core.git: cppuhelper/source cppu/source filter/source

2024-05-01 Thread Noel Grandin (via logerrit)
 cppu/source/typelib/static_types.cxx |   12 ++--
 cppuhelper/source/servicemanager.cxx |   17 ++---
 filter/source/xsltdialog/xmlfiltercommon.hxx |2 
 filter/source/xsltdialog/xmlfiltersettingsdialog.cxx |   56 +--
 4 files changed, 42 insertions(+), 45 deletions(-)

New commits:
commit e8fdc8a4ff60a392f51326e90212fc73d515e270
Author: Noel Grandin 
AuthorDate: Wed May 1 20:07:21 2024 +0200
Commit: Noel Grandin 
CommitDate: Thu May 2 02:51:23 2024 +0200

elide some OUString temporaries

Change-Id: I8364489639c8c02e9670ee597f48d61007244f5b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/166973
Reviewed-by: Noel Grandin 
Tested-by: Noel Grandin 

diff --git a/cppu/source/typelib/static_types.cxx 
b/cppu/source/typelib/static_types.cxx
index 67b63550e1cd..f91dbed71ddb 100644
--- a/cppu/source/typelib/static_types.cxx
+++ b/cppu/source/typelib/static_types.cxx
@@ -118,11 +118,11 @@ typelib_TypeDescriptionReference ** SAL_CALL 
typelib_static_type_getByTypeClass(
 MutexGuard aGuard( typelib_StaticInitMutex() );
 if (! s_aTypes[eTypeClass])
 {
-static const char * s_aTypeNames[] = {
-"void", "char", "boolean", "byte",
-"short", "unsigned short", "long", "unsigned long",
-"hyper", "unsigned hyper", "float", "double",
-"string", "type", "any" };
+static constexpr OUString s_aTypeNames[] = {
+u"void"_ustr, u"char"_ustr, u"boolean"_ustr, u"byte"_ustr,
+u"short"_ustr, u"unsigned short"_ustr, u"long"_ustr, 
u"unsigned long"_ustr,
+u"hyper"_ustr, u"unsigned hyper"_ustr, u"float"_ustr, 
u"double"_ustr,
+u"string"_ustr, u"type"_ustr, u"any"_ustr };
 
 switch (eTypeClass)
 {
@@ -258,7 +258,7 @@ typelib_TypeDescriptionReference ** SAL_CALL 
typelib_static_type_getByTypeClass(
 }
 default:
 {
-OUString aTypeName( OUString::createFromAscii( 
s_aTypeNames[eTypeClass] ) );
+OUString aTypeName( s_aTypeNames[eTypeClass] );
 ::typelib_typedescriptionreference_new( _aTypes[eTypeClass], 
eTypeClass, aTypeName.pData );
 // another static ref:
 ++s_aTypes[eTypeClass]->nStaticRefCount;
diff --git a/cppuhelper/source/servicemanager.cxx 
b/cppuhelper/source/servicemanager.cxx
index 790a776392c4..415d0edb0e3c 100644
--- a/cppuhelper/source/servicemanager.cxx
+++ b/cppuhelper/source/servicemanager.cxx
@@ -2007,21 +2007,18 @@ void 
cppuhelper::ServiceManager::preloadImplementations() {
 
 // Various rather important uno mappings.
 static struct {
-const char *mpFrom;
-const char *mpTo;
-const char *mpPurpose;
-} const aMappingLoad[] = {
-{ "gcc3", "uno",  "" },
-{ "uno",  "gcc3", "" },
+OUString maFrom;
+OUString maTo;
+OUString maPurpose;
+} constexpr aMappingLoad[] = {
+{ u"gcc3"_ustr, u"uno"_ustr,  u""_ustr },
+{ u"uno"_ustr,  u"gcc3"_ustr, u""_ustr },
 };
 
 static std::vector maMaps;
 for (auto  : aMappingLoad)
 {
-maMaps.push_back(css::uno::Mapping(
- OUString::createFromAscii(it.mpFrom),
- OUString::createFromAscii(it.mpTo),
- OUString::createFromAscii(it.mpPurpose)));
+maMaps.push_back(css::uno::Mapping(it.maFrom, it.maTo, it.maPurpose));
 }
 #endif
 }
diff --git a/filter/source/xsltdialog/xmlfiltercommon.hxx 
b/filter/source/xsltdialog/xmlfiltercommon.hxx
index 9482fb0b2b63..34bf5a04d807 100644
--- a/filter/source/xsltdialog/xmlfiltercommon.hxx
+++ b/filter/source/xsltdialog/xmlfiltercommon.hxx
@@ -70,7 +70,7 @@ struct application_info_impl
 OUString   maXMLImporter;
 OUString   maXMLExporter;
 
-application_info_impl(const char * pDocumentService, const OUString& 
rUINameRes, const char * mpXMLImporter, const char * mpXMLExporter);
+application_info_impl(const OUString& rDocumentService, const OUString& 
rUINameRes, const OUString& rXMLImporter, const OUString& rXMLExporter);
 };
 
 
diff --git a/filter/source/xsltdialog/xmlfiltersettingsdialog.cxx 
b/filter/source/xsltdialog/xmlfiltersettingsdialog.cxx
index ce06b716e20b..0248ae75c9c3 100644
--- a/filter/source/xsltdialog/xmlfiltersettingsdialog.cxx
+++ b/filter/source/xsltdialog/xmlfiltersettingsdialog.cxx
@@ -,11 +,11 @@ void XMLFilterSettingsDialog::initFilterList()
 }
 }
 
-application_info_impl::application_info_impl( const char * pDocumentService, 
const OUString& rUINameRes, const char * mpXMLImporter, const char * 
mpXMLExporter )
-:   maDocumentService( pDocumentService, strlen( pDocumentService ), 
RTL_TEXTENCODING_ASCII_US ),
+application_info_impl::application_info_impl( const OUString& 
rDocumentService, const OUString& 

core.git: cppuhelper/source

2024-04-30 Thread Caolán McNamara (via logerrit)
 cppuhelper/source/shlib.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 6104316fd50076d41039c33a5338b016e93259fe
Author: Caolán McNamara 
AuthorDate: Tue Apr 30 11:21:04 2024 +0100
Commit: Caolán McNamara 
CommitDate: Tue Apr 30 18:51:46 2024 +0200

WaE: C6011 Dereferencing NULL pointer warnings

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

diff --git a/cppuhelper/source/shlib.cxx b/cppuhelper/source/shlib.cxx
index b6885cbed770..c1a66ae66704 100644
--- a/cppuhelper/source/shlib.cxx
+++ b/cppuhelper/source/shlib.cxx
@@ -248,7 +248,7 @@ void cppuhelper::detail::loadSharedLibComponentFactory(
 assert(constructor.isEmpty() || !environment.isEmpty());
 assert(
 (constructorFunction == nullptr && constructor.isEmpty())
-|| !*constructorFunction);
+|| (constructorFunction && !*constructorFunction));
 assert(factory != nullptr && !factory->is());
 #if defined DISABLE_DYNLOADING
 assert(!environment.isEmpty());


core.git: cppuhelper/source

2024-03-07 Thread Noel Grandin (via logerrit)
 cppuhelper/source/servicemanager.cxx |3 +++
 1 file changed, 3 insertions(+)

New commits:
commit 07ead0555088dff6fbea4159ee26d1aeda2df19a
Author: Noel Grandin 
AuthorDate: Wed Mar 6 18:47:28 2024 +0200
Commit: Miklos Vajna 
CommitDate: Thu Mar 7 09:00:00 2024 +0100

unlock mutex around lok_preload_hook

because it now instantiates some services

Change-Id: Ia4f7c2df9f8dca3334906f0b482853002666ddd8
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/164484
Tested-by: Jenkins
Reviewed-by: Miklos Vajna 

diff --git a/cppuhelper/source/servicemanager.cxx 
b/cppuhelper/source/servicemanager.cxx
index 1e9c2dbbc192..9085e208ee25 100644
--- a/cppuhelper/source/servicemanager.cxx
+++ b/cppuhelper/source/servicemanager.cxx
@@ -1981,7 +1981,10 @@ void 
cppuhelper::ServiceManager::preloadImplementations() {
 if (std::find(aPreloaded.begin(), aPreloaded.end(), fpPreload) == 
aPreloaded.end())
 {
 aPreloaded.push_back(fpPreload);
+// unlock because we may be instantiating some services here
+g.unlock();
 fpPreload();
+g.lock();
 }
 }
 


core.git: cppuhelper/source unoidl/Library_unoidl.mk unoidl/source vcl/commonfuzzer.mk

2024-02-13 Thread Caolán McNamara (via logerrit)
 cppuhelper/source/servicemanager.cxx |9 -
 unoidl/Library_unoidl.mk |8 +++-
 unoidl/source/unoidl.cxx |9 +
 vcl/commonfuzzer.mk  |2 --
 4 files changed, 24 insertions(+), 4 deletions(-)

New commits:
commit ca1c8b447110321664a7a385dda5af6e303a91c8
Author: Caolán McNamara 
AuthorDate: Tue Feb 13 14:59:48 2024 +
Commit: Caolán McNamara 
CommitDate: Tue Feb 13 17:27:34 2024 +0100

we don't need the reg or store libraries for fuzzing

possibly other configations too, but just for fuzzing for the moment

from looking at:
https://oss-fuzz.com/coverage-report/job/libfuzzer_asan_libreoffice/latest
and see what is built but is 0% coverage and uninteresting to be non-0

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

diff --git a/cppuhelper/source/servicemanager.cxx 
b/cppuhelper/source/servicemanager.cxx
index cd981b8d1a87..1e9c2dbbc192 100644
--- a/cppuhelper/source/servicemanager.cxx
+++ b/cppuhelper/source/servicemanager.cxx
@@ -17,6 +17,8 @@
 #include 
 #include 
 
+#include 
+
 #include 
 #include 
 #include 
@@ -1364,7 +1366,9 @@ void cppuhelper::ServiceManager::readRdbFile(
 static_cast< cppu::OWeakObject * >(this));
 }
 SAL_INFO("cppuhelper", "Ignored optional " << uri);
-} catch (css::registry::InvalidRegistryException & e) {
+}
+#if !ENABLE_FUZZERS
+catch (css::registry::InvalidRegistryException & e) {
 if (!readLegacyRdbFile(uri)) {
 throw css::uno::DeploymentException(
 "InvalidRegistryException: " + e.Message,
@@ -1375,8 +1379,10 @@ void cppuhelper::ServiceManager::readRdbFile(
 throw;
 }
 }
+#endif
 }
 
+#if !ENABLE_FUZZERS
 bool cppuhelper::ServiceManager::readLegacyRdbFile(OUString const & uri) {
 Registry reg;
 switch (reg.open(uri, RegAccessMode::READONLY)) {
@@ -1511,6 +1517,7 @@ void cppuhelper::ServiceManager::readLegacyRdbStrings(
 strings->push_back(names.getElement(i).copy(prefix.getLength()));
 }
 }
+#endif
 
 void cppuhelper::ServiceManager::insertRdbFiles(
 std::vector< OUString > const & uris,
diff --git a/unoidl/Library_unoidl.mk b/unoidl/Library_unoidl.mk
index ff37972eec96..4b3dba1b5ab8 100644
--- a/unoidl/Library_unoidl.mk
+++ b/unoidl/Library_unoidl.mk
@@ -12,13 +12,19 @@ $(eval $(call gb_Library_Library,unoidl))
 $(eval $(call gb_Library_add_defs,unoidl,-DLO_DLLIMPLEMENTATION_UNOIDL))
 
 $(eval $(call gb_Library_add_exception_objects,unoidl, \
-unoidl/source/legacyprovider \
 unoidl/source/sourcefileprovider \
 unoidl/source/sourcetreeprovider \
 unoidl/source/unoidl \
 unoidl/source/unoidlprovider \
 ))
 
+# drop legacy provider for fuzzing
+ifeq (,$(filter FUZZERS,$(BUILD_TYPE)))
+$(eval $(call gb_Library_add_exception_objects,unoidl, \
+unoidl/source/legacyprovider \
+))
+endif
+
 $(eval $(call gb_Library_add_grammars,unoidl, \
 unoidl/source/sourceprovider-parser \
 ))
diff --git a/unoidl/source/unoidl.cxx b/unoidl/source/unoidl.cxx
index 2022bcd058ac..acf984613420 100644
--- a/unoidl/source/unoidl.cxx
+++ b/unoidl/source/unoidl.cxx
@@ -14,6 +14,8 @@
 #include 
 #include 
 
+#include 
+
 #include 
 #include 
 #include 
@@ -21,7 +23,9 @@
 #include 
 #include 
 
+#if !ENABLE_FUZZERS
 #include "legacyprovider.hxx"
+#endif
 #include "sourcefileprovider.hxx"
 #include "sourcetreeprovider.hxx"
 #include "unoidlprovider.hxx"
@@ -211,11 +215,16 @@ rtl::Reference< Provider > Manager::loadProvider(OUString 
const & uri) {
 try {
 return new detail::UnoidlProvider(uri);
 } catch (FileFormatException & e) {
+#if !ENABLE_FUZZERS
 SAL_INFO(
 "unoidl",
 "FileFormatException \"" << e.getDetail() << "\", retrying <" << 
uri
 << "> as legacy format");
 return new detail::LegacyProvider(*this, uri);
+#else
+(void)e;
+return nullptr;
+#endif
 }
 }
 
diff --git a/vcl/commonfuzzer.mk b/vcl/commonfuzzer.mk
index 476a68adb0a4..cca33194e9bc 100644
--- a/vcl/commonfuzzer.mk
+++ b/vcl/commonfuzzer.mk
@@ -148,8 +148,6 @@ fuzzer_core_libraries = \
 i18nlangtag \
 xmlreader \
 unoidl \
-reg \
-store \
 gcc3_uno \
 salhelper \
 sal \


core.git: cppuhelper/source cui/source dbaccess/source hwpfilter/source include/basegfx include/oox include/sfx2 oox/source sax/source sc/source sd/source sfx2/source starmath/source svtools/source sw

2023-12-10 Thread Caolán McNamara (via logerrit)
 cppuhelper/source/component.cxx  |4 +---
 cui/source/dialogs/scriptdlg.cxx |6 ++
 dbaccess/source/ui/querydesign/QueryDesignView.cxx   |5 +
 hwpfilter/source/hwpreader.cxx   |3 +--
 include/basegfx/color/bcolormodifier.hxx |2 +-
 include/oox/ppt/pptimport.hxx|2 +-
 include/oox/ppt/slidepersist.hxx |2 +-
 include/sfx2/viewsh.hxx  |2 +-
 oox/source/ppt/timetargetelementcontext.cxx  |3 +--
 sax/source/tools/CachedOutputStream.hxx  |2 +-
 sc/source/filter/inc/xichart.hxx |2 +-
 sc/source/ui/view/output.cxx |9 -
 sd/source/ui/dlg/TemplateScanner.cxx |3 +--
 sfx2/source/control/listview.cxx |3 +--
 sfx2/source/doc/doctempl.cxx |3 +--
 starmath/source/document.cxx |9 +++--
 svtools/source/control/tabbar.cxx|4 +---
 sw/source/core/access/accmap.cxx |3 +--
 sw/source/core/unocore/unostyle.cxx  |3 +--
 sw/source/ui/vba/vbacontentcontrollistentries.cxx|8 
 sw/source/ui/vba/vbaformfielddropdownlistentries.cxx |4 ++--
 sw/source/uibase/uno/unotxdoc.cxx|3 +--
 testtools/source/bridgetest/bridgetest.cxx   |9 +
 toolkit/source/controls/eventcontainer.cxx   |   14 +++---
 ucb/source/cacher/contentresultsetwrapper.cxx|6 +-
 vcl/inc/jsdialog/jsdialogbuilder.hxx |   11 +++
 vcl/jsdialog/jsdialogbuilder.cxx |7 ---
 writerfilter/source/dmapper/DomainMapperTableHandler.cxx |3 +--
 writerperfect/source/writer/exp/xmlimp.cxx   |3 +--
 29 files changed, 58 insertions(+), 80 deletions(-)

New commits:
commit 283aa103b9aa40ef96b022420fdea69a6fdfe41c
Author: Caolán McNamara 
AuthorDate: Sun Dec 10 12:50:43 2023 +
Commit: Caolán McNamara 
CommitDate: Sun Dec 10 17:41:18 2023 +0100

cid#1545177 COPY_INSTEAD_OF_MOVE

and

cid#1545179 COPY_INSTEAD_OF_MOVE
cid#1545187 COPY_INSTEAD_OF_MOVE
cid#1545188 COPY_INSTEAD_OF_MOVE
cid#1545189 COPY_INSTEAD_OF_MOVE
cid#1545196 COPY_INSTEAD_OF_MOVE
cid#1545197 COPY_INSTEAD_OF_MOVE
cid#1545204 COPY_INSTEAD_OF_MOVE
cid#1545223 COPY_INSTEAD_OF_MOVE
cid#1545236 COPY_INSTEAD_OF_MOVE
cid#1545239 COPY_INSTEAD_OF_MOVE
cid#1545253 COPY_INSTEAD_OF_MOVE
cid#1545274 COPY_INSTEAD_OF_MOVE
cid#1545286 COPY_INSTEAD_OF_MOVE
cid#1545309 COPY_INSTEAD_OF_MOVE
cid#1545311 COPY_INSTEAD_OF_MOVE
cid#1545345 COPY_INSTEAD_OF_MOVE
cid#1545358 COPY_INSTEAD_OF_MOVE
cid#1545361 COPY_INSTEAD_OF_MOVE
cid#1545365 COPY_INSTEAD_OF_MOVE
cid#1545367 COPY_INSTEAD_OF_MOVE
cid#1545372 COPY_INSTEAD_OF_MOVE
cid#1545373 COPY_INSTEAD_OF_MOVE
cid#1545377 COPY_INSTEAD_OF_MOVE
cid#1545392 COPY_INSTEAD_OF_MOVE
cid#1545399 COPY_INSTEAD_OF_MOVE
cid#1545404 COPY_INSTEAD_OF_MOVE
cid#1545408 COPY_INSTEAD_OF_MOVE
cid#1545430 COPY_INSTEAD_OF_MOVE
cid#1545439 COPY_INSTEAD_OF_MOVE
cid#1545449 COPY_INSTEAD_OF_MOVE

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

diff --git a/cppuhelper/source/component.cxx b/cppuhelper/source/component.cxx
index 369e2ead7be5..5c7226f93a1a 100644
--- a/cppuhelper/source/component.cxx
+++ b/cppuhelper/source/component.cxx
@@ -150,10 +150,8 @@ void OComponentHelper::dispose()
 {
 try
 {
-Reference xSource(
-Reference::query( static_cast(this) ) );
 EventObject aEvt;
-aEvt.Source = xSource;
+aEvt.Source = Reference::query( 
static_cast(this) );
 // inform all listeners to release this object
 // The listener container are automatically cleared
 rBHelper.aLC.disposeAndClear( aEvt );
diff --git a/cui/source/dialogs/scriptdlg.cxx b/cui/source/dialogs/scriptdlg.cxx
index 3f1cb9fd33e4..54cdc56d26e1 100644
--- a/cui/source/dialogs/scriptdlg.cxx
+++ b/cui/source/dialogs/scriptdlg.cxx
@@ -814,8 +814,7 @@ void SvxScriptOrgDialog::createEntry(const weld::TreeIter& 
rEntry)
 try
 {
 Any aResult = xInv->invoke( "Creatable", args, outIndex, outArgs );
-Reference< browse::XBrowseNode > newNode( aResult, UNO_QUERY );
-aChildNode = newNode;
+aChildNode.set(aResult, UNO_QUERY);
 
 }
 catch( Exception const & )
@@ -895,8 

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

2023-10-19 Thread Stephan Bergmann (via logerrit)
 cppuhelper/source/component_context.cxx |2 +-
 cppuhelper/source/macro_expander.cxx|4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

New commits:
commit 15b86648f031bb2b44b23a1826ad4ac2a00884b3
Author: Stephan Bergmann 
AuthorDate: Thu Oct 19 10:30:08 2023 +0200
Commit: Stephan Bergmann 
CommitDate: Thu Oct 19 14:41:21 2023 +0200

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

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

diff --git a/cppuhelper/source/component_context.cxx 
b/cppuhelper/source/component_context.cxx
index 21604a6bcd1b..da070bdf027c 100644
--- a/cppuhelper/source/component_context.cxx
+++ b/cppuhelper/source/component_context.cxx
@@ -47,7 +47,7 @@
 #include 
 #include 
 
-constexpr OUStringLiteral SMGR_SINGLETON = 
u"/singletons/com.sun.star.lang.theServiceManager";
+constexpr OUString SMGR_SINGLETON = 
u"/singletons/com.sun.star.lang.theServiceManager"_ustr;
 constexpr OUStringLiteral TDMGR_SINGLETON = 
u"/singletons/com.sun.star.reflection.theTypeDescriptionManager";
 constexpr OUStringLiteral AC_SINGLETON = 
u"/singletons/com.sun.star.security.theAccessController";
 
diff --git a/cppuhelper/source/macro_expander.cxx 
b/cppuhelper/source/macro_expander.cxx
index 0cf2fe99d268..ce227a7e76f4 100644
--- a/cppuhelper/source/macro_expander.cxx
+++ b/cppuhelper/source/macro_expander.cxx
@@ -34,8 +34,8 @@
 #include "macro_expander.hxx"
 #include "paths.hxx"
 
-constexpr OUStringLiteral SERVICE_NAME_A = u"com.sun.star.lang.MacroExpander";
-constexpr OUStringLiteral SERVICE_NAME_B = 
u"com.sun.star.lang.BootstrapMacroExpander";
+constexpr OUString SERVICE_NAME_A = u"com.sun.star.lang.MacroExpander"_ustr;
+constexpr OUString SERVICE_NAME_B = 
u"com.sun.star.lang.BootstrapMacroExpander"_ustr;
 constexpr OUStringLiteral IMPL_NAME = 
u"com.sun.star.lang.comp.cppuhelper.BootstrapMacroExpander";
 
 using namespace ::osl;


[Libreoffice-commits] core.git: cppuhelper/source editeng/source filter/source

2023-06-12 Thread Paris Oplopoios (via logerrit)
 cppuhelper/source/typemanager.cxx   |9 +++--
 editeng/source/misc/svxacorr.cxx|6 ++
 filter/source/msfilter/escherex.cxx |8 ++--
 3 files changed, 7 insertions(+), 16 deletions(-)

New commits:
commit 81e815edbf5b4694789aa1d7b9e3ecde08b08b21
Author: Paris Oplopoios 
AuthorDate: Mon Jun 12 02:11:44 2023 +0300
Commit: Paris Oplopoios 
CommitDate: Mon Jun 12 13:11:07 2023 +0200

tdf#153109 Use any_of instead of loop to check a range

Change-Id: Icf65288a7e53257008129b71e8d716b0b0c7f5fa
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152868
Tested-by: Paris Oplopoios 
Reviewed-by: Paris Oplopoios 

diff --git a/cppuhelper/source/typemanager.cxx 
b/cppuhelper/source/typemanager.cxx
index 0408234c4b39..29f7025cdf6a 100644
--- a/cppuhelper/source/typemanager.cxx
+++ b/cppuhelper/source/typemanager.cxx
@@ -19,6 +19,7 @@
 #include 
 #include 
 #include 
+#include 
 
 #include 
 #include 
@@ -1723,12 +1724,8 @@ bool Enumeration::matches(css::uno::TypeClass tc) const {
 if (!types_.hasElements()) {
 return true;
 }
-for (const auto & i : types_) {
-if (i == tc) {
-return true;
-}
-}
-return false;
+
+return std::any_of(types_.begin(), types_.end(), [](const auto& i) { 
return i == tc; });
 }
 
 void Enumeration::findNextMatch() {
diff --git a/editeng/source/misc/svxacorr.cxx b/editeng/source/misc/svxacorr.cxx
index 318da6536df9..7959b9c2ba83 100644
--- a/editeng/source/misc/svxacorr.cxx
+++ b/editeng/source/misc/svxacorr.cxx
@@ -19,6 +19,7 @@
 
 #include 
 #include 
+#include 
 #include 
 #include 
 
@@ -175,10 +176,7 @@ static bool lcl_IsSymbolChar( CharClass const & rCC, const 
OUString& rTxt,
 
 static bool lcl_IsInArr(std::u16string_view arr, const sal_uInt32 c)
 {
-for (const auto c1 : arr)
-if (c1 == c)
-return true;
-return false;
+return std::any_of(arr.begin(), arr.end(), [c](const auto c1) { return c1 
== c; });
 }
 
 SvxAutoCorrDoc::~SvxAutoCorrDoc()
diff --git a/filter/source/msfilter/escherex.cxx 
b/filter/source/msfilter/escherex.cxx
index 6ab8eb844580..1f74c795d3f9 100644
--- a/filter/source/msfilter/escherex.cxx
+++ b/filter/source/msfilter/escherex.cxx
@@ -3789,12 +3789,8 @@ EscherPersistTable::~EscherPersistTable()
 
 bool EscherPersistTable::PtIsID( sal_uInt32 nID )
 {
-for(auto const & pPtr : maPersistTable) {
-if ( pPtr->mnID == nID ) {
-return true;
-}
-}
-return false;
+return std::any_of(maPersistTable.begin(), maPersistTable.end(),
+[](const auto& rxEntry) { return rxEntry->mnID == nID; });
 }
 
 void EscherPersistTable::PtInsert( sal_uInt32 nID, sal_uInt32 nOfs )


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

2023-05-10 Thread Noel Grandin (via logerrit)
 cppuhelper/source/macro_expander.cxx |   18 +++---
 1 file changed, 3 insertions(+), 15 deletions(-)

New commits:
commit 89e0a3e05dc00339b1d7b4e14443bdf26f9d09c1
Author: Noel Grandin 
AuthorDate: Sun May 7 12:46:01 2023 +0200
Commit: Noel Grandin 
CommitDate: Wed May 10 08:01:47 2023 +0200

use WeakComponentImplHelper2 in Bootstrap_MacroExpander

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

diff --git a/cppuhelper/source/macro_expander.cxx 
b/cppuhelper/source/macro_expander.cxx
index 93f758becc12..0cf2fe99d268 100644
--- a/cppuhelper/source/macro_expander.cxx
+++ b/cppuhelper/source/macro_expander.cxx
@@ -24,7 +24,7 @@
 #include 
 
 #include 
-#include 
+#include 
 #include 
 
 #include 
@@ -83,22 +83,13 @@ Sequence< OUString > const & s_get_service_names()
 return IMPL_NAMES;
 }
 
-typedef cppu::WeakComponentImplHelper<
+typedef cppuhelper::WeakComponentImplHelper2<
 util::XMacroExpander, lang::XServiceInfo > t_uno_impl;
 
-struct mutex_holder
+class Bootstrap_MacroExpander : public t_uno_impl
 {
-Mutex m_mutex;
-};
-
-class Bootstrap_MacroExpander : public mutex_holder, public t_uno_impl
-{
-protected:
-virtual void SAL_CALL disposing() override;
-
 public:
 Bootstrap_MacroExpander()
-: t_uno_impl( m_mutex )
 {}
 
 // XMacroExpander impl
@@ -110,9 +101,6 @@ public:
 };
 
 
-void Bootstrap_MacroExpander::disposing()
-{}
-
 // XServiceInfo impl
 
 OUString Bootstrap_MacroExpander::getImplementationName()


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

2023-05-10 Thread Noel Grandin (via logerrit)
 cppuhelper/source/servicemanager.cxx |   41 +--
 cppuhelper/source/servicemanager.hxx |   18 +--
 2 files changed, 28 insertions(+), 31 deletions(-)

New commits:
commit 8809b57da900c0fa8e7aa9d05021fe9a00114ecd
Author: Noel Grandin 
AuthorDate: Sun May 7 12:44:36 2023 +0200
Commit: Noel Grandin 
CommitDate: Wed May 10 08:01:25 2023 +0200

use WeakComponentImplHelper2 in ServiceManager

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

diff --git a/cppuhelper/source/servicemanager.cxx 
b/cppuhelper/source/servicemanager.cxx
index 86d89e445dd4..7eccd274e7f4 100644
--- a/cppuhelper/source/servicemanager.cxx
+++ b/cppuhelper/source/servicemanager.cxx
@@ -795,7 +795,7 @@ void cppuhelper::ServiceManager::loadImplementation(
 {
 assert(implementation);
 {
-osl::MutexGuard g(rBHelper.rMutex);
+std::unique_lock g(m_aMutex);
 if (implementation->status == Data::Implementation::STATUS_LOADED) {
 return;
 }
@@ -871,8 +871,8 @@ void cppuhelper::ServiceManager::loadImplementation(
 //TODO: There is a race here, as the relevant service factory can be 
removed
 // while the mutex is unlocked and loading can thus fail, as the entity 
from
 // which to load can disappear once the service factory is removed.
-osl::MutexGuard g(rBHelper.rMutex);
-if (!(isDisposed()
+std::unique_lock g(m_aMutex);
+if (!(m_bDisposed
   || implementation->status == Data::Implementation::STATUS_LOADED))
 {
 implementation->status = Data::Implementation::STATUS_LOADED;
@@ -882,12 +882,11 @@ void cppuhelper::ServiceManager::loadImplementation(
 }
 }
 
-void cppuhelper::ServiceManager::disposing() {
+void cppuhelper::ServiceManager::disposing(std::unique_lock& 
rGuard) {
 std::vector< css::uno::Reference > sngls;
 std::vector< css::uno::Reference< css::lang::XComponent > > comps;
 Data clear;
 {
-osl::MutexGuard g(rBHelper.rMutex);
 for (const auto& rEntry : data_.namedImplementations)
 {
 assert(rEntry.second);
@@ -916,6 +915,7 @@ void cppuhelper::ServiceManager::disposing() {
 data_.services.swap(clear.services);
 data_.singletons.swap(clear.singletons);
 }
+rGuard.unlock();
 for (const auto& rxSngl : sngls)
 {
 try {
@@ -928,6 +928,7 @@ void cppuhelper::ServiceManager::disposing() {
 {
 removeEventListenerFromComponent(rxComp);
 }
+rGuard.lock();
 }
 
 void cppuhelper::ServiceManager::initialize(
@@ -983,8 +984,8 @@ cppuhelper::ServiceManager::createInstanceWithArguments(
 css::uno::Sequence< OUString >
 cppuhelper::ServiceManager::getAvailableServiceNames()
 {
-osl::MutexGuard g(rBHelper.rMutex);
-if (isDisposed()) {
+std::unique_lock g(m_aMutex);
+if (m_bDisposed) {
 return css::uno::Sequence< OUString >();
 }
 if (data_.services.size() > o3tl::make_unsigned(SAL_MAX_INT32)) {
@@ -1025,7 +1026,7 @@ css::uno::Type 
cppuhelper::ServiceManager::getElementType()
 
 sal_Bool cppuhelper::ServiceManager::hasElements()
 {
-osl::MutexGuard g(rBHelper.rMutex);
+std::unique_lock g(m_aMutex);
 return
 !(data_.namedImplementations.empty()
   && data_.dynamicImplementations.empty());
@@ -1138,7 +1139,7 @@ cppuhelper::ServiceManager::createContentEnumeration(
 {
 std::vector< std::shared_ptr< Data::Implementation > > impls;
 {
-osl::MutexGuard g(rBHelper.rMutex);
+std::unique_lock g(m_aMutex);
 Data::ImplementationMap::const_iterator i(
 data_.services.find(aServiceName));
 if (i != data_.services.end()) {
@@ -1151,8 +1152,8 @@ cppuhelper::ServiceManager::createContentEnumeration(
 Data::Implementation * impl = rxImpl.get();
 assert(impl != nullptr);
 {
-osl::MutexGuard g(rBHelper.rMutex);
-if (isDisposed()) {
+std::unique_lock g(m_aMutex);
+if (m_bDisposed) {
 factories.clear();
 break;
 }
@@ -1572,8 +1573,8 @@ void cppuhelper::ServiceManager::insertLegacyFactory(
 
 bool cppuhelper::ServiceManager::insertExtraData(Data const & extra) {
 {
-osl::MutexGuard g(rBHelper.rMutex);
-if (isDisposed()) {
+std::unique_lock g(m_aMutex);
+if (m_bDisposed) {
 return false;
 }
 auto i = std::find_if(extra.namedImplementations.begin(), 
extra.namedImplementations.end(),
@@ -1651,7 +1652,7 @@ void cppuhelper::ServiceManager::removeRdbFiles(
 // it is called with a uris vector of size one):
 std::vector< std::shared_ptr< Data::Implementation > > clear;
 {
-osl::MutexGuard g(rBHelper.rMutex);
+std::unique_lock g(m_aMutex);
 for (const auto& rUri : uris)
 

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

2023-05-09 Thread Noel Grandin (via logerrit)
 cppuhelper/source/typemanager.cxx |3 ---
 cppuhelper/source/typemanager.hxx |9 +++--
 2 files changed, 3 insertions(+), 9 deletions(-)

New commits:
commit 94aba9289af06b3a18f143d1253467f32c4af2cd
Author: Noel Grandin 
AuthorDate: Sun May 7 12:20:57 2023 +0200
Commit: Noel Grandin 
CommitDate: Tue May 9 18:15:20 2023 +0200

use WeakComponentImplHelper2 in TypeManager

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

diff --git a/cppuhelper/source/typemanager.cxx 
b/cppuhelper/source/typemanager.cxx
index bede11f7c405..0408234c4b39 100644
--- a/cppuhelper/source/typemanager.cxx
+++ b/cppuhelper/source/typemanager.cxx
@@ -1825,7 +1825,6 @@ void Enumeration::findNextMatch() {
 }
 
 cppuhelper::TypeManager::TypeManager():
-TypeManager_Base(m_aMutex),
 manager_(new unoidl::Manager)
 {}
 
@@ -1906,8 +1905,6 @@ cppuhelper::TypeManager::resolve(OUString const & name) {
 
 cppuhelper::TypeManager::~TypeManager() noexcept {}
 
-void cppuhelper::TypeManager::disposing() {} //TODO
-
 OUString cppuhelper::TypeManager::getImplementationName()
 {
 return
diff --git a/cppuhelper/source/typemanager.hxx 
b/cppuhelper/source/typemanager.hxx
index 24fe0ef12166..ab1dc4fdbe71 100644
--- a/cppuhelper/source/typemanager.hxx
+++ b/cppuhelper/source/typemanager.hxx
@@ -20,8 +20,7 @@
 #include 
 #include 
 #include 
-#include 
-#include 
+#include 
 #include 
 #include 
 
@@ -37,12 +36,12 @@ namespace unoidl {
 
 namespace cppuhelper {
 
-typedef cppu::WeakComponentImplHelper<
+typedef WeakComponentImplHelper2<
 css::lang::XServiceInfo, css::container::XHierarchicalNameAccess,
 css::container::XSet, css::reflection::XTypeDescriptionEnumerationAccess >
 TypeManager_Base;
 
-class TypeManager: private cppu::BaseMutex, public TypeManager_Base {
+class TypeManager: public TypeManager_Base {
 public:
 TypeManager();
 
@@ -59,8 +58,6 @@ public:
 private:
 virtual ~TypeManager() noexcept override;
 
-virtual void SAL_CALL disposing() override;
-
 virtual OUString SAL_CALL getImplementationName() override;
 
 virtual sal_Bool SAL_CALL supportsService(OUString const & ServiceName) 
override;


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

2023-03-22 Thread Stephan Bergmann (via logerrit)
 cppuhelper/source/paths.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 27f9a9cfa76fa584477e89f13b33720b5edbd570
Author: Stephan Bergmann 
AuthorDate: Wed Mar 22 21:43:09 2023 +0100
Commit: Stephan Bergmann 
CommitDate: Wed Mar 22 21:51:01 2023 +

OUString::match -> OUString::startsWith

(which reads better in combination with the following
OUString::endsWithIgnoreAsciiCase)

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

diff --git a/cppuhelper/source/paths.cxx b/cppuhelper/source/paths.cxx
index dd8fe56df2bf..28a1d34658b3 100644
--- a/cppuhelper/source/paths.cxx
+++ b/cppuhelper/source/paths.cxx
@@ -101,7 +101,7 @@ bool cppu::nextDirectoryItem(osl::Directory & directory, 
OUString * url) {
 if (stat.getFileType() != osl::FileStatus::Directory) { //TODO: 
symlinks
 // Ignore backup and spurious junk files:
 OUString name(stat.getFileName());
-if (name.match(".") || !name.endsWithIgnoreAsciiCase(u".rdb")) {
+if (name.startsWith(".") || 
!name.endsWithIgnoreAsciiCase(u".rdb")) {
 SAL_WARN("cppuhelper", "ignoring <" << stat.getFileURL() << 
">");
 } else {
 *url = stat.getFileURL();


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

2023-03-19 Thread Arnaud VERSINI (via logerrit)
 cppuhelper/source/factory.cxx |   32 ++--
 1 file changed, 14 insertions(+), 18 deletions(-)

New commits:
commit 048d01ff0f0869be3b63ad62ea15e52f3727f617
Author: Arnaud VERSINI 
AuthorDate: Sun Mar 19 17:00:20 2023 +0100
Commit: Noel Grandin 
CommitDate: Mon Mar 20 05:45:35 2023 +

cppuhelper : use BaseMutex instead of OFactoryComponentHelper_Mutex

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

diff --git a/cppuhelper/source/factory.cxx b/cppuhelper/source/factory.cxx
index 85d32383a0ce..9a08674d7bdd 100644
--- a/cppuhelper/source/factory.cxx
+++ b/cppuhelper/source/factory.cxx
@@ -20,6 +20,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -58,13 +59,8 @@ namespace cppu
 
 namespace {
 
-struct OFactoryComponentHelper_Mutex
-{
-Mutex   aMutex;
-};
-
 class OFactoryComponentHelper
-: public OFactoryComponentHelper_Mutex
+: public cppu::BaseMutex
 , public WeakComponentImplHelper<
   XServiceInfo,
   XSingleServiceFactory,
@@ -79,7 +75,7 @@ public:
 ComponentFactoryFunc fptr,
 const Sequence< OUString > * pServiceNames_,
 bool bOneInstance_ )
-: WeakComponentImplHelper( aMutex )
+: WeakComponentImplHelper( m_aMutex )
 , bOneInstance( bOneInstance_ )
 , xSMgr( rServiceManager )
 , pCreateFunction( pCreateFunction_ )
@@ -188,7 +184,7 @@ Reference 
OFactoryComponentHelper::createInstance()
 {
 if( !xTheInstance.is() )
 {
-MutexGuard aGuard( aMutex );
+MutexGuard aGuard( m_aMutex );
 if( !xTheInstance.is() )
 xTheInstance = createInstanceEveryTime( Reference< 
XComponentContext >() );
 }
@@ -204,7 +200,7 @@ Reference 
OFactoryComponentHelper::createInstanceWithArguments(
 {
 if( !xTheInstance.is() )
 {
-MutexGuard aGuard( aMutex );
+MutexGuard aGuard( m_aMutex );
 //  OSL_ENSURE( !xTheInstance.is(), "### arguments will be ignored!" );
 if( !xTheInstance.is() )
 xTheInstance = createInstanceWithArgumentsEveryTime(
@@ -224,7 +220,7 @@ Reference< XInterface > 
OFactoryComponentHelper::createInstanceWithContext(
 {
 if( !xTheInstance.is() )
 {
-MutexGuard aGuard( aMutex );
+MutexGuard aGuard( m_aMutex );
 //  OSL_ENSURE( !xTheInstance.is(), "### context will be ignored!" );
 if( !xTheInstance.is() )
 xTheInstance = createInstanceEveryTime( xContext );
@@ -242,7 +238,7 @@ Reference< XInterface > 
OFactoryComponentHelper::createInstanceWithArgumentsAndC
 {
 if( !xTheInstance.is() )
 {
-MutexGuard aGuard( aMutex );
+MutexGuard aGuard( m_aMutex );
 //  OSL_ENSURE( !xTheInstance.is(), "### context and arguments will be 
ignored!" );
 if( !xTheInstance.is() )
 xTheInstance = createInstanceWithArgumentsEveryTime( 
rArguments, xContext );
@@ -291,7 +287,7 @@ void OFactoryComponentHelper::disposing()
 Reference x;
 {
 // do not delete in the guard section
-MutexGuard aGuard( aMutex );
+MutexGuard aGuard( m_aMutex );
 x = xTheInstance;
 xTheInstance.clear();
 }
@@ -449,7 +445,7 @@ Sequence< Type > ORegistryFactoryHelper::getTypes()
 Reference< beans::XPropertySetInfo >
 ORegistryFactoryHelper::getPropertySetInfo()
 {
-::osl::MutexGuard guard( aMutex );
+::osl::MutexGuard guard( m_aMutex );
 if (! m_xInfo.is())
 m_xInfo = createPropertySetInfo( getInfoHelper() );
 return m_xInfo;
@@ -459,7 +455,7 @@ ORegistryFactoryHelper::getPropertySetInfo()
 
 IPropertyArrayHelper & ORegistryFactoryHelper::getInfoHelper()
 {
-::osl::MutexGuard guard( aMutex );
+::osl::MutexGuard guard( m_aMutex );
 if (m_property_array_helper == nullptr)
 {
 beans::Property prop(
@@ -516,7 +512,7 @@ Reference 
ORegistryFactoryHelper::createInstanceEveryTime(
 Reference< XInterface > x( createModuleFactory() );
 if (x.is())
 {
-MutexGuard aGuard( aMutex );
+MutexGuard aGuard( m_aMutex );
 if( !xModuleFactory.is() && !xModuleFactoryDepr.is() )
 {
 xModuleFactory.set( x, UNO_QUERY );
@@ -544,7 +540,7 @@ Reference SAL_CALL 
ORegistryFactoryHelper::createInstanceWithArgume
 Reference< XInterface > x( createModuleFactory() );
 if (x.is())
 {
-MutexGuard aGuard( aMutex );
+MutexGuard aGuard( m_aMutex );
 if( !xModuleFactory.is() && !xModuleFactoryDepr.is() )
 {
 xModuleFactory.set( x, UNO_QUERY );
@@ -574,7 +570,7 @@ Reference< XInterface > 

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

2023-03-19 Thread Arnaud VERSINI (via logerrit)
 cppuhelper/source/access_control.cxx |   10 ++
 1 file changed, 2 insertions(+), 8 deletions(-)

New commits:
commit d4822aa45017349fcff36e9a61e1e5b0237b208f
Author: Arnaud VERSINI 
AuthorDate: Sun Mar 19 17:06:40 2023 +0100
Commit: Noel Grandin 
CommitDate: Mon Mar 20 05:45:07 2023 +

cppuhelper : use constexpr OUStringLiteral instead of a function

Change-Id: Icc25698e4213edbeaae1a997dccbee0ff529ce3b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/149092
Reviewed-by: Noel Grandin 
Tested-by: Noel Grandin 

diff --git a/cppuhelper/source/access_control.cxx 
b/cppuhelper/source/access_control.cxx
index 0e18ef78684a..da8343648a95 100644
--- a/cppuhelper/source/access_control.cxx
+++ b/cppuhelper/source/access_control.cxx
@@ -30,20 +30,14 @@ using namespace ::osl;
 using namespace ::com::sun::star;
 using namespace ::com::sun::star::uno;
 
-namespace
-{
-OUString str_ac_singleton()
-{
-return "/singletons/com.sun.star.security.theAccessController";
-}
-}
+constexpr OUStringLiteral ACCESS_CONTROLLER_SINGLETON = 
u"/singletons/com.sun.star.security.theAccessController";
 
 namespace cppu
 {
 
 AccessControl::AccessControl( Reference< XComponentContext > const & xContext )
 {
-if (! (xContext->getValueByName( str_ac_singleton() ) >>= m_xController))
+if (! (xContext->getValueByName( ACCESS_CONTROLLER_SINGLETON ) >>= 
m_xController))
 {
 throw SecurityException( "no access controller!" );
 }


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

2023-01-13 Thread Stephan Bergmann (via logerrit)
 cppuhelper/source/factory.cxx |   61 --
 1 file changed, 12 insertions(+), 49 deletions(-)

New commits:
commit 55b534660e3fc99a4e4e07cf05df7798e9ba0726
Author: Stephan Bergmann 
AuthorDate: Fri Jan 13 08:37:12 2023 +0100
Commit: Stephan Bergmann 
CommitDate: Fri Jan 13 09:37:49 2023 +

OFactoryComponentHelper's XAggregation is apparently unused

It had been using cppu::OComponentHelper (which derives from XAggregation) 
ever
since b525a3115f54576017a576ff842dede5e2e3545d "initial import", bug e.g.
ORegistryFactoryHelper deriving from it implements queryInterface in a way 
that
is incompatible with XAggregation (it should only have forwarded to
OFactoryComponentHelper::queryInterface, and rather implemented its logic 
in an
ORegistryFactoryHelper::queryAggregation override).

Also, without this commit but instead with a local

> diff --git a/cppuhelper/source/factory.cxx b/cppuhelper/source/factory.cxx
> index c8efcab0e604..9011264b3f3a 100644
> --- a/cppuhelper/source/factory.cxx
> +++ b/cppuhelper/source/factory.cxx
> @@ -241,6 +241,7 @@ class OFactoryComponentHelper
>  , public OComponentHelper
>  , public OSingleFactoryHelper
>  {
> +void SAL_CALL setDelegator(css::uno::Reference 
const &) final { assert(false); }
>  public:
>  OFactoryComponentHelper(
>  const Reference & rServiceManager,

`make check` still succeeded for me on Linux, without hitting that injected
assert that should have fired if that XAggregation mechanism had been used 
after
all.

So switch from OComponentHelper to WeakComponentImplHelper here (which is 
the
simplest implementation helper to use, even if it still needs the 
non-standard
OFactoryComponentHelper::getTypes overriding the non-fitting
WeakComponentImplHelper default implementation).

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

diff --git a/cppuhelper/source/factory.cxx b/cppuhelper/source/factory.cxx
index 6d5cdc7b23bc..85d32383a0ce 100644
--- a/cppuhelper/source/factory.cxx
+++ b/cppuhelper/source/factory.cxx
@@ -21,7 +21,7 @@
 #include 
 #include 
 #include 
-#include 
+#include 
 #include 
 #include 
 #include 
@@ -65,11 +65,11 @@ struct OFactoryComponentHelper_Mutex
 
 class OFactoryComponentHelper
 : public OFactoryComponentHelper_Mutex
-, public OComponentHelper
-, public XServiceInfo
-, public XSingleServiceFactory
-, public lang::XSingleComponentFactory
-, public XUnloadingPreference
+, public WeakComponentImplHelper<
+  XServiceInfo,
+  XSingleServiceFactory,
+  lang::XSingleComponentFactory,
+  XUnloadingPreference>
 {
 public:
 OFactoryComponentHelper(
@@ -79,7 +79,7 @@ public:
 ComponentFactoryFunc fptr,
 const Sequence< OUString > * pServiceNames_,
 bool bOneInstance_ )
-: OComponentHelper( aMutex )
+: WeakComponentImplHelper( aMutex )
 , bOneInstance( bOneInstance_ )
 , xSMgr( rServiceManager )
 , pCreateFunction( pCreateFunction_ )
@@ -90,13 +90,6 @@ public:
 aServiceNames = *pServiceNames_;
 }
 
-// XInterface
-Any SAL_CALL queryInterface( const Type & rType ) override;
-void SAL_CALL acquire() noexcept override
-{ OComponentHelper::acquire(); }
-void SAL_CALL release() noexcept override
-{ OComponentHelper::release(); }
-
 // XSingleServiceFactory
 Reference SAL_CALL createInstance() override;
 Reference SAL_CALL createInstanceWithArguments( const 
Sequence& Arguments ) override;
@@ -114,16 +107,12 @@ public:
 
 // XTypeProvider
 virtual Sequence< Type > SAL_CALL getTypes() override;
-virtual Sequence< sal_Int8 > SAL_CALL getImplementationId() override;
-
-// XAggregation
-Any SAL_CALL queryAggregation( const Type & rType ) override;
 
 // XUnloadingPreference
 virtual sal_Bool SAL_CALL releaseOnNotification() override;
 
-// OComponentHelper
-void SAL_CALL dispose() override;
+// WeakComponentImplHelper
+void SAL_CALL disposing() override;
 
 private:
 css::uno::Reference 
createInstanceWithArgumentsEveryTime(
@@ -156,25 +145,6 @@ protected:
 
 }
 
-Any SAL_CALL OFactoryComponentHelper::queryInterface( const Type & rType )
-{
-return OComponentHelper::queryInterface( rType );
-}
-
-// XAggregation
-Any OFactoryComponentHelper::queryAggregation( const Type & rType )
-{
-Any aRet( OComponentHelper::queryAggregation( rType ) );
-return (aRet.hasValue()
-? aRet
-: ::cppu::queryInterface(
-rType,
-static_cast< XSingleComponentFactory * >( this ),
-static_cast< XSingleServiceFactory * >( this ),
- 

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

2023-01-12 Thread Stephan Bergmann (via logerrit)
 cppuhelper/source/factory.cxx |   19 ---
 1 file changed, 16 insertions(+), 3 deletions(-)

New commits:
commit c945eafc99856f0bcd0a99195e2c5164c2a6d24a
Author: Stephan Bergmann 
AuthorDate: Thu Jan 12 20:44:10 2023 +0100
Commit: Stephan Bergmann 
CommitDate: Thu Jan 12 22:19:36 2023 +

Don't let OSingleFactoryHelper delegate to derived classes' virtual 
overrides

...as it doesn't make sense that e.g. 
OFactoryComponentHelper::createInstance
checked for bOneInstance, called OSingleFactoryHelper::createInstance, which
called [OFactoryComponentHelper::]createInstanceWithContext, which checked 
for
bOneInstance again

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

diff --git a/cppuhelper/source/factory.cxx b/cppuhelper/source/factory.cxx
index c4797f85504a..37ac44ffa1a5 100644
--- a/cppuhelper/source/factory.cxx
+++ b/cppuhelper/source/factory.cxx
@@ -116,6 +116,11 @@ protected:
 ComponentFactoryFunc m_fptr;
 Sequence< OUString > aServiceNames;
 OUString aImplementationName;
+
+private:
+css::uno::Reference 
createInstanceWithArgumentsEveryTime(
+css::uno::Sequence const & rArguments,
+css::uno::Reference const & xContext);
 };
 
 }
@@ -160,14 +165,14 @@ Reference 
OSingleFactoryHelper::createInstanceEveryTime(
 // XSingleServiceFactory
 Reference OSingleFactoryHelper::createInstance()
 {
-return createInstanceWithContext( Reference< XComponentContext >() );
+return createInstanceEveryTime( Reference< XComponentContext >() );
 }
 
 // XSingleServiceFactory
 Reference OSingleFactoryHelper::createInstanceWithArguments(
 const Sequence& Arguments )
 {
-return createInstanceWithArgumentsAndContext(
+return createInstanceWithArgumentsEveryTime(
 Arguments, Reference< XComponentContext >() );
 }
 
@@ -183,7 +188,15 @@ Reference< XInterface > 
OSingleFactoryHelper::createInstanceWithArgumentsAndCont
 Sequence< Any > const & rArguments,
 Reference< XComponentContext > const & xContext )
 {
-Reference< XInterface > xRet( createInstanceWithContext( xContext ) );
+return createInstanceWithArgumentsEveryTime(rArguments, xContext);
+}
+
+css::uno::Reference
+OSingleFactoryHelper::createInstanceWithArgumentsEveryTime(
+css::uno::Sequence const & rArguments,
+css::uno::Reference const & xContext)
+{
+Reference< XInterface > xRet( createInstanceEveryTime( xContext ) );
 
 Reference< lang::XInitialization > xInit( xRet, UNO_QUERY );
 // always call initialize, even if there are no arguments. #i63511#


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

2023-01-12 Thread Stephan Bergmann (via logerrit)
 cppuhelper/source/factory.cxx |6 --
 1 file changed, 6 deletions(-)

New commits:
commit ca3ba86fe17227089d797f4f46cf228af97de3b3
Author: Stephan Bergmann 
AuthorDate: Thu Jan 12 21:39:16 2023 +0100
Commit: Stephan Bergmann 
CommitDate: Thu Jan 12 21:38:06 2023 +

Fix aggregating OFactoryComponentHelper::queryInterface

4bfc00aca2441082842f91dfba15886258674227 "#67468# factories support
XUnloadingPreference now" had added the check for XUnloadingPreference 
there,
but that's already covered by OFactoryComponentHelper::queryAggregation
delegating to OSingleFactoryHelper::queryInterface.  (And as
OFactoryComponentHelper is inheriting XAggregation via OComponentHelper, the
only thing that OFactoryComponentHelper::queryInterface shall do is 
delegate to
OComponentHelper::queryInterface.)

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

diff --git a/cppuhelper/source/factory.cxx b/cppuhelper/source/factory.cxx
index c8efcab0e604..c4797f85504a 100644
--- a/cppuhelper/source/factory.cxx
+++ b/cppuhelper/source/factory.cxx
@@ -298,12 +298,6 @@ protected:
 
 Any SAL_CALL OFactoryComponentHelper::queryInterface( const Type & rType )
 {
-if( rType == cppu::UnoType::get() )
-{
-return Any(
-Reference< XUnloadingPreference >(
-static_cast< XUnloadingPreference * >(this) ) );
-}
 return OComponentHelper::queryInterface( rType );
 }
 


[Libreoffice-commits] core.git: cppuhelper/source desktop/source package/source slideshow/source stoc/source sw/source testtools/source toolkit/source ucb/source vcl/source vcl/unx vcl/workben

2023-01-09 Thread Arnaud VERSINI (via logerrit)
 cppuhelper/source/bootstrap.cxx   |3 ++-
 desktop/source/app/officeipcthread.cxx|   16 
 desktop/source/deployment/misc/dp_misc.cxx|3 ++-
 package/source/zipapi/ZipOutputStream.cxx |4 +++-
 slideshow/source/engine/slideshowimpl.cxx |3 ++-
 stoc/source/javaloader/javaloader.cxx |5 +++--
 sw/source/core/docnode/finalthreadmanager.cxx |5 +++--
 testtools/source/bridgetest/cppobj.cxx|3 ++-
 toolkit/source/awt/vclxtoolkit.cxx|3 ++-
 ucb/source/ucp/webdav-curl/SerfLockStore.cxx  |7 +++
 vcl/source/opengl/OpenGLContext.cxx   |3 ++-
 vcl/unx/generic/dtrans/X11_selection.cxx  |5 +++--
 vcl/workben/vcldemo.cxx   |3 ++-
 13 files changed, 33 insertions(+), 30 deletions(-)

New commits:
commit 555f4333182abd0ca4aa06b354763f6dfbc3eb20
Author: Arnaud VERSINI 
AuthorDate: Sun Nov 6 17:04:20 2022 +0100
Commit: Stephan Bergmann 
CommitDate: Mon Jan 9 08:37:35 2023 +

use std::this_thread::sleep_for instead of osl equivalent

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

diff --git a/cppuhelper/source/bootstrap.cxx b/cppuhelper/source/bootstrap.cxx
index f468518ba456..bd975460f06c 100644
--- a/cppuhelper/source/bootstrap.cxx
+++ b/cppuhelper/source/bootstrap.cxx
@@ -21,6 +21,7 @@
 
 #include 
 #include 
+#include 
 
 #include 
 #include 
@@ -215,7 +216,7 @@ Reference< XComponentContext > SAL_CALL bootstrap()
 catch ( connection::NoConnectException & )
 {
 // wait 500 ms, then try to connect again
-::osl::Thread::wait( std::chrono::milliseconds(500) );
+std::this_thread::sleep_for(std::chrono::milliseconds(500));
 }
 }
 }
diff --git a/desktop/source/app/officeipcthread.cxx 
b/desktop/source/app/officeipcthread.cxx
index 45b8906c3b42..74f838939bfa 100644
--- a/desktop/source/app/officeipcthread.cxx
+++ b/desktop/source/app/officeipcthread.cxx
@@ -48,6 +48,7 @@
 #include 
 #include 
 #include 
+#include 
 
 #if ENABLE_DBUS
 #include 
@@ -792,10 +793,7 @@ RequestHandler::Status 
PipeIpcThread::enable(rtl::Reference * thread)
 else
 {
 // Pipe connection failed (other office exited or crashed)
-TimeValue tval;
-tval.Seconds = 0;
-tval.Nanosec = 5;
-salhelper::Thread::wait( tval );
+std::this_thread::sleep_for( std::chrono::milliseconds(500) );
 }
 }
 else
@@ -805,10 +803,7 @@ RequestHandler::Status 
PipeIpcThread::enable(rtl::Reference * thread)
 return RequestHandler::IPC_STATUS_PIPE_ERROR;
 
 // Wait for second office to be ready
-TimeValue aTimeValue;
-aTimeValue.Seconds = 0;
-aTimeValue.Nanosec = 1000; // 10ms
-salhelper::Thread::wait( aTimeValue );
+std::this_thread::sleep_for( std::chrono::milliseconds(10) );
 }
 
 } while ( nPipeMode == PIPEMODE_DONTKNOW );
@@ -1206,10 +1201,7 @@ void PipeIpcThread::execute()
 }
 
 SAL_WARN( "desktop.app", "Error on accept: " << 
static_cast(nError));
-TimeValue tval;
-tval.Seconds = 1;
-tval.Nanosec = 0;
-salhelper::Thread::wait( tval );
+std::this_thread::sleep_for( std::chrono::seconds(1) );
 }
 } while( schedule() );
 }
diff --git a/desktop/source/deployment/misc/dp_misc.cxx 
b/desktop/source/deployment/misc/dp_misc.cxx
index 2983de24b959..bbe3a085fc68 100644
--- a/desktop/source/deployment/misc/dp_misc.cxx
+++ b/desktop/source/deployment/misc/dp_misc.cxx
@@ -46,6 +46,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -447,7 +448,7 @@ Reference resolveUnoURL(
 catch (const connection::NoConnectException &) {
 if (i < 40)
 {
-::osl::Thread::wait( std::chrono::milliseconds(500) );
+std::this_thread::sleep_for( std::chrono::milliseconds(500) );
 }
 else throw;
 }
diff --git a/package/source/zipapi/ZipOutputStream.cxx 
b/package/source/zipapi/ZipOutputStream.cxx
index 9b582c4691e8..df21f1ffeb13 100644
--- a/package/source/zipapi/ZipOutputStream.cxx
+++ b/package/source/zipapi/ZipOutputStream.cxx
@@ -32,6 +32,8 @@
 #include 
 #include 
 
+#include 
+
 using namespace com::sun::star;
 using namespace com::sun::star::io;
 using namespace com::sun::star::uno;
@@ -151,7 +153,7 @@ void 
ZipOutputStream::reduceScheduledThreadTasksToGivenNumberOrLess(std::size_t
 
 if(m_aEntries.size() > nThreadTasks)
 {
-osl::Thread::wait(std::chrono::microseconds(100));
+

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

2022-06-02 Thread Stephan Bergmann (via logerrit)
 cppuhelper/source/typemanager.cxx |4 ++--
 cppuhelper/source/typemanager.hxx |4 +++-
 2 files changed, 5 insertions(+), 3 deletions(-)

New commits:
commit e3b48ed3b8ca5d3fd65efdb778fc51743123b976
Author: Stephan Bergmann 
AuthorDate: Thu Jun 2 21:09:09 2022 +0200
Commit: Stephan Bergmann 
CommitDate: Thu Jun 2 22:07:35 2022 +0200

Fix type of cppuhelper::TypeManager::getInterfaceMember separator param

...after a5343a89f898468178f04c241de0b2c2a314a1b5 "use more string_view in 
cppu"

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

diff --git a/cppuhelper/source/typemanager.cxx 
b/cppuhelper/source/typemanager.cxx
index 39bec6b9cada..bede11f7c405 100644
--- a/cppuhelper/source/typemanager.cxx
+++ b/cppuhelper/source/typemanager.cxx
@@ -2147,9 +2147,9 @@ css::uno::Any 
cppuhelper::TypeManager::getInstantiatedStruct(
 }
 
 css::uno::Any cppuhelper::TypeManager::getInterfaceMember(
-std::u16string_view name, sal_Int32 separator)
+std::u16string_view name, std::size_t separator)
 {
-assert(static_cast(name.find(u"::")) == separator && separator 
!= -1);
+assert(name.find(u"::") == separator && separator != 
std::u16string_view::npos);
 css::uno::Reference< css::reflection::XInterfaceTypeDescription2 > ifc(
 resolveTypedefs(find(OUString(name.substr(0, separator, 
css::uno::UNO_QUERY);
 if (!ifc.is()) {
diff --git a/cppuhelper/source/typemanager.hxx 
b/cppuhelper/source/typemanager.hxx
index 1a795fe22f8e..24fe0ef12166 100644
--- a/cppuhelper/source/typemanager.hxx
+++ b/cppuhelper/source/typemanager.hxx
@@ -11,6 +11,8 @@
 
 #include 
 
+#include 
+
 #include 
 #include 
 #include 
@@ -100,7 +102,7 @@ private:
 OUString const & name, sal_Int32 separator);
 
 css::uno::Any getInterfaceMember(
-std::u16string_view name, sal_Int32 separator);
+std::u16string_view name, std::size_t separator);
 
 css::uno::Any getNamed(
 OUString const & name,


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

2022-05-09 Thread Noel Grandin (via logerrit)
 cppuhelper/source/servicemanager.cxx |   12 ++--
 cppuhelper/source/servicemanager.hxx |4 ++--
 2 files changed, 8 insertions(+), 8 deletions(-)

New commits:
commit 9277faf14a713b8ae88596785874bdcdfc47957c
Author: Noel Grandin 
AuthorDate: Sun May 8 19:45:23 2022 +0200
Commit: Noel Grandin 
CommitDate: Mon May 9 10:16:39 2022 +0200

osl::Mutex->std::mutex in cppuhelper::ServiceManager

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

diff --git a/cppuhelper/source/servicemanager.cxx 
b/cppuhelper/source/servicemanager.cxx
index 12167739da8d..1a0e85780b21 100644
--- a/cppuhelper/source/servicemanager.cxx
+++ b/cppuhelper/source/servicemanager.cxx
@@ -665,7 +665,7 @@ 
cppuhelper::ServiceManager::Data::Implementation::createInstance(
 {
 css::uno::Reference inst;
 if (isSingleInstance) {
-osl::MutexGuard g(mutex);
+std::unique_lock g(mutex);
 if (!singleInstance.is()) {
 singleInstance = doCreateInstance(context);
 }
@@ -684,7 +684,7 @@ 
cppuhelper::ServiceManager::Data::Implementation::createInstanceWithArguments(
 {
 css::uno::Reference inst;
 if (isSingleInstance) {
-osl::MutexGuard g(mutex);
+std::unique_lock g(mutex);
 if (!singleInstance.is()) {
 singleInstance = doCreateInstanceWithArguments(context, arguments);
 }
@@ -751,14 +751,14 @@ void 
cppuhelper::ServiceManager::Data::Implementation::updateDisposeInstance(
 // at most one of the instances obtained via the service manager, in case
 // the implementation hands out different instances):
 if (singletonRequest) {
-osl::MutexGuard g(mutex);
+std::unique_lock g(mutex);
 disposeInstance.clear();
 dispose = false;
 } else if (shallDispose()) {
 css::uno::Reference comp(
 instance, css::uno::UNO_QUERY);
 if (comp.is()) {
-osl::MutexGuard g(mutex);
+std::unique_lock g(mutex);
 if (dispose) {
 disposeInstance = comp;
 }
@@ -891,7 +891,7 @@ void cppuhelper::ServiceManager::disposing() {
 {
 assert(rEntry.second);
 if (rEntry.second->shallDispose()) {
-osl::MutexGuard g2(rEntry.second->mutex);
+std::unique_lock g2(rEntry.second->mutex);
 if (rEntry.second->disposeInstance.is()) {
 sngls.push_back(rEntry.second->disposeInstance);
 }
@@ -901,7 +901,7 @@ void cppuhelper::ServiceManager::disposing() {
 {
 assert(rEntry.second);
 if (rEntry.second->shallDispose()) {
-osl::MutexGuard g2(rEntry.second->mutex);
+std::unique_lock g2(rEntry.second->mutex);
 if (rEntry.second->disposeInstance.is()) {
 sngls.push_back(rEntry.second->disposeInstance);
 }
diff --git a/cppuhelper/source/servicemanager.hxx 
b/cppuhelper/source/servicemanager.hxx
index 2228cd1fbbf1..b47d188ca82b 100644
--- a/cppuhelper/source/servicemanager.hxx
+++ b/cppuhelper/source/servicemanager.hxx
@@ -14,6 +14,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 
@@ -29,7 +30,6 @@
 #include 
 #include 
 #include 
-#include 
 #include 
 
 namespace com::sun::star::lang {
@@ -146,7 +146,7 @@ public:
 css::uno::Reference< css::lang::XComponent > component;
 Status status;
 
-osl::Mutex mutex;
+std::mutex mutex;
 css::uno::Reference singleInstance;
 css::uno::Reference< css::lang::XComponent > disposeInstance;
 bool dispose;


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

2022-05-04 Thread Stephan Bergmann (via logerrit)
 cppuhelper/source/servicemanager.cxx |6 -
 cppuhelper/source/typemanager.cxx|  106 +--
 2 files changed, 56 insertions(+), 56 deletions(-)

New commits:
commit 7ba88f7981305a08a162b5f38a49dc2bd1143a09
Author: Stephan Bergmann 
AuthorDate: Wed May 4 15:28:22 2022 +0200
Commit: Stephan Bergmann 
CommitDate: Wed May 4 19:28:58 2022 +0200

Just use Any ctor instead of makeAny in cppuhelper

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

diff --git a/cppuhelper/source/servicemanager.cxx 
b/cppuhelper/source/servicemanager.cxx
index d07c7697cac9..8c0a902b782d 100644
--- a/cppuhelper/source/servicemanager.cxx
+++ b/cppuhelper/source/servicemanager.cxx
@@ -781,9 +781,9 @@ void cppuhelper::ServiceManager::addSingletonContextEntries(
 entries->push_back(
 cppu::ContextEntry_Init(
 "/singletons/" + rName,
-css::uno::makeAny<
-css::uno::Reference >(
-new SingletonFactory(this, rImpls[0])),
+css::uno::Any(
+css::uno::Reference(
+new SingletonFactory(this, rImpls[0]))),
 true));
 }
 }
diff --git a/cppuhelper/source/typemanager.cxx 
b/cppuhelper/source/typemanager.cxx
index 1ceb63b11996..ef6faef4b92a 100644
--- a/cppuhelper/source/typemanager.cxx
+++ b/cppuhelper/source/typemanager.cxx
@@ -864,7 +864,7 @@ void BaseOffset::calculateBases(
 for (const auto & i : bases) {
 calculate(
 css::uno::Reference< css::reflection::XInterfaceTypeDescription2 >(
-resolveTypedefs(css::uno::makeAny(i)),
+resolveTypedefs(css::uno::Any(i)),
 css::uno::UNO_QUERY_THROW));
 }
 }
@@ -1655,7 +1655,7 @@ private:
 { return !positions_.empty(); }
 
 virtual css::uno::Any SAL_CALL nextElement() override
-{ return css::uno::makeAny(nextTypeDescription()); }
+{ return css::uno::Any(nextTypeDescription()); }
 
 virtual css::uno::Reference< css::reflection::XTypeDescription > SAL_CALL
 nextTypeDescription() override;
@@ -1851,9 +1851,9 @@ css::uno::Any cppuhelper::TypeManager::find(OUString 
const & name) {
 { u"any", css::uno::TypeClass_ANY } };
 for (const auto& [ rName, rTypeClass ] : simple) {
 if (name == rName) {
-return css::uno::makeAny<
-css::uno::Reference< css::reflection::XTypeDescription > >(
-new SimpleTypeDescription(rTypeClass, name));
+return css::uno::Any(
+css::uno::Reference< css::reflection::XTypeDescription >(
+new SimpleTypeDescription(rTypeClass, name)));
 }
 }
 if (name.startsWith("[]")) {
@@ -2092,10 +2092,10 @@ css::uno::Any cppuhelper::TypeManager::getSequenceType(
 OUString const & name)
 {
 assert(name.startsWith("[]"));
-return css::uno::makeAny<
-css::uno::Reference< css::reflection::XTypeDescription > >(
+return css::uno::Any(
+css::uno::Reference< css::reflection::XTypeDescription >(
 new SequenceTypeDescription(
-this, name, name.copy(std::strlen("[]";
+this, name, name.copy(std::strlen("[]");
 }
 
 css::uno::Any cppuhelper::TypeManager::getInstantiatedStruct(
@@ -2142,10 +2142,10 @@ css::uno::Any 
cppuhelper::TypeManager::getInstantiatedStruct(
 {
 return css::uno::Any();
 }
-return css::uno::makeAny<
-css::uno::Reference< css::reflection::XTypeDescription > >(
+return css::uno::Any(
+css::uno::Reference< css::reflection::XTypeDescription >(
 new InstantiatedPolymorphicStructTypeDescription(
-this, name, ent2, std::move(args)));
+this, name, ent2, std::move(args;
 }
 
 css::uno::Any cppuhelper::TypeManager::getInterfaceMember(
@@ -2164,8 +2164,8 @@ css::uno::Any cppuhelper::TypeManager::getInterfaceMember(
 ifc->getMembers());
 for (const auto & m : mems) {
 if (m->getMemberName() == member) {
-return css::uno::makeAny<
-css::uno::Reference< css::reflection::XTypeDescription > >(m);
+return css::uno::Any(
+css::uno::Reference< css::reflection::XTypeDescription >(m));
 }
 }
 return css::uno::Any();
@@ -2177,87 +2177,87 @@ css::uno::Any cppuhelper::TypeManager::getNamed(
 assert(entity.is());
 switch (entity->getSort()) {
 case unoidl::Entity::SORT_MODULE:
-return css::uno::makeAny<
-css::uno::Reference< css::reflection::XTypeDescription > >(
+return css::uno::Any(
+css::uno::Reference< css::reflection::XTypeDescription >(
 new ModuleDescription(
 this, name,
-  

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

2022-04-26 Thread Noel Grandin (via logerrit)
 cppuhelper/source/factory.cxx |6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

New commits:
commit c0ec38fe54499b9d9940a85d3592671bc543958f
Author: Noel Grandin 
AuthorDate: Tue Apr 26 10:49:34 2022 +0200
Commit: Noel Grandin 
CommitDate: Tue Apr 26 12:48:13 2022 +0200

revert unnecessary change

from
commit 25ada1e520b50247aa27fdbb6f1ab35e678c7ef9
Author: Noel Grandin 
Date:   Thu Apr 21 13:59:07 2022 +0200
use more string_view in cppuhelper

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

diff --git a/cppuhelper/source/factory.cxx b/cppuhelper/source/factory.cxx
index 98ac7e6a3746..e6b920858160 100644
--- a/cppuhelper/source/factory.cxx
+++ b/cppuhelper/source/factory.cxx
@@ -701,7 +701,7 @@ Reference< XInterface > 
ORegistryFactoryHelper::createInstanceWithArgumentsAndCo
 Reference< XInterface > ORegistryFactoryHelper::createModuleFactory()
 {
 OUString aActivatorUrl;
-std::u16string_view aActivatorName;
+OUString aActivatorName;
 OUString aLocation;
 
 Reference xActivatorKey = xImplementationKey->openKey(
@@ -744,9 +744,9 @@ Reference< XInterface > 
ORegistryFactoryHelper::createModuleFactory()
 }
 
 Reference< XInterface > xFactory;
-if( !aActivatorName.empty() )
+if( !aActivatorName.isEmpty() )
 {
-Reference x = xSMgr->createInstance( 
OUString(aActivatorName) );
+Reference x = xSMgr->createInstance( aActivatorName );
 Reference xLoader( x, UNO_QUERY );
 if (xLoader.is())
 {


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

2022-04-26 Thread Gabor Kelemen (via logerrit)
 cppuhelper/source/servicemanager.cxx |   18 --
 1 file changed, 18 deletions(-)

New commits:
commit ffcd599c4f28ca4cfdd7e1505cd5aa5eb68cc32b
Author: Gabor Kelemen 
AuthorDate: Sun Apr 24 20:17:06 2022 +0200
Commit: Thorsten Behrens 
CommitDate: Tue Apr 26 10:10:01 2022 +0200

Drop obsolete workaround for LanguageTool 1.7

Upstream patch for this issue was integrated for LT 1.8:
https://sourceforge.net/p/languagetool/bugs/105/
some 10 years ago.

It should be safe to drop this workaround now that LT 1.7
was dropped from core.

Change-Id: I4ffec2247bcb6445cfcdb1c19018bdddec712c83
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133357
Tested-by: Jenkins
Reviewed-by: Thorsten Behrens 

diff --git a/cppuhelper/source/servicemanager.cxx 
b/cppuhelper/source/servicemanager.cxx
index c128c4371e3f..d07c7697cac9 100644
--- a/cppuhelper/source/servicemanager.cxx
+++ b/cppuhelper/source/servicemanager.cxx
@@ -1085,24 +1085,6 @@ void cppuhelper::ServiceManager::insert(css::uno::Any 
const & aElement)
 insertLegacyFactory(info);
 return;
 }
-// At least revisions up to 1.7 of LanguageTool.oxt (incl. the bundled 1.4.0 in
-// module languagetool) contain an (actively registered) factory that does not
-// implement XServiceInfo (see  "SingletonFactory 
should
-// implement XServiceInfo"); the old OServiceManager::insert
-// (stoc/source/servicemanager/servicemanager.cxx) silently did not add such
-// broken factories to its m_ImplementationNameMap, so ignore them here for
-// backwards compatibility of live-insertion of extensions, too.
-
-// (The plan was that this warning would go away (and we would do the
-// throw instead) for the incompatible LO 4, but we changed our mind):
-css::uno::Reference< css::lang::XSingleComponentFactory > legacy;
-if ((aElement >>= legacy) && legacy.is()) {
-SAL_WARN(
-"cppuhelper",
-"Ignored XSingleComponentFactory not implementing XServiceInfo");
-return;
-}
 
 throw css::lang::IllegalArgumentException(
 "Bad insert element", static_cast< cppu::OWeakObject * >(this), 0);


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

2022-04-22 Thread Noel Grandin (via logerrit)
 cppuhelper/source/typemanager.cxx |4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

New commits:
commit c2092e4da40d6767649b5c33761c3698c1f84a6c
Author: Noel Grandin 
AuthorDate: Fri Apr 22 14:21:26 2022 +0200
Commit: Noel Grandin 
CommitDate: Fri Apr 22 14:44:06 2022 +0200

fix master after string_view patches..

crossed paths

Change-Id: I066b357dc10e2109658194b3b3682b7083ef
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133322
Tested-by: Noel Grandin 
Reviewed-by: Noel Grandin 

diff --git a/cppuhelper/source/typemanager.cxx 
b/cppuhelper/source/typemanager.cxx
index 28f831f0627c..1ceb63b11996 100644
--- a/cppuhelper/source/typemanager.cxx
+++ b/cppuhelper/source/typemanager.cxx
@@ -1873,7 +1873,7 @@ css::uno::Any cppuhelper::TypeManager::find(OUString 
const & name) {
 }
 i = name.lastIndexOf('.');
 if (i != -1) {
-std::u16string_view parent(name.subView(0, i));
+OUString parent(name.copy(0, i));
 ent = findEntity(parent);
 if (ent.is()) {
 switch (ent->getSort()) {
@@ -2072,7 +2072,7 @@ void cppuhelper::TypeManager::readRdbFile(
 std::u16string_view uri, bool optional)
 {
 try {
-manager_->addProvider(uri);
+manager_->addProvider(OUString(uri));
 } catch (unoidl::NoSuchFileException &) {
 if (!optional) {
 throw css::uno::DeploymentException(


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

2022-04-22 Thread Noel Grandin (via logerrit)
 cppuhelper/source/factory.cxx|   19 ++-
 cppuhelper/source/paths.cxx  |   11 ++-
 cppuhelper/source/paths.hxx  |3 ++-
 cppuhelper/source/servicemanager.cxx |   14 +++---
 cppuhelper/source/servicemanager.hxx |2 +-
 cppuhelper/source/typemanager.cxx|   32 
 cppuhelper/source/typemanager.hxx|   10 +-
 7 files changed, 47 insertions(+), 44 deletions(-)

New commits:
commit 25ada1e520b50247aa27fdbb6f1ab35e678c7ef9
Author: Noel Grandin 
AuthorDate: Thu Apr 21 13:59:07 2022 +0200
Commit: Noel Grandin 
CommitDate: Fri Apr 22 13:28:35 2022 +0200

use more string_view in cppuhelper

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

diff --git a/cppuhelper/source/factory.cxx b/cppuhelper/source/factory.cxx
index 8768d9817ab7..98ac7e6a3746 100644
--- a/cppuhelper/source/factory.cxx
+++ b/cppuhelper/source/factory.cxx
@@ -29,6 +29,7 @@
 #include 
 
 #include 
+#include 
 
 #include 
 #include 
@@ -700,7 +701,7 @@ Reference< XInterface > 
ORegistryFactoryHelper::createInstanceWithArgumentsAndCo
 Reference< XInterface > ORegistryFactoryHelper::createModuleFactory()
 {
 OUString aActivatorUrl;
-OUString aActivatorName;
+std::u16string_view aActivatorName;
 OUString aLocation;
 
 Reference xActivatorKey = xImplementationKey->openKey(
@@ -709,7 +710,7 @@ Reference< XInterface > 
ORegistryFactoryHelper::createModuleFactory()
 {
 aActivatorUrl = xActivatorKey->getAsciiValue();
 
-aActivatorName = aActivatorUrl.getToken(0, ':');
+aActivatorName = o3tl::getToken(aActivatorUrl, 0, ':');
 
 Reference xLocationKey = xImplementationKey->openKey(
 "/UNO/LOCATION" );
@@ -732,20 +733,20 @@ Reference< XInterface > 
ORegistryFactoryHelper::createModuleFactory()
 sal_Int32 nPos = aLocation.indexOf("://");
 if( nPos != -1 )
 {
-aActivatorName = aLocation.copy( 0, nPos );
-if( aActivatorName == "java" )
-aActivatorName = "com.sun.star.loader.Java";
-else if( aActivatorName == "module" )
-aActivatorName = "com.sun.star.loader.SharedLibrary";
+aActivatorName = aLocation.subView( 0, nPos );
+if( aActivatorName == u"java" )
+aActivatorName = u"com.sun.star.loader.Java";
+else if( aActivatorName == u"module" )
+aActivatorName = u"com.sun.star.loader.SharedLibrary";
 aLocation = aLocation.copy( nPos + 3 );
 }
 }
 }
 
 Reference< XInterface > xFactory;
-if( !aActivatorName.isEmpty() )
+if( !aActivatorName.empty() )
 {
-Reference x = xSMgr->createInstance( aActivatorName );
+Reference x = xSMgr->createInstance( 
OUString(aActivatorName) );
 Reference xLoader( x, UNO_QUERY );
 if (xLoader.is())
 {
diff --git a/cppuhelper/source/paths.cxx b/cppuhelper/source/paths.cxx
index b6a1e12600dd..ece7650ded4c 100644
--- a/cppuhelper/source/paths.cxx
+++ b/cppuhelper/source/paths.cxx
@@ -28,6 +28,7 @@
 #include 
 #include 
 #include 
+#include 
 
 #include "paths.hxx"
 
@@ -108,18 +109,18 @@ bool cppu::nextDirectoryItem(osl::Directory & directory, 
OUString * url) {
 }
 }
 
-void cppu::decodeRdbUri(OUString * uri, bool * optional, bool * directory)
+void cppu::decodeRdbUri(std::u16string_view * uri, bool * optional, bool * 
directory)
 {
 assert(uri != nullptr && optional != nullptr && directory != nullptr);
-if(!(uri->isEmpty()))
+if(!(uri->empty()))
 {
 *optional = (*uri)[0] == '?';
 if (*optional) {
-*uri = uri->copy(1);
+*uri = uri->substr(1);
 }
-*directory = uri->startsWith("<") && uri->endsWith(">*");
+*directory = o3tl::starts_with(*uri, u"<") && o3tl::ends_with(*uri, 
u">*");
 if (*directory) {
-*uri = uri->copy(1, uri->getLength() - 3);
+*uri = uri->substr(1, uri->size() - 3);
 }
 }
 else
diff --git a/cppuhelper/source/paths.hxx b/cppuhelper/source/paths.hxx
index c1e3724c0aa1..b4681048998a 100644
--- a/cppuhelper/source/paths.hxx
+++ b/cppuhelper/source/paths.hxx
@@ -21,6 +21,7 @@
 
 #include 
 #include 
+#include 
 
 namespace osl
 {
@@ -33,7 +34,7 @@ OUString getUnoIniUri();
 
 bool nextDirectoryItem(osl::Directory& directory, OUString* url);
 
-void decodeRdbUri(OUString* uri, bool* optional, bool* directory);
+void decodeRdbUri(std::u16string_view* uri, bool* optional, bool* directory);
 }
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/cppuhelper/source/servicemanager.cxx 
b/cppuhelper/source/servicemanager.cxx
index 44044e28a54e..c128c4371e3f 100644
--- 

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

2022-04-21 Thread Michael Weghorn (via logerrit)
 cppuhelper/source/exc_thrower.cxx |6 ++
 1 file changed, 2 insertions(+), 4 deletions(-)

New commits:
commit a03d7b1871673473b6201a8a15be175d7b65d71d
Author: Michael Weghorn 
AuthorDate: Thu Apr 21 14:26:18 2022 +0200
Commit: Michael Weghorn 
CommitDate: Thu Apr 21 20:59:05 2022 +0200

android: Use fake exceptions on all architectures

This was previously only used for aarch64, and the
workaround does not seem to be necessary in current
Android versions on other architectures.

However, while it's e.g. not needed on an x86 AVD
with API level 21 (Android 5), at least my
x86 AVD with API level 16 (Android 4.1), which
is currently our `minSdkVersion`, fails otherwise
when trying to open any document with the below
in the ADB log.

With this (and all the previous fixes for low API/SDK levels)
in place, opening a document in Android Viewer finally
succeeds there.

> F/libc( 3288): Fatal signal 11 (SIGSEGV) at 0xdeadbaad (code=1), 
thread 3310 (Thread-122)
> I/stderr  ( 3288): terminating with uncaught exception of type 
com::sun::star::ucb::InteractiveAugmentedIOException
> I/stderr  ( 3288): assertion "terminating with uncaught exception of type 
com::sun::star::ucb::InteractiveAugmentedIOException" failed: file 
"/usr/local/google/buildbot/src/android/ndk-release-r20/external/libcxx/../../external/libcxxabi/src/abort_message.cpp",
 line 73, function "abort_message"
> I/DEBUG   ( 1173): *** *** *** *** *** *** *** *** *** *** *** *** *** 
*** *** ***
> I/DEBUG   ( 1173): Build fingerprint: 
'generic_x86/sdk_x86/generic_x86:4.1.2/MASTER/eng.wdu.20191218.182616:eng/test-keys'
> I/DEBUG   ( 1173): pid: 3288, tid: 3310, name: Thread-122  >>> 
org.libreoffice <<<
> I/DEBUG   ( 1173): signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 
deadbaad
> I/DEBUG   ( 1173): eax   ebx b76c9f4c  ecx   edx 
b76cbfd4
> I/DEBUG   ( 1173): esi b65ed000  edi 788c7d6c
> I/DEBUG   ( 1173): xcs 0073  xds 007b  xes 007b  xfs 
  xss 007b
> I/DEBUG   ( 1173): eip b7661c03  ebp 788c7d88  esp 788c7d40  flags 
00210246
> I/DEBUG   ( 1173):
> I/DEBUG   ( 1173): backtrace:
> I/DEBUG   ( 1173): #00  pc 00021c03  /system/lib/libc.so (abort+131)
> I/DEBUG   ( 1173): #01  pc 00030ff1  /system/lib/libc.so
> I/DEBUG   ( 1173): #02  pc 0e137175  
/data/data/org.libreoffice/lib/liblo-native-code.so
> I/DEBUG   ( 1173): #03  pc 0e1372f5  
/data/data/org.libreoffice/lib/liblo-native-code.so
> I/DEBUG   ( 1173): #04  pc 0e133d0a  
/data/data/org.libreoffice/lib/liblo-native-code.so
> I/DEBUG   ( 1173): #05  pc 0e13323f  
/data/data/org.libreoffice/lib/liblo-native-code.so
> I/DEBUG   ( 1173): #06  pc 0e133194  
/data/data/org.libreoffice/lib/liblo-native-code.so
> I/DEBUG   ( 1173): #07  pc 0d369737  
/data/data/org.libreoffice/lib/liblo-native-code.so
> I/DEBUG   ( 1173): #08  pc 0d3673b0  
/data/data/org.libreoffice/lib/liblo-native-code.so
> I/DEBUG   ( 1173): #09  pc 0d366a7b  
/data/data/org.libreoffice/lib/liblo-native-code.so
> I/DEBUG   ( 1173): #10  pc 0d377a25  
/data/data/org.libreoffice/lib/liblo-native-code.so
> I/DEBUG   ( 1173): #11  pc 09a2b944  
/data/data/org.libreoffice/lib/liblo-native-code.so
> I/DEBUG   ( 1173): #12  pc 098826da  
/data/data/org.libreoffice/lib/liblo-native-code.so
> I/DEBUG   ( 1173): #13  pc 098cc47c  
/data/data/org.libreoffice/lib/liblo-native-code.so
> I/DEBUG   ( 1173): #14  pc 098ded29  
/data/data/org.libreoffice/lib/liblo-native-code.so
> I/DEBUG   ( 1173): #15  pc 098bb839  
/data/data/org.libreoffice/lib/liblo-native-code.so
> I/DEBUG   ( 1173): #16  pc 098b7e23  
/data/data/org.libreoffice/lib/liblo-native-code.so
> I/DEBUG   ( 1173): #17  pc 098bb8cf  
/data/data/org.libreoffice/lib/liblo-native-code.so
> I/DEBUG   ( 1173): #18  pc 0987a677  
/data/data/org.libreoffice/lib/liblo-native-code.so
> I/DEBUG   ( 1173): #19  pc 0987b7c7  
/data/data/org.libreoffice/lib/liblo-native-code.so
> I/DEBUG   ( 1173): #20  pc 0987ab4b  
/data/data/org.libreoffice/lib/liblo-native-code.so
> I/DEBUG   ( 1173): #21  pc 0987a9a7  
/data/data/org.libreoffice/lib/liblo-native-code.so
> I/DEBUG   ( 1173): #22  pc 0987f90b  
/data/data/org.libreoffice/lib/liblo-native-code.so
> I/DEBUG   ( 1173): #23  pc 0986d4ff  
/data/data/org.libreoffice/lib/liblo-native-code.so
> I/DEBUG   ( 1173): #24  pc 09872298  
/data/data/org.libreoffice/lib/liblo-native-code.so
> I/DEBUG   ( 1173): #25  pc 035625cf  
/data/data/org.libreoffice/lib/liblo-native-code.so
> I/DEBUG   ( 1173): #26  pc 0355dff2  
/data/data/org.libreoffice/lib/liblo-native-code.so
> I/DEBUG   ( 1173): #27  pc 035713f9  

[Libreoffice-commits] core.git: cppuhelper/source cppu/source

2022-04-13 Thread Noel Grandin (via logerrit)
 cppu/source/uno/EnvStack.cxx|4 ++--
 cppu/source/uno/cascade_mapping.cxx |4 ++--
 cppuhelper/source/typemanager.cxx   |8 
 cppuhelper/source/typemanager.hxx   |2 +-
 4 files changed, 9 insertions(+), 9 deletions(-)

New commits:
commit a5343a89f898468178f04c241de0b2c2a314a1b5
Author: Noel Grandin 
AuthorDate: Wed Apr 13 14:04:09 2022 +0200
Commit: Noel Grandin 
CommitDate: Wed Apr 13 16:11:49 2022 +0200

use more string_view in cppu

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

diff --git a/cppu/source/uno/EnvStack.cxx b/cppu/source/uno/EnvStack.cxx
index 880b922886d1..2daf56a21a79 100644
--- a/cppu/source/uno/EnvStack.cxx
+++ b/cppu/source/uno/EnvStack.cxx
@@ -141,7 +141,7 @@ extern "C" void SAL_CALL 
uno_getCurrentEnvironment(uno_Environment ** ppEnv, rtl
 }
 }
 
-static OUString s_getPrefix(OUString const & str1, std::u16string_view str2)
+static OUString s_getPrefix(std::u16string_view str1, std::u16string_view str2)
 {
 sal_Int32 nIndex1 = 0;
 sal_Int32 nIndex2 = 0;
@@ -163,7 +163,7 @@ static OUString s_getPrefix(OUString const & str1, 
std::u16string_view str2)
 OUString result;
 
 if (sim)
-result = str1.copy(0, sim - 1);
+result = str1.substr(0, sim - 1);
 
 return result;
 }
diff --git a/cppu/source/uno/cascade_mapping.cxx 
b/cppu/source/uno/cascade_mapping.cxx
index dbfbfc6c4dba..f03d88e529d6 100644
--- a/cppu/source/uno/cascade_mapping.cxx
+++ b/cppu/source/uno/cascade_mapping.cxx
@@ -156,7 +156,7 @@ extern "C" { static void s_MediatorMapping_free(uno_Mapping 
* pMapping)
 }}
 
 
-static OUString getPrefix(OUString const & str1, std::u16string_view str2)
+static OUString getPrefix(std::u16string_view str1, std::u16string_view str2)
 {
 sal_Int32 nIndex1 = 0;
 sal_Int32 nIndex2 = 0;
@@ -178,7 +178,7 @@ static OUString getPrefix(OUString const & str1, 
std::u16string_view str2)
 OUString result;
 
 if (sim)
-result = str1.copy(0, sim - 1);
+result = str1.substr(0, sim - 1);
 
 return result;
 }
diff --git a/cppuhelper/source/typemanager.cxx 
b/cppuhelper/source/typemanager.cxx
index 28ef85189f29..44105df033fa 100644
--- a/cppuhelper/source/typemanager.cxx
+++ b/cppuhelper/source/typemanager.cxx
@@ -2149,15 +2149,15 @@ css::uno::Any 
cppuhelper::TypeManager::getInstantiatedStruct(
 }
 
 css::uno::Any cppuhelper::TypeManager::getInterfaceMember(
-OUString const & name, sal_Int32 separator)
+std::u16string_view name, sal_Int32 separator)
 {
-assert(name.indexOf("::") == separator && separator != -1);
+assert(static_cast(name.find(u"::")) == separator && separator 
!= -1);
 css::uno::Reference< css::reflection::XInterfaceTypeDescription2 > ifc(
-resolveTypedefs(find(name.copy(0, separator))), css::uno::UNO_QUERY);
+resolveTypedefs(find(OUString(name.substr(0, separator, 
css::uno::UNO_QUERY);
 if (!ifc.is()) {
 return css::uno::Any();
 }
-OUString member(name.copy(separator + std::strlen("::")));
+std::u16string_view member = name.substr(separator + std::strlen("::"));
 const css::uno::Sequence<
 css::uno::Reference<
 css::reflection::XInterfaceMemberTypeDescription > > mems(
diff --git a/cppuhelper/source/typemanager.hxx 
b/cppuhelper/source/typemanager.hxx
index 1ee264bf16ff..28c193191267 100644
--- a/cppuhelper/source/typemanager.hxx
+++ b/cppuhelper/source/typemanager.hxx
@@ -100,7 +100,7 @@ private:
 OUString const & name, sal_Int32 separator);
 
 css::uno::Any getInterfaceMember(
-OUString const & name, sal_Int32 separator);
+std::u16string_view name, sal_Int32 separator);
 
 css::uno::Any getNamed(
 OUString const & name,


[Libreoffice-commits] core.git: cppuhelper/source odk/source

2022-04-11 Thread Stephan Bergmann (via logerrit)
 cppuhelper/source/findsofficepath.c|2 +-
 odk/source/unoapploader/win/unoapploader.c |4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

New commits:
commit de465317350f94c8b3308c73572467b588af5af0
Author: Stephan Bergmann 
AuthorDate: Mon Apr 11 18:37:00 2022 +0200
Commit: Stephan Bergmann 
CommitDate: Mon Apr 11 19:40:51 2022 +0200

-Werror,-Wstrict-prototypes (clang-cl)

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

diff --git a/cppuhelper/source/findsofficepath.c 
b/cppuhelper/source/findsofficepath.c
index c8a8846355fd..a46cfb88a1e7 100644
--- a/cppuhelper/source/findsofficepath.c
+++ b/cppuhelper/source/findsofficepath.c
@@ -87,7 +87,7 @@ static wchar_t* getPathFromRegistryKey( HKEY hroot, const 
wchar_t* subKeyName )
  * @return the installation path or NULL, if no installation was found or
  * if an error occurred
  */
-static wchar_t* platformSpecific()
+static wchar_t* platformSpecific(void)
 {
 const wchar_t* UNOPATHVARNAME = L"UNO_PATH";
 
diff --git a/odk/source/unoapploader/win/unoapploader.c 
b/odk/source/unoapploader/win/unoapploader.c
index 4baa3ddda8c5..7a4f9e98e3de 100644
--- a/odk/source/unoapploader/win/unoapploader.c
+++ b/odk/source/unoapploader/win/unoapploader.c
@@ -265,7 +265,7 @@ int WINAPI wWinMain( HINSTANCE hInstance, HINSTANCE 
hPrevInstance,
  * found, or if an error occurred.
  * Returned pointer must be released with free()
  */
-wchar_t* getPath()
+wchar_t* getPath(void)
 {
 wchar_t* path = cppuhelper_detail_findSofficePath();
 
@@ -400,7 +400,7 @@ void writeError( const char* errstr )
 /*
  * Closes the error file.
  */
-void closeErrorFile()
+void closeErrorFile(void)
 {
 FILE* ferr = getErrorFile( 0 );
 if ( ferr != NULL )


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

2022-04-10 Thread Stephan Bergmann (via logerrit)
 cppuhelper/source/findsofficepath.c |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 72303710ab70007769118a1f13106822f3558916
Author: Stephan Bergmann 
AuthorDate: Sun Apr 10 09:09:29 2022 +0200
Commit: Stephan Bergmann 
CommitDate: Sun Apr 10 10:24:51 2022 +0200

-Werror,-Wstrict-prototypes

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

diff --git a/cppuhelper/source/findsofficepath.c 
b/cppuhelper/source/findsofficepath.c
index 75d370981968..c8a8846355fd 100644
--- a/cppuhelper/source/findsofficepath.c
+++ b/cppuhelper/source/findsofficepath.c
@@ -211,7 +211,7 @@ wchar_t*
 #else
 char*
 #endif
-cppuhelper_detail_findSofficePath()
+cppuhelper_detail_findSofficePath(void)
 {
 return platformSpecific();
 }


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

2022-03-18 Thread Mike Kaganski (via logerrit)
 cppuhelper/source/typemanager.cxx |   45 --
 1 file changed, 20 insertions(+), 25 deletions(-)

New commits:
commit 21b17ba1e6ac3eb3c54a6613f5f66a7d5588850b
Author: Mike Kaganski 
AuthorDate: Fri Mar 18 12:27:57 2022 +0300
Commit: Mike Kaganski 
CommitDate: Fri Mar 18 11:49:54 2022 +0100

Simplify a static array iteration

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

diff --git a/cppuhelper/source/typemanager.cxx 
b/cppuhelper/source/typemanager.cxx
index 7d22994a1767..30c1555de137 100644
--- a/cppuhelper/source/typemanager.cxx
+++ b/cppuhelper/source/typemanager.cxx
@@ -17,6 +17,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 
 #include 
@@ -1831,33 +1832,27 @@ cppuhelper::TypeManager::TypeManager():
 
 css::uno::Any cppuhelper::TypeManager::find(OUString const & name) {
 //TODO: caching? (here or in unoidl::Manager?)
-struct Simple {
-std::u16string_view name;
-css::uno::TypeClass typeClass;
-};
-static Simple const simple[] = {
-{ std::u16string_view(u"void"), css::uno::TypeClass_VOID },
-{ std::u16string_view(u"boolean"), css::uno::TypeClass_BOOLEAN },
-{ std::u16string_view(u"byte"), css::uno::TypeClass_BYTE },
-{ std::u16string_view(u"short"), css::uno::TypeClass_SHORT },
-{ std::u16string_view(u"unsigned short"),
-  css::uno::TypeClass_UNSIGNED_SHORT },
-{ std::u16string_view(u"long"), css::uno::TypeClass_LONG },
-{ std::u16string_view(u"unsigned long"), 
css::uno::TypeClass_UNSIGNED_LONG },
-{ std::u16string_view(u"hyper"), css::uno::TypeClass_HYPER },
-{ std::u16string_view(u"unsigned hyper"),
-  css::uno::TypeClass_UNSIGNED_HYPER },
-{ std::u16string_view(u"float"), css::uno::TypeClass_FLOAT },
-{ std::u16string_view(u"double"), css::uno::TypeClass_DOUBLE },
-{ std::u16string_view(u"char"), css::uno::TypeClass_CHAR },
-{ std::u16string_view(u"string"), css::uno::TypeClass_STRING },
-{ std::u16string_view(u"type"), css::uno::TypeClass_TYPE },
-{ std::u16string_view(u"any"), css::uno::TypeClass_ANY } };
-for (std::size_t i = 0; i != SAL_N_ELEMENTS(simple); ++i) {
-if (name == simple[i].name) {
+static constexpr std::pair const 
simple[] = {
+{ u"void", css::uno::TypeClass_VOID },
+{ u"boolean", css::uno::TypeClass_BOOLEAN },
+{ u"byte", css::uno::TypeClass_BYTE },
+{ u"short", css::uno::TypeClass_SHORT },
+{ u"unsigned short", css::uno::TypeClass_UNSIGNED_SHORT },
+{ u"long", css::uno::TypeClass_LONG },
+{ u"unsigned long", css::uno::TypeClass_UNSIGNED_LONG },
+{ u"hyper", css::uno::TypeClass_HYPER },
+{ u"unsigned hyper", css::uno::TypeClass_UNSIGNED_HYPER },
+{ u"float", css::uno::TypeClass_FLOAT },
+{ u"double", css::uno::TypeClass_DOUBLE },
+{ u"char", css::uno::TypeClass_CHAR },
+{ u"string", css::uno::TypeClass_STRING },
+{ u"type", css::uno::TypeClass_TYPE },
+{ u"any", css::uno::TypeClass_ANY } };
+for (const auto& [ rName, rTypeClass ] : simple) {
+if (name == rName) {
 return css::uno::makeAny<
 css::uno::Reference< css::reflection::XTypeDescription > >(
-new SimpleTypeDescription(simple[i].typeClass, name));
+new SimpleTypeDescription(rTypeClass, name));
 }
 }
 if (name.startsWith("[]")) {


[Libreoffice-commits] core.git: cppuhelper/source include/unotools

2022-02-28 Thread Noel Grandin (via logerrit)
 cppuhelper/source/gcc3.map   |2 +-
 cppuhelper/source/weak.cxx   |   27 ---
 include/unotools/weakref.hxx |9 +
 3 files changed, 10 insertions(+), 28 deletions(-)

New commits:
commit 9e8d8870890b0a60ef9acc4c43c67688b58a42a3
Author: Noel Grandin 
AuthorDate: Tue Feb 22 14:41:42 2022 +0200
Commit: Noel Grandin 
CommitDate: Mon Feb 28 11:25:58 2022 +0100

address review comments for "Add XWeak constructor..."

for
commit 27352b81638f2f1e792ab48ec532eaacf6f61718 (origin/master, 
origin/HEAD)
Author: Noel Grandin 
Date:   Mon Feb 21 16:00:52 2022 +0200
Add XWeak constructor and operator= to uno::WeakReference

I accidentally created a new gerrit change for this, and thus managed to
miss sorting out various review comments.

(*) Fix version number in gcc3.map
(*) Narrow the interface (i.e. assume non-null parameter) in
WeakReferenceHelper
(*) Remove cargo-cult catch and OSL_ASSERT in WeakReferenceHelper
(*) Remove accidental indentation

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

diff --git a/cppuhelper/source/gcc3.map b/cppuhelper/source/gcc3.map
index 07099853afb7..2af95d60a7e1 100644
--- a/cppuhelper/source/gcc3.map
+++ b/cppuhelper/source/gcc3.map
@@ -435,7 +435,7 @@ global:
 _ZN3com3sun4star3uno19WeakReferenceHelperaSEOS3_; # 
com::sun::star::uno::WeakReferenceHelper::operator=(com::sun::star::uno::WeakReferenceHelper&&)
 } LIBO_UDK_3.9;
 
-LIBO_UDK_7.5 { # LibO 7.5
+LIBO_UDK_7.4 { # LibO 7.4
 global:
 
_ZN3com3sun4star3uno19WeakReferenceHelperaSERKNS2_9ReferenceINS2_5XWeakEEE; # 
com::sun::star::uno::WeakReferenceHelper::operator=(com::sun::star::uno::Reference
 const&)
 
_ZN3com3sun4star3uno19WeakReferenceHelperC1ERKNS2_9ReferenceINS2_5XWeakEEE; # 
com::sun::star::uno::WeakReferenceHelper::WeakReferenceHelper(com::sun::star::uno::Reference
 const&)
diff --git a/cppuhelper/source/weak.cxx b/cppuhelper/source/weak.cxx
index 65c9e7f81912..e51f9ccf86a6 100644
--- a/cppuhelper/source/weak.cxx
+++ b/cppuhelper/source/weak.cxx
@@ -376,19 +376,12 @@ OWeakRefListener::OWeakRefListener(const Reference< 
XInterface >& xInt)
 OWeakRefListener::OWeakRefListener(const Reference< XWeak >& xWeak)
 : m_aRefCount( 1 )
 {
-try
-{
-if (xWeak.is())
-{
-m_XWeakConnectionPoint = xWeak->queryAdapter();
+m_XWeakConnectionPoint = xWeak->queryAdapter();
 
-if (m_XWeakConnectionPoint.is())
-{
-
m_XWeakConnectionPoint->addReference(static_cast(this));
-}
-}
+if (m_XWeakConnectionPoint.is())
+{
+m_XWeakConnectionPoint->addReference(static_cast(this));
 }
-catch (RuntimeException &) { OSL_ASSERT( false ); } // assert here, but no 
unexpected()
 osl_atomic_decrement( _aRefCount );
 }
 
@@ -526,16 +519,12 @@ WeakReferenceHelper::operator= (const Reference< 
XInterface > & xInt)
 WeakReferenceHelper &
 WeakReferenceHelper::operator= (const Reference< XWeak > & xWeak)
 {
-try
+clear();
+if (xWeak)
 {
-clear();
-if (xWeak.is())
-{
-m_pImpl = new OWeakRefListener(xWeak);
-m_pImpl->acquire();
-}
+m_pImpl = new OWeakRefListener(xWeak);
+m_pImpl->acquire();
 }
-catch (RuntimeException &) { OSL_ASSERT( false ); } // assert here, but no 
unexpected()
 return *this;
 }
 
diff --git a/include/unotools/weakref.hxx b/include/unotools/weakref.hxx
index ca5682416033..104737404054 100644
--- a/include/unotools/weakref.hxx
+++ b/include/unotools/weakref.hxx
@@ -77,22 +77,15 @@ public:
 {
 }
 
-/** Copy ctor.  Initialize this reference with a hard reference.
+/** Copy ctor.  Initialize this reference with a hard reference.
 
 @param rRef another hard ref
 */
-#if defined LIBO_INTERNAL_ONLY
 WeakReference(interface_type* pRef)
 : WeakReferenceHelper(
   
css::uno::Reference(static_cast(pRef)))
 {
 }
-#else
-WeakReference(interface_type* pRef)
-: WeakReferenceHelper(static_cast(pRef))
-{
-}
-#endif
 
 /** Releases this reference and takes over hard reference xInt.
 If the implementation behind xInt does not support XWeak


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

2022-01-28 Thread Jan-Marek Glogowski (via logerrit)
 cppuhelper/source/paths.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 1a403f67ec437c57d25a1ac2d0368dce6c571cbd
Author: Jan-Marek Glogowski 
AuthorDate: Fri Jan 28 14:40:51 2022 +0100
Commit: Jan-Marek Glogowski 
CommitDate: Fri Jan 28 19:34:17 2022 +0100

WASM set correct path to FS image unorc

Guess in all the fixing when upstreaming all the WASM changes,
that hunk got lost. This actually makes the WASM build run, not
just compile.

Change-Id: Ided621af284e62961eb47957d74b31871a30a2bf
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/129105
Tested-by: Jenkins
Reviewed-by: Jan-Marek Glogowski 

diff --git a/cppuhelper/source/paths.cxx b/cppuhelper/source/paths.cxx
index d2f37bb549a7..b6a1e12600dd 100644
--- a/cppuhelper/source/paths.cxx
+++ b/cppuhelper/source/paths.cxx
@@ -52,7 +52,7 @@ OUString get_this_libpath() {
 }
 
 OUString cppu::getUnoIniUri() {
-#if defined ANDROID || defined EMSCRIPTEN
+#if defined ANDROID
 // Wouldn't it be lovely to avoid this ugly hard-coding.
 // The problem is that the 'create_bootstrap_macro_expander_factory()'
 // required for bootstrapping services, calls cppu::get_unorc directly


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

2022-01-12 Thread Stephan Bergmann (via logerrit)
 cppuhelper/source/paths.cxx |9 ++---
 1 file changed, 2 insertions(+), 7 deletions(-)

New commits:
commit 229c312834f8931994ed1147a0cc136ce4b2de69
Author: Stephan Bergmann 
AuthorDate: Wed Jan 12 14:30:56 2022 +0100
Commit: Stephan Bergmann 
CommitDate: Thu Jan 13 08:17:11 2022 +0100

Adapt comment

...to 76e04aef4b4adea8179d564b158e58f495ed43a4 "Rename LO-specific uno 
ini-file
(Linux: program/unorc) to 'louno'".  (And yes, the original comment guessed
right: it is the URE uno ini-file that we look for here.)

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

diff --git a/cppuhelper/source/paths.cxx b/cppuhelper/source/paths.cxx
index 0f59fb1272da..480dcde48fe7 100644
--- a/cppuhelper/source/paths.cxx
+++ b/cppuhelper/source/paths.cxx
@@ -64,13 +64,8 @@ OUString cppu::getUnoIniUri() {
 #else
 OUString uri(get_this_libpath());
 #ifdef MACOSX
-// We keep both the LO and URE dylibs directly in "Frameworks"
-// (that is, LIBO_LIB_FOLDER) and rc files in "Resources"
-// (LIBO_ETC_FOLDER). Except for unorc, of which there are two,
-// the "LO" one (which is in "Resources") and the "URE" one (which
-// is in "Resources/ure/etc" (LIBO_URE_ETC_FOLDER)). As this code
-// goes into the cppuhelper library which is part of URE, we are
-// looking for the latter one here. I think...
+// We keep the URE dylibs directly in "Frameworks" (that is, 
LIBO_LIB_FOLDER) and unorc in
+// "Resources/ure/etc" (LIBO_URE_ETC_FOLDER).
 if (uri.endsWith( "/" LIBO_LIB_FOLDER ) )
 {
 uri = OUString::Concat(uri.subView( 0, uri.getLength() - 
(sizeof(LIBO_LIB_FOLDER)-1) )) + LIBO_URE_ETC_FOLDER;


[Libreoffice-commits] core.git: cppuhelper/source include/cppuhelper

2022-01-03 Thread Mike Kaganski (via logerrit)
 cppuhelper/source/weak.cxx  |   10 --
 include/cppuhelper/weak.hxx |8 +---
 2 files changed, 1 insertion(+), 17 deletions(-)

New commits:
commit 745dcdb1e7e4c070a95db7a1c52840bd65eefa63
Author: Mike Kaganski 
AuthorDate: Sat Dec 25 12:40:59 2021 +0100
Commit: Stephan Bergmann 
CommitDate: Tue Jan 4 08:09:48 2022 +0100

Drop MSVC special-casing for OWeakObject ctor

It was introduced in commit 0c38ca4412531adafdb9cbac9dfa7f6f8e0d9882
author  Daniel Boelzle 
dateMon Nov 18 08:59:15 2002 +
#104560# outlining of msvc mapfile symbols

cppuhelper/source/msvc_win32_intel.map was dropped in commit
b222aa8fff63c803781703e72366ca203f3e6a76
author  Matúš Kukan 
dateTue Aug 23 15:03:09 2011 +0200
cppuhelper: convert to gbuild

The symbol '??0OWeakObject@cppu@@QEAA@XZ' is still exported from
cppuhelper3MSC.dll (checked using dumpbin, that number and names of
exported symbols are the same), thanks to the CPPUHELPER_DLLPUBLIC
macro at the class, that expands to __declspec(dllexport) [1], [2].
Hence, this patch is expected to not cause an ABI change.

[1] https://docs.microsoft.com/en-us/cpp/cpp/dllexport-dllimport
[2] 
https://docs.microsoft.com/en-us/cpp/build/exporting-from-a-dll-using-declspec-dllexport

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

diff --git a/cppuhelper/source/weak.cxx b/cppuhelper/source/weak.cxx
index 0119123aed74..f45f433e9ce2 100644
--- a/cppuhelper/source/weak.cxx
+++ b/cppuhelper/source/weak.cxx
@@ -205,16 +205,6 @@ void SAL_CALL OWeakConnectionPoint::removeReference(const 
Reference< XReference
 
 //-- OWeakObject ---
 
-
-#ifdef _MSC_VER
-// Accidentally occurs in msvc mapfile = > had to be outlined.
-OWeakObject::OWeakObject()
-: m_refCount( 0 ),
-  m_pWeakConnectionPoint( nullptr )
-{
-}
-#endif
-
 // XInterface
 Any SAL_CALL OWeakObject::queryInterface( const Type & rType )
 {
diff --git a/include/cppuhelper/weak.hxx b/include/cppuhelper/weak.hxx
index ef9ed7ffa807..b8e4e9955d9b 100644
--- a/include/cppuhelper/weak.hxx
+++ b/include/cppuhelper/weak.hxx
@@ -95,12 +95,6 @@ public:
 {}
 /// @endcond
 
-#ifdef _MSC_VER
-/** Default Constructor.  Sets the reference count to zero.
-Accidentally occurs in msvc mapfile = > had to be outlined.
-*/
-OWeakObject();
-#else
 /** Default Constructor.  Sets the reference count to zero.
 */
 OWeakObject()
@@ -108,7 +102,7 @@ public:
 , m_pWeakConnectionPoint( NULL )
 , m_pReserved(NULL)
 {}
-#endif
+
 /** Dummy copy constructor.  Set the reference count to zero.
 */
 OWeakObject( const OWeakObject & )


[Libreoffice-commits] core.git: cppuhelper/source include/comphelper include/cppuhelper include/uno

2021-12-16 Thread Miklos Vajna (via logerrit)
 cppuhelper/source/weak.cxx  |2 --
 include/comphelper/interfacecontainer2.hxx  |1 -
 include/comphelper/interfacecontainer3.hxx  |1 -
 include/comphelper/interfacecontainer4.hxx  |1 -
 include/comphelper/multicontainer2.hxx  |1 -
 include/comphelper/multiinterfacecontainer3.hxx |1 -
 include/cppuhelper/interfacecontainer.h |1 -
 include/uno/environment.hxx |4 
 8 files changed, 12 deletions(-)

New commits:
commit f6e6255022ac796ea1a2f81f0d949d04c24a7f9d
Author: Miklos Vajna 
AuthorDate: Thu Dec 16 20:36:45 2021 +0100
Commit: Miklos Vajna 
CommitDate: Fri Dec 17 08:28:45 2021 +0100

Remove empty docpp doxygen comments around namespaces

I assume this was originally added to work around some broken doc
generator, but we don't enforce comments for namespaces today, so this
is no longer needed.

Change-Id: Ia2311658516be84b26ae69e09362af560d793a7f
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/126963
Tested-by: Jenkins
Reviewed-by: Miklos Vajna 

diff --git a/cppuhelper/source/weak.cxx b/cppuhelper/source/weak.cxx
index 657bf5d0c7da..0119123aed74 100644
--- a/cppuhelper/source/weak.cxx
+++ b/cppuhelper/source/weak.cxx
@@ -34,7 +34,6 @@
 using namespace osl;
 using namespace com::sun::star::uno;
 
-/** */ //for docpp
 namespace cppu
 {
 
@@ -332,7 +331,6 @@ void OWeakAggObject::setDelegator( const 
Reference & rDelegator )
 
 }
 
-/** */ //for docpp
 namespace com::sun::star::uno
 {
 
diff --git a/include/comphelper/interfacecontainer2.hxx 
b/include/comphelper/interfacecontainer2.hxx
index 286a5f2cb876..3df7c71d49d8 100644
--- a/include/comphelper/interfacecontainer2.hxx
+++ b/include/comphelper/interfacecontainer2.hxx
@@ -31,7 +31,6 @@
 namespace com::sun::star::uno { class XInterface; }
 namespace osl { class Mutex; }
 
-/** */ //for docpp
 namespace comphelper
 {
 
diff --git a/include/comphelper/interfacecontainer3.hxx 
b/include/comphelper/interfacecontainer3.hxx
index 5dc5fb66aa6d..27008f064e8c 100644
--- a/include/comphelper/interfacecontainer3.hxx
+++ b/include/comphelper/interfacecontainer3.hxx
@@ -34,7 +34,6 @@ namespace osl
 class Mutex;
 }
 
-/** */ //for docpp
 namespace comphelper
 {
 template  class OInterfaceContainerHelper3;
diff --git a/include/comphelper/interfacecontainer4.hxx 
b/include/comphelper/interfacecontainer4.hxx
index c81aa6b3afbd..04fafeadc0fd 100644
--- a/include/comphelper/interfacecontainer4.hxx
+++ b/include/comphelper/interfacecontainer4.hxx
@@ -31,7 +31,6 @@ namespace com::sun::star::uno
 class XInterface;
 }
 
-/** */ //for docpp
 namespace comphelper
 {
 template  class OInterfaceContainerHelper4;
diff --git a/include/comphelper/multicontainer2.hxx 
b/include/comphelper/multicontainer2.hxx
index d0963fa1d89c..91875b6689f3 100644
--- a/include/comphelper/multicontainer2.hxx
+++ b/include/comphelper/multicontainer2.hxx
@@ -34,7 +34,6 @@ namespace com::sun::star::uno
 class XInterface;
 }
 
-/** */ //for docpp
 namespace comphelper
 {
 /** This is a copy of cppu::OMultiTypeInterfaceContainerHelper2 in 
include/cppuhelper/interfacecontainer.h,
diff --git a/include/comphelper/multiinterfacecontainer3.hxx 
b/include/comphelper/multiinterfacecontainer3.hxx
index d11684f417f7..87199885e71e 100644
--- a/include/comphelper/multiinterfacecontainer3.hxx
+++ b/include/comphelper/multiinterfacecontainer3.hxx
@@ -30,7 +30,6 @@ namespace osl
 class Mutex;
 }
 
-/** */ //for docpp
 namespace comphelper
 {
 /**
diff --git a/include/cppuhelper/interfacecontainer.h 
b/include/cppuhelper/interfacecontainer.h
index 520998d4cd92..d901b2db3ccc 100644
--- a/include/cppuhelper/interfacecontainer.h
+++ b/include/cppuhelper/interfacecontainer.h
@@ -41,7 +41,6 @@
 
 namespace com { namespace sun { namespace star { namespace uno { class 
XInterface; } } } }
 
-/** */ //for docpp
 namespace cppu
 {
 
diff --git a/include/uno/environment.hxx b/include/uno/environment.hxx
index b7a31e991c8c..8a26e268d64d 100644
--- a/include/uno/environment.hxx
+++ b/include/uno/environment.hxx
@@ -33,16 +33,12 @@
 
 #include "uno/lbnames.h"
 
-/** */ //for docpp
 namespace com
 {
-/** */ //for docpp
 namespace sun
 {
-/** */ //for docpp
 namespace star
 {
-/** */ //for docpp
 namespace uno
 {
 


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

2021-10-15 Thread Julien Nabet (via logerrit)
 cppuhelper/source/defaultbootstrap.cxx |   15 +++
 1 file changed, 7 insertions(+), 8 deletions(-)

New commits:
commit fd29369a9ddb1e4a277cba90384ecf5ee2de450c
Author: Julien Nabet 
AuthorDate: Fri Oct 15 16:32:08 2021 +0200
Commit: Julien Nabet 
CommitDate: Fri Oct 15 20:27:38 2021 +0200

Simplify vector initialization in cppuhelper

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

diff --git a/cppuhelper/source/defaultbootstrap.cxx 
b/cppuhelper/source/defaultbootstrap.cxx
index e48b3ea67bc1..6e80c9697158 100644
--- a/cppuhelper/source/defaultbootstrap.cxx
+++ b/cppuhelper/source/defaultbootstrap.cxx
@@ -57,27 +57,26 @@ cppu::defaultBootstrap_InitialComponentContext(OUString 
const & iniUri)
 smgr->init(getBootstrapVariable(bs, "UNO_SERVICES"));
 rtl::Reference tmgr(new cppuhelper::TypeManager);
 tmgr->init(getBootstrapVariable(bs, "UNO_TYPES"));
-std::vector< cppu::ContextEntry_Init > context_values;
-context_values.push_back(
+std::vector< cppu::ContextEntry_Init > context_values
+{
 cppu::ContextEntry_Init(
 "/singletons/com.sun.star.lang.theServiceManager",
 css::uno::Any(
 css::uno::Reference< css::uno::XInterface >(
 static_cast< cppu::OWeakObject * >(smgr.get(,
-false));
-context_values.push_back(
+false),
 cppu::ContextEntry_Init(
 "/singletons/com.sun.star.reflection.theTypeDescriptionManager",
 css::uno::Any(
 css::uno::Reference< css::uno::XInterface >(
 static_cast< cppu::OWeakObject * >(tmgr.get(,
-false));
-context_values.push_back( //TODO: from services.rdb?
-cppu::ContextEntry_Init(
+false),
+cppu::ContextEntry_Init( //TODO: from services.rdb?
 "/singletons/com.sun.star.util.theMacroExpander",
 css::uno::Any(
 cppuhelper::detail::create_bootstrap_macro_expander_factory()),
-true));
+true)
+};
 smgr->addSingletonContextEntries(_values);
 context_values.push_back(
 cppu::ContextEntry_Init(


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

2021-10-14 Thread Mike Kaganski (via logerrit)
 cppuhelper/source/typeprovider.cxx |  320 ++---
 1 file changed, 122 insertions(+), 198 deletions(-)

New commits:
commit addf0b2abb9b78429b7b55f9463899a8ec21bf85
Author: Mike Kaganski 
AuthorDate: Thu Oct 14 23:46:13 2021 +0200
Commit: Mike Kaganski 
CommitDate: Fri Oct 15 05:51:01 2021 +0200

Simplify OTypeCollection ctors

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

diff --git a/cppuhelper/source/typeprovider.cxx 
b/cppuhelper/source/typeprovider.cxx
index c69aa11ab6c9..649e0ed5503d 100644
--- a/cppuhelper/source/typeprovider.cxx
+++ b/cppuhelper/source/typeprovider.cxx
@@ -22,6 +22,8 @@
 #include 
 #include 
 
+#include 
+
 using namespace osl;
 using namespace com::sun::star::uno;
 
@@ -58,255 +60,177 @@ Sequence< sal_Int8 > 
OImplementationId::getImplementationId() const
 return *_pSeq;
 }
 
-
-static void copy( Sequence< Type > & rDest, const Sequence< Type > & rSource, 
sal_Int32 nOffset )
+namespace
 {
-Type * pDest = rDest.getArray();
-const Type * pSource = rSource.getConstArray();
+sal_Int32 TypeSeqLen(const Sequence& s) { return s.getLength(); }
+template  sal_Int32 TypeSeqLen(const Type&, Args... args)
+{
+return 1 + TypeSeqLen(args...);
+}
 
-for ( sal_Int32 nPos = rSource.getLength(); nPos--; )
-pDest[nOffset+ nPos] = pSource[nPos];
+void PutToTypeSeq(Type* p, const Sequence& s) { std::copy(s.begin(), 
s.end(), p); }
+template  void PutToTypeSeq(Type* p, const Type& t, Args... 
args)
+{
+*p = t;
+PutToTypeSeq(p + 1, args...);
 }
 
+template  Sequence InitTypeSeq(Args... args)
+{
+Sequence s(TypeSeqLen(args...));
+PutToTypeSeq(s.getArray(), args...);
+return s;
+}
+}
 
 OTypeCollection::OTypeCollection(
-const Type & rType1,
-const Sequence< Type > & rAddTypes )
-: _aTypes( 1 + rAddTypes.getLength() )
+const Type & rT1,
+const Sequence< Type > & rMore )
+: _aTypes(InitTypeSeq(rT1, rMore))
 {
-_aTypes[0] = rType1;
-copy( _aTypes, rAddTypes, 1 );
 }
 
 OTypeCollection::OTypeCollection(
-const Type & rType1,
-const Type & rType2,
-const Sequence< Type > & rAddTypes )
-: _aTypes( 2 + rAddTypes.getLength() )
+const Type & rT1,
+const Type & rT2,
+const Sequence< Type > & rMore )
+: _aTypes(InitTypeSeq(rT1, rT2, rMore))
 {
-_aTypes[0] = rType1;
-_aTypes[1] = rType2;
-copy( _aTypes, rAddTypes, 2 );
 }
 
 OTypeCollection::OTypeCollection(
-const Type & rType1,
-const Type & rType2,
-const Type & rType3,
-const Sequence< Type > & rAddTypes )
-: _aTypes( 3 + rAddTypes.getLength() )
+const Type & rT1,
+const Type & rT2,
+const Type & rT3,
+const Sequence< Type > & rMore )
+: _aTypes(InitTypeSeq(rT1, rT2, rT3, rMore))
 {
-_aTypes[0] = rType1;
-_aTypes[1] = rType2;
-_aTypes[2] = rType3;
-copy( _aTypes, rAddTypes, 3 );
 }
 
 OTypeCollection::OTypeCollection(
-const Type & rType1,
-const Type & rType2,
-const Type & rType3,
-const Type & rType4,
-const Sequence< Type > & rAddTypes )
-: _aTypes( 4 + rAddTypes.getLength() )
+const Type & rT1,
+const Type & rT2,
+const Type & rT3,
+const Type & rT4,
+const Sequence< Type > & rMore )
+: _aTypes(InitTypeSeq(rT1, rT2, rT3, rT4, rMore))
 {
-_aTypes[0] = rType1;
-_aTypes[1] = rType2;
-_aTypes[2] = rType3;
-_aTypes[3] = rType4;
-copy( _aTypes, rAddTypes, 4 );
 }
 
 OTypeCollection::OTypeCollection(
-const Type & rType1,
-const Type & rType2,
-const Type & rType3,
-const Type & rType4,
-const Type & rType5,
-const Sequence< Type > & rAddTypes )
-: _aTypes( 5 + rAddTypes.getLength() )
+const Type & rT1,
+const Type & rT2,
+const Type & rT3,
+const Type & rT4,
+const Type & rT5,
+const Sequence< Type > & rMore )
+: _aTypes(InitTypeSeq(rT1, rT2, rT3, rT4, rT5, rMore))
 {
-_aTypes[0] = rType1;
-_aTypes[1] = rType2;
-_aTypes[2] = rType3;
-_aTypes[3] = rType4;
-_aTypes[4] = rType5;
-copy( _aTypes, rAddTypes, 5 );
 }
 
 OTypeCollection::OTypeCollection(
-const Type & rType1,
-const Type & rType2,
-const Type & rType3,
-const Type & rType4,
-const Type & rType5,
-const Type & rType6,
-const Sequence< Type > & rAddTypes )
-: _aTypes( 6 + rAddTypes.getLength() )
+const Type & rT1,
+const Type & rT2,
+const Type & rT3,
+const Type & rT4,
+const Type & rT5,
+const Type & rT6,
+const Sequence< Type > & rMore )
+: _aTypes(InitTypeSeq(rT1, rT2, rT3, rT4, rT5, rT6, rMore))
 {
-_aTypes[0] = rType1;
-_aTypes[1] = rType2;
-_aTypes[2] = rType3;
-_aTypes[3] = rType4;
-_aTypes[4] = rType5;
-_aTypes[5] = rType6;
-copy( _aTypes, rAddTypes, 6 );
 }
 
 OTypeCollection::OTypeCollection(
-const 

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

2021-10-11 Thread Michael Stahl (via logerrit)
 cppuhelper/source/typeprovider.cxx |9 +
 1 file changed, 9 insertions(+)

New commits:
commit c876183e4c0aff0fe95145c6ee4a84b213a54190
Author: Michael Stahl 
AuthorDate: Mon Oct 11 17:44:17 2021 +0200
Commit: Michael Stahl 
CommitDate: Mon Oct 11 19:31:42 2021 +0200

cppuhelper: suppress unhelpful warning C4996

... that happens while implementing the class declared as deprecated
with MSVC 2019.

cppuhelper/source/typeprovider.cxx(33): warning C4996: 
'cppu::OImplementationId': Uses broken double checked locking

Change-Id: I469fe38bd276a554b1ef006d3da270b85f26554b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123422
Tested-by: Jenkins
Reviewed-by: Michael Stahl 

diff --git a/cppuhelper/source/typeprovider.cxx 
b/cppuhelper/source/typeprovider.cxx
index c4258ef61cc8..c69aa11ab6c9 100644
--- a/cppuhelper/source/typeprovider.cxx
+++ b/cppuhelper/source/typeprovider.cxx
@@ -28,12 +28,21 @@ using namespace com::sun::star::uno;
 namespace cppu
 {
 
+// suppress spurious warning triggered by SAL_DEPRECATED in class declaration
+#if defined _MSC_VER && !defined __clang__
+#pragma warning(push)
+#pragma warning(disable: 4996)
+#endif
 
 OImplementationId::~OImplementationId()
 {
 delete _pSeq;
 }
 
+#if defined _MSC_VER && !defined __clang__
+#pragma warning(pop)
+#endif
+
 Sequence< sal_Int8 > OImplementationId::getImplementationId() const
 {
 if (! _pSeq)


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

2021-10-11 Thread Noel Grandin (via logerrit)
 cppuhelper/source/servicemanager.cxx |6 +++---
 cppuhelper/source/typemanager.cxx|8 
 2 files changed, 7 insertions(+), 7 deletions(-)

New commits:
commit 7b86c11194dcb8375de38865ec1bf54ee59bffa2
Author: Noel Grandin 
AuthorDate: Mon Oct 11 13:52:57 2021 +0200
Commit: Noel Grandin 
CommitDate: Mon Oct 11 16:15:30 2021 +0200

loplugin:moveparam in cppuhelper

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

diff --git a/cppuhelper/source/servicemanager.cxx 
b/cppuhelper/source/servicemanager.cxx
index 009fe137d550..121ad088dc50 100644
--- a/cppuhelper/source/servicemanager.cxx
+++ b/cppuhelper/source/servicemanager.cxx
@@ -451,8 +451,8 @@ class ContentEnumeration:
 public cppu::WeakImplHelper< css::container::XEnumeration >
 {
 public:
-explicit ContentEnumeration(std::vector< css::uno::Any > const & 
factories):
-factories_(factories), iterator_(factories_.begin()) {}
+explicit ContentEnumeration(std::vector< css::uno::Any >&& factories):
+factories_(std::move(factories)), iterator_(factories_.begin()) {}
 
 ContentEnumeration(const ContentEnumeration&) = delete;
 const ContentEnumeration& operator=(const ContentEnumeration&) = delete;
@@ -1193,7 +1193,7 @@ cppuhelper::ServiceManager::createContentEnumeration(
 factories.push_back(css::uno::Any(impl->factory2));
 }
 }
-return new ContentEnumeration(factories);
+return new ContentEnumeration(std::move(factories));
 }
 
 css::uno::Reference< css::beans::XPropertySetInfo >
diff --git a/cppuhelper/source/typemanager.cxx 
b/cppuhelper/source/typemanager.cxx
index 12c25ddc92bc..82aad46483fc 100644
--- a/cppuhelper/source/typemanager.cxx
+++ b/cppuhelper/source/typemanager.cxx
@@ -444,12 +444,12 @@ public:
 OUString const & name,
 rtl::Reference< unoidl::PolymorphicStructTypeTemplateEntity > const &
 entity,
-std::vector< OUString > const & arguments):
-manager_(manager), name_(name), entity_(entity), arguments_(arguments)
+std::vector< OUString >&& arguments):
+manager_(manager), name_(name), entity_(entity), 
arguments_(std::move(arguments))
 {
 assert(manager.is());
 assert(entity.is());
-assert(arguments.size() == entity->getTypeParameters().size());
+assert(arguments_.size() == entity->getTypeParameters().size());
 }
 
 private:
@@ -2121,7 +2121,7 @@ css::uno::Any 
cppuhelper::TypeManager::getInstantiatedStruct(
 return css::uno::makeAny<
 css::uno::Reference< css::reflection::XTypeDescription > >(
 new InstantiatedPolymorphicStructTypeDescription(
-this, name, ent2, args));
+this, name, ent2, std::move(args)));
 }
 
 css::uno::Any cppuhelper::TypeManager::getInterfaceMember(


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

2021-07-18 Thread Noel Grandin (via logerrit)
 cppuhelper/source/typemanager.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit e0ba91b7e8a2f0d949677db1708bb0e6d8534389
Author: Noel Grandin 
AuthorDate: Sat Jul 17 18:51:45 2021 +0200
Commit: Noel Grandin 
CommitDate: Sun Jul 18 11:34:39 2021 +0200

better to use a std::vector here

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

diff --git a/cppuhelper/source/typemanager.cxx 
b/cppuhelper/source/typemanager.cxx
index 857018e204ec..b97d36d16aed 100644
--- a/cppuhelper/source/typemanager.cxx
+++ b/cppuhelper/source/typemanager.cxx
@@ -1670,7 +1670,7 @@ private:
 bool deep_;
 
 std::mutex mutex_;
-std::stack< Position > positions_;
+std::stack< Position, std::vector > positions_;
 OUString current_;
 };
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2021-07-18 Thread Noel Grandin (via logerrit)
 cppuhelper/source/typemanager.cxx |5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

New commits:
commit e2a3e483844e84445c316cad35fdfcaf3b18198d
Author: Noel Grandin 
AuthorDate: Sat Jul 17 18:49:36 2021 +0200
Commit: Noel Grandin 
CommitDate: Sun Jul 18 10:35:36 2021 +0200

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

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

diff --git a/cppuhelper/source/typemanager.cxx 
b/cppuhelper/source/typemanager.cxx
index eb6d7246009e..857018e204ec 100644
--- a/cppuhelper/source/typemanager.cxx
+++ b/cppuhelper/source/typemanager.cxx
@@ -13,6 +13,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -1668,7 +1669,7 @@ private:
 css::uno::Sequence< css::uno::TypeClass > types_;
 bool deep_;
 
-osl::Mutex mutex_;
+std::mutex mutex_;
 std::stack< Position > positions_;
 OUString current_;
 };
@@ -1678,7 +1679,7 @@ Enumeration::nextTypeDescription()
 {
 OUString name;
 {
-osl::MutexGuard g(mutex_);
+std::lock_guard g(mutex_);
 if (positions_.empty()) {
 throw css::container::NoSuchElementException(
 "exhausted XTypeDescriptionEnumeration",
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

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

New commits:
commit bd90d1c630c93cf39f9bd83fc69c568c9d7eb35a
Author: Noel Grandin 
AuthorDate: Sat Jul 17 18:46:51 2021 +0200
Commit: Noel Grandin 
CommitDate: Sun Jul 18 10:12:32 2021 +0200

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

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

diff --git a/cppuhelper/source/servicemanager.cxx 
b/cppuhelper/source/servicemanager.cxx
index d7eff0b74cf6..bf8e13fcc53e 100644
--- a/cppuhelper/source/servicemanager.cxx
+++ b/cppuhelper/source/servicemanager.cxx
@@ -12,6 +12,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 
 #include 
@@ -462,20 +463,20 @@ private:
 
 virtual css::uno::Any SAL_CALL nextElement() override;
 
-osl::Mutex mutex_;
+std::mutex mutex_;
 std::vector< css::uno::Any > factories_;
 std::vector< css::uno::Any >::const_iterator iterator_;
 };
 
 sal_Bool ContentEnumeration::hasMoreElements()
 {
-osl::MutexGuard g(mutex_);
+std::lock_guard g(mutex_);
 return iterator_ != factories_.end();
 }
 
 css::uno::Any ContentEnumeration::nextElement()
 {
-osl::MutexGuard g(mutex_);
+std::lock_guard g(mutex_);
 if (iterator_ == factories_.end()) {
 throw css::container::NoSuchElementException(
 "Bootstrap service manager service enumerator has no more 
elements",
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2021-07-17 Thread Noel Grandin (via logerrit)
 cppuhelper/source/propertysetmixin.cxx |   16 
 1 file changed, 8 insertions(+), 8 deletions(-)

New commits:
commit 5962431c3d380f97f76c31869a1098e3efaa8b43
Author: Noel Grandin 
AuthorDate: Sat Jul 17 18:41:48 2021 +0200
Commit: Noel Grandin 
CommitDate: Sat Jul 17 22:16:28 2021 +0200

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

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

diff --git a/cppuhelper/source/propertysetmixin.cxx 
b/cppuhelper/source/propertysetmixin.cxx
index c7c8154896a4..0a270db6f17e 100644
--- a/cppuhelper/source/propertysetmixin.cxx
+++ b/cppuhelper/source/propertysetmixin.cxx
@@ -22,6 +22,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 
@@ -67,7 +68,6 @@
 #include 
 #include 
 #include 
-#include 
 #include 
 #include 
 #include 
@@ -381,7 +381,7 @@ public:
 
 typedef std::map< OUString, VetoListenerBag > VetoListenerMap;
 
-mutable osl::Mutex mutex;
+mutable std::mutex mutex;
 BoundListenerMap boundListeners;
 VetoListenerMap vetoListeners;
 bool disposed;
@@ -853,7 +853,7 @@ void PropertySetMixinImpl::prepareSet(
 Impl::VetoListenerBag specificVeto;
 Impl::VetoListenerBag unspecificVeto;
 {
-osl::MutexGuard g(m_impl->mutex);
+std::lock_guard g(m_impl->mutex);
 if (m_impl->disposed) {
 throw css::lang::DisposedException(
 "disposed", static_cast< css::beans::XPropertySet * >(this));
@@ -922,7 +922,7 @@ void PropertySetMixinImpl::dispose() {
 Impl::BoundListenerMap boundListeners;
 Impl::VetoListenerMap vetoListeners;
 {
-osl::MutexGuard g(m_impl->mutex);
+std::lock_guard g(m_impl->mutex);
 boundListeners.swap(m_impl->boundListeners);
 vetoListeners.swap(m_impl->vetoListeners);
 m_impl->disposed = true;
@@ -1001,7 +1001,7 @@ void PropertySetMixinImpl::addPropertyChangeListener(
 checkUnknown(propertyName);
 bool disposed;
 {
-osl::MutexGuard g(m_impl->mutex);
+std::lock_guard g(m_impl->mutex);
 disposed = m_impl->disposed;
 if (!disposed) {
 m_impl->boundListeners[propertyName].insert(listener);
@@ -1020,7 +1020,7 @@ void PropertySetMixinImpl::removePropertyChangeListener(
 {
 assert(listener.is());
 checkUnknown(propertyName);
-osl::MutexGuard g(m_impl->mutex);
+std::lock_guard g(m_impl->mutex);
 Impl::BoundListenerMap::iterator i(
 m_impl->boundListeners.find(propertyName));
 if (i != m_impl->boundListeners.end()) {
@@ -1040,7 +1040,7 @@ void PropertySetMixinImpl::addVetoableChangeListener(
 checkUnknown(propertyName);
 bool disposed;
 {
-osl::MutexGuard g(m_impl->mutex);
+std::lock_guard g(m_impl->mutex);
 disposed = m_impl->disposed;
 if (!disposed) {
 m_impl->vetoListeners[propertyName].insert(listener);
@@ -1059,7 +1059,7 @@ void PropertySetMixinImpl::removeVetoableChangeListener(
 {
 assert(listener.is());
 checkUnknown(propertyName);
-osl::MutexGuard g(m_impl->mutex);
+std::lock_guard g(m_impl->mutex);
 Impl::VetoListenerMap::iterator 
i(m_impl->vetoListeners.find(propertyName));
 if (i != m_impl->vetoListeners.end()) {
 Impl::VetoListenerBag::iterator j(i->second.find(listener));
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2021-07-17 Thread Noel Grandin (via logerrit)
 cppuhelper/source/weak.cxx |   47 ++---
 1 file changed, 23 insertions(+), 24 deletions(-)

New commits:
commit 3545caa5aac59022d5c00d4a0c2a74657cbcae8d
Author: Noel Grandin 
AuthorDate: Fri Jul 16 15:01:53 2021 +0200
Commit: Noel Grandin 
CommitDate: Sat Jul 17 09:11:32 2021 +0200

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

it is at least a little bit cheaper than osl::Mutex (since it's not
recursive)

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

diff --git a/cppuhelper/source/weak.cxx b/cppuhelper/source/weak.cxx
index e52dc607a0a3..657bf5d0c7da 100644
--- a/cppuhelper/source/weak.cxx
+++ b/cppuhelper/source/weak.cxx
@@ -21,7 +21,6 @@
 #include 
 
 #include 
-#include 
 #include 
 #include 
 #include 
@@ -30,6 +29,7 @@
 
 #include 
 #include 
+#include 
 
 using namespace osl;
 using namespace com::sun::star::uno;
@@ -40,11 +40,7 @@ namespace cppu
 
 // due to static Reflection destruction from usr, there must be a mutex leak 
(#73272#)
 // this is used to lock all instances of OWeakConnectionPoint and 
OWeakRefListener as well as OWeakObject::m_pWeakConnectionPoint
-static Mutex & getWeakMutex()
-{
-static Mutex * s_pMutex = new Mutex();
-return *s_pMutex;
-}
+static std::mutex * gpWeakMutex = new std::mutex;
 
 
 //-- OWeakConnectionPoint 
@@ -123,7 +119,7 @@ void OWeakConnectionPoint::dispose()
 {
 std::vector> aCopy;
 { // only hold the mutex while we access the field
-MutexGuard aGuard(getWeakMutex());
+std::scoped_lock aGuard(*cppu::gpWeakMutex);
 // OWeakObject is not the only owner of this, so clear m_pObject
 // so that queryAdapted() won't use it now that it's dead
 m_pObject = nullptr;
@@ -155,40 +151,43 @@ Reference< XInterface > SAL_CALL 
OWeakConnectionPoint::queryAdapted()
 {
 Reference< XInterface > ret;
 
-ClearableMutexGuard guard(getWeakMutex());
-
-if (m_pObject)
 {
+std::scoped_lock guard(*gpWeakMutex);
+
+if (!m_pObject)
+return ret;
+
 oslInterlockedCount n = osl_atomic_increment( _pObject->m_refCount );
 
-if (n > 1)
+if (n <= 1)
 {
-// The reference is incremented. The object cannot be destroyed.
-// Release the guard at the earliest point.
-guard.clear();
-// WeakObject has a (XInterface *) cast operator
-ret = *m_pObject;
-osl_atomic_decrement( _pObject->m_refCount );
-}
-else
 // Another thread wait in the dispose method at the guard
 osl_atomic_decrement( _pObject->m_refCount );
+return ret;
+}
 }
 
+// n is now > 1
+// The reference is incremented. The object cannot be destroyed.
+// Release the guard at the earliest point.
+// WeakObject has a (XInterface *) cast operator
+ret = *m_pObject;
+osl_atomic_decrement( _pObject->m_refCount );
+
 return ret;
 }
 
 // XInterface
 void SAL_CALL OWeakConnectionPoint::addReference(const Reference< XReference 
>& rRef)
 {
-MutexGuard aGuard(getWeakMutex());
+std::scoped_lock aGuard(*gpWeakMutex);
 m_aReferences.push_back( rRef );
 }
 
 // XInterface
 void SAL_CALL OWeakConnectionPoint::removeReference(const Reference< 
XReference >& rRef)
 {
-MutexGuard aGuard(getWeakMutex());
+std::scoped_lock aGuard(*gpWeakMutex);
 // Search from end because the thing that last added a ref is most likely 
to be the
 // first to remove a ref.
 // It's not really valid to compare the pointer directly, but it's faster.
@@ -269,7 +268,7 @@ Reference< XAdapter > SAL_CALL OWeakObject::queryAdapter()
 if (!m_pWeakConnectionPoint)
 {
 // only acquire mutex if member is not created
-MutexGuard aGuard( getWeakMutex() );
+std::scoped_lock aGuard( *gpWeakMutex );
 if( !m_pWeakConnectionPoint )
 {
 OWeakConnectionPoint * p = new OWeakConnectionPoint(this);
@@ -422,7 +421,7 @@ void SAL_CALL OWeakRefListener::dispose()
 {
 Reference< XAdapter > xAdp;
 {
-MutexGuard guard(cppu::getWeakMutex());
+std::scoped_lock guard(*cppu::gpWeakMutex);
 if( m_XWeakConnectionPoint.is() )
 {
 xAdp = m_XWeakConnectionPoint;
@@ -518,7 +517,7 @@ Reference< XInterface > WeakReferenceHelper::get() const
 Reference< XAdapter > xAdp;
 {
 // must lock to access m_XWeakConnectionPoint
-MutexGuard guard(cppu::getWeakMutex());
+std::scoped_lock guard(*cppu::gpWeakMutex);
 if( m_pImpl && m_pImpl->m_XWeakConnectionPoint.is() )
 xAdp = m_pImpl->m_XWeakConnectionPoint;
 }
___

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

2021-07-14 Thread Arnaud Versini (via logerrit)
 cppuhelper/source/implbase_ex.cxx |   19 ---
 1 file changed, 4 insertions(+), 15 deletions(-)

New commits:
commit c82914912f73f1fc9912d53fb60ca7a66379c560
Author: Arnaud Versini 
AuthorDate: Sat Jun 5 13:38:14 2021 +0200
Commit: Noel Grandin 
CommitDate: Wed Jul 14 19:12:01 2021 +0200

cppuhelper : use std::mutex and remove useless rtl::Static

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

diff --git a/cppuhelper/source/implbase_ex.cxx 
b/cppuhelper/source/implbase_ex.cxx
index 00eeaf376618..24b7a74582d7 100644
--- a/cppuhelper/source/implbase_ex.cxx
+++ b/cppuhelper/source/implbase_ex.cxx
@@ -24,28 +24,16 @@
 
 #include 
 
+#include 
+
 using namespace ::cppu;
 using namespace ::osl;
 using namespace ::com::sun::star;
 using namespace ::com::sun::star::uno;
 
-namespace
-{
-class theImplHelperInitMutex : public rtl::Static{};
-}
-
 namespace cppu
 {
 
-/** Shared mutex for implementation helper initialization.
-Not for public use.
-*/
-static ::osl::Mutex & getImplHelperInitMutex()
-{
-return theImplHelperInitMutex::get();
-}
-
-
 static void checkInterface( Type const & rType )
 {
 if (TypeClass_INTERFACE != rType.getTypeClass())
@@ -79,7 +67,8 @@ static type_entry * getTypeEntries( class_data * cd )
 type_entry * pEntries = cd->m_typeEntries;
 if (! cd->m_storedTypeRefs) // not inited?
 {
-MutexGuard guard( getImplHelperInitMutex() );
+static std::mutex aMutex;
+std::lock_guard guard( aMutex );
 if (! cd->m_storedTypeRefs) // not inited?
 {
 // get all types
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2021-03-12 Thread Luboš Luňák (via logerrit)
 cppuhelper/source/servicemanager.hxx |8 
 1 file changed, 4 insertions(+), 4 deletions(-)

New commits:
commit bd0dd2589c435078d8d974e3b37da5edb5f74f9f
Author: Luboš Luňák 
AuthorDate: Wed Mar 10 19:19:26 2021 +0100
Commit: Luboš Luňák 
CommitDate: Fri Mar 12 15:44:13 2021 +0100

use std::unordered_map in cppuhelper ServiceManager

It's faster and I do not see any reason for the map to be sorted.
cppuhelper::ServiceManager::findServiceImplementation() may be called
quite often e.g. during text layout by i18npool::BreakIterator.

Change-Id: If8c77c506b88a0a3eac29e0d20d43d2110eed4ba
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/112280
Tested-by: Jenkins
Reviewed-by: Luboš Luňák 

diff --git a/cppuhelper/source/servicemanager.hxx 
b/cppuhelper/source/servicemanager.hxx
index f6a505492be8..d086a8d65ead 100644
--- a/cppuhelper/source/servicemanager.hxx
+++ b/cppuhelper/source/servicemanager.hxx
@@ -12,7 +12,7 @@
 #include 
 
 #include 
-#include 
+#include 
 #include 
 #include 
 #include 
@@ -164,17 +164,17 @@ public:
 css::uno::Reference const & instance);
 };
 
-typedef std::map< OUString, std::shared_ptr< Implementation > >
+typedef std::unordered_map< OUString, std::shared_ptr< Implementation 
> >
 NamedImplementations;
 
 typedef
-std::map<
+std::unordered_map<
 css::uno::Reference< css::lang::XServiceInfo >,
 std::shared_ptr< Implementation > >
 DynamicImplementations;
 
 typedef
-std::map<
+std::unordered_map<
 OUString,
 std::vector< std::shared_ptr< Implementation > > >
 ImplementationMap;
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2020-11-11 Thread Stephan Bergmann (via logerrit)
 cppuhelper/source/paths.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit de26b2661bd77a9708889c1bbed0cb981a470663
Author: Stephan Bergmann 
AuthorDate: Wed Nov 11 21:03:14 2020 +0100
Commit: Stephan Bergmann 
CommitDate: Thu Nov 12 08:09:35 2020 +0100

loplugin:stringview (macOS)

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

diff --git a/cppuhelper/source/paths.cxx b/cppuhelper/source/paths.cxx
index 49144f715e54..0f59fb1272da 100644
--- a/cppuhelper/source/paths.cxx
+++ b/cppuhelper/source/paths.cxx
@@ -73,7 +73,7 @@ OUString cppu::getUnoIniUri() {
 // looking for the latter one here. I think...
 if (uri.endsWith( "/" LIBO_LIB_FOLDER ) )
 {
-uri = uri.copy( 0, uri.getLength() - (sizeof(LIBO_LIB_FOLDER)-1) ) + 
LIBO_URE_ETC_FOLDER;
+uri = OUString::Concat(uri.subView( 0, uri.getLength() - 
(sizeof(LIBO_LIB_FOLDER)-1) )) + LIBO_URE_ETC_FOLDER;
 }
 #endif
 #endif
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2020-10-01 Thread Stephan Bergmann (via logerrit)
 cppuhelper/source/servicemanager.cxx |   97 +--
 cppuhelper/source/servicemanager.hxx |   19 +-
 2 files changed, 88 insertions(+), 28 deletions(-)

New commits:
commit 1a1d432420646bcf129624a866fd6c754e25d195
Author: Stephan Bergmann 
AuthorDate: Wed Sep 30 21:31:10 2020 +0200
Commit: Stephan Bergmann 
CommitDate: Thu Oct 1 09:44:53 2020 +0200

Add single-instance attribute for *.compoonent s

...to ease the implementation in C++ code of constructor-based 
s
that shall be single-instance (and which would have been implemented with 
e.g.
cppu::creaetOneInstanceFactory for non--constructor-based 
s).
See e.g. 6e35794cad555485955c3b43593497dcdbf29840 "terminate XDesktop 
properly
in unit tests" and 6362ebab298549e8616c32cafd75cb3959ba7d65 "dbaccess: 
create
instances with uno constructors" for the clumsy approach used until now, 
where
the C++ constructor function uses a static instance that is cleared in
dispose(), adding fake  entries to s where 
necessary
so that the ServiceManager will call those XComponent::dispose() functions 
when
it itself gets disposed.

For every , the ServiceManager already holds an 
Implementation
data structure, so it can easily hold a singleInstance there and clear it 
when
the ServiceManager gets disposed.  (One consequence is that single-instance
implementations are now created with their Instance.mutex locked, but that
should not cause problems in practice, given that the construction of a 
single-
instance implementation should not recursively request its own construction
anyway.)

The new single-instance="true" attribute is mostly useful in combination 
with
the constructor attribute (see above), but it can also be used for non--
constructor-based s, at least in theory.

(The single-instance="true" attribute is orthogonal to  elements.
There are existing single-instance services---even if those should arguably 
have
been defined as singletons in the first place---that can benefit from
single-instance="true".  And there are s that support one or
more s alongside one or more s, where the latter are not
single-instance.)

This new single-instance="true" attribute in *.component files should not
interfere with the lo_get_constructor_map machinery in the 
DISABLE_DYNLOADING
branch of cppuhelper::detail::loadSharedLibComponentFactory
(cppuhelper/source/shlib.cxx) used by Android, iOS and some fuzzer code.
AFAIU, the lo_get_constructor_map machinery should only ever come into play
after the ServiceManager has decided whether or not to create a new instance
based on the single-instance attributes in the *.component files.

This commit only provides the new single-instance="true" attribute.  Actual
changes of s and their C++ constructor functions are 
delegated
to a series of follow-up commits.  (So that they can easily be reverted
individually should the need arise.)

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

diff --git a/cppuhelper/source/servicemanager.cxx 
b/cppuhelper/source/servicemanager.cxx
index f06405f7794b..fe9ef7dbd2b4 100644
--- a/cppuhelper/source/servicemanager.cxx
+++ b/cppuhelper/source/servicemanager.cxx
@@ -327,6 +327,7 @@ void Parser::handleComponent() {
 void Parser::handleImplementation() {
 OUString attrName;
 OUString attrConstructor;
+bool attrSingleInstance = false;
 xmlreader::Span name;
 int nsId;
 while (reader_.nextAttribute(, )) {
@@ -366,6 +367,19 @@ void Parser::handleImplementation() {
  + ":  has \"constructor\" attribute but"
 "  has no \"environment\" attribute");
 }
+} else if (nsId == xmlreader::XmlReader::NAMESPACE_NONE
+   && 
name.equals(RTL_CONSTASCII_STRINGPARAM("single-instance")))
+{
+if (attrSingleInstance) {
+throw css::registry::InvalidRegistryException(
+reader_.getUrl()
++ ":  has multiple \"single-instance\" 
attributes");
+}
+if 
(!reader_.getAttributeValue(false).equals(RTL_CONSTASCII_STRINGPARAM("true"))) {
+throw css::registry::InvalidRegistryException(
+reader_.getUrl() + ":  has bad 
\"single-instance\" attribute");
+}
+attrSingleInstance = true;
 } else {
 throw css::registry::InvalidRegistryException(
 reader_.getUrl() + ": unexpected element attribute \""
@@ -380,7 +394,7 @@ void Parser::handleImplementation() {
 implementation_ =
 std::make_shared(
 attrName, attrLoader_, attrUri_, attrEnvironment_, attrConstructor,
-attrPrefix_, 

[Libreoffice-commits] core.git: cppuhelper/source cppu/source

2020-09-13 Thread George Bateman (via logerrit)
 cppu/source/helper/purpenv/Proxy.hxx|5 +
 cppu/source/threadpool/current.hxx  |5 +
 cppu/source/threadpool/jobqueue.hxx |5 +
 cppu/source/threadpool/thread.hxx   |5 +
 cppu/source/threadpool/threadpool.hxx   |5 +
 cppu/source/typelib/typelib.hxx |5 +
 cppu/source/uno/IdentityMapping.hxx |5 +
 cppu/source/uno/assign.hxx  |5 +
 cppu/source/uno/cascade_mapping.hxx |5 +
 cppu/source/uno/constr.hxx  |5 +
 cppu/source/uno/copy.hxx|5 +
 cppu/source/uno/destr.hxx   |5 +
 cppu/source/uno/eq.hxx  |5 +
 cppu/source/uno/loadmodule.hxx  |5 +
 cppu/source/uno/prim.hxx|5 +
 cppuhelper/source/loadsharedlibcomponentfactory.hxx |5 +
 cppuhelper/source/macro_expander.hxx|5 +
 cppuhelper/source/paths.hxx |5 +
 cppuhelper/source/servicemanager.hxx|5 +
 cppuhelper/source/typemanager.hxx   |5 +
 20 files changed, 20 insertions(+), 80 deletions(-)

New commits:
commit 08cc983e26dd3252b12b253af9b0c3430e933321
Author: George Bateman 
AuthorDate: Sun Sep 13 11:57:19 2020 +
Commit: Julien Nabet 
CommitDate: Sun Sep 13 15:28:21 2020 +0200

tdf#124176 Use #pragma once in cppu, cppuhelper

This commit was carried out by a Python script, source of which
is at https://bugs.documentfoundation.org/show_bug.cgi?id=124176#c97.

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

diff --git a/cppu/source/helper/purpenv/Proxy.hxx 
b/cppu/source/helper/purpenv/Proxy.hxx
index 6f99ee7d42be..953abbf3b449 100644
--- a/cppu/source/helper/purpenv/Proxy.hxx
+++ b/cppu/source/helper/purpenv/Proxy.hxx
@@ -17,8 +17,7 @@
  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
  */
 
-#ifndef INCLUDED_CPPU_SOURCE_HELPER_PURPENV_PROXY_HXX
-#define INCLUDED_CPPU_SOURCE_HELPER_PURPENV_PROXY_HXX
+#pragma once
 
 #include 
 
@@ -74,6 +73,4 @@ public:
 
 extern "C" void Proxy_free(uno_ExtEnvironment * pEnv, void * pProxy) 
SAL_THROW_EXTERN_C();
 
-#endif
-
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/cppu/source/threadpool/current.hxx 
b/cppu/source/threadpool/current.hxx
index ea26851ddb00..43eb809f9bff 100644
--- a/cppu/source/threadpool/current.hxx
+++ b/cppu/source/threadpool/current.hxx
@@ -17,8 +17,7 @@
  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
  */
 
-#ifndef INCLUDED_CPPU_SOURCE_THREADPOOL_CURRENT_HXX
-#define INCLUDED_CPPU_SOURCE_THREADPOOL_CURRENT_HXX
+#pragma once
 
 #include 
 
@@ -42,6 +41,4 @@ struct IdContainer
 IdContainer * getIdContainer();
 }
 
-#endif
-
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/cppu/source/threadpool/jobqueue.hxx 
b/cppu/source/threadpool/jobqueue.hxx
index 5a5c80479d2b..5b92f2476ed4 100644
--- a/cppu/source/threadpool/jobqueue.hxx
+++ b/cppu/source/threadpool/jobqueue.hxx
@@ -17,8 +17,7 @@
  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
  */
 
-#ifndef INCLUDED_CPPU_SOURCE_THREADPOOL_JOBQUEUE_HXX
-#define INCLUDED_CPPU_SOURCE_THREADPOOL_JOBQUEUE_HXX
+#pragma once
 
 #include 
 
@@ -70,6 +69,4 @@ namespace cppu_threadpool
 };
 }
 
-#endif
-
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/cppu/source/threadpool/thread.hxx 
b/cppu/source/threadpool/thread.hxx
index e9258a97b3ed..9873c214737e 100644
--- a/cppu/source/threadpool/thread.hxx
+++ b/cppu/source/threadpool/thread.hxx
@@ -16,8 +16,7 @@
  *   except in compliance with the License. You may obtain a copy of
  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
  */
-#ifndef INCLUDED_CPPU_SOURCE_THREADPOOL_THREAD_HXX
-#define INCLUDED_CPPU_SOURCE_THREADPOOL_THREAD_HXX
+#pragma once
 
 #include 
 #include 
@@ -65,6 +64,4 @@ namespace cppu_threadpool {
 } // end cppu_threadpool
 
 
-#endif
-
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/cppu/source/threadpool/threadpool.hxx 
b/cppu/source/threadpool/threadpool.hxx
index f473e2519348..e112f05805d0 100644
--- a/cppu/source/threadpool/threadpool.hxx
+++ b/cppu/source/threadpool/threadpool.hxx
@@ -17,8 +17,7 @@
  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
  */
 
-#ifndef INCLUDED_CPPU_SOURCE_THREADPOOL_THREADPOOL_HXX
-#define INCLUDED_CPPU_SOURCE_THREADPOOL_THREADPOOL_HXX
+#pragma once
 
 #include 
 #include 
@@ -159,6 +158,4 @@ namespace cppu_threadpool {
 
 } // end namespace cppu_threadpool
 
-#endif
-
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git 

[Libreoffice-commits] core.git: cppuhelper/source desktop/source editeng/source filter/qa filter/source forms/source framework/qa framework/source

2020-08-19 Thread Andrea Gelmini (via logerrit)
 cppuhelper/source/factory.cxx  |2 +-
 desktop/source/deployment/manager/dp_extensionmanager.cxx  |2 +-
 desktop/source/deployment/registry/package/dp_package.cxx  |2 +-
 editeng/source/editeng/impedit3.cxx|2 +-
 filter/qa/complex/filter/detection/typeDetection/files.csv |2 +-
 filter/source/graphicfilter/idxf/dxfentrd.cxx  |2 +-
 filter/source/msfilter/msdffimp.cxx|2 +-
 filter/source/xslt/export/spreadsheetml/table.xsl  |2 +-
 forms/source/component/Filter.cxx  |2 +-
 framework/qa/complex/framework/recovery/RecoveryTest.java  |2 +-
 framework/source/inc/accelerators/presethandler.hxx|4 ++--
 11 files changed, 12 insertions(+), 12 deletions(-)

New commits:
commit c9a0cbc856281b8f4e8bafb570127e291b282629
Author: Andrea Gelmini 
AuthorDate: Wed Aug 19 13:25:12 2020 +0200
Commit: Julien Nabet 
CommitDate: Wed Aug 19 15:41:21 2020 +0200

Fix typos

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

diff --git a/cppuhelper/source/factory.cxx b/cppuhelper/source/factory.cxx
index 8a951033cc08..1d997146f099 100644
--- a/cppuhelper/source/factory.cxx
+++ b/cppuhelper/source/factory.cxx
@@ -688,7 +688,7 @@ Reference< XInterface > 
ORegistryFactoryHelper::createInstanceWithArgumentsAndCo
 }
 if( xModuleFactoryDepr.is() )
 {
-SAL_INFO_IF(xContext.is(), "cppuhelper", "ignoring context calling 
ORegistryFactoryHelper::createInstaceWithArgumentsAndContext()!");
+SAL_INFO_IF(xContext.is(), "cppuhelper", "ignoring context calling 
ORegistryFactoryHelper::createInstanceWithArgumentsAndContext()!");
 return xModuleFactoryDepr->createInstanceWithArguments( rArguments );
 }
 
diff --git a/desktop/source/deployment/manager/dp_extensionmanager.cxx 
b/desktop/source/deployment/manager/dp_extensionmanager.cxx
index c9ecf7d2123c..2f82d3d500ad 100644
--- a/desktop/source/deployment/manager/dp_extensionmanager.cxx
+++ b/desktop/source/deployment/manager/dp_extensionmanager.cxx
@@ -862,7 +862,7 @@ void ExtensionManager::removeExtension(
 } catch (...) {
 excOccurred1 = ::cppu::getCaughtException();
 css::deployment::DeploymentException exc(
-"Extension Manager: exception during removeEtension",
+"Extension Manager: exception during removeExtension",
 static_cast(this), excOccurred1);
 excOccurred1 <<= exc;
 }
diff --git a/desktop/source/deployment/registry/package/dp_package.cxx 
b/desktop/source/deployment/registry/package/dp_package.cxx
index a6d099db9f5c..e0adb4395f4c 100644
--- a/desktop/source/deployment/registry/package/dp_package.cxx
+++ b/desktop/source/deployment/registry/package/dp_package.cxx
@@ -691,7 +691,7 @@ bool BackendImpl::PackageImpl::checkLicense(
 return 0;
 
 //always return LICENSE as long as the user did not accept the license
-//so that XExtensonManager::checkPrerequisitesAndEnable will again
+//so that XExtensionManager::checkPrerequisitesAndEnable will again
 //check the license
 if (!checkPlatform(xCmdEnv))
 return deployment::Prerequisites::PLATFORM |
diff --git a/editeng/source/editeng/impedit3.cxx 
b/editeng/source/editeng/impedit3.cxx
index eba85963052e..0caebc3ae342 100644
--- a/editeng/source/editeng/impedit3.cxx
+++ b/editeng/source/editeng/impedit3.cxx
@@ -1927,7 +1927,7 @@ void ImpEditEngine::ImpBreakLine( ParaPortion* 
pParaPortion, EditLine* pLine, Te
 sal_Int32 nWordLen = nWordEnd - nWordStart;
 if ( ( nWordEnd >= nMaxBreakPos ) && ( nWordLen > 3 ) )
 {
-// May happen, because getLineBreak may differ from 
getWordBoudary with DICTIONARY_WORD
+// May happen, because getLineBreak may differ from 
getWordBoundary with DICTIONARY_WORD
 const OUString aWord = pNode->GetString().copy(nWordStart, 
nWordLen);
 sal_Int32 nMinTrail = nWordEnd-nMaxBreakPos+1; //+1: Before 
the dickey letter
 Reference< XHyphenatedWord > xHyphWord;
diff --git a/filter/qa/complex/filter/detection/typeDetection/files.csv 
b/filter/qa/complex/filter/detection/typeDetection/files.csv
index 55fe02bd699b..b882ea1179ca 100644
--- a/filter/qa/complex/filter/detection/typeDetection/files.csv
+++ b/filter/qa/complex/filter/detection/typeDetection/files.csv
@@ -3,7 +3,7 @@ fileAlias;fileURL;defaultFileType;streamFileType
 #** N O T E
 #**
 #** The detection for template filter and writer_text_encoded
-#** will be changed on following childworkspsace
+#** will be changed on following childworkspace
 #**
 #**
 ###
diff --git a/filter/source/graphicfilter/idxf/dxfentrd.cxx 

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

2020-08-11 Thread Stephan Bergmann (via logerrit)
 cppuhelper/source/typemanager.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 986bd8b93b35ad7f2760dfe0576860532daa0e42
Author: Stephan Bergmann 
AuthorDate: Tue Aug 11 20:22:31 2020 +0200
Commit: Stephan Bergmann 
CommitDate: Wed Aug 12 06:08:48 2020 +0200

-Werror,-Wuninitialized (apparently new in Clang 12 trunk)

> cppuhelper/source/typemanager.cxx:1571:47: error: field 'entity_' is 
uninitialized when used here [-Werror,-Wuninitialized]
> ServiceBasedSingletonDescription_Base(entity_->isPublished()),
>   ^

The code was like that ever since it was introduced in
fa559f1c416884015d1d83d0a7ac8803e745d9df "WIP: Experimental new binary 
type.rdb
format".  Odd that that never caused an issue, but the code appears to at 
least
never be executed during `make check`.

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

diff --git a/cppuhelper/source/typemanager.cxx 
b/cppuhelper/source/typemanager.cxx
index c03780b1e932..8949ea4c9547 100644
--- a/cppuhelper/source/typemanager.cxx
+++ b/cppuhelper/source/typemanager.cxx
@@ -1568,7 +1568,7 @@ public:
 rtl::Reference< cppuhelper::TypeManager > const & manager,
 OUString const & name,
 rtl::Reference< unoidl::ServiceBasedSingletonEntity > const & entity):
-ServiceBasedSingletonDescription_Base(entity_->isPublished()),
+ServiceBasedSingletonDescription_Base(entity->isPublished()),
 manager_(manager), name_(name), entity_(entity)
 { assert(manager.is()); assert(entity.is()); }
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2020-08-07 Thread Tor Lillqvist (via logerrit)
 cppuhelper/source/exc_thrower.cxx |6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

New commits:
commit 24d94f9a1507d24b71276f879d8353996ebe55dc
Author: Tor Lillqvist 
AuthorDate: Fri Aug 7 06:58:27 2020 +0100
Commit: Tor Lillqvist 
CommitDate: Fri Aug 7 13:32:12 2020 +0200

Use the lo_mobile_throwException() thing on macOS on arm64 for now

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

diff --git a/cppuhelper/source/exc_thrower.cxx 
b/cppuhelper/source/exc_thrower.cxx
index 7c40d12db16e..2963572e4770 100644
--- a/cppuhelper/source/exc_thrower.cxx
+++ b/cppuhelper/source/exc_thrower.cxx
@@ -173,7 +173,7 @@ ExceptionThrower::ExceptionThrower()
 
 class theExceptionThrower : public rtl::Static {};
 
-#if defined(IOS) || (defined(__aarch64__) && defined(ANDROID))
+#if defined(IOS) || (defined(__aarch64__) && (defined(ANDROID) || 
defined(MACOSX)))
 // In the native iOS / Android app, where we don't have any Java, Python,
 // BASIC, or other scripting, the only thing that would use the C++/UNO bridge
 // functionality that invokes codeSnippet() was cppu::throwException().
@@ -211,7 +211,7 @@ void lo_mobile_throwException(css::uno::Any const& 
aException)
 
 assert(false);
 }
-#endif // defined(IOS) || (defined(__aarch64__) && defined(ANDROID))
+#endif // defined(IOS) || (defined(__aarch64__) && (defined(ANDROID) || 
defined(MACOSX)))
 
 } // anonymous namespace
 
@@ -229,7 +229,7 @@ void SAL_CALL throwException( Any const & exc )
 "(must be derived from com::sun::star::uno::Exception)!" );
 }
 
-#if defined(IOS) || (defined(__aarch64__) && defined(ANDROID))
+#if defined(IOS) || (defined(__aarch64__) && (defined(ANDROID) || 
defined(MACOSX)))
 lo_mobile_throwException(exc);
 #else
 Mapping uno2cpp(Environment(UNO_LB_UNO), Environment::getCurrent());
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2020-07-23 Thread Stephan Bergmann (via logerrit)
 cppuhelper/source/defaultbootstrap.cxx |2 --
 1 file changed, 2 deletions(-)

New commits:
commit 37587df6242e232f27b31e3dd6ade29aa6cf2555
Author: Stephan Bergmann 
AuthorDate: Thu Jul 23 15:52:15 2020 +0200
Commit: Stephan Bergmann 
CommitDate: Thu Jul 23 19:49:49 2020 +0200

Remove no longer relevant assert

...that was apparently meant to guard the following

  _values[0]

that got changed to

  context_values.data()

in c18e2ea2a52fc171c50fcb22d431e94c6aececc5 "New loplugin:data"

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

diff --git a/cppuhelper/source/defaultbootstrap.cxx 
b/cppuhelper/source/defaultbootstrap.cxx
index 4796c92e9fa5..bf518a0c1f5d 100644
--- a/cppuhelper/source/defaultbootstrap.cxx
+++ b/cppuhelper/source/defaultbootstrap.cxx
@@ -9,7 +9,6 @@
 
 #include 
 
-#include 
 #include 
 
 #include 
@@ -90,7 +89,6 @@ cppu::defaultBootstrap_InitialComponentContext(OUString const 
& iniUri)
 css::uno::Any(
 OUString("com.sun.star.security.AccessController")),
 true));
-assert(!context_values.empty());
 css::uno::Reference< css::uno::XComponentContext > context(
 createComponentContext(context_values.data(), context_values.size()));
 smgr->setContext(context);
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: cppuhelper/source cui/source

2020-05-20 Thread Noel Grandin (via logerrit)
 cppuhelper/source/propertysetmixin.cxx|   52 +-
 cppuhelper/source/servicemanager.cxx  |   28 ++---
 cppuhelper/source/tdmgr.cxx   |   16 +--
 cppuhelper/source/typemanager.cxx |   19 +--
 cui/source/customize/SvxConfigPageHelper.cxx  |   58 ++--
 cui/source/customize/SvxNotebookbarConfigPage.cxx |6 -
 cui/source/customize/cfg.cxx  |  105 ++
 cui/source/customize/cfgutil.cxx  |   27 ++---
 cui/source/dialogs/colorpicker.cxx|   10 +-
 cui/source/dialogs/cuicharmap.cxx |   24 ++---
 cui/source/dialogs/hldocntp.cxx   |   12 +-
 cui/source/dialogs/insdlg.cxx |   12 +-
 cui/source/dialogs/scriptdlg.cxx  |   38 +++
 cui/source/options/optaboutconfig.cxx |   24 ++---
 cui/source/options/optcolor.cxx   |7 -
 cui/source/options/optlingu.cxx   |   73 ++-
 cui/source/options/treeopt.cxx|   15 +--
 cui/source/options/webconninfo.cxx|   22 ++--
 18 files changed, 264 insertions(+), 284 deletions(-)

New commits:
commit 9a0faf09a8963556eafe172ae16735472f24659d
Author: Noel Grandin 
AuthorDate: Tue May 19 19:16:41 2020 +0200
Commit: Noel Grandin 
CommitDate: Wed May 20 08:37:46 2020 +0200

use for-range on Sequence in cppuhelper,cui

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

diff --git a/cppuhelper/source/propertysetmixin.cxx 
b/cppuhelper/source/propertysetmixin.cxx
index 899567e85686..c7c8154896a4 100644
--- a/cppuhelper/source/propertysetmixin.cxx
+++ b/cppuhelper/source/propertysetmixin.cxx
@@ -137,26 +137,26 @@ void Data::initProperties(
 if (!seen->insert(ifc->getName()).second)
 return;
 
-css::uno::Sequence<
-css::uno::Reference< css::reflection::XTypeDescription > > bases(
+const css::uno::Sequence<
+css::uno::Reference< css::reflection::XTypeDescription > > bases(
 ifc->getBaseTypes());
-for (sal_Int32 i = 0; i < bases.getLength(); ++i) {
-initProperties(bases[i], absentOptional, handleNames, seen);
+for (const auto & i : bases) {
+initProperties(i, absentOptional, handleNames, seen);
 }
-css::uno::Sequence<
-css::uno::Reference<
-css::reflection::XInterfaceMemberTypeDescription > > members(
+const css::uno::Sequence<
+css::uno::Reference<
+css::reflection::XInterfaceMemberTypeDescription > > members(
 ifc->getMembers());
 OUString const * absentBegin = absentOptional.getConstArray();
 OUString const * absentEnd =
 absentBegin + absentOptional.getLength();
-for (sal_Int32 i = 0; i < members.getLength(); ++i) {
-if (members[i]->getTypeClass()
+for (const auto & m : members) {
+if (m->getTypeClass()
 == css::uno::TypeClass_INTERFACE_ATTRIBUTE)
 {
 css::uno::Reference<
 css::reflection::XInterfaceAttributeTypeDescription2 > attr(
-members[i], css::uno::UNO_QUERY_THROW);
+m, css::uno::UNO_QUERY_THROW);
 sal_Int16 attrAttribs = 0;
 if (attr->isBound()) {
 attrAttribs |= css::beans::PropertyAttribute::BOUND;
@@ -174,19 +174,19 @@ void Data::initProperties(
 //XXX  Special interpretation of getter/setter exceptions only
 // works if the specified exceptions are of the exact type, not
 // of a supertype:
-for (sal_Int32 j = 0; j < excs.getLength(); ++j) {
-if ( excs[j]->getName() == 
"com.sun.star.beans.UnknownPropertyException" )
+for (const auto & ex : std::as_const(excs)) {
+if ( ex->getName() == 
"com.sun.star.beans.UnknownPropertyException" )
 {
 bGetUnknown = true;
 break;
 }
 }
 excs = attr->getSetExceptions();
-for (sal_Int32 j = 0; j < excs.getLength(); ++j) {
-if ( excs[j]->getName() == 
"com.sun.star.beans.UnknownPropertyException" )
+for (const auto & ex : std::as_const(excs)) {
+if ( ex->getName() == 
"com.sun.star.beans.UnknownPropertyException" )
 {
 bSetUnknown = true;
-} else if ( excs[j]->getName() == 
"com.sun.star.beans.PropertyVetoException" )
+} else if ( ex->getName() == 
"com.sun.star.beans.PropertyVetoException" )
 {
 attrAttribs
 |= css::beans::PropertyAttribute::CONSTRAINED;
@@ -239,7 +239,7 @@ void Data::initProperties(
 throw css::uno::RuntimeException(
 

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

2020-04-17 Thread Noel Grandin (via logerrit)
 cppuhelper/source/component_context.cxx |   56 +--
 cppuhelper/source/implbase.cxx  |  141 
 cppuhelper/source/propertysetmixin.cxx  |  223 ++---
 cppuhelper/source/propshlp.cxx  |  531 
 cppuhelper/source/tdmgr.cxx |   54 +--
 5 files changed, 504 insertions(+), 501 deletions(-)

New commits:
commit 23dad0aa083996b5086f6da868a001499bdc8a40
Author: Noel Grandin 
AuthorDate: Fri Apr 17 15:08:40 2020 +0200
Commit: Noel Grandin 
CommitDate: Fri Apr 17 21:07:27 2020 +0200

loplugin:flatten in cppuhelper

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

diff --git a/cppuhelper/source/component_context.cxx 
b/cppuhelper/source/component_context.cxx
index 6d70b7817fa7..739be2800631 100644
--- a/cppuhelper/source/component_context.cxx
+++ b/cppuhelper/source/component_context.cxx
@@ -492,38 +492,38 @@ ComponentContext::ComponentContext(
 }
 }
 
-if (!m_xSMgr.is() && m_xDelegate.is())
+if (!(!m_xSMgr.is() && m_xDelegate.is()))
+return;
+
+// wrap delegate's smgr XPropertySet into new smgr
+Reference< lang::XMultiComponentFactory > xMgr( 
m_xDelegate->getServiceManager() );
+if (!xMgr.is())
+return;
+
+osl_atomic_increment( _refCount );
+try
 {
-// wrap delegate's smgr XPropertySet into new smgr
-Reference< lang::XMultiComponentFactory > xMgr( 
m_xDelegate->getServiceManager() );
-if (xMgr.is())
+// create new smgr based on delegate's one
+m_xSMgr.set(
+xMgr->createInstanceWithContext(
+"com.sun.star.comp.stoc.OServiceManagerWrapper", xDelegate ),
+UNO_QUERY );
+// patch DefaultContext property of new one
+Reference< beans::XPropertySet > xProps( m_xSMgr, UNO_QUERY );
+OSL_ASSERT( xProps.is() );
+if (xProps.is())
 {
-osl_atomic_increment( _refCount );
-try
-{
-// create new smgr based on delegate's one
-m_xSMgr.set(
-xMgr->createInstanceWithContext(
-"com.sun.star.comp.stoc.OServiceManagerWrapper", 
xDelegate ),
-UNO_QUERY );
-// patch DefaultContext property of new one
-Reference< beans::XPropertySet > xProps( m_xSMgr, UNO_QUERY );
-OSL_ASSERT( xProps.is() );
-if (xProps.is())
-{
-Reference< XComponentContext > xThis( this );
-xProps->setPropertyValue( "DefaultContext", Any( xThis ) );
-}
-}
-catch (...)
-{
-osl_atomic_decrement( _refCount );
-throw;
-}
-osl_atomic_decrement( _refCount );
-OSL_ASSERT( m_xSMgr.is() );
+Reference< XComponentContext > xThis( this );
+xProps->setPropertyValue( "DefaultContext", Any( xThis ) );
 }
 }
+catch (...)
+{
+osl_atomic_decrement( _refCount );
+throw;
+}
+osl_atomic_decrement( _refCount );
+OSL_ASSERT( m_xSMgr.is() );
 }
 
 
diff --git a/cppuhelper/source/implbase.cxx b/cppuhelper/source/implbase.cxx
index 554520ac8196..1f00accecb27 100644
--- a/cppuhelper/source/implbase.cxx
+++ b/cppuhelper/source/implbase.cxx
@@ -67,64 +67,65 @@ void WeakComponentImplHelperBase::acquire()
 void WeakComponentImplHelperBase::release()
 throw ()
 {
-if (osl_atomic_decrement( _refCount ) == 0) {
-// ensure no other references are created, via the weak connection 
point, from now on
-disposeWeakConnectionPoint();
-// restore reference count:
-osl_atomic_increment( _refCount );
-if (! rBHelper.bDisposed) {
-try {
-dispose();
-}
-catch (RuntimeException const& exc) { // don't break throw ()
-SAL_WARN( "cppuhelper", exc );
-}
-OSL_ASSERT( rBHelper.bDisposed );
+if (osl_atomic_decrement( _refCount ) != 0)
+return;
+
+// ensure no other references are created, via the weak connection point, 
from now on
+disposeWeakConnectionPoint();
+// restore reference count:
+osl_atomic_increment( _refCount );
+if (! rBHelper.bDisposed) {
+try {
+dispose();
+}
+catch (RuntimeException const& exc) { // don't break throw ()
+SAL_WARN( "cppuhelper", exc );
 }
-OWeakObject::release();
+OSL_ASSERT( rBHelper.bDisposed );
 }
+OWeakObject::release();
 }
 
 void WeakComponentImplHelperBase::dispose()
 {
 ClearableMutexGuard aGuard( rBHelper.rMutex );
-if (!rBHelper.bDisposed && !rBHelper.bInDispose)
+if (rBHelper.bDisposed || 

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

2020-03-10 Thread Andrea Gelmini (via logerrit)
 cppuhelper/source/propshlp.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 8305d28f8dbdc9f891df38da290627b5e7dc651a
Author: Andrea Gelmini 
AuthorDate: Tue Mar 10 17:08:46 2020 +0100
Commit: Julien Nabet 
CommitDate: Tue Mar 10 20:43:41 2020 +0100

Fix typo

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

diff --git a/cppuhelper/source/propshlp.cxx b/cppuhelper/source/propshlp.cxx
index 6bf5fad3b74a..cdde8d4ff92f 100644
--- a/cppuhelper/source/propshlp.cxx
+++ b/cppuhelper/source/propshlp.cxx
@@ -768,7 +768,7 @@ void OPropertySetHelper::fire
 {
 try
 {
-// fire the hole event sequence to the
+// fire the whole event sequence to the
 // XPropertiesChangeListener's
 pL->propertiesChange( aEvts );
 }
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2020-03-05 Thread Michael Weghorn (via logerrit)
 cppuhelper/source/exc_thrower.cxx |8 
 1 file changed, 4 insertions(+), 4 deletions(-)

New commits:
commit cd6b32ef1f3348ce8e529c5f808b704ff728c240
Author: Michael Weghorn 
AuthorDate: Thu Mar 5 16:55:17 2020 +0100
Commit: Michael Weghorn 
CommitDate: Thu Mar 5 20:17:24 2020 +0100

tdf#127781 Android Viewer: aarch64: Avoid throwing exceptions through 
bridges

This basically extends what commit
eb15ac837e06087fb8148330e9171d6697d89ee6 ("android: Avoid
throwing exceptions through the bridges.", 2019-11-29), amended
by f2f8a2ec10d87ffb23949338a9e4da1e1d704644 ("android:
Actually let's avoid the exceptions via bridges only on aarch4.",
2019-12-02) did for the online-based Android app to cover the Android
Viewer case as well.

This makes Android Viewer work on aarch64, which previously crashed
whenever trying to load a document.

Change-Id: Id8b30e1dced583159cc4d81aaa18f4c25b901cff
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/90047
Tested-by: Jenkins
Reviewed-by: Michael Weghorn 

diff --git a/cppuhelper/source/exc_thrower.cxx 
b/cppuhelper/source/exc_thrower.cxx
index 5fa7c7330fe5..7c40d12db16e 100644
--- a/cppuhelper/source/exc_thrower.cxx
+++ b/cppuhelper/source/exc_thrower.cxx
@@ -173,7 +173,7 @@ ExceptionThrower::ExceptionThrower()
 
 class theExceptionThrower : public rtl::Static {};
 
-#if defined(IOS) || (defined(__aarch64__) && HAVE_FEATURE_ANDROID_LOK)
+#if defined(IOS) || (defined(__aarch64__) && defined(ANDROID))
 // In the native iOS / Android app, where we don't have any Java, Python,
 // BASIC, or other scripting, the only thing that would use the C++/UNO bridge
 // functionality that invokes codeSnippet() was cppu::throwException().
@@ -211,7 +211,7 @@ void lo_mobile_throwException(css::uno::Any const& 
aException)
 
 assert(false);
 }
-#endif // defined(IOS) || (defined(__aarch64__) && HAVE_FEATURE_ANDROID_LOK)
+#endif // defined(IOS) || (defined(__aarch64__) && defined(ANDROID))
 
 } // anonymous namespace
 
@@ -229,7 +229,7 @@ void SAL_CALL throwException( Any const & exc )
 "(must be derived from com::sun::star::uno::Exception)!" );
 }
 
-#if defined(IOS) || (defined(__aarch64__) && HAVE_FEATURE_ANDROID_LOK)
+#if defined(IOS) || (defined(__aarch64__) && defined(ANDROID))
 lo_mobile_throwException(exc);
 #else
 Mapping uno2cpp(Environment(UNO_LB_UNO), Environment::getCurrent());
@@ -252,7 +252,7 @@ void SAL_CALL throwException( Any const & exc )
 
 Any SAL_CALL getCaughtException()
 {
-#if defined(__aarch64__) && HAVE_FEATURE_ANDROID_LOK
+#if defined(__aarch64__) && defined(ANDROID)
 // FIXME This stuff works on 32bit ARM, let's use the shortcut only for
 // the 64bit ARM.
 return Any();
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2020-02-11 Thread Jan Holesovsky (via logerrit)
 cppuhelper/source/exc_thrower.cxx |   10 ++
 1 file changed, 6 insertions(+), 4 deletions(-)

New commits:
commit f2f8a2ec10d87ffb23949338a9e4da1e1d704644
Author: Jan Holesovsky 
AuthorDate: Mon Dec 2 11:32:45 2019 +0100
Commit: Andras Timar 
CommitDate: Tue Feb 11 15:24:34 2020 +0100

android: Actually let's avoid the exceptions via bridges only on aarch4.

Change-Id: Id2830f09ca6afd11f6f866565f37bdb7ba45bfb1
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/84205
Tested-by: Jenkins
Reviewed-by: Andras Timar 

diff --git a/cppuhelper/source/exc_thrower.cxx 
b/cppuhelper/source/exc_thrower.cxx
index 253e484e1236..5fa7c7330fe5 100644
--- a/cppuhelper/source/exc_thrower.cxx
+++ b/cppuhelper/source/exc_thrower.cxx
@@ -173,7 +173,7 @@ ExceptionThrower::ExceptionThrower()
 
 class theExceptionThrower : public rtl::Static {};
 
-#if defined(IOS) || HAVE_FEATURE_ANDROID_LOK
+#if defined(IOS) || (defined(__aarch64__) && HAVE_FEATURE_ANDROID_LOK)
 // In the native iOS / Android app, where we don't have any Java, Python,
 // BASIC, or other scripting, the only thing that would use the C++/UNO bridge
 // functionality that invokes codeSnippet() was cppu::throwException().
@@ -211,7 +211,7 @@ void lo_mobile_throwException(css::uno::Any const& 
aException)
 
 assert(false);
 }
-#endif // defined(IOS) || HAVE_FEATURE_ANDROID_LOK
+#endif // defined(IOS) || (defined(__aarch64__) && HAVE_FEATURE_ANDROID_LOK)
 
 } // anonymous namespace
 
@@ -229,7 +229,7 @@ void SAL_CALL throwException( Any const & exc )
 "(must be derived from com::sun::star::uno::Exception)!" );
 }
 
-#if defined(IOS) || HAVE_FEATURE_ANDROID_LOK
+#if defined(IOS) || (defined(__aarch64__) && HAVE_FEATURE_ANDROID_LOK)
 lo_mobile_throwException(exc);
 #else
 Mapping uno2cpp(Environment(UNO_LB_UNO), Environment::getCurrent());
@@ -252,7 +252,9 @@ void SAL_CALL throwException( Any const & exc )
 
 Any SAL_CALL getCaughtException()
 {
-#if HAVE_FEATURE_ANDROID_LOK
+#if defined(__aarch64__) && HAVE_FEATURE_ANDROID_LOK
+// FIXME This stuff works on 32bit ARM, let's use the shortcut only for
+// the 64bit ARM.
 return Any();
 #else
 Mapping cpp2uno(Environment::getCurrent(), Environment(UNO_LB_UNO));
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: cppuhelper/source include/cppuhelper

2020-01-17 Thread Noel Grandin (via logerrit)
 cppuhelper/source/interfacecontainer.cxx |   87 +++
 include/cppuhelper/interfacecontainer.h  |2 
 2 files changed, 32 insertions(+), 57 deletions(-)

New commits:
commit ec94926665ef70fdd2c0901e104b43f8bea8b888
Author: Noel Grandin 
AuthorDate: Thu Jan 16 15:56:52 2020 +0200
Commit: Noel Grandin 
CommitDate: Fri Jan 17 13:40:59 2020 +0100

Use std::vector in OInterfaceContainerHelper instead of Sequence

instead of fighting the fact that Sequence is intended to be immutable

getSequence() will become a little slower, but since getSequence()
is called 5k times during 'make check', while add/remove are called
3M times, I think it's safe to say mutation is dominant.

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

diff --git a/cppuhelper/source/interfacecontainer.cxx 
b/cppuhelper/source/interfacecontainer.cxx
index a496b93fc372..38cca295755b 100644
--- a/cppuhelper/source/interfacecontainer.cxx
+++ b/cppuhelper/source/interfacecontainer.cxx
@@ -20,6 +20,7 @@
 
 #include 
 #include 
+#include 
 
 #include 
 #include 
@@ -36,24 +37,6 @@ using namespace com::sun::star::lang;
 
 namespace cppu
 {
-/**
- * Remove an element from an interface sequence.
- */
-static void sequenceRemoveElementAt( Sequence< Reference< XInterface > > & 
rSeq, sal_Int32 index )
-{
-sal_Int32 nNewLen = rSeq.getLength() - 1;
-
-Sequence< Reference< XInterface > > aDestSeq( rSeq.getLength() - 1 );
-// getArray on a const sequence is faster
-const Reference< XInterface > * pSource = rSeq.getConstArray();
-Reference< XInterface > * pDest = aDestSeq.getArray();
-sal_Int32 i = 0;
-for( ; i < index; i++ )
-pDest[i] = pSource[i];
-for( sal_Int32 j = i ; j < nNewLen; j++ )
-pDest[j] = pSource[j+1];
-rSeq = aDestSeq;
-}
 
 OInterfaceIteratorHelper::OInterfaceIteratorHelper( OInterfaceContainerHelper 
& rCont_ )
 : rCont( rCont_ )
@@ -67,7 +50,7 @@ OInterfaceIteratorHelper::OInterfaceIteratorHelper( 
OInterfaceContainerHelper &
 if( bIsList )
 {
 rCont.bInUse = true;
-nRemain = aData.pAsSequence->getLength();
+nRemain = aData.pAsVector->size();
 }
 else if( aData.pAsInterface )
 {
@@ -84,7 +67,7 @@ OInterfaceIteratorHelper::~OInterfaceIteratorHelper()
 {
 MutexGuard aGuard( rCont.rMutex );
 // bResetInUse protect the iterator against recursion
-bShared = aData.pAsSequence == rCont.aData.pAsSequence && rCont.bIsList;
+bShared = aData.pAsVector == rCont.aData.pAsVector && rCont.bIsList;
 if( bShared )
 {
 OSL_ENSURE( rCont.bInUse, "OInterfaceContainerHelper must be in use" );
@@ -96,7 +79,7 @@ OInterfaceIteratorHelper::~OInterfaceIteratorHelper()
 {
 if( bIsList )
 // Sequence owned by the iterator
-delete aData.pAsSequence;
+delete aData.pAsVector;
 else if( aData.pAsInterface )
 // Interface is acquired by the iterator
 aData.pAsInterface->release();
@@ -110,7 +93,7 @@ XInterface * OInterfaceIteratorHelper::next()
 nRemain--;
 if( bIsList )
 // typecase to const,so the getArray method is faster
-return aData.pAsSequence->getConstArray()[nRemain].get();
+return (*aData.pAsVector)[nRemain].get();
 if( aData.pAsInterface )
 return aData.pAsInterface;
 }
@@ -123,8 +106,8 @@ void OInterfaceIteratorHelper::remove()
 if( bIsList )
 {
 OSL_ASSERT( nRemain >= 0 &&
-nRemain < aData.pAsSequence->getLength() );
-XInterface * p = aData.pAsSequence->getConstArray()[nRemain].get();
+nRemain < static_cast(aData.pAsVector->size()) 
);
+XInterface * p = (*aData.pAsVector)[nRemain].get();
 rCont.removeInterface( * reinterpret_cast< const Reference< XInterface 
> * >(  ) );
 }
 else
@@ -145,7 +128,7 @@ OInterfaceContainerHelper::~OInterfaceContainerHelper()
 {
 OSL_ENSURE( !bInUse, "~OInterfaceContainerHelper but is in use" );
 if( bIsList )
-delete aData.pAsSequence;
+delete aData.pAsVector;
 else if( aData.pAsInterface )
 aData.pAsInterface->release();
 }
@@ -154,7 +137,7 @@ sal_Int32 OInterfaceContainerHelper::getLength() const
 {
 MutexGuard aGuard( rMutex );
 if( bIsList )
-return aData.pAsSequence->getLength();
+return aData.pAsVector->size();
 if( aData.pAsInterface )
 return 1;
 return 0;
@@ -164,7 +147,7 @@ Sequence< Reference > 
OInterfaceContainerHelper::getElements() const
 {
 MutexGuard aGuard( rMutex );
 if( bIsList )
-return *aData.pAsSequence;
+return comphelper::containerToSequence(*aData.pAsVector);
 if( aData.pAsInterface )
 {
 Reference x( aData.pAsInterface );

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

2020-01-15 Thread Noel Grandin (via logerrit)
 cppuhelper/source/interfacecontainer.cxx |5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

New commits:
commit 2b8cf734e3f70d96419119e2a21293c617b2e167
Author: Noel Grandin 
AuthorDate: Wed Jan 15 10:03:37 2020 +0200
Commit: Noel Grandin 
CommitDate: Wed Jan 15 10:34:49 2020 +0100

improve "convert OSL_ASSERT to assert"

this fixes commit 3a0c4574449fc2313306c4e0e39bb7416cc20657, by
converting the assert in removeInterface() to SAL_WARN_IF, and similarly
for the related addInterface() method

Comment from sberg on the original commit:

This leaves OInterfaceContainerHelper::add-/removeInterface in somewhat
inconsistent state (as addInterface OSL_ASSERTs non-null but then also
explicitly checks for null, i.e., effectively supports null).

css.lang.XComponent::add-/removeEventListener do not explicitly specify
whether or not their arg may be null.  I /think/ we traditionally
supported null; asserting non-null thus might cause issues for 3rd-party
code.

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

diff --git a/cppuhelper/source/interfacecontainer.cxx 
b/cppuhelper/source/interfacecontainer.cxx
index eac0683329bb..a496b93fc372 100644
--- a/cppuhelper/source/interfacecontainer.cxx
+++ b/cppuhelper/source/interfacecontainer.cxx
@@ -23,6 +23,7 @@
 
 #include 
 #include 
+#include 
 
 #include 
 
@@ -190,7 +191,7 @@ void OInterfaceContainerHelper::copyAndResetInUse()
 
 sal_Int32 OInterfaceContainerHelper::addInterface( const Reference 
& rListener )
 {
-OSL_ASSERT( rListener.is() );
+SAL_WARN_IF( !rListener.is(), "cppuhelper", "rListener is empty" );
 MutexGuard aGuard( rMutex );
 if( bInUse )
 copyAndResetInUse();
@@ -221,7 +222,7 @@ sal_Int32 OInterfaceContainerHelper::addInterface( const 
Reference &
 
 sal_Int32 OInterfaceContainerHelper::removeInterface( const 
Reference & rListener )
 {
-assert( rListener.is() );
+SAL_WARN_IF( !rListener.is(), "cppuhelper", "rListener is empty" );
 MutexGuard aGuard( rMutex );
 if( bInUse )
 copyAndResetInUse();
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: cppuhelper/source unotools/source

2020-01-14 Thread Noel Grandin (via logerrit)
 cppuhelper/source/interfacecontainer.cxx  |2 +-
 unotools/source/misc/eventlisteneradapter.cxx |3 ++-
 2 files changed, 3 insertions(+), 2 deletions(-)

New commits:
commit 3a0c4574449fc2313306c4e0e39bb7416cc20657
Author: Noel Grandin 
AuthorDate: Wed Jan 15 08:42:05 2020 +0200
Commit: Noel Grandin 
CommitDate: Wed Jan 15 08:27:52 2020 +0100

convert OSL_ASSERT to assert

and fix the one place triggering it

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

diff --git a/cppuhelper/source/interfacecontainer.cxx 
b/cppuhelper/source/interfacecontainer.cxx
index 7b97c315343d..eac0683329bb 100644
--- a/cppuhelper/source/interfacecontainer.cxx
+++ b/cppuhelper/source/interfacecontainer.cxx
@@ -221,7 +221,7 @@ sal_Int32 OInterfaceContainerHelper::addInterface( const 
Reference &
 
 sal_Int32 OInterfaceContainerHelper::removeInterface( const 
Reference & rListener )
 {
-OSL_ASSERT( rListener.is() );
+assert( rListener.is() );
 MutexGuard aGuard( rMutex );
 if( bInUse )
 copyAndResetInUse();
diff --git a/unotools/source/misc/eventlisteneradapter.cxx 
b/unotools/source/misc/eventlisteneradapter.cxx
index c9f6b6f73ee9..d9736905de81 100644
--- a/unotools/source/misc/eventlisteneradapter.cxx
+++ b/unotools/source/misc/eventlisteneradapter.cxx
@@ -74,7 +74,8 @@ namespace utl
 {
 if (m_xComponent.is())
 {
-m_xComponent->removeEventListener(m_xKeepMeAlive);
+if (m_xKeepMeAlive.is())
+m_xComponent->removeEventListener(m_xKeepMeAlive);
 m_xComponent.clear();
 m_xKeepMeAlive.clear();
 }
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2020-01-14 Thread Stephan Bergmann (via logerrit)
 cppuhelper/source/shlib.cxx |   11 ---
 1 file changed, 4 insertions(+), 7 deletions(-)

New commits:
commit 35fbf454055a18c8431808b955b54f2cf3200bb0
Author: Stephan Bergmann 
AuthorDate: Tue Jan 14 15:27:56 2020 +0100
Commit: Stephan Bergmann 
CommitDate: Tue Jan 14 16:31:57 2020 +0100

Remove unused prefix="direct" feature

It got introduced with b6cebf4a3e2997e6489bba77b358b306f8f435ce "Allow UNO
component libraries to have each implementation in its own function", then
ae3a0c8da50b36db395984637f5ad74d3b4887bc "Add .component https://gerrit.libreoffice.org/c/core/+/86765
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann 

diff --git a/cppuhelper/source/shlib.cxx b/cppuhelper/source/shlib.cxx
index c5979e642393..89ce8b8554db 100644
--- a/cppuhelper/source/shlib.cxx
+++ b/cppuhelper/source/shlib.cxx
@@ -255,20 +255,19 @@ void cppuhelper::detail::loadSharedLibComponentFactory(
 if (curEnv.get() != env.get()) {
 std::abort();//TODO
 }
-OUString name(prefix == "direct" ? implementation : uri);
 SAL_INFO("cppuhelper.shlib", "prefix=" << prefix << " implementation=" 
<< implementation << " uri=" << uri);
 lib_to_factory_mapping const * map = lo_get_factory_map();
 component_getFactoryFunc fp = 0;
 for (int i = 0; map[i].name != 0; ++i) {
-if (name.equalsAscii(map[i].name)) {
+if (uri.equalsAscii(map[i].name)) {
 fp = map[i].component_getFactory_function;
 break;
 }
 }
 if (fp == 0) {
-SAL_WARN("cppuhelper", "unknown factory name \"" << name << "\"");
+SAL_WARN("cppuhelper", "unknown factory name \"" << uri << "\"");
 throw css::loader::CannotActivateFactoryException(
-"unknown factory name \"" + name + "\"",
+"unknown factory name \"" + uri + "\"",
 css::uno::Reference());
 }
 *factory = invokeComponentFactory(
@@ -301,9 +300,7 @@ void cppuhelper::detail::loadSharedLibComponentFactory(
 if (constructor.isEmpty()) {
 OUString sym;
 SAL_INFO("cppuhelper.shlib", "prefix=" << prefix << " implementation=" 
<< implementation << " uri=" << uri);
-if (prefix == "direct") {
-sym = implementation.replace('.', '_') + "_" COMPONENT_GETFACTORY;
-} else if (!prefix.isEmpty()) {
+if (!prefix.isEmpty()) {
 sym = prefix + "_" COMPONENT_GETFACTORY;
 } else {
 sym = COMPONENT_GETFACTORY;
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2019-12-30 Thread Stephan Bergmann (via logerrit)
 cppuhelper/source/servicemanager.cxx |  144 +--
 cppuhelper/source/servicemanager.hxx |   69 +---
 2 files changed, 95 insertions(+), 118 deletions(-)

New commits:
commit c97965e1b5b890a2a48d87d7a060396be71f2a00
Author: Stephan Bergmann 
AuthorDate: Mon Dec 30 16:36:57 2019 +0100
Commit: Stephan Bergmann 
CommitDate: Mon Dec 30 19:42:49 2019 +0100

Merge ImplementationInfo back into Implementation

...and rename constructor members to constructorName/constructorFn for
disambiguation.

"Splitting ImplementationInfo out of Implementation has become necessary to
avoid circular references" in c16d0dd846e25df56feffe868a15eb33bb55e42a
"fdo#49291 Postpone actual factory instantiation as long as possible", but 
was
no longer necessary since 997d21183322a0a94b96868073808841d2773902 "Support 
for
singleton constructor functions" (which also removed the need to hold
ImplemenationInfo by shared_ptr, which has already been cleaned up with
fc11bce4917aae7e8324f2c721ce50a88d231b0c "ImplementationInfo can be 
inlined").

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

diff --git a/cppuhelper/source/servicemanager.cxx 
b/cppuhelper/source/servicemanager.cxx
index c9a21ba1a557..9f4f541b1388 100644
--- a/cppuhelper/source/servicemanager.cxx
+++ b/cppuhelper/source/servicemanager.cxx
@@ -391,13 +391,13 @@ void Parser::handleImplementation() {
 
 void Parser::handleService() {
 OUString name(getNameAttribute());
-implementation_->info.services.push_back(name);
+implementation_->services.push_back(name);
 data_->services[name].push_back(implementation_);
 }
 
 void Parser::handleSingleton() {
 OUString name(getNameAttribute());
-implementation_->info.singletons.push_back(name);
+implementation_->singletons.push_back(name);
 data_->singletons[name].push_back(implementation_);
 }
 
@@ -614,7 +614,7 @@ OUString ImplementationWrapper::getImplementationName()
 {
 std::shared_ptr< cppuhelper::ServiceManager::Data::Implementation > impl = 
implementation_.lock();
 assert(impl);
-return impl->info.name;
+return impl->name;
 }
 
 sal_Bool ImplementationWrapper::supportsService(OUString const & ServiceName)
@@ -627,15 +627,15 @@ ImplementationWrapper::getSupportedServiceNames()
 {
 std::shared_ptr< cppuhelper::ServiceManager::Data::Implementation > impl = 
implementation_.lock();
 assert(impl);
-if (impl->info.services.size()
+if (impl->services.size()
 > static_cast< sal_uInt32 >(SAL_MAX_INT32))
 {
 throw css::uno::RuntimeException(
-("Implementation " + impl->info.name
+("Implementation " + impl->name
  + " supports too many services"),
 static_cast< cppu::OWeakObject * >(this));
 }
-return comphelper::containerToSequence(impl->info.services);
+return comphelper::containerToSequence(impl->services);
 }
 
 }
@@ -646,9 +646,9 @@ 
cppuhelper::ServiceManager::Data::Implementation::createInstance(
 bool singletonRequest)
 {
 css::uno::Reference inst;
-if (constructor) {
+if (constructorFn) {
 inst.set(
-constructor(context.get(), css::uno::Sequence()),
+constructorFn(context.get(), css::uno::Sequence()),
 SAL_NO_ACQUIRE);
 } else if (factory1.is()) {
 inst = factory1->createInstanceWithContext(context);
@@ -666,8 +666,8 @@ 
cppuhelper::ServiceManager::Data::Implementation::createInstanceWithArguments(
 bool singletonRequest, css::uno::Sequence const & arguments)
 {
 css::uno::Reference inst;
-if (constructor) {
-inst.set(constructor(context.get(), arguments), SAL_NO_ACQUIRE);
+if (constructorFn) {
+inst.set(constructorFn(context.get(), arguments), SAL_NO_ACQUIRE);
 //HACK: The constructor will either observe arguments and return inst
 // that does not implement XInitialization (or null), or ignore
 // arguments and return inst that implements XInitialization; this
@@ -703,7 +703,7 @@ void 
cppuhelper::ServiceManager::Data::Implementation::updateDisposeSingleton(
 osl::MutexGuard g(mutex);
 disposeSingleton.clear();
 dispose = false;
-} else if (!info.singletons.empty()) {
+} else if (!singletons.empty()) {
 css::uno::Reference comp(
 instance, css::uno::UNO_QUERY);
 if (comp.is()) {
@@ -725,7 +725,7 @@ void cppuhelper::ServiceManager::addSingletonContextEntries(
 assert(rImpls[0].get() != nullptr);
 SAL_INFO_IF(
 rImpls.size() > 1, "cppuhelper",
-"Arbitrarily choosing " << rImpls[0]->info.name
+"Arbitrarily choosing " << rImpls[0]->name
 << " among multiple implementations for " << rName);
 

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

2019-12-24 Thread Noel Grandin (via logerrit)
 cppuhelper/source/servicemanager.cxx |  130 +--
 cppuhelper/source/servicemanager.hxx |   26 ++-
 2 files changed, 76 insertions(+), 80 deletions(-)

New commits:
commit fc11bce4917aae7e8324f2c721ce50a88d231b0c
Author: Noel Grandin 
AuthorDate: Tue Dec 24 08:51:19 2019 +0200
Commit: Noel Grandin 
CommitDate: Tue Dec 24 11:38:51 2019 +0100

ImplementationInfo can be inlined

no need to hold by shared_ptr, it is never shared

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

diff --git a/cppuhelper/source/servicemanager.cxx 
b/cppuhelper/source/servicemanager.cxx
index b4c2503db1a1..c9a21ba1a557 100644
--- a/cppuhelper/source/servicemanager.cxx
+++ b/cppuhelper/source/servicemanager.cxx
@@ -391,13 +391,13 @@ void Parser::handleImplementation() {
 
 void Parser::handleService() {
 OUString name(getNameAttribute());
-implementation_->info->services.push_back(name);
+implementation_->info.services.push_back(name);
 data_->services[name].push_back(implementation_);
 }
 
 void Parser::handleSingleton() {
 OUString name(getNameAttribute());
-implementation_->info->singletons.push_back(name);
+implementation_->info.singletons.push_back(name);
 data_->singletons[name].push_back(implementation_);
 }
 
@@ -614,7 +614,7 @@ OUString ImplementationWrapper::getImplementationName()
 {
 std::shared_ptr< cppuhelper::ServiceManager::Data::Implementation > impl = 
implementation_.lock();
 assert(impl);
-return impl->info->name;
+return impl->info.name;
 }
 
 sal_Bool ImplementationWrapper::supportsService(OUString const & ServiceName)
@@ -627,15 +627,15 @@ ImplementationWrapper::getSupportedServiceNames()
 {
 std::shared_ptr< cppuhelper::ServiceManager::Data::Implementation > impl = 
implementation_.lock();
 assert(impl);
-if (impl->info->services.size()
+if (impl->info.services.size()
 > static_cast< sal_uInt32 >(SAL_MAX_INT32))
 {
 throw css::uno::RuntimeException(
-("Implementation " + impl->info->name
+("Implementation " + impl->info.name
  + " supports too many services"),
 static_cast< cppu::OWeakObject * >(this));
 }
-return comphelper::containerToSequence(impl->info->services);
+return comphelper::containerToSequence(impl->info.services);
 }
 
 }
@@ -703,7 +703,7 @@ void 
cppuhelper::ServiceManager::Data::Implementation::updateDisposeSingleton(
 osl::MutexGuard g(mutex);
 disposeSingleton.clear();
 dispose = false;
-} else if (!info->singletons.empty()) {
+} else if (!info.singletons.empty()) {
 css::uno::Reference comp(
 instance, css::uno::UNO_QUERY);
 if (comp.is()) {
@@ -725,7 +725,7 @@ void cppuhelper::ServiceManager::addSingletonContextEntries(
 assert(rImpls[0].get() != nullptr);
 SAL_INFO_IF(
 rImpls.size() > 1, "cppuhelper",
-"Arbitrarily choosing " << rImpls[0]->info->name
+"Arbitrarily choosing " << rImpls[0]->info.name
 << " among multiple implementations for " << rName);
 entries->push_back(
 cppu::ContextEntry_Init(
@@ -750,45 +750,45 @@ void cppuhelper::ServiceManager::loadImplementation(
 }
 OUString uri;
 try {
-uri = cppu::bootstrap_expandUri(implementation->info->uri);
+uri = cppu::bootstrap_expandUri(implementation->info.uri);
 } catch (css::lang::IllegalArgumentException & e) {
 throw css::uno::DeploymentException(
-"Cannot expand URI" + implementation->info->uri + ": " + e.Message,
+"Cannot expand URI" + implementation->info.uri + ": " + e.Message,
 static_cast< cppu::OWeakObject * >(this));
 }
 cppuhelper::WrapperConstructorFn ctor;
 css::uno::Reference< css::uno::XInterface > f0;
 // Special handling of SharedLibrary loader, with support for environment,
 // constructor, and prefix arguments:
-if (!implementation->info->alienContext.is()
-&& implementation->info->loader == "com.sun.star.loader.SharedLibrary")
+if (!implementation->info.alienContext.is()
+&& implementation->info.loader == "com.sun.star.loader.SharedLibrary")
 {
 cppuhelper::detail::loadSharedLibComponentFactory(
-uri, implementation->info->environment,
-implementation->info->prefix, implementation->info->name,
-implementation->info->constructor, this, , );
+uri, implementation->info.environment,
+implementation->info.prefix, implementation->info.name,
+implementation->info.constructor, this, , );
 if (ctor) {
-assert(!implementation->info->environment.isEmpty());
+assert(!implementation->info.environment.isEmpty());
 }
 } 

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

2019-12-05 Thread Andrea Gelmini (via logerrit)
 cppuhelper/source/exc_thrower.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 7eb5b4a0debaff971af3a5dc367849e211e35994
Author: Andrea Gelmini 
AuthorDate: Thu Dec 5 14:39:30 2019 +0100
Commit: Julien Nabet 
CommitDate: Thu Dec 5 18:52:38 2019 +0100

Fix typo

Change-Id: I3c8a0d5fb2b17ccef3c931f13230f99b1945a4bc
Reviewed-on: https://gerrit.libreoffice.org/84566
Tested-by: Jenkins
Reviewed-by: Julien Nabet 

diff --git a/cppuhelper/source/exc_thrower.cxx 
b/cppuhelper/source/exc_thrower.cxx
index a0e7fb32b046..253e484e1236 100644
--- a/cppuhelper/source/exc_thrower.cxx
+++ b/cppuhelper/source/exc_thrower.cxx
@@ -190,7 +190,7 @@ class theExceptionThrower : public 
rtl::Static void tryThrow(css::uno::Any const& aException)
 {
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

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

2019-11-20 Thread Michael Meeks (via logerrit)
 cppuhelper/source/servicemanager.cxx |   14 +++---
 1 file changed, 11 insertions(+), 3 deletions(-)

New commits:
commit d4381cdad5c838219720019d771f7174992c1779
Author: Michael Meeks 
AuthorDate: Wed Nov 20 16:38:14 2019 +
Commit: Aron Budea 
CommitDate: Thu Nov 21 02:48:02 2019 +0100

preload: cleanup failed module load warnings and rename them.

Change-Id: Iafa89df6f724fa6b64712d970502091e38300dad
Reviewed-on: https://gerrit.libreoffice.org/83341
Tested-by: Jenkins
Reviewed-by: Aron Budea 

diff --git a/cppuhelper/source/servicemanager.cxx 
b/cppuhelper/source/servicemanager.cxx
index 8f49b4ecb908..b4c2503db1a1 100644
--- a/cppuhelper/source/servicemanager.cxx
+++ b/cppuhelper/source/servicemanager.cxx
@@ -1788,6 +1788,7 @@ void cppuhelper::ServiceManager::preloadImplementations() 
{
 std::vector aReported;
 std::vector aDisabled;
 OUStringBuffer aDisabledMsg;
+OUStringBuffer aMissingMsg;
 
 /// Allow external callers & testers to disable certain components
 const char *pDisable = getenv("UNODISABLELIBRARY");
@@ -1810,6 +1811,7 @@ void cppuhelper::ServiceManager::preloadImplementations() 
{
 rEntry.second->status == Data::Implementation::STATUS_LOADED)
 continue;
 
+OUString simplified;
 try
 {
 const OUString  = rEntry.second->info->uri;
@@ -1817,7 +1819,8 @@ void cppuhelper::ServiceManager::preloadImplementations() 
{
 if (aLibrary.isEmpty())
 continue;
 
-OUString simplified = simplifyModule(aLibrary);
+simplified = simplifyModule(aLibrary);
+
 bool bDisabled =
 std::find(aDisabled.begin(), aDisabled.end(), simplified) != 
aDisabled.end();
 
@@ -1854,8 +1857,8 @@ void cppuhelper::ServiceManager::preloadImplementations() 
{
 
 if (!aModule.is())
 {
-std::cerr << ":failed" << std::endl;
-std::cerr.flush();
+aMissingMsg.append(simplified);
+aMissingMsg.append(" ");
 }
 
 if (aModule.is() &&
@@ -1948,6 +1951,11 @@ void 
cppuhelper::ServiceManager::preloadImplementations() {
 }
 std::cerr << std::endl;
 
+if (aMissingMsg.getLength() > 0)
+{
+OUString aMsg = aMissingMsg.makeStringAndClear();
+std::cerr << "Absent (often optional): " << aMsg << "\n";
+}
 if (aDisabledMsg.getLength() > 0)
 {
 OUString aMsg = aDisabledMsg.makeStringAndClear();
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

[Libreoffice-commits] core.git: cppuhelper/source cui/source dbaccess/source desktop/qa desktop/source

2019-08-19 Thread Noel Grandin (via logerrit)
 cppuhelper/source/propertysetmixin.cxx  |4 ++--
 cui/source/dialogs/FontFeaturesDialog.cxx   |2 +-
 cui/source/dialogs/cuigaldlg.cxx|4 ++--
 cui/source/dialogs/iconcdlg.cxx |2 +-
 cui/source/dialogs/thesdlg.cxx  |2 +-
 cui/source/options/optupdt.cxx  |4 ++--
 cui/source/tabpages/autocdlg.cxx|4 ++--
 cui/source/tabpages/numpages.cxx|2 +-
 dbaccess/source/filter/hsqldb/createparser.cxx  |6 +++---
 dbaccess/source/filter/hsqldb/hsqlimport.cxx|2 +-
 desktop/qa/desktop_lib/test_desktop_lib.cxx |   12 ++--
 desktop/source/app/dispatchwatcher.cxx  |2 +-
 desktop/source/deployment/manager/dp_manager.cxx|2 +-
 desktop/source/deployment/registry/dp_backend.cxx   |2 +-
 desktop/source/lib/init.cxx |   10 +-
 desktop/source/migration/services/oo3extensionmigration.cxx |4 ++--
 desktop/source/pkgchk/unopkg/unopkg_app.cxx |6 +++---
 17 files changed, 35 insertions(+), 35 deletions(-)

New commits:
commit 8efd46ed867b66f9fbc31dbaa1d46bc91ea29ae2
Author: Noel Grandin 
AuthorDate: Mon Aug 19 15:11:27 2019 +0200
Commit: Noel Grandin 
CommitDate: Mon Aug 19 19:28:11 2019 +0200

loplugin:constvars in cppuhelper..desktop

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

diff --git a/cppuhelper/source/propertysetmixin.cxx 
b/cppuhelper/source/propertysetmixin.cxx
index 7201d49def1a..a37185e76686 100644
--- a/cppuhelper/source/propertysetmixin.cxx
+++ b/cppuhelper/source/propertysetmixin.cxx
@@ -928,14 +928,14 @@ void PropertySetMixinImpl::dispose() {
 }
 css::lang::EventObject event(
 static_cast< css::beans::XPropertySet * >(this));
-for (auto& rEntry : boundListeners)
+for (const auto& rEntry : boundListeners)
 {
 for (auto& rxBoundListener : rEntry.second)
 {
 rxBoundListener->disposing(event);
 }
 }
-for (auto& rEntry : vetoListeners)
+for (const auto& rEntry : vetoListeners)
 {
 for (auto& rxVetoListener : rEntry.second)
 {
diff --git a/cui/source/dialogs/FontFeaturesDialog.cxx 
b/cui/source/dialogs/FontFeaturesDialog.cxx
index 21f962ee4b07..957a2c8e1228 100644
--- a/cui/source/dialogs/FontFeaturesDialog.cxx
+++ b/cui/source/dialogs/FontFeaturesDialog.cxx
@@ -172,7 +172,7 @@ OUString FontFeaturesDialog::createFontNameWithFeatures()
 OUStringBuffer sNameSuffix;
 bool bFirst = true;
 
-for (FontFeatureItem& rItem : m_aFeatureItems)
+for (const FontFeatureItem& rItem : m_aFeatureItems)
 {
 if (rItem.m_xCheck->get_visible())
 {
diff --git a/cui/source/dialogs/cuigaldlg.cxx b/cui/source/dialogs/cuigaldlg.cxx
index 4b220800d33c..a90ef52b916a 100644
--- a/cui/source/dialogs/cuigaldlg.cxx
+++ b/cui/source/dialogs/cuigaldlg.cxx
@@ -720,7 +720,7 @@ void TPGalleryThemeProperties::FillFilterList()
 ::avmedia::FilterNameVector aFilters;
 ::avmedia::MediaWindow::getMediaFilters( aFilters );
 
-for(std::pair & aFilter : aFilters)
+for(const std::pair & aFilter : aFilters)
 {
 for( sal_Int32 nIndex = 0; nIndex >= 0; )
 {
@@ -760,7 +760,7 @@ void TPGalleryThemeProperties::FillFilterList()
 
 #if HAVE_FEATURE_AVMEDIA
 // media filters
-for(std::pair & aFilter : aFilters)
+for(const std::pair & aFilter : aFilters)
 {
 for( sal_Int32 nIndex = 0; nIndex >= 0; )
 {
diff --git a/cui/source/dialogs/iconcdlg.cxx b/cui/source/dialogs/iconcdlg.cxx
index 06c4a37a5397..39864c3a3d3b 100644
--- a/cui/source/dialogs/iconcdlg.cxx
+++ b/cui/source/dialogs/iconcdlg.cxx
@@ -292,7 +292,7 @@ void SvxHpLinkDlg::Start_Impl()
 IconChoicePageData* SvxHpLinkDlg::GetPageData ( const OString& rId )
 {
 IconChoicePageData *pRet = nullptr;
-for (auto & pData : maPageList)
+for (const auto & pData : maPageList)
 {
 if ( pData->sId == rId )
 {
diff --git a/cui/source/dialogs/thesdlg.cxx b/cui/source/dialogs/thesdlg.cxx
index 2a5f73c43175..1ed20384016c 100644
--- a/cui/source/dialogs/thesdlg.cxx
+++ b/cui/source/dialogs/thesdlg.cxx
@@ -294,7 +294,7 @@ SvxThesaurusDialog::SvxThesaurusDialog(
 }
 std::sort( aLangVec.begin(), aLangVec.end() );
 m_xLangLB->freeze();
-for (OUString & i : aLangVec)
+for (const OUString & i : aLangVec)
 m_xLangLB->append_text(i);
 m_xLangLB->thaw();
 
diff --git a/cui/source/options/optupdt.cxx b/cui/source/options/optupdt.cxx
index 6f308bd6455d..4621ac787d95 100644
--- a/cui/source/options/optupdt.cxx
+++ b/cui/source/options/optupdt.cxx
@@ 

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

2019-08-12 Thread Mike Kaganski (via logerrit)
 cppuhelper/source/supportsservice.cxx |   10 +++---
 1 file changed, 3 insertions(+), 7 deletions(-)

New commits:
commit 0d7efa70ededec293590e02bace2b2864ca0d892
Author: Mike Kaganski 
AuthorDate: Mon Aug 12 13:14:46 2019 +0200
Commit: Mike Kaganski 
CommitDate: Mon Aug 12 16:29:53 2019 +0200

Optimize cppu::supportsService to use const methods of Sequence

... and standard algorithm instead of loop.

Change-Id: Ic90fa7e227807768f094b9fc231f3ba3d48e6139
Reviewed-on: https://gerrit.libreoffice.org/77350
Tested-by: Jenkins
Reviewed-by: Mike Kaganski 

diff --git a/cppuhelper/source/supportsservice.cxx 
b/cppuhelper/source/supportsservice.cxx
index 629981310354..eea82602a2ef 100644
--- a/cppuhelper/source/supportsservice.cxx
+++ b/cppuhelper/source/supportsservice.cxx
@@ -9,6 +9,7 @@
 
 #include 
 
+#include 
 #include 
 
 #include 
@@ -21,14 +22,9 @@ bool cppu::supportsService(
 css::lang::XServiceInfo * implementation, OUString const & name)
 {
 assert(implementation != nullptr);
-css::uno::Sequence< OUString > s(
+const css::uno::Sequence< OUString > s(
 implementation->getSupportedServiceNames());
-for (sal_Int32 i = 0; i != s.getLength(); ++i) {
-if (s[i] == name) {
-return true;
-}
-}
-return false;
+return std::find(s.begin(), s.end(), name) != s.end();
 }
 
 /* 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: cppuhelper/source

2019-07-17 Thread Julien Nabet (via logerrit)
 cppuhelper/source/propshlp.cxx |5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

New commits:
commit 3148b506a5a8d333deac35ab59016c3ce420d26c
Author: Julien Nabet 
AuthorDate: Sun Jun 16 21:46:29 2019 +0200
Commit: Noel Grandin 
CommitDate: Thu Jul 18 07:12:47 2019 +0200

Resort pProperties when really needed (cppuhelper)

so not when pProperties[i-1].Name == pProperties[i].Name
and call getConstArray() only if there have been a sort

Found when testing tdf#125941 when editing table:
$8 = uno::Sequence of length 29 = {
{Name = "AutoIncrementCreation", Handle = 49, Type = uno::Type "string", 
Attributes = 0},
{Name = "CatalogName", Handle = 30, Type = uno::Type "string", Attributes = 
0},
{Name = "CatalogName", Handle = 30, Type = uno::Type "string", Attributes = 
0},
{Name = "DefaultValue", Handle = 20, Type = uno::Type "string", Attributes 
= 0},
{Name = "DefaultValue", Handle = 20, Type = uno::Type "string", Attributes 
= 0},
{Name = "Description", Handle = 19, Type = uno::Type "string", Attributes = 
0},
{Name = "Description", Handle = 19, Type = uno::Type "string", Attributes = 
0},
...

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

diff --git a/cppuhelper/source/propshlp.cxx b/cppuhelper/source/propshlp.cxx
index d5f0da890bb7..51f336999050 100644
--- a/cppuhelper/source/propshlp.cxx
+++ b/cppuhelper/source/propshlp.cxx
@@ -977,7 +977,7 @@ void OPropertyArrayHelper::init( sal_Bool bSorted )
 
 for( i = 1; i < nElements; i++ )
 {
-if(  pProperties[i-1].Name >= pProperties[i].Name )
+if(  pProperties[i-1].Name > pProperties[i].Name )
 {
 if (bSorted) {
 OSL_FAIL( "Property array is not sorted" );
@@ -985,11 +985,10 @@ void OPropertyArrayHelper::init( sal_Bool bSorted )
 // not sorted
 qsort( aInfos.getArray(), nElements, sizeof( Property ),
 compare_Property_Impl );
+pProperties = aInfos.getConstArray();
 break;
 }
 }
-// may be that the array is resorted
-pProperties = aInfos.getConstArray();
 for( i = 0; i < nElements; i++ )
 if( pProperties[i].Handle != i )
 return;
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

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

2019-04-19 Thread Andrea Gelmini (via logerrit)
 cppuhelper/source/interfacecontainer.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit bf298e9ef3b22938d1391afb7b96bfea4c84d5fc
Author: Andrea Gelmini 
AuthorDate: Wed Apr 10 16:04:53 2019 +
Commit: Julien Nabet 
CommitDate: Sat Apr 20 07:54:46 2019 +0200

Fix typo

Change-Id: I08d6e2cb30c54b9e7b11498850e5f5cd7de1a98d
Reviewed-on: https://gerrit.libreoffice.org/70994
Tested-by: Jenkins
Reviewed-by: Julien Nabet 

diff --git a/cppuhelper/source/interfacecontainer.cxx 
b/cppuhelper/source/interfacecontainer.cxx
index 7f49682e410b..7b97c315343d 100644
--- a/cppuhelper/source/interfacecontainer.cxx
+++ b/cppuhelper/source/interfacecontainer.cxx
@@ -177,7 +177,7 @@ void OInterfaceContainerHelper::copyAndResetInUse()
 OSL_ENSURE( bInUse, "OInterfaceContainerHelper not in use" );
 if( bInUse )
 {
-// this should be the worst case. If a iterator is active
+// this should be the worst case. If an iterator is active
 // and a new Listener is added.
 if( bIsList )
 aData.pAsSequence = new Sequence< Reference< XInterface > >( 
*aData.pAsSequence );
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

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

2019-03-29 Thread Michael Meeks (via logerrit)
 cppuhelper/source/servicemanager.cxx |  176 +--
 1 file changed, 86 insertions(+), 90 deletions(-)

New commits:
commit 799aef2bf37ba4e23d3a837be49e354624b7083d
Author: Michael Meeks 
AuthorDate: Fri Mar 29 09:51:39 2019 +
Commit: Michael Meeks 
CommitDate: Fri Mar 29 13:01:40 2019 +0100

preload: cleanup disabled messages and simplify flow.

Change-Id: I249b81afe5ec2fab5e0aaf73a2cde62173fa803e
Reviewed-on: https://gerrit.libreoffice.org/69912
Tested-by: Jenkins
Reviewed-by: Michael Meeks 

diff --git a/cppuhelper/source/servicemanager.cxx 
b/cppuhelper/source/servicemanager.cxx
index 93a060e21fa4..2118bcb00c88 100644
--- a/cppuhelper/source/servicemanager.cxx
+++ b/cppuhelper/source/servicemanager.cxx
@@ -1790,7 +1790,7 @@ void cppuhelper::ServiceManager::preloadImplementations() 
{
 std::cerr << "preload:";
 std::vector aReported;
 std::vector aDisabled;
-OUStringBuffer aDisabledMsg("Disabled: ");
+OUStringBuffer aDisabledMsg;
 
 /// Allow external callers & testers to disable certain components
 const char *pDisable = getenv("UNODISABLELIBRARY");
@@ -1809,6 +1809,10 @@ void 
cppuhelper::ServiceManager::preloadImplementations() {
 // loop all implementations
 for (const auto& rEntry : data_.namedImplementations)
 {
+if (rEntry.second->info->loader != "com.sun.star.loader.SharedLibrary" 
||
+rEntry.second->status == Data::Implementation::STATUS_LOADED)
+continue;
+
 try
 {
 const OUString  = rEntry.second->info->uri;
@@ -1848,118 +1852,110 @@ void 
cppuhelper::ServiceManager::preloadImplementations() {
 static_cast< cppu::OWeakObject * >(this));
 }
 
-if (rEntry.second->info->loader == "com.sun.star.loader.SharedLibrary" 
&&
-rEntry.second->status != Data::Implementation::STATUS_LOADED)
+// load component library
+osl::Module aModule(aUri, SAL_LOADMODULE_NOW | SAL_LOADMODULE_GLOBAL);
+
+if (!aModule.is())
 {
-// load component library
-osl::Module aModule(aUri, SAL_LOADMODULE_NOW | 
SAL_LOADMODULE_GLOBAL);
+std::cerr << ":failed" << std::endl;
+std::cerr.flush();
+}
 
-if (!aModule.is())
-{
-std::cerr << ":failed" << std::endl;
-std::cerr.flush();
-}
+if (aModule.is() &&
+!rEntry.second->info->environment.isEmpty())
+{
+OUString aSymFactory;
+oslGenericFunction fpFactory;
+css::uno::Environment aTargetEnv;
+css::uno::Reference xFactory;
 
-if (aModule.is() &&
-!rEntry.second->info->environment.isEmpty())
+if(rEntry.second->info->constructor.isEmpty())
 {
-OUString aSymFactory;
-oslGenericFunction fpFactory;
-css::uno::Environment aTargetEnv;
-css::uno::Reference xFactory;
+// expand full name component factory symbol
+if (rEntry.second->info->prefix == "direct")
+aSymFactory = rEntry.second->info->name.replace('.', '_') 
+ "_" COMPONENT_GETFACTORY;
+else if (!rEntry.second->info->prefix.isEmpty())
+aSymFactory = rEntry.second->info->prefix + "_" 
COMPONENT_GETFACTORY;
+else
+aSymFactory = COMPONENT_GETFACTORY;
 
-if(rEntry.second->info->constructor.isEmpty())
+// get function symbol component factory
+fpFactory = aModule.getFunctionSymbol(aSymFactory);
+if (fpFactory == nullptr)
 {
-// expand full name component factory symbol
-if (rEntry.second->info->prefix == "direct")
-aSymFactory = rEntry.second->info->name.replace('.', 
'_') + "_" COMPONENT_GETFACTORY;
-else if (!rEntry.second->info->prefix.isEmpty())
-aSymFactory = rEntry.second->info->prefix + "_" 
COMPONENT_GETFACTORY;
-else
-aSymFactory = COMPONENT_GETFACTORY;
-
-// get function symbol component factory
-fpFactory = aModule.getFunctionSymbol(aSymFactory);
-if (fpFactory == nullptr)
-{
-throw css::loader::CannotActivateFactoryException(
-("no factory symbol \"" + aSymFactory + "\" in 
component library :" + aUri),
-css::uno::Reference());
-}
-
-aTargetEnv = 
cppuhelper::detail::getEnvironment(rEntry.second->info->environment, 
rEntry.second->info->name);
-component_getFactoryFunc fpComponentFactory = 
reinterpret_cast(fpFactory);

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

2019-03-25 Thread Michael Meeks (via logerrit)
 cppuhelper/source/servicemanager.cxx |   38 +--
 1 file changed, 36 insertions(+), 2 deletions(-)

New commits:
commit 9bc50c7efd4f4e8a5c8840bd5cd9a5a9ee31f1a8
Author: Michael Meeks 
AuthorDate: Fri Mar 22 18:48:41 2019 +0100
Commit: Michael Meeks 
CommitDate: Mon Mar 25 21:32:28 2019 +0100

preload: add the ability to disable various components.

Helps filter stupid stuff that makes no sense for online - eg.
reportbuilder or jdbc.

Change-Id: I40e06954c45fdefd21528202f4587ae83eb994c2
Reviewed-on: https://gerrit.libreoffice.org/69567
Tested-by: Jenkins
Reviewed-by: Michael Meeks 

diff --git a/cppuhelper/source/servicemanager.cxx 
b/cppuhelper/source/servicemanager.cxx
index 765204301e1f..93a060e21fa4 100644
--- a/cppuhelper/source/servicemanager.cxx
+++ b/cppuhelper/source/servicemanager.cxx
@@ -1789,6 +1789,22 @@ void 
cppuhelper::ServiceManager::preloadImplementations() {
 
 std::cerr << "preload:";
 std::vector aReported;
+std::vector aDisabled;
+OUStringBuffer aDisabledMsg("Disabled: ");
+
+/// Allow external callers & testers to disable certain components
+const char *pDisable = getenv("UNODISABLELIBRARY");
+if (pDisable)
+{
+OUString aDisable(pDisable, strlen(pDisable), RTL_TEXTENCODING_UTF8);
+for (sal_Int32 i = 0; i >= 0; )
+{
+OUString tok = aDisable.getToken(0, ' ', i);
+tok = tok.trim();
+if (!tok.isEmpty())
+aDisabled.push_back(tok);
+}
+}
 
 // loop all implementations
 for (const auto& rEntry : data_.namedImplementations)
@@ -1800,13 +1816,28 @@ void 
cppuhelper::ServiceManager::preloadImplementations() {
 if (aLibrary.isEmpty())
 continue;
 
+OUString simplified = simplifyModule(aLibrary);
+bool bDisabled =
+std::find(aDisabled.begin(), aDisabled.end(), simplified) != 
aDisabled.end();
+
 if (std::find(aReported.begin(), aReported.end(), aLibrary) == 
aReported.end())
 {
-std::cerr << " " << simplifyModule(aLibrary);
-std::cerr.flush();
+if (bDisabled)
+{
+aDisabledMsg.append(simplified);
+aDisabledMsg.append(" ");
+}
+else
+{
+std::cerr << " " << simplified;
+std::cerr.flush();
+}
 aReported.push_back(aLibrary);
 }
 
+if (bDisabled)
+continue;
+
 // expand absolute URI implementation component library
 aUri = cppu::bootstrap_expandUri(aLibrary);
 }
@@ -1928,6 +1959,9 @@ void cppuhelper::ServiceManager::preloadImplementations() 
{
 }
 std::cerr << std::endl;
 
+std::cerr << aDisabledMsg.makeStringAndClear() << "\n";
+std::cerr.flush();
+
 // Various rather important uno mappings.
 static struct {
 const char *mpFrom;
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

[Libreoffice-commits] core.git: cppuhelper/source cppu/source cui/source

2019-02-08 Thread Libreoffice Gerrit user
 cppu/source/LogBridge/LogBridge.cxx |   10 ++--
 cppu/source/helper/purpenv/helper_purpenv_Proxy.cxx |2 
 cppu/source/uno/cascade_mapping.cxx |4 -
 cppuhelper/source/implementationentry.cxx   |2 
 cppuhelper/source/interfacecontainer.cxx|6 +-
 cppuhelper/source/propshlp.cxx  |   28 ++--
 cppuhelper/source/servicemanager.cxx|3 -
 cui/source/customize/SvxToolbarConfigPage.cxx   |2 
 cui/source/customize/cfg.cxx|   14 +++---
 cui/source/dialogs/SpellDialog.cxx  |2 
 cui/source/dialogs/colorpicker.cxx  |   14 +++---
 cui/source/dialogs/hldocntp.cxx |2 
 cui/source/dialogs/hldoctp.cxx  |2 
 cui/source/dialogs/insdlg.cxx   |4 -
 cui/source/dialogs/scriptdlg.cxx|   46 ++--
 cui/source/options/connpoolconfig.cxx   |4 -
 cui/source/options/optaboutconfig.cxx   |2 
 cui/source/options/optgenrl.cxx |   10 ++--
 cui/source/options/optopencl.cxx|2 
 cui/source/tabpages/autocdlg.cxx|2 
 cui/source/tabpages/chardlg.cxx |2 
 cui/source/tabpages/numpages.cxx|2 
 cui/source/tabpages/swpossizetabpage.cxx|2 
 cui/source/tabpages/tpline.cxx  |6 +-
 24 files changed, 87 insertions(+), 86 deletions(-)

New commits:
commit a58f6d2744fde88f2034987208124e5b2505c641
Author: Noel Grandin 
AuthorDate: Fri Feb 8 13:13:42 2019 +0200
Commit: Noel Grandin 
CommitDate: Fri Feb 8 13:16:15 2019 +0100

loplugin:indentation in cppu..cui

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

diff --git a/cppu/source/LogBridge/LogBridge.cxx 
b/cppu/source/LogBridge/LogBridge.cxx
index 4c83de9f0aa6..a39fbad6f0ff 100644
--- a/cppu/source/LogBridge/LogBridge.cxx
+++ b/cppu/source/LogBridge/LogBridge.cxx
@@ -205,7 +205,7 @@ static void LogProbe(
 SAL_INFO("cppu.log", "{ LogBridge () " << sTemp );
 if ( nParams )
 {
-   SAL_INFO("cppu.log", "\n| : ( LogBridge ");
+SAL_INFO("cppu.log", "\n| : ( LogBridge ");
 for(sal_Int32 i = 0;i < nParams;++i)
 {
 if ( i > 0 )
@@ -213,9 +213,9 @@ static void LogProbe(
 traceValue(pParams[i].pTypeRef,pArgs[i]);
 
 }
-   SAL_INFO("cppu.log", ")");
+SAL_INFO("cppu.log", ")");
 } // if ( nParams )
-   SAL_INFO("cppu.log", "\n");
+SAL_INFO("cppu.log", "\n");
 }
 else if ( !pre )
 {
@@ -230,11 +230,11 @@ static void LogProbe(
 }
 else if ( pReturnTypeRef )
 {
-   SAL_INFO("cppu.log", " return : ");
+SAL_INFO("cppu.log", " return : ");
 traceValue(pReturnTypeRef,pReturn);
 } // if ( pReturn && pReturnTypeRef )
 
-   SAL_INFO("cppu.log", "\n");
+SAL_INFO("cppu.log", "\n");
 }
 }
 
diff --git a/cppu/source/helper/purpenv/helper_purpenv_Proxy.cxx 
b/cppu/source/helper/purpenv/helper_purpenv_Proxy.cxx
index b6f5ffbe31aa..f62241fe13d6 100644
--- a/cppu/source/helper/purpenv/helper_purpenv_Proxy.cxx
+++ b/cppu/source/helper/purpenv/helper_purpenv_Proxy.cxx
@@ -184,7 +184,7 @@ static void s_acquireAndRegister_v(va_list * pParam)
 uno_ExtEnvironment   * pEnv   = va_arg(*pParam, 
uno_ExtEnvironment *);
 
 pUnoI->acquire(pUnoI);
- pEnv->registerInterface(pEnv, reinterpret_cast(), pOid, 
pTypeDescr);
+pEnv->registerInterface(pEnv, reinterpret_cast(), pOid, 
pTypeDescr);
 }
 }
 
diff --git a/cppu/source/uno/cascade_mapping.cxx 
b/cppu/source/uno/cascade_mapping.cxx
index 3cb34a65bb1c..7d44296ea062 100644
--- a/cppu/source/uno/cascade_mapping.cxx
+++ b/cppu/source/uno/cascade_mapping.cxx
@@ -271,14 +271,14 @@ void getCascadeMapping(uno_Mapping ** ppMapping,
 OUString envDcp = uno_envType;
 
 envDcp += from_envPurpose;
- uno_getEnvironment(, envDcp.pData, nullptr);
+uno_getEnvironment(, envDcp.pData, nullptr);
 }
 else if (from_envType == uno_envType && to_envType != uno_envType) // UNO 
-> ?
 // mediate via uno(context)
 {
 OUString envDcp = uno_envType;
 
- envDcp += to_envPurpose;
+envDcp += to_envPurpose;
 uno_getEnvironment(, envDcp.pData, nullptr);
 }
 else // everything else
diff --git a/cppuhelper/source/implementationentry.cxx 
b/cppuhelper/source/implementationentry.cxx
index 466d766558af..2e5891982b8e 100644
--- a/cppuhelper/source/implementationentry.cxx
+++ b/cppuhelper/source/implementationentry.cxx
@@ -65,7 +65,7 @@ void * component_getFactoryHelper(
 

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

2018-12-28 Thread Libreoffice Gerrit user
 cppuhelper/source/factory.cxx |3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

New commits:
commit 83e7d9e0847af169bd0bfb6ef0b59eaa08a0631e
Author: Matteo Casalin 
AuthorDate: Thu Dec 13 08:36:40 2018 +0100
Commit: Matteo Casalin 
CommitDate: Fri Dec 28 17:07:29 2018 +0100

Do not use indexed getToken for a single call

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

diff --git a/cppuhelper/source/factory.cxx b/cppuhelper/source/factory.cxx
index 97eb8f851077..c993de1ac0bc 100644
--- a/cppuhelper/source/factory.cxx
+++ b/cppuhelper/source/factory.cxx
@@ -700,8 +700,7 @@ Reference< XInterface > 
ORegistryFactoryHelper::createModuleFactory()
 {
 aActivatorUrl = xActivatorKey->getAsciiValue();
 
-sal_Int32 nIndex = 0;
-aActivatorName = aActivatorUrl.getToken(0, ':', nIndex );
+aActivatorName = aActivatorUrl.getToken(0, ':');
 
 Reference xLocationKey = xImplementationKey->openKey(
 "/UNO/LOCATION" );
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2018-11-11 Thread Libreoffice Gerrit user
 cppuhelper/source/component_context.cxx |4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

New commits:
commit 18f9abffadec8337561bef16b006e2968f224538
Author: Zdibák Zoltán 
AuthorDate: Sat Nov 10 20:04:43 2018 +0100
Commit: Markus Mohrhard 
CommitDate: Sun Nov 11 11:16:31 2018 +0100

cppCheck narrowed variableScope rEntry

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

diff --git a/cppuhelper/source/component_context.cxx 
b/cppuhelper/source/component_context.cxx
index b64d8b624849..b2c4cf4d5112 100644
--- a/cppuhelper/source/component_context.cxx
+++ b/cppuhelper/source/component_context.cxx
@@ -400,12 +400,12 @@ void ComponentContext::disposing()
 t_map::iterator const iEnd( m_map.end() );
 for ( ; iPos != iEnd; ++iPos )
 {
-ContextEntry& rEntry = iPos->second;
-
 // service manager disposed separately
 if (!m_xSMgr.is() ||
 !iPos->first.startsWith( SMGR_SINGLETON ))
 {
+ContextEntry& rEntry = iPos->second;
+
 if (rEntry.lateInit)
 {
 // late init
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: cppuhelper/source cui/source dbaccess/source desktop/unx

2018-10-17 Thread Libreoffice Gerrit user
 cppuhelper/source/servicemanager.cxx   |2 
 cui/source/inc/swpossizetabpage.hxx|4 -
 cui/source/options/cfgchart.cxx|2 
 cui/source/options/optfltr.cxx |4 -
 cui/source/tabpages/border.cxx |4 -
 cui/source/tabpages/swpossizetabpage.cxx   |   54 -
 cui/source/uno/services.cxx|2 
 dbaccess/source/ext/macromigration/migrationengine.cxx |2 
 dbaccess/source/sdbtools/connection/tablename.cxx  |2 
 dbaccess/source/ui/app/AppIconControl.cxx  |2 
 dbaccess/source/ui/browser/dbloader.cxx|2 
 desktop/unx/source/args.c  |2 
 12 files changed, 41 insertions(+), 41 deletions(-)

New commits:
commit bb480f77b8a65e7e52b53e601e536f55fa55f44b
Author: Noel Grandin 
AuthorDate: Wed Oct 17 09:30:11 2018 +0200
Commit: Noel Grandin 
CommitDate: Wed Oct 17 10:46:12 2018 +0200

loplugin:staticvar in cppuhelper..desktop

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

diff --git a/cppuhelper/source/servicemanager.cxx 
b/cppuhelper/source/servicemanager.cxx
index 6c64911a5270..3fac957ebc3a 100644
--- a/cppuhelper/source/servicemanager.cxx
+++ b/cppuhelper/source/servicemanager.cxx
@@ -1993,7 +1993,7 @@ void cppuhelper::ServiceManager::preloadImplementations() 
{
 std::cerr << std::endl;
 
 // Various rather important uno mappings.
-struct {
+static struct {
 const char *mpFrom;
 const char *mpTo;
 const char *mpPurpose;
diff --git a/cui/source/inc/swpossizetabpage.hxx 
b/cui/source/inc/swpossizetabpage.hxx
index a00e7b579031..a33f411d6915 100644
--- a/cui/source/inc/swpossizetabpage.hxx
+++ b/cui/source/inc/swpossizetabpage.hxx
@@ -40,8 +40,8 @@ class SvxSwPosSizeTabPage : public SfxTabPage
 ::tools::Rectangle   m_aWorkArea;
 Point   m_aAnchorPos;
 
-FrmMap* m_pVMap;
-FrmMap* m_pHMap;
+FrmMap const * m_pVMap;
+FrmMap const * m_pHMap;
 const SdrView*  m_pSdrView;
 
 // initial values
diff --git a/cui/source/options/cfgchart.cxx b/cui/source/options/cfgchart.cxx
index 8ac51f0ba678..5d97a788fa2f 100644
--- a/cui/source/options/cfgchart.cxx
+++ b/cui/source/options/cfgchart.cxx
@@ -88,7 +88,7 @@ void SvxChartColorTable::replace( size_t _nIndex, const 
XColorEntry & _rEntry )
 
 void SvxChartColorTable::useDefault()
 {
-Color aColors[] = {
+static const Color aColors[] = {
 Color( 0x00, 0x45, 0x86 ),
 Color( 0xff, 0x42, 0x0e ),
 Color( 0xff, 0xd3, 0x20 ),
diff --git a/cui/source/options/optfltr.cxx b/cui/source/options/optfltr.cxx
index 2e917cf10b4c..f2ede6f28b29 100644
--- a/cui/source/options/optfltr.cxx
+++ b/cui/source/options/optfltr.cxx
@@ -202,7 +202,7 @@ bool OfaMSFilterTabPage2::FillItemSet( SfxItemSet* )
 MSFltrPg2_CheckBoxEntries eType;
 bool (SvtFilterOptions:: *FnIs)() const;
 void (SvtFilterOptions:: *FnSet)( bool bFlag );
-} aChkArr[] = {
+} const aChkArr[] = {
 { Math, ::IsMathType2Math,
 ::SetMathType2Math },
 { Math, ::IsMath2MathType,
@@ -279,7 +279,7 @@ void OfaMSFilterTabPage2::Reset( const SfxItemSet* )
 static struct ChkCBoxEntries{
 MSFltrPg2_CheckBoxEntries eType;
 bool (SvtFilterOptions:: *FnIs)() const;
-} aChkArr[] = {
+} const aChkArr[] = {
 { Math, ::IsMathType2Math },
 { Math, ::IsMath2MathType },
 { Writer,   ::IsWinWord2Writer },
diff --git a/cui/source/tabpages/border.cxx b/cui/source/tabpages/border.cxx
index 414c8a2a05a6..17c6417f778b 100644
--- a/cui/source/tabpages/border.cxx
+++ b/cui/source/tabpages/border.cxx
@@ -1265,13 +1265,13 @@ void SvxBorderTabPage::FillLineListBox_Impl()
 {
 using namespace ::com::sun::star::table::BorderLineStyle;
 
-struct {
+static struct {
 SvxBorderLineStyle mnStyle;
 long mnMinWidth;
 LineListBox::ColorFunc mpColor1Fn;
 LineListBox::ColorFunc mpColor2Fn;
 LineListBox::ColorDistFunc mpColorDistFn;
-} aLines[] = {
+} const aLines[] = {
 // Simple lines
 { SvxBorderLineStyle::SOLID,0, , , 
 },
 { SvxBorderLineStyle::DOTTED,   0, , , 
 },
diff --git a/cui/source/tabpages/swpossizetabpage.cxx 
b/cui/source/tabpages/swpossizetabpage.cxx
index 5dd07ce9ff4b..aa97613bf731 100644
--- a/cui/source/tabpages/swpossizetabpage.cxx
+++ b/cui/source/tabpages/swpossizetabpage.cxx
@@ -97,7 +97,7 @@ namespace o3tl {
 template<> struct typed_flags : is_typed_flags {};
 }
 
-static RelationMap aRelationMap[] =
+static RelationMap const aRelationMap[] =
 {
 {SwFPos::FRAME, SwFPos::FRAME, LB::Frame,   

[Libreoffice-commits] core.git: cppuhelper/source desktop/inc desktop/source

2018-08-28 Thread Libreoffice Gerrit user
 cppuhelper/source/paths.cxx |2 +-
 desktop/inc/strings.hrc |4 ++--
 desktop/source/app/app.cxx  |4 ++--
 3 files changed, 5 insertions(+), 5 deletions(-)

New commits:
commit b57ed76361da672697eccd219b09bd358a967e0d
Author: Andrea Gelmini 
AuthorDate: Mon Aug 27 14:38:16 2018 +0200
Commit: Julien Nabet 
CommitDate: Tue Aug 28 16:19:10 2018 +0200

Fix typo in code

To complete commit:
e9fa088735bfbd34bc81f1925438691f746db070

It passed "make check" on Linux

Change-Id: I2772b1ac5d4024bb11f3e09e24afc566b7091fb8
Reviewed-on: https://gerrit.libreoffice.org/59693
Reviewed-by: Julien Nabet 
Tested-by: Jenkins

diff --git a/cppuhelper/source/paths.cxx b/cppuhelper/source/paths.cxx
index 429df7edf8d3..38584b38ee4d 100644
--- a/cppuhelper/source/paths.cxx
+++ b/cppuhelper/source/paths.cxx
@@ -64,7 +64,7 @@ rtl::OUString cppu::getUnoIniUri() {
 // Wouldn't it be lovely to avoid this ugly hard-coding.
 // The problem is that the 'create_bootstrap_macro_expander_factory()'
 // required for bootstrapping services, calls cppu::get_unorc directly
-// instead of re-using the BoostrapHandle from:
+// instead of re-using the BootstrapHandle from:
 // defaultBootstrap_InitialComponentContext
 // and since rtlBootstrapHandle is not ref-counted doing anything
 // clean here is hardish.
diff --git a/desktop/inc/strings.hrc b/desktop/inc/strings.hrc
index 40504ce36815..912f76626b0e 100644
--- a/desktop/inc/strings.hrc
+++ b/desktop/inc/strings.hrc
@@ -174,8 +174,8 @@
 #define STR_TITLE_USERDATALOCKED
NC_("STR_TITLE_USERDATALOCKED", "%PRODUCTNAME %PRODUCTVERSION")
 #define STR_ERR_PRINTDISABLED   
NC_("STR_ERR_PRINTDISABLED", "Printing is disabled. No documents can be 
printed.")
 #define STR_BOOTSTRAP_ERR_NO_PATHSET_SERVICE
NC_("STR_BOOTSTRAP_ERR_NO_PATHSET_SERVICE", "The path manager is not 
available.\n")
-#define STR_BOOSTRAP_ERR_NOTENOUGHDISKSPACE 
NC_("STR_BOOSTRAP_ERR_NOTENOUGHDISKSPACE", "%PRODUCTNAME user installation 
could not be completed due to insufficient free disk space. Please free more 
disc space at the following location and restart %PRODUCTNAME:\n\n")
-#define STR_BOOSTRAP_ERR_NOACCESSRIGHTS 
NC_("STR_BOOSTRAP_ERR_NOACCESSRIGHTS", "%PRODUCTNAME user installation could 
not be processed due to missing access rights. Please make sure that you have 
sufficient access rights for the following location and restart 
%PRODUCTNAME:\n\n")
+#define STR_BOOTSTRAP_ERR_NOTENOUGHDISKSPACE 
NC_("STR_BOOTSTRAP_ERR_NOTENOUGHDISKSPACE", "%PRODUCTNAME user installation 
could not be completed due to insufficient free disk space. Please free more 
disc space at the following location and restart %PRODUCTNAME:\n\n")
+#define STR_BOOTSTRAP_ERR_NOACCESSRIGHTS 
NC_("STR_BOOTSTRAP_ERR_NOACCESSRIGHTS", "%PRODUCTNAME user installation could 
not be processed due to missing access rights. Please make sure that you have 
sufficient access rights for the following location and restart 
%PRODUCTNAME:\n\n")
 
 #define RID_STR_UNOPKG_ACCEPT_LIC_1 
NC_("RID_STR_UNOPKG_ACCEPT_LIC_1", "Extension Software License Agreement of 
$NAME:")
 #define RID_STR_UNOPKG_ACCEPT_LIC_2 
NC_("RID_STR_UNOPKG_ACCEPT_LIC_2", "Read the complete License Agreement 
displayed above. " \
diff --git a/desktop/source/app/app.cxx b/desktop/source/app/app.cxx
index 71b83d64f3c3..de11310bc7ca 100644
--- a/desktop/source/app/app.cxx
+++ b/desktop/source/app/app.cxx
@@ -878,9 +878,9 @@ void Desktop::HandleBootstrapErrors(
 
 OUString aDiagnosticMessage;
 if ( aBootstrapError == BE_USERINSTALL_NOTENOUGHDISKSPACE )
-aDiagnosticMessage = DpResId(STR_BOOSTRAP_ERR_NOTENOUGHDISKSPACE);
+aDiagnosticMessage = DpResId(STR_BOOTSTRAP_ERR_NOTENOUGHDISKSPACE);
 else
-aDiagnosticMessage = DpResId(STR_BOOSTRAP_ERR_NOACCESSRIGHTS);
+aDiagnosticMessage = DpResId(STR_BOOTSTRAP_ERR_NOACCESSRIGHTS);
 aDiagnosticMessage += aUserInstallationPath;
 
 FatalError(MakeStartupErrorMessage(aDiagnosticMessage));
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: cppuhelper/source include/basegfx include/filter package/source sal/qa sc/source winaccessibility/inc

2018-08-13 Thread Libreoffice Gerrit user
 cppuhelper/source/paths.cxx  |2 +-
 include/basegfx/matrix/b2dhommatrixtools.hxx |2 +-
 include/filter/msfilter/svdfppt.hxx  |2 +-
 package/source/xstor/xstorage.cxx|2 +-
 sal/qa/libs2test.txt |2 +-
 sc/source/ui/inc/csvsplits.hxx   |2 +-
 winaccessibility/inc/unomsaaevent.hxx|2 +-
 7 files changed, 7 insertions(+), 7 deletions(-)

New commits:
commit ff0d1b150ed6ca05f021daac52e5fcae8d9265ad
Author: Andrea Gelmini 
AuthorDate: Mon Aug 13 17:06:41 2018 +0200
Commit: Julien Nabet 
CommitDate: Mon Aug 13 21:47:25 2018 +0200

Fix typos

Change-Id: Ie3baa2f843a98c1edc523050db53beaa2c803394
Reviewed-on: https://gerrit.libreoffice.org/58801
Reviewed-by: Julien Nabet 
Tested-by: Jenkins

diff --git a/cppuhelper/source/paths.cxx b/cppuhelper/source/paths.cxx
index 7add3ac72de7..429df7edf8d3 100644
--- a/cppuhelper/source/paths.cxx
+++ b/cppuhelper/source/paths.cxx
@@ -72,7 +72,7 @@ rtl::OUString cppu::getUnoIniUri() {
 #else
 rtl::OUString uri(get_this_libpath());
 #ifdef MACOSX
-// We keep both the LO and URE dylibs direcly in "Frameworks"
+// We keep both the LO and URE dylibs directly in "Frameworks"
 // (that is, LIBO_LIB_FOLDER) and rc files in "Resources"
 // (LIBO_ETC_FOLDER). Except for unorc, of which there are two,
 // the "LO" one (which is in "Resources") and the "URE" one (which
diff --git a/include/basegfx/matrix/b2dhommatrixtools.hxx 
b/include/basegfx/matrix/b2dhommatrixtools.hxx
index 3bc3627dfbf5..6061e68cc811 100644
--- a/include/basegfx/matrix/b2dhommatrixtools.hxx
+++ b/include/basegfx/matrix/b2dhommatrixtools.hxx
@@ -63,7 +63,7 @@ namespace basegfx
 
 /** Tooling methods for faster completely combined matrix creation
 when scale, shearX, rotation and translation needs to be done in
-exactly that order. It's faster since it direcly calculates
+exactly that order. It's faster since it directly calculates
 each matrix value based on a symbolic calculation of the three
 matrix multiplications.
 Inline versions for parameters as tuples added, too.
diff --git a/include/filter/msfilter/svdfppt.hxx 
b/include/filter/msfilter/svdfppt.hxx
index dd220f9bcc3e..6fba3b703a6b 100644
--- a/include/filter/msfilter/svdfppt.hxx
+++ b/include/filter/msfilter/svdfppt.hxx
@@ -189,7 +189,7 @@ struct MSFILTER_DLLPUBLIC PptDocumentAtom
 sal_uInt32  nHandoutMasterPersist;  // 0=non-existent
 sal_uInt16  n1stPageNumber; // page number of the 
first slide
 PptPageFormat   eSlidesPageFormat;  // page format of the 
slides
-boolbEmbeddedTrueType   : 1;// TrueType direcly 
within the File?
+boolbEmbeddedTrueType   : 1;// TrueType directly 
within the File?
 boolbTitlePlaceholdersOmitted   : 1;
 boolbRightToLeft: 1;
 boolbShowComments   : 1;
diff --git a/package/source/xstor/xstorage.cxx 
b/package/source/xstor/xstorage.cxx
index 41bb3ffa8802..3488e5726150 100644
--- a/package/source/xstor/xstorage.cxx
+++ b/package/source/xstor/xstorage.cxx
@@ -5126,7 +5126,7 @@ void SAL_CALL OStorage::copyElementDirectlyTo(
 SAL_INFO("package.xstor", "Rethrow: " << rException);
 
 uno::Any aCaught( ::cppu::getCaughtException() );
-throw embed::StorageWrappedTargetException( THROW_WHERE "Can't copy 
element direcly!",
+throw embed::StorageWrappedTargetException( THROW_WHERE "Can't copy 
element directly!",
  uno::Reference< 
io::XInputStream >(),
  aCaught );
 }
diff --git a/sal/qa/libs2test.txt b/sal/qa/libs2test.txt
index 4c2208cb72fd..5503124f45b4 100644
--- a/sal/qa/libs2test.txt
+++ b/sal/qa/libs2test.txt
@@ -43,7 +43,7 @@ rtl/oustring  ; rtl_OUString2
 rtl/ostring   ; rtl_OString2
 
 osl/file  ; osl_File
-# LLA: temporaly removed, there are lot of problems with our environment
+# LLA: temporarily removed, there are lot of problems with our environment
 osl/socket; osl_StreamSocket
 osl/socket; osl_DatagramSocket
 osl/socket; osl_SocketAddr
diff --git a/sc/source/ui/inc/csvsplits.hxx b/sc/source/ui/inc/csvsplits.hxx
index b6f78c0e1e40..4b67f960714f 100644
--- a/sc/source/ui/inc/csvsplits.hxx
+++ b/sc/source/ui/inc/csvsplits.hxx
@@ -36,7 +36,7 @@ private:
 typedef ::std::vector< sal_Int32 >  ScSplitVector;
 typedef ScSplitVector::const_iterator   const_iterator;
 
-ScSplitVector   maVec;  /// The split containter.
+ScSplitVector   maVec;  /// The split container.
 
 public:
 // *** access by position *** -
diff --git 

[Libreoffice-commits] core.git: cppuhelper/source cppu/source

2018-07-29 Thread Libreoffice Gerrit user
 cppu/source/uno/lbmap.cxx   |   15 ---
 cppuhelper/source/component.cxx |   22 +++---
 2 files changed, 11 insertions(+), 26 deletions(-)

New commits:
commit c9697dc2abb2d23ffbb8253ce8b0ff0314d86984
Author: Jochen Nitschke 
AuthorDate: Sun Jul 29 18:22:48 2018 +0200
Commit: Noel Grandin 
CommitDate: Sun Jul 29 23:06:39 2018 +0200

replace double checked locking patterns

with thread safe static initialization

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

diff --git a/cppu/source/uno/lbmap.cxx b/cppu/source/uno/lbmap.cxx
index e1c606bf5c67..c5ce6709991f 100644
--- a/cppu/source/uno/lbmap.cxx
+++ b/cppu/source/uno/lbmap.cxx
@@ -158,17 +158,10 @@ struct MappingsData
 
 static MappingsData & getMappingsData()
 {
-static MappingsData * s_p = nullptr;
-if (! s_p)
-{
-MutexGuard aGuard( Mutex::getGlobalMutex() );
-if (! s_p)
-{
-//TODO  This memory is leaked; see #i63473# for when this should be
-// changed again:
-s_p = new MappingsData;
-}
-}
+//TODO  This memory is leaked; see #i63473# for when this should be
+// changed again:
+static MappingsData * s_p(new MappingsData);
+
 return *s_p;
 }
 
diff --git a/cppuhelper/source/component.cxx b/cppuhelper/source/component.cxx
index 1c3585ee17d4..c9bd6a4a9b28 100644
--- a/cppuhelper/source/component.cxx
+++ b/cppuhelper/source/component.cxx
@@ -112,21 +112,13 @@ void OComponentHelper::release() throw()
 
 Sequence< Type > OComponentHelper::getTypes()
 {
-static OTypeCollection * s_pTypes = nullptr;
-if (! s_pTypes)
-{
-MutexGuard aGuard( Mutex::getGlobalMutex() );
-if (! s_pTypes)
-{
-static OTypeCollection s_aTypes(
-cppu::UnoType::get(),
-cppu::UnoType::get(),
-cppu::UnoType::get(),
-cppu::UnoType::get() );
-s_pTypes = _aTypes;
-}
-}
-return s_pTypes->getTypes();
+static OTypeCollection s_aTypes(
+cppu::UnoType::get(),
+cppu::UnoType::get(),
+cppu::UnoType::get(),
+cppu::UnoType::get() );
+
+return s_aTypes.getTypes();
 }
 
 // XComponent
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2018-05-31 Thread Arnaud Versini
 cppuhelper/source/unourl.cxx |   22 ++
 1 file changed, 6 insertions(+), 16 deletions(-)

New commits:
commit e93c3662b31d14b75ebca90802848e9021b1f3d2
Author: Arnaud Versini 
Date:   Sun May 13 16:30:52 2018 +0200

cppuhelper : use rtl::isAlphaNumeric instead of recreate the method.

Change-Id: I30bd9e0bf99c2a115b67a59377b2d2ef6fdefef0
Reviewed-on: https://gerrit.libreoffice.org/54194
Tested-by: Jenkins 
Reviewed-by: Arnaud Versini 

diff --git a/cppuhelper/source/unourl.cxx b/cppuhelper/source/unourl.cxx
index cfd62ef23e6f..22250e5568eb 100644
--- a/cppuhelper/source/unourl.cxx
+++ b/cppuhelper/source/unourl.cxx
@@ -27,6 +27,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 
 #include 
@@ -35,17 +36,6 @@
 using cppu::UnoUrl;
 using cppu::UnoUrlDescriptor;
 
-namespace {
-
-inline bool isAlphanum(sal_Unicode c)
-{
-return (c >= 0x30 && c <= 0x39) // '0'--'9'
-|| (c >= 0x41 && c <= 0x5A) // 'A'--'Z'
-|| (c >= 0x61 && c <= 0x7A); // 'a'--'z'
-}
-
-}
-
 class UnoUrlDescriptor::Impl
 {
 public:
@@ -76,7 +66,7 @@ inline UnoUrlDescriptor::Impl::Impl(rtl::OUString const & 
rDescriptor)
 switch (eState)
 {
 case STATE_NAME0:
-if (bEnd || !isAlphanum(c))
+if (bEnd || !rtl::isAsciiAlphanumeric(c))
 throw rtl::MalformedUriException(
 "UNO URL contains bad descriptor name");
 nStart = i;
@@ -90,13 +80,13 @@ inline UnoUrlDescriptor::Impl::Impl(rtl::OUString const & 
rDescriptor)
 = rDescriptor.copy(nStart, i - nStart).toAsciiLowerCase();
 eState = STATE_KEY0;
 }
-else if (!isAlphanum(c))
+else if (!rtl::isAsciiAlphanumeric(c))
 throw rtl::MalformedUriException(
 "UNO URL contains bad descriptor name");
 break;
 
 case STATE_KEY0:
-if (bEnd || !isAlphanum(c))
+if (bEnd || !rtl::isAsciiAlphanumeric(c))
 throw rtl::MalformedUriException(
 "UNO URL contains bad parameter key");
 nStart = i;
@@ -110,7 +100,7 @@ inline UnoUrlDescriptor::Impl::Impl(rtl::OUString const & 
rDescriptor)
 nStart = i + 1;
 eState = STATE_VALUE;
 }
-else if (bEnd || !isAlphanum(c))
+else if (bEnd || !rtl::isAsciiAlphanumeric(c))
 throw rtl::MalformedUriException(
 "UNO URL contains bad parameter key");
 break;
@@ -222,7 +212,7 @@ inline UnoUrl::Impl * UnoUrl::Impl::create(rtl::OUString 
const & rUrl)
 for (j = i; j < rUrl.getLength(); ++j)
 {
 sal_Unicode c = rUrl[j];
-if (!isAlphanum(c) && c != 0x21 && c != 0x24 // '!', '$'
+if (!rtl::isAsciiAlphanumeric(c) && c != 0x21 && c != 0x24 // '!', '$'
 && c != 0x26 && c != 0x27 && c != 0x28 // '&', ''', '('
 && c != 0x29 && c != 0x2A && c != 0x2B // ')', '*', '+'
 && c != 0x2C && c != 0x2D && c != 0x2E // ',', '-', '.'
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2018-02-10 Thread Michael Meeks
 cppuhelper/source/servicemanager.cxx |   20 
 1 file changed, 20 insertions(+)

New commits:
commit 720759ad342000f2729a6c983523af931f01dbef
Author: Michael Meeks 
Date:   Mon Jan 22 22:02:56 2018 +

Pre-load key UNO mappings.

Change-Id: I415e07d737c734d63ac969783464babcbb9ea884
Reviewed-on: https://gerrit.libreoffice.org/48365
Tested-by: Jenkins 
Reviewed-by: Michael Meeks 

diff --git a/cppuhelper/source/servicemanager.cxx 
b/cppuhelper/source/servicemanager.cxx
index 014b8ea91817..420316c2a5a3 100644
--- a/cppuhelper/source/servicemanager.cxx
+++ b/cppuhelper/source/servicemanager.cxx
@@ -43,6 +43,7 @@
 #include 
 #include 
 #include 
+#include 
 
 #include "loadsharedlibcomponentfactory.hxx"
 
@@ -1992,6 +1993,25 @@ void 
cppuhelper::ServiceManager::preloadImplementations() {
 }
 }
 std::cerr << std::endl;
+
+// Various rather important uno mappings.
+struct {
+const char *mpFrom;
+const char *mpTo;
+const char *mpPurpose;
+} aMappingLoad[] = {
+{ "gcc3", "uno",  "" },
+{ "uno",  "gcc3", "" },
+};
+
+static std::vector maMaps;
+for (auto  : aMappingLoad)
+{
+maMaps.push_back(css::uno::Mapping(
+ OUString::createFromAscii(it.mpFrom),
+ OUString::createFromAscii(it.mpTo),
+ OUString::createFromAscii(it.mpPurpose)));
+}
 #endif
 }
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: cppuhelper/source sc/source sd/source sw/source

2018-02-10 Thread Michael Meeks
 cppuhelper/source/servicemanager.cxx |   13 +
 sc/source/ui/app/scdll.cxx   |   11 +++
 sc/source/ui/docshell/impex.cxx  |4 +++-
 sd/source/ui/app/sddll.cxx   |7 +++
 sw/source/uibase/app/swdll.cxx   |7 +++
 5 files changed, 41 insertions(+), 1 deletion(-)

New commits:
commit f215096c24429fe69e7e5ab37898d0f0beeff0ab
Author: Michael Meeks 
Date:   Sat Feb 10 17:27:42 2018 +0100

lok: allow libraries to pre-init themselves.

Populate static module references before entering a jail
containing no code.

Implement for scfilt, scui, swui, sdui.

Change-Id: I8fec2aa78e67053a7945926c818122bd4290103c
Reviewed-on: https://gerrit.libreoffice.org/49545
Tested-by: Jenkins 
Reviewed-by: Michael Meeks 

diff --git a/cppuhelper/source/servicemanager.cxx 
b/cppuhelper/source/servicemanager.cxx
index d51ce6bd6292..014b8ea91817 100644
--- a/cppuhelper/source/servicemanager.cxx
+++ b/cppuhelper/source/servicemanager.cxx
@@ -1974,6 +1974,19 @@ void 
cppuhelper::ServiceManager::preloadImplementations() {
 iterator->second->status = Data::Implementation::STATUS_LOADED;
 
 }
+
+// Some libraries use other (non-UNO) libraries requiring preinit
+oslGenericFunction fpPreload = aModule.getFunctionSymbol( 
"lok_preload_hook" );
+if (fpPreload)
+{
+static std::vector aPreloaded;
+if (std::find(aPreloaded.begin(), aPreloaded.end(), fpPreload) 
== aPreloaded.end())
+{
+aPreloaded.push_back(fpPreload);
+fpPreload();
+}
+}
+
 // leak aModule
 aModule.release();
 }
diff --git a/sc/source/ui/app/scdll.cxx b/sc/source/ui/app/scdll.cxx
index 0f398c5d4170..6f8287cd1b9d 100644
--- a/sc/source/ui/app/scdll.cxx
+++ b/sc/source/ui/app/scdll.cxx
@@ -106,6 +106,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 
 OUString ScResId(const char* pId)
@@ -266,4 +267,14 @@ void ScDLL::Init()
 //  StarOne Services are now handled in the registry
 }
 
+extern "C" SAL_DLLPUBLIC_EXPORT
+void lok_preload_hook()
+{
+// scfilt
+ScFormatFilter::Get();
+// scui
+ScAbstractDialogFactory::Create();
+}
+
+
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/docshell/impex.cxx b/sc/source/ui/docshell/impex.cxx
index 3088c50efe29..cd703cbe9714 100644
--- a/sc/source/ui/docshell/impex.cxx
+++ b/sc/source/ui/docshell/impex.cxx
@@ -2334,7 +2334,9 @@ ScFormatFilterPlugin ::Get()
 #ifndef DISABLE_DYNLOADING
 OUString sFilterLib(SVLIBRARY("scfilt"));
 static ::osl::Module aModule;
-bool bLoaded = aModule.loadRelative(, sFilterLib);
+bool bLoaded = aModule.is();
+if (!bLoaded)
+bLoaded = aModule.loadRelative(, sFilterLib);
 if (!bLoaded)
 bLoaded = aModule.load(sFilterLib);
 if (bLoaded)
diff --git a/sd/source/ui/app/sddll.cxx b/sd/source/ui/app/sddll.cxx
index 16b47899ceea..511b66567d67 100644
--- a/sd/source/ui/app/sddll.cxx
+++ b/sd/source/ui/app/sddll.cxx
@@ -96,6 +96,7 @@
 #include 
 #include 
 #include 
+#include 
 
 using namespace ::com::sun::star;
 
@@ -289,4 +290,10 @@ void SdDLL::Init()
 #endif
 }
 
+extern "C" SAL_DLLPUBLIC_EXPORT
+void lok_preload_hook()
+{
+SdAbstractDialogFactory::Create();
+}
+
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/uibase/app/swdll.cxx b/sw/source/uibase/app/swdll.cxx
index f1f7b9039d86..7df0cec3a0db 100644
--- a/sw/source/uibase/app/swdll.cxx
+++ b/sw/source/uibase/app/swdll.cxx
@@ -45,6 +45,7 @@
 
 #include 
 #include 
+#include 
 
 #include "swdllimpl.hxx"
 #include 
@@ -171,4 +172,10 @@ sw::Filters & SwDLL::getFilters()
 return *filters_.get();
 }
 
+extern "C" SAL_DLLPUBLIC_EXPORT
+void lok_preload_hook()
+{
+SwAbstractDialogFactory::Create();
+}
+
 /* 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: cppuhelper/source i18npool/source lotuswordpro/source sc/qa sc/source sdext/source slideshow/source starmath/source svtools/source svx/source sw/source vcl/opengl

2018-01-18 Thread Andrea Gelmini
 cppuhelper/source/servicemanager.cxx  |6 +++---
 i18npool/source/breakiterator/data/README |2 +-
 lotuswordpro/source/filter/bencont.cxx|2 +-
 lotuswordpro/source/filter/explode.cxx|2 +-
 lotuswordpro/source/filter/lwpfribptr.cxx |2 +-
 sc/qa/unit/subsequent_filters-test.cxx|2 +-
 sc/source/core/data/table3.cxx|2 +-
 sc/source/filter/excel/xichart.cxx|2 +-
 sc/source/ui/app/inputwin.cxx |2 +-
 sc/source/ui/undo/undocell.cxx|2 +-
 sdext/source/minimizer/impoptimizer.cxx   |2 +-
 slideshow/source/engine/slideshowimpl.cxx |4 ++--
 starmath/source/visitors.cxx  |2 +-
 svtools/source/control/calendar.cxx   |2 +-
 svx/source/svdraw/svdsnpv.cxx |4 ++--
 svx/source/unodraw/unoshap3.cxx   |4 ++--
 sw/source/core/layout/fly.cxx |2 +-
 sw/source/core/text/itrform2.cxx  |6 +++---
 sw/source/core/text/txtfld.cxx|4 ++--
 vcl/opengl/gdiimpl.cxx|2 +-
 20 files changed, 28 insertions(+), 28 deletions(-)

New commits:
commit 970b76816a03be0f57f35a790bea57bf299e344b
Author: Andrea Gelmini 
Date:   Wed Jan 17 19:39:12 2018 +0100

Fix typos

Change-Id: Id1c7ddf6c49ec709e38947a82731fe31a64aad04
Reviewed-on: https://gerrit.libreoffice.org/48076
Reviewed-by: Julien Nabet 
Tested-by: Julien Nabet 

diff --git a/cppuhelper/source/servicemanager.cxx 
b/cppuhelper/source/servicemanager.cxx
index 556440dc8733..d51ce6bd6292 100644
--- a/cppuhelper/source/servicemanager.cxx
+++ b/cppuhelper/source/servicemanager.cxx
@@ -738,7 +738,7 @@ void cppuhelper::ServiceManager::addSingletonContextEntries(
 assert(i->second[0].get() != nullptr);
 SAL_INFO_IF(
 i->second.size() > 1, "cppuhelper",
-"Arbitrarily chosing " << i->second[0]->info->name
+"Arbitrarily choosing " << i->second[0]->info->name
 << " among multiple implementations for " << i->first);
 entries->push_back(
 cppu::ContextEntry_Init(
@@ -1641,7 +1641,7 @@ bool cppuhelper::ServiceManager::insertExtraData(Data 
const & extra) {
 assert(i->second[0].get() != nullptr);
 SAL_INFO_IF(
 i->second.size() > 1, "cppuhelper",
-"Arbitrarily chosing " << i->second[0]->info->name
+"Arbitrarily choosing " << i->second[0]->info->name
 << " among multiple implementations for singleton "
 << i->first);
 try {
@@ -1792,7 +1792,7 @@ cppuhelper::ServiceManager::findServiceImplementation(
 assert(!i->second.empty());
 SAL_INFO_IF(
 i->second.size() > 1, "cppuhelper",
-"Arbitrarily chosing " << i->second[0]->info->name
+"Arbitrarily choosing " << i->second[0]->info->name
 << " among multiple implementations for " << i->first);
 impl = i->second[0];
 }
diff --git a/i18npool/source/breakiterator/data/README 
b/i18npool/source/breakiterator/data/README
index a95306608887..63f25a1ccd07 100644
--- a/i18npool/source/breakiterator/data/README
+++ b/i18npool/source/breakiterator/data/README
@@ -117,7 +117,7 @@ Author: Kurt Zenker 
 Date:   Wed Sep 5 16:37:28 2007 +
 
 INTEGRATION: CWS i18n37 (1.22.6); FILE MERGED
-2007/09/03 18:27:39 khong 1.22.6.2: i8132 fixed a problem in skiping space 
for word breakiterator
+2007/09/03 18:27:39 khong 1.22.6.2: i8132 fixed a problem in skipping 
space for word breakiterator
 2007/08/31 21:30:30 khong 1.22.6.1: i81158 fix skipping space problem
 
 commit d2c2baf1a31d281d20e8b4d4c806dda027b2d5a3
diff --git a/lotuswordpro/source/filter/bencont.cxx 
b/lotuswordpro/source/filter/bencont.cxx
index 52c82292c8ea..7340f046fa53 100644
--- a/lotuswordpro/source/filter/bencont.cxx
+++ b/lotuswordpro/source/filter/bencont.cxx
@@ -164,7 +164,7 @@ LtcBenContainer::LtcBenContainer(LwpSvStream * pStream)
 }
 
 /**
-*   Read buffer fro bento file with specified buffer
+*   Read buffer for bento file with specified buffer
 *   @param  buffer pointer
 *   @param  buffer size
 *   @param  number of bytes read
diff --git a/lotuswordpro/source/filter/explode.cxx 
b/lotuswordpro/source/filter/explode.cxx
index 5d821698745c..7f60a9dfa737 100644
--- a/lotuswordpro/source/filter/explode.cxx
+++ b/lotuswordpro/source/filter/explode.cxx
@@ -317,7 +317,7 @@ sal_Int32 Decompression::explode()
 m_pOutStream->ReadBytes(sTemp, nRead);
 if (nRead != Length)
 {
-// fill the buffer with read content repeatly until full
+// fill the buffer with read content repeatedly until full
 for (sal_uInt32 i=nRead; i

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

2018-01-12 Thread Stephan Bergmann
 cppuhelper/source/shlib.cxx |8 
 1 file changed, 8 deletions(-)

New commits:
commit 7f063b77da6db00806d9e6c60239a59d75ae3cee
Author: Stephan Bergmann 
Date:   Fri Jan 12 10:23:49 2018 +0100

Revert "Print the important failure messages on iOS even in a non-debug 
build"

This reverts commit ab07f81d0b5ffc4297d5f15d2458c5cc9217800f.

> Jan 12 10:21:35  tml_, is ab07f81d0b5ffc4297d5f15d2458c5cc9217800f
>  still relevant? (one could imagine that if one wants such debug output 
during
> development in a non-debug build, one could build with --enable-sal-log?)
> Jan 12 10:22:01  I have no idea what's relevant on iOS any longer
> Jan 12 10:22:26  ... but my gut feeling would be no, can be removed
> Jan 12 10:23:14  the rationale in the commit message sounds a bit 
thin
> Jan 12 10:24:02  surely one should test an ap well enough before
>  submitting, to verify that it isn't possible to get it to try to invoke a
>  constructor that isn't included

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

diff --git a/cppuhelper/source/shlib.cxx b/cppuhelper/source/shlib.cxx
index e78071bb4774..52d8af821474 100644
--- a/cppuhelper/source/shlib.cxx
+++ b/cppuhelper/source/shlib.cxx
@@ -266,10 +266,6 @@ void cppuhelper::detail::loadSharedLibComponentFactory(
 }
 if (fp == 0) {
 SAL_WARN("cppuhelper", "unknown factory name \"" << name << "\"");
-#if defined IOS && !defined SAL_LOG_WARN
-// If the above SAL_WARN expanded to nothing, print to stderr...
-fprintf(stderr, "Unknown factory name %s\n", 
OUStringToOString(name, RTL_TEXTENCODING_UTF8).getStr());
-#endif
 throw css::loader::CannotActivateFactoryException(
 "unknown factory name \"" + name + "\"",
 css::uno::Reference());
@@ -290,10 +286,6 @@ void cppuhelper::detail::loadSharedLibComponentFactory(
 }
 }
 SAL_WARN("cppuhelper", "unknown constructor name \"" << constructor << 
"\"");
-#if defined IOS && !defined SAL_LOG_WARN
-// If the above SAL_WARN expanded to nothing, print to stderr...
-fprintf(stderr, "Unknown constructor name %s\n", 
OUStringToOString(constructor, RTL_TEXTENCODING_UTF8).getStr());
-#endif
 throw css::loader::CannotActivateFactoryException(
 "unknown constructor name \"" + constructor + "\"",
 css::uno::Reference());
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2018-01-11 Thread Tor Lillqvist
 cppuhelper/source/servicemanager.cxx |   51 ---
 1 file changed, 48 insertions(+), 3 deletions(-)

New commits:
commit 2ac1298b5f46a7dad44dbd57569b22d15d11f1e7
Author: Tor Lillqvist 
Date:   Thu Jan 11 18:16:24 2018 +0200

Log just one line in cppuhelper::ServiceManager::preloadImplementations()

That *is* what we want, I guess, so better I do it proactively before
I am told to do it. Sorry for the back and forth, but my main point in
touching this code was anyway the filtering out of the component (the
KDE4Backend thing) that causes a crash for me, at least, and which it
presumably is fairly pointless to preload anyway.

Also, filter out libraries that for some reason have an empty name.

Change-Id: I2cffd51e67c23977e0779e7f0d6faaf59d8819d9

diff --git a/cppuhelper/source/servicemanager.cxx 
b/cppuhelper/source/servicemanager.cxx
index eb2f1f9dfba7..556440dc8733 100644
--- a/cppuhelper/source/servicemanager.cxx
+++ b/cppuhelper/source/servicemanager.cxx
@@ -1805,6 +1805,34 @@ cppuhelper::ServiceManager::findServiceImplementation(
 return impl;
 }
 
+/// Make a simpler unique name for preload / progress reporting.
+#ifndef DISABLE_DYNLOADING
+static rtl::OUString simplifyModule(const rtl::OUString )
+{
+sal_Int32 nIdx;
+OUStringBuffer edit(uri);
+if ((nIdx = edit.lastIndexOf('/')) > 0)
+edit.remove(0,nIdx+1);
+if ((nIdx = edit.lastIndexOf(':')) > 0)
+edit.remove(0,nIdx+1);
+if ((nIdx = edit.lastIndexOf("lo.so")) > 0)
+edit.truncate(nIdx);
+if ((nIdx = edit.lastIndexOf(".3")) > 0)
+edit.truncate(nIdx);
+if ((nIdx = edit.lastIndexOf("gcc3.so")) > 0)
+edit.truncate(nIdx);
+if ((nIdx = edit.lastIndexOf(".so")) > 0)
+edit.truncate(nIdx);
+if ((nIdx = edit.lastIndexOf("_uno")) > 0)
+edit.truncate(nIdx);
+if ((nIdx = edit.lastIndexOf(".jar")) > 0)
+edit.truncate(nIdx);
+if (edit.indexOf("lib") == 0)
+edit.remove(0,3);
+return edit.makeStringAndClear();
+}
+#endif
+
 /// Used only by LibreOfficeKit when used by Online to pre-initialize
 void cppuhelper::ServiceManager::preloadImplementations() {
 #ifdef DISABLE_DYNLOADING
@@ -1814,6 +1842,9 @@ void cppuhelper::ServiceManager::preloadImplementations() 
{
 osl::MutexGuard g(rBHelper.rMutex);
 css::uno::Environment aSourceEnv(css::uno::Environment::getCurrent());
 
+std::cerr << "preload:";
+std::vector aReported;
+
 // loop all implementations
 for (Data::NamedImplementations::const_iterator iterator(
 data_.namedImplementations.begin());
@@ -1823,6 +1854,16 @@ void 
cppuhelper::ServiceManager::preloadImplementations() {
 {
 const rtl::OUString  = iterator->second->info->uri;
 
+if (aLibrary.isEmpty())
+continue;
+
+if (std::find(aReported.begin(), aReported.end(), aLibrary) == 
aReported.end())
+{
+std::cerr << " " << simplifyModule(aLibrary);
+std::cerr.flush();
+aReported.push_back(aLibrary);
+}
+
 // expand absolute URI implementation component library
 aUri = cppu::bootstrap_expandUri(aLibrary);
 }
@@ -1839,16 +1880,19 @@ void 
cppuhelper::ServiceManager::preloadImplementations() {
 // Blacklist some components that are known to fail
 if (iterator->second->info->name == 
"com.sun.star.comp.configuration.backend.KDE4Backend")
 {
-std::cerr << "preload: Skipping " << 
iterator->second->info->name << std::endl;
+std::cerr << ":skipping";
+std::cerr.flush();
 continue;
 }
 
 // load component library
-std::cerr << "preload: Loading " << aUri << " for " << 
iterator->second->info->name << std::endl;
 osl::Module aModule(aUri, SAL_LOADMODULE_NOW | 
SAL_LOADMODULE_GLOBAL);
 
 if (!aModule.is())
-std::cerr << "preload: Loading " << aUri << " for " << 
iterator->second->info->name << " failed" << std::endl;
+{
+std::cerr << ":failed" << std::endl;
+std::cerr.flush();
+}
 
 if (aModule.is() &&
 !iterator->second->info->environment.isEmpty())
@@ -1934,6 +1978,7 @@ void cppuhelper::ServiceManager::preloadImplementations() 
{
 aModule.release();
 }
 }
+std::cerr << std::endl;
 #endif
 }
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2018-01-10 Thread Tor Lillqvist
 cppuhelper/source/servicemanager.cxx |7 ---
 1 file changed, 4 insertions(+), 3 deletions(-)

New commits:
commit 29e7b95e9cd24b5b3d436fd5cceac40d36b0ac02
Author: Tor Lillqvist 
Date:   Wed Jan 10 20:04:02 2018 +0200

Do use just std::cerr in 
cppuhelper::ServiceManager::preloadImplementations()

As the 1aedb6c4345719a963a883b13fa983db3ab4b9a8 commit message said,
the point is that we want this output even with a LO built for
production where SAL_INFO() and SAL_WARN() are no-ops.

Change-Id: I5f788c3914286ca8df2c7e290150adae0be42820

diff --git a/cppuhelper/source/servicemanager.cxx 
b/cppuhelper/source/servicemanager.cxx
index 7e2ad4db0440..eb2f1f9dfba7 100644
--- a/cppuhelper/source/servicemanager.cxx
+++ b/cppuhelper/source/servicemanager.cxx
@@ -11,6 +11,7 @@
 
 #include 
 #include 
+#include 
 #include 
 
 #include 
@@ -1838,16 +1839,16 @@ void 
cppuhelper::ServiceManager::preloadImplementations() {
 // Blacklist some components that are known to fail
 if (iterator->second->info->name == 
"com.sun.star.comp.configuration.backend.KDE4Backend")
 {
-SAL_INFO("cppuhelper.preload", "Skipping " << 
iterator->second->info->name);
+std::cerr << "preload: Skipping " << 
iterator->second->info->name << std::endl;
 continue;
 }
 
 // load component library
-SAL_INFO("cppuhelper.preload", "Loading " << aUri << " for " << 
iterator->second->info->name);
+std::cerr << "preload: Loading " << aUri << " for " << 
iterator->second->info->name << std::endl;
 osl::Module aModule(aUri, SAL_LOADMODULE_NOW | 
SAL_LOADMODULE_GLOBAL);
 
 if (!aModule.is())
-SAL_WARN("cppuhelper.preload", "Loading " << aUri << " for " 
<< iterator->second->info->name << " failed");
+std::cerr << "preload: Loading " << aUri << " for " << 
iterator->second->info->name << " failed" << std::endl;
 
 if (aModule.is() &&
 !iterator->second->info->environment.isEmpty())
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2017-11-28 Thread Caolán McNamara
 cppuhelper/source/servicemanager.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 34a7e1b8712bab8dc731a1b7ffe283009752959d
Author: Caolán McNamara 
Date:   Tue Nov 28 17:06:08 2017 +

not used with disable-dynloading

Change-Id: Idad8a7b9b984147b7a64caf7527d8ad21bdd55a2
Reviewed-on: https://gerrit.libreoffice.org/45433
Reviewed-by: Caolán McNamara 
Tested-by: Caolán McNamara 

diff --git a/cppuhelper/source/servicemanager.cxx 
b/cppuhelper/source/servicemanager.cxx
index 09e555a4ff43..42a0e7e3145a 100644
--- a/cppuhelper/source/servicemanager.cxx
+++ b/cppuhelper/source/servicemanager.cxx
@@ -1809,7 +1809,7 @@ cppuhelper::ServiceManager::findServiceImplementation(
 }
 
 /// Make a simpler unique name for preload / progress reporting.
-#ifndef IOS
+#ifndef DISABLE_DYNLOADING
 static rtl::OUString simplifyModule(const rtl::OUString )
 {
 sal_Int32 nIdx;
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: cppuhelper/source desktop/source

2017-11-25 Thread Michael Meeks
 cppuhelper/source/servicemanager.cxx |   42 ++-
 desktop/source/lib/init.cxx  |9 +--
 2 files changed, 47 insertions(+), 4 deletions(-)

New commits:
commit 1aedb6c4345719a963a883b13fa983db3ab4b9a8
Author: Michael Meeks 
Date:   Fri Nov 24 17:05:26 2017 +

LOK: provide user feedback while preloading.

Problems are hard enough to debug in a jailed kit process inside
a docker image; provide some visual feedback via stderr.

Change-Id: I54b0a21c1375be2acc9da0bbacf959a419471b08
Reviewed-on: https://gerrit.libreoffice.org/45256
Tested-by: Jenkins 
Reviewed-by: Michael Meeks 

diff --git a/cppuhelper/source/servicemanager.cxx 
b/cppuhelper/source/servicemanager.cxx
index 8aa294ca0720..163e0e631d37 100644
--- a/cppuhelper/source/servicemanager.cxx
+++ b/cppuhelper/source/servicemanager.cxx
@@ -10,6 +10,7 @@
 #include 
 
 #include 
+#include 
 #include 
 #include 
 
@@ -39,6 +40,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 
@@ -1806,6 +1808,33 @@ cppuhelper::ServiceManager::findServiceImplementation(
 return impl;
 }
 
+/// Make a simpler unique name for preload / progress reporting.
+static rtl::OUString simplifyModule(const rtl::OUString )
+{
+sal_Int32 nIdx;
+OUStringBuffer edit(uri);
+if ((nIdx = edit.lastIndexOf('/')) > 0)
+edit.remove(0,nIdx+1);
+if ((nIdx = edit.lastIndexOf(':')) > 0)
+edit.remove(0,nIdx+1);
+if ((nIdx = edit.lastIndexOf("lo.so")) > 0)
+edit.truncate(nIdx);
+if ((nIdx = edit.lastIndexOf(".3")) > 0)
+edit.truncate(nIdx);
+if ((nIdx = edit.lastIndexOf("gcc3.so")) > 0)
+edit.truncate(nIdx);
+if ((nIdx = edit.lastIndexOf(".so")) > 0)
+edit.truncate(nIdx);
+if ((nIdx = edit.lastIndexOf("_uno")) > 0)
+edit.truncate(nIdx);
+if ((nIdx = edit.lastIndexOf(".jar")) > 0)
+edit.truncate(nIdx);
+if (edit.indexOf("lib") == 0)
+edit.remove(0,3);
+return edit.makeStringAndClear();
+}
+
+/// Used only by LibreOfficeKit when used by Online to pre-initialize
 void cppuhelper::ServiceManager::preloadImplementations() {
 #ifdef DISABLE_DYNLOADING
 abort();
@@ -1814,6 +1843,9 @@ void cppuhelper::ServiceManager::preloadImplementations() 
{
 osl::MutexGuard g(rBHelper.rMutex);
 css::uno::Environment aSourceEnv(css::uno::Environment::getCurrent());
 
+std::cerr << "preload: ";
+std::vector aReported;
+
 // loop all implementations
 for (Data::NamedImplementations::const_iterator iterator(
 data_.namedImplementations.begin());
@@ -1821,8 +1853,15 @@ void 
cppuhelper::ServiceManager::preloadImplementations() {
 {
 try
 {
+const rtl::OUString  = iterator->second->info->uri;
+if (std::find(aReported.begin(), aReported.end(), aLibrary) == 
aReported.end())
+{
+std::cerr << simplifyModule(aLibrary) << " ";
+aReported.push_back(aLibrary);
+}
+
 // expand absolute URI implementation component library
-aUri = cppu::bootstrap_expandUri(iterator->second->info->uri);
+aUri = cppu::bootstrap_expandUri(aLibrary);
 }
 catch (css::lang::IllegalArgumentException& aError)
 {
@@ -1922,6 +1961,7 @@ void cppuhelper::ServiceManager::preloadImplementations() 
{
 aModule.release();
 }
 }
+std::cerr << std::endl;
 #endif
 }
 
diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx
index 42e78e8bec96..5d0e39c419cc 100644
--- a/desktop/source/lib/init.cxx
+++ b/desktop/source/lib/init.cxx
@@ -14,6 +14,7 @@
 #include 
 
 #include 
+#include 
 #include 
 
 #include 
@@ -3482,6 +3483,7 @@ static void lo_status_indicator_callback(void *data, 
comphelper::LibreOfficeKit:
 }
 }
 
+/// Used only by LibreOfficeKit when used by Online to pre-initialize
 static void preloadData()
 {
 // First: sit down and read all dictionaries: yum.
@@ -3491,14 +3493,14 @@ static void preloadData()
 
 css::uno::Reference 
xLocales(xSpellChecker, css::uno::UNO_QUERY_THROW);
 uno::Sequence< css::lang::Locale > aLocales = xLocales->getLocales();
-SAL_INFO("lok", "Preloading #" << aLocales.getLength() << " dictionaries");
+std::cerr << "Preloading dictionaries: ";
 for (auto  : aLocales)
 {
-SAL_INFO("lok", "load " << it.Language << "_" << it.Country);
+std::cerr << it.Language << "_" << it.Country << " ";
 css::beans::PropertyValues aNone;
 xSpellChecker->isValid("forcefed", it, aNone);
 }
-SAL_INFO("lok", "Preloading done");
+std::cerr << "\n";
 }
 
 static int lo_initialize(LibreOfficeKit* pThis, const char* pAppPath, const 
char* pUserProfileUrl)
@@ -3596,6 +3598,7 @@ static int lo_initialize(LibreOfficeKit* pThis, const 
char* 

[Libreoffice-commits] core.git: cppuhelper/source postprocess/qa

2017-10-27 Thread Stephan Bergmann
 cppuhelper/source/servicemanager.cxx |   10 +-
 cppuhelper/source/servicemanager.hxx |   11 +++
 postprocess/qa/services.cxx  |7 +++
 3 files changed, 23 insertions(+), 5 deletions(-)

New commits:
commit 11cf64b7303d3c6bd2620d6c711c9845775f2d3d
Author: Stephan Bergmann 
Date:   Fri Oct 27 10:37:26 2017 +0200

Better fix for CppunitTest_services

...than 25313923b08018bd837cfe3fc99a5e141602cafc "Fix CppunitTest_services 
for
constructor-based implementations..." (which this commit reverts again).  My
claim that "the 'factory' would be the object itself" is nonsense, it would
rather be an ImplementationWrapper (but one that was freshly created for 
each
ServiceManager::createContentEnumeration).

Change-Id: I85c683cff6f9ba78d0f8567a53f8fcbc56fe55cf

diff --git a/cppuhelper/source/servicemanager.cxx 
b/cppuhelper/source/servicemanager.cxx
index 1478010d3434..8aa294ca0720 100644
--- a/cppuhelper/source/servicemanager.cxx
+++ b/cppuhelper/source/servicemanager.cxx
@@ -1172,15 +1172,15 @@ cppuhelper::ServiceManager::createContentEnumeration(
 impl->factory1 = new ImplementationWrapper(this, *i);
 impl->status = Data::Implementation::STATUS_WRAPPER;
 }
+if (impl->constructor != nullptr && !impl->factory1.is()) {
+impl->factory1 = new ImplementationWrapper(this, *i);
+}
 }
 if (impl->factory1.is()) {
 factories.push_back(css::uno::Any(impl->factory1));
-} else if (impl->factory2.is()) {
-factories.push_back(css::uno::Any(impl->factory2));
 } else {
-css::uno::Reference< css::lang::XSingleComponentFactory > factory(
-new ImplementationWrapper(this, *i));
-factories.push_back(css::uno::Any(factory));
+assert(impl->factory2.is());
+factories.push_back(css::uno::Any(impl->factory2));
 }
 }
 return new ContentEnumeration(factories);
diff --git a/cppuhelper/source/servicemanager.hxx 
b/cppuhelper/source/servicemanager.hxx
index 2b1193e9a8d8..9838841403c1 100644
--- a/cppuhelper/source/servicemanager.hxx
+++ b/cppuhelper/source/servicemanager.hxx
@@ -150,6 +150,17 @@ public:
 
 enum Status { STATUS_NEW, STATUS_WRAPPER, STATUS_LOADED };
 
+// Logically, exactly one of constructor, factory1, factory2 should
+// be set.  However, there are two exceptions:  For one, when
+// constructor is set, ServiceManager::createContentEnumeration 
will
+// store the necessary ImplementationWrapper in factory1 (so that
+// multiple calls to createContentEnumeration will return the same
+// wrapper).  For another, when factory1 should be set but status 
is
+// STATUS_NEW, factory1 is not yet set (and when status is
+// STATUS_WRAPPER, factory1 is merely set to an
+// ImplementationWrapper---also due to a
+// ServiceManager::createContentEnumeration call---and will be
+// loaded later).
 std::shared_ptr< ImplementationInfo > info;
 WrapperConstructorFn constructor;
 css::uno::Reference< css::lang::XSingleComponentFactory > factory1;
diff --git a/postprocess/qa/services.cxx b/postprocess/qa/services.cxx
index 78dee9ed3ad1..0ab677339d9d 100644
--- a/postprocess/qa/services.cxx
+++ b/postprocess/qa/services.cxx
@@ -209,6 +209,13 @@ void Test::test() {
 k = impls.insert(
 std::make_pair(name, Implementation(j, servs)))
 .first;
+} else {
+CPPUNIT_ASSERT_MESSAGE(
+(OString(
+"multiple implementations named \"" + msg(name)
++ "\"")
+ .getStr()),
+bool(j == k->second.factory));
 }
 CPPUNIT_ASSERT_MESSAGE(
 (OString(
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: cppuhelper/source include/cppuhelper odk/source

2017-09-26 Thread Mike Kaganski
 cppuhelper/source/bootstrap.cxx|   13 +
 cppuhelper/source/findsofficepath.c|   64 +---
 include/cppuhelper/findsofficepath.h   |   10 +
 odk/source/unoapploader/unx/unoapploader.c |   26 +--
 odk/source/unoapploader/win/unoapploader.c |  211 +
 5 files changed, 170 insertions(+), 154 deletions(-)

New commits:
commit d32506e9f4ea604532bf5f4ba8a302b652aeaaa1
Author: Mike Kaganski 
Date:   Mon Sep 25 08:59:28 2017 +0300

cppuhelper_detail_findSofficePath: use Unicode on Windows

On Windows, UTF-8 is never current locale encoding; so using 8-bit
strings will always fail for paths containing characters outside
of current codepage.
Also fix leaks caused by failing to release its result: previously
it could return either result of getenv (that shouldn't get freed),
or an allocated string, but never got freed; now the result is
always allocated and properly freed.

Change-Id: I8b255dea20040eec0572de2b34280749fe8f071c
Reviewed-on: https://gerrit.libreoffice.org/42743
Tested-by: Jenkins 
Reviewed-by: Mike Kaganski 

diff --git a/cppuhelper/source/bootstrap.cxx b/cppuhelper/source/bootstrap.cxx
index 55a0d244b724..923d0e925795 100644
--- a/cppuhelper/source/bootstrap.cxx
+++ b/cppuhelper/source/bootstrap.cxx
@@ -87,21 +87,28 @@ Reference< XComponentContext > SAL_CALL bootstrap()
 
 try
 {
-char const * p1 = cppuhelper_detail_findSofficePath();
+auto* p1 = cppuhelper_detail_findSofficePath();
 if (p1 == nullptr) {
 throw BootstrapException(
 "no soffice installation found!");
 }
 rtl::OUString p2;
-if (!rtl_convertStringToUString(
+#if defined(_WIN32)
+p2 = SAL_U(p1);
+free(p1);
+#else
+bool bOk = rtl_convertStringToUString(
 , p1, std::strlen(p1), osl_getThreadTextEncoding(),
 (RTL_TEXTTOUNICODE_FLAGS_UNDEFINED_ERROR |
  RTL_TEXTTOUNICODE_FLAGS_MBUNDEFINED_ERROR |
- RTL_TEXTTOUNICODE_FLAGS_INVALID_ERROR)))
+ RTL_TEXTTOUNICODE_FLAGS_INVALID_ERROR));
+free(p1);
+if (!bOk)
 {
 throw BootstrapException(
 "bad characters in soffice installation path!");
 }
+#endif
 OUString path;
 if (osl::FileBase::getFileURLFromSystemPath(p2, path) !=
 osl::FileBase::E_None)
diff --git a/cppuhelper/source/findsofficepath.c 
b/cppuhelper/source/findsofficepath.c
index 2a45f884ed71..f91f753c61eb 100644
--- a/cppuhelper/source/findsofficepath.c
+++ b/cppuhelper/source/findsofficepath.c
@@ -39,36 +39,42 @@
  * @return the installation path or NULL, if no installation was found or
  * if an error occurred
  */
-static char* getPathFromRegistryKey( HKEY hroot, const char* subKeyName )
+static wchar_t* getPathFromRegistryKey( HKEY hroot, const wchar_t* subKeyName )
 {
 HKEY hkey;
 DWORD type;
-char* data = NULL;
+wchar_t* data = NULL;
 DWORD size;
 
 /* open the specified registry key */
-if ( RegOpenKeyEx( hroot, subKeyName, 0, KEY_READ,  ) != 
ERROR_SUCCESS )
+if ( RegOpenKeyExW( hroot, subKeyName, 0, KEY_READ,  ) != 
ERROR_SUCCESS )
 {
 return NULL;
 }
 
 /* find the type and size of the default value */
-if ( RegQueryValueEx( hkey, NULL, NULL, , NULL, ) != 
ERROR_SUCCESS )
+if ( RegQueryValueExW( hkey, NULL, NULL, , NULL, ) != 
ERROR_SUCCESS )
 {
 RegCloseKey( hkey );
 return NULL;
 }
 
 /* get memory to hold the default value */
-data = (char*) malloc( size );
+data = (wchar_t*) malloc( size + sizeof(wchar_t) );
 
 /* read the default value */
-if ( RegQueryValueEx( hkey, NULL, NULL, , (LPBYTE) data,  ) != 
ERROR_SUCCESS )
+if ( RegQueryValueExW( hkey, NULL, NULL, , (LPBYTE) data,  ) != 
ERROR_SUCCESS )
 {
 RegCloseKey( hkey );
+free( data );
 return NULL;
 }
 
+// According to https://msdn.microsoft.com/en-us/ms724911, If the data has 
the REG_SZ,
+// REG_MULTI_SZ or REG_EXPAND_SZ type, the string may not have been stored 
with the
+// proper terminating null characters
+data[size / sizeof(wchar_t)] = 0;
+
 /* release registry key handle */
 RegCloseKey( hkey );
 
@@ -81,14 +87,22 @@ static char* getPathFromRegistryKey( HKEY hroot, const 
char* subKeyName )
  * @return the installation path or NULL, if no installation was found or
  * if an error occurred
  */
-static char* platformSpecific()
+static wchar_t* platformSpecific()
 {
-const char* SUBKEYNAME = "Software\\LibreOffice\\UNO\\InstallPath";
+const wchar_t* UNOPATHVARNAME = L"UNO_PATH";
 
-char* path = NULL;
+/* get the installation path from the UNO_PATH environment variable */
+wchar_t* env = _wgetenv(UNOPATHVARNAME);
+

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

2017-06-20 Thread brainbreaker
 cppuhelper/source/paths.cxx |3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

New commits:
commit a6a447b08dd3959747181fe5350db68acc8c7481
Author: brainbreaker 
Date:   Tue Jun 20 15:50:21 2017 +0530

android:Supress the Clang's unneeded-internal-declaration warning

Change-Id: I76359e98a41206f914c3c05149f0a7eeeff1acc8
Reviewed-on: https://gerrit.libreoffice.org/39007
Tested-by: Jenkins 
Reviewed-by: Miklos Vajna 

diff --git a/cppuhelper/source/paths.cxx b/cppuhelper/source/paths.cxx
index f96044bd3c24..7add3ac72de7 100644
--- a/cppuhelper/source/paths.cxx
+++ b/cppuhelper/source/paths.cxx
@@ -36,6 +36,7 @@
 
 namespace {
 
+#ifndef ANDROID
 rtl::OUString get_this_libpath() {
 static rtl::OUString s_uri;
 if (s_uri.isEmpty()) {
@@ -55,7 +56,7 @@ rtl::OUString get_this_libpath() {
 }
 return s_uri;
 }
-
+#endif
 }
 
 rtl::OUString cppu::getUnoIniUri() {
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: cppuhelper/source cui/source editeng/source extensions/source include/com include/comphelper include/cppuhelper include/editeng include/osl include/rtl include/sal incl

2017-06-06 Thread Caolán McNamara
 cppuhelper/source/weak.cxx|2 -
 cui/source/options/optgdlg.cxx|4 +--
 editeng/source/uno/unoedsrc.cxx   |2 -
 extensions/source/propctrlr/composeduiupdate.hxx  |2 -
 include/com/sun/star/uno/Reference.h  |2 -
 include/com/sun/star/uno/Reference.hxx|3 --
 include/comphelper/componentbase.hxx  |2 -
 include/cppuhelper/weak.hxx   |2 -
 include/editeng/unoedsrc.hxx  |2 -
 include/osl/thread.hxx|2 -
 include/rtl/ref.hxx   |2 -
 include/sal/types.h   |   10 

 include/salhelper/simplereferenceobject.hxx   |2 -
 include/svl/SfxBroadcaster.hxx|2 -
 include/svl/hint.hxx  |2 -
 include/svl/listener.hxx  |2 -
 include/svl/lstner.hxx|2 -
 include/svl/undo.hxx  |2 -
 include/svx/sdr/contact/objectcontact.hxx |2 -
 include/tools/ref.hxx |5 +++-
 include/vcl/scheduler.hxx |2 -
 sal/rtl/ustring.cxx   |   12 
++
 sc/inc/colcontainer.hxx   |2 -
 sc/inc/colorscale.hxx |2 -
 sc/inc/column.hxx |4 +--
 sc/inc/table.hxx  |2 -
 sc/qa/unit/helper/sorthelper.hxx  |2 -
 sc/source/core/data/colcontainer.cxx  |2 -
 sc/source/core/data/colorscale.cxx|2 -
 sc/source/core/data/column.cxx|2 -
 sc/source/core/data/documen8.cxx  |2 -
 sc/source/core/data/table1.cxx|2 -
 sc/source/core/inc/bcaslot.hxx|2 -
 sc/source/core/tool/scmatrix.cxx  |4 +--
 sc/source/ui/docshell/docsh.cxx   |2 -
 sc/source/ui/docshell/impex.cxx   |2 -
 sc/source/ui/inc/docsh.hxx|2 -
 sc/source/ui/inc/impex.hxx|2 -
 sc/source/ui/inc/viewdata.hxx |2 -
 sc/source/ui/unoobj/funcuno.cxx   |4 +--
 sc/source/ui/view/viewdata.cxx|2 -
 sd/source/ui/inc/OutlineView.hxx  |2 -
 sd/source/ui/inc/ToolBarManager.hxx   |2 -
 sd/source/ui/inc/ViewShellManager.hxx |2 -
 sd/source/ui/slidesorter/controller/SlideSorterController.cxx |2 -
 sd/source/ui/slidesorter/controller/SlsDragAndDropContext.cxx |2 -
 sd/source/ui/slidesorter/controller/SlsDragAndDropContext.hxx |2 -
 sd/source/ui/slidesorter/controller/SlsSelectionFunction.cxx  |4 +--
 sd/source/ui/slidesorter/inc/controller/SlideSorterController.hxx |2 -
 sd/source/ui/view/ViewShellManager.cxx|6 ++---
 sd/source/ui/view/outlview.cxx|2 -
 svl/source/notify/SfxBroadcaster.cxx  |2 -
 svl/source/notify/hint.cxx|2 -
 svl/source/notify/listener.cxx|2 -
 svl/source/notify/lstner.cxx  |2 -
 svl/source/undo/undo.cxx  |2 -
 svx/source/sdr/contact/objectcontact.cxx  |2 -
 sw/inc/calbck.hxx |2 -
 sw/inc/editsh.hxx |4 +--
 sw/inc/ndole.hxx  |2 -
 sw/inc/ring.hxx   |2 -
 sw/inc/unobaseclass.hxx   |2 -
 sw/inc/unochart.hxx   |2 -
 sw/source/core/edit/edws.cxx  |4 +--
 sw/source/core/inc/frmtool.hxx|2 -
 

[Libreoffice-commits] core.git: cppuhelper/source dbaccess/source forms/source fpicker/source framework/source include/LibreOfficeKit include/osl

2017-06-01 Thread Andrea Gelmini
 cppuhelper/source/propshlp.cxx|2 +-
 dbaccess/source/ui/querydesign/QueryTableView.cxx |2 +-
 forms/source/xforms/model_ui.cxx  |2 +-
 fpicker/source/win32/folderpicker/MtaFop.cxx  |2 +-
 framework/source/jobs/jobdata.cxx |2 +-
 framework/source/uielement/menubarmanager.cxx |2 +-
 include/LibreOfficeKit/LibreOfficeKitInit.h   |2 +-
 include/osl/conditn.hxx   |2 +-
 8 files changed, 8 insertions(+), 8 deletions(-)

New commits:
commit 1d857ca26f60449ef325acd0aac40c11dded128e
Author: Andrea Gelmini 
Date:   Thu Jun 1 10:42:42 2017 +0200

Fix typos

Change-Id: I3cd50e374c45bc1c400b24c8fffd6d8f5cd1de56
Reviewed-on: https://gerrit.libreoffice.org/38208
Reviewed-by: Julien Nabet 
Tested-by: Julien Nabet 

diff --git a/cppuhelper/source/propshlp.cxx b/cppuhelper/source/propshlp.cxx
index 14a1cb45a077..b8bb9cd737ba 100644
--- a/cppuhelper/source/propshlp.cxx
+++ b/cppuhelper/source/propshlp.cxx
@@ -467,7 +467,7 @@ void OPropertySetHelper::setDependentFastPropertyValue( 
sal_Int32 i_handle, cons
 catch (const RuntimeException& ){ throw;/* allowed to 
leave */ }
 catch (const Exception& )
 {
-// not allowed to leave this meathod
+// not allowed to leave this method
 WrappedTargetException aWrapped;
 aWrapped.TargetException = ::cppu::getCaughtException();
 aWrapped.Context = static_cast< XPropertySet* >( this );
diff --git a/dbaccess/source/ui/querydesign/QueryTableView.cxx 
b/dbaccess/source/ui/querydesign/QueryTableView.cxx
index f96a49e61852..ce4ac928d7c8 100644
--- a/dbaccess/source/ui/querydesign/QueryTableView.cxx
+++ b/dbaccess/source/ui/querydesign/QueryTableView.cxx
@@ -215,7 +215,7 @@ namespace
 // don't create an Undo-Action for the new connection : the 
connection is
 // covered by the Undo-Action for the tabwin, as the "Undo the 
insert" will
 // automatically remove all connections adjacent to the win.
-// (Because of this automatism we would have an ownerhsip 
ambiguity for
+// (Because of this automatism we would have an ownership 
ambiguity for
 // the connection data if we would insert the conn-Undo-Action)
 }
 }
diff --git a/forms/source/xforms/model_ui.cxx b/forms/source/xforms/model_ui.cxx
index b487f8680667..c66bdfe99d3d 100644
--- a/forms/source/xforms/model_ui.cxx
+++ b/forms/source/xforms/model_ui.cxx
@@ -366,7 +366,7 @@ Model::XPropertySet_t Model::cloneBindingAsGhost( const 
XPropertySet_t 
 // Create a new binding instance first...
 Binding *pBinding = new Binding();
 
-// ...and bump up the "defered notification counter"
+// ...and bump up the "deferred notification counter"
 // to prevent this binding from contributing to the
 // MIPs table...
 pBinding->deferNotifications(true);
diff --git a/fpicker/source/win32/folderpicker/MtaFop.cxx 
b/fpicker/source/win32/folderpicker/MtaFop.cxx
index 3bee561b9304..43908c947020 100644
--- a/fpicker/source/win32/folderpicker/MtaFop.cxx
+++ b/fpicker/source/win32/folderpicker/MtaFop.cxx
@@ -280,7 +280,7 @@ bool CMtaFolderPicker::browseForFolder( )
 // dispatching all messages but we expect to
 // receive only paint or timer messages that's
 // why we don't need to call TranslateMessage or
-// TranslateAccelerator, because keybord or
+// TranslateAccelerator, because keyboard or
 // mouse messages are for the FolderPicker which
 // is in the foreground and should not arrive here
 MSG msg;
diff --git a/framework/source/jobs/jobdata.cxx 
b/framework/source/jobs/jobdata.cxx
index 05f14cb0427b..8555605a3673 100644
--- a/framework/source/jobs/jobdata.cxx
+++ b/framework/source/jobs/jobdata.cxx
@@ -264,7 +264,7 @@ void JobData::setJobConfig( const std::vector< 
css::beans::NamedValue >& lArgume
 }
 
 /**
-@short  set a new excution result
+@short  set a new execution result
 @descr  Every executed job can have returned a result.
 We set it here, so our user can use it may be later.
 But the outside code can use it too, to analyze it and
diff --git a/framework/source/uielement/menubarmanager.cxx 
b/framework/source/uielement/menubarmanager.cxx
index 0f7795088ddf..4b6a35d1afcc 100644
--- a/framework/source/uielement/menubarmanager.cxx
+++ b/framework/source/uielement/menubarmanager.cxx
@@ -189,7 +189,7 @@ void MenuBarManager::Destroy()
 if ( !rBHelper.bDisposed )
 {
 // stop asynchronous settings timer and
-// release defered item container reference
+// release deferred item container reference
 

[Libreoffice-commits] core.git: cppuhelper/source extensions/source svtools/source

2017-02-08 Thread Stephan Bergmann
 cppuhelper/source/typemanager.cxx  |   32 +-
 extensions/source/logging/loggerconfig.cxx |   10 +--
 svtools/source/config/colorcfg.cxx |   92 ++---
 3 files changed, 68 insertions(+), 66 deletions(-)

New commits:
commit 3b53a4cdb57667b0c7495ad6aef19312edba2d5d
Author: Stephan Bergmann 
Date:   Wed Feb 8 11:10:30 2017 +0100

Blind fix for apparently buggy GCC 4.8

cf. 

Change-Id: If947e338be0ab17f41f74f8e70e6281f46a7f57c

diff --git a/cppuhelper/source/typemanager.cxx 
b/cppuhelper/source/typemanager.cxx
index 123a4fa..44bf14e 100644
--- a/cppuhelper/source/typemanager.cxx
+++ b/cppuhelper/source/typemanager.cxx
@@ -1815,21 +1815,23 @@ css::uno::Any 
cppuhelper::TypeManager::find(rtl::OUString const & name) {
 css::uno::TypeClass typeClass;
 };
 static Simple const simple[] = {
-{ "void", css::uno::TypeClass_VOID },
-{ "boolean", css::uno::TypeClass_BOOLEAN },
-{ "byte", css::uno::TypeClass_BYTE },
-{ "short", css::uno::TypeClass_SHORT },
-{ "unsigned short", css::uno::TypeClass_UNSIGNED_SHORT },
-{ "long", css::uno::TypeClass_LONG },
-{ "unsigned long", css::uno::TypeClass_UNSIGNED_LONG },
-{ "hyper", css::uno::TypeClass_HYPER },
-{ "unsigned hyper", css::uno::TypeClass_UNSIGNED_HYPER },
-{ "float", css::uno::TypeClass_FLOAT },
-{ "double", css::uno::TypeClass_DOUBLE },
-{ "char", css::uno::TypeClass_CHAR },
-{ "string", css::uno::TypeClass_STRING },
-{ "type", css::uno::TypeClass_TYPE },
-{ "any", css::uno::TypeClass_ANY } };
+{ OUStringLiteral("void"), css::uno::TypeClass_VOID },
+{ OUStringLiteral("boolean"), css::uno::TypeClass_BOOLEAN },
+{ OUStringLiteral("byte"), css::uno::TypeClass_BYTE },
+{ OUStringLiteral("short"), css::uno::TypeClass_SHORT },
+{ OUStringLiteral("unsigned short"),
+  css::uno::TypeClass_UNSIGNED_SHORT },
+{ OUStringLiteral("long"), css::uno::TypeClass_LONG },
+{ OUStringLiteral("unsigned long"), css::uno::TypeClass_UNSIGNED_LONG 
},
+{ OUStringLiteral("hyper"), css::uno::TypeClass_HYPER },
+{ OUStringLiteral("unsigned hyper"),
+  css::uno::TypeClass_UNSIGNED_HYPER },
+{ OUStringLiteral("float"), css::uno::TypeClass_FLOAT },
+{ OUStringLiteral("double"), css::uno::TypeClass_DOUBLE },
+{ OUStringLiteral("char"), css::uno::TypeClass_CHAR },
+{ OUStringLiteral("string"), css::uno::TypeClass_STRING },
+{ OUStringLiteral("type"), css::uno::TypeClass_TYPE },
+{ OUStringLiteral("any"), css::uno::TypeClass_ANY } };
 for (std::size_t i = 0; i != SAL_N_ELEMENTS(simple); ++i) {
 if (name == simple[i].name) {
 return css::uno::makeAny<
diff --git a/extensions/source/logging/loggerconfig.cxx 
b/extensions/source/logging/loggerconfig.cxx
index 8bb8fdb..1d19389 100644
--- a/extensions/source/logging/loggerconfig.cxx
+++ b/extensions/source/logging/loggerconfig.cxx
@@ -123,11 +123,11 @@ namespace logging
 
 Variable const aVariables[] =
 {
-{"$(loggername)", sLoggerName},
-{"$(date)", sDate},
-{"$(time)", sTime},
-{"$(datetime)", sDateTime},
-{"$(pid)", aPID}
+{OUStringLiteral("$(loggername)"), sLoggerName},
+{OUStringLiteral("$(date)"), sDate},
+{OUStringLiteral("$(time)"), sTime},
+{OUStringLiteral("$(datetime)"), sDateTime},
+{OUStringLiteral("$(pid)"), aPID}
 };
 
 for (Variable const & aVariable : aVariables)
diff --git a/svtools/source/config/colorcfg.cxx 
b/svtools/source/config/colorcfg.cxx
index 86ff2ce..73a7339 100644
--- a/svtools/source/config/colorcfg.cxx
+++ b/svtools/source/config/colorcfg.cxx
@@ -113,52 +113,52 @@ uno::Sequence< OUString> GetPropertyNames(const OUString& 
rScheme)
 };
 static const ColorConfigEntryData_Impl cNames[] =
 {
-{ "/DocColor",false },
-{ "/DocBoundaries"   ,true },
-{ "/AppBackground"   ,false },
-{ "/ObjectBoundaries",true },
-{ "/TableBoundaries" ,true },
-{ "/FontColor" ,false },
-{ "/Links"   ,true },
-{ "/LinksVisited",true },
-{ "/Spell" ,false },
-{ "/SmartTags" ,false },
-{ "/Shadow", true },
-{ "/WriterTextGrid"  ,false },
-{ "/WriterFieldShadings",true },
-{ "/WriterIdxShadings" ,true },
-{ "/WriterDirectCursor",true },
-{ "/WriterScriptIndicator",false },
-{ "/WriterSectionBoundaries",true },
-{ "/WriterHeaderFooterMark",false },
-{ "/WriterPageBreaks",false },
-

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

2017-01-17 Thread Stephan Bergmann
 cppuhelper/source/shlib.cxx |4 
 1 file changed, 4 insertions(+)

New commits:
commit cbc0b5e1f322418f190c1faa056be87f762d4f4b
Author: Stephan Bergmann 
Date:   Wed Jan 18 08:39:37 2017 +0100

-Werror=unused-function (DISABLE_DYNLOADING)

Change-Id: I2d70946423c6b1fe56d1630d6982e91bd5c7d81a

diff --git a/cppuhelper/source/shlib.cxx b/cppuhelper/source/shlib.cxx
index fa88cc4..e3791ac 100644
--- a/cppuhelper/source/shlib.cxx
+++ b/cppuhelper/source/shlib.cxx
@@ -160,6 +160,8 @@ css::uno::Reference 
invokeComponentFactory(
 }
 }
 
+#if !defined DISABLE_DYNLOADING
+
 extern "C" void getInstance(va_list * args) {
 cppuhelper::ImplementationConstructorFn * fn = va_arg(*args, 
cppuhelper::ImplementationConstructorFn *);
 void * ctxt = va_arg(*args, void *);
@@ -224,6 +226,8 @@ cppuhelper::WrapperConstructorFn mapConstructorFn(
 }
 }
 
+#endif
+
 }
 
 void cppuhelper::detail::loadSharedLibComponentFactory(
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2017-01-17 Thread Michael Stahl
 cppuhelper/source/loadsharedlibcomponentfactory.hxx |2 
 cppuhelper/source/servicemanager.cxx|   45 ---
 cppuhelper/source/servicemanager.hxx|4 -
 cppuhelper/source/shlib.cxx |   77 ++--
 4 files changed, 94 insertions(+), 34 deletions(-)

New commits:
commit 6ef033669762a0c7ce70c111458437d5e727a4ae
Author: Michael Stahl 
Date:   Fri Jan 13 23:40:51 2017 +0100

cppuhelper: implement environment mapping for constructor functions

ae3a0c8da50b36db395984637f5ad74d3b4887bc unfortunately forgot to
implement mapping between UNO environments for constructor functions
in the UNO service manager, and due to the many componennt conversions
to constructor functions since then, the log UNO purpose environment
has become mostly useless.

Save the environment, create a closure today!

https://wiki.openoffice.org/wiki/Uno/Spec/Log_Environment

Change-Id: Idc03b5ed9529da8e81cd91efe50cbeceffa2b247
Reviewed-on: https://gerrit.libreoffice.org/33060
Tested-by: Jenkins 
Reviewed-by: Michael Stahl 

diff --git a/cppuhelper/source/loadsharedlibcomponentfactory.hxx 
b/cppuhelper/source/loadsharedlibcomponentfactory.hxx
index 7062d86..df6e226 100644
--- a/cppuhelper/source/loadsharedlibcomponentfactory.hxx
+++ b/cppuhelper/source/loadsharedlibcomponentfactory.hxx
@@ -35,7 +35,7 @@ void loadSharedLibComponentFactory(
 rtl::OUString const & prefix, rtl::OUString const & implementation,
 rtl::OUString const & constructor,
 css::uno::Reference const & 
serviceManager,
-ImplementationConstructorFn ** constructorFunction,
+WrapperConstructorFn * constructorFunction,
 css::uno::Reference * factory);
 
 } }
diff --git a/cppuhelper/source/servicemanager.cxx 
b/cppuhelper/source/servicemanager.cxx
index 780fe02..6d2321c 100644
--- a/cppuhelper/source/servicemanager.cxx
+++ b/cppuhelper/source/servicemanager.cxx
@@ -686,9 +686,9 @@ 
cppuhelper::ServiceManager::Data::Implementation::createInstance(
 bool singletonRequest)
 {
 css::uno::Reference inst;
-if (constructor != nullptr) {
+if (constructor) {
 inst.set(
-(*constructor)(context.get(), css::uno::Sequence()),
+constructor(context.get(), css::uno::Sequence()),
 SAL_NO_ACQUIRE);
 } else if (factory1.is()) {
 inst = factory1->createInstanceWithContext(context);
@@ -706,8 +706,8 @@ 
cppuhelper::ServiceManager::Data::Implementation::createInstanceWithArguments(
 bool singletonRequest, css::uno::Sequence const & arguments)
 {
 css::uno::Reference inst;
-if (constructor != nullptr) {
-inst.set((*constructor)(context.get(), arguments), SAL_NO_ACQUIRE);
+if (constructor) {
+inst.set(constructor(context.get(), arguments), SAL_NO_ACQUIRE);
 //HACK: The constructor will either observe arguments and return inst
 // that does not implement XInitialization (or null), or ignore
 // arguments and return inst that implements XInitialization; this
@@ -797,7 +797,7 @@ void cppuhelper::ServiceManager::loadImplementation(
 "Cannot expand URI" + implementation->info->uri + ": " + e.Message,
 static_cast< cppu::OWeakObject * >(this));
 }
-cppuhelper::ImplementationConstructorFn * ctor = nullptr;
+cppuhelper::WrapperConstructorFn ctor;
 css::uno::Reference< css::uno::XInterface > f0;
 // Special handling of SharedLibrary loader, with support for environment,
 // constructor, and prefix arguments:
@@ -808,27 +808,8 @@ void cppuhelper::ServiceManager::loadImplementation(
 uri, implementation->info->environment,
 implementation->info->prefix, implementation->info->name,
 implementation->info->constructor, this, , );
-if (ctor != nullptr) {
+if (ctor) {
 assert(!implementation->info->environment.isEmpty());
-css::uno::Environment curEnv(css::uno::Environment::getCurrent());
-if (!curEnv.is()) {
-throw css::uno::DeploymentException(
-"cannot get current environment",
-css::uno::Reference());
-}
-css::uno::Environment env(
-cppuhelper::detail::getEnvironment(
-implementation->info->environment,
-implementation->info->name));
-if (!env.is()) {
-throw css::uno::DeploymentException(
-("cannot get environment "
- + implementation->info->environment),
-css::uno::Reference());
-}
-if (curEnv.get() != env.get()) {
-std::abort();//TODO
-}
 }
 } else {
 SAL_WARN_IF(
@@ -864,7 +845,7 @@ void cppuhelper::ServiceManager::loadImplementation(
  

[Libreoffice-commits] core.git: cppuhelper/source cui/source

2016-11-02 Thread Stephan Bergmann
 cppuhelper/source/servicemanager.cxx |   10 --
 cui/source/dialogs/scriptdlg.cxx |   28 +++-
 2 files changed, 15 insertions(+), 23 deletions(-)

New commits:
commit d2615f96acf1030ea888b2f24a9c5bf4db0d9f0e
Author: Stephan Bergmann 
Date:   Wed Nov 2 10:33:49 2016 +0100

Improve some error reporting

Change-Id: Ibfdb0eeebec785438d46a0e8e6e9f4c847bfb807

diff --git a/cppuhelper/source/servicemanager.cxx 
b/cppuhelper/source/servicemanager.cxx
index a4267f9..f2c1a4c 100644
--- a/cppuhelper/source/servicemanager.cxx
+++ b/cppuhelper/source/servicemanager.cxx
@@ -812,13 +812,19 @@ void cppuhelper::ServiceManager::loadImplementation(
 if (ctor != nullptr) {
 assert(!implementation->info->environment.isEmpty());
 css::uno::Environment curEnv(css::uno::Environment::getCurrent());
+if (!curEnv.is()) {
+throw css::uno::DeploymentException(
+"cannot get current environment",
+css::uno::Reference());
+}
 css::uno::Environment env(
 cppuhelper::detail::getEnvironment(
 implementation->info->environment,
 implementation->info->name));
-if (!(curEnv.is() && env.is())) {
+if (!env.is()) {
 throw css::uno::DeploymentException(
-"cannot get environments",
+("cannot get environment "
+ + implementation->info->environment),
 css::uno::Reference());
 }
 if (curEnv.get() != env.get()) {
diff --git a/cui/source/dialogs/scriptdlg.cxx b/cui/source/dialogs/scriptdlg.cxx
index a737b9e..11ef281 100644
--- a/cui/source/dialogs/scriptdlg.cxx
+++ b/cui/source/dialogs/scriptdlg.cxx
@@ -1205,6 +1205,8 @@ void SvxScriptOrgDialog::RestorePreviousSelection()
 m_pScriptsBox->SetCurEntry( pEntry );
 }
 
+namespace {
+
 OUString ReplaceString(
 const OUString& source,
 const OUString& token,
@@ -1368,21 +1370,6 @@ OUString GetErrorMessage(
 unformatted, language, script, OUString(), OUString(), message );
 }
 
-OUString GetErrorMessage( const RuntimeException& re )
-{
-Type t = cppu::UnoType::get();
-OUString message = t.getTypeName() + re.Message;
-
-return message;
-}
-
-OUString GetErrorMessage( const Exception& e )
-{
-Type t = cppu::UnoType::get();
-OUString message = t.getTypeName() + e.Message;
-return message;
-}
-
 OUString GetErrorMessage( const css::uno::Any& aException )
 {
 if ( aException.getValueType() ==
@@ -1420,15 +1407,14 @@ OUString GetErrorMessage( const css::uno::Any& 
aException )
 
 }
 // unknown exception
+auto msg = aException.getValueTypeName();
 Exception e;
-RuntimeException rte;
-if ( aException >>= rte )
+if ( (aException >>= e) && !e.Message.isEmpty() )
 {
-return GetErrorMessage( rte );
+msg += ": " + e.Message;
 }
-
-aException >>= e;
-return GetErrorMessage( e );
+return msg;
+}
 
 }
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: cppuhelper/source include/cppuhelper

2016-09-19 Thread Stephan Bergmann
 cppuhelper/source/gcc3.map |5 +
 cppuhelper/source/weak.cxx |   10 ++
 include/cppuhelper/weakref.hxx |9 +
 3 files changed, 24 insertions(+)

New commits:
commit 4f86b7a86cae630c19f6f0d1b4d6672c25e2eb3c
Author: Stephan Bergmann 
Date:   Mon Sep 19 12:40:51 2016 +0200

cid#1371142: Move semantics for css::uno::WeakReferenceHelper

Change-Id: I442b2d8061bd7d50cbf832b345a7a63461e26224

diff --git a/cppuhelper/source/gcc3.map b/cppuhelper/source/gcc3.map
index 12c29834a..f1537e8 100644
--- a/cppuhelper/source/gcc3.map
+++ b/cppuhelper/source/gcc3.map
@@ -430,6 +430,11 @@ global:
 
_ZN4cppu15supportsServiceEPN3com3sun4star4lang12XServiceInfoERKN3rtl8OUStringE; 
# cppu::supportsService(com::sun::star::lang::XServiceInfo*, rtl::OUString 
const&)
 } UDK_3.8;
 
+LIBO_UDK_5.3 { # LibO 5.3
+global:
+_ZN3com3sun4star3uno19WeakReferenceHelperaSEOS3_; # 
com::sun::star::uno::WeakReferenceHelper::operator=(com::sun::star::uno::WeakReferenceHelper&&)
+} LIBO_UDK_3.9;
+
 # Unique libstdc++ symbols:
 GLIBCXX_3.4 {
 global:
diff --git a/cppuhelper/source/weak.cxx b/cppuhelper/source/weak.cxx
index 1c9b57c..9a3a8ba 100644
--- a/cppuhelper/source/weak.cxx
+++ b/cppuhelper/source/weak.cxx
@@ -24,7 +24,9 @@
 #include 
 #include 
 #include 
+
 #include 
+#include 
 
 using namespace osl;
 using namespace com::sun::star::uno;
@@ -485,6 +487,14 @@ WeakReferenceHelper& WeakReferenceHelper::operator=(const 
WeakReferenceHelper& r
 return operator = ( xInt );
 }
 
+WeakReferenceHelper & WeakReferenceHelper::operator =(
+WeakReferenceHelper && other)
+{
+clear();
+std::swap(m_pImpl, other.m_pImpl);
+return *this;
+}
+
 WeakReferenceHelper & SAL_CALL
 WeakReferenceHelper::operator= (const Reference< XInterface > & xInt)
 {
diff --git a/include/cppuhelper/weakref.hxx b/include/cppuhelper/weakref.hxx
index 11095b7..250bb81 100644
--- a/include/cppuhelper/weakref.hxx
+++ b/include/cppuhelper/weakref.hxx
@@ -63,6 +63,11 @@ public:
 */
 WeakReferenceHelper( const WeakReferenceHelper & rWeakRef );
 
+#if defined LIBO_INTERNAL_ONLY
+WeakReferenceHelper(WeakReferenceHelper && other): m_pImpl(other.m_pImpl)
+{ other.m_pImpl = nullptr; }
+#endif
+
 /** Initialize this reference with the hard interface reference xInt. If 
the implementation
 behind xInt does not support XWeak or xInt is null then this reference 
will be null.
 
@@ -80,6 +85,10 @@ public:
 */
 WeakReferenceHelper & SAL_CALL operator = ( const WeakReferenceHelper & 
rWeakRef );
 
+#if defined LIBO_INTERNAL_ONLY
+WeakReferenceHelper & operator =(WeakReferenceHelper && other);
+#endif
+
 /** Releases this reference and takes over hard reference xInt.
 If the implementation behind xInt does not support XWeak
 or XInt is null, then this reference is null.
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2016-07-11 Thread Stephan Bergmann
 cppuhelper/source/shlib.cxx |5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

New commits:
commit d1c0a77ed1ba96b29e9b260b9ea1696634a9a094
Author: Stephan Bergmann 
Date:   Mon Jul 11 17:26:59 2016 +0200

getFactory only called with nullptr "key" argument

Change-Id: I5148e1902cb3c1d2bb87b623dfd843ccadf6c430

diff --git a/cppuhelper/source/shlib.cxx b/cppuhelper/source/shlib.cxx
index 7e334e7..0cffab6 100644
--- a/cppuhelper/source/shlib.cxx
+++ b/cppuhelper/source/shlib.cxx
@@ -105,9 +105,8 @@ extern "C" void getFactory(va_list * args) {
 component_getFactoryFunc fn = va_arg(*args, component_getFactoryFunc);
 rtl::OString const * implementation = va_arg(*args, rtl::OString const *);
 void * smgr = va_arg(*args, void *);
-void * key = va_arg(*args, void *);
 void ** factory = va_arg(*args, void **);
-*factory = (*fn)(implementation->getStr(), smgr, key);
+*factory = (*fn)(implementation->getStr(), smgr, nullptr);
 }
 
 css::uno::Reference invokeComponentFactory(
@@ -140,7 +139,7 @@ css::uno::Reference 
invokeComponentFactory(
 serviceManager.get(),
 cppu::UnoType::get());
 void * factory = nullptr;
-target.invoke(getFactory, function, , smgr, 0, );
+target.invoke(getFactory, function, , smgr, );
 if (smgr != nullptr) {
 (*target.get()->pExtEnv->releaseInterface)(
 target.get()->pExtEnv, smgr);
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2016-06-17 Thread Michael Stahl
 cppuhelper/source/weak.cxx |3 +++
 1 file changed, 3 insertions(+)

New commits:
commit 131e604073f89e6c1dd54be88b94b7befd881f2e
Author: Michael Stahl 
Date:   Fri Jun 17 21:58:09 2016 +0200

cppuhelper: fix use-after-free race in OWeakConnectionPoint

OWeakObject::m_pWeakConnectionPoint is returned from
OWeakObject::queryAdapter(), and stored in
OWeakRefListener::m_xWeakConnectionPoint.

This is cleared in OWeakRefListener::dispose(), called from
OWeakConnectionPoint::dispose(), called from
OWeakObject::disposeWeakConnectionPoint(), but it can happen that
another thread is in WeakReferenceHelper::get() and has copied
m_xWeakConnectionPoint onto the stack before the OWeakObject is
released and deleted, then calls OWeakConnectionPoint::queryAdapted()
after it is released, accessing the dead m_pObject.

Change-Id: I7782e6fb7e07f5a48cf7064115217376714ba8e8

diff --git a/cppuhelper/source/weak.cxx b/cppuhelper/source/weak.cxx
index ed1f772..85cf3f6 100644
--- a/cppuhelper/source/weak.cxx
+++ b/cppuhelper/source/weak.cxx
@@ -111,6 +111,9 @@ void SAL_CALL OWeakConnectionPoint::dispose() 
throw(css::uno::RuntimeException)
 std::vector aCopy;
 { // only hold the mutex while we access the field
 MutexGuard aGuard(getWeakMutex());
+// OWeakObject is not the only owner of this, so clear m_pObject
+// so that queryAdapted() won't use it now that it's dead
+m_pObject = nullptr;
 // other code is going to call removeReference while we are doing 
this, so we need a
 // copy, but since we are disposing and going away, we can just take 
the original data
 aCopy.swap(m_aReferences);
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: cppuhelper/source include/cppuhelper

2016-06-17 Thread Michael Stahl
 cppuhelper/source/weak.cxx |   11 ---
 include/cppuhelper/weakref.hxx |   20 
 2 files changed, 20 insertions(+), 11 deletions(-)

New commits:
commit debe788bcf3ec258b6b95df3db1f7bfeba881be1
Author: Michael Stahl 
Date:   Fri Jun 17 13:35:08 2016 +0200

cppuhelper: WeakReference isn't thread-safe

... but its documentation claims that it is, which is partially
misleading, so fix both the documentation and the data race in
WeakReferenceHelper::clear().

This actually crashed in clear() in the multi-threaded ZipPackage code
on exporting the bugdoc from tdf#94212, presumably because clear()
races against OWeakRefListener::dispose().

Change-Id: I85665c11b8157e90d15e8263758e24e66efeb86c

diff --git a/cppuhelper/source/weak.cxx b/cppuhelper/source/weak.cxx
index b6abef5..ed1f772 100644
--- a/cppuhelper/source/weak.cxx
+++ b/cppuhelper/source/weak.cxx
@@ -34,6 +34,7 @@ namespace cppu
 {
 
 // due to static Reflection destruction from usr, there must be a mutex leak 
(#73272#)
+// this is used to lock all instances of OWeakConnectionPoint and 
OWeakRefListener as well as OWeakObject::m_pWeakConnectionPoint
 inline static Mutex & getWeakMutex()
 {
 static Mutex * s_pMutex = nullptr;
@@ -358,7 +359,7 @@ public:
 
 /// The reference counter.
 oslInterlockedCount m_aRefCount;
-/// The connection point of the weak object
+/// The connection point of the weak object, guarded by getWeakMutex()
 Reference< XAdapter >   m_XWeakConnectionPoint;
 };
 
@@ -463,12 +464,7 @@ void WeakReferenceHelper::clear()
 {
 if (m_pImpl)
 {
-if (m_pImpl->m_XWeakConnectionPoint.is())
-{
-m_pImpl->m_XWeakConnectionPoint->removeReference(
-static_cast(m_pImpl));
-m_pImpl->m_XWeakConnectionPoint.clear();
-}
+m_pImpl->dispose();
 m_pImpl->release();
 m_pImpl = nullptr;
 }
@@ -513,6 +509,7 @@ Reference< XInterface > WeakReferenceHelper::get() const
 {
 Reference< XAdapter > xAdp;
 {
+// must lock to access m_XWeakConnectionPoint
 MutexGuard guard(cppu::getWeakMutex());
 if( m_pImpl && m_pImpl->m_XWeakConnectionPoint.is() )
 xAdp = m_pImpl->m_XWeakConnectionPoint;
diff --git a/include/cppuhelper/weakref.hxx b/include/cppuhelper/weakref.hxx
index 7836494..9cd422b 100644
--- a/include/cppuhelper/weakref.hxx
+++ b/include/cppuhelper/weakref.hxx
@@ -39,8 +39,14 @@ namespace uno
 
 class OWeakRefListener;
 
-/** The WeakReferenceHelper holds a weak reference to an object. This object 
must implement
-the css::uno::XWeak interface.  The implementation is thread safe.
+/** The WeakReferenceHelper holds a weak reference to an object.
+
+This object must implement the css::uno::XWeak interface.
+
+The WeakReferenceHelper itself is *not* thread safe, just as
+Reference itself isn't, but the implementation of the listeners etc.
+behind it *is* thread-safe, so multiple threads can have their own
+WeakReferences to the same XWeak object.
 */
 class CPPUHELPER_DLLPUBLIC WeakReferenceHelper
 {
@@ -116,8 +122,14 @@ protected:
 /// @endcond
 };
 
-/** The WeakReference<> holds a weak reference to an object. This object must 
implement
-the css::uno::XWeak interface.  The implementation is thread safe.
+/** The WeakReference<> holds a weak reference to an object.
+
+This object must implement the css::uno::XWeak interface.
+
+The WeakReference itself is *not* thread safe, just as
+Reference itself isn't, but the implementation of the listeners etc.
+behind it *is* thread-safe, so multiple threads can have their own
+WeakReferences to the same XWeak object.
 
 @tparam interface_type type of interface
 */
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


  1   2   >