diff options
author | Tor Lillqvist <tml@collabora.com> | 2018-04-23 20:50:43 +0300 |
---|---|---|
committer | Tor Lillqvist <tml@collabora.com> | 2018-05-31 15:29:43 +0300 |
commit | b9ef6b66e7a67a448b1a840c47146d8789a92a6d (patch) | |
tree | 8dab5043884df3ee37f31b41fab4fc268b887a17 /extensions | |
parent | 8a2f30e548f930f0ddd869e07f58947616ba9ea4 (diff) |
Initial steps to make also Calc usable from Automation clients
Largely parallel to what we do for Writer.
Yes, there is a fair amount of duplicated code now for the outgoing
("sink") stuff in sw and sc, that should be factored out (to
vbahelper, probably).
Change-Id: I8df4a81c3b9043e8d6b0b206e3c04660205987c7
Diffstat (limited to 'extensions')
-rw-r--r-- | extensions/source/ole/servprov.cxx | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/extensions/source/ole/servprov.cxx b/extensions/source/ole/servprov.cxx index 2fccd9a59b9f..45e693b20982 100644 --- a/extensions/source/ole/servprov.cxx +++ b/extensions/source/ole/servprov.cxx @@ -54,6 +54,10 @@ DEFINE_GUID(OID_ServiceManager, 0x82154420, 0xfbf, 0x11d4, 0x83, 0x13, 0x0, 0x50 // {82154421-0FBF-11d4-8313-005004526AB4} DEFINE_GUID(OID_LibreOfficeWriterApplication, 0x82154421, 0xfbf, 0x11d4, 0x83, 0x13, 0x0, 0x50, 0x4, 0x52, 0x6a, 0xb4); +// For Calc +// {82154425-0FBF-11d4-8313-005004526AB4} +DEFINE_GUID(OID_LibreOfficeCalcApplication, 0x82154425, 0xfbf, 0x11d4, 0x83, 0x13, 0x0, 0x50, 0x4, 0x52, 0x6a, 0xb4); + OneInstanceOleWrapper::OneInstanceOleWrapper( const Reference<XMultiServiceFactory>& smgr, std::function<const Reference<XInterface>()> xInstFunction ) : m_refCount(0) @@ -488,6 +492,18 @@ OleServer::OleServer( const Reference<XMultiServiceFactory>& smgr): return xApplication; }, &OID_LibreOfficeWriterApplication ); + + (void) provideInstance( [&] + { + // Ditto for sc + static const Reference<XInterface> xCalcGlobals = m_smgr->createInstance("ooo.vba.excel.Globals"); + const Reference<ooo::vba::XHelperInterface> xHelperInterface(xCalcGlobals, UNO_QUERY); + Any aApplication = xHelperInterface->Application(); + Reference<XInterface> xApplication; + aApplication >>= xApplication; + return xApplication; + }, + &OID_LibreOfficeCalcApplication ); } OleServer::~OleServer() |