[Libreoffice-commits] core.git: fpicker/source

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Thu Dec 6 12:50:44 UTC 2018


 fpicker/source/win32/VistaFilePicker.cxx     |    2 -
 fpicker/source/win32/VistaFilePickerImpl.cxx |   39 +++------------------------
 fpicker/source/win32/VistaFilePickerImpl.hxx |    2 -
 3 files changed, 6 insertions(+), 37 deletions(-)

New commits:
commit 38a47bc3a4f618da4613968d28c08c8dda064cea
Author:     Mike Kaganski <mike.kaganski at collabora.com>
AuthorDate: Thu Dec 6 00:57:38 2018 +0300
Commit:     Mike Kaganski <mike.kaganski at collabora.com>
CommitDate: Thu Dec 6 13:50:15 2018 +0100

    Revert "tdf#119747 FileSaveDialog: Windows dialog shows only one extension."
    
    This reverts commit 1b50fa88b148739a7b192ba70f08af2c6e326fd2.
    
    Change-Id: Ide94c1be6a265cee2e70c319578d816efa1d2eb9
    Reviewed-on: https://gerrit.libreoffice.org/64655
    Reviewed-by: Mike Kaganski <mike.kaganski at collabora.com>
    Tested-by: Mike Kaganski <mike.kaganski at collabora.com>

diff --git a/fpicker/source/win32/VistaFilePicker.cxx b/fpicker/source/win32/VistaFilePicker.cxx
index e1eb66a9ce83..0737100d07e6 100644
--- a/fpicker/source/win32/VistaFilePicker.cxx
+++ b/fpicker/source/win32/VistaFilePicker.cxx
@@ -119,7 +119,7 @@ void SAL_CALL VistaFilePicker::appendFilter(const OUString& sTitle ,
 {
     RequestRef rRequest(new Request());
     rRequest->setRequest (VistaFilePickerImpl::E_APPEND_FILTER);
-    rRequest->setArgument(PROP_FILTER_TITLE, sTitle);
+    rRequest->setArgument(PROP_FILTER_TITLE, sTitle );
     rRequest->setArgument(PROP_FILTER_VALUE, sFilter);
 
     m_aAsyncExecute.triggerRequestThreadAware(rRequest, AsyncRequests::NON_BLOCKED);
diff --git a/fpicker/source/win32/VistaFilePickerImpl.cxx b/fpicker/source/win32/VistaFilePickerImpl.cxx
index aa33dcdacbdb..ff0cf2c27956 100644
--- a/fpicker/source/win32/VistaFilePickerImpl.cxx
+++ b/fpicker/source/win32/VistaFilePickerImpl.cxx
@@ -360,22 +360,11 @@ void VistaFilePickerImpl::impl_sta_appendFilter(const RequestRef& rRequest)
 {
     const OUString sTitle  = rRequest->getArgumentOrDefault(PROP_FILTER_TITLE, OUString());
     const OUString sFilter = rRequest->getArgumentOrDefault(PROP_FILTER_VALUE, OUString());
+
     // SYNCHRONIZED->
     ::osl::ResettableMutexGuard aLock(m_aMutex);
 
-    const sal_Int32 idx = sTitle.indexOf("(.");
-    if (idx > 0)
-    {
-        const OUString sTitle_ = sTitle.copy(0, idx);
-        m_mapRealFilter[sTitle_] = std::make_pair(sTitle, sFilter);
-        m_lFilters.addFilter(sTitle_, sFilter);
-    }
-    else
-    {
-        m_mapRealFilter[sTitle] = std::make_pair(sTitle, sFilter);
-        m_lFilters.addFilter(sTitle, sFilter);
-    }
-
+    m_lFilters.addFilter(sTitle, sFilter);
 }
 
 
@@ -395,20 +384,7 @@ void VistaFilePickerImpl::impl_sta_appendFilterGroup(const RequestRef& rRequest)
     for (i=0; i<c; ++i)
     {
         const css::beans::StringPair& rFilter = aFilterGroup[i];
-        const OUString sTitle = rFilter.First;
-        const OUString sFilter = rFilter.Second;
-        const sal_Int32 idx = sTitle.indexOf("(.");
-        if (idx > 0)
-        {
-            const OUString sTitle_ = sTitle.copy(0, idx);
-            m_mapRealFilter[sTitle_] = std::make_pair(sTitle, sFilter);
-            m_lFilters.addFilter(sTitle_, sFilter);
-        }
-        else
-        {
-            m_mapRealFilter[sTitle] = std::make_pair(sTitle, sFilter);
-            m_lFilters.addFilter(sTitle, sFilter);
-        }
+        m_lFilters.addFilter(rFilter.First, rFilter.Second);
     }
 }
 
@@ -441,15 +417,10 @@ void VistaFilePickerImpl::impl_sta_getCurrentFilter(const RequestRef& rRequest)
     OUString sTitle;
     ::sal_Int32     nRealIndex = (nIndex-1); // COM dialog base on 1 ... filter container on 0 .-)
     if (
-        (nRealIndex >= 0) &&
+        (nRealIndex >= 0                         ) &&
         (m_lFilters.getFilter(nRealIndex, sTitle))
-        )
-    {
-        if (m_mapRealFilter.find(sTitle) != m_mapRealFilter.end())
-            sTitle = m_mapRealFilter[sTitle].first;
-
+       )
         rRequest->setArgument(PROP_FILTER_TITLE, sTitle);
-    }
     else if ( nRealIndex == -1 ) // Dialog not visible yet
     {
         sTitle = m_lFilters.getCurrentFilter();
diff --git a/fpicker/source/win32/VistaFilePickerImpl.hxx b/fpicker/source/win32/VistaFilePickerImpl.hxx
index 460136a73b48..9cce75b5714f 100644
--- a/fpicker/source/win32/VistaFilePickerImpl.hxx
+++ b/fpicker/source/win32/VistaFilePickerImpl.hxx
@@ -37,7 +37,6 @@
 #include <osl/thread.hxx>
 #include <osl/conditn.hxx>
 #include <rtl/ustring.hxx>
-#include <map>
 
 namespace fpicker{
 namespace win32{
@@ -306,7 +305,6 @@ class VistaFilePickerImpl : private ::cppu::BaseMutex
 
         /// @todo document me
         CFilterContainer m_lFilters;
-        std::map<OUString, std::pair<OUString, OUString>> m_mapRealFilter;
 
 
         /** help us to handle dialog events and provide them to interested office


More information about the Libreoffice-commits mailing list