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 /editeng/source | |
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 'editeng/source')
-rw-r--r-- | editeng/source/editeng/eehtml.cxx | 6 | ||||
-rw-r--r-- | editeng/source/editeng/eertfpar.cxx | 4 | ||||
-rw-r--r-- | editeng/source/items/bulitem.cxx | 2 | ||||
-rw-r--r-- | editeng/source/items/textitem.cxx | 4 | ||||
-rw-r--r-- | editeng/source/misc/acorrcfg.cxx | 8 |
5 files changed, 12 insertions, 12 deletions
diff --git a/editeng/source/editeng/eehtml.cxx b/editeng/source/editeng/eehtml.cxx index d7f7bda645f6..6322c4b194dd 100644 --- a/editeng/source/editeng/eehtml.cxx +++ b/editeng/source/editeng/eehtml.cxx @@ -662,13 +662,13 @@ void EditHTMLParser::ImpSetStyleSheet( sal_uInt16 nHLevel ) if ( nHLevel == STYLE_PRE ) { vcl::Font aFont = OutputDevice::GetDefaultFont( DefaultFontType::FIXED, LANGUAGE_SYSTEM, GetDefaultFontFlags::NONE ); - SvxFontItem aFontItem( aFont.GetFamilyType(), aFont.GetFamilyName(), OUString(), aFont.GetPitch(), aFont.GetCharSet(), EE_CHAR_FONTINFO ); + SvxFontItem aFontItem( aFont.GetFamilyTypeMaybeAskConfig(), aFont.GetFamilyName(), OUString(), aFont.GetPitchMaybeAskConfig(), aFont.GetCharSet(), EE_CHAR_FONTINFO ); aItems.Put( aFontItem ); - SvxFontItem aFontItemCJK( aFont.GetFamilyType(), aFont.GetFamilyName(), OUString(), aFont.GetPitch(), aFont.GetCharSet(), EE_CHAR_FONTINFO_CJK ); + SvxFontItem aFontItemCJK( aFont.GetFamilyTypeMaybeAskConfig(), aFont.GetFamilyName(), OUString(), aFont.GetPitchMaybeAskConfig(), aFont.GetCharSet(), EE_CHAR_FONTINFO_CJK ); aItems.Put( aFontItemCJK ); - SvxFontItem aFontItemCTL( aFont.GetFamilyType(), aFont.GetFamilyName(), OUString(), aFont.GetPitch(), aFont.GetCharSet(), EE_CHAR_FONTINFO_CTL ); + SvxFontItem aFontItemCTL( aFont.GetFamilyTypeMaybeAskConfig(), aFont.GetFamilyName(), OUString(), aFont.GetPitchMaybeAskConfig(), aFont.GetCharSet(), EE_CHAR_FONTINFO_CTL ); aItems.Put( aFontItemCTL ); } diff --git a/editeng/source/editeng/eertfpar.cxx b/editeng/source/editeng/eertfpar.cxx index 3170279eb7e9..3a244b061493 100644 --- a/editeng/source/editeng/eertfpar.cxx +++ b/editeng/source/editeng/eertfpar.cxx @@ -156,8 +156,8 @@ void EditRTFParser::AddRTFDefaultValues( const EditPaM& rStart, const EditPaM& r aSz = mpEditEngine->GetRefDevice()->LogicToLogic(aSz, &aPntMode, &_aEditMapMode); SvxFontHeightItem aFontHeightItem( aSz.Width(), 100, EE_CHAR_FONTHEIGHT ); vcl::Font aDefFont( GetFont( nDefFont ) ); - SvxFontItem aFontItem( aDefFont.GetFamilyType(), aDefFont.GetFamilyName(), - aDefFont.GetStyleName(), aDefFont.GetPitch(), aDefFont.GetCharSet(), EE_CHAR_FONTINFO ); + SvxFontItem aFontItem( aDefFont.GetFamilyTypeMaybeAskConfig(), aDefFont.GetFamilyName(), + aDefFont.GetStyleName(), aDefFont.GetPitchMaybeAskConfig(), aDefFont.GetCharSet(), EE_CHAR_FONTINFO ); sal_Int32 nStartPara = mpEditEngine->GetEditDoc().GetPos( rStart.GetNode() ); sal_Int32 nEndPara = mpEditEngine->GetEditDoc().GetPos( rEnd.GetNode() ); diff --git a/editeng/source/items/bulitem.cxx b/editeng/source/items/bulitem.cxx index 769179748b40..84ddc4a9de1f 100644 --- a/editeng/source/items/bulitem.cxx +++ b/editeng/source/items/bulitem.cxx @@ -64,7 +64,7 @@ void SvxBulletItem::CopyValidProperties( const SvxBulletItem& rCopyFrom ) vcl::Font _aFont = GetFont(); vcl::Font aNewFont = rCopyFrom.GetFont(); _aFont.SetFamilyName( aNewFont.GetFamilyName() ); - _aFont.SetFamily( aNewFont.GetFamilyType() ); + _aFont.SetFamily( aNewFont.GetFamilyTypeMaybeAskConfig() ); _aFont.SetStyleName( aNewFont.GetStyleName() ); _aFont.SetColor( aNewFont.GetColor() ); SetSymbol( rCopyFrom.cSymbol ); diff --git a/editeng/source/items/textitem.cxx b/editeng/source/items/textitem.cxx index 22647b09669f..5adfabe97c72 100644 --- a/editeng/source/items/textitem.cxx +++ b/editeng/source/items/textitem.cxx @@ -2931,10 +2931,10 @@ void GetDefaultFonts( SvxFontItem& rLatin, SvxFontItem& rAsian, SvxFontItem& rCo aOutTypeArr[ n ].nLanguage, GetDefaultFontFlags::OnlyOne ) ); SvxFontItem* pItem = aItemArr[ n ]; - pItem->SetFamily( aFont.GetFamilyType() ); + pItem->SetFamily( aFont.GetFamilyTypeMaybeAskConfig() ); pItem->SetFamilyName( aFont.GetFamilyName() ); pItem->SetStyleName( OUString() ); - pItem->SetPitch( aFont.GetPitch()); + pItem->SetPitch( aFont.GetPitchMaybeAskConfig()); pItem->SetCharSet(aFont.GetCharSet()); } } diff --git a/editeng/source/misc/acorrcfg.cxx b/editeng/source/misc/acorrcfg.cxx index f1f1825c523a..6b634e473c1c 100644 --- a/editeng/source/misc/acorrcfg.cxx +++ b/editeng/source/misc/acorrcfg.cxx @@ -627,11 +627,11 @@ void SvxSwAutoCorrCfg::ImplCommit() // "Format/Option/ChangeToBullets/SpecialCharacter/Char" css::uno::Any(rSwFlags.aBulletFont.GetFamilyName()), // "Format/Option/ChangeToBullets/SpecialCharacter/Font" - css::uno::Any(sal_Int32(rSwFlags.aBulletFont.GetFamilyType())), + css::uno::Any(sal_Int32(rSwFlags.aBulletFont.GetFamilyTypeMaybeAskConfig())), // "Format/Option/ChangeToBullets/SpecialCharacter/FontFamily" css::uno::Any(sal_Int32(rSwFlags.aBulletFont.GetCharSet())), // "Format/Option/ChangeToBullets/SpecialCharacter/FontCharset" - css::uno::Any(sal_Int32(rSwFlags.aBulletFont.GetPitch())), + css::uno::Any(sal_Int32(rSwFlags.aBulletFont.GetPitchMaybeAskConfig())), // "Format/Option/ChangeToBullets/SpecialCharacter/FontPitch" css::uno::Any(rSwFlags.bRightMargin), // "Format/Option/CombineParagraphs" @@ -671,11 +671,11 @@ void SvxSwAutoCorrCfg::ImplCommit() // "Format/ByInput/ApplyNumbering/SpecialCharacter/Char" css::uno::Any(rSwFlags.aByInputBulletFont.GetFamilyName()), // "Format/ByInput/ApplyNumbering/SpecialCharacter/Font" - css::uno::Any(sal_Int32(rSwFlags.aByInputBulletFont.GetFamilyType())), + css::uno::Any(sal_Int32(rSwFlags.aByInputBulletFont.GetFamilyTypeMaybeAskConfig())), // "Format/ByInput/ApplyNumbering/SpecialCharacter/FontFamily" css::uno::Any(sal_Int32(rSwFlags.aByInputBulletFont.GetCharSet())), // "Format/ByInput/ApplyNumbering/SpecialCharacter/FontCharset" - css::uno::Any(sal_Int32(rSwFlags.aByInputBulletFont.GetPitch())), + css::uno::Any(sal_Int32(rSwFlags.aByInputBulletFont.GetPitchMaybeAskConfig())), // "Format/ByInput/ApplyNumbering/SpecialCharacter/FontPitch" css::uno::Any(rSwFlags.bSetDOIAttr), css::uno::Any(rSwFlags.bSetNumRuleAfterSpace), // "Format/ByInput/ApplyNumberingAfterSpace" |