diff options
author | Kohei Yoshida <kohei.yoshida@gmail.com> | 2013-02-12 12:25:01 -0500 |
---|---|---|
committer | Kohei Yoshida <kohei.yoshida@gmail.com> | 2013-02-12 12:33:00 -0500 |
commit | f1eba4c718934e50af478fc3018d404de8d2e780 (patch) | |
tree | 4f3fe8ce285591d418cefbbd34456c67329e67f2 | |
parent | 1ed3387aad80b740b90b28eab2c60816b89e2222 (diff) |
Add prefix 'm' for ScEditCell's data members.
Since I'm modifying the header....
Change-Id: I7cb44335a46dbc185e1a717304c221e5bb6fcb3c
-rw-r--r-- | sc/inc/cell.hxx | 20 | ||||
-rw-r--r-- | sc/source/core/data/cell2.cxx | 75 |
2 files changed, 48 insertions, 47 deletions
diff --git a/sc/inc/cell.hxx b/sc/inc/cell.hxx index 7d0b798fc9df..c84e985f547c 100644 --- a/sc/inc/cell.hxx +++ b/sc/inc/cell.hxx @@ -215,10 +215,9 @@ private: class SC_DLLPUBLIC ScEditCell : public ScBaseCell { -private: - EditTextObject* pData; - mutable rtl::OUString* pString; // for faster access to formulas - ScDocument* pDoc; // for EditEngine access with Pool + EditTextObject* mpData; + mutable OUString* mpString; // for faster access to formulas + ScDocument* mpDoc; // for EditEngine access with Pool void SetTextObject( const EditTextObject* pObject, const SfxItemPool* pFromPool ); @@ -242,7 +241,7 @@ public: * instance returned from ScDocument::GetEditPool()</i>. This is * important.</p> */ - ScEditCell(EditTextObject* pObject, ScDocument* pDocP); + ScEditCell(EditTextObject* pObject, ScDocument* pDoc); /** * Constructor. The caller is responsible for deleting the text object @@ -250,17 +249,18 @@ public: * stores it instead of the original. * * @param rObject text object to clone from. - * @param pDocP pointer to the document instance. + * @param pDoc pointer to the document instance. * @param pFromPool pointer to SfxItemPool instance that the new text * object that is to be stored in the cell instance * should use. If it's NULL, it uses the default pool * for edit cells from the document instance (one * returned from GetEditPool()). */ - ScEditCell(const EditTextObject& rObject, ScDocument* pDocP, const SfxItemPool* pFromPool); + ScEditCell(const EditTextObject& rObject, ScDocument* pDoc, const SfxItemPool* pFromPool); ScEditCell(const ScEditCell& rCell, ScDocument& rDoc, const ScAddress& rDestPos); - // for line breaks - ScEditCell( const rtl::OUString& rString, ScDocument* ); + + // for line breaks + ScEditCell(const OUString& rString, ScDocument* pDoc); /** * Remove the text data as well as string cache. @@ -288,7 +288,7 @@ public: */ void SetData(EditTextObject* pObject); - rtl::OUString GetString() const; + OUString GetString() const; const EditTextObject* GetData() const; diff --git a/sc/source/core/data/cell2.cxx b/sc/source/core/data/cell2.cxx index 58a7595eedf0..ac0f73dcf62c 100644 --- a/sc/source/core/data/cell2.cxx +++ b/sc/source/core/data/cell2.cxx @@ -52,44 +52,45 @@ IMPL_FIXEDMEMPOOL_NEWDEL( ScEditCell ) // ============================================================================ -ScEditCell::ScEditCell(EditTextObject* pObject, ScDocument* pDocP) : +ScEditCell::ScEditCell(EditTextObject* pObject, ScDocument* pDoc) : ScBaseCell(CELLTYPE_EDIT), - pData(pObject), pString(NULL), pDoc(pDocP) {} + mpData(pObject), mpString(NULL), mpDoc(pDoc) {} ScEditCell::ScEditCell( - const EditTextObject& rObject, ScDocument* pDocP, const SfxItemPool* pFromPool) : + const EditTextObject& rObject, ScDocument* pDoc, const SfxItemPool* pFromPool) : ScBaseCell(CELLTYPE_EDIT), - pString(NULL), - pDoc(pDocP) + mpString(NULL), + mpDoc(pDoc) { SetTextObject(&rObject, pFromPool); } ScEditCell::ScEditCell(const ScEditCell& rCell, ScDocument& rDoc, const ScAddress& rDestPos) : - ScBaseCell(rCell), pString(NULL), pDoc(&rDoc) + ScBaseCell(rCell), mpString(NULL), mpDoc(&rDoc) { - SetTextObject( rCell.pData, rCell.pDoc->GetEditPool() ); + SetTextObject( rCell.mpData, rCell.mpDoc->GetEditPool() ); UpdateFields(rDestPos.Tab()); } -ScEditCell::ScEditCell( const rtl::OUString& rString, ScDocument* pDocP ) : - ScBaseCell( CELLTYPE_EDIT ), - pString( NULL ), - pDoc( pDocP ) +ScEditCell::ScEditCell(const OUString& rString, ScDocument* pDoc) : + ScBaseCell(CELLTYPE_EDIT), + mpData(NULL), + mpString(NULL), + mpDoc(pDoc) { OSL_ENSURE( rString.indexOf('\n') != -1 || rString.indexOf(CHAR_CR) != -1, "EditCell mit einfachem Text !?!?" ); - EditEngine& rEngine = pDoc->GetEditEngine(); + EditEngine& rEngine = mpDoc->GetEditEngine(); rEngine.SetText( rString ); - pData = rEngine.CreateTextObject(); + mpData = rEngine.CreateTextObject(); } ScEditCell::~ScEditCell() { - delete pData; - delete pString; + delete mpData; + delete mpString; #if OSL_DEBUG_LEVEL > 0 eCellType = CELLTYPE_DESTROYED; @@ -98,10 +99,10 @@ ScEditCell::~ScEditCell() void ScEditCell::ClearData() { - delete pString; - pString = NULL; - delete pData; - pData = NULL; + delete mpString; + mpString = NULL; + delete mpData; + mpData = NULL; } void ScEditCell::SetData(const EditTextObject& rObject, const SfxItemPool* pFromPool) @@ -113,32 +114,32 @@ void ScEditCell::SetData(const EditTextObject& rObject, const SfxItemPool* pFrom void ScEditCell::SetData(EditTextObject* pObject) { ClearData(); - pData = pObject; + mpData = pObject; } -rtl::OUString ScEditCell::GetString() const +OUString ScEditCell::GetString() const { - if ( pString ) - return *pString; + if (mpString) + return *mpString; - if ( pData ) + if (mpData) { // Also Text from URL fields, Doc-Engine is a ScFieldEditEngine - EditEngine& rEngine = pDoc->GetEditEngine(); - rEngine.SetText( *pData ); + EditEngine& rEngine = mpDoc->GetEditEngine(); + rEngine.SetText(*mpData); rtl::OUString sRet = ScEditUtil::GetMultilineString(rEngine); // string with line separators between paragraphs // cache short strings for formulas if ( sRet.getLength() < 256 ) - pString = new rtl::OUString(sRet); //! non-const + mpString = new rtl::OUString(sRet); //! non-const return sRet; } - return rtl::OUString(); + return OUString(); } const EditTextObject* ScEditCell::GetData() const { - return pData; + return mpData; } void ScEditCell::RemoveCharAttribs( const ScPatternAttr& rAttr ) @@ -159,13 +160,13 @@ void ScEditCell::RemoveCharAttribs( const ScPatternAttr& rAttr ) for (sal_uInt16 i = 0; i < nMapCount; ++i) { if ( rSet.GetItemState(AttrTypeMap[i].nAttrType, false, &pItem) == SFX_ITEM_SET ) - pData->RemoveCharAttribs(AttrTypeMap[i].nCharType); + mpData->RemoveCharAttribs(AttrTypeMap[i].nCharType); } } void ScEditCell::UpdateFields(SCTAB nTab) { - editeng::FieldUpdater aUpdater = pData->GetFieldUpdater(); + editeng::FieldUpdater aUpdater = mpData->GetFieldUpdater(); aUpdater.updateTableFields(nTab); } @@ -174,13 +175,13 @@ void ScEditCell::SetTextObject( const EditTextObject* pObject, { if ( pObject ) { - if ( pFromPool && pDoc->GetEditPool() == pFromPool ) - pData = pObject->Clone(); + if ( pFromPool && mpDoc->GetEditPool() == pFromPool ) + mpData = pObject->Clone(); else { //! another "spool" // Sadly there is no other way to change the Pool than to // "spool" the Object through a corresponding Engine - EditEngine& rEngine = pDoc->GetEditEngine(); + EditEngine& rEngine = mpDoc->GetEditEngine(); if ( pObject->HasOnlineSpellErrors() ) { sal_uLong nControl = rEngine.GetControlWord(); @@ -189,19 +190,19 @@ void ScEditCell::SetTextObject( const EditTextObject* pObject, if ( bNewControl ) rEngine.SetControlWord( nControl | nSpellControl ); rEngine.SetText( *pObject ); - pData = rEngine.CreateTextObject(); + mpData = rEngine.CreateTextObject(); if ( bNewControl ) rEngine.SetControlWord( nControl ); } else { rEngine.SetText( *pObject ); - pData = rEngine.CreateTextObject(); + mpData = rEngine.CreateTextObject(); } } } else - pData = NULL; + mpData = NULL; } ScEditDataArray::ScEditDataArray() |