[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-6.4' - 6 commits - chart2/qa oox/source sw/qa sw/source sw/uiconfig writerfilter/source

Tünde Tóth (via logerrit) logerrit at kemper.freedesktop.org
Tue Jun 2 16:58:38 UTC 2020


 chart2/qa/extras/chart2export.cxx             |   11 ++++
 chart2/qa/extras/data/xlsx/chart_pie2007.xlsx |binary
 oox/source/drawingml/chart/typegroupmodel.cxx |    2 
 sw/qa/extras/ooxmlexport/data/tdf78352.docx   |binary
 sw/qa/extras/ooxmlexport/ooxmlexport14.cxx    |    9 +++
 sw/qa/extras/uiwriter/data2/tdf131684.docx    |binary
 sw/qa/extras/uiwriter/data2/tdf132236.odt     |binary
 sw/qa/extras/uiwriter/uiwriter2.cxx           |   64 ++++++++++++++++++++++++++
 sw/source/core/layout/frmtool.cxx             |   53 ++++++++++++++++++++-
 sw/source/core/layout/layhelp.hxx             |    3 -
 sw/source/core/undo/undel.cxx                 |    1 
 sw/uiconfig/swriter/ui/mmcreatingdialog.ui    |    1 
 writerfilter/source/dmapper/DomainMapper.cxx  |    2 
 13 files changed, 141 insertions(+), 5 deletions(-)

New commits:
commit 8a491038c13e977c5ab28292f2df1abf2426ad09
Author:     Tünde Tóth <tundeth at gmail.com>
AuthorDate: Tue May 26 13:34:32 2020 +0200
Commit:     Michael Meeks <michael.meeks at collabora.com>
CommitDate: Tue Jun 2 17:31:23 2020 +0100

    tdf#132594 Chart XLSX import: fix legend entries in pie charts
    
    Legend entry text of pie chart wasn't imported correctly
    in XLSX documents created with Excel 2007.
    
    Regression from commit: e0b0502516a10181bbd1737b93b38b2bba4c98e8
    (tdf#128016 Chart OOXML Import: fix duplicated category labels)
    
    Change-Id: I4567437a41fe66e124dccbd148c0c49196d5c007
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/94864
    Tested-by: Jenkins
    Tested-by: László Németh <nemeth at numbertext.org>
    Reviewed-by: László Németh <nemeth at numbertext.org>
    Signed-off-by: Xisco Fauli <xiscofauli at libreoffice.org>
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/95294

diff --git a/chart2/qa/extras/chart2export.cxx b/chart2/qa/extras/chart2export.cxx
index 6826c3f53569..cb9e4aa32df3 100644
--- a/chart2/qa/extras/chart2export.cxx
+++ b/chart2/qa/extras/chart2export.cxx
@@ -152,6 +152,7 @@ public:
     void testTdf123206_customLabelText();
     void testCustomLabelText();
     void testTdf131979();
+    void testTdf132594();
 
     CPPUNIT_TEST_SUITE(Chart2ExportTest);
     CPPUNIT_TEST(testErrorBarXLSX);
@@ -267,6 +268,7 @@ public:
     CPPUNIT_TEST(testTdf123206_customLabelText);
     CPPUNIT_TEST(testCustomLabelText);
     CPPUNIT_TEST(testTdf131979);
+    CPPUNIT_TEST(testTdf132594);
 
     CPPUNIT_TEST_SUITE_END();
 
@@ -2467,6 +2469,15 @@ void Chart2ExportTest::testTdf131979()
     }
 }
 
+void Chart2ExportTest::testTdf132594()
+{
+    load("/chart2/qa/extras/data/xlsx/", "chart_pie2007.xlsx");
+    xmlDocPtr pXmlDoc = parseExport("xl/charts/chart","Calc Office Open XML");
+    CPPUNIT_ASSERT(pXmlDoc);
+
+    assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:pieChart/c:ser/c:cat", 1);
+}
+
 CPPUNIT_TEST_SUITE_REGISTRATION(Chart2ExportTest);
 
 CPPUNIT_PLUGIN_IMPLEMENT();
diff --git a/chart2/qa/extras/data/xlsx/chart_pie2007.xlsx b/chart2/qa/extras/data/xlsx/chart_pie2007.xlsx
new file mode 100644
index 000000000000..b122680257c0
Binary files /dev/null and b/chart2/qa/extras/data/xlsx/chart_pie2007.xlsx differ
diff --git a/oox/source/drawingml/chart/typegroupmodel.cxx b/oox/source/drawingml/chart/typegroupmodel.cxx
index aae01ed0f58e..7353bafbecc7 100644
--- a/oox/source/drawingml/chart/typegroupmodel.cxx
+++ b/oox/source/drawingml/chart/typegroupmodel.cxx
@@ -57,7 +57,7 @@ TypeGroupModel::TypeGroupModel( sal_Int32 nTypeId, bool bMSO2007Doc ) :
     mbSmooth( !bMSO2007Doc ),
     mbVaryColors( !bMSO2007Doc ),
     mbWireframe( !bMSO2007Doc ),
-    mbCatAxisVisible( !bMSO2007Doc )
+    mbCatAxisVisible( true )
 {
 }
 
commit 8257c984cc2f7c32ef096102fd7d588d6f1e7497
Author:     Michael Weghorn <m.weghorn at posteo.de>
AuthorDate: Wed May 27 10:15:23 2020 +0200
Commit:     Michael Meeks <michael.meeks at collabora.com>
CommitDate: Tue Jun 2 17:31:19 2020 +0100

    tdf#133426 Make mail merge progress dialog modal
    
    This prevents doing things like trying to start another mail
    merge for the same doc in parallel, thus crashing LibreOffice.
    
    Change-Id: I5df2e804d97e82cccca4f0e297cb6d3396652882
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/94933
    Tested-by: Jenkins
    Reviewed-by: Michael Weghorn <m.weghorn at posteo.de>
    (cherry picked from commit 77140de3fe925f75620e94dbd848b1c925935fb5)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/95247
    Reviewed-by: Adolfo Jayme Barrientos <fitojb at ubuntu.com>

diff --git a/sw/uiconfig/swriter/ui/mmcreatingdialog.ui b/sw/uiconfig/swriter/ui/mmcreatingdialog.ui
index c7c787c37c13..3af13d32de04 100644
--- a/sw/uiconfig/swriter/ui/mmcreatingdialog.ui
+++ b/sw/uiconfig/swriter/ui/mmcreatingdialog.ui
@@ -5,6 +5,7 @@
     <property name="can_focus">False</property>
     <property name="border_width">6</property>
     <property name="title" translatable="yes" context="mmcreatingdialog|MMCreatingDialog">Mail Merge</property>
+    <property name="modal">True</property>
     <property name="type_hint">dialog</property>
     <child internal-child="vbox">
       <object class="GtkBox" id="dialog-vbox1">
commit 5fedb57a8c7fe17ce4c30f4eb1c70db00b25551b
Author:     Michael Stahl <Michael.Stahl at cib.de>
AuthorDate: Tue May 26 16:43:27 2020 +0200
Commit:     Michael Meeks <michael.meeks at collabora.com>
CommitDate: Tue Jun 2 17:30:31 2020 +0100

    tdf#131684 tdf#132236 sw_redlinehide: fix upper of frame moved...
    
    ... in SwUndoDelete::UndoImpl; this wasn't fixed properly in commit
    6c7245e789f973cf6dad03f7008ab3f9d12d350c - the SwTextFrame was moved
    into the SwSectionFrame but its upper was whatever it was previously.
    
    This is rather ugly because with the constraint from the very special
    case of tdf#131684 the MakeFrames() requires one node with pre-existing
    frames, and it's not possible to move the pre-existing frame after
    MakeFrames() because then the tdf#132236 case will have an empty
    SwSectionFrame and InsertCnt_() will just delete it.
    
    So try to detect the situation with some hack in InsertCnt_() to move
    it into the SwSectionFrame.
    
    (regression from 723728cd358693b8f4bc9d913541aa4479f2bd48)
    
    Change-Id: Ic0199c85d7523a49676ad3df1d2c4d8fe135c2ff
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/94881
    Tested-by: Jenkins
    Reviewed-by: Michael Stahl <michael.stahl at cib.de>
    (cherry picked from commit 55576842ec72a748d0bad123d41fa03c89fc136d)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/95023
    Reviewed-by: Miklos Vajna <vmiklos at collabora.com>

diff --git a/sw/qa/extras/uiwriter/uiwriter2.cxx b/sw/qa/extras/uiwriter/uiwriter2.cxx
index 244c82e01a6d..6c8ef7966efb 100644
--- a/sw/qa/extras/uiwriter/uiwriter2.cxx
+++ b/sw/qa/extras/uiwriter/uiwriter2.cxx
@@ -172,6 +172,15 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest2, testTdf131684)
     // without the fix, it crashes
     lcl_dispatchCommand(mxComponent, ".uno:Undo", {});
     CPPUNIT_ASSERT_EQUAL(sal_Int32(1), xIndexAccess->getCount());
+
+    // check that the text frame has the correct upper
+    xmlDocPtr pXmlDoc = parseLayoutDump();
+    OUString const sectionId = getXPath(pXmlDoc, "/root/page[1]/body/section[7]", "id");
+    OUString const sectionLower = getXPath(pXmlDoc, "/root/page[1]/body/section[7]", "lower");
+    OUString const textId = getXPath(pXmlDoc, "/root/page[1]/body/section[7]/txt[1]", "id");
+    OUString const textUpper = getXPath(pXmlDoc, "/root/page[1]/body/section[7]/txt[1]", "upper");
+    CPPUNIT_ASSERT_EQUAL(textId, sectionLower);
+    CPPUNIT_ASSERT_EQUAL(sectionId, textUpper);
 }
 
 CPPUNIT_TEST_FIXTURE(SwUiWriterTest2, testTdfChangeNumberingListAutoFormat)
diff --git a/sw/source/core/layout/frmtool.cxx b/sw/source/core/layout/frmtool.cxx
index 32447b47bb45..2a2a59377636 100644
--- a/sw/source/core/layout/frmtool.cxx
+++ b/sw/source/core/layout/frmtool.cxx
@@ -1694,6 +1694,36 @@ void InsertCnt_( SwLayoutFrame *pLay, SwDoc *pDoc,
                             static_cast<SwTextFrame*>(pPrv)->Prepare( PREP_QUOVADIS, nullptr, false );
                     }
                 }
+                if (nIndex + 1 == nEndIndex)
+                {   // tdf#131684 tdf#132236 fix upper of frame moved in
+                    // SwUndoDelete; can't be done there unfortunately
+                    // because empty section frames are deleted here
+                    SwFrame *const pNext(
+                        // if there's a parent section, it has been split
+                        // into 2 SwSectionFrame already :(
+                        (   pFrame->GetNext()->IsSctFrame()
+                         && pActualSection->GetUpper()
+                         && pActualSection->GetUpper()->GetSectionNode() ==
+                             static_cast<SwSectionFrame const*>(pFrame->GetNext())->GetSection()->GetFormat()->GetSectionNode())
+                        ? static_cast<SwSectionFrame *>(pFrame->GetNext())->ContainsContent()
+                        : pFrame->GetNext());
+                    if (pNext
+                        && pNext->IsTextFrame()
+                        && static_cast<SwTextFrame*>(pNext)->GetTextNodeFirst() == pDoc->GetNodes()[nEndIndex]
+                        && (pNext->GetUpper() == pFrame->GetUpper()
+                            || pFrame->GetNext()->IsSctFrame())) // checked above
+                    {
+                        pNext->Cut();
+                        pNext->InvalidateInfFlags(); // mbInfSct changed
+                        // could have columns
+                        SwSectionFrame *const pSection(static_cast<SwSectionFrame*>(pFrame));
+                        assert(!pSection->Lower() || pSection->Lower()->IsLayoutFrame());
+                        SwLayoutFrame *const pParent(pSection->Lower() ? pSection->GetNextLayoutLeaf() : pSection);
+                        assert(!pParent->Lower());
+                        // paste invalidates, section could have indent...
+                        pNext->Paste(pParent, nullptr);
+                    }
+                }
                 // #i27138#
                 // notify accessibility paragraphs objects about changed
                 // CONTENT_FLOWS_FROM/_TO relation.
commit 8239cca9d64828363b1cd70fce7a8f9ed0be03b9
Author:     Michael Stahl <Michael.Stahl at cib.de>
AuthorDate: Tue May 26 16:46:57 2020 +0200
Commit:     Michael Meeks <michael.meeks at collabora.com>
CommitDate: Tue Jun 2 17:30:28 2020 +0100

    tdf#132236 sw_redlinehide: fix SwUndoDelete with sections even more
    
    SwUndoDelete::UndoImpl may want to move something like this into the
    nodes-array:
    
    [   9]  0x6356fe0            TextNode "",
    [  10]  0x31cba00        ~DeletedNode ,
    [  11]  0x64d8840            TextNode "Introduction - xzn Overview Of KmneqxziTY\t3",
    [  12]  0x64e9750            TextNode "shell\t20",
    [  13]  0x7a0f0a0        ~DeletedNode ,
    
    The ~DeletedNode become end nodes of section nodes; in this case
    m_nSectDiff != 0.
    
    Don't skip these end nodes because in the above "Untitled 1.odt"
    example, they are not necessarily consecutive.
    
    Between the 1st and 2nd one a new SwSectionFrame must be created via the
    outer section, so adapt InsertCnt_() to check for extra end nodes in the
    range and do this.
    
    (regression from 723728cd358693b8f4bc9d913541aa4479f2bd48)
    
    Change-Id: I7bfba9efca1789392495ebec37eb3e5b6138bd07
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/94883
    Tested-by: Jenkins
    Reviewed-by: Michael Stahl <michael.stahl at cib.de>
    (cherry picked from commit ca8e04f1ab739e14288ab5e0be44723536b9ca4e)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/94963
    Reviewed-by: Miklos Vajna <vmiklos at collabora.com>

diff --git a/sw/qa/extras/uiwriter/data2/tdf132236.odt b/sw/qa/extras/uiwriter/data2/tdf132236.odt
new file mode 100644
index 000000000000..f37c9befc095
Binary files /dev/null and b/sw/qa/extras/uiwriter/data2/tdf132236.odt differ
diff --git a/sw/qa/extras/uiwriter/uiwriter2.cxx b/sw/qa/extras/uiwriter/uiwriter2.cxx
index 5156b7138242..244c82e01a6d 100644
--- a/sw/qa/extras/uiwriter/uiwriter2.cxx
+++ b/sw/qa/extras/uiwriter/uiwriter2.cxx
@@ -338,6 +338,30 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest2, testRedlineInHiddenSection)
     CPPUNIT_ASSERT(pNode->GetNodes()[pNode->GetIndex() + 4]->IsEndNode());
 }
 
+CPPUNIT_TEST_FIXTURE(SwUiWriterTest2, testTdf132236)
+{
+    load(DATA_DIRECTORY, "tdf132236.odt");
+
+    SwXTextDocument* const pTextDoc = dynamic_cast<SwXTextDocument*>(mxComponent.get());
+    CPPUNIT_ASSERT(pTextDoc);
+
+    // select everything and delete
+    SwWrtShell* const pWrtShell(pTextDoc->GetDocShell()->GetWrtShell());
+    pWrtShell->Down(true);
+    pWrtShell->Down(true);
+    pWrtShell->Down(true);
+    pWrtShell->Delete();
+    SwDoc* const pDoc(pWrtShell->GetDoc());
+    sw::UndoManager& rUndoManager(pDoc->GetUndoManager());
+    rUndoManager.Undo();
+
+    // check that the text frames exist inside their sections
+    xmlDocPtr pXmlDoc = parseLayoutDump();
+    assertXPath(pXmlDoc, "/root/page[1]/body/section[1]/txt", 1);
+    assertXPath(pXmlDoc, "/root/page[1]/body/section[2]/txt", 2);
+    assertXPath(pXmlDoc, "/root/page[1]/body/txt", 1);
+}
+
 CPPUNIT_TEST_FIXTURE(SwUiWriterTest2, testTdf54819)
 {
     load(DATA_DIRECTORY, "tdf54819.fodt");
diff --git a/sw/source/core/layout/frmtool.cxx b/sw/source/core/layout/frmtool.cxx
index 5c6e6cc4dd44..32447b47bb45 100644
--- a/sw/source/core/layout/frmtool.cxx
+++ b/sw/source/core/layout/frmtool.cxx
@@ -1478,7 +1478,23 @@ void InsertCnt_( SwLayoutFrame *pLay, SwDoc *pDoc,
         if( ( !pLay->IsInFootnote() || pSct->IsInFootnote() ) &&
             ( !pLay->IsInTab() || pSct->IsInTab() ) )
         {
-            pActualSection.reset(new SwActualSection( nullptr, pSct, nullptr ));
+            pActualSection.reset(new SwActualSection(nullptr, pSct, pSct->GetSection()->GetFormat()->GetSectionNode()));
+            // tdf#132236 for SwUndoDelete: find outer sections whose start
+            // nodes aren't contained in the range but whose end nodes are,
+            // because section frames may need to be created for them
+            SwActualSection * pUpperSection(pActualSection.get());
+            while (pUpperSection->GetSectionNode()->EndOfSectionIndex() < nEndIndex)
+            {
+                SwStartNode *const pStart(pUpperSection->GetSectionNode()->StartOfSectionNode());
+                if (!pStart->IsSectionNode())
+                {
+                    break;
+                }
+                // note: these don't have a section frame, check it in EndNode case!
+                auto const pTmp(new SwActualSection(nullptr, nullptr, static_cast<SwSectionNode*>(pStart)));
+                pUpperSection->SetUpper(pTmp);
+                pUpperSection = pTmp;
+            }
             OSL_ENSURE( !pLay->Lower() || !pLay->Lower()->IsColumnFrame(),
                 "InsertCnt_: Wrong Call" );
         }
@@ -1770,7 +1786,7 @@ void InsertCnt_( SwLayoutFrame *pLay, SwDoc *pDoc,
                 SwSectionFrame* pOuterSectionFrame = pActualSection->GetSectionFrame();
 
                 // a follow has to be appended to the new section frame
-                SwSectionFrame* pFollow = pOuterSectionFrame->GetFollow();
+                SwSectionFrame* pFollow = pOuterSectionFrame ? pOuterSectionFrame->GetFollow() : nullptr;
                 if ( pFollow )
                 {
                     pOuterSectionFrame->SetFollow( nullptr );
@@ -1779,7 +1795,8 @@ void InsertCnt_( SwLayoutFrame *pLay, SwDoc *pDoc,
                 }
 
                 // We don't want to leave empty parts back.
-                if( ! pOuterSectionFrame->IsColLocked() &&
+                if (pOuterSectionFrame &&
+                    ! pOuterSectionFrame->IsColLocked() &&
                     ! pOuterSectionFrame->ContainsContent() )
                 {
                     pOuterSectionFrame->DelEmpty( true );
diff --git a/sw/source/core/layout/layhelp.hxx b/sw/source/core/layout/layhelp.hxx
index 0f39b1b0cd00..9dc5a916b25f 100644
--- a/sw/source/core/layout/layhelp.hxx
+++ b/sw/source/core/layout/layhelp.hxx
@@ -83,7 +83,7 @@ public:
 // by controlling nested sections.
 class SwActualSection
 {
-    SwActualSection * const pUpper;
+    SwActualSection *pUpper;
     SwSectionFrame  *pSectFrame;
     SwSectionNode   *pSectNode;
 public:
@@ -94,6 +94,7 @@ public:
     SwSectionFrame    *GetSectionFrame()                    { return pSectFrame; }
     void             SetSectionFrame( SwSectionFrame *p )   { pSectFrame = p; }
     SwSectionNode   *GetSectionNode()                   { return pSectNode;}
+    void             SetUpper(SwActualSection *p)       { pUpper = p; }
     SwActualSection *GetUpper()                         { return pUpper; }
 };
 
diff --git a/sw/source/core/undo/undel.cxx b/sw/source/core/undo/undel.cxx
index 63d7c786ae95..c9dc7fdae063 100644
--- a/sw/source/core/undo/undel.cxx
+++ b/sw/source/core/undo/undel.cxx
@@ -1095,6 +1095,7 @@ void SwUndoDelete::UndoImpl(::sw::UndoRedoContext & rContext)
         // tdf#121031 if the start node is a text node, it already has a frame;
         // if it's a table, it does not
         // tdf#109376 exception: end on non-text-node -> start node was inserted
+        assert(!m_bDelFullPara || (m_nSectDiff == 0));
         SwNodeIndex const start(rDoc.GetNodes(), m_nSttNode +
             ((m_bDelFullPara || !rDoc.GetNodes()[m_nSttNode]->IsTextNode() || pInsNd)
                  ? 0 : 1));
commit 92ac4ab70249f8864cb5a994587fa98de7bcfb14
Author:     Xisco Fauli <xiscofauli at libreoffice.org>
AuthorDate: Tue Apr 14 20:45:49 2020 +0200
Commit:     Michael Meeks <michael.meeks at collabora.com>
CommitDate: Tue Jun 2 17:30:26 2020 +0100

    tdf#131684: Add unittest
    
    Change-Id: Ic59d922700b4046a1ec94be5365b46dc8a021a00
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/92226
    Tested-by: Jenkins
    Reviewed-by: Xisco Faulí <xiscofauli at libreoffice.org>
    (cherry picked from commit 3ee27693301b50cdebd6a47e35b6621f0ac50cfe)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/95022
    Reviewed-by: Michael Stahl <michael.stahl at cib.de>

diff --git a/sw/qa/extras/uiwriter/data2/tdf131684.docx b/sw/qa/extras/uiwriter/data2/tdf131684.docx
new file mode 100644
index 000000000000..7d3397dfba60
Binary files /dev/null and b/sw/qa/extras/uiwriter/data2/tdf131684.docx differ
diff --git a/sw/qa/extras/uiwriter/uiwriter2.cxx b/sw/qa/extras/uiwriter/uiwriter2.cxx
index 949c04514da8..5156b7138242 100644
--- a/sw/qa/extras/uiwriter/uiwriter2.cxx
+++ b/sw/qa/extras/uiwriter/uiwriter2.cxx
@@ -143,6 +143,37 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest2, testTdf47471_paraStyleBackground)
                          getProperty<OUString>(getParagraph(3), "ParaStyleName"));
 }
 
+CPPUNIT_TEST_FIXTURE(SwUiWriterTest2, testTdf131684)
+{
+    load(DATA_DIRECTORY, "tdf131684.docx");
+
+    SwXTextDocument* pTextDoc = dynamic_cast<SwXTextDocument*>(mxComponent.get());
+    CPPUNIT_ASSERT(pTextDoc);
+
+    uno::Reference<text::XTextTablesSupplier> xTextTablesSupplier(mxComponent, uno::UNO_QUERY);
+    uno::Reference<container::XIndexAccess> xIndexAccess(xTextTablesSupplier->getTextTables(),
+                                                         uno::UNO_QUERY);
+    CPPUNIT_ASSERT_EQUAL(sal_Int32(1), xIndexAccess->getCount());
+
+    //Use selectAll 3 times in a row
+    lcl_dispatchCommand(mxComponent, ".uno:SelectAll", {});
+    lcl_dispatchCommand(mxComponent, ".uno:SelectAll", {});
+    lcl_dispatchCommand(mxComponent, ".uno:SelectAll", {});
+
+    lcl_dispatchCommand(mxComponent, ".uno:Cut", {});
+    CPPUNIT_ASSERT_EQUAL(sal_Int32(0), xIndexAccess->getCount());
+
+    lcl_dispatchCommand(mxComponent, ".uno:Undo", {});
+    CPPUNIT_ASSERT_EQUAL(sal_Int32(1), xIndexAccess->getCount());
+
+    lcl_dispatchCommand(mxComponent, ".uno:Paste", {});
+    CPPUNIT_ASSERT_EQUAL(sal_Int32(1), xIndexAccess->getCount());
+
+    // without the fix, it crashes
+    lcl_dispatchCommand(mxComponent, ".uno:Undo", {});
+    CPPUNIT_ASSERT_EQUAL(sal_Int32(1), xIndexAccess->getCount());
+}
+
 CPPUNIT_TEST_FIXTURE(SwUiWriterTest2, testTdfChangeNumberingListAutoFormat)
 {
     createDoc("tdf117923.docx");
commit 2880792e5fd5020eb239e6c7f78fd152e5900dec
Author:     Vasily Melenchuk <vasily.melenchuk at cib.de>
AuthorDate: Wed May 20 11:48:47 2020 +0300
Commit:     Michael Meeks <michael.meeks at collabora.com>
CommitDate: Tue Jun 2 17:30:19 2020 +0100

    tdf#78352: docx import: allow tab at left indent for list
    
    Looks like first tab stop for list bullets is at left paragraph
    boundry. Luckely there is a compatibility option for this.
    
    Change-Id: Iea4bd2b51912746dbd4722ff61eeb2e9293cab31
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/94559
    Tested-by: Jenkins
    Reviewed-by: Thorsten Behrens <Thorsten.Behrens at CIB.de>
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/94971

diff --git a/sw/qa/extras/ooxmlexport/data/tdf78352.docx b/sw/qa/extras/ooxmlexport/data/tdf78352.docx
new file mode 100644
index 000000000000..6f85f2e2ab6a
Binary files /dev/null and b/sw/qa/extras/ooxmlexport/data/tdf78352.docx differ
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport14.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport14.cxx
index 894cd869672d..5a99b366caa0 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport14.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport14.cxx
@@ -254,6 +254,15 @@ DECLARE_OOXMLEXPORT_TEST(testTdf130610, "tdf130610_bold_in_2_styles.ott")
     }
 }
 
+DECLARE_OOXMLEXPORT_TEST(testTdf78352, "tdf78352.docx")
+{
+    CPPUNIT_ASSERT_EQUAL(1, getPages());
+
+    // Ensure that width of first tab is close to zero (previous value was ~1000 twips)
+    int nWidth = parseDump("/root/page/body/txt[1]/Text[@nType='PortionType::TabLeft']", "nWidth").toInt32();
+    CPPUNIT_ASSERT_LESS(150, nWidth);
+}
+
 DECLARE_OOXMLEXPORT_TEST(testTdf120315, "tdf120315.docx")
 {
     // tdf#120315 cells of the second column weren't vertically merged
diff --git a/writerfilter/source/dmapper/DomainMapper.cxx b/writerfilter/source/dmapper/DomainMapper.cxx
index a749169dc009..8ef88ab320bb 100644
--- a/writerfilter/source/dmapper/DomainMapper.cxx
+++ b/writerfilter/source/dmapper/DomainMapper.cxx
@@ -126,6 +126,8 @@ DomainMapper::DomainMapper( const uno::Reference< uno::XComponentContext >& xCon
     // Don't load the default style definitions to avoid weird mix
     m_pImpl->SetDocumentSettingsProperty("StylesNoDefault", uno::makeAny(true));
 
+    m_pImpl->SetDocumentSettingsProperty("TabAtLeftIndentForParagraphsInList", uno::makeAny(true));
+
     // Initialize RDF metadata, to be able to add statements during the import.
     try
     {


More information about the Libreoffice-commits mailing list