[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-5.1' - 5 commits - chart2/source sc/inc sc/source sw/source

Eike Rathke erack at redhat.com
Wed Oct 26 12:56:06 UTC 2016


 chart2/source/controller/main/ChartController.cxx       |    3 +++
 chart2/source/controller/sidebar/ChartElementsPanel.cxx |    3 +++
 sc/inc/externalrefmgr.hxx                               |    3 +++
 sc/source/filter/oox/formulabuffer.cxx                  |    4 ++++
 sc/source/ui/docshell/externalrefmgr.cxx                |   12 ++++++++++++
 sw/source/filter/ww8/wrtw8sty.cxx                       |   15 ++++++++-------
 sw/source/filter/ww8/ww8par2.cxx                        |    7 +++++++
 7 files changed, 40 insertions(+), 7 deletions(-)

New commits:
commit 81b2b9afd88b4c7828edcc5b388d4c90d36cf35e
Author: Eike Rathke <erack at redhat.com>
Date:   Tue Oct 25 19:41:30 2016 +0200

    Resolves: tdf#79442 in OOXML import add external files to LinkManager
    
    Now that we store formula results without recalculating, the implicit
    logic that adds files of external references to the LinkManager is not
    triggered, explicitly force it during import.
    
    Change-Id: Id867d2fa2b39841fb4c8e90941814457c8db431d
    (cherry picked from commit 8464ea6961b9cc54af9c11cce1b80ed7e0cc77e2)
    Reviewed-on: https://gerrit.libreoffice.org/30277
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Caolán McNamara <caolanm at redhat.com>
    Tested-by: Caolán McNamara <caolanm at redhat.com>
    (cherry picked from commit ef4051a295b76a5398e6c4a64bc0f8e1322291c7)

diff --git a/sc/inc/externalrefmgr.hxx b/sc/inc/externalrefmgr.hxx
index 77c497f..94ed3ce 100644
--- a/sc/inc/externalrefmgr.hxx
+++ b/sc/inc/externalrefmgr.hxx
@@ -725,6 +725,9 @@ public:
 
     void enableDocTimer( bool bEnable );
 
+    /** Add all known external files to the LinkManager. */
+    void addFilesToLinkManager();
+
 private:
     ScExternalRefManager(const ScExternalRefManager&) = delete;
 
diff --git a/sc/source/filter/oox/formulabuffer.cxx b/sc/source/filter/oox/formulabuffer.cxx
index ef6172f..0d276a6 100644
--- a/sc/source/filter/oox/formulabuffer.cxx
+++ b/sc/source/filter/oox/formulabuffer.cxx
@@ -425,6 +425,10 @@ void FormulaBuffer::finalizeImport()
         }
     }
 
+    // With formula results being set and not recalculated we need to
+    // force-trigger adding all linked external files to the LinkManager.
+    rDoc.getDoc().GetExternalRefManager()->addFilesToLinkManager();
+
     rDoc.getDoc().SetAutoNameCache(nullptr);
 
     xFormulaBar->setPosition( 1.0 );
diff --git a/sc/source/ui/docshell/externalrefmgr.cxx b/sc/source/ui/docshell/externalrefmgr.cxx
index dcb5cd7..ec87fe6 100644
--- a/sc/source/ui/docshell/externalrefmgr.cxx
+++ b/sc/source/ui/docshell/externalrefmgr.cxx
@@ -2795,6 +2795,18 @@ void ScExternalRefManager::maybeLinkExternalFile(sal_uInt16 nFileId)
     maLinkedDocs.insert(LinkedDocMap::value_type(nFileId, true));
 }
 
+void ScExternalRefManager::addFilesToLinkManager()
+{
+    if (maSrcFiles.empty())
+        return;
+
+    SAL_WARN_IF( maSrcFiles.size() >= SAL_MAX_UINT16,
+            "sc.ui", "ScExternalRefManager::addFilesToLinkManager: files overflow");
+    const sal_uInt16 nSize = static_cast<sal_uInt16>( std::max<size_t>( maSrcFiles.size(), SAL_MAX_UINT16));
+    for (sal_uInt16 nFileId = 0; nFileId < nSize; ++nFileId)
+        maybeLinkExternalFile( nFileId);
+}
+
 void ScExternalRefManager::SrcFileData::maybeCreateRealFileName(const OUString& rOwnDocName)
 {
     if (maRelativeName.isEmpty())
commit f5be6a8ae62b55e782d147f8282e158314044435
Author: Michael Stahl <mstahl at redhat.com>
Date:   Tue Oct 25 17:35:59 2016 +0200

    tdf#101814 sw: MSWord export: don't override first-page with heuristics
    
    Revert commit dcea8ba3b4fc347e7b6d9e0d5ec2fd99bd77ce6f, and do the
    opposite.  The added "titlePage" check makes no sense, because in that
    case there is already an explicit first-page style in the PageDesc, and
    overriding that cannot be right.
    
    The test added in that commit still succeeds, which suggests that the
    root cause of that bug was elsewhere and was fixed in the meantime.
    
    Change-Id: I9b21b6dc115be28cb0ee3360615c538d4cfee3cb
    (cherry picked from commit 36e390eaa55ae302dc5a64fa7098ec43e2009748)
    Reviewed-on: https://gerrit.libreoffice.org/30276
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Caolán McNamara <caolanm at redhat.com>
    Tested-by: Caolán McNamara <caolanm at redhat.com>
    (cherry picked from commit 1bfa382b4af649ff2b56b988d89bada156e29078)

diff --git a/sw/source/filter/ww8/wrtw8sty.cxx b/sw/source/filter/ww8/wrtw8sty.cxx
index 75b266a..4769b73 100644
--- a/sw/source/filter/ww8/wrtw8sty.cxx
+++ b/sw/source/filter/ww8/wrtw8sty.cxx
@@ -1623,18 +1623,19 @@ void MSWordExportBase::SectionProperties( const WW8_SepInfo& rSepInfo, WW8_PdAtt
     {
         // if a Follow is set and it does not point to itself,
         // then there is a page chain.
-        // Falls damit eine "Erste Seite" simuliert werden soll, so
-        // koennen wir das auch als solches schreiben.
-        // Anders sieht es mit Links/Rechts wechseln aus. Dafuer muss
-        // erkannt werden, wo der Seitenwechsel statt findet. Hier ist
-        // es aber dafuer zuspaet!
-        if ( pPd->GetFollow() && pPd != pPd->GetFollow() &&
+        // If this emulates a "first page", we can detect it here and write
+        // it as title page.
+        // With Left/Right changes it's different - we have to detect where
+        // the change of pages is, but here it's too late for that!
+        // tdf#101814 if there is already a explicit first-page, no point
+        // in checking heuristics here.
+        if ( !titlePage && pPd->GetFollow() && pPd != pPd->GetFollow() &&
              pPd->GetFollow()->GetFollow() == pPd->GetFollow() &&
              ( !rSepInfo.pPDNd || pPd->IsFollowNextPageOfNode( *rSepInfo.pPDNd ) ) )
         {
             const SwPageDesc *pFollow = pPd->GetFollow();
             const SwFrameFormat& rFollowFormat = pFollow->GetMaster();
-            if ( sw::util::IsPlausableSingleWordSection( *pPdFirstPgFormat, rFollowFormat ) || titlePage )
+            if (sw::util::IsPlausableSingleWordSection(*pPdFirstPgFormat, rFollowFormat))
             {
                 if (rSepInfo.pPDNd)
                     pPdFirstPgFormat = pPd->GetPageFormatOfNode( *rSepInfo.pPDNd );
commit 8b8567c527fab51f70346910a9c94a82d0e03ebf
Author: Stephan Bergmann <sbergman at redhat.com>
Date:   Fri Oct 21 18:00:03 2016 +0200

    Avoid further crash with empty Chart document
    
    following up on 8b5f8c26f007c8e67bc46b1b09340cae660d0b8b "Avoid crash with empty
    Chart document", when you then close the Writer doc (discarding the changes), it
    crashes in a chart::sidebar::ChartSidebarModifyListener::disposing call whose
    mpParent (that was a ChartElementsPanel) is already destroyed.  The problem is
    that the ChartElementsPanel ctor creates an mxListener pointing to this, then
    calls Initialize, which calls xBroadcaster->addModifyListener(mxListener) and
    then, during updateData, throws a RuntimeException when xDiagram is null in
    getChartType, causing the ChartElementsPanel object to immediately be destroyed,
    but the listener still registered.  This apparently needs fixing independently
    of the immediate problem.  (The immediate problem is a regression introduced
    with d7748842e96536daeb0c638c6f8d01d99b9a3e08 "hide grid and axes options in
    chart elements if not supported, tdf#94297".)
    
    Change-Id: I2fe4f2a59600664f6210456c65e033f9453f4cc9
    (cherry picked from commit 429e4dc671f03e0c4d50e8f8aa055f4aaca761da)
    Reviewed-on: https://gerrit.libreoffice.org/30146
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Michael Stahl <mstahl at redhat.com>
    (cherry picked from commit 4bbd59e113749bf8e9eda7c25683b99f34d6866e)

diff --git a/chart2/source/controller/sidebar/ChartElementsPanel.cxx b/chart2/source/controller/sidebar/ChartElementsPanel.cxx
index 223f5eb..1f8b774 100644
--- a/chart2/source/controller/sidebar/ChartElementsPanel.cxx
+++ b/chart2/source/controller/sidebar/ChartElementsPanel.cxx
@@ -388,6 +388,9 @@ css::uno::Reference<css::chart2::XChartType> getChartType(css::uno::Reference<cs
 {
     css::uno::Reference<css::chart2::XChartDocument> xChartDoc(xModel, css::uno::UNO_QUERY_THROW);
     css::uno::Reference<chart2::XDiagram > xDiagram = xChartDoc->getFirstDiagram();
+    if (!xDiagram.is()) {
+        return css::uno::Reference<css::chart2::XChartType>();
+    }
 
     css::uno::Reference<css::chart2::XCoordinateSystemContainer > xCooSysContainer( xDiagram, css::uno::UNO_QUERY_THROW );
 
commit 3a63fc0b3ab9dc87b51fead71ac22f8b15ca16cd
Author: Stephan Bergmann <sbergman at redhat.com>
Date:   Fri Oct 21 15:02:59 2016 +0200

    Avoid crash with empty Chart document
    
    In a fresh Writer document, "Insert - Object - OLE Object... - Create new -
    LibreOffice 5.3 Chart - OK", then left-clicking into the empty Chart are, caused
    an unhandled (or rather, handled by desktop's FatalError) RuntimeException since
    749a0845500d69f99bf1901bab82361f67b5e4f6 "don't show area and line panel in pie
    chart Chart selection, tdf#94320".
    
    (cherry picked from commit 8b5f8c26f007c8e67bc46b1b09340cae660d0b8b plus
    c5feb9ad79c9c830ca824e29277ff41c5cc24e7d "Minor improvement of previous commit")
    
    Change-Id: I7ff53a84e4b06b20409d09e6010bac80e5a7c4b2
    Reviewed-on: https://gerrit.libreoffice.org/30137
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Michael Stahl <mstahl at redhat.com>
    (cherry picked from commit 1af159c20c7e3b4b27251cf5736d64c217ce7565)

diff --git a/chart2/source/controller/main/ChartController.cxx b/chart2/source/controller/main/ChartController.cxx
index 12195e0..a19c591 100644
--- a/chart2/source/controller/main/ChartController.cxx
+++ b/chart2/source/controller/main/ChartController.cxx
@@ -286,6 +286,9 @@ css::uno::Reference<css::chart2::XChartType> getChartType(
         css::uno::Reference<css::chart2::XChartDocument> xChartDoc)
 {
     Reference <chart2::XDiagram > xDiagram = xChartDoc->getFirstDiagram();
+    if (!xDiagram.is()) {
+        return css::uno::Reference<css::chart2::XChartType>();
+    }
 
     Reference< chart2::XCoordinateSystemContainer > xCooSysContainer( xDiagram, uno::UNO_QUERY_THROW );
 
commit 5d08f5ae64ca4bd8f5fe5fc2ca5e065e7f6a3732
Author: Justin Luth <justin_luth at sil.org>
Date:   Mon Oct 24 15:46:45 2016 +0300

    tdf#89377 ww8import: table honors ParaStyle break-before-page
    
    MS Word can page-break inside a table at any row
    (using paragraph styles from the first column).
    Thus a table can be split across many pages.
    Writer can't because it ignores all page-breaks while inside a table,
    although the entire table itself can specify starting on a new page.
    
    This imported .doc patch checks to see if the very first paragraph style
    in a table is set with a page-break, and if so, then transfers
    that setting to the table itself. That at least mimics the most
    common layout scenario.
    
    Cherry pick from f5f51cb93d11731c64dfd68044144100f5fc4b28
    Reviewed-by: Justin Luth <justin_luth at sil.org>
    Reviewed-by: Miklos Vajna <vmiklos at collabora.co.uk>
    
    Change-Id: I25d99c812281e3654c44f21c2b6030a820917890
    Reviewed-on: https://gerrit.libreoffice.org/30228
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Justin Luth <justin_luth at sil.org>
    Reviewed-by: Miklos Vajna <vmiklos at collabora.co.uk>
    (cherry picked from commit 55840d90c43d0ba6db4a9cda4af648df0776749b)

diff --git a/sw/source/filter/ww8/ww8par2.cxx b/sw/source/filter/ww8/ww8par2.cxx
index 8ef53ba..80d5ca7c 100644
--- a/sw/source/filter/ww8/ww8par2.cxx
+++ b/sw/source/filter/ww8/ww8par2.cxx
@@ -3381,6 +3381,13 @@ bool SwWW8ImplReader::StartTable(WW8_CP nStartCp, SvxULSpaceItem* pULSpaceItem)
             }
         }
     }
+    // if first paragraph in table has break-before-page, transfer that setting to the table itself.
+    else if( StyleExists(m_nAktColl) )
+    {
+        const SwFormat* pStyleFormat = m_vColl[m_nAktColl].m_pFormat;
+        if( pStyleFormat && pStyleFormat->GetBreak().GetBreak() == SVX_BREAK_PAGE_BEFORE )
+            NewAttr( pStyleFormat->GetBreak() );
+    }
 
     m_pTableDesc = new WW8TabDesc( this, nStartCp );
 


More information about the Libreoffice-commits mailing list