[Libreoffice-commits] core.git: include/svx svx/source

Matteo Casalin matteo.casalin at yahoo.com
Sat Aug 17 06:45:08 PDT 2013


 include/svx/ctredlin.hxx       |   26 ++++++++++----------
 svx/source/dialog/ctredlin.cxx |   52 +++++++++++++++++------------------------
 2 files changed, 35 insertions(+), 43 deletions(-)

New commits:
commit 1033903f36fb82b34d1264c94903b1368e7a0b12
Author: Matteo Casalin <matteo.casalin at yahoo.com>
Date:   Fri Aug 16 22:34:12 2013 +0200

    String to OUString
    
    Change-Id: I0e090c41831a40cec0bad8fe2c3fe262fefba762
    Reviewed-on: https://gerrit.libreoffice.org/5462
    Reviewed-by: Michael Stahl <mstahl at redhat.com>
    Tested-by: Michael Stahl <mstahl at redhat.com>

diff --git a/include/svx/ctredlin.hxx b/include/svx/ctredlin.hxx
index 320881c..1958307 100644
--- a/include/svx/ctredlin.hxx
+++ b/include/svx/ctredlin.hxx
@@ -97,9 +97,9 @@ private:
     DateTime        aDaTiLast;
     DateTime        aDaTiFilterFirst;
     DateTime        aDaTiFilterLast;
-    String          aAuthor;
+    OUString        aAuthor;
     Color           aEntryColor;
-    String          aCurEntry;
+    OUString        aCurEntry;
     utl::TextSearch* pCommentSearcher;
     Link            aColCompareLink;
 
@@ -123,7 +123,7 @@ public:
     void            SetFirstTime(const Time&);
     void            SetLastTime(const Time&);
     void            SetFilterAuthor(sal_Bool bFlag=sal_True);
-    void            SetAuthor(const String &);
+    void            SetAuthor(const OUString &);
     void            SetFilterComment(sal_Bool bFlag=sal_True);
     void            SetCommentParams( const utl::SearchParam* pSearchPara );
 
@@ -132,9 +132,9 @@ public:
 
     void            SetCalcView(sal_Bool bFlag=sal_True);
 
-    bool            IsValidEntry(const String &rAuthor, const DateTime &rDateTime, const String &rComment);
-    bool            IsValidEntry(const String &rAuthor, const DateTime &rDateTime);
-    bool            IsValidComment(const String &rComment);
+    bool            IsValidEntry(const OUString &rAuthor, const DateTime &rDateTime, const OUString &rComment);
+    bool            IsValidEntry(const OUString &rAuthor, const DateTime &rDateTime);
+    bool            IsValidComment(const OUString &rComment);
 
     SvTreeListEntry*    InsertEntry(const OUString& ,RedlinData *pUserData,
                                 SvTreeListEntry* pParent=NULL,sal_uIntPtr nPos=LIST_APPEND);
@@ -221,17 +221,17 @@ public:
     sal_uInt16          GetDateMode();
 
     void            ClearAuthors();
-    void            InsertAuthor( const String& rString, sal_uInt16 nPos = LISTBOX_APPEND );
-    String          GetSelectedAuthor()const;
+    void            InsertAuthor( const OUString& rString, sal_uInt16 nPos = LISTBOX_APPEND );
+    OUString        GetSelectedAuthor()const;
     void            SelectedAuthorPos(sal_uInt16 nPos);
-    sal_uInt16          SelectAuthor(const String& aString);
-    void            SetComment(const String &rComment);
-    String          GetComment()const;
+    sal_uInt16      SelectAuthor(const OUString& aString);
+    void            SetComment(const OUString& rComment);
+    OUString        GetComment()const;
 
 
     // Methods for Calc {
-    void            SetRange(const String& rString);
-    String          GetRange() const;
+    void            SetRange(const OUString& rString);
+    OUString        GetRange() const;
     void            HideRange(sal_Bool bHide=sal_True);
     void            SetFocusToRange();
     // } Methods for Calc
diff --git a/svx/source/dialog/ctredlin.cxx b/svx/source/dialog/ctredlin.cxx
index 1b5a883..07122fa 100644
--- a/svx/source/dialog/ctredlin.cxx
+++ b/svx/source/dialog/ctredlin.cxx
@@ -282,7 +282,7 @@ void SvxRedlinTable::SetFilterAuthor(sal_Bool bFlag)
     bAuthor=bFlag;
 }
 
-void SvxRedlinTable::SetAuthor(const String &aString)
+void SvxRedlinTable::SetAuthor(const OUString &aString)
 {
     aAuthor=aString;
 }
@@ -302,16 +302,16 @@ void SvxRedlinTable::SetCommentParams( const utl::SearchParam* pSearchPara )
     }
 }
 
-bool SvxRedlinTable::IsValidEntry(const String &rAuthorStr,
+bool SvxRedlinTable::IsValidEntry(const OUString &rAuthorStr,
                                   const DateTime &rDateTime,
-                                  const String &rCommentStr)
+                                  const OUString &rCommentStr)
 {
     return IsValidEntry(rAuthorStr, rDateTime) && IsValidComment(rCommentStr);
 }
 
-bool SvxRedlinTable::IsValidEntry(const String &rAuthorStr,const DateTime &rDateTime)
+bool SvxRedlinTable::IsValidEntry(const OUString &rAuthorStr, const DateTime &rDateTime)
 {
-    if (bAuthor && !aAuthor.CompareTo(rAuthorStr)==COMPARE_EQUAL)
+    if (bAuthor && aAuthor!=rAuthorStr)
         return false;
 
     if (!bDate)
@@ -321,13 +321,13 @@ bool SvxRedlinTable::IsValidEntry(const String &rAuthorStr,const DateTime &rDate
     return nDaTiMode!=FLT_DATE_NOTEQUAL ? bRes : !bRes;
 }
 
-bool SvxRedlinTable::IsValidComment(const String &rCommentStr)
+bool SvxRedlinTable::IsValidComment(const OUString &rCommentStr)
 {
     if (!bComment)
         return true;
 
     sal_Int32 nStartPos = 0;
-    sal_Int32 nEndPos = rCommentStr.Len();
+    sal_Int32 nEndPos = rCommentStr.getLength();
     return pCommentSearcher->SearchForward( rCommentStr, &nStartPos, &nEndPos);
 }
 
@@ -343,18 +343,9 @@ SvTreeListEntry* SvxRedlinTable::InsertEntry(const OUString& rStr,RedlinData *pU
 {
     aEntryColor=aColor;
 
-    XubString aStr= rStr;
-
-    XubString aFirstStr( aStr );
-    xub_StrLen nEnd = aFirstStr.Search( sal_Unicode ( '\t' ) );
-    if( nEnd != STRING_NOTFOUND )
-    {
-        aFirstStr.Erase( nEnd );
-        aCurEntry = aStr;
-        aCurEntry.Erase( 0, ++nEnd );
-    }
-    else
-        aCurEntry.Erase();
+    sal_Int32 nIndex = 0;
+    const OUString aFirstStr( rStr.getToken(0, '\t', nIndex ) );
+    aCurEntry = nIndex>0 ? rStr.copy(nIndex) : OUString();
 
     return SvSimpleTable::InsertEntry( aFirstStr, pParent, sal_False, nPos, pUserData );
 }
@@ -645,13 +636,13 @@ void SvxTPFilter::ShowDateFields(sal_uInt16 nKind)
         case FLT_DATE_EQUAL:
                 EnableDateLine1(sal_True);
                 m_pTfDate->Disable();
-                m_pTfDate->SetText(aEmpty);
+                m_pTfDate->SetText(OUString());
                 EnableDateLine2(sal_False);
                 break;
         case FLT_DATE_NOTEQUAL:
                 EnableDateLine1(sal_True);
                 m_pTfDate->Disable();
-                m_pTfDate->SetText(aEmpty);
+                m_pTfDate->SetText(OUString());
                 EnableDateLine2(sal_False);
                 break;
         case FLT_DATE_BETWEEN:
@@ -694,9 +685,9 @@ void SvxTPFilter::EnableDateLine2(sal_Bool bFlag)
     {
         m_pFtDate2->Disable();
         m_pDfDate2->Disable();
-        m_pDfDate2->SetText(aEmpty);
+        m_pDfDate2->SetText(OUString());
         m_pTfDate2->Disable();
-        m_pTfDate2->SetText(aEmpty);
+        m_pTfDate2->SetText(OUString());
         m_pIbClock2->Disable();
     }
 }
@@ -757,12 +748,12 @@ void SvxTPFilter::ClearAuthors()
     m_pLbAuthor->Clear();
 }
 
-void SvxTPFilter::InsertAuthor( const String& rString, sal_uInt16 nPos)
+void SvxTPFilter::InsertAuthor( const OUString& rString, sal_uInt16 nPos)
 {
     m_pLbAuthor->InsertEntry(rString,nPos);
 }
 
-String SvxTPFilter::GetSelectedAuthor() const
+OUString SvxTPFilter::GetSelectedAuthor() const
 {
     return m_pLbAuthor->GetSelectEntry();
 }
@@ -772,18 +763,18 @@ void SvxTPFilter::SelectedAuthorPos(sal_uInt16 nPos)
     m_pLbAuthor->SelectEntryPos(nPos);
 }
 
-sal_uInt16 SvxTPFilter::SelectAuthor(const String& aString)
+sal_uInt16 SvxTPFilter::SelectAuthor(const OUString& aString)
 {
     m_pLbAuthor->SelectEntry(aString);
     return m_pLbAuthor->GetSelectEntryPos();
 }
 
-void SvxTPFilter::SetRange(const String& rString)
+void SvxTPFilter::SetRange(const OUString& rString)
 {
     m_pEdRange->SetText(rString);
 }
 
-String SvxTPFilter::GetRange() const
+OUString SvxTPFilter::GetRange() const
 {
     return m_pEdRange->GetText();
 }
@@ -810,11 +801,12 @@ void SvxTPFilter::HideRange(sal_Bool bHide)
     }
 }
 
-void SvxTPFilter::SetComment(const String &rComment)
+void SvxTPFilter::SetComment(const OUString &rComment)
 {
     m_pEdComment->SetText(rComment);
 }
-String SvxTPFilter::GetComment()const
+
+OUString SvxTPFilter::GetComment()const
 {
     return m_pEdComment->GetText();
 }


More information about the Libreoffice-commits mailing list