55 Commits
Author SHA1 Message Date
Pragat Pandya 89559c8bc7 tdf#168771 Convert enum to enum class in xmlreader and xmlsecurity
Converted plain enums to enum class for better type safety:

- xmlreader: Converted two local Space enums to enum class and removed
  redundant SPACE_ prefix from enum values (NONE, SPAN, BREAK, START)
- xmlsecurity: Converted EqualMode enum to enum class
- xmlsecurity: Converted local State enum in CompatDNCryptoAPI to enum class

Updated all usages across 8 files to use scoped enum syntax.

Change-Id: I27fd7280bccad72a43cda3b669b1f0926c34271c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/196207
Tested-by: Jenkins
Reviewed-by: Hossein <hossein@libreoffice.org>
2025-12-29 19:39:46 +01:00
Tomaž Vajngerl 2990620e20 remove code duplication - conversion hex char to value
We use the same funciton all over the place, so create a common
function in o3tl and use that in all instances where we duplicated
the code.

Change-Id: I74091fbbde8c2ba8c7e4ab30194ab53e2a338e52
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/180372
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2025-01-20 01:39:16 +01:00
Noel Grandin d573e2ae17 loplugin:ostr in various
Change-Id: I9f399b3752da9df930e0647536ffcd4e82beb1ac
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/167856
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2024-05-20 22:09:56 +02:00
Noel Grandin af65e892dc clang-tidy modernize-pass-by-value in xmlreader
Change-Id: I448d3119129a864e79dbef336e46545f9aca8b25
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/137584
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-07-29 13:10:15 +02:00
Noel Grandin 233fa43225 Revert "improve perf of xmlreader::Pad"
This reverts commit de5af8315e.

Reason for revert: this commit needs bounds checking before it can reland

Change-Id: I686a533cc27fc4644cce918ca64bd168bba19617
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/115518
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-05-14 21:31:04 +02:00
Noel Grandin de5af8315e improve perf of xmlreader::Pad
Change-Id: I83cc88977e7c287b0f428a3e01f289179b6dbad9
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/115353
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-05-11 11:53:45 +02:00
Noel Grandin 4f746b369a speed up XmlReader::handleSkippedText
this part of config loading is fairly hot at startup, so inlining this memchr
call from rtl_str_indexOfChar_WithLength shaves off 2% of my load time.

Change-Id: Ia79f43179475c51d856b685f053f597919cf12af
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/113924
Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-04-10 20:56:49 +02:00
Julien Nabet 25a3658f51 Revert "Optimize getNamespaceId (xmlreader)"
This reverts commit def0096124.

Finally after other tests, it doesn't improve perfs

Change-Id: Icbaaf751181069dd36dba0c676a4c9a2a6c8a9f3
Reviewed-on: https://gerrit.libreoffice.org/80565
Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
Tested-by: Julien Nabet <serval2412@yahoo.fr>
2019-10-10 07:55:00 +02:00
Noel Grandin 266303e867 cleanups in xmlreader
(*) fix order of headers
(*) include the right headers in span.hxx
(*) use std::memcmp instead of memcmp
(*) clear entries from cache when the namespaces array is resized

Change-Id: I04319bbaa84369e5470799578fadcda66a591c9f
Reviewed-on: https://gerrit.libreoffice.org/80347
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-10-08 08:30:46 +02:00
Noel Grandin 4b28b77edd we can use Span for the cache key here
Change-Id: I77894e3c5e3d68cb2a12abcc0b09f2c042664ba0
Reviewed-on: https://gerrit.libreoffice.org/80315
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-10-06 18:51:37 +02:00
Noel Grandin 0a6b9df8c8 convert equals() to operator== in xmlreader::Span
Change-Id: Ic6a8eae344c06be87e2bc4bf7f242a2d18ebc8ad
Reviewed-on: https://gerrit.libreoffice.org/80312
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-10-06 17:06:53 +02:00
Julien Nabet def0096124 Optimize getNamespaceId (xmlreader)
Adding a map to cache values allows me
20s -> 13s to start LO

Change-Id: If343225def253e29696b96f223cdcb54d0d8525d
Reviewed-on: https://gerrit.libreoffice.org/80290
Tested-by: Jenkins
Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2019-10-06 00:28:13 +02:00
Gabor Kelemen ce1276a4c4 tdf#42949 Fix IWYU warnings in xmlreader/
Found with bin/find-unneeded-includes
Only removal proposals are dealt with here.

Change-Id: I9e64ad0a20654e2b97de5b23302ce2cab1a09c00
Reviewed-on: https://gerrit.libreoffice.org/66975
Tested-by: Jenkins
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2019-02-04 10:07:20 +01:00
Arkadiy Illarionov 87b24ddbba Simplify containers iterations in xmlhelp, xmlreader, xmlscript, xmlsecurity
Use range-based loop or replace with functions from std algorithm.

Change-Id: I5b1859da37c2a6c6e5e70602287bfc2ada951893
Reviewed-on: https://gerrit.libreoffice.org/60463
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-09-15 09:06:38 +02:00
Noel Grandin 0b7fe7b2ce loplugin:unusedfields,can-be-const in xmlreader
Change-Id: I762a749b858063a1c063ee918bb6d33e06328876
Reviewed-on: https://gerrit.libreoffice.org/57852
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-07-24 08:32:46 +02:00
Stephan Bergmann a6b53b5461 Silence -Werror=implicit-fallthrough= (upcoming GCC 8)
Earlier GCC already require a similar workaround to silence -Werror=return-type
("control reaches end of non-void function") a few lines further down, so it's
rather consequential that GCC now also warns about the potential fall-through
here (i.e., for these warnings, GCC apparently assumes that an enum can take on
all of the values from its range of values, not just those denoted by an
enumerator).

Change-Id: I1537a7f6975f900861225ee7a521366a5e57046a
2018-01-23 14:17:03 +01:00
Noel Grandin b0de7bc428 clang-tidy modernize-use-emplace in various
Change-Id: Id1bbd3f380c17beeaab11f7140d4df1304c3d0d8
Reviewed-on: https://gerrit.libreoffice.org/41750
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-09-14 11:51:44 +02:00
Noel Grandin 2fffaf6f05 loplugin:unusedmethods
Change-Id: Ia874baf21257e5fe41e104211068a2bcc50446eb
Reviewed-on: https://gerrit.libreoffice.org/40391
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-07-25 12:03:50 +02:00
Noel Grandin 4300656d9f convert XmlReader::State to scoped enum
Change-Id: I8020843ad238ac3487f7f2781693ca619db5e1b3
2016-08-31 10:00:07 +02:00
Noel Grandin 4722192098 Convert XmlReader::Result to scoped enum
Change-Id: I6a0d1dcf5ae51d2ac08aacdfec50865f93e51c21
Reviewed-on: https://gerrit.libreoffice.org/25365
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
2016-05-25 11:59:08 +00:00
Noel Grandin 6bda2bf6fe Convert XmlReader::Text to scoped enum
Change-Id: I4741b13fcf887a95b85886cb41f8236e128e81a2
Reviewed-on: https://gerrit.libreoffice.org/25364
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
2016-05-24 06:54:19 +00:00
Noel Grandin 96fab05132 clang-tidy modernize-loop-convert in writerfilter to xmlsecurity
Change-Id: I334411c6b57c028ffb41b5deb72002f9d54038c3
Reviewed-on: https://gerrit.libreoffice.org/24923
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
2016-05-13 08:09:03 +00:00
Jochen Nitschke f7a75a66fa cleanup: remove unused Reference.h(xx) includes
and unused using-declarations from Reference.h

Change-Id: I297a7ae6044fa329d245ecf08fd5c4cb930f5b19
Reviewed-on: https://gerrit.libreoffice.org/23735
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Markus Mohrhard <markus.mohrhard@googlemail.com>
2016-04-02 19:01:24 +00:00
Noel Grandin 1aa4df615f use SAL_N_ELEMENTS in for loops
for with
  git grep -n 'for.*sizeof'

Change-Id: I6211024385e03ac5eeeb38690d2c1c699e015c2f
Reviewed-on: https://gerrit.libreoffice.org/23569
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
2016-03-31 08:00:13 +00:00
Stephan Bergmann 3210bc85ae Rename rtl::isValidCodePoint -> rtl::isUnicodeCodePoint
...and fix its documentation, and use it throughout the code base.

Change-Id: I349bc2009b1b0aa7115ea90bc6ecd0a812f63698
2016-02-15 12:36:11 +01:00
Stephan Bergmann 1e66163412 loplugin:nullptr (automatic rewrite)
Change-Id: I86546bcf9b476c73da2d6bff30ee1e56933f69c4
2015-11-10 10:32:02 +01:00
Noel Grandin 3e82897353 improve the inlinesimplememberfunctions clang plugin
Change-Id: I6d5a952901648e01904ef5c37f953c517304d31e
2014-06-17 10:55:17 +02:00
Noel Grandin 0e507ae031 various: remove SAL_THROW macro
Change-Id: I9464179a736b91f5bc32eb5e5e89b3b4e3da3494
2014-06-05 08:17:52 +02:00
Noel Grandin e7bc3cab01 remove boilerplate in UNO Exception constructor calls
Now that we have default values for Exception constructor params,
remove lots of boilerplate code.

Change-Id: I620bd641eecfed38e6123873b3b94aaf47922e74
2014-05-23 15:06:00 +02:00
Caolán McNamara ca03d495a0 coverity#708727 Uninitialized pointer field
Change-Id: I816f7e239f83c35666101aac057912dd7e65ecff
2014-04-30 15:26:07 +01:00
Caolán McNamara 472bc32630 coverity#1158416 Uninitialized pointer field
Change-Id: I5c1b07bd3898e89141fe3c3c8f8b63b81513a97e
2014-01-23 17:23:20 +00:00
Matúš Kukan c2f5e09900 Zip .ui translations per UIConfig target.
Fix installer / scp2 to not ignore directory prefix in 'Name'.

Change-Id: Ib319363c8be73a72029f1ba3833e518e15c55e29
Reviewed-on: https://gerrit.libreoffice.org/6915
Reviewed-by: David Tardon <dtardon@redhat.com>
Tested-by: David Tardon <dtardon@redhat.com>
2013-12-06 05:43:21 -06:00
Norbert Thiebaud 32319e1d56 xmlreader: include <> for external includes
Change-Id: I8ee7c2155a721eedb9d54fc00a681f3a08790194
2013-11-11 22:37:27 -06:00
Jelle van der Waa 34f50399f1 fdo#43460 shell,vcl,xmlreader: use isEmpty()
Change-Id: Ie3d16da6c246b79c4c304b21476f84b2788f0d6e
Reviewed-on: https://gerrit.libreoffice.org/4444
Tested-by: LibreOffice gerrit bot <gerrit@libreoffice.org>
Reviewed-by: Thomas Arnhold <thomas@arnhold.org>
Tested-by: Thomas Arnhold <thomas@arnhold.org>
2013-06-24 09:00:20 +00:00
Stephan Bergmann df18d5878c Some string literal clean up
Change-Id: I108882af13fa97fa094547ec4efb468f988f337d
2013-05-16 09:25:53 +02:00
Philipp Riemer e8eab43eeb cleanup whitespaces due to RTL_CONSTASCII_USTRINGPARAM removal
In e2e2cc6114 the method was removed
automatically leaving several line breaks etc. as visual noise.
2013-05-06 19:21:07 +02:00
Luboš Luňák e2e2cc6114 remove usage of RTL_CONSTASCII_USTRINGPARAM
Mechanical removal of usage together with OUString ctor, done
by compiler plugin.

Change-Id: I554227f76df0dac620b1b46fca32516f78b462c5
2013-05-06 16:51:45 +02:00
Luboš Luňák 1946794ae0 mass removal of rtl:: prefixes for O(U)String*
Modules sal, salhelper, cppu, cppuhelper, codemaker (selectively) and odk
have kept them, in order not to break external API (the automatic using declaration
is LO-internal).

Change-Id: I588fc9e0c45b914f824f91c0376980621d730f09
2013-04-07 14:23:11 +02:00
Thomas Arnhold 8b27d78b4a automated removal of RTL_CONSTASCII_USTRINGPARAM for quoted OUStrings
Done with a perl regex:

s/OUString\s*\(\s*RTL_CONSTASCII_USTRINGPARAM\s*\((\s*"[^")]*?"\s*)\)\s*\)/OUString\($1\)/gms

Change-Id: Idf28320817cdcbea6d0f7ec06a9bf51bd2c3b3ec
Reviewed-on: https://gerrit.libreoffice.org/2832
Reviewed-by: Thomas Arnhold <thomas@arnhold.org>
Tested-by: Thomas Arnhold <thomas@arnhold.org>
2013-03-19 09:00:26 +00:00
Jean-Noël Rouvignac 63bcb139b9 Replaced O[U]String::valueOf( static_cast<> ) with O[U]String::number()
Change-Id: I2f11f2f15a652a9edc3c7e5b67c854debeed20de
Reviewed-on: https://gerrit.libreoffice.org/1784
Reviewed-by: Luboš Luňák <l.lunak@suse.cz>
Tested-by: Luboš Luňák <l.lunak@suse.cz>
2013-01-21 15:04:17 +00:00
Thorsten Behrens 66a175834c c++ API: use css alias in generated headers, adds global css decl
This changes all generated API headers (.hpp and .hdl) to use a
namespace alias 'css' instead of the pointlessly long com::sun::star

Makes the change in cppumaker & associated tools, adds a global
namespace alias definition in sal/types.h, and removes a kiloton
of local, now pointless-to-harmful versions of that alias from all
over the code.

Change-Id: Ice5a644a6b971a981f01dc0589d48f5add31cc0f
2012-11-30 14:36:36 +01:00
Caolán McNamara 2914d52fdf remove xmlreader from string now I don't need it anymore
Change-Id: I8d280a5fa352bf4514a5e593b34be767648f4e64
2012-10-27 20:16:51 +01:00
Caolán McNamara 794a7c67e8 allow XmlReader to parse a string
Change-Id: I3433e6f3766c1ea54ad53896c4e4d142d1e319a5
2012-10-17 16:06:27 +01:00
Norbert Thiebaud b854de954f deprecate oustringostreaminserter.hxx
the intent of this header has canged over time. now it is already
systematically included with ustring.hxx and the operator overload it
provide fit nicely there...

Just to be safe, since that include as been added to the api during the
3.5 timeframe and therefore is already in 'production'
the header remain and simply attempt to include ustring.hxx
but a warning is issued indicating that this header should not be used
anymore... in a couple of major release we will thenr emove it completely

All internal users of that header are converted.

Change-Id: I8934c55f089e29d78c0f5649b7c87b2ecf024bad
Reviewed-on: https://gerrit.libreoffice.org/634
Tested-by: Norbert Thiebaud <nthiebaud@gmail.com>
Reviewed-by: Norbert Thiebaud <nthiebaud@gmail.com>
2012-09-18 10:10:06 +00:00
Michael Meeks 46b8dbda43 re-base on ALv2 code. 2012-06-26 21:48:59 +01:00
Caolán McNamara 32e59f91d0 calling nextAttribute before first tag uses uninited variables
(cherry picked from commit c5818e929c7b608ccc3277f1204b491e426925de)

Signed-off-by: Caolán McNamara <caolanm@redhat.com>
2012-06-08 10:25:32 +01:00
Stephan Bergmann c5c3b6d951 Improved error reporting 2012-04-18 14:43:04 +02:00
Stephan Bergmann b7da830447 Better exception message. 2012-01-26 11:01:08 +01:00
Tor Lillqvist e3ab0fd901 osl_unmapFile can't work for files bundled inside the .apk on Android
On Android, when an app is installed, arbitrary files bundled in the
app won't be unpacked into actual separate files in the file
system. They will exist only as archive entries in the .apk file
(which is a zip archive).

The SDK tooling puts such files under the /assets folder in the
.apk. The LibreOffice bootstrapping code for Android maps the .apk
file into memory.

osl_openFile() knows about the /assets special case, and uses a
separate abstraction for such memory-mapped files.

Obviously, when producing an .apk, one needs to make sure these
bundled files are not compressed, if one wants to be able to use them
directly from the memory-mapped .apk file. We do that in our test and
sample Android projects.

When mapping such files under /assets , just return a pointer to the
file's location inside the mapped .apk archive.

We can't use the old osl_unmapFile() on such mapped files, as that
would unexpectedly unmap fairly arbitrary pages of the .apk mapping,
wreaking havoc on later use of the same pages.

So, introduce a new osl_unmapMappedFile() function that takes also the
oslFileHandle originally passed to osl_mapFile(). Use this instead in
the few places where the code actually called osl_unmapFile(). Make
sure osl_mapFile() is nonexistent on Android.
2011-12-21 14:08:48 +02:00
Stephan Bergmann 438054572e Adapted to new assertion/logging mechanisms. 2011-11-29 22:59:59 +01:00