summaryrefslogtreecommitdiff
path: root/sw
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-03-25 20:46:53 +0100
commit603e4d11a25b30b4b0c9d455420cc5f9b365a5e9 (patch)
tree5f6505407b9306b1a0ef9baff22dc25a2cc405e3 /sw
parent0d35a22cad9ab65465cd6f506c8a3873e54eaa9a (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> (cherry picked from commit 0788ab19869aa2ae5f7fbef9e3c13ceb641f80ee)
Diffstat (limited to 'sw')
-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 59436decddf1..75deb845a988 100644
--- a/sw/source/uibase/wrtsh/delete.cxx
+++ b/sw/source/uibase/wrtsh/delete.cxx
@@ -285,6 +285,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;
}
@@ -397,6 +403,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: