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

Tor Lillqvist tml at collabora.com
Mon Sep 4 22:45:31 UTC 2017


 sc/inc/document.hxx                |   11 ++---
 sc/source/core/data/documen2.cxx   |   78 ++++++++++++++++++-------------------
 sc/source/core/data/documen3.cxx   |   12 ++---
 sc/source/core/data/documen4.cxx   |    4 -
 sc/source/core/data/documen5.cxx   |    8 +--
 sc/source/core/data/documen6.cxx   |    4 -
 sc/source/core/data/documen8.cxx   |   28 ++++++-------
 sc/source/core/data/documen9.cxx   |   28 ++++++-------
 sc/source/core/data/document.cxx   |   56 +++++++++++++-------------
 sc/source/core/data/document10.cxx |    2 
 sc/source/core/data/fillinfo.cxx   |    4 -
 11 files changed, 117 insertions(+), 118 deletions(-)

New commits:
commit fc61be93c60967bf1d6bcffcada8189016d4530e
Author: Tor Lillqvist <tml at collabora.com>
Date:   Tue Sep 5 01:12:40 2017 +0300

    Prefix one more member of ScDocument: pShell
    
    Change-Id: I72f2556f54e1ea4b397f9b21b1d767ae597e6e43

diff --git a/sc/inc/document.hxx b/sc/inc/document.hxx
index 498ea76b119f..e08378e2242c 100644
--- a/sc/inc/document.hxx
+++ b/sc/inc/document.hxx
@@ -319,7 +319,7 @@ private:
     SfxUndoManager*     mpUndoManager;
     ScFieldEditEngine*  mpEditEngine;                   // uses pEditPool from xPoolHelper
     ScNoteEditEngine*   mpNoteEngine;                   // uses pEditPool from xPoolHelper
-    SfxObjectShell*     pShell;
+    SfxObjectShell*     mpShell;
     VclPtr<SfxPrinter>    pPrinter;
     VclPtr<VirtualDevice> pVirtualDevice_100th_mm;
     ScDrawLayer*        pDrawLayer;                     // SdrModel
@@ -931,7 +931,7 @@ public:
     bool            SetDdeLinkResultMatrix( size_t nDdePos, const ScMatrixRef& pResults );
 
     SfxBindings*                    GetViewBindings();
-    SfxObjectShell*                 GetDocumentShell() const    { return pShell; }
+    SfxObjectShell*                 GetDocumentShell() const    { return mpShell; }
     SC_DLLPUBLIC ScDrawLayer*       GetDrawLayer() { return pDrawLayer;  }
     SC_DLLPUBLIC const ScDrawLayer* GetDrawLayer() const { return pDrawLayer;  }
     SfxBroadcaster*                 GetDrawBroadcaster();       // to avoid header
diff --git a/sc/source/core/data/documen2.cxx b/sc/source/core/data/documen2.cxx
index 78cc2a103d05..c54564ddd918 100644
--- a/sc/source/core/data/documen2.cxx
+++ b/sc/source/core/data/documen2.cxx
@@ -138,7 +138,7 @@ ScDocument::ScDocument( ScDocumentMode eMode, SfxObjectShell* pDocShell ) :
         mpUndoManager( nullptr ),
         mpEditEngine( nullptr ),
         mpNoteEngine( nullptr ),
-        pShell( pDocShell ),
+        mpShell( pDocShell ),
         pPrinter( nullptr ),
         pVirtualDevice_100th_mm( nullptr ),
         pDrawLayer( nullptr ),
@@ -266,7 +266,7 @@ const sfx2::LinkManager* ScDocument::GetLinkManager() const
 sc::DocumentLinkManager& ScDocument::GetDocLinkManager()
 {
     if (!mpDocLinkMgr)
-        mpDocLinkMgr.reset(new sc::DocumentLinkManager(pShell));
+        mpDocLinkMgr.reset(new sc::DocumentLinkManager(mpShell));
     return *mpDocLinkMgr;
 }
 
@@ -297,7 +297,7 @@ sal_uInt32 ScDocument::GetDocumentID() const
     const ScDocument* pThis = this;
     sal_uInt32 nCrc = rtl_crc32( 0, &pThis, sizeof(ScDocument*) );
     // the this pointer only might not be sufficient
-    nCrc = rtl_crc32( nCrc, &pShell, sizeof(SfxObjectShell*) );
+    nCrc = rtl_crc32( nCrc, &mpShell, sizeof(SfxObjectShell*) );
     return nCrc;
 }
 
@@ -328,16 +328,16 @@ IMPL_LINK_NOARG(ScDocument, TrackTimeHdl, Timer *, void)
     {
         aTrackIdle.Start();            // try again later
     }
-    else if (pShell)                    // execute
+    else if (mpShell)                    // execute
     {
         TrackFormulas();
-        pShell->Broadcast( SfxHint( SfxHintId::ScDataChanged ) );
+        mpShell->Broadcast( SfxHint( SfxHintId::ScDataChanged ) );
 
             //  modified...
 
-        if (!pShell->IsModified())
+        if (!mpShell->IsModified())
         {
-            pShell->SetModified();
+            mpShell->SetModified();
             SfxBindings* pBindings = GetViewBindings();
             if (pBindings)
             {
@@ -977,16 +977,16 @@ sal_uLong ScDocument::TransferTab( ScDocument* pSrcDoc, SCTAB nSrcPos,
                                             // 3 => NameBox
                                             // 4 => both
 
-    if (pSrcDoc->pShell->GetMedium())
+    if (pSrcDoc->mpShell->GetMedium())
     {
-        pSrcDoc->maFileURL = pSrcDoc->pShell->GetMedium()->GetURLObject().GetMainURL(INetURLObject::DecodeMechanism::ToIUri);
+        pSrcDoc->maFileURL = pSrcDoc->mpShell->GetMedium()->GetURLObject().GetMainURL(INetURLObject::DecodeMechanism::ToIUri);
         // for unsaved files use the title name and adjust during save of file
         if (pSrcDoc->maFileURL.isEmpty())
-            pSrcDoc->maFileURL = pSrcDoc->pShell->GetName();
+            pSrcDoc->maFileURL = pSrcDoc->mpShell->GetName();
     }
     else
     {
-        pSrcDoc->maFileURL = pSrcDoc->pShell->GetName();
+        pSrcDoc->maFileURL = pSrcDoc->mpShell->GetName();
     }
 
     bool bValid = true;
diff --git a/sc/source/core/data/documen3.cxx b/sc/source/core/data/documen3.cxx
index df46daa52e5d..5fb5c8dcd539 100644
--- a/sc/source/core/data/documen3.cxx
+++ b/sc/source/core/data/documen3.cxx
@@ -581,7 +581,7 @@ bool ScDocument::LinkExternalTab( SCTAB& rTab, const OUString& aDocTab,
     SetLink( rTab, ScLinkMode::VALUE, aFileName, aFilterName, aOptions, aTabName, nRefreshDelay );
     if ( !bWasThere ) // Add link only once per source document
     {
-        ScTableLink* pLink = new ScTableLink( pShell, aFileName, aFilterName, aOptions, nRefreshDelay );
+        ScTableLink* pLink = new ScTableLink( mpShell, aFileName, aFilterName, aOptions, nRefreshDelay );
         pLink->SetInCreate( true );
         OUString aFilName = aFilterName;
         GetLinkManager()->InsertFileLink( *pLink, OBJECT_CLIENT_FILE, aFileName, &aFilName );
@@ -1847,7 +1847,7 @@ bool ScDocument::IsDocProtected() const
 bool ScDocument::IsDocEditable() const
 {
     // Import into read-only document is possible
-    return !IsDocProtected() && ( bImportingXML || mbChangeReadOnlyEnabled || !pShell || !pShell->IsReadOnly() );
+    return !IsDocProtected() && ( bImportingXML || mbChangeReadOnlyEnabled || !mpShell || !mpShell->IsReadOnly() );
 }
 
 bool ScDocument::IsTabProtected( SCTAB nTab ) const
diff --git a/sc/source/core/data/documen5.cxx b/sc/source/core/data/documen5.cxx
index 5a673f36ab72..d355241de1c9 100644
--- a/sc/source/core/data/documen5.cxx
+++ b/sc/source/core/data/documen5.cxx
@@ -107,7 +107,7 @@ static void lcl_SetChartParameters( const uno::Reference< chart2::data::XDataRec
 
 void ScDocument::UpdateAllCharts()
 {
-    if ( !pDrawLayer || !pShell )
+    if ( !pDrawLayer || !mpShell )
         return;
 
     if (pChartCollection->empty())
@@ -159,7 +159,7 @@ void ScDocument::UpdateAllCharts()
                                     // connect
                                     xReceiver->attachDataProvider( xDataProvider );
                                     uno::Reference< util::XNumberFormatsSupplier > xNumberFormatsSupplier(
-                                            pShell->GetModel(), uno::UNO_QUERY );
+                                            mpShell->GetModel(), uno::UNO_QUERY );
                                     xReceiver->attachNumberFormatsSupplier( xNumberFormatsSupplier );
 
                                     lcl_SetChartParameters( xReceiver, sRangeStr, chart::ChartDataRowSource_COLUMNS,
@@ -393,13 +393,13 @@ void ScDocument::UpdateChartArea( const OUString& rChartName,
                         aNewRanges = rNewList;
                     }
 
-                    if ( bInternalData && pShell )
+                    if ( bInternalData && mpShell )
                     {
                         // Calc -> DataProvider
                         uno::Reference< chart2::data::XDataProvider > xDataProvider = new ScChart2DataProvider( this );
                         xReceiver->attachDataProvider( xDataProvider );
                         uno::Reference< util::XNumberFormatsSupplier > xNumberFormatsSupplier(
-                                pShell->GetModel(), uno::UNO_QUERY );
+                                mpShell->GetModel(), uno::UNO_QUERY );
                         xReceiver->attachNumberFormatsSupplier( xNumberFormatsSupplier );
                     }
 
diff --git a/sc/source/core/data/documen8.cxx b/sc/source/core/data/documen8.cxx
index 8f1908d4383b..437f2c17dae0 100644
--- a/sc/source/core/data/documen8.cxx
+++ b/sc/source/core/data/documen8.cxx
@@ -690,9 +690,9 @@ bool ScDocument::IdleCalcTextWidth()            // true = try next again
 
 void ScDocument::RepaintRange( const ScRange& rRange )
 {
-    if ( bIsVisible && pShell )
+    if ( bIsVisible && mpShell )
     {
-        ScModelObj* pModel = ScModelObj::getImplementation( pShell->GetModel() );
+        ScModelObj* pModel = ScModelObj::getImplementation( mpShell->GetModel() );
         if ( pModel )
             pModel->RepaintRange( rRange );     // locked repaints are checked there
     }
@@ -700,9 +700,9 @@ void ScDocument::RepaintRange( const ScRange& rRange )
 
 void ScDocument::RepaintRange( const ScRangeList& rRange )
 {
-    if ( bIsVisible && pShell )
+    if ( bIsVisible && mpShell )
     {
-        ScModelObj* pModel = ScModelObj::getImplementation( pShell->GetModel() );
+        ScModelObj* pModel = ScModelObj::getImplementation( mpShell->GetModel() );
         if ( pModel )
             pModel->RepaintRange( rRange );     // locked repaints are checked there
     }
@@ -848,12 +848,12 @@ void ScDocument::UpdateExternalRefLinks(vcl::Window* pWin)
     if (bAny)
     {
         TrackFormulas();
-        pShell->Broadcast( SfxHint(SfxHintId::ScDataChanged) );
+        mpShell->Broadcast( SfxHint(SfxHintId::ScDataChanged) );
 
         // #i101960# set document modified, as in TrackTimeHdl for DDE links
-        if (!pShell->IsModified())
+        if (!mpShell->IsModified())
         {
-            pShell->SetModified();
+            mpShell->SetModified();
             SfxBindings* pBindings = GetViewBindings();
             if (pBindings)
             {
@@ -1165,17 +1165,17 @@ SfxBindings* ScDocument::GetViewBindings()
 {
     //  used to invalidate slots after changes to this document
 
-    if ( !pShell )
+    if ( !mpShell )
         return nullptr;        // no ObjShell -> no view
 
     //  first check current view
     SfxViewFrame* pViewFrame = SfxViewFrame::Current();
-    if ( pViewFrame && pViewFrame->GetObjectShell() != pShell )     // wrong document?
+    if ( pViewFrame && pViewFrame->GetObjectShell() != mpShell )     // wrong document?
         pViewFrame = nullptr;
 
     //  otherwise use first view for this doc
     if ( !pViewFrame )
-        pViewFrame = SfxViewFrame::GetFirst( pShell );
+        pViewFrame = SfxViewFrame::GetFirst( mpShell );
 
     if (pViewFrame)
         return &pViewFrame->GetBindings();
diff --git a/sc/source/core/data/documen9.cxx b/sc/source/core/data/documen9.cxx
index 5610f967f73b..51be5a47fa1c 100644
--- a/sc/source/core/data/documen9.cxx
+++ b/sc/source/core/data/documen9.cxx
@@ -108,14 +108,14 @@ void ScDocument::TransferDrawPage(ScDocument* pSrcDoc, SCTAB nSrcPos, SCTAB nDes
 
 void ScDocument::InitDrawLayer( SfxObjectShell* pDocShell )
 {
-    if (pDocShell && !pShell)
-        pShell = pDocShell;
+    if (pDocShell && !mpShell)
+        mpShell = pDocShell;
 
     if (!pDrawLayer)
     {
         OUString aName;
-        if ( pShell && !pShell->IsLoading() )       // don't call GetTitle while loading
-            aName = pShell->GetTitle();
+        if ( mpShell && !mpShell->IsLoading() )       // don't call GetTitle while loading
+            aName = mpShell->GetTitle();
         pDrawLayer = new ScDrawLayer( this, aName );
 
         sfx2::LinkManager* pMgr = GetDocLinkManager().getLinkManager(bAutoCalc);
diff --git a/sc/source/core/data/document.cxx b/sc/source/core/data/document.cxx
index 239a766629f4..019ee463bacd 100644
--- a/sc/source/core/data/document.cxx
+++ b/sc/source/core/data/document.cxx
@@ -2001,8 +2001,8 @@ void ScDocument::InitUndo( const ScDocument* pSrcDoc, SCTAB nTab1, SCTAB nTab2,
     // Undo document shares its pooled resources with the source document.
     SharePooledResources(pSrcDoc);
 
-    if (pSrcDoc->pShell->GetMedium())
-        maFileURL = pSrcDoc->pShell->GetMedium()->GetURLObject().GetMainURL(INetURLObject::DecodeMechanism::ToIUri);
+    if (pSrcDoc->mpShell->GetMedium())
+        maFileURL = pSrcDoc->mpShell->GetMedium()->GetURLObject().GetMainURL(INetURLObject::DecodeMechanism::ToIUri);
 
     if ( nTab2 >= static_cast<SCTAB>(maTabs.size()))
         maTabs.resize(nTab2 + 1, nullptr);
@@ -2182,16 +2182,16 @@ void ScDocument::CopyToClip(const ScClipParam& rClipParam,
         pClipDoc = ScModule::GetClipDoc();
     }
 
-    if (pShell->GetMedium())
+    if (mpShell->GetMedium())
     {
-        pClipDoc->maFileURL = pShell->GetMedium()->GetURLObject().GetMainURL(INetURLObject::DecodeMechanism::ToIUri);
+        pClipDoc->maFileURL = mpShell->GetMedium()->GetURLObject().GetMainURL(INetURLObject::DecodeMechanism::ToIUri);
         // for unsaved files use the title name and adjust during save of file
         if (pClipDoc->maFileURL.isEmpty())
-            pClipDoc->maFileURL = pShell->GetName();
+            pClipDoc->maFileURL = mpShell->GetName();
     }
     else
     {
-        pClipDoc->maFileURL = pShell->GetName();
+        pClipDoc->maFileURL = mpShell->GetName();
     }
 
     //init maTabNames
@@ -2282,16 +2282,16 @@ void ScDocument::CopyTabToClip(SCCOL nCol1, SCROW nRow1,
             pClipDoc = ScModule::GetClipDoc();
         }
 
-        if (pShell->GetMedium())
+        if (mpShell->GetMedium())
         {
-            pClipDoc->maFileURL = pShell->GetMedium()->GetURLObject().GetMainURL(INetURLObject::DecodeMechanism::ToIUri);
+            pClipDoc->maFileURL = mpShell->GetMedium()->GetURLObject().GetMainURL(INetURLObject::DecodeMechanism::ToIUri);
             // for unsaved files use the title name and adjust during save of file
             if (pClipDoc->maFileURL.isEmpty())
-                pClipDoc->maFileURL = pShell->GetName();
+                pClipDoc->maFileURL = mpShell->GetName();
         }
         else
         {
-            pClipDoc->maFileURL = pShell->GetName();
+            pClipDoc->maFileURL = mpShell->GetName();
         }
 
         //init maTabNames
@@ -5266,7 +5266,7 @@ bool ScDocument::IsBlockEditable( SCTAB nTab, SCCOL nStartCol, SCROW nStartRow,
                                         bool* pOnlyNotBecauseOfMatrix /* = NULL */ ) const
 {
     // import into read-only document is possible
-    if (!bImportingXML && !mbChangeReadOnlyEnabled && pShell && pShell->IsReadOnly())
+    if (!bImportingXML && !mbChangeReadOnlyEnabled && mpShell && mpShell->IsReadOnly())
     {
         if ( pOnlyNotBecauseOfMatrix )
             *pOnlyNotBecauseOfMatrix = false;
@@ -5288,7 +5288,7 @@ bool ScDocument::IsSelectionEditable( const ScMarkData& rMark,
             bool* pOnlyNotBecauseOfMatrix /* = NULL */ ) const
 {
     // import into read-only document is possible
-    if ( !bImportingXML && !mbChangeReadOnlyEnabled && pShell && pShell->IsReadOnly() )
+    if ( !bImportingXML && !mbChangeReadOnlyEnabled && mpShell && mpShell->IsReadOnly() )
     {
         if ( pOnlyNotBecauseOfMatrix )
             *pOnlyNotBecauseOfMatrix = false;
@@ -6401,13 +6401,13 @@ void ScDocument::EnableUserInteraction( bool bVal )
 
 bool ScDocument::IsInVBAMode() const
 {
-    if (!pShell)
+    if (!mpShell)
         return false;
 
     try
     {
         uno::Reference<script::vba::XVBACompatibility> xVBA(
-            pShell->GetBasicContainer(), uno::UNO_QUERY);
+            mpShell->GetBasicContainer(), uno::UNO_QUERY);
 
         return xVBA.is() && xVBA->getVBACompatibilityMode();
     }
commit bc10d6c9dbf2c682a2c40f61bcac4439b0f4bc7b
Author: Tor Lillqvist <tml at collabora.com>
Date:   Tue Sep 5 00:46:01 2017 +0300

    Prefix one more member of ScDocument: pNoteEngine
    
    Change-Id: I93b95b8aca22df81985e4479fa6a7126eab45f0f

diff --git a/sc/inc/document.hxx b/sc/inc/document.hxx
index ac5cd7618ade..498ea76b119f 100644
--- a/sc/inc/document.hxx
+++ b/sc/inc/document.hxx
@@ -318,7 +318,7 @@ private:
 
     SfxUndoManager*     mpUndoManager;
     ScFieldEditEngine*  mpEditEngine;                   // uses pEditPool from xPoolHelper
-    ScNoteEditEngine*   pNoteEngine;                    // uses pEditPool from xPoolHelper
+    ScNoteEditEngine*   mpNoteEngine;                   // uses pEditPool from xPoolHelper
     SfxObjectShell*     pShell;
     VclPtr<SfxPrinter>    pPrinter;
     VclPtr<VirtualDevice> pVirtualDevice_100th_mm;
diff --git a/sc/source/core/data/documen2.cxx b/sc/source/core/data/documen2.cxx
index e5242f012849..78cc2a103d05 100644
--- a/sc/source/core/data/documen2.cxx
+++ b/sc/source/core/data/documen2.cxx
@@ -137,7 +137,7 @@ ScDocument::ScDocument( ScDocumentMode eMode, SfxObjectShell* pDocShell ) :
         maCalcConfig( ScInterpreter::GetGlobalConfig()),
         mpUndoManager( nullptr ),
         mpEditEngine( nullptr ),
-        pNoteEngine( nullptr ),
+        mpNoteEngine( nullptr ),
         pShell( pDocShell ),
         pPrinter( nullptr ),
         pVirtualDevice_100th_mm( nullptr ),
@@ -436,7 +436,7 @@ ScDocument::~ScDocument()
     delete pDetOpList;                  // also deletes entries
     delete pChangeTrack;
     delete mpEditEngine;
-    delete pNoteEngine;
+    delete mpNoteEngine;
     delete pChangeViewSettings;         // and delete
     pVirtualDevice_100th_mm.disposeAndClear();
 
@@ -528,19 +528,19 @@ ScFieldEditEngine& ScDocument::GetEditEngine()
 
 ScNoteEditEngine& ScDocument::GetNoteEngine()
 {
-    if ( !pNoteEngine )
+    if ( !mpNoteEngine )
     {
-        pNoteEngine = new ScNoteEditEngine( GetEnginePool(), GetEditPool() );
-        pNoteEngine->SetUpdateMode( false );
-        pNoteEngine->EnableUndo( false );
-        pNoteEngine->SetRefMapMode( MapUnit::Map100thMM );
-        ApplyAsianEditSettings( *pNoteEngine );
+        mpNoteEngine = new ScNoteEditEngine( GetEnginePool(), GetEditPool() );
+        mpNoteEngine->SetUpdateMode( false );
+        mpNoteEngine->EnableUndo( false );
+        mpNoteEngine->SetRefMapMode( MapUnit::Map100thMM );
+        ApplyAsianEditSettings( *mpNoteEngine );
         const SfxItemSet& rItemSet = GetDefPattern()->GetItemSet();
-        SfxItemSet* pEEItemSet = new SfxItemSet( pNoteEngine->GetEmptyItemSet() );
+        SfxItemSet* pEEItemSet = new SfxItemSet( mpNoteEngine->GetEmptyItemSet() );
         ScPatternAttr::FillToEditItemSet( *pEEItemSet, rItemSet );
-        pNoteEngine->SetDefaults( pEEItemSet );      // edit engine takes ownership
+        mpNoteEngine->SetDefaults( pEEItemSet );      // edit engine takes ownership
     }
-    return *pNoteEngine;
+    return *mpNoteEngine;
 }
 
 void ScDocument::ResetClip( ScDocument* pSourceDoc, const ScMarkData* pMarks )
commit bfb22c85602c8fbf78fe446de81eadb4eed4ea2d
Author: Tor Lillqvist <tml at collabora.com>
Date:   Tue Sep 5 00:44:35 2017 +0300

    Prefix one more member of ScDocument: pEditEngine
    
    Change-Id: Ib46b9b2b2b797f1d2de294819bf641f199e55dfa

diff --git a/sc/inc/document.hxx b/sc/inc/document.hxx
index b28361101dd2..ac5cd7618ade 100644
--- a/sc/inc/document.hxx
+++ b/sc/inc/document.hxx
@@ -317,7 +317,7 @@ private:
     ScCalcConfig        maCalcConfig;
 
     SfxUndoManager*     mpUndoManager;
-    ScFieldEditEngine*  pEditEngine;                    // uses pEditPool from xPoolHelper
+    ScFieldEditEngine*  mpEditEngine;                   // uses pEditPool from xPoolHelper
     ScNoteEditEngine*   pNoteEngine;                    // uses pEditPool from xPoolHelper
     SfxObjectShell*     pShell;
     VclPtr<SfxPrinter>    pPrinter;
diff --git a/sc/source/core/data/documen2.cxx b/sc/source/core/data/documen2.cxx
index 91245e509938..e5242f012849 100644
--- a/sc/source/core/data/documen2.cxx
+++ b/sc/source/core/data/documen2.cxx
@@ -136,7 +136,7 @@ ScDocument::ScDocument( ScDocumentMode eMode, SfxObjectShell* pDocShell ) :
         mpFormulaGroupCxt(nullptr),
         maCalcConfig( ScInterpreter::GetGlobalConfig()),
         mpUndoManager( nullptr ),
-        pEditEngine( nullptr ),
+        mpEditEngine( nullptr ),
         pNoteEngine( nullptr ),
         pShell( pDocShell ),
         pPrinter( nullptr ),
@@ -435,7 +435,7 @@ ScDocument::~ScDocument()
     delete pClipData;
     delete pDetOpList;                  // also deletes entries
     delete pChangeTrack;
-    delete pEditEngine;
+    delete mpEditEngine;
     delete pNoteEngine;
     delete pChangeViewSettings;         // and delete
     pVirtualDevice_100th_mm.disposeAndClear();
@@ -515,15 +515,15 @@ SfxItemPool* ScDocument::GetEnginePool() const
 
 ScFieldEditEngine& ScDocument::GetEditEngine()
 {
-    if ( !pEditEngine )
+    if ( !mpEditEngine )
     {
-        pEditEngine = new ScFieldEditEngine(this, GetEnginePool(), GetEditPool());
-        pEditEngine->SetUpdateMode( false );
-        pEditEngine->EnableUndo( false );
-        pEditEngine->SetRefMapMode( MapUnit::Map100thMM );
-        ApplyAsianEditSettings( *pEditEngine );
+        mpEditEngine = new ScFieldEditEngine(this, GetEnginePool(), GetEditPool());
+        mpEditEngine->SetUpdateMode( false );
+        mpEditEngine->EnableUndo( false );
+        mpEditEngine->SetRefMapMode( MapUnit::Map100thMM );
+        ApplyAsianEditSettings( *mpEditEngine );
     }
-    return *pEditEngine;
+    return *mpEditEngine;
 }
 
 ScNoteEditEngine& ScDocument::GetNoteEngine()
diff --git a/sc/source/core/data/documen8.cxx b/sc/source/core/data/documen8.cxx
index 32680121a07d..8f1908d4383b 100644
--- a/sc/source/core/data/documen8.cxx
+++ b/sc/source/core/data/documen8.cxx
@@ -1191,7 +1191,7 @@ void ScDocument::TransliterateText( const ScMarkData& rMultiMark, Transliteratio
     bool bConsiderLanguage = aTransliterationWrapper.needLanguageForTheMode();
     LanguageType nLanguage = LANGUAGE_SYSTEM;
 
-    std::unique_ptr<ScEditEngineDefaulter> pEngine;        // not using pEditEngine member because of defaults
+    std::unique_ptr<ScEditEngineDefaulter> pEngine;        // not using mpEditEngine member because of defaults
 
     SCTAB nCount = GetTableCount();
     ScMarkData::const_iterator itr = rMultiMark.begin(), itrEnd = rMultiMark.end();
diff --git a/sc/source/core/data/documen9.cxx b/sc/source/core/data/documen9.cxx
index 7ba12255a32e..5610f967f73b 100644
--- a/sc/source/core/data/documen9.cxx
+++ b/sc/source/core/data/documen9.cxx
@@ -633,7 +633,7 @@ const std::shared_ptr<SvxForbiddenCharactersTable>& ScDocument::GetForbiddenChar
 void ScDocument::SetForbiddenCharacters(const std::shared_ptr<SvxForbiddenCharactersTable>& rNew)
 {
     xForbiddenCharacters = rNew;
-    if ( pEditEngine )
+    if ( mpEditEngine )
         EditEngine::SetForbiddenCharsTable( xForbiddenCharacters );
     if ( pDrawLayer )
         pDrawLayer->SetForbiddenCharsTable( xForbiddenCharacters );
@@ -655,8 +655,8 @@ CharCompressType ScDocument::GetAsianCompression() const
 void ScDocument::SetAsianCompression(CharCompressType nNew)
 {
     nAsianCompression = nNew;
-    if ( pEditEngine )
-        pEditEngine->SetAsianCompressionMode( nAsianCompression );
+    if ( mpEditEngine )
+        mpEditEngine->SetAsianCompressionMode( nAsianCompression );
     if ( pDrawLayer )
         pDrawLayer->SetCharCompressType( nAsianCompression );
 }
@@ -677,8 +677,8 @@ bool ScDocument::GetAsianKerning() const
 void ScDocument::SetAsianKerning(bool bNew)
 {
     nAsianKerning = (sal_uInt8)bNew;
-    if ( pEditEngine )
-        pEditEngine->SetKernAsianPunctuation( static_cast<bool>( nAsianKerning ) );
+    if ( mpEditEngine )
+        mpEditEngine->SetKernAsianPunctuation( static_cast<bool>( nAsianKerning ) );
     if ( pDrawLayer )
         pDrawLayer->SetKernAsianPunctuation( static_cast<bool>( nAsianKerning ) );
 }
commit 564ec47db30e888faa88bd9bc5ef4c09a501944d
Author: Tor Lillqvist <tml at collabora.com>
Date:   Tue Sep 5 00:27:35 2017 +0300

    Prefix one more member of ScDocument: xPoolHelper
    
    Change-Id: Id1a216e909d5c0a6bafa80d1e40613fb38ceb1ef

diff --git a/sc/inc/document.hxx b/sc/inc/document.hxx
index 6e91927719a4..b28361101dd2 100644
--- a/sc/inc/document.hxx
+++ b/sc/inc/document.hxx
@@ -308,8 +308,7 @@ public:
     };
 
 private:
-
-    rtl::Reference<ScPoolHelper> xPoolHelper;
+    rtl::Reference<ScPoolHelper> mxPoolHelper;
 
     std::shared_ptr<svl::SharedStringPool> mpCellStringPool;
     std::shared_ptr<sc::FormulaGroupContext> mpFormulaGroupCxt;
diff --git a/sc/source/core/data/documen2.cxx b/sc/source/core/data/documen2.cxx
index 79ffe638ceb8..91245e509938 100644
--- a/sc/source/core/data/documen2.cxx
+++ b/sc/source/core/data/documen2.cxx
@@ -228,7 +228,7 @@ ScDocument::ScDocument( ScDocumentMode eMode, SfxObjectShell* pDocShell ) :
 
     if ( eMode == SCDOCMODE_DOCUMENT )
     {
-        xPoolHelper = new ScPoolHelper( this );
+        mxPoolHelper = new ScPoolHelper( this );
 
         pBASM = new ScBroadcastAreaSlotMachine( this );
         pChartListenerCollection = new ScChartListenerCollection( this );
@@ -443,12 +443,12 @@ ScDocument::~ScDocument()
     delete pDPCollection;
     delete mpAnonymousDBData;
 
-    // delete the EditEngine before destroying the xPoolHelper
+    // delete the EditEngine before destroying the mxPoolHelper
     delete pCacheFieldEditEngine;
 
-    if ( xPoolHelper.is() && !bIsClip && !bIsUndo)
-        xPoolHelper->SourceDocumentGone();
-    xPoolHelper.clear();
+    if ( mxPoolHelper.is() && !bIsClip && !bIsUndo)
+        mxPoolHelper->SourceDocumentGone();
+    mxPoolHelper.clear();
 
     delete pScriptTypeData;
     delete pRecursionHelper;
@@ -500,17 +500,17 @@ void ScDocument::InitClipPtrs( ScDocument* pSourceDoc )
 
 SvNumberFormatter* ScDocument::GetFormatTable() const
 {
-    return xPoolHelper->GetFormTable();
+    return mxPoolHelper->GetFormTable();
 }
 
 SfxItemPool* ScDocument::GetEditPool() const
 {
-    return xPoolHelper->GetEditPool();
+    return mxPoolHelper->GetEditPool();
 }
 
 SfxItemPool* ScDocument::GetEnginePool() const
 {
-    return xPoolHelper->GetEnginePool();
+    return mxPoolHelper->GetEnginePool();
 }
 
 ScFieldEditEngine& ScDocument::GetEditEngine()
diff --git a/sc/source/core/data/documen3.cxx b/sc/source/core/data/documen3.cxx
index 6bd695c00018..df46daa52e5d 100644
--- a/sc/source/core/data/documen3.cxx
+++ b/sc/source/core/data/documen3.cxx
@@ -1894,7 +1894,7 @@ void ScDocument::SetDocOptions( const ScDocOptions& rOpt )
     assert(pDocOptions && "No DocOptions! :-(");
 
     *pDocOptions = rOpt;
-    xPoolHelper->SetFormTableOpt(rOpt);
+    mxPoolHelper->SetFormTableOpt(rOpt);
 }
 
 const ScViewOptions& ScDocument::GetViewOptions() const
@@ -1921,9 +1921,9 @@ void ScDocument::SetLanguage( LanguageType eLatin, LanguageType eCjk, LanguageTy
     eLanguage = eLatin;
     eCjkLanguage = eCjk;
     eCtlLanguage = eCtl;
-    if ( xPoolHelper.is() )
+    if ( mxPoolHelper.is() )
     {
-        ScDocumentPool* pPool = xPoolHelper->GetDocPool();
+        ScDocumentPool* pPool = mxPoolHelper->GetDocPool();
         pPool->SetPoolDefaultItem( SvxLanguageItem( eLanguage, ATTR_FONT_LANGUAGE ) );
         pPool->SetPoolDefaultItem( SvxLanguageItem( eCjkLanguage, ATTR_CJK_FONT_LANGUAGE ) );
         pPool->SetPoolDefaultItem( SvxLanguageItem( eCtlLanguage, ATTR_CTL_FONT_LANGUAGE ) );
@@ -2048,7 +2048,7 @@ void ScDocument::RemoveMerge( SCCOL nCol, SCROW nRow, SCTAB nTab )
     RemoveFlagsTab( nCol, nRow, nEndCol, nEndRow, nTab, ScMF::Hor | ScMF::Ver );
 
     const ScMergeAttr* pDefAttr = static_cast<const ScMergeAttr*>(
-                                        &xPoolHelper->GetDocPool()->GetDefaultItem( ATTR_MERGE ));
+                                        &mxPoolHelper->GetDocPool()->GetDefaultItem( ATTR_MERGE ));
     ApplyAttr( nCol, nRow, nTab, *pDefAttr );
 }
 
diff --git a/sc/source/core/data/documen4.cxx b/sc/source/core/data/documen4.cxx
index 2941198f426d..b4c448133f6e 100644
--- a/sc/source/core/data/documen4.cxx
+++ b/sc/source/core/data/documen4.cxx
@@ -784,7 +784,7 @@ const SfxPoolItem* ScDocument::GetEffItem(
                         OUString aStyle = pForm->GetCellStyle(aCell, aPos);
                         if (!aStyle.isEmpty())
                         {
-                            SfxStyleSheetBase* pStyleSheet = xPoolHelper->GetStylePool()->Find(
+                            SfxStyleSheetBase* pStyleSheet = mxPoolHelper->GetStylePool()->Find(
                                     aStyle, SfxStyleFamily::Para );
                             if ( pStyleSheet && pStyleSheet->GetItemSet().GetItemState(
                                         nWhich, true, &pItem ) == SfxItemState::SET )
@@ -830,7 +830,7 @@ const SfxItemSet* ScDocument::GetCondResult(
         if (!aStyle.isEmpty())
         {
             SfxStyleSheetBase* pStyleSheet =
-                xPoolHelper->GetStylePool()->Find(aStyle, SfxStyleFamily::Para);
+                mxPoolHelper->GetStylePool()->Find(aStyle, SfxStyleFamily::Para);
 
             if (pStyleSheet)
                 return &pStyleSheet->GetItemSet();
diff --git a/sc/source/core/data/documen6.cxx b/sc/source/core/data/documen6.cxx
index 03dee37a6aac..cfc45c4c43da 100644
--- a/sc/source/core/data/documen6.cxx
+++ b/sc/source/core/data/documen6.cxx
@@ -117,7 +117,7 @@ SvtScriptType ScDocument::GetCellScriptType( const ScAddress& rPos, sal_uLong nN
         return nStored;                             // use stored value
 
     Color* pColor;
-    OUString aStr = ScCellFormat::GetString(*this, rPos, nNumberFormat, &pColor, *xPoolHelper->GetFormTable());
+    OUString aStr = ScCellFormat::GetString(*this, rPos, nNumberFormat, &pColor, *mxPoolHelper->GetFormTable());
 
     SvtScriptType nRet = GetStringScriptType( aStr );
 
@@ -143,7 +143,7 @@ SvtScriptType ScDocument::GetScriptType( SCCOL nCol, SCROW nRow, SCTAB nTab )
     if ( !static_cast<const ScCondFormatItem&>(pPattern->GetItem(ATTR_CONDITIONAL)).GetCondFormatData().empty() )
         pCondSet = GetCondResult( nCol, nRow, nTab );
 
-    sal_uLong nFormat = pPattern->GetNumberFormat( xPoolHelper->GetFormTable(), pCondSet );
+    sal_uLong nFormat = pPattern->GetNumberFormat( mxPoolHelper->GetFormTable(), pCondSet );
 
     return GetCellScriptType(aPos, nFormat);
 }
diff --git a/sc/source/core/data/documen8.cxx b/sc/source/core/data/documen8.cxx
index dcf506dcc109..32680121a07d 100644
--- a/sc/source/core/data/documen8.cxx
+++ b/sc/source/core/data/documen8.cxx
@@ -120,7 +120,7 @@ SfxPrinter* ScDocument::GetPrinter(bool bCreateIfNotExist)
     if ( !pPrinter && bCreateIfNotExist )
     {
         auto pSet =
-            o3tl::make_unique<SfxItemSet>( *xPoolHelper->GetDocPool(),
+            o3tl::make_unique<SfxItemSet>( *mxPoolHelper->GetDocPool(),
                             svl::Items<SID_PRINTER_NOTFOUND_WARN,  SID_PRINTER_NOTFOUND_WARN,
                             SID_PRINTER_CHANGESTODOC,   SID_PRINTER_CHANGESTODOC,
                             SID_PRINT_SELECTEDSHEET,    SID_PRINT_SELECTEDSHEET,
@@ -298,7 +298,7 @@ void ScDocument::CopyStdStylesFrom( const ScDocument* pSrcDoc )
 {
     // number format exchange list has to be handled here, too
     NumFmtMergeHandler aNumFmtMergeHdl(this, pSrcDoc);
-    xPoolHelper->GetStylePool()->CopyStdStylesFrom( pSrcDoc->xPoolHelper->GetStylePool() );
+    mxPoolHelper->GetStylePool()->CopyStdStylesFrom( pSrcDoc->mxPoolHelper->GetStylePool() );
 }
 
 void ScDocument::InvalidateTextWidth( const OUString& rStyleName )
@@ -366,7 +366,7 @@ sal_uInt8 ScDocument::GetEditTextDirection(SCTAB nTab) const
     EEHorizontalTextDirection eRet = EE_HTEXTDIR_DEFAULT;
 
     OUString aStyleName = GetPageStyle( nTab );
-    SfxStyleSheetBase* pStyle = xPoolHelper->GetStylePool()->Find( aStyleName, SfxStyleFamily::Page );
+    SfxStyleSheetBase* pStyle = mxPoolHelper->GetStylePool()->Find( aStyleName, SfxStyleFamily::Page );
     if ( pStyle )
     {
         SfxItemSet& rStyleSet = pStyle->GetItemSet();
diff --git a/sc/source/core/data/documen9.cxx b/sc/source/core/data/documen9.cxx
index b62441e8037b..7ba12255a32e 100644
--- a/sc/source/core/data/documen9.cxx
+++ b/sc/source/core/data/documen9.cxx
@@ -127,9 +127,9 @@ void ScDocument::InitDrawLayer( SfxObjectShell* pDocShell )
         // in SfxItemSets using the Calc SfxItemPool. This is e.g. needed when
         // the PageStyle using SvxBrushItem is visualized and will be potentially
         // used more intense in the future
-        if (xPoolHelper.is() && !IsClipOrUndo()) //Using IsClipOrUndo as a proxy for SharePooledResources called
+        if (mxPoolHelper.is() && !IsClipOrUndo()) //Using IsClipOrUndo as a proxy for SharePooledResources called
         {
-            ScDocumentPool* pLocalPool = xPoolHelper->GetDocPool();
+            ScDocumentPool* pLocalPool = mxPoolHelper->GetDocPool();
 
             if (pLocalPool)
             {
@@ -237,9 +237,9 @@ void ScDocument::DeleteDrawLayer()
 {
     // remove DrawingLayer's SfxItemPool from Calc's SfxItemPool where
     // it is registered as secondary pool
-    if (xPoolHelper.is() && !IsClipOrUndo()) //Using IsClipOrUndo as a proxy for SharePooledResources called
+    if (mxPoolHelper.is() && !IsClipOrUndo()) //Using IsClipOrUndo as a proxy for SharePooledResources called
     {
-        ScDocumentPool* pLocalPool = xPoolHelper->GetDocPool();
+        ScDocumentPool* pLocalPool = mxPoolHelper->GetDocPool();
 
         if(pLocalPool && pLocalPool->GetSecondaryPool())
         {
@@ -566,7 +566,7 @@ void ScDocument::UpdateFontCharSet()
         sal_uInt32 nCount,i;
         SvxFontItem* pItem;
 
-        ScDocumentPool* pPool = xPoolHelper->GetDocPool();
+        ScDocumentPool* pPool = mxPoolHelper->GetDocPool();
         nCount = pPool->GetItemCount2(ATTR_FONT);
         for (i=0; i<nCount; i++)
         {
diff --git a/sc/source/core/data/document.cxx b/sc/source/core/data/document.cxx
index 572374180f33..239a766629f4 100644
--- a/sc/source/core/data/document.cxx
+++ b/sc/source/core/data/document.cxx
@@ -2532,8 +2532,8 @@ ScColumnsRange ScDocument::GetColumnsRange( SCTAB nTab, SCCOL nColBegin, SCCOL n
 
 void ScDocument::MergeNumberFormatter(const ScDocument* pSrcDoc)
 {
-    SvNumberFormatter* pThisFormatter = xPoolHelper->GetFormTable();
-    SvNumberFormatter* pOtherFormatter = pSrcDoc->xPoolHelper->GetFormTable();
+    SvNumberFormatter* pThisFormatter = mxPoolHelper->GetFormTable();
+    SvNumberFormatter* pOtherFormatter = pSrcDoc->mxPoolHelper->GetFormTable();
     if (pOtherFormatter && pOtherFormatter != pThisFormatter)
     {
         SvNumberFormatterIndexTable* pExchangeList =
@@ -2562,8 +2562,8 @@ bool ScDocument::IsClipboardSource() const
         return false;
 
     ScDocument* pClipDoc = ScModule::GetClipDoc();
-    return pClipDoc && pClipDoc->bIsClip && pClipDoc->xPoolHelper.is() && xPoolHelper.is() &&
-            xPoolHelper->GetDocPool() == pClipDoc->xPoolHelper->GetDocPool();
+    return pClipDoc && pClipDoc->bIsClip && pClipDoc->mxPoolHelper.is() && mxPoolHelper.is() &&
+            mxPoolHelper->GetDocPool() == pClipDoc->mxPoolHelper->GetDocPool();
 }
 
 void ScDocument::StartListeningFromClip( SCCOL nCol1, SCROW nRow1,
@@ -4696,7 +4696,7 @@ const SfxPoolItem* ScDocument::GetAttr( SCCOL nCol, SCROW nRow, SCTAB nTab, sal_
             OSL_FAIL( "Attribut Null" );
         }
     }
-    return &xPoolHelper->GetDocPool()->GetDefaultItem( nWhich );
+    return &mxPoolHelper->GetDocPool()->GetDefaultItem( nWhich );
 }
 
 const SfxPoolItem* ScDocument::GetAttr( const ScAddress& rPos, sal_uInt16 nWhich ) const
@@ -4928,7 +4928,7 @@ bool ScDocument::IsStyleSheetUsed( const ScStyleSheet& rStyle ) const
 {
     if ( bStyleSheetUsageInvalid || rStyle.GetUsage() == ScStyleSheet::UNKNOWN )
     {
-        SfxStyleSheetIterator aIter( xPoolHelper->GetStylePool(),
+        SfxStyleSheetIterator aIter( mxPoolHelper->GetStylePool(),
                     SfxStyleFamily::Para );
         for ( const SfxStyleSheetBase* pStyle = aIter.First(); pStyle;
                                        pStyle = aIter.Next() )
@@ -5112,7 +5112,7 @@ bool ScDocument::HasAttrib( SCCOL nCol1, SCROW nRow1, SCTAB nTab1,
         //  Is attribute used in document?
         //  (as in fillinfo)
 
-        ScDocumentPool* pPool = xPoolHelper->GetDocPool();
+        ScDocumentPool* pPool = mxPoolHelper->GetDocPool();
 
         bool bAnyItem = false;
         sal_uInt32 nRotCount = pPool->GetItemCount2( ATTR_ROTATE_VALUE );
@@ -5819,7 +5819,7 @@ void ScDocument::ApplySelectionPattern( const ScPatternAttr& rAttr, const ScMark
         }
         else
         {
-            SfxItemPoolCache aCache( xPoolHelper->GetDocPool(), pSet );
+            SfxItemPoolCache aCache( mxPoolHelper->GetDocPool(), pSet );
             SCTAB nMax = static_cast<SCTAB>(maTabs.size());
             ScMarkData::const_iterator itr = rMark.begin(), itrEnd = rMark.end();
             for (; itr != itrEnd && *itr < nMax; ++itr)
@@ -5973,17 +5973,17 @@ void ScDocument::DeleteSelectionTab(
 
 ScPatternAttr* ScDocument::GetDefPattern() const
 {
-    return const_cast<ScPatternAttr*>(static_cast<const ScPatternAttr*>(&xPoolHelper->GetDocPool()->GetDefaultItem(ATTR_PATTERN)));
+    return const_cast<ScPatternAttr*>(static_cast<const ScPatternAttr*>(&mxPoolHelper->GetDocPool()->GetDefaultItem(ATTR_PATTERN)));
 }
 
 ScDocumentPool* ScDocument::GetPool()
 {
-    return xPoolHelper->GetDocPool();
+    return mxPoolHelper->GetDocPool();
 }
 
 ScStyleSheetPool* ScDocument::GetStyleSheetPool() const
 {
-    return xPoolHelper->GetStylePool();
+    return mxPoolHelper->GetStylePool();
 }
 
 SCSIZE ScDocument::GetEmptyLinesInBlock( SCCOL nStartCol, SCROW nStartRow, SCTAB nStartTab,
@@ -6026,7 +6026,7 @@ void ScDocument::GetNextPos( SCCOL& rCol, SCROW& rRow, SCTAB nTab, SCCOL nMovX,
 
 void ScDocument::UpdStlShtPtrsFrmNms()
 {
-    ScDocumentPool* pPool = xPoolHelper->GetDocPool();
+    ScDocumentPool* pPool = mxPoolHelper->GetDocPool();
 
     sal_uInt32 nCount = pPool->GetItemCount2(ATTR_PATTERN);
     for (sal_uInt32 i=0; i<nCount; i++)
@@ -6040,7 +6040,7 @@ void ScDocument::UpdStlShtPtrsFrmNms()
 
 void ScDocument::StylesToNames()
 {
-    ScDocumentPool* pPool = xPoolHelper->GetDocPool();
+    ScDocumentPool* pPool = mxPoolHelper->GetDocPool();
 
     sal_uInt32 nCount = pPool->GetItemCount2(ATTR_PATTERN);
     for (sal_uInt32 i=0; i<nCount; i++)
@@ -6272,7 +6272,7 @@ bool ScDocument::NeedPageResetAfterTab( SCTAB nTab ) const
         OUString aNew = maTabs[nTab+1]->GetPageStyle();
         if ( aNew != maTabs[nTab]->GetPageStyle() )
         {
-            SfxStyleSheetBase* pStyle = xPoolHelper->GetStylePool()->Find( aNew, SfxStyleFamily::Page );
+            SfxStyleSheetBase* pStyle = mxPoolHelper->GetStylePool()->Find( aNew, SfxStyleFamily::Page );
             if ( pStyle )
             {
                 const SfxItemSet& rSet = pStyle->GetItemSet();
diff --git a/sc/source/core/data/document10.cxx b/sc/source/core/data/document10.cxx
index 78b5a8f7d8e7..e62a47e08c7f 100644
--- a/sc/source/core/data/document10.cxx
+++ b/sc/source/core/data/document10.cxx
@@ -336,7 +336,7 @@ void ScDocument::CompileHybridFormula()
 
 void ScDocument::SharePooledResources( const ScDocument* pSrcDoc )
 {
-    xPoolHelper = pSrcDoc->xPoolHelper;
+    mxPoolHelper = pSrcDoc->mxPoolHelper;
     mpCellStringPool = pSrcDoc->mpCellStringPool;
 }
 
diff --git a/sc/source/core/data/fillinfo.cxx b/sc/source/core/data/fillinfo.cxx
index 1f082b8a6a99..ecbc104a2253 100644
--- a/sc/source/core/data/fillinfo.cxx
+++ b/sc/source/core/data/fillinfo.cxx
@@ -361,8 +361,8 @@ void ScDocument::FillInfo(
 
     bool bLayoutRTL = IsLayoutRTL( nTab );
 
-    ScDocumentPool* pPool = xPoolHelper->GetDocPool();
-    ScStyleSheetPool* pStlPool = xPoolHelper->GetStylePool();
+    ScDocumentPool* pPool = mxPoolHelper->GetDocPool();
+    ScStyleSheetPool* pStlPool = mxPoolHelper->GetStylePool();
 
     RowInfo* pRowInfo = rTabInfo.mpRowInfo.get();
 


More information about the Libreoffice-commits mailing list