[Libreoffice-commits] core.git: 2 commits - officecfg/registry sfx2/source sw/inc sw/sdi sw/source sw/uiconfig
Samuel Mehrbrodt (via logerrit)
logerrit at kemper.freedesktop.org
Mon Mar 30 07:37:17 UTC 2020
officecfg/registry/data/org/openoffice/Office/UI/WriterCommands.xcu | 8 ++++
officecfg/registry/schema/org/openoffice/Office/Common.xcs | 6 +++
sfx2/source/view/viewsh.cxx | 3 +
sw/inc/cmdid.h | 2 +
sw/sdi/_viewsh.sdi | 7 +++
sw/sdi/swriter.sdi | 18 ++++++++++
sw/source/uibase/uiview/view0.cxx | 12 ++++++
sw/uiconfig/sglobal/menubar/menubar.xml | 2 -
sw/uiconfig/swriter/menubar/menubar.xml | 2 -
sw/uiconfig/swxform/menubar/menubar.xml | 2 -
10 files changed, 59 insertions(+), 3 deletions(-)
New commits:
commit 79b578b7f8b5e3a80fcd0fd86e83d96d7c900bb1
Author: Samuel Mehrbrodt <Samuel.Mehrbrodt at cib.de>
AuthorDate: Thu Mar 26 16:29:46 2020 +0100
Commit: Samuel Mehrbrodt <Samuel.Mehrbrodt at cib.de>
CommitDate: Mon Mar 30 09:36:50 2020 +0200
tdf#101652 Add config option to prevent disabling readonly mode
There are various cases where people don't want users to
be able to turn off readonly mode, so add a config option for it.
Setting this option will remove the "Edit document" button from
the readonly infobar and also disable the "Edit mode" menu entry.
Change-Id: I7988da5b181455f778a6ab148e6bf32182c72618
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/91144
Tested-by: Samuel Mehrbrodt <Samuel.Mehrbrodt at cib.de>
Reviewed-by: Samuel Mehrbrodt <Samuel.Mehrbrodt at cib.de>
diff --git a/officecfg/registry/schema/org/openoffice/Office/Common.xcs b/officecfg/registry/schema/org/openoffice/Office/Common.xcs
index f7e0329fd5a1..1307269765fb 100644
--- a/officecfg/registry/schema/org/openoffice/Office/Common.xcs
+++ b/officecfg/registry/schema/org/openoffice/Office/Common.xcs
@@ -5806,6 +5806,12 @@
<desc>Number of saved searches in the Find and Replace dialog.</desc>
</info>
</prop>
+ <prop oor:name="AllowEditReadonlyDocs" oor:type="xs:boolean" oor:nillable="false">
+ <info>
+ <desc>Allow the user to edit read-only docs (via menu or Infobar)</desc>
+ </info>
+ <value>true</value>
+ </prop>
</group>
<group oor:name="Forms">
<info>
diff --git a/sfx2/source/view/viewsh.cxx b/sfx2/source/view/viewsh.cxx
index c26d0b6352b4..62c20909102c 100644
--- a/sfx2/source/view/viewsh.cxx
+++ b/sfx2/source/view/viewsh.cxx
@@ -62,6 +62,7 @@
#include <vcl/commandinfoprovider.hxx>
#include <LibreOfficeKit/LibreOfficeKitEnums.h>
+#include <officecfg/Office/Common.hxx>
#include <officecfg/Setup.hxx>
#include <sfx2/app.hxx>
#include <sfx2/flatpak.hxx>
@@ -1783,6 +1784,8 @@ bool SfxViewShell::isEditDocLocked()
Reference<XModel> xModel = GetCurrentDocument();
if (!xModel.is())
return false;
+ if (!officecfg::Office::Common::Misc::AllowEditReadonlyDocs::get())
+ return true;
comphelper::NamedValueCollection aArgs(xModel->getArgs());
return aArgs.getOrDefault("LockEditDoc", false);
}
commit 96def0ee391a99ddf042df820db1292b83d0c4fe
Author: shameempk <mailtoshameempk at gmail.com>
AuthorDate: Wed Mar 11 12:01:28 2020 +0000
Commit: Miklos Vajna <vmiklos at collabora.com>
CommitDate: Mon Mar 30 09:36:37 2020 +0200
tdf#124686 HideWhiteSpace should be positive Show Whitespace
"Hide Whitespace" under View menu changes to "Show Whitespace". Functions and associated strings are renamed accordingly.
Change-Id: Id0c91ecf5c59a8c0cd5d00574f3ce0f38d6dd6d7
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/90324
Tested-by: Jenkins
Reviewed-by: Miklos Vajna <vmiklos at collabora.com>
diff --git a/officecfg/registry/data/org/openoffice/Office/UI/WriterCommands.xcu b/officecfg/registry/data/org/openoffice/Office/UI/WriterCommands.xcu
index 3a0839ab3c0b..9ca5e132d534 100644
--- a/officecfg/registry/data/org/openoffice/Office/UI/WriterCommands.xcu
+++ b/officecfg/registry/data/org/openoffice/Office/UI/WriterCommands.xcu
@@ -2766,6 +2766,14 @@
<value>1</value>
</prop>
</node>
+ <node oor:name=".uno:ShowWhitespace" oor:op="replace">
+ <prop oor:name="Label" oor:type="xs:string">
+ <value xml:lang="en-US">Show Whitespac~e</value>
+ </prop>
+ <prop oor:name="Properties" oor:type="xs:int">
+ <value>1</value>
+ </prop>
+ </node>
<node oor:name=".uno:SortDialog" oor:op="replace">
<prop oor:name="Label" oor:type="xs:string">
<value xml:lang="en-US">So~rt...</value>
diff --git a/sw/inc/cmdid.h b/sw/inc/cmdid.h
index b43a852d38e4..6513bf5032a8 100644
--- a/sw/inc/cmdid.h
+++ b/sw/inc/cmdid.h
@@ -184,6 +184,8 @@
#define FN_VIEW_HIDE_WHITESPACE (FN_VIEW + 59) /* Hide header, footer, and pagebreak */
#define FN_SHOW_INLINETOOLTIPS (FN_VIEW + 60) /* Show tooltips for tracked changes */
#define FN_USE_HEADERFOOTERMENU (FN_VIEW + 61) /* Show advanced header/footer menu */
+#define FN_VIEW_SHOW_WHITESPACE (FN_VIEW + 62) /* Show header, footer, and pagebreak */
+
// Region: Insert
#define FN_INSERT_BOOKMARK (FN_INSERT + 2 ) /* Bookmark */
diff --git a/sw/sdi/_viewsh.sdi b/sw/sdi/_viewsh.sdi
index ad97fe844319..acef4c75f26a 100644
--- a/sw/sdi/_viewsh.sdi
+++ b/sw/sdi/_viewsh.sdi
@@ -811,6 +811,13 @@ interface BaseTextEditView
Export = FALSE;
]
+ FN_VIEW_SHOW_WHITESPACE
+ [
+ ExecMethod = ExecViewOptions ;
+ StateMethod = StateViewOptions ;
+ Export = FALSE;
+ ]
+
SID_TOGGLE_NOTES
[
ExecMethod = ExecViewOptions ;
diff --git a/sw/sdi/swriter.sdi b/sw/sdi/swriter.sdi
index 4634ad612069..851a086492d4 100644
--- a/sw/sdi/swriter.sdi
+++ b/sw/sdi/swriter.sdi
@@ -5476,6 +5476,24 @@ SfxBoolItem HideWhitespace FN_VIEW_HIDE_WHITESPACE
GroupId = SfxGroupId::View;
]
+SfxBoolItem ShowWhitespace FN_VIEW_SHOW_WHITESPACE
+
+[
+ AutoUpdate = TRUE,
+ FastCall = FALSE,
+ ReadOnlyDoc = TRUE,
+ Toggle = TRUE,
+ Container = FALSE,
+ RecordAbsolute = FALSE,
+ RecordPerSet;
+
+
+ AccelConfig = TRUE,
+ MenuConfig = TRUE,
+ ToolBoxConfig = TRUE,
+ GroupId = SfxGroupId::View;
+]
+
SfxBoolItem ShowTrackedChanges FN_REDLINE_SHOW
[
diff --git a/sw/source/uibase/uiview/view0.cxx b/sw/source/uibase/uiview/view0.cxx
index ca7657481c30..d15c0bcc176d 100644
--- a/sw/source/uibase/uiview/view0.cxx
+++ b/sw/source/uibase/uiview/view0.cxx
@@ -292,6 +292,11 @@ void SwView::StateViewOptions(SfxItemSet &rSet)
aBool.SetValue(pOpt->IsHideWhitespaceMode());
break;
}
+ case FN_VIEW_SHOW_WHITESPACE:
+ {
+ aBool.SetValue(!pOpt->IsHideWhitespaceMode());
+ break;
+ }
case SID_GRID_VISIBLE:
aBool.SetValue( pOpt->IsGridVisible() ); break;
case SID_GRID_USE:
@@ -452,6 +457,13 @@ void SwView::ExecViewOptions(SfxRequest &rReq)
pOpt->SetHideWhitespaceMode(bFlag);
break;
+ case FN_VIEW_SHOW_WHITESPACE:
+ if ( STATE_TOGGLE == eState )
+ bFlag = pOpt->IsHideWhitespaceMode();
+
+ pOpt->SetHideWhitespaceMode(!bFlag);
+ break;
+
case FN_VIEW_SMOOTH_SCROLL:
if ( STATE_TOGGLE == eState )
diff --git a/sw/uiconfig/sglobal/menubar/menubar.xml b/sw/uiconfig/sglobal/menubar/menubar.xml
index 268b30cf68b8..50cf8f708584 100644
--- a/sw/uiconfig/sglobal/menubar/menubar.xml
+++ b/sw/uiconfig/sglobal/menubar/menubar.xml
@@ -200,7 +200,7 @@
<menu:menuitem menu:id=".uno:ViewBounds" menu:style="text"/>
<menu:menuitem menu:id=".uno:TableBoundaries" menu:style="text"/>
<menu:menuitem menu:id=".uno:ShowGraphics" menu:style="text"/>
- <menu:menuitem menu:id=".uno:HideWhitespace" menu:style="text"/>
+ <menu:menuitem menu:id=".uno:ShowWhitespace" menu:style="text"/>
<menu:menuseparator/>
<menu:menuitem menu:id=".uno:ViewTrackChanges"/>
<menu:menuitem menu:id=".uno:ShowAnnotations" menu:style="text"/>
diff --git a/sw/uiconfig/swriter/menubar/menubar.xml b/sw/uiconfig/swriter/menubar/menubar.xml
index 896d2f205a31..5c88d7159346 100644
--- a/sw/uiconfig/swriter/menubar/menubar.xml
+++ b/sw/uiconfig/swriter/menubar/menubar.xml
@@ -206,7 +206,7 @@
<menu:menuitem menu:id=".uno:ViewBounds" menu:style="text"/>
<menu:menuitem menu:id=".uno:TableBoundaries" menu:style="text"/>
<menu:menuitem menu:id=".uno:ShowGraphics"/>
- <menu:menuitem menu:id=".uno:HideWhitespace" menu:style="text"/>
+ <menu:menuitem menu:id=".uno:ShowWhitespace" menu:style="text"/>
<menu:menuseparator/>
<menu:menuitem menu:id=".uno:ViewTrackChanges"/>
<menu:menuitem menu:id=".uno:ShowAnnotations" menu:style="text"/>
diff --git a/sw/uiconfig/swxform/menubar/menubar.xml b/sw/uiconfig/swxform/menubar/menubar.xml
index c81b5be0eaa0..0bb0b5f2e7bb 100644
--- a/sw/uiconfig/swxform/menubar/menubar.xml
+++ b/sw/uiconfig/swxform/menubar/menubar.xml
@@ -199,7 +199,7 @@
<menu:menuitem menu:id=".uno:ViewBounds" menu:style="text"/>
<menu:menuitem menu:id=".uno:TableBoundaries" menu:style="text"/>
<menu:menuitem menu:id=".uno:ShowGraphics" menu:style="text"/>
- <menu:menuitem menu:id=".uno:HideWhitespace" menu:style="text"/>
+ <menu:menuitem menu:id=".uno:ShowWhitespace" menu:style="text"/>
<menu:menuseparator/>
<menu:menuitem menu:id=".uno:ViewTrackChanges"/>
<menu:menuitem menu:id=".uno:ShowAnnotations" menu:style="text"/>
More information about the Libreoffice-commits
mailing list