diff options
author | Ivo Hinkelmann <ihi@openoffice.org> | 2008-01-14 16:28:05 +0000 |
---|---|---|
committer | Ivo Hinkelmann <ihi@openoffice.org> | 2008-01-14 16:28:05 +0000 |
commit | 39acf2651cc3125a8c0a4c62ab2bb558021188a9 (patch) | |
tree | 38c5b0a82ada4c22e4aa901e2f2473c0138af215 /sfx2/source | |
parent | 2b7e4a1f15789c8d531f304d9c26b12c02e87995 (diff) |
INTEGRATION: CWS fwk79 (1.134.98); FILE MERGED
2007/12/03 07:54:28 pb 1.134.98.2: RESYNC: (1.134-1.136); FILE MERGED
2007/11/29 11:36:19 pb 1.134.98.1: fix: #i83002# set value of selection box only if it exists
Diffstat (limited to 'sfx2/source')
-rw-r--r-- | sfx2/source/dialog/filedlghelper.cxx | 37 |
1 files changed, 28 insertions, 9 deletions
diff --git a/sfx2/source/dialog/filedlghelper.cxx b/sfx2/source/dialog/filedlghelper.cxx index 7829bcb226cb..1d1cd04b5601 100644 --- a/sfx2/source/dialog/filedlghelper.cxx +++ b/sfx2/source/dialog/filedlghelper.cxx @@ -4,9 +4,9 @@ * * $RCSfile: filedlghelper.cxx,v $ * - * $Revision: 1.136 $ + * $Revision: 1.137 $ * - * last change: $Author: ihi $ $Date: 2007-11-26 16:47:16 $ + * last change: $Author: ihi $ $Date: 2008-01-14 17:28:05 $ * * The Contents of this file are made available subject to * the terms of GNU Lesser General Public License Version 2.1. @@ -66,6 +66,9 @@ #ifndef _COM_SUN_STAR_UI_DIALOGS_TEMPLATEDESCRIPTION_HPP_ #include <com/sun/star/ui/dialogs/TemplateDescription.hpp> #endif +#ifndef _COM_SUN_STAR_UI_DIALOGS_XCONTROLINFORMATION_HPP_ +#include <com/sun/star/ui/dialogs/XControlInformation.hpp> +#endif #ifndef _COM_SUN_STAR_UI_DIALOGS_XFILEPICKERCONTROLACCESS_HPP_ #include <com/sun/star/ui/dialogs/XFilePickerControlAccess.hpp> #endif @@ -657,14 +660,30 @@ void FileDialogHelper_Impl::updateSelectionBox() if ( !mbExport ) return; - const SfxFilter* pFilter = getCurentSfxFilter(); - - updateExtendedControl( - ExtendedFilePickerElementIds::CHECKBOX_SELECTION, - ( mbSelectionEnabled && pFilter && ( pFilter->GetFilterFlags() & SFX_FILTER_SUPPORTSSELECTION ) != 0 ) ); + // Does the selection box exist? + bool bSelectionBoxFound = false; + uno::Reference< XControlInformation > xCtrlInfo( mxFileDlg, UNO_QUERY ); + if ( xCtrlInfo.is() ) + { + Sequence< ::rtl::OUString > aCtrlList = xCtrlInfo->getSupportedControls(); + sal_uInt32 nCount = aCtrlList.getLength(); + for ( sal_uInt32 nCtrl = 0; nCtrl < nCount; ++nCtrl ) + if ( aCtrlList[ nCtrl ].equalsAscii("SelectionBox") ) + { + bSelectionBoxFound = true; + break; + } + } - uno::Reference< XFilePickerControlAccess > xCtrlAccess( mxFileDlg, UNO_QUERY ); - xCtrlAccess->setValue( ExtendedFilePickerElementIds::CHECKBOX_SELECTION, 0, makeAny( (sal_Bool)mbSelection ) ); + if ( bSelectionBoxFound ) + { + const SfxFilter* pFilter = getCurentSfxFilter(); + updateExtendedControl( + ExtendedFilePickerElementIds::CHECKBOX_SELECTION, + ( mbSelectionEnabled && pFilter && ( pFilter->GetFilterFlags() & SFX_FILTER_SUPPORTSSELECTION ) != 0 ) ); + uno::Reference< XFilePickerControlAccess > xCtrlAccess( mxFileDlg, UNO_QUERY ); + xCtrlAccess->setValue( ExtendedFilePickerElementIds::CHECKBOX_SELECTION, 0, makeAny( (sal_Bool)mbSelection ) ); + } } // ------------------------------------------------------------------------ |