framework/inc/properties.h | 24 ++++++++++++--------- framework/source/dispatch/popupmenudispatcher.cxx | 2 - framework/source/fwe/classes/framelistanalyzer.cxx | 4 +-- framework/source/helper/statusindicatorfactory.cxx | 8 +++---- framework/source/services/autorecovery.cxx | 4 +-- framework/source/services/frame.cxx | 14 ++++++------ 6 files changed, 30 insertions(+), 26 deletions(-)
New commits: commit ec0fcce54a33f406e4ddccb372e4fd4ecb34e252 Author: siddhisalunkhe1998 <[email protected]> AuthorDate: Sun Nov 9 11:43:57 2025 +0000 Commit: Hossein <[email protected]> CommitDate: Wed Nov 12 17:02:23 2025 +0100 tdf#145614 convert string literals into o3tl::enumarray groups all FRAME_PROPNAMEs related to Enum class FramePropHandle into o3tl::enumarray this patch is continuation of - https://gerrit.libreoffice.org/c/core/+/192468 Change-Id: I96b1e0f90c2d2735ae73bafc729e4c0183c6795b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/193657 Tested-by: Jenkins Reviewed-by: Hossein <[email protected]> diff --git a/framework/inc/properties.h b/framework/inc/properties.h index 1b766b337140..f6132e81e1a3 100644 --- a/framework/inc/properties.h +++ b/framework/inc/properties.h @@ -19,19 +19,11 @@ #pragma once +#include <o3tl/enumarray.hxx> #include <com/sun/star/uno/Any.hxx> namespace framework{ -/** properties for "Frame" class */ - -inline constexpr OUString FRAME_PROPNAME_ASCII_DISPATCHRECORDERSUPPLIER = u"DispatchRecorderSupplier"_ustr; -inline constexpr OUString FRAME_PROPNAME_ASCII_ISHIDDEN = u"IsHidden"_ustr; -inline constexpr OUString FRAME_PROPNAME_ASCII_LAYOUTMANAGER = u"LayoutManager"_ustr; -inline constexpr OUString FRAME_PROPNAME_ASCII_TITLE = u"Title"_ustr; -inline constexpr OUString FRAME_PROPNAME_ASCII_INDICATORINTERCEPTION = u"IndicatorInterception"_ustr; -inline constexpr OUString FRAME_PROPNAME_ASCII_URL = u"URL"_ustr; - // Please add new entries alphabetical sorted and correct all other handles! // Start counting with 0, so it can be used as direct index into an array too. enum class FramePropHandle : sal_Int32 @@ -41,7 +33,19 @@ enum class FramePropHandle : sal_Int32 LayoutManager = 2, Title = 3, IndicatorInterception = 4, - Url = 5 + Url = 5, + LAST = Url +}; + +/** properties for "Frame" class */ +inline constexpr o3tl::enumarray<FramePropHandle, OUString> FramePropNames = +{ + u"DispatchRecorderSupplier"_ustr, + u"IsHidden"_ustr, + u"LayoutManager"_ustr, + u"Title"_ustr, + u"IndicatorInterception"_ustr, + u"URL"_ustr }; /** properties for "LayoutManager" class */ diff --git a/framework/source/dispatch/popupmenudispatcher.cxx b/framework/source/dispatch/popupmenudispatcher.cxx index 1379d7ee7e81..59df1f5dc0ca 100644 --- a/framework/source/dispatch/popupmenudispatcher.cxx +++ b/framework/source/dispatch/popupmenudispatcher.cxx @@ -238,7 +238,7 @@ void PopupMenuDispatcher::impl_RetrievePopupControllerQuery() try { - xPropSet->getPropertyValue( FRAME_PROPNAME_ASCII_LAYOUTMANAGER ) >>= xLayoutManager; + xPropSet->getPropertyValue( FramePropNames[FramePropHandle::LayoutManager] ) >>= xLayoutManager; if ( xLayoutManager.is() ) { diff --git a/framework/source/fwe/classes/framelistanalyzer.cxx b/framework/source/fwe/classes/framelistanalyzer.cxx index ba2a63675ba4..2b3ff2d7e3ba 100644 --- a/framework/source/fwe/classes/framelistanalyzer.cxx +++ b/framework/source/fwe/classes/framelistanalyzer.cxx @@ -104,7 +104,7 @@ void FrameListAnalyzer::impl_analyze() css::uno::Reference< css::beans::XPropertySet > xSet(m_xReferenceFrame, css::uno::UNO_QUERY); if ( (m_eDetectMode & FrameAnalyzerFlags::Hidden) && xSet.is() ) { - xSet->getPropertyValue(FRAME_PROPNAME_ASCII_ISHIDDEN) >>= m_bReferenceIsHidden; + xSet->getPropertyValue(FramePropNames[FramePropHandle::IsHidden]) >>= m_bReferenceIsHidden; } // check, if the reference frame includes the backing component. @@ -224,7 +224,7 @@ void FrameListAnalyzer::impl_analyze() xSet.set(xFrame, css::uno::UNO_QUERY); if (xSet.is()) { - xSet->getPropertyValue(FRAME_PROPNAME_ASCII_ISHIDDEN) >>= bHidden; + xSet->getPropertyValue(FramePropNames[FramePropHandle::IsHidden]) >>= bHidden; } } diff --git a/framework/source/helper/statusindicatorfactory.cxx b/framework/source/helper/statusindicatorfactory.cxx index b4b1366554d7..4787e48865bd 100644 --- a/framework/source/helper/statusindicatorfactory.cxx +++ b/framework/source/helper/statusindicatorfactory.cxx @@ -341,7 +341,7 @@ void StatusIndicatorFactory::implts_makeParentVisibleIfAllowed() if (xPropSet.is()) { css::uno::Reference< css::frame::XLayoutManager2 > xLayoutManager; - xPropSet->getPropertyValue(FRAME_PROPNAME_ASCII_LAYOUTMANAGER) >>= xLayoutManager; + xPropSet->getPropertyValue(FramePropNames[FramePropHandle::LayoutManager]) >>= xLayoutManager; if (xLayoutManager.is()) { if ( !xLayoutManager->isVisible() ) @@ -419,7 +419,7 @@ void StatusIndicatorFactory::impl_createProgress() if (xPropSet.is()) { css::uno::Reference< css::frame::XLayoutManager2 > xLayoutManager; - xPropSet->getPropertyValue(FRAME_PROPNAME_ASCII_LAYOUTMANAGER) >>= xLayoutManager; + xPropSet->getPropertyValue(FramePropNames[FramePropHandle::LayoutManager]) >>= xLayoutManager; if (xLayoutManager.is()) { xLayoutManager->lock(); @@ -460,7 +460,7 @@ void StatusIndicatorFactory::impl_showProgress() if (xPropSet.is()) { css::uno::Reference< css::frame::XLayoutManager2 > xLayoutManager; - xPropSet->getPropertyValue(FRAME_PROPNAME_ASCII_LAYOUTMANAGER) >>= xLayoutManager; + xPropSet->getPropertyValue(FramePropNames[FramePropHandle::LayoutManager]) >>= xLayoutManager; if (xLayoutManager.is()) { // Be sure that we have always a progress. It can be that our frame @@ -498,7 +498,7 @@ void StatusIndicatorFactory::impl_hideProgress() if (xPropSet.is()) { css::uno::Reference< css::frame::XLayoutManager2 > xLayoutManager; - xPropSet->getPropertyValue(FRAME_PROPNAME_ASCII_LAYOUTMANAGER) >>= xLayoutManager; + xPropSet->getPropertyValue(FramePropNames[FramePropHandle::LayoutManager]) >>= xLayoutManager; if (xLayoutManager.is()) xLayoutManager->hideElement( PROGRESS_RESOURCE ); } diff --git a/framework/source/services/autorecovery.cxx b/framework/source/services/autorecovery.cxx index d47cd76a2863..23076630e455 100644 --- a/framework/source/services/autorecovery.cxx +++ b/framework/source/services/autorecovery.cxx @@ -4248,7 +4248,7 @@ void AutoRecovery::impl_establishProgress(const AutoRecovery::TDocumentInfo& { css::uno::Reference< css::beans::XPropertySet > xFrameProps(xFrame, css::uno::UNO_QUERY); if (xFrameProps.is()) - xFrameProps->setPropertyValue(FRAME_PROPNAME_ASCII_INDICATORINTERCEPTION, css::uno::Any(xExternalProgress)); + xFrameProps->setPropertyValue(FramePropNames[FramePropHandle::IndicatorInterception], css::uno::Any(xExternalProgress)); } // But inside the MediaDescriptor we must set our own create progress ... @@ -4280,7 +4280,7 @@ void AutoRecovery::impl_forgetProgress(const AutoRecovery::TDocumentInfo& // stop progress interception on corresponding frame. css::uno::Reference< css::beans::XPropertySet > xFrameProps(xFrame, css::uno::UNO_QUERY); if (xFrameProps.is()) - xFrameProps->setPropertyValue(FRAME_PROPNAME_ASCII_INDICATORINTERCEPTION, css::uno::Any(css::uno::Reference< css::task::XStatusIndicator >())); + xFrameProps->setPropertyValue(FramePropNames[FramePropHandle::IndicatorInterception], css::uno::Any(css::uno::Reference< css::task::XStatusIndicator >())); // forget progress inside list of arguments. utl::MediaDescriptor::iterator pArg = rArgs.find(utl::MediaDescriptor::PROP_STATUSINDICATOR); diff --git a/framework/source/services/frame.cxx b/framework/source/services/frame.cxx index 1e628f61f5ba..441b25b57bef 100644 --- a/framework/source/services/frame.cxx +++ b/framework/source/services/frame.cxx @@ -516,32 +516,32 @@ void XFrameImpl::initListeners() // set information about all supported properties impl_setPropertyChangeBroadcaster(*this); impl_addPropertyInfo( - FRAME_PROPNAME_ASCII_DISPATCHRECORDERSUPPLIER, + FramePropNames[FramePropHandle::DispatchRecorderSupplier], FramePropHandle::DispatchRecorderSupplier, cppu::UnoType<css::frame::XDispatchRecorderSupplier>::get(), css::beans::PropertyAttribute::TRANSIENT); impl_addPropertyInfo( - FRAME_PROPNAME_ASCII_INDICATORINTERCEPTION, + FramePropNames[FramePropHandle::IndicatorInterception], FramePropHandle::IndicatorInterception, cppu::UnoType<css::task::XStatusIndicator>::get(), css::beans::PropertyAttribute::TRANSIENT); impl_addPropertyInfo( - FRAME_PROPNAME_ASCII_ISHIDDEN, + FramePropNames[FramePropHandle::IsHidden], FramePropHandle::IsHidden, cppu::UnoType<bool>::get(), css::beans::PropertyAttribute::TRANSIENT | css::beans::PropertyAttribute::READONLY); impl_addPropertyInfo( - FRAME_PROPNAME_ASCII_LAYOUTMANAGER, + FramePropNames[FramePropHandle::LayoutManager], FramePropHandle::LayoutManager, cppu::UnoType<css::frame::XLayoutManager>::get(), css::beans::PropertyAttribute::TRANSIENT); impl_addPropertyInfo( - FRAME_PROPNAME_ASCII_TITLE, + FramePropNames[FramePropHandle::Title], FramePropHandle::Title, cppu::UnoType<OUString>::get(), css::beans::PropertyAttribute::TRANSIENT); impl_addPropertyInfo( - FRAME_PROPNAME_ASCII_URL, + FramePropNames[FramePropHandle::Url], FramePropHandle::Url, cppu::UnoType<OUString>::get(), css::beans::PropertyAttribute::TRANSIENT); @@ -3220,7 +3220,7 @@ void XFrameImpl::impl_setCloser( /*IN*/ const css::uno::Reference< css::frame::X { css::uno::Reference< css::beans::XPropertySet > xFrameProps(xFrame, css::uno::UNO_QUERY_THROW); css::uno::Reference< css::frame::XLayoutManager > xLayoutManager; - xFrameProps->getPropertyValue(FRAME_PROPNAME_ASCII_LAYOUTMANAGER) >>= xLayoutManager; + xFrameProps->getPropertyValue(FramePropNames[FramePropHandle::LayoutManager]) >>= xLayoutManager; css::uno::Reference< css::beans::XPropertySet > xLayoutProps(xLayoutManager, css::uno::UNO_QUERY_THROW); xLayoutProps->setPropertyValue(LAYOUTMANAGER_PROPNAME_MENUBARCLOSER, css::uno::Any(bState)); }
