connectivity/registry/firebird/org/openoffice/Office/DataAccess/Drivers.xcu |  
  5 +++
 svx/source/fmcomp/gridcell.cxx                                              |  
 13 +++++++---
 2 files changed, 15 insertions(+), 3 deletions(-)

New commits:
commit 9b6906bbf3cdc3fc100339b39755bbbe02594e4f
Author:     Lionel Elie Mamane <lio...@mamane.lu>
AuthorDate: Wed Oct 24 18:13:56 2018 +0200
Commit:     Lionel Elie Mamane <lio...@mamane.lu>
CommitDate: Thu Oct 25 10:03:13 2018 +0200

    tdf#120713 correctly handle boolean values in filters
    
    This commit has two parts:
     - Hardcode the correct BooleanComparisonMode in the firebird-sdbc driver
       (this fixes on Firebird databases, among others, the AutoFilter for 
bools)
     - Generic to all DBMS, have the "form-based filter" obey the 
BooleanComparisonMode
    
    Change-Id: Ib14e6c3d5cb773ae1f972840f8b53062f0224396
    Reviewed-on: https://gerrit.libreoffice.org/62319
    Tested-by: Jenkins
    Reviewed-by: Lionel Elie Mamane <lio...@mamane.lu>

diff --git 
a/connectivity/registry/firebird/org/openoffice/Office/DataAccess/Drivers.xcu 
b/connectivity/registry/firebird/org/openoffice/Office/DataAccess/Drivers.xcu
index 03896aff4412..586264183b60 100644
--- 
a/connectivity/registry/firebird/org/openoffice/Office/DataAccess/Drivers.xcu
+++ 
b/connectivity/registry/firebird/org/openoffice/Office/DataAccess/Drivers.xcu
@@ -66,6 +66,11 @@
             <value>true</value>
           </prop>
         </node>
+        <node oor:name="BooleanComparisonMode" oor:op="replace">
+          <prop oor:name="Value" oor:type="xs:int">
+            <value>2</value>
+          </prop>
+        </node>
       </node><!--Properties-->
       <node oor:name="Features">
       </node><!--Features-->
diff --git a/svx/source/fmcomp/gridcell.cxx b/svx/source/fmcomp/gridcell.cxx
index da44c4e55591..ae0690c23c4f 100644
--- a/svx/source/fmcomp/gridcell.cxx
+++ b/svx/source/fmcomp/gridcell.cxx
@@ -3100,20 +3100,27 @@ void DbFilterField::UpdateFromField(const Reference< 
XColumn >& /*_rxField*/, co
 IMPL_LINK_NOARG(DbFilterField, OnClick, VclPtr<CheckBox>, void)
 {
     TriState eState = 
static_cast<CheckBoxControl*>(m_pWindow.get())->GetBox().GetState();
-    OUString aText;
+    OUStringBuffer aTextBuf;
+
+    Reference< XRowSet > xDataSourceRowSet(
+                    Reference< XInterface 
>(*m_rColumn.GetParent().getDataSource()), UNO_QUERY);
+    Reference< XConnection >  xConnection(getConnection(xDataSourceRowSet));
+    const sal_Int32 nBooleanComparisonMode = ::dbtools::DatabaseMetaData( 
xConnection ).getBooleanComparisonMode();
 
     switch (eState)
     {
         case TRISTATE_TRUE:
-            aText = "1";
+            ::dbtools::getBooleanComparisonPredicate("", true, 
nBooleanComparisonMode, aTextBuf);
             break;
         case TRISTATE_FALSE:
-            aText = "0";
+            ::dbtools::getBooleanComparisonPredicate("", false, 
nBooleanComparisonMode, aTextBuf);
             break;
         case TRISTATE_INDET:
             break;
     }
 
+    const OUString aText(aTextBuf.makeStringAndClear());
+
     if (m_aText != aText)
     {
         m_aText = aText;
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to