[Libreoffice-commits] .: 2 commits - i18npool/source unotools/source

Caolán McNamara caolan at kemper.freedesktop.org
Fri Jul 8 02:51:36 PDT 2011


 i18npool/source/paper/paper.cxx      |    6 ++-
 unotools/source/config/configmgr.cxx |   56 ++++++++++++++++++++---------------
 2 files changed, 37 insertions(+), 25 deletions(-)

New commits:
commit 0c065c355f762d39c4d8f199e0b8a269ecca579b
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Thu Jul 7 21:33:24 2011 +0100

    catch by const reference

diff --git a/unotools/source/config/configmgr.cxx b/unotools/source/config/configmgr.cxx
index cd4decd..dfa9cd9 100644
--- a/unotools/source/config/configmgr.cxx
+++ b/unotools/source/config/configmgr.cxx
@@ -156,21 +156,23 @@ Reference< XMultiServiceFactory > ConfigManager::GetConfigurationProvider()
                      UNO_QUERY);
             }
 #if OSL_DEBUG_LEVEL > 1
-    catch(Exception& rEx)
-    {
-        static sal_Bool bMessage = sal_True;
-        if(bMessage)
-        {
-            bMessage = sal_False;
-            OString sMsg("CreateInstance with arguments exception: ");
-            sMsg += OString(rEx.Message.getStr(),
-                        rEx.Message.getLength(),
-                        RTL_TEXTENCODING_ASCII_US);
-            OSL_FAIL(sMsg.getStr());
-        }
-    }
+            catch (const Exception& rEx)
+            {
+                static sal_Bool bMessage = sal_True;
+                if(bMessage)
+                {
+                    bMessage = sal_False;
+                    OString sMsg("CreateInstance with arguments exception: ");
+                    sMsg += OString(rEx.Message.getStr(),
+                                rEx.Message.getLength(),
+                                RTL_TEXTENCODING_ASCII_US);
+                    OSL_FAIL(sMsg.getStr());
+                }
+            }
 #else
-    catch(Exception&){}
+            catch (const Exception&)
+            {
+            }
 #endif
         }
     }
@@ -282,7 +284,7 @@ Reference< XHierarchicalNameAccess> ConfigManager::AcquireTree(utl::ConfigItem&
                     OUString::createFromAscii(pAccessSrvc),
                     aArgs);
         }
-        catch(Exception& rEx)
+        catch (const Exception& rEx)
         {
             if (CONFIG_MODE_PROPAGATE_ERRORS & rCfgItem.GetMode())
             {
@@ -489,7 +491,9 @@ Any ConfigManager::GetDirectConfigProperty(ConfigProperty eProp)
                 aArgs);
 
     }
-    catch(Exception&){}
+    catch (const Exception&)
+    {
+    }
     Reference<XNameAccess> xDirectAccess(xIFace, UNO_QUERY);
     if(xDirectAccess.is())
     {
@@ -514,7 +518,7 @@ Any ConfigManager::GetDirectConfigProperty(ConfigProperty eProp)
         {
             aRet = xDirectAccess->getByName(sProperty);
         }
-        catch(Exception&)
+        catch (const Exception&)
         {
             #if OSL_DEBUG_LEVEL > 0
             rtl::OStringBuffer aBuf(256);
@@ -619,7 +623,7 @@ Reference< XHierarchicalNameAccess> ConfigManager::GetHierarchyAccess(const OUSt
                     aArgs);
         }
 #if OSL_DEBUG_LEVEL > 1
-        catch(Exception& rEx)
+        catch (const Exception& rEx)
         {
             OString sMsg("CreateInstance exception: ");
             sMsg += OString(rEx.Message.getStr(),
@@ -628,7 +632,9 @@ Reference< XHierarchicalNameAccess> ConfigManager::GetHierarchyAccess(const OUSt
             OSL_FAIL(sMsg.getStr());
         }
 #else
-        catch(Exception&){}
+        catch (const Exception&)
+        {
+        }
 #endif
     }
     return Reference<XHierarchicalNameAccess>(xIFace, UNO_QUERY);
@@ -650,7 +656,7 @@ Any ConfigManager::GetLocalProperty(const OUString& rProperty)
             aRet = xAccess->getByName(sProperty);
     }
 #if OSL_DEBUG_LEVEL > 1
-    catch(Exception& rEx)
+    catch (const Exception& rEx)
     {
         OString sMsg("GetLocalProperty: ");
         sMsg += OString(rEx.Message.getStr(),
@@ -659,7 +665,9 @@ Any ConfigManager::GetLocalProperty(const OUString& rProperty)
         OSL_FAIL(sMsg.getStr());
     }
 #else
-    catch(Exception&){}
+    catch (const Exception&)
+    {
+    }
 #endif
     return aRet;
 }
@@ -680,7 +688,7 @@ void ConfigManager::PutLocalProperty(const OUString& rProperty, const Any& rValu
             xNodeReplace->replaceByName(sProperty, rValue);
         }
 #if OSL_DEBUG_LEVEL > 1
-        catch(Exception& rEx)
+        catch (const Exception& rEx)
         {
             OString sMsg("PutLocalProperty: ");
             sMsg += OString(rEx.Message.getStr(),
@@ -689,7 +697,9 @@ void ConfigManager::PutLocalProperty(const OUString& rProperty, const Any& rValu
             OSL_FAIL(sMsg.getStr());
         }
 #else
-        catch(Exception& ){}
+        catch (const Exception&)
+        {
+        }
 #endif
     }
 }
commit d665e3e8b0916fa53023339e7d8189d486722631
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Thu Jul 7 21:28:25 2011 +0100

    catch by const reference

diff --git a/i18npool/source/paper/paper.cxx b/i18npool/source/paper/paper.cxx
index 2c7bc91..df78e6f 100644
--- a/i18npool/source/paper/paper.cxx
+++ b/i18npool/source/paper/paper.cxx
@@ -247,7 +247,7 @@ PaperInfo PaperInfo::getSystemDefaultPaper()
         // try user-defined locale setting
         xConfigNA->getByName( CREATE_OUSTRING( "ooSetupSystemLocale" ) ) >>= aLocaleStr;
     }
-    catch( Exception& )
+    catch(const Exception&)
     {
     }
 
@@ -377,7 +377,9 @@ PaperInfo PaperInfo::getSystemDefaultPaper()
             xConfigNA->getByName( CREATE_OUSTRING( "Locale" ) ) >>= aLocaleStr;
         }
     }
-    catch( Exception& ) {}
+    catch(const Exception&)
+    {
+    }
 
     if (aLocaleStr.getLength() == 0)
         aLocaleStr = CREATE_OUSTRING("en-US");


More information about the Libreoffice-commits mailing list