Kaydet (Commit) c502cfeb authored tarafından Tor Lillqvist's avatar Tor Lillqvist

Avoid "Text Import" dialog if invoking Paste() from OLE Automation

Change-Id: Ib12b628eee25273aa489dbbd86004167ca105c0b
üst f710c70b
...@@ -44,6 +44,7 @@ ...@@ -44,6 +44,7 @@
#include <svtools/transfer.hxx> #include <svtools/transfer.hxx>
#include <vcl/graph.hxx> #include <vcl/graph.hxx>
#include <comphelper/automationinvokedzone.hxx>
#include <comphelper/lok.hxx> #include <comphelper/lok.hxx>
#include <comphelper/processfactory.hxx> #include <comphelper/processfactory.hxx>
#include <comphelper/storagehelper.hxx> #include <comphelper/storagehelper.hxx>
...@@ -334,9 +335,10 @@ bool ScViewFunc::PasteDataFormat( SotClipboardFormatId nFormatId, ...@@ -334,9 +335,10 @@ bool ScViewFunc::PasteDataFormat( SotClipboardFormatId nFormatId,
else if ((nFormatId == SotClipboardFormatId::STRING || nFormatId == SotClipboardFormatId::STRING_TSVC) else if ((nFormatId == SotClipboardFormatId::STRING || nFormatId == SotClipboardFormatId::STRING_TSVC)
&& aDataHelper.GetString( nFormatId, *pStrBuffer )) && 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'); 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 = comphelper::LibreOfficeKit::isActive() ? GetActiveWin() : nullptr; vcl::Window* pParent = comphelper::LibreOfficeKit::isActive() ? GetActiveWin() : nullptr;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment