summaryrefslogtreecommitdiffstats
path: root/fpicker
diff options
context:
space:
mode:
authorCarsten Driesner <cd@openoffice.org>2011-03-03 14:49:27 +0100
committerCarsten Driesner <cd@openoffice.org>2011-03-03 14:49:27 +0100
commit7c83fe565234aa5025729462f3250ed883f1b7df (patch)
tree353636be609b79adc5acb989e5c787f714380e69 /fpicker
parent#i117013# Check restart state earlier in startup process to better support ex... (diff)
downloadcore-7c83fe565234aa5025729462f3250ed883f1b7df.tar.gz
core-7c83fe565234aa5025729462f3250ed883f1b7df.zip
fwk167: #i90917# Filter out requests for controls which are not available for the explorer-style Windows file picker.
Diffstat (limited to 'fpicker')
-rw-r--r--fpicker/source/win32/filepicker/WinFileOpenImpl.cxx33
1 files changed, 28 insertions, 5 deletions
diff --git a/fpicker/source/win32/filepicker/WinFileOpenImpl.cxx b/fpicker/source/win32/filepicker/WinFileOpenImpl.cxx
index 9fb13c1a2d5e..f701efe1357b 100644
--- a/fpicker/source/win32/filepicker/WinFileOpenImpl.cxx
+++ b/fpicker/source/win32/filepicker/WinFileOpenImpl.cxx
@@ -316,11 +316,24 @@ void SAL_CALL CWinFileOpenImpl::appendFilterGroup(const rtl::OUString& sGroupTit
// XExtendedFilePicker
//=================================================================================================================
+// #i90917: Due to a different feature set for the system-dependent file pickers
+// it's possible that generic code (e.g. sfx2) provides control ids
+// (see ExtendedFilePickerElementIds::LISTBOX_FILTER_SELECTOR) which are NOT
+// available on all platforms. This filter function should filter out control ids
+// which are only available on KDE/GTK file pickers.
+static bool filterControlCommand( sal_Int16 nControlId )
+{
+ if ( nControlId == LISTBOX_FILTER_SELECTOR )
+ return true;
+ return false;
+}
+
void SAL_CALL CWinFileOpenImpl::setValue(sal_Int16 aControlId, sal_Int16 aControlAction, const uno::Any& aValue)
throw(uno::RuntimeException)
{
OSL_ASSERT(m_FilePickerState);
- m_FilePickerState->setValue(aControlId, aControlAction, aValue);
+ if ( !filterControlCommand( aControlId ))
+ m_FilePickerState->setValue(aControlId, aControlAction, aValue);
}
//-----------------------------------------------------------------------------------------
@@ -332,7 +345,10 @@ uno::Any SAL_CALL CWinFileOpenImpl::getValue(sal_Int16 aControlId, sal_Int16 aCo
throw(uno::RuntimeException)
{
OSL_ASSERT(m_FilePickerState);
- return m_FilePickerState->getValue(aControlId, aControlAction);
+ if ( !filterControlCommand( aControlId ))
+ return m_FilePickerState->getValue(aControlId, aControlAction);
+ else
+ return uno::Any();
}
//-----------------------------------------------------------------------------------------
@@ -343,7 +359,8 @@ void SAL_CALL CWinFileOpenImpl::enableControl(sal_Int16 ControlID, sal_Bool bEna
throw(uno::RuntimeException)
{
OSL_ASSERT(m_FilePickerState);
- m_FilePickerState->enableControl(ControlID, bEnable);
+ if ( !filterControlCommand( ControlID ))
+ m_FilePickerState->enableControl(ControlID, bEnable);
}
//-----------------------------------------------------------------------------------------
@@ -353,7 +370,9 @@ void SAL_CALL CWinFileOpenImpl::enableControl(sal_Int16 ControlID, sal_Bool bEna
void SAL_CALL CWinFileOpenImpl::setLabel( sal_Int16 aControlId, const rtl::OUString& aLabel )
throw (uno::RuntimeException)
{
- m_FilePickerState->setLabel(aControlId, aLabel);
+ OSL_ASSERT(m_FilePickerState);
+ if ( !filterControlCommand( aControlId ))
+ m_FilePickerState->setLabel(aControlId, aLabel);
}
//-----------------------------------------------------------------------------------------
@@ -363,7 +382,11 @@ void SAL_CALL CWinFileOpenImpl::setLabel( sal_Int16 aControlId, const rtl::OUStr
rtl::OUString SAL_CALL CWinFileOpenImpl::getLabel( sal_Int16 aControlId )
throw (uno::RuntimeException)
{
- return m_FilePickerState->getLabel(aControlId);
+ OSL_ASSERT(m_FilePickerState);
+ if ( !filterControlCommand( aControlId ))
+ return m_FilePickerState->getLabel(aControlId);
+ else
+ return rtl::OUString();
}
//-----------------------------------------------------------------------------------------