diff options
author | Caolán McNamara <caolanm@redhat.com> | 2015-02-17 13:43:17 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2015-02-17 16:24:05 +0000 |
commit | 3744d8506ef231d642785faf6da4926cea64c6a0 (patch) | |
tree | 2d57ca5be9eda54aafb5065d7010bb50a37053ac /xmloff/source/table | |
parent | 7a17c038a6f4c433a69c6c1ed04aca2e5c929027 (diff) |
boost->std
Change-Id: I8371b942d915f777a29ca01cd0aed674db0ca853
Diffstat (limited to 'xmloff/source/table')
-rw-r--r-- | xmloff/source/table/XMLTableExport.cxx | 46 | ||||
-rw-r--r-- | xmloff/source/table/XMLTableImport.cxx | 18 |
2 files changed, 32 insertions, 32 deletions
diff --git a/xmloff/source/table/XMLTableExport.cxx b/xmloff/source/table/XMLTableExport.cxx index 405c9db021a8..ab86020132be 100644 --- a/xmloff/source/table/XMLTableExport.cxx +++ b/xmloff/source/table/XMLTableExport.cxx @@ -200,8 +200,8 @@ static bool has_states( const std::vector< XMLPropertyState >& xPropStates ) if( !mbExportTables ) return; - boost::shared_ptr< XMLTableInfo > pTableInfo( new XMLTableInfo() ); - maTableInfoMap[xColumnRowRange] = pTableInfo; + std::shared_ptr< XMLTableInfo > xTableInfo( new XMLTableInfo() ); + maTableInfoMap[xColumnRowRange] = xTableInfo; try { @@ -216,7 +216,7 @@ static bool has_states( const std::vector< XMLPropertyState >& xPropStates ) { const OUString sStyleName( mrExport.GetAutoStylePool()->Add(XML_STYLE_FAMILY_TABLE_COLUMN, xPropStates) ); Reference< XInterface > xKey( xPropSet, UNO_QUERY ); - pTableInfo->maColumnStyleMap[xKey] = sStyleName; + xTableInfo->maColumnStyleMap[xKey] = sStyleName; } } catch(const Exception&) @@ -226,7 +226,7 @@ static bool has_states( const std::vector< XMLPropertyState >& xPropStates ) Reference< XIndexAccess > xIndexAccessRows( xColumnRowRange->getRows(), UNO_QUERY_THROW ); const sal_Int32 nRowCount = xIndexAccessRows->getCount(); - pTableInfo->maDefaultRowCellStyles.resize(nRowCount); + xTableInfo->maDefaultRowCellStyles.resize(nRowCount); StringStatisticHelper aStringStatistic; @@ -239,7 +239,7 @@ static bool has_states( const std::vector< XMLPropertyState >& xPropStates ) { const OUString sStyleName( mrExport.GetAutoStylePool()->Add(XML_STYLE_FAMILY_TABLE_ROW, xRowPropStates) ); Reference< XInterface > xKey( xPropSet, UNO_QUERY ); - pTableInfo->maRowStyleMap[xKey] = sStyleName; + xTableInfo->maRowStyleMap[xKey] = sStyleName; } // get the current row @@ -270,7 +270,7 @@ static bool has_states( const std::vector< XMLPropertyState >& xPropStates ) if( !sStyleName.isEmpty() ) { Reference< XInterface > xKey( xCellSet, UNO_QUERY ); - pTableInfo->maCellStyleMap[xKey] = sStyleName; + xTableInfo->maCellStyleMap[xKey] = sStyleName; } // create auto style for text @@ -283,7 +283,7 @@ static bool has_states( const std::vector< XMLPropertyState >& xPropStates ) OUString sDefaultCellStyle; if( aStringStatistic.getModeString( sDefaultCellStyle ) > 1 ) - pTableInfo->maDefaultRowCellStyles[nRow] = sDefaultCellStyle; + xTableInfo->maDefaultRowCellStyles[nRow] = sDefaultCellStyle; aStringStatistic.clear(); } @@ -300,12 +300,12 @@ static bool has_states( const std::vector< XMLPropertyState >& xPropStates ) void XMLTableExport::exportTable( const Reference < XColumnRowRange >& xColumnRowRange ) { - if( !mbExportTables ) - return; + if( !mbExportTables ) + return; - try + try { - boost::shared_ptr< XMLTableInfo > pTableInfo( maTableInfoMap[xColumnRowRange] ); + std::shared_ptr< XMLTableInfo > xTableInfo( maTableInfoMap[xColumnRowRange] ); // get row and column count Reference< XIndexAccess > xIndexAccess( xColumnRowRange->getRows(), UNO_QUERY_THROW ); @@ -317,7 +317,7 @@ static bool has_states( const std::vector< XMLPropertyState >& xPropStates ) SvXMLElementExport tableElement( mrExport, XML_NAMESPACE_TABLE, XML_TABLE, true, true ); // export table columns - ExportTableColumns( xIndexAccessCols, pTableInfo ); + ExportTableColumns( xIndexAccessCols, xTableInfo ); // start iterating rows and columns for ( sal_Int32 rowIndex = 0; rowIndex < rowCount; rowIndex++ ) @@ -328,14 +328,14 @@ static bool has_states( const std::vector< XMLPropertyState >& xPropStates ) OUString sDefaultCellStyle; // table:style-name - if( pTableInfo.get() ) + if( xTableInfo.get() ) { Reference< XInterface > xKey( xCellRange, UNO_QUERY ); - const OUString sStyleName( pTableInfo->maRowStyleMap[xKey] ); + const OUString sStyleName( xTableInfo->maRowStyleMap[xKey] ); if( !sStyleName.isEmpty() ) mrExport.AddAttribute(XML_NAMESPACE_TABLE, XML_STYLE_NAME, sStyleName ); - sDefaultCellStyle = pTableInfo->maDefaultRowCellStyles[rowIndex]; + sDefaultCellStyle = xTableInfo->maDefaultRowCellStyles[rowIndex]; if( !sDefaultCellStyle.isEmpty() ) mrExport.AddAttribute(XML_NAMESPACE_TABLE, XML_DEFAULT_CELL_STYLE_NAME, sDefaultCellStyle ); } @@ -352,7 +352,7 @@ static bool has_states( const std::vector< XMLPropertyState >& xPropStates ) Reference< XMergeableCell > xMergeableCell( xCell, UNO_QUERY_THROW ); // export cell - ExportCell( xCell, pTableInfo, sDefaultCellStyle ); + ExportCell( xCell, xTableInfo, sDefaultCellStyle ); } } } @@ -364,7 +364,7 @@ static bool has_states( const std::vector< XMLPropertyState >& xPropStates ) // Export the table columns - void XMLTableExport::ExportTableColumns( const Reference < XIndexAccess >& xtableColumnsIndexAccess, const boost::shared_ptr< XMLTableInfo >& pTableInfo ) + void XMLTableExport::ExportTableColumns( const Reference < XIndexAccess >& xtableColumnsIndexAccess, const std::shared_ptr< XMLTableInfo >& rTableInfo ) { const sal_Int32 nColumnCount = xtableColumnsIndexAccess->getCount(); for( sal_Int32 nColumn = 0; nColumn < nColumnCount; ++nColumn ) @@ -373,10 +373,10 @@ static bool has_states( const std::vector< XMLPropertyState >& xPropStates ) if ( xColumnProperties.is() ) { // table:style-name - if( pTableInfo.get() ) + if( rTableInfo.get() ) { Reference< XInterface > xKey( xColumnProperties, UNO_QUERY ); - const OUString sStyleName( pTableInfo->maColumnStyleMap[xKey] ); + const OUString sStyleName( rTableInfo->maColumnStyleMap[xKey] ); if( !sStyleName.isEmpty() ) mrExport.AddAttribute(XML_NAMESPACE_TABLE, XML_STYLE_NAME, sStyleName ); } @@ -391,19 +391,19 @@ static bool has_states( const std::vector< XMLPropertyState >& xPropStates ) // ODF export for a table cell. - void XMLTableExport::ExportCell( const Reference < XCell >& xCell, const boost::shared_ptr< XMLTableInfo >& pTableInfo, const OUString& rDefaultCellStyle ) + void XMLTableExport::ExportCell( const Reference < XCell >& xCell, const std::shared_ptr< XMLTableInfo >& rTableInfo, const OUString& rDefaultCellStyle ) { bool bIsMerged = false; sal_Int32 nRowSpan = 0; sal_Int32 nColSpan = 0; - try + try { - if( pTableInfo.get() ) + if( rTableInfo.get() ) { // table:style-name Reference< XInterface > xKey( xCell, UNO_QUERY ); - const OUString sStyleName( pTableInfo->maCellStyleMap[xKey] ); + const OUString sStyleName( rTableInfo->maCellStyleMap[xKey] ); if( !sStyleName.isEmpty() && (sStyleName != rDefaultCellStyle) ) mrExport.AddAttribute(XML_NAMESPACE_TABLE, XML_STYLE_NAME, sStyleName ); } diff --git a/xmloff/source/table/XMLTableImport.cxx b/xmloff/source/table/XMLTableImport.cxx index dc47fde7db86..729014afff5a 100644 --- a/xmloff/source/table/XMLTableImport.cxx +++ b/xmloff/source/table/XMLTableImport.cxx @@ -41,7 +41,7 @@ #include <osl/diagnose.h> -#include <boost/shared_ptr.hpp> +#include <memory> using namespace ::xmloff::token; using namespace ::com::sun::star::beans; @@ -86,7 +86,7 @@ struct MergeInfo : mnStartColumn( nStartColumn ), mnStartRow( nStartRow ), mnEndColumn( nStartColumn + nColumnSpan - 1 ), mnEndRow( nStartRow + nRowSpan - 1 ) {}; }; -typedef std::vector< boost::shared_ptr< MergeInfo > > MergeInfoVector; +typedef std::vector< std::shared_ptr< MergeInfo > > MergeInfoVector; class XMLTableImportContext : public SvXMLImportContext { @@ -113,7 +113,7 @@ public: Reference< XTableColumns > mxColumns; Reference< XTableRows > mxRows; - std::vector< boost::shared_ptr< ColumnInfo > > maColumnInfos; + std::vector< std::shared_ptr< ColumnInfo > > maColumnInfos; sal_Int32 mnCurrentRow; sal_Int32 mnCurrentColumn; @@ -214,7 +214,7 @@ SvXMLStyleContext* XMLTableImport::CreateTableTemplateContext( sal_uInt16 nPrfx, void XMLTableImport::addTableTemplate( const OUString& rsStyleName, XMLTableTemplate& xTableTemplate ) { - boost::shared_ptr< XMLTableTemplate > xPtr( new XMLTableTemplate ); + std::shared_ptr< XMLTableTemplate > xPtr( new XMLTableTemplate ); xPtr->swap( xTableTemplate ); maTableTemplates[rsStyleName] = xPtr; } @@ -238,7 +238,7 @@ void XMLTableImport::finishStyles() const OUString sTemplateName( (*aTemplateIter).first ); Reference< XNameReplace > xTemplate( xFactory->createInstance(), UNO_QUERY_THROW ); - boost::shared_ptr< XMLTableTemplate > xT( (*aTemplateIter).second ); + std::shared_ptr< XMLTableTemplate > xT( (*aTemplateIter).second ); for( XMLTableTemplate::iterator aStyleIter( xT->begin() ); aStyleIter != xT->end(); ++aStyleIter ) try { @@ -292,7 +292,7 @@ SvXMLImportContext * XMLTableImportContext::ImportColumn( sal_uInt16 nPrefix, co { if( mxColumns.is() && (mnCurrentRow == -1) ) try { - boost::shared_ptr< ColumnInfo > xInfo ( new ColumnInfo ); + std::shared_ptr< ColumnInfo > xInfo ( new ColumnInfo ); sal_Int32 nRepeated = 1; @@ -362,7 +362,7 @@ void XMLTableImportContext::InitColumns() for( sal_Int32 nCol = 0; nCol < nCount2; nCol++ ) { - boost::shared_ptr< ColumnInfo > xInfo( maColumnInfos[nCol] ); + std::shared_ptr< ColumnInfo > xInfo( maColumnInfos[nCol] ); if( pAutoStyles && !xInfo->msStyleName.isEmpty() ) { @@ -469,7 +469,7 @@ SvXMLImportContext * XMLTableImportContext::ImportCell( sal_uInt16 nPrefix, cons const sal_Int32 nColumnSpan = pCellContext->getColumnSpan(); const sal_Int32 nRowSpan = pCellContext->getRowSpan(); if( (nColumnSpan > 1) || (nRowSpan > 1) ) - maMergeInfos.push_back( boost::shared_ptr< MergeInfo >( new MergeInfo( mnCurrentColumn, mnCurrentRow, nColumnSpan, nRowSpan ) ) ); + maMergeInfos.push_back( std::shared_ptr< MergeInfo >( new MergeInfo( mnCurrentColumn, mnCurrentRow, nColumnSpan, nRowSpan ) ) ); const sal_Int32 nRepeated = pCellContext->getRepeated(); if( nRepeated > 1 ) @@ -519,7 +519,7 @@ void XMLTableImportContext::EndElement() MergeInfoVector::iterator aIter( maMergeInfos.begin() ); while( aIter != maMergeInfos.end() ) { - boost::shared_ptr< MergeInfo > xInfo( (*aIter++) ); + std::shared_ptr< MergeInfo > xInfo( (*aIter++) ); if( xInfo.get() ) try { |