sc/source/filter/xml/xmlcvali.cxx |   10 ++++------
 sc/source/filter/xml/xmlstyli.cxx |    4 ++--
 sc/source/filter/xml/xmlstyli.hxx |    6 ++++--
 3 files changed, 10 insertions(+), 10 deletions(-)

New commits:
commit 38a4672bdb55314edc9ce2cd5224b879d8df007f
Author:     Noel Grandin <noel.gran...@collabora.co.uk>
AuthorDate: Wed Nov 8 13:23:43 2023 +0200
Commit:     Noel Grandin <noel.gran...@collabora.co.uk>
CommitDate: Thu Nov 9 20:10:59 2023 +0100

    loplugin:fieldcast in ScXMLContentValidationContext
    
    Change-Id: I2a9138096c9e79381020eaddb75ddc1134201a95
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159197
    Tested-by: Jenkins
    Reviewed-by: Noel Grandin <noel.gran...@collabora.co.uk>

diff --git a/sc/source/filter/xml/xmlcvali.cxx 
b/sc/source/filter/xml/xmlcvali.cxx
index 6a5669b7866a..20b1f235fd17 100644
--- a/sc/source/filter/xml/xmlcvali.cxx
+++ b/sc/source/filter/xml/xmlcvali.cxx
@@ -49,7 +49,7 @@ class ScXMLContentValidationContext : public 
ScXMLImportContext
     bool           bDisplayHelp;
     bool           bDisplayError;
 
-    SvXMLImportContextRef           xEventContext;
+    rtl::Reference<XMLEventsImportContext> xEventContext;
 
     css::sheet::ValidationAlertStyle GetAlertStyle() const;
     void SetFormula( OUString& rFormula, OUString& rFormulaNmsp, 
FormulaGrammar::Grammar& reGrammar,
@@ -232,8 +232,8 @@ uno::Reference< xml::sax::XFastContextHandler > SAL_CALL 
ScXMLContentValidationC
         pContext = new ScXMLErrorMacroContext( GetScImport(), pAttribList, 
this);
         break;
     case XML_ELEMENT(OFFICE, XML_EVENT_LISTENERS):
-        pContext = new XMLEventsImportContext( GetImport() );
-        xEventContext = pContext;
+        xEventContext = new XMLEventsImportContext( GetImport() );
+        pContext = xEventContext.get();
     }
 
     return pContext;
@@ -357,10 +357,8 @@ void SAL_CALL 
ScXMLContentValidationContext::endFastElement( sal_Int32 /*nElemen
     // #i36650# event-listeners element moved up one level
     if (xEventContext.is())
     {
-        XMLEventsImportContext* pEvents =
-            static_cast<XMLEventsImportContext*>(xEventContext.get());
         uno::Sequence<beans::PropertyValue> aValues;
-        pEvents->GetEventSequence( "OnError", aValues );
+        xEventContext->GetEventSequence( "OnError", aValues );
 
         auto pValue = std::find_if(std::cbegin(aValues), std::cend(aValues),
             [](const beans::PropertyValue& rValue) {
commit f6370725d8a68645e82f16d61518fd2d400f148d
Author:     Noel Grandin <noel.gran...@collabora.co.uk>
AuthorDate: Wed Nov 8 13:16:31 2023 +0200
Commit:     Noel Grandin <noel.gran...@collabora.co.uk>
CommitDate: Thu Nov 9 20:10:50 2023 +0100

    loplugin:fieldcast in XMLTableStyleContext
    
    Change-Id: I92b6bc3e765b19c9f250da43463aad253ba9347a
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159196
    Tested-by: Jenkins
    Reviewed-by: Noel Grandin <noel.gran...@collabora.co.uk>

diff --git a/sc/source/filter/xml/xmlstyli.cxx 
b/sc/source/filter/xml/xmlstyli.cxx
index 3d7d86488425..a607b013e9c7 100644
--- a/sc/source/filter/xml/xmlstyli.cxx
+++ b/sc/source/filter/xml/xmlstyli.cxx
@@ -426,7 +426,7 @@ void XMLTableStyleContext::SetAttribute( sal_Int32 nElement,
 
 
 XMLTableStyleContext::XMLTableStyleContext( ScXMLImport& rImport,
-        SvXMLStylesContext& rStyles, XmlStyleFamily nFamily, bool 
bDefaultStyle ) :
+        XMLTableStylesContext& rStyles, XmlStyleFamily nFamily, bool 
bDefaultStyle ) :
     XMLPropStyleContext( rImport, rStyles, nFamily, bDefaultStyle ),
     pStyles(&rStyles),
     nNumberFormat(-1),
@@ -563,7 +563,7 @@ void XMLTableStyleContext::AddProperty(const sal_Int16 
nContextID, const uno::An
     XMLPropertyState* property = FindProperty(nContextID);
     if (property)
         property->mnIndex = -1; // #i46996# remove old property, so it isn't 
double
-    sal_Int32 nIndex(static_cast<XMLTableStylesContext 
*>(pStyles)->GetIndex(nContextID));
+    sal_Int32 nIndex(pStyles->GetIndex(nContextID));
     OSL_ENSURE(nIndex != -1, "Property not found in Map");
     XMLPropertyState aPropState(nIndex, rValue);
     GetProperties().push_back(aPropState); // has to be inserted in a sort 
order later
diff --git a/sc/source/filter/xml/xmlstyli.hxx 
b/sc/source/filter/xml/xmlstyli.hxx
index 8101a72b1f7c..e977b84e0ec6 100644
--- a/sc/source/filter/xml/xmlstyli.hxx
+++ b/sc/source/filter/xml/xmlstyli.hxx
@@ -63,11 +63,13 @@ public:
             ::std::vector< XMLPropertyState >& rProperties, sal_Int32 
nStartIndex, sal_Int32 nEndIndex ) const override;
 };
 
+class XMLTableStylesContext;
+
 class XMLTableStyleContext : public XMLPropStyleContext
 {
     OUString             sDataStyleName;
     OUString               sPageStyle;
-    SvXMLStylesContext*         pStyles;
+    XMLTableStylesContext*      pStyles;
     sal_Int32                   nNumberFormat;
     SCTAB                       nLastSheet;
     bool                        bParentSet;
@@ -85,7 +87,7 @@ protected:
 public:
 
     XMLTableStyleContext( ScXMLImport& rImport,
-            SvXMLStylesContext& rStyles, XmlStyleFamily nFamily, bool 
bDefaultStyle = false );
+            XMLTableStylesContext& rStyles, XmlStyleFamily nFamily, bool 
bDefaultStyle = false );
     virtual ~XMLTableStyleContext() override;
 
     virtual css::uno::Reference< css::xml::sax::XFastContextHandler > SAL_CALL 
createFastChildContext(

Reply via email to