[Libreoffice-commits] core.git: connectivity/source dbaccess/source include/connectivity
Rohan Kumar
rohankanojia420 at gmail.com
Tue Mar 8 13:31:31 UTC 2016
connectivity/source/parse/sqlbison.y | 2 +-
dbaccess/source/core/api/RowSetCache.cxx | 4 ++--
dbaccess/source/core/dataaccess/databasecontext.cxx | 15 ++++-----------
dbaccess/source/filter/xml/xmlfilter.cxx | 2 +-
dbaccess/source/ui/browser/unodatbr.cxx | 2 +-
dbaccess/source/ui/querydesign/querycontroller.cxx | 8 ++++----
include/connectivity/sqlparse.hxx | 2 +-
7 files changed, 14 insertions(+), 21 deletions(-)
New commits:
commit 576ab772555ed9f06995d9b5d605c90191500a76
Author: Rohan Kumar <rohankanojia420 at gmail.com>
Date: Mon Mar 7 21:50:41 2016 +0530
tdf#91794 Remove OSL_DEBUG_LEVEL > 1 conditionals
I either replaced OSL_DEBUG_LEVEL > 1 with OSL_DEBUG_LEVEL > 0
statements or i used SAL_INFO(..)s
Change-Id: Iefb6b83e86e1767e55600b6e1989ee91207fb220
Reviewed-on: https://gerrit.libreoffice.org/23000
Tested-by: Jenkins <ci at libreoffice.org>
Reviewed-by: jan iversen <jani at documentfoundation.org>
diff --git a/connectivity/source/parse/sqlbison.y b/connectivity/source/parse/sqlbison.y
index b5289df..9428804 100644
--- a/connectivity/source/parse/sqlbison.y
+++ b/connectivity/source/parse/sqlbison.y
@@ -4651,7 +4651,7 @@ OString OSQLParser::TokenIDToStr(sal_uInt32 nTokenID, const IParseContext* pCont
return aStr;
}
-#if OSL_DEBUG_LEVEL > 1
+#if OSL_DEBUG_LEVEL > 0
OUString OSQLParser::RuleIDToStr(sal_uInt32 nRuleID)
{
OSL_ENSURE(nRuleID < SAL_N_ELEMENTS(yytname), "OSQLParser::RuleIDToStr: Invalid nRuleId!");
diff --git a/dbaccess/source/core/api/RowSetCache.cxx b/dbaccess/source/core/api/RowSetCache.cxx
index 69d388c..1d4970a 100644
--- a/dbaccess/source/core/api/RowSetCache.cxx
+++ b/dbaccess/source/core/api/RowSetCache.cxx
@@ -1133,10 +1133,10 @@ bool ORowSetCache::last( )
OSL_ENSURE(m_bBeforeFirst,"ORowSetCache::last return false and BeforeFirst isn't true");
m_aMatrixIter = m_pMatrix->end();
}
-#if OSL_DEBUG_LEVEL > 1
+#if OSL_DEBUG_LEVEL > 0
if(bRet)
{
- OSL_ENSURE((*m_aMatrixIter).is(),"ORowSetCache::last: Row not valid!");
+ assert((*m_aMatrixIter).is() && "ORowSetCache::last: Row not valid!");
}
#endif
diff --git a/dbaccess/source/core/dataaccess/databasecontext.cxx b/dbaccess/source/core/dataaccess/databasecontext.cxx
index b12ace6..f4e92b5 100644
--- a/dbaccess/source/core/dataaccess/databasecontext.cxx
+++ b/dbaccess/source/core/dataaccess/databasecontext.cxx
@@ -685,9 +685,7 @@ Reference< XInterface > ODatabaseContext::getObject( const OUString& _rURL )
void ODatabaseContext::registerDatabaseDocument( ODatabaseModelImpl& _rModelImpl )
{
OUString sURL( _rModelImpl.getURL() );
-#if OSL_DEBUG_LEVEL > 1
- OSL_TRACE( "DatabaseContext: registering %s", OUStringToOString( sURL, RTL_TEXTENCODING_UTF8 ).getStr() );
-#endif
+ SAL_INFO("dbaccess.core", "DatabaseContext: registering " << sURL);
if ( m_aDatabaseObjects.find( sURL ) == m_aDatabaseObjects.end() )
{
m_aDatabaseObjects[ sURL ] = &_rModelImpl;
@@ -700,19 +698,14 @@ void ODatabaseContext::registerDatabaseDocument( ODatabaseModelImpl& _rModelImpl
void ODatabaseContext::revokeDatabaseDocument( const ODatabaseModelImpl& _rModelImpl )
{
OUString sURL( _rModelImpl.getURL() );
-#if OSL_DEBUG_LEVEL > 1
- OSL_TRACE( "DatabaseContext: deregistering %s", OUStringToOString( sURL, RTL_TEXTENCODING_UTF8 ).getStr() );
-#endif
+ SAL_INFO("dbaccess.core", "DatabaseContext: deregistering " << sURL);
m_aDatabaseObjects.erase( sURL );
}
void ODatabaseContext::databaseDocumentURLChange( const OUString& _rOldURL, const OUString& _rNewURL )
{
-#if OSL_DEBUG_LEVEL > 1
- OSL_TRACE( "DatabaseContext: changing registration from %s to %s",
- OUStringToOString( _rOldURL, RTL_TEXTENCODING_UTF8 ).getStr(),
- OUStringToOString( _rNewURL, RTL_TEXTENCODING_UTF8 ).getStr() );
-#endif
+ SAL_INFO("dbaccess.core", "DatabaseContext: changing registrations from " << _rOldURL <<
+ " to " << _rNewURL);
ObjectCache::iterator oldPos = m_aDatabaseObjects.find( _rOldURL );
ENSURE_OR_THROW( oldPos != m_aDatabaseObjects.end(), "illegal old database document URL" );
ObjectCache::iterator newPos = m_aDatabaseObjects.find( _rNewURL );
diff --git a/dbaccess/source/filter/xml/xmlfilter.cxx b/dbaccess/source/filter/xml/xmlfilter.cxx
index bd1d661..44a3848 100644
--- a/dbaccess/source/filter/xml/xmlfilter.cxx
+++ b/dbaccess/source/filter/xml/xmlfilter.cxx
@@ -114,7 +114,7 @@ sal_Int32 ReadThroughComponent(
}
catch (const SAXParseException& r)
{
-#if OSL_DEBUG_LEVEL > 1
+#if OSL_DEBUG_LEVEL > 0
SAL_WARN("dbaccess", "SAX parse exception catched while importing:\n" << r.Message << r.LineNumber << "," << r.ColumnNumber);
#else
(void)r;
diff --git a/dbaccess/source/ui/browser/unodatbr.cxx b/dbaccess/source/ui/browser/unodatbr.cxx
index 43e1a35..ed5b85e 100644
--- a/dbaccess/source/ui/browser/unodatbr.cxx
+++ b/dbaccess/source/ui/browser/unodatbr.cxx
@@ -3006,7 +3006,7 @@ void SbaTableQueryBrowser::unloadAndCleanup( bool _bDisposeConnection )
Reference< XPropertySet > xRowSetProps(getRowSet(),UNO_QUERY);
Reference< XConnection > xConn;
xRowSetProps->getPropertyValue(PROPERTY_ACTIVE_CONNECTION) >>= xConn;
-#if OSL_DEBUG_LEVEL > 1
+#if OSL_DEBUG_LEVEL > 0
{
Reference< XComponent > xComp(
xRowSetProps->getPropertyValue(PROPERTY_ACTIVE_CONNECTION),
diff --git a/dbaccess/source/ui/querydesign/querycontroller.cxx b/dbaccess/source/ui/querydesign/querycontroller.cxx
index 05b8bde..498a70b 100644
--- a/dbaccess/source/ui/querydesign/querycontroller.cxx
+++ b/dbaccess/source/ui/querydesign/querycontroller.cxx
@@ -138,7 +138,7 @@ extern "C" void SAL_CALL createRegistryInfo_OViewControl()
namespace dbaui
{
using namespace ::connectivity;
-#if OSL_DEBUG_LEVEL > 1
+#if OSL_DEBUG_LEVEL > 0
namespace
{
void insertParseTree(SvTreeListBox* _pBox,::connectivity::OSQLParseNode* _pNode,SvTreeListEntry* _pParent = NULL)
@@ -541,7 +541,7 @@ FeatureState OQueryController::GetState(sal_uInt16 _nId) const
aReturn.bEnabled = true;
aReturn.bChecked = getContainer() && getContainer()->getPreviewFrame().is();
break;
-#if OSL_DEBUG_LEVEL > 1
+#if OSL_DEBUG_LEVEL > 0
case ID_EDIT_QUERY_SQL:
break;
case ID_EDIT_QUERY_DESIGN:
@@ -749,7 +749,7 @@ void OQueryController::Execute(sal_uInt16 _nId, const Sequence< PropertyValue >&
{
}
break;
-#if OSL_DEBUG_LEVEL > 1
+#if OSL_DEBUG_LEVEL > 0
case ID_EDIT_QUERY_DESIGN:
case ID_EDIT_QUERY_SQL:
{
@@ -1137,7 +1137,7 @@ void OQueryController::describeSupportedFeatures()
implDescribeSupportedFeature( ".uno:DBLimit", SID_QUERY_LIMIT, CommandGroup::FORMAT );
implDescribeSupportedFeature( ".uno:DBQueryPropertiesDialog", SID_QUERY_PROP_DLG, CommandGroup::FORMAT );
-#if OSL_DEBUG_LEVEL > 1
+#if OSL_DEBUG_LEVEL > 0
implDescribeSupportedFeature( ".uno:DBShowParseTree", ID_EDIT_QUERY_SQL );
implDescribeSupportedFeature( ".uno:DBMakeDisjunct", ID_EDIT_QUERY_DESIGN );
#endif
diff --git a/include/connectivity/sqlparse.hxx b/include/connectivity/sqlparse.hxx
index 5f47f56..7ee7a4f 100644
--- a/include/connectivity/sqlparse.hxx
+++ b/include/connectivity/sqlparse.hxx
@@ -196,7 +196,7 @@ namespace connectivity
// TokenIDToStr: token name belonging to a token number.
static OString TokenIDToStr(sal_uInt32 nTokenID, const IParseContext* pContext = nullptr);
-#if OSL_DEBUG_LEVEL > 1
+#if OSL_DEBUG_LEVEL > 0
// (empty string if not found)
static OUString RuleIDToStr(sal_uInt32 nRuleID);
#endif
More information about the Libreoffice-commits
mailing list