diff options
author | Sören Möller <soerenmoeller2001@gmail.com> | 2012-07-09 21:48:26 +0200 |
---|---|---|
committer | Markus Mohrhard <markus.mohrhard@googlemail.com> | 2012-07-11 23:54:33 +0200 |
commit | c5653e812eb9729581e24c5e7822441b00b6d059 (patch) | |
tree | e2ccfd3167298072e398a5786e750c3eace2c402 /sc | |
parent | efd131357462aa16848f308fdb788e3e41f90e6b (diff) |
Replaced deprecated tools/String with OUString in sc/../chgviset
Added new TextSearch::SearchForward mirroring TextSearch::SearchFrwrd using OUString and sal_Int32 to make it possible to replace all uses of tools/String
Change-Id: I260d8d3a23d634eab37f28a5ceaf61ace5040540
Diffstat (limited to 'sc')
-rw-r--r-- | sc/inc/chgviset.hxx | 15 | ||||
-rw-r--r-- | sc/source/core/tool/chgviset.cxx | 13 | ||||
-rw-r--r-- | sc/source/ui/view/viewutil.cxx | 2 |
3 files changed, 14 insertions, 16 deletions
diff --git a/sc/inc/chgviset.hxx b/sc/inc/chgviset.hxx index 6d95abc9f1cf..f3e1dd9e3791 100644 --- a/sc/inc/chgviset.hxx +++ b/sc/inc/chgviset.hxx @@ -29,7 +29,6 @@ #define SC_CHGVISET_HXX #include <tools/datetime.hxx> -#include <tools/string.hxx> #include "rangelst.hxx" #include "scdllapi.h" @@ -50,8 +49,8 @@ private: utl::TextSearch* pCommentSearcher; DateTime aFirstDateTime; DateTime aLastDateTime; - String aAuthorToShow; - String aComment; + ::rtl::OUString aAuthorToShow; + ::rtl::OUString aComment; ScRangeList aRangeList; ScChgsDateMode eDateMode; sal_Bool bShowIt; @@ -108,16 +107,16 @@ public: sal_Bool HasAuthor() const {return bIsAuthor;} void SetHasAuthor(sal_Bool nFlag=sal_True) {bIsAuthor=nFlag;} - String GetTheAuthorToShow()const {return aAuthorToShow;} - void SetTheAuthorToShow(const String& aString){aAuthorToShow=aString;} + ::rtl::OUString GetTheAuthorToShow()const {return aAuthorToShow;} + void SetTheAuthorToShow(const ::rtl::OUString& aString){aAuthorToShow=aString;} sal_Bool HasComment() const {return bIsComment;} void SetHasComment(sal_Bool nFlag=sal_True) {bIsComment=nFlag;} - String GetTheComment()const {return aComment;} - void SetTheComment(const String& aString); + ::rtl::OUString GetTheComment()const {return aComment;} + void SetTheComment(const ::rtl::OUString& aString); - sal_Bool IsValidComment(const String* pCommentStr) const; + sal_Bool IsValidComment(const ::rtl::OUString* pCommentStr) const; sal_Bool IsEveryoneButMe() const {return bEveryoneButMe;} void SetEveryoneButMe(sal_Bool nFlag=sal_True) {bEveryoneButMe=nFlag;} diff --git a/sc/source/core/tool/chgviset.cxx b/sc/source/core/tool/chgviset.cxx index 061f6624ca0c..fdd1678a3498 100644 --- a/sc/source/core/tool/chgviset.cxx +++ b/sc/source/core/tool/chgviset.cxx @@ -89,21 +89,20 @@ ScChangeViewSettings& ScChangeViewSettings::operator=( const ScChangeViewSetting return *this; } -sal_Bool ScChangeViewSettings::IsValidComment(const String* pCommentStr) const +sal_Bool ScChangeViewSettings::IsValidComment(const ::rtl::OUString* pCommentStr) const { sal_Bool nTheFlag=sal_True; if(pCommentSearcher!=NULL) { - xub_StrLen nStartPos = 0; - xub_StrLen nEndPos = pCommentStr->Len(); - - nTheFlag=sal::static_int_cast<sal_Bool>(pCommentSearcher->SearchFrwrd( *pCommentStr, &nStartPos, &nEndPos)); + sal_Int32 nStartPos = 0; + sal_Int32 nEndPos = pCommentStr->getLength(); + nTheFlag=pCommentSearcher->SearchForward(*pCommentStr, &nStartPos, &nEndPos); } return nTheFlag; } -void ScChangeViewSettings::SetTheComment(const String& rString) +void ScChangeViewSettings::SetTheComment(const ::rtl::OUString& rString) { aComment=rString; if(pCommentSearcher!=NULL) @@ -112,7 +111,7 @@ void ScChangeViewSettings::SetTheComment(const String& rString) pCommentSearcher=NULL; } - if(rString.Len()>0) + if(!rString.isEmpty()) { utl::SearchParam aSearchParam( rString, utl::SearchParam::SRCH_REGEXP,false,false,false ); diff --git a/sc/source/ui/view/viewutil.cxx b/sc/source/ui/view/viewutil.cxx index 74bcb8929cd8..574d1c6d7904 100644 --- a/sc/source/ui/view/viewutil.cxx +++ b/sc/source/ui/view/viewutil.cxx @@ -179,7 +179,7 @@ sal_Bool ScViewUtil::IsActionShown( const ScChangeAction& rAction, rAction.GetDescription(aTmp, &rDocument); aBuf.append(aTmp); aBuf.append(sal_Unicode(')')); - String aComStr = aBuf.makeStringAndClear(); + rtl::OUString aComStr = aBuf.makeStringAndClear(); if(!rSettings.IsValidComment(&aComStr)) return false; |