[Libreoffice-commits] core.git: 2 commits - connectivity/source extensions/source

Tor Lillqvist tml at collabora.com
Tue Sep 3 15:39:50 PDT 2013


 connectivity/source/commontools/BlobHelper.cxx                 |    4 +
 connectivity/source/commontools/FDatabaseMetaDataResultSet.cxx |   20 ++++++++
 connectivity/source/sdbcx/VUser.cxx                            |    4 +
 extensions/source/ole/unoconversionutilities.hxx               |   24 +++++-----
 extensions/source/ole/unoobjw.cxx                              |    2 
 5 files changed, 41 insertions(+), 13 deletions(-)

New commits:
commit aa4868de78b3a3893722f7a079f4d05e18abd8db
Author: Tor Lillqvist <tml at collabora.com>
Date:   Wed Sep 4 01:37:58 2013 +0300

    WaE: Unreachable code
    
    Noticed by the MS linker when doing link-time code generation (!). In
    all cases, a "return" after a call to a function that always throws an
    exception. To avoid other compilers perhaps warning about missing
    return of a value, put the "returns" inside ifdefs.
    
    Change-Id: I83aa04cb5c3ff8413d3ed4dc85fb57f2a41fd589

diff --git a/connectivity/source/commontools/BlobHelper.cxx b/connectivity/source/commontools/BlobHelper.cxx
index 15b6363..5135072 100644
--- a/connectivity/source/commontools/BlobHelper.cxx
+++ b/connectivity/source/commontools/BlobHelper.cxx
@@ -49,13 +49,17 @@ BlobHelper::BlobHelper(const ::com::sun::star::uno::Sequence< sal_Int8 >& _val)
 ::sal_Int64 SAL_CALL BlobHelper::position( const ::com::sun::star::uno::Sequence< ::sal_Int8 >& /*pattern*/, ::sal_Int64 /*start*/ ) throw (::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException)
 {
     ::dbtools::throwFeatureNotImplementedException( "XBlob::position", *this );
+#if !(defined(_MSC_VER) && defined(ENABLE_LTO))
     return 0;
+#endif
 }
 // -----------------------------------------------------------------------------
 ::sal_Int64 SAL_CALL BlobHelper::positionOfBlob( const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XBlob >& /*pattern*/, ::sal_Int64 /*start*/ ) throw (::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException)
 {
     ::dbtools::throwFeatureNotImplementedException( "XBlob::positionOfBlob", *this );
+#if !(defined(_MSC_VER) && defined(ENABLE_LTO))
     return 0;
+#endif
 }
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/commontools/FDatabaseMetaDataResultSet.cxx b/connectivity/source/commontools/FDatabaseMetaDataResultSet.cxx
index 32d1e18..7ebd380 100644
--- a/connectivity/source/commontools/FDatabaseMetaDataResultSet.cxx
+++ b/connectivity/source/commontools/FDatabaseMetaDataResultSet.cxx
@@ -326,13 +326,17 @@ sal_Bool SAL_CALL ODatabaseMetaDataResultSet::isAfterLast(  ) throw(SQLException
 sal_Bool SAL_CALL ODatabaseMetaDataResultSet::isFirst(  ) throw(SQLException, RuntimeException)
 {
     ::dbtools::throwFunctionSequenceException(*this);
+#if !(defined(_MSC_VER) && defined(ENABLE_LTO))
     return sal_False;
+#endif
 }
 // -------------------------------------------------------------------------
 sal_Bool SAL_CALL ODatabaseMetaDataResultSet::isLast(  ) throw(SQLException, RuntimeException)
 {
     ::dbtools::throwFunctionSequenceException(*this);
+#if !(defined(_MSC_VER) && defined(ENABLE_LTO))
     return sal_False;
+#endif
 }
 // -------------------------------------------------------------------------
 void SAL_CALL ODatabaseMetaDataResultSet::beforeFirst(  ) throw(SQLException, RuntimeException)
@@ -360,32 +364,42 @@ void SAL_CALL ODatabaseMetaDataResultSet::close(  ) throw(SQLException, RuntimeE
 sal_Bool SAL_CALL ODatabaseMetaDataResultSet::first(  ) throw(SQLException, RuntimeException)
 {
     ::dbtools::throwFunctionSequenceException(*this);
+#if !(defined(_MSC_VER) && defined(ENABLE_LTO))
     return sal_False;
+#endif
 }
 // -------------------------------------------------------------------------
 
 sal_Bool SAL_CALL ODatabaseMetaDataResultSet::last(  ) throw(SQLException, RuntimeException)
 {
     ::dbtools::throwFunctionSequenceException(*this);
+#if !(defined(_MSC_VER) && defined(ENABLE_LTO))
     return sal_False;
+#endif
 }
 // -------------------------------------------------------------------------
 sal_Bool SAL_CALL ODatabaseMetaDataResultSet::absolute( sal_Int32 /*row*/ ) throw(SQLException, RuntimeException)
 {
     ::dbtools::throwFunctionSequenceException(*this);
+#if !(defined(_MSC_VER) && defined(ENABLE_LTO))
     return sal_False;
+#endif
 }
 // -------------------------------------------------------------------------
 sal_Bool SAL_CALL ODatabaseMetaDataResultSet::relative( sal_Int32 /*row*/ ) throw(SQLException, RuntimeException)
 {
     ::dbtools::throwFunctionSequenceException(*this);
+#if !(defined(_MSC_VER) && defined(ENABLE_LTO))
     return sal_False;
+#endif
 }
 // -------------------------------------------------------------------------
 sal_Bool SAL_CALL ODatabaseMetaDataResultSet::previous(  ) throw(SQLException, RuntimeException)
 {
     ::dbtools::throwFunctionSequenceException(*this);
+#if !(defined(_MSC_VER) && defined(ENABLE_LTO))
     return sal_False;
+#endif
 }
 // -------------------------------------------------------------------------
 Reference< XInterface > SAL_CALL ODatabaseMetaDataResultSet::getStatement(  ) throw(SQLException, RuntimeException)
@@ -397,19 +411,25 @@ Reference< XInterface > SAL_CALL ODatabaseMetaDataResultSet::getStatement(  ) th
 sal_Bool SAL_CALL ODatabaseMetaDataResultSet::rowDeleted(  ) throw(SQLException, RuntimeException)
 {
     ::dbtools::throwFunctionSequenceException(*this);
+#if !(defined(_MSC_VER) && defined(ENABLE_LTO))
     return sal_False;
+#endif
 }
 // -------------------------------------------------------------------------
 sal_Bool SAL_CALL ODatabaseMetaDataResultSet::rowInserted(  ) throw(SQLException, RuntimeException)
 {
     ::dbtools::throwFunctionSequenceException(*this);
+#if !(defined(_MSC_VER) && defined(ENABLE_LTO))
     return sal_False;
+#endif
 }
 // -------------------------------------------------------------------------
 sal_Bool SAL_CALL ODatabaseMetaDataResultSet::rowUpdated(  ) throw(SQLException, RuntimeException)
 {
     ::dbtools::throwFunctionSequenceException(*this);
+#if !(defined(_MSC_VER) && defined(ENABLE_LTO))
     return sal_False;
+#endif
 }
 // -------------------------------------------------------------------------
 
diff --git a/connectivity/source/sdbcx/VUser.cxx b/connectivity/source/sdbcx/VUser.cxx
index 4614688..ad088aa 100644
--- a/connectivity/source/sdbcx/VUser.cxx
+++ b/connectivity/source/sdbcx/VUser.cxx
@@ -128,7 +128,9 @@ sal_Int32 SAL_CALL OUser::getPrivileges( const OUString& /*objName*/, sal_Int32
     ::osl::MutexGuard aGuard(m_aMutex);
     checkDisposed(OUser_BASE::rBHelper.bDisposed);
     ::dbtools::throwFeatureNotImplementedException( "XAuthorizable::changePassword", *this );
+#if !(defined(_MSC_VER) && defined(ENABLE_LTO))
     return 0;
+#endif
 }
 // -------------------------------------------------------------------------
 sal_Int32 SAL_CALL OUser::getGrantablePrivileges( const OUString& /*objName*/, sal_Int32 /*objType*/ ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException)
@@ -136,7 +138,9 @@ sal_Int32 SAL_CALL OUser::getGrantablePrivileges( const OUString& /*objName*/, s
     ::osl::MutexGuard aGuard(m_aMutex);
     checkDisposed(OUser_BASE::rBHelper.bDisposed);
     ::dbtools::throwFeatureNotImplementedException( "XAuthorizable::getGrantablePrivileges", *this );
+#if !(defined(_MSC_VER) && defined(ENABLE_LTO))
     return 0;
+#endif
 }
 // -------------------------------------------------------------------------
 void SAL_CALL OUser::grantPrivileges( const OUString& /*objName*/, sal_Int32 /*objType*/, sal_Int32 /*objPrivileges*/ ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException)
commit 340c546eca893a9d306e0a03b78c7f0341af8044
Author: Tor Lillqvist <tml at collabora.com>
Date:   Wed Sep 4 01:24:20 2013 +0300

    WaE: use number() instead of valueOf()
    
    Change-Id: I7a57a8c60c07909018280e52d2da70fbf22857a7

diff --git a/extensions/source/ole/unoconversionutilities.hxx b/extensions/source/ole/unoconversionutilities.hxx
index 36af845..46db5c9 100644
--- a/extensions/source/ole/unoconversionutilities.hxx
+++ b/extensions/source/ole/unoconversionutilities.hxx
@@ -254,7 +254,7 @@ bool convertSelfToCom( T& unoInterface, VARIANT * pVar)
                     throw BridgeRuntimeError(
                         "[automation bridge] convertSelfToCom\n"
                         "VariantCopy failed! Error: " +
-                        OUString::valueOf(hr));
+                        OUString::number(hr));
                 VariantClear( pvariant);
                 CoTaskMemFree( pvariant);
                 ret = true;
@@ -310,7 +310,7 @@ void UnoConversionUtilities<T>::variantToAny( const VARIANTARG* pArg, Any& rAny,
         if( FAILED(hr= VariantCopyInd( &var, const_cast<VARIANTARG*>(pArg)))) // remove VT_BYREF
             throw BridgeRuntimeError(
                 "[automation bridge] UnoConversionUtilities<T>::variantToAny \n"
-                "VariantCopyInd failed for reason : " + OUString::valueOf(hr));
+                "VariantCopyInd failed for reason : " + OUString::number(hr));
         bool bHandled = convertValueObject( & var, rAny);
         if( bHandled)
             OSL_ENSURE(  rAny.getValueType() == ptype, "type in Value Object must match the type parameter");
@@ -562,15 +562,15 @@ void UnoConversionUtilities<T>::variantToAny( const VARIANTARG* pArg, Any& rAny,
             throw CannotConvertException(
                 "[automation bridge]UnoConversionUtilities<T>::variantToAny \n"
                 "Cannot convert the value of vartype :\"" +
-                OUString::valueOf((sal_Int32) var.vt) +
+                OUString::number((sal_Int32) var.vt) +
                 "\"  to the expected UNO type of type class: " +
-                OUString::valueOf((sal_Int32) ptype.getTypeClass()),
+                OUString::number((sal_Int32) ptype.getTypeClass()),
                 0, TypeClass_UNKNOWN, FailReason::TYPE_NOT_SUPPORTED,0);
 
         if (bFail)
             throw IllegalArgumentException(
                 "[automation bridge]UnoConversionUtilities<T>:variantToAny\n"
-                "The provided VARIANT of type\" " + OUString::valueOf((sal_Int32) var.vt) +
+                "The provided VARIANT of type\" " + OUString::number((sal_Int32) var.vt) +
                 "\" is unappropriate for conversion!", Reference<XInterface>(), -1);
     }
     catch (const CannotConvertException &)
@@ -638,22 +638,22 @@ void UnoConversionUtilities<T>::anyToVariant(VARIANT* pVariant, const Any& rAny,
                         "Cannot convert the value of type :\"" +
                         rAny.getValueTypeName() +
                         "\"  to the expected Automation type of VARTYPE: " +
-                        OUString::valueOf((sal_Int32)type),
+                        OUString::number((sal_Int32)type),
                         0, TypeClass_UNKNOWN, FailReason::TYPE_NOT_SUPPORTED,0);
 
                 throw BridgeRuntimeError(
                     "[automation bridge]UnoConversionUtilities<T>::anyToVariant \n"
                     "Conversion of any with " +
                     rAny.getValueType().getTypeName() +
-                    " to VARIANT with type: " + OUString::valueOf((sal_Int32) type) +
-                    " failed! Error code: " + OUString::valueOf(hr));
+                    " to VARIANT with type: " + OUString::number((sal_Int32) type) +
+                    " failed! Error code: " + OUString::number(hr));
 
             }
             if(FAILED(hr = VariantCopy(pVariant, &var)))
             {
                 throw BridgeRuntimeError(
                           "[automation bridge]UnoConversionUtilities<T>::anyToVariant \n"
-                          "VariantCopy failed for reason: " + OUString::valueOf(hr));
+                          "VariantCopy failed for reason: " + OUString::number(hr));
             }
         }
     }
@@ -789,7 +789,7 @@ void UnoConversionUtilities<T>::anyToVariant(VARIANT* pVariant, const Any& rAny)
             {
                 throw BridgeRuntimeError(
                         "[automation bridge]UnoConversionUtilities<T>::anyToVariant\n"
-                        "VariantClear failed with error:" + OUString::valueOf(hr));
+                        "VariantClear failed with error:" + OUString::number(hr));
             }
             break;
         }
@@ -1471,7 +1471,7 @@ void UnoConversionUtilities<T>::variantToAny( const VARIANT* pVariant, Any& rAny
         if( FAILED(hr= VariantCopyInd( &var, const_cast<VARIANTARG*>(pVariant)))) // remove VT_BYREF
             throw BridgeRuntimeError(
                       "[automation bridge] UnoConversionUtilities<T>::variantToAny \n"
-                      "VariantCopyInd failed for reason : " + OUString::valueOf(hr));
+                      "VariantCopyInd failed for reason : " + OUString::number(hr));
 
         if ( ! convertValueObject( & var, rAny))
         {
@@ -2037,7 +2037,7 @@ void UnoConversionUtilities<T>::dispatchExObject2Sequence( const VARIANTARG* pva
         // put them into the passed in sequence
         for( sal_Int32 i= 0; i< length; i++)
         {
-            OUString ousIndex=OUString::valueOf( i);
+            OUString ousIndex=OUString::number( i);
             OLECHAR* sindex =  (OLECHAR*)ousIndex.getStr();
 
             if( FAILED( hr= pdispEx->GetIDsOfNames(IID_NULL, &sindex , 1, LOCALE_USER_DEFAULT, &dispid)))
diff --git a/extensions/source/ole/unoobjw.cxx b/extensions/source/ole/unoobjw.cxx
index 0bed03e..bac14b0 100644
--- a/extensions/source/ole/unoobjw.cxx
+++ b/extensions/source/ole/unoobjw.cxx
@@ -392,7 +392,7 @@ void InterfaceOleWrapper_Impl::convertDispparamsArgs(DISPID id,
                     throw BridgeRuntimeError(
                         "[automation bridge] Could not determine "
                         "if the object has a member \"0\". Error: " +
-                        OUString::valueOf(hr));
+                        OUString::number(hr));
                 }
             }
         }


More information about the Libreoffice-commits mailing list