Kaydet (Commit) bb3540a7 authored tarafından Muthu Subramanian's avatar Muthu Subramanian

n#778854: Fixes quite some issues with bullet points.

* Properties needs to be combined before applyed.
  Rather than applying them separately twice.
* ParaMargins set to zero wrongly rather than boost::none
  This caused its own set of problems.
* Hack: Push default zero to tabstops. This makes impress
  calculate proper values for tabstops using leftmargin.
üst e2c481db
...@@ -108,15 +108,16 @@ void TextParagraph::insertAt( ...@@ -108,15 +108,16 @@ void TextParagraph::insertAt(
float fCharacterSize = nCharHeight > 0 ? GetFontHeight( nCharHeight ) : 18; float fCharacterSize = nCharHeight > 0 ? GetFontHeight( nCharHeight ) : 18;
if ( pTextParagraphStyle.get() ) if ( pTextParagraphStyle.get() )
{ {
pTextParagraphStyle->pushToPropSet( &rFilterBase, xProps, aioBulletList, NULL, sal_True, fCharacterSize, true ); TextParagraphProperties aParaProp;
aParaProp.apply( *pTextParagraphStyle );
aParaProp.apply( maProperties );
aParaProp.pushToPropSet( &rFilterBase, xProps, aioBulletList, &pTextParagraphStyle->getBulletList(), sal_True, fCharacterSize, true );
fCharacterSize = pTextParagraphStyle->getCharHeightPoints( fCharacterSize ); fCharacterSize = pTextParagraphStyle->getCharHeightPoints( fCharacterSize );
// bullets have same color as following texts by default // bullets have same color as following texts by default
if( !aioBulletList.hasProperty( PROP_BulletColor ) && maRuns.size() > 0 if( !aioBulletList.hasProperty( PROP_BulletColor ) && maRuns.size() > 0
&& (*maRuns.begin())->getTextCharacterProperties().maCharColor.isUsed() ) && (*maRuns.begin())->getTextCharacterProperties().maCharColor.isUsed() )
aioBulletList[ PROP_BulletColor ] <<= (*maRuns.begin())->getTextCharacterProperties().maCharColor.getColor( rFilterBase.getGraphicHelper() ); aioBulletList[ PROP_BulletColor ] <<= (*maRuns.begin())->getTextCharacterProperties().maCharColor.getColor( rFilterBase.getGraphicHelper() );
maProperties.pushToPropSet( &rFilterBase, xProps, aioBulletList, &pTextParagraphStyle->getBulletList(), sal_True, fCharacterSize );
} }
// empty paragraphs do not have bullets in ppt // empty paragraphs do not have bullets in ppt
......
...@@ -26,6 +26,7 @@ ...@@ -26,6 +26,7 @@
#include <com/sun/star/awt/XBitmap.hpp> #include <com/sun/star/awt/XBitmap.hpp>
#include <com/sun/star/graphic/XGraphic.hpp> #include <com/sun/star/graphic/XGraphic.hpp>
#include <com/sun/star/beans/PropertyValue.hpp> #include <com/sun/star/beans/PropertyValue.hpp>
#include <com/sun/star/style/TabStop.hpp>
#include "oox/helper/helper.hxx" #include "oox/helper/helper.hxx"
#include "oox/helper/propertyset.hxx" #include "oox/helper/propertyset.hxx"
...@@ -418,12 +419,15 @@ void TextParagraphProperties::pushToPropSet( const ::oox::core::XmlFilterBase* p ...@@ -418,12 +419,15 @@ void TextParagraphProperties::pushToPropSet( const ::oox::core::XmlFilterBase* p
if ( noParaLeftMargin ) if ( noParaLeftMargin )
{ {
rioBulletMap[ PROP_LeftMargin ] <<= static_cast< sal_Int32 >( *noParaLeftMargin ); rioBulletMap[ PROP_LeftMargin ] <<= static_cast< sal_Int32 >( *noParaLeftMargin );
noParaLeftMargin = boost::optional< sal_Int32 >( 0 ); noParaLeftMargin = boost::none;
} }
if ( noFirstLineIndentation ) if ( noFirstLineIndentation )
{ {
// Force Paragraph property as zero - impress seems to use the value from previous
// (non) bullet line if not set to zero explicitly :(
aPropSet.setProperty( PROP_ParaFirstLineIndent, 0 );
rioBulletMap[ PROP_FirstLineOffset ] <<= static_cast< sal_Int32 >( *noFirstLineIndentation ); rioBulletMap[ PROP_FirstLineOffset ] <<= static_cast< sal_Int32 >( *noFirstLineIndentation );
noFirstLineIndentation = boost::optional< sal_Int32 >( 0 ); noFirstLineIndentation = boost::none;
} }
if ( nNumberingType != NumberingType::BITMAP && !rioBulletMap.hasProperty( PROP_BulletColor ) && pFilterBase ) if ( nNumberingType != NumberingType::BITMAP && !rioBulletMap.hasProperty( PROP_BulletColor ) && pFilterBase )
rioBulletMap[ PROP_BulletColor ] <<= static_cast< sal_Int32 >( maTextCharacterProperties.maCharColor.getColor( pFilterBase->getGraphicHelper())); rioBulletMap[ PROP_BulletColor ] <<= static_cast< sal_Int32 >( maTextCharacterProperties.maCharColor.getColor( pFilterBase->getGraphicHelper()));
...@@ -459,7 +463,18 @@ void TextParagraphProperties::pushToPropSet( const ::oox::core::XmlFilterBase* p ...@@ -459,7 +463,18 @@ void TextParagraphProperties::pushToPropSet( const ::oox::core::XmlFilterBase* p
if ( noParaLeftMargin ) if ( noParaLeftMargin )
aPropSet.setProperty( PROP_ParaLeftMargin, sal_Int32( *noParaLeftMargin ) ); aPropSet.setProperty( PROP_ParaLeftMargin, sal_Int32( *noParaLeftMargin ) );
if ( noFirstLineIndentation ) if ( noFirstLineIndentation )
{
aPropSet.setProperty( PROP_ParaFirstLineIndent, *noFirstLineIndentation ); aPropSet.setProperty( PROP_ParaFirstLineIndent, *noFirstLineIndentation );
if( bPushDefaultValues )
{
// Reset TabStops - these would be auto calculated by Impress
TabStop aTabStop;
aTabStop.Position = 0;
Sequence< TabStop > aSeq(1);
aSeq[0] = aTabStop;
aPropSet.setProperty( PROP_ParaTabStops, aSeq );
}
}
} }
float TextParagraphProperties::getCharHeightPoints( float fDefault ) const float TextParagraphProperties::getCharHeightPoints( float fDefault ) const
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment