summaryrefslogtreecommitdiff
path: root/writerfilter
diff options
context:
space:
mode:
authorMark Hung <marklm9@gmail.com>2022-06-29 21:03:35 +0800
committerXisco Fauli <xiscofauli@libreoffice.org>2022-07-07 16:59:08 +0200
commitac0ab772d93bcf3197c1c6e2191cba74eb39718a (patch)
tree59d4093bd00aa70d60b49c525cc6012b8ddab2ba /writerfilter
parent25d0b479406574d318de89ad6252d35cc2ca2884 (diff)
tdf#149089 fallback GridMode.
If line pitch is not defined -> fallback to none. Otherwise if charSpace is not defined -> fallback to lines. Change-Id: I1df027f2e74baf0215567fb9a70c879522558346 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/136622 Tested-by: Jenkins Reviewed-by: Mark Hung <marklh9@gmail.com> (cherry picked from commit 23f80b26098bcf9a8ae870e8ded878cca6e0c541) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/136865 Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
Diffstat (limited to 'writerfilter')
-rw-r--r--writerfilter/source/dmapper/PropertyMap.cxx13
1 files changed, 10 insertions, 3 deletions
diff --git a/writerfilter/source/dmapper/PropertyMap.cxx b/writerfilter/source/dmapper/PropertyMap.cxx
index e1814a8ce1d5..1ae28759db33 100644
--- a/writerfilter/source/dmapper/PropertyMap.cxx
+++ b/writerfilter/source/dmapper/PropertyMap.cxx
@@ -1759,16 +1759,23 @@ void SectionPropertyMap::CloseSectionGroup( DomainMapper_Impl& rDM_Impl )
}
const sal_Int32 nGridLines = nTextAreaHeight / nGridLinePitch;
+ sal_Int16 nGridType = m_nGridType;
if ( nGridLines >= 0 && nGridLines <= SAL_MAX_INT16 )
Insert( PROP_GRID_LINES, uno::Any( sal_Int16(nGridLines) ) );
+ else
+ nGridType = text::TextGridMode::NONE;
// PROP_GRID_MODE
- Insert( PROP_GRID_MODE, uno::Any( static_cast<sal_Int16> (m_nGridType) ) );
- if ( m_nGridType == text::TextGridMode::LINES_AND_CHARS )
+ if ( nGridType == text::TextGridMode::LINES_AND_CHARS )
{
- Insert( PROP_GRID_SNAP_TO_CHARS, uno::Any( m_bGridSnapToChars ) );
+ if (!m_nDxtCharSpace)
+ nGridType = text::TextGridMode::LINES;
+ else
+ Insert( PROP_GRID_SNAP_TO_CHARS, uno::Any( m_bGridSnapToChars ) );
}
+ Insert( PROP_GRID_MODE, uno::Any( nGridType ) );
+
sal_Int32 nCharWidth = 423; //240 twip/ 12 pt
const StyleSheetEntryPtr pEntry = rDM_Impl.GetStyleSheetTable()->FindStyleSheetByConvertedStyleName( u"Standard" );
if ( pEntry )