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

List:       koffice-devel
Subject:    Re: question about autoCreateNewFrame
From:       David Faure <david () mandrakesoft ! com>
Date:       2002-04-30 12:47:12
[Download RAW message or body]

On Tuesday 30 April 2002 14:27, Holger Schröder wrote:
> Hi,
> 
> i am still working on the kword->openwriter filter. i have the problem, 
> that the ow xml does not know about AutoCreateNewFrame, like kw.
> in kw the a frameset is only created for the first page it appears, and 
> then it is implicitly created on the following pages, as many pages as 
> are needed to contain the whole text.
> now the problem is atm i have to guess, how many pages a given text will 
> need. i think it is wrong design, if my filter would have to do some 
> kind of "font metrics calculation", so i would like to hace a 
> numberOfPages attribute to the FRAME or FRAMESET element, which 
> contains this number of pages actually needed to contain the whole 
> text.
> it would belong to frame, but when i write a text needing more than one 
> page, on the second page there is not only created the first frame, but 
> already all frames, so it would also fit into frameset...
> 
> so how do the other filters handle this ?
> did i miss something?
> is this hard to implement / can somebody do this quickly ? ;-)

Interesting that this didn't pop up before indeed.
I see hmm, 3 solutions.
* Using the FRAME tags to know how many frames the frameset needs - this
will give you the number of pages directly, no ?
You don't need to do any fontmetrics calculation, however you might have
to use a calculation like (int)( frame->y / doc->ptPaperHeight ) to know on
which page a given frame is.

* Saving the total number of pages - might not be a bad idea in all cases,
e.g. for the document information plugin (properties dialog) etc.
--- kwdoc.cc    2002/04/26 14:36:34     1.389
+++ kwdoc.cc    2002/04/30 12:39:48
@@ -1871,6 +1871,7 @@ QDomDocument KWDocument::saveXML()
     QDomElement paper = doc.createElement( "PAPER" );
     kwdoc.appendChild( paper );
     paper.setAttribute( "format", static_cast<int>( m_pageLayout.format ) );
+    paper.setAttribute( "pages", m_pages );
     paper.setAttribute( "width", m_pageLayout.ptWidth );
     paper.setAttribute( "height", m_pageLayout.ptHeight );
     paper.setAttribute( "orientation", static_cast<int>( m_pageLayout.orientation ) );

* Saving the number of pages needed by each frameset, as you suggested.
But AFAICS this can be easily determined from the actual frame coordinates,
see first point.

-- 
David FAURE, david@mandrakesoft.com, faure@kde.org
http://people.mandrakesoft.com/~david/
Contributing to: http://www.konqueror.org/, http://www.koffice.org/
KDE, Making The Future of Computing Available Today


_______________________________________________
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