summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMark Hung <marklh9@gmail.com>2016-05-31 01:22:11 +0800
committerMichael Stahl <mstahl@redhat.com>2016-05-31 16:32:43 +0000
commit005ae2fa195bddd1073f3d883cf041d9ac80fad1 (patch)
tree397f767ab8f51172ce9a688e468156d81fc35eba
parent09981cd6383ecb99e4b6c83b98b03af5cf3ff59b (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>
-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 a3c40fb18752..c9566bf696ad 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 bdaefa8f7341..a80617c8f876 100644
--- a/sd/qa/unit/export-tests.cxx
+++ b/sd/qa/unit/export-tests.cxx
@@ -130,6 +130,7 @@ public:
void testTableCellBorder();
void testBulletColor();
void testTdf62176();
+ void testTdf93883();
void testBulletCharAndFont();
void testBulletMarginAndIndentation();
void testParaMarginAndindentation();
@@ -185,6 +186,7 @@ public:
CPPUNIT_TEST(testTableCellBorder);
CPPUNIT_TEST(testBulletColor);
CPPUNIT_TEST(testTdf62176);
+ CPPUNIT_TEST(testTdf93883);
CPPUNIT_TEST(testBulletCharAndFont);
CPPUNIT_TEST(testBulletMarginAndIndentation);
CPPUNIT_TEST(testParaMarginAndindentation);
@@ -1070,6 +1072,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);