summaryrefslogtreecommitdiff
path: root/sw/inc
diff options
context:
space:
mode:
authorMatt K <mattkse@gmail.com>2024-02-03 17:04:19 -0600
committerMatt K <mattkse@gmail.com>2024-02-28 22:08:38 +0100
commit6a064b1967e06e40be40817deff99d00c1a8554f (patch)
tree4c5f0c5c6a653091d8efad37b1a8a1739df65d1e /sw/inc
parentb8237d35d9f90d1dfdd35f24af8729d668029e2c (diff)
tdf#139004 Prevent crash when deleting footnote styles
The problem was that a pointer was assumed valid, but was not, so now we check the value of the pointer before using it. Works now to delete footnote style. Also, change assert to variable check to ensure the proper method is only called when it is supposed to be, and to prevent a failing assert. We add a new Destr method on SwFormat so that it can be called from the SwTextFormatColl context and thus avoid the assert. Change-Id: Ia4b8029fb89e627cd685b3317606e2b9d60cf248 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/162965 Tested-by: Jenkins Reviewed-by: Matt K <mattkse@gmail.com>
Diffstat (limited to 'sw/inc')
-rw-r--r--sw/inc/format.hxx1
-rw-r--r--sw/inc/ndtxt.hxx4
2 files changed, 3 insertions, 2 deletions
diff --git a/sw/inc/format.hxx b/sw/inc/format.hxx
index 91043b1621de..62ef891bc545 100644
--- a/sw/inc/format.hxx
+++ b/sw/inc/format.hxx
@@ -72,6 +72,7 @@ protected:
SwFormat *pDrvdFrame, sal_uInt16 nFormatWhich );
SwFormat( const SwFormat& rFormat );
virtual void SwClientNotify(const SwModify&, const SfxHint&) override;
+ void Destr();
public:
diff --git a/sw/inc/ndtxt.hxx b/sw/inc/ndtxt.hxx
index 352dad71c247..eb046bc9151d 100644
--- a/sw/inc/ndtxt.hxx
+++ b/sw/inc/ndtxt.hxx
@@ -454,8 +454,8 @@ public:
inline SwTextFormatColl *GetTextColl() const;
virtual SwFormatColl *ChgFormatColl( SwFormatColl* ) override;
- void ChgTextCollUpdateNum( const SwTextFormatColl* pOld,
- const SwTextFormatColl* pNew );
+ void ChgTextCollUpdateNum(const SwTextFormatColl* pOld,
+ const SwTextFormatColl* pNew );
/** Copy collection with all auto formats to dest-node.
The latter might be in another document!