summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--include/svx/ctredlin.hxx6
-rw-r--r--svx/source/dialog/ctredlin.cxx48
2 files changed, 19 insertions, 35 deletions
diff --git a/include/svx/ctredlin.hxx b/include/svx/ctredlin.hxx
index c7b7b7128d33..6b3685dc7c90 100644
--- a/include/svx/ctredlin.hxx
+++ b/include/svx/ctredlin.hxx
@@ -133,9 +133,9 @@ public:
void SetCalcView(sal_Bool bFlag=sal_True);
// no NULL-pointer checking {
- sal_Bool IsValidEntry(const String* pAuthor,const DateTime *pDateTime,const String* pComment);
- sal_Bool IsValidEntry(const String* pAuthor,const DateTime *pDateTime);
- sal_Bool IsValidComment(const String* pComment);
+ bool IsValidEntry(const String* pAuthor,const DateTime *pDateTime,const String* pComment);
+ bool IsValidEntry(const String* pAuthor,const DateTime *pDateTime);
+ bool IsValidComment(const String* pComment);
// }
SvTreeListEntry* InsertEntry(const OUString& ,RedlinData *pUserData,
diff --git a/svx/source/dialog/ctredlin.cxx b/svx/source/dialog/ctredlin.cxx
index 62e3f7db53ca..c7fc3337e90b 100644
--- a/svx/source/dialog/ctredlin.cxx
+++ b/svx/source/dialog/ctredlin.cxx
@@ -302,48 +302,32 @@ void SvxRedlinTable::SetCommentParams( const utl::SearchParam* pSearchPara )
}
}
-sal_Bool SvxRedlinTable::IsValidEntry(const String* pAuthorStr,
+bool SvxRedlinTable::IsValidEntry(const String* pAuthorStr,
const DateTime *pDateTime,const String* pCommentStr)
{
return IsValidEntry(pAuthorStr, pDateTime) && IsValidComment(pCommentStr);
}
-sal_Bool SvxRedlinTable::IsValidEntry(const String* pAuthorStr,const DateTime *pDateTime)
+bool SvxRedlinTable::IsValidEntry(const String* pAuthorStr,const DateTime *pDateTime)
{
- sal_Bool nTheFlag=sal_True;
- if(bAuthor)
- {
- if(aAuthor.CompareTo(*pAuthorStr)==COMPARE_EQUAL)
- nTheFlag=sal_True;
- else
- nTheFlag=sal_False;
- }
- if(bDate && nTheFlag)
- {
- if(nDaTiMode!=FLT_DATE_NOTEQUAL)
- {
- nTheFlag=pDateTime->IsBetween(aDaTiFilterFirst,aDaTiFilterLast);
- }
- else
- {
- nTheFlag=!(pDateTime->IsBetween(aDaTiFilterFirst,aDaTiFilterLast));
- }
- }
- return nTheFlag;
+ if (bAuthor && !aAuthor.CompareTo(*pAuthorStr)==COMPARE_EQUAL)
+ return false;
+
+ if (!bDate)
+ return true;
+
+ const bool bRes = pDateTime->IsBetween(aDaTiFilterFirst, aDaTiFilterLast);
+ return nDaTiMode!=FLT_DATE_NOTEQUAL ? bRes : !bRes;
}
-sal_Bool SvxRedlinTable::IsValidComment(const String* pCommentStr)
+bool SvxRedlinTable::IsValidComment(const String* pCommentStr)
{
- bool nTheFlag=true;
+ if (!bComment)
+ return true;
- if(bComment)
- {
- sal_Int32 nStartPos = 0;
- sal_Int32 nEndPos = pCommentStr->Len();
-
- nTheFlag=pCommentSearcher->SearchForward( *pCommentStr, &nStartPos, &nEndPos);
- }
- return nTheFlag;
+ sal_Int32 nStartPos = 0;
+ sal_Int32 nEndPos = pCommentStr->Len();
+ return pCommentSearcher->SearchForward( *pCommentStr, &nStartPos, &nEndPos);
}
SvTreeListEntry* SvxRedlinTable::InsertEntry(const OUString& rStr,RedlinData *pUserData,