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

Caolán McNamara caolan at kemper.freedesktop.org
Tue Oct 19 05:36:46 PDT 2010


 unotools/source/config/historyoptions.cxx |    6 +++++-
 unotools/source/config/pathoptions.cxx    |    8 +++++++-
 2 files changed, 12 insertions(+), 2 deletions(-)

New commits:
commit 8db952ef531b7aa61e8882fda356f4cc1f1ed541
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Tue Oct 19 11:26:36 2010 +0100

    survive missing configuration entries for paths

diff --git a/unotools/source/config/pathoptions.cxx b/unotools/source/config/pathoptions.cxx
index 31a50b5..0b30149 100644
--- a/unotools/source/config/pathoptions.cxx
+++ b/unotools/source/config/pathoptions.cxx
@@ -263,9 +263,12 @@ static VarNameAttribute aVarNameAttribute[] =
 
 const String& SvtPathOptions_Impl::GetPath( SvtPathOptions::Pathes ePath )
 {
+    if ( ePath >= SvtPathOptions::PATH_COUNT )
+        return m_aEmptyString;
+
     ::osl::MutexGuard aGuard( m_aMutex );
 
-    if ( ePath < SvtPathOptions::PATH_COUNT )
+    try
     {
         OUString 	aPathValue;
         String		aResult;
@@ -290,6 +293,9 @@ const String& SvtPathOptions_Impl::GetPath( SvtPathOptions::Pathes ePath )
         m_aPathArray[ ePath ] = aPathValue;
         return m_aPathArray[ ePath ];
     }
+    catch (UnknownPropertyException &)
+    {
+    }
 
     return m_aEmptyString;
 }
commit 171a9d590848ca7e9058743d141b96309816fac3
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Tue Oct 19 10:05:41 2010 +0100

    survive a missing history

diff --git a/unotools/source/config/historyoptions.cxx b/unotools/source/config/historyoptions.cxx
index 43645c8..5aba5f1 100644
--- a/unotools/source/config/historyoptions.cxx
+++ b/unotools/source/config/historyoptions.cxx
@@ -189,9 +189,13 @@ SvtHistoryOptions_Impl::~SvtHistoryOptions_Impl()
 //*****************************************************************************************************************
 sal_uInt32 SvtHistoryOptions_Impl::GetSize( EHistoryType eHistory )
 {
-    sal_uInt32                                       nSize = 0  ;
     css::uno::Reference< css::beans::XPropertySet >  xListAccess(m_xCommonXCU, css::uno::UNO_QUERY);
 
+    if (!xListAccess.is())
+        return 0;
+
+    sal_uInt32 nSize = 0  ;
+
     try
     {
         switch( eHistory )


More information about the Libreoffice-commits mailing list