[Libreoffice-commits] .: 3 commits - mysqlc/source sdext/source

Thomas Arnhold tarnhold at kemper.freedesktop.org
Sun Mar 13 08:46:01 PDT 2011


 mysqlc/source/mysqlc_connection.cxx                |    4 ++--
 mysqlc/source/mysqlc_driver.cxx                    |    4 ++--
 mysqlc/source/mysqlc_general.cxx                   |    2 +-
 sdext/source/pdfimport/filterdet.cxx               |    4 ++--
 sdext/source/pdfimport/tree/drawtreevisiting.cxx   |    2 +-
 sdext/source/pdfimport/tree/imagecontainer.cxx     |    2 +-
 sdext/source/pdfimport/tree/writertreevisiting.cxx |    2 +-
 7 files changed, 10 insertions(+), 10 deletions(-)

New commits:
commit a3ed91972fff7df6043b15505f3263cc60c5ac3e
Author: Thomas Arnhold <thomas at arnhold.org>
Date:   Sat Mar 12 12:35:14 2011 +0100

    OSL_TRACE: Use format string

diff --git a/mysqlc/source/mysqlc_connection.cxx b/mysqlc/source/mysqlc_connection.cxx
index 889a376..82536d8 100644
--- a/mysqlc/source/mysqlc_connection.cxx
+++ b/mysqlc/source/mysqlc_connection.cxx
@@ -245,7 +245,7 @@ void OConnection::construct(const OUString& url, const Sequence< PropertyValue >
     }
 
     m_settings.schema = aDbName;
-    OSL_TRACE(OUStringToOString(m_settings.schema, getConnectionEncoding()).getStr());
+    OSL_TRACE("%s", OUStringToOString(m_settings.schema, getConnectionEncoding()).getStr());
 
     // Check if the server is 4.1 or above
     if (this->getMysqlVersion() < 40100) {
commit 506b5a295072e59f5f80a7183d8ce5aecb96d7fa
Author: Thomas Arnhold <thomas at arnhold.org>
Date:   Sat Mar 12 12:05:23 2011 +0100

    Move OSL_ENSURE(0,...) to OSL_FAIL(...)

diff --git a/sdext/source/pdfimport/tree/drawtreevisiting.cxx b/sdext/source/pdfimport/tree/drawtreevisiting.cxx
index 155c569..c4d7ccc 100644
--- a/sdext/source/pdfimport/tree/drawtreevisiting.cxx
+++ b/sdext/source/pdfimport/tree/drawtreevisiting.cxx
@@ -671,7 +671,7 @@ void DrawXmlOptimizer::optimizeTextElements(Element& rParent)
 {
     if( rParent.Children.empty() ) // this should not happen
     {
-        OSL_ENSURE( 0, "empty paragraph optimized" );
+        OSL_FAIL( "empty paragraph optimized" );
         return;
     }
     
diff --git a/sdext/source/pdfimport/tree/writertreevisiting.cxx b/sdext/source/pdfimport/tree/writertreevisiting.cxx
index 0585dee..cb80dd2 100644
--- a/sdext/source/pdfimport/tree/writertreevisiting.cxx
+++ b/sdext/source/pdfimport/tree/writertreevisiting.cxx
@@ -729,7 +729,7 @@ void WriterXmlOptimizer::optimizeTextElements(Element& rParent)
 {
     if( rParent.Children.empty() ) // this should not happen
     {
-        OSL_ENSURE( 0, "empty paragraph optimized" );
+        OSL_FAIL( "empty paragraph optimized" );
         return;
     }
     
commit 2a195009f69fbd2accc658a87e234d991bee5d80
Author: Thomas Arnhold <thomas at arnhold.org>
Date:   Sat Mar 12 11:29:41 2011 +0100

    Move OSL_ENSURE(false,...) to OSL_FAIL(...)

diff --git a/mysqlc/source/mysqlc_connection.cxx b/mysqlc/source/mysqlc_connection.cxx
index 83c6b2f..889a376 100644
--- a/mysqlc/source/mysqlc_connection.cxx
+++ b/mysqlc/source/mysqlc_connection.cxx
@@ -217,7 +217,7 @@ void OConnection::construct(const OUString& url, const Sequence< PropertyValue >
             #if OSL_DEBUG_LEVEL > 0
                 ::rtl::OString sMessage( "OConnection::construct: malformed URI: " );
                 sMessage += ::rtl::OUStringToOString( e.getMessage(), osl_getThreadTextEncoding() );
-                OSL_ENSURE( false, sMessage.getStr() );
+                OSL_FAIL( sMessage.getStr() );
             #endif
             }
 
diff --git a/mysqlc/source/mysqlc_driver.cxx b/mysqlc/source/mysqlc_driver.cxx
index 13a4f1a..5e41020 100644
--- a/mysqlc/source/mysqlc_driver.cxx
+++ b/mysqlc/source/mysqlc_driver.cxx
@@ -154,7 +154,7 @@ void MysqlCDriver::impl_initCppConn_lck_throw()
     // attempted to load - was it successful?
     if ( !m_hCppConnModule )
     {
-        OSL_ENSURE( false, "MysqlCDriver::impl_initCppConn_lck_throw: could not load the " CPPCONN_LIB " library!");
+        OSL_FAIL( "MysqlCDriver::impl_initCppConn_lck_throw: could not load the " CPPCONN_LIB " library!");
         throw SQLException(
             ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Unable to load the " CPPCONN_LIB " library." ) ),
             *this,
@@ -171,7 +171,7 @@ void MysqlCDriver::impl_initCppConn_lck_throw()
     const FGetMySQLDriver pFactoryFunction = (FGetMySQLDriver)( osl_getFunctionSymbol( m_hCppConnModule, sSymbolName.pData ) );
     if ( !pFactoryFunction )
     {
-        OSL_ENSURE( false, "MysqlCDriver::impl_initCppConn_lck_throw: could not find the factory symbol in " CPPCONN_LIB "!");
+        OSL_FAIL( "MysqlCDriver::impl_initCppConn_lck_throw: could not find the factory symbol in " CPPCONN_LIB "!");
         throw SQLException(
             ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( CPPCONN_LIB " is invalid: missing the driver factory function." ) ),
             *this,
diff --git a/mysqlc/source/mysqlc_general.cxx b/mysqlc/source/mysqlc_general.cxx
index 7cb6969..1f94388 100644
--- a/mysqlc/source/mysqlc_general.cxx
+++ b/mysqlc/source/mysqlc_general.cxx
@@ -154,7 +154,7 @@ int mysqlToOOOType(int cppConnType)
             return com::sun::star::sdbc::DataType::VARCHAR;
     }
 
-    OSL_ENSURE( false, "mysqlToOOOType: unhandled case, falling back to VARCHAR" );
+    OSL_FAIL( "mysqlToOOOType: unhandled case, falling back to VARCHAR" );
     return com::sun::star::sdbc::DataType::VARCHAR;
 }
 
diff --git a/sdext/source/pdfimport/filterdet.cxx b/sdext/source/pdfimport/filterdet.cxx
index e516ba4..dfc42ad 100644
--- a/sdext/source/pdfimport/filterdet.cxx
+++ b/sdext/source/pdfimport/filterdet.cxx
@@ -78,7 +78,7 @@ namespace {
             switch(nIndex)
             {
             default:
-                OSL_ENSURE(false,"Unexpected case!");
+                OSL_FAIL("Unexpected case!");
                 break;
             case DRAW_INDEX:
                 bDrawState=sal_True;
@@ -520,7 +520,7 @@ rtl::OUString SAL_CALL PDFDetector::detect( uno::Sequence< beans::PropertyValue
                     break;
 
                 default:
-                    OSL_ENSURE(false,"Unexpected case");
+                    OSL_FAIL("Unexpected case");
             }
 
             aOutTypeName = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("pdf_Portable_Document_Format") );
diff --git a/sdext/source/pdfimport/tree/imagecontainer.cxx b/sdext/source/pdfimport/tree/imagecontainer.cxx
index e31478e..39312cd 100644
--- a/sdext/source/pdfimport/tree/imagecontainer.cxx
+++ b/sdext/source/pdfimport/tree/imagecontainer.cxx
@@ -146,7 +146,7 @@ void ImageContainer::writeBase64EncodedStream( ImageId nId, EmitContext& rContex
 
     uno::Sequence<sal_Int8> aData;
     if( !(pValue->Value >>= aData) )
-        OSL_ENSURE(false,"Wrong data type");
+        OSL_FAIL("Wrong data type");
 
     rContext.rEmitter.write( encodeBase64( aData.getConstArray(), aData.getLength() ));
 }


More information about the Libreoffice-commits mailing list