summaryrefslogtreecommitdiff
path: root/sc/source/ui/view
diff options
context:
space:
mode:
authorMike Kaganski <mike.kaganski@collabora.com>2025-03-19 13:23:22 +0500
committerMike Kaganski <mike.kaganski@collabora.com>2025-03-19 17:24:38 +0100
commit599ab8dc3ae9d8b8749b6400e87d98a6dad2a03c (patch)
tree9e00bf1e54d609ca6a01dc327f377022ab1d31cc /sc/source/ui/view
parent7af8b3d3305fe8344cb9339269c5dc3f1cd44650 (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 'sc/source/ui/view')
-rw-r--r--sc/source/ui/view/cellsh1.cxx2
-rw-r--r--sc/source/ui/view/editsh.cxx4
2 files changed, 3 insertions, 3 deletions
diff --git a/sc/source/ui/view/cellsh1.cxx b/sc/source/ui/view/cellsh1.cxx
index 72f9fba8c945..91a1143f2695 100644
--- a/sc/source/ui/view/cellsh1.cxx
+++ b/sc/source/ui/view/cellsh1.cxx
@@ -2853,7 +2853,7 @@ void ScCellShell::ExecuteEdit( SfxRequest& rReq )
SfxAllItemSet aSet( GetPool() );
aSet.Put( SfxBoolItem( FN_PARAM_1, false ) );
- aSet.Put( SvxFontItem( aCurFont.GetFamilyType(), aCurFont.GetFamilyName(), aCurFont.GetStyleName(), aCurFont.GetPitch(), aCurFont.GetCharSet(), GetPool().GetWhichIDFromSlotID(SID_ATTR_CHAR_FONT) ) );
+ aSet.Put( SvxFontItem( aCurFont.GetFamilyTypeMaybeAskConfig(), aCurFont.GetFamilyName(), aCurFont.GetStyleName(), aCurFont.GetPitchMaybeAskConfig(), aCurFont.GetCharSet(), GetPool().GetWhichIDFromSlotID(SID_ATTR_CHAR_FONT) ) );
SfxViewFrame& rViewFrame = pTabViewShell->GetViewFrame();
auto xFrame = rViewFrame.GetFrame().GetFrameInterface();
VclPtr<SfxAbstractDialog> pDlg(pFact->CreateCharMapDialog(pTabViewShell->GetFrameWeld(), aSet, xFrame));
diff --git a/sc/source/ui/view/editsh.cxx b/sc/source/ui/view/editsh.cxx
index 3e8a5abe7b1d..d080502eeffe 100644
--- a/sc/source/ui/view/editsh.cxx
+++ b/sc/source/ui/view/editsh.cxx
@@ -410,8 +410,8 @@ void ScEditShell::Execute( SfxRequest& rReq )
vcl::Font aFont(aFontName, Size(1,1)); // Size just because CTOR
// tdf#125054 see comment in drtxob.cxx, same ID
aNewItem = std::make_shared<SvxFontItem>(
- aFont.GetFamilyType(), aFont.GetFamilyName(),
- aFont.GetStyleName(), aFont.GetPitch(),
+ aFont.GetFamilyTypeMaybeAskConfig(), aFont.GetFamilyName(),
+ aFont.GetStyleName(), aFont.GetPitchMaybeAskConfig(),
aFont.GetCharSet(), ATTR_FONT);
}
else