[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    kdewebdev/quanta/src
From:       Andras Mantia <amantia () kde ! org>
Date:       2005-02-21 20:27:56
Message-ID: 20050221202756.F1E462226 () office ! kde ! org
[Download RAW message or body]

CVS commit by amantia: 

Add back something that was present in Quanta 2/3.1: editing XML tags inside PHP with \
the tag editor. Of course it will not work correctly when the tag is constructed in a \
complex way, but works for cases like  echo "<a href=\"$variable\">"


  M +30 -0     quanta.cpp   1.709


--- kdewebdev/quanta/src/quanta.cpp  #1.708:1.709
@@ -4129,4 +4129,34 @@ void QuantaApp::slotEditCurrentTag()
     }
   }
+  if (isUnknown)
+  {
+    const DTDStruct *dtd = w->defaultDTD();
+    if (dtd->family == Xml)
+    {
+      QString currentLine = w->editIf->textLine(line);
+      int sPos = currentLine.findRev('<', col);
+      if (sPos != -1)
+      {
+        int ePos = currentLine.find('>', col);
+        if (ePos != -1)
+        {
+          AreaStruct area(line, sPos, line, ePos);          
+          Tag *tag = new Tag(area, w, dtd, true);  
+          if ( QuantaCommon::isKnownTag(dtd->name, tag->name) )
+          {
+            isUnknown = false;
+            QString selection(w->selectionIf->selection());
+            TagDialog *dlg = new TagDialog( QuantaCommon::tagFromDTD(dtd, \
tag->name), tag, selection, ViewManager::ref()->activeView()->baseURL() ); +          \
if (dlg->exec()) +            {
+              w->changeTag(tag, dlg->getAttributes() );
+            }
+            delete dlg;
+          }
+          delete tag;
+        }
+      }
+    }
+  }
   typingInProgress = false;
   slotEnableIdleTimer(true);


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic