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

List:       kde-commits
Subject:    koffice/kspread
From:       Laurent Montel <montel () kde ! org>
Date:       2005-09-29 7:58:52
Message-ID: 1127980732.334114.32313.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 465218 by mlaurent:

now we can save/load text position and color position. Save/load from/to oo work now. \
I will continue to fix oasis file format into kspread

 M  +24 -11    kspread_format.cc  


--- trunk/koffice/kspread/kspread_format.cc #465217:465218
@@ -408,6 +408,7 @@
             currentCellStyle.addAttribute( "style:parent-style-name", \
m_pStyle->parent()->name() );  }
 
+    //text attributes
     if ( hasProperty( PFont, true ) || hasNoFallBackProperties( PFont ) || force )
     {
         //fo:font-size="13pt" fo:font-style="italic" style:text-underline="single" \
style:text-underline-color="font-color" fo:font-weight="bold" @@ -416,10 +417,12 @@
     if ( ( hasProperty( PTextPen, true ) || hasNoFallBackProperties( PTextPen ) || \
force )  && textPen( _col, _row ).color().isValid() )
     {
-        currentCellStyle.addProperty( "fo:color", textColor( _col, _row ).name() );
+        currentCellStyle.addProperty( "fo:color", textColor( _col, _row ).name() , \
                KoGenStyle::TextType);
         //format.appendChild( util_createElement( "pen", textPen( _col, _row ), doc \
) );  }
+
     //FIXME fallback ????
+    // paragraph attributes.
     KSpreadFormat::Align alignX = KSpreadFormat::Undefined;
     if ( hasProperty( PAlign, true ) || hasNoFallBackProperties( PAlign ) || force  \
)  {
@@ -431,27 +434,31 @@
             value = "end";
         else if ( alignX == KSpreadFormat::Left )
             value = "start";
-        currentCellStyle.addProperty( "fo:text-align", value );
+        currentCellStyle.addProperty( "fo:text-align", value, \
KoGenStyle::ParagraphType );  }
 
-    if (  hasProperty( PAlignY, true ) || hasNoFallBackProperties( PAlignY ) || \
                force  )
-    {
-        KSpreadFormat::AlignY align = alignY( _col, _row );
-        if ( align != KSpreadFormat::Bottom ) // default in OpenCalc
-            currentCellStyle.addProperty( "style:vertical-align", ( align == \
                KSpreadFormat::Middle ? "middle" : "top" ) );
-    }
-
     if (hasProperty( PIndent, true ) || hasNoFallBackProperties( PIndent ) || force \
)  {
         double indent = getIndent( _col, _row );
         if ( indent > 0.0 )
         {
-            currentCellStyle.addPropertyPt("fo:margin-left", indent );
+            currentCellStyle.addPropertyPt("fo:margin-left", indent,  \
KoGenStyle::ParagraphType );  if ( alignX == KSpreadFormat::Undefined )
-                currentCellStyle.addProperty("fo:text-align", "start" );
+                currentCellStyle.addProperty("fo:text-align", "start", \
KoGenStyle::ParagraphType );  }
     }
+    // end paragraph attributes.
 
+
+    // cell attributes
+    if (  hasProperty( PAlignY, true ) || hasNoFallBackProperties( PAlignY ) || \
force  ) +    {
+        KSpreadFormat::AlignY align = alignY( _col, _row );
+        if ( align != KSpreadFormat::Bottom ) // default in OpenCalc
+            currentCellStyle.addProperty( "style:vertical-align", ( align == \
KSpreadFormat::Middle ? "middle" : "top" ) ); +    }
+
+
     if ( hasProperty( PAngle, true ) || hasNoFallBackProperties( PAngle ) || force )
     {
         if ( getAngle( _col, _row ) != 0 )
@@ -1195,6 +1202,9 @@
 
     loadFontOasisStyle( styleStack ); // specific font style
 
+    //TODO reorganize code to avoid to switch typeproperties
+    styleStack.setTypeProperties( "" ); // default
+
     // TODO:
     //   diagonal: fall + goup
     //   fo:direction="ltr"
@@ -1222,6 +1232,7 @@
         setIndent( KoUnit::parseValue( styleStack.attributeNS( KoXmlNS::fo, \
"margin-left" ),0.0 ) );  }
 
+    styleStack.setTypeProperties( "paragraph" ); // load all style attributes from \
                "style:paragraph-properties"
     kdDebug()<<"property.hasAttribute( fo:text-align ) \
:"<<styleStack.hasAttributeNS( KoXmlNS::fo, "text-align" )<<endl;  if ( \
styleStack.hasAttributeNS( KoXmlNS::fo, "text-align" ) )  {
@@ -1236,6 +1247,8 @@
             setAlign( KSpreadFormat::Center );
     }
 
+    styleStack.setTypeProperties( "" ); // Default
+
     kdDebug()<<"property.hasAttribute( fo:background-color ) \
:"<<styleStack.hasAttributeNS( KoXmlNS::fo, "background-color" )<<endl;  
     if ( styleStack.hasAttributeNS( KoXmlNS::fo, "background-color" ) )


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

Configure | About | News | Add a list | Sponsored by KoreLogic