In SwXStyle::setAllPropertiesToDefault() at:
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.
I can give it a try
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.
Panos committed a patch related to this issue.
It has been pushed to "master":
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:
Affected users are encouraged to test the fix and report feedback.