Log used / selected canvas service

Change-Id: If62dcbffe6514966418bbf78ef3392cc3219f159
Reviewed-on: https://gerrit.libreoffice.org/73074
Tested-by: Jenkins
Reviewed-by: Jan-Marek Glogowski <glogow@fbihome.de>
This commit is contained in:
Jan-Marek Glogowski
2019-05-25 10:22:25 +00:00
parent d3ef215486
commit 1ff55a4409

View File

@@ -18,6 +18,7 @@
*/ */
#include <sal/config.h> #include <sal/config.h>
#include <sal/log.hxx>
#include <algorithm> #include <algorithm>
#include <utility> #include <utility>
@@ -30,6 +31,7 @@
#include <com/sun/star/container/XNameAccess.hpp> #include <com/sun/star/container/XNameAccess.hpp>
#include <com/sun/star/lang/IllegalArgumentException.hpp> #include <com/sun/star/lang/IllegalArgumentException.hpp>
#include <com/sun/star/lang/XServiceInfo.hpp> #include <com/sun/star/lang/XServiceInfo.hpp>
#include <com/sun/star/lang/XServiceName.hpp>
#include <com/sun/star/lang/XSingleComponentFactory.hpp> #include <com/sun/star/lang/XSingleComponentFactory.hpp>
#include <com/sun/star/uno/XComponentContext.hpp> #include <com/sun/star/uno/XComponentContext.hpp>
#include <comphelper/propertysequence.hxx> #include <comphelper/propertysequence.hxx>
@@ -447,13 +449,18 @@ Reference<XInterface> CanvasFactory::createInstanceWithArgumentsAndContext(
OUString const & preferredOne, Sequence<Any> const & args, OUString const & preferredOne, Sequence<Any> const & args,
Reference<XComponentContext> const & xContext ) Reference<XComponentContext> const & xContext )
{ {
Reference<XInterface> xCanvas( Reference<XInterface> xCanvas(lookupAndUse(preferredOne, args, xContext));
lookupAndUse( preferredOne, args, xContext ) ); if (!xCanvas.is())
if(xCanvas.is()) // last resort: try service name directly
return xCanvas; xCanvas = use(preferredOne, args, xContext);
// last resort: try service name directly if (xCanvas.is())
return use( preferredOne, args, xContext ); {
Reference<lang::XServiceName> xServiceName(xCanvas, uno::UNO_QUERY);
SAL_INFO("canvas", "using " << (xServiceName.is() ? xServiceName->getServiceName()
: OUString("(unknown)")));
}
return xCanvas;
} }
// XMultiServiceFactory // XMultiServiceFactory