summaryrefslogtreecommitdiff
path: root/sot/source/base
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.co.uk>2018-03-29 18:27:13 +0200
committerMiklos Vajna <vmiklos@collabora.co.uk>2018-03-29 19:28:11 +0200
commit29d4ecf32392bc94ab0ba9e73fd79eba65c23fdb (patch)
treea6f88f801f0857063820b7f39a894f10d64fee7b /sot/source/base
parentd7a8fa7adf2b2b098a1e38cd7002c928d015b489 (diff)
tdf#115574 sot: fix Excel -> Writer paste
Reported problem is that nothing happens for paste. Direct cause is that BITMAP is selected as the format, and Excel advertises BITMAP, but when we try to import that, it fails. There are 3 interesting commits in the recent history for this topic: - commit c47db038f98aaf7aec3cbe57c4e5683591afa23e (fdo#52547 SOT: Prefer embedding image data to embedding linked image., 2014-02-07) was a bugfix due to newer firefox - commit 538c13f3d1756f2d105115f64ab1bc0b7426eebc (fdo#78801 fdo#52547 Paste preference is image, then html, then text., 2014-05-28) was a regression fix from the previous fix - commit a96a7ce51aa98fb9ee97ea3803e2b7e648611008 (fdo#81835 Don't prefer GDI Metafiles to RTF/HTML, 2014-08-05), was a regression fix from the previous fixes Going back to the original state shows that the Excel -> Writer use-case used to be RTF. Restore the old Excel -> Writer (RTF) behavior by: - going back to the original state, ignoring the enum class conversions - re-fix fdo#52547: prefer bitmap over html, but leave everything else unchanged - fdo#78801 needs no fix in this case - fdo#81835 needs no fix in this case - tdf#115574 selects RTF -> table shows up After all these complications, the actual fix is surprisingly simple. Change-Id: I2d728afa7d1dd7888fa43525366c197d806eea6c Reviewed-on: https://gerrit.libreoffice.org/52120 Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk> Tested-by: Jenkins <ci@libreoffice.org>
Diffstat (limited to 'sot/source/base')
-rw-r--r--sot/source/base/formats.cxx23
1 files changed, 8 insertions, 15 deletions
diff --git a/sot/source/base/formats.cxx b/sot/source/base/formats.cxx
index afdb25674f0c..692798b5f19e 100644
--- a/sot/source/base/formats.cxx
+++ b/sot/source/base/formats.cxx
@@ -34,20 +34,6 @@
using namespace ::com::sun::star::uno;
using namespace ::com::sun::star::datatransfer;
-struct SotAction_Impl
-{
- SotClipboardFormatId nFormatId; // Clipboard Id
- sal_uInt16 nAction; // Action Id
- SotExchangeActionFlags nFlags; // Action Id
- sal_uInt8 nContextCheckId; // additional check of content in clipboard
-
- constexpr SotAction_Impl(SotClipboardFormatId _nFormatId, sal_uInt16 _nAction, SotExchangeActionFlags _nFlags, sal_uInt8 _nContextCheckId)
- : nFormatId(_nFormatId), nAction(_nAction), nFlags(_nFlags), nContextCheckId(_nContextCheckId) {}
- constexpr SotAction_Impl(SotClipboardFormatId _nFormatId, sal_uInt16 _nAction)
- : nFormatId(_nFormatId), nAction(_nAction), nFlags(SotExchangeActionFlags::NONE), nContextCheckId(0) {}
-};
-
-
// define a context check Id for every formatid
#define FILEGRPDSC_ONLY_URL 1
@@ -894,13 +880,13 @@ SotAction_Impl const aEXCHG_DEST_SWDOC_FREE_AREA_Copy[] =
{ SotClipboardFormatId::SD_OLE, EXCHG_OUT_ACTION_INSERT_OLE, SotExchangeActionFlags::InsertImageMap | SotExchangeActionFlags::InsertTargetUrl, 0 },
{ SotClipboardFormatId::EMBED_SOURCE, EXCHG_OUT_ACTION_INSERT_OLE, SotExchangeActionFlags::InsertTargetUrl, 0 },
{ SotClipboardFormatId::EMBEDDED_OBJ, EXCHG_OUT_ACTION_INSERT_OLE, SotExchangeActionFlags::InsertTargetUrl, 0 },
+ { SotClipboardFormatId::RTF, EXCHG_IN_ACTION_COPY, SotExchangeActionFlags::InsertTargetUrl, 0 },
{ SotClipboardFormatId::PNG, EXCHG_OUT_ACTION_INSERT_BITMAP, SotExchangeActionFlags::InsertImageMap | SotExchangeActionFlags::InsertTargetUrl, 0 },
{ SotClipboardFormatId::JPEG, EXCHG_OUT_ACTION_INSERT_BITMAP, SotExchangeActionFlags::InsertImageMap | SotExchangeActionFlags::InsertTargetUrl, 0 },
{ SotClipboardFormatId::BITMAP, EXCHG_OUT_ACTION_INSERT_BITMAP, SotExchangeActionFlags::InsertImageMap | SotExchangeActionFlags::InsertTargetUrl, 0 },
{ SotClipboardFormatId::HTML, EXCHG_OUT_ACTION_INSERT_HTML, SotExchangeActionFlags::InsertImageMap | SotExchangeActionFlags::InsertTargetUrl, 0 },
{ SotClipboardFormatId::HTML_NO_COMMENT, EXCHG_OUT_ACTION_INSERT_HTML, SotExchangeActionFlags::InsertImageMap | SotExchangeActionFlags::InsertTargetUrl, 0 },
{ SotClipboardFormatId::HTML_SIMPLE, EXCHG_OUT_ACTION_INSERT_HTML, SotExchangeActionFlags::InsertImageMap | SotExchangeActionFlags::InsertTargetUrl, 0 },
- { SotClipboardFormatId::RTF, EXCHG_IN_ACTION_COPY, SotExchangeActionFlags::InsertTargetUrl, 0 },
{ SotClipboardFormatId::NETSCAPE_IMAGE, EXCHG_IN_ACTION_COPY, SotExchangeActionFlags::InsertTargetUrl, 0 },
{ SotClipboardFormatId::STRING, EXCHG_OUT_ACTION_INSERT_STRING, SotExchangeActionFlags::InsertTargetUrl, 0 },
{ SotClipboardFormatId::NETSCAPE_BOOKMARK, EXCHG_OUT_ACTION_INSERT_HYPERLINK, SotExchangeActionFlags::InsertImageMap | SotExchangeActionFlags::InsertTargetUrl, 0 },
@@ -1314,6 +1300,13 @@ SotDestinationEntry_Impl const aDestinationArray[] =
} // namespace
+namespace sot
+{
+const SotAction_Impl* GetExchangeDestinationWriterFreeAreaCopy()
+{
+ return aEXCHG_DEST_SWDOC_FREE_AREA_Copy;
+}
+}
// - new style GetExchange methods -