https://bugs.documentfoundation.org/show_bug.cgi?id=156776

--- Comment #27 from Julien Nabet <[email protected]> ---
(In reply to prrvchr from comment #26)
> I managed to put the correction in work in progress:
> 
> https://gerrit.libreoffice.org/c/core/+/155950
> 
> But I still get an error while compiling:
> 
> /home/prrvchr/github/libreoffice/dbaccess/source/ui/dlg/dlgsave.cxx: In
> constructor ‘dbaui::OSaveAsDlg::OSaveAsDlg(weld::Window*, sal_Int32, const
> com::sun::star::uno::Reference<com::sun::star::uno::XComponentContext>&,
> const com::sun::star::uno::Reference<com::sun::star::sdbc::XConnection>&,
> const rtl::OUString&, const dbaui::IObjectNameCheck&, SADFlags)’:
> /home/prrvchr/github/libreoffice/dbaccess/source/ui/dlg/dlgsave.cxx:136:56:
> error: invalid initialization of reference of type ‘const
> com::sun::star::uno::Reference<com::sun::star::sdbc::XConnection2>&’ from
> expression of type ‘const
> com::sun::star::uno::Reference<com::sun::star::sdbc::XConnection>’
>   136 |                 const Reference< XConnection2 >& xCon2(_xConnection);
>       |                                                        ^~~~~~~~~~~~
> 
> I'm sorry, I'm going to have to learn, thanks for your help...

I can't succeed in commenting the gerrit patch, wonder if it's because it's
WIP.
I don't want to click on Start Review because I think it'll remove WIP status.

Anyway, changing:
const Reference< XConnection2 > xCon2(_xConnection);
by:
const Reference< XConnection2 > xCon2(_xConnection, UNO_QUERY);
or
const Reference< XConnection2 > xCon2(_xConnection, UNO_QUERY_THROW);

should work.

There are some explanation here:
https://opengrok.libreoffice.org/xref/core/include/com/sun/star/uno/Reference.h?r=53c39db4&mo=4987&fi=157#157
now I'm not sure which one we should use and why.

-- 
You are receiving this mail because:
You are the assignee for the bug.

Reply via email to