summaryrefslogtreecommitdiff
path: root/oox
diff options
context:
space:
mode:
authorTibor Nagy <nagy.tibor2@nisz.hu>2021-11-19 12:36:42 +0100
committerXisco Fauli <xiscofauli@libreoffice.org>2021-12-09 17:12:55 +0100
commit8cb29f4154730713878ddd3c273600411ddaf5fe (patch)
treebb55e1202c39e5acd693e0102f51debcab319a02 /oox
parent97ce03ccf1287c1fa79d5741a85fa419e03d9a35 (diff)
tdf#129430 PPTX export: fix workaround for "At least" line spacing
to avoid bad overlapping lines. PPTX does not have the option "At least", so line spacing with this setting is converted to fixed line spacing. Improve this workaround to use single line spacing, if the "At least" value is lower than the size of the characters, like "At least" is handled by Impress. Change-Id: I29b41225d48fd9a447e7f6ef3a8a7cc7ba9ef354 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125553 Tested-by: László Németh <nemeth@numbertext.org> Reviewed-by: László Németh <nemeth@numbertext.org> (cherry picked from commit fc1e5202cbfb36b28b0e597811f39895c19ae6ba) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/126588 Tested-by: Jenkins Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
Diffstat (limited to 'oox')
-rw-r--r--oox/source/export/drawingml.cxx11
1 files changed, 9 insertions, 2 deletions
diff --git a/oox/source/export/drawingml.cxx b/oox/source/export/drawingml.cxx
index 008e6ff9cf12..396288bd9940 100644
--- a/oox/source/export/drawingml.cxx
+++ b/oox/source/export/drawingml.cxx
@@ -2848,13 +2848,20 @@ const char* DrawingML::GetAlignment( style::ParagraphAdjust nAlignment )
return sAlignment;
}
-void DrawingML::WriteLinespacing( const LineSpacing& rSpacing )
+void DrawingML::WriteLinespacing(const LineSpacing& rSpacing, float fFirstCharHeight)
{
if( rSpacing.Mode == LineSpacingMode::PROP )
{
mpFS->singleElementNS( XML_a, XML_spcPct,
XML_val, OString::number(static_cast<sal_Int32>(rSpacing.Height)*1000));
}
+ else if (rSpacing.Mode == LineSpacingMode::MINIMUM
+ && fFirstCharHeight > static_cast<float>(rSpacing.Height) * 0.001 * 72.0 / 2.54)
+ {
+ // 100% proportional line spacing = single line spacing
+ mpFS->singleElementNS(XML_a, XML_spcPct, XML_val,
+ OString::number(static_cast<sal_Int32>(100000)));
+ }
else
{
mpFS->singleElementNS( XML_a, XML_spcPts,
@@ -2942,7 +2949,7 @@ bool DrawingML::WriteParagraphProperties( const Reference< XTextContent >& rPara
if( bHasLinespacing )
{
mpFS->startElementNS(XML_a, XML_lnSpc);
- WriteLinespacing( aLineSpacing );
+ WriteLinespacing(aLineSpacing, fFirstCharHeight);
mpFS->endElementNS( XML_a, XML_lnSpc );
}