summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGeorgy Litvinov <git@litvinovg.pro>2020-12-25 16:22:37 +0100
committerXisco Fauli <xiscofauli@libreoffice.org>2021-01-04 21:51:44 +0100
commitabc2a0563d33726c10c6cc10c1b879d635453b61 (patch)
tree7dbc6a12833be2fee30e57c9baab3255156cf749
parente865a170a3a964dfa28ca51789801691932827e9 (diff)
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 <noel.grandin@collabora.co.uk> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> (cherry picked from commit 83ff5b784e910f06c9d8384ac73a1c0bda0551d5) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/108590 Reviewed-by: Georgy Litvinov <git@litvinovg.pro> Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org> Tested-by: Jenkins
-rw-r--r--sw/source/filter/xml/xmlimp.cxx10
1 files changed, 10 insertions, 0 deletions
diff --git a/sw/source/filter/xml/xmlimp.cxx b/sw/source/filter/xml/xmlimp.cxx
index 0a7934c8b303..bfd7ef37d004 100644
--- a/sw/source/filter/xml/xmlimp.cxx
+++ b/sw/source/filter/xml/xmlimp.cxx
@@ -824,6 +824,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();