diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2015-03-28 19:06:09 +0100 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2015-03-28 19:09:24 +0100 |
commit | 77d1a61c95779728799277565de3d6528ddc594b (patch) | |
tree | 0b04a079a0a47e2c2efaf6e2318cf447cdff0096 /sc/source/ui | |
parent | a98887d9b82327d4183d24a56ec0636953515aa3 (diff) |
Clean up C-style casts from pointers to void
Change-Id: Ie42848cc9f2d74beeb76e1c5e49ef40b99f6d5f6
Diffstat (limited to 'sc/source/ui')
-rw-r--r-- | sc/source/ui/app/drwtrans.cxx | 6 | ||||
-rw-r--r-- | sc/source/ui/app/scdll.cxx | 2 | ||||
-rw-r--r-- | sc/source/ui/app/transobj.cxx | 6 | ||||
-rw-r--r-- | sc/source/ui/dbgui/PivotLayoutTreeList.cxx | 4 | ||||
-rw-r--r-- | sc/source/ui/dbgui/PivotLayoutTreeListBase.cxx | 4 | ||||
-rw-r--r-- | sc/source/ui/dbgui/PivotLayoutTreeListData.cxx | 8 | ||||
-rw-r--r-- | sc/source/ui/dbgui/foptmgr.cxx | 6 | ||||
-rw-r--r-- | sc/source/ui/dbgui/sfiltdlg.cxx | 6 | ||||
-rw-r--r-- | sc/source/ui/dbgui/tpsort.cxx | 6 | ||||
-rw-r--r-- | sc/source/ui/dbgui/tpsubt.cxx | 10 | ||||
-rw-r--r-- | sc/source/ui/docshell/impex.cxx | 6 | ||||
-rw-r--r-- | sc/source/ui/formdlg/dwfunctr.cxx | 12 | ||||
-rw-r--r-- | sc/source/ui/miscdlgs/acredlin.cxx | 58 | ||||
-rw-r--r-- | sc/source/ui/pagedlg/areasdlg.cxx | 4 | ||||
-rw-r--r-- | sc/source/ui/unoobj/docuno.cxx | 4 | ||||
-rw-r--r-- | sc/source/ui/unoobj/miscuno.cxx | 8 | ||||
-rw-r--r-- | sc/source/ui/vba/vbarange.cxx | 2 |
17 files changed, 76 insertions, 76 deletions
diff --git a/sc/source/ui/app/drwtrans.cxx b/sc/source/ui/app/drwtrans.cxx index 0910bd124ba6..b1b3c204e522 100644 --- a/sc/source/ui/app/drwtrans.cxx +++ b/sc/source/ui/app/drwtrans.cxx @@ -460,7 +460,7 @@ bool ScDrawTransferObj::WriteObject( SotStorageStreamRef& rxOStm, void* pUserObj { case SCDRAWTRANS_TYPE_DRAWMODEL: { - SdrModel* pDrawModel = (SdrModel*)pUserObject; + SdrModel* pDrawModel = static_cast<SdrModel*>(pUserObject); rxOStm->SetBufferSize( 0xff00 ); // #108584# @@ -502,7 +502,7 @@ bool ScDrawTransferObj::WriteObject( SotStorageStreamRef& rxOStm, void* pUserObj case SCDRAWTRANS_TYPE_EMBOBJ: { // impl. for "single OLE" - embed::XEmbeddedObject* pEmbObj = (embed::XEmbeddedObject*) pUserObject; + embed::XEmbeddedObject* pEmbObj = static_cast<embed::XEmbeddedObject*>(pUserObject); ::utl::TempFile aTempFile; aTempFile.EnableKillingFile(); @@ -546,7 +546,7 @@ bool ScDrawTransferObj::WriteObject( SotStorageStreamRef& rxOStm, void* pUserObj case SCDRAWTRANS_TYPE_DOCUMENT: { // impl. for "DocShell" - SfxObjectShell* pEmbObj = (SfxObjectShell*) pUserObject; + SfxObjectShell* pEmbObj = static_cast<SfxObjectShell*>(pUserObject); try { diff --git a/sc/source/ui/app/scdll.cxx b/sc/source/ui/app/scdll.cxx index 52a98d4b12a5..40765e0d25bd 100644 --- a/sc/source/ui/app/scdll.cxx +++ b/sc/source/ui/app/scdll.cxx @@ -114,7 +114,7 @@ ScResId::ScResId( sal_uInt16 nId ) : void ScDLL::Init() { - ScModule **ppShlPtr = (ScModule**) GetAppData(SHL_CALC); + ScModule **ppShlPtr = reinterpret_cast<ScModule**>(GetAppData(SHL_CALC)); if ( *ppShlPtr ) return; diff --git a/sc/source/ui/app/transobj.cxx b/sc/source/ui/app/transobj.cxx index 4b452c8ff89f..95c4d22d3cb0 100644 --- a/sc/source/ui/app/transobj.cxx +++ b/sc/source/ui/app/transobj.cxx @@ -398,7 +398,7 @@ bool ScTransferObj::WriteObject( SotStorageStreamRef& rxOStm, void* pUserObject, { case SCTRANS_TYPE_IMPEX: { - ScImportExport* pImpEx = (ScImportExport*)pUserObject; + ScImportExport* pImpEx = static_cast<ScImportExport*>(pUserObject); SotClipboardFormatId nFormat = SotExchange::GetFormat( rFlavor ); // mba: no BaseURL for data exchange @@ -410,7 +410,7 @@ bool ScTransferObj::WriteObject( SotStorageStreamRef& rxOStm, void* pUserObject, case SCTRANS_TYPE_EDIT_RTF: case SCTRANS_TYPE_EDIT_BIN: { - ScTabEditEngine* pEngine = (ScTabEditEngine*)pUserObject; + ScTabEditEngine* pEngine = static_cast<ScTabEditEngine*>(pUserObject); if ( nUserObjectId == SCTRANS_TYPE_EDIT_RTF ) { pEngine->Write( *rxOStm, EE_FORMAT_RTF ); @@ -438,7 +438,7 @@ bool ScTransferObj::WriteObject( SotStorageStreamRef& rxOStm, void* pUserObject, case SCTRANS_TYPE_EMBOBJ: { // TODO/MBA: testing - SfxObjectShell* pEmbObj = (SfxObjectShell*) pUserObject; + SfxObjectShell* pEmbObj = static_cast<SfxObjectShell*>(pUserObject); ::utl::TempFile aTempFile; aTempFile.EnableKillingFile(); uno::Reference< embed::XStorage > xWorkStore = diff --git a/sc/source/ui/dbgui/PivotLayoutTreeList.cxx b/sc/source/ui/dbgui/PivotLayoutTreeList.cxx index dcfdae35b0be..e667ad97b6bf 100644 --- a/sc/source/ui/dbgui/PivotLayoutTreeList.cxx +++ b/sc/source/ui/dbgui/PivotLayoutTreeList.cxx @@ -42,7 +42,7 @@ bool ScPivotLayoutTreeList::DoubleClickHdl() if (!pEntry) return false; - ScItemValue* pCurrentItemValue = (ScItemValue*) pEntry->GetUserData(); + ScItemValue* pCurrentItemValue = static_cast<ScItemValue*>(pEntry->GetUserData()); ScPivotFuncData& rCurrentFunctionData = pCurrentItemValue->maFunctionData; if (mpParent->IsDataElement(rCurrentFunctionData.mnCol)) @@ -85,7 +85,7 @@ void ScPivotLayoutTreeList::FillFields(ScPivotFieldVector& rFieldVector) void ScPivotLayoutTreeList::InsertEntryForSourceTarget(SvTreeListEntry* pSource, SvTreeListEntry* pTarget) { - ScItemValue* pItemValue = (ScItemValue*) pSource->GetUserData(); + ScItemValue* pItemValue = static_cast<ScItemValue*>(pSource->GetUserData()); ScItemValue* pOriginalItemValue = pItemValue->mpOriginalItemValue; // Don't allow to add "Data" element to page fields diff --git a/sc/source/ui/dbgui/PivotLayoutTreeListBase.cxx b/sc/source/ui/dbgui/PivotLayoutTreeListBase.cxx index ff0c95ea771c..0a54325891d2 100644 --- a/sc/source/ui/dbgui/PivotLayoutTreeListBase.cxx +++ b/sc/source/ui/dbgui/PivotLayoutTreeListBase.cxx @@ -83,7 +83,7 @@ void ScPivotLayoutTreeListBase::PushEntriesToPivotFieldVector(ScPivotFieldVector SvTreeListEntry* pEachEntry; for (pEachEntry = First(); pEachEntry != NULL; pEachEntry = Next(pEachEntry)) { - ScItemValue* pItemValue = (ScItemValue*) pEachEntry->GetUserData(); + ScItemValue* pItemValue = static_cast<ScItemValue*>(pEachEntry->GetUserData()); ScPivotFuncData& rFunctionData = pItemValue->maFunctionData; ScPivotField aField; @@ -107,7 +107,7 @@ void ScPivotLayoutTreeListBase::RemoveEntryForItem(ScItemValue* pItemValue) SvTreeListEntry* pEachEntry; for (pEachEntry = First(); pEachEntry != NULL; pEachEntry = Next(pEachEntry)) { - ScItemValue* pEachItemValue = (ScItemValue*) pEachEntry->GetUserData(); + ScItemValue* pEachItemValue = static_cast<ScItemValue*>(pEachEntry->GetUserData()); if (pEachItemValue == pItemValue) { GetModel()->Remove(pEachEntry); diff --git a/sc/source/ui/dbgui/PivotLayoutTreeListData.cxx b/sc/source/ui/dbgui/PivotLayoutTreeListData.cxx index d0b0be120a2d..e112e9a5b0da 100644 --- a/sc/source/ui/dbgui/PivotLayoutTreeListData.cxx +++ b/sc/source/ui/dbgui/PivotLayoutTreeListData.cxx @@ -73,7 +73,7 @@ ScPivotLayoutTreeListData::~ScPivotLayoutTreeListData() bool ScPivotLayoutTreeListData::DoubleClickHdl() { - ScItemValue* pCurrentItemValue = (ScItemValue*) GetCurEntry()->GetUserData(); + ScItemValue* pCurrentItemValue = static_cast<ScItemValue*>(GetCurEntry()->GetUserData()); ScPivotFuncData& rCurrentFunctionData = pCurrentItemValue->maFunctionData; SCCOL nCurrentColumn = rCurrentFunctionData.mnCol; @@ -149,7 +149,7 @@ void ScPivotLayoutTreeListData::PushDataFieldNames(vector<ScDPName>& rDataFieldN SvTreeListEntry* pLoopEntry; for (pLoopEntry = First(); pLoopEntry != NULL; pLoopEntry = Next(pLoopEntry)) { - ScItemValue* pEachItemValue = (ScItemValue*) pLoopEntry->GetUserData(); + ScItemValue* pEachItemValue = static_cast<ScItemValue*>(pLoopEntry->GetUserData()); SCCOL nColumn = pEachItemValue->maFunctionData.mnCol; ScDPLabelData* pLabelData = mpParent->GetLabelData(nColumn); @@ -172,7 +172,7 @@ void ScPivotLayoutTreeListData::PushDataFieldNames(vector<ScDPName>& rDataFieldN void ScPivotLayoutTreeListData::InsertEntryForSourceTarget(SvTreeListEntry* pSource, SvTreeListEntry* pTarget) { - ScItemValue* pItemValue = (ScItemValue*) pSource->GetUserData(); + ScItemValue* pItemValue = static_cast<ScItemValue*>(pSource->GetUserData()); if(mpParent->IsDataElement(pItemValue->maFunctionData.mnCol)) return; @@ -227,7 +227,7 @@ void ScPivotLayoutTreeListData::AdjustDuplicateCount(ScItemValue* pInputItemValu SvTreeListEntry* pEachEntry; for (pEachEntry = First(); pEachEntry != NULL; pEachEntry = Next(pEachEntry)) { - ScItemValue* pItemValue = (ScItemValue*) pEachEntry->GetUserData(); + ScItemValue* pItemValue = static_cast<ScItemValue*>(pEachEntry->GetUserData()); if (pItemValue == pInputItemValue) continue; diff --git a/sc/source/ui/dbgui/foptmgr.cxx b/sc/source/ui/dbgui/foptmgr.cxx index e1f6f2609775..f17ae254715e 100644 --- a/sc/source/ui/dbgui/foptmgr.cxx +++ b/sc/source/ui/dbgui/foptmgr.cxx @@ -72,7 +72,7 @@ ScFilterOptionsMgr::~ScFilterOptionsMgr() sal_uInt16 i; for ( i=2; i<nEntries; i++ ) - delete (OUString*)pLbCopyArea->GetEntryData( i ); + delete static_cast<OUString*>(pLbCopyArea->GetEntryData( i )); } void ScFilterOptionsMgr::Init() @@ -218,7 +218,7 @@ IMPL_LINK( ScFilterOptionsMgr, LbAreaSelHdl, ListBox*, pLb ) sal_uInt16 nSelPos = pLbCopyArea->GetSelectEntryPos(); if ( nSelPos > 0 ) - aString = *(OUString*)pLbCopyArea->GetEntryData( nSelPos ); + aString = *static_cast<OUString*>(pLbCopyArea->GetEntryData( nSelPos )); pEdCopyArea->SetText( aString ); } @@ -241,7 +241,7 @@ IMPL_LINK( ScFilterOptionsMgr, EdAreaModifyHdl, Edit*, pEd ) for ( i=2; i<nCount && !bFound; i++ ) { - OUString* pStr = (OUString*)pLbCopyArea->GetEntryData( i ); + OUString* pStr = static_cast<OUString*>(pLbCopyArea->GetEntryData( i )); bFound = (theCurPosStr == *pStr); } diff --git a/sc/source/ui/dbgui/sfiltdlg.cxx b/sc/source/ui/dbgui/sfiltdlg.cxx index 5ac8147df318..380278b8c8b8 100644 --- a/sc/source/ui/dbgui/sfiltdlg.cxx +++ b/sc/source/ui/dbgui/sfiltdlg.cxx @@ -101,7 +101,7 @@ ScSpecialFilterDlg::~ScSpecialFilterDlg() sal_uInt16 i; for ( i=1; i<nEntries; i++ ) - delete (OUString*)pLbFilterArea->GetEntryData( i ); + delete static_cast<OUString*>(pLbFilterArea->GetEntryData( i )); delete pOptionsMgr; @@ -413,7 +413,7 @@ IMPL_LINK( ScSpecialFilterDlg, FilterAreaSelHdl, ListBox*, pLb ) sal_uInt16 nSelPos = pLbFilterArea->GetSelectEntryPos(); if ( nSelPos > 0 ) - aString = *(OUString*)pLbFilterArea->GetEntryData( nSelPos ); + aString = *static_cast<OUString*>(pLbFilterArea->GetEntryData( nSelPos )); pEdFilterArea->SetText( aString ); } @@ -438,7 +438,7 @@ IMPL_LINK( ScSpecialFilterDlg, FilterAreaModHdl, formula::RefEdit*, pEd ) for ( i=1; i<nCount && !bFound; i++ ) { - OUString* pStr = (OUString*)pLbFilterArea->GetEntryData( i ); + OUString* pStr = static_cast<OUString*>(pLbFilterArea->GetEntryData( i )); bFound = (theCurAreaStr == *pStr); } diff --git a/sc/source/ui/dbgui/tpsort.cxx b/sc/source/ui/dbgui/tpsort.cxx index ba3703f87fc0..9dbc06600955 100644 --- a/sc/source/ui/dbgui/tpsort.cxx +++ b/sc/source/ui/dbgui/tpsort.cxx @@ -519,7 +519,7 @@ ScTabPageSortOptions::~ScTabPageSortOptions() sal_uInt16 nEntries = m_pLbOutPos->GetEntryCount(); for ( sal_uInt16 i=1; i<nEntries; i++ ) - delete (OUString*)m_pLbOutPos->GetEntryData( i ); + delete static_cast<OUString*>(m_pLbOutPos->GetEntryData( i )); delete pColRes; delete pColWrap; //! not if from document @@ -855,7 +855,7 @@ IMPL_LINK( ScTabPageSortOptions, SelOutPosHdl, ListBox *, pLb ) sal_uInt16 nSelPos = m_pLbOutPos->GetSelectEntryPos(); if ( nSelPos > 0 ) - aString = *(OUString*)m_pLbOutPos->GetEntryData( nSelPos ); + aString = *static_cast<OUString*>(m_pLbOutPos->GetEntryData( nSelPos )); m_pEdOutPos->SetText( aString ); } @@ -890,7 +890,7 @@ void ScTabPageSortOptions::EdOutPosModHdl( Edit* pEd ) for ( i=2; i<nCount && !bFound; i++ ) { - OUString* pStr = (OUString*)m_pLbOutPos->GetEntryData( i ); + OUString* pStr = static_cast<OUString*>(m_pLbOutPos->GetEntryData( i )); bFound = (theCurPosStr == *pStr); } diff --git a/sc/source/ui/dbgui/tpsubt.cxx b/sc/source/ui/dbgui/tpsubt.cxx index ed84bc156f9e..12643fc22c61 100644 --- a/sc/source/ui/dbgui/tpsubt.cxx +++ b/sc/source/ui/dbgui/tpsubt.cxx @@ -73,7 +73,7 @@ ScTpSubTotalGroup::~ScTpSubTotalGroup() { for ( sal_uLong i=0; i<nCount; i++ ) { - sal_uInt16* pData = (sal_uInt16*)(mpLbColumns->GetEntryData( i )); + sal_uInt16* pData = static_cast<sal_uInt16*>(mpLbColumns->GetEntryData( i )); OSL_ENSURE( pData, "EntryData not found" ); delete pData; @@ -116,7 +116,7 @@ bool ScTpSubTotalGroup::DoReset( sal_uInt16 nGroupNo, for ( sal_uLong nLbEntry = 0; nLbEntry < mpLbColumns->GetEntryCount(); ++nLbEntry ) { mpLbColumns->CheckEntryPos( nLbEntry, false ); - *((sal_uInt16*)mpLbColumns->GetEntryData( nLbEntry )) = 0; + *static_cast<sal_uInt16*>(mpLbColumns->GetEntryData( nLbEntry )) = 0; } mpLbFunctions->SelectEntryPos( 0 ); @@ -137,7 +137,7 @@ bool ScTpSubTotalGroup::DoReset( sal_uInt16 nGroupNo, for ( sal_uInt16 i=0; i<nSubTotals; i++ ) { sal_uInt16 nCheckPos = GetFieldSelPos( pSubTotals[i] ); - sal_uInt16* pFunction = (sal_uInt16*)mpLbColumns->GetEntryData( nCheckPos ); + sal_uInt16* pFunction = static_cast<sal_uInt16*>(mpLbColumns->GetEntryData( nCheckPos )); mpLbColumns->CheckEntryPos( nCheckPos ); *pFunction = FuncToLbPos( pFunctions[i] ); @@ -216,7 +216,7 @@ bool ScTpSubTotalGroup::DoFillItemSet( sal_uInt16 nGroupNo, { OSL_ENSURE( nCheck <= nCheckCount, "Range error :-(" ); - nFunction = *((sal_uInt16*)mpLbColumns->GetEntryData( i )); + nFunction = *static_cast<sal_uInt16*>(mpLbColumns->GetEntryData( i )); pSubTotals[nCheck] = nFieldArr[i]; pFunctions[nCheck] = LbPosToFunc( nFunction ); nCheck++; @@ -340,7 +340,7 @@ IMPL_LINK( ScTpSubTotalGroup, SelectHdl, void *, pLb ) { sal_uInt16 nFunction = mpLbFunctions->GetSelectEntryPos(); sal_uInt16 nColumn = mpLbColumns->GetSelectEntryPos(); - sal_uInt16* pFunction = (sal_uInt16*)mpLbColumns->GetEntryData( nColumn ); + sal_uInt16* pFunction = static_cast<sal_uInt16*>(mpLbColumns->GetEntryData( nColumn )); OSL_ENSURE( pFunction, "EntryData not found!" ); if ( !pFunction ) diff --git a/sc/source/ui/docshell/impex.cxx b/sc/source/ui/docshell/impex.cxx index b64ee4c52b7e..806c1b4d7c01 100644 --- a/sc/source/ui/docshell/impex.cxx +++ b/sc/source/ui/docshell/impex.cxx @@ -271,7 +271,7 @@ bool ScImportExport::ExportData( const OUString& rMimeType, { aStrm.WriteUChar( 0 ); rValue <<= ::com::sun::star::uno::Sequence< sal_Int8 >( - (sal_Int8*)aStrm.GetData(), + static_cast<sal_Int8 const *>(aStrm.GetData()), aStrm.Seek( STREAM_SEEK_TO_END ) ); return true; } @@ -323,7 +323,7 @@ bool ScImportExport::ExportString( OUString& rText, SotClipboardFormatId nFmt ) aStrm.WriteUInt16( 0 ); aStrm.Seek( STREAM_SEEK_TO_END ); - rText = OUString( (const sal_Unicode*) aStrm.GetData() ); + rText = OUString( static_cast<const sal_Unicode*>(aStrm.GetData()) ); return true; } rText.clear(); @@ -351,7 +351,7 @@ bool ScImportExport::ExportByteString( OString& rText, rtl_TextEncoding eEnc, So aStrm.Seek( STREAM_SEEK_TO_END ); if( aStrm.Tell() <= nSizeLimit ) { - rText = (const sal_Char*) aStrm.GetData(); + rText = static_cast<const sal_Char*>(aStrm.GetData()); return true; } } diff --git a/sc/source/ui/formdlg/dwfunctr.cxx b/sc/source/ui/formdlg/dwfunctr.cxx index 5809ea5dc720..65604ad60cac 100644 --- a/sc/source/ui/formdlg/dwfunctr.cxx +++ b/sc/source/ui/formdlg/dwfunctr.cxx @@ -551,8 +551,8 @@ void ScFunctionDockWin::SetDescription() { aFiFuncDesc.SetText( EMPTY_OUSTRING ); const ScFuncDesc* pDesc = - (const ScFuncDesc*)pAllFuncList->GetEntryData( - pAllFuncList->GetSelectEntryPos() ); + static_cast<const ScFuncDesc*>(pAllFuncList->GetEntryData( + pAllFuncList->GetSelectEntryPos() )); if (pDesc) { pDesc->initArgumentInfo(); // full argument info is needed @@ -816,8 +816,8 @@ void ScFunctionDockWin::DoEnter() pHdl->ClearText(); } const ScFuncDesc* pDesc = - (const ScFuncDesc*)pAllFuncList->GetEntryData( - pAllFuncList->GetSelectEntryPos() ); + static_cast<const ScFuncDesc*>(pAllFuncList->GetEntryData( + pAllFuncList->GetSelectEntryPos() )); if (pDesc) { pFuncDesc=pDesc; @@ -944,8 +944,8 @@ IMPL_LINK( ScFunctionDockWin, SelHdl, ListBox*, pLb ) IMPL_LINK( ScFunctionDockWin, SetSelectionHdl, void*, pCtrl ) { - if ((ImageButton *)pCtrl == &aInsertButton || - (ListBox *)pCtrl == &aFuncList) + if (static_cast<ImageButton *>(pCtrl) == &aInsertButton || + static_cast<ListBox *>(pCtrl) == &aFuncList) { DoEnter(); // Uebernimmt die Eingabe } diff --git a/sc/source/ui/miscdlgs/acredlin.cxx b/sc/source/ui/miscdlgs/acredlin.cxx index 78f61e52c2d6..cdd661dd36fc 100644 --- a/sc/source/ui/miscdlgs/acredlin.cxx +++ b/sc/source/ui/miscdlgs/acredlin.cxx @@ -941,11 +941,11 @@ IMPL_LINK( ScAcceptChgDlg, RejectHandle, SvxTPView*, pRef ) SvTreeListEntry* pEntry=pTheView->FirstSelected(); while(pEntry!=NULL) { - ScRedlinData *pEntryData=(ScRedlinData *)(pEntry->GetUserData()); + ScRedlinData *pEntryData=static_cast<ScRedlinData *>(pEntry->GetUserData()); if(pEntryData!=NULL) { ScChangeAction* pScChangeAction= - (ScChangeAction*) pEntryData->pData; + static_cast<ScChangeAction*>(pEntryData->pData); if(pScChangeAction->GetType()==SC_CAT_INSERT_TABS) pViewData->SetTabNo(0); @@ -978,11 +978,11 @@ IMPL_LINK( ScAcceptChgDlg, AcceptHandle, SvxTPView*, pRef ) SvTreeListEntry* pEntry=pTheView->FirstSelected(); while(pEntry!=NULL) { - ScRedlinData *pEntryData=(ScRedlinData *)(pEntry->GetUserData()); + ScRedlinData *pEntryData=static_cast<ScRedlinData *>(pEntry->GetUserData()); if(pEntryData!=NULL) { ScChangeAction* pScChangeAction= - (ScChangeAction*) pEntryData->pData; + static_cast<ScChangeAction*>(pEntryData->pData); if(pScChangeAction->GetType()==SC_CAT_CONTENT) { if(pEntryData->nInfo==RD_SPECIAL_CONTENT) @@ -1119,8 +1119,8 @@ void ScAcceptChgDlg::GetDependents( const ScChangeAction* pScChangeAction, SvTreeListEntry* pParent=pTheView->GetParent(pEntry); if(pParent!=NULL) { - ScRedlinData *pParentData=(ScRedlinData *)(pParent->GetUserData()); - ScChangeAction* pParentAction=(ScChangeAction*) pParentData->pData; + ScRedlinData *pParentData=static_cast<ScRedlinData *>(pParent->GetUserData()); + ScChangeAction* pParentAction=static_cast<ScChangeAction*>(pParentData->pData); if(pParentAction!=pScChangeAction) pChanges->GetDependents(const_cast<ScChangeAction*>(pScChangeAction), @@ -1137,8 +1137,8 @@ void ScAcceptChgDlg::GetDependents( const ScChangeAction* pScChangeAction, bool ScAcceptChgDlg::InsertContentChildren(ScChangeActionMap* pActionMap,SvTreeListEntry* pParent) { bool bTheTestFlag = true; - ScRedlinData *pEntryData=(ScRedlinData *)(pParent->GetUserData()); - const ScChangeAction* pScChangeAction = (ScChangeAction*) pEntryData->pData; + ScRedlinData *pEntryData=static_cast<ScRedlinData *>(pParent->GetUserData()); + const ScChangeAction* pScChangeAction = static_cast<ScChangeAction*>(pEntryData->pData); bool bParentInserted = false; // If the parent is a MatrixOrigin then place it in the right order before // the MatrixReferences. Also if it is the first content change at this @@ -1172,7 +1172,7 @@ bool ScAcceptChgDlg::InsertContentChildren(ScChangeActionMap* pActionMap,SvTreeL if(pOriginal!=NULL) { bTheTestFlag=false; - ScRedlinData *pParentData=(ScRedlinData *)(pOriginal->GetUserData()); + ScRedlinData *pParentData=static_cast<ScRedlinData *>(pOriginal->GetUserData()); pParentData->pData=(void *)pScChangeAction; pParentData->nActionNo=pScChangeAction->GetActionNumber(); pParentData->bIsAcceptable=pScChangeAction->IsRejectable(); // select old value @@ -1200,7 +1200,7 @@ bool ScAcceptChgDlg::InsertContentChildren(ScChangeActionMap* pActionMap,SvTreeL if(pEntry!=NULL) { bTheTestFlag=false; - ScRedlinData *pParentData=(ScRedlinData *)(pEntry->GetUserData()); + ScRedlinData *pParentData=static_cast<ScRedlinData *>(pEntry->GetUserData()); pParentData->pData=(void *)pScChangeAction; pParentData->nActionNo=pScChangeAction->GetActionNumber(); pParentData->bIsAcceptable=pScChangeAction->IsClickable(); @@ -1255,7 +1255,7 @@ bool ScAcceptChgDlg::InsertChildren(ScChangeActionMap* pActionMap,SvTreeListEntr { bTheTestFlag=false; - ScRedlinData *pEntryData=(ScRedlinData *)(pEntry->GetUserData()); + ScRedlinData *pEntryData=static_cast<ScRedlinData *>(pEntry->GetUserData()); pEntryData->bIsRejectable=false; pEntryData->bIsAcceptable=false; pEntryData->bDisabled=true; @@ -1285,7 +1285,7 @@ bool ScAcceptChgDlg::InsertDeletedChildren(const ScChangeAction* pScChangeAction if(pEntry!=NULL) { - ScRedlinData *pEntryData=(ScRedlinData *)(pEntry->GetUserData()); + ScRedlinData *pEntryData=static_cast<ScRedlinData *>(pEntry->GetUserData()); pEntryData->bIsRejectable=false; pEntryData->bIsAcceptable=false; pEntryData->bDisabled=true; @@ -1351,9 +1351,9 @@ IMPL_LINK( ScAcceptChgDlg, ExpandingHandle, SvxRedlinTable*, pTable ) { ScChangeAction* pScChangeAction=NULL; - ScRedlinData *pEntryData=(ScRedlinData *)(pEntry->GetUserData()); + ScRedlinData *pEntryData=static_cast<ScRedlinData *>(pEntry->GetUserData()); if(pEntryData!=NULL) - pScChangeAction=(ScChangeAction*) pEntryData->pData; + pScChangeAction=static_cast<ScChangeAction*>(pEntryData->pData); if(pEntry->HasChildrenOnDemand()) { @@ -1365,7 +1365,7 @@ IMPL_LINK( ScAcceptChgDlg, ExpandingHandle, SvxRedlinTable*, pTable ) if(pEntryData!=NULL) { - pScChangeAction=(ScChangeAction*) pEntryData->pData; + pScChangeAction=static_cast<ScChangeAction*>(pEntryData->pData); GetDependents( pScChangeAction, aActionMap, pEntry ); @@ -1493,7 +1493,7 @@ void ScAcceptChgDlg::RemoveEntrys(sal_uLong nStartAction,sal_uLong nEndAction) ScRedlinData *pEntryData=NULL; if(pEntry!=NULL) - pEntryData=(ScRedlinData *)(pEntry->GetUserData()); + pEntryData=static_cast<ScRedlinData *>(pEntry->GetUserData()); sal_uLong nAction=0; if(pEntryData!=NULL) @@ -1508,7 +1508,7 @@ void ScAcceptChgDlg::RemoveEntrys(sal_uLong nStartAction,sal_uLong nEndAction) while(pEntry!=NULL) { bool bRemove = false; - pEntryData=(ScRedlinData *)(pEntry->GetUserData()); + pEntryData=static_cast<ScRedlinData *>(pEntry->GetUserData()); if(pEntryData!=NULL) { nAction=pEntryData->nActionNo; @@ -1540,11 +1540,11 @@ void ScAcceptChgDlg::UpdateEntrys(ScChangeTrack* pChgTrack, sal_uLong nStartActi while(pEntry!=NULL) { bool bRemove = false; - ScRedlinData *pEntryData=(ScRedlinData *)(pEntry->GetUserData()); + ScRedlinData *pEntryData=static_cast<ScRedlinData *>(pEntry->GetUserData()); if(pEntryData!=NULL) { ScChangeAction* pScChangeAction= - (ScChangeAction*) pEntryData->pData; + static_cast<ScChangeAction*>(pEntryData->pData); sal_uLong nAction=pScChangeAction->GetActionNumber(); @@ -1649,13 +1649,13 @@ IMPL_LINK_NOARG(ScAcceptChgDlg, UpdateSelectionHdl) SvTreeListEntry* pEntry = pTheView->FirstSelected(); while( pEntry ) { - ScRedlinData* pEntryData = (ScRedlinData*) pEntry->GetUserData(); + ScRedlinData* pEntryData = static_cast<ScRedlinData*>(pEntry->GetUserData()); if( pEntryData ) { bRejectFlag &= (bool) pEntryData->bIsRejectable; bAcceptFlag &= (bool) pEntryData->bIsAcceptable; - const ScChangeAction* pScChangeAction = (ScChangeAction*) pEntryData->pData; + const ScChangeAction* pScChangeAction = static_cast<ScChangeAction*>(pEntryData->pData); if( pScChangeAction && (pScChangeAction->GetType() != SC_CAT_DELETE_TABS) && (!pEntryData->bDisabled || pScChangeAction->IsVisible()) ) { @@ -1726,11 +1726,11 @@ IMPL_LINK_NOARG(ScAcceptChgDlg, CommandHdl) if(pDoc->IsDocEditable() && pEntry!=NULL) { - ScRedlinData *pEntryData=(ScRedlinData *)(pEntry->GetUserData()); + ScRedlinData *pEntryData=static_cast<ScRedlinData *>(pEntry->GetUserData()); if(pEntryData!=NULL) { ScChangeAction* pScChangeAction= - (ScChangeAction*) pEntryData->pData; + static_cast<ScChangeAction*>(pEntryData->pData); if(pScChangeAction!=NULL && !pTheView->GetParent(pEntry)) aPopup.EnableItem(SC_CHANGES_COMMENT); } @@ -1744,11 +1744,11 @@ IMPL_LINK_NOARG(ScAcceptChgDlg, CommandHdl) { if(pEntry!=NULL) { - ScRedlinData *pEntryData=(ScRedlinData *)(pEntry->GetUserData()); + ScRedlinData *pEntryData=static_cast<ScRedlinData *>(pEntry->GetUserData()); if(pEntryData!=NULL) { ScChangeAction* pScChangeAction= - (ScChangeAction*) pEntryData->pData; + static_cast<ScChangeAction*>(pEntryData->pData); pViewData->GetDocShell()->ExecuteChangeCommentDialog( pScChangeAction, this,false); } @@ -1879,8 +1879,8 @@ IMPL_LINK( ScAcceptChgDlg, ColCompareHdl, SvSortData*, pSortData ) if(CALC_DATE==nSortCol) { - RedlinData *pLeftData=(RedlinData *)(pLeft->GetUserData()); - RedlinData *pRightData=(RedlinData *)(pRight->GetUserData()); + RedlinData *pLeftData=static_cast<RedlinData *>(pLeft->GetUserData()); + RedlinData *pRightData=static_cast<RedlinData *>(pRight->GetUserData()); if(pLeftData!=NULL && pRightData!=NULL) { @@ -1893,8 +1893,8 @@ IMPL_LINK( ScAcceptChgDlg, ColCompareHdl, SvSortData*, pSortData ) } else if(CALC_POS==nSortCol) { - ScRedlinData *pLeftData=(ScRedlinData *)(pLeft->GetUserData()); - ScRedlinData *pRightData=(ScRedlinData *)(pRight->GetUserData()); + ScRedlinData *pLeftData=static_cast<ScRedlinData *>(pLeft->GetUserData()); + ScRedlinData *pRightData=static_cast<ScRedlinData *>(pRight->GetUserData()); if(pLeftData!=NULL && pRightData!=NULL) { diff --git a/sc/source/ui/pagedlg/areasdlg.cxx b/sc/source/ui/pagedlg/areasdlg.cxx index e28f0226c79a..c95aa13cc69b 100644 --- a/sc/source/ui/pagedlg/areasdlg.cxx +++ b/sc/source/ui/pagedlg/areasdlg.cxx @@ -143,7 +143,7 @@ ScPrintAreasDlg::~ScPrintAreasDlg() { sal_uInt16 nCount = aLb[i]->GetEntryCount(); for ( sal_uInt16 j=0; j<nCount; j++ ) - delete (OUString*)aLb[i]->GetEntryData(j); + delete static_cast<OUString*>(aLb[i]->GetEntryData(j)); } } @@ -590,7 +590,7 @@ IMPL_LINK( ScPrintAreasDlg, Impl_ModifyHdl, formula::RefEdit*, pEd ) for ( i=nFirstCustomPos; i<nEntryCount && !bFound; i++ ) { - OUString* pSymbol = (OUString*)pLb->GetEntryData( i ); + OUString* pSymbol = static_cast<OUString*>(pLb->GetEntryData( i )); bFound = ( (*pSymbol) ==aStrEd || (*pSymbol) == aEdUpper ); } diff --git a/sc/source/ui/unoobj/docuno.cxx b/sc/source/ui/unoobj/docuno.cxx index b9e2bf45be45..75300bd3a02d 100644 --- a/sc/source/ui/unoobj/docuno.cxx +++ b/sc/source/ui/unoobj/docuno.cxx @@ -626,7 +626,7 @@ uno::Sequence<uno::Type> SAL_CALL ScModelObj::getTypes() throw(uno::RuntimeExcep if(aNumProv.getValueType() == rProvType) { uno::Reference<lang::XTypeProvider> xNumProv( - *(uno::Reference<lang::XTypeProvider>*)aNumProv.getValue()); + *static_cast<uno::Reference<lang::XTypeProvider> const *>(aNumProv.getValue())); aAggTypes = xNumProv->getTypes(); } } @@ -2216,7 +2216,7 @@ sal_Int64 SAL_CALL ScModelObj::getSomething( if(aNumTunnel.getValueType() == rTunnelType) { uno::Reference<lang::XUnoTunnel> xTunnelAgg( - *(uno::Reference<lang::XUnoTunnel>*)aNumTunnel.getValue()); + *static_cast<uno::Reference<lang::XUnoTunnel> const *>(aNumTunnel.getValue())); return xTunnelAgg->getSomething( rId ); } } diff --git a/sc/source/ui/unoobj/miscuno.cxx b/sc/source/ui/unoobj/miscuno.cxx index d73c00f4402d..3d595a6b9542 100644 --- a/sc/source/ui/unoobj/miscuno.cxx +++ b/sc/source/ui/unoobj/miscuno.cxx @@ -51,7 +51,7 @@ bool ScUnoHelpFunctions::GetBoolProperty( const uno::Reference<beans::XPropertyS if ( aAny.getValueTypeClass() == uno::TypeClass_BOOLEAN ) { //! safe way to get bool value from any??? - bRet = *(sal_Bool*)aAny.getValue(); + bRet = *static_cast<sal_Bool const *>(aAny.getValue()); } } catch(uno::Exception&) @@ -94,7 +94,7 @@ sal_Int32 ScUnoHelpFunctions::GetEnumProperty( const uno::Reference<beans::XProp if ( aAny.getValueTypeClass() == uno::TypeClass_ENUM ) { //! get enum value from any??? - nRet = *(sal_Int32*)aAny.getValue(); + nRet = *static_cast<sal_Int32 const *>(aAny.getValue()); } else { @@ -132,7 +132,7 @@ OUString ScUnoHelpFunctions::GetStringProperty( bool ScUnoHelpFunctions::GetBoolFromAny( const uno::Any& aAny ) { if ( aAny.getValueTypeClass() == uno::TypeClass_BOOLEAN ) - return *(sal_Bool*)aAny.getValue(); + return *static_cast<sal_Bool const *>(aAny.getValue()); return false; } @@ -156,7 +156,7 @@ sal_Int32 ScUnoHelpFunctions::GetEnumFromAny( const uno::Any& aAny ) { sal_Int32 nRet = 0; if ( aAny.getValueTypeClass() == uno::TypeClass_ENUM ) - nRet = *(sal_Int32*)aAny.getValue(); + nRet = *static_cast<sal_Int32 const *>(aAny.getValue()); else aAny >>= nRet; return nRet; diff --git a/sc/source/ui/vba/vbarange.cxx b/sc/source/ui/vba/vbarange.cxx index 992dce44e17b..296c30608bf5 100644 --- a/sc/source/ui/vba/vbarange.cxx +++ b/sc/source/ui/vba/vbarange.cxx @@ -957,7 +957,7 @@ protected: ValueGetter& mValueGetter; void processValue( sal_Int32 x, sal_Int32 y, const uno::Any& aValue ) { - uno::Sequence< uno::Sequence< uno::Any > >& aMatrix = *( uno::Sequence< uno::Sequence< uno::Any > >* )( maValue.getValue() ); + uno::Sequence< uno::Sequence< uno::Any > >& aMatrix = *const_cast<css::uno::Sequence<css::uno::Sequence<css::uno::Any>> *>(static_cast<uno::Sequence< uno::Sequence< uno::Any > > const *>(maValue.getValue())); aMatrix[x][y] = aValue; } |