diff options
-rw-r--r-- | connectivity/source/commontools/dbtools.cxx | 3 | ||||
-rw-r--r-- | connectivity/source/commontools/statementcomposer.cxx | 11 | ||||
-rw-r--r-- | include/connectivity/statementcomposer.hxx | 1 |
3 files changed, 15 insertions, 0 deletions
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 |