sw/source/uibase/shells/textfld.cxx |   20 ++++++++++----------
 1 file changed, 10 insertions(+), 10 deletions(-)

New commits:
commit b7fce2b26ee4ba585544457adc742807a2129d2c
Author:     Justin Luth <jl...@mail.com>
AuthorDate: Fri Jun 21 17:05:47 2024 -0400
Commit:     Justin Luth <jl...@mail.com>
CommitDate: Sat Jun 22 03:26:18 2024 +0200

    NFC sw textfld.cxx: make rDoc an actual reference
    
    Change-Id: I84d65e80f27cdc2cbfc4f56c89e5a391e0fd9e1b
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/169350
    Reviewed-by: Justin Luth <jl...@mail.com>
    Tested-by: Jenkins

diff --git a/sw/source/uibase/shells/textfld.cxx 
b/sw/source/uibase/shells/textfld.cxx
index bd0861ace3f0..54602e0199b7 100644
--- a/sw/source/uibase/shells/textfld.cxx
+++ b/sw/source/uibase/shells/textfld.cxx
@@ -1092,12 +1092,12 @@ FIELD_INSERT:
         pDlg->StartExecuteAsync([pShell, &rSh, pDlg](int nResult) {
             if ( nResult == RET_OK )
             {
-                auto rDoc = rSh.GetDoc();
+                auto& rDoc = *rSh.GetDoc();
 
                 rSh.LockView(true);
                 rSh.StartAllAction();
                 rSh.SwCursorShell::Push();
-                
rDoc->GetIDocumentUndoRedo().StartUndo(SwUndoId::INSERT_PAGE_NUMBER, nullptr);
+                
rDoc.GetIDocumentUndoRedo().StartUndo(SwUndoId::INSERT_PAGE_NUMBER, nullptr);
 
                 const size_t nPageDescIndex = rSh.GetCurPageDesc();
                 const SwPageDesc& rDesc = rSh.GetPageDesc(nPageDescIndex);
@@ -1117,7 +1117,7 @@ FIELD_INSERT:
                 if (ppMark != rIDMA.getAllMarksEnd() && *ppMark)
                 {
                     SwPaM aDeleteOldPageNum((*ppMark)->GetMarkStart(), 
(*ppMark)->GetMarkEnd());
-                    
rDoc->getIDocumentContentOperations().DeleteAndJoin(aDeleteOldPageNum);
+                    
rDoc.getIDocumentContentOperations().DeleteAndJoin(aDeleteOldPageNum);
                 }
 
                 SwPageDesc aNewDesc(rDesc);
@@ -1242,7 +1242,7 @@ FIELD_INSERT:
                 if (ppMark != rIDMA.getAllMarksEnd() && *ppMark)
                 {
                     SwPaM aDeleteOldPageNum((*ppMark)->GetMarkStart(), 
(*ppMark)->GetMarkEnd());
-                    
rDoc->getIDocumentContentOperations().DeleteAndJoin(aDeleteOldPageNum);
+                    
rDoc.getIDocumentContentOperations().DeleteAndJoin(aDeleteOldPageNum);
                 }
 
                 SwTextNode* pTextNode = 
rSh.GetCursor()->GetPoint()->GetNode().GetTextNode();
@@ -1250,7 +1250,7 @@ FIELD_INSERT:
                 // Insert new line if there is already text in header/footer
                 if (pTextNode && !pTextNode->GetText().isEmpty())
                 {
-                    
rDoc->getIDocumentContentOperations().SplitNode(*rSh.GetCursor()->GetPoint(), 
false);
+                    
rDoc.getIDocumentContentOperations().SplitNode(*rSh.GetCursor()->GetPoint(), 
false);
 
                     // Go back to start of header/footer
                     if (bHeader)
@@ -1292,7 +1292,7 @@ FIELD_INSERT:
                 aMgr.InsertField(aData);
                 if (pDlg->GetIncludePageTotal())
                 {
-                    
rDoc->getIDocumentContentOperations().InsertString(*rSh.GetCursor(), u" / 
"_ustr);
+                    
rDoc.getIDocumentContentOperations().InsertString(*rSh.GetCursor(), u" / 
"_ustr);
                     SwInsertField_Data 
aPageTotalData(SwFieldTypesEnum::DocumentStatistics, DS_PAGE,
                                                       OUString(), OUString(), 
SVX_NUM_PAGEDESC);
                     aMgr.InsertField(aPageTotalData);
@@ -1317,7 +1317,7 @@ FIELD_INSERT:
                     if (ppMark != rIDMA.getAllMarksEnd() && *ppMark)
                     {
                         SwPaM aDeleteOldPageNum((*ppMark)->GetMarkStart(), 
(*ppMark)->GetMarkEnd());
-                        
rDoc->getIDocumentContentOperations().DeleteAndJoin(aDeleteOldPageNum);
+                        
rDoc.getIDocumentContentOperations().DeleteAndJoin(aDeleteOldPageNum);
                     }
 
                     pTextNode = 
rSh.GetCursor()->GetPoint()->GetNode().GetTextNode();
@@ -1325,7 +1325,7 @@ FIELD_INSERT:
                     // Insert new line if there is already text in 
header/footer
                     if (pTextNode && !pTextNode->GetText().isEmpty())
                     {
-                        rDoc->getIDocumentContentOperations().SplitNode(
+                        rDoc.getIDocumentContentOperations().SplitNode(
                             *rSh.GetCursor()->GetPoint(), false);
                         // Go back to start of header/footer
                         rSh.SetCursorInHdFt(nPageDescIndex, bHeader, 
/*Even=*/true);
@@ -1346,7 +1346,7 @@ FIELD_INSERT:
                     aEvenMgr.InsertField(aData);
                     if (pDlg->GetIncludePageTotal())
                     {
-                        
rDoc->getIDocumentContentOperations().InsertString(*rSh.GetCursor(), u" / 
"_ustr);
+                        
rDoc.getIDocumentContentOperations().InsertString(*rSh.GetCursor(), u" / 
"_ustr);
                         SwInsertField_Data 
aPageTotalData(SwFieldTypesEnum::DocumentStatistics,
                                                           DS_PAGE, OUString(), 
OUString(),
                                                           SVX_NUM_PAGEDESC);
@@ -1366,7 +1366,7 @@ FIELD_INSERT:
                 rSh.SwCursorShell::Pop(SwCursorShell::PopMode::DeleteCurrent);
                 rSh.EndAllAction();
                 rSh.LockView(false);
-                
rDoc->GetIDocumentUndoRedo().EndUndo(SwUndoId::INSERT_PAGE_NUMBER, nullptr);
+                
rDoc.GetIDocumentUndoRedo().EndUndo(SwUndoId::INSERT_PAGE_NUMBER, nullptr);
             }
             pDlg->disposeOnce();
         });

Reply via email to