diff options
Diffstat (limited to 'connectivity/source/drivers/calc')
-rw-r--r-- | connectivity/source/drivers/calc/CConnection.cxx | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/connectivity/source/drivers/calc/CConnection.cxx b/connectivity/source/drivers/calc/CConnection.cxx index 6576fc1a729b..3ba98f43182c 100644 --- a/connectivity/source/drivers/calc/CConnection.cxx +++ b/connectivity/source/drivers/calc/CConnection.cxx @@ -24,6 +24,7 @@ #include "resource/calc_res.hrc" #include "resource/sharedresources.hxx" #include <com/sun/star/lang/DisposedException.hpp> +#include <com/sun/star/frame/Desktop.hpp> #include <com/sun/star/frame/XComponentLoader.hpp> #include <com/sun/star/sheet/XSpreadsheetDocument.hpp> #include <tools/urlobj.hxx> @@ -32,6 +33,7 @@ #include <unotools/pathoptions.hxx> #include <connectivity/dbexception.hxx> #include <cppuhelper/exc_hlp.hxx> +#include <comphelper/processfactory.hxx> #include <rtl/logfile.hxx> using namespace connectivity::calc; @@ -126,13 +128,7 @@ Reference< XSpreadsheetDocument> OCalcConnection::acquireDoc() aArgs[nPos].Value <<= m_sPassword; } - Reference< XComponentLoader > xDesktop( getDriver()->getFactory()->createInstance( - ::rtl::OUString("com.sun.star.frame.Desktop")), UNO_QUERY ); - if (!xDesktop.is()) - { - OSL_FAIL("no desktop"); - throw SQLException(); - } + Reference< XDesktop2 > xDesktop = Desktop::create( comphelper::getComponentContext(getDriver()->getFactory()) ); Reference< XComponent > xComponent; Any aLoaderException; try |