summaryrefslogtreecommitdiff
path: root/starmath
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 /starmath
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 'starmath')
-rw-r--r--starmath/source/mathtype.cxx4
-rw-r--r--starmath/source/smediteng.cxx6
-rw-r--r--starmath/source/symbol.cxx2
-rw-r--r--starmath/source/unomodel.cxx8
4 files changed, 10 insertions, 10 deletions
diff --git a/starmath/source/mathtype.cxx b/starmath/source/mathtype.cxx
index 7a32c0be86fe..af6f39e71019 100644
--- a/starmath/source/mathtype.cxx
+++ b/starmath/source/mathtype.cxx
@@ -3265,9 +3265,9 @@ void MathType::HandleText(SmNode *pNode)
pS->WriteUChar( CHAR );
sal_uInt8 nFace = 0x1;
- if (pNode->GetFont().GetItalic() == ITALIC_NORMAL)
+ if (pNode->GetFont().GetItalicMaybeAskConfig() == ITALIC_NORMAL)
nFace = 0x3;
- else if (pNode->GetFont().GetWeight() == WEIGHT_BOLD)
+ else if (pNode->GetFont().GetWeightMaybeAskConfig() == WEIGHT_BOLD)
nFace = 0x7;
pS->WriteUChar( nFace+128 ); //typeface
sal_uInt16 nChar = pTemp->GetText()[i];
diff --git a/starmath/source/smediteng.cxx b/starmath/source/smediteng.cxx
index 51681f1423a3..23df3b5b71af 100644
--- a/starmath/source/smediteng.cxx
+++ b/starmath/source/smediteng.cxx
@@ -139,9 +139,9 @@ void SmEditEngine::setSmItemPool(SfxItemPool* mpItemPool, const SvtLinguOptions&
vcl::Font aFont = OutputDevice::GetDefaultFont(aFontData.nFontType, nLang,
GetDefaultFontFlags::OnlyOne);
aFont.SetColor(aTextColor);
- mpItemPool->SetUserDefaultItem(SvxFontItem(aFont.GetFamilyType(), aFont.GetFamilyName(),
- aFont.GetStyleName(), aFont.GetPitch(),
- aFont.GetCharSet(), aFontData.nFontInfoId));
+ mpItemPool->SetUserDefaultItem(SvxFontItem(
+ aFont.GetFamilyTypeMaybeAskConfig(), aFont.GetFamilyName(), aFont.GetStyleName(),
+ aFont.GetPitchMaybeAskConfig(), aFont.GetCharSet(), aFontData.nFontInfoId));
}
// Set font heights
diff --git a/starmath/source/symbol.cxx b/starmath/source/symbol.cxx
index 5d5be5deb93a..53ed18e22461 100644
--- a/starmath/source/symbol.cxx
+++ b/starmath/source/symbol.cxx
@@ -268,7 +268,7 @@ void SmSymbolManager::Load()
// make the new symbol a copy but with ITALIC_NORMAL, and add it to iGreek
const SmSym &rSym = *aGreekSymbols[i];
vcl::Font aFont( rSym.GetFace() );
- OSL_ENSURE( aFont.GetItalic() == ITALIC_NONE, "expected Font with ITALIC_NONE, failed." );
+ OSL_ENSURE( aFont.GetItalicMaybeAskConfig() == ITALIC_NONE, "expected Font with ITALIC_NONE, failed." );
aFont.SetItalic( ITALIC_NORMAL );
OUString aSymbolName = "i" + rSym.GetUiName();
SmSym aSymbol( aSymbolName, aFont, rSym.GetCharacter(),
diff --git a/starmath/source/unomodel.cxx b/starmath/source/unomodel.cxx
index 2533444cd371..14e39542f432 100644
--- a/starmath/source/unomodel.cxx
+++ b/starmath/source/unomodel.cxx
@@ -881,10 +881,10 @@ void SmModel::_getPropertyValues( const PropertyMapEntry **ppEntries, Any *pValu
vcl::Font rFont = pSymbol->GetFace();
pDescriptor->sFontName = rFont.GetFamilyName();
pDescriptor->nCharSet = sal::static_int_cast< sal_Int16 >(rFont.GetCharSet());
- pDescriptor->nFamily = sal::static_int_cast< sal_Int16 >(rFont.GetFamilyType());
- pDescriptor->nPitch = sal::static_int_cast< sal_Int16 >(rFont.GetPitch());
- pDescriptor->nWeight = sal::static_int_cast< sal_Int16 >(rFont.GetWeight());
- pDescriptor->nItalic = sal::static_int_cast< sal_Int16 >(rFont.GetItalic());
+ pDescriptor->nFamily = sal::static_int_cast< sal_Int16 >(rFont.GetFamilyTypeMaybeAskConfig());
+ pDescriptor->nPitch = sal::static_int_cast< sal_Int16 >(rFont.GetPitchMaybeAskConfig());
+ pDescriptor->nWeight = sal::static_int_cast< sal_Int16 >(rFont.GetWeightMaybeAskConfig());
+ pDescriptor->nItalic = sal::static_int_cast< sal_Int16 >(rFont.GetItalicMaybeAskConfig());
pDescriptor++;
}
*pValue <<= aSequence;