https://bugs.documentfoundation.org/show_bug.cgi?id=104271

            Bug ID: 104271
           Summary: New comment box should automatically re-position and
                    re-size appropriately based on the shape of text
                    pasted into it
           Product: LibreOffice
           Version: 3.3.0 release
          Hardware: All
                OS: All
            Status: UNCONFIRMED
          Severity: enhancement
          Priority: medium
         Component: Calc
          Assignee: libreoffice-bugs@lists.freedesktop.org
          Reporter: lopeonl...@gmail.com

Description:
Creating comments in Libre Office Calc is very tedious and inconvenient.

After implementing this very simple algorithm it will be a pleasure to add new
comments to a calc worksheet :)

Steps to Reproduce:
1. Right click a cell in Calc and click "Add comment" 

2. Add a comment to a cell that is on the right of the workspace.

3. Create a new comment and paste in some text.

4. Try paste some text into a new comment and then position it or resize it.

5. Try drag a new comment to a new position.


Actual Results:  
1. It opens a new comment box, positioned 3 cells above and 1 cell to the right
of the cell.
This is a very bad default position for a new comment, because:

2. It scrolls the whole calc workspace to the right unnecessarily, so you can't
see the left column anymore, so you have to manually scroll left after adding
the comment.

3. The comment box's position and width are not set appropriately.

4. It also does not allow you to immediately resize the comment box. You have
to first click outside the comment box, then the new comment is hidden, then
you have to right click the cell and show the comment. Then you have to click
the comment once, ONLY then can you resize it.

5. The first time you drag a newly created comment box away from it's original
position, it moves a little bit, then disappears and resumes it's original
position. The 2nd time you drag it, it is dragged properly.

Expected Results:
The default position of the comment box should be that the left edge of the
comment box is aligned with the left of the cell being commented on, and the
top edge of the comment box should be aligned with the bottom of the cell being
commented on.

The above is just to correct the very inconvenient default position.
But here comes the really useful/innovative part that will make calc a pleasure
to add comments :)

In a Nutshell: When text is pasted into the new comment box, the box should
expand as necessary to accommodate the pasted text, up to a maximum width equal
to the workspace in calc window; after setting the width, the height should be
set to accommodate the entire comment text.

#1. The top of the comment box should be aligned with the bottom of the cell
being commented on.

CALCULATING IDEAL COMMENT BOX WIDTH
#2. The ideal width and height of the comment box should be calculated
according to the following simple rules.
First the algorithm must determine the longest line in the pasted text.
That is the ideal width of the comment box, HOWEVER if it is wider than the
viewable area then the comment box's ideal width must be reduced so that it
fits into the calc window's workspace's width. Lines longer than the ideal
width will be wrapped.

2.1 An option should be added for the user to specify the maximum calculated
width for a comment box. Personally I won't limit the width. I paste a lot of
code snippets, and I'm quite happy with comment boxes that take up the width of
my workspace when necessary. But other people who are not programmers may
likely paste mostly long paragraphs that don't have much line breaks, that can
be arbitrarily wrapped at any length. They may prefer to limit their automatic
comment box width.

#3. If the calculated ideal width of the comment box can fit horizontally from
the left edge of the cell being commented on, to the right edge of the
workspace (at the current scroll position), then the left edge of the comment
box should be aligned with the left of the cell being commented on, and the
comment box should have the calculated ideal width as described above.

#4. If the calculated ideal width exceeds what can fit in #3 then the comment
box should be set to it's ideal width (#1) and the right edge of the comment
box should be aligned with the right edge of the calc window's workspace.

CALCULATING IDEAL COMMENT BOX HEIGHT
The ideal comment box height must fit the number of lines in the pasted text,
taking into consideration word-wrapping (if it occurs), given the comment box's
(ideal calculated) width. The workspace's vertical scrolling position must be
scrolled down if necessary if the bottom edge of the comment box is below the
currently viewable area of the workspace...
Calc does not provide the ability to scroll down inside a comment box, so the
height of the comment box cannot be limited to the workspace height minus the
height of the cell being commented on. Instead the comment box's height must be
set such that the entire comment can be viewed by manually scrolling down.
However the vertical scroll position of the calc window after pasting a
massively long comment should have the cell being commented fully viewable at
the top of the workspace, with the beginning part of the comment directly below
it.


Reproducible: Always

User Profile Reset: N/A

Additional Info:


User-Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like
Gecko) Ubuntu Chromium/53.0.2785.143 Chrome/53.0.2785.143 Safari/537.36

-- 
You are receiving this mail because:
You are the assignee for the bug.
_______________________________________________
Libreoffice-bugs mailing list
Libreoffice-bugs@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-bugs

Reply via email to