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

List:       koffice-devel
Subject:    [PATCH] KPresenter's <HELPLINES>
From:       Nicolas Goutte <nicog () snafu ! de>
Date:       2002-06-30 20:19:40
[Download RAW message or body]

The attached patch is for the directory kpresenter.

Currently in KPresenter, the help lines are saved liked:
<HELPLINES>
  <HELPLINES/>
</HELPLINES>

As I do not see a good reason for the second element and as such a structure 
cannot be described precisely in a DTD, I have made the patch that uses only 
one <HELPLINES> element.

Have a nice day/evening/night!
["patch.txt" (text/plain)]

Index: kpresenter_doc.cc
===================================================================
RCS file: /home/kde/koffice/kpresenter/kpresenter_doc.cc,v
retrieving revision 1.560
diff -u -r1.560 kpresenter_doc.cc
--- kpresenter_doc.cc	2002/06/29 09:41:05	1.560
+++ kpresenter_doc.cc	2002/06/30 20:16:28
@@ -543,7 +543,7 @@
 
     element=doc.createElement("HELPLINES");
     element.setAttribute("show", static_cast<int>( showHelplines() ));
-    element.appendChild( saveHelpLines( doc ));
+    saveHelpLines( doc, element );
     presenter.appendChild(element);
 
     if ( saveOnlyPage == -1 )
@@ -3021,7 +3021,11 @@
 
 void KPresenterDoc::loadHelpLines( const QDomElement &element )
 {
+    // In KPresenter 1.1, there is child also naed <HELPLINES>
     QDomElement helplines=element.namedItem("HELPLINES").toElement();
+    if (helplines.isNull())
+        helplines=element;
+
     helplines=helplines.firstChild().toElement();
     while ( !helplines.isNull() ) {
         if ( helplines.tagName()=="Vertical" )
@@ -3041,9 +3045,20 @@
 
 }
 
-QDomElement KPresenterDoc::saveHelpLines( QDomDocument &doc )
+void KPresenterDoc::saveHelpLines( QDomDocument &doc, QDomElement& element )
 {
-    QDomElement helplines=doc.createElement("HELPLINES");
+    QDomElement helplines;
+
+    if (specialOutputFlag()==SaveAsKOffice1dot1)
+    {
+        // In KPresenter 1.1, <HELPLINES> is the child of another <HELPLINES> \
element +        helplines=doc.createElement("HELPLINES");
+    }
+    else
+    {
+        // In KPresenter 1,2, we write everything in the parent <HELPLINES> element
+        helplines=element;
+    }
 
     for(QValueList<double>::Iterator it = m_vertHelplines.begin(); it != \
m_vertHelplines.end(); ++it)  {
Index: kpresenter_doc.h
===================================================================
RCS file: /home/kde/koffice/kpresenter/kpresenter_doc.h,v
retrieving revision 1.288
diff -u -r1.288 kpresenter_doc.h
--- kpresenter_doc.h	2002/06/29 09:41:05	1.288
+++ kpresenter_doc.h	2002/06/30 20:16:32
@@ -458,7 +458,7 @@
     QDomElement saveUsedSoundFileToXML( QDomDocument &_doc, QStringList _list );
     void loadTextStyle( const QDomElement& domElement );
     void saveEmbeddedObject(KPrPage *page, KoDocumentChild *chl,QDomDocument \
                &doc,QDomElement &presenter, double offset );
-    QDomElement saveHelpLines( QDomDocument &doc );
+    void saveHelpLines( QDomDocument &doc, QDomElement& element );
 
     void loadBackground( const QDomElement &element );
     void loadHelpLines( const QDomElement &element );


_______________________________________________
koffice-devel mailing list
koffice-devel@mail.kde.org
http://mail.kde.org/mailman/listinfo/koffice-devel

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

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