[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-6.4' - 9 commits - pyuno/source sdext/source sw/source

Caolán McNamara (via logerrit) logerrit at kemper.freedesktop.org
Mon Jun 22 06:53:20 UTC 2020


 pyuno/source/loader/pyuno_loader.cxx                    |   14 ++++++++++++--
 sdext/source/pdfimport/xpdfwrapper/pdfioutdev_gpl.cxx   |    4 +++-
 sw/source/core/doc/DocumentContentOperationsManager.cxx |   14 +++++++++++++-
 sw/source/core/docnode/ndsect.cxx                       |    5 ++++-
 sw/source/core/docnode/nodes.cxx                        |    6 +++++-
 sw/source/core/edit/eddel.cxx                           |   12 +++++++++++-
 sw/source/core/layout/colfrm.cxx                        |    3 +++
 sw/source/core/layout/frmtool.cxx                       |    3 ++-
 sw/source/core/undo/undel.cxx                           |   15 ++++++++++++++-
 sw/source/uibase/docvw/edtwin.cxx                       |    8 +++++---
 10 files changed, 72 insertions(+), 12 deletions(-)

New commits:
commit a204f13eb6415b9f90ae1563d03e0c719a593fdc
Author:     Caolán McNamara <caolanm at redhat.com>
AuthorDate: Fri Jun 19 11:32:00 2020 +0100
Commit:     Andras Timar <andras.timar at collabora.com>
CommitDate: Mon Jun 22 08:52:18 2020 +0200

    tdf#121384 don't leave a bare trailing : in PYTHONPATH
    
    and don't insert any empty path entries if that situation
    was to arise
    
    Change-Id: I8d8183485f457c3e4385181fee07390c4bfef603
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/96707
    Reviewed-by: Tomáš Chvátal <tchvatal at suse.com>
    Reviewed-by: Adolfo Jayme Barrientos <fitojb at ubuntu.com>
    Tested-by: Jenkins

diff --git a/pyuno/source/loader/pyuno_loader.cxx b/pyuno/source/loader/pyuno_loader.cxx
index ffdb81143961..e35148f8ddbc 100644
--- a/pyuno/source/loader/pyuno_loader.cxx
+++ b/pyuno/source/loader/pyuno_loader.cxx
@@ -145,6 +145,7 @@ static void setPythonHome ( const OUString & pythonHome )
 static void prependPythonPath( const OUString & pythonPathBootstrap )
 {
     OUStringBuffer bufPYTHONPATH( 256 );
+    bool bAppendSep = false;
     sal_Int32 nIndex = 0;
     while( true )
     {
@@ -160,15 +161,24 @@ static void prependPythonPath( const OUString & pythonPathBootstrap )
         }
         OUString systemPath;
         osl_getSystemPathFromFileURL( fileUrl.pData, &(systemPath.pData) );
-        bufPYTHONPATH.append( systemPath );
-        bufPYTHONPATH.append( static_cast<sal_Unicode>(SAL_PATHSEPARATOR) );
+        if (!systemPath.isEmpty())
+        {
+            if (bAppendSep)
+                bufPYTHONPATH.append(static_cast<sal_Unicode>(SAL_PATHSEPARATOR));
+            bufPYTHONPATH.append(systemPath);
+            bAppendSep = true;
+        }
         if( nNew == -1 )
             break;
         nIndex = nNew + 1;
     }
     const char * oldEnv = getenv( "PYTHONPATH");
     if( oldEnv )
+    {
+        if (bAppendSep)
+            bufPYTHONPATH.append( static_cast<sal_Unicode>(SAL_PATHSEPARATOR) );
         bufPYTHONPATH.append( OUString(oldEnv, strlen(oldEnv), osl_getThreadTextEncoding()) );
+    }
 
     OUString envVar("PYTHONPATH");
     OUString envValue(bufPYTHONPATH.makeStringAndClear());
commit 7631cf3837fa5c7327d9017ee2ed7638b449e4a7
Author:     Michael Stahl <Michael.Stahl at cib.de>
AuthorDate: Thu Jun 18 18:32:24 2020 +0200
Commit:     Andras Timar <andras.timar at collabora.com>
CommitDate: Mon Jun 22 08:52:12 2020 +0200

    tdf#133990 sw_redlinehide: fix Undo with section before table
    
    ... at start of document.
    
    The section node wasn't included in the PaM passed to SwUndoDelete,
    so on Undo it called MakeFrames() starting from the contained table
    node and crashed when reaching the section's end node.
    
    Fixed, then it crashes in Redo, because SwDoc::DelSectionFormat()
    calls SetModified() which calls some event listener which causes
    EndAllAction() to be called, which by itself is scary and then it
    crashes because the nodes array contains a bunch of deleted nodes.
    
    Not sure if that SetModified() serves any purpose, but it's pointless
    in Undo.
    
    (1st crash is regression from 68880a3004623553bf1920ad8a4a4d2be4bca234)
    
    Change-Id: Iafdd073ca9577bf54dd5a8ad2eb8f8f110db93b6
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/96620
    Tested-by: Jenkins
    Reviewed-by: Michael Stahl <michael.stahl at cib.de>
    (cherry picked from commit 57d488660572d62ef0371e50dcdd4ca7a6d98a14)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/96634
    Reviewed-by: Thorsten Behrens <Thorsten.Behrens at CIB.de>

diff --git a/sw/source/core/docnode/ndsect.cxx b/sw/source/core/docnode/ndsect.cxx
index 8655874fe858..ef388242fa67 100644
--- a/sw/source/core/docnode/ndsect.cxx
+++ b/sw/source/core/docnode/ndsect.cxx
@@ -598,7 +598,10 @@ void SwDoc::DelSectionFormat( SwSectionFormat *pFormat, bool bDelNodes )
 
     GetIDocumentUndoRedo().EndUndo(SwUndoId::DELSECTION, nullptr);
 
-    getIDocumentState().SetModified();
+    if (GetIDocumentUndoRedo().DoesUndo())
+    {   // TODO is this ever needed?
+        getIDocumentState().SetModified();
+    }
 }
 
 void SwDoc::UpdateSection( size_t const nPos, SwSectionData & rNewData,
diff --git a/sw/source/core/edit/eddel.cxx b/sw/source/core/edit/eddel.cxx
index 2951b56b4cd5..74e845353566 100644
--- a/sw/source/core/edit/eddel.cxx
+++ b/sw/source/core/edit/eddel.cxx
@@ -106,7 +106,17 @@ void SwEditShell::DeleteSel( SwPaM& rPam, bool* pUndo )
             pNewPam.reset(new SwPaM(*rPam.GetMark(), *rPam.GetPoint()));
             // Selection starts at the first para of the first cell, but we
             // want to delete the table node before the first cell as well.
-            pNewPam->Start()->nNode = pNewPam->Start()->nNode.GetNode().FindTableNode()->GetIndex();
+            while (SwTableNode const* pTableNode =
+                pNewPam->Start()->nNode.GetNode().StartOfSectionNode()->FindTableNode())
+            {
+                pNewPam->Start()->nNode = *pTableNode;
+            }
+            // tdf#133990 ensure section is included in SwUndoDelete
+            while (SwSectionNode const* pSectionNode =
+                pNewPam->Start()->nNode.GetNode().StartOfSectionNode()->FindSectionNode())
+            {
+                pNewPam->Start()->nNode = *pSectionNode;
+            }
             pNewPam->Start()->nContent.Assign(nullptr, 0);
             pPam = pNewPam.get();
         }
commit fb235b60aa440c0d7a952caf505478516f939212
Author:     Michael Stahl <Michael.Stahl at cib.de>
AuthorDate: Wed Jun 17 18:53:49 2020 +0200
Commit:     Andras Timar <andras.timar at collabora.com>
CommitDate: Mon Jun 22 08:52:07 2020 +0200

    tdf#134009 sw: prevent spurious undos in SwColumnFrame::DestroyImpl()
    
    SwUndoFrameFormatDelete is created for every destroyed column frame.
    
    Change-Id: I11e0399487a41c52768175faf3a3699b302ad317
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/96558
    Tested-by: Jenkins
    Reviewed-by: Michael Stahl <michael.stahl at cib.de>
    (cherry picked from commit 102a99e46bca9fb292cc1b2e7604020eb9ca43f4)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/96576
    Reviewed-by: Thorsten Behrens <Thorsten.Behrens at CIB.de>

diff --git a/sw/source/core/layout/colfrm.cxx b/sw/source/core/layout/colfrm.cxx
index b241257b4bda..dfb438953688 100644
--- a/sw/source/core/layout/colfrm.cxx
+++ b/sw/source/core/layout/colfrm.cxx
@@ -52,6 +52,9 @@ void SwColumnFrame::DestroyImpl()
         //I'm the only one, delete the format.
         //Get default format before, so the base class can cope with it.
         pDoc->GetDfltFrameFormat()->Add( this );
+        // tdf#134009, like #i32968# avoid SwUndoFrameFormatDelete creation,
+        // the format is owned by the SwColumnFrame, see lcl_AddColumns()
+        ::sw::UndoGuard const ug(pDoc->GetIDocumentUndoRedo());
         pDoc->DelFrameFormat( pFormat );
     }
 
commit 0faa0f66f54ac4c42e34f86c5737fb2dd437709f
Author:     Michael Stahl <Michael.Stahl at cib.de>
AuthorDate: Thu Jun 18 14:19:12 2020 +0200
Commit:     Andras Timar <andras.timar at collabora.com>
CommitDate: Mon Jun 22 08:52:03 2020 +0200

    tdf#134021 sw_redlinehide: fix crash if document contains only table
    
    This sets the m_bTableDelLastNd flag in SwUndoDelete, so a SwTextNode is
    created so that there's something in the document, and there are 2
    problems with Undo:
    
    1. ~SwIndexReg assert because there's a shell cursor on the text node;
       could fix this with some PaMCorrAbs() but let's just call
       DelFullPara() which takes care of that.
       (this likely isn't possible in the !m_bTableDelLastNd case)
    
    2. no frames are created in MakeFrames() because there's no node in the
       document with layout frames, so delete it at the end.
       (regression from 723728cd358693b8f4bc9d913541aa4479f2bd48)
    
    Change-Id: I6d8535ae1a2e607d665660f149b344e817bc8ab0
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/96604
    Tested-by: Jenkins
    Reviewed-by: Michael Stahl <michael.stahl at cib.de>
    (cherry picked from commit 5d836621326c68decaae09f1911d2d036a251b43)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/96632
    Reviewed-by: Thorsten Behrens <Thorsten.Behrens at CIB.de>

diff --git a/sw/source/core/undo/undel.cxx b/sw/source/core/undo/undel.cxx
index 0510ea64dc37..504bfee25164 100644
--- a/sw/source/core/undo/undel.cxx
+++ b/sw/source/core/undo/undel.cxx
@@ -860,6 +860,7 @@ void SwUndoDelete::UndoImpl(::sw::UndoRedoContext & rContext)
         SwPosition aPos( aIdx );
         if( !m_bDelFullPara )
         {
+            assert(!m_bTableDelLastNd || pInsNd->IsTextNode());
             if( pInsNd->IsTableNode() )
             {
                 pInsNd = rDoc.GetNodes().MakeTextNode( aIdx,
@@ -1046,8 +1047,11 @@ void SwUndoDelete::UndoImpl(::sw::UndoRedoContext & rContext)
         }
     }
     // delete the temporarily added Node
-    if( pInsNd )
+    if (pInsNd && !m_bTableDelLastNd)
+    {
+        assert(&aIdx.GetNode() == pInsNd);
         rDoc.GetNodes().Delete( aIdx );
+    }
     if( m_pRedlSaveData )
         SetSaveData(rDoc, *m_pRedlSaveData);
 
@@ -1139,6 +1143,15 @@ void SwUndoDelete::UndoImpl(::sw::UndoRedoContext & rContext)
         lcl_MakeAutoFrames(*rDoc.GetSpzFrameFormats(), pMovedNode->GetIndex());
     }
 
+    // tdf#134021 only after MakeFrames(), because it may be the only node
+    // that has layout frames
+    if (pInsNd && m_bTableDelLastNd)
+    {
+        assert(&aIdx.GetNode() == pInsNd);
+        SwPaM tmp(aIdx, aIdx);
+        rDoc.getIDocumentContentOperations().DelFullPara(tmp);
+    }
+
     AddUndoRedoPaM(rContext, true);
 }
 
commit a1b85912e65f51d09c3acdf84bc60d7c8d3da8b0
Author:     Michael Stahl <Michael.Stahl at cib.de>
AuthorDate: Fri Jun 19 15:05:42 2020 +0200
Commit:     Andras Timar <andras.timar at collabora.com>
CommitDate: Mon Jun 22 08:51:58 2020 +0200

    tdf#132326 sw_redlinehide: no frames allowed in Undo SwNodesArray
    
    This crashes in SwAccessibleParagraph::GetRealHeadingLevel(); the a11y
    should have been disposed earlier because the node it's connected to is
    in the Undo SwNodesArray.
    
    When SwUndoDelete::SwUndoDelete() calls SwNodes::MoveNodes(), all
    existing frames must be destroyed; the MoveNodes() would reset its flag
    temporarily inside a section, to delay creating the frames inside the
    section when moving to the live SwNodesArray, but this also prevents
    the deletion when moving in the other direction.
    
    (crash is regression from 723728cd358693b8f4bc9d913541aa4479f2bd48)
    
    Change-Id: I13719bf98ea96b8d68db3ee78cf7f4b61a99e7e5
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/96734
    Tested-by: Jenkins
    Reviewed-by: Michael Stahl <michael.stahl at cib.de>
    (cherry picked from commit a60dd9ef1361c5925803acaa5292e99277d1faf3)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/96701
    Reviewed-by: Thorsten Behrens <Thorsten.Behrens at CIB.de>

diff --git a/sw/source/core/docnode/nodes.cxx b/sw/source/core/docnode/nodes.cxx
index 2feef62276df..10f4ba61be03 100644
--- a/sw/source/core/docnode/nodes.cxx
+++ b/sw/source/core/docnode/nodes.cxx
@@ -661,7 +661,11 @@ bool SwNodes::MoveNodes( const SwNodeRange& aRange, SwNodes & rNodes,
                     {
                         pSctNd->NodesArrChgd();
                         ++nSectNdCnt;
-                        bNewFrames = false;
+                        // tdf#132326 do not let frames survive in undo nodes
+                        if (!GetDoc()->GetIDocumentUndoRedo().IsUndoNodes(rNodes))
+                        {
+                            bNewFrames = false;
+                        }
                     }
                 }
             }
commit 23254226c22f66ef03bc05769b94c7345c3547dc
Author:     Michael Stahl <Michael.Stahl at cib.de>
AuthorDate: Fri Jun 19 16:32:19 2020 +0200
Commit:     Andras Timar <andras.timar at collabora.com>
CommitDate: Mon Jun 22 08:51:54 2020 +0200

    tdf#127635 sw_redlinehide: put point at the end of deletion
    
    SwWrtShell::Insert() is called with a selection, so it first calls
    DeleteAndJoin() to get rid of the selection.
    
    With redlining enabled, this leaves the cursor as it was before, so if
    the point was at the start it still is at the start, so the following
    Insert will insert at the start of the selection.
    
    But then AutoCorrect wants to do things and it uses TextFrameIndex and
    ViewToModelPos and gets a result at the end of the delete redline,
    while the cursor remains at the start of the delete redline.
    
    Avoid this by swapping the selection after DeleteAndJoin() (and also
    DeleteRange() for consistency) so that insertion happens at end of
    redline (swap "above" DoWithBreaks because it creates temporary PaMs).
    
    (regression from sw_redlinehide)
    
    Change-Id: Ib5b0475f610c2ce426e9202e9d325dd0cc451d5c
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/96743
    Tested-by: Jenkins
    Reviewed-by: Michael Stahl <michael.stahl at cib.de>
    (cherry picked from commit 398ba26077f9029bdf6f7378bfc9ce8376b6f02d)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/96705
    Reviewed-by: Thorsten Behrens <Thorsten.Behrens at CIB.de>

diff --git a/sw/source/core/doc/DocumentContentOperationsManager.cxx b/sw/source/core/doc/DocumentContentOperationsManager.cxx
index 456b1ba60f93..08d7eb6f09fa 100644
--- a/sw/source/core/doc/DocumentContentOperationsManager.cxx
+++ b/sw/source/core/doc/DocumentContentOperationsManager.cxx
@@ -2007,6 +2007,11 @@ void DocumentContentOperationsManager::DeleteRange( SwPaM & rPam )
 {
     lcl_DoWithBreaks( *this, rPam, &DocumentContentOperationsManager::DeleteRangeImpl );
 
+    if (m_rDoc.getIDocumentRedlineAccess().IsRedlineOn())
+    {
+        rPam.Normalize(false); // tdf#127635 put point at the end of deletion
+    }
+
     if (!m_rDoc.getIDocumentRedlineAccess().IsIgnoreRedline()
         && !m_rDoc.getIDocumentRedlineAccess().GetRedlineTable().empty())
     {
@@ -2178,10 +2183,17 @@ bool DocumentContentOperationsManager::DeleteAndJoin( SwPaM & rPam,
     if ( lcl_StrLenOverflow( rPam ) )
         return false;
 
-    return lcl_DoWithBreaks( *this, rPam, (m_rDoc.getIDocumentRedlineAccess().IsRedlineOn())
+    bool const ret = lcl_DoWithBreaks( *this, rPam, (m_rDoc.getIDocumentRedlineAccess().IsRedlineOn())
                 ? &DocumentContentOperationsManager::DeleteAndJoinWithRedlineImpl
                 : &DocumentContentOperationsManager::DeleteAndJoinImpl,
                 bForceJoinNext );
+
+    if (m_rDoc.getIDocumentRedlineAccess().IsRedlineOn())
+    {
+        rPam.Normalize(false); // tdf#127635 put point at the end of deletion
+    }
+
+    return ret;
 }
 
 // It seems that this is mostly used by SwDoc internals; the only
commit 42eaabf3237e705927a0acd77cf40612464350e2
Author:     Martin Whitaker <foss at martin-whitaker.me.uk>
AuthorDate: Fri May 8 21:47:25 2020 +0200
Commit:     Andras Timar <andras.timar at collabora.com>
CommitDate: Mon Jun 22 08:51:49 2020 +0200

    tdf#131353: Fix build with poppler 0.86.0
    
    Change-Id: I89b4635a6a3e3a5522172d6f4c3f14e6c14994b1
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/93789
    Tested-by: René Engelhard <rene at debian.org>
    Tested-by: Jenkins
    Reviewed-by: Tomáš Chvátal <tchvatal at suse.com>
    (cherry picked from commit b42ab78fb871924896b3cc38a7b2f1257151f711)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/96639
    Reviewed-by: Adolfo Jayme Barrientos <fitojb at ubuntu.com>

diff --git a/sdext/source/pdfimport/xpdfwrapper/pdfioutdev_gpl.cxx b/sdext/source/pdfimport/xpdfwrapper/pdfioutdev_gpl.cxx
index e9c2a407c279..16ad04bf660a 100644
--- a/sdext/source/pdfimport/xpdfwrapper/pdfioutdev_gpl.cxx
+++ b/sdext/source/pdfimport/xpdfwrapper/pdfioutdev_gpl.cxx
@@ -563,7 +563,9 @@ void PDFOutDev::processLink(Link* link, Catalog*)
     if (!(pAction && pAction->getKind() == actionURI))
         return;
 
-#if POPPLER_CHECK_VERSION(0, 72, 0)
+#if POPPLER_CHECK_VERSION(0, 86, 0)
+    const char* pURI = static_cast<LinkURI*>(pAction)->getURI().c_str();
+#elif POPPLER_CHECK_VERSION(0, 72, 0)
     const char* pURI = static_cast<LinkURI*>(pAction)->getURI()->c_str();
 #else
     const char* pURI = static_cast<LinkURI*>(pAction)->getURI()->getCString();
commit 59f29606ca39678b60a5f63c83623034f6bc5038
Author:     Michael Stahl <Michael.Stahl at cib.de>
AuthorDate: Thu Jun 18 19:16:27 2020 +0200
Commit:     Andras Timar <andras.timar at collabora.com>
CommitDate: Mon Jun 22 08:51:44 2020 +0200

    tdf#133981 sw_redlinehide: oops, InsertCnt_() is missing null...
    
    ... pointer check.
    
    (regression from 55576842ec72a748d0bad123d41fa03c89fc136d)
    
    Change-Id: I4478c45d10ac516afd6360e4083b00d667c678fb
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/96621
    Tested-by: Jenkins
    Reviewed-by: Michael Stahl <michael.stahl at cib.de>
    (cherry picked from commit 17f47b3972301273716466656e775f3f09d681d8)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/96692
    Reviewed-by: Adolfo Jayme Barrientos <fitojb at ubuntu.com>

diff --git a/sw/source/core/layout/frmtool.cxx b/sw/source/core/layout/frmtool.cxx
index 2a2a59377636..9765451c3aca 100644
--- a/sw/source/core/layout/frmtool.cxx
+++ b/sw/source/core/layout/frmtool.cxx
@@ -1701,7 +1701,8 @@ void InsertCnt_( SwLayoutFrame *pLay, SwDoc *pDoc,
                     SwFrame *const pNext(
                         // if there's a parent section, it has been split
                         // into 2 SwSectionFrame already :(
-                        (   pFrame->GetNext()->IsSctFrame()
+                        (   pFrame->GetNext()
+                         && pFrame->GetNext()->IsSctFrame()
                          && pActualSection->GetUpper()
                          && pActualSection->GetUpper()->GetSectionNode() ==
                              static_cast<SwSectionFrame const*>(pFrame->GetNext())->GetSection()->GetFormat()->GetSectionNode())
commit 4caf45d6ad733375172fcd2c451cfdd31edacacc
Author:     Justin Luth <jluth at mail.com>
AuthorDate: Wed Jun 17 09:00:33 2020 +0300
Commit:     Andras Timar <andras.timar at collabora.com>
CommitDate: Mon Jun 22 08:51:38 2020 +0200

    tdf#134023 sw ui: stay at footer ONLY when showing control
    
    This adds a missing piece to LO 6.4's
    commit 342a5890dbcddccb4013e201e3ff3d9e6967e733
    
    That tdf#84929 commit message suggested:
      One additional limitation could be added to only apply this
      if it is dealing with the footer, since in the case of a
      header there would be no screen-jump.
    
    and this bug report shows why that is necessary.
    I'm not sure why I didn't apply that immediately.
    Perhaps to help identify situations where the entire
    concept might be bad?
    
    Change-Id: Icea861bec45262eed88c38bb7eea910289c06870
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/96487
    Tested-by: Justin Luth <justin_luth at sil.org>
    Reviewed-by: Justin Luth <justin_luth at sil.org>
    (cherry picked from commit c3cf3e908add6b6617eb0ee12385fbd8a70a9887)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/96494
    Tested-by: Jenkins
    Reviewed-by: Adolfo Jayme Barrientos <fitojb at ubuntu.com>
    (cherry picked from commit df4585686eb56d95a871dd528ad06fd980a58591)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/96505

diff --git a/sw/source/uibase/docvw/edtwin.cxx b/sw/source/uibase/docvw/edtwin.cxx
index 8aaa7a5cdb2a..d852df2d2182 100644
--- a/sw/source/uibase/docvw/edtwin.cxx
+++ b/sw/source/uibase/docvw/edtwin.cxx
@@ -2843,10 +2843,12 @@ void SwEditWin::MouseButtonDown(const MouseEvent& _rMEvt)
                     // Repaint everything
                     Invalidate();
 
-                    // If the control had not been showing, do not return to the cursor position,
+                    // tdf#84929. If the footer control had not been showing, do not change the cursor position,
                     // because the user may have scrolled to turn on the separator control and
-                    // if the cursor is now off-screen, then the user would need to scroll back again to use the control.
-                    if ( !bSeparatorWasVisible && rSh.GetViewOptions()->IsUseHeaderFooterMenu() && !Application::IsHeadlessModeEnabled() )
+                    // if the cursor cannot be positioned on-screen, then the user would need to scroll back again to use the control.
+                    // This should only be done for the footer. The cursor can always be re-positioned near the header. tdf#134023.
+                    if ( eControl == FrameControlType::Footer && !bSeparatorWasVisible
+                         && rSh.GetViewOptions()->IsUseHeaderFooterMenu() && !Application::IsHeadlessModeEnabled() )
                         return;
                 }
             }


More information about the Libreoffice-commits mailing list