diff options
author | Jian Fang Zhang <zhangjf@apache.org> | 2012-09-12 11:19:10 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2013-05-31 13:58:08 +0100 |
commit | 0181f258e5598ee59b1c4847818944b8da16bd51 (patch) | |
tree | 36a8dae21eb74c0981d167407c81acd4cde40fcc /writerfilter | |
parent | 0f33ad3847da22350e69fd998d7494e4334c1ed9 (diff) |
Resolves: #i119558# set default page mode value to false for docx
To avoid default page mode affect the calculation of table row height
Found by: xiao ting xiao, tingxiaox@gmail.com
Patch by: zhaoshzh, aoo.zhaoshzh@gmail.com
Review by: zhangjf
(cherry picked from commit 28e1cb1240e7c7a274a04756c7cab2f5797de400)
Conflicts:
sw/inc/unomap.hxx
sw/inc/unoprnms.hxx
sw/source/core/unocore/unomap.cxx
sw/source/core/unocore/unoprnms.cxx
sw/source/ui/uno/unotxdoc.cxx
writerfilter/source/dmapper/PropertyIds.cxx
Change-Id: I41745eb9d727a5ae87d34872f9dc3f4442c7bc8d
Diffstat (limited to 'writerfilter')
-rw-r--r-- | writerfilter/source/dmapper/PropertyIds.cxx | 1 | ||||
-rw-r--r-- | writerfilter/source/dmapper/PropertyIds.hxx | 1 | ||||
-rw-r--r-- | writerfilter/source/dmapper/PropertyMap.cxx | 26 |
3 files changed, 15 insertions, 13 deletions
diff --git a/writerfilter/source/dmapper/PropertyIds.cxx b/writerfilter/source/dmapper/PropertyIds.cxx index 86438b9a6fc3..e506ee83ab91 100644 --- a/writerfilter/source/dmapper/PropertyIds.cxx +++ b/writerfilter/source/dmapper/PropertyIds.cxx @@ -228,6 +228,7 @@ const OUString& PropertyNameSupplier::GetName( PropertyIds eId ) const case PROP_GRID_LINES : sName = "GridLines"; break; case PROP_GRID_BASE_HEIGHT : sName = "GridBaseHeight"; break; case PROP_GRID_RUBY_HEIGHT : sName = "GridRubyHeight"; break; + case PROP_GRID_STANDARD_MODE : sName = "StandardPageMode"; break; case PROP_IS_ON : sName = "IsOn"; break; case PROP_RESTART_AT_EACH_PAGE : sName = "RestartAtEachPage"; break; case PROP_COUNT_EMPTY_LINES : sName = "CountEmptyLines"; break; diff --git a/writerfilter/source/dmapper/PropertyIds.hxx b/writerfilter/source/dmapper/PropertyIds.hxx index 3467321903a9..1c6b83e3a243 100644 --- a/writerfilter/source/dmapper/PropertyIds.hxx +++ b/writerfilter/source/dmapper/PropertyIds.hxx @@ -276,6 +276,7 @@ enum PropertyIds ,PROP_USER_DATA_TYPE ,PROP_VERTICAL_MERGE ,PROP_VERT_MIRRORED +/*254*/ ,PROP_GRID_STANDARD_MODE ,PROP_VERT_ORIENT ,PROP_VERT_ORIENT_POSITION ,PROP_VERT_ORIENT_RELATION diff --git a/writerfilter/source/dmapper/PropertyMap.cxx b/writerfilter/source/dmapper/PropertyMap.cxx index 9de69fce6568..ebd54970810c 100644 --- a/writerfilter/source/dmapper/PropertyMap.cxx +++ b/writerfilter/source/dmapper/PropertyMap.cxx @@ -990,21 +990,21 @@ void SectionPropertyMap::CloseSectionGroup( DomainMapper_Impl& rDM_Impl ) nRubyHeight = 0; operator[]( PropertyDefinition( PROP_GRID_RUBY_HEIGHT, false )) = uno::makeAny( nRubyHeight ); - sal_Int16 nGridMode = text::TextGridMode::NONE; - - switch (m_nGridType) + // #i119558#, force to set document as standard page mode, + // refer to ww8 import process function "SwWW8ImplReader::SetDocumentGrid" + try { - case NS_ooxml::LN_Value_wordprocessingml_ST_DocGrid_lines: - nGridMode = text::TextGridMode::LINES; - break; - case NS_ooxml::LN_Value_wordprocessingml_ST_DocGrid_linesAndChars: - nGridMode = text::TextGridMode::LINES_AND_CHARS; - break; - default: - break; + uno::Reference< beans::XPropertySet > xDocProperties; + xDocProperties = uno::Reference< beans::XPropertySet >( rDM_Impl.GetTextDocument(), uno::UNO_QUERY_THROW ); + sal_Bool bSquaredPageMode = sal_False; + operator[]( PropertyDefinition( PROP_GRID_STANDARD_MODE, false )) = uno::makeAny( !bSquaredPageMode ); + xDocProperties->setPropertyValue( OUString("DefaultPageMode"), uno::makeAny( bSquaredPageMode )); + } + catch (const uno::Exception& rEx) + { + OSL_ENSURE( false, "Exception in SectionPropertyMap::CloseSectionGroup"); + (void)rEx; } - - operator[](PropertyDefinition(PROP_GRID_MODE, false)) = uno::makeAny(nGridMode); if (rDM_Impl.IsNewDoc()) _ApplyProperties( xFollowPageStyle ); |