summaryrefslogtreecommitdiff
path: root/idlc
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2017-05-26 10:58:42 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2017-05-28 19:44:08 +0200
commitef513fd4b049b214a03fbe6e62a5ea43680a7a9b (patch)
tree82f2ce93bc8e5fde6dce8685b633c3d643c9f069 /idlc
parent826f1bca40a01f0a249d5b6cbb7c39c11638a060 (diff)
remove unnecessary use of OString::getStr
Change-Id: I0490efedf459190521f4339854b3394d57765fdb Reviewed-on: https://gerrit.libreoffice.org/38058 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'idlc')
-rw-r--r--idlc/source/idlcmain.cxx3
-rw-r--r--idlc/source/idlcproduce.cxx7
-rw-r--r--idlc/source/scanner.l4
3 files changed, 6 insertions, 8 deletions
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!");
}