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>
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>
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>
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
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
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
* 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>
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>
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>
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>
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>
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>
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>
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