summaryrefslogtreecommitdiff
path: root/vcl/source/edit/textview.cxx
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2022-09-20 14:50:10 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2022-09-21 10:20:02 +0200
commit0fe36103482b6142833731e77b0d074946138538 (patch)
treeea0afbb7283404e1354e932931f493de4743cf51 /vcl/source/edit/textview.cxx
parent27a271b462c3174bfd5a96c9f5d63f6f689e0b18 (diff)
use more string_view in vcl
Change-Id: I66f96a305bb095716023ae1e565950971826bce0 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/140242 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'vcl/source/edit/textview.cxx')
-rw-r--r--vcl/source/edit/textview.cxx10
1 files changed, 5 insertions, 5 deletions
diff --git a/vcl/source/edit/textview.cxx b/vcl/source/edit/textview.cxx
index 78454f0ce495..128db7f7b088 100644
--- a/vcl/source/edit/textview.cxx
+++ b/vcl/source/edit/textview.cxx
@@ -504,7 +504,7 @@ bool TextView::KeyInput( const KeyEvent& rKeyEvent )
{
if ( !mpImpl->mbReadOnly && !rKeyEvent.GetKeyCode().IsShift() &&
!rKeyEvent.GetKeyCode().IsMod1() && !rKeyEvent.GetKeyCode().IsMod2() &&
- ImplCheckTextLen( OUString('x') ) )
+ ImplCheckTextLen( u"x" ) )
{
aCurSel = mpImpl->mpTextEngine->ImpInsertText( aCurSel, '\t', !IsInsertMode() );
bModified = true;
@@ -518,7 +518,7 @@ bool TextView::KeyInput( const KeyEvent& rKeyEvent )
// do not swallow Shift-RETURN, as this would disable multi-line entries
// in dialogs & property editors
if ( !mpImpl->mbReadOnly && !rKeyEvent.GetKeyCode().IsMod1() &&
- !rKeyEvent.GetKeyCode().IsMod2() && ImplCheckTextLen( OUString('x') ) )
+ !rKeyEvent.GetKeyCode().IsMod2() && ImplCheckTextLen( u"x" ) )
{
mpImpl->mpTextEngine->UndoActionStart();
aCurSel = mpImpl->mpTextEngine->ImpInsertParaBreak( aCurSel );
@@ -553,7 +553,7 @@ bool TextView::KeyInput( const KeyEvent& rKeyEvent )
if ( TextEngine::IsSimpleCharInput( rKeyEvent ) )
{
sal_Unicode nCharCode = rKeyEvent.GetCharCode();
- if ( !mpImpl->mbReadOnly && ImplCheckTextLen( OUString(nCharCode) ) ) // otherwise swallow the character anyway
+ if ( !mpImpl->mbReadOnly && ImplCheckTextLen( OUStringChar(nCharCode) ) ) // otherwise swallow the character anyway
{
aCurSel = mpImpl->mpTextEngine->ImpInsertText( nCharCode, aCurSel, !IsInsertMode(), true );
bModified = true;
@@ -1721,12 +1721,12 @@ bool TextView::ImplTruncateNewText( OUString& rNewText ) const
return bTruncated;
}
-bool TextView::ImplCheckTextLen( const OUString& rNewText ) const
+bool TextView::ImplCheckTextLen( std::u16string_view rNewText ) const
{
bool bOK = true;
if ( mpImpl->mpTextEngine->GetMaxTextLen() )
{
- sal_Int32 n = mpImpl->mpTextEngine->GetTextLen() + rNewText.getLength();
+ sal_Int32 n = mpImpl->mpTextEngine->GetTextLen() + rNewText.size();
if ( n > mpImpl->mpTextEngine->GetMaxTextLen() )
{
// calculate how much text is being deleted