[Libreoffice-commits] core.git: officecfg/registry sw/inc sw/sdi sw/source sw/uiconfig
Gulsah Kose
gulsah.1004 at gmail.com
Sun Feb 5 16:49:25 UTC 2017
officecfg/registry/data/org/openoffice/Office/UI/WriterCommands.xcu | 5 ++
sw/inc/cmdid.h | 5 +-
sw/inc/crsrsh.hxx | 2 +
sw/sdi/_textsh.sdi | 5 ++
sw/sdi/swriter.sdi | 18 ++++++++++
sw/source/core/crsr/crsrsh.cxx | 6 +++
sw/source/uibase/shells/textsh1.cxx | 6 +++
sw/uiconfig/swriter/popupmenu/text.xml | 1
8 files changed, 46 insertions(+), 2 deletions(-)
New commits:
commit 0b819a1f0704b82b16007ba707e49ad4082311df
Author: Gulsah Kose <gulsah.1004 at gmail.com>
Date: Mon Jan 23 16:44:54 2017 +0300
tdf#103258 Add contextual edit footnote endnote command.
Change-Id: I68126d2ec8b8dfb12c45ce577d110be2b94a4e33
Signed-off-by: Gulsah Kose <gulsah.1004 at gmail.com>
Reviewed-on: https://gerrit.libreoffice.org/33803
Tested-by: Jenkins <ci at libreoffice.org>
Tested-by: Maxim Monastirsky <momonasmon at gmail.com>
Reviewed-by: Maxim Monastirsky <momonasmon at gmail.com>
diff --git a/officecfg/registry/data/org/openoffice/Office/UI/WriterCommands.xcu b/officecfg/registry/data/org/openoffice/Office/UI/WriterCommands.xcu
index b0b6eaf8..e38f165 100644
--- a/officecfg/registry/data/org/openoffice/Office/UI/WriterCommands.xcu
+++ b/officecfg/registry/data/org/openoffice/Office/UI/WriterCommands.xcu
@@ -1162,6 +1162,11 @@
<value xml:lang="en-US">~Footnotes and Endnotes...</value>
</prop>
</node>
+ <node oor:name=".uno:CurrentFootnoteDialog" oor:op="replace">
+ <prop oor:name="Label" oor:type="xs:string">
+ <value xml:lang="en-US">~Footnotes and Endnotes...</value>
+ </prop>
+ </node>
<node oor:name=".uno:ResetAttributes" oor:op="replace">
<prop oor:name="Label" oor:type="xs:string">
<value xml:lang="en-US">Clear</value>
diff --git a/sw/inc/cmdid.h b/sw/inc/cmdid.h
index 6a5631d..703a1cf 100644
--- a/sw/inc/cmdid.h
+++ b/sw/inc/cmdid.h
@@ -297,8 +297,9 @@
#define FN_FORMAT_GRAFIC_DLG (FN_FORMAT + 58) /* graphic */
#define FN_FORMAT_TABLE_DLG (FN_FORMAT + 60) /* table */
-#define FN_UPDATE_STYLE_BY_EXAMPLE (FN_FORMAT + 63) /* update style */
-#define FN_FORMAT_FOOTNOTE_DLG (FN_FORMAT + 68) /* footnote dialog */
+#define FN_UPDATE_STYLE_BY_EXAMPLE (FN_FORMAT + 63) /* update style */
+#define FN_FORMAT_FOOTNOTE_DLG (FN_FORMAT + 68) /* footnote dialog */
+#define FN_FORMAT_CURRENT_FOOTNOTE_DLG (FN_FORMAT + 64) /* Contextual footnote dialog */
#define FN_FRAME_NOWRAP (FN_FORMAT + 72)
#define FN_FRAME_WRAP (FN_FORMAT + 73)
diff --git a/sw/inc/crsrsh.hxx b/sw/inc/crsrsh.hxx
index 10e13a1..6671885 100644
--- a/sw/inc/crsrsh.hxx
+++ b/sw/inc/crsrsh.hxx
@@ -565,6 +565,8 @@ public:
// Check of SPoint or Mark of current cursor are placed within a table.
inline const SwTableNode* IsCursorInTable() const;
+ bool IsCursorInFootnote() const;
+
inline Point& GetCursorDocPos() const;
inline bool IsCursorPtAtEnd() const;
diff --git a/sw/sdi/_textsh.sdi b/sw/sdi/_textsh.sdi
index eec76a3..f365fc09 100644
--- a/sw/sdi/_textsh.sdi
+++ b/sw/sdi/_textsh.sdi
@@ -768,6 +768,11 @@ interface BaseText
[
ExecMethod = Execute ;
]
+ FN_FORMAT_CURRENT_FOOTNOTE_DLG // status()
+ [
+ ExecMethod = Execute ;
+ StateMethod = GetState ;
+ ]
FN_FOOTNOTE_TO_ANCHOR // status(final|play)
[
ExecMethod = ExecMoveMisc ;
diff --git a/sw/sdi/swriter.sdi b/sw/sdi/swriter.sdi
index fb1884b..a835734 100644
--- a/sw/sdi/swriter.sdi
+++ b/sw/sdi/swriter.sdi
@@ -1321,6 +1321,24 @@ SfxVoidItem FootnoteDialog FN_FORMAT_FOOTNOTE_DLG
GroupId = GID_FORMAT;
]
+SfxVoidItem CurrentFootnoteDialog FN_FORMAT_CURRENT_FOOTNOTE_DLG
+()
+[
+ AutoUpdate = FALSE,
+ FastCall = FALSE,
+ ReadOnlyDoc = FALSE,
+ Toggle = FALSE,
+ Container = FALSE,
+ RecordAbsolute = FALSE,
+ RecordPerSet;
+ Asynchron;
+
+ AccelConfig = TRUE,
+ MenuConfig = TRUE,
+ ToolBoxConfig = TRUE,
+ GroupId = GID_FORMAT;
+]
+
SfxVoidItem EditFootnote FN_EDIT_FOOTNOTE
()
[
diff --git a/sw/source/core/crsr/crsrsh.cxx b/sw/source/core/crsr/crsrsh.cxx
index 5d2b999..9084a27 100644
--- a/sw/source/core/crsr/crsrsh.cxx
+++ b/sw/source/core/crsr/crsrsh.cxx
@@ -1074,6 +1074,12 @@ bool SwCursorShell::IsEndOfTable() const
return (lastNode == m_pCurrentCursor->GetPoint()->nNode);
}
+bool SwCursorShell::IsCursorInFootnote() const
+{
+ SwStartNodeType aStartNodeType = m_pCurrentCursor->GetNode().StartOfSectionNode()->GetStartNodeType();
+ return aStartNodeType == SwStartNodeType::SwFootnoteStartNode;
+}
+
bool SwCursorShell::IsInFrontOfLabel() const
{
return m_pCurrentCursor->IsInFrontOfLabel();
diff --git a/sw/source/uibase/shells/textsh1.cxx b/sw/source/uibase/shells/textsh1.cxx
index 43383e1..7da48b1 100644
--- a/sw/source/uibase/shells/textsh1.cxx
+++ b/sw/source/uibase/shells/textsh1.cxx
@@ -498,6 +498,7 @@ void SwTextShell::Execute(SfxRequest &rReq)
}
break;
case FN_FORMAT_FOOTNOTE_DLG:
+ case FN_FORMAT_CURRENT_FOOTNOTE_DLG:
{
GetView().ExecFormatFootnote();
break;
@@ -1376,6 +1377,11 @@ void SwTextShell::GetState( SfxItemSet &rSet )
{
switch ( nWhich )
{
+ case FN_FORMAT_CURRENT_FOOTNOTE_DLG:
+ if( !rSh.IsCursorInFootnote() )
+ rSet.DisableItem( nWhich );
+ break;
+
case SID_LANGUAGE_STATUS:
{
// the value of used script types
diff --git a/sw/uiconfig/swriter/popupmenu/text.xml b/sw/uiconfig/swriter/popupmenu/text.xml
index 763066b..cf3a1f5 100644
--- a/sw/uiconfig/swriter/popupmenu/text.xml
+++ b/sw/uiconfig/swriter/popupmenu/text.xml
@@ -44,6 +44,7 @@
<menu:menuseparator/>
<menu:menuitem menu:id=".uno:EditStyle"/>
<menu:menuitem menu:id=".uno:EditCurrentRegion"/>
+ <menu:menuitem menu:id=".uno:CurrentFootnoteDialog"/>
<menu:menuseparator/>
<menu:menuitem menu:id=".uno:OpenHyperlinkOnCursor"/>
<menu:menuitem menu:id=".uno:EditHyperlink"/>
More information about the Libreoffice-commits
mailing list