diff options
author | Attila Szűcs <szucs.attila3@nisz.hu> | 2020-06-29 15:55:28 +0200 |
---|---|---|
committer | László Németh <nemeth@numbertext.org> | 2020-07-15 11:55:32 +0200 |
commit | c78221a5ad98939f3fb9ca6af4a2d2d2a63ff6ee (patch) | |
tree | ee5c85ff3b0ca1eb673b4fa4f636dc81fda0d2d4 /sw/source/core/layout/fly.cxx | |
parent | 8a43bfeffab9009c9f373e883fef87af1a7b3843 (diff) |
tdf#124423 sw: fix AutoSize width frames of DOCX
Add layout compatibility option FRAME_AUTOWIDTH_WITH_MORE_PARA
to keep paragraph area width of AutoSize width frames with
more than one paragraph.
Co-authored-by: Tibor Nagy (NISZ)
Change-Id: Iab8926b6219ac92ef1ab7488bdef1d3f2b47c396
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/97425
Tested-by: László Németh <nemeth@numbertext.org>
Reviewed-by: László Németh <nemeth@numbertext.org>
Diffstat (limited to 'sw/source/core/layout/fly.cxx')
-rw-r--r-- | sw/source/core/layout/fly.cxx | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/sw/source/core/layout/fly.cxx b/sw/source/core/layout/fly.cxx index 252101334374..95fd7d8947ec 100644 --- a/sw/source/core/layout/fly.cxx +++ b/sw/source/core/layout/fly.cxx @@ -72,6 +72,7 @@ #include <bodyfrm.hxx> #include <FrameControlsManager.hxx> #include <ndtxt.hxx> +#include <officecfg/Office/Compatibility.hxx> using namespace ::com::sun::star; @@ -2516,6 +2517,12 @@ static SwTwips lcl_CalcAutoWidth( const SwLayoutFrame& rFrame ) // No autowidth defined for columned frames if ( !pFrame || pFrame->IsColumnFrame() ) return nRet; + // tdf#124423 In Microsoft compatibility mode: widen the frame to max (PagePrintArea) if it contains at least 2 paragraphs. + if (rFrame.GetFormat()->getIDocumentSettingAccess().get(DocumentSettingId::FRAME_AUTOWIDTH_WITH_MORE_PARA) && pFrame && pFrame->GetNext()) + { + const SwPageFrame* pPage = pFrame->FindPageFrame(); + return pFrame->GetUpper()->IsVertical() ? pPage->getFramePrintArea().Height() : pPage->getFramePrintArea().Width(); + } while ( pFrame ) { |