summaryrefslogtreecommitdiff
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
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>
-rw-r--r--dbaccess/source/filter/xml/xmlConnectionData.cxx3
-rw-r--r--dbaccess/source/filter/xml/xmlDataSource.cxx3
-rw-r--r--dbaccess/source/filter/xml/xmlDataSourceSetting.cxx3
-rw-r--r--dbaccess/source/filter/xml/xmlDataSourceSettings.cxx3
-rw-r--r--dbaccess/source/filter/xml/xmlDatabase.cxx3
-rw-r--r--dbaccess/source/filter/xml/xmlDatabaseDescription.cxx3
-rw-r--r--dbaccess/source/filter/xml/xmlDocuments.cxx3
-rw-r--r--dbaccess/source/filter/xml/xmlHierarchyCollection.cxx3
-rw-r--r--dbaccess/source/filter/xml/xmlQuery.cxx3
-rw-r--r--dbaccess/source/filter/xml/xmlTable.cxx3
-rw-r--r--dbaccess/source/filter/xml/xmlTableFilterList.cxx3
-rw-r--r--dbaccess/source/filter/xml/xmlfilter.cxx16
-rw-r--r--editeng/source/misc/SvXMLAutoCorrectImport.cxx6
-rw-r--r--editeng/source/xml/xmltxtimp.cxx6
-rw-r--r--linguistic/source/convdicxml.cxx9
-rw-r--r--reportdesign/source/filter/xml/xmlCell.cxx3
-rw-r--r--reportdesign/source/filter/xml/xmlColumn.cxx3
-rw-r--r--reportdesign/source/filter/xml/xmlControlProperty.cxx3
-rw-r--r--reportdesign/source/filter/xml/xmlGroup.cxx3
-rw-r--r--reportdesign/source/filter/xml/xmlMasterFields.cxx3
-rw-r--r--reportdesign/source/filter/xml/xmlReport.cxx3
-rw-r--r--reportdesign/source/filter/xml/xmlReportElement.cxx4
-rw-r--r--reportdesign/source/filter/xml/xmlReportElementBase.cxx2
-rw-r--r--reportdesign/source/filter/xml/xmlRow.cxx2
-rw-r--r--reportdesign/source/filter/xml/xmlSection.cxx3
-rw-r--r--reportdesign/source/filter/xml/xmlSubDocument.cxx3
-rw-r--r--reportdesign/source/filter/xml/xmlTable.cxx3
-rw-r--r--reportdesign/source/filter/xml/xmlfilter.cxx18
-rw-r--r--sc/source/filter/xml/XMLCalculationSettingsContext.cxx3
-rw-r--r--sc/source/filter/xml/XMLDDELinksContext.cxx12
-rw-r--r--sc/source/filter/xml/XMLDetectiveContext.cxx2
-rw-r--r--sc/source/filter/xml/XMLTableHeaderFooterContext.cxx4
-rw-r--r--sc/source/filter/xml/XMLTableShapesContext.cxx3
-rw-r--r--sc/source/filter/xml/XMLTableSourceContext.cxx2
-rw-r--r--sc/source/filter/xml/XMLTrackedChangesContext.cxx49
-rw-r--r--sc/source/filter/xml/celltextparacontext.cxx6
-rw-r--r--sc/source/filter/xml/importcontext.cxx2
-rw-r--r--sc/source/filter/xml/xmlannoi.cxx3
-rw-r--r--sc/source/filter/xml/xmlbodyi.cxx3
-rw-r--r--sc/source/filter/xml/xmlcelli.cxx6
-rw-r--r--sc/source/filter/xml/xmlcoli.cxx5
-rw-r--r--sc/source/filter/xml/xmlcvali.cxx17
-rw-r--r--sc/source/filter/xml/xmldpimp.cxx27
-rw-r--r--sc/source/filter/xml/xmldrani.cxx21
-rw-r--r--sc/source/filter/xml/xmlexternaltabi.cxx6
-rw-r--r--sc/source/filter/xml/xmlfilti.cxx21
-rw-r--r--sc/source/filter/xml/xmlimprt.cxx17
-rw-r--r--sc/source/filter/xml/xmllabri.cxx2
-rw-r--r--sc/source/filter/xml/xmlmappingi.cxx6
-rw-r--r--sc/source/filter/xml/xmlnexpi.cxx3
-rw-r--r--sc/source/filter/xml/xmlrowi.cxx6
-rw-r--r--sc/source/filter/xml/xmlsorti.cxx3
-rw-r--r--sc/source/filter/xml/xmltabi.cxx9
-rw-r--r--sc/source/filter/xml/xmltransformationi.cxx3
-rw-r--r--starmath/source/mathmlimport.cxx6
-rw-r--r--svx/source/xml/xmlxtimp.cxx2
-rw-r--r--sw/source/core/swg/SwXMLBlockImport.cxx12
-rw-r--r--sw/source/filter/xml/xmlbrsh.cxx4
-rw-r--r--sw/source/filter/xml/xmlimp.cxx7
-rw-r--r--sw/source/filter/xml/xmlitem.cxx8
-rw-r--r--sw/source/filter/xml/xmlmeta.cxx3
-rw-r--r--sw/source/filter/xml/xmlscript.cxx4
-rw-r--r--sw/source/filter/xml/xmltbli.cxx15
-rw-r--r--sw/source/filter/xml/xmltext.cxx5
-rw-r--r--xmloff/source/chart/SchXMLAxisContext.cxx2
-rw-r--r--xmloff/source/chart/SchXMLChartContext.cxx5
-rw-r--r--xmloff/source/chart/SchXMLImport.cxx6
-rw-r--r--xmloff/source/chart/SchXMLParagraphContext.cxx2
-rw-r--r--xmloff/source/chart/SchXMLPlotAreaContext.cxx3
-rw-r--r--xmloff/source/chart/SchXMLSeries2Context.cxx3
-rw-r--r--xmloff/source/chart/SchXMLTableContext.cxx17
-rw-r--r--xmloff/source/chart/SchXMLTextListContext.cxx4
-rw-r--r--xmloff/source/chart/XMLLabelSeparatorContext.cxx4
-rw-r--r--xmloff/source/chart/XMLSymbolImageContext.cxx4
-rw-r--r--xmloff/source/chart/contexts.cxx2
-rw-r--r--xmloff/source/core/DocumentSettingsContext.cxx6
-rw-r--r--xmloff/source/core/XMLEmbeddedObjectImportContext.cxx3
-rw-r--r--xmloff/source/core/xmlictxt.cxx9
-rw-r--r--xmloff/source/core/xmlimp.cxx8
-rw-r--r--xmloff/source/draw/XMLReplacementImageContext.cxx3
-rw-r--r--xmloff/source/draw/animationimport.cxx3
-rw-r--r--xmloff/source/draw/layerimp.cxx5
-rw-r--r--xmloff/source/draw/sdxmlimp.cxx7
-rw-r--r--xmloff/source/draw/ximpshow.cxx2
-rw-r--r--xmloff/source/forms/layerimport.cxx7
-rw-r--r--xmloff/source/forms/propertyimport.cxx22
-rw-r--r--xmloff/source/meta/xmlmetai.cxx3
-rw-r--r--xmloff/source/meta/xmlversion.cxx4
-rw-r--r--xmloff/source/script/xmlbasici.cxx3
-rw-r--r--xmloff/source/style/FillStyleContext.cxx4
-rw-r--r--xmloff/source/style/PageHeaderFooterContext.cxx3
-rw-r--r--xmloff/source/style/XMLBackgroundImageContext.cxx4
-rw-r--r--xmloff/source/style/xmlnumfi.cxx9
-rw-r--r--xmloff/source/style/xmlnumi.cxx12
-rw-r--r--xmloff/source/style/xmlprcon.cxx11
-rw-r--r--xmloff/source/style/xmlstyle.cxx5
-rw-r--r--xmloff/source/style/xmltabi.cxx4
-rw-r--r--xmloff/source/text/XMLAutoTextContainerEventImport.cxx3
-rw-r--r--xmloff/source/text/XMLFootnoteBodyImportContext.cxx2
-rw-r--r--xmloff/source/text/XMLFootnoteImportContext.cxx2
-rw-r--r--xmloff/source/text/XMLIndexBodyContext.cxx6
-rw-r--r--xmloff/source/text/XMLSectionImportContext.cxx7
-rw-r--r--xmloff/source/text/XMLTextColumnsContext.cxx4
-rw-r--r--xmloff/source/text/XMLTextFrameContext.cxx5
-rw-r--r--xmloff/source/text/XMLTextFrameHyperlinkContext.cxx2
-rw-r--r--xmloff/source/text/XMLTextHeaderFooterContext.cxx2
-rw-r--r--xmloff/source/text/XMLTextListBlockContext.cxx2
-rw-r--r--xmloff/source/text/XMLTextListItemContext.cxx3
-rw-r--r--xmloff/source/text/txtparai.cxx9
-rw-r--r--xmloff/source/xforms/SchemaContext.cxx8
-rw-r--r--xmloff/source/xforms/SchemaSimpleTypeContext.cxx9
-rw-r--r--xmloff/source/xforms/TokenContext.cxx1
-rw-r--r--xmloff/source/xforms/XFormsInstanceContext.cxx1
113 files changed, 74 insertions, 611 deletions
diff --git a/dbaccess/source/filter/xml/xmlConnectionData.cxx b/dbaccess/source/filter/xml/xmlConnectionData.cxx
index 41cd781b56c6..ddef531688c2 100644
--- a/dbaccess/source/filter/xml/xmlConnectionData.cxx
+++ b/dbaccess/source/filter/xml/xmlConnectionData.cxx
@@ -88,9 +88,6 @@ SvXMLImportContextRef OXMLConnectionData::CreateChildContext(
break;
}
- if( !pContext )
- pContext = new SvXMLImportContext( GetImport(), nPrefix, rLocalName );
-
return pContext;
}
diff --git a/dbaccess/source/filter/xml/xmlDataSource.cxx b/dbaccess/source/filter/xml/xmlDataSource.cxx
index 50b6b494abf2..aad160ee9bae 100644
--- a/dbaccess/source/filter/xml/xmlDataSource.cxx
+++ b/dbaccess/source/filter/xml/xmlDataSource.cxx
@@ -251,9 +251,6 @@ SvXMLImportContextRef OXMLDataSource::CreateChildContext(
break;
}
- if( !pContext )
- pContext = new SvXMLImportContext( GetImport(), nPrefix, rLocalName );
-
return pContext;
}
diff --git a/dbaccess/source/filter/xml/xmlDataSourceSetting.cxx b/dbaccess/source/filter/xml/xmlDataSourceSetting.cxx
index 74d0e9b992b9..a874f14bdffb 100644
--- a/dbaccess/source/filter/xml/xmlDataSourceSetting.cxx
+++ b/dbaccess/source/filter/xml/xmlDataSourceSetting.cxx
@@ -123,9 +123,6 @@ SvXMLImportContextRef OXMLDataSourceSetting::CreateChildContext(
break;
}
- if( !pContext )
- pContext = new SvXMLImportContext( GetImport(), nPrefix, rLocalName );
-
return pContext;
}
diff --git a/dbaccess/source/filter/xml/xmlDataSourceSettings.cxx b/dbaccess/source/filter/xml/xmlDataSourceSettings.cxx
index 2b40d715f136..3ff748158753 100644
--- a/dbaccess/source/filter/xml/xmlDataSourceSettings.cxx
+++ b/dbaccess/source/filter/xml/xmlDataSourceSettings.cxx
@@ -64,9 +64,6 @@ SvXMLImportContextRef OXMLDataSourceSettings::CreateChildContext(
break;
}
- if( !pContext )
- pContext = new SvXMLImportContext( GetImport(), nPrefix, rLocalName );
-
return pContext;
}
diff --git a/dbaccess/source/filter/xml/xmlDatabase.cxx b/dbaccess/source/filter/xml/xmlDatabase.cxx
index 62778fdb36d6..d6ca6e6e1d4a 100644
--- a/dbaccess/source/filter/xml/xmlDatabase.cxx
+++ b/dbaccess/source/filter/xml/xmlDatabase.cxx
@@ -122,9 +122,6 @@ SvXMLImportContextRef OXMLDatabase::CreateChildContext(
break;
}
- if( !pContext )
- pContext = new SvXMLImportContext( GetImport(), nPrefix, rLocalName );
-
return pContext;
}
diff --git a/dbaccess/source/filter/xml/xmlDatabaseDescription.cxx b/dbaccess/source/filter/xml/xmlDatabaseDescription.cxx
index dbdd3b540642..3290e3344f8e 100644
--- a/dbaccess/source/filter/xml/xmlDatabaseDescription.cxx
+++ b/dbaccess/source/filter/xml/xmlDatabaseDescription.cxx
@@ -75,9 +75,6 @@ SvXMLImportContextRef OXMLDatabaseDescription::CreateChildContext(
break;
}
- if( !pContext )
- pContext = new SvXMLImportContext( GetImport(), nPrefix, rLocalName );
-
return pContext;
}
diff --git a/dbaccess/source/filter/xml/xmlDocuments.cxx b/dbaccess/source/filter/xml/xmlDocuments.cxx
index 5edc6cd10106..4c58e6fada53 100644
--- a/dbaccess/source/filter/xml/xmlDocuments.cxx
+++ b/dbaccess/source/filter/xml/xmlDocuments.cxx
@@ -94,9 +94,6 @@ SvXMLImportContextRef OXMLDocuments::CreateChildContext(
break;
}
- if( !pContext )
- pContext = new SvXMLImportContext( GetImport(), nPrefix, rLocalName );
-
return pContext;
}
diff --git a/dbaccess/source/filter/xml/xmlHierarchyCollection.cxx b/dbaccess/source/filter/xml/xmlHierarchyCollection.cxx
index 7b94d3f1176d..44052a93ed67 100644
--- a/dbaccess/source/filter/xml/xmlHierarchyCollection.cxx
+++ b/dbaccess/source/filter/xml/xmlHierarchyCollection.cxx
@@ -135,9 +135,6 @@ SvXMLImportContextRef OXMLHierarchyCollection::CreateChildContext(
break;
}
- if( !pContext )
- pContext = new SvXMLImportContext( GetImport(), nPrefix, rLocalName );
-
return pContext;
}
diff --git a/dbaccess/source/filter/xml/xmlQuery.cxx b/dbaccess/source/filter/xml/xmlQuery.cxx
index a88e604c48ed..d41b1929937d 100644
--- a/dbaccess/source/filter/xml/xmlQuery.cxx
+++ b/dbaccess/source/filter/xml/xmlQuery.cxx
@@ -99,9 +99,6 @@ SvXMLImportContextRef OXMLQuery::CreateChildContext(
}
}
- if (!xContext)
- xContext = new SvXMLImportContext( GetImport(), nPrefix, rLocalName );
-
return xContext;
}
diff --git a/dbaccess/source/filter/xml/xmlTable.cxx b/dbaccess/source/filter/xml/xmlTable.cxx
index 7d574d09565e..b1fc0084d828 100644
--- a/dbaccess/source/filter/xml/xmlTable.cxx
+++ b/dbaccess/source/filter/xml/xmlTable.cxx
@@ -143,9 +143,6 @@ SvXMLImportContextRef OXMLTable::CreateChildContext(
break;
}
- if( !pContext )
- pContext = new SvXMLImportContext( GetImport(), nPrefix, rLocalName );
-
return pContext;
}
diff --git a/dbaccess/source/filter/xml/xmlTableFilterList.cxx b/dbaccess/source/filter/xml/xmlTableFilterList.cxx
index 34c823e1cc1f..dc98a855b6b5 100644
--- a/dbaccess/source/filter/xml/xmlTableFilterList.cxx
+++ b/dbaccess/source/filter/xml/xmlTableFilterList.cxx
@@ -66,9 +66,6 @@ SvXMLImportContextRef OXMLTableFilterList::CreateChildContext(
pContext = new OXMLTableFilterList( GetImport(), nPrefix, rLocalName );
}
- if( !pContext )
- pContext = new SvXMLImportContext( GetImport(), nPrefix, rLocalName );
-
return pContext;
}
diff --git a/dbaccess/source/filter/xml/xmlfilter.cxx b/dbaccess/source/filter/xml/xmlfilter.cxx
index 332933615ff3..2dc7c17fefc3 100644
--- a/dbaccess/source/filter/xml/xmlfilter.cxx
+++ b/dbaccess/source/filter/xml/xmlfilter.cxx
@@ -428,10 +428,7 @@ public:
{
return new XMLDocumentSettingsContext(GetImport(), nPrefix, rLocalName, xAttrList);
}
- else
- {
- return new SvXMLImportContext(GetImport(), nPrefix, rLocalName);
- }
+ return nullptr;
}
};
@@ -467,9 +464,6 @@ public:
break;
}
- if (!pContext)
- pContext = new SvXMLImportContext(GetImport(), nPrefix, rLocalName);
-
return pContext;
}
};
@@ -495,10 +489,7 @@ public:
rImport.GetProgressBarHelper()->Increment( PROGRESS_BAR_STEP );
return new OXMLDatabase(rImport, nPrefix, rLocalName );
}
- else
- {
- return new SvXMLImportContext(GetImport(), nPrefix, rLocalName);
- }
+ return nullptr;
}
};
@@ -536,9 +527,6 @@ public:
break;
}
- if (!pContext)
- pContext = new SvXMLImportContext(GetImport(), nPrefix, rLocalName);
-
return pContext;
}
};
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;
}
diff --git a/linguistic/source/convdicxml.cxx b/linguistic/source/convdicxml.cxx
index 07ce5258e3ad..b2dc42dbb270 100644
--- a/linguistic/source/convdicxml.cxx
+++ b/linguistic/source/convdicxml.cxx
@@ -171,8 +171,7 @@ css::uno::Reference<XFastContextHandler> ConvDicXMLImportContext::createFastChil
{
if ( Element == ConvDicXMLToken::TEXT_CONVERSION_DICTIONARY )
return new ConvDicXMLDictionaryContext_Impl( GetConvDicImport() );
- else
- return new SvXMLImportContext( GetImport() );
+ return nullptr;
}
@@ -210,8 +209,7 @@ css::uno::Reference<XFastContextHandler> ConvDicXMLDictionaryContext_Impl::creat
{
if ( Element == ConvDicXMLToken::ENTRY )
return new ConvDicXMLEntryTextContext_Impl( GetConvDicImport() );
- else
- return new SvXMLImportContext(GetImport());
+ return nullptr;
}
css::uno::Reference<XFastContextHandler> ConvDicXMLEntryTextContext_Impl::createFastChildContext(
@@ -220,8 +218,7 @@ css::uno::Reference<XFastContextHandler> ConvDicXMLEntryTextContext_Impl::create
{
if ( Element == ConvDicXMLToken::RIGHT_TEXT )
return new ConvDicXMLRightTextContext_Impl( GetConvDicImport(), *this );
- else
- return new SvXMLImportContext(GetImport());
+ return nullptr;
}
void ConvDicXMLEntryTextContext_Impl::startFastElement(
diff --git a/reportdesign/source/filter/xml/xmlCell.cxx b/reportdesign/source/filter/xml/xmlCell.cxx
index 9e22dd5a346d..0c6646d11934 100644
--- a/reportdesign/source/filter/xml/xmlCell.cxx
+++ b/reportdesign/source/filter/xml/xmlCell.cxx
@@ -174,9 +174,6 @@ SvXMLImportContextRef OXMLCell::CreateChildContext(
if ( m_xComponent.is() )
m_pContainer->addCell(m_xComponent);
- if( !pContext )
- pContext = new SvXMLImportContext( GetImport(), _nPrefix, _rLocalName );
-
return pContext;
}
diff --git a/reportdesign/source/filter/xml/xmlColumn.cxx b/reportdesign/source/filter/xml/xmlColumn.cxx
index f2e949356053..6498296cc441 100644
--- a/reportdesign/source/filter/xml/xmlColumn.cxx
+++ b/reportdesign/source/filter/xml/xmlColumn.cxx
@@ -115,9 +115,6 @@ SvXMLImportContextRef OXMLRowColumn::CreateChildContext(
break;
}
- if( !pContext )
- pContext = new SvXMLImportContext( GetImport(), nPrefix, rLocalName );
-
return pContext;
}
diff --git a/reportdesign/source/filter/xml/xmlControlProperty.cxx b/reportdesign/source/filter/xml/xmlControlProperty.cxx
index df7b9b2444a4..3f31577f842f 100644
--- a/reportdesign/source/filter/xml/xmlControlProperty.cxx
+++ b/reportdesign/source/filter/xml/xmlControlProperty.cxx
@@ -141,9 +141,6 @@ SvXMLImportContextRef OXMLControlProperty::CreateChildContext(
break;
}
- if( !pContext )
- pContext = new SvXMLImportContext( GetImport(), nPrefix, rLocalName );
-
return pContext;
}
diff --git a/reportdesign/source/filter/xml/xmlGroup.cxx b/reportdesign/source/filter/xml/xmlGroup.cxx
index 49f270760616..69dfc393ed28 100644
--- a/reportdesign/source/filter/xml/xmlGroup.cxx
+++ b/reportdesign/source/filter/xml/xmlGroup.cxx
@@ -231,9 +231,6 @@ SvXMLImportContextRef OXMLGroup::CreateChildContext(
break;
}
- if( !pContext )
- pContext = new SvXMLImportContext( GetImport(), nPrefix, rLocalName );
-
return pContext;
}
diff --git a/reportdesign/source/filter/xml/xmlMasterFields.cxx b/reportdesign/source/filter/xml/xmlMasterFields.cxx
index 3beed87e9f56..49df6b004de2 100644
--- a/reportdesign/source/filter/xml/xmlMasterFields.cxx
+++ b/reportdesign/source/filter/xml/xmlMasterFields.cxx
@@ -96,9 +96,6 @@ SvXMLImportContextRef OXMLMasterFields::CreateChildContext(
break;
}
- if( !pContext )
- pContext = new SvXMLImportContext( GetImport(), _nPrefix, _rLocalName );
-
return pContext;
}
diff --git a/reportdesign/source/filter/xml/xmlReport.cxx b/reportdesign/source/filter/xml/xmlReport.cxx
index 52079a32baae..5b7a7bfaf740 100644
--- a/reportdesign/source/filter/xml/xmlReport.cxx
+++ b/reportdesign/source/filter/xml/xmlReport.cxx
@@ -192,9 +192,6 @@ SvXMLImportContextRef OXMLReport::CreateChildContext(
break;
}
- if (!xContext)
- xContext = new SvXMLImportContext( GetImport(), nPrefix, rLocalName );
-
return xContext;
}
diff --git a/reportdesign/source/filter/xml/xmlReportElement.cxx b/reportdesign/source/filter/xml/xmlReportElement.cxx
index cff142c726eb..c01ae393dd56 100644
--- a/reportdesign/source/filter/xml/xmlReportElement.cxx
+++ b/reportdesign/source/filter/xml/xmlReportElement.cxx
@@ -113,10 +113,6 @@ SvXMLImportContextRef OXMLReportElement::CreateChildContext(
break;
}
- if( !pContext )
- pContext = new SvXMLImportContext( GetImport(), _nPrefix, _rLocalName );
-
-
return pContext;
}
diff --git a/reportdesign/source/filter/xml/xmlReportElementBase.cxx b/reportdesign/source/filter/xml/xmlReportElementBase.cxx
index 6d0a953ecca3..0963b2732439 100644
--- a/reportdesign/source/filter/xml/xmlReportElementBase.cxx
+++ b/reportdesign/source/filter/xml/xmlReportElementBase.cxx
@@ -54,8 +54,6 @@ SvXMLImportContextRef OXMLReportElementBase::CreateChildContext(
const Reference< XAttributeList > & xAttrList )
{
SvXMLImportContextRef xContext = CreateChildContext_(nPrefix,rLocalName,xAttrList);
- if (!xContext)
- xContext = new SvXMLImportContext( GetImport(), nPrefix, rLocalName );
return xContext;
}
diff --git a/reportdesign/source/filter/xml/xmlRow.cxx b/reportdesign/source/filter/xml/xmlRow.cxx
index 430d9cdeee8b..72a4a69cec55 100644
--- a/reportdesign/source/filter/xml/xmlRow.cxx
+++ b/reportdesign/source/filter/xml/xmlRow.cxx
@@ -111,7 +111,7 @@ SvXMLImportContext* OXMLRow::CreateChildContext(
}
if( !pContext )
- pContext = new SvXMLImportContext( GetImport(), nPrefix, rLocalName );
+ pContext = xxx( GetImport(), nPrefix, rLocalName );
return pContext;
}
diff --git a/reportdesign/source/filter/xml/xmlSection.cxx b/reportdesign/source/filter/xml/xmlSection.cxx
index 4c398601f03a..0c5a647f8662 100644
--- a/reportdesign/source/filter/xml/xmlSection.cxx
+++ b/reportdesign/source/filter/xml/xmlSection.cxx
@@ -119,9 +119,6 @@ SvXMLImportContextRef OXMLSection::CreateChildContext(
break;
}
- if( !pContext )
- pContext = new SvXMLImportContext( rImport, _nPrefix, _rLocalName );
-
return pContext;
}
diff --git a/reportdesign/source/filter/xml/xmlSubDocument.cxx b/reportdesign/source/filter/xml/xmlSubDocument.cxx
index f6196d21e87d..ff97c749656b 100644
--- a/reportdesign/source/filter/xml/xmlSubDocument.cxx
+++ b/reportdesign/source/filter/xml/xmlSubDocument.cxx
@@ -98,9 +98,6 @@ SvXMLImportContextRef OXMLSubDocument::CreateChildContext_(
break;
}
- if (!xContext)
- xContext = new SvXMLImportContext( GetImport(), _nPrefix, _rLocalName );
-
return xContext;
}
diff --git a/reportdesign/source/filter/xml/xmlTable.cxx b/reportdesign/source/filter/xml/xmlTable.cxx
index af7272437ba4..7bf8e57123d2 100644
--- a/reportdesign/source/filter/xml/xmlTable.cxx
+++ b/reportdesign/source/filter/xml/xmlTable.cxx
@@ -150,9 +150,6 @@ SvXMLImportContextRef OXMLTable::CreateChildContext(
break;
}
- if( !pContext )
- pContext = new SvXMLImportContext( rImport, _nPrefix, _rLocalName );
-
return pContext;
}
diff --git a/reportdesign/source/filter/xml/xmlfilter.cxx b/reportdesign/source/filter/xml/xmlfilter.cxx
index 0787a313c5d7..2a510dee12af 100644
--- a/reportdesign/source/filter/xml/xmlfilter.cxx
+++ b/reportdesign/source/filter/xml/xmlfilter.cxx
@@ -600,10 +600,7 @@ public:
{
return new XMLDocumentSettingsContext(GetImport(), nPrefix, rLocalName, xAttrList);
}
- else
- {
- return new SvXMLImportContext(GetImport(), nPrefix, rLocalName);
- }
+ return nullptr;
}
};
@@ -650,9 +647,6 @@ public:
break;
}
- if (!pContext)
- pContext = new SvXMLImportContext(GetImport(), nPrefix, rLocalName);
-
return pContext;
}
};
@@ -680,10 +674,7 @@ SvXMLImportContextRef RptXMLDocumentBodyContext::CreateChildContext(
}
return new OXMLReport(rImport, nPrefix, rLocalName, xAttrList, rImport.getReportDefinition());
}
- else
- {
- return new SvXMLImportContext(GetImport(), nPrefix, rLocalName);
- }
+ return nullptr;
}
namespace {
@@ -723,9 +714,6 @@ public:
break;
}
- if (!pContext)
- pContext = new SvXMLImportContext(GetImport(), nPrefix, rLocalName);
-
return pContext;
}
};
@@ -772,8 +760,6 @@ SvXMLImportContext *ORptFilter::CreateFastContext( sal_Int32 nElement,
GetProgressBarHelper()->Increment( PROGRESS_BAR_STEP );
pContext = CreateMetaContext( nElement );
break;
- default:
- pContext = new SvXMLImportContext(*this);
}
return pContext;
}
diff --git a/sc/source/filter/xml/XMLCalculationSettingsContext.cxx b/sc/source/filter/xml/XMLCalculationSettingsContext.cxx
index 90c59096e300..d2dd7e8ec923 100644
--- a/sc/source/filter/xml/XMLCalculationSettingsContext.cxx
+++ b/sc/source/filter/xml/XMLCalculationSettingsContext.cxx
@@ -104,9 +104,6 @@ uno::Reference< xml::sax::XFastContextHandler > SAL_CALL ScXMLCalculationSetting
else if (nElement == XML_ELEMENT( TABLE, XML_ITERATION ))
pContext = new ScXMLIterationContext(GetScImport(), pAttribList, this);
- if( !pContext )
- pContext = new SvXMLImportContext( GetImport() );
-
return pContext;
}
diff --git a/sc/source/filter/xml/XMLDDELinksContext.cxx b/sc/source/filter/xml/XMLDDELinksContext.cxx
index df0ee77f4fe1..a99b5a2f883f 100644
--- a/sc/source/filter/xml/XMLDDELinksContext.cxx
+++ b/sc/source/filter/xml/XMLDDELinksContext.cxx
@@ -50,9 +50,6 @@ uno::Reference< xml::sax::XFastContextHandler > SAL_CALL ScXMLDDELinksContext::c
if ( nElement == XML_ELEMENT( TABLE, XML_DDE_LINK) )
pContext = new ScXMLDDELinkContext(GetScImport());
- if( !pContext )
- pContext = new SvXMLImportContext( GetImport() );
-
return pContext;
}
@@ -92,9 +89,6 @@ uno::Reference< xml::sax::XFastContextHandler > SAL_CALL ScXMLDDELinkContext::cr
break;
}
- if( !pContext )
- pContext = new SvXMLImportContext( GetImport() );
-
return pContext;
}
@@ -251,9 +245,6 @@ uno::Reference< xml::sax::XFastContextHandler > SAL_CALL ScXMLDDETableContext::c
break;
}
- if (!pContext)
- pContext = new SvXMLImportContext( GetImport() );
-
return pContext;
}
@@ -308,9 +299,6 @@ uno::Reference< xml::sax::XFastContextHandler > SAL_CALL ScXMLDDERowContext::cre
if (nElement == XML_ELEMENT( TABLE, XML_TABLE_CELL ))
pContext = new ScXMLDDECellContext(GetScImport(), pAttribList, pDDELink);
- if (!pContext)
- pContext = new SvXMLImportContext( GetImport() );
-
return pContext;
}
diff --git a/sc/source/filter/xml/XMLDetectiveContext.cxx b/sc/source/filter/xml/XMLDetectiveContext.cxx
index ea7b370130d2..9912aaa22663 100644
--- a/sc/source/filter/xml/XMLDetectiveContext.cxx
+++ b/sc/source/filter/xml/XMLDetectiveContext.cxx
@@ -84,8 +84,6 @@ uno::Reference< xml::sax::XFastContextHandler > SAL_CALL ScXMLDetectiveContext::
pContext = new ScXMLDetectiveOperationContext( GetScImport(), pAttribList );
break;
}
- if( !pContext )
- pContext = new SvXMLImportContext( GetImport() );
return pContext;
}
diff --git a/sc/source/filter/xml/XMLTableHeaderFooterContext.cxx b/sc/source/filter/xml/XMLTableHeaderFooterContext.cxx
index c61ee8f3986d..40d98ce77a7f 100644
--- a/sc/source/filter/xml/XMLTableHeaderFooterContext.cxx
+++ b/sc/source/filter/xml/XMLTableHeaderFooterContext.cxx
@@ -163,8 +163,6 @@ SvXMLImportContextRef XMLTableHeaderFooterContext::CreateChildContext(
}
}
}
- if( !pContext )
- pContext = new SvXMLImportContext( GetImport(), nPrefix, rLocalName );
return pContext;
}
@@ -228,8 +226,6 @@ SvXMLImportContextRef XMLHeaderFooterRegionContext::CreateChildContext(
rLocalName,
xAttrList);
}
- if( !pContext )
- pContext = new SvXMLImportContext( GetImport(), nPrefix, rLocalName );
return pContext;
}
diff --git a/sc/source/filter/xml/XMLTableShapesContext.cxx b/sc/source/filter/xml/XMLTableShapesContext.cxx
index 93779e84dc4e..f645ee09e89a 100644
--- a/sc/source/filter/xml/XMLTableShapesContext.cxx
+++ b/sc/source/filter/xml/XMLTableShapesContext.cxx
@@ -49,9 +49,6 @@ SvXMLImportContextRef ScXMLTableShapesContext::CreateChildContext( sal_uInt16 nP
rXMLImport, nPrefix, rLName, xAttrList, xShapes);
}
- if( !pContext )
- pContext = new SvXMLImportContext( GetImport(), nPrefix, rLName );
-
return pContext;
}
diff --git a/sc/source/filter/xml/XMLTableSourceContext.cxx b/sc/source/filter/xml/XMLTableSourceContext.cxx
index 93ec9ac0ea75..89957208b6a0 100644
--- a/sc/source/filter/xml/XMLTableSourceContext.cxx
+++ b/sc/source/filter/xml/XMLTableSourceContext.cxx
@@ -79,7 +79,7 @@ ScXMLTableSourceContext::~ScXMLTableSourceContext()
uno::Reference< xml::sax::XFastContextHandler > SAL_CALL ScXMLTableSourceContext::createFastChildContext(
sal_Int32 /*nElement*/, const uno::Reference< xml::sax::XFastAttributeList >& /*xAttrList*/ )
{
- return new SvXMLImportContext( GetImport() );
+ return nullptr;
}
void SAL_CALL ScXMLTableSourceContext::endFastElement( sal_Int32 /*nElement*/ )
diff --git a/sc/source/filter/xml/XMLTrackedChangesContext.cxx b/sc/source/filter/xml/XMLTrackedChangesContext.cxx
index 4374f90362e3..d5cd5601f374 100644
--- a/sc/source/filter/xml/XMLTrackedChangesContext.cxx
+++ b/sc/source/filter/xml/XMLTrackedChangesContext.cxx
@@ -400,9 +400,6 @@ uno::Reference< xml::sax::XFastContextHandler > SAL_CALL ScXMLTrackedChangesCont
break;
}
- if( !pContext )
- pContext = new SvXMLImportContext( GetImport() );
-
return pContext;
}
@@ -450,9 +447,6 @@ SvXMLImportContextRef ScXMLChangeInfoContext::CreateChildContext( sal_uInt16 nPr
pContext = new ScXMLContentContext( GetScImport(), nPrefix, rLocalName, sCommentBuffer);
}
- if( !pContext )
- pContext = new SvXMLImportContext( GetImport(), nPrefix, rLocalName );
-
return pContext;
}
@@ -572,9 +566,6 @@ uno::Reference< xml::sax::XFastContextHandler > SAL_CALL ScXMLCellContentDeletio
break;
}
- if( !pContext )
- pContext = new SvXMLImportContext( GetImport() );
-
return pContext;
}
@@ -625,9 +616,6 @@ uno::Reference< xml::sax::XFastContextHandler > SAL_CALL ScXMLDependingsContext:
pContext = new ScXMLDependenceContext(GetScImport(), pAttribList, pChangeTrackingImportHelper);
}
- if( !pContext )
- pContext = new SvXMLImportContext( GetImport() );
-
return pContext;
}
@@ -671,9 +659,6 @@ uno::Reference< xml::sax::XFastContextHandler > SAL_CALL ScXMLDeletionsContext::
break;
}
- if( !pContext )
- pContext = new SvXMLImportContext( GetImport() );
-
return pContext;
}
@@ -737,9 +722,6 @@ SvXMLImportContextRef ScXMLChangeTextPContext::CreateChildContext( sal_uInt16 nT
}
}
- if (!xContext)
- xContext = new SvXMLImportContext( GetImport(), nPrefix, rLName );
-
return xContext;
}
@@ -862,9 +844,6 @@ SvXMLImportContextRef ScXMLChangeCellContext::CreateChildContext( sal_uInt16 nPr
}
}
- if( !pContext )
- pContext = new SvXMLImportContext( GetImport(), nPrefix, rLocalName );
-
return pContext;
}
@@ -968,9 +947,6 @@ uno::Reference< xml::sax::XFastContextHandler > SAL_CALL ScXMLPreviousContext::c
pContext = new ScXMLChangeCellContext(GetScImport(), pAttribList,
maOldCell, sFormulaAddress, sFormula, sFormulaNmsp, eGrammar, sInputString, fValue, nType, nMatrixFlag, nMatrixCols, nMatrixRows);
- if( !pContext )
- pContext = new SvXMLImportContext( GetImport() );
-
return pContext;
}
@@ -1043,9 +1019,6 @@ uno::Reference< xml::sax::XFastContextHandler > SAL_CALL ScXMLContentChangeConte
break;
}
- if( !pContext )
- pContext = new SvXMLImportContext( GetImport() );
-
return pContext;
}
@@ -1133,9 +1106,6 @@ uno::Reference< xml::sax::XFastContextHandler > SAL_CALL ScXMLInsertionContext::
break;
}
- if( !pContext )
- pContext = new SvXMLImportContext( GetImport() );
-
return pContext;
}
@@ -1256,9 +1226,6 @@ SvXMLImportContextRef ScXMLCutOffsContext::CreateChildContext( sal_uInt16 nPrefi
pContext = new ScXMLMovementCutOffContext(GetScImport(), nPrefix, rLocalName, xAttrList, pChangeTrackingImportHelper);
}
- if( !pContext )
- pContext = new SvXMLImportContext( GetImport(), nPrefix, rLocalName );
-
return pContext;
}
@@ -1336,15 +1303,8 @@ SvXMLImportContextRef ScXMLDeletionContext::CreateChildContext( sal_uInt16 nPref
{
if (IsXMLToken(rLocalName, XML_CUT_OFFS) || rLocalName == "cut_offs")
pContext = new ScXMLCutOffsContext(GetScImport(), nPrefix, rLocalName, pChangeTrackingImportHelper);
- else
- {
- OSL_FAIL("don't know this");
- }
}
- if( !pContext )
- pContext = new SvXMLImportContext( GetImport(), nPrefix, rLocalName );
-
return pContext;
}
@@ -1368,9 +1328,6 @@ uno::Reference< xml::sax::XFastContextHandler > SAL_CALL ScXMLDeletionContext::c
break;
}
- if ( !pContext )
- pContext = new SvXMLImportContext( GetImport() );
-
return pContext;
}
@@ -1443,9 +1400,6 @@ uno::Reference< xml::sax::XFastContextHandler > SAL_CALL ScXMLMovementContext::c
break;
}
- if( !pContext )
- pContext = new SvXMLImportContext( GetImport() );
-
return pContext;
}
@@ -1513,9 +1467,6 @@ uno::Reference< xml::sax::XFastContextHandler > SAL_CALL ScXMLRejectionContext::
break;
}
- if( !pContext )
- pContext = new SvXMLImportContext( GetImport() );
-
return pContext;
}
diff --git a/sc/source/filter/xml/celltextparacontext.cxx b/sc/source/filter/xml/celltextparacontext.cxx
index 2f7cc12397cb..e8f6886057ab 100644
--- a/sc/source/filter/xml/celltextparacontext.cxx
+++ b/sc/source/filter/xml/celltextparacontext.cxx
@@ -64,7 +64,7 @@ uno::Reference< xml::sax::XFastContextHandler > SAL_CALL ScXMLCellTextParaContex
;
}
- return new SvXMLImportContext(GetImport());
+ return nullptr;
}
void ScXMLCellTextParaContext::PushSpan(const OUString& rSpan, const OUString& rStyleName)
@@ -180,7 +180,7 @@ uno::Reference< xml::sax::XFastContextHandler > SAL_CALL ScXMLCellTextSpanContex
;
}
- return new SvXMLImportContext(GetImport());
+ return nullptr;
}
ScXMLCellFieldSheetNameContext::ScXMLCellFieldSheetNameContext(
@@ -343,7 +343,7 @@ uno::Reference< xml::sax::XFastContextHandler > SAL_CALL ScXMLCellFieldSContext:
mnCount = 0;
}
- return new SvXMLImportContext(GetImport());
+ return nullptr;
}
void ScXMLCellFieldSContext::PushSpaces()
diff --git a/sc/source/filter/xml/importcontext.cxx b/sc/source/filter/xml/importcontext.cxx
index 3622c14ca018..df219df61679 100644
--- a/sc/source/filter/xml/importcontext.cxx
+++ b/sc/source/filter/xml/importcontext.cxx
@@ -45,7 +45,7 @@ void SAL_CALL ScXMLImportContext::characters(const OUString &)
css::uno::Reference< css::xml::sax::XFastContextHandler > SAL_CALL ScXMLImportContext::createFastChildContext(
sal_Int32/* nElement */, const css::uno::Reference< css::xml::sax::XFastAttributeList >&/* xAttrList */ )
{
- return new SvXMLImportContext( GetImport() );
+ return nullptr;
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/filter/xml/xmlannoi.cxx b/sc/source/filter/xml/xmlannoi.cxx
index 9df714e244f5..d84b297b5084 100644
--- a/sc/source/filter/xml/xmlannoi.cxx
+++ b/sc/source/filter/xml/xmlannoi.cxx
@@ -138,9 +138,6 @@ SvXMLImportContextRef ScXMLAnnotationContext::CreateChildContext( sal_uInt16 nPr
if( !xContext && pShapeContext )
xContext = pShapeContext->CreateChildContext(nPrefix, rLName, xAttrList);
- if (!xContext)
- xContext = new SvXMLImportContext( GetImport(), nPrefix, rLName );
-
return xContext;
}
diff --git a/sc/source/filter/xml/xmlbodyi.cxx b/sc/source/filter/xml/xmlbodyi.cxx
index 2b9a5886a049..36d9b85472a6 100644
--- a/sc/source/filter/xml/xmlbodyi.cxx
+++ b/sc/source/filter/xml/xmlbodyi.cxx
@@ -190,9 +190,6 @@ uno::Reference< xml::sax::XFastContextHandler > SAL_CALL
break;
}
- if( !pContext )
- pContext = new SvXMLImportContext( GetImport() );
-
return pContext;
}
diff --git a/sc/source/filter/xml/xmlcelli.cxx b/sc/source/filter/xml/xmlcelli.cxx
index a14c667abaa0..918a103158e8 100644
--- a/sc/source/filter/xml/xmlcelli.cxx
+++ b/sc/source/filter/xml/xmlcelli.cxx
@@ -680,9 +680,6 @@ SvXMLImportContextRef ScXMLTableRowCellContext::CreateChildContext( sal_uInt16 n
}
}
- if( !pContext )
- pContext = new SvXMLImportContext( GetImport(), nPrefix, rLName );
-
return pContext;
}
@@ -729,9 +726,6 @@ uno::Reference< xml::sax::XFastContextHandler > SAL_CALL ScXMLTableRowCellContex
break;
}
- if( !pContext )
- pContext = new SvXMLImportContext( GetImport() );
-
return pContext;
}
diff --git a/sc/source/filter/xml/xmlcoli.cxx b/sc/source/filter/xml/xmlcoli.cxx
index 40f8b4f74d56..96af8cd7f39a 100644
--- a/sc/source/filter/xml/xmlcoli.cxx
+++ b/sc/source/filter/xml/xmlcoli.cxx
@@ -82,7 +82,7 @@ ScXMLTableColContext::~ScXMLTableColContext()
uno::Reference< xml::sax::XFastContextHandler > SAL_CALL ScXMLTableColContext::createFastChildContext(
sal_Int32 /*nElement*/, const uno::Reference< xml::sax::XFastAttributeList >& /*xAttrList*/ )
{
- return new SvXMLImportContext( GetImport() );
+ return nullptr;
}
void SAL_CALL ScXMLTableColContext::endFastElement( sal_Int32 /*nElement*/ )
@@ -198,9 +198,6 @@ uno::Reference< xml::sax::XFastContextHandler > SAL_CALL ScXMLTableColsContext::
break;
}
- if( !pContext )
- pContext = new SvXMLImportContext( GetImport() );
-
return pContext;
}
diff --git a/sc/source/filter/xml/xmlcvali.cxx b/sc/source/filter/xml/xmlcvali.cxx
index cff9a046c0da..e32fe80cfb84 100644
--- a/sc/source/filter/xml/xmlcvali.cxx
+++ b/sc/source/filter/xml/xmlcvali.cxx
@@ -164,9 +164,6 @@ uno::Reference< xml::sax::XFastContextHandler > SAL_CALL ScXMLContentValidations
break;
}
- if( !pContext )
- pContext = new SvXMLImportContext( GetImport() );
-
return pContext;
}
@@ -236,9 +233,6 @@ SvXMLImportContextRef ScXMLContentValidationContext::CreateChildContext( sal_uIn
break;
}
- if( !pContext )
- pContext = new SvXMLImportContext( GetImport(), nPrefix, rLName );
-
return pContext;
}
@@ -262,9 +256,6 @@ uno::Reference< xml::sax::XFastContextHandler > SAL_CALL ScXMLContentValidationC
break;
}
- if( !pContext )
- pContext = new SvXMLImportContext( GetImport() );
-
return pContext;
}
@@ -483,9 +474,6 @@ SvXMLImportContextRef ScXMLHelpMessageContext::CreateChildContext( sal_uInt16 nP
break;
}
- if( !pContext )
- pContext = new SvXMLImportContext( GetImport(), nPrefix, rLName );
-
return pContext;
}
@@ -544,9 +532,6 @@ SvXMLImportContextRef ScXMLErrorMessageContext::CreateChildContext( sal_uInt16 n
break;
}
- if( !pContext )
- pContext = new SvXMLImportContext( GetImport(), nPrefix, rLName );
-
return pContext;
}
@@ -588,8 +573,6 @@ SvXMLImportContextRef ScXMLErrorMacroContext::CreateChildContext( sal_uInt16 nPr
{
pContext = new XMLEventsImportContext(GetImport(), nPrefix, rLName);
}
- if (!pContext)
- pContext = new SvXMLImportContext( GetImport(), nPrefix, rLName );
return pContext;
}
diff --git a/sc/source/filter/xml/xmldpimp.cxx b/sc/source/filter/xml/xmldpimp.cxx
index 15dd638deaeb..4ce22c4326ff 100644
--- a/sc/source/filter/xml/xmldpimp.cxx
+++ b/sc/source/filter/xml/xmldpimp.cxx
@@ -77,9 +77,6 @@ uno::Reference< xml::sax::XFastContextHandler > SAL_CALL ScXMLDataPilotTablesCon
break;
}
- if( !pContext )
- pContext = new SvXMLImportContext( GetImport() );
-
return pContext;
}
@@ -243,9 +240,6 @@ uno::Reference< xml::sax::XFastContextHandler > SAL_CALL ScXMLDataPilotTableCont
break;
}
- if( !pContext )
- pContext = new SvXMLImportContext( GetImport() );
-
return pContext;
}
@@ -782,9 +776,6 @@ uno::Reference< xml::sax::XFastContextHandler > SAL_CALL ScXMLSourceCellRangeCon
break;
}
- if( !pContext )
- pContext = new SvXMLImportContext( GetImport() );
-
return pContext;
}
@@ -885,9 +876,6 @@ uno::Reference< xml::sax::XFastContextHandler > SAL_CALL ScXMLDataPilotFieldCont
break;
}
- if( !pContext )
- pContext = new SvXMLImportContext( GetImport() );
-
return pContext;
}
@@ -1087,9 +1075,6 @@ uno::Reference< xml::sax::XFastContextHandler > SAL_CALL ScXMLDataPilotLevelCont
break;
}
- if( !pContext )
- pContext = new SvXMLImportContext( GetImport() );
-
return pContext;
}
@@ -1239,9 +1224,6 @@ uno::Reference< xml::sax::XFastContextHandler > SAL_CALL ScXMLDataPilotSubTotals
break;
}
- if( !pContext )
- pContext = new SvXMLImportContext( GetImport() );
-
return pContext;
}
@@ -1315,9 +1297,6 @@ uno::Reference< xml::sax::XFastContextHandler > SAL_CALL ScXMLDataPilotMembersCo
break;
}
- if( !pContext )
- pContext = new SvXMLImportContext( GetImport() );
-
return pContext;
}
@@ -1489,9 +1468,6 @@ uno::Reference< xml::sax::XFastContextHandler > SAL_CALL ScXMLDataPilotGroupsCon
pContext = new ScXMLDataPilotGroupContext(GetScImport(), pAttribList, pDataPilotField);
}
- if( !pContext )
- pContext = new SvXMLImportContext( GetImport() );
-
return pContext;
}
@@ -1526,9 +1502,6 @@ uno::Reference< xml::sax::XFastContextHandler > SAL_CALL ScXMLDataPilotGroupCont
pContext = new ScXMLDataPilotGroupMemberContext(GetScImport(), pAttribList, this);
}
- if( !pContext )
- pContext = new SvXMLImportContext( GetImport() );
-
return pContext;
}
diff --git a/sc/source/filter/xml/xmldrani.cxx b/sc/source/filter/xml/xmldrani.cxx
index 5ca1a1c01b08..181050c98458 100644
--- a/sc/source/filter/xml/xmldrani.cxx
+++ b/sc/source/filter/xml/xmldrani.cxx
@@ -75,9 +75,6 @@ uno::Reference< xml::sax::XFastContextHandler > SAL_CALL ScXMLDatabaseRangesCont
break;
}
- if( !pContext )
- pContext = new SvXMLImportContext( GetImport() );
-
return pContext;
}
@@ -238,9 +235,6 @@ uno::Reference< xml::sax::XFastContextHandler > SAL_CALL ScXMLDatabaseRangeConte
break;
}
- if( !pContext )
- pContext = new SvXMLImportContext( GetImport() );
-
return pContext;
}
@@ -487,9 +481,6 @@ uno::Reference< xml::sax::XFastContextHandler > SAL_CALL ScXMLSourceSQLContext::
pContext = new ScXMLConResContext( GetScImport(), pAttribList, pDatabaseRangeContext);
}
- if( !pContext )
- pContext = new SvXMLImportContext( GetImport() );
-
return pContext;
}
@@ -540,9 +531,6 @@ uno::Reference< xml::sax::XFastContextHandler > SAL_CALL ScXMLSourceTableContext
pContext = new ScXMLConResContext( GetScImport(), pAttribList, pDatabaseRangeContext);
}
- if( !pContext )
- pContext = new SvXMLImportContext( GetImport() );
-
return pContext;
}
@@ -592,9 +580,6 @@ uno::Reference< xml::sax::XFastContextHandler > SAL_CALL ScXMLSourceQueryContext
pContext = new ScXMLConResContext( GetScImport(), pAttribList, pDatabaseRangeContext);
}
- if( !pContext )
- pContext = new SvXMLImportContext( GetImport() );
-
return pContext;
}
@@ -675,9 +660,6 @@ uno::Reference< xml::sax::XFastContextHandler > SAL_CALL ScXMLSubTotalRulesConte
break;
}
- if( !pContext )
- pContext = new SvXMLImportContext( GetImport() );
-
return pContext;
}
@@ -780,9 +762,6 @@ uno::Reference< xml::sax::XFastContextHandler > SAL_CALL ScXMLSubTotalRuleContex
break;
}
- if( !pContext )
- pContext = new SvXMLImportContext( GetImport() );
-
return pContext;
}
diff --git a/sc/source/filter/xml/xmlexternaltabi.cxx b/sc/source/filter/xml/xmlexternaltabi.cxx
index 5515fd835ba5..a442f1418dc2 100644
--- a/sc/source/filter/xml/xmlexternaltabi.cxx
+++ b/sc/source/filter/xml/xmlexternaltabi.cxx
@@ -142,7 +142,7 @@ Reference< XFastContextHandler > SAL_CALL ScXMLExternalRefRowsContext::createFas
default:
;
}
- return new SvXMLImportContext( GetImport() );
+ return nullptr;
}
ScXMLExternalRefRowContext::ScXMLExternalRefRowContext(
@@ -187,7 +187,7 @@ Reference< XFastContextHandler > SAL_CALL ScXMLExternalRefRowContext::createFast
if (nToken == XML_TOK_TABLE_ROW_CELL || nToken == XML_TOK_TABLE_ROW_COVERED_CELL)
return new ScXMLExternalRefCellContext(mrScImport, pAttribList, mrExternalRefInfo);
- return new SvXMLImportContext( GetImport() );
+ return nullptr;
}
void SAL_CALL ScXMLExternalRefRowContext::endFastElement( sal_Int32 /* nElement */ )
@@ -331,7 +331,7 @@ Reference< XFastContextHandler > SAL_CALL ScXMLExternalRefCellContext::createFas
if (nToken == XML_TOK_TABLE_ROW_CELL_P)
return new ScXMLExternalRefCellTextContext(mrScImport, *this);
- return new SvXMLImportContext( GetImport() );
+ return nullptr;
}
void SAL_CALL ScXMLExternalRefCellContext::endFastElement( sal_Int32 /*nElement*/ )
diff --git a/sc/source/filter/xml/xmlfilti.cxx b/sc/source/filter/xml/xmlfilti.cxx
index 50cfb09bfb8e..771575822b67 100644
--- a/sc/source/filter/xml/xmlfilti.cxx
+++ b/sc/source/filter/xml/xmlfilti.cxx
@@ -123,9 +123,6 @@ uno::Reference< xml::sax::XFastContextHandler > SAL_CALL ScXMLFilterContext::cre
break;
}
- if( !pContext )
- pContext = new SvXMLImportContext( GetImport() );
-
return pContext;
}
@@ -223,9 +220,6 @@ uno::Reference< xml::sax::XFastContextHandler > SAL_CALL ScXMLAndContext::create
break;
}
- if( !pContext )
- pContext = new SvXMLImportContext( GetImport() );
-
return pContext;
}
@@ -271,9 +265,6 @@ uno::Reference< xml::sax::XFastContextHandler > SAL_CALL ScXMLOrContext::createF
break;
}
- if( !pContext )
- pContext = new SvXMLImportContext( GetImport() );
-
return pContext;
}
@@ -352,9 +343,6 @@ uno::Reference< xml::sax::XFastContextHandler > SAL_CALL ScXMLConditionContext::
break;
}
- if( !pContext )
- pContext = new SvXMLImportContext( GetImport() );
-
return pContext;
}
@@ -552,9 +540,6 @@ uno::Reference< xml::sax::XFastContextHandler > SAL_CALL ScXMLDPFilterContext::c
break;
}
- if( !pContext )
- pContext = new SvXMLImportContext( GetImport() );
-
return pContext;
}
@@ -609,9 +594,6 @@ uno::Reference< xml::sax::XFastContextHandler > SAL_CALL ScXMLDPAndContext::crea
break;
}
- if( !pContext )
- pContext = new SvXMLImportContext( GetImport() );
-
return pContext;
}
@@ -653,9 +635,6 @@ uno::Reference< xml::sax::XFastContextHandler > SAL_CALL ScXMLDPOrContext::creat
break;
}
- if( !pContext )
- pContext = new SvXMLImportContext( GetImport() );
-
return pContext;
}
diff --git a/sc/source/filter/xml/xmlimprt.cxx b/sc/source/filter/xml/xmlimprt.cxx
index 1c90d5627fd2..2cb864cb56f5 100644
--- a/sc/source/filter/xml/xmlimprt.cxx
+++ b/sc/source/filter/xml/xmlimprt.cxx
@@ -383,9 +383,6 @@ SvXMLImportContextRef ScXMLDocContext_Impl::CreateChildContext( sal_uInt16 nPref
break;
}
- if(!pContext)
- pContext = new SvXMLImportContext( GetImport(), nPrefix, rLocalName );
-
return pContext;
}
@@ -403,13 +400,8 @@ uno::Reference< xml::sax::XFastContextHandler > SAL_CALL
break;
//TODO: handle all other cases
- default:
- pContext = new SvXMLImportContext( GetImport() );
}
- if(!pContext)
- pContext = new SvXMLImportContext( GetImport() );
-
return pContext;
}
@@ -658,8 +650,6 @@ SvXMLImportContext *ScXMLImport::CreateFastContext( sal_Int32 nElement,
break;
}
- default:
- pContext = new SvXMLImportContext( *this );
}
return pContext;
@@ -795,9 +785,6 @@ SvXMLImportContext *ScXMLImport::CreateMetaContext(
pContext = new SvXMLMetaDocumentContext(*this, xDocProps);
}
- if( !pContext )
- pContext = new SvXMLImportContext( *this );
-
return pContext;
}
@@ -811,10 +798,6 @@ SvXMLImportContext *ScXMLImport::CreateScriptContext(
pContext = new XMLScriptContext( *this, rLocalName, GetModel() );
}
- if( !pContext )
- pContext = new SvXMLImportContext( *this, XML_NAMESPACE_OFFICE,
- rLocalName );
-
return pContext;
}
diff --git a/sc/source/filter/xml/xmllabri.cxx b/sc/source/filter/xml/xmllabri.cxx
index 401bac28b866..ef3f2fb84f4a 100644
--- a/sc/source/filter/xml/xmllabri.cxx
+++ b/sc/source/filter/xml/xmllabri.cxx
@@ -50,8 +50,6 @@ uno::Reference< xml::sax::XFastContextHandler > SAL_CALL ScXMLLabelRangesContext
pContext = new ScXMLLabelRangeContext( GetScImport(), pAttribList );
break;
}
- if( !pContext )
- pContext = new SvXMLImportContext( GetImport() );
return pContext;
}
diff --git a/sc/source/filter/xml/xmlmappingi.cxx b/sc/source/filter/xml/xmlmappingi.cxx
index 0ce24a568e4b..7e4618e25d6a 100644
--- a/sc/source/filter/xml/xmlmappingi.cxx
+++ b/sc/source/filter/xml/xmlmappingi.cxx
@@ -54,9 +54,6 @@ uno::Reference< xml::sax::XFastContextHandler > SAL_CALL ScXMLMappingsContext::c
break;
}
- if( !pContext )
- pContext = new SvXMLImportContext( GetImport() );
-
return pContext;
}
@@ -138,9 +135,6 @@ uno::Reference<xml::sax::XFastContextHandler>
break;
}
- if( !pContext )
- pContext = new SvXMLImportContext( GetImport() );
-
return pContext;
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/filter/xml/xmlnexpi.cxx b/sc/source/filter/xml/xmlnexpi.cxx
index 737b3cda7a62..84b5482cff21 100644
--- a/sc/source/filter/xml/xmlnexpi.cxx
+++ b/sc/source/filter/xml/xmlnexpi.cxx
@@ -75,9 +75,6 @@ uno::Reference< xml::sax::XFastContextHandler > SAL_CALL ScXMLNamedExpressionsCo
break;
}
- if( !pContext )
- pContext = new SvXMLImportContext( GetImport() );
-
return pContext;
}
diff --git a/sc/source/filter/xml/xmlrowi.cxx b/sc/source/filter/xml/xmlrowi.cxx
index 112e637c3051..e4d364f40d44 100644
--- a/sc/source/filter/xml/xmlrowi.cxx
+++ b/sc/source/filter/xml/xmlrowi.cxx
@@ -127,9 +127,6 @@ uno::Reference< xml::sax::XFastContextHandler > SAL_CALL
break;
}
- if( !pContext )
- pContext = new SvXMLImportContext( GetImport() );
-
return pContext;
}
@@ -282,9 +279,6 @@ uno::Reference< xml::sax::XFastContextHandler > SAL_CALL
break;
}
- if( !pContext )
- pContext = new SvXMLImportContext( GetImport() );
-
return pContext;
}
diff --git a/sc/source/filter/xml/xmlsorti.cxx b/sc/source/filter/xml/xmlsorti.cxx
index 938b6e7b2cb3..066b6ab0e113 100644
--- a/sc/source/filter/xml/xmlsorti.cxx
+++ b/sc/source/filter/xml/xmlsorti.cxx
@@ -121,9 +121,6 @@ uno::Reference< xml::sax::XFastContextHandler > SAL_CALL ScXMLSortContext::creat
break;
}
- if( !pContext )
- pContext = new SvXMLImportContext( GetImport() );
-
return pContext;
}
diff --git a/sc/source/filter/xml/xmltabi.cxx b/sc/source/filter/xml/xmltabi.cxx
index a8e5b99a2756..5f529b60e79a 100644
--- a/sc/source/filter/xml/xmltabi.cxx
+++ b/sc/source/filter/xml/xmltabi.cxx
@@ -243,9 +243,6 @@ SvXMLImportContextRef ScXMLTableContext::CreateChildContext( sal_uInt16 nPrefix,
;
}
- if( !pContext )
- pContext = new SvXMLImportContext( GetImport(), nPrefix, rLName );
-
return pContext;
}
@@ -277,7 +274,7 @@ uno::Reference< xml::sax::XFastContextHandler > SAL_CALL
default:
;
}
- return new SvXMLImportContext( GetImport() );
+ return nullptr;
}
SvXMLImportContext *pContext(nullptr);
@@ -339,12 +336,8 @@ uno::Reference< xml::sax::XFastContextHandler > SAL_CALL
case XML_ELEMENT( CALC_EXT, XML_CONDITIONAL_FORMATS ):
pContext = new ScXMLConditionalFormatsContext( GetScImport() );
break;
- default:
- pContext = new SvXMLImportContext( GetImport() );
}
- assert(pContext);
-
return pContext;
}
diff --git a/sc/source/filter/xml/xmltransformationi.cxx b/sc/source/filter/xml/xmltransformationi.cxx
index 6c2871b138e6..435d73915023 100644
--- a/sc/source/filter/xml/xmltransformationi.cxx
+++ b/sc/source/filter/xml/xmltransformationi.cxx
@@ -78,9 +78,6 @@ uno::Reference<xml::sax::XFastContextHandler>
break;
}
- if (!pContext)
- pContext = new SvXMLImportContext(GetImport());
-
return pContext;
}
diff --git a/starmath/source/mathmlimport.cxx b/starmath/source/mathmlimport.cxx
index ddeea7932351..0624d6afee88 100644
--- a/starmath/source/mathmlimport.cxx
+++ b/starmath/source/mathmlimport.cxx
@@ -1994,8 +1994,6 @@ SvXMLImportContextRef SmXMLOfficeContext_Impl::CreateChildContext(sal_uInt16 nPr
XML_NAMESPACE_OFFICE, rLocalName,
xAttrList );
}
- else
- pContext = new SvXMLImportContext( GetImport(), nPrefix, rLocalName );
return pContext;
}
@@ -2003,7 +2001,7 @@ SvXMLImportContextRef SmXMLOfficeContext_Impl::CreateChildContext(sal_uInt16 nPr
uno::Reference< xml::sax::XFastContextHandler > SAL_CALL SmXMLOfficeContext_Impl::createFastChildContext(
sal_Int32 /*nElement*/, const uno::Reference< xml::sax::XFastAttributeList >& /*xAttrList*/ )
{
- return new SvXMLImportContext( GetImport() );
+ return nullptr;
}
namespace {
@@ -2915,8 +2913,6 @@ SvXMLImportContext *SmXMLImport::CreateFastContext(sal_Int32 nElement,
default:
if ((nElement & NMSP_MASK) == NAMESPACE_TOKEN(XML_NAMESPACE_OFFICE))
pContext = new SmXMLOfficeContext_Impl(*this);
- else
- pContext = new SvXMLImportContext(*this);
}
return pContext;
}
diff --git a/svx/source/xml/xmlxtimp.cxx b/svx/source/xml/xmlxtimp.cxx
index 570ae8df777f..548f3c7009aa 100644
--- a/svx/source/xml/xmlxtimp.cxx
+++ b/svx/source/xml/xmlxtimp.cxx
@@ -458,7 +458,7 @@ SvXMLImportContext *SvxXMLXTableImport::CreateDocumentContext(
}
}
- return new SvXMLImportContext( *this, nPrefix, rLocalName );
+ return nullptr;
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/swg/SwXMLBlockImport.cxx b/sw/source/core/swg/SwXMLBlockImport.cxx
index 14fe001096b7..ceda8003a152 100644
--- a/sw/source/core/swg/SwXMLBlockImport.cxx
+++ b/sw/source/core/swg/SwXMLBlockImport.cxx
@@ -185,8 +185,7 @@ SwXMLBlockListContext::createFastChildContext( sal_Int32 Element,
{
if ( Element == SwXMLBlockListToken::BLOCK )
return new SwXMLBlockContext( rLocalRef, xAttrList );
- else
- return new SvXMLImportContext( rLocalRef );
+ return nullptr;
}
SwXMLBlockContext::SwXMLBlockContext(
@@ -230,8 +229,7 @@ SwXMLTextBlockDocumentContext::createFastChildContext( sal_Int32 Element,
{
if ( Element == SwXMLTextBlockToken::OFFICE_BODY )
return new SwXMLTextBlockBodyContext( rLocalRef );
- else
- return new SvXMLImportContext( rLocalRef );
+ return nullptr;
}
SwXMLTextBlockTextContext::SwXMLTextBlockTextContext(
@@ -247,8 +245,7 @@ SwXMLTextBlockTextContext::createFastChildContext( sal_Int32 Element,
{
if ( Element == SwXMLTextBlockToken::TEXT_P )
return new SwXMLTextBlockParContext( rLocalRef );
- else
- return new SvXMLImportContext( rLocalRef );
+ return nullptr;
}
SwXMLTextBlockBodyContext::SwXMLTextBlockBodyContext(
@@ -266,8 +263,7 @@ SwXMLTextBlockBodyContext::createFastChildContext( sal_Int32 Element,
return new SwXMLTextBlockTextContext( rLocalRef );
else if( Element == SwXMLTextBlockToken::TEXT_P )
return new SwXMLTextBlockParContext( rLocalRef );
- else
- return new SvXMLImportContext( rLocalRef );
+ return nullptr;
}
SwXMLTextBlockParContext::SwXMLTextBlockParContext(
diff --git a/sw/source/filter/xml/xmlbrsh.cxx b/sw/source/filter/xml/xmlbrsh.cxx
index 47d1ba3d2bdd..8712409847d3 100644
--- a/sw/source/filter/xml/xmlbrsh.cxx
+++ b/sw/source/filter/xml/xmlbrsh.cxx
@@ -122,10 +122,6 @@ SvXMLImportContextRef SwXMLBrushItemImportContext::CreateChildContext(
pContext = new XMLBase64ImportContext(GetImport(), nPrefix, rLocalName, xAttrList, m_xBase64Stream);
}
}
- if (!pContext)
- {
- pContext = new SvXMLImportContext( GetImport(), nPrefix, rLocalName );
- }
return pContext;
}
diff --git a/sw/source/filter/xml/xmlimp.cxx b/sw/source/filter/xml/xmlimp.cxx
index 6b9a18327714..eb755dcd11db 100644
--- a/sw/source/filter/xml/xmlimp.cxx
+++ b/sw/source/filter/xml/xmlimp.cxx
@@ -220,7 +220,7 @@ SwXMLDocContext_Impl::SwXMLDocContext_Impl( SwXMLImport& rImport ) :
uno::Reference< xml::sax::XFastContextHandler > SAL_CALL SwXMLDocContext_Impl::createFastChildContext(
sal_Int32 /*nElement*/, const uno::Reference< xml::sax::XFastAttributeList >& /*xAttrList*/ )
{
- return new SvXMLImportContext( GetImport() );
+ return nullptr;
}
SvXMLImportContextRef SwXMLDocContext_Impl::CreateChildContext(
@@ -274,9 +274,6 @@ SvXMLImportContextRef SwXMLDocContext_Impl::CreateChildContext(
break;
}
- if( !pContext )
- pContext = new SvXMLImportContext( GetImport(), nPrefix, rLocalName );
-
return pContext;
}
@@ -412,8 +409,6 @@ SvXMLImportContext *SwXMLImport::CreateFastContext( sal_Int32 nElement,
pContext = new SwXMLOfficeDocContext_Impl( *this, xDocProps );
}
break;
- default:
- pContext = new SvXMLImportContext( *this );
}
return pContext;
}
diff --git a/sw/source/filter/xml/xmlitem.cxx b/sw/source/filter/xml/xmlitem.cxx
index 55736082e326..4d12335a1d44 100644
--- a/sw/source/filter/xml/xmlitem.cxx
+++ b/sw/source/filter/xml/xmlitem.cxx
@@ -54,21 +54,21 @@ SvXMLImportContextRef SvXMLItemSetContext::CreateChildContext( sal_uInt16 nPrefi
return CreateChildContext( nPrefix, rLocalName, xAttrList,
rItemSet, *pEntry, rUnitConv );
}
- return new SvXMLImportContext( GetImport(), nPrefix, rLocalName );
+ return nullptr;
}
/** This method is called from this instance implementation of
CreateChildContext if the element matches an entry in the
SvXMLImportItemMapper with the mid flag MID_SW_FLAG_ELEMENT
*/
-SvXMLImportContextRef SvXMLItemSetContext::CreateChildContext( sal_uInt16 nPrefix,
- const OUString& rLocalName,
+SvXMLImportContextRef SvXMLItemSetContext::CreateChildContext( sal_uInt16 /*nPrefix*/,
+ const OUString& /*rLocalName*/,
const uno::Reference< xml::sax::XAttributeList >& /*xAttrList*/,
SfxItemSet& /*rItemSet*/,
const SvXMLItemMapEntry& /*rEntry*/,
const SvXMLUnitConverter& /*rUnitConv*/ )
{
- return new SvXMLImportContext( GetImport(), nPrefix, rLocalName );
+ return nullptr;
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/filter/xml/xmlmeta.cxx b/sw/source/filter/xml/xmlmeta.cxx
index 5834ae020250..f9496ff96af9 100644
--- a/sw/source/filter/xml/xmlmeta.cxx
+++ b/sw/source/filter/xml/xmlmeta.cxx
@@ -60,9 +60,6 @@ SvXMLImportContext *SwXMLImport::CreateMetaContext(
pContext = new SvXMLMetaDocumentContext(*this, xDocProps);
}
- if( !pContext )
- pContext = new SvXMLImportContext( *this );
-
return pContext;
}
diff --git a/sw/source/filter/xml/xmlscript.cxx b/sw/source/filter/xml/xmlscript.cxx
index 57e46fd1a66a..aa54efa5dc5a 100644
--- a/sw/source/filter/xml/xmlscript.cxx
+++ b/sw/source/filter/xml/xmlscript.cxx
@@ -34,10 +34,6 @@ SvXMLImportContext *SwXMLImport::CreateScriptContext(
pContext = new XMLScriptContext( *this, rLocalName, GetModel() );
}
- if( !pContext )
- pContext = new SvXMLImportContext( *this, XML_NAMESPACE_OFFICE,
- rLocalName );
-
return pContext;
}
diff --git a/sw/source/filter/xml/xmltbli.cxx b/sw/source/filter/xml/xmltbli.cxx
index 1b882317804a..bc815b7a098d 100644
--- a/sw/source/filter/xml/xmltbli.cxx
+++ b/sw/source/filter/xml/xmltbli.cxx
@@ -647,9 +647,6 @@ SvXMLImportContextRef SwXMLTableCellContext_Impl::CreateChildContext(
}
}
- if( !pContext )
- pContext = new SvXMLImportContext( GetImport(), nPrefix, rLocalName );
-
return pContext;
}
@@ -846,9 +843,6 @@ SvXMLImportContextRef SwXMLTableColsContext_Impl::CreateChildContext(
rLocalName, xAttrList,
GetTable() );
- if( !pContext )
- pContext = new SvXMLImportContext( GetImport(), nPrefix, rLocalName );
-
return pContext;
}
@@ -966,9 +960,6 @@ SvXMLImportContextRef SwXMLTableRowContext_Impl::CreateChildContext(
rLocalName );
}
- if( !pContext )
- pContext = new SvXMLImportContext( GetImport(), nPrefix, rLocalName );
-
return pContext;
}
@@ -1024,9 +1015,6 @@ SvXMLImportContextRef SwXMLTableRowsContext_Impl::CreateChildContext(
GetTable(),
bHeader );
- if( !pContext )
- pContext = new SvXMLImportContext( GetImport(), nPrefix, rLocalName );
-
return pContext;
}
@@ -1462,9 +1450,6 @@ SvXMLImportContextRef SwXMLTableContext::CreateChildContext( sal_uInt16 nPrefix,
break;
}
- if( !pContext )
- pContext = new SvXMLImportContext( GetImport(), nPrefix, rLocalName );
-
return pContext;
}
diff --git a/sw/source/filter/xml/xmltext.cxx b/sw/source/filter/xml/xmltext.cxx
index 690c3cac4d8d..5514d9cc0efe 100644
--- a/sw/source/filter/xml/xmltext.cxx
+++ b/sw/source/filter/xml/xmltext.cxx
@@ -58,8 +58,6 @@ SvXMLImportContextRef SwXMLBodyContentContext_Impl::CreateChildContext(
SvXMLImportContext *pContext = GetSwImport().GetTextImport()->CreateTextChildContext(
GetImport(), nPrefix, rLocalName, xAttrList,
XMLTextType::Body );
- if( !pContext )
- pContext = new SvXMLImportContext( GetImport(), nPrefix, rLocalName );
return pContext;
}
@@ -77,9 +75,6 @@ SvXMLImportContext *SwXMLImport::CreateBodyContentContext(
if( !IsStylesOnlyMode() )
pContext = new SwXMLBodyContentContext_Impl( *this, rLocalName );
- else
- pContext = new SvXMLImportContext( *this, XML_NAMESPACE_OFFICE,
- rLocalName );
return pContext;
}
diff --git a/xmloff/source/chart/SchXMLAxisContext.cxx b/xmloff/source/chart/SchXMLAxisContext.cxx
index 766f2f5e81a3..962fec96e6df 100644
--- a/xmloff/source/chart/SchXMLAxisContext.cxx
+++ b/xmloff/source/chart/SchXMLAxisContext.cxx
@@ -697,12 +697,10 @@ SvXMLImportContextRef SchXMLAxisContext::CreateChildContext(
CreateGrid( sAutoStyleName, bIsMajor );
// don't create a context => use default context. grid elements are empty
- pContext = new SvXMLImportContext( GetImport(), p_nPrefix, rLocalName );
}
break;
default:
- pContext = new SvXMLImportContext( GetImport(), p_nPrefix, rLocalName );
break;
}
diff --git a/xmloff/source/chart/SchXMLChartContext.cxx b/xmloff/source/chart/SchXMLChartContext.cxx
index e5f677f3fa0e..f3bc2fa9e840 100644
--- a/xmloff/source/chart/SchXMLChartContext.cxx
+++ b/xmloff/source/chart/SchXMLChartContext.cxx
@@ -1121,9 +1121,6 @@ SvXMLImportContextRef SchXMLChartContext::CreateChildContext(
break;
}
- if( ! pContext )
- pContext = new SvXMLImportContext( GetImport(), nPrefix, rLocalName );
-
return pContext;
}
@@ -1238,8 +1235,6 @@ SvXMLImportContextRef SchXMLTitleContext::CreateChildContext(
{
pContext = new SchXMLParagraphContext( GetImport(), rLocalName, mrTitle );
}
- else
- pContext = new SvXMLImportContext( GetImport(), nPrefix, rLocalName );
return pContext;
}
diff --git a/xmloff/source/chart/SchXMLImport.cxx b/xmloff/source/chart/SchXMLImport.cxx
index d0cd1f99c33e..9f8a59e0fe52 100644
--- a/xmloff/source/chart/SchXMLImport.cxx
+++ b/xmloff/source/chart/SchXMLImport.cxx
@@ -86,7 +86,7 @@ SchXMLImportHelper::SchXMLImportHelper() :
SvXMLImportContext* SchXMLImportHelper::CreateChartContext(
SvXMLImport& rImport,
- sal_uInt16 nPrefix, const OUString& rLocalName,
+ sal_uInt16 /*nPrefix*/, const OUString& rLocalName,
const Reference< frame::XModel >& rChartModel,
const Reference< xml::sax::XAttributeList >& )
{
@@ -101,7 +101,6 @@ SvXMLImportContext* SchXMLImportHelper::CreateChartContext(
else
{
SAL_WARN("xmloff.chart", "No valid XChartDocument given as XModel" );
- pContext = new SvXMLImportContext( rImport, nPrefix, rLocalName );
}
return pContext;
@@ -553,8 +552,7 @@ SvXMLImportContext *SchXMLImport::CreateFastContext( sal_Int32 nElement,
}
}
break;
- default:
- pContext = new SvXMLImportContext( *this );
+ default: break;
}
return pContext;
}
diff --git a/xmloff/source/chart/SchXMLParagraphContext.cxx b/xmloff/source/chart/SchXMLParagraphContext.cxx
index 65fcee594d77..9161cfad0e24 100644
--- a/xmloff/source/chart/SchXMLParagraphContext.cxx
+++ b/xmloff/source/chart/SchXMLParagraphContext.cxx
@@ -99,7 +99,7 @@ SvXMLImportContextRef SchXMLParagraphContext::CreateChildContext(
}
}
- return new SvXMLImportContext( GetImport(), nPrefix, rLocalName );
+ return nullptr;
}
void SchXMLParagraphContext::Characters( const OUString& rChars )
diff --git a/xmloff/source/chart/SchXMLPlotAreaContext.cxx b/xmloff/source/chart/SchXMLPlotAreaContext.cxx
index f488244e142f..b83998b708cc 100644
--- a/xmloff/source/chart/SchXMLPlotAreaContext.cxx
+++ b/xmloff/source/chart/SchXMLPlotAreaContext.cxx
@@ -494,9 +494,6 @@ SvXMLImportContextRef SchXMLPlotAreaContext::CreateChildContext(
pContext = new SchXMLStockContext( mrImportHelper, GetImport(), nPrefix, rLocalName, mxDiagram,
SchXMLStockContext::CONTEXT_TYPE_RANGE );
break;
-
- default:
- pContext = new SvXMLImportContext( GetImport(), nPrefix, rLocalName );
}
return pContext;
diff --git a/xmloff/source/chart/SchXMLSeries2Context.cxx b/xmloff/source/chart/SchXMLSeries2Context.cxx
index 86c67f8834fa..a571430c28d0 100644
--- a/xmloff/source/chart/SchXMLSeries2Context.cxx
+++ b/xmloff/source/chart/SchXMLSeries2Context.cxx
@@ -696,9 +696,6 @@ SvXMLImportContextRef SchXMLSeries2Context::CreateChildContext(
GetImport(), rLocalName,
mrLSequencesPerIndex, m_xSeries );
break;
-
- default:
- pContext = new SvXMLImportContext( GetImport(), nPrefix, rLocalName );
}
return pContext;
diff --git a/xmloff/source/chart/SchXMLTableContext.cxx b/xmloff/source/chart/SchXMLTableContext.cxx
index ca52090960cc..69b738a66688 100644
--- a/xmloff/source/chart/SchXMLTableContext.cxx
+++ b/xmloff/source/chart/SchXMLTableContext.cxx
@@ -244,9 +244,6 @@ SvXMLImportContextRef SchXMLTableContext::CreateChildContext(
case XML_TOK_TABLE_ROW:
pContext = new SchXMLTableRowContext( mrImportHelper, GetImport(), rLocalName, mrTable );
break;
-
- default:
- pContext = new SvXMLImportContext( GetImport(), nPrefix, rLocalName );
}
return pContext;
@@ -413,8 +410,6 @@ SvXMLImportContextRef SchXMLTableColumnsContext::CreateChildContext(
{
pContext = new SchXMLTableColumnContext( GetImport(), rLocalName, mrTable );
}
- else
- pContext = new SvXMLImportContext( GetImport(), nPrefix, rLocalName );
return pContext;
}
@@ -507,10 +502,6 @@ SvXMLImportContextRef SchXMLTableRowsContext::CreateChildContext(
{
pContext = new SchXMLTableRowContext( mrImportHelper, GetImport(), rLocalName, mrTable );
}
- else
- {
- pContext = new SvXMLImportContext( GetImport(), nPrefix, rLocalName );
- }
return pContext;
}
@@ -553,7 +544,7 @@ SvXMLImportContextRef SchXMLTableRowContext::CreateChildContext(
}
else
{
- pContext = new SvXMLImportContext( GetImport(), nPrefix, rLocalName );
+ assert(false);
}
return pContext;
@@ -683,10 +674,6 @@ SvXMLImportContextRef SchXMLTableCellContext::CreateChildContext(
//so we need to find an alternative to save that range info for copy/paste scenario ... -> use description at an empty group element for now
pContext = new SchXMLRangeSomewhereContext( GetImport(), nPrefix, rLocalName, maRangeId );
}
- else
- {
- pContext = new SvXMLImportContext( GetImport(), nPrefix, rLocalName );
- }
return pContext;
}
@@ -1076,7 +1063,7 @@ SvXMLImportContextRef SchXMLRangeSomewhereContext::CreateChildContext(
return new XMLStringBufferImportContext(
GetImport(), nPrefix, rLocalName, maRangeStringBuffer );
}
- return new SvXMLImportContext( GetImport(), nPrefix, rLocalName );
+ return nullptr;
}
void SchXMLRangeSomewhereContext::EndElement()
diff --git a/xmloff/source/chart/SchXMLTextListContext.cxx b/xmloff/source/chart/SchXMLTextListContext.cxx
index 7f65edb2cd30..a494c79a0cb3 100644
--- a/xmloff/source/chart/SchXMLTextListContext.cxx
+++ b/xmloff/source/chart/SchXMLTextListContext.cxx
@@ -74,8 +74,6 @@ SvXMLImportContextRef SchXMLListItemContext::CreateChildContext(
if( (nPrefix == XML_NAMESPACE_TEXT ||
nPrefix == XML_NAMESPACE_LO_EXT) && IsXMLToken( rLocalName, XML_P ) )
pContext = new SchXMLParagraphContext( GetImport(), rLocalName, m_rText );
- else
- pContext = new SvXMLImportContext( GetImport(), nPrefix, rLocalName );
return pContext;
}
@@ -115,8 +113,6 @@ SvXMLImportContextRef SchXMLTextListContext::CreateChildContext(
m_aTextVector.emplace_back( );
pContext = new SchXMLListItemContext( GetImport(), rLocalName, m_aTextVector.back() );
}
- else
- pContext = new SvXMLImportContext( GetImport(), nPrefix, rLocalName );
return pContext;
}
diff --git a/xmloff/source/chart/XMLLabelSeparatorContext.cxx b/xmloff/source/chart/XMLLabelSeparatorContext.cxx
index 2ef83157e82d..dec08c2ad3da 100644
--- a/xmloff/source/chart/XMLLabelSeparatorContext.cxx
+++ b/xmloff/source/chart/XMLLabelSeparatorContext.cxx
@@ -45,7 +45,7 @@ void XMLLabelSeparatorContext::StartElement( const uno::Reference< xml::sax::XAt
}
SvXMLImportContextRef XMLLabelSeparatorContext::CreateChildContext(
- sal_uInt16 nPrefix, const OUString& rLocalName,
+ sal_uInt16 /*nPrefix*/, const OUString& rLocalName,
const uno::Reference< xml::sax::XAttributeList > & /*xAttrList*/ )
{
SvXMLImportContext* pContext = nullptr;
@@ -54,8 +54,6 @@ SvXMLImportContextRef XMLLabelSeparatorContext::CreateChildContext(
pContext = new SchXMLParagraphContext( GetImport(),
rLocalName, m_aSeparator );
}
- if( !pContext )
- pContext = new SvXMLImportContext( GetImport(), nPrefix, rLocalName );
return pContext;
}
diff --git a/xmloff/source/chart/XMLSymbolImageContext.cxx b/xmloff/source/chart/XMLSymbolImageContext.cxx
index 36fd0eafa6e9..be661375cff0 100644
--- a/xmloff/source/chart/XMLSymbolImageContext.cxx
+++ b/xmloff/source/chart/XMLSymbolImageContext.cxx
@@ -109,10 +109,6 @@ SvXMLImportContextRef XMLSymbolImageContext::CreateChildContext(
mxBase64Stream );
}
}
- if( ! pContext )
- {
- pContext = new SvXMLImportContext( GetImport(), nPrefix, rLocalName );
- }
return pContext;
}
diff --git a/xmloff/source/chart/contexts.cxx b/xmloff/source/chart/contexts.cxx
index 62bebf34ded9..9f4a178590cf 100644
--- a/xmloff/source/chart/contexts.cxx
+++ b/xmloff/source/chart/contexts.cxx
@@ -142,7 +142,7 @@ SvXMLImportContextRef SchXMLDocContext::CreateChildContext(
uno::Reference< xml::sax::XFastContextHandler > SAL_CALL SchXMLDocContext::createFastChildContext(
sal_Int32 /*nElement*/, const uno::Reference< xml::sax::XFastAttributeList >& /*xAttrList*/ )
{
- return new SvXMLImportContext( GetImport() );
+ return nullptr;
}
SchXMLFlatDocContext_Impl::SchXMLFlatDocContext_Impl(
diff --git a/xmloff/source/core/DocumentSettingsContext.cxx b/xmloff/source/core/DocumentSettingsContext.cxx
index 13bb5e1214db..249f1c554d0d 100644
--- a/xmloff/source/core/DocumentSettingsContext.cxx
+++ b/xmloff/source/core/DocumentSettingsContext.cxx
@@ -248,9 +248,6 @@ static SvXMLImportContext *CreateSettingsContext(SvXMLImport& rImport, sal_uInt1
pContext = new XMLConfigItemMapIndexedContext(rImport, p_nPrefix, rLocalName, xAttrList, rProp.Value, rProp.Name, pBaseContext);
}
- if( !pContext )
- pContext = new SvXMLImportContext( rImport, p_nPrefix, rLocalName );
-
return pContext;
}
@@ -343,9 +340,6 @@ SvXMLImportContextRef XMLDocumentSettingsContext::CreateChildContext( sal_uInt16
}
}
- if( !pContext )
- pContext = new SvXMLImportContext( GetImport(), p_nPrefix, rLocalName );
-
return pContext;
}
diff --git a/xmloff/source/core/XMLEmbeddedObjectImportContext.cxx b/xmloff/source/core/XMLEmbeddedObjectImportContext.cxx
index 57403644aea4..abb6601cb9cb 100644
--- a/xmloff/source/core/XMLEmbeddedObjectImportContext.cxx
+++ b/xmloff/source/core/XMLEmbeddedObjectImportContext.cxx
@@ -234,8 +234,7 @@ SvXMLImportContextRef XMLEmbeddedObjectImportContext::CreateChildContext(
return new XMLEmbeddedObjectImportContext_Impl( GetImport(),
nPrefix, rLocalName,
xHandler );
- else
- return new SvXMLImportContext( GetImport(), nPrefix, rLocalName );
+ return nullptr;
}
void XMLEmbeddedObjectImportContext::StartElement(
diff --git a/xmloff/source/core/xmlictxt.cxx b/xmloff/source/core/xmlictxt.cxx
index b05a76b39969..d3647f1faa44 100644
--- a/xmloff/source/core/xmlictxt.cxx
+++ b/xmloff/source/core/xmlictxt.cxx
@@ -49,11 +49,11 @@ SvXMLImportContext::~SvXMLImportContext()
{
}
-SvXMLImportContextRef SvXMLImportContext::CreateChildContext( sal_uInt16 nPrefix,
- const OUString& rLocalName,
+SvXMLImportContextRef SvXMLImportContext::CreateChildContext( sal_uInt16 /*nPrefix*/,
+ const OUString& /*rLocalName*/,
const uno::Reference<xml::sax::XAttributeList>& )
{
- return new SvXMLImportContext(mrImport, nPrefix, rLocalName);
+ return nullptr;
}
void SvXMLImportContext::StartElement( const uno::Reference< xml::sax::XAttributeList >& )
@@ -134,8 +134,7 @@ uno::Reference< xml::sax::XFastContextHandler > SAL_CALL SvXMLImportContext::cre
// Call CreateFastContext only if it's the first element of the document
if ( mrImport.maFastContexts.empty() )
return mrImport.CreateFastContext( Element, Attribs );
- else
- return new SvXMLImportContext( GetImport() );
+ return nullptr;
}
uno::Reference< xml::sax::XFastContextHandler > SAL_CALL SvXMLImportContext::createUnknownChildContext
diff --git a/xmloff/source/core/xmlimp.cxx b/xmloff/source/core/xmlimp.cxx
index 578bef43a82c..65016341d2de 100644
--- a/xmloff/source/core/xmlimp.cxx
+++ b/xmloff/source/core/xmlimp.cxx
@@ -327,12 +327,14 @@ SvXMLImportContext *SvXMLImport::CreateDocumentContext(sal_uInt16 const nPrefix,
const OUString& rLocalName,
const uno::Reference< xml::sax::XAttributeList >& )
{
+ SAL_WARN( "xmloff.core", "CreateDocumentContext should be overridden, for element " << rLocalName);
return new SvXMLImportContext( *this, nPrefix, rLocalName );
}
-SvXMLImportContext *SvXMLImport::CreateFastContext( sal_Int32 /*Element*/,
+SvXMLImportContext *SvXMLImport::CreateFastContext( sal_Int32 nElement,
const uno::Reference< xml::sax::XFastAttributeList >& /*xAttrList*/ )
{
+ SAL_WARN( "xmloff.core", "CreateFastContext should be overridden, for element " << nElement);
return new SvXMLImportContext( *this );
}
@@ -746,7 +748,7 @@ void SAL_CALL SvXMLImport::startElement( const OUString& rName,
}
}
- SAL_WARN_IF( !xContext.is(), "xmloff.core", "SvXMLImport::startElement: missing context" );
+ SAL_WARN_IF( !xContext.is(), "xmloff.core", "SvXMLImport::startElement: missing context for element " << aLocalName );
if( !xContext.is() )
xContext.set(new SvXMLImportContext( *this, nPrefix, aLocalName ));
@@ -875,6 +877,7 @@ void SAL_CALL SvXMLImport::startFastElement (sal_Int32 Element,
else
xContext.set( CreateFastContext( Element, Attribs ) );
+ SAL_WARN_IF(!xContext.is(), "xmloff.core", "No fast context for element " << getNameFromToken(Element));
if ( !xContext.is() )
xContext.set( new SvXMLImportContext( *this ) );
@@ -916,6 +919,7 @@ void SAL_CALL SvXMLImport::startUnknownElement (const OUString & rPrefix, const
else
xContext.set( CreateFastContext( -1, Attribs ) );
+ SAL_WARN_IF(!xContext.is(), "xmloff.core", "No context for unknown-element " << rLocalName);
if ( !xContext.is() )
xContext.set( new SvXMLImportContext( *this ) );
diff --git a/xmloff/source/draw/XMLReplacementImageContext.cxx b/xmloff/source/draw/XMLReplacementImageContext.cxx
index 32ad125c9514..1f9f077fbddf 100644
--- a/xmloff/source/draw/XMLReplacementImageContext.cxx
+++ b/xmloff/source/draw/XMLReplacementImageContext.cxx
@@ -118,9 +118,6 @@ SvXMLImportContextRef XMLReplacementImageContext::CreateChildContext(
m_xBase64Stream );
}
- if( !pContext )
- pContext = new SvXMLImportContext( GetImport(), nPrefix, rLocalName );
-
return pContext;
}
diff --git a/xmloff/source/draw/animationimport.cxx b/xmloff/source/draw/animationimport.cxx
index 5da1b3466321..fea0eac29ece 100644
--- a/xmloff/source/draw/animationimport.cxx
+++ b/xmloff/source/draw/animationimport.cxx
@@ -1201,8 +1201,7 @@ SvXMLImportContextRef AnimationNodeContext::CreateChildContext( sal_uInt16 nPref
{
if( mxNode.is())
return new AnimationNodeContext( mxNode, GetImport(), nPrefix, rLocalName, xAttrList, mpHelper );
- else
- return new SvXMLImportContext( GetImport(), nPrefix, rLocalName );
+ return nullptr;
}
namespace {
diff --git a/xmloff/source/draw/layerimp.cxx b/xmloff/source/draw/layerimp.cxx
index c0826cbec25b..50c6d39061d7 100644
--- a/xmloff/source/draw/layerimp.cxx
+++ b/xmloff/source/draw/layerimp.cxx
@@ -106,10 +106,7 @@ SvXMLImportContextRef SdXMLLayerContext::CreateChildContext( sal_uInt16 nPrefix,
{
return new XMLStringBufferImportContext( GetImport(), nPrefix, rLocalName, sDescriptionBuffer);
}
- else
- {
- return new SvXMLImportContext( GetImport(), nPrefix, rLocalName );
- }
+ return nullptr;
}
void SdXMLLayerContext::EndElement()
diff --git a/xmloff/source/draw/sdxmlimp.cxx b/xmloff/source/draw/sdxmlimp.cxx
index 3a7d52b880ab..dfa68e100629 100644
--- a/xmloff/source/draw/sdxmlimp.cxx
+++ b/xmloff/source/draw/sdxmlimp.cxx
@@ -203,7 +203,7 @@ SvXMLImportContextRef SdXMLDocContext_Impl::CreateChildContext(
uno::Reference< xml::sax::XFastContextHandler > SAL_CALL SdXMLDocContext_Impl::createFastChildContext(
sal_Int32 /*nElement*/, const uno::Reference< xml::sax::XFastAttributeList >& /*xAttrList*/ )
{
- return new SvXMLImportContext( GetImport() );
+ return nullptr;
}
namespace {
@@ -706,11 +706,6 @@ SvXMLImportContext *SdXMLImport::CreateMetaContext(const sal_Int32 /*nElement*/,
pContext = new SvXMLMetaDocumentContext(*this, xDocProps);
}
- if(!pContext)
- {
- pContext = new SvXMLImportContext(*this);
- }
-
return pContext;
}
diff --git a/xmloff/source/draw/ximpshow.cxx b/xmloff/source/draw/ximpshow.cxx
index 4b33fa22bc56..42d3589d17b1 100644
--- a/xmloff/source/draw/ximpshow.cxx
+++ b/xmloff/source/draw/ximpshow.cxx
@@ -250,7 +250,7 @@ SvXMLImportContextRef SdXMLShowsContext::CreateChildContext( sal_uInt16 p_nPrefi
}
}
- return new SvXMLImportContext( GetImport(), p_nPrefix, rLocalName );
+ return nullptr;
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/xmloff/source/forms/layerimport.cxx b/xmloff/source/forms/layerimport.cxx
index 7bf0ed4177b1..9d6909c6bc54 100644
--- a/xmloff/source/forms/layerimport.cxx
+++ b/xmloff/source/forms/layerimport.cxx
@@ -461,13 +461,6 @@ SvXMLImportContext* OFormLayerXMLImport_Impl::createContext(const sal_uInt16 _nP
pContext = createXFormsModelContext( m_rImporter, _nPrefix, _rLocalName );
}
- if ( !pContext )
- {
- OSL_FAIL( "unknown element" );
- pContext =
- new SvXMLImportContext(m_rImporter, _nPrefix, _rLocalName);
- }
-
return pContext;
}
diff --git a/xmloff/source/forms/propertyimport.cxx b/xmloff/source/forms/propertyimport.cxx
index d14f0afefa81..0f296930aee8 100644
--- a/xmloff/source/forms/propertyimport.cxx
+++ b/xmloff/source/forms/propertyimport.cxx
@@ -363,13 +363,7 @@ SvXMLImportContextRef OPropertyElementsContext::CreateChildContext(sal_uInt16 _n
{
return new OListPropertyContext( GetImport(), _nPrefix, _rLocalName, m_xPropertyImporter );
}
- else
- {
- OSL_FAIL(OStringBuffer("OPropertyElementsContext::CreateChildContext: unknown child element (\"").
- append(OUStringToOString(_rLocalName, RTL_TEXTENCODING_ASCII_US)).
- append("\")!").getStr());
- return new SvXMLImportContext(GetImport(), _nPrefix, _rLocalName);
- }
+ return nullptr;
}
#if OSL_DEBUG_LEVEL > 0
@@ -395,13 +389,10 @@ OSinglePropertyContext::OSinglePropertyContext(SvXMLImport& _rImport, sal_uInt16
{
}
-SvXMLImportContextRef OSinglePropertyContext::CreateChildContext(sal_uInt16 _nPrefix, const OUString& _rLocalName,
+SvXMLImportContextRef OSinglePropertyContext::CreateChildContext(sal_uInt16 /*_nPrefix*/, const OUString& /*_rLocalName*/,
const Reference< XAttributeList >&)
{
- OSL_FAIL(OStringBuffer("OSinglePropertyContext::CreateChildContext: unknown child element (\"").
- append(OUStringToOString(_rLocalName, RTL_TEXTENCODING_ASCII_US)).
- append("\")!").getStr());
- return new SvXMLImportContext(GetImport(), _nPrefix, _rLocalName);
+ return nullptr;
}
void OSinglePropertyContext::StartElement(const Reference< XAttributeList >& _rxAttrList)
@@ -531,12 +522,7 @@ SvXMLImportContextRef OListPropertyContext::CreateChildContext( sal_uInt16 _nPre
m_aListValues.emplace_back();
return new OListValueContext( GetImport(), _nPrefix, _rLocalName, *m_aListValues.rbegin() );
}
- else
- {
- SAL_WARN( "xmloff", "OListPropertyContext::CreateChildContext: unknown child element (\""
- << _rLocalName << "\")!" );
- return new SvXMLImportContext( GetImport(), _nPrefix, _rLocalName );
- }
+ return nullptr;
}
//= OListValueContext
diff --git a/xmloff/source/meta/xmlmetai.cxx b/xmloff/source/meta/xmlmetai.cxx
index 533cc761d55c..a24a6f8c31b9 100644
--- a/xmloff/source/meta/xmlmetai.cxx
+++ b/xmloff/source/meta/xmlmetai.cxx
@@ -218,8 +218,7 @@ uno::Reference< xml::sax::XFastContextHandler > SAL_CALL SvXMLMetaDocumentContex
if ( nElement == ( NAMESPACE_TOKEN( XML_NAMESPACE_OFFICE ) | XML_META ) )
return new XMLDocumentBuilderContext(
GetImport(), nElement, xAttrList, mxDocBuilder);
- else
- return new SvXMLImportContext( GetImport() );
+ return nullptr;
}
void SvXMLMetaDocumentContext::setBuildId(OUString const& i_rBuildId, const uno::Reference<beans::XPropertySet>& xImportInfo )
diff --git a/xmloff/source/meta/xmlversion.cxx b/xmloff/source/meta/xmlversion.cxx
index fc7bbe824f95..dba5e8d4f4cd 100644
--- a/xmloff/source/meta/xmlversion.cxx
+++ b/xmloff/source/meta/xmlversion.cxx
@@ -147,10 +147,6 @@ XMLVersionListContext::createFastChildContext(sal_Int32 nElement,
{
pContext = new XMLVersionContext( GetImport(), xAttrList );
}
- else
- {
- pContext = new SvXMLImportContext( GetImport() );
- }
return pContext;
}
diff --git a/xmloff/source/script/xmlbasici.cxx b/xmloff/source/script/xmlbasici.cxx
index da38c060b7a3..0a69889f7218 100644
--- a/xmloff/source/script/xmlbasici.cxx
+++ b/xmloff/source/script/xmlbasici.cxx
@@ -53,9 +53,6 @@ SvXMLImportContextRef XMLBasicImportContext::CreateChildContext(
pContext = new XMLBasicImportChildContext( GetImport(), nPrefix, rLocalName,
Reference<xml::sax::XDocumentHandler>(m_xHandler, UNO_QUERY_THROW) );
- if ( !pContext )
- pContext = new SvXMLImportContext( GetImport(), nPrefix, rLocalName );
-
return pContext;
}
diff --git a/xmloff/source/style/FillStyleContext.cxx b/xmloff/source/style/FillStyleContext.cxx
index 1cb513ce6b50..bc81cd92d5da 100644
--- a/xmloff/source/style/FillStyleContext.cxx
+++ b/xmloff/source/style/FillStyleContext.cxx
@@ -148,10 +148,6 @@ SvXMLImportContextRef XMLBitmapStyleContext::CreateChildContext( sal_uInt16 nPre
mxBase64Stream );
}
}
- if( !pContext )
- {
- pContext = new SvXMLImportContext( GetImport(), nPrefix, rLocalName );
- }
return pContext;
}
diff --git a/xmloff/source/style/PageHeaderFooterContext.cxx b/xmloff/source/style/PageHeaderFooterContext.cxx
index b4c95261e0ad..fe9689ae3f5f 100644
--- a/xmloff/source/style/PageHeaderFooterContext.cxx
+++ b/xmloff/source/style/PageHeaderFooterContext.cxx
@@ -67,9 +67,6 @@ SvXMLImportContextRef PageHeaderFooterContext::CreateChildContext( sal_uInt16 nP
rMap, nStartIndex, nEndIndex, aType);
}
- if (!xContext)
- xContext = new SvXMLImportContext( GetImport(), nPrefix, rLName );
-
return xContext;
}
diff --git a/xmloff/source/style/XMLBackgroundImageContext.cxx b/xmloff/source/style/XMLBackgroundImageContext.cxx
index b9ccb73c9c1a..a2c48e00a5b8 100644
--- a/xmloff/source/style/XMLBackgroundImageContext.cxx
+++ b/xmloff/source/style/XMLBackgroundImageContext.cxx
@@ -365,10 +365,6 @@ SvXMLImportContextRef XMLBackgroundImageContext::CreateChildContext(
m_xBase64Stream );
}
}
- if( !pContext )
- {
- pContext = new SvXMLImportContext( GetImport(), nPrefix, rLocalName );
- }
return pContext;
}
diff --git a/xmloff/source/style/xmlnumfi.cxx b/xmloff/source/style/xmlnumfi.cxx
index d014b658750a..d74353bcf314 100644
--- a/xmloff/source/style/xmlnumfi.cxx
+++ b/xmloff/source/style/xmlnumfi.cxx
@@ -604,11 +604,11 @@ SvXMLNumFmtMapContext::SvXMLNumFmtMapContext( SvXMLImport& rImport,
}
SvXMLImportContextRef SvXMLNumFmtMapContext::CreateChildContext(
- sal_uInt16 nPrfx, const OUString& rLName,
+ sal_uInt16 /*nPrfx*/, const OUString& /*rLName*/,
const uno::Reference<xml::sax::XAttributeList>& )
{
// no elements supported - use default context
- return new SvXMLImportContext( GetImport(), nPrfx, rLName );
+ return nullptr;
}
void SvXMLNumFmtMapContext::Characters( const OUString& )
@@ -1055,8 +1055,7 @@ SvXMLImportContextRef SvXMLNumFmtElementContext::CreateChildContext(
{
return new SvXMLNumFmtEmbeddedTextContext( GetImport(), nPrfx, rLName, *this, xAttrList );
}
- else
- return new SvXMLImportContext( GetImport(), nPrfx, rLName );
+ return nullptr;
}
void SvXMLNumFmtElementContext::Characters( const OUString& rChars )
@@ -1551,8 +1550,6 @@ SvXMLImportContextRef SvXMLNumFormatContext::CreateChildContext(
break;
}
- if( !pContext )
- pContext = new SvXMLImportContext( GetImport(), nPrfx, rLName );
return pContext;
}
diff --git a/xmloff/source/style/xmlnumi.cxx b/xmloff/source/style/xmlnumi.cxx
index 1ea6831d07b8..c1cea0e9cf0c 100644
--- a/xmloff/source/style/xmlnumi.cxx
+++ b/xmloff/source/style/xmlnumi.cxx
@@ -390,10 +390,6 @@ SvXMLImportContextRef SvxXMLListLevelStyleContext_Impl::CreateChildContext(
xBase64Stream );
}
}
- if( !pContext )
- {
- pContext = new SvXMLImportContext( GetImport(), nPrefix, rLocalName );
- }
return pContext;
}
@@ -912,10 +908,6 @@ SvXMLImportContextRef SvxXMLListLevelStyleAttrContext_Impl::CreateChildContext(
xAttrList,
rListLevel );
}
- if( !pContext )
- {
- pContext = new SvXMLImportContext( GetImport(), nPrefix, rLocalName );
- }
return pContext;
}
@@ -1070,10 +1062,6 @@ SvXMLImportContextRef SvxXMLListStyleContext::CreateChildContext(
xContext = xLevelStyle.get();
}
- else
- {
- xContext = new SvXMLImportContext( GetImport(), nPrefix, rLocalName );
- }
return xContext;
}
diff --git a/xmloff/source/style/xmlprcon.cxx b/xmloff/source/style/xmlprcon.cxx
index 0ff6b531c697..813dcb3b3dcd 100644
--- a/xmloff/source/style/xmlprcon.cxx
+++ b/xmloff/source/style/xmlprcon.cxx
@@ -70,10 +70,7 @@ SvXMLImportContextRef SvXMLPropertySetContext::CreateChildContext(
return CreateChildContext( nPrefix, rLocalName, xAttrList,
mrProperties, aProp );
}
- else
- {
- return new SvXMLImportContext( GetImport(), nPrefix, rLocalName );
- }
+ return nullptr;
}
/** This method is called from this instance implementation of
@@ -81,13 +78,13 @@ SvXMLImportContextRef SvXMLPropertySetContext::CreateChildContext(
SvXMLImportItemMapper with the mid flag MID_FLAG_ELEMENT
*/
SvXMLImportContextRef SvXMLPropertySetContext::CreateChildContext(
- sal_uInt16 nPrefix,
- const OUString& rLocalName,
+ sal_uInt16 /*nPrefix*/,
+ const OUString& /*rLocalName*/,
const uno::Reference< xml::sax::XAttributeList >&,
::std::vector< XMLPropertyState > &,
const XMLPropertyState& )
{
- return new SvXMLImportContext( GetImport(), nPrefix, rLocalName );
+ return nullptr;
}
diff --git a/xmloff/source/style/xmlstyle.cxx b/xmloff/source/style/xmlstyle.cxx
index 8d32d38396f2..352eba7cee7f 100644
--- a/xmloff/source/style/xmlstyle.cxx
+++ b/xmloff/source/style/xmlstyle.cxx
@@ -772,11 +772,6 @@ SvXMLImportContextRef SvXMLStylesContext::CreateChildContext( sal_uInt16 nPrefix
mpImpl->AddStyle( pStyle );
pContext = pStyle;
}
- else
- {
- pContext = new SvXMLImportContext( GetImport(), nPrefix,
- rLocalName );
- }
return pContext;
}
diff --git a/xmloff/source/style/xmltabi.cxx b/xmloff/source/style/xmltabi.cxx
index 1ad85eb3cfb3..27880a177e91 100644
--- a/xmloff/source/style/xmltabi.cxx
+++ b/xmloff/source/style/xmltabi.cxx
@@ -181,10 +181,6 @@ SvXMLImportContextRef SvxXMLTabStopImportContext::CreateChildContext(
pContext = xTabStopContext.get();
}
- else
- {
- pContext = new SvXMLImportContext( GetImport(), nPrefix, rLocalName );
- }
return pContext;
}
diff --git a/xmloff/source/text/XMLAutoTextContainerEventImport.cxx b/xmloff/source/text/XMLAutoTextContainerEventImport.cxx
index 70729096ad03..39164f5960b7 100644
--- a/xmloff/source/text/XMLAutoTextContainerEventImport.cxx
+++ b/xmloff/source/text/XMLAutoTextContainerEventImport.cxx
@@ -61,8 +61,7 @@ SvXMLImportContextRef XMLAutoTextContainerEventImport::CreateChildContext(
return new XMLEventsImportContext(GetImport(), nPrefix, rLocalName,
rEvents);
}
- else
- return new SvXMLImportContext(GetImport(), nPrefix, rLocalName);
+ return nullptr;
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/xmloff/source/text/XMLFootnoteBodyImportContext.cxx b/xmloff/source/text/XMLFootnoteBodyImportContext.cxx
index 0eeb831eb81a..dc560f624c10 100644
--- a/xmloff/source/text/XMLFootnoteBodyImportContext.cxx
+++ b/xmloff/source/text/XMLFootnoteBodyImportContext.cxx
@@ -48,8 +48,6 @@ SvXMLImportContextRef XMLFootnoteBodyImportContext::CreateChildContext(
rLocalName,
xAttrList,
XMLTextType::Footnote);
- if( !pContext )
- pContext = new SvXMLImportContext( GetImport(), nPrefix, rLocalName );
return pContext;
}
diff --git a/xmloff/source/text/XMLFootnoteImportContext.cxx b/xmloff/source/text/XMLFootnoteImportContext.cxx
index 4361417f28f6..b77b740528b6 100644
--- a/xmloff/source/text/XMLFootnoteImportContext.cxx
+++ b/xmloff/source/text/XMLFootnoteImportContext.cxx
@@ -201,8 +201,6 @@ SvXMLImportContextRef XMLFootnoteImportContext::CreateChildContext(
}
// ignore content: return default context
- xContext = new SvXMLImportContext(GetImport(),
- p_nPrefix, rLocalName);
break;
}
diff --git a/xmloff/source/text/XMLIndexBodyContext.cxx b/xmloff/source/text/XMLIndexBodyContext.cxx
index b739093b595d..25c01a7db135 100644
--- a/xmloff/source/text/XMLIndexBodyContext.cxx
+++ b/xmloff/source/text/XMLIndexBodyContext.cxx
@@ -48,11 +48,7 @@ SvXMLImportContextRef XMLIndexBodyContext::CreateChildContext(
// return text content (if possible)
SvXMLImportContext* pContext = GetImport().GetTextImport()->CreateTextChildContext(
GetImport(), nPrefix, rLocalName, xAttrList, XMLTextType::Section );
- if (nullptr == pContext)
- {
- pContext = new SvXMLImportContext( GetImport(), nPrefix, rLocalName );
- }
- else
+ if (pContext)
bHasContent = true;
return pContext;
diff --git a/xmloff/source/text/XMLSectionImportContext.cxx b/xmloff/source/text/XMLSectionImportContext.cxx
index d34bd224f248..9f0b0eb50e80 100644
--- a/xmloff/source/text/XMLSectionImportContext.cxx
+++ b/xmloff/source/text/XMLSectionImportContext.cxx
@@ -358,12 +358,7 @@ SvXMLImportContextRef XMLSectionImportContext::CreateChildContext(
XMLTextType::Section );
// if that fails, default context
- if (nullptr == pContext)
- {
- pContext = new SvXMLImportContext( GetImport(),
- nPrefix, rLocalName );
- }
- else
+ if (pContext)
bHasContent = true;
}
diff --git a/xmloff/source/text/XMLTextColumnsContext.cxx b/xmloff/source/text/XMLTextColumnsContext.cxx
index b8f3d55e4884..622e1f38957d 100644
--- a/xmloff/source/text/XMLTextColumnsContext.cxx
+++ b/xmloff/source/text/XMLTextColumnsContext.cxx
@@ -320,10 +320,6 @@ SvXMLImportContextRef XMLTextColumnsContext::CreateChildContext(
pContext = mxColumnSep.get();
}
- else
- {
- pContext = new SvXMLImportContext( GetImport(), nPrefix, rLocalName );
- }
return pContext;
}
diff --git a/xmloff/source/text/XMLTextFrameContext.cxx b/xmloff/source/text/XMLTextFrameContext.cxx
index c7e98d6791fc..d9819994e790 100644
--- a/xmloff/source/text/XMLTextFrameContext.cxx
+++ b/xmloff/source/text/XMLTextFrameContext.cxx
@@ -1203,8 +1203,6 @@ SvXMLImportContextRef XMLTextFrameContext_Impl::CreateChildContext(
GetImport(), nPrefix, rLocalName, xAttrList,
XMLTextType::TextBox );
- if( !pContext )
- pContext = new SvXMLImportContext( GetImport(), nPrefix, rLocalName );
return pContext;
}
@@ -1696,9 +1694,6 @@ SvXMLImportContextRef XMLTextFrameContext::CreateChildContext(
m_xImplContext.get(), p_nPrefix, rLocalName, xAttrList );
}
- if (!xContext)
- xContext = new SvXMLImportContext( GetImport(), p_nPrefix, rLocalName );
-
return xContext;
}
diff --git a/xmloff/source/text/XMLTextFrameHyperlinkContext.cxx b/xmloff/source/text/XMLTextFrameHyperlinkContext.cxx
index bd4bdd52be7a..e92d4656f47a 100644
--- a/xmloff/source/text/XMLTextFrameHyperlinkContext.cxx
+++ b/xmloff/source/text/XMLTextFrameHyperlinkContext.cxx
@@ -123,8 +123,6 @@ SvXMLImportContextRef XMLTextFrameHyperlinkContext::CreateChildContext(
pContext = pTextFrameContext;
xFrameContext = pContext;
}
- else
- pContext = new SvXMLImportContext( GetImport(), nPrefix, rLocalName );
return pContext;
}
diff --git a/xmloff/source/text/XMLTextHeaderFooterContext.cxx b/xmloff/source/text/XMLTextHeaderFooterContext.cxx
index afc499d85a35..50414bd78b65 100644
--- a/xmloff/source/text/XMLTextHeaderFooterContext.cxx
+++ b/xmloff/source/text/XMLTextHeaderFooterContext.cxx
@@ -172,8 +172,6 @@ SvXMLImportContextRef XMLTextHeaderFooterContext::CreateChildContext(
GetImport(), nPrefix, rLocalName, xAttrList,
XMLTextType::HeaderFooter );
}
- if( !pContext )
- pContext = new SvXMLImportContext( GetImport(), nPrefix, rLocalName );
return pContext;
}
diff --git a/xmloff/source/text/XMLTextListBlockContext.cxx b/xmloff/source/text/XMLTextListBlockContext.cxx
index 62b6c250949e..0ed4fb91d1be 100644
--- a/xmloff/source/text/XMLTextListBlockContext.cxx
+++ b/xmloff/source/text/XMLTextListBlockContext.cxx
@@ -271,8 +271,6 @@ SvXMLImportContextRef XMLTextListBlockContext::CreateChildContext(
break;
}
- if( !pContext )
- pContext = new SvXMLImportContext( GetImport(), nPrefix, rLocalName );
return pContext;
}
diff --git a/xmloff/source/text/XMLTextListItemContext.cxx b/xmloff/source/text/XMLTextListItemContext.cxx
index 7964d37aa310..a6050686e652 100644
--- a/xmloff/source/text/XMLTextListItemContext.cxx
+++ b/xmloff/source/text/XMLTextListItemContext.cxx
@@ -161,9 +161,6 @@ SvXMLImportContextRef XMLTextListItemContext::CreateChildContext(
break;
}
- if( !pContext )
- pContext = new SvXMLImportContext( GetImport(), nPrefix, rLocalName );
-
return pContext;
}
diff --git a/xmloff/source/text/txtparai.cxx b/xmloff/source/text/txtparai.cxx
index e44771a224a9..e836017f9396 100644
--- a/xmloff/source/text/txtparai.cxx
+++ b/xmloff/source/text/txtparai.cxx
@@ -696,9 +696,6 @@ SvXMLImportContextRef XMLImpRubyContext_Impl::CreateChildContext(
rLocalName,
xAttrList,
*this );
- else
- xContext = new SvXMLImportContext(
- GetImport(), nPrefix, rLocalName );
}
else
xContext = SvXMLImportContext::CreateChildContext( nPrefix, rLocalName,
@@ -1770,12 +1767,6 @@ SvXMLImportContextRef XMLImpSpanContext_Impl::CreateChildContext(
rHints.push_back(
std::make_unique<XMLDrawHint_Impl>(pShapeContext, xAnchorPos));
}
- if( !pContext )
- {
- // ignore unknown content
- pContext =
- new SvXMLImportContext( rImport, nPrefix, rLocalName );
- }
// Behind fields, shapes and any unknown content blanks aren't ignored
rIgnoreLeadingSpace = false;
}
diff --git a/xmloff/source/xforms/SchemaContext.cxx b/xmloff/source/xforms/SchemaContext.cxx
index 210133a4868c..6c19cbfa019a 100644
--- a/xmloff/source/xforms/SchemaContext.cxx
+++ b/xmloff/source/xforms/SchemaContext.cxx
@@ -67,10 +67,10 @@ SvXMLImportContext* SchemaContext::HandleChild(
const OUString& rLocalName,
const Reference<XAttributeList>& )
{
- return ( nToken == XML_SIMPLETYPE )
- ? new SchemaSimpleTypeContext( GetImport(), nPrefix, rLocalName,
- mxRepository )
- : new SvXMLImportContext( GetImport(), nPrefix, rLocalName );
+ if ( nToken == XML_SIMPLETYPE )
+ return new SchemaSimpleTypeContext( GetImport(), nPrefix, rLocalName,
+ mxRepository );
+ return nullptr;
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/xmloff/source/xforms/SchemaSimpleTypeContext.cxx b/xmloff/source/xforms/SchemaSimpleTypeContext.cxx
index dcff58b5675d..0c01874efbf5 100644
--- a/xmloff/source/xforms/SchemaSimpleTypeContext.cxx
+++ b/xmloff/source/xforms/SchemaSimpleTypeContext.cxx
@@ -72,21 +72,16 @@ SvXMLImportContext* SchemaSimpleTypeContext::HandleChild(
const OUString& rLocalName,
const Reference<XAttributeList>& )
{
- SvXMLImportContext* pContext = nullptr;
switch( nToken )
{
case XML_RESTRICTION:
- pContext = new SchemaRestrictionContext( GetImport(),
+ return new SchemaRestrictionContext( GetImport(),
nPrefix, rLocalName,
mxRepository, msTypeName );
break;
- default:
- OSL_FAIL( "Booo!" );
}
- return ( pContext != nullptr )
- ? pContext
- : new SvXMLImportContext( GetImport(), nPrefix, rLocalName );
+ return nullptr;
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/xmloff/source/xforms/TokenContext.cxx b/xmloff/source/xforms/TokenContext.cxx
index 2178b38c4805..71215c4395d7 100644
--- a/xmloff/source/xforms/TokenContext.cxx
+++ b/xmloff/source/xforms/TokenContext.cxx
@@ -107,7 +107,6 @@ SvXMLImportContextRef TokenContext::CreateChildContext(
if( pContext == nullptr )
{
GetImport().SetError( XMLERROR_UNKNOWN_ELEMENT, rLocalName );
- pContext = new SvXMLImportContext( GetImport(), nPrefix, rLocalName );
}
return pContext;
}
diff --git a/xmloff/source/xforms/XFormsInstanceContext.cxx b/xmloff/source/xforms/XFormsInstanceContext.cxx
index d8ea98e5d5b2..e1a81a3f6c37 100644
--- a/xmloff/source/xforms/XFormsInstanceContext.cxx
+++ b/xmloff/source/xforms/XFormsInstanceContext.cxx
@@ -77,7 +77,6 @@ SvXMLImportContextRef XFormsInstanceContext::CreateChildContext(
if( mxInstance.is() )
{
GetImport().SetError( XMLERROR_XFORMS_ONLY_ONE_INSTANCE_ELEMENT, rLocalName );
- pContext = new SvXMLImportContext( GetImport(), nPrefix, rLocalName );
}
else
{