summaryrefslogtreecommitdiff
path: root/rsc/source/tools
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2016-12-23 10:50:17 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2016-12-23 11:42:34 +0000
commitb641929e69aa5917536fad72644d0da4d67f8adc (patch)
tree92a95c566651b34b55461d2e8e7d5e1ef65b5e87 /rsc/source/tools
parent597d178c2b516ab0cff4e4f86246d47ce9700f18 (diff)
merge StringNode with RscDefine
Change-Id: Ia64b7419ccbb06ff55907717963864caef2023a8 Reviewed-on: https://gerrit.libreoffice.org/32374 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'rsc/source/tools')
-rw-r--r--rsc/source/tools/rscdef.cxx34
-rw-r--r--rsc/source/tools/rsctree.cxx29
2 files changed, 29 insertions, 34 deletions
diff --git a/rsc/source/tools/rscdef.cxx b/rsc/source/tools/rscdef.cxx
index 9beb17e4d5f8..2e2a05767bfb 100644
--- a/rsc/source/tools/rscdef.cxx
+++ b/rsc/source/tools/rscdef.cxx
@@ -115,7 +115,7 @@ OString RscId::GetName() const
}
RscDefine::RscDefine( sal_uLong lKey, const OString& rDefName, sal_Int32 lDefId )
- : StringNode( rDefName )
+ : m_aName( rDefName )
{
nRefCount = 0;
lFileKey = lKey;
@@ -125,8 +125,7 @@ RscDefine::RscDefine( sal_uLong lKey, const OString& rDefName, sal_Int32 lDefId
RscDefine::RscDefine( sal_uLong lKey, const OString& rDefName,
RscExpression * pExpression )
- : StringNode( rDefName )
- , lId(0)
+ : lId(0), m_aName( rDefName )
{
nRefCount = 0;
lFileKey = lKey;
@@ -163,9 +162,34 @@ void RscDefine::Evaluate()
pExp->Evaluate( &lId );
}
-RscDefine * RscDefine::Search( const char * pStr )
+RscDefine * RscDefine::Search( const char * pSearch ) const
{
- return static_cast<RscDefine *>(StringNode::Search( pStr ));
+ return static_cast<RscDefine *>(NameNode::Search( static_cast<const void *>(pSearch) ));
+}
+
+COMPARE RscDefine::Compare( const NameNode * pSearch ) const
+{
+ int nCmp = strcmp( m_aName.getStr(),
+ static_cast<const RscDefine *>(pSearch)->m_aName.getStr() );
+ if( nCmp < 0 )
+ return LESS;
+ else if( nCmp > 0 )
+ return GREATER;
+ else
+ return EQUAL;
+}
+
+// pSearch is a pointer to const char *
+COMPARE RscDefine::Compare( const void * pSearch ) const
+{
+ int nCmp = strcmp( m_aName.getStr(), static_cast<const char *>(pSearch) );
+
+ if( nCmp < 0 )
+ return LESS;
+ else if( nCmp > 0 )
+ return GREATER;
+ else
+ return EQUAL;
}
RscDefine * RscDefineList::New( sal_uLong lFileKey, const OString& rDefName,
diff --git a/rsc/source/tools/rsctree.cxx b/rsc/source/tools/rsctree.cxx
index 7d9f67715f6b..410b7bb58b46 100644
--- a/rsc/source/tools/rsctree.cxx
+++ b/rsc/source/tools/rsctree.cxx
@@ -355,34 +355,5 @@ sal_uInt32 IdNode::GetId() const
return 0xFFFFFFFF;
}
-StringNode * StringNode::Search( const char * pSearch ) const
-{
- return static_cast<StringNode *>(NameNode::Search( static_cast<const void *>(pSearch) ));
-}
-
-COMPARE StringNode::Compare( const NameNode * pSearch ) const
-{
- int nCmp = strcmp( m_aName.getStr(),
- static_cast<const StringNode *>(pSearch)->m_aName.getStr() );
- if( nCmp < 0 )
- return LESS;
- else if( nCmp > 0 )
- return GREATER;
- else
- return EQUAL;
-}
-
-// pSearch is a pointer to const char *
-COMPARE StringNode::Compare( const void * pSearch ) const
-{
- int nCmp = strcmp( m_aName.getStr(), static_cast<const char *>(pSearch) );
-
- if( nCmp < 0 )
- return LESS;
- else if( nCmp > 0 )
- return GREATER;
- else
- return EQUAL;
-}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */