Bug 111535 - [Ruler] Add First-line indent, paragraph indent, and tab spaces
Summary: [Ruler] Add First-line indent, paragraph indent, and tab spaces
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice Online
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
unspecified
Hardware: All All
: medium enhancement
Assignee: Gökay ŞATIR
URL:
Whiteboard: target:7.0.0 target:7.1.0 target:7.0....
Keywords: difficultyInteresting, easyHack, skillCpp, skillJavaScript
Depends on:
Blocks:
 
Reported: 2017-08-08 19:41 UTC by Aditya Dewan
Modified: 2020-07-01 16:27 UTC (History)
8 users (show)

See Also:
Crash report or crash signature:
Regression By:


Attachments
Sample with various indent settings (16.70 KB, application/vnd.oasis.opendocument.text)
2020-05-13 00:48 UTC, Aron Budea
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Aditya Dewan 2017-08-08 19:41:26 UTC
The current implementation is pretty basic, and it would be good to have the Following features:
- First-line indent
- paragraph indent
- tab spaces
just like other office writers and LibreOffice writer

Implementation of these would involve the following tasks:
- extending the LOK_CALLBACK_RULER_UPDATE to accommodate the positions(coordinates) of the above said.
- implementing markers to display these positions along with its drag-able operation to change these values.
- extending the '.uno:RulerChangeState' command to accommodate these changed values.
-changing SvxRuler::SetValues function, to change actual values of svxruler/ruler.
Comment 1 Heiko Tietze 2017-08-09 19:32:40 UTC
Sounds reasonable
Comment 2 Pranav Kant 2018-01-30 12:31:02 UTC
This looks like a very good candidate for easyHack. You have already elaborated the problem nicely and given appropriate code pointers.

Happy to help if there are any further questions. This involves work in both core.git and online.git
Comment 3 Gökay ŞATIR 2020-04-22 21:03:49 UTC
Hello,

Can i work on this task? Is there an ongoing work?
Comment 4 Buovjaga 2020-04-23 06:42:22 UTC
(In reply to Gökay ŞATIR from comment #3)
> Can i work on this task? Is there an ongoing work?

Yes, you can work on it. Would need to find another mentor, though, if questions arise. Well, easier to get advise with a patch in gerrit anyhow.
Comment 5 Gökay ŞATIR 2020-04-23 08:35:09 UTC
(In reply to Buovjaga from comment #4)
> (In reply to Gökay ŞATIR from comment #3)
> > Can i work on this task? Is there an ongoing work?
> 
> Yes, you can work on it. Would need to find another mentor, though, if
> questions arise. Well, easier to get advise with a patch in gerrit anyhow.

Thank you. I started to work.

By the way, i built libreoffice with Firebird enabled, created a simple database with all the data types and tested migration. I could not go further, because i am more interested in Online part. Thank you again.
Comment 6 Aron Budea 2020-04-27 01:13:24 UTC
Some related work has been done for the iOS app recently by Tomaž Vajngerl (bug 128468). Not sure of the status.

The LOK part:
https://cgit.freedesktop.org/libreoffice/core/commit/?id=a60b18a8c5d5c11c87dbbaaf884de138dfeb6c8f
And a couple of online commits with "ruler" in the subject.
Comment 7 Gökay ŞATIR 2020-04-29 13:49:32 UTC
Hello,

I sent a patch for the core part of this task. Can you review the patch? I could not decide whom to add as reviewer.

Thank you.
Comment 8 Gökay ŞATIR 2020-04-29 13:49:59 UTC
The patch is here:

https://gerrit.libreoffice.org/c/core/+/93165
Comment 9 Gökay ŞATIR 2020-05-01 10:40:18 UTC
Patch for the online part is here:
https://gerrit.libreoffice.org/c/online/+/93250
Comment 10 Commit Notification 2020-05-08 10:38:25 UTC
gokaysatir committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/15adfafee5b48d6f88a0b970c50e5c5bc77a4ab1

tdf#111535 - Add First-line indent, paragraph indent, and tab spaces/Core part

It will be available in 7.0.0.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 11 Commit Notification 2020-05-12 11:29:04 UTC
gokaysatir committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/online/commit/221d666822d8f010e629761456ff30ad8bb8fe24

tdf#111535 Add First-line indent, paragraph indent, and tab spaces/Online part.
Comment 12 Aron Budea 2020-05-13 00:48:28 UTC
Created attachment 160737 [details]
Sample with various indent settings

Gökay, thank you for implementing this!

I'm looking at the current master / master build, and have noticed a couple of oddities. I don't know if they come from the recent commits, or have a different cause, so I'm just noting them down here for now.

1.) When opening a file, the indent markers aren't initialized, and remain at the left edge until switching paragraphs.

2.) The markers are slightly off to the left (~0.1 cm or so).
Interestingly the after text indent marker is right on the right margin marker (and both are actually slightly off), while the left margin marker seems to be in the correct position, only the indent markers are off there.

3.) Resizing the browser window doesn't adjust the markers.

4.) Attaching a sample with a couple of paragraphs with different settings. Almost all of them are shown correctly on the ruler, except one, the 6th: the markers should be at 0 cm and 2 cm, while they are at -2 cm and 0 cm.

The list of indent settings in the sample (as they are in the Format Paragraph dialog, not as they appear on the ruler):
1.: 0 cm / 0 cm / 0 cm
2.: 0 cm / 0 cm / 1 cm
3.: 1 cm / 0 cm / 0 cm
4.: 0 cm / 1 cm / 0 cm
5.: -1 cm / 1 cm / 2 cm
6.: 2 cm / 0 cm / -2 cm
Comment 13 Tomaz Vajngerl 2020-05-13 07:17:29 UTC
I've made some fixes in https://gerrit.libreoffice.org/c/online/+/94095
Comment 14 Tomaz Vajngerl 2020-05-13 07:26:43 UTC
I actually wonder if the fat grey line that denotes left and right margin (ruler 0) is positioned correctly (which doesn't really make it a problem of the indent markers however). For the left margin the start should be on the right side of that grey line but it looks like it is on the left side. On the right margin it should be on the left side of the line.
Comment 15 Gökay ŞATIR 2020-05-13 07:48:37 UTC
(In reply to Tomaz Vajngerl from comment #14)
> I actually wonder if the fat grey line that denotes left and right margin
> (ruler 0) is positioned correctly (which doesn't really make it a problem of
> the indent markers however). For the left margin the start should be on the
> right side of that grey line but it looks like it is on the left side. On
> the right margin it should be on the left side of the line.

Thank you for your comment and the patch:) I will take the patch and work on the bugs listed by Mr. Budea.
Comment 16 Tomaz Vajngerl 2020-05-13 08:06:05 UTC
(In reply to Gökay ŞATIR from comment #15)
> 
> Thank you for your comment and the patch:) I will take the patch and work on
> the bugs listed by Mr. Budea.

I have just pushed the patch so you can just get the latest code.
Comment 17 Gökay ŞATIR 2020-05-14 09:39:44 UTC
Hello,

Thank you for your comments. I tested it, as far as i can see is:

* In Online UI: Format=>Paragraph UI is probably showing wrong values. It is adding margin values to actual indentation values.

* When i copy paste the text, Online editor does not recognize the indentations of the 6. paragraph, when i copy the file into the Online data folder and open it, the 6. paragraph is shown as it is. But this time Format=>Paragraph window is more faulty.

 The tool window at the right side shows the right values all the time.

I think there are two things:

Online=>Format=Paragraph codes seem to be faulty.
Copy Paste may be buggy for at least the last paragraph of the text.

Tomaz what should i do next, may you show the way?

I will deal with the bug occurring when the window is resized.

Best Regards.
Comment 18 Gökay ŞATIR 2020-05-30 08:57:27 UTC
Bug related to window resizing is solved here:

https://gerrit.libreoffice.org/c/online/+/95178
Comment 19 Heiko Tietze 2020-06-03 12:13:57 UTC
(In reply to Gökay ŞATIR from comment #18)
> Bug related to window resizing is solved here:
> 
> https://gerrit.libreoffice.org/c/online/+/95178

Resolve as fixed?
Comment 20 Commit Notification 2020-06-03 19:11:05 UTC
gokaysatir committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/online/commit/0b82134d9067abea83959f44728cd3623f14dc7d

tdf#111535 fix mispositioning bug when the page is resized.
Comment 21 Gökay ŞATIR 2020-06-05 20:56:29 UTC
Shall i set it to "resolved"?

There are bugs but they are not related to this task. This task is done i think.

Thank you.
Comment 22 Buovjaga 2020-06-06 07:08:14 UTC
(In reply to Gökay ŞATIR from comment #21)
> Shall i set it to "resolved"?

Yes.
Comment 23 Commit Notification 2020-07-01 16:27:29 UTC
gokaysatir committed a patch related to this issue.
It has been pushed to "libreoffice-7-0":

https://git.libreoffice.org/online/commit/da093e11843acef322cfa72ea28b18e4e546c253

tdf#111535 fix mispositioning bug when the page is resized.