Hi there,
I was wondering why:
sc/source/ui/vba/vbaapplication.cxx
and
sc/source/ui/vba/vbafiledialog.cxx
had this complicated duplication of this big ugly block:
sal_Bool bUseXFilePicker2 = false;
uno::Reference< lang::XServiceInfo > xServiceInfo( xFilePicker, UNO_QUERY );
if ( xServiceInfo.is() )
{
rtl::OUString sImplName = xServiceInfo->getImplementationName();
if (
sImplName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("com.sun.star.comp.fpicker.VistaFileDialog")) ||
sImplName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("com.sun.star.ui.dialogs.SalGtkFilePicker")) )
{
bUseXFilePicker2 = sal_True;
}
}
uno::Sequence< rtl::OUString > aSelectedFiles;
if ( bUseXFilePicker2 && xFilePicker2.is() )
{
// On Linux, XFilePicker->getFiles() always return one selected file although we
select more than one file, also on Vista
// XFilePicker->getFiles() does not work well too, so we call
XFilePicker2->getSelectedFiles() to get selected files.
aSelectedFiles = xFilePicker2->getSelectedFiles();
}
AFAIR only those two services implement xFilePicker2 anyway - so it
-looks- to me as if all of it is redundant except for:
if ( xFilePicker2.is() )
which of course we should always prefer.
Any idea why that heavy-lifting service name check is there ? I'd like
to bin it from both places: in future all fpicker services should use
XFilePicker2 (ideally).
Thanks,
Michael.
--
michael.meeks@novell.com <><, Pseudo Engineer, itinerant idiot
Context
- [Libreoffice] file-selector oddness / duplication ... · Michael Meeks
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.