Bug 146740 - "Resetting to parent" doesn't work for paragraph style's indents
Summary: "Resetting to parent" doesn't work for paragraph style's indents
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
Inherited From OOo
Hardware: All All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: Writer-Styles-Paragraph Styles-Dialog
  Show dependency treegraph
 
Reported: 2022-01-13 14:52 UTC by Mike Kaganski
Modified: 2023-12-14 10:30 UTC (History)
1 user (show)

See Also:
Crash report or crash signature:


Attachments
A file with modified Default style, and several Heading N paragraphs (9.43 KB, application/vnd.oasis.opendocument.text)
2022-01-13 14:52 UTC, Mike Kaganski
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Mike Kaganski 2022-01-13 14:52:43 UTC
Created attachment 177524 [details]
A file with modified Default style, and several Heading N paragraphs

In the attached document, edit Heading 2 style (e.g., right-click paragraph "2" and choose Paragraph->Edit Style). Go to dialog's Indents and Spacing tab. Press "Reset to Parent" button (in older versions, it was "Standard"). See that Indent Before text changes from 0 to 2 cm (because this is what defined at Default paragraph style in the document). Press OK.

The paragraph 2 stays not indented. Opening the style's properties dialog again shows that the indent is still 0.

Repro using Version: 7.4.0.0.alpha0+ (x64) / LibreOffice Community
Build ID: 840b4eb2f3443ff883016e6a8a8ae49e9cbd9e4e
CPU threads: 12; OS: Windows 10.0 Build 19044; UI render: Skia/Raster; VCL: win
Locale: ru-RU (ru_RU); UI: en-US
Calc: CL

and also using OOo 3.2.0.
Comment 1 Dieter 2022-01-28 07:47:35 UTC
I confirm it with

Version: 7.4.0.0.alpha0+ (x64) / LibreOffice Community
Build ID: e27a41a362bf25e12487b36f625985b35fb891e3
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

perhaps duplicate of bug118225?
Comment 2 Andreas Heinisch 2023-12-01 12:34:59 UTC
"Reset to Parent" calls function BaseFmtHdl which calls function Reset of the corresponding tab. There it does not distinguish between a FIRST call of a tab (changes ARE already applied) and a "Reset to parent" (changes ARE NOT applied). So this error does affect all dialogs using tabs using the "Reset" and "Reset to Parent" functionality if the ChangesApplied function is called in the reset function.
Comment 3 Andreas Heinisch 2023-12-01 13:30:45 UTC
A simple bad fix would be just to remove the ChangesApplied function in [1] in the SvxStdParagraphTabPage::Reset function leading to obsolete get_state_changed_from_saved calls in FillItemSet until the changes are applied.

Other solutions would include some flag in the reset page or creating and calling a new function for "Reset To Parent" of the page being called.

Mike what do you think?

[1] https://opengrok.libreoffice.org/xref/core/cui/source/tabpages/paragrph.cxx?r=5af2041c#830
Comment 4 Mike Kaganski 2023-12-01 14:17:35 UTC
(In reply to Andreas Heinisch from comment #3)

Sorry, I would need to dive deep to get the idea - could we please have a call maybe, where you could give me the necessary context? You could join IRC, and we could arrange a time convenient to you?

Thank you very much for working on this!
Comment 5 Andreas Heinisch 2023-12-01 16:00:08 UTC
Hi Mike, thank you very much for the help. I have time next week and I will join IRC for the details. Thank you.
Comment 6 Andreas Heinisch 2023-12-14 10:30:58 UTC
So the problem lies way deeper than missing ranges in the dialog. The reset to parent functions in the dialog but does not get reflected in the paragraph (check the style inspector). As Mike mentioned it could be that the change in [1] caused the problem.

[1] https://gerrit.libreoffice.org/c/core/+/147023