summaryrefslogtreecommitdiff
path: root/sw/inc
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2017-12-08 17:16:48 +0000
committerCaolán McNamara <caolanm@redhat.com>2017-12-09 20:30:20 +0100
commit7459a283b3a08397d28861dbe588c9f5826398d4 (patch)
tree38f2980e1c8f790bde8000d5350e9d79b50af159 /sw/inc
parentbb966d78980177121a15678ee7933a1ffc971b69 (diff)
valgrind: more leaks on loading abi3279-1.html
Change-Id: I88d400cdd142094ece9d829a6f54a57e1b967962 Reviewed-on: https://gerrit.libreoffice.org/46106 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'sw/inc')
-rw-r--r--sw/inc/htmltbl.hxx27
1 files changed, 11 insertions, 16 deletions
diff --git a/sw/inc/htmltbl.hxx b/sw/inc/htmltbl.hxx
index ae2fb28042e7..1c65226e4108 100644
--- a/sw/inc/htmltbl.hxx
+++ b/sw/inc/htmltbl.hxx
@@ -37,11 +37,11 @@ class SwFrameFormat;
class SwHTMLTableLayoutCnts
{
- SwHTMLTableLayoutCnts *pNext; ///< The next content.
+ std::shared_ptr<SwHTMLTableLayoutCnts> xNext; ///< The next content.
/// Only one of the following two pointers may be set!
SwTableBox *pBox; ///< A Box.
- SwHTMLTableLayout *pTable; ///< A "table within a table".
+ std::shared_ptr<SwHTMLTableLayout> xTable; ///< A "table within a table".
/** During first run there are still no boxes. In this case
pStartNode is used instead of pBox. */
@@ -58,20 +58,18 @@ class SwHTMLTableLayoutCnts
public:
- SwHTMLTableLayoutCnts( const SwStartNode* pSttNd, SwHTMLTableLayout* pTab,
- bool bNoBreakTag, SwHTMLTableLayoutCnts* pNxt );
-
- ~SwHTMLTableLayoutCnts();
+ SwHTMLTableLayoutCnts(const SwStartNode* pSttNd, SwHTMLTableLayout* pTab,
+ bool bNoBreakTag, std::shared_ptr<SwHTMLTableLayoutCnts> const& rNxt);
void SetTableBox( SwTableBox *pBx ) { pBox = pBx; }
SwTableBox *GetTableBox() const { return pBox; }
- SwHTMLTableLayout *GetTable() const { return pTable; }
+ SwHTMLTableLayout *GetTable() const { return xTable.get(); }
const SwStartNode *GetStartNode() const;
/// Calculation of next node.
- SwHTMLTableLayoutCnts *GetNext() const { return pNext; }
+ const std::shared_ptr<SwHTMLTableLayoutCnts>& GetNext() const { return xNext; }
void SetWidthSet( sal_uInt8 nRef ) { nWidthSet = nRef; }
bool IsWidthSet( sal_uInt8 nRef ) const { return nRef==nWidthSet; }
@@ -84,7 +82,7 @@ public:
class SwHTMLTableLayoutCell
{
- SwHTMLTableLayoutCnts *pContents; ///< Content of cell.
+ std::shared_ptr<SwHTMLTableLayoutCnts> xContents; ///< Content of cell.
sal_uInt16 nRowSpan; ///< ROWSPAN of cell.
sal_uInt16 nColSpan; ///< COLSPAN of cell.
@@ -95,16 +93,14 @@ class SwHTMLTableLayoutCell
public:
- SwHTMLTableLayoutCell( SwHTMLTableLayoutCnts *pCnts,
+ SwHTMLTableLayoutCell(std::shared_ptr<SwHTMLTableLayoutCnts> const& rCnts,
sal_uInt16 nRSpan, sal_uInt16 nCSpan,
sal_uInt16 nWidthOpt, bool bPrcWdthOpt,
bool bNWrapOpt );
- ~SwHTMLTableLayoutCell();
-
/// Set or get content of a cell.
- void SetContents( SwHTMLTableLayoutCnts *pCnts ) { pContents = pCnts; }
- SwHTMLTableLayoutCnts *GetContents() const { return pContents; }
+ void SetContents(std::shared_ptr<SwHTMLTableLayoutCnts> const& rCnts) { xContents = rCnts; }
+ const std::shared_ptr<SwHTMLTableLayoutCnts>& GetContents() const { return xContents; }
inline void SetProtected();
@@ -353,8 +349,7 @@ inline void SwHTMLTableLayoutCell::SetProtected()
{
nRowSpan = 1;
nColSpan = 1;
-
- pContents = nullptr;
+ xContents.reset();
}
inline void SwHTMLTableLayoutColumn::MergeMinMaxNoAlign( sal_uLong nCMin,