From a6278bc3a9a7de6de5802fc4cbceb739bc0720d6 Mon Sep 17 00:00:00 2001 From: Miklos Vajna Date: Fri, 14 Feb 2014 16:19:50 +0100 Subject: drawingML import: fix inheritance of character height The problem was that in case a shape had multiple (e.g. two) paragraphs, and in case the first paragraph had an explicit character height, but not the second, then the cursor carried over the explicit character height to the second paragraph, but it shouldn't, as that leads to incorrect character height in the second paragraph. Fix this by remembering the default character height and using that in case nothing is set explicitly. Change-Id: I66e06d5cf192739fb254f7280c74617171d9ee6a --- oox/source/drawingml/textbody.cxx | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'oox/source/drawingml/textbody.cxx') diff --git a/oox/source/drawingml/textbody.cxx b/oox/source/drawingml/textbody.cxx index 3df764339779..c90e4826e6e0 100644 --- a/oox/source/drawingml/textbody.cxx +++ b/oox/source/drawingml/textbody.cxx @@ -20,6 +20,7 @@ #include "oox/drawingml/textbody.hxx" #include #include +#include #include "oox/drawingml/textparagraph.hxx" using namespace ::com::sun::star::uno; @@ -63,8 +64,10 @@ void TextBody::insertAt( aCombinedTextStyle.apply( *pMasterTextListStylePtr ); aCombinedTextStyle.apply( maTextListStyle ); + Reference xPropertySet(xAt, UNO_QUERY); + float nCharHeight = xPropertySet->getPropertyValue("CharHeight").get(); for( TextParagraphVector::const_iterator aBeg = maParagraphs.begin(), aIt = aBeg, aEnd = maParagraphs.end(); aIt != aEnd; ++aIt ) - (*aIt)->insertAt( rFilterBase, xText, xAt, rTextStyleProperties, aCombinedTextStyle, aIt == aBeg ); + (*aIt)->insertAt( rFilterBase, xText, xAt, rTextStyleProperties, aCombinedTextStyle, aIt == aBeg, nCharHeight ); } bool TextBody::isEmpty() -- cgit