From 6eeee04bad507a1194bac9709ce4f00322762477 Mon Sep 17 00:00:00 2001 From: Stephan Bergmann Date: Fri, 10 Jan 2014 12:39:45 +0100 Subject: WildCard::ImpMatch should return bool Change-Id: Ib851cbe072bca0d594440cc28164e112d0fe37cb --- include/tools/wldcrd.hxx | 2 +- tools/source/fsys/wldcrd.cxx | 10 ++++------ 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/include/tools/wldcrd.hxx b/include/tools/wldcrd.hxx index 6c462807fbc5..e219edbed779 100644 --- a/include/tools/wldcrd.hxx +++ b/include/tools/wldcrd.hxx @@ -29,7 +29,7 @@ private: OString aWildString; char cSepSymbol; - sal_uInt16 ImpMatch( const char *pWild, const char *pStr ) const; + bool ImpMatch( const char *pWild, const char *pStr ) const; public: WildCard() diff --git a/tools/source/fsys/wldcrd.cxx b/tools/source/fsys/wldcrd.cxx index e7311eab38c2..66425bc910e4 100644 --- a/tools/source/fsys/wldcrd.cxx +++ b/tools/source/fsys/wldcrd.cxx @@ -20,14 +20,12 @@ #include /** Tests, whether a wildcard in pWild will match for pStr. - * - * If they match, return 1, otherwise 0. * * '*' in pWild means n chars for n > 0. * '?' in pWild mean match exactly one character. * */ -sal_uInt16 WildCard::ImpMatch( const char *pWild, const char *pStr ) const +bool WildCard::ImpMatch( const char *pWild, const char *pStr ) const { int pos=0; int flag=0; @@ -38,7 +36,7 @@ sal_uInt16 WildCard::ImpMatch( const char *pWild, const char *pStr ) const { case '?': if ( *pStr == '\0' ) - return 0; + return false; break; default: @@ -46,7 +44,7 @@ sal_uInt16 WildCard::ImpMatch( const char *pWild, const char *pStr ) const pWild++; if ( *pWild != *pStr ) if ( !pos ) - return 0; + return false; else pWild += pos; else @@ -56,7 +54,7 @@ sal_uInt16 WildCard::ImpMatch( const char *pWild, const char *pStr ) const while ( *pWild == '*' ) pWild++; if ( *pWild == '\0' ) - return 1; + return true; flag = 1; pos = 0; if ( *pStr == '\0' ) -- cgit