summaryrefslogtreecommitdiff
path: root/oox/source/export/drawingml.cxx
diff options
context:
space:
mode:
authorTor Lillqvist <tml@collabora.com>2017-02-15 19:21:06 +0200
committerTor Lillqvist <tml@collabora.com>2017-03-04 17:02:20 +0200
commit1154cda87d518156d1e52dfb81d5e23b32ab23d5 (patch)
tree2397e664e0b33fce7807a969ee92c3a78e8251c8 /oox/source/export/drawingml.cxx
parent7453cb58df4ce434a1252567f961cfe497064aca (diff)
tdf#106304: Output <a:br> instead of &#10; for hard newlines
This fixes the problem that the line before the hard newline in the .pptx export is not centred. The fix for the sd_export_ooxml1 test is a bit hacky, but then so is the code in question. Change-Id: I4f89e9d0177ab3b16e8ec624a99fce9e2f8ef730
Diffstat (limited to 'oox/source/export/drawingml.cxx')
-rw-r--r--oox/source/export/drawingml.cxx42
1 files changed, 25 insertions, 17 deletions
diff --git a/oox/source/export/drawingml.cxx b/oox/source/export/drawingml.cxx
index 36c460ab5867..3a575329bf44 100644
--- a/oox/source/export/drawingml.cxx
+++ b/oox/source/export/drawingml.cxx
@@ -1631,29 +1631,37 @@ void DrawingML::WriteRun( const Reference< XTextRange >& rRun )
}
}
- if( ( bWriteField ) )
+ if (sText == "\n")
{
- OString sUUID(GetUUID());
- mpFS->startElementNS( XML_a, XML_fld,
- XML_id, sUUID.getStr(),
- XML_type, OUStringToOString( sFieldValue, RTL_TEXTENCODING_UTF8 ).getStr(),
- FSEND );
+ mpFS->singleElementNS( XML_a, XML_br,
+ FSEND );
}
else
{
- mpFS->startElementNS( XML_a, XML_r, FSEND );
- }
+ if( ( bWriteField ) )
+ {
+ OString sUUID(GetUUID());
+ mpFS->startElementNS( XML_a, XML_fld,
+ XML_id, sUUID.getStr(),
+ XML_type, OUStringToOString( sFieldValue, RTL_TEXTENCODING_UTF8 ).getStr(),
+ FSEND );
+ }
+ else
+ {
+ mpFS->startElementNS( XML_a, XML_r, FSEND );
+ }
- Reference< XPropertySet > xPropSet( rRun, uno::UNO_QUERY );
- WriteRunProperties( xPropSet, bIsURLField );
- mpFS->startElementNS( XML_a, XML_t, FSEND );
- mpFS->writeEscaped( sText );
- mpFS->endElementNS( XML_a, XML_t );
+ Reference< XPropertySet > xPropSet( rRun, uno::UNO_QUERY );
+ WriteRunProperties( xPropSet, bIsURLField );
+ mpFS->startElementNS( XML_a, XML_t, FSEND );
+ mpFS->writeEscaped( sText );
+ mpFS->endElementNS( XML_a, XML_t );
- if( bWriteField )
- mpFS->endElementNS( XML_a, XML_fld );
- else
- mpFS->endElementNS( XML_a, XML_r );
+ if( bWriteField )
+ mpFS->endElementNS( XML_a, XML_fld );
+ else
+ mpFS->endElementNS( XML_a, XML_r );
+ }
}
OUString GetAutoNumType(SvxNumType nNumberingType, bool bSDot, bool bPBehind, bool bPBoth)