diff options
author | Marcos Paulo de Souza <marcos.souza.org@gmail.com> | 2013-01-07 07:45:44 -0200 |
---|---|---|
committer | Luboš Luňák <l.lunak@suse.cz> | 2013-01-07 13:53:20 +0000 |
commit | 36e1e0ce128a25ce63743bed18a599a6915f3ec3 (patch) | |
tree | 557da067e095470cb9f6106ec6cec7214b5778bb /dbaccess/source | |
parent | 2b0b5f7df0e3c7deab2fdccec49b6bbb4186f58a (diff) |
fdo#57950: Remove some chained appends in dbaccess
Also simplify logic a little bit.
Change-Id: I342f8d1d22e70023d23c6c8ca3976d501e18fb90
Signed-off-by: Marcos Paulo de Souza <marcos.souza.org@gmail.com>
Reviewed-on: https://gerrit.libreoffice.org/1559
Reviewed-by: Luboš Luňák <l.lunak@suse.cz>
Tested-by: Luboš Luňák <l.lunak@suse.cz>
Diffstat (limited to 'dbaccess/source')
-rw-r--r-- | dbaccess/source/core/api/SingleSelectQueryComposer.cxx | 16 |
1 files changed, 4 insertions, 12 deletions
diff --git a/dbaccess/source/core/api/SingleSelectQueryComposer.cxx b/dbaccess/source/core/api/SingleSelectQueryComposer.cxx index aff9dde838cc..f398a468ec74 100644 --- a/dbaccess/source/core/api/SingleSelectQueryComposer.cxx +++ b/dbaccess/source/core/api/SingleSelectQueryComposer.cxx @@ -765,25 +765,17 @@ Reference< XNameAccess > SAL_CALL OSingleSelectQueryComposer::getColumns( ) thr bCase = m_xMetaData->supportsMixedCaseQuotedIdentifiers(); aSelectColumns = m_aSqlIterator.getSelectColumns(); - ::rtl::OUStringBuffer aSQL; - aSQL.append( m_aPureSelectSQL ); - aSQL.append( STR_WHERE ); + OUStringBuffer aSQL( m_aPureSelectSQL + STR_WHERE + " ( 0 = 1 )"); // preserve the original WHERE clause // #i102234# - ::rtl::OUString sOriginalWhereClause = getSQLPart( Where, m_aSqlIterator, sal_False ); + OUString sOriginalWhereClause = getSQLPart( Where, m_aSqlIterator, sal_False ); if ( !sOriginalWhereClause.isEmpty() ) { - aSQL.appendAscii( " ( 0 = 1 ) AND ( " ); - aSQL.append( sOriginalWhereClause ); - aSQL.appendAscii( " ) " ); - } - else - { - aSQL.appendAscii( " ( 0 = 1 ) " ); + aSQL.append( " AND ( " + sOriginalWhereClause + " ) " ); } - ::rtl::OUString sGroupBy = getSQLPart( Group, m_aSqlIterator, sal_True ); + OUString sGroupBy = getSQLPart( Group, m_aSqlIterator, sal_True ); if ( !sGroupBy.isEmpty() ) aSQL.append( sGroupBy ); |