From 60d70e2c97b70d26272bd7c2761eaa41749189cd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= Date: Fri, 11 Apr 2014 14:50:44 +0100 Subject: [PATCH] Related: rhbz#1081176 don't jump to cursor pos when we don't want to --- ...081176-don-t-jump-to-cursor-pos-when.patch | 84 +++++++++++++++++++ libreoffice.spec | 6 +- 2 files changed, 89 insertions(+), 1 deletion(-) create mode 100644 0001-Resolves-rhbz-1081176-don-t-jump-to-cursor-pos-when.patch diff --git a/0001-Resolves-rhbz-1081176-don-t-jump-to-cursor-pos-when.patch b/0001-Resolves-rhbz-1081176-don-t-jump-to-cursor-pos-when.patch new file mode 100644 index 0000000..0368f0e --- /dev/null +++ b/0001-Resolves-rhbz-1081176-don-t-jump-to-cursor-pos-when.patch @@ -0,0 +1,84 @@ +From bd06f80114633be741e8db2d69565d191555a539 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= +Date: Fri, 11 Apr 2014 14:45:39 +0100 +Subject: [PATCH] Resolves: rhbz#1081176: don't jump to cursor pos when... + +launching a new window view of a document. This was happening because of +(temporary) activation of the modified flag (from updating the document stats +in the bottom bar) triggering a scrolll to the current cursor position of the +old document + +Change-Id: I6e1a3c07b66ff6373345850d1449f17c1f0baa17 +(cherry picked from commit e12184393f0591b5c5d9218062cc0a4bced6d4e6) +--- + sw/source/core/doc/doc.cxx | 40 +++++++++++++++++++++++++++++++++++++++- + 1 file changed, 39 insertions(+), 1 deletion(-) + +diff --git a/sw/source/core/doc/doc.cxx b/sw/source/core/doc/doc.cxx +index 6382d74..6b54528 100644 +--- a/sw/source/core/doc/doc.cxx ++++ b/sw/source/core/doc/doc.cxx +@@ -1650,6 +1650,41 @@ void SwDoc::CalculatePagePairsForProspectPrinting( + // thus we are done here. + } + ++namespace ++{ ++ class LockAllViews ++ { ++ std::stack m_aViewWasLocked; ++ SwViewShell* m_pViewShell; ++ public: ++ LockAllViews(SwViewShell *pViewShell) ++ : m_pViewShell(pViewShell) ++ { ++ if (!m_pViewShell) ++ return; ++ SwViewShell *pSh = m_pViewShell; ++ do ++ { ++ m_aViewWasLocked.push(pSh->IsViewLocked()); ++ pSh->LockView(true); ++ pSh = (SwViewShell*)pSh->GetNext(); ++ } while (pSh != m_pViewShell); ++ } ++ ~LockAllViews() ++ { ++ if (!m_pViewShell) ++ return; ++ SwViewShell *pSh = m_pViewShell; ++ do ++ { ++ pSh->LockView(m_aViewWasLocked.top()); ++ m_aViewWasLocked.pop(); ++ pSh = (SwViewShell*)pSh->GetNext(); ++ } while (pSh != m_pViewShell); ++ } ++ }; ++} ++ + // returns true while there is more to do + bool SwDoc::IncrementalDocStatCalculate(long nChars, bool bFields) + { +@@ -1720,7 +1755,7 @@ bool SwDoc::IncrementalDocStatCalculate(long nChars, bool bFields) + aStat[n++].Value <<= (sal_Int32)mpDocStat->nCharExcludingSpaces; + + // For e.g. autotext documents there is no pSwgInfo (#i79945) +- SfxObjectShell * const pObjShell( GetDocShell() ); ++ SwDocShell* pObjShell(GetDocShell()); + if (pObjShell) + { + const uno::Reference xDPS( +@@ -1730,6 +1765,9 @@ bool SwDoc::IncrementalDocStatCalculate(long nChars, bool bFields) + // #i96786#: do not set modified flag when updating statistics + const bool bDocWasModified( IsModified() ); + const ModifyBlocker_Impl b(pObjShell); ++ // rhbz#1081176: don't jump to cursor pos because of (temporary) ++ // activation of modified flag triggering move to input position ++ LockAllViews aViewGuard((SwViewShell*)pObjShell->GetWrtShell()); + xDocProps->setDocumentStatistics(aStat); + if (!bDocWasModified) + { +-- +1.8.5.3 + diff --git a/libreoffice.spec b/libreoffice.spec index a9ce1a1..6f7f2e4 100644 --- a/libreoffice.spec +++ b/libreoffice.spec @@ -43,7 +43,7 @@ Summary: Free Software Productivity Suite Name: libreoffice Epoch: 1 Version: %{libo_version}.3 -Release: 1%{?libo_prerelease}%{?dist} +Release: 2%{?libo_prerelease}%{?dist} License: (MPLv1.1 or LGPLv3+) and LGPLv3 and LGPLv2+ and BSD and (MPLv1.1 or GPLv2 or LGPLv2 or Netscape) and Public Domain and ASL 2.0 and Artistic and MPLv2.0 Group: Applications/Productivity URL: http://www.libreoffice.org/default/ @@ -290,6 +290,7 @@ Patch26: 0001-Package-GeneratedPackage-fixup.patch Patch27: 0001-rhbz-1080196-Delete-the-destination-first-then-paste.patch Patch28: 0001-Related-rhbz-1075951-abrt-crash-in-MSWordExportBase-.patch Patch29: 0001-drop-OnlyShowIn-from-.desktop-files.patch +Patch30: 0001-Resolves-rhbz-1081176-don-t-jump-to-cursor-pos-when.patch %define instdir %{_libdir} %define baseinstdir %{instdir}/libreoffice @@ -2185,6 +2186,9 @@ update-desktop-database %{_datadir}/applications &> /dev/null || : %endif %changelog +* Fri Apr 11 2014 Caolán McNamara - 1:4.2.3.3-2 +- Related: rhbz#1081176 don't jump to cursor pos when we don't want to + * Sat Apr 05 2014 David Tardon - 1:4.2.3.3-1 - update to 4.2.3 rc3