summaryrefslogtreecommitdiff
path: root/sw/source/uibase/wrtsh
diff options
context:
space:
mode:
authorMichael Stahl <Michael.Stahl@cib.de>2020-02-05 18:31:29 +0100
committerMichael Stahl <michael.stahl@cib.de>2020-02-06 13:00:46 +0100
commit0788ab19869aa2ae5f7fbef9e3c13ceb641f80ee (patch)
tree8084ad33c834c5d46b9cde695885caad5609ef7e /sw/source/uibase/wrtsh
parentc0b7fe8281319146c4a2e36e203cfd65633ce3bd (diff)
sw: read-only/protected content dialog was missing on Delete/Backspace
If SwWrtShell::DelRight()/DelLeft() are called without an active selection, they select 1 character to the right/left, but then they don't check if the selection is read-only, so then SwEditShell::Delete() calls HasReadonlySel() and silently returns. Pop up the dialog in this case too, for consistency. Change-Id: I3d72f136f4d132de3f8a6f3cc2aab493ced95a28 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/88055 Tested-by: Jenkins Reviewed-by: Michael Stahl <michael.stahl@cib.de>
Diffstat (limited to 'sw/source/uibase/wrtsh')
-rw-r--r--sw/source/uibase/wrtsh/delete.cxx12
1 files changed, 12 insertions, 0 deletions
diff --git a/sw/source/uibase/wrtsh/delete.cxx b/sw/source/uibase/wrtsh/delete.cxx
index 177cb2344c46..631afcfa1fce 100644
--- a/sw/source/uibase/wrtsh/delete.cxx
+++ b/sw/source/uibase/wrtsh/delete.cxx
@@ -279,6 +279,12 @@ bool SwWrtShell::DelLeft()
if( !bRet && bSwap )
SwCursorShell::SwapPam();
CloseMark( bRet );
+ if (!bRet)
+ { // false indicates HasReadonlySel failed
+ std::unique_ptr<weld::Builder> xBuilder(Application::CreateBuilder(GetView().GetFrameWeld(), "modules/swriter/ui/inforeadonlydialog.ui"));
+ std::unique_ptr<weld::MessageDialog> xInfo(xBuilder->weld_message_dialog("InfoReadonlyDialog"));
+ xInfo->run();
+ }
return bRet;
}
@@ -394,6 +400,12 @@ bool SwWrtShell::DelRight()
SwCursorShell::Right(1, CRSR_SKIP_CELLS);
bRet = Delete();
CloseMark( bRet );
+ if (!bRet)
+ { // false indicates HasReadonlySel failed
+ std::unique_ptr<weld::Builder> xBuilder(Application::CreateBuilder(GetView().GetFrameWeld(), "modules/swriter/ui/inforeadonlydialog.ui"));
+ std::unique_ptr<weld::MessageDialog> xInfo(xBuilder->weld_message_dialog("InfoReadonlyDialog"));
+ xInfo->run();
+ }
break;
case SelectionType::Frame: