summaryrefslogtreecommitdiff
path: root/vcl/source/font/font.cxx
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2021-09-13 13:02:14 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2021-09-13 15:05:56 +0200
commit6c7c7bcdbd3e47cad5c6b94e1ed1c5314dbdbf6b (patch)
tree4ab84fa839582aa6922450429d15f3b10cec74a5 /vcl/source/font/font.cxx
parent5979076a14098f6887b61e937cfc9059ff7f2506 (diff)
loplugin:cow_wrapper
check the classes that use o3tl::cow_wrapper so that they don't unnecessarity trigger copies Change-Id: I545e627598217f3e61ba2c384adb8d4f8b404829 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/122030 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'vcl/source/font/font.cxx')
-rw-r--r--vcl/source/font/font.cxx6
1 files changed, 3 insertions, 3 deletions
diff --git a/vcl/source/font/font.cxx b/vcl/source/font/font.cxx
index 275eb5fe97a2..1681159b015a 100644
--- a/vcl/source/font/font.cxx
+++ b/vcl/source/font/font.cxx
@@ -164,7 +164,7 @@ void Font::SetSymbolFlag( bool bSymbol )
}
else
{
- if ( mpImplFont->GetCharSet() == RTL_TEXTENCODING_SYMBOL )
+ if ( std::as_const(*mpImplFont).GetCharSet() == RTL_TEXTENCODING_SYMBOL )
mpImplFont->SetCharSet( RTL_TEXTENCODING_DONTKNOW );
}
}
@@ -830,9 +830,9 @@ const OUString& Font::GetFamilyName() const { return mpImplFont->GetFamilyName()
const OUString& Font::GetStyleName() const { return mpImplFont->maStyleName; }
const Size& Font::GetFontSize() const { return mpImplFont->GetFontSize(); }
-void Font::SetFontHeight( tools::Long nHeight ) { SetFontSize( Size( mpImplFont->GetFontSize().Width(), nHeight ) ); }
+void Font::SetFontHeight( tools::Long nHeight ) { SetFontSize( Size( std::as_const(*mpImplFont).GetFontSize().Width(), nHeight ) ); }
tools::Long Font::GetFontHeight() const { return mpImplFont->GetFontSize().Height(); }
-void Font::SetAverageFontWidth( tools::Long nWidth ) { SetFontSize( Size( nWidth, mpImplFont->GetFontSize().Height() ) ); }
+void Font::SetAverageFontWidth( tools::Long nWidth ) { SetFontSize( Size( nWidth, std::as_const(*mpImplFont).GetFontSize().Height() ) ); }
tools::Long Font::GetAverageFontWidth() const { return mpImplFont->GetFontSize().Width(); }
rtl_TextEncoding Font::GetCharSet() const { return mpImplFont->GetCharSet(); }