[Libreoffice-commits] core.git: sc/source

Noel Grandin noel.grandin at collabora.co.uk
Tue Apr 11 10:30:05 UTC 2017


 sc/source/filter/inc/root.hxx       |   16 ++++++++--------
 sc/source/filter/lotus/lotattr.cxx  |    2 +-
 sc/source/filter/lotus/lotform.cxx  |    2 +-
 sc/source/filter/lotus/lotimpop.cxx |   17 ++++++-----------
 sc/source/filter/lotus/lotread.cxx  |    4 ++--
 sc/source/filter/lotus/op.cxx       |    4 ++--
 6 files changed, 20 insertions(+), 25 deletions(-)

New commits:
commit b9dbd58cdd3767ee5d574023c6331932440275b9
Author: Noel Grandin <noel.grandin at collabora.co.uk>
Date:   Tue Apr 11 10:04:59 2017 +0200

    loplugin:inlinefields in LOTUS_ROOT
    
    Change-Id: Ia0e1eebf5fd15d487451fd061f053fb5b802ca98
    Reviewed-on: https://gerrit.libreoffice.org/36406
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>

diff --git a/sc/source/filter/inc/root.hxx b/sc/source/filter/inc/root.hxx
index d74a7ed62538..377a62266f64 100644
--- a/sc/source/filter/inc/root.hxx
+++ b/sc/source/filter/inc/root.hxx
@@ -25,6 +25,10 @@
 #include "flttypes.hxx"
 #include "filter.hxx"
 #include "excdefs.hxx"
+#include "lotattr.hxx"
+#include "lotfntbf.hxx"
+#include "lotrange.hxx"
+#include <memory>
 
 class ScRangeName;
 
@@ -81,22 +85,18 @@ protected:
 
 // Lotus Imp~/Exp~ -
 
-class LotusRangeList;
-class LotusFontBuffer;
-class LotAttrTable;
-
 struct LOTUS_ROOT
 {
     ScDocument*         pDoc;
-    LotusRangeList*     pRangeNames;
+    LotusRangeList      maRangeNames;
     ScRangeName*        pScRangeName;
     rtl_TextEncoding    eCharsetQ;
     Lotus123Typ         eFirstType;
     Lotus123Typ         eActType;
     ScRange             aActRange;
-    RangeNameBufferWK3* pRngNmBffWK3;
-    LotusFontBuffer*    pFontBuff;
-    LotAttrTable*       pAttrTable;
+    std::unique_ptr<RangeNameBufferWK3> pRngNmBffWK3;
+    LotusFontBuffer     maFontBuff;
+    LotAttrTable        maAttrTable;
 
                         LOTUS_ROOT( ScDocument* pDocP, rtl_TextEncoding eQ );
                         ~LOTUS_ROOT();
diff --git a/sc/source/filter/lotus/lotattr.cxx b/sc/source/filter/lotus/lotattr.cxx
index d9d9ac4cdad0..863afbeebe27 100644
--- a/sc/source/filter/lotus/lotattr.cxx
+++ b/sc/source/filter/lotus/lotattr.cxx
@@ -101,7 +101,7 @@ const ScPatternAttr& LotAttrCache::GetPattAttr( const LotAttrWK3& rAttr )
 
     pAkt->nHash0 = nRefHash;
 
-    mpLotusRoot->pFontBuff->Fill( rAttr.nFont, rItemSet );
+    mpLotusRoot->maFontBuff.Fill( rAttr.nFont, rItemSet );
 
     sal_uInt8 nLine = rAttr.nLineStyle;
     if( nLine )
diff --git a/sc/source/filter/lotus/lotform.cxx b/sc/source/filter/lotus/lotform.cxx
index cec80e44f2b2..c066684443e7 100644
--- a/sc/source/filter/lotus/lotform.cxx
+++ b/sc/source/filter/lotus/lotform.cxx
@@ -389,7 +389,7 @@ void LotusToSc::Convert( const ScTokenArray*& rpErg, sal_Int32& rRest )
     LR_ID               nId;
     TokenId             nNewId;
 
-    LotusRangeList&     rRangeList = *m_rContext.pLotusRoot->pRangeNames;
+    LotusRangeList&     rRangeList = m_rContext.pLotusRoot->maRangeNames;
 
     FuncType1*          pIndexToType;
     FuncType2*          pIndexToToken;
diff --git a/sc/source/filter/lotus/lotimpop.cxx b/sc/source/filter/lotus/lotimpop.cxx
index 9babc9354871..087f93faacb2 100644
--- a/sc/source/filter/lotus/lotimpop.cxx
+++ b/sc/source/filter/lotus/lotimpop.cxx
@@ -42,23 +42,18 @@
 LOTUS_ROOT::LOTUS_ROOT( ScDocument* pDocP, rtl_TextEncoding eQ )
     :
         pDoc( pDocP),
-        pRangeNames( new LotusRangeList(this)),
+        maRangeNames( this ),
         pScRangeName( pDocP->GetRangeName()),
         eCharsetQ( eQ),
         eFirstType( Lotus123Typ::X),
         eActType( Lotus123Typ::X),
         pRngNmBffWK3( new RangeNameBufferWK3(this)),
-        pFontBuff( new LotusFontBuffer),
-        pAttrTable( new LotAttrTable(this))
+        maAttrTable( this )
 {
 }
 
 LOTUS_ROOT::~LOTUS_ROOT()
 {
-    delete pRangeNames;
-    delete pRngNmBffWK3;
-    delete pFontBuff;
-    delete pAttrTable;
 }
 
 static osl::Mutex aLotImpSemaphore;
@@ -354,7 +349,7 @@ void ImportLotus::Font_Face()
     Read( aName );
 
     LotusContext &rContext = aConv.getContext();
-    rContext.pLotusRoot->pFontBuff->SetName( nNum, aName );
+    rContext.pLotusRoot->maFontBuff.SetName( nNum, aName );
 }
 
 void ImportLotus::Font_Type()
@@ -364,7 +359,7 @@ void ImportLotus::Font_Type()
     {
         sal_uInt16 nType;
         Read( nType );
-        rContext.pLotusRoot->pFontBuff->SetType( nCnt, nType );
+        rContext.pLotusRoot->maFontBuff.SetType( nCnt, nType );
     }
 }
 
@@ -375,7 +370,7 @@ void ImportLotus::Font_Ysize()
     {
         sal_uInt16 nSize;
         Read( nSize );
-        rContext.pLotusRoot->pFontBuff->SetHeight( nCnt, nSize );
+        rContext.pLotusRoot->maFontBuff.SetHeight( nCnt, nSize );
     }
 }
 
@@ -412,7 +407,7 @@ void ImportLotus::Row_( const sal_uInt16 nRecLen )
         Read( nRepeats );
 
         if( aAttr.HasStyles() )
-            rContext.pLotusRoot->pAttrTable->SetAttr(
+            rContext.pLotusRoot->maAttrTable.SetAttr(
                 nColCnt, static_cast<SCCOL> ( nColCnt + nRepeats ), nRow, aAttr );
 
         // Do this here and NOT in class LotAttrTable, as we only add attributes if the other
diff --git a/sc/source/filter/lotus/lotread.cxx b/sc/source/filter/lotus/lotread.cxx
index 1a37631688c9..d23955b544ef 100644
--- a/sc/source/filter/lotus/lotread.cxx
+++ b/sc/source/filter/lotus/lotread.cxx
@@ -283,7 +283,7 @@ FltError ImportLotus::Read(SvStream& rIn)
 
                 case 195:
                     if( nExtTab >= 0 )
-                        rContext.pLotusRoot->pAttrTable->Apply(rContext.pLotusRoot, (SCTAB)nExtTab);
+                        rContext.pLotusRoot->maAttrTable.Apply(rContext.pLotusRoot, (SCTAB)nExtTab);
                     nExtTab++;
                     break;
                 case 197:
@@ -298,7 +298,7 @@ FltError ImportLotus::Read(SvStream& rIn)
         }
     }
 
-    rContext.pLotusRoot->pAttrTable->Apply(rContext.pLotusRoot, (SCTAB)nExtTab);
+    rContext.pLotusRoot->maAttrTable.Apply(rContext.pLotusRoot, (SCTAB)nExtTab);
 
     return eRet;
 }
diff --git a/sc/source/filter/lotus/op.cxx b/sc/source/filter/lotus/op.cxx
index 78df25d4e902..0f0b2ad4c180 100644
--- a/sc/source/filter/lotus/op.cxx
+++ b/sc/source/filter/lotus/op.cxx
@@ -223,7 +223,7 @@ void OP_NamedRange(LotusContext& rContext, SvStream& r, sal_uInt16 /*n*/)
 
         aTmp = ScfTools::ConvertToScDefinedName( aTmp );
 
-        rContext.pLotusRoot->pRangeNames->Append( pRange, aTmp );
+        rContext.pLotusRoot->maRangeNames.Append( pRange, aTmp );
     }
 }
 
@@ -261,7 +261,7 @@ void OP_SymphNamedRange(LotusContext& rContext, SvStream& r, sal_uInt16 /*n*/)
         OUString  aTmp( cBuf, strlen(cBuf), rContext.pLotusRoot->eCharsetQ );
         aTmp = ScfTools::ConvertToScDefinedName( aTmp );
 
-        rContext.pLotusRoot->pRangeNames->Append( pRange, aTmp );
+        rContext.pLotusRoot->maRangeNames.Append( pRange, aTmp );
     }
 }
 


More information about the Libreoffice-commits mailing list