diff options
Diffstat (limited to 'sw/source')
-rw-r--r-- | sw/source/uibase/shells/annotsh.cxx | 22 |
1 files changed, 10 insertions, 12 deletions
diff --git a/sw/source/uibase/shells/annotsh.cxx b/sw/source/uibase/shells/annotsh.cxx index e83249e9538d..03834f40fda5 100644 --- a/sw/source/uibase/shells/annotsh.cxx +++ b/sw/source/uibase/shells/annotsh.cxx @@ -396,7 +396,7 @@ void SwAnnotationShell::Exec( SfxRequest &rReq ) const SvxFieldItem* pFieldItem = pOLV->GetFieldAtSelection(); - if (pFieldItem && dynamic_cast< const SvxURLField *>( pFieldItem->GetField() ) != nullptr ) + if (pFieldItem && dynamic_cast<const SvxURLField *>(pFieldItem->GetField()) != nullptr) { // Select the field so that it will be deleted during insert ESelection aSel = pOLV->GetSelection(); @@ -940,10 +940,10 @@ void SwAnnotationShell::ExecClpbrd(SfxRequest &rReq) { SotClipboardFormatId nFormat = SotClipboardFormatId::NONE; const SfxPoolItem* pItem; - if ( rReq.GetArgs() && rReq.GetArgs()->GetItemState(nSlot, true, &pItem) == SfxItemState::SET && - dynamic_cast< const SfxUInt32Item *>( pItem ) != nullptr ) + if (rReq.GetArgs() && rReq.GetArgs()->GetItemState(nSlot, true, &pItem) == SfxItemState::SET) { - nFormat = static_cast<SotClipboardFormatId>(static_cast<const SfxUInt32Item*>(pItem)->GetValue()); + if (const SfxUInt32Item* pUInt32Item = dynamic_cast<const SfxUInt32Item *>(pItem)) + nFormat = static_cast<SotClipboardFormatId>(pUInt32Item->GetValue()); } if ( nFormat != SotClipboardFormatId::NONE ) @@ -1063,13 +1063,11 @@ void SwAnnotationShell::StateInsert(SfxItemSet &rSet) if (pFieldItem) { - const SvxFieldData* pField = pFieldItem->GetField(); - - if (dynamic_cast< const SvxURLField *>( pField ) != nullptr) + if (const SvxURLField* pURLField = dynamic_cast<const SvxURLField *>(pFieldItem->GetField())) { - aHLinkItem.SetName(static_cast<const SvxURLField*>( pField)->GetRepresentation()); - aHLinkItem.SetURL(static_cast<const SvxURLField*>( pField)->GetURL()); - aHLinkItem.SetTargetFrame(static_cast<const SvxURLField*>( pField)->GetTargetFrame()); + aHLinkItem.SetName(pURLField->GetRepresentation()); + aHLinkItem.SetURL(pURLField->GetURL()); + aHLinkItem.SetTargetFrame(pURLField->GetTargetFrame()); } } else @@ -1692,8 +1690,8 @@ void SwAnnotationShell::InsertSymbol(SfxRequest& rReq) sSym = static_cast<const SfxStringItem*>(pItem)->GetValue(); const SfxPoolItem* pFtItem = nullptr; pArgs->GetItemState( GetPool().GetWhich(SID_ATTR_SPECIALCHAR), false, &pFtItem); - const SfxStringItem* pFontItem = dynamic_cast<const SfxStringItem*>( pFtItem ); - if ( pFontItem ) + + if (const SfxStringItem* pFontItem = dynamic_cast<const SfxStringItem*>(pFtItem)) sFontName = pFontItem->GetValue(); } |