diff options
-rw-r--r-- | sw/source/filter/xml/xmltbli.cxx | 18 | ||||
-rw-r--r-- | sw/source/filter/xml/xmltbli.hxx | 3 |
2 files changed, 17 insertions, 4 deletions
diff --git a/sw/source/filter/xml/xmltbli.cxx b/sw/source/filter/xml/xmltbli.cxx index ec43a0ce33c6..d30cccf8e3e6 100644 --- a/sw/source/filter/xml/xmltbli.cxx +++ b/sw/source/filter/xml/xmltbli.cxx @@ -587,8 +587,11 @@ SwXMLTableCellContext_Impl::~SwXMLTableCellContext_Impl() inline void SwXMLTableCellContext_Impl::_InsertContent() { + SwStartNode const*const pStartNode( GetTable()->InsertTableSection(0, + (m_bHasStringValue && m_bValueTypeIsString && + !aStyleName.isEmpty()) ? & aStyleName : 0) ); GetTable()->InsertCell( aStyleName, nRowSpan, nColSpan, - GetTable()->InsertTableSection(), + pStartNode, mXmlId, NULL, bProtect, &sFormula, bHasValue, fValue, (m_bHasStringValue && m_bValueTypeIsString) ? &m_StringValue : 0); @@ -2881,12 +2884,14 @@ void SwXMLTableContext::MakeTable( SwTableBox *pBox, sal_Int32 nW ) } const SwStartNode *SwXMLTableContext::InsertTableSection( - const SwStartNode *pPrevSttNd ) + const SwStartNode *const pPrevSttNd, + OUString const*const pStringValueStyleName) { // The topmost table is the only table that maintains the two members // pBox1 and bFirstSection. if( xParentTable.Is() ) - return ((SwXMLTableContext *)&xParentTable)->InsertTableSection( pPrevSttNd ); + return static_cast<SwXMLTableContext *>(&xParentTable) + ->InsertTableSection(pPrevSttNd, pStringValueStyleName); const SwStartNode *pStNd; Reference<XUnoTunnel> xCrsrTunnel( GetImport().GetTextImport()->GetCursor(), @@ -2941,6 +2946,13 @@ const SwStartNode *SwXMLTableContext::InsertTableSection( } } + if (pStringValueStyleName) + { // fdo#62147: apply style to paragraph on string-value cell + GetImport().GetTextImport()->SetStyleAndAttrs( GetImport(), + GetImport().GetTextImport()->GetCursor(), *pStringValueStyleName, + true, false, -1, false); // parameters same as sCellParaStyleName + } + return pStNd; } diff --git a/sw/source/filter/xml/xmltbli.hxx b/sw/source/filter/xml/xmltbli.hxx index 7062dc487a0c..0ba3130843cd 100644 --- a/sw/source/filter/xml/xmltbli.hxx +++ b/sw/source/filter/xml/xmltbli.hxx @@ -186,7 +186,8 @@ public: void InsertRepRows( sal_uInt32 nCount ); const SwXMLTableCell_Impl *GetCell( sal_uInt32 nRow, sal_uInt32 nCol ) const; SwXMLTableCell_Impl *GetCell( sal_uInt32 nRow, sal_uInt32 nCol ); - const SwStartNode *InsertTableSection( const SwStartNode *pPrevSttNd=0 ); + const SwStartNode *InsertTableSection(const SwStartNode *pPrevSttNd = 0, + OUString const* pStringValueStyleName = 0); virtual void EndElement(); |