summaryrefslogtreecommitdiff
path: root/xmloff/source/chart
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2015-08-05 10:48:40 +0200
committerNoel Grandin <noelgrandin@gmail.com>2015-08-05 11:26:04 +0000
commit9c1f700aff5f7e375d3570231e6d68fe2e2c0334 (patch)
tree0d616e27ab7cf82dd5e28939b984a626adc682e0 /xmloff/source/chart
parenta5b842f3aa401352f5454edb8f47d9576dff0092 (diff)
improve refcounting loplugin to check SvRef-based classes
Change-Id: I2b3c8eedabeaecd8dcae9fe69c951353a5686883 Reviewed-on: https://gerrit.libreoffice.org/17521 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
Diffstat (limited to 'xmloff/source/chart')
-rw-r--r--xmloff/source/chart/SchXMLExport.cxx22
-rw-r--r--xmloff/source/chart/SchXMLImport.cxx11
2 files changed, 17 insertions, 16 deletions
diff --git a/xmloff/source/chart/SchXMLExport.cxx b/xmloff/source/chart/SchXMLExport.cxx
index 08f1c5311ae0..e50c783d91dd 100644
--- a/xmloff/source/chart/SchXMLExport.cxx
+++ b/xmloff/source/chart/SchXMLExport.cxx
@@ -3560,8 +3560,8 @@ SchXMLExport::SchXMLExport(
OUString const & implementationName, SvXMLExportFlags nExportFlags )
: SvXMLExport( util::MeasureUnit::CM, xContext, implementationName,
::xmloff::token::XML_CHART, nExportFlags ),
- maAutoStylePool( *this ),
- maExportHelper( *this, maAutoStylePool )
+ maAutoStylePool( new SchXMLAutoStylePoolP(*this) ),
+ maExportHelper( new SchXMLExportHelper(*this, *maAutoStylePool.get()) )
{
if( getDefaultVersion() > SvtSaveOptions::ODFVER_012 )
_GetNamespaceMap().Add( GetXMLToken(XML_NP_CHART_EXT), GetXMLToken(XML_N_CHART_EXT), XML_NAMESPACE_CHART_EXT);
@@ -3579,11 +3579,11 @@ SchXMLExport::~SchXMLExport()
sal_uInt32 SchXMLExport::exportDoc( enum ::xmloff::token::XMLTokenEnum eClass )
{
- maExportHelper.SetSourceShellID(GetSourceShellID());
- maExportHelper.SetDestinationShellID(GetDestinationShellID());
+ maExportHelper->SetSourceShellID(GetSourceShellID());
+ maExportHelper->SetDestinationShellID(GetDestinationShellID());
Reference< chart2::XChartDocument > xChartDoc( GetModel(), uno::UNO_QUERY );
- maExportHelper.m_pImpl->InitRangeSegmentationProperties( xChartDoc );
+ maExportHelper->m_pImpl->InitRangeSegmentationProperties( xChartDoc );
return SvXMLExport::exportDoc( eClass );
}
@@ -3606,8 +3606,8 @@ void SchXMLExport::_ExportAutoStyles()
Reference< chart::XChartDocument > xChartDoc( GetModel(), uno::UNO_QUERY );
if( xChartDoc.is())
{
- maExportHelper.m_pImpl->collectAutoStyles( xChartDoc );
- maExportHelper.m_pImpl->exportAutoStyles();
+ maExportHelper->m_pImpl->collectAutoStyles( xChartDoc );
+ maExportHelper->m_pImpl->exportAutoStyles();
}
else
{
@@ -3654,13 +3654,13 @@ void SchXMLExport::_ExportContent()
aAny = xProp->getPropertyValue(
OUString( "ChartRangeAddress" ));
aAny >>= sChartAddress;
- maExportHelper.m_pImpl->SetChartRangeAddress( sChartAddress );
+ maExportHelper->m_pImpl->SetChartRangeAddress( sChartAddress );
OUString sTableNumberList;
aAny = xProp->getPropertyValue(
OUString( "TableNumberList" ));
aAny >>= sTableNumberList;
- maExportHelper.m_pImpl->SetTableNumberList( sTableNumberList );
+ maExportHelper->m_pImpl->SetTableNumberList( sTableNumberList );
// do not include own table if there are external addresses
bIncludeTable = sChartAddress.isEmpty();
@@ -3673,7 +3673,7 @@ void SchXMLExport::_ExportContent()
}
}
}
- maExportHelper.m_pImpl->exportChart( xChartDoc, bIncludeTable );
+ maExportHelper->m_pImpl->exportChart( xChartDoc, bIncludeTable );
}
else
{
@@ -3683,7 +3683,7 @@ void SchXMLExport::_ExportContent()
rtl::Reference< XMLPropertySetMapper > SchXMLExport::GetPropertySetMapper() const
{
- return maExportHelper.m_pImpl->GetPropertySetMapper();
+ return maExportHelper->m_pImpl->GetPropertySetMapper();
}
void SchXMLExportHelper_Impl::InitRangeSegmentationProperties( const Reference< chart2::XChartDocument > & xChartDoc )
diff --git a/xmloff/source/chart/SchXMLImport.cxx b/xmloff/source/chart/SchXMLImport.cxx
index 46083c41febd..a8e1ea4a81e4 100644
--- a/xmloff/source/chart/SchXMLImport.cxx
+++ b/xmloff/source/chart/SchXMLImport.cxx
@@ -506,7 +506,8 @@ Reference< chart2::XDataSeries > SchXMLImportHelper::GetNewDataSeries(
SchXMLImport::SchXMLImport(
const Reference< uno::XComponentContext >& xContext,
OUString const & implementationName, SvXMLImportFlags nImportFlags ) :
- SvXMLImport( xContext, implementationName, nImportFlags )
+ SvXMLImport( xContext, implementationName, nImportFlags ),
+ maImportHelper(new SchXMLImportHelper)
{
GetNamespaceMap().Add( GetXMLToken(XML_NP_XLINK), GetXMLToken(XML_N_XLINK), XML_NAMESPACE_XLINK );
GetNamespaceMap().Add( GetXMLToken(XML_NP_CHART_EXT), GetXMLToken(XML_N_CHART_EXT), XML_NAMESPACE_CHART_EXT);
@@ -540,7 +541,7 @@ SvXMLImportContext *SchXMLImport::CreateContext( sal_uInt16 nPrefix, const OUStr
( IsXMLToken( rLocalName, XML_DOCUMENT_STYLES) ||
IsXMLToken( rLocalName, XML_DOCUMENT_CONTENT) ))
{
- pContext = new SchXMLDocContext( maImportHelper, *this, nPrefix, rLocalName );
+ pContext = new SchXMLDocContext( *maImportHelper.get(), *this, nPrefix, rLocalName );
} else if ( (XML_NAMESPACE_OFFICE == nPrefix) &&
( IsXMLToken(rLocalName, XML_DOCUMENT) ||
(IsXMLToken(rLocalName, XML_DOCUMENT_META)
@@ -556,12 +557,12 @@ SvXMLImportContext *SchXMLImport::CreateContext( sal_uInt16 nPrefix, const OUStr
xDPS->getDocumentProperties())
// flat OpenDocument file format
: new SchXMLFlatDocContext_Impl(
- maImportHelper, *this, nPrefix, rLocalName,
+ *maImportHelper.get(), *this, nPrefix, rLocalName,
xDPS->getDocumentProperties());
} else {
pContext = (IsXMLToken(rLocalName, XML_DOCUMENT_META))
? SvXMLImport::CreateContext( nPrefix, rLocalName, xAttrList )
- : new SchXMLDocContext( maImportHelper, *this,
+ : new SchXMLDocContext( *maImportHelper.get(), *this,
nPrefix, rLocalName );
}
} else {
@@ -583,7 +584,7 @@ SvXMLImportContext* SchXMLImport::CreateStylesContext(
// set context at base class, so that all auto-style classes are imported
SetAutoStyles( pStylesCtxt );
- maImportHelper.SetAutoStylesContext( pStylesCtxt );
+ maImportHelper->SetAutoStylesContext( pStylesCtxt );
return pStylesCtxt;
}