summaryrefslogtreecommitdiff
path: root/sc/source/ui/docshell/docsh.cxx
diff options
context:
space:
mode:
authorTor Lillqvist <tml@collabora.com>2018-05-02 14:57:48 +0300
committerTor Lillqvist <tml@collabora.com>2018-05-31 15:46:25 +0300
commit7d275e3ab35b3f9bfd7ff16290393ca027c50355 (patch)
tree548636c515e034d4a258219fb65d7d953e6065a2 /sc/source/ui/docshell/docsh.cxx
parentad57e6d3369b10c181cb644729466512428cc52d (diff)
Implement NewWorkbook and WorkbookOpen Automation callbacks in Calc
Change-Id: I1ff31d692100695a706bf128c18c4e3ae8b55ce3
Diffstat (limited to 'sc/source/ui/docshell/docsh.cxx')
-rw-r--r--sc/source/ui/docshell/docsh.cxx32
1 files changed, 32 insertions, 0 deletions
diff --git a/sc/source/ui/docshell/docsh.cxx b/sc/source/ui/docshell/docsh.cxx
index d2ae9a945c18..362ddbd0a6e7 100644
--- a/sc/source/ui/docshell/docsh.cxx
+++ b/sc/source/ui/docshell/docsh.cxx
@@ -1080,6 +1080,33 @@ void ScDocShell::Notify( SfxBroadcaster&, const SfxHint& rHint )
pClipDoc->ClosingClipboardSource();
}
}
+
+ if ( const SfxEventHint* pSfxEventHint = dynamic_cast<const SfxEventHint*>(&rHint) )
+ {
+ switch( pSfxEventHint->GetEventId() )
+ {
+ case SfxEventHintId::CreateDoc:
+ {
+ uno::Any aWorkbook;
+ aWorkbook <<= mxAutomationWorkbookObject;
+ uno::Sequence< uno::Any > aArgs(1);
+ aArgs[0] = aWorkbook;
+ SC_MOD()->CallAutomationApplicationEventSinks( "NewWorkbook", aArgs );
+ }
+ break;
+ case SfxEventHintId::OpenDoc:
+ {
+ uno::Any aWorkbook;
+ aWorkbook <<= mxAutomationWorkbookObject;
+ uno::Sequence< uno::Any > aArgs(1);
+ aArgs[0] = aWorkbook;
+ SC_MOD()->CallAutomationApplicationEventSinks( "WorkbookOpen", aArgs );
+ }
+ break;
+ default:
+ break;
+ }
+ }
}
// Load contents for organizer
@@ -3340,6 +3367,11 @@ void ScDocShell::SetIsInUcalc()
mbUcalcTest = true;
}
+void ScDocShell::RegisterAutomationWorkbookObject(css::uno::Reference< ooo::vba::excel::XWorkbook > const& xWorkbook)
+{
+ mxAutomationWorkbookObject = xWorkbook;
+}
+
extern "C" SAL_DLLPUBLIC_EXPORT bool TestImportSLK(SvStream &rStream)
{
ScDLL::Init();