From 83ff5b784e910f06c9d8384ac73a1c0bda0551d5 Mon Sep 17 00:00:00 2001 From: Georgy Litvinov Date: Fri, 25 Dec 2020 16:22:37 +0100 Subject: Missing last para style when inserting text from odt file tdf#138879 Change-Id: Ief235e98f3de02350b6403a1ea8ecf6361571789 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/108285 Tested-by: Noel Grandin Reviewed-by: Noel Grandin --- sw/source/filter/xml/xmlimp.cxx | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'sw/source/filter/xml') diff --git a/sw/source/filter/xml/xmlimp.cxx b/sw/source/filter/xml/xmlimp.cxx index 9e06e6e098e8..956582987373 100644 --- a/sw/source/filter/xml/xmlimp.cxx +++ b/sw/source/filter/xml/xmlimp.cxx @@ -768,6 +768,16 @@ void SwXMLImport::endDocument() if( pCurrNd->CanJoinNext( &pPos->nNode )) { SwTextNode* pNextNd = pPos->nNode.GetNode().GetTextNode(); + + SwNode *pLastPar = pDoc->GetNodes()[nNodeIdx -2]; + if ( !pLastPar->IsTextNode() ) { + pLastPar = pDoc->GetNodes()[nNodeIdx -1]; + } + if ( pLastPar->IsTextNode() ) + { + pNextNd->ChgFormatColl(pLastPar->GetTextNode()->GetTextColl()); + } + pPos->nContent.Assign( pNextNd, 0 ); pPaM->SetMark(); pPaM->DeleteMark(); pNextNd->JoinPrev(); -- cgit