Kaydet (Commit) f751be6f authored tarafından Jack Leigh's avatar Jack Leigh Kaydeden (comit) Michael Meeks

liblibo: create XComponent for doc

Change-Id: Ie07ac4a3e89a9a82a107612b81be18d3826c49e1
üst af969873
...@@ -13,11 +13,14 @@ ...@@ -13,11 +13,14 @@
#include <tools/errinf.hxx> #include <tools/errinf.hxx>
#include <osl/file.hxx> #include <osl/file.hxx>
#include <osl/process.h>
#include <rtl/strbuf.hxx> #include <rtl/strbuf.hxx>
#include <rtl/bootstrap.hxx> #include <rtl/bootstrap.hxx>
#include <cppuhelper/bootstrap.hxx> #include <cppuhelper/bootstrap.hxx>
#include <comphelper/processfactory.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/Locale.hpp>
#include <com/sun/star/lang/XComponent.hpp> #include <com/sun/star/lang/XComponent.hpp>
#include <com/sun/star/lang/XMultiServiceFactory.hpp> #include <com/sun/star/lang/XMultiServiceFactory.hpp>
...@@ -39,6 +42,19 @@ static uno::Reference<css::lang::XMultiComponentFactory> xFactory; ...@@ -39,6 +42,19 @@ static uno::Reference<css::lang::XMultiComponentFactory> xFactory;
LODocument * LODocument *
LibLibreOffice_Impl::documentLoad( const char *docUrl ) 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; return NULL;
} }
...@@ -133,4 +149,3 @@ LibLibreOffice_Impl::~LibLibreOffice_Impl () ...@@ -133,4 +149,3 @@ LibLibreOffice_Impl::~LibLibreOffice_Impl ()
} }
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
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