From ef513fd4b049b214a03fbe6e62a5ea43680a7a9b Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Fri, 26 May 2017 10:58:42 +0200 Subject: remove unnecessary use of OString::getStr Change-Id: I0490efedf459190521f4339854b3394d57765fdb Reviewed-on: https://gerrit.libreoffice.org/38058 Tested-by: Jenkins Reviewed-by: Noel Grandin --- idlc/source/idlcmain.cxx | 3 +-- idlc/source/idlcproduce.cxx | 7 +++---- idlc/source/scanner.l | 4 ++-- 3 files changed, 6 insertions(+), 8 deletions(-) (limited to 'idlc') diff --git a/idlc/source/idlcmain.cxx b/idlc/source/idlcmain.cxx index 59a656aed142..038d0a0769d4 100644 --- a/idlc/source/idlcmain.cxx +++ b/idlc/source/idlcmain.cxx @@ -85,8 +85,7 @@ SAL_IMPLEMENT_MAIN_WITH_ARGS(argc, argv) OString sysFileName( convertToAbsoluteSystemPath(*i) ); if ( !options.quiet() ) - fprintf(stdout, "Compiling: %s\n", - (*i).getStr()); + fprintf(stdout, "Compiling: %s\n", (*i).getStr()); nErrors = compileFile(&sysFileName); if ( idlc()->getWarningCount() && !options.quiet() ) diff --git a/idlc/source/idlcproduce.cxx b/idlc/source/idlcproduce.cxx index e66bc9229a43..60c5ff463045 100644 --- a/idlc/source/idlcproduce.cxx +++ b/idlc/source/idlcproduce.cxx @@ -51,10 +51,9 @@ static bool checkOutputPath(const OString& completeName) sal_Int32 nIndex = 0; OString token(sysPathName.getToken(0, SEPARATOR, nIndex)); - const sal_Char* p = token.getStr(); - if (strcmp(p, "..") == 0 - || *(p+1) == ':' - || strcmp(p, ".") == 0) + if (token.startsWith("..") + || (token.getLength() >= 2 && token[1] == ':') + || token.startsWith(".")) { buffer.append(token); buffer.append(SEPARATOR); diff --git a/idlc/source/scanner.l b/idlc/source/scanner.l index 2db7f97f38cf..cfb9cb6d56ed 100644 --- a/idlc/source/scanner.l +++ b/idlc/source/scanner.l @@ -439,7 +439,7 @@ published return IDL_PUBLISHED; if ( (nIndex = docu.indexOf("/*")) >= 0 || (nIndex = docu.indexOf("///")) >= 0 ) { if ( 0 != nIndex && - (docu.getStr()[nIndex - 1] != '"' && docu.getStr()[nIndex - 1] != ':') ) + (docu[nIndex - 1] != '"' && docu[nIndex - 1] != ':') ) ErrorHandler::syntaxError(PS_NoState, idlc()->getLineNumber(), "nested documentation strings are not allowed!"); } @@ -456,7 +456,7 @@ published return IDL_PUBLISHED; if ( docu.indexOf("/*") >= 0 || docu.indexOf("//") >= 0 ) { if ( 0 != nIndex && - (docu.getStr()[nIndex - 1] != '"' && docu.getStr()[nIndex - 1] != ':') ) + (docu[nIndex - 1] != '"' && docu[nIndex - 1] != ':') ) ErrorHandler::syntaxError(PS_NoState, idlc()->getLineNumber(), "nested documentation strings are not allowed!"); } -- cgit