Commit Graph

38 Commits

Author SHA1 Message Date
Noel Grandin
f163745cca convert HighlighterLanguage to scoped enum
Change-Id: Ibf0871601e52ea4fa49e9622176431943c55abdd
2016-02-24 11:48:39 +02:00
Noel Grandin
a5e53f9ffd convert TokenTypes to scoped enum
Change-Id: I17c0a616dd6cf48a22896b6cd6b0df157d1f9a9f
2016-02-24 11:48:39 +02:00
Stephan Bergmann
fb4ce444c2 loplugin:nullptr (automatic rewrite)
Change-Id: Ibd0e6ae5e3243464b2484a009f2b4781bdaac471
2015-11-10 10:31:19 +01:00
Stephan Bergmann
9a1f09b93b clang-analyzer-deadcode.DeadStores
Change-Id: Ifd016962dda31b312070745e7646879186d074e9
2015-10-05 09:52:43 +02:00
Marek Doležel
11f24bc2f0 tdf#92130 fix DoEvents to be recognized as keyword
Change-Id: I24868acec66a72abbb52b8026ed3a092dbd97632
Reviewed-on: https://gerrit.libreoffice.org/17347
Reviewed-by: Markus Mohrhard <markus.mohrhard@googlemail.com>
Tested-by: Markus Mohrhard <markus.mohrhard@googlemail.com>
2015-07-25 23:44:03 +00:00
Stephan Bergmann
6390d2c52b Get rid of comphelper::string::is*Ascii functions
Change-Id: I99912112e5b009d7a143f9816d757cdf6ebb1783
2015-06-24 15:27:28 +02:00
Caolán McNamara
a941df0f89 cppcheck: noExplicitConstructor
Change-Id: Ie2ae923ad4c1a66e779711de6ff05328ef144dac
2015-06-08 17:35:00 +01:00
Noel Grandin
71b809959b remove unnecessary use of void in function declarations
ie.
    void f(void);
becomes
    void f();

I used the following command to make the changes:

  git grep -lP '\(\s*void\s*\)' -- *.cxx \
    | xargs perl -pi -w -e 's/(\w+)\s*\(\s*void\s*\)/$1\(\)/g;'

and ran it for both .cxx and .hxx files.

Change-Id: I314a1b56e9c14d10726e32841736b0ad5eef8ddd
2015-04-15 11:47:12 +02:00
Stephan Bergmann
962b77340f Clean up C-style casts from pointers to void
Change-Id: Icdb619101a992a740c71545e669e138cb5dc63a6
2015-03-28 19:09:18 +01:00
Caolán McNamara
f8b80701e0 these can all be made const
Change-Id: I6a8af82e8612196f20143f4997eb95c80a2ca13d
2015-02-12 10:53:18 +00:00
Caolán McNamara
edaee2352b coverity#1242878 Unused value
Change-Id: I85bc3fffb2d350a13aeb30c75f0c2d0a7bc5e7a3
2014-10-10 12:50:21 +01:00
Caolán McNamara
cde0a09137 coverity#1242878 Unused value
Change-Id: I123855003be3eb5ef6494cda8f42b4daeba1c272
2014-10-02 14:48:53 +01:00
Chris Laplante
3c1e30b77d Correct common misspellings, and remove some ASCII art along the way.
Change-Id: I42787db31769e8bde984c5f4f0aa90335e889b1c
Reviewed-on: https://gerrit.libreoffice.org/9356
Reviewed-by: Thomas Arnhold <thomas@arnhold.org>
Tested-by: LibreOffice gerrit bot <gerrit@libreoffice.org>
2014-05-17 12:38:38 +00:00
Thomas Arnhold
6d2de44a54 fix-includes.pl: comphelper
Change-Id: I0b4cd8320881b2b1f7984c86e58915217bcd0d5f
2014-05-11 01:55:37 +02:00
Noel Grandin
4f9b21248f simplify ternary conditions "xxx ? yyy : false"
Look for code like:
   xxx ? yyy : false;
Which can be simplified to:
   xxx && yyy

Change-Id: Ia33c0e452aa28af3f0658a5382895aaad0246b4d
2014-05-05 12:47:48 +02:00
Stephan Bergmann
05f742d28b comphelper: sal_Bool -> bool
Change-Id: I6fc331ae0706f4bb193543011c8d4ae0a385fcc0
2014-02-17 17:55:19 +01:00
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