summaryrefslogtreecommitdiff
path: root/sc
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2014-10-23 08:57:36 +0200
committerNoel Grandin <noel@peralex.com>2014-10-23 12:36:16 +0200
commitfeba02c3a408c34b3b4e203167ea7094efbe7449 (patch)
treedbb858c473beb95f85f4a6a35fab70d76077083b /sc
parent6a097a7d964a22fbff8bfa9552c77b11447691bb (diff)
loplugin: cstylecast
Change-Id: I71cdd9154a8a5955e2915858cec33ec4e9ef4987
Diffstat (limited to 'sc')
-rw-r--r--sc/source/ui/Accessibility/AccessibleCell.cxx4
-rw-r--r--sc/source/ui/Accessibility/AccessibleCellBase.cxx2
-rw-r--r--sc/source/ui/Accessibility/AccessiblePreviewCell.cxx4
-rw-r--r--sc/source/ui/Accessibility/AccessiblePreviewTable.cxx8
-rw-r--r--sc/source/ui/Accessibility/AccessibleText.cxx10
-rw-r--r--sc/source/ui/app/client.cxx4
-rw-r--r--sc/source/ui/app/drwtrans.cxx12
-rw-r--r--sc/source/ui/app/inputhdl.cxx14
-rw-r--r--sc/source/ui/app/inputwin.cxx8
-rw-r--r--sc/source/ui/app/scmod.cxx74
-rw-r--r--sc/source/ui/app/seltrans.cxx2
-rw-r--r--sc/source/ui/app/transobj.cxx4
-rw-r--r--sc/source/ui/app/uiitems.cxx24
-rw-r--r--sc/source/ui/cctrl/tbzoomsliderctrl.cxx2
14 files changed, 86 insertions, 86 deletions
diff --git a/sc/source/ui/Accessibility/AccessibleCell.cxx b/sc/source/ui/Accessibility/AccessibleCell.cxx
index aff5ba2a3774..6ad4cc2faebc 100644
--- a/sc/source/ui/Accessibility/AccessibleCell.cxx
+++ b/sc/source/ui/Accessibility/AccessibleCell.cxx
@@ -588,8 +588,8 @@ bool ScAccessibleCell::IsDropdown()
if( pData && pData->HasSelectionList() )
return true;
}
- ScMergeFlagAttr* pAttr;
- pAttr = static_cast<ScMergeFlagAttr*>(mpDoc->GetAttr( nPosX, nPosY, nTab, ATTR_MERGE_FLAG ));
+ const ScMergeFlagAttr* pAttr;
+ pAttr = static_cast<const ScMergeFlagAttr*>(mpDoc->GetAttr( nPosX, nPosY, nTab, ATTR_MERGE_FLAG ));
if( pAttr->HasAutoFilter() )
{
return true;
diff --git a/sc/source/ui/Accessibility/AccessibleCellBase.cxx b/sc/source/ui/Accessibility/AccessibleCellBase.cxx
index 4295f68398b2..7024fe57f311 100644
--- a/sc/source/ui/Accessibility/AccessibleCellBase.cxx
+++ b/sc/source/ui/Accessibility/AccessibleCellBase.cxx
@@ -256,7 +256,7 @@ sal_Bool SAL_CALL
}
if (IsEditable(xParentStates))
{
- ScDocShell* pDocShell = (ScDocShell*) mpDoc->GetDocumentShell();
+ ScDocShell* pDocShell = static_cast<ScDocShell*>(mpDoc->GetDocumentShell());
bResult = pDocShell->GetDocFunc().SetValueCell(maCellAddress, fValue, false);
}
}
diff --git a/sc/source/ui/Accessibility/AccessiblePreviewCell.cxx b/sc/source/ui/Accessibility/AccessiblePreviewCell.cxx
index b6f2dd557df4..df7fb5749e5e 100644
--- a/sc/source/ui/Accessibility/AccessiblePreviewCell.cxx
+++ b/sc/source/ui/Accessibility/AccessiblePreviewCell.cxx
@@ -271,8 +271,8 @@ bool ScAccessiblePreviewCell::IsOpaque(
bool bOpaque(true);
if (mpDoc)
{
- const SvxBrushItem* pItem = (const SvxBrushItem*)mpDoc->GetAttr(
- maCellAddress.Col(), maCellAddress.Row(), maCellAddress.Tab(), ATTR_BACKGROUND);
+ const SvxBrushItem* pItem = static_cast<const SvxBrushItem*>(mpDoc->GetAttr(
+ maCellAddress.Col(), maCellAddress.Row(), maCellAddress.Tab(), ATTR_BACKGROUND));
if (pItem)
bOpaque = pItem->GetColor() != COL_TRANSPARENT;
}
diff --git a/sc/source/ui/Accessibility/AccessiblePreviewTable.cxx b/sc/source/ui/Accessibility/AccessiblePreviewTable.cxx
index f8cda3b2e754..b1d1b5bb26e9 100644
--- a/sc/source/ui/Accessibility/AccessiblePreviewTable.cxx
+++ b/sc/source/ui/Accessibility/AccessiblePreviewTable.cxx
@@ -204,8 +204,8 @@ sal_Int32 SAL_CALL ScAccessiblePreviewTable::getAccessibleRowExtentAt( sal_Int32
else
{
ScDocument& rDoc = mpViewShell->GetDocument();
- const ScMergeAttr* pItem = (const ScMergeAttr*)rDoc.GetAttr(
- static_cast<SCCOL>(rColInfo.nDocIndex), static_cast<SCROW>(rRowInfo.nDocIndex), mpTableInfo->GetTab(), ATTR_MERGE );
+ const ScMergeAttr* pItem = static_cast<const ScMergeAttr*>(rDoc.GetAttr(
+ static_cast<SCCOL>(rColInfo.nDocIndex), static_cast<SCROW>(rRowInfo.nDocIndex), mpTableInfo->GetTab(), ATTR_MERGE ));
if ( pItem && pItem->GetRowMerge() > 0 )
nRows = pItem->GetRowMerge();
}
@@ -238,8 +238,8 @@ sal_Int32 SAL_CALL ScAccessiblePreviewTable::getAccessibleColumnExtentAt( sal_In
else
{
ScDocument& rDoc = mpViewShell->GetDocument();
- const ScMergeAttr* pItem = (const ScMergeAttr*)rDoc.GetAttr(
- static_cast<SCCOL>(rColInfo.nDocIndex), static_cast<SCROW>(rRowInfo.nDocIndex), mpTableInfo->GetTab(), ATTR_MERGE );
+ const ScMergeAttr* pItem = static_cast<const ScMergeAttr*>(rDoc.GetAttr(
+ static_cast<SCCOL>(rColInfo.nDocIndex), static_cast<SCROW>(rRowInfo.nDocIndex), mpTableInfo->GetTab(), ATTR_MERGE ));
if ( pItem && pItem->GetColMerge() > 0 )
nColumns = pItem->GetColMerge();
}
diff --git a/sc/source/ui/Accessibility/AccessibleText.cxx b/sc/source/ui/Accessibility/AccessibleText.cxx
index 9a602834b8a7..94b283352bc6 100644
--- a/sc/source/ui/Accessibility/AccessibleText.cxx
+++ b/sc/source/ui/Accessibility/AccessibleText.cxx
@@ -1303,7 +1303,7 @@ ScDocShell* ScAccessiblePreviewCellTextData::GetDocShell(ScPreviewShell* pViewSh
{
ScDocShell* pDocSh = NULL;
if (pViewShell)
- pDocSh = (ScDocShell*) pViewShell->GetDocument().GetDocumentShell();
+ pDocSh = static_cast<ScDocShell*>( pViewShell->GetDocument().GetDocumentShell());
return pDocSh;
}
@@ -1411,7 +1411,7 @@ ScDocShell* ScAccessiblePreviewHeaderCellTextData::GetDocShell(ScPreviewShell* p
{
ScDocShell* pDocSh = NULL;
if (pViewShell)
- pDocSh = (ScDocShell*) pViewShell->GetDocument().GetDocumentShell();
+ pDocSh = static_cast<ScDocShell*>(pViewShell->GetDocument().GetDocumentShell());
return pDocSh;
}
@@ -1429,7 +1429,7 @@ ScAccessibleHeaderTextData::ScAccessibleHeaderTextData(ScPreviewShell* pViewShel
meAdjust(eAdjust)
{
if (pViewShell)
- mpDocSh = (ScDocShell*) pViewShell->GetDocument().GetDocumentShell();
+ mpDocSh = static_cast<ScDocShell*>(pViewShell->GetDocument().GetDocumentShell());
if (mpDocSh)
mpDocSh->GetDocument().AddUnoObject(*this);
}
@@ -1482,7 +1482,7 @@ SvxTextForwarder* ScAccessibleHeaderTextData::GetTextForwarder()
// -> use global pool from module
SfxItemSet aDefaults( pHdrEngine->GetEmptyItemSet() );
- const ScPatternAttr& rPattern = (const ScPatternAttr&)SC_MOD()->GetPool().GetDefaultItem(ATTR_PATTERN);
+ const ScPatternAttr& rPattern = static_cast<const ScPatternAttr&>(SC_MOD()->GetPool().GetDefaultItem(ATTR_PATTERN));
rPattern.FillEditItemSet( &aDefaults );
// FillEditItemSet adjusts font height to 1/100th mm,
// but for header/footer twips is needed, as in the PatternAttr:
@@ -1544,7 +1544,7 @@ ScAccessibleNoteTextData::ScAccessibleNoteTextData(ScPreviewShell* pViewShell,
mbDataValid(false)
{
if (pViewShell)
- mpDocSh = (ScDocShell*) pViewShell->GetDocument().GetDocumentShell();
+ mpDocSh = static_cast<ScDocShell*>(pViewShell->GetDocument().GetDocumentShell());
if (mpDocSh)
mpDocSh->GetDocument().AddUnoObject(*this);
}
diff --git a/sc/source/ui/app/client.cxx b/sc/source/ui/app/client.cxx
index a2c7fd04d4ae..d5ddc28ace66 100644
--- a/sc/source/ui/app/client.cxx
+++ b/sc/source/ui/app/client.cxx
@@ -68,8 +68,8 @@ SdrOle2Obj* ScClient::GetDrawObj()
if ( pObject->GetObjIdentifier() == OBJ_OLE2 )
{
// name from InfoObject is PersistName
- if ( ((SdrOle2Obj*)pObject)->GetPersistName() == aName )
- pOle2Obj = (SdrOle2Obj*)pObject;
+ if ( static_cast<SdrOle2Obj*>(pObject)->GetPersistName() == aName )
+ pOle2Obj = static_cast<SdrOle2Obj*>(pObject);
}
pObject = aIter.Next();
}
diff --git a/sc/source/ui/app/drwtrans.cxx b/sc/source/ui/app/drwtrans.cxx
index c2f2f1ac96ad..afbc7ae5418c 100644
--- a/sc/source/ui/app/drwtrans.cxx
+++ b/sc/source/ui/app/drwtrans.cxx
@@ -110,7 +110,7 @@ ScDrawTransferObj::ScDrawTransferObj( SdrModel* pClipModel, ScDocShell* pContain
// if object has no persistence it must be copied as a part of document
try
{
- uno::Reference< embed::XEmbedPersist > xPersObj( ((SdrOle2Obj*)pObject)->GetObjRef(), uno::UNO_QUERY );
+ uno::Reference< embed::XEmbedPersist > xPersObj( static_cast<SdrOle2Obj*>(pObject)->GetObjRef(), uno::UNO_QUERY );
if ( xPersObj.is() && xPersObj->hasEntry() )
bOleObj = true;
}
@@ -124,7 +124,7 @@ ScDrawTransferObj::ScDrawTransferObj( SdrModel* pClipModel, ScDocShell* pContain
if (nSdrObjKind == OBJ_GRAF)
{
bGraphic = true;
- if ( ((SdrGrafObj*)pObject)->GetGraphic().GetType() == GRAPHIC_BITMAP )
+ if ( static_cast<SdrGrafObj*>(pObject)->GetGraphic().GetType() == GRAPHIC_BITMAP )
bGrIsBit = true;
}
@@ -418,7 +418,7 @@ bool ScDrawTransferObj::GetData( const css::datatransfer::DataFlavor& rFlavor, c
SdrObject* pObject = aIter.Next();
if (pObject && pObject->GetObjIdentifier() == OBJ_GRAF)
{
- SdrGrafObj* pGraphObj = (SdrGrafObj*) pObject;
+ SdrGrafObj* pGraphObj = static_cast<SdrGrafObj*>(pObject);
bOK = SetGraphic( pGraphObj->GetGraphic(), rFlavor );
}
}
@@ -467,7 +467,7 @@ bool ScDrawTransferObj::WriteObject( SotStorageStreamRef& rxOStm, void* pUserObj
// for the changed pool defaults from drawing layer pool set those
// attributes as hard attributes to preserve them for saving
const SfxItemPool& rItemPool = pModel->GetItemPool();
- const SvxFontHeightItem& rDefaultFontHeight = (const SvxFontHeightItem&)rItemPool.GetDefaultItem(EE_CHAR_FONTHEIGHT);
+ const SvxFontHeightItem& rDefaultFontHeight = static_cast<const SvxFontHeightItem&>(rItemPool.GetDefaultItem(EE_CHAR_FONTHEIGHT));
// SW should have no MasterPages
OSL_ENSURE(0L == pModel->GetMasterPageCount(), "SW with MasterPages (!)");
@@ -480,7 +480,7 @@ bool ScDrawTransferObj::WriteObject( SotStorageStreamRef& rxOStm, void* pUserObj
while(aIter.IsMore())
{
SdrObject* pObj = aIter.Next();
- const SvxFontHeightItem& rItem = (const SvxFontHeightItem&)pObj->GetMergedItem(EE_CHAR_FONTHEIGHT);
+ const SvxFontHeightItem& rItem = static_cast<const SvxFontHeightItem&>(pObj->GetMergedItem(EE_CHAR_FONTHEIGHT));
if(rItem.GetHeight() == rDefaultFontHeight.GetHeight())
{
@@ -690,7 +690,7 @@ SdrOle2Obj* ScDrawTransferObj::GetSingleObject()
SdrObject* pObject = aIter.Next();
if (pObject && pObject->GetObjIdentifier() == OBJ_OLE2)
{
- return (SdrOle2Obj*) pObject;
+ return static_cast<SdrOle2Obj*>(pObject);
}
}
diff --git a/sc/source/ui/app/inputhdl.cxx b/sc/source/ui/app/inputhdl.cxx
index 1a8fb0f02c5b..f2d89bce7589 100644
--- a/sc/source/ui/app/inputhdl.cxx
+++ b/sc/source/ui/app/inputhdl.cxx
@@ -694,7 +694,7 @@ void ScInputHandler::UpdateSpellSettings( bool bFromStartTab )
pEngine->SetSpeller( xXSpellChecker1 );
}
- bool bHyphen = pLastPattern && ((const SfxBoolItem&)pLastPattern->GetItem(ATTR_HYPHENATE)).GetValue();
+ bool bHyphen = pLastPattern && static_cast<const SfxBoolItem&>(pLastPattern->GetItem(ATTR_HYPHENATE)).GetValue();
if ( bHyphen ) {
com::sun::star::uno::Reference<com::sun::star::linguistic2::XHyphenator> xXHyphenator( LinguMgr::GetHyphenator() );
pEngine->SetHyphenator( xXHyphenator );
@@ -1769,8 +1769,8 @@ void ScInputHandler::UpdateAdjust( sal_Unicode cTyped )
}
bool bAsianVertical = pLastPattern &&
- ((const SfxBoolItem&)pLastPattern->GetItem( ATTR_STACKED )).GetValue() &&
- ((const SfxBoolItem&)pLastPattern->GetItem( ATTR_VERTICAL_ASIAN )).GetValue();
+ static_cast<const SfxBoolItem&>(pLastPattern->GetItem( ATTR_STACKED )).GetValue() &&
+ static_cast<const SfxBoolItem&>(pLastPattern->GetItem( ATTR_VERTICAL_ASIAN )).GetValue();
if ( bAsianVertical )
{
// Always edit at top of cell -> LEFT when editing vertically
@@ -1888,7 +1888,7 @@ bool ScInputHandler::StartTable( sal_Unicode cTyped, bool bFromCommand, bool bIn
if ( SfxItemState::SET == rAttrSet.GetItemState( ATTR_VALUE_FORMAT, true, &pItem ) )
{
- sal_uLong nFormat = ((const SfxUInt32Item*)pItem)->GetValue();
+ sal_uLong nFormat = static_cast<const SfxUInt32Item*>(pItem)->GetValue();
bCellHasPercentFormat = ( NUMBERFORMAT_PERCENT ==
rDoc.GetFormatTable()->GetType( nFormat ) );
}
@@ -1897,7 +1897,7 @@ bool ScInputHandler::StartTable( sal_Unicode cTyped, bool bFromCommand, bool bIn
// Validity specified?
if ( SfxItemState::SET == rAttrSet.GetItemState( ATTR_VALIDDATA, true, &pItem ) )
- nValidation = ((const SfxUInt32Item*)pItem)->GetValue();
+ nValidation = static_cast<const SfxUInt32Item*>(pItem)->GetValue();
else
nValidation = 0;
@@ -1918,7 +1918,7 @@ bool ScInputHandler::StartTable( sal_Unicode cTyped, bool bFromCommand, bool bIn
// Background color must be known for automatic font color.
// For transparent cell background, the document background color must be used.
- Color aBackCol = ((const SvxBrushItem&)
+ Color aBackCol = static_cast<const SvxBrushItem&>(
pPattern->GetItem( ATTR_BACKGROUND )).GetColor();
ScModule* pScMod = SC_MOD();
if ( aBackCol.GetTransparency() > 0 ||
@@ -1927,7 +1927,7 @@ bool ScInputHandler::StartTable( sal_Unicode cTyped, bool bFromCommand, bool bIn
pEngine->SetBackgroundColor( aBackCol );
// Adjustment
- eAttrAdjust = (SvxCellHorJustify)((const SvxHorJustifyItem&)pPattern->
+ eAttrAdjust = (SvxCellHorJustify)static_cast<const SvxHorJustifyItem&>(pPattern->
GetItem(ATTR_HOR_JUSTIFY)).GetValue();
if ( eAttrAdjust == SVX_HOR_JUSTIFY_REPEAT &&
static_cast<const SfxBoolItem&>(pPattern->GetItem(ATTR_LINEBREAK)).GetValue() )
diff --git a/sc/source/ui/app/inputwin.cxx b/sc/source/ui/app/inputwin.cxx
index 96b4080cef52..3e72f643ab3c 100644
--- a/sc/source/ui/app/inputwin.cxx
+++ b/sc/source/ui/app/inputwin.cxx
@@ -271,7 +271,7 @@ ScInputWindow::~ScInputWindow()
SfxViewShell* pSh = SfxViewShell::GetFirst( &aScType );
while ( pSh )
{
- ScInputHandler* pHdl = ((ScTabViewShell*)pSh)->GetInputHandler();
+ ScInputHandler* pHdl = static_cast<ScTabViewShell*>(pSh)->GetInputHandler();
if ( pHdl && pHdl->GetInputWindow() == this )
{
pHdl->SetInputWindow( NULL );
@@ -1782,7 +1782,7 @@ void ScTextWnd::StartEditEngine()
// SfxObjectShell* pObjSh = SfxObjectShell::Current();
if ( pObjSh && pObjSh->ISA(ScDocShell) )
{
- ScDocument& rDoc = ((ScDocShell*)pObjSh)->GetDocument(); // any document
+ ScDocument& rDoc = static_cast<ScDocShell*>(pObjSh)->GetDocument(); // any document
sal_uInt8 nScript = rDoc.GetStringScriptType( aString );
if ( nScript & SCRIPTTYPE_COMPLEX )
Invalidate();
@@ -1882,7 +1882,7 @@ void ScTextWnd::SetTextString( const OUString& rNewString )
if ( pObjSh && pObjSh->ISA(ScDocShell) )
{
// any document can be used (used only for its break iterator)
- ScDocument& rDoc = ((ScDocShell*)pObjSh)->GetDocument();
+ ScDocument& rDoc = static_cast<ScDocShell*>(pObjSh)->GetDocument();
nOldScript = rDoc.GetStringScriptType( aString );
nNewScript = rDoc.GetStringScriptType( rNewString );
}
@@ -2119,7 +2119,7 @@ void ScPosWnd::FillRangeNames()
SfxObjectShell* pObjSh = SfxObjectShell::Current();
if ( pObjSh && pObjSh->ISA(ScDocShell) )
{
- ScDocument& rDoc = ((ScDocShell*)pObjSh)->GetDocument();
+ ScDocument& rDoc = static_cast<ScDocShell*>(pObjSh)->GetDocument();
InsertEntry(ScGlobal::GetRscString( STR_MANAGE_NAMES ));
SetSeparatorPos(0);
diff --git a/sc/source/ui/app/scmod.cxx b/sc/source/ui/app/scmod.cxx
index 7922e40097b8..abbcb21e0771 100644
--- a/sc/source/ui/app/scmod.cxx
+++ b/sc/source/ui/app/scmod.cxx
@@ -231,7 +231,7 @@ void ScModule::ConfigurationChanged( utl::ConfigurationBroadcaster* p, sal_uInt3
{
if ( pObjSh->Type() == TYPE(ScDocShell) )
{
- ScDocShell* pDocSh = ((ScDocShell*)pObjSh);
+ ScDocShell* pDocSh = static_cast<ScDocShell*>(pObjSh);
if ( bArrows )
ScDetectiveFunc( &pDocSh->GetDocument(), 0 ).UpdateAllArrowColors();
if ( bComments )
@@ -248,7 +248,7 @@ void ScModule::ConfigurationChanged( utl::ConfigurationBroadcaster* p, sal_uInt3
{
if ( pViewShell->ISA(ScTabViewShell) )
{
- ScTabViewShell* pViewSh = (ScTabViewShell*)pViewShell;
+ ScTabViewShell* pViewSh = static_cast<ScTabViewShell*>(pViewShell);
pViewSh->PaintGrid();
pViewSh->PaintTop();
pViewSh->PaintLeft();
@@ -275,7 +275,7 @@ void ScModule::ConfigurationChanged( utl::ConfigurationBroadcaster* p, sal_uInt3
{
if ( pObjSh->Type() == TYPE(ScDocShell) )
{
- ScDocShell* pDocSh = ((ScDocShell*)pObjSh);
+ ScDocShell* pDocSh = static_cast<ScDocShell*>(pObjSh);
OutputDevice* pPrinter = pDocSh->GetPrinter();
if ( pPrinter )
pPrinter->SetDigitLanguage( GetOptDigitLanguage() );
@@ -295,7 +295,7 @@ void ScModule::ConfigurationChanged( utl::ConfigurationBroadcaster* p, sal_uInt3
{
if ( pSh->ISA( ScTabViewShell ) )
{
- ScTabViewShell* pViewSh = (ScTabViewShell*)pSh;
+ ScTabViewShell* pViewSh = static_cast<ScTabViewShell*>(pSh);
// set ref-device for EditEngine (re-evaluates digit settings)
ScInputHandler* pHdl = GetInputHdl(pViewSh);
@@ -307,7 +307,7 @@ void ScModule::ConfigurationChanged( utl::ConfigurationBroadcaster* p, sal_uInt3
}
else if ( pSh->ISA( ScPreviewShell ) )
{
- ScPreviewShell* pPreviewSh = (ScPreviewShell*)pSh;
+ ScPreviewShell* pPreviewSh = static_cast<ScPreviewShell*>(pSh);
ScPreview* pPreview = pPreviewSh->GetPreview();
pPreview->SetDigitLanguage( GetOptDigitLanguage() );
@@ -395,7 +395,7 @@ void ScModule::Execute( SfxRequest& rReq )
bool bSet;
const SfxPoolItem* pItem;
if ( pReqArgs && SfxItemState::SET == pReqArgs->GetItemState( nSlot, true, &pItem ) )
- bSet = ((const SfxBoolItem*)pItem)->GetValue();
+ bSet = static_cast<const SfxBoolItem*>(pItem)->GetValue();
else
{ // Toggle
ScDocShell* pDocSh = PTR_CAST(ScDocShell, SfxObjectShell::Current());
@@ -417,7 +417,7 @@ void ScModule::Execute( SfxRequest& rReq )
const SfxPoolItem* pItem;
if ( pReqArgs && SfxItemState::SET == pReqArgs->GetItemState( nSlot, true, &pItem ) )
{
- FieldUnit eUnit = (FieldUnit)((const SfxUInt16Item*)pItem)->GetValue();
+ FieldUnit eUnit = (FieldUnit)static_cast<const SfxUInt16Item*>(pItem)->GetValue();
switch( eUnit )
{
case FUNIT_MM: // Just the units that are also in the dialog
@@ -475,7 +475,7 @@ void ScModule::Execute( SfxRequest& rReq )
case SID_PSZ_FUNCTION:
if (pReqArgs)
{
- const SfxUInt16Item& rItem = (const SfxUInt16Item&)pReqArgs->Get(SID_PSZ_FUNCTION);
+ const SfxUInt16Item& rItem = static_cast<const SfxUInt16Item&>(pReqArgs->Get(SID_PSZ_FUNCTION));
OSL_ENSURE(rItem.ISA(SfxUInt16Item),"wrong Parameter");
ScAppOptions aNewOpts( GetAppOptions() );
@@ -505,7 +505,7 @@ void ScModule::Execute( SfxRequest& rReq )
if ( pDocSh )
{
ScDocument& rDoc = pDocSh->GetDocument();
- LanguageType eNewLang = ((SvxLanguageItem*)pItem)->GetLanguage();
+ LanguageType eNewLang = static_cast<const SvxLanguageItem*>(pItem)->GetLanguage();
LanguageType eLatin, eCjk, eCtl;
rDoc.GetLanguage( eLatin, eCjk, eCtl );
LanguageType eOld = ( nSlot == SID_ATTR_CHAR_CJK_LANGUAGE ) ? eCjk :
@@ -780,9 +780,9 @@ void ScModule::RecentFunctionsChanged()
SfxViewFrame* pViewFrm = SfxViewFrame::Current();
if ( pViewFrm && pViewFrm->HasChildWindow(nFuncListID) )
{
- ScFunctionChildWindow* pWnd =(ScFunctionChildWindow*)pViewFrm->GetChildWindow( nFuncListID );
+ ScFunctionChildWindow* pWnd = static_cast<ScFunctionChildWindow*>(pViewFrm->GetChildWindow( nFuncListID ));
- ScFunctionDockWin* pFuncList=(ScFunctionDockWin*)pWnd->GetWindow();
+ ScFunctionDockWin* pFuncList = static_cast<ScFunctionDockWin*>(pWnd->GetWindow());
pFuncList->InitLRUList();
}
@@ -979,13 +979,13 @@ void ScModule::ModifyOptions( const SfxItemSet& rOptSet )
if (rOptSet.HasItem(SID_ATTR_METRIC, &pItem))
{
PutItem( *pItem );
- pAppCfg->SetAppMetric( (FieldUnit)((const SfxUInt16Item*)pItem)->GetValue() );
+ pAppCfg->SetAppMetric( (FieldUnit)static_cast<const SfxUInt16Item*>(pItem)->GetValue() );
bSaveAppOptions = true;
}
if (rOptSet.HasItem(SCITEM_USERLIST, &pItem))
{
- ScGlobal::SetUserList( ((const ScUserListItem*)pItem)->GetUserList() );
+ ScGlobal::SetUserList( static_cast<const ScUserListItem*>(pItem)->GetUserList() );
bSaveAppOptions = true;
}
@@ -1011,14 +1011,14 @@ void ScModule::ModifyOptions( const SfxItemSet& rOptSet )
// DefaultsOptions
if (rOptSet.HasItem(SID_SCDEFAULTSOPTIONS, &pItem))
{
- const ScDefaultsOptions& rOpt = ((const ScTpDefaultsItem*)pItem)->GetDefaultsOptions();
+ const ScDefaultsOptions& rOpt = static_cast<const ScTpDefaultsItem*>(pItem)->GetDefaultsOptions();
SetDefaultsOptions( rOpt );
}
// FormulaOptions
if (rOptSet.HasItem(SID_SCFORMULAOPTIONS, &pItem))
{
- const ScFormulaOptions& rOpt = ((const ScTpFormulaItem*)pItem)->GetFormulaOptions();
+ const ScFormulaOptions& rOpt = static_cast<const ScTpFormulaItem*>(pItem)->GetFormulaOptions();
if (!pFormulaCfg || (*pFormulaCfg != rOpt))
// Formula options have changed. Repaint the column headers.
@@ -1049,7 +1049,7 @@ void ScModule::ModifyOptions( const SfxItemSet& rOptSet )
// ViewOptions
if (rOptSet.HasItem(SID_SCVIEWOPTIONS, &pItem))
{
- const ScViewOptions& rNewOpt = ((const ScTpViewItem*)pItem)->GetViewOptions();
+ const ScViewOptions& rNewOpt = static_cast<const ScTpViewItem*>(pItem)->GetViewOptions();
if ( pViewSh )
{
@@ -1081,7 +1081,7 @@ void ScModule::ModifyOptions( const SfxItemSet& rOptSet )
// Evaluate after ViewOptions, as GridOptions is a member of ViewOptions
if ( rOptSet.HasItem(SID_ATTR_GRID_OPTIONS,&pItem) )
{
- ScGridOptions aNewGridOpt( (const SvxGridItem&)*pItem );
+ ScGridOptions aNewGridOpt( static_cast<const SvxGridItem&>(*pItem ));
if ( pViewSh )
{
@@ -1111,7 +1111,7 @@ void ScModule::ModifyOptions( const SfxItemSet& rOptSet )
// DocOptions
if ( rOptSet.HasItem(SID_SCDOCOPTIONS,&pItem) )
{
- const ScDocOptions& rNewOpt = ((const ScTpCalcItem*)pItem)->GetDocOptions();
+ const ScDocOptions& rNewOpt = static_cast<const ScTpCalcItem*>(pItem)->GetDocOptions();
if ( pDoc )
{
@@ -1139,7 +1139,7 @@ void ScModule::ModifyOptions( const SfxItemSet& rOptSet )
// Set TabDistance after the actual DocOptions
if ( rOptSet.HasItem(SID_ATTR_DEFTABSTOP,&pItem) )
{
- sal_uInt16 nTabDist = ((SfxUInt16Item*)pItem)->GetValue();
+ sal_uInt16 nTabDist = static_cast<const SfxUInt16Item*>(pItem)->GetValue();
ScDocOptions aOpt(GetDocOptions());
aOpt.SetTabDistance(nTabDist);
SetDocOptions( aOpt );
@@ -1158,7 +1158,7 @@ void ScModule::ModifyOptions( const SfxItemSet& rOptSet )
// AutoSpell after the DocOptions (due to being a member)
if ( rOptSet.HasItem(SID_AUTOSPELL_CHECK,&pItem) ) // At DocOptions
{
- bool bDoAutoSpell = ((const SfxBoolItem*)pItem)->GetValue();
+ bool bDoAutoSpell = static_cast<const SfxBoolItem*>(pItem)->GetValue();
if (pDoc)
{
@@ -1193,32 +1193,32 @@ void ScModule::ModifyOptions( const SfxItemSet& rOptSet )
// InputOptions
if ( rOptSet.HasItem(SID_SC_INPUT_SELECTIONPOS,&pItem) )
{
- pInputCfg->SetMoveDir( ((const SfxUInt16Item*)pItem)->GetValue() );
+ pInputCfg->SetMoveDir( static_cast<const SfxUInt16Item*>(pItem)->GetValue() );
bSaveInputOptions = true;
}
if ( rOptSet.HasItem(SID_SC_INPUT_SELECTION,&pItem) )
{
- pInputCfg->SetMoveSelection( ((const SfxBoolItem*)pItem)->GetValue() );
+ pInputCfg->SetMoveSelection( static_cast<const SfxBoolItem*>(pItem)->GetValue() );
bSaveInputOptions = true;
}
if ( rOptSet.HasItem(SID_SC_INPUT_EDITMODE,&pItem) )
{
- pInputCfg->SetEnterEdit( ((const SfxBoolItem*)pItem)->GetValue() );
+ pInputCfg->SetEnterEdit( static_cast<const SfxBoolItem*>(pItem)->GetValue() );
bSaveInputOptions = true;
}
if ( rOptSet.HasItem(SID_SC_INPUT_FMT_EXPAND,&pItem) )
{
- pInputCfg->SetExtendFormat( ((const SfxBoolItem*)pItem)->GetValue() );
+ pInputCfg->SetExtendFormat( static_cast<const SfxBoolItem*>(pItem)->GetValue() );
bSaveInputOptions = true;
}
if ( rOptSet.HasItem(SID_SC_INPUT_RANGEFINDER,&pItem) )
{
- pInputCfg->SetRangeFinder( ((const SfxBoolItem*)pItem)->GetValue() );
+ pInputCfg->SetRangeFinder( static_cast<const SfxBoolItem*>(pItem)->GetValue() );
bSaveInputOptions = true;
}
if ( rOptSet.HasItem(SID_SC_INPUT_REF_EXPAND,&pItem) )
{
- pInputCfg->SetExpandRefs( ((const SfxBoolItem*)pItem)->GetValue() );
+ pInputCfg->SetExpandRefs( static_cast<const SfxBoolItem*>(pItem)->GetValue() );
bSaveInputOptions = true;
}
if (rOptSet.HasItem(SID_SC_OPT_SORT_REF_UPDATE, &pItem))
@@ -1229,13 +1229,13 @@ void ScModule::ModifyOptions( const SfxItemSet& rOptSet )
if ( rOptSet.HasItem(SID_SC_INPUT_MARK_HEADER,&pItem) )
{
- pInputCfg->SetMarkHeader( ((const SfxBoolItem*)pItem)->GetValue() );
+ pInputCfg->SetMarkHeader( static_cast<const SfxBoolItem*>(pItem)->GetValue() );
bSaveInputOptions = true;
bUpdateMarks = true;
}
if ( rOptSet.HasItem(SID_SC_INPUT_TEXTWYSIWYG,&pItem) )
{
- bool bNew = ((const SfxBoolItem*)pItem)->GetValue();
+ bool bNew = static_cast<const SfxBoolItem*>(pItem)->GetValue();
if ( bNew != pInputCfg->GetTextWysiwyg() )
{
pInputCfg->SetTextWysiwyg( bNew );
@@ -1245,20 +1245,20 @@ void ScModule::ModifyOptions( const SfxItemSet& rOptSet )
}
if( rOptSet.HasItem( SID_SC_INPUT_REPLCELLSWARN, &pItem ) )
{
- pInputCfg->SetReplaceCellsWarn( ((const SfxBoolItem*)pItem)->GetValue() );
+ pInputCfg->SetReplaceCellsWarn( static_cast<const SfxBoolItem*>(pItem)->GetValue() );
bSaveInputOptions = true;
}
if( rOptSet.HasItem( SID_SC_INPUT_LEGACY_CELL_SELECTION, &pItem ) )
{
- pInputCfg->SetLegacyCellSelection( ((const SfxBoolItem*)pItem)->GetValue() );
+ pInputCfg->SetLegacyCellSelection( static_cast<const SfxBoolItem*>(pItem)->GetValue() );
bSaveInputOptions = true;
}
// PrintOptions
if ( rOptSet.HasItem(SID_SCPRINTOPTIONS,&pItem) )
{
- const ScPrintOptions& rNewOpt = ((const ScTpPrintItem*)pItem)->GetPrintOptions();
+ const ScPrintOptions& rNewOpt = static_cast<const ScTpPrintItem*>(pItem)->GetPrintOptions();
SetPrintOptions( rNewOpt );
// broadcast causes all previews to recalc page numbers
@@ -1321,7 +1321,7 @@ void ScModule::ModifyOptions( const SfxItemSet& rOptSet )
{
if ( pObjSh->Type() == TYPE(ScDocShell) )
{
- ScDocShell* pOneDocSh = ((ScDocShell*)pObjSh);
+ ScDocShell* pOneDocSh = static_cast<ScDocShell*>(pObjSh);
pOneDocSh->CalcOutputFactor();
SCTAB nTabCount = pOneDocSh->GetDocument().GetTableCount();
for (SCTAB nTab=0; nTab<nTabCount; nTab++)
@@ -1335,7 +1335,7 @@ void ScModule::ModifyOptions( const SfxItemSet& rOptSet )
SfxViewShell* pSh = SfxViewShell::GetFirst( &aScType );
while ( pSh )
{
- ScTabViewShell* pOneViewSh = (ScTabViewShell*)pSh;
+ ScTabViewShell* pOneViewSh = static_cast<ScTabViewShell*>(pSh);
// set ref-device for EditEngine
ScInputHandler* pHdl = GetInputHdl(pOneViewSh);
@@ -1553,7 +1553,7 @@ void ScModule::SetRefDialog( sal_uInt16 nId, bool bVis, SfxViewFrame* pViewFrm )
// store the dialog id also in the view shell
SfxViewShell* pViewSh = pViewFrm->GetViewShell();
if ( pViewSh && pViewSh->ISA( ScTabViewShell ) )
- ((ScTabViewShell*)pViewSh)->SetCurRefDlgId( nCurRefDlgId );
+ static_cast<ScTabViewShell*>(pViewSh)->SetCurRefDlgId( nCurRefDlgId );
else
{
// no ScTabViewShell - possible for example from a Basic macro
@@ -2182,7 +2182,7 @@ IMPL_LINK( ScModule, CalcFieldValueHdl, EditFieldInfo*, pInfo )
if (pField && pField->ISA(SvxURLField))
{
// URLField
- const SvxURLField* pURLField = (const SvxURLField*) pField;
+ const SvxURLField* pURLField = static_cast<const SvxURLField*>(pField);
OUString aURL = pURLField->GetURL();
switch ( pURLField->GetFormat() )
@@ -2293,7 +2293,7 @@ void ScModule::PushNewAnyRefDlg( ScAnyRefModalDlg* pNewDlg )
{
if ( pViewShell->ISA(ScTabViewShell) )
{
- ScTabViewShell* pViewSh = (ScTabViewShell*)pViewShell;
+ ScTabViewShell* pViewSh = static_cast<ScTabViewShell*>(pViewShell);
pViewSh->SetInRefMode( true );
}
pViewShell = SfxViewShell::GetNext( *pViewShell );
@@ -2313,7 +2313,7 @@ void ScModule::PopAnyRefDlg()
{
if ( pViewShell->ISA(ScTabViewShell) )
{
- ScTabViewShell* pViewSh = (ScTabViewShell*)pViewShell;
+ ScTabViewShell* pViewSh = static_cast<ScTabViewShell*>(pViewShell);
pViewSh->SetInRefMode( false );
}
pViewShell = SfxViewShell::GetNext( *pViewShell );
diff --git a/sc/source/ui/app/seltrans.cxx b/sc/source/ui/app/seltrans.cxx
index 0ad7efe45a09..c965c1d26b2b 100644
--- a/sc/source/ui/app/seltrans.cxx
+++ b/sc/source/ui/app/seltrans.cxx
@@ -92,7 +92,7 @@ ScSelectionTransferObj* ScSelectionTransferObj::CreateFromView( ScTabView* pView
if ( nSdrObjKind == OBJ_GRAF )
{
- if ( ((SdrGrafObj*)pObj)->GetGraphic().GetType() == GRAPHIC_BITMAP )
+ if ( static_cast<SdrGrafObj*>(pObj)->GetGraphic().GetType() == GRAPHIC_BITMAP )
eMode = SC_SELTRANS_DRAW_BITMAP;
else
eMode = SC_SELTRANS_DRAW_GRAPHIC;
diff --git a/sc/source/ui/app/transobj.cxx b/sc/source/ui/app/transobj.cxx
index 02733c174912..cb822e238134 100644
--- a/sc/source/ui/app/transobj.cxx
+++ b/sc/source/ui/app/transobj.cxx
@@ -664,7 +664,7 @@ void ScTransferObj::InitDocShell(bool bLimitToPageSize)
if (pStyleSheet)
{
const SfxItemSet& rSourceSet = pStyleSheet->GetItemSet();
- aPaperSize = ((const SvxSizeItem&) rSourceSet.Get(ATTR_PAGE_SIZE)).GetSize();
+ aPaperSize = static_cast<const SvxSizeItem&>( rSourceSet.Get(ATTR_PAGE_SIZE)).GetSize();
// CopyStyleFrom kopiert SetItems mit richtigem Pool
ScStyleSheetPool* pDestPool = rDestDoc.GetStyleSheetPool();
@@ -798,7 +798,7 @@ void ScTransferObj::StripRefs( ScDocument* pDoc,
ScAddress aPos(nCol, nRow, nDestTab);
if (nErrCode)
{
- if ( ((const SvxHorJustifyItem*) pDestDoc->GetAttr(
+ if ( static_cast<const SvxHorJustifyItem*>(pDestDoc->GetAttr(
nCol,nRow,nDestTab, ATTR_HOR_JUSTIFY))->GetValue() ==
SVX_HOR_JUSTIFY_STANDARD )
pDestDoc->ApplyAttr( nCol,nRow,nDestTab,
diff --git a/sc/source/ui/app/uiitems.cxx b/sc/source/ui/app/uiitems.cxx
index e2c3e89b968c..f8618a080ec4 100644
--- a/sc/source/ui/app/uiitems.cxx
+++ b/sc/source/ui/app/uiitems.cxx
@@ -79,10 +79,10 @@ bool ScInputStatusItem::operator==( const SfxPoolItem& rItem ) const
{
OSL_ENSURE( SfxPoolItem::operator==( rItem ), "unequal Which or Type" );
- return ( (aStartPos == ((ScInputStatusItem&)rItem).aStartPos)
- && (aEndPos == ((ScInputStatusItem&)rItem).aEndPos)
- && (aCursorPos == ((ScInputStatusItem&)rItem).aCursorPos)
- && (aString == ((ScInputStatusItem&)rItem).aString) );
+ return (aStartPos == static_cast<const ScInputStatusItem&>(rItem).aStartPos)
+ && (aEndPos == static_cast<const ScInputStatusItem&>(rItem).aEndPos)
+ && (aCursorPos == static_cast<const ScInputStatusItem&>(rItem).aCursorPos)
+ && (aString == static_cast<const ScInputStatusItem&>(rItem).aString);
//TODO: Compare Edit data!
}
@@ -175,7 +175,7 @@ bool ScSortItem::operator==( const SfxPoolItem& rItem ) const
{
OSL_ENSURE( SfxPoolItem::operator==( rItem ), "unequal Which or Type" );
- const ScSortItem& rOther = (const ScSortItem&)rItem;
+ const ScSortItem& rOther = static_cast<const ScSortItem&>(rItem);
return ( (pViewData == rOther.pViewData)
&& (theSortData == rOther.theSortData) );
@@ -267,7 +267,7 @@ bool ScQueryItem::operator==( const SfxPoolItem& rItem ) const
{
OSL_ENSURE( SfxPoolItem::operator==( rItem ), "unequal Which or Type" );
- const ScQueryItem& rQueryItem = (const ScQueryItem&)rItem;
+ const ScQueryItem& rQueryItem = static_cast<const ScQueryItem&>(rItem);
return ( (pViewData == rQueryItem.pViewData)
&& (bIsAdvanced == rQueryItem.bIsAdvanced)
@@ -320,7 +320,7 @@ bool ScSubTotalItem::operator==( const SfxPoolItem& rItem ) const
{
OSL_ENSURE( SfxPoolItem::operator==( rItem ), "unequal Which or Type" );
- const ScSubTotalItem& rSTItem = (const ScSubTotalItem&)rItem;
+ const ScSubTotalItem& rSTItem = static_cast<const ScSubTotalItem&>(rItem);
return ( (pViewData == rSTItem.pViewData)
&& (theSubTotalData == rSTItem.theSubTotalData) );
@@ -370,7 +370,7 @@ bool ScUserListItem::operator==( const SfxPoolItem& rItem ) const
{
OSL_ENSURE( SfxPoolItem::operator==( rItem ), "unequal Which or Type" );
- const ScUserListItem& r = (const ScUserListItem&)rItem;
+ const ScUserListItem& r = static_cast<const ScUserListItem&>(rItem);
bool bEqual = false;
if ( !pUserList || !(r.pUserList) )
@@ -422,7 +422,7 @@ bool ScConsolidateItem::operator==( const SfxPoolItem& rItem ) const
{
OSL_ENSURE( SfxPoolItem::operator==( rItem ), "unequal Which or Type" );
- const ScConsolidateItem& rCItem = (const ScConsolidateItem&)rItem;
+ const ScConsolidateItem& rCItem = static_cast<const ScConsolidateItem&>(rItem);
return ( theConsData == rCItem.theConsData);
}
@@ -471,7 +471,7 @@ bool ScPivotItem::operator==( const SfxPoolItem& rItem ) const
{
OSL_ENSURE( SfxPoolItem::operator==( rItem ), "unequal Which or Type" );
- const ScPivotItem& rPItem = (const ScPivotItem&)rItem;
+ const ScPivotItem& rPItem = static_cast<const ScPivotItem&>(rItem);
OSL_ENSURE( pSaveData && rPItem.pSaveData, "pSaveData" );
return ( *pSaveData == *rPItem.pSaveData &&
aDestRange == rPItem.aDestRange &&
@@ -512,7 +512,7 @@ bool ScSolveItem::operator==( const SfxPoolItem& rItem ) const
{
OSL_ENSURE( SfxPoolItem::operator==( rItem ), "unequal Which or Type" );
- const ScSolveItem& rPItem = (const ScSolveItem&)rItem;
+ const ScSolveItem& rPItem = static_cast<const ScSolveItem&>(rItem);
return ( theSolveData == rPItem.theSolveData );
}
@@ -551,7 +551,7 @@ bool ScTabOpItem::operator==( const SfxPoolItem& rItem ) const
{
OSL_ENSURE( SfxPoolItem::operator==( rItem ), "unequal Which or Type" );
- const ScTabOpItem& rPItem = (const ScTabOpItem&)rItem;
+ const ScTabOpItem& rPItem = static_cast<const ScTabOpItem&>(rItem);
return ( theTabOpData == rPItem.theTabOpData );
}
diff --git a/sc/source/ui/cctrl/tbzoomsliderctrl.cxx b/sc/source/ui/cctrl/tbzoomsliderctrl.cxx
index 6e2e8bc501c0..3a3bcd769c76 100644
--- a/sc/source/ui/cctrl/tbzoomsliderctrl.cxx
+++ b/sc/source/ui/cctrl/tbzoomsliderctrl.cxx
@@ -58,7 +58,7 @@ void ScZoomSliderControl::StateChanged( sal_uInt16 /*nSID*/, SfxItemState eState
{
sal_uInt16 nId = GetId();
ToolBox& rTbx = GetToolBox();
- ScZoomSliderWnd* pBox = (ScZoomSliderWnd*)(rTbx.GetItemWindow( nId ));
+ ScZoomSliderWnd* pBox = static_cast<ScZoomSliderWnd*>(rTbx.GetItemWindow( nId ));
OSL_ENSURE( pBox ,"Control not found!" );
if ( SfxItemState::DEFAULT != eState || pState->ISA( SfxVoidItem ) )