summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAriel Constenla-Haile <arielch@apache.org>2013-10-15 21:17:30 +0000
committerAriel Constenla-Haile <arielch@apache.org>2013-10-15 21:17:30 +0000
commita17e221225915c140c7840904cb9b46d75731edc (patch)
tree013e4b52605b6a25a0faf5c880b08b072792038d
parent2fc5d2946561258b012b80443cac025d851afda8 (diff)
i122759 - Pass the Sequence by reference
Despite it's name, rProperties, the Sequence is not a reference in the function signature. Besides, some small improvements: - remove the unused code related to the "Flags" - instead of compareToAscii, use equalsAsciiL, which is optimized for performance
Notes
-rw-r--r--cui/source/options/optsave.cxx35
1 files changed, 16 insertions, 19 deletions
diff --git a/cui/source/options/optsave.cxx b/cui/source/options/optsave.cxx
index a67b864b75a2..99d58e6be460 100644
--- a/cui/source/options/optsave.cxx
+++ b/cui/source/options/optsave.cxx
@@ -655,32 +655,29 @@ IMPL_LINK( SfxSaveTabPage, AutoClickHdl_Impl, CheckBox *, pBox )
/* -----------------------------05.04.01 13:10--------------------------------
---------------------------------------------------------------------------*/
-OUString lcl_ExtracUIName(const Sequence<PropertyValue> rProperties)
+OUString lcl_ExtracUIName(const Sequence<PropertyValue> &rProperties)
{
- OUString sRet;
- sal_Int32 nFlags;
- const PropertyValue* pProperties = rProperties.getConstArray();
- for(int nProp = 0; nProp < rProperties.getLength(); nProp++)
+ OUString sName;
+ const PropertyValue* pPropVal = rProperties.getConstArray();
+ const PropertyValue* const pEnd = pPropVal + rProperties.getLength();
+ for( ; pPropVal != pEnd; pPropVal++ )
{
- if(!pProperties[nProp].Name.compareToAscii("UIName"))
+ const OUString &rName = pPropVal->Name;
+ if( rName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "UIName" ) ) )
{
- if ( pProperties[nProp].Value >>= sRet )
- break;
+ OUString sUIName;
+ if ( ( pPropVal->Value >>= sUIName ) && sUIName.getLength() )
+ return sUIName;
}
- else if(!pProperties[nProp].Name.compareToAscii("Flags"))
+ else if( rName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "Name" ) ) )
{
- if ( pProperties[nProp].Value >>= nFlags )
- {
- nFlags &= 0x100;
- }
- }
- else if(!pProperties[nProp].Name.compareToAscii("Name"))
- {
- if ( !sRet.getLength() )
- pProperties[nProp].Value >>= sRet;
+ pPropVal->Value >>= sName;
}
}
- return sRet;
+
+ OSL_ENSURE( false, "Filter without UIName!" );
+
+ return sName;
}
/* -----------------------------05.04.01 13:37--------------------------------