diff options
author | Caolán McNamara <caolanm@redhat.com> | 2020-09-30 08:47:26 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2020-09-30 14:27:21 +0200 |
commit | daa058c714804ffbd2aa1ff20096b4c79bebea0c (patch) | |
tree | 1f08b0cac20a0779426f67905ceaac4ce59ff1a7 /sw | |
parent | 7672ac2e8764d9e4fcb5a896ef6210077907dcd0 (diff) |
SwHTMLTableLayout::GetDoc can return a reference
Change-Id: I5d300ea19433b6439d8fca2152fa5ac1f5e90fef
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/103671
Tested-by: Caolán McNamara <caolanm@redhat.com>
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'sw')
-rw-r--r-- | sw/inc/htmltbl.hxx | 2 | ||||
-rw-r--r-- | sw/source/core/doc/htmltbl.cxx | 8 |
2 files changed, 5 insertions, 5 deletions
diff --git a/sw/inc/htmltbl.hxx b/sw/inc/htmltbl.hxx index 8f289c39d35d..7fad4b0fd087 100644 --- a/sw/inc/htmltbl.hxx +++ b/sw/inc/htmltbl.hxx @@ -233,7 +233,7 @@ class SwHTMLTableLayout const SwStartNode *GetAnyBoxStartNode() const; SwFrameFormat *FindFlyFrameFormat() const; - const SwDoc *GetDoc() const { return &GetAnyBoxStartNode()->GetDoc(); } + const SwDoc& GetDoc() const { return GetAnyBoxStartNode()->GetDoc(); } void Resize_( sal_uInt16 nAbsAvail, bool bRecalc ); diff --git a/sw/source/core/doc/htmltbl.cxx b/sw/source/core/doc/htmltbl.cxx index 3851e061a2c7..7441ddf7447c 100644 --- a/sw/source/core/doc/htmltbl.cxx +++ b/sw/source/core/doc/htmltbl.cxx @@ -1673,7 +1673,7 @@ void SwHTMLTableLayout::Resize_( sal_uInt16 nAbsAvail, bool bRecalc ) if( bRecalc ) AutoLayoutPass1(); - SwRootFrame *pRoot = GetDoc()->getIDocumentLayoutAccess().GetCurrentViewShell()->GetLayout(); + SwRootFrame *pRoot = GetDoc().getIDocumentLayoutAccess().GetCurrentViewShell()->GetLayout(); if ( pRoot && pRoot->IsCallbackActionEnabled() ) pRoot->StartAllAction(); @@ -1705,15 +1705,15 @@ bool SwHTMLTableLayout::Resize( sal_uInt16 nAbsAvail, bool bRecalc, if( m_bMustNotRecalc && !bForce ) bRecalc = false; - const SwDoc *pDoc = GetDoc(); + const SwDoc& rDoc = GetDoc(); // If there is a layout, the root frame's size instead of the // VisArea's size was potentially passed. // If we're not in a frame we need to calculate the table for the VisArea, // because switching from relative to absolute wouldn't work. - if( pDoc->getIDocumentLayoutAccess().GetCurrentViewShell() && pDoc->getIDocumentLayoutAccess().GetCurrentViewShell()->GetViewOptions()->getBrowseMode() ) + if( rDoc.getIDocumentLayoutAccess().GetCurrentViewShell() && rDoc.getIDocumentLayoutAccess().GetCurrentViewShell()->GetViewOptions()->getBrowseMode() ) { - const sal_uInt16 nVisAreaWidth = GetBrowseWidthByVisArea( *pDoc ); + const sal_uInt16 nVisAreaWidth = GetBrowseWidthByVisArea( rDoc ); if( nVisAreaWidth < nAbsAvail && !FindFlyFrameFormat() ) nAbsAvail = nVisAreaWidth; } |