[Libreoffice-commits] core.git: 2 commits - editeng/source stoc/source

Jan Holesovsky kendy at suse.cz
Thu Apr 11 09:28:12 PDT 2013


 editeng/source/items/flditem.cxx |   13 ++++++++++++-
 stoc/source/tdmanager/tdmgr.cxx  |   12 +++---------
 2 files changed, 15 insertions(+), 10 deletions(-)

New commits:
commit 763011690b18cdf47cb23125c98a5bfa5d17b2d6
Author: Jan Holesovsky <kendy at suse.cz>
Date:   Thu Apr 11 13:29:36 2013 +0200

    i#79611: SvxFieldData::Create() is not supposed to throw.
    
    Change-Id: Ied4e5cc9211b2a541006432d0b4d257f014249f4

diff --git a/editeng/source/items/flditem.cxx b/editeng/source/items/flditem.cxx
index 2b3d090..70fe692 100644
--- a/editeng/source/items/flditem.cxx
+++ b/editeng/source/items/flditem.cxx
@@ -43,7 +43,18 @@ SvxFieldData* SvxFieldData::Create(const uno::Reference<text::XTextContent>& xTe
     if (!xPropSet.is())
         return NULL;
 
-    uno::Any aAny = xPropSet->getPropertyValue(UNO_TC_PROP_TEXTFIELD_TYPE);
+    // we do not support these fields from Writer, so make sure we do not throw
+    // here - see fdo#63436 how to possibly extend Writer to make use of this
+    uno::Any aAny;
+    try {
+        aAny = xPropSet->getPropertyValue(UNO_TC_PROP_TEXTFIELD_TYPE);
+        if ( !aAny.has<sal_Int32>() )
+            return NULL;
+    } catch ( const beans::UnknownPropertyException& e )
+    {
+        return NULL;
+    }
+
     sal_Int32 nFieldType = aAny.get<sal_Int32>();
 
     switch (nFieldType)
commit c226e93159730cc53947d271c587d3720d966546
Author: Jan Holesovsky <kendy at suse.cz>
Date:   Thu Apr 11 13:26:55 2013 +0200

    Avoid an endless stream of NoSuchElementException exceptions.
    
    Extremely annoying during debugging; and throwing / catching is not the
    fastest operation under the sun...
    
    Change-Id: Ic5604bb1c3ef77d1577c4ac611af44be6fea6533

diff --git a/stoc/source/tdmanager/tdmgr.cxx b/stoc/source/tdmanager/tdmgr.cxx
index 2ac1483..f8904c9 100644
--- a/stoc/source/tdmanager/tdmgr.cxx
+++ b/stoc/source/tdmanager/tdmgr.cxx
@@ -1085,16 +1085,10 @@ Any ManagerImpl::getByHierarchicalName( const OUString & rName )
             for ( ProviderVector::const_iterator iPos( _aProviders.begin() );
                   iPos != _aProviders.end(); ++iPos )
             {
-                try
-                {
-                    if ((aRet = (*iPos)->getByHierarchicalName(
-                             rName )).hasValue())
-                    {
-                        break;
-                    }
-                }
-                catch (const NoSuchElementException &)
+                if ( (*iPos)->hasByHierarchicalName( rName ) )
                 {
+                    aRet = (*iPos)->getByHierarchicalName( rName );
+                    break;
                 }
             }
         }


More information about the Libreoffice-commits mailing list