summaryrefslogtreecommitdiff
path: root/sw/source/uibase
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2017-12-19 15:39:54 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2017-12-24 10:54:05 +0100
commit617a2feff0978d06aa2759038715dfde90d369db (patch)
treee7355f9dfe29c05db574a9961c6132f0c94d61a2 /sw/source/uibase
parent6028b64e27dc45f20aa4a4e0adbef1c03e91a79b (diff)
convert RES_FRM constants to TypedWhichId
Change-Id: I0c71a6fd2e094cebdb720e6c0661cd8a7bb8482c Reviewed-on: https://gerrit.libreoffice.org/46812 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sw/source/uibase')
-rw-r--r--sw/source/uibase/app/appopt.cxx3
-rw-r--r--sw/source/uibase/dochdl/swdtflvr.cxx20
-rw-r--r--sw/source/uibase/docvw/edtwin.cxx12
-rw-r--r--sw/source/uibase/frmdlg/colex.cxx9
-rw-r--r--sw/source/uibase/frmdlg/colmgr.cxx6
-rw-r--r--sw/source/uibase/frmdlg/frmmgr.cxx6
-rw-r--r--sw/source/uibase/inc/frmmgr.hxx14
-rw-r--r--sw/source/uibase/ribbar/drawbase.cxx2
-rw-r--r--sw/source/uibase/shells/basesh.cxx29
-rw-r--r--sw/source/uibase/shells/frmsh.cxx12
-rw-r--r--sw/source/uibase/shells/grfsh.cxx2
-rw-r--r--sw/source/uibase/shells/tabsh.cxx5
-rw-r--r--sw/source/uibase/shells/textsh.cxx2
-rw-r--r--sw/source/uibase/shells/textsh1.cxx2
-rw-r--r--sw/source/uibase/shells/txtattr.cxx4
-rw-r--r--sw/source/uibase/uiview/viewtab.cxx28
-rw-r--r--sw/source/uibase/wrtsh/delete.cxx2
17 files changed, 76 insertions, 82 deletions
diff --git a/sw/source/uibase/app/appopt.cxx b/sw/source/uibase/app/appopt.cxx
index 946e5f6a2aab..6be4c2407e13 100644
--- a/sw/source/uibase/app/appopt.cxx
+++ b/sw/source/uibase/app/appopt.cxx
@@ -342,8 +342,7 @@ void SwModule::ApplyItemSet( sal_uInt16 nId, const SfxItemSet& rSet )
// Background only in WebDialog
if(SfxItemState::SET == rSet.GetItemState(RES_BACKGROUND))
{
- const SvxBrushItem& rBrushItem = static_cast<const SvxBrushItem&>(rSet.Get(
- RES_BACKGROUND));
+ const SvxBrushItem& rBrushItem = rSet.Get(RES_BACKGROUND);
aViewOpt.SetRetoucheColor( rBrushItem.GetColor() );
}
diff --git a/sw/source/uibase/dochdl/swdtflvr.cxx b/sw/source/uibase/dochdl/swdtflvr.cxx
index 5154491973a6..d08e740121b1 100644
--- a/sw/source/uibase/dochdl/swdtflvr.cxx
+++ b/sw/source/uibase/dochdl/swdtflvr.cxx
@@ -465,7 +465,7 @@ bool SwTransferable::GetData( const DataFlavor& rFlavor, const OUString& rDestDo
{
SfxItemSet aSet( m_pWrtShell->GetAttrPool(), svl::Items<RES_URL, RES_URL>{} );
m_pWrtShell->GetFlyFrameAttr( aSet );
- const SwFormatURL& rURL = static_cast<const SwFormatURL&>(aSet.Get( RES_URL ));
+ const SwFormatURL& rURL = aSet.Get( RES_URL );
if( rURL.GetMap() )
m_pImageMap.reset(new ImageMap( *rURL.GetMap() ));
else if( !rURL.GetURL().isEmpty() )
@@ -986,7 +986,7 @@ int SwTransferable::PrepareForCopy( bool bIsCut )
{
SfxItemSet aSet( m_pWrtShell->GetAttrPool(), svl::Items<RES_URL, RES_URL>{} );
m_pWrtShell->GetFlyFrameAttr( aSet );
- const SwFormatURL& rURL = static_cast<const SwFormatURL&>(aSet.Get( RES_URL ));
+ const SwFormatURL& rURL = aSet.Get( RES_URL );
if( rURL.GetMap() )
{
m_pImageMap.reset( new ImageMap( *rURL.GetMap() ) );
@@ -1991,7 +1991,7 @@ bool SwTransferable::PasteTargetURL( TransferableDataHelper& rData,
{
SfxItemSet aSet( rSh.GetAttrPool(), svl::Items<RES_URL, RES_URL>{} );
rSh.GetFlyFrameAttr( aSet );
- SwFormatURL aURL( static_cast<const SwFormatURL&>(aSet.Get( RES_URL )) );
+ SwFormatURL aURL( aSet.Get( RES_URL ) );
if( aURL.GetURL() != aINetImg.GetTargetURL() ||
aURL.GetTargetFrameName() != aINetImg.GetTargetFrame() )
@@ -2381,7 +2381,7 @@ bool SwTransferable::PasteGrf( TransferableDataHelper& rData, SwWrtShell& rSh,
{
SfxItemSet aSet( rSh.GetAttrPool(), svl::Items<RES_URL, RES_URL>{} );
rSh.GetFlyFrameAttr( aSet );
- SwFormatURL aURL( static_cast<const SwFormatURL&>(aSet.Get( RES_URL )) );
+ SwFormatURL aURL( aSet.Get( RES_URL ) );
aURL.SetURL( aBkmk.GetURL(), false );
aSet.Put( aURL );
rSh.SetFlyFrameAttr( aSet );
@@ -2437,7 +2437,7 @@ bool SwTransferable::PasteGrf( TransferableDataHelper& rData, SwWrtShell& rSh,
{
SfxItemSet aSet( rSh.GetAttrPool(), svl::Items<RES_URL, RES_URL>{} );
rSh.GetFlyFrameAttr( aSet );
- SwFormatURL aURL( static_cast<const SwFormatURL&>(aSet.Get( RES_URL )) );
+ SwFormatURL aURL( aSet.Get( RES_URL ) );
aURL.SetMap( &aMap );
aSet.Put( aURL );
rSh.SetFlyFrameAttr( aSet );
@@ -2456,7 +2456,7 @@ bool SwTransferable::PasteImageMap( TransferableDataHelper& rData,
{
SfxItemSet aSet( rSh.GetAttrPool(), svl::Items<RES_URL, RES_URL>{} );
rSh.GetFlyFrameAttr( aSet );
- SwFormatURL aURL( static_cast<const SwFormatURL&>(aSet.Get( RES_URL )) );
+ SwFormatURL aURL( aSet.Get( RES_URL ) );
const ImageMap* pOld = aURL.GetMap();
// set or replace, that is the question
@@ -2497,7 +2497,7 @@ bool SwTransferable::PasteAsHyperlink( TransferableDataHelper& rData,
{
SfxItemSet aSet( rSh.GetAttrPool(), svl::Items<RES_URL, RES_URL>{} );
rSh.GetFlyFrameAttr( aSet );
- SwFormatURL aURL2( static_cast<const SwFormatURL&>(aSet.Get( RES_URL )) );
+ SwFormatURL aURL2( aSet.Get( RES_URL ) );
aURL2.SetURL( sFile, false );
if( aURL2.GetName().isEmpty() )
aURL2.SetName( sFile );
@@ -2591,7 +2591,7 @@ bool SwTransferable::PasteFileName( TransferableDataHelper& rData,
{
SfxItemSet aSet( rSh.GetAttrPool(), svl::Items<RES_URL, RES_URL>{} );
rSh.GetFlyFrameAttr( aSet );
- SwFormatURL aURL2( static_cast<const SwFormatURL&>(aSet.Get( RES_URL )) );
+ SwFormatURL aURL2( aSet.Get( RES_URL ) );
aURL2.SetURL( sFile, false );
if( aURL2.GetName().isEmpty() )
aURL2.SetName( sFile );
@@ -3122,7 +3122,7 @@ void SwTransferable::SetDataForDragAndDrop( const Point& rSttPos )
{
SfxItemSet aSet( m_pWrtShell->GetAttrPool(), svl::Items<RES_URL, RES_URL>{} );
m_pWrtShell->GetFlyFrameAttr( aSet );
- const SwFormatURL& rURL = static_cast<const SwFormatURL&>(aSet.Get( RES_URL ));
+ const SwFormatURL& rURL = aSet.Get( RES_URL );
if( rURL.GetMap() )
{
m_pImageMap.reset( new ImageMap( *rURL.GetMap() ) );
@@ -3332,7 +3332,7 @@ bool SwTransferable::PrivateDrop( SwWrtShell& rSh, const Point& rDragPt,
{
SfxItemSet aSet( rSh.GetAttrPool(), svl::Items<RES_URL, RES_URL>{} );
rSh.GetFlyFrameAttr( aSet );
- SwFormatURL aURL( static_cast<const SwFormatURL&>(aSet.Get( RES_URL )) );
+ SwFormatURL aURL( aSet.Get( RES_URL ) );
aURL.SetURL( aTmp.GetURL(), false );
aSet.Put( aURL );
rSh.SetFlyFrameAttr( aSet );
diff --git a/sw/source/uibase/docvw/edtwin.cxx b/sw/source/uibase/docvw/edtwin.cxx
index edb94d575e5d..748c4b2136fe 100644
--- a/sw/source/uibase/docvw/edtwin.cxx
+++ b/sw/source/uibase/docvw/edtwin.cxx
@@ -1019,7 +1019,7 @@ void SwEditWin::ChangeFly( sal_uInt8 nDir, bool bWeb )
RES_COL, RES_COL,
RES_FOLLOW_TEXT_FLOW, RES_FOLLOW_TEXT_FLOW>{});
rSh.GetFlyFrameAttr( aSet );
- RndStdIds eAnchorId = static_cast<const SwFormatAnchor&>(aSet.Get(RES_ANCHOR)).GetAnchorId();
+ RndStdIds eAnchorId = aSet.Get(RES_ANCHOR).GetAnchorId();
Size aSnap;
bool bHuge(MOVE_LEFT_HUGE == nDir ||
MOVE_UP_HUGE == nDir ||
@@ -1055,10 +1055,10 @@ void SwEditWin::ChangeFly( sal_uInt8 nDir, bool bWeb )
// adjustment for allowing vertical position
// aligned to page for fly frame anchored to paragraph or to character.
{
- SwFormatVertOrient aVert( static_cast<const SwFormatVertOrient&>(aSet.Get(RES_VERT_ORIENT)) );
+ SwFormatVertOrient aVert( aSet.Get(RES_VERT_ORIENT) );
const bool bFollowTextFlow =
- static_cast<const SwFormatFollowTextFlow&>(aSet.Get(RES_FOLLOW_TEXT_FLOW)).GetValue();
- const SwPosition* pToCharContentPos = static_cast<const SwFormatAnchor&>(aSet.Get(RES_ANCHOR)).GetContentAnchor();
+ aSet.Get(RES_FOLLOW_TEXT_FLOW).GetValue();
+ const SwPosition* pToCharContentPos = aSet.Get(RES_ANCHOR).GetContentAnchor();
rSh.CalcBoundRect( aBoundRect, eAnchorId,
text::RelOrientation::FRAME, aVert.GetRelationOrient(),
pToCharContentPos, bFollowTextFlow,
@@ -1109,7 +1109,7 @@ void SwEditWin::ChangeFly( sal_uInt8 nDir, bool bWeb )
aDiff = 0;
else if ( aDiff < -aTmp.Height() )
aDiff = -aTmp.Height();
- SwFormatVertOrient aVert( static_cast<const SwFormatVertOrient&>(aSet.Get(RES_VERT_ORIENT)) );
+ SwFormatVertOrient aVert( aSet.Get(RES_VERT_ORIENT) );
sal_Int16 eNew;
if( bWeb )
{
@@ -1150,7 +1150,7 @@ void SwEditWin::ChangeFly( sal_uInt8 nDir, bool bWeb )
if (bWeb && (RndStdIds::FLY_AT_PARA == eAnchorId)
&& ( nDir==MOVE_LEFT_SMALL || nDir==MOVE_RIGHT_BIG ))
{
- SwFormatHoriOrient aHori( static_cast<const SwFormatHoriOrient&>(aSet.Get(RES_HORI_ORIENT)) );
+ SwFormatHoriOrient aHori( aSet.Get(RES_HORI_ORIENT) );
sal_Int16 eNew;
eNew = aHori.GetHoriOrient();
switch( eNew )
diff --git a/sw/source/uibase/frmdlg/colex.cxx b/sw/source/uibase/frmdlg/colex.cxx
index c7c481f35c3d..cd71648e72fc 100644
--- a/sw/source/uibase/frmdlg/colex.cxx
+++ b/sw/source/uibase/frmdlg/colex.cxx
@@ -44,8 +44,7 @@ void SwPageExample::UpdateExample( const SfxItemSet& rSet )
{
if (SfxItemState::DEFAULT <= rSet.GetItemState(RES_FRAMEDIR))
{
- const SvxFrameDirectionItem& rDirItem =
- static_cast<const SvxFrameDirectionItem&>(rSet.Get(RES_FRAMEDIR));
+ const SvxFrameDirectionItem& rDirItem = rSet.Get(RES_FRAMEDIR);
m_bVertical = rDirItem.GetValue() == SvxFrameDirection::Vertical_RL_TB||
rDirItem.GetValue() == SvxFrameDirection::Vertical_LR_TB;
}
@@ -128,7 +127,7 @@ void SwPageExample::UpdateExample( const SfxItemSet& rSet )
if(SfxItemState::SET == rHeaderSet.GetItemState(RES_BACKGROUND))
{
// create FillAttributes from SvxBrushItem //SetHdColor(rItem.GetColor());
- const SvxBrushItem& rItem = static_cast< const SvxBrushItem& >(rHeaderSet.Get(RES_BACKGROUND));
+ const SvxBrushItem& rItem = rHeaderSet.Get(RES_BACKGROUND);
SfxItemSet aTempSet(*rHeaderSet.GetPool(), svl::Items<XATTR_FILL_FIRST, XATTR_FILL_LAST>{});
setSvxBrushItemAsFillAttributesToTargetSet(rItem, aTempSet);
@@ -166,7 +165,7 @@ void SwPageExample::UpdateExample( const SfxItemSet& rSet )
if( rFooterSet.GetItemState( RES_BACKGROUND ) == SfxItemState::SET )
{
// create FillAttributes from SvxBrushItem //SetFtColor(rItem.GetColor());
- const SvxBrushItem& rItem = static_cast< const SvxBrushItem& >(rFooterSet.Get(RES_BACKGROUND));
+ const SvxBrushItem& rItem = rFooterSet.Get(RES_BACKGROUND);
SfxItemSet aTempSet(*rFooterSet.GetPool(), svl::Items<XATTR_FILL_FIRST, XATTR_FILL_LAST>{});
setSvxBrushItemAsFillAttributesToTargetSet(rItem, aTempSet);
@@ -612,7 +611,7 @@ void SwPageGridExample::UpdateExample( const SfxItemSet& rSet )
DELETEZ(pGridItem);
//get the grid information
if(SfxItemState::DEFAULT <= rSet.GetItemState(RES_TEXTGRID))
- pGridItem = static_cast<SwTextGridItem*>(static_cast<const SwTextGridItem&>(rSet.Get(RES_TEXTGRID)).Clone());
+ pGridItem = static_cast<SwTextGridItem*>(rSet.Get(RES_TEXTGRID).Clone());
SwPageExample::UpdateExample(rSet);
}
diff --git a/sw/source/uibase/frmdlg/colmgr.cxx b/sw/source/uibase/frmdlg/colmgr.cxx
index 5231eb6ef6b6..ade307c7c29c 100644
--- a/sw/source/uibase/frmdlg/colmgr.cxx
+++ b/sw/source/uibase/frmdlg/colmgr.cxx
@@ -110,12 +110,12 @@ void SwColMgr::SetActualWidth(sal_uInt16 nW)
// ctor
SwColMgr::SwColMgr(const SfxItemSet& rSet) :
- aFormatCol(static_cast<const SwFormatCol&>(rSet.Get(RES_COL)))
+ aFormatCol(rSet.Get(RES_COL))
{
- nWidth = (sal_uInt16)static_cast<const SwFormatFrameSize&>(rSet.Get(RES_FRM_SIZE)).GetWidth();
+ nWidth = (sal_uInt16)rSet.Get(RES_FRM_SIZE).GetWidth();
if (nWidth < MINLAY)
nWidth = USHRT_MAX;
- const SvxLRSpaceItem &rLR = static_cast<const SvxLRSpaceItem&>(rSet.Get(RES_LR_SPACE));
+ const SvxLRSpaceItem &rLR = rSet.Get(RES_LR_SPACE);
nWidth = nWidth - (sal_uInt16)rLR.GetLeft();
nWidth = nWidth - (sal_uInt16)rLR.GetRight();
::FitToActualSize(aFormatCol, nWidth);
diff --git a/sw/source/uibase/frmdlg/frmmgr.cxx b/sw/source/uibase/frmdlg/frmmgr.cxx
index 2bf04a3cce44..2a7bce931465 100644
--- a/sw/source/uibase/frmdlg/frmmgr.cxx
+++ b/sw/source/uibase/frmdlg/frmmgr.cxx
@@ -254,7 +254,7 @@ void SwFlyFrameAttrMgr::ValidateMetrics( SvxSwFrameValidation& rVal,
// OD 18.09.2003 #i18732# - adjustment for allowing vertical position
// aligned to page for fly frame anchored to paragraph or to character.
const RndStdIds eAnchorType = rVal.nAnchorType;
- const SwFormatFrameSize& rSize = static_cast<const SwFormatFrameSize&>(m_aSet.Get(RES_FRM_SIZE));
+ const SwFormatFrameSize& rSize = m_aSet.Get(RES_FRM_SIZE);
m_pOwnSh->CalcBoundRect( aBoundRect, eAnchorType,
rVal.nHRelOrient,
rVal.nVRelOrient,
@@ -518,7 +518,7 @@ void SwFlyFrameAttrMgr::SetLRSpace( long nLeft, long nRight )
{
OSL_ENSURE( LONG_MAX != nLeft && LONG_MAX != nRight, "Which border to set?" );
- SvxLRSpaceItem aTmp( static_cast<const SvxLRSpaceItem&>(m_aSet.Get( RES_LR_SPACE )) );
+ SvxLRSpaceItem aTmp( m_aSet.Get( RES_LR_SPACE ) );
if( LONG_MAX != nLeft )
aTmp.SetLeft( sal_uInt16(nLeft) );
if( LONG_MAX != nRight )
@@ -530,7 +530,7 @@ void SwFlyFrameAttrMgr::SetULSpace( long nTop, long nBottom )
{
OSL_ENSURE(LONG_MAX != nTop && LONG_MAX != nBottom, "Which border to set?" );
- SvxULSpaceItem aTmp( static_cast<const SvxULSpaceItem&>(m_aSet.Get( RES_UL_SPACE )) );
+ SvxULSpaceItem aTmp( m_aSet.Get( RES_UL_SPACE ) );
if( LONG_MAX != nTop )
aTmp.SetUpper( sal_uInt16(nTop) );
if( LONG_MAX != nBottom )
diff --git a/sw/source/uibase/inc/frmmgr.hxx b/sw/source/uibase/inc/frmmgr.hxx
index e0f939ff2223..1bc51b9f1801 100644
--- a/sw/source/uibase/inc/frmmgr.hxx
+++ b/sw/source/uibase/inc/frmmgr.hxx
@@ -137,28 +137,28 @@ public:
inline const Size& SwFlyFrameAttrMgr::GetSize() const
{
- return static_cast<const SwFormatFrameSize&>(m_aSet.Get(RES_FRM_SIZE)).GetSize();
+ return m_aSet.Get(RES_FRM_SIZE).GetSize();
}
inline const SwFormatVertOrient &SwFlyFrameAttrMgr::GetVertOrient() const
{
- return static_cast<const SwFormatVertOrient&>(m_aSet.Get(RES_VERT_ORIENT));
+ return m_aSet.Get(RES_VERT_ORIENT);
}
inline const SwFormatHoriOrient &SwFlyFrameAttrMgr::GetHoriOrient() const
{
- return static_cast<const SwFormatHoriOrient &>(m_aSet.Get(RES_HORI_ORIENT));
+ return m_aSet.Get(RES_HORI_ORIENT);
}
inline const SwFormatFrameSize& SwFlyFrameAttrMgr::GetFrameSize() const
{
- return static_cast<const SwFormatFrameSize&>(m_aSet.Get(RES_FRM_SIZE));
+ return m_aSet.Get(RES_FRM_SIZE);
}
inline const SvxShadowItem &SwFlyFrameAttrMgr::GetShadow() const
{
- return static_cast<const SvxShadowItem&>(m_aSet.Get(RES_SHADOW));
+ return m_aSet.Get(RES_SHADOW);
}
inline const SvxBoxItem &SwFlyFrameAttrMgr::GetBox() const
{
- return static_cast<const SvxBoxItem&>(m_aSet.Get(RES_BOX));
+ return m_aSet.Get(RES_BOX);
}
inline Point SwFlyFrameAttrMgr::GetPos() const
{
@@ -166,7 +166,7 @@ inline Point SwFlyFrameAttrMgr::GetPos() const
}
inline RndStdIds SwFlyFrameAttrMgr::GetAnchor() const
{
- return static_cast<const SwFormatAnchor&>(m_aSet.Get(RES_ANCHOR)).GetAnchorId();
+ return m_aSet.Get(RES_ANCHOR).GetAnchorId();
}
#endif
diff --git a/sw/source/uibase/ribbar/drawbase.cxx b/sw/source/uibase/ribbar/drawbase.cxx
index a32ee16bb905..7bfea2cb6b9d 100644
--- a/sw/source/uibase/ribbar/drawbase.cxx
+++ b/sw/source/uibase/ribbar/drawbase.cxx
@@ -286,7 +286,7 @@ bool SwDrawBase::MouseButtonUp(const MouseEvent& rMEvt)
if(m_pWin->GetFrameColCount() > 1)
{
SfxItemSet aSet(m_pView->GetPool(),svl::Items<RES_COL,RES_COL>{});
- SwFormatCol aCol(static_cast<const SwFormatCol&>(aSet.Get(RES_COL)));
+ SwFormatCol aCol(aSet.Get(RES_COL));
aCol.Init(m_pWin->GetFrameColCount(), aCol.GetGutterWidth(), aCol.GetWishWidth());
aSet.Put(aCol);
// Template AutoUpdate
diff --git a/sw/source/uibase/shells/basesh.cxx b/sw/source/uibase/shells/basesh.cxx
index 7428455dfb7b..df7f9072fce7 100644
--- a/sw/source/uibase/shells/basesh.cxx
+++ b/sw/source/uibase/shells/basesh.cxx
@@ -173,7 +173,7 @@ static void lcl_UpdateIMapDlg( SwWrtShell& rSh )
SfxItemSet aSet( rSh.GetAttrPool(), svl::Items<RES_URL, RES_URL>{} );
rSh.GetFlyFrameAttr( aSet );
- const SwFormatURL &rURL = static_cast<const SwFormatURL&>(aSet.Get( RES_URL ));
+ const SwFormatURL &rURL = aSet.Get( RES_URL );
SvxIMapDlgChildWindow::UpdateIMapDlg(
aGrf, rURL.GetMap(), pList.get(), pEditObj );
}
@@ -996,7 +996,7 @@ void SwBaseShell::Execute(SfxRequest &rReq)
{
SfxItemSet aSet( rSh.GetAttrPool(), svl::Items<RES_URL, RES_URL>{} );
rSh.GetFlyFrameAttr( aSet );
- SwFormatURL aURL( static_cast<const SwFormatURL&>(aSet.Get( RES_URL )) );
+ SwFormatURL aURL( aSet.Get( RES_URL ) );
aURL.SetMap( &pDlg->GetImageMap() );
aSet.Put( aURL );
rSh.SetFlyFrameAttr( aSet );
@@ -1031,7 +1031,7 @@ void SwBaseShell::Execute(SfxRequest &rReq)
rSh.StartAction();
SfxItemSet aSet( rSh.GetAttrPool(), svl::Items<RES_SURROUND, RES_SURROUND>{});
rSh.GetFlyFrameAttr( aSet );
- SwFormatSurround aSur( static_cast<const SwFormatSurround&>(aSet.Get( RES_SURROUND )) );
+ SwFormatSurround aSur( aSet.Get( RES_SURROUND ) );
if ( !aSur.IsContour() )
{
aSur.SetContour( true );
@@ -1094,9 +1094,9 @@ void SwBaseShell::Execute(SfxRequest &rReq)
SfxItemSet aSet(GetPool(), svl::Items<RES_SURROUND, RES_HORI_ORIENT>{});
rSh.GetFlyFrameAttr(aSet);
- const SwFormatSurround& rSurround = static_cast<const SwFormatSurround&>(aSet.Get(RES_SURROUND));
- const SwFormatVertOrient& rVert = static_cast<const SwFormatVertOrient&>(aSet.Get(RES_VERT_ORIENT));
- const SwFormatHoriOrient& rHori = static_cast<const SwFormatHoriOrient&>(aSet.Get(RES_HORI_ORIENT));
+ const SwFormatSurround& rSurround = aSet.Get(RES_SURROUND);
+ const SwFormatVertOrient& rVert = aSet.Get(RES_VERT_ORIENT);
+ const SwFormatHoriOrient& rHori = aSet.Get(RES_HORI_ORIENT);
sal_Int16 eVOrient = rVert.GetVertOrient();
sal_Int16 eHOrient = rHori.GetHoriOrient();
css::text::WrapTextMode eSurround = rSurround.GetSurround();
@@ -1340,7 +1340,7 @@ IMPL_LINK_NOARG(SwBaseShell, GraphicArrivedHdl, SwCursorShell&, void)
{
SfxItemSet aSet(GetPool(), svl::Items<RES_SURROUND, RES_SURROUND>{});
rSh.GetFlyFrameAttr(aSet);
- const SwFormatSurround& rWrap = static_cast<const SwFormatSurround&>(aSet.Get(RES_SURROUND));
+ const SwFormatSurround& rWrap = aSet.Get(RES_SURROUND);
bSetState = true;
bState = rWrap.IsContour();
}
@@ -1634,7 +1634,7 @@ void SwBaseShell::GetState( SfxItemSet &rSet )
rSh.GetObjAttr(aSet);
else
rSh.GetFlyFrameAttr(aSet);
- RndStdIds eSet = static_cast<const SwFormatAnchor&>(aSet.Get(RES_ANCHOR)).GetAnchorId();
+ RndStdIds eSet = aSet.Get(RES_ANCHOR).GetAnchorId();
const bool bSet =
((nWhich == FN_TOOL_ANCHOR_PAGE) &&
(eSet == RndStdIds::FLY_AT_PAGE))
@@ -1682,11 +1682,11 @@ void SwBaseShell::GetState( SfxItemSet &rSet )
else
{
rSh.GetFlyFrameAttr(aSet);
- nAnchorType = static_cast<const SwFormatAnchor&>(aSet.Get(RES_ANCHOR)).GetAnchorId();
+ nAnchorType = aSet.Get(RES_ANCHOR).GetAnchorId();
}
- const SwFormatSurround& rWrap = static_cast<const SwFormatSurround&>(aSet.Get(RES_SURROUND));
+ const SwFormatSurround& rWrap = aSet.Get(RES_SURROUND);
- const SvxOpaqueItem& rOpaque = static_cast<const SvxOpaqueItem&>(aSet.Get(RES_OPAQUE));
+ const SvxOpaqueItem& rOpaque = aSet.Get(RES_OPAQUE);
bool bOpaque = rOpaque.GetValue();
css::text::WrapTextMode nSurround = rWrap.GetSurround();
bool bSet = false;
@@ -1853,7 +1853,7 @@ void SwBaseShell::SetWrapMode( sal_uInt16 nSlot )
rSh.GetObjAttr(aSet);
else
rSh.GetFlyFrameAttr(aSet);
- SwFormatSurround aWrap( static_cast<const SwFormatSurround&>(aSet.Get(RES_SURROUND)) );
+ SwFormatSurround aWrap( aSet.Get(RES_SURROUND) );
css::text::WrapTextMode nOldSurround(aWrap.GetSurround());
css::text::WrapTextMode nSurround = css::text::WrapTextMode_PARALLEL;
@@ -1922,7 +1922,7 @@ void SwBaseShell::SetWrapMode( sal_uInt16 nSlot )
bOpaque = !rSh.GetLayerId();
else
{
- const SvxOpaqueItem aOpaque( static_cast<const SvxOpaqueItem&>(aSet.Get(RES_OPAQUE)) );
+ const SvxOpaqueItem aOpaque( aSet.Get(RES_OPAQUE) );
bOpaque = !aOpaque.GetValue();
}
}
@@ -2541,8 +2541,7 @@ void SwBaseShell::ExecDlg(SfxRequest &rReq)
if ( pDlg->Execute() == RET_OK )
{
- rSh.SetBoxBackground( static_cast<const SvxBrushItem&>(
- pDlg->GetOutputItemSet()->Get( RES_BACKGROUND )));
+ rSh.SetBoxBackground( pDlg->GetOutputItemSet()->Get( RES_BACKGROUND ) );
pOutSet = pDlg->GetOutputItemSet();
}
}
diff --git a/sw/source/uibase/shells/frmsh.cxx b/sw/source/uibase/shells/frmsh.cxx
index cfb535a0dfa9..790c291aa5d9 100644
--- a/sw/source/uibase/shells/frmsh.cxx
+++ b/sw/source/uibase/shells/frmsh.cxx
@@ -168,7 +168,7 @@ void SwFrameShell::Execute(SfxRequest &rReq)
SfxItemSet aSet(GetPool(),svl::Items<RES_COL,RES_COL>{});
rSh.GetFlyFrameAttr( aSet );
- SwFormatCol aCol(static_cast<const SwFormatCol&>(aSet.Get(RES_COL)));
+ SwFormatCol aCol(aSet.Get(RES_COL));
// GutterWidth will not always passed, hence get firstly
// (see view2: Execute on this slot)
sal_uInt16 nGutterWidth = aCol.GetGutterWidth();
@@ -203,7 +203,7 @@ void SwFrameShell::Execute(SfxRequest &rReq)
SfxItemSet aSet( rSh.GetAttrPool(), svl::Items<RES_URL, RES_URL>{} );
rSh.GetFlyFrameAttr( aSet );
- SwFormatURL aURL( static_cast<const SwFormatURL&>(aSet.Get( RES_URL )) );
+ SwFormatURL aURL( aSet.Get( RES_URL ) );
OUString sOldName(rHLinkItem.GetName().toAsciiUpperCase());
OUString sFlyName(rSh.GetFlyName().toAsciiUpperCase());
@@ -457,7 +457,7 @@ void SwFrameShell::Execute(SfxRequest &rReq)
aSet.SetParent( aMgr.GetAttrSet().GetParent() );
// On % values initialize size
- SwFormatFrameSize& rSize = const_cast<SwFormatFrameSize&>(static_cast<const SwFormatFrameSize&>(aSet.Get(RES_FRM_SIZE)));
+ SwFormatFrameSize& rSize = const_cast<SwFormatFrameSize&>(aSet.Get(RES_FRM_SIZE));
if (rSize.GetWidthPercent() && rSize.GetWidthPercent() != SwFormatFrameSize::SYNCED)
rSize.SetWidth(rSh.GetAnyCurRect(CurRectType::FlyEmbedded).Width());
if (rSize.GetHeightPercent() && rSize.GetHeightPercent() != SwFormatFrameSize::SYNCED)
@@ -999,13 +999,13 @@ void SwFrameShell::ExecFrameStyle(SfxRequest const & rReq)
// At first pick the default BoxItem out of the pool.
// If unequal to regular box item, then it has already
// been changed (New one is no default).
- const SvxBoxItem* pPoolBoxItem = static_cast<const SvxBoxItem*>(::GetDfltAttr(RES_BOX));
+ const SvxBoxItem* pPoolBoxItem = ::GetDfltAttr(RES_BOX);
const SfxItemSet *pArgs = rReq.GetArgs();
SfxItemSet aFrameSet(rSh.GetAttrPool(), svl::Items<RES_BOX, RES_BOX>{});
rSh.GetFlyFrameAttr( aFrameSet );
- const SvxBoxItem& rBoxItem = static_cast<const SvxBoxItem&>(aFrameSet.Get(RES_BOX));
+ const SvxBoxItem& rBoxItem = aFrameSet.Get(RES_BOX);
if (pPoolBoxItem == &rBoxItem)
bDefault = true;
@@ -1198,7 +1198,7 @@ void SwFrameShell::GetLineStyleState(SfxItemSet &rSet)
rSh.GetFlyFrameAttr(aFrameSet);
- const SvxBorderLine* pLine = static_cast<const SvxBoxItem&>(aFrameSet.Get(RES_BOX)).GetTop();
+ const SvxBorderLine* pLine = aFrameSet.Get(RES_BOX).GetTop();
rSet.Put(SvxColorItem(pLine ? pLine->GetColor() : Color(), SID_FRAME_LINECOLOR));
}
}
diff --git a/sw/source/uibase/shells/grfsh.cxx b/sw/source/uibase/shells/grfsh.cxx
index bda2b2b395ff..a8d2850bccbd 100644
--- a/sw/source/uibase/shells/grfsh.cxx
+++ b/sw/source/uibase/shells/grfsh.cxx
@@ -336,7 +336,7 @@ void SwGrfShell::Execute(SfxRequest &rReq)
aSet.SetParent( aMgr.GetAttrSet().GetParent() );
// At percentage values initialize size
- SwFormatFrameSize aSizeCopy = static_cast<const SwFormatFrameSize&>(aSet.Get(RES_FRM_SIZE));
+ SwFormatFrameSize aSizeCopy = aSet.Get(RES_FRM_SIZE);
if (aSizeCopy.GetWidthPercent() && aSizeCopy.GetWidthPercent() != SwFormatFrameSize::SYNCED)
aSizeCopy.SetWidth(rSh.GetAnyCurRect(CurRectType::FlyEmbedded).Width());
if (aSizeCopy.GetHeightPercent() && aSizeCopy.GetHeightPercent() != SwFormatFrameSize::SYNCED)
diff --git a/sw/source/uibase/shells/tabsh.cxx b/sw/source/uibase/shells/tabsh.cxx
index 818a1074ba73..330d72a10269 100644
--- a/sw/source/uibase/shells/tabsh.cxx
+++ b/sw/source/uibase/shells/tabsh.cxx
@@ -477,8 +477,7 @@ void SwTableShell::Execute(SfxRequest &rReq)
SvxBoxInfoItem aCoreInfo( SID_ATTR_BORDER_INNER );
aCoreSet.Put(aCoreInfo);
rSh.GetTabBorders( aCoreSet );
- const SvxBoxItem& rCoreBox = static_cast<const SvxBoxItem&>(
- aCoreSet.Get(RES_BOX));
+ const SvxBoxItem& rCoreBox = aCoreSet.Get(RES_BOX);
const SfxPoolItem *pBoxItem = nullptr;
if ( pArgs->GetItemState(RES_BOX, true, &pBoxItem) == SfxItemState::SET )
{
@@ -1446,7 +1445,7 @@ void SwTableShell::GetLineStyleState(SfxItemSet &rSet)
aCoreSet.Put(aCoreInfo);
GetShell().GetTabBorders( aCoreSet );
- const SvxBoxItem& rBoxItem = static_cast<const SvxBoxItem&>(aCoreSet.Get( RES_BOX ));
+ const SvxBoxItem& rBoxItem = aCoreSet.Get( RES_BOX );
const SvxBorderLine* pLine = rBoxItem.GetTop();
rSet.Put( SvxColorItem( pLine ? pLine->GetColor() : Color(), SID_FRAME_LINECOLOR ) );
diff --git a/sw/source/uibase/shells/textsh.cxx b/sw/source/uibase/shells/textsh.cxx
index 98f453e299ab..5f12d98a3a5d 100644
--- a/sw/source/uibase/shells/textsh.cxx
+++ b/sw/source/uibase/shells/textsh.cxx
@@ -867,7 +867,7 @@ SfxItemSet SwTextShell::CreateInsertFrameItemSet(SwFlyFrameAttrMgr& rMgr)
// Delete minimum size in columns.
SvxBoxInfoItem aBoxInfo(aSet.Get(SID_ATTR_BORDER_INNER));
- const SvxBoxItem& rBox = static_cast<const SvxBoxItem&>(aSet.Get(RES_BOX));
+ const SvxBoxItem& rBox = aSet.Get(RES_BOX);
aBoxInfo.SetMinDist(false);
aBoxInfo.SetDefDist(rBox.GetDistance(SvxBoxItemLine::LEFT));
aSet.Put(aBoxInfo);
diff --git a/sw/source/uibase/shells/textsh1.cxx b/sw/source/uibase/shells/textsh1.cxx
index 191dc8683f05..7303d53b3566 100644
--- a/sw/source/uibase/shells/textsh1.cxx
+++ b/sw/source/uibase/shells/textsh1.cxx
@@ -959,7 +959,7 @@ void SwTextShell::Execute(SfxRequest &rReq)
// Left border as offset
//#i24363# tab stops relative to indent
const long nOff = rWrtSh.getIDocumentSettingAccess().get(DocumentSettingId::TABS_RELATIVE_TO_INDENT) ?
- static_cast<const SvxLRSpaceItem&>(aCoreSet.Get( RES_LR_SPACE )).GetTextLeft() : 0;
+ aCoreSet.Get( RES_LR_SPACE ).GetTextLeft() : 0;
SfxInt32Item aOff( SID_ATTR_TABSTOP_OFFSET, nOff );
aCoreSet.Put( aOff );
diff --git a/sw/source/uibase/shells/txtattr.cxx b/sw/source/uibase/shells/txtattr.cxx
index 101d0d3a1122..765d116811a5 100644
--- a/sw/source/uibase/shells/txtattr.cxx
+++ b/sw/source/uibase/shells/txtattr.cxx
@@ -720,7 +720,7 @@ void SwTextShell::GetAttrState(SfxItemSet &rSet)
eState = aCoreSet.GetItemState(RES_LR_SPACE);
if( eState >= SfxItemState::DEFAULT )
{
- SvxLRSpaceItem aLR = static_cast<const SvxLRSpaceItem&>( aCoreSet.Get( RES_LR_SPACE ) );
+ SvxLRSpaceItem aLR = aCoreSet.Get( RES_LR_SPACE );
aLR.SetWhich(nSlot);
rSet.Put(aLR);
}
@@ -746,7 +746,7 @@ void SwTextShell::GetAttrState(SfxItemSet &rSet)
aCoreSet.GetItemState( RES_FRAMEDIR, false ) >= SfxItemState::DEFAULT)
{
SvxFrameDirection eFrameDir =
- static_cast<const SvxFrameDirectionItem& >(aCoreSet.Get(RES_FRAMEDIR)).GetValue();
+ aCoreSet.Get(RES_FRAMEDIR).GetValue();
if (SvxFrameDirection::Environment == eFrameDir)
{
eFrameDir = rSh.IsInRightToLeftText() ?
diff --git a/sw/source/uibase/uiview/viewtab.cxx b/sw/source/uibase/uiview/viewtab.cxx
index 06ed70fa4def..c4e79e9e4199 100644
--- a/sw/source/uibase/uiview/viewtab.cxx
+++ b/sw/source/uibase/uiview/viewtab.cxx
@@ -629,7 +629,7 @@ void SwView::ExecTabWin( SfxRequest const & rReq )
// Default tab at pos 0
SfxItemSet aSet( GetPool(), svl::Items<RES_LR_SPACE, RES_LR_SPACE>{} );
rSh.GetCurAttr( aSet );
- const SvxLRSpaceItem& rLR = static_cast<const SvxLRSpaceItem&>(aSet.Get(RES_LR_SPACE));
+ const SvxLRSpaceItem& rLR = aSet.Get(RES_LR_SPACE);
if ( rLR.GetTextFirstLineOfst() < 0 )
{
@@ -656,7 +656,7 @@ void SwView::ExecTabWin( SfxRequest const & rReq )
{
SfxItemSet aLRSpaceSet( GetPool(), svl::Items<RES_LR_SPACE, RES_LR_SPACE>{} );
rSh.GetCurAttr( aLRSpaceSet );
- SvxLRSpaceItem aParaMargin( static_cast<const SvxLRSpaceItem&>( aLRSpaceSet.Get( RES_LR_SPACE ) ) );
+ SvxLRSpaceItem aParaMargin( aLRSpaceSet.Get( RES_LR_SPACE ) );
SvxLRSpaceItem aNewMargin( RES_LR_SPACE );
aNewMargin.SetTextLeft( aParaMargin.GetTextLeft() + aParaMargin.GetTextFirstLineOfst() );
@@ -686,8 +686,7 @@ void SwView::ExecTabWin( SfxRequest const & rReq )
// has to consider the left indent of the paragraph
SfxItemSet aSet( GetPool(), svl::Items<RES_LR_SPACE, RES_LR_SPACE>{} );
rSh.GetCurAttr( aSet );
- const SvxLRSpaceItem& rLR =
- static_cast<const SvxLRSpaceItem&>(aSet.Get(RES_LR_SPACE));
+ const SvxLRSpaceItem& rLR = aSet.Get(RES_LR_SPACE);
SwPosition aPos(*m_pNumRuleNodeFromDoc);
// #i90078#
@@ -772,8 +771,7 @@ void SwView::ExecTabWin( SfxRequest const & rReq )
{
SfxItemSet aULSpaceSet( GetPool(), svl::Items<RES_UL_SPACE, RES_UL_SPACE>{} );
rSh.GetCurAttr( aULSpaceSet );
- SvxULSpaceItem aULSpace(
- static_cast< const SvxULSpaceItem& >( aULSpaceSet.Get( RES_UL_SPACE ) ) );
+ SvxULSpaceItem aULSpace( aULSpaceSet.Get( RES_UL_SPACE ) );
sal_uInt16 nUpper = aULSpace.GetUpper();
sal_uInt16 nLower = aULSpace.GetLower();
@@ -907,7 +905,7 @@ void SwView::ExecTabWin( SfxRequest const & rReq )
SwFormatCol aCols(
bSect ?
pSectFormat->GetCol() :
- static_cast<const SwFormatCol&>(aSet.Get( RES_COL, false )));
+ aSet.Get( RES_COL, false ));
SwRect aCurRect = rSh.GetAnyCurRect(bSect ? CurRectType::SectionPrt : CurRectType::FlyEmbeddedPrt);
const long lWidth = bVerticalWriting ? aCurRect.Height() : aCurRect.Width();
::lcl_ConvertToCols( aColItem, lWidth, aCols );
@@ -1477,7 +1475,7 @@ void SwView::StateTabWin(SfxItemSet& rSet)
SvxLRSpaceItem aLR( RES_LR_SPACE );
if ( !IsTabColFromDoc() )
{
- aLR = static_cast<const SvxLRSpaceItem&>(aCoreSet.Get(RES_LR_SPACE));
+ aLR = aCoreSet.Get(RES_LR_SPACE);
// #i23726#
if (m_pNumRuleNodeFromDoc)
@@ -1505,7 +1503,7 @@ void SwView::StateTabWin(SfxItemSet& rSet)
case SID_PARASPACE_INCREASE:
case SID_PARASPACE_DECREASE:
{
- SvxULSpaceItem aUL = static_cast<const SvxULSpaceItem&>(aCoreSet.Get(RES_UL_SPACE));
+ SvxULSpaceItem aUL = aCoreSet.Get(RES_UL_SPACE);
SfxItemState e = aCoreSet.GetItemState(RES_UL_SPACE);
if( e >= SfxItemState::DEFAULT )
{
@@ -1558,14 +1556,14 @@ void SwView::StateTabWin(SfxItemSet& rSet)
SvxBoxInfoItem aBoxInfo( SID_ATTR_BORDER_INNER );
aCoreSet.Put( aBoxInfo );
rSh.GetFlyFrameAttr( aCoreSet );
- const SvxBoxItem& rBox = static_cast<const SvxBoxItem&>(aCoreSet.Get(RES_BOX));
+ const SvxBoxItem& rBox = aCoreSet.Get(RES_BOX);
aDistLR.SetLeft(rBox.GetDistance(SvxBoxItemLine::LEFT));
aDistLR.SetRight(rBox.GetDistance(SvxBoxItemLine::RIGHT));
//add the paragraph border distance
SfxItemSet aCoreSet1( GetPool(), svl::Items<RES_BOX, RES_BOX>{} );
rSh.GetCurAttr( aCoreSet1 );
- const SvxBoxItem& rParaBox = static_cast<const SvxBoxItem&>(aCoreSet1.Get(RES_BOX));
+ const SvxBoxItem& rParaBox = aCoreSet1.Get(RES_BOX);
aDistLR.SetLeft(aDistLR.GetLeft() + rParaBox.GetDistance(SvxBoxItemLine::LEFT));
aDistLR.SetRight(aDistLR.GetRight() + rParaBox.GetDistance(SvxBoxItemLine::RIGHT));
}
@@ -1585,14 +1583,14 @@ void SwView::StateTabWin(SfxItemSet& rSet)
aBoxInfo.SetDist(true);
aCoreSet2.Put(aBoxInfo);
rSh.GetTabBorders( aCoreSet2 );
- const SvxBoxItem& rBox = static_cast<const SvxBoxItem&>(aCoreSet2.Get(RES_BOX));
+ const SvxBoxItem& rBox = aCoreSet2.Get(RES_BOX);
aDistLR.SetLeft(rBox.GetDistance(SvxBoxItemLine::LEFT));
aDistLR.SetRight(rBox.GetDistance(SvxBoxItemLine::RIGHT));
//add the border distance of the paragraph
SfxItemSet aCoreSet1( GetPool(), svl::Items<RES_BOX, RES_BOX>{} );
rSh.GetCurAttr( aCoreSet1 );
- const SvxBoxItem& rParaBox = static_cast<const SvxBoxItem&>(aCoreSet1.Get(RES_BOX));
+ const SvxBoxItem& rParaBox = aCoreSet1.Get(RES_BOX);
aDistLR.SetLeft(aDistLR.GetLeft() + rParaBox.GetDistance(SvxBoxItemLine::LEFT));
aDistLR.SetRight(aDistLR.GetRight() + rParaBox.GetDistance(SvxBoxItemLine::RIGHT));
rSet.Put(aDistLR);
@@ -1603,7 +1601,7 @@ void SwView::StateTabWin(SfxItemSet& rSet)
{
//get the page/header/footer border distance
const SwFrameFormat& rMaster = rDesc.GetMaster();
- const SvxBoxItem& rBox = static_cast<const SvxBoxItem&>(rMaster.GetAttrSet().Get(RES_BOX));
+ const SvxBoxItem& rBox = rMaster.GetAttrSet().Get(RES_BOX);
aDistLR.SetLeft(rBox.GetDistance(SvxBoxItemLine::LEFT));
aDistLR.SetRight(rBox.GetDistance(SvxBoxItemLine::RIGHT));
@@ -1632,7 +1630,7 @@ void SwView::StateTabWin(SfxItemSet& rSet)
//add the border distance of the paragraph
SfxItemSet aCoreSetTmp( GetPool(), svl::Items<RES_BOX, RES_BOX>{} );
rSh.GetCurAttr( aCoreSetTmp );
- const SvxBoxItem& rParaBox = static_cast<const SvxBoxItem&>(aCoreSetTmp.Get(RES_BOX));
+ const SvxBoxItem& rParaBox = aCoreSetTmp.Get(RES_BOX);
aDistLR.SetLeft(aDistLR.GetLeft() + rParaBox.GetDistance(SvxBoxItemLine::LEFT));
aDistLR.SetRight(aDistLR.GetRight() + rParaBox.GetDistance(SvxBoxItemLine::RIGHT));
rSet.Put(aDistLR);
diff --git a/sw/source/uibase/wrtsh/delete.cxx b/sw/source/uibase/wrtsh/delete.cxx
index 2b2c90f5ac2e..6c2a7d04d272 100644
--- a/sw/source/uibase/wrtsh/delete.cxx
+++ b/sw/source/uibase/wrtsh/delete.cxx
@@ -50,7 +50,7 @@ bool SwWrtShell::TryRemoveIndent()
SfxItemSet aAttrSet(GetAttrPool(), svl::Items<RES_LR_SPACE, RES_LR_SPACE>{});
GetCurAttr(aAttrSet);
- SvxLRSpaceItem aItem = static_cast<const SvxLRSpaceItem &>(aAttrSet.Get(RES_LR_SPACE));
+ SvxLRSpaceItem aItem = aAttrSet.Get(RES_LR_SPACE);
short aOldFirstLineOfst = aItem.GetTextFirstLineOfst();
if (aOldFirstLineOfst > 0)