Bug 149259 - After updating a Table Of Contents, text alignment of toc entries is not preserved (related to alignment of tab stop)
Summary: After updating a Table Of Contents, text alignment of toc entries is not pres...
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
7.3.3.2 release
Hardware: All All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: TableofContents-Indexes
  Show dependency treegraph
 
Reported: 2022-05-24 10:30 UTC by Jambunathan K
Modified: 2022-06-06 10:30 UTC (History)
1 user (show)

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


Attachments
Note that TOC content doesn't use any automatic styles; Also the text is NOT IN SYNC with the template (17.73 KB, application/vnd.oasis.opendocument.text)
2022-05-24 10:30 UTC, Jambunathan K
Details
How the document looks when it is loaded in to LibreOffice (140.85 KB, image/png)
2022-05-24 10:31 UTC, Jambunathan K
Details
How the documnet looks after update of TOC. Note that text is left aligned (when it should be right aligned) (133.39 KB, image/png)
2022-05-24 10:32 UTC, Jambunathan K
Details
Contents 1 is right aligned (40.39 KB, image/png)
2022-05-24 10:44 UTC, Jambunathan K
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Jambunathan K 2022-05-24 10:30:05 UTC
Created attachment 180327 [details]
Note that TOC content doesn't use any automatic styles; Also the text is NOT IN SYNC with the template

1.  Open the attached document.  See the TOC is right aligned, and it doesn't have page numbers.
2. Right Click on TOC -> Update Index. 
3. TOC now will have page numbers because the TOC template requests it.   But why does the entry have left alignment as opposed to right alignment?


See screen shot for details.

$ dpkg -l | grep libreoffice | grep writer
ii  libreoffice-writer                                 1:7.3.3~rc2-1  

Version: 7.3.3.2 / LibreOffice Community
Build ID: 30(Build:2)
CPU threads: 4; OS: Linux 5.17; UI render: default; VCL: x11
Locale: en-IN (en_IN); UI: en-US
Debian package version: 1:7.3.3~rc2-1
Calc: threaded
Comment 1 Jambunathan K 2022-05-24 10:31:00 UTC
Created attachment 180328 [details]
How the document looks when it is loaded in to LibreOffice
Comment 2 Jambunathan K 2022-05-24 10:32:21 UTC
Created attachment 180329 [details]
How the documnet looks after update of TOC.  Note that text is left aligned (when it should be right aligned)
Comment 3 Jambunathan K 2022-05-24 10:41:56 UTC
This is how TOC template looks like  ....

Note that Contents_20_1 etc inherit from the default paragraph style ... which requests right aligned text.  See screenshot.


<text:table-of-content text:style-name="OrgIndexSection"
                       text:name="Table of Contents"
                       text:protected="false">
  <text:table-of-content-source text:index-scope="document"
				text:outline-level="3"
				text:use-index-source-styles="true"
				text:use-outline-level="false">
    <text:index-title-template text:style-name="Contents_20_Heading">
    Table of Contents</text:index-title-template>
    <text:table-of-content-entry-template text:style-name="Contents_20_1"
					  text:outline-level="1">
      <text:index-entry-link-start text:style-name="Index_20_Link" />
      <text:index-entry-chapter />
      <text:index-entry-text />
      <text:index-entry-tab-stop style:leader-char="."
				 style:type="right" />
      <text:index-entry-page-number />
      <text:index-entry-link-end />
    </text:table-of-content-entry-template>
    <text:table-of-content-entry-template text:style-name="Contents_20_2"
					  text:outline-level="2">
      <text:index-entry-link-start text:style-name="Index_20_Link" />
      <text:index-entry-chapter />
      <text:index-entry-text />
      <text:index-entry-tab-stop style:leader-char="."
				 style:type="right" />
      <text:index-entry-page-number />
      <text:index-entry-link-end />
    </text:table-of-content-entry-template>

    <!-- snipped -->
    <text:index-source-styles text:outline-level="1">
      <text:index-source-style text:style-name="Heading_20_1" />
    </text:index-source-styles>
    <text:index-source-styles text:outline-level="2">
      <text:index-source-style text:style-name="Heading_20_2" />
    </text:index-source-styles>
    <text:index-source-styles text:outline-level="3">
      <text:index-source-style text:style-name="Heading_20_3" />
    </text:index-source-styles>
  </text:table-of-content-source>
  <text:index-body>
    <text:index-title text:style-name="OrgIndexSection"
                      text:name="Table of Contents1_Head">
      <text:p text:style-name="Contents_20_Heading">Table of
      Contents</text:p>
    </text:index-title>
    <text:p text:style-name="Contents_20_1">
      <text:a xlink:href="#org2dbeb53"
              xlink:type="simple">1. Align all paragraphs to the
      Right</text:a>
    </text:p>
    <!-- snipped -->
  </text:index-body>
</text:table-of-content>
Comment 4 Jambunathan K 2022-05-24 10:44:02 UTC
Created attachment 180330 [details]
Contents 1 is right aligned
Comment 5 Dieter 2022-06-06 10:30:32 UTC
I confirm the behaviour with

Version: 7.3.4.1 (x64) / LibreOffice Community
Build ID: 13668373362b52f6e3ebcaaecb031bd59a3ac66b
CPU threads: 4; OS: Windows 10.0 Build 19044; UI render: Skia/Raster; VCL: win
Locale: de-DE (de_DE); UI: en-GB
Calc: CL

How to solve the problem
1. Edit Index => Enries
2. In structure click on "T" and deselect "Align right" -> O.K.

I'm not sure for 100%, if this is the correct behaviour (for me it is not) or a bug. Help [1] isn't helpful here.

But in a right aligned paragraph, there shouldn't be a different, if tab stop is aligned right or not.

[1] https://help.libreoffice.org/7.3/en-GB/text/swriter/01/04120221.html?&DbPAR=WRITER&System=WIN