summaryrefslogtreecommitdiff
path: root/sc/inc/cell.hxx
diff options
context:
space:
mode:
authorKohei Yoshida <kohei.yoshida@gmail.com>2013-02-12 11:23:26 -0500
committerKohei Yoshida <kohei.yoshida@gmail.com>2013-02-12 12:33:00 -0500
commit0585322e70d3c0f1d26d6bd9c04a388a1ff55abf (patch)
treebd206df6f4f80ab4ea461137deccb6887dc72777 /sc/inc/cell.hxx
parent117b3a13b82aaac0977fd17ee5b7b63204e659f4 (diff)
Go through all ScEditCell instantiations and fix memory leaks.
Changed the signature of the constructor (one that clones the text object) to take a reference instead of a pointer, to smoke out the callers that use this constructor. Went through all its callers and made changes to either 1) pass ownership to the cell instance (if the text object uses the SfxItemPool instance returned from ScDocument::GetEditPool()), or 2) pass as const reference to make it clear that the instance will get cloned. Change-Id: I669e066d4739536bf8d3b356186503dcdfa303b0
Diffstat (limited to 'sc/inc/cell.hxx')
-rw-r--r--sc/inc/cell.hxx16
1 files changed, 14 insertions, 2 deletions
diff --git a/sc/inc/cell.hxx b/sc/inc/cell.hxx
index a66d7795fd0d..a6d1480923e2 100644
--- a/sc/inc/cell.hxx
+++ b/sc/inc/cell.hxx
@@ -244,8 +244,20 @@ public:
*/
ScEditCell(EditTextObject* pObject, ScDocument* pDocP);
- ScEditCell( const EditTextObject* pObject, ScDocument*,
- const SfxItemPool* pFromPool /* = NULL */ );
+ /**
+ * Constructor. The caller is responsible for deleting the text object
+ * instance passed on to this constructor, since it creates a clone and
+ * stores it instead of the original.
+ *
+ * @param rObject text object to clone from.
+ * @param pDocP 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 ScEditCell& rCell, ScDocument& rDoc, const ScAddress& rDestPos);
// for line breaks
ScEditCell( const rtl::OUString& rString, ScDocument* );