oox/inc/oox/drawingml/textparagraphproperties.hxx |    2 +-
 oox/source/drawingml/textparagraph.cxx            |    9 +++++++--
 oox/source/drawingml/textparagraphproperties.cxx  |    7 ++++---
 3 files changed, 12 insertions(+), 6 deletions(-)

New commits:
commit b8b054785b9718f0ec08f92b0c53cac7a497b189
Author: Muthu Subramanian <sumu...@suse.com>
Date:   Tue Aug 14 17:43:54 2012 +0530

    n#759180: Override properties with endParaPr.
    
    This is done only for empty textruns.

diff --git a/oox/source/drawingml/textparagraph.cxx 
b/oox/source/drawingml/textparagraph.cxx
index 163b79c..a47a5d5 100644
--- a/oox/source/drawingml/textparagraph.cxx
+++ b/oox/source/drawingml/textparagraph.cxx
@@ -92,8 +92,13 @@ void TextParagraph::insertAt(
         {
             for( TextRunVector::const_iterator aIt = maRuns.begin(), aEnd = 
maRuns.end(); aIt != aEnd; ++aIt )
             {
+                sal_Int32 nLen = (*aIt)->getText().getLength();
+                // n#759180: Force use, maEndProperties for the last segment
+                // This is currently applied to only empty runs
+                if( !nLen && ( ( aIt + 1 ) == aEnd ) )
+                    (*aIt)->getTextCharacterProperties().assignUsed( 
maEndProperties );
                 nCharHeight = std::max< sal_Int32 >( nCharHeight, 
(*aIt)->insertAt( rFilterBase, xText, xAt, aTextCharacterStyle ) );
-                nParagraphSize += (*aIt)->getText().getLength();
+                nParagraphSize += nLen;
             }
         }
         xAt->gotoEnd( sal_True );
commit ed011e491bc9c4ca5ea90851bb81384eb0b47537
Author: Muthu Subramanian <sumu...@suse.com>
Date:   Tue Aug 14 17:41:59 2012 +0530

    n#759180: Push oox default spacing values.

diff --git a/oox/inc/oox/drawingml/textparagraphproperties.hxx 
b/oox/inc/oox/drawingml/textparagraphproperties.hxx
index c9f6ea7..3dacd86 100644
--- a/oox/inc/oox/drawingml/textparagraphproperties.hxx
+++ b/oox/inc/oox/drawingml/textparagraphproperties.hxx
@@ -97,7 +97,7 @@ public:
     void                                apply( const TextParagraphProperties& 
rSourceProps );
     void                                pushToPropSet( const 
::oox::core::XmlFilterBase* pFilterBase,
                                             const 
::com::sun::star::uno::Reference < ::com::sun::star::beans::XPropertySet > & 
xPropSet,
-                                                PropertyMap& rioBulletList, 
const BulletList* pMasterBuList, sal_Bool bApplyBulletList, float fFontSize ) 
const;
+                                                PropertyMap& rioBulletList, 
const BulletList* pMasterBuList, sal_Bool bApplyBulletList, float fFontSize, 
bool bPushDefaultValues = false ) const;
     void                                pushToPropSet( const 
::com::sun::star::uno::Reference < ::com::sun::star::beans::XPropertySet > & 
xPropSet) const;
 
     /** Returns the largest character size of this paragraph. If possible the
diff --git a/oox/source/drawingml/textparagraph.cxx 
b/oox/source/drawingml/textparagraph.cxx
index 24804c8..163b79c 100644
--- a/oox/source/drawingml/textparagraph.cxx
+++ b/oox/source/drawingml/textparagraph.cxx
@@ -103,7 +103,7 @@ void TextParagraph::insertAt(
         float fCharacterSize = nCharHeight > 0 ? GetFontHeight( nCharHeight ) 
:  18;
         if ( pTextParagraphStyle.get() )
         {
-            pTextParagraphStyle->pushToPropSet( &rFilterBase, xProps, 
aioBulletList, NULL, sal_True, fCharacterSize );
+            pTextParagraphStyle->pushToPropSet( &rFilterBase, xProps, 
aioBulletList, NULL, sal_True, fCharacterSize, true );
             fCharacterSize = pTextParagraphStyle->getCharHeightPoints( 
fCharacterSize );
 
             // bullets have same color as following texts by default
diff --git a/oox/source/drawingml/textparagraphproperties.cxx 
b/oox/source/drawingml/textparagraphproperties.cxx
index e9afae2..3cd0bba 100644
--- a/oox/source/drawingml/textparagraphproperties.cxx
+++ b/oox/source/drawingml/textparagraphproperties.cxx
@@ -381,7 +381,8 @@ void TextParagraphProperties::apply( const 
TextParagraphProperties& rSourceProps
 }
 
 void TextParagraphProperties::pushToPropSet( const ::oox::core::XmlFilterBase* 
pFilterBase,
-    const Reference < XPropertySet >& xPropSet, PropertyMap& rioBulletMap, 
const BulletList* pMasterBuList, sal_Bool bApplyBulletMap, float fCharacterSize 
) const
+    const Reference < XPropertySet >& xPropSet, PropertyMap& rioBulletMap, 
const BulletList* pMasterBuList, sal_Bool bApplyBulletMap, float fCharacterSize,
+    bool bPushDefaultValues ) const
 {
     PropertySet aPropSet( xPropSet );
     aPropSet.setProperties( maTextParagraphPropertyMap );
@@ -396,9 +397,9 @@ void TextParagraphProperties::pushToPropSet( const 
::oox::core::XmlFilterBase* p
 
     maBulletList.pushToPropMap( pFilterBase, rioBulletMap );
 
-    if ( maParaTopMargin.bHasValue )
+    if ( maParaTopMargin.bHasValue || bPushDefaultValues )
         aPropSet.setProperty( PROP_ParaTopMargin, maParaTopMargin.toMargin( 
fCharacterSize != 0.0 ? fCharacterSize : getCharHeightPoints ( 18.0 ) ) );
-    if ( maParaBottomMargin.bHasValue )
+    if ( maParaBottomMargin.bHasValue || bPushDefaultValues )
         aPropSet.setProperty( PROP_ParaBottomMargin, 
maParaBottomMargin.toMargin( fCharacterSize != 0.0 ? fCharacterSize : 
getCharHeightPoints ( 18.0 ) ) );
     if ( nNumberingType == NumberingType::BITMAP )
     {
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to