diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-08-16 16:57:15 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-08-22 13:31:57 +0200 |
commit | 60bc26354763fa3461db49a3e827da552484150d (patch) | |
tree | 5c66cee43f76f556f9a086a67fa8a6e88750c5d5 /svx/source/table | |
parent | 7867e1f1cdd726cb98a236245e3d08557cc3a313 (diff) |
new loplugin:conststringfield
Look for const string fields which can be static, and
mostly convert them to OUStringLiteral
And add a getLength() method to OUStringLiteral to make
the transition easier.
Remove dead code in XclExpRoot::GenerateDefaultEncryptionData,
default password is never empty.
Change-Id: Iae75514d9dbb87289fd5b016222f640abe755091
Reviewed-on: https://gerrit.libreoffice.org/59204
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'svx/source/table')
-rw-r--r-- | svx/source/table/tablelayouter.cxx | 14 | ||||
-rw-r--r-- | svx/source/table/tablelayouter.hxx | 2 | ||||
-rw-r--r-- | svx/source/table/tablertfexporter.cxx | 8 |
3 files changed, 11 insertions, 13 deletions
diff --git a/svx/source/table/tablelayouter.cxx b/svx/source/table/tablelayouter.cxx index 49d0cf9dfa65..bbca0cc47d30 100644 --- a/svx/source/table/tablelayouter.cxx +++ b/svx/source/table/tablelayouter.cxx @@ -51,10 +51,10 @@ namespace sdr { namespace table { static SvxBorderLine gEmptyBorder; +static const OUStringLiteral gsSize( "Size" ); TableLayouter::TableLayouter( const TableModelRef& xTableModel ) : mxTable( xTableModel ) -, msSize( "Size" ) { } @@ -572,7 +572,7 @@ void TableLayouter::LayoutTableWidth( tools::Rectangle& rArea, bool bFit ) } else { - xColSet->getPropertyValue( msSize ) >>= nColWidth; + xColSet->getPropertyValue( gsSize ) >>= nColWidth; } maColumns[nCol].mnSize = nColWidth; @@ -650,7 +650,7 @@ void TableLayouter::LayoutTableWidth( tools::Rectangle& rArea, bool bFit ) if( bFit ) { Reference< XPropertySet > xColSet( xCols->getByIndex(nCol), UNO_QUERY_THROW ); - xColSet->setPropertyValue( msSize, Any( maColumns[nCol].mnSize ) ); + xColSet->setPropertyValue( gsSize, Any( maColumns[nCol].mnSize ) ); } } @@ -732,7 +732,7 @@ void TableLayouter::LayoutTableHeight( tools::Rectangle& rArea, bool bFit ) } else { - xRowSet->getPropertyValue( msSize ) >>= nRowHeight; + xRowSet->getPropertyValue( gsSize ) >>= nRowHeight; } maRows[nRow].mnSize = nRowHeight; @@ -807,7 +807,7 @@ void TableLayouter::LayoutTableHeight( tools::Rectangle& rArea, bool bFit ) if( bFit ) { Reference< XPropertySet > xRowSet( xRows->getByIndex(nRow), UNO_QUERY_THROW ); - xRowSet->setPropertyValue( msSize, Any( maRows[nRow].mnSize ) ); + xRowSet->setPropertyValue( gsSize, Any( maRows[nRow].mnSize ) ); } } @@ -1070,7 +1070,7 @@ void TableLayouter::DistributeColumns( ::tools::Rectangle& rArea, sal_Int32 nFir nWidth = nAllWidth; // last column get round errors Reference< XPropertySet > xColSet( xCols->getByIndex( nCol ), UNO_QUERY_THROW ); - xColSet->setPropertyValue( msSize, Any( nWidth ) ); + xColSet->setPropertyValue( gsSize, Any( nWidth ) ); nAllWidth -= nWidth; } @@ -1120,7 +1120,7 @@ void TableLayouter::DistributeRows( ::tools::Rectangle& rArea, sal_Int32 nFirstR nHeight = nAllHeight; // last row get round errors Reference< XPropertySet > xRowSet( xRows->getByIndex( nRow ), UNO_QUERY_THROW ); - xRowSet->setPropertyValue( msSize, Any( nHeight ) ); + xRowSet->setPropertyValue( gsSize, Any( nHeight ) ); nAllHeight -= nHeight; } diff --git a/svx/source/table/tablelayouter.hxx b/svx/source/table/tablelayouter.hxx index b664daa505c1..b411b5a48883 100644 --- a/svx/source/table/tablelayouter.hxx +++ b/svx/source/table/tablelayouter.hxx @@ -138,8 +138,6 @@ private: BorderLineMap maHorizontalBorders; BorderLineMap maVerticalBorders; - - const OUString msSize; }; } } diff --git a/svx/source/table/tablertfexporter.cxx b/svx/source/table/tablertfexporter.cxx index 1cfaa372da6a..edd0ff610beb 100644 --- a/svx/source/table/tablertfexporter.cxx +++ b/svx/source/table/tablertfexporter.cxx @@ -60,7 +60,6 @@ private: SvStream& mrStrm; SdrTableObj& mrObj; Reference< XTable > mxTable; - const OUString msSize; }; void SdrTableObj::ExportAsRTF( SvStream& rStrm, SdrTableObj& rObj ) @@ -69,11 +68,12 @@ void SdrTableObj::ExportAsRTF( SvStream& rStrm, SdrTableObj& rObj ) aEx.Write(); } +static const OUStringLiteral gsSize( "Size" ); + SdrTableRtfExporter::SdrTableRtfExporter( SvStream& rStrm, SdrTableObj& rObj ) : mrStrm( rStrm ) , mrObj( rObj ) , mxTable( rObj.getTable() ) -, msSize( "Size" ) { } @@ -100,7 +100,7 @@ void SdrTableRtfExporter::Write() { Reference< XPropertySet > xSet( xColumns->getByIndex(nCol), UNO_QUERY_THROW ); sal_Int32 nWidth = 0; - xSet->getPropertyValue( msSize ) >>= nWidth; + xSet->getPropertyValue( gsSize ) >>= nWidth; nPos += HundMMToTwips( nWidth ); aColumnStart.push_back( nPos ); } @@ -129,7 +129,7 @@ void SdrTableRtfExporter::Write() void SdrTableRtfExporter::WriteRow( const Reference< XPropertySet >& xRowSet, sal_Int32 nRow, const std::vector< sal_Int32 >& aColumnStart ) { sal_Int32 nRowHeight = 0; - xRowSet->getPropertyValue( msSize ) >>= nRowHeight; + xRowSet->getPropertyValue( gsSize ) >>= nRowHeight; mrStrm.WriteCharPtr( OOO_STRING_SVTOOLS_RTF_TROWD ).WriteCharPtr( OOO_STRING_SVTOOLS_RTF_TRGAPH ).WriteCharPtr( "30" ).WriteCharPtr( OOO_STRING_SVTOOLS_RTF_TRLEFT ).WriteCharPtr( "-30" ); mrStrm.WriteCharPtr( OOO_STRING_SVTOOLS_RTF_TRRH ).WriteCharPtr( OString::number(nRowHeight).getStr() ); |