Kaydet (Commit) 6eeee04b authored tarafından Stephan Bergmann's avatar Stephan Bergmann

WildCard::ImpMatch should return bool

Change-Id: Ib851cbe072bca0d594440cc28164e112d0fe37cb
üst fd30e4a1
......@@ -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()
......
......@@ -20,14 +20,12 @@
#include <tools/wldcrd.hxx>
/** 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' )
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment