Kaydet (Commit) 50cbf16d authored tarafından Juergen Funk's avatar Juergen Funk Kaydeden (comit) Andras Timar

tdf#92517 KDE4-FileDialog: "Save as" has wrong Filter

Fixing follow
 - The order of calling: first should be set the filter, after
   that can be set the current filter
 - change the function from "setCurrentFilter" to "setCurrentItem"
   When you set the filter over "setCurrentFilter" you need the full
   search string "extention|description" e.g. "*.docx|Microsoft Word.."
-  Not need the escape of slash (with that can not find
   "Microsoft Word 2007/2010 XML (.docx))"

Change-Id: Ie4f7d6fd619b391487ee944c3e745c855600ee54
Reviewed-on: https://gerrit.libreoffice.org/16721Tested-by: 's avatarJenkins <ci@libreoffice.org>
Reviewed-by: 's avatarKatarina Behrens <Katarina.Behrens@cib.de>
(cherry picked from commit a93cfd5a)
Reviewed-on: https://gerrit.libreoffice.org/16890Reviewed-by: 's avatarCaolán McNamara <caolanm@redhat.com>
Tested-by: 's avatarCaolán McNamara <caolanm@redhat.com>
üst 96058afa
...@@ -250,6 +250,10 @@ sal_Int16 SAL_CALL KDE4FilePicker::execute() ...@@ -250,6 +250,10 @@ sal_Int16 SAL_CALL KDE4FilePicker::execute()
_dialog->clearFilter(); _dialog->clearFilter();
_dialog->setFilter(_filter); _dialog->setFilter(_filter);
if(!_currentFilter.isNull())
_dialog->filterWidget()->setCurrentItem(_currentFilter);
_dialog->filterWidget()->setEditable(false); _dialog->filterWidget()->setEditable(false);
VCLKDEApplication::preDialogSetup(); VCLKDEApplication::preDialogSetup();
...@@ -384,9 +388,7 @@ void SAL_CALL KDE4FilePicker::setCurrentFilter( const OUString &title ) ...@@ -384,9 +388,7 @@ void SAL_CALL KDE4FilePicker::setCurrentFilter( const OUString &title )
return Q_EMIT setCurrentFilterSignal( title ); return Q_EMIT setCurrentFilterSignal( title );
} }
QString t = toQString(title); _currentFilter = toQString(title);
t.replace("/", "\\/");
_dialog->filterWidget()->setCurrentFilter(t);
} }
OUString SAL_CALL KDE4FilePicker::getCurrentFilter() OUString SAL_CALL KDE4FilePicker::getCurrentFilter()
...@@ -633,6 +635,7 @@ void SAL_CALL KDE4FilePicker::initialize( const uno::Sequence<uno::Any> &args ) ...@@ -633,6 +635,7 @@ void SAL_CALL KDE4FilePicker::initialize( const uno::Sequence<uno::Any> &args )
} }
_filter.clear(); _filter.clear();
_currentFilter.clear();
// parameter checking // parameter checking
uno::Any arg; uno::Any arg;
......
...@@ -66,6 +66,8 @@ protected: ...@@ -66,6 +66,8 @@ protected:
//running filter string to add to dialog //running filter string to add to dialog
QString _filter; QString _filter;
// string to set the current filter
QString _currentFilter;
//mapping of SAL control ID's to created custom controls //mapping of SAL control ID's to created custom controls
QHash<sal_Int16, QWidget*> _customWidgets; QHash<sal_Int16, QWidget*> _customWidgets;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment