diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2019-09-04 16:07:56 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2019-09-05 08:27:12 +0200 |
commit | 51fa45c8b8ee2ff37beef9639dc1ce5ed1e38e8f (patch) | |
tree | 8bcf0c069a72a6120e870170c43810b968c834b5 | |
parent | f8f606297d53eb216ff0c3c269de40058513e0a5 (diff) |
loplugin:constmethod in cui
Change-Id: I06ffacbb02f3e9088e9c1a51e0e3e0d65d356f62
Reviewed-on: https://gerrit.libreoffice.org/78602
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
41 files changed, 93 insertions, 92 deletions
diff --git a/cui/source/customize/CommandCategoryListBox.cxx b/cui/source/customize/CommandCategoryListBox.cxx index 1591e208b7cc..1df6422db190 100644 --- a/cui/source/customize/CommandCategoryListBox.cxx +++ b/cui/source/customize/CommandCategoryListBox.cxx @@ -482,7 +482,7 @@ void CommandCategoryListBox::SetStylesInfo(SfxStylesInfo_Impl* pStyles) } void CommandCategoryListBox::addChildren( - weld::TreeIter* parentEntry, const css::uno::Reference< css::script::browse::XBrowseNode > &parentNode, + const weld::TreeIter* parentEntry, const css::uno::Reference< css::script::browse::XBrowseNode > &parentNode, CuiConfigFunctionListBox* pFunctionListBox, const OUString& filterTerm , SaveInData *pCurrentSaveInData, std::vector<std::unique_ptr<weld::TreeIter>> &rNodesToExpand) { diff --git a/cui/source/customize/CustomNotebookbarGenerator.cxx b/cui/source/customize/CustomNotebookbarGenerator.cxx index dee8e141d37c..9bff37e428d7 100644 --- a/cui/source/customize/CustomNotebookbarGenerator.cxx +++ b/cui/source/customize/CustomNotebookbarGenerator.cxx @@ -176,7 +176,7 @@ static void searchNodeAndAttribute(xmlNode* pNodePtr, char* pUIItemID, char* pPr } } -static xmlDocPtr notebookbarXMLParser(char* pDocName, char* pUIItemID, char* pProperty, +static xmlDocPtr notebookbarXMLParser(const char* pDocName, char* pUIItemID, char* pProperty, char* pValue) { xmlDocPtr pDocPtr; diff --git a/cui/source/customize/SvxNotebookbarConfigPage.cxx b/cui/source/customize/SvxNotebookbarConfigPage.cxx index 40d26bada76d..521aafcfa67e 100644 --- a/cui/source/customize/SvxNotebookbarConfigPage.cxx +++ b/cui/source/customize/SvxNotebookbarConfigPage.cxx @@ -48,8 +48,8 @@ namespace container = com::sun::star::container; namespace beans = com::sun::star::beans; namespace graphic = com::sun::star::graphic; -static bool isCategoryAvailable(OUString& sClassId, OUString& sUIItemId, OUString& sActiveCategory, - bool& isCategory) +static bool isCategoryAvailable(const OUString& sClassId, const OUString& sUIItemId, + const OUString& sActiveCategory, bool& isCategory) { if (sUIItemId == sActiveCategory) return true; @@ -218,8 +218,9 @@ short SvxNotebookbarConfigPage::QueryReset() return nValue; } -void SvxConfigPage::InsertEntryIntoNotebookbarTabUI(OUString& sClassId, OUString& sUIItemId, - OUString& sUIItemCommand, int nPos, +void SvxConfigPage::InsertEntryIntoNotebookbarTabUI(const OUString& sClassId, + const OUString& sUIItemId, + const OUString& sUIItemCommand, int nPos, int nStartCol) { OUString sAppName, sFileName; @@ -519,8 +520,8 @@ SvxNotebookbarEntriesListBox::SvxNotebookbarEntriesListBox(std::unique_ptr<weld: SvxNotebookbarEntriesListBox::~SvxNotebookbarEntriesListBox() {} -static void EditRegistryFile(OUString& sUIItemId, OUString& sSetEntry, - OUString& sNotebookbarInterface) +static void EditRegistryFile(const OUString& sUIItemId, const OUString& sSetEntry, + const OUString& sNotebookbarInterface) { int nFlag = 0; Sequence<OUString> aOldEntries diff --git a/cui/source/customize/cfg.cxx b/cui/source/customize/cfg.cxx index e30cb708c99b..45319736b7db 100644 --- a/cui/source/customize/cfg.cxx +++ b/cui/source/customize/cfg.cxx @@ -1305,7 +1305,7 @@ OUString SvxConfigPage::GetScriptURL() const return result; } -OUString SvxConfigPage::GetSelectedDisplayName() +OUString SvxConfigPage::GetSelectedDisplayName() const { return m_xFunctions->get_selected_text(); } @@ -1873,17 +1873,17 @@ SvxConfigEntry::~SvxConfigEntry() } } -bool SvxConfigEntry::IsMovable() +bool SvxConfigEntry::IsMovable() const { return !IsPopup() || IsMain(); } -bool SvxConfigEntry::IsDeletable() +bool SvxConfigEntry::IsDeletable() const { return !IsMain() || IsUserDefined(); } -bool SvxConfigEntry::IsRenamable() +bool SvxConfigEntry::IsRenamable() const { return !IsMain() || IsUserDefined(); } diff --git a/cui/source/customize/cfgutil.cxx b/cui/source/customize/cfgutil.cxx index 1e675a682296..ebfc025ea27c 100644 --- a/cui/source/customize/cfgutil.cxx +++ b/cui/source/customize/cfgutil.cxx @@ -149,7 +149,7 @@ void SfxStylesInfo_Impl::getLabel4Style(SfxStyleInfo_Impl& aStyle) } } -std::vector< SfxStyleInfo_Impl > SfxStylesInfo_Impl::getStyleFamilies() +std::vector< SfxStyleInfo_Impl > SfxStylesInfo_Impl::getStyleFamilies() const { // It's an optional interface! css::uno::Reference< css::style::XStyleFamiliesSupplier > xModel(m_xDoc, css::uno::UNO_QUERY); @@ -255,7 +255,7 @@ OUString CuiConfigFunctionListBox::GetHelpText( bool bConsiderParent ) return OUString(); } -OUString CuiConfigFunctionListBox::GetCurCommand() +OUString CuiConfigFunctionListBox::GetCurCommand() const { SfxGroupInfo_Impl *pData = reinterpret_cast<SfxGroupInfo_Impl*>(get_selected_id().toInt64()); if (!pData) @@ -263,7 +263,7 @@ OUString CuiConfigFunctionListBox::GetCurCommand() return pData->sCommand; } -OUString CuiConfigFunctionListBox::GetCurLabel() +OUString CuiConfigFunctionListBox::GetCurLabel() const { SfxGroupInfo_Impl *pData = reinterpret_cast<SfxGroupInfo_Impl*>(get_selected_id().toInt64()); if (!pData) @@ -317,7 +317,7 @@ void CuiConfigFunctionListBox::ClearAll() m_xTreeView->clear(); } -OUString CuiConfigFunctionListBox::GetSelectedScriptURI() +OUString CuiConfigFunctionListBox::GetSelectedScriptURI() const { SfxGroupInfo_Impl *pData = reinterpret_cast<SfxGroupInfo_Impl*>(get_selected_id().toInt64()); if (pData && pData->nKind == SfxCfgKind::FUNCTION_SCRIPT) diff --git a/cui/source/customize/macropg.cxx b/cui/source/customize/macropg.cxx index 453a764db608..b75e48a9709f 100644 --- a/cui/source/customize/macropg.cxx +++ b/cui/source/customize/macropg.cxx @@ -397,7 +397,7 @@ IMPL_LINK_NOARG( SvxMacroTabPage_, DoubleClickHdl_Impl, weld::TreeView&, void) } // handler for double click on the listbox, and for the assign/delete buttons -void SvxMacroTabPage_::GenericHandler_Impl(SvxMacroTabPage_* pThis, weld::Button* pBtn) +void SvxMacroTabPage_::GenericHandler_Impl(SvxMacroTabPage_* pThis, const weld::Button* pBtn) { SvxMacroTabPage_Impl* pImpl = pThis->mpImpl.get(); weld::TreeView& rListBox = *pImpl->xEventLB; diff --git a/cui/source/dialogs/DiagramDialog.cxx b/cui/source/dialogs/DiagramDialog.cxx index f3b84c0fcc4e..4891ef93daee 100644 --- a/cui/source/dialogs/DiagramDialog.cxx +++ b/cui/source/dialogs/DiagramDialog.cxx @@ -49,7 +49,7 @@ IMPL_LINK_NOARG(DiagramDialog, OnAddClick, weld::Button&, void) } } -void DiagramDialog::populateTree(weld::TreeIter* pParent, const OUString& rParentId) +void DiagramDialog::populateTree(const weld::TreeIter* pParent, const OUString& rParentId) { auto aItems = mpDiagramData->getChildren(rParentId); for (auto& aItem : aItems) diff --git a/cui/source/dialogs/SpellDialog.cxx b/cui/source/dialogs/SpellDialog.cxx index ef8f08cd216c..ab03a51c4e15 100644 --- a/cui/source/dialogs/SpellDialog.cxx +++ b/cui/source/dialogs/SpellDialog.cxx @@ -112,18 +112,18 @@ public: sal_uInt16 GetId() const; void SetEnableChangePB(){m_bEnableChangePB = true;} - bool IsEnableChangePB(){return m_bEnableChangePB;} + bool IsEnableChangePB() const {return m_bEnableChangePB;} void SetEnableChangeAllPB(){m_bEnableChangeAllPB = true;} - bool IsEnableChangeAllPB(){return m_bEnableChangeAllPB;} + bool IsEnableChangeAllPB() const {return m_bEnableChangeAllPB;} void SetErrorMove(long nOldStart, long nOldEnd) { m_nOldErrorStart = nOldStart; m_nOldErrorEnd = nOldEnd; } - long GetOldErrorStart() { return m_nOldErrorStart;} - long GetOldErrorEnd() { return m_nOldErrorEnd;} + long GetOldErrorStart() const { return m_nOldErrorStart;} + long GetOldErrorEnd() const { return m_nOldErrorEnd;} void SetErrorLanguageSelected(bool bSet){ m_bIsErrorLanguageSelected = bSet;} bool IsErrorLanguageSelected() const {return m_bIsErrorLanguageSelected;} @@ -1982,7 +1982,7 @@ void SentenceEditWindow_Impl::AddUndoAction( std::unique_ptr<SfxUndoAction> pAct GetSpellDialog()->m_xUndoPB->set_sensitive(true); } -size_t SentenceEditWindow_Impl::GetUndoActionCount() +size_t SentenceEditWindow_Impl::GetUndoActionCount() const { return m_xEditEngine->GetUndoManager().GetUndoActionCount(); } diff --git a/cui/source/dialogs/colorpicker.cxx b/cui/source/dialogs/colorpicker.cxx index e96037e747df..bddca8e8ca81 100644 --- a/cui/source/dialogs/colorpicker.cxx +++ b/cui/source/dialogs/colorpicker.cxx @@ -209,8 +209,8 @@ public: void Modify(); void SetValues(Color aColor, ColorMode eMode, double x, double y); - double GetX() { return mdX;} - double GetY() { return mdY;} + double GetX() const { return mdX;} + double GetY() const { return mdY;} void SetModifyHdl(const Link<ColorFieldControl&,void>& rLink) { maModifyHdl = rLink; } diff --git a/cui/source/dialogs/hldoctp.cxx b/cui/source/dialogs/hldoctp.cxx index d9fb18906392..c0dbd18ec0ee 100644 --- a/cui/source/dialogs/hldoctp.cxx +++ b/cui/source/dialogs/hldoctp.cxx @@ -92,7 +92,7 @@ void SvxHyperlinkDocTp::FillDlgFields(const OUString& rStrURL) |* retrieve current url-string |* |************************************************************************/ -OUString SvxHyperlinkDocTp::GetCurrentURL () +OUString SvxHyperlinkDocTp::GetCurrentURL () const { // get data from dialog-controls OUString aStrURL; diff --git a/cui/source/dialogs/hlmarkwn.cxx b/cui/source/dialogs/hlmarkwn.cxx index 833c4f75efa7..9589f6087b00 100644 --- a/cui/source/dialogs/hlmarkwn.cxx +++ b/cui/source/dialogs/hlmarkwn.cxx @@ -277,7 +277,7 @@ bool SvxHlinkDlgMarkWnd::RefreshFromDoc(const OUString& aURL) } // Fill Tree-Control -int SvxHlinkDlgMarkWnd::FillTree( const uno::Reference< container::XNameAccess >& xLinks, weld::TreeIter* pParentEntry ) +int SvxHlinkDlgMarkWnd::FillTree( const uno::Reference< container::XNameAccess >& xLinks, const weld::TreeIter* pParentEntry ) { int nEntries=0; const uno::Sequence< OUString > aNames( xLinks->getElementNames() ); diff --git a/cui/source/dialogs/hltpbase.cxx b/cui/source/dialogs/hltpbase.cxx index 828657b08a5f..b2dc2711dc93 100644 --- a/cui/source/dialogs/hltpbase.cxx +++ b/cui/source/dialogs/hltpbase.cxx @@ -377,7 +377,7 @@ IMPL_LINK_NOARG(SvxHyperlinkTabPageBase, ClickScriptHdl_Impl, weld::Button&, voi } // Get Macro-Infos -HyperDialogEvent SvxHyperlinkTabPageBase::GetMacroEvents() +HyperDialogEvent SvxHyperlinkTabPageBase::GetMacroEvents() const { const SvxHyperlinkItem *pHyperlinkItem = static_cast<const SvxHyperlinkItem *>( GetItemSet().GetItem (SID_HYPERLINK_GETLINK)); diff --git a/cui/source/dialogs/scriptdlg.cxx b/cui/source/dialogs/scriptdlg.cxx index c3e0314502c8..588059081506 100644 --- a/cui/source/dialogs/scriptdlg.cxx +++ b/cui/source/dialogs/scriptdlg.cxx @@ -67,7 +67,7 @@ static void ShowErrorDialog( const Any& aException ) pDlg->Execute(); } -void SvxScriptOrgDialog::delUserData(weld::TreeIter& rIter) +void SvxScriptOrgDialog::delUserData(const weld::TreeIter& rIter) { SFEntry* pUserData = reinterpret_cast<SFEntry*>(m_xScriptsBox->get_id(rIter).toInt64()); if (pUserData) @@ -881,7 +881,7 @@ void SvxScriptOrgDialog::createEntry(weld::TreeIter& rEntry) } } -void SvxScriptOrgDialog::renameEntry(weld::TreeIter& rEntry) +void SvxScriptOrgDialog::renameEntry(const weld::TreeIter& rEntry) { Reference< browse::XBrowseNode > aChildNode; diff --git a/cui/source/dialogs/thesdlg.cxx b/cui/source/dialogs/thesdlg.cxx index 1ed20384016c..dcb8805e7a0d 100644 --- a/cui/source/dialogs/thesdlg.cxx +++ b/cui/source/dialogs/thesdlg.cxx @@ -332,7 +332,7 @@ void SvxThesaurusDialog::SetWindowTitle( LanguageType nLanguage ) m_xDialog->set_title(aStr); // set window title } -OUString SvxThesaurusDialog::GetWord() +OUString SvxThesaurusDialog::GetWord() const { return m_xReplaceEdit->get_text(); } diff --git a/cui/source/inc/CommandCategoryListBox.hxx b/cui/source/inc/CommandCategoryListBox.hxx index acc353b93a73..209ae83ffd42 100644 --- a/cui/source/inc/CommandCategoryListBox.hxx +++ b/cui/source/inc/CommandCategoryListBox.hxx @@ -70,7 +70,7 @@ public: // Adds children of the given macro group to the functions list void addChildren( - weld::TreeIter* parentEntry, const css::uno::Reference<com::sun::star::script::browse::XBrowseNode> &parentNode, + const weld::TreeIter* parentEntry, const css::uno::Reference<com::sun::star::script::browse::XBrowseNode> &parentNode, CuiConfigFunctionListBox* pFunctionListBox, const OUString &filterTerm , SaveInData *pCurrentSaveInData, std::vector<std::unique_ptr<weld::TreeIter>> &rNodesToExpand); }; diff --git a/cui/source/inc/DiagramDialog.hxx b/cui/source/inc/DiagramDialog.hxx index c1ce3316427e..461ffee9a7e6 100644 --- a/cui/source/inc/DiagramDialog.hxx +++ b/cui/source/inc/DiagramDialog.hxx @@ -32,7 +32,7 @@ private: DECL_LINK(OnAddClick, weld::Button&, void); - void populateTree(weld::TreeIter* pParent, const OUString& rParentId); + void populateTree(const weld::TreeIter* pParent, const OUString& rParentId); }; #endif // INCLUDED_CUI_SOURCE_INC_DIAGRAMDIALOG_HXX diff --git a/cui/source/inc/FontFeaturesDialog.hxx b/cui/source/inc/FontFeaturesDialog.hxx index 3e4157129944..d30f92305067 100644 --- a/cui/source/inc/FontFeaturesDialog.hxx +++ b/cui/source/inc/FontFeaturesDialog.hxx @@ -66,7 +66,7 @@ public: ~FontFeaturesDialog() override; virtual short run() override; - OUString const& getResultFontName() { return m_sResultFontName; } + OUString const& getResultFontName() const { return m_sResultFontName; } void updateFontPreview(); }; diff --git a/cui/source/inc/SpellDialog.hxx b/cui/source/inc/SpellDialog.hxx index 7775ea347dbf..65de78342f7e 100644 --- a/cui/source/inc/SpellDialog.hxx +++ b/cui/source/inc/SpellDialog.hxx @@ -109,7 +109,7 @@ public: void ResetUndo(); void Undo(); void AddUndoAction( std::unique_ptr<SfxUndoAction> pAction ); - size_t GetUndoActionCount(); + size_t GetUndoActionCount() const; void UndoActionStart( sal_uInt16 nId ); void UndoActionEnd(); diff --git a/cui/source/inc/backgrnd.hxx b/cui/source/inc/backgrnd.hxx index 78c82a6448ac..099997775374 100644 --- a/cui/source/inc/backgrnd.hxx +++ b/cui/source/inc/backgrnd.hxx @@ -141,7 +141,7 @@ private: bool LoadLinkedGraphic_Impl(); void RaiseLoadError_Impl(); void SetGraphicPosition_Impl( SvxGraphicPosition ePos ); - SvxGraphicPosition GetGraphicPosition_Impl(); + SvxGraphicPosition GetGraphicPosition_Impl() const; void FillControls_Impl(const SvxBrushItem& rBgdAttr, const OUString& rUserData); diff --git a/cui/source/inc/cfg.hxx b/cui/source/inc/cfg.hxx index 5d6a677f8eab..4b4e308803bd 100644 --- a/cui/source/inc/cfg.hxx +++ b/cui/source/inc/cfg.hxx @@ -121,26 +121,26 @@ public: const css::uno::Reference< css::uno::XInterface >& xManager ); void SetModified( bool bValue = true ) { bModified = bValue; } - bool IsModified( ) { return bModified; } + bool IsModified( ) const { return bModified; } - bool IsReadOnly( ) { return bReadOnly; } - bool IsDocConfig( ) { return bDocConfig; } + bool IsReadOnly( ) const { return bReadOnly; } + bool IsDocConfig( ) const { return bDocConfig; } const css::uno::Reference < css::ui::XUIConfigurationManager >& - GetConfigManager() { return m_xCfgMgr; }; + GetConfigManager() const { return m_xCfgMgr; }; const css::uno::Reference < css::ui::XUIConfigurationManager >& - GetParentConfigManager() { return m_xParentCfgMgr; }; + GetParentConfigManager() const { return m_xParentCfgMgr; }; const css::uno::Reference < css::ui::XImageManager >& - GetImageManager() { return m_xImgMgr; }; + GetImageManager() const { return m_xImgMgr; }; const css::uno::Reference < css::ui::XImageManager >& - GetParentImageManager() { return m_xParentImgMgr; }; + GetParentImageManager() const { return m_xParentImgMgr; }; css::uno::Reference < css::container::XNameAccess > m_xCommandToLabelMap; @@ -288,17 +288,17 @@ public: void SetEntries( std::unique_ptr<SvxEntries> entries ) { mpEntries = std::move(entries); } void SetMain() { bIsMain = true; } - bool IsMain() { return bIsMain; } + bool IsMain() const { return bIsMain; } void SetParentData( bool bValue = true ) { bIsParentData = bValue; } - bool IsParentData() { return bIsParentData; } + bool IsParentData() const { return bIsParentData; } void SetModified( bool bValue = true ) { bIsModified = bValue; } - bool IsModified() { return bIsModified; } + bool IsModified() const { return bIsModified; } - bool IsMovable(); - bool IsDeletable(); - bool IsRenamable(); + bool IsMovable() const; + bool IsDeletable() const; + bool IsRenamable() const; void SetVisible( bool b ) { bIsVisible = b; } bool IsVisible() const { return bIsVisible; } @@ -306,7 +306,7 @@ public: void SetBackupGraphic( css::uno::Reference< css::graphic::XGraphic > const & graphic ) { xBackupGraphic = graphic; } - const css::uno::Reference< css::graphic::XGraphic >& GetBackupGraphic() + const css::uno::Reference< css::graphic::XGraphic >& GetBackupGraphic() const { return xBackupGraphic; } sal_Int32 GetStyle() const { return nStyle; } @@ -435,7 +435,7 @@ protected: void InsertEntryIntoUI(SvxConfigEntry* pNewEntryData, int nPos, int nStartCol); - void InsertEntryIntoNotebookbarTabUI(OUString& sClassId ,OUString& sUIItemId, OUString& sUIItemCommand, int nPos, + void InsertEntryIntoNotebookbarTabUI(const OUString& sClassId, const OUString& sUIItemId, const OUString& sUIItemCommand, int nPos, int nStartCol); SvxEntries* FindParentForChild( SvxEntries* pParentEntries, @@ -483,7 +483,7 @@ public: GetFrameWithDefaultAndIdentify( css::uno::Reference< css::frame::XFrame >& _inout_rxFrame ); OUString GetScriptURL() const; - OUString GetSelectedDisplayName(); + OUString GetSelectedDisplayName() const; }; class SvxMainMenuOrganizerDialog : public weld::GenericDialogController @@ -576,7 +576,7 @@ public: SvxNewToolbarDialog(weld::Window* pWindow, const OUString& rName); virtual ~SvxNewToolbarDialog() override; - OUString GetName() + OUString GetName() const { return m_xEdtName->get_text(); } diff --git a/cui/source/inc/cfgutil.hxx b/cui/source/inc/cfgutil.hxx index 8b69238cfbaf..331a59a21d8d 100644 --- a/cui/source/inc/cfgutil.hxx +++ b/cui/source/inc/cfgutil.hxx @@ -68,7 +68,7 @@ public: static bool parseStyleCommand(SfxStyleInfo_Impl& aStyle); void getLabel4Style(SfxStyleInfo_Impl& aStyle); - std::vector< SfxStyleInfo_Impl > getStyleFamilies(); + std::vector< SfxStyleInfo_Impl > getStyleFamilies() const; std::vector< SfxStyleInfo_Impl > getStyles(const OUString& sFamily); static OUString generateCommand(const OUString& sFamily, const OUString& sStyle); @@ -114,29 +114,29 @@ public: void connect_row_activated(const Link<weld::TreeView&, void>& rLink) { m_xTreeView->connect_row_activated(rLink); } void freeze() { m_xTreeView->freeze(); } void thaw() { m_xTreeView->thaw(); } - void append(const OUString& rId, const OUString& rStr, weld::TreeIter* pParent = nullptr) + void append(const OUString& rId, const OUString& rStr, const weld::TreeIter* pParent = nullptr) { m_xTreeView->insert(pParent, -1, &rStr, &rId, nullptr, nullptr, nullptr, false, nullptr); } - std::unique_ptr<weld::TreeIter> tree_append(const OUString& rId, const OUString& rStr, weld::TreeIter* pParent = nullptr) + std::unique_ptr<weld::TreeIter> tree_append(const OUString& rId, const OUString& rStr, const weld::TreeIter* pParent = nullptr) { std::unique_ptr<weld::TreeIter> xIter(m_xTreeView->make_iterator()); m_xTreeView->insert(pParent, -1, &rStr, &rId, nullptr, nullptr, nullptr, false, xIter.get()); return xIter; } - void append(const OUString& rId, const OUString& rStr, const OUString& rImage, weld::TreeIter* pParent = nullptr) + void append(const OUString& rId, const OUString& rStr, const OUString& rImage, const weld::TreeIter* pParent = nullptr) { m_xTreeView->insert(pParent, -1, &rStr, &rId, nullptr, nullptr, &rImage, false, nullptr); } - void append(const OUString& rId, const OUString& rStr, const css::uno::Reference<css::graphic::XGraphic>& rImage, weld::TreeIter* pParent = nullptr) + void append(const OUString& rId, const OUString& rStr, const css::uno::Reference<css::graphic::XGraphic>& rImage, const weld::TreeIter* pParent = nullptr) { m_xTreeView->insert(pParent, -1, &rStr, &rId, nullptr, nullptr, nullptr, false, m_xScratchIter.get()); m_xTreeView->set_image(*m_xScratchIter, rImage, -1); } void remove(int nPos) { m_xTreeView->remove(nPos); } void scroll_to_row(int pos) { m_xTreeView->scroll_to_row(pos); } - void remove(weld::TreeIter& rIter) { m_xTreeView->remove(rIter); } - void expand_row(weld::TreeIter& rIter) { m_xTreeView->expand_row(rIter); } + void remove(const weld::TreeIter& rIter) { m_xTreeView->remove(rIter); } + void expand_row(const weld::TreeIter& rIter) { m_xTreeView->expand_row(rIter); } int n_children() const { return m_xTreeView->n_children(); } std::unique_ptr<weld::TreeIter> make_iterator(const weld::TreeIter* pOrig = nullptr) const { return m_xTreeView->make_iterator(pOrig); } bool get_iter_first(weld::TreeIter& rIter) const { return m_xTreeView->get_iter_first(rIter); } @@ -171,10 +171,10 @@ public: ~CuiConfigFunctionListBox(); void ClearAll(); - OUString GetSelectedScriptURI(); + OUString GetSelectedScriptURI() const; OUString GetHelpText( bool bConsiderParent = true ); - OUString GetCurCommand(); - OUString GetCurLabel(); + OUString GetCurCommand() const; + OUString GetCurLabel() const; }; struct SvxConfigGroupBoxResource_Impl; diff --git a/cui/source/inc/cuitabarea.hxx b/cui/source/inc/cuitabarea.hxx index e60e718a28ce..92dab7b168c2 100644 --- a/cui/source/inc/cuitabarea.hxx +++ b/cui/source/inc/cuitabarea.hxx @@ -62,7 +62,7 @@ class ButtonBox maButtonList.push_back(pButton); maButtonToPos.insert( std::make_pair(pButton, maButtonList.size() - 1) ); } - sal_Int32 GetCurrentButtonPos() { return mnCurrentButton; } + sal_Int32 GetCurrentButtonPos() const { return mnCurrentButton; } sal_Int32 GetButtonPos(weld::ToggleButton* pButton) { std::map<weld::ToggleButton*, sal_Int32>::const_iterator aBtnPos = maButtonToPos.find(pButton); @@ -251,7 +251,7 @@ protected: void SelectFillType( weld::ToggleButton& rButton, const SfxItemSet* _pSet = nullptr ); SfxTabPage* GetFillTabPage() { return m_pFillTabPage; } - bool IsBtnClicked() { return m_bBtnClicked; } + bool IsBtnClicked() const { return m_bBtnClicked; } private: DECL_LINK(SelectFillTypeHdl_Impl, weld::ToggleButton&, void); @@ -762,7 +762,7 @@ public: void SetColorChgd( ChangeType* pIn ) { pnColorListState = pIn; } - void SetCtlPreviewOld( SfxItemSet& rAttrs ) { m_aCtlPreviewOld.SetAttributes( rAttrs ); } + void SetCtlPreviewOld( const SfxItemSet& rAttrs ) { m_aCtlPreviewOld.SetAttributes( rAttrs ); } virtual void FillUserData() override; }; diff --git a/cui/source/inc/dlgname.hxx b/cui/source/inc/dlgname.hxx index 83b42d409e07..a1e90f32db71 100644 --- a/cui/source/inc/dlgname.hxx +++ b/cui/source/inc/dlgname.hxx @@ -85,7 +85,7 @@ public: SvxObjectNameDialog(weld::Window* pWindow, const OUString& rName); // data access - OUString GetName() { return m_xEdtName->get_text(); } + OUString GetName() const { return m_xEdtName->get_text(); } // set handler void SetCheckNameHdl(const Link<SvxObjectNameDialog&,bool>& rLink) diff --git a/cui/source/inc/hldoctp.hxx b/cui/source/inc/hldoctp.hxx index 53f302204bf0..9f5f8395f3c1 100644 --- a/cui/source/inc/hldoctp.hxx +++ b/cui/source/inc/hldoctp.hxx @@ -58,7 +58,7 @@ private: SvxLinkInsertMode& eMode ) override; virtual bool ShouldOpenMarkWnd () override {return m_bMarkWndOpen;} virtual void SetMarkWndShouldOpen (bool bOpen) override {m_bMarkWndOpen=bOpen;} - OUString GetCurrentURL (); + OUString GetCurrentURL() const; public: SvxHyperlinkDocTp(weld::Container* pParent, SvxHpLinkDlg* pDlg, const SfxItemSet* pItemSet); diff --git a/cui/source/inc/hlmarkwn.hxx b/cui/source/inc/hlmarkwn.hxx index e45baa8572f7..aa03d4da4ddf 100644 --- a/cui/source/inc/hlmarkwn.hxx +++ b/cui/source/inc/hlmarkwn.hxx @@ -50,7 +50,7 @@ protected: std::unique_ptr<weld::TreeIter> FindEntry(const OUString& aStrName); void ClearTree(); - int FillTree( const css::uno::Reference< css::container::XNameAccess >& xLinks, weld::TreeIter* pParentEntry =nullptr ); + int FillTree( const css::uno::Reference< css::container::XNameAccess >& xLinks, const weld::TreeIter* pParentEntry =nullptr ); DECL_LINK( ClickApplyHdl_Impl, weld::Button&, void ); DECL_LINK( DoubleClickApplyHdl_Impl, weld::TreeView&, void ); diff --git a/cui/source/inc/hltpbase.hxx b/cui/source/inc/hltpbase.hxx index 7c88179d1477..278eab3dd853 100644 --- a/cui/source/inc/hltpbase.hxx +++ b/cui/source/inc/hltpbase.hxx @@ -129,7 +129,7 @@ protected: SfxDispatcher* GetDispatcher() const; - HyperDialogEvent GetMacroEvents(); + HyperDialogEvent GetMacroEvents() const; SvxMacroTableDtor* GetMacroTable(); }; diff --git a/cui/source/inc/insdlg.hxx b/cui/source/inc/insdlg.hxx index a63d8587d658..50f14987b492 100644 --- a/cui/source/inc/insdlg.hxx +++ b/cui/source/inc/insdlg.hxx @@ -40,7 +40,7 @@ protected: const OUString& rUIXMLDescription, const OString& rID, const css::uno::Reference < css::embed::XStorage >& xStorage); public: - const css::uno::Reference<css::embed::XEmbeddedObject>& GetObject() { return m_xObj; } + const css::uno::Reference<css::embed::XEmbeddedObject>& GetObject() const { return m_xObj; } virtual css::uno::Reference<css::io::XInputStream> GetIconIfIconified(OUString* pGraphicMediaType); void SetHelpId(const OString& rHelpId) { m_xDialog->set_help_id(rHelpId); } virtual bool IsCreateNew() const; diff --git a/cui/source/inc/macropg.hxx b/cui/source/inc/macropg.hxx index c80f848ec759..8cb4e5466b19 100644 --- a/cui/source/inc/macropg.hxx +++ b/cui/source/inc/macropg.hxx @@ -58,7 +58,7 @@ class SvxMacroTabPage_ : public SfxTabPage DECL_LINK( AssignDeleteHdl_Impl, weld::Button&, void ); DECL_LINK( DoubleClickHdl_Impl, weld::TreeView&, void ); - static void GenericHandler_Impl( SvxMacroTabPage_* pThis, weld::Button* pBtn ); + static void GenericHandler_Impl( SvxMacroTabPage_* pThis, const weld::Button* pBtn ); css::uno::Reference< css::container::XNameReplace > m_xAppEvents; protected: diff --git a/cui/source/inc/optdict.hxx b/cui/source/inc/optdict.hxx index 5921dc905490..4aed3f4305d0 100644 --- a/cui/source/inc/optdict.hxx +++ b/cui/source/inc/optdict.hxx @@ -50,7 +50,7 @@ private: public: SvxNewDictionaryDialog(weld::Window* pParent); - const css::uno::Reference<css::linguistic2::XDictionary>& GetNewDictionary() { return m_xNewDic; } + const css::uno::Reference<css::linguistic2::XDictionary>& GetNewDictionary() const { return m_xNewDic; } }; // class SvxEditDictionaryDialog ----------------------------------------- diff --git a/cui/source/inc/page.hxx b/cui/source/inc/page.hxx index aa7209a8cd56..a52ca0cffc53 100644 --- a/cui/source/inc/page.hxx +++ b/cui/source/inc/page.hxx @@ -158,7 +158,7 @@ private: bool IsPrinterRangeOverflow(weld::MetricSpinButton& rField, long nFirstMargin, long nLastMargin, MarginPosition nPos); void CheckMarginEdits( bool _bClear ); - bool IsMarginOutOfRange(); + bool IsMarginOutOfRange() const; SvxPageDescPage(TabPageParent pParent, const SfxItemSet& rSet); diff --git a/cui/source/inc/postdlg.hxx b/cui/source/inc/postdlg.hxx index c3c086d89097..62a3379b9289 100644 --- a/cui/source/inc/postdlg.hxx +++ b/cui/source/inc/postdlg.hxx @@ -42,7 +42,7 @@ public: virtual ~SvxPostItDialog() override; static const sal_uInt16* GetRanges(); - const SfxItemSet* GetOutputItemSet() { return m_xOutSet.get(); } + const SfxItemSet* GetOutputItemSet() const { return m_xOutSet.get(); } void SetPrevHdl( const Link<SvxPostItDialog&,void>& rLink ) { m_aPrevHdlLink = rLink; } @@ -71,7 +71,7 @@ public: { m_xDialog->set_title(rTitle); } - std::shared_ptr<weld::Dialog> const & GetDialog() + std::shared_ptr<weld::Dialog> const & GetDialog() const { return m_xDialog; } diff --git a/cui/source/inc/scriptdlg.hxx b/cui/source/inc/scriptdlg.hxx index 3efd5df17517..7ae0f333563e 100644 --- a/cui/source/inc/scriptdlg.hxx +++ b/cui/source/inc/scriptdlg.hxx @@ -70,8 +70,8 @@ public: SFEntry( const css::uno::Reference< css::script::browse::XBrowseNode >& entryNodes , const css::uno::Reference< css::frame::XModel >& entryModel) { nodes = entryNodes; loaded=false; model = entryModel; } SFEntry( const SFEntry& r ) { nodes = r.nodes; loaded = r.loaded; } - const css::uno::Reference< css::script::browse::XBrowseNode >& GetNode() { return nodes ;} - const css::uno::Reference< css::frame::XModel >& GetModel() { return model ;}; + const css::uno::Reference< css::script::browse::XBrowseNode >& GetNode() const { return nodes ;} + const css::uno::Reference< css::frame::XModel >& GetModel() const { return model ;}; bool isLoaded() const { return loaded; } void setLoaded() { loaded=true; } }; @@ -108,7 +108,7 @@ protected: void CheckButtons( css::uno::Reference< css::script::browse::XBrowseNode > const & node ); void createEntry(weld::TreeIter& rEntry); - void renameEntry(weld::TreeIter& rEntry); + void renameEntry(const weld::TreeIter& rEntry); void deleteEntry(weld::TreeIter& rEntry); css::uno::Reference<css::script::browse::XBrowseNode> getBrowseNode(const weld::TreeIter& rEntry); css::uno::Reference<css::frame::XModel> getModel(const weld::TreeIter& rEntry); @@ -117,7 +117,7 @@ protected: void RestorePreviousSelection(); void Init(const OUString& language); - void delUserData(weld::TreeIter& rIter); + void delUserData(const weld::TreeIter& rIter); void deleteTree(weld::TreeIter& rIter); void deleteAllTree(); void insertEntry(OUString const & rText, OUString const & rBitmap, diff --git a/cui/source/inc/srchxtra.hxx b/cui/source/inc/srchxtra.hxx index 38ee2955aa0d..5513ae236a46 100644 --- a/cui/source/inc/srchxtra.hxx +++ b/cui/source/inc/srchxtra.hxx @@ -73,10 +73,10 @@ public: sal_uInt16 nLonger); virtual ~SvxSearchSimilarityDialog() override; - sal_uInt16 GetOther() { return static_cast<sal_uInt16>(m_xOtherFld->get_value()); } - sal_uInt16 GetShorter() { return static_cast<sal_uInt16>(m_xShorterFld->get_value()); } - sal_uInt16 GetLonger() { return static_cast<sal_uInt16>(m_xLongerFld->get_value()); } - bool IsRelaxed() { return m_xRelaxBox->get_active(); } + sal_uInt16 GetOther() const { return static_cast<sal_uInt16>(m_xOtherFld->get_value()); } + sal_uInt16 GetShorter() const { return static_cast<sal_uInt16>(m_xShorterFld->get_value()); } + sal_uInt16 GetLonger() const { return static_cast<sal_uInt16>(m_xLongerFld->get_value()); } + bool IsRelaxed() const { return m_xRelaxBox->get_active(); } }; #endif diff --git a/cui/source/inc/textanim.hxx b/cui/source/inc/textanim.hxx index 4a7339d4ee8b..ecc725edcb7b 100644 --- a/cui/source/inc/textanim.hxx +++ b/cui/source/inc/textanim.hxx @@ -75,7 +75,7 @@ private: DECL_LINK( ClickDirectionHdl_Impl, weld::Button&, void ); void SelectDirection( SdrTextAniDirection nValue ); - sal_uInt16 GetSelectedDirection(); + sal_uInt16 GetSelectedDirection() const; public: SvxTextAnimationPage(TabPageParent pPage, const SfxItemSet& rInAttrs); diff --git a/cui/source/inc/thesdlg.hxx b/cui/source/inc/thesdlg.hxx index 4172164f70ea..46af0be49cfd 100644 --- a/cui/source/inc/thesdlg.hxx +++ b/cui/source/inc/thesdlg.hxx @@ -74,7 +74,7 @@ public: css::uno::Reference< css::linguistic2::XThesaurus > const & xThesaurus, const OUString &rWord, LanguageType nLanguage); void SetWindowTitle( LanguageType nLanguage ); - OUString GetWord(); + OUString GetWord() const; }; #endif diff --git a/cui/source/options/optaboutconfig.hxx b/cui/source/options/optaboutconfig.hxx index c045ed42095e..989fbef6f0ad 100644 --- a/cui/source/options/optaboutconfig.hxx +++ b/cui/source/options/optaboutconfig.hxx @@ -77,7 +77,7 @@ public: CuiAboutConfigValueDialog(weld::Window* pWindow, const OUString& rValue , int limit); virtual ~CuiAboutConfigValueDialog() override; - OUString getValue() + OUString getValue() const { return m_xEDValue->get_text(); } diff --git a/cui/source/options/optcolor.cxx b/cui/source/options/optcolor.cxx index d85381cc70a5..56f80cb5ab29 100644 --- a/cui/source/options/optcolor.cxx +++ b/cui/source/options/optcolor.cxx @@ -786,7 +786,7 @@ public: void SetConfig (EditableColorConfig& rConfig) { pColorConfig = &rConfig; } void SetExtendedConfig (EditableExtendedColorConfig& rConfig) { pExtColorConfig = &rConfig; } void Update (); - long GetScrollPosition () + long GetScrollPosition () const { return m_pVScroll->GetThumbPos(); } diff --git a/cui/source/tabpages/backgrnd.cxx b/cui/source/tabpages/backgrnd.cxx index 86b9ca5dfd2e..d033764ff8aa 100644 --- a/cui/source/tabpages/backgrnd.cxx +++ b/cui/source/tabpages/backgrnd.cxx @@ -912,7 +912,7 @@ void SvxBackgroundTabPage::SetGraphicPosition_Impl( SvxGraphicPosition ePos ) m_xWndPosition->Invalidate(); } -SvxGraphicPosition SvxBackgroundTabPage::GetGraphicPosition_Impl() +SvxGraphicPosition SvxBackgroundTabPage::GetGraphicPosition_Impl() const { if (m_xBtnTile->get_active()) return GPOS_TILED; diff --git a/cui/source/tabpages/page.cxx b/cui/source/tabpages/page.cxx index 9a498c44d42e..58d4e8627475 100644 --- a/cui/source/tabpages/page.cxx +++ b/cui/source/tabpages/page.cxx @@ -1502,7 +1502,7 @@ void SvxPageDescPage::CheckMarginEdits( bool _bClear ) m_nPos |= MARGIN_BOTTOM; } -bool SvxPageDescPage::IsMarginOutOfRange() +bool SvxPageDescPage::IsMarginOutOfRange() const { bool bRet = ( ( ( !( m_nPos & MARGIN_LEFT ) && m_xLeftMarginEdit->get_value_changed_from_saved() ) && diff --git a/cui/source/tabpages/textanim.cxx b/cui/source/tabpages/textanim.cxx index 7048a030c36e..ecd5afdf5b8b 100644 --- a/cui/source/tabpages/textanim.cxx +++ b/cui/source/tabpages/textanim.cxx @@ -517,7 +517,7 @@ void SvxTextAnimationPage::SelectDirection( SdrTextAniDirection nValue ) m_xBtnDown->set_active( nValue == SdrTextAniDirection::Down ); } -sal_uInt16 SvxTextAnimationPage::GetSelectedDirection() +sal_uInt16 SvxTextAnimationPage::GetSelectedDirection() const { SdrTextAniDirection nValue = SdrTextAniDirection::Left; diff --git a/cui/source/tabpages/tppattern.cxx b/cui/source/tabpages/tppattern.cxx index 87f54a08c89c..ef96e4511c1e 100644 --- a/cui/source/tabpages/tppattern.cxx +++ b/cui/source/tabpages/tppattern.cxx @@ -57,7 +57,7 @@ public: } // BitmapCtl: Returns the Bitmap - BitmapEx GetBitmapEx() + BitmapEx GetBitmapEx() const { if (!pBmpArray) return BitmapEx(); |