Kaydet (Commit) 22547d05 authored tarafından Matteo Casalin's avatar Matteo Casalin

Avoid getTokenCount in CustomAnimationPreset::getProperties/hasProperty

Change-Id: Ic5b9c152ef2faf8333ad797232e26b817668e965
üst 77ca5fec
...@@ -32,7 +32,6 @@ ...@@ -32,7 +32,6 @@
#include <comphelper/getexpandeduri.hxx> #include <comphelper/getexpandeduri.hxx>
#include <comphelper/processfactory.hxx> #include <comphelper/processfactory.hxx>
#include <comphelper/random.hxx> #include <comphelper/random.hxx>
#include <comphelper/string.hxx>
#include <unotools/pathoptions.hxx> #include <unotools/pathoptions.hxx>
#include <tools/stream.hxx> #include <tools/stream.hxx>
...@@ -199,28 +198,31 @@ Reference< XAnimationNode > CustomAnimationPreset::create( const OUString& rstrS ...@@ -199,28 +198,31 @@ Reference< XAnimationNode > CustomAnimationPreset::create( const OUString& rstrS
UStringList CustomAnimationPreset::getProperties() const UStringList CustomAnimationPreset::getProperties() const
{ {
OUString aProperties( maProperty );
sal_uInt16 nTokens = comphelper::string::getTokenCount(aProperties, ';');
sal_uInt16 nToken;
UStringList aPropertyList; UStringList aPropertyList;
for( nToken = 0; nToken < nTokens; nToken++ ) if (!maProperty.isEmpty())
aPropertyList.push_back( aProperties.getToken( nToken, ';' ) ); {
sal_Int32 nPos = 0;
do
{
aPropertyList.push_back(maProperty.getToken(0, ';', nPos));
}
while (nPos >= 0);
}
return aPropertyList; return aPropertyList;
} }
bool CustomAnimationPreset::hasProperty( const OUString& rProperty )const bool CustomAnimationPreset::hasProperty( const OUString& rProperty )const
{ {
OUString aProperties( maProperty ); if (maProperty.isEmpty())
OUString aProperty( rProperty ); return false;
sal_uInt16 nTokens = comphelper::string::getTokenCount(aProperties, ';');
sal_uInt16 nToken; sal_Int32 nPos = 0;
for( nToken = 0; nToken < nTokens; nToken++ ) do
{ {
if( aProperties.getToken( nToken, ';' ) == aProperty ) if (maProperty.getToken(0, ';', nPos) == rProperty)
return true; return true;
} }
while (nPos >= 0);
return false; return false;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment