summaryrefslogtreecommitdiffstats
path: root/include/svtools/editbrowsebox.hxx
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2020-06-27 21:28:04 +0100
committerCaolán McNamara <caolanm@redhat.com>2020-06-28 21:38:55 +0200
commit8fe03ea93213bbb19b6ee9862a3966144f0df5cb (patch)
treef0bbdf1af6e3af9e819fdb0503e70e09be0c4a5f /include/svtools/editbrowsebox.hxx
parenttdf#44076: sc: Add unittest (diff)
downloadcore-8fe03ea93213bbb19b6ee9862a3966144f0df5cb.tar.gz
core-8fe03ea93213bbb19b6ee9862a3966144f0df5cb.zip
decouple IEditImplementation from Edit more
Change-Id: Ie01373ca40d519c179485bd1a4b6616d5929fa5d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/97328 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'include/svtools/editbrowsebox.hxx')
-rw-r--r--include/svtools/editbrowsebox.hxx23
1 files changed, 17 insertions, 6 deletions
diff --git a/include/svtools/editbrowsebox.hxx b/include/svtools/editbrowsebox.hxx
index 2e9c7cb891cb..ac84f078b6b1 100644
--- a/include/svtools/editbrowsebox.hxx
+++ b/include/svtools/editbrowsebox.hxx
@@ -143,7 +143,7 @@ namespace svt
virtual void SetModified() = 0;
virtual bool IsModified() const = 0;
virtual void ClearModified() = 0;
- virtual void SetModifyHdl( const Link<Edit&,void>& _rLink ) = 0;
+ virtual void SetModifyHdl( const Link<LinkParamNone*,void>& _rLink ) = 0;
};
@@ -153,6 +153,8 @@ namespace svt
class GenericEditImplementation : public IEditImplementation
{
EDIT& m_rEdit;
+ protected:
+ Link<LinkParamNone*,void> m_aModifyHdl;
public:
GenericEditImplementation( EDIT& _rEdit );
@@ -178,7 +180,7 @@ namespace svt
virtual void SetModified() override;
virtual bool IsModified() const override;
virtual void ClearModified() override;
- virtual void SetModifyHdl( const Link<Edit&,void>& _rLink ) override;
+ virtual void SetModifyHdl( const Link<LinkParamNone*,void>& _rLink ) override;
};
#include <svtools/editimplementation.hxx>
@@ -209,23 +211,32 @@ namespace svt
//= concrete edit implementations
- typedef GenericEditImplementation< Edit > EditImplementation;
+ typedef GenericEditImplementation< Edit > EditImplementation_Base;
+ class UNLESS_MERGELIBS(SVT_DLLPUBLIC) EditImplementation final : public EditImplementation_Base
+ {
+ DECL_LINK(ModifyHdl, Edit&, void);
+ public:
+ EditImplementation( Edit& _rEdit ) : EditImplementation_Base( _rEdit )
+ {
+ _rEdit.SetModifyHdl(LINK(this, EditImplementation, ModifyHdl));
+ }
+ };
typedef GenericEditImplementation< MultiLineTextCell > MultiLineEditImplementation_Base;
class UNLESS_MERGELIBS(SVT_DLLPUBLIC) MultiLineEditImplementation final : public MultiLineEditImplementation_Base
{
+ DECL_LINK(ModifyHdl, Edit&, void);
public:
MultiLineEditImplementation( MultiLineTextCell& _rEdit ) : MultiLineEditImplementation_Base( _rEdit )
{
+ _rEdit.SetModifyHdl(LINK(this, MultiLineEditImplementation, ModifyHdl));
}
virtual OUString GetText( LineEnd aSeparator ) const override;
virtual OUString GetSelected( LineEnd aSeparator ) const override;
};
-
//= EditCellController
-
class SVT_DLLPUBLIC EditCellController : public CellController
{
IEditImplementation* m_pEditImplementation;
@@ -246,7 +257,7 @@ namespace svt
protected:
virtual bool MoveAllowed(const KeyEvent& rEvt) const override;
private:
- DECL_LINK(ModifyHdl, Edit&, void);
+ DECL_LINK(ModifyHdl, LinkParamNone*, void);
};