Commit Graph
704 Commits
Author SHA1 Message Date
Mike Kaganski 89b0b449d8 Use a bit more standard null date in lcl_normalizeDateTime
This value is only used for dates comparison inside ODateTimeType;
_getValue is used in OValueLimitedType_Base::_validate to comnpare
to minimal and maximal cached values, and the latter are set using
normalizeValue. The choice of null date is ~random, and in theory,
we could just normalize using Date::GetAsNormalizedDays(), but the
null date close enough to the actual dates has an upside of keepng
enough precision for time part - so just use the most used epoch,
which gives an optimized GetAsNormalizedDays, and hence, a faster
operator-.

Change-Id: I35723373107b2786633c7ddb3cfb82a7dcc4deaa
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/190827
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2025-09-12 05:09:23 +02:00
Mike Kaganski ec70331b1e Drop useless initialization value
It is unused. ISO8601parseDate would either return false (and then
the function would throw), or it would use a different default and
result of parsing the string. The initializer here was confusing.

Change-Id: Ia44d0755262382fa94aefe0e8c183ba3785b5fe5
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/190773
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2025-09-10 19:41:40 +02:00
Xisco Fauli 4cfed5c6c1 libxml2: replace deprecated xmlXPathNAN
Follow-up to
commit e3b5e3aebc
Author: Xisco Fauli <xiscofauli@libreoffice.org>
Date:   Wed Apr 23 13:38:50 2025 +0200

    libxml2: upgrade to 2.14.3

Change-Id: I02ba6c55dbf3919e811f6731bc4c081ffa6bdde2
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/186293
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2025-06-09 15:37:31 +02:00
Gabor Kelemen 9176b4c53c Remove obsolete fw declarations from forms/
found with bin/find-unneeded-includes --fwdecl

Change-Id: Ia59ebd1f5edddb278d77a234b222ae90c5945aba
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/183888
Tested-by: Jenkins
Reviewed-by: Gabor Kelemen <gabor.kelemen.extern@allotropia.de>
2025-04-19 20:57:12 +02:00
Karthik 5a3dd3f0b1 tdf#165233 Use lambdas instead of std::bind
Change-Id: I1aad4c456ee171b569b49de326c53380d73da071
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/182448
Reviewed-by: Ilmari Lauhakangas <ilmari.lauhakangas@libreoffice.org>
Tested-by: Ilmari Lauhakangas <ilmari.lauhakangas@libreoffice.org>
Tested-by: Jenkins
2025-03-21 10:38:43 +01:00
Noel Grandin 09e2627a83 use more concrete UNO types in some local vars
found by a little plugin I created.

Plugin parked into store/ folder because it needs hand-holding
when run.

Change-Id: I2b4da7378f0becbc5f020ac9e78cd765aa0119b4
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/181768
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Tested-by: Jenkins
2025-02-26 16:56:56 +01:00
Simon Chenery ad471148ec Add isEmpty() check to avoid possible OUStringBuffer underflow
Avoid accessing invalid index -1 if OUStringBuffer aBuffer is empty.

It cannot be guaranteed that callers will always pass strings that
result in aBuffer being non-empty.

Change-Id: Ied9abf753bcaf2bd1ee618b2431fa35b0bdb5573
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/180856
Reviewed-by: Samuel Mehrbrodt <samuel.mehrbrodt@allotropia.de>
Tested-by: Jenkins
2025-02-03 11:26:32 +01:00
Johann bf7ac07c04 tdf#158237: Use C++20 contains() instead of find() and end()
Change-Id: I0528229042aa62d3d99e8dbaad68a86d41cf369a
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/178659
Reviewed-by: Ilmari Lauhakangas <ilmari.lauhakangas@libreoffice.org>
Tested-by: Jenkins
2024-12-27 16:20:47 +01:00
Mike Kaganski 1180b3473a com::sun::star -> css
Change-Id: I890ec73e30d3cc6b210903ecee29431f3cb5f635
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/175979
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2024-11-10 10:50:15 +01:00
Noel Grandin ed0b12f4ea no need to take a copy of the getProcessComponentContext return value
we can just take a "const &".

(found by running clang-tidy with the
performance-unnecessary-copy-initialization warning)

Change-Id: I20fd208c65303da78170b1ac06c638fdf3aa094b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/176267
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Tested-by: Jenkins
2024-11-08 15:23:52 +01:00
Caolán McNamara 7cf8cffcb8 cid#1633347 COPY_INSTEAD_OF_MOVE
and

cid#1633346 COPY_INSTEAD_OF_MOVE
cid#1633344 COPY_INSTEAD_OF_MOVE
cid#1633343 COPY_INSTEAD_OF_MOVE
cid#1633340 COPY_INSTEAD_OF_MOVE
cid#1608137 COPY_INSTEAD_OF_MOVE
cid#1608131 COPY_INSTEAD_OF_MOVE
cid#1607860 COPY_INSTEAD_OF_MOVE
cid#1607432 COPY_INSTEAD_OF_MOVE
cid#1607394 COPY_INSTEAD_OF_MOVE
cid#1607310 COPY_INSTEAD_OF_MOVE
cid#1607156 COPY_INSTEAD_OF_MOVE
cid#1607093 COPY_INSTEAD_OF_MOVE
cid#1607090 COPY_INSTEAD_OF_MOVE
cid#1607039 COPY_INSTEAD_OF_MOVE
cid#1606709 COPY_INSTEAD_OF_MOVE
cid#1558053 COPY_INSTEAD_OF_MOVE
cid#1558052 COPY_INSTEAD_OF_MOVE
cid#1558042 COPY_INSTEAD_OF_MOVE
cid#1558038 COPY_INSTEAD_OF_MOVE
cid#1558037 COPY_INSTEAD_OF_MOVE
cid#1558034 COPY_INSTEAD_OF_MOVE
cid#1558031 COPY_INSTEAD_OF_MOVE
cid#1558027 COPY_INSTEAD_OF_MOVE
cid#1557994 COPY_INSTEAD_OF_MOVE
cid#1557977 COPY_INSTEAD_OF_MOVE
cid#1557970 COPY_INSTEAD_OF_MOVE
cid#1557966 COPY_INSTEAD_OF_MOVE
cid#1557957 COPY_INSTEAD_OF_MOVE
cid#1557954 COPY_INSTEAD_OF_MOVE
cid#1557941 COPY_INSTEAD_OF_MOVE
cid#1557933 COPY_INSTEAD_OF_MOVE
cid#1557918 COPY_INSTEAD_OF_MOVE
cid#1557907 COPY_INSTEAD_OF_MOVE
cid#1557890 COPY_INSTEAD_OF_MOVE
cid#1557883 COPY_INSTEAD_OF_MOVE
cid#1557881 COPY_INSTEAD_OF_MOVE
cid#1557861 COPY_INSTEAD_OF_MOVE
cid#1557842 COPY_INSTEAD_OF_MOVE
cid#1557840 COPY_INSTEAD_OF_MOVE
cid#1557830 COPY_INSTEAD_OF_MOVE
cid#1557830 COPY_INSTEAD_OF_MOVE

Change-Id: If5ee3396eafdb8b338d9e6cf0705be6e2b431fd5
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/175577
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
2024-10-25 10:48:12 +02:00
Andrea Gelmini ada8843ec8 Fix typos
Change-Id: I7b2347682cd5f0c625b0bc35b4f73e259262cc52
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/173461
Tested-by: Julien Nabet <serval2412@yahoo.fr>
Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2024-09-16 19:21:25 +02:00
Noel Grandin daba3bc234 use more concrete UNO types in forms
Change-Id: I2e8bbea33be2ac62692230e5da4bb4c748bae73c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/173405
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2024-09-16 08:12:09 +02:00
Caolán McNamara 8a83a62410 cid#1555167 COPY_INSTEAD_OF_MOVE
and

cid#1555172 COPY_INSTEAD_OF_MOVE
cid#1555184 COPY_INSTEAD_OF_MOVE
cid#1555188 COPY_INSTEAD_OF_MOVE
cid#1555197 COPY_INSTEAD_OF_MOVE
cid#1555209 COPY_INSTEAD_OF_MOVE
cid#1555211 COPY_INSTEAD_OF_MOVE
cid#1555215 COPY_INSTEAD_OF_MOVE
cid#1555216 COPY_INSTEAD_OF_MOVE
cid#1555217 COPY_INSTEAD_OF_MOVE
cid#1555218 COPY_INSTEAD_OF_MOVE
cid#1555222 COPY_INSTEAD_OF_MOVE
cid#1556674 COPY_INSTEAD_OF_MOVE
cid#1555229 COPY_INSTEAD_OF_MOVE
cid#1555233 COPY_INSTEAD_OF_MOVE
cid#1555234 COPY_INSTEAD_OF_MOVE
cid#1555242 COPY_INSTEAD_OF_MOVE
cid#1555250 COPY_INSTEAD_OF_MOVE
cid#1555251 COPY_INSTEAD_OF_MOVE
cid#1555254 COPY_INSTEAD_OF_MOVE
cid#1555304 COPY_INSTEAD_OF_MOVE
cid#1555307 COPY_INSTEAD_OF_MOVE
cid#1555317 COPY_INSTEAD_OF_MOVE
cid#1555329 COPY_INSTEAD_OF_MOVE
cid#1555340 COPY_INSTEAD_OF_MOVE
cid#1555347 COPY_INSTEAD_OF_MOVE
cid#1555352 COPY_INSTEAD_OF_MOVE
cid#1555358 COPY_INSTEAD_OF_MOVE
cid#1555363 COPY_INSTEAD_OF_MOVE
cid#1555365 COPY_INSTEAD_OF_MOVE
cid#1555367 COPY_INSTEAD_OF_MOVE
cid#1555374 COPY_INSTEAD_OF_MOVE
cid#1555380 COPY_INSTEAD_OF_MOVE

Change-Id: I343194c10749488a1143e2517ee0638ab19da218
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/170888
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
2024-07-23 21:58:02 +02:00
Noel Grandin 1eaae3966d loplugin:ostr in forms
Change-Id: Ifee5d86b54aa746dbd3b17ff966794f32fbc23bd
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/167303
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2024-05-08 11:15:40 +02:00
Caolán McNamara 41590e7d1f WaE: C6011 Dereferencing NULL pointer warnings
Change-Id: I8edb1fefe1b2b8a3db3ee8f3a0eed59c7f08a36e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/166863
Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
Tested-by: Jenkins
2024-05-02 09:24:11 +02:00
Gabor Kelemen ad640dedd2 tdf#146619 Drop unused 'using namespace' in: forms
Change-Id: I5d81e8c359100da2a7dd98e75a1f79bbb73d9521
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/165570
Tested-by: Jenkins
Reviewed-by: Gabor Kelemen <gabor.kelemen.extern@allotropia.de>
2024-04-05 13:45:10 +02:00
RMZeroFour 599b113b73 tdf#42982 Add error messages to thrown exceptions
As part of the efforts in #42982 to improve the UNO API
error reporting, this commit adds error messages in several
files to help improve debugging experience.

Change-Id: I7a51d4fd1e3a57798d70bc3464b034649948a287
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/165253
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Tested-by: Jenkins
2024-03-30 13:32:16 +01:00
Noel Grandin 35d9d669f2 convert OXSDDataType to comphelper::WeakImplHelperBase
Change-Id: Idb299ea698480d0b98ac0deff9d1f9b87e749782
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/165442
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2024-03-28 19:08:49 +01:00
Caolán McNamara f7327527d4 cid#1560053 Missing move assignment operator
and

cid#1560054 Missing move assignment operator

Change-Id: I438699b24ca7aa7726dbce3af310d80327b9a717
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/161708
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
2024-01-06 19:48:25 +01:00
Julien Nabet 7dcc4bf0d8 Replace "size() != 0 with !empty()" (forms)
Change-Id: I855c4868334c8890b00e78caa67bfc9c9c9ebd80
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/161485
Tested-by: Jenkins
Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2023-12-31 16:03:09 +01:00
Julien Nabet 67c2a47861 cid#1545597 Using invalid iterator
and :

cid#1545537 Using invalid iterator
cid#1545508 Using invalid iterator
cid#1545494 Using invalid iterator
cid#1545478 Using invalid iterator
cid#1545427 Using invalid iterator
cid#1545420 Using invalid iterator
cid#1545400 Using invalid iterator
cid#1545300 Using invalid iterator
cid#1545258 Using invalid iterator
cid#1545257 Using invalid iterator
cid#1545200 Using invalid iterator
cid#1545183 Using invalid iterator

Change-Id: Ibf3a41902f34286967195c5c3b22e337a4b06809
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/160322
Tested-by: Jenkins
Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2023-12-04 22:10:20 +01:00
Noel Grandin 0cea768b52 loplugin:fieldcast in Binding
Change-Id: Ia4bb341dba0c853b53c42a36fcb472e5948f1708
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159839
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2023-11-23 08:13:53 +01:00
Mike Kaganski 176e8cf09a Use exception ctors, instead of setting members later
Avoids overwriting source location in message

Change-Id: Ia0290c7dd1ab3ea1357712a27ecab75c7b583dd4
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157893
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2023-10-14 15:37:17 +02:00
Michael Stahl 2295c2b17c sw, forms: some hacks to nerf time-fields so convwatch works better
This is useful for PDF-based layout-comparison regression testing
where date/time fields were updated upon PDF export and create
lots of false positives. Hopefully these can be eliminated this way,
at least from text documents.

To test:
Download https://bugs.documentfoundation.org/attachment.cgi?id=48452
from tdf#38703 and export it with:

STABLE_FIELDS_HACK=1 instdir/program/swriter --convert-to pdf DeleteStackSample.odt

The date and time fields are now reset to
30/12/1899 00:00:00

Change-Id: Ic89111615074adb50f16a605f920f9a89c437dfd
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/24442
Tested-by: Jenkins
Tested-by: Gabor Kelemen <kelemeng@ubuntu.com>
Reviewed-by: Gabor Kelemen <kelemeng@ubuntu.com>
2023-07-24 18:56:40 +02:00
Julien Nabet 45826e60d5 XML forms: remove duplicate addEventListener DOMAttrModified with capture true
since commit b2a54aa2e4
Author: Vladimir Glazounov <vg@openoffice.org>
Date:   Wed Mar 23 10:34:34 2005 +0000

Change-Id: I8f511d1efa0e2ee713d1e7c145cc60f4945aa8cb
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/151983
Tested-by: Jenkins
Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2023-05-19 21:19:31 +02:00
Julien Nabet 0138745f02 tdf#155123: XML Form: Deleting parts of user defined data type impossible
2 parts:
1) in extensions/source/propctrlr/standardcontrol.cxx
if value retrieved from the field is 0, let's return an empty Any var.

2) forms/source/xforms/datatypes.cxx
Allow to select 0 in the spinbox for String and URI ("hyperlink") datatypes
to be homogeneous

Change-Id: Ife9a94c279e8651623112c0bf8a64555cb9c556c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/151740
Tested-by: Jenkins
Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2023-05-18 12:40:03 +02:00
Julien Nabet 2811ffb4a5 tdf#154628: XML Form Document: Sending data with GET fires very often
See rationale here:
https://bugs.documentfoundation.org/show_bug.cgi?id=154628#c5

Change-Id: I26556baceec8823d2c3bed382d51731d18bd2ccd
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/151852
Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
Tested-by: Jenkins
2023-05-17 15:35:52 +02:00
Julien Nabet aa0cbe2c82 tdf#155121: XML Form Document: better take into account "not required"
Change-Id: Ibebdbc52f2bd7d09ec7aa5f072efef364249a291
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/151733
Tested-by: Jenkins
Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2023-05-14 14:17:00 +02:00
Caolán McNamara 9e745192f1 Resolves: tdf#154337 allow submitting to file: if user agrees
continue to allow submitting to http[s]: without further interaction.
Don't allow for other protocols, except for file: where the user has to
agree via dialog prompt.

Change-Id: Ia915f4f33d5dba621971ce69a156c339da933b55
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/151418
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2023-05-05 15:51:53 +02:00
Julien Nabet c4aa51f497 Related tdf#154769: XML Form add limits of length value for some datatype
length value for:
- year:4
- month and day:2

change ISO8601parseDate in unotools to return false when month or day length > 2

Change-Id: I807a8a784c8924750ae2c821de4be667e514e91f
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/151238
Tested-by: Jenkins
Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2023-05-03 13:55:30 +02:00
Julien Nabet d0ecc80ca4 Related tdf#154769: XML forms add anyURI/hyperlink datatype
See https://www.w3.org/TR/xmlschema11-2/#anyURI

Since I copied-paste string datatype + add check url, I thought about deriving from string datatype
but seeing https://www.w3.org/TR/2012/REC-xmlschema11-2-20120405/datatypes.html#built-in-datatypes
anyURI doesn't derive from string

TODO: contrary to "string" which uses "preserve" for "whitespace" "anyURI" uses "collapse"
There's WhiteSpaceTreatment notion in datatypes.cxx and m_nWST associated,
WhiteSpaceTreatment::Preserve seems to be the default but when searching about it, it's seems not used.

Change-Id: Ifc2dc06072e40b9be168c2f40a9506fe7d267ce4
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/150822
Tested-by: Jenkins
Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2023-04-26 09:36:53 +02:00
Gabor Kelemen 75ed566894 Add script to find unused using declarations
As a complementer to clang-tidy-12 --checks="-*,misc-unused-using-decls"
Pros:
- simple, fast!
- finds some more unused declarations, somehow
- works on non-linux specific parts of the code
- clang-tidy (for me) trips on files with external headers, this does not

Change-Id: If2db989114ac5c2841ed2e89ff7bd7a9e419f567
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/150612
Tested-by: Jenkins
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2023-04-25 08:09:28 +02:00
Julien Nabet 50837fdd60 tdf#116451: XML Form: adding 2 values of decimal-fields gives wrong result
Since, depending of the localization decimal separator may be ",",
replace "," by "." before calling ::rtl::math::stringToDouble

Change-Id: I461f3bdf83019d066735e10b3b6b6784e006bc7f
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/150750
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Tested-by: Jenkins
2023-04-21 13:46:11 +02:00
Gabor Kelemen 890bf59e0a Run clang-tidy with misc-unused-using-decls on modules [d-o]*
To remove unneeded using declarations.

Via the simple script:

for i in $(find $dirname -name "*cxx" -o -name "*hxx" ); do
    clang-tidy-12  --checks="-*,misc-unused-using-decls" "$i";
done

Change-Id: Idd8aa3d3cfec456c4babb65e89af712051b4deb0
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/150609
Tested-by: Jenkins
Reviewed-by: Thorsten Behrens <thorsten.behrens@allotropia.de>
2023-04-20 13:14:37 +02:00
Julien Nabet 4d8a46b819 Related tdf#154769: XML form, detect misformed year/month/day
From https://www.w3.org/TR/xforms20/
"Data Binding Restrictions: Binds only the following list of datatypes,
 or datatypes derived by restriction from those in the list:
 xsd:duration, xsd:date, xsd:time, xsd:dateTime, xsd:gYearMonth,
 xsd:gYear, xsd:gMonthDay, xsd:gDay, xsd:gMonth, xsd:float, xsd:double, and xsd:decimal.
"

gYear: a number between 0 and 10000
From https://www.w3.org/TR/xmlschema11-2/#gYear + https://www.w3.org/TR/xmlschema11-2/#partial-implementation:
"All ·minimally conforming· processors must support nonnegative ·year· values less than 10000"
-> we could accept more but if other use this minimal requirement, they may wrongly consider LO as buggy here

gMonth: a number between 1 and 12, not some string like 'May' (see https://www.w3.org/TR/xmlschema11-2/#gMonth)

gDay: a number between 1 and 31, https://www.w3.org/TR/xmlschema11-2/#gDay

The first test in lcl_getValueyear is due to the fact that a failing conversion with "o3tl::toInt32" also returns 0.
So the goal is to consider this obvious case first.

Change-Id: Ifd8106b55419093a0223cff6a0afb9ccd3aa5efe
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/150652
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2023-04-20 08:03:38 +02:00
Julien Nabet 3b4982b9c7 Related tdf#154769: XML form, detect misformed date/datetime/time
Change-Id: Ied859703f906ef97c70be4518974ca6a0e482573
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/150582
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2023-04-19 08:03:55 +02:00
Julien Nabet 4829a85d07 tdf#154734: XML Form doc: all binded fields will be shown as fields...
with wrong content - except fields, which have wrong content

Regression of 14cfff500e (at 2021-08-05)
Pass context and resource string down to boost::locale separately
because this is often on a hot path, and we can avoid the splitting and
joining of strings like this.

Before the commit, it was:
return ( _validate( sValue ) == nullptr );

_validate methods return "TranslateId" variable which contain the reason why validity is wrong
so if this variable contains no reason it means everything is OK.

so just replace:
return bool(_validate( sValue ));
by:
return bool(!_validate( sValue ));

Change-Id: I76373d0825f86f9072217c96757252b6a891ecc4
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/150433
Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
Tested-by: Jenkins
2023-04-14 22:58:09 +02:00
Julien Nabet 26012007e4 tdf#154658: XML Form Document: Fields doesnt calculate any more
Regression from 73334560b2
author	Julien Nabet <serval2412@yahoo.fr>	2021-11-07 15:40:37 +0100
committer	Julien Nabet <serval2412@yahoo.fr>	2021-11-07 21:58:53 +0100
commit	73334560b2 (patch)
tree	b5bc4f69dd
parent	6be03ac71e (diff)
Replace some macros in forms part 16

A big thank you to Raal for having spotted this!

Change-Id: Ib6f1878897b16b43df287702f82835824c1f766d
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/150174
Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
Tested-by: Jenkins
2023-04-10 12:01:57 +02:00
Noel Grandin 3a0c5b7820 loplugin:stringadd in editeng..framework
after my patch to merge the bufferadd loplugin into stringadd

Change-Id: Ieac16a01fde6467a2f6fe47864069304a3c44e47
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/149552
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2023-03-25 07:27:34 +00:00
Noel Grandin f5bfc127dd elide some temporary OUStrings
where we are calling
  append(OUString::createFromAscii(
and we can rather call
  appendAscii

Change-Id: I2366b518fe6d8d2484b00bb831cb79fb49bc0293
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/149043
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2023-03-17 09:41:13 +00:00
Noel Grandin 13d3ae64db make more use of OUStringBuffer::append(OUStringConcat)
where we can avoid constructing temporary OUStrings

Change-Id: I0eacd68a8d1b450894c2ea769055f16886b78ad0
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/148780
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2023-03-13 16:47:32 +00:00
Noel Grandin 0292570e63 osl::Mutex->std::mutex in CProgressHandlerHelper
Change-Id: I86ddf381e0d52fe50739d5378ea36059a4d1e521
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/147863
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2023-02-27 14:11:02 +00:00
Caolán McNamara c6668bf7f8 cid#1520418 Unchecked dynamic_cast
and

cid#1520419 Unchecked dynamic_cast
cid#1520420 Unchecked dynamic_cast

Change-Id: Ia5ef238677bd5eadcdb7fc3fcf982d8a1507133c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/145768
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2023-01-19 10:33:16 +00:00
Noel Grandin 7195e2740e cleanup commit for Submission
The following commit missed some stuff:
    commit fc41f4d58c
    Author: Noel Grandin <noel.grandin@collabora.co.uk>
    Date:   Sat Jan 14 12:41:58 2023 +0200
    XUnoTunnel->dynamic_cast in Submission

Change-Id: Ic27a813e360ae39227cd68213d2899ab64f0dee5
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/145688
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2023-01-18 05:01:26 +00:00
Noel Grandin fc41f4d58c XUnoTunnel->dynamic_cast in Submission
Change-Id: I2bafbecdd1b3f16375880e49708fe932db060812
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/145626
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2023-01-17 16:10:02 +00:00
Noel Grandin 68a8d0e750 XUnoTunnel->dynamic_cast in forms::Model
Change-Id: I60525e6c4f2d2400cdc47538e9d704b10b7c87ea
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/145627
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2023-01-17 06:43:02 +00:00
Noel Grandin 27d76f145a tdf#153039 submitting XML from XForms document
regression from
    commit 5fd2f0b93b
    Author: Noel Grandin <noel.grandin@collabora.co.uk>
    Date:   Thu Jan 12 09:19:03 2023 +0200
    use concrete class in Submission

Change-Id: I99bc069b5243e994da71287960e29be6ab3338ac
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/145567
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2023-01-16 15:33:24 +00:00
Noel Grandin 5fd2f0b93b use concrete class in Submission
the code already relies on the underlying type of mxModel being Model
rather than XModel

Change-Id: I5b78482d37024a5bc274b0208fa56e4328f3f5f2
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/145390
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2023-01-12 14:46:19 +00: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