From 599ab8dc3ae9d8b8749b6400e87d98a6dad2a03c Mon Sep 17 00:00:00 2001
From: Mike Kaganski <mike.kaganski@collabora.com>
Date: Wed, 19 Mar 2025 13:23:22 +0500
Subject: 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
---
 sc/qa/unit/helper/qahelper.cxx | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

(limited to 'sc/qa/unit/helper/qahelper.cxx')

diff --git a/sc/qa/unit/helper/qahelper.cxx b/sc/qa/unit/helper/qahelper.cxx
index 635a27585f97..4034ab23e188 100644
--- a/sc/qa/unit/helper/qahelper.cxx
+++ b/sc/qa/unit/helper/qahelper.cxx
@@ -198,10 +198,10 @@ void ScModelTestBase::testFormats(ScDocument* pDoc,std::u16string_view sFormat)
     CPPUNIT_ASSERT_EQUAL_MESSAGE("font size should be 12", tools::Long(240), aFont.GetFontSize().getHeight());
     pPattern = pDoc->GetPattern(0,2,1);
     pPattern->fillFontOnly(aFont);
-    CPPUNIT_ASSERT_EQUAL_MESSAGE("font should be italic", ITALIC_NORMAL, aFont.GetItalic());
+    CPPUNIT_ASSERT_EQUAL_MESSAGE("font should be italic", ITALIC_NORMAL, aFont.GetItalicMaybeAskConfig());
     pPattern = pDoc->GetPattern(0,4,1);
     pPattern->fillFontOnly(aFont);
-    CPPUNIT_ASSERT_EQUAL_MESSAGE("font should be bold", WEIGHT_BOLD, aFont.GetWeight());
+    CPPUNIT_ASSERT_EQUAL_MESSAGE("font should be bold", WEIGHT_BOLD, aFont.GetWeightMaybeAskConfig());
     pPattern = pDoc->GetPattern(1,0,1);
     pPattern->fillFontOnly(aFont);
     pPattern->fillColor(aComplexColor, ScAutoFontColorMode::Raw);
-- 
cgit