Commit Graph

141 Commits

Author SHA1 Message Date
Noel Grandin
87db52ab1e Revert "use more Reference::query instead of UNO_QUERY_THROW"
This reverts commit 7fc6063914.

sberg noticed that there is a difference now:

there's a subtle difference now, in that if  y  was null originally, it would have thrown a (caught) exception, whereas now it will crash in the  y.query<X>()  call.

Change-Id: Idbb5a08d635d15b5ca63f4822eddf05fb0a5afa0
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156002
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2023-08-25 14:15:56 +02:00
Noel Grandin
7fc6063914 use more Reference::query instead of UNO_QUERY_THROW
since querying with exceptions is consideably more expensive

Change-Id: I968a9a40766b2abb0d3058549b0ed44011fd5716
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155791
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2023-08-18 11:03:02 +02:00
Juergen Funk
cf650ceaaf tdf#147590 update OLE object after document refresh
Regression from b099da78a6f0b3e120f706714003b05d84d11e70
we didn't update linked OLE document after document reload

Change-Id: I8e52f6430f454b276cb43449c6f7a3b0e07e909f
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/130692
Reviewed-by: Samuel Mehrbrodt <samuel.mehrbrodt@allotropia.de>
Tested-by: Jenkins
2022-05-10 09:02:01 +02:00
Noel Grandin
25298930bc loplugin:flatten in canvas..cui
Change-Id: I208767eaa60d913fe2882403f1f9351eb08256f7
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/127224
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-12-21 15:55:46 +01:00
Mike Kaganski
5661f257f9 Prepare for removal of non-const operator[] from Sequence in comphelper
Change-Id: Ie4f3675adc888ecf175c5342c87d416f34f8dce1
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/124351
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2021-10-29 10:31:35 +02:00
Balazs Varga
a41cf57c1e tdf#134987 convert DOCX to ODT: fix lost charts
Embedded charts of DOCX documents were lost or replaced
by images during conversion to native ODT format,
resulted by bad handling of XEmbedPersist objects in
EmbeddedObjectContainer.

Note: Add missing loext:external-data to ODF 1.3 schema
definition to fix ODF validation error in gerrit.

See commit 2054af83fe
(fdo#72520 : Added property to store external data path in chart)
and commit a49a9dab31
(fix one more ODF validation error).

Change-Id: I9edff9af3a79370ea447ffc6078da3520d0c6f63
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/104104
Tested-by: László Németh <nemeth@numbertext.org>
Reviewed-by: László Németh <nemeth@numbertext.org>
2020-10-13 13:52:49 +02:00
Noel Grandin
960252e129 improve some exception messages
Change-Id: Ifc5d940fbf77ae13071c299fb6168bdc55dc5c95
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/103493
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-09-27 09:50:31 +02:00
Caolán McNamara
de74d98c58 OUStringLiteral/OStringLiteral coverity PARSE_ERROR workaround
do more like

commit 121771e37f
Date:   Mon Sep 21 09:17:54 2020 +0200

    Make some OUStringLiteral vars constexpr

cause coverity can live with that

Change-Id: I9efd7f848289c4865997a44c6780373068422227
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/103147
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2020-09-22 12:58:14 +02:00
Andrea Gelmini
39078750d7 Fix typo in code
It passed "make check on Linux"

Change-Id: I53b40e36c6b1c0aa115044208b5a372fb101347b
2020-08-31 13:08:57 +02:00
Stephan Bergmann
33ecd0d5c4 Change OUStringLiteral from char[] to char16_t[]
This is a prerequisite for making conversion from OUStringLiteral to OUString
more efficient at least for C++20 (by replacing its internals with a constexpr-
generated sal_uString-compatible layout with a SAL_STRING_STATIC_FLAG refCount,
conditionally for C++20 for now).

For a configure-wise bare-bones build on Linux, size reported by `du -bs
instdir` grew by 118792 bytes from 1155636636 to 1155755428.

In most places just a u"..." string literal prefix had to be added.  In some
places

  char const a[] = "...";

variables have been changed to char16_t, and a few places required even further
changes to code (which prompted the addition of include/o3tl/string_view.hxx
helper function o3tl::equalsIgnoreAsciiCase and the additional
OUString::createFromAscii overload).

For all uses of macros expanding to string literals, the relevant uses have been
rewritten as

  u"" MACRO

instead of changing the macro definitions.  It should be possible to change at
least some of those macro definitions (and drop the u"" from their call sites)
in follow-up commits.

Change-Id: Iec4ef1a057d412d22443312d40c6a8a290dc6144
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/101483
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2020-08-28 08:07:09 +02:00
Justin Luth
91d1cd8687 tdf#81522 comphelper: just ignore disposed obj on save
Even if xObj.is(), it might be disposed, and then
getCurrentState() will raise an exception,
resulting in an ERRCODE_IO_GENERAL,
and failing to save the entire document.

Although it might not seem good to just ignore an error
on save, the general attitude in that function already
leans that way. In fact, the other ::StoreChildren()
wraps the entire for-loop in a try-catch.
Also, in this function a bad xPersist also breaks
out of the loop and returns a false.
So wrapping the entire xObj in an "ignore if errors"
try-catch seems reasonable to me in this instance.

The alternative is not to allow the user to save at all,
which is much worse, especially since there is nothing
he can do to fix the problem.

Change-Id: I0372245563735ae7ac7976bf7ce6060e57a5eb87
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/99129
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Reviewed-by: Justin Luth <justin_luth@sil.org>
2020-07-22 17:27:55 +02:00
Noel Grandin
5f56f07e92 use for-range loop on Sequence
Change-Id: Ib2d7b21e0fa52087027c0b3b1d362693c7019ba3
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/93856
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-05-29 20:56:06 +02:00
Noel Grandin
11bdb6b9d9 improve loplugin:referencecasting
to catch a few more cases

Change-Id: I0323fba51bb2b4ba255e1db5aa0d890c5c6a2e1b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/93726
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-05-08 18:32:33 +02:00
Noel Grandin
8d4fd34183 loplugin:flatten in comphelper
Change-Id: I1a8db4dbd744b87406d1db5609585495f01f4403
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/92478
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-04-18 21:46:33 +02:00
Noel Grandin
242e1c42d9 loplugin:referencecasting in comphelper..connectivity
Change-Id: I21896885c29e9ab58ebab17b59f1480c6a06fb38
Reviewed-on: https://gerrit.libreoffice.org/75936
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-07-19 13:28:41 +02:00
Noel Grandin
22f2cf3ccc implement std::hash for css::uno::Reference and rtl::Reference
The declaration in BarChart.cxx is particularly suspicious, because it
was using a < for the KeyEqual template parameter.
Been there since:
    commit b2c3233e5f
    Date:   Thu Dec 21 20:08:33 2017 +0900
    chart2: suspend/resume setting rects dirty for 3D shapes

comphelper::OInterfaceCompare is no longer necessary

Change-Id: I8278c4a3d9113a18570ca237cd05d553ec8f3975
Reviewed-on: https://gerrit.libreoffice.org/71537
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-04-30 08:43:04 +02:00
Gabor Kelemen
368f20001c tdf#42949 Fix IWYU warnings in comphelper
Found with bin/find-unneeded-includes
Only removal proposals are dealt with here.

Also re-evaluate some blacklisted headers and recheck include/comphelper/

Change-Id: Ib7eea5951e849c07cea2e2782be4e8945f71ad96
Reviewed-on: https://gerrit.libreoffice.org/70899
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
2019-04-19 11:31:19 +02:00
Andrea Gelmini
b839763531 Fix typo
Change-Id: Ia778edadc6ca4cf56868e250f0c29efeeef3ca9f
Reviewed-on: https://gerrit.libreoffice.org/70909
Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
Tested-by: Julien Nabet <serval2412@yahoo.fr>
2019-04-18 10:12:13 +02:00
Noel Grandin
eb7c9bcda2 tdf#117066 Saving ODT document with ~1500 bookmarks is slow, part 1
Individually, these don't make much difference, but they add up
to a halving the time to save on my machine.

EmbeddedObjectContainer shows a lot of work in HasEmbeddedObject and
GetEmbeddedObjectName, so add a reverse map there.

Change-Id: Ib758668dbb045e6ceb2611bd86aa2af4fbfb9917
Reviewed-on: https://gerrit.libreoffice.org/70309
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-04-08 08:51:07 +02:00
Arkadiy Illarionov
95a538180f Simplify containers iterations in chart2, cli_ure, comphelper, configmgr
Use range-based loop or replace with STL functions

Change-Id: I7c229faa96e08b76cb4f182a1bd77c15bac4ba76
Reviewed-on: https://gerrit.libreoffice.org/69010
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-03-12 16:10:01 +01:00
Noel Grandin
3b9dcfee64 loplugin:indentation in codemaker..comphelper
Change-Id: I8dee6245cfa1f7998591b31a3752bbbae13f499d
Reviewed-on: https://gerrit.libreoffice.org/67527
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-02-08 10:01:40 +01:00
Noel Grandin
6f50961e69 remove more rtl::OUString and OString prefixes
which seem to have snuck back in since the great rounds of removals.

Change-Id: I85f7f5f4801c0b48dae8b50f51f83595b286d6a1
Reviewed-on: https://gerrit.libreoffice.org/62229
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-10-24 14:43:34 +02:00
Noel Grandin
2c1b7e8d6a clang-tidy readability-container-size-empty
Change-Id: I1df70b7dff5ebb6048f7fc618789faa15ca5d422
Reviewed-on: https://gerrit.libreoffice.org/61967
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-10-19 10:02:39 +02:00
Gabor Kelemen
8df9935dcb tdf#42949 Fix IWYU warnings in include/comphelper/[a-l]*
Found with bin/find-unneeded-includes
Only removal proposals are dealt with here.

Change-Id: I22ba2c8aec235e34cd7835b8a0a716bf3057db7a
Reviewed-on: https://gerrit.libreoffice.org/60837
Tested-by: Jenkins
Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
2018-09-24 23:23:20 +02:00
Noel Grandin
d913b7d2d8 loplugin:unusedmethods
Change-Id: I6f976ba8f792d2cee34859e9258798351eed8b1d
Reviewed-on: https://gerrit.libreoffice.org/52636
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-04-10 08:44:23 +02:00
Noel Grandin
0f28c8612f loplugin:unused-returns in basegfx..cppcanvas
Change-Id: I32dc8c92871c8349651d2f4204a332d387e6e1b2
Reviewed-on: https://gerrit.libreoffice.org/48428
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-01-25 13:51:24 +01:00
Noel Grandin
57c5f98083 loplugin:constmethod in comphelper,ucbhelper
Change-Id: I27a860fbbedd2174c60c199af18cae76e02abc25
Reviewed-on: https://gerrit.libreoffice.org/43759
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-10-25 08:32:27 +02:00
Noel Grandin
87a9979c89 overload std::hash for OUString and OString
no need to explicitly specify it anymore

Change-Id: I6ad9259cce77201fdd75152533f5151aae83e9ec
Reviewed-on: https://gerrit.libreoffice.org/43567
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-10-23 08:15:35 +02:00
Noel Grandin
2c05d758b2 add << operator for css::uno::Exception
Change-Id: Ia23dafd07133779144965682df3b7125a3214235
Reviewed-on: https://gerrit.libreoffice.org/43046
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Tested-by: Jenkins <ci@libreoffice.org>
2017-10-04 15:18:00 +02:00
Noel Grandin
a394d67f37 use more OUString::operator== comphelper..cui
Change-Id: Ib5f3037249152be2b66acf347d1a0c236dc7adfa
Reviewed-on: https://gerrit.libreoffice.org/39888
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-07-13 11:03:14 +02:00
Noel Grandin
539c75b910 strip some linefeeds from the end of debug output
Change-Id: I2821969d86b7f8cee53404e6a0acfbebbe53b3ac
Reviewed-on: https://gerrit.libreoffice.org/39824
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-07-12 08:43:14 +02:00
Stephan Bergmann
2b1c731f3c loplugin:casttovoid: comphelper
Change-Id: I28752323d31320141a537c0e108c911cef09c10a
2017-07-02 22:34:31 +02:00
Noel Grandin
8ed77fae3e loplugin:oncevar in codemaker..connectivity
Change-Id: Ia479d9d3d459a699dfc5c1148d01c35e8bc973bd
Reviewed-on: https://gerrit.libreoffice.org/39000
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-06-20 11:54:20 +02:00
Noel Grandin
8c8f2a5285 remove unnecessary explicit linefeeds from end of SAL and OSL log calls
Change-Id: I3fa363c8e76e6cfb297f4ec346e3f031c09d6fbf
Reviewed-on: https://gerrit.libreoffice.org/36727
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-04-21 09:15:11 +02:00
Caolán McNamara
3f243471b5 ofz: segv on nullptr
Change-Id: I5ec64411b101972ddd150a782b845d4f790ea873
2017-03-19 21:34:58 +00:00
Tor Lillqvist
6de3688cc6 Drop :: prefix from std in c*/
Change-Id: If078cda95fa6ccd37270a5e9d81cfa0b84e71155
Reviewed-on: https://gerrit.libreoffice.org/34324
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Tor Lillqvist <tml@collabora.com>
2017-02-15 23:01:23 +00:00
Stephan Bergmann
20d648625b Some simplifications, using UNO_QUERY_THROW
Change-Id: I143ec0287421675fb13a03e8cf3c7054a17be37f
Reviewed-on: https://gerrit.libreoffice.org/34271
Tested-by: Stephan Bergmann <sbergman@redhat.com>
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2017-02-15 14:19:13 +00:00
Stephan Bergmann
6dce9c6757 Add missing #includes
...and remove some unncessary using directives/declarations, in preparation of
removing now-unnecessary #includes from cppumaker-generated files, post
e57ca02849 "Remove dynamic exception
specifications".

Change-Id: Iaf1f268871e2ee1d1c76cf90f03557527ebc9067
2017-02-06 17:21:16 +01:00
Noel Grandin
8a16f665b1 makeAny->Any in canvas..configmgr
Change-Id: Id06812595f373cd0da8b421dbac34a60a266ae6e
Reviewed-on: https://gerrit.libreoffice.org/33869
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-02-03 10:44:01 +00:00
Huzaifa Iftikhar
5c983bc2ab tdf#70998 Change word "Graphic(s)" to "Image(s)"
There was an error in the previous patch inside the file embeddedobjectcontainer.cxx
This is fixed in this patch.

Change-Id: I01c9e254e58e1683a8e6e9a0bcff3c4663bf32e0
Reviewed-on: https://gerrit.libreoffice.org/32353
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: jan iversen <jani@documentfoundation.org>
2016-12-23 18:27:05 +00:00
Noel Grandin
d15b4e2045 teach sallogareas plugin to catch inconsistencies
Change-Id: I8bcea5ffc74d48148bea78da8c17744e288c069a
Reviewed-on: https://gerrit.libreoffice.org/32004
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2016-12-15 06:45:14 +00:00
Tor Lillqvist
714de95ec5 Remove nonsense comments: // bitfield
Surely the actual bitfield syntax is enough to tell the code reader
that it is a bitfield.

Change-Id: Ic9552e01b19c8b34b2a17db56b9ff63e7c7de926
2016-09-13 11:09:06 +03:00
Noel Grandin
127f70d66a new loplugin to check for static OUStrings
that are better declared as OUStringLiteral

Change-Id: Ifb5d9a12bb31a68641940bec16971a8181a46567
Reviewed-on: https://gerrit.libreoffice.org/27377
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
Tested-by: Noel Grandin <noelgrandin@gmail.com>
2016-08-16 06:30:09 +00:00
nadith
efef273e2c tdf#100726: Improve readability of OUString concatenation
this bug fixed in the modules between canvas - cppu

Change-Id: I2022b022897dafde20251352376e3facdb9b8d75
Reviewed-on: https://gerrit.libreoffice.org/27663
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
2016-08-01 06:12:30 +00:00
Xisco Fauli
e88107c055 tdf#89329: use unique_ptr for pImpl in embeddedobjectcontainer
Change-Id: I679555e2eb51e2b9660bb035a08d8da8b1687cab
Reviewed-on: https://gerrit.libreoffice.org/25747
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
2016-06-03 06:16:52 +00:00
Noel Grandin
74713b34a3 loplugin:unusedmethods
Change-Id: Ib36bc0e87d00abb638cbfec511cd13b6179eabda
Reviewed-on: https://gerrit.libreoffice.org/25431
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
2016-05-26 07:50:33 +00:00
Noel Grandin
2c8fe2e737 update unusedmethods plugin to deal with constructors
and fix the operator< implementations in some of the other
plugins too.

Change-Id: Ie5631e0cdc8d2a994ad2af2533cdb558a6cfc035
Reviewed-on: https://gerrit.libreoffice.org/25057
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
2016-05-18 10:03:44 +00:00
Noel Grandin
58a32075ca use Any constructor instead of temporaries
Change-Id: Iffb82a2cee1a28d89eeea2b905aaa14086ee475a
2016-05-04 12:39:40 +02:00
Seraphime Kirkovski
7739bd5f54 Iteration must not start at the end
Change-Id: I2aebcc909aa9222fc1881e57bbc844025a154e84
Reviewed-on: https://gerrit.libreoffice.org/24497
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Jochen Nitschke <j.nitschke+logerrit@ok.de>
2016-04-29 18:42:16 +00:00
Stephan Bergmann
f555ab4e96 loplugin:salbool: Automatic rewrite of sal_False/True
Change-Id: Idb7e5ff0c73bbc2c462b92cd96444eb5d2d4194b
2016-04-20 17:25:37 +02:00