summaryrefslogtreecommitdiff
path: root/sw/source/core/layout/tabfrm.cxx
diff options
context:
space:
mode:
authorMichael Stahl <mstahl@redhat.com>2018-01-04 11:37:37 +0100
committerMichael Stahl <mstahl@redhat.com>2018-01-04 12:12:12 +0100
commit334601603aa04ea968e8a850f4e7f6cf52f7735b (patch)
tree6dc0bc02b83b4b618b059391b99c31b83d1c2b2e /sw/source/core/layout/tabfrm.cxx
parent1bf8c74c0d0a78086b0688070bd375567344bb35 (diff)
sw: move some globals in fetab.cxx into SwFEShell
It looks like the main point of these being globals is so that they can be cleared from various places when tables or table frames are destroyed. Add a SwDoc parameter to ClearFEShellTabCols() and just iterate over all shells. Change-Id: I75ad6b695ee1bfa76b9a05c606b07a3574c70ac4
Diffstat (limited to 'sw/source/core/layout/tabfrm.cxx')
-rw-r--r--sw/source/core/layout/tabfrm.cxx16
1 files changed, 3 insertions, 13 deletions
diff --git a/sw/source/core/layout/tabfrm.cxx b/sw/source/core/layout/tabfrm.cxx
index 28b2b9934ea9..1f3024a77592 100644
--- a/sw/source/core/layout/tabfrm.cxx
+++ b/sw/source/core/layout/tabfrm.cxx
@@ -21,10 +21,10 @@
#include <rootfrm.hxx>
#include <IDocumentFieldsAccess.hxx>
#include <viewimp.hxx>
+#include <fesh.hxx>
#include <swtable.hxx>
#include <dflyobj.hxx>
#include <anchoreddrawobject.hxx>
-#include <fetab.hxx>
#include <fmtanchr.hxx>
#include <viewopt.hxx>
#include <hints.hxx>
@@ -126,18 +126,8 @@ SwTabFrame::SwTabFrame( SwTabFrame &rTab )
void SwTabFrame::DestroyImpl()
{
// There is some terrible code in fetab.cxx, that
- // makes use of these global pointers. Obviously
- // this code did not consider that a TabFrame can be
- // deleted.
- if (this == g_pColumnCacheLastTabFrame)
- {
- g_pColumnCacheLastTable = nullptr;
- g_pColumnCacheLastTabFrame = nullptr;
- g_pColumnCacheLastCellFrame = nullptr;
- g_pRowCacheLastTable = nullptr;
- g_pRowCacheLastTabFrame = nullptr;
- g_pRowCacheLastCellFrame = nullptr;
- }
+ // caches pointers to SwTabFrames.
+ ::ClearFEShellTabCols(*GetFormat()->GetDoc(), this);
SwLayoutFrame::DestroyImpl();
}