From 67ef5f22aa3c8f060ab5caf5b816e9806c610654 Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Fri, 17 Apr 2015 12:36:30 +0100 Subject: SwTableLines::size is an unreliable way to count rows pathological old-school writer tables can have one line here for merged rows The table writer knows about these things, so use that, keep it up to date, and make that up to date cheaper to do Change-Id: I3433206a54c7cb096b699ac0b61653358e647115 --- sw/source/filter/ww8/docxattributeoutput.hxx | 25 ++++++++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) (limited to 'sw/source/filter/ww8/docxattributeoutput.hxx') diff --git a/sw/source/filter/ww8/docxattributeoutput.hxx b/sw/source/filter/ww8/docxattributeoutput.hxx index 4da101b4beeb..2b253d269559 100644 --- a/sw/source/filter/ww8/docxattributeoutput.hxx +++ b/sw/source/filter/ww8/docxattributeoutput.hxx @@ -138,6 +138,29 @@ struct TableReference } }; +class DocxWriteTable : public SwWriteTable +{ +public: + DocxWriteTable(const SwTable* pTable, const SwTableLines& rLines, long nWidth, sal_uInt32 nBWidth, + bool bRel, sal_uInt16 nMaxDepth = USHRT_MAX, + sal_uInt16 nInLeftSub=0, sal_uInt16 nInRightSub=0, sal_uInt32 nNumOfRowsToRepeat=0) + : SwWriteTable(rLines, nWidth, nBWidth, + bRel, nMaxDepth, nInLeftSub, nInRightSub, nNumOfRowsToRepeat) + , m_pTable(pTable) + { + } + + DocxWriteTable(const SwTable* pTable, const SwHTMLTableLayout *pLayoutInfo ) + : SwWriteTable(pLayoutInfo) + , m_pTable(pTable) + { + } + + const SwTable* getTable() const { return m_pTable; } +private: + const SwTable* m_pTable; +}; + /// The class that has handlers for various resource types when exporting as DOCX. class DocxAttributeOutput : public AttributeOutputBase, public oox::vml::VMLTextExport, public oox::drawingml::DMLTextExport { @@ -795,7 +818,7 @@ private: std::vector m_aTextEffectsGrabBag; /// The current table helper - std::unique_ptr m_pTableWrt; + std::unique_ptr m_xTableWrt; sw::Frame* m_pCurrentFrame; -- cgit v1.2.3