include/svx/ctredlin.hxx       |    6 ++---
 svx/source/dialog/ctredlin.cxx |   48 +++++++++++++----------------------------
 2 files changed, 19 insertions(+), 35 deletions(-)

New commits:
commit 2145d6e8b3c5bead1db97e33f60f5ae0e34add38
Author: Matteo Casalin <matteo.casa...@yahoo.com>
Date:   Fri Aug 16 17:42:03 2013 +0200

    sal_Bool to bool and early bail out
    
    Change-Id: I2cac3cdd24a1e9ad322724e0819aa43cad63855e
    Reviewed-on: https://gerrit.libreoffice.org/5458
    Reviewed-by: Michael Stahl <mst...@redhat.com>
    Tested-by: Michael Stahl <mst...@redhat.com>

diff --git a/include/svx/ctredlin.hxx b/include/svx/ctredlin.hxx
index c7b7b71..6b3685d 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 62e3f7d..c7fc333 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,
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to