summaryrefslogtreecommitdiff
path: root/connectivity/source/parse/sqlnode.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'connectivity/source/parse/sqlnode.cxx')
-rw-r--r--connectivity/source/parse/sqlnode.cxx120
1 files changed, 62 insertions, 58 deletions
diff --git a/connectivity/source/parse/sqlnode.cxx b/connectivity/source/parse/sqlnode.cxx
index 9a3abb0d4fc2..599128dd5936 100644
--- a/connectivity/source/parse/sqlnode.cxx
+++ b/connectivity/source/parse/sqlnode.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -29,6 +30,7 @@
#include "precompiled_connectivity.hxx"
+#include <sal/macros.h>
#include <connectivity/sqlnode.hxx>
#include <connectivity/sqlerror.hxx>
#include <internalnode.hxx>
@@ -312,7 +314,7 @@ void OSQLParseNode::parseNodeToStr(::rtl::OUString& rString,
}
catch( const SQLException& )
{
- OSL_ENSURE( false, "OSQLParseNode::parseNodeToStr: this should not throw!" );
+ OSL_FAIL( "OSQLParseNode::parseNodeToStr: this should not throw!" );
// our callers don't expect this method to throw anything. The only known situation
// where impl_parseNodeToString_throw can throw is when there is a cyclic reference
// in the sub queries, but this cannot be the case here, as we do not parse to
@@ -420,7 +422,7 @@ void OSQLParseNode::impl_parseNodeToString_throw(::rtl::OUStringBuffer& rString,
case as:
if ( rParam.aMetaData.generateASBeforeCorrelationName() )
- rString.append(::rtl::OUString::createFromAscii( " AS" ));
+ rString.append(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(" AS")));
bHandled = true;
break;
@@ -529,16 +531,16 @@ void OSQLParseNode::impl_parseNodeToString_throw(::rtl::OUStringBuffer& rString,
{
pSubTree = *i;
if (pSubTree && pSubTree->getNodeType() == SQL_NODE_EQUAL)
- i++;
+ ++i;
}
}
else
- i++;
+ ++i;
}
else
{
pSubTree->impl_parseNodeToString_throw( rString, aNewParam );
- i++;
+ ++i;
// bei den CommaListen zwischen alle Subtrees Commas setzen
if ((m_eNodeType == SQL_NODE_COMMALISTRULE) && (i != m_aChildren.end()))
@@ -548,7 +550,7 @@ void OSQLParseNode::impl_parseNodeToString_throw(::rtl::OUStringBuffer& rString,
else
{
pSubTree->impl_parseNodeToString_throw( rString, aNewParam );
- i++;
+ ++i;
// bei den CommaListen zwischen alle Subtrees Commas setzen
if ((m_eNodeType == SQL_NODE_COMMALISTRULE) && (i != m_aChildren.end()))
@@ -668,7 +670,7 @@ void OSQLParseNode::impl_parseTableRangeNodeToString_throw(::rtl::OUStringBuffer
RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "parse", "Ocke.Janssen@sun.com", "OSQLParseNode::impl_parseTableRangeNodeToString_throw" );
OSL_PRECOND( ( count() == 2 ) || ( count() == 3 ) || ( count() == 5 ) ,"Illegal count");
- // rString += ::rtl::OUString::createFromAscii(" ");
+ // rString += ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(" "));
::std::for_each(m_aChildren.begin(),m_aChildren.end(),
boost::bind( &OSQLParseNode::impl_parseNodeToString_throw, _1, boost::ref( rString ), boost::cref( rParam ) ));
}
@@ -700,7 +702,7 @@ void OSQLParseNode::impl_parseLikeNodeToString_throw( ::rtl::OUStringBuffer& rSt
}
catch ( Exception& )
{
- OSL_ENSURE( false, "OSQLParseNode::impl_parseLikeNodeToString_throw Exception occured!" );
+ OSL_FAIL( "OSQLParseNode::impl_parseLikeNodeToString_throw Exception occurred!" );
}
if ( !m_aChildren[0]->isLeaf() )
{
@@ -724,7 +726,7 @@ void OSQLParseNode::impl_parseLikeNodeToString_throw( ::rtl::OUStringBuffer& rSt
{
::rtl::OUString aStr = ConvertLikeToken(pParaNode, pEscNode, rParam.bInternational);
rString.appendAscii(" ");
- rString.append(SetQuotation(aStr,::rtl::OUString::createFromAscii("\'"),::rtl::OUString::createFromAscii("\'\'")));
+ rString.append(SetQuotation(aStr,::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("\'")),::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("\'\'"))));
}
else
pParaNode->impl_parseNodeToString_throw( rString, aNewParam );
@@ -773,7 +775,7 @@ sal_Bool OSQLParseNode::getTableComponents(const OSQLParseNode* _pTableNode,
}
else
{
- OSL_ENSURE(0,"Error in parse tree!");
+ OSL_FAIL("Error in parse tree!");
}
}
return _rTable.getLength() != 0;
@@ -987,7 +989,7 @@ sal_Int16 OSQLParser::buildLikeRule(OSQLParseNode*& pAppend, OSQLParseNode*& pLi
sal_Int16 nScale = 0;
try
{
- Any aValue = getNumberFormatProperty( m_xFormatter, m_nFormatKey, ::rtl::OUString::createFromAscii("Decimals") );
+ Any aValue = getNumberFormatProperty( m_xFormatter, m_nFormatKey, ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Decimals")) );
aValue >>= nScale;
}
catch( Exception& )
@@ -1004,7 +1006,7 @@ sal_Int16 OSQLParser::buildLikeRule(OSQLParseNode*& pAppend, OSQLParseNode*& pLi
break;
default:
m_sErrorMessage = m_pContext->getErrorMessage(IParseContext::ERROR_VALUE_NO_LIKE);
- m_sErrorMessage = m_sErrorMessage.replaceAt(m_sErrorMessage.indexOf(::rtl::OUString::createFromAscii("#1")),2,pLiteral->getTokenValue());
+ m_sErrorMessage = m_sErrorMessage.replaceAt(m_sErrorMessage.indexOf(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("#1"))),2,pLiteral->getTokenValue());
break;
}
}
@@ -1020,10 +1022,10 @@ OSQLParseNode* OSQLParser::buildNode_Date(const double& fValue, sal_Int32 nType)
{
::rtl::OUString aEmptyString;
OSQLParseNode* pNewNode = new OSQLInternalNode(aEmptyString, SQL_NODE_RULE,OSQLParser::RuleID(OSQLParseNode::set_fct_spec));
- pNewNode->append(new OSQLInternalNode(::rtl::OUString::createFromAscii("{"), SQL_NODE_PUNCTUATION));
+ pNewNode->append(new OSQLInternalNode(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("{")), SQL_NODE_PUNCTUATION));
OSQLParseNode* pDateNode = new OSQLInternalNode(aEmptyString, SQL_NODE_RULE,OSQLParser::RuleID(OSQLParseNode::odbc_fct_spec));
pNewNode->append(pDateNode);
- pNewNode->append(new OSQLInternalNode(::rtl::OUString::createFromAscii("}"), SQL_NODE_PUNCTUATION));
+ pNewNode->append(new OSQLInternalNode(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("}")), SQL_NODE_PUNCTUATION));
switch (nType)
{
@@ -1098,7 +1100,7 @@ OSQLParseNode* OSQLParser::buildNode_STR_NUM(OSQLParseNode*& _pLiteral)
{
::rtl::OUString aValue;
if(!m_xCharClass.is())
- m_xCharClass = Reference<XCharacterClassification>(m_xServiceFactory->createInstance(::rtl::OUString::createFromAscii("com.sun.star.i18n.CharacterClassification")),UNO_QUERY);
+ m_xCharClass = Reference<XCharacterClassification>(m_xServiceFactory->createInstance(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.i18n.CharacterClassification"))),UNO_QUERY);
if(m_xCharClass.is() && s_xLocaleData.is())
{
try
@@ -1107,10 +1109,10 @@ OSQLParseNode* OSQLParser::buildNode_STR_NUM(OSQLParseNode*& _pLiteral)
if((aResult.TokenType & KParseType::IDENTNAME) && aResult.EndPos == _rValue.getLength())
{
aValue = ::rtl::OUString::valueOf(aResult.Value);
- sal_Int32 nPos = aValue.lastIndexOf(::rtl::OUString::createFromAscii("."));
+ sal_Int32 nPos = aValue.lastIndexOf(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(".")));
if((nPos+_nScale) < aValue.getLength())
aValue = aValue.replaceAt(nPos+_nScale,aValue.getLength()-nPos-_nScale,::rtl::OUString());
- aValue = aValue.replaceAt(aValue.lastIndexOf(::rtl::OUString::createFromAscii(".")),1,s_xLocaleData->getLocaleItem(m_pData->aLocale).decimalSeparator);
+ aValue = aValue.replaceAt(aValue.lastIndexOf(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("."))),1,s_xLocaleData->getLocaleItem(m_pData->aLocale).decimalSeparator);
return aValue;
}
}
@@ -1214,7 +1216,7 @@ OSQLParseNode* OSQLParser::predicateTree(::rtl::OUString& rErrorMessage, const :
}
catch ( Exception& )
{
- OSL_ENSURE(0,"DateFormatKey");
+ OSL_FAIL("DateFormatKey");
}
}
@@ -1317,7 +1319,7 @@ OSQLParser::OSQLParser(const ::com::sun::star::uno::Reference< ::com::sun::star:
s_pGarbageCollector = new OSQLParseNodesGarbageCollector();
if(!s_xLocaleData.is())
- s_xLocaleData = Reference<XLocaleData>(m_xServiceFactory->createInstance(::rtl::OUString::createFromAscii("com.sun.star.i18n.LocaleData")),UNO_QUERY);
+ s_xLocaleData = Reference<XLocaleData>(m_xServiceFactory->createInstance(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.i18n.LocaleData"))),UNO_QUERY);
// auf 0 zuruecksetzen
memset(OSQLParser::s_nRuleIDs,0,sizeof(OSQLParser::s_nRuleIDs[0]) * (OSQLParseNode::rule_count+1));
@@ -1428,7 +1430,7 @@ OSQLParser::OSQLParser(const ::com::sun::star::uno::Reference< ::com::sun::star:
{ OSQLParseNode::between_predicate_part_2, "between_predicate_part_2" },
{ OSQLParseNode::cast_spec, "cast_spec" }
};
- size_t nRuleMapCount = sizeof( aRuleDescriptions ) / sizeof( aRuleDescriptions[0] );
+ size_t nRuleMapCount = SAL_N_ELEMENTS( aRuleDescriptions );
OSL_ENSURE( nRuleMapCount == size_t( OSQLParseNode::rule_count ), "OSQLParser::OSQLParser: added a new rule? Adjust this map!" );
for ( size_t mapEntry = 0; mapEntry < nRuleMapCount; ++mapEntry )
@@ -1483,7 +1485,7 @@ void OSQLParseNode::substituteParameterNames(OSQLParseNode* _pNode)
OSQLParseNode* pChildNode = _pNode->getChild(i);
if(SQL_ISRULE(pChildNode,parameter) && pChildNode->count() > 1)
{
- OSQLParseNode* pNewNode = new OSQLParseNode(::rtl::OUString::createFromAscii("?") ,SQL_NODE_PUNCTUATION,0);
+ OSQLParseNode* pNewNode = new OSQLParseNode(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("?")) ,SQL_NODE_PUNCTUATION,0);
delete pChildNode->replace(pChildNode->getChild(0),pNewNode);
sal_Int32 nChildCount = pChildNode->count();
for(sal_Int32 j=1;j < nChildCount;++j)
@@ -1580,7 +1582,7 @@ OSQLParseNode::OSQLParseNode(const ::rtl::OString &_rNewValue,
SQLNodeType eNewNodeType,
sal_uInt32 nNewNodeID)
:m_pParent(NULL)
- ,m_aNodeValue(_rNewValue,_rNewValue.getLength(),RTL_TEXTENCODING_UTF8)
+ ,m_aNodeValue(rtl::OStringToOUString(_rNewValue,RTL_TEXTENCODING_UTF8))
,m_eNodeType(eNewNodeType)
,m_nNodeID(nNewNodeID)
{
@@ -1636,7 +1638,7 @@ OSQLParseNode::OSQLParseNode(const OSQLParseNode& rParseNode)
// wenn kein Blatt, dann SubTrees bearbeiten
for (OSQLParseNodes::const_iterator i = rParseNode.m_aChildren.begin();
- i != rParseNode.m_aChildren.end(); i++)
+ i != rParseNode.m_aChildren.end(); ++i)
append(new OSQLParseNode(**i));
}
// -----------------------------------------------------------------------------
@@ -1651,13 +1653,13 @@ OSQLParseNode& OSQLParseNode::operator=(const OSQLParseNode& rParseNode)
m_nNodeID = rParseNode.m_nNodeID;
for (OSQLParseNodes::const_iterator i = m_aChildren.begin();
- i != m_aChildren.end(); i++)
+ i != m_aChildren.end(); ++i)
delete *i;
m_aChildren.clear();
for (OSQLParseNodes::const_iterator j = rParseNode.m_aChildren.begin();
- j != rParseNode.m_aChildren.end(); j++)
+ j != rParseNode.m_aChildren.end(); ++j)
append(new OSQLParseNode(**j));
}
return *this;
@@ -1686,7 +1688,7 @@ sal_Bool OSQLParseNode::operator==(OSQLParseNode& rParseNode) const
OSQLParseNode::~OSQLParseNode()
{
for (OSQLParseNodes::const_iterator i = m_aChildren.begin();
- i != m_aChildren.end(); i++)
+ i != m_aChildren.end(); ++i)
delete *i;
m_aChildren.clear();
}
@@ -1721,19 +1723,19 @@ sal_Bool OSQLParseNode::addDateValue(::rtl::OUStringBuffer& rString, const SQLPa
SQL_ISTOKEN(pODBCNodeChild, T) ||
SQL_ISTOKEN(pODBCNodeChild, TS) ))
{
- ::rtl::OUString suQuote(::rtl::OUString::createFromAscii("'"));
+ ::rtl::OUString suQuote(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("'")));
if (rParam.bPredicate)
{
if (rParam.aMetaData.shouldEscapeDateTime())
{
- suQuote = ::rtl::OUString::createFromAscii("#");
+ suQuote = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("#"));
}
}
else
{
if (rParam.aMetaData.shouldEscapeDateTime())
{
- // suQuote = ::rtl::OUString::createFromAscii("'");
+ // suQuote = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("'"));
return sal_False;
}
}
@@ -1770,7 +1772,7 @@ void OSQLParseNode::replaceNodeValue(const ::rtl::OUString& rTableAlias,const ::
{
OSQLParseNode * pCol = removeAt((sal_uInt32)0);
append(new OSQLParseNode(rTableAlias,SQL_NODE_NAME));
- append(new OSQLParseNode(::rtl::OUString::createFromAscii("."),SQL_NODE_PUNCTUATION));
+ append(new OSQLParseNode(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(".")),SQL_NODE_PUNCTUATION));
append(pCol);
}
else
@@ -1787,7 +1789,7 @@ OSQLParseNode* OSQLParseNode::getByRule(OSQLParseNode::Rule eRule) const
else
{
for (OSQLParseNodes::const_iterator i = m_aChildren.begin();
- !pRetNode && i != m_aChildren.end(); i++)
+ !pRetNode && i != m_aChildren.end(); ++i)
pRetNode = (*i)->getByRule(eRule);
}
return pRetNode;
@@ -1797,7 +1799,7 @@ OSQLParseNode* MakeANDNode(OSQLParseNode *pLeftLeaf,OSQLParseNode *pRightLeaf)
{
OSQLParseNode* pNewNode = new OSQLParseNode(::rtl::OUString(),SQL_NODE_RULE,OSQLParser::RuleID(OSQLParseNode::boolean_term));
pNewNode->append(pLeftLeaf);
- pNewNode->append(new OSQLParseNode(::rtl::OUString::createFromAscii("AND"),SQL_NODE_KEYWORD,SQL_TOKEN_AND));
+ pNewNode->append(new OSQLParseNode(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("AND")),SQL_NODE_KEYWORD,SQL_TOKEN_AND));
pNewNode->append(pRightLeaf);
return pNewNode;
}
@@ -1806,7 +1808,7 @@ OSQLParseNode* MakeORNode(OSQLParseNode *pLeftLeaf,OSQLParseNode *pRightLeaf)
{
OSQLParseNode* pNewNode = new OSQLParseNode(::rtl::OUString(),SQL_NODE_RULE,OSQLParser::RuleID(OSQLParseNode::search_condition));
pNewNode->append(pLeftLeaf);
- pNewNode->append(new OSQLParseNode(::rtl::OUString::createFromAscii("OR"),SQL_NODE_KEYWORD,SQL_TOKEN_OR));
+ pNewNode->append(new OSQLParseNode(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("OR")),SQL_NODE_KEYWORD,SQL_TOKEN_OR));
pNewNode->append(pRightLeaf);
return pNewNode;
}
@@ -1908,7 +1910,7 @@ void OSQLParseNode::negateSearchCondition(OSQLParseNode*& pSearchCondition,sal_B
{
OSQLParseNode* pNewNode = new OSQLParseNode(::rtl::OUString(),SQL_NODE_RULE,OSQLParser::RuleID(OSQLParseNode::boolean_term));
pNewNode->append(pSearchCondition->removeAt((sal_uInt32)0));
- pNewNode->append(new OSQLParseNode(::rtl::OUString::createFromAscii("AND"),SQL_NODE_KEYWORD,SQL_TOKEN_AND));
+ pNewNode->append(new OSQLParseNode(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("AND")),SQL_NODE_KEYWORD,SQL_TOKEN_AND));
pNewNode->append(pSearchCondition->removeAt((sal_uInt32)1));
replaceAndReset(pSearchCondition,pNewNode);
@@ -1928,7 +1930,7 @@ void OSQLParseNode::negateSearchCondition(OSQLParseNode*& pSearchCondition,sal_B
{
OSQLParseNode* pNewNode = new OSQLParseNode(::rtl::OUString(),SQL_NODE_RULE,OSQLParser::RuleID(OSQLParseNode::search_condition));
pNewNode->append(pSearchCondition->removeAt((sal_uInt32)0));
- pNewNode->append(new OSQLParseNode(::rtl::OUString::createFromAscii("OR"),SQL_NODE_KEYWORD,SQL_TOKEN_OR));
+ pNewNode->append(new OSQLParseNode(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("OR")),SQL_NODE_KEYWORD,SQL_TOKEN_OR));
pNewNode->append(pSearchCondition->removeAt((sal_uInt32)1));
replaceAndReset(pSearchCondition,pNewNode);
@@ -1960,25 +1962,25 @@ void OSQLParseNode::negateSearchCondition(OSQLParseNode*& pSearchCondition,sal_B
switch(pComparison->getNodeType())
{
case SQL_NODE_EQUAL:
- pNewComparison = new OSQLParseNode(::rtl::OUString::createFromAscii("<>"),SQL_NODE_NOTEQUAL,SQL_NOTEQUAL);
+ pNewComparison = new OSQLParseNode(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("<>")),SQL_NODE_NOTEQUAL,SQL_NOTEQUAL);
break;
case SQL_NODE_LESS:
- pNewComparison = new OSQLParseNode(::rtl::OUString::createFromAscii(">="),SQL_NODE_GREATEQ,SQL_GREATEQ);
+ pNewComparison = new OSQLParseNode(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(">=")),SQL_NODE_GREATEQ,SQL_GREATEQ);
break;
case SQL_NODE_GREAT:
- pNewComparison = new OSQLParseNode(::rtl::OUString::createFromAscii("<="),SQL_NODE_LESSEQ,SQL_LESSEQ);
+ pNewComparison = new OSQLParseNode(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("<=")),SQL_NODE_LESSEQ,SQL_LESSEQ);
break;
case SQL_NODE_LESSEQ:
- pNewComparison = new OSQLParseNode(::rtl::OUString::createFromAscii(">"),SQL_NODE_GREAT,SQL_GREAT);
+ pNewComparison = new OSQLParseNode(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(">")),SQL_NODE_GREAT,SQL_GREAT);
break;
case SQL_NODE_GREATEQ:
- pNewComparison = new OSQLParseNode(::rtl::OUString::createFromAscii("<"),SQL_NODE_LESS,SQL_LESS);
+ pNewComparison = new OSQLParseNode(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("<")),SQL_NODE_LESS,SQL_LESS);
break;
case SQL_NODE_NOTEQUAL:
- pNewComparison = new OSQLParseNode(::rtl::OUString::createFromAscii("="),SQL_NODE_EQUAL,SQL_EQUAL);
+ pNewComparison = new OSQLParseNode(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("=")),SQL_NODE_EQUAL,SQL_EQUAL);
break;
default:
- OSL_ENSURE( false, "OSQLParseNode::negateSearchCondition: unexpected node type!" );
+ OSL_FAIL( "OSQLParseNode::negateSearchCondition: unexpected node type!" );
break;
}
pSearchCondition->replace(pComparison, pNewComparison);
@@ -2000,7 +2002,7 @@ void OSQLParseNode::negateSearchCondition(OSQLParseNode*& pSearchCondition,sal_B
OSQLParseNode* pNot = pPart2->getChild(nNotPos);
OSQLParseNode* pNotNot = NULL;
if(pNot->isRule())
- pNotNot = new OSQLParseNode(::rtl::OUString::createFromAscii("NOT"),SQL_NODE_KEYWORD,SQL_TOKEN_NOT);
+ pNotNot = new OSQLParseNode(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("NOT")),SQL_NODE_KEYWORD,SQL_TOKEN_NOT);
else
pNotNot = new OSQLParseNode(::rtl::OUString(),SQL_NODE_RULE,OSQLParser::RuleID(OSQLParseNode::sql_not));
pPart2->replace(pNot, pNotNot);
@@ -2011,7 +2013,7 @@ void OSQLParseNode::negateSearchCondition(OSQLParseNode*& pSearchCondition,sal_B
OSQLParseNode* pNot = pSearchCondition->getChild( 1 )->getChild( 0 );
OSQLParseNode* pNotNot = NULL;
if(pNot->isRule())
- pNotNot = new OSQLParseNode(::rtl::OUString::createFromAscii("NOT"),SQL_NODE_KEYWORD,SQL_TOKEN_NOT);
+ pNotNot = new OSQLParseNode(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("NOT")),SQL_NODE_KEYWORD,SQL_TOKEN_NOT);
else
pNotNot = new OSQLParseNode(::rtl::OUString(),SQL_NODE_RULE,OSQLParser::RuleID(OSQLParseNode::sql_not));
pSearchCondition->getChild( 1 )->replace(pNot, pNotNot);
@@ -2103,9 +2105,9 @@ void OSQLParseNode::absorptions(OSQLParseNode*& pSearchCondition)
OSQLParseNode* p2ndAnd = MakeANDNode(new OSQLParseNode(*pA),pC);
pNewNode = MakeORNode(p1stAnd,p2ndAnd);
OSQLParseNode* pNode = new OSQLParseNode(::rtl::OUString(),SQL_NODE_RULE,OSQLParser::RuleID(OSQLParseNode::boolean_primary));
- pNode->append(new OSQLParseNode(::rtl::OUString::createFromAscii("("),SQL_NODE_PUNCTUATION));
+ pNode->append(new OSQLParseNode(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("(")),SQL_NODE_PUNCTUATION));
pNode->append(pNewNode);
- pNode->append(new OSQLParseNode(::rtl::OUString::createFromAscii(")"),SQL_NODE_PUNCTUATION));
+ pNode->append(new OSQLParseNode(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(")")),SQL_NODE_PUNCTUATION));
OSQLParseNode::eraseBraces(p1stAnd);
OSQLParseNode::eraseBraces(p2ndAnd);
replaceAndReset(pSearchCondition,pNode);
@@ -2183,9 +2185,9 @@ void OSQLParseNode::compress(OSQLParseNode *&pSearchCondition)
OSQLParseNode* pNode = MakeORNode(pLeft,pRight);
OSQLParseNode* pNewRule = new OSQLParseNode(::rtl::OUString(),SQL_NODE_RULE,OSQLParser::RuleID(OSQLParseNode::boolean_primary));
- pNewRule->append(new OSQLParseNode(::rtl::OUString::createFromAscii("("),SQL_NODE_PUNCTUATION));
+ pNewRule->append(new OSQLParseNode(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("(")),SQL_NODE_PUNCTUATION));
pNewRule->append(pNode);
- pNewRule->append(new OSQLParseNode(::rtl::OUString::createFromAscii(")"),SQL_NODE_PUNCTUATION));
+ pNewRule->append(new OSQLParseNode(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(")")),SQL_NODE_PUNCTUATION));
OSQLParseNode::eraseBraces(pLeft);
OSQLParseNode::eraseBraces(pRight);
@@ -2200,9 +2202,9 @@ void OSQLParseNode::compress(OSQLParseNode *&pSearchCondition)
OSQLParseNode* pNode = MakeORNode(pLeft,pRight);
OSQLParseNode* pNewRule = new OSQLParseNode(::rtl::OUString(),SQL_NODE_RULE,OSQLParser::RuleID(OSQLParseNode::boolean_primary));
- pNewRule->append(new OSQLParseNode(::rtl::OUString::createFromAscii("("),SQL_NODE_PUNCTUATION));
+ pNewRule->append(new OSQLParseNode(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("(")),SQL_NODE_PUNCTUATION));
pNewRule->append(pNode);
- pNewRule->append(new OSQLParseNode(::rtl::OUString::createFromAscii(")"),SQL_NODE_PUNCTUATION));
+ pNewRule->append(new OSQLParseNode(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(")")),SQL_NODE_PUNCTUATION));
OSQLParseNode::eraseBraces(pLeft);
OSQLParseNode::eraseBraces(pRight);
@@ -2217,9 +2219,9 @@ void OSQLParseNode::compress(OSQLParseNode *&pSearchCondition)
OSQLParseNode* pNode = MakeORNode(pLeft,pRight);
OSQLParseNode* pNewRule = new OSQLParseNode(::rtl::OUString(),SQL_NODE_RULE,OSQLParser::RuleID(OSQLParseNode::boolean_primary));
- pNewRule->append(new OSQLParseNode(::rtl::OUString::createFromAscii("("),SQL_NODE_PUNCTUATION));
+ pNewRule->append(new OSQLParseNode(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("(")),SQL_NODE_PUNCTUATION));
pNewRule->append(pNode);
- pNewRule->append(new OSQLParseNode(::rtl::OUString::createFromAscii(")"),SQL_NODE_PUNCTUATION));
+ pNewRule->append(new OSQLParseNode(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(")")),SQL_NODE_PUNCTUATION));
OSQLParseNode::eraseBraces(pLeft);
OSQLParseNode::eraseBraces(pRight);
@@ -2234,9 +2236,9 @@ void OSQLParseNode::compress(OSQLParseNode *&pSearchCondition)
OSQLParseNode* pNode = MakeORNode(pLeft,pRight);
OSQLParseNode* pNewRule = new OSQLParseNode(::rtl::OUString(),SQL_NODE_RULE,OSQLParser::RuleID(OSQLParseNode::boolean_primary));
- pNewRule->append(new OSQLParseNode(::rtl::OUString::createFromAscii("("),SQL_NODE_PUNCTUATION));
+ pNewRule->append(new OSQLParseNode(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("(")),SQL_NODE_PUNCTUATION));
pNewRule->append(pNode);
- pNewRule->append(new OSQLParseNode(::rtl::OUString::createFromAscii(")"),SQL_NODE_PUNCTUATION));
+ pNewRule->append(new OSQLParseNode(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(")")),SQL_NODE_PUNCTUATION));
OSQLParseNode::eraseBraces(pLeft);
OSQLParseNode::eraseBraces(pRight);
@@ -2367,7 +2369,7 @@ void OSQLParseNode::showParseTree( ::rtl::OUStringBuffer& _inout_rBuffer, sal_uI
default:
OSL_TRACE( "-- %i", int( m_eNodeType ) );
- OSL_ENSURE( false, "OSQLParser::ShowParseTree: unzulaessiger NodeType" );
+ OSL_FAIL( "OSQLParser::ShowParseTree: unzulaessiger NodeType" );
}
}
}
@@ -2469,12 +2471,12 @@ void OSQLParseNode::parseLeaf(::rtl::OUStringBuffer& rString, const SQLParseNode
rString.appendAscii(" ");
const ::rtl::OString sT = OSQLParser::TokenIDToStr(m_nNodeID, rParam.bInternational ? &rParam.m_rContext : NULL);
- rString.append(::rtl::OUString(sT,sT.getLength(),RTL_TEXTENCODING_UTF8));
+ rString.append(::rtl::OStringToOUString(sT,RTL_TEXTENCODING_UTF8));
} break;
case SQL_NODE_STRING:
if (rString.getLength())
rString.appendAscii(" ");
- rString.append(SetQuotation(m_aNodeValue,::rtl::OUString::createFromAscii("\'"),::rtl::OUString::createFromAscii("\'\'")));
+ rString.append(SetQuotation(m_aNodeValue,::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("\'")),::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("\'\'"))));
break;
case SQL_NODE_NAME:
if (rString.getLength())
@@ -2554,7 +2556,7 @@ void OSQLParseNode::parseLeaf(::rtl::OUStringBuffer& rString, const SQLParseNode
sal_Int32 OSQLParser::getFunctionReturnType(const ::rtl::OUString& _sFunctionName, const IParseContext* pContext)
{
sal_Int32 nType = DataType::VARCHAR;
- ::rtl::OString sFunctionName(_sFunctionName,_sFunctionName.getLength(),RTL_TEXTENCODING_UTF8);
+ ::rtl::OString sFunctionName(::rtl::OUStringToOString(_sFunctionName,RTL_TEXTENCODING_UTF8));
if(sFunctionName.equalsIgnoreAsciiCase(TokenIDToStr(SQL_TOKEN_ASCII,pContext))) nType = DataType::INTEGER;
else if(sFunctionName.equalsIgnoreAsciiCase(TokenIDToStr(SQL_TOKEN_BIT_LENGTH,pContext))) nType = DataType::INTEGER;
@@ -2832,3 +2834,5 @@ void OSQLParseNodesContainer::clearAndDelete()
}
}
} // namespace connectivity
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */