summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorsj <sj@openoffice.org>2010-03-25 15:28:38 +0100
committersj <sj@openoffice.org>2010-03-25 15:28:38 +0100
commit05b9996b4ea5d2328b13b5c4756a4566147f09b6 (patch)
tree355d8a9cc5f7f90c1ab944f50e9d9993f40c2d17
parent8ea419c8c33bafd637da73b1e09807a4c02ec0fe (diff)
impress189: #161894# now correctly importing character properties for empty paragraphs
-rw-r--r--oox/inc/oox/drawingml/textparagraph.hxx6
-rw-r--r--oox/source/drawingml/textbodycontext.cxx2
-rw-r--r--oox/source/drawingml/textparagraph.cxx19
3 files changed, 19 insertions, 8 deletions
diff --git a/oox/inc/oox/drawingml/textparagraph.hxx b/oox/inc/oox/drawingml/textparagraph.hxx
index e98232477f3b..d8c97cbfa114 100644
--- a/oox/inc/oox/drawingml/textparagraph.hxx
+++ b/oox/inc/oox/drawingml/textparagraph.hxx
@@ -54,8 +54,8 @@ public:
inline TextParagraphProperties& getProperties() { return maProperties; }
inline const TextParagraphProperties& getProperties() const { return maProperties; }
- inline TextParagraphProperties& getEndProperties() { return maEndProperties; }
- inline const TextParagraphProperties& getEndProperties() const { return maEndProperties; }
+ inline TextCharacterProperties& getEndProperties() { return maEndProperties; }
+ inline const TextCharacterProperties& getEndProperties() const { return maEndProperties; }
//inline void setProperties( TextParagraphPropertiesPtr pProps ) { mpProperties = pProps; }
@@ -69,7 +69,7 @@ public:
private:
TextParagraphProperties maProperties;
- TextParagraphProperties maEndProperties;
+ TextCharacterProperties maEndProperties;
TextRunVector maRuns;
};
diff --git a/oox/source/drawingml/textbodycontext.cxx b/oox/source/drawingml/textbodycontext.cxx
index 9a197ee691bf..8de730849b24 100644
--- a/oox/source/drawingml/textbodycontext.cxx
+++ b/oox/source/drawingml/textbodycontext.cxx
@@ -109,7 +109,7 @@ Reference< XFastContextHandler > TextParagraphContext::createFastChildContext( s
xRet.set( new TextParagraphPropertiesContext( *this, xAttribs, mrParagraph.getProperties() ) );
break;
case NMSP_DRAWINGML|XML_endParaRPr:
- xRet.set( new TextParagraphPropertiesContext( *this, xAttribs, mrParagraph.getEndProperties() ) );
+ xRet.set( new TextCharacterPropertiesContext( *this, xAttribs, mrParagraph.getEndProperties() ) );
break;
}
diff --git a/oox/source/drawingml/textparagraph.cxx b/oox/source/drawingml/textparagraph.cxx
index 1ff78541243e..f416b3d19d7e 100644
--- a/oox/source/drawingml/textparagraph.cxx
+++ b/oox/source/drawingml/textparagraph.cxx
@@ -29,6 +29,7 @@
#include "oox/drawingml/drawingmltypes.hxx"
#include <rtl/ustring.hxx>
+#include "oox/helper/propertyset.hxx"
#include <com/sun/star/text/XText.hpp>
#include <com/sun/star/text/XTextCursor.hpp>
#include <com/sun/star/text/ControlCharacter.hpp>
@@ -78,11 +79,22 @@ void TextParagraph::insertAt(
xText->insertControlCharacter( xStart, ControlCharacter::APPEND_PARAGRAPH, sal_False );
xAt->gotoEnd( sal_True );
}
+ if ( maRuns.begin() == maRuns.end() )
+ {
+ Reference< XTextRange > xStart( xAt, UNO_QUERY );
+ PropertySet aPropSet( xStart );
- for( TextRunVector::const_iterator aIt = maRuns.begin(), aEnd = maRuns.end(); aIt != aEnd; ++aIt )
+ TextCharacterProperties aTextCharacterProps( aTextCharacterStyle );
+ aTextCharacterProps.assignUsed( maEndProperties );
+ aTextCharacterProps.pushToPropSet( aPropSet, rFilterBase );
+ }
+ else
{
- (*aIt)->insertAt( rFilterBase, xText, xAt, aTextCharacterStyle );
- nParagraphSize += (*aIt)->getText().getLength();
+ for( TextRunVector::const_iterator aIt = maRuns.begin(), aEnd = maRuns.end(); aIt != aEnd; ++aIt )
+ {
+ (*aIt)->insertAt( rFilterBase, xText, xAt, aTextCharacterStyle );
+ nParagraphSize += (*aIt)->getText().getLength();
+ }
}
xAt->gotoEnd( sal_True );
@@ -94,7 +106,6 @@ void TextParagraph::insertAt(
pTextParagraphStyle->pushToPropSet( rFilterBase, xProps, aioBulletList, NULL, sal_False, fCharacterSize );
fCharacterSize = pTextParagraphStyle->getCharHeightPoints( 18 );
}
-
maProperties.pushToPropSet( rFilterBase, xProps, aioBulletList, &pTextParagraphStyle->getBulletList(), sal_True, fCharacterSize );
// empty paragraphs do not have bullets in ppt