summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2020-01-16 11:11:32 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2020-01-16 10:52:19 +0100
commit8041a9b1fd26b64494ecb4c23022f39bd168a24f (patch)
tree2ad86004de35a56859919b18f551b1dd92806eac
parentef5812deb142d043e58965bf8f4829b50acffcee (diff)
return nullptr from Create*Context methods in nullptr subclasses
the calling class handles this nicely, and also tells us when we are not handling some part of the XML file Change-Id: Ic51a42b9d2dec96243e7f83b528d7455d4bc0504 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/86906 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
-rw-r--r--dbaccess/source/filter/xml/xmlfilter.cxx7
-rw-r--r--editeng/source/misc/SvXMLAutoCorrectImport.cxx10
-rw-r--r--linguistic/source/convdicxml.cxx5
-rw-r--r--reportdesign/source/filter/xml/xmlfilter.cxx7
-rw-r--r--sw/source/uibase/config/StoredChapterNumbering.cxx6
-rw-r--r--xmloff/source/draw/animationimport.cxx4
-rw-r--r--xmloff/source/draw/sdxmlimp.cxx2
-rw-r--r--xmloff/source/meta/MetaImportComponent.cxx7
-rw-r--r--xmloff/source/meta/xmlversion.cxx6
-rw-r--r--xmloff/source/text/XMLAutoTextEventImport.cxx7
10 files changed, 15 insertions, 46 deletions
diff --git a/dbaccess/source/filter/xml/xmlfilter.cxx b/dbaccess/source/filter/xml/xmlfilter.cxx
index fa57e133bba3..96a34742fba0 100644
--- a/dbaccess/source/filter/xml/xmlfilter.cxx
+++ b/dbaccess/source/filter/xml/xmlfilter.cxx
@@ -542,7 +542,7 @@ public:
}
SvXMLImportContext* ODBFilter::CreateFastContext(sal_Int32 nElement,
- const ::css::uno::Reference< ::css::xml::sax::XFastAttributeList >& xAttrList )
+ const ::css::uno::Reference< ::css::xml::sax::XFastAttributeList >& /*xAttrList*/ )
{
SvXMLImportContext *pContext = nullptr;
@@ -561,13 +561,8 @@ SvXMLImportContext* ODBFilter::CreateFastContext(sal_Int32 nElement,
case XML_ELEMENT(OOO, XML_DOCUMENT_CONTENT):
pContext = new DBXMLDocumentContentContext(*this);
break;
- default:
- break;
}
- if ( !pContext )
- pContext = SvXMLImport::CreateFastContext( nElement, xAttrList );
-
return pContext;
}
diff --git a/editeng/source/misc/SvXMLAutoCorrectImport.cxx b/editeng/source/misc/SvXMLAutoCorrectImport.cxx
index fb64d57c024f..b2a9e51d9823 100644
--- a/editeng/source/misc/SvXMLAutoCorrectImport.cxx
+++ b/editeng/source/misc/SvXMLAutoCorrectImport.cxx
@@ -40,12 +40,11 @@ SvXMLAutoCorrectImport::~SvXMLAutoCorrectImport() throw ()
}
SvXMLImportContext *SvXMLAutoCorrectImport::CreateFastContext( sal_Int32 Element,
- const uno::Reference< xml::sax::XFastAttributeList > & xAttrList )
+ const uno::Reference< xml::sax::XFastAttributeList > & /*xAttrList*/ )
{
if( Element == SvXMLAutoCorrectToken::BLOCKLIST )
return new SvXMLWordListContext( *this );
- else
- return SvXMLImport::CreateFastContext( Element, xAttrList );
+ return nullptr;
}
SvXMLWordListContext::SvXMLWordListContext(
@@ -114,12 +113,11 @@ SvXMLExceptionListImport::~SvXMLExceptionListImport() throw ()
}
SvXMLImportContext *SvXMLExceptionListImport::CreateFastContext(sal_Int32 Element,
- const uno::Reference< xml::sax::XFastAttributeList > & xAttrList )
+ const uno::Reference< xml::sax::XFastAttributeList > & /*xAttrList*/ )
{
if( Element == SvXMLAutoCorrectToken::BLOCKLIST )
return new SvXMLExceptionListContext( *this );
- else
- return SvXMLImport::CreateFastContext( Element, xAttrList );
+ return nullptr;
}
SvXMLExceptionListContext::SvXMLExceptionListContext(
diff --git a/linguistic/source/convdicxml.cxx b/linguistic/source/convdicxml.cxx
index b2dc42dbb270..ecae4e48548e 100644
--- a/linguistic/source/convdicxml.cxx
+++ b/linguistic/source/convdicxml.cxx
@@ -347,12 +347,11 @@ ConvDicXMLImport::ConvDicXMLImport( ConvDic *pConvDic ) :
SvXMLImportContext * ConvDicXMLImport::CreateFastContext(
sal_Int32 Element,
- const css::uno::Reference< css::xml::sax::XFastAttributeList > & xAttrList )
+ const css::uno::Reference< css::xml::sax::XFastAttributeList > & /*xAttrList*/ )
{
if( Element == ConvDicXMLToken::TEXT_CONVERSION_DICTIONARY )
return new ConvDicXMLDictionaryContext_Impl( *this );
- else
- return SvXMLImport::CreateFastContext( Element, xAttrList );
+ return nullptr;
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/reportdesign/source/filter/xml/xmlfilter.cxx b/reportdesign/source/filter/xml/xmlfilter.cxx
index 917dd5209411..69d4251fc337 100644
--- a/reportdesign/source/filter/xml/xmlfilter.cxx
+++ b/reportdesign/source/filter/xml/xmlfilter.cxx
@@ -727,7 +727,7 @@ public:
SvXMLImportContext* ORptFilter::CreateDocumentContext( sal_uInt16 nPrefix,
const OUString& rLocalName,
- const uno::Reference< xml::sax::XAttributeList >& xAttrList )
+ const uno::Reference< xml::sax::XAttributeList >& /*xAttrList*/ )
{
SvXMLImportContext *pContext = nullptr;
@@ -744,13 +744,8 @@ SvXMLImportContext* ORptFilter::CreateDocumentContext( sal_uInt16 nPrefix,
case XML_TOK_DOC_CONTENT:
pContext = new RptXMLDocumentContentContext(*this, nPrefix, rLocalName);
break;
- default:
- break;
}
- if ( !pContext )
- pContext = SvXMLImport::CreateDocumentContext( nPrefix, rLocalName, xAttrList );
-
return pContext;
}
diff --git a/sw/source/uibase/config/StoredChapterNumbering.cxx b/sw/source/uibase/config/StoredChapterNumbering.cxx
index 67e5f06c47d0..9ebbd37f3375 100644
--- a/sw/source/uibase/config/StoredChapterNumbering.cxx
+++ b/sw/source/uibase/config/StoredChapterNumbering.cxx
@@ -372,13 +372,11 @@ public:
}
virtual SvXMLImportContext *CreateFastContext( sal_Int32 Element,
- const css::uno::Reference< css::xml::sax::XFastAttributeList > & xAttrList ) override
+ const css::uno::Reference< css::xml::sax::XFastAttributeList > & /*xAttrList*/ ) override
{
if (Element == XML_ELEMENT(OFFICE, XML_STYLES))
- {
return new StoredChapterNumberingRootContext(m_rNumRules, *this);
- }
- return SvXMLImport::CreateFastContext(Element, xAttrList);
+ return nullptr;
}
};
diff --git a/xmloff/source/draw/animationimport.cxx b/xmloff/source/draw/animationimport.cxx
index 29df61897d53..5306314a028b 100644
--- a/xmloff/source/draw/animationimport.cxx
+++ b/xmloff/source/draw/animationimport.cxx
@@ -1276,10 +1276,6 @@ SvXMLImportContext *AnimationsImport::CreateDocumentContext(
{
pContext = new AnimationNodeContext( mxRootNode, *this, nPrefix, rLocalName, xAttrList );
}
- else
- {
- pContext = SvXMLImport::CreateDocumentContext(nPrefix, rLocalName, xAttrList);
- }
return pContext;
}
diff --git a/xmloff/source/draw/sdxmlimp.cxx b/xmloff/source/draw/sdxmlimp.cxx
index dfa68e100629..30a69187732d 100644
--- a/xmloff/source/draw/sdxmlimp.cxx
+++ b/xmloff/source/draw/sdxmlimp.cxx
@@ -686,8 +686,6 @@ SvXMLImportContext *SdXMLImport::CreateFastContext( sal_Int32 nElement,
pContext = new SdXMLFlatDocContext_Impl( *this, xDPS->getDocumentProperties());
}
break;
- default:
- pContext = SvXMLImport::CreateFastContext(nElement, xAttrList);
}
return pContext;
}
diff --git a/xmloff/source/meta/MetaImportComponent.cxx b/xmloff/source/meta/MetaImportComponent.cxx
index c3cbdb03d2b2..fc8329fecff2 100644
--- a/xmloff/source/meta/MetaImportComponent.cxx
+++ b/xmloff/source/meta/MetaImportComponent.cxx
@@ -69,7 +69,7 @@ XMLMetaImportComponent::XMLMetaImportComponent(
}
SvXMLImportContext *XMLMetaImportComponent::CreateFastContext( sal_Int32 nElement,
- const uno::Reference< xml::sax::XFastAttributeList >& xAttrList )
+ const uno::Reference< xml::sax::XFastAttributeList >& /*xAttrList*/ )
{
if (nElement == XML_ELEMENT( OFFICE, XML_DOCUMENT_META ))
{
@@ -81,10 +81,7 @@ SvXMLImportContext *XMLMetaImportComponent::CreateFastContext( sal_Int32 nElemen
return new SvXMLMetaDocumentContext(
*this, mxDocProps);
}
- else
- {
- return SvXMLImport::CreateFastContext(nElement, xAttrList);
- }
+ return nullptr;
}
void SAL_CALL XMLMetaImportComponent::setTargetDocument(
diff --git a/xmloff/source/meta/xmlversion.cxx b/xmloff/source/meta/xmlversion.cxx
index ff53368af587..0055fb56d802 100644
--- a/xmloff/source/meta/xmlversion.cxx
+++ b/xmloff/source/meta/xmlversion.cxx
@@ -113,7 +113,7 @@ XMLVersionListImport::~XMLVersionListImport() throw()
{}
SvXMLImportContext *XMLVersionListImport::CreateFastContext( sal_Int32 nElement,
- const ::css::uno::Reference< ::css::xml::sax::XFastAttributeList >& xAttrList )
+ const ::css::uno::Reference< ::css::xml::sax::XFastAttributeList >& /*xAttrList*/ )
{
SvXMLImportContext *pContext = nullptr;
@@ -121,10 +121,6 @@ SvXMLImportContext *XMLVersionListImport::CreateFastContext( sal_Int32 nElement,
{
pContext = new XMLVersionListContext( *this );
}
- else
- {
- pContext = SvXMLImport::CreateFastContext( nElement, xAttrList );
- }
return pContext;
}
diff --git a/xmloff/source/text/XMLAutoTextEventImport.cxx b/xmloff/source/text/XMLAutoTextEventImport.cxx
index f12921c8a28e..49a9dbdd31f6 100644
--- a/xmloff/source/text/XMLAutoTextEventImport.cxx
+++ b/xmloff/source/text/XMLAutoTextEventImport.cxx
@@ -86,16 +86,13 @@ void XMLAutoTextEventImport::initialize(
SvXMLImportContext* XMLAutoTextEventImport::CreateFastContext(
sal_Int32 nElement,
- const Reference<css::xml::sax::XFastAttributeList> & xAttrList )
+ const Reference<css::xml::sax::XFastAttributeList> & /*xAttrList*/ )
{
if ( xEvents.is() && nElement == XML_ELEMENT(OOO, XML_AUTO_TEXT_EVENTS) )
{
return new XMLAutoTextContainerEventImport(*this, xEvents);
}
- else
- {
- return SvXMLImport::CreateFastContext(nElement, xAttrList);
- }
+ return nullptr;
}