From a952d1f59f4f84380b82f1eb9e550b8f69c4be5d Mon Sep 17 00:00:00 2001 From: Mike Kaganski Date: Tue, 12 Sep 2017 13:54:26 +0300 Subject: tdf#112346: take Word no-wrap limit into account also for ww8 This also makes ww8 floating-table conversion decision heuristics somewhat closer to OOXML code. Change-Id: I29ca2ebabd1758ad98e02aaf560cf2f44daec3a8 Reviewed-on: https://gerrit.libreoffice.org/42196 Tested-by: Jenkins Reviewed-by: Miklos Vajna --- writerfilter/source/dmapper/PropertyMap.cxx | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'writerfilter') diff --git a/writerfilter/source/dmapper/PropertyMap.cxx b/writerfilter/source/dmapper/PropertyMap.cxx index 6ba8e6c20084..36fd67761a4b 100644 --- a/writerfilter/source/dmapper/PropertyMap.cxx +++ b/writerfilter/source/dmapper/PropertyMap.cxx @@ -1010,6 +1010,13 @@ void SectionPropertyMap::HandleMarginsHeaderFooter( bool bFirstPage, DomainMappe bool SectionPropertyMap::FloatingTableConversion( DomainMapper_Impl& rDM_Impl, FloatingTableInfo& rInfo ) { + // This is OOXML version of the code deciding if the table needs to be + // in a floating frame. + // For ww8 code, see SwWW8ImplReader::FloatingTableConversion in + // sw/source/filter/ww8/ww8par.cxx + // The two should do the same, so if you make changes here, please check + // that the other is in sync. + // Note that this is just a list of heuristics till sw core can have a // table that is floating and can span over multiple pages at the same // time. @@ -1063,9 +1070,9 @@ bool SectionPropertyMap::FloatingTableConversion( DomainMapper_Impl& rDM_Impl, F // If the position is relative to the edge of the page, then we need to check the whole // page width to see whether text can fit next to the table. - if ( rInfo.getPropertyValue( "HoriOrientRelation" ) == text::RelOrientation::PAGE_FRAME ) + if ( nHoriOrientRelation == text::RelOrientation::PAGE_FRAME ) { - // If the table is wide enough to that no text fits next to it, then don't create a fly + // If the table is wide enough so that no text fits next to it, then don't create a fly // for the table: no wrapping will be performed anyway, but multi-page // tables will be broken. if ((nTableWidth + nMagicNumber) < (nPageWidth - std::min(GetLeftMargin(), GetRightMargin()))) -- cgit