[Libreoffice-commits] core.git: oox/source
Julien Nabet
serval2412 at yahoo.fr
Mon Jan 2 13:49:42 UTC 2017
oox/source/helper/progressbar.cxx | 9 ++++-----
1 file changed, 4 insertions(+), 5 deletions(-)
New commits:
commit 12f6247e7b0bd29434f774a4790d8cae3c87db9a
Author: Julien Nabet <serval2412 at yahoo.fr>
Date: Mon Jan 2 13:35:13 2017 +0100
OSL_ENSURE->SAL_WARN_IF for progressbar (oox)
Change-Id: I88f143d823b83cc7db1b0ebde01f416eca84840e
Reviewed-on: https://gerrit.libreoffice.org/32642
Tested-by: Jenkins <ci at libreoffice.org>
Reviewed-by: Julien Nabet <serval2412 at yahoo.fr>
diff --git a/oox/source/helper/progressbar.cxx b/oox/source/helper/progressbar.cxx
index e62debd..162356a 100644
--- a/oox/source/helper/progressbar.cxx
+++ b/oox/source/helper/progressbar.cxx
@@ -19,7 +19,6 @@
#include "oox/helper/progressbar.hxx"
-#include <osl/diagnose.h>
#include <com/sun/star/task/XStatusIndicator.hpp>
#include "oox/helper/helper.hxx"
@@ -63,7 +62,7 @@ double ProgressBar::getPosition() const
void ProgressBar::setPosition( double fPosition )
{
- OSL_ENSURE( (mfPosition <= fPosition) && (fPosition <= 1.0), "ProgressBar::setPosition - invalid position" );
+ SAL_WARN_IF( (mfPosition > fPosition) || (fPosition > 1.0), "oox", "ProgressBar::setPosition - invalid position" );
mfPosition = getLimitedValue< double >( fPosition, mfPosition, 1.0 );
if( mxIndicator.is() )
mxIndicator->setValue( static_cast< sal_Int32 >( mfPosition * PROGRESS_RANGE ) );
@@ -106,7 +105,7 @@ double SubSegment::getPosition() const
void SubSegment::setPosition( double fPosition )
{
- OSL_ENSURE( (mfPosition <= fPosition) && (fPosition <= 1.0), "SubSegment::setPosition - invalid position" );
+ SAL_WARN_IF( (mfPosition > fPosition) || (fPosition > 1.0), "oox", "SubSegment::setPosition - invalid position" );
mfPosition = getLimitedValue< double >( fPosition, mfPosition, 1.0 );
mrParentProgress.setPosition( mfStartPos + mfPosition * mfLength );
}
@@ -118,7 +117,7 @@ double SubSegment::getFreeLength() const
ISegmentProgressBarRef SubSegment::createSegment( double fLength )
{
- OSL_ENSURE( (0.0 < fLength) && (fLength <= getFreeLength()), "SubSegment::createSegment - invalid length" );
+ SAL_WARN_IF( (0.0 >= fLength) || (fLength > getFreeLength()), "oox", "SubSegment::createSegment - invalid length" );
fLength = getLimitedValue< double >( fLength, 0.0, getFreeLength() );
ISegmentProgressBarRef xSegment( new prv::SubSegment( *this, mfFreeStart, fLength ) );
mfFreeStart += fLength;
@@ -150,7 +149,7 @@ double SegmentProgressBar::getFreeLength() const
ISegmentProgressBarRef SegmentProgressBar::createSegment( double fLength )
{
- OSL_ENSURE( (0.0 < fLength) && (fLength <= getFreeLength()), "SegmentProgressBar::createSegment - invalid length" );
+ SAL_WARN_IF( (0.0 >= fLength) || (fLength > getFreeLength()), "oox", "SegmentProgressBar::createSegment - invalid length" );
fLength = getLimitedValue< double >( fLength, 0.0, getFreeLength() );
ISegmentProgressBarRef xSegment( new prv::SubSegment( maProgress, mfFreeStart, fLength ) );
mfFreeStart += fLength;
More information about the Libreoffice-commits
mailing list