[Libreoffice-commits] core.git: 2 commits - sc/source sw/source

Tor Lillqvist tml at collabora.com
Fri Dec 1 08:48:30 UTC 2017


 sc/source/filter/xml/xmlcondformat.cxx  |    7 ++++---
 sw/source/core/swg/SwXMLSectionList.cxx |    4 ----
 2 files changed, 4 insertions(+), 7 deletions(-)

New commits:
commit 2b0ff1adeb13efbf7fb0f46939738e3f895d7caf
Author: Tor Lillqvist <tml at collabora.com>
Date:   Thu Nov 30 19:55:18 2017 +0200

    Need to use dynamic_cast and not static_cast here, thanks UBSan and sberg
    
    Change-Id: I95748f75fc4337481ec6574511bf4b1f47fc4587
    Reviewed-on: https://gerrit.libreoffice.org/45611
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Stephan Bergmann <sbergman at redhat.com>

diff --git a/sc/source/filter/xml/xmlcondformat.cxx b/sc/source/filter/xml/xmlcondformat.cxx
index 2e8a2a66d1a3..08e8dbf827b5 100644
--- a/sc/source/filter/xml/xmlcondformat.cxx
+++ b/sc/source/filter/xml/xmlcondformat.cxx
@@ -232,10 +232,11 @@ void SAL_CALL ScXMLConditionalFormatContext::endFastElement( sal_Int32 /*nElemen
     for (size_t nFormatEntryIx = 0; nFormatEntryIx < pFormat->size(); ++nFormatEntryIx)
     {
         auto pFormatEntry = pFormat->GetEntry(nFormatEntryIx);
-        auto pCondFormatEntry = static_cast<const ScCondFormatEntry*>(pFormatEntry);
+        auto pCondFormatEntry = dynamic_cast<const ScCondFormatEntry*>(pFormatEntry);
 
-        if (pCondFormatEntry->GetOperation() != ScConditionMode::Equal &&
-            pCondFormatEntry->GetOperation() != ScConditionMode::Direct)
+        if (pCondFormatEntry == nullptr ||
+            (pCondFormatEntry->GetOperation() != ScConditionMode::Equal &&
+             pCondFormatEntry->GetOperation() != ScConditionMode::Direct))
         {
             bEligibleForCache = false;
             break;
commit a1087bace1aa2f91adebe9cd89e25189b222baed
Author: Stephan Bergmann <sbergman at redhat.com>
Date:   Fri Dec 1 09:36:03 2017 +0100

    loplugin:unnecessaryoverride
    
    Change-Id: I7a685a82dd6452591d4e5460954366bd31acb268

diff --git a/sw/source/core/swg/SwXMLSectionList.cxx b/sw/source/core/swg/SwXMLSectionList.cxx
index cad35a9958bd..1ac8c1d083f1 100644
--- a/sw/source/core/swg/SwXMLSectionList.cxx
+++ b/sw/source/core/swg/SwXMLSectionList.cxx
@@ -39,7 +39,6 @@ public:
     virtual SvXMLImportContextRef CreateChildContext(sal_uInt16 nPrefix,
            const OUString& rLocalName,
            const uno::Reference<xml::sax::XAttributeList> & xAttrList) override;
-    virtual ~SvXMLSectionListContext() override;
 };
 
 class SwXMLParentContext : public SvXMLImportContext
@@ -149,8 +148,5 @@ SvXMLImportContextRef SvXMLSectionListContext::CreateChildContext(
     pContext = new SvXMLSectionListContext(m_rImport, nPrefix, rLocalName, xAttrList);
     return pContext;
 }
-SvXMLSectionListContext::~SvXMLSectionListContext()
-{
-}
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */


More information about the Libreoffice-commits mailing list