summaryrefslogtreecommitdiff
path: root/sw/source/uibase
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2022-03-01 16:29:12 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2022-03-02 08:30:52 +0100
commit31a8627f0323fad0f85f7859a513dbc039375afb (patch)
treec0b8ca5310c2c56661f02c90c3072c11a01e6576 /sw/source/uibase
parenta12b4d548cd4173d87d8736ec6a484becb44d943 (diff)
add TypedWhichId version of GetWhichOfScript
Change-Id: Ieb93f9525d0cc5b3a23e013f30ddaad6f44890ed Reviewed-on: https://gerrit.libreoffice.org/c/core/+/130796 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sw/source/uibase')
-rw-r--r--sw/source/uibase/shells/annotsh.cxx6
-rw-r--r--sw/source/uibase/shells/drwtxtsh.cxx8
-rw-r--r--sw/source/uibase/shells/textsh.cxx12
3 files changed, 17 insertions, 9 deletions
diff --git a/sw/source/uibase/shells/annotsh.cxx b/sw/source/uibase/shells/annotsh.cxx
index 3246e43bc404..21b249fb00d2 100644
--- a/sw/source/uibase/shells/annotsh.cxx
+++ b/sw/source/uibase/shells/annotsh.cxx
@@ -1762,9 +1762,11 @@ void SwAnnotationShell::InsertSymbol(SfxRequest& rReq)
}
else
{
- aSetDlgFont.reset(static_cast<SvxFontItem*>(aSet.Get( GetWhichOfScript(
+ TypedWhichId<SvxFontItem> nFontWhich =
+ GetWhichOfScript(
SID_ATTR_CHAR_FONT,
- SvtLanguageOptions::GetI18NScriptTypeOfLanguage( GetAppLanguage() ) )).Clone()));
+ SvtLanguageOptions::GetI18NScriptTypeOfLanguage( GetAppLanguage() ) );
+ aSetDlgFont.reset(aSet.Get(nFontWhich).Clone());
}
if (sFontName.isEmpty())
diff --git a/sw/source/uibase/shells/drwtxtsh.cxx b/sw/source/uibase/shells/drwtxtsh.cxx
index 43c35159f671..2416c3a4863c 100644
--- a/sw/source/uibase/shells/drwtxtsh.cxx
+++ b/sw/source/uibase/shells/drwtxtsh.cxx
@@ -701,9 +701,13 @@ void SwDrawTextShell::InsertSymbol(SfxRequest& rReq)
if( pI )
aSetDlgFont.reset(static_cast<SvxFontItem*>(pI->Clone()));
else
- aSetDlgFont.reset(static_cast<SvxFontItem*>(aSet.Get( GetWhichOfScript(
+ {
+ TypedWhichId<SvxFontItem> nFontWhich =
+ GetWhichOfScript(
SID_ATTR_CHAR_FONT,
- SvtLanguageOptions::GetI18NScriptTypeOfLanguage( GetAppLanguage() ) )).Clone()));
+ SvtLanguageOptions::GetI18NScriptTypeOfLanguage( GetAppLanguage() ) );
+ aSetDlgFont.reset(aSet.Get( nFontWhich ).Clone());
+ }
if (sFontName.isEmpty())
sFontName = aSetDlgFont->GetFamilyName();
}
diff --git a/sw/source/uibase/shells/textsh.cxx b/sw/source/uibase/shells/textsh.cxx
index 158e381b1351..8fe5862e3479 100644
--- a/sw/source/uibase/shells/textsh.cxx
+++ b/sw/source/uibase/shells/textsh.cxx
@@ -909,11 +909,11 @@ void SwTextShell::InsertSymbol( SfxRequest& rReq )
}
else
{
- aFont.reset(static_cast<SvxFontItem*>(
- aSet.Get(
+ TypedWhichId<SvxFontItem> nFontWhich =
GetWhichOfScript(
RES_CHRATR_FONT,
- SvtLanguageOptions::GetI18NScriptTypeOfLanguage( GetAppLanguage() ) )).Clone()));
+ SvtLanguageOptions::GetI18NScriptTypeOfLanguage( GetAppLanguage() ) );
+ aFont.reset(aSet.Get(nFontWhich).Clone());
}
if (aFontName.isEmpty())
@@ -966,9 +966,11 @@ void SwTextShell::InsertSymbol( SfxRequest& rReq )
}
else
{
- aFont.reset(static_cast<SvxFontItem*>(aSet.Get( GetWhichOfScript(
+ TypedWhichId<SvxFontItem> nFontWhich =
+ GetWhichOfScript(
RES_CHRATR_FONT,
- SvtLanguageOptions::GetI18NScriptTypeOfLanguage( GetAppLanguage() ) )).Clone()));
+ SvtLanguageOptions::GetI18NScriptTypeOfLanguage( GetAppLanguage() ) );
+ aFont.reset(aSet.Get( nFontWhich ).Clone());
}
}