sw/qa/extras/ooxmlexport/data/fdo73550.docx |binary sw/qa/extras/ooxmlexport/ooxmlexport.cxx | 10 +++++++++- sw/source/filter/ww8/attributeoutputbase.hxx | 2 +- sw/source/filter/ww8/docxattributeoutput.cxx | 5 +++-- sw/source/filter/ww8/docxattributeoutput.hxx | 2 +- sw/source/filter/ww8/rtfattributeoutput.cxx | 2 +- sw/source/filter/ww8/rtfattributeoutput.hxx | 2 +- sw/source/filter/ww8/wrtw8nds.cxx | 10 ++++++++-- sw/source/filter/ww8/ww8attributeoutput.hxx | 2 +- 9 files changed, 25 insertions(+), 10 deletions(-)
New commits: commit 36c5078d244e5a757d92cdc0f183ebd11712f6fc Author: Nikhil Walvekar <nikhil.walve...@synerzip.com> Date: Wed Jan 22 12:22:42 2014 +0530 fdo#73550 : Fix for files having spacing issues due to missing pPr/rPr for empty paragraphs. Change-Id: I7e73a750982a0bd57da602379ea47c8bf9c194fe Reviewed-on: https://gerrit.libreoffice.org/7587 Reviewed-by: Miklos Vajna <vmik...@collabora.co.uk> Tested-by: Miklos Vajna <vmik...@collabora.co.uk> diff --git a/sw/qa/extras/ooxmlexport/data/fdo73550.docx b/sw/qa/extras/ooxmlexport/data/fdo73550.docx new file mode 100644 index 0000000..c6b7f15 Binary files /dev/null and b/sw/qa/extras/ooxmlexport/data/fdo73550.docx differ diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport.cxx index 315fb0b..8f1982d 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlexport.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlexport.cxx @@ -2472,6 +2472,15 @@ DECLARE_OOXMLEXPORT_TEST(testMsoSpt180, "mso-spt180.docx") CPPUNIT_ASSERT_EQUAL(OUString("ooxml-borderCallout1"), aType); } +DECLARE_OOXMLEXPORT_TEST(testFdo73550, "fdo73550.docx") +{ + xmlDocPtr pXmlDocument = parseExport("word/document.xml"); + if (!pXmlDocument) + return; + // This was wrap="none". + assertXPath(pXmlDocument, "/w:document/w:body/w:p[2]/w:pPr/w:rPr/w:rFonts"); +} + DECLARE_OOXMLEXPORT_TEST(testDmlTextshape, "dml-textshape.docx") { uno::Reference<container::XIndexAccess> xGroup(getShape(1), uno::UNO_QUERY); @@ -2512,7 +2521,6 @@ DECLARE_OOXMLEXPORT_TEST(testDrawinglayerPicPos, "drawinglayer-pic-pos.docx") // This was 1828800. assertXPath(pXmlDocument, aXPath, "y", "0"); } - DECLARE_OOXMLEXPORT_TEST(testShapeThemePreservation, "shape-theme-preservation.docx") { xmlDocPtr pXmlDocument = parseExport("word/document.xml"); diff --git a/sw/source/filter/ww8/attributeoutputbase.hxx b/sw/source/filter/ww8/attributeoutputbase.hxx index 8ed93db..e5b461a 100644 --- a/sw/source/filter/ww8/attributeoutputbase.hxx +++ b/sw/source/filter/ww8/attributeoutputbase.hxx @@ -161,7 +161,7 @@ public: virtual void StartParagraphProperties() = 0; /// Called after we end outputting the attributes. - virtual void EndParagraphProperties(const boost::shared_ptr<SfxItemSet> pParagraphMarkerProperties, const SwRedlineData* pRedlineData, const SwRedlineData* pRedlineParagraphMarkerDeleted, const SwRedlineData* pRedlineParagraphMarkerInserted) = 0; + virtual void EndParagraphProperties(const SfxItemSet* pParagraphMarkerProperties, const SwRedlineData* pRedlineData, const SwRedlineData* pRedlineParagraphMarkerDeleted, const SwRedlineData* pRedlineParagraphMarkerInserted) = 0; /// Empty paragraph. virtual void EmptyParagraph() = 0; diff --git a/sw/source/filter/ww8/docxattributeoutput.cxx b/sw/source/filter/ww8/docxattributeoutput.cxx index caf2635..c5c2feb 100644 --- a/sw/source/filter/ww8/docxattributeoutput.cxx +++ b/sw/source/filter/ww8/docxattributeoutput.cxx @@ -502,7 +502,7 @@ void DocxAttributeOutput::WriteCollectedParagraphProperties() } } -void DocxAttributeOutput::EndParagraphProperties( const boost::shared_ptr<SfxItemSet> pParagraphMarkerProperties, const SwRedlineData* pRedlineData, const SwRedlineData* pRedlineParagraphMarkerDeleted, const SwRedlineData* pRedlineParagraphMarkerInserted) +void DocxAttributeOutput::EndParagraphProperties( const SfxItemSet* pParagraphMarkerProperties, const SwRedlineData* pRedlineData, const SwRedlineData* pRedlineParagraphMarkerDeleted, const SwRedlineData* pRedlineParagraphMarkerInserted) { // Call the 'Redline' function. This will add redline (change-tracking) information that regards to paragraph properties. // This includes changes like 'Bold', 'Underline', 'Strikethrough' etc. @@ -540,7 +540,8 @@ void DocxAttributeOutput::EndParagraphProperties( const boost::shared_ptr<SfxIte if( SFX_ITEM_SET == pParagraphMarkerProperties->GetItemState( nWhichId, sal_True, &pItem )) { SAL_INFO( "sw.ww8", "nWhichId " << nWhichId); - OutputItem( *pItem ); + if (isCHRATR( nWhichId )) + OutputItem( *pItem ); } nWhichId = aIter.NextWhich(); } diff --git a/sw/source/filter/ww8/docxattributeoutput.hxx b/sw/source/filter/ww8/docxattributeoutput.hxx index 30f69ac..3466f3d 100644 --- a/sw/source/filter/ww8/docxattributeoutput.hxx +++ b/sw/source/filter/ww8/docxattributeoutput.hxx @@ -150,7 +150,7 @@ public: virtual void StartParagraphProperties(); /// Called after we end outputting the attributes. - virtual void EndParagraphProperties( const boost::shared_ptr<SfxItemSet> pParagraphMarkerProperties, const SwRedlineData* pRedlineData, const SwRedlineData* pRedlineParagraphMarkerDeleted, const SwRedlineData* pRedlineParagraphMarkerInserted); + virtual void EndParagraphProperties( const SfxItemSet* pParagraphMarkerProperties, const SwRedlineData* pRedlineData, const SwRedlineData* pRedlineParagraphMarkerDeleted, const SwRedlineData* pRedlineParagraphMarkerInserted); /// Start of the text run. virtual void StartRun( const SwRedlineData* pRedlineData, bool bSingleEmptyRun = false ); diff --git a/sw/source/filter/ww8/rtfattributeoutput.cxx b/sw/source/filter/ww8/rtfattributeoutput.cxx index 6760572..a09625b 100644 --- a/sw/source/filter/ww8/rtfattributeoutput.cxx +++ b/sw/source/filter/ww8/rtfattributeoutput.cxx @@ -388,7 +388,7 @@ void RtfAttributeOutput::StartParagraphProperties() m_aSectionHeaders.append(aPar.makeStringAndClear()); } -void RtfAttributeOutput::EndParagraphProperties( const boost::shared_ptr<SfxItemSet> /*pParagraphMarkerProperties*/, const SwRedlineData* /*pRedlineData*/, const SwRedlineData* /*pRedlineParagraphMarkerDeleted*/, const SwRedlineData* /*pRedlineParagraphMarkerInserted*/) +void RtfAttributeOutput::EndParagraphProperties( const SfxItemSet* /*pParagraphMarkerProperties*/, const SwRedlineData* /*pRedlineData*/, const SwRedlineData* /*pRedlineParagraphMarkerDeleted*/, const SwRedlineData* /*pRedlineParagraphMarkerInserted*/) { SAL_INFO("sw.rtf", OSL_THIS_FUNC); m_aStyles.append(m_aStylesEnd.makeStringAndClear()); diff --git a/sw/source/filter/ww8/rtfattributeoutput.hxx b/sw/source/filter/ww8/rtfattributeoutput.hxx index 0f35073..016d00d 100644 --- a/sw/source/filter/ww8/rtfattributeoutput.hxx +++ b/sw/source/filter/ww8/rtfattributeoutput.hxx @@ -57,7 +57,7 @@ public: virtual void StartParagraphProperties(); /// Called after we end outputting the attributes. - virtual void EndParagraphProperties( const boost::shared_ptr<SfxItemSet> pParagraphMarkerProperties, const SwRedlineData* pRedlineData, const SwRedlineData* pRedlineParagraphMarkerDeleted, const SwRedlineData* pRedlineParagraphMarkerInserted ); + virtual void EndParagraphProperties( const SfxItemSet* pParagraphMarkerProperties, const SwRedlineData* pRedlineData, const SwRedlineData* pRedlineParagraphMarkerDeleted, const SwRedlineData* pRedlineParagraphMarkerInserted ); /// Start of the text run. virtual void StartRun( const SwRedlineData* pRedlineData, bool bSingleEmptyRun = false ); diff --git a/sw/source/filter/ww8/wrtw8nds.cxx b/sw/source/filter/ww8/wrtw8nds.cxx index 4e29bdd..1fe3ad7 100644 --- a/sw/source/filter/ww8/wrtw8nds.cxx +++ b/sw/source/filter/ww8/wrtw8nds.cxx @@ -2521,7 +2521,9 @@ void MSWordExportBase::OutputTextNode( const SwTxtNode& rNode ) delete pNewSet; } } - boost::shared_ptr<SfxItemSet> sfxItemSet ; + + + const SfxItemSet* sfxItemSet = NULL; if(const SwpHints* pTxtAttrs = rNode.GetpSwpHints()) { for( sal_uInt16 i = 0; i < pTxtAttrs->Count(); i++ ) @@ -2540,11 +2542,15 @@ void MSWordExportBase::OutputTextNode( const SwTxtNode& rNode ) if (nWhich == RES_TXTATR_AUTOFMT) { const SwFmtAutoFmt& rAutoFmt = static_cast<const SwFmtAutoFmt&>(pHt->GetAttr()); - sfxItemSet = rAutoFmt.GetStyleHandle(); + sfxItemSet = rAutoFmt.GetStyleHandle().get(); } } } } + else + { + sfxItemSet = rNode.GetpSwAttrSet(); + } const SwRedlineData* pRedlineParagraphMarkerDelete = AttrOutput().GetParagraphMarkerRedline( rNode, nsRedlineType_t::REDLINE_DELETE ); const SwRedlineData* pRedlineParagraphMarkerInsert = AttrOutput().GetParagraphMarkerRedline( rNode, nsRedlineType_t::REDLINE_INSERT ); const SwRedlineData* pParagraphRedlineData = aAttrIter.GetParagraphLevelRedline( ); diff --git a/sw/source/filter/ww8/ww8attributeoutput.hxx b/sw/source/filter/ww8/ww8attributeoutput.hxx index 48e1e48..4a2e987 100644 --- a/sw/source/filter/ww8/ww8attributeoutput.hxx +++ b/sw/source/filter/ww8/ww8attributeoutput.hxx @@ -42,7 +42,7 @@ public: virtual void StartParagraphProperties() {} /// Called after we end outputting the attributes. - virtual void EndParagraphProperties( const boost::shared_ptr<SfxItemSet> /*pParagraphMarkerProperties*/, const SwRedlineData* /*pRedlineData*/, const SwRedlineData* /*pRedlineParagraphMarkerDeleted*/, const SwRedlineData* /*pRedlineParagraphMarkerInserted*/) {} + virtual void EndParagraphProperties( const SfxItemSet* /*pParagraphMarkerProperties*/, const SwRedlineData* /*pRedlineData*/, const SwRedlineData* /*pRedlineParagraphMarkerDeleted*/, const SwRedlineData* /*pRedlineParagraphMarkerInserted*/) {} /// Empty paragraph. virtual void EmptyParagraph(); _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits