l10ntools/inc/xmlparse.hxx    |    2 +-
 l10ntools/source/xmlparse.cxx |   12 +++---------
 2 files changed, 4 insertions(+), 10 deletions(-)

New commits:
commit 337691db0e3f928ed6dff489fc6305a9a5e0b493
Author:     Stephan Bergmann <sberg...@redhat.com>
AuthorDate: Mon Nov 21 11:51:35 2022 +0100
Commit:     Stephan Bergmann <sberg...@redhat.com>
CommitDate: Tue Nov 22 08:14:09 2022 +0100

    Simplify previous fix
    
    ...e735de2051143347b7283c85ad80b0e2412522dc "Avoid some unnecessary, wrong
    downcasts during `make translations"
    
    Change-Id: If6110e16698302b3d43b2192cf0f0e0d0fddb57b
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/143026
    Tested-by: Jenkins
    Reviewed-by: Stephan Bergmann <sberg...@redhat.com>

diff --git a/l10ntools/inc/xmlparse.hxx b/l10ntools/inc/xmlparse.hxx
index 0495883a5311..8e7d320affc5 100644
--- a/l10ntools/inc/xmlparse.hxx
+++ b/l10ntools/inc/xmlparse.hxx
@@ -161,7 +161,7 @@ public:
     void Write( OString const &rFilename );
     void Write( std::ofstream &rStream, XMLNode *pCur = nullptr );
 
-    bool CheckExportStatus( XMLParentNode *pCur = nullptr );
+    bool CheckExportStatus( XMLChildNode *pCur = nullptr );
 
     XMLFile& operator=(const XMLFile& rObj);
 
diff --git a/l10ntools/source/xmlparse.cxx b/l10ntools/source/xmlparse.cxx
index bcf5d37154cb..30da2bebf509 100644
--- a/l10ntools/source/xmlparse.cxx
+++ b/l10ntools/source/xmlparse.cxx
@@ -473,7 +473,7 @@ void XMLFile::SearchL10NElements( XMLChildNode *pCur )
     }
 }
 
-bool XMLFile::CheckExportStatus( XMLParentNode *pCur )
+bool XMLFile::CheckExportStatus( XMLChildNode *pCur )
 {
     static bool bStatusExport = true;
 
@@ -489,7 +489,7 @@ bool XMLFile::CheckExportStatus( XMLParentNode *pCur )
                     for ( size_t i = 0; i < GetChildList()->size(); i++ )
                     {
                         XMLChildNode* pElement = (*GetChildList())[ i ];
-                        if( pElement->GetNodeType() ==  XMLNodeType::ELEMENT ) 
CheckExportStatus( static_cast<XMLParentNode*>(pElement) );//, i);
+                        if( pElement->GetNodeType() ==  XMLNodeType::ELEMENT ) 
CheckExportStatus( pElement );//, i);
                     }
                 }
             }
@@ -520,13 +520,7 @@ bool XMLFile::CheckExportStatus( XMLParentNode *pCur )
                 else if ( pElement->GetChildList() )
                 {
                     for (size_t k = 0; k < pElement->GetChildList()->size(); 
++k)
-                    {
-                        auto const child = (*pElement->GetChildList())[k];
-                        auto const type = child->GetNodeType();
-                        if (type != XMLNodeType::DATA && type != 
XMLNodeType::COMMENT) {
-                            CheckExportStatus( 
static_cast<XMLParentNode*>(child) );
-                        }
-                    }
+                        CheckExportStatus( (*pElement->GetChildList())[k] );
                 }
             }
             break;

Reply via email to