summaryrefslogtreecommitdiff
path: root/oox/source/helper
diff options
context:
space:
mode:
authorOlivier Hallot <olivier.hallot@documentfoundation.org>2012-01-01 12:55:53 -0200
committerLuboš Luňák <l.lunak@suse.cz>2012-01-02 19:17:17 +0100
commit6af59644d6508049409a03d1c4a598ea2bef521e (patch)
tree6897eaf76372c606a487ebb0135962e6c7e52cb7 /oox/source/helper
parent93d2a2eb4dd13d81b9be4f087653baecb33ead67 (diff)
Fix for fdo43460 Part XXV getLength() to isEmpty()
Please find attached a partial fix for Easy Hack FDO43460 Part XXI Module oox
Diffstat (limited to 'oox/source/helper')
-rw-r--r--oox/source/helper/attributelist.cxx14
-rw-r--r--oox/source/helper/graphichelper.cxx4
-rw-r--r--oox/source/helper/modelobjecthelper.cxx4
-rw-r--r--oox/source/helper/storagebase.cxx18
-rw-r--r--oox/source/helper/textinputstream.cxx2
5 files changed, 21 insertions, 21 deletions
diff --git a/oox/source/helper/attributelist.cxx b/oox/source/helper/attributelist.cxx
index 767c5711371e..2d7445037c77 100644
--- a/oox/source/helper/attributelist.cxx
+++ b/oox/source/helper/attributelist.cxx
@@ -172,49 +172,49 @@ OptValue< OUString > AttributeList::getXString( sal_Int32 nAttrToken ) const
OptValue< double > AttributeList::getDouble( sal_Int32 nAttrToken ) const
{
OUString aValue = mxAttribs->getOptionalValue( nAttrToken );
- bool bValid = aValue.getLength() > 0;
+ bool bValid = !aValue.isEmpty();
return OptValue< double >( bValid, bValid ? AttributeConversion::decodeDouble( aValue ) : 0.0 );
}
OptValue< sal_Int32 > AttributeList::getInteger( sal_Int32 nAttrToken ) const
{
OUString aValue = mxAttribs->getOptionalValue( nAttrToken );
- bool bValid = aValue.getLength() > 0;
+ bool bValid = !aValue.isEmpty();
return OptValue< sal_Int32 >( bValid, bValid ? AttributeConversion::decodeInteger( aValue ) : 0 );
}
OptValue< sal_uInt32 > AttributeList::getUnsigned( sal_Int32 nAttrToken ) const
{
OUString aValue = mxAttribs->getOptionalValue( nAttrToken );
- bool bValid = aValue.getLength() > 0;
+ bool bValid = !aValue.isEmpty();
return OptValue< sal_uInt32 >( bValid, AttributeConversion::decodeUnsigned( aValue ) );
}
OptValue< sal_Int64 > AttributeList::getHyper( sal_Int32 nAttrToken ) const
{
OUString aValue = mxAttribs->getOptionalValue( nAttrToken );
- bool bValid = aValue.getLength() > 0;
+ bool bValid = !aValue.isEmpty();
return OptValue< sal_Int64 >( bValid, bValid ? AttributeConversion::decodeHyper( aValue ) : 0 );
}
OptValue< sal_Int32 > AttributeList::getIntegerHex( sal_Int32 nAttrToken ) const
{
OUString aValue = mxAttribs->getOptionalValue( nAttrToken );
- bool bValid = aValue.getLength() > 0;
+ bool bValid = !aValue.isEmpty();
return OptValue< sal_Int32 >( bValid, bValid ? AttributeConversion::decodeIntegerHex( aValue ) : 0 );
}
OptValue< sal_uInt32 > AttributeList::getUnsignedHex( sal_Int32 nAttrToken ) const
{
OUString aValue = mxAttribs->getOptionalValue( nAttrToken );
- bool bValid = aValue.getLength() > 0;
+ bool bValid = !aValue.isEmpty();
return OptValue< sal_uInt32 >( bValid, bValid ? AttributeConversion::decodeUnsignedHex( aValue ) : 0 );
}
OptValue< sal_Int64 > AttributeList::getHyperHex( sal_Int32 nAttrToken ) const
{
OUString aValue = mxAttribs->getOptionalValue( nAttrToken );
- bool bValid = aValue.getLength() > 0;
+ bool bValid = !aValue.isEmpty();
return OptValue< sal_Int64 >( bValid, bValid ? AttributeConversion::decodeHyperHex( aValue ) : 0 );
}
diff --git a/oox/source/helper/graphichelper.cxx b/oox/source/helper/graphichelper.cxx
index 6ddb9860554c..ddca88f19e65 100644
--- a/oox/source/helper/graphichelper.cxx
+++ b/oox/source/helper/graphichelper.cxx
@@ -293,8 +293,8 @@ Reference< XGraphic > GraphicHelper::importGraphic( const StreamDataSequence& rG
Reference< XGraphic > GraphicHelper::importEmbeddedGraphic( const OUString& rStreamName ) const
{
Reference< XGraphic > xGraphic;
- OSL_ENSURE( rStreamName.getLength() > 0, "GraphicHelper::importEmbeddedGraphic - empty stream name" );
- if( rStreamName.getLength() > 0 )
+ OSL_ENSURE( !rStreamName.isEmpty(), "GraphicHelper::importEmbeddedGraphic - empty stream name" );
+ if( !rStreamName.isEmpty() )
{
EmbeddedGraphicMap::const_iterator aIt = maEmbeddedGraphics.find( rStreamName );
if( aIt == maEmbeddedGraphics.end() )
diff --git a/oox/source/helper/modelobjecthelper.cxx b/oox/source/helper/modelobjecthelper.cxx
index 2268bfa551c0..f0c31f900f75 100644
--- a/oox/source/helper/modelobjecthelper.cxx
+++ b/oox/source/helper/modelobjecthelper.cxx
@@ -130,7 +130,7 @@ bool ModelObjectHelper::insertLineMarker( const OUString& rMarkerName, const Pol
{
OSL_ENSURE( rMarker.Coordinates.hasElements(), "ModelObjectHelper::insertLineMarker - line marker without coordinates" );
if( rMarker.Coordinates.hasElements() )
- return maMarkerContainer.insertObject( rMarkerName, Any( rMarker ), false ).getLength() > 0;
+ return !maMarkerContainer.insertObject( rMarkerName, Any( rMarker ), false ).isEmpty();
return false;
}
@@ -151,7 +151,7 @@ OUString ModelObjectHelper::insertTransGrandient( const Gradient& rGradient )
OUString ModelObjectHelper::insertFillBitmapUrl( const OUString& rGraphicUrl )
{
- if( rGraphicUrl.getLength() > 0 )
+ if( !rGraphicUrl.isEmpty() )
return maBitmapUrlContainer.insertObject( maBitmapUrlNameBase, Any( rGraphicUrl ), true );
return OUString();
}
diff --git a/oox/source/helper/storagebase.cxx b/oox/source/helper/storagebase.cxx
index 7e5b2d0f4966..38eacaf727a4 100644
--- a/oox/source/helper/storagebase.cxx
+++ b/oox/source/helper/storagebase.cxx
@@ -110,7 +110,7 @@ bool StorageBase::isStorage() const
bool StorageBase::isRootStorage() const
{
- return implIsStorage() && (maStorageName.getLength() == 0);
+ return implIsStorage() && maStorageName.isEmpty();
}
bool StorageBase::isReadOnly() const
@@ -151,9 +151,9 @@ StorageRef StorageBase::openSubStorage( const OUString& rStorageName, bool bCrea
{
OUString aElement, aRemainder;
lclSplitFirstElement( aElement, aRemainder, rStorageName );
- if( aElement.getLength() > 0 )
+ if( !aElement.isEmpty() )
xSubStorage = getSubStorage( aElement, bCreateMissing );
- if( xSubStorage.get() && (aRemainder.getLength() > 0) )
+ if( xSubStorage.get() && !aRemainder.isEmpty() )
xSubStorage = xSubStorage->openSubStorage( aRemainder, bCreateMissing );
}
return xSubStorage;
@@ -164,9 +164,9 @@ Reference< XInputStream > StorageBase::openInputStream( const OUString& rStreamN
Reference< XInputStream > xInStream;
OUString aElement, aRemainder;
lclSplitFirstElement( aElement, aRemainder, rStreamName );
- if( aElement.getLength() > 0 )
+ if( !aElement.isEmpty() )
{
- if( aRemainder.getLength() > 0 )
+ if( !aRemainder.isEmpty() )
{
StorageRef xSubStorage = getSubStorage( aElement, false );
if( xSubStorage.get() )
@@ -192,9 +192,9 @@ Reference< XOutputStream > StorageBase::openOutputStream( const OUString& rStrea
{
OUString aElement, aRemainder;
lclSplitFirstElement( aElement, aRemainder, rStreamName );
- if( aElement.getLength() > 0 )
+ if( !aElement.isEmpty() )
{
- if( aRemainder.getLength() > 0 )
+ if( !aRemainder.isEmpty() )
{
StorageRef xSubStorage = getSubStorage( aElement, true );
if( xSubStorage.get() )
@@ -216,8 +216,8 @@ Reference< XOutputStream > StorageBase::openOutputStream( const OUString& rStrea
void StorageBase::copyToStorage( StorageBase& rDestStrg, const OUString& rElementName )
{
OSL_ENSURE( rDestStrg.isStorage() && !rDestStrg.isReadOnly(), "StorageBase::copyToStorage - invalid destination" );
- OSL_ENSURE( rElementName.getLength() > 0, "StorageBase::copyToStorage - invalid element name" );
- if( rDestStrg.isStorage() && !rDestStrg.isReadOnly() && (rElementName.getLength() > 0) )
+ OSL_ENSURE( !rElementName.isEmpty(), "StorageBase::copyToStorage - invalid element name" );
+ if( rDestStrg.isStorage() && !rDestStrg.isReadOnly() && !rElementName.isEmpty() )
{
StorageRef xSubStrg = openSubStorage( rElementName, false );
if( xSubStrg.get() )
diff --git a/oox/source/helper/textinputstream.cxx b/oox/source/helper/textinputstream.cxx
index e98ed861ed83..f374cc920f81 100644
--- a/oox/source/helper/textinputstream.cxx
+++ b/oox/source/helper/textinputstream.cxx
@@ -181,7 +181,7 @@ OUString TextInputStream::readToChar( sal_Unicode cChar, bool bIncludeChar )
a character that has been buffered in the previous call. */
OUString aString = createFinalString( mxTextStrm->readString( aDelimiters, sal_False ) );
// remove last character from string and remember it for next call
- if( !bIncludeChar && (aString.getLength() > 0) && (aString[ aString.getLength() - 1 ] == cChar) )
+ if( !bIncludeChar && !aString.isEmpty() && (aString[ aString.getLength() - 1 ] == cChar) )
{
mcPendingChar = cChar;
aString = aString.copy( 0, aString.getLength() - 1 );