summaryrefslogtreecommitdiff
path: root/sw/source/core/crsr/crsrsh.cxx
diff options
context:
space:
mode:
authorJim Raykowski <raykowj@gmail.com>2023-02-07 23:17:17 -0900
committerJim Raykowski <raykowj@gmail.com>2023-02-10 17:07:50 +0000
commit5bc7cb77df839f7dd3cc7d444490aaf50ebccdc6 (patch)
treec8a580e36b60296121c348ff06f535bb4be4be63 /sw/source/core/crsr/crsrsh.cxx
parent208a4ecafafa97ea7fcc5a135fa8160e91ea0a74 (diff)
tdf#153205 related: Fix selection problems caused by cursor shell
push pop during insert state update This patch renames the SelectHiddenRange function to IsInHiddenRange and modifies it to take a bool argument that when true selects the hidden range if the current cursor position is in a hidden range. When the argument is false, the hidden range is not selected if the current cursor position is in a hidden range. This makes using cursor push pop unnecessary when all that is wanted to know is if the current cursor position is in a hidden range. Change-Id: I622dfaf8e73c5b432bb74a48d36433ff755542b2 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/146725 Tested-by: Jenkins Reviewed-by: Justin Luth <jluth@mail.com> Reviewed-by: Jim Raykowski <raykowj@gmail.com>
Diffstat (limited to 'sw/source/core/crsr/crsrsh.cxx')
-rw-r--r--sw/source/core/crsr/crsrsh.cxx15
1 files changed, 9 insertions, 6 deletions
diff --git a/sw/source/core/crsr/crsrsh.cxx b/sw/source/core/crsr/crsrsh.cxx
index bc78d12cb594..6aef2801b0b7 100644
--- a/sw/source/core/crsr/crsrsh.cxx
+++ b/sw/source/core/crsr/crsrsh.cxx
@@ -3453,9 +3453,9 @@ bool SwCursorShell::IsInRightToLeftText() const
return SvxFrameDirection::Vertical_LR_TB == nDir || SvxFrameDirection::Horizontal_RL_TB == nDir;
}
-/// If the current cursor position is inside a hidden range, the hidden range
-/// is selected.
-bool SwCursorShell::SelectHiddenRange()
+/// If the current cursor position is inside a hidden range true is returned. If bSelect is
+/// true, the hidden range is selected. If bSelect is false, the hidden range is not selected.
+bool SwCursorShell::IsInHiddenRange(const bool bSelect)
{
bool bRet = false;
if ( !GetViewOptions()->IsShowHiddenChar() && !m_pCurrentCursor->HasMark() )
@@ -3472,9 +3472,12 @@ bool SwCursorShell::SelectHiddenRange()
SwScriptInfo::GetBoundsOfHiddenRange( *pNode, nPos, nHiddenStart, nHiddenEnd );
if ( COMPLETE_STRING != nHiddenStart )
{
- // make selection:
- m_pCurrentCursor->SetMark();
- m_pCurrentCursor->GetMark()->SetContent(nHiddenEnd);
+ if (bSelect)
+ {
+ // make selection:
+ m_pCurrentCursor->SetMark();
+ m_pCurrentCursor->GetMark()->SetContent(nHiddenEnd);
+ }
bRet = true;
}
}