Date: prev next · Thread: first prev next last
2013 Archives by date, by thread · List index


Hi

Ooops, that would be my fault.
I'll push a fix shortly.
The IDL will look something like:
service ConnectionTools : XConnectionTools
{
createWithConnection([in] com::sun::star::sdbc::XConnection Connection);
};

Regards, Noel.

On 2013-05-14 08:21, Lionel Elie Mamane wrote:
Hi,

With regards to adapting UNO services to "new style", the case of
com.sun.star.sdb.tools.ConnectionTools.

It used to be invoked as follows (in file dbaccess/source/core/dataaccess/connection.cxx, method ):

     m_xConnectionTools.set(
         
m_aContext->getServiceManager()->createInstanceWithArgumentsAndContext("com.sun.star.sdb.tools.ConnectionTools",
 aArguments, m_aContext),
         UNO_QUERY_THROW );

The "convert to new style" commit (002aab309055b7feeeeeb25c1835b6abe6646729)

changed that to:

     m_xConnectionTools = css::sdb::tools::ConnectionTools::create( m_aContext );

Which ignores aArguments, which creates a regression because
aArguments actually contained information that was needed...

So, I've added:

     assert(Reference< XInitialization >(m_xConnectionTools, UNO_QUERY).is());
     Reference< XInitialization > xInit(m_xConnectionTools, UNO_QUERY_THROW );
     xInit->initialize(aArguments);

This seems to work.

But my question is: is this the new idiomatic way to invoke a service
with arguments, or can I make some change to the newly-introduced
offapi/com/sun/star/sdb/tools/ConnectionTools.idl so that the service
has e.g. some createWithArguments method instead of only "create"? Or
is there some wrapper that will do the above xInit-dance for me or
some such?



Disclaimer: http://www.peralex.com/disclaimer.html



Context


Privacy Policy | Impressum (Legal Info) | Copyright information: Unless otherwise specified, all text and images on this website are licensed under the Creative Commons Attribution-Share Alike 3.0 License. This does not include the source code of LibreOffice, which is licensed under the Mozilla Public License (MPLv2). "LibreOffice" and "The Document Foundation" are registered trademarks of their corresponding registered owners or are in actual use as trademarks in one or more countries. Their respective logos and icons are also subject to international copyright laws. Use thereof is explained in our trademark policy.