diff options
-rw-r--r-- | cui/source/tabpages/page.cxx | 3 | ||||
-rw-r--r-- | cui/source/tabpages/themepage.cxx | 3 | ||||
-rw-r--r-- | include/editeng/editids.hrc | 4 | ||||
-rw-r--r-- | include/editeng/eeitem.hxx | 3 | ||||
-rw-r--r-- | include/sfx2/sfxsids.hrc | 71 | ||||
-rw-r--r-- | include/svx/svxids.hrc | 20 | ||||
-rw-r--r-- | sc/inc/sc.hrc | 67 | ||||
-rw-r--r-- | sc/inc/scitems.hxx | 21 | ||||
-rw-r--r-- | sc/source/ui/dbgui/tpsort.cxx | 4 | ||||
-rw-r--r-- | sc/source/ui/optdlg/tpcalc.cxx | 5 | ||||
-rw-r--r-- | sc/source/ui/optdlg/tpformula.cxx | 3 | ||||
-rw-r--r-- | sc/source/ui/view/cellsh1.cxx | 11 | ||||
-rw-r--r-- | sc/source/ui/view/cellsh2.cxx | 12 | ||||
-rw-r--r-- | sd/inc/app.hrc | 2 | ||||
-rw-r--r-- | sd/inc/sdattr.hrc | 31 | ||||
-rw-r--r-- | sd/source/core/anminfo.cxx | 2 | ||||
-rw-r--r-- | sd/source/ui/dlg/paragr.cxx | 4 | ||||
-rw-r--r-- | sd/source/ui/dlg/tpoption.cxx | 17 | ||||
-rw-r--r-- | sd/source/ui/func/fuprlout.cxx | 8 | ||||
-rw-r--r-- | sw/inc/cmdid.h | 49 | ||||
-rw-r--r-- | sw/source/ui/config/optpage.cxx | 6 | ||||
-rw-r--r-- | sw/source/ui/frmdlg/frmpage.cxx | 2 |
22 files changed, 171 insertions, 177 deletions
diff --git a/cui/source/tabpages/page.cxx b/cui/source/tabpages/page.cxx index f78cda0ee602..69bbbcc10d94 100644 --- a/cui/source/tabpages/page.cxx +++ b/cui/source/tabpages/page.cxx @@ -665,8 +665,7 @@ bool SvxPageDescPage::FillItemSet( SfxItemSet* rSet ) if (rOldSet.HasItem(SID_ATTR_CHAR_GRABBAG)) { // Set gutter position. - SfxGrabBagItem aGrabBagItem( - static_cast<const SfxGrabBagItem&>(rOldSet.Get(SID_ATTR_CHAR_GRABBAG))); + SfxGrabBagItem aGrabBagItem(rOldSet.Get(SID_ATTR_CHAR_GRABBAG)); if (m_xGutterPositionLB->get_value_changed_from_saved()) { bool bGutterAtTop = m_xGutterPositionLB->get_active() == 1; diff --git a/cui/source/tabpages/themepage.cxx b/cui/source/tabpages/themepage.cxx index 35eb9156398a..b175ae8754c3 100644 --- a/cui/source/tabpages/themepage.cxx +++ b/cui/source/tabpages/themepage.cxx @@ -133,8 +133,7 @@ bool SvxThemePage::FillItemSet(SfxItemSet* pAttrs) if (!rOldSet.HasItem(SID_ATTR_CHAR_GRABBAG)) return true; - SfxGrabBagItem aGrabBagItem( - static_cast<const SfxGrabBagItem&>(rOldSet.Get(SID_ATTR_CHAR_GRABBAG))); + SfxGrabBagItem aGrabBagItem(rOldSet.Get(SID_ATTR_CHAR_GRABBAG)); comphelper::SequenceAsHashMap aMap; auto it = aGrabBagItem.GetGrabBag().find("Theme"); diff --git a/include/editeng/editids.hrc b/include/editeng/editids.hrc index ac7c2bf763a9..91456529af23 100644 --- a/include/editeng/editids.hrc +++ b/include/editeng/editids.hrc @@ -88,7 +88,7 @@ class SvxLanguageItem; #define SID_ATTR_PARA_PAGENUM ( SID_SVX_START + 457 ) #define SID_ATTR_PARA_NUMRULE ( SID_SVX_START + 587 ) #define SID_ATTR_BRUSH_CHAR ( SID_SVX_START + 591 ) -#define SID_ATTR_NUMBERING_RULE ( SID_SVX_START + 855 ) +#define SID_ATTR_NUMBERING_RULE TypedWhichId<SvxNumBulletItem>( SID_SVX_START + 855 ) #define SID_ATTR_CHAR_CHARSETCOLOR ( SID_SVX_START + 877 ) #define SID_ATTR_CHAR_CJK_FONT ( SID_SVX_START + 887 ) #define SID_ATTR_CHAR_CJK_FONTHEIGHT ( SID_SVX_START + 888 ) @@ -123,7 +123,7 @@ class SvxLanguageItem; #define SID_ATTR_CHAR_LATIN_LANGUAGE ( SID_SVX_START + 996 ) #define SID_ATTR_CHAR_LATIN_POSTURE ( SID_SVX_START + 997 ) #define SID_ATTR_CHAR_LATIN_WEIGHT ( SID_SVX_START + 998 ) -#define SID_ATTR_CHAR_GRABBAG ( SID_SVX_START + 1142 ) +#define SID_ATTR_CHAR_GRABBAG TypedWhichId<SfxGrabBagItem>( SID_SVX_START + 1142 ) #define SID_ATTR_CHAR_BACK_COLOR ( SID_SVX_START + 1153 ) // these ID didn't exist prior to the svx split, add new ids here diff --git a/include/editeng/eeitem.hxx b/include/editeng/eeitem.hxx index e4908ee59e0c..28e5d8a0dd80 100644 --- a/include/editeng/eeitem.hxx +++ b/include/editeng/eeitem.hxx @@ -36,6 +36,7 @@ class SvxContourItem; class SvxCrossedOutItem; class SvxEmphasisMarkItem; class SvxEscapementItem; +class SvxFieldItem; class SvxFontHeightItem; class SvxFontItem; class SvxForbiddenRuleItem; @@ -134,7 +135,7 @@ constexpr sal_uInt16 EE_FEATURE_START (EE_CHAR_END + 1); constexpr sal_uInt16 EE_FEATURE_TAB (EE_FEATURE_START + 0); constexpr sal_uInt16 EE_FEATURE_LINEBR (EE_FEATURE_TAB + 1); constexpr sal_uInt16 EE_FEATURE_NOTCONV (EE_FEATURE_LINEBR + 1); -constexpr sal_uInt16 EE_FEATURE_FIELD (EE_FEATURE_NOTCONV + 1); +constexpr TypedWhichId<SvxFieldItem> EE_FEATURE_FIELD (EE_FEATURE_NOTCONV + 1); constexpr sal_uInt16 EE_FEATURE_END (EE_FEATURE_FIELD + 0); constexpr sal_uInt16 EE_ITEMS_END (EE_FEATURE_END); diff --git a/include/sfx2/sfxsids.hrc b/include/sfx2/sfxsids.hrc index 7f40ddc2284c..9b36e9c47e4b 100644 --- a/include/sfx2/sfxsids.hrc +++ b/include/sfx2/sfxsids.hrc @@ -23,6 +23,7 @@ #include <svl/memberid.h> #include <svl/typedwhich.hxx> +class SfxAllEnumItem; class SfxBoolItem; class SfxDocumentInfoItem; class SfxEventNamesItem; @@ -99,8 +100,8 @@ class SvxZoomItem; // default-ids for help #define SID_HELPINDEX (SID_SFX_START + 401) #define SID_EXTENDEDHELP (SID_SFX_START + 402) -#define SID_HELPBALLOONS (SID_SFX_START + 403) -#define SID_HELPTIPS (SID_SFX_START + 404) +#define SID_HELPBALLOONS TypedWhichId<SfxBoolItem>(SID_SFX_START + 403) +#define SID_HELPTIPS TypedWhichId<SfxBoolItem>(SID_SFX_START + 404) #define SID_EMOJI_CONTROL (SID_SFX_START + 405) #define SID_CHARMAP_CONTROL (SID_SFX_START + 406) #define SID_TIPOFTHEDAY (SID_SFX_START + 407) @@ -144,7 +145,7 @@ class SvxZoomItem; #define SID_SAVEDOC (SID_SFX_START + 505) #define SID_FILE_NAME (SID_SFX_START + 507) #define SID_DOCINFO_TITLE TypedWhichId<SfxStringItem>(SID_SFX_START + 557) -#define SID_FILE_FILTEROPTIONS (SID_SFX_START + 527) +#define SID_FILE_FILTEROPTIONS TypedWhichId<SfxStringItem>(SID_SFX_START + 527) #define SID_RELOAD (SID_SFX_START + 508) #define SID_PRINTDOCDIRECT (SID_SFX_START + 509) #define SID_DOC_REPAIR (SID_SFX_START + 510) @@ -247,7 +248,7 @@ class SvxZoomItem; #define SID_TERMINATE_INPLACEACTIVATION (SID_SFX_START + 1702) #define SID_APPLY_STYLE (SID_SFX_START + 1703) #define SID_MACRO_SIGNATURE (SID_SFX_START + 1704) -#define SID_ATTR_WARNALIENFORMAT (SID_SFX_START + 1705) +#define SID_ATTR_WARNALIENFORMAT TypedWhichId<SfxBoolItem>(SID_SFX_START + 1705) #define SID_COPY_STREAM_IF_POSSIBLE TypedWhichId<SfxBoolItem>(SID_SFX_START + 1706) #define SID_MAIL_SENDDOCASFORMAT (SID_SFX_START + 1707) #define SID_MAIL_SENDDOCASMS (SID_SFX_START + 1708) @@ -310,7 +311,7 @@ class SvxZoomItem; #define SID_FILTER_NAME TypedWhichId<SfxStringItem>(SID_SFX_START + 530) #define SID_DOC_SALVAGE TypedWhichId<SfxStringItem>(SID_SFX_START + 531) #define SID_INSERTDOC (SID_SFX_START + 532) -#define SID_TYPE_NAME (SID_SFX_START + 533) +#define SID_TYPE_NAME TypedWhichId<SfxStringItem>(SID_SFX_START + 533) #define SID_DOC_READONLY TypedWhichId<SfxBoolItem>(SID_SFX_START + 590) #define SID_DOC_MODIFIED (SID_SFX_START + 584) @@ -371,7 +372,7 @@ class SvxZoomItem; #define SID_STYLE_END_PREVIEW (SID_SFX_START + 568) #define SID_STYLE_HIDE (SID_SFX_START + 1603) #define SID_STYLE_SHOW (SID_SFX_START + 1604) -#define SID_STYLE_UPD_BY_EX_NAME (SID_SFX_START + 1585) +#define SID_STYLE_UPD_BY_EX_NAME TypedWhichId<SfxStringItem>(SID_SFX_START + 1585) #define SID_STYLE_REFERENCE TypedWhichId<SfxStringItem>(SID_SFX_START + 1602) #define SID_TEMPLATE_NAME TypedWhichId<SfxStringItem>(SID_SFX_START + 660) @@ -382,10 +383,10 @@ class SvxZoomItem; #define SID_INSERT_FLOATINGFRAME (SID_SFX_START + 563) #define SID_CLASSIFICATION_APPLY (SID_SFX_START + 672) #define SID_WATERMARK (SID_SFX_START + 676) -#define SID_WATERMARK_FONT (SID_SFX_START + 677) -#define SID_WATERMARK_TRANSPARENCY (SID_SFX_START + 805) -#define SID_WATERMARK_COLOR (SID_SFX_START + 806) -#define SID_WATERMARK_ANGLE (SID_SFX_START + 807) +#define SID_WATERMARK_FONT TypedWhichId<SfxStringItem>(SID_SFX_START + 677) +#define SID_WATERMARK_TRANSPARENCY TypedWhichId<SfxInt16Item>(SID_SFX_START + 805) +#define SID_WATERMARK_COLOR TypedWhichId<SfxUInt32Item>(SID_SFX_START + 806) +#define SID_WATERMARK_ANGLE TypedWhichId<SfxInt16Item>(SID_SFX_START + 807) #define SID_HYPERLINK_DIALOG (SID_SFX_START + 678) @@ -507,49 +508,49 @@ class SvxZoomItem; #define SID_SIGNATURE (SID_SFX_START + 1643) // SaveTabPage -#define SID_ATTR_DOCINFO (SID_OPTIONS_START + 0) -#define SID_ATTR_BACKUP (SID_OPTIONS_START + 1) -#define SID_ATTR_AUTOSAVE (SID_OPTIONS_START + 2) -#define SID_ATTR_AUTOSAVEPROMPT (SID_OPTIONS_START + 3) -#define SID_ATTR_USERAUTOSAVE (SID_OPTIONS_START + 4) -#define SID_ATTR_AUTOSAVEMINUTE (SID_OPTIONS_START + 5) -#define SID_ATTR_WORKINGSET (SID_OPTIONS_START + 13) -#define SID_ATTR_UNDO_COUNT (SID_OPTIONS_START + 16) +#define SID_ATTR_DOCINFO TypedWhichId<SfxBoolItem>(SID_OPTIONS_START + 0) +#define SID_ATTR_BACKUP TypedWhichId<SfxBoolItem>(SID_OPTIONS_START + 1) +#define SID_ATTR_AUTOSAVE TypedWhichId<SfxBoolItem>(SID_OPTIONS_START + 2) +#define SID_ATTR_AUTOSAVEPROMPT TypedWhichId<SfxBoolItem>(SID_OPTIONS_START + 3) +#define SID_ATTR_USERAUTOSAVE TypedWhichId<SfxBoolItem>(SID_OPTIONS_START + 4) +#define SID_ATTR_AUTOSAVEMINUTE TypedWhichId<SfxUInt16Item>(SID_OPTIONS_START + 5) +#define SID_ATTR_WORKINGSET TypedWhichId<SfxBoolItem>(SID_OPTIONS_START + 13) +#define SID_ATTR_UNDO_COUNT TypedWhichId<SfxUInt16Item>(SID_OPTIONS_START + 16) // unused -#define SID_ATTR_SAVEDOCVIEW (SID_OPTIONS_START + 18) +#define SID_ATTR_SAVEDOCVIEW TypedWhichId<SfxBoolItem>(SID_OPTIONS_START + 18) // GeneralTabPage #define SID_ATTR_METRIC TypedWhichId<SfxUInt16Item>(SID_OPTIONS_START + 8) -#define SID_ATTR_DEFTABSTOP (SID_OPTIONS_START + 14) -#define SID_ATTR_BUTTON_BIGSIZE (SID_OPTIONS_START + 63) -#define SID_ATTR_QUICKLAUNCHER (SID_OPTIONS_START + 74) +#define SID_ATTR_DEFTABSTOP TypedWhichId<SfxUInt16Item>(SID_OPTIONS_START + 14) +#define SID_ATTR_BUTTON_BIGSIZE TypedWhichId<SfxBoolItem>(SID_OPTIONS_START + 63) +#define SID_ATTR_QUICKLAUNCHER TypedWhichId<SfxBoolItem>(SID_OPTIONS_START + 74) #define SID_ATTR_YEAR2000 TypedWhichId<SfxUInt16Item>(SID_OPTIONS_START + 87) #define SID_ATTR_APPLYCHARUNIT TypedWhichId<SfxBoolItem>(SID_OPTIONS_START + 88) // PathTabPage -#define SID_ATTR_PATHNAME (SID_OPTIONS_START + 11) +#define SID_ATTR_PATHNAME TypedWhichId<SfxAllEnumItem>(SID_OPTIONS_START + 11) // LinguTabPage #define SID_ATTR_LANGUAGE TypedWhichId<SvxLanguageItem>(SID_OPTIONS_START + 7) #define SID_ATTR_HYPHENREGION TypedWhichId<SfxHyphenRegionItem>(SID_OPTIONS_START + 12) -#define SID_AUTOSPELL_CHECK (SID_OPTIONS_START + 21) +#define SID_AUTOSPELL_CHECK TypedWhichId<SfxBoolItem>(SID_OPTIONS_START + 21) // InetTabPage -#define SID_INET_PROXY_TYPE (SID_OPTIONS_START + 23) +#define SID_INET_PROXY_TYPE TypedWhichId<SfxUInt16Item>(SID_OPTIONS_START + 23) -#define SID_SAVEREL_INET (SID_OPTIONS_START + 30) -#define SID_SAVEREL_FSYS (SID_OPTIONS_START + 31) +#define SID_SAVEREL_INET TypedWhichId<SfxBoolItem>(SID_OPTIONS_START + 30) +#define SID_SAVEREL_FSYS TypedWhichId<SfxBoolItem>(SID_OPTIONS_START + 31) #define SID_PASSWORD TypedWhichId<SfxStringItem>(SID_OPTIONS_START + 36) #define SID_INET_NOPROXY TypedWhichId<SfxStringItem>(SID_OPTIONS_START + 37) -#define SID_INET_HTTP_PROXY_NAME (SID_OPTIONS_START + 38) -#define SID_INET_HTTP_PROXY_PORT (SID_OPTIONS_START + 39) -#define SID_INET_FTP_PROXY_NAME (SID_OPTIONS_START + 40) -#define SID_INET_FTP_PROXY_PORT (SID_OPTIONS_START + 41) +#define SID_INET_HTTP_PROXY_NAME TypedWhichId<SfxStringItem>(SID_OPTIONS_START + 38) +#define SID_INET_HTTP_PROXY_PORT TypedWhichId<SfxInt32Item>(SID_OPTIONS_START + 39) +#define SID_INET_FTP_PROXY_NAME TypedWhichId<SfxStringItem>(SID_OPTIONS_START + 40) +#define SID_INET_FTP_PROXY_PORT TypedWhichId<SfxInt32Item>(SID_OPTIONS_START + 41) // Automatic update of Styles - manage TabPage #define SID_ATTR_AUTO_STYLE_UPDATE TypedWhichId<SfxBoolItem>(SID_OPTIONS_START + 65) @@ -559,8 +560,8 @@ class SvxZoomItem; // configured locale changed #define SID_OPT_LOCALE_CHANGED (SID_OPTIONS_START + 94) //middle mouse button -#define SID_ATTR_PRETTYPRINTING (SID_OPTIONS_START + 98) -#define SID_HELP_STYLESHEET (SID_OPTIONS_START + 99) +#define SID_ATTR_PRETTYPRINTING TypedWhichId<SfxBoolItem>(SID_OPTIONS_START + 98) +#define SID_HELP_STYLESHEET TypedWhichId<SfxStringItem>(SID_OPTIONS_START + 99) // slot IDs from SVX (svxids.hrc) --------------------------------------------- // These SID_SVX_START entries came from include/svx/svxids.hrc, avoid @@ -594,7 +595,7 @@ class SvxZoomItem; #define SID_ATTR_COLOR_STR (SID_SVX_START + 540) #define SID_COMP_BIBLIOGRAPHY (SID_SVX_START + 880) #define SID_ADDRESS_DATA_SOURCE (SID_SVX_START + 934) -#define SID_OPEN_SMARTTAGOPTIONS (SID_SVX_START + 1062) +#define SID_OPEN_SMARTTAGOPTIONS TypedWhichId<SfxBoolItem>(SID_SVX_START + 1062) #define SID_RULER_MARGIN1 (SID_SVX_START + 1063) #define SID_RULER_MARGIN2 (SID_SVX_START + 1064) #define SID_TABLE_BORDER_TYPE (SID_SVX_START + 1065) @@ -708,7 +709,7 @@ class SvxZoomItem; // SfxSecurityPage related stuff #define FN_EDIT2 (SID_SW_START + 1800) -#define FN_REDLINE_PROTECT (FN_EDIT2 + 23) +#define FN_REDLINE_PROTECT TypedWhichId<SfxBoolItem>(FN_EDIT2 + 23) #define FN_REDLINE_ON (FN_EDIT2 + 25) #define SID_HTML_MODE TypedWhichId<SfxUInt16Item>(SID_SVX_START + 414) diff --git a/include/svx/svxids.hrc b/include/svx/svxids.hrc index 07d10bb1ee97..a1d973fde81a 100644 --- a/include/svx/svxids.hrc +++ b/include/svx/svxids.hrc @@ -202,8 +202,8 @@ class XFillGradientItem; #define FN_END_DOC_DIRECT (FN_SELECTION + 79) #define FN_PARAM (SID_SW_START + 1100) -#define FN_PARAM_FILTER (FN_PARAM + 30) -#define FN_PARAM_FIELD_CONTENT (FN_PARAM + 55) +#define FN_PARAM_FILTER TypedWhichId<SfxStringItem>(FN_PARAM + 30) +#define FN_PARAM_FIELD_CONTENT TypedWhichId<SfxStringItem>(FN_PARAM + 55) #define FN_PGPREVIEW (SID_SW_START + 1250) #define FN_SHOW_MULTIPLE_PAGES (FN_PGPREVIEW + 2) @@ -342,8 +342,8 @@ class XFillGradientItem; #define SID_DIALOG_TESTMODE ( SID_SVX_START + 200 ) #define SID_FRAME_LINESTYLE TypedWhichId<SvxLineItem>( SID_SVX_START + 201 ) #define SID_FRAME_LINECOLOR TypedWhichId<SvxColorItem>( SID_SVX_START + 202 ) -#define SID_ATTR_LINE_WIDTH_ARG ( SID_SVX_START + 203 ) -#define SID_FILL_GRADIENT_JSON ( SID_SVX_START + 204 ) +#define SID_ATTR_LINE_WIDTH_ARG TypedWhichId<SvxDoubleItem>( SID_SVX_START + 203 ) +#define SID_FILL_GRADIENT_JSON TypedWhichId<SfxStringItem>( SID_SVX_START + 204 ) #define SID_SEARCHDLG_SEARCHSTRINGS ( SID_SVX_START + 215 ) #define SID_SEARCHDLG_REPLACESTRINGS ( SID_SVX_START + 216 ) #define SID_ATTR_TABLE ( SID_SVX_START + 217 ) @@ -445,9 +445,9 @@ class XFillGradientItem; #define SID_ATTR_TEXTCOLUMNS_NUMBER ( SID_SVX_START + 340 ) #define SID_ATTR_TEXTCOLUMNS_SPACING ( SID_SVX_START + 341 ) -#define SID_ATTR_COLOR_THEME_INDEX ( SID_SVX_START + 342 ) -#define SID_ATTR_COLOR_LUM_MOD ( SID_SVX_START + 343 ) -#define SID_ATTR_COLOR_LUM_OFF ( SID_SVX_START + 344 ) +#define SID_ATTR_COLOR_THEME_INDEX TypedWhichId<SfxInt16Item>( SID_SVX_START + 342 ) +#define SID_ATTR_COLOR_LUM_MOD TypedWhichId<SfxInt16Item>( SID_SVX_START + 343 ) +#define SID_ATTR_COLOR_LUM_OFF TypedWhichId<SfxInt16Item>( SID_SVX_START + 344 ) #define SID_SB_CONNECTIONPOOLING ( SID_SVX_START + 348 ) #define SID_SB_DBREGISTEROPTIONS ( SID_SVX_START + 349 ) @@ -703,8 +703,8 @@ class XFillGradientItem; // CAUTION! Range <855 .. 855> used by EditEngine (!) -#define SID_PARAM_NUM_PRESET ( SID_SVX_START + 856 ) -#define SID_PARAM_CUR_NUM_LEVEL ( SID_SVX_START + 859 ) +#define SID_PARAM_NUM_PRESET TypedWhichId<SfxBoolItem>( SID_SVX_START + 856 ) +#define SID_PARAM_CUR_NUM_LEVEL TypedWhichId<SfxUInt16Item>( SID_SVX_START + 859 ) #define SID_CREATE_SW_DRAWVIEW ( SID_SVX_START + 860 ) #define SID_ATTR_GRAF_LUMINANCE ( SID_SVX_START + 863 ) #define SID_ATTR_GRAF_CONTRAST ( SID_SVX_START + 864 ) @@ -945,7 +945,7 @@ class XFillGradientItem; #define SID_COMPRESS_GRAPHIC ( SID_SVX_START + 1117 ) #define SID_FRAME_UP ( SID_SVX_START + 1118 ) #define SID_FRAME_DOWN ( SID_SVX_START + 1119 ) -#define SID_ATTR_SPECIALCHAR ( SID_SVX_START + 1120 ) +#define SID_ATTR_SPECIALCHAR TypedWhichId<SfxStringItem>( SID_SVX_START + 1120 ) #define SID_ROTATE_GRAPHIC_LEFT ( SID_SVX_START + 1121 ) #define SID_ROTATE_GRAPHIC_RIGHT ( SID_SVX_START + 1122 ) #define SID_ROTATE_GRAPHIC_180 ( SID_SVX_START + 1123 ) diff --git a/sc/inc/sc.hrc b/sc/inc/sc.hrc index f4a602fbed48..7e80324416af 100644 --- a/sc/inc/sc.hrc +++ b/sc/inc/sc.hrc @@ -22,6 +22,7 @@ #include <svx/svxids.hrc> +class ScTpPrintItem; class SvxZoomSliderItem; // areas @@ -62,12 +63,12 @@ class SvxZoomSliderItem; #define SID_UPDATECHART (SC_VIEW_START + 13) // TabPage entry - Legacy selection -#define SID_SC_INPUT_LEGACY_CELL_SELECTION (SC_VIEW_START + 15) -#define SID_SC_OPT_SORT_REF_UPDATE (SC_VIEW_START + 16) +#define SID_SC_INPUT_LEGACY_CELL_SELECTION TypedWhichId<SfxBoolItem>(SC_VIEW_START + 15) +#define SID_SC_OPT_SORT_REF_UPDATE TypedWhichId<SfxBoolItem>(SC_VIEW_START + 16) // Format options -#define SID_SCFORMULAOPTIONS (SC_VIEW_START + 20) -#define SID_SCDEFAULTSOPTIONS (SC_VIEW_START + 21) +#define SID_SCFORMULAOPTIONS TypedWhichId<ScTpFormulaItem>(SC_VIEW_START + 20) +#define SID_SCDEFAULTSOPTIONS TypedWhichId<ScTpDefaultsItem>(SC_VIEW_START + 21) #define SID_DATA_PROVIDER (SC_VIEW_START + 31) @@ -82,8 +83,8 @@ class SvxZoomSliderItem; // other slot-IDs: #define SID_SCUSERLISTS (SC_VIEW_START + 37) // user defined lists #define RES_TBX_DUMMY (SC_VIEW_START + 38) // dummy-item -#define SID_SCVIEWOPTIONS (SC_VIEW_START + 39) -#define SID_SCDOCOPTIONS (SC_VIEW_START + 40) +#define SID_SCVIEWOPTIONS TypedWhichId<ScTpViewItem>(SC_VIEW_START + 39) +#define SID_SCDOCOPTIONS TypedWhichId<ScTpCalcItem>(SC_VIEW_START + 40) // cursor movements as properties: #define SID_CURRENTCELL (SC_VIEW_START + 41) @@ -111,24 +112,24 @@ class SvxZoomSliderItem; #define SID_LINKS (SC_VIEW_START + 60) #define SID_INSERT_SMATH (SC_VIEW_START + 63) // Put this here since all available slots for "SC_INPUT" are taken -#define SID_SC_INPUT_ENTER_PASTE_MODE (SC_VIEW_START + 64) +#define SID_SC_INPUT_ENTER_PASTE_MODE TypedWhichId<SfxBoolItem>(SC_VIEW_START + 64) #define SID_MIRROR_VERTICAL (SC_VIEW_START + 65) #define SID_MIRROR_HORIZONTAL (SC_VIEW_START + 66) #define SID_CELL_FORMAT_RESET (SC_VIEW_START + 67) -#define SID_SCPRINTOPTIONS (SC_VIEW_START + 68) +#define SID_SCPRINTOPTIONS TypedWhichId<ScTpPrintItem>(SC_VIEW_START + 68) #define SID_WINDOW_SPLIT (SC_VIEW_START + 69) #define SID_WINDOW_FIX (SC_VIEW_START + 70) #define SID_DRAW_CHART (SC_VIEW_START + 71) #define SID_UPDATETABLINKS (SC_VIEW_START + 72) // TabPage entry -#define SID_SC_INPUT_SELECTION (SC_VIEW_START + 73) -#define SID_SC_INPUT_SELECTIONPOS (SC_VIEW_START + 74) -#define SID_SC_INPUT_EDITMODE (SC_VIEW_START + 75) -#define SID_SC_INPUT_FMT_EXPAND (SC_VIEW_START + 76) -#define SID_SC_INPUT_RANGEFINDER (SC_VIEW_START + 77) -#define SID_SC_INPUT_REF_EXPAND (SC_VIEW_START + 78) -#define SID_SC_INPUT_MARK_HEADER (SC_VIEW_START + 79) +#define SID_SC_INPUT_SELECTION TypedWhichId<SfxBoolItem>(SC_VIEW_START + 73) +#define SID_SC_INPUT_SELECTIONPOS TypedWhichId<SfxUInt16Item>(SC_VIEW_START + 74) +#define SID_SC_INPUT_EDITMODE TypedWhichId<SfxBoolItem>(SC_VIEW_START + 75) +#define SID_SC_INPUT_FMT_EXPAND TypedWhichId<SfxBoolItem>(SC_VIEW_START + 76) +#define SID_SC_INPUT_RANGEFINDER TypedWhichId<SfxBoolItem>(SC_VIEW_START + 77) +#define SID_SC_INPUT_REF_EXPAND TypedWhichId<SfxBoolItem>(SC_VIEW_START + 78) +#define SID_SC_INPUT_MARK_HEADER TypedWhichId<SfxBoolItem>(SC_VIEW_START + 79) #define SID_REIMPORT_AFTER_LOAD (SC_VIEW_START + 80) #define SID_DRAW_NOTEEDIT (SC_VIEW_START + 81) @@ -138,7 +139,7 @@ class SvxZoomSliderItem; //See include/sfx2/sfxsids.hrc for reserved usage of (SC_VIEW_START + 84) #define SID_EXTERNAL_SOURCE (SC_VIEW_START + 85) -#define SID_SC_INPUT_TEXTWYSIWYG (SC_VIEW_START + 86) +#define SID_SC_INPUT_TEXTWYSIWYG TypedWhichId<SfxBoolItem>(SC_VIEW_START + 86) #define SID_ENABLE_HYPHENATION (SC_VIEW_START + 87) @@ -150,10 +151,10 @@ class SvxZoomSliderItem; #define SID_DP_FILTER (SC_VIEW_START + 91) // replace cell contents warning -#define SID_SC_INPUT_REPLCELLSWARN (SC_VIEW_START + 92) +#define SID_SC_INPUT_REPLCELLSWARN TypedWhichId<SfxBoolItem>(SC_VIEW_START + 92) // additional IDs for list/range validity -#define FID_VALID_LISTTYPE (SC_VIEW_START + 93) +#define FID_VALID_LISTTYPE TypedWhichId<SfxInt16Item>(SC_VIEW_START + 93) // #i68101# ID for changing title & description of an object #define SID_TITLE_DESCRIPTION_OBJECT (SC_VIEW_START + 94) @@ -162,9 +163,9 @@ class SvxZoomSliderItem; #define SID_ASSIGNMACRO (SC_VIEW_START + 95) // "Zoom / Synchronize sheets" in options dialog -#define SID_SC_OPT_SYNCZOOM (SC_VIEW_START + 98) +#define SID_SC_OPT_SYNCZOOM TypedWhichId<SfxBoolItem>(SC_VIEW_START + 98) -#define SID_SC_OPT_KEY_BINDING_COMPAT (SC_VIEW_START + 99) +#define SID_SC_OPT_KEY_BINDING_COMPAT TypedWhichId<SfxUInt16Item>(SC_VIEW_START + 99) // NOTE: last valid ID is (SC_VIEW_START + 99) @@ -268,7 +269,7 @@ class SvxZoomSliderItem; #define EDIT_MENU_END (EDIT_MENU_START + 20) #define VIEW_MENU_START (EDIT_MENU_END) -#define FID_TOGGLEINPUTLINE (VIEW_MENU_START + 1) +#define FID_TOGGLEINPUTLINE TypedWhichId<SfxBoolItem>(VIEW_MENU_START + 1) #define FID_TOGGLEHEADERS (VIEW_MENU_START + 2) #define FID_SCALE (VIEW_MENU_START + 4) #define FID_TOGGLESYNTAX (VIEW_MENU_START + 5) @@ -556,18 +557,18 @@ class SvxZoomSliderItem; #define FID_NOTE_VISIBLE (SID_NEW_SLOTS+59) // items for validation -#define FID_VALID_MODE (SID_NEW_SLOTS+60) -#define FID_VALID_CONDMODE (SID_NEW_SLOTS+61) -#define FID_VALID_VALUE1 (SID_NEW_SLOTS+62) -#define FID_VALID_VALUE2 (SID_NEW_SLOTS+63) -#define FID_VALID_BLANK (SID_NEW_SLOTS+64) -#define FID_VALID_SHOWHELP (SID_NEW_SLOTS+65) -#define FID_VALID_HELPTITLE (SID_NEW_SLOTS+66) -#define FID_VALID_HELPTEXT (SID_NEW_SLOTS+67) -#define FID_VALID_SHOWERR (SID_NEW_SLOTS+68) -#define FID_VALID_ERRSTYLE (SID_NEW_SLOTS+69) -#define FID_VALID_ERRTITLE (SID_NEW_SLOTS+70) -#define FID_VALID_ERRTEXT (SID_NEW_SLOTS+71) +#define FID_VALID_MODE TypedWhichId<SfxUInt16Item>(SID_NEW_SLOTS+60) +#define FID_VALID_CONDMODE TypedWhichId<SfxUInt16Item>(SID_NEW_SLOTS+61) +#define FID_VALID_VALUE1 TypedWhichId<SfxStringItem>(SID_NEW_SLOTS+62) +#define FID_VALID_VALUE2 TypedWhichId<SfxStringItem>(SID_NEW_SLOTS+63) +#define FID_VALID_BLANK TypedWhichId<SfxBoolItem>(SID_NEW_SLOTS+64) +#define FID_VALID_SHOWHELP TypedWhichId<SfxBoolItem>(SID_NEW_SLOTS+65) +#define FID_VALID_HELPTITLE TypedWhichId<SfxStringItem>(SID_NEW_SLOTS+66) +#define FID_VALID_HELPTEXT TypedWhichId<SfxStringItem>(SID_NEW_SLOTS+67) +#define FID_VALID_SHOWERR TypedWhichId<SfxBoolItem>(SID_NEW_SLOTS+68) +#define FID_VALID_ERRSTYLE TypedWhichId<SfxUInt16Item>(SID_NEW_SLOTS+69) +#define FID_VALID_ERRTITLE TypedWhichId<SfxStringItem>(SID_NEW_SLOTS+70) +#define FID_VALID_ERRTEXT TypedWhichId<SfxStringItem>(SID_NEW_SLOTS+71) #define SID_REFRESH_DBAREA (SID_NEW_SLOTS+72) diff --git a/sc/inc/scitems.hxx b/sc/inc/scitems.hxx index eb9771b0d3af..dd91e2f63a3c 100644 --- a/sc/inc/scitems.hxx +++ b/sc/inc/scitems.hxx @@ -21,6 +21,7 @@ #include <svl/typedwhich.hxx> +class ScConsolidateItem; class SfxBoolItem; class SvxCharReliefItem; class SvxColorItem; @@ -84,16 +85,16 @@ class SvxSetItem; #define MSGPOOL_START 1100 -#define SCITEM_STRING 1100 -#define SCITEM_SEARCHDATA 1101 -#define SCITEM_SORTDATA 1102 -#define SCITEM_QUERYDATA 1103 -#define SCITEM_SUBTDATA 1104 -#define SCITEM_CONSOLIDATEDATA 1105 -#define SCITEM_PIVOTDATA 1106 -#define SCITEM_SOLVEDATA 1107 -#define SCITEM_USERLIST 1108 -#define SCITEM_CONDFORMATDLGDATA 1109 +#define SCITEM_STRING TypedWhichId<SfxStringItem>(1100) +#define SCITEM_SEARCHDATA TypedWhichId<SvxSearchItem>(1101) +#define SCITEM_SORTDATA TypedWhichId<ScSortItem>(1102) +#define SCITEM_QUERYDATA TypedWhichId<ScQueryItem>(1103) +#define SCITEM_SUBTDATA TypedWhichId<ScSubTotalItem>(1104) +#define SCITEM_CONSOLIDATEDATA TypedWhichId<ScConsolidateItem>(1105) +#define SCITEM_PIVOTDATA TypedWhichId<ScPivotItem>(1106) +#define SCITEM_SOLVEDATA TypedWhichId<ScSolveItem>(1107) +#define SCITEM_USERLIST TypedWhichId<ScUserListItem>(1108) +#define SCITEM_CONDFORMATDLGDATA TypedWhichId<ScCondFormatDlgItem>(1109) #define MSGPOOL_END 1109 diff --git a/sc/source/ui/dbgui/tpsort.cxx b/sc/source/ui/dbgui/tpsort.cxx index 4a662e4fad56..dfdce8fd51b9 100644 --- a/sc/source/ui/dbgui/tpsort.cxx +++ b/sc/source/ui/dbgui/tpsort.cxx @@ -276,7 +276,7 @@ bool ScTabPageSortFields::FillItemSet( SfxItemSet* rArgSet ) void ScTabPageSortFields::ActivatePage( const SfxItemSet& rSet ) { // Refresh local copy with shared data - aSortData = static_cast<const ScSortItem&>(rSet.Get( SCITEM_SORTDATA )).GetSortData(); + aSortData = rSet.Get( SCITEM_SORTDATA ).GetSortData(); ScSortDlg* pDlg = static_cast<ScSortDlg*>(GetDialogController()); if (!pDlg) return; @@ -706,7 +706,7 @@ bool ScTabPageSortOptions::FillItemSet( SfxItemSet* rArgSet ) void ScTabPageSortOptions::ActivatePage( const SfxItemSet& rSet ) { // Refresh local copy with shared data - aSortData = static_cast<const ScSortItem&>(rSet.Get( SCITEM_SORTDATA )).GetSortData(); + aSortData = rSet.Get( SCITEM_SORTDATA ).GetSortData(); ScSortDlg* pDlg = static_cast<ScSortDlg*>(GetDialogController()); if (!pDlg) return; diff --git a/sc/source/ui/optdlg/tpcalc.cxx b/sc/source/ui/optdlg/tpcalc.cxx index 6ab3baaa70c9..a7cc06088376 100644 --- a/sc/source/ui/optdlg/tpcalc.cxx +++ b/sc/source/ui/optdlg/tpcalc.cxx @@ -36,7 +36,7 @@ ScTpCalcOptions::ScTpCalcOptions(weld::Container* pPage, weld::DialogController* pController, const SfxItemSet& rCoreAttrs) : SfxTabPage(pPage, pController, "modules/scalc/ui/optcalculatepage.ui", "OptCalculatePage", &rCoreAttrs) , pOldOptions(new ScDocOptions( - static_cast<const ScTpCalcItem&>(rCoreAttrs.Get(SID_SCDOCOPTIONS)).GetDocOptions())) + rCoreAttrs.Get(SID_SCDOCOPTIONS).GetDocOptions())) , pLocalOptions(new ScDocOptions) , m_xBtnIterate(m_xBuilder->weld_check_button("iterate")) , m_xFtSteps(m_xBuilder->weld_label("stepsft")) @@ -87,8 +87,7 @@ void ScTpCalcOptions::Reset(const SfxItemSet* rCoreAttrs) sal_Int16 y; pOldOptions.reset(new ScDocOptions( - static_cast<const ScTpCalcItem&>(rCoreAttrs->Get( - SID_SCDOCOPTIONS)).GetDocOptions())); + rCoreAttrs->Get(SID_SCDOCOPTIONS).GetDocOptions())); *pLocalOptions = *pOldOptions; diff --git a/sc/source/ui/optdlg/tpformula.cxx b/sc/source/ui/optdlg/tpformula.cxx index 0656c03948c7..656097cf1c5f 100644 --- a/sc/source/ui/optdlg/tpformula.cxx +++ b/sc/source/ui/optdlg/tpformula.cxx @@ -76,8 +76,7 @@ ScTpFormulaOptions::ScTpFormulaOptions(weld::Container* pPage, weld::DialogContr OUString aSep = ScGlobal::getLocaleData().getNumDecimalSep(); mnDecSep = aSep.isEmpty() ? u'.' : aSep[0]; - maSavedDocOptions = static_cast<const ScTpCalcItem&>(rCoreAttrs.Get( - SID_SCDOCOPTIONS)).GetDocOptions(); + maSavedDocOptions = rCoreAttrs.Get(SID_SCDOCOPTIONS).GetDocOptions(); } ScTpFormulaOptions::~ScTpFormulaOptions() diff --git a/sc/source/ui/view/cellsh1.cxx b/sc/source/ui/view/cellsh1.cxx index 441f62148931..7960fc771b2a 100644 --- a/sc/source/ui/view/cellsh1.cxx +++ b/sc/source/ui/view/cellsh1.cxx @@ -1953,7 +1953,7 @@ void ScCellShell::ExecuteEdit( SfxRequest& rReq ) if ( pOkItem->GetValue() ) // OK { OUString aFormula; - const SfxStringItem* pSItem = static_cast<const SfxStringItem*>(&pReqArgs->Get( SCITEM_STRING )); + const SfxStringItem* pSItem = &pReqArgs->Get( SCITEM_STRING ); const SfxBoolItem* pMatrixItem = static_cast<const SfxBoolItem*>(&pReqArgs->Get( SID_DLG_MATRIX )); aFormula += pSItem->GetValue(); @@ -2247,8 +2247,7 @@ void ScCellShell::ExecuteEdit( SfxRequest& rReq ) if (pReqArgs) { const ScSolveItem& rItem = - static_cast<const ScSolveItem&>( - pReqArgs->Get( SCITEM_SOLVEDATA )); + pReqArgs->Get( SCITEM_SOLVEDATA ); pTabViewShell->Solve( rItem.GetData() ); @@ -3263,7 +3262,7 @@ void ScCellShell::ExecuteSubtotals(SfxRequest& rReq) const SfxItemSet* pArgs = rReq.GetArgs(); if ( pArgs ) { - pTabViewShell->DoSubTotals( static_cast<const ScSubTotalItem&>( pArgs->Get( SCITEM_SUBTDATA )). + pTabViewShell->DoSubTotals( pArgs->Get( SCITEM_SUBTDATA ). GetSubTotalData() ); rReq.Done(); return; @@ -3315,9 +3314,7 @@ void ScCellShell::ExecuteSubtotals(SfxRequest& rReq) { pOutSet = pDlg->GetOutputItemSet(); aSubTotalParam = - static_cast<const ScSubTotalItem&>( - pOutSet->Get( SCITEM_SUBTDATA )). - GetSubTotalData(); + pOutSet->Get( SCITEM_SUBTDATA ).GetSubTotalData(); } else // if (bResult == SCRET_REMOVE) { diff --git a/sc/source/ui/view/cellsh2.cxx b/sc/source/ui/view/cellsh2.cxx index 0bed3b16141f..0269c5e9f7dd 100644 --- a/sc/source/ui/view/cellsh2.cxx +++ b/sc/source/ui/view/cellsh2.cxx @@ -520,8 +520,8 @@ void ScCellShell::ExecuteDB( SfxRequest& rReq ) if ( nResult == RET_OK ) { const SfxItemSet* pOutSet = pDlg->GetOutputItemSet(); - const ScSortParam& rOutParam = static_cast<const ScSortItem&>( - pOutSet->Get( SCITEM_SORTDATA )).GetSortData(); + const ScSortParam& rOutParam = + pOutSet->Get( SCITEM_SORTDATA ).GetSortData(); // subtotal when needed new @@ -545,8 +545,8 @@ void ScCellShell::ExecuteDB( SfxRequest& rReq ) if ( pArgs ) { OSL_FAIL("SID_FILTER with arguments?"); - pTabViewShell->Query( static_cast<const ScQueryItem&>( - pArgs->Get( SCITEM_QUERYDATA )).GetQueryData(), nullptr, true ); + pTabViewShell->Query( + pArgs->Get( SCITEM_QUERYDATA ).GetQueryData(), nullptr, true ); rReq.Done(); } else @@ -566,8 +566,8 @@ void ScCellShell::ExecuteDB( SfxRequest& rReq ) if ( pArgs ) { OSL_FAIL("SID_SPECIAL_FILTER with arguments?"); - pTabViewShell->Query( static_cast<const ScQueryItem&>( - pArgs->Get( SCITEM_QUERYDATA )).GetQueryData(), nullptr, true ); + pTabViewShell->Query( + pArgs->Get( SCITEM_QUERYDATA ).GetQueryData(), nullptr, true ); rReq.Done(); } else diff --git a/sd/inc/app.hrc b/sd/inc/app.hrc index 6655b5b96b84..16780524b23d 100644 --- a/sd/inc/app.hrc +++ b/sd/inc/app.hrc @@ -451,7 +451,7 @@ // Add companion for the SID_HIDE_SLIDE (that is defined in svx) #define SID_SHOW_SLIDE (SID_SD_START+441) -#define SID_ADD_MOTION_PATH (SID_SD_START+442) +#define SID_ADD_MOTION_PATH TypedWhichId<SfxUnoAnyItem>(SID_SD_START+442) // FREE #define SID_ZOOM_MODE (SID_SD_START+447) diff --git a/sd/inc/sdattr.hrc b/sd/inc/sdattr.hrc index f6230634e07e..17f8d8761fd1 100644 --- a/sd/inc/sdattr.hrc +++ b/sd/inc/sdattr.hrc @@ -21,6 +21,7 @@ #include <svl/solar.hrc> +class SdOptionsPrintItem; class XColorItem; // Layer attributes @@ -77,12 +78,12 @@ class XColorItem; #define ATTR_ACTION_END ATTR_ACTION_PLAYFULL #define ATTR_COPY_START ATTR_ACTION_END + 1 -#define ATTR_COPY_NUMBER ATTR_COPY_START -#define ATTR_COPY_MOVE_X ATTR_COPY_START + 1 -#define ATTR_COPY_MOVE_Y ATTR_COPY_START + 2 +#define ATTR_COPY_NUMBER TypedWhichId<SfxUInt16Item>(ATTR_COPY_START) +#define ATTR_COPY_MOVE_X TypedWhichId<SfxInt32Item>(ATTR_COPY_START + 1) +#define ATTR_COPY_MOVE_Y TypedWhichId<SfxInt32Item>(ATTR_COPY_START + 2) #define ATTR_COPY_ANGLE TypedWhichId<SdrAngleItem>(ATTR_COPY_START + 3) -#define ATTR_COPY_WIDTH ATTR_COPY_START + 4 -#define ATTR_COPY_HEIGHT ATTR_COPY_START + 5 +#define ATTR_COPY_WIDTH TypedWhichId<SfxInt32Item>(ATTR_COPY_START + 4) +#define ATTR_COPY_HEIGHT TypedWhichId<SfxInt32Item>(ATTR_COPY_START + 5) #define ATTR_COPY_START_COLOR TypedWhichId<XColorItem>(ATTR_COPY_START + 6) #define ATTR_COPY_END_COLOR TypedWhichId<XColorItem>(ATTR_COPY_START + 7) #define ATTR_COPY_END ATTR_COPY_END_COLOR @@ -94,30 +95,30 @@ class XColorItem; #define ATTR_SNAPLINE_END ATTR_SNAPLINE_Y #define ATTR_OPTIONS_START ATTR_SNAPLINE_END + 1 -#define ATTR_OPTIONS_LAYOUT ATTR_OPTIONS_START + 1 -#define ATTR_OPTIONS_MISC ATTR_OPTIONS_START + 2 -#define ATTR_OPTIONS_SNAP ATTR_OPTIONS_START + 3 -#define ATTR_OPTIONS_PRINT ATTR_OPTIONS_START + 4 +#define ATTR_OPTIONS_LAYOUT TypedWhichId<SdOptionsLayoutItem>(ATTR_OPTIONS_START + 1) +#define ATTR_OPTIONS_MISC TypedWhichId<SdOptionsMiscItem>(ATTR_OPTIONS_START + 2) +#define ATTR_OPTIONS_SNAP TypedWhichId<SdOptionsSnapItem>(ATTR_OPTIONS_START + 3) +#define ATTR_OPTIONS_PRINT TypedWhichId<SdOptionsPrintItem>(ATTR_OPTIONS_START + 4) #define ATTR_OPTIONS_END ATTR_OPTIONS_PRINT #define ATTR_OPTIONS_SCALE_START ATTR_OPTIONS_END + 1 -#define ATTR_OPTIONS_SCALE_X ATTR_OPTIONS_SCALE_START -#define ATTR_OPTIONS_SCALE_Y ATTR_OPTIONS_SCALE_START + 1 +#define ATTR_OPTIONS_SCALE_X TypedWhichId<SfxInt32Item>(ATTR_OPTIONS_SCALE_START) +#define ATTR_OPTIONS_SCALE_Y TypedWhichId<SfxInt32Item>(ATTR_OPTIONS_SCALE_START + 1) #define ATTR_OPTIONS_SCALE_WIDTH ATTR_OPTIONS_SCALE_START + 2 #define ATTR_OPTIONS_SCALE_HEIGHT ATTR_OPTIONS_SCALE_START + 3 #define ATTR_OPTIONS_SCALE_END ATTR_OPTIONS_SCALE_HEIGHT #define ATTR_PRESLAYOUT_START ATTR_OPTIONS_SCALE_END + 1 -#define ATTR_PRESLAYOUT_NAME ATTR_PRESLAYOUT_START +#define ATTR_PRESLAYOUT_NAME TypedWhichId<SfxStringItem>(ATTR_PRESLAYOUT_START) #define ATTR_PRESLAYOUT_LOAD ATTR_PRESLAYOUT_START + 1 -#define ATTR_PRESLAYOUT_MASTER_PAGE ATTR_PRESLAYOUT_START + 2 +#define ATTR_PRESLAYOUT_MASTER_PAGE TypedWhichId<SfxBoolItem>(ATTR_PRESLAYOUT_START + 2) #define ATTR_PRESLAYOUT_CHECK_MASTERS ATTR_PRESLAYOUT_START + 3 #define ATTR_PRESLAYOUT_END ATTR_PRESLAYOUT_CHECK_MASTERS // paragraph numbering attributes #define ATTR_PARANUMBERING_START ATTR_PRESLAYOUT_END + 1 -#define ATTR_NUMBER_NEWSTART ATTR_PARANUMBERING_START -#define ATTR_NUMBER_NEWSTART_AT ATTR_PARANUMBERING_START + 1 +#define ATTR_NUMBER_NEWSTART TypedWhichId<SfxBoolItem>(ATTR_PARANUMBERING_START) +#define ATTR_NUMBER_NEWSTART_AT TypedWhichId<SfxInt16Item>(ATTR_PARANUMBERING_START + 1) #define ATTR_PARANUMBERING_END ATTR_NUMBER_NEWSTART_AT /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sd/source/core/anminfo.cxx b/sd/source/core/anminfo.cxx index 5abc0accf39e..5f763708ccda 100644 --- a/sd/source/core/anminfo.cxx +++ b/sd/source/core/anminfo.cxx @@ -111,7 +111,7 @@ OUString SdAnimationInfo::GetBookmark() const { OUString sBookmark; - const SvxFieldItem* pFldItem = dynamic_cast< const SvxFieldItem* >( &mrObject.GetMergedItem( EE_FEATURE_FIELD ) ); + const SvxFieldItem* pFldItem = &mrObject.GetMergedItem( EE_FEATURE_FIELD ); if( pFldItem ) { SvxURLField* pURLField = const_cast< SvxURLField* >( dynamic_cast<const SvxURLField*>( pFldItem->GetField() ) ); diff --git a/sd/source/ui/dlg/paragr.cxx b/sd/source/ui/dlg/paragr.cxx index cead5dfc4634..be9df558e50d 100644 --- a/sd/source/ui/dlg/paragr.cxx +++ b/sd/source/ui/dlg/paragr.cxx @@ -97,7 +97,7 @@ void SdParagraphNumTabPage::Reset( const SfxItemSet* rSet ) SfxItemState eItemState = rSet->GetItemState( ATTR_NUMBER_NEWSTART ); if(eItemState > SfxItemState::DEFAULT ) { - const SfxBoolItem& rStart = static_cast<const SfxBoolItem&>(rSet->Get(ATTR_NUMBER_NEWSTART)); + const SfxBoolItem& rStart = rSet->Get(ATTR_NUMBER_NEWSTART); m_xNewStartCB->set_state( rStart.GetValue() ? TRISTATE_TRUE : TRISTATE_FALSE ); } else @@ -110,7 +110,7 @@ void SdParagraphNumTabPage::Reset( const SfxItemSet* rSet ) eItemState = rSet->GetItemState( ATTR_NUMBER_NEWSTART_AT); if( eItemState > SfxItemState::DEFAULT ) { - sal_Int16 nNewStart = static_cast<const SfxInt16Item&>(rSet->Get(ATTR_NUMBER_NEWSTART_AT)).GetValue(); + sal_Int16 nNewStart = rSet->Get(ATTR_NUMBER_NEWSTART_AT).GetValue(); m_xNewStartNumberCB->set_active(-1 != nNewStart); if(-1 == nNewStart) nNewStart = 1; diff --git a/sd/source/ui/dlg/tpoption.cxx b/sd/source/ui/dlg/tpoption.cxx index 48e24d1f752d..27bd1396684f 100644 --- a/sd/source/ui/dlg/tpoption.cxx +++ b/sd/source/ui/dlg/tpoption.cxx @@ -78,8 +78,7 @@ void SdTpOptionsSnap::Reset( const SfxItemSet* rAttrs ) { SvxGridTabPage::Reset(rAttrs); - SdOptionsSnapItem aOptsItem( static_cast<const SdOptionsSnapItem&>( rAttrs-> - Get( ATTR_OPTIONS_SNAP ) ) ); + SdOptionsSnapItem aOptsItem( rAttrs->Get( ATTR_OPTIONS_SNAP ) ); m_xCbxSnapHelplines->set_active( aOptsItem.GetOptionsSnap().IsSnapHelplines() ); m_xCbxSnapBorder->set_active( aOptsItem.GetOptionsSnap().IsSnapBorder() ); @@ -143,8 +142,7 @@ bool SdTpOptionsContents::FillItemSet( SfxItemSet* rAttrs ) void SdTpOptionsContents::Reset( const SfxItemSet* rAttrs ) { - SdOptionsLayoutItem aLayoutItem( static_cast<const SdOptionsLayoutItem&>( rAttrs-> - Get( ATTR_OPTIONS_LAYOUT ) ) ); + SdOptionsLayoutItem aLayoutItem( rAttrs->Get( ATTR_OPTIONS_LAYOUT ) ); m_xCbxRuler->set_active( aLayoutItem.GetOptionsLayout().IsRulerVisible() ); m_xCbxMoveOutline->set_active( aLayoutItem.GetOptionsLayout().IsMoveOutline() ); @@ -398,8 +396,7 @@ bool SdTpOptionsMisc::FillItemSet( SfxItemSet* rAttrs ) void SdTpOptionsMisc::Reset( const SfxItemSet* rAttrs ) { - SdOptionsMiscItem aOptsItem( static_cast<const SdOptionsMiscItem&>( rAttrs-> - Get( ATTR_OPTIONS_MISC ) ) ); + SdOptionsMiscItem aOptsItem( rAttrs->Get( ATTR_OPTIONS_MISC ) ); m_xCbxStartWithTemplate->set_active( aOptsItem.GetOptionsMisc().IsStartWithTemplate() ); m_xCbxMarkedHitMovesAlways->set_active( aOptsItem.GetOptionsMisc().IsMarkedHitMovesAlways() ); @@ -449,16 +446,14 @@ void SdTpOptionsMisc::Reset( const SfxItemSet* rAttrs ) if( rAttrs->GetItemState( nWhich2 ) >= SfxItemState::DEFAULT ) { MapUnit eUnit = rAttrs->GetPool()->GetMetric( nWhich2 ); - const SfxUInt16Item& rItem = static_cast<const SfxUInt16Item&>(rAttrs->Get( nWhich2 )); + const SfxUInt16Item& rItem = rAttrs->Get( nWhich2 ); SetMetricValue( *m_xMtrFldTabstop, rItem.GetValue(), eUnit ); } m_xLbMetric->save_value(); m_xMtrFldTabstop->save_value(); //Scale - sal_Int32 nX = static_cast<const SfxInt32Item&>( rAttrs-> - Get( ATTR_OPTIONS_SCALE_X ) ).GetValue(); - sal_Int32 nY = static_cast<const SfxInt32Item&>( rAttrs-> - Get( ATTR_OPTIONS_SCALE_Y ) ).GetValue(); + sal_Int32 nX = rAttrs->Get( ATTR_OPTIONS_SCALE_X ).GetValue(); + sal_Int32 nY = rAttrs->Get( ATTR_OPTIONS_SCALE_Y ).GetValue(); nWidth = static_cast<const SfxUInt32Item&>( rAttrs-> Get( ATTR_OPTIONS_SCALE_WIDTH ) ).GetValue(); nHeight = static_cast<const SfxUInt32Item&>( rAttrs-> diff --git a/sd/source/ui/func/fuprlout.cxx b/sd/source/ui/func/fuprlout.cxx index 37120721c72d..c436b78f05c4 100644 --- a/sd/source/ui/func/fuprlout.cxx +++ b/sd/source/ui/func/fuprlout.cxx @@ -150,11 +150,11 @@ void FuPresentationLayout::DoExecute( SfxRequest& rReq ) if (pArgs->GetItemState(ATTR_PRESLAYOUT_LOAD) == SfxItemState::SET) bLoad = static_cast<const SfxBoolItem&>(pArgs->Get(ATTR_PRESLAYOUT_LOAD)).GetValue(); if( pArgs->GetItemState( ATTR_PRESLAYOUT_MASTER_PAGE ) == SfxItemState::SET ) - bMasterPage = static_cast<const SfxBoolItem&>( pArgs->Get( ATTR_PRESLAYOUT_MASTER_PAGE ) ).GetValue(); + bMasterPage = pArgs->Get( ATTR_PRESLAYOUT_MASTER_PAGE ).GetValue(); if( pArgs->GetItemState( ATTR_PRESLAYOUT_CHECK_MASTERS ) == SfxItemState::SET ) bCheckMasters = static_cast<const SfxBoolItem&>( pArgs->Get( ATTR_PRESLAYOUT_CHECK_MASTERS ) ).GetValue(); if (pArgs->GetItemState(ATTR_PRESLAYOUT_NAME) == SfxItemState::SET) - aFile = static_cast<const SfxStringItem&>(pArgs->Get(ATTR_PRESLAYOUT_NAME)).GetValue(); + aFile = pArgs->Get(ATTR_PRESLAYOUT_NAME).GetValue(); } else { @@ -171,11 +171,11 @@ void FuPresentationLayout::DoExecute( SfxRequest& rReq ) if (aSet.GetItemState(ATTR_PRESLAYOUT_LOAD) == SfxItemState::SET) bLoad = static_cast<const SfxBoolItem&>(aSet.Get(ATTR_PRESLAYOUT_LOAD)).GetValue(); if( aSet.GetItemState( ATTR_PRESLAYOUT_MASTER_PAGE ) == SfxItemState::SET ) - bMasterPage = static_cast<const SfxBoolItem&>(aSet.Get( ATTR_PRESLAYOUT_MASTER_PAGE ) ).GetValue(); + bMasterPage = aSet.Get( ATTR_PRESLAYOUT_MASTER_PAGE ).GetValue(); if( aSet.GetItemState( ATTR_PRESLAYOUT_CHECK_MASTERS ) == SfxItemState::SET ) bCheckMasters = static_cast<const SfxBoolItem&>(aSet.Get( ATTR_PRESLAYOUT_CHECK_MASTERS ) ).GetValue(); if (aSet.GetItemState(ATTR_PRESLAYOUT_NAME) == SfxItemState::SET) - aFile = static_cast<const SfxStringItem&>(aSet.Get(ATTR_PRESLAYOUT_NAME)).GetValue(); + aFile = aSet.Get(ATTR_PRESLAYOUT_NAME).GetValue(); } break; diff --git a/sw/inc/cmdid.h b/sw/inc/cmdid.h index 1483bdf91f87..559a8949998c 100644 --- a/sw/inc/cmdid.h +++ b/sw/inc/cmdid.h @@ -24,6 +24,9 @@ #include <svx/svxids.hrc> #include <svl/solar.hrc> +class SwAddPrinterItem; +class SwPtrItem; + #define FN_FILE SID_SW_START //#define FN_EDIT (SID_SW_START + 100) defined in svxids.hrc #define FN_VIEW (SID_SW_START + 200) @@ -173,8 +176,8 @@ #define FN_PREVIEW_ZOOM (FN_VIEW + 51) /* create table controller for zoom */ #define FN_SET_MODOPT_TBLNUMFMT (FN_VIEW + 52) /* Number recognition in tables */ -#define FN_HSCROLL_METRIC (FN_VIEW + 53) /* Metric horizontal scrollbar */ -#define FN_VSCROLL_METRIC (FN_VIEW + 54) /* Metric vertical scrollbar */ +#define FN_HSCROLL_METRIC TypedWhichId<SfxUInt16Item>(FN_VIEW + 53) /* Metric horizontal scrollbar */ +#define FN_VSCROLL_METRIC TypedWhichId<SfxUInt16Item>(FN_VIEW + 54) /* Metric vertical scrollbar */ #define FN_NAV_ELEMENT (FN_VIEW + 55) /* Navigate By drop down controller */ #define FN_SCROLL_PREV (FN_VIEW + 57) /* uno:ScrollToPrevious */ @@ -278,7 +281,7 @@ #define FN_INSERT_PAGEFOOTER (FN_INSERT2 + 14) /* insert default footer */ #define FN_INSERT_ENDNOTE (FN_INSERT2 + 18) /* insert endnote*/ -#define FN_INSERT_REGION (FN_INSERT2 + 19) /* Insert section */ +#define FN_INSERT_REGION TypedWhichId<SfxUInt16Item>(FN_INSERT2 + 19) /* Insert section */ #define FN_INSERT_MULTI_TOX (FN_INSERT2 + 20) /* insert any TOX */ #define FN_INSERT_AUTH_ENTRY_DLG (FN_INSERT2 + 21) /* insert entry for table of authorities*/ @@ -549,7 +552,7 @@ #define FN_UNO_PARENT_TEXT (FN_EXTRA2 + 42) #define FN_UNO_FOLLOW_STYLE (FN_EXTRA2 + 59) -#define FN_API_CALL (FN_EXTRA2 + 60) +#define FN_API_CALL TypedWhichId<SfxBoolItem>(FN_EXTRA2 + 60) #define FN_UNO_IS_PHYSICAL (FN_EXTRA2 + 61) #define FN_UNO_IS_AUTO_UPDATE (FN_EXTRA2 + 62) @@ -764,18 +767,18 @@ #define FN_PARAM_MOVE_COUNT (FN_PARAM+2) #define FN_PARAM_MOVE_SELECTION (FN_PARAM+3) -#define FN_PARAM_ADDPRINTER (FN_PARAM+18) -#define FN_PARAM_DOCDISP (FN_PARAM+20) -#define FN_PARAM_ELEM (FN_PARAM+21) -#define FN_PARAM_SWTEST (FN_PARAM+22) +#define FN_PARAM_ADDPRINTER TypedWhichId<SwAddPrinterItem>(FN_PARAM+18) +#define FN_PARAM_DOCDISP TypedWhichId<SwDocDisplayItem>(FN_PARAM+20) +#define FN_PARAM_ELEM TypedWhichId<SwElemItem>(FN_PARAM+21) +#define FN_PARAM_SWTEST TypedWhichId<SwTestItem>(FN_PARAM+22) #define FN_PARAM_FTN_INFO (FN_PARAM+23) -#define FN_PARAM_REGION_NAME (FN_PARAM+24) -#define FN_PARAM_REGION_CONDITION (FN_PARAM+25) -#define FN_PARAM_REGION_HIDDEN (FN_PARAM+26) -#define FN_PARAM_REGION_PROTECT (FN_PARAM+27) -#define FN_PARAM_REGION_EDIT_IN_READONLY (FN_PARAM+28) +#define FN_PARAM_REGION_NAME TypedWhichId<SfxStringItem>(FN_PARAM+24) +#define FN_PARAM_REGION_CONDITION TypedWhichId<SfxStringItem>(FN_PARAM+25) +#define FN_PARAM_REGION_HIDDEN TypedWhichId<SfxBoolItem>(FN_PARAM+26) +#define FN_PARAM_REGION_PROTECT TypedWhichId<SfxBoolItem>(FN_PARAM+27) +#define FN_PARAM_REGION_EDIT_IN_READONLY TypedWhichId<SfxBoolItem>(FN_PARAM+28) #define FN_PARAM_INSERT_AFTER (FN_PARAM+29) @@ -792,23 +795,23 @@ #define FN_PARAM_GRF_DIALOG (FN_PARAM+71) #define FN_INET_FIELD_MACRO (FN_PARAM+77) /* Id for URL-Field-Macros*/ -#define FN_PARAM_PRINTER (FN_PARAM+78) /* Printer */ -#define FN_PARAM_STDFONTS (FN_PARAM+79) /* ConfigItem Standardfonts */ +#define FN_PARAM_PRINTER TypedWhichId<SwPtrItem>(FN_PARAM+78) /* Printer */ +#define FN_PARAM_STDFONTS TypedWhichId<SwPtrItem>(FN_PARAM+79) /* ConfigItem Standardfonts */ -#define FN_PARAM_WRTSHELL (FN_PARAM2) /* SwWrtShell */ +#define FN_PARAM_WRTSHELL TypedWhichId<SwPtrItem>(FN_PARAM2) /* SwWrtShell */ -#define FN_COND_COLL (FN_PARAM2+1) /* Item for conditional templates */ -#define FN_PARAM_SELECTION (FN_PARAM2+2) /* selected word for format/character/hyperlink */ +#define FN_COND_COLL TypedWhichId<SwCondCollItem>(FN_PARAM2+1) /* Item for conditional templates */ +#define FN_PARAM_SELECTION TypedWhichId<SfxStringItem>(FN_PARAM2+2) /* selected word for format/character/hyperlink */ #define FN_PARAM_ACT_NUMBER (FN_PARAM2+3) /* PointerItem the current NumRule */ #define FN_PARAM_NUM_PRESET (FN_PARAM2+5) /* predefined numbering */ -#define FN_PARAM_SHADOWCURSOR (FN_PARAM2+8) /* for ShadowCursor options */ +#define FN_PARAM_SHADOWCURSOR TypedWhichId<SwShadowCursorItem>(FN_PARAM2+8) /* for ShadowCursor options */ #define FN_TEXT_RANGE (FN_PARAM2+12) /* TextRange Property*/ -#define FN_PARAM_CRSR_IN_PROTECTED (FN_PARAM2+13) /* Cursor in protected areas */ +#define FN_PARAM_CRSR_IN_PROTECTED TypedWhichId<SfxBoolItem>(FN_PARAM2+13) /* Cursor in protected areas */ #define FN_PARAM_TOX_TYPE (FN_PARAM2+14) /* TOX type in tox dialog*/ #define FN_PARAM_LINK_DISPLAY_NAME (FN_PARAM2+15) /* LinkDisplayName property*/ #define FN_PARAM_NUM_LEVEL (FN_PARAM2+16) /* rtf filter*/ @@ -819,7 +822,7 @@ #define FN_DROP_CHAR_STYLE_NAME (FN_PARAM2+19) /* character style of drop caps - for recording */ #define FN_PARAM_CHAIN_PREVIOUS (FN_PARAM2+20) /* Name of frame to be added as chain successor */ #define FN_PARAM_CHAIN_NEXT (FN_PARAM2+21) /* Name of frame to be added as chain predecessor */ -#define FN_PARAM_DATABASE_PROPERTIES (FN_PARAM2+22) /* transport a Sequence<PropertyValue> containing database properties*/ +#define FN_PARAM_DATABASE_PROPERTIES TypedWhichId<SfxUnoAnyItem>(FN_PARAM2+22) /* transport a Sequence<PropertyValue> containing database properties*/ #define FN_SHAPE_TRANSFORMATION_IN_HORI_L2R (FN_PARAM2+23) #define FN_SHAPE_POSITION_LAYOUT_DIR (FN_PARAM2+24) #define FN_SHAPE_STARTPOSITION_IN_HORI_L2R (FN_PARAM2+25) @@ -853,8 +856,8 @@ #define FN_SURROUND (FN_FRAME + 3) #define FN_VERT_ORIENT (FN_FRAME + 4) #define FN_HORI_ORIENT (FN_FRAME + 5) -#define FN_SET_FRM_NAME (FN_FRAME + 6) -#define FN_KEEP_ASPECT_RATIO (FN_FRAME + 7) +#define FN_SET_FRM_NAME TypedWhichId<SfxStringItem>(FN_FRAME + 6) +#define FN_KEEP_ASPECT_RATIO TypedWhichId<SfxBoolItem>(FN_FRAME + 7) #define FN_SET_FRM_ALT_NAME (FN_FRAME + 18) #define FN_UNO_TITLE (FN_FRAME + 19) diff --git a/sw/source/ui/config/optpage.cxx b/sw/source/ui/config/optpage.cxx index d75cd17c40c2..ee175236d000 100644 --- a/sw/source/ui/config/optpage.cxx +++ b/sw/source/ui/config/optpage.cxx @@ -228,8 +228,7 @@ void SwContentOptPage::Reset(const SfxItemSet* rSet) bool SwContentOptPage::FillItemSet(SfxItemSet* rSet) { - const SwElemItem* pOldAttr = static_cast<const SwElemItem*>( - GetOldItem(GetItemSet(), FN_PARAM_ELEM)); + const SwElemItem* pOldAttr = GetOldItem(GetItemSet(), FN_PARAM_ELEM); SwElemItem aElem; aElem.m_bTable = m_xTableCB->get_active(); @@ -1301,8 +1300,7 @@ bool SwShdwCursorOptionsTabPage::FillItemSet( SfxItemSet* rSet ) bRet = true; } - const SwDocDisplayItem* pOldAttr = static_cast<const SwDocDisplayItem*>( - GetOldItem(GetItemSet(), FN_PARAM_DOCDISP)); + const SwDocDisplayItem* pOldAttr = GetOldItem(GetItemSet(), FN_PARAM_DOCDISP); SwDocDisplayItem aDisp; diff --git a/sw/source/ui/frmdlg/frmpage.cxx b/sw/source/ui/frmdlg/frmpage.cxx index e002d74ca35a..6975fda7b824 100644 --- a/sw/source/ui/frmdlg/frmpage.cxx +++ b/sw/source/ui/frmdlg/frmpage.cxx @@ -2193,7 +2193,7 @@ void SwFramePage::Init(const SfxItemSet& rSet) m_nLowerBorder = rUL.GetLower(); if (SfxItemState::SET == rSet.GetItemState(FN_KEEP_ASPECT_RATIO)) - m_xFixedRatioCB->set_active(static_cast<const SfxBoolItem&>(rSet.Get(FN_KEEP_ASPECT_RATIO)).GetValue()); + m_xFixedRatioCB->set_active(rSet.Get(FN_KEEP_ASPECT_RATIO).GetValue()); // columns SwFormatCol aCol( rSet.Get(RES_COL) ); |