summaryrefslogtreecommitdiff
path: root/UnoControls
diff options
context:
space:
mode:
authorCaolán McNamara <caolan.mcnamara@collabora.com>2024-01-07 15:57:43 +0000
committerCaolán McNamara <caolan.mcnamara@collabora.com>2024-01-08 10:04:05 +0100
commit60150ef4b8fc1d0a30f20c3d9ed6ba0725da16a5 (patch)
treef88aff4014d4055b9a459676ad1f597556326de4 /UnoControls
parent08c4ed96cc94df4a3859aa167e92e6f6da9c2ce7 (diff)
cid#1560054 use RVO
Change-Id: I04644c9ca78930d42289368b9a596f44a14b7012 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/161746 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
Diffstat (limited to 'UnoControls')
-rw-r--r--UnoControls/source/controls/OConnectionPointContainerHelper.cxx15
-rw-r--r--UnoControls/source/controls/OConnectionPointHelper.cxx15
-rw-r--r--UnoControls/source/controls/framecontrol.cxx22
-rw-r--r--UnoControls/source/controls/progressbar.cxx15
-rw-r--r--UnoControls/source/controls/progressmonitor.cxx12
5 files changed, 28 insertions, 51 deletions
diff --git a/UnoControls/source/controls/OConnectionPointContainerHelper.cxx b/UnoControls/source/controls/OConnectionPointContainerHelper.cxx
index bf687a0df5d6..110174812a3e 100644
--- a/UnoControls/source/controls/OConnectionPointContainerHelper.cxx
+++ b/UnoControls/source/controls/OConnectionPointContainerHelper.cxx
@@ -46,7 +46,6 @@ OConnectionPointContainerHelper::~OConnectionPointContainerHelper()
}
// XInterface
-
Any SAL_CALL OConnectionPointContainerHelper::queryInterface( const Type& aType )
{
// Attention:
@@ -58,18 +57,15 @@ Any SAL_CALL OConnectionPointContainerHelper::queryInterface( const Type& aType
)
);
- // If searched interface not supported by this class ...
- if ( !aReturn.hasValue() )
- {
- // ... ask baseclasses.
- aReturn = OWeakObject::queryInterface( aType );
- }
+ if (aReturn.hasValue())
+ return aReturn;
- return aReturn;
+ // If searched interface not supported by this class ...
+ // ... ask baseclasses.
+ return OWeakObject::queryInterface( aType );
}
// XInterface
-
void SAL_CALL OConnectionPointContainerHelper::acquire() noexcept
{
// Attention:
@@ -80,7 +76,6 @@ void SAL_CALL OConnectionPointContainerHelper::acquire() noexcept
}
// XInterface
-
void SAL_CALL OConnectionPointContainerHelper::release() noexcept
{
// Attention:
diff --git a/UnoControls/source/controls/OConnectionPointHelper.cxx b/UnoControls/source/controls/OConnectionPointHelper.cxx
index b6ddaaa513a0..b17edc2ba3da 100644
--- a/UnoControls/source/controls/OConnectionPointHelper.cxx
+++ b/UnoControls/source/controls/OConnectionPointHelper.cxx
@@ -52,7 +52,6 @@ OConnectionPointHelper::~OConnectionPointHelper()
}
// XInterface
-
Any SAL_CALL OConnectionPointHelper::queryInterface( const Type& aType )
{
// Attention:
@@ -64,18 +63,15 @@ Any SAL_CALL OConnectionPointHelper::queryInterface( const Type& aType )
)
);
- // If searched interface not supported by this class ...
- if ( !aReturn.hasValue() )
- {
- // ... ask baseclasses.
- aReturn = OWeakObject::queryInterface( aType );
- }
+ if (aReturn.hasValue())
+ return aReturn;
- return aReturn;
+ // If searched interface not supported by this class ...
+ // ... ask baseclasses.
+ return OWeakObject::queryInterface(aType);
}
// XInterface
-
void SAL_CALL OConnectionPointHelper::acquire() noexcept
{
// Attention:
@@ -86,7 +82,6 @@ void SAL_CALL OConnectionPointHelper::acquire() noexcept
}
// XInterface
-
void SAL_CALL OConnectionPointHelper::release() noexcept
{
// Attention:
diff --git a/UnoControls/source/controls/framecontrol.cxx b/UnoControls/source/controls/framecontrol.cxx
index f58c77a3b76a..ab841d906fde 100644
--- a/UnoControls/source/controls/framecontrol.cxx
+++ b/UnoControls/source/controls/framecontrol.cxx
@@ -70,7 +70,6 @@ FrameControl::~FrameControl()
}
// XInterface
-
Any SAL_CALL FrameControl::queryInterface( const Type& rType )
{
// Ask for my own supported interfaces ...
@@ -81,22 +80,18 @@ Any SAL_CALL FrameControl::queryInterface( const Type& rType )
)
);
- // If searched interface not supported by this class ...
- if ( !aReturn.hasValue() )
- {
- // ... ask baseclasses.
- aReturn = OPropertySetHelper::queryInterface( rType );
- if ( !aReturn.hasValue() )
- {
- aReturn = BaseControl::queryInterface( rType );
- }
- }
+ if (aReturn.hasValue())
+ return aReturn;
- return aReturn;
+ // If searched interface not supported by this class ...
+ // ... ask baseclasses.
+ aReturn = OPropertySetHelper::queryInterface(rType);
+ if (aReturn.hasValue())
+ return aReturn;
+ return BaseControl::queryInterface(rType);
}
// XInterface
-
void SAL_CALL FrameControl::acquire() noexcept
{
// Attention:
@@ -107,7 +102,6 @@ void SAL_CALL FrameControl::acquire() noexcept
}
// XInterface
-
void SAL_CALL FrameControl::release() noexcept
{
// Attention:
diff --git a/UnoControls/source/controls/progressbar.cxx b/UnoControls/source/controls/progressbar.cxx
index 6ba8874fbb88..1cf0bc08a36f 100644
--- a/UnoControls/source/controls/progressbar.cxx
+++ b/UnoControls/source/controls/progressbar.cxx
@@ -52,7 +52,6 @@ ProgressBar::~ProgressBar()
}
// XInterface
-
Any SAL_CALL ProgressBar::queryInterface( const Type& rType )
{
// Ask for my own supported interfaces ...
@@ -63,18 +62,15 @@ Any SAL_CALL ProgressBar::queryInterface( const Type& rType )
)
);
- // If searched interface not supported by this class ...
- if ( !aReturn.hasValue() )
- {
- // ... ask baseclasses.
- aReturn = BaseControl::queryInterface( rType );
- }
+ if (aReturn.hasValue())
+ return aReturn;
- return aReturn;
+ // If searched interface not supported by this class ...
+ // ... ask baseclasses.
+ return BaseControl::queryInterface(rType);
}
// XInterface
-
void SAL_CALL ProgressBar::acquire() noexcept
{
// Attention:
@@ -85,7 +81,6 @@ void SAL_CALL ProgressBar::acquire() noexcept
}
// XInterface
-
void SAL_CALL ProgressBar::release() noexcept
{
// Attention:
diff --git a/UnoControls/source/controls/progressmonitor.cxx b/UnoControls/source/controls/progressmonitor.cxx
index 7df767760323..d58518e0e8ff 100644
--- a/UnoControls/source/controls/progressmonitor.cxx
+++ b/UnoControls/source/controls/progressmonitor.cxx
@@ -121,14 +121,12 @@ Any SAL_CALL ProgressMonitor::queryInterface( const Type& rType )
)
);
- // If searched interface not supported by this class ...
- if ( !aReturn.hasValue() )
- {
- // ... ask baseclasses.
- aReturn = BaseControl::queryInterface( rType );
- }
+ if (aReturn.hasValue())
+ return aReturn;
- return aReturn;
+ // If searched interface not supported by this class ...
+ // ... ask baseclasses.
+ return BaseControl::queryInterface(rType);
}
// XInterface