Kaydet (Commit) ea1c1ad8 authored tarafından August Sodora's avatar August Sodora

cppcheck: C-style pointer casting

üst 48796870
...@@ -328,7 +328,7 @@ void BasicLibBox::Select() ...@@ -328,7 +328,7 @@ void BasicLibBox::Select()
void BasicLibBox::NotifyIDE() void BasicLibBox::NotifyIDE()
{ {
sal_uInt16 nSelPos = GetSelectEntryPos(); sal_uInt16 nSelPos = GetSelectEntryPos();
BasicLibEntry* pEntry = (BasicLibEntry*)GetEntryData( nSelPos ); BasicLibEntry* pEntry = static_cast<BasicLibEntry*>(GetEntryData( nSelPos ));
if ( pEntry ) if ( pEntry )
{ {
ScriptDocument aDocument( pEntry->GetDocument() ); ScriptDocument aDocument( pEntry->GetDocument() );
...@@ -352,7 +352,7 @@ void BasicLibBox::ClearBox() ...@@ -352,7 +352,7 @@ void BasicLibBox::ClearBox()
sal_uInt16 nCount = GetEntryCount(); sal_uInt16 nCount = GetEntryCount();
for ( sal_uInt16 i = 0; i < nCount; ++i ) for ( sal_uInt16 i = 0; i < nCount; ++i )
{ {
BasicLibEntry* pEntry = (BasicLibEntry*)GetEntryData( i ); BasicLibEntry* pEntry = static_cast<BasicLibEntry*>(GetEntryData( i ));
delete pEntry; delete pEntry;
} }
ListBox::Clear(); ListBox::Clear();
......
...@@ -148,7 +148,7 @@ public: ...@@ -148,7 +148,7 @@ public:
EditorWindow( Window* pParent ); EditorWindow( Window* pParent );
~EditorWindow(); ~EditorWindow();
ExtTextEngine* GetEditEngine() const { return (ExtTextEngine*)pEditEngine; } ExtTextEngine* GetEditEngine() const { return pEditEngine; }
ExtTextView* GetEditView() const { return pEditView; } ExtTextView* GetEditView() const { return pEditView; }
ProgressInfo* GetProgress() const { return pProgress; } ProgressInfo* GetProgress() const { return pProgress; }
......
...@@ -769,7 +769,7 @@ void EditorWindow::ImpDoHighlight( sal_uLong nLine ) ...@@ -769,7 +769,7 @@ void EditorWindow::ImpDoHighlight( sal_uLong nLine )
for ( size_t i = 0; i < aPortions.size(); i++ ) for ( size_t i = 0; i < aPortions.size(); i++ )
{ {
HighlightPortion& r = aPortions[i]; HighlightPortion& r = aPortions[i];
const Color& rColor = ((ModulWindowLayout*)pModulWindow->GetLayoutWindow())->getSyntaxColor(r.tokenType); const Color& rColor = dynamic_cast<ModulWindowLayout*>(pModulWindow->GetLayoutWindow())->getSyntaxColor(r.tokenType);
pEditEngine->SetAttrib( TextAttribFontColor( rColor ), nLine, r.nBegin, r.nEnd, sal_True ); pEditEngine->SetAttrib( TextAttribFontColor( rColor ), nLine, r.nBegin, r.nEnd, sal_True );
} }
...@@ -960,10 +960,10 @@ void BreakPointWindow::Paint( const Rectangle& ) ...@@ -960,10 +960,10 @@ void BreakPointWindow::Paint( const Rectangle& )
Size aOutSz( GetOutputSize() ); Size aOutSz( GetOutputSize() );
long nLineHeight = GetTextHeight(); long nLineHeight = GetTextHeight();
Image aBrk1(((ModulWindowLayout *) pModulWindow->GetLayoutWindow())-> ModulWindowLayout* pModulWindowLayout = dynamic_cast<ModulWindowLayout*>(pModulWindow->GetLayoutWindow());
getImage(IMGID_BRKENABLED));
Image aBrk0(((ModulWindowLayout *) pModulWindow->GetLayoutWindow())-> Image aBrk1(pModulWindowLayout->getImage(IMGID_BRKENABLED));
getImage(IMGID_BRKDISABLED)); Image aBrk0(pModulWindowLayout->getImage(IMGID_BRKDISABLED));
Size aBmpSz( aBrk1.GetSizePixel() ); Size aBmpSz( aBrk1.GetSizePixel() );
aBmpSz = PixelToLogic( aBmpSz ); aBmpSz = PixelToLogic( aBmpSz );
Point aBmpOff( 0, 0 ); Point aBmpOff( 0, 0 );
...@@ -1009,9 +1009,8 @@ void BreakPointWindow::ShowMarker( sal_Bool bShow ) ...@@ -1009,9 +1009,8 @@ void BreakPointWindow::ShowMarker( sal_Bool bShow )
Size aOutSz( GetOutputSize() ); Size aOutSz( GetOutputSize() );
long nLineHeight = GetTextHeight(); long nLineHeight = GetTextHeight();
Image aMarker(((ModulWindowLayout*)pModulWindow->GetLayoutWindow())-> ModulWindowLayout* pModulWindowLayout = dynamic_cast<ModulWindowLayout*>(pModulWindow->GetLayoutWindow());
getImage(bErrorMarker Image aMarker(pModulWindowLayout->getImage(bErrorMarker ? IMGID_ERRORMARKER : IMGID_STEPMARKER));
? IMGID_ERRORMARKER : IMGID_STEPMARKER));
Size aMarkerSz( aMarker.GetSizePixel() ); Size aMarkerSz( aMarker.GetSizePixel() );
aMarkerSz = PixelToLogic( aMarkerSz ); aMarkerSz = PixelToLogic( aMarkerSz );
......
...@@ -205,7 +205,7 @@ bool RenameModule( Window* pErrorParent, const ScriptDocument& rDocument, const ...@@ -205,7 +205,7 @@ bool RenameModule( Window* pErrorParent, const ScriptDocument& rDocument, const
pWin->SetName( rNewName ); pWin->SetName( rNewName );
// set new module in module window // set new module in module window
ModulWindow* pModWin = (ModulWindow*)pWin; ModulWindow* pModWin = dynamic_cast<ModulWindow*>(pWin);
pModWin->SetSbModule( (SbModule*)pModWin->GetBasic()->FindModule( rNewName ) ); pModWin->SetSbModule( (SbModule*)pModWin->GetBasic()->FindModule( rNewName ) );
// update tabwriter // update tabwriter
...@@ -308,7 +308,7 @@ namespace ...@@ -308,7 +308,7 @@ namespace
SbModule* pModule = pMethod->GetModule(); SbModule* pModule = pMethod->GetModule();
ENSURE_OR_BREAK( pModule, "BasicIDE::ChooseMacro: No Module found!" ); ENSURE_OR_BREAK( pModule, "BasicIDE::ChooseMacro: No Module found!" );
StarBASIC* pBasic = (StarBASIC*)pModule->GetParent(); StarBASIC* pBasic = dynamic_cast<StarBASIC*>(pModule->GetParent());
ENSURE_OR_BREAK( pBasic, "BasicIDE::ChooseMacro: No Basic found!" ); ENSURE_OR_BREAK( pBasic, "BasicIDE::ChooseMacro: No Basic found!" );
BasicManager* pBasMgr = BasicIDE::FindBasicManager( pBasic ); BasicManager* pBasMgr = BasicIDE::FindBasicManager( pBasic );
......
...@@ -182,7 +182,7 @@ BasicCheckBox::~BasicCheckBox() ...@@ -182,7 +182,7 @@ BasicCheckBox::~BasicCheckBox()
SvLBoxEntry* pEntry = First(); SvLBoxEntry* pEntry = First();
while ( pEntry ) while ( pEntry )
{ {
delete (BasicLibUserData*)pEntry->GetUserData(); delete static_cast<BasicLibUserData*>(pEntry->GetUserData());
pEntry = Next( pEntry ); pEntry = Next( pEntry );
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment