Writer can produce documents with combinations of anchor-type and horizontal-rel that are invalid according to ODF 1.3, 20.298 style:horizontal-pos. for "page" anchor, "paragraph", "paragraph-content", "paragraph-end-margin", "paragraph-start-margin", "char" are invalid. to create such a document: 1. insert a shape (or image/frame/ole, 2 different implementations of it) 2. use context menu "Anchor->To Page" now the Properties dialog will show Page (because the actual value "Paragraph area" isn't valid) but when you save the file it actually writes "paragraph". it looks like if the anchor is FLY_AT_PAGE, the anchor frame is always going to be SwPageFrame, and there is only one difference in the layout code that i can find where things are different between the horizontal-rel values: flylay.cxx: CalcClipRect() has this: if( rH.GetHoriOrient() != text::HoriOrientation::NONE && rH.GetRelationOrient() == text::RelOrientation::PRINT_AREA ) { aRectFnSet.SetLeft( rRect, aRectFnSet.GetPrtLeft(*pClip) ); aRectFnSet.SetRight(rRect, aRectFnSet.GetPrtRight(*pClip)); } but no corresponding case for PAGE_PRINT_AREA. so i hope we might be able to easily fix this on ODF import for 3 of the 4 invalid cases.
Created attachment 163974 [details] test case for "paragraph-content" that differs in CalcClipRect
Michael Stahl committed a patch related to this issue. It has been pushed to "master": https://git.libreoffice.org/core/commit/12645900dece0a9aa0661fee796c27f672217977 tdf#135464 sw: ODT->DOCX: fix positioning of at-page shapes and frames It will be available in 7.1.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.
Michael Stahl committed a patch related to this issue. It has been pushed to "master": https://git.libreoffice.org/core/commit/1de2b0d3234462b488db54d36ebc17e2b579b0f0 tdf#135464 sw: avoid invalid combinations of HoriOrientRelation and FLY_AT_PAGE It will be available in 7.1.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.
Michael Stahl committed a patch related to this issue. It has been pushed to "libreoffice-7-0": https://git.libreoffice.org/core/commit/0de435962fc2ffbbcf3dc4a9bac13894372dfd5e tdf#135464 sw: avoid invalid combinations of HoriOrientRelation and FLY_AT_PAGE It will be available in 7.0.1. 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.
Michael Stahl committed a patch related to this issue. It has been pushed to "libreoffice-7-0": https://git.libreoffice.org/core/commit/56e1c88a7b2fc31682a239f59ec319f93ba61a25 tdf#135464 sw: ODT->DOCX: fix positioning of at-page shapes and frames It will be available in 7.0.1. 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.
*** Bug 109172 has been marked as a duplicate of this bug. ***
I guess we can close this issue now... @Michael stahl, thanks for fixing this issue!!