diff options
author | Tor Lillqvist <tml@collabora.com> | 2019-04-01 15:50:53 +0300 |
---|---|---|
committer | Tor Lillqvist <tml@collabora.com> | 2019-09-20 13:09:30 +0200 |
commit | ea277bb4a8a2fe218e12ff8bd2a46bdc08c6ca26 (patch) | |
tree | 6489e3293c87b6fc2fe9af031d305b8bd6c06167 | |
parent | ba9f91a909cb52194178ac2ed78dc62bd61c1be3 (diff) |
Avoid "Text Import" dialog if invoking Paste() from OLE Automation
Change-Id: Ib12b628eee25273aa489dbbd86004167ca105c0b
Reviewed-on: https://gerrit.libreoffice.org/79197
Reviewed-by: Tor Lillqvist <tml@collabora.com>
Tested-by: Tor Lillqvist <tml@collabora.com>
-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 0eca9685ad61..96e2f270a783 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(); |