basctl/source/basicide/basicbox.cxx |    4 ++--
 basctl/source/basicide/baside2.hxx  |    2 +-
 basctl/source/basicide/baside2b.cxx |   15 +++++++--------
 basctl/source/basicide/basobj2.cxx  |    4 ++--
 basctl/source/basicide/moduldl2.cxx |    2 +-
 5 files changed, 13 insertions(+), 14 deletions(-)

New commits:
commit ea1c1ad843d219bc2e6d99d72998eb8a00805493
Author: August Sodora <aug...@gmail.com>
Date:   Mon Nov 21 20:13:24 2011 -0500

    cppcheck: C-style pointer casting

diff --git a/basctl/source/basicide/basicbox.cxx 
b/basctl/source/basicide/basicbox.cxx
index 2a5a7ca..7e20bca 100644
--- a/basctl/source/basicide/basicbox.cxx
+++ b/basctl/source/basicide/basicbox.cxx
@@ -328,7 +328,7 @@ void BasicLibBox::Select()
 void BasicLibBox::NotifyIDE()
 {
     sal_uInt16 nSelPos = GetSelectEntryPos();
-    BasicLibEntry* pEntry = (BasicLibEntry*)GetEntryData( nSelPos );
+    BasicLibEntry* pEntry = static_cast<BasicLibEntry*>(GetEntryData( nSelPos 
));
     if ( pEntry )
     {
         ScriptDocument aDocument( pEntry->GetDocument() );
@@ -352,7 +352,7 @@ void BasicLibBox::ClearBox()
     sal_uInt16 nCount = GetEntryCount();
     for ( sal_uInt16 i = 0; i < nCount; ++i )
     {
-        BasicLibEntry* pEntry = (BasicLibEntry*)GetEntryData( i );
+        BasicLibEntry* pEntry = static_cast<BasicLibEntry*>(GetEntryData( i ));
         delete pEntry;
     }
     ListBox::Clear();
diff --git a/basctl/source/basicide/baside2.hxx 
b/basctl/source/basicide/baside2.hxx
index 48a65c9..ebf501e 100644
--- a/basctl/source/basicide/baside2.hxx
+++ b/basctl/source/basicide/baside2.hxx
@@ -148,7 +148,7 @@ public:
                     EditorWindow( Window* pParent );
                     ~EditorWindow();
 
-    ExtTextEngine*  GetEditEngine() const   { return 
(ExtTextEngine*)pEditEngine; }
+    ExtTextEngine*  GetEditEngine() const   { return pEditEngine; }
     ExtTextView*    GetEditView() const     { return pEditView; }
     ProgressInfo*   GetProgress() const     { return pProgress; }
 
diff --git a/basctl/source/basicide/baside2b.cxx 
b/basctl/source/basicide/baside2b.cxx
index 1fb174a..ac42db8 100644
--- a/basctl/source/basicide/baside2b.cxx
+++ b/basctl/source/basicide/baside2b.cxx
@@ -769,7 +769,7 @@ void EditorWindow::ImpDoHighlight( sal_uLong nLine )
         for ( size_t i = 0; i < aPortions.size(); 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 );
         }
 
@@ -960,10 +960,10 @@ void BreakPointWindow::Paint( const Rectangle& )
     Size aOutSz( GetOutputSize() );
     long nLineHeight = GetTextHeight();
 
-    Image aBrk1(((ModulWindowLayout *) pModulWindow->GetLayoutWindow())->
-                getImage(IMGID_BRKENABLED));
-    Image aBrk0(((ModulWindowLayout *) pModulWindow->GetLayoutWindow())->
-                getImage(IMGID_BRKDISABLED));
+    ModulWindowLayout* pModulWindowLayout = 
dynamic_cast<ModulWindowLayout*>(pModulWindow->GetLayoutWindow());
+
+    Image aBrk1(pModulWindowLayout->getImage(IMGID_BRKENABLED));
+    Image aBrk0(pModulWindowLayout->getImage(IMGID_BRKDISABLED));
     Size aBmpSz( aBrk1.GetSizePixel() );
     aBmpSz = PixelToLogic( aBmpSz );
     Point aBmpOff( 0, 0 );
@@ -1009,9 +1009,8 @@ void BreakPointWindow::ShowMarker( sal_Bool bShow )
     Size aOutSz( GetOutputSize() );
     long nLineHeight = GetTextHeight();
 
-    Image aMarker(((ModulWindowLayout*)pModulWindow->GetLayoutWindow())->
-                  getImage(bErrorMarker
-                           ? IMGID_ERRORMARKER : IMGID_STEPMARKER));
+    ModulWindowLayout* pModulWindowLayout = 
dynamic_cast<ModulWindowLayout*>(pModulWindow->GetLayoutWindow());
+    Image aMarker(pModulWindowLayout->getImage(bErrorMarker ? 
IMGID_ERRORMARKER : IMGID_STEPMARKER));
 
     Size aMarkerSz( aMarker.GetSizePixel() );
     aMarkerSz = PixelToLogic( aMarkerSz );
diff --git a/basctl/source/basicide/basobj2.cxx 
b/basctl/source/basicide/basobj2.cxx
index 7954b09..68a40f6 100644
--- a/basctl/source/basicide/basobj2.cxx
+++ b/basctl/source/basicide/basobj2.cxx
@@ -205,7 +205,7 @@ bool RenameModule( Window* pErrorParent, const 
ScriptDocument& rDocument, const
             pWin->SetName( rNewName );
 
             // set new module in module window
-            ModulWindow* pModWin = (ModulWindow*)pWin;
+            ModulWindow* pModWin = dynamic_cast<ModulWindow*>(pWin);
             pModWin->SetSbModule( (SbModule*)pModWin->GetBasic()->FindModule( 
rNewName ) );
 
             // update tabwriter
@@ -308,7 +308,7 @@ namespace
             SbModule* pModule = pMethod->GetModule();
             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!" 
);
 
             BasicManager* pBasMgr = BasicIDE::FindBasicManager( pBasic );
diff --git a/basctl/source/basicide/moduldl2.cxx 
b/basctl/source/basicide/moduldl2.cxx
index 0e5b380..be74388 100644
--- a/basctl/source/basicide/moduldl2.cxx
+++ b/basctl/source/basicide/moduldl2.cxx
@@ -182,7 +182,7 @@ BasicCheckBox::~BasicCheckBox()
     SvLBoxEntry* pEntry = First();
     while ( pEntry )
     {
-        delete (BasicLibUserData*)pEntry->GetUserData();
+        delete static_cast<BasicLibUserData*>(pEntry->GetUserData());
         pEntry = Next( pEntry );
     }
 }
_______________________________________________
Libreoffice-commits mailing list
Libreoffice-commits@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to