summaryrefslogtreecommitdiff
path: root/writerfilter
diff options
context:
space:
mode:
authorMark Hung <marklh9@gmail.com>2017-04-23 13:41:32 +0800
committerMark Hung <marklh9@gmail.com>2017-04-24 15:53:34 +0200
commit6030e8f5a42d48a43076bf1e2ddc88b20242e6da (patch)
tree08bdab352e4fd91be281c9b10ce8d220607ea454 /writerfilter
parent80486db4b691e9b716840438422b9001573d2a90 (diff)
tdf107359: imporve line pitch and char pitch importing of writerfilter.
1. Use converted style name to assure the default style is found. 2. Switch off squared-page mode before setting the base text width and height. 3. Ruby text height is not effective per ODF spec. Change-Id: I0f2901a453a9f7b344cac6989780688cc2d6c7b4 Reviewed-on: https://gerrit.libreoffice.org/36828 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Mark Hung <marklh9@gmail.com>
Diffstat (limited to 'writerfilter')
-rw-r--r--writerfilter/source/dmapper/PropertyIds.cxx1
-rw-r--r--writerfilter/source/dmapper/PropertyIds.hxx1
-rw-r--r--writerfilter/source/dmapper/PropertyMap.cxx12
3 files changed, 7 insertions, 7 deletions
diff --git a/writerfilter/source/dmapper/PropertyIds.cxx b/writerfilter/source/dmapper/PropertyIds.cxx
index 9182ac48b3f9..e109ca15d0c6 100644
--- a/writerfilter/source/dmapper/PropertyIds.cxx
+++ b/writerfilter/source/dmapper/PropertyIds.cxx
@@ -196,6 +196,7 @@ OUString getPropertyName( PropertyIds eId )
case PROP_GRID_PRINT : sName = "GridPrint"; break;
case PROP_GRID_LINES : sName = "GridLines"; break;
case PROP_GRID_BASE_HEIGHT : sName = "GridBaseHeight"; break;
+ case PROP_GRID_BASE_WIDTH : sName = "GridBaseWidth"; break;
case PROP_GRID_RUBY_HEIGHT : sName = "GridRubyHeight"; break;
case PROP_GRID_STANDARD_MODE : sName = "StandardPageMode"; break;
case PROP_IS_ON : sName = "IsOn"; break;
diff --git a/writerfilter/source/dmapper/PropertyIds.hxx b/writerfilter/source/dmapper/PropertyIds.hxx
index 4bf8bf84c6ce..911667e9dd09 100644
--- a/writerfilter/source/dmapper/PropertyIds.hxx
+++ b/writerfilter/source/dmapper/PropertyIds.hxx
@@ -134,6 +134,7 @@ enum PropertyIds
,PROP_GRAPHIC
,PROP_GRAPHIC_COLOR_MODE
,PROP_GRID_BASE_HEIGHT
+ ,PROP_GRID_BASE_WIDTH
,PROP_GRID_DISPLAY
,PROP_GRID_LINES
,PROP_GRID_MODE
diff --git a/writerfilter/source/dmapper/PropertyMap.cxx b/writerfilter/source/dmapper/PropertyMap.cxx
index 6dd001acc3bb..8c81f7fb0ecb 100644
--- a/writerfilter/source/dmapper/PropertyMap.cxx
+++ b/writerfilter/source/dmapper/PropertyMap.cxx
@@ -1258,8 +1258,7 @@ void SectionPropertyMap::CloseSectionGroup( DomainMapper_Impl& rDM_Impl )
}
sal_Int32 nCharWidth = 423; //240 twip/ 12 pt
- //todo: is '0' the right index here?
- const StyleSheetEntryPtr pEntry = rDM_Impl.GetStyleSheetTable()->FindStyleSheetByISTD( OUString::number( 0, 16 ) );
+ const StyleSheetEntryPtr pEntry = rDM_Impl.GetStyleSheetTable()->FindStyleSheetByConvertedStyleName( "Standard" );
if ( pEntry.get() )
{
boost::optional< PropertyMap::Property > pPropHeight = pEntry->pProperties->getProperty( PROP_CHAR_HEIGHT_ASIAN );
@@ -1284,11 +1283,6 @@ void SectionPropertyMap::CloseSectionGroup( DomainMapper_Impl& rDM_Impl )
nFraction = (nFraction * 20) / 0xFFF;
nCharWidth += ConversionHelper::convertTwipToMM100( nFraction );
}
- Insert( PROP_GRID_BASE_HEIGHT, uno::makeAny( nCharWidth ) );
- sal_Int32 nRubyHeight = nGridLinePitch - nCharWidth;
- if ( nRubyHeight < 0 )
- nRubyHeight = 0;
- Insert( PROP_GRID_RUBY_HEIGHT, uno::makeAny( nRubyHeight ) );
if ( m_nPageNumberType >= 0 )
Insert( PROP_NUMBERING_TYPE, uno::makeAny( m_nPageNumberType ) );
@@ -1309,6 +1303,10 @@ void SectionPropertyMap::CloseSectionGroup( DomainMapper_Impl& rDM_Impl )
(void)rEx;
}
+ Insert( PROP_GRID_BASE_HEIGHT, uno::makeAny( nGridLinePitch ) );
+ Insert( PROP_GRID_BASE_WIDTH, uno::makeAny( nCharWidth ) );
+ Insert( PROP_GRID_RUBY_HEIGHT, uno::makeAny( sal_Int32( 0 ) ) );
+
if ( rDM_Impl.IsNewDoc() )
ApplyProperties_( xFollowPageStyle );