summaryrefslogtreecommitdiff
path: root/sc/source/ui/app/inputhdl.cxx
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2020-10-30 16:06:39 +0000
committerCaolán McNamara <caolanm@redhat.com>2020-10-30 20:43:54 +0100
commitc946abb704c9f72c1fdc696ac72c6a9381d95f16 (patch)
tree650ab180f9692667cbbfd3815ebe7967057900d4 /sc/source/ui/app/inputhdl.cxx
parenta499b4eb2ac1bd557dfcd1b00d1bf5916572e6d6 (diff)
tdf#137620 add explicit SurroundingText support to ScGridWindow
Change-Id: I51cf18d635c7a32e88c4afd4c59756ef93fc9c4d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/105076 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'sc/source/ui/app/inputhdl.cxx')
-rw-r--r--sc/source/ui/app/inputhdl.cxx48
1 files changed, 48 insertions, 0 deletions
diff --git a/sc/source/ui/app/inputhdl.cxx b/sc/source/ui/app/inputhdl.cxx
index 075e012f00a5..fef75313ca04 100644
--- a/sc/source/ui/app/inputhdl.cxx
+++ b/sc/source/ui/app/inputhdl.cxx
@@ -3831,6 +3831,54 @@ bool ScInputHandler::KeyInput( const KeyEvent& rKEvt, bool bStartEdit /* = false
return bUsed;
}
+OUString ScInputHandler::GetSurroundingText()
+{
+ if (eMode != SC_INPUT_NONE)
+ {
+ UpdateActiveView();
+ if (pTableView || pTopView)
+ {
+ if (pTableView)
+ return pTableView->GetSurroundingText();
+ else if (pTopView) // call only once
+ return pTopView->GetSurroundingText();
+ }
+ }
+ return OUString();
+}
+
+Selection ScInputHandler::GetSurroundingTextSelection()
+{
+ if (eMode != SC_INPUT_NONE)
+ {
+ UpdateActiveView();
+ if (pTableView || pTopView)
+ {
+ if (pTableView)
+ return pTableView->GetSurroundingTextSelection();
+ else if (pTopView) // call only once
+ return pTopView->GetSurroundingTextSelection();
+ }
+ }
+ return Selection(0, 0);
+}
+
+bool ScInputHandler::DeleteSurroundingText(const Selection& rSelection)
+{
+ if (eMode != SC_INPUT_NONE)
+ {
+ UpdateActiveView();
+ if (pTableView || pTopView)
+ {
+ if (pTableView)
+ return pTableView->DeleteSurroundingText(rSelection);
+ else if (pTopView) // call only once
+ return pTopView->DeleteSurroundingText(rSelection);
+ }
+ }
+ return false;
+}
+
void ScInputHandler::InputCommand( const CommandEvent& rCEvt )
{
if ( rCEvt.GetCommand() == CommandEventId::CursorPos )