]> git.lyx.org Git - lyx.git/commitdiff
Fix bug #6642: Concatenate the context menus for: InsetCollapsables without a button...
authorVincent van Ravesteijn <vfr@lyx.org>
Mon, 29 Nov 2010 23:21:52 +0000 (23:21 +0000)
committerVincent van Ravesteijn <vfr@lyx.org>
Mon, 29 Nov 2010 23:21:52 +0000 (23:21 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@36606 a592a061-630c-0410-9148-cb99ea01b6c8

src/insets/InsetCollapsable.cpp
src/insets/InsetInfo.cpp
src/insets/InsetInfo.h
src/insets/InsetTabular.cpp
src/insets/InsetTabular.h
src/insets/InsetText.cpp
src/insets/InsetText.h

index 72cd73b5b21fcab70d2b314773f8df2d1637bfab..c75285796c1dcaee350b9e1b0833a28339bb5180 100644 (file)
@@ -622,10 +622,10 @@ docstring InsetCollapsable::contextMenu(BufferView const & bv, int x,
        int y) const
 {
        if (decoration() == InsetLayout::CONGLOMERATE)
-               return contextMenuName();
+               return contextMenuName() + ";" + InsetText::contextMenuName();
 
        if (geometry(bv) == NoButton)
-               return contextMenuName();
+               return contextMenuName() + ";" + InsetText::contextMenuName();
 
        Dimension dim = dimensionCollapsed(bv);
        if (x < xo(bv) + dim.wid && y < yo(bv) + dim.des)
index 4dbee710aee6b839b43d6d05c2fe5ef3e9699336..28bce9e31874caa7cccb47b09a6a6e68fa0220e1 100644 (file)
@@ -452,6 +452,14 @@ void InsetInfo::updateInfo()
 }
 
 
+docstring InsetInfo::contextMenuName() const
+{
+       //FIXME: We override the implementation of InsetCollapsable,
+       //because this inset is not a collapsable inset.
+       return contextMenuName();
+}
+
+
 docstring InsetInfo::contextMenuName() const
 {
        return from_ascii("context-info");
index bb2144db03c25896a6aa3f835d32998b1175d8a4..ee64c016b68238e850392842a028e176d4affdd0 100644 (file)
@@ -127,6 +127,8 @@ public:
        docstring toolTip(BufferView const & bv, int x, int y) const;
        ///
        docstring contextMenuName() const;
+       ///
+       docstring contextMenuName() const;
        /// should paragraph indendation be ommitted in any case?
        bool neverIndent() const { return true; }
 
index b1706be00e885c837607bd5bb4c0989f704d87d7..b68d03a8c55dd91bb4208954c61af07aa65171fc 100644 (file)
@@ -3329,7 +3329,14 @@ void InsetTabular::write(ostream & os) const
 
 docstring InsetTabular::contextMenuName() const
 {
-       // FIXME: depending on the selection state, we could offer a different menu.
+       // FIXME: depending on the selection state,
+       // we could offer a different menu.
+       return cell(0)->contextMenuName() + ";" + contextMenuName();
+}
+
+
+docstring InsetTabular::contextMenuName() const
+{
        return from_ascii("context-tabular");
 }
 
index 6b34e6caf37be6a4910f5b6961b2aba86bd0a45c..289b32f5c3a004c5b1083b18ef346a864ee88fe2 100644 (file)
@@ -813,6 +813,8 @@ public:
        ///
        InsetCode lyxCode() const { return TABULAR_CODE; }
        ///
+       docstring contextMenu(BufferView const &, int, int) const;
+       ///
        docstring contextMenuName() const;
        /// get offset of this cursor slice relative to our upper left corner
        void cursorPos(BufferView const & bv, CursorSlice const & sl,
index 68220af5d671852129a9c154001347742edf02d8..c8c8175036aa2a5dfb2b20b893568c6643864e27 100644 (file)
@@ -813,6 +813,15 @@ void InsetText::completionPosAndDim(Cursor const & cur, int & x, int & y,
 }
 
 
+docstring InsetText::contextMenuName() const
+{
+       docstring context_menu = contextMenuName();
+       if (context_menu != InsetText::contextMenuName())
+               context_menu += ";" + InsetText::contextMenuName(); 
+       return context_menu;
+}
+
+
 docstring InsetText::contextMenuName() const
 {
        return from_ascii("context-edit");
index ebb11a29f1c165fe1ab55d3a767d72ff1beb5763..f1c23cccaf6987ba12409750d27fca801a783579 100644 (file)
@@ -195,6 +195,8 @@ public:
        /// e.g., "Index: ".
        docstring toolTipText(docstring prefix = empty_docstring()) const;
 
+       ///
+       docstring contextMenu(BufferView const &, int, int) const;
        ///
        docstring contextMenuName() const;
        ///