summaryrefslogtreecommitdiff
path: root/sd
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2018-03-15 16:40:37 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2018-03-16 08:25:02 +0100
commitb8512a1cc771b0bce7305ed5930524e1527b1cc1 (patch)
tree5459737688a820bd2f15c01093c61e9823441876 /sd
parenta47baea83f761937f5b8b5ed0ee142d3e04386d4 (diff)
use more TypedWhichId in sfxsids
Change-Id: I136427319ce2f1117501517efec2f03019bbf71e Reviewed-on: https://gerrit.libreoffice.org/51339 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sd')
-rw-r--r--sd/inc/app.hrc2
-rw-r--r--sd/source/filter/grf/sdgrffilter.cxx2
-rw-r--r--sd/source/ui/docshell/docshel3.cxx11
-rw-r--r--sd/source/ui/docshell/docshel4.cxx10
-rw-r--r--sd/source/ui/func/fuformatpaintbrush.cxx2
-rw-r--r--sd/source/ui/func/fuscale.cxx4
-rw-r--r--sd/source/ui/func/futempl.cxx6
-rw-r--r--sd/source/ui/view/drviews2.cxx8
-rw-r--r--sd/source/ui/view/drviews3.cxx2
-rw-r--r--sd/source/ui/view/drviewse.cxx2
-rw-r--r--sd/source/ui/view/outlnvs2.cxx8
-rw-r--r--sd/source/ui/view/outlnvsh.cxx2
12 files changed, 27 insertions, 32 deletions
diff --git a/sd/inc/app.hrc b/sd/inc/app.hrc
index 01e55838560e..8571af94c10c 100644
--- a/sd/inc/app.hrc
+++ b/sd/inc/app.hrc
@@ -140,7 +140,7 @@
#define SID_STATUS_PAGE (SID_SD_START+86)
#define SID_STATUS_LAYOUT (SID_SD_START+87)
#define SID_STATUS_SELMODE (SID_SD_START+88)
-#define SID_MODIFIED (SID_SD_START+89)
+#define SID_MODIFIED TypedWhichId<SfxBoolItem>(SID_SD_START+89)
#define SID_OBJECT_CROOK_ROTATE (SID_SD_START+90)
#define SID_OBJECT_CROOK_SLANT (SID_SD_START+91)
#define SID_OBJECT_CROOK_STRETCH (SID_SD_START+92)
diff --git a/sd/source/filter/grf/sdgrffilter.cxx b/sd/source/filter/grf/sdgrffilter.cxx
index d5dd2d1cedfb..522f2bab8fc4 100644
--- a/sd/source/filter/grf/sdgrffilter.cxx
+++ b/sd/source/filter/grf/sdgrffilter.cxx
@@ -289,7 +289,7 @@ bool SdGRFFilter::Export()
// take selection if needed
if( ( SfxItemState::SET == pSet->GetItemState( SID_SELECTION ) )
- && static_cast< const SfxBoolItem& >( pSet->Get( SID_SELECTION ) ).GetValue()
+ && pSet->Get( SID_SELECTION ).GetValue()
&& pDrawViewShell )
{
uno::Reference< view::XSelectionSupplier > xSelectionSupplier(
diff --git a/sd/source/ui/docshell/docshel3.cxx b/sd/source/ui/docshell/docshel3.cxx
index c49841bcb969..de61d9c25eb0 100644
--- a/sd/source/ui/docshell/docshel3.cxx
+++ b/sd/source/ui/docshell/docshel3.cxx
@@ -145,9 +145,9 @@ void DrawDocShell::Execute( SfxRequest& rReq )
if (pReqArgs)
{
- const SvxSearchItem* pSearchItem = static_cast<const SvxSearchItem*>( &pReqArgs->Get(SID_SEARCH_ITEM) );
+ const SvxSearchItem & rSearchItem = pReqArgs->Get(SID_SEARCH_ITEM);
- SD_MOD()->SetSearchItem(std::unique_ptr<SvxSearchItem>(static_cast<SvxSearchItem*>(pSearchItem->Clone())));
+ SD_MOD()->SetSearchItem(std::unique_ptr<SvxSearchItem>(static_cast<SvxSearchItem*>(rSearchItem.Clone())));
}
rReq.Done();
@@ -208,11 +208,10 @@ void DrawDocShell::Execute( SfxRequest& rReq )
if( xFuSearch.is() )
{
- const SvxSearchItem* pSearchItem =
- static_cast<const SvxSearchItem*>( &pReqArgs->Get(SID_SEARCH_ITEM) );
+ const SvxSearchItem& rSearchItem = pReqArgs->Get(SID_SEARCH_ITEM);
- SD_MOD()->SetSearchItem(std::unique_ptr<SvxSearchItem>(static_cast<SvxSearchItem*>( pSearchItem->Clone() )));
- xFuSearch->SearchAndReplace(pSearchItem);
+ SD_MOD()->SetSearchItem(std::unique_ptr<SvxSearchItem>(static_cast<SvxSearchItem*>( rSearchItem.Clone() )));
+ xFuSearch->SearchAndReplace(&rSearchItem);
}
}
diff --git a/sd/source/ui/docshell/docshel4.cxx b/sd/source/ui/docshell/docshel4.cxx
index 33d351e05d15..426b09b7e2d7 100644
--- a/sd/source/ui/docshell/docshel4.cxx
+++ b/sd/source/ui/docshell/docshel4.cxx
@@ -281,13 +281,13 @@ bool DrawDocShell::Load( SfxMedium& rMedium )
if( pSet )
{
- if( ( SfxItemState::SET == pSet->GetItemState(SID_PREVIEW ) ) && static_cast<const SfxBoolItem&>( pSet->Get( SID_PREVIEW ) ).GetValue() )
+ if( ( SfxItemState::SET == pSet->GetItemState(SID_PREVIEW ) ) && pSet->Get( SID_PREVIEW ).GetValue() )
{
mpDoc->SetStarDrawPreviewMode( true );
}
if( SfxItemState::SET == pSet->GetItemState(SID_DOC_STARTPRESENTATION)&&
- static_cast<const SfxBoolItem&>( pSet->Get( SID_DOC_STARTPRESENTATION ) ).GetValue() )
+ pSet->Get( SID_DOC_STARTPRESENTATION ).GetValue() )
{
bStartPresentation = true;
mpDoc->SetStartWithPresentation( true );
@@ -420,7 +420,7 @@ bool DrawDocShell::ImportFrom(SfxMedium &rMedium,
if( pSet )
{
if( SfxItemState::SET == pSet->GetItemState(SID_DOC_STARTPRESENTATION)&&
- static_cast<const SfxBoolItem&>( pSet->Get( SID_DOC_STARTPRESENTATION ) ).GetValue() )
+ pSet->Get( SID_DOC_STARTPRESENTATION ).GetValue() )
{
mpDoc->SetStartWithPresentation( true );
@@ -451,13 +451,13 @@ bool DrawDocShell::ConvertFrom( SfxMedium& rMedium )
SfxItemSet* pSet = rMedium.GetItemSet();
if( pSet )
{
- if( ( SfxItemState::SET == pSet->GetItemState(SID_PREVIEW ) ) && static_cast<const SfxBoolItem&>( pSet->Get( SID_PREVIEW ) ).GetValue() )
+ if( ( SfxItemState::SET == pSet->GetItemState(SID_PREVIEW ) ) && pSet->Get( SID_PREVIEW ).GetValue() )
{
mpDoc->SetStarDrawPreviewMode( true );
}
if( SfxItemState::SET == pSet->GetItemState(SID_DOC_STARTPRESENTATION)&&
- static_cast<const SfxBoolItem&>( pSet->Get( SID_DOC_STARTPRESENTATION ) ).GetValue() )
+ pSet->Get( SID_DOC_STARTPRESENTATION ).GetValue() )
{
bStartPresentation = true;
mpDoc->SetStartWithPresentation( true );
diff --git a/sd/source/ui/func/fuformatpaintbrush.cxx b/sd/source/ui/func/fuformatpaintbrush.cxx
index 1d19e9cc9ebc..bcdf46996c5c 100644
--- a/sd/source/ui/func/fuformatpaintbrush.cxx
+++ b/sd/source/ui/func/fuformatpaintbrush.cxx
@@ -65,7 +65,7 @@ void FuFormatPaintBrush::DoExecute( SfxRequest& rReq )
const SfxItemSet *pArgs = rReq.GetArgs();
if( pArgs && pArgs->Count() >= 1 )
{
- mbPermanent = static_cast<const SfxBoolItem &>(pArgs->Get(SID_FORMATPAINTBRUSH)).GetValue();
+ mbPermanent = pArgs->Get(SID_FORMATPAINTBRUSH).GetValue();
}
if( mpView )
diff --git a/sd/source/ui/func/fuscale.cxx b/sd/source/ui/func/fuscale.cxx
index 7cb45019018d..5b2505985d27 100644
--- a/sd/source/ui/func/fuscale.cxx
+++ b/sd/source/ui/func/fuscale.cxx
@@ -134,11 +134,11 @@ void FuScale::DoExecute( SfxRequest& rReq )
if (!mpViewShell)
return;
- switch (static_cast<const SvxZoomItem &>( aArgs.Get (SID_ATTR_ZOOM)).GetType ())
+ switch ( aArgs.Get (SID_ATTR_ZOOM).GetType ())
{
case SvxZoomType::PERCENT:
{
- nValue = static_cast<const SvxZoomItem &>( aArgs.Get (SID_ATTR_ZOOM)).GetValue ();
+ nValue = aArgs.Get (SID_ATTR_ZOOM).GetValue ();
mpViewShell->SetZoom( nValue );
diff --git a/sd/source/ui/func/futempl.cxx b/sd/source/ui/func/futempl.cxx
index 89c798af391d..d51f9e25e18e 100644
--- a/sd/source/ui/func/futempl.cxx
+++ b/sd/source/ui/func/futempl.cxx
@@ -107,12 +107,12 @@ void FuTemplate::DoExecute( SfxRequest& rReq )
if( pArgs && SfxItemState::SET == pArgs->GetItemState( SID_STYLE_FAMILY,
false, &pItem ))
{
- nFamily = static_cast<SfxStyleFamily>(static_cast<const SfxUInt16Item &>( pArgs->Get( SID_STYLE_FAMILY ) ).GetValue());
+ nFamily = static_cast<SfxStyleFamily>( pArgs->Get( SID_STYLE_FAMILY ).GetValue());
}
else if( pArgs && SfxItemState::SET == pArgs->GetItemState( SID_STYLE_FAMILYNAME,
false, &pItem ))
{
- OUString sFamily = static_cast<const SfxStringItem &>( pArgs->Get( SID_STYLE_FAMILYNAME ) ).GetValue();
+ OUString sFamily = pArgs->Get( SID_STYLE_FAMILYNAME ).GetValue();
if (sFamily == "graphics")
nFamily = SfxStyleFamily::Para;
else
@@ -172,7 +172,7 @@ void FuTemplate::DoExecute( SfxRequest& rReq )
if (pArgs && pArgs->GetItemState(SID_STYLE_REFERENCE) == SfxItemState::SET)
{
- OUString aParentName(static_cast<const SfxStringItem&>( pArgs->Get(SID_STYLE_REFERENCE)).GetValue());
+ OUString aParentName( pArgs->Get(SID_STYLE_REFERENCE).GetValue());
pStyleSheet->SetParent(aParentName);
}
else
diff --git a/sd/source/ui/view/drviews2.cxx b/sd/source/ui/view/drviews2.cxx
index 6ca5cf90da8a..940ac082849e 100644
--- a/sd/source/ui/view/drviews2.cxx
+++ b/sd/source/ui/view/drviews2.cxx
@@ -908,13 +908,11 @@ void DrawViewShell::FuTemporary(SfxRequest& rReq)
if ( pArgs )
{
- SvxZoomType eZT = static_cast<const SvxZoomItem&>( pArgs->
- Get( SID_ATTR_ZOOM ) ).GetType();
+ SvxZoomType eZT = pArgs->Get( SID_ATTR_ZOOM ).GetType();
switch( eZT )
{
case SvxZoomType::PERCENT:
- SetZoom( static_cast<long>(static_cast<const SvxZoomItem&>( pArgs->
- Get( SID_ATTR_ZOOM ) ).GetValue()) );
+ SetZoom( static_cast<long>( pArgs->Get( SID_ATTR_ZOOM ).GetValue()) );
break;
case SvxZoomType::OPTIMAL:
@@ -2145,7 +2143,7 @@ void DrawViewShell::FuTemporary(SfxRequest& rReq)
if (pReqArgs)
{
const SvxHyperlinkItem* pHLItem =
- static_cast<const SvxHyperlinkItem*>( &pReqArgs->Get(SID_HYPERLINK_SETLINK) );
+ &pReqArgs->Get(SID_HYPERLINK_SETLINK);
if (pHLItem->GetInsertMode() == HLINK_FIELD)
{
diff --git a/sd/source/ui/view/drviews3.cxx b/sd/source/ui/view/drviews3.cxx
index 2615d8b7505e..18b5a2978607 100644
--- a/sd/source/ui/view/drviews3.cxx
+++ b/sd/source/ui/view/drviews3.cxx
@@ -331,7 +331,7 @@ void DrawViewShell::ExecCtrl(SfxRequest& rReq)
if ( pIPClient && pIPClient->IsObjectInPlaceActive() )
{
const SfxRectangleItem& rRect =
- static_cast<const SfxRectangleItem&>(rReq.GetArgs()->Get(SID_OBJECTRESIZE));
+ rReq.GetArgs()->Get(SID_OBJECTRESIZE);
::tools::Rectangle aRect( GetActiveWindow()->PixelToLogic( rRect.GetValue() ) );
if ( mpDrawView->AreObjectsMarked() )
diff --git a/sd/source/ui/view/drviewse.cxx b/sd/source/ui/view/drviewse.cxx
index e8111408ef0b..42f4f12e4d19 100644
--- a/sd/source/ui/view/drviewse.cxx
+++ b/sd/source/ui/view/drviewse.cxx
@@ -709,7 +709,7 @@ void DrawViewShell::FuDeleteSelectedObjects()
void DrawViewShell::FuSupport(SfxRequest& rReq)
{
if( rReq.GetSlot() == SID_STYLE_FAMILY && rReq.GetArgs())
- GetDocSh()->SetStyleFamily(static_cast<SfxStyleFamily>(static_cast<const SfxUInt16Item&>(rReq.GetArgs()->Get( SID_STYLE_FAMILY )).GetValue()));
+ GetDocSh()->SetStyleFamily(static_cast<SfxStyleFamily>(rReq.GetArgs()->Get( SID_STYLE_FAMILY ).GetValue()));
// We do not execute a thing during a native slide show
if(SlideShow::IsRunning(GetViewShellBase()) &&
diff --git a/sd/source/ui/view/outlnvs2.cxx b/sd/source/ui/view/outlnvs2.cxx
index 9400154d44a2..ff5a555756c6 100644
--- a/sd/source/ui/view/outlnvs2.cxx
+++ b/sd/source/ui/view/outlnvs2.cxx
@@ -89,13 +89,11 @@ void OutlineViewShell::FuTemporary(SfxRequest &rReq)
if ( pArgs )
{
- SvxZoomType eZT = static_cast<const SvxZoomItem&>( pArgs->
- Get( SID_ATTR_ZOOM ) ).GetType();
+ SvxZoomType eZT = pArgs->Get( SID_ATTR_ZOOM ).GetType();
switch( eZT )
{
case SvxZoomType::PERCENT:
- SetZoom( static_cast<long>(static_cast<const SvxZoomItem&>( pArgs->
- Get( SID_ATTR_ZOOM ) ).GetValue()) );
+ SetZoom( static_cast<long>( pArgs->Get( SID_ATTR_ZOOM ).GetValue()) );
Invalidate( SID_ATTR_ZOOM );
Invalidate( SID_ATTR_ZOOMSLIDER );
break;
@@ -368,7 +366,7 @@ void OutlineViewShell::FuTemporaryModify(SfxRequest &rReq)
if (pReqArgs)
{
const SvxHyperlinkItem* pHLItem =
- static_cast<const SvxHyperlinkItem*>( &pReqArgs->Get(SID_HYPERLINK_SETLINK) );
+ &pReqArgs->Get(SID_HYPERLINK_SETLINK);
SvxFieldItem aURLItem(SvxURLField(pHLItem->GetURL(),
pHLItem->GetName(),
diff --git a/sd/source/ui/view/outlnvsh.cxx b/sd/source/ui/view/outlnvsh.cxx
index 0cf769ead03d..30a4dd6693c1 100644
--- a/sd/source/ui/view/outlnvsh.cxx
+++ b/sd/source/ui/view/outlnvsh.cxx
@@ -411,7 +411,7 @@ void OutlineViewShell::GetCtrlState(SfxItemSet &rSet)
void OutlineViewShell::FuSupport(SfxRequest &rReq)
{
if( rReq.GetSlot() == SID_STYLE_FAMILY && rReq.GetArgs())
- GetDocSh()->SetStyleFamily(static_cast<SfxStyleFamily>(static_cast<const SfxUInt16Item&>(rReq.GetArgs()->Get( SID_STYLE_FAMILY )).GetValue()));
+ GetDocSh()->SetStyleFamily(static_cast<SfxStyleFamily>(rReq.GetArgs()->Get( SID_STYLE_FAMILY ).GetValue()));
bool bPreviewState = false;
sal_uLong nSlot = rReq.GetSlot();