sw/inc/fmtanchr.hxx | 2 sw/inc/fmtclbl.hxx | 2 sw/inc/fmtclds.hxx | 2 sw/inc/fmtcnct.hxx | 2 sw/inc/fmtcntnt.hxx | 2 sw/inc/fmteiro.hxx | 2 sw/inc/fmtfollowtextflow.hxx | 2 sw/inc/fmtfordr.hxx | 2 sw/inc/fmtfsize.hxx | 2 sw/inc/fmtftntx.hxx | 4 - sw/inc/fmthdft.hxx | 4 - sw/inc/fmtline.hxx | 2 sw/inc/fmtlsplt.hxx | 2 sw/inc/fmtornt.hxx | 4 - sw/inc/fmtpdsc.hxx | 2 sw/inc/fmtrowsplt.hxx | 2 sw/inc/fmtsrnd.hxx | 2 sw/inc/fmturl.hxx | 2 sw/inc/fmtwrapinfluenceonobjpos.hxx | 2 sw/inc/frmatr.hxx | 28 ++++---- sw/inc/hfspacingitem.hxx | 2 sw/inc/hintids.hxx | 93 +++++++++++++-------------- sw/inc/tgrditem.hxx | 2 sw/inc/unostyle.hxx | 4 - sw/source/core/doc/docdraw.cxx | 2 sw/source/core/doc/docfly.cxx | 2 sw/source/core/doc/docfmt.cxx | 2 sw/source/core/doc/doclay.cxx | 5 - sw/source/core/doc/fmtcol.cxx | 4 - sw/source/core/doc/ftnidx.cxx | 4 - sw/source/core/doc/tblafmt.cxx | 20 ++--- sw/source/core/docnode/ndsect.cxx | 6 - sw/source/core/docnode/ndtbl1.cxx | 6 - sw/source/core/docnode/section.cxx | 1 sw/source/core/fields/docufld.cxx | 2 sw/source/core/frmedt/fefly1.cxx | 8 +- sw/source/core/layout/tabfrm.cxx | 2 sw/source/core/undo/unattr.cxx | 7 -- sw/source/core/undo/undel.cxx | 4 - sw/source/core/unocore/SwXTextDefaults.cxx | 1 sw/source/core/unocore/unodraw.cxx | 2 sw/source/core/unocore/unoframe.cxx | 34 ++++----- sw/source/core/unocore/unostyle.cxx | 36 +++++----- sw/source/core/unocore/unotbl.cxx | 6 - sw/source/filter/basflt/fltini.cxx | 7 -- sw/source/filter/html/htmlatr.cxx | 9 +- sw/source/filter/html/htmlflywriter.cxx | 4 - sw/source/filter/html/htmlnumreader.cxx | 3 sw/source/filter/html/htmlplug.cxx | 4 - sw/source/filter/html/htmlsect.cxx | 2 sw/source/filter/html/htmltab.cxx | 4 - sw/source/filter/html/swhtml.cxx | 4 - sw/source/filter/html/wrthtml.cxx | 4 - sw/source/filter/ww8/docxattributeoutput.cxx | 2 sw/source/filter/ww8/rtfattributeoutput.cxx | 2 sw/source/filter/ww8/rtfexport.cxx | 16 ++-- sw/source/filter/ww8/wrtw8nds.cxx | 7 -- sw/source/filter/ww8/wrtw8sty.cxx | 4 - sw/source/filter/ww8/wrtww8.cxx | 2 sw/source/filter/ww8/ww8atr.cxx | 8 +- sw/source/filter/ww8/ww8graf.cxx | 16 +--- sw/source/filter/xml/xmlitemm.cxx | 1 sw/source/ui/chrdlg/numpara.cxx | 2 sw/source/ui/dialog/uiregionsw.cxx | 10 +- sw/source/ui/envelp/envfmt.cxx | 3 sw/source/ui/frmdlg/column.cxx | 24 +++--- sw/source/ui/frmdlg/frmdlg.cxx | 3 sw/source/ui/frmdlg/frmpage.cxx | 46 ++++++------- sw/source/ui/frmdlg/wrap.cxx | 29 ++++---- sw/source/ui/index/cnttab.cxx | 2 sw/source/ui/misc/linenum.cxx | 2 sw/source/ui/misc/pgfnote.cxx | 4 - sw/source/ui/misc/pggrid.cxx | 12 +-- sw/source/ui/table/tabledlg.cxx | 3 sw/source/uibase/app/appopt.cxx | 3 sw/source/uibase/dochdl/swdtflvr.cxx | 20 ++--- sw/source/uibase/docvw/edtwin.cxx | 12 +-- sw/source/uibase/frmdlg/colex.cxx | 9 +- sw/source/uibase/frmdlg/colmgr.cxx | 6 - sw/source/uibase/frmdlg/frmmgr.cxx | 6 - sw/source/uibase/inc/frmmgr.hxx | 14 ++-- sw/source/uibase/ribbar/drawbase.cxx | 2 sw/source/uibase/shells/basesh.cxx | 29 ++++---- sw/source/uibase/shells/frmsh.cxx | 12 +-- sw/source/uibase/shells/grfsh.cxx | 2 sw/source/uibase/shells/tabsh.cxx | 5 - sw/source/uibase/shells/textsh.cxx | 2 sw/source/uibase/shells/textsh1.cxx | 2 sw/source/uibase/shells/txtattr.cxx | 4 - sw/source/uibase/uiview/viewtab.cxx | 28 +++----- sw/source/uibase/wrtsh/delete.cxx | 2 91 files changed, 346 insertions(+), 378 deletions(-)
New commits: commit 617a2feff0978d06aa2759038715dfde90d369db Author: Noel Grandin <noel.gran...@collabora.co.uk> Date: Tue Dec 19 15:39:54 2017 +0200 convert RES_FRM constants to TypedWhichId Change-Id: I0c71a6fd2e094cebdb720e6c0661cd8a7bb8482c Reviewed-on: https://gerrit.libreoffice.org/46812 Tested-by: Jenkins <c...@libreoffice.org> Reviewed-by: Noel Grandin <noel.gran...@collabora.co.uk> diff --git a/sw/inc/fmtanchr.hxx b/sw/inc/fmtanchr.hxx index 28361a7ac7cf..cfdc600562f7 100644 --- a/sw/inc/fmtanchr.hxx +++ b/sw/inc/fmtanchr.hxx @@ -76,7 +76,7 @@ public: }; inline const SwFormatAnchor &SwAttrSet::GetAnchor(bool bInP) const - { return static_cast<const SwFormatAnchor&>(Get(RES_ANCHOR, bInP)); } + { return Get(RES_ANCHOR, bInP); } inline const SwFormatAnchor &SwFormat::GetAnchor(bool bInP) const { return m_aSet.GetAnchor(bInP); } diff --git a/sw/inc/fmtclbl.hxx b/sw/inc/fmtclbl.hxx index cf41b339f938..dcfdba05f7f1 100644 --- a/sw/inc/fmtclbl.hxx +++ b/sw/inc/fmtclbl.hxx @@ -37,7 +37,7 @@ public: }; inline const SwFormatNoBalancedColumns &SwAttrSet::GetBalancedColumns(bool bInP) const - { return static_cast<const SwFormatNoBalancedColumns&>(Get( RES_COLUMNBALANCE, bInP )); } + { return Get( RES_COLUMNBALANCE, bInP ); } inline const SwFormatNoBalancedColumns &SwFormat::GetBalancedColumns(bool bInP) const { return m_aSet.GetBalancedColumns( bInP ); } diff --git a/sw/inc/fmtclds.hxx b/sw/inc/fmtclds.hxx index 9e94196729fb..6bb50990660f 100644 --- a/sw/inc/fmtclds.hxx +++ b/sw/inc/fmtclds.hxx @@ -162,7 +162,7 @@ public: }; inline const SwFormatCol &SwAttrSet::GetCol(bool bInP) const - { return static_cast<const SwFormatCol&>(Get( RES_COL,bInP)); } + { return Get( RES_COL,bInP); } inline const SwFormatCol &SwFormat::GetCol(bool bInP) const { return m_aSet.GetCol(bInP); } diff --git a/sw/inc/fmtcnct.hxx b/sw/inc/fmtcnct.hxx index c95e87cc10e2..e85ac8db5b8b 100644 --- a/sw/inc/fmtcnct.hxx +++ b/sw/inc/fmtcnct.hxx @@ -65,7 +65,7 @@ SwFormatChain &SwFormatChain::operator=( const SwFormatChain &rCpy ) } inline const SwFormatChain &SwAttrSet::GetChain(bool bInP) const - { return static_cast<const SwFormatChain&>(Get( RES_CHAIN,bInP)); } + { return Get( RES_CHAIN,bInP); } inline const SwFormatChain &SwFormat::GetChain(bool bInP) const { return m_aSet.GetChain(bInP); } diff --git a/sw/inc/fmtcntnt.hxx b/sw/inc/fmtcntnt.hxx index 8fcdae13542b..ad864a51fce7 100644 --- a/sw/inc/fmtcntnt.hxx +++ b/sw/inc/fmtcntnt.hxx @@ -50,7 +50,7 @@ public: }; inline const SwFormatContent &SwAttrSet::GetContent(bool bInP) const - { return static_cast<const SwFormatContent&>(Get( RES_CNTNT,bInP)); } + { return Get( RES_CNTNT,bInP); } inline const SwFormatContent &SwFormat::GetContent(bool bInP) const { return m_aSet.GetContent(bInP); } diff --git a/sw/inc/fmteiro.hxx b/sw/inc/fmteiro.hxx index 8ea4e9964d7c..ab53d6d2bf93 100644 --- a/sw/inc/fmteiro.hxx +++ b/sw/inc/fmteiro.hxx @@ -43,7 +43,7 @@ public: }; inline const SwFormatEditInReadonly &SwAttrSet::GetEditInReadonly(bool bInP) const - { return static_cast<const SwFormatEditInReadonly&>(Get( RES_EDIT_IN_READONLY,bInP)); } + { return Get( RES_EDIT_IN_READONLY,bInP); } inline const SwFormatEditInReadonly &SwFormat::GetEditInReadonly(bool bInP) const { return m_aSet.GetEditInReadonly(bInP); } diff --git a/sw/inc/fmtfollowtextflow.hxx b/sw/inc/fmtfollowtextflow.hxx index 7686edfeccd2..6cbc6dfe39e9 100644 --- a/sw/inc/fmtfollowtextflow.hxx +++ b/sw/inc/fmtfollowtextflow.hxx @@ -45,7 +45,7 @@ public: }; inline const SwFormatFollowTextFlow &SwAttrSet::GetFollowTextFlow(bool bInP) const - { return static_cast<const SwFormatFollowTextFlow&>(Get( RES_FOLLOW_TEXT_FLOW, bInP )); } + { return Get( RES_FOLLOW_TEXT_FLOW, bInP ); } inline const SwFormatFollowTextFlow &SwFormat::GetFollowTextFlow(bool bInP) const { return m_aSet.GetFollowTextFlow( bInP ); } diff --git a/sw/inc/fmtfordr.hxx b/sw/inc/fmtfordr.hxx index 20b80d1d4b90..2518995dbe3a 100644 --- a/sw/inc/fmtfordr.hxx +++ b/sw/inc/fmtfordr.hxx @@ -51,7 +51,7 @@ inline SwFormatFillOrder &SwFormatFillOrder::operator=( const SwFormatFillOrder } inline const SwFormatFillOrder &SwAttrSet::GetFillOrder(bool bInP) const - { return static_cast<const SwFormatFillOrder&>(Get( RES_FILL_ORDER,bInP)); } + { return Get( RES_FILL_ORDER,bInP); } inline const SwFormatFillOrder &SwFormat::GetFillOrder(bool bInP) const { return m_aSet.GetFillOrder(bInP); } diff --git a/sw/inc/fmtfsize.hxx b/sw/inc/fmtfsize.hxx index 94edec0814ce..9cbfb2078198 100644 --- a/sw/inc/fmtfsize.hxx +++ b/sw/inc/fmtfsize.hxx @@ -105,7 +105,7 @@ public: }; inline const SwFormatFrameSize &SwAttrSet::GetFrameSize(bool bInP) const - { return static_cast<const SwFormatFrameSize&>(Get( RES_FRM_SIZE,bInP)); } + { return Get( RES_FRM_SIZE,bInP); } inline const SwFormatFrameSize &SwFormat::GetFrameSize(bool bInP) const { return m_aSet.GetFrameSize(bInP); } diff --git a/sw/inc/fmtftntx.hxx b/sw/inc/fmtftntx.hxx index 5fc5832b224c..e8c747d7ad4b 100644 --- a/sw/inc/fmtftntx.hxx +++ b/sw/inc/fmtftntx.hxx @@ -102,9 +102,9 @@ public: }; inline const SwFormatFootnoteAtTextEnd &SwAttrSet::GetFootnoteAtTextEnd(bool bInP) const - { return static_cast<const SwFormatFootnoteAtTextEnd&>(Get( RES_FTN_AT_TXTEND, bInP)); } + { return Get( RES_FTN_AT_TXTEND, bInP); } inline const SwFormatEndAtTextEnd &SwAttrSet::GetEndAtTextEnd(bool bInP) const - { return static_cast<const SwFormatEndAtTextEnd&>(Get( RES_END_AT_TXTEND, bInP)); } + { return Get( RES_END_AT_TXTEND, bInP); } inline const SwFormatFootnoteAtTextEnd &SwFormat::GetFootnoteAtTextEnd(bool bInP) const { return m_aSet.GetFootnoteAtTextEnd(bInP); } diff --git a/sw/inc/fmthdft.hxx b/sw/inc/fmthdft.hxx index 0c0804fa1d04..7fcb53ecf4d8 100644 --- a/sw/inc/fmthdft.hxx +++ b/sw/inc/fmthdft.hxx @@ -91,9 +91,9 @@ public: }; inline const SwFormatHeader &SwAttrSet::GetHeader(bool bInP) const - { return static_cast<const SwFormatHeader&>(Get( RES_HEADER,bInP)); } + { return Get( RES_HEADER,bInP); } inline const SwFormatFooter &SwAttrSet::GetFooter(bool bInP) const - { return static_cast<const SwFormatFooter&>(Get( RES_FOOTER,bInP)); } + { return Get( RES_FOOTER,bInP); } inline const SwFormatHeader &SwFormat::GetHeader(bool bInP) const { return m_aSet.GetHeader(bInP); } diff --git a/sw/inc/fmtline.hxx b/sw/inc/fmtline.hxx index 523442f6c677..84e4d56e6e35 100644 --- a/sw/inc/fmtline.hxx +++ b/sw/inc/fmtline.hxx @@ -56,7 +56,7 @@ public: }; inline const SwFormatLineNumber &SwAttrSet::GetLineNumber(bool bInP) const - { return static_cast<const SwFormatLineNumber&>(Get( RES_LINENUMBER,bInP)); } + { return Get( RES_LINENUMBER,bInP); } #endif diff --git a/sw/inc/fmtlsplt.hxx b/sw/inc/fmtlsplt.hxx index 85f10adadf00..89670136a5e9 100644 --- a/sw/inc/fmtlsplt.hxx +++ b/sw/inc/fmtlsplt.hxx @@ -41,7 +41,7 @@ public: }; inline const SwFormatLayoutSplit &SwAttrSet::GetLayoutSplit(bool bInP) const - { return static_cast<const SwFormatLayoutSplit&>(Get( RES_LAYOUT_SPLIT,bInP)); } + { return Get( RES_LAYOUT_SPLIT,bInP); } inline const SwFormatLayoutSplit &SwFormat::GetLayoutSplit(bool bInP) const { return m_aSet.GetLayoutSplit(bInP); } diff --git a/sw/inc/fmtornt.hxx b/sw/inc/fmtornt.hxx index 8b8c3173afde..5de9f2ff6949 100644 --- a/sw/inc/fmtornt.hxx +++ b/sw/inc/fmtornt.hxx @@ -118,9 +118,9 @@ inline SwFormatHoriOrient &SwFormatHoriOrient::operator=( const SwFormatHoriOrie } inline const SwFormatVertOrient &SwAttrSet::GetVertOrient(bool bInP) const - { return static_cast<const SwFormatVertOrient&>(Get( RES_VERT_ORIENT,bInP)); } + { return Get( RES_VERT_ORIENT,bInP); } inline const SwFormatHoriOrient &SwAttrSet::GetHoriOrient(bool bInP) const - { return static_cast<const SwFormatHoriOrient&>(Get( RES_HORI_ORIENT,bInP)); } + { return Get( RES_HORI_ORIENT,bInP); } inline const SwFormatVertOrient &SwFormat::GetVertOrient(bool bInP) const { return m_aSet.GetVertOrient(bInP); } diff --git a/sw/inc/fmtpdsc.hxx b/sw/inc/fmtpdsc.hxx index 1d39f7b0343f..1b015cf2384f 100644 --- a/sw/inc/fmtpdsc.hxx +++ b/sw/inc/fmtpdsc.hxx @@ -78,7 +78,7 @@ public: }; inline const SwFormatPageDesc &SwAttrSet::GetPageDesc(bool bInP) const - { return static_cast<const SwFormatPageDesc&>(Get( RES_PAGEDESC,bInP)); } + { return Get( RES_PAGEDESC,bInP); } inline const SwFormatPageDesc &SwFormat::GetPageDesc(bool bInP) const { return m_aSet.GetPageDesc(bInP); } diff --git a/sw/inc/fmtrowsplt.hxx b/sw/inc/fmtrowsplt.hxx index a17809b0c604..735625841dc4 100644 --- a/sw/inc/fmtrowsplt.hxx +++ b/sw/inc/fmtrowsplt.hxx @@ -41,7 +41,7 @@ public: }; inline const SwFormatRowSplit &SwAttrSet::GetRowSplit(bool bInP) const - { return static_cast<const SwFormatRowSplit&>(Get( RES_ROW_SPLIT,bInP)); } + { return Get( RES_ROW_SPLIT,bInP); } inline const SwFormatRowSplit &SwFormat::GetRowSplit(bool bInP) const { return m_aSet.GetRowSplit(bInP); } diff --git a/sw/inc/fmtsrnd.hxx b/sw/inc/fmtsrnd.hxx index df4637842819..ae17719d32ff 100644 --- a/sw/inc/fmtsrnd.hxx +++ b/sw/inc/fmtsrnd.hxx @@ -71,7 +71,7 @@ inline SwFormatSurround &SwFormatSurround::operator=( const SwFormatSurround &rC } inline const SwFormatSurround &SwAttrSet::GetSurround(bool bInP) const - { return static_cast<const SwFormatSurround&>(Get( RES_SURROUND,bInP)); } + { return Get( RES_SURROUND,bInP); } inline const SwFormatSurround &SwFormat::GetSurround(bool bInP) const { return m_aSet.GetSurround(bInP); } diff --git a/sw/inc/fmturl.hxx b/sw/inc/fmturl.hxx index f7f472b558bb..de877239563e 100644 --- a/sw/inc/fmturl.hxx +++ b/sw/inc/fmturl.hxx @@ -73,7 +73,7 @@ public: }; inline const SwFormatURL &SwAttrSet::GetURL(bool bInP) const - { return static_cast<const SwFormatURL&>(Get( RES_URL,bInP)); } + { return Get( RES_URL,bInP); } inline const SwFormatURL &SwFormat::GetURL(bool bInP) const { return m_aSet.GetURL(bInP); } diff --git a/sw/inc/fmtwrapinfluenceonobjpos.hxx b/sw/inc/fmtwrapinfluenceonobjpos.hxx index 7c9139d04dc7..bff1bd2945d8 100644 --- a/sw/inc/fmtwrapinfluenceonobjpos.hxx +++ b/sw/inc/fmtwrapinfluenceonobjpos.hxx @@ -57,7 +57,7 @@ public: }; inline const SwFormatWrapInfluenceOnObjPos& SwAttrSet::GetWrapInfluenceOnObjPos(bool bInP) const - { return static_cast<const SwFormatWrapInfluenceOnObjPos&>(Get( RES_WRAP_INFLUENCE_ON_OBJPOS,bInP)); } + { return Get( RES_WRAP_INFLUENCE_ON_OBJPOS,bInP); } inline const SwFormatWrapInfluenceOnObjPos& SwFormat::GetWrapInfluenceOnObjPos(bool bInP) const { return m_aSet.GetWrapInfluenceOnObjPos(bInP); } diff --git a/sw/inc/frmatr.hxx b/sw/inc/frmatr.hxx index 02a1188c711c..51dda4f4a5d0 100644 --- a/sw/inc/frmatr.hxx +++ b/sw/inc/frmatr.hxx @@ -40,33 +40,33 @@ // Implementation of FrameAttribute methods of SwAttrSet. inline const SvxPaperBinItem &SwAttrSet::GetPaperBin(bool bInP) const - { return static_cast<const SvxPaperBinItem&>(Get( RES_PAPER_BIN,bInP)); } + { return Get( RES_PAPER_BIN,bInP); } inline const SvxLRSpaceItem &SwAttrSet::GetLRSpace(bool bInP) const - { return static_cast<const SvxLRSpaceItem&>(Get( RES_LR_SPACE,bInP)); } + { return Get( RES_LR_SPACE,bInP); } inline const SvxULSpaceItem &SwAttrSet::GetULSpace(bool bInP) const - { return static_cast<const SvxULSpaceItem&>(Get( RES_UL_SPACE,bInP)); } + { return Get( RES_UL_SPACE,bInP); } inline const SvxPrintItem &SwAttrSet::GetPrint(bool bInP) const - { return static_cast<const SvxPrintItem&>(Get( RES_PRINT,bInP)); } + { return Get( RES_PRINT,bInP); } inline const SvxOpaqueItem &SwAttrSet::GetOpaque(bool bInP) const - { return static_cast<const SvxOpaqueItem&>(Get( RES_OPAQUE,bInP)); } + { return Get( RES_OPAQUE,bInP); } inline const SvxProtectItem &SwAttrSet::GetProtect(bool bInP) const - { return static_cast<const SvxProtectItem&>(Get( RES_PROTECT,bInP)); } + { return Get( RES_PROTECT,bInP); } inline const SvxBoxItem &SwAttrSet::GetBox(bool bInP) const - { return static_cast<const SvxBoxItem&>(Get( RES_BOX,bInP)); } + { return Get( RES_BOX,bInP); } inline const SvxFormatKeepItem &SwAttrSet::GetKeep(bool bInP) const - { return static_cast<const SvxFormatKeepItem&>(Get( RES_KEEP,bInP)); } + { return Get( RES_KEEP,bInP); } inline const SvxBrushItem &SwAttrSet::GetBackground(bool bInP) const - { return static_cast<const SvxBrushItem&>(Get( RES_BACKGROUND,bInP)); } + { return Get( RES_BACKGROUND,bInP); } inline const SvxShadowItem &SwAttrSet::GetShadow(bool bInP) const - { return static_cast<const SvxShadowItem&>(Get( RES_SHADOW,bInP)); } + { return Get( RES_SHADOW,bInP); } inline const SvxFormatBreakItem &SwAttrSet::GetBreak(bool bInP) const - { return static_cast<const SvxFormatBreakItem&>(Get( RES_BREAK,bInP)); } + { return Get( RES_BREAK,bInP); } inline const SvxMacroItem &SwAttrSet::GetMacro(bool bInP) const - { return static_cast<const SvxMacroItem&>(Get( RES_FRMMACRO,bInP)); } + { return Get( RES_FRMMACRO,bInP); } inline const SvxFrameDirectionItem &SwAttrSet::GetFrameDir(bool bInP) const - { return static_cast<const SvxFrameDirectionItem&>(Get( RES_FRAMEDIR,bInP)); } + { return Get( RES_FRAMEDIR,bInP); } inline const SdrTextVertAdjustItem &SwAttrSet::GetTextVertAdjust(bool bInP) const - { return static_cast<const SdrTextVertAdjustItem&>(Get( RES_TEXT_VERT_ADJUST,bInP)); } + { return Get( RES_TEXT_VERT_ADJUST,bInP); } // Implementation of FrameAttribute methods of SwFormat. inline const SvxPaperBinItem &SwFormat::GetPaperBin(bool bInP) const diff --git a/sw/inc/hfspacingitem.hxx b/sw/inc/hfspacingitem.hxx index ec850a13bb46..136c4fc3e7d7 100644 --- a/sw/inc/hfspacingitem.hxx +++ b/sw/inc/hfspacingitem.hxx @@ -41,7 +41,7 @@ public: }; inline const SwHeaderAndFooterEatSpacingItem &SwAttrSet::GetHeaderAndFooterEatSpacing(bool bInP) const - { return static_cast<const SwHeaderAndFooterEatSpacingItem&>(Get( RES_HEADER_FOOTER_EAT_SPACING,bInP)); } + { return Get( RES_HEADER_FOOTER_EAT_SPACING,bInP); } inline const SwHeaderAndFooterEatSpacingItem &SwFormat::GetHeaderAndFooterEatSpacing(bool bInP) const { return m_aSet.GetHeaderAndFooterEatSpacing(bInP); } diff --git a/sw/inc/hintids.hxx b/sw/inc/hintids.hxx index ef869ddfe559..8e254b62ec0f 100644 --- a/sw/inc/hintids.hxx +++ b/sw/inc/hintids.hxx @@ -177,54 +177,51 @@ #define RES_PARATR_LIST_ISCOUNTED TypedWhichId<SfxBoolItem>(86) #define RES_PARATR_LIST_END (87) -enum RES_FRMATR -{ -RES_FRMATR_BEGIN = RES_PARATR_LIST_END, - RES_FILL_ORDER = RES_FRMATR_BEGIN, // 87 - RES_FRM_SIZE, // 88 - RES_PAPER_BIN, // 89 - RES_LR_SPACE, // 90 - RES_UL_SPACE, // 91 - RES_PAGEDESC, // 92 - RES_BREAK, // 93 - RES_CNTNT, // 94 - RES_HEADER, // 95 - RES_FOOTER, // 96 - RES_PRINT, // 97 - RES_OPAQUE, // 98 - RES_PROTECT, // 99 - RES_SURROUND, // 100 - RES_VERT_ORIENT, // 101 - RES_HORI_ORIENT, // 102 - RES_ANCHOR, // 103 - RES_BACKGROUND, // 104 - RES_BOX, // 105 - RES_SHADOW, // 106 - RES_FRMMACRO, // 107 - RES_COL, // 108 - RES_KEEP, // 109 - RES_URL, // 110 - RES_EDIT_IN_READONLY, // 111 - RES_LAYOUT_SPLIT, // 112 - RES_CHAIN, // 113 - RES_TEXTGRID, // 114 - RES_LINENUMBER , // 115 - RES_FTN_AT_TXTEND, // 116 - RES_END_AT_TXTEND, // 117 - RES_COLUMNBALANCE, // 118 - RES_FRAMEDIR, // 119 - RES_HEADER_FOOTER_EAT_SPACING, // 120 - RES_ROW_SPLIT, // 121 - RES_FOLLOW_TEXT_FLOW, // 122 - RES_COLLAPSING_BORDERS, // 123 - RES_WRAP_INFLUENCE_ON_OBJPOS, // 124 - RES_AUTO_STYLE, // 125 - RES_FRMATR_STYLE_NAME, // 126 - RES_FRMATR_CONDITIONAL_STYLE_NAME, // 127 - RES_FRMATR_GRABBAG, // 128 - RES_TEXT_VERT_ADJUST, // 129 -RES_FRMATR_END -}; +#define RES_FRMATR_BEGIN RES_PARATR_LIST_END +#define RES_FILL_ORDER TypedWhichId<SwFormatFillOrder>(RES_FRMATR_BEGIN) +#define RES_FRM_SIZE TypedWhichId<SwFormatFrameSize>(88) +#define RES_PAPER_BIN TypedWhichId<SvxPaperBinItem>(89) +#define RES_LR_SPACE TypedWhichId<SvxLRSpaceItem>(90) +#define RES_UL_SPACE TypedWhichId<SvxULSpaceItem>(91) +#define RES_PAGEDESC TypedWhichId<SwFormatPageDesc>(92) +#define RES_BREAK TypedWhichId<SvxFormatBreakItem>(93) +#define RES_CNTNT TypedWhichId<SwFormatContent>(94) +#define RES_HEADER TypedWhichId<SwFormatHeader>(95) +#define RES_FOOTER TypedWhichId<SwFormatFooter>(96) +#define RES_PRINT TypedWhichId<SvxPrintItem>(97) +#define RES_OPAQUE TypedWhichId<SvxOpaqueItem>(98) +#define RES_PROTECT TypedWhichId<SvxProtectItem>(99) +#define RES_SURROUND TypedWhichId<SwFormatSurround>(100) +#define RES_VERT_ORIENT TypedWhichId<SwFormatVertOrient>(101) +#define RES_HORI_ORIENT TypedWhichId<SwFormatHoriOrient>(102) +#define RES_ANCHOR TypedWhichId<SwFormatAnchor>(103) +#define RES_BACKGROUND TypedWhichId<SvxBrushItem>(104) +#define RES_BOX TypedWhichId<SvxBoxItem>(105) +#define RES_SHADOW TypedWhichId<SvxShadowItem>(106) +#define RES_FRMMACRO TypedWhichId<SvxMacroItem>(107) +#define RES_COL TypedWhichId<SwFormatCol>(108) +#define RES_KEEP TypedWhichId<SvxFormatKeepItem>(109) +#define RES_URL TypedWhichId<SwFormatURL>(110) +#define RES_EDIT_IN_READONLY TypedWhichId<SwFormatEditInReadonly>(111) +#define RES_LAYOUT_SPLIT TypedWhichId<SwFormatLayoutSplit>(112) +#define RES_CHAIN TypedWhichId<SwFormatChain>(113) +#define RES_TEXTGRID TypedWhichId<SwTextGridItem>(114) +#define RES_LINENUMBER TypedWhichId<SwFormatLineNumber>(115) +#define RES_FTN_AT_TXTEND TypedWhichId<SwFormatFootnoteAtTextEnd>(116) +#define RES_END_AT_TXTEND TypedWhichId<SwFormatEndAtTextEnd>(117) +#define RES_COLUMNBALANCE TypedWhichId<SwFormatNoBalancedColumns>(118) +#define RES_FRAMEDIR TypedWhichId<SvxFrameDirectionItem>(119) +#define RES_HEADER_FOOTER_EAT_SPACING TypedWhichId<SwHeaderAndFooterEatSpacingItem>(120) +#define RES_ROW_SPLIT TypedWhichId<SwFormatRowSplit>(121) +#define RES_FOLLOW_TEXT_FLOW TypedWhichId<SwFormatFollowTextFlow>(122) +#define RES_COLLAPSING_BORDERS TypedWhichId<SfxBoolItem>(123) +#define RES_WRAP_INFLUENCE_ON_OBJPOS TypedWhichId<SwFormatWrapInfluenceOnObjPos>(124) +#define RES_AUTO_STYLE TypedWhichId<SwFormatAutoFormat>(125) +#define RES_FRMATR_STYLE_NAME TypedWhichId<SfxStringItem>(126) +#define RES_FRMATR_CONDITIONAL_STYLE_NAME TypedWhichId<SfxStringItem>(127) +#define RES_FRMATR_GRABBAG TypedWhichId<SfxGrabBagItem>(128) +#define RES_TEXT_VERT_ADJUST TypedWhichId<SdrTextVertAdjustItem>(129) +#define RES_FRMATR_END 130 #define RES_GRFATR_BEGIN RES_FRMATR_END #define RES_GRFATR_MIRRORGRF TypedWhichId<SwMirrorGrf>(RES_GRFATR_BEGIN) // 130 diff --git a/sw/inc/tgrditem.hxx b/sw/inc/tgrditem.hxx index be7fd137b7ec..30cf95066fb8 100644 --- a/sw/inc/tgrditem.hxx +++ b/sw/inc/tgrditem.hxx @@ -107,7 +107,7 @@ public: }; inline const SwTextGridItem &SwFormat::GetTextGrid(bool bInP) const - { return static_cast<const SwTextGridItem&>(m_aSet.Get( RES_TEXTGRID, bInP )); } + { return m_aSet.Get( RES_TEXTGRID, bInP ); } #endif diff --git a/sw/inc/unostyle.hxx b/sw/inc/unostyle.hxx index afd2a500ff38..5d76bd719808 100644 --- a/sw/inc/unostyle.hxx +++ b/sw/inc/unostyle.hxx @@ -104,8 +104,8 @@ namespace sw class ICoreFrameStyle { public: - virtual void SetItem(enum RES_FRMATR eAtr, const SfxPoolItem& rItem) =0; - virtual const SfxPoolItem* GetItem(enum RES_FRMATR eAtr) =0; + virtual void SetItem(sal_uInt16 eAtr, const SfxPoolItem& rItem) =0; + virtual const SfxPoolItem* GetItem(sal_uInt16 eAtr) =0; virtual css::document::XEventsSupplier& GetEventsSupplier() =0; virtual ~ICoreFrameStyle() {}; }; diff --git a/sw/source/core/doc/docdraw.cxx b/sw/source/core/doc/docdraw.cxx index a7f68a62f30c..ae759ef8aca3 100644 --- a/sw/source/core/doc/docdraw.cxx +++ b/sw/source/core/doc/docdraw.cxx @@ -110,7 +110,7 @@ static void lcl_AdjustPositioningAttr( SwDrawFrameFormat* _pFrameFormat, // If no anchor frame exist - e.g. because no layout exists - the // default layout direction is taken. const SvxFrameDirectionItem& rDirItem = - static_cast<const SvxFrameDirectionItem&>(_pFrameFormat->GetAttrSet().GetPool()->GetDefaultItem( RES_FRAMEDIR )); + _pFrameFormat->GetAttrSet().GetPool()->GetDefaultItem( RES_FRAMEDIR ); switch ( rDirItem.GetValue() ) { case SvxFrameDirection::Vertical_LR_TB: diff --git a/sw/source/core/doc/docfly.cxx b/sw/source/core/doc/docfly.cxx index f06d3f6ab5cc..cc4a6552e18f 100644 --- a/sw/source/core/doc/docfly.cxx +++ b/sw/source/core/doc/docfly.cxx @@ -281,7 +281,7 @@ sal_Int8 SwDoc::SetFlyFrameAnchor( SwFrameFormat& rFormat, SfxItemSet& rSet, boo const SwFormatAnchor &rOldAnch = rFormat.GetAnchor(); const RndStdIds nOld = rOldAnch.GetAnchorId(); - SwFormatAnchor aNewAnch( static_cast<const SwFormatAnchor&>(rSet.Get( RES_ANCHOR )) ); + SwFormatAnchor aNewAnch( rSet.Get( RES_ANCHOR ) ); RndStdIds nNew = aNewAnch.GetAnchorId(); // Is the new anchor valid? diff --git a/sw/source/core/doc/docfmt.cxx b/sw/source/core/doc/docfmt.cxx index 532c492e5ca2..c344a2f6e966 100644 --- a/sw/source/core/doc/docfmt.cxx +++ b/sw/source/core/doc/docfmt.cxx @@ -1353,7 +1353,7 @@ void SwDoc::CopyPageDescHeaderFooterImpl( bool bCpyHeader, { // Treat the header and footer attributes in the right way: // Copy content nodes across documents! - sal_uInt16 nAttr = static_cast<sal_uInt16>( bCpyHeader ? RES_HEADER : RES_FOOTER ); + sal_uInt16 nAttr = bCpyHeader ? sal_uInt16(RES_HEADER) : sal_uInt16(RES_FOOTER); const SfxPoolItem* pItem; if( SfxItemState::SET != rSrcFormat.GetAttrSet().GetItemState( nAttr, false, &pItem )) return ; diff --git a/sw/source/core/doc/doclay.cxx b/sw/source/core/doc/doclay.cxx index fd6d5f415310..53f9c85c5833 100644 --- a/sw/source/core/doc/doclay.cxx +++ b/sw/source/core/doc/doclay.cxx @@ -352,7 +352,7 @@ SwFlyFrameFormat* SwDoc::MakeFlyAndMove( const SwPaM& rPam, const SfxItemSet& rS const SwSelBoxes* pSelBoxes, SwFrameFormat *pParent ) { - const SwFormatAnchor& rAnch = static_cast<const SwFormatAnchor&>(rSet.Get( RES_ANCHOR )); + const SwFormatAnchor& rAnch = rSet.Get( RES_ANCHOR ); GetIDocumentUndoRedo().StartUndo( SwUndoId::INSLAYFMT, nullptr ); @@ -1627,8 +1627,7 @@ SvxFrameDirection SwDoc::GetTextDirection( const SwPosition& rPos, } } if( !pItem ) - pItem = static_cast<const SvxFrameDirectionItem*>(&GetAttrPool().GetDefaultItem( - RES_FRAMEDIR )); + pItem = &GetAttrPool().GetDefaultItem( RES_FRAMEDIR ); nRet = pItem->GetValue(); } return nRet; diff --git a/sw/source/core/doc/fmtcol.cxx b/sw/source/core/doc/fmtcol.cxx index 0491f1d07428..1a3ca6e7755e 100644 --- a/sw/source/core/doc/fmtcol.cxx +++ b/sw/source/core/doc/fmtcol.cxx @@ -158,8 +158,8 @@ void SwTextFormatColl::Modify( const SfxPoolItem* pOld, const SfxPoolItem* pNew if( GetAttrSet().GetParent() ) { const SfxItemSet* pParent = GetAttrSet().GetParent(); - pNewLRSpace = static_cast<const SvxLRSpaceItem*>(&pParent->Get( RES_LR_SPACE )); - pNewULSpace = static_cast<const SvxULSpaceItem*>(&pParent->Get( RES_UL_SPACE )); + pNewLRSpace = &pParent->Get( RES_LR_SPACE ); + pNewULSpace = &pParent->Get( RES_UL_SPACE ); aFontSizeArr[0] = &pParent->Get( RES_CHRATR_FONTSIZE ); aFontSizeArr[1] = &pParent->Get( RES_CHRATR_CJK_FONTSIZE ); aFontSizeArr[2] = &pParent->Get( RES_CHRATR_CTL_FONTSIZE ); diff --git a/sw/source/core/doc/ftnidx.cxx b/sw/source/core/doc/ftnidx.cxx index d9bfbc238ad4..5b753c56733c 100644 --- a/sw/source/core/doc/ftnidx.cxx +++ b/sw/source/core/doc/ftnidx.cxx @@ -283,8 +283,8 @@ SwTextFootnote* SwFootnoteIdxs::SeekEntry( const SwNodeIndex& rPos, size_t* pFnd const SwSectionNode* SwUpdFootnoteEndNtAtEnd::FindSectNdWithEndAttr( const SwTextFootnote& rTextFootnote ) { - sal_uInt16 nWh = static_cast<sal_uInt16>( rTextFootnote.GetFootnote().IsEndNote() ? - RES_END_AT_TXTEND : RES_FTN_AT_TXTEND ); + sal_uInt16 nWh = rTextFootnote.GetFootnote().IsEndNote() ? + sal_uInt16(RES_END_AT_TXTEND) : sal_uInt16(RES_FTN_AT_TXTEND); sal_uInt16 nVal; const SwSectionNode* pNd = rTextFootnote.GetTextNode().FindSectionNode(); while( pNd && FTNEND_ATTXTEND_OWNNUMSEQ != ( nVal = diff --git a/sw/source/core/doc/tblafmt.cxx b/sw/source/core/doc/tblafmt.cxx index 3b0ceb86e03f..e818e67fac76 100644 --- a/sw/source/core/doc/tblafmt.cxx +++ b/sw/source/core/doc/tblafmt.cxx @@ -764,13 +764,13 @@ void SwTableAutoFormat::UpdateFromSet( sal_uInt8 nPos, } if( UPDATE_BOX & eFlags ) { - pFormat->SetBox( static_cast<const SvxBoxItem&>(rSet.Get( RES_BOX )) ); + pFormat->SetBox( rSet.Get( RES_BOX ) ); // FIXME - add attribute IDs for the diagonal line items // pFormat->SetTLBR( (SvxLineItem&)rSet.Get( RES_... ) ); // pFormat->SetBLTR( (SvxLineItem&)rSet.Get( RES_... ) ); - pFormat->SetBackground( static_cast<const SvxBrushItem&>(rSet.Get( RES_BACKGROUND )) ); - pFormat->SetTextOrientation(static_cast<const SvxFrameDirectionItem&>(rSet.Get(RES_FRAMEDIR))); - pFormat->SetVerticalAlignment(static_cast<const SwFormatVertOrient&>(rSet.Get(RES_VERT_ORIENT))); + pFormat->SetBackground( rSet.Get( RES_BACKGROUND ) ); + pFormat->SetTextOrientation(rSet.Get(RES_FRAMEDIR)); + pFormat->SetVerticalAlignment(rSet.Get(RES_VERT_ORIENT)); const SwTableBoxNumFormat* pNumFormatItem; const SvNumberformat* pNumFormat = nullptr; @@ -938,15 +938,15 @@ void SwTableAutoFormat::StoreTableProperties(const SwTable &table) const SfxItemSet &rSet = pFormat->GetAttrSet(); - m_aBreak = static_cast<const SvxFormatBreakItem&>(rSet.Get(RES_BREAK)); - m_aPageDesc = static_cast<const SwFormatPageDesc&>(rSet.Get(RES_PAGEDESC)); - const SwFormatLayoutSplit &layoutSplit = static_cast<const SwFormatLayoutSplit&>(rSet.Get(RES_LAYOUT_SPLIT)); + m_aBreak = rSet.Get(RES_BREAK); + m_aPageDesc = rSet.Get(RES_PAGEDESC); + const SwFormatLayoutSplit &layoutSplit = rSet.Get(RES_LAYOUT_SPLIT); m_bLayoutSplit = layoutSplit.GetValue(); - m_bCollapsingBorders = static_cast<const SfxBoolItem&>(rSet.Get(RES_COLLAPSING_BORDERS)).GetValue(); + m_bCollapsingBorders = rSet.Get(RES_COLLAPSING_BORDERS).GetValue(); - m_aKeepWithNextPara = static_cast<const SvxFormatKeepItem&>(rSet.Get(RES_KEEP)); + m_aKeepWithNextPara = rSet.Get(RES_KEEP); m_aRepeatHeading = table.GetRowsToRepeat(); - m_aShadow = static_cast<const SvxShadowItem&>(rSet.Get(RES_SHADOW)); + m_aShadow = rSet.Get(RES_SHADOW); } bool SwTableAutoFormat::FirstRowEndColumnIsRow() diff --git a/sw/source/core/docnode/ndsect.cxx b/sw/source/core/docnode/ndsect.cxx index e5d2d017c799..51c57c7d74ce 100644 --- a/sw/source/core/docnode/ndsect.cxx +++ b/sw/source/core/docnode/ndsect.cxx @@ -350,12 +350,10 @@ SwDoc::InsertSwSection(SwPaM const& rRange, SwSectionData & rNewData, bool bUpdateFootnote = false; if( GetFootnoteIdxs().size() && pAttr ) { - sal_uInt16 nVal = static_cast<const SwFormatFootnoteAtTextEnd&>(pAttr->Get( - RES_FTN_AT_TXTEND )).GetValue(); + sal_uInt16 nVal = pAttr->Get( RES_FTN_AT_TXTEND ).GetValue(); if( ( FTNEND_ATTXTEND_OWNNUMSEQ == nVal || FTNEND_ATTXTEND_OWNNUMANDFMT == nVal ) || - ( FTNEND_ATTXTEND_OWNNUMSEQ == ( nVal = static_cast<const SwFormatEndAtTextEnd&>( - pAttr->Get( RES_END_AT_TXTEND )).GetValue() ) || + ( FTNEND_ATTXTEND_OWNNUMSEQ == ( nVal = pAttr->Get( RES_END_AT_TXTEND ).GetValue() ) || FTNEND_ATTXTEND_OWNNUMANDFMT == nVal )) { bUpdateFootnote = true; diff --git a/sw/source/core/docnode/ndtbl1.cxx b/sw/source/core/docnode/ndtbl1.cxx index 36208de5ca26..dc1ef66cb7d5 100644 --- a/sw/source/core/docnode/ndtbl1.cxx +++ b/sw/source/core/docnode/ndtbl1.cxx @@ -873,7 +873,7 @@ void SwDoc::SetTabLineStyle( const SwCursor& rCursor, SvxBoxItem aBox( pFormat->GetBox() ); if ( !pBorderLine && bSetLine ) - aBox = *static_cast<const SvxBoxItem*>(::GetDfltAttr( RES_BOX )); + aBox = *::GetDfltAttr( RES_BOX ); else { if ( aBox.GetTop() ) @@ -922,7 +922,7 @@ void SwDoc::GetTabBorders( const SwCursor& rCursor, SfxItemSet& rSet ) if( !aUnions.empty() ) { - SvxBoxItem aSetBox (static_cast<const SvxBoxItem &>( rSet.Get(RES_BOX ))); + SvxBoxItem aSetBox ( rSet.Get(RES_BOX ) ); SvxBoxInfoItem aSetBoxInfo( rSet.Get(SID_ATTR_BORDER_INNER) ); bool bTopSet = false, @@ -1111,7 +1111,7 @@ void SwDoc::GetTabBorders( const SwCursor& rCursor, SfxItemSet& rSet ) // fdo#62470 fix the reading for table format. if ( bRTLTab ) { - SvxBoxItem aTempBox (static_cast<const SvxBoxItem &>( rSet.Get(RES_BOX ))); + SvxBoxItem aTempBox ( rSet.Get(RES_BOX ) ); SvxBoxInfoItem aTempBoxInfo( rSet.Get(SID_ATTR_BORDER_INNER) ); aTempBox.SetLine( aSetBox.GetRight(), SvxBoxItemLine::RIGHT); diff --git a/sw/source/core/docnode/section.cxx b/sw/source/core/docnode/section.cxx index e685ece04d61..469024234ec6 100644 --- a/sw/source/core/docnode/section.cxx +++ b/sw/source/core/docnode/section.cxx @@ -62,6 +62,7 @@ #include <swerror.h> #include <unosection.hxx> #include <calbck.hxx> +#include <fmtclds.hxx> #include <algorithm> #include "ndsect.hxx" diff --git a/sw/source/core/fields/docufld.cxx b/sw/source/core/fields/docufld.cxx index 8e360155f1b8..fe2d9cf2cefe 100644 --- a/sw/source/core/fields/docufld.cxx +++ b/sw/source/core/fields/docufld.cxx @@ -145,7 +145,7 @@ void SwPageNumberFieldType::ChangeExpansion( SwDoc* pDoc, for( sal_uInt32 n = 0; n < nMaxItems; ++n ) { const SwFormatPageDesc *pDesc; - if( nullptr != (pDesc = static_cast<const SwFormatPageDesc*>(rPool.GetItem2( RES_PAGEDESC, n )) ) + if( nullptr != (pDesc = rPool.GetItem2( RES_PAGEDESC, n ) ) && pDesc->GetNumOffset() && pDesc->GetDefinedIn() ) { const SwContentNode* pNd = dynamic_cast<const SwContentNode*>( pDesc->GetDefinedIn() ); diff --git a/sw/source/core/frmedt/fefly1.cxx b/sw/source/core/frmedt/fefly1.cxx index c06bbd6e2951..2cbeeeb4a3bc 100644 --- a/sw/source/core/frmedt/fefly1.cxx +++ b/sw/source/core/frmedt/fefly1.cxx @@ -109,7 +109,7 @@ static bool lcl_FindAnchorPos( SfxItemSet& rSet ) { bool bRet = true; - SwFormatAnchor aNewAnch( static_cast<const SwFormatAnchor&>(rSet.Get( RES_ANCHOR )) ); + SwFormatAnchor aNewAnch( rSet.Get( RES_ANCHOR ) ); RndStdIds nNew = aNewAnch.GetAnchorId(); const SwFrame *pNewAnch; @@ -206,7 +206,7 @@ bool sw_ChkAndSetNewAnchor( const SwFormatAnchor &rOldAnch = rFormat.GetAnchor(); const RndStdIds nOld = rOldAnch.GetAnchorId(); - RndStdIds nNew = static_cast<const SwFormatAnchor&>(rSet.Get( RES_ANCHOR )).GetAnchorId(); + RndStdIds nNew = rSet.Get( RES_ANCHOR ).GetAnchorId(); if( nOld == nNew ) return false; @@ -644,7 +644,7 @@ const SwFrameFormat *SwFEShell::NewFlyFrame( const SfxItemSet& rSet, bool bAnchV const SwPosition& rPos = *pCursor->Start(); - SwFormatAnchor& rAnch = const_cast<SwFormatAnchor&>(static_cast<const SwFormatAnchor&>(rSet.Get( RES_ANCHOR ))); + SwFormatAnchor& rAnch = const_cast<SwFormatAnchor&>(rSet.Get( RES_ANCHOR )); RndStdIds eRndId = rAnch.GetAnchorId(); switch( eRndId ) { @@ -1103,7 +1103,7 @@ bool SwFEShell::SetDrawingAttr( SfxItemSet& rSet ) StartAllAction(); if( SfxItemState::SET == rSet.GetItemState( RES_ANCHOR, false )) { - RndStdIds nNew = static_cast<const SwFormatAnchor&>(rSet.Get( RES_ANCHOR )).GetAnchorId(); + RndStdIds nNew = rSet.Get( RES_ANCHOR ).GetAnchorId(); if ( nNew != pFormat->GetAnchor().GetAnchorId() ) { ChgAnchor( nNew ); diff --git a/sw/source/core/layout/tabfrm.cxx b/sw/source/core/layout/tabfrm.cxx index ee1af4668c5b..28b2b9934ea9 100644 --- a/sw/source/core/layout/tabfrm.cxx +++ b/sw/source/core/layout/tabfrm.cxx @@ -5330,7 +5330,7 @@ sal_uInt16 SwTabFrame::GetBottomLineSize() const bool SwTabFrame::IsCollapsingBorders() const { - return static_cast<const SfxBoolItem&>(GetFormat()->GetAttrSet().Get( RES_COLLAPSING_BORDERS )).GetValue(); + return GetFormat()->GetAttrSet().Get( RES_COLLAPSING_BORDERS ).GetValue(); } /// Local helper function to calculate height of first text row diff --git a/sw/source/core/undo/unattr.cxx b/sw/source/core/undo/unattr.cxx index fda4e0f9c0e0..34262fd5ecc6 100644 --- a/sw/source/core/undo/unattr.cxx +++ b/sw/source/core/undo/unattr.cxx @@ -372,7 +372,7 @@ void SwUndoFormatAttr::SaveFlyAnchor( bool bSvDrwPt ) } const SwFormatAnchor& rAnchor = - static_cast<const SwFormatAnchor&>( m_pOldSet->Get( RES_ANCHOR, false ) ); + m_pOldSet->Get( RES_ANCHOR, false ); if( !rAnchor.GetContentAnchor() ) return; @@ -403,7 +403,7 @@ bool SwUndoFormatAttr::RestoreFlyAnchor(::sw::UndoRedoContext & rContext) SwDoc *const pDoc = & rContext.GetDoc(); SwFrameFormat* pFrameFormat = static_cast<SwFrameFormat*>(m_pFormat); const SwFormatAnchor& rAnchor = - static_cast<const SwFormatAnchor&>( m_pOldSet->Get( RES_ANCHOR, false ) ); + m_pOldSet->Get( RES_ANCHOR, false ); SwFormatAnchor aNewAnchor( rAnchor.GetAnchorId() ); if (RndStdIds::FLY_AT_PAGE != rAnchor.GetAnchorId()) { @@ -436,8 +436,7 @@ bool SwUndoFormatAttr::RestoreFlyAnchor(::sw::UndoRedoContext & rContext) if( pDoc->getIDocumentLayoutAccess().GetCurrentViewShell() ) { if( RES_DRAWFRMFMT == pFrameFormat->Which() ) { // get the old cached value - const SwFormatFrameSize& rOldSize = static_cast<const SwFormatFrameSize&>( - m_pOldSet->Get( RES_FRM_SIZE ) ); + const SwFormatFrameSize& rOldSize = m_pOldSet->Get( RES_FRM_SIZE ); aDrawSavePt.X() = rOldSize.GetWidth(); aDrawSavePt.Y() = rOldSize.GetHeight(); m_pOldSet->ClearItem( RES_FRM_SIZE ); diff --git a/sw/source/core/undo/undel.cxx b/sw/source/core/undo/undel.cxx index 809b0848dcc5..2795e84fbe14 100644 --- a/sw/source/core/undo/undel.cxx +++ b/sw/source/core/undo/undel.cxx @@ -946,8 +946,8 @@ void SwUndoDelete::UndoImpl(::sw::UndoRedoContext & rContext) if( m_bResetPgDesc || m_bResetPgBrk ) { - sal_uInt16 nStt = static_cast<sal_uInt16>( m_bResetPgDesc ? RES_PAGEDESC : RES_BREAK ); - sal_uInt16 nEnd = static_cast<sal_uInt16>( m_bResetPgBrk ? RES_BREAK : RES_PAGEDESC ); + sal_uInt16 nStt = m_bResetPgDesc ? sal_uInt16(RES_PAGEDESC) : sal_uInt16(RES_BREAK); + sal_uInt16 nEnd = m_bResetPgBrk ? sal_uInt16(RES_BREAK) : sal_uInt16(RES_PAGEDESC); SwNode* pNode = rDoc.GetNodes()[ nEndNode + 1 ]; if( pNode->IsContentNode() ) diff --git a/sw/source/core/unocore/SwXTextDefaults.cxx b/sw/source/core/unocore/SwXTextDefaults.cxx index 82e64091d08e..f9af14cb786c 100644 --- a/sw/source/core/unocore/SwXTextDefaults.cxx +++ b/sw/source/core/unocore/SwXTextDefaults.cxx @@ -35,6 +35,7 @@ #include <unoprnms.hxx> #include <unocrsrhelper.hxx> #include <hintids.hxx> +#include <fmtpdsc.hxx> using namespace ::com::sun::star; using namespace ::com::sun::star::uno; diff --git a/sw/source/core/unocore/unodraw.cxx b/sw/source/core/unocore/unodraw.cxx index 2131779573dd..e15629008b17 100644 --- a/sw/source/core/unocore/unodraw.cxx +++ b/sw/source/core/unocore/unodraw.cxx @@ -1145,7 +1145,7 @@ void SwXShape::setPropertyValue(const OUString& rPropertyName, const uno::Any& a // #i26791# - special handling for property FN_TEXT_RANGE else if ( FN_TEXT_RANGE == pEntry->nWID ) { - SwFormatAnchor aAnchor( static_cast<const SwFormatAnchor&>(aSet.Get( RES_ANCHOR )) ); + SwFormatAnchor aAnchor( aSet.Get( RES_ANCHOR ) ); if (aAnchor.GetAnchorId() == RndStdIds::FLY_AT_PAGE) { // set property <TextRange> not valid for to-page anchored shapes diff --git a/sw/source/core/unocore/unoframe.cxx b/sw/source/core/unocore/unoframe.cxx index b62e4dce7bec..ef28818d61a2 100644 --- a/sw/source/core/unocore/unoframe.cxx +++ b/sw/source/core/unocore/unoframe.cxx @@ -193,7 +193,7 @@ bool BaseFrameProperties_Impl::FillBaseProperties(SfxItemSet& rToSet, const SfxI bool bRet = true; // always add an anchor to the set - SwFormatAnchor aAnchor ( static_cast < const SwFormatAnchor & > ( rFromSet.Get ( RES_ANCHOR ) ) ); + SwFormatAnchor aAnchor ( rFromSet.Get ( RES_ANCHOR ) ); { const ::uno::Any* pAnchorPgNo; if(GetProperty(RES_ANCHOR, MID_ANCHOR_PAGENUM, pAnchorPgNo)) @@ -641,7 +641,7 @@ bool BaseFrameProperties_Impl::FillBaseProperties(SfxItemSet& rToSet, const SfxI GetProperty(RES_PROTECT, MID_PROTECT_SIZE, pName ); if(pCont||pPos||pName) { - SvxProtectItem aProt ( static_cast < const ::SvxProtectItem & > ( rFromSet.Get ( RES_PROTECT ) ) ); + SvxProtectItem aProt ( rFromSet.Get ( RES_PROTECT ) ); if(pCont) bRet &= static_cast<SfxPoolItem&>(aProt).PutValue(*pCont, MID_PROTECT_CONTENT); if(pPos ) @@ -662,7 +662,7 @@ bool BaseFrameProperties_Impl::FillBaseProperties(SfxItemSet& rToSet, const SfxI GetProperty(RES_HORI_ORIENT, MID_HORIORIENT_PAGETOGGLE, pPageT); if(pHori||pHoriP||pHoriR||pPageT) { - SwFormatHoriOrient aOrient ( static_cast < const ::SwFormatHoriOrient & > ( rFromSet.Get ( RES_HORI_ORIENT ) ) ); + SwFormatHoriOrient aOrient ( rFromSet.Get ( RES_HORI_ORIENT ) ); if(pHori ) bRet &= static_cast<SfxPoolItem&>(aOrient).PutValue(*pHori, MID_HORIORIENT_ORIENT); if(pHoriP) @@ -684,7 +684,7 @@ bool BaseFrameProperties_Impl::FillBaseProperties(SfxItemSet& rToSet, const SfxI GetProperty(RES_VERT_ORIENT, MID_VERTORIENT_RELATION, pVertR ); if(pVert||pVertP||pVertR) { - SwFormatVertOrient aOrient ( static_cast < const ::SwFormatVertOrient & > ( rFromSet.Get ( RES_VERT_ORIENT ) ) ); + SwFormatVertOrient aOrient ( rFromSet.Get ( RES_VERT_ORIENT ) ); if(pVert ) bRet &= static_cast<SfxPoolItem&>(aOrient).PutValue(*pVert, MID_VERTORIENT_ORIENT); if(pVertP) @@ -705,7 +705,7 @@ bool BaseFrameProperties_Impl::FillBaseProperties(SfxItemSet& rToSet, const SfxI GetProperty(RES_URL, MID_URL_SERVERMAP, pHySMp ); if(pURL||pTarget||pHyLNm||pHySMp) { - SwFormatURL aURL ( static_cast < const ::SwFormatURL & > ( rFromSet.Get ( RES_URL ) ) ); + SwFormatURL aURL ( rFromSet.Get ( RES_URL ) ); if(pURL) bRet &= static_cast<SfxPoolItem&>(aURL).PutValue(*pURL, MID_URL_URL); if(pTarget) @@ -723,7 +723,7 @@ bool BaseFrameProperties_Impl::FillBaseProperties(SfxItemSet& rToSet, const SfxI GetProperty(RES_LR_SPACE, MID_R_MARGIN|CONVERT_TWIPS, pR ); if(pL||pR) { - SvxLRSpaceItem aLR ( static_cast < const ::SvxLRSpaceItem & > ( rFromSet.Get ( RES_LR_SPACE ) ) ); + SvxLRSpaceItem aLR ( rFromSet.Get ( RES_LR_SPACE ) ); if(pL) bRet &= static_cast<SfxPoolItem&>(aLR).PutValue(*pL, MID_L_MARGIN|CONVERT_TWIPS); if(pR) @@ -736,7 +736,7 @@ bool BaseFrameProperties_Impl::FillBaseProperties(SfxItemSet& rToSet, const SfxI GetProperty(RES_UL_SPACE, MID_LO_MARGIN|CONVERT_TWIPS, pB ); if(pT||pB) { - SvxULSpaceItem aTB ( static_cast < const ::SvxULSpaceItem &> ( rFromSet.Get ( RES_UL_SPACE ) ) ); + SvxULSpaceItem aTB ( rFromSet.Get ( RES_UL_SPACE ) ); if(pT) bRet &= static_cast<SfxPoolItem&>(aTB).PutValue(*pT, MID_UP_MARGIN|CONVERT_TWIPS); if(pB) @@ -746,28 +746,28 @@ bool BaseFrameProperties_Impl::FillBaseProperties(SfxItemSet& rToSet, const SfxI const ::uno::Any* pOp; if(GetProperty(RES_OPAQUE, 0, pOp)) { - SvxOpaqueItem aOp ( static_cast < const ::SvxOpaqueItem& > ( rFromSet.Get ( RES_OPAQUE ) ) ); + SvxOpaqueItem aOp ( rFromSet.Get ( RES_OPAQUE ) ); bRet &= static_cast<SfxPoolItem&>(aOp).PutValue(*pOp, 0); rToSet.Put(aOp); } const ::uno::Any* pPrt; if(GetProperty(RES_PRINT, 0, pPrt)) { - SvxPrintItem aPrt ( static_cast < const ::SvxPrintItem & > ( rFromSet.Get ( RES_PRINT ) ) ); + SvxPrintItem aPrt ( rFromSet.Get ( RES_PRINT ) ); bRet &= static_cast<SfxPoolItem&>(aPrt).PutValue(*pPrt, 0); rToSet.Put(aPrt); } const ::uno::Any* pSh; if(GetProperty(RES_SHADOW, CONVERT_TWIPS, pSh)) { - SvxShadowItem aSh ( static_cast < const ::SvxShadowItem& > ( rFromSet.Get ( RES_SHADOW ) ) ); + SvxShadowItem aSh ( rFromSet.Get ( RES_SHADOW ) ); bRet &= static_cast<SfxPoolItem&>(aSh).PutValue(*pSh, CONVERT_TWIPS); rToSet.Put(aSh); } const ::uno::Any* pShTr; if(GetProperty(RES_SHADOW, MID_SHADOW_TRANSPARENCE, pShTr) && rToSet.HasItem(RES_SHADOW)) { - SvxShadowItem aSh(static_cast<const SvxShadowItem&>(rToSet.Get(RES_SHADOW))); + SvxShadowItem aSh(rToSet.Get(RES_SHADOW)); bRet &= aSh.PutValue(*pShTr, MID_SHADOW_TRANSPARENCE); rToSet.Put(aSh); } @@ -777,7 +777,7 @@ bool BaseFrameProperties_Impl::FillBaseProperties(SfxItemSet& rToSet, const SfxI GetProperty(RES_SURROUND, MID_SURROUND_ANCHORONLY, pSurAnch); if(pSur || pSurAnch) { - SwFormatSurround aSrnd ( static_cast < const ::SwFormatSurround & > ( rFromSet.Get ( RES_SURROUND ) ) ); + SwFormatSurround aSrnd ( rFromSet.Get ( RES_SURROUND ) ); if(pSur) bRet &= static_cast<SfxPoolItem&>(aSrnd).PutValue(*pSur, MID_SURROUND_SURROUNDTYPE ); if(pSurAnch) @@ -810,7 +810,7 @@ bool BaseFrameProperties_Impl::FillBaseProperties(SfxItemSet& rToSet, const SfxI pLeftDistance || pRightDistance || pTopDistance || pBottomDistance || pLineStyle || pLineWidth ) { - SvxBoxItem aBox ( static_cast < const ::SvxBoxItem & > ( rFromSet.Get ( RES_BOX ) ) ); + SvxBoxItem aBox ( rFromSet.Get ( RES_BOX ) ); if( pLeft ) bRet &= static_cast<SfxPoolItem&>(aBox).PutValue(*pLeft, CONVERT_TWIPS|LEFT_BORDER ); if( pRight ) @@ -862,7 +862,7 @@ bool BaseFrameProperties_Impl::FillBaseProperties(SfxItemSet& rToSet, const SfxI pWidthType ||pSyncWidth || pSyncHeight ) { rSizeFound = true; - SwFormatFrameSize aFrameSz ( static_cast < const ::SwFormatFrameSize& > ( rFromSet.Get ( RES_FRM_SIZE ) ) ); + SwFormatFrameSize aFrameSz ( rFromSet.Get ( RES_FRM_SIZE ) ); if(pWidth) bRet &= static_cast<SfxPoolItem&>(aFrameSz).PutValue(*pWidth, MID_FRMSIZE_WIDTH|CONVERT_TWIPS); if(pHeight) @@ -946,7 +946,7 @@ bool BaseFrameProperties_Impl::FillBaseProperties(SfxItemSet& rToSet, const SfxI GetProperty(RES_TEXT_VERT_ADJUST, 0, pTextVertAdjust); if ( pTextVertAdjust ) { - SdrTextVertAdjustItem aTextVertAdjust(static_cast <const ::SdrTextVertAdjustItem & > ( rFromSet.Get ( RES_TEXT_VERT_ADJUST ) )); + SdrTextVertAdjustItem aTextVertAdjust( rFromSet.Get ( RES_TEXT_VERT_ADJUST ) ); bRet &= static_cast<SfxPoolItem&>(aTextVertAdjust).PutValue(*pTextVertAdjust, 0); rToSet.Put(aTextVertAdjust); } @@ -972,7 +972,7 @@ static inline void lcl_FillCol ( SfxItemSet &rToSet, const ::SfxItemSet &rFromSe { if ( pAny ) { - SwFormatCol aCol ( static_cast < const ::SwFormatCol & > ( rFromSet.Get ( RES_COL ) ) ); + SwFormatCol aCol ( rFromSet.Get ( RES_COL ) ); static_cast<SfxPoolItem&>(aCol).PutValue( *pAny, MID_COLUMNS); rToSet.Put(aCol); } @@ -3080,7 +3080,7 @@ void SwXFrame::attach(const uno::Reference< text::XTextRange > & xTextRange) SfxItemSet aSet( pDoc->GetAttrPool(), svl::Items<RES_ANCHOR, RES_ANCHOR>{} ); aSet.SetParent(&pFormat->GetAttrSet()); - SwFormatAnchor aAnchor = static_cast<const SwFormatAnchor&>(aSet.Get(RES_ANCHOR)); + SwFormatAnchor aAnchor = aSet.Get(RES_ANCHOR); aAnchor.SetAnchor( aIntPam.Start() ); aSet.Put(aAnchor); pDoc->SetFlyFrameAttr( *pFormat, aSet ); diff --git a/sw/source/core/unocore/unostyle.cxx b/sw/source/core/unocore/unostyle.cxx index 83c0439efd69..c560c3acf941 100644 --- a/sw/source/core/unocore/unostyle.cxx +++ b/sw/source/core/unocore/unostyle.cxx @@ -408,8 +408,8 @@ public: virtual css::uno::Reference< css::container::XNameReplace > SAL_CALL getEvents( ) override; //ICoreStyle - virtual void SetItem(enum RES_FRMATR eAtr, const SfxPoolItem& rItem) override; - virtual const SfxPoolItem* GetItem(enum RES_FRMATR eAtr) override; + virtual void SetItem(sal_uInt16 eAtr, const SfxPoolItem& rItem) override; + virtual const SfxPoolItem* GetItem(sal_uInt16 eAtr) override; virtual css::document::XEventsSupplier& GetEventsSupplier() override { return *this; }; }; @@ -1668,7 +1668,7 @@ void SwXStyle::SetPropertyValue<OWN_ATTR_FILLBMP_MODE>(const SfxItemPropertySimp rStyleSet.Put(XFillBmpTileItem(drawing::BitmapMode_REPEAT == eMode)); } template<> -void SwXStyle::SetPropertyValue<RES_PAPER_BIN>(const SfxItemPropertySimpleEntry& rEntry, const SfxItemPropertySet& rPropSet, const uno::Any& rValue, SwStyleBase_Impl& o_rStyleBase) +void SwXStyle::SetPropertyValue<sal_uInt16(RES_PAPER_BIN)>(const SfxItemPropertySimpleEntry& rEntry, const SfxItemPropertySet& rPropSet, const uno::Any& rValue, SwStyleBase_Impl& o_rStyleBase) { if(!rValue.has<OUString>()) throw lang::IllegalArgumentException(); @@ -1768,7 +1768,7 @@ void SwXStyle::SetPropertyValue<FN_UNO_FOLLOW_STYLE>(const SfxItemPropertySimple o_rStyleBase.getNewBase()->SetFollow(aString); } template<> -void SwXStyle::SetPropertyValue<RES_PAGEDESC>(const SfxItemPropertySimpleEntry& rEntry, const SfxItemPropertySet& rPropSet, const uno::Any& rValue, SwStyleBase_Impl& o_rStyleBase) +void SwXStyle::SetPropertyValue<sal_uInt16(RES_PAGEDESC)>(const SfxItemPropertySimpleEntry& rEntry, const SfxItemPropertySet& rPropSet, const uno::Any& rValue, SwStyleBase_Impl& o_rStyleBase) { if(MID_PAGEDESC_PAGEDESCNAME != rEntry.nMemberId) { @@ -1805,7 +1805,7 @@ void SwXStyle::SetPropertyValue<RES_PAGEDESC>(const SfxItemPropertySimpleEntry& } } template<> -void SwXStyle::SetPropertyValue<RES_TEXT_VERT_ADJUST>(const SfxItemPropertySimpleEntry& rEntry, const SfxItemPropertySet& rPropSet, const uno::Any& rValue, SwStyleBase_Impl& o_rStyleBase) +void SwXStyle::SetPropertyValue<sal_uInt16(RES_TEXT_VERT_ADJUST)>(const SfxItemPropertySimpleEntry& rEntry, const SfxItemPropertySet& rPropSet, const uno::Any& rValue, SwStyleBase_Impl& o_rStyleBase) { if(m_rEntry.m_eFamily != SfxStyleFamily::Page) { @@ -1985,14 +1985,14 @@ void SwXStyle::SetStyleProperty(const SfxItemPropertySimpleEntry& rEntry, const { XATTR_FILLHATCH, std::mem_fn(&SwXStyle::SetPropertyValue<sal_uInt16(XATTR_FILLGRADIENT)>) }, { XATTR_FILLBITMAP, std::mem_fn(&SwXStyle::SetPropertyValue<sal_uInt16(XATTR_FILLGRADIENT)>) }, { XATTR_FILLFLOATTRANSPARENCE, std::mem_fn(&SwXStyle::SetPropertyValue<sal_uInt16(XATTR_FILLGRADIENT)>) }, - { RES_BACKGROUND, std::mem_fn(&SwXStyle::SetPropertyValue<RES_BACKGROUND>) }, + { RES_BACKGROUND, std::mem_fn(&SwXStyle::SetPropertyValue<sal_uInt16(RES_BACKGROUND)>) }, { OWN_ATTR_FILLBMP_MODE, std::mem_fn(&SwXStyle::SetPropertyValue<OWN_ATTR_FILLBMP_MODE>) }, - { RES_PAPER_BIN, std::mem_fn(&SwXStyle::SetPropertyValue<RES_PAPER_BIN>) }, + { RES_PAPER_BIN, std::mem_fn(&SwXStyle::SetPropertyValue<sal_uInt16(RES_PAPER_BIN)>) }, { FN_UNO_NUM_RULES, std::mem_fn(&SwXStyle::SetPropertyValue<FN_UNO_NUM_RULES>) }, { RES_PARATR_OUTLINELEVEL, std::mem_fn(&SwXStyle::SetPropertyValue<sal_uInt16(RES_PARATR_OUTLINELEVEL)>) }, { FN_UNO_FOLLOW_STYLE, std::mem_fn(&SwXStyle::SetPropertyValue<FN_UNO_FOLLOW_STYLE>) }, - { RES_PAGEDESC, std::mem_fn(&SwXStyle::SetPropertyValue<RES_PAGEDESC>) }, - { RES_TEXT_VERT_ADJUST, std::mem_fn(&SwXStyle::SetPropertyValue<RES_TEXT_VERT_ADJUST>) }, + { RES_PAGEDESC, std::mem_fn(&SwXStyle::SetPropertyValue<sal_uInt16(RES_PAGEDESC)>) }, + { RES_TEXT_VERT_ADJUST, std::mem_fn(&SwXStyle::SetPropertyValue<sal_uInt16(RES_TEXT_VERT_ADJUST)>) }, { FN_UNO_IS_AUTO_UPDATE, std::mem_fn(&SwXStyle::SetPropertyValue<FN_UNO_IS_AUTO_UPDATE>) }, { FN_UNO_PARA_STYLE_CONDITIONS, std::mem_fn(&SwXStyle::SetPropertyValue<FN_UNO_PARA_STYLE_CONDITIONS>) }, { FN_UNO_CATEGORY, std::mem_fn(&SwXStyle::SetPropertyValue<FN_UNO_CATEGORY>) }, @@ -2133,7 +2133,7 @@ uno::Any SwXStyle::GetStyleProperty<FN_UNO_STYLE_INTEROP_GRAB_BAG>(const SfxItem return aRet; } template<> -uno::Any SwXStyle::GetStyleProperty<RES_PAPER_BIN>(const SfxItemPropertySimpleEntry& rEntry, const SfxItemPropertySet& rPropSet, SwStyleBase_Impl& rBase) +uno::Any SwXStyle::GetStyleProperty<sal_uInt16(RES_PAPER_BIN)>(const SfxItemPropertySimpleEntry& rEntry, const SfxItemPropertySet& rPropSet, SwStyleBase_Impl& rBase) { PrepareStyleBase(rBase); SfxItemSet& rSet = rBase.GetItemSet(); @@ -2172,7 +2172,7 @@ uno::Any SwXStyle::GetStyleProperty<FN_UNO_FOLLOW_STYLE>(const SfxItemPropertySi return uno::makeAny(aString); } template<> -uno::Any SwXStyle::GetStyleProperty<RES_PAGEDESC>(const SfxItemPropertySimpleEntry& rEntry, const SfxItemPropertySet& rPropSet, SwStyleBase_Impl& rBase) +uno::Any SwXStyle::GetStyleProperty<sal_uInt16(RES_PAGEDESC)>(const SfxItemPropertySimpleEntry& rEntry, const SfxItemPropertySet& rPropSet, SwStyleBase_Impl& rBase) { PrepareStyleBase(rBase); const sal_uInt8 nMemberId(rEntry.nMemberId & (~SFX_METRIC_ITEM)); @@ -2269,7 +2269,7 @@ uno::Any SwXStyle::GetStyleProperty<SID_SWREGISTER_COLLECTION>(const SfxItemProp return uno::makeAny(aName); } template<> -uno::Any SwXStyle::GetStyleProperty<RES_BACKGROUND>(const SfxItemPropertySimpleEntry& rEntry, const SfxItemPropertySet&, SwStyleBase_Impl& rBase) +uno::Any SwXStyle::GetStyleProperty<sal_uInt16(RES_BACKGROUND)>(const SfxItemPropertySimpleEntry& rEntry, const SfxItemPropertySet&, SwStyleBase_Impl& rBase) { PrepareStyleBase(rBase); const SfxItemSet& rSet = rBase.GetItemSet(); @@ -2332,17 +2332,17 @@ uno::Any SwXStyle::GetStyleProperty_Impl(const SfxItemPropertySimpleEntry& rEntr { FN_UNO_IS_PHYSICAL, std::mem_fn(&SwXStyle::GetStyleProperty<FN_UNO_IS_PHYSICAL>) }, { FN_UNO_HIDDEN, std::mem_fn(&SwXStyle::GetStyleProperty<FN_UNO_HIDDEN>) }, { FN_UNO_STYLE_INTEROP_GRAB_BAG, std::mem_fn(&SwXStyle::GetStyleProperty<FN_UNO_STYLE_INTEROP_GRAB_BAG>) }, - { RES_PAPER_BIN, std::mem_fn(&SwXStyle::GetStyleProperty<RES_PAPER_BIN>) }, + { RES_PAPER_BIN, std::mem_fn(&SwXStyle::GetStyleProperty<sal_uInt16(RES_PAPER_BIN)>) }, { FN_UNO_NUM_RULES, std::mem_fn(&SwXStyle::GetStyleProperty<FN_UNO_NUM_RULES>) }, { RES_PARATR_OUTLINELEVEL, std::mem_fn(&SwXStyle::GetStyleProperty<sal_uInt16(RES_PARATR_OUTLINELEVEL)>) }, { FN_UNO_FOLLOW_STYLE, std::mem_fn(&SwXStyle::GetStyleProperty<FN_UNO_FOLLOW_STYLE>) }, - { RES_PAGEDESC, std::mem_fn(&SwXStyle::GetStyleProperty<RES_PAGEDESC>) }, + { RES_PAGEDESC, std::mem_fn(&SwXStyle::GetStyleProperty<sal_uInt16(RES_PAGEDESC)>) }, { FN_UNO_IS_AUTO_UPDATE, std::mem_fn(&SwXStyle::GetStyleProperty<FN_UNO_IS_AUTO_UPDATE>) }, { FN_UNO_DISPLAY_NAME, std::mem_fn(&SwXStyle::GetStyleProperty<FN_UNO_DISPLAY_NAME>) }, { FN_UNO_PARA_STYLE_CONDITIONS, std::mem_fn(&SwXStyle::GetStyleProperty<FN_UNO_PARA_STYLE_CONDITIONS>) }, { FN_UNO_CATEGORY, std::mem_fn(&SwXStyle::GetStyleProperty<FN_UNO_CATEGORY>) }, { SID_SWREGISTER_COLLECTION, std::mem_fn(&SwXStyle::GetStyleProperty<SID_SWREGISTER_COLLECTION>) }, - { RES_BACKGROUND, std::mem_fn(&SwXStyle::GetStyleProperty<RES_BACKGROUND>) }, + { RES_BACKGROUND, std::mem_fn(&SwXStyle::GetStyleProperty<sal_uInt16(RES_BACKGROUND)>) }, { OWN_ATTR_FILLBMP_MODE, std::mem_fn(&SwXStyle::GetStyleProperty<OWN_ATTR_FILLBMP_MODE>) } }); } @@ -3289,8 +3289,9 @@ SwXFrameStyle::SwXFrameStyle(SwDoc *pDoc) : SwXStyle(pDoc, SfxStyleFamily::Frame, false) { } -void SwXFrameStyle::SetItem(enum RES_FRMATR eAtr, const SfxPoolItem& rItem) +void SwXFrameStyle::SetItem(sal_uInt16 eAtr, const SfxPoolItem& rItem) { + assert(eAtr >= RES_FRMATR_BEGIN && eAtr < RES_FRMATR_END); SfxStyleSheetBase* pBase = GetStyleSheetBase(); if(!pBase) return; @@ -3301,8 +3302,9 @@ void SwXFrameStyle::SetItem(enum RES_FRMATR eAtr, const SfxPoolItem& rItem) xStyle->SetItemSet(aSet); } -const SfxPoolItem* SwXFrameStyle::GetItem(enum RES_FRMATR eAtr) +const SfxPoolItem* SwXFrameStyle::GetItem(sal_uInt16 eAtr) { + assert(eAtr >= RES_FRMATR_BEGIN && eAtr < RES_FRMATR_END); SfxStyleSheetBase* pBase = GetStyleSheetBase(); if(!pBase) return nullptr; diff --git a/sw/source/core/unocore/unotbl.cxx b/sw/source/core/unocore/unotbl.cxx index 350656ff5365..cdd63b47805f 100644 --- a/sw/source/core/unocore/unotbl.cxx +++ b/sw/source/core/unocore/unotbl.cxx @@ -2822,7 +2822,7 @@ uno::Any SwXTextTable::getPropertyValue(const OUString& rPropertyName) aSet.Put(SvxBoxInfoItem( SID_ATTR_BORDER_INNER )); SwDoc::GetTabBorders(rCursor, aSet); const SvxBoxInfoItem& rBoxInfoItem = aSet.Get(SID_ATTR_BORDER_INNER); - const SvxBoxItem& rBox = static_cast<const SvxBoxItem&>(aSet.Get(RES_BOX)); + const SvxBoxItem& rBox = aSet.Get(RES_BOX); if (FN_UNO_TABLE_BORDER == pEntry->nWID) { @@ -3429,7 +3429,7 @@ SwXCellRange::setPropertyValue(const OUString& rPropertyName, const uno::Any& aV SwDoc::GetTabBorders(rCursor, aSet); aSet.Put(aBoxInfo); - SvxBoxItem aBoxItem(static_cast<const SvxBoxItem&>(aSet.Get(RES_BOX))); + SvxBoxItem aBoxItem(aSet.Get(RES_BOX)); static_cast<SfxPoolItem&>(aBoxItem).PutValue(aValue, pEntry->nMemberId); aSet.Put(aBoxItem); pDoc->SetTabBorders(*m_pImpl->m_pTableCursor, aSet); @@ -3519,7 +3519,7 @@ uno::Any SAL_CALL SwXCellRange::getPropertyValue(const OUString& rPropertyName) SID_ATTR_BORDER_INNER, SID_ATTR_BORDER_INNER>{}); aSet.Put(SvxBoxInfoItem( SID_ATTR_BORDER_INNER )); SwDoc::GetTabBorders(*m_pImpl->m_pTableCursor, aSet); - const SvxBoxItem& rBoxItem = static_cast<const SvxBoxItem&>(aSet.Get(RES_BOX)); + const SvxBoxItem& rBoxItem = aSet.Get(RES_BOX); rBoxItem.QueryValue(aRet, pEntry->nMemberId); } break; diff --git a/sw/source/filter/basflt/fltini.cxx b/sw/source/filter/basflt/fltini.cxx index c0c3d992eff0..4d7c7ad48a2a 100644 --- a/sw/source/filter/basflt/fltini.cxx +++ b/sw/source/filter/basflt/fltini.cxx @@ -307,7 +307,7 @@ void CalculateFlySize(SfxItemSet& rFlySet, const SwNodeIndex& rAnchor, if( SfxItemState::SET != rFlySet.GetItemState( RES_FRM_SIZE, true, &pItem ) || MINFLY > static_cast<const SwFormatFrameSize*>(pItem)->GetWidth() ) { - SwFormatFrameSize aSz(static_cast<const SwFormatFrameSize&>(rFlySet.Get(RES_FRM_SIZE))); + SwFormatFrameSize aSz(rFlySet.Get(RES_FRM_SIZE)); if (pItem) aSz = static_cast<const SwFormatFrameSize&>(*pItem); @@ -320,8 +320,7 @@ void CalculateFlySize(SfxItemSet& rFlySet, const SwNodeIndex& rAnchor, else nWidth = nPageWidth; - const SwNodeIndex* pSttNd = static_cast<const SwFormatContent&>(rFlySet.Get( RES_CNTNT )). - GetContentIdx(); + const SwNodeIndex* pSttNd = rFlySet.Get( RES_CNTNT ).GetContentIdx(); if( pSttNd ) { bool bOnlyOneNode = true; @@ -366,7 +365,7 @@ void CalculateFlySize(SfxItemSet& rFlySet, const SwNodeIndex& rAnchor, } // consider border and distance to content - const SvxBoxItem& rBoxItem = static_cast<const SvxBoxItem&>(rFlySet.Get( RES_BOX )); + const SvxBoxItem& rBoxItem = rFlySet.Get( RES_BOX ); SvxBoxItemLine nLine = SvxBoxItemLine::LEFT; for( int i = 0; i < 2; ++i ) { diff --git a/sw/source/filter/html/htmlatr.cxx b/sw/source/filter/html/htmlatr.cxx index a17e2426af8d..e82dc41be022 100644 --- a/sw/source/filter/html/htmlatr.cxx +++ b/sw/source/filter/html/htmlatr.cxx @@ -573,7 +573,7 @@ void OutHTML_SwFormat( Writer& rWrt, const SwFormat& rFormat, // we will need the lower spacing of the paragraph later on const SvxULSpaceItem& rULSpace = - pNodeItemSet ? static_cast<const SvxULSpaceItem &>(pNodeItemSet->Get(RES_UL_SPACE)) + pNodeItemSet ? pNodeItemSet->Get(RES_UL_SPACE) : rFormat.GetULSpace(); if( (rHWrt.m_bOutHeader && @@ -627,7 +627,7 @@ void OutHTML_SwFormat( Writer& rWrt, const SwFormat& rFormat, rWrt.pCurPam->GetMark()->nNode.GetIndex()); // If styles are exported, indented paragraphs become definition lists const SvxLRSpaceItem& rLRSpace = - pNodeItemSet ? static_cast<const SvxLRSpaceItem &>(pNodeItemSet->Get(RES_LR_SPACE)) + pNodeItemSet ? pNodeItemSet->Get(RES_LR_SPACE) : rFormat.GetLRSpace(); if( (!rHWrt.m_bCfgOutStyles || bForceDL) && !rInfo.bInNumBulList ) { @@ -824,8 +824,7 @@ void OutHTML_SwFormat( Writer& rWrt, const SwFormat& rFormat, // and the text direction SvxFrameDirection nDir = rHWrt.GetHTMLDirection( - (pNodeItemSet ? static_cast < const SvxFrameDirectionItem& >( - pNodeItemSet->Get( RES_FRAMEDIR ) ) + (pNodeItemSet ? pNodeItemSet->Get( RES_FRAMEDIR ) : rFormat.GetFrameDir() ).GetValue() ); // We only write a <P>, if @@ -2515,7 +2514,7 @@ Writer& OutHTML_SwTextNode( Writer& rWrt, const SwContentNode& rNode ) { HtmlWriter aHtml(rHTMLWrt.Strm()); aHtml.single(OOO_STRING_SVTOOLS_HTML_linebreak); - const SvxULSpaceItem& rULSpace = static_cast<const SvxULSpaceItem&>( pNd->GetSwAttrSet().Get(RES_UL_SPACE) ); + const SvxULSpaceItem& rULSpace = pNd->GetSwAttrSet().Get(RES_UL_SPACE); if (rULSpace.GetLower() > 0 && !bEndOfCell && !rHTMLWrt.IsHTMLMode(HTMLMODE_NO_BR_AT_PAREND) ) diff --git a/sw/source/filter/html/htmlflywriter.cxx b/sw/source/filter/html/htmlflywriter.cxx index 2bd0b7800f0c..1760b97bf4f4 100644 --- a/sw/source/filter/html/htmlflywriter.cxx +++ b/sw/source/filter/html/htmlflywriter.cxx @@ -2037,8 +2037,8 @@ void SwHTMLWriter::CollectLinkTargets() nMaxItems = pDoc->GetAttrPool().GetItemCount2( RES_URL ); for( n = 0; n < nMaxItems; ++n ) { - if( nullptr != (pURL = static_cast<const SwFormatURL*>(pDoc->GetAttrPool().GetItem2( - RES_URL, n ) ) ) ) + if( nullptr != (pURL = pDoc->GetAttrPool().GetItem2( + RES_URL, n ) ) ) { AddLinkTarget( pURL->GetURL() ); const ImageMap *pIMap = pURL->GetMap(); diff --git a/sw/source/filter/html/htmlnumreader.cxx b/sw/source/filter/html/htmlnumreader.cxx index 7ae3230f7332..4904426730ff 100644 --- a/sw/source/filter/html/htmlnumreader.cxx +++ b/sw/source/filter/html/htmlnumreader.cxx @@ -283,8 +283,7 @@ void SwHTMLParser::NewNumBulList( HtmlTokenId nToken ) if( aPropInfo.m_bTextIndent ) { short nTextIndent = - static_cast<const SvxLRSpaceItem &>(aItemSet.Get( RES_LR_SPACE )) - .GetTextFirstLineOfst(); + aItemSet.Get( RES_LR_SPACE ).GetTextFirstLineOfst(); aNumFormat.SetFirstLineOffset( nTextIndent ); bChangeNumFormat = true; } diff --git a/sw/source/filter/html/htmlplug.cxx b/sw/source/filter/html/htmlplug.cxx index ed8bf7fa833b..3179bfa68e21 100644 --- a/sw/source/filter/html/htmlplug.cxx +++ b/sw/source/filter/html/htmlplug.cxx @@ -241,7 +241,7 @@ void SwHTMLParser::SetSpace( const Size& rPixSpace, if( nLeftSpace ) { const SwFormatHoriOrient& rHoriOri = - static_cast<const SwFormatHoriOrient&>(rFlyItemSet.Get( RES_HORI_ORIENT )); + rFlyItemSet.Get( RES_HORI_ORIENT ); if( text::HoriOrientation::NONE == rHoriOri.GetHoriOrient() ) { SwFormatHoriOrient aHoriOri( rHoriOri ); @@ -277,7 +277,7 @@ void SwHTMLParser::SetSpace( const Size& rPixSpace, if( nUpperSpace ) { const SwFormatVertOrient& rVertOri = - static_cast<const SwFormatVertOrient&>(rFlyItemSet.Get( RES_VERT_ORIENT )); + rFlyItemSet.Get( RES_VERT_ORIENT ); if( text::VertOrientation::NONE == rVertOri.GetVertOrient() ) { SwFormatVertOrient aVertOri( rVertOri ); diff --git a/sw/source/filter/html/htmlsect.cxx b/sw/source/filter/html/htmlsect.cxx index 56149052609f..17995c420482 100644 --- a/sw/source/filter/html/htmlsect.cxx +++ b/sw/source/filter/html/htmlsect.cxx @@ -760,7 +760,7 @@ void SwHTMLParser::InsertFlyFrame( const SfxItemSet& rItemSet, const OUString& rName ) { RndStdIds eAnchorId = - static_cast<const SwFormatAnchor&>(rItemSet.Get( RES_ANCHOR )).GetAnchorId(); + rItemSet.Get( RES_ANCHOR ).GetAnchorId(); // create frame SwFlyFrameFormat* pFlyFormat = m_xDoc->MakeFlySection( eAnchorId, m_pPam->GetPoint(), diff --git a/sw/source/filter/html/htmltab.cxx b/sw/source/filter/html/htmltab.cxx index 80ddf65f2303..33c7de3e6fe3 100644 --- a/sw/source/filter/html/htmltab.cxx +++ b/sw/source/filter/html/htmltab.cxx @@ -3562,8 +3562,8 @@ void SwHTMLParser::BuildTableCell( HTMLTable *pCurTable, bool bReadOptions, if( nSpace ) aFrameSet.Put( SvxULSpaceItem(nSpace,nSpace, RES_UL_SPACE) ); - RndStdIds eAnchorId = static_cast<const SwFormatAnchor&>(aFrameSet. - Get( RES_ANCHOR )). + RndStdIds eAnchorId = aFrameSet. + Get( RES_ANCHOR ). GetAnchorId(); SwFrameFormat *pFrameFormat = m_xDoc->MakeFlySection( eAnchorId, m_pPam->GetPoint(), &aFrameSet ); diff --git a/sw/source/filter/html/swhtml.cxx b/sw/source/filter/html/swhtml.cxx index d8b2398b7f20..1b1cd5c950e8 100644 --- a/sw/source/filter/html/swhtml.cxx +++ b/sw/source/filter/html/swhtml.cxx @@ -4869,7 +4869,7 @@ void SwHTMLParser::InsertSpacer() // create the frame RndStdIds eAnchorId = - static_cast<const SwFormatAnchor &>(aFrameSet.Get(RES_ANCHOR)).GetAnchorId(); + aFrameSet.Get(RES_ANCHOR).GetAnchorId(); SwFrameFormat *pFlyFormat = m_xDoc->MakeFlySection( eAnchorId, m_pPam->GetPoint(), &aFrameSet ); // Possibly create frames and register auto-bound frames. @@ -5131,7 +5131,7 @@ void SwHTMLParser::InsertLineBreak() { if( m_pCSS1Parser->SetFormatBreak( aItemSet, aPropInfo ) ) { - aBreakItem = static_cast<const SvxFormatBreakItem &>(aItemSet.Get( RES_BREAK )); + aBreakItem = aItemSet.Get( RES_BREAK ); bBreakItem = true; } if( !aPropInfo.m_aId.isEmpty() ) diff --git a/sw/source/filter/html/wrthtml.cxx b/sw/source/filter/html/wrthtml.cxx index fb27971cf060..3213ab5ef868 100644 --- a/sw/source/filter/html/wrthtml.cxx +++ b/sw/source/filter/html/wrthtml.cxx @@ -1295,9 +1295,7 @@ void SwHTMLWriter::OutLanguage( LanguageType nLang ) SvxFrameDirection SwHTMLWriter::GetHTMLDirection( const SfxItemSet& rItemSet ) const { - return GetHTMLDirection( - static_cast < const SvxFrameDirectionItem& >( rItemSet.Get( RES_FRAMEDIR ) ) - .GetValue() ); + return GetHTMLDirection( rItemSet.Get( RES_FRAMEDIR ).GetValue() ); } SvxFrameDirection SwHTMLWriter::GetHTMLDirection( SvxFrameDirection nDir ) const diff --git a/sw/source/filter/ww8/docxattributeoutput.cxx b/sw/source/filter/ww8/docxattributeoutput.cxx index d46c2d205119..eaa3b84af42b 100644 --- a/sw/source/filter/ww8/docxattributeoutput.cxx +++ b/sw/source/filter/ww8/docxattributeoutput.cxx @@ -7603,7 +7603,7 @@ void DocxAttributeOutput::ParaAdjust( const SvxAdjustItem& rAdjust ) const SfxItemSet* pItems = GetExport().GetCurItemSet(); const SvxFrameDirectionItem* rFrameDir = pItems? - static_cast< const SvxFrameDirectionItem* >( pItems->GetItem( RES_FRAMEDIR ) ): nullptr; + pItems->GetItem( RES_FRAMEDIR ) : nullptr; SvxFrameDirection nDir = SvxFrameDirection::Environment; if( rFrameDir != nullptr ) diff --git a/sw/source/filter/ww8/rtfattributeoutput.cxx b/sw/source/filter/ww8/rtfattributeoutput.cxx index 473bcddf8abf..181764bf4607 100644 --- a/sw/source/filter/ww8/rtfattributeoutput.cxx +++ b/sw/source/filter/ww8/rtfattributeoutput.cxx @@ -2914,7 +2914,7 @@ void RtfAttributeOutput::ParaNumRule_Impl(const SwTextNode* pTextNd, sal_Int32 n m_aStyles.append(OOO_STRING_SVTOOLS_RTF_PLAIN); m_aStyles.append(' '); - SvxLRSpaceItem aLR(static_cast<const SvxLRSpaceItem&>(rNdSet.Get(RES_LR_SPACE))); + SvxLRSpaceItem aLR(rNdSet.Get(RES_LR_SPACE)); aLR.SetTextLeft(aLR.GetTextLeft() + pFormat->GetIndentAt()); aLR.SetTextFirstLineOfst(pFormat->GetFirstLineOffset()); diff --git a/sw/source/filter/ww8/rtfexport.cxx b/sw/source/filter/ww8/rtfexport.cxx index f31ae9bba61b..e98751b1b976 100644 --- a/sw/source/filter/ww8/rtfexport.cxx +++ b/sw/source/filter/ww8/rtfexport.cxx @@ -733,7 +733,7 @@ void RtfExport::ExportDocument_Impl() sal_uInt32 const nMaxItem = rPool.GetItemCount2(RES_PROTECT); for (sal_uInt32 n = 0; n < nMaxItem; ++n) { - auto pProtect = static_cast<const SvxProtectItem*>(rPool.GetItem2(RES_PROTECT, n)); + auto pProtect = rPool.GetItem2(RES_PROTECT, n); if (pProtect && pProtect->IsContentProtected()) { Strm().WriteCharPtr(OOO_STRING_SVTOOLS_RTF_FORMPROT); @@ -766,7 +766,7 @@ void RtfExport::ExportDocument_Impl() if (pSet) { std::size_t nPosInDoc; - pSttPgDsc = static_cast<const SwFormatPageDesc*>(&pSet->Get(RES_PAGEDESC)); + pSttPgDsc = &pSet->Get(RES_PAGEDESC); if (!pSttPgDsc->GetPageDesc()) pSttPgDsc = nullptr; else if (m_pDoc->FindPageDesc(pSttPgDsc->GetPageDesc()->GetName(), &nPosInDoc)) @@ -1224,18 +1224,16 @@ void RtfExport::OutColorTable() // shadow color { - auto pShadow = static_cast<const SvxShadowItem*>(GetDfltAttr(RES_SHADOW)); + auto pShadow = GetDfltAttr(RES_SHADOW); InsColor(pShadow->GetColor()); - if (nullptr - != (pShadow = static_cast<const SvxShadowItem*>(rPool.GetPoolDefaultItem(RES_SHADOW)))) + if (nullptr != (pShadow = rPool.GetPoolDefaultItem(RES_SHADOW))) { InsColor(pShadow->GetColor()); } nMaxItem = rPool.GetItemCount2(RES_SHADOW); for (sal_uInt32 n = 0; n < nMaxItem; ++n) { - if (nullptr - != (pShadow = static_cast<const SvxShadowItem*>(rPool.GetItem2(RES_SHADOW, n)))) + if (nullptr != (pShadow = rPool.GetItem2(RES_SHADOW, n))) { InsColor(pShadow->GetColor()); } @@ -1245,12 +1243,12 @@ void RtfExport::OutColorTable() // frame border color { const SvxBoxItem* pBox; - if (nullptr != (pBox = static_cast<const SvxBoxItem*>(rPool.GetPoolDefaultItem(RES_BOX)))) + if (nullptr != (pBox = rPool.GetPoolDefaultItem(RES_BOX))) InsColorLine(*pBox); nMaxItem = rPool.GetItemCount2(RES_BOX); for (sal_uInt32 n = 0; n < nMaxItem; ++n) { - if (nullptr != (pBox = static_cast<const SvxBoxItem*>(rPool.GetItem2(RES_BOX, n)))) + if (nullptr != (pBox = rPool.GetItem2(RES_BOX, n))) InsColorLine(*pBox); } } diff --git a/sw/source/filter/ww8/wrtw8nds.cxx b/sw/source/filter/ww8/wrtw8nds.cxx index 8ca637f005cf..5619ff7639f9 100644 --- a/sw/source/filter/ww8/wrtw8nds.cxx +++ b/sw/source/filter/ww8/wrtw8nds.cxx @@ -2833,8 +2833,8 @@ void MSWordExportBase::OutputTextNode( SwTextNode& rNode ) cannot export that, if it's ltr then that's ok as that is word's default. Otherwise we must add a RTL attribute to our export list */ - const SvxFrameDirectionItem* pItem = static_cast<const SvxFrameDirectionItem*>( - rNode.GetSwAttrSet().GetItem(RES_FRAMEDIR)); + const SvxFrameDirectionItem* pItem = + rNode.GetSwAttrSet().GetItem(RES_FRAMEDIR); if ( (!pItem || pItem->GetValue() == SvxFrameDirection::Environment) && aAttrIter.IsParaRTL() @@ -3117,8 +3117,7 @@ void MSWordExportBase::OutputSectionNode( const SwSectionNode& rSectionNode ) if ( rNd.IsContentNode() ) { pSet = &rNd.GetContentNode()->GetSwAttrSet(); - nRstLnNum = static_cast<const SwFormatLineNumber&>(pSet->Get( - RES_LINENUMBER )).GetStartValue(); + nRstLnNum = pSet->Get( RES_LINENUMBER ).GetStartValue(); } else pSet = nullptr; diff --git a/sw/source/filter/ww8/wrtw8sty.cxx b/sw/source/filter/ww8/wrtw8sty.cxx index a61cbbc76e81..3b692e9825a0 100644 --- a/sw/source/filter/ww8/wrtw8sty.cxx +++ b/sw/source/filter/ww8/wrtw8sty.cxx @@ -974,7 +974,7 @@ MSWordSections::MSWordSections( MSWordExportBase& rExport ) const SwNode* pNd = rExport.m_pCurPam->GetContentNode(); const SfxItemSet* pSet = pNd ? &static_cast<const SwContentNode*>(pNd)->GetSwAttrSet() : nullptr; - sal_uLong nRstLnNum = pSet ? static_cast<const SwFormatLineNumber&>(pSet->Get( RES_LINENUMBER )).GetStartValue() : 0; + sal_uLong nRstLnNum = pSet ? pSet->Get( RES_LINENUMBER ).GetStartValue() : 0; const SwTableNode* pTableNd = rExport.m_pCurPam->GetNode().FindTableNode(); const SwSectionNode* pSectNd; @@ -1069,7 +1069,7 @@ sal_uInt16 MSWordSections::NumberOfColumns( const SwDoc &rDoc, const WW8_SepInfo if ( rInfo.pSectionFormat && reinterpret_cast<SwSectionFormat*>(sal_IntPtr(-1)) != rInfo.pSectionFormat ) aSet.Put( rInfo.pSectionFormat->GetFormatAttr( RES_COL ) ); - const SwFormatCol& rCol = static_cast<const SwFormatCol&>(aSet.Get( RES_COL )); + const SwFormatCol& rCol = aSet.Get( RES_COL ); const SwColumns& rColumns = rCol.GetColumns(); return rColumns.size(); } diff --git a/sw/source/filter/ww8/wrtww8.cxx b/sw/source/filter/ww8/wrtww8.cxx index c9fe09f40dfc..4a3086511b59 100644 --- a/sw/source/filter/ww8/wrtww8.cxx +++ b/sw/source/filter/ww8/wrtww8.cxx @@ -3093,7 +3093,7 @@ void MSWordExportBase::CollectOutlineBookmarks(const SwDoc &rDoc) nMaxItems = rDoc.GetAttrPool().GetItemCount2( RES_URL ); for (sal_uInt32 n = 0; n < nMaxItems; ++n) { - const SwFormatURL *pURL = static_cast<const SwFormatURL*>(rDoc.GetAttrPool().GetItem2(RES_URL, n)); + const SwFormatURL *pURL = rDoc.GetAttrPool().GetItem2(RES_URL, n); if (!pURL) continue; diff --git a/sw/source/filter/ww8/ww8atr.cxx b/sw/source/filter/ww8/ww8atr.cxx index 34a448ef2690..98f1a58d3c5a 100644 --- a/sw/source/filter/ww8/ww8atr.cxx +++ b/sw/source/filter/ww8/ww8atr.cxx @@ -3370,8 +3370,8 @@ static bool lcl_IsAtTextEnd(const SwFormatFootnote& rFootnote) bool bRet = true; if( rFootnote.GetTextFootnote() ) { - sal_uInt16 nWh = static_cast< sal_uInt16 >(rFootnote.IsEndNote() ? RES_END_AT_TXTEND - : RES_FTN_AT_TXTEND); + sal_uInt16 nWh = rFootnote.IsEndNote() ? sal_uInt16(RES_END_AT_TXTEND) + : sal_uInt16(RES_FTN_AT_TXTEND); const SwSectionNode* pSectNd = rFootnote.GetTextFootnote()->GetTextNode(). FindSectionNode(); while( pSectNd && FTNEND_ATPGORDOCEND == @@ -4497,7 +4497,7 @@ void AttributeOutputBase::FormatColumns( const SwFormatCol& rCol ) nPageSize = pFormat->GetFrameSize().GetHeight(); nPageSize -= rUL.GetUpper() + rUL.GetLower(); - const SwFormatHeader *header = dynamic_cast<const SwFormatHeader *>(pFormat->GetAttrSet().GetItem(RES_HEADER)); + const SwFormatHeader *header = pFormat->GetAttrSet().GetItem(RES_HEADER); if ( header ) { const SwFrameFormat *headerFormat = header->GetHeaderFormat(); @@ -4506,7 +4506,7 @@ void AttributeOutputBase::FormatColumns( const SwFormatCol& rCol ) nPageSize -= headerFormat->GetFrameSize().GetHeight(); } } - const SwFormatFooter *footer = dynamic_cast<const SwFormatFooter *>(pFormat->GetAttrSet().GetItem(RES_FOOTER)); + const SwFormatFooter *footer = pFormat->GetAttrSet().GetItem(RES_FOOTER); if ( footer ) { const SwFrameFormat *footerFormat = footer->GetFooterFormat(); diff --git a/sw/source/filter/ww8/ww8graf.cxx b/sw/source/filter/ww8/ww8graf.cxx index b61b8147932d..90110354b647 100644 --- a/sw/source/filter/ww8/ww8graf.cxx +++ b/sw/source/filter/ww8/ww8graf.cxx @@ -1639,16 +1639,14 @@ void SwWW8ImplReader::MatchSdrItemsIntoFlySet( SdrObject const * pSdrObj, const SfxItemSet& rOldSet = pSdrObj->GetMergedItemSet(); // some Items can be taken over directly - const sal_uInt16 nDirectMatch = 2; - static RES_FRMATR const aDirectMatch[ nDirectMatch ] = + static sal_uInt16 const aDirectMatch[] { RES_LR_SPACE, // outer spacing left/right: SvxLRSpaceItem RES_UL_SPACE // outer spacing top/bottom: SvxULSpaceItem }; const SfxPoolItem* pPoolItem; - for(RES_FRMATR i : aDirectMatch) - if( SfxItemState::SET == rOldSet.GetItemState( - static_cast< sal_uInt16 >(i), false, &pPoolItem) ) + for(sal_uInt16 i : aDirectMatch) + if( SfxItemState::SET == rOldSet.GetItemState(i, false, &pPoolItem) ) { rFlySet.Put( *pPoolItem ); } @@ -1713,7 +1711,7 @@ void SwWW8ImplReader::MatchSdrItemsIntoFlySet( SdrObject const * pSdrObj, } else // If a size is set, adjust it to consider border thickness { - SwFormatFrameSize aSize = static_cast<const SwFormatFrameSize &>(rFlySet.Get(RES_FRM_SIZE)); + SwFormatFrameSize aSize = rFlySet.Get(RES_FRM_SIZE); SwFormatFrameSize aNewSize = SwFormatFrameSize(bFixSize ? ATT_FIX_SIZE : ATT_VAR_SIZE, aSize.GetWidth() + 2*nOutside, @@ -1726,13 +1724,11 @@ void SwWW8ImplReader::MatchSdrItemsIntoFlySet( SdrObject const * pSdrObj, // graphic in relation to the top left inside the border. We don't if (nOutside) { - SwFormatHoriOrient aHori = static_cast<const SwFormatHoriOrient &>(rFlySet.Get( - RES_HORI_ORIENT)); + SwFormatHoriOrient aHori = rFlySet.Get(RES_HORI_ORIENT); aHori.SetPos(MakeSafePositioningValue(aHori.GetPos()-nOutside)); rFlySet.Put(aHori); - SwFormatVertOrient aVert = static_cast<const SwFormatVertOrient &>(rFlySet.Get( - RES_VERT_ORIENT)); + SwFormatVertOrient aVert = rFlySet.Get(RES_VERT_ORIENT); aVert.SetPos(aVert.GetPos()-nOutside); rFlySet.Put(aVert); } diff --git a/sw/source/filter/xml/xmlitemm.cxx b/sw/source/filter/xml/xmlitemm.cxx index 998e430f108d..417e0a5d96c1 100644 --- a/sw/source/filter/xml/xmlitemm.cxx +++ b/sw/source/filter/xml/xmlitemm.cxx @@ -26,6 +26,7 @@ #include <xmloff/xmltoken.hxx> #include <unomid.h> +#include <fmtfsize.hxx> using namespace ::xmloff::token; diff --git a/sw/source/ui/chrdlg/numpara.cxx b/sw/source/ui/chrdlg/numpara.cxx index ab3ab8889aa7..239b64060bd6 100644 --- a/sw/source/ui/chrdlg/numpara.cxx +++ b/sw/source/ui/chrdlg/numpara.cxx @@ -273,7 +273,7 @@ void SwParagraphNumTabPage::Reset(const SfxItemSet* rSet) StyleHdl_Impl(*m_pNumberStyleLB.get()); if( SfxItemState::DEFAULT <= rSet->GetItemState(RES_LINENUMBER)) { - const SwFormatLineNumber& rNum = static_cast<const SwFormatLineNumber&>(rSet->Get(RES_LINENUMBER)); + const SwFormatLineNumber& rNum = rSet->Get(RES_LINENUMBER); sal_uLong nStartValue = rNum.GetStartValue(); bool bCount = rNum.IsCount(); m_pCountParaCB->SetState( bCount ? TRISTATE_TRUE : TRISTATE_FALSE ); diff --git a/sw/source/ui/dialog/uiregionsw.cxx b/sw/source/ui/dialog/uiregionsw.cxx index 404b2a0f59bc..0b44307455c6 100644 --- a/sw/source/ui/dialog/uiregionsw.cxx +++ b/sw/source/ui/dialog/uiregionsw.cxx @@ -1443,7 +1443,7 @@ void SwInsertSectionTabDialog::PageCreated( sal_uInt16 nId, SfxTabPage &rPage ) } else if (nId == m_nColumnPageId) { - const SwFormatFrameSize& rSize = static_cast<const SwFormatFrameSize&>(GetInputSetImpl()->Get(RES_FRM_SIZE)); + const SwFormatFrameSize& rSize = GetInputSetImpl()->Get(RES_FRM_SIZE); static_cast<SwColumnPage&>(rPage).SetPageWidth(rSize.GetWidth()); static_cast<SwColumnPage&>(rPage).ShowBalance(true); static_cast<SwColumnPage&>(rPage).SetInSection(true); @@ -2010,10 +2010,8 @@ void SwSectionFootnoteEndTabPage::ResetState( bool bFootnote, void SwSectionFootnoteEndTabPage::Reset( const SfxItemSet* rSet ) { - ResetState( true, static_cast<const SwFormatFootnoteAtTextEnd&>(rSet->Get( - RES_FTN_AT_TXTEND, false ))); - ResetState( false, static_cast<const SwFormatEndAtTextEnd&>(rSet->Get( - RES_END_AT_TXTEND, false ))); + ResetState( true, rSet->Get( RES_FTN_AT_TXTEND, false )); + ResetState( false, rSet->Get( RES_END_AT_TXTEND, false )); } VclPtr<SfxTabPage> SwSectionFootnoteEndTabPage::Create( vcl::Window* pParent, @@ -2170,7 +2168,7 @@ void SwSectionIndentTabPage::Reset( const SfxItemSet* rSet) if ( eItemState >= SfxItemState::DEFAULT ) { const SvxLRSpaceItem& rSpace = - static_cast<const SvxLRSpaceItem&>(rSet->Get( RES_LR_SPACE )); + rSet->Get( RES_LR_SPACE ); m_pBeforeMF->SetValue( m_pBeforeMF->Normalize(rSpace.GetLeft()), FUNIT_TWIP ); m_pAfterMF->SetValue( m_pAfterMF->Normalize(rSpace.GetRight()), FUNIT_TWIP ); diff --git a/sw/source/ui/envelp/envfmt.cxx b/sw/source/ui/envelp/envfmt.cxx index 6a1371e4926c..3c87cd77f8cd 100644 --- a/sw/source/ui/envelp/envfmt.cxx +++ b/sw/source/ui/envelp/envfmt.cxx @@ -311,8 +311,7 @@ IMPL_LINK( SwEnvFormatPage, EditHdl, MenuButton *, pButton, void ) aTmpSet.Put( aTabPos ); // left border as offset - const long nOff = static_cast<const SvxLRSpaceItem&>(aTmpSet.Get( RES_LR_SPACE )). - GetTextLeft(); + const long nOff = aTmpSet.Get( RES_LR_SPACE ).GetTextLeft(); SfxInt32Item aOff( SID_ATTR_TABSTOP_OFFSET, nOff ); aTmpSet.Put( aOff ); diff --git a/sw/source/ui/frmdlg/column.cxx b/sw/source/ui/frmdlg/column.cxx index 6242abbb954f..c510ed5b4b7d 100644 --- a/sw/source/ui/frmdlg/column.cxx +++ b/sw/source/ui/frmdlg/column.cxx @@ -285,7 +285,7 @@ IMPL_LINK_NOARG(SwColumnDlg, OkHdl, Button*, void) if(pSelectionSet && SfxItemState::SET == pSelectionSet->GetItemState(RES_COL)) { //insert region with columns - const SwFormatCol& rColItem = static_cast<const SwFormatCol&>(pSelectionSet->Get(RES_COL)); + const SwFormatCol& rColItem = pSelectionSet->Get(RES_COL); //only if there actually are columns! if(rColItem.GetNumCols() > 1) rWrtShell.GetView().GetViewFrame()->GetDispatcher()->Execute( @@ -603,8 +603,8 @@ void SwColumnPage::Reset(const SfxItemSet *rSet) m_pColMgr->SetActualWidth(FRAME_FORMAT_WIDTH); else { - const SwFormatFrameSize& rSize = static_cast<const SwFormatFrameSize&>(rSet->Get(RES_FRM_SIZE)); - const SvxBoxItem& rBox = static_cast<const SvxBoxItem&>(rSet->Get(RES_BOX)); + const SwFormatFrameSize& rSize = rSet->Get(RES_FRM_SIZE); + const SvxBoxItem& rBox = rSet->Get(RES_BOX); m_pColMgr->SetActualWidth((sal_uInt16)rSize.GetSize().Width() - rBox.GetSmallestDistance()); } } @@ -620,7 +620,7 @@ void SwColumnPage::Reset(const SfxItemSet *rSet) //text direction if( SfxItemState::DEFAULT <= rSet->GetItemState( RES_FRAMEDIR ) ) { - const SvxFrameDirectionItem& rItem = static_cast<const SvxFrameDirectionItem&>(rSet->Get(RES_FRAMEDIR)); + const SvxFrameDirectionItem& rItem = rSet->Get(RES_FRAMEDIR); SvxFrameDirection nVal = rItem.GetValue(); const sal_Int32 nPos = m_pTextDirectionLB->GetEntryPos( reinterpret_cast<void*>(nVal) ); m_pTextDirectionLB->SelectEntryPos( nPos ); @@ -1209,7 +1209,7 @@ void SwColumnPage::ActivatePage(const SfxItemSet& rSet) if (SfxItemState::DEFAULT <= rSet.GetItemState(RES_FRAMEDIR)) { const SvxFrameDirectionItem& rDirItem = - static_cast<const SvxFrameDirectionItem&>(rSet.Get(RES_FRAMEDIR)); + rSet.Get(RES_FRAMEDIR); bVertical = rDirItem.GetValue() == SvxFrameDirection::Vertical_RL_TB|| rDirItem.GetValue() == SvxFrameDirection::Vertical_LR_TB; } @@ -1224,17 +1224,15 @@ void SwColumnPage::ActivatePage(const SfxItemSet& rSet) if (!bVertical) { - const SvxLRSpaceItem& rLRSpace = static_cast<const SvxLRSpaceItem&>(rSet.Get( - RES_LR_SPACE )); - const SvxBoxItem& rBox = static_cast<const SvxBoxItem&>( rSet.Get(RES_BOX)); + const SvxLRSpaceItem& rLRSpace = rSet.Get(RES_LR_SPACE); + const SvxBoxItem& rBox = rSet.Get(RES_BOX); nActWidth = rSize.GetSize().Width() - rLRSpace.GetLeft() - rLRSpace.GetRight() - rBox.GetSmallestDistance(); } else { - const SvxULSpaceItem& rULSpace = static_cast<const SvxULSpaceItem&>(rSet.Get( - RES_UL_SPACE )); - const SvxBoxItem& rBox = static_cast<const SvxBoxItem&>( rSet.Get(RES_BOX)); + const SvxULSpaceItem& rULSpace = rSet.Get( RES_UL_SPACE ); + const SvxBoxItem& rBox = rSet.Get(RES_BOX); nActWidth = rSize.GetSize().Height() - rULSpace.GetUpper() - rULSpace.GetLower() - rBox.GetSmallestDistance(); @@ -1258,8 +1256,8 @@ void SwColumnPage::ActivatePage(const SfxItemSet& rSet) m_pFrameExampleWN->Show(); // Size - const SwFormatFrameSize& rSize = static_cast<const SwFormatFrameSize&>(rSet.Get(RES_FRM_SIZE)); - const SvxBoxItem& rBox = static_cast<const SvxBoxItem&>( rSet.Get(RES_BOX)); + const SwFormatFrameSize& rSize = rSet.Get(RES_FRM_SIZE); + const SvxBoxItem& rBox = rSet.Get(RES_BOX); sal_uInt16 nTotalWish; if (m_bFormat) diff --git a/sw/source/ui/frmdlg/frmdlg.cxx b/sw/source/ui/frmdlg/frmdlg.cxx index 43f37545cece..178ed41f3fd1 100644 --- a/sw/source/ui/frmdlg/frmdlg.cxx +++ b/sw/source/ui/frmdlg/frmdlg.cxx @@ -164,8 +164,7 @@ void SwFrameDlg::PageCreated( sal_uInt16 nId, SfxTabPage &rPage ) static_cast<SwColumnPage&>(rPage).SetFrameMode(true); static_cast<SwColumnPage&>(rPage).SetFormatUsed(m_bFormat); - const SwFormatFrameSize& rSize = static_cast<const SwFormatFrameSize&>( - m_rSet.Get( RES_FRM_SIZE )); + const SwFormatFrameSize& rSize = m_rSet.Get( RES_FRM_SIZE ); static_cast<SwColumnPage&>(rPage).SetPageWidth( rSize.GetWidth() ); } else if (nId == m_nMacroId) diff --git a/sw/source/ui/frmdlg/frmpage.cxx b/sw/source/ui/frmdlg/frmpage.cxx index 8574f8ce7e90..f93d0fcffbb9 100644 --- a/sw/source/ui/frmdlg/frmpage.cxx +++ b/sw/source/ui/frmdlg/frmpage.cxx @@ -910,7 +910,7 @@ void SwFramePage::Reset( const SfxItemSet *rSet ) SetMetric( *m_pAtVertPosED, aMetric ); const SfxPoolItem* pItem = nullptr; - const SwFormatAnchor& rAnchor = static_cast<const SwFormatAnchor&>(rSet->Get(RES_ANCHOR)); + const SwFormatAnchor& rAnchor = rSet->Get(RES_ANCHOR); if (SfxItemState::SET == rSet->GetItemState(FN_OLE_IS_MATH, false, &pItem)) m_bIsMathOLE = static_cast<const SfxBoolItem*>(pItem)->GetValue(); @@ -965,7 +965,7 @@ void SwFramePage::Reset( const SfxItemSet *rSet ) } else { - m_aGrfSize = static_cast<const SwFormatFrameSize&>(rSet->Get(RES_FRM_SIZE)).GetSize(); + m_aGrfSize = rSet->Get(RES_FRM_SIZE).GetSize(); } // entering procent value made possible @@ -974,7 +974,7 @@ void SwFramePage::Reset( const SfxItemSet *rSet ) //the available space is not yet known so the RefValue has to be calculated from size and relative size values //this is needed only if relative values are already set - const SwFormatFrameSize& rFrameSize = static_cast<const SwFormatFrameSize&>(rSet->Get(RES_FRM_SIZE)); + const SwFormatFrameSize& rFrameSize = rSet->Get(RES_FRM_SIZE); m_pRelWidthRelationLB->InsertEntry(SvxSwFramePosString::GetString(SwFPos::FRAME)); m_pRelWidthRelationLB->InsertEntry(SvxSwFramePosString::GetString(SwFPos::REL_PG_FRAME)); @@ -1020,7 +1020,7 @@ void SwFramePage::Reset( const SfxItemSet *rSet ) // i#18732 - init checkbox value { const bool bFollowTextFlow = - static_cast<const SwFormatFollowTextFlow&>(rSet->Get(RES_FOLLOW_TEXT_FLOW)).GetValue(); + rSet->Get(RES_FOLLOW_TEXT_FLOW).GetValue(); m_pFollowTextFlowCB->Check( bFollowTextFlow ); } @@ -1092,8 +1092,7 @@ bool SwFramePage::FillItemSet(SfxItemSet *rSet) if ( m_pHMap ) { - SwFormatHoriOrient aHoriOrient( static_cast<const SwFormatHoriOrient&>( - rOldSet.Get(RES_HORI_ORIENT)) ); + SwFormatHoriOrient aHoriOrient( rOldSet.Get(RES_HORI_ORIENT) ); const sal_Int32 nMapPos = GetMapPos(m_pHMap, *m_pHorizontalDLB); const sal_Int16 eHOri = GetAlignment(m_pHMap, nMapPos, *m_pHoriRelationLB); @@ -1128,8 +1127,7 @@ bool SwFramePage::FillItemSet(SfxItemSet *rSet) if ( m_pVMap ) { // alignment vertical - SwFormatVertOrient aVertOrient( static_cast<const SwFormatVertOrient&>( - rOldSet.Get(RES_VERT_ORIENT)) ); + SwFormatVertOrient aVertOrient( rOldSet.Get(RES_VERT_ORIENT) ); const sal_Int32 nMapPos = GetMapPos(m_pVMap, *m_pVerticalDLB); const sal_Int16 eVOri = GetAlignment(m_pVMap, nMapPos, *m_pVertRelationLB); @@ -1173,7 +1171,7 @@ bool SwFramePage::FillItemSet(SfxItemSet *rSet) // for a graphic that isn't even loaded, are set. Then no SetSize // is done here when the size settings were not changed by the // user. - const SwFormatFrameSize& rOldSize = static_cast<const SwFormatFrameSize& >(rOldSet.Get(RES_FRM_SIZE)); + const SwFormatFrameSize& rOldSize = rOldSet.Get(RES_FRM_SIZE); SwFormatFrameSize aSz( rOldSize ); sal_Int32 nRelWidthRelation = m_pRelWidthRelationLB->GetSelectedEntryPos(); @@ -1869,7 +1867,7 @@ void SwFramePage::RangeModifyHdl() if(GetTabDialog()->GetExampleSet() && SfxItemState::DEFAULT <= GetTabDialog()->GetExampleSet()->GetItemState(RES_COL)) { - const SwFormatCol& rCol = static_cast<const SwFormatCol&>(GetTabDialog()->GetExampleSet()->Get(RES_COL)); + const SwFormatCol& rCol = GetTabDialog()->GetExampleSet()->Get(RES_COL); if ( rCol.GetColumns().size() > 1 ) { for (const SwColumn & i : rCol.GetColumns()) @@ -2202,7 +2200,7 @@ void SwFramePage::Init(const SfxItemSet& rSet, bool bReset) } } - const SwFormatFrameSize& rSize = static_cast<const SwFormatFrameSize&>(rSet.Get(RES_FRM_SIZE)); + const SwFormatFrameSize& rSize = rSet.Get(RES_FRM_SIZE); sal_Int64 nWidth = m_aWidthED.NormalizePercent(rSize.GetWidth()); sal_Int64 nHeight = m_aHeightED.NormalizePercent(rSize.GetHeight()); @@ -2258,7 +2256,7 @@ void SwFramePage::Init(const SfxItemSet& rSet, bool bReset) m_pAutoHeightCB->Hide(); // organise circulation-gap for character bound frames - const SvxULSpaceItem &rUL = static_cast<const SvxULSpaceItem &>(rSet.Get(RES_UL_SPACE)); + const SvxULSpaceItem &rUL = rSet.Get(RES_UL_SPACE); m_nUpperBorder = rUL.GetUpper(); m_nLowerBorder = rUL.GetLower(); @@ -2269,7 +2267,7 @@ void SwFramePage::Init(const SfxItemSet& rSet, bool bReset) } // columns - SwFormatCol aCol( static_cast<const SwFormatCol&>(rSet.Get(RES_COL)) ); + SwFormatCol aCol( rSet.Get(RES_COL) ); ::FitToActualSize( aCol, (sal_uInt16)rSize.GetWidth() ); RndStdIds eAnchorId = GetAnchor(); @@ -2278,8 +2276,8 @@ void SwFramePage::Init(const SfxItemSet& rSet, bool bReset) InitPos(eAnchorId, -1, 0, -1, 0, LONG_MAX, LONG_MAX); else { - const SwFormatHoriOrient& rHori = static_cast<const SwFormatHoriOrient&>(rSet.Get(RES_HORI_ORIENT)); - const SwFormatVertOrient& rVert = static_cast<const SwFormatVertOrient&>(rSet.Get(RES_VERT_ORIENT)); + const SwFormatHoriOrient& rHori = rSet.Get(RES_HORI_ORIENT); + const SwFormatVertOrient& rVert = rSet.Get(RES_VERT_ORIENT); m_nOldH = rHori.GetHoriOrient(); m_nOldHRel = rHori.GetRelationOrient(); m_nOldV = rVert.GetVertOrient(); @@ -2311,12 +2309,12 @@ void SwFramePage::Init(const SfxItemSet& rSet, bool bReset) // transparent for example // circulation for example - const SwFormatSurround& rSurround = static_cast<const SwFormatSurround&>(rSet.Get(RES_SURROUND)); + const SwFormatSurround& rSurround = rSet.Get(RES_SURROUND); m_pExampleWN->SetWrap( rSurround.GetSurround() ); if ( rSurround.GetSurround() == css::text::WrapTextMode_THROUGH ) { - const SvxOpaqueItem& rOpaque = static_cast<const SvxOpaqueItem&>(rSet.Get(RES_OPAQUE)); + const SvxOpaqueItem& rOpaque = rSet.Get(RES_OPAQUE); m_pExampleWN->SetTransparent(!rOpaque.GetValue()); } @@ -2462,7 +2460,7 @@ void SwGrfExtPage::Reset(const SfxItemSet *rSet) void SwGrfExtPage::ActivatePage(const SfxItemSet& rSet) { - const SvxProtectItem& rProt = static_cast<const SvxProtectItem& >(rSet.Get(RES_PROTECT)); + const SvxProtectItem& rProt = rSet.Get(RES_PROTECT); bool bProtContent = rProt.IsContentProtected(); const SfxPoolItem* pItem = nullptr; @@ -3105,16 +3103,16 @@ void SwFrameAddPage::Reset(const SfxItemSet *rSet ) } } // Pos Protected - const SvxProtectItem& rProt = static_cast<const SvxProtectItem& >(rSet->Get(RES_PROTECT)); + const SvxProtectItem& rProt = rSet->Get(RES_PROTECT); m_pProtectFrameCB->Check(rProt.IsPosProtected()); m_pProtectContentCB->Check(rProt.IsContentProtected()); m_pProtectSizeCB->Check(rProt.IsSizeProtected()); - const SwFormatEditInReadonly& rEdit = static_cast<const SwFormatEditInReadonly& >(rSet->Get(RES_EDIT_IN_READONLY)); + const SwFormatEditInReadonly& rEdit = rSet->Get(RES_EDIT_IN_READONLY); m_pEditInReadonlyCB->Check(rEdit.GetValue()); m_pEditInReadonlyCB->SaveValue(); // print - const SvxPrintItem& rPrt = static_cast<const SvxPrintItem&>(rSet->Get(RES_PRINT)); + const SvxPrintItem& rPrt = rSet->Get(RES_PRINT); m_pPrintFrameCB->Check(rPrt.GetValue()); m_pPrintFrameCB->SaveValue(); // textflow @@ -3130,7 +3128,7 @@ void SwFrameAddPage::Reset(const SfxItemSet *rSet ) { m_pTextFlowLB->RemoveEntry(m_pTextFlowLB->GetEntryPos(reinterpret_cast<void*>(SvxFrameDirection::Vertical_RL_TB))); } - SvxFrameDirection nVal = static_cast<const SvxFrameDirectionItem&>(rSet->Get(RES_FRAMEDIR)).GetValue(); + SvxFrameDirection nVal = rSet->Get(RES_FRAMEDIR).GetValue(); sal_Int32 nPos; for( nPos = m_pTextFlowLB->GetEntryCount(); nPos; ) if( static_cast<SvxFrameDirection>(reinterpret_cast<sal_IntPtr>(m_pTextFlowLB->GetEntryData( --nPos ))) == nVal ) @@ -3147,7 +3145,7 @@ void SwFrameAddPage::Reset(const SfxItemSet *rSet ) // Content alignment if ( rSet->GetItemState(RES_TEXT_VERT_ADJUST) > SfxItemState::DEFAULT ) { - SdrTextVertAdjust nAdjust = static_cast<const SdrTextVertAdjustItem&>(rSet->Get(RES_TEXT_VERT_ADJUST)).GetValue(); + SdrTextVertAdjust nAdjust = rSet->Get(RES_TEXT_VERT_ADJUST).GetValue(); sal_Int32 nPos = 0; switch(nAdjust) { @@ -3172,7 +3170,7 @@ bool SwFrameAddPage::FillItemSet(SfxItemSet *rSet) bRet |= nullptr != rSet->Put(SfxStringItem(FN_UNO_DESCRIPTION, m_pDescriptionED->GetText())); const SfxPoolItem* pOldItem; - SvxProtectItem aProt ( static_cast<const SvxProtectItem& >(GetItemSet().Get(RES_PROTECT)) ); + SvxProtectItem aProt ( GetItemSet().Get(RES_PROTECT) ); aProt.SetContentProtect( m_pProtectContentCB->IsChecked() ); aProt.SetSizeProtect ( m_pProtectSizeCB->IsChecked() ); aProt.SetPosProtect ( m_pProtectFrameCB->IsChecked() ); diff --git a/sw/source/ui/frmdlg/wrap.cxx b/sw/source/ui/frmdlg/wrap.cxx index 21f07d980816..2447745edc86 100644 --- a/sw/source/ui/frmdlg/wrap.cxx +++ b/sw/source/ui/frmdlg/wrap.cxx @@ -187,10 +187,10 @@ void SwWrapTabPage::Reset(const SfxItemSet *rSet) SetMetric(*m_pTopMarginED, aMetric); SetMetric(*m_pBottomMarginED, aMetric); - const SwFormatSurround& rSurround = static_cast<const SwFormatSurround&>(rSet->Get(RES_SURROUND)); + const SwFormatSurround& rSurround = rSet->Get(RES_SURROUND); css::text::WrapTextMode nSur = rSurround.GetSurround(); ... etc. - the rest is truncated _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits