[Libreoffice-commits] core.git: fpicker/source
Libreoffice Gerrit user
logerrit at kemper.freedesktop.org
Tue Nov 20 10:54:48 UTC 2018
fpicker/source/win32/VistaFilePicker.cxx | 19 +++++++++++++++++--
1 file changed, 17 insertions(+), 2 deletions(-)
New commits:
commit c444eb7934d4a3c190e1d060805d9d175c1a9127
Author: Ilhan Yesil <ilhanyesil at gmx.de>
AuthorDate: Mon Nov 19 14:50:25 2018 +0100
Commit: Thorsten Behrens <Thorsten.Behrens at CIB.de>
CommitDate: Tue Nov 20 11:54:25 2018 +0100
tdf#121497 "Save As": File Format Type unchanged in Windows
Added checks for filter title, so filter titles are Windows
conform.
Change-Id: I42485c465ea58540a99b8300c5205b902cb86a92
Reviewed-on: https://gerrit.libreoffice.org/63573
Tested-by: Jenkins
Reviewed-by: Thorsten Behrens <Thorsten.Behrens at CIB.de>
diff --git a/fpicker/source/win32/VistaFilePicker.cxx b/fpicker/source/win32/VistaFilePicker.cxx
index e1eb66a9ce83..874bed2f5c5f 100644
--- a/fpicker/source/win32/VistaFilePicker.cxx
+++ b/fpicker/source/win32/VistaFilePicker.cxx
@@ -119,7 +119,14 @@ void SAL_CALL VistaFilePicker::appendFilter(const OUString& sTitle ,
{
RequestRef rRequest(new Request());
rRequest->setRequest (VistaFilePickerImpl::E_APPEND_FILTER);
- rRequest->setArgument(PROP_FILTER_TITLE, sTitle);
+ const sal_Int32 idx = sTitle.indexOf("(.");
+ if (idx > 0)
+ {
+ const OUString sTitle_ = sTitle.replaceAt(idx, 2, "(*.");
+ rRequest->setArgument(PROP_FILTER_TITLE, sTitle_);
+ }
+ else
+ rRequest->setArgument(PROP_FILTER_TITLE, sTitle);
rRequest->setArgument(PROP_FILTER_VALUE, sFilter);
m_aAsyncExecute.triggerRequestThreadAware(rRequest, AsyncRequests::NON_BLOCKED);
@@ -129,7 +136,14 @@ void SAL_CALL VistaFilePicker::setCurrentFilter(const OUString& sTitle)
{
RequestRef rRequest(new Request());
rRequest->setRequest (VistaFilePickerImpl::E_SET_CURRENT_FILTER);
- rRequest->setArgument(PROP_FILTER_TITLE, sTitle);
+ const sal_Int32 idx = sTitle.indexOf("(.");
+ if (idx > 0)
+ {
+ const OUString sTitle_ = sTitle.replaceAt(idx, 2, "(*.");
+ rRequest->setArgument(PROP_FILTER_TITLE, sTitle_);
+ }
+ else
+ rRequest->setArgument(PROP_FILTER_TITLE, sTitle);
m_aAsyncExecute.triggerRequestThreadAware(rRequest, AsyncRequests::NON_BLOCKED);
}
@@ -142,6 +156,7 @@ OUString SAL_CALL VistaFilePicker::getCurrentFilter()
m_aAsyncExecute.triggerRequestThreadAware(rRequest, AsyncRequests::BLOCKED);
const OUString sTitle = rRequest->getArgumentOrDefault(PROP_FILTER_TITLE, OUString());
+
return sTitle;
}
More information about the Libreoffice-commits
mailing list