Commit c97e6199 authored by Thorsten Zachmann's avatar Thorsten Zachmann

o I missed to commit these in my last commit

svn path=/trunk/koffice/; revision=729921
parent 5fa9f8f9
......@@ -25,7 +25,6 @@
#include <KoXmlReader.h>
#include <KoOasisStyles.h>
#include <KoOasisStore.h>
#include <KoSavingContext.h>
#include <KoOasisLoadingContext.h>
#include <KoShapeManager.h>
#include <KoShapeLayer.h>
......@@ -137,7 +136,9 @@ bool KoPADocument::saveOasis( KoStore* store, KoXmlWriter* manifestWriter )
KoGenStyles mainStyles;
KoXmlWriter * bodyWriter = oasisStore.bodyWriter();
if ( !saveOasisPages( bodyWriter, mainStyles, m_pages, m_masterPages ) ) {
KoPASavingContext paContext( *bodyWriter, mainStyles, 1, KoShapeSavingContext::Store );
if ( !saveOasisPages( paContext, m_pages, m_masterPages ) ) {
return false;
}
......@@ -151,35 +152,29 @@ bool KoPADocument::saveOasis( KoStore* store, KoXmlWriter* manifestWriter )
return mainStyles.saveOdfStylesDotXml( store, manifestWriter );
}
bool KoPADocument::saveOasisPages( KoXmlWriter* bodyWriter, KoGenStyles &mainStyles,
QList<KoPAPageBase *> &pages, QList<KoPAPageBase *> &masterPages )
bool KoPADocument::saveOasisPages( KoPASavingContext &paContext, QList<KoPAPageBase *> &pages, QList<KoPAPageBase *> &masterPages )
{
KoSavingContext savingContext( mainStyles, KoSavingContext::Store );
KoPASavingContext paContext( *bodyWriter, savingContext, 1 );
paContext.setOptions( KoPASavingContext::DrawId | KoPASavingContext::AutoStyleInStyleXml );
// save master pages
foreach( KoPAPageBase *page, masterPages )
{
foreach( KoPAPageBase *page, masterPages ) {
page->saveOdf( paContext );
}
bodyWriter->startElement( "office:body" );
bodyWriter->startElement( odfTagName( true ) );
KoXmlWriter & bodyWriter = paContext.xmlWriter();
bodyWriter.startElement( "office:body" );
bodyWriter.startElement( odfTagName( true ) );
paContext.setXmlWriter( *bodyWriter );
paContext.setOptions( KoPASavingContext::DrawId );
// save pages
foreach ( KoPAPageBase *page, pages )
{
foreach ( KoPAPageBase *page, pages ) {
page->saveOdf( paContext );
paContext.incrementPage();
}
bodyWriter->endElement(); // office:odfTagName()
bodyWriter->endElement(); // office:body
bodyWriter.endElement(); // office:odfTagName()
bodyWriter.endElement(); // office:body
return true;
}
......
......@@ -31,6 +31,7 @@ class KoShapeSavingContext;
class KoPAPage;
class KoPAPageBase;
class KoPAMasterPage;
class KoPASavingContext;
class KoInlineTextObjectManager;
......@@ -58,8 +59,7 @@ public:
*
* For all pages that are specified also the master slide has to be specified.
*/
bool saveOasisPages( KoXmlWriter* bodyWriter, KoGenStyles &mainStyles,
QList<KoPAPageBase *> &pages, QList<KoPAPageBase *> &masterPages );
bool saveOasisPages( KoPASavingContext & paContext, QList<KoPAPageBase *> &pages, QList<KoPAPageBase *> &masterPages );
/**
* Get page by index.
......
......@@ -21,9 +21,9 @@
#include <QPixmap>
KoPASavingContext::KoPASavingContext( KoXmlWriter &xmlWriter, KoSavingContext &context, int page )
: KoShapeSavingContext( xmlWriter, context )
, m_page( page )
KoPASavingContext::KoPASavingContext( KoXmlWriter &xmlWriter, KoGenStyles& mainStyles, int page, SavingMode savingMode )
: KoShapeSavingContext( xmlWriter, mainStyles, savingMode )
, m_page( page )
{
}
......
......@@ -42,8 +42,8 @@ public:
* @param context the saving context
* @param page the starting page number
*/
KoPASavingContext( KoXmlWriter &xmlWriter, KoSavingContext &context, int page );
KoPASavingContext( KoXmlWriter &xmlWriter, KoGenStyles& mainStyles, int page, SavingMode savingMode = Store ); //TODO default
/**
* @brief Destructor
*/
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment