Commit e9840ada authored by Thorsten Zachmann's avatar Thorsten Zachmann

o more style consolidation use the new methods for testing styles

  writing.

svn path=/trunk/koffice/; revision=723042
parent 3c31a49f
......@@ -43,7 +43,6 @@
#include "KoPAPage.h"
#include "KoPAMasterPage.h"
#include "KoPASavingContext.h"
#include "KoPAStyles.h"
#include "KoPALoadingContext.h"
#include <kdebug.h>
......@@ -177,9 +176,7 @@ bool KoPADocument::saveOasis( KoStore* store, KoXmlWriter* manifestWriter )
bodyWriter->endElement(); // office:odfTagName()
bodyWriter->endElement(); // office:body
contentWriter->startElement( "office:automatic-styles" );
saveOdfAutomaticStyles( *contentWriter, mainStyles, false );
contentWriter->endElement();
mainStyles.saveOdfAutomaticStyles( contentWriter, false );
oasisStore.closeContentWriter();
......@@ -208,7 +205,7 @@ void KoPADocument::saveOdfAutomaticStyles( KoXmlWriter& contentWriter, KoGenStyl
( *it ).style->writeStyle( &contentWriter, mainStyles, "style:style", ( *it ).name , "style:graphic-properties" );
}
styles = mainStyles.styles( KoPAStyles::STYLE_PAGE, stylesDotXml );
styles = mainStyles.styles( KoGenStyle::StyleDrawingPage, stylesDotXml );
it = styles.begin();
for ( ; it != styles.end() ; ++it ) {
//qDebug() << "style:style" << ( *it ).name;
......@@ -229,6 +226,10 @@ void KoPADocument::saveOdfDocumentStyles( KoStore * store, KoShapeSavingContext
KoXmlWriter* stylesWriter = createOasisXmlWriter( &stylesDev, "office:document-styles" );
KoGenStyles & mainStyles = context.mainStyles();
#if 1
mainStyles.saveOdfDocumentStyles( stylesWriter );
mainStyles.saveOdfAutomaticStyles( stylesWriter, true );
#else
stylesWriter->startElement( "office:styles" );
KoShapeStyleWriter styleHandler( context );
......@@ -239,6 +240,7 @@ void KoPADocument::saveOdfDocumentStyles( KoStore * store, KoShapeSavingContext
stylesWriter->startElement( "office:automatic-styles" );
saveOdfAutomaticStyles( *stylesWriter, mainStyles, true );
stylesWriter->endElement(); // office:automatic-styles
#endif
stylesWriter->addCompleteElement( masterStyles );
......
......@@ -19,7 +19,6 @@
#include "KoPAPageBase.h"
#include "KoPASavingContext.h"
#include "KoPAStyles.h"
#include "KoPALoadingContext.h"
#include <QDebug>
......@@ -105,7 +104,7 @@ void KoPAPageBase::saveOdfShapes( KoShapeSavingContext &context ) const
QString KoPAPageBase::saveOdfPageStyle( KoPASavingContext &paContext ) const
{
KoGenStyle style( KoPAStyles::STYLE_PAGE, "drawing-page" );
KoGenStyle style( KoGenStyle::StyleDrawingPage, "drawing-page" );
if ( paContext.isSet( KoShapeSavingContext::AutoStyleInStyleXml ) ) {
style.setAutoStyleInStylesDotXml( true );
......
/* This file is part of the KDE project
Copyright (C) 2007 Thorsten Zachmann <zachmann@kde.org>
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
You should have received a copy of the GNU Library General Public License
along with this library; see the file COPYING.LIB. If not, write to
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
* Boston, MA 02110-1301, USA.
*/
#ifndef KOPASTYLES_H
#define KOPASTYLES_H
#include <KoGenStyle.h>
/**
* This namespace contains style types needed for kopageapp
*/
namespace KoPAStyles
{
enum {
STYLE_PAGE = KoGenStyle::StyleFirstCustom /// style for drawing-page see ODF 14.13.2 Drawing Page Style
};
}
#endif // KOPASTYLES_H
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