From fa42b0d8382d1a509ff95a79dbd18787fd5b3735 Mon Sep 17 00:00:00 2001 From: Kohei Yoshida Date: Thu, 3 Nov 2011 22:45:31 -0400 Subject: const correct ness etc & mutable only for lazy-initializing accessor. --- sc/inc/global.hxx | 6 +++--- sc/inc/queryparam.hxx | 9 +++++---- 2 files changed, 8 insertions(+), 7 deletions(-) (limited to 'sc/inc') diff --git a/sc/inc/global.hxx b/sc/inc/global.hxx index ff4814d3ae03..cc8c0fde1028 100644 --- a/sc/inc/global.hxx +++ b/sc/inc/global.hxx @@ -766,15 +766,15 @@ struct ScQueryEntry ScQueryConnect eConnect; String* pStr; double nVal; - utl::SearchParam* pSearchParam; // if RegExp, not saved - utl::TextSearch* pSearchText; // if RegExp, not saved + mutable utl::SearchParam* pSearchParam; // if RegExp, not saved + mutable utl::TextSearch* pSearchText; // if RegExp, not saved ScQueryEntry(); ScQueryEntry(const ScQueryEntry& r); ~ScQueryEntry(); // creates pSearchParam and pSearchText if necessary, always RegExp! - utl::TextSearch* GetSearchTextPtr( bool bCaseSens ); + utl::TextSearch* GetSearchTextPtr( bool bCaseSens ) const; void Clear(); ScQueryEntry& operator=( const ScQueryEntry& r ); diff --git a/sc/inc/queryparam.hxx b/sc/inc/queryparam.hxx index 915422458bcf..a083f74acb9c 100644 --- a/sc/inc/queryparam.hxx +++ b/sc/inc/queryparam.hxx @@ -51,7 +51,8 @@ struct ScQueryParamBase virtual bool IsValidFieldIndex() const; SC_DLLPUBLIC SCSIZE GetEntryCount() const; - SC_DLLPUBLIC ScQueryEntry& GetEntry(SCSIZE n) const; + SC_DLLPUBLIC const ScQueryEntry& GetEntry(SCSIZE n) const; + SC_DLLPUBLIC ScQueryEntry& GetEntry(SCSIZE n); void Resize(SCSIZE nNew); SC_DLLPUBLIC void DeleteQuery( SCSIZE nPos ); void FillInExcelSyntax(String& aCellStr, SCSIZE nIndex); @@ -60,7 +61,7 @@ protected: ScQueryParamBase(); ScQueryParamBase(const ScQueryParamBase& r); - mutable std::vector maEntries; + std::vector maEntries; }; // ============================================================================ @@ -92,8 +93,8 @@ struct SC_DLLPUBLIC ScQueryParam : public ScQueryParamBase, public ScQueryParamT ScQueryParam( const ScDBQueryParamInternal& r ); virtual ~ScQueryParam(); - ScQueryParam& operator= ( const ScQueryParam& r ); - sal_Bool operator== ( const ScQueryParam& rOther ) const; + ScQueryParam& operator= ( const ScQueryParam& r ); + bool operator== ( const ScQueryParam& rOther ) const; void Clear(); void ClearDestParams(); void MoveToDest(); -- cgit