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

Noel Grandin noel.grandin at collabora.co.uk
Tue Aug 29 18:01:07 UTC 2017


 sc/source/filter/inc/orcusinterface.hxx     |    2 +-
 sc/source/filter/inc/pivotcachebuffer.hxx   |    6 +++---
 sc/source/filter/inc/worksheetfragment.hxx  |    2 +-
 sc/source/filter/oox/pivotcachebuffer.cxx   |    6 +++---
 sc/source/filter/oox/workbookfragment.cxx   |    2 +-
 sc/source/filter/oox/worksheetfragment.cxx  |    2 +-
 sc/source/filter/orcus/interface.cxx        |    2 +-
 sc/source/filter/orcus/orcusfiltersimpl.cxx |    2 +-
 sc/source/ui/dbgui/scuiasciiopt.cxx         |    4 ++--
 sc/source/ui/dbgui/tpsubt.cxx               |    2 +-
 sc/source/ui/inc/instbdlg.hxx               |    2 +-
 sc/source/ui/inc/scuiasciiopt.hxx           |    2 +-
 sc/source/ui/inc/scuiautofmt.hxx            |    2 +-
 sc/source/ui/inc/scuitphfedit.hxx           |    6 +++---
 sc/source/ui/inc/tpdefaults.hxx             |    2 +-
 sc/source/ui/inc/tpsubt.hxx                 |    2 +-
 sc/source/ui/miscdlgs/instbdlg.cxx          |    2 +-
 sc/source/ui/miscdlgs/scuiautofmt.cxx       |    2 +-
 sc/source/ui/optdlg/tpdefaults.cxx          |    2 +-
 sc/source/ui/pagedlg/scuitphfedit.cxx       |    6 +++---
 sc/source/ui/vba/excelvbahelper.cxx         |    4 ++--
 sc/source/ui/vba/excelvbahelper.hxx         |    4 ++--
 sc/source/ui/vba/vbaborders.cxx             |   14 +++++++++-----
 sc/source/ui/vba/vbaborders.hxx             |    5 ++++-
 sc/source/ui/vba/vbacomments.cxx            |    2 +-
 sc/source/ui/vba/vbaoleobjects.cxx          |    5 ++++-
 sc/source/ui/vba/vbapagebreaks.cxx          |    6 +++---
 sc/source/ui/vba/vbapagebreaks.hxx          |    6 +++---
 sc/source/ui/vba/vbapivottables.cxx         |    2 +-
 sc/source/ui/vba/vbarange.cxx               |   10 +++++-----
 sc/source/ui/vba/vbarange.hxx               |    2 +-
 sc/source/ui/vba/vbawindows.cxx             |    2 +-
 sc/source/ui/vba/vbaworkbooks.cxx           |    4 +++-
 sc/source/ui/vba/vbaworksheet.cxx           |    4 ++--
 sc/source/ui/vba/vbaworksheets.cxx          |    2 +-
 sc/source/ui/vba/vbaworksheets.hxx          |    2 +-
 36 files changed, 72 insertions(+), 60 deletions(-)

New commits:
commit f8a900e81e397cbee9837312d16210b39443c850
Author: Noel Grandin <noel.grandin at collabora.co.uk>
Date:   Tue Aug 29 14:39:00 2017 +0200

    loplugin:constparam in sc part9
    
    Change-Id: If5bd37c48ee99210eb8f8a432b87a5e5235865bd
    Reviewed-on: https://gerrit.libreoffice.org/41702
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>

diff --git a/sc/source/filter/inc/orcusinterface.hxx b/sc/source/filter/inc/orcusinterface.hxx
index a6e62a1c870f..bfb844f0ba30 100644
--- a/sc/source/filter/inc/orcusinterface.hxx
+++ b/sc/source/filter/inc/orcusinterface.hxx
@@ -336,7 +336,7 @@ private:
         bool mbHasNumberFormatAttr;
 
         number_format();
-        void applyToItemSet(SfxItemSet& rSet, ScDocument& rDoc) const;
+        void applyToItemSet(SfxItemSet& rSet, const ScDocument& rDoc) const;
     };
 
     number_format maCurrentNumberFormat;
diff --git a/sc/source/filter/inc/pivotcachebuffer.hxx b/sc/source/filter/inc/pivotcachebuffer.hxx
index e3d5da48be9d..48c8fba055e7 100644
--- a/sc/source/filter/inc/pivotcachebuffer.hxx
+++ b/sc/source/filter/inc/pivotcachebuffer.hxx
@@ -275,7 +275,7 @@ public:
     void                writeSourceHeaderCell( const WorksheetHelper& rSheetHelper,
                             sal_Int32 nCol, sal_Int32 nRow ) const;
     /** Writes a source field item value into the passed sheet. */
-    void                writeSourceDataCell( WorksheetHelper& rSheetHelper,
+    void                writeSourceDataCell( const WorksheetHelper& rSheetHelper,
                             sal_Int32 nCol, sal_Int32 nRow,
                             const PivotCacheItem& rItem ) const;
 
@@ -385,13 +385,13 @@ public:
     /** Writes the titles of all source fields into the passed sheet. */
     void                writeSourceHeaderCells( const WorksheetHelper& rSheetHelper ) const;
     /** Writes a source field item value into the passed sheet. */
-    void                writeSourceDataCell( WorksheetHelper& rSheetHelper,
+    void                writeSourceDataCell( const WorksheetHelper& rSheetHelper,
                             sal_Int32 nColIdx, sal_Int32 nRowIdx,
                             const PivotCacheItem& rItem ) const;
 
     /** Reads a PCRECORD record and writes all item values to the passed sheet. */
     void                importPCRecord( SequenceInputStream& rStrm,
-                            WorksheetHelper& rSheetHelper, sal_Int32 nRowIdx ) const;
+                            const WorksheetHelper& rSheetHelper, sal_Int32 nRowIdx ) const;
 
 private:
 
diff --git a/sc/source/filter/inc/worksheetfragment.hxx b/sc/source/filter/inc/worksheetfragment.hxx
index 4993bc67f198..512412d24ea2 100644
--- a/sc/source/filter/inc/worksheetfragment.hxx
+++ b/sc/source/filter/inc/worksheetfragment.hxx
@@ -176,7 +176,7 @@ private:
     void                importControl( SequenceInputStream& rStrm );
 
     /** Imports the binary data of an embedded OLE object from the fragment with the passed ID. */
-    void                importEmbeddedOleData( StreamDataSequence& orEmbeddedData, const OUString& rRelId );
+    void                importEmbeddedOleData( const StreamDataSequence& orEmbeddedData, const OUString& rRelId );
 };
 
 } // namespace xls
diff --git a/sc/source/filter/oox/pivotcachebuffer.cxx b/sc/source/filter/oox/pivotcachebuffer.cxx
index b89ed20e8e27..25e9c241f207 100644
--- a/sc/source/filter/oox/pivotcachebuffer.cxx
+++ b/sc/source/filter/oox/pivotcachebuffer.cxx
@@ -760,7 +760,7 @@ void PivotCacheField::writeSourceHeaderCell( const WorksheetHelper& rSheetHelper
     rSheetHelper.getSheetData().setStringCell( aModel, maFieldModel.maName );
 }
 
-void PivotCacheField::writeSourceDataCell( WorksheetHelper& rSheetHelper, sal_Int32 nCol, sal_Int32 nRow, const PivotCacheItem& rItem ) const
+void PivotCacheField::writeSourceDataCell( const WorksheetHelper& rSheetHelper, sal_Int32 nCol, sal_Int32 nRow, const PivotCacheItem& rItem ) const
 {
     bool bHasIndex = rItem.getType() == XML_x;
     OSL_ENSURE( bHasIndex != maSharedItems.empty(), "PivotCacheField::writeSourceDataCell - shared items missing or not expected" );
@@ -1038,7 +1038,7 @@ void PivotCache::writeSourceHeaderCells( const WorksheetHelper& rSheetHelper ) c
         (*aIt)->writeSourceHeaderCell( rSheetHelper, nCol, nRow );
 }
 
-void PivotCache::writeSourceDataCell( WorksheetHelper& rSheetHelper, sal_Int32 nColIdx, sal_Int32 nRowIdx, const PivotCacheItem& rItem ) const
+void PivotCache::writeSourceDataCell( const WorksheetHelper& rSheetHelper, sal_Int32 nColIdx, sal_Int32 nRowIdx, const PivotCacheItem& rItem ) const
 {
     SCCOL nCol = maSheetSrcModel.maRange.aStart.Col() + nColIdx;
     OSL_ENSURE( ( maSheetSrcModel.maRange.aStart.Col() <= nCol ) && ( nCol <= maSheetSrcModel.maRange.aEnd.Col() ), "PivotCache::writeSourceDataCell - invalid column index" );
@@ -1049,7 +1049,7 @@ void PivotCache::writeSourceDataCell( WorksheetHelper& rSheetHelper, sal_Int32 n
         pCacheField->writeSourceDataCell( rSheetHelper, nCol, nRow, rItem );
 }
 
-void PivotCache::importPCRecord( SequenceInputStream& rStrm, WorksheetHelper& rSheetHelper, sal_Int32 nRowIdx ) const
+void PivotCache::importPCRecord( SequenceInputStream& rStrm, const WorksheetHelper& rSheetHelper, sal_Int32 nRowIdx ) const
 {
     SCROW nRow = maSheetSrcModel.maRange.aStart.Row() + nRowIdx;
     OSL_ENSURE( ( maSheetSrcModel.maRange.aStart.Row() < nRow ) && ( nRow <= maSheetSrcModel.maRange.aEnd.Row() ), "PivotCache::importPCRecord - invalid row index" );
diff --git a/sc/source/filter/oox/workbookfragment.cxx b/sc/source/filter/oox/workbookfragment.cxx
index 67a500e72322..17e51d8419e2 100644
--- a/sc/source/filter/oox/workbookfragment.cxx
+++ b/sc/source/filter/oox/workbookfragment.cxx
@@ -511,7 +511,7 @@ void WorkbookFragment::finalizeImport()
 
 namespace {
 
-ScDocShell& getDocShell(ScDocument& rDoc)
+ScDocShell& getDocShell(const ScDocument& rDoc)
 {
     return static_cast<ScDocShell&>(*rDoc.GetDocumentShell());
 }
diff --git a/sc/source/filter/oox/worksheetfragment.cxx b/sc/source/filter/oox/worksheetfragment.cxx
index 703593747c22..57a8d0051f44 100644
--- a/sc/source/filter/oox/worksheetfragment.cxx
+++ b/sc/source/filter/oox/worksheetfragment.cxx
@@ -895,7 +895,7 @@ void WorksheetFragment::importControl( SequenceInputStream& rStrm )
     getVmlDrawing().registerControl( aInfo );
 }
 
-void WorksheetFragment::importEmbeddedOleData( StreamDataSequence& orEmbeddedData, const OUString& rRelId )
+void WorksheetFragment::importEmbeddedOleData( const StreamDataSequence& orEmbeddedData, const OUString& rRelId )
 {
     OUString aFragmentPath = getFragmentPathFromRelId( rRelId );
     if( !aFragmentPath.isEmpty() )
diff --git a/sc/source/filter/orcus/interface.cxx b/sc/source/filter/orcus/interface.cxx
index 9c5ac689a954..9683661671cd 100644
--- a/sc/source/filter/orcus/interface.cxx
+++ b/sc/source/filter/orcus/interface.cxx
@@ -913,7 +913,7 @@ void ScOrcusStyles::border::applyToItemSet(SfxItemSet& rSet) const
     rSet.Put(aBoxItem);
 }
 
-void ScOrcusStyles::number_format::applyToItemSet(SfxItemSet& rSet, ScDocument& rDoc) const
+void ScOrcusStyles::number_format::applyToItemSet(SfxItemSet& rSet, const ScDocument& rDoc) const
 {
     sal_uInt32 nKey;
     sal_Int32 nCheckPos;
diff --git a/sc/source/filter/orcus/orcusfiltersimpl.cxx b/sc/source/filter/orcus/orcusfiltersimpl.cxx
index b7a68d40a711..6f1c2db3b3a6 100644
--- a/sc/source/filter/orcus/orcusfiltersimpl.cxx
+++ b/sc/source/filter/orcus/orcusfiltersimpl.cxx
@@ -41,7 +41,7 @@ using namespace com::sun::star;
 
 namespace {
 
-uno::Reference<task::XStatusIndicator> getStatusIndicator(SfxMedium& rMedium)
+uno::Reference<task::XStatusIndicator> getStatusIndicator(const SfxMedium& rMedium)
 {
     uno::Reference<task::XStatusIndicator> xStatusIndicator;
     SfxItemSet* pSet = rMedium.GetItemSet();
diff --git a/sc/source/ui/dbgui/scuiasciiopt.cxx b/sc/source/ui/dbgui/scuiasciiopt.cxx
index 15a7088e238a..7f9eac1ff9d9 100644
--- a/sc/source/ui/dbgui/scuiasciiopt.cxx
+++ b/sc/source/ui/dbgui/scuiasciiopt.cxx
@@ -85,7 +85,7 @@ static void lcl_FillCombo( ComboBox& rCombo, const OUString& rList, sal_Unicode
     }
 }
 
-static sal_Unicode lcl_CharFromCombo( ComboBox& rCombo, const OUString& rList )
+static sal_Unicode lcl_CharFromCombo( const ComboBox& rCombo, const OUString& rList )
 {
     sal_Unicode c = 0;
     OUString aStr = rCombo.GetText();
@@ -695,7 +695,7 @@ IMPL_LINK( ScImportAsciiDlg, SeparatorEditHdl, Edit&, rEdit, void )
 {
     SeparatorHdl(&rEdit);
 }
-void ScImportAsciiDlg::SeparatorHdl( Control* pCtrl )
+void ScImportAsciiDlg::SeparatorHdl( const Control* pCtrl )
 {
     OSL_ENSURE( pCtrl, "ScImportAsciiDlg::SeparatorHdl - missing sender" );
     OSL_ENSURE( !pRbFixed->IsChecked(), "ScImportAsciiDlg::SeparatorHdl - not allowed in fixed width" );
diff --git a/sc/source/ui/dbgui/tpsubt.cxx b/sc/source/ui/dbgui/tpsubt.cxx
index 70199ffcc796..bbc06737796b 100644
--- a/sc/source/ui/dbgui/tpsubt.cxx
+++ b/sc/source/ui/dbgui/tpsubt.cxx
@@ -351,7 +351,7 @@ IMPL_LINK( ScTpSubTotalGroup, SelectListBoxHdl, ListBox&, rLb, void )
 {
     SelectHdl(&rLb);
 }
-void ScTpSubTotalGroup::SelectHdl(void *pLb)
+void ScTpSubTotalGroup::SelectHdl(const void *pLb)
 {
     if (   (mpLbColumns->GetEntryCount() > 0)
         && (mpLbColumns->GetSelectionCount() > 0) )
diff --git a/sc/source/ui/inc/instbdlg.hxx b/sc/source/ui/inc/instbdlg.hxx
index 141a92a5a8cf..ff6900139df5 100644
--- a/sc/source/ui/inc/instbdlg.hxx
+++ b/sc/source/ui/inc/instbdlg.hxx
@@ -88,7 +88,7 @@ private:
     void    Init_Impl( bool bFromFile );
     void    SetNewTable_Impl();
     void    SetFromTo_Impl();
-    void    FillTables_Impl( ScDocument* pSrcDoc );
+    void    FillTables_Impl( const ScDocument* pSrcDoc );
     void    DoEnable_Impl();
 
     DECL_LINK( BrowseHdl_Impl, Button*, void );
diff --git a/sc/source/ui/inc/scuiasciiopt.hxx b/sc/source/ui/inc/scuiasciiopt.hxx
index 65848aa1ec7c..e25904e51569 100644
--- a/sc/source/ui/inc/scuiasciiopt.hxx
+++ b/sc/source/ui/inc/scuiasciiopt.hxx
@@ -120,7 +120,7 @@ private:
                                 DECL_LINK( SeparatorEditHdl, Edit&, void );
                                 DECL_LINK( SeparatorClickHdl, Button*, void );
                                 DECL_LINK( SeparatorComboBoxHdl, ComboBox&, void );
-                                void SeparatorHdl(Control*);
+                                void SeparatorHdl(const Control*);
                                 DECL_LINK( LbColTypeHdl, ListBox&, void );
                                 DECL_LINK( UpdateTextHdl, ScCsvTableBox&, void );
                                 DECL_LINK( ColTypeHdl, ScCsvTableBox&, void );
diff --git a/sc/source/ui/inc/scuiautofmt.hxx b/sc/source/ui/inc/scuiautofmt.hxx
index 1c4e4f4f1276..67adc8a6c7e1 100644
--- a/sc/source/ui/inc/scuiautofmt.hxx
+++ b/sc/source/ui/inc/scuiautofmt.hxx
@@ -26,7 +26,7 @@ public:
     ScAutoFormatDlg(vcl::Window* pParent,
                     ScAutoFormat* pAutoFormat,
                     const ScAutoFormatData* pSelFormatData,
-                    ScViewData *pViewData);
+                    const ScViewData *pViewData);
     virtual ~ScAutoFormatDlg() override;
     virtual void dispose() override;
 
diff --git a/sc/source/ui/inc/scuitphfedit.hxx b/sc/source/ui/inc/scuitphfedit.hxx
index 12a93772fdc6..0ac59c31eed1 100644
--- a/sc/source/ui/inc/scuitphfedit.hxx
+++ b/sc/source/ui/inc/scuitphfedit.hxx
@@ -94,9 +94,9 @@ private:
     void InsertToDefinedList();
     void RemoveFromDefinedList();
     void SetSelectDefinedList();
-    bool IsPageEntry(EditEngine*pEngine, EditTextObject* pTextObj);
-    static bool IsDateEntry(EditTextObject* pTextObj);
-    static bool IsExtFileNameEntry(EditTextObject* pTextObj);
+    bool IsPageEntry(EditEngine*pEngine, const EditTextObject* pTextObj);
+    static bool IsDateEntry(const EditTextObject* pTextObj);
+    static bool IsExtFileNameEntry(const EditTextObject* pTextObj);
     DECL_LINK( ListHdl_Impl, ListBox&, void);
     DECL_LINK( ClickHdl, Button*, void );
     DECL_LINK( MenuHdl, ScExtIButton&, void );
diff --git a/sc/source/ui/inc/tpdefaults.hxx b/sc/source/ui/inc/tpdefaults.hxx
index 287d13740abf..b93fe336c136 100644
--- a/sc/source/ui/inc/tpdefaults.hxx
+++ b/sc/source/ui/inc/tpdefaults.hxx
@@ -33,7 +33,7 @@ private:
 
     void CheckNumSheets();
     void CheckPrefix(Edit* pEdit);
-    void OnFocusPrefixInput(Edit* pEdit);
+    void OnFocusPrefixInput(const Edit* pEdit);
 
     DECL_LINK( NumModifiedHdl, Edit&, void );
     DECL_LINK( PrefixModifiedHdl, Edit&, void );
diff --git a/sc/source/ui/inc/tpsubt.hxx b/sc/source/ui/inc/tpsubt.hxx
index 08d2769b8d7c..26597193ad7e 100644
--- a/sc/source/ui/inc/tpsubt.hxx
+++ b/sc/source/ui/inc/tpsubt.hxx
@@ -73,7 +73,7 @@ private:
     DECL_LINK( SelectListBoxHdl, ListBox&, void );
     DECL_LINK( SelectTreeListBoxHdl, SvTreeListBox*, void );
     DECL_LINK( CheckHdl, SvTreeListBox*, void );
-    void SelectHdl(void *);
+    void SelectHdl(const void *);
 };
 
 class ScTpSubTotalGroup1 : public ScTpSubTotalGroup
diff --git a/sc/source/ui/miscdlgs/instbdlg.cxx b/sc/source/ui/miscdlgs/instbdlg.cxx
index cab40f8976c1..1dd51b7774b5 100644
--- a/sc/source/ui/miscdlgs/instbdlg.cxx
+++ b/sc/source/ui/miscdlgs/instbdlg.cxx
@@ -178,7 +178,7 @@ void ScInsertTableDlg::SetFromTo_Impl()
     }
 }
 
-void ScInsertTableDlg::FillTables_Impl( ScDocument* pSrcDoc )
+void ScInsertTableDlg::FillTables_Impl( const ScDocument* pSrcDoc )
 {
     m_pLbTables->SetUpdateMode( false );
     m_pLbTables->Clear();
diff --git a/sc/source/ui/miscdlgs/scuiautofmt.cxx b/sc/source/ui/miscdlgs/scuiautofmt.cxx
index b59fc2647153..3cbaff853680 100644
--- a/sc/source/ui/miscdlgs/scuiautofmt.cxx
+++ b/sc/source/ui/miscdlgs/scuiautofmt.cxx
@@ -54,7 +54,7 @@
 ScAutoFormatDlg::ScAutoFormatDlg(vcl::Window* pParent,
     ScAutoFormat* pAutoFormat,
     const ScAutoFormatData* pSelFormatData,
-    ScViewData *pViewData)
+    const ScViewData *pViewData)
     : ModalDialog(pParent, "AutoFormatTableDialog",
         "modules/scalc/ui/autoformattable.ui")
     , aStrTitle(ScResId(STR_ADD_AUTOFORMAT_TITLE))
diff --git a/sc/source/ui/optdlg/tpdefaults.cxx b/sc/source/ui/optdlg/tpdefaults.cxx
index bcc26d5aa5e9..a789d0b83db6 100644
--- a/sc/source/ui/optdlg/tpdefaults.cxx
+++ b/sc/source/ui/optdlg/tpdefaults.cxx
@@ -113,7 +113,7 @@ void ScTpDefaultsOptions::CheckPrefix(Edit* pEdit)
     }
 }
 
-void ScTpDefaultsOptions::OnFocusPrefixInput(Edit* pEdit)
+void ScTpDefaultsOptions::OnFocusPrefixInput(const Edit* pEdit)
 {
     if (!pEdit)
         return;
diff --git a/sc/source/ui/pagedlg/scuitphfedit.cxx b/sc/source/ui/pagedlg/scuitphfedit.cxx
index 8bffe1312ce2..99443f2e45ae 100644
--- a/sc/source/ui/pagedlg/scuitphfedit.cxx
+++ b/sc/source/ui/pagedlg/scuitphfedit.cxx
@@ -486,7 +486,7 @@ void ScHFEditPage::SetSelectDefinedList()
     m_pLbDefined->SelectEntryPos( sal::static_int_cast<sal_uInt16>( eSelectEntry ) );
 }
 
-bool ScHFEditPage::IsPageEntry(EditEngine*pEngine, EditTextObject* pTextObj)
+bool ScHFEditPage::IsPageEntry(EditEngine*pEngine, const EditTextObject* pTextObj)
 {
     if(!pEngine || !pTextObj)
         return false;
@@ -524,7 +524,7 @@ bool ScHFEditPage::IsPageEntry(EditEngine*pEngine, EditTextObject* pTextObj)
     return bReturn;
 }
 
-bool ScHFEditPage::IsDateEntry(EditTextObject* pTextObj)
+bool ScHFEditPage::IsDateEntry(const EditTextObject* pTextObj)
 {
     if(!pTextObj)
         return false;
@@ -543,7 +543,7 @@ bool ScHFEditPage::IsDateEntry(EditTextObject* pTextObj)
     return bReturn;
 }
 
-bool ScHFEditPage::IsExtFileNameEntry(EditTextObject* pTextObj)
+bool ScHFEditPage::IsExtFileNameEntry(const EditTextObject* pTextObj)
 {
     if(!pTextObj)
         return false;
diff --git a/sc/source/ui/vba/excelvbahelper.cxx b/sc/source/ui/vba/excelvbahelper.cxx
index b0ecaeb83245..b7f9180f6cc5 100644
--- a/sc/source/ui/vba/excelvbahelper.cxx
+++ b/sc/source/ui/vba/excelvbahelper.cxx
@@ -46,7 +46,7 @@ namespace vba {
 namespace excel {
 
 uno::Reference< sheet::XUnnamedDatabaseRanges >
-GetUnnamedDataBaseRanges( ScDocShell* pShell )
+GetUnnamedDataBaseRanges( const ScDocShell* pShell )
 {
     uno::Reference< frame::XModel > xModel;
     if ( pShell )
@@ -59,7 +59,7 @@ GetUnnamedDataBaseRanges( ScDocShell* pShell )
 // returns the XDatabaseRange for the autofilter on sheet (nSheet)
 // also populates sName with the name of range
 uno::Reference< sheet::XDatabaseRange >
-GetAutoFiltRange( ScDocShell* pShell, sal_Int16 nSheet )
+GetAutoFiltRange( const ScDocShell* pShell, sal_Int16 nSheet )
 {
     uno::Reference< sheet::XUnnamedDatabaseRanges > xUnnamedDBRanges( GetUnnamedDataBaseRanges( pShell ), uno::UNO_QUERY_THROW );
     uno::Reference< sheet::XDatabaseRange > xDataBaseRange;
diff --git a/sc/source/ui/vba/excelvbahelper.hxx b/sc/source/ui/vba/excelvbahelper.hxx
index 7fc8f4da5f66..1cb9ec86b4c5 100644
--- a/sc/source/ui/vba/excelvbahelper.hxx
+++ b/sc/source/ui/vba/excelvbahelper.hxx
@@ -48,10 +48,10 @@ ScTabViewShell* getCurrentBestViewShell( const css::uno::Reference< css::uno::XC
 SfxViewFrame* getViewFrame( const css::uno::Reference< css::frame::XModel >& xModel );
 
 /// @throws css::uno::RuntimeException
-css::uno::Reference< css::sheet::XUnnamedDatabaseRanges > GetUnnamedDataBaseRanges( ScDocShell* pShell );
+css::uno::Reference< css::sheet::XUnnamedDatabaseRanges > GetUnnamedDataBaseRanges( const ScDocShell* pShell );
 
 /// @throws css::uno::RuntimeException
-css::uno::Reference< css::sheet::XDatabaseRange > GetAutoFiltRange( ScDocShell* pShell, sal_Int16 nSheet );
+css::uno::Reference< css::sheet::XDatabaseRange > GetAutoFiltRange( const ScDocShell* pShell, sal_Int16 nSheet );
 /// @throws css::uno::RuntimeException
 css::uno::Reference< ooo::vba::XHelperInterface > getUnoSheetModuleObj( const css::uno::Reference< css::sheet::XSpreadsheet >& xSheet );
 /// @throws css::uno::RuntimeException
diff --git a/sc/source/ui/vba/vbaborders.cxx b/sc/source/ui/vba/vbaborders.cxx
index c9590e2cfbab..169597f39be1 100644
--- a/sc/source/ui/vba/vbaborders.cxx
+++ b/sc/source/ui/vba/vbaborders.cxx
@@ -55,7 +55,7 @@ private:
     uno::Reference< beans::XPropertySet > m_xProps;
     sal_Int32 m_LineType;
     ScVbaPalette m_Palette;
-    void setBorderLine( table::BorderLine& rBorderLine )
+    void setBorderLine( const table::BorderLine& rBorderLine )
     {
         table::TableBorder aTableBorder;
         m_xProps->getPropertyValue( sTableBorder ) >>= aTableBorder;
@@ -157,7 +157,7 @@ protected:
         return aServiceNames;
     }
 public:
-    ScVbaBorder( const uno::Reference< beans::XPropertySet > & xProps, const uno::Reference< uno::XComponentContext >& xContext, sal_Int32 lineType, ScVbaPalette& rPalette) : ScVbaBorder_Base( uno::Reference< XHelperInterface >( xProps, uno::UNO_QUERY ), xContext ), m_xProps( xProps ), m_LineType( lineType ), m_Palette( rPalette ) {}
+    ScVbaBorder( const uno::Reference< beans::XPropertySet > & xProps, const uno::Reference< uno::XComponentContext >& xContext, sal_Int32 lineType, const ScVbaPalette& rPalette) : ScVbaBorder_Base( uno::Reference< XHelperInterface >( xProps, uno::UNO_QUERY ), xContext ), m_xProps( xProps ), m_LineType( lineType ), m_Palette( rPalette ) {}
 
     // XBorder
     uno::Any SAL_CALL getColor() override
@@ -326,7 +326,7 @@ private:
         return getCount(); // error condition
     }
 public:
-    RangeBorders(  const uno::Reference< table::XCellRange >& xRange,  const uno::Reference< uno::XComponentContext > & xContext, ScVbaPalette& rPalette ) : m_xRange( xRange ), m_xContext( xContext ), m_Palette( rPalette )
+    RangeBorders(  const uno::Reference< table::XCellRange >& xRange,  const uno::Reference< uno::XComponentContext > & xContext, const ScVbaPalette& rPalette ) : m_xRange( xRange ), m_xContext( xContext ), m_Palette( rPalette )
     {
     }
     // XIndexAccess
@@ -356,7 +356,7 @@ public:
 };
 
 uno::Reference< container::XIndexAccess >
-rangeToBorderIndexAccess( const uno::Reference< table::XCellRange >& xRange,  const uno::Reference< uno::XComponentContext > & xContext, ScVbaPalette& rPalette )
+rangeToBorderIndexAccess( const uno::Reference< table::XCellRange >& xRange,  const uno::Reference< uno::XComponentContext > & xContext, const ScVbaPalette& rPalette )
 {
     return new RangeBorders( xRange, xContext, rPalette );
 }
@@ -380,7 +380,11 @@ public:
     }
 };
 
-ScVbaBorders::ScVbaBorders( const uno::Reference< XHelperInterface >& xParent, const uno::Reference< uno::XComponentContext > & xContext, const uno::Reference< table::XCellRange >& xRange, ScVbaPalette& rPalette  ):  ScVbaBorders_BASE( xParent, xContext, rangeToBorderIndexAccess( xRange ,xContext, rPalette ) ), bRangeIsSingleCell( false )
+ScVbaBorders::ScVbaBorders( const uno::Reference< XHelperInterface >& xParent,
+                            const uno::Reference< uno::XComponentContext > & xContext,
+                            const uno::Reference< table::XCellRange >& xRange,
+                            const ScVbaPalette& rPalette  )
+    :  ScVbaBorders_BASE( xParent, xContext, rangeToBorderIndexAccess( xRange ,xContext, rPalette ) ), bRangeIsSingleCell( false )
 {
     uno::Reference< table::XColumnRowRange > xColumnRowRange(xRange, uno::UNO_QUERY_THROW );
     if ( xColumnRowRange->getRows()->getCount() == 1 && xColumnRowRange->getColumns()->getCount() == 1 )
diff --git a/sc/source/ui/vba/vbaborders.hxx b/sc/source/ui/vba/vbaborders.hxx
index 2d9d0b049a30..cb16b696633e 100644
--- a/sc/source/ui/vba/vbaborders.hxx
+++ b/sc/source/ui/vba/vbaborders.hxx
@@ -36,7 +36,10 @@ class ScVbaBorders : public ScVbaBorders_BASE
     bool bRangeIsSingleCell;
     css::uno::Reference< css::beans::XPropertySet > m_xProps;
 public:
-    ScVbaBorders( const css::uno::Reference< ov::XHelperInterface >& xParent, const css::uno::Reference< css::uno::XComponentContext > & xContext, const css::uno::Reference< css::table::XCellRange >& xRange, ScVbaPalette& rPalette );
+    ScVbaBorders( const css::uno::Reference< ov::XHelperInterface >& xParent,
+                  const css::uno::Reference< css::uno::XComponentContext > & xContext,
+                  const css::uno::Reference< css::table::XCellRange >& xRange,
+                  const ScVbaPalette& rPalette );
 
     // XEnumerationAccess
     virtual css::uno::Type SAL_CALL getElementType() override;
diff --git a/sc/source/ui/vba/vbacomments.cxx b/sc/source/ui/vba/vbacomments.cxx
index b78cc4eacf68..eb493f2c9ebf 100644
--- a/sc/source/ui/vba/vbacomments.cxx
+++ b/sc/source/ui/vba/vbacomments.cxx
@@ -26,7 +26,7 @@
 using namespace ::ooo::vba;
 using namespace ::com::sun::star;
 
-uno::Any AnnotationToComment( const uno::Any& aSource, uno::Reference< uno::XComponentContext > & xContext, const uno::Reference< frame::XModel >& xModel )
+uno::Any AnnotationToComment( const uno::Any& aSource, const uno::Reference< uno::XComponentContext > & xContext, const uno::Reference< frame::XModel >& xModel )
 {
     uno::Reference< sheet::XSheetAnnotation > xAnno( aSource, uno::UNO_QUERY_THROW );
     uno::Reference< container::XChild > xChild( xAnno, uno::UNO_QUERY_THROW );
diff --git a/sc/source/ui/vba/vbaoleobjects.cxx b/sc/source/ui/vba/vbaoleobjects.cxx
index c6cce4902c1d..5d285984fb77 100644
--- a/sc/source/ui/vba/vbaoleobjects.cxx
+++ b/sc/source/ui/vba/vbaoleobjects.cxx
@@ -82,7 +82,10 @@ class EnumWrapper : public EnumerationHelper_BASE
         uno::Reference<container::XIndexAccess > m_xIndexAccess;
         sal_Int32 nIndex;
 public:
-        EnumWrapper(  const uno::Reference< XHelperInterface >& xParent, const uno::Reference< uno::XComponentContext >& xContext, uno::Reference< container::XIndexAccess >& xIndexAccess ) :  m_xParent( xParent ), m_xContext( xContext), m_xIndexAccess( xIndexAccess ), nIndex( 0 ) {}
+        EnumWrapper( const uno::Reference< XHelperInterface >& xParent,
+                     const uno::Reference< uno::XComponentContext >& xContext,
+                     const uno::Reference< container::XIndexAccess >& xIndexAccess )
+            :  m_xParent( xParent ), m_xContext( xContext), m_xIndexAccess( xIndexAccess ), nIndex( 0 ) {}
 
         virtual sal_Bool SAL_CALL hasMoreElements(  ) override
         {
diff --git a/sc/source/ui/vba/vbapagebreaks.cxx b/sc/source/ui/vba/vbapagebreaks.cxx
index cf4c38245abf..93690140ffbe 100644
--- a/sc/source/ui/vba/vbapagebreaks.cxx
+++ b/sc/source/ui/vba/vbapagebreaks.cxx
@@ -35,7 +35,7 @@ private:
 public:
     RangePageBreaks( const uno::Reference< XHelperInterface >& xParent,
                      const uno::Reference< uno::XComponentContext >& xContext,
-                     uno::Reference< sheet::XSheetPageBreak >& xSheetPageBreak,
+                     const uno::Reference< sheet::XSheetPageBreak >& xSheetPageBreak,
                      bool bColumn ) : mxParent( xParent ), mxContext( xContext ), mxSheetPageBreak( xSheetPageBreak ), m_bColumn( bColumn )
     {
     }
@@ -208,7 +208,7 @@ public:
 
 ScVbaHPageBreaks::ScVbaHPageBreaks( const uno::Reference< XHelperInterface >& xParent,
                                     const uno::Reference< uno::XComponentContext >& xContext,
-                                    uno::Reference< sheet::XSheetPageBreak >& xSheetPageBreak):
+                                    const uno::Reference< sheet::XSheetPageBreak >& xSheetPageBreak):
                           ScVbaHPageBreaks_BASE( xParent,xContext, new RangePageBreaks( xParent, xContext, xSheetPageBreak, false ))
 {
 }
@@ -262,7 +262,7 @@ ScVbaHPageBreaks::getServiceNames()
 //VPageBreak
 ScVbaVPageBreaks::ScVbaVPageBreaks( const uno::Reference< XHelperInterface >& xParent,
                                     const uno::Reference< uno::XComponentContext >& xContext,
-                                    uno::Reference< sheet::XSheetPageBreak >& xSheetPageBreak )
+                                    const uno::Reference< sheet::XSheetPageBreak >& xSheetPageBreak )
 :   ScVbaVPageBreaks_BASE( xParent, xContext, new RangePageBreaks( xParent, xContext, xSheetPageBreak, true ) )
 {
 }
diff --git a/sc/source/ui/vba/vbapagebreaks.hxx b/sc/source/ui/vba/vbapagebreaks.hxx
index 58c217ada3d0..eabb12200fb2 100644
--- a/sc/source/ui/vba/vbapagebreaks.hxx
+++ b/sc/source/ui/vba/vbapagebreaks.hxx
@@ -40,8 +40,8 @@ class ScVbaHPageBreaks : public ScVbaHPageBreaks_BASE
 public:
     /// @throws css::uno::RuntimeException
     ScVbaHPageBreaks( const css::uno::Reference< ov::XHelperInterface >& xParent,
-                    const css::uno::Reference< css::uno::XComponentContext >& xContext,
-                    css::uno::Reference< css::sheet::XSheetPageBreak >& xSheetPageBreak);
+                      const css::uno::Reference< css::uno::XComponentContext >& xContext,
+                      const css::uno::Reference< css::sheet::XSheetPageBreak >& xSheetPageBreak);
 
     // XHPageBreaks
     virtual css::uno::Any SAL_CALL Add( const css::uno::Any& Before) override;
@@ -65,7 +65,7 @@ public:
     /// @throws css::uno::RuntimeException
     ScVbaVPageBreaks( const css::uno::Reference< ov::XHelperInterface >& xParent,
                       const css::uno::Reference< css::uno::XComponentContext >& xContext,
-                      css::uno::Reference< css::sheet::XSheetPageBreak >& xSheetPageBreak );
+                      const css::uno::Reference< css::sheet::XSheetPageBreak >& xSheetPageBreak );
 
     virtual ~ScVbaVPageBreaks() override;
 
diff --git a/sc/source/ui/vba/vbapivottables.cxx b/sc/source/ui/vba/vbapivottables.cxx
index f60c5e53b7db..13b2b46c0f5f 100644
--- a/sc/source/ui/vba/vbapivottables.cxx
+++ b/sc/source/ui/vba/vbapivottables.cxx
@@ -24,7 +24,7 @@
 using namespace ::com::sun::star;
 using namespace ::ooo::vba;
 
-uno::Any DataPilotToPivotTable( const uno::Any& aSource, uno::Reference< uno::XComponentContext > & xContext )
+uno::Any DataPilotToPivotTable( const uno::Any& aSource, const uno::Reference< uno::XComponentContext > & xContext )
 {
     uno::Reference< sheet::XDataPilotTable > xTable( aSource, uno::UNO_QUERY_THROW );
     return uno::makeAny( uno::Reference< excel::XPivotTable > ( new ScVbaPivotTable( xContext, xTable ) ) );
diff --git a/sc/source/ui/vba/vbarange.cxx b/sc/source/ui/vba/vbarange.cxx
index 216e158729ee..dec8b43ca9d8 100644
--- a/sc/source/ui/vba/vbarange.cxx
+++ b/sc/source/ui/vba/vbarange.cxx
@@ -1159,7 +1159,7 @@ ScVbaRange::getCellRangesForAddress( ScRefFlags& rResFlags, const OUString& sAdd
     return false;
 }
 
-bool getScRangeListForAddress( const OUString& sName, ScDocShell* pDocSh, ScRange& refRange, ScRangeList& aCellRanges, formula::FormulaGrammar::AddressConvention aConv )
+bool getScRangeListForAddress( const OUString& sName, ScDocShell* pDocSh, const ScRange& refRange, ScRangeList& aCellRanges, formula::FormulaGrammar::AddressConvention aConv )
 {
     // see if there is a match with a named range
     uno::Reference< beans::XPropertySet > xProps( pDocSh->GetModel(), uno::UNO_QUERY_THROW );
@@ -1232,7 +1232,7 @@ bool getScRangeListForAddress( const OUString& sName, ScDocShell* pDocSh, ScRang
 
 /// @throws uno::RuntimeException
 ScVbaRange*
-getRangeForName( const uno::Reference< uno::XComponentContext >& xContext, const OUString& sName, ScDocShell* pDocSh, table::CellRangeAddress& pAddr, formula::FormulaGrammar::AddressConvention eConv = formula::FormulaGrammar::CONV_XL_A1 )
+getRangeForName( const uno::Reference< uno::XComponentContext >& xContext, const OUString& sName, ScDocShell* pDocSh, const table::CellRangeAddress& pAddr, formula::FormulaGrammar::AddressConvention eConv = formula::FormulaGrammar::CONV_XL_A1 )
 {
     ScRangeList aCellRanges;
     ScRange refRange;
@@ -3280,7 +3280,7 @@ ScVbaRange::Find( const uno::Any& What, const uno::Any& After, const uno::Any& L
     return uno::Reference< excel::XRange >();
 }
 
-uno::Reference< table::XCellRange > processKey( const uno::Any& Key, uno::Reference<  uno::XComponentContext >& xContext, ScDocShell* pDocSh )
+uno::Reference< table::XCellRange > processKey( const uno::Any& Key, const uno::Reference<  uno::XComponentContext >& xContext, ScDocShell* pDocSh )
 {
     uno::Reference< excel::XRange > xKeyRange;
     if ( Key.getValueType() == cppu::UnoType<excel::XRange>::get() )
@@ -4250,7 +4250,7 @@ static ScDBData* lcl_GetDBData_Impl( ScDocShell* pDocShell, sal_Int16 nSheet )
     return pRet;
 }
 
-static void lcl_SelectAll( ScDocShell* pDocShell, ScQueryParam& aParam )
+static void lcl_SelectAll( const ScDocShell* pDocShell, const ScQueryParam& aParam )
 {
     if ( pDocShell )
     {
@@ -4281,7 +4281,7 @@ static void lcl_SetAllQueryForField( ScDocShell* pDocShell, SCCOLROW nField, sal
 }
 
 // Modifies sCriteria, and nOp depending on the value of sCriteria
-static void lcl_setTableFieldsFromCriteria( OUString& sCriteria1, uno::Reference< beans::XPropertySet >& xDescProps, sheet::TableFilterField2& rFilterField )
+static void lcl_setTableFieldsFromCriteria( OUString& sCriteria1, const uno::Reference< beans::XPropertySet >& xDescProps, sheet::TableFilterField2& rFilterField )
 {
     // #TODO make this more efficient and cycle through
     // sCriteria1 character by character to pick up <,<>,=, * etc.
diff --git a/sc/source/ui/vba/vbarange.hxx b/sc/source/ui/vba/vbarange.hxx
index cc63ead27f9a..425ee126deec 100644
--- a/sc/source/ui/vba/vbarange.hxx
+++ b/sc/source/ui/vba/vbarange.hxx
@@ -319,7 +319,7 @@ public:
 };
 
 /// @throws css::uno::RuntimeException
-bool getScRangeListForAddress( const OUString& sName, ScDocShell* pDocSh, ScRange& refRange,
+bool getScRangeListForAddress( const OUString& sName, ScDocShell* pDocSh, const ScRange& refRange,
                                ScRangeList& aCellRanges,
                                formula::FormulaGrammar::AddressConvention aConv = formula::FormulaGrammar::CONV_XL_A1 );
 
diff --git a/sc/source/ui/vba/vbawindows.cxx b/sc/source/ui/vba/vbawindows.cxx
index 324df72297ee..568488ff0e91 100644
--- a/sc/source/ui/vba/vbawindows.cxx
+++ b/sc/source/ui/vba/vbawindows.cxx
@@ -40,7 +40,7 @@ static uno::Reference< XHelperInterface > lcl_createWorkbookHIParent( const uno:
     return new ScVbaWorkbook( uno::Reference< XHelperInterface >( aApplication, uno::UNO_QUERY_THROW ), xContext,  xModel );
 }
 
-uno::Any ComponentToWindow( const uno::Any& aSource, uno::Reference< uno::XComponentContext > & xContext, const uno::Any& aApplication )
+uno::Any ComponentToWindow( const uno::Any& aSource, const uno::Reference< uno::XComponentContext > & xContext, const uno::Any& aApplication )
 {
     uno::Reference< frame::XModel > xModel( aSource, uno::UNO_QUERY_THROW );
     // !! TODO !! iterate over all controllers
diff --git a/sc/source/ui/vba/vbaworkbooks.cxx b/sc/source/ui/vba/vbaworkbooks.cxx
index 59928983559d..8b4f68e64f50 100644
--- a/sc/source/ui/vba/vbaworkbooks.cxx
+++ b/sc/source/ui/vba/vbaworkbooks.cxx
@@ -45,7 +45,9 @@ using namespace ::com::sun::star;
 const sal_Int16 CUSTOM_CHAR = 5;
 
 static uno::Any
-getWorkbook( uno::Reference< uno::XComponentContext >& xContext, const uno::Reference< sheet::XSpreadsheetDocument > &xDoc, const uno::Reference< XHelperInterface >& xParent )
+getWorkbook( const uno::Reference< uno::XComponentContext >& xContext,
+             const uno::Reference< sheet::XSpreadsheetDocument > &xDoc,
+             const uno::Reference< XHelperInterface >& xParent )
 {
     // FIXME: fine as long as ScVbaWorkbook is stateless ...
     uno::Reference< frame::XModel > xModel( xDoc, uno::UNO_QUERY );
diff --git a/sc/source/ui/vba/vbaworksheet.cxx b/sc/source/ui/vba/vbaworksheet.cxx
index 7ffddf9a4f99..265f3c46ad6b 100644
--- a/sc/source/ui/vba/vbaworksheet.cxx
+++ b/sc/source/ui/vba/vbaworksheet.cxx
@@ -100,7 +100,7 @@
 using namespace com::sun::star;
 using namespace ooo::vba;
 
-static void getNewSpreadsheetName (OUString &aNewName, const OUString& aOldName, uno::Reference <sheet::XSpreadsheetDocument>& xSpreadDoc )
+static void getNewSpreadsheetName (OUString &aNewName, const OUString& aOldName, const uno::Reference <sheet::XSpreadsheetDocument>& xSpreadDoc )
 {
     if (!xSpreadDoc.is())
         throw lang::IllegalArgumentException( "getNewSpreadsheetName() xSpreadDoc is null", uno::Reference< uno::XInterface  >(), 1 );
@@ -114,7 +114,7 @@ static void getNewSpreadsheetName (OUString &aNewName, const OUString& aOldName,
     }
 }
 
-static void removeAllSheets( uno::Reference <sheet::XSpreadsheetDocument>& xSpreadDoc, const OUString& aSheetName)
+static void removeAllSheets( const uno::Reference <sheet::XSpreadsheetDocument>& xSpreadDoc, const OUString& aSheetName)
 {
     if (!xSpreadDoc.is())
         throw lang::IllegalArgumentException( "removeAllSheets() xSpreadDoc is null", uno::Reference< uno::XInterface  >(), 1 );
diff --git a/sc/source/ui/vba/vbaworksheets.cxx b/sc/source/ui/vba/vbaworksheets.cxx
index 840d101806b4..7c209dd42bbe 100644
--- a/sc/source/ui/vba/vbaworksheets.cxx
+++ b/sc/source/ui/vba/vbaworksheets.cxx
@@ -480,7 +480,7 @@ ScVbaWorksheets::getServiceNames()
     return sNames;
 }
 
-bool ScVbaWorksheets::nameExists( uno::Reference <sheet::XSpreadsheetDocument>& xSpreadDoc, const OUString & name, SCTAB& nTab )
+bool ScVbaWorksheets::nameExists( const uno::Reference <sheet::XSpreadsheetDocument>& xSpreadDoc, const OUString & name, SCTAB& nTab )
 {
     if (!xSpreadDoc.is())
         throw lang::IllegalArgumentException( "nameExists() xSpreadDoc is null", uno::Reference< uno::XInterface  >(), 1 );
diff --git a/sc/source/ui/vba/vbaworksheets.hxx b/sc/source/ui/vba/vbaworksheets.hxx
index 26e8d227df67..95c644e7cf0b 100644
--- a/sc/source/ui/vba/vbaworksheets.hxx
+++ b/sc/source/ui/vba/vbaworksheets.hxx
@@ -62,7 +62,7 @@ public:
 
     /// @throws css::lang::IllegalArgumentException
     /// @throws css::uno::RuntimeException
-    static bool nameExists( css::uno::Reference <css::sheet::XSpreadsheetDocument>& xSpreadDoc, const OUString & name, SCTAB& nTab );
+    static bool nameExists( const css::uno::Reference <css::sheet::XSpreadsheetDocument>& xSpreadDoc, const OUString & name, SCTAB& nTab );
 };
 
 #endif // INCLUDED_SC_SOURCE_UI_VBA_VBAWORKSHEETS_HXX


More information about the Libreoffice-commits mailing list