[Libreoffice-commits] core.git: Branch 'distro/collabora/cd-5.3-3.4' - 9 commits - configure.ac desktop/qa desktop/source include/vcl officecfg/registry sc/inc sc/qa scripting/source sc/source sw/source vcl/source

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Tue Nov 13 20:08:34 UTC 2018


 configure.ac                                                |    2 
 desktop/qa/desktop_lib/test_desktop_lib.cxx                 |    3 
 desktop/source/lib/init.cxx                                 |    2 
 include/vcl/svapp.hxx                                       |    3 
 officecfg/registry/schema/org/openoffice/Office/Draw.xcs    |    2 
 officecfg/registry/schema/org/openoffice/Office/Impress.xcs |    2 
 sc/inc/dbdata.hxx                                           |    3 
 sc/qa/unit/data/xlsx/tdf41425.xlsx                          |binary
 sc/qa/unit/subsequent_export-test.cxx                       |   15 ++
 sc/source/core/tool/dbdata.cxx                              |    6 -
 sc/source/filter/excel/xetable.cxx                          |    3 
 scripting/source/pyprov/pythonscript.py                     |   30 ++++-
 sw/source/core/doc/docredln.cxx                             |    4 
 sw/source/core/unocore/unochart.cxx                         |   47 ++------
 sw/source/filter/ww8/ww8par3.cxx                            |    2 
 sw/source/uibase/uno/unotxdoc.cxx                           |   69 +++++++-----
 vcl/source/app/svapp.cxx                                    |    7 +
 17 files changed, 130 insertions(+), 70 deletions(-)

New commits:
commit 32c01c3e794ccdcbb167cdff9bac8f4cc379811e
Author:     Andras Timar <andras.timar at collabora.com>
AuthorDate: Thu Nov 8 22:21:48 2018 +0100
Commit:     Andras Timar <andras.timar at collabora.com>
CommitDate: Tue Nov 13 21:07:20 2018 +0100

    Bump version to 5.3-60
    
    (cherry picked from commit 25ec65bf4b77a5cdb2544527f3d1a262fcb78fe6)
    
    Change-Id: I7f5a4a30802c9348e8fef0d7a11b7efec47e1d88

diff --git a/configure.ac b/configure.ac
index fa150761ca90..bd93fe182eb5 100644
--- a/configure.ac
+++ b/configure.ac
@@ -9,7 +9,7 @@ dnl in order to create a configure script.
 # several non-alphanumeric characters, those are split off and used only for the
 # ABOUTBOXPRODUCTVERSIONSUFFIX in openoffice.lst. Why that is necessary, no idea.
 
-AC_INIT([Collabora Office],[5.3.10.56],[],[],[https://collaboraoffice.com/])
+AC_INIT([Collabora Office],[5.3.10.60],[],[],[https://collaboraoffice.com/])
 
 AC_PREREQ([2.59])
 
commit 7c753bd58ab51b2daef41c5c61adbcd6ae2e8c36
Author:     Ashod Nakashian <ashod.nakashian at collabora.co.uk>
AuthorDate: Thu Nov 8 11:02:26 2018 -0500
Commit:     Andras Timar <andras.timar at collabora.com>
CommitDate: Tue Nov 13 21:06:51 2018 +0100

    LOK: don't emit redline comments
    
    Change tracking can be quite numerous. Showing the
    markers (and their comments" as comment-boxes is
    sensible where there is limited change in a doc.
    
    However with extensively modified doc, this becomes
    overwhelming both in terms of browser load and
    editing performance. As such, we disable them
    as they don't add much value. The user can still
    access them from the Track Changes > Manage menu.
    
    Use a rather nasty env. var hack to propagate this
    setting from WSD for now.
    
    Change-Id: I3f964816b4a10f565012b273added8a8413cd309
    Signed-off-by: Michael Meeks <michael.meeks at collabora.com>
    (cherry picked from commit d4f821b7a385953542e90b2749690b9f8f4cc782)

diff --git a/sw/source/core/doc/docredln.cxx b/sw/source/core/doc/docredln.cxx
index fc92fbcf6a68..1a429a83f8d9 100644
--- a/sw/source/core/doc/docredln.cxx
+++ b/sw/source/core/doc/docredln.cxx
@@ -357,7 +357,9 @@ void lcl_LOKInvalidateStartEndFrames(SwShellCursor& rCursor)
 /// Emits LOK notification about one addition / removal of a redline item.
 void SwRedlineTable::LOKRedlineNotification(RedlineNotification nType, SwRangeRedline* pRedline)
 {
-    if (!comphelper::LibreOfficeKit::isActive())
+    // Disable since usability is very low beyond some small number of changes.
+    static bool bDisableRedlineComments = getenv("DISABLE_REDLINE") != nullptr;
+    if (!comphelper::LibreOfficeKit::isActive() || bDisableRedlineComments)
         return;
 
     boost::property_tree::ptree aRedline;
diff --git a/sw/source/uibase/uno/unotxdoc.cxx b/sw/source/uibase/uno/unotxdoc.cxx
index f578c5480bb4..c5aafda8c191 100644
--- a/sw/source/uibase/uno/unotxdoc.cxx
+++ b/sw/source/uibase/uno/unotxdoc.cxx
@@ -3278,40 +3278,53 @@ Pointer SwXTextDocument::getPointer()
 
 OUString SwXTextDocument::getTrackedChanges()
 {
-    const SwRedlineTable& rRedlineTable = pDocShell->GetDoc()->getIDocumentRedlineAccess().GetRedlineTable();
     boost::property_tree::ptree aTrackedChanges;
-    for (SwRedlineTable::size_type i = 0; i < rRedlineTable.size(); ++i)
-    {
-        boost::property_tree::ptree aTrackedChange;
-        aTrackedChange.put("index", rRedlineTable[i]->GetId());
-        aTrackedChange.put("author", rRedlineTable[i]->GetAuthorString(1).toUtf8().getStr());
-        aTrackedChange.put("type", nsRedlineType_t::SwRedlineTypeToOUString(rRedlineTable[i]->GetRedlineData().GetType()).toUtf8().getStr());
-        aTrackedChange.put("comment", rRedlineTable[i]->GetRedlineData().GetComment().toUtf8().getStr());
-        aTrackedChange.put("description", rRedlineTable[i]->GetDescr().toUtf8().getStr());
-        OUString sDateTime = utl::toISO8601(rRedlineTable[i]->GetRedlineData().GetTimeStamp().GetUNODateTime());
-        aTrackedChange.put("dateTime", sDateTime.toUtf8().getStr());
-
-        SwContentNode* pContentNd = rRedlineTable[i]->GetContentNode();
-        SwView* pView = dynamic_cast<SwView*>(SfxViewShell::Current());
-        if (pView && pContentNd)
+
+    // Disable since usability is very low beyond some small number of changes.
+    static bool bDisableRedlineComments = getenv("DISABLE_REDLINE") != nullptr;
+    if (!bDisableRedlineComments)
+    {
+        const SwRedlineTable& rRedlineTable
+            = pDocShell->GetDoc()->getIDocumentRedlineAccess().GetRedlineTable();
+        for (SwRedlineTable::size_type i = 0; i < rRedlineTable.size(); ++i)
         {
-            SwShellCursor aCursor(pView->GetWrtShell(), *(rRedlineTable[i]->Start()));
-            aCursor.SetMark();
-            aCursor.GetMark()->nNode = *pContentNd;
-            aCursor.GetMark()->nContent.Assign(pContentNd, rRedlineTable[i]->End()->nContent.GetIndex());
+            boost::property_tree::ptree aTrackedChange;
+            aTrackedChange.put("index", rRedlineTable[i]->GetId());
+            aTrackedChange.put("author", rRedlineTable[i]->GetAuthorString(1).toUtf8().getStr());
+            aTrackedChange.put("type", nsRedlineType_t::SwRedlineTypeToOUString(
+                                           rRedlineTable[i]->GetRedlineData().GetType())
+                                           .toUtf8()
+                                           .getStr());
+            aTrackedChange.put("comment",
+                               rRedlineTable[i]->GetRedlineData().GetComment().toUtf8().getStr());
+            aTrackedChange.put("description", rRedlineTable[i]->GetDescr().toUtf8().getStr());
+            OUString sDateTime = utl::toISO8601(
+                rRedlineTable[i]->GetRedlineData().GetTimeStamp().GetUNODateTime());
+            aTrackedChange.put("dateTime", sDateTime.toUtf8().getStr());
+
+            SwContentNode* pContentNd = rRedlineTable[i]->GetContentNode();
+            SwView* pView = dynamic_cast<SwView*>(SfxViewShell::Current());
+            if (pView && pContentNd)
+            {
+                SwShellCursor aCursor(pView->GetWrtShell(), *(rRedlineTable[i]->Start()));
+                aCursor.SetMark();
+                aCursor.GetMark()->nNode = *pContentNd;
+                aCursor.GetMark()->nContent.Assign(pContentNd,
+                                                   rRedlineTable[i]->End()->nContent.GetIndex());
 
-            aCursor.FillRects();
+                aCursor.FillRects();
 
-            SwRects* pRects(&aCursor);
-            std::vector<OString> aRects;
-            for(SwRect& rNextRect : *pRects)
-                aRects.push_back(rNextRect.SVRect().toString());
+                SwRects* pRects(&aCursor);
+                std::vector<OString> aRects;
+                for (SwRect& rNextRect : *pRects)
+                    aRects.push_back(rNextRect.SVRect().toString());
 
-            const OString sRects = comphelper::string::join("; ", aRects);
-            aTrackedChange.put("textRange", sRects.getStr());
-        }
+                const OString sRects = comphelper::string::join("; ", aRects);
+                aTrackedChange.put("textRange", sRects.getStr());
+            }
 
-        aTrackedChanges.push_back(std::make_pair("", aTrackedChange));
+            aTrackedChanges.push_back(std::make_pair("", aTrackedChange));
+        }
     }
 
     boost::property_tree::ptree aTree;
commit 71c6a308035eb687f8fd8823c1e16670ad2a450b
Author:     Andras Timar <andras.timar at collabora.com>
AuthorDate: Mon Nov 5 18:17:05 2018 +0100
Commit:     Andras Timar <andras.timar at collabora.com>
CommitDate: Tue Nov 13 21:06:44 2018 +0100

    LOK: update main thread
    
    Change-Id: I75df6ae9f9fb41b08a8774ce026f79fdd120b629
    Reviewed-on: https://gerrit.libreoffice.org/62921
    Reviewed-by: Michael Meeks <michael.meeks at collabora.com>
    Tested-by: Michael Meeks <michael.meeks at collabora.com>
    (cherry picked from commit 6f076e75b2adb4628ee3cea311781c40f219bba7)

diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx
index 10e81de091e5..7637f764b46d 100644
--- a/desktop/source/lib/init.cxx
+++ b/desktop/source/lib/init.cxx
@@ -3630,6 +3630,8 @@ static void lo_startmain(void*)
     if (GetpApp())
         Application::GetSolarMutex().tryToAcquire();
 
+    Application::UpdateMainThread();
+
     soffice_main();
 }
 
diff --git a/include/vcl/svapp.hxx b/include/vcl/svapp.hxx
index 9b930b3127d9..014850eba019 100644
--- a/include/vcl/svapp.hxx
+++ b/include/vcl/svapp.hxx
@@ -1355,6 +1355,9 @@ public:
     static void                 ShowNativeErrorBox(const OUString& sTitle  ,
                                                    const OUString& sMessage);
 
+    /** Update main thread identifier */
+    static void                 UpdateMainThread();
+
     /** Do we have a native / system file selector available?
 
      @returns True if native file selector is available, false otherwise.
diff --git a/vcl/source/app/svapp.cxx b/vcl/source/app/svapp.cxx
index e08adff710e3..c412728cd6a4 100644
--- a/vcl/source/app/svapp.cxx
+++ b/vcl/source/app/svapp.cxx
@@ -1383,6 +1383,13 @@ void Application::SetHelp( Help* pHelp )
     ImplGetSVData()->maAppData.mpHelp = pHelp;
 }
 
+void Application::UpdateMainThread()
+{
+    ImplSVData* pSVData = ImplGetSVData();
+    if (pSVData)
+        pSVData->mnMainThreadId = osl::Thread::getCurrentIdentifier();
+}
+
 Help* Application::GetHelp()
 {
     return ImplGetSVData()->maAppData.mpHelp;
commit a3b3eea394a5e6388e84d69f32721d11c2e7b2be
Author:     Samuel Mehrbrodt <Samuel.Mehrbrodt at cib.de>
AuthorDate: Wed Mar 14 14:25:44 2018 +0100
Commit:     Andras Timar <andras.timar at collabora.com>
CommitDate: Tue Nov 13 21:06:37 2018 +0100

    tdf#116342 Allow selecting text boxes anywhere by default
    
    Not only by hitting the (invisble) frame or the text content.
    
    Change-Id: I125f76a102611b628411d8c5acf70e3ed9e5e8fe
    Reviewed-on: https://gerrit.libreoffice.org/51276
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Samuel Mehrbrodt <Samuel.Mehrbrodt at cib.de>
    (cherry picked from commit d799436414ab7e28b6bf9a918fd3779b3fc85008)
    (cherry picked from commit ead83a1a3a346ae8a8206274954edabc6ce1116e)

diff --git a/desktop/qa/desktop_lib/test_desktop_lib.cxx b/desktop/qa/desktop_lib/test_desktop_lib.cxx
index 7c5c0c18ab38..5dacf4a6255d 100644
--- a/desktop/qa/desktop_lib/test_desktop_lib.cxx
+++ b/desktop/qa/desktop_lib/test_desktop_lib.cxx
@@ -1233,7 +1233,8 @@ void DesktopLOKTest::testContextMenuImpress()
     pDocument->pClass->initializeForRendering(pDocument, nullptr);
     pDocument->pClass->registerCallback(pDocument, &DesktopLOKTest::callback, this);
 
-    Point aRandomPoint(1150, 1100);
+    // random point where we don't hit an underlying comment or text box
+    Point aRandomPoint(10, 1150);
     pDocument->pClass->postMouseEvent(pDocument,
                                       LOK_MOUSEEVENT_MOUSEBUTTONDOWN,
                                       aRandomPoint.X(), aRandomPoint.Y(),
diff --git a/officecfg/registry/schema/org/openoffice/Office/Draw.xcs b/officecfg/registry/schema/org/openoffice/Office/Draw.xcs
index f92e9a1c4d74..45b4c8ecd125 100644
--- a/officecfg/registry/schema/org/openoffice/Office/Draw.xcs
+++ b/officecfg/registry/schema/org/openoffice/Office/Draw.xcs
@@ -368,7 +368,7 @@
             <desc>Indicates whether a text frame can only be selected by clicking on the text or by clicking somewhere in the frame.</desc>
             <label>Only text area selectable</label>
           </info>
-          <value>true</value>
+          <value>false</value>
         </prop>
       </group>
       <group oor:name="CrossFading">
diff --git a/officecfg/registry/schema/org/openoffice/Office/Impress.xcs b/officecfg/registry/schema/org/openoffice/Office/Impress.xcs
index 323e7eff5639..f87f68d779c1 100644
--- a/officecfg/registry/schema/org/openoffice/Office/Impress.xcs
+++ b/officecfg/registry/schema/org/openoffice/Office/Impress.xcs
@@ -591,7 +591,7 @@
             <desc>Indicates whether a text frame can only be selected by clicking on the text or by clicking somewhere in the frame.</desc>
             <label>Only text area selectable</label>
           </info>
-          <value>true</value>
+          <value>false</value>
         </prop>
       </group>
       <group oor:name="NewDoc">
commit 691763cee46a2267e53caf75f73fd5a2beb1430f
Author:     Caolán McNamara <caolanm at redhat.com>
AuthorDate: Thu Oct 18 20:39:23 2018 +0100
Commit:     Andras Timar <andras.timar at collabora.com>
CommitDate: Tue Nov 13 21:06:32 2018 +0100

    keep pyuno script processing below base uri
    
    Change-Id: Icc13fb7193fb1e7c50e0df286161a10b4ed636c7
    Reviewed-on: https://gerrit.libreoffice.org/61969
    Tested-by: Jenkins
    Reviewed-by: Stephan Bergmann <sbergman at redhat.com>
    (cherry picked from commit b1c85cdb37a47998f8ab135fbc96f186334b171c)
    (cherry picked from commit a9d81dd30d809b9c5ce2d3e4752039f19be70494)
    (cherry picked from commit 4c0d9942ebd56e83e83ac3079528e62ce5644008)

diff --git a/scripting/source/pyprov/pythonscript.py b/scripting/source/pyprov/pythonscript.py
index 68a1bacd1462..d96a7afcba6f 100644
--- a/scripting/source/pyprov/pythonscript.py
+++ b/scripting/source/pyprov/pythonscript.py
@@ -25,6 +25,7 @@ import imp
 import time
 import ast
 import platform
+from com.sun.star.uri.RelativeUriExcessParentSegments import RETAIN
 
 try:
     unicode
@@ -212,8 +213,33 @@ class MyUriHelper:
 
     def scriptURI2StorageUri( self, scriptURI ):
         try:
-            myUri = self.m_uriRefFac.parse(scriptURI)
-            ret = self.m_baseUri + "/" + myUri.getName().replace( "|", "/" )
+            # base path to the python script location
+            sBaseUri = self.m_baseUri + "/"
+            xBaseUri = self.m_uriRefFac.parse(sBaseUri)
+
+            # path to the .py file + "$functionname, arguments, etc
+            xStorageUri = self.m_uriRefFac.parse(scriptURI)
+            sStorageUri = xStorageUri.getName().replace( "|", "/" );
+
+            # path to the .py file, relative to the base
+            sFileUri = sStorageUri[0:sStorageUri.find("$")]
+            xFileUri = self.m_uriRefFac.parse(sFileUri)
+            if not xFileUri:
+                message = "pythonscript: invalid relative uri '" + sFileUri+ "'"
+                log.debug( message )
+                raise RuntimeException( message )
+
+            # absolute path to the .py file
+            xAbsScriptUri = self.m_uriRefFac.makeAbsolute(xBaseUri, xFileUri, True, RETAIN)
+            sAbsScriptUri = xAbsScriptUri.getUriReference()
+
+            # ensure py file is under the base path
+            if not sAbsScriptUri.startswith(sBaseUri):
+                message = "pythonscript: storage uri '" + sAbsScriptUri + "' not in base uri '" + self.m_baseUri + "'"
+                log.debug( message )
+                raise RuntimeException( message )
+
+            ret = sBaseUri + sStorageUri
             log.debug( "converting scriptURI="+scriptURI + " to storageURI=" + ret )
             return ret
         except UnoException as e:
commit fcea07243eb4c2aea3db928bce69c53ce19b3f65
Author:     Caolán McNamara <caolanm at redhat.com>
AuthorDate: Wed Aug 15 14:13:02 2018 +0100
Commit:     Andras Timar <andras.timar at collabora.com>
CommitDate: Tue Nov 13 21:06:27 2018 +0100

    outer loop unrelated to inner loop
    
    since original checkin of...
    
    commit 9cddf9da7fb256418e1bc3b4719abb55e3b0604c
    Date:   Tue May 22 15:33:44 2007 +0000
    
        INTEGRATION: CWS chart2mst3 (1.1.2); FILE ADDED
    ...
        2006/12/13 12:31:03 tl 1.1.2.38: #i71244# update charts in writer
    
    where I think this LockUnlockAllCharts chart2 loop was modelled on
    the previous chart[1] styles loop of e.g. DoUpdateAllCharts which
    loop over tables.
    
    chart2 objects are unrelated to these tables, so remove the outer
    loop, which then means the ofz#9689 ofz#9856 ofz9874 crashes that
    made me look at it will get fixed
    
    Change-Id: I7d7ba0a2aa257b5aa399f20d902f01306fbaecff
    Reviewed-on: https://gerrit.libreoffice.org/59112
    Tested-by: Jenkins
    Reviewed-by: Michael Stahl <Michael.Stahl at cib.de>
    (cherry picked from commit eadf6f4551416430b58efc42a5756556df0a237d)
    (cherry picked from commit 74de907344923a9f9575927fca8d43260f86f4c9)
    (cherry picked from commit c7b0292184c0942ca00633b88e76367092f3ea91)
    (cherry picked from commit d20db10442dcc6c0c93d11219c1e60ba6d91245f)

diff --git a/sw/source/core/unocore/unochart.cxx b/sw/source/core/unocore/unochart.cxx
index 8ae7d5bc8652..a8f8898507e3 100644
--- a/sw/source/core/unocore/unochart.cxx
+++ b/sw/source/core/unocore/unochart.cxx
@@ -119,43 +119,30 @@ void SwChartLockController_Helper::LockUnlockAllCharts( bool bLock )
     if (!pDoc)
         return;
 
-    const SwFrameFormats& rTableFormats = *pDoc->GetTableFrameFormats();
-    for( size_t n = 0; n < rTableFormats.size(); ++n )
+    uno::Reference< frame::XModel > xRes;
+    SwOLENode *pONd;
+    SwStartNode *pStNd;
+    SwNodeIndex aIdx( *pDoc->GetNodes().GetEndOfAutotext().StartOfSectionNode(), 1 );
+    while( nullptr != (pStNd = aIdx.GetNode().GetStartNode()) )
     {
-        SwTable* pTmpTable;
-        const SwTableNode* pTableNd;
-        const SwFrameFormat* pFormat = rTableFormats[ n ];
-
-        if( nullptr != ( pTmpTable = SwTable::FindTable( pFormat ) ) &&
-            nullptr != ( pTableNd = pTmpTable->GetTableNode() ) &&
-            pTableNd->GetNodes().IsDocNodes() )
+        ++aIdx;
+        if (nullptr != ( pONd = aIdx.GetNode().GetOLENode() ) &&
+            !pONd->GetChartTableName().isEmpty() /* is chart object? */)
         {
-            uno::Reference< frame::XModel > xRes;
-            SwOLENode *pONd;
-            SwStartNode *pStNd;
-            SwNodeIndex aIdx( *pDoc->GetNodes().GetEndOfAutotext().StartOfSectionNode(), 1 );
-            while( nullptr != (pStNd = aIdx.GetNode().GetStartNode()) )
+            uno::Reference < embed::XEmbeddedObject > xIP = pONd->GetOLEObj().GetOleRef();
+            if ( svt::EmbeddedObjectRef::TryRunningState( xIP ) )
             {
-                ++aIdx;
-                if (nullptr != ( pONd = aIdx.GetNode().GetOLENode() ) &&
-                    !pONd->GetChartTableName().isEmpty() /* is chart object? */)
+                xRes.set( xIP->getComponent(), uno::UNO_QUERY );
+                if (xRes.is())
                 {
-                    uno::Reference < embed::XEmbeddedObject > xIP = pONd->GetOLEObj().GetOleRef();
-                    if ( svt::EmbeddedObjectRef::TryRunningState( xIP ) )
-                    {
-                        xRes.set( xIP->getComponent(), uno::UNO_QUERY );
-                        if (xRes.is())
-                        {
-                            if (bLock)
-                                xRes->lockControllers();
-                            else
-                                xRes->unlockControllers();
-                        }
-                    }
+                    if (bLock)
+                        xRes->lockControllers();
+                    else
+                        xRes->unlockControllers();
                 }
-                aIdx.Assign( *pStNd->EndOfSectionNode(), + 1 );
             }
         }
+        aIdx.Assign( *pStNd->EndOfSectionNode(), + 1 );
     }
 
     bIsLocked = bLock;
commit f712c91f34534462feba5a4a9217122ce332a671
Author:     Eike Rathke <erack at redhat.com>
AuthorDate: Thu Sep 20 18:12:03 2018 +0200
Commit:     Andras Timar <andras.timar at collabora.com>
CommitDate: Tue Nov 13 21:06:22 2018 +0100

    Resolves: tdf#119954 do not copy the old parent, init with new parent instead
    
    The parent is always the ScDBCollection that contains the
    ScDBCollection::NamedDBs container, not the one the
    ScDBCollection::NamedDBs was copy-constructed from.
    
    Change-Id: Ia409347f3aeb9ad7a5e68da7af727adfac98d6a2
    Reviewed-on: https://gerrit.libreoffice.org/60833
    Reviewed-by: Eike Rathke <erack at redhat.com>
    Tested-by: Jenkins
    (cherry picked from commit 7ea5d339dc4d8412f436f3affa589bfbd0b1ef68)
    (cherry picked from commit 3298d3c68fa17b350ef7bec8271fcfc673b5e1a7)
    (cherry picked from commit 15ce830eb8994bf1c01389b53c05aed7ed9daba4)

diff --git a/sc/inc/dbdata.hxx b/sc/inc/dbdata.hxx
index df6b88d4dbb9..27a7cb77b4ac 100644
--- a/sc/inc/dbdata.hxx
+++ b/sc/inc/dbdata.hxx
@@ -241,7 +241,8 @@ public:
         DBsType m_DBs;
         ScDBCollection& mrParent;
         NamedDBs(ScDBCollection& rParent, ScDocument& rDoc);
-        NamedDBs(const NamedDBs& r);
+        NamedDBs(const NamedDBs& r, ScDBCollection& rParent);
+        NamedDBs(const NamedDBs&) = delete;
         virtual ~NamedDBs() override;
         NamedDBs & operator=(NamedDBs const&) = delete;
         void initInserted( ScDBData* p );
diff --git a/sc/source/core/tool/dbdata.cxx b/sc/source/core/tool/dbdata.cxx
index 1d62a479981b..31c1977ca064 100644
--- a/sc/source/core/tool/dbdata.cxx
+++ b/sc/source/core/tool/dbdata.cxx
@@ -1071,9 +1071,9 @@ ScRangeList& ScDBDataContainerBase::GetDirtyTableColumnNames()
 ScDBCollection::NamedDBs::NamedDBs(ScDBCollection& rParent, ScDocument& rDoc) :
     ScDBDataContainerBase(rDoc), mrParent(rParent) {}
 
-ScDBCollection::NamedDBs::NamedDBs(const NamedDBs& r)
+ScDBCollection::NamedDBs::NamedDBs(const NamedDBs& r, ScDBCollection& rParent)
     : ScDBDataContainerBase(r.mrDoc)
-    , mrParent(r.mrParent)
+    , mrParent(rParent)
 {
     for (auto const& it : r.m_DBs)
     {
@@ -1288,7 +1288,7 @@ ScDBCollection::ScDBCollection(ScDocument* pDocument) :
     pDoc(pDocument), nEntryIndex(1), maNamedDBs(*this, *pDocument) {}
 
 ScDBCollection::ScDBCollection(const ScDBCollection& r) :
-    pDoc(r.pDoc), nEntryIndex(r.nEntryIndex), maNamedDBs(r.maNamedDBs), maAnonDBs(r.maAnonDBs) {}
+    pDoc(r.pDoc), nEntryIndex(r.nEntryIndex), maNamedDBs(r.maNamedDBs, *this), maAnonDBs(r.maAnonDBs) {}
 
 const ScDBData* ScDBCollection::GetDBAtCursor(SCCOL nCol, SCROW nRow, SCTAB nTab, ScDBDataPortion ePortion) const
 {
commit 46c0aca3e53a26219ed14e83b603a13d486ed5c5
Author:     Caolán McNamara <caolanm at redhat.com>
AuthorDate: Thu Sep 20 16:03:24 2018 +0100
Commit:     Andras Timar <andras.timar at collabora.com>
CommitDate: Tue Nov 13 21:06:15 2018 +0100

    ofz#10523 guard aginst 0 pF->nLCode
    
    Change-Id: I8ef476e06f54ddd57be907488a8a65314abda3ee
    (cherry picked from commit 108eca19c9043895f26c889c90b3f4081113a3fb)
    (cherry picked from commit 40d91027e70518dff8404aaf10fd9830995d9409)

diff --git a/sw/source/filter/ww8/ww8par3.cxx b/sw/source/filter/ww8/ww8par3.cxx
index 5f334ad3361e..e1031167416a 100644
--- a/sw/source/filter/ww8/ww8par3.cxx
+++ b/sw/source/filter/ww8/ww8par3.cxx
@@ -102,7 +102,7 @@ eF_ResT SwWW8ImplReader::Read_F_FormTextBox( WW8FieldDesc* pF, OUString& rStr )
 {
     WW8FormulaEditBox aFormula(*this);
 
-    if (rStr[pF->nLCode-1]==0x01) {
+    if (pF->nLCode && rStr[pF->nLCode-1]==0x01) {
         ImportFormulaControl(aFormula,pF->nSCode+pF->nLCode-1, WW8_CT_EDIT);
     }
 
commit 43f9d728231a6c7d707e3c0db6ef74f3637c0d20
Author:     László Németh <nemeth at numbertext.org>
AuthorDate: Fri Aug 3 16:11:16 2018 +0200
Commit:     Andras Timar <andras.timar at collabora.com>
CommitDate: Mon Sep 17 17:52:23 2018 +0200

    tdf#41425 XLS/XLSX export: workaround for style and validation loss
    
    of cells of blank rows.
    
    This workaround is probably a fix for problems of most users, but for
    a full solution it needs to extend the workaround for all rows with not
    default settings, also avoiding of the possible performance problems.
    
    Note: the number 1000 of the extra rows came from a similar workaround used in
    XLSX export of Google Spreadsheets, but instead of listing extra empty 1000
    rows in OOXML, this fix writes only the cells with not default settings from
    the extra 1000 blank rows.
    
    Reviewed-on: https://gerrit.libreoffice.org/58575
    Tested-by: Jenkins
    Reviewed-by: László Németh <nemeth at numbertext.org>
    (cherry picked from commit 99b9ea63bfc9a5fe63a0cd7b30b66ce2c1bde08e)
    Reviewed-on: https://gerrit.libreoffice.org/58812
    Reviewed-by: Christian Lohmaier <lohmaier+LibreOffice at googlemail.com>
    (cherry picked from commit d7cbaac61b8f3575184c675a760907c3b4bb225e)
    
    Change-Id: Icac9441b7eb1520dcd20fc04337e070d070591c7

diff --git a/sc/qa/unit/data/xlsx/tdf41425.xlsx b/sc/qa/unit/data/xlsx/tdf41425.xlsx
new file mode 100644
index 000000000000..f7d3ec9ed6ec
Binary files /dev/null and b/sc/qa/unit/data/xlsx/tdf41425.xlsx differ
diff --git a/sc/qa/unit/subsequent_export-test.cxx b/sc/qa/unit/subsequent_export-test.cxx
index 793b239d510d..36b3e9c8fd15 100644
--- a/sc/qa/unit/subsequent_export-test.cxx
+++ b/sc/qa/unit/subsequent_export-test.cxx
@@ -220,6 +220,7 @@ public:
     void testPivotTableOutlineModeXLSX();
     void testPivotTableDuplicatedMemberFilterXLSX();
     void testPivotTableTabularModeXLSX();
+    void testKeepSettingsOfBlankRows();
 
     CPPUNIT_TEST_SUITE(ScExportTest);
     CPPUNIT_TEST(test);
@@ -339,6 +340,7 @@ public:
     CPPUNIT_TEST(testPivotTableOutlineModeXLSX);
     CPPUNIT_TEST(testPivotTableDuplicatedMemberFilterXLSX);
     CPPUNIT_TEST(testPivotTableTabularModeXLSX);
+    CPPUNIT_TEST(testKeepSettingsOfBlankRows);
 
     CPPUNIT_TEST_SUITE_END();
 
@@ -5262,6 +5264,19 @@ void ScExportTest::testPivotTableTabularModeXLSX()
     assertXPath(pTable, "/x:pivotTableDefinition/x:pivotFields/x:pivotField[1]", "outline", "0");
 }
 
+void ScExportTest::testKeepSettingsOfBlankRows()
+{
+    ScDocShellRef xDocSh = loadDoc("tdf41425.", FORMAT_XLSX);
+    CPPUNIT_ASSERT(xDocSh.Is());
+
+    std::shared_ptr<utl::TempFile> pXPathFile = ScBootstrapFixture::exportTo(&(*xDocSh), FORMAT_XLSX);
+    xmlDocPtr pSheet = XPathHelper::parseExport(pXPathFile, m_xSFactory, "xl/worksheets/sheet1.xml");
+    CPPUNIT_ASSERT(pSheet);
+
+    // saved blank row with not default setting in A2
+    assertXPath(pSheet, "/x:worksheet/x:sheetData/x:row", 2);
+}
+
 CPPUNIT_TEST_SUITE_REGISTRATION(ScExportTest);
 
 CPPUNIT_PLUGIN_IMPLEMENT();
diff --git a/sc/source/filter/excel/xetable.cxx b/sc/source/filter/excel/xetable.cxx
index 29257f2df5ed..12e5afc0b5a7 100644
--- a/sc/source/filter/excel/xetable.cxx
+++ b/sc/source/filter/excel/xetable.cxx
@@ -2463,6 +2463,9 @@ XclExpCellTable::XclExpCellTable( const XclExpRoot& rRoot ) :
     if(nLastUsedScCol > nMaxScCol)
         nLastUsedScCol = nMaxScCol;
 
+    // check extra blank rows to avoid of losing their not default settings (workaround for tdf#41425)
+    nLastUsedScRow += 1000;
+
     if(nLastUsedScRow > nMaxScRow)
         nLastUsedScRow = nMaxScRow;
 


More information about the Libreoffice-commits mailing list