diff options
author | Matteo Casalin <matteo.casalin@yahoo.com> | 2014-04-21 00:07:57 +0200 |
---|---|---|
committer | Matteo Casalin <matteo.casalin@yahoo.com> | 2014-04-27 14:00:44 +0200 |
commit | 74191a177ca125d3ed171a61cda242c9eefed05d (patch) | |
tree | 52b7f4102a89b24a9cee6a623074739f9513a072 /sw | |
parent | afcd18230d2faecaad45b124c51baa6ad53c780a (diff) |
OUString: avoid concatenated appends and temporaries
Change-Id: If18b40b15ce83aa794527b9b9109b916dc6c3ed8
Diffstat (limited to 'sw')
-rw-r--r-- | sw/source/filter/xml/xmltble.cxx | 33 |
1 files changed, 10 insertions, 23 deletions
diff --git a/sw/source/filter/xml/xmltble.cxx b/sw/source/filter/xml/xmltble.cxx index 7bf8e0675e32..d5d935ee86c4 100644 --- a/sw/source/filter/xml/xmltble.cxx +++ b/sw/source/filter/xml/xmltble.cxx @@ -593,20 +593,16 @@ void SwXMLExport::ExportTableLinesAutoStyles( const SwTableLines& rLines, } else { - sBuffer.append( rNamePrefix ); - sBuffer.append( '.' ); if( bTop ) { OUString sTmp; sw_GetTblBoxColStr( nColumn, sTmp ); - sBuffer.append( sTmp ); + pColumn->SetStyleName( rNamePrefix + "." + sTmp ); } else { - sBuffer.append( (sal_Int32)(nColumn + 1U) ); + pColumn->SetStyleName( rNamePrefix + "." + OUString::number(nColumn + 1U) ); } - - pColumn->SetStyleName( sBuffer.makeStringAndClear() ); ExportTableColumnStyle( *pColumn ); rExpCols.insert( pColumn ); } @@ -663,8 +659,7 @@ void SwXMLExport::ExportTableLinesAutoStyles( const SwTableLines& rLines, { Reference<XPropertySet> xCellPropertySet( xCell, UNO_QUERY ); - OUString sTextSection("TextSection"); - Any aAny = xCellPropertySet->getPropertyValue(sTextSection); + Any aAny = xCellPropertySet->getPropertyValue("TextSection"); Reference < XTextSection > xTextSection; aAny >>= xTextSection; rTblInfo.SetBaseSection( xTextSection ); @@ -724,13 +719,12 @@ void SwXMLExport::ExportTableAutoStyles( const SwTableNode& rTblNd ) } ExportTableFmt( *pTblFmt, nAbsWidth ); - OUString sName( pTblFmt->GetName() ); SwXMLTableColumnsSortByWidth_Impl aExpCols; SwXMLTableFrmFmtsSort_Impl aExpRows; SwXMLTableFrmFmtsSort_Impl aExpCells; SwXMLTableInfo_Impl aTblInfo( &rTbl ); ExportTableLinesAutoStyles( rTbl.GetTabLines(), nAbsWidth, nBaseWidth, - sName, aExpCols, aExpRows, aExpCells, + pTblFmt->GetName(), aExpCols, aExpRows, aExpCells, aTblInfo, sal_True); } } @@ -756,18 +750,14 @@ void SwXMLExport::ExportTableBox( const SwTableBox& rBox, if( nRowSpan != 1 ) { - OUStringBuffer sTmp; - sTmp.append( (sal_Int32)nRowSpan ); AddAttribute( XML_NAMESPACE_TABLE, XML_NUMBER_ROWS_SPANNED, - sTmp.makeStringAndClear() ); + OUString::number(nRowSpan) ); } if( nColSpan != 1 ) { - OUStringBuffer sTmp; - sTmp.append( (sal_Int32)nColSpan ); AddAttribute( XML_NAMESPACE_TABLE, XML_NUMBER_COLUMNS_SPANNED, - sTmp.makeStringAndClear() ); + OUString::number(nColSpan) ); } { @@ -784,13 +774,13 @@ void SwXMLExport::ExportTableBox( const SwTableBox& rBox, Reference<XText> xText( xCell, UNO_QUERY ); // get formula (and protection) - OUString sCellFormula = xCell->getFormula(); + const OUString sCellFormula = xCell->getFormula(); // if this cell has a formula, export it // (with value and number format) if (!sCellFormula.isEmpty()) { - OUString sQValue = + const OUString sQValue = GetNamespaceMap().GetQNameByKey( XML_NAMESPACE_OOOW, sCellFormula, false ); // formula @@ -833,8 +823,7 @@ void SwXMLExport::ExportTableBox( const SwTableBox& rBox, if( !rTblInfo.IsBaseSectionValid() ) { - OUString sTextSection("TextSection"); - aAny = xCellPropertySet->getPropertyValue(sTextSection); + aAny = xCellPropertySet->getPropertyValue("TextSection"); Reference < XTextSection > xTextSection; aAny >>= xTextSection; rTblInfo.SetBaseSection( xTextSection ); @@ -1010,10 +999,8 @@ void SwXMLExport::ExportTableLines( const SwTableLines& rLines, if( nColRep > 1 ) { - OUStringBuffer sTmp(4); - sTmp.append( nColRep ); AddAttribute( XML_NAMESPACE_TABLE, XML_NUMBER_COLUMNS_REPEATED, - sTmp.makeStringAndClear() ); + OUString::number(nColRep) ); } { |