summaryrefslogtreecommitdiff
path: root/sw/source/uibase/frmdlg
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2014-12-01 10:17:45 +0200
committerNoel Grandin <noel@peralex.com>2014-12-02 09:32:10 +0200
commite5764b7d04429549658c1eaf1189428aa504f0da (patch)
treea59a3fb91d15c7dec7cbb1ef1d8392913c6dd0aa /sw/source/uibase/frmdlg
parentc91ece97c00a780c1ed745aed64b20958e9ee2aa (diff)
loplugin: cstylecast
Change-Id: I9a0f424adbcf95fb5ab275b90af1c56ae1d2fc44
Diffstat (limited to 'sw/source/uibase/frmdlg')
-rw-r--r--sw/source/uibase/frmdlg/colex.cxx40
-rw-r--r--sw/source/uibase/frmdlg/colmgr.cxx6
-rw-r--r--sw/source/uibase/frmdlg/frmmgr.cxx10
3 files changed, 28 insertions, 28 deletions
diff --git a/sw/source/uibase/frmdlg/colex.cxx b/sw/source/uibase/frmdlg/colex.cxx
index 8068fa1f46f5..8943c093f9ab 100644
--- a/sw/source/uibase/frmdlg/colex.cxx
+++ b/sw/source/uibase/frmdlg/colex.cxx
@@ -48,7 +48,7 @@ void SwPageExample::UpdateExample( const SfxItemSet& rSet )
if ( rSet.GetItemState( nWhich, false ) == SfxItemState::SET )
{
// alignment
- const SvxPageItem* pPage = (const SvxPageItem*)&rSet.Get( nWhich );
+ const SvxPageItem* pPage = static_cast<const SvxPageItem*>(&rSet.Get( nWhich ));
if ( pPage )
SetUsage( pPage->GetPageUsage() );
@@ -59,14 +59,14 @@ void SwPageExample::UpdateExample( const SfxItemSet& rSet )
if ( rSet.GetItemState( nWhich, false ) == SfxItemState::SET )
{
// orientation and size from PageItem
- const SvxSizeItem& rSize = (const SvxSizeItem&)rSet.Get( nWhich );
+ const SvxSizeItem& rSize = static_cast<const SvxSizeItem&>(rSet.Get( nWhich ));
SetSize( rSize.GetSize() );
}
nWhich = RES_LR_SPACE;
if ( rSet.GetItemState( nWhich, false ) == SfxItemState::SET )
{
// set left and right border
- const SvxLRSpaceItem& rLRSpace = (const SvxLRSpaceItem&)rSet.Get( nWhich );
+ const SvxLRSpaceItem& rLRSpace = static_cast<const SvxLRSpaceItem&>(rSet.Get( nWhich ));
SetLeft( rLRSpace.GetLeft() );
SetRight( rLRSpace.GetRight() );
@@ -82,7 +82,7 @@ void SwPageExample::UpdateExample( const SfxItemSet& rSet )
if ( rSet.GetItemState( nWhich, false ) == SfxItemState::SET )
{
// set upper and lower border
- const SvxULSpaceItem& rULSpace = (const SvxULSpaceItem&)rSet.Get( nWhich );
+ const SvxULSpaceItem& rULSpace = static_cast<const SvxULSpaceItem&>(rSet.Get( nWhich ));
SetTop( rULSpace.GetUpper() );
SetBottom( rULSpace.GetLower() );
@@ -100,17 +100,17 @@ void SwPageExample::UpdateExample( const SfxItemSet& rSet )
{
const SfxItemSet& rHeaderSet = static_cast<const SvxSetItem*>(pItem)->GetItemSet();
const SfxBoolItem& rHeaderOn =
- (const SfxBoolItem&)rHeaderSet.Get( pPool->GetWhich( SID_ATTR_PAGE_ON ) );
+ static_cast<const SfxBoolItem&>(rHeaderSet.Get( pPool->GetWhich( SID_ATTR_PAGE_ON ) ) );
if ( rHeaderOn.GetValue() )
{
const SvxSizeItem& rSize =
- (const SvxSizeItem&)rHeaderSet.Get(pPool->GetWhich(SID_ATTR_PAGE_SIZE));
+ static_cast<const SvxSizeItem&>(rHeaderSet.Get(pPool->GetWhich(SID_ATTR_PAGE_SIZE)));
- const SvxULSpaceItem& rUL = (const SvxULSpaceItem&)rHeaderSet.Get(
- pPool->GetWhich(SID_ATTR_ULSPACE));
- const SvxLRSpaceItem& rLR = (const SvxLRSpaceItem&)rHeaderSet.Get(
- pPool->GetWhich(SID_ATTR_LRSPACE));
+ const SvxULSpaceItem& rUL = static_cast<const SvxULSpaceItem&>(rHeaderSet.Get(
+ pPool->GetWhich(SID_ATTR_ULSPACE)));
+ const SvxLRSpaceItem& rLR = static_cast<const SvxLRSpaceItem&>(rHeaderSet.Get(
+ pPool->GetWhich(SID_ATTR_LRSPACE)));
SetHdHeight( rSize.GetSize().Height() - rUL.GetLower());
SetHdDist( rUL.GetLower() );
@@ -134,7 +134,7 @@ void SwPageExample::UpdateExample( const SfxItemSet& rSet )
if ( rHeaderSet.GetItemState( RES_BOX ) == SfxItemState::SET )
{
const SvxBoxItem& rItem =
- (const SvxBoxItem&)rHeaderSet.Get( RES_BOX );
+ static_cast<const SvxBoxItem&>(rHeaderSet.Get( RES_BOX ));
SetHdBorder( rItem );
}
}
@@ -147,17 +147,17 @@ void SwPageExample::UpdateExample( const SfxItemSet& rSet )
{
const SfxItemSet& rFooterSet = static_cast<const SvxSetItem*>(pItem)->GetItemSet();
const SfxBoolItem& rFooterOn =
- (const SfxBoolItem&)rFooterSet.Get( SID_ATTR_PAGE_ON );
+ static_cast<const SfxBoolItem&>(rFooterSet.Get( SID_ATTR_PAGE_ON ));
if ( rFooterOn.GetValue() )
{
const SvxSizeItem& rSize =
- (const SvxSizeItem&)rFooterSet.Get( pPool->GetWhich( SID_ATTR_PAGE_SIZE ) );
+ static_cast<const SvxSizeItem&>(rFooterSet.Get( pPool->GetWhich( SID_ATTR_PAGE_SIZE ) ));
- const SvxULSpaceItem& rUL = (const SvxULSpaceItem&)rFooterSet.Get(
- pPool->GetWhich( SID_ATTR_ULSPACE ) );
- const SvxLRSpaceItem& rLR = (const SvxLRSpaceItem&)rFooterSet.Get(
- pPool->GetWhich( SID_ATTR_LRSPACE ) );
+ const SvxULSpaceItem& rUL = static_cast<const SvxULSpaceItem&>(rFooterSet.Get(
+ pPool->GetWhich( SID_ATTR_ULSPACE ) ));
+ const SvxLRSpaceItem& rLR = static_cast<const SvxLRSpaceItem&>(rFooterSet.Get(
+ pPool->GetWhich( SID_ATTR_LRSPACE ) ));
SetFtHeight( rSize.GetSize().Height() - rUL.GetUpper());
SetFtDist( rUL.GetUpper() );
@@ -181,7 +181,7 @@ void SwPageExample::UpdateExample( const SfxItemSet& rSet )
if( rFooterSet.GetItemState( RES_BOX ) == SfxItemState::SET )
{
const SvxBoxItem& rItem =
- (const SvxBoxItem&)rFooterSet.Get( RES_BOX );
+ static_cast<const SvxBoxItem&>(rFooterSet.Get( RES_BOX ));
SetFtBorder( rItem );
}
}
@@ -597,11 +597,11 @@ void SwPageGridExample::UpdateExample( const SfxItemSet& rSet )
DELETEZ(pGridItem);
//get the grid information
if(SfxItemState::DEFAULT <= rSet.GetItemState(RES_TEXTGRID, true))
- pGridItem = (SwTextGridItem*)static_cast<const SwTextGridItem&>(rSet.Get(RES_TEXTGRID)).Clone();
+ pGridItem = static_cast<SwTextGridItem*>(static_cast<const SwTextGridItem&>(rSet.Get(RES_TEXTGRID)).Clone());
if( SfxItemState::DEFAULT <= rSet.GetItemState( RES_FRAMEDIR, true ))
{
const SvxFrameDirectionItem& rDirItem =
- (const SvxFrameDirectionItem&)rSet.Get(RES_FRAMEDIR);
+ static_cast<const SvxFrameDirectionItem&>(rSet.Get(RES_FRAMEDIR));
m_bVertical = rDirItem.GetValue() == FRMDIR_VERT_TOP_RIGHT||
rDirItem.GetValue() == FRMDIR_VERT_TOP_LEFT;
}
diff --git a/sw/source/uibase/frmdlg/colmgr.cxx b/sw/source/uibase/frmdlg/colmgr.cxx
index 94e04b6599f5..3f040b844358 100644
--- a/sw/source/uibase/frmdlg/colmgr.cxx
+++ b/sw/source/uibase/frmdlg/colmgr.cxx
@@ -110,15 +110,15 @@ void SwColMgr::SetActualWidth(sal_uInt16 nW)
// ctor
SwColMgr::SwColMgr(const SfxItemSet& rSet, sal_uInt16 nActWidth) :
- aFmtCol((const SwFmtCol&)rSet.Get(RES_COL)),
+ aFmtCol(static_cast<const SwFmtCol&>(rSet.Get(RES_COL))),
nWidth(nActWidth)
{
if(nWidth == USHRT_MAX)
{
- nWidth = (sal_uInt16)((const SwFmtFrmSize&)rSet.Get(RES_FRM_SIZE)).GetWidth();
+ nWidth = (sal_uInt16)static_cast<const SwFmtFrmSize&>(rSet.Get(RES_FRM_SIZE)).GetWidth();
if (nWidth < MINLAY)
nWidth = USHRT_MAX;
- const SvxLRSpaceItem &rLR = (const SvxLRSpaceItem&)rSet.Get(RES_LR_SPACE);
+ const SvxLRSpaceItem &rLR = static_cast<const SvxLRSpaceItem&>(rSet.Get(RES_LR_SPACE));
nWidth = nWidth - (sal_uInt16)rLR.GetLeft();
nWidth = nWidth - (sal_uInt16)rLR.GetRight();
}
diff --git a/sw/source/uibase/frmdlg/frmmgr.cxx b/sw/source/uibase/frmdlg/frmmgr.cxx
index b4285c82731e..c455b0d48d7d 100644
--- a/sw/source/uibase/frmdlg/frmmgr.cxx
+++ b/sw/source/uibase/frmdlg/frmmgr.cxx
@@ -57,7 +57,7 @@ static sal_uInt16 aFrmMgrRange[] = {
// determine frame attributes via Shell
SwFlyFrmAttrMgr::SwFlyFrmAttrMgr( bool bNew, SwWrtShell* pSh, sal_uInt8 nType ) :
- m_aSet( (SwAttrPool&)pSh->GetAttrPool(), aFrmMgrRange ),
+ m_aSet( static_cast<SwAttrPool&>(pSh->GetAttrPool()), aFrmMgrRange ),
m_pOwnSh( pSh ),
m_bAbsPos( false ),
m_bNewFrm( bNew ),
@@ -116,7 +116,7 @@ void SwFlyFrmAttrMgr::_UpdateFlyFrm()
const SfxPoolItem* pItem = 0;
if (m_aSet.GetItemState(FN_SET_FRM_NAME, false, &pItem) == SfxItemState::SET)
- m_pOwnSh->SetFlyName(((SfxStringItem *)pItem)->GetValue());
+ m_pOwnSh->SetFlyName(static_cast<const SfxStringItem *>(pItem)->GetValue());
m_pOwnSh->SetModified();
@@ -253,7 +253,7 @@ void SwFlyFrmAttrMgr::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 = static_cast<RndStdIds >(rVal.nAnchorType);
- const SwFmtFrmSize& rSize = (const SwFmtFrmSize&)m_aSet.Get(RES_FRM_SIZE);
+ const SwFmtFrmSize& rSize = static_cast<const SwFmtFrmSize&>(m_aSet.Get(RES_FRM_SIZE));
m_pOwnSh->CalcBoundRect( aBoundRect, eAnchorType,
rVal.nHRelOrient,
rVal.nVRelOrient,
@@ -517,7 +517,7 @@ void SwFlyFrmAttrMgr::SetLRSpace( long nLeft, long nRight )
{
OSL_ENSURE( LONG_MAX != nLeft && LONG_MAX != nRight, "Welchen Raend setzen?" );
- SvxLRSpaceItem aTmp( (SvxLRSpaceItem&)m_aSet.Get( RES_LR_SPACE ) );
+ SvxLRSpaceItem aTmp( static_cast<const SvxLRSpaceItem&>(m_aSet.Get( RES_LR_SPACE )) );
if( LONG_MAX != nLeft )
aTmp.SetLeft( sal_uInt16(nLeft) );
if( LONG_MAX != nRight )
@@ -529,7 +529,7 @@ void SwFlyFrmAttrMgr::SetULSpace( long nTop, long nBottom )
{
OSL_ENSURE(LONG_MAX != nTop && LONG_MAX != nBottom, "Welchen Raend setzen?" );
- SvxULSpaceItem aTmp( (SvxULSpaceItem&)m_aSet.Get( RES_UL_SPACE ) );
+ SvxULSpaceItem aTmp( static_cast<const SvxULSpaceItem&>(m_aSet.Get( RES_UL_SPACE )) );
if( LONG_MAX != nTop )
aTmp.SetUpper( sal_uInt16(nTop) );
if( LONG_MAX != nBottom )