sw/source/core/unocore/unotbl.cxx  |    4 ++--
 sw/source/core/unocore/unotext.cxx |    8 ++++----
 2 files changed, 6 insertions(+), 6 deletions(-)

New commits:
commit 814cc6e8a30bde58adfb9f114c435dcb11c1e013
Author:     Noel Grandin <noel.gran...@collabora.co.uk>
AuthorDate: Sun Oct 30 15:01:25 2022 +0200
Commit:     Noel Grandin <noel.gran...@collabora.co.uk>
CommitDate: Sun Oct 30 16:42:34 2022 +0100

    tdf#126788 reduce number of comparisons to query XUnoTunnel
    
    Change-Id: I581fa6944f9da9195651bacd2f11fd7f35967ebb
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/142041
    Tested-by: Jenkins
    Reviewed-by: Noel Grandin <noel.gran...@collabora.co.uk>

diff --git a/sw/source/core/unocore/unotbl.cxx 
b/sw/source/core/unocore/unotbl.cxx
index 2201a3ebb688..f1d697a36c81 100644
--- a/sw/source/core/unocore/unotbl.cxx
+++ b/sw/source/core/unocore/unotbl.cxx
@@ -781,9 +781,9 @@ void SAL_CALL SwXCell::release(  ) noexcept
 
 uno::Any SAL_CALL SwXCell::queryInterface( const uno::Type& aType )
 {
-    uno::Any aRet = SwXCellBaseClass::queryInterface(aType);
+    uno::Any aRet = SwXText::queryInterface(aType);
     if(aRet.getValueType() == cppu::UnoType<void>::get())
-        aRet = SwXText::queryInterface(aType);
+        aRet = SwXCellBaseClass::queryInterface(aType);
     return aRet;
 }
 
diff --git a/sw/source/core/unocore/unotext.cxx 
b/sw/source/core/unocore/unotext.cxx
index be1f76fe5353..bdaf1d0357e3 100644
--- a/sw/source/core/unocore/unotext.cxx
+++ b/sw/source/core/unocore/unotext.cxx
@@ -198,6 +198,10 @@ SwXText::queryInterface(const uno::Type& rType)
     {
         aRet <<= uno::Reference< text::XText >(this);
     }
+    else if (rType == cppu::UnoType<lang::XUnoTunnel>::get())
+    {
+        aRet <<= uno::Reference< lang::XUnoTunnel >(this);
+    }
     else if (rType == cppu::UnoType<text::XSimpleText>::get())
     {
         aRet <<= uno::Reference< text::XSimpleText >(this);
@@ -226,10 +230,6 @@ SwXText::queryInterface(const uno::Type& rType)
     {
         aRet <<= uno::Reference< beans::XPropertySet >(this);
     }
-    else if (rType == cppu::UnoType<lang::XUnoTunnel>::get())
-    {
-        aRet <<= uno::Reference< lang::XUnoTunnel >(this);
-    }
     else if (rType == cppu::UnoType<text::XTextAppendAndConvert>::get())
     {
         aRet <<= uno::Reference< text::XTextAppendAndConvert >(this);

Reply via email to