1396 Commits
Author SHA1 Message Date
Julien Nabet 4bc8d8e4dd tdf#173869: Compound File Binary version 4 rejected - PPT/DOC fail to load
Bugtracker submitted but also analyzed and with suggestion of a fix by
Florian Stascheck (florian.stascheck@gmail.com)
(see bugtracker for the whole analysis)
Thank you to him!

Edit:
m_nPageSize is in fact the sector shift
(see https://learn.microsoft.com/en-us/openspecs/windows_protocols/ms-cfb/05060311-bfce-4b12-874d-71fd4ce63aea)
so name the constants accordingly.

Change-Id: Iccbad515c0cda243e1ed9eec12caf7b614215484
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/211958
Tested-by: Jenkins
Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2026-10-08 07:56:16 +02:00
Andrea Gelmini aae006522f Fix typos
Change-Id: I9d41f9ab9cf8d9d547159de79bd7eaebba55491b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/209912
Tested-by: Julien Nabet <serval2412@yahoo.fr>
Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2026-08-25 10:40:57 +02:00
Ujjawal Kumar 0c361202d0 tdf#171121 Lower the priority of markdown on the clipboard even further
Lower markdown preference below plain text because it is natively not
supported in almost all known clipboard services and offering it via
paste special seems to be a better choice.

Signed-off-by: Ujjawal Kumar <ujjawal.kumarchouhan@collabora.com>
Change-Id: I6bbba63ab56aca4a68ea2838a0036c9bc37b2238
Reviewed-on: https://gerrit.collaboraoffice.com/c/online/+/2955
Tested-by: Jenkins CPCI <releng@collaboraoffice.com>
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
(cherry picked from commit 149ecd37eee98f6b52161733ce64a883ed603000)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/205526
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2026-05-22 16:12:28 +02:00
Ujjawal Kumar d5509c16ca tdf#171121 Lower the priority of markdown on the clipboard
Change-Id: I47957a35d08c5cd47c1a896e80e4202c4078127f
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/202305
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-by: Michael Stahl <michael.stahl@collabora.com>
(cherry picked from commit 372dc1487e9741dbf15fb717bc1f8a552ab22196)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/202304
Tested-by: Jenkins
2026-03-24 10:36:15 +01:00
Ujjawal Kumar 517e2fb772 Add Markdown under paste special for gtk3.
Change-Id: I423bfa356c337e7a6365beda0dcf1fff233f3edd
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/199096
Tested-by: Jenkins
Reviewed-by: Thorsten Behrens <thorsten.behrens@collabora.com>
2026-02-16 05:10:48 +01:00
Gabor Kelemen bce3ef60a8 tdf#146619 Use more forward declarations in include/sot/
Change-Id: I6706c7009432d0d8d7bc6f9193d8f020e9aedf25
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/198239
Reviewed-by: Gabor Kelemen <gabor.kelemen@collabora.com>
Tested-by: Jenkins
2026-02-06 19:33:51 +01:00
Gabor Kelemen b42aef5df3 tdf#146619 Run IWYU again on include/sot/
Change-Id: I10ac9a7bcd0727a549943227a454475148f36b97
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/193913
Reviewed-by: Gabor Kelemen <gabor.kelemen@collabora.com>
Tested-by: Jenkins
2025-11-29 14:12:45 +01:00
Mike Kaganski 88c9155e51 Use static_assert instead of assert
Change-Id: Ief4ec64b931ee423482f4178463e001d43446f76
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/194085
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2025-11-17 07:25:45 +01:00
Laurent BallandandMike Kaganski ba49c9249f tdf#127675 Treat Biff12 when pasting
Prior to Biff8, Biff12 is tested as format for pasting.

The new format is read using SfxObjectShell::DoLoad. Since the import
must be to an ScDocument in SCDOCMODE_CLIP mode, a new ctor was added
for SfxObjectShell, that initializes the document with needed mode.

The change in MS_Excel_2007_Binary.xcu enables GetFilter4ClipBoardId
to return the correct filter.

Since clipboard documents don't have a chart listener collection, we
must not call SetChartListenerCollectionNeedsUpdate from SetChanged;
otherwise, ScDocument::UpdateChartListenerCollection would crash.

Change-Id: If57b1ffb9a2f8d0573cf77b9eb82f81aa4250b5e
Co-authored-by: Mike Kaganski <mike.kaganski@collabora.com>
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/190077
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2025-11-16 16:05:34 +01:00
codemaestro 003380c797 tdf#145614: Convert #define to enum class
Change-Id: I4efedf1aedf5b41dc2db6a91c2e3f66065b0275f
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/192671
Reviewed-by: Hossein <hossein@libreoffice.org>
Tested-by: Jenkins
2025-11-13 11:54:49 +01:00
Mike Kaganski dbdc2f17d6 Refactor initialization of translation table
Most of the table in ftransl.cxx reuses data from exchange.cxx. The fact
that we duplicate everything in several places naturally leads to errors,
which shows in this change.

1. Introduce a FormatEntry ctor taking SotClipboardFormatId, to obtain
DataFlavor from that identifier, instead of using a copy of MIME type
strings and corresponding human-presentable-names and data types for
creation of DataFlavor.

2. Use it for all elements that have SotClipboardFormatId for them. It
turns out, that in the end, only one element can't be constructed that
way, because there is no SotClipboardFormatId for CF_LOCALE.

2.1. While at it, make some elements' data consistent.
Fixed MIME types (all were errors):
* application/x-openoffice-svbx -> application/x-openoffice-svxb
* application/x-openoffice-msgattachfile -> application/x-openoffice-cnt-msgattachfile
* application/x-openofficesba-tabed -> application/x-openoffice-sba-tabed
Fixed native format names (these are mostly unimportant cosmetics):
* Unicode-Text -> Text
* EditEngine ODF -> Flat XML format (EditEngine ODF)
* StatusInfo vom SvxInternalLink -> StatusInfo of SvxInternalLink
* PNG -> PNG Bitmap

2.2. Drop SO_DUMMYFORMAT_3 and SO_DUMMYFORMAT_4, which were never used from
initial import.

3. Obtain native format name from MIME types, where "windows_formatname"
parameter is defined. This allows to drop another redundancy.

4. To avoid building the table before program initializes (and process
component context is available, needed to create XMimeContentTypeFactory,
needed to parse MIME type parameters), make table function-local static.

Change-Id: I72320aa54f154e9cc79c8b9ba700c7afecf89eb7
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/193691
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2025-11-10 07:38:32 +01:00
Mike Kaganski effd6814a7 An omission from commit 84c1c49d86
... "Fix Unicode-dependent format names", 2025-11-09.

Change-Id: I87f47be21b0afe9e788d3243f07e85358ec88e1b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/193662
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2025-11-09 20:05:24 +01:00
Mike Kaganski 84c1c49d86 Fix Unicode-dependent format names
For application/x-openoffice-file, a change from FileName to FileNameW
happened in commit 5fb9f4ffa9 (tdf#145964:
Windows format name is FileNameW for Unicode strings, 2021-12-01). But
there I didn't fix aNativeFormatName value to match the string in MIME
type, because I was confused that it co-incided with human-presentable
name.

Seeing what was used for application/x-openoffice-filename, I realized
that these need to match the correct sormat string.

Commit 558956dc81 (Drop UNICODE/_UNICODE
defines, 2019-04-04) changed the meaning of UNICODE-dependent defines
CFSTR_FILEDESCRIPTOR and CFSTR_FILENAME, used in the format list. This
change fixes that by explicitly using *W strings.

Other related commits are:
- 52e1d0ca6a Windows format name is
  UniformResourceLocatorW for Unicode strings, 2021-12-03
- f586839956 Windows format name is
  FileGroupDescriptorW for Unicode strings, 2021-12-03

Change-Id: Ic258e6311601ffe9d653bece17b7eef3a8f94f23
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/193659
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2025-11-09 18:00:15 +01:00
Mike Kaganski 5f582394e6 Drop DataFlavorRepresentation, use datatransfer::DataFlavor directly
Change-Id: I8b48fef0a4edbfd82a774943a344f489a5c9a26c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/191243
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2025-09-20 20:04:50 +02:00
Mike Kaganski a255b04d8d Shorten some names ending with _ASCII
Whatever that was intended to mean: if that meant that the constants
were encoded that way, these are UTF-16 already; is that meant that
they only contained characters in that range, that is unimportant.

Change-Id: I5463f1fca0d552a93d3c9d487ed9912c9e1a989e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/191240
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Tested-by: Jenkins
2025-09-20 19:35:12 +02:00
Mike Kaganski 24a54f699e Shorten comments that moved code too far to the right
Change-Id: Ifd1fa0cb361733c3528e50529ce2f4f213bddca3
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/191230
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Tested-by: Jenkins
2025-09-20 17:40:35 +02:00
Mike Kaganski 41b259ca7f Add a function to add new dynamic flavor
Allows to deduplicate some more code.

Change-Id: I1753f12e26f67cf4de7b921ebae1575f9f7208f7
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/191228
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2025-09-20 16:57:51 +02:00
Mike Kaganski e98986dbd2 Use GetFormatIdFromMimeType in RegisterFormatMimeType
This follows the pattern in RegisterFormat, which uses GetFormat.

This is potentially a functional change, because now RegisterFormatMimeType
uses the "Hack for a temporary chart format string StarChartDocument 5.0"
introduced in commit 0dd53c8d11. But taking
into account the only place where the function is used, it will not change
program behavior at all.

Change-Id: Ie02acd67e86f5ab6f7fb699f8b44dcff8a93cb21
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/191223
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Tested-by: Jenkins
2025-09-20 15:55:12 +02:00
Mike Kaganski f68e27ac1d Add functions to convert SotClipboardFormatId <-> index in array
Makes the code readable.

Change-Id: I5c0dc277911149a6a2ae8bea65887812105d3a0d
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/191221
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Tested-by: Jenkins
2025-09-20 13:01:50 +02:00
Mike Kaganski 68a806a662 Drop useless (and sometimes erroneous) comments
I don't know where "CLIP.SDW" is, so I keep those lines just in case.

Change-Id: Ie017be0acdb7d2e7eb7ea2b97669191c68392a14
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/191222
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2025-09-20 12:53:44 +02:00
Mike Kaganski 215c439742 Deduplicate the code
Before commit ba1cd49642 (Make
SotExchange::GetFormat() accept a MIME type with additional
parameters, 2021-01-14), SotExchange::GetFormatIdFromMimeType
and SotExchange::GetFormat did exactly the same thing; it's
unclear why weren't they deduplicated from start.

The said commit introduced some functional difference. Maybe
it makes sense to unify their functionality again; but since
there was some discussion in the respective git review (see
https://gerrit.libreoffice.org/c/core/+/109254), this change
keeps the difference.

Change-Id: I062b21b25c47d27592c4b05bd0f6cbc629040efc
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/191214
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Tested-by: Jenkins
2025-09-20 11:28:57 +02:00
Mike Kaganski d11111f342 Simplify the check introduced in ba1cd49642
Change-Id: Ie1c7acb9865f50fd0fd7784f6c045d6584f509ea
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/191213
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Tested-by: Jenkins
2025-09-20 11:28:50 +02:00
Ujjawal Kumar f8c2fbdbce tdf#162153 Introduce clipboard support for Markdown format.
* Can be used under "Paste As" by manually registering markdown mime type "text/markdown" using cli tools like xclip and wl-paste.
* Example - echo 'World of **Markdown**' | wl-copy --type text/markdown

Change-Id: I2f4c7eacf201f65eab8361a50eb246988caf9f29
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/187792
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2025-07-29 13:09:26 +02:00
Noel Grandin 22f46bd89f use more concrete UNO classes
Change-Id: Id10786bbf7985adbb251224b45f9dabcc84d0a3d
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/182721
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2025-03-10 14:18:35 +01:00
Noel Grandin 65caa58206 loplugin:reftotemp in sot..svl
Change-Id: I4c15b3443f411e81eaf7ea0e8c98e8728ab4ca02
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/176482
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2024-11-12 16:06:24 +01:00
Noel Grandin 5fdfc074c9 loplugin:passstuffbyref make some small improvements
Change-Id: Ib14a2e6b41165887fcf99c3d155850faa8564822
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/176218
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2024-11-07 17:20:09 +01:00
Noel Grandin 19bc8856c4 move vcl::DeleteOnDeinit to tools
so we can fix a shutdown use-after-free in sot.

Change-Id: I32f83bd94627d72d7bee7ea2ebd6ab77a7f78435
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/175335
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2024-10-22 08:01:19 +02:00
Noel Grandin a6ad198d09 tdf#158556 use more comphelper::ByteReader
which avoids a ton of temporary uno::Sequence being created

Change-Id: I237bb69395f692bb0272ca0daec05b81af828e01
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/171968
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Tested-by: Jenkins
2024-08-27 09:10:04 +02:00
Noel Grandin ece0729e18 use less exception throwing for flow control
Change-Id: Ib376a1bcb75e72d6e5754818a353b0d9c7dbd26d
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/171851
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2024-08-14 18:05:59 +02:00
Gabor Kelemen e1a351ca19 Remove now unneeded osl/diagnose.h
followup to commit 57c228803e

Change-Id: Iebfb23bb65e2bf898bf27f367cc9641f47a14cf3
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/167998
Reviewed-by: Gabor Kelemen <gabor.kelemen.extern@allotropia.de>
Tested-by: Jenkins
2024-07-20 10:20:31 +02:00
Noel Grandin a9cf09844e loplugin:ostr in sot
Change-Id: I782a071672b8c1fa2a843637fc5d7e993dbe0ef2
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/167599
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2024-05-13 20:11:36 +02:00
Caolán McNamara fdbc8d1374 WaE: C6011 Dereferencing NULL pointer warnings
Change-Id: Ie1aff54bbc2d9dad0298636bf680ac7790f70a72
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/166941
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
2024-05-01 09:17:27 +02:00
Caolán McNamara fe72e20f86 CopyTo is never passed a null argument
Change-Id: Ie25e61d6795819a9c432d71fdf478b1a4430c06f
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/166940
Tested-by: Caolán McNamara <caolan.mcnamara@collabora.com>
Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
2024-05-01 09:17:14 +02:00
Noel Grandin 25b642fdd8 simplify SotTempStream and lifetime
It is really just an SvStream instance, and the lifetime does
not need reference counting

Change-Id: Idb5ffd96f852aae0dc1a94cddc0a83fbcdf974ff
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/165655
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2024-04-02 07:53:43 +02:00
Mike Kaganski 1ac5353bbb Use weak reference to SfxObjectShell in SfxEventHint to avoid use-after-free
The events may be processed after the shell has been destroyed. This is
happening reliably after commit e2bfc34d14
(Reimplement OleComponentNative_Impl to use IGlobalInterfaceTable,
2024-03-11) when controlling LibreOffice from external Java scripts; but
obviously, it could happen before as well.

Now SotObject inherits from cppu::OWeakObject, instead of SvRefBase.

Change-Id: I73a3531499a3068c801c98f40de39bdf8ad90b2b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/164458
Tested-by: Mike Kaganski <mike.kaganski@collabora.com>
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2024-03-11 04:43:28 +01:00
Gabor Kelemen ab95ed2c4b Use less boost_headers in low level libraries
Most of these don't use boost themselves, nor do they need
it transitively since the use of boost::optional was removed

Change-Id: Ic9dee1c4e160b313ec5b91677b02ffdea6c5779d
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/164440
Tested-by: Jenkins
Reviewed-by: Thorsten Behrens <thorsten.behrens@allotropia.de>
2024-03-06 21:23:17 +01:00
Damjan Jovanovic 6c04b8356c i#112829: offer svg as clipboard format as well
When copying charts, shapes, etc. out of LibreOffice, export them to
the clipboard in the (lossless) SVG graphics format as well.

This can be pasted into GIMP, Inkscape, and other apps, unlike our
current WMF/EMF clipboard formats which use private MIME types that
nothing supports.

(cherry picked from commit 61aee323790d0a1ed0745ee5a84b8885bcd0a559)

Change-Id: Ia32be448a096154bb092d49f372148c6b2263f35
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/163412
Tested-by: Thorsten Behrens <thorsten.behrens@allotropia.de>
Reviewed-by: Thorsten Behrens <thorsten.behrens@allotropia.de>
2024-02-15 22:09:34 +01:00
Noel Grandin 3653efd060 use more unique_ptr in StgTmpStrm
Change-Id: Ib2d598323f94e76e90fc5fef68094dfefba6d3c9
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/161433
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2023-12-30 08:13:21 +01:00
Caolán McNamara 95e12eaebc cid#1545789 COPY_INSTEAD_OF_MOVE
and

cid#1545791 COPY_INSTEAD_OF_MOVE
cid#1545800 COPY_INSTEAD_OF_MOVE
cid#1545806 COPY_INSTEAD_OF_MOVE
cid#1545817 COPY_INSTEAD_OF_MOVE
cid#1545832 COPY_INSTEAD_OF_MOVE
cid#1545834 COPY_INSTEAD_OF_MOVE
cid#1545841 COPY_INSTEAD_OF_MOVE
cid#1545848 COPY_INSTEAD_OF_MOVE
cid#1545852 COPY_INSTEAD_OF_MOVE
cid#1545854 COPY_INSTEAD_OF_MOVE
cid#1545864 COPY_INSTEAD_OF_MOVE
cid#1545875 COPY_INSTEAD_OF_MOVE
cid#1545882 COPY_INSTEAD_OF_MOVE
cid#1545900 COPY_INSTEAD_OF_MOVE
cid#1545901 COPY_INSTEAD_OF_MOVE
cid#1545908 COPY_INSTEAD_OF_MOVE
cid#1545921 COPY_INSTEAD_OF_MOVE
cid#1546054 COPY_INSTEAD_OF_MOVE
cid#1546145 COPY_INSTEAD_OF_MOVE
cid#1546146 COPY_INSTEAD_OF_MOVE

Change-Id: I8b23d0457cb293aa0e33593131224c1cdd1d8eb1
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/160545
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
2023-12-10 20:27:43 +01:00
Andrea Gelmini 2f9a680279 Fix typo
Change-Id: I25685976a4cd4549ab6448bcba179d5c4e7185bf
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158745
Tested-by: Jenkins
Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2023-11-01 12:52:55 +01:00
Mike Kaganski d8b9f57c0f Use std::span
Change-Id: Id40dd540d715ed79f7fe09e686fd0a9909d82d74
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157792
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2023-10-11 08:50:20 +02:00
Mike Kaganski f47e4b152f Simplify a bit
Change-Id: If87cf8d71ce49af191cf991e2dc5479b275cd918
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157745
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2023-10-11 08:50:10 +02:00
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
Noel Grandin da54fbce1c use sal_uInt64 when dealing with stream position
Change-Id: I2869e115941b3e1f52911d58d54ec1b2831d0524
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155524
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2023-08-09 20:06:54 +02:00
Noel Grandin 009b889616 do not throw DisposedException when inside a dispose() method
There is no need to do this, as the documentation of
css.lang.XComponent::dispose at

    udkapi/com/sun/star/lang/XComponent.idl

states:

    After this method has been called, the object should
    behave as passive as possible, thus it should ignore all calls

Otherwise, the effect of throwing here is mostly to disturb the flow of
logic in caller code, preventing other parts of teardown from proceeding
smoothly.

Change-Id: I30e6d1b35f85b727debf4405a995fdc0a4fccde6
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152450
Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2023-05-31 18:37:34 +02:00
Mike Kaganski 0dcbf8a5a5 Use getXWeak in sot
Change-Id: I68d6b7393b367b68206c92cd65705326c5aeda7d
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/150870
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2023-04-30 20:34:59 +02:00
Noel Grandin bc2101646b loplugin:stringviewparam improvements
improve the check by checking for methods that exclude
using string_view, rather than checking for methods that
__can__ use string_view, which leads to exposing
some holes in our o3tl/string_view.hxx coverage.

Change-Id: Ic9dd60441c671f502692f9cd2a1bb67301c4b960
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/150277
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2023-04-14 07:54:28 +02:00
Miklos Vajna 34504d2496 CppunitTest_sot_test_sot: remove duplicated assert
This was added in commit 29d4ecf323
(tdf#115574 sot: fix Excel -> Writer paste, 2018-03-29), where it was
hard to consider 4 bugreports at the same time, so I wrote asserts for
each bugreport. But at the end 1 bugreport is a superset of an other
one, so just moving the 2 comments next to each other having 2 asserts
instead of 3 leads to a simple removal of the duplication.

Change-Id: Iaedccf5ac498dd6842c25b60b507e63332daddf9
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/148847
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
Tested-by: Jenkins
2023-03-14 15:28:45 +00:00
Noel Grandin d6ae28fe07 no need to allocate ucbhelper::Content separately in UCBStorage_Impl
it is only one pointer big

Change-Id: Id60710eca9a170733ebba4120359e03f384f9962
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/147945
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2023-02-28 10:53:47 +00:00