diff options
author | Daniel Arato (NISZ) <arato.daniel@nisz.hu> | 2021-01-26 13:11:42 +0100 |
---|---|---|
committer | László Németh <nemeth@numbertext.org> | 2021-03-02 11:10:29 +0100 |
commit | f5dc6b11d2218d94c9effe7a1ab418d0133da5e3 (patch) | |
tree | e2060ae00cd846278e49b554f502d59274a498dc /sw/inc/pagedesc.hxx | |
parent | 3fe274dcfeca17ee7713b306fcd36183f6cf4689 (diff) |
tdf#140117 sw UI: keep headers/footers when inactive
Custom left page and first headers (and footers) used to disappear
forever if hidden temporarily by checking the "Same content on left
and right pages" or "Same content on first page" options, respectively.
This commit stashes the endangered headers (footers) in SwPageDesc
and restores them on demand.
Change-Id: I1f6b605e2bd19af18726de1b825721487d29b4eb
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/110398
Tested-by: Jenkins
Reviewed-by: László Németh <nemeth@numbertext.org>
Diffstat (limited to 'sw/inc/pagedesc.hxx')
-rw-r--r-- | sw/inc/pagedesc.hxx | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/sw/inc/pagedesc.hxx b/sw/inc/pagedesc.hxx index 7f2eaa9c9d53..0d29eb0ca6e3 100644 --- a/sw/inc/pagedesc.hxx +++ b/sw/inc/pagedesc.hxx @@ -148,6 +148,17 @@ class SW_DLLPUBLIC SwPageDesc // FIXME epicycles growing here - page margins need to be stored differently SwFrameFormat m_FirstMaster; SwFrameFormat m_FirstLeft; + + struct StashedPageDesc + { + std::shared_ptr<SwFrameFormat> m_pStashedFirst; + std::shared_ptr<SwFrameFormat> m_pStashedLeft; + std::shared_ptr<SwFrameFormat> m_pStashedFirstLeft; + }; + + mutable StashedPageDesc m_aStashedHeader; + mutable StashedPageDesc m_aStashedFooter; + sw::WriterMultiListener m_aDepends; ///< Because of grid alignment (Registerhaltigkeit). mutable const SwTextFormatColl* m_pTextFormatColl; SwPageDesc *m_pFollow; @@ -206,6 +217,12 @@ public: bool IsHidden() const { return m_IsHidden; } void SetHidden(bool const bValue) { m_IsHidden = bValue; } + /// Remember original header/footer formats even when they are hidden by "sharing". + void StashFrameFormat(const SwFrameFormat& rFormat, bool bHeader, bool bLeft, bool bFirst); + + /// Used to restore hidden header/footer formats. + const SwFrameFormat* GetStashedFrameFormat(bool bHeader, bool bLeft, bool bFirst) const; + /// Same as WriteUseOn(), but the >= HeaderShare part of the bitfield is not modified. inline void SetUseOn( UseOnPage eNew ); inline UseOnPage GetUseOn() const; |