[prev in list] [next in list] [prev in thread] [next in thread]
List: koffice-devel
Subject: [PATCH] OOWriter import: <COUNTER>
From: Nicolas Goutte <nicolasg () snafu ! de>
Date: 2003-11-18 21:43:38
[Download RAW message or body]
The attached patch is for koffice/filters/kword/oowriter/oowriterimport.cc
The patch puts the <COUNTER> element as child of <LAYOUT> (as KWord needs)
instead as child of <PARAGRAPH> (as KPresenter seems to do.) The patch is
*not* tested.
(The change from int to uint of maxColumns is a small change to avoid a gcc
warning (signed/unsigned compare.))
Have a nice day!
["patch_oow_counter.diff" (text/x-diff)]
Index: oowriterimport.cc
===================================================================
RCS file: /home/kde/koffice/filters/kword/oowriter/oowriterimport.cc,v
retrieving revision 1.55
diff -u -p -r1.55 oowriterimport.cc
--- oowriterimport.cc 17 Nov 2003 00:45:55 -0000 1.55
+++ oowriterimport.cc 18 Nov 2003 21:21:14 -0000
@@ -637,15 +637,14 @@ QDomDocumentFragment OoWriterImport::par
for ( QDomNode n = list.firstChild(); !n.isNull(); n = n.nextSibling() )
{
e = n.firstChild().toElement();
- QString name = e.tagName();
- //kdDebug(30518) << k_funcinfo << "Got tag: " << name << endl;
+ //kdDebug(30518) << k_funcinfo << "Got tag: " << e.tagName() << endl;
// parse the list-properties
fillStyleStack( e );
QDomElement p = parseParagraph( doc, e );
- QDomElement counter = doc.createElement( "COUNTER" ); // should be under \
<LAYOUT> + QDomElement counter = doc.createElement( "COUNTER" );
counter.setAttribute( "numberingtype", 0 );
counter.setAttribute( "depth", 0 );
@@ -658,10 +657,11 @@ QDomDocumentFragment OoWriterImport::par
else
counter.setAttribute( "type", 10 ); // a disc bullet
- // Don't 'appendChild()'! Text elements have to be the last children of the
- // paragraph element otherwise kpresenter will cut off the last character of
- // every item!
- p.insertBefore( counter, QDomNode() );
+ QDomElement layout (p.namedItem("LAYOUT").toElement());
+ if (layout.isNull())
+ kdWarning(30518) << "Cannot find <LAYOUT> in KWord paragraph." << endl;
+ else
+ p.appendChild(counter);
fragment.appendChild(p);
listCounter++;
@@ -1464,7 +1464,7 @@ void OoWriterImport::parseTable( QDomDoc
// Left position of the cell/column (similar to RTF's \cellx). The last one \
defined is the right position of the last cell/column QMemArray<double> \
columnLefts(4);
- int maxColumns=columnLefts.size();
+ uint maxColumns=columnLefts.size();
uint col=0;
columnLefts[0]=0.0; // Initialize left of first cell
_______________________________________________
koffice-devel mailing list
koffice-devel@mail.kde.org
https://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