[Libreoffice-commits] .: 2 commits - chart2/source sc/source

Caolán McNamara caolan at kemper.freedesktop.org
Tue Jun 21 01:13:57 PDT 2011


 chart2/source/controller/chartapiwrapper/ChartDocumentWrapper.cxx |   35 ++++------
 chart2/source/controller/main/ChartController.cxx                 |    2 
 chart2/source/model/filter/XMLFilter.cxx                          |   28 ++++----
 chart2/source/model/main/ChartModel.cxx                           |   16 ++--
 chart2/source/tools/ReferenceSizeProvider.cxx                     |   10 +-
 sc/source/ui/vba/vbaapplication.cxx                               |   14 ++--
 sc/source/ui/vba/vbaoleobjects.cxx                                |    2 
 7 files changed, 53 insertions(+), 54 deletions(-)

New commits:
commit 6b990ddc098ac6715add9c6ffe24278e4a258fd4
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Mon Jun 20 21:57:53 2011 +0100

    catch by const reference

diff --git a/chart2/source/controller/chartapiwrapper/ChartDocumentWrapper.cxx b/chart2/source/controller/chartapiwrapper/ChartDocumentWrapper.cxx
index e34ba33..175307a 100644
--- a/chart2/source/controller/chartapiwrapper/ChartDocumentWrapper.cxx
+++ b/chart2/source/controller/chartapiwrapper/ChartDocumentWrapper.cxx
@@ -533,7 +533,7 @@ void WrappedHasLegendProperty::setPropertyValue( const Any& rOuterValue, const R
                 xLegendProp->setPropertyValue( C2U("Show"), uno::makeAny( bNewValue ));
         }
     }
-    catch( uno::Exception & ex )
+    catch (const uno::Exception& ex)
     {
         ASSERT_EXCEPTION( ex );
     }
@@ -552,7 +552,7 @@ Any WrappedHasLegendProperty::getPropertyValue( const Reference< beans::XPropert
         else
             aRet <<= sal_False;
     }
-    catch( uno::Exception & ex )
+    catch (const uno::Exception& ex)
     {
         ASSERT_EXCEPTION( ex );
     }
@@ -614,7 +614,7 @@ void WrappedHasMainTitleProperty::setPropertyValue( const Any& rOuterValue, cons
         else
             TitleHelper::removeTitle( TitleHelper::MAIN_TITLE, m_spChart2ModelContact->getChartModel() );
     }
-    catch( uno::Exception & ex )
+    catch (const uno::Exception& ex)
     {
         ASSERT_EXCEPTION( ex );
     }
@@ -628,7 +628,7 @@ Any WrappedHasMainTitleProperty::getPropertyValue( const Reference< beans::XProp
     {
         aRet <<= sal_Bool( TitleHelper::getTitle( TitleHelper::MAIN_TITLE, m_spChart2ModelContact->getChartModel() ).is() );
     }
-    catch( uno::Exception & ex )
+    catch (const uno::Exception& ex)
     {
         ASSERT_EXCEPTION( ex );
     }
@@ -691,7 +691,7 @@ void WrappedHasSubTitleProperty::setPropertyValue( const Any& rOuterValue, const
         else
             TitleHelper::removeTitle( TitleHelper::SUB_TITLE, m_spChart2ModelContact->getChartModel() );
     }
-    catch( uno::Exception & ex )
+    catch (const uno::Exception& ex)
     {
         ASSERT_EXCEPTION( ex );
     }
@@ -705,7 +705,7 @@ Any WrappedHasSubTitleProperty::getPropertyValue( const Reference< beans::XPrope
     {
         aRet <<= sal_Bool( TitleHelper::getTitle( TitleHelper::SUB_TITLE, m_spChart2ModelContact->getChartModel() ).is() );
     }
-    catch( uno::Exception & ex )
+    catch (const uno::Exception& ex)
     {
         ASSERT_EXCEPTION( ex );
     }
@@ -802,7 +802,7 @@ Reference< XDiagram > SAL_CALL ChartDocumentWrapper::getDiagram()
         {
             m_xDiagram = new DiagramWrapper( m_spChart2ModelContact );
         }
-        catch( uno::Exception & ex )
+        catch (const uno::Exception& ex)
         {
             ASSERT_EXCEPTION( ex );
         }
@@ -837,7 +837,7 @@ void SAL_CALL ChartDocumentWrapper::setDiagram( const Reference< XDiagram >& xDi
                 m_xDiagram = xDiagram;
             }
         }
-        catch( uno::Exception & ex )
+        catch (const uno::Exception& ex)
         {
             ASSERT_EXCEPTION( ex );
         }
@@ -1004,12 +1004,12 @@ void SAL_CALL ChartDocumentWrapper::dispose()
             if( xFormerDelegator.is())
                 xFormerDelegator->dispose();
         }
-        catch( lang::DisposedException )
+        catch (const lang::DisposedException&)
         {
             // this is ok, don't panic
         }
     }
-    catch( uno::Exception &ex )
+    catch (const uno::Exception &ex)
     {
         ASSERT_EXCEPTION( ex );
     }
@@ -1041,11 +1041,11 @@ void ChartDocumentWrapper::impl_resetAddIn()
                 }
             }
         }
-        catch( const uno::RuntimeException& ex )
+        catch (const uno::RuntimeException& ex)
         {
             ASSERT_EXCEPTION( ex );
         }
-        catch( const uno::Exception& ex )
+        catch (const uno::Exception& ex)
         {
             ASSERT_EXCEPTION( ex );
         }
@@ -1347,7 +1347,7 @@ uno::Reference< uno::XInterface > SAL_CALL ChartDocumentWrapper::createInstance(
 
                 xResult = static_cast< ::cppu::OWeakObject* >( new DiagramWrapper( m_spChart2ModelContact ));
             }
-            catch( uno::Exception & ex )
+            catch (const uno::Exception& ex)
             {
                 ASSERT_EXCEPTION( ex );
             }
@@ -1390,7 +1390,7 @@ uno::Reference< uno::XInterface > SAL_CALL ChartDocumentWrapper::createInstance(
                         aArguments[1]=uno::makeAny(bRefreshAddIn);
                         xViewInit->initialize(aArguments);
                     }
-                    catch( uno::Exception & ex )
+                    catch (const uno::Exception& ex)
                     {
                         ASSERT_EXCEPTION( ex );
                     }
@@ -1422,7 +1422,7 @@ uno::Reference< uno::XInterface > SAL_CALL ChartDocumentWrapper::createInstance(
                 bServiceFound = true;
             }
         }
-        catch( const uno::Exception )
+        catch (const uno::Exception&)
         {
             // couldn't create shape
         }
@@ -1446,9 +1446,8 @@ uno::Reference< uno::XInterface > SAL_CALL ChartDocumentWrapper::createInstance(
                 }
             }
         }
-        catch( const uno::Exception& ex )
+        catch (const uno::Exception&)
         {
-            (void)ex;
             // couldn't create service
         }
     }
@@ -1509,7 +1508,7 @@ void SAL_CALL ChartDocumentWrapper::setDelegator(
         {
             this->dispose();
         }
-        catch( uno::Exception &ex )
+        catch (const uno::Exception& ex)
         {
             ASSERT_EXCEPTION( ex );
         }
diff --git a/chart2/source/controller/main/ChartController.cxx b/chart2/source/controller/main/ChartController.cxx
index 2bbdb8d..b317b15 100644
--- a/chart2/source/controller/main/ChartController.cxx
+++ b/chart2/source/controller/main/ChartController.cxx
@@ -241,7 +241,7 @@ void ChartController::TheModel::tryTermination()
 
 #if OSL_DEBUG_LEVEL > 1
                 OSL_ENSURE( !m_bOwnership,
-                    "INFO: a well known owner has catched a CloseVetoException after calling close(true)" );
+                    "INFO: a well known owner has caught a CloseVetoException after calling close(true)" );
 #endif
 
                 m_bOwnership				= false;
diff --git a/chart2/source/model/filter/XMLFilter.cxx b/chart2/source/model/filter/XMLFilter.cxx
index b575956..b0bfdfb 100644
--- a/chart2/source/model/filter/XMLFilter.cxx
+++ b/chart2/source/model/filter/XMLFilter.cxx
@@ -162,7 +162,7 @@ uno::Reference< embed::XStorage > lcl_getWriteStorage(
             xProp->setPropertyValue( C2U("MediaType"), uno::makeAny( _sMediaType ));
         }
     }
-    catch( uno::Exception & ex )
+    catch (const uno::Exception& ex)
     {
         ASSERT_EXCEPTION( ex );
     }
@@ -226,7 +226,7 @@ uno::Reference< embed::XStorage > lcl_getReadStorage(
 
         OSL_ENSURE( xStorage.is(), "No Storage" );
     }
-    catch( uno::Exception & ex )
+    catch (const uno::Exception& ex)
     {
         ASSERT_EXCEPTION( ex );
     }
@@ -465,7 +465,7 @@ sal_Int32 XMLFilter::impl_Import(
                 xStorage, xSaxParser, xFactory, xGraphicObjectResolver, xImportInfo );
         }
     }
-    catch( uno::Exception & ex )
+    catch (const uno::Exception& ex)
     {
         ASSERT_EXCEPTION( ex );
 
@@ -549,7 +549,7 @@ sal_Int32 XMLFilter::impl_ImportStream(
                         xDocHandler.set(xFactory->createInstanceWithArgumentsAndContext(m_sDocumentHandler,aArgs,m_xContext), uno::UNO_QUERY );
                         xImporter.set(xDocHandler,uno::UNO_QUERY);
                     }
-                    catch(uno::Exception&)
+                    catch (const uno::Exception&)
                     {
                         OSL_FAIL("Exception caught!");
                     }
@@ -561,24 +561,24 @@ sal_Int32 XMLFilter::impl_ImportStream(
             // load was successful
             nWarning = 0;
         }
-        catch( xml::sax::SAXParseException )
+        catch (const xml::sax::SAXParseException&)
         {
             // todo: if encrypted: ERRCODE_SFX_WRONGPASSWORD
         }
-        catch( xml::sax::SAXException )
+        catch (const xml::sax::SAXException&)
         {
             // todo: if encrypted: ERRCODE_SFX_WRONGPASSWORD
         }
-        catch( packages::zip::ZipIOException )
+        catch (const packages::zip::ZipIOException&)
         {
             nWarning = ERRCODE_IO_BROKENPACKAGE;
         }
-        catch( io::IOException )
+        catch (const io::IOException&)
         {
         }
-        catch( uno::Exception& aEx )
+        catch (const uno::Exception& rEx)
         {
-            ASSERT_EXCEPTION( aEx );
+            ASSERT_EXCEPTION(rEx);
         }
     }
 
@@ -647,7 +647,7 @@ sal_Int32 XMLFilter::impl_Export(
                 xDocHandler.set(xServiceFactory->createInstanceWithArguments(m_sDocumentHandler,aArgs), uno::UNO_QUERY );
                 xSaxWriter.set(xDocHandler,uno::UNO_QUERY);
             }
-            catch(uno::Exception&)
+            catch (const uno::Exception&)
             {
                 OSL_FAIL("Exception caught!");
             }
@@ -727,7 +727,7 @@ sal_Int32 XMLFilter::impl_Export(
         if ( xTransact.is() )
             xTransact->commit();
     }
-    catch( uno::Exception & ex )
+    catch (const uno::Exception& ex)
     {
         ASSERT_EXCEPTION( ex );
 
@@ -772,7 +772,7 @@ sal_Int32 XMLFilter::impl_ExportStream(
             xStreamProp->setPropertyValue( C2U("Compressed"), uno::makeAny( sal_True ) );//@todo?
             xStreamProp->setPropertyValue( C2U("UseCommonStoragePasswordEncryption"), uno::makeAny( sal_True ) );
         }
-        catch( uno::Exception& rEx )
+        catch (const uno::Exception& rEx)
         {
             ASSERT_EXCEPTION( rEx );
         }
@@ -804,7 +804,7 @@ sal_Int32 XMLFilter::impl_ExportStream(
         //@todo? filter properties? ... url? ...
         xFilter->filter( aMediaDesc );
     }
-    catch( uno::Exception& rEx )
+    catch (const uno::Exception& rEx)
     {
         ASSERT_EXCEPTION( rEx );
     }
diff --git a/chart2/source/model/main/ChartModel.cxx b/chart2/source/model/main/ChartModel.cxx
index 66f07c7..10a2c3a 100644
--- a/chart2/source/model/main/ChartModel.cxx
+++ b/chart2/source/model/main/ChartModel.cxx
@@ -235,7 +235,7 @@ sal_Bool ChartModel::impl_isControllerConnected( const uno::Reference< frame::XC
                 return sal_True;
         }
     }
-    catch( uno::Exception )
+    catch (const uno::Exception&)
     {
     }
     return sal_False;
@@ -654,7 +654,7 @@ void SAL_CALL ChartModel::close( sal_Bool bDeliverOwnership )
                 //try to cancel running longlasting calls
                 //// @todo
             }
-            catch( uno::Exception )
+            catch (const uno::Exception&)
             {
                 //// @todo
                 //do not throw anything here!! (without endTryClose)
@@ -837,7 +837,7 @@ void SAL_CALL ChartModel::attachDataProvider( const uno::Reference< chart2::data
                 sal_Bool bIncludeHiddenCells = ChartModelHelper::isIncludeHiddenCells( Reference< frame::XModel >(this) );
                 xProp->setPropertyValue(C2U("IncludeHiddenCells"), uno::makeAny(bIncludeHiddenCells));
             }
-            catch( const beans::UnknownPropertyException& )
+            catch (const beans::UnknownPropertyException&)
             {
             }
         }
@@ -906,11 +906,11 @@ void SAL_CALL ChartModel::setArguments( const Sequence< beans::PropertyValue >&
                     xDia->setDiagramData( xDataSource, aArguments );
             }
         }
-        catch( lang::IllegalArgumentException & )
+        catch (const lang::IllegalArgumentException&)
         {
             throw;
         }
-        catch( uno::Exception & ex )
+        catch (const uno::Exception& ex)
         {
             ASSERT_EXCEPTION( ex );
         }
@@ -1011,7 +1011,7 @@ uno::Any SAL_CALL ChartModel::queryInterface( const uno::Type& aType )
             if( m_xOldModelAgg.is())
                 aResult = m_xOldModelAgg->queryAggregation( aType );
         }
-        catch( uno::Exception & ex )
+        catch (const uno::Exception& ex)
         {
             ASSERT_EXCEPTION( ex );
         }
@@ -1105,7 +1105,7 @@ embed::VisualRepresentation SAL_CALL ChartModel::getPreferredVisualRepresentatio
 
         aResult.Data <<= aMetafile;
     }
-    catch( uno::Exception & ex )
+    catch (const uno::Exception& ex)
     {
         ASSERT_EXCEPTION( ex );
     }
@@ -1143,7 +1143,7 @@ uno::Any SAL_CALL ChartModel::getTransferData( const datatransfer::DataFlavor& a
                 aResult = xTransferable->getTransferData( aFlavor );
             }
         }
-        catch( uno::Exception & ex )
+        catch (const uno::Exception& ex)
         {
             ASSERT_EXCEPTION( ex );
         }
diff --git a/chart2/source/tools/ReferenceSizeProvider.cxx b/chart2/source/tools/ReferenceSizeProvider.cxx
index 32493d9..ac8a159 100644
--- a/chart2/source/tools/ReferenceSizeProvider.cxx
+++ b/chart2/source/tools/ReferenceSizeProvider.cxx
@@ -109,7 +109,7 @@ void ReferenceSizeProvider::setValuesAtTitle(
 
         setValuesAtPropertySet( xTitleProp, /* bAdaptFontSizes = */ false );
     }
-    catch( const uno::Exception & ex )
+    catch (const uno::Exception& ex)
     {
         ASSERT_EXCEPTION( ex );
     }
@@ -140,7 +140,7 @@ void ReferenceSizeProvider::setValuesAtAllDataSeries()
                             (*aIt)->getDataPointByIndex( aPointIndexes[i] ) );
                 }
             }
-            catch( const uno::Exception & ex )
+            catch (const uno::Exception& ex)
             {
                 ASSERT_EXCEPTION( ex );
             }
@@ -183,7 +183,7 @@ void ReferenceSizeProvider::setValuesAtPropertySet(
             }
         }
     }
-    catch( const uno::Exception & ex )
+    catch (const uno::Exception& ex)
     {
         ASSERT_EXCEPTION( ex );
     }
@@ -205,7 +205,7 @@ void ReferenceSizeProvider::getAutoResizeFromPropSet(
             else
                 eSingleState = AUTO_RESIZE_NO;
         }
-        catch( uno::Exception )
+        catch (const uno::Exception&)
         {
             // unknown property -> state stays unknown
         }
@@ -320,7 +320,7 @@ ReferenceSizeProvider::AutoResizeState ReferenceSizeProvider::getAutoResizeState
                     }
                 }
             }
-            catch( const uno::Exception & ex )
+            catch (const uno::Exception& ex)
             {
                 ASSERT_EXCEPTION( ex );
             }
commit d5a88cc271213a727de40d6b44f285fff38db0f2
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Mon Jun 20 21:51:30 2011 +0100

    catch by const reference

diff --git a/sc/source/ui/vba/vbaapplication.cxx b/sc/source/ui/vba/vbaapplication.cxx
index a1d9c11..96d1e9d 100644
--- a/sc/source/ui/vba/vbaapplication.cxx
+++ b/sc/source/ui/vba/vbaapplication.cxx
@@ -218,7 +218,7 @@ ScVbaApplication::invoke( const ::rtl::OUString& FunctionName, const uno::Sequen
         uno::Reference< script::XInvocation > xWSF( new ScVbaWSFunction( this, mxContext ) );
         aAny = xWSF->invoke( FunctionName, Params, OutParamIndex, OutParam );
     }
-    catch( uno::Exception& )
+    catch (const uno::Exception&)
     {
         aAny <<= script::BasicErrorException( ::rtl::OUString(), uno::Reference< uno::XInterface >(), 1000, ::rtl::OUString() );
     }
@@ -519,7 +519,7 @@ ScVbaApplication::setCutCopyMode( const uno::Any& _cutcopymode ) throw (uno::Run
                             {
                                 xFlushableClipboard->flushClipboard();
                             }
-                            catch( const uno::Exception& )
+                            catch (const uno::Exception&)
                             {
                             }
                             Application::AcquireSolarMutex( nRef );
@@ -733,7 +733,7 @@ ScVbaApplication::GoTo( const uno::Any& Reference, const uno::Any& Scroll ) thro
                 gridWindow->GrabFocus();
             }
         }
-        catch( uno::RuntimeException )
+        catch (const uno::RuntimeException&)
         {
             //maybe this should be a procedure name
             //TODO for procedure name
@@ -835,7 +835,7 @@ ScVbaApplication::setCursor( sal_Int32 _cursor ) throw (uno::RuntimeException)
                 // IllegalArgumentException, or so
         }
     }
-    catch( const uno::Exception& )
+    catch (const uno::Exception&)
     {
         DBG_UNHANDLED_EXCEPTION();
     }
@@ -996,7 +996,7 @@ rtl::OUString ScVbaApplication::getOfficePath( const rtl::OUString& _sPathType )
             sUrl = sUrl.copy( nIndex + 1 );
         ::osl::File::getSystemPathFromFileURL( sUrl, sRetPath );
     }
-    catch (uno::Exception&)
+    catch (const uno::Exception&)
     {
         DebugHelper::exception(SbERR_METHOD_FAILED, rtl::OUString());
     }
@@ -1528,7 +1528,7 @@ ScVbaApplication::GetOpenFilename(const uno::Any& FileFilter, const uno::Any& Fi
             }
         }
     }
-    catch( const uno::Exception& )
+    catch (const uno::Exception&)
     {
         DebugHelper::exception(SbERR_METHOD_FAILED, rtl::OUString());
     }
@@ -1696,7 +1696,7 @@ ScVbaApplication::GetSaveAsFilename( const ::com::sun::star::uno::Any& InitialFi
             }
         }
     }
-    catch( const uno::Exception& )
+    catch (const uno::Exception&)
     {
         DebugHelper::exception(SbERR_METHOD_FAILED, rtl::OUString());
     }
diff --git a/sc/source/ui/vba/vbaoleobjects.cxx b/sc/source/ui/vba/vbaoleobjects.cxx
index bbb88d9..a376197 100644
--- a/sc/source/ui/vba/vbaoleobjects.cxx
+++ b/sc/source/ui/vba/vbaoleobjects.cxx
@@ -141,7 +141,7 @@ ScVbaOLEObjects::getItemByStringIndex( const rtl::OUString& sIndex ) throw (uno:
     {
         return OLEObjectsImpl_BASE::getItemByStringIndex( sIndex );
     }
-    catch( uno::RuntimeException )
+    catch (const uno::RuntimeException&)
     {
         uno::Reference< container::XIndexAccess > xIndexAccess( m_xIndexAccess, uno::UNO_QUERY_THROW );
         sal_Int32 nCount = xIndexAccess->getCount();


More information about the Libreoffice-commits mailing list