[Libreoffice-commits] core.git: 2 commits - include/oox oox/source

Zolnai Tamás tamas.zolnai at collabora.com
Sun Feb 23 10:51:12 PST 2014


 include/oox/drawingml/textparagraphpropertiescontext.hxx |    2 --
 include/oox/drawingml/textspacing.hxx                    |    3 ++-
 oox/source/drawingml/textparagraphpropertiescontext.cxx  |    6 ++----
 3 files changed, 4 insertions(+), 7 deletions(-)

New commits:
commit b0073ef79efe65d8094d479faf0c4b657dffbfb0
Author: Zolnai Tamás <tamas.zolnai at collabora.com>
Date:   Sun Feb 23 16:15:06 2014 +0100

    drawingML import: reduce code duplication
    
    Change-Id: I7730fb047a10f270498bbf6f1a89dde034514121

diff --git a/include/oox/drawingml/textspacing.hxx b/include/oox/drawingml/textspacing.hxx
index e36ca72..4c859d7 100644
--- a/include/oox/drawingml/textspacing.hxx
+++ b/include/oox/drawingml/textspacing.hxx
@@ -24,6 +24,7 @@
 
 #include <com/sun/star/style/LineSpacing.hpp>
 #include <com/sun/star/style/LineSpacingMode.hpp>
+#include <oox/drawingml/drawingmltypes.hxx>
 
 namespace oox { namespace drawingml {
 
@@ -53,7 +54,7 @@ namespace oox { namespace drawingml {
         sal_Int32 toMargin( float fFontSize ) const
             {
                 if ( nUnit == PERCENT )
-                    return (sal_Int32) ((((fFontSize*nValue)/1000)*254 + 360)/720);
+                    return GetTextSpacingPoint(static_cast<sal_Int32>((fFontSize*nValue)/1000));
                 else
                     return nValue;
             }
commit a35a29829d1899e441a969de6d1045fd17e4639b
Author: Zolnai Tamás <tamas.zolnai at collabora.com>
Date:   Sun Feb 23 16:09:34 2014 +0100

    drawingML import: remove some unneeded member
    
    Change-Id: Iea975665b9225e535dcc4fbdcd666d7c7bff8ef3

diff --git a/include/oox/drawingml/textparagraphpropertiescontext.hxx b/include/oox/drawingml/textparagraphpropertiescontext.hxx
index d1a5fa8..0d3dc98 100644
--- a/include/oox/drawingml/textparagraphpropertiescontext.hxx
+++ b/include/oox/drawingml/textparagraphpropertiescontext.hxx
@@ -43,8 +43,6 @@ public:
 protected:
     TextParagraphProperties& mrTextParagraphProperties;
     TextSpacing     maLineSpacing;
-    TextSpacing&    mrSpaceBefore;
-    TextSpacing&    mrSpaceAfter;
     BulletList&     mrBulletList;
     ::std::list< ::com::sun::star::style::TabStop >  maTabList;
     ::boost::shared_ptr< BlipFillProperties > mxBlipProps;
diff --git a/oox/source/drawingml/textparagraphpropertiescontext.cxx b/oox/source/drawingml/textparagraphpropertiescontext.cxx
index 9e05446..a47d37f 100644
--- a/oox/source/drawingml/textparagraphpropertiescontext.cxx
+++ b/oox/source/drawingml/textparagraphpropertiescontext.cxx
@@ -47,8 +47,6 @@ TextParagraphPropertiesContext::TextParagraphPropertiesContext( ContextHandler2H
                                                                 TextParagraphProperties& rTextParagraphProperties )
 : ContextHandler2( rParent )
 , mrTextParagraphProperties( rTextParagraphProperties )
-, mrSpaceBefore( rTextParagraphProperties.getParaTopMargin() )
-, mrSpaceAfter( rTextParagraphProperties.getParaBottomMargin() )
 , mrBulletList( rTextParagraphProperties.getBulletList() )
 {
     OUString sValue;
@@ -171,9 +169,9 @@ ContextHandlerRef TextParagraphPropertiesContext::onCreateContext( sal_Int32 aEl
         case A_TOKEN( lnSpc ):          // CT_TextSpacing
             return new TextSpacingContext( *this, maLineSpacing );
         case A_TOKEN( spcBef ):         // CT_TextSpacing
-            return new TextSpacingContext( *this, mrSpaceBefore );
+            return new TextSpacingContext( *this, mrTextParagraphProperties.getParaTopMargin() );
         case A_TOKEN( spcAft ):         // CT_TextSpacing
-            return new TextSpacingContext( *this, mrSpaceAfter );
+            return new TextSpacingContext( *this, mrTextParagraphProperties.getParaBottomMargin() );
         // EG_TextBulletColor
         case A_TOKEN( buClrTx ):        // CT_TextBulletColorFollowText ???
             mrBulletList.mbBulletColorFollowText <<= sal_True;


More information about the Libreoffice-commits mailing list