diff options
author | Mike Kaganski <mike.kaganski@collabora.com> | 2025-03-19 13:23:22 +0500 |
---|---|---|
committer | Mike Kaganski <mike.kaganski@collabora.com> | 2025-03-19 17:24:38 +0100 |
commit | 599ab8dc3ae9d8b8749b6400e87d98a6dad2a03c (patch) | |
tree | 9e00bf1e54d609ca6a01dc327f377022ab1d31cc /sd | |
parent | 7af8b3d3305fe8344cb9339269c5dc3f1cd44650 (diff) |
Rename con-const vcl::Font property getters for clarity
There are two sets of getters there; and the non-const ones may copy
the COW mpImplFont, and may call its AskConfig.
The name overload is unfortunate. It is not obvious at the call site,
which of the two will be called; and what is different. IMO, the way
to fix it would be to keep only one set of getters (the const one),
and make the call to AskConfig explicit (in the places that set font
name, and know that resolution of other properties will be needed).
But in this change, I only rename the non-const getters, making sure
to keep the behavior unchanged (at least the intention is to have a
non-functional change, meaning that the places that called non-const
overload, now use the renamed functions), to make it clear where we
actually may copy and initialize it.
Change-Id: I9a5cd91d5c1c0de7ff8577b9b982d165e4cdd2c1
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/183116
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Tested-by: Jenkins
Diffstat (limited to 'sd')
-rw-r--r-- | sd/source/core/drawdoc4.cxx | 12 | ||||
-rw-r--r-- | sd/source/core/stlpool.cxx | 6 | ||||
-rw-r--r-- | sd/source/ui/annotations/annotationmanager.cxx | 2 | ||||
-rw-r--r-- | sd/source/ui/func/fubullet.cxx | 4 |
4 files changed, 12 insertions, 12 deletions
diff --git a/sd/source/core/drawdoc4.cxx b/sd/source/core/drawdoc4.cxx index f696c09ae95f..de0005098693 100644 --- a/sd/source/core/drawdoc4.cxx +++ b/sd/source/core/drawdoc4.cxx @@ -194,13 +194,13 @@ void SdDrawDocument::CreateLayoutTemplates() getDefaultFonts( aLatinFont, aCJKFont, aCTLFont ); - SvxFontItem aSvxFontItem( aLatinFont.GetFamilyType(), aLatinFont.GetFamilyName(), aLatinFont.GetStyleName(), aLatinFont.GetPitch(), + SvxFontItem aSvxFontItem( aLatinFont.GetFamilyTypeMaybeAskConfig(), aLatinFont.GetFamilyName(), aLatinFont.GetStyleName(), aLatinFont.GetPitchMaybeAskConfig(), aLatinFont.GetCharSet(), EE_CHAR_FONTINFO ); - SvxFontItem aSvxFontItemCJK( aCJKFont.GetFamilyType(), aCJKFont.GetFamilyName(), aCJKFont.GetStyleName(), aCJKFont.GetPitch(), + SvxFontItem aSvxFontItemCJK( aCJKFont.GetFamilyTypeMaybeAskConfig(), aCJKFont.GetFamilyName(), aCJKFont.GetStyleName(), aCJKFont.GetPitchMaybeAskConfig(), aCJKFont.GetCharSet(), EE_CHAR_FONTINFO_CJK ); - SvxFontItem aSvxFontItemCTL( aCTLFont.GetFamilyType(), aCTLFont.GetFamilyName(), aCTLFont.GetStyleName(), aCTLFont.GetPitch(), + SvxFontItem aSvxFontItemCTL( aCTLFont.GetFamilyTypeMaybeAskConfig(), aCTLFont.GetFamilyName(), aCTLFont.GetStyleName(), aCTLFont.GetPitchMaybeAskConfig(), aCTLFont.GetCharSet(), EE_CHAR_FONTINFO_CTL ); rISet.Put( aSvxFontItem ); @@ -652,13 +652,13 @@ void SdDrawDocument::CreateDefaultCellStyles() getDefaultFonts( aLatinFont, aCJKFont, aCTLFont ); - SvxFontItem aSvxFontItem( aLatinFont.GetFamilyType(), aLatinFont.GetFamilyName(), aLatinFont.GetStyleName(), aLatinFont.GetPitch(), + SvxFontItem aSvxFontItem( aLatinFont.GetFamilyTypeMaybeAskConfig(), aLatinFont.GetFamilyName(), aLatinFont.GetStyleName(), aLatinFont.GetPitchMaybeAskConfig(), aLatinFont.GetCharSet(), EE_CHAR_FONTINFO ); - SvxFontItem aSvxFontItemCJK( aCJKFont.GetFamilyType(), aCJKFont.GetFamilyName(), aCJKFont.GetStyleName(), aCJKFont.GetPitch(), + SvxFontItem aSvxFontItemCJK( aCJKFont.GetFamilyTypeMaybeAskConfig(), aCJKFont.GetFamilyName(), aCJKFont.GetStyleName(), aCJKFont.GetPitchMaybeAskConfig(), aCJKFont.GetCharSet(), EE_CHAR_FONTINFO_CJK ); - SvxFontItem aSvxFontItemCTL( aCTLFont.GetFamilyType(), aCTLFont.GetFamilyName(), aCTLFont.GetStyleName(), aCTLFont.GetPitch(), + SvxFontItem aSvxFontItemCTL( aCTLFont.GetFamilyTypeMaybeAskConfig(), aCTLFont.GetFamilyName(), aCTLFont.GetStyleName(), aCTLFont.GetPitchMaybeAskConfig(), aCTLFont.GetCharSet(), EE_CHAR_FONTINFO_CTL ); SdStyleSheetPool* pSSPool = static_cast<SdStyleSheetPool*>(GetStyleSheetPool()); diff --git a/sd/source/core/stlpool.cxx b/sd/source/core/stlpool.cxx index 23a41e8df5cf..69a5fe18de37 100644 --- a/sd/source/core/stlpool.cxx +++ b/sd/source/core/stlpool.cxx @@ -185,13 +185,13 @@ void SdStyleSheetPool::CreateLayoutStyleSheets(std::u16string_view rLayoutName, mpDoc->getDefaultFonts( aLatinFont, aCJKFont, aCTLFont ); // Font for title and outline - SvxFontItem aSvxFontItem( aLatinFont.GetFamilyType(), aLatinFont.GetFamilyName(), aLatinFont.GetStyleName(), aLatinFont.GetPitch(), + SvxFontItem aSvxFontItem( aLatinFont.GetFamilyTypeMaybeAskConfig(), aLatinFont.GetFamilyName(), aLatinFont.GetStyleName(), aLatinFont.GetPitchMaybeAskConfig(), aLatinFont.GetCharSet(), EE_CHAR_FONTINFO ); - SvxFontItem aSvxFontItemCJK( aCJKFont.GetFamilyType(), aCJKFont.GetFamilyName(), aCJKFont.GetStyleName(), aCJKFont.GetPitch(), + SvxFontItem aSvxFontItemCJK( aCJKFont.GetFamilyTypeMaybeAskConfig(), aCJKFont.GetFamilyName(), aCJKFont.GetStyleName(), aCJKFont.GetPitchMaybeAskConfig(), aCJKFont.GetCharSet(), EE_CHAR_FONTINFO_CJK ); - SvxFontItem aSvxFontItemCTL( aCTLFont.GetFamilyType(), aCTLFont.GetFamilyName(), aCTLFont.GetStyleName(), aCTLFont.GetPitch(), + SvxFontItem aSvxFontItemCTL( aCTLFont.GetFamilyTypeMaybeAskConfig(), aCTLFont.GetFamilyName(), aCTLFont.GetStyleName(), aCTLFont.GetPitchMaybeAskConfig(), aCTLFont.GetCharSet(), EE_CHAR_FONTINFO_CTL ); vcl::Font aBulletFont( GetBulletFont() ); diff --git a/sd/source/ui/annotations/annotationmanager.cxx b/sd/source/ui/annotations/annotationmanager.cxx index cfcfa52ef971..504bbe63adef 100644 --- a/sd/source/ui/annotations/annotationmanager.cxx +++ b/sd/source/ui/annotations/annotationmanager.cxx @@ -113,7 +113,7 @@ SfxItemPool* GetAnnotationPool() s_pAnnotationPool->SetUserDefaultItem(SvxFontHeightItem(423,100,EE_CHAR_FONTHEIGHT)); vcl::Font aAppFont( Application::GetSettings().GetStyleSettings().GetAppFont() ); - s_pAnnotationPool->SetUserDefaultItem(SvxFontItem(aAppFont.GetFamilyType(),aAppFont.GetFamilyName(),u""_ustr,PITCH_DONTKNOW,RTL_TEXTENCODING_DONTKNOW,EE_CHAR_FONTINFO)); + s_pAnnotationPool->SetUserDefaultItem(SvxFontItem(aAppFont.GetFamilyTypeMaybeAskConfig(),aAppFont.GetFamilyName(),u""_ustr,PITCH_DONTKNOW,RTL_TEXTENCODING_DONTKNOW,EE_CHAR_FONTINFO)); } return s_pAnnotationPool.get(); diff --git a/sd/source/ui/func/fubullet.cxx b/sd/source/ui/func/fubullet.cxx index ba2e1d71cc50..299abd1c3641 100644 --- a/sd/source/ui/func/fubullet.cxx +++ b/sd/source/ui/func/fubullet.cxx @@ -257,8 +257,8 @@ void FuBullet::InsertSpecialCharacter( SfxRequest const & rReq ) // set attributes (set font) SfxItemSet aSet(pOL->GetEmptyItemSet()); - SvxFontItem aFontItem (aFont.GetFamilyType(), aFont.GetFamilyName(), - aFont.GetStyleName(), aFont.GetPitch(), + SvxFontItem aFontItem (aFont.GetFamilyTypeMaybeAskConfig(), aFont.GetFamilyName(), + aFont.GetStyleName(), aFont.GetPitchMaybeAskConfig(), aFont.GetCharSet(), EE_CHAR_FONTINFO); aSet.Put(aFontItem); |