135360
From 01673b7cf6bb0abbd35ff79b50dc15b14bacad70 Mon Sep 17 00:00:00 2001
135360
From: =?UTF-8?q?Micha=C3=ABl=20Lef=C3=A8vre?= <lefevre00@yahoo.fr>
135360
Date: Mon, 21 Sep 2015 15:11:57 +0200
135360
Subject: [PATCH 156/398] CppCheck : reduce variables scope
135360
MIME-Version: 1.0
135360
Content-Type: text/plain; charset=UTF-8
135360
Content-Transfer-Encoding: 8bit
135360
135360
Reviewed-on: https://gerrit.libreoffice.org/18753
135360
Tested-by: Jenkins <ci@libreoffice.org>
135360
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
135360
Tested-by: Caolán McNamara <caolanm@redhat.com>
135360
(cherry picked from commit 92c8d74c543aa94cd512369072975dca7006d5b3)
135360
135360
Change-Id: Ief402017b693a4337f330fb07bb7a6dc6e749f72
135360
---
135360
 desktop/source/lib/init.cxx | 3 ++-
135360
 1 file changed, 2 insertions(+), 1 deletion(-)
135360
135360
diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx
135360
index 64a6c00ffba6..1b06c4220564 100644
135360
--- a/desktop/source/lib/init.cxx
135360
+++ b/desktop/source/lib/init.cxx
135360
@@ -566,7 +566,6 @@ static void doc_iniUnoCommands ()
135360
     };
135360
 
135360
     util::URL aCommandURL;
135360
-    const SfxSlot* pSlot = NULL;
135360
     SfxViewShell* pViewShell = SfxViewShell::Current();
135360
     SfxViewFrame* pViewFrame = pViewShell? pViewShell->GetViewFrame(): NULL;
135360
 
135360
@@ -582,6 +581,8 @@ static void doc_iniUnoCommands ()
135360
 
135360
     for (sal_uInt32 nIterator = 0; nIterator < SAL_N_ELEMENTS(sUnoCommands); nIterator++)
135360
     {
135360
+        const SfxSlot* pSlot = NULL;
135360
+
135360
         aCommandURL.Complete = sUnoCommands[nIterator];
135360
         xParser->parseStrict(aCommandURL);
135360
         pSlot = rSlotPool.GetUnoSlot(aCommandURL.Path);
135360
-- 
135360
2.12.0
135360