Members of the KDE Community are recommended to subscribe to the kde-community mailing list at https://mail.kde.org/mailman/listinfo/kde-community to allow them to participate in important discussions and receive other important announcements

Commit c3d306fb authored by Thorsten Zachmann's avatar Thorsten Zachmann

o rename KoOasisStyles to KoOdfStylesReader

  I hope I did not break anything. If I have done however please send me
  a mail.

svn path=/trunk/koffice/; revision=741247
parent 2e901ae5
...@@ -48,7 +48,7 @@ ...@@ -48,7 +48,7 @@
<UML:DataType stereotype="15470" isSpecification="false" isLeaf="false" visibility="public" namespace="m1" xmi.id="22026" isRoot="false" isAbstract="false" name="KisUndoAdapter&amp;" elementReference="22003" /> <UML:DataType stereotype="15470" isSpecification="false" isLeaf="false" visibility="public" namespace="m1" xmi.id="22026" isRoot="false" isAbstract="false" name="KisUndoAdapter&amp;" elementReference="22003" />
<UML:DataType stereotype="15470" isSpecification="false" isLeaf="false" visibility="public" namespace="m1" xmi.id="22052" isRoot="false" isAbstract="false" name="KoStore*" elementReference="22051" /> <UML:DataType stereotype="15470" isSpecification="false" isLeaf="false" visibility="public" namespace="m1" xmi.id="22052" isRoot="false" isAbstract="false" name="KoStore*" elementReference="22051" />
<UML:DataType stereotype="15470" isSpecification="false" isLeaf="false" visibility="public" namespace="m1" xmi.id="22058" isRoot="false" isAbstract="false" name="const QDomDocument&amp;" elementReference="22057" /> <UML:DataType stereotype="15470" isSpecification="false" isLeaf="false" visibility="public" namespace="m1" xmi.id="22058" isRoot="false" isAbstract="false" name="const QDomDocument&amp;" elementReference="22057" />
<UML:DataType stereotype="15470" isSpecification="false" isLeaf="false" visibility="public" namespace="m1" xmi.id="22061" isRoot="false" isAbstract="false" name="KoOasisStyles&amp;" elementReference="22060" /> <UML:DataType stereotype="15470" isSpecification="false" isLeaf="false" visibility="public" namespace="m1" xmi.id="22061" isRoot="false" isAbstract="false" name="KoOdfStylesReader&amp;" elementReference="22060" />
<UML:DataType stereotype="15470" isSpecification="false" isLeaf="false" visibility="public" namespace="m1" xmi.id="22068" isRoot="false" isAbstract="false" name="KoXmlWriter*" elementReference="22067" /> <UML:DataType stereotype="15470" isSpecification="false" isLeaf="false" visibility="public" namespace="m1" xmi.id="22068" isRoot="false" isAbstract="false" name="KoXmlWriter*" elementReference="22067" />
<UML:DataType stereotype="15470" isSpecification="false" isLeaf="false" visibility="public" namespace="m1" xmi.id="22074" isRoot="false" isAbstract="false" name="QIODevice*" elementReference="22073" /> <UML:DataType stereotype="15470" isSpecification="false" isLeaf="false" visibility="public" namespace="m1" xmi.id="22074" isRoot="false" isAbstract="false" name="QIODevice*" elementReference="22073" />
<UML:DataType stereotype="15470" isSpecification="false" isLeaf="false" visibility="public" namespace="m1" xmi.id="22083" isRoot="false" isAbstract="false" name="const QPoint&amp;" elementReference="22082" /> <UML:DataType stereotype="15470" isSpecification="false" isLeaf="false" visibility="public" namespace="m1" xmi.id="22083" isRoot="false" isAbstract="false" name="const QPoint&amp;" elementReference="22082" />
...@@ -1134,7 +1134,7 @@ due to an undo or redo action." isSpecification="false" isLeaf="false" visibilit ...@@ -1134,7 +1134,7 @@ due to an undo or redo action." isSpecification="false" isLeaf="false" visibilit
<UML:Class isSpecification="false" isLeaf="false" visibility="public" namespace="m1" xmi.id="22036" isRoot="false" isAbstract="false" name="KoDocument" /> <UML:Class isSpecification="false" isLeaf="false" visibility="public" namespace="m1" xmi.id="22036" isRoot="false" isAbstract="false" name="KoDocument" />
<UML:Class isSpecification="false" isLeaf="false" visibility="public" namespace="m1" xmi.id="22051" isRoot="false" isAbstract="false" name="KoStore" /> <UML:Class isSpecification="false" isLeaf="false" visibility="public" namespace="m1" xmi.id="22051" isRoot="false" isAbstract="false" name="KoStore" />
<UML:Class isSpecification="false" isLeaf="false" visibility="public" namespace="m1" xmi.id="22057" isRoot="false" isAbstract="false" name="QDomDocument" /> <UML:Class isSpecification="false" isLeaf="false" visibility="public" namespace="m1" xmi.id="22057" isRoot="false" isAbstract="false" name="QDomDocument" />
<UML:Class isSpecification="false" isLeaf="false" visibility="public" namespace="m1" xmi.id="22060" isRoot="false" isAbstract="false" name="KoOasisStyles" /> <UML:Class isSpecification="false" isLeaf="false" visibility="public" namespace="m1" xmi.id="22060" isRoot="false" isAbstract="false" name="KoOdfStylesReader" />
<UML:Class isSpecification="false" isLeaf="false" visibility="public" namespace="m1" xmi.id="22067" isRoot="false" isAbstract="false" name="KoXmlWriter" /> <UML:Class isSpecification="false" isLeaf="false" visibility="public" namespace="m1" xmi.id="22067" isRoot="false" isAbstract="false" name="KoXmlWriter" />
<UML:Class isSpecification="false" isLeaf="false" visibility="public" namespace="m1" xmi.id="22073" isRoot="false" isAbstract="false" name="QIODevice" /> <UML:Class isSpecification="false" isLeaf="false" visibility="public" namespace="m1" xmi.id="22073" isRoot="false" isAbstract="false" name="QIODevice" />
<UML:Class isSpecification="false" isLeaf="false" visibility="public" namespace="m1" xmi.id="22078" isRoot="false" isAbstract="false" name="QByteArray" /> <UML:Class isSpecification="false" isLeaf="false" visibility="public" namespace="m1" xmi.id="22078" isRoot="false" isAbstract="false" name="QByteArray" />
......
...@@ -1295,7 +1295,7 @@ pixels in the brush." visibility="public" xmi.id="705" type="virtual KisAlphaMas ...@@ -1295,7 +1295,7 @@ pixels in the brush." visibility="public" xmi.id="705" type="virtual KisAlphaMas
</UML:Operation> </UML:Operation>
<UML:Operation visibility="public" xmi.id="998" type="virtual bool" name="loadOasis" > <UML:Operation visibility="public" xmi.id="998" type="virtual bool" name="loadOasis" >
<UML:Parameter visibility="private" xmi.id="999" value="" type="const QDomDocument &amp;" /> <UML:Parameter visibility="private" xmi.id="999" value="" type="const QDomDocument &amp;" />
<UML:Parameter visibility="private" xmi.id="1000" value="" type="KoOasisStyles &amp;" /> <UML:Parameter visibility="private" xmi.id="1000" value="" type="KoOdfStylesReader &amp;" />
</UML:Operation> </UML:Operation>
<UML:Operation visibility="public" xmi.id="1001" type="virtual bool" name="loadXML" > <UML:Operation visibility="public" xmi.id="1001" type="virtual bool" name="loadXML" >
<UML:Parameter visibility="private" xmi.id="1002" value="" type="QIODevice *" /> <UML:Parameter visibility="private" xmi.id="1002" value="" type="QIODevice *" />
...@@ -43,7 +43,7 @@ ...@@ -43,7 +43,7 @@
#include <KoXmlNS.h> #include <KoXmlNS.h>
#include <KoGenStyle.h> #include <KoGenStyle.h>
#include <KoUnit.h> #include <KoUnit.h>
#include <KoOasisStyles.h> #include <KoOdfStylesReader.h>
#include <KoOdfGraphicStyles.h> #include <KoOdfGraphicStyles.h>
#include <KoOasisLoadingContext.h> #include <KoOasisLoadingContext.h>
...@@ -727,9 +727,9 @@ QBrush KoShape::loadOdfFill( const KoXmlElement & element, KoShapeLoadingContext ...@@ -727,9 +727,9 @@ QBrush KoShape::loadOdfFill( const KoXmlElement & element, KoShapeLoadingContext
KoStyleStack &styleStack = context.koLoadingContext().styleStack(); KoStyleStack &styleStack = context.koLoadingContext().styleStack();
QString fill = getStyleProperty( "fill", element, context ); QString fill = getStyleProperty( "fill", element, context );
if ( fill == "solid" || fill == "hatch" ) if ( fill == "solid" || fill == "hatch" )
return KoOdfGraphicStyles::loadOasisFillStyle( styleStack, fill, context.koLoadingContext().oasisStyles() ); return KoOdfGraphicStyles::loadOasisFillStyle( styleStack, fill, context.koLoadingContext().stylesReader() );
else if( fill == "gradient" ) else if( fill == "gradient" )
return KoOdfGraphicStyles::loadOasisGradientStyle( styleStack, context.koLoadingContext().oasisStyles(), size() ); return KoOdfGraphicStyles::loadOasisGradientStyle( styleStack, context.koLoadingContext().stylesReader(), size() );
else if( fill == "bitmap" ) else if( fill == "bitmap" )
return KoOdfGraphicStyles::loadOasisPatternStyle( styleStack, context.koLoadingContext(), size() ); return KoOdfGraphicStyles::loadOasisPatternStyle( styleStack, context.koLoadingContext(), size() );
...@@ -742,7 +742,7 @@ KoShapeBorderModel * KoShape::loadOdfStroke( const KoXmlElement & element, KoSha ...@@ -742,7 +742,7 @@ KoShapeBorderModel * KoShape::loadOdfStroke( const KoXmlElement & element, KoSha
QString stroke = getStyleProperty( "stroke", element, context ); QString stroke = getStyleProperty( "stroke", element, context );
if( stroke == "solid" || stroke == "dash" ) if( stroke == "solid" || stroke == "dash" )
{ {
QPen pen = KoOdfGraphicStyles::loadOasisStrokeStyle( styleStack, stroke, context.koLoadingContext().oasisStyles() ); QPen pen = KoOdfGraphicStyles::loadOasisStrokeStyle( styleStack, stroke, context.koLoadingContext().stylesReader() );
KoLineBorder * border = new KoLineBorder(); KoLineBorder * border = new KoLineBorder();
border->setLineWidth( pen.widthF() ); border->setLineWidth( pen.widthF() );
......
...@@ -20,7 +20,7 @@ ...@@ -20,7 +20,7 @@
#include <qtest_kde.h> #include <qtest_kde.h>
#include <KoOasisLoadingContext.h> #include <KoOasisLoadingContext.h>
#include <KoOasisStyles.h> #include <KoOdfStylesReader.h>
#include <KoShapeLoadingContext.h> #include <KoShapeLoadingContext.h>
#include <KoPathShapeFactory.h> #include <KoPathShapeFactory.h>
#include <KoShape.h> #include <KoShape.h>
...@@ -114,8 +114,8 @@ void TestKoShapeFactory::testOdfElement() ...@@ -114,8 +114,8 @@ void TestKoShapeFactory::testOdfElement()
// XXX: When loading is implemented, these no doubt have to be // XXX: When loading is implemented, these no doubt have to be
// sensibly filled. // sensibly filled.
KoOasisStyles styles; KoOdfStylesReader stylesReader;
KoOasisLoadingContext oasisContext(0, styles, 0); KoOasisLoadingContext oasisContext(0, stylesReader, 0);
KoShapeLoadingContext shapeContext( oasisContext ); KoShapeLoadingContext shapeContext( oasisContext );
QVERIFY( shape->loadOdf( pathElement, shapeContext ) ); QVERIFY( shape->loadOdf( pathElement, shapeContext ) );
......
...@@ -27,7 +27,7 @@ ...@@ -27,7 +27,7 @@
#include <QtXml> #include <QtXml>
#include <KoOasisLoadingContext.h> #include <KoOasisLoadingContext.h>
#include <KoOasisStyles.h> #include <KoOdfStylesReader.h>
#include "KoShapeRegistry.h" #include "KoShapeRegistry.h"
#include "KoShape.h" #include "KoShape.h"
...@@ -77,8 +77,8 @@ void TestKoShapeRegistry::testCreateShapes() ...@@ -77,8 +77,8 @@ void TestKoShapeRegistry::testCreateShapes()
// XXX: When loading is implemented, these no doubt have to be // XXX: When loading is implemented, these no doubt have to be
// sensibly filled. // sensibly filled.
KoOasisStyles styles; KoOdfStylesReader stylesReader;
KoOasisLoadingContext oasisContext(0, styles, 0); KoOasisLoadingContext oasisContext(0, stylesReader, 0);
KoShapeLoadingContext shapeContext( oasisContext ); KoShapeLoadingContext shapeContext( oasisContext );
KoShape * shape = registry->createShapeFromOdf(bodyElement, shapeContext); KoShape * shape = registry->createShapeFromOdf(bodyElement, shapeContext);
...@@ -124,8 +124,8 @@ void TestKoShapeRegistry::testCreateFramedShapes() ...@@ -124,8 +124,8 @@ void TestKoShapeRegistry::testCreateFramedShapes()
// XXX: When loading is implemented, these no doubt have to be // XXX: When loading is implemented, these no doubt have to be
// sensibly filled. // sensibly filled.
KoOasisStyles styles; KoOdfStylesReader stylesReader;
KoOasisLoadingContext oasisContext(0, styles, 0); KoOasisLoadingContext oasisContext(0, stylesReader, 0);
KoShapeLoadingContext shapeContext( oasisContext ); KoShapeLoadingContext shapeContext( oasisContext );
KoShape * shape = registry->createShapeFromOdf(bodyElement, shapeContext); KoShape * shape = registry->createShapeFromOdf(bodyElement, shapeContext);
......
...@@ -24,7 +24,7 @@ ...@@ -24,7 +24,7 @@
#include <KoStoreDevice.h> #include <KoStoreDevice.h>
#include <KoXmlWriter.h> #include <KoXmlWriter.h>
#include <KoXmlReader.h> #include <KoXmlReader.h>
#include <KoOasisStyles.h> #include <KoOdfStylesReader.h>
#include <KoOdfReadStore.h> #include <KoOdfReadStore.h>
#include <KoOdfWriteStore.h> #include <KoOdfWriteStore.h>
#include <KoOasisLoadingContext.h> #include <KoOasisLoadingContext.h>
......
...@@ -23,7 +23,7 @@ ...@@ -23,7 +23,7 @@
#include <KoGenStyle.h> #include <KoGenStyle.h>
#include <KoXmlWriter.h> #include <KoXmlWriter.h>
#include <KoXmlNS.h> #include <KoXmlNS.h>
#include <KoOasisStyles.h> #include <KoOdfStylesReader.h>
#include <KoOasisLoadingContext.h> #include <KoOasisLoadingContext.h>
#include "KoPASavingContext.h" #include "KoPASavingContext.h"
...@@ -79,7 +79,7 @@ void KoPAMasterPage::loadOdfPageTag( const KoXmlElement &element, KoPALoadingCon ...@@ -79,7 +79,7 @@ void KoPAMasterPage::loadOdfPageTag( const KoXmlElement &element, KoPALoadingCon
setName( element.attributeNS( KoXmlNS::style, "name" ) ); setName( element.attributeNS( KoXmlNS::style, "name" ) );
} }
QString pageLayoutName = element.attributeNS( KoXmlNS::style, "page-layout-name" ); QString pageLayoutName = element.attributeNS( KoXmlNS::style, "page-layout-name" );
const KoOasisStyles& styles = loadingContext.koLoadingContext().oasisStyles(); const KoOdfStylesReader& styles = loadingContext.koLoadingContext().stylesReader();
const KoXmlElement* masterPageStyle = styles.findStyle( pageLayoutName ); const KoXmlElement* masterPageStyle = styles.findStyle( pageLayoutName );
KoPageLayout pageLayout = KoPageLayout::standardLayout(); KoPageLayout pageLayout = KoPageLayout::standardLayout();
......
...@@ -32,7 +32,7 @@ ...@@ -32,7 +32,7 @@
#include <KoShapeRegistry.h> #include <KoShapeRegistry.h>
#include <KoGenStyle.h> #include <KoGenStyle.h>
#include <KoGenStyles.h> #include <KoGenStyles.h>
#include <KoOasisStyles.h> #include <KoOdfStylesReader.h>
#include <KoOdfGraphicStyles.h> #include <KoOdfGraphicStyles.h>
#include <KoXmlWriter.h> #include <KoXmlWriter.h>
#include <KoViewConverter.h> #include <KoViewConverter.h>
...@@ -115,7 +115,7 @@ bool KoPAPageBase::loadOdf( const KoXmlElement &element, KoShapeLoadingContext & ...@@ -115,7 +115,7 @@ bool KoPAPageBase::loadOdf( const KoXmlElement &element, KoShapeLoadingContext &
// load layers and shapes // load layers and shapes
// This needs some work as this is only for layers which are the same for all pages // This needs some work as this is only for layers which are the same for all pages
KoXmlElement layerElement; KoXmlElement layerElement;
forEachElement( layerElement, loadingContext.koLoadingContext().oasisStyles().layerSet() ) forEachElement( layerElement, loadingContext.koLoadingContext().stylesReader().layerSet() )
{ {
KoShapeLayer * layer = new KoShapeLayer(); KoShapeLayer * layer = new KoShapeLayer();
if ( layer->loadOdf( layerElement, loadingContext ) ) { if ( layer->loadOdf( layerElement, loadingContext ) ) {
......
...@@ -24,7 +24,7 @@ ...@@ -24,7 +24,7 @@
#include <KoOdfReadStore.h> #include <KoOdfReadStore.h>
#include <KoXmlWriter.h> #include <KoXmlWriter.h>
#include <KoOasisLoadingContext.h> #include <KoOasisLoadingContext.h>
#include <KoOasisStyles.h> #include <KoOdfStylesReader.h>
#include "KoPALoadingContext.h" #include "KoPALoadingContext.h"
#include "KoPADocument.h" #include "KoPADocument.h"
#include "KoPAMasterPage.h" #include "KoPAMasterPage.h"
......
...@@ -174,7 +174,7 @@ bool KoTextShapeData::loadOdf(const KoXmlElement & element, KoShapeLoadingContex ...@@ -174,7 +174,7 @@ bool KoTextShapeData::loadOdf(const KoXmlElement & element, KoShapeLoadingContex
owner = true; owner = true;
loader = new KoTextLoader(new KoStyleManager); loader = new KoTextLoader(new KoStyleManager);
loader->styleManager()->setParent(loader); loader->styleManager()->setParent(loader);
loaderContext = new KoTextLoadingContext(loader, oasisContext.koDocument(), oasisContext.oasisStyles(), oasisContext.store()); loaderContext = new KoTextLoadingContext(loader, oasisContext.koDocument(), oasisContext.stylesReader(), oasisContext.store());
} }
QTextCursor cursor( document() ); QTextCursor cursor( document() );
......
...@@ -28,7 +28,7 @@ ...@@ -28,7 +28,7 @@
//#include "frames/KWTextFrame.h" //#include "frames/KWTextFrame.h"
// koffice // koffice
#include <KoOasisStyles.h> #include <KoOdfStylesReader.h>
#include <KoOasisSettings.h> #include <KoOasisSettings.h>
#include <KoXmlNS.h> #include <KoXmlNS.h>
#include <KoDom.h> #include <KoDom.h>
......
...@@ -28,7 +28,7 @@ ...@@ -28,7 +28,7 @@
//#include "frames/KWTextFrame.h" //#include "frames/KWTextFrame.h"
// koffice // koffice
#include <KoOasisStyles.h> #include <KoOdfStylesReader.h>
#include <KoOasisSettings.h> #include <KoOasisSettings.h>
#include <KoXmlNS.h> #include <KoXmlNS.h>
#include <KoDom.h> #include <KoDom.h>
...@@ -151,7 +151,7 @@ void KoTextLoader::loadStyles(KoTextLoadingContext& context, QList<KoXmlElement* ...@@ -151,7 +151,7 @@ void KoTextLoader::loadStyles(KoTextLoadingContext& context, QList<KoXmlElement*
{ {
#if 0 //1.6: #if 0 //1.6:
QStringList followingStyles; QStringList followingStyles;
QList<KoXmlElement*> userStyles = context.oasisStyles().customStyles( "paragraph" ).values(); QList<KoXmlElement*> userStyles = context.stylesReader().customStyles( "paragraph" ).values();
bool defaultStyleDeleted = false; bool defaultStyleDeleted = false;
int stylesLoaded = 0; int stylesLoaded = 0;
const unsigned int nStyles = userStyles.count(); const unsigned int nStyles = userStyles.count();
...@@ -241,8 +241,8 @@ void KoTextLoader::loadAllStyles(KoTextLoadingContext& context) ...@@ -241,8 +241,8 @@ void KoTextLoader::loadAllStyles(KoTextLoadingContext& context)
// User styles are named and appear in the gui while automatic styles are just a way to // User styles are named and appear in the gui while automatic styles are just a way to
// save formatting changes done by the user. There is no real tech diff between them // save formatting changes done by the user. There is no real tech diff between them
// except how we present them to the user. // except how we present them to the user.
loadStyles(context, context.oasisStyles().autoStyles("paragraph").values()); loadStyles(context, context.stylesReader().autoStyles("paragraph").values());
loadStyles(context, context.oasisStyles().customStyles("paragraph").values()); loadStyles(context, context.stylesReader().customStyles("paragraph").values());
// we always need the default style // we always need the default style
if( ! d->paragraphStyle("Standard") ) { if( ! d->paragraphStyle("Standard") ) {
...@@ -252,7 +252,7 @@ void KoTextLoader::loadAllStyles(KoTextLoadingContext& context) ...@@ -252,7 +252,7 @@ void KoTextLoader::loadAllStyles(KoTextLoadingContext& context)
} }
// handle the list styles // handle the list styles
QHash<QString, KoXmlElement*> listStyles = context.oasisStyles().listStyles(); QHash<QString, KoXmlElement*> listStyles = context.stylesReader().listStyles();
for(QHash<QString, KoXmlElement*>::Iterator it = listStyles.begin(); it != listStyles.end(); ++it) { for(QHash<QString, KoXmlElement*>::Iterator it = listStyles.begin(); it != listStyles.end(); ++it) {
#ifdef KOOPENDOCUMENTLOADER_DEBUG #ifdef KOOPENDOCUMENTLOADER_DEBUG
kDebug(32500)<<"listStyle="<<it.key(); kDebug(32500)<<"listStyle="<<it.key();
...@@ -264,7 +264,7 @@ void KoTextLoader::loadAllStyles(KoTextLoadingContext& context) ...@@ -264,7 +264,7 @@ void KoTextLoader::loadAllStyles(KoTextLoadingContext& context)
} }
// outline-styles used e.g. for headers // outline-styles used e.g. for headers
KoXmlElement outlineStyle = KoDom::namedItemNS( context.oasisStyles().officeStyle(), KoXmlNS::text, "outline-style" ); KoXmlElement outlineStyle = KoDom::namedItemNS( context.stylesReader().officeStyle(), KoXmlNS::text, "outline-style" );
KoXmlElement tag; KoXmlElement tag;
forEachElement(tag, outlineStyle) { forEachElement(tag, outlineStyle) {
#ifdef KOOPENDOCUMENTLOADER_DEBUG #ifdef KOOPENDOCUMENTLOADER_DEBUG
...@@ -433,7 +433,7 @@ void KoTextLoader::loadParagraph(KoTextLoadingContext& context, const KoXmlEleme ...@@ -433,7 +433,7 @@ void KoTextLoader::loadParagraph(KoTextLoadingContext& context, const KoXmlEleme
kDebug(32500)<<"styleName="<<styleName<<" userStyleName="<<userStyleName<<" userStyle="<<(userStyle?"YES":"NULL"); kDebug(32500)<<"styleName="<<styleName<<" userStyleName="<<userStyleName<<" userStyle="<<(userStyle?"YES":"NULL");
#endif #endif
if ( !styleName.isEmpty() ) { if ( !styleName.isEmpty() ) {
const KoXmlElement* paragraphStyle = context.oasisStyles().findStyle( styleName, "paragraph" ); const KoXmlElement* paragraphStyle = context.stylesReader().findStyle( styleName, "paragraph" );
QString masterPageName = paragraphStyle ? paragraphStyle->attributeNS( KoXmlNS::style, "master-page-name", QString() ) : QString(); QString masterPageName = paragraphStyle ? paragraphStyle->attributeNS( KoXmlNS::style, "master-page-name", QString() ) : QString();
if ( masterPageName.isEmpty() ) if ( masterPageName.isEmpty() )
masterPageName = "Standard"; masterPageName = "Standard";
...@@ -486,7 +486,7 @@ void KoTextLoader::loadParagraph(KoTextLoadingContext& context, const KoXmlEleme ...@@ -486,7 +486,7 @@ void KoTextLoader::loadParagraph(KoTextLoadingContext& context, const KoXmlEleme
QTextCharFormat cf = cursor.charFormat(); // store the current cursor char format QTextCharFormat cf = cursor.charFormat(); // store the current cursor char format
context.styleStack().setTypeProperties( "paragraph" ); context.styleStack().setTypeProperties( "paragraph" );
const QString textStyleName = parent.attributeNS( KoXmlNS::text, "style-name", QString() ); const QString textStyleName = parent.attributeNS( KoXmlNS::text, "style-name", QString() );
const KoXmlElement* textStyleElem = textStyleName.isEmpty() ? 0 : context.oasisStyles().findStyle( textStyleName, "paragraph" ); const KoXmlElement* textStyleElem = textStyleName.isEmpty() ? 0 : context.stylesReader().findStyle( textStyleName, "paragraph" );
KoCharacterStyle *charstyle = 0; KoCharacterStyle *charstyle = 0;
if( textStyleElem ) { if( textStyleElem ) {
context.addStyles( textStyleElem, "paragraph" ); context.addStyles( textStyleElem, "paragraph" );
...@@ -559,7 +559,7 @@ void KoTextLoader::loadHeading(KoTextLoadingContext& context, const KoXmlElement ...@@ -559,7 +559,7 @@ void KoTextLoader::loadHeading(KoTextLoadingContext& context, const KoXmlElement
/* /*
//1.6: KoOasisContext::pushOutlineListLevelStyle //1.6: KoOasisContext::pushOutlineListLevelStyle
//KoXmlElement outlineStyle = KoDom::namedItemNS( oasisStyles().officeStyle(), KoXmlNS::text, "outline-style" ); //KoXmlElement outlineStyle = KoDom::namedItemNS( stylesReader().officeStyle(), KoXmlNS::text, "outline-style" );
KoListStyle* listStyle = 0; KoListStyle* listStyle = 0;
if( level > 0 ) { if( level > 0 ) {
listStyle = new KoListStyle(); listStyle = new KoListStyle();
...@@ -571,7 +571,7 @@ void KoTextLoader::loadHeading(KoTextLoadingContext& context, const KoXmlElement ...@@ -571,7 +571,7 @@ void KoTextLoader::loadHeading(KoTextLoadingContext& context, const KoXmlElement
//1.6: KWTextParag::loadOasis //1.6: KWTextParag::loadOasis
QString styleName = parent.attributeNS( KoXmlNS::text, "style-name", QString() ); QString styleName = parent.attributeNS( KoXmlNS::text, "style-name", QString() );
if ( !styleName.isEmpty() ) { if ( !styleName.isEmpty() ) {
const KoXmlElement* paragraphStyle = context.oasisStyles().findStyle( styleName, "paragraph" ); const KoXmlElement* paragraphStyle = context.stylesReader().findStyle( styleName, "paragraph" );
//QString masterPageName = paragraphStyle ? paragraphStyle->attributeNS( KoXmlNS::style, "master-page-name", QString() ) : QString(); //QString masterPageName = paragraphStyle ? paragraphStyle->attributeNS( KoXmlNS::style, "master-page-name", QString() ) : QString();
//if ( masterPageName.isEmpty() ) masterPageName = "Standard"; // Seems to be a builtin name for the default layout... //if ( masterPageName.isEmpty() ) masterPageName = "Standard"; // Seems to be a builtin name for the default layout...
//#ifdef KOOPENDOCUMENTLOADER_DEBUG //#ifdef KOOPENDOCUMENTLOADER_DEBUG
...@@ -866,7 +866,7 @@ void KoTextLoader::loadSpan(KoTextLoadingContext& context, const KoXmlElement& p ...@@ -866,7 +866,7 @@ void KoTextLoader::loadSpan(KoTextLoadingContext& context, const KoXmlElement& p
context.styleStack().setTypeProperties( "text" ); context.styleStack().setTypeProperties( "text" );
const QString textStyleName = ts.attributeNS( KoXmlNS::text, "style-name", QString() ); const QString textStyleName = ts.attributeNS( KoXmlNS::text, "style-name", QString() );
const KoXmlElement* textStyleElem = textStyleName.isEmpty() ? 0 : context.oasisStyles().findStyle( textStyleName, "text" ); const KoXmlElement* textStyleElem = textStyleName.isEmpty() ? 0 : context.stylesReader().findStyle( textStyleName, "text" );
KoCharacterStyle *charstyle = 0; KoCharacterStyle *charstyle = 0;
if( textStyleElem ) { if( textStyleElem ) {
#ifdef KOOPENDOCUMENTLOADER_DEBUG #ifdef KOOPENDOCUMENTLOADER_DEBUG
...@@ -947,8 +947,8 @@ void KoTextLoader::loadSpan(KoTextLoadingContext& context, const KoXmlElement& p ...@@ -947,8 +947,8 @@ void KoTextLoader::loadSpan(KoTextLoadingContext& context, const KoXmlElement& p
QString dataStyle = ts.attributeNS(KoXmlNS::style, "data-style-name"); QString dataStyle = ts.attributeNS(KoXmlNS::style, "data-style-name");
QString dateFormat = ""; QString dateFormat = "";
if (!dataStyle.isEmpty()) { if (!dataStyle.isEmpty()) {
if (context.oasisStyles().dataFormats().contains(dataStyle)) { if (context.stylesReader().dataFormats().contains(dataStyle)) {
KoOdfNumberStyles::NumericStyleFormat dataFormat = context.oasisStyles().dataFormats().value(dataStyle); KoOdfNumberStyles::NumericStyleFormat dataFormat = context.stylesReader().dataFormats().value(dataStyle);
dateFormat = dataFormat.prefix + dataFormat.formatStr + dataFormat.suffix; dateFormat = dataFormat.prefix + dataFormat.formatStr + dataFormat.suffix;
} }
} }
......
...@@ -33,8 +33,8 @@ class KoTextLoadingContext::Private ...@@ -33,8 +33,8 @@ class KoTextLoadingContext::Private
int currentListLevel; int currentListLevel;
}; };
KoTextLoadingContext::KoTextLoadingContext( KoTextLoader* loader, KoDocument* doc, KoOasisStyles& styles, KoStore* store ) KoTextLoadingContext::KoTextLoadingContext( KoTextLoader* loader, KoDocument* doc, KoOdfStylesReader& stylesReader, KoStore* store )
: KoOasisLoadingContext( doc, styles, store ), d(new Private()) : KoOasisLoadingContext( doc, stylesReader, store ), d(new Private())
{ {
d->loader = loader; d->loader = loader;
d->currentListLevel = 1; // default list level is always 1 d->currentListLevel = 1; // default list level is always 1
...@@ -84,7 +84,7 @@ static KoXmlElement findListLevelStyle( const KoXmlElement& fullListStyle, int l ...@@ -84,7 +84,7 @@ static KoXmlElement findListLevelStyle( const KoXmlElement& fullListStyle, int l
bool KoOasisContext::pushListLevelStyle( const QString& listStyleName, int level ) bool KoOasisContext::pushListLevelStyle( const QString& listStyleName, int level )
{ {
KoXmlElement* fullListStyle = oasisStyles().listStyles()[listStyleName]; KoXmlElement* fullListStyle = stylesReader().listStyles()[listStyleName];
if ( !fullListStyle ) { if ( !fullListStyle ) {
kWarning(32500) << "List style " << listStyleName << " not found!"; kWarning(32500) << "List style " << listStyleName << " not found!";
return false; return false;
...@@ -95,7 +95,7 @@ bool KoOasisContext::pushListLevelStyle( const QString& listStyleName, int level ...@@ -95,7 +95,7 @@ bool KoOasisContext::pushListLevelStyle( const QString& listStyleName, int level
bool KoOasisContext::pushOutlineListLevelStyle( int level ) bool KoOasisContext::pushOutlineListLevelStyle( int level )
{ {
KoXmlElement outlineStyle = KoDom::namedItemNS( oasisStyles().officeStyle(), KoXmlNS::text, "outline-style" ); KoXmlElement outlineStyle = KoDom::namedItemNS( stylesReader().officeStyle(), KoXmlNS::text, "outline-style" );
return pushListLevelStyle( "<outline-style>", outlineStyle, level ); return pushListLevelStyle( "<outline-style>", outlineStyle, level );
} }
......
...@@ -47,7 +47,7 @@ public: ...@@ -47,7 +47,7 @@ public:
* \param styles The styles used for loading. * \param styles The styles used for loading.
* \param store The storage backend we are reading from. * \param store The storage backend we are reading from.
*/ */
KoTextLoadingContext( KoTextLoader* loader, KoDocument* doc, KoOasisStyles& styles, KoStore* store ); KoTextLoadingContext( KoTextLoader* loader, KoDocument* doc, KoOdfStylesReader& stylesReader, KoStore* store );
/** /**
* Destructor. * Destructor.
......
...@@ -25,7 +25,7 @@ ...@@ -25,7 +25,7 @@
#include <QTextCursor> #include <QTextCursor>
#include <KoStyleStack.h> #include <KoStyleStack.h>
#include <KoOasisStyles.h> #include <KoOdfStylesReader.h>
#include <KoXmlNS.h> #include <KoXmlNS.h>
#include <KoXmlReader.h> #include <KoXmlReader.h>
#include <KoUnit.h> #include <KoUnit.h>
...@@ -504,8 +504,8 @@ void KoCharacterStyle::loadOasis(KoTextLoadingContext& context) { ...@@ -504,8 +504,8 @@ void KoCharacterStyle::loadOasis(KoTextLoadingContext& context) {
fontName = styleStack.property( KoXmlNS::style, "font-family" ); fontName = styleStack.property( KoXmlNS::style, "font-family" );
if ( styleStack.hasProperty( KoXmlNS::style, "font-name" ) ) { if ( styleStack.hasProperty( KoXmlNS::style, "font-name" ) ) {
// This font name is a reference to a font face declaration. // This font name is a reference to a font face declaration.
KoOasisStyles &styles = context.oasisStyles(); KoOdfStylesReader &stylesReader = context.stylesReader();
const KoXmlElement *fontFace = styles.findStyle(styleStack.property( KoXmlNS::style, "font-name" )); const KoXmlElement *fontFace = stylesReader.findStyle(styleStack.property( KoXmlNS::style, "font-name" ));
if (fontFace != 0) if (fontFace != 0)
fontName = fontFace->attributeNS(KoXmlNS::svg, "font-family", ""); fontName = fontFace->attributeNS(KoXmlNS::svg, "font-family", "");
} }
......
...@@ -23,7 +23,7 @@ ...@@ -23,7 +23,7 @@
#include "opendocument/KoTextLoadingContext.h" #include "opendocument/KoTextLoadingContext.h"
#include <KoStyleStack.h> #include <KoStyleStack.h>
#include <KoOasisStyles.h> #include <KoOdfStylesReader.h>
#include <KoXmlNS.h> #include <KoXmlNS.h>
#include <kdebug.h> #include <kdebug.h>
#include <QTextCursor> #include <QTextCursor>
......
...@@ -30,7 +30,7 @@ ...@@ -30,7 +30,7 @@
#include "KoMainWindow.h" #include "KoMainWindow.h"
#include "KoFilterManager.h" #include "KoFilterManager.h"
#include "KoDocumentInfo.h" #include "KoDocumentInfo.h"
#include "KoOasisStyles.h" #include "KoOdfStylesReader.h"
#include "KoOdfReadStore.h" #include "KoOdfReadStore.h"
#include "KoOdfWriteStore.h" #include "KoOdfWriteStore.h"
#include "KoXmlNS.h" #include "KoXmlNS.h"
......
...@@ -47,7 +47,6 @@ class KoChild; ...@@ -47,7 +47,6 @@ class KoChild;
class KoDocumentChild; class KoDocumentChild;
class KoView; class KoView;
class KoDocumentInfo; class KoDocumentInfo;
class KoOasisStyles;
class KoOpenPane; class KoOpenPane;
......
...@@ -36,7 +36,7 @@ ...@@ -36,7 +36,7 @@
#include <KoXmlWriter.h> #include <KoXmlWriter.h>
#include "KoOasisLoadingContext.h" #include "KoOasisLoadingContext.h"
#include "KoOasisStyles.h" #include "KoOdfStylesReader.h"
#include "KoPictureShared.h" #include "KoPictureShared.h"
void KoOdfGraphicStyles::saveOasisFillStyle( KoGenStyle &styleFill, KoGenStyles& mainStyles, const QBrush & brush ) void KoOdfGraphicStyles::saveOasisFillStyle( KoGenStyle &styleFill, KoGenStyles& mainStyles, const QBrush & brush )
...@@ -192,11 +192,11 @@ QString KoOdfGraphicStyles::saveOasisGradientStyle( KoGenStyles &mainStyles, con ...@@ -192,11 +192,11 @@ QString KoOdfGraphicStyles::saveOasisGradientStyle( KoGenStyles &mainStyles, con
return mainStyles.lookup( gradientStyle, "gradient" ); return mainStyles.lookup( gradientStyle, "gradient" );
} }
QBrush KoOdfGraphicStyles::loadOasisGradientStyle( const KoStyleStack &styleStack, const KoOasisStyles & oasisStyles, const QSizeF &size ) QBrush KoOdfGraphicStyles::loadOasisGradientStyle( const KoStyleStack &styleStack, const KoOdfStylesReader & stylesReader, const QSizeF &size )
{ {
QString styleName = styleStack.property( KoXmlNS::draw, "fill-gradient-name" ); QString styleName = styleStack.property( KoXmlNS::draw, "fill-gradient-name" );
KoXmlElement* e = oasisStyles.drawStyles()[styleName]; KoXmlElement* e = stylesReader.drawStyles()[styleName];
if( ! e ) if( ! e )
return QBrush(); return QBrush();
...@@ -324,7 +324,7 @@ QBrush KoOdfGraphicStyles::loadOasisPatternStyle( const KoStyleStack &styleStack ...@@ -324,7 +324,7 @@ QBrush KoOdfGraphicStyles::loadOasisPatternStyle( const KoStyleStack &styleStack
{ {
QString styleName = styleStack.property( KoXmlNS::draw, "fill-image-name" ); QString styleName = styleStack.property( KoXmlNS::draw, "fill-image-name" );
KoXmlElement* e = context.oasisStyles().drawStyles()[styleName]; KoXmlElement* e = context.stylesReader().drawStyles()[styleName];
if( ! e ) if( ! e )
return QBrush(); return QBrush();
...@@ -434,7 +434,7 @@ QBrush KoOdfGraphicStyles::loadOasisPatternStyle( const KoStyleStack &styleStack ...@@ -434,7 +434,7 @@ QBrush KoOdfGraphicStyles::loadOasisPatternStyle( const KoStyleStack &styleStack
return resultBrush; return resultBrush;
} }
QBrush KoOdfGraphicStyles::loadOasisFillStyle( const KoStyleStack &styleStack, const QString & fill, const KoOasisStyles & oasisStyles ) QBrush KoOdfGraphicStyles::loadOasisFillStyle( const KoStyleStack &styleStack, const QString & fill, const KoOdfStylesReader & stylesReader )
{ {
QBrush tmpBrush; QBrush tmpBrush;
if ( fill == "solid" ) if ( fill == "solid" )
...@@ -501,7 +501,7 @@ QBrush KoOdfGraphicStyles::loadOasisFillStyle( const KoStyleStack &styleStack, c ...@@ -501,7 +501,7 @@ QBrush KoOdfGraphicStyles::loadOasisFillStyle( const KoStyleStack &styleStack, c
//type not defined by default //type not defined by default
//try to use style. //try to use style.
KoXmlElement* draw = oasisStyles.drawStyles()[style]; KoXmlElement* draw = stylesReader.drawStyles()[style];
if ( draw) if ( draw)
{ {
kDebug(30003)<<"We have a style"; kDebug(30003)<<"We have a style";
...@@ -588,7 +588,7 @@ QBrush KoOdfGraphicStyles::loadOasisFillStyle( const KoStyleStack &styleStack, c ...@@ -588,7 +588,7 @@ QBrush KoOdfGraphicStyles::loadOasisFillStyle( const KoStyleStack &styleStack, c
return tmpBrush; return tmpBrush;
} }
QPen KoOdfGraphicStyles::loadOasisStrokeStyle( const KoStyleStack &styleStack, const QString & stroke, const KoOasisStyles & oasisStyles ) QPen KoOdfGraphicStyles::loadOasisStrokeStyle( const KoStyleStack &styleStack, const QString & stroke, const KoOdfStylesReader & stylesReader )
{ {
QPen tmpPen; QPen tmpPen;
...@@ -620,7 +620,7 @@ QPen KoOdfGraphicStyles::loadOasisStrokeStyle( const KoStyleStack &styleStack, c ...@@ -620,7 +620,7 @@ QPen KoOdfGraphicStyles::loadOasisStrokeStyle( const KoStyleStack &styleStack, c
{ {
QString dashStyleName = styleStack.property( KoXmlNS::draw, "stroke-dash" ); QString dashStyleName = styleStack.property( KoXmlNS::draw, "stroke-dash" );
KoXmlElement * dashElement = oasisStyles.drawStyles()[ dashStyleName ]; KoXmlElement * dashElement = stylesReader.drawStyles()[ dashStyleName ];
if( dashElement ) if( dashElement )
{ {
QVector<qreal> dashes; QVector<qreal> dashes;
......
...@@ -34,7 +34,7 @@ class KoGenStyle; ...@@ -34,7 +34,7 @@ class KoGenStyle;