diff options
25 files changed, 161 insertions, 151 deletions
diff --git a/chart2/source/controller/itemsetwrapper/AxisItemConverter.cxx b/chart2/source/controller/itemsetwrapper/AxisItemConverter.cxx index 40dd0616e5cb..a073931e9344 100644 --- a/chart2/source/controller/itemsetwrapper/AxisItemConverter.cxx +++ b/chart2/source/controller/itemsetwrapper/AxisItemConverter.cxx @@ -899,8 +899,7 @@ bool AxisItemConverter::ApplySpecialItem( sal_uInt16 nWhichId, const SfxItemSet if( m_pExplicitScale ) { bool bUseSourceFormat = - static_cast< const SfxBoolItem & >( - rItemSet.Get( SID_ATTR_NUMBERFORMAT_SOURCE )).GetValue(); + rItemSet.Get( SID_ATTR_NUMBERFORMAT_SOURCE ).GetValue(); if( ! bUseSourceFormat ) { diff --git a/cui/source/tabpages/backgrnd.cxx b/cui/source/tabpages/backgrnd.cxx index ada1d46c1521..6b9d906ec907 100644 --- a/cui/source/tabpages/backgrnd.cxx +++ b/cui/source/tabpages/backgrnd.cxx @@ -204,7 +204,7 @@ bool SvxBkgTabPage::FillItemSet( SfxItemSet* rCoreSet ) { if (SfxItemState::SET == maSet.GetItemState(SID_ATTR_BRUSH_ROW)) { - SvxBrushItem aBrushItem(static_cast<const SvxBrushItem&>(maSet.Get(SID_ATTR_BRUSH_ROW))); + SvxBrushItem aBrushItem(maSet.Get(SID_ATTR_BRUSH_ROW)); rCoreSet->Put(aBrushItem); } } @@ -212,7 +212,7 @@ bool SvxBkgTabPage::FillItemSet( SfxItemSet* rCoreSet ) { if (SfxItemState::SET == maSet.GetItemState(SID_ATTR_BRUSH_TABLE)) { - SvxBrushItem aBrushItem(static_cast<const SvxBrushItem&>(maSet.Get(SID_ATTR_BRUSH_TABLE))); + SvxBrushItem aBrushItem(maSet.Get(SID_ATTR_BRUSH_TABLE)); rCoreSet->Put(aBrushItem); } } diff --git a/cui/source/tabpages/numfmt.cxx b/cui/source/tabpages/numfmt.cxx index 13c01c8f43f9..e91bef4a8822 100644 --- a/cui/source/tabpages/numfmt.cxx +++ b/cui/source/tabpages/numfmt.cxx @@ -364,8 +364,8 @@ void SvxNumberFormatTabPage::Reset( const SfxItemSet* rSet ) if(eState==SfxItemState::SET) { - const SfxBoolItem* pBoolLangItem = static_cast<const SfxBoolItem*>( - GetItem( *rSet, SID_ATTR_NUMBERFORMAT_NOLANGUAGE)); + const SfxBoolItem* pBoolLangItem = + GetItem( *rSet, SID_ATTR_NUMBERFORMAT_NOLANGUAGE); if(pBoolLangItem!=nullptr && pBoolLangItem->GetValue()) { @@ -415,8 +415,8 @@ void SvxNumberFormatTabPage::Reset( const SfxItemSet* rSet ) if ( eState == SfxItemState::SET ) { - const SfxBoolItem* pBoolItem = static_cast<const SfxBoolItem*>( - GetItem( *rSet, SID_ATTR_NUMBERFORMAT_SOURCE )); + const SfxBoolItem* pBoolItem = + GetItem( *rSet, SID_ATTR_NUMBERFORMAT_SOURCE ); if ( pBoolItem ) m_xCbSourceFormat->set_active(pBoolItem->GetValue()); else @@ -514,8 +514,7 @@ void SvxNumberFormatTabPage::Reset( const SfxItemSet* rSet ) } eState = rSet->GetItemState( SID_ATTR_NUMBERFORMAT_ADD_AUTO ); if(SfxItemState::SET == eState) - pAutoEntryAttr = static_cast<const SfxBoolItem*>( - GetItem( *rSet, SID_ATTR_NUMBERFORMAT_ADD_AUTO )); + pAutoEntryAttr = GetItem( *rSet, SID_ATTR_NUMBERFORMAT_ADD_AUTO ); // no_NO is an alias for nb_NO and normally isn't listed, we need it for // backwards compatibility, but only if the format passed is of // LanguageType no_NO. @@ -735,8 +734,8 @@ bool SvxNumberFormatTabPage::FillItemSet( SfxItemSet* rCoreAttrs ) if ( m_xCbSourceFormat->get_sensitive() ) { SfxItemState _eItemState = rMyItemSet.GetItemState( SID_ATTR_NUMBERFORMAT_SOURCE, false ); - const SfxBoolItem* pBoolItem = static_cast<const SfxBoolItem*>( - GetItem( rMyItemSet, SID_ATTR_NUMBERFORMAT_SOURCE )); + const SfxBoolItem* pBoolItem = + GetItem( rMyItemSet, SID_ATTR_NUMBERFORMAT_SOURCE ); bool bOld = pBoolItem && pBoolItem->GetValue(); rCoreAttrs->Put( SfxBoolItem( SID_ATTR_NUMBERFORMAT_SOURCE, m_xCbSourceFormat->get_active() ) ); if ( !bDataChanged ) diff --git a/cui/source/tabpages/page.cxx b/cui/source/tabpages/page.cxx index c3b8e154fc26..36a7874996a2 100644 --- a/cui/source/tabpages/page.cxx +++ b/cui/source/tabpages/page.cxx @@ -583,15 +583,14 @@ void SvxPageDescPage::Reset( const SfxItemSet* rSet ) if(SfxItemState::SET == rSet->GetItemState(SID_SWREGISTER_MODE)) { - m_xRegisterCB->set_active(static_cast<const SfxBoolItem&>(rSet->Get( - SID_SWREGISTER_MODE)).GetValue()); + m_xRegisterCB->set_active(rSet->Get(SID_SWREGISTER_MODE).GetValue()); m_xRegisterCB->save_state(); RegisterModify(*m_xRegisterCB); } if(SfxItemState::SET == rSet->GetItemState(SID_SWREGISTER_COLLECTION)) { m_xRegisterLB->set_active_text( - static_cast<const SfxStringItem&>(rSet->Get(SID_SWREGISTER_COLLECTION)).GetValue()); + rSet->Get(SID_SWREGISTER_COLLECTION).GetValue()); m_xRegisterLB->save_value(); } @@ -850,7 +849,7 @@ bool SvxPageDescPage::FillItemSet( SfxItemSet* rSet ) if (m_xRegisterCB->get_visible() && (m_xRegisterCB->get_active() || m_xRegisterCB->get_state_changed_from_saved())) { - const SfxBoolItem& rRegItem = static_cast<const SfxBoolItem&>(rOldSet.Get(SID_SWREGISTER_MODE)); + const SfxBoolItem& rRegItem = rOldSet.Get(SID_SWREGISTER_MODE); std::unique_ptr<SfxBoolItem> pRegItem(rRegItem.Clone()); bool bCheck = m_xRegisterCB->get_active(); pRegItem->SetValue(bCheck); diff --git a/cui/source/tabpages/paragrph.cxx b/cui/source/tabpages/paragrph.cxx index 1771c15d209f..e1c9437983cf 100644 --- a/cui/source/tabpages/paragrph.cxx +++ b/cui/source/tabpages/paragrph.cxx @@ -1626,8 +1626,7 @@ void SvxExtParagraphTabPage::Reset( const SfxItemSet* rSet ) { aApplyCollState.bTriStateEnabled = false; - const SvxPageModelItem& rModel = - static_cast<const SvxPageModelItem&>(rSet->Get( SID_ATTR_PARA_MODEL )); + const SvxPageModelItem& rModel = rSet->Get( SID_ATTR_PARA_MODEL ); const OUString& aStr( rModel.GetValue() ); if (!aStr.isEmpty() && m_xApplyCollBox->find_text(aStr) != -1) diff --git a/cui/source/tabpages/swpossizetabpage.cxx b/cui/source/tabpages/swpossizetabpage.cxx index 82a7672d5b5d..5bea85ba73f5 100644 --- a/cui/source/tabpages/swpossizetabpage.cxx +++ b/cui/source/tabpages/swpossizetabpage.cxx @@ -794,11 +794,11 @@ bool SvxSwPosSizeTabPage::FillItemSet( SfxItemSet* rSet) if ( m_pHMap ) { const SfxInt16Item& rHoriOrient = - static_cast<const SfxInt16Item&>(rOldSet.Get( SID_ATTR_TRANSFORM_HORI_ORIENT)); + rOldSet.Get( SID_ATTR_TRANSFORM_HORI_ORIENT ); const SfxInt16Item& rHoriRelation = - static_cast<const SfxInt16Item&>(rOldSet.Get( SID_ATTR_TRANSFORM_HORI_RELATION)); + rOldSet.Get( SID_ATTR_TRANSFORM_HORI_RELATION); const SfxInt32Item& rHoriPosition = - static_cast<const SfxInt32Item&>(rOldSet.Get( SID_ATTR_TRANSFORM_HORI_POSITION)) ; + rOldSet.Get( SID_ATTR_TRANSFORM_HORI_POSITION); sal_uInt16 nMapPos = GetMapPos(m_pHMap, *m_xHoriLB); short nAlign = GetAlignment(m_pHMap, nMapPos, *m_xHoriToLB); @@ -823,11 +823,11 @@ bool SvxSwPosSizeTabPage::FillItemSet( SfxItemSet* rSet) if ( m_pVMap ) { const SfxInt16Item& rVertOrient = - static_cast<const SfxInt16Item&>(rOldSet.Get( SID_ATTR_TRANSFORM_VERT_ORIENT)); + rOldSet.Get( SID_ATTR_TRANSFORM_VERT_ORIENT); const SfxInt16Item& rVertRelation = - static_cast<const SfxInt16Item&>(rOldSet.Get( SID_ATTR_TRANSFORM_VERT_RELATION)); + rOldSet.Get( SID_ATTR_TRANSFORM_VERT_RELATION); const SfxInt32Item& rVertPosition = - static_cast<const SfxInt32Item&>(rOldSet.Get( SID_ATTR_TRANSFORM_VERT_POSITION)); + rOldSet.Get( SID_ATTR_TRANSFORM_VERT_POSITION); sal_uInt16 nMapPos = GetMapPos(m_pVMap, *m_xVertLB); short nAlign = GetAlignment(m_pVMap, nMapPos, *m_xVertToLB); diff --git a/editeng/source/rtf/svxrtf.cxx b/editeng/source/rtf/svxrtf.cxx index 0822b3522817..f60c14cdbafa 100644 --- a/editeng/source/rtf/svxrtf.cxx +++ b/editeng/source/rtf/svxrtf.cxx @@ -899,7 +899,7 @@ void SvxRTFParser::BuildWhichTable() // Here are the IDs for all paragraph attributes, which can be detected by // SvxParser and can be set in a SfxItemSet. The IDs are set correctly through // the SlotIds from POOL. - for (sal_uInt16 nWid : { + static constexpr sal_uInt16 WIDS1[] { SID_ATTR_PARA_LINESPACE, SID_ATTR_PARA_ADJUST, SID_ATTR_TABSTOP, @@ -917,7 +917,8 @@ void SvxRTFParser::BuildWhichTable() SID_ATTR_PARA_HANGPUNCTUATION, SID_ATTR_PARA_FORBIDDEN_RULES, SID_ATTR_FRAMEDIRECTION, - }) + }; + for (sal_uInt16 nWid : WIDS1) { sal_uInt16 nTrueWid = pAttrPool->GetTrueWhich(nWid, false); aPardMap[nWid] = nTrueWid; @@ -929,7 +930,7 @@ void SvxRTFParser::BuildWhichTable() // Here are the IDs for all character attributes, which can be detected by // SvxParser and can be set in a SfxItemSet. The IDs are set correctly through // the SlotIds from POOL. - constexpr sal_uInt16 WIDS[] { + static constexpr sal_uInt16 WIDS[] { SID_ATTR_CHAR_CASEMAP, SID_ATTR_BRUSH_CHAR, SID_ATTR_CHAR_COLOR, SID_ATTR_CHAR_CONTOUR, SID_ATTR_CHAR_STRIKEOUT, SID_ATTR_CHAR_ESCAPEMENT, SID_ATTR_CHAR_FONT, SID_ATTR_CHAR_FONTHEIGHT, SID_ATTR_CHAR_KERNING, diff --git a/forms/source/richtext/richtextimplcontrol.cxx b/forms/source/richtext/richtextimplcontrol.cxx index d1cbd7f6aec3..c51a3a8772af 100644 --- a/forms/source/richtext/richtextimplcontrol.cxx +++ b/forms/source/richtext/richtextimplcontrol.cxx @@ -99,10 +99,10 @@ namespace frm void RichTextControlImpl::implUpdateAttribute( const AttributeHandlerPool::const_iterator& _pHandler ) { - if ( ( _pHandler->first == SID_ATTR_CHAR_WEIGHT ) - || ( _pHandler->first == SID_ATTR_CHAR_POSTURE ) - || ( _pHandler->first == SID_ATTR_CHAR_FONT ) - || ( _pHandler->first == SID_ATTR_CHAR_FONTHEIGHT ) + if ( ( _pHandler->first == sal_uInt16(SID_ATTR_CHAR_WEIGHT) ) + || ( _pHandler->first == sal_uInt16(SID_ATTR_CHAR_POSTURE) ) + || ( _pHandler->first == sal_uInt16(SID_ATTR_CHAR_FONT) ) + || ( _pHandler->first == sal_uInt16(SID_ATTR_CHAR_FONTHEIGHT) ) ) { // these are attributes whose value depends on the current script type. diff --git a/forms/source/richtext/rtattributehandler.cxx b/forms/source/richtext/rtattributehandler.cxx index 653d42e46a5f..65117893305b 100644 --- a/forms/source/richtext/rtattributehandler.cxx +++ b/forms/source/richtext/rtattributehandler.cxx @@ -268,9 +268,9 @@ namespace frm :AttributeHandler( _nAttributeId, _nWhichId ) ,m_bScriptDependent( false ) { - m_bScriptDependent = ( SID_ATTR_CHAR_WEIGHT == _nAttributeId ) - || ( SID_ATTR_CHAR_POSTURE == _nAttributeId ) - || ( SID_ATTR_CHAR_FONT == _nAttributeId ); + m_bScriptDependent = ( sal_uInt16(SID_ATTR_CHAR_WEIGHT) == _nAttributeId ) + || ( sal_uInt16(SID_ATTR_CHAR_POSTURE) == _nAttributeId ) + || ( sal_uInt16(SID_ATTR_CHAR_FONT) == _nAttributeId ); } diff --git a/include/editeng/editids.hrc b/include/editeng/editids.hrc index 91456529af23..92007573fe5d 100644 --- a/include/editeng/editids.hrc +++ b/include/editeng/editids.hrc @@ -21,7 +21,14 @@ #include <svl/solar.hrc> +class SfxGrabBagItem; +class SfxUInt16Item; +class SvxBrushItem; +class SvxFontItem; class SvxLanguageItem; +class SvxPageModelItem; +class SvxPostureItem; +class SvxTabStopItem; /* These SID_SVX_START entries came from include/svx/svxids.hrc, avoid @@ -29,14 +36,14 @@ class SvxLanguageItem; include/sfx2/sfxsids.hrc. Only add new SID_SVX_START entries to include/svx/svxids.hrc */ -#define SID_ATTR_BRUSH ( SID_SVX_START + 1 ) -#define SID_ATTR_TABSTOP ( SID_SVX_START + 2 ) -#define SID_ATTR_TABSTOP_DEFAULTS ( SID_SVX_START + 3 ) -#define SID_ATTR_TABSTOP_POS ( SID_SVX_START + 4 ) -#define SID_ATTR_TABSTOP_OFFSET ( SID_SVX_START + 5 ) +#define SID_ATTR_BRUSH TypedWhichId<SvxBrushItem>( SID_SVX_START + 1 ) +#define SID_ATTR_TABSTOP TypedWhichId<SvxTabStopItem>( SID_SVX_START + 2 ) +#define SID_ATTR_TABSTOP_DEFAULTS TypedWhichId<SfxUInt16Item>( SID_SVX_START + 3 ) +#define SID_ATTR_TABSTOP_POS TypedWhichId<SfxUInt16Item>( SID_SVX_START + 4 ) +#define SID_ATTR_TABSTOP_OFFSET TypedWhichId<SfxInt32Item>( SID_SVX_START + 5 ) #define SID_ATTR_CHAR ( SID_SVX_START + 6 ) -#define SID_ATTR_CHAR_FONT ( SID_SVX_START + 7 ) -#define SID_ATTR_CHAR_POSTURE ( SID_SVX_START + 8 ) +#define SID_ATTR_CHAR_FONT TypedWhichId<SvxFontItem>( SID_SVX_START + 7 ) +#define SID_ATTR_CHAR_POSTURE TypedWhichId<SvxPostureItem>( SID_SVX_START + 8 ) #define SID_ATTR_CHAR_WEIGHT ( SID_SVX_START + 9 ) #define SID_ATTR_CHAR_SHADOWED ( SID_SVX_START + 10 ) #define SID_ATTR_CHAR_WORDLINEMODE ( SID_SVX_START + 11 ) @@ -77,7 +84,7 @@ class SvxLanguageItem; #define SID_ATTR_LRSPACE ( SID_SVX_START + 48 ) #define SID_ATTR_ULSPACE ( SID_SVX_START + 49 ) #define SID_ATTR_PARA_ABOVESPACE ( SID_SVX_START + 64 ) -#define SID_ATTR_PARA_MODEL ( SID_SVX_START + 65 ) +#define SID_ATTR_PARA_MODEL TypedWhichId<SvxPageModelItem>( SID_SVX_START + 65 ) #define SID_ATTR_PARA_KEEP ( SID_SVX_START + 66 ) #define SID_ATTR_CHAR_AUTOKERN ( SID_SVX_START + 67 ) #define SID_HANGING_INDENT ( SID_SVX_START + 68 ) @@ -131,13 +138,13 @@ class SvxLanguageItem; #define SID_ATTR_ALIGN_HOR_JUSTIFY_METHOD ( SID_EDIT_START + 69 ) #define SID_ATTR_ALIGN_VER_JUSTIFY_METHOD ( SID_EDIT_START + 70 ) #define SID_ATTR_ALIGN_HOR_JUSTIFY ( SID_EDIT_START + 71 ) -#define SID_ATTR_ALIGN_VER_JUSTIFY ( SID_EDIT_START + 72 ) -#define SID_ATTR_PARA_OUTLINE_LEVEL ( SID_EDIT_START + 73 ) -#define SID_ATTR_CHAR_PREVIEW_FONT ( SID_EDIT_START + 74 ) -#define SID_ATTR_CHAR_ENDPREVIEW_FONT ( SID_EDIT_START + 75 ) +#define SID_ATTR_ALIGN_VER_JUSTIFY TypedWhichId<SvxVerJustifyItem>( SID_EDIT_START + 72 ) +#define SID_ATTR_PARA_OUTLINE_LEVEL TypedWhichId<SfxUInt16Item>( SID_EDIT_START + 73 ) +#define SID_ATTR_CHAR_PREVIEW_FONT TypedWhichId<SvxFontItem>( SID_EDIT_START + 74 ) +#define SID_ATTR_CHAR_ENDPREVIEW_FONT TypedWhichId<SvxFontItem>( SID_EDIT_START + 75 ) #define SID_ATTR_CHAR_BOX ( SID_EDIT_START + 76 ) #define SID_ATTR_CHAR_SHADOW ( SID_EDIT_START + 77 ) -#define SID_ATTR_PARA_GRABBAG ( SID_EDIT_START + 78 ) +#define SID_ATTR_PARA_GRABBAG TypedWhichId<SfxGrabBagItem>( SID_EDIT_START + 78 ) #if 95 > (SID_EDIT_END-SID_EDIT_START) diff --git a/include/sfx2/sfxsids.hrc b/include/sfx2/sfxsids.hrc index a89fbee4c51b..12ac2cd763a5 100644 --- a/include/sfx2/sfxsids.hrc +++ b/include/sfx2/sfxsids.hrc @@ -28,6 +28,8 @@ class SfxBoolItem; class SfxDocumentInfoItem; class SfxEventNamesItem; class SfxFlagItem; +class SfxInt16Item; +class SfxInt32Item; class SfxHyphenRegionItem; class SfxMacroInfoItem; class SfxScriptOrganizerItem; @@ -143,7 +145,7 @@ class SvxZoomItem; #define SID_PRINT_COLLATE (SID_SFX_START +1590) #define SID_PRINT_SORT (SID_SFX_START +1591) #define SID_SAVEDOC (SID_SFX_START + 505) -#define SID_FILE_NAME (SID_SFX_START + 507) +#define SID_FILE_NAME TypedWhichId<SfxStringItem>(SID_SFX_START + 507) #define SID_DOCINFO_TITLE TypedWhichId<SfxStringItem>(SID_SFX_START + 557) #define SID_FILE_FILTEROPTIONS TypedWhichId<SfxStringItem>(SID_SFX_START + 527) #define SID_RELOAD (SID_SFX_START + 508) @@ -201,7 +203,7 @@ class SvxZoomItem; #define SID_SAVETO TypedWhichId<SfxBoolItem>(SID_SFX_START + 1546) -#define SID_VERSION (SID_SFX_START + 1583) +#define SID_VERSION TypedWhichId<SfxInt16Item>(SID_SFX_START + 1583) #define SID_DOCUMENT_COMPARE (SID_SFX_START + 1586) #define SID_DOCUMENT_MERGE (SID_SFX_START + 1587) @@ -253,9 +255,9 @@ class SvxZoomItem; #define SID_MAIL_SENDDOCASFORMAT (SID_SFX_START + 1707) #define SID_MAIL_SENDDOCASMS (SID_SFX_START + 1708) #define SID_MAIL_SENDDOCASOOO (SID_SFX_START + 1709) -#define SID_NO_ACCEPT_DIALOG (SID_SFX_START + 1710) +#define SID_NO_ACCEPT_DIALOG TypedWhichId<SfxBoolItem>(SID_SFX_START + 1710) #define SID_NOAUTOSAVE TypedWhichId<SfxBoolItem>(SID_SFX_START + 1711) -#define SID_PRINT_SELECTEDSHEET (SID_SFX_START + 1712) +#define SID_PRINT_SELECTEDSHEET TypedWhichId<SfxBoolItem>(SID_SFX_START + 1712) #define SID_OPTIONS_PAGEURL (SID_SFX_START + 1713) #define SID_MORE_DICTIONARIES (SID_SFX_START + 1714) #define SID_ACTIVATE_STYLE_APPLY (SID_SFX_START + 1715) @@ -330,7 +332,7 @@ class SvxZoomItem; #define SID_DONELINK (SID_SFX_START + 646) #define SID_REFERER (SID_SFX_START + 654) #define SID_PAGE_NUMBER (SID_SFX_START + 655) -#define SID_MODIFIER (SID_SFX_START + 669) +#define SID_MODIFIER TypedWhichId<SfxUInt16Item>(SID_SFX_START + 669) #define SID_SETOPTIONS (SID_SFX_START + 670) #define SID_SOURCEVIEW (SID_SFX_START + 675) #define SID_DOC_STARTPRESENTATION TypedWhichId<SfxBoolItem>(SID_SFX_START + 695) @@ -593,15 +595,15 @@ class SvxZoomItem; #define SID_ATTR_CHAR_COLOR_BACKGROUND (SID_SVX_START + 489) #define SID_ATTR_CHAR_COLOR_BACKGROUND_EXT (SID_SVX_START + 490) #define SID_ATTR_CHAR_COLOR2 (SID_SVX_START + 537) -#define SID_ATTR_COLOR_STR (SID_SVX_START + 540) +#define SID_ATTR_COLOR_STR TypedWhichId<SfxStringItem>(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 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) -#define SID_TABLE_BORDER_INDEX (SID_SVX_START + 1066) -#define SID_TABLE_BORDER_OFFSET (SID_SVX_START + 1067) +#define SID_RULER_MARGIN1 TypedWhichId<SfxStringItem>(SID_SVX_START + 1063) +#define SID_RULER_MARGIN2 TypedWhichId<SfxStringItem>(SID_SVX_START + 1064) +#define SID_TABLE_BORDER_TYPE TypedWhichId<SfxStringItem>(SID_SVX_START + 1065) +#define SID_TABLE_BORDER_INDEX TypedWhichId<SfxUInt16Item>(SID_SVX_START + 1066) +#define SID_TABLE_BORDER_OFFSET TypedWhichId<SfxInt32Item>(SID_SVX_START + 1067) #define FID_SVX_START (SID_LIB_START + 500) #define FID_SEARCH_NOW (FID_SVX_START + 2) diff --git a/include/svx/svxids.hrc b/include/svx/svxids.hrc index a1d973fde81a..8d6e7dc08e10 100644 --- a/include/svx/svxids.hrc +++ b/include/svx/svxids.hrc @@ -139,8 +139,8 @@ class XFillGradientItem; #define SID_SIZE_PAGE_WIDTH (SID_SD_START+98) #define SID_INSERT_MATH (SID_SD_START+106) #define SID_SIZE_VISAREA (SID_SD_START+114) -#define SID_ATTR_SYMBOLTYPE (SID_SD_START+115) // used by Chart and SvxLineTabPage -#define SID_ATTR_SYMBOLSIZE (SID_SD_START+116) +#define SID_ATTR_SYMBOLTYPE TypedWhichId<SfxInt32Item>(SID_SD_START+115) // used by Chart and SvxLineTabPage +#define SID_ATTR_SYMBOLSIZE TypedWhichId<SvxSizeItem>(SID_SD_START+116) #define SID_HELPLINES_MOVE (SID_SD_START+153) #define SID_GRID_USE (SID_SD_START+154) #define ID_VAL_MOUSESTART_X (SID_SD_START+200) @@ -422,14 +422,14 @@ class XFillGradientItem; #define SID_ATTR_TRANSFORM_RESIZE_REF_Y ( SID_SVX_START + 309 ) #define SID_ATTR_TRANSFORM_AUTOWIDTH TypedWhichId<SfxBoolItem>( SID_SVX_START + 310 ) #define SID_ATTR_TRANSFORM_AUTOHEIGHT TypedWhichId<SfxBoolItem>( SID_SVX_START + 311 ) -#define SID_ATTR_TRANSFORM_HORI_RELATION ( SID_SVX_START + 312 ) -#define SID_ATTR_TRANSFORM_VERT_RELATION ( SID_SVX_START + 313 ) -#define SID_ATTR_TRANSFORM_HORI_ORIENT ( SID_SVX_START + 314 ) +#define SID_ATTR_TRANSFORM_HORI_RELATION TypedWhichId<SfxInt16Item>( SID_SVX_START + 312 ) +#define SID_ATTR_TRANSFORM_VERT_RELATION TypedWhichId<SfxInt16Item>( SID_SVX_START + 313 ) +#define SID_ATTR_TRANSFORM_HORI_ORIENT TypedWhichId<SfxInt16Item>( SID_SVX_START + 314 ) #define SID_ATTR_TRANSFORM_IN_VERTICAL_TEXT ( SID_SVX_START + 315 ) #define SID_ATTR_TRANSFORM_IN_RTL_TEXT ( SID_SVX_START + 316 ) -#define SID_ATTR_TRANSFORM_HORI_MIRROR ( SID_SVX_START + 317 ) -#define SID_ATTR_TRANSFORM_ANCHOR ( SID_SVX_START + 318 ) -#define SID_ATTR_TRANSFORM_VERT_ORIENT ( SID_SVX_START + 319 ) +#define SID_ATTR_TRANSFORM_HORI_MIRROR TypedWhichId<SfxBoolItem>( SID_SVX_START + 317 ) +#define SID_ATTR_TRANSFORM_ANCHOR TypedWhichId<SfxInt16Item>( SID_SVX_START + 318 ) +#define SID_ATTR_TRANSFORM_VERT_ORIENT TypedWhichId<SfxInt16Item>( SID_SVX_START + 319 ) #define SID_ATTR_GLOW_RADIUS ( SID_SVX_START + 320 ) #define SID_ATTR_GLOW_COLOR ( SID_SVX_START + 321 ) #define SID_ATTR_GLOW_TRANSPARENCY ( SID_SVX_START + 322 ) @@ -458,7 +458,7 @@ class XFillGradientItem; // CAUTION! Range <363 .. 363> used by EditEngine (!) #define SID_ATTR_TEXT_FITTOSIZE ( SID_SVX_START + 367 ) -#define SID_ATTR_BRUSH_ROW ( SID_SVX_START + 368 ) +#define SID_ATTR_BRUSH_ROW TypedWhichId<SvxBrushItem>( SID_SVX_START + 368 ) #define SID_OPTFILTER_MSOFFICE ( SID_SVX_START + 369 ) #define SID_IMAP ( SID_SVX_START + 371 ) #define SID_IMAP_EXEC ( SID_SVX_START + 374 ) @@ -524,9 +524,9 @@ class XFillGradientItem; #define SID_SD_GRAPHIC_OPTIONS ( SID_SVX_START + 447 ) #define SID_SM_TP_PRINTOPTIONS ( SID_SVX_START + 448 ) #define SID_SB_STARBASEOPTIONS ( SID_SVX_START + 450 ) -#define SID_SWREGISTER_COLLECTION ( SID_SVX_START + 451 ) +#define SID_SWREGISTER_COLLECTION TypedWhichId<SfxStringItem>( SID_SVX_START + 451 ) #define SID_FILTER_DLG ( SID_SVX_START + 452 ) -#define SID_ATTR_BRUSH_TABLE ( SID_SVX_START + 453 ) +#define SID_ATTR_BRUSH_TABLE TypedWhichId<SvxBrushItem>( SID_SVX_START + 453 ) #define SID_GROUP ( SID_SVX_START + 454 ) #define SID_UNGROUP ( SID_SVX_START + 455 ) #define SID_SET_DEFAULT ( SID_SVX_START + 456 ) @@ -540,7 +540,7 @@ class XFillGradientItem; #define SID_DRAW_FREELINE ( SID_SVX_START + 463 ) #define SID_DRAW_FREELINE_NOFILL ( SID_SVX_START + 464 ) #define SID_DRAW_TEXT_MARQUEE ( SID_SVX_START + 465 ) -#define SID_SWREGISTER_MODE ( SID_SVX_START + 467 ) +#define SID_SWREGISTER_MODE TypedWhichId<SfxBoolItem>( SID_SVX_START + 467 ) #define SID_GRFFILTER ( SID_SVX_START + 469 ) #define SID_GRFFILTER_INVERT ( SID_SVX_START + 470 ) #define SID_GRFFILTER_SMOOTH ( SID_SVX_START + 471 ) @@ -564,9 +564,9 @@ class XFillGradientItem; // CAUTION! Range <587 .. 587> used by EditEngine (!) -#define SID_PARAGRAPH_FIRST_LINE_INDENT ( SID_SVX_START + 588 ) -#define SID_PARAGRAPH_LEFT_INDENT ( SID_SVX_START + 589 ) -#define SID_PARAGRAPH_RIGHT_INDENT ( SID_SVX_START + 590 ) +#define SID_PARAGRAPH_FIRST_LINE_INDENT TypedWhichId<SfxStringItem>( SID_SVX_START + 588 ) +#define SID_PARAGRAPH_LEFT_INDENT TypedWhichId<SfxStringItem>( SID_SVX_START + 589 ) +#define SID_PARAGRAPH_RIGHT_INDENT TypedWhichId<SfxStringItem>( SID_SVX_START + 590 ) // CAUTION! Range <591 .. 591> used by EditEngine (!) @@ -625,7 +625,7 @@ class XFillGradientItem; #define SID_CONVERT_TO_3D ( SID_SVX_START + 648 ) #define SID_CONVERT_TO_3D_LATHE_FAST ( SID_SVX_START + 649 ) #define SID_ATTR_3D_END SID_CONVERT_TO_3D_LATHE_FAST -#define SID_ATTR_NUMBERFORMAT_NOLANGUAGE ( SID_SVX_START + 700 ) +#define SID_ATTR_NUMBERFORMAT_NOLANGUAGE TypedWhichId<SfxBoolItem>( SID_SVX_START + 700 ) #define SID_MORE_FMSLOTS_START ( SID_SVX_START + 702 ) #define SID_FM_SHOW_PROPERTY_BROWSER ( SID_SVX_START + 703 ) @@ -718,10 +718,10 @@ class XFillGradientItem; // CAUTION! Range <877 .. 877> used by EditEngine (!) -#define SID_ATTR_GRAF_KEEP_ZOOM ( SID_SVX_START + 882 ) +#define SID_ATTR_GRAF_KEEP_ZOOM TypedWhichId<SfxBoolItem>( SID_SVX_START + 882 ) #define SID_ATTR_GRAF_CROP ( SID_SVX_START + 883 ) #define SID_ATTR_GRAF_FRMSIZE TypedWhichId<SvxSizeItem>( SID_SVX_START + 884 ) -#define SID_ATTR_GRAF_FRMSIZE_PERCENT ( SID_SVX_START + 885 ) +#define SID_ATTR_GRAF_FRMSIZE_PERCENT TypedWhichId<SvxSizeItem>( SID_SVX_START + 885 ) #define SID_ATTR_GRAF_GRAPHIC TypedWhichId<SvxBrushItem>( SID_SVX_START + 886 ) #define SID_DRAW_TEXT_VERTICAL SID_ATTR_CHAR_VERTICAL @@ -756,7 +756,7 @@ class XFillGradientItem; #define SID_INSERT_VFIXEDLINE ( SID_SVX_START + 929 ) #define SID_READONLY_MODE ( SID_SVX_START + 930 ) #define SID_ATTR_ALIGN_HYPHENATION ( SID_SVX_START + 931 ) -#define SID_ATTR_NUMBERFORMAT_SOURCE ( SID_SVX_START + 932 ) +#define SID_ATTR_NUMBERFORMAT_SOURCE TypedWhichId<SfxBoolItem>( SID_SVX_START + 932 ) #define SID_RULER_BORDER_DISTANCE ( SID_SVX_START + 935 ) #define SID_INSERT_DATEFIELD ( SID_SVX_START + 936 ) @@ -781,7 +781,7 @@ class XFillGradientItem; #define SID_RULER_TEXT_RIGHT_TO_LEFT ( SID_SVX_START + 952 ) #define SID_ATTR_HDFT_DYNAMIC_SPACING ( SID_SVX_START + 953 ) -#define SID_ATTR_NUMBERFORMAT_ADD_AUTO ( SID_SVX_START + 954 ) +#define SID_ATTR_NUMBERFORMAT_ADD_AUTO TypedWhichId<SfxBoolItem>( SID_SVX_START + 954 ) #define SID_OPEN_HYPERLINK ( SID_SVX_START + 955 ) #define SID_CTLFONT_STATE ( SID_SVX_START + 956 ) #define SID_VERTICALTEXT_STATE ( SID_SVX_START + 957 ) @@ -826,8 +826,8 @@ class XFillGradientItem; // CAUTION! Range <994 .. 998> used by EditEngine (!) -#define SID_ATTR_TRANSFORM_HORI_POSITION ( SID_SVX_START + 999 ) -#define SID_ATTR_TRANSFORM_VERT_POSITION ( SID_SVX_START + 1000 ) +#define SID_ATTR_TRANSFORM_HORI_POSITION TypedWhichId<SfxInt32Item>( SID_SVX_START + 999 ) +#define SID_ATTR_TRANSFORM_VERT_POSITION TypedWhichId<SfxInt32Item>( SID_SVX_START + 1000 ) // Available for use 1001 #define SID_ALIGN_ANY_LEFT ( SID_SVX_START + 1002 ) #define SID_ALIGN_ANY_HCENTER ( SID_SVX_START + 1003 ) diff --git a/sc/inc/sc.hrc b/sc/inc/sc.hrc index c87effa212fe..f391e618357b 100644 --- a/sc/inc/sc.hrc +++ b/sc/inc/sc.hrc @@ -187,8 +187,8 @@ class SvxZoomSliderItem; #define SID_STATUS_SELMODE_ERW (SC_MESSAGE_START + 23) #define SID_STATUS_SELMODE_NORM (SC_MESSAGE_START + 24) -#define SID_CHART_SOURCE (SC_MESSAGE_START + 25) -#define SID_CHART_NAME (SC_MESSAGE_START + 26) +#define SID_CHART_SOURCE TypedWhichId<SfxStringItem>(SC_MESSAGE_START + 25) +#define SID_CHART_NAME TypedWhichId<SfxStringItem>(SC_MESSAGE_START + 26) #define SID_CHART_ADDSOURCE (SC_MESSAGE_START + 27) #define SID_AUTO_STYLE (SC_MESSAGE_START + 28) @@ -310,11 +310,11 @@ class SvxZoomSliderItem; #define FORMAT_MENU_START (INSERT_MENU_END) #define FID_CELL_FORMAT (FORMAT_MENU_START) -#define FID_ROW_HEIGHT (FORMAT_MENU_START + 1) +#define FID_ROW_HEIGHT TypedWhichId<SfxUInt16Item>(FORMAT_MENU_START + 1) #define FID_ROW_OPT_HEIGHT (FORMAT_MENU_START + 2) #define FID_ROW_HIDE (FORMAT_MENU_START + 3) #define FID_ROW_SHOW (FORMAT_MENU_START + 4) -#define FID_COL_WIDTH (FORMAT_MENU_START + 5) +#define FID_COL_WIDTH TypedWhichId<SfxUInt16Item>(FORMAT_MENU_START + 5) #define FID_COL_OPT_WIDTH (FORMAT_MENU_START + 6) #define FID_COL_HIDE (FORMAT_MENU_START + 7) #define FID_COL_SHOW (FORMAT_MENU_START + 8) @@ -336,7 +336,7 @@ class SvxZoomSliderItem; #define FID_PROTECT_TABLE (EXTRA_MENU_START + 6) #define FID_PROTECT_DOC (EXTRA_MENU_START + 7) #define SID_SHARE_DOC (EXTRA_MENU_START + 11) -#define SID_SCENARIOS (EXTRA_MENU_START + 12) +#define SID_SCENARIOS TypedWhichId<SfxStringItem>(EXTRA_MENU_START + 12) #define SID_PIVOT_RECALC (EXTRA_MENU_START + 14) #define SID_PIVOT_KILL (EXTRA_MENU_START + 15) @@ -490,7 +490,7 @@ class SvxZoomSliderItem; #define SID_MARKAREA (SID_KEYFUNC_START + 33) -#define FID_FILL_AUTO (SID_KEYFUNC_START + 35) +#define FID_FILL_AUTO TypedWhichId<SfxStringItem>(SID_KEYFUNC_START + 35) #define SID_CANCEL (SID_KEYFUNC_START + 36) #define SID_CURSORENTERUP (SID_KEYFUNC_START + 37) @@ -505,13 +505,13 @@ class SvxZoomSliderItem; #define SID_NEW_SLOTS (SID_KEYFUNC_END) -#define SID_NEW_TABLENAME (SID_NEW_SLOTS+1) +#define SID_NEW_TABLENAME TypedWhichId<SfxStringItem>(SID_NEW_SLOTS+1) #define SID_EXPORT_AS_GRAPHIC (SID_NEW_SLOTS+2) #define FID_MERGE_TOGGLE (SID_NEW_SLOTS+10) -#define SID_RANGE_ROW (SID_NEW_SLOTS+20) -#define SID_RANGE_COL (SID_NEW_SLOTS+21) +#define SID_RANGE_ROW TypedWhichId<SfxInt32Item>(SID_NEW_SLOTS+20) +#define SID_RANGE_COL TypedWhichId<SfxInt16Item>(SID_NEW_SLOTS+21) #define SID_RANGE_TABLE (SID_NEW_SLOTS+22) // empty, was SID_RANGE_VALUE #define SID_RANGE_FORMULA (SID_NEW_SLOTS+24) @@ -605,14 +605,14 @@ class SvxZoomSliderItem; #define SID_CURRENT_FORMULA_RANGE (SID_NEW_SLOTS+109) // idl parameter -#define SID_SORT_BYROW (SC_PARAM_START) -#define SID_SORT_HASHEADER (SC_PARAM_START+1) -#define SID_SORT_CASESENS (SC_PARAM_START+2) -#define SID_SORT_ATTRIBS (SC_PARAM_START+3) -#define SID_SORT_USERDEF (SC_PARAM_START+4) -#define SID_SORT_NATURALSORT (SC_PARAM_START+5) -#define SID_SORT_INCCOMMENTS (SC_PARAM_START+6) -#define SID_SORT_INCIMAGES (SC_PARAM_START+7) +#define SID_SORT_BYROW TypedWhichId<SfxBoolItem>(SC_PARAM_START) +#define SID_SORT_HASHEADER TypedWhichId<SfxBoolItem>(SC_PARAM_START+1) +#define SID_SORT_CASESENS TypedWhichId<SfxBoolItem>(SC_PARAM_START+2) +#define SID_SORT_ATTRIBS TypedWhichId<SfxBoolItem>(SC_PARAM_START+3) +#define SID_SORT_USERDEF TypedWhichId<SfxUInt16Item>(SC_PARAM_START+4) +#define SID_SORT_NATURALSORT TypedWhichId<SfxBoolItem>(SC_PARAM_START+5) +#define SID_SORT_INCCOMMENTS TypedWhichId<SfxBoolItem>(SC_PARAM_START+6) +#define SID_SORT_INCIMAGES TypedWhichId<SfxBoolItem>(SC_PARAM_START+7) // Sidebar ------------------------------------------------------------- diff --git a/sd/source/ui/func/fubullet.cxx b/sd/source/ui/func/fubullet.cxx index 108af78b11af..3cf19b9a139f 100644 --- a/sd/source/ui/func/fubullet.cxx +++ b/sd/source/ui/func/fubullet.cxx @@ -172,7 +172,7 @@ void FuBullet::InsertSpecialCharacter( SfxRequest const & rReq ) { SfxItemSet aFontAttr( mpDoc->GetPool() ); mpView->GetAttributes( aFontAttr ); - const SvxFontItem* pFItem = static_cast<const SvxFontItem*>(aFontAttr.GetItem( SID_ATTR_CHAR_FONT )); + const SvxFontItem* pFItem = aFontAttr.GetItem( SID_ATTR_CHAR_FONT ); if( pFItem ) aFont = vcl::Font( pFItem->GetFamilyName(), pFItem->GetStyleName(), Size( 1, 1 ) ); } @@ -185,7 +185,7 @@ void FuBullet::InsertSpecialCharacter( SfxRequest const & rReq ) SfxItemSet aFontAttr( mpDoc->GetPool() ); mpView->GetAttributes( aFontAttr ); - const SvxFontItem* pFontItem = static_cast<const SvxFontItem*>(aFontAttr.GetItem( SID_ATTR_CHAR_FONT )); + const SvxFontItem* pFontItem = aFontAttr.GetItem( SID_ATTR_CHAR_FONT ); if( pFontItem ) aSet.Put( *pFontItem ); diff --git a/sw/inc/cmdid.h b/sw/inc/cmdid.h index 559a8949998c..233b7870bef8 100644 --- a/sw/inc/cmdid.h +++ b/sw/inc/cmdid.h @@ -24,8 +24,12 @@ #include <svx/svxids.hrc> #include <svl/solar.hrc> +class SvxFrameDirectionItem; +class SvxSizeItem; class SwAddPrinterItem; +class SwPageFootnoteInfoItem; class SwPtrItem; +class SwUINumRuleItem; #define FN_FILE SID_SW_START //#define FN_EDIT (SID_SW_START + 100) defined in svxids.hrc @@ -149,7 +153,7 @@ class SwPtrItem; #define FN_REDLINE_REJECT_TONEXT (FN_EDIT2 + 46) /* Redlining Reject and jump to next*/ // Region: View -#define FN_DRAW_WRAP_DLG (FN_VIEW + 3) /* Draw wrapping dlg */ +#define FN_DRAW_WRAP_DLG TypedWhichId<SfxInt16Item>(FN_VIEW + 3) /* Draw wrapping dlg */ #define FN_RULER (FN_VIEW + 11) /* Horizontal ruler */ #define FN_VIEW_GRAPHIC (FN_VIEW + 13) /* View graphic */ @@ -173,11 +177,11 @@ class SwPtrItem; #define FN_VIEW_HIDDEN_PARA (FN_VIEW + 42) /* View hidden paragraphs */ #define FN_VIEW_SMOOTH_SCROLL (FN_VIEW + 43) -#define FN_PREVIEW_ZOOM (FN_VIEW + 51) /* create table controller for zoom */ +#define FN_PREVIEW_ZOOM TypedWhichId<SfxUInt16Item>(FN_VIEW + 51) /* create table controller for zoom */ #define FN_SET_MODOPT_TBLNUMFMT (FN_VIEW + 52) /* Number recognition in tables */ -#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_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 */ @@ -320,7 +324,7 @@ class SwPtrItem; #define FN_FORMAT_PAGE_DLG (FN_FORMAT + 52) /* page */ #define FN_FORMAT_COLUMN (FN_FORMAT + 53) /* columns */ #define FN_FORMAT_DROPCAPS (FN_FORMAT + 54) /* initials */ -#define FN_FORMAT_FRAME_DLG (FN_FORMAT + 56) /* frame */ +#define FN_FORMAT_FRAME_DLG TypedWhichId<SfxStringItem>(FN_FORMAT + 56) /* frame */ #define FN_FORMAT_GRAFIC_DLG (FN_FORMAT + 58) /* graphic */ #define FN_FORMAT_TABLE_DLG (FN_FORMAT + 60) /* table */ @@ -345,7 +349,7 @@ class SwPtrItem; #define FN_FORMAT_TITLEPAGE_DLG (FN_FORMAT + 98) /* Title Page */ -#define FN_TABLE_REP (FN_FORMAT + 99) /* TableRepresentation */ +#define FN_TABLE_REP TypedWhichId<SwPtrItem>(FN_FORMAT + 99) /* TableRepresentation */ #define FN_CONVERT_TEXT_TABLE (FN_FORMAT + 100) /* convert text <-> table */ #define FN_TABLE_INSERT_ROW (FN_FORMAT + 101) /* */ #define FN_TABLE_INSERT_COL (FN_FORMAT + 102) /* */ @@ -424,11 +428,11 @@ class SwPtrItem; // +185..+187 removed in favor of corresponding globally available slot -#define FN_TABLE_SET_VERT_ALIGN (FN_FORMAT + 188) /* vertical alignment in Writer table cells */ +#define FN_TABLE_SET_VERT_ALIGN TypedWhichId<SfxUInt16Item>(FN_FORMAT + 188) /* vertical alignment in Writer table cells */ #define FN_TABLE_MODE_FIX (FN_FORMAT + 189) /* table mode */ #define FN_TABLE_MODE_FIX_PROP (FN_FORMAT + 190) /* -"- */ #define FN_TABLE_MODE_VARIABLE (FN_FORMAT + 191) /* -"- */ -#define FN_TABLE_BOX_TEXTORIENTATION (FN_FORMAT + 192) /* text orientation of table cells */ +#define FN_TABLE_BOX_TEXTORIENTATION TypedWhichId<SvxFrameDirectionItem>(FN_FORMAT + 192) /* text orientation of table cells */ #define SID_ATTR_TABLE_ROW_HEIGHT (FN_FORMAT + 193) #define SID_ATTR_TABLE_COLUMN_WIDTH (FN_FORMAT2 + 194) @@ -619,8 +623,8 @@ class SwPtrItem; #define FN_NAVIGATION_FORWARD (FN_EXTRA2 + 115) // #i972: bool items to be passed to SwFramePage for evaluation -#define FN_OLE_IS_MATH (FN_EXTRA2 + 116) -#define FN_MATH_BASELINE_ALIGNMENT (FN_EXTRA2 + 117) +#define FN_OLE_IS_MATH TypedWhichId<SfxBoolItem>(FN_EXTRA2 + 116) +#define FN_MATH_BASELINE_ALIGNMENT TypedWhichId<SfxBoolItem>(FN_EXTRA2 + 117) #define FN_EMBEDDED_OBJECT (FN_EXTRA2 + 118) #define FN_UNO_DRAW_ASPECT (FN_EXTRA2 + 119) @@ -738,14 +742,14 @@ class SwPtrItem; #define FN_TXTATR_INET (FN_QUERY +29) /* INet-Attribute */ #define FN_GET_PRINT_AREA (FN_QUERY +32) /* Get attribute for printable area of page */ -#define FN_DB_CONNECTION_ANY (FN_QUERY2 + 3) -#define FN_DB_COLUMN_ANY (FN_QUERY2 + 4) -#define FN_DB_DATA_SOURCE_ANY (FN_QUERY2 + 5) -#define FN_DB_DATA_COMMAND_ANY (FN_QUERY2 + 6) -#define FN_DB_DATA_COMMAND_TYPE_ANY (FN_QUERY2 + 7) -#define FN_DB_DATA_COLUMN_NAME_ANY (FN_QUERY2 + 8) -#define FN_DB_DATA_SELECTION_ANY (FN_QUERY2 + 9) -#define FN_DB_DATA_CURSOR_ANY (FN_QUERY2 + 10) +#define FN_DB_CONNECTION_ANY TypedWhichId<SfxUnoAnyItem>(FN_QUERY2 + 3) +#define FN_DB_COLUMN_ANY TypedWhichId<SfxUnoAnyItem>(FN_QUERY2 + 4) +#define FN_DB_DATA_SOURCE_ANY TypedWhichId<SfxUnoAnyItem>(FN_QUERY2 + 5) +#define FN_DB_DATA_COMMAND_ANY TypedWhichId<SfxUnoAnyItem>(FN_QUERY2 + 6) +#define FN_DB_DATA_COMMAND_TYPE_ANY TypedWhichId<SfxUnoAnyItem>(FN_QUERY2 + 7) +#define FN_DB_DATA_COLUMN_NAME_ANY TypedWhichId<SfxUnoAnyItem>(FN_QUERY2 + 8) +#define FN_DB_DATA_SELECTION_ANY TypedWhichId<SfxUnoAnyItem>(FN_QUERY2 + 9) +#define FN_DB_DATA_CURSOR_ANY TypedWhichId<SfxUnoAnyItem>(FN_QUERY2 + 10) // Region: Envelope #define FN_ENVELOP (FN_ENVELP ) @@ -764,15 +768,15 @@ class SwPtrItem; #define FN_DELETE_COMMENT_THREAD (FN_NOTES+11) // Region: Parameter -#define FN_PARAM_MOVE_COUNT (FN_PARAM+2) -#define FN_PARAM_MOVE_SELECTION (FN_PARAM+3) +#define FN_PARAM_MOVE_COUNT TypedWhichId<SfxInt32Item>(FN_PARAM+2) +#define FN_PARAM_MOVE_SELECTION TypedWhichId<SfxBoolItem>(FN_PARAM+3) #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_FTN_INFO TypedWhichId<SwPageFootnoteInfoItem>(FN_PARAM+23) #define FN_PARAM_REGION_NAME TypedWhichId<SfxStringItem>(FN_PARAM+24) #define FN_PARAM_REGION_CONDITION TypedWhichId<SfxStringItem>(FN_PARAM+25) @@ -780,18 +784,18 @@ class SwPtrItem; #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) +#define FN_PARAM_INSERT_AFTER TypedWhichId<SfxBoolItem>(FN_PARAM+29) -#define FN_PARAM_TABLE_NAME (FN_PARAM+44) -#define FN_PARAM_TABLE_HEADLINE (FN_PARAM+50) +#define FN_PARAM_TABLE_NAME TypedWhichId<SfxStringItem>(FN_PARAM+44) +#define FN_PARAM_TABLE_HEADLINE TypedWhichId<SfxUInt16Item>(FN_PARAM+50) #define FN_PARAM_TABLE_SPACE (FN_PARAM+51) -#define FN_PARAM_GRF_CONNECT (FN_PARAM+53) -#define FN_PARAM_FIELD_TYPE (FN_PARAM+54) -#define FN_PARAM_FIELD_SUBTYPE (FN_PARAM+56) -#define FN_PARAM_FIELD_FORMAT (FN_PARAM+57) +#define FN_PARAM_GRF_CONNECT TypedWhichId<SfxBoolItem>(FN_PARAM+53) +#define FN_PARAM_FIELD_TYPE TypedWhichId<SfxUInt16Item>(FN_PARAM+54) +#define FN_PARAM_FIELD_SUBTYPE TypedWhichId<SfxUInt16Item>(FN_PARAM+56) +#define FN_PARAM_FIELD_FORMAT TypedWhichId<SfxUInt32Item>(FN_PARAM+57) -#define FN_PARAM_GRF_REALSIZE (FN_PARAM+70) +#define FN_PARAM_GRF_REALSIZE TypedWhichId<SvxSizeItem>(FN_PARAM+70) #define FN_PARAM_GRF_DIALOG (FN_PARAM+71) #define FN_INET_FIELD_MACRO (FN_PARAM+77) /* Id for URL-Field-Macros*/ @@ -803,31 +807,31 @@ class SwPtrItem; #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_ACT_NUMBER TypedWhichId<SwUINumRuleItem>(FN_PARAM2+3) /* PointerItem the current NumRule */ -#define FN_PARAM_NUM_PRESET (FN_PARAM2+5) /* predefined numbering */ +#define FN_PARAM_NUM_PRESET TypedWhichId<SfxBoolItem>(FN_PARAM2+5) /* predefined numbering */ #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 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_TOX_TYPE TypedWhichId<SfxUInt16Item>(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*/ #define FN_PARAM_CONTOUR_PP (FN_PARAM2+17) /* contour PolyPolygon*/ #define FN_ANCHOR_POSITION (FN_PARAM2+18) /* AnchorPosition property */ -#define FN_DROP_TEXT (FN_PARAM2+18) /* text set in drop caps tab page - for recording */ -#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_DROP_TEXT TypedWhichId<SfxStringItem>(FN_PARAM2+18) /* text set in drop caps tab page - for recording */ +#define FN_DROP_CHAR_STYLE_NAME TypedWhichId<SfxStringItem>(FN_PARAM2+19) /* character style of drop caps - for recording */ +#define FN_PARAM_CHAIN_PREVIOUS TypedWhichId<SfxStringItem>(FN_PARAM2+20) /* Name of frame to be added as chain successor */ +#define FN_PARAM_CHAIN_NEXT TypedWhichId<SfxStringItem>(FN_PARAM2+21) /* Name of frame to be added as chain predecessor */ #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) #define FN_SHAPE_ENDPOSITION_IN_HORI_L2R (FN_PARAM2+26) -#define FN_PARAM_PAM (FN_PARAM2+27) /* Point and Mark */ +#define FN_PARAM_PAM TypedWhichId<SwPaMItem>(FN_PARAM2+27) /* Point and Mark */ #define FN_TEXT_BOX (FN_PARAM2+28) /* TextBox Property*/ #define FN_BOOKMARK_HIDDEN (FN_PARAM2+29) /* Hidden Property of bookmarks*/ #define FN_BOOKMARK_CONDITION (FN_PARAM2+30) /* Condition Property of bookmarks*/ @@ -859,9 +863,9 @@ class SwPtrItem; #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_SET_FRM_ALT_NAME TypedWhichId<SfxStringItem>(FN_FRAME + 18) #define FN_UNO_TITLE (FN_FRAME + 19) -#define FN_UNO_DESCRIPTION (FN_FRAME + 20) +#define FN_UNO_DESCRIPTION TypedWhichId<SfxStringItem>(FN_FRAME + 20) #define SID_ATTR_PAGE_COLUMN (FN_SIDEBAR + 0) #define SID_ATTR_PAGE_HEADER (FN_SIDEBAR + 3) diff --git a/sw/inc/hintids.hxx b/sw/inc/hintids.hxx index a14b1a9e2779..6cf969d3a392 100644 --- a/sw/inc/hintids.hxx +++ b/sw/inc/hintids.hxx @@ -464,7 +464,7 @@ constexpr sal_uInt16 RES_FLTRATTR_END(197); constexpr sal_uInt16 RES_TBX_DUMMY(RES_FLTRATTR_END + 1); -constexpr sal_uInt16 HINT_END(RES_TBX_DUMMY); +constexpr TypedWhichId<SfxStringItem> HINT_END(RES_TBX_DUMMY); // Error recognition!! constexpr sal_uInt16 INVALID_HINT(HINT_END); diff --git a/sw/source/core/unocore/unostyle.cxx b/sw/source/core/unocore/unostyle.cxx index 40b9878f59a2..43722e270a91 100644 --- a/sw/source/core/unocore/unostyle.cxx +++ b/sw/source/core/unocore/unostyle.cxx @@ -113,6 +113,7 @@ #include <ccoll.hxx> #include <hints.hxx> +#include <uiitems.hxx> #include <cassert> #include <memory> @@ -3037,7 +3038,7 @@ void SwXPageStyle::SetPropertyValues_Impl(const uno::Sequence<OUString>& rProper throw lang::IllegalArgumentException(); case FN_PARAM_FTN_INFO: { - const SfxPoolItem& rItem = aBaseImpl.GetItemSet().Get(FN_PARAM_FTN_INFO); + const SwPageFootnoteInfoItem& rItem = aBaseImpl.GetItemSet().Get(FN_PARAM_FTN_INFO); std::unique_ptr<SfxPoolItem> pNewFootnoteItem(rItem.Clone()); if(!pNewFootnoteItem->PutValue(rValues[nProp], pEntry->nMemberId)) throw lang::IllegalArgumentException(); diff --git a/sw/source/filter/ww8/rtfsdrexport.cxx b/sw/source/filter/ww8/rtfsdrexport.cxx index 8f0941261cef..09804fb24f80 100644 --- a/sw/source/filter/ww8/rtfsdrexport.cxx +++ b/sw/source/filter/ww8/rtfsdrexport.cxx @@ -628,8 +628,7 @@ sal_Int32 RtfSdrExport::StartShape() msfilter::rtfutil::OutString(rEditObj.GetText(0), m_rExport.GetCurrentEncoding())); - auto pFontFamily - = static_cast<const SvxFontItem*>(rItemSet.GetItem(SID_ATTR_CHAR_FONT)); + auto pFontFamily = rItemSet.GetItem(SID_ATTR_CHAR_FONT); if (pFontFamily) { lcl_AppendSP(m_rAttrOutput.RunText(), "gtextFont", diff --git a/sw/source/filter/ww8/wrtw8esh.cxx b/sw/source/filter/ww8/wrtw8esh.cxx index 6325e691c2ec..7927d230a553 100644 --- a/sw/source/filter/ww8/wrtw8esh.cxx +++ b/sw/source/filter/ww8/wrtw8esh.cxx @@ -122,7 +122,7 @@ OUString SwBasicEscherEx::GetBasePath() const const SfxItemSet* pPItemSet = pMedium->GetItemSet(); if( pPItemSet ) { - const SfxStringItem* pPItem = dynamic_cast< const SfxStringItem* >( pPItemSet->GetItem( SID_FILE_NAME ) ); + const SfxStringItem* pPItem = pPItemSet->GetItem( SID_FILE_NAME ); if ( pPItem ) sDocUrl = pPItem->GetValue(); } diff --git a/sw/source/ui/chrdlg/numpara.cxx b/sw/source/ui/chrdlg/numpara.cxx index 205bcacadb6f..064439a1be15 100644 --- a/sw/source/ui/chrdlg/numpara.cxx +++ b/sw/source/ui/chrdlg/numpara.cxx @@ -96,7 +96,7 @@ bool SwParagraphNumTabPage::FillItemSet( SfxItemSet* rSet ) if (m_xOutlineLvLB->get_value_changed_from_saved()) { const sal_uInt16 aOutlineLv = m_xOutlineLvLB->get_active(); - const SfxUInt16Item* pOldOutlineLv = static_cast<const SfxUInt16Item*>(GetOldItem( *rSet, SID_ATTR_PARA_OUTLINE_LEVEL)); + const SfxUInt16Item* pOldOutlineLv = GetOldItem( *rSet, SID_ATTR_PARA_OUTLINE_LEVEL); if (pOldOutlineLv) { std::unique_ptr<SfxUInt16Item> pOutlineLv(pOldOutlineLv->Clone()); @@ -165,7 +165,7 @@ void SwParagraphNumTabPage::Reset(const SfxItemSet* rSet) if( eItemState >= SfxItemState::DEFAULT ) { - sal_Int16 nOutlineLv = static_cast<const SfxUInt16Item &>(rSet->Get( GetWhich(SID_ATTR_PARA_OUTLINE_LEVEL) )).GetValue(); + sal_Int16 nOutlineLv = rSet->Get( GetWhich(SID_ATTR_PARA_OUTLINE_LEVEL) ).GetValue(); m_xOutlineLvLB->set_active(nOutlineLv) ; } else diff --git a/sw/source/ui/frmdlg/wrap.cxx b/sw/source/ui/frmdlg/wrap.cxx index 5f608db7108d..a03ddff953be 100644 --- a/sw/source/ui/frmdlg/wrap.cxx +++ b/sw/source/ui/frmdlg/wrap.cxx @@ -129,8 +129,7 @@ void SwWrapTabPage::Reset(const SfxItemSet *rSet) m_xWrapOutlineCB->show(); m_xWrapOutsideCB->show(); - m_xWrapTransparentCB->set_active( 0 == static_cast<const SfxInt16Item&>(rSet->Get( - FN_DRAW_WRAP_DLG)).GetValue() ); + m_xWrapTransparentCB->set_active( 0 == rSet->Get(FN_DRAW_WRAP_DLG).GetValue() ); m_xWrapTransparentCB->save_state(); } else diff --git a/sw/source/ui/misc/pgfnote.cxx b/sw/source/ui/misc/pgfnote.cxx index 452aab1874d1..786d8028f97a 100644 --- a/sw/source/ui/misc/pgfnote.cxx +++ b/sw/source/ui/misc/pgfnote.cxx @@ -211,7 +211,7 @@ void SwFootNotePage::Reset(const SfxItemSet *rSet) // stuff attributes into the set, when OK bool SwFootNotePage::FillItemSet(SfxItemSet *rSet) { - SwPageFootnoteInfoItem aItem(static_cast<const SwPageFootnoteInfoItem&>(GetItemSet().Get(FN_PARAM_FTN_INFO))); + SwPageFootnoteInfoItem aItem(GetItemSet().Get(FN_PARAM_FTN_INFO)); // that's the original SwPageFootnoteInfo &rFootnoteInfo = aItem.GetPageFootnoteInfo(); diff --git a/sw/source/ui/table/tabledlg.cxx b/sw/source/ui/table/tabledlg.cxx index 7762a9d33588..c62b73629aa2 100644 --- a/sw/source/ui/table/tabledlg.cxx +++ b/sw/source/ui/table/tabledlg.cxx @@ -1596,14 +1596,13 @@ void SwTextFlowPage::Reset( const SfxItemSet* rSet ) } if ( rSet->GetItemState(FN_TABLE_BOX_TEXTORIENTATION) > SfxItemState::DEFAULT ) { - SvxFrameDirection nDirection = - static_cast<const SvxFrameDirectionItem&>(rSet->Get(FN_TABLE_BOX_TEXTORIENTATION)).GetValue(); + SvxFrameDirection nDirection = rSet->Get(FN_TABLE_BOX_TEXTORIENTATION).GetValue(); m_xTextDirectionLB->set_active_id(OUString::number(static_cast<sal_uInt32>(nDirection))); } if ( rSet->GetItemState(FN_TABLE_SET_VERT_ALIGN) > SfxItemState::DEFAULT ) { - sal_uInt16 nVert = static_cast<const SfxUInt16Item&>(rSet->Get(FN_TABLE_SET_VERT_ALIGN)).GetValue(); + sal_uInt16 nVert = rSet->Get(FN_TABLE_SET_VERT_ALIGN).GetValue(); sal_uInt16 nPos = 0; switch(nVert) { diff --git a/sw/source/uibase/config/modcfg.cxx b/sw/source/uibase/config/modcfg.cxx index 425534945e67..3f690795b41d 100644 --- a/sw/source/uibase/config/modcfg.cxx +++ b/sw/source/uibase/config/modcfg.cxx @@ -25,6 +25,7 @@ #include <editeng/editids.hrc> #include <osl/diagnose.h> #include <rtl/ustrbuf.hxx> +#include <svl/typedwhich.hxx> #include <tools/globname.hxx> #include <tools/UnitConversion.hxx> diff --git a/sw/source/uibase/shells/txtattr.cxx b/sw/source/uibase/shells/txtattr.cxx index 25b0a3dcb074..ef9d878233c2 100644 --- a/sw/source/uibase/shells/txtattr.cxx +++ b/sw/source/uibase/shells/txtattr.cxx @@ -32,6 +32,7 @@ #include <editeng/lrspitem.hxx> #include <editeng/udlnitem.hxx> #include <editeng/escapementitem.hxx> +#include <editeng/pmdlitem.hxx> #include <sfx2/htmlmode.hxx> #include <editeng/scripttypeitem.hxx> #include <editeng/frmdiritem.hxx> |