summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGulsah Kose <gulsah.1004@gmail.com>2017-01-23 16:44:54 +0300
committerMaxim Monastirsky <momonasmon@gmail.com>2017-02-05 16:48:49 +0000
commit0b819a1f0704b82b16007ba707e49ad4082311df (patch)
tree21af2452d0ecc851da43d75348e34422c38afb28
parent1f9b7ccd6e988b330e5d16305c27c7d6844c938b (diff)
tdf#103258 Add contextual edit footnote endnote command.
Change-Id: I68126d2ec8b8dfb12c45ce577d110be2b94a4e33 Signed-off-by: Gulsah Kose <gulsah.1004@gmail.com> Reviewed-on: https://gerrit.libreoffice.org/33803 Tested-by: Jenkins <ci@libreoffice.org> Tested-by: Maxim Monastirsky <momonasmon@gmail.com> Reviewed-by: Maxim Monastirsky <momonasmon@gmail.com>
-rw-r--r--officecfg/registry/data/org/openoffice/Office/UI/WriterCommands.xcu5
-rw-r--r--sw/inc/cmdid.h5
-rw-r--r--sw/inc/crsrsh.hxx2
-rw-r--r--sw/sdi/_textsh.sdi5
-rw-r--r--sw/sdi/swriter.sdi18
-rw-r--r--sw/source/core/crsr/crsrsh.cxx6
-rw-r--r--sw/source/uibase/shells/textsh1.cxx6
-rw-r--r--sw/uiconfig/swriter/popupmenu/text.xml1
8 files changed, 46 insertions, 2 deletions
diff --git a/officecfg/registry/data/org/openoffice/Office/UI/WriterCommands.xcu b/officecfg/registry/data/org/openoffice/Office/UI/WriterCommands.xcu
index b0b6eaf8afd0..e38f165de2c9 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 6a5631d9f287..703a1cfd2532 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 10e13a101e0a..66718855192c 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 eec76a38ed58..f365fc09993d 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 fb1884b97c88..a835734ed4f8 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 5d2b9994990e..9084a272f94e 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 43383e1c55c0..7da48b1dd92a 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 763066be8bf6..cf3a1f54dd6d 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"/>