summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJulien Nabet <serval2412@yahoo.fr>2017-01-02 13:35:13 +0100
committerJulien Nabet <serval2412@yahoo.fr>2017-01-02 13:49:18 +0000
commit12f6247e7b0bd29434f774a4790d8cae3c87db9a (patch)
tree0bf954f9bd5d5fe2aa62b701b3988bffd0102b15
parent49968942a62f6feb6db4dcf385ddee925a57b497 (diff)
OSL_ENSURE->SAL_WARN_IF for progressbar (oox)
Change-Id: I88f143d823b83cc7db1b0ebde01f416eca84840e Reviewed-on: https://gerrit.libreoffice.org/32642 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
-rw-r--r--oox/source/helper/progressbar.cxx9
1 files changed, 4 insertions, 5 deletions
diff --git a/oox/source/helper/progressbar.cxx b/oox/source/helper/progressbar.cxx
index e62debdab2e0..162356a588bb 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;