From 89206c472ecf18bfde6824cea8004921cd404365 Mon Sep 17 00:00:00 2001 From: Zolnai Tamás Date: Sun, 21 Dec 2014 15:39:36 +0100 Subject: bnc#862510: PPTX import: Wrong text color inside shape When theme index is 0, it means it's unset so we should not apply that. Change-Id: I62a9cd2a9b4c19f5acffc334d5e8263fe24fc8fd --- oox/source/drawingml/shape.cxx | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'oox/source/drawingml') diff --git a/oox/source/drawingml/shape.cxx b/oox/source/drawingml/shape.cxx index 9cffa093af6d..7fdfefd94dc3 100644 --- a/oox/source/drawingml/shape.cxx +++ b/oox/source/drawingml/shape.cxx @@ -1042,11 +1042,14 @@ Reference< XShape > Shape::createAndInsert( TextCharacterProperties aCharStyleProperties; if( const ShapeStyleRef* pFontRef = getShapeStyleRef( XML_fontRef ) ) { - if( pTheme ) - if( const TextCharacterProperties* pCharProps = pTheme->getFontStyle( pFontRef->mnThemedIdx ) ) - aCharStyleProperties.assignUsed( *pCharProps ); - SAL_INFO("oox.drawingml", OSL_THIS_FUNC << "use font color"); - aCharStyleProperties.maCharColor.assignIfUsed( pFontRef->maPhClr ); + if( pFontRef->mnThemedIdx != 0 ) + { + if( pTheme ) + if( const TextCharacterProperties* pCharProps = pTheme->getFontStyle( pFontRef->mnThemedIdx ) ) + aCharStyleProperties.assignUsed( *pCharProps ); + SAL_INFO("oox.drawingml", OSL_THIS_FUNC << "use font color"); + aCharStyleProperties.maCharColor.assignIfUsed( pFontRef->maPhClr ); + } } Reference < XTextCursor > xAt = xText->createTextCursor(); -- cgit