summaryrefslogtreecommitdiff
path: root/basctl
diff options
context:
space:
mode:
authorUray M. János <uray.janos@gmail.com>2012-08-07 15:22:25 +0200
committerTor Lillqvist <tlillqvist@suse.com>2012-08-07 16:27:34 +0300
commit5f3a75f97e4c4235c865c2687c3bfca37e19811b (patch)
tree79d9bda009fd840947804115d5fa3dbe63c4220b /basctl
parent3494780dcdb98b70fca4f28c354eec9c081b59c5 (diff)
IDE: dynamic_cast fix
Change-Id: Ia8826be6e6fe7c09adb4f0104b52ceba6b89163b
Diffstat (limited to 'basctl')
-rw-r--r--basctl/source/accessibility/accessibledialogwindow.cxx12
-rw-r--r--basctl/source/basicide/baside2b.cxx10
-rw-r--r--basctl/source/basicide/basides1.cxx6
-rw-r--r--basctl/source/basicide/basidesh.cxx4
-rw-r--r--basctl/source/basicide/basobj3.cxx6
-rw-r--r--basctl/source/basicide/bastype3.cxx2
-rw-r--r--basctl/source/basicide/localizationmgr.cxx2
-rw-r--r--basctl/source/basicide/tbxctl.cxx5
-rw-r--r--basctl/source/dlged/dlgedobj.cxx2
9 files changed, 25 insertions, 24 deletions
diff --git a/basctl/source/accessibility/accessibledialogwindow.cxx b/basctl/source/accessibility/accessibledialogwindow.cxx
index 2982cda8918a..4621e7e52f4a 100644
--- a/basctl/source/accessibility/accessibledialogwindow.cxx
+++ b/basctl/source/accessibility/accessibledialogwindow.cxx
@@ -513,15 +513,15 @@ awt::Rectangle AccessibleDialogWindow::implGetBounds() throw (RuntimeException)
void AccessibleDialogWindow::Notify( SfxBroadcaster&, const SfxHint& rHint )
{
- if (SdrHint* pSdrHint = dynamic_cast<SdrHint*>(&rHint))
+ if (SdrHint const* pSdrHint = dynamic_cast<SdrHint const*>(&rHint))
{
switch ( pSdrHint->GetKind() )
{
case HINT_OBJINSERTED:
{
- if (DlgEdObj* pDlgEdObj = dynamic_cast<DlgEdObj*>(pSdrHint->GetObject()))
+ if (DlgEdObj const* pDlgEdObj = dynamic_cast<DlgEdObj const*>(pSdrHint->GetObject()))
{
- ChildDescriptor aDesc( pDlgEdObj );
+ ChildDescriptor aDesc(const_cast<DlgEdObj*>(pDlgEdObj));
if ( IsChildVisible( aDesc ) )
InsertChild( aDesc );
}
@@ -529,14 +529,14 @@ void AccessibleDialogWindow::Notify( SfxBroadcaster&, const SfxHint& rHint )
break;
case HINT_OBJREMOVED:
{
- if (DlgEdObj* pDlgEdObj = dynamic_cast<DlgEdObj*>(pSdrHint->GetObject()))
- RemoveChild( ChildDescriptor( pDlgEdObj ) );
+ if (DlgEdObj const* pDlgEdObj = dynamic_cast<DlgEdObj const*>(pSdrHint->GetObject()))
+ RemoveChild( ChildDescriptor(const_cast<DlgEdObj*>(pDlgEdObj)) );
}
break;
default: ;
}
}
- else if (DlgEdHint* pDlgEdHint = dynamic_cast<DlgEdHint*>(&rHint))
+ else if (DlgEdHint const* pDlgEdHint = dynamic_cast<DlgEdHint const*>(&rHint))
{
switch ( pDlgEdHint->GetKind() )
{
diff --git a/basctl/source/basicide/baside2b.cxx b/basctl/source/basicide/baside2b.cxx
index 0f11e8433343..dd6337e6601b 100644
--- a/basctl/source/basicide/baside2b.cxx
+++ b/basctl/source/basicide/baside2b.cxx
@@ -54,10 +54,10 @@ long nVirtToolBoxHeight; // inited in WatchWindow, used in Stackwindow
long nHeaderBarHeight;
// Returns pBase converted to SbxVariable if valid and is not an SbxMethod.
-SbxVariable const* IsSbxVariable (SbxBase const* pBase)
+SbxVariable* IsSbxVariable (SbxBase* pBase)
{
- if (SbxVariable const* pVar = dynamic_cast<SbxVariable const*>(pBase))
- if (!dynamic_cast<SbxMethod const*>(pVar))
+ if (SbxVariable* pVar = dynamic_cast<SbxVariable*>(pBase))
+ if (!dynamic_cast<SbxMethod*>(pVar))
return pVar;
return 0;
}
@@ -1933,7 +1933,7 @@ sal_Bool WatchTreeListBox::EditingEntry( SvLBoxEntry* pEntry, Selection& )
{
// No out of scope entries
bool bArrayElement;
- SbxBase const* pSbx = ImplGetSBXForEntry( pEntry, bArrayElement );
+ SbxBase* pSbx = ImplGetSBXForEntry( pEntry, bArrayElement );
if (IsSbxVariable(pSbx) || bArrayElement)
{
// Accept no objects and only end nodes of arrays for editing
@@ -1970,7 +1970,7 @@ bool WatchTreeListBox::ImplBasicEntryEdited( SvLBoxEntry* pEntry, const String&
bool bArrayElement;
SbxBase* pSBX = ImplGetSBXForEntry( pEntry, bArrayElement );
- if (SbxVariable const* pVar = IsSbxVariable(pSBX))
+ if (SbxVariable* pVar = IsSbxVariable(pSBX))
{
SbxDataType eType = pVar->GetType();
if ( (sal_uInt8)eType != (sal_uInt8)SbxOBJECT
diff --git a/basctl/source/basicide/basides1.cxx b/basctl/source/basicide/basides1.cxx
index 06ed7528a6d3..97447f49566f 100644
--- a/basctl/source/basicide/basides1.cxx
+++ b/basctl/source/basicide/basides1.cxx
@@ -160,7 +160,7 @@ void BasicIDEShell::ExecuteCurrent( SfxRequest& rReq )
{
IDEBaseWindow* pWin = it->second;
if (!pWin->IsSuspended())
- if (pModulWindow* pMWin = dynamic_cast<ModulWindow*>(pWin))
+ if (ModulWindow* pMWin = dynamic_cast<ModulWindow*>(pWin))
nFound += pMWin->StartSearchAndReplace(*pSearchItem);
}
}
@@ -277,7 +277,7 @@ void BasicIDEShell::ExecuteCurrent( SfxRequest& rReq )
sal_Int32 nLine = xGotoDlg->GetLineNumber();
if ( nLine )
- ((ModulWindow*)pCurWin)->GetEditView()->SetSelection( TextSelection( TextPaM( nLine - 1 , 0 ), TextPaM( nLine - 1, 0 ) ) );
+ pMCurWin->GetEditView()->SetSelection( TextSelection( TextPaM( nLine - 1 , 0 ), TextPaM( nLine - 1, 0 ) ) );
}
}
}
@@ -1424,7 +1424,7 @@ void BasicIDEShell::Activate( sal_Bool bMDI )
if ( bMDI )
{
- if (DialogWindow* pDCurWin = dynamic_cast<DialogWindow>(pCurWin))
+ if (DialogWindow* pDCurWin = dynamic_cast<DialogWindow*>(pCurWin))
pDCurWin->UpdateBrowser();
}
}
diff --git a/basctl/source/basicide/basidesh.cxx b/basctl/source/basicide/basidesh.cxx
index b59882c94229..b271811695f8 100644
--- a/basctl/source/basicide/basidesh.cxx
+++ b/basctl/source/basicide/basidesh.cxx
@@ -530,7 +530,7 @@ void BasicIDEShell::SFX_NOTIFY( SfxBroadcaster& rBC, const TypeId&,
{
if ( BasicIDEGlobals::GetShell() )
{
- if (SfxSimpleHint* pSimpleHint = dynamic_cast<SfxSimpleHint*>(&rHint))
+ if (SfxSimpleHint const* pSimpleHint = dynamic_cast<SfxSimpleHint const*>(&rHint))
{
switch (pSimpleHint->GetId())
{
@@ -542,7 +542,7 @@ void BasicIDEShell::SFX_NOTIFY( SfxBroadcaster& rBC, const TypeId&,
break;
}
- if (SbxHint* pSbxHint = dynamic_cast<SbxHint*>(&rHint))
+ if (SbxHint const* pSbxHint = dynamic_cast<SbxHint const*>(&rHint))
{
sal_uLong nHintId = pSbxHint->GetId();
if ( ( nHintId == SBX_HINT_BASICSTART ) ||
diff --git a/basctl/source/basicide/basobj3.cxx b/basctl/source/basicide/basobj3.cxx
index 61d9c53838fc..7325904540c9 100644
--- a/basctl/source/basicide/basobj3.cxx
+++ b/basctl/source/basicide/basobj3.cxx
@@ -244,10 +244,10 @@ bool RemoveDialog( const ScriptDocument& rDocument, const ::rtl::OUString& rLibN
StarBASIC* FindBasic( const SbxVariable* pVar )
{
- const SbxVariable* pSbx = pVar;
- while (pSbx && !dynamic_cast<StarBASIC*>(pSbx))
+ SbxVariable const* pSbx = pVar;
+ while (pSbx && !dynamic_cast<StarBASIC const*>(pSbx))
pSbx = pSbx->GetParent();
- return static_cast<StarBASIC*>(pSbx);
+ return (StarBASIC*)pSbx;
}
//----------------------------------------------------------------------------
diff --git a/basctl/source/basicide/bastype3.cxx b/basctl/source/basicide/bastype3.cxx
index 45253e169eee..bd5f3bcc0234 100644
--- a/basctl/source/basicide/bastype3.cxx
+++ b/basctl/source/basicide/bastype3.cxx
@@ -464,7 +464,7 @@ SvLBoxEntry* BasicTreeListBox::FindRootEntry( const ScriptDocument& rDocument, L
while ( pRootEntry )
{
DBG_ASSERT( static_cast<BasicEntry*>(pRootEntry->GetUserData())->GetType() == OBJ_TYPE_DOCUMENT, "Kein Shelleintrag?" );
- BasicDocumentEntry* pBDEntry = static_cast<BasicDocEntry*>(pRootEntry->GetUserData());
+ BasicDocumentEntry* pBDEntry = static_cast<BasicDocumentEntry*>(pRootEntry->GetUserData());
if (pBDEntry && pBDEntry->GetDocument() == rDocument && pBDEntry->GetLocation() == eLocation)
return pRootEntry;
pRootEntry = GetEntry( ++nRootPos );
diff --git a/basctl/source/basicide/localizationmgr.cxx b/basctl/source/basicide/localizationmgr.cxx
index 1786e490325f..ea439314e3e6 100644
--- a/basctl/source/basicide/localizationmgr.cxx
+++ b/basctl/source/basicide/localizationmgr.cxx
@@ -815,7 +815,7 @@ DialogWindow* FindDialogWindowForEditor( DlgEditor* pEditor )
{
DlgEditor* pWinEditor = pDlgWin->GetEditor();
if( pWinEditor == pEditor )
- return pFoundDlgWin;
+ return pDlgWin;
}
}
return 0;
diff --git a/basctl/source/basicide/tbxctl.cxx b/basctl/source/basicide/tbxctl.cxx
index a80381b276de..6052b47ea28a 100644
--- a/basctl/source/basicide/tbxctl.cxx
+++ b/basctl/source/basicide/tbxctl.cxx
@@ -67,10 +67,11 @@ void TbxControls::StateChanged( sal_uInt16 nSID, SfxItemState eState,
{
if( pState )
{
- if (SfxAllEnumItem* pItem = dynamic_cast<SfxAllEnumItem*>(pState))
+ if (SfxAllEnumItem const* pItem = dynamic_cast<SfxAllEnumItem const*>(pState))
{
sal_uInt16 nTemp = 0;
- switch (sal_uInt16 nLastEnum = pItem->GetValue())
+ sal_uInt16 nLastEnum = pItem->GetValue();
+ switch (nLastEnum)
{
case SVX_SNAP_PUSHBUTTON: nTemp = SID_INSERT_PUSHBUTTON; break;
case SVX_SNAP_CHECKBOX: nTemp = SID_INSERT_CHECKBOX; break;
diff --git a/basctl/source/dlged/dlgedobj.cxx b/basctl/source/dlged/dlgedobj.cxx
index 41ae1cb0ee0b..38f4fbcb8866 100644
--- a/basctl/source/dlged/dlgedobj.cxx
+++ b/basctl/source/dlged/dlgedobj.cxx
@@ -1240,7 +1240,7 @@ void SAL_CALL DlgEdObj::_propertyChange( const ::com::sun::star::beans::Propert
// change tabindex
else if ( evt.PropertyName == DLGED_PROP_TABINDEX )
{
- if (!dynamic_cast<DlgEdForm>(this))
+ if (!dynamic_cast<DlgEdForm*>(this))
TabIndexChange(evt);
}
}