summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2011-08-10 11:49:07 +0100
committerCaolán McNamara <caolanm@redhat.com>2011-08-10 11:49:50 +0100
commitcd690d2e72be410058376c416a40ff5d918fb0f7 (patch)
treebededd74dcf985a02ea0ce97ba2987dffdc4db8d
parente16221d3e0eb11958e20b8a1fd959c7055b9172e (diff)
Resolves: fdo#39159 don't restore original view settings on temp documents
-rw-r--r--sw/inc/printdata.hxx2
-rw-r--r--sw/inc/unotxdoc.hxx3
-rw-r--r--sw/source/core/view/printdata.cxx4
-rw-r--r--sw/source/ui/uno/unotxdoc.cxx14
4 files changed, 15 insertions, 8 deletions
diff --git a/sw/inc/printdata.hxx b/sw/inc/printdata.hxx
index 6bd83c1f651d..02ff7a3433e8 100644
--- a/sw/inc/printdata.hxx
+++ b/sw/inc/printdata.hxx
@@ -269,7 +269,7 @@ public:
bool IsViewOptionAdjust() const { return m_pViewOptionAdjust != 0; }
bool NeedNewViewOptionAdjust( const ViewShell& ) const;
- void ViewOptionAdjustStart( ViewShell &rSh, const SwViewOption &rViewOptions );
+ void ViewOptionAdjustStart( ViewShell &rSh, const SwViewOption &rViewOptions, bool bIsTmpSelection );
void ViewOptionAdjust( SwPrintData const* const pPrtOptions );
void ViewOptionAdjustStop();
diff --git a/sw/inc/unotxdoc.hxx b/sw/inc/unotxdoc.hxx
index 7aad16da1d3c..bc21cf3350f3 100644
--- a/sw/inc/unotxdoc.hxx
+++ b/sw/inc/unotxdoc.hxx
@@ -588,9 +588,10 @@ class SwViewOptionAdjust_Impl
{
ViewShell & m_rShell;
SwViewOption m_aOldViewOptions;
+ bool m_bIsTmpSelection;
public:
- SwViewOptionAdjust_Impl( ViewShell& rSh, const SwViewOption &rViewOptions );
+ SwViewOptionAdjust_Impl( ViewShell& rSh, const SwViewOption &rViewOptions, bool bIsTmpSelection );
~SwViewOptionAdjust_Impl();
void AdjustViewOptions( SwPrintData const* const pPrtOptions );
bool checkShell( const ViewShell& rCompare ) const
diff --git a/sw/source/core/view/printdata.cxx b/sw/source/core/view/printdata.cxx
index 893907fd1773..497a5cb35461 100644
--- a/sw/source/core/view/printdata.cxx
+++ b/sw/source/core/view/printdata.cxx
@@ -113,13 +113,13 @@ bool SwRenderData::NeedNewViewOptionAdjust( const ViewShell& rCompare ) const
}
-void SwRenderData::ViewOptionAdjustStart( ViewShell &rSh, const SwViewOption &rViewOptions )
+void SwRenderData::ViewOptionAdjustStart( ViewShell &rSh, const SwViewOption &rViewOptions, bool bIsTmpSelection )
{
if (m_pViewOptionAdjust)
{
OSL_FAIL("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 603773b0c6ea..418dbf0aff6f 100644
--- a/sw/source/ui/uno/unotxdoc.cxx
+++ b/sw/source/ui/uno/unotxdoc.cxx
@@ -2551,7 +2551,7 @@ sal_Int32 SAL_CALL SwXTextDocument::getRendererCount(
if (m_pRenderData && m_pRenderData->NeedNewViewOptionAdjust( *pViewShell ) )
m_pRenderData->ViewOptionAdjustStop();
if (m_pRenderData && !m_pRenderData->IsViewOptionAdjust())
- m_pRenderData->ViewOptionAdjustStart( *pViewShell, *pViewShell->GetViewOptions() );
+ m_pRenderData->ViewOptionAdjustStart( *pViewShell, *pViewShell->GetViewOptions(), rSelection.hasValue() );
}
m_pRenderData->SetSwPrtOptions( new SwPrintData );
@@ -3833,15 +3833,21 @@ void SwXDocumentPropertyHelper::onChange()
m_pDoc->SetModified();
}
-SwViewOptionAdjust_Impl::SwViewOptionAdjust_Impl( ViewShell& rSh, const SwViewOption &rViewOptions ) :
+SwViewOptionAdjust_Impl::SwViewOptionAdjust_Impl( ViewShell& 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 );
}
void