summaryrefslogtreecommitdiff
path: root/sc/inc/editsrc.hxx
diff options
context:
space:
mode:
authorKohei Yoshida <kohei.yoshida@gmail.com>2012-04-25 15:08:36 -0400
committerKohei Yoshida <kohei.yoshida@gmail.com>2012-04-26 09:58:04 -0400
commitf0561d3f3d28506a1351cebdd1bbe8d80b67892f (patch)
treeb73b0433e04c11b3d8820dcb37c5b38860b29e2e /sc/inc/editsrc.hxx
parent98831752bab7827f1d4d6d121daa1d0a0de805ee (diff)
Define interfance to get edit engine instance without ugly casting.
Diffstat (limited to 'sc/inc/editsrc.hxx')
-rw-r--r--sc/inc/editsrc.hxx20
1 files changed, 14 insertions, 6 deletions
diff --git a/sc/inc/editsrc.hxx b/sc/inc/editsrc.hxx
index 64c5871b32fb..d3258434244f 100644
--- a/sc/inc/editsrc.hxx
+++ b/sc/inc/editsrc.hxx
@@ -44,11 +44,19 @@ class ScHeaderFooterTextData;
class ScAccessibleTextData;
class SdrObject;
+class ScEditSource : public SvxEditSource
+{
+public:
+ virtual ScEditEngineDefaulter* GetEditEngine() = 0;
+};
+
/**
- * ScHeaderFooterEditSource with local copy of ScHeaderFooterTextData is
- * used by field objects.
+ * ScHeaderFooterTextObj keeps the authoritative copy of
+ * ScHeaderFooterTextData that this class holds reference to. It's a
+ * reference instead of a copy to avoid broadcasting changes to the
+ * authoritative copy.
*/
-class ScHeaderFooterEditSource : public SvxEditSource
+class ScHeaderFooterEditSource : public ScEditSource
{
private:
ScHeaderFooterTextData& mrTextData;
@@ -58,7 +66,7 @@ public:
virtual ~ScHeaderFooterEditSource();
// GetEditEngine is needed because the forwarder doesn't have field functions
- ScEditEngineDefaulter* GetEditEngine();
+ virtual ScEditEngineDefaulter* GetEditEngine();
virtual SvxEditSource* Clone() const;
virtual SvxTextForwarder* GetTextForwarder();
@@ -72,7 +80,7 @@ public:
* ScCellEditSource with local copy of ScCellTextData is used by
* ScCellFieldsObj, ScCellFieldObj.
*/
-class ScCellEditSource : public SvxEditSource
+class ScCellEditSource : public ScEditSource
{
private:
ScCellTextData* pCellTextData;
@@ -82,7 +90,7 @@ public:
virtual ~ScCellEditSource();
// GetEditEngine is needed because the forwarder doesn't have field functions
- ScEditEngineDefaulter* GetEditEngine();
+ virtual ScEditEngineDefaulter* GetEditEngine();
virtual SvxEditSource* Clone() const;
virtual SvxTextForwarder* GetTextForwarder();