[Libreoffice-commits] .: Branch 'feature/kill_String' - 21 commits - basctl/source basic/CppunitTest_basic_coverage.mk basic/inc basic/Module_basic.mk basic/qa basic/source scripting/source sc/source sfx2/source solenv/gbuild sw/source unotest/inc unotest/source vbahelper/source writerfilter/source

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Sat Nov 3 16:40:35 PDT 2012


Rebased ref, commits from common ancestor:
commit a094e7b12d16bcb89ba6462f9d6c8b94f3e0ccfb
Author: Norbert Thiebaud <nthiebaud at gmail.com>
Date:   Tue Oct 23 06:53:22 2012 +0200

    gbuild: add beginning of gcov support
    
    Change-Id: If5b551c46de4afae2393a6320d08c191feafc358

diff --git a/solenv/gbuild/platform/com_GCC_defs.mk b/solenv/gbuild/platform/com_GCC_defs.mk
index 9bb9cf7..2fa3023 100644
--- a/solenv/gbuild/platform/com_GCC_defs.mk
+++ b/solenv/gbuild/platform/com_GCC_defs.mk
@@ -85,6 +85,14 @@ ifneq ($(HAVE_THREADSAFE_STATICS),TRUE)
 gb_CXXFLAGS_COMMON += -fno-threadsafe-statics
 endif
 
+ifeq ($(strip $(gb_GCOV)),YES)
+gb_CFLAGS_COMMON += -fprofile-arcs -ftest-coverage
+gb_CXXFLAGS_COMMON += -fprofile-arcs -ftest-coverage
+gb_LinkTarget_LDFLAGS += -fprofile-arcs -lgcov
+gb_COMPILERDEFAULTOPTFLAGS := -O0
+endif
+
+
 ifeq ($(HAVE_GCC_VISIBILITY_FEATURE),TRUE)
 gb_VISIBILITY_FLAGS := -DHAVE_GCC_VISIBILITY_FEATURE -fvisibility=hidden
 ifneq ($(HAVE_GCC_VISIBILITY_BROKEN),TRUE)
commit f8cb06e1fc4f6da65139f89d001f648e52961cb9
Author: Norbert Thiebaud <nthiebaud at gmail.com>
Date:   Sat Nov 3 17:34:40 2012 -0500

    unottest: add get(URL|Path)FromWorkdir to locate $WORKDIR_FOR_BUILD
    
    Change-Id: Iec4e609e023262f357a7552b75863aeae9385205

diff --git a/unotest/inc/unotest/bootstrapfixturebase.hxx b/unotest/inc/unotest/bootstrapfixturebase.hxx
index 9ede450..3d17a4a 100644
--- a/unotest/inc/unotest/bootstrapfixturebase.hxx
+++ b/unotest/inc/unotest/bootstrapfixturebase.hxx
@@ -57,6 +57,8 @@ protected:
   ::rtl::OUString m_aSrcRootPath;
   ::rtl::OUString m_aSolverRootURL;
   ::rtl::OUString m_aSolverRootPath;
+  ::rtl::OUString m_aWorkdirRootURL;
+  ::rtl::OUString m_aWorkdirRootPath;
 
   com::sun::star::uno::Reference<com::sun::star::uno::XComponentContext> m_xContext;
   com::sun::star::uno::Reference<com::sun::star::lang::XMultiServiceFactory> m_xSFactory;
@@ -86,6 +88,12 @@ public:
   // return a Path to a given c-str path from the solver directory
   ::rtl::OUString getPathFromSolver( const char *pPath );
 
+  // return a URL to a given c-str path from the workdir directory
+  ::rtl::OUString getURLFromWorkdir( const char *pPath );
+
+  // return a Path to a given c-str path from the workdir directory
+  ::rtl::OUString getPathFromWorkdir( const char *pPath );
+
   virtual void setUp();
   virtual void tearDown();
 
diff --git a/unotest/source/cpp/bootstrapfixturebase.cxx b/unotest/source/cpp/bootstrapfixturebase.cxx
index 9c78632..7917341 100644
--- a/unotest/source/cpp/bootstrapfixturebase.cxx
+++ b/unotest/source/cpp/bootstrapfixturebase.cxx
@@ -50,21 +50,36 @@ test::BootstrapFixtureBase::BootstrapFixtureBase()
     CPPUNIT_ASSERT_MESSAGE("SRC_ROOT env variable not set", pSrcRoot != NULL && pSrcRoot[0] != 0);
     const char* pSolverRoot = getenv( "OUTDIR_FOR_BUILD" );
     CPPUNIT_ASSERT_MESSAGE("$OUTDIR_FOR_BUILD env variable not set", pSolverRoot != NULL && pSolverRoot[0] != 0);
+    const char* pWorkdirRoot = getenv( "WORKDIR_FOR_BUILD" );
+    CPPUNIT_ASSERT_MESSAGE("$WORKDIR_FOR_BUILD env variable not set", pWorkdirRoot != NULL && pWorkdirRoot[0] != 0);
 #ifdef WNT
     if (pSrcRoot[1] == ':')
+    {
         m_aSrcRootURL += rtl::OUString::createFromAscii( "/" );
+    }
     if (pSolverRoot[1] == ':')
+    {
         m_aSolverRootURL += rtl::OUString::createFromAscii( "/" );
+    }
+    if (pWorkdirRoot[1] == ':')
+    {
+        m_aWorkdirRootURL += rtl::OUString::createFromAscii( "/" );
+    }
 #endif
 #else
     const char* pSrcRoot = "/assets";
     const char* pSolverRoot = "/assets";
+    const char* pWorkdirRoot = "/assets";
 #endif
     m_aSrcRootPath = rtl::OUString::createFromAscii( pSrcRoot );
     m_aSrcRootURL += m_aSrcRootPath;
 
     m_aSolverRootPath = rtl::OUString::createFromAscii( pSolverRoot );
     m_aSolverRootURL += m_aSolverRootPath;
+
+    m_aWorkdirRootPath = rtl::OUString::createFromAscii( pWorkdirRoot );
+    m_aWorkdirRootURL += m_aWorkdirRootPath;
+
 }
 
 test::BootstrapFixtureBase::~BootstrapFixtureBase()
@@ -91,6 +106,16 @@ test::BootstrapFixtureBase::~BootstrapFixtureBase()
     return m_aSolverRootPath + rtl::OUString::createFromAscii( pPath );
 }
 
+::rtl::OUString test::BootstrapFixtureBase::getURLFromWorkdir( const char *pPath )
+{
+    return m_aWorkdirRootURL + rtl::OUString::createFromAscii( pPath );
+}
+
+::rtl::OUString test::BootstrapFixtureBase::getPathFromWorkdir( const char *pPath )
+{
+    return m_aWorkdirRootPath + rtl::OUString::createFromAscii( pPath );
+}
+
 void test::BootstrapFixtureBase::setUp()
 {
     // set UserInstallation to user profile dir in test/user-template
commit 72c93dc2595a693b89041f25ebccfb7e771fff85
Author: Norbert Thiebaud <nthiebaud at gmail.com>
Date:   Sat Nov 3 17:33:27 2012 -0500

    basic add a generic unit test fixture
    
    basic_coverage is a generic unit test that scan
    qa/basic_coverage/*
    
    each file there is supposed to be a well formed Basic script
    that define as least a Function doUnitTest as Integer
    that return 1 if OK, 0 if not OK
    
    Change-Id: I6c3cfac1e7ce4748f46c04344102a0eff69b6a49

diff --git a/basic/CppunitTest_basic_coverage.mk b/basic/CppunitTest_basic_coverage.mk
index 4a90565..e1189e5 100644
--- a/basic/CppunitTest_basic_coverage.mk
+++ b/basic/CppunitTest_basic_coverage.mk
@@ -12,7 +12,7 @@ $(eval $(call gb_CppunitTest_add_exception_objects,basic_coverage, \
     basic/qa/cppunit/basic_coverage \
 ))
 
-$(eval $(call gb_CppunitTest_use_library_objects,basic_coverage,sb))
+#$(eval $(call gb_CppunitTest_use_library_objects,basic_coverage,sb))
 
 # add a list of all needed libraries here
 $(eval $(call gb_CppunitTest_use_libraries,basic_coverage, \
@@ -25,7 +25,9 @@ $(eval $(call gb_CppunitTest_use_libraries,basic_coverage, \
     sot \
     svl \
     svt \
+    test \
     tl \
+    unotest \
     utl \
     vcl \
     xmlscript \
diff --git a/basic/qa/basic_coverage/string_left_01.vb b/basic/qa/basic_coverage/string_left_01.vb
new file mode 100644
index 0000000..6d2c7d1
--- /dev/null
+++ b/basic/qa/basic_coverage/string_left_01.vb
@@ -0,0 +1,16 @@
+Function doUnitTest as Integer
+
+Dim s1 As String
+Dim s2 As String
+
+    s1 = "abc"
+
+    s2 = Left(s1, 2)
+
+    If s2 = "ab" Then
+        doUnitTest = 1
+    Else
+        doUnitTest = 0
+    End If
+
+End Function
diff --git a/basic/qa/basic_coverage/string_right_01.vb b/basic/qa/basic_coverage/string_right_01.vb
new file mode 100644
index 0000000..743ad4d
--- /dev/null
+++ b/basic/qa/basic_coverage/string_right_01.vb
@@ -0,0 +1,17 @@
+
+Function doUnitTest as Integer
+
+Dim s1 As String
+Dim s2 As String
+
+    s1 = "abc"
+
+    s2 = Right(s1, 2)
+
+    If s2 = "bc" Then
+        doUnitTest = 1
+    Else
+        doUnitTest = 0
+    End If
+
+End Function
diff --git a/basic/qa/cppunit/basic_coverage.cxx b/basic/qa/cppunit/basic_coverage.cxx
index 4218d0d..d78a28f 100644
--- a/basic/qa/cppunit/basic_coverage.cxx
+++ b/basic/qa/cppunit/basic_coverage.cxx
@@ -8,27 +8,190 @@
  */
 
 #include "basictest.hxx"
+#include <osl/file.hxx>
+#include "basic/sbmod.hxx"
+#include "basic/sbmeth.hxx"
+
 
 namespace
 {
 
 class Coverage : public BasicTestBase
 {
-    public:
-    Coverage() {};
+private:
+    bool m_bError;
+    int  m_nb_tests;
+    int  m_nb_tests_ok;
+    int  m_nb_tests_ko;
+    int  m_nb_tests_skipped;
+    OUString m_sCurrentTest;
+    void process_directory(OUString sDirName);
+    void process_file(OUString sFileName);
+    void run_test(OUString sFileName, OUString sCode);
+    void test_start(OUString /* sFileName */);
+    void test_failed(void);
+    void test_success(void);
+    void print_summary() {};
+
+    DECL_LINK( CoverageErrorHdl, StarBASIC * );
+
+public:
+    Coverage();
+    ~Coverage();
 
-    void Coverage_0001() {};
+    void Coverage_Iterator();
 
     // Adds code needed to register the test suite
     CPPUNIT_TEST_SUITE(Coverage);
 
     // Declares the method as a test to call
-    CPPUNIT_TEST(Coverage_0001);
+    CPPUNIT_TEST(Coverage_Iterator);
 
     // End of test suite definition
     CPPUNIT_TEST_SUITE_END();
 };
 
+IMPL_LINK( Coverage, CoverageErrorHdl, StarBASIC *, /*pBasic*/)
+{
+    fprintf(stderr,"%s:(%d:%d)\n",
+            rtl::OUStringToOString( m_sCurrentTest, RTL_TEXTENCODING_UTF8 ).getStr(),
+            StarBASIC::GetLine(), StarBASIC::GetCol1());
+    fprintf(stderr,"Basic error: %s\n", rtl::OUStringToOString( StarBASIC::GetErrorText(), RTL_TEXTENCODING_UTF8 ).getStr() );
+    m_bError = true;
+    return 0;
+}
+
+Coverage::Coverage()
+    : m_bError(false)
+    , m_nb_tests(0)
+    , m_nb_tests_ok(0)
+    , m_nb_tests_ko(0)
+    , m_nb_tests_skipped(0)
+{
+}
+
+Coverage::~Coverage()
+{
+    fprintf(stderr,"basic coverage Summary : skipped:%d pass:%d failed:%d\n", m_nb_tests_skipped, m_nb_tests_ok, m_nb_tests_ko );
+    if(m_nb_tests_ko)
+    {
+        CPPUNIT_FAIL("");
+    }
+}
+
+void Coverage::test_start(OUString sFileName)
+{
+    m_nb_tests += 1;
+    m_sCurrentTest = sFileName;
+}
+
+void Coverage::test_failed()
+{
+    m_nb_tests_ko += 1;
+    fprintf(stderr,"%s,FAIL\n", rtl::OUStringToOString( m_sCurrentTest, RTL_TEXTENCODING_UTF8 ).getStr() );
+
+}
+
+void Coverage::test_success()
+{
+    m_nb_tests_ok += 1;
+    fprintf(stderr,"%s,PASS\n", rtl::OUStringToOString( m_sCurrentTest, RTL_TEXTENCODING_UTF8 ).getStr() );
+}
+
+void Coverage::run_test(OUString /*sFileName*/, OUString sCode)
+{
+    bool result = false;
+    CPPUNIT_ASSERT_MESSAGE( "No resource manager", basicDLL().GetBasResMgr() != NULL );
+    StarBASICRef pBasic = new StarBASIC();
+    ResetError();
+    StarBASIC::SetGlobalErrorHdl( LINK( this, Coverage, CoverageErrorHdl ) );
+
+    SbModule* pMod = pBasic->MakeModule( rtl::OUString( "TestModule" ), sCode );
+    pMod->Compile();
+    if(!m_bError)
+    {
+        SbMethod* pMeth = static_cast<SbMethod*>(pMod->Find( rtl::OUString("doUnitTest"),  SbxCLASS_METHOD ));
+        if(pMeth)
+        {
+            SbxVariableRef refTemp = pMeth;
+            // forces a broadcast
+            SbxVariableRef pNew = new  SbxMethod( *((SbxMethod*)pMeth));
+            if(pNew->GetInteger() == 1 )
+            {
+                result = true;
+            }
+        }
+    }
+    if(result)
+    {
+        test_success();
+    }
+    else
+    {
+        test_failed();
+    }
+}
+
+void Coverage::process_file(OUString sFileName)
+{
+    osl::File aFile(sFileName);
+
+    test_start(sFileName);
+    if(osl::FileBase::E_None == aFile.open(osl_File_OpenFlag_Read))
+    {
+        sal_uInt64 size;
+        sal_uInt64 size_read;
+        if(osl::FileBase::E_None == aFile.getSize(size))
+        {
+            void* buffer = calloc(1, size+1);
+            CPPUNIT_ASSERT(buffer);
+            if(osl::FileBase::E_None == aFile.read( buffer, size, size_read))
+            {
+                if(size == size_read)
+                {
+                    OUString sCode((sal_Char*)buffer, size, RTL_TEXTENCODING_UTF8);
+                    run_test(sFileName, sCode);
+                    return;
+                }
+            }
+        }
+    }
+    test_failed();
+}
+
+void Coverage::process_directory(OUString sDirName)
+{
+    osl::Directory aDir(sDirName);
+    osl::DirectoryItem aItem;
+    osl::FileStatus aFileStatus(osl_FileStatus_Mask_FileURL|osl_FileStatus_Mask_Type);
+
+    if(osl::FileBase::E_None == aDir.open())
+    {
+        while (aDir.getNextItem(aItem) == osl::FileBase::E_None)
+        {
+            aItem.getFileStatus(aFileStatus);
+            if(aFileStatus.isRegular())
+            {
+                process_file(aFileStatus.getFileURL());
+            }
+        }
+    }
+    else
+    {
+    }
+    fprintf(stderr,"end process directory\n");
+}
+
+void Coverage::Coverage_Iterator(void)
+{
+    OUString sDirName = getURLFromSrc("/basic/qa/basic_coverage/");
+
+    CPPUNIT_ASSERT(!sDirName.isEmpty());
+    process_directory(sDirName);
+}
+
+  CPPUNIT_TEST_SUITE_REGISTRATION(Coverage);
+
 }
 CPPUNIT_PLUGIN_IMPLEMENT();
 
commit 5bc4ff79e918efcdf10ce364366f96235f4c9b27
Author: Norbert Thiebaud <nthiebaud at gmail.com>
Date:   Tue Oct 23 08:57:23 2012 +0200

    basic add a generic cppunitest to be exempended to do code coverage
    
    Change-Id: I6a05ae27cb1ee027995343bd4a79799f121e53a5

diff --git a/basic/CppunitTest_basic_coverage.mk b/basic/CppunitTest_basic_coverage.mk
new file mode 100644
index 0000000..4a90565
--- /dev/null
+++ b/basic/CppunitTest_basic_coverage.mk
@@ -0,0 +1,58 @@
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+
+$(eval $(call gb_CppunitTest_CppunitTest,basic_coverage))
+
+$(eval $(call gb_CppunitTest_add_exception_objects,basic_coverage, \
+    basic/qa/cppunit/basic_coverage \
+))
+
+$(eval $(call gb_CppunitTest_use_library_objects,basic_coverage,sb))
+
+# add a list of all needed libraries here
+$(eval $(call gb_CppunitTest_use_libraries,basic_coverage, \
+    comphelper \
+    cppu \
+    cppuhelper \
+    sal \
+    salhelper \
+    sb \
+    sot \
+    svl \
+    svt \
+    tl \
+    utl \
+    vcl \
+    xmlscript \
+    $(gb_UWINAPI) \
+))
+
+ifeq ($(GUI),WNT)
+$(eval $(call gb_CppunitTest_use_system_win32_libs,basic_coverage, \
+    oleaut32 \
+))
+endif
+
+$(eval $(call gb_CppunitTest_set_include,basic_coverage,\
+    -I$(SRCDIR)/basic/source/inc \
+    -I$(SRCDIR)/basic/inc \
+    $$(INCLUDE) \
+))
+
+$(eval $(call gb_CppunitTest_use_api,basic_coverage,\
+    offapi \
+    udkapi \
+))
+
+$(eval $(call gb_CppunitTest_use_ure,basic_coverage))
+
+$(eval $(call gb_CppunitTest_use_components,basic_coverage,\
+    configmgr/source/configmgr \
+    i18npool/util/i18npool \
+))
+$(eval $(call gb_CppunitTest_use_configuration,basic_coverage))
diff --git a/basic/Module_basic.mk b/basic/Module_basic.mk
index e60e83e..a4ff822 100644
--- a/basic/Module_basic.mk
+++ b/basic/Module_basic.mk
@@ -19,6 +19,7 @@ $(eval $(call gb_Module_add_check_targets,basic,\
      CppunitTest_basic_scanner \
      CppunitTest_basic_enable \
      CppunitTest_basic_nested_struct \
+     CppunitTest_basic_coverage \
 ))
 
 endif
diff --git a/basic/qa/cppunit/basic_coverage.cxx b/basic/qa/cppunit/basic_coverage.cxx
new file mode 100644
index 0000000..4218d0d
--- /dev/null
+++ b/basic/qa/cppunit/basic_coverage.cxx
@@ -0,0 +1,37 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ */
+
+#include "basictest.hxx"
+
+namespace
+{
+
+class Coverage : public BasicTestBase
+{
+    public:
+    Coverage() {};
+
+    void Coverage_0001() {};
+
+    // Adds code needed to register the test suite
+    CPPUNIT_TEST_SUITE(Coverage);
+
+    // Declares the method as a test to call
+    CPPUNIT_TEST(Coverage_0001);
+
+    // End of test suite definition
+    CPPUNIT_TEST_SUITE_END();
+};
+
+}
+CPPUNIT_PLUGIN_IMPLEMENT();
+
+
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
commit 393c757411cdd6bf5e94e545dc9e3f36598417cb
Author: Norbert Thiebaud <nthiebaud at gmail.com>
Date:   Sat Nov 3 09:07:25 2012 -0500

    basic: preliminary cosmetic clean-up
    
    parsing 1000s of line of code is hard enough without having to fight
    with weird indentation and irregular formatting.
    
    So as the review progress, in order to follow the code, cosmetic changes
    were made...
    
    In order to minimize the task of the reviewers and allow them to
    concentrate on what matter, an effort is made to collect these
    cosmetic changes into this separate commit.
    
    Change-Id: I3c9b04a0150d0d0a048c2e976fe24de4f2b6b98a

diff --git a/basctl/source/basicide/baside2b.cxx b/basctl/source/basicide/baside2b.cxx
index 2986b82..8fdf123 100644
--- a/basctl/source/basicide/baside2b.cxx
+++ b/basctl/source/basicide/baside2b.cxx
@@ -1568,21 +1568,29 @@ void StackWindow::UpdateCalls()
                     SbxVariable* pVar = pParams->Get( nParam );
                     DBG_ASSERT( pVar, "Parameter?!" );
                     if ( pVar->GetName().Len() )
+                    {
                         aEntry += pVar->GetName();
+                    }
                     else if ( pInfo )
                     {
                         const SbxParamInfo* pParam = pInfo->GetParam( nParam );
                         if ( pParam )
+                        {
                             aEntry += pParam->aName;
+                        }
                     }
                     aEntry += '=';
                     SbxDataType eType = pVar->GetType();
                     if( eType & SbxARRAY )
+                    {
                         aEntry += OUString( "..." );
+                    }
                     else if( eType != SbxOBJECT )
                         aEntry += pVar->GetString();
                     if ( nParam < ( pParams->Count() - 1 ) )
+                    {
                         aEntry += OUString( ", " );
+                    }
                 }
                 aEntry += ')';
             }
@@ -2086,11 +2094,13 @@ void WatchTreeListBox::UpdateWatches( bool bBasicStopped )
                             }
                         }
                         else if( pNewArray == NULL || pOldArray == NULL )
+                        {
                             bArrayChanged = true;
-
+                        }
                         if( pNewArray )
+                        {
                             implEnableChildren( pEntry, true );
-
+                        }
                         // #i37227 Clear always and replace array
                         if( pNewArray != pOldArray )
                         {
@@ -2106,12 +2116,15 @@ void WatchTreeListBox::UpdateWatches( bool bBasicStopped )
                             }
                         }
                         if( bArrayChanged && pOldArray != NULL )
+                        {
                             bCollapse = true;
-
+                        }
                         aTypeStr = implCreateTypeStringForDimArray( pItem, eType );
                     }
                     else
+                    {
                         aWatchStr += OUString( "<?>" );
+                    }
                 }
                 else if ( (sal_uInt8)eType == (sal_uInt8)SbxOBJECT )
                 {
@@ -2134,7 +2147,9 @@ void WatchTreeListBox::UpdateWatches( bool bBasicStopped )
                                 }
                             }
                             if( bObjChanged )
+                            {
                                 bCollapse = true;
+                            }
                         }
 
                         pItem->mpObject = pObj;
@@ -2169,20 +2184,28 @@ void WatchTreeListBox::UpdateWatches( bool bBasicStopped )
                         aWatchStr += aStrStr;
                     aWatchStr += pVar->GetString();
                     if( bString )
+                    {
                         aWatchStr += aStrStr;
+                    }
                 }
                 if( !aTypeStr.Len() )
                 {
                     if( !pVar->IsFixed() )
+                    {
                         aTypeStr = OUString( "Variant/" );
+                    }
                     aTypeStr += getBasicTypeName( pVar->GetType() );
                 }
             }
             else if( !bArrayElement )
+            {
                 aWatchStr += OUString( "<Out of Scope>" );
+            }
 
             if( bCollapse )
+            {
                 implCollapseModifiedObjectEntry( pEntry, this );
+            }
 
         }
         else if( bBasicStopped )
diff --git a/basctl/source/basicide/basidesh.cxx b/basctl/source/basicide/basidesh.cxx
index 4639b4e..58d71de 100644
--- a/basctl/source/basicide/basidesh.cxx
+++ b/basctl/source/basicide/basidesh.cxx
@@ -790,7 +790,9 @@ void Shell::UpdateWindows()
     if ( bChangeCurWindow )
     {
         if ( !pNextActiveWindow )
+        {
             pNextActiveWindow = FindApplicationWindow();
+        }
         SetCurWindow( pNextActiveWindow, true );
     }
 }
@@ -804,9 +806,13 @@ void Shell::RemoveWindow( BaseWindow* pWindow_, bool bDestroy, bool bAllowChange
     if ( pWindow_ == pCurWin )
     {
         if ( bAllowChangeCurWindow )
+        {
             SetCurWindow( FindApplicationWindow(), true );
+        }
         else
+        {
             SetCurWindow( NULL, false );
+        }
     }
     if ( bDestroy )
     {
@@ -826,7 +832,9 @@ void Shell::RemoveWindow( BaseWindow* pWindow_, bool bDestroy, bool bAllowChange
             {
                 SbModule* pMod = StarBASIC::GetActiveModule();
                 if ( !pMod || ( pMod && ( !pMod->GetName().Equals(pWindow_->GetName()) ) ) )
+                {
                     bStop = false;
+                }
             }
             if ( bStop )
             {
diff --git a/basic/inc/basic/basmgr.hxx b/basic/inc/basic/basmgr.hxx
index 6ff8a69..f59b414 100644
--- a/basic/inc/basic/basmgr.hxx
+++ b/basic/inc/basic/basmgr.hxx
@@ -55,13 +55,13 @@ public:
             BasicError( const BasicError& rErr );
             BasicError( sal_uIntPtr nId, sal_uInt16 nR, const OUString& rErrStr );
 
-    sal_uIntPtr     GetErrorId() const                  { return nErrorId; }
+    sal_uIntPtr GetErrorId() const                  { return nErrorId; }
     sal_uInt16  GetReason() const                   { return nReason; }
-    OUString  GetErrorStr()                       { return aErrStr; }
+    OUString    GetErrorStr()                       { return aErrStr; }
 
     void    SetErrorId( sal_uIntPtr n )             { nErrorId = n; }
     void    SetReason( sal_uInt16 n )               { nReason = n; }
-    void    SetErrorStr( const OUString& rStr)    { aErrStr = rStr; }
+    void    SetErrorStr( const OUString& rStr)      { aErrStr = rStr; }
 };
 
 class BasicLibs;
@@ -74,9 +74,9 @@ namespace basic { class BasicManagerCleaner; }
 class BASIC_DLLPUBLIC OldBasicPassword
 {
 public:
-    virtual void setLibraryPassword( const OUString& rLibraryName, const OUString& rPassword ) = 0;
+    virtual void     setLibraryPassword( const OUString& rLibraryName, const OUString& rPassword ) = 0;
     virtual OUString getLibraryPassword( const OUString& rLibraryName ) = 0;
-    virtual void clearLibraryPassword( const OUString& rLibraryName ) = 0;
+    virtual void     clearLibraryPassword( const OUString& rLibraryName ) = 0;
     virtual sal_Bool hasLibraryPassword( const OUString& rLibraryName ) = 0;
 
 protected:
@@ -122,8 +122,8 @@ private:
     BasicLibs*          pLibs;
     std::vector<BasicError> aErrors;
 
-    OUString              aName;
-    OUString              maStorageName;
+    OUString            aName;
+    OUString            maStorageName;
     bool                mbDocMgr;
 
     BasicManagerImpl*   mpImpl;
@@ -131,15 +131,15 @@ private:
     BASIC_DLLPRIVATE void Init();
 
 protected:
-    sal_Bool            ImpLoadLibrary( BasicLibInfo* pLibInfo ) const;
-    sal_Bool            ImpLoadLibrary( BasicLibInfo* pLibInfo, SotStorage* pCurStorage, sal_Bool bInfosOnly = sal_False );
+    sal_Bool        ImpLoadLibrary( BasicLibInfo* pLibInfo ) const;
+    sal_Bool        ImpLoadLibrary( BasicLibInfo* pLibInfo, SotStorage* pCurStorage, sal_Bool bInfosOnly = sal_False );
     void            ImpCreateStdLib( StarBASIC* pParentFromStdLib );
     void            ImpMgrNotLoaded(  const OUString& rStorageName  );
     BasicLibInfo*   CreateLibInfo();
     void            LoadBasicManager( SotStorage& rStorage, const OUString& rBaseURL, sal_Bool bLoadBasics = sal_True );
     void            LoadOldBasicManager( SotStorage& rStorage );
-    sal_Bool            ImplLoadBasic( SvStream& rStrm, StarBASICRef& rOldBasic ) const;
-    sal_Bool            ImplEncryptStream( SvStream& rStream ) const;
+    sal_Bool        ImplLoadBasic( SvStream& rStrm, StarBASICRef& rOldBasic ) const;
+    sal_Bool        ImplEncryptStream( SvStream& rStream ) const;
     BasicLibInfo*   FindLibInfo( StarBASIC* pBasic ) const;
     void            CheckModules( StarBASIC* pBasic, sal_Bool bReference ) const;
     ~BasicManager();
@@ -159,17 +159,17 @@ public:
     static void     LegacyDeleteBasicManager( BasicManager*& _rpManager );
 
     void            SetStorageName( const OUString& rName )   { maStorageName = rName; }
-    OUString          GetStorageName() const                  { return maStorageName; }
+    OUString        GetStorageName() const                  { return maStorageName; }
     void            SetName( const OUString& rName )          { aName = rName; }
-    OUString          GetName() const                         { return aName; }
+    OUString        GetName() const                         { return aName; }
 
 
-    sal_uInt16          GetLibCount() const;
+    sal_uInt16      GetLibCount() const;
     StarBASIC*      GetLib( sal_uInt16 nLib ) const;
     StarBASIC*      GetLib( const OUString& rName ) const;
-    sal_uInt16          GetLibId( const OUString& rName ) const;
+    sal_uInt16      GetLibId( const OUString& rName ) const;
 
-    OUString          GetLibName( sal_uInt16 nLib );
+    OUString        GetLibName( sal_uInt16 nLib );
 
     /** announces the library containers which belong to this BasicManager
 
@@ -183,11 +183,11 @@ public:
     const ::com::sun::star::uno::Reference< com::sun::star::script::XPersistentLibraryContainer >&
                     GetScriptLibraryContainer()  const;
 
-    sal_Bool            LoadLib( sal_uInt16 nLib );
-    sal_Bool            RemoveLib( sal_uInt16 nLib, sal_Bool bDelBasicFromStorage );
+    sal_Bool        LoadLib( sal_uInt16 nLib );
+    sal_Bool        RemoveLib( sal_uInt16 nLib, sal_Bool bDelBasicFromStorage );
 
     // Modify-Flag will be reset only during save.
-    sal_Bool            IsBasicModified() const;
+    sal_Bool        IsBasicModified() const;
 
     std::vector<BasicError>& GetErrors();
 
@@ -231,7 +231,7 @@ private:
     // For XML import/export:
     BASIC_DLLPRIVATE StarBASIC* CreateLib( const OUString& rLibName );
     BASIC_DLLPRIVATE StarBASIC* CreateLib( const OUString& rLibName, const OUString& Password,
-                               const OUString& LinkTargetURL );
+                                           const OUString& LinkTargetURL );
 };
 
 #endif  //_BASMGR_HXX
diff --git a/basic/inc/basic/modsizeexceeded.hxx b/basic/inc/basic/modsizeexceeded.hxx
index 83176f0..e736348 100644
--- a/basic/inc/basic/modsizeexceeded.hxx
+++ b/basic/inc/basic/modsizeexceeded.hxx
@@ -43,7 +43,7 @@ class BASIC_DLLPUBLIC ModuleSizeExceeded : public ::cppu::WeakImplHelper1< ::com
 
     // member
     private:
-    rtl::OUString m_sMods;
+    OUString m_sMods;
     com::sun::star::uno::Any m_aRequest;
     com::sun::star::uno::Sequence< com::sun::star::uno::Reference< com::sun::star::task::XInteractionContinuation > > m_lContinuations;
     com::sun::star::uno::Reference< com::sun::star::task::XInteractionContinuation > m_xAbort;
diff --git a/basic/inc/basic/sbdef.hxx b/basic/inc/basic/sbdef.hxx
index 1d3409f..2bc29cb 100644
--- a/basic/inc/basic/sbdef.hxx
+++ b/basic/inc/basic/sbdef.hxx
@@ -26,13 +26,13 @@
 
 // Returns type name for Basic type, array flag is ignored
 // implementation: basic/source/runtime/methods.cxx
-BASIC_DLLPUBLIC ::rtl::OUString getBasicTypeName( SbxDataType eType );
+BASIC_DLLPUBLIC OUString getBasicTypeName( SbxDataType eType );
 
 // Returns type name for Basic objects, especially
 // important for SbUnoObj instances
 // implementation: basic/source/classes/sbunoobj.cxx
 class SbxObject;
-BASIC_DLLPUBLIC ::rtl::OUString getBasicObjectTypeName( SbxObject* pObj );
+BASIC_DLLPUBLIC OUString getBasicObjectTypeName( SbxObject* pObj );
 
 // Allows Basic IDE to set watch mode to suppress errors
 // implementation: basic/source/runtime/runtime.cxx
@@ -52,8 +52,8 @@ BASIC_DLLPUBLIC void setBasicWatchMode( bool bOn );
 #define SBXID_JSCRIPTMOD    0x6a62          // jm: JavaScript Module
 #define SBXID_JSCRIPTMETH   0x6a64          // jm: JavaScript Module
 
-#define SBX_HINT_BASICSTART     SFX_HINT_USER04
-#define SBX_HINT_BASICSTOP      SFX_HINT_USER05
+#define SBX_HINT_BASICSTART SFX_HINT_USER04
+#define SBX_HINT_BASICSTOP  SFX_HINT_USER05
 
 enum PropertyMode
 {
diff --git a/basic/inc/basic/sbmeth.hxx b/basic/inc/basic/sbmeth.hxx
index 6963c0d..0f24d4a 100644
--- a/basic/inc/basic/sbmeth.hxx
+++ b/basic/inc/basic/sbmeth.hxx
@@ -37,8 +37,8 @@ class BASIC_DLLPUBLIC SbMethod : public SbxMethod
     friend class SbJScriptMethod;
     friend class SbIfaceMapperMethod;
 
-    SbxVariable* mCaller;                   // caller
-    SbModule* pMod;
+    SbxVariable*  mCaller;                   // caller
+    SbModule*     pMod;
     sal_uInt16    nDebugFlags;
     sal_uInt16    nLine1, nLine2;
     sal_uInt32    nStart;
@@ -54,17 +54,17 @@ public:
     SBX_DECL_PERSIST_NODATA(SBXCR_SBX,SBXID_BASICMETHOD,2);
     TYPEINFO();
     virtual SbxInfo* GetInfo();
-    SbxArray* GetStatics();
-    void      ClearStatics();
-    SbModule* GetModule()                { return pMod;        }
-    sal_uInt32    GetId() const              { return nStart;      }
-    sal_uInt16    GetDebugFlags()            { return nDebugFlags; }
-    void      SetDebugFlags( sal_uInt16 n )  { nDebugFlags = n;    }
-    void      GetLineRange( sal_uInt16&, sal_uInt16& );
+    SbxArray*  GetStatics();
+    void       ClearStatics();
+    SbModule*  GetModule()                { return pMod;        }
+    sal_uInt32 GetId() const              { return nStart;      }
+    sal_uInt16 GetDebugFlags()            { return nDebugFlags; }
+    void       SetDebugFlags( sal_uInt16 n )  { nDebugFlags = n;    }
+    void       GetLineRange( sal_uInt16&, sal_uInt16& );
 
     // Interface to execute a method from the applications
     virtual ErrCode Call( SbxValue* pRet = NULL,  SbxVariable* pCaller = NULL );
-    virtual void Broadcast( sal_uIntPtr nHintId );
+    virtual void    Broadcast( sal_uIntPtr nHintId );
 };
 
 SV_DECL_IMPL_REF(SbMethod)
diff --git a/basic/inc/basic/sbmod.hxx b/basic/inc/basic/sbmod.hxx
index 464ebf2..7d32abc 100644
--- a/basic/inc/basic/sbmod.hxx
+++ b/basic/inc/basic/sbmod.hxx
@@ -74,15 +74,15 @@ protected:
     SbProcedureProperty* GetProcedureProperty( const String&, SbxDataType );
     SbIfaceMapperMethod* GetIfaceMapperMethod( const String&, SbMethod* );
     void            EndDefinitions( sal_Bool=sal_False );
-    sal_uInt16          Run( SbMethod* );
+    sal_uInt16      Run( SbMethod* );
     void            RunInit();
     void            ClearPrivateVars();
     void            ClearVarsDependingOnDeletedBasic( StarBASIC* pDeletedBasic );
     void            GlobalRunInit( bool bBasicStart );  // for all modules
     void            GlobalRunDeInit( void );
-    const sal_uInt8*    FindNextStmnt( const sal_uInt8*, sal_uInt16&, sal_uInt16& ) const;
-    const sal_uInt8*    FindNextStmnt( const sal_uInt8*, sal_uInt16&, sal_uInt16&,
-                        sal_Bool bFollowJumps, const SbiImage* pImg=NULL ) const;
+    const sal_uInt8* FindNextStmnt( const sal_uInt8*, sal_uInt16&, sal_uInt16& ) const;
+    const sal_uInt8* FindNextStmnt( const sal_uInt8*, sal_uInt16&, sal_uInt16&,
+                                    sal_Bool bFollowJumps, const SbiImage* pImg=NULL ) const;
     virtual sal_Bool LoadData( SvStream&, sal_uInt16 );
     virtual sal_Bool StoreData( SvStream& ) const;
     virtual sal_Bool LoadCompleted();
@@ -109,27 +109,27 @@ public:
     virtual sal_Bool    IsCompiled() const;
     const SbxObject* FindType( String aTypeName ) const;
 
-    virtual sal_Bool    IsBreakable( sal_uInt16 nLine ) const;
-    virtual size_t  GetBPCount() const;
-    virtual sal_uInt16  GetBP( size_t n ) const;
-    virtual sal_Bool    IsBP( sal_uInt16 nLine ) const;
-    virtual sal_Bool    SetBP( sal_uInt16 nLine );
-    virtual sal_Bool    ClearBP( sal_uInt16 nLine );
-    virtual void    ClearAllBP();
+    virtual sal_Bool IsBreakable( sal_uInt16 nLine ) const;
+    virtual size_t   GetBPCount() const;
+    virtual sal_uInt16 GetBP( size_t n ) const;
+    virtual sal_Bool IsBP( sal_uInt16 nLine ) const;
+    virtual sal_Bool SetBP( sal_uInt16 nLine );
+    virtual sal_Bool ClearBP( sal_uInt16 nLine );
+    virtual void     ClearAllBP();
 
     // Lines of Subs
     virtual SbMethod*   GetFunctionForLine( sal_uInt16 );
 
     // Store only image, no source (needed for new password protection)
-       sal_Bool StoreBinaryData( SvStream& );
-       sal_Bool StoreBinaryData( SvStream&, sal_uInt16 nVer );
+    sal_Bool StoreBinaryData( SvStream& );
+    sal_Bool StoreBinaryData( SvStream&, sal_uInt16 nVer );
     sal_Bool LoadBinaryData( SvStream&, sal_uInt16 nVer );
     sal_Bool LoadBinaryData( SvStream& );
     sal_Bool ExceedsLegacyModuleSize();
-    void fixUpMethodStart( bool bCvtToLegacy, SbiImage* pImg = NULL ) const;
-    bool HasExeCode();
-    bool IsVBACompat() const;
-    void SetVBACompat( bool bCompat );
+    void     fixUpMethodStart( bool bCvtToLegacy, SbiImage* pImg = NULL ) const;
+    bool     HasExeCode();
+    bool     IsVBACompat() const;
+    void     SetVBACompat( bool bCompat );
     sal_Int32 GetModuleType() { return mnType; }
     void SetModuleType( sal_Int32 nType ) { mnType = nType; }
     bool isProxyModule() { return bIsProxyModule; }
diff --git a/basic/inc/basic/sbstar.hxx b/basic/inc/basic/sbstar.hxx
index cffd4ad..af3fa60 100644
--- a/basic/inc/basic/sbstar.hxx
+++ b/basic/inc/basic/sbstar.hxx
@@ -134,9 +134,9 @@ public:
     void            ClearAllModuleVars( void );
 
     // Calls for error and break handler
-    static sal_uInt16   GetLine();
-    static sal_uInt16   GetCol1();
-    static sal_uInt16   GetCol2();
+    static sal_uInt16 GetLine();
+    static sal_uInt16 GetCol1();
+    static sal_uInt16 GetCol2();
     static void     SetErrorData( SbError nCode, sal_uInt16 nLine,
                                   sal_uInt16 nCol1, sal_uInt16 nCol2 );
 
diff --git a/basic/inc/basic/sbx.hxx b/basic/inc/basic/sbx.hxx
index 30dac56..f6e924e 100644
--- a/basic/inc/basic/sbx.hxx
+++ b/basic/inc/basic/sbx.hxx
@@ -68,7 +68,7 @@ class BASIC_DLLPUBLIC SbxInfo : public SvRefBase
 
     String          aComment;
     String          aHelpFile;
-    sal_uInt32          nHelpId;
+    sal_uInt32      nHelpId;
     SbxParams       aParams;
 
 protected:
@@ -209,8 +209,8 @@ public:
     void   AddDim32( sal_Int32, sal_Int32 );
     void   unoAddDim32( sal_Int32, sal_Int32 );
     sal_Bool   GetDim32( sal_Int32, sal_Int32&, sal_Int32& ) const;
-        bool hasFixedSize() { return mbHasFixedSize; };
-        void setHasFixedSize( bool bHasFixedSize ) {mbHasFixedSize = bHasFixedSize; };
+    bool hasFixedSize() { return mbHasFixedSize; };
+    void setHasFixedSize( bool bHasFixedSize ) {mbHasFixedSize = bHasFixedSize; };
 };
 
 class BASIC_DLLPUBLIC SbxCollection : public SbxObject
diff --git a/basic/inc/basic/sbxbase.hxx b/basic/inc/basic/sbxbase.hxx
index 37142a9..7b088be 100644
--- a/basic/inc/basic/sbxbase.hxx
+++ b/basic/inc/basic/sbxbase.hxx
@@ -39,7 +39,7 @@ struct SbxAppData
     SbxBasicFormater    *pBasicFormater;    // Pointer to Format()-Command helper class
 
     LanguageType        eBasicFormaterLangType;
-        // It might be useful to store this class 'global' because some string reosurces are saved here
+    // It might be useful to store this class 'global' because some string reosurces are saved here
 
     SbxAppData() : eSbxError( SbxERR_OK ), aFacs(), pBasicFormater( NULL ) {}
     ~SbxAppData();
diff --git a/basic/inc/basic/sbxcore.hxx b/basic/inc/basic/sbxcore.hxx
index e1ff9be..ce86fd6 100644
--- a/basic/inc/basic/sbxcore.hxx
+++ b/basic/inc/basic/sbxcore.hxx
@@ -68,10 +68,10 @@ protected:
     SBX_DECL_PERSIST(0,0,0);
 public:
     TYPEINFO();
-    inline void     SetFlags( sal_uInt16 n );
+    inline void         SetFlags( sal_uInt16 n );
     inline sal_uInt16   GetFlags() const;
-    inline void     SetFlag( sal_uInt16 n );
-    inline void     ResetFlag( sal_uInt16 n );
+    inline void         SetFlag( sal_uInt16 n );
+    inline void         ResetFlag( sal_uInt16 n );
     inline sal_Bool     IsSet( sal_uInt16 n ) const;
     inline sal_Bool     IsReset( sal_uInt16 n ) const;
     inline sal_Bool     CanRead() const;
@@ -81,17 +81,17 @@ public:
     inline sal_Bool     IsHidden() const;
     inline sal_Bool     IsVisible() const;
 
-    virtual sal_Bool IsFixed() const;
-    virtual void SetModified( sal_Bool );
+    virtual sal_Bool    IsFixed() const;
+    virtual void        SetModified( sal_Bool );
 
-    virtual SbxDataType  GetType()  const;
+    virtual SbxDataType GetType()  const;
     virtual SbxClassType GetClass() const;
 
     virtual void Clear();
 
     static SbxBase* Load( SvStream& );
-    static void Skip( SvStream& );
-    sal_Bool Store( SvStream& );
+    static void     Skip( SvStream& );
+    sal_Bool        Store( SvStream& );
     virtual sal_Bool LoadCompleted();
     virtual sal_Bool StoreCompleted();
 
diff --git a/basic/inc/basic/sbxprop.hxx b/basic/inc/basic/sbxprop.hxx
index 8b3bdb9..34e5877 100644
--- a/basic/inc/basic/sbxprop.hxx
+++ b/basic/inc/basic/sbxprop.hxx
@@ -32,7 +32,7 @@ public:
     SbxProperty( const SbxProperty& r ) : SvRefBase( r ), SbxVariable( r ) {}
     virtual ~SbxProperty();
     SbxProperty& operator=( const SbxProperty& r )
-    { SbxVariable::operator=( r ); return *this; }
+        { SbxVariable::operator=( r ); return *this; }
     virtual SbxClassType GetClass() const;
 };
 
diff --git a/basic/inc/basic/sbxvar.hxx b/basic/inc/basic/sbxvar.hxx
index 8bbd87b..c02c2a1 100644
--- a/basic/inc/basic/sbxvar.hxx
+++ b/basic/inc/basic/sbxvar.hxx
@@ -167,8 +167,8 @@ public:
 
     SbxBase*    GetObject() const;
     sal_uInt8   GetByte() const;
-    sal_uInt16 GetUShort() const;
-    sal_uInt32 GetULong() const;
+    sal_uInt16  GetUShort() const;
+    sal_uInt32  GetULong() const;
 
     sal_Bool PutInteger( sal_Int16 );
     sal_Bool PutLong( sal_Int32 );
@@ -293,7 +293,7 @@ class BASIC_DLLPUBLIC SbxVariable : public SbxValue
     SfxBroadcaster*  pCst;              // Broadcaster, if needed
     String           maName;            // Name, if available
     SbxArrayRef      mpPar;             // Parameter-Array, if set
-    sal_uInt16           nHash;             // Hash-ID for search
+    sal_uInt16       nHash;             // Hash-ID for search
 
     BASIC_DLLPRIVATE SbxVariableImpl* getImpl( void );
 
diff --git a/basic/source/basmgr/basmgr.cxx b/basic/source/basmgr/basmgr.cxx
index d681273..a0c25e8 100644
--- a/basic/source/basmgr/basmgr.cxx
+++ b/basic/source/basmgr/basmgr.cxx
@@ -2361,7 +2361,9 @@ void LibraryContainer_Impl::removeByName( const ::rtl::OUString& Name )
 {
     StarBASIC* pLib = mpMgr->GetLib( Name );
     if( !pLib )
+    {
         throw container::NoSuchElementException();
+    }
     sal_uInt16 nLibId = mpMgr->GetLibId( Name );
     mpMgr->RemoveLib( nLibId );
 }
@@ -2433,7 +2435,9 @@ void SAL_CALL StarBasicAccess_Impl::addModule
     StarBASIC* pLib = mpMgr->GetLib( LibraryName );
     DBG_ASSERT( pLib, "XML Import: Lib for module unknown");
     if( pLib )
+    {
         pLib->MakeModule32( ModuleName, Source );
+    }
 }
 
 void SAL_CALL StarBasicAccess_Impl::addDialog
diff --git a/basic/source/classes/errobject.cxx b/basic/source/classes/errobject.cxx
index e40809e..c5bd012 100644
--- a/basic/source/classes/errobject.cxx
+++ b/basic/source/classes/errobject.cxx
@@ -210,7 +210,9 @@ void SbxErrObject::setNumberAndDescription( ::sal_Int32 _number, const ::rtl::OU
     throw (uno::RuntimeException)
 {
     if( m_pErrObject != NULL )
+    {
         m_pErrObject->setData( uno::makeAny( _number ), uno::Any(), uno::makeAny( _description ), uno::Any(), uno::Any() );
+    }
 }
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/basic/source/classes/image.cxx b/basic/source/classes/image.cxx
index 3c91470..1d75670 100644
--- a/basic/source/classes/image.cxx
+++ b/basic/source/classes/image.cxx
@@ -135,8 +135,9 @@ bool SbiImage::Load( SvStream& r, sal_uInt32& nVersion )
         r >> nSign >> nLen >> nCount;
         nNext += nLen + 8;
         if( r.GetError() == SVSTREAM_OK )
-          switch( nSign )
         {
+            switch( nSign )
+            {
             case B_NAME:
                 aName = r.ReadUniOrByteString(eCharSet);
                 break;
@@ -212,20 +213,26 @@ bool SbiImage::Load( SvStream& r, sal_uInt32& nVersion )
                         memcpy( pStrings + nOff2, aStr.GetBuffer(), (aStr.Len() + 1) * sizeof( sal_Unicode ) );
                     }
                     delete[] pByteStrings;
-                } break;
+                }
+                break;
             case B_MODEND:
                 goto done;
             default:
                 break;
+            }
         }
         else
+        {
             break;
+        }
         r.Seek( nNext );
     }
 done:
     r.Seek( nLast );
     if( !SbiGood( r ) )
+    {
         bError = true;
+    }
     return !bError;
 }
 
@@ -248,15 +255,19 @@ bool SbiImage::Save( SvStream& r, sal_uInt32 nVer )
 
     eCharSet = GetSOStoreTextEncoding( eCharSet );
     if ( bLegacy )
+    {
         r << (sal_Int32) B_LEGACYVERSION;
+    }
     else
+    {
         r << (sal_Int32) B_CURVERSION;
+    }
     r  << (sal_Int32) eCharSet
-      << (sal_Int32) nDimBase
-      << (sal_Int16) nFlags
-      << (sal_Int16) 0
-      << (sal_Int32) 0
-      << (sal_Int32) 0;
+       << (sal_Int32) nDimBase
+       << (sal_Int16) nFlags
+       << (sal_Int16) 0
+       << (sal_Int32) 0
+       << (sal_Int32) 0;
 
     // Name?
     if( aName.Len() && SbiGood( r ) )
@@ -280,9 +291,13 @@ bool SbiImage::Save( SvStream& r, sal_uInt32 nVer )
         sal_Int32 nLen = aOUSource.getLength();
         const sal_Int32 nMaxUnitSize = STRING_MAXLEN - 1;
         if( nLen > STRING_MAXLEN )
+        {
             aTmp = aOUSource.copy( 0, nMaxUnitSize );
+        }
         else
+        {
             aTmp = aOUSource;
+        }
         r.WriteUniOrByteString( aTmp, eCharSet );
         SbiCloseRecord( r, nPos );
 
@@ -313,10 +328,12 @@ bool SbiImage::Save( SvStream& r, sal_uInt32 nVer )
             aNewToLegacy.convert();
             pLegacyPCode = (char*)aNewToLegacy.GetBuffer();
             nLegacyCodeSize = aNewToLegacy.GetSize();
-                r.Write( pLegacyPCode, nLegacyCodeSize );
+            r.Write( pLegacyPCode, nLegacyCodeSize );
         }
         else
+        {
             r.Write( pCode, nCodeSize );
+        }
         SbiCloseRecord( r, nPos );
     }
     // String-Pool?
@@ -328,8 +345,9 @@ bool SbiImage::Save( SvStream& r, sal_uInt32 nVer )
         short i;
 
         for( i = 0; i < nStrings && SbiGood( r ); i++ )
+        {
             r << (sal_uInt32) pStringOff[ i ];
-
+        }
         // Then the String-Block
         char* pByteStrings = new char[ nStringSize ];
         for( i = 0; i < nStrings; i++ )
@@ -347,7 +365,9 @@ bool SbiImage::Save( SvStream& r, sal_uInt32 nVer )
     // Set overall length
     SbiCloseRecord( r, nStart );
     if( !SbiGood( r ) )
+    {
         bError = true;
+    }
     return !bError;
 }
 
@@ -372,7 +392,9 @@ void SbiImage::MakeStrings( short nSize )
         memset( pStrings, 0, nStringSize * sizeof( sal_Unicode ) );
     }
     else
+    {
         bError = true;
+    }
 }
 
 // Add a string to StringPool. The String buffer is dynamically
@@ -380,19 +402,25 @@ void SbiImage::MakeStrings( short nSize )
 void SbiImage::AddString( const String& r )
 {
     if( nStringIdx >= nStrings )
+    {
         bError = true;
+    }
     if( !bError )
     {
         xub_StrLen  len = r.Len() + 1;
         sal_uInt32 needed = nStringOff + len;
         if( needed > 0xFFFFFF00L )
+        {
             bError = true;  // out of mem!
+        }
         else if( needed > nStringSize )
         {
             sal_uInt32 nNewLen = needed + 1024;
             nNewLen &= 0xFFFFFC00;  // trim to 1K border
             if( nNewLen > 0xFFFFFF00L )
+            {
                 nNewLen = 0xFFFFFF00L;
+            }
             sal_Unicode* p = NULL;
             if( (p = new sal_Unicode[ nNewLen ]) != NULL )
             {
@@ -402,7 +430,9 @@ void SbiImage::AddString( const String& r )
                 nStringSize = sal::static_int_cast< sal_uInt16 >(nNewLen);
             }
             else
+            {
                 bError = true;
+            }
         }
         if( !bError )
         {
@@ -411,7 +441,9 @@ void SbiImage::AddString( const String& r )
             nStringOff = nStringOff + len;
             // Last String? The update the size of the buffer
             if( nStringIdx >= nStrings )
+            {
                 nStringSize = nStringOff;
+            }
         }
     }
 }
@@ -430,7 +462,9 @@ void SbiImage::AddCode( char* p, sal_uInt32 s )
 void SbiImage::AddType(SbxObject* pObject)
 {
     if( !rTypes.Is() )
+    {
         rTypes = new SbxArray;
+    }
     SbxObject *pCopyObject = new SbxObject(*pObject);
     rTypes->Insert (pCopyObject,rTypes->Count());
 }
@@ -438,7 +472,9 @@ void SbiImage::AddType(SbxObject* pObject)
 void SbiImage::AddEnum(SbxObject* pObject) // Register enum type
 {
     if( !rEnums.Is() )
+    {
         rEnums = new SbxArray;
+    }
     rEnums->Insert( pObject, rEnums->Count() );
 }
 
diff --git a/basic/source/classes/sb.cxx b/basic/source/classes/sb.cxx
index bb375ee..24cc887 100644
--- a/basic/source/classes/sb.cxx
+++ b/basic/source/classes/sb.cxx
@@ -876,10 +876,15 @@ SbxObject* SbClassFactory::CreateObject( const rtl::OUString& rClassName )
     SbxObjectRef xToUseClassModules = xClassModules;
 
     if( SbModule* pMod = GetSbData()->pMod )
+    {
         if( StarBASIC* pDocBasic = lclGetDocBasicForModule( pMod ) )
+        {
             if( const DocBasicItem* pDocBasicItem = lclFindDocBasicItem( pDocBasic ) )
+            {
                 xToUseClassModules = pDocBasicItem->getClassModules();
-
+            }
+        }
+    }
     SbxVariable* pVar = xToUseClassModules->Find( rClassName, SbxCLASS_OBJECT );
     SbxObject* pRet = NULL;
     if( pVar )
@@ -1723,7 +1728,9 @@ sal_Bool StarBASIC::RTError( SbError code, const String& rMsg, sal_uInt16 l, sal
 
     SbError c = code;
     if( (c & ERRCODE_CLASS_MASK) == ERRCODE_CLASS_COMPILER )
+    {
         c = 0;
+    }
     MakeErrorText( c, rMsg );
 
     // Implementation of the code for the string transport to SFX-Error
diff --git a/basic/source/classes/sbunoobj.cxx b/basic/source/classes/sbunoobj.cxx
index 6b635aa..4519cee 100644
--- a/basic/source/classes/sbunoobj.cxx
+++ b/basic/source/classes/sbunoobj.cxx
@@ -308,7 +308,9 @@ namespace
     void lcl_indent( ::rtl::OUStringBuffer& _inout_rBuffer, sal_Int32 _nLevel )
     {
         while ( _nLevel-- > 0 )
+        {
             _inout_rBuffer.appendAscii( "  " );
+        }
     }
 }
 
@@ -2705,7 +2707,9 @@ SbxVariable* SbUnoObject::Find( const rtl::OUString& rName, SbxClassType t )
             {
                 ::rtl::OUString aUExactName = mxExactNameInvocation->getExactName( aUName );
                 if( !aUExactName.isEmpty() )
+                {
                     aUName = aUExactName;
+                }
             }
 
             try
@@ -2920,11 +2924,17 @@ void createAllObjectProperties( SbxObject* pObj )
     SbUnoObject* pUnoObj = PTR_CAST(SbUnoObject,pObj);
     SbUnoStructRefObject* pUnoStructObj = PTR_CAST(SbUnoStructRefObject,pObj);
     if( pUnoObj )
+    {
         pUnoObj->createAllProperties();
+    }
     else if ( pUnoStructObj )
+    {
         pUnoStructObj->createAllProperties();
+    }
     else
+    {
         pObj->GetAll( SbxCLASS_DONTCARE );
+    }
 }
 
 
@@ -2946,8 +2956,9 @@ void RTL_Impl_CreateUnoStruct( StarBASIC* pBasic, SbxArray& rPar, sal_Bool bWrit
     // try to create Struct with the same name
     SbUnoObjectRef xUnoObj = Impl_CreateUnoStruct( aClassName );
     if( !xUnoObj )
+    {
         return;
-
+    }
     // return the object
     SbxVariableRef refVar = rPar.Get(0);
     refVar->PutObject( (SbUnoObject*)xUnoObj );
@@ -3109,20 +3120,24 @@ void RTL_Impl_HasInterfaces( StarBASIC* pBasic, SbxArray& rPar, sal_Bool bWrite
     // get the Uno-Object
     SbxBaseRef pObj = (SbxBase*)rPar.Get( 1 )->GetObject();
     if( !(pObj && pObj->ISA(SbUnoObject)) )
+    {
         return;
+    }
     Any aAny = ((SbUnoObject*)(SbxBase*)pObj)->getUnoAny();
     TypeClass eType = aAny.getValueType().getTypeClass();
     if( eType != TypeClass_INTERFACE )
+    {
         return;
-
+    }
     // get the interface out of the Any
     Reference< XInterface > x = *(Reference< XInterface >*)aAny.getValue();
 
     // get CoreReflection
     Reference< XIdlReflection > xCoreReflection = getCoreReflection_Impl();
     if( !xCoreReflection.is() )
+    {
         return;
-
+    }
     for( sal_uInt16 i = 2 ; i < nParCount ; i++ )
     {
         // get the name of the interface of the struct
@@ -3131,13 +3146,16 @@ void RTL_Impl_HasInterfaces( StarBASIC* pBasic, SbxArray& rPar, sal_Bool bWrite
         // search for the class
         Reference< XIdlClass > xClass = xCoreReflection->forName( aIfaceName );
         if( !xClass.is() )
+        {
             return;
-
+        }
         // check if the interface will be supported
         ::rtl::OUString aClassName = xClass->getName();
         Type aClassType( xClass->getTypeClass(), aClassName.getStr() );
         if( !x->queryInterface( aClassType ).hasValue() )
+        {
             return;
+        }
     }
 
     // Every thing works; then return TRUE
@@ -3163,14 +3181,20 @@ void RTL_Impl_IsUnoStruct( StarBASIC* pBasic, SbxArray& rPar, sal_Bool bWrite )
     // get the Uno-Object
     SbxVariableRef xParam = rPar.Get( 1 );
     if( !xParam->IsObject() )
+    {
         return;
+    }
     SbxBaseRef pObj = (SbxBase*)rPar.Get( 1 )->GetObject();
     if( !(pObj && pObj->ISA(SbUnoObject)) )
+    {
         return;
+    }
     Any aAny = ((SbUnoObject*)(SbxBase*)pObj)->getUnoAny();
     TypeClass eType = aAny.getValueType().getTypeClass();
     if( eType == TypeClass_STRUCT )
+    {
         refVar->PutBool( sal_True );
+    }
 }
 
 
@@ -3192,32 +3216,46 @@ void RTL_Impl_EqualUnoObjects( StarBASIC* pBasic, SbxArray& rPar, sal_Bool bWrit
     // get the Uno-Objects
     SbxVariableRef xParam1 = rPar.Get( 1 );
     if( !xParam1->IsObject() )
+    {
         return;
+    }
     SbxBaseRef pObj1 = (SbxBase*)xParam1->GetObject();
     if( !(pObj1 && pObj1->ISA(SbUnoObject)) )
+    {
         return;
+    }
     Any aAny1 = ((SbUnoObject*)(SbxBase*)pObj1)->getUnoAny();
     TypeClass eType1 = aAny1.getValueType().getTypeClass();
     if( eType1 != TypeClass_INTERFACE )
+    {
         return;
+    }
     Reference< XInterface > x1;
     aAny1 >>= x1;
 
     SbxVariableRef xParam2 = rPar.Get( 2 );
     if( !xParam2->IsObject() )
+    {
         return;
+    }
     SbxBaseRef pObj2 = (SbxBase*)xParam2->GetObject();
     if( !(pObj2 && pObj2->ISA(SbUnoObject)) )
+    {
         return;
+    }
     Any aAny2 = ((SbUnoObject*)(SbxBase*)pObj2)->getUnoAny();
     TypeClass eType2 = aAny2.getValueType().getTypeClass();
     if( eType2 != TypeClass_INTERFACE )
+    {
         return;
+    }
     Reference< XInterface > x2;
     aAny2 >>= x2;
 
     if( x1 == x2 )
+    {
         refVar->PutBool( sal_True );
+    }
 }
 
 
@@ -3254,8 +3292,7 @@ VBAConstantHelper::instance()
     return aHelper;
 }
 
-void
-VBAConstantHelper::init()
+void VBAConstantHelper::init()
 {
     if ( !isInited )
     {
@@ -3263,9 +3300,10 @@ VBAConstantHelper::init()
         types[ 0 ] = TypeClass_CONSTANTS;
         Reference< XTypeDescriptionEnumeration > xEnum = getTypeDescriptorEnumeration( rtl::OUString(defaultNameSpace), types, TypeDescriptionSearchDepth_INFINITE  );
 
-        if ( !xEnum.is() )
+        if ( !xEnum.is())
+        {
             return; //NULL;
-
+        }
         while ( xEnum->hasMoreElements() )
         {
             Reference< XConstantsTypeDescription > xConstants( xEnum->nextElement(), UNO_QUERY );
@@ -3823,7 +3861,9 @@ void SbUnoSingleton::SFX_NOTIFY( SfxBroadcaster& rBC, const TypeId& rBCType,
         unoToSbxValue( pVar, aRetAny );
     }
     else
+    {
         SbxObject::SFX_NOTIFY( rBC, rBCType, rHint, rHintType );
+    }
 }
 
 
@@ -3852,10 +3892,7 @@ public:
 
 
 //========================================================================
-BasicAllListener_Impl::BasicAllListener_Impl
-(
-    const ::rtl::OUString   & aPrefixName_
-)
+BasicAllListener_Impl::BasicAllListener_Impl(const OUString& aPrefixName_)
     : aPrefixName( aPrefixName_ )
 {
 }
@@ -4367,8 +4404,9 @@ void SAL_CALL ModuleInvocationProxy::setValue( const ::rtl::OUString& rProperty,
 Any SAL_CALL ModuleInvocationProxy::getValue( const ::rtl::OUString& rProperty ) throw( UnknownPropertyException )
 {
     if( !m_bProxyIsClassModuleObject )
+    {
         throw UnknownPropertyException();
-
+    }
     SolarMutexGuard guard;
 
     ::rtl::OUString aPropertyFunctionName( "Property Get " );
@@ -4647,8 +4685,9 @@ bool SbModule::createCOMWrapperForIface( Any& o_rRetAny, SbClassModuleObject* pP
             ::rtl::OUString aPureIfaceName = aIfaceName;
             sal_Int32 indexLastDot = aIfaceName.lastIndexOf('.');
             if ( indexLastDot > -1 )
+            {
                 aPureIfaceName = aIfaceName.copy( indexLastDot + 1 );
-
+            }
             Reference< XInvocation > xProxy = new ModuleInvocationProxy( aPureIfaceName, pProxyClassModuleObject );
 
             Sequence<Any> args( 2 );
@@ -4748,7 +4787,9 @@ rtl::OUString StructRefInfo::getTypeName() const
 {
     rtl::OUString sTypeName;
     if ( mpTD )
+    {
         sTypeName = mpTD->pTypeName;
+    }
     return sTypeName;
 }
 
@@ -4913,8 +4954,9 @@ Any SbUnoStructRefObject::getUnoAny( void )
         {
             ::rtl::OUStringBuffer aPropStr;
             if( (i % nPropsPerLine) == 0 )
+            {
                 aPropStr.appendAscii( "\n" );
-
+            }
             // output the type and name
             // Is it in Uno a sequence?
             SbxDataType eType = pVar->GetFullType();
@@ -4930,20 +4972,27 @@ Any SbUnoStructRefObject::getUnoAny( void )
                 if( eType == SbxOBJECT )
                 {
                     if( rPropInfo.getTypeClass() == TypeClass_SEQUENCE )
+                    {
                         eType = (SbxDataType) ( SbxOBJECT | SbxARRAY );
+                    }
                 }
             }
             aPropStr.append( Dbg_SbxDataType2String( eType ) );
             if( bMaybeVoid )
+            {
                 aPropStr.appendAscii( "/void" );
+            }
             aPropStr.appendAscii( " " );
             aPropStr.append( pVar->GetName() );
 
             if( i == nPropCount - 1 )
+            {
                 aPropStr.appendAscii( "\n" );
+            }
             else
+            {
                 aPropStr.appendAscii( "; " );
-
+            }
             aRet.append( aPropStr.makeStringAndClear() );
         }
     }
@@ -5029,7 +5078,9 @@ void SbUnoStructRefObject::SFX_NOTIFY( SfxBroadcaster& rBC, const TypeId& rBCTyp
 StructRefInfo SbUnoStructRefObject::getStructMember( const rtl::OUString& rMemberName )
 {
     if (!mbMemberCacheInit)
+    {
         initMemberCache();
+    }
     StructFieldInfo::iterator it = maFields.find( rMemberName );
 
     typelib_TypeDescription * pFoundTD = NULL;
diff --git a/basic/source/classes/sbxmod.cxx b/basic/source/classes/sbxmod.cxx
index 759b9b2..d6c2a9b 100644
--- a/basic/source/classes/sbxmod.cxx
+++ b/basic/source/classes/sbxmod.cxx
@@ -202,7 +202,9 @@ DocObjectWrapper::release() throw ()
         delete this;
     }
     else
+    {
         OSL_TRACE("DocObjectWrapper::release(%s) 0x%x refcount is now %d", rtl::OUStringToOString( mName, RTL_TEXTENCODING_UTF8 ).getStr(), this, m_refCount );
+    }
 }
 
 DocObjectWrapper::~DocObjectWrapper()
@@ -216,15 +218,21 @@ Sequence< Type > SAL_CALL DocObjectWrapper::getTypes()
     {
         Sequence< Type > sTypes;
         if ( m_xAggregateTypeProv.is() )
+        {
             sTypes = m_xAggregateTypeProv->getTypes();
+        }
         m_Types.realloc( sTypes.getLength() + 1 );
         Type* pPtr = m_Types.getArray();
         for ( int i=0; i<m_Types.getLength(); ++i, ++pPtr )
         {
             if ( i == 0 )
+            {
                 *pPtr = XInvocation::static_type( NULL );
+            }
             else
+            {
                 *pPtr = sTypes[ i - 1 ];
+            }
         }
     }
     return m_Types;
@@ -504,7 +512,9 @@ SbModule::SbModule( const String& rName,  sal_Bool bVBACompat )
     // #i92642: Set name property to intitial name
     SbxVariable* pNameProp = pProps->Find( String( RTL_CONSTASCII_USTRINGPARAM("Name") ), SbxCLASS_PROPERTY );
     if( pNameProp != NULL )
+    {
         pNameProp->PutString( GetName() );
+    }
 }
 
 SbModule::~SbModule()
@@ -571,7 +581,9 @@ SbMethod* SbModule::GetMethod( const String& rName, SbxDataType t )
     SbxVariable* p = pMethods->Find( rName, SbxCLASS_METHOD );
     SbMethod* pMeth = p ? PTR_CAST(SbMethod,p) : NULL;
     if( p && !pMeth )
+    {
         pMethods->Remove( p );
+    }
     if( !pMeth )
     {
         pMeth = new SbMethod( rName, t, this );
@@ -588,7 +600,9 @@ SbMethod* SbModule::GetMethod( const String& rName, SbxDataType t )
     pMeth->SetType( t );
     pMeth->ResetFlag( SBX_WRITE );
     if( t != SbxVARIANT )
+    {
         pMeth->SetFlag( SBX_FIXED );
+    }
     return pMeth;
 }
 
@@ -599,7 +613,9 @@ SbProperty* SbModule::GetProperty( const String& rName, SbxDataType t )
     SbxVariable* p = pProps->Find( rName, SbxCLASS_PROPERTY );
     SbProperty* pProp = p ? PTR_CAST(SbProperty,p) : NULL;
     if( p && !pProp )
+    {
         pProps->Remove( p );
+    }
     if( !pProp )
     {
         pProp = new SbProperty( rName, t, this );
@@ -617,7 +633,9 @@ SbProcedureProperty* SbModule::GetProcedureProperty
     SbxVariable* p = pProps->Find( rName, SbxCLASS_PROPERTY );
     SbProcedureProperty* pProp = p ? PTR_CAST(SbProcedureProperty,p) : NULL;
     if( p && !pProp )
+    {
         pProps->Remove( p );
+    }
     if( !pProp )
     {
         pProp = new SbProcedureProperty( rName, t );
@@ -635,7 +653,9 @@ SbIfaceMapperMethod* SbModule::GetIfaceMapperMethod
     SbxVariable* p = pMethods->Find( rName, SbxCLASS_METHOD );
     SbIfaceMapperMethod* pMapperMethod = p ? PTR_CAST(SbIfaceMapperMethod,p) : NULL;
     if( p && !pMapperMethod )
+    {
         pMethods->Remove( p );
+    }
     if( !pMapperMethod )
     {
         pMapperMethod = new SbIfaceMapperMethod( rName, pImplMeth );
@@ -691,7 +711,9 @@ SbxVariable* SbModule::Find( const rtl::OUString& rName, SbxClassType t )
     // make sure a search in an uninstatiated class module will fail
     SbxVariable* pRes = SbxObject::Find( rName, t );
     if ( bIsProxyModule && !GetSbData()->bRunInit )
+    {
         return NULL;
+    }
     if( !pRes && pImage )
     {
         SbiInstance* pInst = GetSbData()->pInst;
@@ -714,7 +736,9 @@ SbxVariable* SbModule::Find( const rtl::OUString& rName, SbxClassType t )
                     pRes->SetParent( this );
                     pRes->SetFlag( SBX_READ );
                     if( bPrivate )
+                    {
                         pRes->SetFlag( SBX_PRIVATE );
+                    }
                     pRes->PutObject( pEnumObject );
                 }
             }
@@ -837,8 +861,10 @@ void SbModule::SFX_NOTIFY( SfxBroadcaster& rBC, const TypeId& rBCType,
             if( pHint->GetId() == SBX_HINT_DATAWANTED )
             {
                 if( pMeth->bInvalid && !Compile() )
+                {
                     // auto compile has not worked!
                     StarBASIC::Error( SbERR_BAD_PROP_VALUE );
+                }
                 else
                 {
                     // Call of a subprogram
@@ -858,10 +884,13 @@ void SbModule::SFX_NOTIFY( SfxBroadcaster& rBC, const TypeId& rBCType,
             sal_uIntPtr nId = pHint->GetId();
             if( (nId == SBX_HINT_DATAWANTED || nId == SBX_HINT_DATACHANGED) &&
                 pVar->GetName().EqualsIgnoreCaseAscii( "name" ) )
+            {
                     bForwardToSbxObject = false;
-
+            }
             if( bForwardToSbxObject )
+            {
                 SbxObject::SFX_NOTIFY( rBC, rBCType, rHint, rHintType );
+            }
         }
     }
 }
@@ -881,7 +910,7 @@ void SbModule::SetSource32( const ::rtl::OUString& r )
     aOUSource = r;
     StartDefinitions();
     SbiTokenizer aTok( r );
-        aTok.SetCompatible( IsVBACompat() );
+    aTok.SetCompatible( IsVBACompat() );
     while( !aTok.IsEof() )
     {
         SbiToken eEndTok = NIL;
@@ -910,11 +939,13 @@ void SbModule::SetSource32( const ::rtl::OUString& r )
                 {
                     eCurTok = aTok.Next();
                     if( eCurTok == COMPATIBLE )
+                    {
                         aTok.SetCompatible( true );
+                    }
                     else if ( ( eCurTok == VBASUPPORT ) && ( aTok.Next() == NUMBER ) )
                     {
-                            sal_Bool bIsVBA = ( aTok.GetDbl()== 1 );
-                            SetVBACompat( bIsVBA );
+                        sal_Bool bIsVBA = ( aTok.GetDbl()== 1 );
+                        SetVBACompat( bIsVBA );
                         aTok.SetCompatible( bIsVBA );
                     }
                 }
@@ -1083,7 +1114,7 @@ sal_uInt16 SbModule::Run( SbMethod* pMeth )
 
     sal_uInt16 nRes = 0;
     bool bDelInst = ( GetSbData()->pInst == NULL );
-        bool bQuit = false;
+    bool bQuit = false;
     StarBASICRef xBasic;
     uno::Reference< frame::XModel > xModel;
     uno::Reference< script::vba::XVBACompatibility > xVBACompat;
diff --git a/basic/source/comp/codegen.cxx b/basic/source/comp/codegen.cxx
index 6642cb1..3f389eb 100644
--- a/basic/source/comp/codegen.cxx
+++ b/basic/source/comp/codegen.cxx
@@ -149,17 +149,21 @@ void SbiCodeGen::Save()
     {
         GetSbData()->pClassFac->RemoveClassModule( &rMod );
         // Only a ClassModule can revert to Normal
-                if ( rMod.mnType == com::sun::star::script::ModuleType::CLASS )
+        if ( rMod.mnType == com::sun::star::script::ModuleType::CLASS )
+        {
             rMod.mnType = com::sun::star::script::ModuleType::NORMAL;
+        }
         rMod.bIsProxyModule = false;
     }
 
     // GlobalCode-Flag
     if( pParser->HasGlobalCode() )
+    {
         p->SetFlag( SBIMG_INITCODE );
+    }
     // Die Entrypoints:
     for( SbiSymDef* pDef = pParser->aPublics.First(); pDef;
-                   pDef = pParser->aPublics.Next() )
+         pDef = pParser->aPublics.Next() )
     {
         SbiProcDef* pProc = pDef->GetProcDef();
         if( pProc && pProc->IsDefined() )
@@ -198,8 +202,9 @@ void SbiCodeGen::Save()
             for( sal_uInt16 nPass = 0 ; nPass < nPassCount ; nPass++ )
             {
                 if( nPass == 1 )
+                {
                     aProcName = aIfaceProcName;
-
+                }
                 PropertyMode ePropMode = pProc->getPropertyMode();
                 if( ePropMode != PROPERTY_MODE_NONE )
                 {
@@ -249,8 +254,9 @@ void SbiCodeGen::Save()
 
                     // Declare? -> Hidden
                     if( pProc->GetLib().Len() > 0 )
+                    {
                         pMeth->SetFlag( SBX_HIDDEN );
-
+                    }
                     pMeth->nStart = pProc->GetAddr();
                     pMeth->nLine1 = pProc->GetLine1();
                     pMeth->nLine2 = pProc->GetLine2();
@@ -275,24 +281,35 @@ void SbiCodeGen::Save()
                         SbiSymDef* pPar = pPool->Get( i );
                         SbxDataType t = pPar->GetType();
                         if( !pPar->IsByVal() )
+                        {
                             t = (SbxDataType) ( t | SbxBYREF );
+                        }
                         if( pPar->GetDims() )
+                        {
                             t = (SbxDataType) ( t | SbxARRAY );
+                        }
                         // #33677 hand-over an Optional-Info
                         sal_uInt16 nFlags = SBX_READ;
                         if( pPar->IsOptional() )
+                        {
                             nFlags |= SBX_OPTIONAL;
-
+                        }
                         pInfo->AddParam( pPar->GetName(), t, nFlags );
 
                         sal_uInt32 nUserData = 0;
                         sal_uInt16 nDefaultId = pPar->GetDefaultId();
                         if( nDefaultId )
+                        {
                             nUserData |= nDefaultId;
+                        }
                         if( pPar->IsParamArray() )
+                        {
                             nUserData |= PARAM_INFO_PARAMARRAY;
+                        }
                         if( pPar->IsWithBrackets() )
+                        {
                             nUserData |= PARAM_INFO_WITHBRACKETS;
+                        }
                         if( nUserData )
                         {
                             SbxParamInfo* pParam = (SbxParamInfo*)pInfo->GetParam( i );
@@ -301,7 +318,6 @@ void SbiCodeGen::Save()
                     }
                     pMeth->SetInfo( pInfo );
                 }
-
             }   // for( iPass...
         }
     }
@@ -314,23 +330,29 @@ void SbiCodeGen::Save()
     p->MakeStrings( nSize );
     sal_uInt16 i;
     for( i = 1; i <= nSize; i++ )
+    {
         p->AddString( pPool->Find( i ) );
-
+    }
     // Insert types
     sal_uInt16 nCount = pParser->rTypeArray->Count();
     for (i = 0; i < nCount; i++)
+    {
          p->AddType((SbxObject *)pParser->rTypeArray->Get(i));
-
+    }
     // Insert enum objects
     nCount = pParser->rEnumArray->Count();
     for (i = 0; i < nCount; i++)
+    {
          p->AddEnum((SbxObject *)pParser->rEnumArray->Get(i));
-
+    }
     if( !p->IsError() )
+    {
         rMod.pImage = p;
+    }
     else
+    {
         delete p;
-
+    }
     rMod.EndDefinitions();
 }
 
diff --git a/basic/source/comp/dim.cxx b/basic/source/comp/dim.cxx
index 70d441e..b2f5dc5 100644
--- a/basic/source/comp/dim.cxx
+++ b/basic/source/comp/dim.cxx
@@ -824,17 +824,25 @@ SbiProcDef* SbiParser::ProcDecl( bool bDecl )
     {
         Next();
         if( Next() == FIXSTRING )
+        {
             pDef->GetLib() = aSym;
+        }
         else
+        {
             Error( SbERR_SYNTAX );
+        }
     }
     if( Peek() == ALIAS )
     {
         Next();
         if( Next() == FIXSTRING )
+        {
             pDef->GetAlias() = aSym;
+        }
         else
+        {
             Error( SbERR_SYNTAX );
+        }
     }
     if( !bDecl )
     {
@@ -844,7 +852,9 @@ SbiProcDef* SbiParser::ProcDecl( bool bDecl )
         if( pDef->GetAlias().Len() )
             Error( SbERR_UNEXPECTED, ALIAS );
         if( pDef->IsCdecl() )
+        {
             Error( SbERR_UNEXPECTED, _CDECL_ );
+        }
         pDef->SetCdecl( false );
         pDef->GetLib().Erase();
         pDef->GetAlias().Erase();
@@ -853,9 +863,13 @@ SbiProcDef* SbiParser::ProcDecl( bool bDecl )
     {
         // ALIAS and CDECL only together with LIB
         if( pDef->GetAlias().Len() )
+        {
             Error( SbERR_UNEXPECTED, ALIAS );
+        }
         if( pDef->IsCdecl() )
+        {
             Error( SbERR_UNEXPECTED, _CDECL_ );
+        }
         pDef->SetCdecl( false );
         pDef->GetAlias().Erase();
     }
@@ -927,9 +941,13 @@ SbiProcDef* SbiParser::ProcDecl( bool bDecl )
     }
     TypeDecl( *pDef );
     if( eType != SbxVARIANT && pDef->GetType() != eType )
+    {
         Error( SbERR_BAD_DECLARATION, aName );
+    }
     if( pDef->GetType() == SbxVARIANT && !( bFunc || bProp ) )
+    {
         pDef->SetType( SbxEMPTY );
+    }
     return pDef;
 }
 
@@ -944,7 +962,9 @@ void SbiParser::DefDeclare( bool bPrivate )
 {
     Next();
     if( eCurTok != SUB && eCurTok != FUNCTION )
+    {
       Error( SbERR_UNEXPECTED, eCurTok );
+    }
     else
     {
         bool bFunction = (eCurTok == FUNCTION);
@@ -953,7 +973,9 @@ void SbiParser::DefDeclare( bool bPrivate )
         if( pDef )
         {
             if( !pDef->GetLib().Len() )
+            {
                 Error( SbERR_EXPECTED, LIB );
+            }
             // Is it already there?
             SbiSymDef* pOld = aPublics.Find( pDef->GetName() );
             if( pOld )
@@ -967,11 +989,14 @@ void SbiParser::DefDeclare( bool bPrivate )
                     pDef = NULL;
                 }
                 else
+                {
                     pDef->Match( p );
+                }
             }
             else
+            {
                 aPublics.Add( pDef );
-
+            }
             if ( pDef )
             {
                 pDef->SetPublic( !bPrivate );
@@ -996,8 +1021,9 @@ void SbiParser::DefDeclare( bool bPrivate )
 
                     SbxDataType eType = pDef->GetType();
                     if( bFunction )
+                    {
                         aGen.Gen( _PARAM, 0, sal::static_int_cast< sal_uInt16 >( eType ) );
-
+                    }
                     if( nParCount > 1 )
                     {
                         aGen.Gen( _ARGC );
@@ -1026,14 +1052,19 @@ void SbiParser::DefDeclare( bool bPrivate )
                     SbiOpcode eOp = pDef->IsCdecl() ? _CALLC : _CALL;
                     sal_uInt16 nId = pDef->GetId();
                     if( pDef->GetAlias().Len() )
+                    {
                         nId = ( nId & 0x8000 ) | aGblStrings.Add( pDef->GetAlias() );
+                    }
                     if( nParCount > 1 )
+                    {
                         nId |= 0x8000;
+                    }
                     aGen.Gen( eOp, nId, sal::static_int_cast< sal_uInt16 >( eType ) );
 
                     if( bFunction )
+                    {
                         aGen.Gen( _PUT );
-
+                    }
                     aGen.Gen( _LEAVE );
                 }
             }
@@ -1047,14 +1078,19 @@ void SbiParser::Attribute()
     while( Next() != EQ )
     {
         if( Next() != DOT)
+        {
             break;
+        }
     }
 
     if( eCurTok != EQ )
+    {
         Error( SbERR_SYNTAX );
+    }
     else
+    {
         SbiExpression aValue( this );
-
+    }
     // Don't generate any code - just discard it.
 }
 
@@ -1086,19 +1122,29 @@ void SbiParser::DefProc( bool bStatic, bool bPrivate )
     {
         Next();
         if( eCurTok == GET )
+        {
             ePropertyMode = PROPERTY_MODE_GET;
+        }
         else if( eCurTok == LET )
+        {
             ePropertyMode = PROPERTY_MODE_LET;
+        }
         else if( eCurTok == SET )
+        {
             ePropertyMode = PROPERTY_MODE_SET;
+        }
         else
+        {
             Error( SbERR_EXPECTED, "Get or Let or Set" );
+        }
     }
 
     SbiToken eExit = eCurTok;
     SbiProcDef* pDef = ProcDecl( false );
     if( !pDef )
+    {
         return;
+    }
     pDef->setPropertyMode( ePropertyMode );
 
     // Is the Proc already declared?
@@ -1137,10 +1183,13 @@ void SbiParser::DefProc( bool bStatic, bool bPrivate )
         }
     }
     else
+    {
         aPublics.Add( pDef ), pProc = pDef;
-
+    }
     if( !pProc )
+    {
         return;
+    }
     pProc->SetPublic( !bPrivate );
 
     // Now we set the search hierarchy for symbols as well as the
@@ -1148,16 +1197,20 @@ void SbiParser::DefProc( bool bStatic, bool bPrivate )
     aPublics.SetProcId( pProc->GetId() );
     pProc->GetParams().SetParent( &aPublics );
     if( bStatic )
-        {
+    {
         if ( bVBASupportOn )
+        {
             pProc->SetStatic( sal_True );
+        }
         else
+        {
             Error( SbERR_NOT_IMPLEMENTED ); // STATIC SUB ...
         }
-     else
+    }
+    else
     {
         pProc->SetStatic( sal_False );
-        }
+    }
     // Normal case: Local variable->parameter->global variable
     pProc->GetLocals().SetParent( &pProc->GetParams() );
     pPool = &pProc->GetLocals();
@@ -1186,30 +1239,35 @@ void SbiParser::Static()
 
 void SbiParser::DefStatic( bool bPrivate )
 {
+    SbiSymPool* p;
+
     switch( Peek() )
     {
-        case SUB:
-        case FUNCTION:
-        case PROPERTY:
-            // End global chain if necessary (not done in
-            // SbiParser::Parse() under these conditions
-            if( bNewGblDefs && nGblChain == 0 )
-            {
-                nGblChain = aGen.Gen( _JUMP, 0 );
-                bNewGblDefs = false;
-            }
-            Next();
-            DefProc( true, bPrivate );
-            break;
-        default: {
-            if( !pProc )
-                Error( SbERR_NOT_IN_SUBR );
-            // Reset the Pool, so that STATIC-Declarations go into the
-            // global Pool
-            SbiSymPool* p = pPool; pPool = &aPublics;
-            DefVar( _STATIC, true );
-            pPool = p;
-            } break;
+    case SUB:
+    case FUNCTION:
+    case PROPERTY:
+        // End global chain if necessary (not done in
+        // SbiParser::Parse() under these conditions
+        if( bNewGblDefs && nGblChain == 0 )
+        {
+            nGblChain = aGen.Gen( _JUMP, 0 );
+            bNewGblDefs = false;
+        }
+        Next();
+        DefProc( true, bPrivate );
+        break;
+    default:
+        if( !pProc )
+        {
+            Error( SbERR_NOT_IN_SUBR );
+        }
+        // Reset the Pool, so that STATIC-Declarations go into the
+        // global Pool
+        p = pPool;
+        pPool = &aPublics;
+        DefVar( _STATIC, true );
+        pPool = p;
+        break;
     }
 }
 
diff --git a/basic/source/comp/exprgen.cxx b/basic/source/comp/exprgen.cxx
index d752993..13ce100 100644
--- a/basic/source/comp/exprgen.cxx
+++ b/basic/source/comp/exprgen.cxx
@@ -57,22 +57,26 @@ static OpTable aOpTable [] = {
 // Output of an element
 void SbiExprNode::Gen( RecursiveMode eRecMode )
 {
+    sal_uInt16 nStringId;
+
     if( IsConstant() )
     {
         switch( GetType() )
         {
-            case SbxEMPTY:   pGen->Gen( _EMPTY ); break;
-            case SbxINTEGER: pGen->Gen( _CONST,  (short) nVal ); break;
-            case SbxSTRING:
-            {
-                sal_uInt16 nStringId = pGen->GetParser()->aGblStrings.Add( aStrVal, sal_True );
-                pGen->Gen( _SCONST, nStringId ); break;
-            }
-            default:
-            {
-                sal_uInt16 nStringId = pGen->GetParser()->aGblStrings.Add( nVal, eType );
-                pGen->Gen( _NUMBER, nStringId );
-            }
+        case SbxEMPTY:
+            pGen->Gen( _EMPTY );
+            break;
+        case SbxINTEGER:
+            pGen->Gen( _CONST,  (short) nVal );
+            break;
+        case SbxSTRING:
+            nStringId = pGen->GetParser()->aGblStrings.Add( aStrVal, sal_True );
+            pGen->Gen( _SCONST, nStringId );
+            break;
+        default:
+            nStringId = pGen->GetParser()->aGblStrings.Add( nVal, eType );
+            pGen->Gen( _NUMBER, nStringId );
+            break;
         }
     }
     else if( IsOperand() )
@@ -92,10 +96,14 @@ void SbiExprNode::Gen( RecursiveMode eRecMode )
                 else if( eRecMode == UNDEFINED )
                 {
                     if( aVar.pPar && aVar.pPar->IsBracket() )
+                    {
                          bTreatFunctionAsParam = false;
+                    }
                 }
                 if( !bTreatFunctionAsParam )
+                {
                     eOp = aVar.pDef->IsGlobal() ? _FIND_G : _FIND;
+                }
             }
         }
         // special treatment for WITH
@@ -114,7 +122,9 @@ void SbiExprNode::Gen( RecursiveMode eRecMode )
 
             SbiProcDef* pProc = aVar.pDef->GetProcDef();
             if ( pGen->GetParser()->bClassModule )
+            {
                 eOp = _FIND_CM;
+            }
             else if ( aVar.pDef->IsStatic() || (pProc && pProc->IsStatic()) )
             {
                 eOp = _FIND_STATIC;
@@ -123,7 +133,9 @@ void SbiExprNode::Gen( RecursiveMode eRecMode )
         for( SbiExprNode* p = this; p; p = p->aVar.pNext )
         {
             if( p == this && pWithParent_ != NULL )
+            {
                 pWithParent_->Gen();
+            }
             p->GenElement( eOp );
             eOp = _ELEM;
         }
@@ -141,7 +153,9 @@ void SbiExprNode::Gen( RecursiveMode eRecMode )
     {
         pLeft->Gen();
         if( pRight )
+        {
             pRight->Gen();
+        }
         for( OpTable* p = aOpTable; p->eTok != NIL; p++ )
         {
             if( p->eTok == eTok )
@@ -247,12 +261,16 @@ void SbiExpression::Gen( RecursiveMode eRecMode )
     // If pExpr == .-term in With, approximately Gen for Basis-Object
     pExpr->Gen( eRecMode );
     if( bByVal )
+    {
         pParser->aGen.Gen( _BYVAL );
+    }
     if( bBased )
     {
         sal_uInt16 uBase = pParser->nBase;
         if( pParser->IsCompatible() )
+        {
             uBase |= 0x8000;        // #109275 Flag compatiblity
+        }
         pParser->aGen.Gen( _BASED, uBase );
         pParser->aGen.Gen( _ARGV );
     }
diff --git a/basic/source/comp/exprtree.cxx b/basic/source/comp/exprtree.cxx
index 1a4b465..3385756 100644
--- a/basic/source/comp/exprtree.cxx
+++ b/basic/source/comp/exprtree.cxx
@@ -39,11 +39,17 @@ SbiExpression::SbiExpression( SbiParser* p, SbiExprType t,
     pNext = NULL;
     pExpr = (t != SbSTDEXPR ) ? Term( pKeywordSymbolInfo ) : Boolean();
     if( t != SbSYMBOL )
+    {
         pExpr->Optimize();
+    }
     if( t == SbLVALUE && !pExpr->IsLvalue() )
+    {
         p->Error( SbERR_LVALUE_EXPECTED );
+    }
     if( t == SbOPERAND && !IsVariable() )
+    {
         p->Error( SbERR_VAR_EXPECTED );
+    }
 }
 
 SbiExpression::SbiExpression( SbiParser* p, double n, SbxDataType t )
@@ -82,12 +88,16 @@ SbiExpression::~SbiExpression()
 static sal_Bool DoParametersFollow( SbiParser* p, SbiExprType eCurExpr, SbiToken eTok )
 {
     if( eTok == LPAREN )
+    {
         return sal_True;
+    }
     // but only if similar to CALL!
     if( !p->WhiteSpace() || eCurExpr != SbSYMBOL )
+    {
         return sal_False;
-    if (   eTok == NUMBER || eTok == MINUS || eTok == FIXSTRING
-        || eTok == SYMBOL || eTok == COMMA  || eTok == DOT || eTok == NOT || eTok == BYVAL )
+    }
+    if ( eTok == NUMBER || eTok == MINUS || eTok == FIXSTRING ||
+         eTok == SYMBOL || eTok == COMMA  || eTok == DOT || eTok == NOT || eTok == BYVAL )
     {
         return sal_True;
     }
@@ -97,7 +107,9 @@ static sal_Bool DoParametersFollow( SbiParser* p, SbiExprType eCurExpr, SbiToken
         // Urk the Next() / Peek() symantics are... weird
         tokens.Next();
         if ( tokens.Peek() == ASSIGN )
+        {
             return sal_True;
+        }
     }
     return sal_False;
 }
@@ -118,13 +130,16 @@ static SbiSymDef* AddSym
         // procs must always get into a public pool
         SbiSymPool* pPool = &rPool;
         if( pPool->GetScope() != SbPUBLIC )
+        {
             pPool = &rPool.GetParser()->aPublics;
+        }
         SbiProcDef* pProc = pPool->AddProc( rName );
 
         // special treatment for Colls like Documents(1)
         if( eCurExpr == SbSTDEXPR )
+        {
             bHasType = sal_True;
-
+        }
         pDef = pProc;
         pDef->SetType( bHasType ? eType : SbxEMPTY );
         if( pPar )
@@ -166,7 +181,9 @@ SbiExprNode* SbiExpression::Term( const KeywordSymbolInfo* pKeywordSymbolInfo )
         {
             pNd = ObjTerm( *pDef );
             if( pNd )
+            {
                 pNd->SetWithParent( pWithVar );
+            }
         }
         if( !pNd )
         {
@@ -220,7 +237,9 @@ SbiExprNode* SbiExpression::Term( const KeywordSymbolInfo* pKeywordSymbolInfo )
         while( eTok == LPAREN )
         {
             if( pvMoreParLcl == NULL )
+            {
                 pvMoreParLcl = new SbiExprListVector();
+            }
             SbiParameters* pAddPar = new SbiParameters( pParser );
             pvMoreParLcl->push_back( pAddPar );
             bError = bError || !pAddPar->IsValid();
@@ -236,7 +255,9 @@ SbiExprNode* SbiExpression::Term( const KeywordSymbolInfo* pKeywordSymbolInfo )
     {
         bBracket = false;   // Now the bracket for the first term is obsolete
         if( eType == SbxVARIANT )
+        {
             eType = SbxOBJECT;
+        }
         else
         {
             // Name%. really does not work!
@@ -257,18 +278,24 @@ SbiExprNode* SbiExpression::Term( const KeywordSymbolInfo* pKeywordSymbolInfo )
         SbModule& rMod = pParser->aGen.GetModule();
         SbxArray* pModMethods = rMod.GetMethods();
         if( pModMethods->Find( aSym, SbxCLASS_DONTCARE ) )
+        {
             pDef = NULL;
+        }
     }
     if( !pDef )
     {
         if( bObj )
+        {
             eType = SbxOBJECT;
+        }
         pDef = AddSym( eTok, *pParser->pPool, eCurExpr, aSym, eType, pPar );
         // Looks like this is a local ( but undefined variable )
         // if it is in a static procedure then make this Symbol
         // static
         if ( !bObj && pParser->pProc && pParser->pProc->IsStatic() )
+        {
             pDef->SetStatic();
+        }
     }
     else
     {
@@ -277,16 +304,22 @@ SbiExprNode* SbiExpression::Term( const KeywordSymbolInfo* pKeywordSymbolInfo )
         if( pConst )
         {
             if( pConst->GetType() == SbxSTRING )
+            {
                 return new SbiExprNode( pParser, pConst->GetString() );
+            }
             else
+            {
                 return new SbiExprNode( pParser, pConst->GetValue(), pConst->GetType() );
+            }
         }
 
         // 0 parameters come up to ()
         if( pDef->GetDims() )
         {
             if( pPar && pPar->GetSize() && pPar->GetSize() != pDef->GetDims() )
+            {
                 pParser->Error( SbERR_WRONG_DIMS );
+            }
         }
         if( pDef->IsDefinedAs() )
         {
@@ -347,7 +380,9 @@ SbiExprNode* SbiExpression::Term( const KeywordSymbolInfo* pKeywordSymbolInfo )
             }
         }
         if( !bError )
+        {
             pNd->aVar.pNext = ObjTerm( *pDef );
+        }
     }
 
     pParser->UnlockColumn();
@@ -393,19 +428,22 @@ SbiExprNode* SbiExpression::ObjTerm( SbiSymDef& rObj )
         while( eTok == LPAREN )
         {
             if( pvMoreParLcl == NULL )
+            {
                 pvMoreParLcl = new SbiExprListVector();
+            }
             SbiParameters* pAddPar = new SbiParameters( pParser );
             pvMoreParLcl->push_back( pAddPar );
             bError = bError || !pPar->IsValid();
             eTok = pParser->Peek();
         }
-
     }
     sal_Bool bObj = sal_Bool( ( eTok == DOT || eTok == EXCLAM ) && !pParser->WhiteSpace() );
     if( bObj )
     {
         if( eType == SbxVARIANT )
+        {
             eType = SbxOBJECT;
+        }
         else
         {
             // Name%. does really not work!
@@ -430,8 +468,9 @@ SbiExprNode* SbiExpression::ObjTerm( SbiSymDef& rObj )
     if( bObj )
     {
         if( pDef->GetType() == SbxVARIANT )
+        {
             pDef->SetType( SbxOBJECT );
-
+        }
         if( pDef->GetType() != SbxOBJECT )
         {
             pParser->Error( SbERR_BAD_DECLARATION, aSym );
@@ -462,67 +501,78 @@ SbiExprNode* SbiExpression::Operand( bool bUsedForTypeOf )
     // test operand:
     switch( eTok = pParser->Peek() )
     {
-        case SYMBOL:
-            pRes = Term();
-            // process something like "IF Not r Is Nothing Then .."
-            if( !bUsedForTypeOf && pParser->IsVBASupportOn() && pParser->Peek() == IS )
-            {
-                eTok = pParser->Next();
-                pRes = new SbiExprNode( pParser, pRes, eTok, Like() );
-            }
-            break;
-        case DOT:   // .with
-            pRes = Term(); break;
-        case NUMBER:
+    case SYMBOL:
+        pRes = Term();
+        // process something like "IF Not r Is Nothing Then .."
+        if( !bUsedForTypeOf && pParser->IsVBASupportOn() && pParser->Peek() == IS )
+        {
+            eTok = pParser->Next();
+            pRes = new SbiExprNode( pParser, pRes, eTok, Like() );
+        }
+        break;
+    case DOT:   // .with
+        pRes = Term(); break;
+    case NUMBER:
+        pParser->Next();
+        pRes = new SbiExprNode( pParser, pParser->GetDbl(), pParser->GetType() );
+        break;
+    case FIXSTRING:
+        pParser->Next();
+        pRes = new SbiExprNode( pParser, pParser->GetSym() ); break;
+    case LPAREN:
+        pParser->Next();
+        if( nParenLevel == 0 && m_eMode == EXPRMODE_LPAREN_PENDING && pParser->Peek() == RPAREN )
+        {
+            m_eMode = EXPRMODE_EMPTY_PAREN;
+            pRes = new SbiExprNode();   // Dummy node
             pParser->Next();
-            pRes = new SbiExprNode( pParser, pParser->GetDbl(), pParser->GetType() );
             break;
-        case FIXSTRING:
-            pParser->Next();
-            pRes = new SbiExprNode( pParser, pParser->GetSym() ); break;
-        case LPAREN:
-            pParser->Next();
-            if( nParenLevel == 0 && m_eMode == EXPRMODE_LPAREN_PENDING && pParser->Peek() == RPAREN )
+        }
+        nParenLevel++;
+        pRes = Boolean();
+        if( pParser->Peek() != RPAREN )
+        {
+            // If there was a LPARAM, it does not belong to the expression
+            if( nParenLevel == 1 && m_eMode == EXPRMODE_LPAREN_PENDING )
             {
-                m_eMode = EXPRMODE_EMPTY_PAREN;
-                pRes = new SbiExprNode();   // Dummy node
-                pParser->Next();
-                break;
+                m_eMode = EXPRMODE_LPAREN_NOT_NEEDED;
             }
-            nParenLevel++;
-            pRes = Boolean();
-            if( pParser->Peek() != RPAREN )
+            else
             {
-                // If there was a LPARAM, it does not belong to the expression
-                if( nParenLevel == 1 && m_eMode == EXPRMODE_LPAREN_PENDING )
-                    m_eMode = EXPRMODE_LPAREN_NOT_NEEDED;
-                else
-                    pParser->Error( SbERR_BAD_BRACKETS );
+                pParser->Error( SbERR_BAD_BRACKETS );
             }
-            else
+        }
+        else
+        {
+            pParser->Next();
+            if( nParenLevel == 1 && m_eMode == EXPRMODE_LPAREN_PENDING )
             {
-                pParser->Next();
-                if( nParenLevel == 1 && m_eMode == EXPRMODE_LPAREN_PENDING )
+                SbiToken eTokAfterRParen = pParser->Peek();
+                if( eTokAfterRParen == EQ || eTokAfterRParen == LPAREN || eTokAfterRParen == DOT )
                 {
-                    SbiToken eTokAfterRParen = pParser->Peek();
-                    if( eTokAfterRParen == EQ || eTokAfterRParen == LPAREN || eTokAfterRParen == DOT )
-                        m_eMode = EXPRMODE_ARRAY_OR_OBJECT;
-                    else
-                        m_eMode = EXPRMODE_STANDARD;
+                    m_eMode = EXPRMODE_ARRAY_OR_OBJECT;
+                }
+                else
+                {
+                    m_eMode = EXPRMODE_STANDARD;
                 }
             }
-            nParenLevel--;
-            break;
-        default:
-            // keywords here are OK at the moment!
-            if( pParser->IsKwd( eTok ) )
-                pRes = Term();
-            else
-            {
-                pParser->Next();
-                pRes = new SbiExprNode( pParser, 1.0, SbxDOUBLE );
-                pParser->Error( SbERR_UNEXPECTED, eTok );
-            }
+        }
+        nParenLevel--;
+        break;
+    default:
+        // keywords here are OK at the moment!
+        if( pParser->IsKwd( eTok ) )
+        {
+            pRes = Term();
+        }
+        else
+        {
+            pParser->Next();
+            pRes = new SbiExprNode( pParser, 1.0, SbxDOUBLE );
+            pParser->Error( SbERR_UNEXPECTED, eTok );
+        }
+        break;
     }
     return pRes;
 }
@@ -585,7 +635,8 @@ SbiExprNode* SbiExpression::Exp()
     SbiExprNode* pNd = Unary();
     if( m_eMode != EXPRMODE_EMPTY_PAREN )
     {
-        while( pParser->Peek() == EXPON ) {
+        while( pParser->Peek() == EXPON )
+        {
             SbiToken eTok = pParser->Next();
             pNd = new SbiExprNode( pParser, pNd, eTok, Unary() );
         }
@@ -602,7 +653,9 @@ SbiExprNode* SbiExpression::MulDiv()
         {
             SbiToken eTok = pParser->Peek();
             if( eTok != MUL && eTok != DIV )
+            {
                 break;
+            }
             eTok = pParser->Next();
             pNd = new SbiExprNode( pParser, pNd, eTok, Exp() );
         }
@@ -615,7 +668,8 @@ SbiExprNode* SbiExpression::IntDiv()
     SbiExprNode* pNd = MulDiv();
     if( m_eMode != EXPRMODE_EMPTY_PAREN )
     {
-        while( pParser->Peek() == IDIV ) {
+        while( pParser->Peek() == IDIV )
+        {
             SbiToken eTok = pParser->Next();
             pNd = new SbiExprNode( pParser, pNd, eTok, MulDiv() );
         }
@@ -628,7 +682,8 @@ SbiExprNode* SbiExpression::Mod()
     SbiExprNode* pNd = IntDiv();
     if( m_eMode != EXPRMODE_EMPTY_PAREN )
     {
-        while( pParser->Peek() == MOD ) {
+        while( pParser->Peek() == MOD )
+        {
             SbiToken eTok = pParser->Next();
             pNd = new SbiExprNode( pParser, pNd, eTok, IntDiv() );
         }
@@ -645,7 +700,9 @@ SbiExprNode* SbiExpression::AddSub()
         {
             SbiToken eTok = pParser->Peek();
             if( eTok != PLUS && eTok != MINUS )
+            {
                 break;
+            }
             eTok = pParser->Next();
             pNd = new SbiExprNode( pParser, pNd, eTok, Mod() );
         }
@@ -662,7 +719,9 @@ SbiExprNode* SbiExpression::Cat()
         {
             SbiToken eTok = pParser->Peek();
             if( eTok != CAT )
+            {
                 break;
+            }
             eTok = pParser->Next();
             pNd = new SbiExprNode( pParser, pNd, eTok, AddSub() );
         }
@@ -820,10 +879,13 @@ short SbiConstExpression::GetShortValue()
     {
         double n = nVal;
         if( n > 0 )
+        {
             n += .5;
+        }
         else
+        {
             n -= .5;
-
+        }
         if( n > SbxMAXINT )
         {
             n = SbxMAXINT;
@@ -872,7 +934,9 @@ SbiExpression* SbiExprList::Get( short n )
 {
     SbiExpression* p = pFirst;
     while( n-- && p )
+    {
         p = p->pNext;
+    }
     return p;
 }
 
@@ -886,8 +950,9 @@ void SbiExprList::addExpression( SbiExpression* pExpr )
 
     SbiExpression* p = pFirst;
     while( p->pNext )
+    {
         p = p->pNext;
-
+    }
     p->pNext = pExpr;
 }
 
@@ -911,8 +976,9 @@ SbiParameters::SbiParameters( SbiParser* p, bool bStandaloneExpression, bool bPa
     SbiExprList( p )
 {
     if( !bPar )
+    {
         return;
-
+    }
     SbiExpression *pExpr;
     SbiToken eTok = pParser->Peek();
 
@@ -985,16 +1051,20 @@ SbiParameters::SbiParameters( SbiParser* p, bool bStandaloneExpression, bool bPa
                     bBracket = true;
                     delete pExpr;
                     if( bByVal )
+                    {
                         pParser->Error( SbERR_LVALUE_EXPECTED );
+                    }
                     return;
                 }
             }
             else
+            {
                 pExpr = new SbiExpression( pParser );
-
+            }
             if( bByVal && pExpr->IsLvalue() )
+            {
                 pExpr->SetByVal();
-
+            }
             if( !bAssumeArrayMode )
             {
                 if( pParser->Peek() == ASSIGN )
@@ -1011,24 +1081,29 @@ SbiParameters::SbiParameters( SbiParser* p, bool bStandaloneExpression, bool bPa
         }
         pExpr->pNext = NULL;
         if( !pLast )
+        {
             pFirst = pLast = pExpr;
+        }
         else
+        {
             pLast->pNext = pExpr, pLast = pExpr;
+        }
         nExpr++;
         bError = bError || !pExpr->IsValid();
 
         if( bAssumeArrayMode )
+        {
             break;
-
+        }
         // next element?
         eTok = pParser->Peek();
         if( eTok != COMMA )
         {
             if( ( bBracket && eTok == RPAREN ) || pParser->IsEoln( eTok ) )
+            {
                 break;
-            pParser->Error( bBracket
-                            ? SbERR_BAD_BRACKETS
-                            : SbERR_EXPECTED, COMMA );
+            }
+            pParser->Error( bBracket ? SbERR_BAD_BRACKETS : SbERR_EXPECTED, COMMA );
             bError = true;
         }
         else
@@ -1036,7 +1111,9 @@ SbiParameters::SbiParameters( SbiParser* p, bool bStandaloneExpression, bool bPa
             pParser->Next();
             eTok = pParser->Peek();
             if( ( bBracket && eTok == RPAREN ) || pParser->IsEoln( eTok ) )
+            {
                 break;
+            }
         }
     }
     // closing bracket
@@ -1089,9 +1166,13 @@ SbiDimList::SbiDimList( SbiParser* p ) : SbiExprList( p )
                 bError = bError || !pExpr1->IsValid() || !pExpr2->IsValid();
                 pExpr1->pNext = pExpr2;
                 if( !pLast )
+                {
                     pFirst = pExpr1;
+                }
                 else
+                {
                     pLast->pNext = pExpr1;
+                }
                 pLast = pExpr2;
                 nExpr += 2;
             }
@@ -1102,9 +1183,13 @@ SbiDimList::SbiDimList( SbiParser* p ) : SbiExprList( p )
                 bConst = bConst && pExpr1->IsIntConstant();
                 bError = bError || !pExpr1->IsValid();
                 if( !pLast )
+                {
                     pFirst = pLast = pExpr1;
+                }
                 else
+                {
                     pLast->pNext = pExpr1, pLast = pExpr1;
+                }
                 nExpr++;
             }
             nDim++;
diff --git a/basic/source/comp/loops.cxx b/basic/source/comp/loops.cxx
index b2e7eb7..51953e0 100644
--- a/basic/source/comp/loops.cxx
+++ b/basic/source/comp/loops.cxx
@@ -460,11 +460,19 @@ void SbiParser::On()
     SbiToken eTok = Peek();
     String aString = SbiTokenizer::Symbol(eTok);
     if (aString.EqualsIgnoreCaseAscii("ERROR"))
+    {
         eTok = _ERROR_; // Error comes as SYMBOL
-    if( eTok != _ERROR_ && eTok != LOCAL ) OnGoto();
+    }
+    if( eTok != _ERROR_ && eTok != LOCAL )
+    {
+        OnGoto();
+    }
     else
     {
-        if( eTok == LOCAL ) Next();
+        if( eTok == LOCAL )
+        {
+            Next();
+        }
         Next (); // no more TestToken, as there'd be an error otherwise
 
         Next(); // get token after error
@@ -476,7 +484,9 @@ void SbiParser::On()
             if( MayBeLabel() )
             {
                 if( eCurTok == NUMBER && !nVal )
+                {
                     aGen.Gen( _STDERROR );
+                }
                 else
                 {
                     sal_uInt32 nOff = pProc->GetLabels().Reference( aSym );
@@ -487,12 +497,18 @@ void SbiParser::On()
             {
                 Next();
                 if( eCurTok == NUMBER && nVal == 1 )
+                {
                     aGen.Gen( _STDERROR );
+                }
                 else
+                {
                     bError_ = true;
+                }
             }
             if( bError_ )
+            {
                 Error( SbERR_LABEL_EXPECTED );
+            }
         }
         else if( eCurTok == RESUME )
         {
diff --git a/basic/source/comp/parser.cxx b/basic/source/comp/parser.cxx
index c1f1752..587b478 100644
--- a/basic/source/comp/parser.cxx
+++ b/basic/source/comp/parser.cxx
@@ -628,11 +628,15 @@ void SbiParser::LSet()
 {
     SbiExpression aLvalue( this, SbLVALUE );
     if( aLvalue.GetType() != SbxSTRING )
+    {
         Error( SbERR_INVALID_OBJECT );
+    }
     TestToken( EQ );
     SbiSymDef* pDef = aLvalue.GetRealVar();
     if( pDef && pDef->GetConstDef() )
+    {
         Error( SbERR_DUPLICATE_DEF, pDef->GetName() );
+    }
     SbiExpression aExpr( this );
     aLvalue.Gen();
     aExpr.Gen();
@@ -644,7 +648,9 @@ void SbiParser::RSet()
 {
     SbiExpression aLvalue( this, SbLVALUE );
     if( aLvalue.GetType() != SbxSTRING )
+    {
         Error( SbERR_INVALID_OBJECT );
+    }
     TestToken( EQ );
     SbiSymDef* pDef = aLvalue.GetRealVar();
     if( pDef && pDef->GetConstDef() )
@@ -772,11 +778,17 @@ void SbiParser::Option()
         {
             SbiToken eTok = Next();
             if( eTok == BINARY )
+            {
                 bText = false;
+            }
             else if( eTok == SYMBOL && GetSym().equalsIgnoreAsciiCaseAsciiL(RTL_CONSTASCII_STRINGPARAM("text")) )
+            {
                 bText = true;
+            }
             else
+            {
                 Error( SbERR_EXPECTED, "Text/Binary" );
+            }
             break;
         }
         case COMPATIBLE:
@@ -794,11 +806,15 @@ void SbiParser::Option()
                 {
                     bVBASupportOn = ( nVal == 1 );
                     if ( bVBASupportOn )
+                    {
                         EnableCompatibility();
+                    }
                     // if the module setting is different
                     // reset it to what the Option tells us
                     if ( bVBASupportOn != aGen.GetModule().IsVBACompat() )
+                    {
                         aGen.GetModule().SetVBACompat( bVBASupportOn );
+                    }
                     break;
                 }
             }
diff --git a/basic/source/comp/sbcomp.cxx b/basic/source/comp/sbcomp.cxx
index b3ee0a1..a9288d3 100644
--- a/basic/source/comp/sbcomp.cxx
+++ b/basic/source/comp/sbcomp.cxx
@@ -284,8 +284,9 @@ String lcl_dumpMethodParameters( SbMethod* pMethod )
 {
     String aStr;
     if( pMethod == NULL )
+    {
         return aStr;
-
+    }
     SbxError eOld = SbxBase::GetError();
 
     SbxArray* pParams = pMethod->GetParameters();
@@ -299,12 +300,16 @@ String lcl_dumpMethodParameters( SbMethod* pMethod )
             SbxVariable* pVar = pParams->Get( nParam );
             DBG_ASSERT( pVar, "Parameter?!" );
             if ( pVar->GetName().Len() )
+            {
                 aStr += pVar->GetName();
+            }
             else if ( pInfo )
             {
                 const SbxParamInfo* pParam = pInfo->GetParam( nParam );
                 if ( pParam )
+                {
                     aStr += pParam->aName;
+                }
             }
             aStr += '=';
             SbxDataType eType = pVar->GetType();
@@ -320,8 +325,9 @@ String lcl_dumpMethodParameters( SbMethod* pMethod )
 
     SbxBase::ResetError();
     if( eOld != SbxERR_OK )
+    {
         SbxBase::SetError( eOld );
-
+    }
     return aStr;
 }
 
@@ -386,7 +392,9 @@ void lcl_printTimeOutput( void )
         {
             FunctionItem* pFunctionItem = it->second;
             if( pFunctionItem != NULL )
+            {
                 avFunctionItems.push_back( pFunctionItem );
+            }
         }
 

... etc. - the rest is truncated


More information about the Libreoffice-commits mailing list