diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2017-11-20 09:25:11 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2017-11-21 11:32:43 +0100 |
commit | a60ffa6985dec32cc73032a7774f58694a6ee9a7 (patch) | |
tree | e94b9c586e6db1dde0a69aeddbe067bf8be2a47d /sw/source/filter/xml/xmltble.cxx | |
parent | 466c3564058aae4946cdd21eab9dfef529554d90 (diff) |
loplugin:flatten in sw
Change-Id: I64176f48d90303f078e326c8838da9eb2daf8126
Reviewed-on: https://gerrit.libreoffice.org/44937
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sw/source/filter/xml/xmltble.cxx')
-rw-r--r-- | sw/source/filter/xml/xmltble.cxx | 51 |
1 files changed, 26 insertions, 25 deletions
diff --git a/sw/source/filter/xml/xmltble.cxx b/sw/source/filter/xml/xmltble.cxx index 18ed1cd2ef73..775bc175eaab 100644 --- a/sw/source/filter/xml/xmltble.cxx +++ b/sw/source/filter/xml/xmltble.cxx @@ -722,36 +722,37 @@ void SwXMLExport::ExportTableAutoStyles( const SwTableNode& rTableNd ) const SwTable& rTable = rTableNd.GetTable(); const SwFrameFormat *pTableFormat = rTable.GetFrameFormat(); - if( pTableFormat ) - { - sal_Int16 eTabHoriOri = pTableFormat->GetHoriOrient().GetHoriOrient(); - const SwFormatFrameSize& rFrameSize = pTableFormat->GetFrameSize(); + if( !pTableFormat ) + return; - sal_uInt32 nAbsWidth = rFrameSize.GetSize().Width(); - sal_uInt32 nBaseWidth = 0; - sal_Int8 nPrcWidth = rFrameSize.GetWidthPercent(); + sal_Int16 eTabHoriOri = pTableFormat->GetHoriOrient().GetHoriOrient(); + const SwFormatFrameSize& rFrameSize = pTableFormat->GetFrameSize(); - bool bFixAbsWidth = nPrcWidth != 0 || /*text::*/HoriOrientation::NONE == eTabHoriOri - || /*text::*/HoriOrientation::FULL == eTabHoriOri; - if( bFixAbsWidth ) + sal_uInt32 nAbsWidth = rFrameSize.GetSize().Width(); + sal_uInt32 nBaseWidth = 0; + sal_Int8 nPrcWidth = rFrameSize.GetWidthPercent(); + + bool bFixAbsWidth = nPrcWidth != 0 || /*text::*/HoriOrientation::NONE == eTabHoriOri + || /*text::*/HoriOrientation::FULL == eTabHoriOri; + if( bFixAbsWidth ) + { + nBaseWidth = nAbsWidth; + nAbsWidth = pTableFormat->FindLayoutRect(true).Width(); + if( !nAbsWidth ) { - nBaseWidth = nAbsWidth; - nAbsWidth = pTableFormat->FindLayoutRect(true).Width(); - if( !nAbsWidth ) - { - // TODO? - } + // TODO? } - ExportTableFormat( *pTableFormat, nAbsWidth ); - - SwXMLTableColumnsSortByWidth_Impl aExpCols; - SwXMLTableFrameFormatsSort_Impl aExpRows; - SwXMLTableFrameFormatsSort_Impl aExpCells; - SwXMLTableInfo_Impl aTableInfo( &rTable, XML_NAMESPACE_TABLE ); - ExportTableLinesAutoStyles( rTable.GetTabLines(), nAbsWidth, nBaseWidth, - pTableFormat->GetName(), aExpCols, aExpRows, aExpCells, - aTableInfo, true); } + ExportTableFormat( *pTableFormat, nAbsWidth ); + + SwXMLTableColumnsSortByWidth_Impl aExpCols; + SwXMLTableFrameFormatsSort_Impl aExpRows; + SwXMLTableFrameFormatsSort_Impl aExpCells; + SwXMLTableInfo_Impl aTableInfo( &rTable, XML_NAMESPACE_TABLE ); + ExportTableLinesAutoStyles( rTable.GetTabLines(), nAbsWidth, nBaseWidth, + pTableFormat->GetName(), aExpCols, aExpRows, aExpCells, + aTableInfo, true); + } void SwXMLExport::ExportTableBox( const SwTableBox& rBox, |