Kaydet (Commit) 1ff55a44 authored tarafından Jan-Marek Glogowski's avatar Jan-Marek Glogowski

Log used / selected canvas service

Change-Id: If62dcbffe6514966418bbf78ef3392cc3219f159
Reviewed-on: https://gerrit.libreoffice.org/73074
Tested-by: Jenkins
Reviewed-by: 's avatarJan-Marek Glogowski <glogow@fbihome.de>
üst d3ef2154
......@@ -18,6 +18,7 @@
*/
#include <sal/config.h>
#include <sal/log.hxx>
#include <algorithm>
#include <utility>
......@@ -30,6 +31,7 @@
#include <com/sun/star/container/XNameAccess.hpp>
#include <com/sun/star/lang/IllegalArgumentException.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/uno/XComponentContext.hpp>
#include <comphelper/propertysequence.hxx>
......@@ -447,13 +449,18 @@ Reference<XInterface> CanvasFactory::createInstanceWithArgumentsAndContext(
OUString const & preferredOne, Sequence<Any> const & args,
Reference<XComponentContext> const & xContext )
{
Reference<XInterface> xCanvas(
lookupAndUse( preferredOne, args, xContext ) );
if(xCanvas.is())
return xCanvas;
Reference<XInterface> xCanvas(lookupAndUse(preferredOne, args, xContext));
if (!xCanvas.is())
// last resort: try service name directly
return use( preferredOne, args, xContext );
xCanvas = use(preferredOne, args, xContext);
if (xCanvas.is())
{
Reference<lang::XServiceName> xServiceName(xCanvas, uno::UNO_QUERY);
SAL_INFO("canvas", "using " << (xServiceName.is() ? xServiceName->getServiceName()
: OUString("(unknown)")));
}
return xCanvas;
}
// XMultiServiceFactory
......
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