diff options
author | Kohei Yoshida <kohei.yoshida@gmail.com> | 2013-03-26 15:04:25 -0400 |
---|---|---|
committer | Kohei Yoshida <kohei.yoshida@gmail.com> | 2013-03-26 15:36:02 -0400 |
commit | 5f5d2cb6d1363bd133053a7c035b6e0163ee4edc (patch) | |
tree | 228d251e1f9f258acdb1b402a57528e4d295e158 /sc/inc | |
parent | 7c2dd80cbee59aadee20b59aacdf0ba437c765db (diff) |
Make the conditional formatting code free of ScBaseCell.
Change-Id: I93f83a840874c973cdc0821ddeb1913be7f09767
Diffstat (limited to 'sc/inc')
-rw-r--r-- | sc/inc/cellvalue.hxx | 5 | ||||
-rw-r--r-- | sc/inc/conditio.hxx | 9 | ||||
-rw-r--r-- | sc/inc/validat.hxx | 15 |
3 files changed, 14 insertions, 15 deletions
diff --git a/sc/inc/cellvalue.hxx b/sc/inc/cellvalue.hxx index 7998898fd3ef..84127cd959a6 100644 --- a/sc/inc/cellvalue.hxx +++ b/sc/inc/cellvalue.hxx @@ -80,9 +80,10 @@ struct SC_DLLPUBLIC ScCellValue }; /** - * This is very similar to ScCellValue, except that it points to the + * This is very similar to ScCellValue, except that it references the * original value instead of copying it. As such, don't hold an instance of - * this class any longer than necessary. + * this class any longer than necessary, and absolutely not after the + * original cell has been destroyed. */ struct SC_DLLPUBLIC ScRefCellValue { diff --git a/sc/inc/conditio.hxx b/sc/inc/conditio.hxx index d5a55e3fd29a..8592bcb9a7e1 100644 --- a/sc/inc/conditio.hxx +++ b/sc/inc/conditio.hxx @@ -35,10 +35,9 @@ #include <boost/ptr_container/ptr_vector.hpp> #include <boost/scoped_ptr.hpp> -class ScBaseCell; class ScFormulaCell; class ScTokenArray; - +class ScRefCellValue; // nOptions Flags #define SC_COND_NOBLANKS 1 @@ -196,7 +195,7 @@ public: virtual void SetParent( ScConditionalFormat* pNew ) { pCondFormat = pNew; } - bool IsCellValid( ScBaseCell* pCell, const ScAddress& rPos ) const; + bool IsCellValid( ScRefCellValue& rCell, const ScAddress& rPos ) const; ScConditionMode GetOperation() const { return eOp; } bool IsIgnoreBlank() const { return ( nOptions & SC_COND_NOBLANKS ) == 0; } @@ -406,9 +405,9 @@ public: const ScFormatEntry* GetEntry( sal_uInt16 nPos ) const; - const rtl::OUString& GetCellStyle( ScBaseCell* pCell, const ScAddress& rPos ) const; + const OUString& GetCellStyle( ScRefCellValue& rCell, const ScAddress& rPos ) const; - ScCondFormatData GetData( ScBaseCell* pCell, const ScAddress& rPos ) const; + ScCondFormatData GetData( ScRefCellValue& rCell, const ScAddress& rPos ) const; bool EqualEntries( const ScConditionalFormat& r ) const; diff --git a/sc/inc/validat.hxx b/sc/inc/validat.hxx index 8c73b7d095e1..85737a3a989f 100644 --- a/sc/inc/validat.hxx +++ b/sc/inc/validat.hxx @@ -125,12 +125,11 @@ public: @return true = rStrings has been filled with at least one entry. */ bool FillSelectionList(std::vector<ScTypedStrData>& rStrings, const ScAddress& rPos) const; - // with string: during input, with cell: for detective / RC_FORCED - sal_Bool IsDataValid( const String& rTest, const ScPatternAttr& rPattern, - const ScAddress& rPos ) const; - sal_Bool IsDataValid( ScBaseCell* pCell, const ScAddress& rPos ) const; + // with string: during input, with cell: for detective / RC_FORCED + bool IsDataValid( + const OUString& rTest, const ScPatternAttr& rPattern, const ScAddress& rPos ) const; - bool IsDataValid( ScCellIterator& rIter ) const; + bool IsDataValid( ScRefCellValue& rCell, const ScAddress& rPos ) const; // TRUE -> break sal_Bool DoError( Window* pParent, const String& rInput, const ScAddress& rPos ) const; @@ -160,14 +159,14 @@ private: @param rMatch (out-param) the index of the first item that matched, -1 if nothing matched. @return true = Cell range found, rRange is valid, or an error entry stuffed into the list if pCell==NULL. */ bool GetSelectionFromFormula( - std::vector<ScTypedStrData>* pStrings, ScBaseCell* pCell, const ScAddress& rPos, + std::vector<ScTypedStrData>* pStrings, ScRefCellValue& rCell, const ScAddress& rPos, const ScTokenArray& rTokArr, int& rMatch) const; /** Tests, if pCell is equal to what the passed token array represents. */ - bool IsEqualToTokenArray( ScBaseCell* pCell, const ScAddress& rPos, const ScTokenArray& rTokArr ) const; + bool IsEqualToTokenArray( ScRefCellValue& rCell, const ScAddress& rPos, const ScTokenArray& rTokArr ) const; /** Tests, if contents of pCell occur in cell range referenced by own formula, or in a string list. */ - bool IsListValid( ScBaseCell* pCell, const ScAddress& rPos ) const; + bool IsListValid( ScRefCellValue& rCell, const ScAddress& rPos ) const; }; // |