tdf#153220 exit header/footer edit mode, if active, on undo header/footer
Change-Id: Ibe97a9239bff03b7bcffc11c02b6bdff840c4481 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/146178 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
This commit is contained in:
parent
abe1310448
commit
481c740ff0
2 changed files with 14 additions and 0 deletions
|
@ -34,6 +34,8 @@ class SwUndoPageDesc final : public SwUndo
|
|||
// To avoid duplication of (header/footer)content nodes for simple page desc changes
|
||||
void ExchangeContentNodes( SwPageDesc& rSource, SwPageDesc &rDest );
|
||||
|
||||
// tdf#153220 use to Exit HeaderFooter EditMode
|
||||
void ExitHeaderFooterEdit();
|
||||
public:
|
||||
SwUndoPageDesc(const SwPageDesc & aOld, const SwPageDesc & aNew,
|
||||
SwDoc * pDoc);
|
||||
|
|
|
@ -18,6 +18,7 @@
|
|||
*/
|
||||
|
||||
#include <doc.hxx>
|
||||
#include <editsh.hxx>
|
||||
#include <IDocumentUndoRedo.hxx>
|
||||
#include <swundo.hxx>
|
||||
#include <pagedesc.hxx>
|
||||
|
@ -216,12 +217,22 @@ void SwUndoPageDesc::ExchangeContentNodes( SwPageDesc& rSource, SwPageDesc &rDes
|
|||
pNewFormat->SetFormatAttr( SwFormatContent() );
|
||||
}
|
||||
|
||||
void SwUndoPageDesc::ExitHeaderFooterEdit()
|
||||
{
|
||||
SwEditShell* pESh = m_pDoc->GetEditShell();
|
||||
if (!pESh)
|
||||
return;
|
||||
if (pESh->IsHeaderFooterEdit())
|
||||
pESh->ToggleHeaderFooterEdit();
|
||||
}
|
||||
|
||||
void SwUndoPageDesc::UndoImpl(::sw::UndoRedoContext &)
|
||||
{
|
||||
// Move (header/footer)content node responsibility from new page descriptor to old one again.
|
||||
if( m_bExchange )
|
||||
ExchangeContentNodes( m_aNew.m_PageDesc, m_aOld.m_PageDesc );
|
||||
m_pDoc->ChgPageDesc(m_aOld.GetName(), m_aOld);
|
||||
ExitHeaderFooterEdit();
|
||||
}
|
||||
|
||||
void SwUndoPageDesc::RedoImpl(::sw::UndoRedoContext &)
|
||||
|
@ -230,6 +241,7 @@ void SwUndoPageDesc::RedoImpl(::sw::UndoRedoContext &)
|
|||
if( m_bExchange )
|
||||
ExchangeContentNodes( m_aOld.m_PageDesc, m_aNew.m_PageDesc );
|
||||
m_pDoc->ChgPageDesc(m_aNew.GetName(), m_aNew);
|
||||
ExitHeaderFooterEdit();
|
||||
}
|
||||
|
||||
SwRewriter SwUndoPageDesc::GetRewriter() const
|
||||
|
|
Loading…
Reference in a new issue