[Libreoffice-commits] .: 6 commits - comphelper/inc comphelper/qa sdext/source sfx2/inc svtools/source sw/source tools/source unotools/inc unotools/source unusedcode.easy

Caolán McNamara caolan at kemper.freedesktop.org
Tue Nov 22 04:50:55 PST 2011


 comphelper/inc/comphelper/string.hxx           |   27 +++++++++++++
 comphelper/qa/string/test_string.cxx           |   19 +++++++++
 sdext/source/minimizer/configurationaccess.cxx |   26 ++++++-------
 sfx2/inc/sfx2/tabdlg.hxx                       |    2 -
 svtools/source/filter/ixbm/xbmread.cxx         |    8 ++--
 svtools/source/filter/sgvtext.cxx              |    6 ++-
 svtools/source/filter/wmf/wmfwr.cxx            |    4 +-
 svtools/source/svhtml/parhtml.cxx              |   28 +++++++-------
 sw/source/ui/app/docsh.cxx                     |    2 -
 sw/source/ui/app/docsh2.cxx                    |    8 ++--
 sw/source/ui/app/docst.cxx                     |    2 -
 sw/source/ui/dbui/mailmergechildwindow.cxx     |    5 +-
 sw/source/ui/dochdl/swdtflvr.cxx               |   18 +++++----
 sw/source/ui/envelp/labelexp.cxx               |    6 +--
 sw/source/ui/envelp/mailmrge.cxx               |    4 +-
 sw/source/ui/fldui/xfldui.cxx                  |   10 +++--
 sw/source/ui/index/cntex.cxx                   |    4 +-
 sw/source/ui/lingu/olmenu.cxx                  |    4 +-
 sw/source/ui/misc/glossary.cxx                 |    5 +-
 sw/source/ui/misc/glshell.cxx                  |    5 +-
 sw/source/ui/shells/annotsh.cxx                |    4 +-
 sw/source/ui/shells/drawsh.cxx                 |    2 -
 sw/source/ui/shells/drwtxtex.cxx               |    2 -
 sw/source/ui/shells/drwtxtsh.cxx               |    2 -
 sw/source/ui/shells/frmsh.cxx                  |    2 -
 sw/source/ui/shells/textsh.cxx                 |    4 +-
 sw/source/ui/shells/textsh1.cxx                |    2 -
 sw/source/ui/table/chartins.cxx                |    2 -
 sw/source/ui/uiview/swcli.cxx                  |    4 +-
 sw/source/ui/uiview/view2.cxx                  |    4 +-
 sw/source/ui/uiview/viewling.cxx               |    6 +--
 sw/source/ui/uno/dlelstnr.cxx                  |    2 -
 sw/source/ui/uno/swdetect.cxx                  |   10 +++--
 sw/source/ui/uno/unomailmerge.cxx              |   18 ++++-----
 sw/source/ui/utlui/swrenamexnameddlg.cxx       |    2 -
 sw/source/ui/utlui/unotools.cxx                |    2 -
 sw/source/ui/vba/vbadocumentproperties.cxx     |    2 -
 sw/source/ui/vba/vbaheaderfooterhelper.cxx     |    4 +-
 sw/source/ui/vba/vbarange.cxx                  |    2 -
 sw/source/ui/vba/vbarangehelper.cxx            |    8 ++--
 sw/source/ui/vba/wordvbahelper.cxx             |    2 -
 sw/source/ui/wrtsh/wrtsh1.cxx                  |   13 +++---
 tools/source/fsys/dirent.cxx                   |   50 ++++++++++++-------------
 unotools/inc/unotools/atom.hxx                 |    8 ----
 unotools/source/misc/atom.cxx                  |   30 ---------------
 unusedcode.easy                                |    3 -
 46 files changed, 199 insertions(+), 184 deletions(-)

New commits:
commit 4a06a42de49215167221177d47cd2eb0e2d59232
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Tue Nov 22 12:29:25 2011 +0000

    want to match here, not check for equality

diff --git a/comphelper/inc/comphelper/string.hxx b/comphelper/inc/comphelper/string.hxx
index 31414e5..00a1664 100644
--- a/comphelper/inc/comphelper/string.hxx
+++ b/comphelper/inc/comphelper/string.hxx
@@ -272,6 +272,33 @@ COMPHELPER_DLLPUBLIC inline sal_Bool matchL(const rtl::OString& rStr, const char
 }
 
 /**
+  Match against a substring appearing in this string, ignoring the case of
+  ASCII letters.
+
+  The result is true if and only if the second string appears as a substring
+  of this string, at the given position.
+  Character values between 65 and 90 (ASCII A-Z) are interpreted as
+  values between 97 and 122 (ASCII a-z).
+  This function can't be used for language specific comparison.
+
+  @param    rStr        The string that pMatch will be compared to.
+  @param    pMatch      The substring rStr is to be compared against
+  @param    nMatchLen   The length of pMatch
+  @param    fromIndex   the index to start the comparion from.
+                        The index must be greater or equal than 0
+                        and less or equal as the string length.
+  @return   sal_True if str match with the characters in the string
+            at the given position;
+            sal_False, otherwise.
+*/
+COMPHELPER_DLLPUBLIC inline sal_Bool matchIgnoreAsciiCaseL(const rtl::OString& rStr, const char *pMatch, sal_Int32 nMatchLen, sal_Int32 fromIndex = 0) SAL_THROW(())
+{
+    return rtl_str_shortenedCompareIgnoreAsciiCase_WithLength( rStr.pData->buffer+fromIndex, rStr.pData->length-fromIndex,
+                                                               pMatch, nMatchLen,
+                                                               nMatchLen ) == 0;
+}
+
+/**
   Returns the index within this string of the first occurrence of the
   specified substring, starting at the specified index.
 
diff --git a/comphelper/qa/string/test_string.cxx b/comphelper/qa/string/test_string.cxx
index 1106381..2ce6f2c 100644
--- a/comphelper/qa/string/test_string.cxx
+++ b/comphelper/qa/string/test_string.cxx
@@ -55,6 +55,7 @@ public:
     void testIsalnumAsciiString();
     void testIsupperAsciiString();
     void testIndexOfL();
+    void testMatchIgnoreAsciiCaseL();
 
     CPPUNIT_TEST_SUITE(TestString);
     CPPUNIT_TEST(testSearchAndReplaceAsciiL);
@@ -67,6 +68,7 @@ public:
     CPPUNIT_TEST(testIsalnumAsciiString);
     CPPUNIT_TEST(testIsupperAsciiString);
     CPPUNIT_TEST(testIndexOfL);
+    CPPUNIT_TEST(testMatchIgnoreAsciiCaseL);
     CPPUNIT_TEST_SUITE_END();
 };
 
@@ -168,6 +170,23 @@ void TestString::testIndexOfL()
         RTL_CONSTASCII_STRINGPARAM("two"), 5), static_cast<sal_Int32>(-1));
 }
 
+void TestString::testMatchIgnoreAsciiCaseL()
+{
+    rtl::OString s1(RTL_CONSTASCII_STRINGPARAM("one two three"));
+
+    CPPUNIT_ASSERT_EQUAL(comphelper::string::matchIgnoreAsciiCaseL(s1,
+        RTL_CONSTASCII_STRINGPARAM("one")), sal_True);
+
+    CPPUNIT_ASSERT_EQUAL(comphelper::string::matchIgnoreAsciiCaseL(s1,
+        RTL_CONSTASCII_STRINGPARAM("ONE")), sal_True);
+
+    CPPUNIT_ASSERT_EQUAL(comphelper::string::matchIgnoreAsciiCaseL(s1,
+        RTL_CONSTASCII_STRINGPARAM("two")), sal_False);
+
+    CPPUNIT_ASSERT_EQUAL(comphelper::string::matchIgnoreAsciiCaseL(s1,
+        RTL_CONSTASCII_STRINGPARAM("two"), 4), sal_True);
+}
+
 using namespace ::com::sun::star;
 
 class testCollator : public cppu::WeakImplHelper1< i18n::XCollator >
diff --git a/tools/source/fsys/dirent.cxx b/tools/source/fsys/dirent.cxx
index 647dcfc..2862603 100644
--- a/tools/source/fsys/dirent.cxx
+++ b/tools/source/fsys/dirent.cxx
@@ -673,7 +673,7 @@ DirEntry::DirEntry( const String& rInitName, FSysPathStyle eStyle )
     }
 
     rtl::OString aTmpName(rtl::OUStringToOString(rInitName, osl_getThreadTextEncoding()));
-    if (aTmpName.equalsIgnoreAsciiCaseL(RTL_CONSTASCII_STRINGPARAM("file:")))
+    if (comphelper::string::matchIgnoreAsciiCaseL(aTmpName, RTL_CONSTASCII_STRINGPARAM("file:")))
     {
 #ifndef BOOTSTRAP
         DBG_WARNING( "File URLs are not permitted but accepted" );
@@ -692,7 +692,7 @@ DirEntry::DirEntry( const String& rInitName, FSysPathStyle eStyle )
         }
 
 #ifdef DBG_UTIL
-        if (eStyle == FSYS_STYLE_HOST && aTmpName.indexOf( "://" ) != STRING_NOTFOUND)
+        if (eStyle == FSYS_STYLE_HOST && aTmpName.indexOf( "://" ) != -1)
         {
             rtl::OStringBuffer aErr(RTL_CONSTASCII_STRINGPARAM("DirEntries akzeptieren nur File URLS: "));
             aErr.append(aTmpName);
@@ -727,7 +727,7 @@ DirEntry::DirEntry( const rtl::OString& rInitName, FSysPathStyle eStyle )
     }
 
     rtl::OString aTmpName( rInitName );
-    if (rInitName.equalsIgnoreAsciiCaseL(RTL_CONSTASCII_STRINGPARAM("file:")))
+    if (comphelper::string::matchIgnoreAsciiCaseL(aTmpName, RTL_CONSTASCII_STRINGPARAM("file:")))
     {
 #ifndef BOOTSTRAP
         DBG_WARNING( "File URLs are not permitted but accepted" );
@@ -1760,27 +1760,27 @@ FSysError DirEntry::ImpParseUnixName( const rtl::OString& rPfad, FSysPathStyle e
                 /* do nothing */;
 
 #ifdef UNX
-                        // stellt der Name das User-Dir dar?
-                        else if ( aName == "~" )
-                        {
-                                DirEntry aHome( String( (const char *) getenv( "HOME" ), osl_getThreadTextEncoding()) );
-                                for ( sal_uInt16 n = aHome.Level(); n; --n )
-                                        aStack.Push( new DirEntry( aHome[ (sal_uInt16) n-1 ] ) );
-                        }
+            // stellt der Name das User-Dir dar?
+            else if ( aName == "~" )
+            {
+                DirEntry aHome( String( (const char *) getenv( "HOME" ), osl_getThreadTextEncoding()) );
+                for ( sal_uInt16 n = aHome.Level(); n; --n )
+                    aStack.Push( new DirEntry( aHome[ (sal_uInt16) n-1 ] ) );
+            }
 #endif
-
-                // stellt der Name die Parent-Directory dar?
+            // stellt der Name die Parent-Directory dar?
             else if ( aName == ".." )
             {
                 // ist nichts, ein Parent oder eine relative Root
                 // auf dem Stack?
-                if ( ( aStack.Empty() ) ||
-                     ( aStack.Top()->eFlag == FSYS_FLAG_PARENT ) )
+                if ( ( aStack.Empty() ) || ( aStack.Top()->eFlag == FSYS_FLAG_PARENT ) )
+                {
                     // fuehrende Parents kommen auf den Stack
                     aStack.Push( new DirEntry(rtl::OString(), FSYS_FLAG_PARENT, eStyle) );
-
+                }
                 // ist es eine absolute Root
-                else if ( aStack.Top()->eFlag == FSYS_FLAG_ABSROOT ) {
+                else if ( aStack.Top()->eFlag == FSYS_FLAG_ABSROOT )
+                {
                     // die hat keine Parent-Directory
                     return FSYS_ERR_NOTEXISTS;
                 }
@@ -1792,16 +1792,16 @@ FSysError DirEntry::ImpParseUnixName( const rtl::OString& rPfad, FSysPathStyle e
             {
                 DirEntry *pNew = NULL;
                 // normalen Entries kommen auf den Stack
-                                pNew = new DirEntry( aName, FSYS_FLAG_NORMAL, eStyle );
-                                if ( !pNew->IsValid() )
-                                {
-                                        aName = rPfad;
-                                        ErrCode eErr = pNew->GetError();
-                                        delete pNew;
-                                        return eErr;
-                                }
+                pNew = new DirEntry( aName, FSYS_FLAG_NORMAL, eStyle );
+                if ( !pNew->IsValid() )
+                {
+                    aName = rPfad;
+                    ErrCode eErr = pNew->GetError();
+                    delete pNew;
+                    return eErr;
+                }
                 aStack.Push( pNew );
-                        }
+            }
         }
 
         // den Restpfad bestimmen
commit 5317e0501fe356fb38c7de408cdde1d3f3e1242e
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Tue Nov 22 11:33:42 2011 +0000

    WaE: unused variable, and catch by const

diff --git a/sdext/source/minimizer/configurationaccess.cxx b/sdext/source/minimizer/configurationaccess.cxx
index 449dfe7..fde554d 100644
--- a/sdext/source/minimizer/configurationaccess.cxx
+++ b/sdext/source/minimizer/configurationaccess.cxx
@@ -89,7 +89,7 @@ void OptimizerSettings::LoadSettingsFromConfiguration( const Reference< XNameAcc
                     default: break;
                 }
             }
-            catch( Exception& )
+            catch (const Exception&)
             {
             }
         }
@@ -142,7 +142,7 @@ void OptimizerSettings::SaveSettingsToConfiguration( const Reference< XNameRepla
             {
                 rSettings->replaceByName( pNames[ i ], pValues[ i ] );
             }
-            catch( Exception& /* rException */ )
+            catch (const Exception&)
             {
             }
         }
@@ -200,7 +200,7 @@ rtl::OUString ConfigurationAccess::getPath( const PPPOptimizerTokenEnum eToken )
             }
         }
     }
-    catch ( Exception& )
+    catch (const Exception&)
     {
     }
     return aPath;
@@ -233,7 +233,7 @@ void ConfigurationAccess::LoadStrings()
                         if ( xSet->getByName( aPropertyName ) >>= aString )
                             maStrings[ TKGet( aPropertyName ) ] = aString;
                     }
-                    catch( Exception& )
+                    catch (const Exception&)
                     {
                     }
                 }
@@ -241,7 +241,7 @@ void ConfigurationAccess::LoadStrings()
         }
         while( false );
     }
-    catch( Exception& )
+    catch (const Exception&)
     {
     }
 }
@@ -277,7 +277,7 @@ void ConfigurationAccess::LoadConfiguration()
                             maSettings.back().LoadSettingsFromConfiguration( xTemplates );
                         }
                     }
-                    catch( Exception& /* rException */ )
+                    catch (const Exception&)
                     {
                     }
                 }
@@ -285,7 +285,7 @@ void ConfigurationAccess::LoadConfiguration()
         }
         while( false );
     }
-    catch( Exception& )
+    catch (const Exception&)
     {
     }
 }
@@ -329,9 +329,8 @@ void ConfigurationAccess::SaveConfiguration()
         }
         while( false );
     }
-    catch( Exception& /* rException */ )
+    catch (const Exception&)
     {
-
     }
 }
 
@@ -363,7 +362,7 @@ Reference< XInterface > ConfigurationAccess::OpenConfiguration( bool bReadOnly )
                 sAccessService, aCreationArguments );
         }
     }
-    catch ( Exception& /* rException */ )
+    catch (const Exception&)
     {
     }
     return xRoot;
@@ -387,13 +386,14 @@ Reference< XInterface > ConfigurationAccess::GetConfigurationNode(
             }
         }
     }
-    catch ( Exception& rException )
+    catch (const Exception& rException)
     {
         OSL_TRACE ("caught exception while getting configuration node %s: %s",
             ::rtl::OUStringToOString(sPathToNode,
                 RTL_TEXTENCODING_UTF8).getStr(),
             ::rtl::OUStringToOString(rException.Message,
                 RTL_TEXTENCODING_UTF8).getStr());
+        (void)rException;
     }
     return xNode;
 }
@@ -426,7 +426,7 @@ com::sun::star::uno::Any ConfigurationAccess::GetConfigProperty( const PPPOptimi
                 break;
         }
     }
-    catch( Exception& /* rException */ )
+    catch (const Exception&)
     {
     }
     return aRetValue;
@@ -460,7 +460,7 @@ void ConfigurationAccess::SetConfigProperty( const PPPOptimizerTokenEnum eProper
                 break;
         }
     }
-    catch( Exception& /* rException */ )
+    catch (const Exception&)
     {
     }
 }
commit ed7c80d3353bd21d9c278a209adb4e62669b3978
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Tue Nov 22 09:06:06 2011 +0000

    these can be const

diff --git a/sw/source/ui/app/docsh.cxx b/sw/source/ui/app/docsh.cxx
index d7ee019..d371946 100644
--- a/sw/source/ui/app/docsh.cxx
+++ b/sw/source/ui/app/docsh.cxx
@@ -669,7 +669,7 @@ sal_Bool SwDocShell::ConvertTo( SfxMedium& rMedium )
                 if ( xSet.is() )
                     xSet->setPropertyValue( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("MediaType")), uno::makeAny( ::rtl::OUString( SotExchange::GetFormatMimeType( nSaveClipId ) ) ) );
             }
-            catch ( uno::Exception& )
+            catch (const uno::Exception&)
             {
             }
         }
diff --git a/sw/source/ui/app/docsh2.cxx b/sw/source/ui/app/docsh2.cxx
index a0481d1..71827e6 100755
--- a/sw/source/ui/app/docsh2.cxx
+++ b/sw/source/ui/app/docsh2.cxx
@@ -835,7 +835,7 @@ void SwDocShell::Execute(SfxRequest& rReq)
                         {
                             xFltMgr->setCurrentFilter( pOwnFlt->GetUIName() );
                         }
-                        catch( const uno::Exception& )
+                        catch (const uno::Exception&)
                         {
                             bError = true;
                         }
@@ -1250,7 +1250,7 @@ void SwDocShell::Execute(SfxRequest& rReq)
                         {
                             xFltMgr->setCurrentFilter( pFlt->GetUIName() ) ;
                         }
-                        catch( const uno::Exception& )
+                        catch (const uno::Exception&)
                         {
                             bError = true;
                         }
@@ -1310,7 +1310,7 @@ void SwDocShell::Execute(SfxRequest& rReq)
                             xCtrlAcc->setLabel( ExtendedFilePickerElementIds::LISTBOX_TEMPLATE,
                                                     String(SW_RES( STR_FDLG_TEMPLATE_NAME )));
                         }
-                        catch(Exception& )
+                        catch (const Exception&)
                         {
                             OSL_FAIL("control acces failed");
                         }
@@ -1730,7 +1730,7 @@ sal_uLong SwDocShell::LoadStylesFromFile( const String& rURL,
                     xProps->getPropertyValue( aMediaTypePropName );
                     bImport = true;
                 }
-                catch( const uno::Exception& )
+                catch (const uno::Exception&)
                 {
                     bImport = false;
                 }
diff --git a/sw/source/ui/app/docst.cxx b/sw/source/ui/app/docst.cxx
index 8455a40..0ac3b7e 100644
--- a/sw/source/ui/app/docst.cxx
+++ b/sw/source/ui/app/docst.cxx
@@ -326,7 +326,7 @@ void SwDocShell::ExecStyleSheet( SfxRequest& rReq )
                         if ( aUIName.getLength() )
                             rReq.AppendItem( SfxStringItem( SID_STYLE_APPLY, aUIName ) );
                     }
-                    catch( uno::Exception& )
+                    catch (const uno::Exception&)
                     {
                     }
                 }
diff --git a/sw/source/ui/dbui/mailmergechildwindow.cxx b/sw/source/ui/dbui/mailmergechildwindow.cxx
index 089ccbf..436ceff 100644
--- a/sw/source/ui/dbui/mailmergechildwindow.cxx
+++ b/sw/source/ui/dbui/mailmergechildwindow.cxx
@@ -247,9 +247,8 @@ void SwMailDispatcherListener_Impl::DeleteAttachments( uno::Reference< mail::XMa
                     SWUnoHelper::UCB_DeleteFile( sURL );
             }
         }
-        catch( const uno::Exception& rEx )
+        catch (const uno::Exception&)
         {
-            (void)rEx;
         }
     }
 }
@@ -396,7 +395,7 @@ SwSendMailDialog::~SwSendMailDialog()
                 xMessage = m_pImpl->xMailDispatcher->dequeueMailMessage();
             }
         }
-        catch(const uno::Exception&)
+        catch (const uno::Exception&)
         {
         }
     }
diff --git a/sw/source/ui/dochdl/swdtflvr.cxx b/sw/source/ui/dochdl/swdtflvr.cxx
index 4222949..1212d9c 100755
--- a/sw/source/ui/dochdl/swdtflvr.cxx
+++ b/sw/source/ui/dochdl/swdtflvr.cxx
@@ -674,8 +674,9 @@ sal_Bool SwTransferable::WriteObject( SotStorageStreamRef& xStream,
                 xWorkStore = uno::Reference < embed::XStorage >();
                 xStream->Commit();
             }
-            catch ( uno::Exception& )
-            {}
+            catch (const uno::Exception&)
+            {
+            }
 
             bRet = ( xStream->GetError() == ERRCODE_NONE );
         }
@@ -1698,14 +1699,14 @@ int SwTransferable::_PasteOLE( TransferableDataHelper& rData, SwWrtShell& rSh,
                         xComp->dispose();
                         xStore = 0;
                     }
-                    catch ( uno::Exception& )
+                    catch (const uno::Exception&)
                     {
                     }
 
                     break;
             }
         }
-        catch ( uno::Exception& )
+        catch (const uno::Exception&)
         {
             // it wasn't a storage, but maybe it's a useful stream
         }
@@ -1764,8 +1765,9 @@ int SwTransferable::_PasteOLE( TransferableDataHelper& rData, SwWrtShell& rSh,
                         // for example whether the object should be an iconified one
                         xObj = aInfo.Object;
                     }
-                    catch( uno::Exception& )
-                    {}
+                    catch (const uno::Exception&)
+                    {
+                    }
                 }
             }
         }
@@ -1823,7 +1825,7 @@ int SwTransferable::_PasteOLE( TransferableDataHelper& rData, SwWrtShell& rSh,
                 {
                     aSz = xObj->getVisualAreaSize( aObjDesc.mnViewAspect );
                 }
-                catch( embed::NoVisualAreaSizeException& )
+                catch (const embed::NoVisualAreaSizeException&)
                 {
                     // in this case the provided size is used
                 }
@@ -1844,7 +1846,7 @@ int SwTransferable::_PasteOLE( TransferableDataHelper& rData, SwWrtShell& rSh,
                 {
                     xObj->getVisualAreaSize( aObjDesc.mnViewAspect );
                 }
-                catch( uno::Exception& )
+                catch (const uno::Exception&)
                 {
                 }
             }
diff --git a/sw/source/ui/envelp/labelexp.cxx b/sw/source/ui/envelp/labelexp.cxx
index 5e8bef1..8124668 100644
--- a/sw/source/ui/envelp/labelexp.cxx
+++ b/sw/source/ui/envelp/labelexp.cxx
@@ -94,7 +94,7 @@ void SwVisitingCardPage::InitFrameControl()
                 aAutoTextGroupLB.SetEntryData(nEntry, new String(sGroup));
             }
         }
-        catch(Exception&)
+        catch (const Exception&)
         {
         }
     }
@@ -117,7 +117,7 @@ void SwVisitingCardPage::InitFrameControl()
                 SetUserData( aBlockNames.getLength(), aTitles.getConstArray(),
                             aBlockNames.getConstArray() );
             }
-            catch( uno::RuntimeException& )
+            catch (const uno::RuntimeException&)
             {
                 // we'll be her if path settings were wrong
             }
@@ -258,7 +258,7 @@ void SwLabDlg::UpdateFieldInformation(uno::Reference< frame::XModel > & xModel,
             }
         }
     }
-    catch( uno::RuntimeException&)
+    catch (const uno::RuntimeException&)
     {
         //
     }
diff --git a/sw/source/ui/envelp/mailmrge.cxx b/sw/source/ui/envelp/mailmrge.cxx
index 90ee807..6b774ce 100644
--- a/sw/source/ui/envelp/mailmrge.cxx
+++ b/sw/source/ui/envelp/mailmrge.cxx
@@ -292,7 +292,7 @@ SwMailMergeDlg::SwMailMergeDlg(Window* pParent, SwWrtShell& rShell,
                 xFrame->initialize( VCLUnoHelper::GetInterface ( pBeamerWin ) );
             }
         }
-        catch (Exception&)
+        catch (const Exception&)
         {
             xFrame.clear();
         }
@@ -464,7 +464,7 @@ SwMailMergeDlg::SwMailMergeDlg(Window* pParent, SwWrtShell& rShell,
         }
         aFilterLB.SelectEntryPos( nODT );
     }
-    catch( const uno::Exception& )
+    catch (const uno::Exception&)
     {
     }
 }
diff --git a/sw/source/ui/fldui/xfldui.cxx b/sw/source/ui/fldui/xfldui.cxx
index 14b193e..c35dfe6 100644
--- a/sw/source/ui/fldui/xfldui.cxx
+++ b/sw/source/ui/fldui/xfldui.cxx
@@ -97,7 +97,9 @@ sal_Bool SwFldMgr::IsDBNumeric( const String& rDBName, const String& rTblQryName
                 aTable >>= xPropSet;
                 xColsSupplier = Reference<XColumnsSupplier>(xPropSet, UNO_QUERY);
             }
-            catch(Exception&){}
+            catch (const Exception&)
+            {
+            }
         }
     }
     else
@@ -114,7 +116,9 @@ sal_Bool SwFldMgr::IsDBNumeric( const String& rDBName, const String& rTblQryName
                 aQuery >>= xPropSet;
                 xColsSupplier = Reference<XColumnsSupplier>(xPropSet, UNO_QUERY);
             }
-            catch(Exception&){}
+            catch (const Exception&)
+            {
+            }
         }
     }
 
@@ -125,7 +129,7 @@ sal_Bool SwFldMgr::IsDBNumeric( const String& rDBName, const String& rTblQryName
         {
             xCols = xColsSupplier->getColumns();
         }
-        catch(Exception& )
+        catch (const Exception&)
         {
             OSL_FAIL("Exception in getColumns()");
         }
diff --git a/sw/source/ui/index/cntex.cxx b/sw/source/ui/index/cntex.cxx
index b5c595b..760316c 100644
--- a/sw/source/ui/index/cntex.cxx
+++ b/sw/source/ui/index/cntex.cxx
@@ -176,7 +176,7 @@ IMPL_LINK( SwMultiTOXTabDialog, CreateExample_Hdl, void*, EMPTYARG )
         }
         CreateOrUpdateExample(eCurrentTOXType.eType);
     }
-    catch(Exception&)
+    catch (const Exception&)
     {
         OSL_FAIL("::CreateExample() - exception caught");
     }
@@ -470,7 +470,7 @@ void SwMultiTOXTabDialog::CreateOrUpdateExample(
         pxIndexSectionsArr[nTOXIndex]->xDocumentIndex->update();
 
     }
-    catch(Exception&)
+    catch (const Exception&)
     {
         OSL_FAIL("::CreateExample() - exception caught");
     }
diff --git a/sw/source/ui/lingu/olmenu.cxx b/sw/source/ui/lingu/olmenu.cxx
index 7133237..6d8599e 100644
--- a/sw/source/ui/lingu/olmenu.cxx
+++ b/sw/source/ui/lingu/olmenu.cxx
@@ -373,7 +373,7 @@ OUString RetrieveLabelFromCommand( const OUString& aCmdURL )
                 aLabel = aStr;
             }
         }
-        catch ( uno::Exception& )
+        catch (const uno::Exception&)
         {
         }
     }
@@ -853,7 +853,7 @@ void SwSpellPopup::Execute( sal_uInt16 nId )
             xSystemShellExecute->execute( sExplanationLink, rtl::OUString(),
                     com::sun::star::system::SystemShellExecuteFlags::DEFAULTS );
         }
-        catch ( uno::Exception& )
+        catch (const uno::Exception&)
         {
             uno::Any exc( ::cppu::getCaughtException() );
             rtl::OUString msg( ::comphelper::anyToString( exc ) );
diff --git a/sw/source/ui/misc/glossary.cxx b/sw/source/ui/misc/glossary.cxx
index 683c3bb..5e33c25 100644
--- a/sw/source/ui/misc/glossary.cxx
+++ b/sw/source/ui/misc/glossary.cxx
@@ -687,8 +687,9 @@ IMPL_LINK( SwGlossaryDlg, BibHdl, Button *, EMPTYARG )
                     bIsWritable = !*(sal_Bool*)aAny.getValue();
                 }
             }
-            catch(Exception&)
-            {}
+            catch (const Exception&)
+            {
+            }
             if(bIsWritable)
                 break;
         }
diff --git a/sw/source/ui/misc/glshell.cxx b/sw/source/ui/misc/glshell.cxx
index 7323737..2dad9aa 100644
--- a/sw/source/ui/misc/glshell.cxx
+++ b/sw/source/ui/misc/glshell.cxx
@@ -272,8 +272,9 @@ SwDocShellRef SwGlossaries::EditGroupDoc( const String& rGroup, const String& rS
             uno::Reference< frame::XTitle > xTitle( xDocSh->GetModel(), uno::UNO_QUERY_THROW );
             xTitle->setTitle( aDocTitle );
         }
-        catch( uno::Exception& )
-        {}
+        catch (const uno::Exception&)
+        {
+        }
 
         xDocSh->GetDoc()->GetIDocumentUndoRedo().DoUndo( bDoesUndo );
         xDocSh->GetDoc()->ResetModified();
diff --git a/sw/source/ui/shells/annotsh.cxx b/sw/source/ui/shells/annotsh.cxx
index 6aada30..5853742 100644
--- a/sw/source/ui/shells/annotsh.cxx
+++ b/sw/source/ui/shells/annotsh.cxx
@@ -404,7 +404,7 @@ void SwAnnotationShell::Exec( SfxRequest &rReq )
                     xDialog->execute();
                 }
             }
-            catch( uno::Exception& )
+            catch (const uno::Exception&)
             {
             }
             rReq.Ignore ();
@@ -1178,7 +1178,7 @@ void SwAnnotationShell::ExecLingu(SfxRequest &rReq)
                                         xProp->getPropertyValue( C2U("IsUseCharacterVariants") ) >>= bUseVariants;
                                         xProp->getPropertyValue( C2U("IsTranslateCommonTerms") ) >>= bCommonTerms;
                                     }
-                                    catch( Exception& )
+                                    catch (const Exception&)
                                     {
                                     }
                                 }
diff --git a/sw/source/ui/shells/drawsh.cxx b/sw/source/ui/shells/drawsh.cxx
index 56e0a42..99c9ab2 100644
--- a/sw/source/ui/shells/drawsh.cxx
+++ b/sw/source/ui/shells/drawsh.cxx
@@ -225,7 +225,7 @@ void SwDrawShell::Execute(SfxRequest &rReq)
                     xDialog->execute();
                 }
             }
-            catch( uno::Exception& )
+            catch (const uno::Exception&)
             {
             }
             rReq.Ignore ();
diff --git a/sw/source/ui/shells/drwtxtex.cxx b/sw/source/ui/shells/drwtxtex.cxx
index dcbdd6f..a73a2f9 100644
--- a/sw/source/ui/shells/drwtxtex.cxx
+++ b/sw/source/ui/shells/drwtxtex.cxx
@@ -339,7 +339,7 @@ void SwDrawTextShell::Execute( SfxRequest &rReq )
                     xDialog->execute();
                 }
             }
-            catch( uno::Exception& )
+            catch (const uno::Exception&)
             {
             }
             rReq.Ignore ();
diff --git a/sw/source/ui/shells/drwtxtsh.cxx b/sw/source/ui/shells/drwtxtsh.cxx
index 399c327..b9328ac 100644
--- a/sw/source/ui/shells/drwtxtsh.cxx
+++ b/sw/source/ui/shells/drwtxtsh.cxx
@@ -371,7 +371,7 @@ void SwDrawTextShell::ExecDrawLingu(SfxRequest &rReq)
                                         xProp->getPropertyValue( C2U("IsUseCharacterVariants") ) >>= bUseVariants;
                                         xProp->getPropertyValue( C2U("IsTranslateCommonTerms") ) >>= bCommonTerms;
                                     }
-                                    catch( Exception& )
+                                    catch (const Exception&)
                                     {
                                     }
                                 }
diff --git a/sw/source/ui/shells/frmsh.cxx b/sw/source/ui/shells/frmsh.cxx
index 12efea7..362812e 100644
--- a/sw/source/ui/shells/frmsh.cxx
+++ b/sw/source/ui/shells/frmsh.cxx
@@ -412,7 +412,7 @@ void SwFrameShell::Execute(SfxRequest &rReq)
                     xDialog->execute();
                 }
             }
-            catch( uno::Exception& )
+            catch (const uno::Exception&)
             {
             }
             rReq.Ignore ();
diff --git a/sw/source/ui/shells/textsh.cxx b/sw/source/ui/shells/textsh.cxx
index f379a61..2f83f7b 100644
--- a/sw/source/ui/shells/textsh.cxx
+++ b/sw/source/ui/shells/textsh.cxx
@@ -317,7 +317,7 @@ void SwTextShell::ExecInsert(SfxRequest &rReq)
                             xSet->setPropertyValue( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("PluginCommands")), uno::makeAny( aSeq ) );
                         }
                     }
-                    catch ( uno::Exception& )
+                    catch (const uno::Exception&)
                     {
                     }
                 }
@@ -388,7 +388,7 @@ void SwTextShell::ExecInsert(SfxRequest &rReq)
                             uno::makeAny( sal_Int32( aMargin.Height() ) ) );
                     }
                 }
-                catch ( uno::Exception& )
+                catch (const uno::Exception&)
                 {
                 }
             }
diff --git a/sw/source/ui/shells/textsh1.cxx b/sw/source/ui/shells/textsh1.cxx
index aeda86e..1d77ed5 100644
--- a/sw/source/ui/shells/textsh1.cxx
+++ b/sw/source/ui/shells/textsh1.cxx
@@ -1260,7 +1260,7 @@ void SwTextShell::Execute(SfxRequest &rReq)
                 xDialog->execute();
             }
         }
-        catch( uno::Exception& )
+        catch (const uno::Exception&)
         {
         }
         rReq.Ignore ();
diff --git a/sw/source/ui/table/chartins.cxx b/sw/source/ui/table/chartins.cxx
index ba251cd..44833d2 100644
--- a/sw/source/ui/table/chartins.cxx
+++ b/sw/source/ui/table/chartins.cxx
@@ -240,7 +240,7 @@ void SwInsertChart(Window* pParent, SfxBindings* pBindings )
                             }
                         }
                     }
-                    catch( uno::Exception& )
+                    catch (const uno::Exception&)
                     {
                         OSL_FAIL("Chart wizard couldn't be positioned automatically\n" );
                     }
diff --git a/sw/source/ui/uiview/swcli.cxx b/sw/source/ui/uiview/swcli.cxx
index 7fc94e5..2e2c6c0 100644
--- a/sw/source/ui/uiview/swcli.cxx
+++ b/sw/source/ui/uiview/swcli.cxx
@@ -130,11 +130,11 @@ void SwOleClient::ViewChanged()
     {
         aSz = GetObject()->getVisualAreaSize( GetAspect() );
     }
-    catch( embed::NoVisualAreaSizeException& )
+    catch (const embed::NoVisualAreaSizeException&)
     {
         // Nothing will be done
     }
-    catch( uno::Exception& )
+    catch (const uno::Exception&)
     {
         // this is an error
         OSL_FAIL( "Something goes wrong on requesting object size!\n" );
diff --git a/sw/source/ui/uiview/view2.cxx b/sw/source/ui/uiview/view2.cxx
index e986f69..2b3ace2 100644
--- a/sw/source/ui/uiview/view2.cxx
+++ b/sw/source/ui/uiview/view2.cxx
@@ -318,7 +318,7 @@ sal_Bool SwView::InsertGraphicDlg( SfxRequest& rReq )
         xCtrlAcc->setValue( ExtendedFilePickerElementIds::LISTBOX_IMAGE_TEMPLATE,
             ListboxControlActions::SET_SELECT_ITEM, aSelectPos );
     }
-    catch(Exception& )
+    catch (const Exception&)
     {
         OSL_FAIL("control acces failed");
     }
@@ -360,7 +360,7 @@ sal_Bool SwView::InsertGraphicDlg( SfxRequest& rReq )
                     aTemplateValue >>= sTmpl;
                     rReq.AppendItem( SfxStringItem( FN_PARAM_2, sTmpl) );
                 }
-                catch(Exception& )
+                catch (const Exception&)
                 {
                     OSL_FAIL("control access failed");
                 }
diff --git a/sw/source/ui/uiview/viewling.cxx b/sw/source/ui/uiview/viewling.cxx
index c537a3a..77eca57 100644
--- a/sw/source/ui/uiview/viewling.cxx
+++ b/sw/source/ui/uiview/viewling.cxx
@@ -171,7 +171,7 @@ void SwView::ExecLingu(SfxRequest &rReq)
                                     xProp->getPropertyValue( C2U("IsUseCharacterVariants") ) >>= bUseVariants;
                                     xProp->getPropertyValue( C2U("IsTranslateCommonTerms") ) >>= bCommonTerms;
                                 }
-                                catch( Exception& )
+                                catch (const Exception&)
                                 {
                                 }
                             }
@@ -654,7 +654,7 @@ IMPL_STATIC_LINK_NOINSTANCE( AsyncExecute, ExecuteHdl_Impl, ExecuteInfo*, pExecu
         // elements if a component gets detached from its frame!
         pExecuteInfo->xDispatch->dispatch( pExecuteInfo->aTargetURL, pExecuteInfo->aArgs );
     }
-    catch ( Exception& )
+    catch (const Exception&)
     {
     }
 
@@ -790,7 +790,7 @@ sal_Bool SwView::ExecSpellPopup(const Point& rPt)
                                     Application::PostUserEvent( STATIC_LINK(0, AsyncExecute , ExecuteHdl_Impl), pExecuteInfo );
                                 }
                             }
-                            catch (Exception &)
+                            catch (const Exception&)
                             {
                             }
                         }
diff --git a/sw/source/ui/uno/dlelstnr.cxx b/sw/source/ui/uno/dlelstnr.cxx
index 374abaa..ce9d963 100644
--- a/sw/source/ui/uno/dlelstnr.cxx
+++ b/sw/source/ui/uno/dlelstnr.cxx
@@ -83,7 +83,7 @@ SwLinguServiceEventListener::SwLinguServiceEventListener()
                     xBC->addLinguServiceEventListener( (XLinguServiceEventListener *) this );
             }
         }
-        catch (uno::Exception &)
+        catch (const uno::Exception&)
         {
             OSL_FAIL("exception caught in SwLinguServiceEventListener c-tor" );
         }
diff --git a/sw/source/ui/uno/swdetect.cxx b/sw/source/ui/uno/swdetect.cxx
index c95900f..c9dabe8 100644
--- a/sw/source/ui/uno/swdetect.cxx
+++ b/sw/source/ui/uno/swdetect.cxx
@@ -224,7 +224,9 @@ SwFilterDetect::~SwFilterDetect()
                                                                       ucbhelper::CONTINUATION_APPROVE ) );
                             xInteraction->handle( xRequest );
                         }
-                        catch ( Exception & ) {};
+                        catch (const Exception&)
+                        {
+                        }
                     }
                 }
                 else
@@ -247,7 +249,7 @@ SwFilterDetect::~SwFilterDetect()
 
                         aTypeName = SfxFilter::GetTypeFromStorage( xStorage, pPreFilter ? pPreFilter->IsOwnTemplateFormat() : sal_False, &aFilterName );
                     }
-                    catch( lang::WrappedTargetException& aWrap )
+                    catch (const lang::WrappedTargetException& aWrap)
                     {
                         packages::zip::ZipIOException aZipException;
 
@@ -297,11 +299,11 @@ SwFilterDetect::~SwFilterDetect()
                             }
                         }
                     }
-                    catch( uno::RuntimeException& )
+                    catch (const uno::RuntimeException&)
                     {
                         throw;
                     }
-                    catch( uno::Exception& )
+                    catch (const uno::Exception&)
                     {
                         aTypeName.Erase();
                         aPreselectedFilterName.Erase();
diff --git a/sw/source/ui/uno/unomailmerge.cxx b/sw/source/ui/uno/unomailmerge.cxx
index 1a1b5b0..0b0fc02 100644
--- a/sw/source/ui/uno/unomailmerge.cxx
+++ b/sw/source/ui/uno/unomailmerge.cxx
@@ -134,13 +134,13 @@ static CloseResult CloseModelAndDocSh(
             //! I.e. now that object is responsible for closing the model and doc shell.
             xClose->close( sal_True );
         }
-        catch (util::CloseVetoException &)
+        catch (const util::CloseVetoException&)
         {
             //! here we have the problem that the temporary file that is
             //! currently being printed will never be deleted. :-(
             eResult = eVetoed;
         }
-        catch ( const uno::RuntimeException& )
+        catch (const uno::RuntimeException&)
         {
             eResult = eFailed;
         }
@@ -170,7 +170,7 @@ static sal_Bool LoadFromURL_impl(
         xTmpModel = Reference < XModel >( xDesktop->loadComponentFromURL(
                 rURL, C2U("_blank"), 0, aArgs ), UNO_QUERY );
     }
-    catch( Exception & )
+    catch (const Exception&)
     {
         return sal_False;
     }
@@ -260,7 +260,7 @@ namespace
                 OSL_FAIL("DelayedFileDeletion::DelayedFileDeletion: model is no component!" );
             }
         }
-        catch( const Exception& )
+        catch (const Exception&)
         {
             OSL_FAIL("DelayedFileDeletion::DelayedFileDeletion: could not register as event listener at the model!" );
         }
@@ -281,7 +281,7 @@ namespace
             m_xDocument->close( bDeliverOwnership );
             bSuccess = sal_True;
         }
-        catch( const util::CloseVetoException& )
+        catch (const util::CloseVetoException&)
         {
             // somebody vetoed -> next try
             if ( m_nPendingDeleteAttempts )
@@ -293,7 +293,7 @@ namespace
             else
                 bSuccess = sal_True;    // can't do anything here ...
         }
-        catch( const Exception& )
+        catch (const Exception&)
         {
             OSL_FAIL("DelayedFileDeletion::OnTryDeleteFile: caught a strange exception!" );
             bSuccess = sal_True;
@@ -317,7 +317,7 @@ namespace
         {
             m_xDocument->removeCloseListener( this );
         }
-        catch( const Exception & )
+        catch (const Exception&)
         {
             OSL_FAIL("DelayedFileDeletion::implTakeOwnership: could not revoke the listener!" );
         }
@@ -599,7 +599,7 @@ uno::Any SAL_CALL SwXMailMerge::execute(
                 if ( bEverythingsFine )
                     bValid = sal_True;
             }
-            catch( const Exception& )
+            catch (const Exception&)
             {
                 bValid = sal_False;
             }
@@ -805,7 +805,7 @@ uno::Any SAL_CALL SwXMailMerge::execute(
             xStorable->storeAsURL( aTmpFileName, Sequence< PropertyValue >() );
             bStoredAsTemporary = sal_True;
         }
-        catch( const Exception& )
+        catch (const Exception&)
         {
         }
     }
diff --git a/sw/source/ui/utlui/swrenamexnameddlg.cxx b/sw/source/ui/utlui/swrenamexnameddlg.cxx
index 143f3ca..e217398 100644
--- a/sw/source/ui/utlui/swrenamexnameddlg.cxx
+++ b/sw/source/ui/utlui/swrenamexnameddlg.cxx
@@ -103,7 +103,7 @@ IMPL_LINK(SwRenameXNamedDlg, OkHdl, OKButton*, EMPTYARG)
     {
         xNamed->setName(aNewNameED.GetText());
     }
-    catch(uno::RuntimeException&)
+    catch (const uno::RuntimeException&)
     {
         OSL_FAIL("name wasn't changed");
     }
diff --git a/sw/source/ui/utlui/unotools.cxx b/sw/source/ui/utlui/unotools.cxx
index cbefd87..feaf45f 100644
--- a/sw/source/ui/utlui/unotools.cxx
+++ b/sw/source/ui/utlui/unotools.cxx
@@ -206,7 +206,7 @@ IMPL_LINK( SwOneExampleFrame, TimeoutHdl, Timer*, pTimer )
             if ( xLayoutManager.is() )
                 xLayoutManager->setVisible( sal_False );
         }
-        catch ( uno::Exception& )
+        catch (const uno::Exception&)
         {
         }
     }
diff --git a/sw/source/ui/vba/vbadocumentproperties.cxx b/sw/source/ui/vba/vbadocumentproperties.cxx
index 963fca4..c0f12b3 100644
--- a/sw/source/ui/vba/vbadocumentproperties.cxx
+++ b/sw/source/ui/vba/vbadocumentproperties.cxx
@@ -138,7 +138,7 @@ public:
             // the model ( and addtionally these also update the statics object )
             return mxModelProps->getPropertyValue( rPropName );
         }
-        catch( uno::Exception& )
+        catch (const uno::Exception&)
         {
             OSL_TRACE("Got exception");
         }
diff --git a/sw/source/ui/vba/vbaheaderfooterhelper.cxx b/sw/source/ui/vba/vbaheaderfooterhelper.cxx
index c1d04f6..2f7ee3f 100644
--- a/sw/source/ui/vba/vbaheaderfooterhelper.cxx
+++ b/sw/source/ui/vba/vbaheaderfooterhelper.cxx
@@ -87,7 +87,7 @@ sal_Bool HeaderFooterHelper::isHeader( const uno::Reference< frame::XModel >& xM
         if( xTRC->compareRegionStarts( xTR1, xTR2 ) == 0 )
             return sal_True;
     }
-    catch( lang::IllegalArgumentException& )
+    catch (const lang::IllegalArgumentException&)
     {
         return sal_False;
     }
@@ -153,7 +153,7 @@ sal_Bool HeaderFooterHelper::isFooter( const uno::Reference< frame::XModel >& xM
         if( xTRC->compareRegionStarts( xTR1, xTR2 ) == 0 )
             return sal_True;
     }
-    catch( lang::IllegalArgumentException& )
+    catch (const lang::IllegalArgumentException&)
     {
         return sal_False;
     }
diff --git a/sw/source/ui/vba/vbarange.cxx b/sw/source/ui/vba/vbarange.cxx
index f58f7ab..0f51400 100644
--- a/sw/source/ui/vba/vbarange.cxx
+++ b/sw/source/ui/vba/vbarange.cxx
@@ -147,7 +147,7 @@ SwVbaRange::setText( const rtl::OUString& rText ) throw ( uno::RuntimeException
             sName = xNamed->getName();
         }
     }
-    catch( uno::Exception& )
+    catch (const uno::Exception&)
     {
         // do nothing
     }
diff --git a/sw/source/ui/vba/vbarangehelper.cxx b/sw/source/ui/vba/vbarangehelper.cxx
index 8e4d1f3..871ed4c 100644
--- a/sw/source/ui/vba/vbarangehelper.cxx
+++ b/sw/source/ui/vba/vbarangehelper.cxx
@@ -108,7 +108,7 @@ uno::Reference< text::XTextCursor > SwVbaRangeHelper::initCursor( const uno::Ref
         xTextCursor = rText->createTextCursorByRange( rTextRange );
         bGotTextCursor = sal_True;
     }
-    catch (uno::Exception& e)
+    catch (const uno::Exception& e)
     {
         DebugHelper::exception(e);
     }
@@ -121,7 +121,7 @@ uno::Reference< text::XTextCursor > SwVbaRangeHelper::initCursor( const uno::Ref
             xTextCursor = xText->createTextCursor();
             bGotTextCursor = sal_True;
         }
-        catch( uno::Exception& e )
+        catch (const uno::Exception& e)
         {
             DebugHelper::exception(e);
         }
@@ -134,7 +134,7 @@ uno::Reference< text::XTextCursor > SwVbaRangeHelper::initCursor( const uno::Ref
             xTextCursor = rText->createTextCursor();
             bGotTextCursor = sal_True;
         }
-        catch( uno::Exception& e )
+        catch (const uno::Exception& e)
         {
             DebugHelper::exception(e);
         }
@@ -188,7 +188,7 @@ uno::Reference< text::XTextContent > SwVbaRangeHelper::findBookmarkByPosition( c
                 if( xCompare->compareRegionStarts( xTextRange, xBkAnchor->getStart() ) == 0 )
                     return xBookmark;
             }
-            catch( uno::Exception& )
+            catch (const uno::Exception&)
             {
                 continue;
             }
diff --git a/sw/source/ui/vba/wordvbahelper.cxx b/sw/source/ui/vba/wordvbahelper.cxx
index fa1f509..6981c1d 100644
--- a/sw/source/ui/vba/wordvbahelper.cxx
+++ b/sw/source/ui/vba/wordvbahelper.cxx
@@ -155,7 +155,7 @@ uno::Reference< text::XText > getCurrentXText( const uno::Reference< frame::XMod
     {
         xText.set( xTextRange->getText(), uno::UNO_QUERY );
     }
-    catch( uno::RuntimeException& )
+    catch (const uno::RuntimeException&)
     {
         //catch exception "no text selection"
     }
diff --git a/sw/source/ui/wrtsh/wrtsh1.cxx b/sw/source/ui/wrtsh/wrtsh1.cxx
index 07a926d..409500b 100644
--- a/sw/source/ui/wrtsh/wrtsh1.cxx
+++ b/sw/source/ui/wrtsh/wrtsh1.cxx
@@ -517,7 +517,7 @@ sal_Bool SwWrtShell::InsertOleObject( const svt::EmbeddedObjectRef& xRef, SwFlyF
                         xSet->setPropertyValue( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Formula")), uno::makeAny( ::rtl::OUString( aMathData ) ) );
                         bActivate = sal_False;
                     }
-                    catch ( uno::Exception& )
+                    catch (const uno::Exception&)
                     {
                     }
                 }
@@ -648,8 +648,9 @@ void SwWrtShell::MoveObjectIfActive( svt::EmbeddedObjectRef& xObj, const Point&
             }
         }
     }
-    catch( uno::Exception& )
-    {}
+    catch (const uno::Exception&)
+    {
+    }
 }
 
 
@@ -728,7 +729,7 @@ void SwWrtShell::CalcAndSetScale( svt::EmbeddedObjectRef& xObj,
             bLinkingChart = ( xChartDocument.is() && !xChartDocument->hasInternalDataProvider() );
         }
     }
-    catch ( uno::Exception& )
+    catch (const uno::Exception&)
     {
         // TODO/LATER: handle the error
         return;
@@ -759,12 +760,12 @@ void SwWrtShell::CalcAndSetScale( svt::EmbeddedObjectRef& xObj,
     {
         aSize = xObj->getVisualAreaSize( nAspect );
     }
-    catch( embed::NoVisualAreaSizeException& )
+    catch (const embed::NoVisualAreaSizeException&)
     {
         OSL_FAIL("Can't get visual area size!\n" );
         // the scaling will not be done
     }
-    catch( uno::Exception& )
+    catch (const uno::Exception&)
     {
         // TODO/LATER: handle the error
         OSL_FAIL("Can't get visual area size!\n" );
commit 3679b7651737eba53c3779126246e4f0292570eb
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Mon Nov 21 23:22:27 2011 +0000

    callcatcher: remove various unused MultiAtomProvider methods

diff --git a/unotools/inc/unotools/atom.hxx b/unotools/inc/unotools/atom.hxx
index 6ad53ea..40f707c 100644
--- a/unotools/inc/unotools/atom.hxx
+++ b/unotools/inc/unotools/atom.hxx
@@ -57,12 +57,9 @@ namespace utl {
         ~AtomProvider();
 
         int getAtom( const ::rtl::OUString&, sal_Bool bCreate = sal_False );
-        int getLastAtom() const { return m_nAtoms-1; }
         const ::rtl::OUString& getString( int ) const;
 
         void overrideAtom( int atom, const ::rtl::OUString& description );
-
-        sal_Bool hasAtom( int atom ) const;
     };
 
 
@@ -73,10 +70,6 @@ namespace utl {
         MultiAtomProvider();
         ~MultiAtomProvider();
 
-        int getLastAtom( int atomClass ) const;
-
-        sal_Bool insertAtomClass( int atomClass );
-
         int getAtom( int atomClass, const ::rtl::OUString& rString, sal_Bool bCreate = sal_False );
 
         const ::rtl::OUString& getString( int atomClass, int atom ) const;
@@ -84,7 +77,6 @@ namespace utl {
         void overrideAtom( int atomClass, int atom, const ::rtl::OUString& description );
         void overrideAtom( int atomClass, const ::com::sun::star::util::AtomDescription& newDescription )
             { overrideAtom( atomClass, newDescription.atom, newDescription.description ); }
-        sal_Bool hasAtom( int atomClass, int atom ) const;
     };
 }
 
diff --git a/unotools/source/misc/atom.cxx b/unotools/source/misc/atom.cxx
index 61c0d52..92b42af 100644
--- a/unotools/source/misc/atom.cxx
+++ b/unotools/source/misc/atom.cxx
@@ -74,11 +74,6 @@ void AtomProvider::overrideAtom( int atom, const ::rtl::OUString& description )
         m_nAtoms=atom+1;
 }
 
-sal_Bool AtomProvider::hasAtom( int atom ) const
-{
-    return m_aStringMap.find( atom ) != m_aStringMap.end() ? sal_True : sal_False;
-}
-
 // -----------------------------------------------------------------------
 
 MultiAtomProvider::MultiAtomProvider()
@@ -91,17 +86,6 @@ MultiAtomProvider::~MultiAtomProvider()
         delete it->second;
 }
 
-
-sal_Bool MultiAtomProvider::insertAtomClass( int atomClass )
-{
-    ::boost::unordered_map< int, AtomProvider*, ::boost::hash< int > >::iterator it =
-          m_aAtomLists.find( atomClass );
-    if( it != m_aAtomLists.end() )
-        return sal_False;
-    m_aAtomLists[ atomClass ] = new AtomProvider();
-    return sal_True;
-}
-
 int MultiAtomProvider::getAtom( int atomClass, const ::rtl::OUString& rString, sal_Bool bCreate )
 {
     ::boost::unordered_map< int, AtomProvider*, ::boost::hash< int > >::iterator it =
@@ -118,14 +102,6 @@ int MultiAtomProvider::getAtom( int atomClass, const ::rtl::OUString& rString, s
     return INVALID_ATOM;
 }
 
-int MultiAtomProvider::getLastAtom( int atomClass ) const
-{
-    ::boost::unordered_map< int, AtomProvider*, ::boost::hash< int > >::const_iterator it =
-          m_aAtomLists.find( atomClass );
-
-    return it != m_aAtomLists.end() ? it->second->getLastAtom() : INVALID_ATOM;
-}
-
 const ::rtl::OUString& MultiAtomProvider::getString( int atomClass, int atom ) const
 {
     ::boost::unordered_map< int, AtomProvider*, ::boost::hash< int > >::const_iterator it =
@@ -137,12 +113,6 @@ const ::rtl::OUString& MultiAtomProvider::getString( int atomClass, int atom ) c
     return aEmpty;
 }
 
-sal_Bool MultiAtomProvider::hasAtom( int atomClass, int atom ) const
-{
-    ::boost::unordered_map< int, AtomProvider*, ::boost::hash< int > >::const_iterator it = m_aAtomLists.find( atomClass );
-    return it != m_aAtomLists.end() ? it->second->hasAtom( atom ) : sal_False;
-}
-
 void MultiAtomProvider::overrideAtom( int atomClass, int atom, const ::rtl::OUString& description )
 {
     ::boost::unordered_map< int, AtomProvider*, ::boost::hash< int > >::const_iterator it = m_aAtomLists.find( atomClass );
diff --git a/unusedcode.easy b/unusedcode.easy
index 5cad8f6..126beb1 100644
--- a/unusedcode.easy
+++ b/unusedcode.easy
@@ -2260,9 +2260,6 @@ unicode::isTitle(unsigned short)
 unicode::isUnicodeScriptType(unsigned short, short)
 unographic::GraphicDescriptor::isValid() const
 utl::AccessibleStateSetHelper::Compare(utl::AccessibleStateSetHelper const&, utl::AccessibleStateSetHelper&, utl::AccessibleStateSetHelper&)
-utl::MultiAtomProvider::getLastAtom(int) const
-utl::MultiAtomProvider::hasAtom(int, int) const
-utl::MultiAtomProvider::insertAtomClass(int)
 utl::MultiAtomProvider::overrideAtom(int, int, rtl::OUString const&)
 utl::NodeValueAccessor::bind(com::sun::star::uno::Any*)
 utl::OConfigurationNode::appendNode(rtl::OUString const&, utl::OConfigurationNode const&) const
commit 2f0914e5f2957ebdb04bfc7fb5acb1bd6351a0f5
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Mon Nov 21 23:14:21 2011 +0000

    ByteString->rtl::OString

diff --git a/svtools/source/filter/ixbm/xbmread.cxx b/svtools/source/filter/ixbm/xbmread.cxx
index 0870eec..d17910a 100644
--- a/svtools/source/filter/ixbm/xbmread.cxx
+++ b/svtools/source/filter/ixbm/xbmread.cxx
@@ -232,15 +232,15 @@ sal_Bool XBMReader::ParseData( SvStream* pInStm, const ByteString& aLastLine, XB
 
             for( sal_uInt16 i = 0; ( i < nCount ) && ( nRow < nHeight ); i++ )
             {
-                const ByteString    aToken( aLine.GetToken( i, ',' ) );
-                const xub_StrLen nLen = aToken.Len();
+                const rtl::OString aToken(aLine.GetToken(i, ','));
+                const sal_Int32 nLen = aToken.getLength();
                 sal_Bool                bProcessed = sal_False;
 
                 nBit = nDigits = nValue = 0;
 
-                for( xub_StrLen n = 0UL; n < nLen; n++ )
+                for (sal_Int32 n = 0; n < nLen; ++n)
                 {
-                    const unsigned char cChar = aToken.GetChar( n );
+                    const unsigned char cChar = aToken[n];
                     const short         nTable = pHexTable[ cChar ];
 
                     if( isxdigit( cChar ) || !nTable )
diff --git a/svtools/source/filter/sgvtext.cxx b/svtools/source/filter/sgvtext.cxx
index 4eab4c6..36f608e 100644
--- a/svtools/source/filter/sgvtext.cxx
+++ b/svtools/source/filter/sgvtext.cxx
@@ -1253,7 +1253,8 @@ void SgfFontLst::AssignFN(const String& rFName)
 
 void SgfFontLst::ReadList()
 {
-    if (!Tried) {
+    if (!Tried)
+    {
         Tried=sal_True;
         LastID=0;
         LastLn=NULL;
@@ -1262,7 +1263,8 @@ void SgfFontLst::ReadList()
         aCfg.SetGroup("SGV Fonts fuer StarView");
         sal_uInt16 Anz=aCfg.GetKeyCount();
         sal_uInt16 i;
-        ByteString FID,Dsc;
+        rtl::OString FID;
+        ByteString Dsc;
 
         for (i=0;i<Anz;i++)
         {
diff --git a/svtools/source/filter/wmf/wmfwr.cxx b/svtools/source/filter/wmf/wmfwr.cxx
index e30e395..5291c28 100644
--- a/svtools/source/filter/wmf/wmfwr.cxx
+++ b/svtools/source/filter/wmf/wmfwr.cxx
@@ -457,10 +457,10 @@ void WMFWriter::WMFRecord_CreateFontIndirect(const Font & rFont)
     }
     *pWMF << nPitchFamily;
 
-    ByteString aFontName( rFont.GetName(), eFontNameEncoding );
+    rtl::OString aFontName(rtl::OUStringToOString(rFont.GetName(), eFontNameEncoding));
     for ( i = 0; i < W_LF_FACESIZE; i++ )
     {
-        sal_Char nChar = ( i < aFontName.Len() ) ? aFontName.GetChar( i ) : 0;
+        sal_Char nChar = ( i < aFontName.getLength() ) ? aFontName[i] : 0;
         *pWMF << nChar;
     }
     UpdateRecordHeader();
diff --git a/svtools/source/svhtml/parhtml.cxx b/svtools/source/svhtml/parhtml.cxx
index eb976e5..33292b5 100644
--- a/svtools/source/svhtml/parhtml.cxx
+++ b/svtools/source/svhtml/parhtml.cxx
@@ -1881,7 +1881,7 @@ bool HTMLParser::IsHTMLFormat( const sal_Char* pHeader,
     // ^<!
     //
     // where the underlined subexpression has to be a HTML token
-    ByteString sCmp;
+    rtl::OString sCmp;
     bool bUCS2B = false;
     if( bSwitchToUCS2 )
     {
@@ -1932,23 +1932,23 @@ bool HTMLParser::IsHTMLFormat( const sal_Char* pHeader,
     }
     else
     {
-        sCmp = (sal_Char *)pHeader;
+        sCmp = pHeader;
     }
 
-    sCmp.ToUpperAscii();
+    sCmp = sCmp.toAsciiUpperCase();
 
     // A HTML document must have a '<' in the first line
-    xub_StrLen nStart = sCmp.Search( '<' );
-    if( STRING_NOTFOUND  == nStart )
+    sal_Int32 nStart = sCmp.indexOf('<');
+    if (nStart == -1)
         return false;
     nStart++;
 
     // followed by arbitrary characters followed by a blank or '>'
     sal_Char c;
-    xub_StrLen nPos;
-    for( nPos = nStart; nPos<sCmp.Len(); nPos++ )
+    sal_Int32 nPos;
+    for( nPos = nStart; nPos < sCmp.getLength(); ++nPos )
     {
-        if( '>'==(c=sCmp.GetChar(nPos)) || HTML_ISSPACE(c) )
+        if( '>'==(c=sCmp[nPos]) || HTML_ISSPACE(c) )
             break;
     }
 
@@ -1959,20 +1959,20 @@ bool HTMLParser::IsHTMLFormat( const sal_Char* pHeader,
     // the string following '<' has to be a known HTML token.
     // <DIR> is not interpreted as HTML. Otherwise the output of the DOS command "DIR"
     // could be interpreted as HTML.
-    String sTest( sCmp.Copy( nStart, nPos-nStart ), RTL_TEXTENCODING_ASCII_US );
+    String sTest( sCmp.copy( nStart, nPos-nStart ), RTL_TEXTENCODING_ASCII_US );
     int nTok = GetHTMLToken( sTest );
     if( 0 != nTok && HTML_DIRLIST_ON != nTok )
         return true;
 
     // "<!" at the very beginning of the file?
-    if( nStart == 1 && '!' == sCmp.GetChar( 1 ) )
+    if( nStart == 1 && '!' == sCmp[1] )
         return true;
 
     // <HTML> somewhere in the first 80 characters of the document
-    nStart = sCmp.Search( OOO_STRING_SVTOOLS_HTML_html );
-    if( nStart!=STRING_NOTFOUND &&
-        nStart>0 && '<'==sCmp.GetChar(nStart-1) &&
-        nStart+4 < sCmp.Len() && '>'==sCmp.GetChar(nStart+4) )
+    nStart = comphelper::string::indexOfL(sCmp, RTL_CONSTASCII_STRINGPARAM(OOO_STRING_SVTOOLS_HTML_html));
+    if( nStart != -1 &&
+        nStart>0 && '<'==sCmp[nStart-1] &&
+        nStart+4 < sCmp.getLength() && '>'==sCmp[nStart+4] )
         return true;
 
     // Else it's rather not a HTML document
commit 32a0646ba6c124544dc209cfc2633ef76c8449fd
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Mon Nov 21 22:49:38 2011 +0000

    simply tabdialog, remove unused resetbutton api

diff --git a/sfx2/inc/sfx2/tabdlg.hxx b/sfx2/inc/sfx2/tabdlg.hxx
index 8df8018..a689499 100644
--- a/sfx2/inc/sfx2/tabdlg.hxx
+++ b/sfx2/inc/sfx2/tabdlg.hxx
@@ -174,8 +174,6 @@ public:
     CancelButton&       GetCancelButton() { return aCancelBtn; }
     const HelpButton&   GetHelpButton() const { return aHelpBtn; }
     HelpButton&         GetHelpButton() { return aHelpBtn; }
-    const PushButton&   GetResetButton() const { return aResetBtn; }
-    PushButton&         GetResetButton() { return aResetBtn; }
 
     const PushButton*   GetUserButton() const { return pUserBtn; }
     PushButton*         GetUserButton() { return pUserBtn; }


More information about the Libreoffice-commits mailing list