Bug 132357 - Opening-/closing-tag update does not work properly
Summary: Opening-/closing-tag update does not work properly
Status: RESOLVED FIXED
Alias: None
Product: quanta
Classification: Unmaintained
Component: general (show other bugs)
Version: unspecified
Platform: openSUSE Linux
: NOR normal
Target Milestone: ---
Assignee: András Manţia
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-08-13 20:36 UTC by twerner
Modified: 2006-09-08 15:21 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description twerner 2006-08-13 20:36:12 UTC
Version:           3.5.4 (using KDE KDE 3.5.1)
Installed from:    SuSE RPMs
OS:                Linux

Given following XML-excerpt:

        <entry id="color" label="%color" type="selection">
            <selection type="dropdown">
                <entry label="%brown" value="%brown"/>
                <entry label="%green" value="%green"/>
            </selection>
        </entry>

I experience following problem with "opening/closing tag update" turned on:

I try to change the code above into:

        <entry id="color" label="%color" type="selection">
            <selection type="dropdown">
                <option label="%brown" value="%brown"/>
                <option label="%green" value="%green"/>
            </selection>
        </entry>

After saving the file, Quanta decides to apply following change

        <entry id="color" label="%color" type="selection">
            <selection type="dropdown">
                <option label="%brown" value="%brown"/>
                <option label="%green" value="%green"/>
            </selection>
        </option>

It does not seem to recognize the tag nesting properly.
Comment 1 András Manţia 2006-09-08 15:21:43 UTC
SVN commit 582175 by amantia:

Fix automatic updating of closing tags (don't search for the closing tag for single tags). 

BUG: 132357

 M  +1 -0      ChangeLog  
 M  +6 -4      src/document.cpp  


--- branches/KDE/3.5/kdewebdev/quanta/ChangeLog #582174:582175
@@ -17,6 +17,7 @@
       - respect the order of items in the .docrc [#133704]
       - fix crash when creating project through slow links [#133705]
       - really abort if a remote directory cannot be created [#117032]
+      - fix automatic updating of closing tags [#132357]
 
 
 Version 3.5.4 (Release date: 02-08-2006; Started 24-06-2005):
--- branches/KDE/3.5/kdewebdev/quanta/src/document.cpp #582174:582175
@@ -2296,7 +2296,9 @@
       viewCursorIf->cursorPositionReal(&line, &column);
       node = parser->nodeAt(line, column, false);
       if (node &&
-          (node->tag->type==Tag::XmlTag || node->tag->type == Tag::XmlTagEnd) )
+          ((node->tag->type == Tag::XmlTag && !node->tag->single) ||
+            node->tag->type == Tag::XmlTagEnd)
+           )
       {
         Tag *tag;
         tag = new Tag(*node->tag);
@@ -2322,7 +2324,7 @@
       node = parser->nodeAt(line, column, false);
       if (node &&
           node->tag->nameSpace + node->tag->name != currentNode->tag->nameSpace + currentNode->tag->name &&
-          (node->tag->type == Tag::XmlTag || node->tag->type == Tag::XmlTagEnd) && node->tag->validXMLTag)
+          ((node->tag->type == Tag::XmlTag && !node->tag->single) || node->tag->type == Tag::XmlTagEnd) && node->tag->validXMLTag)
       {
         int bl, bc, bl2, bc2;
         node->tag->beginPos(bl, bc);
@@ -2339,7 +2341,7 @@
           previousNode = 0L;
         }
         if (bl == bl2 && bc == bc2 &&
-           (currentNode->tag->type == Tag::XmlTag || currentNode->tag->type == Tag::XmlTagEnd))
+           ((node->tag->type == Tag::XmlTag && !node->tag->single) || currentNode->tag->type == Tag::XmlTagEnd))
         {
           QString newName = node->tag->name;
           bool updateClosing = (currentNode->tag->type == Tag::XmlTag) && !newName.startsWith("!");
@@ -2352,7 +2354,7 @@
             node = node->previousSibling();
           while (node)
           {
-            if (node->tag->validXMLTag && (node->tag->type == Tag::XmlTag || node->tag->type == Tag::XmlTagEnd))
+            if (node->tag->validXMLTag && ((node->tag->type == Tag::XmlTag && !node->tag->single) || node->tag->type == Tag::XmlTagEnd))
             {
               if (node->tag->nameSpace + node->tag->name == currentNode->tag->nameSpace + currentNode->tag->name )
               {