summaryrefslogtreecommitdiff
path: root/editeng/source
diff options
context:
space:
mode:
authorNoel Grandin <noelgrandin@gmail.com>2020-01-07 13:01:41 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2020-01-07 17:45:03 +0100
commite1383444c6d00f5d0b1d507670517f45988b9cc7 (patch)
tree5304b99014f1b2236456923a3e98b2c0dbf31511 /editeng/source
parent0f4dd820ee433932d9d9237b676292d31c4ba913 (diff)
extract some common code from ImportContext classes
which reduces code bloat, and lets us log when elements are ignored Change-Id: I5ca12bc1fcbfa3bea49ebde819fd80bd233a96a0 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/86338 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'editeng/source')
-rw-r--r--editeng/source/misc/SvXMLAutoCorrectImport.cxx6
-rw-r--r--editeng/source/xml/xmltxtimp.cxx6
2 files changed, 2 insertions, 10 deletions
diff --git a/editeng/source/misc/SvXMLAutoCorrectImport.cxx b/editeng/source/misc/SvXMLAutoCorrectImport.cxx
index 0e93089acfba..fb64d57c024f 100644
--- a/editeng/source/misc/SvXMLAutoCorrectImport.cxx
+++ b/editeng/source/misc/SvXMLAutoCorrectImport.cxx
@@ -61,8 +61,7 @@ css::uno::Reference<XFastContextHandler> SAL_CALL SvXMLWordListContext::createFa
{
if ( Element == SvXMLAutoCorrectToken::BLOCK )
return new SvXMLWordContext (rLocalRef, xAttrList);
- else
- return new SvXMLImportContext( rLocalRef );
+ return nullptr;
}
SvXMLWordListContext::~SvXMLWordListContext()
@@ -135,8 +134,7 @@ css::uno::Reference<xml::sax::XFastContextHandler> SAL_CALL SvXMLExceptionListCo
{
if ( Element == SvXMLAutoCorrectToken::BLOCK )
return new SvXMLExceptionContext (rLocalRef, xAttrList);
- else
- return new SvXMLImportContext( rLocalRef );
+ return nullptr;
}
SvXMLExceptionListContext::~SvXMLExceptionListContext()
diff --git a/editeng/source/xml/xmltxtimp.cxx b/editeng/source/xml/xmltxtimp.cxx
index 42c757a8b3c1..6ebe9f235e3f 100644
--- a/editeng/source/xml/xmltxtimp.cxx
+++ b/editeng/source/xml/xmltxtimp.cxx
@@ -83,9 +83,6 @@ SvXMLImportContextRef SvxXMLTextImportContext::CreateChildContext( sal_uInt16 nP
pContext = GetImport().GetTextImport()->CreateTextChildContext( GetImport(), nPrefix, rLocalName, xAttrList );
}
- if( nullptr == pContext )
- pContext = new SvXMLImportContext( GetImport(), nPrefix, rLocalName );
-
return pContext;
}
@@ -118,9 +115,6 @@ SvXMLImportContext *SvxXMLXTextImportComponent::CreateDocumentContext(
pContext = new SvxXMLTextImportContext( *this, nPrefix, rLocalName, mxText );
}
- if( nullptr == pContext )
- pContext = new SvXMLImportContext( *this, nPrefix, rLocalName );
-
return pContext;
}