From dc7ca91a0494713a057da33cf33f1a83640f6a75 Mon Sep 17 00:00:00 2001 From: Luboš Luňák Date: Tue, 30 Sep 2014 19:21:10 +0200 Subject: avoid calling OUString::copy() with length being -1 Which asserts in dbgutil build. Change-Id: I0f8205ae98c5a57c430b7d8a574e4c0019855841 --- basic/source/comp/scanner.cxx | 37 ++++++++++++++++++++----------------- 1 file changed, 20 insertions(+), 17 deletions(-) diff --git a/basic/source/comp/scanner.cxx b/basic/source/comp/scanner.cxx index 042518d394f4..6065e2692069 100644 --- a/basic/source/comp/scanner.cxx +++ b/basic/source/comp/scanner.cxx @@ -491,25 +491,28 @@ bool SbiScanner::NextSym() if( *pLine == cSep ) { pLine++; nCol++; - if( *pLine != cSep || cSep == ']' ) break; + if( *pLine != cSep || cSep == ']' ) + { + // If VBA Interop then doen't eat the [] chars + if ( cSep == ']' && bVBASupportOn ) + aSym = aLine.copy( n - 1, nCol - n + 1); + else + aSym = aLine.copy( n, nCol - n - 1 ); + // get out duplicate string delimiters + OUStringBuffer aSymBuf; + for ( sal_Int32 i = 0, len = aSym.getLength(); i < len; ++i ) + { + aSymBuf.append( aSym[i] ); + if ( aSym[i] == cSep && ( i+1 < len ) && aSym[i+1] == cSep ) + ++i; + } + aSym = aSymBuf.makeStringAndClear(); + if( cSep != ']' ) + eScanType = ( cSep == '#' ) ? SbxDATE : SbxSTRING; + break; + } } else aError = OUString(cSep), GenError( SbERR_EXPECTED ); } - // If VBA Interop then doen't eat the [] chars - if ( cSep == ']' && bVBASupportOn ) - aSym = aLine.copy( n - 1, nCol - n + 1); - else - aSym = aLine.copy( n, nCol - n - 1 ); - // get out duplicate string delimiters - OUStringBuffer aSymBuf; - for ( sal_Int32 i = 0, len = aSym.getLength(); i < len; ++i ) - { - aSymBuf.append( aSym[i] ); - if ( aSym[i] == cSep && ( i+1 < len ) && aSym[i+1] == cSep ) - ++i; - } - aSym = aSymBuf.makeStringAndClear(); - if( cSep != ']' ) - eScanType = ( cSep == '#' ) ? SbxDATE : SbxSTRING; } // invalid characters: else if( ( *pLine & 0xFF ) >= 0x7F ) -- cgit tro/collabora/co-22.05-testflight LibreOffice 核心代码仓库文档基金会
summaryrefslogtreecommitdiff
path: root/svx/source/tbxctrls
diff options
context:
space:
mode:
authorMichael Weghorn <m.weghorn@posteo.de>2021-03-03 15:28:15 +0100
committerMichael Weghorn <m.weghorn@posteo.de>2021-03-04 08:15:29 +0100
commit23548f4ff51e28fec6751604a0a28197d6680773 (patch)
tree4a6ca4fdae1cccd61d378b207f2a34b931f0ff32 /svx/source/tbxctrls
parent6065e4f400390702080c7de3bcc3de670453a347 (diff)
Related tdf#140762 Add texts for "Border style" toolbar item
Make 'GetLineStyleName' a static method of 'SvtLineListBox' and use it to retrieve and set the names for the items used in the "Border Style" dropdown button in Calc's formatting toolbar. This ensures that the corresponding names are available as tooltips and for screen readers. Change-Id: I6b775e1bcd62deefd8a8a6a778dcee426bf3a1f3 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111905 Tested-by: Michael Weghorn <m.weghorn@posteo.de> Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>