[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-6.0' - sc/source

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Mon Aug 27 19:50:42 UTC 2018


 sc/source/ui/docshell/docsh.cxx  |  542 +++++++++++++++++++--------------------
 sc/source/ui/docshell/docsh2.cxx |   42 +--
 sc/source/ui/docshell/docsh3.cxx |  156 +++++------
 sc/source/ui/docshell/docsh4.cxx |  342 ++++++++++++------------
 sc/source/ui/docshell/docsh5.cxx |  226 ++++++++--------
 sc/source/ui/docshell/docsh6.cxx |   66 ++--
 sc/source/ui/docshell/docsh8.cxx |   40 +-
 sc/source/ui/inc/docsh.hxx       |   70 ++---
 8 files changed, 742 insertions(+), 742 deletions(-)

New commits:
commit 5ae953e0db0c3e1d52e658138e1ea7cf4c274235
Author:     Henry Castro <hcastro at collabora.com>
AuthorDate: Thu May 31 17:39:26 2018 -0400
Commit:     Andras Timar <andras.timar at collabora.com>
CommitDate: Mon Aug 27 21:50:17 2018 +0200

    sc: prefix members of ScDocShell
    
    Change-Id: I7c2a4e5e850b26da515719f7df869f12c49b0ad3
    Reviewed-on: https://gerrit.libreoffice.org/55148
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Henry Castro <hcastro at collabora.com>
    Reviewed-on: https://gerrit.libreoffice.org/59627
    Reviewed-by: Andras Timar <andras.timar at collabora.com>
    Tested-by: Andras Timar <andras.timar at collabora.com>

diff --git a/sc/source/ui/docshell/docsh.cxx b/sc/source/ui/docshell/docsh.cxx
index a1bab9b3fb62..3940260f4e6d 100644
--- a/sc/source/ui/docshell/docsh.cxx
+++ b/sc/source/ui/docshell/docsh.cxx
@@ -208,7 +208,7 @@ void ScDocShell::FillClass( SvGlobalName* pClassName,
 
 std::set<Color> ScDocShell::GetDocColors()
 {
-    return aDocument.GetDocColors();
+    return m_aDocument.GetDocColors();
 }
 
 void ScDocShell::DoEnterHandler()
@@ -238,16 +238,16 @@ HiddenInformation ScDocShell::GetHiddenInformationState( HiddenInformation nStat
 
     if ( nStates & HiddenInformation::RECORDEDCHANGES )
     {
-        if ( aDocument.GetChangeTrack() && aDocument.GetChangeTrack()->GetFirst() )
+        if ( m_aDocument.GetChangeTrack() && m_aDocument.GetChangeTrack()->GetFirst() )
           nState |= HiddenInformation::RECORDEDCHANGES;
     }
     if ( nStates & HiddenInformation::NOTES )
     {
-        SCTAB nTableCount = aDocument.GetTableCount();
+        SCTAB nTableCount = m_aDocument.GetTableCount();
         bool bFound = false;
         for (SCTAB nTab = 0; nTab < nTableCount && !bFound; ++nTab)
         {
-            if (aDocument.HasTabNotes(nTab)) //TODO:
+            if (m_aDocument.HasTabNotes(nTab)) //TODO:
                 bFound = true;
         }
 
@@ -260,17 +260,17 @@ HiddenInformation ScDocShell::GetHiddenInformationState( HiddenInformation nStat
 
 void ScDocShell::BeforeXMLLoading()
 {
-    aDocument.EnableIdle(false);
+    m_aDocument.EnableIdle(false);
 
     // prevent unnecessary broadcasts and updates
-    OSL_ENSURE(pModificator == nullptr, "The Modificator should not exist");
-    pModificator = new ScDocShellModificator( *this );
+    OSL_ENSURE(m_pModificator == nullptr, "The Modificator should not exist");
+    m_pModificator = new ScDocShellModificator( *this );
 
-    aDocument.SetImportingXML( true );
-    aDocument.EnableExecuteLink( false );   // #i101304# to be safe, prevent nested loading from external references
-    aDocument.EnableUndo( false );
+    m_aDocument.SetImportingXML( true );
+    m_aDocument.EnableExecuteLink( false );   // #i101304# to be safe, prevent nested loading from external references
+    m_aDocument.EnableUndo( false );
     // prevent unnecessary broadcasts and "half way listeners"
-    aDocument.SetInsertingFromOtherDoc( true );
+    m_aDocument.SetInsertingFromOtherDoc( true );
 }
 
 void ScDocShell::AfterXMLLoading(bool bRet)
@@ -279,22 +279,22 @@ void ScDocShell::AfterXMLLoading(bool bRet)
     {
         UpdateLinks();
         // don't prevent establishing of listeners anymore
-        aDocument.SetInsertingFromOtherDoc( false );
+        m_aDocument.SetInsertingFromOtherDoc( false );
         if ( bRet )
         {
-            ScChartListenerCollection* pChartListener = aDocument.GetChartListenerCollection();
+            ScChartListenerCollection* pChartListener = m_aDocument.GetChartListenerCollection();
             if (pChartListener)
                 pChartListener->UpdateDirtyCharts();
 
             // #95582#; set the table names of linked tables to the new path
-            SCTAB nTabCount = aDocument.GetTableCount();
+            SCTAB nTabCount = m_aDocument.GetTableCount();
             for (SCTAB i = 0; i < nTabCount; ++i)
             {
-                if (aDocument.IsLinked( i ))
+                if (m_aDocument.IsLinked( i ))
                 {
                     OUString aName;
-                    aDocument.GetName(i, aName);
-                    OUString aLinkTabName = aDocument.GetLinkTab(i);
+                    m_aDocument.GetName(i, aName);
+                    OUString aLinkTabName = m_aDocument.GetLinkTab(i);
                     sal_Int32 nLinkTabNameLength = aLinkTabName.getLength();
                     sal_Int32 nNameLength = aName.getLength();
                     if (nLinkTabNameLength < nNameLength)
@@ -325,8 +325,8 @@ void ScDocShell::AfterXMLLoading(bool bRet)
                                     (aName[nIndex - 1] == '#') && // before the table name should be the # char
                                     !aINetURLObject.HasError()) // the docname should be a valid URL
                                 {
-                                    aName = ScGlobal::GetDocTabName( aDocument.GetLinkDoc( i ), aDocument.GetLinkTab( i ) );
-                                    aDocument.RenameTab(i, aName, true/*bExternalDocument*/);
+                                    aName = ScGlobal::GetDocTabName( m_aDocument.GetLinkDoc( i ), m_aDocument.GetLinkTab( i ) );
+                                    m_aDocument.RenameTab(i, aName, true/*bExternalDocument*/);
                                 }
                                 // else;  nothing has to happen, because it is a user given name
                             }
@@ -340,7 +340,7 @@ void ScDocShell::AfterXMLLoading(bool bRet)
 
             // #i94570# DataPilot table names have to be unique, or the tables can't be accessed by API.
             // If no name (or an invalid name, skipped in ScXMLDataPilotTableContext::EndElement) was set, create a new name.
-            ScDPCollection* pDPCollection = aDocument.GetDPCollection();
+            ScDPCollection* pDPCollection = m_aDocument.GetDPCollection();
             if ( pDPCollection )
             {
                 size_t nDPCount = pDPCollection->GetCount();
@@ -354,31 +354,31 @@ void ScDocShell::AfterXMLLoading(bool bRet)
         }
     }
     else
-        aDocument.SetInsertingFromOtherDoc( false );
+        m_aDocument.SetInsertingFromOtherDoc( false );
 
-    aDocument.SetImportingXML( false );
-    aDocument.EnableExecuteLink( true );
-    aDocument.EnableUndo( true );
-    bIsEmpty = false;
+    m_aDocument.SetImportingXML( false );
+    m_aDocument.EnableExecuteLink( true );
+    m_aDocument.EnableUndo( true );
+    m_bIsEmpty = false;
 
-    if (pModificator)
+    if (m_pModificator)
     {
-        ScDocument::HardRecalcState eRecalcState = aDocument.GetHardRecalcState();
+        ScDocument::HardRecalcState eRecalcState = m_aDocument.GetHardRecalcState();
         // Temporarily set hard-recalc to prevent calling
         // ScFormulaCell::Notify() during destruction of the Modificator which
         // will set the cells dirty.
         if (eRecalcState == ScDocument::HardRecalcState::OFF)
-            aDocument.SetHardRecalcState(ScDocument::HardRecalcState::TEMPORARY);
-        delete pModificator;
-        pModificator = nullptr;
-        aDocument.SetHardRecalcState(eRecalcState);
+            m_aDocument.SetHardRecalcState(ScDocument::HardRecalcState::TEMPORARY);
+        delete m_pModificator;
+        m_pModificator = nullptr;
+        m_aDocument.SetHardRecalcState(eRecalcState);
     }
     else
     {
         OSL_FAIL("The Modificator should exist");
     }
 
-    aDocument.EnableIdle(true);
+    m_aDocument.EnableIdle(true);
 }
 
 namespace {
@@ -459,7 +459,7 @@ public:
 
 bool ScDocShell::LoadXML( SfxMedium* pLoadMedium, const css::uno::Reference< css::embed::XStorage >& xStor )
 {
-    LoadMediumGuard aLoadGuard(&aDocument);
+    LoadMediumGuard aLoadGuard(&m_aDocument);
 
     //  MacroCallMode is no longer needed, state is kept in SfxObjectShell now
 
@@ -471,7 +471,7 @@ bool ScDocShell::LoadXML( SfxMedium* pLoadMedium, const css::uno::Reference< css
 
     bool bRet = false;
     ErrCode nError = ERRCODE_NONE;
-    aDocument.LockAdjustHeight();
+    m_aDocument.LockAdjustHeight();
     if (GetCreateMode() == SfxObjectCreateMode::ORGANIZER)
         bRet = aImport.Import(ImportFlags::Styles, nError);
     else
@@ -496,7 +496,7 @@ bool ScDocShell::LoadXML( SfxMedium* pLoadMedium, const css::uno::Reference< css
     if (nRecalcMode == RECALC_ASK)
     {
         OUString sProductName(utl::ConfigManager::getProductName());
-        if (aDocument.IsUserInteractionEnabled() && xDocProps->getGenerator().indexOf(sProductName) == -1)
+        if (m_aDocument.IsUserInteractionEnabled() && xDocProps->getGenerator().indexOf(sProductName) == -1)
         {
             // Generator is not LibreOffice.  Ask if the user wants to perform
             // full re-calculation.
@@ -530,18 +530,18 @@ bool ScDocShell::LoadXML( SfxMedium* pLoadMedium, const css::uno::Reference< css
     else
     {
         // still need to recalc volatile formula cells.
-        aDocument.Broadcast(ScHint(SfxHintId::ScDataChanged, BCA_BRDCST_ALWAYS));
+        m_aDocument.Broadcast(ScHint(SfxHintId::ScDataChanged, BCA_BRDCST_ALWAYS));
     }
 
     AfterXMLLoading(bRet);
 
-    aDocument.UnlockAdjustHeight();
+    m_aDocument.UnlockAdjustHeight();
     return bRet;
 }
 
 bool ScDocShell::SaveXML( SfxMedium* pSaveMedium, const css::uno::Reference< css::embed::XStorage >& xStor )
 {
-    aDocument.EnableIdle(false);
+    m_aDocument.EnableIdle(false);
 
     ScXMLImportWrapper aImport(*this, pSaveMedium, xStor);
     bool bRet(false);
@@ -550,7 +550,7 @@ bool ScDocShell::SaveXML( SfxMedium* pSaveMedium, const css::uno::Reference< css
     else
         bRet = aImport.Export(true);
 
-    aDocument.EnableIdle(true);
+    m_aDocument.EnableIdle(true);
 
     return bRet;
 }
@@ -580,8 +580,8 @@ bool ScDocShell::SaveCurrentChart( SfxMedium& rMedium )
 
 bool ScDocShell::Load( SfxMedium& rMedium )
 {
-    LoadMediumGuard aLoadGuard(&aDocument);
-    ScRefreshTimerProtector aProt( aDocument.GetRefreshTimerControlAddress() );
+    LoadMediumGuard aLoadGuard(&m_aDocument);
+    ScRefreshTimerProtector aProt( m_aDocument.GetRefreshTimerControlAddress() );
 
     //  only the latin script language is loaded
     //  -> initialize the others from options (before loading)
@@ -591,8 +591,8 @@ bool ScDocShell::Load( SfxMedium& rMedium )
     // for tdf#99729 (if required, it will be overridden in *::ReadUserDataSequence())
     if (IsOwnStorageFormat(rMedium))
     {
-        if (aDocument.GetDrawLayer())
-            aDocument.GetDrawLayer()->SetAnchoredTextOverflowLegacy(true);
+        if (m_aDocument.GetDrawLayer())
+            m_aDocument.GetDrawLayer()->SetAnchoredTextOverflowLegacy(true);
     }
 
     GetUndoManager()->Clear();
@@ -606,17 +606,17 @@ bool ScDocShell::Load( SfxMedium& rMedium )
         if (GetMedium())
         {
             const SfxUInt16Item* pUpdateDocItem = SfxItemSet::GetItem<SfxUInt16Item>(rMedium.GetItemSet(), SID_UPDATEDOCMODE, false);
-            nCanUpdate = pUpdateDocItem ? pUpdateDocItem->GetValue() : css::document::UpdateDocMode::NO_UPDATE;
+            m_nCanUpdate = pUpdateDocItem ? pUpdateDocItem->GetValue() : css::document::UpdateDocMode::NO_UPDATE;
         }
 
         {
             //  prepare a valid document for XML filter
             //  (for ConvertFrom, InitNew is called before)
-            aDocument.MakeTable(0);
-            aDocument.GetStyleSheetPool()->CreateStandardStyles();
-            aDocument.UpdStlShtPtrsFrmNms();
+            m_aDocument.MakeTable(0);
+            m_aDocument.GetStyleSheetPool()->CreateStandardStyles();
+            m_aDocument.UpdStlShtPtrsFrmNms();
 
-            if (!mbUcalcTest)
+            if (!m_bUcalcTest)
             {
                 /* Create styles that are imported through Orcus */
 
@@ -630,8 +630,8 @@ bool ScDocShell::Load( SfxMedium& rMedium )
 
                 if (pOrcus)
                 {
-                    pOrcus->importODS_Styles(aDocument, aPath);
-                    aDocument.GetStyleSheetPool()->setAllStandard();
+                    pOrcus->importODS_Styles(m_aDocument, aPath);
+                    m_aDocument.GetStyleSheetPool()->setAllStandard();
                 }
             }
 
@@ -650,9 +650,9 @@ bool ScDocShell::Load( SfxMedium& rMedium )
 
     // invalidate eventually temporary table areas
     if ( bRet )
-        aDocument.InvalidateTableArea();
+        m_aDocument.InvalidateTableArea();
 
-    bIsEmpty = false;
+    m_bIsEmpty = false;
     FinishedLoading();
     return bRet;
 }
@@ -664,7 +664,7 @@ void ScDocShell::Notify( SfxBroadcaster&, const SfxHint& rHint )
     {
         if (pScHint->GetTablesHintId() == SC_TAB_INSERTED)
         {
-            uno::Reference< script::vba::XVBAEventProcessor > xVbaEvents = aDocument.GetVbaEventProcessor();
+            uno::Reference< script::vba::XVBAEventProcessor > xVbaEvents = m_aDocument.GetVbaEventProcessor();
             if ( xVbaEvents.is() ) try
             {
                 uno::Sequence< uno::Any > aArgs( 1 );
@@ -693,9 +693,9 @@ void ScDocShell::Notify( SfxBroadcaster&, const SfxHint& rHint )
         const OUString& aName2 = rStlHint.GetStyle2();
         sal_uInt32 nTimeout = rStlHint.GetTimeout();
 
-        if (!pAutoStyleList)
-            pAutoStyleList = new ScAutoStyleList(this);
-        pAutoStyleList->AddInitial( aRange, aName1, nTimeout, aName2 );
+        if (!m_pAutoStyleList)
+            m_pAutoStyleList = new ScAutoStyleList(this);
+        m_pAutoStyleList->AddInitial( aRange, aName1, nTimeout, aName2 );
     }
     else if ( dynamic_cast<const SfxEventHint*>(&rHint) )
     {
@@ -897,12 +897,12 @@ void ScDocShell::Notify( SfxBroadcaster&, const SfxHint& rHint )
                                         if ( bSaveToShared )
                                         {
                                             bool bChangedViewSettings = false;
-                                            ScChangeViewSettings* pChangeViewSet = aDocument.GetChangeViewSettings();
+                                            ScChangeViewSettings* pChangeViewSet = m_aDocument.GetChangeViewSettings();
                                             if ( pChangeViewSet && pChangeViewSet->ShowChanges() )
                                             {
                                                 pChangeViewSet->SetShowChanges( false );
                                                 pChangeViewSet->SetShowAccepted( false );
-                                                aDocument.SetChangeViewSettings( *pChangeViewSet );
+                                                m_aDocument.SetChangeViewSettings( *pChangeViewSet );
                                                 bChangedViewSettings = true;
                                             }
 
@@ -928,7 +928,7 @@ void ScDocShell::Notify( SfxBroadcaster&, const SfxHint& rHint )
                                             {
                                                 pChangeViewSet->SetShowChanges( true );
                                                 pChangeViewSet->SetShowAccepted( true );
-                                                aDocument.SetChangeViewSettings( *pChangeViewSet );
+                                                m_aDocument.SetChangeViewSettings( *pChangeViewSet );
                                             }
                                         }
 
@@ -980,8 +980,8 @@ void ScDocShell::Notify( SfxBroadcaster&, const SfxHint& rHint )
                     }
 #endif
 
-                    if (pSheetSaveData)
-                        pSheetSaveData->SetInSupportedSave(true);
+                    if (m_pSheetSaveData)
+                        m_pSheetSaveData->SetInSupportedSave(true);
                 }
                 break;
             case SfxEventHintId::SaveAsDoc:
@@ -1002,8 +1002,8 @@ void ScDocShell::Notify( SfxBroadcaster&, const SfxHint& rHint )
                 // #i108978# If no event is sent before saving, there will also be no "...DONE" event,
                 // and SAVE/SAVEAS can't be distinguished from SAVETO. So stream copying is only enabled
                 // if there is a SAVE/SAVEAS/SAVETO event first.
-                if (pSheetSaveData)
-                    pSheetSaveData->SetInSupportedSave(true);
+                if (m_pSheetSaveData)
+                    m_pSheetSaveData->SetInSupportedSave(true);
                 break;
             case SfxEventHintId::SaveDocDone:
             case SfxEventHintId::SaveAsDocDone:
@@ -1014,8 +1014,8 @@ void ScDocShell::Notify( SfxBroadcaster&, const SfxHint& rHint )
                 }
             case SfxEventHintId::SaveToDocDone:
                 // only reset the flag, don't use the new positions
-                if (pSheetSaveData)
-                    pSheetSaveData->SetInSupportedSave(false);
+                if (m_pSheetSaveData)
+                    m_pSheetSaveData->SetInSupportedSave(false);
                 break;
             default:
                 {
@@ -1025,7 +1025,7 @@ void ScDocShell::Notify( SfxBroadcaster&, const SfxHint& rHint )
     }
     else if (rHint.GetId() == SfxHintId::TitleChanged) // Without parameter
     {
-        aDocument.SetName( SfxShell::GetName() );
+        m_aDocument.SetName( SfxShell::GetName() );
         //  RegisterNewTargetNames doesn't exist any longer
         SfxGetpApp()->Broadcast(SfxHint( SfxHintId::ScDocNameChanged )); // Navigator
     }
@@ -1040,7 +1040,7 @@ void ScDocShell::Notify( SfxBroadcaster&, const SfxHint& rHint )
         }
 #endif
 
-        if (aDocument.IsClipboardSource())
+        if (m_aDocument.IsClipboardSource())
         {
             // Notes copied to the clipboard have a raw SdrCaptionObj pointer
             // copied from this document, forget it as it references this
@@ -1084,8 +1084,8 @@ void ScDocShell::Notify( SfxBroadcaster&, const SfxHint& rHint )
 // Load contents for organizer
 bool ScDocShell::LoadFrom( SfxMedium& rMedium )
 {
-    LoadMediumGuard aLoadGuard(&aDocument);
-    ScRefreshTimerProtector aProt( aDocument.GetRefreshTimerControlAddress() );
+    LoadMediumGuard aLoadGuard(&m_aDocument);
+    ScRefreshTimerProtector aProt( m_aDocument.GetRefreshTimerControlAddress() );
 
     WaitObject aWait( GetActiveDialogParent() );
 
@@ -1094,7 +1094,7 @@ bool ScDocShell::LoadFrom( SfxMedium& rMedium )
     if (GetMedium())
     {
         const SfxUInt16Item* pUpdateDocItem = SfxItemSet::GetItem<SfxUInt16Item>(rMedium.GetItemSet(), SID_UPDATEDOCMODE, false);
-        nCanUpdate = pUpdateDocItem ? pUpdateDocItem->GetValue() : css::document::UpdateDocMode::NO_UPDATE;
+        m_nCanUpdate = pUpdateDocItem ? pUpdateDocItem->GetValue() : css::document::UpdateDocMode::NO_UPDATE;
     }
 
     //  until loading/saving only the styles in XML is implemented,
@@ -1139,12 +1139,12 @@ static void lcl_parseHtmlFilterOption(const OUString& rOption, LanguageType& rLa
 
 bool ScDocShell::ConvertFrom( SfxMedium& rMedium )
 {
-    LoadMediumGuard aLoadGuard(&aDocument);
+    LoadMediumGuard aLoadGuard(&m_aDocument);
 
     bool bRet = false; // sal_False means user quit!
                            // On error: Set error at stream
 
-    ScRefreshTimerProtector aProt( aDocument.GetRefreshTimerControlAddress() );
+    ScRefreshTimerProtector aProt( m_aDocument.GetRefreshTimerControlAddress() );
 
     GetUndoManager()->Clear();
 
@@ -1163,7 +1163,7 @@ bool ScDocShell::ConvertFrom( SfxMedium& rMedium )
     rMedium.GetPhysicalName();  //! Call CreateFileStream directly, if available
 
     const SfxUInt16Item* pUpdateDocItem = SfxItemSet::GetItem<SfxUInt16Item>(rMedium.GetItemSet(), SID_UPDATEDOCMODE, false);
-    nCanUpdate = pUpdateDocItem ? pUpdateDocItem->GetValue() : css::document::UpdateDocMode::NO_UPDATE;
+    m_nCanUpdate = pUpdateDocItem ? pUpdateDocItem->GetValue() : css::document::UpdateDocMode::NO_UPDATE;
 
     std::shared_ptr<const SfxFilter> pFilter = rMedium.GetFilter();
     if (pFilter)
@@ -1173,7 +1173,7 @@ bool ScDocShell::ConvertFrom( SfxMedium& rMedium )
         bool bCalc3 = aFltName == "StarCalc 3.0";
         bool bCalc4 = aFltName == "StarCalc 4.0";
         if (!bCalc3 && !bCalc4)
-            aDocument.SetInsertingFromOtherDoc( true );
+            m_aDocument.SetInsertingFromOtherDoc( true );
 
         if (aFltName == pFilterXML)
             bRet = LoadXML( &rMedium, nullptr );
@@ -1195,7 +1195,7 @@ bool ScDocShell::ConvertFrom( SfxMedium& rMedium )
                 sItStr = ScGlobal::GetCharsetString( RTL_TEXTENCODING_IBM_437 );
             }
 
-            ErrCode eError = ScFormatFilter::Get().ScImportLotus123( rMedium, &aDocument,
+            ErrCode eError = ScFormatFilter::Get().ScImportLotus123( rMedium, &m_aDocument,
                                                 ScGlobal::GetCharsetValue(sItStr));
             if (eError != ERRCODE_NONE)
             {
@@ -1226,13 +1226,13 @@ bool ScDocShell::ConvertFrom( SfxMedium& rMedium )
 
             MakeDrawLayer(); //! In the filter
             CalcOutputFactor(); // prepare update of row height
-            ErrCode eError = ScFormatFilter::Get().ScImportExcel( rMedium, &aDocument, eFormat );
-            aDocument.UpdateFontCharSet();
-            if ( aDocument.IsChartListenerCollectionNeedsUpdate() )
-                aDocument.UpdateChartListenerCollection(); //! For all imports?
+            ErrCode eError = ScFormatFilter::Get().ScImportExcel( rMedium, &m_aDocument, eFormat );
+            m_aDocument.UpdateFontCharSet();
+            if ( m_aDocument.IsChartListenerCollectionNeedsUpdate() )
+                m_aDocument.UpdateChartListenerCollection(); //! For all imports?
 
             // all graphics objects must have names
-            aDocument.EnsureGraphicNames();
+            m_aDocument.EnsureGraphicNames();
 
             if (eError == SCWARN_IMPORT_RANGE_OVERFLOW)
             {
@@ -1254,7 +1254,7 @@ bool ScDocShell::ConvertFrom( SfxMedium& rMedium )
             if (!pOrcus)
                 return false;
 
-            bRet = pOrcus->importGnumeric(aDocument, rMedium);
+            bRet = pOrcus->importGnumeric(m_aDocument, rMedium);
         }
         else if (aFltName == pFilterAscii)
         {
@@ -1286,7 +1286,7 @@ bool ScDocShell::ConvertFrom( SfxMedium& rMedium )
 
             if( ! rMedium.IsStorage() )
             {
-                ScImportExport  aImpEx( &aDocument );
+                ScImportExport  aImpEx( &m_aDocument );
                 aImpEx.SetExtOptions( aOptions );
 
                 SvStream* pInStream = rMedium.GetInStream();
@@ -1296,9 +1296,9 @@ bool ScDocShell::ConvertFrom( SfxMedium& rMedium )
                     pInStream->Seek( 0 );
                     bRet = aImpEx.ImportStream( *pInStream, rMedium.GetBaseURL(), SotClipboardFormatId::STRING );
                     eError = bRet ? ERRCODE_NONE : SCERR_IMPORT_CONNECT;
-                    aDocument.StartAllListeners();
+                    m_aDocument.StartAllListeners();
                     sc::SetFormulaDirtyContext aCxt;
-                    aDocument.SetAllFormulasDirty(aCxt);
+                    m_aDocument.SetAllFormulasDirty(aCxt);
 
                     // The same resulting name has to be handled in
                     // ScExternalRefCache::initializeDoc() and related, hence
@@ -1310,7 +1310,7 @@ bool ScDocShell::ConvertFrom( SfxMedium& rMedium )
                     // corresponding places of the external references
                     // manager/cache. Likely then we'd also need a method to
                     // compose a name excluding such characters.
-                    aDocument.RenameTab( 0, INetURLObject( rMedium.GetName()).GetBase(), true/*bExternalDocument*/);
+                    m_aDocument.RenameTab( 0, INetURLObject( rMedium.GetName()).GetBase(), true/*bExternalDocument*/);
 
                     bOverflowRow = aImpEx.IsOverflowRow();
                     bOverflowCol = aImpEx.IsOverflowCol();
@@ -1398,7 +1398,7 @@ bool ScDocShell::ConvertFrom( SfxMedium& rMedium )
                     sItStr = ScGlobal::GetCharsetString( RTL_TEXTENCODING_MS_1252 );
                 }
 
-                eError = ScFormatFilter::Get().ScImportDif( *pStream, &aDocument, ScAddress(0,0,0),
+                eError = ScFormatFilter::Get().ScImportDif( *pStream, &m_aDocument, ScAddress(0,0,0),
                                     ScGlobal::GetCharsetValue(sItStr));
                 if (eError != ERRCODE_NONE)
                 {
@@ -1422,7 +1422,7 @@ bool ScDocShell::ConvertFrom( SfxMedium& rMedium )
             bOverflowRow = bOverflowCol = bOverflowCell = false;
             if( !rMedium.IsStorage() )
             {
-                ScImportExport aImpEx( &aDocument );
+                ScImportExport aImpEx( &m_aDocument );
 
                 SvStream* pInStream = rMedium.GetInStream();
                 if (pInStream)
@@ -1430,9 +1430,9 @@ bool ScDocShell::ConvertFrom( SfxMedium& rMedium )
                     pInStream->Seek( 0 );
                     bRet = aImpEx.ImportStream( *pInStream, rMedium.GetBaseURL(), SotClipboardFormatId::SYLK );
                     eError = bRet ? ERRCODE_NONE : SCERR_IMPORT_UNKNOWN;
-                    aDocument.StartAllListeners();
+                    m_aDocument.StartAllListeners();
                     sc::SetFormulaDirtyContext aCxt;
-                    aDocument.SetAllFormulasDirty(aCxt);
+                    m_aDocument.SetAllFormulasDirty(aCxt);
 
                     bOverflowRow = aImpEx.IsOverflowRow();
                     bOverflowCol = aImpEx.IsOverflowCol();
@@ -1460,7 +1460,7 @@ bool ScDocShell::ConvertFrom( SfxMedium& rMedium )
         }
         else if (aFltName == pFilterQPro6)
         {
-            ErrCode eError = ScFormatFilter::Get().ScImportQuattroPro(rMedium.GetInStream(), &aDocument);
+            ErrCode eError = ScFormatFilter::Get().ScImportQuattroPro(rMedium.GetInStream(), &m_aDocument);
             if (eError != ERRCODE_NONE)
             {
                 if (!GetError())
@@ -1486,7 +1486,7 @@ bool ScDocShell::ConvertFrom( SfxMedium& rMedium )
                 {
                     pInStream->Seek( 0 );
                     ScRange aRange;
-                    eError = ScFormatFilter::Get().ScImportRTF( *pInStream, rMedium.GetBaseURL(), &aDocument, aRange );
+                    eError = ScFormatFilter::Get().ScImportRTF( *pInStream, rMedium.GetBaseURL(), &m_aDocument, aRange );
                     if (eError != ERRCODE_NONE)
                     {
                         if (!GetError())
@@ -1497,9 +1497,9 @@ bool ScDocShell::ConvertFrom( SfxMedium& rMedium )
                     }
                     else
                         bRet = true;
-                    aDocument.StartAllListeners();
+                    m_aDocument.StartAllListeners();
                     sc::SetFormulaDirtyContext aCxt;
-                    aDocument.SetAllFormulasDirty(aCxt);
+                    m_aDocument.SetAllFormulasDirty(aCxt);
                     bSetColWidths = true;
                     bSetRowHeights = true;
                 }
@@ -1537,7 +1537,7 @@ bool ScDocShell::ConvertFrom( SfxMedium& rMedium )
                     // HTML does its own ColWidth/RowHeight
                     CalcOutputFactor();
                     SvNumberFormatter aNumFormatter( comphelper::getProcessComponentContext(), eLang);
-                    eError = ScFormatFilter::Get().ScImportHTML( *pInStream, rMedium.GetBaseURL(), &aDocument, aRange,
+                    eError = ScFormatFilter::Get().ScImportHTML( *pInStream, rMedium.GetBaseURL(), &m_aDocument, aRange,
                                             GetOutputFactor(), !bWebQuery, &aNumFormatter, bDateConvert );
                     if (eError != ERRCODE_NONE)
                     {
@@ -1549,10 +1549,10 @@ bool ScDocShell::ConvertFrom( SfxMedium& rMedium )
                     }
                     else
                         bRet = true;
-                    aDocument.StartAllListeners();
+                    m_aDocument.StartAllListeners();
 
                     sc::SetFormulaDirtyContext aCxt;
-                    aDocument.SetAllFormulasDirty(aCxt);
+                    m_aDocument.SetAllFormulasDirty(aCxt);
                 }
                 else
                 {
@@ -1573,7 +1573,7 @@ bool ScDocShell::ConvertFrom( SfxMedium& rMedium )
         }
 
         if (!bCalc3)
-            aDocument.SetInsertingFromOtherDoc( false );
+            m_aDocument.SetInsertingFromOtherDoc( false );
     }
     else
     {
@@ -1589,12 +1589,12 @@ bool ScDocShell::ConvertFrom( SfxMedium& rMedium )
         double nPPTY = ScGlobal::nScreenPPTY * (double) aZoom;
         ScopedVclPtrInstance< VirtualDevice > pVirtDev;
         //  all sheets (for Excel import)
-        SCTAB nTabCount = aDocument.GetTableCount();
+        SCTAB nTabCount = m_aDocument.GetTableCount();
         for (SCTAB nTab=0; nTab<nTabCount; nTab++)
         {
             SCCOL nEndCol;
             SCROW nEndRow;
-            aDocument.GetCellArea( nTab, nEndCol, nEndRow );
+            m_aDocument.GetCellArea( nTab, nEndCol, nEndRow );
             aColWidthRange.aEnd.SetCol( nEndCol );
             aColWidthRange.aEnd.SetRow( nEndRow );
             ScMarkData aMark;
@@ -1609,11 +1609,11 @@ bool ScDocShell::ConvertFrom( SfxMedium& rMedium )
                     if (!bSetSimpleTextColWidths)
                         aColWidthParam[nCol].mbSimpleText = false;
 
-                    sal_uInt16 nWidth = aDocument.GetOptimalColWidth(
+                    sal_uInt16 nWidth = m_aDocument.GetOptimalColWidth(
                         nCol, nTab, pVirtDev, nPPTX, nPPTY, aZoom, aZoom, false, &aMark,
                         &aColWidthParam[nCol] );
-                    aDocument.SetColWidth( nCol, nTab,
-                        nWidth + (sal_uInt16)ScGlobal::nLastColWidthExtra );
+                    m_aDocument.SetColWidth( nCol, nTab,
+                        nWidth + static_cast<sal_uInt16>(ScGlobal::nLastColWidthExtra) );
                 }
             }
         }
@@ -1622,14 +1622,14 @@ bool ScDocShell::ConvertFrom( SfxMedium& rMedium )
         {
             // Update all rows in all tables.
             ScSizeDeviceProvider aProv(this);
-            ScDocRowHeightUpdater aUpdater(aDocument, aProv.GetDevice(), aProv.GetPPTX(), aProv.GetPPTY(), nullptr);
+            ScDocRowHeightUpdater aUpdater(m_aDocument, aProv.GetDevice(), aProv.GetPPTX(), aProv.GetPPTY(), nullptr);
             aUpdater.update();
         }
         else if (!aRecalcRowRangesArray.empty())
         {
             // Update only specified row ranges for better performance.
             ScSizeDeviceProvider aProv(this);
-            ScDocRowHeightUpdater aUpdater(aDocument, aProv.GetDevice(), aProv.GetPPTX(), aProv.GetPPTY(), &aRecalcRowRangesArray);
+            ScDocRowHeightUpdater aUpdater(m_aDocument, aProv.GetDevice(), aProv.GetPPTX(), aProv.GetPPTY(), &aRecalcRowRangesArray);
             aUpdater.update();
         }
     }
@@ -1637,9 +1637,9 @@ bool ScDocShell::ConvertFrom( SfxMedium& rMedium )
 
     // invalidate eventually temporary table areas
     if ( bRet )
-        aDocument.InvalidateTableArea();
+        m_aDocument.InvalidateTableArea();
 
-    bIsEmpty = false;
+    m_bIsEmpty = false;
 
     return bRet;
 }
@@ -1659,22 +1659,22 @@ bool ScDocShell::LoadExternal( SfxMedium& rMed )
         const OUString& rFilterName = pFilter->GetName();
         if (rFilterName == "gnumeric")
         {
-            if (!pOrcus->importGnumeric(aDocument, rMed))
+            if (!pOrcus->importGnumeric(m_aDocument, rMed))
                 return false;
         }
         else if (rFilterName == "csv")
         {
-            if (!pOrcus->importCSV(aDocument, rMed))
+            if (!pOrcus->importCSV(m_aDocument, rMed))
                 return false;
         }
         else if (rFilterName == "xlsx")
         {
-            if (!pOrcus->importXLSX(aDocument, rMed))
+            if (!pOrcus->importXLSX(m_aDocument, rMed))
                 return false;
         }
         else if (rFilterName == "ods")
         {
-            if (!pOrcus->importODS(aDocument, rMed))
+            if (!pOrcus->importODS(m_aDocument, rMed))
                 return false;
         }
 
@@ -1690,19 +1690,19 @@ ScDocShell::PrepareSaveGuard::PrepareSaveGuard( ScDocShell& rDocShell )
 {
     // DoEnterHandler not here (because of AutoSave), is in ExecuteSave.
 
-    ScChartListenerCollection* pCharts = mrDocShell.aDocument.GetChartListenerCollection();
+    ScChartListenerCollection* pCharts = mrDocShell.m_aDocument.GetChartListenerCollection();
     if (pCharts)
         pCharts->UpdateDirtyCharts();                           // Charts to be updated.
-    mrDocShell.aDocument.StopTemporaryChartLock();
-    if (mrDocShell.pAutoStyleList)
-        mrDocShell.pAutoStyleList->ExecuteAllNow();             // Execute template timeouts now.
-    if (mrDocShell.aDocument.HasExternalRefManager())
+    mrDocShell.m_aDocument.StopTemporaryChartLock();
+    if (mrDocShell.m_pAutoStyleList)
+        mrDocShell.m_pAutoStyleList->ExecuteAllNow();             // Execute template timeouts now.
+    if (mrDocShell.m_aDocument.HasExternalRefManager())
     {
-        ScExternalRefManager* pRefMgr = mrDocShell.aDocument.GetExternalRefManager();
+        ScExternalRefManager* pRefMgr = mrDocShell.m_aDocument.GetExternalRefManager();
         if (pRefMgr && pRefMgr->hasExternalData())
         {
             pRefMgr->setAllCacheTableReferencedStati( false);
-            mrDocShell.aDocument.MarkUsedExternalReferences();  // Mark tables of external references to be written.
+            mrDocShell.m_aDocument.MarkUsedExternalReferences();  // Mark tables of external references to be written.
         }
     }
     if (mrDocShell.GetCreateMode()== SfxObjectCreateMode::STANDARD)
@@ -1711,9 +1711,9 @@ ScDocShell::PrepareSaveGuard::PrepareSaveGuard( ScDocShell& rDocShell )
 
 ScDocShell::PrepareSaveGuard::~PrepareSaveGuard()
 {
-    if (mrDocShell.aDocument.HasExternalRefManager())
+    if (mrDocShell.m_aDocument.HasExternalRefManager())
     {
-        ScExternalRefManager* pRefMgr = mrDocShell.aDocument.GetExternalRefManager();
+        ScExternalRefManager* pRefMgr = mrDocShell.m_aDocument.GetExternalRefManager();
         if (pRefMgr && pRefMgr->hasExternalData())
         {
             // Prevent accidental data loss due to lack of knowledge.
@@ -1724,7 +1724,7 @@ ScDocShell::PrepareSaveGuard::~PrepareSaveGuard()
 
 bool ScDocShell::Save()
 {
-    ScRefreshTimerProtector aProt( aDocument.GetRefreshTimerControlAddress() );
+    ScRefreshTimerProtector aProt( m_aDocument.GetRefreshTimerControlAddress() );
 
     PrepareSaveGuard aPrepareGuard( *this);
 
@@ -1784,18 +1784,18 @@ bool ScDocShell::SaveAs( SfxMedium& rMedium )
         if (!aRel.isEmpty())
         {
             // Directory path will change before and after the save.
-            aDocument.InvalidateStreamOnSave();
+            m_aDocument.InvalidateStreamOnSave();
         }
     }
 
     ScTabViewShell* pViewShell = GetBestViewShell();
-    bool bNeedsRehash = ScPassHashHelper::needsPassHashRegen(aDocument, PASSHASH_SHA1);
+    bool bNeedsRehash = ScPassHashHelper::needsPassHashRegen(m_aDocument, PASSHASH_SHA1);
     if (bNeedsRehash)
         // legacy xls hash double-hashed by SHA1 is also supported.
-        bNeedsRehash = ScPassHashHelper::needsPassHashRegen(aDocument, PASSHASH_XL, PASSHASH_SHA1);
+        bNeedsRehash = ScPassHashHelper::needsPassHashRegen(m_aDocument, PASSHASH_XL, PASSHASH_SHA1);
     if (bNeedsRehash)
     {   // SHA256 explicitly supported in ODF 1.2, implicitly in ODF 1.1
-        bNeedsRehash = ScPassHashHelper::needsPassHashRegen(aDocument, PASSHASH_SHA256);
+        bNeedsRehash = ScPassHashHelper::needsPassHashRegen(m_aDocument, PASSHASH_SHA256);
     }
 
     if (pViewShell && bNeedsRehash)
@@ -1805,7 +1805,7 @@ bool ScDocShell::SaveAs( SfxMedium& rMedium )
             return false;
     }
 
-    ScRefreshTimerProtector aProt( aDocument.GetRefreshTimerControlAddress() );
+    ScRefreshTimerProtector aProt( m_aDocument.GetRefreshTimerControlAddress() );
 
     PrepareSaveGuard aPrepareGuard( *this);
 
@@ -1980,13 +1980,13 @@ void ScDocShell::AsciiSave( SvStream& rStream, const ScImportOptions& rAsciiOpt
     SCTAB nTab = GetSaveTab();
     SCCOL nEndCol;
     SCROW nEndRow;
-    aDocument.GetCellArea( nTab, nEndCol, nEndRow );
+    m_aDocument.GetCellArea( nTab, nEndCol, nEndRow );
 
     ScProgress aProgress( this, ScGlobal::GetRscString( STR_SAVE_DOC ), nEndRow, true );
 
     OUString aString;
 
-    bool bTabProtect = aDocument.IsTabProtected( nTab );
+    bool bTabProtect = m_aDocument.IsTabProtected( nTab );
 
     SCCOL nCol;
     SCROW nRow;
@@ -1994,9 +1994,9 @@ void ScDocShell::AsciiSave( SvStream& rStream, const ScImportOptions& rAsciiOpt
     SCROW nNextRow = nStartRow;
     SCCOL nEmptyCol;
     SCROW nEmptyRow;
-    SvNumberFormatter& rFormatter = *aDocument.GetFormatTable();
+    SvNumberFormatter& rFormatter = *m_aDocument.GetFormatTable();
 
-    ScHorizontalCellIterator aIter( &aDocument, nTab, nStartCol, nStartRow,
+    ScHorizontalCellIterator aIter( &m_aDocument, nTab, nStartCol, nStartRow,
         nEndCol, nEndRow );
     ScRefCellValue* pCell;
     while ( ( pCell = aIter.GetNext( nCol, nRow ) ) != nullptr )
@@ -2009,7 +2009,7 @@ void ScDocShell::AsciiSave( SvStream& rStream, const ScImportOptions& rAsciiOpt
             {   // remaining columns of last row
                 if ( bFixedWidth )
                     lcl_ScDocShell_WriteEmptyFixedWidthString( rStream,
-                            aDocument, nTab, nEmptyCol );
+                            m_aDocument, nTab, nEmptyCol );
                 else if ( cDelim != 0 )
                     rStream.WriteUniOrByteChar( cDelim );
             }
@@ -2021,7 +2021,7 @@ void ScDocShell::AsciiSave( SvStream& rStream, const ScImportOptions& rAsciiOpt
                 {
                     if ( bFixedWidth )
                         lcl_ScDocShell_WriteEmptyFixedWidthString( rStream,
-                                aDocument, nTab, nEmptyCol );
+                                m_aDocument, nTab, nEmptyCol );
                     else if ( cDelim != 0 )
                         rStream.WriteUniOrByteChar( cDelim );
                 }
@@ -2031,7 +2031,7 @@ void ScDocShell::AsciiSave( SvStream& rStream, const ScImportOptions& rAsciiOpt
             {   // empty columns at beginning of row
                 if ( bFixedWidth )
                     lcl_ScDocShell_WriteEmptyFixedWidthString( rStream,
-                            aDocument, nTab, nEmptyCol );
+                            m_aDocument, nTab, nEmptyCol );
                 else if ( cDelim != 0 )
                     rStream.WriteUniOrByteChar( cDelim );
             }
@@ -2043,7 +2043,7 @@ void ScDocShell::AsciiSave( SvStream& rStream, const ScImportOptions& rAsciiOpt
             {   // columns in between
                 if ( bFixedWidth )
                     lcl_ScDocShell_WriteEmptyFixedWidthString( rStream,
-                            aDocument, nTab, nEmptyCol );
+                            m_aDocument, nTab, nEmptyCol );
                 else if ( cDelim != 0 )
                     rStream.WriteUniOrByteChar( cDelim );
             }
@@ -2062,7 +2062,7 @@ void ScDocShell::AsciiSave( SvStream& rStream, const ScImportOptions& rAsciiOpt
         if ( bTabProtect )
         {
             const ScProtectionAttr* pProtAttr =
-                static_cast<const ScProtectionAttr*>( aDocument.GetAttr(
+                static_cast<const ScProtectionAttr*>( m_aDocument.GetAttr(
                                                             nCol, nRow, nTab, ATTR_PROTECTION ));
             if ( pProtAttr->GetHideCell() ||
                     ( eType == CELLTYPE_FORMULA && bShowFormulas &&
@@ -2091,16 +2091,16 @@ void ScDocShell::AsciiSave( SvStream& rStream, const ScImportOptions& rAsciiOpt
                     }
                     else if (pCell->mpFormula->IsValue())
                     {
-                        sal_uInt32 nFormat = aDocument.GetNumberFormat(aPos);
+                        sal_uInt32 nFormat = m_aDocument.GetNumberFormat(aPos);
                         if ( bFixedWidth || bSaveAsShown )
                         {
                             Color* pDummy;
-                            ScCellFormat::GetString(*pCell, nFormat, aString, &pDummy, rFormatter, &aDocument);
+                            ScCellFormat::GetString(*pCell, nFormat, aString, &pDummy, rFormatter, &m_aDocument);
                             bString = bSaveAsShown && rFormatter.IsTextFormat( nFormat);
                         }
                         else
                         {
-                            ScCellFormat::GetInputString(*pCell, nFormat, aString, rFormatter, &aDocument);
+                            ScCellFormat::GetInputString(*pCell, nFormat, aString, rFormatter, &m_aDocument);
                             bString = false;
                         }
                     }
@@ -2108,9 +2108,9 @@ void ScDocShell::AsciiSave( SvStream& rStream, const ScImportOptions& rAsciiOpt
                     {
                         if ( bSaveAsShown )
                         {
-                            sal_uInt32 nFormat = aDocument.GetNumberFormat(aPos);
+                            sal_uInt32 nFormat = m_aDocument.GetNumberFormat(aPos);
                             Color* pDummy;
-                            ScCellFormat::GetString(*pCell, nFormat, aString, &pDummy, rFormatter, &aDocument);
+                            ScCellFormat::GetString(*pCell, nFormat, aString, &pDummy, rFormatter, &m_aDocument);
                         }
                         else
                             aString = pCell->mpFormula->GetString().getString();
@@ -2121,9 +2121,9 @@ void ScDocShell::AsciiSave( SvStream& rStream, const ScImportOptions& rAsciiOpt
             case CELLTYPE_STRING :
                 if ( bSaveAsShown )
                 {
-                    sal_uInt32 nFormat = aDocument.GetNumberFormat(aPos);
+                    sal_uInt32 nFormat = m_aDocument.GetNumberFormat(aPos);
                     Color* pDummy;
-                    ScCellFormat::GetString(*pCell, nFormat, aString, &pDummy, rFormatter, &aDocument);
+                    ScCellFormat::GetString(*pCell, nFormat, aString, &pDummy, rFormatter, &m_aDocument);
                 }
                 else
                     aString = pCell->mpString->getString();
@@ -2132,7 +2132,7 @@ void ScDocShell::AsciiSave( SvStream& rStream, const ScImportOptions& rAsciiOpt
             case CELLTYPE_EDIT :
                 {
                     const EditTextObject* pObj = pCell->mpEditText;
-                    EditEngine& rEngine = aDocument.GetEditEngine();
+                    EditEngine& rEngine = m_aDocument.GetEditEngine();
                     rEngine.SetText( *pObj);
                     aString = rEngine.GetText();  // including LF
                     bString = true;
@@ -2141,16 +2141,16 @@ void ScDocShell::AsciiSave( SvStream& rStream, const ScImportOptions& rAsciiOpt
             case CELLTYPE_VALUE :
                 {
                     sal_uInt32 nFormat;
-                    aDocument.GetNumberFormat( nCol, nRow, nTab, nFormat );
+                    m_aDocument.GetNumberFormat( nCol, nRow, nTab, nFormat );
                     if ( bFixedWidth || bSaveAsShown )
                     {
                         Color* pDummy;
-                        ScCellFormat::GetString(*pCell, nFormat, aString, &pDummy, rFormatter, &aDocument);
+                        ScCellFormat::GetString(*pCell, nFormat, aString, &pDummy, rFormatter, &m_aDocument);
                         bString = bSaveAsShown && rFormatter.IsTextFormat( nFormat);
                     }
                     else
                     {
-                        ScCellFormat::GetInputString(*pCell, nFormat, aString, rFormatter, &aDocument);
+                        ScCellFormat::GetInputString(*pCell, nFormat, aString, rFormatter, &m_aDocument);
                         bString = false;
                     }
                 }
@@ -2164,9 +2164,9 @@ void ScDocShell::AsciiSave( SvStream& rStream, const ScImportOptions& rAsciiOpt
         if ( bFixedWidth )
         {
             SvxCellHorJustify eHorJust =
-                static_cast<const SvxHorJustifyItem*>( aDocument.GetAttr( nCol, nRow,
+                static_cast<const SvxHorJustifyItem*>( m_aDocument.GetAttr( nCol, nRow,
                 nTab, ATTR_HOR_JUSTIFY ))->GetValue();
-            lcl_ScDocShell_GetFixedWidthString( aString, aDocument, nTab, nCol,
+            lcl_ScDocShell_GetFixedWidthString( aString, m_aDocument, nTab, nCol,
                     !bString, eHorJust );
             rStream.WriteUnicodeOrByteText( aString );
         }
@@ -2288,7 +2288,7 @@ void ScDocShell::AsciiSave( SvStream& rStream, const ScImportOptions& rAsciiOpt
         {   // remaining empty columns of last row
             if ( bFixedWidth )
                 lcl_ScDocShell_WriteEmptyFixedWidthString( rStream,
-                        aDocument, nTab, nEmptyCol );
+                        m_aDocument, nTab, nEmptyCol );
             else if ( cDelim != 0 )
                 rStream.WriteUniOrByteChar( cDelim );
         }
@@ -2301,7 +2301,7 @@ void ScDocShell::AsciiSave( SvStream& rStream, const ScImportOptions& rAsciiOpt
         {
             if ( bFixedWidth )
                 lcl_ScDocShell_WriteEmptyFixedWidthString( rStream,
-                        aDocument, nTab, nEmptyCol );
+                        m_aDocument, nTab, nEmptyCol );
             else if ( cDelim != 0 )
                 rStream.WriteUniOrByteChar( cDelim );
         }
@@ -2314,13 +2314,13 @@ void ScDocShell::AsciiSave( SvStream& rStream, const ScImportOptions& rAsciiOpt
 
 bool ScDocShell::ConvertTo( SfxMedium &rMed )
 {
-    ScRefreshTimerProtector aProt( aDocument.GetRefreshTimerControlAddress() );
+    ScRefreshTimerProtector aProt( m_aDocument.GetRefreshTimerControlAddress() );
 
     //  #i6500# don't call DoEnterHandler here (doesn't work with AutoSave),
     //  it's already in ExecuteSave (as for Save and SaveAs)
 
-    if (pAutoStyleList)
-        pAutoStyleList->ExecuteAllNow(); // Execute template timeouts now
+    if (m_pAutoStyleList)
+        m_pAutoStyleList->ExecuteAllNow(); // Execute template timeouts now
     if (GetCreateMode()== SfxObjectCreateMode::STANDARD)
         SfxObjectShell::SetVisArea( tools::Rectangle() ); // Edited normally -> no VisArea
 
@@ -2344,9 +2344,9 @@ bool ScDocShell::ConvertTo( SfxMedium &rMed )
         bool bDoSave = true;
         if( ScTabViewShell* pViewShell = GetBestViewShell() )
         {
-            ScExtDocOptions* pExtDocOpt = aDocument.GetExtDocOptions();
+            ScExtDocOptions* pExtDocOpt = m_aDocument.GetExtDocOptions();
             if( !pExtDocOpt )
-                aDocument.SetExtDocOptions( pExtDocOpt = new ScExtDocOptions );
+                m_aDocument.SetExtDocOptions( pExtDocOpt = new ScExtDocOptions );
             pViewShell->GetViewData().WriteExtOptions( *pExtDocOpt );
 
             /*  #i104990# If the imported document contains a medium
@@ -2367,7 +2367,7 @@ bool ScDocShell::ConvertTo( SfxMedium &rMed )
 
             if( bDoSave )
             {
-                bool bNeedRetypePassDlg = ScPassHashHelper::needsPassHashRegen( aDocument, PASSHASH_XL );
+                bool bNeedRetypePassDlg = ScPassHashHelper::needsPassHashRegen( m_aDocument, PASSHASH_XL );
                 bDoSave = !bNeedRetypePassDlg || pViewShell->ExecuteRetypePassDlg( PASSHASH_XL );
             }
         }
@@ -2377,7 +2377,7 @@ bool ScDocShell::ConvertTo( SfxMedium &rMed )
             ExportFormatExcel eFormat = ExpBiff5;
             if( aFltName == pFilterExcel97 || aFltName == pFilterEx97Temp )
                 eFormat = ExpBiff8;
-            ErrCode eError = ScFormatFilter::Get().ScExportExcel5( rMed, &aDocument, eFormat, RTL_TEXTENCODING_MS_1252 );
+            ErrCode eError = ScFormatFilter::Get().ScExportExcel5( rMed, &m_aDocument, eFormat, RTL_TEXTENCODING_MS_1252 );
 
             if( eError && !GetError() )
                 SetError(eError);
@@ -2419,7 +2419,7 @@ bool ScDocShell::ConvertTo( SfxMedium &rMed )
             AsciiSave( *pStream, aOptions );
             bRet = true;
 
-            if (aDocument.GetTableCount() > 1)
+            if (m_aDocument.GetTableCount() > 1)
                 if (!rMed.GetError())
                     rMed.SetError(SCWARN_EXPORT_ASCII);
         }
@@ -2516,11 +2516,11 @@ bool ScDocShell::ConvertTo( SfxMedium &rMed )
             }
 
             WaitObject aWait( GetActiveDialogParent() );
-            ScFormatFilter::Get().ScExportDif( *pStream, &aDocument, ScAddress(0,0,0),
+            ScFormatFilter::Get().ScExportDif( *pStream, &m_aDocument, ScAddress(0,0,0),
                 ScGlobal::GetCharsetValue(sItStr) );
             bRet = true;
 
-            if (aDocument.GetTableCount() > 1)
+            if (m_aDocument.GetTableCount() > 1)
                 if (!rMed.GetError())
                     rMed.SetError(SCWARN_EXPORT_ASCII);
         }
@@ -2534,10 +2534,10 @@ bool ScDocShell::ConvertTo( SfxMedium &rMed )
 
             SCCOL nEndCol;
             SCROW nEndRow;
-            aDocument.GetCellArea( 0, nEndCol, nEndRow );
+            m_aDocument.GetCellArea( 0, nEndCol, nEndRow );
             ScRange aRange( 0,0,0, nEndCol,nEndRow,0 );
 
-            ScImportExport aImExport( &aDocument, aRange );
+            ScImportExport aImExport( &m_aDocument, aRange );
             aImExport.SetFormulas( true );
             bRet = aImExport.ExportStream( *pStream, rMed.GetBaseURL( true ), SotClipboardFormatId::SYLK );
         }
@@ -2555,7 +2555,7 @@ bool ScDocShell::ConvertTo( SfxMedium &rMed )
                 sFilterOptions = static_cast<const SfxStringItem*>(pItem)->GetValue();
 
             WaitObject aWait(GetActiveDialogParent());
-            ScImportExport aImExport(&aDocument);
+            ScImportExport aImExport(&m_aDocument);
             aImExport.SetStreamPath(rMed.GetName());
             aImExport.SetFilterOptions(sFilterOptions);
             bRet = aImExport.ExportStream(*pStream, rMed.GetBaseURL(true), SotClipboardFormatId::HTML);
@@ -2610,7 +2610,7 @@ bool ScDocShell::QuerySlotExecutable( sal_uInt16 nSlotId )
     bool bSlotExecutable = true;
     if( nVbaEventId != VBAEventId::NO_EVENT ) try
     {
-        uno::Reference< XVBAEventProcessor > xEventProcessor( aDocument.GetVbaEventProcessor(), uno::UNO_QUERY_THROW );
+        uno::Reference< XVBAEventProcessor > xEventProcessor( m_aDocument.GetVbaEventProcessor(), uno::UNO_QUERY_THROW );
         xEventProcessor->processVbaEvent( nVbaEventId, aArgs );
     }
     catch( util::VetoException& )
@@ -2641,7 +2641,7 @@ bool ScDocShell::PrepareClose( bool bUI )
 
         return false;
     }
-    if ( aDocument.IsInLinkUpdate() || aDocument.IsInInterpreter() )
+    if ( m_aDocument.IsInLinkUpdate() || m_aDocument.IsInInterpreter() )
     {
         ErrorMessage(STR_CLOSE_ERROR_LINK);
         return false;
@@ -2654,7 +2654,7 @@ bool ScDocShell::PrepareClose( bool bUI )
     {
         try
         {
-            uno::Reference< script::vba::XVBAEventProcessor > xVbaEvents( aDocument.GetVbaEventProcessor(), uno::UNO_SET_THROW );
+            uno::Reference< script::vba::XVBAEventProcessor > xVbaEvents( m_aDocument.GetVbaEventProcessor(), uno::UNO_SET_THROW );
             uno::Sequence< uno::Any > aArgs;
             xVbaEvents->processVbaEvent( script::vba::VBAEventId::WORKBOOK_BEFORECLOSE, aArgs );
         }
@@ -2671,7 +2671,7 @@ bool ScDocShell::PrepareClose( bool bUI )
 
     bool bRet = SfxObjectShell::PrepareClose( bUI );
     if (bRet) // true == close
-        aDocument.EnableIdle(false); // Do not mess around with it anymore!
+        m_aDocument.EnableIdle(false); // Do not mess around with it anymore!
 
     return bRet;
 }
@@ -2686,7 +2686,7 @@ void ScDocShell::PrepareReload()
     //  This causes a hang.
     //
     //  Thus: Disconnect the DDE Links of the old Document before Reload
-    aDocument.GetDocLinkManager().disconnectDdeLinks();
+    m_aDocument.GetDocLinkManager().disconnectDdeLinks();
 }
 
 OUString ScDocShell::GetOwnFilterName()
@@ -2750,85 +2750,85 @@ ScDocShell::ScDocShell( const ScDocShell& rShell ) :
     SotObject(),
     SfxObjectShell( rShell.GetCreateMode() ),
     SfxListener(),
-    aDocument       ( SCDOCMODE_DOCUMENT, this ),
-    aDdeTextFmt(OUString("TEXT")),
-    nPrtToScreenFactor( 1.0 ),
-    pImpl           ( new DocShell_Impl ),
-    bHeaderOn       ( true ),
-    bFooterOn       ( true ),
-    bIsEmpty        ( true ),
-    bIsInUndo       ( false ),
-    bDocumentModifiedPending( false ),
-    bUpdateEnabled  ( true ),
-    mbUcalcTest(rShell.mbUcalcTest),
-    nDocumentLock   ( 0 ),
-    nCanUpdate (css::document::UpdateDocMode::ACCORDING_TO_CONFIG),
-    pOldAutoDBRange ( nullptr ),
-    pAutoStyleList  ( nullptr ),
-    pPaintLockData  ( nullptr ),
-    pSolverSaveData ( nullptr ),
-    pSheetSaveData  ( nullptr ),
-    mpFormatSaveData( nullptr ),
-    pModificator    ( nullptr )
+    m_aDocument       ( SCDOCMODE_DOCUMENT, this ),
+    m_aDdeTextFmt(OUString("TEXT")),
+    m_nPrtToScreenFactor( 1.0 ),
+    m_pImpl           ( new DocShell_Impl ),
+    m_bHeaderOn       ( true ),
+    m_bFooterOn       ( true ),
+    m_bIsEmpty        ( true ),
+    m_bIsInUndo       ( false ),
+    m_bDocumentModifiedPending( false ),
+    m_bUpdateEnabled  ( true ),
+    m_bUcalcTest(rShell.m_bUcalcTest),
+    m_nDocumentLock   ( 0 ),
+    m_nCanUpdate (css::document::UpdateDocMode::ACCORDING_TO_CONFIG),
+    m_pOldAutoDBRange ( nullptr ),
+    m_pAutoStyleList  ( nullptr ),
+    m_pPaintLockData  ( nullptr ),
+    m_pSolverSaveData ( nullptr ),
+    m_pSheetSaveData  ( nullptr ),
+    m_pFormatSaveData( nullptr ),
+    m_pModificator    ( nullptr )
 {
     SetPool( &SC_MOD()->GetPool() );
 
-    bIsInplace = rShell.bIsInplace;
+    m_bIsInplace = rShell.m_bIsInplace;
 
-    pDocFunc = CreateDocFunc();
+    m_pDocFunc = CreateDocFunc();
 
     //  SetBaseModel needs exception handling
     ScModelObj::CreateAndSet( this );
 
     StartListening(*this);
-    SfxStyleSheetPool* pStlPool = aDocument.GetStyleSheetPool();
+    SfxStyleSheetPool* pStlPool = m_aDocument.GetStyleSheetPool();
     if (pStlPool)
         StartListening(*pStlPool);
 
-    GetPageOnFromPageStyleSet( nullptr, 0, bHeaderOn, bFooterOn );
+    GetPageOnFromPageStyleSet( nullptr, 0, m_bHeaderOn, m_bFooterOn );
 
     // InitItems and CalcOutputFactor are called now in Load/ConvertFrom/InitNew
 }
 
 ScDocShell::ScDocShell( const SfxModelFlags i_nSfxCreationFlags ) :
     SfxObjectShell( i_nSfxCreationFlags ),
-    aDocument       ( SCDOCMODE_DOCUMENT, this ),
-    aDdeTextFmt(OUString("TEXT")),
-    nPrtToScreenFactor( 1.0 ),
-    pImpl           ( new DocShell_Impl ),
-    bHeaderOn       ( true ),
-    bFooterOn       ( true ),
-    bIsEmpty        ( true ),
-    bIsInUndo       ( false ),
-    bDocumentModifiedPending( false ),
-    bUpdateEnabled  ( true ),
-    mbUcalcTest     ( false ),
-    nDocumentLock   ( 0 ),
-    nCanUpdate (css::document::UpdateDocMode::ACCORDING_TO_CONFIG),
-    pOldAutoDBRange ( nullptr ),
-    pAutoStyleList  ( nullptr ),
-    pPaintLockData  ( nullptr ),
-    pSolverSaveData ( nullptr ),
-    pSheetSaveData  ( nullptr ),
-    mpFormatSaveData( nullptr ),
-    pModificator    ( nullptr )
+    m_aDocument       ( SCDOCMODE_DOCUMENT, this ),
+    m_aDdeTextFmt(OUString("TEXT")),
+    m_nPrtToScreenFactor( 1.0 ),
+    m_pImpl           ( new DocShell_Impl ),
+    m_bHeaderOn       ( true ),
+    m_bFooterOn       ( true ),
+    m_bIsEmpty        ( true ),
+    m_bIsInUndo       ( false ),
+    m_bDocumentModifiedPending( false ),
+    m_bUpdateEnabled  ( true ),
+    m_bUcalcTest     ( false ),
+    m_nDocumentLock   ( 0 ),
+    m_nCanUpdate (css::document::UpdateDocMode::ACCORDING_TO_CONFIG),
+    m_pOldAutoDBRange ( nullptr ),
+    m_pAutoStyleList  ( nullptr ),
+    m_pPaintLockData  ( nullptr ),
+    m_pSolverSaveData ( nullptr ),
+    m_pSheetSaveData  ( nullptr ),
+    m_pFormatSaveData( nullptr ),
+    m_pModificator    ( nullptr )
 {
     SetPool( &SC_MOD()->GetPool() );
 
-    bIsInplace = (GetCreateMode() == SfxObjectCreateMode::EMBEDDED);
+    m_bIsInplace = (GetCreateMode() == SfxObjectCreateMode::EMBEDDED);
     //  Will be reset if not in place
 
-    pDocFunc = CreateDocFunc();
+    m_pDocFunc = CreateDocFunc();
 
     //  SetBaseModel needs exception handling
     ScModelObj::CreateAndSet( this );
 
     StartListening(*this);
-    SfxStyleSheetPool* pStlPool = aDocument.GetStyleSheetPool();
+    SfxStyleSheetPool* pStlPool = m_aDocument.GetStyleSheetPool();
     if (pStlPool)
         StartListening(*pStlPool);
 
-    aDocument.GetDBCollection()->SetRefreshHandler(
+    m_aDocument.GetDBCollection()->SetRefreshHandler(
         LINK( this, ScDocShell, RefreshDBDataHdl ) );
 
     // InitItems and CalcOutputFactor are called now in Load/ConvertFrom/InitNew
@@ -2838,39 +2838,39 @@ ScDocShell::~ScDocShell()
 {
     ResetDrawObjectShell(); // If the Drawing Layer still tries to access it, access it
 
-    SfxStyleSheetPool* pStlPool = aDocument.GetStyleSheetPool();
+    SfxStyleSheetPool* pStlPool = m_aDocument.GetStyleSheetPool();
     if (pStlPool)
         EndListening(*pStlPool);
     EndListening(*this);
 
-    delete pAutoStyleList;
+    delete m_pAutoStyleList;
 
     SfxApplication *pSfxApp = SfxGetpApp();
     if ( pSfxApp->GetDdeService() ) // Delete DDE for Document
         pSfxApp->RemoveDdeTopic( this );
 
-    delete pDocFunc;
-    delete aDocument.mpUndoManager;
-    aDocument.mpUndoManager = nullptr;
-    delete pImpl;
+    delete m_pDocFunc;
+    delete m_aDocument.mpUndoManager;
+    m_aDocument.mpUndoManager = nullptr;
+    delete m_pImpl;
 
-    delete pPaintLockData;
+    delete m_pPaintLockData;
 
-    delete pSolverSaveData;
-    delete pSheetSaveData;
-    delete mpFormatSaveData;
-    delete pOldAutoDBRange;
+    delete m_pSolverSaveData;
+    delete m_pSheetSaveData;
+    delete m_pFormatSaveData;
+    delete m_pOldAutoDBRange;
 
-    if (pModificator)
+    if (m_pModificator)
     {
         OSL_FAIL("The Modificator should not exist");
-        delete pModificator;
+        delete m_pModificator;
     }
 }
 
 ::svl::IUndoManager* ScDocShell::GetUndoManager()
 {
-    return aDocument.GetUndoManager();
+    return m_aDocument.GetUndoManager();
 }
 
 void ScDocShell::SetModified( bool bModified )
@@ -2888,32 +2888,32 @@ void ScDocShell::SetDocumentModified()
     //  FIXME: Also for SetDrawModified, if Drawing is connected
     //  FIXME: Then own Hint?
 
-    if ( pPaintLockData )
+    if ( m_pPaintLockData )
     {
         // #i115009# broadcast BCA_BRDCST_ALWAYS, so a component can read recalculated results
         // of RecalcModeAlways formulas (like OFFSET) after modifying cells
-        aDocument.Broadcast(ScHint(SfxHintId::ScDataChanged, BCA_BRDCST_ALWAYS));
-        aDocument.InvalidateTableArea();    // #i105279# needed here
-        aDocument.BroadcastUno( SfxHint( SfxHintId::DataChanged ) );
+        m_aDocument.Broadcast(ScHint(SfxHintId::ScDataChanged, BCA_BRDCST_ALWAYS));
+        m_aDocument.InvalidateTableArea();    // #i105279# needed here
+        m_aDocument.BroadcastUno( SfxHint( SfxHintId::DataChanged ) );
 
-        pPaintLockData->SetModified(); // Later on ...
+        m_pPaintLockData->SetModified(); // Later on ...
         return;
     }
 
     SetDrawModified();
 
-    if ( aDocument.IsAutoCalcShellDisabled() )
+    if ( m_aDocument.IsAutoCalcShellDisabled() )
         SetDocumentModifiedPending( true );
     else
     {
         SetDocumentModifiedPending( false );
-        aDocument.InvalidateStyleSheetUsage();
-        aDocument.InvalidateTableArea();
-        aDocument.InvalidateLastTableOpParams();
-        aDocument.Broadcast(ScHint(SfxHintId::ScDataChanged, BCA_BRDCST_ALWAYS));
-        if ( aDocument.IsForcedFormulaPending() && aDocument.GetAutoCalc() )
-            aDocument.CalcFormulaTree( true );
-        aDocument.RefreshDirtyTableColumnNames();
+        m_aDocument.InvalidateStyleSheetUsage();
+        m_aDocument.InvalidateTableArea();
+        m_aDocument.InvalidateLastTableOpParams();
+        m_aDocument.Broadcast(ScHint(SfxHintId::ScDataChanged, BCA_BRDCST_ALWAYS));
+        if ( m_aDocument.IsForcedFormulaPending() && m_aDocument.GetAutoCalc() )
+            m_aDocument.CalcFormulaTree( true );
+        m_aDocument.RefreshDirtyTableColumnNames();
         PostDataChanged();
 
         //  Detective AutoUpdate:
@@ -2921,17 +2921,17 @@ void ScDocShell::SetDocumentModified()
         //  "Trace Error" entries (Trace Error can look completely different
         //  after changes to non-formula cells).
 
-        ScDetOpList* pList = aDocument.GetDetOpList();
-        if ( pList && ( aDocument.IsDetectiveDirty() || pList->HasAddError() ) &&
+        ScDetOpList* pList = m_aDocument.GetDetOpList();
+        if ( pList && ( m_aDocument.IsDetectiveDirty() || pList->HasAddError() ) &&
              pList->Count() && !IsInUndo() && SC_MOD()->GetAppOptions().GetDetectiveAuto() )
         {
             GetDocFunc().DetectiveRefresh(true);    // sal_True = caused by automatic update
         }
-        aDocument.SetDetectiveDirty(false);         // always reset, also if not refreshed
+        m_aDocument.SetDetectiveDirty(false);         // always reset, also if not refreshed
     }
 
     // notify UNO objects after BCA_BRDCST_ALWAYS etc.
-    aDocument.BroadcastUno( SfxHint( SfxHintId::DataChanged ) );
+    m_aDocument.BroadcastUno( SfxHint( SfxHintId::DataChanged ) );
 }
 
 /**
@@ -2966,9 +2966,9 @@ void ScDocShell::SetDrawModified()
         pBindings->Invalidate( SID_REPEAT );
     }
 
-    if ( aDocument.IsChartListenerCollectionNeedsUpdate() )
+    if ( m_aDocument.IsChartListenerCollectionNeedsUpdate() )
     {
-        aDocument.UpdateChartListenerCollection();
+        m_aDocument.UpdateChartListenerCollection();
         SfxGetpApp()->Broadcast(SfxHint( SfxHintId::ScDrawChanged ));    // Navigator
     }
     SC_MOD()->AnythingChanged();
@@ -2976,14 +2976,14 @@ void ScDocShell::SetDrawModified()
 
 void ScDocShell::SetInUndo(bool bSet)
 {
-    bIsInUndo = bSet;
+    m_bIsInUndo = bSet;
 }
 
 void ScDocShell::GetDocStat( ScDocStat& rDocStat )
 {
     SfxPrinter* pPrinter = GetPrinter();
 
-    aDocument.GetDocStat( rDocStat );
+    m_aDocument.GetDocStat( rDocStat );
     rDocStat.nPageCount = 0;
 
     if ( pPrinter )
@@ -3024,24 +3024,24 @@ vcl::Window* ScDocShell::GetActiveDialogParent()
 
 void ScDocShell::SetSolverSaveData( const ScOptSolverSave& rData )
 {
-    delete pSolverSaveData;
-    pSolverSaveData = new ScOptSolverSave( rData );
+    delete m_pSolverSaveData;
+    m_pSolverSaveData = new ScOptSolverSave( rData );
 }
 
 ScSheetSaveData* ScDocShell::GetSheetSaveData()
 {
-    if (!pSheetSaveData)
-        pSheetSaveData = new ScSheetSaveData;
+    if (!m_pSheetSaveData)
+        m_pSheetSaveData = new ScSheetSaveData;
 
-    return pSheetSaveData;
+    return m_pSheetSaveData;
 }
 
 ScFormatSaveData* ScDocShell::GetFormatSaveData()
 {
-    if (!mpFormatSaveData)
-        mpFormatSaveData = new ScFormatSaveData;
+    if (!m_pFormatSaveData)
+        m_pFormatSaveData = new ScFormatSaveData;
 
-    return mpFormatSaveData;
+    return m_pFormatSaveData;
 }
 
 namespace {
@@ -3181,15 +3181,15 @@ void ScDocShell::ResetKeyBindings( ScOptionsUtil::KeyBindingType eType )
 
 void ScDocShell::UseSheetSaveEntries()
 {
-    if (pSheetSaveData)
+    if (m_pSheetSaveData)
     {
-        pSheetSaveData->UseSaveEntries();   // use positions from saved file for next saving
+        m_pSheetSaveData->UseSaveEntries();   // use positions from saved file for next saving
 
         bool bHasEntries = false;
-        SCTAB nTabCount = aDocument.GetTableCount();
+        SCTAB nTabCount = m_aDocument.GetTableCount();
         SCTAB nTab;
         for (nTab = 0; nTab < nTabCount; ++nTab)
-            if (pSheetSaveData->HasStreamPos(nTab))
+            if (m_pSheetSaveData->HasStreamPos(nTab))
                 bHasEntries = true;
 
         if (!bHasEntries)
@@ -3197,7 +3197,7 @@ void ScDocShell::UseSheetSaveEntries()
             // if no positions were set (for example, export to other format),
             // reset all "valid" flags
             for (nTab = 0; nTab < nTabCount; ++nTab)
-                aDocument.SetStreamValid(nTab, false);
+                m_aDocument.SetStreamValid(nTab, false);
         }
     }
 }
@@ -3247,14 +3247,14 @@ void ScDocShellModificator::SetDocumentModified()
 
 bool ScDocShell::IsChangeRecording() const
 {
-    ScChangeTrack* pChangeTrack = aDocument.GetChangeTrack();
+    ScChangeTrack* pChangeTrack = m_aDocument.GetChangeTrack();
     return pChangeTrack != nullptr;
 }
 
 bool ScDocShell::HasChangeRecordProtection() const
 {
     bool bRes = false;
-    ScChangeTrack* pChangeTrack = aDocument.GetChangeTrack();
+    ScChangeTrack* pChangeTrack = m_aDocument.GetChangeTrack();
     if (pChangeTrack)
         bRes = pChangeTrack->IsProtected();
     return bRes;
@@ -3266,14 +3266,14 @@ void ScDocShell::SetChangeRecording( bool bActivate )
 
     if (bActivate)
     {
-        aDocument.StartChangeTracking();
+        m_aDocument.StartChangeTracking();
         ScChangeViewSettings aChangeViewSet;
         aChangeViewSet.SetShowChanges(true);
-        aDocument.SetChangeViewSettings(aChangeViewSet);
+        m_aDocument.SetChangeViewSettings(aChangeViewSet);
     }
     else
     {
-        aDocument.EndChangeTracking();
+        m_aDocument.EndChangeTracking();
         PostPaintGridAll();
     }
 
@@ -3289,7 +3289,7 @@ void ScDocShell::SetChangeRecording( bool bActivate )
 
 void ScDocShell::SetProtectionPassword( const OUString &rNewPassword )
 {
-    ScChangeTrack* pChangeTrack = aDocument.GetChangeTrack();
+    ScChangeTrack* pChangeTrack = m_aDocument.GetChangeTrack();
     if (pChangeTrack)
     {
         bool bProtected = pChangeTrack->IsProtected();
@@ -3319,7 +3319,7 @@ void ScDocShell::SetProtectionPassword( const OUString &rNewPassword )
 bool ScDocShell::GetProtectionHash( /*out*/ css::uno::Sequence< sal_Int8 > &rPasswordHash )
 {
     bool bRes = false;
-    ScChangeTrack* pChangeTrack = aDocument.GetChangeTrack();
+    ScChangeTrack* pChangeTrack = m_aDocument.GetChangeTrack();
     if (pChangeTrack && pChangeTrack->IsProtected())
     {
         rPasswordHash = pChangeTrack->GetProtection();
@@ -3330,7 +3330,7 @@ bool ScDocShell::GetProtectionHash( /*out*/ css::uno::Sequence< sal_Int8 > &rPas
 
 void ScDocShell::SetIsInUcalc()
 {
-    mbUcalcTest = true;
+    m_bUcalcTest = true;
 }
 
 void ScDocShell::RegisterAutomationWorkbookObject(css::uno::Reference< ooo::vba::excel::XWorkbook > const& xWorkbook)
diff --git a/sc/source/ui/docshell/docsh2.cxx b/sc/source/ui/docshell/docsh2.cxx
index 8dff8eb694b2..f871c7de85f2 100644
--- a/sc/source/ui/docshell/docsh2.cxx
+++ b/sc/source/ui/docshell/docsh2.cxx
@@ -43,7 +43,7 @@ bool ScDocShell::InitNew( const uno::Reference < embed::XStorage >& xStor )
 {
     bool bRet = SfxObjectShell::InitNew( xStor );
 
-    aDocument.MakeTable(0);
+    m_aDocument.MakeTable(0);
 
     //  Additional tables are created by the first View, if bIsEmpty is still sal_True
     if( bRet )
@@ -57,10 +57,10 @@ bool ScDocShell::InitNew( const uno::Reference < embed::XStorage >& xStor )
     // InitOptions sets the document languages, must be called before CreateStandardStyles
     InitOptions(false);
 
-    aDocument.GetStyleSheetPool()->CreateStandardStyles();
-    aDocument.UpdStlShtPtrsFrmNms();
+    m_aDocument.GetStyleSheetPool()->CreateStandardStyles();
+    m_aDocument.UpdStlShtPtrsFrmNms();
 
-    if (!mbUcalcTest)
+    if (!m_bUcalcTest)
     {
         /* Create styles that are imported through Orcus */
 
@@ -73,8 +73,8 @@ bool ScDocShell::InitNew( const uno::Reference < embed::XStorage >& xStor )
         ScOrcusFilters* pOrcus = ScFormatFilter::Get().GetOrcusFilters();
         if (pOrcus)
         {
-            pOrcus->importODS_Styles(aDocument, aPath);
-            aDocument.GetStyleSheetPool()->setAllStandard();
+            pOrcus->importODS_Styles(m_aDocument, aPath);
+            m_aDocument.GetStyleSheetPool()->setAllStandard();
         }
     }
 
@@ -87,7 +87,7 @@ bool ScDocShell::InitNew( const uno::Reference < embed::XStorage >& xStor )
 
 void ScDocShell::SetEmpty(bool bSet)
 {
-    bIsEmpty = bSet;
+    m_bIsEmpty = bSet;
 }
 
 void ScDocShell::InitItems()
@@ -96,7 +96,7 @@ void ScDocShell::InitItems()
     // Printer Options are set in GetPrinter when printing
     UpdateFontList();
 
-    ScDrawLayer* pDrawLayer = aDocument.GetDrawLayer();
+    ScDrawLayer* pDrawLayer = m_aDocument.GetDrawLayer();
     if (pDrawLayer)
     {
         PutItem( SvxColorListItem  ( pDrawLayer->GetColorList(), SID_COLOR_TABLE ) );
@@ -108,7 +108,7 @@ void ScDocShell::InitItems()
         PutItem( SvxLineEndListItem ( pDrawLayer->GetLineEndList(), SID_LINEEND_LIST ) );
 
         // Other modifications after creation of the DrawLayer
-        pDrawLayer->SetNotifyUndoActionHdl( LINK( pDocFunc, ScDocFunc, NotifyDrawUndo ) );
+        pDrawLayer->SetNotifyUndoActionHdl( LINK( m_pDocFunc, ScDocFunc, NotifyDrawUndo ) );
     }
     else if (!utl::ConfigManager::IsFuzzing())
     {
@@ -117,12 +117,12 @@ void ScDocShell::InitItems()
     }
 
     if (!utl::ConfigManager::IsFuzzing() &&
-        (!aDocument.GetForbiddenCharacters() || !aDocument.IsValidAsianCompression() || !aDocument.IsValidAsianKerning()))
+        (!m_aDocument.GetForbiddenCharacters() || !m_aDocument.IsValidAsianCompression() || !m_aDocument.IsValidAsianKerning()))
     {
         //  get settings from SvxAsianConfig
         SvxAsianConfig aAsian;
 
-        if (!aDocument.GetForbiddenCharacters())
+        if (!m_aDocument.GetForbiddenCharacters())
         {
             // set forbidden characters if necessary
             uno::Sequence<lang::Locale> aLocales = aAsian.GetStartEndCharLocales();
@@ -141,41 +141,41 @@ void ScDocShell::InitItems()
                     xForbiddenTable->SetForbiddenCharacters( eLang, aForbidden );
                 }
 
-                aDocument.SetForbiddenCharacters( xForbiddenTable );
+                m_aDocument.SetForbiddenCharacters( xForbiddenTable );
             }
         }
 
-        if ( !aDocument.IsValidAsianCompression() )
+        if ( !m_aDocument.IsValidAsianCompression() )
         {
             // set compression mode from configuration if not already set (e.g. XML import)
-            aDocument.SetAsianCompression( aAsian.GetCharDistanceCompression() );
+            m_aDocument.SetAsianCompression( aAsian.GetCharDistanceCompression() );
         }
 
-        if ( !aDocument.IsValidAsianKerning() )
+        if ( !m_aDocument.IsValidAsianKerning() )
         {
             // set asian punctuation kerning from configuration if not already set (e.g. XML import)
-            aDocument.SetAsianKerning( !aAsian.IsKerningWesternTextOnly() );    // reversed
+            m_aDocument.SetAsianKerning( !aAsian.IsKerningWesternTextOnly() );    // reversed
         }
     }
 }
 
 void ScDocShell::ResetDrawObjectShell()
 {
-    ScDrawLayer* pDrawLayer = aDocument.GetDrawLayer();
+    ScDrawLayer* pDrawLayer = m_aDocument.GetDrawLayer();
     if (pDrawLayer)
         pDrawLayer->SetObjectShell( nullptr );
 }
 
 ScDrawLayer* ScDocShell::MakeDrawLayer()
 {
-    ScDrawLayer* pDrawLayer = aDocument.GetDrawLayer();
+    ScDrawLayer* pDrawLayer = m_aDocument.GetDrawLayer();
     if (!pDrawLayer)
     {
-        aDocument.InitDrawLayer(this);
-        pDrawLayer = aDocument.GetDrawLayer();
+        m_aDocument.InitDrawLayer(this);
+        pDrawLayer = m_aDocument.GetDrawLayer();
         InitItems(); // including Undo and Basic
         Broadcast( SfxHint( SfxHintId::ScDrawLayerNew ) );
-        if (nDocumentLock)
+        if (m_nDocumentLock)
             pDrawLayer->setLock(true);
     }
     return pDrawLayer;
diff --git a/sc/source/ui/docshell/docsh3.cxx b/sc/source/ui/docshell/docsh3.cxx
index 35f174613450..68f974a19f53 100644
--- a/sc/source/ui/docshell/docsh3.cxx
+++ b/sc/source/ui/docshell/docsh3.cxx
@@ -86,7 +86,7 @@ void ScDocShell::PostDataChanged()
 {
     Broadcast( SfxHint( SfxHintId::ScDataChanged ) );
     SfxGetpApp()->Broadcast(SfxHint( SfxHintId::ScAnyDataChanged ));      // Navigator
-    aDocument.PrepareFormulaCalc();
+    m_aDocument.PrepareFormulaCalc();
     //! notify navigator directly!
 }
 
@@ -113,7 +113,7 @@ void ScDocShell::PostPaint( const ScRangeList& rRanges, PaintPartFlags nPart, sa
         if (!ValidCol(nCol2)) nCol2 = MAXCOL;
         if (!ValidRow(nRow2)) nRow2 = MAXROW;
 
-        if ( pPaintLockData )
+        if ( m_pPaintLockData )
         {
             // #i54081# PaintPartFlags::Extras still has to be broadcast because it changes the
             // current sheet if it's invalid. All other flags added to pPaintLockData.
@@ -121,7 +121,7 @@ void ScDocShell::PostPaint( const ScRangeList& rRanges, PaintPartFlags nPart, sa
             if ( nLockPart != PaintPartFlags::NONE )
             {
                 //! nExtFlags ???
-                pPaintLockData->AddRange( ScRange( nCol1, nRow1, nTab1,
+                m_pPaintLockData->AddRange( ScRange( nCol1, nRow1, nTab1,
                                                    nCol2, nRow2, nTab2 ), nLockPart );
             }
 
@@ -141,7 +141,7 @@ void ScDocShell::PostPaint( const ScRangeList& rRanges, PaintPartFlags nPart, sa
 
                                                 // expand for the merged ones
         if (nExtFlags & SC_PF_TESTMERGE)
-            aDocument.ExtendMerge( nCol1, nRow1, nCol2, nRow2, nTab1 );
+            m_aDocument.ExtendMerge( nCol1, nRow1, nCol2, nRow2, nTab1 );
 
         if ( nCol1 != 0 || nCol2 != MAXCOL )
         {
@@ -151,7 +151,7 @@ void ScDocShell::PostPaint( const ScRangeList& rRanges, PaintPartFlags nPart, sa
             //  support of right-aligned text.
 
             if ( ( nExtFlags & SC_PF_WHOLEROWS ) ||
-                 aDocument.HasAttrib( nCol1,nRow1,nTab1,
+                 m_aDocument.HasAttrib( nCol1,nRow1,nTab1,
                                       MAXCOL,nRow2,nTab2, HasAttrFlags::Rotate | HasAttrFlags::RightOrCenter ) )
             {
                 nCol1 = 0;
@@ -199,7 +199,7 @@ void ScDocShell::PostPaintExtras()
 void ScDocShell::UpdatePaintExt( sal_uInt16& rExtFlags, const ScRange& rRange )
 {
     if ( ( rExtFlags & SC_PF_LINES ) == 0 &&
-         aDocument.HasAttrib( rRange, HasAttrFlags::Lines | HasAttrFlags::Shadow | HasAttrFlags::Conditional ) )
+         m_aDocument.HasAttrib( rRange, HasAttrFlags::Lines | HasAttrFlags::Shadow | HasAttrFlags::Conditional ) )
     {
         //  If the range contains lines, shadow or conditional formats,
         //  set SC_PF_LINES to include one extra cell in all directions.
@@ -209,7 +209,7 @@ void ScDocShell::UpdatePaintExt( sal_uInt16& rExtFlags, const ScRange& rRange )
 
     if ( ( rExtFlags & SC_PF_WHOLEROWS ) == 0 &&
          ( rRange.aStart.Col() != 0 || rRange.aEnd.Col() != MAXCOL ) &&
-         aDocument.HasAttrib( rRange, HasAttrFlags::Rotate | HasAttrFlags::RightOrCenter ) )
+         m_aDocument.HasAttrib( rRange, HasAttrFlags::Rotate | HasAttrFlags::RightOrCenter ) )
     {
         //  If the range contains (logically) right- or center-aligned cells,
         //  or rotated cells, set SC_PF_WHOLEROWS to paint the whole rows.
@@ -229,23 +229,23 @@ void ScDocShell::UpdatePaintExt( sal_uInt16& rExtFlags, SCCOL nStartCol, SCROW n
 
 void ScDocShell::LockPaint_Impl(bool bDoc)
 {
-    if ( !pPaintLockData )
-        pPaintLockData = new ScPaintLockData;
-    pPaintLockData->IncLevel(bDoc);
+    if ( !m_pPaintLockData )
+        m_pPaintLockData = new ScPaintLockData;
+    m_pPaintLockData->IncLevel(bDoc);
 }
 
 void ScDocShell::UnlockPaint_Impl(bool bDoc)
 {
-    if ( pPaintLockData )
+    if ( m_pPaintLockData )
     {
-        if ( pPaintLockData->GetLevel(bDoc) )
-            pPaintLockData->DecLevel(bDoc);
-        if (!pPaintLockData->GetLevel(!bDoc) && !pPaintLockData->GetLevel(bDoc))
+        if ( m_pPaintLockData->GetLevel(bDoc) )
+            m_pPaintLockData->DecLevel(bDoc);
+        if (!m_pPaintLockData->GetLevel(!bDoc) && !m_pPaintLockData->GetLevel(bDoc))
         {
             //     Execute Paint now
 
-            ScPaintLockData* pPaint = pPaintLockData;
-            pPaintLockData = nullptr;                      // don't continue collecting
+            ScPaintLockData* pPaint = m_pPaintLockData;
+            m_pPaintLockData = nullptr;                      // don't continue collecting
 
             ScRangeListRef xRangeList = pPaint->GetRangeList();
             if ( xRangeList.is() )
@@ -275,21 +275,21 @@ void ScDocShell::UnlockPaint_Impl(bool bDoc)
 
 void ScDocShell::LockDocument_Impl(sal_uInt16 nNew)
 {
-    if (!nDocumentLock)
+    if (!m_nDocumentLock)
     {
-        ScDrawLayer* pDrawLayer = aDocument.GetDrawLayer();
+        ScDrawLayer* pDrawLayer = m_aDocument.GetDrawLayer();
         if (pDrawLayer)
             pDrawLayer->setLock(true);
     }
-    nDocumentLock = nNew;
+    m_nDocumentLock = nNew;
 }
 
 void ScDocShell::UnlockDocument_Impl(sal_uInt16 nNew)
 {
-    nDocumentLock = nNew;
-    if (!nDocumentLock)
+    m_nDocumentLock = nNew;
+    if (!m_nDocumentLock)
     {
-        ScDrawLayer* pDrawLayer = aDocument.GetDrawLayer();
+        ScDrawLayer* pDrawLayer = m_aDocument.GetDrawLayer();
         if (pDrawLayer)
             pDrawLayer->setLock(false);
     }
@@ -299,14 +299,14 @@ void ScDocShell::SetLockCount(sal_uInt16 nNew)
 {
     if (nNew)                   // set
     {
-        if ( !pPaintLockData )
-            pPaintLockData = new ScPaintLockData;
-        pPaintLockData->SetDocLevel(nNew-1);
+        if ( !m_pPaintLockData )
+            m_pPaintLockData = new ScPaintLockData;
+        m_pPaintLockData->SetDocLevel(nNew-1);
         LockDocument_Impl(nNew);
     }
-    else if (pPaintLockData)    // delete
+    else if (m_pPaintLockData)    // delete
     {
-        pPaintLockData->SetDocLevel(0);  // at unlock, execute immediately
+        m_pPaintLockData->SetDocLevel(0);  // at unlock, execute immediately
         UnlockPaint_Impl(true);                 // now
         UnlockDocument_Impl(0);
     }
@@ -325,15 +325,15 @@ void ScDocShell::UnlockPaint()
 void ScDocShell::LockDocument()
 {
     LockPaint_Impl(true);
-    LockDocument_Impl(nDocumentLock + 1);
+    LockDocument_Impl(m_nDocumentLock + 1);
 }
 
 void ScDocShell::UnlockDocument()
 {
-    if (nDocumentLock)
+    if (m_nDocumentLock)
     {
         UnlockPaint_Impl(true);
-        UnlockDocument_Impl(nDocumentLock - 1);
+        UnlockDocument_Impl(m_nDocumentLock - 1);
     }
     else
     {
@@ -343,25 +343,25 @@ void ScDocShell::UnlockDocument()
 
 void ScDocShell::SetInplace( bool bInplace )
 {
-    if (bIsInplace != bInplace)
+    if (m_bIsInplace != bInplace)
     {
-        bIsInplace = bInplace;
+        m_bIsInplace = bInplace;
         CalcOutputFactor();
     }
 }
 
 void ScDocShell::CalcOutputFactor()
 {
-    if (bIsInplace)
+    if (m_bIsInplace)
     {
-        nPrtToScreenFactor = 1.0;           // otherwise it does not match the inactive display
+        m_nPrtToScreenFactor = 1.0;           // otherwise it does not match the inactive display
         return;
     }
 
     bool bTextWysiwyg = SC_MOD()->GetInputOptions().GetTextWysiwyg();
     if (bTextWysiwyg)
     {
-        nPrtToScreenFactor = 1.0;
+        m_nPrtToScreenFactor = 1.0;
         return;
     }
 
@@ -369,7 +369,7 @@ void ScDocShell::CalcOutputFactor()
             "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz01234567890123456789");
     long nPrinterWidth = 0;
     long nWindowWidth = 0;
-    const ScPatternAttr* pPattern = &aDocument.GetPool()->GetDefaultItem(ATTR_PATTERN);
+    const ScPatternAttr* pPattern = &m_aDocument.GetPool()->GetDefaultItem(ATTR_PATTERN);
 
     vcl::Font aDefFont;
     OutputDevice* pRefDev = GetRefDevice();
@@ -391,11 +391,11 @@ void ScDocShell::CalcOutputFactor()
     nWindowWidth = (long) ( nWindowWidth / ScGlobal::nScreenPPTX * HMM_PER_TWIPS );
 
     if (nPrinterWidth && nWindowWidth)
-        nPrtToScreenFactor = nPrinterWidth / (double) nWindowWidth;
+        m_nPrtToScreenFactor = nPrinterWidth / static_cast<double>(nWindowWidth);
     else
     {
         OSL_FAIL("GetTextSize returns 0 ??");
-        nPrtToScreenFactor = 1.0;
+        m_nPrtToScreenFactor = 1.0;
     }
 }
 
@@ -430,31 +430,31 @@ void ScDocShell::InitOptions(bool bForLoading)      // called from InitNew and L
         aDocOpt.SetDate( 30, 12, 1899);
     }
 
-    aDocument.SetDocOptions( aDocOpt );
-    aDocument.SetViewOptions( aViewOpt );
+    m_aDocument.SetDocOptions( aDocOpt );
+    m_aDocument.SetViewOptions( aViewOpt );
     SetFormulaOptions( aFormulaOpt, bForLoading );
 
     //  print options are now set directly before the printing
 
-    aDocument.SetLanguage( nDefLang, nCjkLang, nCtlLang );
+    m_aDocument.SetLanguage( nDefLang, nCjkLang, nCtlLang );
 }
 
 Printer* ScDocShell::GetDocumentPrinter()       // for OLE
 {
-    return aDocument.GetPrinter();
+    return m_aDocument.GetPrinter();
 }
 
 SfxPrinter* ScDocShell::GetPrinter(bool bCreateIfNotExist)
 {
-    return aDocument.GetPrinter(bCreateIfNotExist);
+    return m_aDocument.GetPrinter(bCreateIfNotExist);
 }
 
 void ScDocShell::UpdateFontList()
 {
-    delete pImpl->pFontList;
-    // pImpl->pFontList = new FontList( GetPrinter(), Application::GetDefaultDevice() );
-    pImpl->pFontList = new FontList(GetRefDevice(), nullptr);
-    SvxFontListItem aFontListItem( pImpl->pFontList, SID_ATTR_CHAR_FONTLIST );
+    delete m_pImpl->pFontList;
+    // m_pImpl->pFontList = new FontList( GetPrinter(), Application::GetDefaultDevice() );
+    m_pImpl->pFontList = new FontList(GetRefDevice(), nullptr);
+    SvxFontListItem aFontListItem( m_pImpl->pFontList, SID_ATTR_CHAR_FONTLIST );
     PutItem( aFontListItem );
 
     CalcOutputFactor();
@@ -462,21 +462,21 @@ void ScDocShell::UpdateFontList()
 
 OutputDevice* ScDocShell::GetRefDevice()
 {
-    return aDocument.GetRefDevice();
+    return m_aDocument.GetRefDevice();
 }
 
 sal_uInt16 ScDocShell::SetPrinter( VclPtr<SfxPrinter> const & pNewPrinter, SfxPrinterChangeFlags nDiffFlags )
 {
-    SfxPrinter *pOld = aDocument.GetPrinter( false );
+    SfxPrinter *pOld = m_aDocument.GetPrinter( false );
     if ( pOld && pOld->IsPrinting() )
         return SFX_PRINTERROR_BUSY;
 
     if (nDiffFlags & SfxPrinterChangeFlags::PRINTER)
     {
-        if ( aDocument.GetPrinter() != pNewPrinter )
+        if ( m_aDocument.GetPrinter() != pNewPrinter )
         {
-            aDocument.SetPrinter( pNewPrinter );
-            aDocument.SetPrintOptions();
+            m_aDocument.SetPrinter( pNewPrinter );
+            m_aDocument.SetPrintOptions();
 
             // MT: Use UpdateFontList: Will use Printer fonts only if needed!
             /*
@@ -507,7 +507,7 @@ sal_uInt16 ScDocShell::SetPrinter( VclPtr<SfxPrinter> const & pNewPrinter, SfxPr
     }
     else if (nDiffFlags & SfxPrinterChangeFlags::JOBSETUP)
     {
-        SfxPrinter* pOldPrinter = aDocument.GetPrinter();
+        SfxPrinter* pOldPrinter = m_aDocument.GetPrinter();
         if (pOldPrinter)
         {
             pOldPrinter->SetJobSetup( pNewPrinter->GetJobSetup() );
@@ -515,20 +515,20 @@ sal_uInt16 ScDocShell::SetPrinter( VclPtr<SfxPrinter> const & pNewPrinter, SfxPr
             //  #i6706# Call SetPrinter with the old printer again, so the drawing layer
             //  RefDevice is set (calling ReformatAllTextObjects and rebuilding charts),
             //  because the JobSetup (printer device settings) may affect text layout.
-            aDocument.SetPrinter( pOldPrinter );
+            m_aDocument.SetPrinter( pOldPrinter );
             CalcOutputFactor();                         // also with the new settings
         }
     }
 
     if (nDiffFlags & SfxPrinterChangeFlags::OPTIONS)
     {
-        aDocument.SetPrintOptions();        //! from new printer ???
+        m_aDocument.SetPrintOptions();        //! from new printer ???
     }
 
     if (nDiffFlags & (SfxPrinterChangeFlags::CHG_ORIENTATION | SfxPrinterChangeFlags::CHG_SIZE))
     {
-        OUString aStyle = aDocument.GetPageStyle( GetCurTab() );
-        ScStyleSheetPool* pStPl = aDocument.GetStyleSheetPool();
+        OUString aStyle = m_aDocument.GetPageStyle( GetCurTab() );
+        ScStyleSheetPool* pStPl = m_aDocument.GetStyleSheetPool();
         SfxStyleSheet* pStyleSheet = static_cast<SfxStyleSheet*>(pStPl->Find(aStyle, SfxStyleFamily::Page));
         if (pStyleSheet)
         {
@@ -657,17 +657,17 @@ void ScDocShell::ExecuteChangeCommentDialog( ScChangeAction* pAction, vcl::Windo
 
 void ScDocShell::CompareDocument( ScDocument& rOtherDoc )
 {
-    ScChangeTrack* pTrack = aDocument.GetChangeTrack();
+    ScChangeTrack* pTrack = m_aDocument.GetChangeTrack();
     if ( pTrack && pTrack->GetFirst() )
     {
         //! there are changes -> inquiry if needs to be deleted
     }
 
-    aDocument.EndChangeTracking();
-    aDocument.StartChangeTracking();
+    m_aDocument.EndChangeTracking();
+    m_aDocument.StartChangeTracking();
 
     OUString aOldUser;
-    pTrack = aDocument.GetChangeTrack();
+    pTrack = m_aDocument.GetChangeTrack();
     if ( pTrack )
     {
         aOldUser = pTrack->GetUser();
@@ -706,9 +706,9 @@ void ScDocShell::CompareDocument( ScDocument& rOtherDoc )
         }
     }
 
-    aDocument.CompareDocument( rOtherDoc );
+    m_aDocument.CompareDocument( rOtherDoc );
 
-    pTrack = aDocument.GetChangeTrack();
+    pTrack = m_aDocument.GetChangeTrack();
     if ( pTrack )
         pTrack->SetUser( aOldUser );
 
@@ -774,18 +774,18 @@ void ScDocShell::MergeDocument( ScDocument& rOtherDoc, bool bShared, bool bCheck
     if (!pSourceTrack)
         return;             //! nothing to do - error notification?
 
-    ScChangeTrack* pThisTrack = aDocument.GetChangeTrack();
+    ScChangeTrack* pThisTrack = m_aDocument.GetChangeTrack();
     if ( !pThisTrack )
     {   // turn on
-        aDocument.StartChangeTracking();
-        pThisTrack = aDocument.GetChangeTrack();
+        m_aDocument.StartChangeTracking();
+        pThisTrack = m_aDocument.GetChangeTrack();
         OSL_ENSURE(pThisTrack,"ChangeTracking not enabled?");
         if ( !bShared )
         {
             // turn on visual RedLining
             ScChangeViewSettings aChangeViewSet;
             aChangeViewSet.SetShowChanges(true);
-            aDocument.SetChangeViewSettings(aChangeViewSet);
+            m_aDocument.SetChangeViewSettings(aChangeViewSet);
         }
     }
 
@@ -892,7 +892,7 @@ void ScDocShell::MergeDocument( ScDocument& rOtherDoc, bool bShared, bool bCheck
         bool bMergeAction = false;
         if ( bShared )
         {
-            if ( !bCheckDuplicates || !lcl_FindAction( &rOtherDoc, pSourceAction, &aDocument, pFirstSearchAction, pLastSearchAction, bIgnore100Sec ) )
+            if ( !bCheckDuplicates || !lcl_FindAction( &rOtherDoc, pSourceAction, &m_aDocument, pFirstSearchAction, pLastSearchAction, bIgnore100Sec ) )
             {
                 bMergeAction = true;
             }
@@ -920,7 +920,7 @@ void ScDocShell::MergeDocument( ScDocument& rOtherDoc, bool bShared, bool bCheck
 #if OSL_DEBUG_LEVEL > 0
                 OUString aValue;
                 if ( eSourceType == SC_CAT_CONTENT )
-                    static_cast<const ScChangeActionContent*>(pSourceAction)->GetNewString( aValue, &aDocument );
+                    static_cast<const ScChangeActionContent*>(pSourceAction)->GetNewString( aValue, &m_aDocument );
                 SAL_WARN( "sc", aValue << " omitted");
 #endif
             }
@@ -982,7 +982,7 @@ void ScDocShell::MergeDocument( ScDocument& rOtherDoc, bool bShared, bool bCheck
                             OSL_ENSURE( aSourceRange.aStart == aSourceRange.aEnd, "huch?" );
                             ScAddress aPos = aSourceRange.aStart;
                             OUString aValue;
-                            static_cast<const ScChangeActionContent*>(pSourceAction)->GetNewString( aValue, &aDocument );
+                            static_cast<const ScChangeActionContent*>(pSourceAction)->GetNewString( aValue, &m_aDocument );
                             ScMatrixMode eMatrix = ScMatrixMode::NONE;
                             const ScCellValue& rCell = static_cast<const ScChangeActionContent*>(pSourceAction)->GetNewCell();
                             if (rCell.meType == CELLTYPE_FORMULA)
@@ -1013,7 +1013,7 @@ void ScDocShell::MergeDocument( ScDocument& rOtherDoc, bool bShared, bool bCheck
                         case SC_CAT_INSERT_TABS :
                         {
                             OUString aName;
-                            aDocument.CreateValidTabName( aName );
+                            m_aDocument.CreateValidTabName( aName );
                             (void)GetDocFunc().InsertTable( aSourceRange.aStart.Tab(), aName, true, false );
                         }
                         break;
@@ -1141,7 +1141,7 @@ bool ScDocShell::MergeSharedDocument( ScDocShell* pSharedDocShell )
         return false;
     }
 
-    ScChangeTrack* pThisTrack = aDocument.GetChangeTrack();
+    ScChangeTrack* pThisTrack = m_aDocument.GetChangeTrack();
     if ( !pThisTrack )
     {
         return false;
@@ -1157,7 +1157,7 @@ bool ScDocShell::MergeSharedDocument( ScDocShell* pSharedDocShell )
     // reset show changes
     ScChangeViewSettings aChangeViewSet;
     aChangeViewSet.SetShowChanges( false );
-    aDocument.SetChangeViewSettings( aChangeViewSet );
+    m_aDocument.SetChangeViewSettings( aChangeViewSet );
 
     // find first merge action in this document
     bool bIgnore100Sec = !pThisTrack->IsTimeNanoSeconds() || !pSharedTrack->IsTimeNanoSeconds();
@@ -1177,13 +1177,13 @@ bool ScDocShell::MergeSharedDocument( ScDocShell* pSharedDocShell )
             sal_uLong nActStartShared = pSharedAction->GetActionNumber();
             sal_uLong nActEndShared = pSharedTrack->GetActionMax();
             ScDocument* pTmpDoc = new ScDocument;
-            for ( sal_Int32 nIndex = 0; nIndex < aDocument.GetTableCount(); ++nIndex )
+            for ( sal_Int32 nIndex = 0; nIndex < m_aDocument.GetTableCount(); ++nIndex )
             {
                 OUString sTabName;
                 pTmpDoc->CreateValidTabName( sTabName );
                 pTmpDoc->InsertTab( SC_TAB_APPEND, sTabName );
             }
-            aDocument.GetChangeTrack()->Clone( pTmpDoc );
+            m_aDocument.GetChangeTrack()->Clone( pTmpDoc );
             ScChangeActionMergeMap aOwnInverseMergeMap;
             pSharedDocShell->MergeDocument( *pTmpDoc, true, true, 0, &aOwnInverseMergeMap, true );
             delete pTmpDoc;
@@ -1222,7 +1222,7 @@ bool ScDocShell::MergeSharedDocument( ScDocShell* pSharedDocShell )
 
             // clone change track for merging into own document
             pTmpDoc = new ScDocument;
-            for ( sal_Int32 nIndex = 0; nIndex < aDocument.GetTableCount(); ++nIndex )
+            for ( sal_Int32 nIndex = 0; nIndex < m_aDocument.GetTableCount(); ++nIndex )
             {
                 OUString sTabName;
                 pTmpDoc->CreateValidTabName( sTabName );
@@ -1267,7 +1267,7 @@ bool ScDocShell::MergeSharedDocument( ScDocShell* pSharedDocShell )
             aChangeViewSet.SetShowAccepted( true );
             aChangeViewSet.SetHasActionRange();
             aChangeViewSet.SetTheActionRange( nStartShared, nEndShared );
-            aDocument.SetChangeViewSettings( aChangeViewSet );
+            m_aDocument.SetChangeViewSettings( aChangeViewSet );
 
             // merge own changes back into own document
             sal_uLong nStartOwn = nEndShared + 1;
@@ -1310,7 +1310,7 @@ bool ScDocShell::MergeSharedDocument( ScDocShell* pSharedDocShell )
             aChangeViewSet.SetShowAccepted( true );
             aChangeViewSet.SetHasActionRange();
             aChangeViewSet.SetTheActionRange( nStartShared, nEndShared );
-            aDocument.SetChangeViewSettings( aChangeViewSet );
+            m_aDocument.SetChangeViewSettings( aChangeViewSet );
         }
 
         // update view
diff --git a/sc/source/ui/docshell/docsh4.cxx b/sc/source/ui/docshell/docsh4.cxx
index 598b6d8f77bb..22097e55c52c 100644
--- a/sc/source/ui/docshell/docsh4.cxx
+++ b/sc/source/ui/docshell/docsh4.cxx
@@ -116,7 +116,7 @@ void ScDocShell::Execute( SfxRequest& rReq )
 {
     const SfxItemSet* pReqArgs = rReq.GetArgs();
     SfxBindings* pBindings = GetViewBindings();
-    bool bUndo (aDocument.IsUndoEnabled());
+    bool bUndo (m_aDocument.IsUndoEnabled());
 
     sal_uInt16 nSlot = rReq.GetSlot();
     switch ( nSlot )
@@ -137,13 +137,13 @@ void ScDocShell::Execute( SfxRequest& rReq )
                 SCROW nRow = static_cast<const SfxInt32Item*>(pRowItem)->GetValue() - 1;
                 SCTAB nTab = static_cast<const SfxInt16Item*>(pTabItem)->GetValue() - 1;
 
-                SCTAB nTabCount = aDocument.GetTableCount();
+                SCTAB nTabCount = m_aDocument.GetTableCount();
                 if ( ValidCol(nCol) && ValidRow(nRow) && ValidTab(nTab,nTabCount) )
                 {
-                    if ( aDocument.IsBlockEditable( nTab, nCol,nRow, nCol, nRow ) )
+                    if ( m_aDocument.IsBlockEditable( nTab, nCol,nRow, nCol, nRow ) )
                     {
                         OUString aVal = static_cast<const SfxStringItem*>(pTextItem)->GetValue();
-                        aDocument.SetString( nCol, nRow, nTab, aVal );
+                        m_aDocument.SetString( nCol, nRow, nTab, aVal );
 
                         PostPaintCell( nCol, nRow, nTab );
                         SetDocumentModified();
@@ -192,11 +192,11 @@ void ScDocShell::Execute( SfxRequest& rReq )
                 bool bMakeArea = false;
                 if (bIsNewArea)
                 {
-                    ScDBCollection* pDBColl = aDocument.GetDBCollection();
+                    ScDBCollection* pDBColl = m_aDocument.GetDBCollection();
                     if ( !pDBColl || !pDBColl->getNamedDBs().findByUpperName(ScGlobal::pCharClass->uppercase(sTarget)) )
                     {
                         ScAddress aPos;
-                        if ( aPos.Parse( sTarget, &aDocument, aDocument.GetAddressConvention() ) & ScRefFlags::VALID )
+                        if ( aPos.Parse( sTarget, &m_aDocument, m_aDocument.GetAddressConvention() ) & ScRefFlags::VALID )
                         {
                             bMakeArea = true;
                             if (bUndo)
@@ -312,13 +312,13 @@ void ScDocShell::Execute( SfxRequest& rReq )
 
                     //! limit always or not at all ???
                     if (!bMultiRange)
-                        aDocument.LimitChartArea( nTab, nCol1,nRow1, nCol2,nRow2 );
+                        m_aDocument.LimitChartArea( nTab, nCol1,nRow1, nCol2,nRow2 );
 
                                         // Dialog for column/row headers
                     bool bOk = true;
                     if ( !bAddRange && ( !bColInit || !bRowInit ) )
                     {
-                        ScChartPositioner aChartPositioner( &aDocument, nTab, nCol1,nRow1, nCol2,nRow2 );
+                        ScChartPositioner aChartPositioner( &m_aDocument, nTab, nCol1,nRow1, nCol2,nRow2 );
                         if (!bColInit)
                             bColHeaders = aChartPositioner.HasColHeaders();
                         if (!bRowInit)
@@ -351,7 +351,7 @@ void ScDocShell::Execute( SfxRequest& rReq )
                                     new ScUndoChartData( this, aChartName, aRangeListRef,
                                                             bColHeaders, bRowHeaders, bAddRange ) );
                             }
-                            aDocument.UpdateChartArea( aChartName, aRangeListRef,
+                            m_aDocument.UpdateChartArea( aChartName, aRangeListRef,
                                                         bColHeaders, bRowHeaders, bAddRange );
                         }
                         else
@@ -363,7 +363,7 @@ void ScDocShell::Execute( SfxRequest& rReq )
                                     new ScUndoChartData( this, aChartName, aNewRange,
                                                             bColHeaders, bRowHeaders, bAddRange ) );
                             }
-                            aDocument.UpdateChartArea( aChartName, aNewRange,
+                            m_aDocument.UpdateChartArea( aChartName, aNewRange,
                                                         bColHeaders, bRowHeaders, bAddRange );
                         }
                     }
@@ -387,8 +387,8 @@ void ScDocShell::Execute( SfxRequest& rReq )
                 if ( pReqArgs && SfxItemState::SET == pReqArgs->GetItemState( nSlot, true, &pItem ) )
                     bNewVal = static_cast<const SfxBoolItem*>(pItem)->GetValue();
                 else
-                    bNewVal = !aDocument.GetAutoCalc();     // Toggle for menu
-                aDocument.SetAutoCalc( bNewVal );
+                    bNewVal = !m_aDocument.GetAutoCalc();     // Toggle for menu
+                m_aDocument.SetAutoCalc( bNewVal );
                 SetDocumentModified();
                 if (pBindings)
                 {
@@ -422,9 +422,9 @@ void ScDocShell::Execute( SfxRequest& rReq )
                     nSet=aAppOptions.GetLinkMode();
                 }
 
-                if (nCanUpdate == css::document::UpdateDocMode::NO_UPDATE)
+                if (m_nCanUpdate == css::document::UpdateDocMode::NO_UPDATE)
                     nSet = LM_NEVER;
-                else if (nCanUpdate == css::document::UpdateDocMode::FULL_UPDATE)
+                else if (m_nCanUpdate == css::document::UpdateDocMode::FULL_UPDATE)
                     nSet = LM_ALWAYS;
 
                 if (nSet == LM_ALWAYS
@@ -435,7 +435,7 @@ void ScDocShell::Execute( SfxRequest& rReq )
                 {
                     nSet = LM_ON_DEMAND;
                 }
-                if (nCanUpdate == css::document::UpdateDocMode::QUIET_UPDATE
+                if (m_nCanUpdate == css::document::UpdateDocMode::QUIET_UPDATE
                     && nSet == LM_ON_DEMAND)
                 {
                     nSet = LM_NEVER;
@@ -452,21 +452,21 @@ void ScDocShell::Execute( SfxRequest& rReq )
                 if (nDlgRet == RET_YES || nSet==LM_ALWAYS)
                 {
                     ReloadTabLinks();
-                    aDocument.UpdateExternalRefLinks(GetActiveDialogParent());
+                    m_aDocument.UpdateExternalRefLinks(GetActiveDialogParent());
 
-                    bool bAnyDde = aDocument.GetDocLinkManager().updateDdeOrOleOrWebServiceLinks(GetActiveDialogParent());
+                    bool bAnyDde = m_aDocument.GetDocLinkManager().updateDdeOrOleOrWebServiceLinks(GetActiveDialogParent());
 
                     if (bAnyDde)
                     {
                         //  calculate formulas and paint like in the TrackTimeHdl
-                        aDocument.TrackFormulas();
+                        m_aDocument.TrackFormulas();
                         Broadcast(SfxHint(SfxHintId::ScDataChanged));
 
                         //  Should FID_DATACHANGED become asynchronous some time

... etc. - the rest is truncated


More information about the Libreoffice-commits mailing list