[Libreoffice-commits] .: Branch 'libreoffice-3-6' - writerfilter/source

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Fri Oct 19 02:34:16 PDT 2012


 writerfilter/source/dmapper/DomainMapper.cxx |   12 ++++++++++--
 writerfilter/source/dmapper/PropertyMap.hxx  |    1 +
 2 files changed, 11 insertions(+), 2 deletions(-)

New commits:
commit b7cc2a8a22d3723a1efff515eb07669166f158a8
Author: Miklos Vajna <vmiklos at suse.cz>
Date:   Mon Oct 15 12:53:05 2012 +0200

    fdo#52208 DOCX import: don't always ignore cont sect break at the doc end
    
    Regression from commit 1fdd61db155cf63d5dd55cc2bfb45af33796e131,
    continuous section break does make sense at the end of the doc, if the
    previous type was a non-continuous.
    
    (cherry picked from commit abd4ffadf30e02284290ea35e8f45d9ffd8eb5ee)
    
    Change-Id: I6d82c67e068d8dc3ce1edb1a5fe6ad293afd805d
    Reviewed-on: https://gerrit.libreoffice.org/877
    Reviewed-by: Michael Stahl <mstahl at redhat.com>
    Tested-by: Michael Stahl <mstahl at redhat.com>

diff --git a/writerfilter/source/dmapper/DomainMapper.cxx b/writerfilter/source/dmapper/DomainMapper.cxx
index 2068b61..3eed3cd 100644
--- a/writerfilter/source/dmapper/DomainMapper.cxx
+++ b/writerfilter/source/dmapper/DomainMapper.cxx
@@ -2372,9 +2372,17 @@ void DomainMapper::sprmWithProps( Sprm& rSprm, PropertyMapPtr rContext, SprmType
         OSL_ENSURE(pSectionContext, "SectionContext unavailable!");
         if(pSectionContext)
         {
-            // Ignore continous section break at the end of the document
+            // Ignore continous section break at the end of the document, if the previous section had the same type as well
             // It makes the importer loose margin settings with no benefit
-            if (m_pImpl->GetParaSectpr() || nIntValue != 0)
+            SectionPropertyMap* pLastContext = m_pImpl->GetLastSectionContext();
+            int nPrevBreakType = 0;
+            bool bHasPrevSection = false;
+            if (pLastContext)
+            {
+                bHasPrevSection = true;
+                nPrevBreakType = pLastContext->GetBreakType();
+            }
+            if (m_pImpl->GetParaSectpr() || nIntValue != 0 || (bHasPrevSection && nPrevBreakType != nIntValue))
                 pSectionContext->SetBreakType( nIntValue );
         }
         break;
diff --git a/writerfilter/source/dmapper/PropertyMap.hxx b/writerfilter/source/dmapper/PropertyMap.hxx
index b9a3d5d..7a3b5bd 100644
--- a/writerfilter/source/dmapper/PropertyMap.hxx
+++ b/writerfilter/source/dmapper/PropertyMap.hxx
@@ -245,6 +245,7 @@ public:
     void SetPageNoRestart( bool bSet ) { m_bPageNoRestart = bSet; }
     void SetPageNumber( sal_Int32 nSet ) { m_nPageNumber = nSet; }
     void SetBreakType( sal_Int32 nSet ) { m_nBreakType = nSet; }
+    sal_Int32 GetBreakType( ) { return m_nBreakType; }
     void SetPaperBin( sal_Int32 nSet );
     void SetFirstPaperBin( sal_Int32 nSet );
 


More information about the Libreoffice-commits mailing list