Skip to content

Commit dc50abb

Browse files
author
Noel Grandin
committed
use more TypedWhichInfo
Change-Id: I406c5d070e3dd197b2cf819d63212d5a40a8eadc Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152309 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
1 parent fc4f7db commit dc50abb

File tree

9 files changed

+27
-30
lines changed

9 files changed

+27
-30
lines changed

cui/source/tabpages/numfmt.cxx

+1-1
Original file line numberDiff line numberDiff line change
@@ -672,7 +672,7 @@ bool SvxNumberFormatTabPage::FillItemSet( SfxItemSet* rCoreAttrs )
672672
if ( bDataChanged )
673673
{
674674
const SfxItemSet& rMyItemSet = GetItemSet();
675-
sal_uInt16 nWhich = GetWhich( SID_ATTR_NUMBERFORMAT_VALUE );
675+
TypedWhichId<SfxUInt32Item> nWhich = GetWhich( SID_ATTR_NUMBERFORMAT_VALUE );
676676
SfxItemState eItemState = rMyItemSet.GetItemState( nWhich, false );
677677

678678
// OK chosen - Is format code input entered already taken over?

include/svx/svxids.hrc

+6-6
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ class XFillGradientItem;
164164
#define ID_VAL_DASHES (SID_SD_START+243)
165165
#define ID_VAL_DASHLEN (SID_SD_START+244)
166166
#define ID_VAL_DISTANCE (SID_SD_START+245)
167-
#define ID_VAL_INDEX (SID_SD_START+246)
167+
#define ID_VAL_INDEX TypedWhichId<SfxUInt32Item>(SID_SD_START+246)
168168
#define SID_BEZIERTO (SID_SD_START+252)
169169
#define SID_DASH (SID_SD_START+267)
170170
#define SID_TEXT_FITTOSIZE_VERTICAL TypedWhichId<SfxBoolItem>(SID_SD_START+286)
@@ -510,7 +510,7 @@ class XFillGradientItem;
510510
#define SID_TABLE_INSERT_ROW_AFTER ( SID_SVX_START + 421 )
511511

512512
#define SID_ATTR_3D_INTERN TypedWhichId<SfxUInt32Item>( SID_SVX_START + 422 )
513-
#define SID_PSZ_FUNCTION ( SID_SVX_START + 423 )
513+
#define SID_PSZ_FUNCTION TypedWhichId<SfxUInt32Item>( SID_SVX_START + 423 )
514514

515515
// CAUTION! <424 > used by sfxids (!)
516516
#define SID_TABLE_INSERT_COL_DLG ( SID_SVX_START + 426 )
@@ -616,7 +616,7 @@ class XFillGradientItem;
616616
#define SID_FM_DESIGN_MODE TypedWhichId<SfxBoolItem>( SID_SVX_START + 629 )
617617
#define SID_FM_RECORD_UNDO ( SID_SVX_START + 630 )
618618
#define SID_FM_CONTROL_IDENTIFIER TypedWhichId<SfxUInt16Item>( SID_SVX_START + 631 )
619-
#define SID_FM_CONTROL_INVENTOR ( SID_SVX_START + 632 )
619+
#define SID_FM_CONTROL_INVENTOR TypedWhichId<SfxUInt32Item>( SID_SVX_START + 632 )
620620
#define SID_FM_SHOW_FMEXPLORER ( SID_SVX_START + 633 )
621621
#define SID_FM_FIELDS_CONTROL ( SID_SVX_START + 634 )
622622
#define SID_FM_SHOW_PROPERTIES TypedWhichId<SfxBoolItem>( SID_SVX_START + 635 )
@@ -863,11 +863,11 @@ class XFillGradientItem;
863863
#define SID_DISABLE_SVXEXTPARAGRAPHTABPAGE_PAGEBREAK ( SID_SVX_START + 1027 )
864864
#define SID_SVXPARAALIGNTABPAGE_ENABLEJUSTIFYEXT ( SID_SVX_START + 1028 )
865865
#define SID_SVXSTDPARAGRAPHTABPAGE_PAGEWIDTH TypedWhichId<SfxUInt16Item>( SID_SVX_START + 1029 )
866-
#define SID_SVXSTDPARAGRAPHTABPAGE_FLAGSET ( SID_SVX_START + 1030 )
867-
#define SID_SVXSTDPARAGRAPHTABPAGE_ABSLINEDIST ( SID_SVX_START + 1031 )
866+
#define SID_SVXSTDPARAGRAPHTABPAGE_FLAGSET TypedWhichId<SfxUInt32Item>( SID_SVX_START + 1030 )
867+
#define SID_SVXSTDPARAGRAPHTABPAGE_ABSLINEDIST TypedWhichId<SfxUInt32Item>( SID_SVX_START + 1031 )
868868
#define SID_SVXTABULATORTABPAGE_DISABLEFLAGS TypedWhichId<SfxUInt16Item>( SID_SVX_START + 1032 )
869869
#define SID_SVXTEXTATTRPAGE_OBJKIND ( SID_SVX_START + 1033 )
870-
#define SID_FLAG_TYPE ( SID_SVX_START + 1034 )
870+
#define SID_FLAG_TYPE TypedWhichId<SfxUInt32Item>( SID_SVX_START + 1034 )
871871
#define SID_SWMODE_TYPE TypedWhichId<SfxUInt16Item>( SID_SVX_START + 1035 )
872872
#define SID_DISABLE_CTL TypedWhichId<SfxUInt16Item>( SID_SVX_START + 1036 )
873873
#define SID_INSERT_HYPERLINKCONTROL ( SID_SVX_START + 1037 )

sc/source/ui/app/scmod.cxx

+1-3
Original file line numberDiff line numberDiff line change
@@ -418,9 +418,7 @@ void ScModule::Execute( SfxRequest& rReq )
418418
case SID_PSZ_FUNCTION:
419419
if (pReqArgs)
420420
{
421-
auto const & p = pReqArgs->Get(SID_PSZ_FUNCTION);
422-
assert(dynamic_cast<const SfxUInt32Item*>(&p) && "wrong Parameter");
423-
const SfxUInt32Item& rItem = static_cast<const SfxUInt32Item&>(p);
421+
const SfxUInt32Item & rItem = pReqArgs->Get(SID_PSZ_FUNCTION);
424422

425423
ScAppOptions aNewOpts( GetAppOptions() );
426424
aNewOpts.SetStatusFunc( rItem.GetValue() );

sd/inc/app.hrc

+8-8
Original file line numberDiff line numberDiff line change
@@ -239,7 +239,7 @@
239239
// In svxids.hrc: ID_VAL_ANGLEEND (SID_SD_START+209)
240240
// In svxids.hrc: ID_VAL_CENTER_X (SID_SD_START+210)
241241
// In svxids.hrc: ID_VAL_CENTER_Y (SID_SD_START+211)
242-
#define ID_VAL_WHATPAGE (SID_SD_START+212)
242+
#define ID_VAL_WHATPAGE TypedWhichId<SfxUInt32Item>(SID_SD_START+212)
243243
#define ID_VAL_WHATLAYER (SID_SD_START+213)
244244
#define ID_VAL_ANGLE (SID_SD_START+214)
245245
#define ID_VAL_MIRRORVERT (SID_SD_START+215)
@@ -253,7 +253,7 @@
253253
#define ID_VAL_PAGERIGHT (SID_SD_START+223)
254254
#define ID_VAL_SCALEOBJECTS (SID_SD_START+224)
255255
#define ID_VAL_PAGENAME TypedWhichId<SfxStringItem>(SID_SD_START+225)
256-
#define ID_VAL_WHATLAYOUT (SID_SD_START+226)
256+
#define ID_VAL_WHATLAYOUT TypedWhichId<SfxUInt32Item>(SID_SD_START+226)
257257
#define ID_VAL_ISPAGEBACK (SID_SD_START+227)
258258
#define ID_VAL_ISPAGEOBJ (SID_SD_START+228)
259259
#define ID_VAL_LAYERNAME (SID_SD_START+229)
@@ -297,9 +297,9 @@
297297
#define SID_RENAMEPAGE (SID_SD_START+268)
298298
#define SID_RENAMELAYER (SID_SD_START+269)
299299
#define SID_HATCH (SID_SD_START+270)
300-
#define SID_GETFILLSTYLE (SID_SD_START+271)
301-
#define SID_GETLINESTYLE (SID_SD_START+272)
302-
#define SID_GETLINEWIDTH (SID_SD_START+273)
300+
#define SID_GETFILLSTYLE TypedWhichId<SfxUInt32Item>(SID_SD_START+271)
301+
#define SID_GETLINESTYLE TypedWhichId<SfxUInt32Item>(SID_SD_START+272)
302+
#define SID_GETLINEWIDTH TypedWhichId<SfxUInt32Item>(SID_SD_START+273)
303303
#define SID_SETLINECOLOR (SID_SD_START+274)
304304
#define SID_SETHATCHCOLOR (SID_SD_START+275)
305305
#define SID_SETGRADSTARTCOLOR (SID_SD_START+276)
@@ -313,7 +313,7 @@
313313
#define SID_TEXT_FITTOSIZE (SID_SD_START+285)
314314
// In svxids.hrc: SID_TEXT_FITTOSIZE_VERTICAL (SID_SD_START+286)
315315
#define SID_NAVIGATOR_PAGENAME TypedWhichId<SfxStringItem>(SID_SD_START+287)
316-
#define SID_NAVIGATOR_STATE (SID_SD_START+288)
316+
#define SID_NAVIGATOR_STATE TypedWhichId<SfxUInt32Item>(SID_SD_START+288)
317317
#define SID_NAVIGATOR_INIT (SID_SD_START+289)
318318
// FREE
319319
#define SID_NAVIGATOR_PAGE TypedWhichId<SfxUInt16Item>(SID_SD_START+292)
@@ -414,7 +414,7 @@
414414
// FREE
415415
#define SID_INSERT_PAGE_NUMBER (SID_SD_START+411)
416416
#define SID_INSERT_DATE_TIME (SID_SD_START+412)
417-
#define SID_SDMODE_FLAG (SID_SD_START+413)
417+
#define SID_SDMODE_FLAG TypedWhichId<SfxUInt32Item>(SID_SD_START+413)
418418
// Enum in the middle of IDs...
419419
#define SD_DRAW_MODE 1
420420
#define SD_IMPRESS_MODE 2
@@ -436,7 +436,7 @@
436436
#define SID_DELETE_MASTER_PAGE (SID_SD_START+432)
437437
#define SID_RENAME_MASTER_PAGE (SID_SD_START+433)
438438
#define SID_CLOSE_MASTER_VIEW (SID_SD_START+434)
439-
#define SID_ASSIGN_LAYOUT (SID_SD_START+435)
439+
#define SID_ASSIGN_LAYOUT TypedWhichId<SfxUInt32Item>(SID_SD_START+435)
440440
#define SID_DISPLAY_MASTER_BACKGROUND (SID_SD_START+436)
441441
#define SID_DISPLAY_MASTER_OBJECTS (SID_SD_START+437)
442442
#define SID_INSERTPAGE_LAYOUT_MENU (SID_SD_START+438)

sd/inc/sdattr.hrc

+4-3
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
class SdOptionsPrintItem;
2525
class SfxInt32Item;
2626
class SfxStringItem;
27+
class SfxUInt32Item;
2728
class XColorItem;
2829

2930
// Layer attributes
@@ -51,7 +52,7 @@ class XColorItem;
5152
#define ATTR_PRESENT_ALWAYS_ON_TOP ATTR_PRESENT_START + 9
5253
#define ATTR_PRESENT_FULLSCREEN ATTR_PRESENT_START + 10
5354
#define ATTR_PRESENT_ANIMATION_ALLOWED ATTR_PRESENT_START + 12
54-
#define ATTR_PRESENT_PAUSE_TIMEOUT ATTR_PRESENT_START + 13
55+
#define ATTR_PRESENT_PAUSE_TIMEOUT TypedWhichId<SfxUInt32Item>(ATTR_PRESENT_START + 13)
5556
#define ATTR_PRESENT_SHOW_PAUSELOGO ATTR_PRESENT_START + 14
5657
#define ATTR_PRESENT_DISPLAY TypedWhichId<SfxInt32Item>(ATTR_PRESENT_START + 15)
5758
#define ATTR_PRESENT_SHOW_NAVIGATION_BUTTONS ATTR_PRESENT_START + 16
@@ -108,8 +109,8 @@ class XColorItem;
108109
#define ATTR_OPTIONS_SCALE_START ATTR_OPTIONS_END + 1
109110
#define ATTR_OPTIONS_SCALE_X TypedWhichId<SfxInt32Item>(ATTR_OPTIONS_SCALE_START)
110111
#define ATTR_OPTIONS_SCALE_Y TypedWhichId<SfxInt32Item>(ATTR_OPTIONS_SCALE_START + 1)
111-
#define ATTR_OPTIONS_SCALE_WIDTH ATTR_OPTIONS_SCALE_START + 2
112-
#define ATTR_OPTIONS_SCALE_HEIGHT ATTR_OPTIONS_SCALE_START + 3
112+
#define ATTR_OPTIONS_SCALE_WIDTH TypedWhichId<SfxUInt32Item>(ATTR_OPTIONS_SCALE_START + 2)
113+
#define ATTR_OPTIONS_SCALE_HEIGHT TypedWhichId<SfxUInt32Item>(ATTR_OPTIONS_SCALE_START + 3)
113114
#define ATTR_OPTIONS_SCALE_END ATTR_OPTIONS_SCALE_HEIGHT
114115

115116
#define ATTR_PRESLAYOUT_START ATTR_OPTIONS_SCALE_END + 1

sd/source/ui/dlg/present.cxx

+1-1
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ SdStartPresentationDlg::SdStartPresentationDlg(weld::Window* pWindow, const SfxI
117117

118118
const bool bEndless = static_cast<const SfxBoolItem&>( rOutAttrs.Get( ATTR_PRESENT_ENDLESS ) ).GetValue();
119119
const bool bWindow = !static_cast<const SfxBoolItem&>( rOutAttrs.Get( ATTR_PRESENT_FULLSCREEN ) ).GetValue();
120-
const tools::Long nPause = static_cast<const SfxUInt32Item&>( rOutAttrs.Get( ATTR_PRESENT_PAUSE_TIMEOUT ) ).GetValue();
120+
const tools::Long nPause = rOutAttrs.Get( ATTR_PRESENT_PAUSE_TIMEOUT ).GetValue();
121121

122122
m_xFormatter->SetTime( tools::Time( 0, 0, nPause ) );
123123
// set cursor in timefield to end

sd/source/ui/dlg/tpoption.cxx

+2-4
Original file line numberDiff line numberDiff line change
@@ -450,10 +450,8 @@ void SdTpOptionsMisc::Reset( const SfxItemSet* rAttrs )
450450
//Scale
451451
sal_Int32 nX = rAttrs->Get( ATTR_OPTIONS_SCALE_X ).GetValue();
452452
sal_Int32 nY = rAttrs->Get( ATTR_OPTIONS_SCALE_Y ).GetValue();
453-
nWidth = static_cast<const SfxUInt32Item&>( rAttrs->
454-
Get( ATTR_OPTIONS_SCALE_WIDTH ) ).GetValue();
455-
nHeight = static_cast<const SfxUInt32Item&>( rAttrs->
456-
Get( ATTR_OPTIONS_SCALE_HEIGHT ) ).GetValue();
453+
nWidth = rAttrs->Get( ATTR_OPTIONS_SCALE_WIDTH ).GetValue();
454+
nHeight = rAttrs->Get( ATTR_OPTIONS_SCALE_HEIGHT ).GetValue();
457455

458456
m_xCbScale->set_entry_text( GetScale( nX, nY ) );
459457

sd/source/ui/func/fusldlg.cxx

+1-1
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,7 @@ void FuSlideShowDlg::DoExecute( SfxRequest& )
208208
rPresentationSettings.mbFullScreen = bValue;
209209
}
210210

211-
nValue32 = ITEMVALUE( aDlgSet, ATTR_PRESENT_PAUSE_TIMEOUT, SfxUInt32Item );
211+
nValue32 = aDlgSet.Get(ATTR_PRESENT_PAUSE_TIMEOUT).GetValue();
212212
if( nValue32 != rPresentationSettings.mnPauseTimeout )
213213
{
214214
bValuesChanged = true;

sw/inc/cmdid.h

+3-3
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,7 @@ class SwUINumRuleItem;
188188
#define FN_HSCROLL_METRIC TypedWhichId<SfxUInt16Item>(FN_VIEW + 53) /* Metric horizontal scrollbar */
189189
#define FN_VSCROLL_METRIC TypedWhichId<SfxUInt16Item>(FN_VIEW + 54) /* Metric vertical scrollbar */
190190

191-
#define FN_NAV_ELEMENT (FN_VIEW + 55) /* Navigate By drop down controller */
191+
#define FN_NAV_ELEMENT TypedWhichId<SfxUInt32Item>(FN_VIEW + 55) /* Navigate By drop down controller */
192192
#define FN_SCROLL_PREV (FN_VIEW + 57) /* uno:ScrollToPrevious */
193193
#define FN_SCROLL_NEXT (FN_VIEW + 58) /* uno:ScrollToNext */
194194
#define FN_VIEW_HIDE_WHITESPACE (FN_VIEW + 59) /* Hide header, footer, and pagebreak */
@@ -462,8 +462,8 @@ class SwUINumRuleItem;
462462
#define FN_TABLE_MODE_FIX_PROP (FN_FORMAT + 190) /* -"- */
463463
#define FN_TABLE_MODE_VARIABLE (FN_FORMAT + 191) /* -"- */
464464
#define FN_TABLE_BOX_TEXTORIENTATION TypedWhichId<SvxFrameDirectionItem>(FN_FORMAT + 192) /* text orientation of table cells */
465-
#define SID_ATTR_TABLE_ROW_HEIGHT (FN_FORMAT + 193)
466-
#define SID_ATTR_TABLE_COLUMN_WIDTH (FN_FORMAT2 + 194)
465+
#define SID_ATTR_TABLE_ROW_HEIGHT TypedWhichId<SfxUInt32Item>(FN_FORMAT + 193)
466+
#define SID_ATTR_TABLE_COLUMN_WIDTH TypedWhichId<SfxUInt32Item>(FN_FORMAT2 + 194)
467467

468468
#define FN_TABLE_AUTOSUM (FN_FORMAT + 195) /* */
469469

0 commit comments

Comments
 (0)