<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugs.kde.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.6"
          urlbase="https://bugs.kde.org/"
          
          maintainer="sysadmin@kde.org"
>

    <bug>
          <bug_id>132357</bug_id>
          
          <creation_ts>2006-08-13 20:36:12 +0000</creation_ts>
          <short_desc>Opening-/closing-tag update does not work properly</short_desc>
          <delta_ts>2006-09-08 15:21:44 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>10</classification_id>
          <classification>Unmaintained</classification>
          <product>quanta</product>
          <component>general</component>
          <version>unspecified</version>
          <rep_platform>openSUSE</rep_platform>
          <op_sys>Linux</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>NOR</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>0</everconfirmed>
          <reporter>twerner</reporter>
          <assigned_to name="András Manţia">amantia</assigned_to>
          
          
          <cf_commitlink></cf_commitlink>
          <cf_versionfixedin></cf_versionfixedin>
          <cf_sentryurl></cf_sentryurl>
          <votes>0</votes>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>460255</commentid>
    <comment_count>0</comment_count>
    <who name="">twerner</who>
    <bug_when>2006-08-13 20:36:12 +0000</bug_when>
    <thetext>Version:           3.5.4 (using KDE KDE 3.5.1)
Installed from:    SuSE RPMs
OS:                Linux

Given following XML-excerpt:

        &lt;entry id=&quot;color&quot; label=&quot;%color&quot; type=&quot;selection&quot;&gt;
            &lt;selection type=&quot;dropdown&quot;&gt;
                &lt;entry label=&quot;%brown&quot; value=&quot;%brown&quot;/&gt;
                &lt;entry label=&quot;%green&quot; value=&quot;%green&quot;/&gt;
            &lt;/selection&gt;
        &lt;/entry&gt;

I experience following problem with &quot;opening/closing tag update&quot; turned on:

I try to change the code above into:

        &lt;entry id=&quot;color&quot; label=&quot;%color&quot; type=&quot;selection&quot;&gt;
            &lt;selection type=&quot;dropdown&quot;&gt;
                &lt;option label=&quot;%brown&quot; value=&quot;%brown&quot;/&gt;
                &lt;option label=&quot;%green&quot; value=&quot;%green&quot;/&gt;
            &lt;/selection&gt;
        &lt;/entry&gt;

After saving the file, Quanta decides to apply following change

        &lt;entry id=&quot;color&quot; label=&quot;%color&quot; type=&quot;selection&quot;&gt;
            &lt;selection type=&quot;dropdown&quot;&gt;
                &lt;option label=&quot;%brown&quot; value=&quot;%brown&quot;/&gt;
                &lt;option label=&quot;%green&quot; value=&quot;%green&quot;/&gt;
            &lt;/selection&gt;
        &lt;/option&gt;

It does not seem to recognize the tag nesting properly.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>467923</commentid>
    <comment_count>1</comment_count>
    <who name="András Manţia">amantia</who>
    <bug_when>2006-09-08 15:21:43 +0000</bug_when>
    <thetext>SVN commit 582175 by amantia:

Fix automatic updating of closing tags (don&apos;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-&gt;cursorPositionReal(&amp;line, &amp;column);
       node = parser-&gt;nodeAt(line, column, false);
       if (node &amp;&amp;
-          (node-&gt;tag-&gt;type==Tag::XmlTag || node-&gt;tag-&gt;type == Tag::XmlTagEnd) )
+          ((node-&gt;tag-&gt;type == Tag::XmlTag &amp;&amp; !node-&gt;tag-&gt;single) ||
+            node-&gt;tag-&gt;type == Tag::XmlTagEnd)
+           )
       {
         Tag *tag;
         tag = new Tag(*node-&gt;tag);
@@ -2322,7 +2324,7 @@
       node = parser-&gt;nodeAt(line, column, false);
       if (node &amp;&amp;
           node-&gt;tag-&gt;nameSpace + node-&gt;tag-&gt;name != currentNode-&gt;tag-&gt;nameSpace + currentNode-&gt;tag-&gt;name &amp;&amp;
-          (node-&gt;tag-&gt;type == Tag::XmlTag || node-&gt;tag-&gt;type == Tag::XmlTagEnd) &amp;&amp; node-&gt;tag-&gt;validXMLTag)
+          ((node-&gt;tag-&gt;type == Tag::XmlTag &amp;&amp; !node-&gt;tag-&gt;single) || node-&gt;tag-&gt;type == Tag::XmlTagEnd) &amp;&amp; node-&gt;tag-&gt;validXMLTag)
       {
         int bl, bc, bl2, bc2;
         node-&gt;tag-&gt;beginPos(bl, bc);
@@ -2339,7 +2341,7 @@
           previousNode = 0L;
         }
         if (bl == bl2 &amp;&amp; bc == bc2 &amp;&amp;
-           (currentNode-&gt;tag-&gt;type == Tag::XmlTag || currentNode-&gt;tag-&gt;type == Tag::XmlTagEnd))
+           ((node-&gt;tag-&gt;type == Tag::XmlTag &amp;&amp; !node-&gt;tag-&gt;single) || currentNode-&gt;tag-&gt;type == Tag::XmlTagEnd))
         {
           QString newName = node-&gt;tag-&gt;name;
           bool updateClosing = (currentNode-&gt;tag-&gt;type == Tag::XmlTag) &amp;&amp; !newName.startsWith(&quot;!&quot;);
@@ -2352,7 +2354,7 @@
             node = node-&gt;previousSibling();
           while (node)
           {
-            if (node-&gt;tag-&gt;validXMLTag &amp;&amp; (node-&gt;tag-&gt;type == Tag::XmlTag || node-&gt;tag-&gt;type == Tag::XmlTagEnd))
+            if (node-&gt;tag-&gt;validXMLTag &amp;&amp; ((node-&gt;tag-&gt;type == Tag::XmlTag &amp;&amp; !node-&gt;tag-&gt;single) || node-&gt;tag-&gt;type == Tag::XmlTagEnd))
             {
               if (node-&gt;tag-&gt;nameSpace + node-&gt;tag-&gt;name == currentNode-&gt;tag-&gt;nameSpace + currentNode-&gt;tag-&gt;name )
               {
</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>