Commit Graph

22 Commits

Author SHA1 Message Date
Norbert Thiebaud
8df4ce0ebe coverity#1130481 : Uninitialized scalar field
Change-Id: I41025a3dfe16af9417b1ae8c7668c76cb501c7b9
2014-01-26 22:40:27 -06:00
Noel Grandin
6eac9deadd remove unnecessary RTL_CONSTASCII_STRINGPARAM in OUString::equalsL
Convert code like this:
    if (aStr.equalsL(RTL_CONSTASCII_STRINGPARAM("rem")))
to:
    if (aStr == "rem")
which compiles down to the same code.

Change-Id: I2dfa0f0a457c465948ecf720daaa45ff29d69de9
2013-11-21 13:29:29 +02:00
Noel Grandin
d454834895 Revert "remove RTL_CONSTASCII_STRINGPARAM in OString::equalsL calls"
This reverts commit acebbee971.

I mistakenly converted OUString::equalsL calls to OUString::startsWith
calls.
2013-11-20 16:38:28 +02:00
Noel Grandin
acebbee971 remove RTL_CONSTASCII_STRINGPARAM in OString::equalsL calls
Convert code like:
    if (aByteStr.equalsL(RTL_CONSTASCII_STRINGPARAM("rem")))
to:
    if (aByteStr.startsWith("rem"))

Change-Id: I09e40b3fdc87d59a8176c2a5f39cc6aa5cf5a576
2013-11-20 13:56:08 +02:00
Stephan Bergmann
a2f9c446b7 Some clean-up
Change-Id: I8ef80b7ae952428a62cc1cea8b03219b77a83e99
2013-10-28 13:48:14 +01:00
Stephan Bergmann
176ac1e616 Remove unnecessary SyntaxHighlighter::Tokenizer statefulness
...which reveals that SyntaxHighlighter::notifyChange does nothing, so remove it.

Change-Id: I49834af29081ee703d9e62e182e3c1f8ce7e212e
2013-10-28 13:48:14 +01:00
Stephan Bergmann
c99267b326 Fold SyntaxHighlighter::initialize into ctor
...which reveals that m_pKeyWords, m_nKeyWordCount members are unused.

Change-Id: I55020e892d463f2e40d5bcf71efba92778b317c1
2013-10-28 13:48:14 +01:00
Stephan Bergmann
6aa24e7565 Move implementation details to syntaxhighlight.cxx
(and clean up a little)

Change-Id: I6e660708d8ca1509b89b306cd428dc38c8b03f2c
2013-10-28 13:48:14 +01:00
Stephan Bergmann
f5e8be8bb1 Remove unused SimpleTokenizer_Impl::nLine/nCol
...which are never read; remove thereby unused parameters from functions.

Change-Id: I644d2dc1b2d13ae2f932d04243521eef97e67e3e
2013-10-28 13:48:13 +01:00
Stephan Bergmann
0827aba84e Correctly fix "Terminating NUL" fix
1cbe2313ed "Terminating NUL at end of its buffer
is not considered part of OUString" was a thinko that cut the last character off
the last reported HighlightPortion on a line.

Change-Id: Idbe74676e85749cd93854293c6f49c7581414562
2013-10-28 10:47:19 +01:00
Stephan Bergmann
a699e7c70d Revert "COMPHELPER: Allow empty comments in SyntaxHighlight"
This reverts commit a79cb836b9, which broke
--with-help builds again, as

  strLine.copy(i->nBegin, i->nEnd-i->nBegin)

in BasicCodeTagger::tagParagraph (helpcompiler/source/BasCodeTagger.cxx) depends
on the invariant that a HighlightPortion does not extend past the source string.

Also, I see no reason for that change, as empty comments are handled just fine
already as demonstrated by the following commit...

Change-Id: I384bae9c4cf6a38d0a0a2832fa15bde82126cace
2013-10-28 10:47:19 +01:00
Arnaud Versini
a79cb836b9 COMPHELPER: Allow empty comments in SyntaxHighlight
Change-Id: I0f3d5673e28e34ed3921c930aca48f3d7574b064
Reviewed-on: https://gerrit.libreoffice.org/6450
Reviewed-by: Arnaud Versini <arnaud.versini@libreoffice.org>
Tested-by: Arnaud Versini <arnaud.versini@libreoffice.org>
2013-10-27 16:07:16 +00:00
Stephan Bergmann
520a67ccd3 Make violation of "trailing OUString NUL is impl. detail" more obvious
Change-Id: I4e91b73dc276f984a4fe324c3a80cb94e8df6ee3
2013-10-22 18:19:19 +02:00
Stephan Bergmann
8e48edad58 Minor clean-up
Change-Id: I48280cf6e12a5219adaa34f57323a93d21c3f554
2013-10-22 18:19:19 +02:00
Stephan Bergmann
93e652d1fa HighlightPortion's indizes into strings should be sal_Int32
(Had to fix type of some variables holding TextPaM::GetIndex() values from
sal_uLong to sal_uInt16 to avoid -Werror,-Wsign-compare failures when comparing
those against HightlightPortion's nEnd.)

Change-Id: Ia8a0ba682ae28e86e394ee48adff3225eb8de053
2013-10-22 18:19:18 +02:00
Stephan Bergmann
b7f20ef33f Unwind HighlightPortions typedef
Change-Id: I0ecc15f9bfd557d0a70a05536906a4984a46463c
2013-10-22 18:19:18 +02:00
Stephan Bergmann
1cbe2313ed Terminating NUL at end of its buffer is not considered part of OUString
Change-Id: I3eb11659d1bd45327b66abb567e3ccf132d31915
2013-10-22 15:55:41 +02:00
Tor Lillqvist
ec16bfc22a Probably best to use extern "C" here
Change-Id: I9fac782e29566d3652f9e903ed22abdb6531f883
2013-10-14 12:04:36 +03:00
Tor Lillqvist
265ae345c0 Bin obsolete CDECL crack
Change-Id: I69da428711681d14fd48c198fbce0bb545665b5a
2013-10-12 19:35:26 +03:00
Zolnai Tamás
3abe80ac14 Highlight "LIMIT" as a keyword in sql edit
Change-Id: I5aed0a4d9b3e912b1cad0be2092b2dc394e10b04
2013-06-14 11:07:39 +02:00
Gábor Nyers
9e991e1852 fdo#39468 Translated German comments to English
Change-Id: If4f8e308cfae6a4ba64576c1b2844210e64085a0
2013-03-02 21:08:46 +00:00
Andras Timar
c16e9f4ed9 Move SyntaxHighlighter class from svtools to comphelper
We use this class in helpcompiler, and it is not desirable to
compile svtools (thus half of LibreOffice) for a build tool
in cross-compiling environment.

Change-Id: I5e6bc3e576af41eb03c1420dd347c542306f69fa
2013-02-16 12:55:03 +01:00