[Libreoffice-commits] core.git: 2 commits - basctl/source basic/source

Caolán McNamara caolanm at redhat.com
Mon Mar 9 09:29:33 PDT 2015


 basctl/source/basicide/baside2.cxx  |    2 +-
 basctl/source/basicide/baside2b.cxx |    2 +-
 basctl/source/basicide/basobj2.cxx  |    2 +-
 basctl/source/basicide/bastypes.cxx |    2 +-
 basic/source/sbx/sbxstr.cxx         |    8 ++++----
 5 files changed, 8 insertions(+), 8 deletions(-)

New commits:
commit 34d6ec2c6e6618beacac881ec28ab527b25558d1
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Mon Mar 9 13:33:08 2015 +0000

    cppcheck: variableScope
    
    Change-Id: Ie77a988956927475ea384c36664ca7c3dd00b2a7

diff --git a/basic/source/sbx/sbxstr.cxx b/basic/source/sbx/sbxstr.cxx
index bfd2b62..990d1c7 100644
--- a/basic/source/sbx/sbxstr.cxx
+++ b/basic/source/sbx/sbxstr.cxx
@@ -262,13 +262,13 @@ SbxArray* StringToByteArray(const OUString& rStr)
     sal_Int32 nArraySize = rStr.getLength() * 2;
     const sal_Unicode* pSrc = rStr.getStr();
     SbxDimArray* pArray = new SbxDimArray(SbxBYTE);
+    if( nArraySize )
+    {
 #if !HAVE_FEATURE_SCRIPTING
-    bool bIncIndex = false;
+        bool bIncIndex = false;
 #else
-    bool bIncIndex = ( IsBaseIndexOne() && SbiRuntime::isVBAEnabled() );
+        bool bIncIndex = ( IsBaseIndexOne() && SbiRuntime::isVBAEnabled() );
 #endif
-    if( nArraySize )
-    {
         if( bIncIndex )
             pArray->AddDim32( 1, nArraySize );
         else
commit 938caeaf5850b63ed74c1d8a4d95c3bedbb66298
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Mon Mar 9 13:28:49 2015 +0000

    cppcheck: cstyleCast
    
    Change-Id: I3a1aaafe30f13f2eb388f7db3d78ecafaf0a4a2d

diff --git a/basctl/source/basicide/baside2.cxx b/basctl/source/basicide/baside2.cxx
index d73ecd3..35ddb67 100644
--- a/basctl/source/basicide/baside2.cxx
+++ b/basctl/source/basicide/baside2.cxx
@@ -218,7 +218,7 @@ SbModuleRef ModulWindow::XModule()
             if ( pBasic )
             {
                 xBasic = pBasic;
-                xModule = (SbModule*)pBasic->FindModule( GetName() );
+                xModule = pBasic->FindModule( GetName() );
             }
         }
     }
diff --git a/basctl/source/basicide/baside2b.cxx b/basctl/source/basicide/baside2b.cxx
index 58a28f8..ca647a8 100644
--- a/basctl/source/basicide/baside2b.cxx
+++ b/basctl/source/basicide/baside2b.cxx
@@ -1811,7 +1811,7 @@ IMPL_LINK_NOARG_INLINE_START(WatchWindow, TreeListHdl)
 {
     SvTreeListEntry* pCurEntry = aTreeListBox.GetCurEntry();
     if ( pCurEntry && pCurEntry->GetUserData() )
-        aXEdit.SetText( ((WatchItem*)pCurEntry->GetUserData())->maName );
+        aXEdit.SetText( static_cast<WatchItem*>(pCurEntry->GetUserData())->maName );
 
     return 0;
 }
diff --git a/basctl/source/basicide/basobj2.cxx b/basctl/source/basicide/basobj2.cxx
index 9834875..3bde7a4 100644
--- a/basctl/source/basicide/basobj2.cxx
+++ b/basctl/source/basicide/basobj2.cxx
@@ -173,7 +173,7 @@ bool RenameModule (
             pWin->SetName( rNewName );
 
             // set new module in module window
-            pWin->SetSbModule( (SbModule*)pWin->GetBasic()->FindModule( rNewName ) );
+            pWin->SetSbModule( pWin->GetBasic()->FindModule( rNewName ) );
 
             // update tabwriter
             sal_uInt16 nId = pShell->GetWindowId( pWin );
diff --git a/basctl/source/basicide/bastypes.cxx b/basctl/source/basicide/bastypes.cxx
index e6039e3..88fd1ce 100644
--- a/basctl/source/basicide/bastypes.cxx
+++ b/basctl/source/basicide/bastypes.cxx
@@ -522,7 +522,7 @@ void TabBar::Command( const CommandEvent& rCEvt )
                         Shell::WindowTableIt it = aWindowTable.find( GetCurPageId() );
                         if (it != aWindowTable.end() && dynamic_cast<ModulWindow*>(it->second))
                         {
-                            SbModule* pActiveModule = (SbModule*)pBasic->FindModule( it->second->GetName() );
+                            SbModule* pActiveModule = pBasic->FindModule( it->second->GetName() );
                             if( pActiveModule && ( pActiveModule->GetModuleType() == script::ModuleType::DOCUMENT ) )
                             {
                                 aPopup.EnableItem(SID_BASICIDE_DELETECURRENT, false);


More information about the Libreoffice-commits mailing list