diff options
author | Noel <noelgrandin@gmail.com> | 2020-12-02 09:50:54 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2020-12-03 19:36:46 +0100 |
commit | e4c30ac9c50bf102184bb8e2a90de0acdea042ee (patch) | |
tree | 1fc09e435338369a7340abde0f90cabb5d7ff2cd | |
parent | fd670f52523e3a4dd51afe116b0f6ce90ce0d2fe (diff) |
convert EHistoryType to scoped enum
Change-Id: I115fc0ed81d6392d3649757727c4d9468213619d
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/107046
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
-rw-r--r-- | dbaccess/source/ui/app/AppController.cxx | 2 | ||||
-rw-r--r-- | dbaccess/source/ui/control/opendoccontrols.cxx | 2 | ||||
-rw-r--r-- | framework/source/uielement/recentfilesmenucontroller.cxx | 4 | ||||
-rw-r--r-- | include/unotools/historyoptions.hxx | 6 | ||||
-rw-r--r-- | sfx2/source/appl/newhelp.cxx | 6 | ||||
-rw-r--r-- | sfx2/source/appl/sfxpicklist.cxx | 2 | ||||
-rw-r--r-- | sfx2/source/appl/shutdowniconaqua.mm | 2 | ||||
-rw-r--r-- | sfx2/source/control/recentdocsview.cxx | 2 | ||||
-rw-r--r-- | sfx2/source/control/recentdocsviewitem.cxx | 2 | ||||
-rw-r--r-- | sfx2/source/dialog/backingwindow.cxx | 2 | ||||
-rw-r--r-- | sfx2/source/inet/inettbc.cxx | 2 | ||||
-rw-r--r-- | svtools/source/control/inettbc.cxx | 4 | ||||
-rw-r--r-- | unotools/source/config/historyoptions.cxx | 8 |
13 files changed, 22 insertions, 22 deletions
diff --git a/dbaccess/source/ui/app/AppController.cxx b/dbaccess/source/ui/app/AppController.cxx index 1d23f3af8715..987536261316 100644 --- a/dbaccess/source/ui/app/AppController.cxx +++ b/dbaccess/source/ui/app/AppController.cxx @@ -357,7 +357,7 @@ void SAL_CALL OApplicationController::disposing() aFilter = pFilter->GetFilterName(); // add to svtool history options - SvtHistoryOptions().AppendItem( ePICKLIST, + SvtHistoryOptions().AppendItem( EHistoryType::PickList, aURL.GetURLNoPass( INetURLObject::DecodeMechanism::NONE ), aFilter, getStrippedDatabaseName(), diff --git a/dbaccess/source/ui/control/opendoccontrols.cxx b/dbaccess/source/ui/control/opendoccontrols.cxx index a80ed3ede422..699eae894d89 100644 --- a/dbaccess/source/ui/control/opendoccontrols.cxx +++ b/dbaccess/source/ui/control/opendoccontrols.cxx @@ -130,7 +130,7 @@ namespace dbaui { OSL_ENSURE( _pAsciiModuleName, "OpenDocumentListBox::impl_init: invalid module name!" ); - Sequence< Sequence< PropertyValue> > aHistory = SvtHistoryOptions().GetList( ePICKLIST ); + Sequence< Sequence< PropertyValue> > aHistory = SvtHistoryOptions().GetList( EHistoryType::PickList ); Reference< XNameAccess > xFilterFactory; xFilterFactory.set(::comphelper::getProcessServiceFactory()->createInstance( "com.sun.star.document.FilterFactory" ), css::uno::UNO_QUERY); diff --git a/framework/source/uielement/recentfilesmenucontroller.cxx b/framework/source/uielement/recentfilesmenucontroller.cxx index b775835d3a4e..3d79087be85d 100644 --- a/framework/source/uielement/recentfilesmenucontroller.cxx +++ b/framework/source/uielement/recentfilesmenucontroller.cxx @@ -127,7 +127,7 @@ void RecentFilesMenuController::fillPopupMenu( Reference< css::awt::XPopupMenu > if ( !pVCLPopupMenu ) return; - Sequence< Sequence< PropertyValue > > aHistoryList = SvtHistoryOptions().GetList( ePICKLIST ); + Sequence< Sequence< PropertyValue > > aHistoryList = SvtHistoryOptions().GetList( EHistoryType::PickList ); int nPickListMenuItems = std::min<sal_Int32>( aHistoryList.getLength(), MAX_MENU_ITEMS ); m_aRecentFilesItems.clear(); @@ -292,7 +292,7 @@ void SAL_CALL RecentFilesMenuController::itemSelected( const css::awt::MenuEvent if ( aCommand == CMD_CLEAR_LIST ) { - SvtHistoryOptions().Clear( ePICKLIST ); + SvtHistoryOptions().Clear( EHistoryType::PickList ); dispatchCommand( "vnd.org.libreoffice.recentdocs:ClearRecentFileList", css::uno::Sequence< css::beans::PropertyValue >() ); diff --git a/include/unotools/historyoptions.hxx b/include/unotools/historyoptions.hxx index 43c61b66788f..34e2c74ea4ec 100644 --- a/include/unotools/historyoptions.hxx +++ b/include/unotools/historyoptions.hxx @@ -41,10 +41,10 @@ namespace com::sun::star::beans { struct PropertyValue; } #define HISTORY_PROPERTYNAME_THUMBNAIL "Thumbnail" /// You can use these enum values to specify right history if you call our interface methods. -enum EHistoryType +enum class EHistoryType { - ePICKLIST = 0, - eHELPBOOKMARKS = 1 + PickList, + HelpBookmarks }; class SvtHistoryOptions_Impl; diff --git a/sfx2/source/appl/newhelp.cxx b/sfx2/source/appl/newhelp.cxx index 6170c5db01f0..065f18c820a9 100644 --- a/sfx2/source/appl/newhelp.cxx +++ b/sfx2/source/appl/newhelp.cxx @@ -1171,7 +1171,7 @@ BookmarksTabPage_Impl::BookmarksTabPage_Impl(weld::Widget* pParent, SfxHelpIndex m_xBookmarksBox->connect_key_press(LINK(this, BookmarksTabPage_Impl, KeyInputHdl)); // load bookmarks from configuration - const Sequence< Sequence< PropertyValue > > aBookmarkSeq = SvtHistoryOptions().GetList( eHELPBOOKMARKS ); + const Sequence< Sequence< PropertyValue > > aBookmarkSeq = SvtHistoryOptions().GetList( EHistoryType::HelpBookmarks ); OUString aTitle; OUString aURL; @@ -1187,10 +1187,10 @@ BookmarksTabPage_Impl::~BookmarksTabPage_Impl() { // save bookmarks to configuration SvtHistoryOptions aHistOpt; - aHistOpt.Clear( eHELPBOOKMARKS ); + aHistOpt.Clear( EHistoryType::HelpBookmarks ); const sal_Int32 nCount = m_xBookmarksBox->n_children(); for (sal_Int32 i = 0; i < nCount; ++i) - aHistOpt.AppendItem(eHELPBOOKMARKS, m_xBookmarksBox->get_id(i), "", m_xBookmarksBox->get_text(i), std::nullopt); + aHistOpt.AppendItem(EHistoryType::HelpBookmarks, m_xBookmarksBox->get_id(i), "", m_xBookmarksBox->get_text(i), std::nullopt); m_xBookmarksBox.reset(); m_xBookmarksPB.reset(); diff --git a/sfx2/source/appl/sfxpicklist.cxx b/sfx2/source/appl/sfxpicklist.cxx index 070d762b00dc..e25b90818768 100644 --- a/sfx2/source/appl/sfxpicklist.cxx +++ b/sfx2/source/appl/sfxpicklist.cxx @@ -134,7 +134,7 @@ void SfxPickListImpl::AddDocumentToPickList( const SfxObjectShell* pDocSh ) } // add to svtool history options - SvtHistoryOptions().AppendItem( ePICKLIST, + SvtHistoryOptions().AppendItem( EHistoryType::PickList, aURL.GetURLNoPass( INetURLObject::DecodeMechanism::NONE ), aFilter, aTitle, diff --git a/sfx2/source/appl/shutdowniconaqua.mm b/sfx2/source/appl/shutdowniconaqua.mm index 4a4404654eff..dc824e91d92d 100644 --- a/sfx2/source/appl/shutdowniconaqua.mm +++ b/sfx2/source/appl/shutdowniconaqua.mm @@ -180,7 +180,7 @@ class RecentFilesStringLength : public ::cppu::WeakImplHelper< css::util::XStrin [menu removeItemAtIndex: 0]; // update recent item list - css::uno::Sequence< css::uno::Sequence< css::beans::PropertyValue > > aHistoryList( SvtHistoryOptions().GetList( ePICKLIST ) ); + css::uno::Sequence< css::uno::Sequence< css::beans::PropertyValue > > aHistoryList( SvtHistoryOptions().GetList( EHistoryType::PickList ) ); int nPickListMenuItems = ( aHistoryList.getLength() > 99 ) ? 99 : aHistoryList.getLength(); diff --git a/sfx2/source/control/recentdocsview.cxx b/sfx2/source/control/recentdocsview.cxx index e1b086583220..8bb669f2cf4e 100644 --- a/sfx2/source/control/recentdocsview.cxx +++ b/sfx2/source/control/recentdocsview.cxx @@ -237,7 +237,7 @@ void RecentDocsView::Reload() { Clear(); - Sequence< Sequence< PropertyValue > > aHistoryList = SvtHistoryOptions().GetList( ePICKLIST ); + Sequence< Sequence< PropertyValue > > aHistoryList = SvtHistoryOptions().GetList( EHistoryType::PickList ); for ( int i = 0; i < aHistoryList.getLength(); i++ ) { const Sequence< PropertyValue >& rRecentEntry = aHistoryList[i]; diff --git a/sfx2/source/control/recentdocsviewitem.cxx b/sfx2/source/control/recentdocsviewitem.cxx index dbec7dac90db..7a1268f2800d 100644 --- a/sfx2/source/control/recentdocsviewitem.cxx +++ b/sfx2/source/control/recentdocsviewitem.cxx @@ -163,7 +163,7 @@ void RecentDocsViewItem::MouseButtonUp(const MouseEvent& rMEvt) { if (getRemoveIconArea().IsInside(rMEvt.GetPosPixel())) { - SvtHistoryOptions().DeleteItem(ePICKLIST, maURL); + SvtHistoryOptions().DeleteItem(EHistoryType::PickList, maURL); mrParent.Reload(); return; } diff --git a/sfx2/source/dialog/backingwindow.cxx b/sfx2/source/dialog/backingwindow.cxx index e27b8bf7bbba..7be3383bedff 100644 --- a/sfx2/source/dialog/backingwindow.cxx +++ b/sfx2/source/dialog/backingwindow.cxx @@ -523,7 +523,7 @@ IMPL_LINK (BackingWindow, MenuSelectHdl, const OString&, rId, void) { if (rId == "clear_all") { - SvtHistoryOptions().Clear(ePICKLIST); + SvtHistoryOptions().Clear(EHistoryType::PickList); mxAllRecentThumbnails->Reload(); return; } diff --git a/sfx2/source/inet/inettbc.cxx b/sfx2/source/inet/inettbc.cxx index 822374bc1cc3..4bea456af22e 100644 --- a/sfx2/source/inet/inettbc.cxx +++ b/sfx2/source/inet/inettbc.cxx @@ -242,7 +242,7 @@ void SfxURLToolBoxControl_Impl::StateChanged SvtURLBox* pURLBox = GetURLBox(); pURLBox->clear(); - const css::uno::Sequence< css::uno::Sequence< css::beans::PropertyValue > > lList = SvtHistoryOptions().GetList(ePICKLIST); + const css::uno::Sequence< css::uno::Sequence< css::beans::PropertyValue > > lList = SvtHistoryOptions().GetList(EHistoryType::PickList); for (const css::uno::Sequence< css::beans::PropertyValue >& lProps : lList) { for (const auto& rProp : lProps) diff --git a/svtools/source/control/inettbc.cxx b/svtools/source/control/inettbc.cxx index 907ddb32abbb..4990b07654f1 100644 --- a/svtools/source/control/inettbc.cxx +++ b/svtools/source/control/inettbc.cxx @@ -140,7 +140,7 @@ SvtMatchContext_Impl::~SvtMatchContext_Impl() void SvtMatchContext_Impl::FillPicklist(std::vector<OUString>& rPickList) { // Read the history of picks - Sequence< Sequence< PropertyValue > > seqPicklist = SvtHistoryOptions().GetList( ePICKLIST ); + Sequence< Sequence< PropertyValue > > seqPicklist = SvtHistoryOptions().GetList( EHistoryType::PickList ); sal_uInt32 nCount = seqPicklist.getLength(); for( sal_uInt32 nItem=0; nItem < nCount; nItem++ ) @@ -928,7 +928,7 @@ void SvtURLBox::UpdatePicklistForSmartProtocol_Impl() return; // read history pick list - const Sequence< Sequence< PropertyValue > > seqPicklist = SvtHistoryOptions().GetList( ePICKLIST ); + const Sequence< Sequence< PropertyValue > > seqPicklist = SvtHistoryOptions().GetList( EHistoryType::PickList ); INetURLObject aCurObj; for( const Sequence< PropertyValue >& rPropertySet : seqPicklist ) diff --git a/unotools/source/config/historyoptions.cxx b/unotools/source/config/historyoptions.cxx index d200aa833982..4e6aac18caf7 100644 --- a/unotools/source/config/historyoptions.cxx +++ b/unotools/source/config/historyoptions.cxx @@ -132,11 +132,11 @@ sal_uInt32 SvtHistoryOptions_Impl::GetCapacity(EHistoryType eHistory) const { switch (eHistory) { - case ePICKLIST: + case EHistoryType::PickList: xListAccess->getPropertyValue("PickListSize") >>= nSize; break; - case eHELPBOOKMARKS: + case EHistoryType::HelpBookmarks: xListAccess->getPropertyValue("HelpBookmarkSize") >>= nSize; break; @@ -160,11 +160,11 @@ uno::Reference<container::XNameAccess> SvtHistoryOptions_Impl::GetListAccess(EHi { switch (eHistory) { - case ePICKLIST: + case EHistoryType::PickList: m_xCfg->getByName("PickList") >>= xListAccess; break; - case eHELPBOOKMARKS: + case EHistoryType::HelpBookmarks: m_xCfg->getByName("HelpBookmarks") >>= xListAccess; break; |