diff options
Diffstat (limited to 'xmloff/source/text/XMLTextColumnsContext.cxx')
-rw-r--r-- | xmloff/source/text/XMLTextColumnsContext.cxx | 48 |
1 files changed, 17 insertions, 31 deletions
diff --git a/xmloff/source/text/XMLTextColumnsContext.cxx b/xmloff/source/text/XMLTextColumnsContext.cxx index 08e8d05270c0..475f9c916ce7 100644 --- a/xmloff/source/text/XMLTextColumnsContext.cxx +++ b/xmloff/source/text/XMLTextColumnsContext.cxx @@ -276,7 +276,6 @@ XMLTextColumnsContext::XMLTextColumnsContext( , sAutomaticDistance("AutomaticDistance") , sSeparatorLineStyle("SeparatorLineStyle") , pColumns( nullptr ) -, pColumnSep( nullptr ) , pColumnAttrTokenMap( new SvXMLTokenMap(aColAttrTokenMap) ) , pColumnSepAttrTokenMap( new SvXMLTokenMap(aColSepAttrTokenMap) ) , nCount( 0 ) @@ -311,17 +310,6 @@ XMLTextColumnsContext::XMLTextColumnsContext( XMLTextColumnsContext::~XMLTextColumnsContext() { - if( pColumns ) - { - for (XMLTextColumnsArray_Impl::iterator it = pColumns->begin(); - it != pColumns->end(); ++it) - { - (*it)->ReleaseRef(); - } - } - if( pColumnSep ) - pColumnSep->ReleaseRef(); - delete pColumns; delete pColumnAttrTokenMap; delete pColumnSepAttrTokenMap; @@ -337,28 +325,26 @@ SvXMLImportContext *XMLTextColumnsContext::CreateChildContext( if( XML_NAMESPACE_STYLE == nPrefix && IsXMLToken( rLocalName, XML_COLUMN ) ) { - XMLTextColumnContext_Impl *pColumn = + const uno::Reference<XMLTextColumnContext_Impl> xColumn{ new XMLTextColumnContext_Impl( GetImport(), nPrefix, rLocalName, - xAttrList, *pColumnAttrTokenMap ); + xAttrList, *pColumnAttrTokenMap )}; // add new tabstop to array of tabstops if( !pColumns ) pColumns = new XMLTextColumnsArray_Impl; - pColumns->push_back( pColumn ); - pColumn->AddFirstRef(); + pColumns->push_back( xColumn ); - pContext = pColumn; + pContext = xColumn.get(); } else if( XML_NAMESPACE_STYLE == nPrefix && IsXMLToken( rLocalName, XML_COLUMN_SEP ) ) { - pColumnSep = + mxColumnSep.set( new XMLTextColumnSepContext_Impl( GetImport(), nPrefix, rLocalName, - xAttrList, *pColumnSepAttrTokenMap ); - pColumnSep->AddFirstRef(); + xAttrList, *pColumnSepAttrTokenMap )); - pContext = pColumnSep; + pContext = mxColumnSep.get(); } else { @@ -442,29 +428,29 @@ void XMLTextColumnsContext::EndElement( ) Reference < XPropertySet > xPropSet( xColumns, UNO_QUERY ); if( xPropSet.is() ) { - bool bOn = pColumnSep != nullptr; + bool bOn = mxColumnSep != nullptr; xPropSet->setPropertyValue( sSeparatorLineIsOn, Any(bOn) ); - if( pColumnSep ) + if( mxColumnSep.is() ) { - if( pColumnSep->GetWidth() ) + if( mxColumnSep->GetWidth() ) { - xPropSet->setPropertyValue( sSeparatorLineWidth, Any(pColumnSep->GetWidth()) ); + xPropSet->setPropertyValue( sSeparatorLineWidth, Any(mxColumnSep->GetWidth()) ); } - if( pColumnSep->GetHeight() ) + if( mxColumnSep->GetHeight() ) { xPropSet->setPropertyValue( sSeparatorLineRelativeHeight, - Any(pColumnSep->GetHeight()) ); + Any(mxColumnSep->GetHeight()) ); } - if ( pColumnSep->GetStyle() ) + if ( mxColumnSep->GetStyle() ) { - xPropSet->setPropertyValue( sSeparatorLineStyle, Any(pColumnSep->GetStyle()) ); + xPropSet->setPropertyValue( sSeparatorLineStyle, Any(mxColumnSep->GetStyle()) ); } - xPropSet->setPropertyValue( sSeparatorLineColor, Any(pColumnSep->GetColor()) ); + xPropSet->setPropertyValue( sSeparatorLineColor, Any(mxColumnSep->GetColor()) ); - xPropSet->setPropertyValue( sSeparatorLineVerticalAlignment, Any(pColumnSep->GetVertAlign()) ); + xPropSet->setPropertyValue( sSeparatorLineVerticalAlignment, Any(mxColumnSep->GetVertAlign()) ); } // handle 'automatic columns': column distance |