summaryrefslogtreecommitdiff
path: root/sw/inc
diff options
context:
space:
mode:
authorMichael Stahl <mstahl@redhat.com>2011-12-21 16:39:22 +0100
committerMichael Stahl <mstahl@redhat.com>2011-12-21 16:44:50 +0100
commit89d2733e16ae6233deea6bef3193bd45c89b854c (patch)
tree29437ec754649108f9c208351eff8e2335e30993 /sw/inc
parentc84ac758aa081f2b642aa9b96fda8496d0d66188 (diff)
sw: fdo#39159 fdo#40482: temp selection print doc:
Ensure that the printing temp selection document is not destroyed prematurely by SwXTextView::NotifySelChanged, called via ViewOptionAdjustStop, by retaining the temp doc object shell not at the View but in SwRenderData. Not restoring the view options for selections does not actually work, because having a selection surprisingly does not imply printing a temp document: the preview also uses a selection. (view option regression from cd690d2e72be410058376c416a40ff5d918fb0f7)
Diffstat (limited to 'sw/inc')
-rw-r--r--sw/inc/printdata.hxx11
-rw-r--r--sw/inc/unotxdoc.hxx3
2 files changed, 10 insertions, 4 deletions
diff --git a/sw/inc/printdata.hxx b/sw/inc/printdata.hxx
index 8d29336d036b..02d56b8a20b2 100644
--- a/sw/inc/printdata.hxx
+++ b/sw/inc/printdata.hxx
@@ -28,10 +28,10 @@
#ifndef SW_PRINTDATA_HXX
#define SW_PRINTDATA_HXX
-
#include <sal/types.h>
#include <rtl/ustring.hxx>
#include <vcl/print.hxx>
+#include <sfx2/objsh.hxx>
#include <boost/scoped_ptr.hpp>
@@ -244,6 +244,10 @@ class SwRenderData
rtl::OUString m_aPageRange;
+ // temp print document -- must live longer than m_pViewOptionAdjust!
+ // also this is a Lock and not a Ref because Ref does not delete the doc
+ SfxObjectShellLock m_xTempDocShell;
+
// the view options to be applied for printing
::boost::scoped_ptr<SwViewOptionAdjust_Impl> m_pViewOptionAdjust;
@@ -266,9 +270,12 @@ public:
void CreatePostItData( SwDoc *pDoc, const SwViewOption *pViewOpt, OutputDevice *pOutDev );
void DeletePostItData();
+ SfxObjectShellLock const& GetTempDocShell() const;
+ void SetTempDocShell(SfxObjectShellLock const&);
+
bool IsViewOptionAdjust() const { return m_pViewOptionAdjust != 0; }
bool NeedNewViewOptionAdjust( const ViewShell& ) const;
- void ViewOptionAdjustStart( ViewShell &rSh, const SwViewOption &rViewOptions, bool bIsTmpSelection );
+ void ViewOptionAdjustStart( ViewShell &rSh, const SwViewOption &rViewOptions);
void ViewOptionAdjust( SwPrintData const* const pPrtOptions );
void ViewOptionAdjustStop();
diff --git a/sw/inc/unotxdoc.hxx b/sw/inc/unotxdoc.hxx
index 5d61a9a60b5e..42d646f26b0a 100644
--- a/sw/inc/unotxdoc.hxx
+++ b/sw/inc/unotxdoc.hxx
@@ -589,10 +589,9 @@ class SwViewOptionAdjust_Impl
{
ViewShell & m_rShell;
SwViewOption m_aOldViewOptions;
- bool m_bIsTmpSelection;
public:
- SwViewOptionAdjust_Impl( ViewShell& rSh, const SwViewOption &rViewOptions, bool bIsTmpSelection );
+ SwViewOptionAdjust_Impl( ViewShell& rSh, const SwViewOption &rViewOptions );
~SwViewOptionAdjust_Impl();
void AdjustViewOptions( SwPrintData const* const pPrtOptions );
bool checkShell( const ViewShell& rCompare ) const