diff options
Diffstat (limited to 'connectivity/source/commontools/predicateinput.cxx')
-rw-r--r-- | connectivity/source/commontools/predicateinput.cxx | 52 |
1 files changed, 26 insertions, 26 deletions
diff --git a/connectivity/source/commontools/predicateinput.cxx b/connectivity/source/commontools/predicateinput.cxx index e4ee4716d036..57f3d07678f2 100644 --- a/connectivity/source/commontools/predicateinput.cxx +++ b/connectivity/source/commontools/predicateinput.cxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -142,20 +142,20 @@ namespace dbtools { OSQLParseNode* pReturn = const_cast< OSQLParser& >( m_aParser ).predicateTree( _rErrorMessage, _rStatement, m_xFormatter, _rxField ); if ( !pReturn ) - { // is it a text field ? + { // is it a text field ? sal_Int32 nType = DataType::OTHER; _rxField->getPropertyValue( ::rtl::OUString::createFromAscii( "Type" ) ) >>= nType; - if ( ( DataType::CHAR == nType ) - || ( DataType::VARCHAR == nType ) - || ( DataType::LONGVARCHAR == nType ) - || ( DataType::CLOB == nType ) + if ( ( DataType::CHAR == nType ) + || ( DataType::VARCHAR == nType ) + || ( DataType::LONGVARCHAR == nType ) + || ( DataType::CLOB == nType ) ) - { // yes -> force a quoted text and try again + { // yes -> force a quoted text and try again ::rtl::OUString sQuoted( _rStatement ); - if ( sQuoted.getLength() - && ( (sQuoted.getStr()[0] != '\'') - || (sQuoted.getStr()[ sQuoted.getLength() - 1 ] != '\'' ) + if ( sQuoted.getLength() + && ( (sQuoted.getStr()[0] != '\'') + || (sQuoted.getStr()[ sQuoted.getLength() - 1 ] != '\'' ) ) ) { @@ -183,12 +183,12 @@ namespace dbtools // * a column formatted with an english number format // => the output is german (as we use the system locale for this), i.e. "3,4" // => the input does not recognize the german text, as predicateTree uses the number format - // of the column to determine the main locale - the locale on the context is only a fallback - if ( ( DataType::FLOAT == nType ) - || ( DataType::REAL == nType ) - || ( DataType::DOUBLE == nType ) - || ( DataType::NUMERIC == nType ) - || ( DataType::DECIMAL == nType ) + // of the column to determine the main locale - the locale on the context is only a fallback + if ( ( DataType::FLOAT == nType ) + || ( DataType::REAL == nType ) + || ( DataType::DOUBLE == nType ) + || ( DataType::NUMERIC == nType ) + || ( DataType::DECIMAL == nType ) ) { const IParseContext& rParseContext = m_aParser.getContext(); @@ -232,12 +232,12 @@ namespace dbtools sal_Bool bDecDiffers = ( nCtxDecSep != nFmtDecSep ); sal_Bool bFmtDiffers = ( nCtxThdSep != nFmtThdSep ); if ( bDecDiffers || bFmtDiffers ) - { // okay, at least one differs + { // okay, at least one differs // "translate" the value into the "format locale" ::rtl::OUString sTranslated( _rStatement ); const sal_Unicode nIntermediate( '_' ); - sTranslated = sTranslated.replace( nCtxDecSep, nIntermediate ); - sTranslated = sTranslated.replace( nCtxThdSep, nFmtThdSep ); + sTranslated = sTranslated.replace( nCtxDecSep, nIntermediate ); + sTranslated = sTranslated.replace( nCtxThdSep, nFmtThdSep ); sTranslated = sTranslated.replace( nIntermediate, nFmtDecSep ); pReturn = const_cast< OSQLParser& >( m_aParser ).predicateTree( _rErrorMessage, sTranslated, m_xFormatter, _rxField ); @@ -300,9 +300,9 @@ namespace dbtools // '-characters to the text. If we would give this to predicateTree this would add // two additional '-characters which we don't want. So check the field format. // FS - 06.01.00 - 71532 - sal_Bool bValidQuotedText = ( sValue.getLength() >= 2 ) - && ( sValue.getStr()[0] == '\'' ) - && ( sValue.getStr()[ sValue.getLength() - 1 ] == '\'' ); + sal_Bool bValidQuotedText = ( sValue.getLength() >= 2 ) + && ( sValue.getStr()[0] == '\'' ) + && ( sValue.getStr()[ sValue.getLength() - 1 ] == '\'' ); // again : as normalizePredicateString always did a conversion on the value text, // bValidQuotedText == sal_True implies that we have a text field, as no other field // values will be formatted with the quote characters @@ -335,8 +335,8 @@ namespace dbtools { if ( !_bForStatementUse ) { - if ( ( pOdbcSpec->count() >= 2 ) - && ( SQL_NODE_STRING == pOdbcSpec->getChild(1)->getNodeType() ) + if ( ( pOdbcSpec->count() >= 2 ) + && ( SQL_NODE_STRING == pOdbcSpec->getChild(1)->getNodeType() ) ) { @@ -357,7 +357,7 @@ namespace dbtools } else { - if ( pParseNode->count() >= 3 ) + if ( pParseNode->count() >= 3 ) { OSQLParseNode* pValueNode = pParseNode->getChild(2); OSL_ENSURE( pValueNode, "OPredicateInputController::getPredicateValue: invalid node child!" ); @@ -386,7 +386,7 @@ namespace dbtools return sReturn; } //......................................................................... -} // namespace dbtools +} // namespace dbtools //......................................................................... |