Re: Note inset can not be dissolved in table

2019-12-30 Thread Jean-Marc Lasgouttes

Le 07/12/2019 à 04:08, Richard Kimberly Heck a écrit :

On 12/6/19 7:27 AM, Pavel Sanda wrote:

On Fri, Dec 06, 2019 at 09:55:46AM +0100, Jean-Marc Lasgouttes wrote:

Pavel, could you try latest master?

I tested it and it works well now.


If this is needed in stable, please go ahead.


Done at [44027154/lyxgit]

--
lyx-devel mailing list
lyx-devel@lists.lyx.org
http://lists.lyx.org/mailman/listinfo/lyx-devel


Re: Note inset can not be dissolved in table

2019-12-06 Thread Richard Kimberly Heck
On 12/6/19 7:27 AM, Pavel Sanda wrote:
> On Fri, Dec 06, 2019 at 09:55:46AM +0100, Jean-Marc Lasgouttes wrote:
>>> This patch seems to fix the issue.
>>> For not having better idea I take descendable() as a reasonable proxy for 
>>> insets
>>> in which dissolving inset makes sense.
>>>
>>> I'll commit to master unless someone has better idea.
>> Pavel, could you try latest master?
> I tested it and it works well now.

If this is needed in stable, please go ahead.

Riki


-- 
lyx-devel mailing list
lyx-devel@lists.lyx.org
http://lists.lyx.org/mailman/listinfo/lyx-devel


Re: Note inset can not be dissolved in table

2019-12-06 Thread Pavel Sanda
On Fri, Dec 06, 2019 at 09:55:46AM +0100, Jean-Marc Lasgouttes wrote:
> >This patch seems to fix the issue.
> >For not having better idea I take descendable() as a reasonable proxy for 
> >insets
> >in which dissolving inset makes sense.
> >
> >I'll commit to master unless someone has better idea.
> 
> Pavel, could you try latest master?

I tested it and it works well now.
Thanks!
Pavel
-- 
lyx-devel mailing list
lyx-devel@lists.lyx.org
http://lists.lyx.org/mailman/listinfo/lyx-devel


Re: Note inset can not be dissolved in table

2019-12-06 Thread Jean-Marc Lasgouttes

Le 19/11/2019 à 13:35, Pavel Sanda a écrit :

On Wed, Nov 06, 2019 at 04:11:44PM +0100, Pavel Sanda wrote:

On Mon, Nov 04, 2019 at 04:07:57PM +0100, Pavel Sanda wrote:

Hi,
as title says - in the current stable 2.3 note inset can't be dissolved via 
inset menu (the menu entry is greyed out).


Reverting 67f77a07 fixes the problem (but introduces back #9954).

JMarc, it might be easy cake for you?


This patch seems to fix the issue.
For not having better idea I take descendable() as a reasonable proxy for insets
in which dissolving inset makes sense.

I'll commit to master unless someone has better idea.


Pavel, could you try latest master?

JMarc
--
lyx-devel mailing list
lyx-devel@lists.lyx.org
http://lists.lyx.org/mailman/listinfo/lyx-devel


Re: Note inset can not be dissolved in table

2019-11-19 Thread Jean-Marc Lasgouttes

Le 19/11/2019 à 13:35, Pavel Sanda a écrit :

This patch seems to fix the issue.
For not having better idea I take descendable() as a reasonable proxy for insets
in which dissolving inset makes sense.


No, descendable means that there are cells in there. But (up to now) we 
do not dissolve when there are several cells. I suspect this is not the 
case for mathed, but this is a separate issue.


The issue here is that the test "only one cell" is done on the tabular 
inset, not the note inset.



I'll commit to master unless someone has better idea.


I'll try to have a look tomorrow.

JMarc
--
lyx-devel mailing list
lyx-devel@lists.lyx.org
http://lists.lyx.org/mailman/listinfo/lyx-devel


Re: Note inset can not be dissolved in table

2019-11-19 Thread Pavel Sanda
On Wed, Nov 06, 2019 at 04:11:44PM +0100, Pavel Sanda wrote:
> On Mon, Nov 04, 2019 at 04:07:57PM +0100, Pavel Sanda wrote:
> > Hi,
> > as title says - in the current stable 2.3 note inset can't be dissolved via 
> > inset menu (the menu entry is greyed out).
> 
> Reverting 67f77a07 fixes the problem (but introduces back #9954).
> 
> JMarc, it might be easy cake for you?

This patch seems to fix the issue.
For not having better idea I take descendable() as a reasonable proxy for insets
in which dissolving inset makes sense.

I'll commit to master unless someone has better idea.
Pavel
diff --git a/src/insets/InsetText.cpp b/src/insets/InsetText.cpp
index c7757f1673..8e240b2979 100644
--- a/src/insets/InsetText.cpp
+++ b/src/insets/InsetText.cpp
@@ -318,7 +318,9 @@ void InsetText::doDispatch(Cursor & cur, FuncRequest & cmd)
bool const target_inset = cmd.argument().empty()
|| cmd.getArg(0) == insetName(lyxCode());
// cur.inset() is the tabular when this is a single cell (bug 
#9954)
-   bool const one_cell = cur.inset().nargs() == 1;
+   bool one_cell = cur.inset().nargs() == 1;
+   //if in tabular but in front of another inset
+   if (!one_cell && descendable(cur.bv())) one_cell = 1;
 
if (!main_inset && target_inset && one_cell) {
// Text::dissolveInset assumes that the cursor
@@ -351,7 +353,9 @@ bool InsetText::getStatus(Cursor & cur, FuncRequest const & 
cmd,
bool const target_inset = cmd.argument().empty()
|| cmd.getArg(0) == insetName(lyxCode());
// cur.inset() is the tabular when this is a single cell (bug 
#9954)
-   bool const one_cell = cur.inset().nargs() == 1;
+   bool one_cell = cur.inset().nargs() == 1;
+   //if in tabular but in front of another inset
+   if (!one_cell && descendable(cur.bv())) one_cell = 1;
 
if (target_inset)
status.setEnabled(!main_inset && one_cell);
-- 
lyx-devel mailing list
lyx-devel@lists.lyx.org
http://lists.lyx.org/mailman/listinfo/lyx-devel


Re: Note inset can not be dissolved in table

2019-11-06 Thread Pavel Sanda
On Mon, Nov 04, 2019 at 04:07:57PM +0100, Pavel Sanda wrote:
> Hi,
> as title says - in the current stable 2.3 note inset can't be dissolved via 
> inset menu (the menu entry is greyed out).

Reverting 67f77a07 fixes the problem (but introduces back #9954).

JMarc, it might be easy cake for you?

Pavel
-- 
lyx-devel mailing list
lyx-devel@lists.lyx.org
http://lists.lyx.org/mailman/listinfo/lyx-devel


Note inset can not be dissolved in table

2019-11-04 Thread Pavel Sanda
Hi,
as title says - in the current stable 2.3 note inset can't be dissolved via 
inset menu (the menu entry is greyed out).
Pavel
-- 
lyx-devel mailing list
lyx-devel@lists.lyx.org
http://lists.lyx.org/mailman/listinfo/lyx-devel