summaryrefslogtreecommitdiff
path: root/sc
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2014-10-27 14:18:31 +0200
committerNoel Grandin <noel@peralex.com>2014-10-28 08:10:20 +0200
commit788e9b9f39e2e074a146642be60df4d005018356 (patch)
treecf8586fa2b6011f323f19350d1762163372afb3e /sc
parentd9026e13578e6714b2847a9adc0c0563708a0c74 (diff)
loplugin: cstylecast
Change-Id: Ib0c5e17c9fba4b876b22c2a6d636d4fd19f3a280
Diffstat (limited to 'sc')
-rw-r--r--sc/source/ui/drawfunc/drawsh.cxx2
-rw-r--r--sc/source/ui/drawfunc/drawsh2.cxx2
-rw-r--r--sc/source/ui/drawfunc/drawsh4.cxx4
-rw-r--r--sc/source/ui/drawfunc/drawsh5.cxx6
-rw-r--r--sc/source/ui/drawfunc/drtxtob.cxx68
-rw-r--r--sc/source/ui/drawfunc/drtxtob2.cxx6
-rw-r--r--sc/source/ui/drawfunc/fuconcustomshape.cxx6
-rw-r--r--sc/source/ui/drawfunc/fuconpol.cxx2
-rw-r--r--sc/source/ui/drawfunc/fuconrec.cxx10
-rw-r--r--sc/source/ui/drawfunc/fuconstr.cxx2
-rw-r--r--sc/source/ui/drawfunc/fudraw.cxx2
-rw-r--r--sc/source/ui/drawfunc/fuins1.cxx8
-rw-r--r--sc/source/ui/drawfunc/fuins2.cxx6
-rw-r--r--sc/source/ui/drawfunc/fusel.cxx6
-rw-r--r--sc/source/ui/drawfunc/futext.cxx10
-rw-r--r--sc/source/ui/drawfunc/graphsh.cxx22
-rw-r--r--sc/source/ui/formdlg/formula.cxx8
-rw-r--r--sc/source/ui/miscdlgs/acredlin.cxx14
-rw-r--r--sc/source/ui/miscdlgs/anyrefdg.cxx22
-rw-r--r--sc/source/ui/miscdlgs/autofmt.cxx32
-rw-r--r--sc/source/ui/miscdlgs/crnrdlg.cxx16
-rw-r--r--sc/source/ui/miscdlgs/scuiautofmt.cxx2
-rw-r--r--sc/source/ui/miscdlgs/tabbgcolordlg.cxx2
-rw-r--r--sc/source/ui/miscdlgs/textdlgs.cxx2
24 files changed, 130 insertions, 130 deletions
diff --git a/sc/source/ui/drawfunc/drawsh.cxx b/sc/source/ui/drawfunc/drawsh.cxx
index 32257f897f1d..9f0ce375474d 100644
--- a/sc/source/ui/drawfunc/drawsh.cxx
+++ b/sc/source/ui/drawfunc/drawsh.cxx
@@ -347,7 +347,7 @@ void ScDrawShell::ExecuteMacroAssign( SdrObject* pObj, vcl::Window* pWin )
if( SfxItemState::SET == pOutSet->GetItemState( SID_ATTR_MACROITEM, false, &pItem ))
{
OUString sMacro;
- const SvxMacro* pMacro = ((SvxMacroItem*)pItem)->GetMacroTable().Get( SFX_EVENT_MOUSECLICK_OBJECT );
+ const SvxMacro* pMacro = static_cast<const SvxMacroItem*>(pItem)->GetMacroTable().Get( SFX_EVENT_MOUSECLICK_OBJECT );
if ( pMacro )
sMacro = pMacro->GetMacName();
diff --git a/sc/source/ui/drawfunc/drawsh2.cxx b/sc/source/ui/drawfunc/drawsh2.cxx
index 73ab0cd8ff5b..edada20f2da6 100644
--- a/sc/source/ui/drawfunc/drawsh2.cxx
+++ b/sc/source/ui/drawfunc/drawsh2.cxx
@@ -268,7 +268,7 @@ void ScDrawShell::GetDrawFuncState( SfxItemSet& rSet ) // Funktionen disabl
pView->GetAttributes( aAttrs );
if( aAttrs.GetItemState( EE_PARA_HYPHENATE ) >= SfxItemState::DEFAULT )
{
- bool bValue = ( (const SfxBoolItem&) aAttrs.Get( EE_PARA_HYPHENATE ) ).GetValue();
+ bool bValue = static_cast<const SfxBoolItem&>( aAttrs.Get( EE_PARA_HYPHENATE ) ).GetValue();
rSet.Put( SfxBoolItem( SID_ENABLE_HYPHENATION, bValue ) );
}
}
diff --git a/sc/source/ui/drawfunc/drawsh4.cxx b/sc/source/ui/drawfunc/drawsh4.cxx
index 0f59e0597951..09a0f7b55b54 100644
--- a/sc/source/ui/drawfunc/drawsh4.cxx
+++ b/sc/source/ui/drawfunc/drawsh4.cxx
@@ -41,7 +41,7 @@ void ScDrawShell::GetFormTextState(SfxItemSet& rSet)
SfxViewFrame* pViewFrm = pViewData->GetViewShell()->GetViewFrame();
if ( pViewFrm->HasChildWindow(nId) )
- pDlg = (SvxFontWorkDialog*)(pViewFrm->GetChildWindow(nId)->GetWindow());
+ pDlg = static_cast<SvxFontWorkDialog*>(pViewFrm->GetChildWindow(nId)->GetWindow());
if ( rMarkList.GetMarkCount() == 1 )
pObj = rMarkList.GetMark(0)->GetMarkedSdrObj();
@@ -82,7 +82,7 @@ void ScDrawShell::GetFormTextState(SfxItemSet& rSet)
XColorListRef pColorList;
if ( pItem )
- pColorList = ((SvxColorListItem*)pItem)->GetColorList();
+ pColorList = static_cast<const SvxColorListItem*>(pItem)->GetColorList();
pDlg->SetActive();
diff --git a/sc/source/ui/drawfunc/drawsh5.cxx b/sc/source/ui/drawfunc/drawsh5.cxx
index 206ee0c49eed..a74e52397cb4 100644
--- a/sc/source/ui/drawfunc/drawsh5.cxx
+++ b/sc/source/ui/drawfunc/drawsh5.cxx
@@ -152,7 +152,7 @@ void ScDrawShell::ExecuteHLink( SfxRequest& rReq )
const SfxPoolItem* pItem;
if ( pReqArgs->GetItemState( SID_HYPERLINK_SETLINK, true, &pItem ) == SfxItemState::SET )
{
- const SvxHyperlinkItem* pHyper = (const SvxHyperlinkItem*) pItem;
+ const SvxHyperlinkItem* pHyper = static_cast<const SvxHyperlinkItem*>(pItem);
const OUString& rName = pHyper->GetName();
const OUString& rURL = pHyper->GetURL();
const OUString& rTarget = pHyper->GetTargetFrame();
@@ -253,7 +253,7 @@ void ScDrawShell::ExecDrawFunc( SfxRequest& rReq )
// wer weiss, wie lange das funktioniert? (->vom Abreisscontrol funktioniert es)
if (nSlotId == SID_OBJECT_ALIGN && pArgs)
- nSlotId = SID_OBJECT_ALIGN + ((SfxEnumItem&)pArgs->Get(SID_OBJECT_ALIGN)).GetValue() + 1;
+ nSlotId = SID_OBJECT_ALIGN + static_cast<const SfxEnumItem&>(pArgs->Get(SID_OBJECT_ALIGN)).GetValue() + 1;
switch (nSlotId)
{
@@ -444,7 +444,7 @@ void ScDrawShell::ExecDrawFunc( SfxRequest& rReq )
if ( rReq.GetArgs() )
pViewFrm->SetChildWindow( nId,
- ((const SfxBoolItem&)
+ static_cast<const SfxBoolItem&>(
(rReq.GetArgs()->Get(SID_FONTWORK))).
GetValue() );
else
diff --git a/sc/source/ui/drawfunc/drtxtob.cxx b/sc/source/ui/drawfunc/drtxtob.cxx
index 315f55719a8a..0c9d4fe64a5d 100644
--- a/sc/source/ui/drawfunc/drtxtob.cxx
+++ b/sc/source/ui/drawfunc/drtxtob.cxx
@@ -182,7 +182,7 @@ void ScDrawTextObjectBar::Execute( SfxRequest &rReq )
pReqArgs->GetItemState(nSlot, true, &pItem) == SfxItemState::SET &&
pItem->ISA(SfxUInt32Item) )
{
- nFormat = ((const SfxUInt32Item*)pItem)->GetValue();
+ nFormat = static_cast<const SfxUInt32Item*>(pItem)->GetValue();
}
if ( nFormat )
@@ -209,8 +209,8 @@ void ScDrawTextObjectBar::Execute( SfxRequest &rReq )
case SID_CHARMAP:
{
- const SvxFontItem& rItem = (const SvxFontItem&)
- pOutView->GetAttribs().Get(EE_CHAR_FONTINFO);
+ const SvxFontItem& rItem = static_cast<const SvxFontItem&>(
+ pOutView->GetAttribs().Get(EE_CHAR_FONTINFO));
OUString aString;
SvxFontItem aNewItem( EE_CHAR_FONTINFO );
@@ -222,7 +222,7 @@ void ScDrawTextObjectBar::Execute( SfxRequest &rReq )
if ( pItem )
{
- aString = ((const SfxStringItem*)pItem)->GetValue();
+ aString = static_cast<const SfxStringItem*>(pItem)->GetValue();
const SfxPoolItem* pFtItem = NULL;
pArgs->GetItemState( GetPool().GetWhich(SID_ATTR_SPECIALCHAR), false, &pFtItem);
const SfxStringItem* pFontItem = PTR_CAST( SfxStringItem, pFtItem );
@@ -259,7 +259,7 @@ void ScDrawTextObjectBar::Execute( SfxRequest &rReq )
const SfxPoolItem* pItem;
if ( pReqArgs->GetItemState( SID_HYPERLINK_SETLINK, true, &pItem ) == SfxItemState::SET )
{
- const SvxHyperlinkItem* pHyper = (const SvxHyperlinkItem*) pItem;
+ const SvxHyperlinkItem* pHyper = static_cast<const SvxHyperlinkItem*>(pItem);
const OUString& rName = pHyper->GetName();
const OUString& rURL = pHyper->GetURL();
const OUString& rTarget = pHyper->GetTargetFrame();
@@ -391,7 +391,7 @@ void ScDrawTextObjectBar::GetState( SfxItemSet& rSet )
const SvxFieldData* pField = pFieldItem->GetField();
if ( pField && pField->ISA(SvxURLField) )
{
- const SvxURLField* pURLField = (const SvxURLField*) pField;
+ const SvxURLField* pURLField = static_cast<const SvxURLField*>(pField);
aHLinkItem.SetName( pURLField->GetRepresentation() );
aHLinkItem.SetURL( pURLField->GetURL() );
aHLinkItem.SetTargetFrame( pURLField->GetTargetFrame() );
@@ -444,7 +444,7 @@ void ScDrawTextObjectBar::GetState( SfxItemSet& rSet )
pView->GetAttributes( aAttrs );
if( aAttrs.GetItemState( EE_PARA_HYPHENATE ) >= SfxItemState::DEFAULT )
{
- bool bValue = ( (const SfxBoolItem&) aAttrs.Get( EE_PARA_HYPHENATE ) ).GetValue();
+ bool bValue = static_cast<const SfxBoolItem&>( aAttrs.Get( EE_PARA_HYPHENATE ) ).GetValue();
rSet.Put( SfxBoolItem( SID_ENABLE_HYPHENATION, bValue ) );
}
}
@@ -559,7 +559,7 @@ void ScDrawTextObjectBar::ExecuteToggle( SfxRequest &rReq )
pView->GetAttributes(aViewAttr);
// Unterstreichung
- FontUnderline eOld = ((const SvxUnderlineItem&) aViewAttr.
+ FontUnderline eOld = static_cast<const SvxUnderlineItem&>( aViewAttr.
Get(EE_CHAR_UNDERLINE)).GetLineStyle();
FontUnderline eNew = eOld;
switch (nSlot)
@@ -723,7 +723,7 @@ void ScDrawTextObjectBar::ExecuteAttr( SfxRequest &rReq )
case SID_SET_SUPER_SCRIPT:
{
SvxEscapementItem aItem(EE_CHAR_ESCAPEMENT);
- SvxEscapement eEsc = (SvxEscapement) ( (const SvxEscapementItem&)
+ SvxEscapement eEsc = (SvxEscapement) static_cast<const SvxEscapementItem&>(
aEditAttr.Get( EE_CHAR_ESCAPEMENT ) ).GetEnumValue();
if( eEsc == SVX_ESCAPEMENT_SUPERSCRIPT )
@@ -737,7 +737,7 @@ void ScDrawTextObjectBar::ExecuteAttr( SfxRequest &rReq )
case SID_SET_SUB_SCRIPT:
{
SvxEscapementItem aItem(EE_CHAR_ESCAPEMENT);
- SvxEscapement eEsc = (SvxEscapement) ( (const SvxEscapementItem&)
+ SvxEscapement eEsc = (SvxEscapement) static_cast<const SvxEscapementItem&>(
aEditAttr.Get( EE_CHAR_ESCAPEMENT ) ).GetEnumValue();
if( eEsc == SVX_ESCAPEMENT_SUBSCRIPT )
@@ -806,31 +806,31 @@ void ScDrawTextObjectBar::ExecuteAttr( SfxRequest &rReq )
break;
case SID_ATTR_CHAR_WEIGHT:
- aNewAttr.Put( (const SvxWeightItem&)aEditAttr.Get( EE_CHAR_WEIGHT ) );
+ aNewAttr.Put( static_cast<const SvxWeightItem&>(aEditAttr.Get( EE_CHAR_WEIGHT )) );
break;
case SID_ATTR_CHAR_POSTURE:
- aNewAttr.Put( (const SvxPostureItem&)aEditAttr.Get( EE_CHAR_ITALIC ) );
+ aNewAttr.Put( static_cast<const SvxPostureItem&>(aEditAttr.Get( EE_CHAR_ITALIC )) );
break;
case SID_ATTR_CHAR_UNDERLINE:
- aNewAttr.Put( (const SvxUnderlineItem&)aEditAttr.Get( EE_CHAR_UNDERLINE ) );
+ aNewAttr.Put( static_cast<const SvxUnderlineItem&>(aEditAttr.Get( EE_CHAR_UNDERLINE )) );
break;
case SID_ATTR_CHAR_OVERLINE:
- aNewAttr.Put( (const SvxOverlineItem&)aEditAttr.Get( EE_CHAR_OVERLINE ) );
+ aNewAttr.Put( static_cast<const SvxOverlineItem&>(aEditAttr.Get( EE_CHAR_OVERLINE )) );
break;
case SID_ATTR_CHAR_CONTOUR:
- aNewAttr.Put( (const SvxContourItem&)aEditAttr.Get( EE_CHAR_OUTLINE ) );
+ aNewAttr.Put( static_cast<const SvxContourItem&>(aEditAttr.Get( EE_CHAR_OUTLINE )) );
break;
case SID_ATTR_CHAR_SHADOWED:
- aNewAttr.Put( (const SvxShadowedItem&)aEditAttr.Get( EE_CHAR_SHADOW ) );
+ aNewAttr.Put( static_cast<const SvxShadowedItem&>(aEditAttr.Get( EE_CHAR_SHADOW )) );
break;
case SID_ATTR_CHAR_STRIKEOUT:
- aNewAttr.Put( (const SvxCrossedOutItem&)aEditAttr.Get( EE_CHAR_STRIKEOUT ) );
+ aNewAttr.Put( static_cast<const SvxCrossedOutItem&>(aEditAttr.Get( EE_CHAR_STRIKEOUT )) );
break;
case SID_DRAWTEXT_ATTR_DLG:
@@ -883,8 +883,8 @@ void ScDrawTextObjectBar::ExecuteAttr( SfxRequest &rReq )
else if( nSlot == SID_ATTR_PARA_LRSPACE )
{
sal_uInt16 nId = SID_ATTR_PARA_LRSPACE;
- const SvxLRSpaceItem& rItem = (const SvxLRSpaceItem&)
- pArgs->Get( nId );
+ const SvxLRSpaceItem& rItem = static_cast<const SvxLRSpaceItem&>(
+ pArgs->Get( nId ));
SfxItemSet aAttr( GetPool(), EE_PARA_LRSPACE, EE_PARA_LRSPACE );
nId = EE_PARA_LRSPACE;
SvxLRSpaceItem aLRSpaceItem( rItem.GetLeft(),
@@ -895,16 +895,16 @@ void ScDrawTextObjectBar::ExecuteAttr( SfxRequest &rReq )
}
else if( nSlot == SID_ATTR_PARA_LINESPACE )
{
- SvxLineSpacingItem aLineSpaceItem = (const SvxLineSpacingItem&)pArgs->Get(
- GetPool().GetWhich(nSlot));
+ SvxLineSpacingItem aLineSpaceItem = static_cast<const SvxLineSpacingItem&>(pArgs->Get(
+ GetPool().GetWhich(nSlot)));
SfxItemSet aAttr( GetPool(), EE_PARA_SBL, EE_PARA_SBL );
aAttr.Put( aLineSpaceItem );
pView->SetAttributes( aAttr );
}
else if( nSlot == SID_ATTR_PARA_ULSPACE )
{
- SvxULSpaceItem aULSpaceItem = (const SvxULSpaceItem&)pArgs->Get(
- GetPool().GetWhich(nSlot));
+ SvxULSpaceItem aULSpaceItem = static_cast<const SvxULSpaceItem&>(pArgs->Get(
+ GetPool().GetWhich(nSlot)));
SfxItemSet aAttr( GetPool(), EE_PARA_ULSPACE, EE_PARA_ULSPACE );
aULSpaceItem.SetWhich(EE_PARA_ULSPACE);
aAttr.Put( aULSpaceItem );
@@ -963,7 +963,7 @@ void ScDrawTextObjectBar::GetAttrState( SfxItemSet& rDestSet )
ScViewUtil::PutItemScript( rDestSet, aAttrSet, EE_CHAR_ITALIC, nScript );
// Ausrichtung
- SvxAdjust eAdj = ((const SvxAdjustItem&)aAttrSet.Get(EE_PARA_JUST)).GetAdjust();
+ SvxAdjust eAdj = static_cast<const SvxAdjustItem&>(aAttrSet.Get(EE_PARA_JUST)).GetAdjust();
switch( eAdj )
{
case SVX_ADJUST_LEFT:
@@ -1001,7 +1001,7 @@ void ScDrawTextObjectBar::GetAttrState( SfxItemSet& rDestSet )
rDestSet.Put( SfxBoolItem( SID_ALIGN_ANY_RIGHT, eAdj == SVX_ADJUST_RIGHT ) );
rDestSet.Put( SfxBoolItem( SID_ALIGN_ANY_JUSTIFIED, eAdj == SVX_ADJUST_BLOCK ) );
- SvxLRSpaceItem aLR = ((const SvxLRSpaceItem&)aAttrSet.Get( EE_PARA_LRSPACE ));
+ SvxLRSpaceItem aLR = static_cast<const SvxLRSpaceItem&>(aAttrSet.Get( EE_PARA_LRSPACE ));
aLR.SetWhich(SID_ATTR_PARA_LRSPACE);
rDestSet.Put(aLR);
Invalidate( SID_ATTR_PARA_LRSPACE );
@@ -1009,7 +1009,7 @@ void ScDrawTextObjectBar::GetAttrState( SfxItemSet& rDestSet )
if ( eState == SfxItemState::DONTCARE )
rDestSet.InvalidateItem(SID_ATTR_PARA_LRSPACE);
//xuxu for Line Space
- SvxLineSpacingItem aLineSP = ((const SvxLineSpacingItem&)aAttrSet.
+ SvxLineSpacingItem aLineSP = static_cast<const SvxLineSpacingItem&>(aAttrSet.
Get( EE_PARA_SBL ));
aLineSP.SetWhich(SID_ATTR_PARA_LINESPACE);
rDestSet.Put(aLineSP);
@@ -1018,7 +1018,7 @@ void ScDrawTextObjectBar::GetAttrState( SfxItemSet& rDestSet )
if ( eState == SfxItemState::DONTCARE )
rDestSet.InvalidateItem(SID_ATTR_PARA_LINESPACE);
//xuxu for UL Space
- SvxULSpaceItem aULSP = ((const SvxULSpaceItem&)aAttrSet.
+ SvxULSpaceItem aULSP = static_cast<const SvxULSpaceItem&>(aAttrSet.
Get( EE_PARA_ULSPACE ));
aULSP.SetWhich(SID_ATTR_PARA_ULSPACE);
rDestSet.Put(aULSP);
@@ -1030,7 +1030,7 @@ void ScDrawTextObjectBar::GetAttrState( SfxItemSet& rDestSet )
// Zeilenabstand
sal_uInt16 nLineSpace = (sal_uInt16)
- ((const SvxLineSpacingItem&)aAttrSet.
+ static_cast<const SvxLineSpacingItem&>(aAttrSet.
Get( EE_PARA_SBL )).GetPropLineSpace();
switch( nLineSpace )
{
@@ -1047,7 +1047,7 @@ void ScDrawTextObjectBar::GetAttrState( SfxItemSet& rDestSet )
// hoch-/tiefgestellt
- SvxEscapement eEsc = (SvxEscapement) ( (const SvxEscapementItem&)
+ SvxEscapement eEsc = (SvxEscapement) static_cast<const SvxEscapementItem&>(
aAttrSet.Get( EE_CHAR_ESCAPEMENT ) ).GetEnumValue();
if( eEsc == SVX_ESCAPEMENT_SUPERSCRIPT )
rDestSet.Put( SfxBoolItem( SID_SET_SUPER_SCRIPT, true ) );
@@ -1066,7 +1066,7 @@ void ScDrawTextObjectBar::GetAttrState( SfxItemSet& rDestSet )
}
else
{
- FontUnderline eUnderline = ((const SvxUnderlineItem&)
+ FontUnderline eUnderline = static_cast<const SvxUnderlineItem&>(
aAttrSet.Get(EE_CHAR_UNDERLINE)).GetLineStyle();
sal_uInt16 nId = SID_ULINE_VAL_NONE;
switch (eUnderline)
@@ -1091,7 +1091,7 @@ void ScDrawTextObjectBar::GetAttrState( SfxItemSet& rDestSet )
bLeftToRight = false;
}
else
- bLeftToRight = ( (const SvxWritingModeItem&) aAttrSet.Get( SDRATTR_TEXTDIRECTION ) ).GetValue() == com::sun::star::text::WritingMode_LR_TB;
+ bLeftToRight = static_cast<const SvxWritingModeItem&>( aAttrSet.Get( SDRATTR_TEXTDIRECTION ) ).GetValue() == com::sun::star::text::WritingMode_LR_TB;
if ( bDisableVerticalText )
{
@@ -1119,7 +1119,7 @@ void ScDrawTextObjectBar::GetAttrState( SfxItemSet& rDestSet )
}
else
{
- SvxFrameDirection eAttrDir = (SvxFrameDirection)((const SvxFrameDirectionItem&)
+ SvxFrameDirection eAttrDir = (SvxFrameDirection)static_cast<const SvxFrameDirectionItem&>(
aAttrSet.Get( EE_PARA_WRITINGDIR )).GetValue();
if ( eAttrDir == FRMDIR_ENVIRONMENT )
{
@@ -1178,7 +1178,7 @@ void ScDrawTextObjectBar::GetStatePropPanelAttr(SfxItemSet &rSet)
SfxItemState eConState = aEditAttr.GetItemState( SDRATTR_TEXT_CONTOURFRAME );
if( eConState != SfxItemState::DONTCARE )
{
- bContour = ( ( const SdrOnOffItem& )aEditAttr.Get( SDRATTR_TEXT_CONTOURFRAME ) ).GetValue();
+ bContour = static_cast<const SdrOnOffItem&>( aEditAttr.Get( SDRATTR_TEXT_CONTOURFRAME ) ).GetValue();
}
if (bContour) break;
@@ -1188,7 +1188,7 @@ void ScDrawTextObjectBar::GetStatePropPanelAttr(SfxItemSet &rSet)
//if(SfxItemState::DONTCARE != eVState && SfxItemState::DONTCARE != eHState)
if(SfxItemState::DONTCARE != eVState)
{
- SdrTextVertAdjust eTVA = (SdrTextVertAdjust)((const SdrTextVertAdjustItem&)aEditAttr.Get(SDRATTR_TEXT_VERTADJUST)).GetValue();
+ SdrTextVertAdjust eTVA = (SdrTextVertAdjust)static_cast<const SdrTextVertAdjustItem&>(aEditAttr.Get(SDRATTR_TEXT_VERTADJUST)).GetValue();
bool bSet = (nSlotId == SID_TABLE_VERT_NONE && eTVA == SDRTEXTVERTADJUST_TOP) ||
(nSlotId == SID_TABLE_VERT_CENTER && eTVA == SDRTEXTVERTADJUST_CENTER) ||
(nSlotId == SID_TABLE_VERT_BOTTOM && eTVA == SDRTEXTVERTADJUST_BOTTOM);
diff --git a/sc/source/ui/drawfunc/drtxtob2.cxx b/sc/source/ui/drawfunc/drtxtob2.cxx
index 1aaebbfc58ac..8f43c4c2b8cc 100644
--- a/sc/source/ui/drawfunc/drtxtob2.cxx
+++ b/sc/source/ui/drawfunc/drtxtob2.cxx
@@ -148,7 +148,7 @@ void ScDrawTextObjectBar::ExecuteExtra( SfxRequest &rReq )
if ( rReq.GetArgs() )
pViewFrm->SetChildWindow( nId,
- ((const SfxBoolItem&)
+ static_cast<const SfxBoolItem&>(
(rReq.GetArgs()->Get(SID_FONTWORK))).
GetValue() );
else
@@ -209,7 +209,7 @@ void ScDrawTextObjectBar::GetFormTextState(SfxItemSet& rSet)
SfxViewFrame* pViewFrm = pViewData->GetViewShell()->GetViewFrame();
if ( pViewFrm->HasChildWindow(nId) )
- pDlg = (SvxFontWorkDialog*)(pViewFrm->GetChildWindow(nId)->GetWindow());
+ pDlg = static_cast<SvxFontWorkDialog*>(pViewFrm->GetChildWindow(nId)->GetWindow());
if ( rMarkList.GetMarkCount() == 1 )
pObj = rMarkList.GetMark(0)->GetMarkedSdrObj();
@@ -250,7 +250,7 @@ void ScDrawTextObjectBar::GetFormTextState(SfxItemSet& rSet)
XColorListRef pColorList;
if ( pItem )
- pColorList = ((SvxColorListItem*)pItem)->GetColorList();
+ pColorList = static_cast<const SvxColorListItem*>(pItem)->GetColorList();
pDlg->SetActive();
diff --git a/sc/source/ui/drawfunc/fuconcustomshape.cxx b/sc/source/ui/drawfunc/fuconcustomshape.cxx
index d37d247b8ed0..e64b107a3e78 100644
--- a/sc/source/ui/drawfunc/fuconcustomshape.cxx
+++ b/sc/source/ui/drawfunc/fuconcustomshape.cxx
@@ -43,7 +43,7 @@ FuConstCustomShape::FuConstCustomShape( ScTabViewShell* pViewSh, vcl::Window* pW
const SfxItemSet* pArgs = rReq.GetArgs();
if ( pArgs )
{
- const SfxStringItem& rItm = (const SfxStringItem&)pArgs->Get( rReq.GetSlot() );
+ const SfxStringItem& rItm = static_cast<const SfxStringItem&>(pArgs->Get( rReq.GetSlot() ));
aCustomShape = rItm.GetValue();
}
}
@@ -87,7 +87,7 @@ bool FuConstCustomShape::MouseButtonDown(const MouseEvent& rMEvt)
{
SetAttributes( pObj );
bool bForceNoFillStyle = false;
- if ( ((SdrObjCustomShape*)pObj)->UseNoFillStyle() )
+ if ( static_cast<SdrObjCustomShape*>(pObj)->UseNoFillStyle() )
bForceNoFillStyle = true;
if ( bForceNoFillStyle )
pObj->SetMergedItem( XFillStyleItem( drawing::FillStyle_NONE ) );
@@ -265,7 +265,7 @@ void FuConstCustomShape::SetAttributes( SdrObject* pObj )
pObj->SetMergedItem( SdrTextVertAdjustItem( SDRTEXTVERTADJUST_CENTER ) );
pObj->SetMergedItem( SdrTextHorzAdjustItem( SDRTEXTHORZADJUST_BLOCK ) );
pObj->SetMergedItem( makeSdrTextAutoGrowHeightItem( false ) );
- ((SdrObjCustomShape*)pObj)->MergeDefaultAttributes( &aCustomShape );
+ static_cast<SdrObjCustomShape*>(pObj)->MergeDefaultAttributes( &aCustomShape );
}
}
diff --git a/sc/source/ui/drawfunc/fuconpol.cxx b/sc/source/ui/drawfunc/fuconpol.cxx
index 6265683fdd68..babcafd315e7 100644
--- a/sc/source/ui/drawfunc/fuconpol.cxx
+++ b/sc/source/ui/drawfunc/fuconpol.cxx
@@ -318,7 +318,7 @@ SdrObject* FuConstPolygon::CreateDefaultObject(const sal_uInt16 nID, const Recta
}
}
- ((SdrPathObj*)pObj)->SetPathPoly(aPoly);
+ static_cast<SdrPathObj*>(pObj)->SetPathPoly(aPoly);
}
else
{
diff --git a/sc/source/ui/drawfunc/fuconrec.cxx b/sc/source/ui/drawfunc/fuconrec.cxx
index 846de7792fd9..d0282f2abfd1 100644
--- a/sc/source/ui/drawfunc/fuconrec.cxx
+++ b/sc/source/ui/drawfunc/fuconrec.cxx
@@ -130,7 +130,7 @@ bool FuConstRectangle::MouseButtonUp(const MouseEvent& rMEvt)
SdrObject* pObj = rMarkList.GetMark(0)->GetMarkedSdrObj();
// create OutlinerParaObject now so it can be set to vertical
if ( pObj->ISA(SdrTextObj) )
- ((SdrTextObj*)pObj)->ForceOutlinerParaObject();
+ static_cast<SdrTextObj*>(pObj)->ForceOutlinerParaObject();
OutlinerParaObject* pOPO = pObj->GetOutlinerParaObject();
if( pOPO && !pOPO->IsVertical() )
pOPO->SetVertical( true );
@@ -238,7 +238,7 @@ SdrObject* FuConstRectangle::CreateDefaultObject(const sal_uInt16 nID, const Rec
basegfx::B2DPolygon aPoly;
aPoly.append(basegfx::B2DPoint(aStart.X(), nYMiddle));
aPoly.append(basegfx::B2DPoint(aEnd.X(), nYMiddle));
- ((SdrPathObj*)pObj)->SetPathPoly(basegfx::B2DPolyPolygon(aPoly));
+ static_cast<SdrPathObj*>(pObj)->SetPathPoly(basegfx::B2DPolyPolygon(aPoly));
}
else
{
@@ -254,7 +254,7 @@ SdrObject* FuConstRectangle::CreateDefaultObject(const sal_uInt16 nID, const Rec
{
bool bIsVertical(SID_DRAW_CAPTION_VERTICAL == nID);
- ((SdrTextObj*)pObj)->SetVerticalWriting(bIsVertical);
+ static_cast<SdrTextObj*>(pObj)->SetVerticalWriting(bIsVertical);
if(bIsVertical)
{
@@ -270,8 +270,8 @@ SdrObject* FuConstRectangle::CreateDefaultObject(const sal_uInt16 nID, const Rec
// String aText(ScResId(STR_CAPTION_DEFAULT_TEXT));
// ((SdrCaptionObj*)pObj)->SetText(aText);
- ((SdrCaptionObj*)pObj)->SetLogicRect(aRect);
- ((SdrCaptionObj*)pObj)->SetTailPos(
+ static_cast<SdrCaptionObj*>(pObj)->SetLogicRect(aRect);
+ static_cast<SdrCaptionObj*>(pObj)->SetTailPos(
aRect.TopLeft() - Point(aRect.GetWidth() / 2, aRect.GetHeight() / 2));
}
else
diff --git a/sc/source/ui/drawfunc/fuconstr.cxx b/sc/source/ui/drawfunc/fuconstr.cxx
index 84fdcacaf0cb..039a7c01c946 100644
--- a/sc/source/ui/drawfunc/fuconstr.cxx
+++ b/sc/source/ui/drawfunc/fuconstr.cxx
@@ -243,7 +243,7 @@ bool FuConstruct::MouseButtonUp(const MouseEvent& rMEvt)
FuPoor* pPoor = pViewShell->GetViewData().GetView()->GetDrawFuncPtr();
if ( pPoor && pPoor->GetSlotID() == nTextSlotId ) // hat keine RTTI
{
- FuText* pText = (FuText*)pPoor;
+ FuText* pText = static_cast<FuText*>(pPoor);
Point aMousePixel = rMEvt.GetPosPixel();
pText->SetInEditMode( pObj, &aMousePixel );
}
diff --git a/sc/source/ui/drawfunc/fudraw.cxx b/sc/source/ui/drawfunc/fudraw.cxx
index eb2ab21ccaae..34cea9993cd3 100644
--- a/sc/source/ui/drawfunc/fudraw.cxx
+++ b/sc/source/ui/drawfunc/fudraw.cxx
@@ -207,7 +207,7 @@ static bool lcl_KeyEditMode( SdrObject* pObj, ScTabViewShell* pViewShell, const
pPoor = pViewShell->GetViewData().GetView()->GetDrawFuncPtr();
if ( pPoor && pPoor->GetSlotID() == nTextSlotId ) // no RTTI
{
- FuText* pText = (FuText*)pPoor;
+ FuText* pText = static_cast<FuText*>(pPoor);
pText->SetInEditMode( pObj, NULL, true, pInitialKey );
//! set cursor to end of text
}
diff --git a/sc/source/ui/drawfunc/fuins1.cxx b/sc/source/ui/drawfunc/fuins1.cxx
index 3c92010345c7..e135b29fb5e8 100644
--- a/sc/source/ui/drawfunc/fuins1.cxx
+++ b/sc/source/ui/drawfunc/fuins1.cxx
@@ -159,7 +159,7 @@ static void lcl_InsertGraphic( const Graphic& rGraphic,
// Path is no longer used as name for the graphics object
- ScDrawLayer* pLayer = (ScDrawLayer*) pView->GetModel();
+ ScDrawLayer* pLayer = static_cast<ScDrawLayer*>(pView->GetModel());
OUString aName = pLayer->GetNewGraphicName(); // "Graphics"
pObj->SetName(aName);
@@ -237,15 +237,15 @@ FuInsertGraphic::FuInsertGraphic( ScTabViewShell* pViewSh,
if ( pReqArgs &&
pReqArgs->GetItemState( SID_INSERT_GRAPHIC, true, &pItem ) == SfxItemState::SET )
{
- OUString aFileName = ((const SfxStringItem*)pItem)->GetValue();
+ OUString aFileName = static_cast<const SfxStringItem*>(pItem)->GetValue();
OUString aFilterName;
if ( pReqArgs->GetItemState( FN_PARAM_FILTER, true, &pItem ) == SfxItemState::SET )
- aFilterName = ((const SfxStringItem*)pItem)->GetValue();
+ aFilterName = static_cast<const SfxStringItem*>(pItem)->GetValue();
bool bAsLink = false;
if ( pReqArgs->GetItemState( FN_PARAM_1, true, &pItem ) == SfxItemState::SET )
- bAsLink = ((const SfxBoolItem*)pItem)->GetValue();
+ bAsLink = static_cast<const SfxBoolItem*>(pItem)->GetValue();
Graphic aGraphic;
int nError = GraphicFilter::LoadGraphic( aFileName, aFilterName, aGraphic, &GraphicFilter::GetGraphicFilter() );
diff --git a/sc/source/ui/drawfunc/fuins2.cxx b/sc/source/ui/drawfunc/fuins2.cxx
index 535309bb7c01..4e88e59cdfd0 100644
--- a/sc/source/ui/drawfunc/fuins2.cxx
+++ b/sc/source/ui/drawfunc/fuins2.cxx
@@ -448,7 +448,7 @@ FuInsertChart::FuInsertChart(ScTabViewShell* pViewSh, vcl::Window* pWin, ScDrawV
{
const SfxPoolItem* pItem;
if( pReqArgs->HasItem( FN_PARAM_5, &pItem ) )
- aRangeString = OUString( ((const SfxStringItem*)pItem)->GetValue());
+ aRangeString = OUString( static_cast<const SfxStringItem*>(pItem)->GetValue());
aPositionRange = pViewSh->GetViewData().GetCurPos();
}
@@ -552,13 +552,13 @@ FuInsertChart::FuInsertChart(ScTabViewShell* pViewSh, vcl::Window* pWin, ScDrawV
if( pReqArgs->HasItem( FN_PARAM_4, &pItem ) )
{
if ( pItem->ISA( SfxUInt16Item ) )
- nToTable = ((const SfxUInt16Item*)pItem)->GetValue();
+ nToTable = static_cast<const SfxUInt16Item*>(pItem)->GetValue();
else if ( pItem->ISA( SfxBoolItem ) )
{
// in der idl fuer Basic steht FN_PARAM_4 als SfxBoolItem
// -> wenn gesetzt, neue Tabelle, sonst aktuelle Tabelle
- if ( ((const SfxBoolItem*)pItem)->GetValue() )
+ if ( static_cast<const SfxBoolItem*>(pItem)->GetValue() )
nToTable = static_cast<sal_uInt16>(rScDoc.GetTableCount());
else
nToTable = static_cast<sal_uInt16>(rData.GetTabNo());
diff --git a/sc/source/ui/drawfunc/fusel.cxx b/sc/source/ui/drawfunc/fusel.cxx
index c00b28486ff3..4d7fe591915b 100644
--- a/sc/source/ui/drawfunc/fusel.cxx
+++ b/sc/source/ui/drawfunc/fusel.cxx
@@ -527,9 +527,9 @@ bool FuSelection::MouseButtonUp(const MouseEvent& rMEvt)
{
if (!bOle)
{
- if (((SdrOle2Obj*) pObj)->GetObjRef().is())
+ if (static_cast<SdrOle2Obj*>(pObj)->GetObjRef().is())
{
- pViewShell->ActivateObject( (SdrOle2Obj*) pObj, 0 );
+ pViewShell->ActivateObject( static_cast<SdrOle2Obj*>(pObj), 0 );
}
}
}
@@ -551,7 +551,7 @@ bool FuSelection::MouseButtonUp(const MouseEvent& rMEvt)
FuPoor* pPoor = pViewShell->GetViewData().GetView()->GetDrawFuncPtr();
if ( pPoor && pPoor->GetSlotID() == nTextSlotId ) // hat keine RTTI
{
- FuText* pText = (FuText*)pPoor;
+ FuText* pText = static_cast<FuText*>(pPoor);
Point aMousePixel = rMEvt.GetPosPixel();
pText->SetInEditMode( pObj, &aMousePixel );
}
diff --git a/sc/source/ui/drawfunc/futext.cxx b/sc/source/ui/drawfunc/futext.cxx
index bfb3003257c6..e3be9577a7f2 100644
--- a/sc/source/ui/drawfunc/futext.cxx
+++ b/sc/source/ui/drawfunc/futext.cxx
@@ -94,7 +94,7 @@ static void lcl_InvalidateAttribs( SfxBindings& rBindings )
static void lcl_UpdateHyphenator( Outliner& rOutliner, SdrObject* pObj )
{
// use hyphenator only if hyphenation attribute is set
- if ( pObj && ((const SfxBoolItem&)pObj->GetMergedItem(EE_PARA_HYPHENATE)).GetValue() ) {
+ if ( pObj && static_cast<const SfxBoolItem&>(pObj->GetMergedItem(EE_PARA_HYPHENATE)).GetValue() ) {
com::sun::star::uno::Reference<com::sun::star::linguistic2::XHyphenator> xHyphenator( LinguMgr::GetHyphenator() );
rOutliner.SetHyphenator( xHyphenator );
}
@@ -486,7 +486,7 @@ bool FuText::MouseButtonUp(const MouseEvent& rMEvt)
SdrObject* pObj = rMarkList.GetMark(0)->GetMarkedSdrObj();
if(pObj && pObj->ISA(SdrTextObj))
{
- SdrTextObj* pText = (SdrTextObj*)pObj;
+ SdrTextObj* pText = static_cast<SdrTextObj*>(pObj);
SfxItemSet aSet(pDrDoc->GetItemPool());
pText->SetVerticalWriting(true);
@@ -658,7 +658,7 @@ void FuText::SelectionHasChanged()
nSdrObjKind == OBJ_OUTLINETEXT /* ||
pObj->ISA(SdrTextObj) */ )
{
- pTextObj = (SdrTextObj*) pObj;
+ pTextObj = static_cast<SdrTextObj*>(pObj);
}
}
}
@@ -738,7 +738,7 @@ void FuText::SetInEditMode(SdrObject* pObj, const Point* pMousePixel,
// EditEngine-UndoManager anmelden
pViewShell->SetDrawTextUndo( &pO->GetUndoManager() );
- pTextObj = (SdrTextObj*) pObj;
+ pTextObj = static_cast<SdrTextObj*>(pObj);
pView->SetEditMode();
// set text cursor to click position or to end,
@@ -786,7 +786,7 @@ SdrObject* FuText::CreateDefaultObject(const sal_uInt16 nID, const Rectangle& rR
{
if(pObj->ISA(SdrTextObj))
{
- SdrTextObj* pText = (SdrTextObj*)pObj;
+ SdrTextObj* pText = static_cast<SdrTextObj*>(pObj);
pText->SetLogicRect(rRectangle);
// don't set default text, start edit mode instead
diff --git a/sc/source/ui/drawfunc/graphsh.cxx b/sc/source/ui/drawfunc/graphsh.cxx
index 67e3ca4f33e6..c74431a7619d 100644
--- a/sc/source/ui/drawfunc/graphsh.cxx
+++ b/sc/source/ui/drawfunc/graphsh.cxx
@@ -54,7 +54,7 @@ public:
SdrPageView* pPageView = m_pView->GetSdrPageView();
if( pPageView )
{
- SdrGrafObj* pNewObj = (SdrGrafObj*) m_pObj->Clone();
+ SdrGrafObj* pNewObj = static_cast<SdrGrafObj*>(m_pObj->Clone());
OUString aStr = m_pView->GetDescriptionOfMarkedObjects() + " External Edit";
m_pView->BegUndo( aStr );
pNewObj->SetGraphicObject( aGraphic );
@@ -117,7 +117,7 @@ void ScGraphicShell::GetFilterState( SfxItemSet& rSet )
{
SdrObject* pObj = rMarkList.GetMark( 0 )->GetMarkedSdrObj();
- if( pObj && pObj->ISA( SdrGrafObj ) && ( ( (SdrGrafObj*) pObj )->GetGraphicType() == GRAPHIC_BITMAP ) )
+ if( pObj && pObj->ISA( SdrGrafObj ) && ( static_cast<SdrGrafObj*>(pObj)->GetGraphicType() == GRAPHIC_BITMAP ) )
bEnable = true;
}
@@ -134,9 +134,9 @@ void ScGraphicShell::ExecuteFilter( SfxRequest& rReq )
{
SdrObject* pObj = rMarkList.GetMark( 0 )->GetMarkedSdrObj();
- if( pObj && pObj->ISA( SdrGrafObj ) && ( (SdrGrafObj*) pObj )->GetGraphicType() == GRAPHIC_BITMAP )
+ if( pObj && pObj->ISA( SdrGrafObj ) && static_cast<SdrGrafObj*>(pObj)->GetGraphicType() == GRAPHIC_BITMAP )
{
- GraphicObject aFilterObj( ( (SdrGrafObj*) pObj )->GetGraphicObject() );
+ GraphicObject aFilterObj( static_cast<SdrGrafObj*>(pObj)->GetGraphicObject() );
if( SVX_GRAPHICFILTER_ERRCODE_NONE ==
SvxGraphicFilter::ExecuteGrfFilterSlot( rReq, aFilterObj ) )
@@ -145,7 +145,7 @@ void ScGraphicShell::ExecuteFilter( SfxRequest& rReq )
if( pPageView )
{
- SdrGrafObj* pFilteredObj = (SdrGrafObj*) pObj->Clone();
+ SdrGrafObj* pFilteredObj = static_cast<SdrGrafObj*>(pObj->Clone());
OUString aStr = pView->GetDescriptionOfMarkedObjects() + " " + OUString(ScResId( SCSTR_UNDO_GRAFFILTER ));
pView->BegUndo( aStr );
pFilteredObj->SetGraphicObject( aFilterObj );
@@ -168,7 +168,7 @@ void ScGraphicShell::GetExternalEditState( SfxItemSet& rSet )
{
SdrObject* pObj = rMarkList.GetMark( 0 )->GetMarkedSdrObj();
- if( pObj && pObj->ISA( SdrGrafObj ) && ( ( (SdrGrafObj*) pObj )->GetGraphicType() == GRAPHIC_BITMAP ) )
+ if( pObj && pObj->ISA( SdrGrafObj ) && ( static_cast<SdrGrafObj*>(pObj)->GetGraphicType() == GRAPHIC_BITMAP ) )
bEnable = true;
}
@@ -185,9 +185,9 @@ void ScGraphicShell::ExecuteExternalEdit( SfxRequest& )
{
SdrObject* pObj = rMarkList.GetMark( 0 )->GetMarkedSdrObj();
- if( pObj && pObj->ISA( SdrGrafObj ) && ( (SdrGrafObj*) pObj )->GetGraphicType() == GRAPHIC_BITMAP )
+ if( pObj && pObj->ISA( SdrGrafObj ) && static_cast<SdrGrafObj*>(pObj)->GetGraphicType() == GRAPHIC_BITMAP )
{
- GraphicObject aGraphicObject( ( (SdrGrafObj*) pObj )->GetGraphicObject() );
+ GraphicObject aGraphicObject( static_cast<SdrGrafObj*>(pObj)->GetGraphicObject() );
ScExternalToolEdit* aExternalToolEdit = new ScExternalToolEdit( pView, pObj );
aExternalToolEdit->Edit( &aGraphicObject );
}
@@ -205,7 +205,7 @@ void ScGraphicShell::GetCompressGraphicState( SfxItemSet& rSet )
{
SdrObject* pObj = rMarkList.GetMark( 0 )->GetMarkedSdrObj();
- if( pObj && pObj->ISA( SdrGrafObj ) && ( ( (SdrGrafObj*) pObj )->GetGraphicType() == GRAPHIC_BITMAP ) )
+ if( pObj && pObj->ISA( SdrGrafObj ) && ( static_cast<SdrGrafObj*>(pObj)->GetGraphicType() == GRAPHIC_BITMAP ) )
bEnable = true;
}
@@ -222,9 +222,9 @@ void ScGraphicShell::ExecuteCompressGraphic( SfxRequest& )
{
SdrObject* pObj = rMarkList.GetMark( 0 )->GetMarkedSdrObj();
- if( pObj && pObj->ISA( SdrGrafObj ) && ( (SdrGrafObj*) pObj )->GetGraphicType() == GRAPHIC_BITMAP )
+ if( pObj && pObj->ISA( SdrGrafObj ) && static_cast<SdrGrafObj*>(pObj)->GetGraphicType() == GRAPHIC_BITMAP )
{
- SdrGrafObj* pGraphicObj = (SdrGrafObj*) pObj;
+ SdrGrafObj* pGraphicObj = static_cast<SdrGrafObj*>(pObj);
CompressGraphicsDialog dialog( GetViewData()->GetDialogParent(), pGraphicObj, GetViewData()->GetBindings() );
if ( dialog.Execute() == RET_OK )
{
diff --git a/sc/source/ui/formdlg/formula.cxx b/sc/source/ui/formdlg/formula.cxx
index 2a294fb2448c..b483bd3dc42e 100644
--- a/sc/source/ui/formdlg/formula.cxx
+++ b/sc/source/ui/formdlg/formula.cxx
@@ -93,11 +93,11 @@ ScFormulaDlg::ScFormulaDlg( SfxBindings* pB, SfxChildWindow* pCW,
if ( pDoc == NULL )
pDoc = pViewData->GetDocument();
- m_xParser.set(ScServiceProvider::MakeInstance(SC_SERVICE_FORMULAPARS,(ScDocShell*)pDoc->GetDocumentShell()),uno::UNO_QUERY);
+ m_xParser.set(ScServiceProvider::MakeInstance(SC_SERVICE_FORMULAPARS, static_cast<ScDocShell*>(pDoc->GetDocumentShell())),uno::UNO_QUERY);
uno::Reference< beans::XPropertySet> xSet(m_xParser,uno::UNO_QUERY);
xSet->setPropertyValue(OUString(SC_UNO_COMPILEFAP),uno::makeAny(sal_True));
- m_xOpCodeMapper.set(ScServiceProvider::MakeInstance(SC_SERVICE_OPCODEMAPPER,(ScDocShell*)pDoc->GetDocumentShell()),uno::UNO_QUERY);
+ m_xOpCodeMapper.set(ScServiceProvider::MakeInstance(SC_SERVICE_OPCODEMAPPER, static_cast<ScDocShell*>(pDoc->GetDocumentShell())),uno::UNO_QUERY);
ScInputHandler* pInputHdl = SC_MOD()->GetInputHdl(pScViewShell);
@@ -263,7 +263,7 @@ bool ScFormulaDlg::IsInputHdl(ScInputHandler* pHdl)
SfxViewShell* pSh = SfxViewShell::GetFirst( &aScType );
while ( pSh && !bAlive )
{
- if (((ScTabViewShell*)pSh)->GetInputHandler() == pHdl)
+ if (static_cast<ScTabViewShell*>(pSh)->GetInputHandler() == pHdl)
bAlive = true;
pSh = SfxViewShell::GetNext( *pSh, &aScType );
}
@@ -443,7 +443,7 @@ bool ScFormulaDlg::IsDocAllowed(SfxObjectShell* pDocSh) const
{
// not allowed: different from this doc, and no name
// pDocSh is always a ScDocShell
- if ( pDocSh && &((ScDocShell*)pDocSh)->GetDocument() != pDoc && !pDocSh->HasName() )
+ if ( pDocSh && &static_cast<ScDocShell*>(pDocSh)->GetDocument() != pDoc && !pDocSh->HasName() )
return false;
return true; // everything else is allowed
diff --git a/sc/source/ui/miscdlgs/acredlin.cxx b/sc/source/ui/miscdlgs/acredlin.cxx
index 36758e5fdde1..8614e813bec7 100644
--- a/sc/source/ui/miscdlgs/acredlin.cxx
+++ b/sc/source/ui/miscdlgs/acredlin.cxx
@@ -865,7 +865,7 @@ IMPL_LINK_NOARG(ScAcceptChgDlg, RefHandle)
SC_MOD()->SetRefDialog( nId, true );
SfxViewFrame* pViewFrm = pViewData->GetViewShell()->GetViewFrame();
- ScSimpleRefDlgWrapper* pWnd =(ScSimpleRefDlgWrapper*)pViewFrm->GetChildWindow( nId );
+ ScSimpleRefDlgWrapper* pWnd = static_cast<ScSimpleRefDlgWrapper*>(pViewFrm->GetChildWindow( nId ));
if(pWnd!=NULL)
{
@@ -896,7 +896,7 @@ IMPL_LINK( ScAcceptChgDlg, RefInfoHandle, OUString*, pResult)
FilterHandle(pTPFilter);
nId = ScSimpleRefDlgWrapper::GetChildWindowId();
- ScSimpleRefDlgWrapper* pWnd = (ScSimpleRefDlgWrapper*)pViewFrm->GetChildWindow( nId );
+ ScSimpleRefDlgWrapper* pWnd = static_cast<ScSimpleRefDlgWrapper*>(pViewFrm->GetChildWindow( nId ));
if(pWnd!=NULL)
{
@@ -1146,7 +1146,7 @@ bool ScAcceptChgDlg::InsertContentChildren(ScChangeActionMap* pActionMap,SvTreeL
// content (original value) but insert the predecessor of the MatrixOrigin
// itself instead.
if ( pScChangeAction->GetType() == SC_CAT_CONTENT &&
- ((const ScChangeActionContent*)pScChangeAction)->IsMatrixOrigin() )
+ static_cast<const ScChangeActionContent*>(pScChangeAction)->IsMatrixOrigin() )
{
pActionMap->insert( ::std::make_pair( pScChangeAction->GetActionNumber(),
const_cast<ScChangeAction*>( pScChangeAction ) ) );
@@ -1194,8 +1194,8 @@ bool ScAcceptChgDlg::InsertContentChildren(ScChangeActionMap* pActionMap,SvTreeL
if ( !bParentInserted )
{
- pEntry=InsertChangeActionContent((const ScChangeActionContent*)
- pScChangeAction,pParent,RD_SPECIAL_NONE);
+ pEntry=InsertChangeActionContent(static_cast<const ScChangeActionContent*>(
+ pScChangeAction),pParent,RD_SPECIAL_NONE);
if(pEntry!=NULL)
{
@@ -1934,8 +1934,8 @@ IMPL_LINK( ScAcceptChgDlg, ColCompareHdl, SvSortData*, pSortData )
nLeftKind == SV_ITEM_ID_LBOXSTRING )
{
nCompare = ScGlobal::GetCaseCollator()->compareString(
- ((SvLBoxString*)pLeftItem)->GetText(),
- ((SvLBoxString*)pRightItem)->GetText());
+ static_cast<SvLBoxString*>(pLeftItem)->GetText(),
+ static_cast<SvLBoxString*>(pRightItem)->GetText());
if (nCompare == 0)
nCompare = -1;
diff --git a/sc/source/ui/miscdlgs/anyrefdg.cxx b/sc/source/ui/miscdlgs/anyrefdg.cxx
index 3de5d0532c12..59387d044e98 100644
--- a/sc/source/ui/miscdlgs/anyrefdg.cxx
+++ b/sc/source/ui/miscdlgs/anyrefdg.cxx
@@ -81,7 +81,7 @@ ScFormulaReferenceHelper::~ScFormulaReferenceHelper()
void ScFormulaReferenceHelper::enableInput( bool bEnable )
{
TypeId aType(TYPE(ScDocShell));
- ScDocShell* pDocShell = (ScDocShell*)SfxObjectShell::GetFirst(&aType);
+ ScDocShell* pDocShell = static_cast<ScDocShell*>(SfxObjectShell::GetFirst(&aType));
while( pDocShell )
{
SfxViewFrame* pFrame = SfxViewFrame::GetFirst( pDocShell );
@@ -110,7 +110,7 @@ void ScFormulaReferenceHelper::enableInput( bool bEnable )
pFrame = SfxViewFrame::GetNext( *pFrame, pDocShell );
}
- pDocShell = (ScDocShell*)SfxObjectShell::GetNext(*pDocShell, &aType);
+ pDocShell = static_cast<ScDocShell*>(SfxObjectShell::GetNext(*pDocShell, &aType));
}
}
@@ -622,7 +622,7 @@ bool ScFormulaReferenceHelper::DoClose( sal_uInt16 nId )
SfxChildWindow* pChild = pViewFrm->GetChildWindow(FID_INPUTLINE_STATUS);
if (pChild)
{
- ScInputWindow* pWin = (ScInputWindow*)pChild->GetWindow();
+ ScInputWindow* pWin = static_cast<ScInputWindow*>(pChild->GetWindow());
pWin->Enable();
}
}
@@ -650,7 +650,7 @@ void ScFormulaReferenceHelper::SetDispatcherLock( bool bLock )
// lock / unlock only the dispatchers of Calc documents
TypeId aType(TYPE(ScDocShell));
- ScDocShell* pDocShell = (ScDocShell*)SfxObjectShell::GetFirst(&aType);
+ ScDocShell* pDocShell = static_cast<ScDocShell*>(SfxObjectShell::GetFirst(&aType));
while( pDocShell )
{
SfxViewFrame* pFrame = SfxViewFrame::GetFirst( pDocShell );
@@ -662,7 +662,7 @@ void ScFormulaReferenceHelper::SetDispatcherLock( bool bLock )
pFrame = SfxViewFrame::GetNext( *pFrame, pDocShell );
}
- pDocShell = (ScDocShell*)SfxObjectShell::GetNext(*pDocShell, &aType);
+ pDocShell = static_cast<ScDocShell*>(SfxObjectShell::GetNext(*pDocShell, &aType));
}
// if a new view is created while the dialog is open,
@@ -679,7 +679,7 @@ void ScFormulaReferenceHelper::ViewShellChanged()
void ScFormulaReferenceHelper::EnableSpreadsheets(bool bFlag, bool bChildren)
{
TypeId aType(TYPE(ScDocShell));
- ScDocShell* pDocShell = (ScDocShell*)SfxObjectShell::GetFirst(&aType);
+ ScDocShell* pDocShell = static_cast<ScDocShell*>(SfxObjectShell::GetFirst(&aType));
while( pDocShell )
{
SfxViewFrame* pFrame = SfxViewFrame::GetFirst( pDocShell );
@@ -708,14 +708,14 @@ void ScFormulaReferenceHelper::EnableSpreadsheets(bool bFlag, bool bChildren)
pFrame = SfxViewFrame::GetNext( *pFrame, pDocShell );
}
- pDocShell = (ScDocShell*)SfxObjectShell::GetNext(*pDocShell, &aType);
+ pDocShell = static_cast<ScDocShell*>(SfxObjectShell::GetNext(*pDocShell, &aType));
}
}
static void lcl_InvalidateWindows()
{
TypeId aType(TYPE(ScDocShell));
- ScDocShell* pDocShell = (ScDocShell*)SfxObjectShell::GetFirst(&aType);
+ ScDocShell* pDocShell = static_cast<ScDocShell*>(SfxObjectShell::GetFirst(&aType));
while( pDocShell )
{
SfxViewFrame* pFrame = SfxViewFrame::GetFirst( pDocShell );
@@ -740,7 +740,7 @@ static void lcl_InvalidateWindows()
pFrame = SfxViewFrame::GetNext( *pFrame, pDocShell );
}
- pDocShell = (ScDocShell*)SfxObjectShell::GetNext(*pDocShell, &aType);
+ pDocShell = static_cast<ScDocShell*>(SfxObjectShell::GetNext(*pDocShell, &aType));
}
}
@@ -750,7 +750,7 @@ static void lcl_HideAllReferences()
SfxViewShell* pSh = SfxViewShell::GetFirst( &aScType );
while ( pSh )
{
- ((ScTabViewShell*)pSh)->ClearHighlightRanges();
+ static_cast<ScTabViewShell*>(pSh)->ClearHighlightRanges();
pSh = SfxViewShell::GetNext( *pSh, &aScType );
}
}
@@ -869,7 +869,7 @@ void ScRefHandler::SwitchToDocument()
if ( pObjSh && pObjSh->GetTitle() == aDocName )
{
// switch to first TabViewShell for document
- ((ScTabViewShell*)pSh)->SetActive();
+ static_cast<ScTabViewShell*>(pSh)->SetActive();
return;
}
pSh = SfxViewShell::GetNext( *pSh, &aScType );
diff --git a/sc/source/ui/miscdlgs/autofmt.cxx b/sc/source/ui/miscdlgs/autofmt.cxx
index 5c42f6644f44..2e24fce04f80 100644
--- a/sc/source/ui/miscdlgs/autofmt.cxx
+++ b/sc/source/ui/miscdlgs/autofmt.cxx
@@ -115,21 +115,21 @@ void ScAutoFmtPreview::MakeFonts( sal_uInt16 nIndex, vcl::Font& rFont, vcl::Font
rFont = rCJKFont = rCTLFont = GetFont();
Size aFontSize( rFont.GetSize().Width(), 10 * GetDPIScaleFactor() );
- const SvxFontItem* pFontItem = (const SvxFontItem*) pCurData->GetItem( nIndex, ATTR_FONT );
- const SvxWeightItem* pWeightItem = (const SvxWeightItem*) pCurData->GetItem( nIndex, ATTR_FONT_WEIGHT );
- const SvxPostureItem* pPostureItem = (const SvxPostureItem*) pCurData->GetItem( nIndex, ATTR_FONT_POSTURE );
- const SvxFontItem* pCJKFontItem = (const SvxFontItem*) pCurData->GetItem( nIndex, ATTR_CJK_FONT );
- const SvxWeightItem* pCJKWeightItem = (const SvxWeightItem*) pCurData->GetItem( nIndex, ATTR_CJK_FONT_WEIGHT );
- const SvxPostureItem* pCJKPostureItem = (const SvxPostureItem*) pCurData->GetItem( nIndex, ATTR_CJK_FONT_POSTURE );
- const SvxFontItem* pCTLFontItem = (const SvxFontItem*) pCurData->GetItem( nIndex, ATTR_CTL_FONT );
- const SvxWeightItem* pCTLWeightItem = (const SvxWeightItem*) pCurData->GetItem( nIndex, ATTR_CTL_FONT_WEIGHT );
- const SvxPostureItem* pCTLPostureItem = (const SvxPostureItem*) pCurData->GetItem( nIndex, ATTR_CTL_FONT_POSTURE );
- const SvxUnderlineItem* pUnderlineItem = (const SvxUnderlineItem*) pCurData->GetItem( nIndex, ATTR_FONT_UNDERLINE );
- const SvxOverlineItem* pOverlineItem = (const SvxOverlineItem*) pCurData->GetItem( nIndex, ATTR_FONT_OVERLINE );
- const SvxCrossedOutItem* pCrossedOutItem = (const SvxCrossedOutItem*)pCurData->GetItem( nIndex, ATTR_FONT_CROSSEDOUT );
- const SvxContourItem* pContourItem = (const SvxContourItem*) pCurData->GetItem( nIndex, ATTR_FONT_CONTOUR );
- const SvxShadowedItem* pShadowedItem = (const SvxShadowedItem*) pCurData->GetItem( nIndex, ATTR_FONT_SHADOWED );
- const SvxColorItem* pColorItem = (const SvxColorItem*) pCurData->GetItem( nIndex, ATTR_FONT_COLOR );
+ const SvxFontItem* pFontItem = static_cast<const SvxFontItem*> (pCurData->GetItem( nIndex, ATTR_FONT ));
+ const SvxWeightItem* pWeightItem = static_cast<const SvxWeightItem*> (pCurData->GetItem( nIndex, ATTR_FONT_WEIGHT ));
+ const SvxPostureItem* pPostureItem = static_cast<const SvxPostureItem*> (pCurData->GetItem( nIndex, ATTR_FONT_POSTURE ));
+ const SvxFontItem* pCJKFontItem = static_cast<const SvxFontItem*> (pCurData->GetItem( nIndex, ATTR_CJK_FONT ));
+ const SvxWeightItem* pCJKWeightItem = static_cast<const SvxWeightItem*> (pCurData->GetItem( nIndex, ATTR_CJK_FONT_WEIGHT ));
+ const SvxPostureItem* pCJKPostureItem = static_cast<const SvxPostureItem*> (pCurData->GetItem( nIndex, ATTR_CJK_FONT_POSTURE ));
+ const SvxFontItem* pCTLFontItem = static_cast<const SvxFontItem*> (pCurData->GetItem( nIndex, ATTR_CTL_FONT ));
+ const SvxWeightItem* pCTLWeightItem = static_cast<const SvxWeightItem*> (pCurData->GetItem( nIndex, ATTR_CTL_FONT_WEIGHT ));
+ const SvxPostureItem* pCTLPostureItem = static_cast<const SvxPostureItem*> (pCurData->GetItem( nIndex, ATTR_CTL_FONT_POSTURE ));
+ const SvxUnderlineItem* pUnderlineItem = static_cast<const SvxUnderlineItem*> (pCurData->GetItem( nIndex, ATTR_FONT_UNDERLINE ));
+ const SvxOverlineItem* pOverlineItem = static_cast<const SvxOverlineItem*> (pCurData->GetItem( nIndex, ATTR_FONT_OVERLINE ));
+ const SvxCrossedOutItem* pCrossedOutItem = static_cast<const SvxCrossedOutItem*>(pCurData->GetItem( nIndex, ATTR_FONT_CROSSEDOUT ));
+ const SvxContourItem* pContourItem = static_cast<const SvxContourItem*> (pCurData->GetItem( nIndex, ATTR_FONT_CONTOUR ));
+ const SvxShadowedItem* pShadowedItem = static_cast<const SvxShadowedItem*> (pCurData->GetItem( nIndex, ATTR_FONT_SHADOWED ));
+ const SvxColorItem* pColorItem = static_cast<const SvxColorItem*> (pCurData->GetItem( nIndex, ATTR_FONT_COLOR ));
lcl_SetFontProperties( rFont, *pFontItem, *pWeightItem, *pPostureItem );
lcl_SetFontProperties( rCJKFont, *pCJKFontItem, *pCJKWeightItem, *pCJKPostureItem );
@@ -254,7 +254,7 @@ void ScAutoFmtPreview::DrawString( size_t nCol, size_t nRow )
// Justification:
eJustification = mbRTL ? SVX_HOR_JUSTIFY_RIGHT : bJustify ?
- (SvxCellHorJustify)(((const SvxHorJustifyItem*)pCurData->GetItem( nFmtIndex, ATTR_HOR_JUSTIFY ))->GetValue()) :
+ (SvxCellHorJustify)(static_cast<const SvxHorJustifyItem*>(pCurData->GetItem( nFmtIndex, ATTR_HOR_JUSTIFY ))->GetValue()) :
SVX_HOR_JUSTIFY_STANDARD;
if ( pCurData->GetIncludeFont() )
diff --git a/sc/source/ui/miscdlgs/crnrdlg.cxx b/sc/source/ui/miscdlgs/crnrdlg.cxx
index b366587e3f0d..6510dc13290e 100644
--- a/sc/source/ui/miscdlgs/crnrdlg.cxx
+++ b/sc/source/ui/miscdlgs/crnrdlg.cxx
@@ -354,7 +354,7 @@ void ScColRowNameRangesDlg::UpdateNames()
aString += ScGlobal::GetRscString( STR_COLUMN );
aString += strDelim;
nPos = pLbRange->InsertEntry( aString );
- pLbRange->SetEntryData( nPos, (void*)nEntryDataDelim );
+ pLbRange->SetEntryData( nPos, reinterpret_cast<void*>(nEntryDataDelim) );
if ( (nCount = xColNameRanges->size()) > 0 )
{
boost::scoped_array<ScRangePair*> ppSortArray(xColNameRanges->CreateNameSortedArray(
@@ -390,14 +390,14 @@ void ScColRowNameRangesDlg::UpdateNames()
aInsStr += strShow;
nPos = pLbRange->InsertEntry( aInsStr );
aRangeMap.insert( NameRangeMap::value_type(aInsStr, aRange) );
- pLbRange->SetEntryData( nPos, (void*)nEntryDataCol );
+ pLbRange->SetEntryData( nPos, reinterpret_cast<void*>(nEntryDataCol) );
}
}
aString = strDelim;
aString += ScGlobal::GetRscString( STR_ROW );
aString += strDelim;
nPos = pLbRange->InsertEntry( aString );
- pLbRange->SetEntryData( nPos, (void*)nEntryDataDelim );
+ pLbRange->SetEntryData( nPos, reinterpret_cast<void*>(nEntryDataDelim) );
if ( (nCount = xRowNameRanges->size()) > 0 )
{
boost::scoped_array<ScRangePair*> ppSortArray(xRowNameRanges->CreateNameSortedArray(
@@ -431,7 +431,7 @@ void ScColRowNameRangesDlg::UpdateNames()
aInsStr += strShow;
nPos = pLbRange->InsertEntry( aInsStr );
aRangeMap.insert( NameRangeMap::value_type(aInsStr, aRange) );
- pLbRange->SetEntryData( nPos, (void*)nEntryDataRow );
+ pLbRange->SetEntryData( nPos, reinterpret_cast<void*>(nEntryDataRow) );
}
}
@@ -568,7 +568,7 @@ IMPL_LINK_NOARG(ScColRowNameRangesDlg, RemoveBtnHdl)
OUString aRangeStr = pLbRange->GetSelectEntry();
sal_uInt16 nSelectPos = pLbRange->GetSelectEntryPos();
bool bColName =
- ((sal_uLong)pLbRange->GetEntryData( nSelectPos ) == nEntryDataCol);
+ (reinterpret_cast<sal_uLong>(pLbRange->GetEntryData( nSelectPos )) == nEntryDataCol);
NameRangeMap::const_iterator itr = aRangeMap.find(aRangeStr);
if (itr == aRangeMap.end())
return 0;
@@ -607,7 +607,7 @@ IMPL_LINK_NOARG(ScColRowNameRangesDlg, RemoveBtnHdl)
}
pLbRange->SelectEntryPos( nSelectPos );
if ( nSelectPos &&
- (sal_uLong)pLbRange->GetEntryData( nSelectPos ) == nEntryDataDelim )
+ reinterpret_cast<sal_uLong>(pLbRange->GetEntryData( nSelectPos )) == nEntryDataDelim )
pLbRange->SelectEntryPos( --nSelectPos ); // ---Row---
pLbRange->GrabFocus();
@@ -631,7 +631,7 @@ IMPL_LINK_NOARG(ScColRowNameRangesDlg, Range1SelectHdl)
sal_uInt16 nCnt = pLbRange->GetEntryCount();
sal_uInt16 nMoves = 0;
while ( nSelectPos < nCnt
- && (sal_uLong)pLbRange->GetEntryData( nSelectPos ) == nEntryDataDelim )
+ && reinterpret_cast<sal_uLong>(pLbRange->GetEntryData( nSelectPos )) == nEntryDataDelim )
{ // skip Delimiter
++nMoves;
pLbRange->SelectEntryPos( ++nSelectPos );
@@ -658,7 +658,7 @@ IMPL_LINK_NOARG(ScColRowNameRangesDlg, Range1SelectHdl)
if ( itr != aRangeMap.end() )
{
bool bColName =
- ((sal_uLong)pLbRange->GetEntryData( nSelectPos ) == nEntryDataCol);
+ (reinterpret_cast<sal_uLong>(pLbRange->GetEntryData( nSelectPos )) == nEntryDataCol);
UpdateRangeData( itr->second, bColName );
pBtnAdd->Disable();
pBtnRemove->Enable();
diff --git a/sc/source/ui/miscdlgs/scuiautofmt.cxx b/sc/source/ui/miscdlgs/scuiautofmt.cxx
index 8734356c4dc3..b55b722294c0 100644
--- a/sc/source/ui/miscdlgs/scuiautofmt.cxx
+++ b/sc/source/ui/miscdlgs/scuiautofmt.cxx
@@ -165,7 +165,7 @@ IMPL_LINK_NOARG_INLINE_END(ScAutoFormatDlg, DblClkHdl)
IMPL_LINK( ScAutoFormatDlg, CheckHdl, Button *, pBtn )
{
ScAutoFormatData* pData = pFormat->findByIndex(nIndex);
- bool bCheck = ((CheckBox*)pBtn)->IsChecked();
+ bool bCheck = static_cast<CheckBox*>(pBtn)->IsChecked();
if ( pBtn == m_pBtnNumFormat )
pData->SetIncludeValueFormat( bCheck );
diff --git a/sc/source/ui/miscdlgs/tabbgcolordlg.cxx b/sc/source/ui/miscdlgs/tabbgcolordlg.cxx
index 44e8503ac125..985821eb0bff 100644
--- a/sc/source/ui/miscdlgs/tabbgcolordlg.cxx
+++ b/sc/source/ui/miscdlgs/tabbgcolordlg.cxx
@@ -75,7 +75,7 @@ void ScTabBgColorDlg::FillColorValueSets_Impl()
OSL_ENSURE( pDocSh, "DocShell not found!" );
if ( pDocSh && ( 0 != ( pItem = pDocSh->GetItem(SID_COLOR_TABLE) ) ) )
- pColorList = ( (SvxColorListItem*)pItem )->GetColorList();
+ pColorList = static_cast<const SvxColorListItem*>(pItem)->GetColorList();
if ( !pColorList.is() )
pColorList = XColorList::CreateStdColorList();
diff --git a/sc/source/ui/miscdlgs/textdlgs.cxx b/sc/source/ui/miscdlgs/textdlgs.cxx
index 4051d3ff3761..478a37bb901b 100644
--- a/sc/source/ui/miscdlgs/textdlgs.cxx
+++ b/sc/source/ui/miscdlgs/textdlgs.cxx
@@ -49,7 +49,7 @@ void ScCharDlg::PageCreated( sal_uInt16 nId, SfxTabPage &rPage )
SfxAllItemSet aSet(*(GetInputSetImpl()->GetPool()));
if (nId == m_nNamePageId)
{
- SvxFontListItem aItem(*( (const SvxFontListItem*)
+ SvxFontListItem aItem(*static_cast<const SvxFontListItem*>(
( rDocShell.GetItem( SID_ATTR_CHAR_FONTLIST) ) ) );
aSet.Put (SvxFontListItem( aItem.GetFontList(), SID_ATTR_CHAR_FONTLIST));