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

2023-10-20 Thread Stephan Bergmann (via logerrit)
 stoc/source/implementationregistration/implreg.cxx |   40 ++---
 stoc/source/security/access_controller.cxx |4 +-
 stoc/source/security/file_policy.cxx   |2 -
 3 files changed, 23 insertions(+), 23 deletions(-)

New commits:
commit ea4d4d0979ae295f1045362c621bdcb6583fbc15
Author: Stephan Bergmann 
AuthorDate: Thu Oct 19 10:30:29 2023 +0200
Commit: Stephan Bergmann 
CommitDate: Fri Oct 20 12:50:55 2023 +0200

Extended loplugin:ostr: Automatic rewrite O[U]StringLiteral: stoc

Change-Id: Ic8c251b97f5e5bdf81599534384d86ac9904da53
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158222
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann 

diff --git a/stoc/source/implementationregistration/implreg.cxx 
b/stoc/source/implementationregistration/implreg.cxx
index 0f711b7dcf63..ca8c6b2673df 100644
--- a/stoc/source/implementationregistration/implreg.cxx
+++ b/stoc/source/implementationregistration/implreg.cxx
@@ -57,28 +57,28 @@ using namespace osl;
 
 namespace {
 
-constexpr OUStringLiteral slash_UNO_slash_REGISTRY_LINKS
-= u"/UNO/REGISTRY_LINKS";
-constexpr OUStringLiteral slash_IMPLEMENTATIONS
-=  u"/IMPLEMENTATIONS";
-constexpr OUStringLiteral slash_UNO
-= u"/UNO";
-constexpr OUStringLiteral slash_UNO_slash_SERVICES
-= u"/UNO/SERVICES";
-constexpr OUStringLiteral slash_UNO_slash_SINGLETONS
-= u"/UNO/SINGLETONS";
-constexpr OUStringLiteral slash_SERVICES
-= u"/SERVICES/";
-constexpr OUStringLiteral slash_UNO_slash_LOCATION
-= u"/UNO/LOCATION";
-constexpr OUStringLiteral slash_UNO_slash_ACTIVATOR
-= u"/UNO/ACTIVATOR";
-constexpr OUStringLiteral colon_old
-= u":old";
+constexpr OUString slash_UNO_slash_REGISTRY_LINKS
+= u"/UNO/REGISTRY_LINKS"_ustr;
+constexpr OUString slash_IMPLEMENTATIONS
+=  u"/IMPLEMENTATIONS"_ustr;
+constexpr OUString slash_UNO
+= u"/UNO"_ustr;
+constexpr OUString slash_UNO_slash_SERVICES
+= u"/UNO/SERVICES"_ustr;
+constexpr OUString slash_UNO_slash_SINGLETONS
+= u"/UNO/SINGLETONS"_ustr;
+constexpr OUString slash_SERVICES
+= u"/SERVICES/"_ustr;
+constexpr OUString slash_UNO_slash_LOCATION
+= u"/UNO/LOCATION"_ustr;
+constexpr OUString slash_UNO_slash_ACTIVATOR
+= u"/UNO/ACTIVATOR"_ustr;
+constexpr OUString colon_old
+= u":old"_ustr;
 constexpr OUStringLiteral com_sun_star_registry_SimpleRegistry
 = u"com.sun.star.registry.SimpleRegistry";
-constexpr OUStringLiteral Registry
-= u"Registry";
+constexpr OUString Registry
+= u"Registry"_ustr;
 
 //  static deleteAllLinkReferences()
 
diff --git a/stoc/source/security/access_controller.cxx 
b/stoc/source/security/access_controller.cxx
index af58d1472878..1359e529c73d 100644
--- a/stoc/source/security/access_controller.cxx
+++ b/stoc/source/security/access_controller.cxx
@@ -50,7 +50,7 @@
 
 #include 
 
-constexpr OUStringLiteral SERVICE_NAME = 
u"com.sun.star.security.AccessController";
+constexpr OUString SERVICE_NAME = 
u"com.sun.star.security.AccessController"_ustr;
 constexpr OUStringLiteral USER_CREDS  = u"access-control.user-credentials.id";
 
 
@@ -64,7 +64,7 @@ namespace {
 
 // static stuff initialized when loading lib
 OUString s_envType = CPPU_CURRENT_LANGUAGE_BINDING_NAME;
-constexpr OUStringLiteral s_acRestriction = u"access-control.restriction";
+constexpr OUString s_acRestriction = u"access-control.restriction"_ustr;
 
 
 /** ac context intersects permissions of two ac contexts
diff --git a/stoc/source/security/file_policy.cxx 
b/stoc/source/security/file_policy.cxx
index 5bbd604b1a72..63d0c6156e50 100644
--- a/stoc/source/security/file_policy.cxx
+++ b/stoc/source/security/file_policy.cxx
@@ -40,7 +40,7 @@
 #include 
 #include 
 
-constexpr OUStringLiteral IMPL_NAME = 
u"com.sun.star.security.comp.stoc.FilePolicy";
+constexpr OUString IMPL_NAME = 
u"com.sun.star.security.comp.stoc.FilePolicy"_ustr;
 
 using namespace ::osl;
 using namespace ::cppu;


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

2023-10-18 Thread Stephan Bergmann (via logerrit)
 stoc/source/javavm/javavm.cxx |6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

New commits:
commit 871c37f782a53cec13bed724b90495197348aa29
Author: Stephan Bergmann 
AuthorDate: Wed Oct 18 16:57:14 2023 +0200
Commit: Stephan Bergmann 
CommitDate: Wed Oct 18 18:34:01 2023 +0200

loplugin:indentation

Change-Id: If81844107209c3fb04d39c9f2b826b623068fc30
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158120
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann 

diff --git a/stoc/source/javavm/javavm.cxx b/stoc/source/javavm/javavm.cxx
index fa5883ae3fa7..a41dde50f1ef 100644
--- a/stoc/source/javavm/javavm.cxx
+++ b/stoc/source/javavm/javavm.cxx
@@ -474,9 +474,9 @@ public:
 // current thread" calls to the JVM.
 if (CFRunLoopGetCurrent() != CFRunLoopGetMain())
 #endif
-if (m_jvm->DetachCurrentThread() != 0) {
-OSL_ASSERT(false);
-}
+if (m_jvm->DetachCurrentThread() != 0) {
+OSL_ASSERT(false);
+}
 }
 
 DetachCurrentThread(const DetachCurrentThread&) = delete;


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

2023-09-24 Thread Julien Nabet (via logerrit)
 stoc/source/proxy_factory/proxyfac.cxx |3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

New commits:
commit aaccb43dad5290cde04b36209ca9fa95d69ba060
Author: Julien Nabet 
AuthorDate: Sat Sep 23 10:37:54 2023 +0200
Commit: Julien Nabet 
CommitDate: Sun Sep 24 09:00:26 2023 +0200

tdf#157288: "Primary key" missing when right click a field during table 
edition

Revert partly 0c2b2c9babfd781e0d9d68bb2a14a045b0c6ec4c
"Use getXWeak in stoc"

Change-Id: I0344510dee33c8740937354d64c0e60115606d26
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157178
Tested-by: Jenkins
Reviewed-by: Julien Nabet 

diff --git a/stoc/source/proxy_factory/proxyfac.cxx 
b/stoc/source/proxy_factory/proxyfac.cxx
index 2653363b3c36..6745d0163c70 100644
--- a/stoc/source/proxy_factory/proxyfac.cxx
+++ b/stoc/source/proxy_factory/proxyfac.cxx
@@ -292,7 +292,8 @@ Any ProxyRoot::queryAggregation( Type const & rType )
 OSL_ASSERT( cpp_env != nullptr );
 
 // mind a new delegator, calculate current root:
-Reference< XInterface > xRoot(getXWeak());
+Reference< XInterface > xRoot(
+static_cast< OWeakObject * >(this), UNO_QUERY_THROW );
 OUString oid;
 (*cpp_env->getObjectIdentifier)( cpp_env, , xRoot.get() 
);
 OSL_ASSERT( !oid.isEmpty() );


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

2023-09-09 Thread Noel Grandin (via logerrit)
 stoc/source/defaultregistry/defaultregistry.cxx |3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

New commits:
commit dc69edc50c8ccde2422d21d5b3899d08f7510574
Author: Noel Grandin 
AuthorDate: Fri Sep 8 14:00:49 2023 +0200
Commit: Noel Grandin 
CommitDate: Sat Sep 9 15:41:18 2023 +0200

NestedRegistryImpl does not need to implement XAggreggation

Checked on jenkins using 'make check' and

+  void SAL_CALL setDelegator(css::uno::Reference 
const &) final { assert(false); }

Change-Id: I3eb7f69ab16bedbe32e457f67257393822dc90d1
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156718
Tested-by: Jenkins
Reviewed-by: Noel Grandin 

diff --git a/stoc/source/defaultregistry/defaultregistry.cxx 
b/stoc/source/defaultregistry/defaultregistry.cxx
index 689aed725795..815d7a6679c3 100644
--- a/stoc/source/defaultregistry/defaultregistry.cxx
+++ b/stoc/source/defaultregistry/defaultregistry.cxx
@@ -21,7 +21,6 @@
 #include 
 #include 
 #include 
-#include 
 #include 
 #include 
 
@@ -41,7 +40,7 @@ using namespace osl;
 
 namespace {
 
-class NestedRegistryImpl: public WeakAggImplHelper4 < XSimpleRegistry, 
XInitialization, XServiceInfo, XEnumerationAccess >
+class NestedRegistryImpl : public WeakImplHelper < XSimpleRegistry, 
XInitialization, XServiceInfo, XEnumerationAccess >
 {
 public:
 NestedRegistryImpl( );


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

2023-08-24 Thread Mike Kaganski (via logerrit)
 stoc/source/javavm/javavm.cxx |6 --
 1 file changed, 4 insertions(+), 2 deletions(-)

New commits:
commit a3ce697e10a63d96cd081979b0f134239305a7cc
Author: Mike Kaganski 
AuthorDate: Wed Aug 23 12:35:55 2023 +0300
Commit: Mike Kaganski 
CommitDate: Thu Aug 24 08:53:58 2023 +0200

Small refactor

Change-Id: I25fb8a769cd5e97863e5bd9fabae670589e4a18a
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156018
Tested-by: Jenkins
Reviewed-by: Mike Kaganski 

diff --git a/stoc/source/javavm/javavm.cxx b/stoc/source/javavm/javavm.cxx
index b68813e5ffae..091bb7779eeb 100644
--- a/stoc/source/javavm/javavm.cxx
+++ b/stoc/source/javavm/javavm.cxx
@@ -594,7 +594,7 @@ JavaVirtualMachine::getJavaVM(css::uno::Sequence< sal_Int8 
> const & rProcessId)
 }
 
 JNIEnv * pMainThreadEnv = nullptr;
-javaFrameworkError errcode = JFW_E_NONE;
+javaFrameworkError errcode;
 
 if (getenv("STOC_FORCE_NO_JRE"))
 errcode = JFW_E_NO_SELECT;
@@ -610,9 +610,11 @@ JavaVirtualMachine::getJavaVM(css::uno::Sequence< sal_Int8 
> const & rProcessId)
 {
 // No Java configured. We silently run the Java configuration
 info.reset();
-javaFrameworkError errFind = jfw_findAndSelectJRE();
+javaFrameworkError errFind;
 if (getenv("STOC_FORCE_NO_JRE"))
 errFind = JFW_E_NO_JAVA_FOUND;
+else
+errFind = jfw_findAndSelectJRE();
 if (errFind == JFW_E_NONE)
 {
 continue;


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

2023-08-23 Thread Mike Kaganski (via logerrit)
 stoc/source/javavm/javavm.cxx |9 +++--
 1 file changed, 3 insertions(+), 6 deletions(-)

New commits:
commit f12d6b76b6dd80c81a4d9902593ef5c762a3af73
Author: Mike Kaganski 
AuthorDate: Wed Aug 23 10:13:58 2023 +0300
Commit: Mike Kaganski 
CommitDate: Wed Aug 23 10:54:13 2023 +0200

tdf#156701: Move DontEnableJava handling into askForRetry

Change-Id: I0deeed09fcea765e66c1967f40d60a1222f90c08
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155964
Tested-by: Jenkins
Reviewed-by: Mike Kaganski 

diff --git a/stoc/source/javavm/javavm.cxx b/stoc/source/javavm/javavm.cxx
index 305ebe290d34..b68813e5ffae 100644
--- a/stoc/source/javavm/javavm.cxx
+++ b/stoc/source/javavm/javavm.cxx
@@ -128,6 +128,9 @@ static void destroyAttachGuards(void * pData)
 
 bool askForRetry(css::uno::Any const & rException)
 {
+if (comphelper::IsContextFlagActive("DontEnableJava"))
+return false;
+
 css::uno::Reference< css::uno::XCurrentContext > xContext(
 css::uno::getCurrentContext());
 if (xContext.is())
@@ -650,9 +653,6 @@ JavaVirtualMachine::getJavaVM(css::uno::Sequence< sal_Int8 
> const & rProcessId)
 }
 case JFW_E_JAVA_DISABLED:
 {
-if (comphelper::IsContextFlagActive("DontEnableJava"))
-return css::uno::Any();
-
 //QueryBox:
 //%PRODUCTNAME requires a Java runtime environment (JRE) to perform
 //this task. However, use of a JRE has been disabled. Do you want 
to
@@ -690,9 +690,6 @@ JavaVirtualMachine::getJavaVM(css::uno::Sequence< sal_Int8 
> const & rProcessId)
 }
 }
 
-if (comphelper::IsContextFlagActive("DontEnableJava"))
-return css::uno::Any();
-
 //Error: %PRODUCTNAME requires a Java
 //runtime environment (JRE) to perform this task. The selected JRE
 //is defective. Please select another version or install a new JRE


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

2023-07-31 Thread Mike Kaganski (via logerrit)
 stoc/source/javavm/javavm.cxx |3 +++
 1 file changed, 3 insertions(+)

New commits:
commit dbe0ad486c60bde96b7f8019f31d855e3eae545b
Author: Mike Kaganski 
AuthorDate: Sun Jul 30 19:46:02 2023 +0300
Commit: Mike Kaganski 
CommitDate: Mon Jul 31 16:46:12 2023 +0200

tdf#156161: Honor "DontEnableJava" when failed because selected JRE 
uninstalled

Change-Id: Id90f530fda9e565a5a53853a3acb8195035a80ff
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155078
Tested-by: Jenkins
Reviewed-by: Mike Kaganski 

diff --git a/stoc/source/javavm/javavm.cxx b/stoc/source/javavm/javavm.cxx
index 96fdd61401fc..305ebe290d34 100644
--- a/stoc/source/javavm/javavm.cxx
+++ b/stoc/source/javavm/javavm.cxx
@@ -690,6 +690,9 @@ JavaVirtualMachine::getJavaVM(css::uno::Sequence< sal_Int8 
> const & rProcessId)
 }
 }
 
+if (comphelper::IsContextFlagActive("DontEnableJava"))
+return css::uno::Any();
+
 //Error: %PRODUCTNAME requires a Java
 //runtime environment (JRE) to perform this task. The selected JRE
 //is defective. Please select another version or install a new JRE


[Libreoffice-commits] core.git: stoc/source stoc/test

2023-06-18 Thread Mike Kaganski (via logerrit)
 stoc/source/corereflection/crarray.cxx   |   16 +-
 stoc/source/corereflection/crcomp.cxx|   10 -
 stoc/source/corereflection/crefl.cxx |8 -
 stoc/source/corereflection/crenum.cxx|4 
 stoc/source/corereflection/criface.cxx   |8 -
 stoc/source/inspect/introspection.cxx|4 
 stoc/source/invocation/invocation.cxx|4 
 stoc/source/javaloader/javaloader.cxx|2 
 stoc/source/javavm/javavm.cxx|   50 +++---
 stoc/source/proxy_factory/proxyfac.cxx   |3 
 stoc/source/security/access_controller.cxx   |   18 +-
 stoc/source/security/file_policy.cxx |2 
 stoc/source/servicemanager/servicemanager.cxx|   12 -
 stoc/source/simpleregistry/simpleregistry.cxx|  110 +++
 stoc/source/typeconv/convert.cxx |2 
 stoc/source/uriproc/UriReferenceFactory.cxx  |2 
 stoc/test/javavm/jvm_interaction/interactionhandler.cxx  |5 
 stoc/test/registry_tdprovider/testregistrytdprovider.cxx |2 
 stoc/test/tdmanager/testtdmanager.cxx|2 
 stoc/test/testproxyfac.cxx   |   10 -
 20 files changed, 136 insertions(+), 138 deletions(-)

New commits:
commit 0c2b2c9babfd781e0d9d68bb2a14a045b0c6ec4c
Author: Mike Kaganski 
AuthorDate: Sun Apr 23 20:14:54 2023 +0300
Commit: Mike Kaganski 
CommitDate: Sun Jun 18 11:10:20 2023 +0200

Use getXWeak in stoc

Change-Id: Icd694eeae002ab28cbd06ba3097e9039e299de3b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/150871
Tested-by: Jenkins
Reviewed-by: Mike Kaganski 

diff --git a/stoc/source/corereflection/crarray.cxx 
b/stoc/source/corereflection/crarray.cxx
index ca8d159ef721..67be31e1ac93 100644
--- a/stoc/source/corereflection/crarray.cxx
+++ b/stoc/source/corereflection/crarray.cxx
@@ -40,13 +40,13 @@ void ArrayIdlClassImpl::realloc( Any & rArray, sal_Int32 
nLen )
 {
 throw IllegalArgumentException(
 "expected sequence, but found " + 
rArray.getValueType().getTypeName(),
-static_cast(static_cast(this)), 0 );
+getXWeak(), 0 );
 }
 if (nLen < 0)
 {
 throw IllegalArgumentException(
 "negative length given!",
-static_cast(static_cast(this)), 1 );
+getXWeak(), 1 );
 }
 
 uno_Sequence ** ppSeq = const_cast(static_cast(rArray.getValue()));
@@ -64,7 +64,7 @@ sal_Int32 ArrayIdlClassImpl::getLen( const Any & rArray )
 {
 throw IllegalArgumentException(
 "expected sequence, but found " + 
rArray.getValueType().getTypeName(),
-static_cast(static_cast(this)), 0 );
+getXWeak(), 0 );
 }
 
 return (*static_cast(rArray.getValue()))->nElements;
@@ -77,7 +77,7 @@ Any ArrayIdlClassImpl::get( const Any & rArray, sal_Int32 
nIndex )
 {
 throw IllegalArgumentException(
 "expected sequence, but found " + 
rArray.getValueType().getTypeName(),
-static_cast(static_cast(this)), 0 );
+getXWeak(), 0 );
 }
 
 uno_Sequence * pSeq = *static_cast(rArray.getValue());
@@ -85,7 +85,7 @@ Any ArrayIdlClassImpl::get( const Any & rArray, sal_Int32 
nIndex )
 {
 throw ArrayIndexOutOfBoundsException(
 "illegal index given, index " + OUString::number(nIndex) + " is < 
" + OUString::number(pSeq->nElements),
-static_cast(static_cast(this)) );
+getXWeak() );
 }
 
 Any aRet;
@@ -107,7 +107,7 @@ void ArrayIdlClassImpl::set( Any & rArray, sal_Int32 
nIndex, const Any & rNewVal
 {
 throw IllegalArgumentException(
 "expected sequence, but found " + 
rArray.getValueType().getTypeName(),
-static_cast(static_cast(this)), 0 );
+getXWeak(), 0 );
 }
 
 uno_Sequence * pSeq = *static_cast(rArray.getValue());
@@ -115,7 +115,7 @@ void ArrayIdlClassImpl::set( Any & rArray, sal_Int32 
nIndex, const Any & rNewVal
 {
 throw ArrayIndexOutOfBoundsException(
 "illegal index given, index " + OUString::number(nIndex) + " is < 
" + OUString::number(pSeq->nElements),
-static_cast(static_cast(this)) );
+getXWeak() );
 }
 
 uno_Sequence ** ppSeq = const_cast(static_cast(rArray.getValue()));
@@ -135,7 +135,7 @@ void ArrayIdlClassImpl::set( Any & rArray, sal_Int32 
nIndex, const Any & rNewVal
 TYPELIB_DANGER_RELEASE( pElemTypeDescr );
 throw IllegalArgumentException(
 "sequence element is not assignable by given value!",
-static_cast(static_cast(this)), 2 );
+getXWeak(), 2 );
 }
 TYPELIB_DANGER_RELEASE( pElemTypeDescr );
 }
diff --git a/stoc/source/corereflection/crcomp.cxx 
b/stoc/source/corereflection/crcomp.cxx

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

2023-01-19 Thread Stephan Bergmann (via logerrit)
 stoc/source/corereflection/base.hxx  |   23 +
 stoc/source/corereflection/crefl.cxx |   47 +--
 2 files changed, 9 insertions(+), 61 deletions(-)

New commits:
commit 1786cd0687c5223821e673fe4d2f7b2ff65deb00
Author: Stephan Bergmann 
AuthorDate: Thu Jan 19 14:05:58 2023 +0100
Commit: Stephan Bergmann 
CommitDate: Thu Jan 19 15:00:41 2023 +

Base IdlReflectionServiceImpl on WeakComponentImplHelper

...rather than on the deprecated OComponentHelper

Change-Id: Icb83d3cc0a0588a703a9041c00730b2a8d8bb90b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/145789
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann 

diff --git a/stoc/source/corereflection/base.hxx 
b/stoc/source/corereflection/base.hxx
index 05975d3d24b7..03d844de3cc9 100644
--- a/stoc/source/corereflection/base.hxx
+++ b/stoc/source/corereflection/base.hxx
@@ -28,7 +28,7 @@
 #include 
 #include 
 #include 
-#include 
+#include 
 #include 
 #include 
 
@@ -74,10 +74,10 @@ typedef std::unordered_map< OUString, 
css::uno::WeakReference< css::reflection::
 
 
 class IdlReflectionServiceImpl
-: public ::cppu::OComponentHelper
-, public css::reflection::XIdlReflection
-, public css::container::XHierarchicalNameAccess
-, public css::lang::XServiceInfo
+: public ::cppu::WeakComponentImplHelper<
+  css::reflection::XIdlReflection,
+  css::container::XHierarchicalNameAccess,
+  css::lang::XServiceInfo>
 {
 ::osl::Mutex_aComponentMutex;
 css::uno::Reference< css::container::XHierarchicalNameAccess >_xTDMgr;
@@ -102,23 +102,14 @@ public:
 explicit IdlReflectionServiceImpl( const css::uno::Reference< 
css::uno::XComponentContext > & xContext );
 virtual ~IdlReflectionServiceImpl() override;
 
-// XInterface
-virtual css::uno::Any SAL_CALL queryInterface( const css::uno::Type & 
rType ) override;
-virtual void SAL_CALL acquire() noexcept override;
-virtual void SAL_CALL release() noexcept override;
-
-// some XComponent part from OComponentHelper
-virtual void SAL_CALL dispose() override;
+// WeakComponentImplHelper
+virtual void SAL_CALL disposing() override;
 
 // XServiceInfo
 virtual OUString SAL_CALL getImplementationName() override;
 virtual sal_Bool SAL_CALL supportsService( const OUString & rServiceName ) 
override;
 virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() 
override;
 
-// XTypeProvider
-virtual css::uno::Sequence< css::uno::Type > SAL_CALL getTypes() override;
-virtual css::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() 
override;
-
 // XIdlReflection
 virtual css::uno::Reference< css::reflection::XIdlClass > SAL_CALL 
forName( const OUString & rTypeName ) override;
 virtual css::uno::Reference< css::reflection::XIdlClass > SAL_CALL 
getType( const css::uno::Any & rObj ) override;
diff --git a/stoc/source/corereflection/crefl.cxx 
b/stoc/source/corereflection/crefl.cxx
index af1854e7e3b4..4f396065b478 100644
--- a/stoc/source/corereflection/crefl.cxx
+++ b/stoc/source/corereflection/crefl.cxx
@@ -45,7 +45,7 @@ namespace stoc_corefl
 
 IdlReflectionServiceImpl::IdlReflectionServiceImpl(
 const Reference< XComponentContext > & xContext )
-: OComponentHelper( _aComponentMutex )
+: WeakComponentImplHelper( _aComponentMutex )
 {
 xContext->getValueByName(
 "/singletons/com.sun.star.reflection.theTypeDescriptionManager" ) >>= 
_xTDMgr;
@@ -54,53 +54,10 @@ IdlReflectionServiceImpl::IdlReflectionServiceImpl(
 
 IdlReflectionServiceImpl::~IdlReflectionServiceImpl() {}
 
-// XInterface
-
-Any IdlReflectionServiceImpl::queryInterface( const Type & rType )
-{
-Any aRet( ::cppu::queryInterface(
-rType,
-static_cast< XIdlReflection * >( this ),
-static_cast< XHierarchicalNameAccess * >( this ),
-static_cast< XServiceInfo * >( this ) ) );
-
-return (aRet.hasValue() ? aRet : OComponentHelper::queryInterface( rType 
));
-}
-
-void IdlReflectionServiceImpl::acquire() noexcept
-{
-OComponentHelper::acquire();
-}
-
-void IdlReflectionServiceImpl::release() noexcept
-{
-OComponentHelper::release();
-}
-
-// XTypeProvider
-
-Sequence< Type > IdlReflectionServiceImpl::getTypes()
-{
-static OTypeCollection s_aTypes(
-cppu::UnoType::get(),
-cppu::UnoType::get(),
-cppu::UnoType::get(),
-OComponentHelper::getTypes() );
-
-return s_aTypes.getTypes();
-}
-
-Sequence< sal_Int8 > IdlReflectionServiceImpl::getImplementationId()
-{
-return css::uno::Sequence();
-}
-
 // XComponent
 
-void IdlReflectionServiceImpl::dispose()
+void IdlReflectionServiceImpl::disposing()
 {
-OComponentHelper::dispose();
-
 MutexGuard aGuard( _aComponentMutex );
 _aElements.clear();
 #ifdef TEST_LIST_CLASSES


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

2022-12-19 Thread Noel Grandin (via logerrit)
 stoc/source/corereflection/base.hxx|   15 +
 stoc/source/corereflection/crarray.cxx |   34 ---
 stoc/source/corereflection/crcomp.cxx  |   54 +-
 stoc/source/corereflection/crenum.cxx  |   54 +-
 stoc/source/corereflection/criface.cxx |   94 ++---
 5 files changed, 15 insertions(+), 236 deletions(-)

New commits:
commit 6600552f80064d548fab86e2e18ca649c6dc3cf0
Author: Noel Grandin 
AuthorDate: Mon Dec 19 08:44:09 2022 +0200
Commit: Noel Grandin 
CommitDate: Mon Dec 19 10:27:01 2022 +

loplugin:implinheritancehelper in stoc

use more ImplInheritanceHelper to reduce boilerplate

Change-Id: I2b4937ebee2e8cc16759df0eacdeb160343a7001
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/10
Tested-by: Jenkins
Reviewed-by: Noel Grandin 

diff --git a/stoc/source/corereflection/base.hxx 
b/stoc/source/corereflection/base.hxx
index d0793c1877aa..05975d3d24b7 100644
--- a/stoc/source/corereflection/base.hxx
+++ b/stoc/source/corereflection/base.hxx
@@ -255,9 +255,8 @@ public:
 };
 
 
-class ArrayIdlClassImpl
-: public IdlClassImpl
-, public css::reflection::XIdlArray
+typedef cppu::ImplInheritanceHelper 
ArrayIdlClassImpl_Base;
+class ArrayIdlClassImpl : public ArrayIdlClassImpl_Base
 {
 public:
 typelib_IndirectTypeDescription * getTypeDescr() const
@@ -267,17 +266,9 @@ public:
 ArrayIdlClassImpl( IdlReflectionServiceImpl * pReflection,
const OUString & rName, typelib_TypeClass eTypeClass,
typelib_TypeDescription * pTypeDescr )
-: IdlClassImpl( pReflection, rName, eTypeClass, pTypeDescr )
+: ArrayIdlClassImpl_Base( pReflection, rName, eTypeClass, pTypeDescr )
 {}
 
-virtual css::uno::Any SAL_CALL queryInterface( const css::uno::Type & 
rType ) override;
-virtual void SAL_CALL acquire() noexcept override;
-virtual void SAL_CALL release() noexcept override;
-
-// XTypeProvider
-virtual css::uno::Sequence< css::uno::Type > SAL_CALL getTypes() override;
-virtual css::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() 
override;
-
 // IdlClassImpl modifications
 virtual sal_Bool SAL_CALL isAssignableFrom( const css::uno::Reference< 
css::reflection::XIdlClass > & xType ) override;
 virtual css::uno::Reference< css::reflection::XIdlClass > SAL_CALL 
getComponentType() override;
diff --git a/stoc/source/corereflection/crarray.cxx 
b/stoc/source/corereflection/crarray.cxx
index 8a402c489899..ca8d159ef721 100644
--- a/stoc/source/corereflection/crarray.cxx
+++ b/stoc/source/corereflection/crarray.cxx
@@ -31,40 +31,6 @@ using namespace css::uno;
 namespace stoc_corefl
 {
 
-// XInterface
-
-Any ArrayIdlClassImpl::queryInterface( const Type & rType )
-{
-Any aRet( ::cppu::queryInterface( rType, static_cast< XIdlArray * >( this 
) ) );
-return (aRet.hasValue() ? aRet : IdlClassImpl::queryInterface( rType ));
-}
-
-void ArrayIdlClassImpl::acquire() noexcept
-{
-IdlClassImpl::acquire();
-}
-
-void ArrayIdlClassImpl::release() noexcept
-{
-IdlClassImpl::release();
-}
-
-// XTypeProvider
-
-Sequence< Type > ArrayIdlClassImpl::getTypes()
-{
-static cppu::OTypeCollection s_aTypes(
-cppu::UnoType::get(),
-IdlClassImpl::getTypes() );
-
-return s_aTypes.getTypes();
-}
-
-Sequence< sal_Int8 > ArrayIdlClassImpl::getImplementationId()
-{
-return css::uno::Sequence();
-}
-
 // XIdlArray
 
 void ArrayIdlClassImpl::realloc( Any & rArray, sal_Int32 nLen )
diff --git a/stoc/source/corereflection/crcomp.cxx 
b/stoc/source/corereflection/crcomp.cxx
index 51cf4a6f02e4..990e5a63aa1a 100644
--- a/stoc/source/corereflection/crcomp.cxx
+++ b/stoc/source/corereflection/crcomp.cxx
@@ -35,10 +35,8 @@ namespace stoc_corefl
 
 namespace {
 
-class IdlCompFieldImpl
-: public IdlMemberImpl
-, public XIdlField
-, public XIdlField2
+typedef cppu::ImplInheritanceHelper 
IdlCompFieldImpl_Base;
+class IdlCompFieldImpl : public IdlCompFieldImpl_Base
 {
 sal_Int32   _nOffset;
 
@@ -46,19 +44,10 @@ public:
 IdlCompFieldImpl( IdlReflectionServiceImpl * pReflection, const OUString & 
rName,
   typelib_TypeDescription * pTypeDescr, 
typelib_TypeDescription * pDeclTypeDescr,
   sal_Int32 nOffset )
-: IdlMemberImpl( pReflection, rName, pTypeDescr, pDeclTypeDescr )
+: IdlCompFieldImpl_Base( pReflection, rName, pTypeDescr, 
pDeclTypeDescr )
 , _nOffset( nOffset )
 {}
 
-// XInterface
-virtual Any SAL_CALL queryInterface( const Type & rType ) override;
-virtual void SAL_CALL acquire() noexcept override;
-virtual void SAL_CALL release() noexcept override;
-
-// XTypeProvider
-virtual Sequence< Type > SAL_CALL getTypes() override;
-virtual Sequence< sal_Int8 > SAL_CALL getImplementationId() override;
-
 // XIdlMember
 virtual Reference< 

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

2022-11-14 Thread Stephan Bergmann (via logerrit)
 stoc/source/simpleregistry/simpleregistry.cxx |   89 ++
 1 file changed, 50 insertions(+), 39 deletions(-)

New commits:
commit 04a8f3a42c0cefa67aeff00c6dea256f5be67449
Author: Stephan Bergmann 
AuthorDate: Mon Nov 14 12:54:14 2022 +0100
Commit: Stephan Bergmann 
CommitDate: Mon Nov 14 18:19:24 2022 +0100

Destruction of Registry and RegitsryKey isn't MT-safe

...as the underlying ORegistry and ORegKey modify their ref counts outside 
any
locked mutexes.  For example, 

had failed during CustomTarget_odk/build-examples_java with

> ==402==ERROR: AddressSanitizer: heap-use-after-free on address 
0x60d00035d920 at pc 0x7f379ce963d9 bp 0x7ffe74b1ac60 sp 0x7ffe74b1ac58
> READ of size 4 at 0x60d00035d920 thread T0
> #0 0x7f379ce963d8 in ORegistry::acquire() 
/registry/source/regimpl.hxx:49:18
> #1 0x7f379ce947a3 in acquire(void*) 
/registry/source/registry.cxx:38:15
> #2 0x7f375ee9287e in Registry::operator=(Registry const&) 
/include/registry/registry.hxx:961:9
> #3 0x7f375ee92654 in RegistryKey::setRegistry(Registry const&) 
/include/registry/registry.hxx:647:20
> #4 0x7f375ee91d66 in Registry::openRootKey(RegistryKey&) 
/include/registry/registry.hxx:979:18
> #5 0x7f375ee725da in (anonymous 
namespace)::SimpleRegistry::getRootKey() 
/stoc/source/simpleregistry/simpleregistry.cxx:889:30
> #6 0x7f375ee73a56 in non-virtual thunk to (anonymous 
namespace)::SimpleRegistry::getRootKey() 
/stoc/source/simpleregistry/simpleregistry.cxx
> #7 0x7f37828e142c in gcc3::callVirtualMethod(void*, unsigned int, 
void*, _typelib_TypeDescriptionReference*, bool, unsigned long*, unsigned int, 
unsigned long*, double*) 
/bridges/source/cpp_uno/gcc3_linux_x86-64/callvirtualmethod.cxx:77:5
> #8 0x7f37828db812 in 
cpp_call(bridges::cpp_uno::shared::UnoInterfaceProxy*, 
bridges::cpp_uno::shared::VtableSlot, _typelib_TypeDescriptionReference*, int, 
_typelib_MethodParameter*, void*, void**, _uno_Any**) 
/bridges/source/cpp_uno/gcc3_linux_x86-64/uno2cpp.cxx:233:13
> #9 0x7f37828d8668 in unoInterfaceProxyDispatch 
/bridges/source/cpp_uno/gcc3_linux_x86-64/uno2cpp.cxx:413:13
> #10 0x7f375cfebc05 in 
binaryurp::IncomingRequest::execute_throw(binaryurp::BinaryAny*, 
std::__debug::vector 
>*) const /binaryurp/source/incomingrequest.cxx:236:13
> #11 0x7f375cfe5a46 in binaryurp::IncomingRequest::execute() const 
/binaryurp/source/incomingrequest.cxx:79:26
> #12 0x7f375d0ae662 in request /binaryurp/source/reader.cxx:86:9
> #13 0x7f37b5cf5a2b in cppu_threadpool::JobQueue::enter(void const*, 
bool) /cppu/source/threadpool/jobqueue.cxx:100:17
> #14 0x7f37b5d44637 in 
cppu_threadpool::ThreadPool::enter(rtl::ByteSequence const&, void const*) 
/cppu/source/threadpool/threadpool.cxx:304:33
> #15 0x7f37b5d468d4 in uno_threadpool_enter 
/cppu/source/threadpool/threadpool.cxx:408:33
> #16 0x7f375cf144fa in binaryurp::Bridge::makeCall(rtl::OUString 
const&, com::sun::star::uno::TypeDescription const&, bool, 
std::__debug::vector 
>&&, binaryurp::BinaryAny*, std::__debug::vector >*) /binaryurp/source/bridge.cxx:606:9
> #17 0x7f375d0aa130 in 
binaryurp::Proxy::do_dispatch_throw(_typelib_TypeDescription const*, void*, 
void**, _uno_Any**) const /binaryurp/source/proxy.cxx:169:18
> #18 0x7f375d0a82f4 in 
binaryurp::Proxy::do_dispatch(_typelib_TypeDescription const*, void*, void**, 
_uno_Any**) const /binaryurp/source/proxy.cxx:102:13
> #19 0x7f375d0a80cf in proxy_dispatchInterface 
/binaryurp/source/proxy.cxx:61:36
> #20 0x7f3782881fff in 
cpp2uno_call(bridges::cpp_uno::shared::CppInterfaceProxy*, 
_typelib_TypeDescription const*, _typelib_TypeDescriptionReference*, int, 
_typelib_MethodParameter*, void**, void**, void**, unsigned long*) 
/bridges/source/cpp_uno/gcc3_linux_x86-64/cpp2uno.cxx:191:5
> #21 0x7f378287ef40 in cpp_vtable_call 
/bridges/source/cpp_uno/gcc3_linux_x86-64/cpp2uno.cxx:389:28
> #22 0x7f378292d60d in privateSnippetExecutor 
(/instdir/program/libgcc3_uno.so+0x13960d)
> #23 0x7f3774fd11c7 in dp_registry::backend::component::(anonymous 
namespace)::BackendImpl::ComponentPackageImpl::processPackage_(osl::ResettableGuard&,
 bool, bool, rtl::Reference const&, 
com::sun::star::uno::Reference 
const&) /desktop/source/deployment/registry/component/dp_component.cxx:1376:17
> #24 0x7f37750f1c11 in 
dp_registry::backend::Package::processPackage_impl(bool, bool, 
com::sun::star::uno::Reference const&, 
com::sun::star::uno::Reference 
const&) /desktop/source/deployment/registry/dp_backend.cxx:631:17
> #25 0x7f37750f3f4b in 
dp_registry::backend::Package::registerPackage(unsigned char, 
com::sun::star::uno::Reference const&, 
com::sun::star::uno::Reference 
const&) /desktop/source/deployment/registry/dp_backend.cxx:688:5
> #26 

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

2022-11-02 Thread Tor Lillqvist (via logerrit)
 stoc/source/typeconv/convert.cxx |5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

New commits:
commit 4f88a1d624a97f53b58d3cdf36b2f5cfc237da59
Author: Tor Lillqvist 
AuthorDate: Wed Nov 2 09:34:42 2022 +0200
Commit: Tor Lillqvist 
CommitDate: Wed Nov 2 11:21:21 2022 +0100

Use o3tl::to_underlying() instead of static_cast()

sberg says it is better, and I trust him.

Change-Id: I32b343cd899f807c0eb803e74e856b0eb9610074
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/142132
Tested-by: Tor Lillqvist 
Reviewed-by: Tor Lillqvist 

diff --git a/stoc/source/typeconv/convert.cxx b/stoc/source/typeconv/convert.cxx
index 445163f923f1..51b857b424c6 100644
--- a/stoc/source/typeconv/convert.cxx
+++ b/stoc/source/typeconv/convert.cxx
@@ -22,6 +22,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -359,7 +360,7 @@ sal_Int64 TypeConverter_Impl::toHyper( const Any& rAny, 
sal_Int64 min, sal_uInt6
 
 default:
 throw CannotConvertException(
-"Type " + OUString::number(static_cast(aDestinationClass)) + 
" is not supported!",
+"Type " + OUString::number(o3tl::to_underlying(aDestinationClass)) 
+ " is not supported!",
 Reference(), aDestinationClass, 
FailReason::TYPE_NOT_SUPPORTED, 0 );
 }
 
@@ -439,7 +440,7 @@ double TypeConverter_Impl::toDouble( const Any& rAny, 
double min, double max )
 
 default:
 throw CannotConvertException(
-"Type " + OUString::number(static_cast(aDestinationClass)) + 
" is not supported!",
+"Type " + OUString::number(o3tl::to_underlying(aDestinationClass)) 
+ " is not supported!",
 Reference< XInterface >(), aDestinationClass, 
FailReason::TYPE_NOT_SUPPORTED, 0 );
 }
 


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

2022-11-01 Thread Tor Lillqvist (via logerrit)
 stoc/source/typeconv/convert.cxx |4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

New commits:
commit e99a09f857b1aa4a98052dc9dd79eba70186bcff
Author: Tor Lillqvist 
AuthorDate: Mon Oct 31 12:53:48 2022 +0200
Commit: Tor Lillqvist 
CommitDate: Tue Nov 1 12:55:26 2022 +0100

Make exception message a bit more informative

Change-Id: I61141eab37f07d012ff2c5033efdfa1e0126786f
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/142075
Tested-by: Jenkins
Reviewed-by: Tor Lillqvist 

diff --git a/stoc/source/typeconv/convert.cxx b/stoc/source/typeconv/convert.cxx
index 29e8f344b4a7..445163f923f1 100644
--- a/stoc/source/typeconv/convert.cxx
+++ b/stoc/source/typeconv/convert.cxx
@@ -359,7 +359,7 @@ sal_Int64 TypeConverter_Impl::toHyper( const Any& rAny, 
sal_Int64 min, sal_uInt6
 
 default:
 throw CannotConvertException(
-"TYPE is not supported!",
+"Type " + OUString::number(static_cast(aDestinationClass)) + 
" is not supported!",
 Reference(), aDestinationClass, 
FailReason::TYPE_NOT_SUPPORTED, 0 );
 }
 
@@ -439,7 +439,7 @@ double TypeConverter_Impl::toDouble( const Any& rAny, 
double min, double max )
 
 default:
 throw CannotConvertException(
-"TYPE is not supported!",
+"Type " + OUString::number(static_cast(aDestinationClass)) + 
" is not supported!",
 Reference< XInterface >(), aDestinationClass, 
FailReason::TYPE_NOT_SUPPORTED, 0 );
 }
 


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

2022-09-30 Thread Noel Grandin (via logerrit)
 stoc/source/typeconv/convert.cxx|   39 ++--
 stoc/source/uriproc/UriReferenceFactory.cxx |   18 ++--
 2 files changed, 29 insertions(+), 28 deletions(-)

New commits:
commit 113d9bba057b2fd634fcfcebb83a4d92cf41d69f
Author: Noel Grandin 
AuthorDate: Fri Sep 30 09:06:51 2022 +0200
Commit: Noel Grandin 
CommitDate: Fri Sep 30 13:13:31 2022 +0200

use more string_view in stoc

Change-Id: I6552f3daee7b18dbd311ac7e80ebf1e84e36704d
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/140787
Tested-by: Jenkins
Reviewed-by: Noel Grandin 

diff --git a/stoc/source/typeconv/convert.cxx b/stoc/source/typeconv/convert.cxx
index 1b50c94494fb..29e8f344b4a7 100644
--- a/stoc/source/typeconv/convert.cxx
+++ b/stoc/source/typeconv/convert.cxx
@@ -21,6 +21,7 @@
 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -63,26 +64,26 @@ static double round( double aVal )
 }
 
 
-static bool getNumericValue( double & rfVal, const OUString & rStr )
+static bool getNumericValue( double & rfVal, std::u16string_view rStr )
 {
-double fRet = rStr.toDouble();
+double fRet = o3tl::toDouble(rStr);
 if (fRet == 0.0)
 {
-sal_Int32 nLen = rStr.getLength();
+size_t nLen = rStr.size();
 if (!nLen || (nLen == 1 && rStr[0] == '0')) // common case
 {
 rfVal = 0.0;
 return true;
 }
 
-OUString trim( rStr.trim() );
+std::u16string_view trim( o3tl::trim(rStr) );
 
 // try hex
-sal_Int32 nX = trim.indexOf( 'x' );
-if (nX < 0)
-nX = trim.indexOf( 'X' );
+size_t nX = trim.find( 'x' );
+if (nX == std::u16string_view::npos)
+nX = trim.find( 'X' );
 
-if (nX > 0 && trim[nX-1] == '0') // 0x
+if (nX > 0 && nX != std::u16string_view::npos && trim[nX-1] == '0') // 
0x
 {
 bool bNeg = false;
 switch (nX)
@@ -99,7 +100,7 @@ static bool getNumericValue( double & rfVal, const OUString 
& rStr )
 return false;
 }
 
-OUString aHexRest( trim.copy( nX+1 ) );
+OUString aHexRest( trim.substr( nX+1 ) );
 sal_uInt64 nRet = aHexRest.toUInt64( 16 );
 
 if (nRet == 0)
@@ -115,8 +116,8 @@ static bool getNumericValue( double & rfVal, const OUString 
& rStr )
 return true;
 }
 
-nLen = trim.getLength();
-sal_Int32 nPos = 0;
+nLen = trim.size();
+size_t nPos = 0;
 
 // skip +/-
 if (nLen && (trim[0] == '-' || trim[0] == '+'))
@@ -145,23 +146,23 @@ static bool getNumericValue( double & rfVal, const 
OUString & rStr )
 }
 
 
-static bool getHyperValue( sal_Int64 & rnVal, const OUString & rStr )
+static bool getHyperValue( sal_Int64 & rnVal, std::u16string_view rStr )
 {
-sal_Int32 nLen = rStr.getLength();
+size_t nLen = rStr.size();
 if (!nLen || (nLen == 1 && rStr[0] == '0')) // common case
 {
 rnVal = 0;
 return true;
 }
 
-OUString trim( rStr.trim() );
+std::u16string_view trim( o3tl::trim(rStr) );
 
 // try hex
-sal_Int32 nX = trim.indexOf( 'x' );
-if (nX < 0)
-nX = trim.indexOf( 'X' );
+size_t nX = trim.find( 'x' );
+if (nX == std::u16string_view::npos)
+nX = trim.find( 'X' );
 
-if (nX >= 0)
+if (nX != std::u16string_view::npos)
 {
 if (nX > 0 && trim[nX-1] == '0') // 0x
 {
@@ -180,7 +181,7 @@ static bool getHyperValue( sal_Int64 & rnVal, const 
OUString & rStr )
 return false;
 }
 
-OUString aHexRest( trim.copy( nX+1 ) );
+OUString aHexRest( trim.substr( nX+1 ) );
 sal_uInt64 nRet = aHexRest.toUInt64( 16 );
 
 if (nRet == 0)
diff --git a/stoc/source/uriproc/UriReferenceFactory.cxx 
b/stoc/source/uriproc/UriReferenceFactory.cxx
index ed739cdc32cf..aa6da45197de 100644
--- a/stoc/source/uriproc/UriReferenceFactory.cxx
+++ b/stoc/source/uriproc/UriReferenceFactory.cxx
@@ -167,10 +167,10 @@ private:
 };
 
 css::uno::Reference< css::uri::XUriReference > parseGeneric(
-OUString const & scheme, OUString const & schemeSpecificPart)
+OUString const & scheme, std::u16string_view schemeSpecificPart)
 {
-sal_Int32 len = schemeSpecificPart.getLength();
-sal_Int32 i = 0;
+size_t len = schemeSpecificPart.size();
+size_t i = 0;
 bool hasAuthority = false;
 OUString authority;
 if (len - i >= 2 && schemeSpecificPart[i] == '/'
@@ -183,22 +183,22 @@ css::uno::Reference< css::uri::XUriReference > 
parseGeneric(
 ++i;
 }
 hasAuthority = true;
-authority = schemeSpecificPart.copy(n, i - n);
+authority = schemeSpecificPart.substr(n, i - n);
 }
 sal_Int32 n = i;
-i = schemeSpecificPart.indexOf('?', i);
-if (i == -1) {
+i = schemeSpecificPart.find('?', i);
+if (i == 

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

2022-06-27 Thread Noel Grandin (via logerrit)
 stoc/source/corereflection/base.hxx  |4 +-
 stoc/source/corereflection/crbase.cxx|   10 +++--
 stoc/source/implementationregistration/mergekeys.cxx |7 ++-
 stoc/source/inspect/introspection.cxx|   15 
 stoc/source/javaloader/javaloader.cxx|7 ++-
 stoc/source/javavm/interact.cxx  |5 +-
 stoc/source/javavm/interact.hxx  |2 -
 stoc/source/javavm/javavm.cxx|5 +-
 stoc/source/javavm/javavm.hxx|2 -
 stoc/source/proxy_factory/proxyfac.cxx   |   27 +++
 stoc/source/security/access_controller.cxx   |5 +-
 stoc/source/security/file_policy.cxx |7 ++-
 stoc/source/security/permissions.h   |9 ++---
 stoc/source/servicemanager/servicemanager.cxx|5 +-
 stoc/source/simpleregistry/simpleregistry.cxx|5 +-
 stoc/source/uriproc/UriReference.cxx |9 ++---
 stoc/source/uriproc/UriReference.hxx |4 +-
 stoc/source/uriproc/UriReferenceFactory.cxx  |4 +-
 stoc/source/uriproc/VndSunStarPkgUrlReferenceFactory.cxx |5 +-
 19 files changed, 76 insertions(+), 61 deletions(-)

New commits:
commit 69485e422c906a3bb290797725a0784f73d94b9f
Author: Noel Grandin 
AuthorDate: Mon Jun 27 09:46:16 2022 +0200
Commit: Noel Grandin 
CommitDate: Mon Jun 27 12:04:02 2022 +0200

clang-tidy modernize-pass-by-value in stoc

Change-Id: Ia628b2af646e576d52b6c72352255710a885c23f
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/136452
Tested-by: Jenkins
Reviewed-by: Noel Grandin 

diff --git a/stoc/source/corereflection/base.hxx 
b/stoc/source/corereflection/base.hxx
index 16d42213ddcd..d0793c1877aa 100644
--- a/stoc/source/corereflection/base.hxx
+++ b/stoc/source/corereflection/base.hxx
@@ -153,7 +153,7 @@ public:
 
 // Ctor
 IdlClassImpl( IdlReflectionServiceImpl * pReflection,
-  const OUString & rName, typelib_TypeClass eTypeClass,
+  OUString aName, typelib_TypeClass eTypeClass,
   typelib_TypeDescription * pTypeDescr );
 virtual ~IdlClassImpl() override;
 
@@ -338,7 +338,7 @@ public:
 { return _pDeclTypeDescr; }
 
 // ctor/ dtor
-IdlMemberImpl( IdlReflectionServiceImpl * pReflection, const OUString & 
rName,
+IdlMemberImpl( IdlReflectionServiceImpl * pReflection, OUString aName,
typelib_TypeDescription * pTypeDescr, 
typelib_TypeDescription * pDeclTypeDescr );
 virtual ~IdlMemberImpl() override;
 
diff --git a/stoc/source/corereflection/crbase.cxx 
b/stoc/source/corereflection/crbase.cxx
index 75e802c96045..439ee5b2229f 100644
--- a/stoc/source/corereflection/crbase.cxx
+++ b/stoc/source/corereflection/crbase.cxx
@@ -19,6 +19,8 @@
 
 #include 
 
+#include 
+
 #include "base.hxx"
 
 using namespace css::reflection;
@@ -41,10 +43,10 @@ ClassNameVector g_aClassNames;
 
 
 IdlClassImpl::IdlClassImpl( IdlReflectionServiceImpl * pReflection,
-const OUString & rName, typelib_TypeClass 
eTypeClass,
+OUString aName, typelib_TypeClass eTypeClass,
 typelib_TypeDescription * pTypeDescr )
 : m_xReflection( pReflection )
-, _aName( rName )
+, _aName(std::move( aName ))
 , _eTypeClass( static_cast(eTypeClass) )
 , _pTypeDescr( pTypeDescr )
 {
@@ -201,11 +203,11 @@ Reference< XIdlArray > IdlClassImpl::getArray()
 }
 
 
-IdlMemberImpl::IdlMemberImpl( IdlReflectionServiceImpl * pReflection, const 
OUString & rName,
+IdlMemberImpl::IdlMemberImpl( IdlReflectionServiceImpl * pReflection, OUString 
aName,
   typelib_TypeDescription * pTypeDescr,
   typelib_TypeDescription * pDeclTypeDescr )
 : m_xReflection( pReflection )
-, _aName( rName )
+, _aName(std::move( aName ))
 , _pTypeDescr( pTypeDescr )
 , _pDeclTypeDescr( pDeclTypeDescr )
 {
diff --git a/stoc/source/implementationregistration/mergekeys.cxx 
b/stoc/source/implementationregistration/mergekeys.cxx
index da7da509ebce..dde219b9ada7 100644
--- a/stoc/source/implementationregistration/mergekeys.cxx
+++ b/stoc/source/implementationregistration/mergekeys.cxx
@@ -18,6 +18,7 @@
  */
 
 
+#include 
 #include 
 
 #include 
@@ -40,9 +41,9 @@ struct Link
 OUString m_name;
 OUString m_target;
 
-Link( OUString const & name, OUString const & target )
-: m_name( name )
-, m_target( target )
+Link( OUString name, OUString target )
+: m_name(std::move( name ))
+, m_target(std::move( target ))
 {}
 };
 
diff --git a/stoc/source/inspect/introspection.cxx 
b/stoc/source/inspect/introspection.cxx
index 1a92d5b4cc34..c219e8030f0c 100644
--- 

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

2022-06-03 Thread Stephan Bergmann (via logerrit)
 stoc/source/inspect/introspection.cxx |   17 -
 1 file changed, 8 insertions(+), 9 deletions(-)

New commits:
commit 2e197356f8473d3b7ac56ec8e471ff61d9feeba1
Author: Stephan Bergmann 
AuthorDate: Fri Jun 3 09:30:23 2022 +0200
Commit: Stephan Bergmann 
CommitDate: Fri Jun 3 10:08:57 2022 +0200

Use more appropriate index variable types

Change-Id: I3c8985862aeccb350c4e8e04d3f71f9dc7018e43
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/135334
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann 

diff --git a/stoc/source/inspect/introspection.cxx 
b/stoc/source/inspect/introspection.cxx
index 0b27ac0b1fe3..1a92d5b4cc34 100644
--- a/stoc/source/inspect/introspection.cxx
+++ b/stoc/source/inspect/introspection.cxx
@@ -1644,7 +1644,6 @@ css::uno::Reference 
Implementation::inspect(
 std::vector>& rInterfaces2 = pAccess->aInterfaceSeq2;
 std::vector& rMapTypeArray = pAccess->maMapTypeSeq;
 std::vector& rPropertyConceptArray = 
pAccess->maPropertyConceptSeq;
-sal_Int32 i;
 
 // References to important data from pAccess
 sal_Int32& rPropCount = pAccess->mnPropCount;
@@ -1662,7 +1661,7 @@ css::uno::Reference 
Implementation::inspect(
 {
 SupportedClassSeq.resize( nTypeCount );
 
-for( i = 0 ; i < static_cast(nTypeCount) ; i++ )
+for( size_t i = 0 ; i < nTypeCount ; i++ )
 SupportedClassSeq[i] = reflection->forName( 
SupportedTypesSeq[i].getTypeName() );
 }
 
@@ -1684,7 +1683,7 @@ css::uno::Reference 
Implementation::inspect(
 if( bFast )
 pAccess->mpOrgPropertyHandleArray.reset( new sal_Int32[ nLen ] 
);
 
-for( i = 0 ; i < nLen ; i++ )
+for( sal_Int32 i = 0 ; i < nLen ; i++ )
 {
 // Put property in its own list
 pAccess->checkPropertyArraysSize( rPropCount );
@@ -1742,7 +1741,7 @@ css::uno::Reference 
Implementation::inspect(
 bool bFoundXInterface = false;
 
 size_t nClassCount = SupportedClassSeq.size();
-for( sal_Int32 nIdx = 0 ; nIdx < static_cast(nClassCount); 
nIdx++ )
+for( size_t nIdx = 0 ; nIdx < nClassCount; nIdx++ )
 {
 Reference xImplClass2 = SupportedClassSeq[nIdx];
 while( xImplClass2.is() )
@@ -1835,13 +1834,13 @@ css::uno::Reference 
Implementation::inspect(
 };
 std::unique_ptr pMethodTypes( new 
MethodType[ nSourceMethodCount ] );
 std::unique_ptr pLocalMethodConcepts( new 
sal_Int32[ nSourceMethodCount ] );
-for( i = 0 ; i < nSourceMethodCount ; i++ )
+for( sal_Int32 i = 0 ; i < nSourceMethodCount ; i++ )
 {
 pMethodTypes[ i ] = STANDARD_METHOD;
 pLocalMethodConcepts[ i ] = 0;
 }
 
-for( i = 0 ; i < nSourceMethodCount ; i++ )
+for( sal_Int32 i = 0 ; i < nSourceMethodCount ; i++ )
 {
 // Address method
 const Reference& rxMethod_i = 
pSourceMethods[i];
@@ -2111,7 +2110,7 @@ css::uno::Reference 
Implementation::inspect(
 
 // A set method could still exist without a corresponding 
get method,
 // this must be a write-only property
-for( i = 0 ; i < nSourceMethodCount ; i++ )
+for( sal_Int32 i = 0 ; i < nSourceMethodCount ; i++ )
 {
 // Address method
 const Reference& rxMethod_i = 
pSourceMethods[i];
@@ -2202,7 +2201,7 @@ css::uno::Reference 
Implementation::inspect(
 // How many methods in the method sequence
 sal_Int32 nExportedMethodCount = 0;
 sal_Int32 nSupportedListenerCount = 0;
-for( i = 0 ; i < nSourceMethodCount ; i++ )
+for( sal_Int32 i = 0 ; i < nSourceMethodCount ; i++ )
 {
 if( pMethodTypes[ i ] != INVALID_METHOD )
 {
@@ -2220,7 +2219,7 @@ css::uno::Reference 
Implementation::inspect(
 pAccess->maSupportedListenerSeq.resize( 
nSupportedListenerCount + iAllSupportedListener );
 
 // Write in methods
-for( i = 0 ; i < nSourceMethodCount ; i++ )
+for( sal_Int32 i = 0 ; i < nSourceMethodCount ; i++ )
 {
 if( pMethodTypes[ i ] != INVALID_METHOD )
 {


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

2022-05-03 Thread Stephan Bergmann (via logerrit)
 stoc/source/corereflection/crefl.cxx  |4 ++--
 stoc/source/invocation/invocation.cxx |   20 ++--
 stoc/source/javavm/javavm.cxx |   16 
 stoc/source/servicemanager/servicemanager.cxx |8 
 4 files changed, 24 insertions(+), 24 deletions(-)

New commits:
commit 234f87d354d3af8dfe842d8cf8c733679c3180fe
Author: Stephan Bergmann 
AuthorDate: Tue May 3 20:08:27 2022 +0200
Commit: Stephan Bergmann 
CommitDate: Tue May 3 23:17:24 2022 +0200

Just use Any ctor instead of makeAny in stoc

Change-Id: I3345444f356dd3df9069773eba2bab1b46a08c46
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133772
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann 

diff --git a/stoc/source/corereflection/crefl.cxx 
b/stoc/source/corereflection/crefl.cxx
index 723e0711fa59..af1854e7e3b4 100644
--- a/stoc/source/corereflection/crefl.cxx
+++ b/stoc/source/corereflection/crefl.cxx
@@ -201,7 +201,7 @@ Reference< XIdlClass > IdlReflectionServiceImpl::forName( 
const OUString & rType
 {
 xRet = constructClass( pTD );
 if (xRet.is())
-_aElements.setValue( rTypeName, makeAny( xRet ) ); // update
+_aElements.setValue( rTypeName, Any( xRet ) ); // update
 typelib_typedescription_release( pTD );
 }
 }
@@ -289,7 +289,7 @@ Reference< XIdlClass > IdlReflectionServiceImpl::forType( 
typelib_TypeDescriptio
 {
 xRet = constructClass( pTypeDescr );
 if (xRet.is())
-_aElements.setValue( aName, makeAny( xRet ) ); // update
+_aElements.setValue( aName, Any( xRet ) ); // update
 }
 
 return xRet;
diff --git a/stoc/source/invocation/invocation.cxx 
b/stoc/source/invocation/invocation.cxx
index ab8a10fa1ef6..5463c059eb5f 100644
--- a/stoc/source/invocation/invocation.cxx
+++ b/stoc/source/invocation/invocation.cxx
@@ -241,49 +241,49 @@ Any SAL_CALL Invocation_Impl::queryInterface( const Type 
& aType )
 (_xDirect.is() && _xENDirect.is()) ||
 (!_xDirect.is() && _xENIntrospection.is()))
 {
-return makeAny( Reference< XExactName >( static_cast< XExactName* 
>(this) ) );
+return Any( Reference< XExactName >( static_cast< XExactName* 
>(this) ) );
 }
 }
 else if ( aType == cppu::UnoType::get())
 {
 if( _xNameContainer.is() )
-return makeAny( Reference< XNameContainer >( static_cast< 
XNameContainer* >(this) ) );
+return Any( Reference< XNameContainer >( static_cast< 
XNameContainer* >(this) ) );
 }
 else if ( aType == cppu::UnoType::get())
 {
 if( _xNameReplace.is() )
-return makeAny( Reference< XNameReplace >( static_cast< 
XNameReplace* >(this) ) );
+return Any( Reference< XNameReplace >( static_cast< XNameReplace* 
>(this) ) );
 }
 else if ( aType == cppu::UnoType::get())
 {
 if( _xNameAccess.is() )
-return makeAny( Reference< XNameAccess >( static_cast< 
XNameAccess* >(this) ) );
+return Any( Reference< XNameAccess >( static_cast< XNameAccess* 
>(this) ) );
 }
 else if ( aType == cppu::UnoType::get())
 {
 if (_xIndexContainer.is())
-return makeAny( Reference< XIndexContainer >( static_cast< 
XIndexContainer* >(this) ) );
+return Any( Reference< XIndexContainer >( static_cast< 
XIndexContainer* >(this) ) );
 }
 else if ( aType == cppu::UnoType::get())
 {
 if (_xIndexReplace.is())
-return makeAny( Reference< XIndexReplace >( static_cast< 
XIndexReplace* >(this) ) );
+return Any( Reference< XIndexReplace >( static_cast< 
XIndexReplace* >(this) ) );
 }
 else if ( aType == cppu::UnoType::get())
 {
 if (_xIndexAccess.is())
-return makeAny( Reference< XIndexAccess >( static_cast< 
XIndexAccess* >(this) ) );
+return Any( Reference< XIndexAccess >( static_cast< XIndexAccess* 
>(this) ) );
 }
 else if ( aType == cppu::UnoType::get())
 {
 if (_xEnumerationAccess.is())
-return makeAny( Reference< XEnumerationAccess >( static_cast< 
XEnumerationAccess* >(this) ) );
+return Any( Reference< XEnumerationAccess >( static_cast< 
XEnumerationAccess* >(this) ) );
 }
 else if ( aType == cppu::UnoType::get())
 {
 if (_xElementAccess.is())
 {
-return makeAny( Reference< XElementAccess >(
+return Any( Reference< XElementAccess >(
 static_cast< XElementAccess* >(static_cast< XNameContainer* 
>(this)) ) );
 }
 }
@@ -295,7 +295,7 @@ Any SAL_CALL Invocation_Impl::queryInterface( const Type & 
aType )
  ( _xDirect.is() && _xDirect2.is()) ||
  (!_xDirect.is() && _xIntrospectionAccess.is() ) )
 {
-return makeAny( Reference< XInvocation2 >( static_cast< 

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

2022-03-18 Thread Stephan Bergmann (via logerrit)
 stoc/source/typeconv/convert.cxx |   11 +++
 1 file changed, 11 insertions(+)

New commits:
commit 9074f5602a9b0b51349647f29d8537256217ebe7
Author: Stephan Bergmann 
AuthorDate: Fri Mar 18 14:12:56 2022 +0100
Commit: Stephan Bergmann 
CommitDate: Fri Mar 18 15:33:50 2022 +0100

tdf#148063: Avoid dereferencing potentially bad user-supplied 
TypeDescription

...from Basic script

> sub foo
>   a = Array()
>   oUnoValue = CreateUnoValue( "[]", a )
> end sub

at

> Thread 1 "soffice.bin" received signal SIGSEGV, Segmentation fault.
> 0x7fffc413b2db in stoc_tcv::(anonymous 
namespace)::TypeConverter_Impl::convertTo (this=0x3269200, 
rVal=uno::Any("[]any": empty uno::Sequence), aDestType=invalid uno::Type) at 
stoc/source/typeconv/convert.cxx:537
> 537   reinterpret_cast(aDestTD.get())->pType );
> (gdb) bt
> #0  0x7fffc413b2db in stoc_tcv::(anonymous 
namespace)::TypeConverter_Impl::convertTo(com::sun::star::uno::Any const&, 
com::sun::star::uno::Type const&) (this=0x3269200, rVal=uno::Any("[]any": empty 
uno::Sequence), aDestType=invalid uno::Type) at 
stoc/source/typeconv/convert.cxx:537
> #1  0x7fffc413d144 in non-virtual thunk to stoc_tcv::(anonymous 
namespace)::TypeConverter_Impl::convertTo(com::sun::star::uno::Any const&, 
com::sun::star::uno::Type const&) () at instdir/program/libstocserviceslo.so
> #2  0x74fe0264 in convertAny(com::sun::star::uno::Any const&, 
com::sun::star::uno::Type const&) (rVal=uno::Any("[]any": empty uno::Sequence), 
aDestType=invalid uno::Type) at basic/source/classes/sbunoobj.cxx:324
> #3  0x74fdfe79 in RTL_Impl_CreateUnoValue(SbxArray&) (rPar=...) 
at basic/source/classes/sbunoobj.cxx:4157
> #4  0x7513b1b0 in SbRtl_CreateUnoValue(StarBASIC*, SbxArray&, 
bool) (rPar=...) at basic/source/runtime/methods1.cxx:1403
> #5  0x750ea80e in SbiStdObject::Notify(SfxBroadcaster&, SfxHint 
const&) (this=0x2003400, rBC=..., rHint=...) at 
basic/source/runtime/stdobj.cxx:1059
> #6  0x73decfae in SfxBroadcaster::Broadcast(SfxHint const&) 
(this=0x3329e90, rHint=...) at svl/source/notify/SfxBroadcaster.cxx:39
> #7  0x7518e772 in SbxVariable::Broadcast(SfxHintId) 
(this=0x31e8f60, nHintId=SfxHintId::BasicDataWanted) at 
basic/source/sbx/sbxvar.cxx:151
> #8  0x75186d4f in SbxValue::SbxValue(SbxValue const&) 
(this=0x31ff450, vtt=0x751ae718 , r=...) at 
basic/source/sbx/sbxvalue.cxx:66
> #9  0x7518d291 in SbxVariable::SbxVariable(SbxVariable const&) 
(this=0x31ff450, vtt=0x751ae710 , r=...) at 
basic/source/sbx/sbxvar.cxx:45
> #10 0x7517d44a in SbxMethod::SbxMethod(SbxMethod const&) 
(this=0x31ff450, r=...) at basic/source/sbx/sbxobj.cxx:838
> #11 0x7510386b in SbiRuntime::FindElement(SbxObject*, unsigned 
int, unsigned int, ErrCode, bool, bool) (this=0x2d6f400, pObj=0x2003400, 
nOp1=32773, nOp2=9, nNotFound=..., bLocal=false, bStatic=false) at 
basic/source/runtime/runtime.cxx:3709
> #12 0x750f5a91 in SbiRuntime::StepRTL(unsigned int, unsigned int) 
(this=0x2d6f400, nOp1=32773, nOp2=9) at basic/source/runtime/runtime.cxx:4131
> #13 0x750faef8 in SbiRuntime::Step() (this=0x2d6f400) at 
basic/source/runtime/runtime.cxx:830
[...]

Change-Id: I552f0360aaf3f9aa6a499aa5ea6eca9ae37e4614
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/131739
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann 

diff --git a/stoc/source/typeconv/convert.cxx b/stoc/source/typeconv/convert.cxx
index 2f87b4f42500..1b50c94494fb 100644
--- a/stoc/source/typeconv/convert.cxx
+++ b/stoc/source/typeconv/convert.cxx
@@ -527,6 +527,17 @@ Any SAL_CALL TypeConverter_Impl::convertTo( const Any& 
rVal, const Type& aDestTy
 
 TypeDescription aSourceTD( aSourceType );
 TypeDescription aDestTD( aDestType );
+// For a sequence type notation "[]...", SequenceTypeDescription in
+// cppuhelper/source/typemanager.cxx resolves the "..." component 
type notation part
+// only lazily, so it could happen here that bad user input (e.g., 
"[]" or "[]foo" from
+// a Basic script CreateUnoValue call) leads to a bad but 
as-of-yet undetected
+// aDestType, so check it here; this is less likely an issue for 
the non-sequence type
+// classes, whose notation is not resolved lazily based on their 
syntax:
+if (!aDestTD.is()) {
+throw css::lang::IllegalArgumentException(
+"Bad XTypeConverter::convertTo destination " + 
aDestType.getTypeName(),
+static_cast(this), 1);
+}
 typelib_TypeDescription * pSourceElementTD = nullptr;
 TYPELIB_DANGER_GET(
 ,


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

2022-01-03 Thread Noel Grandin (via logerrit)
 stoc/source/inspect/introspection.cxx |   50 +-
 1 file changed, 25 insertions(+), 25 deletions(-)

New commits:
commit c87c58feb2e4be996ae28a6bc393fc86cde18598
Author: Noel Grandin 
AuthorDate: Mon Dec 20 20:24:01 2021 +0200
Commit: Noel Grandin 
CommitDate: Mon Jan 3 20:07:29 2022 +0100

osl::Mutex->std::mutex in ImplIntrospectionAccess

Change-Id: I311762ccaac48161c8ce38f8ce081bf01e27ab09
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/127904
Tested-by: Jenkins
Reviewed-by: Noel Grandin 

diff --git a/stoc/source/inspect/introspection.cxx 
b/stoc/source/inspect/introspection.cxx
index aa1440bb4b7d..0b27ac0b1fe3 100644
--- a/stoc/source/inspect/introspection.cxx
+++ b/stoc/source/inspect/introspection.cxx
@@ -24,11 +24,11 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 
 #include 
 #include 
-#include 
 #include 
 #include 
 #include 
@@ -660,7 +660,7 @@ class ImplIntrospectionAccess : public 
IntrospectionAccessHelper
 sal_Int32 mnLastMethodConcept;
 
 // Guards the caching of queried interfaces
-osl::Mutex m_aMutex;
+std::mutex m_aMutex;
 
 // Original interfaces of the objects
 Reference   mxObjElementAccess;
@@ -782,13 +782,13 @@ ImplIntrospectionAccess::ImplIntrospectionAccess
 
 Reference ImplIntrospectionAccess::getXElementAccess()
 {
-ResettableGuard< Mutex > aGuard( m_aMutex );
+std::unique_lock aGuard( m_aMutex );
 
 if( !mxObjElementAccess.is() )
 {
-aGuard.clear();
+aGuard.unlock();
 Reference xElementAccess( mxIface, UNO_QUERY );
-aGuard.reset();
+aGuard.lock();
 if( !mxObjElementAccess.is() )
 mxObjElementAccess = xElementAccess;
 }
@@ -817,7 +817,7 @@ void ImplIntrospectionAccess::cacheXNameContainer()
 }
 
 {
-MutexGuard aGuard( m_aMutex );
+std::unique_lock aGuard( m_aMutex );
 if( !mxObjNameContainer.is() )
 mxObjNameContainer = xNameContainer;
 if( !mxObjNameReplace.is() )
@@ -829,11 +829,11 @@ void ImplIntrospectionAccess::cacheXNameContainer()
 
 Reference ImplIntrospectionAccess::getXNameContainer()
 {
-ClearableGuard< Mutex > aGuard( m_aMutex );
+std::unique_lock aGuard( m_aMutex );
 
 if( !mxObjNameContainer.is() )
 {
-aGuard.clear();
+aGuard.unlock();
 cacheXNameContainer();
 }
 return mxObjNameContainer;
@@ -841,11 +841,11 @@ Reference 
ImplIntrospectionAccess::getXNameContainer()
 
 Reference ImplIntrospectionAccess::getXNameReplace()
 {
-ClearableGuard< Mutex > aGuard( m_aMutex );
+std::unique_lock aGuard( m_aMutex );
 
 if( !mxObjNameReplace.is() )
 {
-aGuard.clear();
+aGuard.unlock();
 cacheXNameContainer();
 }
 return mxObjNameReplace;
@@ -853,11 +853,11 @@ Reference 
ImplIntrospectionAccess::getXNameReplace()
 
 Reference ImplIntrospectionAccess::getXNameAccess()
 {
-ClearableGuard< Mutex > aGuard( m_aMutex );
+std::unique_lock aGuard( m_aMutex );
 
 if( !mxObjNameAccess.is() )
 {
-aGuard.clear();
+aGuard.unlock();
 cacheXNameContainer();
 }
 return mxObjNameAccess;
@@ -885,7 +885,7 @@ void ImplIntrospectionAccess::cacheXIndexContainer()
 }
 
 {
-MutexGuard aGuard( m_aMutex );
+std::unique_lock aGuard( m_aMutex );
 if( !mxObjIndexContainer.is() )
 mxObjIndexContainer = xIndexContainer;
 if( !mxObjIndexReplace.is() )
@@ -897,11 +897,11 @@ void ImplIntrospectionAccess::cacheXIndexContainer()
 
 Reference ImplIntrospectionAccess::getXIndexContainer()
 {
-ClearableGuard< Mutex > aGuard( m_aMutex );
+std::unique_lock aGuard( m_aMutex );
 
 if( !mxObjIndexContainer.is() )
 {
-aGuard.clear();
+aGuard.unlock();
 cacheXIndexContainer();
 }
 return mxObjIndexContainer;
@@ -909,11 +909,11 @@ Reference 
ImplIntrospectionAccess::getXIndexContainer()
 
 Reference ImplIntrospectionAccess::getXIndexReplace()
 {
-ClearableGuard< Mutex > aGuard( m_aMutex );
+std::unique_lock aGuard( m_aMutex );
 
 if( !mxObjIndexReplace.is() )
 {
-aGuard.clear();
+aGuard.unlock();
 cacheXIndexContainer();
 }
 return mxObjIndexReplace;
@@ -921,11 +921,11 @@ Reference 
ImplIntrospectionAccess::getXIndexReplace()
 
 Reference ImplIntrospectionAccess::getXIndexAccess()
 {
-ClearableGuard< Mutex > aGuard( m_aMutex );
+std::unique_lock aGuard( m_aMutex );
 
 if( !mxObjIndexAccess.is() )
 {
-aGuard.clear();
+aGuard.unlock();
 cacheXIndexContainer();
 }
 return mxObjIndexAccess;
@@ -933,13 +933,13 @@ Reference 
ImplIntrospectionAccess::getXIndexAccess()
 
 Reference ImplIntrospectionAccess::getXEnumerationAccess()
 {
-ResettableGuard< Mutex > aGuard( m_aMutex );
+std::unique_lock aGuard( m_aMutex );
 
 if( 

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

2021-12-19 Thread Noel Grandin (via logerrit)
 stoc/source/security/access_controller.cxx |   21 +
 stoc/source/security/file_policy.cxx   |   15 ++-
 2 files changed, 15 insertions(+), 21 deletions(-)

New commits:
commit 4547c4d208a8978684d602a582b933898385008e
Author: Noel Grandin 
AuthorDate: Sat Dec 18 12:53:20 2021 +0200
Commit: Noel Grandin 
CommitDate: Sun Dec 19 11:19:56 2021 +0100

use more cppu::BaseMutex

Change-Id: I1374d615e8e72286a23407c50b5fe5f52017926a
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/127084
Tested-by: Jenkins
Reviewed-by: Noel Grandin 

diff --git a/stoc/source/security/access_controller.cxx 
b/stoc/source/security/access_controller.cxx
index aaefd5dc39c7..c96f1f61f945 100644
--- a/stoc/source/security/access_controller.cxx
+++ b/stoc/source/security/access_controller.cxx
@@ -30,6 +30,7 @@
 #include 
 #include 
 
+#include 
 #include 
 #include 
 #include 
@@ -270,16 +271,12 @@ public:
 { ::uno_setCurrentContext( m_cc, s_envType.pData, nullptr ); }
 };
 
-struct MutexHolder
-{
-Mutex m_mutex;
-};
 typedef WeakComponentImplHelper<
 security::XAccessController, lang::XServiceInfo, lang::XInitialization > 
t_helper;
 
 
 class AccessController
-: public MutexHolder
+: public cppu::BaseMutex
 , public t_helper
 {
 Reference< XComponentContext > m_xComponentContext;
@@ -338,7 +335,7 @@ public:
 };
 
 AccessController::AccessController( Reference< XComponentContext > const & 
xComponentContext )
-: t_helper( m_mutex )
+: t_helper( m_aMutex )
 , m_xComponentContext( xComponentContext )
 , m_mode( Mode::On ) // default
 , m_defaultPerm_init( false )
@@ -445,7 +442,7 @@ Reference< security::XPolicy > const & 
AccessController::getPolicy()
 "cannot get policy singleton!", static_cast(this) );
 }
 
-MutexGuard guard( m_mutex );
+MutexGuard guard( m_aMutex );
 if (! m_xPolicy.is())
 {
 m_xPolicy = xPolicy;
@@ -526,7 +523,7 @@ void AccessController::checkAndClearPostPoned()
 PermissionCollection const * pPermissions;
 // lookup policy for user
 {
-MutexGuard guard( m_mutex );
+MutexGuard guard( m_aMutex );
 pPermissions = m_user2permissions.lookup( p.first );
 }
 OSL_ASSERT( pPermissions );
@@ -583,7 +580,7 @@ PermissionCollection 
AccessController::getEffectivePermissions(
 }
 
 // lookup policy for user
-MutexGuard guard( m_mutex );
+MutexGuard guard( m_aMutex );
 PermissionCollection const * pPermissions = m_user2permissions.lookup( 
userId );
 if (pPermissions)
 return *pPermissions;
@@ -623,7 +620,7 @@ PermissionCollection 
AccessController::getEffectivePermissions(
 PermissionCollection defaultPermissions(
 getPolicy()->getDefaultPermissions() );
 // assign
-MutexGuard guard( m_mutex );
+MutexGuard guard( m_aMutex );
 if (! m_defaultPerm_init)
 {
 m_defaultPermissions = defaultPermissions;
@@ -645,7 +642,7 @@ PermissionCollection 
AccessController::getEffectivePermissions(
 getPolicy()->getPermissions( userId ), m_defaultPermissions );
 {
 // assign
-MutexGuard guard( m_mutex );
+MutexGuard guard( m_aMutex );
 if (m_singleUser_init)
 {
 ret = m_singleUserPermissions;
@@ -672,7 +669,7 @@ PermissionCollection 
AccessController::getEffectivePermissions(
 getPolicy()->getPermissions( userId ), m_defaultPermissions );
 {
 // cache
-MutexGuard guard( m_mutex );
+MutexGuard guard( m_aMutex );
 m_user2permissions.set( userId, ret );
 }
 #ifdef __DIAGNOSE
diff --git a/stoc/source/security/file_policy.cxx 
b/stoc/source/security/file_policy.cxx
index 293e2c44c4c9..91f75092bc22 100644
--- a/stoc/source/security/file_policy.cxx
+++ b/stoc/source/security/file_policy.cxx
@@ -24,6 +24,7 @@
 #include 
 
 #include 
+#include 
 #include 
 #include 
 
@@ -47,15 +48,11 @@ using namespace css::uno;
 
 namespace {
 
-struct MutexHolder
-{
-Mutex m_mutex;
-};
 typedef WeakComponentImplHelper< security::XPolicy, lang::XServiceInfo > 
t_helper;
 
 
 class FilePolicy
-: public MutexHolder
+: public cppu::BaseMutex
 , public t_helper
 {
 Reference< XComponentContext > m_xComponentContext;
@@ -85,7 +82,7 @@ public:
 };
 
 FilePolicy::FilePolicy( Reference< XComponentContext > const & 
xComponentContext )
-: t_helper( m_mutex )
+: t_helper( m_aMutex )
 , m_xComponentContext( xComponentContext )
 , m_ac( xComponentContext )
 , m_init( false )
@@ -108,7 +105,7 @@ Sequence< Any > FilePolicy::getPermissions(
 m_init = true;
 }
 
-MutexGuard guard( m_mutex 

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

2021-08-19 Thread Stephan Bergmann (via logerrit)
 stoc/source/uriproc/UriReference.cxx |   14 ++
 stoc/source/uriproc/UriReference.hxx |   21 +++--
 2 files changed, 21 insertions(+), 14 deletions(-)

New commits:
commit d001836139b28d367cc70b64a13519d173066df1
Author: Stephan Bergmann 
AuthorDate: Thu Aug 19 17:35:04 2021 +0200
Commit: Stephan Bergmann 
CommitDate: Thu Aug 19 21:04:10 2021 +0200

Fix locking of public UriReference members again

...after 074790ad6f4e02e7aed3f9c954f0b4005b40fa21 "remove some locking from
UriReference" (and its follow-up 0f44815ce7b2925189cd603853ce55d8363549dd
"loplugin:constmethods"):  The m_path member is modified by
UrlReference::setName in
stoc/source/uriproc/UriSchemeParser_vndDOTsunDOTstarDOTscript.cxx.  Also 
make
the non-mutated members (for which locking is thus indeed not needed) 
private
for now.  (The original intention was that there can be further parsers for
other URI schemes, which might need to modify further UriReference members. 
 If
such further parsers are ever implemented, the relevant members can be made
public again, and the locking be restored where necessary.)

Change-Id: I80b437fe14f43294a52e465a7e1f31ddf2ab0482
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/120749
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann 

diff --git a/stoc/source/uriproc/UriReference.cxx 
b/stoc/source/uriproc/UriReference.cxx
index a47198ac2241..75298583b0c4 100644
--- a/stoc/source/uriproc/UriReference.cxx
+++ b/stoc/source/uriproc/UriReference.cxx
@@ -34,9 +34,9 @@ UriReference::UriReference(
 OUString const & scheme, bool bHasAuthority,
 OUString const & authority, OUString const & path,
 bool bHasQuery, OUString const & query):
+m_path(path),
 m_scheme(scheme),
 m_authority(authority),
-m_path(path),
 m_query(query),
 m_hasAuthority(bHasAuthority),
 m_hasQuery(bHasQuery),
@@ -69,14 +69,16 @@ bool UriReference::isAbsolute() const {
 }
 
 
-OUString UriReference::getSchemeSpecificPart() const
+OUString UriReference::getSchemeSpecificPart()
 {
+std::lock_guard g(m_mutex);
 OUStringBuffer buf;
 appendSchemeSpecificPart(buf);
 return buf.makeStringAndClear();
 }
 
-bool UriReference::isHierarchical() const {
+bool UriReference::isHierarchical() {
+std::lock_guard g(m_mutex);
 return m_scheme.isEmpty() || m_hasAuthority || m_path.startsWith("/");
 }
 
@@ -88,17 +90,20 @@ const OUString& UriReference::getAuthority() const {
 return m_authority;
 }
 
-const OUString& UriReference::getPath() const {
+OUString UriReference::getPath() {
+std::lock_guard g(m_mutex);
 return m_path;
 }
 
 bool UriReference::hasRelativePath() {
+std::lock_guard g(m_mutex);
 return !m_hasAuthority
 && (m_path.isEmpty() || m_path[0] != '/');
 }
 
 sal_Int32 UriReference::getPathSegmentCount()
 {
+std::lock_guard g(m_mutex);
 if (m_path.isEmpty()) {
 return 0;
 } else {
@@ -116,6 +121,7 @@ sal_Int32 UriReference::getPathSegmentCount()
 
 OUString UriReference::getPathSegment(sal_Int32 index)
 {
+std::lock_guard g(m_mutex);
 if (!m_path.isEmpty() && index >= 0) {
 for (sal_Int32 i = m_path[0] == '/' ? 1 : 0;; ++i) {
 if (index-- == 0) {
diff --git a/stoc/source/uriproc/UriReference.hxx 
b/stoc/source/uriproc/UriReference.hxx
index 715819789e66..e1645372038a 100644
--- a/stoc/source/uriproc/UriReference.hxx
+++ b/stoc/source/uriproc/UriReference.hxx
@@ -46,10 +46,10 @@ public:
 const OUString& getScheme() const { return m_scheme;}
 
 /// @throws css::uno::RuntimeException
-OUString getSchemeSpecificPart() const;
+OUString getSchemeSpecificPart();
 
 /// @throws css::uno::RuntimeException
-bool isHierarchical() const;
+bool isHierarchical();
 
 /// @throws css::uno::RuntimeException
 bool hasAuthority() const;
@@ -58,7 +58,7 @@ public:
 const OUString& getAuthority() const;
 
 /// @throws css::uno::RuntimeException
-const OUString& getPath() const;
+OUString getPath();
 
 /// @throws css::uno::RuntimeException
 bool hasRelativePath();
@@ -88,20 +88,21 @@ public:
 void clearFragment();
 
 std::mutex m_mutex;
-OUString m_scheme;
-OUString m_authority;
 OUString m_path;
-OUString m_query;
-OUString m_fragment;
-bool m_hasAuthority;
-bool m_hasQuery;
-bool m_hasFragment;
 
 private:
 UriReference(UriReference const &) = delete;
 void operator =(UriReference const &) = delete;
 
 void appendSchemeSpecificPart(OUStringBuffer & buffer) const;
+
+OUString m_scheme;
+OUString m_authority;
+OUString m_query;
+OUString m_fragment;
+bool m_hasAuthority;
+bool m_hasQuery;
+bool m_hasFragment;
 };
 
 }


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

2021-08-03 Thread Noel Grandin (via logerrit)
 stoc/source/uriproc/UriReference.cxx  |   30 
+-
 stoc/source/uriproc/UriReference.hxx  |4 -
 stoc/source/uriproc/UriSchemeParser_vndDOTsunDOTstarDOTscript.cxx |   10 +--
 3 files changed, 22 insertions(+), 22 deletions(-)

New commits:
commit 5891746d5cf459ea87ad79ea231f2aedaafb7b39
Author: Noel Grandin 
AuthorDate: Sun Aug 1 19:09:07 2021 +0200
Commit: Noel Grandin 
CommitDate: Tue Aug 3 13:21:07 2021 +0200

osl::Mutex->std::mutex in UriReference

Change-Id: Ic5fb97774821be582af62e74bd2e00fca503b8f3
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/119889
Tested-by: Jenkins
Reviewed-by: Noel Grandin 

diff --git a/stoc/source/uriproc/UriReference.cxx 
b/stoc/source/uriproc/UriReference.cxx
index 75ed1abaa2a4..b5962ea74342 100644
--- a/stoc/source/uriproc/UriReference.cxx
+++ b/stoc/source/uriproc/UriReference.cxx
@@ -50,7 +50,7 @@ UriReference::~UriReference() {}
 
 OUString UriReference::getUriReference()
 {
-osl::MutexGuard g(m_mutex);
+std::lock_guard g(m_mutex);
 OUStringBuffer buf(128);
 if (!m_scheme.isEmpty()) {
 buf.append(m_scheme);
@@ -71,41 +71,41 @@ bool UriReference::isAbsolute() const {
 
 OUString UriReference::getSchemeSpecificPart()
 {
-osl::MutexGuard g(m_mutex);
+std::lock_guard g(m_mutex);
 OUStringBuffer buf;
 appendSchemeSpecificPart(buf);
 return buf.makeStringAndClear();
 }
 
 bool UriReference::isHierarchical() {
-osl::MutexGuard g(m_mutex);
+std::lock_guard g(m_mutex);
 return m_scheme.isEmpty() || m_hasAuthority || m_path.startsWith("/");
 }
 
 bool UriReference::hasAuthority() {
-osl::MutexGuard g(m_mutex);
+std::lock_guard g(m_mutex);
 return m_hasAuthority;
 }
 
 OUString UriReference::getAuthority() {
-osl::MutexGuard g(m_mutex);
+std::lock_guard g(m_mutex);
 return m_authority;
 }
 
 OUString UriReference::getPath() {
-osl::MutexGuard g(m_mutex);
+std::lock_guard g(m_mutex);
 return m_path;
 }
 
 bool UriReference::hasRelativePath() {
-osl::MutexGuard g(m_mutex);
+std::lock_guard g(m_mutex);
 return !m_hasAuthority
 && (m_path.isEmpty() || m_path[0] != '/');
 }
 
 sal_Int32 UriReference::getPathSegmentCount()
 {
-osl::MutexGuard g(m_mutex);
+std::lock_guard g(m_mutex);
 if (m_path.isEmpty()) {
 return 0;
 } else {
@@ -123,7 +123,7 @@ sal_Int32 UriReference::getPathSegmentCount()
 
 OUString UriReference::getPathSegment(sal_Int32 index)
 {
-osl::MutexGuard g(m_mutex);
+std::lock_guard g(m_mutex);
 if (!m_path.isEmpty() && index >= 0) {
 for (sal_Int32 i = m_path[0] == '/' ? 1 : 0;; ++i) {
 if (index-- == 0) {
@@ -140,34 +140,34 @@ OUString UriReference::getPathSegment(sal_Int32 index)
 }
 
 bool UriReference::hasQuery() {
-osl::MutexGuard g(m_mutex);
+std::lock_guard g(m_mutex);
 return m_hasQuery;
 }
 
 OUString UriReference::getQuery() {
-osl::MutexGuard g(m_mutex);
+std::lock_guard g(m_mutex);
 return m_query;
 }
 
 bool UriReference::hasFragment() {
-osl::MutexGuard g(m_mutex);
+std::lock_guard g(m_mutex);
 return m_hasFragment;
 }
 
 OUString UriReference::getFragment() {
-osl::MutexGuard g(m_mutex);
+std::lock_guard g(m_mutex);
 return m_fragment;
 }
 
 void UriReference::setFragment(OUString const & fragment)
 {
-osl::MutexGuard g(m_mutex);
+std::lock_guard g(m_mutex);
 m_hasFragment = true;
 m_fragment = fragment;
 }
 
 void UriReference::clearFragment() {
-osl::MutexGuard g(m_mutex);
+std::lock_guard g(m_mutex);
 m_hasFragment = false;
 m_fragment.clear();
 }
diff --git a/stoc/source/uriproc/UriReference.hxx 
b/stoc/source/uriproc/UriReference.hxx
index 4a88c414f567..90a095873364 100644
--- a/stoc/source/uriproc/UriReference.hxx
+++ b/stoc/source/uriproc/UriReference.hxx
@@ -20,7 +20,7 @@
 #ifndef INCLUDED_STOC_SOURCE_URIPROC_URIREFERENCE_HXX
 #define INCLUDED_STOC_SOURCE_URIPROC_URIREFERENCE_HXX
 
-#include 
+#include 
 #include 
 #include 
 #include 
@@ -87,7 +87,7 @@ public:
 /// @throws css::uno::RuntimeException
 void clearFragment();
 
-osl::Mutex m_mutex;
+std::mutex m_mutex;
 OUString m_scheme;
 OUString m_authority;
 OUString m_path;
diff --git a/stoc/source/uriproc/UriSchemeParser_vndDOTsunDOTstarDOTscript.cxx 
b/stoc/source/uriproc/UriSchemeParser_vndDOTsunDOTstarDOTscript.cxx
index d5cfb2347863..1614f44b2f89 100644
--- a/stoc/source/uriproc/UriSchemeParser_vndDOTsunDOTstarDOTscript.cxx
+++ b/stoc/source/uriproc/UriSchemeParser_vndDOTsunDOTstarDOTscript.cxx
@@ -267,7 +267,7 @@ private:
 };
 
 OUString UrlReference::getName() {
-osl::MutexGuard g(m_base.m_mutex);
+std::lock_guard g(m_base.m_mutex);
 sal_Int32 i = 0;
 return parsePart(m_base.m_path, true, );
 }
@@ -278,7 +278,7 @@ void SAL_CALL UrlReference::setName(OUString const & name)
 throw 

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

2021-08-02 Thread Noel Grandin (via logerrit)
 stoc/source/simpleregistry/simpleregistry.cxx |   70 +-
 1 file changed, 35 insertions(+), 35 deletions(-)

New commits:
commit 0b5869d9f898ad8533a7c49a135efa739b8c465e
Author: Noel Grandin 
AuthorDate: Sun Aug 1 19:03:49 2021 +0200
Commit: Noel Grandin 
CommitDate: Mon Aug 2 09:58:28 2021 +0200

osl::Mutex->std::mutex in SimpleRegistry

Change-Id: I92d76187ec9f487aaf43cbf19f390ddd8d82
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/119833
Tested-by: Jenkins
Reviewed-by: Noel Grandin 

diff --git a/stoc/source/simpleregistry/simpleregistry.cxx 
b/stoc/source/simpleregistry/simpleregistry.cxx
index 29c9011f6ef3..7b7b9d8d132d 100644
--- a/stoc/source/simpleregistry/simpleregistry.cxx
+++ b/stoc/source/simpleregistry/simpleregistry.cxx
@@ -20,6 +20,7 @@
 #include 
 
 #include 
+#include 
 #include 
 
 #include 
@@ -37,7 +38,6 @@
 #include 
 #include 
 #include 
-#include 
 #include 
 #include 
 #include 
@@ -60,7 +60,7 @@ class SimpleRegistry:
 public:
 SimpleRegistry() {}
 
-osl::Mutex mutex_;
+std::mutex mutex_;
 
 private:
 virtual OUString SAL_CALL getURL() override;
@@ -179,18 +179,18 @@ private:
 };
 
 OUString Key::getKeyName() {
-osl::MutexGuard guard(registry_->mutex_);
+std::lock_guard guard(registry_->mutex_);
 return key_.getName();
 }
 
 sal_Bool Key::isReadOnly()
 {
-osl::MutexGuard guard(registry_->mutex_);
+std::lock_guard guard(registry_->mutex_);
 return key_.isReadOnly();
 }
 
 sal_Bool Key::isValid() {
-osl::MutexGuard guard(registry_->mutex_);
+std::lock_guard guard(registry_->mutex_);
 return key_.isValid();
 }
 
@@ -201,7 +201,7 @@ css::registry::RegistryKeyType Key::getKeyType(OUString 
const & )
 
 css::registry::RegistryValueType Key::getValueType()
 {
-osl::MutexGuard guard(registry_->mutex_);
+std::lock_guard guard(registry_->mutex_);
 RegValueType type;
 sal_uInt32 size;
 RegError err = key_.getValueInfo(OUString(), , );
@@ -242,7 +242,7 @@ css::registry::RegistryValueType Key::getValueType()
 
 sal_Int32 Key::getLongValue()
 {
-osl::MutexGuard guard(registry_->mutex_);
+std::lock_guard guard(registry_->mutex_);
 sal_Int32 value;
 RegError err = key_.getValue(OUString(), );
 switch (err) {
@@ -264,7 +264,7 @@ sal_Int32 Key::getLongValue()
 
 void Key::setLongValue(sal_Int32 value)
 {
-osl::MutexGuard guard(registry_->mutex_);
+std::lock_guard guard(registry_->mutex_);
 RegError err = key_.setValue(
 OUString(), RegValueType::LONG, , sizeof (sal_Int32));
 if (err != RegError::NO_ERROR) {
@@ -277,7 +277,7 @@ void Key::setLongValue(sal_Int32 value)
 
 css::uno::Sequence< sal_Int32 > Key::getLongListValue()
 {
-osl::MutexGuard guard(registry_->mutex_);
+std::lock_guard guard(registry_->mutex_);
 RegistryValueList< sal_Int32 > list;
 RegError err = key_.getLongListValue(OUString(), list);
 switch (err) {
@@ -313,7 +313,7 @@ css::uno::Sequence< sal_Int32 > Key::getLongListValue()
 
 void Key::setLongListValue(css::uno::Sequence< sal_Int32 > const & seqValue)
 {
-osl::MutexGuard guard(registry_->mutex_);
+std::lock_guard guard(registry_->mutex_);
 auto list = 
comphelper::sequenceToContainer>(seqValue);
 RegError err = key_.setLongListValue(
 OUString(), list.data(), static_cast< sal_uInt32 >(list.size()));
@@ -327,7 +327,7 @@ void Key::setLongListValue(css::uno::Sequence< sal_Int32 > 
const & seqValue)
 
 OUString Key::getAsciiValue()
 {
-osl::MutexGuard guard(registry_->mutex_);
+std::lock_guard guard(registry_->mutex_);
 RegValueType type;
 sal_uInt32 size;
 RegError err = key_.getValueInfo(OUString(), , );
@@ -390,7 +390,7 @@ OUString Key::getAsciiValue()
 
 void Key::setAsciiValue(OUString const & value)
 {
-osl::MutexGuard guard(registry_->mutex_);
+std::lock_guard guard(registry_->mutex_);
 OString utf8;
 if (!value.convertToString(
 , RTL_TEXTENCODING_UTF8,
@@ -416,7 +416,7 @@ void Key::setAsciiValue(OUString const & value)
 
 css::uno::Sequence< OUString > Key::getAsciiListValue()
 {
-osl::MutexGuard guard(registry_->mutex_);
+std::lock_guard guard(registry_->mutex_);
 RegistryValueList< char * > list;
 RegError err = key_.getStringListValue(OUString(), list);
 switch (err) {
@@ -469,7 +469,7 @@ css::uno::Sequence< OUString > Key::getAsciiListValue()
 void Key::setAsciiListValue(
 css::uno::Sequence< OUString > const & seqValue)
 {
-osl::MutexGuard guard(registry_->mutex_);
+std::lock_guard guard(registry_->mutex_);
 std::vector< OString > list;
 for (const auto& rValue : seqValue) {
 OString utf8;
@@ -503,7 +503,7 @@ void Key::setAsciiListValue(
 
 OUString Key::getStringValue()
 {
-osl::MutexGuard guard(registry_->mutex_);
+std::lock_guard guard(registry_->mutex_);
 RegValueType type;
 sal_uInt32 size;
 RegError err = 

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

2021-08-02 Thread Noel Grandin (via logerrit)
 stoc/source/corereflection/lrucache.hxx |   10 +-
 1 file changed, 5 insertions(+), 5 deletions(-)

New commits:
commit e98f04cedff85fd6a355a67cabd507782e2f693b
Author: Noel Grandin 
AuthorDate: Sun Aug 1 18:56:59 2021 +0200
Commit: Noel Grandin 
CommitDate: Mon Aug 2 08:37:00 2021 +0200

osl::Mutex->std::mutex in LRU_Cache

Change-Id: Ia84cef550412540aa511f917198712add32fc7ac
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/119831
Tested-by: Jenkins
Reviewed-by: Noel Grandin 

diff --git a/stoc/source/corereflection/lrucache.hxx 
b/stoc/source/corereflection/lrucache.hxx
index 4ed99eaa77b0..c004d605485a 100644
--- a/stoc/source/corereflection/lrucache.hxx
+++ b/stoc/source/corereflection/lrucache.hxx
@@ -22,10 +22,10 @@
 // __CACHE_DIAGNOSE forces cache size to 4 and works only for OUString keys
 //  #define __CACHE_DIAGNOSE 1
 
-#include 
 #include 
 
 #include 
+#include 
 #include 
 
 namespace com::sun::star::uno { class Any; }
@@ -45,7 +45,7 @@ class LRU_Cache
 };
 typedef std::unordered_map< t_Key, CacheEntry *, t_KeyHash > t_Key2Element;
 
-mutable ::osl::Mutex_aCacheMutex;
+mutable std::mutex_aCacheMutex;
 sal_Int32   _nCachedElements;
 t_Key2Element   _aKey2Element;
 
@@ -126,7 +126,7 @@ inline void LRU_Cache< t_Key, t_Val, t_KeyHash >::toFront( 
CacheEntry * pEntry )
 template< class t_Key, class t_Val, class t_KeyHash >
 inline t_Val LRU_Cache< t_Key, t_Val, t_KeyHash >::getValue( const t_Key & 
rKey ) const
 {
-::osl::MutexGuard aGuard( _aCacheMutex );
+std::lock_guard aGuard( _aCacheMutex );
 const typename t_Key2Element::const_iterator iFind( _aKey2Element.find( 
rKey ) );
 if (iFind != _aKey2Element.end())
 {
@@ -146,7 +146,7 @@ template< class t_Key, class t_Val, class t_KeyHash >
 inline void LRU_Cache< t_Key, t_Val, t_KeyHash >::setValue(
 const t_Key & rKey, const t_Val & rValue )
 {
-::osl::MutexGuard aGuard( _aCacheMutex );
+std::lock_guard aGuard( _aCacheMutex );
 if (_nCachedElements > 0)
 {
 const typename t_Key2Element::const_iterator iFind( 
_aKey2Element.find( rKey ) );
@@ -184,7 +184,7 @@ inline void LRU_Cache< t_Key, t_Val, t_KeyHash >::setValue(
 template< class t_Key, class t_Val, class t_KeyHash >
 inline void LRU_Cache< t_Key, t_Val, t_KeyHash >::clear()
 {
-::osl::MutexGuard aGuard( _aCacheMutex );
+std::lock_guard aGuard( _aCacheMutex );
 _aKey2Element.clear();
 for ( sal_Int32 nPos = _nCachedElements; nPos--; )
 {


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

2021-08-01 Thread Noel Grandin (via logerrit)
 stoc/source/javavm/interact.cxx |8 
 1 file changed, 4 insertions(+), 4 deletions(-)

New commits:
commit 7c38362dbe1922c9825dffb463072030948d406b
Author: Noel Grandin 
AuthorDate: Sun Aug 1 18:59:31 2021 +0200
Commit: Noel Grandin 
CommitDate: Sun Aug 1 22:59:38 2021 +0200

osl::Mutex->std::mutex in InteractionRequest::RetryContinuation

Change-Id: I36a238f9b61471266b8fbc81c8e159a0e36182da
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/119832
Tested-by: Jenkins
Reviewed-by: Noel Grandin 

diff --git a/stoc/source/javavm/interact.cxx b/stoc/source/javavm/interact.cxx
index 58be91615d2f..45fba8aab597 100644
--- a/stoc/source/javavm/interact.cxx
+++ b/stoc/source/javavm/interact.cxx
@@ -23,7 +23,7 @@
 #include 
 #include 
 #include 
-#include 
+#include 
 
 namespace com::sun::star::task { class XInteractionContinuation; }
 
@@ -62,19 +62,19 @@ public:
 private:
 virtual ~RetryContinuation() override {}
 
-mutable osl::Mutex m_aMutex;
+mutable std::mutex m_aMutex;
 bool m_bSelected;
 };
 
 void SAL_CALL InteractionRequest::RetryContinuation::select()
 {
-osl::MutexGuard aGuard(m_aMutex);
+std::lock_guard aGuard(m_aMutex);
 m_bSelected = true;
 }
 
 bool InteractionRequest::RetryContinuation::isSelected() const
 {
-osl::MutexGuard aGuard(m_aMutex);
+std::lock_guard aGuard(m_aMutex);
 return m_bSelected;
 }
 


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

2021-07-19 Thread Noel Grandin (via logerrit)
 stoc/source/servicemanager/servicemanager.cxx |6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

New commits:
commit e9570e324a750d103d0116a2e3495306757f1a64
Author: Noel Grandin 
AuthorDate: Sun Jul 18 12:00:11 2021 +0200
Commit: Noel Grandin 
CommitDate: Mon Jul 19 08:54:03 2021 +0200

osl::Mutex->std::mutex in ImplementationEnumeration_Impl

Change-Id: I4bb9c6dc7efd76b730e2c8acf824b1e29bca8df5
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/119134
Tested-by: Jenkins
Reviewed-by: Noel Grandin 

diff --git a/stoc/source/servicemanager/servicemanager.cxx 
b/stoc/source/servicemanager/servicemanager.cxx
index f1543d293de7..ad7cef754c60 100644
--- a/stoc/source/servicemanager/servicemanager.cxx
+++ b/stoc/source/servicemanager/servicemanager.cxx
@@ -216,7 +216,7 @@ public:
 virtual Any SAL_CALL nextElement() override;
 
 private:
-Mutex   aMutex;
+std::mutex  aMutex;
 HashSet_Ref aImplementationMap;
 HashSet_Ref::iterator   aIt;
 };
@@ -224,14 +224,14 @@ private:
 // XEnumeration
 sal_Bool ImplementationEnumeration_Impl::hasMoreElements()
 {
-MutexGuard aGuard( aMutex );
+std::lock_guard aGuard( aMutex );
 return aIt != aImplementationMap.end();
 }
 
 // XEnumeration
 Any ImplementationEnumeration_Impl::nextElement()
 {
-MutexGuard aGuard( aMutex );
+std::lock_guard aGuard( aMutex );
 if( aIt == aImplementationMap.end() )
 throw NoSuchElementException("no more elements");
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2021-07-18 Thread Noel Grandin (via logerrit)
 stoc/source/servicemanager/servicemanager.cxx |7 ---
 1 file changed, 4 insertions(+), 3 deletions(-)

New commits:
commit 3d18cae102e16b85fb8787f5ec3b086bfa2bd7b8
Author: Noel Grandin 
AuthorDate: Sun Jul 18 11:59:28 2021 +0200
Commit: Noel Grandin 
CommitDate: Sun Jul 18 21:59:50 2021 +0200

osl::Mutex->std::mutex in ServiceEnumeration_Impl

Change-Id: I3d754006c7c2766281d924253f2caa0ff4963fea
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/119133
Tested-by: Jenkins
Reviewed-by: Noel Grandin 

diff --git a/stoc/source/servicemanager/servicemanager.cxx 
b/stoc/source/servicemanager/servicemanager.cxx
index 09814d5d08eb..f1543d293de7 100644
--- a/stoc/source/servicemanager/servicemanager.cxx
+++ b/stoc/source/servicemanager/servicemanager.cxx
@@ -51,6 +51,7 @@
 #include 
 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -137,7 +138,7 @@ public:
 sal_Bool SAL_CALL hasMoreElements() override;
 Any SAL_CALL nextElement() override;
 private:
-Mutex   aMutex;
+std::mutex  aMutex;
 Sequence< Reference >  aFactories;
 sal_Int32   nIt;
 };
@@ -145,14 +146,14 @@ private:
 // XEnumeration
 sal_Bool ServiceEnumeration_Impl::hasMoreElements()
 {
-MutexGuard aGuard( aMutex );
+std::lock_guard aGuard( aMutex );
 return nIt != aFactories.getLength();
 }
 
 // XEnumeration
 Any ServiceEnumeration_Impl::nextElement()
 {
-MutexGuard aGuard( aMutex );
+std::lock_guard aGuard( aMutex );
 if( nIt == aFactories.getLength() )
 throw NoSuchElementException("no more elements");
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2021-07-18 Thread Noel Grandin (via logerrit)
 stoc/source/namingservice/namingservice.cxx |   10 +-
 1 file changed, 5 insertions(+), 5 deletions(-)

New commits:
commit 896e213395bdbd5adb3a62ece67fb28b4d78d6c9
Author: Noel Grandin 
AuthorDate: Sun Jul 18 11:56:47 2021 +0200
Commit: Noel Grandin 
CommitDate: Sun Jul 18 20:46:02 2021 +0200

osl::Mutex->std::mutex in NamingService_Impl

Change-Id: Ief6cf9df4caafcf72e31394488c407acb5d545fc
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/119132
Tested-by: Jenkins
Reviewed-by: Noel Grandin 

diff --git a/stoc/source/namingservice/namingservice.cxx 
b/stoc/source/namingservice/namingservice.cxx
index a71b3644f9e4..efc33e5adf77 100644
--- a/stoc/source/namingservice/namingservice.cxx
+++ b/stoc/source/namingservice/namingservice.cxx
@@ -18,7 +18,6 @@
  */
 
 
-#include 
 #include 
 #include 
 #include 
@@ -26,6 +25,7 @@
 #include 
 #include 
 
+#include 
 #include 
 
 using namespace cppu;
@@ -47,7 +47,7 @@ namespace {
 class NamingService_Impl
 : public WeakImplHelper < XServiceInfo, XNamingService >
 {
-Mutex   aMutex;
+std::mutex  aMutex;
 HashMap_OWString_Interface  aMap;
 public:
 NamingService_Impl();
@@ -89,7 +89,7 @@ Sequence< OUString > 
NamingService_Impl::getSupportedServiceNames()
 // XServiceInfo
 Reference< XInterface > NamingService_Impl::getRegisteredObject( const 
OUString& Name )
 {
-Guard< Mutex > aGuard( aMutex );
+std::lock_guard aGuard( aMutex );
 Reference< XInterface > xRet;
 HashMap_OWString_Interface::iterator aIt = aMap.find( Name );
 if( aIt != aMap.end() )
@@ -100,14 +100,14 @@ Reference< XInterface > 
NamingService_Impl::getRegisteredObject( const OUString&
 // XServiceInfo
 void NamingService_Impl::registerObject( const OUString& Name, const 
Reference< XInterface >& Object )
 {
-Guard< Mutex > aGuard( aMutex );
+std::lock_guard aGuard( aMutex );
 aMap[ Name ] = Object;
 }
 
 // XServiceInfo
 void NamingService_Impl::revokeObject( const OUString& Name )
 {
-Guard< Mutex > aGuard( aMutex );
+std::lock_guard aGuard( aMutex );
 aMap.erase( Name );
 }
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2021-06-29 Thread Stephan Bergmann (via logerrit)
 stoc/source/javavm/javavm.cxx |2 +-
 stoc/source/javavm/javavm.hxx |   15 ---
 2 files changed, 5 insertions(+), 12 deletions(-)

New commits:
commit 457d53b1d409f97545a9d6492efa5119de92293c
Author: Stephan Bergmann 
AuthorDate: Tue Jun 29 16:12:00 2021 +0200
Commit: Stephan Bergmann 
CommitDate: Tue Jun 29 21:31:47 2021 +0200

Drop old MSVC workaround

Change-Id: Ifbbbad0bf837533d36fdeddcb0184baa5b789ca3
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/118118
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann 

diff --git a/stoc/source/javavm/javavm.cxx b/stoc/source/javavm/javavm.cxx
index 729573b43be6..00fec7970aa6 100644
--- a/stoc/source/javavm/javavm.cxx
+++ b/stoc/source/javavm/javavm.cxx
@@ -471,7 +471,7 @@ private:
 
 JavaVirtualMachine::JavaVirtualMachine(
 css::uno::Reference< css::uno::XComponentContext > const & rContext):
-JavaVirtualMachine_Impl(m_aMutex),
+WeakComponentImplHelper(m_aMutex),
 m_xContext(rContext),
 m_bDisposed(false),
 m_pJavaVm(nullptr),
diff --git a/stoc/source/javavm/javavm.hxx b/stoc/source/javavm/javavm.hxx
index b2517fa22f69..e3551b29220f 100644
--- a/stoc/source/javavm/javavm.hxx
+++ b/stoc/source/javavm/javavm.hxx
@@ -52,18 +52,11 @@ namespace jvmaccess {
 
 namespace stoc_javavm {
 
-// The MS compiler needs a typedef here, so the JavaVirtualMachine ctor can 
call
-// its base class ctor:
-typedef
-cppu::WeakComponentImplHelper< css::lang::XInitialization,
-css::lang::XServiceInfo,
-css::java::XJavaVM,
-css::java::XJavaThreadRegister_11,
-css::container::XContainerListener >
-JavaVirtualMachine_Impl;
-
 class JavaVirtualMachine:
-private cppu::BaseMutex, public JavaVirtualMachine_Impl
+private cppu::BaseMutex,
+public cppu::WeakComponentImplHelper<
+css::lang::XInitialization, css::lang::XServiceInfo, 
css::java::XJavaVM,
+css::java::XJavaThreadRegister_11, css::container::XContainerListener>
 {
 public:
 explicit JavaVirtualMachine(
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2021-06-29 Thread Stephan Bergmann (via logerrit)
 stoc/source/javavm/javavm.cxx |2 --
 stoc/source/javavm/javavm.hxx |4 
 2 files changed, 6 deletions(-)

New commits:
commit 310a1931c1087f94b4b8a8f1964189e020275286
Author: Stephan Bergmann 
AuthorDate: Tue Jun 29 17:04:53 2021 +0200
Commit: Stephan Bergmann 
CommitDate: Tue Jun 29 21:31:24 2021 +0200

Fix JavaVirtualMachine::dispose

...which must call derived-from JavaVirtualMachine_Impl::dispose 
(explicitly,
when overriding it), but which got lost with
951a9342631129832e647bd8a303a959308bad65 "use single-use attribute for
JavaVirtualMachine"

Change-Id: I0ca581ae10400f430c24a04b056afbb45a5c1445
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/118121
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann 

diff --git a/stoc/source/javavm/javavm.cxx b/stoc/source/javavm/javavm.cxx
index 47a735464040..729573b43be6 100644
--- a/stoc/source/javavm/javavm.cxx
+++ b/stoc/source/javavm/javavm.cxx
@@ -1472,8 +1472,6 @@ void JavaVirtualMachine::handleJniException(JNIEnv * 
environment) {
 }
 
 
-void JavaVirtualMachine::dispose() {}
-
 extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface*
 stoc_JavaVM_get_implementation(
 css::uno::XComponentContext* context , css::uno::Sequence 
const&)
diff --git a/stoc/source/javavm/javavm.hxx b/stoc/source/javavm/javavm.hxx
index 8b721bd62825..b2517fa22f69 100644
--- a/stoc/source/javavm/javavm.hxx
+++ b/stoc/source/javavm/javavm.hxx
@@ -112,10 +112,6 @@ public:
 virtual void SAL_CALL
 elementReplaced(css::container::ContainerEvent const & rEvent) override;
 
-// XComponent
-virtual void SAL_CALL
-dispose() override;
-
 private:
 JavaVirtualMachine(JavaVirtualMachine const &) = delete;
 void operator =(const JavaVirtualMachine&) = delete;
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2021-06-29 Thread Stephan Bergmann (via logerrit)
 stoc/source/javavm/javavm.cxx |3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

New commits:
commit 4cc1b2b55bf4efd21530632eccd9c01267a71218
Author: Stephan Bergmann 
AuthorDate: Tue Jun 29 09:54:16 2021 +0200
Commit: Stephan Bergmann 
CommitDate: Tue Jun 29 11:53:47 2021 +0200

Missing acquire in UNO constructor function

...that was lost in 951a9342631129832e647bd8a303a959308bad65 "use single-use
attribute for JavaVirtualMachine".  (Noticed with `SDK_HOME=.../instdir/sdk
URE_HOME=.../instdir make -f Makefile.pln test-javatest` in 
ure/source/uretest
failing at

[...]
> warn:legacy.osl:1255514:1255514:cppuhelper/source/implbase.cxx:84: 
OSL_ASSERT: rBHelper.bDisposed
> =
> ==1255514==ERROR: AddressSanitizer: heap-use-after-free on address 
0x61001740 at pc 0x7f14cbe32a2a bp 0x7fff46636a70 sp 0x7fff46636a68
> READ of size 8 at 0x61001740 thread T0
>  #0 in com::sun::star::uno::cpp_release(void*) at 
include/com/sun/star/uno/genfunc.hxx:52:43
>  #1 in cppu::_release(void*, void (*)(void*)) at 
cppu/source/uno/prim.hxx:85:13
>  #2 in cppu::_destructAny(_uno_Any*, void (*)(void*)) at 
cppu/source/uno/destr.hxx:129:9
>  #3 in uno_any_destruct at cppu/source/uno/any.cxx:131:5
>  #4 in com::sun::star::uno::Any::~Any() at 
include/com/sun/star/uno/Any.hxx:115:5
>  #5 in cppu::(anonymous 
namespace)::ComponentContext::ContextEntry::~ContextEntry() at 
cppuhelper/source/component_context.cxx:131:12
>  #6 in std::pair::~pair() at 
~/gcc/trunk/inst/lib/gcc/x86_64-pc-linux-gnu/12.0.0/../../../../include/c++/12.0.0/bits/stl_iterator.h:2368:12
>  #7 in void std::destroy_at 
>(std::pair*) at 
~/gcc/trunk/inst/lib/gcc/x86_64-pc-linux-gnu/12.0.0/../../../../include/c++/12.0.0/bits/stl_construct.h:88:15
>  #8 in void 
std::allocator_traits, true> > 
>::destroy 
>(std::allocator, true> >&, 
std::pair*) at 
~/gcc/trunk/inst/lib/gcc/x86_64-pc-linux-gnu/12.0.0/../../../../include/c++/12.0.0/bits/alloc_traits.h:533:4
>  #9 in 
std::__detail::_Hashtable_alloc, true> > 
>::_M_deallocate_node(std::__detail::_Hash_node, true>*) at 
~/gcc/trunk/inst/lib/gcc/x86_64-pc-linux-gnu/12.0.0/../../../../include/c++/12.0.0/bits/hashtable_policy.h:1932:7
>  #10 in 
std::__detail::_Hashtable_alloc, true> > 
>::_M_deallocate_nodes(std::__detail::_Hash_node, true>*) at 
~/gcc/trunk/inst/lib/gcc/x86_64-pc-linux-gnu/12.0.0/../../../../include/c++/12.0.0/bits/hashtable_policy.h:1954:4
>  #11 in std::_Hashtable, 
std::allocator >, std::__detail::_Select1st, 
std::equal_to, std::hash, 
std::__detail::_Mod_range_hashing, std::__detail::_Default_ranged_hash, 
std::__detail::_Prime_rehash_policy, std::__detail::_Hashtable_traits >::clear() at 
~/gcc/trunk/inst/lib/gcc/x86_64-pc-linux-gnu/12.0.0/../../../../include/c++/12.0.0/bits/hashtable.h:2332:13
>  #12 in std::__cxx1998::unordered_map, 
std::equal_to, std::allocator > >::clear() at 
~/gcc/trunk/inst/lib/gcc/x86_64-pc-linux-gnu/12.0.0/../../../../include/c++/12.0.0/bits/unordered_map.h:791:14
>  #13 in std::__debug::unordered_map, 
std::equal_to, std::allocator > >::clear() at 
~/gcc/trunk/inst/lib/gcc/x86_64-pc-linux-gnu/12.0.0/../../../../include/c++/12.0.0/debug/unordered_map:223:9
>  #14 in cppu::(anonymous namespace)::ComponentContext::disposing() at 
cppuhelper/source/component_context.cxx:444:11
>  #15 in cppu::WeakComponentImplHelperBase::dispose() at 
cppuhelper/source/implbase.cxx:104:13
>  #16 in 
cppu::PartialWeakComponentImplHelper::dispose() at 
include/cppuhelper/compbase.hxx:90:36
>  #17 in sal_main() at cpputools/source/unoexe/unoexe.cxx:540:16
>  #18 in main at cpputools/source/unoexe/unoexe.cxx:358:1
>
> 0x61001740 is located 0 bytes inside of 192-byte region 
[0x61001740,0x61001800)
> freed by thread T0 here:
>  #0 in free at 
~/github.com/llvm/llvm-project/compiler-rt/lib/asan/asan_malloc_linux.cpp:111:3
>  #1 in rtl_freeMemory at sal/rtl/alloc_global.cxx:51:5
>  #2 in cppu::WeakComponentImplHelperBase::operator delete(void*) at 
include/cppuhelper/compbase_ex.hxx:70:11
>  #3 in stoc_javavm::JavaVirtualMachine::~JavaVirtualMachine() at 
stoc/source/javavm/javavm.cxx:1122:1
>  #4 in cppu::OWeakObject::release() at cppuhelper/source/weak.cxx:242:9
>  #5 in cppu::WeakComponentImplHelperBase::release() at 
cppuhelper/source/implbase.cxx:86:18
>  #6 in 
cppu::PartialWeakComponentImplHelper::release() at 
include/cppuhelper/compbase.hxx:86:36
>  #7 in 
com::sun::star::uno::Reference::~Reference() 
at include/com/sun/star/uno/Reference.hxx:114:22
>  #8 in 
cppuhelper::ServiceManager::Data::Implementation::~Implementation() at 
cppuhelper/source/servicemanager.hxx:72:16
>  #9 in void 
std::destroy_at(cppuhelper::ServiceManager::Data::Implementation*)
 at 

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

2021-05-29 Thread Noel Grandin (via logerrit)
 stoc/source/corereflection/base.hxx|6 +--
 stoc/source/corereflection/crcomp.cxx  |   13 +++
 stoc/source/corereflection/crenum.cxx  |   15 -
 stoc/source/corereflection/criface.cxx |   55 +++--
 4 files changed, 42 insertions(+), 47 deletions(-)

New commits:
commit d32dfd9e955cdc893aa21ab8e870d217d1628ad3
Author: Noel Grandin 
AuthorDate: Fri May 28 14:43:02 2021 +0200
Commit: Noel Grandin 
CommitDate: Sat May 29 19:22:23 2021 +0200

std::unique->std::optional

rather than having a pointer to a pointer (which is what Sequence is)

Change-Id: Ieb7b9995f6a25022fe2401adc3c38124edb83506
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/116376
Tested-by: Jenkins
Reviewed-by: Noel Grandin 

diff --git a/stoc/source/corereflection/base.hxx 
b/stoc/source/corereflection/base.hxx
index e322f87aa62e..16d42213ddcd 100644
--- a/stoc/source/corereflection/base.hxx
+++ b/stoc/source/corereflection/base.hxx
@@ -231,8 +231,8 @@ class CompoundIdlClassImpl
 {
 css::uno::Reference< css::reflection::XIdlClass >
  _xSuperClass;
-std::unique_ptr< css::uno::Sequence< css::uno::Reference< 
css::reflection::XIdlField > > >
-_pFields;
+std::optional< css::uno::Sequence< css::uno::Reference< 
css::reflection::XIdlField > > >
+m_xFields;
 OUString2Field  _aName2Field;
 
 public:
@@ -294,7 +294,7 @@ public:
 class EnumIdlClassImpl
 : public IdlClassImpl
 {
-std::unique_ptr< css::uno::Sequence< css::uno::Reference< 
css::reflection::XIdlField > > > _pFields;
+std::optional< css::uno::Sequence< css::uno::Reference< 
css::reflection::XIdlField > > > m_xFields;
 OUString2Field   _aName2Field;
 
 public:
diff --git a/stoc/source/corereflection/crcomp.cxx 
b/stoc/source/corereflection/crcomp.cxx
index ae15991ad017..51cf4a6f02e4 100644
--- a/stoc/source/corereflection/crcomp.cxx
+++ b/stoc/source/corereflection/crcomp.cxx
@@ -302,7 +302,7 @@ Sequence< Reference< XIdlClass > > 
CompoundIdlClassImpl::getSuperclasses()
 
 Reference< XIdlField > CompoundIdlClassImpl::getField( const OUString & rName )
 {
-if (! _pFields)
+if (! m_xFields)
 getFields(); // init fields
 
 const OUString2Field::const_iterator iFind( _aName2Field.find( rName ) );
@@ -315,16 +315,15 @@ Reference< XIdlField > CompoundIdlClassImpl::getField( 
const OUString & rName )
 Sequence< Reference< XIdlField > > CompoundIdlClassImpl::getFields()
 {
 ::osl::MutexGuard aGuard( getMutexAccess() );
-if (! _pFields)
+if (! m_xFields)
 {
 sal_Int32 nAll = 0;
 typelib_CompoundTypeDescription * pCompTypeDescr = getTypeDescr();
 for ( ; pCompTypeDescr; pCompTypeDescr = 
pCompTypeDescr->pBaseTypeDescription )
 nAll += pCompTypeDescr->nMembers;
 
-Sequence< Reference< XIdlField > > * pFields =
-new Sequence< Reference< XIdlField > >( nAll );
-Reference< XIdlField > * pSeq = pFields->getArray();
+Sequence< Reference< XIdlField > > aFields( nAll );
+Reference< XIdlField > * pSeq = aFields.getArray();
 
 for ( pCompTypeDescr = getTypeDescr(); pCompTypeDescr;
   pCompTypeDescr = pCompTypeDescr->pBaseTypeDescription )
@@ -348,9 +347,9 @@ Sequence< Reference< XIdlField > > 
CompoundIdlClassImpl::getFields()
 }
 }
 
-_pFields.reset( pFields );
+m_xFields = std::move( aFields );
 }
-return *_pFields;
+return *m_xFields;
 }
 
 }
diff --git a/stoc/source/corereflection/crenum.cxx 
b/stoc/source/corereflection/crenum.cxx
index ea441fc975fd..dae3449d3b2c 100644
--- a/stoc/source/corereflection/crenum.cxx
+++ b/stoc/source/corereflection/crenum.cxx
@@ -159,7 +159,7 @@ EnumIdlClassImpl::~EnumIdlClassImpl()
 
 Reference< XIdlField > EnumIdlClassImpl::getField( const OUString & rName )
 {
-if (! _pFields)
+if (! m_xFields)
 getFields(); // init members
 
 const OUString2Field::const_iterator iFind( _aName2Field.find( rName ) );
@@ -171,15 +171,14 @@ Reference< XIdlField > EnumIdlClassImpl::getField( const 
OUString & rName )
 
 Sequence< Reference< XIdlField > > EnumIdlClassImpl::getFields()
 {
-if (! _pFields)
+if (! m_xFields)
 {
 ::osl::MutexGuard aGuard( getMutexAccess() );
-if (! _pFields)
+if (! m_xFields)
 {
 sal_Int32 nFields = getTypeDescr()->nEnumValues;
-Sequence< Reference< XIdlField > > * pFields =
-new Sequence< Reference< XIdlField > >( nFields );
-Reference< XIdlField > * pSeq = pFields->getArray();
+Sequence< Reference< XIdlField > > aFields( nFields );
+Reference< XIdlField > * pSeq = aFields.getArray();
 
 while (nFields--)
 {
@@ -188,10 +187,10 @@ 

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

2021-03-23 Thread Noel Grandin (via logerrit)
 stoc/source/corereflection/crefl.cxx|   20 +---
 stoc/source/corereflection/reflection.component |3 ++-
 2 files changed, 3 insertions(+), 20 deletions(-)

New commits:
commit 3c534f895c2811d9bcbae06a48fdad7893f0c684
Author: Noel Grandin 
AuthorDate: Mon Mar 22 13:50:00 2021 +0200
Commit: Noel Grandin 
CommitDate: Tue Mar 23 10:26:11 2021 +0100

use single-use attribute for IdlReflectionServiceImpl

instead of rtl::Instance, which means it will get
cleaned up when UNO shuts down

Change-Id: Icf87023bba5932c3b6e229b71c421fce17e86db9
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/112931
Tested-by: Jenkins
Reviewed-by: Noel Grandin 

diff --git a/stoc/source/corereflection/crefl.cxx 
b/stoc/source/corereflection/crefl.cxx
index e4f879495c3f..e19869e5d9df 100644
--- a/stoc/source/corereflection/crefl.cxx
+++ b/stoc/source/corereflection/crefl.cxx
@@ -367,24 +367,6 @@ uno_Interface * IdlReflectionServiceImpl::mapToUno(
 }
 
 
-namespace {
-
-struct Instance {
-explicit Instance(
-css::uno::Reference const & context):
-instance(new stoc_corefl::IdlReflectionServiceImpl(context))
-{}
-
-rtl::Reference instance;
-};
-
-struct Singleton:
-public rtl::StaticWithArg<
-Instance, css::uno::Reference, Singleton>
-{};
-
-}
-
 extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface *
 com_sun_star_comp_stoc_CoreReflection_get_implementation(
 css::uno::XComponentContext * context,
@@ -392,7 +374,7 @@ com_sun_star_comp_stoc_CoreReflection_get_implementation(
 {
 SAL_WARN_IF(
 arguments.hasElements(), "stoc", "unexpected singleton arguments");
-return cppu::acquire(Singleton::get(context).instance.get());
+return cppu::acquire(new stoc_corefl::IdlReflectionServiceImpl(context));
 }
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/stoc/source/corereflection/reflection.component 
b/stoc/source/corereflection/reflection.component
index 6ebd541950bf..70ccb68e0402 100644
--- a/stoc/source/corereflection/reflection.component
+++ b/stoc/source/corereflection/reflection.component
@@ -20,7 +20,8 @@
 http://openoffice.org/2010/uno-components;>
   
+  constructor="com_sun_star_comp_stoc_CoreReflection_get_implementation"
+  single-instance="true">
 
 
   
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2021-03-23 Thread Noel Grandin (via logerrit)
 stoc/source/inspect/introspection.component |3 ++-
 stoc/source/inspect/introspection.cxx   |   16 +---
 2 files changed, 3 insertions(+), 16 deletions(-)

New commits:
commit 9a1f9c13439491d3b78a73f6eee5cda4e561401f
Author: Noel Grandin 
AuthorDate: Mon Mar 22 13:47:27 2021 +0200
Commit: Noel Grandin 
CommitDate: Tue Mar 23 07:39:57 2021 +0100

use single-use attribute for Introspection

instead of rtl::Instance, which means it will get
cleaned up when UNO shuts down

Change-Id: I8b9ed057ca77b9c783ad353b88205b296dbe54ed
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/112930
Tested-by: Jenkins
Reviewed-by: Noel Grandin 

diff --git a/stoc/source/inspect/introspection.component 
b/stoc/source/inspect/introspection.component
index 4cf06357ae24..84e121fad1f7 100644
--- a/stoc/source/inspect/introspection.component
+++ b/stoc/source/inspect/introspection.component
@@ -20,7 +20,8 @@
 http://openoffice.org/2010/uno-components;>
   
+  constructor="com_sun_star_comp_stoc_Introspection_get_implementation"
+  single-instance="true">
 
 
   
diff --git a/stoc/source/inspect/introspection.cxx 
b/stoc/source/inspect/introspection.cxx
index 9317a5c35493..c7c0fd638175 100644
--- a/stoc/source/inspect/introspection.cxx
+++ b/stoc/source/inspect/introspection.cxx
@@ -2404,20 +2404,6 @@ css::uno::Reference 
Implementation::inspect(
 return new ImplIntrospectionAccess(aToInspectObj, pAccess);
 }
 
-struct Instance {
-explicit Instance(
-css::uno::Reference const & context):
-instance(new Implementation(context))
-{}
-
-rtl::Reference instance;
-};
-
-struct Singleton:
-public rtl::StaticWithArg<
-Instance, css::uno::Reference, Singleton>
-{};
-
 }
 
 extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface *
@@ -2427,7 +2413,7 @@ com_sun_star_comp_stoc_Introspection_get_implementation(
 {
 SAL_WARN_IF(
 arguments.hasElements(), "stoc", "unexpected singleton arguments");
-return cppu::acquire(Singleton::get(context).instance.get());
+return cppu::acquire(new Implementation(context));
 }
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2021-03-23 Thread Noel Grandin (via logerrit)
 stoc/source/javavm/javavm.component |3 ++-
 stoc/source/javavm/javavm.cxx   |   20 ++--
 2 files changed, 4 insertions(+), 19 deletions(-)

New commits:
commit 951a9342631129832e647bd8a303a959308bad65
Author: Noel Grandin 
AuthorDate: Mon Mar 22 13:45:32 2021 +0200
Commit: Noel Grandin 
CommitDate: Tue Mar 23 07:39:40 2021 +0100

use single-use attribute for JavaVirtualMachine

instead of rtl::Instance, which means it will get
cleaned up when UNO shuts down

Change-Id: Iecf943584d71aac0ed147ff4b6fce49192ef2787
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/112929
Tested-by: Jenkins
Reviewed-by: Noel Grandin 

diff --git a/stoc/source/javavm/javavm.component 
b/stoc/source/javavm/javavm.component
index 79d993ddd62c..71379052b89e 100644
--- a/stoc/source/javavm/javavm.component
+++ b/stoc/source/javavm/javavm.component
@@ -20,7 +20,8 @@
 http://openoffice.org/2010/uno-components;>
   
+constructor="stoc_JavaVM_get_implementation"
+single-instance="true">
 
 
   
diff --git a/stoc/source/javavm/javavm.cxx b/stoc/source/javavm/javavm.cxx
index 19bce9f5f2cd..35fc0cb9c7d9 100644
--- a/stoc/source/javavm/javavm.cxx
+++ b/stoc/source/javavm/javavm.cxx
@@ -1471,29 +1471,13 @@ void JavaVirtualMachine::handleJniException(JNIEnv * 
environment) {
 }
 
 
-static osl::Mutex m_aMutex;
-static rtl::Reference< JavaVirtualMachine > m_xSingleton;
-
-
-void JavaVirtualMachine::dispose() {
-JavaVirtualMachine_Impl::dispose();
-osl::MutexGuard aGuard(m_aMutex);
-m_xSingleton.clear();
-}
+void JavaVirtualMachine::dispose() {}
 
 extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface*
 stoc_JavaVM_get_implementation(
 css::uno::XComponentContext* context , css::uno::Sequence 
const&)
 {
-// Only one single instance of this service is ever constructed, and is
-// available until the component context used to create this instance is
-// disposed.  Afterwards, this function throws a DisposedException (as do
-// all relevant methods on the single service instance).
-osl::MutexGuard aGuard(m_aMutex);
-if (!m_xSingleton.is())
-m_xSingleton.set(new JavaVirtualMachine(context));
-m_xSingleton->acquire();
-return static_cast(m_xSingleton.get());
+return static_cast(new JavaVirtualMachine(context));
 }
 
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2021-03-22 Thread Caolán McNamara (via logerrit)
 stoc/source/typeconv/convert.cxx |1 +
 1 file changed, 1 insertion(+)

New commits:
commit af6a33f495a6c0ad1981a250dde355044e8519cb
Author: Caolán McNamara 
AuthorDate: Mon Mar 22 10:15:38 2021 +
Commit: Caolán McNamara 
CommitDate: Mon Mar 22 13:33:08 2021 +0100

cid#1473974 silence Explicit null dereferenced

Change-Id: Id9e381c3919dac989a5957beddd0c070d38ad47d
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/112870
Tested-by: Caolán McNamara 
Reviewed-by: Caolán McNamara 

diff --git a/stoc/source/typeconv/convert.cxx b/stoc/source/typeconv/convert.cxx
index e8fe65830a99..2f87b4f42500 100644
--- a/stoc/source/typeconv/convert.cxx
+++ b/stoc/source/typeconv/convert.cxx
@@ -495,6 +495,7 @@ Any SAL_CALL TypeConverter_Impl::convertTo( const Any& 
rVal, const Type& aDestTy
 {
 // void -> interface (null)
 void * null_ref = nullptr;
+// coverity[var_deref_model : FALSE] - null_ref will not be 
derefed in this case
 aRet.setValue( _ref, aDestType );
 break;
 }
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: stoc/source svl/source svtools/source

2021-02-16 Thread Noel (via logerrit)
 stoc/source/javavm/javavm.cxx  |2 +-
 svl/source/numbers/numfmuno.cxx|2 +-
 svl/source/passwordcontainer/passwordcontainer.cxx |2 +-
 svtools/source/control/ruler.cxx   |4 ++--
 svtools/source/control/valueacc.cxx|2 +-
 svtools/source/misc/embedhlp.cxx   |   14 +++---
 svtools/source/uno/unogridcolumnfacade.cxx |4 ++--
 svtools/source/uno/unoimap.cxx |4 ++--
 8 files changed, 17 insertions(+), 17 deletions(-)

New commits:
commit dfe8ec631426bf317209723c956d373ac146058e
Author: Noel 
AuthorDate: Tue Feb 16 12:57:01 2021 +0200
Commit: Noel Grandin 
CommitDate: Tue Feb 16 20:18:01 2021 +0100

loplugin:referencecasting in stoc..svtools

Change-Id: I806ffb3ab06731c61fe9c58788aabf00a05e980f
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/110987
Tested-by: Jenkins
Reviewed-by: Noel Grandin 

diff --git a/stoc/source/javavm/javavm.cxx b/stoc/source/javavm/javavm.cxx
index 1b7a86e712ec..19bce9f5f2cd 100644
--- a/stoc/source/javavm/javavm.cxx
+++ b/stoc/source/javavm/javavm.cxx
@@ -137,7 +137,7 @@ bool askForRetry(css::uno::Any const & rException)
 {
 rtl::Reference< stoc_javavm::InteractionRequest > xRequest(
 new stoc_javavm::InteractionRequest(rException));
-xHandler->handle(xRequest.get());
+xHandler->handle(xRequest);
 return xRequest->retry();
 }
 }
diff --git a/svl/source/numbers/numfmuno.cxx b/svl/source/numbers/numfmuno.cxx
index ba3a9e0cbe0d..45e12f8fab31 100644
--- a/svl/source/numbers/numfmuno.cxx
+++ b/svl/source/numbers/numfmuno.cxx
@@ -137,7 +137,7 @@ void SAL_CALL 
SvNumberFormatterServiceObj::attachNumberFormatsSupplier( const un
 uno::Reference SAL_CALL 
SvNumberFormatterServiceObj::getNumberFormatsSupplier()
 {
 ::osl::MutexGuard aGuard( m_aMutex );
-return xSupplier.get();
+return xSupplier;
 }
 
 sal_Int32 SAL_CALL SvNumberFormatterServiceObj::detectNumberFormat( sal_Int32 
nKey, const OUString& aString )
diff --git a/svl/source/passwordcontainer/passwordcontainer.cxx 
b/svl/source/passwordcontainer/passwordcontainer.cxx
index c5ad78d65106..4a6d8abf4f32 100644
--- a/svl/source/passwordcontainer/passwordcontainer.cxx
+++ b/svl/source/passwordcontainer/passwordcontainer.cxx
@@ -782,7 +782,7 @@ OUString PasswordContainer::RequestPasswordFromUser( 
PasswordRequestMode aRMode,
 {
 ::rtl::Reference< MasterPasswordRequest_Impl > xRequest = new 
MasterPasswordRequest_Impl( aRMode );
 
-xHandler->handle( xRequest.get() );
+xHandler->handle( xRequest );
 
 ::rtl::Reference< ucbhelper::InteractionContinuation > xSelection = 
xRequest->getSelection();
 
diff --git a/svtools/source/control/ruler.cxx b/svtools/source/control/ruler.cxx
index 170769684ba1..7b1aa9549e8b 100644
--- a/svtools/source/control/ruler.cxx
+++ b/svtools/source/control/ruler.cxx
@@ -2764,8 +2764,8 @@ uno::Reference< XAccessible > Ruler::CreateAccessible()
 aStr = SvtResId(STR_SVT_ACC_RULER_VERT_NAME);
 }
 mxAccContext = new SvtRulerAccessible( xAccParent, *this, aStr );
-SetAccessible(mxAccContext.get());
-return mxAccContext.get();
+SetAccessible(mxAccContext);
+return mxAccContext;
 }
 else
 return uno::Reference< XAccessible >();
diff --git a/svtools/source/control/valueacc.cxx 
b/svtools/source/control/valueacc.cxx
index 0973f9ff5a15..ff0e18959a9b 100644
--- a/svtools/source/control/valueacc.cxx
+++ b/svtools/source/control/valueacc.cxx
@@ -58,7 +58,7 @@ uno::Reference< accessibility::XAccessible > 
ValueSetItem::GetAccessible( bool b
 if( !mxAcc.is() )
 mxAcc = new ValueItemAcc( this, bIsTransientChildrenDisabled );
 
-return mxAcc.get();
+return mxAcc;
 }
 
 ValueItemAcc::ValueItemAcc( ValueSetItem* pParent, bool 
bIsTransientChildrenDisabled ) :
diff --git a/svtools/source/misc/embedhlp.cxx b/svtools/source/misc/embedhlp.cxx
index 6536747f1b3a..8146c8fd956a 100644
--- a/svtools/source/misc/embedhlp.cxx
+++ b/svtools/source/misc/embedhlp.cxx
@@ -95,16 +95,16 @@ rtl::Reference 
EmbedEventListener_Impl::Create( Embedde
 
 if ( p->GetObject().is() )
 {
-p->GetObject()->addStateChangeListener( pRet.get() );
+p->GetObject()->addStateChangeListener( pRet );
 
 uno::Reference < util::XCloseable > xClose = p->GetObject();
 DBG_ASSERT( xClose.is(), "Object does not support XCloseable!" );
 if ( xClose.is() )
-xClose->addCloseListener( pRet.get() );
+xClose->addCloseListener( pRet );
 
 uno::Reference < document::XEventBroadcaster > xBrd = p->GetObject();
 if ( xBrd.is() )
-xBrd->addEventListener( pRet.get() );
+xBrd->addEventListener( pRet );
 
 pRet->nState = p->GetObject()->getCurrentState();
 if ( 

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

2020-12-21 Thread Henry Castro (via logerrit)
 stoc/source/javavm/javavm.cxx |3 ---
 1 file changed, 3 deletions(-)

New commits:
commit 8ccc28f8a72d0ac5a464418bde51ce6a1518c087
Author: Henry Castro 
AuthorDate: Mon Dec 21 14:30:42 2020 +0100
Commit: Henry Castro 
CommitDate: Mon Dec 21 14:35:10 2020 +0100

Revert "lok: add pre-condition "DontEnableJava""

This reverts commit 8c5c6b8993a52c40b9de231e778204bcdca16333.

Reason for revert: "This is broken.  For example, "Tools - Macros - Run 
Macro... - Library - LibreOffice Macros - HelloWorld" under "Macro Name" no 
longer lists the JVM-based scripts ("helloworld.bsh", "helloworld.js", 
"org.libreoffice.exmpale.java_scripts.HelloWorld.printHW")."

Change-Id: I6fef6ea80689f036e79816c8d58d2c1f9e64967c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/108007
Tested-by: Henry Castro 
Reviewed-by: Henry Castro 

diff --git a/stoc/source/javavm/javavm.cxx b/stoc/source/javavm/javavm.cxx
index ccb8ca232813..1b7a86e712ec 100644
--- a/stoc/source/javavm/javavm.cxx
+++ b/stoc/source/javavm/javavm.cxx
@@ -574,9 +574,6 @@ JavaVirtualMachine::getJavaVM(css::uno::Sequence< sal_Int8 
> const & rProcessId)
 if (aId != aProcessId)
 return css::uno::Any();
 
-if (comphelper::IsContextFlagActive("DontEnableJava"))
-return css::uno::Any();
-
 std::unique_ptr info;
 while (!m_xVirtualMachine.is()) // retry until successful
 {
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2020-12-18 Thread Henry Castro (via logerrit)
 stoc/source/javavm/javavm.cxx |3 +++
 1 file changed, 3 insertions(+)

New commits:
commit 8c5c6b8993a52c40b9de231e778204bcdca16333
Author: Henry Castro 
AuthorDate: Fri Dec 4 16:11:12 2020 -0400
Commit: Henry Castro 
CommitDate: Fri Dec 18 22:22:58 2020 +0100

lok: add pre-condition "DontEnableJava"

The context data "DontEnableJava" is set when
it is not required to JVM to get involved,
in particular case when the Macro Selector Dialog
tries to fill the macro scripts, but the client side
has disabled the JVM and it produces a lot of checks
to try to get booted the JVM.

Is there any reason why it is not a pre-condition
at the beginning of the function?

Change-Id: I3bd4a22ddef12a130ea5ecd08c67f1db66bbac72
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/107242
Tested-by: Jenkins
Reviewed-by: Henry Castro 

diff --git a/stoc/source/javavm/javavm.cxx b/stoc/source/javavm/javavm.cxx
index 1b7a86e712ec..ccb8ca232813 100644
--- a/stoc/source/javavm/javavm.cxx
+++ b/stoc/source/javavm/javavm.cxx
@@ -574,6 +574,9 @@ JavaVirtualMachine::getJavaVM(css::uno::Sequence< sal_Int8 
> const & rProcessId)
 if (aId != aProcessId)
 return css::uno::Any();
 
+if (comphelper::IsContextFlagActive("DontEnableJava"))
+return css::uno::Any();
+
 std::unique_ptr info;
 while (!m_xVirtualMachine.is()) // retry until successful
 {
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2020-07-24 Thread Noel Grandin (via logerrit)
 stoc/source/javavm/javavm.component |5 -
 stoc/source/javavm/javavm.cxx   |  145 +++-
 stoc/source/javavm/javavm.hxx   |4 
 3 files changed, 36 insertions(+), 118 deletions(-)

New commits:
commit 785312dc11a78f72784c04a2e8e3183162a1e28b
Author: Noel Grandin 
AuthorDate: Fri Jul 24 08:36:10 2020 +0200
Commit: Noel Grandin 
CommitDate: Fri Jul 24 09:20:25 2020 +0200

stoc/javavm: create instances with uno constructors

See tdf#74608 for motivation.

Change-Id: I4eb381d19e453ceb2b035462f0f5de923458a03e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/99345
Tested-by: Jenkins
Reviewed-by: Noel Grandin 

diff --git a/stoc/source/javavm/javavm.component 
b/stoc/source/javavm/javavm.component
index 04367fad7ee3..79d993ddd62c 100644
--- a/stoc/source/javavm/javavm.component
+++ b/stoc/source/javavm/javavm.component
@@ -18,8 +18,9 @@
  -->
 
 http://openoffice.org/2010/uno-components;>
-  
+xmlns="http://openoffice.org/2010/uno-components;>
+  
 
 
   
diff --git a/stoc/source/javavm/javavm.cxx b/stoc/source/javavm/javavm.cxx
index 7df1fed46c57..c2c5f469e914 100644
--- a/stoc/source/javavm/javavm.cxx
+++ b/stoc/source/javavm/javavm.cxx
@@ -108,111 +108,6 @@ class NoJavaIniException: public css::uno::Exception
 {
 };
 
-class SingletonFactory:
-private cppu::WeakImplHelper< css::lang::XEventListener >
-{
-public:
-static css::uno::Reference< css::uno::XInterface > getSingleton(
-css::uno::Reference< css::uno::XComponentContext > const & rContext);
-
-private:
-SingletonFactory() {}
-
-virtual ~SingletonFactory() override {}
-
-SingletonFactory(const SingletonFactory&) = delete;
-SingletonFactory& operator=(const SingletonFactory&) = delete;
-
-virtual void SAL_CALL disposing(css::lang::EventObject const &) override;
-
-static void dispose();
-
-// TODO ok to keep these static?
-static osl::Mutex m_aMutex;
-static css::uno::Reference< css::uno::XInterface > m_xSingleton;
-static bool m_bDisposed;
-};
-
-css::uno::Reference< css::uno::XInterface > SingletonFactory::getSingleton(
-css::uno::Reference< css::uno::XComponentContext > const & rContext)
-{
-css::uno::Reference< css::uno::XInterface > xSingleton;
-css::uno::Reference< css::lang::XComponent > xComponent;
-{
-osl::MutexGuard aGuard(m_aMutex);
-if (!m_xSingleton.is())
-{
-if (m_bDisposed)
-throw css::lang::DisposedException();
-xComponent.set( rContext, css::uno::UNO_QUERY_THROW);
-m_xSingleton = static_cast< cppu::OWeakObject * >(
-new JavaVirtualMachine(rContext));
-}
-xSingleton = m_xSingleton;
-}
-if (xComponent.is())
-try
-{
-xComponent->addEventListener(new SingletonFactory);
-}
-catch (...)
-{
-dispose();
-throw;
-}
-return xSingleton;
-}
-
-void SAL_CALL SingletonFactory::disposing(css::lang::EventObject const &)
-{
-dispose();
-}
-
-void SingletonFactory::dispose()
-{
-css::uno::Reference< css::lang::XComponent > xComponent;
-{
-osl::MutexGuard aGuard(m_aMutex);
-xComponent.set( m_xSingleton, css::uno::UNO_QUERY);
-m_xSingleton.clear();
-m_bDisposed = true;
-}
-if (xComponent.is())
-xComponent->dispose();
-}
-
-osl::Mutex SingletonFactory::m_aMutex;
-css::uno::Reference< css::uno::XInterface > SingletonFactory::m_xSingleton;
-bool SingletonFactory::m_bDisposed = false;
-
-OUString serviceGetImplementationName()
-{
-return "com.sun.star.comp.stoc.JavaVirtualMachine";
-}
-
-css::uno::Sequence< OUString > serviceGetSupportedServiceNames()
-{
-return css::uno::Sequence< OUString > { 
"com.sun.star.java.JavaVirtualMachine" };
-}
-
-css::uno::Reference< css::uno::XInterface > serviceCreateInstance(
-css::uno::Reference< css::uno::XComponentContext > const & rContext)
-{
-// Only one single instance of this service is ever constructed, and is
-// available until the component context used to create this instance is
-// disposed.  Afterwards, this function throws a DisposedException (as do
-// all relevant methods on the single service instance).
-return SingletonFactory::getSingleton(rContext);
-}
-
-cppu::ImplementationEntry const aServiceImplementation[]
-= { { serviceCreateInstance,
-  serviceGetImplementationName,
-  serviceGetSupportedServiceNames,
-  cppu::createSingleComponentFactory,
-  nullptr, 0 },
-{ nullptr, nullptr, nullptr, nullptr, nullptr, 0 } };
-
 typedef std::stack< jvmaccess::VirtualMachine::AttachGuard * > GuardStack;
 
 extern "C" {
@@ -577,15 +472,6 @@ private:
 
 }
 
-extern "C" SAL_DLLPUBLIC_EXPORT void * javavm_component_getFactory(char const 
* pImplName,
-void * 

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

2020-07-15 Thread Noel Grandin (via logerrit)
 stoc/source/invocation/invocation.component |5 +--
 stoc/source/invocation/invocation.cxx   |   43 +++-
 2 files changed, 9 insertions(+), 39 deletions(-)

New commits:
commit 3e8ca5b50a6eb70118908c7741bbf26d23ae1574
Author: Noel Grandin 
AuthorDate: Mon Jul 13 22:24:37 2020 +0200
Commit: Noel Grandin 
CommitDate: Wed Jul 15 09:53:10 2020 +0200

stoc/invocation: create instances with uno constructors

See tdf#74608 for motivation.

Change-Id: Idf47e3fff2ca0e693834bcdd228159b5725837e7
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/98700
Tested-by: Jenkins
Reviewed-by: Noel Grandin 

diff --git a/stoc/source/invocation/invocation.component 
b/stoc/source/invocation/invocation.component
index c5aa8b5a33af..b5027a4d6d65 100644
--- a/stoc/source/invocation/invocation.component
+++ b/stoc/source/invocation/invocation.component
@@ -18,8 +18,9 @@
  -->
 
 http://openoffice.org/2010/uno-components;>
-  
+xmlns="http://openoffice.org/2010/uno-components;>
+  
 
   
 
diff --git a/stoc/source/invocation/invocation.cxx 
b/stoc/source/invocation/invocation.cxx
index c2fb1d0d280f..bffd68ab99de 100644
--- a/stoc/source/invocation/invocation.cxx
+++ b/stoc/source/invocation/invocation.cxx
@@ -21,8 +21,6 @@
 #include 
 #include 
 #include 
-#include 
-#include 
 #include 
 #include 
 
@@ -49,31 +47,18 @@
 #include 
 #include 
 
-#define SERVICENAME "com.sun.star.script.Invocation"
-#define IMPLNAME "com.sun.star.comp.stoc.Invocation"
-
 using namespace css::uno;
 using namespace css::lang;
 using namespace css::script;
 using namespace css::reflection;
 using namespace css::beans;
-using namespace css::registry;
 using namespace css::container;
 using namespace cppu;
 using namespace osl;
 
 namespace stoc_inv
 {
-static Sequence< OUString > inv_getSupportedServiceNames()
-{
-Sequence< OUString > seqNames { SERVICENAME };
-return seqNames;
-}
 
-static OUString inv_getImplementationName()
-{
-return IMPLNAME;
-}
 
 // TODO: Implement centrally
 static Reference TypeToIdlClass( const Type& rType, const 
Reference< XIdlReflection > & xRefl )
@@ -1051,7 +1036,7 @@ InvocationService::InvocationService( const 
Reference & xCtx
 // XServiceInfo
 OUString InvocationService::getImplementationName()
 {
-return inv_getImplementationName();
+return "com.sun.star.comp.stoc.Invocation";
 }
 
 // XServiceInfo
@@ -1063,7 +1048,7 @@ sal_Bool InvocationService::supportsService(const 
OUString& ServiceName)
 // XServiceInfo
 Sequence< OUString > InvocationService::getSupportedServiceNames()
 {
-return inv_getSupportedServiceNames();
+return { "com.sun.star.script.Invocation" };
 }
 
 
@@ -1099,30 +1084,14 @@ Reference 
InvocationService::createInstanceWithArguments(
 return Reference();
 }
 
-/// @throws RuntimeException
-static Reference InvocationService_CreateInstance( const 
Reference & xCtx )
+extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface*
+stoc_InvocationService_get_implementation(
+css::uno::XComponentContext* context, css::uno::Sequence 
const&)
 {
-Reference xService( *new InvocationService( xCtx ) );
-return xService;
+return cppu::acquire(new InvocationService(context));
 }
 
 }
 
-using namespace stoc_inv;
-const struct ImplementationEntry g_entries[] =
-{
-{
-InvocationService_CreateInstance, inv_getImplementationName,
-inv_getSupportedServiceNames, createSingleComponentFactory,
-nullptr, 0
-},
-{ nullptr, nullptr, nullptr, nullptr, nullptr, 0 }
-};
-
-extern "C" SAL_DLLPUBLIC_EXPORT void * invocation_component_getFactory(
-const char * pImplName, void * pServiceManager, void * pRegistryKey )
-{
-return component_getFactoryHelper( pImplName, pServiceManager, 
pRegistryKey , g_entries );
-}
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2020-07-15 Thread Noel Grandin (via logerrit)
 stoc/source/javaloader/javaloader.component |5 +-
 stoc/source/javaloader/javaloader.cxx   |   53 
 2 files changed, 11 insertions(+), 47 deletions(-)

New commits:
commit 37f5ad41ed9928a4394b80050cdc00fd6d830a07
Author: Noel Grandin 
AuthorDate: Mon Jul 13 22:15:36 2020 +0200
Commit: Noel Grandin 
CommitDate: Wed Jul 15 08:47:22 2020 +0200

stoc/javaloader: create instances with uno constructors

See tdf#74608 for motivation.

Change-Id: Ic1ce8431bfb116c1e64116e2019fa0d3bcf8344c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/98698
Tested-by: Jenkins
Reviewed-by: Noel Grandin 

diff --git a/stoc/source/javaloader/javaloader.component 
b/stoc/source/javaloader/javaloader.component
index 9299097c4fd0..cc4ae610bdb2 100644
--- a/stoc/source/javaloader/javaloader.component
+++ b/stoc/source/javaloader/javaloader.component
@@ -18,8 +18,9 @@
  -->
 
 http://openoffice.org/2010/uno-components;>
-  
+xmlns="http://openoffice.org/2010/uno-components;>
+  
 
 
   
diff --git a/stoc/source/javaloader/javaloader.cxx 
b/stoc/source/javaloader/javaloader.cxx
index 191703b103c0..2b40cdd219db 100644
--- a/stoc/source/javaloader/javaloader.cxx
+++ b/stoc/source/javaloader/javaloader.cxx
@@ -64,18 +64,6 @@ using namespace ::osl;
 
 namespace stoc_javaloader {
 
-static Mutex & getInitMutex();
-
-static Sequence< OUString > loader_getSupportedServiceNames()
-{
-return { "com.sun.star.loader.Java", "com.sun.star.loader.Java2" };
-}
-
-static OUString loader_getImplementationName()
-{
-return "com.sun.star.comp.stoc.JavaComponentLoader";
-}
-
 namespace {
 
 class JavaComponentLoader : public WeakImplHelper
@@ -117,7 +105,8 @@ public:
 
 const css::uno::Reference & 
JavaComponentLoader::getJavaLoader()
 {
-MutexGuard aGuard(getInitMutex());
+static Mutex ourMutex;
+MutexGuard aGuard(ourMutex);
 
 if (m_javaLoader.is())
 return m_javaLoader;
@@ -290,7 +279,7 @@ JavaComponentLoader::JavaComponentLoader(const 
css::uno::Reference SAL_CALL JavaComponentLoader::getSupportedServiceNames()
 {
-return loader_getSupportedServiceNames();
+return { "com.sun.star.loader.Java", "com.sun.star.loader.Java2" };
 }
 
 
@@ -326,18 +315,12 @@ css::uno::Reference SAL_CALL 
JavaComponentLoader::activate(
 return loader->activate(rImplName, blabla, rLibName, xKey);
 }
 
-static Mutex & getInitMutex()
-{
-static Mutex ourMutex;
-
-return ourMutex;
-}
-
-/// @throws Exception
-static css::uno::Reference 
JavaComponentLoader_CreateInstance(const css::uno::Reference 
& xCtx)
+extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface*
+stoc_JavaComponentLoader_get_implementation(
+css::uno::XComponentContext* context, css::uno::Sequence 
const&)
 {
 try {
-return *new JavaComponentLoader(xCtx);
+return cppu::acquire(new JavaComponentLoader(context));
 }
 catch(const RuntimeException &) {
 TOOLS_INFO_EXCEPTION("stoc", "could not init javaloader");
@@ -348,25 +331,5 @@ static css::uno::Reference 
JavaComponentLoader_CreateInstance(const
 } //end namespace
 
 
-using namespace stoc_javaloader;
-
-const struct ImplementationEntry g_entries[] =
-{
-{
-JavaComponentLoader_CreateInstance, loader_getImplementationName,
-loader_getSupportedServiceNames, createOneInstanceComponentFactory,
-nullptr , 0
-},
-{ nullptr, nullptr, nullptr, nullptr, nullptr, 0 }
-};
-
-extern "C"
-{
-SAL_DLLPUBLIC_EXPORT void * javaloader_component_getFactory(
-const char * pImplName, void * pServiceManager, void * pRegistryKey )
-{
-return component_getFactoryHelper( pImplName, pServiceManager, 
pRegistryKey , g_entries );
-}
-}
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2020-07-14 Thread Noel Grandin (via logerrit)
 stoc/source/namingservice/namingservice.component |5 +-
 stoc/source/namingservice/namingservice.cxx   |   42 +++---
 2 files changed, 10 insertions(+), 37 deletions(-)

New commits:
commit 17363342935e38f463cf879682009534aab9fa7e
Author: Noel Grandin 
AuthorDate: Mon Jul 13 22:10:54 2020 +0200
Commit: Noel Grandin 
CommitDate: Tue Jul 14 18:30:58 2020 +0200

stoc/naming: create instances with uno constructors

See tdf#74608 for motivation.

Change-Id: Iaa8805141e480e05badd92c61a455e46bd411e87
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/98697
Tested-by: Jenkins
Reviewed-by: Noel Grandin 

diff --git a/stoc/source/namingservice/namingservice.component 
b/stoc/source/namingservice/namingservice.component
index 523c0037363b..3ba192e866e1 100644
--- a/stoc/source/namingservice/namingservice.component
+++ b/stoc/source/namingservice/namingservice.component
@@ -18,8 +18,9 @@
  -->
 
 http://openoffice.org/2010/uno-components;>
-  
+xmlns="http://openoffice.org/2010/uno-components;>
+  
 
   
 
diff --git a/stoc/source/namingservice/namingservice.cxx 
b/stoc/source/namingservice/namingservice.cxx
index cfecc0a7c795..29142064d537 100644
--- a/stoc/source/namingservice/namingservice.cxx
+++ b/stoc/source/namingservice/namingservice.cxx
@@ -38,23 +38,9 @@ using namespace css::lang;
 using namespace css::registry;
 
 
-#define SERVICENAME "com.sun.star.uno.NamingService"
-#define IMPLNAME"com.sun.star.comp.stoc.NamingService"
-
 namespace stoc_namingservice
 {
 
-static Sequence< OUString > ns_getSupportedServiceNames()
-{
-Sequence< OUString > seqNames { SERVICENAME };
-return seqNames;
-}
-
-static OUString ns_getImplementationName()
-{
-return IMPLNAME;
-}
-
 typedef std::unordered_map< OUString, Reference > 
HashMap_OWString_Interface;
 
 namespace {
@@ -79,11 +65,6 @@ public:
 
 }
 
-static Reference NamingService_Impl_create(
-SAL_UNUSED_PARAMETER const Reference & )
-{
-return *new NamingService_Impl();
-}
 
 
 NamingService_Impl::NamingService_Impl() {}
@@ -91,7 +72,7 @@ NamingService_Impl::NamingService_Impl() {}
 // XServiceInfo
 OUString NamingService_Impl::getImplementationName()
 {
-return ns_getImplementationName();
+return "com.sun.star.comp.stoc.NamingService";
 }
 
 // XServiceInfo
@@ -103,7 +84,7 @@ sal_Bool NamingService_Impl::supportsService( const OUString 
& rServiceName )
 // XServiceInfo
 Sequence< OUString > NamingService_Impl::getSupportedServiceNames()
 {
-return ns_getSupportedServiceNames();
+return { "com.sun.star.uno.NamingService" };
 }
 
 // XServiceInfo
@@ -133,21 +114,12 @@ void NamingService_Impl::revokeObject( const OUString& 
Name )
 
 }
 
-using namespace stoc_namingservice;
-const struct ImplementationEntry g_entries[] =
-{
-{
-NamingService_Impl_create, ns_getImplementationName,
-ns_getSupportedServiceNames, createSingleComponentFactory,
-nullptr, 0
-},
-{ nullptr, nullptr, nullptr, nullptr, nullptr, 0 }
-};
-
-extern "C" SAL_DLLPUBLIC_EXPORT void * namingservice_component_getFactory(
-const char * pImplName, void * pServiceManager, void * pRegistryKey )
+extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface*
+stoc_NamingService_Impl_get_implementation(
+css::uno::XComponentContext* , css::uno::Sequence const&)
 {
-return component_getFactoryHelper( pImplName, pServiceManager, 
pRegistryKey , g_entries );
+return cppu::acquire(new stoc_namingservice::NamingService_Impl());
 }
 
+
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2020-07-02 Thread Stephan Bergmann (via logerrit)
 stoc/source/corereflection/crbase.cxx   |2 -
 stoc/source/implementationregistration/implreg.cxx  |   22 ++--
 stoc/source/invocation/invocation.cxx   |2 -
 stoc/source/invocation_adapterfactory/iafactory.cxx |2 -
 stoc/source/javaloader/javaloader.cxx   |2 -
 stoc/source/namingservice/namingservice.cxx |2 -
 stoc/source/proxy_factory/proxyfac.cxx  |2 -
 stoc/source/security/access_controller.cxx  |2 -
 8 files changed, 18 insertions(+), 18 deletions(-)

New commits:
commit 45898370bcf0dfb8bd303dc0922ebae604d59224
Author: Stephan Bergmann 
AuthorDate: Thu Jul 2 07:13:23 2020 +0200
Commit: Stephan Bergmann 
CommitDate: Thu Jul 2 08:10:25 2020 +0200

Upcoming improved loplugin:staticanonymous -> redundantstatic: stoc

Change-Id: I993e4c0aef41b0925678d7744a989ad5539cc80e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/97693
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann 

diff --git a/stoc/source/corereflection/crbase.cxx 
b/stoc/source/corereflection/crbase.cxx
index c179324050c4..75e802c96045 100644
--- a/stoc/source/corereflection/crbase.cxx
+++ b/stoc/source/corereflection/crbase.cxx
@@ -93,7 +93,7 @@ sal_Bool IdlClassImpl::equals( const Reference< XIdlClass >& 
xType )
 (xType->getTypeClass() == _eTypeClass) && (xType->getName() == 
_aName));
 }
 
-static const bool s_aAssignableFromTab[11][11] =
+const bool s_aAssignableFromTab[11][11] =
 {
  /* from  CH,BO,BY,SH,US,LO,
UL,HY,UH,FL,DO */
 /* TypeClass_CHAR */{ true,  false, false, false, false, false, 
false, false, false, false, false },
diff --git a/stoc/source/implementationregistration/implreg.cxx 
b/stoc/source/implementationregistration/implreg.cxx
index dc21f55663c3..0d9cfb80ffda 100644
--- a/stoc/source/implementationregistration/implreg.cxx
+++ b/stoc/source/implementationregistration/implreg.cxx
@@ -56,27 +56,27 @@ using namespace osl;
 
 namespace {
 
-static constexpr OUStringLiteral slash_UNO_slash_REGISTRY_LINKS
+constexpr OUStringLiteral slash_UNO_slash_REGISTRY_LINKS
 = "/UNO/REGISTRY_LINKS";
-static constexpr OUStringLiteral slash_IMPLEMENTATIONS
+constexpr OUStringLiteral slash_IMPLEMENTATIONS
 =  "/IMPLEMENTATIONS";
-static constexpr OUStringLiteral slash_UNO
+constexpr OUStringLiteral slash_UNO
 = "/UNO";
-static constexpr OUStringLiteral slash_UNO_slash_SERVICES
+constexpr OUStringLiteral slash_UNO_slash_SERVICES
 = "/UNO/SERVICES";
-static constexpr OUStringLiteral slash_UNO_slash_SINGLETONS
+constexpr OUStringLiteral slash_UNO_slash_SINGLETONS
 = "/UNO/SINGLETONS";
-static constexpr OUStringLiteral slash_SERVICES
+constexpr OUStringLiteral slash_SERVICES
 = "/SERVICES/";
-static constexpr OUStringLiteral slash_UNO_slash_LOCATION
+constexpr OUStringLiteral slash_UNO_slash_LOCATION
 = "/UNO/LOCATION";
-static constexpr OUStringLiteral slash_UNO_slash_ACTIVATOR
+constexpr OUStringLiteral slash_UNO_slash_ACTIVATOR
 = "/UNO/ACTIVATOR";
-static constexpr OUStringLiteral colon_old
+constexpr OUStringLiteral colon_old
 = ":old";
-static constexpr OUStringLiteral com_sun_star_registry_SimpleRegistry
+constexpr OUStringLiteral com_sun_star_registry_SimpleRegistry
 = "com.sun.star.registry.SimpleRegistry";
-static constexpr OUStringLiteral Registry
+constexpr OUStringLiteral Registry
 = "Registry";
 
 //  static deleteAllLinkReferences()
diff --git a/stoc/source/invocation/invocation.cxx 
b/stoc/source/invocation/invocation.cxx
index 8027442aa9b2..c2fb1d0d280f 100644
--- a/stoc/source/invocation/invocation.cxx
+++ b/stoc/source/invocation/invocation.cxx
@@ -1109,7 +1109,7 @@ static Reference 
InvocationService_CreateInstance( const Reference FactoryImpl_create(
 }
 
 
-static const struct ::cppu::ImplementationEntry g_entries[] =
+const struct ::cppu::ImplementationEntry g_entries[] =
 {
 {
 ::stoc_invadp::FactoryImpl_create,
diff --git a/stoc/source/javaloader/javaloader.cxx 
b/stoc/source/javaloader/javaloader.cxx
index d6f77cd2be1d..191703b103c0 100644
--- a/stoc/source/javaloader/javaloader.cxx
+++ b/stoc/source/javaloader/javaloader.cxx
@@ -350,7 +350,7 @@ static css::uno::Reference 
JavaComponentLoader_CreateInstance(const
 
 using namespace stoc_javaloader;
 
-static const struct ImplementationEntry g_entries[] =
+const struct ImplementationEntry g_entries[] =
 {
 {
 JavaComponentLoader_CreateInstance, loader_getImplementationName,
diff --git a/stoc/source/namingservice/namingservice.cxx 
b/stoc/source/namingservice/namingservice.cxx
index b58212e2c176..cfecc0a7c795 100644
--- a/stoc/source/namingservice/namingservice.cxx
+++ b/stoc/source/namingservice/namingservice.cxx
@@ -134,7 +134,7 @@ void NamingService_Impl::revokeObject( const OUString& Name 
)
 }
 
 using namespace 

[Libreoffice-commits] core.git: stoc/source store/source svgio/inc

2020-03-14 Thread Noel Grandin (via logerrit)
 stoc/source/corereflection/base.hxx  |6 +++---
 stoc/source/corereflection/crcomp.cxx|2 +-
 stoc/source/implementationregistration/mergekeys.cxx |4 ++--
 stoc/source/inspect/introspection.cxx|2 +-
 stoc/source/invocation/invocation.cxx|2 +-
 stoc/source/invocation_adapterfactory/iafactory.cxx  |2 +-
 stoc/source/javavm/interact.hxx  |2 +-
 stoc/source/proxy_factory/proxyfac.cxx   |4 ++--
 stoc/source/security/file_policy.cxx |2 +-
 stoc/source/security/permissions.cxx |8 
 stoc/source/security/permissions.h   |2 +-
 stoc/source/servicemanager/servicemanager.cxx|2 +-
 stoc/source/uriproc/UriReference.hxx |   10 +-
 store/source/lockbyte.cxx|8 
 store/source/storcach.cxx|2 +-
 svgio/inc/svgcharacternode.hxx   |2 +-
 svgio/inc/svgnode.hxx|2 +-
 svgio/inc/svgpolynode.hxx|2 +-
 18 files changed, 32 insertions(+), 32 deletions(-)

New commits:
commit 2eb0e7594cc875dd0960822d9403b573ac00f739
Author: Noel Grandin 
AuthorDate: Fri Mar 13 09:59:10 2020 +0200
Commit: Noel Grandin 
CommitDate: Sat Mar 14 07:54:02 2020 +0100

Revert "loplugin:constfields in stoc..svgio"

This reverts commit 0ddf3e0a628599d01356cb5262b93faca073ee9f.

Change-Id: I3e476399a465950defc15ac4d6199a638c4a4baf
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/90452
Tested-by: Jenkins
Reviewed-by: Noel Grandin 

diff --git a/stoc/source/corereflection/base.hxx 
b/stoc/source/corereflection/base.hxx
index 4f8be7282230..02742fdb660e 100644
--- a/stoc/source/corereflection/base.hxx
+++ b/stoc/source/corereflection/base.hxx
@@ -140,8 +140,8 @@ class IdlClassImpl
 rtl::Reference
  m_xReflection;
 
-OUString const   _aName;
-css::uno::TypeClass const_eTypeClass;
+OUString_aName;
+css::uno::TypeClass _eTypeClass;
 
 typelib_TypeDescription *   _pTypeDescr;
 
@@ -321,7 +321,7 @@ class IdlMemberImpl
 {
 rtl::Reference
 m_xReflection;
-OUString const  _aName;
+OUString_aName;
 
 typelib_TypeDescription *   _pTypeDescr;
 typelib_TypeDescription *   _pDeclTypeDescr;
diff --git a/stoc/source/corereflection/crcomp.cxx 
b/stoc/source/corereflection/crcomp.cxx
index a42ee6742f92..da4ad43b83e6 100644
--- a/stoc/source/corereflection/crcomp.cxx
+++ b/stoc/source/corereflection/crcomp.cxx
@@ -40,7 +40,7 @@ class IdlCompFieldImpl
 , public XIdlField
 , public XIdlField2
 {
-sal_Int32 const _nOffset;
+sal_Int32   _nOffset;
 
 public:
 IdlCompFieldImpl( IdlReflectionServiceImpl * pReflection, const OUString & 
rName,
diff --git a/stoc/source/implementationregistration/mergekeys.cxx 
b/stoc/source/implementationregistration/mergekeys.cxx
index 1a8f8fcce8c4..da7da509ebce 100644
--- a/stoc/source/implementationregistration/mergekeys.cxx
+++ b/stoc/source/implementationregistration/mergekeys.cxx
@@ -37,8 +37,8 @@ namespace {
 
 struct Link
 {
-OUString const m_name;
-OUString const m_target;
+OUString m_name;
+OUString m_target;
 
 Link( OUString const & name, OUString const & target )
 : m_name( name )
diff --git a/stoc/source/inspect/introspection.cxx 
b/stoc/source/inspect/introspection.cxx
index 14ecf79af050..9317a5c35493 100644
--- a/stoc/source/inspect/introspection.cxx
+++ b/stoc/source/inspect/introspection.cxx
@@ -643,7 +643,7 @@ class ImplIntrospectionAccess : public 
IntrospectionAccessHelper
 friend class Implementation;
 
 // Object under examination
-Any const maInspectedObject;
+Any maInspectedObject;
 
 // As interface
 Reference mxIface;
diff --git a/stoc/source/invocation/invocation.cxx 
b/stoc/source/invocation/invocation.cxx
index 9343e0865e22..8027442aa9b2 100644
--- a/stoc/source/invocation/invocation.cxx
+++ b/stoc/source/invocation/invocation.cxx
@@ -212,7 +212,7 @@ private:
 
 Reference   _xENDirect, _xENIntrospection;
 
-bool const  mbFromOLE;
+boolmbFromOLE;
 };
 
 }
diff --git a/stoc/source/invocation_adapterfactory/iafactory.cxx 
b/stoc/source/invocation_adapterfactory/iafactory.cxx
index 060170fe420f..e6a66cf8d126 100644
--- a/stoc/source/invocation_adapterfactory/iafactory.cxx
+++ b/stoc/source/invocation_adapterfactory/iafactory.cxx
@@ -132,7 +132,7 @@ struct AdapterImpl
 {
 oslInterlockedCount m_nRef;
 FactoryImpl *   m_pFactory;
-void * constm_key; // map key
+void *  m_key; // 

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

2020-03-10 Thread Stephan Bergmann (via logerrit)
 stoc/source/javaloader/javaloader.cxx |   12 ++--
 1 file changed, 2 insertions(+), 10 deletions(-)

New commits:
commit 9ed75e2c65544b4f71c73e1c51a68d74e31d544b
Author: Stephan Bergmann 
AuthorDate: Tue Mar 10 13:17:24 2020 +0100
Commit: Stephan Bergmann 
CommitDate: Tue Mar 10 14:17:17 2020 +0100

Properly use createOneInstanceComponentFactory for javaloader

After 424a7f404565e068995e2a9827d5bc6f76920ec8 "add some more libs to 
libmerged"
had added javaloader to libmerged, destruction of static xStaticRef started 
to
cause problems at least during CppunitTest_services of --enable-mergedlib
Windows builds (presumably because the relative order of static variable
destruction had changed).

Change-Id: I8307570222cc9a3d9511d090d0dae7f7dfe7a9ad
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/90254
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann 

diff --git a/stoc/source/javaloader/javaloader.cxx 
b/stoc/source/javaloader/javaloader.cxx
index 065ff12558a5..d6f77cd2be1d 100644
--- a/stoc/source/javaloader/javaloader.cxx
+++ b/stoc/source/javaloader/javaloader.cxx
@@ -336,21 +336,13 @@ static Mutex & getInitMutex()
 /// @throws Exception
 static css::uno::Reference 
JavaComponentLoader_CreateInstance(const css::uno::Reference 
& xCtx)
 {
-css::uno::Reference xRet;
-
 try {
-MutexGuard guard( getInitMutex() );
-// The javaloader is never destroyed and there can be only one!
-// Note that the first context wins...
-static css::uno::Reference< XInterface > xStaticRef = *new 
JavaComponentLoader(xCtx);
-xRet = xStaticRef;
+return *new JavaComponentLoader(xCtx);
 }
 catch(const RuntimeException &) {
 TOOLS_INFO_EXCEPTION("stoc", "could not init javaloader");
 throw;
 }
-
-return xRet;
 }
 
 } //end namespace
@@ -362,7 +354,7 @@ static const struct ImplementationEntry g_entries[] =
 {
 {
 JavaComponentLoader_CreateInstance, loader_getImplementationName,
-loader_getSupportedServiceNames, createSingleComponentFactory,
+loader_getSupportedServiceNames, createOneInstanceComponentFactory,
 nullptr , 0
 },
 { nullptr, nullptr, nullptr, nullptr, nullptr, 0 }
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2020-02-06 Thread Stephan Bergmann (via logerrit)
 stoc/source/javavm/javavm.cxx |4 
 1 file changed, 4 insertions(+)

New commits:
commit 75c21f5a9298b8fa6ea6e8b6ae9f6bd59c442b36
Author: Stephan Bergmann 
AuthorDate: Wed Feb 5 17:34:10 2020 +0100
Commit: Stephan Bergmann 
CommitDate: Thu Feb 6 11:16:42 2020 +0100

Be more verbose about JNI errors at least with --enable-dbgutil

("The Java Native Interface" by Sheng Liang, Addison-Wesley 1999, states on
page 211:  "This function [ExceptionDescribe] has the side effect of 
clearing
the pending exception."  And since Java 10, the documentation of
ExceptionDescription at  states that "[t]he pending exception is
cleared as a side-effect of calling this function", even though for Java 8

 does not mention that.  So assume that calling
ExceptionDescribe always makes calling ExceptionClear superfluous.)

Change-Id: I4f89eb44768d436a224d7027afb5e7a93f092f29
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/88050
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann 

diff --git a/stoc/source/javavm/javavm.cxx b/stoc/source/javavm/javavm.cxx
index 84120eaa3c85..7df1fed46c57 100644
--- a/stoc/source/javavm/javavm.cxx
+++ b/stoc/source/javavm/javavm.cxx
@@ -1582,7 +1582,11 @@ void JavaVirtualMachine::setUpUnoVirtualMachine(JNIEnv * 
environment) {
 }
 
 void JavaVirtualMachine::handleJniException(JNIEnv * environment) {
+#if defined DBG_UTIL
+environment->ExceptionDescribe();
+#else
 environment->ExceptionClear();
+#endif
 throw css::uno::RuntimeException(
 "JNI exception occurred",
 static_cast< cppu::OWeakObject * >(this));
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2020-01-28 Thread Efdal İncesu (via logerrit)
 stoc/source/loader/dllcomponentloader.cxx |3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

New commits:
commit c8a27f91dad1d84da76f0862954956570b56a602
Author: Efdal İncesu 
AuthorDate: Tue Jan 28 10:28:24 2020 +0300
Commit: Muhammet Kara 
CommitDate: Tue Jan 28 09:56:42 2020 +0100

tdf#88205:  Adapt uses of css::uno::Sequence to use initializer_list ctor

Change-Id: Ie23019fe0b86f16820dd68c647c4ce1542dc
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/87575
Tested-by: Jenkins
Reviewed-by: Muhammet Kara 

diff --git a/stoc/source/loader/dllcomponentloader.cxx 
b/stoc/source/loader/dllcomponentloader.cxx
index fe88d1b74746..43f20ad0a5e4 100644
--- a/stoc/source/loader/dllcomponentloader.cxx
+++ b/stoc/source/loader/dllcomponentloader.cxx
@@ -86,8 +86,7 @@ sal_Bool SAL_CALL DllComponentLoader::supportsService( const 
OUString& ServiceNa
 
 Sequence SAL_CALL DllComponentLoader::getSupportedServiceNames(  )
 {
-Sequence< OUString > seqNames { "com.sun.star.loader.SharedLibrary" };
-return seqNames;
+return { "com.sun.star.loader.SharedLibrary" };
 }
 
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2019-12-03 Thread Stephan Bergmann (via logerrit)
 stoc/source/invocation/invocation.cxx |   17 +
 1 file changed, 9 insertions(+), 8 deletions(-)

New commits:
commit b7597b45255aa6514825b987d6fa23e2c92f92df
Author: Stephan Bergmann 
AuthorDate: Tue Dec 3 21:03:37 2019 +0100
Commit: Stephan Bergmann 
CommitDate: Wed Dec 4 08:49:55 2019 +0100

use scoped enum

Change-Id: I8eadedbdf5f4bee218ae2f39c76300fc0624912b
Reviewed-on: https://gerrit.libreoffice.org/84374
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann 

diff --git a/stoc/source/invocation/invocation.cxx 
b/stoc/source/invocation/invocation.cxx
index d70ed15cc2b8..c1c97f6d05aa 100644
--- a/stoc/source/invocation/invocation.cxx
+++ b/stoc/source/invocation/invocation.cxx
@@ -704,10 +704,11 @@ struct MemberItem
 OUString aName;
 
 // Defines where the member comes from
-enum Mode { NAMEACCESS, PROPERTYSET, METHOD } eMode;
+enum class Mode { NameAccess, PropertySet, Method };
+Mode eMode;
 
 // Index to respective sequence
-// (Index to NameAccess sequence for eMode==NAMEACCESS etc.)
+// (Index to NameAccess sequence for eMode==Mode::NameAccess etc.)
 sal_Int32 nIndex;
 };
 
@@ -765,7 +766,7 @@ void Invocation_Impl::getInfoSequenceImpl
 {
 MemberItem& rItem = pItems[ iTotal ];
 rItem.aName = pStrings[ i ];
-rItem.eMode = MemberItem::NAMEACCESS;
+rItem.eMode = MemberItem::Mode::NameAccess;
 rItem.nIndex = i;
 }
 
@@ -774,7 +775,7 @@ void Invocation_Impl::getInfoSequenceImpl
 {
 MemberItem& rItem = pItems[ iTotal ];
 rItem.aName = pProps[ i ].Name;
-rItem.eMode = MemberItem::PROPERTYSET;
+rItem.eMode = MemberItem::Mode::PropertySet;
 rItem.nIndex = i;
 }
 
@@ -784,7 +785,7 @@ void Invocation_Impl::getInfoSequenceImpl
 MemberItem& rItem = pItems[ iTotal ];
 Reference< XIdlMethod > xMethod = pMethods[ i ];
 rItem.aName = xMethod->getName();
-rItem.eMode = MemberItem::METHOD;
+rItem.eMode = MemberItem::Mode::Method;
 rItem.nIndex = i;
 }
 
@@ -814,15 +815,15 @@ void Invocation_Impl::getInfoSequenceImpl
 
 if( pRetInfos )
 {
-if( rItem.eMode == MemberItem::NAMEACCESS )
+if( rItem.eMode == MemberItem::Mode::NameAccess )
 {
 fillInfoForNameAccess( pRetInfos[ iTotal ], rItem.aName );
 }
-else if( rItem.eMode == MemberItem::PROPERTYSET )
+else if( rItem.eMode == MemberItem::Mode::PropertySet )
 {
 fillInfoForProperty( pRetInfos[ iTotal ], pProps[ rItem.nIndex 
] );
 }
-else if( rItem.eMode == MemberItem::METHOD )
+else if( rItem.eMode == MemberItem::Mode::Method )
 {
 fillInfoForMethod( pRetInfos[ iTotal ], pMethods[ rItem.nIndex 
] );
 }
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

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

2019-12-03 Thread Stephan Bergmann (via logerrit)
 stoc/source/security/access_controller.cxx |   51 ++---
 1 file changed, 26 insertions(+), 25 deletions(-)

New commits:
commit caf2e75b4c1b46c38342440767ffdd07f246e98e
Author: Stephan Bergmann 
AuthorDate: Tue Dec 3 12:17:47 2019 +0100
Commit: Stephan Bergmann 
CommitDate: Tue Dec 3 16:28:34 2019 +0100

use scoped enum

Change-Id: Ib40fad986f99d02e58f0564fb68608e86989173c
Reviewed-on: https://gerrit.libreoffice.org/84325
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann 

diff --git a/stoc/source/security/access_controller.cxx 
b/stoc/source/security/access_controller.cxx
index 08ba90a20670..7b10e11f01c9 100644
--- a/stoc/source/security/access_controller.cxx
+++ b/stoc/source/security/access_controller.cxx
@@ -288,7 +288,8 @@ class AccessController
 Reference< security::XPolicy > const & getPolicy();
 
 // mode
-enum Mode { OFF, ON, DYNAMIC_ONLY, SINGLE_USER, SINGLE_DEFAULT_USER } 
m_mode;
+enum class Mode { Off, On, DynamicOnly, SingleUser, SingleDefaultUser };
+Mode m_mode;
 
 PermissionCollection m_defaultPermissions;
 // for single-user mode
@@ -339,7 +340,7 @@ public:
 AccessController::AccessController( Reference< XComponentContext > const & 
xComponentContext )
 : t_helper( m_mutex )
 , m_xComponentContext( xComponentContext )
-, m_mode( ON ) // default
+, m_mode( Mode::On ) // default
 , m_defaultPerm_init( false )
 , m_singleUser_init( false )
 , m_rec( nullptr )
@@ -353,15 +354,15 @@ AccessController::AccessController( Reference< 
XComponentContext > const & xComp
 {
 if ( mode == "off" )
 {
-m_mode = OFF;
+m_mode = Mode::Off;
 }
 else if ( mode == "on" )
 {
-m_mode = ON;
+m_mode = Mode::On;
 }
 else if ( mode == "dynamic-only" )
 {
-m_mode = DYNAMIC_ONLY;
+m_mode = Mode::DynamicOnly;
 }
 else if ( mode == "single-user" )
 {
@@ -374,16 +375,16 @@ AccessController::AccessController( Reference< 
XComponentContext > const & xComp
 "\"/services/" SERVICE_NAME "/single-user-id\"!",
 static_cast(this) );
 }
-m_mode = SINGLE_USER;
+m_mode = Mode::SingleUser;
 }
 else if ( mode == "single-default-user" )
 {
-m_mode = SINGLE_DEFAULT_USER;
+m_mode = Mode::SingleDefaultUser;
 }
 }
 
-// switch on caching for DYNAMIC_ONLY and ON (shareable multi-user process)
-if (!(ON == m_mode || DYNAMIC_ONLY == m_mode))
+// switch on caching for Mode::DynamicOnly and Mode::On (shareable 
multi-user process)
+if (!(Mode::On == m_mode || Mode::DynamicOnly == m_mode))
 return;
 
 sal_Int32 cacheSize = 0; // multi-user cache size
@@ -400,7 +401,7 @@ AccessController::AccessController( Reference< 
XComponentContext > const & xComp
 
 void AccessController::disposing()
 {
-m_mode = OFF; // avoid checks from now on xxx todo review/ better 
DYNAMIC_ONLY?
+m_mode = Mode::Off; // avoid checks from now on xxx todo review/ better 
Mode::DynamicOnly?
 m_xPolicy.clear();
 m_xComponentContext.clear();
 }
@@ -412,7 +413,7 @@ void AccessController::initialize(
 {
 // xxx todo: review for forking
 // portal forking hack: re-initialize for another user-id
-if (SINGLE_USER != m_mode) // only if in single-user mode
+if (Mode::SingleUser != m_mode) // only if in single-user mode
 {
 throw RuntimeException(
 "invalid call: ac must be in \"single-user\" mode!", 
static_cast(this) );
@@ -498,7 +499,7 @@ void AccessController::checkAndClearPostPoned()
 t_rec_vec const& vec = *rec;
 switch (m_mode)
 {
-case SINGLE_USER:
+case Mode::SingleUser:
 {
 OSL_ASSERT( m_singleUser_init );
 for (const auto & p : vec)
@@ -508,7 +509,7 @@ void AccessController::checkAndClearPostPoned()
 }
 break;
 }
-case SINGLE_DEFAULT_USER:
+case Mode::SingleDefaultUser:
 {
 OSL_ASSERT( m_defaultPerm_init );
 for (const auto & p : vec)
@@ -518,7 +519,7 @@ void AccessController::checkAndClearPostPoned()
 }
 break;
 }
-case ON:
+case Mode::On:
 {
 for (const auto & p : vec)
 {
@@ -556,20 +557,20 @@ PermissionCollection 
AccessController::getEffectivePermissions(
 
 switch (m_mode)
 {
-case SINGLE_USER:
+case Mode::SingleUser:
 {
 if (m_singleUser_init)
 return m_singleUserPermissions;
 userId = m_singleUserId;
 break;
 }
-case SINGLE_DEFAULT_USER:
+case Mode::SingleDefaultUser:
 {
 if (m_defaultPerm_init)
 return m_defaultPermissions;
 break;
 }
-case ON:
+case Mode::On:
 {
 if (xContext.is())
 {
@@ -638,7 +639,7 @@ 

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

2019-08-15 Thread Arkadiy Illarionov (via logerrit)
 stoc/source/defaultregistry/defaultregistry.cxx |   24 +---
 1 file changed, 9 insertions(+), 15 deletions(-)

New commits:
commit 3e64065612acec2eb29aa21e2b515953422256d7
Author: Arkadiy Illarionov 
AuthorDate: Wed Aug 14 22:27:06 2019 +0300
Commit: Arkadiy Illarionov 
CommitDate: Thu Aug 15 23:44:41 2019 +0200

Optimize NestedKeyImpl::openKeys

* Use const methods of Sequence
* Get rid of extra loop over localSeq
* Simplify default keys insert condition

Change-Id: I112c0a53d3ebfc2ff54a4ac904e6e112beaf3cdd
Reviewed-on: https://gerrit.libreoffice.org/77472
Tested-by: Jenkins
Reviewed-by: Arkadiy Illarionov 

diff --git a/stoc/source/defaultregistry/defaultregistry.cxx 
b/stoc/source/defaultregistry/defaultregistry.cxx
index bfa698b13b91..71a637309c5a 100644
--- a/stoc/source/defaultregistry/defaultregistry.cxx
+++ b/stoc/source/defaultregistry/defaultregistry.cxx
@@ -755,33 +755,27 @@ Sequence< Reference< XRegistryKey > > SAL_CALL 
NestedKeyImpl::openKeys(  )
 defaultSeq = m_defaultKey->getKeyNames();
 }
 
-sal_uInt32 local = localSeq.getLength();
-sal_uInt32 def = defaultSeq.getLength();
-sal_uInt32 len = static_cast(std::count_if(localSeq.begin(), 
localSeq.end(),
-[](const OUString& rLocal) { return 
comphelper::findValue(defaultSeq, rLocal) != -1; }));
-
-Sequence< Reference > retSeq(local + def - len);
+std::vector< Reference > retVec;
+retVec.reserve(localSeq.getLength() + defaultSeq.getLength());
 
 auto lKeyNameToRegKey = [this](const OUString& rName) -> 
Reference {
 sal_Int32 lastIndex = rName.lastIndexOf('/');
 OUString name = rName.copy(lastIndex);
 return new NestedKeyImpl(name, this);
 };
-std::transform(localSeq.begin(), localSeq.end(), retSeq.begin(), 
lKeyNameToRegKey);
 
-sal_uInt32 k = local;
-for (const auto& rDef : std::as_const(defaultSeq))
-{
-bool insert = std::none_of(retSeq.begin(), std::next(retSeq.begin(), 
local),
-[](const Reference& rKey) { return 
rKey->getKeyName() == rDef; });
+for (const auto& rKeyName : std::as_const(localSeq))
+retVec.push_back(lKeyNameToRegKey(rKeyName));
 
-if ( insert )
+for (const auto& rKeyName : std::as_const(defaultSeq))
+{
+if ( comphelper::findValue(localSeq, rKeyName) == -1 )
 {
-retSeq.getArray()[k++] = lKeyNameToRegKey(rDef);
+retVec.push_back(lKeyNameToRegKey(rKeyName));
 }
 }
 
-return retSeq;
+return comphelper::containerToSequence(retVec);
 }
 
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

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

2019-08-14 Thread Stephan Bergmann (via logerrit)
 stoc/source/typeconv/convert.cxx |4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

New commits:
commit b122db670b2b3d68f0ba199a1e25bdb1d8992241
Author: Stephan Bergmann 
AuthorDate: Tue Aug 13 20:59:58 2019 +0200
Commit: Stephan Bergmann 
CommitDate: Wed Aug 14 08:58:22 2019 +0200

Reformulate TypeConverter_Impl::toHyper FLOAT/DOUBLE cases

...to avoid UB when fVal was cast to nRet *before* checking that fVal 
actually
fit into the bounds, and to avoid Clang 10
-Werror,-Wimplicit-int-float-conversion when comparing fVal against
SAL_MAX_INT64 ("implicit conversion from 'const sal_Int64' (aka 'const 
long') to
'double' changes value from 9223372036854775807 to 9223372036854775808")

Change-Id: I9e2f6c97309609d9ec2455d4ecf9c341d85c1680
Reviewed-on: https://gerrit.libreoffice.org/77430
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann 

diff --git a/stoc/source/typeconv/convert.cxx b/stoc/source/typeconv/convert.cxx
index 9ffef7287d6c..b74a3d1a5714 100644
--- a/stoc/source/typeconv/convert.cxx
+++ b/stoc/source/typeconv/convert.cxx
@@ -313,9 +313,9 @@ sal_Int64 TypeConverter_Impl::toHyper( const Any& rAny, 
sal_Int64 min, sal_uInt6
 case TypeClass_FLOAT:
 {
 double fVal = round( *o3tl::forceAccess(rAny) );
-nRet = (fVal > SAL_MAX_INT64 ? 
static_cast(static_cast(fVal)) : 
static_cast(fVal));
 if (fVal >= min && fVal <= max)
 {
+nRet = (fVal >= 0.0 ? 
static_cast(static_cast(fVal)) : 
static_cast(fVal));
 return nRet;
 }
 throw CannotConvertException(
@@ -325,9 +325,9 @@ sal_Int64 TypeConverter_Impl::toHyper( const Any& rAny, 
sal_Int64 min, sal_uInt6
 case TypeClass_DOUBLE:
 {
 double fVal = round( *o3tl::forceAccess(rAny) );
-nRet = (fVal > SAL_MAX_INT64 ? 
static_cast(static_cast(fVal)) : 
static_cast(fVal));
 if (fVal >= min && fVal <= max)
 {
+nRet = (fVal >= 0.0 ? 
static_cast(static_cast(fVal)) : 
static_cast(fVal));
 return nRet;
 }
 throw CannotConvertException(
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

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

2019-08-13 Thread Stephan Bergmann (via logerrit)
 stoc/source/typeconv/convert.cxx |   29 -
 1 file changed, 4 insertions(+), 25 deletions(-)

New commits:
commit 63128dd267eb2d487c94ba8db65444a3e5e69fd2
Author: Stephan Bergmann 
AuthorDate: Tue Aug 13 14:50:30 2019 +0200
Commit: Stephan Bergmann 
CommitDate: Tue Aug 13 17:23:03 2019 +0200

Drop MSVC workaround from 2002

(cf. f2b0299972730989c46949d6101c7c346fc01971 "#97095# MS Visual C++ 
unsigned
__int64 to double missing"), assuming that our baseline MSVC is capable of 
that
by now.

Replace DOUBLE_SAL_UINT64_MAX with double(SAL_MAX_UINT64) and replace
unsigned_int64_to_double(X) with either X or static_cast(X), 
matching
respective context.

Change-Id: Ia1e1daff5cbcb545738615fad541082810d7a46b
Reviewed-on: https://gerrit.libreoffice.org/77414
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann 

diff --git a/stoc/source/typeconv/convert.cxx b/stoc/source/typeconv/convert.cxx
index 9ec909310b02..9ffef7287d6c 100644
--- a/stoc/source/typeconv/convert.cxx
+++ b/stoc/source/typeconv/convert.cxx
@@ -51,27 +51,6 @@ using namespace osl;
 namespace stoc_tcv
 {
 
-/* MS Visual C++ no conversion from unsigned __int64 to double */
-#ifdef _MSC_VER
-static const double DOUBLE_SAL_UINT64_MAX = ((double(SAL_MAX_INT64)) * 2) + 1;
-
-static double unsigned_int64_to_double( sal_uInt64 n )
-{
-sal_uInt64 n2 = n / 3;
-n -= (2 * n2);
-return (static_cast(static_cast(n2)) * 2.0) + 
static_cast(static_cast(n));
-}
-#else
-static const double DOUBLE_SAL_UINT64_MAX =
-double(((sal_uInt64(0x)) << 32) | sal_uInt64(0x));
-
-static double unsigned_int64_to_double( sal_uInt64 n )
-{
-return static_cast(n);
-}
-#endif
-
-
 static double round( double aVal )
 {
 bool bPos   = (aVal >= 0.0);
@@ -221,7 +200,7 @@ static bool getHyperValue( sal_Int64 & rnVal, const 
OUString & rStr )
 double fVal;
 if (getNumericValue( fVal, rStr ) &&
 fVal >= double(SAL_MIN_INT64) &&
-fVal <= DOUBLE_SAL_UINT64_MAX)
+fVal <= double(SAL_MAX_UINT64))
 {
 rnVal = static_cast(round( fVal ));
 return true;
@@ -335,7 +314,7 @@ sal_Int64 TypeConverter_Impl::toHyper( const Any& rAny, 
sal_Int64 min, sal_uInt6
 {
 double fVal = round( *o3tl::forceAccess(rAny) );
 nRet = (fVal > SAL_MAX_INT64 ? 
static_cast(static_cast(fVal)) : 
static_cast(fVal));
-if (fVal >= min && fVal <= unsigned_int64_to_double( max ))
+if (fVal >= min && fVal <= max)
 {
 return nRet;
 }
@@ -347,7 +326,7 @@ sal_Int64 TypeConverter_Impl::toHyper( const Any& rAny, 
sal_Int64 min, sal_uInt6
 {
 double fVal = round( *o3tl::forceAccess(rAny) );
 nRet = (fVal > SAL_MAX_INT64 ? 
static_cast(static_cast(fVal)) : 
static_cast(fVal));
-if (fVal >= min && fVal <= unsigned_int64_to_double( max ))
+if (fVal >= min && fVal <= max)
 {
 return nRet;
 }
@@ -432,7 +411,7 @@ double TypeConverter_Impl::toDouble( const Any& rAny, 
double min, double max )
 break;
 // UNSIGNED HYPER
 case TypeClass_UNSIGNED_HYPER:
-fRet = unsigned_int64_to_double( *o3tl::forceAccess(rAny) 
);
+fRet = static_cast(*o3tl::forceAccess(rAny));
 break;
 // FLOAT, DOUBLE
 case TypeClass_FLOAT:
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

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

2019-08-13 Thread Stephan Bergmann (via logerrit)
 stoc/source/typeconv/convert.cxx |   19 ++-
 1 file changed, 6 insertions(+), 13 deletions(-)

New commits:
commit ce1ac2973ea248072e7f7b6a45ab83f5b2cb7fe4
Author: Stephan Bergmann 
AuthorDate: Tue Aug 13 12:01:25 2019 +0200
Commit: Stephan Bergmann 
CommitDate: Tue Aug 13 14:45:28 2019 +0200

Use existing SAL_MIN/MAX_...

Change-Id: Ic1c18f1eb7db7b25cc1b276b8786630bd1d68929
Reviewed-on: https://gerrit.libreoffice.org/77397
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann 

diff --git a/stoc/source/typeconv/convert.cxx b/stoc/source/typeconv/convert.cxx
index 5a13985f8687..9ec909310b02 100644
--- a/stoc/source/typeconv/convert.cxx
+++ b/stoc/source/typeconv/convert.cxx
@@ -51,16 +51,9 @@ using namespace osl;
 namespace stoc_tcv
 {
 
-static const sal_uInt64 SAL_UINT64_MAX =
-(((sal_uInt64(0x)) << 32) | sal_uInt64(0x));
-static const sal_Int64 SAL_INT64_MAX =
-sal_Int64(((sal_uInt64(0x7fff)) << 32) | sal_uInt64(0x));
-static const sal_Int64 SAL_INT64_MIN =
-sal_Int64((sal_uInt64(0x8000)) << 32);
-
 /* MS Visual C++ no conversion from unsigned __int64 to double */
 #ifdef _MSC_VER
-static const double DOUBLE_SAL_UINT64_MAX = ((double(SAL_INT64_MAX)) * 2) + 1;
+static const double DOUBLE_SAL_UINT64_MAX = ((double(SAL_MAX_INT64)) * 2) + 1;
 
 static double unsigned_int64_to_double( sal_uInt64 n )
 {
@@ -227,7 +220,7 @@ static bool getHyperValue( sal_Int64 & rnVal, const 
OUString & rStr )
 
 double fVal;
 if (getNumericValue( fVal, rStr ) &&
-fVal >= double(SAL_INT64_MIN) &&
+fVal >= double(SAL_MIN_INT64) &&
 fVal <= DOUBLE_SAL_UINT64_MAX)
 {
 rnVal = static_cast(round( fVal ));
@@ -242,7 +235,7 @@ class TypeConverter_Impl : public WeakImplHelper< 
XTypeConverter, XServiceInfo >
 // ...misc helpers...
 /// @throws CannotConvertException
 static sal_Int64 toHyper(
-const Any& rAny, sal_Int64 min, sal_uInt64 max = SAL_UINT64_MAX );
+const Any& rAny, sal_Int64 min, sal_uInt64 max = SAL_MAX_UINT64 );
 /// @throws CannotConvertException
 static double toDouble( const Any& rAny, double min = -DBL_MAX, double max 
= DBL_MAX );
 
@@ -341,7 +334,7 @@ sal_Int64 TypeConverter_Impl::toHyper( const Any& rAny, 
sal_Int64 min, sal_uInt6
 case TypeClass_FLOAT:
 {
 double fVal = round( *o3tl::forceAccess(rAny) );
-nRet = (fVal > SAL_INT64_MAX ? 
static_cast(static_cast(fVal)) : 
static_cast(fVal));
+nRet = (fVal > SAL_MAX_INT64 ? 
static_cast(static_cast(fVal)) : 
static_cast(fVal));
 if (fVal >= min && fVal <= unsigned_int64_to_double( max ))
 {
 return nRet;
@@ -353,7 +346,7 @@ sal_Int64 TypeConverter_Impl::toHyper( const Any& rAny, 
sal_Int64 min, sal_uInt6
 case TypeClass_DOUBLE:
 {
 double fVal = round( *o3tl::forceAccess(rAny) );
-nRet = (fVal > SAL_INT64_MAX ? 
static_cast(static_cast(fVal)) : 
static_cast(fVal));
+nRet = (fVal > SAL_MAX_INT64 ? 
static_cast(static_cast(fVal)) : 
static_cast(fVal));
 if (fVal >= min && fVal <= unsigned_int64_to_double( max ))
 {
 return nRet;
@@ -778,7 +771,7 @@ Any TypeConverter_Impl::convertToSimpleType( const Any& 
rVal, TypeClass aDestina
 
 // --- to HYPER, UNSIGNED HYPER
 case TypeClass_HYPER:
-aRet <<= toHyper( rVal, SAL_INT64_MIN, SAL_INT64_MAX );
+aRet <<= toHyper( rVal, SAL_MIN_INT64, SAL_MAX_INT64 );
 break;
 case TypeClass_UNSIGNED_HYPER:
 aRet <<= static_cast( toHyper( rVal, 0 ) );
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

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

2019-03-21 Thread Libreoffice Gerrit user
 stoc/source/corereflection/criface.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 14a11ab5dfa2ea34049866517ee78170922aee4e
Author: Juergen Funk 
AuthorDate: Thu Mar 21 09:22:03 2019 +0100
Commit: Stephan Bergmann 
CommitDate: Thu Mar 21 12:41:45 2019 +0100

pUnoReturn should be null when UNO methode is VOID

the problem is that at least the msvc_win32_x86-64 bridge's
unoInterfaceProxyDispatch
(bridges/source/cpp_uno/msvc_win32_x86-64/uno2cpp.cxx)
requires pUnoReturn to be a nullptr when the UNO method has VOID
return type (see computation of retKind in cpp_call in the same file),
but that IdlInterfaceMethodImpl::invoke doesn't set up the arguments
according to that expectation.


Change-Id: I187a997300571cd9822de2eeacf7ad887ad00a4f
Reviewed-on: https://gerrit.libreoffice.org/69495
Reviewed-by: Stephan Bergmann 
Tested-by: Stephan Bergmann 

diff --git a/stoc/source/corereflection/criface.cxx 
b/stoc/source/corereflection/criface.cxx
index 041272a51a28..c4f5feab38ed 100644
--- a/stoc/source/corereflection/criface.cxx
+++ b/stoc/source/corereflection/criface.cxx
@@ -579,7 +579,7 @@ Any SAL_CALL IdlInterfaceMethodImpl::invoke( const Any & 
rObj, Sequence< Any > &
 // end of a "short" struct by writing the full contents of a "long"
 // register); so create enough space here (assuming that no ABI 
requires
 // padding larger than 16 byte boundaries):
-void * pUnoReturn = alloca( multipleOf16(pReturnType->nSize) );
+void * pUnoReturn = (pReturnType->nSize == 0) ? nullptr : alloca( 
multipleOf16(pReturnType->nSize) );
 void ** ppUnoArgs = static_cast(alloca( sizeof(void *) * 
nParams *2 ));
 typelib_TypeDescription ** ppParamTypes = 
reinterpret_cast(ppUnoArgs + nParams);
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

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

2019-02-12 Thread Libreoffice Gerrit user
 stoc/source/implementationregistration/implreg.cxx |6 ++
 1 file changed, 2 insertions(+), 4 deletions(-)

New commits:
commit 972b9968cd8bd70bfb39e3307cb5097302682c31
Author: Matteo Casalin 
AuthorDate: Sat Feb 9 18:18:47 2019 +0100
Commit: Matteo Casalin 
CommitDate: Wed Feb 13 07:46:26 2019 +0100

Avoid index for single getToken() call

Change-Id: I907c108f4b056d3388464e29ce2fc40b319380c0
Reviewed-on: https://gerrit.libreoffice.org/67627
Tested-by: Jenkins
Reviewed-by: Matteo Casalin 

diff --git a/stoc/source/implementationregistration/implreg.cxx 
b/stoc/source/implementationregistration/implreg.cxx
index 363a8bf7c52c..e463097bb5e6 100644
--- a/stoc/source/implementationregistration/implreg.cxx
+++ b/stoc/source/implementationregistration/implreg.cxx
@@ -1362,8 +1362,7 @@ void ImplementationRegistration::prepareRegister(
 
 if (!implementationLoaderUrl.isEmpty())
 {
-sal_Int32 nIndex = 0;
-activatorName = implementationLoaderUrl.getToken(0, ':', nIndex );
+activatorName = implementationLoaderUrl.getToken(0, ':');
 } else
 {
 // check locationUrl to find out what kind of loader is needed
@@ -1494,8 +1493,7 @@ Sequence< OUString > 
ImplementationRegistration::getImplementations(
 
 if (!implementationLoaderUrl.isEmpty())
 {
-sal_Int32 nIndex = 0;
-activatorName = implementationLoaderUrl.getToken(0, ':', nIndex );
+activatorName = implementationLoaderUrl.getToken(0, ':');
 } else
 {
 // check locationUrl to find out what kind of loader is needed
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

[Libreoffice-commits] core.git: stoc/source store/source svgio/inc

2018-10-08 Thread Libreoffice Gerrit user
 stoc/source/corereflection/base.hxx  |6 
 stoc/source/corereflection/crcomp.cxx|2 
 stoc/source/implementationregistration/implreg.cxx   |  127 +++
 stoc/source/implementationregistration/mergekeys.cxx |4 
 stoc/source/inspect/introspection.cxx|2 
 stoc/source/invocation/invocation.cxx|2 
 stoc/source/invocation_adapterfactory/iafactory.cxx  |2 
 stoc/source/javavm/interact.hxx  |2 
 stoc/source/proxy_factory/proxyfac.cxx   |4 
 stoc/source/security/file_policy.cxx |2 
 stoc/source/security/permissions.cxx |8 -
 stoc/source/security/permissions.h   |2 
 stoc/source/servicemanager/servicemanager.cxx|2 
 stoc/source/uriproc/UriReference.hxx |   12 -
 store/source/lockbyte.cxx|8 -
 store/source/storcach.cxx|2 
 svgio/inc/svgcharacternode.hxx   |2 
 svgio/inc/svgnode.hxx|2 
 svgio/inc/svgpolynode.hxx|2 
 19 files changed, 86 insertions(+), 107 deletions(-)

New commits:
commit 0ddf3e0a628599d01356cb5262b93faca073ee9f
Author: Noel Grandin 
AuthorDate: Mon Oct 8 09:09:08 2018 +0200
Commit: Noel Grandin 
CommitDate: Mon Oct 8 11:09:03 2018 +0200

loplugin:constfields in stoc..svgio

Change-Id: Icfd936fe9b83e0e122af5b09f7ed6dde2ead4400
Reviewed-on: https://gerrit.libreoffice.org/61512
Tested-by: Jenkins
Reviewed-by: Noel Grandin 

diff --git a/stoc/source/corereflection/base.hxx 
b/stoc/source/corereflection/base.hxx
index 7c02a09edaf0..23c68aa83583 100644
--- a/stoc/source/corereflection/base.hxx
+++ b/stoc/source/corereflection/base.hxx
@@ -144,8 +144,8 @@ class IdlClassImpl
 rtl::Reference
  m_xReflection;
 
-OUString_aName;
-css::uno::TypeClass _eTypeClass;
+OUString const   _aName;
+css::uno::TypeClass const_eTypeClass;
 
 typelib_TypeDescription *   _pTypeDescr;
 
@@ -325,7 +325,7 @@ class IdlMemberImpl
 {
 rtl::Reference
 m_xReflection;
-OUString_aName;
+OUString const  _aName;
 
 typelib_TypeDescription *   _pTypeDescr;
 typelib_TypeDescription *   _pDeclTypeDescr;
diff --git a/stoc/source/corereflection/crcomp.cxx 
b/stoc/source/corereflection/crcomp.cxx
index acfcf765bb2e..26e0c8ecf8ad 100644
--- a/stoc/source/corereflection/crcomp.cxx
+++ b/stoc/source/corereflection/crcomp.cxx
@@ -39,7 +39,7 @@ class IdlCompFieldImpl
 , public XIdlField
 , public XIdlField2
 {
-sal_Int32   _nOffset;
+sal_Int32 const _nOffset;
 
 public:
 IdlCompFieldImpl( IdlReflectionServiceImpl * pReflection, const OUString & 
rName,
diff --git a/stoc/source/implementationregistration/implreg.cxx 
b/stoc/source/implementationregistration/implreg.cxx
index dd8997e5673b..f3c686f776c4 100644
--- a/stoc/source/implementationregistration/implreg.cxx
+++ b/stoc/source/implementationregistration/implreg.cxx
@@ -68,43 +68,28 @@ using namespace osl;
 
 namespace {
 
-struct StringPool
-{
-OUString slash_UNO_slash_REGISTRY_LINKS;
-OUString slash_IMPLEMENTATIONS;
-OUString slash_UNO;
-OUString slash_UNO_slash_SERVICES;
-OUString slash_UNO_slash_SINGLETONS;
-OUString slash_SERVICES;
-OUString slash_UNO_slash_LOCATION;
-OUString slash_UNO_slash_ACTIVATOR;
-OUString colon_old;
-OUString com_sun_star_registry_SimpleRegistry;
-OUString Registry;
-StringPool()
-: slash_UNO_slash_REGISTRY_LINKS( "/UNO/REGISTRY_LINKS")
-, slash_IMPLEMENTATIONS( "/IMPLEMENTATIONS" )
-, slash_UNO( "/UNO")
-, slash_UNO_slash_SERVICES( "/UNO/SERVICES")
-, slash_UNO_slash_SINGLETONS( "/UNO/SINGLETONS")
-, slash_SERVICES( "/SERVICES/" )
-, slash_UNO_slash_LOCATION( "/UNO/LOCATION" )
-, slash_UNO_slash_ACTIVATOR( "/UNO/ACTIVATOR" )
-, colon_old( ":old")
-, 
com_sun_star_registry_SimpleRegistry("com.sun.star.registry.SimpleRegistry" )
-, Registry( "Registry" )
-{}
-StringPool(const StringPool&) = delete;
-StringPool& operator=(const StringPool&) = delete;
-};
-
-const StringPool ()
-{
-static StringPool s_pool;
-
-return s_pool;
-}
-
+static constexpr OUStringLiteral slash_UNO_slash_REGISTRY_LINKS
+= "/UNO/REGISTRY_LINKS";
+static constexpr OUStringLiteral slash_IMPLEMENTATIONS
+=  "/IMPLEMENTATIONS";
+static constexpr OUStringLiteral slash_UNO
+= "/UNO";
+static constexpr OUStringLiteral slash_UNO_slash_SERVICES
+= "/UNO/SERVICES";
+static constexpr OUStringLiteral slash_UNO_slash_SINGLETONS
+= "/UNO/SINGLETONS";
+static constexpr 

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

2018-08-03 Thread Libreoffice Gerrit user
 stoc/source/security/lru_cache.h |   26 --
 1 file changed, 8 insertions(+), 18 deletions(-)

New commits:
commit ed1e2967064e098459324818baa5466ad2a90492
Author: Noel Grandin 
AuthorDate: Thu Aug 2 15:29:12 2018 +0200
Commit: Noel Grandin 
CommitDate: Fri Aug 3 11:57:42 2018 +0200

loplugin:useuniqueptr in lru_cache

Change-Id: I8ccd3acdcb160a19466da2bbf05527617c9f9ad2
Reviewed-on: https://gerrit.libreoffice.org/58491
Tested-by: Jenkins
Reviewed-by: Noel Grandin 

diff --git a/stoc/source/security/lru_cache.h b/stoc/source/security/lru_cache.h
index 28c34fec9eda..8d9f69fe1c5e 100644
--- a/stoc/source/security/lru_cache.h
+++ b/stoc/source/security/lru_cache.h
@@ -19,6 +19,7 @@
 #ifndef INCLUDED_STOC_SOURCE_SECURITY_LRU_CACHE_H
 #define INCLUDED_STOC_SOURCE_SECURITY_LRU_CACHE_H
 
+#include 
 #include 
 
 // __CACHE_DIAGNOSE works only for OUString keys
@@ -49,7 +50,7 @@ class lru_cache
 t_key2element m_key2element;
 ::std::size_t m_size;
 
-Entry * m_block;
+std::unique_ptr m_block;
 mutable Entry * m_head;
 mutable Entry * m_tail;
 inline void toFront( Entry * entry ) const;
@@ -59,10 +60,6 @@ public:
 */
 inline lru_cache();
 
-/** Destructor: releases all cached elements and keys.
-*/
-inline ~lru_cache();
-
 /** Retrieves a pointer to value in cache.  Returns 0, if none was found.
 
 @param key a key
@@ -89,19 +86,18 @@ inline void lru_cache< t_key, t_val, t_hashKey, t_equalKey 
>::setSize(
 ::std::size_t size )
 {
 m_key2element.clear();
-delete [] m_block;
-m_block = nullptr;
+m_block.reset();
 m_size = size;
 
 if (0 < m_size)
 {
-m_block = new Entry[ m_size ];
-m_head = m_block;
-m_tail = m_block + m_size -1;
+m_block.reset( new Entry[ m_size ] );
+m_head = m_block.get();
+m_tail = m_block.get() + m_size -1;
 for ( ::std::size_t nPos = m_size; nPos--; )
 {
-m_block[ nPos ].m_pred = m_block + nPos -1;
-m_block[ nPos ].m_succ = m_block + nPos +1;
+m_block[ nPos ].m_pred = m_block.get() + nPos -1;
+m_block[ nPos ].m_succ = m_block.get() + nPos +1;
 }
 }
 }
@@ -116,12 +112,6 @@ inline lru_cache< t_key, t_val, t_hashKey, t_equalKey 
>::lru_cache()
 }
 
 template< typename t_key, typename t_val, typename t_hashKey, typename 
t_equalKey >
-inline lru_cache< t_key, t_val, t_hashKey, t_equalKey >::~lru_cache()
-{
-delete [] m_block;
-}
-
-template< typename t_key, typename t_val, typename t_hashKey, typename 
t_equalKey >
 inline void lru_cache< t_key, t_val, t_hashKey, t_equalKey >::toFront(
 Entry * entry ) const
 {
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2018-08-03 Thread Libreoffice Gerrit user
 stoc/source/corereflection/lrucache.hxx |   23 +++
 1 file changed, 7 insertions(+), 16 deletions(-)

New commits:
commit a0c2958552e82c3795b094a0538beab521679628
Author: Noel Grandin 
AuthorDate: Thu Aug 2 15:27:42 2018 +0200
Commit: Noel Grandin 
CommitDate: Fri Aug 3 11:06:38 2018 +0200

loplugin:useuniqueptr in LRU_Cache

Change-Id: I30d008f01318f9e484b08398ed1ca1b41f90946a
Reviewed-on: https://gerrit.libreoffice.org/58490
Tested-by: Jenkins
Reviewed-by: Noel Grandin 

diff --git a/stoc/source/corereflection/lrucache.hxx 
b/stoc/source/corereflection/lrucache.hxx
index bab65f87786f..e9a89bebd66f 100644
--- a/stoc/source/corereflection/lrucache.hxx
+++ b/stoc/source/corereflection/lrucache.hxx
@@ -26,6 +26,7 @@
 #include 
 #include 
 
+#include 
 #include 
 
 /** Implementation of a least recently used (lru) cache.
@@ -47,7 +48,7 @@ class LRU_Cache
 sal_Int32   _nCachedElements;
 t_Key2Element   _aKey2Element;
 
-CacheEntry *_pBlock;
+std::unique_ptr _pBlock;
 mutable CacheEntry *_pHead;
 mutable CacheEntry *_pTail;
 inline void toFront( CacheEntry * pEntry ) const;
@@ -58,10 +59,6 @@ public:
 @param nCachedElements number of elements to be cached; default param 
set to 128
 */
 explicit inline LRU_Cache();
-/** Destructor: releases all cached elements and keys.
-
-*/
-inline ~LRU_Cache();
 
 /** Retrieves a value from the cache. Returns default constructed value,
 if none was found.
@@ -95,24 +92,18 @@ inline LRU_Cache< t_Key, t_Val, t_KeyHash >::LRU_Cache()
 {
 if (_nCachedElements > 0)
 {
-_pBlock = new CacheEntry[_nCachedElements];
-_pHead  = _pBlock;
-_pTail  = _pBlock + _nCachedElements -1;
+_pBlock.reset(new CacheEntry[_nCachedElements]);
+_pHead  = _pBlock.get();
+_pTail  = _pBlock.get() + _nCachedElements -1;
 for ( sal_Int32 nPos = _nCachedElements; nPos--; )
 {
-_pBlock[nPos].pPred = _pBlock + nPos -1;
-_pBlock[nPos].pSucc = _pBlock + nPos +1;
+_pBlock[nPos].pPred = _pBlock.get() + nPos -1;
+_pBlock[nPos].pSucc = _pBlock.get() + nPos +1;
 }
 }
 }
 
 template< class t_Key, class t_Val, class t_KeyHash >
-inline LRU_Cache< t_Key, t_Val, t_KeyHash >::~LRU_Cache()
-{
-delete [] _pBlock;
-}
-
-template< class t_Key, class t_Val, class t_KeyHash >
 inline void LRU_Cache< t_Key, t_Val, t_KeyHash >::toFront( CacheEntry * pEntry 
) const
 {
 if (pEntry != _pHead)
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: stoc/source stoc/test svgio/source svl/source svtools/langsupport svtools/source svx/source svx/workben

2018-08-02 Thread Libreoffice Gerrit user
 stoc/source/corereflection/crefl.cxx  |1 +
 stoc/source/javavm/javavm.cxx |1 +
 stoc/source/security/access_controller.cxx|1 +
 stoc/source/security/permissions.cxx  |1 +
 stoc/source/servicemanager/servicemanager.cxx |1 +
 stoc/test/javavm/testjavavm.cxx   |1 +
 stoc/test/testiadapter.cxx|1 +
 stoc/test/testproxyfac.cxx|1 +
 svgio/source/svgreader/svgdocumenthandler.cxx |1 +
 svgio/source/svgreader/svgimagenode.cxx   |1 +
 svgio/source/svgreader/svgtools.cxx   |1 +
 svgio/source/svguno/xsvgparser.cxx|1 +
 svl/source/config/itemholder2.cxx |1 +
 svl/source/crypto/cryptosign.cxx  |1 +
 svl/source/items/cenumitm.cxx |1 +
 svl/source/items/cintitem.cxx |1 +
 svl/source/items/flagitem.cxx |1 +
 svl/source/misc/urihelper.cxx |1 +
 svl/source/notify/lstner.cxx  |1 +
 svtools/langsupport/langsupport.cxx   |1 +
 svtools/source/brwbox/brwbox1.cxx |1 +
 svtools/source/brwbox/brwbox2.cxx |1 +
 svtools/source/brwbox/brwbox3.cxx |1 +
 svtools/source/config/extcolorcfg.cxx |1 +
 svtools/source/config/helpopt.cxx |1 +
 svtools/source/config/itemholder2.cxx |1 +
 svtools/source/config/test/test.cxx   |1 +
 svtools/source/contnr/DocumentInfoPreview.cxx |1 +
 svtools/source/contnr/contentenumeration.cxx  |1 +
 svtools/source/contnr/fileview.cxx|1 +
 svtools/source/contnr/imivctl2.cxx|1 +
 svtools/source/contnr/svtabbx.cxx |1 +
 svtools/source/contnr/treelistbox.cxx |1 +
 svtools/source/control/asynclink.cxx  |1 +
 svtools/source/control/calendar.cxx   |1 +
 svtools/source/control/ctrlbox.cxx|1 +
 svtools/source/control/fmtfield.cxx   |1 +
 svtools/source/control/inettbc.cxx|1 +
 svtools/source/control/ruler.cxx  |1 +
 svtools/source/control/valueacc.cxx   |1 +
 svtools/source/control/valueset.cxx   |1 +
 svtools/source/dialogs/addresstemplate.cxx|1 +
 svtools/source/dialogs/prnsetup.cxx   |1 +
 svtools/source/misc/ehdl.cxx  |1 +
 svtools/source/misc/embedhlp.cxx  |1 +
 svtools/source/misc/filechangedchecker.cxx|1 +
 svtools/source/misc/imagemgr.cxx  |1 +
 svtools/source/misc/imap.cxx  |1 +
 svtools/source/misc/langhelp.cxx  |1 +
 svtools/source/misc/langtab.cxx   |1 +
 svtools/source/misc/sampletext.cxx|1 +
 svtools/source/misc/templatefoldercache.cxx   |1 +
 svtools/source/misc/transfer.cxx  |1 +
 svtools/source/svhtml/parhtml.cxx |1 +
 svtools/source/svrtf/svparser.cxx |1 +
 svtools/source/table/cellvalueconversion.cxx  |1 +
 svtools/source/table/tablecontrol.cxx |1 +
 svtools/source/uno/svtxgridcontrol.cxx|1 +
 svtools/source/uno/unocontroltablemodel.cxx   |1 +
 svx/source/accessibility/AccessibleControlShape.cxx   |1 +
 svx/source/accessibility/AccessibleShape.cxx  |1 +
 svx/source/accessibility/AccessibleTextHelper.cxx |1 +
 svx/source/accessibility/ChildrenManager.cxx  |1 +
 svx/source/accessibility/svxrectctaccessiblecontext.cxx   |1 +
 svx/source/core/extedit.cxx   |1 +
 svx/source/core/graphichelper.cxx |1 +
 svx/source/customshapes/EnhancedCustomShape2d.cxx |1 +
 svx/source/customshapes/EnhancedCustomShapeFontWork.cxx   |1 +
 svx/source/customshapes/EnhancedCustomShapeFunctionParser.cxx |1 +
 svx/source/dialog/dlgutil.cxx 

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

2018-07-27 Thread Libreoffice Gerrit user
 stoc/source/security/permissions.h |3 ---
 1 file changed, 3 deletions(-)

New commits:
commit db481dff62bd8f744083c91b12289ff92a166ff1
Author: Stephan Bergmann 
AuthorDate: Thu Jul 26 11:25:36 2018 +0200
Commit: Stephan Bergmann 
CommitDate: Fri Jul 27 08:15:28 2018 +0200

stoc: avoid -Werror=deprecated-copy (GCC trunk towards GCC 9)

...by removing explicitly user-provided functions that do the same as their
implicitly-defined counterparts, but may prevent implicitly declared copy
functions from being defined as non-deleted in the future

Change-Id: Iacfdd89ca6ca3af19a56cd26721e1ce2d47c49fa
Reviewed-on: https://gerrit.libreoffice.org/58055
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann 

diff --git a/stoc/source/security/permissions.h 
b/stoc/source/security/permissions.h
index 6e9fe7937932..7e25d440b696 100644
--- a/stoc/source/security/permissions.h
+++ b/stoc/source/security/permissions.h
@@ -67,9 +67,6 @@ class PermissionCollection
 public:
 PermissionCollection()
 {}
-PermissionCollection( PermissionCollection const & collection )
-: m_head( collection.m_head )
-{}
 explicit PermissionCollection( ::rtl::Reference< Permission > const & 
single )
 : m_head( single )
 {}
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: stoc/source svl/source svx/source sw/inc sw/source

2018-06-25 Thread Arkadiy Illarionov
 stoc/source/uriproc/UriReferenceFactory.cxx |9 +
 svl/source/inc/poolio.hxx   |3 -
 svx/source/dialog/framelinkarray.cxx|   15 -
 svx/source/table/tablelayouter.cxx  |9 ++---
 sw/inc/modeltoviewhelper.hxx|9 ++---
 sw/source/core/access/accportions.cxx   |4 --
 sw/source/core/access/accportions.hxx   |7 +---
 sw/source/core/inc/scriptinfo.hxx   |3 -
 sw/source/core/text/porlay.cxx  |   14 
 sw/source/filter/basflt/fltshell.cxx|4 +-
 sw/source/filter/inc/fltshell.hxx   |1 
 sw/source/filter/ww8/wrtw8sty.cxx   |   10 ++
 sw/source/filter/ww8/wrtww8.hxx |1 
 sw/source/filter/ww8/wrtww8gr.cxx   |6 +--
 sw/source/filter/ww8/ww8graf.cxx|7 +---
 sw/source/filter/ww8/ww8graf.hxx|1 
 sw/source/filter/ww8/ww8graf2.cxx   |4 +-
 sw/source/filter/ww8/ww8par3.cxx|5 +--
 sw/source/filter/ww8/ww8scan.cxx|6 +--
 sw/source/filter/ww8/ww8scan.hxx|1 
 sw/source/ui/index/cnttab.cxx   |   44 ++--
 sw/source/ui/misc/glosbib.cxx   |   21 -
 sw/source/uibase/inc/glosbib.hxx|7 +---
 sw/source/uibase/inc/swuicnttab.hxx |5 ---
 24 files changed, 81 insertions(+), 115 deletions(-)

New commits:
commit 087213c6a27de31d36d9ccb72a514048a0bb7724
Author: Arkadiy Illarionov 
Date:   Mon Jun 25 00:01:52 2018 +0300

tdf#96099 Remove trivial container typedefs in stoc, svl, svx, sw

Change-Id: I0b4d18d2120ba2ce7d2526332bec199f52393290
Reviewed-on: https://gerrit.libreoffice.org/56363
Tested-by: Jenkins
Reviewed-by: Noel Grandin 

diff --git a/stoc/source/uriproc/UriReferenceFactory.cxx 
b/stoc/source/uriproc/UriReferenceFactory.cxx
index ac1178bb491d..600df5e7cde2 100644
--- a/stoc/source/uriproc/UriReferenceFactory.cxx
+++ b/stoc/source/uriproc/UriReferenceFactory.cxx
@@ -211,10 +211,8 @@ css::uno::Reference< css::uri::XUriReference > 
parseGeneric(
 scheme, isHierarchical, hasAuthority, authority, path, hasQuery, 
query);
 }
 
-typedef std::vector< sal_Int32 > Segments;
-
 void processSegments(
-Segments & segments,
+std::vector & segments,
 css::uno::Reference< css::uri::XUriReference > const & uriReference,
 bool base, bool processSpecialSegments)
 {
@@ -406,7 +404,7 @@ css::uno::Reference< css::uri::XUriReference > 
Factory::makeAbsolute(
 abs.append(baseUriReference->getAuthority());
 }
 if (uriReference->hasRelativePath()) {
-Segments segments;
+std::vector segments;
 processSegments(
 segments, baseUriReference, true, processSpecialBaseSegments);
 processSegments(segments, uriReference, false, true);
@@ -420,8 +418,7 @@ css::uno::Reference< css::uri::XUriReference > 
Factory::makeAbsolute(
 if (slash) {
 abs.append('/');
 }
-for (Segments::iterator i(segments.begin()); i != segments.end();
- ++i)
+for (auto i(segments.begin()); i != segments.end(); ++i)
 {
 if (*i < -1) {
 OUString segment(
diff --git a/svl/source/inc/poolio.hxx b/svl/source/inc/poolio.hxx
index 59513517daba..a31897e6575d 100644
--- a/svl/source/inc/poolio.hxx
+++ b/svl/source/inc/poolio.hxx
@@ -40,13 +40,12 @@ static const sal_uInt32 SFX_ITEMS_DEFAULT = 0xfffe;
  */
 struct SfxPoolItemArray_Impl
 {
-typedef std::vector FreeList;
 typedef std::unordered_map PoolItemPtrToIndexMap;
 private:
 std::vector maPoolItemVector;
 public:
 /// Track list of indices into our array that contain an empty slot
-FreeList maFree;
+std::vector maFree;
 /// Hash of SfxPoolItem pointer to index into our array that contains that 
slot
 PoolItemPtrToIndexMap maPtrToIndex;
 
diff --git a/svx/source/dialog/framelinkarray.cxx 
b/svx/source/dialog/framelinkarray.cxx
index f0934c48dd7c..38681286f1f0 100644
--- a/svx/source/dialog/framelinkarray.cxx
+++ b/svx/source/dialog/framelinkarray.cxx
@@ -78,7 +78,6 @@ public:
 basegfx::B2DHomMatrix CreateCoordinateSystem(const Array& rArray, size_t 
nCol, size_t nRow, bool bExpandMerged) const;
 };
 
-typedef std::vector< long > LongVec;
 typedef std::vector< Cell > CellVec;
 
 basegfx::B2DHomMatrix Cell::CreateCoordinateSystem(const Array& rArray, size_t 
nCol, size_t nRow, bool bExpandMerged) const
@@ -148,11 +147,11 @@ void Cell::MirrorSelfX()
 }
 
 
-void lclRecalcCoordVec( LongVec& rCoords, const LongVec& rSizes )
+void lclRecalcCoordVec( std::vector& rCoords, const std::vector& 
rSizes )
 {
 DBG_ASSERT( rCoords.size() == rSizes.size() + 1, "lclRecalcCoordVec - 
inconsistent vectors" );
-LongVec::iterator aCIt = rCoords.begin();
-LongVec::const_iterator aSIt = 

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

2018-06-15 Thread Jochen Nitschke
 stoc/source/corereflection/crarray.cxx |   18 ++---
 stoc/source/corereflection/crbase.cxx  |   14 +--
 stoc/source/corereflection/crcomp.cxx  |   20 +++
 stoc/source/corereflection/crefl.cxx   |   22 +++-
 stoc/source/corereflection/crenum.cxx  |   20 +++
 stoc/source/corereflection/criface.cxx |   38 ++---
 stoc/source/implementationregistration/implreg.cxx |   14 +--
 7 files changed, 41 insertions(+), 105 deletions(-)

New commits:
commit 02a7f9e15a46ead2892f54b9e891a32eeef52deb
Author: Jochen Nitschke 
Date:   Fri Jun 15 21:18:54 2018 +0200

stoc: replace double-checked locking with static initializers

Change-Id: I2a36033d0377a58dc27564e903e2c7ce02696206
Reviewed-on: https://gerrit.libreoffice.org/55900
Reviewed-by: Noel Grandin 
Tested-by: Jenkins
Reviewed-by: Jochen Nitschke 

diff --git a/stoc/source/corereflection/crarray.cxx 
b/stoc/source/corereflection/crarray.cxx
index 4bdfa4867054..1c6b1692aab1 100644
--- a/stoc/source/corereflection/crarray.cxx
+++ b/stoc/source/corereflection/crarray.cxx
@@ -52,19 +52,11 @@ void ArrayIdlClassImpl::release() throw()
 
 Sequence< Type > ArrayIdlClassImpl::getTypes()
 {
-static ::cppu::OTypeCollection * s_pTypes = nullptr;
-if (! s_pTypes)
-{
-::osl::MutexGuard aGuard( getMutexAccess() );
-if (! s_pTypes)
-{
-static ::cppu::OTypeCollection s_aTypes(
-cppu::UnoType::get(),
-IdlClassImpl::getTypes() );
-s_pTypes = _aTypes;
-}
-}
-return s_pTypes->getTypes();
+static cppu::OTypeCollection s_aTypes(
+cppu::UnoType::get(),
+IdlClassImpl::getTypes() );
+
+return s_aTypes.getTypes();
 }
 
 Sequence< sal_Int8 > ArrayIdlClassImpl::getImplementationId()
diff --git a/stoc/source/corereflection/crbase.cxx 
b/stoc/source/corereflection/crbase.cxx
index c5256cac92f6..6e84e20e20fe 100644
--- a/stoc/source/corereflection/crbase.cxx
+++ b/stoc/source/corereflection/crbase.cxx
@@ -35,17 +35,9 @@ ClassNameVector g_aClassNames;
 
 ::osl::Mutex & getMutexAccess()
 {
-static ::osl::Mutex * s_pMutex = nullptr;
-if (! s_pMutex)
-{
-::osl::MutexGuard aGuard( ::osl::Mutex::getGlobalMutex() );
-if (! s_pMutex)
-{
-static ::osl::Mutex s_aMutex;
-s_pMutex = _aMutex;
-}
-}
-return *s_pMutex;
+static osl::Mutex s_aMutex;
+
+return s_aMutex;
 }
 
 
diff --git a/stoc/source/corereflection/crcomp.cxx 
b/stoc/source/corereflection/crcomp.cxx
index 01e043144075..acfcf765bb2e 100644
--- a/stoc/source/corereflection/crcomp.cxx
+++ b/stoc/source/corereflection/crcomp.cxx
@@ -94,20 +94,12 @@ void IdlCompFieldImpl::release() throw()
 
 Sequence< Type > IdlCompFieldImpl::getTypes()
 {
-static ::cppu::OTypeCollection * s_pTypes = nullptr;
-if (! s_pTypes)
-{
-::osl::MutexGuard aGuard( getMutexAccess() );
-if (! s_pTypes)
-{
-static ::cppu::OTypeCollection s_aTypes(
-cppu::UnoType::get(),
-cppu::UnoType::get(),
-IdlMemberImpl::getTypes() );
-s_pTypes = _aTypes;
-}
-}
-return s_pTypes->getTypes();
+static cppu::OTypeCollection s_aTypes(
+cppu::UnoType::get(),
+cppu::UnoType::get(),
+IdlMemberImpl::getTypes() );
+
+return s_aTypes.getTypes();
 }
 
 Sequence< sal_Int8 > IdlCompFieldImpl::getImplementationId()
diff --git a/stoc/source/corereflection/crefl.cxx 
b/stoc/source/corereflection/crefl.cxx
index d7d59c769dcc..6d02a8b9bf37 100644
--- a/stoc/source/corereflection/crefl.cxx
+++ b/stoc/source/corereflection/crefl.cxx
@@ -82,21 +82,13 @@ void IdlReflectionServiceImpl::release() throw()
 
 Sequence< Type > IdlReflectionServiceImpl::getTypes()
 {
-static OTypeCollection * s_pTypes = nullptr;
-if (! s_pTypes)
-{
-MutexGuard aGuard( _aComponentMutex );
-if (! s_pTypes)
-{
-static OTypeCollection s_aTypes(
-cppu::UnoType::get(),
-cppu::UnoType::get(),
-cppu::UnoType::get(),
-OComponentHelper::getTypes() );
-s_pTypes = _aTypes;
-}
-}
-return s_pTypes->getTypes();
+static OTypeCollection s_aTypes(
+cppu::UnoType::get(),
+cppu::UnoType::get(),
+cppu::UnoType::get(),
+OComponentHelper::getTypes() );
+
+return s_aTypes.getTypes();
 }
 
 Sequence< sal_Int8 > IdlReflectionServiceImpl::getImplementationId()
diff --git a/stoc/source/corereflection/crenum.cxx 
b/stoc/source/corereflection/crenum.cxx
index ca090763fd12..54871195fff8 100644
--- a/stoc/source/corereflection/crenum.cxx
+++ b/stoc/source/corereflection/crenum.cxx
@@ -88,20 +88,12 @@ void IdlEnumFieldImpl::release() throw()
 
 Sequence< Type > 

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

2018-03-12 Thread Stephan Bergmann
 stoc/source/corereflection/criface.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 9549f0708eb0284de38290631cb46838144274ca
Author: Stephan Bergmann 
Date:   Mon Mar 12 09:48:19 2018 +0100

loplugin:redundantfcast

Change-Id: I9e6e6ffdca91591701b4d2998ef0730b484db557

diff --git a/stoc/source/corereflection/criface.cxx 
b/stoc/source/corereflection/criface.cxx
index 28ac96e37504..25839f741f5f 100644
--- a/stoc/source/corereflection/criface.cxx
+++ b/stoc/source/corereflection/criface.cxx
@@ -763,7 +763,7 @@ Sequence< Reference< XIdlClass > > 
InterfaceIdlClassImpl::getSuperclasses()
 OSL_ASSERT(_xSuperClasses[i].is());
 }
 }
-return Sequence< Reference< XIdlClass > >(_xSuperClasses);
+return _xSuperClasses;
 }
 
 void InterfaceIdlClassImpl::initMembers()
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2018-02-08 Thread Tor Lillqvist
 stoc/source/invocation/invocation.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 7d56128654457bfc859217c23a957d1712fd6e1c
Author: Tor Lillqvist 
Date:   Thu Feb 8 21:36:07 2018 +0200

Fix exception message: add colon between function name and the word 
"expected"

Change-Id: I80eadaa097afdbe4394aceca9f40b9753792f30b

diff --git a/stoc/source/invocation/invocation.cxx 
b/stoc/source/invocation/invocation.cxx
index f564425c4202..82dfbac5a417 100644
--- a/stoc/source/invocation/invocation.cxx
+++ b/stoc/source/invocation/invocation.cxx
@@ -590,7 +590,7 @@ Any Invocation_Impl::invoke( const OUString& FunctionName, 
const Sequence&
 {
 throw IllegalArgumentException(
 "incorrect number of parameters passed invoking function " + 
FunctionName +
-"expected " + OUString::number(nFParamsLen) + ", got " + 
OUString::number(InParams.getLength()),
+": expected " + OUString::number(nFParamsLen) + ", got " + 
OUString::number(InParams.getLength()),
 static_cast(this), sal_Int16(1) );
 }
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2017-11-04 Thread Julien Nabet
 stoc/source/corereflection/base.hxx|6 ++---
 stoc/source/corereflection/crbase.cxx  |8 +++---
 stoc/source/corereflection/crefl.cxx   |6 +
 stoc/source/implementationregistration/implreg.cxx |   25 -
 4 files changed, 19 insertions(+), 26 deletions(-)

New commits:
commit 2345f00899da2cb4624ab07bd92d139adcdb74e5
Author: Julien Nabet 
Date:   Sat Nov 4 15:02:44 2017 +0100

Replace lists by vectors (stoc)

Change-Id: Ifb5dc253186b7cc8f37d843e600addcc579c77e6
Reviewed-on: https://gerrit.libreoffice.org/44299
Reviewed-by: Noel Grandin 
Reviewed-by: Julien Nabet 
Tested-by: Julien Nabet 

diff --git a/stoc/source/corereflection/base.hxx 
b/stoc/source/corereflection/base.hxx
index 8c01dd3ddf0c..fe15a10a75ac 100644
--- a/stoc/source/corereflection/base.hxx
+++ b/stoc/source/corereflection/base.hxx
@@ -39,7 +39,7 @@
 #include "lrucache.hxx"
 
 #ifdef TEST_LIST_CLASSES
-#include 
+#include 
 #include 
 #endif
 #include 
@@ -59,8 +59,8 @@ namespace stoc_corefl
 {
 
 #ifdef TEST_LIST_CLASSES
-typedef std::list< OUString > ClassNameList;
-extern ClassNameList g_aClassNames;
+typedef std::vector< OUString > ClassNameVector;
+extern ClassNameVector g_aClassNames;
 #endif
 
 
diff --git a/stoc/source/corereflection/crbase.cxx 
b/stoc/source/corereflection/crbase.cxx
index 58439f67deb2..5b96e97db576 100644
--- a/stoc/source/corereflection/crbase.cxx
+++ b/stoc/source/corereflection/crbase.cxx
@@ -29,7 +29,7 @@ namespace stoc_corefl
 {
 
 #ifdef TEST_LIST_CLASSES
-ClassNameList g_aClassNames;
+ClassNameVector g_aClassNames;
 #endif
 
 
@@ -65,9 +65,9 @@ IdlClassImpl::IdlClassImpl( IdlReflectionServiceImpl * 
pReflection,
 }
 
 #ifdef TEST_LIST_CLASSES
-ClassNameList::const_iterator iFind( std::find( g_aClassNames.begin(), 
g_aClassNames.end(), _aName ) );
+ClassNameVector::const_iterator iFind( std::find( g_aClassNames.begin(), 
g_aClassNames.end(), _aName ) );
 OSL_ENSURE( iFind == g_aClassNames.end(), "### idl class already exists!" 
);
-g_aClassNames.push_front( _aName );
+g_aClassNames.insert(g_aClassNames.begin(), _aName);
 #endif
 }
 
@@ -78,7 +78,7 @@ IdlClassImpl::~IdlClassImpl()
 m_xReflection.clear();
 
 #ifdef TEST_LIST_CLASSES
-ClassNameList::iterator iFind( std::find( g_aClassNames.begin(), 
g_aClassNames.end(), _aName ) );
+ClassNameVector::iterator iFind( std::find( g_aClassNames.begin(), 
g_aClassNames.end(), _aName ) );
 OSL_ENSURE( iFind != g_aClassNames.end(), "### idl class does not exist!" 
);
 g_aClassNames.erase( iFind );
 #endif
diff --git a/stoc/source/corereflection/crefl.cxx 
b/stoc/source/corereflection/crefl.cxx
index 8982b768a684..1621ecb6627e 100644
--- a/stoc/source/corereflection/crefl.cxx
+++ b/stoc/source/corereflection/crefl.cxx
@@ -114,11 +114,9 @@ void IdlReflectionServiceImpl::dispose()
 _aElements.clear();
 #ifdef TEST_LIST_CLASSES
 OSL_ENSURE( g_aClassNames.empty(), "### idl classes still alive!" );
-ClassNameList::const_iterator iPos( g_aClassNames.begin() );
-while (iPos != g_aClassNames.end())
+for (auto const& className : g_aClassNames)
 {
-OUString aName( *iPos );
-++iPos;
+OUString aName(className);
 }
 #endif
 }
diff --git a/stoc/source/implementationregistration/implreg.cxx 
b/stoc/source/implementationregistration/implreg.cxx
index d9beabfe48b7..3a86e6c864d9 100644
--- a/stoc/source/implementationregistration/implreg.cxx
+++ b/stoc/source/implementationregistration/implreg.cxx
@@ -19,7 +19,7 @@
 
 #include 
 #include 
-#include 
+#include 
 
 #include 
 #include 
@@ -661,7 +661,7 @@ void prepareUserKeys(const Reference < XSimpleRegistry >& 
xDest,
 void deleteAllImplementations(   const Reference < XSimpleRegistry >& xReg,
 const Reference < XRegistryKey >& 
xSource,
 const OUString& locationUrl,
-std::list & implNames)
+std::vector & implNames)
 // throw (InvalidRegistryException, RuntimeException)
 {
 Sequence < Reference < XRegistryKey > > subKeys = xSource->openKeys();
@@ -747,7 +747,7 @@ void deleteAllImplementations(   const Reference < 
XSimpleRegistry >& xReg,
 
 void delete_all_singleton_entries(
 Reference < registry::XRegistryKey > const & xSingletons_section,
-::std::list< OUString > const & impl_names )
+::std::vector< OUString > const & impl_names )
 // throw (InvalidRegistryException, RuntimeException)
 {
 Sequence< Reference< registry::XRegistryKey > > singletons( 
xSingletons_section->openKeys() );
@@ -774,11 +774,9 @@ void delete_all_singleton_entries(
 {
 OUString const & registered_implname = p[ n ];
 
-::std::list< OUString 

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

2017-09-30 Thread Stephan Bergmann
 stoc/source/corereflection/criface.cxx |   21 -
 1 file changed, 20 insertions(+), 1 deletion(-)

New commits:
commit 43b02c4532d88ef24c688ecd32bc8bfd6e1f57ff
Author: Stephan Bergmann 
Date:   Fri Sep 29 18:37:15 2017 +0200

Make sure space handed to C/C++ ABI is padded large enough

PythonTest_pyuno_pytests_testcollections had failed with -fsanitize=address:

> ==6341==ERROR: AddressSanitizer: dynamic-stack-buffer-overflow on address 
0x7ffe5cf77048 at pc 0x7f6be12e51ba bp 0x7ffe5cf76810 sp 0x7ffe5cf76808
> WRITE of size 8 at 0x7ffe5cf77048 thread T0
> #0 0x7f6be12e51b9 in 
x86_64::fill_struct(_typelib_TypeDescriptionReference*, unsigned long const*, 
double const*, void*) bridges/source/cpp_uno/gcc3_linux_x86-64/abi.cxx
> #1 0x7f6be1307f03 in gcc3::callVirtualMethod(void*, unsigned int, 
void*, _typelib_TypeDescriptionReference*, bool, unsigned long*, unsigned int, 
unsigned long*, double*) 
bridges/source/cpp_uno/gcc3_linux_x86-64/callvirtualmethod.cxx:171:17
> #2 0x7f6be130346d in 
cpp_call(bridges::cpp_uno::shared::UnoInterfaceProxy*, 
bridges::cpp_uno::shared::VtableSlot, _typelib_TypeDescriptionReference*, int, 
_typelib_MethodParameter*, void*, void**, _uno_Any**) 
bridges/source/cpp_uno/gcc3_linux_x86-64/uno2cpp.cxx:233:13
> #3 0x7f6be1301c56 in 
bridges::cpp_uno::shared::unoInterfaceProxyDispatch(_uno_Interface*, 
_typelib_TypeDescription const*, void*, void**, _uno_Any**) 
bridges/source/cpp_uno/gcc3_linux_x86-64/uno2cpp.cxx:420:13
> #4 0x7f6be0be09ff in 
stoc_corefl::IdlInterfaceMethodImpl::invoke(com::sun::star::uno::Any const&, 
com::sun::star::uno::Sequence&) 
stoc/source/corereflection/criface.cxx:679:9
> #5 0x7f6be0be304c in non-virtual thunk to 
stoc_corefl::IdlInterfaceMethodImpl::invoke(com::sun::star::uno::Any const&, 
com::sun::star::uno::Sequence&) 
stoc/source/corereflection/criface.cxx
> #6 0x7f6be0375ef9 in (anonymous 
namespace)::IntrospectionAccessStatic_Impl::getPropertyValueByIndex(com::sun::star::uno::Any
 const&, int) const stoc/source/inspect/introspection.cxx:609:33
> #7 0x7f6be03753eb in (anonymous 
namespace)::IntrospectionAccessStatic_Impl::getPropertyValue(com::sun::star::uno::Any
 const&, rtl::OUString const&) const 
stoc/source/inspect/introspection.cxx:519:16
> #8 0x7f6be036bd75 in (anonymous 
namespace)::ImplIntrospectionAccess::getPropertyValue(rtl::OUString const&) 
stoc/source/inspect/introspection.cxx:1040:26
> #9 0x7f6be037102c in non-virtual thunk to (anonymous 
namespace)::ImplIntrospectionAccess::getPropertyValue(rtl::OUString const&) 
stoc/source/inspect/introspection.cxx
> #10 0x7f6be0f95805 in 
stoc_inv::Invocation_Impl::getValue(rtl::OUString const&) 
stoc/source/invocation/invocation.cxx:495:35
> #11 0x7f6be0f95fcc in non-virtual thunk to 
stoc_inv::Invocation_Impl::getValue(rtl::OUString const&) 
stoc/source/invocation/invocation.cxx
> #12 0x7f6be665d69a in pyuno::PyUNO_getattr(_object*, char*) 
pyuno/source/module/pyuno.cxx:1424:52
> #13 0x7f6bf34b1a5f in PyObject_GetAttr 
workdir/UnpackedTarball/python3/Objects/object.c:894:16
> #14 0x7f6bf39f10f9 in PyEval_EvalFrameEx 
workdir/UnpackedTarball/python3/Python/ceval.c:2793:29
...

Change-Id: I7c8aa0f0e153a022c19c981165730725a566a0b2
Reviewed-on: https://gerrit.libreoffice.org/42946
Tested-by: Jenkins 
Reviewed-by: Stephan Bergmann 

diff --git a/stoc/source/corereflection/criface.cxx 
b/stoc/source/corereflection/criface.cxx
index 841cb235eb90..9ead12622f54 100644
--- a/stoc/source/corereflection/criface.cxx
+++ b/stoc/source/corereflection/criface.cxx
@@ -18,6 +18,11 @@
  */
 
 #include 
+
+#include 
+#include 
+#include 
+
 #ifdef SAL_UNX
 #include 
 #endif
@@ -40,6 +45,15 @@ using namespace css::lang;
 using namespace css::reflection;
 using namespace css::uno;
 
+namespace {
+
+std::size_t multipleOf16(std::size_t n) {
+assert(n <= std::numeric_limits::max() - 15);
+return (n + 15) & ~std::size_t(15);
+}
+
+}
+
 namespace stoc_corefl
 {
 
@@ -586,7 +600,12 @@ Any SAL_CALL IdlInterfaceMethodImpl::invoke( const Any & 
rObj, Sequence< Any > &
 TYPELIB_DANGER_GET(
 , getMethodTypeDescr()->pReturnTypeRef );
 
-void * pUnoReturn = alloca( pReturnType->nSize );
+// C/C++ ABIs typically assume that structs are padded at the end, and
+// that those padding bytes may be written to (e.g., to write into the
+// end of a "short" struct by writing the full contents of a "long"
+// register); so create enough space here (assuming that no ABI 
requires
+// padding larger than 16 byte boundaries):
+void * pUnoReturn = alloca( multipleOf16(pReturnType->nSize) );
 void ** ppUnoArgs = static_cast(alloca( sizeof(void *) * 
nParams *2 ));
 typelib_TypeDescription ** 

[Libreoffice-commits] core.git: stoc/source svl/source svtools/source ucb/source unotools/source

2017-06-17 Thread Jochen Nitschke
 stoc/source/javaloader/javaloader.cxx   |   14 +++---
 svl/source/numbers/zforlist.cxx |   19 ++-
 svtools/source/config/helpopt.cxx   |   13 ++---
 svtools/source/config/menuoptions.cxx   |   21 +++--
 svtools/source/config/printoptions.cxx  |   21 +++--
 ucb/source/sorter/sortdynres.cxx|   13 ++---
 ucb/source/sorter/sortresult.cxx|   13 ++---
 unotools/source/config/syslocaleoptions.cxx |   19 ++-
 unotools/source/misc/syslocale.cxx  |   19 ++-
 9 files changed, 33 insertions(+), 119 deletions(-)

New commits:
commit 6149da20ddee5c0c50b445fb6a4e3e81b5ff900b
Author: Jochen Nitschke 
Date:   Sat Jun 17 14:01:36 2017 +0200

replace misc double checked locking patterns

... with thread safe local statics

Change-Id: Ie3c8023776a388846b989f00a0be185273c0d5da
Reviewed-on: https://gerrit.libreoffice.org/38907
Tested-by: Jenkins 
Reviewed-by: Noel Grandin 

diff --git a/stoc/source/javaloader/javaloader.cxx 
b/stoc/source/javaloader/javaloader.cxx
index db850bdb5e6a..01000b0ab827 100644
--- a/stoc/source/javaloader/javaloader.cxx
+++ b/stoc/source/javaloader/javaloader.cxx
@@ -330,17 +330,9 @@ css::uno::Reference SAL_CALL 
JavaComponentLoader::activate(
 
 static Mutex & getInitMutex()
 {
-static Mutex * pMutex = nullptr;
-if( ! pMutex )
-{
-MutexGuard guard( Mutex::getGlobalMutex() );
-if( ! pMutex )
-{
-static Mutex mutex;
-pMutex = 
-}
-}
-return *pMutex;
+static Mutex ourMutex;
+
+return ourMutex;
 }
 
 /// @throws Exception
diff --git a/svl/source/numbers/zforlist.cxx b/svl/source/numbers/zforlist.cxx
index 876dfbde187e..1b77382bc6bd 100644
--- a/svl/source/numbers/zforlist.cxx
+++ b/svl/source/numbers/zforlist.cxx
@@ -350,19 +350,12 @@ void SvNumberFormatter::ChangeIntl(LanguageType eLnge)
 // static
 ::osl::Mutex& SvNumberFormatter::GetMutex()
 {
-static ::osl::Mutex* pMutex = nullptr;
-if( !pMutex )
-{
-::osl::MutexGuard aGuard( ::osl::Mutex::getGlobalMutex() );
-if( !pMutex )
-{
-// #i77768# Due to a static reference in the toolkit lib
-// we need a mutex that lives longer than the svl library.
-// Otherwise the dtor would use a destructed mutex!!
-pMutex = new ::osl::Mutex;
-}
-}
-return *pMutex;
+// #i77768# Due to a static reference in the toolkit lib
+// we need a mutex that lives longer than the svl library.
+// Otherwise the dtor would use a destructed mutex!!
+static ::osl::Mutex persistantMutex;
+
+return persistantMutex;
 }
 
 
diff --git a/svtools/source/config/helpopt.cxx 
b/svtools/source/config/helpopt.cxx
index 381d67f7f0a4..bc1ac4d014c1 100644
--- a/svtools/source/config/helpopt.cxx
+++ b/svtools/source/config/helpopt.cxx
@@ -98,18 +98,9 @@ Sequence< OUString > const & 
SvtHelpOptions_Impl::GetPropertyNames()
 
 ::osl::Mutex & SvtHelpOptions_Impl::getInitMutex()
 {
-static ::osl::Mutex *pMutex = nullptr;
+static ::osl::Mutex ourMutex;
 
-if( ! pMutex )
-{
-::osl::MutexGuard guard( ::osl::Mutex::getGlobalMutex() );
-if( ! pMutex )
-{
-static ::osl::Mutex mutex;
-pMutex = 
-}
-}
-return *pMutex;
+return ourMutex;
 }
 
 SvtHelpOptions_Impl::SvtHelpOptions_Impl()
diff --git a/svtools/source/config/menuoptions.cxx 
b/svtools/source/config/menuoptions.cxx
index cc8b64b760bc..8bec940d4000 100644
--- a/svtools/source/config/menuoptions.cxx
+++ b/svtools/source/config/menuoptions.cxx
@@ -410,24 +410,9 @@ void SvtMenuOptions::SetContextMenuShortcuts(TriState 
eState)
 
 Mutex& SvtMenuOptions::GetOwnStaticMutex()
 {
-// Initialize static mutex only for one time!
-static Mutex* pMutex = nullptr;
-// If these method first called (Mutex not already exist!) ...
-if( pMutex == nullptr )
-{
-// ... we must create a new one. Protect follow code with the global 
mutex -
-// It must be - we create a static variable!
-MutexGuard aGuard( Mutex::getGlobalMutex() );
-// We must check our pointer again - because it can be that another 
instance of our class will be faster than these!
-if( pMutex == nullptr )
-{
-// Create the new mutex and set it for return on static variable.
-static Mutex aMutex;
-pMutex = 
-}
-}
-// Return new created or already existing mutex object.
-return *pMutex;
+static Mutex ourMutex;
+
+return ourMutex;
 }
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/svtools/source/config/printoptions.cxx 
b/svtools/source/config/printoptions.cxx
index be4a73644d4d..05ac6875d4a4 

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

2017-02-01 Thread Noel Grandin
 stoc/source/corereflection/crarray.cxx |   14 -
 stoc/source/corereflection/crcomp.cxx  |   10 -
 stoc/source/corereflection/crenum.cxx  |4 
 stoc/source/corereflection/criface.cxx |3 
 stoc/source/implementationregistration/implreg.cxx |   92 +++---
 stoc/source/inspect/introspection.cxx  |   24 +-
 stoc/source/invocation/invocation.cxx  |5 
 stoc/source/javavm/javavm.cxx  |8 
 stoc/source/security/access_controller.cxx |5 
 stoc/source/security/file_policy.cxx   |   21 --
 stoc/source/security/permissions.cxx   |   16 -
 stoc/source/servicemanager/servicemanager.cxx  |   18 +-
 stoc/source/simpleregistry/simpleregistry.cxx  |  176 -
 stoc/source/typeconv/convert.cxx   |6 
 14 files changed, 161 insertions(+), 241 deletions(-)

New commits:
commit bbd34216dca07bb37b9188147c42e64bbf875d54
Author: Noel Grandin 
Date:   Mon Jan 30 11:22:54 2017 +0200

improve exception messages in stoc

Change-Id: I43716332ab916e5ec7b8ab7a4d14895d060a9bd4
Reviewed-on: https://gerrit.libreoffice.org/33692
Tested-by: Jenkins 
Reviewed-by: Noel Grandin 

diff --git a/stoc/source/corereflection/crarray.cxx 
b/stoc/source/corereflection/crarray.cxx
index 3ab0b55..4bdfa48 100644
--- a/stoc/source/corereflection/crarray.cxx
+++ b/stoc/source/corereflection/crarray.cxx
@@ -80,13 +80,13 @@ void ArrayIdlClassImpl::realloc( Any & rArray, sal_Int32 
nLen )
 if (eTC != TypeClass_SEQUENCE)
 {
 throw IllegalArgumentException(
-"no sequence given!",
+"expected sequence, but found " + 
rArray.getValueType().getTypeName(),
 static_cast(static_cast(this)), 0 );
 }
 if (nLen < 0)
 {
 throw IllegalArgumentException(
-"illegal length given!",
+"negative length given!",
 static_cast(static_cast(this)), 1 );
 }
 
@@ -104,7 +104,7 @@ sal_Int32 ArrayIdlClassImpl::getLen( const Any & rArray )
 if (eTC != TypeClass_SEQUENCE)
 {
 throw IllegalArgumentException(
-"no sequence given!",
+"expected sequence, but found " + 
rArray.getValueType().getTypeName(),
 static_cast(static_cast(this)), 0 );
 }
 
@@ -117,7 +117,7 @@ Any ArrayIdlClassImpl::get( const Any & rArray, sal_Int32 
nIndex )
 if (eTC != TypeClass_SEQUENCE)
 {
 throw IllegalArgumentException(
-"no sequence given!",
+"expected sequence, but found " + 
rArray.getValueType().getTypeName(),
 static_cast(static_cast(this)), 0 );
 }
 
@@ -125,7 +125,7 @@ Any ArrayIdlClassImpl::get( const Any & rArray, sal_Int32 
nIndex )
 if (pSeq->nElements <= nIndex)
 {
 throw ArrayIndexOutOfBoundsException(
-"illegal index given!",
+"illegal index given, index " + OUString::number(nIndex) + " is < 
" + OUString::number(pSeq->nElements),
 static_cast(static_cast(this)) );
 }
 
@@ -147,7 +147,7 @@ void ArrayIdlClassImpl::set( Any & rArray, sal_Int32 
nIndex, const Any & rNewVal
 if (eTC != TypeClass_SEQUENCE)
 {
 throw IllegalArgumentException(
-"no sequence given!",
+"expected sequence, but found " + 
rArray.getValueType().getTypeName(),
 static_cast(static_cast(this)), 0 );
 }
 
@@ -155,7 +155,7 @@ void ArrayIdlClassImpl::set( Any & rArray, sal_Int32 
nIndex, const Any & rNewVal
 if (pSeq->nElements <= nIndex)
 {
 throw ArrayIndexOutOfBoundsException(
-"illegal index given!",
+"illegal index given, index " + OUString::number(nIndex) + " is < 
" + OUString::number(pSeq->nElements),
 static_cast(static_cast(this)) );
 }
 
diff --git a/stoc/source/corereflection/crcomp.cxx 
b/stoc/source/corereflection/crcomp.cxx
index 3dd101f..0a05726 100644
--- a/stoc/source/corereflection/crcomp.cxx
+++ b/stoc/source/corereflection/crcomp.cxx
@@ -189,7 +189,7 @@ Any IdlCompFieldImpl::get( const Any & rObj )
 TYPELIB_DANGER_RELEASE( pObjTD );
 }
 throw IllegalArgumentException(
-"illegal object given!",
+"expected struct or exception, got " + 
rObj.getValueType().getTypeName(),
 static_cast(static_cast(this)), 0 );
 }
 
@@ -217,14 +217,14 @@ void IdlCompFieldImpl::set( const Any & rObj, const Any & 
rValue )
 else
 {
 throw IllegalArgumentException(
-"illegal value given!",
+"cannot assign value to destination",
 static_cast(static_cast(this)), 1 
);
 }
 }
 TYPELIB_DANGER_RELEASE( pObjTD );
 }
 throw IllegalArgumentException(
-"illegal object given!",
+"expected 

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

2017-01-27 Thread Michael Stahl
 stoc/source/corereflection/criface.cxx |3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

New commits:
commit dae273da614a57724aea736f415de97416fe016e
Author: Michael Stahl 
Date:   Fri Jan 27 12:14:37 2017 +0100

stoc: oops, missing closing quote

Change-Id: Ib1acd95a705d2b504718a28a91abd570b57c9de9

diff --git a/stoc/source/corereflection/criface.cxx 
b/stoc/source/corereflection/criface.cxx
index a6b4395..6846514 100644
--- a/stoc/source/corereflection/criface.cxx
+++ b/stoc/source/corereflection/criface.cxx
@@ -653,7 +653,8 @@ Any SAL_CALL IdlInterfaceMethodImpl::invoke( const Any & 
rObj, Sequence< Any > &
 "cannot coerce argument type during corereflection 
call:"
 "\narg no.: " + OUString::number(nPos)
 + " expected: \"" + OUString(pTD->pTypeName)
-+ "\" actual: \"" + 
OUString(pCppArgs[nPos].getValueTypeRef()->pTypeName),
++ "\" actual: \"" + 
OUString(pCppArgs[nPos].getValueTypeRef()->pTypeName)
++ "\"",
 *o3tl::doAccess(rObj), 
(sal_Int16)nPos );
 
 // cleanup
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2017-01-27 Thread Michael Stahl
 stoc/source/corereflection/criface.cxx |5 -
 1 file changed, 4 insertions(+), 1 deletion(-)

New commits:
commit 845d4eb7bc20a6eadf08b0fe0939c51c3cbf3a62
Author: Michael Stahl 
Date:   Thu Jan 26 16:31:42 2017 +0100

stoc: try to throw more informative exceptions

... from IdlInterfaceMethodImpl::invoke(), which is somewhere involved
in BASIC calls.

Change-Id: I739f70fec56ec9e4345511eefe41fd0f8df8bf6f
Reviewed-on: https://gerrit.libreoffice.org/33593
Tested-by: Jenkins 
Reviewed-by: Katarina Behrens 

diff --git a/stoc/source/corereflection/criface.cxx 
b/stoc/source/corereflection/criface.cxx
index 254f1a35..a6b4395 100644
--- a/stoc/source/corereflection/criface.cxx
+++ b/stoc/source/corereflection/criface.cxx
@@ -650,7 +650,10 @@ Any SAL_CALL IdlInterfaceMethodImpl::invoke( const Any & 
rObj, Sequence< Any > &
 if (! bAssign)
 {
 IllegalArgumentException aExc(
-"cannot coerce argument type during corereflection 
call!",
+"cannot coerce argument type during corereflection 
call:"
+"\narg no.: " + OUString::number(nPos)
++ " expected: \"" + OUString(pTD->pTypeName)
++ "\" actual: \"" + 
OUString(pCppArgs[nPos].getValueTypeRef()->pTypeName),
 *o3tl::doAccess(rObj), 
(sal_Int16)nPos );
 
 // cleanup
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2017-01-26 Thread Stephan Bergmann
 stoc/source/security/permissions.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 52b84ea00775b8cff8b889ac9d5e73952de02817
Author: Stephan Bergmann 
Date:   Thu Jan 26 15:09:31 2017 +0100

-Werror=int-in-bool-context (GCC 7)

Change-Id: Id97c3ec66c9c0f924951c44efa9f7dd95b184223

diff --git a/stoc/source/security/permissions.cxx 
b/stoc/source/security/permissions.cxx
index a865d47..7e98f96 100644
--- a/stoc/source/security/permissions.cxx
+++ b/stoc/source/security/permissions.cxx
@@ -87,7 +87,7 @@ static inline OUString makeStrings(
 if (0x8000 & mask)
 {
 buf.appendAscii( *strings );
-if (mask << 1) // more items following
+if ((mask << 1) != 0) // more items following
 buf.append( ',' );
 }
 mask = (mask << 1);
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2016-11-02 Thread Caolán McNamara
 stoc/source/javavm/javavm.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 0a1e6954a11df2d8ae13ea4f3b9086c050a2bbed
Author: Caolán McNamara 
Date:   Wed Nov 2 20:26:28 2016 +

coverity#1375798 Uncaught exception

Change-Id: Id7e968170a038d9316503ee796cfd6a99e9fc3ae

diff --git a/stoc/source/javavm/javavm.cxx b/stoc/source/javavm/javavm.cxx
index d27c081..b7bc59f 100644
--- a/stoc/source/javavm/javavm.cxx
+++ b/stoc/source/javavm/javavm.cxx
@@ -539,7 +539,7 @@ void setTimeZone(stoc_javavm::JVM * pjvm) throw() {
 void initVMConfiguration(
 stoc_javavm::JVM * pjvm,
 const css::uno::Reference & xSMgr,
-const css::uno::Reference ) 
throw(css::uno::Exception)
+const css::uno::Reference ) 
throw(css::uno::Exception, std::exception)
 {
 stoc_javavm::JVM jvm;
 try {
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2016-10-27 Thread Caolán McNamara
 stoc/source/javavm/javavm.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 7e46e9bb5c226defde6fb4b3c1d4022991df33c1
Author: Caolán McNamara 
Date:   Thu Oct 27 21:10:57 2016 +0100

coverity#1374309 Uncaught exception

Change-Id: I043236e45fbb110b6b3818f2b02dcf1f512623f6

diff --git a/stoc/source/javavm/javavm.cxx b/stoc/source/javavm/javavm.cxx
index b780b7a..d27c081 100644
--- a/stoc/source/javavm/javavm.cxx
+++ b/stoc/source/javavm/javavm.cxx
@@ -349,7 +349,7 @@ void getINetPropsFromConfig(stoc_javavm::JVM * pjvm,
 void getDefaultLocaleFromConfig(
 stoc_javavm::JVM * pjvm,
 const css::uno::Reference & xSMgr,
-const css::uno::Reference  ) 
throw(css::uno::Exception)
+const css::uno::Reference  ) 
throw(css::uno::Exception, std::exception)
 {
 css::uno::Reference xConfRegistry =
 xSMgr->createInstanceWithContext( 
"com.sun.star.configuration.ConfigurationRegistry", xCtx );
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2016-10-26 Thread Eike Rathke
 stoc/source/javavm/javavm.cxx |   73 --
 1 file changed, 64 insertions(+), 9 deletions(-)

New commits:
commit effb27326746945763bda70e2c375c86a40a05fc
Author: Eike Rathke 
Date:   Tue Oct 25 16:48:11 2016 +0200

Java 7 DISPLAY and FORMAT locale and script field

Change-Id: Ie62105c60a327f6e5cbcf1a801b341e988471d73
Reviewed-on: https://gerrit.libreoffice.org/30308
Reviewed-by: Eike Rathke 
Tested-by: Eike Rathke 

diff --git a/stoc/source/javavm/javavm.cxx b/stoc/source/javavm/javavm.cxx
index b27df6f..b780b7a 100644
--- a/stoc/source/javavm/javavm.cxx
+++ b/stoc/source/javavm/javavm.cxx
@@ -366,27 +366,82 @@ void getDefaultLocaleFromConfig(
 xConfRegistry_simple->open("org.openoffice.Setup", true, false);
 css::uno::Reference xRegistryRootKey = 
xConfRegistry_simple->getRootKey();
 
-// read locale
-css::uno::Reference locale = 
xRegistryRootKey->openKey("L10N/ooLocale");
-if(locale.is() && !locale->getStringValue().isEmpty()) {
-LanguageTag aLanguageTag( locale->getStringValue());
+// Since 1.7 Java knows DISPLAY and FORMAT locales, which match our UI and
+// system locale. See
+// 
http://hg.openjdk.java.net/jdk8u/jdk8u-dev/jdk/file/569b1b644416/src/share/classes/java/util/Locale.java
+// https://docs.oracle.com/javase/tutorial/i18n/locale/scope.html
+// https://docs.oracle.com/javase/7/docs/api/java/util/Locale.html
+
+// Read UI language/locale.
+css::uno::Reference xUILocale = 
xRegistryRootKey->openKey("L10N/ooLocale");
+if(xUILocale.is() && !xUILocale->getStringValue().isEmpty()) {
+LanguageTag aLanguageTag( xUILocale->getStringValue());
 OUString language;
 OUString script;
 OUString country;
-// Java knows nothing but plain old ISO language and country codes.
+// Java knows nothing but plain old ISO codes, unless Locale.Builder or
+// Locale.forLanguageTag() are used, or non-standardized variant field
+// content which we ignore.
 aLanguageTag.getIsoLanguageScriptCountry( language, script, country);
 
 if(!language.isEmpty()) {
-OUString prop = "user.language="
-  + language;
+OUString prop = "user.language=" + language;
+pjvm->pushProp(prop);
+}
 
+// As of Java 7 also script is supported.
+if(!script.isEmpty()) {
+OUString prop = "user.script=" + script;
 pjvm->pushProp(prop);
 }
 
 if(!country.isEmpty()) {
-OUString prop = "user.country="
-  + country;
+OUString prop = "user.country=" + country;
+pjvm->pushProp(prop);
+}
+
+// Java 7 DISPLAY category is our UI language/locale.
+if(!language.isEmpty()) {
+OUString prop = "user.language.display=" + language;
+pjvm->pushProp(prop);
+}
 
+if(!script.isEmpty()) {
+OUString prop = "user.script.display=" + script;
+pjvm->pushProp(prop);
+}
+
+if(!country.isEmpty()) {
+OUString prop = "user.country.display=" + country;
+pjvm->pushProp(prop);
+}
+}
+
+// Read system locale.
+css::uno::Reference xLocale = 
xRegistryRootKey->openKey("L10N/ooSetupSystemLocale");
+if(xLocale.is() && !xLocale->getStringValue().isEmpty()) {
+LanguageTag aLanguageTag( xLocale->getStringValue());
+OUString language;
+OUString script;
+OUString country;
+// Java knows nothing but plain old ISO codes, unless Locale.Builder or
+// Locale.forLanguageTag() are used, or non-standardized variant field
+// content which we ignore.
+aLanguageTag.getIsoLanguageScriptCountry( language, script, country);
+
+// Java 7 FORMAT category is our system locale.
+if(!language.isEmpty()) {
+OUString prop = "user.language.format=" + language;
+pjvm->pushProp(prop);
+}
+
+if(!script.isEmpty()) {
+OUString prop = "user.script.format=" + script;
+pjvm->pushProp(prop);
+}
+
+if(!country.isEmpty()) {
+OUString prop = "user.country.format=" + country;
 pjvm->pushProp(prop);
 }
 }
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2016-07-18 Thread Markus Mohrhard
 stoc/source/invocation/invocation.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit b944e498a3053497394963b4e7bda2951ddcbcc1
Author: Markus Mohrhard 
Date:   Mon Jul 18 15:19:32 2016 +0200

don't write past the end of the array

Found through

http://crashreport.libreoffice.org/stats/crash_details/6ba2edbd-d268-4074-8b87-590a5694cc26

Change-Id: Ic95d472fd117c2d286fabb775ef49e287a2874fa

diff --git a/stoc/source/invocation/invocation.cxx 
b/stoc/source/invocation/invocation.cxx
index eee3da6..207797a 100644
--- a/stoc/source/invocation/invocation.cxx
+++ b/stoc/source/invocation/invocation.cxx
@@ -992,7 +992,7 @@ Sequence< Type > SAL_CALL Invocation_Impl::getTypes() 
throw( RuntimeException, s
 static Sequence< Type > const * s_pTypes = nullptr;
 if (! s_pTypes)
 {
-Sequence< Type > types( 4 +8 );
+Sequence< Type > types( 4 + 10 );
 Type * pTypes = types.getArray();
 sal_Int32 n = 0;
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2016-06-21 Thread Stephan Bergmann
 stoc/source/corereflection/base.hxx   |7 +-
 stoc/source/corereflection/crefl.cxx  |9 +-
 stoc/source/corereflection/criface.cxx|   25 +++-
 stoc/source/inspect/introspection.cxx |   57 +++---
 stoc/source/invocation/invocation.cxx |6 -
 stoc/source/servicemanager/servicemanager.cxx |   19 ++
 stoc/source/typeconv/convert.cxx  |   80 +-
 7 files changed, 95 insertions(+), 108 deletions(-)

New commits:
commit 9cef658364e4d8441f490e4fe89c3bfa14cd24b3
Author: Stephan Bergmann 
Date:   Tue Jun 21 14:05:17 2016 +0200

Clean up uses of Any::getValue() in stoc

Change-Id: I455b708bfcc9d5aa71bb0ffc21efec205302169e

diff --git a/stoc/source/corereflection/base.hxx 
b/stoc/source/corereflection/base.hxx
index f28a600..cdfcb3f 100644
--- a/stoc/source/corereflection/base.hxx
+++ b/stoc/source/corereflection/base.hxx
@@ -21,6 +21,9 @@
 #ifndef INCLUDED_STOC_SOURCE_COREREFLECTION_BASE_HXX
 #define INCLUDED_STOC_SOURCE_COREREFLECTION_BASE_HXX
 
+#include 
+
+#include 
 #include 
 #include 
 #include 
@@ -366,9 +369,9 @@ inline bool extract(
 reinterpret_cast< uno_AcquireFunc >(css::uno::cpp_acquire),
 reinterpret_cast< uno_ReleaseFunc >(css::uno::cpp_release) );
 }
-else if (rObj.getValueTypeClass() == css::uno::TypeClass_TYPE)
+else if (auto t = o3tl::tryAccess(rObj))
 {
-rDest = pRefl->forType( static_cast< const css::uno::Type * >( 
rObj.getValue() )->getTypeLibType() );
+rDest = pRefl->forType( t->getTypeLibType() );
 return rDest.is();
 }
 }
diff --git a/stoc/source/corereflection/crefl.cxx 
b/stoc/source/corereflection/crefl.cxx
index d9e9007..9275e45 100644
--- a/stoc/source/corereflection/crefl.cxx
+++ b/stoc/source/corereflection/crefl.cxx
@@ -25,6 +25,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 
 using namespace css;
@@ -223,8 +224,7 @@ Reference< XIdlClass > IdlReflectionServiceImpl::forName( 
const OUString & rType
 
 if (aAny.hasValue())
 {
-if (aAny.getValueTypeClass() == TypeClass_INTERFACE)
-xRet = *static_cast 
*>(aAny.getValue());
+aAny >>= xRet;
 }
 else
 {
@@ -254,7 +254,7 @@ Any IdlReflectionServiceImpl::getByHierarchicalName( const 
OUString & rName )
 if (aRet.getValueTypeClass() == TypeClass_INTERFACE)
 {
 // type retrieved from tdmgr
-OSL_ASSERT( (*static_cast const 
*>(aRet.getValue()))->queryInterface(
+OSL_ASSERT( 
(*o3tl::forceAccess(aRet))->queryInterface(
 cppu::UnoType::get()).hasValue() );
 
 css::uno::Reference< css::reflection::XConstantTypeDescription >
@@ -321,8 +321,7 @@ Reference< XIdlClass > IdlReflectionServiceImpl::forType( 
typelib_TypeDescriptio
 
 if (aAny.hasValue())
 {
-if (aAny.getValueTypeClass() == TypeClass_INTERFACE)
-xRet = *static_cast 
*>(aAny.getValue());
+aAny >>= xRet;
 }
 else
 {
diff --git a/stoc/source/corereflection/criface.cxx 
b/stoc/source/corereflection/criface.cxx
index 22b12db..91d42ae 100644
--- a/stoc/source/corereflection/criface.cxx
+++ b/stoc/source/corereflection/criface.cxx
@@ -24,6 +24,7 @@
 #if !(defined(MACOSX) || defined(IOS) || defined(FREEBSD))
 #include 
 #endif
+#include 
 #include 
 #include 
 #include 
@@ -189,9 +190,7 @@ Any IdlAttributeFieldImpl::get( const Any & rObj )
 (*pUnoI->pDispatcher)( pUnoI, getTypeDescr(), pReturn, nullptr,  
);
 (*pUnoI->release)( pUnoI );
 
-checkException(
-pExc,
-*static_cast< Reference< XInterface > const * >(rObj.getValue()));
+checkException(pExc, *o3tl::doAccess(rObj));
 Any aRet;
 uno_any_destruct(
 , reinterpret_cast< uno_ReleaseFunc >(cpp_release) );
@@ -277,17 +276,14 @@ void IdlAttributeFieldImpl::set( Any & rObj, const Any & 
rValue )
 (*pUnoI->release)( pUnoI );
 
 uno_destructData( pArg, pTD, nullptr );
-checkException(
-pExc,
-*static_cast< Reference< XInterface > const * >(
-rObj.getValue()));
+checkException(pExc, *o3tl::doAccess(rObj));
 return;
 }
 (*pUnoI->release)( pUnoI );
 
 throw IllegalArgumentException(
 "illegal value given!",
-*static_cast *>(rObj.getValue()), 1 
);
+*o3tl::doAccess(rObj), 1 );
 }
 throw IllegalArgumentException(
 "illegal destination object given!",
@@ -575,19 +571,20 @@ Any SAL_CALL IdlInterfaceMethodImpl::invoke( const Any & 
rObj, Sequence< Any > &
   css::reflection::InvocationTargetException,
   css::uno::RuntimeException, std::exception)
 {
-if 

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

2016-05-01 Thread tymyjan
 stoc/source/invocation_adapterfactory/iafactory.cxx |4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

New commits:
commit 8e4ee4bc68be0fd75636466864b3f6e2716b2748
Author: tymyjan 
Date:   Sat Apr 30 16:20:31 2016 +0200

tdf#97499 Fixed containers parameters clearing #9

Change-Id: I097106e1887be283320fc518ddafda76608b46ee
Reviewed-on: https://gerrit.libreoffice.org/24521
Tested-by: Jenkins 
Reviewed-by: Markus Mohrhard 

diff --git a/stoc/source/invocation_adapterfactory/iafactory.cxx 
b/stoc/source/invocation_adapterfactory/iafactory.cxx
index 8c57f65..d66afab 100644
--- a/stoc/source/invocation_adapterfactory/iafactory.cxx
+++ b/stoc/source/invocation_adapterfactory/iafactory.cxx
@@ -75,8 +75,8 @@ struct hash_ptr
 inline size_t operator() ( void * p ) const
 { return reinterpret_cast(p); }
 };
-typedef std::unordered_set< void *, hash_ptr, equal_to< void * > > t_ptr_set;
-typedef std::unordered_map< void *, t_ptr_set, hash_ptr, equal_to< void * > > 
t_ptr_map;
+typedef std::unordered_set< void *, hash_ptr > t_ptr_set;
+typedef std::unordered_map< void *, t_ptr_set, hash_ptr > t_ptr_map;
 
 
 class FactoryImpl
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: stoc/source store/source svgio/inc svgio/source svl/source svtools/source svx/inc svx/source test/source testtools/source toolkit/source tools/source unotest/source uui

2016-04-13 Thread Jochen Nitschke
 stoc/source/implementationregistration/implreg.cxx |5 +-
 stoc/source/javavm/interact.cxx|   11 +++--
 stoc/source/javavm/javavm.cxx  |   12 
--
 stoc/source/uriproc/ExternalUriReferenceTranslator.cxx |7 ++-
 stoc/source/uriproc/UriReferenceFactory.cxx|   13 
--
 stoc/source/uriproc/UriSchemeParser_vndDOTsunDOTstarDOTexpand.cxx  |   13 
--
 stoc/source/uriproc/UriSchemeParser_vndDOTsunDOTstarDOTscript.cxx  |   13 
--
 stoc/source/uriproc/VndSunStarPkgUrlReferenceFactory.cxx   |7 ++-
 store/source/lockbyte.cxx  |   19 
++
 store/source/storbase.cxx  |7 ++-
 store/source/storcach.cxx  |2 -
 store/source/storcach.hxx  |7 ++-
 svgio/inc/svgio/svgreader/svgdocument.hxx  |8 ++--
 svgio/inc/svgio/svgreader/svgnode.hxx  |5 +-
 svgio/source/svguno/xsvgparser.cxx |5 +-
 svl/source/config/asiancfg.cxx |6 ++-
 svl/source/items/aeitem.cxx|1 
 svl/source/misc/getstringresource.cxx  |6 ++-
 svl/source/misc/inethist.cxx   |5 +-
 svl/source/svdde/ddeimp.hxx|5 +-
 svtools/source/edit/textwindowpeer.cxx |6 ++-
 svtools/source/misc/svtaccessiblefactory.cxx   |5 +-
 svtools/source/table/mousefunction.hxx |6 +--
 svtools/source/uno/contextmenuhelper.cxx   |6 +--
 svtools/source/uno/unocontroltablemodel.hxx|1 
 svtools/source/uno/unogridcolumnfacade.cxx |4 +-
 svtools/source/uno/unogridcolumnfacade.hxx |5 +-
 svx/inc/AccessibleTableShape.hxx   |   11 +++--
 svx/source/accessibility/lookupcolorname.cxx   |5 +-
 svx/source/form/fmscriptingenv.cxx |5 +-
 svx/source/sdr/contact/viewcontactofunocontrol.cxx |1 
 svx/source/sdr/contact/viewobjectcontactofunocontrol.cxx   |7 +--
 svx/source/sidebar/PanelFactory.cxx|7 +--
 svx/source/table/accessiblecell.hxx|   12 
++
 svx/source/tbxctrls/lboxctrl.cxx   |1 
 svx/source/xml/xmlgrhlp.cxx|9 +++-
 test/source/vclbootstrapprotector.cxx  |5 +-
 testtools/source/bridgetest/constructors.cxx   |6 +--
 testtools/source/bridgetest/currentcontextchecker.cxx  |7 ++-
 toolkit/source/awt/asynccallback.cxx   |6 +--
 toolkit/source/controls/unocontrol.cxx |5 +-
 toolkit/source/helper/accessibilityclient.cxx  |6 +--
 tools/source/generic/fract.cxx |7 ++-
 unotest/source/cpp/unobootstrapprotector/unobootstrapprotector.cxx |6 ++-
 unotest/source/cpp/unoexceptionprotector/unoexceptionprotector.cxx |6 ++-
 uui/source/interactionhandler.cxx  |7 ++-
 vbahelper/source/vbahelper/vbaapplicationbase.cxx  |6 ++-
 vcl/osx/DragSource.hxx |7 +--
 vcl/osx/DragSourceContext.hxx  |7 +--
 vcl/osx/DropTarget.hxx |7 +--
 vcl/osx/OSXTransferable.hxx|6 +--
 vcl/osx/clipboard.hxx  |6 +--
 writerperfect/source/common/WPXSvInputStream.cxx   |5 +-
 xmloff/inc/txtlists.hxx|5 +-
 xmloff/source/chart/SchXMLExport.cxx   |6 ++-
 xmloff/source/style/impastpl.hxx   |7 ++-
 xmloff/source/text/txtimp.cxx  |4 +-
 xmlsecurity/source/xmlsec/serialnumberadapter.cxx  |6 +--
 58 files changed, 214 insertions(+), 167 deletions(-)

New commits:
commit 97abbec95665b43a9a09e10a0fb31854cdbd5c0d
Author: Jochen Nitschke 
Date:   Wed Apr 13 10:11:37 2016 +0200

tdf#94306 replace boost::noncopyable in stoc to xmlsec..

Replace with C++11 delete copy-constructur
and copy-assignment.
Remove boost/noncopyable.hpp includes.
Add missing 

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

2016-04-12 Thread Stephan Bergmann
 stoc/source/invocation_adapterfactory/iafactory.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit b6fc8ae0e3a0580c6f23f0cec5618a0457885529
Author: Stephan Bergmann 
Date:   Tue Apr 12 18:12:46 2016 +0200

Remove stray spaces from start of log messages, redux

Change-Id: I6d8e330665860d376629ff6df8897d3826d0883b

diff --git a/stoc/source/invocation_adapterfactory/iafactory.cxx 
b/stoc/source/invocation_adapterfactory/iafactory.cxx
index e40e8b7..8c57f65 100644
--- a/stoc/source/invocation_adapterfactory/iafactory.cxx
+++ b/stoc/source/invocation_adapterfactory/iafactory.cxx
@@ -757,7 +757,7 @@ FactoryImpl::~FactoryImpl()
 (*m_pConverter->release)( m_pConverter );
 
 #if OSL_DEBUG_LEVEL > 0
-assert(m_receiver2adapters.empty() && " still adapters out there!?");
+assert(m_receiver2adapters.empty() && "still adapters out there!?");
 #endif
 }
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2016-04-12 Thread Stephan Bergmann
 stoc/source/corereflection/crefl.cxx  |2 +-
 stoc/source/javavm/javavm.cxx |2 +-
 stoc/source/servicemanager/servicemanager.cxx |8 
 3 files changed, 6 insertions(+), 6 deletions(-)

New commits:
commit 117dc3c5ecb7874e1a9d2ac96f9df65b8f3d3944
Author: Stephan Bergmann 
Date:   Tue Apr 12 17:13:03 2016 +0200

Remove stray spaces from start of log messages

Change-Id: I0bf6945a030867b3575fcef81c0d32addb85b992

diff --git a/stoc/source/corereflection/crefl.cxx 
b/stoc/source/corereflection/crefl.cxx
index d0e9e8c..adad971 100644
--- a/stoc/source/corereflection/crefl.cxx
+++ b/stoc/source/corereflection/crefl.cxx
@@ -210,7 +210,7 @@ inline Reference< XIdlClass > 
IdlReflectionServiceImpl::constructClass(
 return new IdlClassImpl( this, pTypeDescr->pTypeName, 
pTypeDescr->eTypeClass, pTypeDescr );
 
 default:
-SAL_INFO("stoc", " corereflection type unsupported: " << 
pTypeDescr->pTypeName);
+SAL_INFO("stoc", "corereflection type unsupported: " << 
pTypeDescr->pTypeName);
 return Reference< XIdlClass >();
 }
 }
diff --git a/stoc/source/javavm/javavm.cxx b/stoc/source/javavm/javavm.cxx
index c81fe0c..7a1e08c 100644
--- a/stoc/source/javavm/javavm.cxx
+++ b/stoc/source/javavm/javavm.cxx
@@ -500,7 +500,7 @@ void initVMConfiguration(
 getINetPropsFromConfig(, xSMgr, xCtx);
 }
 catch(const css::uno::Exception & exception) {
-SAL_INFO("stoc", " can not get INETProps because of >" << 
exception.Message << "<");
+SAL_INFO("stoc", "can not get INETProps because of >" << 
exception.Message << "<");
 }
 
 try {
diff --git a/stoc/source/servicemanager/servicemanager.cxx 
b/stoc/source/servicemanager/servicemanager.cxx
index 55c2c9b1..2e9c42e 100644
--- a/stoc/source/servicemanager/servicemanager.cxx
+++ b/stoc/source/servicemanager/servicemanager.cxx
@@ -891,7 +891,7 @@ Reference< XInterface > 
OServiceManager::createInstanceWithContext(
 Reference< XSingleServiceFactory > xFac2( xFactory, 
UNO_QUERY );
 if (xFac2.is())
 {
-SAL_INFO("stoc", " ignoring given context raising 
service " << rServiceSpecifier << "!!!");
+SAL_INFO("stoc", "ignoring given context raising 
service " << rServiceSpecifier << "!!!");
 return xFac2->createInstance();
 }
 }
@@ -899,7 +899,7 @@ Reference< XInterface > 
OServiceManager::createInstanceWithContext(
 }
 catch (const lang::DisposedException & exc)
 {
-SAL_INFO("stoc", " DisposedException occurred: " << exc.Message);
+SAL_INFO("stoc", "DisposedException occurred: " << exc.Message);
 }
 }
 
@@ -946,7 +946,7 @@ Reference< XInterface > 
OServiceManager::createInstanceWithArgumentsAndContext(
 Reference< XSingleServiceFactory > xFac2( xFactory, 
UNO_QUERY );
 if (xFac2.is())
 {
-SAL_INFO("stoc", " ignoring given context raising 
service " << rServiceSpecifier << "!!!");
+SAL_INFO("stoc", "ignoring given context raising 
service " << rServiceSpecifier << "!!!");
 return xFac2->createInstanceWithArguments( rArguments 
);
 }
 }
@@ -954,7 +954,7 @@ Reference< XInterface > 
OServiceManager::createInstanceWithArgumentsAndContext(
 }
 catch (const lang::DisposedException & exc)
 {
-SAL_INFO("stoc", " DisposedException occurred: " << exc.Message);
+SAL_INFO("stoc", "DisposedException occurred: " << exc.Message);
 }
 }
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: stoc/source stoc/test

2016-04-12 Thread Rohan Kumar
 stoc/source/corereflection/crefl.cxx|7 
 stoc/source/invocation_adapterfactory/iafactory.cxx |4 +-
 stoc/source/javavm/javavm.cxx   |   28 ++
 stoc/source/servicemanager/servicemanager.cxx   |   31 +++-
 stoc/test/testconv.cxx  |4 +-
 5 files changed, 14 insertions(+), 60 deletions(-)

New commits:
commit 31bddb874d2be54b81cdd7ea142b58db18e11a5b
Author: Rohan Kumar 
Date:   Tue Mar 8 23:41:03 2016 +0530

tdf#91794 removed OSL_DEBUG_LEVEL > 1 conditionals

I removed all the OSL_DEBUG_LEVEL > 1 conditionals by SAL_INFOs
or OSL_DEBUG_LEVEL > 0

Change-Id: I261644a179e763612204bbb0e54a869fa1a62298
Reviewed-on: https://gerrit.libreoffice.org/23035
Tested-by: Jenkins 
Reviewed-by: Björn Michaelsen 

diff --git a/stoc/source/corereflection/crefl.cxx 
b/stoc/source/corereflection/crefl.cxx
index 3304233..d0e9e8c 100644
--- a/stoc/source/corereflection/crefl.cxx
+++ b/stoc/source/corereflection/crefl.cxx
@@ -210,12 +210,7 @@ inline Reference< XIdlClass > 
IdlReflectionServiceImpl::constructClass(
 return new IdlClassImpl( this, pTypeDescr->pTypeName, 
pTypeDescr->eTypeClass, pTypeDescr );
 
 default:
-#if OSL_DEBUG_LEVEL > 1
-OSL_TRACE( "### corereflection type unsupported: " );
-OString aName( OUStringToOString( pTypeDescr->pTypeName, 
RTL_TEXTENCODING_ASCII_US ) );
-OSL_TRACE( "%s", aName.getStr() );
-OSL_TRACE( "\n" );
-#endif
+SAL_INFO("stoc", " corereflection type unsupported: " << 
pTypeDescr->pTypeName);
 return Reference< XIdlClass >();
 }
 }
diff --git a/stoc/source/invocation_adapterfactory/iafactory.cxx 
b/stoc/source/invocation_adapterfactory/iafactory.cxx
index 4ed0b8f..e40e8b7 100644
--- a/stoc/source/invocation_adapterfactory/iafactory.cxx
+++ b/stoc/source/invocation_adapterfactory/iafactory.cxx
@@ -756,8 +756,8 @@ FactoryImpl::~FactoryImpl()
 
 (*m_pConverter->release)( m_pConverter );
 
-#if OSL_DEBUG_LEVEL > 1
-OSL_ENSURE( m_receiver2adapters.empty(), "### still adapters out there!?" 
);
+#if OSL_DEBUG_LEVEL > 0
+assert(m_receiver2adapters.empty() && " still adapters out there!?");
 #endif
 }
 
diff --git a/stoc/source/javavm/javavm.cxx b/stoc/source/javavm/javavm.cxx
index 290198c..c81fe0c 100644
--- a/stoc/source/javavm/javavm.cxx
+++ b/stoc/source/javavm/javavm.cxx
@@ -500,24 +500,14 @@ void initVMConfiguration(
 getINetPropsFromConfig(, xSMgr, xCtx);
 }
 catch(const css::uno::Exception & exception) {
-#if OSL_DEBUG_LEVEL > 1
-OString message = OUStringToOString(exception.Message, 
RTL_TEXTENCODING_ASCII_US);
-OSL_TRACE("javavm.cxx: can not get INetProps cause of >%s<", 
message.getStr());
-#else
-(void) exception; // unused
-#endif
+SAL_INFO("stoc", " can not get INETProps because of >" << 
exception.Message << "<");
 }
 
 try {
 getDefaultLocaleFromConfig(, xSMgr,xCtx);
 }
 catch(const css::uno::Exception & exception) {
-#if OSL_DEBUG_LEVEL > 1
-OString message = OUStringToOString(exception.Message, 
RTL_TEXTENCODING_ASCII_US);
-OSL_TRACE("javavm.cxx: can not get locale cause of >%s<", 
message.getStr());
-#else
-(void) exception; // unused
-#endif
+SAL_INFO("stoc", "can not get locale because of >" << 
exception.Message << "<");
 }
 
 try
@@ -525,12 +515,7 @@ void initVMConfiguration(
 getJavaPropsFromSafetySettings(, xSMgr, xCtx);
 }
 catch(const css::uno::Exception & exception) {
-#if OSL_DEBUG_LEVEL > 1
-OString message = OUStringToOString(exception.Message, 
RTL_TEXTENCODING_ASCII_US);
-OSL_TRACE("javavm.cxx: couldn't get safety settings because of >%s<", 
message.getStr());
-#else
-(void) exception; // unused
-#endif
+SAL_INFO("stoc", "couldn't get safety settings because of >" << 
exception.Message << "<");
 }
 
 *pjvm= jvm;
@@ -1366,12 +1351,7 @@ void JavaVirtualMachine::registerConfigChangesListener()
 }
 }catch(const css::uno::Exception & e)
 {
-#if OSL_DEBUG_LEVEL > 1
-OString message = OUStringToOString(e.Message, 
RTL_TEXTENCODING_ASCII_US);
-OSL_TRACE("javavm.cxx: could not set up listener for Configuration 
because of >%s<", message.getStr());
-#else
-(void) e; // unused
-#endif
+SAL_INFO("stoc", "could not set up listener for Configuration because 
of >" << e.Message << "<");
 }
 }
 
diff --git a/stoc/source/servicemanager/servicemanager.cxx 
b/stoc/source/servicemanager/servicemanager.cxx
index 861e73f..55c2c9b1 100644
--- a/stoc/source/servicemanager/servicemanager.cxx
+++ b/stoc/source/servicemanager/servicemanager.cxx
@@ -698,12 +698,7 @@ void OServiceManager::disposing()
 }
 catch (const RuntimeException & exc)
 {
-#if 

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

2016-03-07 Thread Caolán McNamara
 stoc/source/inspect/introspection.cxx |   21 +++--
 1 file changed, 7 insertions(+), 14 deletions(-)

New commits:
commit 5d58e77317c80d1e2002a9f81b7eab419df11bce
Author: Caolán McNamara 
Date:   Mon Mar 7 13:55:10 2016 +

coverity#1353440 try and refactor to avoid Argument cannot be negative

Change-Id: I3a75e27ba1b721a99e0547b418df883e2c1753b4

diff --git a/stoc/source/inspect/introspection.cxx 
b/stoc/source/inspect/introspection.cxx
index 0148540..1fff94f 100644
--- a/stoc/source/inspect/introspection.cxx
+++ b/stoc/source/inspect/introspection.cxx
@@ -308,7 +308,6 @@ sal_Int32 IntrospectionAccessStatic_Impl::getMethodIndex( 
const OUString& aMetho
 }
 
 // #95159 Check if full qualified name matches
-sal_Int32 iHashResult = -1;
 sal_Int32 nSearchFrom = aMethodName.getLength();
 while( true )
 {
@@ -332,19 +331,17 @@ sal_Int32 IntrospectionAccessStatic_Impl::getMethodIndex( 
const OUString& aMetho
 // If this is a valid class it could be the right method
 
 // Could be the right method, type has to be checked
-iHashResult = aIt->second;
+const sal_Int32 iHashResult = aIt->second;
 
-const Reference xMethod = 
maAllMethodSeq.at(iHashResult);
+const Reference xMethod = 
maAllMethodSeq[iHashResult];
 
 Reference< XIdlClass > xMethClass = 
xMethod->getDeclaringClass();
 if( xClass->equals( xMethClass ) )
 {
-break;
+return iHashResult;
 }
 else
 {
-iHashResult = -1;
-
 // Could also be another method with the same name
 // Iterate over all methods
 size_t nLen = maAllMethodSeq.size();
@@ -357,14 +354,10 @@ sal_Int32 IntrospectionAccessStatic_Impl::getMethodIndex( 
const OUString& aMetho
 
 if( xClass->equals( xMethClass2 ) )
 {
-iHashResult = i;
-break;
+return i;
 }
 }
 }
-
-if( iHashResult != -1 )
-break;
 }
 }
 }
@@ -373,7 +366,7 @@ sal_Int32 IntrospectionAccessStatic_Impl::getMethodIndex( 
const OUString& aMetho
 if( nSearchFrom < 0 )
 break;
 }
-return iHashResult;
+return -1;
 }
 
 void IntrospectionAccessStatic_Impl::setPropertyValue( const Any& obj, const 
OUString& aPropertyName, const Any& aValue ) const
@@ -2378,7 +2371,7 @@ css::uno::Reference 
Implementation::inspect(
 {
 sal_Int32 iHashResult = aIt->second;
 
-Reference xExistingMethod = 
pAccess->maAllMethodSeq.at(iHashResult);
+Reference xExistingMethod = 
pAccess->maAllMethodSeq[iHashResult];
 
 Reference< XIdlClass > xExistingMethClass =
 xExistingMethod->getDeclaringClass();
@@ -2387,7 +2380,7 @@ css::uno::Reference 
Implementation::inspect(
 continue;
 }
 
-pAccess->maAllMethodSeq.at(iAllExportedMethod) = 
rxMethod;
+pAccess->maAllMethodSeq[iAllExportedMethod] = 
rxMethod;
 
 // If a concept has been set, is the method 
"normal"?
 sal_Int32& rMethodConcept_i = 
pLocalMethodConcepts[ i ];
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2016-03-07 Thread Caolán McNamara
 stoc/source/inspect/introspection.cxx |   14 +++---
 1 file changed, 7 insertions(+), 7 deletions(-)

New commits:
commit 7c5955d858f3d92cd3be2411d0b13919e5d5ab98
Author: Caolán McNamara 
Date:   Mon Mar 7 13:01:01 2016 +

!(==) -> !=

Change-Id: Ie1c3c61dea2052e85179157e3e0b6c07dd60bb48

diff --git a/stoc/source/inspect/introspection.cxx 
b/stoc/source/inspect/introspection.cxx
index 67a7095..2393dd7 100644
--- a/stoc/source/inspect/introspection.cxx
+++ b/stoc/source/inspect/introspection.cxx
@@ -293,7 +293,7 @@ sal_Int32 IntrospectionAccessStatic_Impl::getPropertyIndex( 
const OUString& aPro
 sal_Int32 iHashResult = -1;
 IntrospectionAccessStatic_Impl* pThis = 
const_cast(this);
 IntrospectionNameMap::iterator aIt = pThis->maPropertyNameMap.find( 
aPropertyName );
-if( !( aIt == pThis->maPropertyNameMap.end() ) )
+if (aIt != pThis->maPropertyNameMap.end())
 iHashResult = (*aIt).second;
 return iHashResult;
 }
@@ -303,7 +303,7 @@ sal_Int32 IntrospectionAccessStatic_Impl::getMethodIndex( 
const OUString& aMetho
 sal_Int32 iHashResult = -1;
 IntrospectionAccessStatic_Impl* pThis = 
const_cast(this);
 IntrospectionNameMap::iterator aIt = pThis->maMethodNameMap.find( 
aMethodName );
-if( !( aIt == pThis->maMethodNameMap.end() ) )
+if (aIt != pThis->maMethodNameMap.end())
 {
 iHashResult = (*aIt).second;
 }
@@ -321,7 +321,7 @@ sal_Int32 IntrospectionAccessStatic_Impl::getMethodIndex( 
const OUString& aMetho
 OUString aPureMethodName = aMethodName.copy( nFound + 1 );
 
 aIt = pThis->maMethodNameMap.find( aPureMethodName );
-if( !( aIt == pThis->maMethodNameMap.end() ) )
+if (aIt != pThis->maMethodNameMap.end())
 {
 // Check if it can be a type?
 // Problem: Does not work if package names contain _ ?!
@@ -1539,7 +1539,7 @@ OUString ImplIntrospectionAccess::getExactName( const 
OUString& rApproximateName
 OUString aRetStr;
 LowerToExactNameMap::iterator aIt =
 mpStaticImpl->maLowerToExactNameMap.find( 
rApproximateName.toAsciiLowerCase() );
-if( !( aIt == mpStaticImpl->maLowerToExactNameMap.end() ) )
+if (aIt != mpStaticImpl->maLowerToExactNameMap.end())
 aRetStr = (*aIt).second;
 return aRetStr;
 }
@@ -1923,7 +1923,7 @@ css::uno::Reference 
Implementation::inspect(
 
 // Do we have the name already?
 IntrospectionNameMap::iterator aIt = 
rPropNameMap.find( aPropName );
-if( !( aIt == rPropNameMap.end() ) )
+if (aIt != rPropNameMap.end())
 continue;
 
 // New entry in the hash table
@@ -2097,7 +2097,7 @@ css::uno::Reference 
Implementation::inspect(
 
 // Do we have the name already?
 IntrospectionNameMap::iterator aIt = 
rPropNameMap.find( aPropName );
-if( !( aIt == rPropNameMap.end() ) )
+if (aIt != rPropNameMap.end())
 {
 /* TODO
OSL_TRACE(
@@ -2286,7 +2286,7 @@ css::uno::Reference 
Implementation::inspect(
 
 // Do we have the name already?
 IntrospectionNameMap::iterator aIt = 
rPropNameMap.find( aPropName );
-if( !( aIt == rPropNameMap.end() ) )
+if (aIt != rPropNameMap.end())
 {
 /* TODO:
OSL_TRACE(
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2016-02-20 Thread Caolán McNamara
 stoc/source/inspect/introspection.cxx |   10 +-
 1 file changed, 5 insertions(+), 5 deletions(-)

New commits:
commit f92f7efead4d6d41955a3e14aa2fc20f95ac
Author: Caolán McNamara 
Date:   Sat Feb 20 20:17:51 2016 +

coverity#1353440 Argument cannot be negative

Change-Id: I0576264c006a70a6783e31fb77b380928558cf45

diff --git a/stoc/source/inspect/introspection.cxx 
b/stoc/source/inspect/introspection.cxx
index 80e742d..67a7095 100644
--- a/stoc/source/inspect/introspection.cxx
+++ b/stoc/source/inspect/introspection.cxx
@@ -335,7 +335,7 @@ sal_Int32 IntrospectionAccessStatic_Impl::getMethodIndex( 
const OUString& aMetho
 // Could be the right method, type has to be checked
 iHashResult = (*aIt).second;
 
-const Reference xMethod = maAllMethodSeq[ 
iHashResult ];
+const Reference xMethod = 
maAllMethodSeq.at(iHashResult);
 
 Reference< XIdlClass > xMethClass = 
xMethod->getDeclaringClass();
 if( xClass->equals( xMethClass ) )
@@ -348,8 +348,8 @@ sal_Int32 IntrospectionAccessStatic_Impl::getMethodIndex( 
const OUString& aMetho
 
 // Could also be another method with the same name
 // Iterate over all methods
-sal_Int32 nLen = (sal_Int32)maAllMethodSeq.size();
-for( int i = 0 ; i < nLen ; ++i )
+size_t nLen = maAllMethodSeq.size();
+for (size_t i = 0; i < nLen; ++i)
 {
 const Reference xMethod2 = 
maAllMethodSeq[ i ];
 if( xMethod2->getName() == aPureMethodName )
@@ -2380,7 +2380,7 @@ css::uno::Reference 
Implementation::inspect(
 {
 sal_Int32 iHashResult = (*aIt).second;
 
-Reference xExistingMethod = 
pAccess->maAllMethodSeq[ iHashResult ];
+Reference xExistingMethod = 
pAccess->maAllMethodSeq.at(iHashResult);
 
 Reference< XIdlClass > xExistingMethClass =
 xExistingMethod->getDeclaringClass();
@@ -2389,7 +2389,7 @@ css::uno::Reference 
Implementation::inspect(
 continue;
 }
 
-pAccess->maAllMethodSeq[ iAllExportedMethod ] = 
rxMethod;
+pAccess->maAllMethodSeq.at(iAllExportedMethod) = 
rxMethod;
 
 // If a concept has been set, is the method 
"normal"?
 sal_Int32& rMethodConcept_i = 
pLocalMethodConcepts[ i ];
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2016-02-18 Thread Tor Lillqvist
 stoc/source/javavm/javavm.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit cf6cbd29fdeba54bd83a87c1165d49312dc2d2a6
Author: Tor Lillqvist 
Date:   Thu Feb 18 10:06:38 2016 +0200

WaE: replace OUString constructed from a string literal directly ...

... with the string literal [loplugin:stringconstant]

Change-Id: I38fff65c8b5da320ad82419f5c7b46f35da2aa62

diff --git a/stoc/source/javavm/javavm.cxx b/stoc/source/javavm/javavm.cxx
index 64b55f7..918707f 100644
--- a/stoc/source/javavm/javavm.cxx
+++ b/stoc/source/javavm/javavm.cxx
@@ -540,7 +540,7 @@ void initVMConfiguration(
 // java-side force look and feel to something that doesn't
 // crash when we are using gtk3
 if (getenv("STOC_FORCE_SYSTEM_LAF"))
-
pjvm->pushProp(OUString("swing.systemlaf=javax.swing.plaf.metal.MetalLookAndFeel"));
+
pjvm->pushProp("swing.systemlaf=javax.swing.plaf.metal.MetalLookAndFeel");
 
 setTimeZone(pjvm);
 }
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: stoc/source vcl/unx

2016-02-17 Thread Caolán McNamara
 stoc/source/javavm/javavm.cxx |9 -
 vcl/unx/gtk/gtksys.cxx|7 +++
 2 files changed, 15 insertions(+), 1 deletion(-)

New commits:
commit 9f7f881d11ceb4e2534758b9507a55292ec697b0
Author: Caolán McNamara 
Date:   Wed Feb 17 16:09:01 2016 +

Resolves: rhbz#1285356 force swing not to use gtk2 if gtk3 is loaded

Change-Id: I6347bf4c25ce649073afdfe4225182ab2dc84af1
Reviewed-on: https://gerrit.libreoffice.org/22433
Tested-by: Jenkins 
Reviewed-by: Chris Sherlock 

diff --git a/stoc/source/javavm/javavm.cxx b/stoc/source/javavm/javavm.cxx
index c7a061c..64b55f7 100644
--- a/stoc/source/javavm/javavm.cxx
+++ b/stoc/source/javavm/javavm.cxx
@@ -534,8 +534,15 @@ void initVMConfiguration(
 }
 
 *pjvm= jvm;
-setTimeZone(pjvm);
 
+// rhbz#1285356, native look will be gtk2, which crashes
+// when gtk3 is already loaded. Until there is a solution
+// java-side force look and feel to something that doesn't
+// crash when we are using gtk3
+if (getenv("STOC_FORCE_SYSTEM_LAF"))
+
pjvm->pushProp(OUString("swing.systemlaf=javax.swing.plaf.metal.MetalLookAndFeel"));
+
+setTimeZone(pjvm);
 }
 
 class DetachCurrentThread: private boost::noncopyable {
diff --git a/vcl/unx/gtk/gtksys.cxx b/vcl/unx/gtk/gtksys.cxx
index 80153fe..97f2464 100644
--- a/vcl/unx/gtk/gtksys.cxx
+++ b/vcl/unx/gtk/gtksys.cxx
@@ -40,6 +40,13 @@ GtkSalSystem::GtkSalSystem() : SalGenericSystem()
 {
 mpDisplay = gdk_display_get_default();
 countScreenMonitors();
+#if GTK_CHECK_VERSION(3,0,0)
+// rhbz#1285356, native look will be gtk2, which crashes
+// when gtk3 is already loaded. Until there is a solution
+// java-side force look and feel to something that doesn't
+// crash when we are using gtk3
+setenv("STOC_FORCE_SYSTEM_LAF", "true", 1);
+#endif
 }
 
 GtkSalSystem::~GtkSalSystem()
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2016-02-15 Thread Noel Grandin
 stoc/source/inspect/introspection.cxx |  302 ++
 1 file changed, 130 insertions(+), 172 deletions(-)

New commits:
commit 045ec6aa6241939e402594e6f69b7d8fb1560717
Author: Noel Grandin 
Date:   Mon Dec 21 09:56:08 2015 +0200

uno::Sequence->std::vector in stoc/introspection

Change-Id: I6427bc26d77e4ace2a827b9ae81716d62b5050ba

diff --git a/stoc/source/inspect/introspection.cxx 
b/stoc/source/inspect/introspection.cxx
index 9483a14..80e742d 100644
--- a/stoc/source/inspect/introspection.cxx
+++ b/stoc/source/inspect/introspection.cxx
@@ -38,6 +38,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 
 #include 
@@ -167,22 +168,22 @@ class IntrospectionAccessStatic_Impl: public 
salhelper::SimpleReferenceObject
 
 // InterfaceSequences, to save additional information in a property
 // for example the Field at MAP_FIELD, the get/set-Methods at MAP_GETSET, 
et cetera
-Sequence< Reference > aInterfaceSeq1;
-Sequence< Reference > aInterfaceSeq2;
+std::vector< Reference > aInterfaceSeq1;
+std::vector< Reference > aInterfaceSeq2;
 
 // Hashtables for names
 IntrospectionNameMap maPropertyNameMap;
 IntrospectionNameMap maMethodNameMap;
 LowerToExactNameMap  maLowerToExactNameMap;
 
-// Sequence of all Properties, also for delivering from getProperties()
-Sequence maAllPropertySeq;
+// Vector of all Properties, also for delivering from getProperties()
+std::vector maAllPropertySeq;
 
 // Mapping of properties to Access-Types
-Sequence maMapTypeSeq;
+std::vector maMapTypeSeq;
 
 // Classification of found methods
-Sequence maPropertyConceptSeq;
+std::vector maPropertyConceptSeq;
 
 // Number of Properties
 sal_Int32 mnPropCount;
@@ -210,26 +211,20 @@ class IntrospectionAccessStatic_Impl: public 
salhelper::SimpleReferenceObject
 sal_Int32* mpOrgPropertyHandleArray;
 
 // MethodSequence, that accepts all methods
-Sequence< Reference > maAllMethodSeq;
+std::vector< Reference > maAllMethodSeq;
 
 // Classification of found methods
-Sequence maMethodConceptSeq;
+std::vector maMethodConceptSeq;
 
 // Number of methods
 sal_Int32 mnMethCount;
 
 // Sequence of Listener, that can be registered
-Sequence< Type > maSupportedListenerSeq;
+std::vector< Type > maSupportedListenerSeq;
 
 // Helper-methods for adjusting sizes of Sequences
-void checkPropertyArraysSize
-(
-Property*& rpAllPropArray,
-sal_Int16*& rpMapTypeArray,
-sal_Int32*& rpPropertyConceptArray,
-sal_Int32 iNextIndex
-);
-static void checkInterfaceArraySize( Sequence< Reference >& 
rSeq, Reference*& rpInterfaceArray,
+void checkPropertyArraysSize( sal_Int32 iNextIndex );
+static void checkInterfaceArraySize( std::vector< Reference >& 
rSeq, std::vector& rInterfaceVec,
 sal_Int32 iNextIndex );
 
 public:
@@ -249,11 +244,11 @@ public:
 //void setPropertyValueByIndex(Any& obj, sal_Int32 nIndex, const Any& 
aValue) const;
 Any getPropertyValueByIndex(const Any& obj, sal_Int32 nIndex) const;
 
-Sequence getProperties() const{ return 
maAllPropertySeq; }
-Sequence< Reference > getMethods() const{ return 
maAllMethodSeq; }
-Sequence< Type > getSupportedListeners() const{ return 
maSupportedListenerSeq; }
-Sequence getPropertyConcepts() const{ 
return maPropertyConceptSeq; }
-Sequence getMethodConcepts() const{ return 
maMethodConceptSeq; }
+const std::vector& getProperties() const  { return 
maAllPropertySeq; }
+const std::vector< Reference >& getMethods() const  { return 
maAllMethodSeq; }
+const std::vector< Type >& getSupportedListeners() const{ return 
maSupportedListenerSeq; }
+const std::vector& getPropertyConcepts() const   { return 
maPropertyConceptSeq; }
+const std::vector& getMethodConcepts() const { return 
maMethodConceptSeq; }
 };
 
 
@@ -261,13 +256,13 @@ public:
 IntrospectionAccessStatic_Impl::IntrospectionAccessStatic_Impl( Reference< 
XIdlReflection > xCoreReflection_ )
 : mxCoreReflection( xCoreReflection_ )
 {
-aInterfaceSeq1.realloc( ARRAY_SIZE_STEP );
-aInterfaceSeq2.realloc( ARRAY_SIZE_STEP );
+aInterfaceSeq1.resize( ARRAY_SIZE_STEP );
+aInterfaceSeq2.resize( ARRAY_SIZE_STEP );
 
 // Property-Data
-maAllPropertySeq.realloc( ARRAY_SIZE_STEP );
-maMapTypeSeq.realloc( ARRAY_SIZE_STEP );
-maPropertyConceptSeq.realloc( ARRAY_SIZE_STEP );
+maAllPropertySeq.resize( ARRAY_SIZE_STEP );
+maMapTypeSeq.resize( ARRAY_SIZE_STEP );
+maPropertyConceptSeq.resize( ARRAY_SIZE_STEP );
 
 mbFastPropSet = false;
 mbElementAccess = false;
@@ -340,8 +335,7 @@ sal_Int32 IntrospectionAccessStatic_Impl::getMethodIndex( 
const OUString& aMetho
 

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

2015-12-20 Thread Oliver Specht
 stoc/source/inspect/introspection.cxx |   16 +---
 1 file changed, 1 insertion(+), 15 deletions(-)

New commits:
commit 7b02cfef9507dd2f0e9bec61bb5b78b75dc852e9
Author: Oliver Specht 
Date:   Fri Dec 18 15:39:50 2015 +0100

tdf#96223: introspection queries for XPropertySet again

this patch removes the search by name for css::beans::XPropertySet because
that fails if that is indirectly inherited e.g. with 
css::util::XSearchDescriptor

Change-Id: I7f40b1d109d9bddc0987bea8eb3eda5b7f19
Reviewed-on: https://gerrit.libreoffice.org/20792
Tested-by: Jenkins 
Reviewed-by: Oliver Specht 

diff --git a/stoc/source/inspect/introspection.cxx 
b/stoc/source/inspect/introspection.cxx
index 65bb0ff..9f43c8c 100644
--- a/stoc/source/inspect/introspection.cxx
+++ b/stoc/source/inspect/introspection.cxx
@@ -1766,29 +1766,15 @@ css::uno::Reference 
Implementation::inspect(
 if( xTypeProvider.is() )
 {
 SupportedTypesSeq = xTypeProvider->getTypes();
-sal_Int32 nTypeCount = SupportedTypesSeq.getLength();
-if( nTypeCount )
-{
-const Type* pTypes = SupportedTypesSeq.getConstArray();
-for( sal_Int32 i = 0 ; i < nTypeCount ; i++ )
-{
-if( pTypes[i].getTypeName() == 
"com.sun.star.beans.XPropertySet" )
-{
-xPropSet.set( x, UNO_QUERY );
-break;
-}
-}
-}
 } else {
 SAL_WARN(
 "stoc",
 "object of type \"" << aToInspectObj.getValueTypeName()
 << "\" lacks XTypeProvider");
 SupportedTypesSeq = Sequence((), 
1);
-xPropSet.set( x, UNO_QUERY );
 }
-
 // Now try to get the PropertySetInfo
+xPropSet.set( x, UNO_QUERY );
 if( xPropSet.is() )
 xPropSetInfo = xPropSet->getPropertySetInfo();
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2015-11-17 Thread Stephan Bergmann
 stoc/source/javavm/javavm.cxx |   38 +++---
 1 file changed, 19 insertions(+), 19 deletions(-)

New commits:
commit 602e942af6e493ce24b5266549a995c5d5a1148d
Author: Stephan Bergmann 
Date:   Tue Nov 17 10:41:39 2015 +0100

Don't assume sal_Unicode is unsigned short

Change-Id: If61f46cceff4e2d4fe49e77788516ef60ab6eb50

diff --git a/stoc/source/javavm/javavm.cxx b/stoc/source/javavm/javavm.cxx
index 1e158fa..64db8c8 100644
--- a/stoc/source/javavm/javavm.cxx
+++ b/stoc/source/javavm/javavm.cxx
@@ -1167,7 +1167,7 @@ void SAL_CALL JavaVirtualMachine::elementReplaced(
 jmethodID jmSetProps= pJNIEnv->GetStaticMethodID( jcSystem, 
"setProperty","(Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;");
 if(pJNIEnv->ExceptionOccurred()) throw 
css::uno::RuntimeException("JNI:GetStaticMethodID 
java.lang.System.setProperty", nullptr);
 
-jstring jsPropName= pJNIEnv->NewString( aPropertyName.getStr(), 
aPropertyName.getLength());
+jstring jsPropName= pJNIEnv->NewString( reinterpret_cast(aPropertyName.getStr()), aPropertyName.getLength());
 if(pJNIEnv->ExceptionOccurred()) throw 
css::uno::RuntimeException("JNI:NewString", nullptr);
 
 // remove the property if it does not have a value ( user left the 
dialog field empty)
@@ -1193,7 +1193,7 @@ void SAL_CALL JavaVirtualMachine::elementReplaced(
 // has a value for two java properties
 if (!aPropertyName2.isEmpty())
 {
-jstring jsPropName2= pJNIEnv->NewString( 
aPropertyName2.getStr(), aPropertyName2.getLength());
+jstring jsPropName2= pJNIEnv->NewString( 
reinterpret_cast(aPropertyName2.getStr()), 
aPropertyName2.getLength());
 if(pJNIEnv->ExceptionOccurred()) throw 
css::uno::RuntimeException("JNI:NewString", nullptr);
 pJNIEnv->CallObjectMethod( joProperties, jmRemove, 
jsPropName2);
 }
@@ -1201,7 +1201,7 @@ void SAL_CALL JavaVirtualMachine::elementReplaced(
 else
 {
 // Change the Value of the property
-jstring jsPropValue= pJNIEnv->NewString( 
aPropertyValue.getStr(), aPropertyValue.getLength());
+jstring jsPropValue= pJNIEnv->NewString( 
reinterpret_cast(aPropertyValue.getStr()), 
aPropertyValue.getLength());
 if(pJNIEnv->ExceptionOccurred()) throw 
css::uno::RuntimeException("JNI:NewString", nullptr);
 pJNIEnv->CallStaticObjectMethod( jcSystem, jmSetProps, 
jsPropName, jsPropValue);
 if(pJNIEnv->ExceptionOccurred()) throw 
css::uno::RuntimeException("JNI:CallStaticObjectMethod 
java.lang.System.setProperty", nullptr);
@@ -1210,9 +1210,9 @@ void SAL_CALL JavaVirtualMachine::elementReplaced(
 // has a value for two java properties
 if (!aPropertyName2.isEmpty())
 {
-jstring jsPropName2= pJNIEnv->NewString( 
aPropertyName2.getStr(), aPropertyName2.getLength());
+jstring jsPropName2= pJNIEnv->NewString( 
reinterpret_cast(aPropertyName2.getStr()), 
aPropertyName2.getLength());
 if(pJNIEnv->ExceptionOccurred()) throw 
css::uno::RuntimeException("JNI:NewString", nullptr);
-jsPropValue= pJNIEnv->NewString( aPropertyValue.getStr(), 
aPropertyValue.getLength());
+jsPropValue= pJNIEnv->NewString( reinterpret_cast(aPropertyValue.getStr()), aPropertyValue.getLength());
 if(pJNIEnv->ExceptionOccurred()) throw 
css::uno::RuntimeException("JNI:NewString", nullptr);
 pJNIEnv->CallStaticObjectMethod( jcSystem, jmSetProps, 
jsPropName2, jsPropValue);
 if(pJNIEnv->ExceptionOccurred()) throw 
css::uno::RuntimeException("JNI:CallStaticObjectMethod 
java.lang.System.setProperty", nullptr);
@@ -1244,7 +1244,7 @@ void SAL_CALL JavaVirtualMachine::elementReplaced(
 if(pJNIEnv->ExceptionOccurred()) throw 
css::uno::RuntimeException("JNI:GetMethodID java.lang.Class.getName", nullptr);
 jstring jsClass= 
static_cast(pJNIEnv->CallObjectMethod( jcSec, jmName));
 const jchar* jcharName= pJNIEnv->GetStringChars( jsClass, 
nullptr);
-OUString sName( jcharName);
+OUString sName(reinterpret_cast(jcharName));
 bool bIsSandbox;
 if ( sName == "com.sun.star.lib.sandbox.SandboxSecurity" )
 bIsSandbox= true;
@@ -1411,17 +1411,17 @@ void JavaVirtualMachine::setINetSettingsInVM(bool 
set_reset)
 OUString sHttpNonProxyHosts("http.nonProxyHosts");
 
 // create Java Properties as JNI strings
-jstring jsFtpProxyHost= pJNIEnv->NewString( 
sFtpProxyHost.getStr(), sFtpProxyHost.getLength());
+jstring 

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

2015-07-28 Thread David Ostrovsky
 stoc/source/javavm/javavm.cxx |3 +++
 1 file changed, 3 insertions(+)

New commits:
commit fb8d066368ffbbb1909a6d0b402c09248569c62e
Author: David Ostrovsky da...@ostrovsky.org
Date:   Mon Jul 27 08:15:10 2015 +0200

stoc: tzname is _tzname on MSVC 14.0

Change-Id: I899ed85dc86edceb83b262643f83d87edd4ba905
Reviewed-on: https://gerrit.libreoffice.org/17361
Tested-by: Jenkins c...@libreoffice.org
Reviewed-by: Michael Stahl mst...@redhat.com
Tested-by: Michael Stahl mst...@redhat.com

diff --git a/stoc/source/javavm/javavm.cxx b/stoc/source/javavm/javavm.cxx
index 46571c1..8e20fc2 100644
--- a/stoc/source/javavm/javavm.cxx
+++ b/stoc/source/javavm/javavm.cxx
@@ -484,6 +484,9 @@ static void setTimeZone(stoc_javavm::JVM * pjvm) throw() {
 tmData = localtime(clock);
 #ifdef MACOSX
 char * p = tmData-tm_zone;
+#elif defined(_MSC_VER)  _MSC_VER = 1900
+char * p = _tzname[0];
+(void)tmData;
 #else
 char * p = tzname[0];
 (void)tmData;
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2015-07-22 Thread Matthew J . Francis
 stoc/source/inspect/introspection.cxx |  238 ++
 stoc/source/invocation/invocation.cxx |   50 +++
 2 files changed, 128 insertions(+), 160 deletions(-)

New commits:
commit e412e16d56caf426bac04c7e5966e2a9efa7c408
Author: Matthew J. Francis mjay.fran...@gmail.com
Date:   Mon Jul 13 09:28:52 2015 +0800

Merge ImplIntrospectionAccess and ImplIntrospectionAdapter

This eliminates a lifecycle error which caused an instance
of ImplIntrospectionAdapter to be created on every failing
call to ImplIntrospectionAccess::queryAdapter(), rather than
only once, due to an incorrectly conceived weak reference
relationship between the two.

Change-Id: If0c7c906acadfd7f81a0ce9e7f7a949154494720
Reviewed-on: https://gerrit.libreoffice.org/16972
Reviewed-by: Matthew Francis mjay.fran...@gmail.com
Tested-by: Matthew Francis mjay.fran...@gmail.com

diff --git a/stoc/source/inspect/introspection.cxx 
b/stoc/source/inspect/introspection.cxx
index a74a729..cd621b8 100644
--- a/stoc/source/inspect/introspection.cxx
+++ b/stoc/source/inspect/introspection.cxx
@@ -35,7 +35,7 @@
 #include cppuhelper/weak.hxx
 #include cppuhelper/component.hxx
 #include cppuhelper/factory.hxx
-#include cppuhelper/implbase3.hxx
+#include cppuhelper/implbase.hxx
 #include cppuhelper/supportsservice.hxx
 #include cppuhelper/typeprovider.hxx
 #include salhelper/simplereferenceobject.hxx
@@ -83,7 +83,10 @@ using namespace osl;
 namespace
 {
 
-typedef WeakImplHelper3 XIntrospectionAccess, XMaterialHolder, XExactName  
IntrospectionAccessHelper;
+typedef WeakImplHelper XIntrospectionAccess, XMaterialHolder, XExactName,
+XPropertySet, XFastPropertySet, XPropertySetInfo,
+XNameContainer, XIndexContainer, XEnumerationAccess,
+XIdlArray  IntrospectionAccessHelper;
 
 
 
@@ -162,7 +165,6 @@ class IntrospectionAccessStatic_Impl: public 
salhelper::SimpleReferenceObject
 {
 friend class Implementation;
 friend class ImplIntrospectionAccess;
-friend class ImplIntrospectionAdapter;
 
 // Holding CoreReflection
 Reference XIdlReflection  mxCoreReflection;
@@ -700,9 +702,6 @@ class ImplIntrospectionAccess : public 
IntrospectionAccessHelper
 // Static introspection data
 rtl::Reference IntrospectionAccessStatic_Impl  mpStaticImpl;
 
-// Adapter-Implementation
-WeakReference XInterface  maAdapter;
-
 // Last Sequence that came with getProperties (optimization)
 SequenceProperty maLastPropertySeq;
 sal_Int32 mnLastPropertyConcept;
@@ -711,6 +710,26 @@ class ImplIntrospectionAccess : public 
IntrospectionAccessHelper
 SequenceReferenceXIdlMethod  maLastMethodSeq;
 sal_Int32 mnLastMethodConcept;
 
+// Guards the caching of queried interfaces
+osl::Mutex m_aMutex;
+
+// Original interfaces of the objects
+ReferenceXElementAccess   mxObjElementAccess;
+ReferenceXNameContainer   mxObjNameContainer;
+ReferenceXNameAccess  mxObjNameAccess;
+ReferenceXIndexAccess mxObjIndexAccess;
+ReferenceXIndexContainer  mxObjIndexContainer;
+ReferenceXEnumerationAccess   mxObjEnumerationAccess;
+ReferenceXIdlArraymxObjIdlArray;
+
+ReferenceXElementAccess   getXElementAccess();
+ReferenceXNameContainer   getXNameContainer();
+ReferenceXNameAccess  getXNameAccess();
+ReferenceXIndexContainer  getXIndexContainer();
+ReferenceXIndexAccess getXIndexAccess();
+ReferenceXEnumerationAccess   getXEnumerationAccess();
+ReferenceXIdlArraygetXIdlArray();
+
 public:
 ImplIntrospectionAccess( const Any obj, rtl::Reference 
IntrospectionAccessStatic_Impl  const  pStaticImpl_ );
 virtual ~ImplIntrospectionAccess();
@@ -743,75 +762,6 @@ public:
 
 // Methods from XExactName
 virtual OUString SAL_CALL getExactName( const OUString rApproximateName ) 
throw( RuntimeException, std::exception ) SAL_OVERRIDE;
-};
-
-ImplIntrospectionAccess::ImplIntrospectionAccess
-( const Any obj, rtl::Reference IntrospectionAccessStatic_Impl  const  
pStaticImpl_ )
-: maInspectedObject( obj ), mpStaticImpl( pStaticImpl_ ), maAdapter()
-{
-// Remember object as interface if possible
-TypeClass eType = maInspectedObject.getValueType().getTypeClass();
-if( eType == TypeClass_INTERFACE )
-mxIface = *static_castReferenceXInterface const 
*(maInspectedObject.getValue());
-
-mnLastPropertyConcept = -1;
-mnLastMethodConcept = -1;
-}
-
-ImplIntrospectionAccess::~ImplIntrospectionAccess()
-{
-}
-
-
-
-//*** ImplIntrospectionAdapter ***
-
-
-// New Impl class as part of the introspection conversion to instance-bound
-// Introspection with property access via XPropertySet. The old class
-// ImplIntrospectionAccess lives on as IntrospectionAccessStatic_Impl
-class ImplIntrospectionAdapter :
-public XPropertySet, public 

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

2015-07-22 Thread Matthew J . Francis
 stoc/source/inspect/introspection.cxx |  113 ++
 1 file changed, 22 insertions(+), 91 deletions(-)

New commits:
commit a37df351c447373bb893ba154bd124d33e43c040
Author: Matthew J. Francis mjay.fran...@gmail.com
Date:   Fri Jul 10 15:29:22 2015 +0800

Fix logic in the fast path of Implementation::inspect()

- Merge TypeCache and ClassCache
- Don't fill SupportedClassSeq before the fast exit for a
  cache hit
- Do query XPropertySet blind in the degenerate interface case

Change-Id: I3fd8ab4a215f4c217e1a687af679aef4a21b68b9
Reviewed-on: https://gerrit.libreoffice.org/16921
Reviewed-by: Matthew Francis mjay.fran...@gmail.com
Tested-by: Matthew Francis mjay.fran...@gmail.com

diff --git a/stoc/source/inspect/introspection.cxx 
b/stoc/source/inspect/introspection.cxx
index 497d9e2..a74a729 100644
--- a/stoc/source/inspect/introspection.cxx
+++ b/stoc/source/inspect/introspection.cxx
@@ -197,7 +197,6 @@ class IntrospectionAccessStatic_Impl: public 
salhelper::SimpleReferenceObject
 
 // Flags which indicate if various interfaces are present
 bool mbFastPropSet;
-bool mbPropertySet;
 bool mbElementAccess;
 bool mbNameAccess;
 bool mbNameContainer;
@@ -270,7 +269,6 @@ 
IntrospectionAccessStatic_Impl::IntrospectionAccessStatic_Impl( Reference XIdlR
 maPropertyConceptSeq.realloc( ARRAY_SIZE_STEP );
 
 mbFastPropSet = false;
-mbPropertySet = false;
 mbElementAccess = false;
 mbNameAccess = false;
 mbNameContainer = false;
@@ -1499,55 +1497,6 @@ OUString ImplIntrospectionAccess::getExactName( const 
OUString rApproximateName
 return aRetStr;
 }
 
-struct ClassKey {
-ClassKey(
-css::uno::Referencecss::beans::XPropertySetInfo const  
theProperties,
-css::uno::Referencecss::reflection::XIdlClass const 
-theImplementation,
-css::uno::Sequence css::uno::Referencecss::reflection::XIdlClass 
-const  theClasses):
-properties(theProperties), implementation(theImplementation),
-classes(theClasses)
-{}
-
-css::uno::Referencecss::beans::XPropertySetInfo properties;
-css::uno::Referencecss::reflection::XIdlClass implementation;
-css::uno::Sequence css::uno::Referencecss::reflection::XIdlClass 
-classes;
-};
-
-struct ClassKeyLess {
-bool operator ()(ClassKey const  key1, ClassKey const  key2) const {
-if (key1.properties.get()  key2.properties.get()) {
-return true;
-}
-if (key1.properties.get()  key2.properties.get()) {
-return false;
-}
-if (key1.implementation.get()  key2.implementation.get()) {
-return true;
-}
-if (key1.implementation.get()  key2.implementation.get()) {
-return false;
-}
-if (key1.classes.getLength()  key2.classes.getLength()) {
-return true;
-}
-if (key1.classes.getLength()  key2.classes.getLength()) {
-return false;
-}
-for (sal_Int32 i = 0; i != key1.classes.getLength(); ++i) {
-if (key1.classes[i].get()  key2.classes[i].get()) {
-return true;
-}
-if (key1.classes[i].get()  key2.classes[i].get()) {
-return false;
-}
-}
-return false;
-}
-};
-
 struct TypeKey {
 TypeKey(
 css::uno::Referencecss::beans::XPropertySetInfo const  
theProperties,
@@ -1653,7 +1602,6 @@ private:
 virtual void SAL_CALL disposing() SAL_OVERRIDE {
 osl::MutexGuard g(m_aMutex);
 reflection_.clear();
-classCache_.clear();
 typeCache_.clear();
 }
 
@@ -1679,7 +1627,6 @@ private:
 throw (css::uno::RuntimeException, std::exception) SAL_OVERRIDE;
 
 css::uno::Referencecss::reflection::XIdlReflection reflection_;
-CacheClassKey, ClassKeyLess classCache_;
 CacheTypeKey, TypeKeyLess typeCache_;
 };
 
@@ -1731,10 +1678,8 @@ css::uno::Referencecss::beans::XIntrospectionAccess 
Implementation::inspect(
 Sequence ReferenceXIdlClass SupportedClassSeq;
 Sequence Type SupportedTypesSeq;
 ReferenceXTypeProviderxTypeProvider;
-ReferenceXIdlClassxImplClass;
 ReferenceXPropertySetInfoxPropSetInfo;
 ReferenceXPropertySetxPropSet;
-boolbHasPropertySet = false;
 
 // Look for interfaces XTypeProvider and PropertySet
 if( eType == TypeClass_INTERFACE )
@@ -1746,66 +1691,46 @@ css::uno::Referencecss::beans::XIntrospectionAccess 
Implementation::inspect(
 sal_Int32 nTypeCount = SupportedTypesSeq.getLength();
 if( nTypeCount )
 {
-SupportedClassSeq.realloc( nTypeCount );
-ReferenceXIdlClass* pClasses = SupportedClassSeq.getArray();
-
 const Type* pTypes = 

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

2015-07-15 Thread Matthew J . Francis
 stoc/source/inspect/introspection.cxx |  469 --
 stoc/source/invocation/invocation.cxx |   26 -
 2 files changed, 247 insertions(+), 248 deletions(-)

New commits:
commit 80cbfb75026f4673b14237650302c3da1cc5ab13
Author: Matthew J. Francis mjay.fran...@gmail.com
Date:   Thu Jul 16 13:37:15 2015 +0800

Translate German comments

Change-Id: I1d1c66fb2c62a3c6e0c65c2b89efcd8bfd2b87cd

diff --git a/stoc/source/inspect/introspection.cxx 
b/stoc/source/inspect/introspection.cxx
index 2b5f3d6..497d9e2 100644
--- a/stoc/source/inspect/introspection.cxx
+++ b/stoc/source/inspect/introspection.cxx
@@ -119,13 +119,13 @@ bool isDerivedFrom( ReferenceXIdlClass xToTestClass, 
ReferenceXIdlClass xDer
 #define MAP_PROPERTY_SET0
 // Properties from Fields
 #define MAP_FIELD1
-// Properties, that get described with get/set-Methods
+// Properties that get described with get/set methods
 #define MAP_GETSET2
-// Properties, with only a set-Method
+// Properties with only a set method
 #define MAP_SETONLY3
 
 
-// Increments, in which the size of Sequences get adjusted
+// Increments by which the size of sequences get adjusted
 #define ARRAY_SIZE_STEP20
 
 
@@ -206,7 +206,7 @@ class IntrospectionAccessStatic_Impl: public 
salhelper::SimpleReferenceObject
 bool mbEnumerationAccess;
 bool mbIdlArray;
 
-// Original-Handles of FastPropertySets
+// Original handles of FastPropertySets
 sal_Int32* mpOrgPropertyHandleArray;
 
 // MethodSequence, that accepts all methods
@@ -448,7 +448,7 @@ void 
IntrospectionAccessStatic_Impl::setPropertyValueByIndex(const Any obj, sal
 }
 
 // Do we have a FastPropertySet and a valid Handle?
-// CAUTION: At this point we exploit, that the PropertySet
+// CAUTION: At this point we exploit that the PropertySet
 // gets queried at the beginning of the Introspection-Process.
 sal_Int32 nOrgHandle;
 if( mbFastPropSet  ( nOrgHandle = mpOrgPropertyHandleArray[ 
nSequenceIndex ] ) != -1 )
@@ -509,7 +509,7 @@ void 
IntrospectionAccessStatic_Impl::setPropertyValueByIndex(const Any obj, sal
 case MAP_GETSET:
 case MAP_SETONLY:
 {
-// Retrieve set-Methods
+// Fetch set method
 ReferenceXIdlMethod xMethod = 
static_castXIdlMethod*(aInterfaceSeq2.getConstArray()[ nSequenceIndex 
].get());
 if( xMethod.is() )
 {
@@ -539,7 +539,7 @@ Any 
IntrospectionAccessStatic_Impl::getPropertyValueByIndex(const Any obj, sal_
 {
 Any aRet;
 
-// Handelt es sich bei dem uebergebenen Objekt ueberhaupt um was passendes?
+// Is there anything suitable in the passed object?
 TypeClass eObjType = obj.getValueType().getTypeClass();
 
 ReferenceXInterface xInterface;
@@ -558,16 +558,16 @@ Any 
IntrospectionAccessStatic_Impl::getPropertyValueByIndex(const Any obj, sal_
 {
 case MAP_PROPERTY_SET:
 {
-// Property besorgen
+// Acquire property
 const Property rProp = maAllPropertySeq.getConstArray()[ 
nSequenceIndex ];
 
-// Haben wir ein FastPropertySet und ein gueltiges Handle?
-// ACHTUNG: An dieser Stelle wird ausgenutzt, dass das PropertySet
-// zu Beginn des Introspection-Vorgangs abgefragt wird.
+// Do we have a FastPropertySet and a valid handle?
+// NOTE: At this point is exploited that the PropertySet
+// is queried at the beginning of introspection process.
 sal_Int32 nOrgHandle;
 if( mbFastPropSet  ( nOrgHandle = mpOrgPropertyHandleArray[ 
nSequenceIndex ] ) != -1 )
 {
-// PropertySet-Interface holen
+// Fetch the PropertySet interface
 ReferenceXFastPropertySet xFastPropSet =
 ReferenceXFastPropertySet::query( xInterface );
 if( xFastPropSet.is() )
@@ -580,10 +580,10 @@ Any 
IntrospectionAccessStatic_Impl::getPropertyValueByIndex(const Any obj, sal_
 return aRet;
 }
 }
-// sonst eben das normale nehmen
+// Otherwise use the normal one
 else
 {
-// PropertySet-Interface holen
+// Fetch the PropertySet interface
 ReferenceXPropertySet xPropSet =
 ReferenceXPropertySet::query( xInterface );
 if( xPropSet.is() )
@@ -618,7 +618,7 @@ Any 
IntrospectionAccessStatic_Impl::getPropertyValueByIndex(const Any obj, sal_
 
 case MAP_GETSET:
 {
-// get-Methode holen
+// Fetch get method
 ReferenceXIdlMethod xMethod = 
static_castXIdlMethod*(aInterfaceSeq1.getConstArray()[ nSequenceIndex 
].get());
 if( xMethod.is() )
 {
@@ -634,7 +634,7 @@ Any 

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

2015-07-08 Thread Matthew J . Francis
 stoc/source/inspect/introspection.cxx |  245 +++---
 1 file changed, 199 insertions(+), 46 deletions(-)

New commits:
commit 61b1697069c50ff72339d4592add42ab72b03243
Author: Matthew J. Francis mjay.fran...@gmail.com
Date:   Mon Jul 6 08:09:24 2015 +0800

Reduce the amount of up front work in performing introspection

Previously, when using PyUNO over a remote bridge, each remote
call which returned an object could result in 50+ further calls
to query interfaces on the result, regardless of whether and
how the object was then used. The majority of these queries
were made under css.script.Invocation to pre-cache certain
information about the returned object.

By making better use of available information to eliminate
interface queries which are certain to fail, and lazily
acquiring those interfaces which are required, remote scripting
is significantly accelerated. In general, this also gives a
small speedup for local scripting.

Change-Id: I4f36da6b5f09cb0d22f21291f05fbea2ae7ae697
Signed-off-by: Stephan Bergmann sberg...@redhat.com

diff --git a/stoc/source/inspect/introspection.cxx 
b/stoc/source/inspect/introspection.cxx
index e6b9110..cfa7085 100644
--- a/stoc/source/inspect/introspection.cxx
+++ b/stoc/source/inspect/introspection.cxx
@@ -162,6 +162,7 @@ class IntrospectionAccessStatic_Impl: public 
salhelper::SimpleReferenceObject
 {
 friend class Implementation;
 friend class ImplIntrospectionAccess;
+friend class ImplIntrospectionAdapter;
 
 // Holding CoreReflection
 Reference XIdlReflection  mxCoreReflection;
@@ -194,8 +195,16 @@ class IntrospectionAccessStatic_Impl: public 
salhelper::SimpleReferenceObject
 sal_Int32 mnAttributePropCount;
 sal_Int32 mnMethodPropCount;
 
-// Flag, if a FastPropertySet is supported
+// Flags which indicate if various interfaces are present
 bool mbFastPropSet;
+bool mbPropertySet;
+bool mbElementAccess;
+bool mbNameAccess;
+bool mbNameContainer;
+bool mbIndexAccess;
+bool mbIndexContainer;
+bool mbEnumerationAccess;
+bool mbIdlArray;
 
 // Original-Handles of FastPropertySets
 sal_Int32* mpOrgPropertyHandleArray;
@@ -261,6 +270,15 @@ 
IntrospectionAccessStatic_Impl::IntrospectionAccessStatic_Impl( Reference XIdlR
 maPropertyConceptSeq.realloc( ARRAY_SIZE_STEP );
 
 mbFastPropSet = false;
+mbPropertySet = false;
+mbElementAccess = false;
+mbNameAccess = false;
+mbNameContainer = false;
+mbIndexAccess = false;
+mbIndexContainer = false;
+mbEnumerationAccess = false;
+mbIdlArray = false;
+
 mpOrgPropertyHandleArray = NULL;
 
 mnPropCount = 0;
@@ -772,6 +790,9 @@ class ImplIntrospectionAdapter :
 // Objekt als Interface
 ReferenceXInterface mxIface;
 
+// Guards the caching of queried interfaces
+osl::Mutex m_aMutex;
+
 // Original-Interfaces des Objekts
 ReferenceXElementAccessmxObjElementAccess;
 ReferenceXNameContainermxObjNameContainer;
@@ -781,6 +802,14 @@ class ImplIntrospectionAdapter :
 ReferenceXEnumerationAccessmxObjEnumerationAccess;
 ReferenceXIdlArraymxObjIdlArray;
 
+ReferenceXElementAccess getXElementAccess();
+ReferenceXNameContainer getXNameContainer();
+ReferenceXNameAccess getXNameAccess();
+ReferenceXIndexContainer getXIndexContainer();
+ReferenceXIndexAccess getXIndexAccess();
+ReferenceXEnumerationAccess getXEnumerationAccess();
+ReferenceXIdlArray getXIdlArray();
+
 public:
 ImplIntrospectionAdapter( ImplIntrospectionAccess* pAccess_,
 const Any obj,
@@ -861,6 +890,112 @@ public:
 throw( IllegalArgumentException, ArrayIndexOutOfBoundsException, 
RuntimeException, std::exception ) SAL_OVERRIDE;
 };
 
+ReferenceXElementAccess ImplIntrospectionAdapter::getXElementAccess()
+{
+ResettableGuard Mutex  aGuard( m_aMutex );
+
+if( !mxObjElementAccess.is() )
+{
+aGuard.clear();
+ReferenceXElementAccess xElementAccess = 
ReferenceXElementAccess::query( mxIface );
+aGuard.reset();
+if( !mxObjElementAccess.is() )
+mxObjElementAccess = xElementAccess;
+}
+return mxObjElementAccess;
+}
+
+ReferenceXNameContainer ImplIntrospectionAdapter::getXNameContainer()
+{
+ResettableGuard Mutex  aGuard( m_aMutex );
+
+if( !mxObjNameContainer.is() )
+{
+aGuard.clear();
+ReferenceXNameContainer xNameContainer = 
ReferenceXNameContainer::query( mxIface );
+aGuard.reset();
+if( !mxObjNameContainer.is() )
+mxObjNameContainer = xNameContainer;
+}
+return mxObjNameContainer;
+}
+
+ReferenceXNameAccess ImplIntrospectionAdapter::getXNameAccess()
+{
+ResettableGuard Mutex  aGuard( m_aMutex );
+
+if( !mxObjNameAccess.is() )
+{
+aGuard.clear();
+ReferenceXNameAccess xNameAccess = 

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

2015-07-08 Thread Matthew J . Francis
 stoc/source/inspect/introspection.cxx |   24 +++-
 1 file changed, 7 insertions(+), 17 deletions(-)

New commits:
commit 85ce6a2446deb0f4c01604b6188f969603de9b16
Author: Matthew J. Francis mjay.fran...@gmail.com
Date:   Thu Jul 9 09:03:46 2015 +0800

Eliminate pointless string copies

Change-Id: I30049795f511704a43ed0eaf8dd0841c7109c334

diff --git a/stoc/source/inspect/introspection.cxx 
b/stoc/source/inspect/introspection.cxx
index cfa7085..c92d636 100644
--- a/stoc/source/inspect/introspection.cxx
+++ b/stoc/source/inspect/introspection.cxx
@@ -1489,22 +1489,12 @@ Any ImplIntrospectionAccess::getMaterial() 
throw(RuntimeException, std::exceptio
 return maInspectedObject;
 }
 
-// Hilfs-Funktion zur LowerCase-Wandlung eines OUString
-OUString toLower( const OUString aUStr )
-{
-// Tabelle fuer XExactName pflegen
-OUString aOWStr( aUStr.getStr() );
-OUString aOWLowerStr = aOWStr.toAsciiLowerCase();
-OUString aLowerUStr( aOWLowerStr.getStr() );
-return aLowerUStr;
-}
-
 // Methoden von XExactName
 OUString ImplIntrospectionAccess::getExactName( const OUString 
rApproximateName ) throw( RuntimeException, std::exception )
 {
 OUString aRetStr;
 LowerToExactNameMap::iterator aIt =
-mpStaticImpl-maLowerToExactNameMap.find( toLower( rApproximateName ) 
);
+mpStaticImpl-maLowerToExactNameMap.find( 
rApproximateName.toAsciiLowerCase() );
 if( !( aIt == mpStaticImpl-maLowerToExactNameMap.end() ) )
 aRetStr = (*aIt).second;
 return aRetStr;
@@ -1898,7 +1888,7 @@ css::uno::Referencecss::beans::XIntrospectionAccess 
Implementation::inspect(
 rPropNameMap[ aPropName ] = rPropCount;
 
 // Tabelle fuer XExactName pflegen
-rLowerToExactNameMap[ toLower( aPropName ) ] = aPropName;
+rLowerToExactNameMap[ aPropName.toAsciiLowerCase() ] = 
aPropName;
 }
 else
 {
@@ -1989,7 +1979,7 @@ css::uno::Referencecss::beans::XIntrospectionAccess 
Implementation::inspect(
 rPropNameMap[ aPropName ] = rPropCount;
 
 // Tabelle fuer XExactName pflegen
-rLowerToExactNameMap[ toLower( aPropName ) ] = 
aPropName;
+rLowerToExactNameMap[ aPropName.toAsciiLowerCase() ] = 
aPropName;
 
 // Field merken
 
IntrospectionAccessStatic_Impl::checkInterfaceArraySize( 
pAccess-aInterfaceSeq1,
@@ -2169,7 +2159,7 @@ css::uno::Referencecss::beans::XIntrospectionAccess 
Implementation::inspect(
 rPropNameMap[ aPropName ] = rPropCount;
 
 // Tabelle fuer XExactName pflegen
-rLowerToExactNameMap[ toLower( aPropName ) ] = 
aPropName;
+rLowerToExactNameMap[ aPropName.toAsciiLowerCase() 
] = aPropName;
 
 // get-Methode merken
 
IntrospectionAccessStatic_Impl::checkInterfaceArraySize( 
pAccess-aInterfaceSeq1,
@@ -2359,7 +2349,7 @@ css::uno::Referencecss::beans::XIntrospectionAccess 
Implementation::inspect(
 rPropNameMap[ aPropName ] = rPropCount;
 
 // Tabelle fuer XExactName pflegen
-rLowerToExactNameMap[ toLower( aPropName ) ] = 
aPropName;
+rLowerToExactNameMap[ aPropName.toAsciiLowerCase() 
] = aPropName;
 
 // set-Methode merken
 
IntrospectionAccessStatic_Impl::checkInterfaceArraySize( 
pAccess-aInterfaceSeq2,
@@ -2421,7 +2411,7 @@ css::uno::Referencecss::beans::XIntrospectionAccess 
Implementation::inspect(
 rMethodNameMap[ aMethName2 ] = 
iAllExportedMethod;
 
 // Tabelle fuer XExactName pflegen
-rLowerToExactNameMap[ toLower( aMethName2 ) ] 
= aMethName2;
+rLowerToExactNameMap[ 
aMethName2.toAsciiLowerCase() ] = aMethName2;
 }
 else
 {
@@ -2580,7 +2570,7 @@ css::uno::Referencecss::beans::XIntrospectionAccess 
Implementation::inspect(
 rPropNameMap[ aPropName ] = rPropCount;
 
 // Tabelle fuer XExactName pflegen
-rLowerToExactNameMap[ toLower( aPropName ) ] = aPropName;
+rLowerToExactNameMap[ aPropName.toAsciiLowerCase() ] = aPropName;
 
 // Field merken
 IntrospectionAccessStatic_Impl::checkInterfaceArraySize( 
pAccess-aInterfaceSeq1,
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2015-06-30 Thread Stephan Bergmann
 stoc/source/inspect/introspection.cxx |   45 +++---
 1 file changed, 31 insertions(+), 14 deletions(-)

New commits:
commit a12db8e9e1960f3f209f1b95547041681566d636
Author: Stephan Bergmann sberg...@redhat.com
Date:   Tue Jun 30 14:10:17 2015 +0200

tdf#92440: Reduce code areas covered by mutex

Change-Id: Iec79e088e67e1cddeb8242d069fae911b305f613

diff --git a/stoc/source/inspect/introspection.cxx 
b/stoc/source/inspect/introspection.cxx
index 116b8ed..ca8d99a 100644
--- a/stoc/source/inspect/introspection.cxx
+++ b/stoc/source/inspect/introspection.cxx
@@ -1537,6 +1537,7 @@ public:
 
 private:
 virtual void SAL_CALL disposing() SAL_OVERRIDE {
+osl::MutexGuard g(m_aMutex);
 reflection_.clear();
 classCache_.clear();
 typeCache_.clear();
@@ -1572,16 +1573,20 @@ css::uno::Referencecss::beans::XIntrospectionAccess 
Implementation::inspect(
 css::uno::Any const  aObject)
 throw (css::uno::RuntimeException, std::exception)
 {
-osl::MutexGuard g(m_aMutex);
-if (rBHelper.bDisposed || rBHelper.bInDispose) {
-throw css::lang::DisposedException(
-getImplementationName(), static_castOWeakObject *(this));
+css::uno::Referencecss::reflection::XIdlReflection reflection;
+{
+osl::MutexGuard g(m_aMutex);
+if (rBHelper.bDisposed || rBHelper.bInDispose) {
+throw css::lang::DisposedException(
+getImplementationName(), static_castOWeakObject *(this));
+}
+reflection = reflection_;
 }
 css::uno::Any aToInspectObj;
 css::uno::Type t;
 if (aObject = t) {
 css::uno::Referencecss::reflection::XIdlClass c(
-reflection_-forName(t.getTypeName()));
+reflection-forName(t.getTypeName()));
 if (!c.is()) {
 SAL_WARN(stoc, cannot reflect type   t.getTypeName());
 return css::uno::Referencecss::beans::XIntrospectionAccess();
@@ -1632,7 +1637,7 @@ css::uno::Referencecss::beans::XIntrospectionAccess 
Implementation::inspect(
 const Type* pTypes = SupportedTypesSeq.getConstArray();
 for( sal_Int32 i = 0 ; i  nTypeCount ; i++ )
 {
-pClasses[i] = 
reflection_-forName(pTypes[i].getTypeName());
+pClasses[i] = reflection-forName(pTypes[i].getTypeName());
 }
 // TODO: Caching!
 }
@@ -1641,7 +1646,7 @@ css::uno::Referencecss::beans::XIntrospectionAccess 
Implementation::inspect(
 stoc,
 object of type \  aToInspectObj.getValueTypeName()
  \ lacks XTypeProvider);
-xImplClass = 
reflection_-forName(aToInspectObj.getValueTypeName());
+xImplClass = reflection-forName(aToInspectObj.getValueTypeName());
 SupportedClassSeq.realloc(1);
 SupportedClassSeq[0] = xImplClass;
 }
@@ -1651,24 +1656,36 @@ css::uno::Referencecss::beans::XIntrospectionAccess 
Implementation::inspect(
 if( xPropSet.is() )
 xPropSetInfo = xPropSet-getPropertySetInfo();
 } else {
-xImplClass = reflection_-forName(aToInspectObj.getValueTypeName());
+xImplClass = reflection-forName(aToInspectObj.getValueTypeName());
 }
 
 if (xTypeProvider.is()) {
 TypeKey key(xPropSetInfo, xTypeProvider-getTypes());
+
+osl::MutexGuard g(m_aMutex);
+if (rBHelper.bDisposed || rBHelper.bInDispose) {
+throw css::lang::DisposedException(
+getImplementationName(), static_castOWeakObject *(this));
+}
 pAccess = typeCache_.find(key);
 if (pAccess.is()) {
 return new ImplIntrospectionAccess(aToInspectObj, pAccess);
 }
-pAccess = new IntrospectionAccessStatic_Impl(reflection_);
+pAccess = new IntrospectionAccessStatic_Impl(reflection);
 typeCache_.insert(key, pAccess);
 } else if (xImplClass.is()) {
 ClassKey key(xPropSetInfo, xImplClass, SupportedClassSeq);
+
+osl::MutexGuard g(m_aMutex);
+if (rBHelper.bDisposed || rBHelper.bInDispose) {
+throw css::lang::DisposedException(
+getImplementationName(), static_castOWeakObject *(this));
+}
 pAccess = classCache_.find(key);
 if (pAccess.is()) {
 return new ImplIntrospectionAccess(aToInspectObj, pAccess);
 }
-pAccess = new IntrospectionAccessStatic_Impl(reflection_);
+pAccess = new IntrospectionAccessStatic_Impl(reflection);
 classCache_.insert(key, pAccess);
 }
 
@@ -1681,7 +1698,7 @@ css::uno::Referencecss::beans::XIntrospectionAccess 
Implementation::inspect(
 sal_Int32 i;
 
 if( !pAccess.is() )
-pAccess = new IntrospectionAccessStatic_Impl( reflection_ );
+pAccess = new IntrospectionAccessStatic_Impl( reflection );
 
 // Referenzen auf wichtige Daten von 

[Libreoffice-commits] core.git: stoc/source svl/source svtools/source

2015-01-11 Thread Michael Weghorn
 stoc/source/defaultregistry/defaultregistry.cxx|6 ++
 stoc/source/implementationregistration/implreg.cxx |3 +--
 svl/source/passwordcontainer/passwordcontainer.cxx |5 ++---
 svl/source/svdde/ddesvr.cxx|6 ++
 svtools/source/contnr/treelistbox.cxx  |   10 --
 svtools/source/contnr/treelistentry.cxx|3 +--
 svtools/source/control/calendar.cxx|9 +++--
 svtools/source/control/headbar.cxx |3 ++-
 svtools/source/control/roadmap.cxx |   10 +++---
 svtools/source/control/ruler.cxx   |   13 +
 svtools/source/control/tabbar.cxx  |9 -
 svtools/source/control/toolbarmenu.cxx |2 +-
 svtools/source/misc/imap.cxx   |6 +++---
 svtools/source/misc/imap2.cxx  |6 ++
 14 files changed, 35 insertions(+), 56 deletions(-)

New commits:
commit d5f48d742ac1fea9fd341244bbcea09bcd78b476
Author: Michael Weghorn m.wegh...@posteo.de
Date:   Sat Jan 10 15:52:17 2015 +0100

fdo#39440 reduce scope of local variables

This addresses some cppcheck warnings.

Change-Id: I46b9293eed0cba2ebca119cc1fb0a6334ea66308
Reviewed-on: https://gerrit.libreoffice.org/13844
Tested-by: Jenkins c...@libreoffice.org
Reviewed-by: Noel Grandin noelgran...@gmail.com

diff --git a/stoc/source/defaultregistry/defaultregistry.cxx 
b/stoc/source/defaultregistry/defaultregistry.cxx
index 37ff4a47..aff3f14 100644
--- a/stoc/source/defaultregistry/defaultregistry.cxx
+++ b/stoc/source/defaultregistry/defaultregistry.cxx
@@ -822,7 +822,6 @@ Sequence Reference XRegistryKey   SAL_CALL 
NestedKeyImpl::openKeys(  )
 }
 
 Sequence ReferenceXRegistryKey  retSeq(local + def - len);
-boolinsert = true;
 OUStringname;
 sal_Int32   lastIndex;
 
@@ -838,7 +837,7 @@ Sequence Reference XRegistryKey   SAL_CALL 
NestedKeyImpl::openKeys(  )
 sal_uInt32 k = local;
 for (i=0; i  def; i++)
 {
-insert = true;
+bool insert = true;
 
 for (j=0 ; j  local; j++)
 {
@@ -902,7 +901,6 @@ Sequence OUString  SAL_CALL NestedKeyImpl::getKeyNames(  )
 }
 
 SequenceOUString  retSeq(local + def - len);
-boolinsert = true;
 
 for (i=0; i  local; i++)
 {
@@ -912,7 +910,7 @@ Sequence OUString  SAL_CALL NestedKeyImpl::getKeyNames(  )
 sal_uInt32 k = local;
 for (i=0; i  def; i++)
 {
-insert = true;
+bool insert = true;
 
 for (j=0 ; j  local; j++)
 {
diff --git a/stoc/source/implementationregistration/implreg.cxx 
b/stoc/source/implementationregistration/implreg.cxx
index d0627d2..90d3ce2 100644
--- a/stoc/source/implementationregistration/implreg.cxx
+++ b/stoc/source/implementationregistration/implreg.cxx
@@ -505,13 +505,12 @@ static void deleteUserLink(const Reference  XRegistryKey 
 xRootKey,
 linkName + spool().colon_old );
 if (xOldKey.is())
 {
-bool hasNoImplementations = false;
-
 if (xOldKey-getValueType() == RegistryValueType_ASCIILIST)
 {
 SequenceOUString implEntries = xOldKey-getAsciiListValue();
 sal_Int32 length = implEntries.getLength();
 sal_Int32 equals = 0;
+bool hasNoImplementations = false;
 
 for (sal_Int32 i = 0; i  length; i++)
 {
diff --git a/svl/source/passwordcontainer/passwordcontainer.cxx 
b/svl/source/passwordcontainer/passwordcontainer.cxx
index aadd1f98..6588a4d 100644
--- a/svl/source/passwordcontainer/passwordcontainer.cxx
+++ b/svl/source/passwordcontainer/passwordcontainer.cxx
@@ -50,14 +50,13 @@ using namespace com::sun::star::ucb;
 static OUString createIndex( vector OUString  lines )
 {
 OString aResult;
-const sal_Char* pLine;
 
 for( unsigned int i = 0; i  lines.size(); i++ )
 {
 if( i )
 aResult += OString( __ );
 OString line = OUStringToOString( lines[i], RTL_TEXTENCODING_UTF8 );
-pLine = line.getStr();
+const sal_Char* pLine = line.getStr();
 
 while( *pLine )
 {
@@ -852,7 +851,6 @@ OUString PasswordContainer::GetMasterPassword( const 
Reference XInteractionHand
 if( m_aMasterPasswd.isEmpty()  aHandler.is() )
 {
 OUString aEncodedMP;
-bool bAskAgain = false;
 bool bDefaultPassword = false;
 
 if( !m_pStorageFile-getEncodedMP( aEncodedMP ) )
@@ -865,6 +863,7 @@ OUString PasswordContainer::GetMasterPassword( const 
Reference XInteractionHand
 
 if ( !bDefaultPassword )
 {
+bool bAskAgain = false;
 do {
 bAskAgain = false;
 
diff --git a/svl/source/svdde/ddesvr.cxx b/svl/source/svdde/ddesvr.cxx
index 24492be..1dd7110 100644
--- a/svl/source/svdde/ddesvr.cxx
+++ 

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

2015-01-07 Thread Stephan Bergmann
 stoc/source/security/access_controller.cxx |   33 +
 1 file changed, 2 insertions(+), 31 deletions(-)

New commits:
commit 27a166bcb8bdf56efff987b08895d2c676125426
Author: Stephan Bergmann sberg...@redhat.com
Date:   Wed Jan 7 16:34:23 2015 +0100

Just use WeakImplHelper1 instead of ImplHelper1

Change-Id: Iadc5960ef22289c044a0c85accaefb4f60b6097f

diff --git a/stoc/source/security/access_controller.cxx 
b/stoc/source/security/access_controller.cxx
index 4fc3de1..721b095 100644
--- a/stoc/source/security/access_controller.cxx
+++ b/stoc/source/security/access_controller.cxx
@@ -21,7 +21,6 @@
 #include vector
 
 #include osl/diagnose.h
-#include osl/interlck.h
 #include osl/mutex.hxx
 #include osl/thread.hxx
 
@@ -217,10 +216,8 @@ void acc_Policy::checkPermission(
 /** current context overriding dynamic ac restriction
 */
 class acc_CurrentContext
-: public ImplHelper1 XCurrentContext 
+: public WeakImplHelper1 XCurrentContext 
 {
-oslInterlockedCount m_refcount;
-
 Reference XCurrentContext  m_xDelegate;
 Any m_restriction;
 
@@ -228,13 +225,6 @@ public:
 inline acc_CurrentContext(
 Reference XCurrentContext  const  xDelegate,
 Reference security::XAccessControlContext  const  xRestriction );
-virtual ~acc_CurrentContext();
-
-// XInterface impl
-virtual void SAL_CALL acquire()
-throw () SAL_OVERRIDE;
-virtual void SAL_CALL release()
-throw () SAL_OVERRIDE;
 
 // XCurrentContext impl
 virtual Any SAL_CALL getValueByName( OUString const  name )
@@ -244,8 +234,7 @@ public:
 inline acc_CurrentContext::acc_CurrentContext(
 Reference XCurrentContext  const  xDelegate,
 Reference security::XAccessControlContext  const  xRestriction )
-: m_refcount( 0 )
-, m_xDelegate( xDelegate )
+: m_xDelegate( xDelegate )
 {
 if (xRestriction.is())
 {
@@ -254,24 +243,6 @@ inline acc_CurrentContext::acc_CurrentContext(
 // return empty any otherwise on getValueByName(), not null interface
 }
 
-acc_CurrentContext::~acc_CurrentContext()
-{}
-
-void acc_CurrentContext::acquire()
-throw ()
-{
-osl_atomic_increment( m_refcount );
-}
-
-void acc_CurrentContext::release()
-throw ()
-{
-if (! osl_atomic_decrement( m_refcount ))
-{
-delete this;
-}
-}
-
 Any acc_CurrentContext::getValueByName( OUString const  name )
 throw (RuntimeException, std::exception)
 {
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2014-08-07 Thread Stephan Bergmann
 stoc/source/typeconv/convert.cxx  |1 +
 stoc/source/uriproc/UriSchemeParser_vndDOTsunDOTstarDOTexpand.cxx |1 +
 stoc/source/uriproc/UriSchemeParser_vndDOTsunDOTstarDOTscript.cxx |1 +
 3 files changed, 3 insertions(+)

New commits:
commit e80c3152fdd343829af9e196aa6c72aaf9c7597f
Author: Stephan Bergmann sberg...@redhat.com
Date:   Thu Aug 7 18:40:17 2014 +0200

Avoid incomplete type in fn sig to keep ubsan's RTTI-based checks happy

Change-Id: I004905375489fa5533ab4af13ebba439ba792384

diff --git a/stoc/source/typeconv/convert.cxx b/stoc/source/typeconv/convert.cxx
index 3a0e127..6e10a0c 100644
--- a/stoc/source/typeconv/convert.cxx
+++ b/stoc/source/typeconv/convert.cxx
@@ -40,6 +40,7 @@
 #include com/sun/star/script/FailReason.hpp
 #include com/sun/star/container/XSet.hpp
 #include com/sun/star/registry/XRegistryKey.hpp
+#include com/sun/star/uno/XComponentContext.hpp
 
 #include stocservices.hxx
 
diff --git a/stoc/source/uriproc/UriSchemeParser_vndDOTsunDOTstarDOTexpand.cxx 
b/stoc/source/uriproc/UriSchemeParser_vndDOTsunDOTstarDOTexpand.cxx
index 38bc99a..a0a7600 100644
--- a/stoc/source/uriproc/UriSchemeParser_vndDOTsunDOTstarDOTexpand.cxx
+++ b/stoc/source/uriproc/UriSchemeParser_vndDOTsunDOTstarDOTexpand.cxx
@@ -29,6 +29,7 @@
 #include com/sun/star/uno/Reference.hxx
 #include com/sun/star/uno/RuntimeException.hpp
 #include com/sun/star/uno/Sequence.hxx
+#include com/sun/star/uno/XComponentContext.hpp
 #include com/sun/star/uno/XInterface.hpp
 #include com/sun/star/uri/XUriReference.hpp
 #include com/sun/star/uri/XUriSchemeParser.hpp
diff --git a/stoc/source/uriproc/UriSchemeParser_vndDOTsunDOTstarDOTscript.cxx 
b/stoc/source/uriproc/UriSchemeParser_vndDOTsunDOTstarDOTscript.cxx
index 465800b..5866c31 100644
--- a/stoc/source/uriproc/UriSchemeParser_vndDOTsunDOTstarDOTscript.cxx
+++ b/stoc/source/uriproc/UriSchemeParser_vndDOTsunDOTstarDOTscript.cxx
@@ -28,6 +28,7 @@
 #include com/sun/star/uno/Reference.hxx
 #include com/sun/star/uno/RuntimeException.hpp
 #include com/sun/star/uno/Sequence.hxx
+#include com/sun/star/uno/XComponentContext.hpp
 #include com/sun/star/uno/XInterface.hpp
 #include com/sun/star/uri/XUriReference.hpp
 #include com/sun/star/uri/XUriSchemeParser.hpp
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


  1   2   >