summaryrefslogtreecommitdiffstats
path: root/svx/source
diff options
context:
space:
mode:
authorMatteo Casalin <matteo.casalin@yahoo.com>2013-08-16 17:42:03 +0200
committerMichael Stahl <mstahl@redhat.com>2013-08-17 13:06:03 +0000
commit2145d6e8b3c5bead1db97e33f60f5ae0e34add38 (patch)
treeab9df33679d74eb63202d86d66c340548ae5946e /svx/source
parentString to OUString (diff)
downloadcore-2145d6e8b3c5bead1db97e33f60f5ae0e34add38.tar.gz
core-2145d6e8b3c5bead1db97e33f60f5ae0e34add38.zip
sal_Bool to bool and early bail out
Change-Id: I2cac3cdd24a1e9ad322724e0819aa43cad63855e Reviewed-on: https://gerrit.libreoffice.org/5458 Reviewed-by: Michael Stahl <mstahl@redhat.com> Tested-by: Michael Stahl <mstahl@redhat.com>
Diffstat (limited to 'svx/source')
-rw-r--r--svx/source/dialog/ctredlin.cxx48
1 files changed, 16 insertions, 32 deletions
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,