diff options
author | Tor Lillqvist <tml@collabora.com> | 2019-04-01 15:50:53 +0300 |
---|---|---|
committer | Tor Lillqvist <tml@collabora.com> | 2019-04-01 17:06:32 +0300 |
commit | acf49090ad43573e12af82a527cff24c688263fd (patch) | |
tree | dd67fedf8d9c09bfdbd9924efa200028f63e0d4f | |
parent | 538f7d66b17bfde94e5270b9e2b2fb9850e0d65e (diff) |
Avoid "Text Import" dialog if invoking Paste() from OLE Automation
Excel does not show such a dialog in that case either. At least not in
the customer use case.
Possibly we could try to be clever and sniff the string to see if it
seems to use defaults, like TABs as separators, and if not, then show
the dialog?
Change-Id: Ib12b628eee25273aa489dbbd86004167ca105c0b
-rw-r--r-- | sc/source/ui/view/viewfun5.cxx | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/sc/source/ui/view/viewfun5.cxx b/sc/source/ui/view/viewfun5.cxx index 0b0a65600fd4..7e030c828e22 100644 --- a/sc/source/ui/view/viewfun5.cxx +++ b/sc/source/ui/view/viewfun5.cxx @@ -43,6 +43,7 @@ #include <vcl/transfer.hxx> #include <vcl/graph.hxx> +#include <comphelper/automationinvokedzone.hxx> #include <comphelper/lok.hxx> #include <comphelper/processfactory.hxx> #include <comphelper/storagehelper.hxx> @@ -334,9 +335,10 @@ bool ScViewFunc::PasteDataFormat( SotClipboardFormatId nFormatId, else if ((nFormatId == SotClipboardFormatId::STRING || nFormatId == SotClipboardFormatId::STRING_TSVC) && aDataHelper.GetString( nFormatId, *pStrBuffer )) { - // Do CSV dialog if more than one line. + // Do CSV dialog if more than one line. But not if invoked from Automation. sal_Int32 nDelim = pStrBuffer->indexOf('\n'); - if (nDelim >= 0 && nDelim != pStrBuffer->getLength () - 1) + if (!comphelper::Automation::AutomationInvokedZone::isActive() + && nDelim >= 0 && nDelim != pStrBuffer->getLength () - 1) { vcl::Window* pParent = GetActiveWin(); |