[PATCH libreoffice-4-0] Base: fix incorrect field removal in criterion inside query ...

Lionel Elie Mamane (via Code Review) gerrit at gerrit.libreoffice.org
Mon Apr 22 21:57:45 PDT 2013


Hi,

I have submitted a patch for review:

    https://gerrit.libreoffice.org/3564

To pull it, you can do:

    git pull ssh://gerrit.libreoffice.org:29418/core refs/changes/64/3564/1

Base: fix incorrect field removal in criterion inside query design view

Includes following master commits:

commit 6536d0eb4f56e64c9b74b358642e3ee1e39353e5
Author: Lionel Elie Mamane <lionel at mamane.lu>
Date:   Tue Apr 23 06:44:57 2013 +0200

    reword comment

commit 5143e162f81ec64db4ed2b11a3a79183c4901c79
Author: Lionel Elie Mamane <lionel at mamane.lu>
Date:   Tue Apr 23 06:44:42 2013 +0200

    isEmpty() instead of getLength()==0

commit f0c38b6355333c0bbb02e52a732f04ab0d519ecf
Author: Olivier Ploton <olivier.ploton at univ-tours.fr>
Date:   Wed Dec 12 22:04:38 2012 +0100

    Base: fix incorrect field removal in criterion inside query design view

Change-Id: I2fedae672c24a269fca3dfc1bacc66fd53fc61af
---
M connectivity/source/parse/sqlnode.cxx
1 file changed, 7 insertions(+), 2 deletions(-)



diff --git a/connectivity/source/parse/sqlnode.cxx b/connectivity/source/parse/sqlnode.cxx
index 73fd510..d9bb7a0 100644
--- a/connectivity/source/parse/sqlnode.cxx
+++ b/connectivity/source/parse/sqlnode.cxx
@@ -463,8 +463,13 @@
             if (rParam.xField.is() && SQL_ISRULE(pSubTree,subquery))
                 aNewParam.xField = NULL;
 
-            // if there is a field given we don't display the fieldname, if there is any
-            if (rParam.xField.is() && SQL_ISRULE(pSubTree,column_ref))
+            // When we are building a criterion inside a query view,
+            // simplify criterion display by removing:
+            //   "currentFieldName"
+            //   "currentFieldName" =
+            // but only at the very beginning of the criterion
+            // (not embedded deep in the expression).
+            if (rString.isEmpty() && rParam.xField.is() && SQL_ISRULE(pSubTree,column_ref))
             {
                 sal_Bool bFilter = sal_False;
                 // retrieve the fields name

-- 
To view, visit https://gerrit.libreoffice.org/3564
To unsubscribe, visit https://gerrit.libreoffice.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I2fedae672c24a269fca3dfc1bacc66fd53fc61af
Gerrit-PatchSet: 1
Gerrit-Project: core
Gerrit-Branch: libreoffice-4-0
Gerrit-Owner: Lionel Elie Mamane <lionel at mamane.lu>



More information about the LibreOffice mailing list