sc/source/filter/lotus/filter.cxx    |    4 -
 sc/source/filter/lotus/lotattr.cxx   |   12 ++---
 sc/source/filter/lotus/lotfilter.hxx |    4 -
 sc/source/filter/lotus/lotform.cxx   |    8 +--
 sc/source/filter/lotus/lotimpop.cxx  |    4 -
 sc/source/filter/lotus/lotread.cxx   |    2 
 sc/source/filter/lotus/lotus.cxx     |   10 ++--
 sc/source/filter/lotus/memory.cxx    |    2 
 sc/source/filter/lotus/op.cxx        |   78 +++++++++++++++++------------------
 sc/source/filter/lotus/tool.cxx      |   16 +++----
 10 files changed, 70 insertions(+), 70 deletions(-)

New commits:
commit 9dab203196b5acd2bfec052c71cd3cf75764e5dc
Author:     Caolán McNamara <caol...@redhat.com>
AuthorDate: Sun Sep 13 19:09:25 2020 +0100
Commit:     Caolán McNamara <caol...@redhat.com>
CommitDate: Mon Sep 14 09:44:30 2020 +0200

    LotusContext ctor always dereferences its ScDocument*
    
    Change-Id: I05aa86253f269152acd1e8122e4289bfb2b20e16
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/102595
    Tested-by: Caolán McNamara <caol...@redhat.com>
    Reviewed-by: Caolán McNamara <caol...@redhat.com>

diff --git a/sc/source/filter/lotus/filter.cxx 
b/sc/source/filter/lotus/filter.cxx
index 2e8ad776082e..d61015595a16 100644
--- a/sc/source/filter/lotus/filter.cxx
+++ b/sc/source/filter/lotus/filter.cxx
@@ -120,7 +120,7 @@ generate_Opcodes(LotusContext &rContext, SvStream& aStream,
     if (!aStream.good())
         nErr = SCERR_IMPORT_FORMAT;
     else if (nErr == ERRCODE_NONE)
-        rContext.pDoc->CalcAfterLoad();
+        rContext.rDoc.CalcAfterLoad();
 
     return nErr;
 }
@@ -199,7 +199,7 @@ ErrCode ScImportLotus123old(LotusContext& rContext, 
SvStream& aStream, rtl_TextE
     //scGetPageFormat( 0, &aPage );
 
     // start progressbar
-    ScfStreamProgressBar aPrgrsBar( aStream, rContext.pDoc->GetDocumentShell() 
);
+    ScfStreamProgressBar aPrgrsBar( aStream, rContext.rDoc.GetDocumentShell() 
);
 
     // detect file type
     rContext.eTyp = ScanVersion(aStream);
diff --git a/sc/source/filter/lotus/lotattr.cxx 
b/sc/source/filter/lotus/lotattr.cxx
index 7e1af1fcfff6..5054e8c36fcc 100644
--- a/sc/source/filter/lotus/lotattr.cxx
+++ b/sc/source/filter/lotus/lotattr.cxx
@@ -50,7 +50,7 @@ LotAttrCache::ENTRY::~ENTRY ()
 LotAttrCache::LotAttrCache (LotusContext& rContext)
     : mrContext(rContext)
 {
-    pDocPool = rContext.pDoc->GetPool();
+    pDocPool = rContext.rDoc.GetPool();
 
     pColTab.reset( new Color [ 8 ] );
     pColTab[ 0 ] = COL_WHITE;
@@ -214,12 +214,12 @@ void LotAttrCol::SetAttr( const ScDocument* pDoc, const 
SCROW nRow, const ScPatt
 
 void LotAttrCol::Apply(LotusContext& rContext, const SCCOL nColNum, const 
SCTAB nTabNum)
 {
-    ScDocument*     pDoc = rContext.pDoc;
+    ScDocument& rDoc = rContext.rDoc;
 
     for (const auto& rxEntry : aEntries)
     {
-        pDoc->ApplyPatternAreaTab(nColNum, rxEntry->nFirstRow, nColNum, 
rxEntry->nLastRow,
-                                  nTabNum, *(rxEntry->pPattAttr));
+        rDoc.ApplyPatternAreaTab(nColNum, rxEntry->nFirstRow, nColNum, 
rxEntry->nLastRow,
+                                 nTabNum, *(rxEntry->pPattAttr));
     }
 }
 
@@ -238,13 +238,13 @@ void LotAttrTable::SetAttr( LotusContext& rContext, const 
SCCOL nColFirst, const
     SCCOL nColCnt;
 
     for( nColCnt = nColFirst ; nColCnt <= nColLast ; nColCnt++ )
-        pCols[ nColCnt ].SetAttr( rContext.pDoc, nRow, rPattAttr );
+        pCols[ nColCnt ].SetAttr( &rContext.rDoc, nRow, rPattAttr );
 }
 
 void LotAttrTable::Apply(LotusContext& rContext, const SCTAB nTabNum)
 {
     SCCOL nColCnt;
-    for( nColCnt = 0 ; nColCnt <= aAttrCache.mrContext.pDoc->MaxCol() ; 
nColCnt++ )
+    for( nColCnt = 0 ; nColCnt <= aAttrCache.mrContext.rDoc.MaxCol() ; 
nColCnt++ )
         pCols[ nColCnt ].Apply(rContext, nColCnt, nTabNum);     // does a 
Clear() at end
 }
 
diff --git a/sc/source/filter/lotus/lotfilter.hxx 
b/sc/source/filter/lotus/lotfilter.hxx
index 95cb49b3b13d..043e950525ce 100644
--- a/sc/source/filter/lotus/lotfilter.hxx
+++ b/sc/source/filter/lotus/lotfilter.hxx
@@ -42,7 +42,7 @@ struct LotusContext
     WKTYP            eTyp;          // type of file being processed
     bool             bEOF;          // shows end of file
     rtl_TextEncoding eCharset;
-    ScDocument*      pDoc;          // pointer to access document
+    ScDocument&      rDoc;          // reference to access document
     std::map<sal_uInt16, ScPatternAttr> aLotusPatternPool;
 
     SvxHorJustifyItem *pAttrRight, *pAttrLeft, *pAttrCenter, *pAttrRepeat, 
*pAttrStandard;
@@ -57,7 +57,7 @@ struct LotusContext
     LotusFontBuffer     maFontBuff;
     LotAttrTable        maAttrTable;
 
-    LotusContext(ScDocument* pDocP, rtl_TextEncoding eQ);
+    LotusContext(ScDocument& rDocP, rtl_TextEncoding eQ);
 };
 
 #endif
diff --git a/sc/source/filter/lotus/lotform.cxx 
b/sc/source/filter/lotus/lotform.cxx
index 783780624f34..f51ee0ab938d 100644
--- a/sc/source/filter/lotus/lotform.cxx
+++ b/sc/source/filter/lotus/lotform.cxx
@@ -436,7 +436,7 @@ void LotusToSc::Convert( std::unique_ptr<ScTokenArray>& 
rpErg, sal_Int32& rRest
 
         if( nBytesLeft < 0 )
         {
-            rpErg = aPool.GetTokenArray(m_rContext.pDoc, aStack.Get());
+            rpErg = aPool.GetTokenArray(&m_rContext.rDoc, aStack.Get());
             return;
         }
 
@@ -552,12 +552,12 @@ void LotusToSc::Convert( std::unique_ptr<ScTokenArray>& 
rpErg, sal_Int32& rRest
             // for > WK3
             case FT_Cref:
                 Read( nRelBits );
-                ReadSRD( m_rContext.pDoc, rR, nRelBits );
+                ReadSRD( &m_rContext.rDoc, rR, nRelBits );
                 aStack << aPool.Store( rR );
                 break;
             case FT_Rref:
                 Read( nRelBits );
-                ReadCRD( m_rContext.pDoc, aCRD, nRelBits );
+                ReadCRD( &m_rContext.rDoc, aCRD, nRelBits );
                 aStack << aPool.Store( aCRD );
                 break;
             case FT_Nrref:
@@ -655,7 +655,7 @@ void LotusToSc::Convert( std::unique_ptr<ScTokenArray>& 
rpErg, sal_Int32& rRest
         }
     }
 
-    rpErg = aPool.GetTokenArray( m_rContext.pDoc, aStack.Get());
+    rpErg = aPool.GetTokenArray( &m_rContext.rDoc, aStack.Get());
 
     SAL_WARN_IF( nBytesLeft < 0, "sc.filter", "*LotusToSc::Convert(): 
processed too much!");
     SAL_WARN_IF( nBytesLeft > 0, "sc.filter", "*LotusToSc::Convert(): what 
happens with the rest?" );
diff --git a/sc/source/filter/lotus/lotimpop.cxx 
b/sc/source/filter/lotus/lotimpop.cxx
index 00f64cfd596f..ebff4e67480d 100644
--- a/sc/source/filter/lotus/lotimpop.cxx
+++ b/sc/source/filter/lotus/lotimpop.cxx
@@ -167,7 +167,7 @@ void ImportLotus::Userrange()
     Read( aScRange );
 
     LotusContext &rContext = aConv.getContext();
-    rContext.pRngNmBffWK3->Add( rContext.pDoc, aName, aScRange );
+    rContext.pRngNmBffWK3->Add( &rContext.rDoc, aName, aScRange );
 }
 
 void ImportLotus::Errcell()
@@ -372,7 +372,7 @@ void ImportLotus::Row_( const sal_uInt16 nRecLen )
 
     sal_uInt16 nTmpRow(0);
     Read(nTmpRow);
-    SCROW nRow(rContext.pDoc->SanitizeRow(static_cast<SCROW>(nTmpRow)));
+    SCROW nRow(rContext.rDoc.SanitizeRow(static_cast<SCROW>(nTmpRow)));
     sal_uInt16 nHeight(0);
     Read(nHeight);
 
diff --git a/sc/source/filter/lotus/lotread.cxx 
b/sc/source/filter/lotus/lotread.cxx
index 85dad7b210c5..b0eefbf13466 100644
--- a/sc/source/filter/lotus/lotread.cxx
+++ b/sc/source/filter/lotus/lotread.cxx
@@ -321,7 +321,7 @@ extern "C" SAL_DLLPUBLIC_EXPORT bool 
TestImportWKS(SvStream& rStream)
     aDocument.EnableExecuteLink(false);
     aDocument.SetInsertingFromOtherDoc(true);
 
-    LotusContext aContext(&aDocument, RTL_TEXTENCODING_ASCII_US);
+    LotusContext aContext(aDocument, RTL_TEXTENCODING_ASCII_US);
     ImportLotus aLotusImport(aContext, rStream, &aDocument, 
RTL_TEXTENCODING_ASCII_US);
 
     ErrCode eRet = aLotusImport.parse();
diff --git a/sc/source/filter/lotus/lotus.cxx b/sc/source/filter/lotus/lotus.cxx
index bc0adc44da89..9e0e2216cec7 100644
--- a/sc/source/filter/lotus/lotus.cxx
+++ b/sc/source/filter/lotus/lotus.cxx
@@ -38,7 +38,7 @@ ErrCode ScFormatFilterPluginImpl::ScImportLotus123( 
SfxMedium& rMedium, ScDocume
 
     pStream->SetBufferSize( 32768 );
 
-    LotusContext aContext(pDocument, eSrc);
+    LotusContext aContext(*pDocument, eSrc);
 
     ImportLotus aLotusImport(aContext, *pStream, pDocument, eSrc);
 
@@ -53,7 +53,7 @@ ErrCode ScFormatFilterPluginImpl::ScImportLotus123( 
SfxMedium& rMedium, ScDocume
     {
         pStream->Seek( 0 );
         pStream->SetBufferSize( 32768 );
-        assert(pDocument == aContext.pDoc);
+        assert(pDocument == &aContext.rDoc);
         eRet = ScImportLotus123old(aContext, *pStream, eSrc);
         pStream->SetBufferSize( 0 );
         return eRet;
@@ -81,11 +81,11 @@ ErrCode ScFormatFilterPluginImpl::ScImportLotus123( 
SfxMedium& rMedium, ScDocume
     return eRet;
 }
 
-LotusContext::LotusContext(ScDocument* pDocP, rtl_TextEncoding eQ)
+LotusContext::LotusContext(ScDocument& rDocP, rtl_TextEncoding eQ)
     : eTyp(eWK_UNKNOWN)
     , bEOF(false)
     , eCharset(eQ)
-    , pDoc(pDocP)
+    , rDoc(rDocP)
     , pAttrRight(nullptr)
     , pAttrLeft(nullptr)
     , pAttrCenter(nullptr)
@@ -95,7 +95,7 @@ LotusContext::LotusContext(ScDocument* pDocP, 
rtl_TextEncoding eQ)
     , maRangeNames()
     , eFirstType( Lotus123Typ::X)
     , eActType( Lotus123Typ::X)
-    , pRngNmBffWK3( new RangeNameBufferWK3(*pDocP) )
+    , pRngNmBffWK3( new RangeNameBufferWK3(rDocP) )
     , maAttrTable( *this )
 {
 }
diff --git a/sc/source/filter/lotus/memory.cxx 
b/sc/source/filter/lotus/memory.cxx
index 83851d93c4ba..7852858b726e 100644
--- a/sc/source/filter/lotus/memory.cxx
+++ b/sc/source/filter/lotus/memory.cxx
@@ -29,7 +29,7 @@
 
 bool MemNew(LotusContext &rContext)
 {
-    rContext.pValueFormCache = new FormCache(rContext.pDoc);
+    rContext.pValueFormCache = new FormCache(&rContext.rDoc);
 
     // for tool.cxx::PutFormString()
     rContext.pAttrRight = new SvxHorJustifyItem( SvxCellHorJustify::Right, 
ATTR_HOR_JUSTIFY );
diff --git a/sc/source/filter/lotus/op.cxx b/sc/source/filter/lotus/op.cxx
index 59e4fb1a4b7f..e64ecd07458e 100644
--- a/sc/source/filter/lotus/op.cxx
+++ b/sc/source/filter/lotus/op.cxx
@@ -74,10 +74,10 @@ void OP_Integer(LotusContext& rContext, SvStream& r, 
sal_uInt16 /*n*/)
     SCCOL nCol(static_cast<SCCOL>(nTmpCol));
     SCROW nRow(static_cast<SCROW>(nTmpRow));
 
-    if (rContext.pDoc->ValidColRow(nCol, nRow))
+    if (rContext.rDoc.ValidColRow(nCol, nRow))
     {
-        rContext.pDoc->EnsureTable(0);
-        rContext.pDoc->SetValue(ScAddress(nCol, nRow, 0), 
static_cast<double>(nValue));
+        rContext.rDoc.EnsureTable(0);
+        rContext.rDoc.SetValue(ScAddress(nCol, nRow, 0), 
static_cast<double>(nValue));
 
         // 0 digits in fractional part!
         SetFormat(rContext, nCol, nRow, 0, nFormat, 0);
@@ -93,11 +93,11 @@ void OP_Number(LotusContext& rContext, SvStream& r, 
sal_uInt16 /*n*/)
     SCCOL nCol(static_cast<SCCOL>(nTmpCol));
     SCROW nRow(static_cast<SCROW>(nTmpRow));
 
-    if (rContext.pDoc->ValidColRow(nCol, nRow))
+    if (rContext.rDoc.ValidColRow(nCol, nRow))
     {
         fValue = ::rtl::math::round( fValue, 15 );
-        rContext.pDoc->EnsureTable(0);
-        rContext.pDoc->SetValue(ScAddress(nCol, nRow, 0), fValue);
+        rContext.rDoc.EnsureTable(0);
+        rContext.rDoc.SetValue(ScAddress(nCol, nRow, 0), fValue);
 
         SetFormat(rContext, nCol, nRow, 0, nFormat, nFractionalFloat);
     }
@@ -117,7 +117,7 @@ void OP_Label(LotusContext& rContext, SvStream& r, 
sal_uInt16 n)
     r.ReadBytes(pText.get(), n);
     pText[n] = 0;
 
-    if (rContext.pDoc->ValidColRow(nCol, nRow))
+    if (rContext.rDoc.ValidColRow(nCol, nRow))
     {
         nFormat &= 0x80;    // don't change Bit 7
         nFormat |= 0x75;    // protected does not matter, special-text is set
@@ -144,19 +144,19 @@ void OP_Formula(LotusContext &rContext, SvStream& r, 
sal_uInt16 /*n*/)
     sal_Int32 nBytesLeft = nFormulaSize;
     ScAddress aAddress(nCol, nRow, 0);
 
-    svl::SharedStringPool& rSPool = rContext.pDoc->GetSharedStringPool();
+    svl::SharedStringPool& rSPool = rContext.rDoc.GetSharedStringPool();
     LotusToSc aConv(rContext, r, rSPool, rContext.eCharset, false);
     aConv.Reset( aAddress );
     aConv.Convert( pResult, nBytesLeft );
     if (!aConv.good())
         return;
 
-    if (rContext.pDoc->ValidColRow(nCol, nRow))
+    if (rContext.rDoc.ValidColRow(nCol, nRow))
     {
-        ScFormulaCell* pCell = new ScFormulaCell(rContext.pDoc, aAddress, 
std::move(pResult));
+        ScFormulaCell* pCell = new ScFormulaCell(&rContext.rDoc, aAddress, 
std::move(pResult));
         pCell->AddRecalcMode( ScRecalcMode::ONLOAD_ONCE );
-        rContext.pDoc->EnsureTable(0);
-        rContext.pDoc->SetFormulaCell(ScAddress(nCol, nRow, 0), pCell);
+        rContext.rDoc.EnsureTable(0);
+        rContext.rDoc.SetFormulaCell(ScAddress(nCol, nRow, 0), pCell);
 
         // nFormat = Default -> number of digits in fractional part like Float
         SetFormat(rContext, nCol, nRow, 0, nFormat, nFractionalFloat);
@@ -170,10 +170,10 @@ void OP_ColumnWidth(LotusContext& rContext, SvStream& r, 
sal_uInt16 /*n*/)
     r.ReadUInt16(nTmpCol).ReadUChar(nWidthSpaces);
     SCCOL nCol(static_cast<SCCOL>(nTmpCol));
 
-    if (!rContext.pDoc->ValidCol(nCol))
+    if (!rContext.rDoc.ValidCol(nCol))
         return;
 
-    nCol = rContext.pDoc->SanitizeCol(nCol);
+    nCol = rContext.rDoc.SanitizeCol(nCol);
 
     sal_uInt16 nBreite;
     if( nWidthSpaces )
@@ -181,11 +181,11 @@ void OP_ColumnWidth(LotusContext& rContext, SvStream& r, 
sal_uInt16 /*n*/)
         nBreite = static_cast<sal_uInt16>( TWIPS_PER_CHAR * nWidthSpaces );
     else
     {
-        rContext.pDoc->SetColHidden(nCol, nCol, 0, true);
+        rContext.rDoc.SetColHidden(nCol, nCol, 0, true);
         nBreite = nDefWidth;
     }
 
-    rContext.pDoc->SetColWidth(nCol, 0, nBreite);
+    rContext.rDoc.SetColWidth(nCol, 0, nBreite);
 }
 
 void OP_NamedRange(LotusContext& rContext, SvStream& r, sal_uInt16 /*n*/)
@@ -199,7 +199,7 @@ void OP_NamedRange(LotusContext& rContext, SvStream& r, 
sal_uInt16 /*n*/)
 
     r.ReadUInt16( nColSt ).ReadUInt16( nRowSt ).ReadUInt16( nColEnd 
).ReadUInt16( nRowEnd );
 
-    if (!(rContext.pDoc->ValidColRow( static_cast<SCCOL>(nColSt), nRowSt) && 
rContext.pDoc->ValidColRow( static_cast<SCCOL>(nColEnd), nRowEnd)))
+    if (!(rContext.rDoc.ValidColRow( static_cast<SCCOL>(nColSt), nRowSt) && 
rContext.rDoc.ValidColRow( static_cast<SCCOL>(nColEnd), nRowEnd)))
         return;
 
     std::unique_ptr<LotusRange> pRange;
@@ -223,7 +223,7 @@ void OP_NamedRange(LotusContext& rContext, SvStream& r, 
sal_uInt16 /*n*/)
 
     aTmp = ScfTools::ConvertToScDefinedName( aTmp );
 
-    rContext.maRangeNames.Append( rContext.pDoc, std::move(pRange) );
+    rContext.maRangeNames.Append( &rContext.rDoc, std::move(pRange) );
 }
 
 void OP_SymphNamedRange(LotusContext& rContext, SvStream& r, sal_uInt16 /*n*/)
@@ -238,7 +238,7 @@ void OP_SymphNamedRange(LotusContext& rContext, SvStream& 
r, sal_uInt16 /*n*/)
 
     r.ReadUInt16( nColSt ).ReadUInt16( nRowSt ).ReadUInt16( nColEnd 
).ReadUInt16( nRowEnd ).ReadUChar( nType );
 
-    if (!(rContext.pDoc->ValidColRow( static_cast<SCCOL>(nColSt), nRowSt) && 
rContext.pDoc->ValidColRow( static_cast<SCCOL>(nColEnd), nRowEnd)))
+    if (!(rContext.rDoc.ValidColRow( static_cast<SCCOL>(nColSt), nRowSt) && 
rContext.rDoc.ValidColRow( static_cast<SCCOL>(nColEnd), nRowEnd)))
         return;
 
     std::unique_ptr<LotusRange> pRange;
@@ -261,7 +261,7 @@ void OP_SymphNamedRange(LotusContext& rContext, SvStream& 
r, sal_uInt16 /*n*/)
     OUString  aTmp( cBuf, strlen(cBuf), rContext.eCharset );
     aTmp = ScfTools::ConvertToScDefinedName( aTmp );
 
-    rContext.maRangeNames.Append( rContext.pDoc, std::move(pRange) );
+    rContext.maRangeNames.Append( &rContext.rDoc, std::move(pRange) );
 }
 
 void OP_Footer(LotusContext& /*rContext*/, SvStream& r, sal_uInt16 n)
@@ -294,7 +294,7 @@ void OP_HiddenCols(LotusContext& rContext, SvStream& r, 
sal_uInt16 /*n*/)
             if( nCurrent & 0x01 )   // is lowest Bit set?
             {
                 // -> Hidden Col
-                rContext.pDoc->SetColHidden(nCount, nCount, 0, true);
+                rContext.rDoc.SetColHidden(nCount, nCount, 0, true);
             }
 
             nCount++;
@@ -323,9 +323,9 @@ void OP_Window1(LotusContext& rContext, SvStream& r, 
sal_uInt16 n)
     const bool bFuzzing = utl::ConfigManager::IsFuzzing();
 
     // instead of default, set all Cols in SC by hand
-    for (SCCOL nCol = 0 ; nCol <= rContext.pDoc->MaxCol() ; nCol++)
+    for (SCCOL nCol = 0 ; nCol <= rContext.rDoc.MaxCol() ; nCol++)
     {
-        rContext.pDoc->SetColWidth( nCol, 0, nDefWidth );
+        rContext.rDoc.SetColWidth( nCol, 0, nDefWidth );
         if (bFuzzing)
             break;
     }
@@ -380,11 +380,11 @@ void OP_Number123(LotusContext& rContext, SvStream& r, 
sal_uInt16 /*n*/)
     SCCOL nCol(static_cast<SCCOL>(nTmpCol));
     SCROW nRow(static_cast<SCROW>(nTmpRow));
 
-    if (rContext.pDoc->ValidColRow(nCol, nRow) && nTab <= 
rContext.pDoc->GetMaxTableNumber())
+    if (rContext.rDoc.ValidColRow(nCol, nRow) && nTab <= 
rContext.rDoc.GetMaxTableNumber())
     {
         double fValue = Snum32ToDouble( nValue );
-        rContext.pDoc->EnsureTable(nTab);
-        rContext.pDoc->SetValue(ScAddress(nCol,nRow,nTab), fValue);
+        rContext.rDoc.EnsureTable(nTab);
+        rContext.rDoc.SetValue(ScAddress(nCol,nRow,nTab), fValue);
     }
 }
 
@@ -402,19 +402,19 @@ void OP_Formula123(LotusContext& rContext, SvStream& r, 
sal_uInt16 n)
     sal_Int32 nBytesLeft = (n > 12) ? n - 12 : 0;
     ScAddress aAddress( nCol, nRow, nTab );
 
-    svl::SharedStringPool& rSPool = rContext.pDoc->GetSharedStringPool();
+    svl::SharedStringPool& rSPool = rContext.rDoc.GetSharedStringPool();
     LotusToSc aConv(rContext, r, rSPool, rContext.eCharset, true);
     aConv.Reset( aAddress );
     aConv.Convert( pResult, nBytesLeft );
     if (!aConv.good())
         return;
 
-    if (rContext.pDoc->ValidColRow(nCol, nRow) && nTab <= 
rContext.pDoc->GetMaxTableNumber())
+    if (rContext.rDoc.ValidColRow(nCol, nRow) && nTab <= 
rContext.rDoc.GetMaxTableNumber())
     {
-        ScFormulaCell* pCell = new ScFormulaCell(rContext.pDoc, aAddress, 
std::move(pResult));
+        ScFormulaCell* pCell = new ScFormulaCell(&rContext.rDoc, aAddress, 
std::move(pResult));
         pCell->AddRecalcMode( ScRecalcMode::ONLOAD_ONCE );
-        rContext.pDoc->EnsureTable(nTab);
-        rContext.pDoc->SetFormulaCell(ScAddress(nCol,nRow,nTab), pCell);
+        rContext.rDoc.EnsureTable(nTab);
+        rContext.rDoc.SetFormulaCell(ScAddress(nCol,nRow,nTab), pCell);
     }
 }
 
@@ -428,10 +428,10 @@ void OP_IEEENumber123(LotusContext& rContext, SvStream& 
r, sal_uInt16 /*n*/)
     SCCOL nCol(static_cast<SCCOL>(nTmpCol));
     SCROW nRow(static_cast<SCROW>(nTmpRow));
 
-    if (rContext.pDoc->ValidColRow(nCol, nRow) && nTab <= 
rContext.pDoc->GetMaxTableNumber())
+    if (rContext.rDoc.ValidColRow(nCol, nRow) && nTab <= 
rContext.rDoc.GetMaxTableNumber())
     {
-        rContext.pDoc->EnsureTable(nTab);
-        rContext.pDoc->SetValue(ScAddress(nCol,nRow,nTab), dValue);
+        rContext.rDoc.EnsureTable(nTab);
+        rContext.rDoc.SetValue(ScAddress(nCol,nRow,nTab), dValue);
     }
 }
 
@@ -454,7 +454,7 @@ void OP_Note123(LotusContext& rContext, SvStream& r, 
sal_uInt16 n)
     pText.reset();
 
     ScAddress aPos(nCol, nRow, nTab);
-    ScNoteUtil::CreateNoteFromString( *rContext.pDoc, aPos, aNoteText, false, 
false );
+    ScNoteUtil::CreateNoteFromString( rContext.rDoc, aPos, aNoteText, false, 
false );
 }
 
 void OP_HorAlign123(LotusContext& /*rContext*/, sal_uInt8 nAlignPattern, 
SfxItemSet& rPatternItemSet)
@@ -523,7 +523,7 @@ void OP_CreatePattern123(LotusContext& rContext, SvStream& 
r, sal_uInt16 n)
 {
     sal_uInt16 nCode,nPatternId;
 
-    ScPatternAttr aPattern(rContext.pDoc->GetPool());
+    ScPatternAttr aPattern(rContext.rDoc.GetPool());
     SfxItemSet& rItemSet = aPattern.GetItemSet();
 
     r.ReadUInt16( nCode );
@@ -592,11 +592,11 @@ void OP_SheetName123(LotusContext& rContext, SvStream& 
rStream, sal_uInt16 nLeng
     if (!ValidTab(nSheetNum))
         return;
     // coverity[tainted_data : FALSE] - ValidTab has sanitized nSheetNum
-    rContext.pDoc->MakeTable(nSheetNum);
+    rContext.rDoc.MakeTable(nSheetNum);
     if (!sSheetName.empty())
     {
         OUString aName(sSheetName.data(), strlen(sSheetName.data()), 
rContext.eCharset);
-        rContext.pDoc->RenameTab(nSheetNum, aName);
+        rContext.rDoc.RenameTab(nSheetNum, aName);
     }
 }
 
@@ -657,7 +657,7 @@ void OP_ApplyPatternArea123(LotusContext& rContext, 
SvStream& rStream)
                     if ( loc != rContext.aLotusPatternPool.end() )
                         for( int i = 0; i < nTabCount; i++)
                         {
-                            rContext.pDoc->ApplyPatternAreaTab( nCol, nRow, 
nCol +  nColCount - 1, nRow + nRowCount - 1, static_cast< SCTAB >( nTab + i ), 
loc->second );
+                            rContext.rDoc.ApplyPatternAreaTab( nCol, nRow, 
nCol +  nColCount - 1, nRow + nRowCount - 1, static_cast< SCTAB >( nTab + i ), 
loc->second );
                         }
                 }
                 else
diff --git a/sc/source/filter/lotus/tool.cxx b/sc/source/filter/lotus/tool.cxx
index dd868ee98996..6ca63465052a 100644
--- a/sc/source/filter/lotus/tool.cxx
+++ b/sc/source/filter/lotus/tool.cxx
@@ -75,30 +75,30 @@ void PutFormString(LotusContext& rContext, SCCOL nCol, 
SCROW nRow, SCTAB nTab, c
     if (!pString)
         return;
 
-    nCol = rContext.pDoc->SanitizeCol(nCol);
-    nRow = rContext.pDoc->SanitizeRow(nRow);
+    nCol = rContext.rDoc.SanitizeCol(nCol);
+    nRow = rContext.rDoc.SanitizeRow(nRow);
     nTab = SanitizeTab(nTab);
 
-    rContext.pDoc->ApplyAttr( nCol, nRow, nTab, *pJustify );
+    rContext.rDoc.ApplyAttr( nCol, nRow, nTab, *pJustify );
     ScSetStringParam aParam;
     aParam.setTextInput();
-    rContext.pDoc->SetString(ScAddress(nCol,nRow,nTab), OUString(pString, 
strlen(pString), rContext.eCharset), &aParam);
+    rContext.rDoc.SetString(ScAddress(nCol,nRow,nTab), OUString(pString, 
strlen(pString), rContext.eCharset), &aParam);
 }
 
 void SetFormat(LotusContext& rContext, SCCOL nCol, SCROW nRow, SCTAB nTab, 
sal_uInt8 nFormat, sal_uInt8 nSt)
 {
-    nCol = rContext.pDoc->SanitizeCol(nCol);
-    nRow = rContext.pDoc->SanitizeRow(nRow);
+    nCol = rContext.rDoc.SanitizeCol(nCol);
+    nRow = rContext.rDoc.SanitizeRow(nRow);
     nTab = SanitizeTab(nTab);
 
     //  PREC:   nSt = default number of decimal places
-    rContext.pDoc->ApplyAttr(nCol, nRow, nTab, 
*(rContext.pValueFormCache->GetAttr(nFormat, nSt)));
+    rContext.rDoc.ApplyAttr(nCol, nRow, nTab, 
*(rContext.pValueFormCache->GetAttr(nFormat, nSt)));
 
     ScProtectionAttr aAttr;
 
     aAttr.SetProtection( nFormat & 0x80 );
 
-    rContext.pDoc->ApplyAttr( nCol, nRow, nTab, aAttr );
+    rContext.rDoc.ApplyAttr( nCol, nRow, nTab, aAttr );
 }
 
 double SnumToDouble( sal_Int16 nVal )
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to