diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2023-11-15 10:48:27 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2023-11-15 12:04:31 +0100 |
commit | d0e848dab096160b16c4778ba25a40d1e5ff82af (patch) | |
tree | fec4a155c91994a19aa3b13599749a2563329685 /toolkit | |
parent | def8f7699661f3ca9d763b6bd5e81759cf5b4e12 (diff) |
avoid double map lookup
Change-Id: I02018eaaf220c7835756eba6215425bac9cbc6f3
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159432
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'toolkit')
-rw-r--r-- | toolkit/source/controls/unocontrolmodel.cxx | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/toolkit/source/controls/unocontrolmodel.cxx b/toolkit/source/controls/unocontrolmodel.cxx index 76bee95cf2ac..de573b11e1a5 100644 --- a/toolkit/source/controls/unocontrolmodel.cxx +++ b/toolkit/source/controls/unocontrolmodel.cxx @@ -900,8 +900,9 @@ void UnoControlModel::read( const css::uno::Reference< css::io::XObjectInputStre if ( !pFD ) { pFD.reset(new css::awt::FontDescriptor); - if ( maData.find( BASEPROPERTY_FONTDESCRIPTOR ) != maData.end() ) // due to defaults... - maData[ BASEPROPERTY_FONTDESCRIPTOR ] >>= *pFD; + auto it = maData.find( BASEPROPERTY_FONTDESCRIPTOR ); + if ( it != maData.end() ) // due to defaults... + it->second >>= *pFD; } pFD->Name = InStream->readUTF(); pFD->StyleName = InStream->readUTF(); @@ -917,8 +918,9 @@ void UnoControlModel::read( const css::uno::Reference< css::io::XObjectInputStre if ( !pFD ) { pFD.reset(new css::awt::FontDescriptor); - if ( maData.find(BASEPROPERTY_FONTDESCRIPTOR) != maData.end() ) // due to defaults... - maData[BASEPROPERTY_FONTDESCRIPTOR] >>= *pFD; + auto it = maData.find(BASEPROPERTY_FONTDESCRIPTOR); + if ( it != maData.end() ) // due to defaults... + it->second >>= *pFD; } pFD->Width = static_cast<sal_Int16>(InStream->readLong()); pFD->Height = static_cast<sal_Int16>(InStream->readLong()); @@ -934,8 +936,9 @@ void UnoControlModel::read( const css::uno::Reference< css::io::XObjectInputStre if ( !pFD ) { pFD.reset(new css::awt::FontDescriptor); - if ( maData.find(BASEPROPERTY_FONTDESCRIPTOR) != maData.end() ) // due to defaults... - maData[BASEPROPERTY_FONTDESCRIPTOR] >>= *pFD; + auto it = maData.find(BASEPROPERTY_FONTDESCRIPTOR); + if ( it != maData.end() ) // due to defaults... + it->second >>= *pFD; } pFD->Weight = vcl::unohelper::ConvertFontWeight(static_cast<FontWeight>(InStream->readShort())); pFD->Slant = static_cast<css::awt::FontSlant>(InStream->readShort()); |