Bug 98749 - Move hardcoded/duplicated PageDesc defaults from UNO wrappers to writer core
Summary: Move hardcoded/duplicated PageDesc defaults from UNO wrappers to writer core
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
unspecified
Hardware: All All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard: target:7.2.0
Keywords: difficultyInteresting, easyHack, skillCpp, topicCleanup
Depends on:
Blocks:
 
Reported: 2016-03-18 14:57 UTC by Björn Michaelsen
Modified: 2023-03-11 07:41 UTC (History)
2 users (show)

See Also:
Crash report or crash signature:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Björn Michaelsen 2016-03-18 14:57:07 UTC
In SwXStyle::setAllPropertiesToDefault() at:

 https://github.com/LibreOffice/core/blob/eef1d712c409878678b4ffbf33e44cac6d564cc2/sw/source/core/unocore/unostyle.cxx#L2529

there are quite some defaults for PageDescs hardcoded in the UNO wrapper layer (including e.g. the 2 cm borders etc.). A cleaner approach would be to have the core objects have a functions that sets up default on initialisation or when reset and have the UNO wrapper just trigger that instead of duplicating hardcoded defaults.
Comment 1 Panos Korovesis 2021-03-23 15:10:50 UTC
I can give it a try
Comment 2 Panos Korovesis 2021-03-25 18:21:21 UTC
I submited a pathc to gerrit with a function (https://gerrit.libreoffice.org/c/core/+/113104) for some hardcoded defaults.
Feedback about whether the patch is relative with the bug objective is greatly appreciated.
Comment 3 Commit Notification 2021-03-29 20:38:31 UTC
Panos committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/6c241f991809dd9ab825baf400c6da77c1c130bd

tdf#98749 Move initialization of page defaults to writer core

It will be available in 7.2.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 4 Buovjaga 2023-03-11 07:41:53 UTC
It seems this is done, so closing.