[Libreoffice-commits] core.git: Branch 'distro/collabora/co-2021' - 6 commits - chart2/source compilerplugins/clang editeng/source include/editeng oox/qa oox/source sc/source sd/qa sw/qa writerfilter/source

Caolán McNamara (via logerrit) logerrit at kemper.freedesktop.org
Thu May 27 06:29:03 UTC 2021


 chart2/source/model/template/CandleStickChartType.hxx |    3 
 compilerplugins/clang/fragiledestructor.cxx           |    2 
 editeng/source/items/textitem.cxx                     |   66 +++++++++++++++---
 include/editeng/colritem.hxx                          |   24 ++++++
 oox/qa/unit/vml.cxx                                   |    4 -
 oox/source/drawingml/textcharacterproperties.cxx      |    2 
 sc/source/ui/docshell/docsh4.cxx                      |   10 ++
 sd/qa/unit/data/pptx/tdf96061.pptx                    |binary
 sd/qa/unit/export-tests-ooxml2.cxx                    |   35 +++++++++
 sw/qa/extras/ooxmlexport/data/tdf132752.docx          |binary
 sw/qa/extras/ooxmlexport/ooxmlexport16.cxx            |    7 +
 writerfilter/source/dmapper/DomainMapper_Impl.cxx     |   11 ++-
 12 files changed, 148 insertions(+), 16 deletions(-)

New commits:
commit 18dda8ed5ec0d77648e795ba995a324d0cbbdeca
Author:     Caolán McNamara <caolanm at redhat.com>
AuthorDate: Wed May 26 14:44:02 2021 +0100
Commit:     Andras Timar <andras.timar at collabora.com>
CommitDate: Thu May 27 08:28:22 2021 +0200

    tdf#142467 crash on calling 'getInfoHelper' in final class
    
    IPropertyArrayHelper & rInfo = getInfoHelper(); crashes when
    CandleStickChartType is final for unknown reasons. I see this with
    gcc-11.1.1-1.fc34.x86_64 in 7-1 locally but also in the fedora
    libreoffice-7.0.6 built with gcc-10 so this isn't a recent problem.
    
     #1  0x00007ffff6f4fe91 in cppu::OPropertySetHelper::getFastPropertyValue(int) (this=this at entry=0x5bdd588, nHandle=nHandle at entry=3) at cppuhelper/source/propshlp.cxx:549
     #2  0x00007fffad45e9ff in chart::CandleStickChartType::getSupportedMandatoryRoles() (this=0x5bdd520) at chart2/source/model/template/CandleStickChartType.cxx:219
    
    Change-Id: Ia029162587da1fc00df32866863deb186c7e11bb
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/116153
    Tested-by: Jenkins
    Reviewed-by: Xisco Fauli <xiscofauli at libreoffice.org>

diff --git a/chart2/source/model/template/CandleStickChartType.hxx b/chart2/source/model/template/CandleStickChartType.hxx
index 00c2747bc7af..969c14c24d35 100644
--- a/chart2/source/model/template/CandleStickChartType.hxx
+++ b/chart2/source/model/template/CandleStickChartType.hxx
@@ -23,7 +23,8 @@
 namespace chart
 {
 
-class CandleStickChartType final : public ChartType
+// see tdf#142467 before restoring 'final'
+class CandleStickChartType /* final */ : public ChartType
 {
 public:
     explicit CandleStickChartType();
diff --git a/compilerplugins/clang/fragiledestructor.cxx b/compilerplugins/clang/fragiledestructor.cxx
index a1a09a2e6081..9bce19ccda27 100644
--- a/compilerplugins/clang/fragiledestructor.cxx
+++ b/compilerplugins/clang/fragiledestructor.cxx
@@ -51,6 +51,8 @@ public:
              return false;
         if (loplugin::isSamePathname(fn, SRCDIR "/sw/source/core/layout/ssfrm.cxx")) // ~SwFrame calling IsDeleteForbidden
              return false;
+        if (loplugin::isSamePathname(fn, SRCDIR "/chart2/source/model/template/CandleStickChartType.cxx")) // to ignore tdf#142467 workaround
+             return false;
 
         return true;
     }
commit 29155d89275c0a67aefc9a733ee7047462912cd3
Author:     Jan-Marek Glogowski <glogow at fbihome.de>
AuthorDate: Wed May 26 14:31:27 2021 +0200
Commit:     Andras Timar <andras.timar at collabora.com>
CommitDate: Thu May 27 08:28:22 2021 +0200

    tdf137314 Add margin to CppunitTest assertions
    
    The test had multiple failures on Windows with:
    
    oox/qa/unit/vml.cxx(79) : error : Assertion
    Test name: tdf137314_vml_rotation_unit_fd::TestBody
    equality assertion failed
    - Expected: 1490
    - Actual  : 1491
    
    So add a 1px margin to all value checks.
    
    Change-Id: I70298db253299a57cc37eed482c0816d902fbeab
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/116192
    Tested-by: Jenkins
    Reviewed-by: Xisco Fauli <xiscofauli at libreoffice.org>
    (cherry picked from commit 60b98189281524c85b559ee3b6adc1381b793b9d)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/116154

diff --git a/oox/qa/unit/vml.cxx b/oox/qa/unit/vml.cxx
index 94e73459d995..d75372da39ae 100644
--- a/oox/qa/unit/vml.cxx
+++ b/oox/qa/unit/vml.cxx
@@ -73,9 +73,9 @@ CPPUNIT_TEST_FIXTURE(OoxVmlTest, tdf137314_vml_rotation_unit_fd)
     // Without fix in place, the vector was -1441|1490.
     // [1] and [2] are Bezier-curve control points.
     sal_Int32 nDiffX = aPolygon[3].X - aPolygon[0].X;
-    CPPUNIT_ASSERT_EQUAL(sal_Int32(1490), nDiffX);
+    CPPUNIT_ASSERT_DOUBLES_EQUAL(sal_Int32(1490), nDiffX, 1);
     sal_Int32 nDiffY = aPolygon[3].Y - aPolygon[0].Y;
-    CPPUNIT_ASSERT_EQUAL(sal_Int32(1441), nDiffY);
+    CPPUNIT_ASSERT_DOUBLES_EQUAL(sal_Int32(1441), nDiffY, 1);
 }
 
 CPPUNIT_TEST_FIXTURE(OoxVmlTest, testSpt202ShapeType)
commit c6f5ccdeee10fd3ac900f92b0efb31bd4a973da2
Author:     Gülşah Köse <gulsah.kose at collabora.com>
AuthorDate: Wed May 19 14:37:36 2021 +0300
Commit:     Andras Timar <andras.timar at collabora.com>
CommitDate: Thu May 27 08:28:06 2021 +0200

    tdf#96061 Unset the highlight property
    
    When we have highlight property on specific part of the text
    the following texts were highligthing. To prevent this we unset the
    highlight property when we have not highlight property anymore.
    
    Change-Id: I802cde1c784afe47201a9ba4f41827dd0c705035
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/115800
    Tested-by: Jenkins
    Reviewed-by: Gülşah Köse <gulsah.kose at collabora.com>
    Signed-off-by: Xisco Fauli <xiscofauli at libreoffice.org>
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/116176
    Reviewed-by: Andras Timar <andras.timar at collabora.com>

diff --git a/oox/source/drawingml/textcharacterproperties.cxx b/oox/source/drawingml/textcharacterproperties.cxx
index 20965e33abb1..4eb5acaffb56 100644
--- a/oox/source/drawingml/textcharacterproperties.cxx
+++ b/oox/source/drawingml/textcharacterproperties.cxx
@@ -177,6 +177,8 @@ void TextCharacterProperties::pushToPropMap( PropertyMap& rPropMap, const XmlFil
 
     if( maHighlightColor.isUsed() )
         rPropMap.setProperty( PROP_CharBackColor, maHighlightColor.getColor( rFilter.getGraphicHelper() ));
+    else
+        rPropMap.setProperty( PROP_CharBackColor, sal_Int32(-1));
 }
 
 static void pushToGrabBag( PropertySet& rPropSet, const std::vector<PropertyValue>& aVectorOfPropertyValues )
diff --git a/sd/qa/unit/data/pptx/tdf96061.pptx b/sd/qa/unit/data/pptx/tdf96061.pptx
new file mode 100644
index 000000000000..c6e6aa5ae16f
Binary files /dev/null and b/sd/qa/unit/data/pptx/tdf96061.pptx differ
diff --git a/sd/qa/unit/export-tests-ooxml2.cxx b/sd/qa/unit/export-tests-ooxml2.cxx
index 14033035ce56..ef74eb9a4850 100644
--- a/sd/qa/unit/export-tests-ooxml2.cxx
+++ b/sd/qa/unit/export-tests-ooxml2.cxx
@@ -207,6 +207,7 @@ public:
     void testShapeShadowBlurEffect();
     void testTdf119223();
     void testTdf128213ShapeRot();
+    void testTdf96061_textHighlight();
 
     CPPUNIT_TEST_SUITE(SdOOXMLExportTest2);
 
@@ -329,6 +330,7 @@ public:
     CPPUNIT_TEST(testShapeShadowBlurEffect);
     CPPUNIT_TEST(testTdf119223);
     CPPUNIT_TEST(testTdf128213ShapeRot);
+    CPPUNIT_TEST(testTdf96061_textHighlight);
 
     CPPUNIT_TEST_SUITE_END();
 
@@ -3090,6 +3092,39 @@ void SdOOXMLExportTest2::testTdf128213ShapeRot()
     assertXPath(pXmlDocRels, "/p:sld/p:cSld/p:spTree/p:sp/p:txBody/a:bodyPr/a:scene3d/a:camera/a:rot", "rev", "5400000");
 }
 
+void SdOOXMLExportTest2::testTdf96061_textHighlight()
+{
+    ::sd::DrawDocShellRef xDocShRef = loadURL( m_directories.getURLFromSrc(u"/sd/qa/unit/data/pptx/tdf96061.pptx"), PPTX);
+
+    uno::Reference<beans::XPropertySet> xShape(getShapeFromPage(0, 0, xDocShRef));
+    uno::Reference<text::XTextRange> const xParagraph1(getParagraphFromShape(0, xShape));
+    uno::Reference<text::XTextRange> xRun1(getRunFromParagraph(0, xParagraph1));
+    uno::Reference< beans::XPropertySet> xPropSet1(xRun1, uno::UNO_QUERY_THROW);
+    sal_Int32 aColor;
+    xPropSet1->getPropertyValue("CharBackColor") >>= aColor;
+    CPPUNIT_ASSERT_EQUAL(sal_Int32(16776960), aColor);
+
+    uno::Reference<text::XTextRange> const xParagraph2(getParagraphFromShape(1, xShape));
+    uno::Reference<text::XTextRange> xRun2(getRunFromParagraph(0, xParagraph2));
+    uno::Reference< beans::XPropertySet> xPropSet2(xRun2, uno::UNO_QUERY_THROW);
+    xPropSet2->getPropertyValue("CharBackColor") >>= aColor;
+    CPPUNIT_ASSERT_EQUAL(sal_Int32(-1), aColor);
+
+    xDocShRef = saveAndReload( xDocShRef.get(), PPTX );
+
+    uno::Reference<beans::XPropertySet> xShape2(getShapeFromPage(0, 0, xDocShRef));
+    uno::Reference<text::XTextRange> const xParagraph3(getParagraphFromShape(0, xShape2));
+    uno::Reference<text::XTextRange> xRun3(getRunFromParagraph(0, xParagraph3));
+    uno::Reference< beans::XPropertySet> xPropSet3(xRun3, uno::UNO_QUERY_THROW);
+    xPropSet3->getPropertyValue("CharBackColor") >>= aColor;
+    CPPUNIT_ASSERT_EQUAL(sal_Int32(16776960), aColor);
+
+    uno::Reference<text::XTextRange> const xParagraph4(getParagraphFromShape(1, xShape2));
+    uno::Reference<text::XTextRange> xRun4(getRunFromParagraph(0, xParagraph4));
+    uno::Reference< beans::XPropertySet> xPropSet4(xRun4, uno::UNO_QUERY_THROW);
+    xPropSet4->getPropertyValue("CharBackColor") >>= aColor;
+    CPPUNIT_ASSERT_EQUAL(sal_Int32(-1), aColor);
+}
 
 CPPUNIT_TEST_SUITE_REGISTRATION(SdOOXMLExportTest2);
 
commit 63d39a6ceb34373a69a356279470676594ef71e6
Author:     Gülşah Köse <gulsah.kose at collabora.com>
AuthorDate: Wed May 26 08:47:38 2021 +0300
Commit:     Andras Timar <andras.timar at collabora.com>
CommitDate: Thu May 27 08:26:45 2021 +0200

    Seperate SvxBackgroundColorItem from SvxColorItem
    
    SvxBackgroundColorItem derivated from SfxPoolItem instead of
    SvxColorItem.
    
    Casting is common usage to control if object is this or not.
    When we can cast SvxBackgroundColorItem to SvxColorItem we can not
    seperate them anymore.
    
    eg: Char color is a SvxColorItem and char background color is a
    SvxBackgroundColorItem. They can be hold together and we should
    understand they are different types.
    
    Change-Id: I7b1879a1b00de26c0b8a2d9f8d658aa3aef75ecb
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/116135
    Tested-by: Jenkins
    Reviewed-by: Gülşah Köse <gulsah.kose at collabora.com>
    Signed-off-by: Xisco Fauli <xiscofauli at libreoffice.org>
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/116183

diff --git a/editeng/source/items/textitem.cxx b/editeng/source/items/textitem.cxx
index e1700df6e254..d9dba072b980 100644
--- a/editeng/source/items/textitem.cxx
+++ b/editeng/source/items/textitem.cxx
@@ -1313,26 +1313,32 @@ bool SvxContourItem::GetPresentation
 // class SvxBackgroundColorItem -----------------------------------------
 
 SvxBackgroundColorItem::SvxBackgroundColorItem( const sal_uInt16 nId ) :
-    SvxColorItem( nId )
+    SfxPoolItem( nId ),
+    mColor( COL_WHITE )
 {
 }
 
+SvxBackgroundColorItem::SvxBackgroundColorItem( const Color& rCol, const sal_uInt16 nId ) :
+    SfxPoolItem( nId ),
+    mColor( rCol )
+{
+}
 
-SvxBackgroundColorItem::SvxBackgroundColorItem( const Color& rCol,
-                                                const sal_uInt16 nId ) :
-    SvxColorItem( rCol, nId )
+SvxBackgroundColorItem::~SvxBackgroundColorItem()
 {
 }
 
-SvxBackgroundColorItem* SvxBackgroundColorItem::Clone( SfxItemPool * ) const
+bool SvxBackgroundColorItem::operator==( const SfxPoolItem& rAttr ) const
 {
-    return new SvxBackgroundColorItem(*this);
+    assert(SfxPoolItem::operator==(rAttr));
+
+    return  mColor == static_cast<const SvxBackgroundColorItem&>( rAttr ).mColor;
 }
 
 bool SvxBackgroundColorItem::QueryValue( uno::Any& rVal, sal_uInt8 nMemberId ) const
 {
     nMemberId &= ~CONVERT_TWIPS;
-    Color aColor = SvxColorItem::GetValue();
+    Color aColor = SvxBackgroundColorItem::GetValue();
 
     switch( nMemberId )
     {
@@ -1354,27 +1360,67 @@ bool SvxBackgroundColorItem::PutValue( const uno::Any& rVal, sal_uInt8 nMemberId
 {
     nMemberId &= ~CONVERT_TWIPS;
     sal_Int32 nColor = 0;
-    Color aColor = SvxColorItem::GetValue();
+    Color aColor = SvxBackgroundColorItem::GetValue();
 
     switch( nMemberId )
     {
         case MID_GRAPHIC_TRANSPARENT:
         {
             aColor.SetTransparency( Any2Bool( rVal ) ? 0xff : 0 );
-            SvxColorItem::SetValue( aColor );
+            SvxBackgroundColorItem::SetValue( aColor );
             break;
         }
         default:
         {
             if(!(rVal >>= nColor))
                 return false;
-            SvxColorItem::SetValue( Color(nColor) );
+            SvxBackgroundColorItem::SetValue( Color(nColor) );
             break;
         }
     }
     return true;
 }
 
+SvxBackgroundColorItem* SvxBackgroundColorItem::Clone( SfxItemPool * ) const
+{
+    return new SvxBackgroundColorItem(*this);
+}
+
+
+bool SvxBackgroundColorItem::GetPresentation
+(
+    SfxItemPresentation /*ePres*/,
+    MapUnit             /*eCoreUnit*/,
+    MapUnit             /*ePresUnit*/,
+    OUString&           rText, const IntlWrapper& /*rIntl*/
+)   const
+{
+    rText = ::GetColorString( mColor );
+    return true;
+}
+
+void SvxBackgroundColorItem::dumpAsXml(xmlTextWriterPtr pWriter) const
+{
+    (void)xmlTextWriterStartElement(pWriter, BAD_CAST("SvxBackgroundColorItem"));
+    (void)xmlTextWriterWriteAttribute(pWriter, BAD_CAST("whichId"), BAD_CAST(OString::number(Which()).getStr()));
+
+    std::stringstream ss;
+    ss << mColor;
+    (void)xmlTextWriterWriteAttribute(pWriter, BAD_CAST("value"), BAD_CAST(ss.str().c_str()));
+
+    OUString aStr;
+    IntlWrapper aIntlWrapper(SvtSysLocale().GetUILanguageTag());
+    GetPresentation( SfxItemPresentation::Complete, MapUnit::Map100thMM, MapUnit::Map100thMM, aStr, aIntlWrapper);
+    (void)xmlTextWriterWriteAttribute(pWriter, BAD_CAST("presentation"), BAD_CAST(OUStringToOString(aStr, RTL_TEXTENCODING_UTF8).getStr()));
+    (void)xmlTextWriterEndElement(pWriter);
+}
+
+void SvxBackgroundColorItem::SetValue( const Color& rNewCol )
+{
+    mColor = rNewCol;
+}
+
+
 // class SvxColorItem ----------------------------------------------------
 SvxColorItem::SvxColorItem( const sal_uInt16 nId ) :
     SfxPoolItem( nId ),
diff --git a/include/editeng/colritem.hxx b/include/editeng/colritem.hxx
index 1eab79723577..8e081fc6aab1 100644
--- a/include/editeng/colritem.hxx
+++ b/include/editeng/colritem.hxx
@@ -61,17 +61,37 @@ public:
 };
 
 // XXX: to be moved in a separate header.
-class EDITENG_DLLPUBLIC SvxBackgroundColorItem final : public SvxColorItem
+class EDITENG_DLLPUBLIC SvxBackgroundColorItem final : public SfxPoolItem
 {
+private:
+    Color mColor;
+
 public:
     static SfxPoolItem* CreateDefault();
 
     SvxBackgroundColorItem(const sal_uInt16 nId);
     SvxBackgroundColorItem(const Color& rCol, const sal_uInt16 nId);
+    virtual ~SvxBackgroundColorItem() override;
 
-    virtual SvxBackgroundColorItem* Clone(SfxItemPool* pPool = nullptr) const override;
+    virtual bool operator==(const SfxPoolItem& rPoolItem) const override;
     virtual bool QueryValue(css::uno::Any& rVal, sal_uInt8 nMemberId = 0) const override;
     virtual bool PutValue(const css::uno::Any& rVal, sal_uInt8 nMemberId) override;
+
+    virtual bool GetPresentation(SfxItemPresentation ePres,
+                                 MapUnit eCoreMetric, MapUnit ePresMetric,
+                                 OUString &rText, const IntlWrapper& rIntlWrapper) const override;
+
+    virtual SvxBackgroundColorItem* Clone(SfxItemPool* pPool = nullptr) const override;
+    SvxBackgroundColorItem(SvxBackgroundColorItem const &) = default; // SfxPoolItem copy function dichotomy
+
+    const Color& GetValue() const
+    {
+        return mColor;
+    }
+
+    void SetValue(const Color& rNewColor);
+
+    void dumpAsXml(xmlTextWriterPtr pWriter) const override;
 };
 
 #endif
commit f092c825e39a0bb0c2c30d3ea0b28f3743444e6f
Author:     Vasily Melenchuk <vasily.melenchuk at cib.de>
AuthorDate: Wed May 19 13:58:35 2021 +0300
Commit:     Andras Timar <andras.timar at collabora.com>
CommitDate: Thu May 27 08:26:45 2021 +0200

    tdf#132752: docx import: improvements for first line indent in lists
    
    As far as I see, Word is using lists with id=0 and no list definitions
    to reset list numbering used in this paragraph. At the same time Word
    is still using some of default list properties. For example in this
    scenario parent style has defined first line indent, but in paragrath
    it is overwritten by "not existing" list=0 without definitions.
    
    To this moment I know about only first line indent behavior, but
    probably some other properties are also affected.
    
    Conflicts:
          sw/qa/extras/ooxmlexport/ooxmlexport16.cxx
    
    Change-Id: I344c907bb7a7b83a91f5727e13ad184fb44137b5
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/115795
    Tested-by: Jenkins
    Reviewed-by: Thorsten Behrens <thorsten.behrens at allotropia.de>
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/116093
    Reviewed-by: Vasily Melenchuk <vasily.melenchuk at cib.de>
    Reviewed-by: Xisco Fauli <xiscofauli at libreoffice.org>

diff --git a/sw/qa/extras/ooxmlexport/data/tdf132752.docx b/sw/qa/extras/ooxmlexport/data/tdf132752.docx
new file mode 100644
index 000000000000..57eddc455fca
Binary files /dev/null and b/sw/qa/extras/ooxmlexport/data/tdf132752.docx differ
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport16.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport16.cxx
index 33d7bffa7ed6..0b3f2321c4c6 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport16.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport16.cxx
@@ -46,6 +46,13 @@ DECLARE_OOXMLEXPORT_TEST(testTdf138892_noNumbering, "tdf138892_noNumbering.docx"
     CPPUNIT_ASSERT_MESSAGE("Para3: <blank line>", getProperty<OUString>(getParagraph(3), "NumberingStyleName").isEmpty());
 }
 
+DECLARE_OOXMLEXPORT_TEST(testTdf132752, "tdf132752.docx")
+{
+    CPPUNIT_ASSERT_EQUAL(sal_Int32(1801), getProperty<sal_Int32>(getParagraph(1), "ParaLeftMargin"));
+    CPPUNIT_ASSERT_EQUAL(sal_Int32(1000), getProperty<sal_Int32>(getParagraph(1), "ParaRightMargin"));
+    CPPUNIT_ASSERT_EQUAL(sal_Int32(0), getProperty<sal_Int32>(getParagraph(1), "ParaFirstLineIndent"));
+}
+
 DECLARE_OOXMLEXPORT_TEST(testTdf140668, "tdf140668.docx")
 {
     // Don't crash when document is opened
diff --git a/writerfilter/source/dmapper/DomainMapper_Impl.cxx b/writerfilter/source/dmapper/DomainMapper_Impl.cxx
index d3c779a10b6c..0d008bf78618 100644
--- a/writerfilter/source/dmapper/DomainMapper_Impl.cxx
+++ b/writerfilter/source/dmapper/DomainMapper_Impl.cxx
@@ -1537,6 +1537,15 @@ void DomainMapper_Impl::finishParagraph( const PropertyMapPtr& pPropertyMap, con
                     pParaContext->Insert(PROP_PARA_LEFT_MARGIN, uno::makeAny(nParaLeftMargin), /*bOverwrite=*/false);
             }
         }
+
+        if (nListId == 0 && !pList)
+        {
+            // Seems situation with listid=0 and missing list definition is used by MS Word
+            // to remove numbering defined previously. But some default numbering attributes
+            // are still applied. This is first line indent, probably something more?
+            if (!pParaContext->isSet(PROP_PARA_FIRST_LINE_INDENT))
+                pParaContext->Insert(PROP_PARA_FIRST_LINE_INDENT, uno::makeAny(sal_Int16(0)), false);
+        }
     }
 
     // apply AutoSpacing: it has priority over all other margin settings
@@ -1996,7 +2005,7 @@ void DomainMapper_Impl::finishParagraph( const PropertyMapPtr& pPropertyMap, con
                     const bool bLeftSet  = pParaContext->isSet(PROP_PARA_LEFT_MARGIN);
                     const bool bRightSet = pParaContext->isSet(PROP_PARA_RIGHT_MARGIN);
                     const bool bFirstSet = pParaContext->isSet(PROP_PARA_FIRST_LINE_INDENT);
-                    if ( bLeftSet != bRightSet || bRightSet != bFirstSet )
+                    if (bLeftSet != bRightSet || bRightSet != bFirstSet)
                     {
                         if ( !bLeftSet )
                         {
commit e537a98adf112e58b294e28905f40c29e6b69ec1
Author:     Eike Rathke <erack at redhat.com>
AuthorDate: Tue May 25 22:33:46 2021 +0200
Commit:     Andras Timar <andras.timar at collabora.com>
CommitDate: Thu May 27 08:26:44 2021 +0200

    Related: tdf#81757 Do not even try to re-enter ScDocShell::Do*Recalc()
    
    That happened when loading bug doc
    https://bugs.documentfoundation.org/attachment.cgi?id=103462
    where form selection events fire asynchronous recalcul() and
    BASIC Main also calls recalcul.
    
    Change-Id: Ic27fb340c7b5019453723c7cabe2122905d400f5
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/116133
    Reviewed-by: Eike Rathke <erack at redhat.com>
    Tested-by: Jenkins
    (cherry picked from commit 807f3508c9319d7f94820ea1282e306594418fce)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/116152
    Reviewed-by: Xisco Fauli <xiscofauli at libreoffice.org>

diff --git a/sc/source/ui/docshell/docsh4.cxx b/sc/source/ui/docshell/docsh4.cxx
index 65e1337c3fa3..5583d309dfcd 100644
--- a/sc/source/ui/docshell/docsh4.cxx
+++ b/sc/source/ui/docshell/docsh4.cxx
@@ -1422,6 +1422,11 @@ bool ScDocShell::ExecuteChangeProtectionDialog( bool bJustQueryIfProtected )
 
 void ScDocShell::DoRecalc( bool bApi )
 {
+    if (m_aDocument.IsInDocShellRecalc())
+    {
+        SAL_WARN("sc","ScDocShell::DoRecalc tries re-entering while in Recalc; probably Forms->BASIC->Dispatcher.");
+        return;
+    }
     ScDocShellRecalcGuard aGuard(m_aDocument);
     bool bDone = false;
     ScTabViewShell* pSh = GetBestViewShell();
@@ -1468,6 +1473,11 @@ void ScDocShell::DoRecalc( bool bApi )
 
 void ScDocShell::DoHardRecalc()
 {
+    if (m_aDocument.IsInDocShellRecalc())
+    {
+        SAL_WARN("sc","ScDocShell::DoHardRecalc tries re-entering while in Recalc; probably Forms->BASIC->Dispatcher.");
+        return;
+    }
     auto start = std::chrono::steady_clock::now();
     ScDocShellRecalcGuard aGuard(m_aDocument);
     weld::WaitObject aWaitObj( GetActiveDialogParent() );


More information about the Libreoffice-commits mailing list