summaryrefslogtreecommitdiff
path: root/toolkit
diff options
context:
space:
mode:
authorJulien Nabet <serval2412@yahoo.fr>2023-10-05 13:19:58 +0200
committerStephan Bergmann <sbergman@redhat.com>2023-10-05 16:09:32 +0200
commitb20d44d301258ea99d7c20366d35f8fab8682e3b (patch)
tree17ff1ed5d0ce1bd1d08ce0d26a2133c619cc7b4d /toolkit
parent6947cbca81b57adf78c0a3cf3108e664220d0cec (diff)
Replace getTabIndexPropertyName and getStepPropertyName (toolkit)
by constrexp or by using the string directly since used once. Change-Id: I0d232d5856551bd5dde22ed5075807d20f6f6624 Change-Id: I07d50845ec21998813f3fecb7fb183eaf234f7ca Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157591 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Diffstat (limited to 'toolkit')
-rw-r--r--toolkit/source/controls/controlmodelcontainerbase.cxx32
1 files changed, 10 insertions, 22 deletions
diff --git a/toolkit/source/controls/controlmodelcontainerbase.cxx b/toolkit/source/controls/controlmodelcontainerbase.cxx
index c82f1052eee3..8714b5ad64d4 100644
--- a/toolkit/source/controls/controlmodelcontainerbase.cxx
+++ b/toolkit/source/controls/controlmodelcontainerbase.cxx
@@ -133,19 +133,7 @@ public:
}
};
-
-static OUString getTabIndexPropertyName( )
-{
- return "TabIndex";
-}
-
-
-static OUString getStepPropertyName( )
-{
- return "Step";
-}
-
-
+constexpr OUString aTabIndexPropertyNameStr( u"TabIndex"_ustr );
ControlModelContainerBase::ControlModelContainerBase( const Reference< XComponentContext >& rxContext )
:ControlModelContainer_IBase( rxContext )
@@ -628,8 +616,8 @@ void SAL_CALL ControlModelContainerBase::setControlModels( const Sequence< Refer
Reference< XPropertySetInfo > xPSI;
if ( xProps.is() )
xPSI = xProps->getPropertySetInfo();
- if ( xPSI.is() && xPSI->hasPropertyByName( getTabIndexPropertyName() ) )
- xProps->setPropertyValue( getTabIndexPropertyName(), Any( nTabIndex++ ) );
+ if ( xPSI.is() && xPSI->hasPropertyByName( aTabIndexPropertyNameStr ) )
+ xProps->setPropertyValue( aTabIndexPropertyNameStr, Any( nTabIndex++ ) );
}
mbGroupsUpToDate = false;
}
@@ -660,10 +648,10 @@ Sequence< Reference< XControlModel > > SAL_CALL ControlModelContainerBase::getCo
DBG_ASSERT( xPSI.is(), "ControlModelContainerBase::getControlModels: invalid child model!" );
// has it?
- if ( xPSI.is() && xPSI->hasPropertyByName( getTabIndexPropertyName() ) )
+ if ( xPSI.is() && xPSI->hasPropertyByName( aTabIndexPropertyNameStr ) )
{ // yes
sal_Int32 nTabIndex = -1;
- xControlProps->getPropertyValue( getTabIndexPropertyName() ) >>= nTabIndex;
+ xControlProps->getPropertyValue( aTabIndexPropertyNameStr ) >>= nTabIndex;
aSortedModels.emplace( nTabIndex, xModel );
}
@@ -772,7 +760,7 @@ namespace
try
{
Reference< XPropertySet > xModelProps( _rxModel, UNO_QUERY );
- xModelProps->getPropertyValue( getStepPropertyName() ) >>= nStep;
+ xModelProps->getPropertyValue( u"Step"_ustr ) >>= nStep;
}
catch (const Exception&)
{
@@ -1001,8 +989,8 @@ void ControlModelContainerBase::startControlListening( const Reference< XControl
if ( xModelProps.is() )
xPSI = xModelProps->getPropertySetInfo();
- if ( xPSI.is() && xPSI->hasPropertyByName( getTabIndexPropertyName() ) )
- xModelProps->addPropertyChangeListener( getTabIndexPropertyName(), this );
+ if ( xPSI.is() && xPSI->hasPropertyByName( aTabIndexPropertyNameStr ) )
+ xModelProps->addPropertyChangeListener( aTabIndexPropertyNameStr, this );
}
@@ -1015,8 +1003,8 @@ void ControlModelContainerBase::stopControlListening( const Reference< XControlM
if ( xModelProps.is() )
xPSI = xModelProps->getPropertySetInfo();
- if ( xPSI.is() && xPSI->hasPropertyByName( getTabIndexPropertyName() ) )
- xModelProps->removePropertyChangeListener( getTabIndexPropertyName(), this );
+ if ( xPSI.is() && xPSI->hasPropertyByName( aTabIndexPropertyNameStr ) )
+ xModelProps->removePropertyChangeListener( aTabIndexPropertyNameStr, this );
}