[Libreoffice-commits] core.git: sw/source
Libreoffice Gerrit user
logerrit at kemper.freedesktop.org
Thu Dec 20 19:46:37 UTC 2018
sw/source/uibase/shells/textsh1.cxx | 9 +++++++++
1 file changed, 9 insertions(+)
New commits:
commit daf63683ff7eec73df2ce061720f464c36e08ecb
Author: Mike Kaganski <mike.kaganski at collabora.com>
AuthorDate: Thu Dec 20 15:13:45 2018 +0300
Commit: Mike Kaganski <mike.kaganski at collabora.com>
CommitDate: Thu Dec 20 20:46:09 2018 +0100
tdf#122217: Don't allow to change readonly content with Alt+X
Change-Id: Ic350503e67f27bd59ccca3876a1f3b566bb187e4
Reviewed-on: https://gerrit.libreoffice.org/65490
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski at collabora.com>
diff --git a/sw/source/uibase/shells/textsh1.cxx b/sw/source/uibase/shells/textsh1.cxx
index 8fa74feee88e..8eb590a9b5a2 100644
--- a/sw/source/uibase/shells/textsh1.cxx
+++ b/sw/source/uibase/shells/textsh1.cxx
@@ -369,6 +369,15 @@ void SwTextShell::Execute(SfxRequest &rReq)
OUString sReplacement = aToggle.ReplacementString();
if( !sReplacement.isEmpty() )
{
+ if (rWrtSh.HasReadonlySel() && !rWrtSh.CursorInsideInputField())
+ {
+ // Only break if there's something to do; don't nag with the dialog otherwise
+ auto xInfo(o3tl::make_unique<weld::GenericDialogController>(
+ rWrtSh.GetView().GetFrameWeld(), "modules/swriter/ui/inforeadonlydialog.ui",
+ "InfoReadonlyDialog"));
+ xInfo->run();
+ break;
+ }
SwRewriter aRewriter;
aRewriter.AddRule( UndoArg1, aToggle.StringToReplace() );
aRewriter.AddRule( UndoArg2, SwResId(STR_YIELDS) );
More information about the Libreoffice-commits
mailing list