summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMark Hung <marklh9@gmail.com>2016-05-31 01:22:11 +0800
committerMiklos Vajna <vmiklos@collabora.co.uk>2016-06-07 07:22:13 +0000
commit02a5941c6ea747fa26dcbb27aa45ef9faac9c857 (patch)
tree035e528fe447b343f28d6b8bab4999bff6a11eec
parent212ebeb225fae10db4dbb4c4a1a4f3fd2d100f42 (diff)
tdf#93883 don't add space to empty paragraph when bullet is turned off.
Change-Id: Ia1bad61cb5585dae0501e8cd657fc84bfea60ab2 Reviewed-on: https://gerrit.libreoffice.org/25679 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Michael Stahl <mstahl@redhat.com> (cherry picked from commit 005ae2fa195bddd1073f3d883cf041d9ac80fad1) Reviewed-on: https://gerrit.libreoffice.org/25984
-rw-r--r--oox/source/export/drawingml.cxx5
-rwxr-xr-xsd/qa/unit/data/odp/tdf93883.odpbin0 -> 11057 bytes
-rw-r--r--sd/qa/unit/export-tests.cxx12
3 files changed, 16 insertions, 1 deletions
diff --git a/oox/source/export/drawingml.cxx b/oox/source/export/drawingml.cxx
index 880351d61bd1..dfa46d7d1699 100644
--- a/oox/source/export/drawingml.cxx
+++ b/oox/source/export/drawingml.cxx
@@ -1583,6 +1583,9 @@ void DrawingML::WriteRun( const Reference< XTextRange >& rRun )
sal_Int16 nLevel = -1;
GET( nLevel, NumberingLevel );
+ bool bNumberingIsNumber = true;
+ GET( bNumberingIsNumber, NumberingIsNumber );
+
bool bIsURLField = false;
OUString sFieldValue = GetFieldValue( rRun, bIsURLField );
bool bWriteField = !( sFieldValue.isEmpty() || bIsURLField );
@@ -1590,7 +1593,7 @@ void DrawingML::WriteRun( const Reference< XTextRange >& rRun )
OUString sText = rRun->getString();
//if there is no text following the bullet, add a space after the bullet
- if (nLevel !=-1 && sText.isEmpty() )
+ if (nLevel !=-1 && bNumberingIsNumber && sText.isEmpty() )
sText=" ";
if ( bIsURLField )
diff --git a/sd/qa/unit/data/odp/tdf93883.odp b/sd/qa/unit/data/odp/tdf93883.odp
new file mode 100755
index 000000000000..54d589ca0fe8
--- /dev/null
+++ b/sd/qa/unit/data/odp/tdf93883.odp
Binary files differ
diff --git a/sd/qa/unit/export-tests.cxx b/sd/qa/unit/export-tests.cxx
index 1665ac23b0a2..a7fd6051370e 100644
--- a/sd/qa/unit/export-tests.cxx
+++ b/sd/qa/unit/export-tests.cxx
@@ -131,6 +131,7 @@ public:
void testTableCellBorder();
void testBulletColor();
void testTdf62176();
+ void testTdf93883();
void testBulletCharAndFont();
void testBulletMarginAndIndentation();
void testParaMarginAndindentation();
@@ -186,6 +187,7 @@ public:
CPPUNIT_TEST(testTableCellBorder);
CPPUNIT_TEST(testBulletColor);
CPPUNIT_TEST(testTdf62176);
+ CPPUNIT_TEST(testTdf93883);
CPPUNIT_TEST(testBulletCharAndFont);
CPPUNIT_TEST(testBulletMarginAndIndentation);
CPPUNIT_TEST(testParaMarginAndindentation);
@@ -1074,6 +1076,16 @@ void SdExportTest::testTdf62176()
xDocShRef->DoClose();
}
+void SdExportTest::testTdf93883()
+{
+ ::sd::DrawDocShellRef xDocShRef = loadURL( m_directories.getURLFromSrc("/sd/qa/unit/data/odp/tdf93883.odp"), ODP);
+ xDocShRef = saveAndReload( xDocShRef, PPTX );
+ uno::Reference< beans::XPropertySet > xShape( getShapeFromPage( 0, 0, xDocShRef ) );
+ uno::Reference<text::XTextRange> const xParagraph( getParagraphFromShape( 0, xShape ) );
+ uno::Reference< beans::XPropertySet > xPropSet( xParagraph, uno::UNO_QUERY_THROW );
+ CPPUNIT_ASSERT(!xPropSet->getPropertyValue("NumberingLevel").hasValue());
+}
+
void SdExportTest::testBulletCharAndFont()
{
::sd::DrawDocShellRef xDocShRef = loadURL( m_directories.getURLFromSrc("/sd/qa/unit/data/odp/bulletCharAndFont.odp"), ODP);