summaryrefslogtreecommitdiff
path: root/vcl/source/window/menu.cxx
diff options
context:
space:
mode:
authorNoel <noel.grandin@collabora.co.uk>2021-01-28 12:38:01 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2021-01-28 17:32:18 +0100
commit943060836339f9640c612e9724f20e79db616e6e (patch)
tree3dc6e7748aef3ef0f2fca86979792162daa443fc /vcl/source/window/menu.cxx
parentd249bd5a3dfe13052ce9aa91bad94ec7d60604d4 (diff)
simplify code, use more subView()
Change-Id: I569c7f34acbdf8451cd5c9acf1abd334637072d1 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/110051 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'vcl/source/window/menu.cxx')
-rw-r--r--vcl/source/window/menu.cxx7
1 files changed, 2 insertions, 5 deletions
diff --git a/vcl/source/window/menu.cxx b/vcl/source/window/menu.cxx
index 825616b3d0aa..3cffab6e3b20 100644
--- a/vcl/source/window/menu.cxx
+++ b/vcl/source/window/menu.cxx
@@ -1668,11 +1668,8 @@ static OUString getShortenedString( const OUString& i_rLong, vcl::RenderContext
{
if (nPos < aNonMnem.getLength() && i_rLong[nPos+1] == aNonMnem[nPos])
{
- OUStringBuffer aBuf( i_rLong.getLength() );
- aBuf.append( std::u16string_view(aNonMnem).substr(0, nPos) );
- aBuf.append( '~' );
- aBuf.append( std::u16string_view(aNonMnem).substr(nPos) );
- aNonMnem = aBuf.makeStringAndClear();
+ OUString aTmp = OUString::Concat(aNonMnem.subView(0, nPos)) + "~" + aNonMnem.subView(nPos);
+ aNonMnem = aTmp;
}
}
return aNonMnem;