diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2022-03-03 09:56:09 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2022-03-03 19:19:39 +0100 |
commit | 0a1031a9ecd1502b1841bde26dde7ad51358c638 (patch) | |
tree | 564e854741e6307d5be08afcad395bca5ce30c16 /sw/source/uibase/shells/txtattr.cxx | |
parent | c1ac79906bde5c902be5cb0ae6b530da96e52169 (diff) |
use SfxItemSet::GetItemIfSet in sw/source/uibase
Change-Id: Ic82df8d321ba2eb94957236264c71c5eb9a940a7
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/130905
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sw/source/uibase/shells/txtattr.cxx')
-rw-r--r-- | sw/source/uibase/shells/txtattr.cxx | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/sw/source/uibase/shells/txtattr.cxx b/sw/source/uibase/shells/txtattr.cxx index ef9d878233c2..44c6ee6aa152 100644 --- a/sw/source/uibase/shells/txtattr.cxx +++ b/sw/source/uibase/shells/txtattr.cxx @@ -39,6 +39,7 @@ #include <editeng/cmapitem.hxx> #include <osl/diagnose.h> #include <paratr.hxx> +#include <editeng/pmdlitem.hxx> #include <fmtinfmt.hxx> #include <wrtsh.hxx> @@ -497,10 +498,10 @@ void SwTextShell::ExecParaAttrArgs(SfxRequest &rReq) { rSh.StartAction(); rSh.StartUndo( SwUndoId::START ); - if ( SfxItemState::SET == aSet.GetItemState(HINT_END,false,&pItem) ) + if ( const SfxStringItem* pHintItem = aSet.GetItemIfSet(HINT_END,false) ) { - if ( !static_cast<const SfxStringItem*>(pItem)->GetValue().isEmpty() ) - rSh.ReplaceDropText(static_cast<const SfxStringItem*>(pItem)->GetValue()); + if ( !pHintItem->GetValue().isEmpty() ) + rSh.ReplaceDropText(pHintItem->GetValue()); } rSh.SetAttrSet(*pDlg->GetOutputItemSet()); rSh.EndUndo( SwUndoId::END ); |