[Libreoffice-commits] core.git: accessibility/source canvas/source connectivity/source desktop/source extensions/source forms/source include/sal mysqlc/source registry/source sc/source sdext/source svtools/source svx/source unotools/source

Michaël Lefèvre lefevre00 at yahoo.fr
Fri Apr 4 05:24:11 PDT 2014


 accessibility/source/extended/textwindowaccessibility.cxx     |    7 ++++---
 canvas/source/tools/spriteredrawmanager.cxx                   |    6 ++++--
 connectivity/source/commontools/parameters.cxx                |    7 +++++--
 connectivity/source/drivers/hsqldb/HConnection.cxx            |    2 +-
 connectivity/source/drivers/kab/KDriver.cxx                   |    2 +-
 connectivity/source/drivers/macab/MacabDriver.cxx             |    2 +-
 desktop/source/deployment/registry/component/dp_component.cxx |    2 +-
 extensions/source/propctrlr/formlinkdialog.cxx                |    4 +++-
 forms/source/richtext/richtextimplcontrol.cxx                 |    2 +-
 include/sal/log-areas.dox                                     |    6 ++++++
 mysqlc/source/mysqlc_driver.cxx                               |    2 +-
 registry/source/keyimpl.cxx                                   |    2 +-
 sc/source/core/data/documen2.cxx                              |    2 +-
 sdext/source/pdfimport/wrapper/wrapper.cxx                    |    2 +-
 svtools/source/toolpanel/paneltabbar.cxx                      |    4 ++--
 svx/source/form/formcontroller.cxx                            |    2 +-
 unotools/source/config/bootstrap.cxx                          |    5 +++--
 17 files changed, 37 insertions(+), 22 deletions(-)

New commits:
commit 453ee351f32494b1f30b477069cc7a1834352377
Author: Michaël Lefèvre <lefevre00 at yahoo.fr>
Date:   Fri Apr 4 00:13:31 2014 +0200

    fdo#43157 : clean up more OSL_POSTCOND
    
    Change-Id: Iaca31b4e12c258b762b3d88fbad0fb08b4f1fc16
    Reviewed-on: https://gerrit.libreoffice.org/8832
    Reviewed-by: Caolán McNamara <caolanm at redhat.com>
    Tested-by: Caolán McNamara <caolanm at redhat.com>

diff --git a/accessibility/source/extended/textwindowaccessibility.cxx b/accessibility/source/extended/textwindowaccessibility.cxx
index e289104..fe77780 100644
--- a/accessibility/source/extended/textwindowaccessibility.cxx
+++ b/accessibility/source/extended/textwindowaccessibility.cxx
@@ -1856,9 +1856,10 @@ void Document::determineVisibleRange()
         }
     }
 
-    OSL_POSTCOND(
-            (m_aVisibleBegin == m_xParagraphs->end() && m_aVisibleEnd == m_xParagraphs->end() && m_nVisibleBeginOffset == 0)
-            || (m_aVisibleBegin < m_aVisibleEnd && m_nVisibleBeginOffset >= 0),
+    SAL_WARN_IF(
+            !((m_aVisibleBegin == m_xParagraphs->end() && m_aVisibleEnd == m_xParagraphs->end() && m_nVisibleBeginOffset == 0)
+                || (m_aVisibleBegin < m_aVisibleEnd && m_nVisibleBeginOffset >= 0)),
+            "accessibility",
             "invalid visible range");
 }
 
diff --git a/canvas/source/tools/spriteredrawmanager.cxx b/canvas/source/tools/spriteredrawmanager.cxx
index ee97967..7873883 100644
--- a/canvas/source/tools/spriteredrawmanager.cxx
+++ b/canvas/source/tools/spriteredrawmanager.cxx
@@ -366,9 +366,11 @@ namespace canvas
         ::basegfx::B2DRectangle aTotalBounds( o_rMoveStart );
         aTotalBounds.expand( o_rMoveEnd );
 
-        OSL_POSTCOND(impIsEqualB2DRange(rUpdateArea.maTotalBounds, basegfx::unotools::b2DSurroundingIntegerRangeFromB2DRange(aTotalBounds), 0.5),
+        SAL_WARN_IF(!impIsEqualB2DRange(rUpdateArea.maTotalBounds, basegfx::unotools::b2DSurroundingIntegerRangeFromB2DRange(aTotalBounds), 0.5),
+            "canvas",
             "SpriteRedrawManager::isAreaUpdateScroll(): sprite area and total area mismatch");
-        OSL_POSTCOND(impIsEqualB2DVector(o_rMoveStart.getRange(), o_rMoveEnd.getRange(), 0.5),
+        SAL_WARN_IF(!impIsEqualB2DVector(o_rMoveStart.getRange(), o_rMoveEnd.getRange(), 0.5),
+            "canvas",
             "SpriteRedrawManager::isAreaUpdateScroll(): scroll start and end area have mismatching size");
 #endif
 
diff --git a/connectivity/source/commontools/parameters.cxx b/connectivity/source/commontools/parameters.cxx
index 77599d8..09f5dca 100644
--- a/connectivity/source/commontools/parameters.cxx
+++ b/connectivity/source/commontools/parameters.cxx
@@ -322,7 +322,8 @@ namespace dbtools
             if ( bValidLink )
                 aStrippedMasterFields.push_back( *pMasterFields );
         }
-        OSL_POSTCOND( aStrippedMasterFields.size() == aStrippedDetailFields.size(),
+        SAL_WARN_IF( aStrippedMasterFields.size() != aStrippedDetailFields.size(),
+            "connectivity.commontools",
             "ParameterManager::classifyLinks: inconsistency in new link pairs!" );
 
         if ( bNeedExchangeLinks )
@@ -502,7 +503,9 @@ namespace dbtools
                 return;
             } // if ( !initializeComposerByComponent( m_xComponent ) )
         }
-        OSL_POSTCOND( m_xInnerParamColumns.is(), "ParameterManager::updateParameterInfo: initializeComposerByComponent did nonsense (1)!" );
+        SAL_WARN_IF( !m_xInnerParamColumns.is(),
+            "connectivity.commontools",
+            "ParameterManager::updateParameterInfo: initializeComposerByComponent did nonsense (1)!" );
 
         // collect all parameters which are defined by the "inner parameters"
         collectInnerParameters( false );
diff --git a/connectivity/source/drivers/hsqldb/HConnection.cxx b/connectivity/source/drivers/hsqldb/HConnection.cxx
index 407931c..aa2bc4a 100644
--- a/connectivity/source/drivers/hsqldb/HConnection.cxx
+++ b/connectivity/source/drivers/hsqldb/HConnection.cxx
@@ -265,7 +265,7 @@ namespace connectivity { namespace hsqldb
             throw WrappedTargetException( sError ,*this, ::cppu::getCaughtException() );
         }
 
-        OSL_POSTCOND( xTables.is(), "OHsqlConnection::impl_getTableContainer_throw: post condition not met!" );
+        SAL_WARN_IF( !xTables.is(), "connectivity.hsqldb", "OHsqlConnection::impl_getTableContainer_throw: post condition not met!" );
         return xTables;
     }
 
diff --git a/connectivity/source/drivers/kab/KDriver.cxx b/connectivity/source/drivers/kab/KDriver.cxx
index a4ef7ca..b023eaa 100644
--- a/connectivity/source/drivers/kab/KDriver.cxx
+++ b/connectivity/source/drivers/kab/KDriver.cxx
@@ -379,7 +379,7 @@ Reference< XConnection > SAL_CALL KabDriver::connect( const OUString& url, const
 
     // create a new connection with the given properties and append it to our vector
     KabConnection* pConnection = m_aImplModule.createConnection( this );
-    OSL_POSTCOND( pConnection, "KabDriver::connect: no connection has been created by the factory!" );
+    SAL_WARN_IF( !pConnection, "connectivity.kab", "KabDriver::connect: no connection has been created by the factory!" );
 
     // by definition, the factory function returned an object which was acquired once
     Reference< XConnection > xConnection = pConnection;
diff --git a/connectivity/source/drivers/macab/MacabDriver.cxx b/connectivity/source/drivers/macab/MacabDriver.cxx
index 08f4b51..2567a57 100644
--- a/connectivity/source/drivers/macab/MacabDriver.cxx
+++ b/connectivity/source/drivers/macab/MacabDriver.cxx
@@ -247,7 +247,7 @@ Reference< XConnection > SAL_CALL MacabDriver::connect( const OUString& url, con
 
     // create a new connection with the given properties and append it to our vector
     MacabConnection* pConnection = m_aImplModule.createConnection( this );
-    OSL_POSTCOND( pConnection, "MacabDriver::connect: no connection has been created by the factory!" );
+    SAL_WARN_IF( !pConnection, "connectivity.macab", "MacabDriver::connect: no connection has been created by the factory!" );
 
     // by definition, the factory function returned an object which was acquired once
     Reference< XConnection > xConnection = pConnection;
diff --git a/desktop/source/deployment/registry/component/dp_component.cxx b/desktop/source/deployment/registry/component/dp_component.cxx
index 5de1c6e..1f48229 100644
--- a/desktop/source/deployment/registry/component/dp_component.cxx
+++ b/desktop/source/deployment/registry/component/dp_component.cxx
@@ -1606,7 +1606,7 @@ BackendImpl::OtherPlatformPackageImpl::impl_openRDB() const
         xRegistry.set(0);
     }
 
-    OSL_POSTCOND(xRegistry.is(), "could not create registry for the package's platform");
+    SAL_WARN_IF( !xRegistry.is(), "desktop.deployment", "could not create registry for the package's platform");
     return xRegistry;
 }
 
diff --git a/extensions/source/propctrlr/formlinkdialog.cxx b/extensions/source/propctrlr/formlinkdialog.cxx
index dc608df..5a1fb98 100644
--- a/extensions/source/propctrlr/formlinkdialog.cxx
+++ b/extensions/source/propctrlr/formlinkdialog.cxx
@@ -609,7 +609,9 @@ namespace pcr
             if ( bEnable )
             {
                 bEnable = getExistingRelation( xDetailTable, xMasterTable, m_aRelationDetailColumns, m_aRelationMasterColumns );
-                OSL_POSTCOND( m_aRelationMasterColumns.getLength() == m_aRelationDetailColumns.getLength(), "FormLinkDialog::initializeSuggest: nonsense!" );
+                SAL_WARN_IF( m_aRelationMasterColumns.getLength() != m_aRelationDetailColumns.getLength(),
+                    "extensions.propctrlr",
+                    "FormLinkDialog::initializeSuggest: nonsense!" );
                 if ( m_aRelationMasterColumns.getLength() == 0 )
                 {   // okay, there is no relation "pointing" (via a foreign key) from the detail table to the master table
                     // but perhaps the other way round (would make less sense, but who knows ...)
diff --git a/forms/source/richtext/richtextimplcontrol.cxx b/forms/source/richtext/richtextimplcontrol.cxx
index cc61a35..f670701 100644
--- a/forms/source/richtext/richtextimplcontrol.cxx
+++ b/forms/source/richtext/richtextimplcontrol.cxx
@@ -193,7 +193,7 @@ namespace frm
             OSL_ENSURE( aHandler.is(), "RichTextControlImpl::enableAttributeNotification: no handler available for this attribute!" );
             if ( !aHandler.is() )
                 return;
-            OSL_POSTCOND( _nAttributeId == aHandler->getAttributeId(), "RichTextControlImpl::enableAttributeNotification: suspicious handler!" );
+            SAL_WARN_IF( _nAttributeId != aHandler->getAttributeId(), "forms.richtext", "RichTextControlImpl::enableAttributeNotification: suspicious handler!" );
 
             aHandlerPos = m_aAttributeHandlers.insert( AttributeHandlerPool::value_type( _nAttributeId , aHandler ) ).first;
         }
diff --git a/include/sal/log-areas.dox b/include/sal/log-areas.dox
index 0508fb4..39209af 100644
--- a/include/sal/log-areas.dox
+++ b/include/sal/log-areas.dox
@@ -72,6 +72,8 @@ certain functionality.
 @li @c connectivity.flat
 @li @c connectivity.hsqldb
 @li @c connectivity.jdbc
+ at li @c connectivity.kab
+ at li @c connectivity.macab
 @li @c connectivity.mork
 @li @c connectivity.parse
 @li @c connectivity.postgresql
@@ -156,6 +158,7 @@ certain functionality.
 @li @c extensions.biblio
 @li @c extensions.dbpilots
 @li @c extensions.plugin
+ at li @c extensions.propctrlr
 @li @c extensions.scanner
 @li @c extensions.update
 @li @c extensions.olebridge - OLE automation bridge
@@ -178,6 +181,7 @@ certain functionality.
 
 @li @c forms.component
 @li @c forms.misc
+ at li @c forms.richtext
 @li @c forms.runtime
 
 @section formula
@@ -461,8 +465,10 @@ certain functionality.
 @li @c drawinglayer
 @li @c helpcompiler
 @li @c linguistic
+ at li @c mysqlc
 @li @c oox
 @li @c postprocess.cppunit
+ at li @c registry
 @li @c reportdesign
 @li @c rsc
 @li @c sax
diff --git a/mysqlc/source/mysqlc_driver.cxx b/mysqlc/source/mysqlc_driver.cxx
index 850d47f..21befa0 100644
--- a/mysqlc/source/mysqlc_driver.cxx
+++ b/mysqlc/source/mysqlc_driver.cxx
@@ -217,7 +217,7 @@ Reference< XConnection > SAL_CALL MysqlCDriver::connect(const OUString& url, con
     if ( !cppDriver )
     {
         impl_initCppConn_lck_throw();
-        OSL_POSTCOND( cppDriver, "MySQLCDriver::connect: internal error." );
+        SAL_WARN_IF( !cppDriver, "mysqlc", "MySQLCDriver::connect: internal error." );
         if ( !cppDriver )
             throw RuntimeException("MySQLCDriver::connect: internal error.", *this );
     }
diff --git a/registry/source/keyimpl.cxx b/registry/source/keyimpl.cxx
index c8a3ddd..38fa3bb 100644
--- a/registry/source/keyimpl.cxx
+++ b/registry/source/keyimpl.cxx
@@ -47,7 +47,7 @@ ORegKey::ORegKey(const OUString& keyName, ORegistry* pReg)
 
 ORegKey::~ORegKey()
 {
-    OSL_POSTCOND(m_refCount == 0, "registry::ORegKey::dtor(): refcount not zero.");
+    SAL_WARN_IF(m_refCount != 0, "registry", "registry::ORegKey::dtor(): refcount not zero.");
 }
 
 
diff --git a/sc/source/core/data/documen2.cxx b/sc/source/core/data/documen2.cxx
index 745bc24..03e6160 100644
--- a/sc/source/core/data/documen2.cxx
+++ b/sc/source/core/data/documen2.cxx
@@ -444,7 +444,7 @@ ScDocument::~ScDocument()
     delete pRecursionHelper;
 
     delete pPreviewFont;
-    OSL_POSTCOND( !pAutoNameCache, "AutoNameCache still set in dtor" );
+    SAL_WARN_IF( pAutoNameCache, "sc.core", "AutoNameCache still set in dtor" );
 
     mpFormulaGroupCxt.reset();
     mpCellStringPool.reset();
diff --git a/sdext/source/pdfimport/wrapper/wrapper.cxx b/sdext/source/pdfimport/wrapper/wrapper.cxx
index bfa11ee..189b29c 100644
--- a/sdext/source/pdfimport/wrapper/wrapper.cxx
+++ b/sdext/source/pdfimport/wrapper/wrapper.cxx
@@ -878,7 +878,7 @@ void Parser::parseLine( const OString& rLine )
     }
 
     // all consumed?
-    OSL_POSTCOND(m_nCharIndex==-1,"leftover scanner input");
+    SAL_WARN_IF(m_nCharIndex!=-1, "sdext.pdfimport", "leftover scanner input");
 }
 
 oslFileError readLine( oslFileHandle pFile, OStringBuffer& line )
diff --git a/svtools/source/toolpanel/paneltabbar.cxx b/svtools/source/toolpanel/paneltabbar.cxx
index a7d51f9..05902d7 100644
--- a/svtools/source/toolpanel/paneltabbar.cxx
+++ b/svtools/source/toolpanel/paneltabbar.cxx
@@ -818,7 +818,7 @@ namespace svt
             return;
         }
         impl_calcItemRects();
-        OSL_POSTCOND( m_bItemsDirty == false, "PanelTabBar_Impl::EnsureItemsCache: cache still dirty!" );
+        SAL_WARN_IF( m_bItemsDirty , "svtools", "PanelTabBar_Impl::EnsureItemsCache: cache still dirty!" );
         DBG_CHECK( *this );
     }
 
@@ -1331,7 +1331,7 @@ namespace svt
             GrabFocus();
 
         m_pImpl->FocusItem( i_nItemPos );
-        OSL_POSTCOND( !!m_pImpl->m_aFocusedItem, "PanelTabBar::FocusPanelItem: have the focus, but no focused item?" );
+        SAL_WARN_IF( !m_pImpl->m_aFocusedItem, "svtools", "PanelTabBar::FocusPanelItem: have the focus, but no focused item?" );
         if ( !!m_pImpl->m_aFocusedItem )
             m_pImpl->InvalidateItem( *m_pImpl->m_aFocusedItem );
         m_pImpl->m_aFocusedItem.reset( i_nItemPos );
diff --git a/svx/source/form/formcontroller.cxx b/svx/source/form/formcontroller.cxx
index 4910d26..ceefb3e 100644
--- a/svx/source/form/formcontroller.cxx
+++ b/svx/source/form/formcontroller.cxx
@@ -1747,7 +1747,7 @@ void FormController::focusGained(const FocusEvent& e) throw( RuntimeException, s
     m_xActiveControl  = xControl;
 
     implSetCurrentControl( xControl );
-    OSL_POSTCOND( m_xCurrentControl.is(), "implSetCurrentControl did nonsense!" );
+    SAL_WARN_IF( !m_xCurrentControl.is(), "svx.form", "implSetCurrentControl did nonsense!" );
 
     if ( bActivated )
     {
diff --git a/unotools/source/config/bootstrap.cxx b/unotools/source/config/bootstrap.cxx
index c956cae..4c4548f 100644
--- a/unotools/source/config/bootstrap.cxx
+++ b/unotools/source/config/bootstrap.cxx
@@ -340,8 +340,9 @@ PathStatus getDerivedPath(
         _rData.getFrom(_sBootstrapParameter, _rURL, sDerivedURL);
 
         OSL_ENSURE(sDerivedURL == _rURL,"Could not set derived URL via Bootstrap default parameter");
-        OSL_POSTCOND(RTL_BOOTSTRAP_DEFAULTS_BROKEN ||
-                    (_rData.getFrom(_sBootstrapParameter,sDerivedURL) && sDerivedURL==_rURL),"Use of default did not affect bootstrap value");
+        SAL_WARN_IF( !(RTL_BOOTSTRAP_DEFAULTS_BROKEN || (_rData.getFrom(_sBootstrapParameter,sDerivedURL) && sDerivedURL==_rURL)),
+            "unotools.config",
+            "Use of default did not affect bootstrap value");
     }
     else
     {


More information about the Libreoffice-commits mailing list