Bug Hunting Session
Bug 51689 - UI: Possibility in Menu (besides key board Alt+Enter) to insert (additional) paragraphs before and after sections, tables and indexes
Summary: UI: Possibility in Menu (besides key board Alt+Enter) to insert (additional) ...
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
Inherited From OOo
Hardware: All All
: low enhancement
Assignee: Not Assigned
URL:
Whiteboard: BSA
Keywords: needsUXEval
Depends on:
Blocks: TableofContents-Indexes Writer-Tables-Enhancements Section
  Show dependency treegraph
 
Reported: 2012-07-03 04:48 UTC by Harald Koester
Modified: 2019-01-21 10:30 UTC (History)
6 users (show)

See Also:
Crash report or crash signature:


Attachments
Test case. Try to add new paragraph at beginning of document (11.67 KB, application/vnd.oasis.opendocument.text)
2012-07-13 13:33 UTC, sasha.libreoffice
Details
Basic macro which has needed functionality (23.29 KB, application/vnd.oasis.opendocument.text)
2012-12-20 09:42 UTC, sasha.libreoffice
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Harald Koester 2012-07-03 04:48:55 UTC
Problem description: 

If you like to insert a paragraph before or behind a section/table/index which is positioned at the begin or the end of the document, you have to use the short cut Alt+Enter. If you do not know this short cut, as I did, you will not succeed to insert paragraphs in some cases.

Proposal for enhancement:

IF
 a section, table or index is positioned at the begin
 or the end of a document
 AND
 the cursor is also positioned at the begin or the end
 of the document inside the section, table and index
 AND 
 the user presses Enter
THEN
 a dialog should open and ask the user "Where shall 
 the paragraph inserted? Possible selections should be
 "Before/After section/table/index" and 
 "Inside section/table/index".

See also bug 46092.
              
Browser: Mozilla/5.0 (Windows NT 6.1; rv:13.0) Gecko/20100101 Firefox/13.0.1
Comment 1 sasha.libreoffice 2012-07-06 05:11:41 UTC
Thanks for new idea. I can confirm that idea is good.
Let we wait for other ideas.
Comment 2 Joel Madero 2012-07-09 15:38:20 UTC
I'm going to mark this as NEEDINFO until there is an example document. Sasha or Harald could you get an example document up and mark it as UNCONFIRMED again. I'll take a look after and verify that it's an enhancement request and prioritize it. Thanks to both of you for the suggestion/verification
Comment 3 sasha.libreoffice 2012-07-13 13:33:28 UTC
Created attachment 64172 [details]
Test case. Try to add new paragraph at beginning of document
Comment 4 Joel Madero 2012-10-01 03:01:02 UTC
This is pretty normal behavior for tables (I agree it's not ideal) but the alt+enter is normal even in Excel I believe. Another weird one with tables is deleting them which requires an extra shift key. 

I'll confirm this, although the solution provided I think would get annoying real quick for users working with large projects (having a dialog pop up every time). I'm not sure if there is a better option but that particular one doesn't seem ideal. Really might be better just to have Enter function is it does any other time (no pop up needed). 

Confirming as an enhancement request.
Comment 5 Harald Koester 2012-10-22 10:02:52 UTC
In the German user mailing list the same problem with a TOC has been reported. So I thought again about a solution. 

Another or an additional solution to my first proposal may be an item in the submenu "Insert": "Paragraph above section/table/index".

In order to insert a paragraph e.g above a table, you should proceed as follows:
[1] Position the cursor somewhere into the table.
[2] Menu: Insert > Paragraph above table. 

Then above the table a new paragraph (i.e. an empty line) is inserted and the cursor should be positioned at the beginning of the new line.
Comment 6 sasha.libreoffice 2012-12-20 09:42:48 UTC
Created attachment 71841 [details]
Basic macro which has needed functionality

I have written Basic macro which can add new line before and after tables, sections, indexes
Comment 7 Cor Nouws 2016-08-27 10:32:50 UTC
could be something for the table menu?
Comment 8 Yousuf Philips (jay) (retired) 2016-09-09 20:38:25 UTC
I seem confused with the description as i just tested this.

1) Open writer
2) Insert a table
3) Use down key to exit the table
4) Press delete to delete the paragraph after the table
5) Press down and the paragraph is still there

So is there ever a situation when you cant go below the table?

With regards to adding a paragraph above a table, all you have to do is to go the beginning of cell A1 of the table and press enter and it will add a paragraph above the table.
Comment 9 Cor Nouws 2016-09-09 20:43:07 UTC
(In reply to Yousuf Philips (jay) from comment #8)
> I seem confused with the description as i just tested this.

;)

> So is there ever a situation when you cant go below the table?

No, there always is a paragraph below a table.

> With regards to adding a paragraph above a table, all you have to do is to
> go the beginning of cell A1 of the table and press enter and it will add a
> paragraph above the table.

When the table is at the top of the page, yes, but not in another situation.
Comment 10 Heiko Tietze 2016-09-12 08:50:40 UTC
When I add a table in Write and press Enter at the first cell a new line is added before the table. And after the table there is always a line. 
It does not work like this for a section, neither before nor after since I can delete the caret in this case (alt+enter does the trick for both situations). 
For an index (tested with a TOC) I have no chance to add something before, neither using alt nor alt+enter. The end of the TOC is not a problem because there is always text below.

We should change the behavior for sections and indexes so that enter pressed when the cursor is placed at the very first position adds a line before the object. But I wonder if there are more objects like these three.
Comment 11 Cor Nouws 2016-09-12 09:07:51 UTC
(In reply to Heiko Tietze from comment #10)
> When I add a table in Write and press Enter at the first cell a new line is
> added before the table. And after the table there is always a line. 

Table at the top of the document? Only works like that for me in that case.

> We should change the behavior for sections and indexes so that enter pressed

Or alt+enter. Cause: if you want to add a paragraph in the beginning of your section or table, that you have to fiddle around.
Comment 12 Heiko Tietze 2016-09-12 09:31:24 UTC
(In reply to Cor Nouws from comment #11)
> Or alt+enter. Cause: if you want to add a paragraph in the beginning of your
> section or table, that you have to fiddle around.

Is there a use case for an empty first line in sections? I'm afraid of the Benjamins who are not aware of the shortcut and have no clue how to enter a line break before the section (but they will likely not use this feature anyway). Your idea of an entry in the context menus adds discoverability but is not the first choice.
Comment 13 Cor Nouws 2016-09-12 20:51:06 UTC
Hi Heiko,

(In reply to Cor Nouws from comment #11)
> (In reply to Heiko Tietze from comment #10)
> > When I add a table in Write and press Enter at the first cell a new line is
> > added before the table. And after the table there is always a line. 
> 
> Table at the top of the document? Only works like that for me in that case.


??


(In reply to Heiko Tietze from comment #12)
> (In reply to Cor Nouws from comment #11)

> Is there a use case for an empty first line in sections?

Sure :)

> I'm afraid of the
> Benjamins who are not aware of the shortcut and have no clue how to enter a
> line break before the section (but they will likely not use this feature
> anyway). 

Alt+Enter already exists, is listed, documented and used..
Hmm wait, the Help on Writer shortcut mentions:
  Alt+Enter
  Inserting a new paragraph directly before or after a section, or before 
  a table.
Indeed, simply works for me with a section too. Not with a TOC.

> Your idea of an entry in the context menus adds discoverability but
> is not the first choice.

Looking at how it works, adding Alt+Enter in the menu would be helpful.
People can also find hard spaces (Ctrl+Shft+Space), Soft Hyphens (Ctrl+-) in the menu.
Comment 14 Yousuf Philips (jay) (retired) 2016-09-12 21:45:44 UTC
(In reply to Heiko Tietze from comment #10)
> It does not work like this for a section, neither before nor after since I
> can delete the caret in this case (alt+enter does the trick for both
> situations). 

Yes i had this problem when it tried editing help documents and wanted to insert a line after a section.

> For an index (tested with a TOC) I have no chance to add something before,
> neither using alt nor alt+enter. The end of the TOC is not a problem because
> there is always text below.

If you disable 'protected against manual changes' in the index dialog you will be able to do alt+enter at the top of to TOC.

> We should change the behavior for sections and indexes so that enter pressed
> when the cursor is placed at the very first position adds a line before the
> object. But I wonder if there are more objects like these three.

Have to agree with Cor that it causes problems for editing sections.

My suggestion would be to add a checkbox in all of the three dialogs (section, table, index) that would add spacing above and below if necessary. Then remove the press enter at the beginning of A1 in tables to unify the behaviour and having an uno command for the alt+enter behaviour placed in Insert > Formatting Mark.
Comment 15 Heiko Tietze 2016-09-13 07:02:04 UTC
(In reply to Yousuf Philips (jay) from comment #14)
> If you disable 'protected against manual changes' in the index dialog you
> will be able to do alt+enter at the top of to TOC.

That allows to modify the TOC but we try to insert a line break before the object. For instance the document title on page 1.

> My suggestion would be to add a checkbox in all of the three dialogs...

What an ugly solution ;-).

Having another entry under 'Formatting Mark' is good as it helps to learn the Alt+Enter shortcut. But why should users be allowed to add a break in sections, indexes (if enabled) etc. but not for tables? (I don't want to change how to deal with tables.) 

It would be helpful to have the same processing of input in all situations meaning enter in objects at the very first item add a line break before the object.

(In reply to Cor Nouws from comment #13)
> ??

Testing right now with nightly builds under Windows.
Comment 16 Yousuf Philips (jay) (retired) 2016-09-13 15:11:11 UTC
(In reply to Heiko Tietze from comment #15)
> What an ugly solution ;-).

Solution doesnt have to pretty :D, it just has to be discoverable and if i had to look for it, which i did when i was doing documentation, i'd check the dialog and would assume others would also.

> Having another entry under 'Formatting Mark' is good as it helps to learn
> the Alt+Enter shortcut. But why should users be allowed to add a break in
> sections, indexes (if enabled) etc. but not for tables? (I don't want to
> change how to deal with tables.) 

If i'm getting you write, my answer would be that sections are no different than text in non-sections, where you press enter and the cursor moves downward and not that the cursor moves upwards. Not a huge adjustment to press alt+enter rather than enter at A1. Change comes everyday so you have to adapt. :D

> It would be helpful to have the same processing of input in all situations
> meaning enter in objects at the very first item add a line break before the
> object.

If it didnt so negatively hurt inserting a section, i might be with you on this. If its feasible to do it for indexes, go for it.
Comment 17 Harald Koester 2016-09-15 12:05:52 UTC
(In reply to Yousuf Philips (jay) from comment #8)
> I seem confused with the description as i just tested this.
> 
> 1) Open writer
> 2) Insert a table
> 3) Use down key to exit the table
> 4) Press delete to delete the paragraph after the table
> 5) Press down and the paragraph is still there
> 
> So is there ever a situation when you cant go below the table?

Currently not. But consider a table which ends together at the end of a document and at the bottom of a page. In this case there is an empty paragraph on a new empty page at the end of the document. This should be avoided because the number of pages is not correct, an empty page will be printed, ... Hence I think no empty paragraph should be inserted when inserting a new table. Furthermore it should be possible to delete an empty paragraph below a table at the end of a document. When this is implemented there should be a possibility to insert a new paragraph below a table besides Alt+Enter.

> 
> With regards to adding a paragraph above a table, all you have to do is to
> go the beginning of cell A1 of the table and press enter and it will add a
> paragraph above the table.
Usually this works, but not if the first cell is protected.
Comment 18 Harald Koester 2016-09-15 12:52:38 UTC
(In reply to Heiko Tietze from comment #10)

> For an index (tested with a TOC) I have no chance to add something before,
> neither using alt nor alt+enter. The end of the TOC is not a problem because
> there is always text below.
That's not always right. Suppose you start editing a document und first add a TOC. In this case there is no text below. A TOC may also be put at the end of a document. A bit old-fashioned, but possible. And it's quite normal to put other kinds of indexes at the end of a document.

If you insert an index, it is always inserted with an empty paragraph below. For the same reasons mentioned in comment 17, I think this is not correct.