<?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>80605</bug_id>
          
          <creation_ts>2004-04-29 11:51:20 +0000</creation_ts>
          <short_desc>css autocompletion style tag</short_desc>
          <delta_ts>2006-09-09 12:21:58 +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>3.2.2</version>
          <rep_platform>unspecified</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>wishlist</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="arne anka">kde-bugs</reporter>
          <assigned_to name="András Manţia">amantia</assigned_to>
          
          
          <cf_commitlink></cf_commitlink>
          <cf_versionfixedin></cf_versionfixedin>
          <cf_sentryurl></cf_sentryurl>
          <votes>30</votes>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>227556</commentid>
    <comment_count>0</comment_count>
    <who name="arne anka">kde-bugs</who>
    <bug_when>2004-04-29 11:51:20 +0000</bug_when>
    <thetext>Version:           3.2.2 (using KDE 3.2.2,  (testing/unstable))
Compiler:          gcc version 3.3.3 (Debian 20040401)
OS:          Linux (i686) release 2.6.5

auto-completion of tags for css works inside 
&lt;style&gt;
 .foo {}
&lt;/style&gt;
but not inside
&lt;foo style=&quot;&quot;&gt;
would be nice to hve it there too ...</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>468250</commentid>
    <comment_count>1</comment_count>
    <who name="András Manţia">amantia</who>
    <bug_when>2006-09-09 12:21:57 +0000</bug_when>
    <thetext>SVN commit 582414 by amantia:

Make CSS completion work inside style attributes.

BUG: 80605

 M  +3 -0      ChangeLog  
 M  +2 -2      quanta.kdevelop  
 M  +47 -10    src/document.cpp  


--- branches/KDE/3.5/kdewebdev/quanta/ChangeLog #582413:582414
@@ -20,7 +20,10 @@
       - fix automatic updating of closing tags [#132357]
       - accept float numbers for length values [#130295]
 
+ - improvements:
+      - make CSS completion work inside style attributes [#80605]
 
+
 Version 3.5.4 (Release date: 02-08-2006; Started 24-06-2005):
  - bugfixes:
       - make Open File in context menu work for remote projects as well
--- branches/KDE/3.5/kdewebdev/quanta/quanta.kdevelop #582413:582414
@@ -245,10 +245,10 @@
   &lt;/kdevcvs&gt;
   &lt;kdevfilecreate&gt;
     &lt;filetypes&gt;
-      &lt;type icon=&quot;&quot; ext=&quot;h&quot; create=&quot;template&quot; name=&quot;C++ header&quot; &gt;
+      &lt;type icon=&quot;&quot; ext=&quot;h&quot; name=&quot;C++ header&quot; create=&quot;template&quot; &gt;
         &lt;descr&gt;Quanta speicfic header&lt;/descr&gt;
       &lt;/type&gt;
-      &lt;type icon=&quot;source_cpp&quot; ext=&quot;cpp&quot; create=&quot;template&quot; name=&quot;C++ source&quot; &gt;
+      &lt;type icon=&quot;source_cpp&quot; ext=&quot;cpp&quot; name=&quot;C++ source&quot; create=&quot;template&quot; &gt;
         &lt;descr&gt;A new empty C++ file.&lt;/descr&gt;
       &lt;/type&gt;
     &lt;/filetypes&gt;
--- branches/KDE/3.5/kdewebdev/quanta/src/document.cpp #582413:582414
@@ -1050,17 +1050,46 @@
          }
     else if ( string[0] == qConfig.attrValueQuotation )
           {
-          //we need to find the attribute name
-          QString textLine = editIf-&gt;textLine(line).left(column-1);
-          QString attribute = textLine.mid(textLine.findRev(&apos; &apos;)+1);
-          showCodeCompletions( getAttributeValueCompletions(tagName, attribute) );
-          handled = true;
+            //we need to find the attribute name
+            QString textLine = editIf-&gt;textLine(line).left(column-1);
+            QString attribute = textLine.mid(textLine.findRev(&apos; &apos;)+1);
+            if (attribute == &quot;style&quot; &amp;&amp; completionDTD-&gt;insideDTDs.contains(&quot;css&quot;))
+            {
+              completionDTD = DTDs::ref()-&gt;find(&quot;text/css&quot;);
+              completionRequested = true;
+              return scriptAutoCompletion(line, column + 1, string);
+            }
+            showCodeCompletions( getAttributeValueCompletions(tagName, attribute) );
+            handled = true;
           }
   } // else - we are inside of a tag
   if (!handled)
   {
+    //check if we are inside a style attribute, and use css autocompletion if we are
+    QString textLine = editIf-&gt;textLine(line);
+    textLine = textLine.left(column);
+    int pos = textLine.findRev(&apos;&quot;&apos;);
+    if (pos != -1)
+    {
+      pos = textLine.findRev(&apos; &apos;, pos);
+      if (pos != -1)
+      {
+        textLine = textLine.mid(pos + 1);
+        pos = textLine.find(&apos;=&apos;);
+        if (pos != -1)
+        {
+          QString attribute = textLine.left(pos);
+          if (attribute == &quot;style&quot; &amp;&amp; completionDTD-&gt;insideDTDs.contains(&quot;css&quot;))
+          {
+            completionDTD = DTDs::ref()-&gt;find(&quot;text/css&quot;);
+            completionRequested = true;
+            return scriptAutoCompletion(line, column + 1, string);
+          }
+        }
+      }
+    }
     QString s = editIf-&gt;textLine(line).left(column + 1);
-    int pos = s.findRev(&apos;&amp;&apos;);
+    pos = s.findRev(&apos;&amp;&apos;);
     if (pos != -1)
     {
       //complete character codes
@@ -2064,10 +2093,18 @@
       index = tag-&gt;valueIndexAtPos(line,col);
       if (index != -1)      //inside a value
       {
-        tag-&gt;attributeValuePos(index, bLine, bCol);
-        s = tag-&gt;attributeValue(index).left(col - bCol);
-        showCodeCompletions( getAttributeValueCompletions(tagName, tag-&gt;attribute(index), s) );
-        handled = true;
+        s = tag-&gt;attribute(index);
+        if (s == &quot;style&quot; &amp;&amp; completionDTD-&gt;insideDTDs.contains(&quot;css&quot;))
+        {
+          completionDTD = DTDs::ref()-&gt;find(&quot;text/css&quot;);
+          return scriptAutoCompletion(line, col, &quot;&quot;);
+        } else
+        {
+          tag-&gt;attributeValuePos(index, bLine, bCol);
+          s = tag-&gt;attributeValue(index).left(col - bCol);
+          showCodeCompletions( getAttributeValueCompletions(tagName, tag-&gt;attribute(index), s) );
+          handled = true;
+        }
       } else
       {
         index = tag-&gt;attributeIndexAtPos(line,col);
</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>