accessibility/source/extended/accessiblelistboxentry.cxx |5 ++---
avmedia/source/gstreamer/gstplayer.cxx |3 +--
basctl/source/basicide/basides1.cxx |2 +-
basctl/source/basicide/basobj2.cxx |3 ++-
basctl/source/basicide/bastype3.cxx |2 +-
basctl/source/basicide/moduldl2.cxx |2 +-
basctl/source/dlged/dlged.cxx|3 ++-
basegfx/source/polygon/b2dpolygonclipper.cxx |6 ++
basegfx/source/polygon/b3dpolygontools.cxx |2 +-
9 files changed, 13 insertions(+), 15 deletions(-)
New commits:
commit 3338f479182a5face7f143bdc4b9ea9067028887
Author: Michael Weghorn m.wegh...@posteo.de
Date: Sat Dec 6 01:07:11 2014 +0100
reduce scope of local variables
This eliminates some of the warnings from Cppcheck report of
2014-11-29.
Change-Id: Id5bf885de12a6de262d2cca9fa71627ac67f50d9
Reviewed-on: https://gerrit.libreoffice.org/13330
Reviewed-by: Noel Grandin noelgran...@gmail.com
Tested-by: Noel Grandin noelgran...@gmail.com
diff --git a/accessibility/source/extended/accessiblelistboxentry.cxx
b/accessibility/source/extended/accessiblelistboxentry.cxx
index fc296b4..a0aa0a7 100644
--- a/accessibility/source/extended/accessiblelistboxentry.cxx
+++ b/accessibility/source/extended/accessiblelistboxentry.cxx
@@ -460,12 +460,11 @@ namespace accessibility
sal_uInt16 iRealItemCount = 0;
sal_uInt16 iCount = 0;
sal_uInt16 iTotleItemCount = pEntry-ItemCount();
-SvLBoxItem* pItem;
while( iCount iTotleItemCount )
{
-pItem = pEntry-GetItem( iCount );
+const SvLBoxItem* pItem = pEntry-GetItem( iCount );
if ( pItem-GetType() == SV_ITEM_ID_LBOXSTRING
- !static_castSvLBoxString*( pItem )-GetText().isEmpty() )
+ !static_castconst SvLBoxString*( pItem
)-GetText().isEmpty() )
{
iRealItemCount++;
}
diff --git a/avmedia/source/gstreamer/gstplayer.cxx
b/avmedia/source/gstreamer/gstplayer.cxx
index cc44a4a..88e62cf 100644
--- a/avmedia/source/gstreamer/gstplayer.cxx
+++ b/avmedia/source/gstreamer/gstplayer.cxx
@@ -304,14 +304,13 @@ GstBusSyncReply Player::processSyncMessage( GstMessage
*message )
}
if( mnWidth == 0 ) {
GstPad *pad = NULL;
-GstCaps *caps;
g_signal_emit_by_name( mpPlaybin, get-video-pad, 0, pad );
if( pad ) {
int w = 0, h = 0;
-caps = gst_pad_get_current_caps( pad );
+GstCaps *caps = gst_pad_get_current_caps( pad );
if( gst_structure_get( gst_caps_get_structure( caps, 0 ),
width, G_TYPE_INT, w,
diff --git a/basctl/source/basicide/basides1.cxx
b/basctl/source/basicide/basides1.cxx
index d981296..e5d4da4 100644
--- a/basctl/source/basicide/basides1.cxx
+++ b/basctl/source/basicide/basides1.cxx
@@ -87,7 +87,6 @@ void Shell::ExecuteCurrent( SfxRequest rReq )
// memorize item because of the adjustments...
GetExtraData()-SetSearchItem(rSearchItem);
sal_Int32 nFound = 0;
-bool bCanceled = false;
if (rSearchItem.GetCommand() == SVX_SEARCHCMD_REPLACE_ALL)
{
sal_uInt16 nActModWindows = 0;
@@ -115,6 +114,7 @@ void Shell::ExecuteCurrent( SfxRequest rReq )
}
else
{
+bool bCanceled = false;
nFound = pCurWin-StartSearchAndReplace(rSearchItem);
if ( !nFound !rSearchItem.GetSelection() )
{
diff --git a/basctl/source/basicide/basobj2.cxx
b/basctl/source/basicide/basobj2.cxx
index 28a781c..9834875 100644
--- a/basctl/source/basicide/basobj2.cxx
+++ b/basctl/source/basicide/basobj2.cxx
@@ -240,7 +240,6 @@ OUString ChooseMacro( const uno::Reference frame::XModel
rxLimitToDocument,
GetExtraData()-ChoosingMacro() = true;
OUString aScriptURL;
-bool bError = false;
SbMethod* pMethod = NULL;
boost::scoped_ptr MacroChooser pChooser( new MacroChooser( NULL, true )
);
@@ -259,6 +258,8 @@ OUString ChooseMacro( const uno::Reference frame::XModel
rxLimitToDocument,
{
case Macro_OkRun:
{
+bool bError = false;
+
pMethod = pChooser-GetMacro();
if ( !pMethod pChooser-GetMode() == MacroChooser::Recording )
pMethod = pChooser-CreateMacro();
diff --git a/basctl/source/basicide/bastype3.cxx
b/basctl/source/basicide/bastype3.cxx
index 8cb3b2f..24122ea 100644
--- a/basctl/source/basicide/bastype3.cxx
+++ b/basctl/source/basicide/bastype3.cxx
@@ -190,9 +190,9 @@ SbxVariable* TreeListBox::FindVariable( SvTreeListEntry*
pEntry )
}
SbxVariable* pVar = 0;
-bool