tdf#157637 wrtw8esh: identify bMSOLayout better
This is a follow-up from tdf#170767
bMSOLayout is a distraction (of my own creation I see),
and was not entirely accurate.
While all MSO formats turn CONSIDER_WRAP_ON_OBJECT_POSITION on
(and ODT does not),
it IS a user-customizable setting in Writer - Compatibility.
So pure ODT files can have it as well.
Remove this anti-pattern from the code base:
==> re-use non-user-customizable flags instead
Change-Id: I69f42019d2819cad54f7521ac54a1bb3275f3137
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/203178
Tested-by: Jenkins
Reviewed-by: Justin Luth <jluth@mail.com>
This commit is contained in:
@@ -2698,6 +2698,7 @@ void WinwordAnchoring::SetAnchoring(const SwFrameFormat& rFormat)
|
||||
break;
|
||||
}
|
||||
|
||||
const IDocumentSettingAccess& rIDSA = rFormat.getIDocumentSettingAccess();
|
||||
mnGroupShapeBooleanProperties = 0;
|
||||
// LayoutInCell is hugely problematic if the value is false,
|
||||
// so much so that Microsoft, since DOCX compat15, ignores it and always does a layoutInCell.
|
||||
@@ -2714,9 +2715,10 @@ void WinwordAnchoring::SetAnchoring(const SwFrameFormat& rFormat)
|
||||
if (!bLayoutInCell)
|
||||
bLayoutInCell = mnYRelTo == 3 || mnXRelTo == 3;
|
||||
|
||||
// Re-using existing compat flags to determine if this comes from an MSO-formatted document.
|
||||
// If this is already MSO format, then we need to round-trip a false FollowingTextFlow value
|
||||
const bool bIsMSOLayout = rFormat.getIDocumentSettingAccess().get(
|
||||
DocumentSettingId::CONSIDER_WRAP_ON_OBJECT_POSITION);
|
||||
const bool bIsMSOLayout = rIDSA.get(DocumentSettingId::TAB_OVER_MARGIN) // <= MSO 2010
|
||||
|| rIDSA.get(DocumentSettingId::TAB_OVER_SPACING); // <= MSO 2013+
|
||||
|
||||
// For native LO: if !FollowingTextFlow and the fly is oriented to the pageMargin(0) or page(1),
|
||||
// we must write layoutInCell(false), but paragraph-oriented flies match layoutInCell placement.
|
||||
|
||||
Reference in New Issue
Block a user