oox/source/drawingml/textparagraphproperties.cxx   |    2 ++
 oox/source/ppt/pptshape.cxx                        |    3 ++-
 sd/qa/unit/data/pptx/formatting-bullet-indent.pptx |binary
 sd/qa/unit/import-tests2.cxx                       |   20 ++++++++++++++++++++
 4 files changed, 24 insertions(+), 1 deletion(-)

New commits:
commit 0b89df718b6b8aac3bd1e0402a9a73ffe11c7100
Author:     Szymon Kłos <szymon.k...@collabora.com>
AuthorDate: Wed Aug 2 08:57:54 2023 +0200
Commit:     Szymon Kłos <szymon.k...@collabora.com>
CommitDate: Mon Aug 7 07:53:45 2023 +0200

    oox: don't use master style by default
    
    By default a shape with empty type attribute in placeholder tag: <p:ph/>
    will get subtype = XML_obj (oox/source/drawingml/shapecontext.cxx:81)
    
    When it is not referencing any master style shape by idx attribute
    we shouldn't use master list style to be compatible with MSO.
    
    Change-Id: Ib695b695885892dbe659e70a28daff1799c5f50e
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155222
    Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoff...@gmail.com>
    Reviewed-by: Ashod Nakashian <a...@collabora.com>

diff --git a/oox/source/ppt/pptshape.cxx b/oox/source/ppt/pptshape.cxx
index 2d0924406536..9634d44e83fe 100644
--- a/oox/source/ppt/pptshape.cxx
+++ b/oox/source/ppt/pptshape.cxx
@@ -206,7 +206,8 @@ void PPTShape::addShape(
                    case XML_obj :
                 {
                     sServiceName = sOutlinerShapeService;
-                    aMasterTextListStyle = rSlidePersist.getMasterPersist() ? 
rSlidePersist.getMasterPersist()->getBodyTextStyle() : 
rSlidePersist.getBodyTextStyle();
+                    if (getSubTypeIndex().has_value())
+                        aMasterTextListStyle = 
rSlidePersist.getMasterPersist() ? 
rSlidePersist.getMasterPersist()->getBodyTextStyle() : 
rSlidePersist.getBodyTextStyle();
                 }
                 break;
                 case XML_body :
commit 9799a95bf8681a7575ba85a698eb1752622af080
Author:     Szymon Kłos <szymon.k...@collabora.com>
AuthorDate: Thu Aug 3 16:53:36 2023 +0200
Commit:     Szymon Kłos <szymon.k...@collabora.com>
CommitDate: Mon Aug 7 07:53:32 2023 +0200

    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/+/155315
    Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoff...@gmail.com>
    Reviewed-by: Ashod Nakashian <a...@collabora.com>

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
Binary files /dev/null and b/sd/qa/unit/data/pptx/formatting-bullet-indent.pptx 
differ
diff --git a/sd/qa/unit/import-tests2.cxx b/sd/qa/unit/import-tests2.cxx
index 1168fdabeb55..102d7e2dfa99 100644
--- a/sd/qa/unit/import-tests2.cxx
+++ b/sd/qa/unit/import-tests2.cxx
@@ -148,6 +148,7 @@ public:
     void testTdf149588TransparentSolidFill();
     void testOverflowBehaviorClip();
     void testShapeMasterText();
+    void testIndentDuplication();
 
     CPPUNIT_TEST_SUITE(SdImportTest2);
 
@@ -229,6 +230,7 @@ public:
     CPPUNIT_TEST(testTdf149588TransparentSolidFill);
     CPPUNIT_TEST(testOverflowBehaviorClip);
     CPPUNIT_TEST(testShapeMasterText);
+    CPPUNIT_TEST(testIndentDuplication);
 
     CPPUNIT_TEST_SUITE_END();
 };
@@ -2064,6 +2066,24 @@ void SdImportTest2::testShapeMasterText()
     CPPUNIT_ASSERT_EQUAL(OUString("Custom"), xRun->getString());
 }
 
+void 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_TEST_SUITE_REGISTRATION(SdImportTest2);
 CPPUNIT_PLUGIN_IMPLEMENT();
 

Reply via email to