[Libreoffice-commits] core.git: sw/source

Georgy Litvinov (via logerrit) logerrit at kemper.freedesktop.org
Tue Dec 29 18:18:31 UTC 2020


 sw/source/filter/xml/xmlimp.cxx |   10 ++++++++++
 1 file changed, 10 insertions(+)

New commits:
commit 83ff5b784e910f06c9d8384ac73a1c0bda0551d5
Author:     Georgy Litvinov <git at litvinovg.pro>
AuthorDate: Fri Dec 25 16:22:37 2020 +0100
Commit:     Noel Grandin <noel.grandin at collabora.co.uk>
CommitDate: Tue Dec 29 19:17:49 2020 +0100

    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 at collabora.co.uk>
    Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>

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();


More information about the Libreoffice-commits mailing list