summaryrefslogtreecommitdiff
path: root/xmloff/source/table/XMLTableExport.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'xmloff/source/table/XMLTableExport.cxx')
-rw-r--r--xmloff/source/table/XMLTableExport.cxx10
1 files changed, 6 insertions, 4 deletions
diff --git a/xmloff/source/table/XMLTableExport.cxx b/xmloff/source/table/XMLTableExport.cxx
index 4429c7cbed..e1cdad63c4 100644
--- a/xmloff/source/table/XMLTableExport.cxx
+++ b/xmloff/source/table/XMLTableExport.cxx
@@ -353,6 +353,8 @@ static bool has_states( const std::vector< XMLPropertyState >& xPropStates )
// get the current row
Reference< XCellRange > xCellRange( xIndexAccess->getByIndex(rowIndex), UNO_QUERY_THROW );
+ OUString sDefaultCellStyle;
+
// table:style-name
if( pTableInfo.get() )
{
@@ -360,11 +362,11 @@ static bool has_states( const std::vector< XMLPropertyState >& xPropStates )
const OUString sStyleName( pTableInfo->maRowStyleMap[xKey] );
if( sStyleName.getLength() )
mrExport.AddAttribute(XML_NAMESPACE_TABLE, XML_STYLE_NAME, sStyleName );
- }
- const OUString sDefaultCellStyle( pTableInfo->maDefaultRowCellStyles[rowIndex] );
- if( sDefaultCellStyle.getLength() )
- mrExport.AddAttribute(XML_NAMESPACE_TABLE, XML_DEFAULT_CELL_STYLE_NAME, sDefaultCellStyle );
+ sDefaultCellStyle = pTableInfo->maDefaultRowCellStyles[rowIndex];
+ if( sDefaultCellStyle.getLength() )
+ mrExport.AddAttribute(XML_NAMESPACE_TABLE, XML_DEFAULT_CELL_STYLE_NAME, sDefaultCellStyle );
+ }
// write row element
SvXMLElementExport tableRowElement( mrExport, XML_NAMESPACE_TABLE, XML_TABLE_ROW, sal_True, sal_True );