diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-10-26 08:37:40 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-10-26 11:20:07 +0200 |
commit | c0cc59adca23580864a2e5cdadf66212246cbfcc (patch) | |
tree | 57413c8efb3ca4a59f3699592353da1c575e345d /editeng | |
parent | 4bf2052e9dbdfcd32a749747c918f2d714010633 (diff) |
loplugin:singlevalfields improvement
look for any kind of types, not just POD types, helps to find
smart pointer fields that are only assigned nullptr
Change-Id: I2d887e98db012f03b646e1023985bcc196285abc
Reviewed-on: https://gerrit.libreoffice.org/62382
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'editeng')
-rw-r--r-- | editeng/source/editeng/eertfpar.cxx | 13 | ||||
-rw-r--r-- | editeng/source/editeng/eertfpar.hxx | 1 |
2 files changed, 6 insertions, 8 deletions
diff --git a/editeng/source/editeng/eertfpar.cxx b/editeng/source/editeng/eertfpar.cxx index dbaf1cfe0b0a..54c585c44560 100644 --- a/editeng/source/editeng/eertfpar.cxx +++ b/editeng/source/editeng/eertfpar.cxx @@ -59,12 +59,13 @@ RtfImportInfo::~RtfImportInfo() { } +static constexpr MapUnit gRTFMapUnit = MapUnit::MapTwip; + EditRTFParser::EditRTFParser( SvStream& rIn, EditSelection aSel, SfxItemPool& rAttrPool, EditEngine* pEditEngine) : SvxRTFParser(rAttrPool, rIn), aCurSel(std::move(aSel)), mpEditEngine(pEditEngine), - aRTFMapMode(MapUnit::MapTwip), nDefFont(0), bLastActionInsertParaBreak(false) { @@ -311,8 +312,7 @@ void EditRTFParser::SetAttrInDoc( SvxRTFItemStackType &rSet ) // #i66167# adapt font heights to destination MapUnit if necessary const MapUnit eDestUnit = mpEditEngine->GetEditDoc().GetItemPool().GetMetric(0); - const MapUnit eSrcUnit = aRTFMapMode.GetMapUnit(); - if (eDestUnit != eSrcUnit) + if (eDestUnit != gRTFMapUnit) { sal_uInt16 const aFntHeightIems[3] = { EE_CHAR_FONTHEIGHT, EE_CHAR_FONTHEIGHT_CJK, EE_CHAR_FONTHEIGHT_CTL }; for (unsigned short aFntHeightIem : aFntHeightIems) @@ -321,7 +321,7 @@ void EditRTFParser::SetAttrInDoc( SvxRTFItemStackType &rSet ) { sal_uInt32 nHeight = static_cast<const SvxFontHeightItem*>(pItem)->GetHeight(); long nNewHeight; - nNewHeight = OutputDevice::LogicToLogic( static_cast<long>(nHeight), eSrcUnit, eDestUnit ); + nNewHeight = OutputDevice::LogicToLogic( static_cast<long>(nHeight), gRTFMapUnit, eDestUnit ); SvxFontHeightItem aFntHeightItem( nNewHeight, 100, aFntHeightIem ); aFntHeightItem.SetProp( @@ -504,9 +504,8 @@ void EditRTFParser::CreateStyleSheets() void EditRTFParser::CalcValue() { const MapUnit eDestUnit = aEditMapMode.GetMapUnit(); - const MapUnit eSrcUnit = aRTFMapMode.GetMapUnit(); - if (eDestUnit != eSrcUnit) - nTokenValue = OutputDevice::LogicToLogic( nTokenValue, eSrcUnit, eDestUnit ); + if (eDestUnit != gRTFMapUnit) + nTokenValue = OutputDevice::LogicToLogic( nTokenValue, gRTFMapUnit, eDestUnit ); } void EditRTFParser::ReadField() diff --git a/editeng/source/editeng/eertfpar.hxx b/editeng/source/editeng/eertfpar.hxx index c289bb8422df..51f750daa589 100644 --- a/editeng/source/editeng/eertfpar.hxx +++ b/editeng/source/editeng/eertfpar.hxx @@ -31,7 +31,6 @@ class EditRTFParser final : public SvxRTFParser private: EditSelection aCurSel; EditEngine* mpEditEngine; - MapMode aRTFMapMode; MapMode aEditMapMode; sal_uInt16 nDefFont; |