[Libreoffice-commits] core.git: basic/source filter/source framework/source

Arnold Dumas arnold at dumas.at
Tue Feb 16 12:48:22 UTC 2016


 basic/source/sbx/sbxdec.cxx                      |    5 +----
 filter/source/msfilter/escherex.cxx              |    3 +--
 framework/source/layoutmanager/layoutmanager.cxx |    4 ++--
 3 files changed, 4 insertions(+), 8 deletions(-)

New commits:
commit fd3cb8d8222113cbc7bf472060ac77233706ea1f
Author: Arnold Dumas <arnold at dumas.at>
Date:   Mon Feb 15 22:32:15 2016 +0100

    tdf#39440: reduce scope of local variables
    
    Change-Id: I6ba411d2e07240821518281996d543f71acf3259
    Reviewed-on: https://gerrit.libreoffice.org/22378
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Noel Grandin <noelgrandin at gmail.com>

diff --git a/basic/source/sbx/sbxdec.cxx b/basic/source/sbx/sbxdec.cxx
index 1616771..b073ea1 100644
--- a/basic/source/sbx/sbxdec.cxx
+++ b/basic/source/sbx/sbxdec.cxx
@@ -354,15 +354,12 @@ void SbxDecimal::getString( OUString& rString )
 #ifdef _WIN32
     static LCID nLANGID = MAKELANGID( LANG_ENGLISH, SUBLANG_ENGLISH_US );
 
-    bool bRet = false;
-
     OLECHAR sz[100];
     BSTR aBStr = SysAllocString( sz );
     if( aBStr != NULL )
     {
         HRESULT hResult = VarBstrFromDec( &maDec, nLANGID, 0, &aBStr );
-        bRet = ( hResult == S_OK );
-        if( bRet )
+        if( hResult == S_OK )
         {
             // Convert delimiter
             sal_Unicode cDecimalSep;
diff --git a/filter/source/msfilter/escherex.cxx b/filter/source/msfilter/escherex.cxx
index 1ee99db..79108f71b 100644
--- a/filter/source/msfilter/escherex.cxx
+++ b/filter/source/msfilter/escherex.cxx
@@ -1347,7 +1347,6 @@ bool EscherPropertyContainer::ImplCreateEmbeddedBmp( const OString& rUniqueId )
 void EscherPropertyContainer::CreateEmbeddedBitmapProperties(
     const OUString& rBitmapUrl, css::drawing::BitmapMode eBitmapMode )
 {
-    bool bRetValue = false;
     OUString aVndUrl( "vnd.sun.star.GraphicObject:" );
     OUString aBmpUrl( rBitmapUrl );
     sal_Int32 nIndex = aBmpUrl.indexOf( aVndUrl );
@@ -1357,7 +1356,7 @@ void EscherPropertyContainer::CreateEmbeddedBitmapProperties(
         if( aBmpUrl.getLength() > nIndex )
         {
             OString aUniqueId(OUStringToOString(aBmpUrl.copy(nIndex, aBmpUrl.getLength() - nIndex), RTL_TEXTENCODING_UTF8));
-            bRetValue = ImplCreateEmbeddedBmp( aUniqueId );
+            bool bRetValue = ImplCreateEmbeddedBmp( aUniqueId );
             if( bRetValue )
             {
                 // bitmap mode property
diff --git a/framework/source/layoutmanager/layoutmanager.cxx b/framework/source/layoutmanager/layoutmanager.cxx
index 163bbbf..c89a577 100644
--- a/framework/source/layoutmanager/layoutmanager.cxx
+++ b/framework/source/layoutmanager/layoutmanager.cxx
@@ -485,14 +485,14 @@ bool LayoutManager::readWindowStateData( const OUString& aName, UIElement& rElem
         GlobalSettings* &rGlobalSettings, bool &bInGlobalSettings,
         const Reference< XComponentContext > &rComponentContext )
 {
-    bool bGetSettingsState( false );
-
     SolarMutexResettableGuard aWriteLock;
     Reference< XNameAccess > xPersistentWindowState( rPersistentWindowState );
     aWriteLock.clear();
 
     if ( xPersistentWindowState.is() )
     {
+        bool bGetSettingsState( false );
+
         aWriteLock.reset();
         bool bGlobalSettings( bInGlobalSettings );
         GlobalSettings* pGlobalSettings( nullptr );


More information about the Libreoffice-commits mailing list