Commit Graph
194 Commits
Author SHA1 Message Date
Mike Kaganski ee4a456d91 sal: MSVC: pragma warning: make more specific, remove obsolete
Change-Id: Ib7ad23257a966447d627b4f73698d9298790f759
Reviewed-on: https://gerrit.libreoffice.org/49042
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2018-02-02 06:02:48 +01:00
Stephan Bergmann 9a188a0a04 loplugin:cstylecast (clang-cl, manual fix of conditional code)
Change-Id: I7d9c935897107fd0c8471f472234d789e9b8c2da
Reviewed-on: https://gerrit.libreoffice.org/48315
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2018-01-22 22:00:29 +01:00
Stephan Bergmann 697f01e052 SAL_W32 is just an alias for _WIN32
...so consistently use the latter instead of the former

Change-Id: I144d5e7c472632f93b2258461510346bc85892d9
Reviewed-on: https://gerrit.libreoffice.org/48135
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2018-01-19 08:19:38 +01:00
Michael Stahl efc06e9bb6 tdf#114939 sal: deprecate rtl_digest_*SHA* and rtl_digest_PBKDF2
Document the disaster but don't fix it so this implementation can be
used to import existing documents with bad SHA1 hashes.

Change-Id: I4f3648dd0987392ef49dc149a9213bcafcefb202
2018-01-12 23:31:44 +01:00
Stephan Bergmann 5a3bb76cd3 More loplugin:cstylecast: sal
auto-rewrite with <https://gerrit.libreoffice.org/#/c/47798/> "Enable
loplugin:cstylecast for some more cases" plus
solenv/clang-format/reformat-formatted-files

Change-Id: I7d89b011464ba5d2dd12e04d5fc9f65cb4daebde
2018-01-12 20:17:51 +01:00
Andrea Gelmini a2ef65b09d Fix typos
Change-Id: I0e56430afa65b6b5826d56212ac501c0244fce9b
Reviewed-on: https://gerrit.libreoffice.org/47145
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2017-12-29 09:56:34 +01:00
Andrea Gelmini 19e519593c Fix typos
Change-Id: I90f72b6a618436d8cd2115be4e57a07bac15befc
Reviewed-on: https://gerrit.libreoffice.org/47161
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2017-12-29 09:50:54 +01:00
Ashod Nakashian 271a663d2f rtl: support start/stop threads around pre-init
This is necessary to avoid having extra threads
while forking. After forking, the second stage
of pre-init is started and so we start the stopped
rtl threads.

The comment for rtl_alloc_preInit_phase_t has
more details.

Change-Id: I1a3f7be74d4b04d0b2fc4a72b02124c2faa3c047
Reviewed-on: https://gerrit.libreoffice.org/47060
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
2017-12-28 19:10:01 +01:00
Andrea Gelmini 5877a3733c Fix typos
Change-Id: I0a8579406a70d2f63d96969c766e2a43d830ed6f
Reviewed-on: https://gerrit.libreoffice.org/47114
Reviewed-by: Tamás Zolnai <tamas.zolnai@collabora.com>
Tested-by: Tamás Zolnai <tamas.zolnai@collabora.com>
2017-12-28 14:43:13 +01:00
Michael Meeks 556e121379 sal: add pre-initialization scheme for allocations.
This saves several megabytes of dirtied pages for each LOK
client of Online.

Change-Id: I425a2e7896879f0a64d71fcc0655e9e1fa1256aa
2017-12-15 10:22:03 +00:00
Stephan Bergmann 1fc79c3491 Avoid using O[U]StringConcat lvalues containing dangling refs to temporaries
...in code accidentally using auto like

> auto const aURL = uri->getUriReference() + "/"
>     + INetURLObject::encode(
>         m_sEmbeddedName, INetURLObject::PART_FPATH,
>         INetURLObject::EncodeMechanism::All);
>
> uno::Reference<uno::XInterface> xDataSource(xDatabaseContext->getByName(aURL), uno::UNO_QUERY);

in <https://gerrit.libreoffice.org/#/c/44569/1> "Properly construct
vnd.sun.star.pkg URL" did (causing hard to debug test failures there).

So make functions taking O[U]StringConcat take those by rvalue reference.
Unfortunately, that also needed adaption of various functions that just forward
their arguments.  And some code in sc/qa/unit/ucalc_formula.cxx used
CPPUNIT_ASSERT_EQUAL on OUStringConcat arguments in cases where that happened to
actually compile (because the structure of the two OUStringConcats was
identical), which needed adaption too (but which would arguably better use
CPPUNIT_ASSERT_EQUAL_MESSAGE, anyway).

Change-Id: I8994d932aaedb2a491c7c81c167e93379d4fb6e3
Reviewed-on: https://gerrit.libreoffice.org/44608
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2017-11-11 00:03:37 +01:00
Stephan Bergmann 189abcf0db loplugin:includeform: UNO API include files
Change these back to consistently use the "..." form to include other UNO API
include files, for the benefit of external users of this API.

Change-Id: I9c9188e895eb3495e20a71ad44abfa2f6061fa94
2017-10-23 22:22:50 +02:00
Korrawit Pruegsanusak adc2018215 correct doxygen syntax
Change-Id: I9e0ae4f9adadf58b99228d64a316d279043151f2
Reviewed-on: https://gerrit.libreoffice.org/43638
Reviewed-by: Michael Stahl <mstahl@redhat.com>
Tested-by: Michael Stahl <mstahl@redhat.com>
2017-10-23 13:24:58 +02:00
Noel Grandin 87a9979c89 overload std::hash for OUString and OString
no need to explicitly specify it anymore

Change-Id: I6ad9259cce77201fdd75152533f5151aae83e9ec
Reviewed-on: https://gerrit.libreoffice.org/43567
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-10-23 08:15:35 +02:00
Korrawit Pruegsanusak 167afaf111 correct wrong doxygen syntax; also comments clean-up
Change-Id: I6074241dfcdcd4ca8a365ab6e03f01028d2c1a7b
Reviewed-on: https://gerrit.libreoffice.org/43344
Reviewed-by: Michael Stahl <mstahl@redhat.com>
Tested-by: Michael Stahl <mstahl@redhat.com>
2017-10-17 13:26:12 +02:00
Michael Stahl 98e69875f9 sal: fix numerous doxygen warnings
Change-Id: I2fd3fb7b67a62d349ff917466b08c75c19dcbff6
2017-09-19 17:49:17 +02:00
Stephan Bergmann 3f0fba004b New rtl::isUnicodeScalarValue, rtl::isSurrogate
There are apparently various places that want to check for a Unicode scalar
value rather than for a Unicode code point.  Changed those uses of
rtl::isUnicodeCodePoint where that was obvious.  (For changing
svtools/source/svrtf/svparser.cxx see 8e0fb74dc0
"Revert 'svtools: HTML import: don't put lone surrogates in OUString'".)  Other
uses of rtl::isUnicodeCodePoint might also want to use rtl::isUnicodeScalarValue
instead.

As a side effect, this change also introduces rtl::isSurrogate, which is useful
in a few places as well.

Change-Id: I9245f4f98b83877145a4d392f0ddb7c5d824a535
2017-09-13 13:35:49 +02:00
Mike Kaganski 5b518ab051 tdf#111964: only trim XML whitespace
OUString::trim() uses rtl_uString_newTrim, which relies upon
rtl_ImplIsWhitespace. The latter treats as whitespaces not only
characters with values less than or equal to 32, but also Unicode
General Punctuation area Space and some Control characters. Thus,
using OUString::trim() is incorrect when the goal is to trim XML
whitespace, which is defined as one of 0x09, 0x0A, 0x0D, 0x20.

The comments for OUString::trim() and rtl_uString_newTrim are
corrected to describe which characters are considered whitespace.

A unit test included.

Change-Id: I45a132be923a52dcd5a4c35aeecb53d423b49fec
Reviewed-on: https://gerrit.libreoffice.org/41444
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Tested-by: Mike Kaganski <mike.kaganski@collabora.com>
2017-08-23 13:20:32 +02:00
Ashod Nakashian 12e13f1f17 rtl: typo in doc comment
Change-Id: I068d0bce3e0122d4539d489097ef7771f910ed0e
Reviewed-on: https://gerrit.libreoffice.org/40719
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
2017-08-04 02:10:55 +02:00
Caolán McNamara 182a74d937 de-hrc various things
e.g.  helpid[s].hrc -> helpids.h
and insert include guards where missing

move "ordinary" defines into .hxx files

remove .hrc entries that are used as arguments to dialog factory
when a dedicated method can be added instead

Change-Id: I792fb8eb0adfaa63cf354e6e57401fc943e9196e
2017-07-21 08:20:51 +01:00
Chris Sherlock 9af8964dd2 RTL_UNICODETOTEXT_INFO_{DEST|SCR}BUFFERTOSMALL should use TOO, not TO
I have kept the old mispelled constant for backwards compatibility

Change-Id: I128a2eec76d00cc5ef058cd6a0c35a7474d2411e
Reviewed-on: https://gerrit.libreoffice.org/39995
Reviewed-by: Chris Sherlock <chris.sherlock79@gmail.com>
Tested-by: Chris Sherlock <chris.sherlock79@gmail.com>
2017-07-17 21:47:38 +02:00
Chris Sherlock df65749845 Remove a bunch of comment cruft - esp. "the end." bits
Change-Id: I5a339a4211ec8eb547459996be69610b9f2b3766
Reviewed-on: https://gerrit.libreoffice.org/38147
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de>
2017-06-16 16:48:50 +02:00
Stephan Bergmann c127c19de6 Remove HAVE_CXX11_REF_QUALIFIER, always true now
...after 579497164f "Bump GCC baseline to 4.8.1"

Make this a fatal configuration error for now.  The check should be removed
completely after LO 6.0 branch-off.

Change-Id: I70cf65d6b0eb7158008f28449794c66c1b775916
Reviewed-on: https://gerrit.libreoffice.org/38869
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2017-06-16 15:22:32 +02:00
Mike Kaganski ef117cad3a tdf#108039: check for nullptr in rtl_uString and OUString
rtl_[u]String_newConcat now checks allocation result to return
early and avoid SIGSEGV. Other functions are not modified, to
keep old behavior relying on allocation success and crashing
early on OOM to avoid added overhead in performance-critical
places.

OUString operator+= now checks rtl_uString_newConcat result and
throws std::bad_alloc on failure, to specifically address BASIC
problem. It keeps strong exception guarantee of leaving this'
state unaltered.

Concatenation in BASIC now checks for bad string allocation
(previously SIGSEGV was generated).

Unit test included.

Change-Id: I1513311d3d58eac43b2d2ec9a230e22dff0b4245
Reviewed-on: https://gerrit.libreoffice.org/37965
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Tested-by: Jenkins <ci@libreoffice.org>
2017-06-07 11:48:57 +02:00
Caolán McNamara d0069e5189 add COVERITY_NOEXCEPT_FALSE
to markup dtors that coverity warns might throw exceptions
which won't throw in practice, or where std::terminate is
an acceptable response if they do

Change-Id: I32b94814e8245372e1d1dc36be0d81e3564042f4
Reviewed-on: https://gerrit.libreoffice.org/38318
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
2017-06-06 14:15:43 +02:00
Stephan Bergmann 6517fd2107 HAVE_THREADSAFE_STATICS sould always be true
...(for LIBO_INTERNAL_ONLY), now that the status of Android has been clarified,
see <https://lists.freedesktop.org/archives/libreoffice/2017-June/077827.html>
"Re: Some baseline thoughts"

Change-Id: Ie9d5444df84c23d48c24b68d9d2ab5322c619858
2017-06-01 23:42:24 +02:00
Noel Grandin 5e49021b8e apply SAL_RETURNS_NONNULL in a couple more places
Change-Id: I0a57a6a5ea9372215e5f076aeafc64c896ec2312
Reviewed-on: https://gerrit.libreoffice.org/38057
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-05-29 08:38:12 +02:00
Noel Grandin 24b2c636a2 create SAL_RETURNS_NONNULL annotation
and apply it to some methods in OString and OUString

Change-Id: I30e91f961b6d310799d3641f68b7ed54b3080f3a
Reviewed-on: https://gerrit.libreoffice.org/38020
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-05-26 10:35:30 +02:00
Noel Grandin 6b448d3634 make __RSC a builtin define for the RSC compiler
instead of randomly defining it in only some of .src files

Change-Id: Ifec3920740723d248400f451d717b5288c421b8d
Reviewed-on: https://gerrit.libreoffice.org/36832
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-04-25 10:04:53 +02:00
Stephan Bergmann de0ea66610 Improved loplugin:redundantcast, static_cast on arithmetic types: sal
Change-Id: I7caadbc06b2266800666151de75d799c42148aca
2017-04-06 18:31:59 +02:00
Stephan Bergmann 9ac98e6e34 Finally switch MSVC to sal_Unicode = char16_t, too
There is lots of (Windows-only) code that relied on sal_Unicode being the same
as wchar_t, and the best change may be different in each case (and doing the
changes may be somewhat error prone).  So for now add SAL_U/SAL_W scaffolding
functions to sal/types.h, remove their uses one by one again, and finally drop
those functions again.

Change-Id: I2cc791bd941d089901abb5f6fc2f05fbc49e65ea
Reviewed-on: https://gerrit.libreoffice.org/36077
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2017-04-04 16:12:11 +00:00
Jochen Nitschke da56de9ac4 remove type decorations on char literals
they are only needed where type deduction fails.
left them in defines for now.

Change-Id: I7f002dd6bc7acc083c73b6c64076de6dd28d0b09
Reviewed-on: https://gerrit.libreoffice.org/35893
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2017-03-30 12:21:40 +00:00
Andrea Gelmini 86781bcfc8 Fix typos
Change-Id: I998e9b2ad8ebdcc983239192cb61f6689e378ad9
Reviewed-on: https://gerrit.libreoffice.org/35633
Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
Tested-by: Julien Nabet <serval2412@yahoo.fr>
2017-03-25 10:49:09 +00:00
Stephan Bergmann f9bf486e25 Better check for 'defined LIBO_INTERNAL_ONLY'
(to avoid warnings about undefined macros in external code)

Change-Id: Ie1007207b22c19a3d9d96f0f94070c32d417595a
2017-03-24 16:35:32 +01:00
Stephan Bergmann f5c93d4149 Use rtl::isAscii* instead of ctype.h is* (and fix passing plain char)
and add rtl::isAsciiWhiteSpace

Change-Id: Iac71975f718b9360ea9dc94485c069c5e7cb91c7
2017-03-22 21:31:00 +01:00
Stephan Bergmann 7778d9f51b Prevent calls to rtl/character.hxx functions with (signed) char arguments
...that would implicitly be sign extended (for plain char only if it is signed),
so non-ASCII char values would trigger the isUnicodeCodePoint assert.

Change-Id: Iaf8024ad509e64525558e882fe3fd078cfb4ea91
Reviewed-on: https://gerrit.libreoffice.org/35523
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2017-03-22 09:00:57 +00:00
Stephan Bergmann 46b8d2b78a Mark rtl_locale_get/setDefault as deprecated
unused in LO itself since 73bda5058b "ditched
rtl::OLocale"

Change-Id: I6fd713f4771d7a7a397ef08002d1b9d754417f67
2017-03-21 16:31:33 +01:00
Stephan Bergmann e6ce64b1d7 Only need an OStringBuffer in number2PolyPolygon
...so that later passing the OStringBuffer's aNum[i] to
createSevenSegmentPolyPolygon (taking a first parameter of type char) doesn't
need to implicitly convert from sal_Unicode to char.

Requires addition of some missing OStringBuffer-related function variants in
rtl/math.hxx and rtl/strbuf.hxx.

Change-Id: I79e6b2a791abc62b6556a6668e4411cced490c11
2017-03-21 08:54:05 +01:00
Stephan Bergmann 6cb9e6dad7 Remove redundant 'inline' keyword
...from function definitions occurring within class definitions.  Done with
a rewriting Clang plugin (to be pushed later).

Change-Id: I9c6f2818a57ccdb361548895a7743107cbacdff8
Reviewed-on: https://gerrit.libreoffice.org/34874
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2017-03-03 20:55:50 +00:00
Andrea Gelmini bcb402298f Fix typos
Change-Id: I5e3c9683741ddc66283008c20794be5c2b2bc53f
Reviewed-on: https://gerrit.libreoffice.org/34804
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-03-03 06:56:42 +00:00
Stephan Bergmann ba42357925 Remove uses of SAL_CONSTEXPR in LIBO_INTERNAL_ONLY
Change-Id: I9a7dc7c83302b3361f056fcf6636bbba7672f15f
Reviewed-on: https://gerrit.libreoffice.org/34840
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2017-03-03 06:47:35 +00:00
Stephan Bergmann 8646ab97dc Remove MinGW support
In OOo times, there'd originally been efforts to allow building on Windows with
MinGW.  Later, in LO times, this has been shifted to an attempt of cross-
compiling for Windows on Linux.  That attempt can be considered abandoned, and
the relevant code rotting.

Due to this heritage, there are now three kinds of MinGW-specific code in LO:

* Code from the original OOo native Windows effort that is no longer relevant
  for the LO cross-compilation effort, but has never been removed properly.

* Code from the original OOo native Windows effort that is re-purposed for the
  LO cross-compilation effort.

* Code that has been added specifially for the LO cross-compilation effort.

All three kinds of code are removed.

(An unrelated, remaining use of MinGW is for --enable-build-unowinreg, utilizing
--with-mingw-cross-compiler, MINGWCXX, and MINGWSTRIP.)

Change-Id: I49daad8669b4cbe49fa923050c4a4a6ff7dda568
Reviewed-on: https://gerrit.libreoffice.org/34127
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2017-02-10 18:01:27 +00:00
Noel Grandin 1480a2d05a add 'explicit operator bool' to our reference classes
Change-Id: I91cfbe2646dcc55b98d2b809c49c9ea073f54f58
Reviewed-on: https://gerrit.libreoffice.org/33517
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-01-26 06:11:42 +00:00
Stephan Bergmann 387a035d74 New loplugin:externvar: sal
Change-Id: Iefc33784f21e7a0b88c8d6308618926e38ab8554
2017-01-09 15:41:25 +01:00
Caolán McNamara e497d4d490 coverity#1371227 Missing move assignment operator
Change-Id: I2de6b5e2910ff570c08e662769d5e6ee188825a7
Reviewed-on: https://gerrit.libreoffice.org/32843
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2017-01-09 09:05:41 +00:00
Stephan Bergmann c03d803a72 Replace side-effect--only uses of makeStringAndClear() with setLength(0)
Change-Id: Iaf8011f1bd6a10b324653899b7f51458f7d0b68a
2017-01-05 13:52:17 +01:00
Stephan Bergmann 87707670c9 Make OUStringLiteral more useful
...by:

* making the OUStringLiteral ctor non-explicit (to be exploited in a follow-up
  commit)

* adding (LIBO_INTERNAL_ONLY) overloads to OUString/OUStringBuffer functions
  that can now take OUStringLiteral in addition to taking "real" string literals

(Keeping the number of overloads smaller by replacing the ConstCharArrayDetector
overloads with ones taking OUStringLiteral (for LIBO_INTERNAL_ONLY, at least)
and relying on the now-implicit conversion from "real" string literals to
OUStringLiteral unfortunately would not work:  Both OUString and OUStringLiteral
argubably need implicit conversions from "real" string literals, so any function
overloaded for OUString and OUStringLiteral would be ambinguous when called with
a "real" string literal.  And removing the OUString ctor taking a "real" string
literal and relying on an implicit conversion chain from "real" string literal
to OUStringLiteral to OUString doesn't work because it would involve two user-
provided conversions.)

Change-Id: I14433fc1605b048807f60b3a3e14f92221d3a226
Reviewed-on: https://gerrit.libreoffice.org/32097
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Tested-by: Stephan Bergmann <sbergman@redhat.com>
2016-12-17 16:11:10 +00:00
Stephan Bergmann 0dc19268d2 Typo in meant-to-be-overloading function name
Change-Id: I65ab9176b39a436afce23e6bd4423ebf76219166
2016-12-16 12:57:53 +01:00
Stephan Bergmann 40633e32f3 Revert "Revert "Prevent nonsensical comparations between OUString and nullptr_t""
This reverts commit e559c0c9cbfd819f22ef695a9823bb71f4385b58; just turn the
deleted overloads into non-friend functions (and rely on any other overloads to
be still found via ADL).

Change-Id: I2af834162cab2e71ed9e32ae6903bc9f86d77ba2
Reviewed-on: https://gerrit.libreoffice.org/30441
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Tested-by: Stephan Bergmann <sbergman@redhat.com>
2016-10-31 15:29:17 +00:00
Stephan Bergmann e559c0c9cb Revert "Prevent nonsensical comparations between OUString and nullptr_t"
This reverts commit 2e3f5c8dd3, some GCC
have trouble with deleted friend functions; need to fix that properly.
2016-10-31 13:37:17 +01:00