From 5405bd8cb81f09d1631aeebd95bd6b00926ae931 Mon Sep 17 00:00:00 2001 From: Mike Kaganski Date: Mon, 18 Jan 2021 09:29:45 +0100 Subject: [PATCH] Get the rest directly from startsWith Change-Id: Ie93fa23778dc224631c25dd1e9794a1af8ff4b99 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/109514 Tested-by: Jenkins Reviewed-by: Mike Kaganski --- editeng/source/uno/unofield.cxx | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/editeng/source/uno/unofield.cxx b/editeng/source/uno/unofield.cxx index 9fdc097132da..59772b594490 100644 --- a/editeng/source/uno/unofield.cxx +++ b/editeng/source/uno/unofield.cxx @@ -905,16 +905,13 @@ uno::Reference< uno::XInterface > SvxUnoTextCreateTextField( const OUString& Ser { uno::Reference< uno::XInterface > xRet; - const OUString aTextFieldPrexit( "com.sun.star.text.textfield." ); - // #i93308# up to OOo 3.2 we used this wrong namespace name with the capital T & F. This is // fixed since OOo 3.2 but for compatibility we will still provide support for the wrong notation. - if( (ServiceSpecifier.startsWith( aTextFieldPrexit )) || - (ServiceSpecifier.startsWith( "com.sun.star.text.TextField." )) ) + OUString aFieldType; + if( (ServiceSpecifier.startsWith( "com.sun.star.text.textfield.", &aFieldType )) || + (ServiceSpecifier.startsWith( "com.sun.star.text.TextField.", &aFieldType )) ) { - OUString aFieldType( ServiceSpecifier.copy( aTextFieldPrexit.getLength() ) ); - sal_Int32 nId = text::textfield::Type::UNSPECIFIED; if ( aFieldType == "DateTime" )