From b7c8c337d4ffad55fe111c9634c4c04afce78bad Mon Sep 17 00:00:00 2001 From: Mark Hung Date: Thu, 14 May 2015 23:02:21 +0800 Subject: [PATCH] tdf#91261: DOCX import: snapGrid property of paragraphs are ignored Fix the situation for OOXML import filter: a) While handling DocGrid type, SnapToChars was treated as None. Now it is implemented as described in the article: http://linpeifeng.blogspot.tw/2007/02/text-grid-enhancement.html Both LinesAndChars and SnapToChars will be translated to Writer grid type "lines and characters", and set SnapToGrid property to false or true accordingly. b) All the imported paragraphs snap to grid because SnapToGrid was appended to grabbag, now it allows SnapToGrid property in paragraph and paragraph styles to be imported properly. Change-Id: I446b4c64c0ed86960896bcd61a1006c9173a757a Reviewed-on: https://gerrit.libreoffice.org/15732 Reviewed-by: Michael Stahl Tested-by: Michael Stahl --- sw/qa/extras/ooxmlexport/data/tdf91261.docx | Bin 0 -> 22081 bytes sw/qa/extras/ooxmlexport/ooxmlexport.cxx | 19 +++++++++++++++++ writerfilter/source/dmapper/DomainMapper.cxx | 21 ++++++++++++++----- writerfilter/source/dmapper/PropertyIds.cxx | 2 ++ writerfilter/source/dmapper/PropertyIds.hxx | 2 ++ writerfilter/source/dmapper/PropertyMap.cxx | 5 +++++ writerfilter/source/dmapper/PropertyMap.hxx | 2 ++ 7 files changed, 46 insertions(+), 5 deletions(-) create mode 100644 sw/qa/extras/ooxmlexport/data/tdf91261.docx diff --git a/sw/qa/extras/ooxmlexport/data/tdf91261.docx b/sw/qa/extras/ooxmlexport/data/tdf91261.docx new file mode 100644 index 0000000000000000000000000000000000000000..6edb8b8755d7fb97c0d9732d2d2d821a1ba38ae2 GIT binary patch literal 22081 zcmeF3bDw0*w&%;XUDajVwz_PaUAB!b+qP}nw#_aZU7YIY%sKbDbI;7YfP42JnL9rj z8GFTwSo`guGx=L=g z#tz!Fu2z-=c_2XKIRHRk<^SjSZ|s4FL}{CKdYIrV;75EIZE(#KxPJP9liaf?O+Vw6 zsxsl>zI)J6^K>7+F`0;phrJ3>S}@DdtGh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?UDQk zY=%M7DLi=Q1sCJ|?P0)3tpO%5poe3P22A^ewe0B!9 zcJxyh5ZV)fXCZ;LBb~v3t{Z(xHA446RV3Z;1=i^L(HG|;^lw*(>PKIyi*5w^swadI z3-zEzAg_T!*N(nc0ij*X7^WTD$^~?D&?f^B<_OxLm;)+?(KVy?_z_we7&2WLka~WQ z^oZL3M>h+#--v8hz8kVxsJ%#ZQ_y=)2y@oEL%ov*JpL5kmqOQ%+CE0;2F{jvF)(1X zmeIANHg1r$_xqrG0^HO=HvqlyfH0!K7wUerrUbePs8uOKKLf)OKO`SOE7kySR^S?Q QP)kgh;X1I~2?+%807S+5A^-pY literal 0 HcmV?d00001 diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport.cxx index 948d3fbaf6d5..ba7715ba4abc 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlexport.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlexport.cxx @@ -676,6 +676,25 @@ DECLARE_OOXMLEXPORT_TEST(testTdf89791, "tdf89791.docx") } } +DECLARE_OOXMLEXPORT_TEST(testTdf91261, "tdf91261.docx") +{ + bool snapToGrid = true; + uno::Reference< text::XTextRange > xPara = getParagraph( 2 ); + uno::Reference< beans::XPropertySet > properties( xPara, uno::UNO_QUERY); + properties->getPropertyValue("SnapToGrid") >>= snapToGrid ; + CPPUNIT_ASSERT_EQUAL(false, snapToGrid); + + uno::Reference< beans::XPropertySet> xStyle(getStyles("PageStyles")->getByName("Standard"), uno::UNO_QUERY); + sal_Int16 nGridMode; + xStyle->getPropertyValue("GridMode") >>= nGridMode; + CPPUNIT_ASSERT_EQUAL( sal_Int16(2), nGridMode); + + bool bGridSnapToChars; + xStyle->getPropertyValue("GridSnapToChars") >>= bGridSnapToChars; + CPPUNIT_ASSERT_EQUAL(true, bGridSnapToChars); + +} + CPPUNIT_PLUGIN_IMPLEMENT(); /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/writerfilter/source/dmapper/DomainMapper.cxx b/writerfilter/source/dmapper/DomainMapper.cxx index abe1069c8885..5542cca364e3 100644 --- a/writerfilter/source/dmapper/DomainMapper.cxx +++ b/writerfilter/source/dmapper/DomainMapper.cxx @@ -934,14 +934,18 @@ void DomainMapper::lcl_attribute(Id nName, Value & val) switch( nIntValue ) { case NS_ooxml::LN_Value_doc_ST_DocGrid_default: - case NS_ooxml::LN_Value_doc_ST_DocGrid_snapToChars: - pSectionContext->SetGridType( 0 ); + pSectionContext->SetGridType(text::TextGridMode::NONE); break; case NS_ooxml::LN_Value_doc_ST_DocGrid_lines: - pSectionContext->SetGridType( 1 ); + pSectionContext->SetGridType(text::TextGridMode::LINES); break; case NS_ooxml::LN_Value_doc_ST_DocGrid_linesAndChars: - pSectionContext->SetGridType( 2 ); + pSectionContext->SetGridType(text::TextGridMode::LINES_AND_CHARS); + pSectionContext->SetGridSnapToChars( false ); + break; + case NS_ooxml::LN_Value_doc_ST_DocGrid_snapToChars: + pSectionContext->SetGridType(text::TextGridMode::LINES_AND_CHARS); + pSectionContext->SetGridSnapToChars( true ); break; default : OSL_FAIL("unknown SwTextGrid value"); @@ -2005,7 +2009,14 @@ void DomainMapper::sprmWithProps( Sprm& rSprm, PropertyMapPtr rContext ) break; case NS_ooxml::LN_CT_PPrBase_snapToGrid: - m_pImpl->appendGrabBag(m_pImpl->m_aInteropGrabBag, "snapToGrid", OUString::number(nIntValue)); + if (!IsStyleSheetImport()||!m_pImpl->isInteropGrabBagEnabled()) + { + rContext->Insert( PROP_SNAP_TO_GRID, uno::makeAny(bool(nIntValue))); + } + else + { + m_pImpl->appendGrabBag(m_pImpl->m_aInteropGrabBag, "snapToGrid", OUString::number(nIntValue)); + } break; case NS_ooxml::LN_CT_PPrBase_pStyle: { diff --git a/writerfilter/source/dmapper/PropertyIds.cxx b/writerfilter/source/dmapper/PropertyIds.cxx index 5506322c857c..059a5808a4a8 100644 --- a/writerfilter/source/dmapper/PropertyIds.cxx +++ b/writerfilter/source/dmapper/PropertyIds.cxx @@ -403,6 +403,8 @@ OUString PropertyNameSupplier::GetName( PropertyIds eId ) const case PROP_FOLLOW_TEXT_FLOW: sName = "IsFollowingTextFlow"; break; case PROP_FILL_STYLE: sName = "FillStyle"; break; case PROP_FILL_COLOR: sName = "FillColor"; break; + case PROP_SNAP_TO_GRID: sName = "SnapToGrid"; break; + case PROP_GRID_SNAP_TO_CHARS: sName = "GridSnapToChars"; break; } ::std::pair aInsertIt = m_pImpl->aNameMap.insert( PropertyNameMap_t::value_type( eId, sName )); diff --git a/writerfilter/source/dmapper/PropertyIds.hxx b/writerfilter/source/dmapper/PropertyIds.hxx index 51b27320cc3a..956e6f8adf25 100644 --- a/writerfilter/source/dmapper/PropertyIds.hxx +++ b/writerfilter/source/dmapper/PropertyIds.hxx @@ -377,6 +377,8 @@ enum PropertyIds ,PROP_FOLLOW_TEXT_FLOW ,PROP_FILL_STYLE ,PROP_FILL_COLOR + ,PROP_SNAP_TO_GRID + ,PROP_GRID_SNAP_TO_CHARS }; struct PropertyNameSupplier_Impl; class PropertyNameSupplier diff --git a/writerfilter/source/dmapper/PropertyMap.cxx b/writerfilter/source/dmapper/PropertyMap.cxx index f2f49b1ddc1c..dcf4f3bd349b 100644 --- a/writerfilter/source/dmapper/PropertyMap.cxx +++ b/writerfilter/source/dmapper/PropertyMap.cxx @@ -427,6 +427,7 @@ SectionPropertyMap::SectionPropertyMap(bool bIsFirstSection) : ,m_nGridType(0) ,m_nGridLinePitch( 1 ) ,m_nDxtCharSpace( 0 ) + ,m_bGridSnapToChars(true) ,m_nLnnMod( 0 ) ,m_nLnc( 0 ) ,m_ndxaLnn( 0 ) @@ -1168,6 +1169,10 @@ void SectionPropertyMap::CloseSectionGroup( DomainMapper_Impl& rDM_Impl ) // PROP_GRID_MODE Insert( PROP_GRID_MODE, uno::makeAny( static_cast (m_nGridType) )); + if (m_nGridType == text::TextGridMode::LINES_AND_CHARS) + { + Insert( PROP_GRID_SNAP_TO_CHARS, uno::makeAny(m_bGridSnapToChars)); + } sal_Int32 nCharWidth = 423; //240 twip/ 12 pt //todo: is '0' the right index here? diff --git a/writerfilter/source/dmapper/PropertyMap.hxx b/writerfilter/source/dmapper/PropertyMap.hxx index 55c7ceccb5aa..79b1f640b1bc 100644 --- a/writerfilter/source/dmapper/PropertyMap.hxx +++ b/writerfilter/source/dmapper/PropertyMap.hxx @@ -230,6 +230,7 @@ class SectionPropertyMap : public PropertyMap sal_Int32 m_nGridType; sal_Int32 m_nGridLinePitch; sal_Int32 m_nDxtCharSpace; + bool m_bGridSnapToChars; //line numbering sal_Int32 m_nLnnMod; @@ -312,6 +313,7 @@ public: void SetGridType(sal_Int32 nSet) { m_nGridType = nSet; } void SetGridLinePitch( sal_Int32 nSet ) { m_nGridLinePitch = nSet; } + void SetGridSnapToChars( bool bSet) { m_bGridSnapToChars = bSet; } void SetDxtCharSpace( sal_Int32 nSet ) { m_nDxtCharSpace = nSet; } void SetLnnMod( sal_Int32 nValue ) { m_nLnnMod = nValue; }