summaryrefslogtreecommitdiff
path: root/include/connectivity/sqlnode.hxx
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2018-01-30 08:28:47 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2018-02-05 07:53:09 +0100
commit7dcf9db73b48c396332ea0d17572c5103018b8e0 (patch)
tree78d980d57fcdfa2f638911075dd94ce6a06307c9 /include/connectivity/sqlnode.hxx
parentc81791db5506f2576fac0466c760479902e7ccc8 (diff)
loplugin:useuniqueptr in OSQLParseNode
Change-Id: Ibad6e4b32b19a925de621b9dea7070d3930f05ef Reviewed-on: https://gerrit.libreoffice.org/49182 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'include/connectivity/sqlnode.hxx')
-rw-r--r--include/connectivity/sqlnode.hxx21
1 files changed, 9 insertions, 12 deletions
diff --git a/include/connectivity/sqlnode.hxx b/include/connectivity/sqlnode.hxx
index 20c821957eab..e2198499baed 100644
--- a/include/connectivity/sqlnode.hxx
+++ b/include/connectivity/sqlnode.hxx
@@ -63,8 +63,6 @@ namespace connectivity
class OSQLParseNode;
class IParseContext;
- typedef ::std::vector< OSQLParseNode* > OSQLParseNodes;
-
enum class SQLNodeType { Rule, ListRule, CommaListRule,
Keyword, Name,
String, IntNum, ApproxNum,
@@ -114,14 +112,15 @@ namespace connectivity
{
friend class OSQLParser;
- OSQLParseNodes m_aChildren;
- OSQLParseNode* m_pParent; // pParent for reverse linkage in the tree
+ std::vector< std::unique_ptr<OSQLParseNode> >
+ m_aChildren;
+ OSQLParseNode* m_pParent; // pParent for reverse linkage in the tree
OUString m_aNodeValue; // token name, or empty in case of rules,
- // or OUString in case of
- // OUString, INT, etc.
- SQLNodeType m_eNodeType; // see above
- sal_uInt32 m_nNodeID; // Rule ID (if IsRule())
- // or Token ID (if !IsRule())
+ // or OUString in case of
+ // OUString, INT, etc.
+ SQLNodeType m_eNodeType; // see above
+ sal_uInt32 m_nNodeID; // Rule ID (if IsRule())
+ // or Token ID (if !IsRule())
// Rule IDs and Token IDs can't
// be distinguished by their values,
// IsRule has to be used for that!
@@ -441,9 +440,7 @@ namespace connectivity
inline OSQLParseNode* OSQLParseNode::getChild(sal_uInt32 nPos) const
{
- assert(nPos < m_aChildren.size());
-
- return m_aChildren[nPos];
+ return m_aChildren[nPos].get();
}
// utilities to query for a specific rule, token or punctuation