summaryrefslogtreecommitdiff
path: root/oox
diff options
context:
space:
mode:
authorPaul Trojahn <paul.trojahn@gmail.com>2018-01-20 18:08:58 +0100
committerTamás Zolnai <tamas.zolnai@collabora.com>2018-01-24 17:22:02 +0100
commit1fe4f041aeef2fcabd90bc07ab6a5ee5aba1dd59 (patch)
tree310da4c80d76c76260bb129adf9fc55c79ec9e7c /oox
parentb7f12d8fd7493a7201ae5fd97e80e0296538f136 (diff)
tdf#114913 Use master if char size wasn't set
The size returned by insertAt falls back to the master size if needed. Change-Id: I741b48616c6c848fc641c597cc72bf8b17e3cad4 Reviewed-on: https://gerrit.libreoffice.org/48456 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Tamás Zolnai <tamas.zolnai@collabora.com>
Diffstat (limited to 'oox')
-rw-r--r--oox/source/drawingml/textparagraph.cxx11
1 files changed, 7 insertions, 4 deletions
diff --git a/oox/source/drawingml/textparagraph.cxx b/oox/source/drawingml/textparagraph.cxx
index 8f1e5d1b061c..e1fe50b31f1b 100644
--- a/oox/source/drawingml/textparagraph.cxx
+++ b/oox/source/drawingml/textparagraph.cxx
@@ -93,6 +93,7 @@ void TextParagraph::insertAt(
}
sal_Int32 nCharHeight = 0;
+ sal_Int32 nCharHeightFirst = 0;
if ( maRuns.empty() )
{
PropertySet aPropSet( xAt );
@@ -100,7 +101,7 @@ void TextParagraph::insertAt(
TextCharacterProperties aTextCharacterProps( aTextCharacterStyle );
aTextCharacterProps.assignUsed( maEndProperties );
if ( aTextCharacterProps.moHeight.has() )
- nCharHeight = aTextCharacterProps.moHeight.get();
+ nCharHeight = nCharHeightFirst = aTextCharacterProps.moHeight.get();
aTextCharacterProps.pushToPropSet( aPropSet, rFilterBase );
}
else
@@ -112,7 +113,10 @@ void TextParagraph::insertAt(
// 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, nDefaultCharHeight ) );
+ sal_Int32 nCharHeightCurrent = (*aIt)->insertAt( rFilterBase, xText, xAt, aTextCharacterStyle, nDefaultCharHeight );
+ if(aIt == maRuns.begin())
+ nCharHeightFirst = nCharHeightCurrent;
+ nCharHeight = std::max< sal_Int32 >( nCharHeight, nCharHeightCurrent);
nParagraphSize += nLen;
}
}
@@ -137,8 +141,7 @@ void TextParagraph::insertAt(
if( !aioBulletList.hasProperty( PROP_GraphicSize ) && maRuns.size() > 0
&& aParaProp.getBulletList().maGraphic.hasValue())
{
- float fFirstCharHeight = maRuns.front()->getTextCharacterProperties().getCharHeightPoints(12);
- long nFirstCharHeightMm = TransformMetric(fFirstCharHeight * 100.f, FUNIT_POINT, FUNIT_MM);
+ long nFirstCharHeightMm = TransformMetric(nCharHeightFirst > 0 ? nCharHeightFirst : 1200, FUNIT_POINT, FUNIT_MM);
float fBulletSizeRel = 1.f;
if( aParaProp.getBulletList().mnSize.hasValue() )
fBulletSizeRel = aParaProp.getBulletList().mnSize.get<sal_Int16>() / 100.f;