[Libreoffice-commits] core.git: Branch 'libreoffice-6-4' - connectivity/source include/connectivity
Lionel Elie Mamane (via logerrit)
logerrit at kemper.freedesktop.org
Wed May 13 08:05:23 UTC 2020
connectivity/source/commontools/dbtools.cxx | 3 +++
connectivity/source/commontools/statementcomposer.cxx | 11 +++++++++++
include/connectivity/statementcomposer.hxx | 1 +
3 files changed, 15 insertions(+)
New commits:
commit bfaa243b0cac1753330982bedb47f272724bfa1c
Author: Lionel Elie Mamane <lionel at mamane.lu>
AuthorDate: Mon May 4 22:58:31 2020 +0200
Commit: Michael Stahl <michael.stahl at cib.de>
CommitDate: Wed May 13 10:04:52 2020 +0200
tdf#122408 make StatementComposer apply HAVING clause
Change-Id: I381c918e8cac2800367bc586f8c230d46bcd71e5
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/93378
Tested-by: Lionel Elie Mamane <lionel at mamane.lu>
Reviewed-by: Michael Stahl <michael.stahl at cib.de>
diff --git a/connectivity/source/commontools/dbtools.cxx b/connectivity/source/commontools/dbtools.cxx
index 514b026b26c9..34d83e573a1e 100644
--- a/connectivity/source/commontools/dbtools.cxx
+++ b/connectivity/source/commontools/dbtools.cxx
@@ -1247,7 +1247,10 @@ static Reference< XSingleSelectQueryComposer > getComposedRowSetStatement( const
bool bApplyFilter = true;
_rxRowSet->getPropertyValue("ApplyFilter") >>= bApplyFilter;
if ( bApplyFilter )
+ {
aComposer.setFilter( getString( _rxRowSet->getPropertyValue("Filter") ) );
+ aComposer.setHavingClause( getString( _rxRowSet->getPropertyValue("HavingClause") ) );
+ }
aComposer.getQuery();
diff --git a/connectivity/source/commontools/statementcomposer.cxx b/connectivity/source/commontools/statementcomposer.cxx
index a21c8cf1a41d..01f20e9c1e3c 100644
--- a/connectivity/source/commontools/statementcomposer.cxx
+++ b/connectivity/source/commontools/statementcomposer.cxx
@@ -60,6 +60,7 @@ namespace dbtools
Reference< XSingleSelectQueryComposer > xComposer;
OUString sCommand;
OUString sFilter;
+ OUString sHavingClause;
OUString sOrder;
sal_Int32 nCommandType;
bool bEscapeProcessing;
@@ -189,6 +190,8 @@ namespace dbtools
OUString sFilter;
OSL_VERIFY( xQuery->getPropertyValue("Filter") >>= sFilter );
xComposer->setFilter( sFilter );
+ OSL_VERIFY( xQuery->getPropertyValue("HavingClause") >>= sFilter );
+ xComposer->setHavingClause( sFilter );
}
// the composed statement
@@ -212,6 +215,7 @@ namespace dbtools
// append sort/filter
xComposer->setOrder( _rData.sOrder );
xComposer->setFilter( _rData.sFilter );
+ xComposer->setHavingClause( _rData.sHavingClause );
sStatement = xComposer->getQuery();
@@ -262,6 +266,13 @@ namespace dbtools
}
+ void StatementComposer::setHavingClause( const OUString& _rHavingClause )
+ {
+ m_pData->sHavingClause = _rHavingClause;
+ m_pData->bComposerDirty = true;
+ }
+
+
void StatementComposer::setOrder( const OUString& _rOrder )
{
m_pData->sOrder = _rOrder;
diff --git a/include/connectivity/statementcomposer.hxx b/include/connectivity/statementcomposer.hxx
index 944a4321b12a..88fa61f553b1 100644
--- a/include/connectivity/statementcomposer.hxx
+++ b/include/connectivity/statementcomposer.hxx
@@ -68,6 +68,7 @@ namespace dbtools
void setDisposeComposer( bool _bDoDispose );
void setFilter( const OUString& _rFilter );
+ void setHavingClause( const OUString& _rHavingClause );
void setOrder( const OUString& _rOrder );
/** returns the composer which has been fed with the current settings
More information about the Libreoffice-commits
mailing list