Commit Graph
1050 Commits
Author SHA1 Message Date
Mike Kaganski f2f008c52a Merge SvXMLAttributeList to comphelper::AttributeList
And simplify the latter, to always use "CDATA" type (as the former did).
"CDATA" was used in all cases but one, where an empty string was used.

Change-Id: I1b3bfae40e29628e4094d9a6e58a69a66865874c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/145526
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2023-01-15 12:32:29 +00:00
Mike Kaganski b15eb164a8 tdf#152380: add checks for names and values sequences length equality
Change-Id: Ibeef551126874bcfffb4e7736588e2e1873f5768
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/143681
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2022-12-06 05:32:37 +00:00
Noel Grandin e14a3ebf80 tdf#54857 use OUStringConstExpr in XMLPropertyMapEntry
which means we don't need to allocate a bunch of strings
when building the property maps in xmloff

Change-Id: I83cb013f816d9b7bcb0dd55c59e5151b33b91c9c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/142192
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-11-04 06:50:43 +01:00
Stephan Bergmann 91ba9654ba Move tools/diagnose_ex.h to comphelper/diagnose_ex.hxx
...so that its TOOLS_WARN_EXCEPTION can be used in
comphelper/source/misc/logging.cxx in a follow-up commit.  (And while at it,
rename from diangose_ex.h to the more appropriate diagnose_ex.hxx.  The
comphelper module is sufficiently low-level for this immediate use case, so use
that at least for now; o3tl might be even more suitable but doesn't have a
Library until now.  Also, for the immediate use case it would have sufficed to
only break DbgGetCaughtException, exceptionToString, TOOLS_WARN_EXCEPTION,
TOOLS_WARN_EXCEPTION_IF, and TOOLS_INFO_EXCEPTION out of
include/tools/diagnose_ex.h into an additional new
include/comphelper/diagnose_ex.hxx, but its probably easier overall to just move
the complete include file as is.)

Change-Id: I9f3222d4ccf1a9ac29d7eb9ba1530d53e2affaee
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/138451
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2022-08-18 17:10:19 +02:00
ehsan e010a57ab2 tdf#147021 Use std::size() instead of SAL_N_ELEMENTS() macro
Change-Id: I9f3819c155bed0796f1b12e5e46e51d42f098117
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/136775
Tested-by: Jenkins
Reviewed-by: Hossein <hossein@libreoffice.org>
2022-08-03 13:08:43 +02:00
Noel Grandin ca2a4a4b1c clang-tidy modernize-pass-by-value in xmloff
Change-Id: Ica07e393763343d0f5caaad6a89fa3378f6ad344
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/136995
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-07-12 15:59:38 +02:00
Stephan Bergmann 4d55513852 Just use Any ctor instead of makeAny in xmloff
Change-Id: Ibefb18e5b798ccf1f9d7a5ba1524c9fb1e9bee32
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133700
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2022-05-03 12:10:52 +02:00
Noel Grandin dc3d56e5cf use more string_view in xmloff
found by examining uses of OUString::copy() for likely places

Change-Id: I50adefbcdbfde8aa71134e5f162b6986a6d566a9
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133623
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-04-29 17:21:50 +02:00
Noel Grandin 9b0202bf43 loplugin:stringliteraldefine in xmloff
Change-Id: I9216c18d3ba4a4a528a49198fdfe547a66c06b6b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/126284
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-12-03 17:58:24 +01:00
Noel Grandin 5fe5ded723 simplify construction of XMLPropertyMapEntry
so we don't have to pass in the size of the string literal.

This is mostly a preparatory change, to make an another
patch of mine less noisy.

Change-Id: Idafcd68586b8b465e63dc89e4a4180d2e70ac3a4
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125080
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-11-12 10:55:07 +01:00
Mike Kaganski 8cb57be792 Prepare for removal of non-const operator[] from Sequence in xmloff
Change-Id: I7ea7964f76f0a5db678510ac3533003726dc49fa
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/124416
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2021-11-01 07:11:36 +01:00
Mike Kaganski 2484de6728 Remove non-const Sequence::begin()/end() in internal code
... to avoid hidden cost of multiple COW checks, because they
call getArray() internally.
This obsoletes [loplugin:sequenceloop].

Also rename toNonConstRange to asNonConstRange, to reflect that
the result is a view of the sequence, not an independent object.

TODO: also drop non-const operator[], but introduce operator[]
in SequenceRange.

Change-Id: Idd5fd7a3400fe65274d2a6343025e2ef8911635d
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123518
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2021-10-15 10:36:36 +02:00
Mike Kaganski 8a017d25a6 Avoid COW overhead using css::uno::Sequence
The scenarios are:

1. Calling sequence's begin() and end() in pairs to pass to algorithms
   (both calls use getArray(), which does the COW checks)
2. In addition to #1, calling end() again when checking result of find
   algorithms, and/or begin() to calculate result's distance
3. Using non-const sequences in range-based for loops, which internally
   do #1
4. Assigning sequence to another sequence variable, and then modifying
   one of them

In many cases, the sequences could be made const, or treated as const
for the purposes of the algorithms (using std::as_const, std::cbegin,
and std::cend). Where algorithm modifies the sequence, it was changed
to only call getArray() once. For that, css::uno::toNonConstRange was
introduced, which returns a struct (sublclass of std::pair) with two
iterators [begin, end], that are calculated using one call to begin()
and one call to getLength().

To handle #4, css::uno::Sequence::swap was introduced, that swaps the
internal pointer to uno_Sequence. So when a local Sequence variable
should be assigned to another variable, and the latter will be modified
further, it's now possible to use swap instead, so the two sequences
are kept independent.

The modified places were found by temporarily removing non-const end().

Change-Id: I8fe2787f200eecb70744e8b77fbdf7a49653f628
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123542
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2021-10-14 06:00:49 +02:00
Noel Grandin f67392948d loplugin:moveparam in xmloff
Change-Id: I46c1c8dc46cd2b8470b69506f6609f8bd7e42211
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123347
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-10-10 21:03:18 +02:00
Mike Kaganski 4d82c1d8a3 Simplify SvXMLExport::AddAttribute overloads
Remove overloads taking const char* which were not needed, because
every their use eventually took a string literal convertible to
OUString directly.

Many other literals were converted to OUStringLiterals.

Change-Id: Ia1e742a8087776cd20bf5094dc415dafd9a8834a
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123155
Tested-by: Mike Kaganski <mike.kaganski@collabora.com>
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2021-10-09 07:08:24 +02:00
Noel Grandin 0d56337387 clang-tidy:clang-analyzer-optin.performance.Padding
noting that XMLTokenEnum was already being treated as being limited to
32-bits, we bitmask it together with namespaces

Change-Id: Ic48f2a662452d1b8e022078d31a723d2ac65aef0
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/121707
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-09-06 11:58:09 +02:00
Stephan Bergmann 2bc1a0431b New loplugin:unusedcapturedefault
In sc/qa/unit/ucalc_formula.cxx, dropping the capture-default from the
lExpectedinF lambda revealed that MSVC in C++17 mode (i.e., when building
without --with-latest-c++) requires ROW_RANGE (a local const int variable from
the enclosing TestFormula::testTdf97369) to be captured, even though all uses of
that variable within the lambda body are constant expressions.  That is still
true at least for the latest Visual Studio 2019 version 16.11.1.  (This is not
an issue for the lExpectedinH and lExpectedinI lambdas a few lines further down,
as they, in addition to using that ROW_RANGE, also use the local const double
variables SHIFT1 and SHIFT2, whose uses are not constant expressions, so
they are implicitly captured and loplugin:unusedcapturedefault does not suggest
dropping those lambdas' capture-defaults in the first place.)

Change-Id: Iee7efb485187cbe8eba6a2d470afca4993eb1816
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/120693
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2021-08-20 14:25:38 +02:00
Noel Grandin 303aa36685 unordered_map is better for pointer keys
Change-Id: Iaef42c9cc3526d1daa9ad6aaa840ea5a449173be
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/119816
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-08-01 20:06:40 +02:00
Noel Grandin 5678db6ff2 o3tl::sorted_vector is better for small sets of pointers
Change-Id: Ice284159b1666d930903eb53315e8a3c777c2a16
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/119815
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-08-01 20:06:21 +02:00
Stephan Bergmann af16aa6256 Improve loplugin:stringview
Issue the "instead of O[U]String, pass [u16]string_view" diagnostic also for
operator call arguments.  (The "rather than copy, pass subView()" diagnostic is
already part of handleSubExprThatCouldBeView, so no need to repeat it explicitly
for operator call arguments.)

(And many call sites don't even require an explicit [u16]string_view, esp. with
the recent ad48b2b02f "Optimized OString operator
+= overloads".  Just some test code in sal/qa/ that explicitly tests the
O[U]String functionality had to be excluded.)

Change-Id: I8d55ba5a7fa16a563f5ffe43d245125c88c793bc
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/115589
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2021-05-14 13:11:50 +02:00
Tomaž Vajngerl eb6819e74a change usage of boost::hash_combine to o3tl::hash_combine
Change-Id: I840518a36ac43d36c95f38e09c7bfcfe1a25a525
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/114984
Tested-by: Tomaž Vajngerl <quikee@gmail.com>
Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2021-05-11 12:28:24 +02:00
Michael Stahl 16de54a5c4 tdf#138209 ODF export: work around forms problem in LO < 7.0
LO without commit 519d96fd8b makes a mess
when storing form documents it has loaded from ODF 1.3 documents: the
XML parts are stored as ODF 1.2, but the storage (and therefore manifest
entry) keeps version 1.3.

To avoid this, store form documents as ODF 1.2 extended by default.

Unfortunately a bunch of ODF export code accesses the global
SvtSaveOptions variable; with this version override, only
SvXMLExport::getSaneDefaultVersion() must be used.

Change-Id: I5fa8e286f5103c578ed0d93da07a8a6cbe2f0ddd
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/115357
Tested-by: Jenkins
Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
2021-05-10 21:07:40 +02:00
Noel Grandin c7c6f0af6c loplugin:stringadd convert chained append to +
which can use the more efficient *StringConcat

Also fix a crash in stringview plugin which
started happening while I working on this.

Change-Id: I91a5b9b7707d1594d27d80b73930f5afac8ae608
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/114568
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-04-27 14:07:56 +02:00
Noel Grandin 75997f13ee no need to create temporaries when appending number to O[U]StringBuffer
Change-Id: I36d82423b5f75010552696a66cec7e53ee265ce4
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/114395
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-04-22 21:42:14 +02:00
Noel eab3fa1f37 loplugin:unusedvarsglobal
Change-Id: Ie73c8bec0196c680311b0959f3a17c3af900ce88
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/113084
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-03-25 14:13:12 +01:00
Vincent LE GARREC aef40e7388 tdf#124176 Use pragma once in x*
xmlhelp, xmloff, xmlsecurity

Change-Id: I80c6fa806387f3dcba8be7f93fe2fef146b033e3
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/112050
Tested-by: Jenkins
Reviewed-by: Ilmari Lauhakangas <ilmari.lauhakangas@libreoffice.org>
2021-03-23 13:14:42 +01:00
Noel Grandin 67db5b7c8d tdf#140486 forms "empty string is null" setting not loaded
regression from
    commit 3de38e9556
    Date:   Tue Nov 10 19:20:06 2020 +0200
    use fastparser in forms

Change-Id: I1e679bdca17185f20c1f755da16f02aa5661e22f
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111123
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-02-18 17:34:07 +01:00
Noel Grandin 63d14566ba tdf#140198 Base text field will not retain multi-line setting
regression due to a combination of
    commit 3de38e9556
    Date:   Tue Nov 10 19:20:06 2020 +0200
    use fastparser in forms
and
    commit 3d00847709
    Date:   Fri Dec 4 16:14:16 2020 +0200
    fastparser in a couple of random places
The first one introduced the bug, due to the fallback
paths from fast to slowparser, things kept working, until
the second one removed the fallback.

Change-Id: I1aaae902eda2aaf8f5151404ddb3577f4582757d
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111101
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-02-18 12:08:23 +01:00
Noel 7943752b9e loplugin:referencecasting in xmloff
Change-Id: Ib601b7045d773ab612569a8fd00d76545dea13af
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111055
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-02-17 13:15:11 +01:00
Caolán McNamara ac396f2f6b fix coverity parse errors
Change-Id: I3a1179947704452e3ffec02be59d0f7bf0b75ab0
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/109017
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2021-01-09 13:01:49 +01:00
Stephan Bergmann a3d0091d18 New loplugin:stringliteralvar
See the comment at the top of compilerplugins/clang/stringliteralvar.cxx for
details.

(Turned some affected variables in included files into inline variables, to
avoid GCC warnings about unused variables.)

Change-Id: Ie77219e6adfdaaceaa8b4e590b08971f2f04c83a
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/108239
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2020-12-26 14:51:15 +01:00
Noel 917338c6a8 use std::u16string_view in SvXMLTokenEnumerator
Change-Id: I1194441063047637adc20c8e37bb717fdb787714
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/108073
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-12-21 11:34:17 +01:00
Noel Grandin 46c5de8328 make *String(string_view) constructors explicit
to make it more obvious when we are constructing heap OUStrings
code and potentially inadvertently throwing away performance.

And fix a handful of places so revealed.

Change-Id: I0cf390f78026f8a670aaab53424cd31510633051
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/107923
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-12-19 17:53:06 +01:00
Julien Nabet e7fb2c18e9 Get rid of wrong warning in propertyexport (forms)
Create a brand new odt file, add an image with form Control then save
You'll notice this on console:
warn:legacy.osl:20299:20299:xmloff/source/forms/propertyexport.cxx:680: OPropertyExport::dbg_implCheckProperty: invalid property type!

it's wrong since most of the type the exported property should be a OUString (internal "string")
but it may also be a graphic::XGraphic and this case isn't dealt by DBG_CHECK_PROPERTY
since we only gave it "OUString()"

Change-Id: I268b8d5f79c84ea73acdac245ee1705ddd009ae9
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/107653
Tested-by: Jenkins
Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2020-12-13 16:48:48 +01:00
Noel b541cd9a80 loplugin:unusedmethods
Change-Id: Ib51fd610c5188fe95872d509f004ae88f38c5417
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/107351
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-12-07 16:59:28 +01:00
Noel 3d00847709 fastparser in a couple of random places
Change-Id: I9c88c826cfffa71f389f78f9d18d46e097e540ec
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/107217
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-12-04 17:39:12 +01:00
Noel bea9187bb4 fastparser in propertyimport
Change-Id: I6922594367050e5aab4b3c0fa0b38dbd6fcd206c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/106867
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-11-30 18:38:06 +01:00
Noel Grandin 3faf503b1a tdf#138507 error in loading form
regression from
    commit 3de38e9556
    Author: Noel Grandin <noelgrandin@gmail.com>
    Date:   Tue Nov 10 19:20:06 2020 +0200
    use fastparser in forms

Change-Id: I995677d4e381e8229e7f052cf54a134bdf49d378
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/106708
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-11-27 08:05:58 +01:00
Noel bb06f51308 loplugin:stringviewparam extend to comparison operators
which means that some call sites have to change to use
unicode string literals i.e. u"foo" instead of "foo"

Change-Id: Ie51c3adf56d343dd1d1710777f9d2a43ee66221c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/106125
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-11-24 09:45:04 +01:00
Noel 46aaf4e4e6 fastparser in forms
Change-Id: Ia5274bf6c200a5077bc9b7fdf16b7723337d353d
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/106165
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-11-19 19:31:17 +01:00
Philipp Hofer c927d6daa9 tdf#123936 Formatting files in module xmloff with clang-format
Change-Id: I4d9016a0e646da5d9f0044762f6ecce86ce1242b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/105732
Reviewed-by: Christian Lohmaier <lohmaier+LibreOffice@googlemail.com>
Tested-by: Christian Lohmaier <lohmaier+LibreOffice@googlemail.com>
2020-11-19 19:25:20 +01:00
Julien Nabet ef7abc0dc8 Fix SAL_WARN_IF in elementimport (xmloff)
Wrong from:
2012-05-17 5e0b52c189
-                    (0 == _rPropValue.Name.compareToAscii(PROPERTY_EFFECTIVE_VALUE))
-                ||  (0 == _rPropValue.Name.compareToAscii(PROPERTY_EFFECTIVE_DEFAULT)),
+                    (0 == _rPropValue.Name.equalsAsciiL(PROPERTY_EFFECTIVE_VALUE.ascii, PROPERTY_EFFECTIVE_VALUE.length))
+                ||  (0 == _rPropValue.Name.equalsAsciiL(PROPERTY_EFFECTIVE_DEFAULT.ascii, PROPERTY_EFFECTIVE_DEFAULT.length)),
since '"compareToAscii" returned 0 if both strings are equal'
whereas "equalsAsciiL" returned sal_Bool (so sal_True if both strings equal)

there have been different changes during some years.
But c2d808a5dd (2019-02-01) did also wrongly this:
-            OSL_ENSURE(
-                    _rPropValue.Name != PROPERTY_EFFECTIVE_VALUE
-                &&  _rPropValue.Name != PROPERTY_EFFECTIVE_DEFAULT,
-                "OControlImport::implTranslateValueProperty: invalid property type/name combination!");
+            SAL_WARN_IF(
+                    _rPropValue.Name == PROPERTY_EFFECTIVE_VALUE
+                ||  _rPropValue.Name == PROPERTY_EFFECTIVE_DEFAULT, "xmloff",
+                "OControlImport::implTranslateValueProperty: invalid property type/name combination, Any and " + _rPropValue.Name);

Indeed the comment (which has never changed since 2001) above indicates:
"we have exactly 2 properties where this type class is allowed"

In brief, we want to warn if "_rPropValue.Name" different from "PROPERTY_EFFECTIVE_VALUE" and "PROPERTY_EFFECTIVE_DEFAULT"

Change-Id: I576b2af2eaf96c53ae7950b352239ce1510ff03c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/106080
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
Tested-by: Jenkins
2020-11-19 12:17:06 +01:00
Julien Nabet acf7d8d1ab Avoid wrong warning in OElementImport::implApplyGenericProperties (xmloff)
When empty sequence, there's nothing to convert so no need to spend time here and
to indicate the following warning:
Avoid warn:legacy.osl:93722:93722:xmloff/source/forms/elementimport.cxx:364:
OElementImport::implApplyGenericProperties: conversion to sequences other than 'sequence< short >' not implemented, yet!

+ avoid these in the same time:
warn:xmloff.forms:88800:88800:xmloff/source/forms/elementimport.cxx:428: DBG_UNHANDLED_EXCEPTION in implApplyGenericProperties
exception: com.sun.star.lang.IllegalArgumentException message:
/home/julien/lo/libreoffice/include/cppuhelper/proptypehlp.hxx:35 ArgumentPosition: 0

In addition, convert 2 OSL_ENSURE of this block in SAL_WARN_IF

Change-Id: I047eb5afba6fd22249010791aa61ebd1f83f3c67
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/106082
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-11-19 10:17:42 +01:00
Noel 8ef6067596 loplugin:stringviewparam check methods too
not just functions

Change-Id: Icca295dd159002b428b73f2c95d40725434f04d9
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/105789
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-11-17 09:57:35 +01:00
Noel d52f83c7db tdf#138144 Form wizard fails to save
fallout from
    commit 3de38e9556
    Date:   Tue Nov 10 19:20:06 2020 +0200
    use fastparser in forms

Change-Id: I4691786525132ef0cf98b6b177a2c022c4d7d032
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/105932
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-11-16 18:07:50 +01:00
Noel d9f0e8db9a loplugin:unusedmethods
Change-Id: I90d402a5c18ab16424a042bcea1470fa8a3a5839
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/105629
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-11-12 16:54:19 +01:00
Noel Grandin 3de38e9556 use fastparser in forms
Change-Id: I7d09d64857e24267b4b4baddb563e28ceea92f2e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/105560
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-11-11 06:33:53 +01:00
Mike Kaganski 8ba9ecaaad Fix Windows build with --disable-pch
[build CXX] xmloff/source/forms/formlayerimport.cxx
C:\lo\src\core\include\cppu/unotype.hxx(296): error C2665: 'com::sun::star::beans::cppu_detail_getUnoType': none of the 28 overloads could convert all the argum
ent types
C:\lo\src\build\workdir\UnoApiHeadersTarget\udkapi\normal\com/sun/star/beans/XVetoableChangeListener.hpp(56): note: could be 'const com::sun::star::uno::Type &c
om::sun::star::beans::cppu_detail_getUnoType(const com::sun::star::beans::XVetoableChangeListener *)' [found using argument-dependent lookup]
C:\lo\src\build\workdir\UnoApiHeadersTarget\udkapi\normal\com/sun/star/beans/XPropertySetInfo.hpp(69): note: or       'const com::sun::star::uno::Type &com::sun
::star::beans::cppu_detail_getUnoType(const com::sun::star::beans::XPropertySetInfo *)' [found using argument-dependent lookup]
C:\lo\src\build\workdir\UnoApiHeadersTarget\udkapi\normal\com/sun/star/beans/Property.hpp(81): note: or       'const com::sun::star::uno::Type &com::sun::star::
beans::cppu_detail_getUnoType(const com::sun::star::beans::Property *)' [found using argument-dependent lookup]
C:\lo\src\build\workdir\UnoApiHeadersTarget\udkapi\normal\com/sun/star/beans/XPropertyChangeListener.hpp(55): note: or       'const com::sun::star::uno::Type &c
om::sun::star::beans::cppu_detail_getUnoType(const com::sun::star::beans::XPropertyChangeListener *)' [found using argument-dependent lookup]
C:\lo\src\build\workdir\UnoApiHeadersTarget\udkapi\normal\com/sun/star/beans/PropertyChangeEvent.hpp(92): note: or       'const com::sun::star::uno::Type &com::
sun::star::beans::cppu_detail_getUnoType(const com::sun::star::beans::PropertyChangeEvent *)' [found using argument-dependent lookup]
C:\lo\src\build\workdir\UnoApiHeadersTarget\udkapi\normal\com/sun/star/beans/UnknownPropertyException.hpp(54): note: or       'const com::sun::star::uno::Type &
com::sun::star::beans::cppu_detail_getUnoType(const com::sun::star::beans::UnknownPropertyException *)' [found using argument-dependent lookup]
C:\lo\src\build\workdir\UnoApiHeadersTarget\udkapi\normal\com/sun/star/beans/PropertyVetoException.hpp(54): note: or       'const com::sun::star::uno::Type &com
::sun::star::beans::cppu_detail_getUnoType(const com::sun::star::beans::PropertyVetoException *)' [found using argument-dependent lookup]
C:\lo\src\build\workdir\UnoApiHeadersTarget\udkapi\normal\com/sun/star/beans/XPropertySet.hpp(93): note: or       'const com::sun::star::uno::Type &com::sun::st
ar::beans::cppu_detail_getUnoType(const com::sun::star::beans::XPropertySet *)' [found using argument-dependent lookup]
C:\lo\src\core\include\cppu/unotype.hxx(249): note: or       'const com::sun::star::uno::Type &cppu::detail::cppu_detail_getUnoType(const com::sun::star::uno::X
Interface *)'
C:\lo\src\core\include\cppu/unotype.hxx(243): note: or       'const com::sun::star::uno::Type &cppu::detail::cppu_detail_getUnoType(const com::sun::star::uno::E
xception *)'
C:\lo\src\core\include\cppu/unotype.hxx(217): note: or       'const com::sun::star::uno::Type &cppu::detail::cppu_detail_getUnoType(const com::sun::star::uno::A
ny *)'
C:\lo\src\core\include\cppu/unotype.hxx(211): note: or       'const com::sun::star::uno::Type &cppu::detail::cppu_detail_getUnoType(const com::sun::star::uno::T
ype *)'
C:\lo\src\core\include\cppu/unotype.hxx(206): note: or       'const com::sun::star::uno::Type &cppu::detail::cppu_detail_getUnoType(const rtl::OUString *)'
C:\lo\src\core\include\cppu/unotype.hxx(200): note: or       'const com::sun::star::uno::Type &cppu::detail::cppu_detail_getUnoType(const sal_Unicode *)'
C:\lo\src\core\include\cppu/unotype.hxx(193): note: or       'const com::sun::star::uno::Type &cppu::detail::cppu_detail_getUnoType(const cppu::UnoCharType *)'
C:\lo\src\core\include\cppu/unotype.hxx(188): note: or       'const com::sun::star::uno::Type &cppu::detail::cppu_detail_getUnoType(const double *)'
C:\lo\src\core\include\cppu/unotype.hxx(183): note: or       'const com::sun::star::uno::Type &cppu::detail::cppu_detail_getUnoType(const float *)'
C:\lo\src\core\include\cppu/unotype.hxx(177): note: or       'const com::sun::star::uno::Type &cppu::detail::cppu_detail_getUnoType(const sal_uInt64 *)'
C:\lo\src\core\include\cppu/unotype.hxx(172): note: or       'const com::sun::star::uno::Type &cppu::detail::cppu_detail_getUnoType(const sal_Int64 *)'
C:\lo\src\core\include\cppu/unotype.hxx(166): note: or       'const com::sun::star::uno::Type &cppu::detail::cppu_detail_getUnoType(const sal_uInt32 *)'
C:\lo\src\core\include\cppu/unotype.hxx(161): note: or       'const com::sun::star::uno::Type &cppu::detail::cppu_detail_getUnoType(const sal_Int32 *)'
C:\lo\src\core\include\cppu/unotype.hxx(155): note: or       'const com::sun::star::uno::Type &cppu::detail::cppu_detail_getUnoType(const sal_uInt16 *)'
C:\lo\src\core\include\cppu/unotype.hxx(145): note: or       'const com::sun::star::uno::Type &cppu::detail::cppu_detail_getUnoType(const cppu::UnoUnsignedShort
Type *)'
C:\lo\src\core\include\cppu/unotype.hxx(140): note: or       'const com::sun::star::uno::Type &cppu::detail::cppu_detail_getUnoType(const sal_Int16 *)'
C:\lo\src\core\include\cppu/unotype.hxx(135): note: or       'const com::sun::star::uno::Type &cppu::detail::cppu_detail_getUnoType(const sal_Int8 *)'
C:\lo\src\core\include\cppu/unotype.hxx(130): note: or       'const com::sun::star::uno::Type &cppu::detail::cppu_detail_getUnoType(const sal_Bool *)'
C:\lo\src\core\include\cppu/unotype.hxx(125): note: or       'const com::sun::star::uno::Type &cppu::detail::cppu_detail_getUnoType(const bool *)'
C:\lo\src\core\include\cppu/unotype.hxx(120): note: or       'const com::sun::star::uno::Type &cppu::detail::cppu_detail_getUnoType(const cppu::UnoVoidType *)'
C:\lo\src\core\include\cppu/unotype.hxx(296): note: while trying to match the argument list '(T1 *)'
C:\lo\src\core\include\cppu/unotype.hxx(288): note: while compiling class template member function 'const com::sun::star::uno::Type &cppu::UnoType<T>::get(void)
'
with
[
T=com::sun::star::beans::PropertyValue
]
C:\lo\src\core\include\cppu/unotype.hxx(321): note: see reference to function template instantiation 'const com::sun::star::uno::Type &cppu::UnoType<T>::get(voi
d)' being compiled
with
[
T=com::sun::star::beans::PropertyValue
]
C:\lo\src\core\include\cppu/unotype.hxx(321): note: see reference to class template instantiation 'cppu::UnoType<T>' being compiled
with
[
T=com::sun::star::beans::PropertyValue
]
C:\lo\src\core\include\com/sun/star/uno/Sequence.hxx(291): note: see reference to function template instantiation 'const com::sun::star::uno::Type &cppu::getTyp
eFavourUnsigned<com::sun::star::beans::PropertyValue>(const T *)' being compiled
with
[
T=com::sun::star::beans::PropertyValue
]
C:\lo\src\core\include\com/sun/star/uno/Sequence.hxx(117): note: see reference to function template instantiation 'const com::sun::star::uno::Type &cppu::getTyp
eFavourUnsigned<com::sun::star::beans::PropertyValue>(const com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> *)' being compiled
C:\lo\src\core\include\com/sun/star/uno/Sequence.hxx(114): note: while compiling class template member function 'com::sun::star::uno::Sequence<com::sun::star::b
eans::PropertyValue>::~Sequence(void)'
C:/lo/src/core/xmloff/source/forms/formlayerimport.cxx(89): note: see reference to function template instantiation 'com::sun::star::uno::Sequence<com::sun::star
::beans::PropertyValue>::~Sequence(void)' being compiled
make[1]: *** [C:/lo/src/core/solenv/gbuild/LinkTarget.mk:301: C:/lo/src/build/workdir/CxxObject/xmloff/source/forms/formlayerimport.o] Error 2

Change-Id: Ib75f2da6393a7ba4aa1660bdf872dc4bf0fb796c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/105478
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Tested-by: Jenkins
2020-11-09 14:28:05 +01:00
Noel 3940cf7d71 drop the SvXMLExport::EndElement method..
in favour of just using the endFastElement() method

Change-Id: Id95abb0b9e78bc44278c5e9e3cc8dee15185e2e2
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/105175
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-11-02 17:08:47 +01:00
Noel 2764c334c3 drop the SvXMLExport::Characters method..
in favour of just using the characters() method

Change-Id: Iecb2773d488fcf4fa3c2202d0e889015a288fe2a
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/105174
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-11-02 14:11:49 +01:00