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

List:       kde-commits
Subject:    kdelibs/kdeui
From:       Pascal Létourneau <pletourn () globetrotter ! net>
Date:       2003-07-31 20:28:49
[Download RAW message or body]

CVS commit by pletourn: 

Since <WeakSeparator/> are not shown in kedittoolbar,
you have to jump over them when moving an action in the DOM tree.
Also, two small simplifications.


  M +10 -4     kedittoolbar.cpp   1.80


--- kdelibs/kdeui/kedittoolbar.cpp  #1.79:1.80
@@ -423,5 +423,5 @@ bool KEditToolbarWidget::save()
       continue;
 
-    dump_xml((*it).m_document.toDocument());
+    dump_xml((*it).m_document);
 
     // if we got this far, we might as well just save it
@@ -786,5 +786,5 @@ void KEditToolbarWidget::slotToolbarSele
 
         if ((*xit).m_type == XmlData::Part || (*xit).m_type == XmlData::Shell)
-          setXML(KXMLGUIFactory::documentToXML((*xit).m_document.toDocument()));
+          setDOMDocument( (*xit).m_document );
         return;
       }
@@ -962,5 +962,8 @@ void KEditToolbarWidget::slotUpButton()
 
       // and do the real move in the DOM
-      d->m_currentToolbarElem.insertBefore(elem, elem.previousSibling());
+      QDomNode prev = elem.previousSibling();
+      while ( prev.toElement().tagName() == QString( "WeakSeparator" ) )
+        prev = prev.previousSibling();
+      d->m_currentToolbarElem.insertBefore(elem, prev);
 
       // and set this container as a noMerge
@@ -1019,5 +1022,8 @@ void KEditToolbarWidget::slotDownButton(
 
       // and do the real move in the DOM
-      d->m_currentToolbarElem.insertAfter(elem, elem.nextSibling());
+      QDomNode next = elem.nextSibling();
+      while ( next.toElement().tagName() == QString( "WeakSeparator" ) )
+        next = next.nextSibling();
+      d->m_currentToolbarElem.insertAfter(elem, next);
 
       // and set this container as a noMerge


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

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