Commit 7afe0587 authored by Thorsten Zachmann's avatar Thorsten Zachmann

o write office styles, so now also gradient are saved. Thanks to Jan for

  giving the tip what is wrong.

svn path=/trunk/koffice/; revision=708942
parent 0b0b1147
......@@ -30,6 +30,7 @@
#include <KoOasisLoadingContext.h>
#include <KoShapeManager.h>
#include <KoShapeLayer.h>
#include <KoShapeStyleWriter.h>
#include <KoPathShape.h>
#include <KoLineBorder.h>
#include <KoDom.h>
......@@ -214,7 +215,7 @@ bool KoPADocument::saveOasis( KoStore* store, KoXmlWriter* manifestWriter )
return false;
manifestWriter->addManifestEntry( "styles.xml", "text/xml" );
saveOdfDocumentStyles( store, mainStyles, &masterStyles );
saveOdfDocumentStyles( store, paContext, &masterStyles );
if ( !store->close() ) // done with styles.xml
return false;
......@@ -247,12 +248,17 @@ void KoPADocument::saveOdfAutomaticStyles( KoXmlWriter& contentWriter, KoGenStyl
}
}
void KoPADocument::saveOdfDocumentStyles( KoStore * store, KoGenStyles& mainStyles, QFile *masterStyles )
void KoPADocument::saveOdfDocumentStyles( KoStore * store, KoShapeSavingContext & context, QFile *masterStyles )
{
KoStoreDevice stylesDev( store );
KoXmlWriter* stylesWriter = createOasisXmlWriter( &stylesDev, "office:document-styles" );
KoGenStyles & mainStyles = context.mainStyles();
stylesWriter->startElement( "office:styles" );
KoShapeStyleWriter styleHandler( context );
styleHandler.writeOfficeStyles( stylesWriter );
stylesWriter->endElement(); // office:styles
stylesWriter->startElement( "office:automatic-styles" );
......
......@@ -27,6 +27,7 @@
#include "KoPageApp.h"
#include "kopageapp_export.h"
class KoShapeSavingContext;
class KoPAPage;
class KoPAPageBase;
class KoPAMasterPage;
......@@ -125,7 +126,7 @@ protected:
virtual const char *odfTagName( bool withNamespace ) = 0;
void saveOdfAutomaticStyles( KoXmlWriter& contentWriter, KoGenStyles& mainStyles, bool stylesDotXml );
void saveOdfDocumentStyles( KoStore * store, KoGenStyles& mainStyles, QFile *masterStyles );
void saveOdfDocumentStyles( KoStore * store, KoShapeSavingContext& context, QFile *masterStyles );
/**
* This function is called by at the end of addShape. This is used
......
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