mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-05-02 14:16:16 -04:00
FeedReeder:
- Fixed memory leak in xpath processing - Stop long loops when closing the preview dialog or shutdown - Added drag and drop to xpath lists in preview dialog - Fixed save of xpaths lists git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@6074 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
parent
66c4a3d71b
commit
13f2863569
5 changed files with 254 additions and 149 deletions
|
@ -71,12 +71,25 @@ bool XPathWrapper::compile(const char *expression)
|
|||
return true;
|
||||
}
|
||||
|
||||
xmlXPathObjectType XPathWrapper::type()
|
||||
{
|
||||
if (mResult) {
|
||||
return mResult->type;
|
||||
}
|
||||
|
||||
return XPATH_UNDEFINED;
|
||||
}
|
||||
|
||||
unsigned int XPathWrapper::count()
|
||||
{
|
||||
if (!mResult) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (mResult->type != XPATH_NODESET) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (xmlXPathNodeSetIsEmpty(mResult->nodesetval)) {
|
||||
return 0;
|
||||
}
|
||||
|
@ -90,6 +103,10 @@ xmlNodePtr XPathWrapper::node(unsigned int index)
|
|||
return NULL;
|
||||
}
|
||||
|
||||
if (mResult->type != XPATH_NODESET) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if (xmlXPathNodeSetIsEmpty(mResult->nodesetval)) {
|
||||
return NULL;
|
||||
}
|
||||
|
|
|
@ -37,6 +37,8 @@ public:
|
|||
|
||||
bool compile(const char *expression);
|
||||
|
||||
xmlXPathObjectType type();
|
||||
|
||||
unsigned int count();
|
||||
xmlNodePtr node(unsigned int index);
|
||||
|
||||
|
@ -48,4 +50,4 @@ protected:
|
|||
xmlXPathObjectPtr mResult;
|
||||
};
|
||||
|
||||
#endif
|
||||
#endif
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue