summaryrefslogtreecommitdiff
path: root/vcl/source/window/layout.cxx
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2020-10-25 15:27:58 +0000
committerCaolán McNamara <caolanm@redhat.com>2020-10-27 17:00:59 +0100
commitb9405fbc4e19901c78d136895c5ab0437d8450ac (patch)
treef42d180c9f6b4450959ff94d6f40a2ae881d8984 /vcl/source/window/layout.cxx
parent23c30c073495201acb82e6e2e83bb0840f25acce (diff)
Resolves: tdf#137620 add DeleteSurroundingText at vcl::Window level
a) give it a default implementation based on the current one b) re-use code introduced for WeldEditView::DeleteSurroundingText for the EditView containing vcl::Window in impress/draw and various similar Annotation windows Change-Id: I55547c70e90ee394795b5545450cf8131538fad8 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/104781 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'vcl/source/window/layout.cxx')
-rw-r--r--vcl/source/window/layout.cxx20
1 files changed, 14 insertions, 6 deletions
diff --git a/vcl/source/window/layout.cxx b/vcl/source/window/layout.cxx
index 36ebf51a74ff..4c98d7a88ad5 100644
--- a/vcl/source/window/layout.cxx
+++ b/vcl/source/window/layout.cxx
@@ -2859,19 +2859,27 @@ void VclDrawingArea::StartDrag(sal_Int8, const Point&)
OUString VclDrawingArea::GetSurroundingText() const
{
+ if (!m_aGetSurroundingHdl.IsSet())
+ return Control::GetSurroundingText();
OUString sSurroundingText;
- if (m_aGetSurroundingHdl.Call(sSurroundingText) != -1)
- return sSurroundingText;
- return Control::GetSurroundingText();
+ m_aGetSurroundingHdl.Call(sSurroundingText);
+ return sSurroundingText;
}
Selection VclDrawingArea::GetSurroundingTextSelection() const
{
+ if (!m_aGetSurroundingHdl.IsSet())
+ return Control::GetSurroundingTextSelection();
OUString sSurroundingText;
int nCursor = m_aGetSurroundingHdl.Call(sSurroundingText);
- if (nCursor != -1)
- return Selection(nCursor, nCursor);
- return Control::GetSurroundingTextSelection();
+ return Selection(nCursor, nCursor);
+}
+
+bool VclDrawingArea::DeleteSurroundingText(const Selection& rSelection)
+{
+ if (!m_aDeleteSurroundingHdl.IsSet())
+ return Control::DeleteSurroundingText(rSelection);
+ return m_aDeleteSurroundingHdl.Call(rSelection);
}
VclHPaned::~VclHPaned()