[Libreoffice-commits] core.git: chart2/source

Rohan Kumar rohankanojia420 at gmail.com
Thu Apr 14 09:25:59 UTC 2016


 chart2/source/controller/accessibility/AccessibleBase.cxx |   25 ++------------
 chart2/source/controller/dialogs/DataBrowserModel.cxx     |    4 --
 chart2/source/controller/main/ChartController.cxx         |    6 ---
 chart2/source/model/main/BaseCoordinateSystem.cxx         |    3 -
 chart2/source/model/template/BubbleDataInterpreter.cxx    |    4 +-
 chart2/source/model/template/DataInterpreter.cxx          |   10 ++---
 chart2/source/model/template/XYDataInterpreter.cxx        |    4 +-
 chart2/source/tools/InternalData.cxx                      |    2 -
 chart2/source/tools/WrappedPropertySet.cxx                |    8 +---
 9 files changed, 17 insertions(+), 49 deletions(-)

New commits:
commit 81c9d54db34647fb1db311b228de6749c089dcf8
Author: Rohan Kumar <rohankanojia420 at gmail.com>
Date:   Tue Apr 12 11:31:44 2016 +0530

    tdf#91794 removed OSL_DEBUG_LEVEL > 1 conditionals
    
    Removed OSL_DEBUG_LEVEL > 1 conditionals to reduce the
    problem of multiple debug levels
    
    Change-Id: I453f74198e08308c3891e923ebaee58a276e34ad
    Reviewed-on: https://gerrit.libreoffice.org/22616
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Markus Mohrhard <markus.mohrhard at googlemail.com>

diff --git a/chart2/source/controller/accessibility/AccessibleBase.cxx b/chart2/source/controller/accessibility/AccessibleBase.cxx
index 587a827..7fba2be 100644
--- a/chart2/source/controller/accessibility/AccessibleBase.cxx
+++ b/chart2/source/controller/accessibility/AccessibleBase.cxx
@@ -126,13 +126,7 @@ bool AccessibleBase::NotifyEvent( EventType eEventType, const AccessibleUniqueId
             case OBJECT_CHANGE:
                 {
                     BroadcastAccEvent( AccessibleEventId::VISIBLE_DATA_CHANGED, aEmpty, aEmpty );
-#if OSL_DEBUG_LEVEL > 1
-                    OSL_TRACE(
-                        OUStringToOString(
-                            OUString( "Visible data event sent by: " ) +
-                            getAccessibleName(),
-                            RTL_TEXTENCODING_ASCII_US ).getStr() );
-#endif
+                    SAL_INFO("chart2.accessibility", "Visible data event sent by: " << getAccessibleName());
                 }
                 break;
 
@@ -144,13 +138,8 @@ bool AccessibleBase::NotifyEvent( EventType eEventType, const AccessibleUniqueId
                     AddState( AccessibleStateType::FOCUSED );
                     aSelected <<= AccessibleStateType::FOCUSED;
                     BroadcastAccEvent( AccessibleEventId::STATE_CHANGED, aSelected, aEmpty, true );
-#if OSL_DEBUG_LEVEL > 1
-                    OSL_TRACE(
-                        OUStringToOString(
-                            OUString( "Selection acquired by: " ) +
-                            getAccessibleName(),
-                            RTL_TEXTENCODING_ASCII_US ).getStr() );
-#endif
+
+                    SAL_INFO("chart2.accessibility", "Selection acquired by: " << getAccessibleName());
                 }
                 break;
 
@@ -162,13 +151,7 @@ bool AccessibleBase::NotifyEvent( EventType eEventType, const AccessibleUniqueId
                     AddState( AccessibleStateType::FOCUSED );
                     aSelected <<= AccessibleStateType::FOCUSED;
                     BroadcastAccEvent( AccessibleEventId::STATE_CHANGED, aEmpty, aSelected, true );
-#if OSL_DEBUG_LEVEL > 1
-                    OSL_TRACE(
-                        OUStringToOString(
-                            OUString( "Selection lost by: " ) +
-                            getAccessibleName(),
-                            RTL_TEXTENCODING_ASCII_US ).getStr() );
-#endif
+                    SAL_INFO("chart2.accessibility", "Selection lost by: " << getAccessibleName());
                 }
                 break;
 
diff --git a/chart2/source/controller/dialogs/DataBrowserModel.cxx b/chart2/source/controller/dialogs/DataBrowserModel.cxx
index b16c6cc..8ec2ca3 100644
--- a/chart2/source/controller/dialogs/DataBrowserModel.cxx
+++ b/chart2/source/controller/dialogs/DataBrowserModel.cxx
@@ -51,10 +51,6 @@
 
 #include <algorithm>
 
-#if OSL_DEBUG_LEVEL > 1
-#include <cstdio>
-#endif
-
 using namespace ::com::sun::star;
 
 using ::com::sun::star::uno::Reference;
diff --git a/chart2/source/controller/main/ChartController.cxx b/chart2/source/controller/main/ChartController.cxx
index 0007569..b2fd677 100644
--- a/chart2/source/controller/main/ChartController.cxx
+++ b/chart2/source/controller/main/ChartController.cxx
@@ -202,11 +202,7 @@ void ChartController::TheModel::tryTermination()
                 //since we have indicated to give up the ownership with parameter true in close call
                 //the one who has thrown the CloseVetoException is the new owner
 
-#if OSL_DEBUG_LEVEL > 1
-                OSL_ENSURE( !m_bOwnership,
-                    "INFO: a well known owner has caught a CloseVetoException after calling close(true)" );
-#endif
-
+                SAL_WARN_IF( m_bOwnership, "chart2.main", "a well known owner has caught a CloseVetoException after calling close(true)");
                 m_bOwnership                = false;
                 return;
             }
diff --git a/chart2/source/model/main/BaseCoordinateSystem.cxx b/chart2/source/model/main/BaseCoordinateSystem.cxx
index cbd9f7d..6eb5cae 100644
--- a/chart2/source/model/main/BaseCoordinateSystem.cxx
+++ b/chart2/source/model/main/BaseCoordinateSystem.cxx
@@ -30,9 +30,6 @@
 #include <algorithm>
 #include <iterator>
 
-#if OSL_DEBUG_LEVEL > 1
-#include <rtl/math.hxx>
-#endif
 #include <com/sun/star/beans/PropertyAttribute.hpp>
 
 using namespace ::com::sun::star;
diff --git a/chart2/source/model/template/BubbleDataInterpreter.cxx b/chart2/source/model/template/BubbleDataInterpreter.cxx
index 2465041..910430a 100644
--- a/chart2/source/model/template/BubbleDataInterpreter.cxx
+++ b/chart2/source/model/template/BubbleDataInterpreter.cxx
@@ -250,11 +250,11 @@ chart2::InterpretedData SAL_CALL BubbleDataInterpreter::reinterpretDataSeries(
             Sequence< Reference< data::XLabeledDataSequence > > aSeqs( xSeriesSource->getDataSequences());
             if( aSeqs.getLength() != aNewSequences.getLength() )
             {
-#if OSL_DEBUG_LEVEL > 1
+#if OSL_DEBUG_LEVEL > 0
                 sal_Int32 j=0;
                 for( ; j<aSeqs.getLength(); ++j )
                 {
-                    OSL_ENSURE( aSeqs[j] == xValuesY || aSeqs[j] == xValuesX || aSeqs[j] == xValuesSize, "All sequences should be used" );
+                    assert( (aSeqs[j] == xValuesY || aSeqs[j] == xValuesX || aSeqs[j] == xValuesSize) && "All sequences should be used" );
                 }
 #endif
                 Reference< data::XDataSink > xSink( xSeriesSource, uno::UNO_QUERY_THROW );
diff --git a/chart2/source/model/template/DataInterpreter.cxx b/chart2/source/model/template/DataInterpreter.cxx
index 25a1c8b4..d8ea1c46 100644
--- a/chart2/source/model/template/DataInterpreter.cxx
+++ b/chart2/source/model/template/DataInterpreter.cxx
@@ -40,7 +40,7 @@ using namespace ::chart::ContainerHelper;
 using ::com::sun::star::uno::Reference;
 using ::com::sun::star::uno::Sequence;
 
-#if OSL_DEBUG_LEVEL > 1
+#ifdef DEBUG_CHART2_TEMPLATE
 namespace
 {
 void lcl_ShowDataSource( const Reference< data::XDataSource > & xSource );
@@ -68,7 +68,7 @@ InterpretedData SAL_CALL DataInterpreter::interpretDataSource(
     if( ! xSource.is())
         return InterpretedData();
 
-#if OSL_DEBUG_LEVEL > 1
+#ifdef DEBUG_CHART2_TEMPLATE
     lcl_ShowDataSource( xSource );
 #endif
 
@@ -172,11 +172,11 @@ InterpretedData SAL_CALL DataInterpreter::reinterpretDataSeries(
             Sequence< Reference< data::XLabeledDataSequence > > aSeqs( xSeriesSource->getDataSequences());
             if( aSeqs.getLength() != aNewSequences.getLength() )
             {
-#if OSL_DEBUG_LEVEL > 1
+#ifdef DEBUG_CHART2_TEMPLATE
                 sal_Int32 j=0;
                 for( ; j<aSeqs.getLength(); ++j )
                 {
-                    OSL_ENSURE( aSeqs[j] == xValuesY, "All sequences should be used" );
+                    assert( aSeqs[j] == xValuesY && "All sequences should be used" );
                 }
 #endif
                 Reference< data::XDataSink > xSink( xSeriesSource, uno::UNO_QUERY_THROW );
@@ -413,7 +413,7 @@ css::uno::Sequence< OUString > SAL_CALL DataInterpreter::getSupportedServiceName
 
 } // namespace chart
 
-#if OSL_DEBUG_LEVEL > 1
+#ifdef DEBUG_CHART2_TEMPLATE
 namespace
 {
 
diff --git a/chart2/source/model/template/XYDataInterpreter.cxx b/chart2/source/model/template/XYDataInterpreter.cxx
index a30a445..e291eaf 100644
--- a/chart2/source/model/template/XYDataInterpreter.cxx
+++ b/chart2/source/model/template/XYDataInterpreter.cxx
@@ -211,11 +211,11 @@ chart2::InterpretedData SAL_CALL XYDataInterpreter::reinterpretDataSeries(
             Sequence< Reference< data::XLabeledDataSequence > > aSeqs( xSeriesSource->getDataSequences());
             if( aSeqs.getLength() != aNewSequences.getLength() )
             {
-#if OSL_DEBUG_LEVEL > 1
+#ifdef DBG_UTIL
                 sal_Int32 j=0;
                 for( ; j<aSeqs.getLength(); ++j )
                 {
-                    OSL_ENSURE( aSeqs[j] == xValuesY || aSeqs[j] == xValuesX, "All sequences should be used" );
+                    SAL_WARN_IF((aSeqs[j] == xValuesY || aSeqs[j] == xValuesX), "chart2.template", "All sequences should be used" );
                 }
 #endif
                 Reference< data::XDataSink > xSink( xSeriesSource, uno::UNO_QUERY_THROW );
diff --git a/chart2/source/tools/InternalData.cxx b/chart2/source/tools/InternalData.cxx
index a134240..b6cb49f 100644
--- a/chart2/source/tools/InternalData.cxx
+++ b/chart2/source/tools/InternalData.cxx
@@ -22,7 +22,7 @@
 #include "Strings.hrc"
 
 #include <rtl/math.hxx>
-#if OSL_DEBUG_LEVEL > 1
+#ifdef DEBUG_CHART2_TOOLS
 #define DEBUG_INTERNAL_DATA 1
 #endif
 
diff --git a/chart2/source/tools/WrappedPropertySet.cxx b/chart2/source/tools/WrappedPropertySet.cxx
index 06b9898..2fe07d7 100644
--- a/chart2/source/tools/WrappedPropertySet.cxx
+++ b/chart2/source/tools/WrappedPropertySet.cxx
@@ -105,9 +105,7 @@ void SAL_CALL WrappedPropertySet::setPropertyValue( const OUString& rPropertyNam
             xInnerPropertySet->setPropertyValue( rPropertyName, rValue );
         else
         {
-#if OSL_DEBUG_LEVEL > 1
-            OSL_FAIL("found no inner property set to map to");
-#endif
+            SAL_WARN("chart2.tools", "found no inner property set to map to");
         }
     }
     catch( const beans::UnknownPropertyException& )
@@ -154,9 +152,7 @@ Any SAL_CALL WrappedPropertySet::getPropertyValue( const OUString& rPropertyName
             aRet = xInnerPropertySet->getPropertyValue( rPropertyName );
         else
         {
-#if OSL_DEBUG_LEVEL > 1
-            OSL_FAIL("found no inner property set to map to");
-#endif
+            SAL_WARN("chart2.tools", "found no inner property set to map to");
         }
     }
     catch( const beans::UnknownPropertyException& )


More information about the Libreoffice-commits mailing list