diff options
-rw-r--r-- | src/layout.cpp | 4 | ||||
-rw-r--r-- | src/qcstring.h | 15 |
2 files changed, 11 insertions, 8 deletions
diff --git a/src/layout.cpp b/src/layout.cpp index 49405aa..7c368be 100644 --- a/src/layout.cpp +++ b/src/layout.cpp @@ -110,7 +110,7 @@ LayoutNavEntry *LayoutNavEntry::find(LayoutNavEntry::Kind kind, // root in case an entry is in the tree twice result = entry->find(kind,file); if (result) return result; - if (entry->kind()==kind && (file==0 || entry->baseFile()==file)) + if (entry->kind()==kind && (file==QCString() || entry->baseFile()==file)) { return entry.get(); } @@ -1559,7 +1559,7 @@ void LayoutDocManager::init() XMLParser parser(handlers); layoutParser.setDocumentLocator(&parser); QCString layout_default = ResourceMgr::instance().getAsString("layout_default.xml"); - parser.parse("layout_default.xml",qPrint(layout_default),Debug::isFlagSet(Debug::Lex)); + parser.parse("layout_default.xml",layout_default.data(),Debug::isFlagSet(Debug::Lex)); } LayoutDocManager::~LayoutDocManager() diff --git a/src/qcstring.h b/src/qcstring.h index 1588d5c..d53d48d 100644 --- a/src/qcstring.h +++ b/src/qcstring.h @@ -76,19 +76,22 @@ char * qstrncpy(char *dst,const char *src, uint len); inline int cstrcmp( const char *str1, const char *str2 ) { return strcmp(str1,str2); } +inline bool qisempty( const char *s) +{ return s==0 || *s==0; } + inline int qstrcmp( const char *str1, const char *str2 ) -{ return (str1 && str2) ? strcmp(str1,str2) : - (!str1 && !str2) ? 0 : // both empty - str1 ? -1 : 1; +{ return (str1 && str2) ? strcmp(str1,str2) : // both non-empty + (qisempty(str1) && qisempty(str2)) ? 0 : // both empty + qisempty(str1) ? -1 : 1; // one empty, other non-empty } inline int cstrncmp( const char *str1, const char *str2, uint len ) { return strncmp(str1,str2,len); } inline int qstrncmp( const char *str1, const char *str2, uint len ) -{ return (str1 && str2) ? strncmp(str1,str2,len) : - (!str1 && !str2) ? 0 : // both empty - str1 ? -1 : 1; +{ return (str1 && str2) ? strncmp(str1,str2,len) : // both non-empty + (qisempty(str1) && qisempty(str2)) ? 0 : // both empty + qisempty(str1) ? -1 : 1; // one empty other non-empty } inline bool qisspace(char c) |