diff options
author | Jack Leigh <leighman@gmx.se> | 2013-03-05 14:29:26 +0000 |
---|---|---|
committer | Michael Meeks <michael.meeks@suse.com> | 2013-03-12 15:35:34 +0000 |
commit | f751be6fa0c097ad51e28a79fa91141bf3313d8f (patch) | |
tree | 52beed2f79f425ebe43cf5f51ddbeb75aa1dd105 /desktop/source/lib | |
parent | af969873cb01e44aacfa34623ce1f0d51a62c895 (diff) |
liblibo: create XComponent for doc
Change-Id: Ie07ac4a3e89a9a82a107612b81be18d3826c49e1
Diffstat (limited to 'desktop/source/lib')
-rw-r--r-- | desktop/source/lib/init.cxx | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx index 0628b7f8f7e3..de5788dd0420 100644 --- a/desktop/source/lib/init.cxx +++ b/desktop/source/lib/init.cxx @@ -13,11 +13,14 @@ #include <tools/errinf.hxx> #include <osl/file.hxx> +#include <osl/process.h> #include <rtl/strbuf.hxx> #include <rtl/bootstrap.hxx> #include <cppuhelper/bootstrap.hxx> #include <comphelper/processfactory.hxx> +#include <com/sun/star/beans/XPropertySet.hpp> +#include <com/sun/star/frame/Desktop.hpp> #include <com/sun/star/lang/Locale.hpp> #include <com/sun/star/lang/XComponent.hpp> #include <com/sun/star/lang/XMultiServiceFactory.hpp> @@ -39,6 +42,19 @@ static uno::Reference<css::lang::XMultiComponentFactory> xFactory; LODocument * LibLibreOffice_Impl::documentLoad( const char *docUrl ) { + OUString sUrl = OUString::createFromAscii (docUrl); + OUString sAbsoluteDocUrl, sWorkingDir, sDocPathUrl; + + uno::Reference < css::frame::XDesktop2 > xComponentLoader = + css::frame::Desktop::create(xContext); + + osl_getProcessWorkingDir(&sWorkingDir.pData); + osl::FileBase::getFileURLFromSystemPath(sUrl, sDocPathUrl); + osl::FileBase::getAbsoluteFileURL(sWorkingDir, sDocPathUrl, sAbsoluteDocUrl); + + uno::Reference < css::lang::XComponent > xComponent = xComponentLoader->loadComponentFromURL( + sAbsoluteDocUrl, OUString("_blank"), 0, + uno::Sequence < css::beans::PropertyValue >()); return NULL; } @@ -133,4 +149,3 @@ LibLibreOffice_Impl::~LibLibreOffice_Impl () } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ - |