summaryrefslogtreecommitdiff
path: root/sd
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2022-05-01 20:34:18 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2022-05-03 09:12:32 +0200
commitddef1e2c017b7d8e421dedc1a0ce722ff4208985 (patch)
tree54e52c86e4e33bcb61eee44706117b1616e99624 /sd
parent0a6d946694e4fcb39228c5e1fec58fcfd8a45989 (diff)
add o3tl::equalsAscii
Change-Id: I042b8dcadbf7581de325c161763fe35aecde5ca2 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133694 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sd')
-rw-r--r--sd/inc/EffectMigration.hxx2
-rw-r--r--sd/source/core/EffectMigration.cxx7
-rw-r--r--sd/source/filter/eppt/pptexanimations.cxx20
-rw-r--r--sd/source/filter/eppt/pptexanimations.hxx2
-rw-r--r--sd/source/ui/unoidl/UnoDocumentSettings.cxx5
5 files changed, 19 insertions, 17 deletions
diff --git a/sd/inc/EffectMigration.hxx b/sd/inc/EffectMigration.hxx
index 7d803cb16bd9..e6e5f9fac30a 100644
--- a/sd/inc/EffectMigration.hxx
+++ b/sd/inc/EffectMigration.hxx
@@ -41,7 +41,7 @@ public:
static css::presentation::AnimationSpeed ConvertDuration( double fDuration );
static double ConvertAnimationSpeed( css::presentation::AnimationSpeed eSpeed );
- static bool ConvertPreset( const OUString& rPresetId, const OUString* pPresetSubType, css::presentation::AnimationEffect& rEffect );
+ static bool ConvertPreset( std::u16string_view rPresetId, const OUString* pPresetSubType, css::presentation::AnimationEffect& rEffect );
static bool ConvertAnimationEffect( const css::presentation::AnimationEffect& rEffect, OUString& rPresetId, OUString& rPresetSubType );
static void SetFadeEffect( SdPage* pPage, css::presentation::FadeEffect eNewEffect);
diff --git a/sd/source/core/EffectMigration.cxx b/sd/source/core/EffectMigration.cxx
index 326fa74abcec..d0eac5055c39 100644
--- a/sd/source/core/EffectMigration.cxx
+++ b/sd/source/core/EffectMigration.cxx
@@ -25,6 +25,7 @@
#include <com/sun/star/animations/AnimationFill.hpp>
#include <com/sun/star/animations/XAnimate.hpp>
#include <com/sun/star/beans/NamedValue.hpp>
+#include <o3tl/string_view.hxx>
#include <tools/debug.hxx>
#include <svx/unoshape.hxx>
#include <svx/svdotext.hxx>
@@ -751,16 +752,16 @@ AnimationEffect EffectMigration::GetTextAnimationEffect( SvxShape* pShape )
return eEffect;
}
-bool EffectMigration::ConvertPreset( const OUString& rPresetId, const OUString* pPresetSubType, AnimationEffect& rEffect )
+bool EffectMigration::ConvertPreset( std::u16string_view rPresetId, const OUString* pPresetSubType, AnimationEffect& rEffect )
{
rEffect = AnimationEffect_NONE;
- if( !rPresetId.isEmpty() )
+ if( !rPresetId.empty() )
{
// first try a match for preset id and subtype
deprecated_AnimationEffect_conversion_table_entry const * p = deprecated_AnimationEffect_conversion_table;
while( p->mpPresetId )
{
- if( rPresetId.equalsAscii( p->mpPresetId ) &&
+ if( o3tl::equalsAscii( rPresetId, p->mpPresetId ) &&
(( p->mpPresetSubType == nullptr ) ||
( pPresetSubType == nullptr) ||
( pPresetSubType->equalsAscii( p->mpPresetSubType )) ) )
diff --git a/sd/source/filter/eppt/pptexanimations.cxx b/sd/source/filter/eppt/pptexanimations.cxx
index bbab0ed2d8b9..99fe0b4437c2 100644
--- a/sd/source/filter/eppt/pptexanimations.cxx
+++ b/sd/source/filter/eppt/pptexanimations.cxx
@@ -138,7 +138,7 @@ static void ImplTranslateAttribute( OUString& rString, const TranslateMode eTran
}
}
-sal_uInt32 AnimationExporter::TranslatePresetSubType( const sal_uInt32 nPresetClass, const sal_uInt32 nPresetId, const OUString& rPresetSubType )
+sal_uInt32 AnimationExporter::TranslatePresetSubType( const sal_uInt32 nPresetClass, const sal_uInt32 nPresetId, std::u16string_view rPresetSubType )
{
sal_uInt32 nPresetSubType = 0;
bool bTranslated = false;
@@ -151,12 +151,12 @@ sal_uInt32 AnimationExporter::TranslatePresetSubType( const sal_uInt32 nPresetCl
{
case 5 :
{
- if ( rPresetSubType == "downward" )
+ if ( rPresetSubType == u"downward" )
{
nPresetSubType = 5;
bTranslated = true;
}
- else if ( rPresetSubType == "across" )
+ else if ( rPresetSubType == u"across" )
{
nPresetSubType = 10;
bTranslated = true;
@@ -165,7 +165,7 @@ sal_uInt32 AnimationExporter::TranslatePresetSubType( const sal_uInt32 nPresetCl
break;
case 17 :
{
- if ( rPresetSubType == "across" )
+ if ( rPresetSubType == u"across" )
{
nPresetSubType = 10;
bTranslated = true;
@@ -174,22 +174,22 @@ sal_uInt32 AnimationExporter::TranslatePresetSubType( const sal_uInt32 nPresetCl
break;
case 18 :
{
- if ( rPresetSubType == "right-to-top" )
+ if ( rPresetSubType == u"right-to-top" )
{
nPresetSubType = 3;
bTranslated = true;
}
- else if ( rPresetSubType == "right-to-bottom" )
+ else if ( rPresetSubType == u"right-to-bottom" )
{
nPresetSubType = 6;
bTranslated = true;
}
- else if ( rPresetSubType == "left-to-top" )
+ else if ( rPresetSubType == u"left-to-top" )
{
nPresetSubType = 9;
bTranslated = true;
}
- else if ( rPresetSubType == "left-to-bottom" )
+ else if ( rPresetSubType == u"left-to-bottom" )
{
nPresetSubType = 12;
bTranslated = true;
@@ -203,7 +203,7 @@ sal_uInt32 AnimationExporter::TranslatePresetSubType( const sal_uInt32 nPresetCl
const oox::ppt::convert_subtype* p = oox::ppt::convert_subtype::getList();
while( p->mpStrSubType )
{
- if ( rPresetSubType.equalsAscii( p->mpStrSubType ) )
+ if ( o3tl::equalsAscii( rPresetSubType, p->mpStrSubType ) )
{
nPresetSubType = p->mnID;
bTranslated = true;
@@ -214,7 +214,7 @@ sal_uInt32 AnimationExporter::TranslatePresetSubType( const sal_uInt32 nPresetCl
}
}
if ( !bTranslated )
- nPresetSubType = rPresetSubType.toUInt32();
+ nPresetSubType = o3tl::toUInt32(rPresetSubType);
return nPresetSubType;
}
diff --git a/sd/source/filter/eppt/pptexanimations.hxx b/sd/source/filter/eppt/pptexanimations.hxx
index dd09acd5ad3c..daa54d85b8c5 100644
--- a/sd/source/filter/eppt/pptexanimations.hxx
+++ b/sd/source/filter/eppt/pptexanimations.hxx
@@ -122,7 +122,7 @@ public:
static bool GetNodeType( const css::uno::Reference< css::animations::XAnimationNode >& xNode, sal_Int16& nType );
static sal_Int16 GetFillMode( const css::uno::Reference< css::animations::XAnimationNode >& xNode, const sal_Int16 nFillDefault );
static void GetUserData( const css::uno::Sequence< css::beans::NamedValue >& rUserData, const css::uno::Any ** pAny, std::size_t nLen );
- static sal_uInt32 TranslatePresetSubType( const sal_uInt32 nPresetClass, const sal_uInt32 nPresetId, const OUString& rPresetSubType );
+ static sal_uInt32 TranslatePresetSubType( const sal_uInt32 nPresetClass, const sal_uInt32 nPresetId, std::u16string_view rPresetSubType );
static sal_uInt32 GetPresetID( const OUString& rPreset, sal_uInt32 nAPIPresetClass, bool& bPresetId );
static sal_uInt32 GetValueTypeForAttributeName( const OUString& rAttributeName );
diff --git a/sd/source/ui/unoidl/UnoDocumentSettings.cxx b/sd/source/ui/unoidl/UnoDocumentSettings.cxx
index 6b0f64471721..e05cfaf3b5eb 100644
--- a/sd/source/ui/unoidl/UnoDocumentSettings.cxx
+++ b/sd/source/ui/unoidl/UnoDocumentSettings.cxx
@@ -32,6 +32,7 @@
#include <cppuhelper/supportsservice.hxx>
#include <comphelper/propertysethelper.hxx>
#include <comphelper/propertysetinfo.hxx>
+#include <o3tl/string_view.hxx>
#include <tools/debug.hxx>
#include <tools/urlobj.hxx>
#include <svx/xtable.hxx>
@@ -289,10 +290,10 @@ struct {
{ "BitmapTableURL", XPropertyListType::Bitmap }
};
-static XPropertyListType getTypeOfName( const OUString &aName )
+static XPropertyListType getTypeOfName( std::u16string_view aName )
{
for(const auto & rURLPropertyName : aURLPropertyNames) {
- if( aName.equalsAscii( rURLPropertyName.pName ) )
+ if( o3tl::equalsAscii( aName, rURLPropertyName.pName ) )
return rURLPropertyName.t;
}
return XPropertyListType::Unknown;