diff options
author | Miklos Vajna <vmiklos@collabora.co.uk> | 2015-06-08 07:48:42 +0200 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.co.uk> | 2015-06-09 09:50:04 +0200 |
commit | 233a52af646f73a9ef0d53dd27f2823e8c362728 (patch) | |
tree | 0565fb53965664d89155c194cc9355daf6468a18 /writerfilter/source | |
parent | 09cc096f63f39cb6233328653a2778d094e70d31 (diff) |
tdf#82553 DOCX import: handle table margin when converting floattables
Change-Id: I7a3a233a34453153b3e1c0fe3d60bb0ede65dc86
(cherry picked from commit 292ec5fe8d01af6119325f1a426422bb42e58615)
Diffstat (limited to 'writerfilter/source')
-rw-r--r-- | writerfilter/source/dmapper/PropertyMap.cxx | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/writerfilter/source/dmapper/PropertyMap.cxx b/writerfilter/source/dmapper/PropertyMap.cxx index dcf4f3bd349b..b9f46ff8039b 100644 --- a/writerfilter/source/dmapper/PropertyMap.cxx +++ b/writerfilter/source/dmapper/PropertyMap.cxx @@ -1029,6 +1029,16 @@ void SectionPropertyMap::CloseSectionGroup( DomainMapper_Impl& rDM_Impl ) for (size_t i = 0; i < rPendingFloatingTables.size(); ++i) { FloatingTableInfo& rInfo = rPendingFloatingTables[i]; + + // Count the layout width of the table. + sal_Int32 nTableWidth = rInfo.m_nTableWidth; + sal_Int32 nLeftMargin = 0; + if (rInfo.getPropertyValue("LeftMargin") >>= nLeftMargin) + nTableWidth += nLeftMargin; + sal_Int32 nRightMargin = 0; + if (rInfo.getPropertyValue("RightMargin") >>= nRightMargin) + nTableWidth += nRightMargin; + // If the table is wider than the text area, then don't create a fly // for the table: no wrapping will be performed anyway, but multi-page // tables will be broken. @@ -1037,7 +1047,7 @@ void SectionPropertyMap::CloseSectionGroup( DomainMapper_Impl& rDM_Impl ) // If there are columns, always create the fly, otherwise the columns would // restrict geometry of the table. if ( ( rInfo.getPropertyValue("HoriOrientRelation") == text::RelOrientation::PAGE_FRAME ) || - ( rInfo.m_nTableWidth < nTextAreaWidth ) || ColumnCount() + 1 >= 2 ) + nTableWidth < nTextAreaWidth || ColumnCount() + 1 >= 2 ) xBodyText->convertToTextFrame(rInfo.m_xStart, rInfo.m_xEnd, rInfo.m_aFrameProperties); } rPendingFloatingTables.clear(); |