[openoffice.org/f14] Resolves: rhbz#657783 dead ViewShell, possibly on selection

Caolan McNamara caolanm at fedoraproject.org
Tue Aug 23 09:56:29 UTC 2011


commit 21e078b157e63da91d87ee88b3091ec9a72cc090
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Tue Aug 23 10:56:13 2011 +0100

    Resolves: rhbz#657783 dead ViewShell, possibly on selection

 ...o-39159-don-t-restore-original-view-setti.patch |  103 ++++++++++++++++++++
 openoffice.org.spec                                |    5 +-
 2 files changed, 107 insertions(+), 1 deletions(-)
---
diff --git a/0001-Resolves-fdo-39159-don-t-restore-original-view-setti.patch b/0001-Resolves-fdo-39159-don-t-restore-original-view-setti.patch
new file mode 100644
index 0000000..a286907
--- /dev/null
+++ b/0001-Resolves-fdo-39159-don-t-restore-original-view-setti.patch
@@ -0,0 +1,103 @@
+From cd690d2e72be410058376c416a40ff5d918fb0f7 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= <caolanm at redhat.com>
+Date: Wed, 10 Aug 2011 11:49:07 +0100
+Subject: [PATCH] Resolves: fdo#39159 don't restore original view settings on
+ temp documents
+
+---
+ sw/inc/printdata.hxx              |    2 +-
+ sw/inc/unotxdoc.hxx               |    3 ++-
+ sw/source/core/view/printdata.cxx |    4 ++--
+ sw/source/ui/uno/unotxdoc.cxx     |   14 ++++++++++----
+ 4 files changed, 15 insertions(+), 8 deletions(-)
+
+diff --git a/sw/inc/printdata.hxx b/sw/inc/printdata.hxx
+index 6bd83c1..02ff7a3 100644
+--- a/sw/inc/printdata.hxx
++++ b/sw/inc/printdata.hxx
+@@ -268,7 +268,7 @@ public:
+ 
+     bool IsViewOptionAdjust() const  { return m_pViewOptionAdjust != 0; }
+     bool NeedNewViewOptionAdjust( const SwWrtShell& ) const;
+-    void ViewOptionAdjustStart( SwWrtShell &rSh, const SwViewOption &rViewOptions );
++    void ViewOptionAdjustStart( SwWrtShell &rSh, const SwViewOption &rViewOptions, bool bIsTmpSelection );
+     void ViewOptionAdjust( const SwPrtOptions *pPrtOptions );
+     void ViewOptionAdjustStop();
+ 
+diff --git a/sw/inc/unotxdoc.hxx b/sw/inc/unotxdoc.hxx
+index 7aad16d..bc21cf3 100644
+--- a/sw/inc/unotxdoc.hxx
++++ b/sw/inc/unotxdoc.hxx
+@@ -599,11 +599,12 @@
+ {
+     SwWrtShell &    m_rShell;
+     SwViewOption    m_aOldViewOptions;
++    bool m_bIsTmpSelection;
+ //    SwViewOption    m_aRenderViewOptions;   // view options to use when rendering for PDF export or printing
+ //    bool            m_bRestoreViewOptions;
+ 
+ public:
+-    SwViewOptionAdjust_Impl( SwWrtShell& rSh, const SwViewOption &rViewOptions );
++    SwViewOptionAdjust_Impl( SwWrtShell& rSh, const SwViewOption &rViewOptions, bool bIsTmpSelection );
+     ~SwViewOptionAdjust_Impl();
+     
+     void AdjustViewOptions( const SwPrtOptions *pPrtOptions );
+diff --git a/sw/source/core/view/printdata.cxx b/sw/source/core/view/printdata.cxx
+index 893907f..497a5cb 100644
+--- a/sw/source/core/view/printdata.cxx
++++ b/sw/source/core/view/printdata.cxx
+@@ -117,13 +117,13 @@
+ }
+ 
+ 
+-void SwRenderData::ViewOptionAdjustStart( SwWrtShell &rSh, const SwViewOption &rViewOptions )
++void SwRenderData::ViewOptionAdjustStart( SwWrtShell &rSh, const SwViewOption &rViewOptions, bool bIsTmpSelection )
+ {
+     if (m_pViewOptionAdjust)
+     {
+         DBG_ASSERT( 0, "error: there should be no ViewOptionAdjust active when calling this function" );
+     }
+-    m_pViewOptionAdjust = new SwViewOptionAdjust_Impl( rSh, rViewOptions );
++    m_pViewOptionAdjust = new SwViewOptionAdjust_Impl( rSh, rViewOptions, bIsTmpSelection );
+ }
+     
+ 
+diff --git a/sw/source/ui/uno/unotxdoc.cxx b/sw/source/ui/uno/unotxdoc.cxx
+index 603773b..418dbf0 100644
+--- a/sw/source/ui/uno/unotxdoc.cxx
++++ b/sw/source/ui/uno/unotxdoc.cxx
+@@ -2716,7 +2716,7 @@
+                 if (m_pRenderData && m_pRenderData->NeedNewViewOptionAdjust( *pWrtShell ) )
+                     m_pRenderData->ViewOptionAdjustStop();
+                 if (m_pRenderData && !m_pRenderData->IsViewOptionAdjust())
+-                    m_pRenderData->ViewOptionAdjustStart( *pWrtShell, *pWrtShell->GetViewOptions() );
++                    m_pRenderData->ViewOptionAdjustStart( *pWrtShell, *pWrtShell->GetViewOptions(), rSelection.hasValue() );
+             }
+ 
+             m_pRenderData->SetSwPrtOptions( new SwPrtOptions( C2U( bIsPDFExport ? "PDF export" : "Printing" ) ) );
+@@ -4100,16 +4100,22 @@
+ 
+ /*****************************************************************************/
+ 
+-SwViewOptionAdjust_Impl::SwViewOptionAdjust_Impl( SwWrtShell& rSh, const SwViewOption &rViewOptions ) :
++SwViewOptionAdjust_Impl::SwViewOptionAdjust_Impl( SwWrtShell& rSh, const SwViewOption &rViewOptions, bool bIsTmpSelection ) :
+     m_rShell( rSh ),
+-    m_aOldViewOptions( rViewOptions )
++    m_aOldViewOptions( rViewOptions ),
++    m_bIsTmpSelection( bIsTmpSelection )
+ {
+ }
+ 
+ 
+ SwViewOptionAdjust_Impl::~SwViewOptionAdjust_Impl()
+ {
+-    m_rShell.ApplyViewOptions( m_aOldViewOptions );
++    //fdo#39159 don't restore original view options on a temporary document
++    //selection, it triggers throwing away the current view. Presumably we can
++    //forget about it in the temporary document case as unimportant to restore
++    //the original view settings
++    if (!m_bIsTmpSelection)
++        m_rShell.ApplyViewOptions( m_aOldViewOptions );
+ }
+ 
+ 
diff --git a/openoffice.org.spec b/openoffice.org.spec
index 76d2c8c..0f1e30c 100644
--- a/openoffice.org.spec
+++ b/openoffice.org.spec
@@ -178,6 +178,7 @@ Patch94: 0001-Resolves-rhbz-693265-fix-crash-from-unhandled-except.patch
 Patch95: openoffice.org-3.3.0.rh697176.framework.crash.patch
 Patch96: 0001-rhbz-667082-do-not-crash-importing-section-containin.patch
 Patch97: 0001-add-missing-xsl-when-start-tag.patch
+Patch98: 0001-Resolves-fdo-39159-don-t-restore-original-view-setti.patch
 
 %{!?python_sitearch: %global python_sitearch %(%{__python} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib(1))")}
 %define instdir %{_libdir}
@@ -1772,6 +1773,7 @@ cp -p %{SOURCE5} external/unowinreg/unowinreg.dll
 %patch95 -p0 -b .rh697176.framework.crash.patch
 %patch96 -p1 -b .rhbz667082-do-not-crash-importing-section-containin.patch
 %patch97 -p1 -b .add-missing-xsl-when-start-tag.patch
+%patch98 -p1 -b .fdo39159-don-t-restore-original-view-setti.patch
 touch scripting/source/pyprov/delzip
 touch scripting/util/provider/beanshell/delzip
 touch scripting/util/provider/javascript/delzip
@@ -3967,13 +3969,14 @@ unopkg remove --shared org.openoffice.legacy.ScriptProviderForPython.zip > /dev/
 %endif
 
 %changelog
-* Mon Aug 08 2011 Caolán McNamara <caolanm at redhat.com>- 1:3.3.0-20.7-UNBUILT
+* Mon Aug 08 2011 Caolán McNamara <caolanm at redhat.com>- 1:3.3.0-20.7
 - Related: rhbz#702833 addEventListener without removeEventListener
 - Resolves: rhbz#693265 fix crash from unhandled exception
 - Resolves: rhbz#697176 framework crash in dock restoration
 - Resolves: rhbz#667082 do not crash importing section containing just
   an empty paragraph (dtardon)
 - Resolves: rhbz#728945 unable to export into XHTML/HTML (dtardon)
+- Resolves: rhbz#657783 dead ViewShell, possibly on selection
 
 * Wed Jun 08 2011 Caolán McNamara <caolanm at redhat.com>- 1:3.3.0-20.6
 - Resolves: rhbz#695509 crash in RefreshDocumentLB


More information about the scm-commits mailing list