[Libreoffice-commits] core.git: reportdesign/source

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Fri Oct 19 06:01:04 UTC 2018


 reportdesign/source/ui/inspection/DefaultInspection.cxx |   30 ++--------------
 1 file changed, 5 insertions(+), 25 deletions(-)

New commits:
commit b25e2451d981878fbde636b66bfa48f13d21fa7e
Author:     Noel Grandin <noelgrandin at gmail.com>
AuthorDate: Thu Oct 18 19:04:20 2018 +0200
Commit:     Noel Grandin <noel.grandin at collabora.co.uk>
CommitDate: Fri Oct 19 07:59:06 2018 +0200

    simplify construction of Sequence
    
    and don't bother with mutex when returning static data
    
    Change-Id: I92bb53cf4e9ae8996b25a1d83cb5ffa4a8d4aed5
    Reviewed-on: https://gerrit.libreoffice.org/61948
    Tested-by: Jenkins
    Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>

diff --git a/reportdesign/source/ui/inspection/DefaultInspection.cxx b/reportdesign/source/ui/inspection/DefaultInspection.cxx
index 9ddb7ec0f3a4..2067652f413a 100644
--- a/reportdesign/source/ui/inspection/DefaultInspection.cxx
+++ b/reportdesign/source/ui/inspection/DefaultInspection.cxx
@@ -94,33 +94,13 @@ namespace rptui
 
     Sequence< Any > SAL_CALL DefaultComponentInspectorModel::getHandlerFactories()
     {
-        ::osl::MutexGuard aGuard( m_aMutex );
-
-
         // service names for all our handlers
-        static const struct
-        {
-            const sal_Char* serviceName;
-        } aFactories[] = {
-
-            { "com.sun.star.report.inspection.ReportComponentHandler"},
-            { "com.sun.star.form.inspection.EditPropertyHandler"},
-            { "com.sun.star.report.inspection.DataProviderHandler"},
-            { "com.sun.star.report.inspection.GeometryHandler"}
-
-            // generic virtual edit properties
-
+        return Sequence<Any> {
+            Any(OUString( "com.sun.star.report.inspection.ReportComponentHandler")),
+            Any(OUString( "com.sun.star.form.inspection.EditPropertyHandler")),
+            Any(OUString( "com.sun.star.report.inspection.DataProviderHandler")),
+            Any(OUString( "com.sun.star.report.inspection.GeometryHandler"))
         };
-
-        const size_t nFactories = SAL_N_ELEMENTS( aFactories );
-        Sequence< Any > aReturn( nFactories );
-        Any* pReturn = aReturn.getArray();
-        for (const auto& rFactory : aFactories)
-        {
-            *pReturn++ <<= OUString::createFromAscii( rFactory.serviceName );
-        }
-
-        return aReturn;
     }
 
     sal_Bool SAL_CALL DefaultComponentInspectorModel::getHasHelpSection()


More information about the Libreoffice-commits mailing list