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

List:       koffice-devel
Subject:    API change in KoCharacterStyle
From:       Pinaraf <pinaraf () gmail ! com>
Date:       2007-05-17 18:15:24
Message-ID: 2d74a35c0705171115m396dd111pc52732b45ca2b901 () mail ! gmail ! com
[Download RAW message or body]

[Attachment #2 (multipart/alternative)]


Hi

I'm trying to get the font names working in KWord ODF loading code, but
after facing the problem with font-face-decls I'm getting another problem
with KoCharacterStyle : it's getting access only to KoStyleStack, which
doesn't make it possible (ok, more exactly : I didn't find any way but there
is perhaps a way I didn't find) to access KoOasisStyles.
That's why I'd like to change the loadOasis fonction in KoCharacterStyle :
its argument would be the KoOasisLoadingContext instead of KoStyleStack.
I attached a svn diff for this small change...

What do you think about it ?

[Attachment #5 (text/html)]

Hi<br><br>I&#39;m trying to get the font names working in KWord ODF loading code, but \
after facing the problem with font-face-decls I&#39;m getting another problem with \
KoCharacterStyle : it&#39;s getting access only to KoStyleStack, which doesn&#39;t \
make it possible (ok, more exactly : I didn&#39;t find any way but there is perhaps a \
way I didn&#39;t find) to access KoOasisStyles. <br>That&#39;s why I&#39;d like to \
change the loadOasis fonction in KoCharacterStyle : its argument would be the \
KoOasisLoadingContext instead of KoStyleStack.<br>I attached a svn diff for this \
small change...<br><br>What do you think about it ? <br>


["koCharacterStyle-loadOasis.diff" (text/x-diff)]

Index: kword/part/KWOpenDocumentLoader.cpp
===================================================================
--- kword/part/KWOpenDocumentLoader.cpp	(révision 665597)
+++ kword/part/KWOpenDocumentLoader.cpp	(copie de travail)
@@ -450,7 +450,7 @@
         //1.6: KoTextFormat::load
         KoCharacterStyle *charstyle = parastyle->characterStyle();
         context.styleStack().setTypeProperties( "text" ); // load all style \
                attributes from "style:text-properties"
-        charstyle->loadOasis(context.styleStack()); // load the KoCharacterStyle \
from the stylestack +        charstyle->loadOasis(context); // load the \
KoCharacterStyle from the stack using the context  
         context.styleStack().restore();
     }
@@ -695,7 +695,7 @@
         if( ! charstyle1 ) {
             charstyle1 = new KoCharacterStyle();
             charstyle1->setName(textStyleName);
-            charstyle1->loadOasis( context.styleStack() );
+            charstyle1->loadOasis( context );
             d->document->styleManager()->add(charstyle1);
         }
         charstyle1->applyStyle(&cursor);
@@ -843,7 +843,7 @@
         paragstyle->loadOasis(context.styleStack()); // load the KoParagraphStyle \
from the stylestack  KoCharacterStyle *charstyle = paragstyle->characterStyle();
         context.styleStack().setTypeProperties( "text" ); // load all style \
                attributes from "style:text-properties"
-        charstyle->loadOasis(context.styleStack()); // load the KoCharacterStyle \
from the stylestack +        charstyle->loadOasis(context); // load the \
KoCharacterStyle from the stack using the context  }
     //context.styleStack().setTypeProperties( "paragraph" );
     //style->loadOasis( context.styleStack() );
@@ -1036,7 +1036,7 @@
                 if( ! charstyle1 ) {
                     charstyle1 = new KoCharacterStyle();
                     charstyle1->setName(textStyleName);
-                    charstyle1->loadOasis( context.styleStack() );
+                    charstyle1->loadOasis( context );
                     d->document->styleManager()->add(charstyle1);
                 }
                 charstyle1->applyStyle(&cursor);
Index: libs/kotext/styles/KoCharacterStyle.cpp
===================================================================
--- libs/kotext/styles/KoCharacterStyle.cpp	(révision 665597)
+++ libs/kotext/styles/KoCharacterStyle.cpp	(copie de travail)
@@ -24,6 +24,7 @@
 #include <QTextCursor>
 
 #include <KoStyleStack.h>
+#include <KoOasisLoadingContext.h>
 #include <KoXmlNS.h>
 
 #include <KDebug>
@@ -203,7 +204,8 @@
     // We should separate them in kotext...
 }
 
-void KoCharacterStyle::loadOasis(KoStyleStack& styleStack) {
+void KoCharacterStyle::loadOasis(KoOasisLoadingContext& context) {
+    KoStyleStack &styleStack = context.styleStack();
     //in 1.6 this was defined in KoTextFormat::load(KoOasisContext& context)
 
     if ( styleStack.hasProperty( KoXmlNS::fo, "color" ) ) { // 3.10.3

Index: libs/kotext/styles/KoCharacterStyle.h
===================================================================
--- libs/kotext/styles/KoCharacterStyle.h	(révision 665597)
+++ libs/kotext/styles/KoCharacterStyle.h	(copie de travail)
@@ -29,6 +29,7 @@
 class StylePrivate;
 class QTextBlock;
 class KoStyleStack;
+class KoOasisLoadingContext;
 
 /**
  * A container for all properties for a character style.
@@ -163,7 +164,7 @@
      * Load the style from the \a KoStyleStack style stack using the
      * OpenDocument format.
      */
-    void loadOasis(KoStyleStack& styleStack);
+    void loadOasis(KoOasisLoadingContext& context);
 
 private:
     void setProperty(int key, const QVariant &value);



_______________________________________________
koffice-devel mailing list
koffice-devel@kde.org
https://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