diff --git a/include/svx/svxids.hrc b/include/svx/svxids.hrc index 237205995053..087c5f9f389e 100644 --- a/include/svx/svxids.hrc +++ b/include/svx/svxids.hrc @@ -936,7 +936,7 @@ class XFillGradientItem; // 1092 is used out of order below #define SID_OBJECT_MIRROR ( SID_SVX_START + 1093 ) -#define SID_DELETE_POSTIT ( SID_SVX_START + 1094 ) +#define SID_DELETE_POSTIT TypedWhichId( SID_SVX_START + 1094 ) #define SID_NEXT_POSTIT ( SID_SVX_START + 1095 ) #define SID_PREVIOUS_POSTIT ( SID_SVX_START + 1096 ) #define SID_DELETEALL_POSTIT ( SID_SVX_START + 1097 ) diff --git a/sd/source/ui/annotations/annotationmanager.cxx b/sd/source/ui/annotations/annotationmanager.cxx index 8790f54673e4..d4ea4efd79e6 100644 --- a/sd/source/ui/annotations/annotationmanager.cxx +++ b/sd/source/ui/annotations/annotationmanager.cxx @@ -381,7 +381,7 @@ void AnnotationManagerImpl::ExecuteDeleteAnnotation(SfxRequest const & rReq) const SfxPoolItem* pPoolItem = nullptr; if( SfxItemState::SET == pArgs->GetItemState( SID_DELETEALLBYAUTHOR_POSTIT, true, &pPoolItem ) ) { - OUString sAuthor( static_cast( pPoolItem )->GetValue() ); + OUString sAuthor( pPoolItem->StaticWhichCast(SID_DELETEALLBYAUTHOR_POSTIT).GetValue() ); DeleteAnnotationsByAuthor( sAuthor ); } } @@ -396,14 +396,14 @@ void AnnotationManagerImpl::ExecuteDeleteAnnotation(SfxRequest const & rReq) if( SfxItemState::SET == pArgs->GetItemState( SID_DELETE_POSTIT, true, &pPoolItem ) ) { uno::Reference xTmpAnnotation; - if (static_cast(pPoolItem)->GetValue() >>= xTmpAnnotation) + if (pPoolItem->StaticWhichCast(SID_DELETE_POSTIT).GetValue() >>= xTmpAnnotation) { xAnnotation = dynamic_cast(xTmpAnnotation.get()); assert(bool(xAnnotation) == bool(xTmpAnnotation) && "must be of concrete type sd::Annotation"); } } if( SfxItemState::SET == pArgs->GetItemState( SID_ATTR_POSTIT_ID, true, &pPoolItem ) ) - nId = static_cast(pPoolItem)->GetValue().toUInt32(); + nId = pPoolItem->StaticWhichCast(SID_ATTR_POSTIT_ID).GetValue().toUInt32(); } if (nId != 0) @@ -585,7 +585,7 @@ void AnnotationManagerImpl::ExecuteReplyToAnnotation( SfxRequest const & rReq ) if( SfxItemState::SET == pArgs->GetItemState( SID_ATTR_POSTIT_ID, true, &pPoolItem ) ) { sal_uInt32 nReplyId = 0; // Id of the comment to reply to - nReplyId = static_cast(pPoolItem)->GetValue().toUInt32(); + nReplyId = pPoolItem->StaticWhichCast(SID_ATTR_POSTIT_ID).GetValue().toUInt32(); xAnnotation = GetAnnotationById(nReplyId); } else if( SfxItemState::SET == pArgs->GetItemState( rReq.GetSlot(), true, &pPoolItem ) ) @@ -599,7 +599,7 @@ void AnnotationManagerImpl::ExecuteReplyToAnnotation( SfxRequest const & rReq ) } if( SfxItemState::SET == pArgs->GetItemState( SID_ATTR_POSTIT_TEXT, true, &pPoolItem ) ) - sReplyText = static_cast( pPoolItem )->GetValue(); + sReplyText = pPoolItem->StaticWhichCast(SID_ATTR_POSTIT_TEXT).GetValue(); } auto* pTextApi = getTextApiObject( xAnnotation );