summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorMatteo Casalin <matteo.casalin@yahoo.com>2014-04-20 23:55:32 +0200
committerMatteo Casalin <matteo.casalin@yahoo.com>2014-04-27 14:00:44 +0200
commitafcd18230d2faecaad45b124c51baa6ad53c780a (patch)
tree5ea461c483e670acc2027052c5ec0f2fd89190ce /sw
parent6757781318bbd51386c763c6eefbef2835234481 (diff)
Simplify lcl_xmltble_appendBoxPrefix
Change-Id: I1ba0af6b03383e83a24c765d8036d8729163a574
Diffstat (limited to 'sw')
-rw-r--r--sw/source/filter/xml/xmltble.cxx28
1 files changed, 9 insertions, 19 deletions
diff --git a/sw/source/filter/xml/xmltble.cxx b/sw/source/filter/xml/xmltble.cxx
index 9c1d6ea9b411..7bf8e0675e32 100644
--- a/sw/source/filter/xml/xmltble.cxx
+++ b/sw/source/filter/xml/xmltble.cxx
@@ -290,24 +290,18 @@ bool SwXMLTableFrmFmtsSort_Impl::AddRow( SwFrmFmt& rFrmFmt,
}
void sw_GetTblBoxColStr( sal_uInt16 nCol, OUString& rNm );
-static void lcl_xmltble_appendBoxPrefix( OUStringBuffer& rBuffer,
- const OUString& rNamePrefix,
+static OUString lcl_xmltble_appendBoxPrefix(const OUString& rNamePrefix,
sal_uInt32 nCol, sal_uInt32 nRow, sal_Bool bTop )
{
- rBuffer.append( rNamePrefix );
- rBuffer.append( '.' );
if( bTop )
{
OUString sTmp;
sw_GetTblBoxColStr( (sal_uInt16)nCol, sTmp );
- rBuffer.append( sTmp );
+ return rNamePrefix + "." + sTmp + OUString::number(nRow + 1);
}
- else
- {
- rBuffer.append( (sal_Int32)(nCol + 1));
- rBuffer.append( '.' );
- }
- rBuffer.append( (sal_Int32)(nRow + 1));
+ return rNamePrefix
+ + "." + OUString::number(nCol + 1)
+ + "." + OUString::number(nRow + 1);
}
bool SwXMLTableFrmFmtsSort_Impl::AddCell( SwFrmFmt& rFrmFmt,
@@ -455,9 +449,7 @@ bool SwXMLTableFrmFmtsSort_Impl::AddCell( SwFrmFmt& rFrmFmt,
if( bInsert )
{
- OUStringBuffer sBuffer( rNamePrefix.getLength() + 8UL );
- lcl_xmltble_appendBoxPrefix( sBuffer, rNamePrefix, nCol, nRow, bTop );
- rFrmFmt.SetName( sBuffer.makeStringAndClear() );
+ rFrmFmt.SetName( lcl_xmltble_appendBoxPrefix( rNamePrefix, nCol, nRow, bTop ) );
if ( i != aFormatList.end() ) ++i;
aFormatList.insert( i, &rFrmFmt );
}
@@ -692,14 +684,12 @@ void SwXMLExport::ExportTableLinesAutoStyles( const SwTableLines& rLines,
}
else
{
- lcl_xmltble_appendBoxPrefix( sBuffer, rNamePrefix, nOldCol,
- nLine, bTop );
-
ExportTableLinesAutoStyles( pBox->GetTabLines(),
nAbsWidth, nBaseWidth,
- sBuffer.makeStringAndClear(),
+ lcl_xmltble_appendBoxPrefix( rNamePrefix,
+ nOldCol, nLine, bTop ),
rExpCols, rExpRows, rExpCells,
- rTblInfo );
+ rTblInfo );
}
nCol++;