summaryrefslogtreecommitdiff
path: root/vbahelper
diff options
context:
space:
mode:
Diffstat (limited to 'vbahelper')
-rw-r--r--vbahelper/source/vbahelper/vbacommandbarhelper.cxx5
1 files changed, 3 insertions, 2 deletions
diff --git a/vbahelper/source/vbahelper/vbacommandbarhelper.cxx b/vbahelper/source/vbahelper/vbacommandbarhelper.cxx
index 708b59a0da41..961288463c63 100644
--- a/vbahelper/source/vbahelper/vbacommandbarhelper.cxx
+++ b/vbahelper/source/vbahelper/vbacommandbarhelper.cxx
@@ -33,6 +33,7 @@
#include <sal/log.hxx>
#include <time.h>
#include <map>
+#include <string_view>
using namespace com::sun::star;
using namespace ooo::vba;
@@ -223,10 +224,10 @@ sal_Int32 VbaCommandBarHelper::findControlByName( const css::uno::Reference< css
}
else
{
- aBuffer.appendCopy( sLabel, 0, index );
+ aBuffer.append( std::u16string_view(sLabel).substr(0, index) );
if( bMenu )
aBuffer.append( '&' );
- aBuffer.appendCopy( sLabel, index + 1 );
+ aBuffer.append( std::u16string_view(sLabel).substr(index + 1) );
}
OUString sNewLabel = aBuffer.makeStringAndClear();
SAL_INFO("vbahelper", "VbaCommandBarHelper::findControlByName, control name: " << sNewLabel);