sc/source/ui/dbgui/filtdlg.cxx |    5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

New commits:
commit 551ee32dfaaddd2aa48efebaefab0730474b656d
Author: David Ostrovsky <da...@ostrovsky.org>
Date:   Wed Sep 24 02:11:28 2014 +0200

    fdo#65281 Empty/Not empty doesn't work in columns with date format
    
    "Empty" and "Not empty" predicates were unconditionally overriden
    in filter dialog for date format columns. Rectify it by preventing
    the overriding for these functions.
    
    Test Plan:
    
    * open calc document
    * define column with date format
    * put some data and let some columns empty
    * apply standard filter on date column with "Not empty" function
    * verify that rows with non empty columns still visible
    
    Change-Id: I2111c5a6b6350cab63173d42419069813d1137b6
    Reviewed-on: https://gerrit.libreoffice.org/11613
    Reviewed-by: Kohei Yoshida <libreoff...@kohei.us>
    Tested-by: Kohei Yoshida <libreoff...@kohei.us>

diff --git a/sc/source/ui/dbgui/filtdlg.cxx b/sc/source/ui/dbgui/filtdlg.cxx
index f3fa5d4..463e5a5 100644
--- a/sc/source/ui/dbgui/filtdlg.cxx
+++ b/sc/source/ui/dbgui/filtdlg.cxx
@@ -1074,15 +1074,18 @@ IMPL_LINK( ScFilterDlg, ValModifyHdl, ComboBox*, pEd )
         ScQueryEntry::Item& rItem = rEntry.GetQueryItem();
         bool bDoThis = (pLbField->GetSelectEntryPos() != 0);
         rEntry.bDoQuery = bDoThis;
+        bool bByEmptyOrNotByEmpty = false;
 
         if ( rEntry.bDoQuery || maRefreshExceptQuery[nQE] )
         {
             if ( aStrEmpty.equals(aStrVal) )
             {
+                bByEmptyOrNotByEmpty = true;
                 rEntry.SetQueryByEmpty();
             }
             else if ( aStrNotEmpty.equals(aStrVal) )
             {
+                bByEmptyOrNotByEmpty = true;
                 rEntry.SetQueryByNonEmpty();
             }
             else
@@ -1102,7 +1105,7 @@ IMPL_LINK( ScFilterDlg, ValModifyHdl, ComboBox*, pEd )
 
             ScQueryOp eOp  = (ScQueryOp)pLbCond->GetSelectEntryPos();
             rEntry.eOp     = eOp;
-            if (maHasDates[nQE])
+            if (maHasDates[nQE] && !bByEmptyOrNotByEmpty)
                 rItem.meType = ScQueryEntry::ByDate;
         }
     }
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to