713 Commits
Author SHA1 Message Date
Andrea Gelmini 1d13866f77 Fix typos
Change-Id: Ia411390c0f297ce12b282a8f7b858747aa255bd1

Reviewed-on: https://gerrit.libreoffice.org/c/core/+/209818
Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
Tested-by: Julien Nabet <serval2412@yahoo.fr>
2026-08-24 08:52:08 +02:00
Caolán McNamara c0d662ca8b don't bother loading exotic protocols for document-supplied data
Signed-off-by: Caolán McNamara <caolan.mcnamara@collabora.com>
Change-Id: I5415f4f1804a85a04ff6396d71b7a61b230e1685
Reviewed-on: https://gerrit.collaboraoffice.com/c/online/+/6686
Tested-by: Jenkins CPCI <releng@collaboraoffice.com>
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
(cherry picked from commit 0274803ae273fa6bdbd1124cedf37395ce847148)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/208190
Tested-by: Xisco Fauli <xiscofauli@libreoffice.org>
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2026-07-18 09:35:15 +02:00
Michael Weghorn f26084217a weld: Move weld::Button to own header/Rename weld.hxx
In the past, weld.hxx used to contain the class
definitions for weld::Widget and all subclasses.

By now, weld::Widget and almost all subclasses have
been moved to separate headers, to make it easier
to keep the overview and to avoid having to
recompile ~all UI code when one class changes.

By now, only weld::Button is left in weld.hxx.
Rename the header to Button.hxx.
Drop weld.hxx includes and instead add Button.hxx
includes (or weld::Button forward declarations) where
weld::Button is used.
(Don't simply replace all weld.hxx includes with
Button.hxx ones, since many of them were for the
use of other widgets that have since been moved
to their own headers.)

Add further includes where needed now that the
(direct or transitive) includes of weld.hxx were removed.

Change-Id: I8ea6201446a418d5e38b46337059dcd517ee29d7
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/205937
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
Tested-by: Jenkins
2026-06-05 07:58:07 +02:00
Mike Kaganski 38ad50ebf4 Move OXSDDataType to use OPropertyImplHelper
Simplifies the implementation, removing boilerplate.

Change-Id: I56942a0b847995d680f65387b314c6eb27199198
Reviewed-on: https://gerrit.collaboraoffice.com/c/core/+/241
Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
Tested-by: Jenkins CPCI <releng@collaboraoffice.com>
(cherry picked from commit dbb5e6bcd8e8edb3ed3346fb331cb6d38f1f5252)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/205666
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
Tested-by: Xisco Fauli <xiscofauli@libreoffice.org>
2026-05-25 14:32:41 +02:00
Michael Weghorn ab3635b2f3 weld: Move weld::MessageDialog to own header
Move the class out of weld.hxx into its own header, in
order to make it easier to keep an overview and to avoid
having to recompile ~all UI code when the class is
modified.

Change-Id: I5b23b02151c75bb49831a2bbf8d515eb0b54415e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/199068
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
Tested-by: Jenkins
2026-02-11 07:32:45 +01:00
Gabor Kelemen 495fa42afa tdf#146619 Use more forward declarations in include/vcl/weld/
after recent split of these headers

This shaves off another 150M input

Change-Id: Ia4e42781cdc6fd6e795c9fb55c6c24dd641b8f0d
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/197339
Reviewed-by: Gabor Kelemen <gabor.kelemen@collabora.com>
Tested-by: Jenkins
2026-01-31 11:06:42 +01:00
Gabor Kelemen 3fc666e120 Fix some non self contained headers in modules [a-r]*
Change-Id: I844cfcfa2bc31fae0256e0c7b757b6223ac8ac35
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/196633
Reviewed-by: Gabor Kelemen <gabor.kelemen@collabora.com>
Tested-by: Jenkins
2026-01-18 00:34:04 +01:00
Michael Weghorn 5b16b3acc6 weld: Move weld.hxx and weldutils.hxx to new include/vcl/weld subdir
This is in preparation of moving code out of weld.hxx
to separate headers/source files, in order to make it
easier to keep an overview and to avoid having to
recompile ~all UI code when anything changes.

Also move weldutils.cxx to a new vcl/source/weld
directory.

Change-Id: Ia75b42f21e560dd248307282a522f186a64cd742
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/195777
Tested-by: Jenkins
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
2025-12-17 18:20:13 +01:00
Mike Kaganski b280efcb9b Drop some uses Sequence::getConstArray
Replace by operator[], begin() and end(), which don't have overhead
since commit 2484de6728 (Remove non-
const Sequence::begin()/end() in internal code, 2021-10-15)
and commit fb3c04bd19 (Drop non-const
Sequence::operator[] in internal code, 2021-11-05).

Change-Id: I221470b3439bb0dc6e7705b0d99deb3cd2063484
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/195176
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2025-12-07 12:54:23 +01:00
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