From ef0023e064d92bf15707b3ed5b350cd3cf89acc1 Mon Sep 17 00:00:00 2001 From: James Hogan Date: Fri, 19 Jun 2009 00:49:03 +0100 Subject: [PATCH] Make openoffice.org plugin compile --- cmake/modules/FindUNO.cmake | 8 ++++---- unipresent/openoffice.org/UpOoBridge.cpp | 11 ++++++++--- 2 files changed, 12 insertions(+), 7 deletions(-) diff --git a/cmake/modules/FindUNO.cmake b/cmake/modules/FindUNO.cmake index d81fdea..37eca54 100644 --- a/cmake/modules/FindUNO.cmake +++ b/cmake/modules/FindUNO.cmake @@ -148,10 +148,10 @@ IF ( UNO_OO_HOME OUTPUT ${UNO_RDB} ${UNO_HPPFILES} COMMAND ${UNO_TOOL_ENV} ${UNO_REGMERGE} ${UNO_RDB} / ${UNO_OO_RDBS} #${UNO_URDFILES} COMMAND ${UNO_TOOL_ENV} ${UNO_CPPUMAKER} -Gc -BUCR -O${UNO_COMPONENT_INC} ${UNO_TYPELIST} ${UNO_RDB} - COMMAND ${UNO_TOOL_ENV} echo ${UNO_REGCOMP} -register -r ${UNO_RDB} -c connector.uno.${UNO_SHLIB_EXT} - COMMAND ${UNO_TOOL_ENV} echo ${UNO_REGCOMP} -register -r ${UNO_RDB} -c remotebridge.uno.${UNO_SHLIB_EXT} - COMMAND ${UNO_TOOL_ENV} echo ${UNO_REGCOMP} -register -r ${UNO_RDB} -c bridgefac.uno.${UNO_SHLIB_EXT} - COMMAND ${UNO_TOOL_ENV} echo ${UNO_REGCOMP} -register -r ${UNO_RDB} -c uuresolver.uno.${UNO_SHLIB_EXT} + COMMAND ${UNO_TOOL_ENV} ${UNO_REGCOMP} -register -r ${UNO_RDB} -c connector.uno.${UNO_SHLIB_EXT} + COMMAND ${UNO_TOOL_ENV} ${UNO_REGCOMP} -register -r ${UNO_RDB} -c remotebridge.uno.${UNO_SHLIB_EXT} + COMMAND ${UNO_TOOL_ENV} ${UNO_REGCOMP} -register -r ${UNO_RDB} -c bridgefac.uno.${UNO_SHLIB_EXT} + COMMAND ${UNO_TOOL_ENV} ${UNO_REGCOMP} -register -r ${UNO_RDB} -c uuresolver.uno.${UNO_SHLIB_EXT} DEPENDS ${UNO_OO_RDBS} ) diff --git a/unipresent/openoffice.org/UpOoBridge.cpp b/unipresent/openoffice.org/UpOoBridge.cpp index 4eef1b5..13f156a 100644 --- a/unipresent/openoffice.org/UpOoBridge.cpp +++ b/unipresent/openoffice.org/UpOoBridge.cpp @@ -28,9 +28,9 @@ #include #include +#include #include -#include #include #include @@ -64,7 +64,7 @@ UpOoBridge::UpOoBridge() QString rdbFileBa = KStandardDirs::locate("data", TYPESDB); if (rdbFileBa.isNull()) { - qDebug() << BACKEND_NAME << i18n("couldn't find data %1").arg(TYPESDB); + kdError() << BACKEND_NAME << i18n("couldn't find data %1").arg(TYPESDB); return; } @@ -81,6 +81,11 @@ UpOoBridge::UpOoBridge() Reference resolver(componentFactory->createInstanceWithContext( OUString::createFromAscii("com.sun.star.bridge.UnoUrlResolver"), componentContext), UNO_QUERY); + if (!resolver.is()) + { + kdError() << BACKEND_NAME << i18n("could not create instance of XUnoUrlResolver"); + return; + } try { m_serviceManager = resolver->resolve(connectionString); @@ -93,7 +98,7 @@ UpOoBridge::UpOoBridge() { // not valid OUString message = exception.Message; - qDebug() << BACKEND_NAME << QString::fromUtf16((const sal_Unicode*)message, message.getLength()) << i18n("(start OpenOffice.org with %1)").arg(QString()+"soffice \"-accept=" + connectionBaCore + "\""); + kdDebug() << BACKEND_NAME << QString::fromUtf16((const sal_Unicode*)message, message.getLength()) << i18n("(start OpenOffice.org with %1)").arg(QString()+"soffice \"-accept=" + connectionBaCore + "\""); return; } else -- 2.11.4.GIT