If my document has a page border and I create a table then save the document as a docx file, when I open the docx file, I can see slight increase in table widths. If I save that file again (as docx) table width increases again and again without ever doing anything new to that file myself. This doesn't happen if I save to odt file or remove page-border. steps to reproduce: 1- Create a new document and define a page border. 2- Create a table. 3- Save the document as a docx file. 4- Open the docx file and see the difference. 5- You can redo the 4th step over and over and you can see that it increases every time. I can only confirm this bug on my Linux Mint 64-bit machine. I don't have Windows and do not know if this is present on other platforms.
I can't confirm this under Win10. Can you add an attachment?
Created attachment 135901 [details] docx file and screenshots Here's the docx file. If I open this and save it, after opening it up again there's an increase. If I keep doing it the width increases continuously. 3 screen-shots of this problem are provided.
I could reproduce it only with your document. What I could find out is, that not the size of the tabls changed, but the size of the margins in your document every margin has the size of 2,40 cm save as docx and reopen in LO => size of 2,49 cm save as docx and reopen in LO => size of 2,59 cm I delated the table, but the size of the margin still changed. So my suggestion is to change the summry of this bug to: "Size of margin changes when saving as docx". What do you think? I haven't checked, if this bug is already known.
You are right the problem is margins! Could you attach a docx file created with your machine (1 with LibreOffice and 1 with ms-word if you have it) to see if it's just my docx file or it's a problem with my installation or something. The culprit might be something I've done to my default style. If it is just my docx file then I probably should delete this bug because it can't be reproduced in normal situations. But to be sure I have to check other docx files created with other machines.
I found some bugs, that seem to be similar: 89628 94009 95374.
(In reply to Dieter Praas from comment #5) > I found some bugs, that seem to be similar: 89628 94009 95374. I meant 89621 instead of 89628
(In reply to Dieter Praas from comment #6) > (In reply to Dieter Praas from comment #5) > > I found some bugs, that seem to be similar: 89628 94009 95374. > > I meant 89621 instead of 89628 94009 is very similar but in a different situation. Mine only happens when I use page-border. 95374 could be the same thing but I couldn't reproduce it. And 89621 isn't very much related to this. And again none of them mention page-border. So I changed my summery to include page-border again and removed 89621 from list.
I forgot the page border in my own test-document. With page borders I can confirm this bug.
(In reply to Dieter Praas from comment #8) > I forgot the page border in my own test-document. With page borders I can > confirm this bug. If you can confirm it on windows or any other machine you can change Hardware values.
*** Bug 116247 has been marked as a duplicate of this bug. ***
Simpler repro steps as described in duplicate bug 116247: Add borders to an empty page, and save it in DOC or DOCX format, then reopen the document. => Margin is changed (eg. default 2 cm is changed to 2.05 cm). Attaching a sample with varied margins: 1.5 / 2.5 / 1 / 3 cm (left / right / top / bottom). When saving in DOC format the margins become: 1.51 / 2.51 / 1.01 / 3.01 cm. When saving in DOCX format the margins become: 1.55 / 2.55 / 1.05 / 3.05 cm.
Created attachment 140583 [details] Sample ODT Attaching a sample with somewhat more exotic settings than in bug 116247, with varying margin, padding and border width.
https://gerrit.libreoffice.org/51267 is the DOCX part. Please note that there are fundamental difference in document models between ODF and MS formats, that disallows from fully preserving the border/margin sizes/distances. Partly (!) it's discussed at https://wiki.openoffice.org/wiki/Writer/MSInteroperability/PageBorder. MS Word only allows one to have page borders to have offset no more than 31 pt (~1.1 cm) from either page edge, or page text, while ODF allows for any offset value (so, MS Word cannot display correctly borders placed outside of the mentioned limits); note that this is Word limitation, not of OOXML. OTOH, ODT doesn't allow for placing border outside of the page, or inside of text area (which Word allows). MS formats only can have integer pt size as border offset, and 1/8 pt as border width (0.25 pt minimum). So, given that ODF allows for much more precise control over the sizes, not every size valid for ODF could be saved intact to MS formats, and so on round-trip, sizes may arrive changed a little. The patch takes care to preserve size from page edge to text (the most important size that affects document layout). This should be done correctly now. Also, it positions borders properly on import, taking into account the border width, in all cases supported by ODF (when border is inside ODF page margin). When borders go outside of range valid for ODF, the margin is set to keep text area intact, and the border is placed as close to intended position as possible. Export code now also handles border width (which it didn't); also it improves the logic in cases when borders in document are outside of ranges possible for Word. Note that we write correct sizes to OOXML, so that when reopened by LO, the borders will be in correct places; but as Word cannot handle sizes more than 31 pt, it will show borders shifted. To test the change, you may create a sample text document in Writer with all margins 4 cm, and borders 6 pt wide padded by 2 cm; and another one with all margins 2 cm, and border padding 4 cm; and compare the results of export in Word.
Mike Kaganski committed a patch related to this issue. It has been pushed to "master": http://cgit.freedesktop.org/libreoffice/core/commit/?id=fb959e581c900b392efd0bb329b7cf30c8ed56a5 tdf#112118: DOCX: properly import/export border distance It will be available in 6.1.0. The patch should be included in the daily builds available at http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: http://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback.
https://gerrit.libreoffice.org/51366 is the DOC part.
Mike Kaganski committed a patch related to this issue. It has been pushed to "master": http://cgit.freedesktop.org/libreoffice/core/commit/?id=8805e10f5887df66edfd0a2fa4b70e87f0c74700 tdf#112118: DOC: properly import/export border distance It will be available in 6.1.0. The patch should be included in the daily builds available at http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: http://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback.
Have one problem with the fixes pushed (when saving from ODT, margins now dectease - unlike when roundtripping from DOC(X)); working on that
https://gerrit.libreoffice.org/51474 The description in comment 17 is incorrect. The pushed commits are fine; just since they ensure that export of margins to DOC(X) is correct, it became apparent that we had a longstanding (at least since 2000: it's already there in commit 7b0b5cdf) import bug with margin width calculations, which only shows up when left and right border distances/widths are not the same. The left and right were simply switched in the code, which is fixed now in this patch. Thanks Aron for pointing this out!
Mike Kaganski committed a patch related to this issue. It has been pushed to "master": http://cgit.freedesktop.org/libreoffice/core/commit/?id=45f1b733e0f736f4db677ba1fd17695ac1009c9f tdf#112118: use correct border when calculating margin It will be available in 6.1.0. The patch should be included in the daily builds available at http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: http://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback.
VERIFIED with Version: 6.3.2.2 (x64) Build-ID: 98b30e735bda24bc04ab42594c85f7fd8be07b9c CPU-Threads: 4; BS: Windows 10.0; UI-Render: GL; VCL: win; Gebietsschema: de-DE (de_DE); UI-Sprache: de-DE Calc: threaded