[Libreoffice-commits] core.git: Branch 'libreoffice-4-3' - 2 commits - solenv/gbuild sw/qa writerfilter/source

David Tardon dtardon at redhat.com
Fri May 30 13:18:13 PDT 2014


 solenv/gbuild/ExternalProject.mk                         |    1 +
 sw/qa/extras/ooxmlimport/data/fdo78883.docx              |binary
 sw/qa/extras/ooxmlimport/ooxmlimport.cxx                 |   11 +++++++++++
 writerfilter/source/dmapper/DomainMapper.cxx             |    5 +++++
 writerfilter/source/dmapper/DomainMapperTableHandler.cxx |   12 +++++++++---
 writerfilter/source/dmapper/DomainMapper_Impl.cxx        |   11 +++++++++++
 writerfilter/source/dmapper/DomainMapper_Impl.hxx        |    5 +++++
 7 files changed, 42 insertions(+), 3 deletions(-)

New commits:
commit 37f2be4230b754ce0b24d39c5b4bae110f268d4d
Author: David Tardon <dtardon at redhat.com>
Date:   Fri May 30 21:47:07 2014 +0200

    rebuild ext. project if makefile changes
    
    Change-Id: Ib1b7dab5b4fa10f068bcce58e00450895c455121
    (cherry picked from commit fb984ab884e225df9456b1a0e7ab9ae65b570644)

diff --git a/solenv/gbuild/ExternalProject.mk b/solenv/gbuild/ExternalProject.mk
index f57649f..f6e8cfc 100644
--- a/solenv/gbuild/ExternalProject.mk
+++ b/solenv/gbuild/ExternalProject.mk
@@ -74,6 +74,7 @@ $(call gb_ExternalProject_get_clean_target,%) :
 define gb_ExternalProject_ExternalProject
 $(call gb_ExternalProject_get_target,$(1)) : EXTERNAL_WORKDIR := $(call gb_UnpackedTarball_get_dir,$(1))
 
+$(call gb_ExternalProject_get_preparation_target,$(1)) : $(gb_Module_CURRENTMAKEFILE)
 $(call gb_ExternalProject_get_preparation_target,$(1)) :| $(dir $(call gb_ExternalProject_get_target,$(1))).dir
 $(call gb_UnpackedTarball_get_preparation_target,$(1)) : $(call gb_ExternalProject_get_preparation_target,$(1))
 $(call gb_ExternalProject_get_clean_target,$(1)) : $(call gb_UnpackedTarball_get_clean_target,$(1))
commit d9b607664f25c206c37dc3e9a68e94e55bd272c1
Author: Tushar Bende <tushar.bende at synerzip.com>
Date:   Fri May 30 11:12:54 2014 +0530

    fdo#78883: Writer getting Hang while opening document
    
    Description:
    Writer getting Hang while opening document because of loop in layout.
    
    Root cause: For Documents containing table with direct formatting for
    Para line spacing along with style w:type="table" in style.xml LO was
    erasing PROP_PARA_LINE_SPACING Prop from pAllCellProps in
    DomainMapperTableHandler::endTableGetCellProperties().  But for
    Documents without direct formatting for Para line spacing this deletion
    was causing problem, as after deletion there is no formatting available
    to apply.
    
    To fix this checking whether there is a Direct formatting available for
    table, if Yes then proceed with this deletion logic.
    
    Change-Id: Ibaf51ebd1aca93eff44a9edfbe8fa13832ab2b70
    Signed-off-by: Michael Stahl <mstahl at redhat.com>
    (cherry picked from commit 489611732319dec36ec630f6bfffd0c6ff03b9bf)

diff --git a/sw/qa/extras/ooxmlimport/data/fdo78883.docx b/sw/qa/extras/ooxmlimport/data/fdo78883.docx
new file mode 100644
index 0000000..a72ff94
Binary files /dev/null and b/sw/qa/extras/ooxmlimport/data/fdo78883.docx differ
diff --git a/sw/qa/extras/ooxmlimport/ooxmlimport.cxx b/sw/qa/extras/ooxmlimport/ooxmlimport.cxx
index 0089c4a..a24c3ab 100644
--- a/sw/qa/extras/ooxmlimport/ooxmlimport.cxx
+++ b/sw/qa/extras/ooxmlimport/ooxmlimport.cxx
@@ -2126,6 +2126,17 @@ DECLARE_OOXMLIMPORT_TEST(testInlineGroupshape, "inline-groupshape.docx")
     CPPUNIT_ASSERT_EQUAL(true, getProperty<bool>(getShape(1), "Opaque"));
 }
 
+DECLARE_OOXMLIMPORT_TEST(testFdo78883, "fdo78883.docx")
+{
+    // fdo#78883 : LO was getting hang while opening document
+    // Checking there is a single page after loading a doc in LO.
+    uno::Reference<frame::XModel> xModel(mxComponent, uno::UNO_QUERY);
+    uno::Reference<text::XTextViewCursorSupplier> xTextViewCursorSupplier(xModel->getCurrentController(), uno::UNO_QUERY);
+    uno::Reference<text::XPageCursor> xCursor(xTextViewCursorSupplier->getViewCursor(), uno::UNO_QUERY);
+    xCursor->jumpToLastPage();
+    CPPUNIT_ASSERT_EQUAL(sal_Int16(1), xCursor->getPage());
+}
+
 DECLARE_OOXMLIMPORT_TEST(testBnc875718, "bnc875718.docx")
 {
     // The frame in the footer must not accidentally end up in the document body.
diff --git a/writerfilter/source/dmapper/DomainMapper.cxx b/writerfilter/source/dmapper/DomainMapper.cxx
index 09470c5..0a958d4 100644
--- a/writerfilter/source/dmapper/DomainMapper.cxx
+++ b/writerfilter/source/dmapper/DomainMapper.cxx
@@ -393,6 +393,11 @@ void DomainMapper::lcl_attribute(Id nName, Value & val)
             }
             if( nName == NS_ooxml::LN_CT_Spacing_line )
             {
+                if( m_pImpl->getTableManager().isInCell() )
+                {
+                    // direct formatting is applied for table cell data
+                    m_pImpl->SetIsTableHasDirectFormatting(true);
+                }
                 m_pImpl->appendGrabBag(m_pImpl->m_aSubInteropGrabBag, "line", OUString::number(nIntValue));
                 //now set the value depending on the Mode
                 if( aSpacing.Mode == style::LineSpacingMode::PROP )
diff --git a/writerfilter/source/dmapper/DomainMapperTableHandler.cxx b/writerfilter/source/dmapper/DomainMapperTableHandler.cxx
index 49ea9ac..57bbd32 100644
--- a/writerfilter/source/dmapper/DomainMapperTableHandler.cxx
+++ b/writerfilter/source/dmapper/DomainMapperTableHandler.cxx
@@ -757,9 +757,15 @@ CellPropertyValuesSeq_t DomainMapperTableHandler::endTableGetCellProperties(Tabl
                 if ( aDefaultRepeatIt != pAllCellProps->end( ) )
                     pAllCellProps->erase( aDefaultRepeatIt );
 
-                aDefaultRepeatIt = pAllCellProps->find(PROP_PARA_LINE_SPACING);
-                if ( aDefaultRepeatIt != pAllCellProps->end( ) )
-                    pAllCellProps->erase( aDefaultRepeatIt );
+                if( m_rDMapper_Impl.GetIsTableHasDirectFormatting() )
+                {
+                    // Bug#78883 : direct formatting is applied for table cell data
+                    // so we can erase para line spacing property from style.xml
+                    aDefaultRepeatIt = pAllCellProps->find(PROP_PARA_LINE_SPACING);
+                    if ( aDefaultRepeatIt != pAllCellProps->end( ) )
+                        pAllCellProps->erase( aDefaultRepeatIt );
+                    m_rDMapper_Impl.SetIsTableHasDirectFormatting(false);
+                }
 
                 aDefaultRepeatIt = pAllCellProps->find(PROP_TBL_HEADER);
                 if ( aDefaultRepeatIt != pAllCellProps->end( ) )
diff --git a/writerfilter/source/dmapper/DomainMapper_Impl.cxx b/writerfilter/source/dmapper/DomainMapper_Impl.cxx
index 816e85d..5078760 100644
--- a/writerfilter/source/dmapper/DomainMapper_Impl.cxx
+++ b/writerfilter/source/dmapper/DomainMapper_Impl.cxx
@@ -187,6 +187,7 @@ DomainMapper_Impl::DomainMapper_Impl(
         m_bUsingEnhancedFields( false ),
         m_bSdt(false),
         m_bIsFirstRun(false),
+        m_bIsTableHasDirectFormatting(false),
         m_xAnnotationField(),
         m_nAnnotationId( -1 ),
         m_aAnnotationPositions(),
@@ -450,6 +451,16 @@ bool DomainMapper_Impl::GetSdt()
     return m_bSdt;
 }
 
+void DomainMapper_Impl::SetIsTableHasDirectFormatting(bool bIsTableHasDirectFormatting)
+{
+    m_bIsTableHasDirectFormatting = bIsTableHasDirectFormatting;
+}
+
+bool DomainMapper_Impl::GetIsTableHasDirectFormatting()
+{
+    return m_bIsTableHasDirectFormatting;
+}
+
 bool DomainMapper_Impl::GetParaChanged()
 {
     return m_bParaChanged;
diff --git a/writerfilter/source/dmapper/DomainMapper_Impl.hxx b/writerfilter/source/dmapper/DomainMapper_Impl.hxx
index f2d61e0..74ff784 100644
--- a/writerfilter/source/dmapper/DomainMapper_Impl.hxx
+++ b/writerfilter/source/dmapper/DomainMapper_Impl.hxx
@@ -387,6 +387,7 @@ private:
     /// If the current paragraph is inside a structured document element.
     bool                            m_bSdt;
     bool                            m_bIsFirstRun;
+    bool                            m_bIsTableHasDirectFormatting;
 
     css::uno::Reference< css::text::XTextCursor > xTOCMarkerCursor;
     css::uno::Reference< css::text::XTextCursor > mxTOCTextCursor;
@@ -472,6 +473,10 @@ public:
     void SetSdt(bool bSdt);
     /// Getter method for m_bSdt.
     bool GetSdt();
+    /// Getter method for m_bIsTableHasDirectFormatting
+    bool GetIsTableHasDirectFormatting();
+    /// Setter method for m_bIsTableHasDirectFormatting
+    void SetIsTableHasDirectFormatting(bool bIsTableHasDirectFormatting);
     bool GetParaChanged();
 
     void deferBreak( BreakType deferredBreakType );


More information about the Libreoffice-commits mailing list