summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSzymon Kłos <szymon.klos@collabora.com>2023-08-03 16:53:36 +0200
committerSzymon Kłos <szymon.klos@collabora.com>2023-08-04 10:17:33 +0200
commita68d39c34ea1e418deadc0a5ee2acc2019a582cf (patch)
treecb63ad7b773d6a858619cf88c14b521be8eded03
parentae3b97a69688553e6c40ef4b64655db09d5a0f5e (diff)
oox: default first line indent is 0
When First Line Indent was defined in paragraph properties Impress remembered that value and applied for the next paragraph. Let's set it to default value (0) if property is not set explicitly. Change-Id: I3b075fab594fce64d953553634a49b9769c9341c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155336 Tested-by: Jenkins Reviewed-by: Szymon Kłos <szymon.klos@collabora.com>
-rw-r--r--oox/source/drawingml/textparagraphproperties.cxx2
-rw-r--r--sd/qa/unit/data/pptx/formatting-bullet-indent.pptxbin0 -> 35409 bytes
-rw-r--r--sd/qa/unit/import-tests2.cxx18
3 files changed, 20 insertions, 0 deletions
diff --git a/oox/source/drawingml/textparagraphproperties.cxx b/oox/source/drawingml/textparagraphproperties.cxx
index 8122c4e53324..df3d36a21003 100644
--- a/oox/source/drawingml/textparagraphproperties.cxx
+++ b/oox/source/drawingml/textparagraphproperties.cxx
@@ -494,6 +494,8 @@ void TextParagraphProperties::pushToPropSet( const ::oox::core::XmlFilterBase* p
aPropSet.setProperty( PROP_ParaTabStops, aSeq );
}
}
+ else
+ aPropSet.setProperty<sal_Int32>( PROP_ParaFirstLineIndent, 0);
if ( moDefaultTabSize )
{
diff --git a/sd/qa/unit/data/pptx/formatting-bullet-indent.pptx b/sd/qa/unit/data/pptx/formatting-bullet-indent.pptx
new file mode 100644
index 000000000000..3140d7ce57f8
--- /dev/null
+++ b/sd/qa/unit/data/pptx/formatting-bullet-indent.pptx
Binary files differ
diff --git a/sd/qa/unit/import-tests2.cxx b/sd/qa/unit/import-tests2.cxx
index 0b168ef2bd91..4d197b364449 100644
--- a/sd/qa/unit/import-tests2.cxx
+++ b/sd/qa/unit/import-tests2.cxx
@@ -1900,6 +1900,24 @@ CPPUNIT_TEST_FIXTURE(SdImportTest2, testShapeMasterText)
CPPUNIT_ASSERT_EQUAL(OUString("Custom"), xRun->getString());
}
+CPPUNIT_TEST_FIXTURE(SdImportTest2, testIndentDuplication)
+{
+ createSdImpressDoc("pptx/formatting-bullet-indent.pptx");
+ uno::Reference<beans::XPropertySet> xShape(getShapeFromPage(2, 0));
+
+ uno::Reference<beans::XPropertySet> const xParagraph1(getParagraphFromShape(0, xShape),
+ uno::UNO_QUERY_THROW);
+ sal_Int32 nIndent1;
+ xParagraph1->getPropertyValue("ParaFirstLineIndent") >>= nIndent1;
+ CPPUNIT_ASSERT_EQUAL(sal_Int32(2500), nIndent1);
+
+ uno::Reference<beans::XPropertySet> const xParagraph2(getParagraphFromShape(1, xShape),
+ uno::UNO_QUERY_THROW);
+ sal_Int32 nIndent2;
+ xParagraph2->getPropertyValue("ParaFirstLineIndent") >>= nIndent2;
+ CPPUNIT_ASSERT_EQUAL(sal_Int32(0), nIndent2);
+}
+
CPPUNIT_PLUGIN_IMPLEMENT();
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */