Kaydet (Commit) cd690d2e authored tarafından Caolán McNamara's avatar Caolán McNamara

Resolves: fdo#39159 don't restore original view settings on temp documents

üst e16221d3
......@@ -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();
......
......@@ -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
......
......@@ -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 );
}
......
......@@ -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
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment