sw/inc/htmltbl.hxx             |    2 +-
 sw/source/core/doc/htmltbl.cxx |    8 ++++----
 2 files changed, 5 insertions(+), 5 deletions(-)

New commits:
commit daa058c714804ffbd2aa1ff20096b4c79bebea0c
Author:     Caolán McNamara <caol...@redhat.com>
AuthorDate: Wed Sep 30 08:47:26 2020 +0100
Commit:     Caolán McNamara <caol...@redhat.com>
CommitDate: Wed Sep 30 14:27:21 2020 +0200

    SwHTMLTableLayout::GetDoc can return a reference
    
    Change-Id: I5d300ea19433b6439d8fca2152fa5ac1f5e90fef
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/103671
    Tested-by: Caolán McNamara <caol...@redhat.com>
    Reviewed-by: Caolán McNamara <caol...@redhat.com>

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;
     }
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to