[Libreoffice-commits] .: 9 commits - connectivity/source desktop/source drawinglayer/source editeng/source formula/source sfx2/source svx/source

Caolán McNamara caolan at kemper.freedesktop.org
Wed Apr 13 12:39:16 PDT 2011


 connectivity/source/commontools/TConnection.cxx                 |    2 
 connectivity/source/commontools/TIndexes.cxx                    |    2 
 connectivity/source/drivers/dbase/DTable.cxx                    |   20 +++---
 connectivity/source/drivers/evoab2/NDriver.cxx                  |   13 ++--
 connectivity/source/drivers/evoab2/NServices.cxx                |    2 
 connectivity/source/drivers/hsqldb/HStorageAccess.cxx           |   14 ++--
 connectivity/source/drivers/hsqldb/HStorageMap.cxx              |   18 ++----
 connectivity/source/drivers/hsqldb/StorageFileAccess.cxx        |   22 +++----
 connectivity/source/drivers/hsqldb/StorageNativeInputStream.cxx |   14 ++--
 connectivity/source/drivers/jdbc/ResultSet.cxx                  |    8 +-
 connectivity/source/drivers/odbcbase/OResultSet.cxx             |   16 ++---
 connectivity/source/drivers/odbcbase/OStatement.cxx             |   16 ++---
 desktop/source/deployment/misc/dp_misc.cxx                      |   29 +++++++---
 drawinglayer/source/primitive2d/textprimitive2d.cxx             |    2 
 editeng/source/editeng/impedit2.cxx                             |    8 +-
 formula/source/core/api/FormulaCompiler.cxx                     |   13 +++-
 formula/source/core/api/token.cxx                               |    9 ++-
 sfx2/source/bastyp/sfxhtml.cxx                                  |    7 --
 svx/source/form/formcontroller.cxx                              |    2 
 svx/source/unodraw/unoshap4.cxx                                 |    2 
 20 files changed, 122 insertions(+), 97 deletions(-)

New commits:
commit 7136dc471580bf4f0546197a650b5dfe02d207c5
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Wed Apr 13 15:23:53 2011 +0100

    dont' assert for changing seperators, common thing to do

diff --git a/formula/source/core/api/FormulaCompiler.cxx b/formula/source/core/api/FormulaCompiler.cxx
index 7b64c39..477894f 100644
--- a/formula/source/core/api/FormulaCompiler.cxx
+++ b/formula/source/core/api/FormulaCompiler.cxx
@@ -489,7 +489,9 @@ void FormulaCompiler::OpCodeMap::putOpCode( const String & rStr, const OpCode eO
     DBG_ASSERT( 0 < eOp && sal_uInt16(eOp) < mnSymbols, "OpCodeMap::putOpCode: OpCode out of range");
     if (0 < eOp && sal_uInt16(eOp) < mnSymbols)
     {
-        DBG_ASSERT( (mpTable[eOp].Len() == 0) || (mpTable[eOp] == rStr) || (eOp == ocCurrency),
+        DBG_ASSERT( (mpTable[eOp].Len() == 0) || (mpTable[eOp] == rStr) ||
+            (eOp == ocCurrency) || (eOp == ocSep) || (eOp == ocArrayColSep) ||
+            (eOp == ocArrayRowSep),
             ByteString( "OpCodeMap::putOpCode: reusing OpCode ").
             Append( ByteString::CreateFromInt32( sal_Int32( eOp))).Append( " (").
             Append( ByteString( rStr, RTL_TEXTENCODING_ASCII_US)).Append( ')').GetBuffer());
commit 8eb3e965e0fcc86f9ddc05ea54fd58fd6579045b
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Wed Apr 13 15:12:21 2011 +0100

    default to UTF8 for html encoding

diff --git a/sfx2/source/bastyp/sfxhtml.cxx b/sfx2/source/bastyp/sfxhtml.cxx
index 8ab736b..f41c4f5 100644
--- a/sfx2/source/bastyp/sfxhtml.cxx
+++ b/sfx2/source/bastyp/sfxhtml.cxx
@@ -80,15 +80,12 @@ SfxHTMLParser::SfxHTMLParser( SvStream& rStream, sal_Bool bIsNewDoc,
     pMedium( pMed ), pDLMedium( 0 ),
     nMetaTags( 0 )
 {
-    DBG_ASSERT( RTL_TEXTENCODING_DONTKNOW == GetSrcEncoding( ),
+    DBG_ASSERT( RTL_TEXTENCODING_UTF8 == GetSrcEncoding( ),
                 "SfxHTMLParser::SfxHTMLParser: From where comes ZS?" );
+
     DBG_ASSERT( !IsSwitchToUCS2(),
                 "SfxHTMLParser::SfxHTMLParser: Switch to UCS2?" );
 
-    // Altough the real default encoding is ISO8859-1, we use MS-1252
-    // as default encoding.
-    SetSrcEncoding( GetExtendedCompatibilityTextEncoding(  RTL_TEXTENCODING_ISO_8859_1 ) );
-
     // If the file starts with a BOM, switch to UCS2.
     SetSwitchToUCS2( sal_True );
 }
commit 63f6f4c41642da11592944c52bda33b436ec0e26
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Wed Apr 13 11:17:17 2011 +0100

    WaE on enable-dbgutil

diff --git a/svx/source/form/formcontroller.cxx b/svx/source/form/formcontroller.cxx
index 40a250a..cc46ffa 100644
--- a/svx/source/form/formcontroller.cxx
+++ b/svx/source/form/formcontroller.cxx
@@ -1716,7 +1716,7 @@ void FormController::focusGained(const FocusEvent& e) throw( RuntimeException )
             )
         {
             // check the old control if the content is ok
-#if (OSL_DEBUG_LEVEL > 1) || defined DBG_UTIL
+#if OSL_DEBUG_LEVEL > 1
             Reference< XBoundControl >  xLockingTest(m_xCurrentControl, UNO_QUERY);
             sal_Bool bControlIsLocked = xLockingTest.is() && xLockingTest->getLock();
             OSL_ENSURE(!bControlIsLocked, "FormController::Gained: I'm modified and the current control is locked ? How this ?");
commit 0f2362091a974e17cfca04bbe736fc2ed7723a46
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Wed Apr 13 09:47:24 2011 +0100

    catch by const reference

diff --git a/connectivity/source/commontools/TConnection.cxx b/connectivity/source/commontools/TConnection.cxx
index b0747df..497caca 100644
--- a/connectivity/source/commontools/TConnection.cxx
+++ b/connectivity/source/commontools/TConnection.cxx
@@ -59,7 +59,7 @@ void OMetaConnection::disposing()
             Reference< XInterface > xStatement( i->get() );
             ::comphelper::disposeComponent( xStatement );
         }
-        catch (DisposedException)
+        catch (const DisposedException&)
         {
         }
     }
diff --git a/connectivity/source/commontools/TIndexes.cxx b/connectivity/source/commontools/TIndexes.cxx
index 2f08a77..d1237bd 100644
--- a/connectivity/source/commontools/TIndexes.cxx
+++ b/connectivity/source/commontools/TIndexes.cxx
@@ -107,7 +107,7 @@ sdbcx::ObjectType OIndexesHelper::createObject(const ::rtl::OUString& _rName)
                         bPrimarKeyIndex = xRow->getString(6) == aName;
                     }
                 }
-                catch(Exception)
+                catch(const Exception&)
                 {
                 }
                 OIndexHelper* pRet = new OIndexHelper(m_pTable,aName,aQualifier,bUnique,
diff --git a/connectivity/source/drivers/dbase/DTable.cxx b/connectivity/source/drivers/dbase/DTable.cxx
index f309944..5a1fe17 100644
--- a/connectivity/source/drivers/dbase/DTable.cxx
+++ b/connectivity/source/drivers/dbase/DTable.cxx
@@ -643,7 +643,7 @@ String ODbaseTable::getEntry(OConnection* _pConnection,const ::rtl::OUString& _s
         }
         xDir->beforeFirst(); // move back to before first record
     }
-    catch(Exception&)
+    catch(const Exception&)
     {
         OSL_ASSERT(0);
     }
@@ -700,7 +700,7 @@ void ODbaseTable::refreshIndexes()
                         aVector.push_back(aURL.getBase());
                     }
                 }
-                catch(Exception&) // an exception is thrown when no file exists
+                catch(const Exception&) // an exception is thrown when no file exists
                 {
                 }
             }
@@ -1064,7 +1064,7 @@ sal_Bool ODbaseTable::CreateImpl()
             delete pFileStream;
         }
     }
-    catch(Exception&) // an exception is thrown when no file exists
+    catch(const Exception&) // an exception is thrown when no file exists
     {
     }
 
@@ -1081,7 +1081,7 @@ sal_Bool ODbaseTable::CreateImpl()
             Content aContent(aURL.GetMainURL(INetURLObject::NO_DECODE),Reference<XCommandEnvironment>());
             aContent.executeCommand( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("delete")),bool2any( sal_True ) );
         }
-        catch(Exception&) // an exception is thrown when no file exists
+        catch(const Exception&) // an exception is thrown when no file exists
         {
         }
         return sal_False;
@@ -1098,7 +1098,7 @@ sal_Bool ODbaseTable::CreateImpl()
         {
             bMemoAlreadyExists = aMemo1Content.isDocument();
         }
-        catch(Exception&) // an exception is thrown when no file exists
+        catch(const Exception&) // an exception is thrown when no file exists
         {
         }
         if (bMemoAlreadyExists)
@@ -1455,7 +1455,7 @@ sal_Bool ODbaseTable::Drop_Static(const ::rtl::OUString& _sUrl,sal_Bool _bHasMem
                         _pIndexes->dropByIndex(--i);
                     }
                 }
-                catch(SQLException)
+                catch(const SQLException&)
                 {
                 }
             }
@@ -1467,7 +1467,7 @@ sal_Bool ODbaseTable::Drop_Static(const ::rtl::OUString& _sUrl,sal_Bool _bHasMem
                 ::ucbhelper::Content aDeleteContent( aURL.GetMainURL( INetURLObject::NO_DECODE ), Reference< XCommandEnvironment > () );
                 aDeleteContent.executeCommand( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("delete")), makeAny( sal_Bool( sal_True ) ) );
             }
-            catch(Exception&)
+            catch(const Exception&)
             {
                 // silently ignore this ....
             }
@@ -1979,11 +1979,11 @@ sal_Bool ODbaseTable::UpdateBuffer(OValueRefVector& rRow, OValueRefRow pOrgRow,c
                 break;
             }
         }
-        catch( SQLException&  )
+        catch( const SQLException&  )
         {
             throw;
         }
-        catch ( Exception& )
+        catch ( const Exception& )
         {
             m_pColumns->getByIndex(i) >>= xCol;
             OSL_ENSURE( xCol.is(), "ODbaseTable::UpdateBuffer column is null!" );
@@ -2333,7 +2333,7 @@ namespace
             if(aValues.getLength() && aValues[0].hasValue())
                 throw Exception();
         }
-        catch(Exception&)
+        catch(const Exception&)
         {
             throw ElementExistException(newName,NULL);
         }
diff --git a/connectivity/source/drivers/evoab2/NDriver.cxx b/connectivity/source/drivers/evoab2/NDriver.cxx
index ae34a7e..ddb8d78 100644
--- a/connectivity/source/drivers/evoab2/NDriver.cxx
+++ b/connectivity/source/drivers/evoab2/NDriver.cxx
@@ -71,12 +71,15 @@ void OEvoabDriver::disposing()
     for (OWeakRefArray::iterator i = m_xConnections.begin(); m_xConnections.end() != i; ++i)
     {
         Reference< XComponent > xComp(i->get(), UNO_QUERY);
-        if (xComp.is()) {
-            try {	
-            xComp->dispose();
+        if (xComp.is())
+        {
+            try
+            {
+                xComp->dispose();
             }
-            catch (com::sun::star::lang::DisposedException e) {
-             xComp.clear();
+            catch (const com::sun::star::lang::DisposedException&)
+            {
+                xComp.clear();
             }
         }
     }
diff --git a/connectivity/source/drivers/evoab2/NServices.cxx b/connectivity/source/drivers/evoab2/NServices.cxx
index 2e39639..8695a95 100644
--- a/connectivity/source/drivers/evoab2/NServices.cxx
+++ b/connectivity/source/drivers/evoab2/NServices.cxx
@@ -77,7 +77,7 @@ struct ProviderRequest
         {
             xRet = creator( xServiceManager, sImplementationName,Factory, Services,0);
         }
-        catch(::com::sun::star::uno::Exception)
+        catch(const ::com::sun::star::uno::Exception&)
         {
             OSL_FAIL("Service Creation Exception");
         }
diff --git a/connectivity/source/drivers/hsqldb/HStorageAccess.cxx b/connectivity/source/drivers/hsqldb/HStorageAccess.cxx
index ce69f2e..c0a5993 100644
--- a/connectivity/source/drivers/hsqldb/HStorageAccess.cxx
+++ b/connectivity/source/drivers/hsqldb/HStorageAccess.cxx
@@ -90,7 +90,7 @@ SAL_DLLPUBLIC_EXPORT void JNICALL Java_com_sun_star_sdbcx_comp_hsqldb_NativeStor
         {
             xFlush->flush();
         }
-        catch(Exception&)
+        catch(const Exception&)
         {
             OSL_FAIL( "NativeStorageAccess::close: caught an exception while flushing!" );
         }
@@ -171,7 +171,7 @@ jint read_from_storage_stream( JNIEnv * env, jobject /*obj_this*/, jstring name,
         {
             nBytesRead = xIn->readBytes(aData,1);
         }
-        catch(Exception& e)
+        catch(const Exception& e)
         {
             StorageContainer::throwJavaException(e,env);
             return -1;
@@ -249,7 +249,7 @@ jint read_from_storage_stream_into_buffer( JNIEnv * env, jobject /*obj_this*/,js
         {
             nBytesRead = xIn->readBytes(aData, len);
         }
-        catch(Exception& e)
+        catch(const Exception& e)
         {
             StorageContainer::throwJavaException(e,env);
             return -1;
@@ -317,7 +317,7 @@ SAL_DLLPUBLIC_EXPORT jint JNICALL Java_com_sun_star_sdbcx_comp_hsqldb_NativeStor
         {
             nBytesRead = xIn->readBytes(aData, 4);
         }
-        catch(Exception& e)
+        catch(const Exception& e)
         {
             StorageContainer::throwJavaException(e,env);
             return -1;
@@ -464,7 +464,7 @@ void write_to_storage_stream_from_buffer( JNIEnv* env, jobject /*obj_this*/, jst
                     "No OutputStream");
         }
     }
-    catch(Exception& e)
+    catch(const Exception& e)
     {
         OSL_FAIL("Exception caught! : write [BII)V");
         StorageContainer::throwJavaException(e,env);
@@ -523,9 +523,9 @@ void write_to_storage_stream( JNIEnv* env, jobject /*obj_this*/, jstring name, j
                     "No OutputStream");
         }
     }
-    catch(Exception& e)
+    catch(const Exception& e)
     {
-        OSL_FAIL("Exception catched! : writeBytes(aData);");
+        OSL_FAIL("Exception caught! : writeBytes(aData);");
         StorageContainer::throwJavaException(e,env);
     }
 }
diff --git a/connectivity/source/drivers/hsqldb/HStorageMap.cxx b/connectivity/source/drivers/hsqldb/HStorageMap.cxx
index 5e947f2..ba10091 100644
--- a/connectivity/source/drivers/hsqldb/HStorageMap.cxx
+++ b/connectivity/source/drivers/hsqldb/HStorageMap.cxx
@@ -79,21 +79,19 @@ namespace connectivity
                     {
                         ::comphelper::disposeComponent(m_xOutputStream);
                     }
-                    catch(DisposedException&)
+                    catch(const DisposedException&)
                     {
                     }
-                    catch(const Exception& e)
+                    catch(const Exception&)
                     {
-                        OSL_UNUSED( e );
                         OSL_FAIL("Could not dispose OutputStream");
                     }
                     m_xOutputStream.clear();
                 }
             }
-            catch(Exception& ex)
+            catch(const Exception&)
             {
-                OSL_UNUSED( ex );
-                OSL_FAIL("Exception catched!");
+                OSL_FAIL("Exception caught!");
             }
         }
         // -----------------------------------------------------------------------------
@@ -245,7 +243,7 @@ namespace connectivity
                             xTrans->commit();
                     }
                 }
-                catch(Exception&)
+                catch(const Exception&)
                 {
                 }
                 rMap.erase(aFind);
@@ -281,7 +279,7 @@ namespace connectivity
                             {
                                 pHelper.reset(new StreamHelper(aStoragePair.first.first->openStreamElement(sName,_nMode)));
                             }
-                            catch(Exception& )
+                            catch(const Exception&)
                             {
                                 ::rtl::OUString sStrippedName = removeOldURLPrefix(sOrgName);
 
@@ -292,7 +290,7 @@ namespace connectivity
                                     {
                                        bIsStream = aStoragePair.first.first->isStreamElement(sStrippedName);
                                     }
-                                    catch(Exception& )
+                                    catch(const Exception&)
                                     {
                                         bIsStream = sal_False;
                                     }
@@ -303,7 +301,7 @@ namespace connectivity
                             }
                             aFind->second.second.insert(TStreamMap::value_type(sName,pHelper));
                         }
-                        catch(Exception& e)
+                        catch(const Exception& e)
                         {
 #if OSL_DEBUG_LEVEL > 0
                             ::rtl::OString sMessage( "[HSQLDB-SDBC] caught an exception while opening a stream\n" );
diff --git a/connectivity/source/drivers/hsqldb/StorageFileAccess.cxx b/connectivity/source/drivers/hsqldb/StorageFileAccess.cxx
index 98d8322..7bfca08 100644
--- a/connectivity/source/drivers/hsqldb/StorageFileAccess.cxx
+++ b/connectivity/source/drivers/hsqldb/StorageFileAccess.cxx
@@ -76,22 +76,22 @@ SAL_DLLPUBLIC_EXPORT jboolean JNICALL Java_com_sun_star_sdbcx_comp_hsqldb_Storag
                     {
                         aStoragePair.first.first->renameElement(sOldName,StorageContainer::removeURLPrefix(sName,aStoragePair.first.second));
                     }
-                    catch(Exception&)
+                    catch(const Exception&)
                     {
                     }
                 }
             }
-            catch(NoSuchElementException&)
+            catch(const NoSuchElementException&)
             {
             }
             return aStoragePair.first.first->isStreamElement(StorageContainer::removeURLPrefix(sName,aStoragePair.first.second));
         }
-        catch(NoSuchElementException&)
+        catch(const NoSuchElementException&)
         {
         }
-        catch(Exception& e)
+        catch(const Exception& e)
         {
-            OSL_FAIL("Exception catched! : Java_com_sun_star_sdbcx_comp_hsqldb_StorageFileAccess_isStreamElement");
+            OSL_FAIL("Exception caught! : Java_com_sun_star_sdbcx_comp_hsqldb_StorageFileAccess_isStreamElement");
             if (JNI_FALSE != env->ExceptionCheck())
                 env->ExceptionClear();
             ::rtl::OString cstr( ::rtl::OUStringToOString(e.Message, RTL_TEXTENCODING_JAVA_UTF8 ) );
@@ -123,14 +123,14 @@ SAL_DLLPUBLIC_EXPORT void JNICALL Java_com_sun_star_sdbcx_comp_hsqldb_StorageFil
         {
             aStoragePair.first.first->removeElement(StorageContainer::removeURLPrefix(StorageContainer::jstring2ustring(env,name),aStoragePair.first.second));
         }
-        catch(NoSuchElementException&)
+        catch(const NoSuchElementException&)
         {
             if (JNI_FALSE != env->ExceptionCheck())
                 env->ExceptionClear();
         }
-        catch(Exception& e)
+        catch(const Exception& e)
         {
-            OSL_FAIL("Exception catched! : Java_com_sun_star_sdbcx_comp_hsqldb_StorageFileAccess_removeElement");
+            OSL_FAIL("Exception caught! : Java_com_sun_star_sdbcx_comp_hsqldb_StorageFileAccess_removeElement");
             StorageContainer::throwJavaException(e,env);
         }
     }
@@ -168,12 +168,12 @@ SAL_DLLPUBLIC_EXPORT void JNICALL Java_com_sun_star_sdbcx_comp_hsqldb_StorageFil
             }
 #endif
         }
-        catch(NoSuchElementException&)
+        catch(const NoSuchElementException&)
         {
         }
-        catch(Exception& e)
+        catch(const Exception& e)
         {
-            OSL_FAIL("Exception catched! : Java_com_sun_star_sdbcx_comp_hsqldb_StorageFileAccess_renameElement");
+            OSL_FAIL("Exception caught! : Java_com_sun_star_sdbcx_comp_hsqldb_StorageFileAccess_renameElement");
             StorageContainer::throwJavaException(e,env);
         }
     }
diff --git a/connectivity/source/drivers/hsqldb/StorageNativeInputStream.cxx b/connectivity/source/drivers/hsqldb/StorageNativeInputStream.cxx
index c80eba8..3d3a912 100644
--- a/connectivity/source/drivers/hsqldb/StorageNativeInputStream.cxx
+++ b/connectivity/source/drivers/hsqldb/StorageNativeInputStream.cxx
@@ -183,15 +183,15 @@ SAL_DLLPUBLIC_EXPORT jlong JNICALL Java_com_sun_star_sdbcx_comp_hsqldb_StorageNa
 
                     } while (tmpLongVal > 0);
                 }
-                catch(Exception& )
+                catch(const Exception&)
                 {
                 }
 
                 return n - tmpLongVal;
             }
-            catch(Exception& e)
+            catch(const Exception& e)
             {
-                OSL_FAIL("Exception catched! : skip();");
+                OSL_FAIL("Exception caught! : skip();");
                 StorageContainer::throwJavaException(e,env);
             }
         }
@@ -232,9 +232,9 @@ SAL_DLLPUBLIC_EXPORT jint JNICALL Java_com_sun_star_sdbcx_comp_hsqldb_StorageNat
 #endif
             return nAvailable;
         }
-        catch(Exception& e)
+        catch(const Exception& e)
         {
-           OSL_FAIL("Exception caught! : available();");
+            OSL_FAIL("Exception caught! : available();");
             StorageContainer::throwJavaException(e,env);
         }
     }
@@ -276,9 +276,9 @@ SAL_DLLPUBLIC_EXPORT jint JNICALL Java_com_sun_star_sdbcx_comp_hsqldb_StorageNat
         {
             nBytesRead = xIn->readBytes(aData,nLen);
         }
-        catch(Exception& e)
+        catch(const Exception& e)
         {
-            OSL_FAIL("Exception catched! : skip();");
+            OSL_FAIL("Exception caught! : skip();");
             StorageContainer::throwJavaException(e,env);
         }
 
diff --git a/connectivity/source/drivers/jdbc/ResultSet.cxx b/connectivity/source/drivers/jdbc/ResultSet.cxx
index 7712dfd..64a17ad 100644
--- a/connectivity/source/drivers/jdbc/ResultSet.cxx
+++ b/connectivity/source/drivers/jdbc/ResultSet.cxx
@@ -809,7 +809,7 @@ void SAL_CALL java_sql_ResultSet::updateBinaryStream( sal_Int32 columnIndex, con
             }
         }
     }
-    catch(Exception)
+    catch(const Exception&)
     {
         ::dbtools::throwFeatureNotImplementedException( "XRowUpdate::updateBinaryStream", *this );    
     }    
@@ -841,7 +841,7 @@ void SAL_CALL java_sql_ResultSet::updateCharacterStream( sal_Int32 columnIndex,
             }
         }
     }
-    catch(Exception)
+    catch(const Exception&)
     {
         ::dbtools::throwFeatureNotImplementedException( "XRowUpdate::updateCharacterStream", *this );    
     }
@@ -899,7 +899,7 @@ void SAL_CALL java_sql_ResultSet::updateNumericObject( sal_Int32 columnIndex, co
             }
         }
     }
-    catch(Exception)
+    catch(const Exception&)
     {
         updateObject( columnIndex,x);
     }
@@ -1061,7 +1061,7 @@ void java_sql_ResultSet::getFastPropertyValue(
                 break;
         }
     }
-    catch(Exception&)
+    catch(const Exception&)
     {
     }
 }
diff --git a/connectivity/source/drivers/odbcbase/OResultSet.cxx b/connectivity/source/drivers/odbcbase/OResultSet.cxx
index 909143b..c454823 100644
--- a/connectivity/source/drivers/odbcbase/OResultSet.cxx
+++ b/connectivity/source/drivers/odbcbase/OResultSet.cxx
@@ -122,7 +122,7 @@ OResultSet::OResultSet(SQLHANDLE _pStatementHandle ,OStatement_Base* pStmt) :	OR
         m_pRowStatusArray = new SQLUSMALLINT[1]; // the default value
         N3SQLSetStmtAttr(m_aStatementHandle,SQL_ATTR_ROW_STATUS_PTR,m_pRowStatusArray,SQL_IS_POINTER);
     }
-    catch(Exception&)
+    catch(const Exception&)
     { // we don't want our result destroy here
     }
     SQLINTEGER nCurType = 0;
@@ -134,7 +134,7 @@ OResultSet::OResultSet(SQLHANDLE _pStatementHandle ,OStatement_Base* pStmt) :	OR
             (nValueLen & SQL_CA2_CRC_EXACT) != SQL_CA2_CRC_EXACT)
             m_pSkipDeletedSet = new OSkipDeletedSet(this);
     }
-    catch(Exception&)
+    catch(const Exception&)
     { // we don't want our result destroy here
     }
     try
@@ -143,7 +143,7 @@ OResultSet::OResultSet(SQLHANDLE _pStatementHandle ,OStatement_Base* pStmt) :	OR
         OTools::GetInfo(m_pStatement->getOwnConnection(),m_aConnectionHandle,SQL_GETDATA_EXTENSIONS,nValueLen,NULL);
         m_bFetchData = !((SQL_GD_ANY_ORDER & nValueLen) == SQL_GD_ANY_ORDER && nCurType != SQL_CURSOR_FORWARD_ONLY);
     }
-    catch(Exception&)
+    catch(const Exception&)
     { // we don't want our result destroy here
         m_bFetchData = sal_True;
     }
@@ -155,7 +155,7 @@ OResultSet::OResultSet(SQLHANDLE _pStatementHandle ,OStatement_Base* pStmt) :	OR
             m_bUseFetchScroll = ( N3SQLGetFunctions(m_aConnectionHandle,SQL_API_SQLFETCHSCROLL,&nSupported) == SQL_SUCCESS && nSupported == 1 );
         }
     }
-    catch(Exception&)
+    catch(const Exception&)
     {
         m_bUseFetchScroll = sal_False;
     }
@@ -546,7 +546,7 @@ sal_Int64 SAL_CALL OResultSet::getLong( sal_Int32 columnIndex ) throw(SQLExcepti
         const ORowSetValue& aValue = getValue(columnIndex,SQL_C_SBIGINT,&nRet,sizeof nRet);
         return (&aValue == &m_aEmptyValue) ? nRet : (sal_Int64)aValue;
     }
-    catch(SQLException&)
+    catch(const SQLException&)
     {
         nRet = getString(columnIndex).toInt64();
     }
@@ -873,7 +873,7 @@ void SAL_CALL OResultSet::insertRow(  ) throw(SQLException, RuntimeException)
     {
         OTools::ThrowException(m_pStatement->getOwnConnection(),nRet,m_aStatementHandle,SQL_HANDLE_STMT,*this);
     }
-    catch(SQLException e)
+    catch(const SQLException&)
     {
         nRet = unbind();
         throw;
@@ -1260,7 +1260,7 @@ Sequence< sal_Int32 > SAL_CALL OResultSet::deleteRows( const  Sequence<  Any >&
                 *pRet = 1;
             }
         }
-        catch(SQLException&)
+        catch(const SQLException&)
         {
             *pRet = 0;
         }
@@ -1351,7 +1351,7 @@ sal_Bool  OResultSet::isBookmarkable() const
             break;
         }
     }
-    catch(Exception&)
+    catch(const Exception&)
     {
         return sal_False;
     }
diff --git a/connectivity/source/drivers/odbcbase/OStatement.cxx b/connectivity/source/drivers/odbcbase/OStatement.cxx
index ec2bd0d..096f1db 100644
--- a/connectivity/source/drivers/odbcbase/OStatement.cxx
+++ b/connectivity/source/drivers/odbcbase/OStatement.cxx
@@ -62,9 +62,9 @@ using namespace ::comphelper;
     {									\
         THROW_SQL(nRetCode);			\
     }									\
-    catch(SQLException&)				\
+    catch(const SQLException&)				\
     {									\
-        OSL_FAIL("Exception in odbc catched"); \
+        OSL_FAIL("Exception in odbc caught"); \
     }
 #endif
 
@@ -269,7 +269,7 @@ SQLLEN OStatement_Base::getRowCount () throw( SQLException)
     try {
         THROW_SQL(N3SQLRowCount(m_aStatementHandle,&numRows));
     }
-    catch (SQLException&)
+    catch (const SQLException&)
     {
     }
     return numRows;
@@ -305,7 +305,7 @@ sal_Bool OStatement_Base::lockIfNecessary (const ::rtl::OUString& sql) throw( SQ
             SQLINTEGER nLock = SQL_CONCUR_LOCK;
             THROW_SQL(N3SQLSetStmtAttr(m_aStatementHandle, SQL_CONCURRENCY,(SQLPOINTER)(sal_IntPtr)nLock,SQL_IS_UINTEGER));
         }
-        catch (SQLWarning& warn)
+        catch (const SQLWarning& warn)
         {
             // Catch any warnings and place on the warning stack
             setWarning (warn);
@@ -346,7 +346,7 @@ sal_Int32 OStatement_Base::getColumnCount () throw( SQLException)
     try {
         THROW_SQL(N3SQLNumResultCols(m_aStatementHandle,&numCols));
     }
-    catch (SQLException&)
+    catch (const SQLException&)
     {
     }
     return numCols;
@@ -380,7 +380,7 @@ sal_Bool SAL_CALL OStatement_Base::execute( const ::rtl::OUString& sql ) throw(S
     try {
         THROW_SQL(N3SQLExecDirect(m_aStatementHandle, (SDB_ODBC_CHAR*)aSql.getStr(),aSql.getLength()));
     }
-    catch (SQLWarning& ex) {
+    catch (const SQLWarning& ex) {
 
         // Save pointer to warning and save with ResultSet
         // object once it is created.
@@ -617,7 +617,7 @@ sal_Bool SAL_CALL OStatement_Base::getMoreResults(  ) throw(SQLException, Runtim
     try {
         hasResultSet = N3SQLMoreResults(m_aStatementHandle) == SQL_SUCCESS;
     }
-    catch (SQLWarning &ex) {
+    catch (const SQLWarning &ex) {
 
         // Save pointer to warning and save with ResultSet
         // object once it is created.
@@ -1148,7 +1148,7 @@ SQLUINTEGER OStatement_Base::getCursorProperties(SQLINTEGER _nCursorType,sal_Boo
 
         OTools::GetInfo(getOwnConnection(),getConnectionHandle(),nAskFor,nValueLen,NULL);
     }
-    catch(Exception&)
+    catch(const Exception&)
     { // we don't want our result destroy here
         nValueLen = 0;
     }
commit d6f3bbc87b31c62acb7147d86d5945f08bfbbd8b
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Tue Apr 12 21:29:27 2011 +0100

    Resolves: #i113273# use modification time of soft link targets if linked

diff --git a/desktop/source/deployment/misc/dp_misc.cxx b/desktop/source/deployment/misc/dp_misc.cxx
index fd60788..df2c86a 100644
--- a/desktop/source/deployment/misc/dp_misc.cxx
+++ b/desktop/source/deployment/misc/dp_misc.cxx
@@ -142,6 +142,23 @@ bool existsOfficePipe()
     return pipe.is();
 }
 
+//get modification time
+static bool getModifyTimeTargetFile(const OUString &rFileURL, TimeValue &rTime)
+{
+    ::osl::DirectoryItem item;
+    if (::osl::DirectoryItem::get(rFileURL, item) != ::osl::File::E_None)
+        return false;
+
+    ::osl::FileStatus stat(FileStatusMask_ModifyTime|FileStatusMask_Type|FileStatusMask_LinkTargetURL);
+    if (item.getFileStatus(stat) != ::osl::File::E_None)
+        return false;
+
+    if( stat.getFileType() == ::osl::FileStatus::Link )
+        return getModifyTimeTargetFile(stat.getLinkTargetURL(), rTime);
+
+    rTime = stat.getModifyTime();
+    return true;
+}
 
 //Returns true if the Folder was more recently modified then
 //the lastsynchronized file. That is the repository needs to
@@ -180,15 +197,12 @@ bool compareExtensionFolderWithLastSynchronizedFile(
     
     //compare the modification time of the extension folder and the last
     //modified file
-    ::osl::FileStatus statFolder(FileStatusMask_ModifyTime);
-    ::osl::FileStatus statFile(FileStatusMask_ModifyTime);
-    if (itemExtFolder.getFileStatus(statFolder) == ::osl::File::E_None)
+    TimeValue timeFolder;
+    if (getModifyTimeTargetFile(folderURL, timeFolder))
     {
-        if (itemFile.getFileStatus(statFile) == ::osl::File::E_None)
+        TimeValue timeFile;
+        if (getModifyTimeTargetFile(fileURL, timeFile))
         {
-            TimeValue timeFolder = statFolder.getModifyTime();
-            TimeValue timeFile = statFile.getModifyTime();
-
             if (timeFile.Seconds < timeFolder.Seconds)
                 bNeedsSync = true;
         }
@@ -203,6 +217,7 @@ bool compareExtensionFolderWithLastSynchronizedFile(
         OSL_ASSERT(0);
         bNeedsSync = true;
     }
+
     return bNeedsSync;    
 }
 
commit 3c64f132e5fa17593ef07e5bb9d8ad1eeafcbfc8
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Tue Apr 12 20:21:44 2011 +0100

    WaE: various compiler warnings

diff --git a/formula/source/core/api/FormulaCompiler.cxx b/formula/source/core/api/FormulaCompiler.cxx
index 8d0236d..7b64c39 100644
--- a/formula/source/core/api/FormulaCompiler.cxx
+++ b/formula/source/core/api/FormulaCompiler.cxx
@@ -722,6 +722,7 @@ OpCode FormulaCompiler::GetEnglishOpCode( const String& rName ) const
 
 bool FormulaCompiler::IsOpCodeVolatile( OpCode eOp )
 {
+    bool bRet = false;
     switch (eOp)
     {
         // no parameters:
@@ -739,9 +740,13 @@ bool FormulaCompiler::IsOpCodeVolatile( OpCode eOp )
         case ocIndirectXL:
             // ocOffset results in indirect references.
         case ocOffset:
-            return true;
+            bRet = true;
+            break;
+        default:
+            bRet = false;
+            break;
     }
-    return false;
+    return bRet;
 }
 
 // Remove quotes, escaped quotes are unescaped.
diff --git a/formula/source/core/api/token.cxx b/formula/source/core/api/token.cxx
index 182459d..bff7d14 100644
--- a/formula/source/core/api/token.cxx
+++ b/formula/source/core/api/token.cxx
@@ -135,14 +135,19 @@ bool FormulaToken::IsMatrixFunction() const
 
 bool FormulaToken::IsExternalRef() const
 {
+    bool bRet = false;
     switch (eType)
     {
         case svExternalSingleRef:
         case svExternalDoubleRef:
         case svExternalName:
-            return true;
+            bRet = true;
+            break;
+        default:
+            bRet = false;
+            break;
     }
-    return false;
+    return bRet;
 }
 
 bool FormulaToken::operator==( const FormulaToken& rToken ) const
commit bdc3d14e53f86439f131d00d0b3e4134d9ca6679
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Tue Apr 12 16:51:31 2011 +0100

    WaE in dbg-util mode

diff --git a/svx/source/unodraw/unoshap4.cxx b/svx/source/unodraw/unoshap4.cxx
index 4051343..01b8dbf 100644
--- a/svx/source/unodraw/unoshap4.cxx
+++ b/svx/source/unodraw/unoshap4.cxx
@@ -364,7 +364,7 @@ bool SvxOle2Shape::getPropertyValueImpl( const ::rtl::OUString& rName, const Sfx
                 // usage. Removed it, former fallback is used now
                 if ( pProperty->nWID == OWN_ATTR_OLEMODEL || pProperty->nWID == OWN_ATTR_OLE_EMBEDDED_OBJECT )
                 {
-#ifdef DBG_UTIL
+#if OSL_DEBUG_LEVEL > 0
                     const sal_Bool bSuccess(pObj->AddOwnLightClient());
                     OSL_ENSURE( bSuccess, "An object without client is provided!" );
 #else
commit 87442840a8a019faf427e44c8d6817badd47ee5f
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Tue Apr 12 16:45:24 2011 +0100

    WaE in dbg-util mode

diff --git a/drawinglayer/source/primitive2d/textprimitive2d.cxx b/drawinglayer/source/primitive2d/textprimitive2d.cxx
index 131249c..fc5296e 100644
--- a/drawinglayer/source/primitive2d/textprimitive2d.cxx
+++ b/drawinglayer/source/primitive2d/textprimitive2d.cxx
@@ -254,7 +254,7 @@ namespace drawinglayer
             mbFilled(bFilled),
             mnWidthToFill(nWidthToFill)
         {
-#ifdef DBG_UTIL
+#if OSL_DEBUG_LEVEL > 0
             const xub_StrLen aStringLength(getText().Len());
             OSL_ENSURE(aStringLength >= getTextPosition() && aStringLength >= getTextPosition() + getTextLength(), 
                 "TextSimplePortionPrimitive2D with text out of range (!)");
commit 53ffcbe9dc74e37808374fd39a1428a695cbc1f0
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Tue Apr 12 16:40:07 2011 +0100

    WaE in dbgutil mode

diff --git a/editeng/source/editeng/impedit2.cxx b/editeng/source/editeng/impedit2.cxx
index cb9497e..666d630 100644
--- a/editeng/source/editeng/impedit2.cxx
+++ b/editeng/source/editeng/impedit2.cxx
@@ -3817,10 +3817,10 @@ EditPaM ImpEditEngine::GetPaM( ParaPortion* pPortion, Point aDocPos, sal_Bool bS
 
     if ( !pLine ) // may happen only in the range of SA!
     {
-        #ifdef DBG_UTIL
-         const SvxULSpaceItem& rULSpace =(const SvxULSpaceItem&)pPortion->GetNode()->GetContentAttribs().GetItem( EE_PARA_ULSPACE );
-         OSL_ENSURE( nY+GetYValue( rULSpace.GetLower() ) >= aDocPos.Y() , "Index in no line, GetPaM ?" );
-        #endif
+#if OSL_DEBUG_LEVEL > 0
+        const SvxULSpaceItem& rULSpace =(const SvxULSpaceItem&)pPortion->GetNode()->GetContentAttribs().GetItem( EE_PARA_ULSPACE );
+        OSL_ENSURE( nY+GetYValue( rULSpace.GetLower() ) >= aDocPos.Y() , "Index in no line, GetPaM ?" );
+#endif
         aPaM.SetIndex( pPortion->GetNode()->Len() );
         return aPaM;
     }


More information about the Libreoffice-commits mailing list