diff options
author | Caolán McNamara <caolanm@redhat.com> | 2020-10-07 10:16:41 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2020-10-07 16:19:32 +0200 |
commit | ac2369cf0369da191ac970a6ed47d634a7fae0e7 (patch) | |
tree | 1bf092ca5554a7d182aef7dee44db5d0d8554dc0 /include/svx/weldeditview.hxx | |
parent | bd567a409f214d042bd64798f168fdb3dbf3cd31 (diff) |
let a subclass destroy and recreate its EditView
Change-Id: I743592b0d6d864f3d72c2fd111ef8adf13a3eb4a
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/104052
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'include/svx/weldeditview.hxx')
-rw-r--r-- | include/svx/weldeditview.hxx | 20 |
1 files changed, 16 insertions, 4 deletions
diff --git a/include/svx/weldeditview.hxx b/include/svx/weldeditview.hxx index d54f2c9404a7..00f49f6965a7 100644 --- a/include/svx/weldeditview.hxx +++ b/include/svx/weldeditview.hxx @@ -39,11 +39,23 @@ public: EditEngine& GetEditEngine() { return *m_xEditEngine; } - bool HasSelection() const { return m_xEditView->HasSelection(); } + bool HasSelection() const { return m_xEditView && m_xEditView->HasSelection(); } - void Cut() { m_xEditView->Cut(); } - void Copy() { m_xEditView->Copy(); } - void Paste() { m_xEditView->Paste(); } + void Cut() + { + if (m_xEditView) + m_xEditView->Cut(); + } + void Copy() + { + if (m_xEditView) + m_xEditView->Copy(); + } + void Paste() + { + if (m_xEditView) + m_xEditView->Paste(); + } virtual ~WeldEditView() override; |