[Libreoffice-commits] core.git: include/comphelper xmloff/qa

2023-11-15 Thread Miklos Vajna (via logerrit)
 include/comphelper/sequenceashashmap.hxx |5 +
 xmloff/qa/unit/text.cxx  |8 
 2 files changed, 9 insertions(+), 4 deletions(-)

New commits:
commit 06e3877dc2cf22e00d04b48453e9ab0b948c3ca2
Author: Miklos Vajna 
AuthorDate: Wed Nov 15 20:08:48 2023 +0100
Commit: Miklos Vajna 
CommitDate: Thu Nov 16 08:31:08 2023 +0100

comphelper: use c++20 contains() instead of find() and end()

Whether an element is contained inside a container is better to be
checked with contains() instead of find() because contains() conveys the
intent more clearly.

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

diff --git a/include/comphelper/sequenceashashmap.hxx 
b/include/comphelper/sequenceashashmap.hxx
index 59ab4c298d76..f5af2e28de50 100644
--- a/include/comphelper/sequenceashashmap.hxx
+++ b/include/comphelper/sequenceashashmap.hxx
@@ -405,6 +405,11 @@ class SAL_WARN_UNUSED COMPHELPER_DLLPUBLIC 
SequenceAsHashMap
 return m_aMap.find(rKey);
 }
 
+bool contains(const OUString& rKey)
+{
+return m_aMap.contains(rKey);
+}
+
 iterator erase(iterator it)
 {
 return m_aMap.erase(it);
diff --git a/xmloff/qa/unit/text.cxx b/xmloff/qa/unit/text.cxx
index 5188770a32ba..2a5350423c0d 100644
--- a/xmloff/qa/unit/text.cxx
+++ b/xmloff/qa/unit/text.cxx
@@ -126,7 +126,7 @@ CPPUNIT_TEST_FIXTURE(XmloffStyleTest, 
testBibliographyLocalUrl)
 uno::Reference xPortion(xPortionEnum->nextElement(), 
uno::UNO_QUERY);
 xField.set(xPortion->getPropertyValue("TextField"), uno::UNO_QUERY);
 comphelper::SequenceAsHashMap aMap(xField->getPropertyValue("Fields"));
-CPPUNIT_ASSERT(aMap.find("LocalURL") != aMap.end());
+CPPUNIT_ASSERT(aMap.contains("LocalURL"));
 auto aActual = aMap["LocalURL"].get();
 CPPUNIT_ASSERT_EQUAL(OUString("file:///home/me/test.pdf"), aActual);
 }
@@ -165,15 +165,15 @@ CPPUNIT_TEST_FIXTURE(XmloffStyleTest, 
testBibliographyTargetURL1)
 xField.set(xPortion->getPropertyValue("TextField"), uno::UNO_QUERY);
 comphelper::SequenceAsHashMap aMap(xField->getPropertyValue("Fields"));
 
-CPPUNIT_ASSERT(aMap.find("URL") != aMap.end());
+CPPUNIT_ASSERT(aMap.contains("URL"));
 CPPUNIT_ASSERT_EQUAL(OUString("https://display.url/test1.pdf#page=1;),
  aMap["URL"].get());
 
-CPPUNIT_ASSERT(aMap.find("TargetURL") != aMap.end());
+CPPUNIT_ASSERT(aMap.contains("TargetURL"));
 CPPUNIT_ASSERT_EQUAL(OUString("https://target.url/test2.pdf#page=2;),
  aMap["TargetURL"].get());
 
-CPPUNIT_ASSERT(aMap.find("TargetType") != aMap.end());
+CPPUNIT_ASSERT(aMap.contains("TargetType"));
 CPPUNIT_ASSERT_EQUAL(OUString("1"), aMap["TargetType"].get());
 }
 


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

2023-10-31 Thread Mike Kaganski (via logerrit)
 include/comphelper/windowserrorstring.hxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit b3c12778aa908a147224cc05f3384b3f57d3b394
Author: Mike Kaganski 
AuthorDate: Tue Oct 31 11:38:02 2023 +0300
Commit: Mike Kaganski 
CommitDate: Tue Oct 31 11:39:14 2023 +0100

Update an URL

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

diff --git a/include/comphelper/windowserrorstring.hxx 
b/include/comphelper/windowserrorstring.hxx
index 1b50f1eadb58..7b6bdb6db8b1 100644
--- a/include/comphelper/windowserrorstring.hxx
+++ b/include/comphelper/windowserrorstring.hxx
@@ -40,7 +40,7 @@ inline OUString WindowsErrorString(DWORD nErrorCode)
 
 inline OUString WindowsErrorStringFromHRESULT(HRESULT hr)
 {
-// See https://blogs.msdn.microsoft.com/oldnewthing/20061103-07/?p=29133
+// See https://devblogs.microsoft.com/oldnewthing/20061103-07/?p=29133
 // Also 
https://social.msdn.microsoft.com/Forums/vstudio/en-US/c33d9a4a-1077-4efd-99e8-0c222743d2f8
 // (which refers to https://msdn.microsoft.com/en-us/library/aa382475)
 // explains why can't we just reinterpret_cast HRESULT to DWORD Win32 
error:


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

2023-10-13 Thread Stephan Bergmann (via logerrit)
 include/comphelper/errcode.hxx |1 +
 1 file changed, 1 insertion(+)

New commits:
commit 113e064117b2632974a696b950634229d70c5b96
Author: Stephan Bergmann 
AuthorDate: Fri Oct 13 11:58:02 2023 +0200
Commit: Stephan Bergmann 
CommitDate: Fri Oct 13 13:29:10 2023 +0200

Make sure __cpp_lib_source_location is consistently defined

...following up on 9c5f597fc80a8a910c1f898556ef2a3226dfe40c "use
std::source_location instead of std::experimental::source_location".
__cpp_lib_source_location is defined in both  (but which 
we can
apparently not rely on here, trying to figure out whether to #include it in 
the
first place) and , so lets hope that all our toolchains support 
C++20
 by now and #include that.

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

diff --git a/include/comphelper/errcode.hxx b/include/comphelper/errcode.hxx
index 567400f101f8..662ec139164b 100644
--- a/include/comphelper/errcode.hxx
+++ b/include/comphelper/errcode.hxx
@@ -23,6 +23,7 @@
 #include 
 #include 
 #include 
+#include 
 
 #if defined(DBG_UTIL)
 #if defined(__cpp_lib_source_location) && __cpp_lib_source_location >= 201907


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

2023-10-06 Thread Caolán McNamara (via logerrit)
 include/comphelper/errcode.hxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit d852e411b52cda24f2d79070798a2fa662bb71f1
Author: Caolán McNamara 
AuthorDate: Fri Oct 6 09:38:01 2023 +0100
Commit: Caolán McNamara 
CommitDate: Fri Oct 6 15:24:27 2023 +0200

cid#1547076 Uninitialized scalar field

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

diff --git a/include/comphelper/errcode.hxx b/include/comphelper/errcode.hxx
index 6e5390b9a09b..3d3773fadf50 100644
--- a/include/comphelper/errcode.hxx
+++ b/include/comphelper/errcode.hxx
@@ -181,7 +181,7 @@ namespace o3tl
 class SAL_WARN_UNUSED ErrCodeMsg
 {
 public:
-ErrCodeMsg() : mnCode(0) {}
+ErrCodeMsg() : mnCode(0), mnDialogMask(DialogMask::NONE) {}
 #ifdef LIBO_ERRMSG_USE_SOURCE_LOCATION
 ErrCodeMsg(ErrCode code, const OUString& arg, 
std::experimental::source_location loc = 
std::experimental::source_location::current())
 : mnCode(code), maArg1(arg),  mnDialogMask(DialogMask::NONE), 
moLoc(loc) {}


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

2023-08-19 Thread Andrea Gelmini (via logerrit)
 include/comphelper/docpasswordhelper.hxx  |2 +-
 sc/source/filter/inc/querytablebuffer.hxx |2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

New commits:
commit 1d46f502498290d33dbea63df9f16b90891ec3b6
Author: Andrea Gelmini 
AuthorDate: Fri Aug 18 16:07:12 2023 +0200
Commit: Julien Nabet 
CommitDate: Sat Aug 19 11:15:25 2023 +0200

Fix typo

Change-Id: I6649e13646e4fd33dd1858f5a5a56ec0955005dd
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155841
Tested-by: Julien Nabet 
Reviewed-by: Julien Nabet 

diff --git a/include/comphelper/docpasswordhelper.hxx 
b/include/comphelper/docpasswordhelper.hxx
index 64d7ba9782ec..9d8409c3bf46 100644
--- a/include/comphelper/docpasswordhelper.hxx
+++ b/include/comphelper/docpasswordhelper.hxx
@@ -392,7 +392,7 @@ public:
 @param rMediaPassword
 If not empty, will be passed to the password validator before
 requesting a password from the user. This password usually should
-be querried from a media descriptor.
+be queried from a media descriptor.
 
 @param rxInteractHandler
 The interaction handler that will be used to request a password
diff --git a/sc/source/filter/inc/querytablebuffer.hxx 
b/sc/source/filter/inc/querytablebuffer.hxx
index 4bba7a68c83a..16410ec8cfea 100644
--- a/sc/source/filter/inc/querytablebuffer.hxx
+++ b/sc/source/filter/inc/querytablebuffer.hxx
@@ -36,7 +36,7 @@ struct QueryTableModel : public AutoFormatModel
 boolmbFirstBackground;  /// True = first background 
refresh not yet finished.
 boolmbRefreshOnLoad;/// True = refresh table after 
import.
 boolmbFillFormulas; /// True = expand formulas next to 
range when source data grows.
-boolmbRemoveDataOnSave; /// True = remove querried data 
before saving.
+boolmbRemoveDataOnSave; /// True = remove queried data 
before saving.
 boolmbDisableEdit;  /// True = connection locked for 
editing.
 boolmbPreserveFormat;   /// True = use existing formatting 
for new rows.
 boolmbAdjustColWidth;   /// True = adjust column widths 
after refresh.


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

2023-08-02 Thread Stephan Bergmann (via logerrit)
 include/comphelper/crashzone.hxx |7 +++
 1 file changed, 7 insertions(+)

New commits:
commit aaba06d2fca3264cd73093ffc048af27992bd0fb
Author: Stephan Bergmann 
AuthorDate: Wed Aug 2 17:33:27 2023 +0200
Commit: Stephan Bergmann 
CommitDate: Wed Aug 2 19:45:03 2023 +0200

Silence C++20 volatile increment deprecation warnings

...as seen with path set 2 of 

"Bump baseline to C++20",

> In file included from 
/home/tdf/lode/jenkins/workspace/android_arm/vcl/source/app/watchdog.cxx:19:
> In file included from 
/home/tdf/lode/jenkins/workspace/android_arm/vcl/inc/opengl/zone.hxx:16:
> 
/home/tdf/lode/jenkins/workspace/android_arm/include/comphelper/crashzone.hxx:59:39:
 error: increment of object of volatile-qualified type 
'CrashZone::AtomicCounter' (aka 'volatile unsigned int') is deprecated 
[-Werror,-Wdeprecated-volatile]
> static void enter() { gnEnterCount++; }
>   ^
> 
/home/tdf/lode/jenkins/workspace/android_arm/include/comphelper/crashzone.hxx:60:39:
 error: increment of object of volatile-qualified type 
'CrashZone::AtomicCounter' (aka 'volatile unsigned int') is deprecated 
[-Werror,-Wdeprecated-volatile]
> static void leave() { gnLeaveCount++; }
>   ^
> 
/home/tdf/lode/jenkins/workspace/android_arm/include/comphelper/crashzone.hxx:59:39:
 error: increment of object of volatile-qualified type 
'CrashZone::AtomicCounter' (aka 'volatile unsigned int') is deprecated 
[-Werror,-Wdeprecated-volatile]
> static void enter() { gnEnterCount++; }
>   ^
> 
/home/tdf/lode/jenkins/workspace/android_arm/include/comphelper/crashzone.hxx:54:19:
 note: in instantiation of member function 'CrashZone::enter' 
requested here
> CrashZone() { enter(); }
>   ^
> /home/tdf/lode/jenkins/workspace/android_arm/vcl/inc/skia/zone.hxx:23:5: 
note: in instantiation of member function 'CrashZone::CrashZone' 
requested here
> SkiaZone() { 
assert(comphelper::SolarMutex::get()->IsCurrentThread()); }
> ^
> In file included from 
/home/tdf/lode/jenkins/workspace/android_arm/vcl/source/app/watchdog.cxx:19:
> In file included from 
/home/tdf/lode/jenkins/workspace/android_arm/vcl/inc/opengl/zone.hxx:16:
> 
/home/tdf/lode/jenkins/workspace/android_arm/include/comphelper/crashzone.hxx:60:39:
 error: increment of object of volatile-qualified type 
'CrashZone::AtomicCounter' (aka 'volatile unsigned int') is deprecated 
[-Werror,-Wdeprecated-volatile]
> static void leave() { gnLeaveCount++; }
>   ^
> 
/home/tdf/lode/jenkins/workspace/android_arm/include/comphelper/crashzone.hxx:55:20:
 note: in instantiation of member function 'CrashZone::leave' 
requested here
> ~CrashZone() { leave(); }
>^
> /home/tdf/lode/jenkins/workspace/android_arm/vcl/inc/skia/zone.hxx:23:5: 
note: in instantiation of member function 'CrashZone::~CrashZone' 
requested here
> SkiaZone() { 
assert(comphelper::SolarMutex::get()->IsCurrentThread()); }
> ^

()

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

diff --git a/include/comphelper/crashzone.hxx b/include/comphelper/crashzone.hxx
index f15f848cdf9e..c4e87e6b799c 100644
--- a/include/comphelper/crashzone.hxx
+++ b/include/comphelper/crashzone.hxx
@@ -55,9 +55,16 @@ public:
 ~CrashZone() { leave(); }
 static bool isInZone() { return gnEnterCount != gnLeaveCount; }
 static const AtomicCounter& enterCount() { return gnEnterCount; }
+#if defined ARM32 && !defined __ARM_PCS_VFP && defined __clang__
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wdeprecated-volatile"
+#endif
 // prefer creating instances to manually calling enter()/leave()
 static void enter() { gnEnterCount++; }
 static void leave() { gnLeaveCount++; }
+#if defined ARM32 && !defined __ARM_PCS_VFP && defined __clang__
+#pragma clang diagnostic pop
+#endif
 // these should be implemented for each specific zone if needed
 // static void hardDisable();
 // static const CrashWatchdogTimingsValues& 
getCrashWatchdogTimingsValues();


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

2023-02-22 Thread Noel Grandin (via logerrit)
 include/comphelper/propmultiplex.hxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit bdeda4385df297cd6cbd90497d9cd6ce95103ae4
Author: Noel Grandin 
AuthorDate: Wed Feb 22 09:36:20 2023 +0200
Commit: Noel Grandin 
CommitDate: Wed Feb 22 11:02:36 2023 +

OPropertyChangeListener::setAdapter can be private

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

diff --git a/include/comphelper/propmultiplex.hxx 
b/include/comphelper/propmultiplex.hxx
index 41d456d43dfb..30285f3e6204 100644
--- a/include/comphelper/propmultiplex.hxx
+++ b/include/comphelper/propmultiplex.hxx
@@ -64,7 +64,7 @@ namespace comphelper
 */
 voiddisposeAdapter();
 
-// pseudo-private. Making it private now could break compatibility
+private:
 voidsetAdapter( OPropertyChangeMultiplexer* _pAdapter );
 };
 


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

2023-02-19 Thread Noel Grandin (via logerrit)
 include/comphelper/interfacecontainer4.hxx  |   25 ++--
 include/comphelper/multiinterfacecontainer4.hxx |   22 ++---
 2 files changed, 38 insertions(+), 9 deletions(-)

New commits:
commit 414172d7fafc2d2c6b1e698aeb67fdb5797b118d
Author: Noel Grandin 
AuthorDate: Sun Feb 19 15:28:06 2023 +0200
Commit: Noel Grandin 
CommitDate: Sun Feb 19 18:28:57 2023 +

fix locking in OMultiTypeInterfaceContainerHelperVar4::diposeAndCloear

where I forgot to relock at the end of the method

And sprinkle some asserts around to catch mistakes like this in future

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

diff --git a/include/comphelper/interfacecontainer4.hxx 
b/include/comphelper/interfacecontainer4.hxx
index 3a6696fda8c5..bfa3a3059212 100644
--- a/include/comphelper/interfacecontainer4.hxx
+++ b/include/comphelper/interfacecontainer4.hxx
@@ -60,13 +60,15 @@ public:
@param rGuard
 this parameter only here to make that this container is accessed 
while locked
  */
-OInterfaceIteratorHelper4(std::unique_lock& /*rGuard*/,
+OInterfaceIteratorHelper4(std::unique_lock& rGuard,
   OInterfaceContainerHelper4& rCont_)
 : rCont(rCont_)
 , maData(rCont.maData)
 // const_cast so we don't trigger make_unique via 
o3tl::cow_wrapper::operator->
 , nRemain(std::as_const(maData)->size())
 {
+assert(rGuard.owns_lock());
+(void)rGuard;
 }
 
 /** Return true, if there are more elements in the iterator. */
@@ -281,6 +283,7 @@ template 
 inline void 
OInterfaceContainerHelper4::forEach(std::unique_lock& rGuard,
FuncT const& func) const
 {
+assert(rGuard.owns_lock());
 if (std::as_const(maData)->size() == 0)
 {
 return;
@@ -321,23 +324,29 @@ inline void 
OInterfaceContainerHelper4::notifyEach(
 
 template 
 sal_Int32
-OInterfaceContainerHelper4::getLength(std::unique_lock& 
/*rGuard*/) const
+OInterfaceContainerHelper4::getLength(std::unique_lock& 
rGuard) const
 {
+assert(rGuard.owns_lock());
+(void)rGuard;
 return maData->size();
 }
 
 template 
 std::vector>
-OInterfaceContainerHelper4::getElements(std::unique_lock&
 /*rGuard*/) const
+OInterfaceContainerHelper4::getElements(std::unique_lock&
 rGuard) const
 {
+assert(rGuard.owns_lock());
+(void)rGuard;
 return *maData;
 }
 
 template 
 sal_Int32
-OInterfaceContainerHelper4::addInterface(std::unique_lock&
 /*rGuard*/,
+OInterfaceContainerHelper4::addInterface(std::unique_lock&
 rGuard,
 const 
css::uno::Reference& rListener)
 {
+assert(rGuard.owns_lock());
+(void)rGuard;
 assert(rListener.is());
 maData->push_back(rListener);
 return maData->size();
@@ -345,8 +354,10 @@ 
OInterfaceContainerHelper4::addInterface(std::unique_lock
 
 template 
 sal_Int32 OInterfaceContainerHelper4::removeInterface(
-std::unique_lock& /*rGuard*/, const 
css::uno::Reference& rListener)
+std::unique_lock& rGuard, const 
css::uno::Reference& rListener)
 {
+assert(rGuard.owns_lock());
+(void)rGuard;
 assert(rListener.is());
 
 // It is not valid to compare the pointer directly, but it's faster.
@@ -395,8 +406,10 @@ void 
OInterfaceContainerHelper4::disposeAndClear(std::unique_lock
-void 
OInterfaceContainerHelper4::clear(::std::unique_lock<::std::mutex>& 
/*rGuard*/)
+void 
OInterfaceContainerHelper4::clear(::std::unique_lock<::std::mutex>& 
rGuard)
 {
+assert(rGuard.owns_lock());
+(void)rGuard;
 maData->clear();
 }
 }
diff --git a/include/comphelper/multiinterfacecontainer4.hxx 
b/include/comphelper/multiinterfacecontainer4.hxx
index 1241951f5505..2212d638410d 100644
--- a/include/comphelper/multiinterfacecontainer4.hxx
+++ b/include/comphelper/multiinterfacecontainer4.hxx
@@ -45,6 +45,7 @@ public:
  */
 inline std::vector getContainedTypes(std::unique_lock& 
rGuard) const
 {
+assert(rGuard.owns_lock());
 std::vector aInterfaceTypes;
 aInterfaceTypes.reserve(m_aMap.size());
 for (const auto& rPair : m_aMap)
@@ -56,6 +57,7 @@ public:
 }
 inline bool hasContainedTypes(std::unique_lock& rGuard) const
 {
+assert(rGuard.owns_lock());
 for (const auto& rPair : m_aMap)
 // are interfaces added to this container?
 if (rPair.second->getLength(rGuard))
@@ -133,15 +135,24 @@ public:
 inline void disposeAndClear(std::unique_lock& rGuard,
 const css::lang::EventObject& rEvt)
 {
+assert(rGuard.owns_lock());
 // create a copy, because do not fire event in a guarded section
 InterfaceMap tempMap;
 {
 tempMap = std::move(m_aMap);

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

2023-02-18 Thread Noel Grandin (via logerrit)
 include/comphelper/compbase.hxx |5 
 toolkit/source/controls/grid/defaultgridcolumnmodel.cxx |  130 
 2 files changed, 70 insertions(+), 65 deletions(-)

New commits:
commit 76bdc40cc3157a8ac98332047f8edbc4008f5392
Author: Noel Grandin 
AuthorDate: Fri Feb 17 14:23:52 2023 +0200
Commit: Noel Grandin 
CommitDate: Sat Feb 18 20:40:37 2023 +

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

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

diff --git a/include/comphelper/compbase.hxx b/include/comphelper/compbase.hxx
index 38380ede20d0..ad34ed7007ea 100644
--- a/include/comphelper/compbase.hxx
+++ b/include/comphelper/compbase.hxx
@@ -50,6 +50,11 @@ public:
 virtual void disposing(std::unique_lock&);
 
 protected:
+void throwIfDisposed(std::unique_lock&)
+{
+if (m_bDisposed)
+throw css::lang::DisposedException(OUString(), 
static_cast(this));
+}
 comphelper::OInterfaceContainerHelper4 
maEventListeners;
 mutable std::mutex m_aMutex;
 bool m_bDisposed = false;
diff --git a/toolkit/source/controls/grid/defaultgridcolumnmodel.cxx 
b/toolkit/source/controls/grid/defaultgridcolumnmodel.cxx
index 64cf2a61b3e2..f498001d1173 100644
--- a/toolkit/source/controls/grid/defaultgridcolumnmodel.cxx
+++ b/toolkit/source/controls/grid/defaultgridcolumnmodel.cxx
@@ -29,9 +29,8 @@
 #include 
 #include 
 #include 
-#include 
-#include 
-#include 
+#include 
+#include 
 #include 
 #include 
 #include 
@@ -49,12 +48,11 @@ using namespace toolkit;
 
 namespace {
 
-typedef ::cppu::WeakComponentImplHelper<   css::awt::grid::XGridColumnModel
+typedef ::comphelper::WeakComponentImplHelper<   
css::awt::grid::XGridColumnModel
 ,   css::lang::XServiceInfo
 >   DefaultGridColumnModel_Base;
 
-class DefaultGridColumnModel:public ::cppu::BaseMutex
-,public DefaultGridColumnModel_Base
+class DefaultGridColumnModel : public DefaultGridColumnModel_Base
 {
 public:
 DefaultGridColumnModel();
@@ -82,25 +80,20 @@ public:
 virtual css::uno::Reference< css::util::XCloneable > SAL_CALL createClone( 
 ) override;
 
 // OComponentHelper
-virtual void SAL_CALL disposing() override;
+virtual void disposing( std::unique_lock& ) override;
 
 private:
 typedef ::std::vector< rtl::Reference< GridColumn > >   Columns;
 
-::comphelper::OInterfaceContainerHelper3 
m_aContainerListeners;
+::comphelper::OInterfaceContainerHelper4 
m_aContainerListeners;
 Columns m_aColumns;
 };
 
 DefaultGridColumnModel::DefaultGridColumnModel()
-:DefaultGridColumnModel_Base( m_aMutex )
-,m_aContainerListeners( m_aMutex )
 {
 }
 
 DefaultGridColumnModel::DefaultGridColumnModel( DefaultGridColumnModel 
const & i_copySource )
-:cppu::BaseMutex()
-,DefaultGridColumnModel_Base( m_aMutex )
-,m_aContainerListeners( m_aMutex )
 {
 Columns aColumns;
 aColumns.reserve( i_copySource.m_aColumns.size() );
@@ -134,14 +127,16 @@ private:
 
 Reference< XGridColumn > SAL_CALL DefaultGridColumnModel::createColumn(  )
 {
-::comphelper::ComponentGuard aGuard( *this, rBHelper );
+std::unique_lock aGuard(m_aMutex);
+throwIfDisposed(aGuard);
 return new GridColumn();
 }
 
 
 ::sal_Int32 SAL_CALL DefaultGridColumnModel::addColumn( const Reference< 
XGridColumn > & i_column )
 {
-::comphelper::ComponentGuard aGuard( *this, rBHelper );
+std::unique_lock aGuard(m_aMutex);
+throwIfDisposed(aGuard);
 
 GridColumn* const pGridColumn = dynamic_cast( 
i_column.get() );
 if ( pGridColumn == nullptr )
@@ -157,8 +152,7 @@ private:
 aEvent.Accessor <<= index;
 aEvent.Element <<= i_column;
 
-aGuard.clear();
-m_aContainerListeners.notifyEach( 
::elementInserted, aEvent );
+m_aContainerListeners.notifyEach( aGuard, 
::elementInserted, aEvent );
 
 return index;
 }
@@ -166,7 +160,8 @@ private:
 
 void SAL_CALL DefaultGridColumnModel::removeColumn( ::sal_Int32 
i_columnIndex )
 {
-::comphelper::ComponentGuard aGuard( *this, rBHelper );
+std::unique_lock aGuard(m_aMutex);
+throwIfDisposed(aGuard);
 
 if ( ( i_columnIndex < 0 ) || ( o3tl::make_unsigned( i_columnIndex ) 
>= m_aColumns.size() ) )
 throw css::lang::IndexOutOfBoundsException( OUString(), *this );
@@ -192,8 +187,9 @@ private:
 aEvent.Accessor <<= i_columnIndex;
 aEvent.Element <<= xColumn;
 
-aGuard.clear();
-m_aContainerListeners.notifyEach( ::elementRemoved, 
aEvent );
+m_aContainerListeners.notifyEach( aGuard, 

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

2023-02-16 Thread Noel Grandin (via logerrit)
 include/comphelper/singletonref.hxx |2 --
 1 file changed, 2 deletions(-)

New commits:
commit bdfd8d5ab2c30b2c85bbf4354678d60811ae3998
Author: Noel Grandin 
AuthorDate: Thu Feb 16 09:04:00 2023 +0200
Commit: Noel Grandin 
CommitDate: Thu Feb 16 08:25:29 2023 +

no need to lock when accessing m_pInstance here

as noted by mkaganski, this field is valid until the object destructs,
so no need to take a lock

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

diff --git a/include/comphelper/singletonref.hxx 
b/include/comphelper/singletonref.hxx
index 5e90fc78cdc1..7e9e85522562 100644
--- a/include/comphelper/singletonref.hxx
+++ b/include/comphelper/singletonref.hxx
@@ -125,7 +125,6 @@ public:
 SingletonClass* operator->() const
 {
 // GLOBAL SAFE ->
-std::unique_lock aLock(SingletonRef::ownStaticLock());
 return m_pInstance;
 // <- GLOBAL SAFE
 }
@@ -135,7 +134,6 @@ public:
 SingletonClass& operator*() const
 {
 // GLOBAL SAFE ->
-std::unique_lock aLock(SingletonRef::ownStaticLock());
 return *m_pInstance;
 // <- GLOBAL SAFE
 }


[Libreoffice-commits] core.git: include/comphelper sc/inc sc/source ucb/source

2023-02-14 Thread Noel Grandin (via logerrit)
 include/comphelper/interfacecontainer4.hxx|   13 
 sc/inc/fielduno.hxx   |4 +-
 sc/source/ui/unoobj/fielduno.cxx  |   32 +++
 ucb/source/cacher/contentresultsetwrapper.cxx |   14 ++--
 ucb/source/cacher/contentresultsetwrapper.hxx |4 +-
 ucb/source/cacher/dynamicresultsetwrapper.cxx |   13 ++--
 ucb/source/cacher/dynamicresultsetwrapper.hxx |4 +-
 ucb/source/core/ucbstore.cxx  |   42 +++---
 ucb/source/core/ucbstore.hxx  |4 +-
 9 files changed, 47 insertions(+), 83 deletions(-)

New commits:
commit 0e6e0270d25c4181ed15bd04123e20672f1e3a0b
Author: Noel Grandin 
AuthorDate: Tue Feb 14 13:14:14 2023 +0200
Commit: Noel Grandin 
CommitDate: Tue Feb 14 16:57:09 2023 +

no need to use unique_ptr for OInterfaceContainerHelper4

it has an empty size of one pointer, so it saves no memory to use
unique_ptr.

Need to fix the const-ness of some methods in OInterfaceContainerHelper4

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

diff --git a/include/comphelper/interfacecontainer4.hxx 
b/include/comphelper/interfacecontainer4.hxx
index 7f6e72bf91f1..3a6696fda8c5 100644
--- a/include/comphelper/interfacecontainer4.hxx
+++ b/include/comphelper/interfacecontainer4.hxx
@@ -200,7 +200,7 @@ public:
 this parameter only here to make that this container is accessed 
while locked
 */
 template 
-inline void forEach(std::unique_lock& rGuard, FuncT const& 
func);
+inline void forEach(std::unique_lock& rGuard, FuncT const& 
func) const;
 
 /** Calls a UNO listener method for each contained listener.
 
@@ -227,7 +227,7 @@ public:
 template 
 inline void notifyEach(std::unique_lock& rGuard,
void (SAL_CALL 
ListenerT::*NotificationMethod)(const EventT&),
-   const EventT& Event);
+   const EventT& Event) const;
 
 private:
 friend class OInterfaceIteratorHelper4;
@@ -279,14 +279,15 @@ inline 
OInterfaceContainerHelper4::OInterfaceContainerHelper4()
 template 
 template 
 inline void 
OInterfaceContainerHelper4::forEach(std::unique_lock& rGuard,
-   FuncT const& func)
+   FuncT const& func) const
 {
 if (std::as_const(maData)->size() == 0)
 {
 return;
 }
-maData.make_unique(); // so we can iterate over the data without holding 
the lock
-OInterfaceIteratorHelper4 iter(rGuard, *this);
+const_cast(*this)
+.maData.make_unique(); // so we can iterate over the data without 
holding the lock
+OInterfaceIteratorHelper4 iter(rGuard, 
const_cast(*this));
 rGuard.unlock();
 while (iter.hasMoreElements())
 {
@@ -312,7 +313,7 @@ template 
 template 
 inline void OInterfaceContainerHelper4::notifyEach(
 std::unique_lock& rGuard,
-void (SAL_CALL ListenerT::*NotificationMethod)(const EventT&), const 
EventT& Event)
+void (SAL_CALL ListenerT::*NotificationMethod)(const EventT&), const 
EventT& Event) const
 {
 forEach>(rGuard,
   
NotifySingleListener(NotificationMethod, Event));
diff --git a/sc/inc/fielduno.hxx b/sc/inc/fielduno.hxx
index 7cf455c7bcc3..82c9a04ebb87 100644
--- a/sc/inc/fielduno.hxx
+++ b/sc/inc/fielduno.hxx
@@ -60,7 +60,7 @@ private:
 ScAddress   aCellPos;
 std::unique_ptr mpEditSource;
 /// List of refresh listeners.
-
std::unique_ptr>
 mpRefreshListeners;
+comphelper::OInterfaceContainerHelper4 
maRefreshListeners;
 /// mutex to lock the InterfaceContainerHelper
 std::mutex  aMutex;
 
@@ -114,7 +114,7 @@ private:
 std::unique_ptr mpEditSource;
 
 /// List of refresh listeners.
-
std::unique_ptr>
 mpRefreshListeners;
+comphelper::OInterfaceContainerHelper4 
maRefreshListeners;
 /// mutex to lock the InterfaceContainerHelper
 std::mutex  aMutex;
 
diff --git a/sc/source/ui/unoobj/fielduno.cxx b/sc/source/ui/unoobj/fielduno.cxx
index 2a05a24fab75..aacb4e2e3815 100644
--- a/sc/source/ui/unoobj/fielduno.cxx
+++ b/sc/source/ui/unoobj/fielduno.cxx
@@ -289,12 +289,11 @@ ScCellFieldsObj::~ScCellFieldsObj()
 osl_atomic_increment( _refCount );
 
 std::unique_lock g(aMutex);
-if (mpRefreshListeners)
+if (maRefreshListeners.getLength(g))
 {
 lang::EventObject aEvent;
 aEvent.Source.set(static_cast(this));
-mpRefreshListeners->disposeAndClear(g, aEvent);
-mpRefreshListeners.reset();
+maRefreshListeners.disposeAndClear(g, aEvent);
 }
 }
 
@@ -387,12 +386,12 @@ void SAL_CALL ScCellFieldsObj::removeContainerListener(
 void SAL_CALL ScCellFieldsObj::refresh(  )
 {
 

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

2023-01-12 Thread Stephan Bergmann (via logerrit)
 include/comphelper/accessiblecomponenthelper.hxx |8 
 svx/source/inc/charmapacc.hxx|1 +
 2 files changed, 5 insertions(+), 4 deletions(-)

New commits:
commit 941ab8acf0765131fb9d0af560846293f3768d13
Author: Stephan Bergmann 
AuthorDate: Wed Jan 11 11:39:35 2023 +0100
Commit: Stephan Bergmann 
CommitDate: Thu Jan 12 08:12:44 2023 +

comphelper::OCommonAccessibleComponent's XAggregation is apparently unused

It had been using WeakAggComponentImplHelper2 ever since
2f79d5f4794ec7f076bb290702b4c9c0afb2a6c8 "initial checkin - helper for
implementing an XAccessibleContext", but all the classes that derive from it
(comphelper::OAccessibleComponentHelper,
comphelper::OAccessibleExtendedComponentHelper, and classes that in turn 
derive
from those) implement queryInterface (in a way not just forwarding to the 
base
class queryInterface, as would be required for classes implementing
XAggregation) rather than queryAggregation, so aggregation was broken and 
any
delegator would be ignored when calling queryInterface on one of the derived
classes.

Also, without this commit but instead with a local

> --- a/include/comphelper/accessiblecomponenthelper.hxx
> +++ b/include/comphelper/accessiblecomponenthelper.hxx
> @@ -49,6 +49,7 @@ namespace comphelper
>  :public ::cppu::BaseMutex
>  ,public OCommonAccessibleComponent_Base
>  {
> +void SAL_CALL 
setDelegator(css::uno::Reference const &) final { 
assert(false); }
>  friend class OContextEntryGuard;
>  private:
>  css::uno::WeakReference< css::accessibility::XAccessible > 
m_aCreator; // the XAccessible which created our XAccessibleContext

on all of Linux, macOS, and Windows: `make check` still succeeded, and 
running
the resulting LibreOffice with the system in some assistive technology 
narration
mode produced audio, all without hitting that injected assert that should 
have
fired if the XAggregation mechanism had been used after all.

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

diff --git a/include/comphelper/accessiblecomponenthelper.hxx 
b/include/comphelper/accessiblecomponenthelper.hxx
index 0c738d0e6df0..8743b322a4d8 100644
--- a/include/comphelper/accessiblecomponenthelper.hxx
+++ b/include/comphelper/accessiblecomponenthelper.hxx
@@ -26,7 +26,7 @@
 #include 
 #include 
 #include 
-#include 
+#include 
 #include 
 #include 
 #include 
@@ -38,9 +38,9 @@ namespace comphelper
 
 //= OCommonAccessibleComponent
 
-typedef ::cppu::WeakAggComponentImplHelper2 <   
css::accessibility::XAccessibleContext2,
-
css::accessibility::XAccessibleEventBroadcaster
->   
OCommonAccessibleComponent_Base;
+typedef ::cppu::WeakComponentImplHelper <   
css::accessibility::XAccessibleContext2,
+
css::accessibility::XAccessibleEventBroadcaster
+>   
OCommonAccessibleComponent_Base;
 
 /** base class encapsulating common functionality for the helper classes 
implementing
 the XAccessibleComponent respectively XAccessibleExtendendComponent
diff --git a/svx/source/inc/charmapacc.hxx b/svx/source/inc/charmapacc.hxx
index 3831c3485ccf..201f53db3f37 100644
--- a/svx/source/inc/charmapacc.hxx
+++ b/svx/source/inc/charmapacc.hxx
@@ -23,6 +23,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 


[Libreoffice-commits] core.git: include/comphelper include/oox oox/source starmath/source sw/source writerfilter/source

2022-12-19 Thread Stephan Bergmann (via logerrit)
 include/comphelper/servicehelper.hxx  |   20 ++
 include/oox/mathml/imexport.hxx   |5 
 oox/source/drawingml/shape.cxx|3 +-
 oox/source/export/shapes.cxx  |3 +-
 oox/source/mathml/imexport.cxx|   10 +
 starmath/source/unomodel.cxx  |1 
 sw/source/filter/ww8/docxattributeoutput.cxx  |3 +-
 sw/source/filter/ww8/rtfattributeoutput.cxx   |3 +-
 writerfilter/source/dmapper/DomainMapper_Impl.cxx |3 +-
 writerfilter/source/ooxml/OOXMLFastContextHandler.cxx |3 +-
 writerfilter/source/rtftok/rtfdocumentimpl.cxx|3 +-
 11 files changed, 50 insertions(+), 7 deletions(-)

New commits:
commit 4d6c23216559eb48f9943bb49d6e475a6d64ba15
Author: Stephan Bergmann 
AuthorDate: Fri Dec 16 23:02:08 2022 +0100
Commit: Stephan Bergmann 
CommitDate: Mon Dec 19 12:57:29 2022 +

loplugin:unocast (oox::ForumlaImExportBase)

(See the upcoming commit introducing that loplugin:unocast on why such
dynamic_casts from UNO types are dangerous.)

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

diff --git a/include/comphelper/servicehelper.hxx 
b/include/comphelper/servicehelper.hxx
index 1d157cbf1482..286108bd2568 100644
--- a/include/comphelper/servicehelper.hxx
+++ b/include/comphelper/servicehelper.hxx
@@ -137,6 +137,26 @@ namespace comphelper {
 return FallbackToGetSomethingOf::get(rId, pThis);
 }
 
+#if defined _MSC_VER && _MSC_VER < 1930 && !defined __clang__
+// Without this additional overload, at least VS 2019 16.11.21 has 
sometimes issues deducing the
+// Base template argument in calls to the "full" getSomethingImpl overload 
with zero arguments
+// substituted for the variadic Mixins parameter:
+template 
+sal_Int64 getSomethingImpl(const css::uno::Sequence& rId, T* 
pThis,
+MixinToGetSomethingOf,
+FallbackToGetSomethingOf)
+{
+sal_Int64 res;
+if (MixinToGetSomethingOf::get(rId, pThis, )
+|| MixinToGetSomethingOf::get(rId, pThis, ))
+{
+return res;
+}
+
+return FallbackToGetSomethingOf::get(rId, pThis);
+}
+#endif
+
 template 
 sal_Int64 getSomethingImpl(const css::uno::Sequence& rId, T* 
pThis,
 MixinToGetSomethingOf, MixinToGetSomethingOf...,
diff --git a/include/oox/mathml/imexport.hxx b/include/oox/mathml/imexport.hxx
index a93216fb1199..5a0ac1313f18 100644
--- a/include/oox/mathml/imexport.hxx
+++ b/include/oox/mathml/imexport.hxx
@@ -9,12 +9,14 @@
 #ifndef INCLUDED_OOX_MATHML_IMEXPORT_HXX
 #define INCLUDED_OOX_MATHML_IMEXPORT_HXX
 
+#include 
 #include 
 #include 
 #include 
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 
@@ -43,6 +45,9 @@ public:
 virtual void writeFormulaRtf( OStringBuffer& rBuffer, rtl_TextEncoding 
nEncoding ) = 0;
 enum eFormulaAlign { INLINE, CENTER, GROUPEDCENTER, LEFT, RIGHT };
 
+sal_Int64 getSomething(css::uno::Sequence const & id);
+static css::uno::Sequence const & getUnoTunnelId();
+
 protected:
 FormulaImExportBase();
 
diff --git a/oox/source/drawingml/shape.cxx b/oox/source/drawingml/shape.cxx
index d5b02455ab35..7c2920eabcbf 100644
--- a/oox/source/drawingml/shape.cxx
+++ b/oox/source/drawingml/shape.cxx
@@ -56,6 +56,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -1295,7 +1296,7 @@ Reference< XShape > const & Shape::createAndInsert(
 {
 uno::Reference const 
xMathModel(xObj->getComponent());
 oox::FormulaImExportBase *const pMagic(
-
dynamic_cast(xMathModel.get()));
+
comphelper::getFromUnoTunnel(xMathModel));
 assert(pMagic);
 pMagic->readFormulaOoxml(*pMathXml);
 }
diff --git a/oox/source/export/shapes.cxx b/oox/source/export/shapes.cxx
index 137c69fe7c33..ce3787069adb 100644
--- a/oox/source/export/shapes.cxx
+++ b/oox/source/export/shapes.cxx
@@ -71,6 +71,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -2473,7 +2474,7 @@ void ShapeExport::WriteMathShape(Reference const& 
xShape)
 mpFS->startElementNS(XML_a14, XML_m);
 
 oox::FormulaImExportBase *const pMagic(
-dynamic_cast(xMathModel.get()));
+comphelper::getFromUnoTunnel(xMathModel));
 assert(pMagic);
 pMagic->writeFormulaOoxml(GetFS(), GetFB()->getVersion(), 
GetDocumentType(),
 FormulaImExportBase::eFormulaAlign::INLINE);
diff --git a/oox/source/mathml/imexport.cxx b/oox/source/mathml/imexport.cxx
index 2b5990679bea..ad0389051b42 100644
--- a/oox/source/mathml/imexport.cxx
+++ b/oox/source/mathml/imexport.cxx
@@ -13,6 +13,7 @@
 

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

2022-12-18 Thread Andrea Gelmini (via logerrit)
 include/comphelper/string.hxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 4a4c0c8001d6d1357ef664a274032c795babd826
Author: Andrea Gelmini 
AuthorDate: Sun Dec 18 09:51:23 2022 +0100
Commit: Julien Nabet 
CommitDate: Sun Dec 18 09:22:04 2022 +

Fix typo

Change-Id: Id469267ff57f8013accf2371b54174bee07016ae
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/144396
Tested-by: Julien Nabet 
Reviewed-by: Julien Nabet 

diff --git a/include/comphelper/string.hxx b/include/comphelper/string.hxx
index 06c825b36832..38564bc16673 100644
--- a/include/comphelper/string.hxx
+++ b/include/comphelper/string.hxx
@@ -375,7 +375,7 @@ COMPHELPER_DLLPUBLIC bool 
isdigitAsciiString(std::string_view rString);
  */
 COMPHELPER_DLLPUBLIC bool isdigitAsciiString(std::u16string_view rString);
 
-/** Santitize an OUString to not have invalid surrogates
+/** Sanitize an OUString to not have invalid surrogates
 
 @param rString  An OUString
 


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

2022-11-22 Thread Noel Grandin (via logerrit)
 include/comphelper/interfacecontainer4.hxx |   31 -
 1 file changed, 18 insertions(+), 13 deletions(-)

New commits:
commit 8f46b6d847e8dc9f3bea44d0bd76f517c1e54163
Author: Noel Grandin 
AuthorDate: Tue Nov 22 12:24:01 2022 +0200
Commit: Noel Grandin 
CommitDate: Tue Nov 22 14:23:17 2022 +0100

tdf#152077 Calc freeze when you draw a line inside the chart

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

diff --git a/include/comphelper/interfacecontainer4.hxx 
b/include/comphelper/interfacecontainer4.hxx
index 6ec1ca7179e2..7f6e72bf91f1 100644
--- a/include/comphelper/interfacecontainer4.hxx
+++ b/include/comphelper/interfacecontainer4.hxx
@@ -368,23 +368,28 @@ template 
 void 
OInterfaceContainerHelper4::disposeAndClear(std::unique_lock&
 rGuard,
 const 
css::lang::EventObject& rEvt)
 {
-OInterfaceIteratorHelper4 aIt(rGuard, *this);
-maData
-= DEFAULT(); // cheaper than calling maData->clear() because it 
doesn't allocate a new vector
-rGuard.unlock();
-// unlock followed by iterating is only safe because we are not going to 
call remove() on the iterator
-while (aIt.hasMoreElements())
 {
-try
-{
-aIt.next()->disposing(rEvt);
-}
-catch (css::uno::RuntimeException&)
+OInterfaceIteratorHelper4 aIt(rGuard, *this);
+maData
+= DEFAULT(); // cheaper than calling maData->clear() because it 
doesn't allocate a new vector
+rGuard.unlock();
+// unlock followed by iterating is only safe because we are not going 
to call remove() on the iterator
+while (aIt.hasMoreElements())
 {
-// be robust, if e.g. a remote bridge has disposed already.
-// there is no way to delegate the error to the caller :o(.
+try
+{
+aIt.next()->disposing(rEvt);
+}
+catch (css::uno::RuntimeException&)
+{
+// be robust, if e.g. a remote bridge has disposed already.
+// there is no way to delegate the error to the caller :o(.
+}
 }
 }
+// tdf#152077 need to destruct the OInterfaceIteratorHelper4 before we 
take the lock again
+// because there is a vague chance that destructing it will trigger a call 
back into something
+// that wants to take the lock.
 rGuard.lock();
 }
 


[Libreoffice-commits] core.git: include/comphelper include/o3tl vcl/source

2022-11-08 Thread Stephan Bergmann (via logerrit)
 include/comphelper/flagguard.hxx |4 +++
 include/o3tl/restoreguard.hxx|   40 ---
 vcl/source/fontsubset/cff.cxx|6 ++---
 3 files changed, 7 insertions(+), 43 deletions(-)

New commits:
commit a08ae2b5d06a49fa69f1282d1dddc45d1d5bd919
Author: Stephan Bergmann 
AuthorDate: Tue Nov 8 08:36:20 2022 +0100
Commit: Stephan Bergmann 
CommitDate: Tue Nov 8 13:21:29 2022 +0100

Combine o3tl::RestoreGuard into comphelper::ValueRestorationGuard

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

diff --git a/include/comphelper/flagguard.hxx b/include/comphelper/flagguard.hxx
index 14eee07a8401..72fa43aa90d0 100644
--- a/include/comphelper/flagguard.hxx
+++ b/include/comphelper/flagguard.hxx
@@ -46,6 +46,10 @@ namespace comphelper
 class ValueRestorationGuard : public 
ScopeGuard>
 {
 public:
+ValueRestorationGuard(T& i_valRef)
+: 
ScopeGuard>(ValueRestorationGuard_Impl(i_valRef))
+{}
+
 template 
 ValueRestorationGuard(T& i_valRef, T1&& i_temporaryValue)
 : 
ScopeGuard>(ValueRestorationGuard_Impl(i_valRef))
diff --git a/include/o3tl/restoreguard.hxx b/include/o3tl/restoreguard.hxx
deleted file mode 100644
index 19075be3dcea..
--- a/include/o3tl/restoreguard.hxx
+++ /dev/null
@@ -1,40 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; 
fill-column: 100 -*- */
-/*
- * This file is part of the LibreOffice project.
- *
- * This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/.
- */
-
-#pragma once
-
-#include 
-
-// A convenience guard class that captures a given object's value on guard 
construction and restores
-// it on guard destruction:
-namespace o3tl
-{
-template  class RestoreGuard
-{
-public:
-RestoreGuard(T& object)
-: object_(object)
-, value_(object)
-{
-}
-
-~RestoreGuard() { object_ = value_; }
-
-private:
-RestoreGuard(RestoreGuard&) = delete;
-RestoreGuard(RestoreGuard&&) = delete;
-void operator=(RestoreGuard&) = delete;
-void operator=(RestoreGuard&&) = delete;
-
-T& object_;
-T value_;
-};
-}
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s 
cinkeys+=0=break: */
diff --git a/vcl/source/fontsubset/cff.cxx b/vcl/source/fontsubset/cff.cxx
index cb980018a64f..900ddfeea637 100644
--- a/vcl/source/fontsubset/cff.cxx
+++ b/vcl/source/fontsubset/cff.cxx
@@ -24,7 +24,7 @@
 
 #include 
 
-#include 
+#include 
 #include 
 #include 
 #include 
@@ -1938,8 +1938,8 @@ OString CffSubsetterContext::getString( int nStringID)
 return pStringIds[ nStringID];
 
 // else get the string from the StringIndex table
-o3tl::RestoreGuard pReadPtr(mpReadPtr);
-o3tl::RestoreGuard pReadEnd(mpReadEnd);
+comphelper::ValueRestorationGuard pReadPtr(mpReadPtr);
+comphelper::ValueRestorationGuard pReadEnd(mpReadEnd);
 nStringID -= nStdStrings;
 int nLen = seekIndexData( mnStringIdxBase, nStringID);
 // assert( nLen >= 0);


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

2022-10-29 Thread Noel Grandin (via logerrit)
 include/comphelper/interfacecontainer4.hxx |3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

New commits:
commit 29de154fdfd5ce69ec906e04823c7d1ccdf9
Author: Noel Grandin 
AuthorDate: Sat Oct 29 13:22:35 2022 +0200
Commit: Noel Grandin 
CommitDate: Sat Oct 29 19:52:14 2022 +0200

tdf#126788 reduce cost of OInterfaceContainerHelper4::disposeAndClear

use the empty singleton to avoid allocating an empty vector

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

diff --git a/include/comphelper/interfacecontainer4.hxx 
b/include/comphelper/interfacecontainer4.hxx
index 20429954d56d..6ec1ca7179e2 100644
--- a/include/comphelper/interfacecontainer4.hxx
+++ b/include/comphelper/interfacecontainer4.hxx
@@ -369,7 +369,8 @@ void 
OInterfaceContainerHelper4::disposeAndClear(std::unique_lock aIt(rGuard, *this);
-maData->clear();
+maData
+= DEFAULT(); // cheaper than calling maData->clear() because it 
doesn't allocate a new vector
 rGuard.unlock();
 // unlock followed by iterating is only safe because we are not going to 
call remove() on the iterator
 while (aIt.hasMoreElements())


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

2022-08-12 Thread Andrea Gelmini (via logerrit)
 include/comphelper/configurationhelper.hxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit e73fdbdf4472dae41bcaa6e6494f34a49fbcbcbe
Author: Andrea Gelmini 
AuthorDate: Fri Aug 12 11:31:31 2022 +0200
Commit: Julien Nabet 
CommitDate: Fri Aug 12 13:24:14 2022 +0200

Fix typo

Change-Id: I63cdee1466397618cb72198c870e183b3ce90b8e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/138183
Tested-by: Julien Nabet 
Reviewed-by: Julien Nabet 

diff --git a/include/comphelper/configurationhelper.hxx 
b/include/comphelper/configurationhelper.hxx
index 162319316df6..637068f5dc07 100644
--- a/include/comphelper/configurationhelper.hxx
+++ b/include/comphelper/configurationhelper.hxx
@@ -169,7 +169,7 @@ public:
  *  path relative to xCFG parameter.
  *
  *  @param  sSetNode
- *  the set node, which should be checked if its exists ...
+ *  the set node, which should be checked if it exists...
  *  or which should be created with default values.
  *
  *  @return A reference to the found (or new created) set node.


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

2022-08-09 Thread Stephan Bergmann (via logerrit)
 include/comphelper/parallelsort.hxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit b8e451af93c2917d70214c75bb6b6a8bf566813b
Author: Stephan Bergmann 
AuthorDate: Wed Jun 29 15:59:47 2022 +0200
Commit: Stephan Bergmann 
CommitDate: Tue Aug 9 09:37:03 2022 +0200

Use stable_sort in comphelper::s3sort

With a randomizing debug-mode libc++ (`export 
LIBCPP_DEBUG=-D_LIBCPP_DEBUG=1`
in config_host.mk), CppunitTest_sc_ucalc_pivottable consistently failed for 
me
with

> Expected: A  Actual: a
> 
sc/qa/unit/ucalc_pivottable.cxx:1886:TestPivottable::testPivotTableCaseInsensitiveStrings
> assertion failed
> - Expression: bSuccess
> - Table output check failed

when _LIBCPP_DEBUG_RANDOMIZE_UNSPECIFIED_STABILITY_SEED is 140365334480272.

This change apparently happens to fix it, but I have no idea what exactly is
going on here.  (comphelper::s3sort was introduced in
46d0afba738d8ee7c9b63384fef513f42ee587f3 "Implement parallel version of
super-scalar-sample-sort...", and
TestPivottable::testPivotTableCaseInsensitiveStrings traces back to
96086484d3429ff849b468ef5d1ff8ac8e7874a9 "Move pivot table tests into a 
separate
source file.)

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

diff --git a/include/comphelper/parallelsort.hxx 
b/include/comphelper/parallelsort.hxx
index 94d86e0d119b..032165f06f0c 100644
--- a/include/comphelper/parallelsort.hxx
+++ b/include/comphelper/parallelsort.hxx
@@ -292,7 +292,7 @@ void s3sort(const RandItr aBegin, const RandItr aEnd, 
Compare aComp = Compare(),
 const std::size_t nLen = static_cast(aEnd - aBegin);
 if (nLen < nBaseCaseSize)
 {
-std::sort(aBegin, aEnd, aComp);
+std::stable_sort(aBegin, aEnd, aComp);
 return;
 }
 


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

2022-08-03 Thread Mike Kaganski (via logerrit)
 include/comphelper/interfacecontainer4.hxx |2 ++
 1 file changed, 2 insertions(+)

New commits:
commit 4f3d989a40a7083ce25a0ccddd711f7a045844b6
Author: Mike Kaganski 
AuthorDate: Wed Aug 3 09:59:21 2022 +0200
Commit: Mike Kaganski 
CommitDate: Wed Aug 3 19:40:46 2022 +0200

This must be non-null

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

diff --git a/include/comphelper/interfacecontainer4.hxx 
b/include/comphelper/interfacecontainer4.hxx
index 694e5b17bbca..20429954d56d 100644
--- a/include/comphelper/interfacecontainer4.hxx
+++ b/include/comphelper/interfacecontainer4.hxx
@@ -23,6 +23,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 
@@ -259,6 +260,7 @@ private:
 : m_pMethod(method)
 , m_rEvent(event)
 {
+assert(m_pMethod);
 }
 
 void operator()(const css::uno::Reference& listener) const


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

2022-05-24 Thread Noel Grandin (via logerrit)
 include/comphelper/interfacecontainer4.hxx |   16 
 1 file changed, 12 insertions(+), 4 deletions(-)

New commits:
commit c022b7a169eebf15f38db0286660ac84cc537358
Author: Noel Grandin 
AuthorDate: Tue May 24 14:06:51 2022 +0200
Commit: Stephan Bergmann 
CommitDate: Tue May 24 21:17:58 2022 +0200

fix thread-safety in OInterfaceContainerHelper4

we need thread-safety here (even though we use a mutex), because we use
a singleton, and the singleton can be ref-counted when the
OInterfaceContainerHelper4 is deleted, and is generallly not held at
that point, and that is tricky to enforce.

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

diff --git a/include/comphelper/interfacecontainer4.hxx 
b/include/comphelper/interfacecontainer4.hxx
index fe19bab4e43e..694e5b17bbca 100644
--- a/include/comphelper/interfacecontainer4.hxx
+++ b/include/comphelper/interfacecontainer4.hxx
@@ -86,7 +86,9 @@ public:
 
 private:
 OInterfaceContainerHelper4& rCont;
-o3tl::cow_wrapper>> maData;
+o3tl::cow_wrapper>,
+  o3tl::ThreadSafeRefCountingPolicy>
+maData;
 sal_Int32 nRemain;
 
 OInterfaceIteratorHelper4(const OInterfaceIteratorHelper4&) = delete;
@@ -228,13 +230,19 @@ public:
 
 private:
 friend class OInterfaceIteratorHelper4;
-o3tl::cow_wrapper>> maData;
+o3tl::cow_wrapper>,
+  o3tl::ThreadSafeRefCountingPolicy>
+maData;
 OInterfaceContainerHelper4(const OInterfaceContainerHelper4&) = delete;
 OInterfaceContainerHelper4& operator=(const OInterfaceContainerHelper4&) = 
delete;
 
-static o3tl::cow_wrapper>>& 
DEFAULT()
+static o3tl::cow_wrapper>,
+ o3tl::ThreadSafeRefCountingPolicy>&
+DEFAULT()
 {
-static o3tl::cow_wrapper>> 
SINGLETON;
+static o3tl::cow_wrapper>,
+ o3tl::ThreadSafeRefCountingPolicy>
+SINGLETON;
 return SINGLETON;
 }
 


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

2022-05-16 Thread Noel Grandin (via logerrit)
 include/comphelper/interfacecontainer4.hxx |7 ---
 1 file changed, 4 insertions(+), 3 deletions(-)

New commits:
commit a49c68354656dcdcef87d5c14c8f8f3e3391ec6f
Author: Noel Grandin 
AuthorDate: Sun May 15 21:23:34 2022 +0200
Commit: Noel Grandin 
CommitDate: Mon May 16 17:51:27 2022 +0200

remove unnecessary copying in OInterfaceContainerHelper4

caused by triggering make_unique in cow_wrappe when calling through
non-const operator*

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

diff --git a/include/comphelper/interfacecontainer4.hxx 
b/include/comphelper/interfacecontainer4.hxx
index 04b949575e7a..fe19bab4e43e 100644
--- a/include/comphelper/interfacecontainer4.hxx
+++ b/include/comphelper/interfacecontainer4.hxx
@@ -63,7 +63,8 @@ public:
   OInterfaceContainerHelper4& rCont_)
 : rCont(rCont_)
 , maData(rCont.maData)
-, nRemain(maData->size())
+// const_cast so we don't trigger make_unique via 
o3tl::cow_wrapper::operator->
+, nRemain(std::as_const(maData)->size())
 {
 }
 
@@ -96,13 +97,13 @@ template 
 const css::uno::Reference& 
OInterfaceIteratorHelper4::next()
 {
 nRemain--;
-return (*maData)[nRemain];
+return (*std::as_const(maData))[nRemain];
 }
 
 template 
 void 
OInterfaceIteratorHelper4::remove(::std::unique_lock<::std::mutex>& 
rGuard)
 {
-rCont.removeInterface(rGuard, (*maData)[nRemain]);
+rCont.removeInterface(rGuard, (*std::as_const(maData))[nRemain]);
 }
 
 /**


[Libreoffice-commits] core.git: include/comphelper sdext/source sw/source

2022-04-05 Thread Noel Grandin (via logerrit)
 include/comphelper/string.hxx  |   62 +++--
 sdext/source/pdfimport/wrapper/wrapper.cxx |   13 +-
 sw/source/filter/ascii/wrtasc.cxx  |3 -
 sw/source/uibase/utlui/unotools.cxx|3 -
 4 files changed, 66 insertions(+), 15 deletions(-)

New commits:
commit 9b2ad2e29e69fa5b7561f738cc82e49268f2b4ec
Author: Noel Grandin 
AuthorDate: Mon Apr 4 14:02:02 2022 +0200
Commit: Noel Grandin 
CommitDate: Tue Apr 5 09:22:48 2022 +0200

add some comphelper::string::toInt* functions for string_views

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

diff --git a/include/comphelper/string.hxx b/include/comphelper/string.hxx
index 6ada67a6a381..7d1b549bb9e3 100644
--- a/include/comphelper/string.hxx
+++ b/include/comphelper/string.hxx
@@ -16,9 +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_COMPHELPER_STRING_HXX
-#define INCLUDED_COMPHELPER_STRING_HXX
+#pragma once
 
 #include 
 
@@ -361,8 +359,64 @@ COMPHELPER_DLLPUBLIC bool 
isdigitAsciiString(std::string_view rString);
  */
 COMPHELPER_DLLPUBLIC bool isdigitAsciiString(std::u16string_view rString);
 
+/** Interpret a string as a long integer.
+
+This function cannot be used for language-specific conversion.
+
+@param str
+a string.
+
+@param radix
+the radix.  Must be between RTL_USTR_MIN_RADIX (2) and RTL_USTR_MAX_RADIX
+(36), inclusive.
+
+@param nStrLength
+number of chars to process
+
+@return
+the long integer value represented by the string, or 0 if the string does
+not represent a long integer.
+*/
+inline sal_Int64 toInt64(std::u16string_view str, sal_Int16 radix = 10 )
+{
+return rtl_ustr_toInt64_WithLength(str.data(), radix, str.size());
+}
+inline sal_Int64 toInt64(std::string_view str, sal_Int16 radix = 10 )
+{
+return rtl_str_toInt64_WithLength(str.data(), radix, str.size());
+}
+
+/** Interpret a string as an integer.
+
+This function cannot be used for language-specific conversion.
+
+@param radix
+the radix.  Must be between RTL_USTR_MIN_RADIX (2) and RTL_USTR_MAX_RADIX
+(36), inclusive.
+
+@param nStrLength
+number of chars to process
+
+@return
+the integer value represented by the string, or 0 if the string does not
+represent an integer.
+ */
+inline sal_Int32 toInt32( std::u16string_view str, sal_Int16 radix = 10 )
+{
+sal_Int64 n = rtl_ustr_toInt64_WithLength(str.data(), radix, str.size());
+if (n < SAL_MIN_INT32 || n > SAL_MAX_INT32)
+n = 0;
+return n;
+}
+inline sal_Int32 toInt32( std::string_view str, sal_Int16 radix = 10 )
+{
+sal_Int64 n = rtl_str_toInt64_WithLength(str.data(), radix, str.size());
+if (n < SAL_MIN_INT32 || n > SAL_MAX_INT32)
+n = 0;
+return n;
 }
 
-#endif
+
+}
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sdext/source/pdfimport/wrapper/wrapper.cxx 
b/sdext/source/pdfimport/wrapper/wrapper.cxx
index 9a79e939046d..9f9e9a3c3c87 100644
--- a/sdext/source/pdfimport/wrapper/wrapper.cxx
+++ b/sdext/source/pdfimport/wrapper/wrapper.cxx
@@ -36,6 +36,7 @@
 #include 
 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -254,25 +255,19 @@ std::string_view LineParser::readNextToken()
 void LineParser::readInt32( sal_Int32& o_Value )
 {
 std::string_view tok = readNextToken();
-sal_Int64 n = rtl_str_toInt64_WithLength(tok.data(), 10, tok.size());
-if (n < SAL_MIN_INT32 || n > SAL_MAX_INT32)
-n = 0;
-o_Value = n;
+o_Value = comphelper::string::toInt32(tok);
 }
 
 sal_Int32 LineParser::readInt32()
 {
 std::string_view tok = readNextToken();
-sal_Int64 n =rtl_str_toInt64_WithLength(tok.data(), 10, tok.size());
-if (n < SAL_MIN_INT32 || n > SAL_MAX_INT32)
-n = 0;
-return n;
+return comphelper::string::toInt32(tok);
 }
 
 void LineParser::readInt64( sal_Int64& o_Value )
 {
 std::string_view tok = readNextToken();
-o_Value = rtl_str_toInt64_WithLength(tok.data(), 10, tok.size());
+o_Value = comphelper::string::toInt64(tok);
 }
 
 void LineParser::readDouble( double& o_Value )
diff --git a/sw/source/filter/ascii/wrtasc.cxx 
b/sw/source/filter/ascii/wrtasc.cxx
index 1f4153293bc3..c37efe6ee713 100644
--- a/sw/source/filter/ascii/wrtasc.cxx
+++ b/sw/source/filter/ascii/wrtasc.cxx
@@ -29,6 +29,7 @@
 #include 
 #include 
 #include 
+#include 
 
 #include 
 
@@ -44,7 +45,7 @@ SwASCWriter::SwASCWriter( std::u16string_view rFltNm )
 if( 5 < rFltNm.size() )
 {
 std::u16string_view aFilterNum = rFltNm.substr( 5 );
-switch( rtl_ustr_toInt64_WithLength(aFilterNum.data(), 10, 
aFilterNum.size()) )
+switch( 

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

2022-03-29 Thread Stephan Bergmann (via logerrit)
 include/comphelper/parallelsort.hxx |3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

New commits:
commit ac520c337bd3799366a1fd1dbda0baabb299e3bc
Author: Stephan Bergmann 
AuthorDate: Tue Mar 29 13:28:21 2022 +0200
Commit: Stephan Bergmann 
CommitDate: Tue Mar 29 14:19:38 2022 +0200

Revert "removed pointless using namespace std"

This reverts commit 5b53dd0514c25f907c80d523b078387db71f859b.

The using directive was not pointless, it was necessary to correctly call 
the
std::swap customization point.

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

diff --git a/include/comphelper/parallelsort.hxx 
b/include/comphelper/parallelsort.hxx
index 57eccc4770e3..94d86e0d119b 100644
--- a/include/comphelper/parallelsort.hxx
+++ b/include/comphelper/parallelsort.hxx
@@ -147,7 +147,8 @@ template  struct Sampler
 for (size_t nIdx = 0; nIdx < nSamples; ++nIdx)
 {
 size_t nSel = aGenerator() % nLen--;
-std::swap(*(aBegin + nSel), *(aBegin + nLen));
+using namespace std;
+swap(*(aBegin + nSel), *(aBegin + nLen));
 pSamples[nIdx] = *(aBegin + nLen);
 }
 }


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

2022-03-29 Thread offtkp (via logerrit)
 include/comphelper/parallelsort.hxx |3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

New commits:
commit 5b53dd0514c25f907c80d523b078387db71f859b
Author: offtkp 
AuthorDate: Mon Mar 28 15:52:29 2022 +0300
Commit: Hossein 
CommitDate: Tue Mar 29 13:03:34 2022 +0200

removed pointless using namespace std

Change-Id: I117aa1ea74b636ef06f7eedce8f2e12f9c4226b2
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132213
Tested-by: Jenkins
Reviewed-by: Hossein 

diff --git a/include/comphelper/parallelsort.hxx 
b/include/comphelper/parallelsort.hxx
index 94d86e0d119b..57eccc4770e3 100644
--- a/include/comphelper/parallelsort.hxx
+++ b/include/comphelper/parallelsort.hxx
@@ -147,8 +147,7 @@ template  struct Sampler
 for (size_t nIdx = 0; nIdx < nSamples; ++nIdx)
 {
 size_t nSel = aGenerator() % nLen--;
-using namespace std;
-swap(*(aBegin + nSel), *(aBegin + nLen));
+std::swap(*(aBegin + nSel), *(aBegin + nLen));
 pSamples[nIdx] = *(aBegin + nLen);
 }
 }


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

2022-02-01 Thread Mike Kaganski (via logerrit)
 include/comphelper/string.hxx |   16 ++--
 1 file changed, 6 insertions(+), 10 deletions(-)

New commits:
commit aabc5b0f7c8e9cf6bb711815a67ff6b6e900b5aa
Author: Mike Kaganski 
AuthorDate: Tue Feb 1 16:03:38 2022 +0100
Commit: Mike Kaganski 
CommitDate: Tue Feb 1 20:39:16 2022 +0100

Slightly optimize truncateToLength and padToLength

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

diff --git a/include/comphelper/string.hxx b/include/comphelper/string.hxx
index d4c9ccd1b947..5e5c4c4a28ab 100644
--- a/include/comphelper/string.hxx
+++ b/include/comphelper/string.hxx
@@ -22,6 +22,7 @@
 
 #include 
 
+#include 
 #include 
 #include 
 #include 
@@ -159,7 +160,7 @@ namespace detail
 template B& truncateToLength(B& rBuffer, sal_Int32 nLen)
 {
 if (nLen < rBuffer.getLength())
-rBuffer.remove(nLen, rBuffer.getLength()-nLen);
+rBuffer.setLength(nLen);
 return rBuffer;
 }
 }
@@ -184,16 +185,11 @@ inline OUStringBuffer& truncateToLength(
 
 namespace detail
 {
-template B& padToLength(B& rBuffer, sal_Int32 nLen,
-U cFill = '\0')
+template B& padToLength(B& rBuffer, sal_Int32 
nLen, U cFill)
 {
-sal_Int32 nOrigLen = rBuffer.getLength();
-if (nLen > nOrigLen)
-{
-rBuffer.setLength(nLen);
-for (sal_Int32 i = nOrigLen; i < nLen; ++i)
-rBuffer[i] = cFill;
-}
+const sal_Int32 nPadLen = nLen - rBuffer.getLength();
+if (nPadLen > 0)
+std::fill_n(rBuffer.appendUninitialized(nPadLen), nPadLen, cFill);
 return rBuffer;
 }
 }


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

2022-01-18 Thread Noel Grandin (via logerrit)
 include/comphelper/interfacecontainer4.hxx |3 +++
 sfx2/source/notify/globalevents.cxx|1 +
 2 files changed, 4 insertions(+)

New commits:
commit a605f2f8fd3e848ed1229328144f948adea82256
Author: Noel Grandin 
AuthorDate: Tue Jan 18 11:03:55 2022 +0200
Commit: Noel Grandin 
CommitDate: Tue Jan 18 15:04:18 2022 +0100

fix locking in comphelper::OInterfaceContainerHelper4::forEach

regression from
commit a2eaf99e46f370ffb3b73828c2bdc53dc193b9a4
Author: Noel Grandin 
Date:   Fri Jan 14 10:56:50 2022 +0200
make comphelper::OInterfaceContainerHelper4 more threadsafe

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

diff --git a/include/comphelper/interfacecontainer4.hxx 
b/include/comphelper/interfacecontainer4.hxx
index b8e2079a9201..1df8f47776eb 100644
--- a/include/comphelper/interfacecontainer4.hxx
+++ b/include/comphelper/interfacecontainer4.hxx
@@ -271,7 +271,10 @@ inline void 
OInterfaceContainerHelper4::forEach(std::unique_lock&
FuncT const& func)
 {
 if (std::as_const(maData)->size() == 0)
+{
+rGuard.unlock(); // code depends on the guard being unlocked after 
return
 return;
+}
 maData.make_unique(); // so we can iterate over the data without holding 
the lock
 OInterfaceIteratorHelper4 iter(rGuard, *this);
 rGuard.unlock();
diff --git a/sfx2/source/notify/globalevents.cxx 
b/sfx2/source/notify/globalevents.cxx
index 817e8a38448b..17719f992341 100644
--- a/sfx2/source/notify/globalevents.cxx
+++ b/sfx2/source/notify/globalevents.cxx
@@ -487,6 +487,7 @@ void SfxGlobalEvents_Impl::implts_notifyListener(const 
document::DocumentEvent&
 xListener->notifyEvent(aLegacyEvent);
 }
 );
+g.lock();
 m_aDocumentListeners.forEach(g,
 [](const css::uno::Reference& 
xListener)
 {


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

2022-01-14 Thread Noel Grandin (via logerrit)
 include/comphelper/interfacecontainer3.hxx |   23 +++
 1 file changed, 19 insertions(+), 4 deletions(-)

New commits:
commit c8a5312b82ff1d3305baabbd2362ed0706ba8ace
Author: Noel Grandin 
AuthorDate: Fri Jan 14 09:51:38 2022 +0200
Commit: Noel Grandin 
CommitDate: Fri Jan 14 09:57:35 2022 +0100

reduce default cost of OInterfaceContainerHelper3

most of these are never used, so rather store a pointer to a shared
empty vector

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

diff --git a/include/comphelper/interfacecontainer3.hxx 
b/include/comphelper/interfacecontainer3.hxx
index 27008f064e8c..4b3d44bab69d 100644
--- a/include/comphelper/interfacecontainer3.hxx
+++ b/include/comphelper/interfacecontainer3.hxx
@@ -126,10 +126,8 @@ public:
The lifetime must be longer than the lifetime
of this object.
  */
-OInterfaceContainerHelper3(::osl::Mutex& rMutex_)
-: mrMutex(rMutex_)
-{
-}
+inline OInterfaceContainerHelper3(::osl::Mutex& rMutex_);
+
 /**
   Return the number of Elements in the container. Only useful if you have 
acquired
   the mutex.
@@ -224,6 +222,16 @@ private:
 OInterfaceContainerHelper3(const OInterfaceContainerHelper3&) = delete;
 OInterfaceContainerHelper3& operator=(const OInterfaceContainerHelper3&) = 
delete;
 
+static o3tl::cow_wrapper>,
+ o3tl::ThreadSafeRefCountingPolicy>&
+DEFAULT()
+{
+static o3tl::cow_wrapper>,
+ o3tl::ThreadSafeRefCountingPolicy>
+SINGLETON;
+return SINGLETON;
+}
+
 private:
 template  class NotifySingleListener
 {
@@ -246,6 +254,13 @@ private:
 };
 };
 
+template 
+inline OInterfaceContainerHelper3::OInterfaceContainerHelper3(::osl::Mutex& 
rMutex_)
+: maData(OInterfaceContainerHelper3::DEFAULT())
+, mrMutex(rMutex_)
+{
+}
+
 template 
 template 
 inline void OInterfaceContainerHelper3::forEach(FuncT const& func)


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

2021-12-27 Thread Noel Grandin (via logerrit)
 include/comphelper/interfacecontainer4.hxx |   15 ++-
 1 file changed, 14 insertions(+), 1 deletion(-)

New commits:
commit 1606f778e4cd3d8056aecbac3d13f5858361356a
Author: Noel Grandin 
AuthorDate: Mon Dec 27 19:05:42 2021 +0200
Commit: Noel Grandin 
CommitDate: Mon Dec 27 20:57:37 2021 +0100

reduce default cost of OInterfaceContainerHelper4

most of these are never used, so rather store a pointer to a shared
empty vector

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

diff --git a/include/comphelper/interfacecontainer4.hxx 
b/include/comphelper/interfacecontainer4.hxx
index 04fafeadc0fd..e58b958629b9 100644
--- a/include/comphelper/interfacecontainer4.hxx
+++ b/include/comphelper/interfacecontainer4.hxx
@@ -114,7 +114,8 @@ template  void 
OInterfaceIteratorHelper4::remove()
 template  class OInterfaceContainerHelper4
 {
 public:
-OInterfaceContainerHelper4() {}
+OInterfaceContainerHelper4();
+
 /**
   Return the number of Elements in the container. Only useful if you have 
acquired
   the mutex.
@@ -205,6 +206,12 @@ private:
 OInterfaceContainerHelper4(const OInterfaceContainerHelper4&) = delete;
 OInterfaceContainerHelper4& operator=(const OInterfaceContainerHelper4&) = 
delete;
 
+static o3tl::cow_wrapper>>& 
DEFAULT()
+{
+static o3tl::cow_wrapper>> 
SINGLETON;
+return SINGLETON;
+}
+
 private:
 template  class NotifySingleListener
 {
@@ -227,6 +234,12 @@ private:
 };
 };
 
+template 
+inline OInterfaceContainerHelper4::OInterfaceContainerHelper4()
+: maData(OInterfaceContainerHelper4::DEFAULT())
+{
+}
+
 template 
 template 
 inline void OInterfaceContainerHelper4::forEach(FuncT const& func)


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

2021-12-25 Thread Noel Grandin (via logerrit)
 include/comphelper/compbase.hxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit f0c0c62c10e4ffdb9ce44202e2540d2f39a9fcb5
Author: Noel Grandin 
AuthorDate: Sat Dec 25 11:43:11 2021 +0200
Commit: Noel Grandin 
CommitDate: Sat Dec 25 13:56:09 2021 +0100

uninitialised field in comphelper::WeakComponentImplHelperBase

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

diff --git a/include/comphelper/compbase.hxx b/include/comphelper/compbase.hxx
index 6cd969386034..9a8ea3bb6a24 100644
--- a/include/comphelper/compbase.hxx
+++ b/include/comphelper/compbase.hxx
@@ -47,7 +47,7 @@ public:
 protected:
 comphelper::OInterfaceContainerHelper4 
maEventListeners;
 mutable std::mutex m_aMutex;
-bool m_bDisposed;
+bool m_bDisposed = false;
 };
 
 template 


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

2021-12-03 Thread Stephan Bergmann (via logerrit)
 include/comphelper/scopeguard.hxx |   17 +++--
 1 file changed, 3 insertions(+), 14 deletions(-)

New commits:
commit aa5ee0085c7d8b8713f4dbed0009b38b9fabb281
Author: Stephan Bergmann 
AuthorDate: Wed Dec 1 20:32:46 2021 +0100
Commit: Stephan Bergmann 
CommitDate: Fri Dec 3 09:27:15 2021 +0100

Stop swallowing exceptions in ~ScopeGuard

...and rather assume that m_func() is implicitly noexcept.  (Catching 
exceptions
had been done ever since the class' introduction in
7d1c1393eecf0cfcce06f35b0b18311f1e887aee "INTEGRATION: CWS presfixes01: 
#i3#
new scopeguard" and looks more like a general safety measure rather than
catering for m_func() that deliberately throw exceptions.  This change is in
part a prerequisite for using this inline-only class in salhelper, where 
use of
css::uno::Exception would cause a circular dependency.)

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

diff --git a/include/comphelper/scopeguard.hxx 
b/include/comphelper/scopeguard.hxx
index a361c7c5f2b0..72ae4a699d16 100644
--- a/include/comphelper/scopeguard.hxx
+++ b/include/comphelper/scopeguard.hxx
@@ -20,9 +20,9 @@
 #ifndef INCLUDED_COMPHELPER_SCOPEGUARD_HXX
 #define INCLUDED_COMPHELPER_SCOPEGUARD_HXX
 
-#include 
-#include 
+#include 
 
+#include 
 
 // For some reason, Android buildbot issues -Werror like this:
 //   In file included from
@@ -60,18 +60,7 @@ public:
 {
 if (m_bDismissed)
 return;
-try
-{
-m_func();
-}
-catch (css::uno::Exception& exc)
-{
-SAL_WARN("comphelper", "UNO exception occurred: " << exc);
-}
-catch (...)
-{
-SAL_WARN("comphelper", "unknown exception occurred!");
-}
+m_func();
 }
 
 /** Dismisses the scope guard, i.e. the function won't


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

2021-12-01 Thread Noel Grandin (via logerrit)
 include/comphelper/multiinterfacecontainer2.hxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit fabce43fe1caf3a59a7d9dc1074a74b704f9fa24
Author: Noel Grandin 
AuthorDate: Wed Dec 1 09:46:01 2021 +0200
Commit: Noel Grandin 
CommitDate: Wed Dec 1 12:12:57 2021 +0100

fix thinko in OMultiTypeInterfaceContainerHelperVar2 change

in
commit d8a526eabe3a7256c1637307e8de74c54e5df4eb
Author: Noel Grandin 
Date:   Tue Nov 30 21:36:08 2021 +0200
improve OMultiTypeInterfaceContainerHelperVar2::disposeAndClear

spotted by sberg

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

diff --git a/include/comphelper/multiinterfacecontainer2.hxx 
b/include/comphelper/multiinterfacecontainer2.hxx
index b9eea1bd86dc..0c3e7f690d16 100644
--- a/include/comphelper/multiinterfacecontainer2.hxx
+++ b/include/comphelper/multiinterfacecontainer2.hxx
@@ -177,7 +177,7 @@ public:
 tempMap = std::move(m_aMap);
 }
 
-for (auto& rPair : m_aMap)
+for (auto& rPair : tempMap)
 rPair.second->disposeAndClear(rEvt);
 }
 


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

2021-11-30 Thread Noel Grandin (via logerrit)
 include/comphelper/multiinterfacecontainer2.hxx |   31 +++-
 1 file changed, 5 insertions(+), 26 deletions(-)

New commits:
commit d8a526eabe3a7256c1637307e8de74c54e5df4eb
Author: Noel Grandin 
AuthorDate: Tue Nov 30 21:36:08 2021 +0200
Commit: Noel Grandin 
CommitDate: Wed Dec 1 08:06:09 2021 +0100

improve OMultiTypeInterfaceContainerHelperVar2::disposeAndClear

no need to create an array, just move/empty the map in one step

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

diff --git a/include/comphelper/multiinterfacecontainer2.hxx 
b/include/comphelper/multiinterfacecontainer2.hxx
index e15c26733198..b9eea1bd86dc 100644
--- a/include/comphelper/multiinterfacecontainer2.hxx
+++ b/include/comphelper/multiinterfacecontainer2.hxx
@@ -170,36 +170,15 @@ public:
  */
 inline void disposeAndClear(const css::lang::EventObject& rEvt)
 {
-typename InterfaceMap::size_type nSize = 0;
-OInterfaceContainerHelper2** ppListenerContainers = nullptr;
-{
-::osl::MutexGuard aGuard(rMutex);
-nSize = m_aMap.size();
-if (nSize)
-{
-typedef OInterfaceContainerHelper2* ppp;
-ppListenerContainers = new ppp[nSize];
-
-typename InterfaceMap::iterator iter = m_aMap.begin();
-typename InterfaceMap::iterator end = m_aMap.end();
-
-typename InterfaceMap::size_type i = 0;
-while (iter != end)
-{
-ppListenerContainers[i++] = (*iter).second.get();
-++iter;
-}
-}
-}
-
 // create a copy, because do not fire event in a guarded section
-for (typename InterfaceMap::size_type i = 0; i < nSize; i++)
+InterfaceMap tempMap;
 {
-if (ppListenerContainers[i])
-ppListenerContainers[i]->disposeAndClear(rEvt);
+::osl::MutexGuard aGuard(rMutex);
+tempMap = std::move(m_aMap);
 }
 
-delete[] ppListenerContainers;
+for (auto& rPair : m_aMap)
+rPair.second->disposeAndClear(rEvt);
 }
 
 /**


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

2021-11-28 Thread Noel Grandin (via logerrit)
 include/comphelper/interfacecontainer3.hxx |8 ++--
 1 file changed, 6 insertions(+), 2 deletions(-)

New commits:
commit 17aa192818caeb9af1381051a2dfda9568f7ce07
Author: Noel Grandin 
AuthorDate: Sun Nov 28 21:32:15 2021 +0200
Commit: Noel Grandin 
CommitDate: Mon Nov 29 07:36:15 2021 +0100

OInterfaceContainerHelper3 needs to be thread-safe

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

diff --git a/include/comphelper/interfacecontainer3.hxx 
b/include/comphelper/interfacecontainer3.hxx
index 9d4709918024..5c087c668669 100644
--- a/include/comphelper/interfacecontainer3.hxx
+++ b/include/comphelper/interfacecontainer3.hxx
@@ -85,7 +85,9 @@ public:
 
 private:
 OInterfaceContainerHelper3& rCont;
-o3tl::cow_wrapper>> maData;
+o3tl::cow_wrapper>,
+  o3tl::ThreadSafeRefCountingPolicy>
+maData;
 sal_Int32 nRemain;
 
 OInterfaceIteratorHelper3(const OInterfaceIteratorHelper3&) = delete;
@@ -217,7 +219,9 @@ public:
 
 private:
 friend class OInterfaceIteratorHelper3;
-o3tl::cow_wrapper>> maData;
+o3tl::cow_wrapper>,
+  o3tl::ThreadSafeRefCountingPolicy>
+maData;
 ::osl::Mutex& rMutex;
 OInterfaceContainerHelper3(const OInterfaceContainerHelper3&) = delete;
 OInterfaceContainerHelper3& operator=(const OInterfaceContainerHelper3&) = 
delete;


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

2021-11-28 Thread Noel Grandin (via logerrit)
 include/comphelper/interfacecontainer3.hxx |   12 
 svx/source/unodraw/unoshcol.cxx|8 
 2 files changed, 16 insertions(+), 4 deletions(-)

New commits:
commit 134cbe4c3b94a5ec46849abd1eef2c3acb5f789e
Author: Noel Grandin 
AuthorDate: Sun Nov 28 16:16:37 2021 +0200
Commit: Noel Grandin 
CommitDate: Sun Nov 28 21:07:13 2021 +0100

use more OInterfaceContainerHelper3 in SvxShapeCollection

which requires adding a getInterface method to OInterfaceContainerHelper3

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

diff --git a/include/comphelper/interfacecontainer3.hxx 
b/include/comphelper/interfacecontainer3.hxx
index 82fa1f5e6b3d..9d4709918024 100644
--- a/include/comphelper/interfacecontainer3.hxx
+++ b/include/comphelper/interfacecontainer3.hxx
@@ -166,6 +166,9 @@ public:
 the new count of elements in the container
 */
 sal_Int32 removeInterface(const css::uno::Reference& rxIFace);
+/** Return an interface by index
+*/
+const css::uno::Reference& getInterface(sal_Int32 nIndex) const;
 /**
   Call disposing on all object in the container that
   support XEventListener. Then clear the container.
@@ -319,6 +322,15 @@ sal_Int32 
OInterfaceContainerHelper3::removeInterface(
 return maData->size();
 }
 
+template 
+const css::uno::Reference&
+OInterfaceContainerHelper3::getInterface(sal_Int32 nIndex) const
+{
+osl::MutexGuard aGuard(rMutex);
+
+return (*maData)[nIndex];
+}
+
 template 
 void OInterfaceContainerHelper3::disposeAndClear(const 
css::lang::EventObject& rEvt)
 {
diff --git a/svx/source/unodraw/unoshcol.cxx b/svx/source/unodraw/unoshcol.cxx
index 450de874753b..80ad53cc1f88 100644
--- a/svx/source/unodraw/unoshcol.cxx
+++ b/svx/source/unodraw/unoshcol.cxx
@@ -26,7 +26,7 @@
 
 #include 
 #include 
-#include 
+#include 
 #include 
 #include 
 #include 
@@ -47,7 +47,7 @@ class SvxShapeCollection :
 public SvxShapeCollectionMutex
 {
 private:
-comphelper::OInterfaceContainerHelper2 maShapeContainer;
+comphelper::OInterfaceContainerHelper3 maShapeContainer;
 
 cppu::OBroadcastHelper mrBHelper;
 
@@ -213,8 +213,8 @@ uno::Any SAL_CALL SvxShapeCollection::getByIndex( sal_Int32 
Index )
 if( Index < 0 || Index >= getCount() )
 throw lang::IndexOutOfBoundsException();
 
-Reference< uno::XInterface> xInterface = 
maShapeContainer.getInterface(Index);
-return uno::makeAny( Reference< drawing::XShape>(static_cast< 
drawing::XShape* >( xInterface.get())) );
+Reference xShape = maShapeContainer.getInterface(Index);
+return uno::makeAny( xShape );
 }
 
 // XElementAccess


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

2021-11-27 Thread Noel Grandin (via logerrit)
 include/comphelper/interfacecontainer4.hxx |4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

New commits:
commit aa0a2266f0fd9f53b50944aa183b7e78fe675300
Author: Noel Grandin 
AuthorDate: Sat Nov 27 16:21:56 2021 +0200
Commit: Noel Grandin 
CommitDate: Sat Nov 27 17:00:30 2021 +0100

fix header include guard

was overlapping with the header it was copied from

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

diff --git a/include/comphelper/interfacecontainer4.hxx 
b/include/comphelper/interfacecontainer4.hxx
index 0260ac4f5c0b..c81aa6b3afbd 100644
--- a/include/comphelper/interfacecontainer4.hxx
+++ b/include/comphelper/interfacecontainer4.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_COMPHELPER_INTERFACECONTAINER3_H
-#define INCLUDED_COMPHELPER_INTERFACECONTAINER3_H
+#pragma once
 
 #include 
 
@@ -323,6 +322,5 @@ void 
OInterfaceContainerHelper4::disposeAndClear(std::unique_lock void OInterfaceContainerHelper4::clear() 
{ maData->clear(); }
 }
-#endif
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */


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

2021-11-12 Thread Noel Grandin (via logerrit)
 include/comphelper/proparrhlp.hxx|   16 
 include/comphelper/servicehelper.hxx |1 -
 2 files changed, 8 insertions(+), 9 deletions(-)

New commits:
commit ec1a54ca6033533a20309f3df5b8b5353bb2b509
Author: Noel Grandin 
AuthorDate: Thu Nov 11 20:55:22 2021 +0200
Commit: Noel Grandin 
CommitDate: Sat Nov 13 07:35:10 2021 +0100

rtl::Static->thread-safe static in OPropertyArrayUsageHelper

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

diff --git a/include/comphelper/proparrhlp.hxx 
b/include/comphelper/proparrhlp.hxx
index a53b718c2697..8520ac58f87d 100644
--- a/include/comphelper/proparrhlp.hxx
+++ b/include/comphelper/proparrhlp.hxx
@@ -24,21 +24,21 @@
 #include 
 #include 
 #include 
-#include 
 
 namespace comphelper
 {
 
-template  struct OPropertyArrayUsageHelperMutex
-: public rtl::Static< ::osl::Mutex, OPropertyArrayUsageHelperMutex > 
{};
-
 template 
 class OPropertyArrayUsageHelper
 {
 protected:
 static sal_Int32s_nRefCount;
 static ::cppu::IPropertyArrayHelper*s_pProps;
-
+static osl::Mutex& theMutex()
+{
+static osl::Mutex SINGLETON;
+return SINGLETON;
+}
 public:
 OPropertyArrayUsageHelper();
 virtual ~OPropertyArrayUsageHelper();
@@ -92,14 +92,14 @@ template
 template 
 OPropertyArrayUsageHelper::OPropertyArrayUsageHelper()
 {
-::osl::MutexGuard aGuard(OPropertyArrayUsageHelperMutex::get());
+::osl::MutexGuard aGuard(theMutex());
 ++s_nRefCount;
 }
 
 template 
 OPropertyArrayUsageHelper::~OPropertyArrayUsageHelper()
 {
-::osl::MutexGuard aGuard(OPropertyArrayUsageHelperMutex::get());
+::osl::MutexGuard aGuard(theMutex());
 OSL_ENSURE(s_nRefCount > 0, 
"OPropertyArrayUsageHelper::~OPropertyArrayUsageHelper : suspicious call : have 
a refcount of 0 !");
 if (!--s_nRefCount)
 {
@@ -114,7 +114,7 @@ template 
 OSL_ENSURE(s_nRefCount, "OPropertyArrayUsageHelper::getArrayHelper : 
suspicious call : have a refcount of 0 !");
 if (!s_pProps)
 {
-::osl::MutexGuard aGuard(OPropertyArrayUsageHelperMutex::get());
+::osl::MutexGuard aGuard(theMutex());
 if (!s_pProps)
 {
 s_pProps = createArrayHelper();
diff --git a/include/comphelper/servicehelper.hxx 
b/include/comphelper/servicehelper.hxx
index fa906075e1b6..b2c6bf46d009 100644
--- a/include/comphelper/servicehelper.hxx
+++ b/include/comphelper/servicehelper.hxx
@@ -21,7 +21,6 @@
 #define INCLUDED_COMPHELPER_SERVICEHELPER_HXX
 
 #include 
-#include 
 #include 
 #include 
 


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

2021-11-12 Thread Noel Grandin (via logerrit)
 include/comphelper/IdPropArrayHelper.hxx |   12 ++--
 1 file changed, 6 insertions(+), 6 deletions(-)

New commits:
commit e6f2736be82559c513aa07c765e9f6c0dd72072b
Author: Noel Grandin 
AuthorDate: Thu Nov 11 20:41:58 2021 +0200
Commit: Noel Grandin 
CommitDate: Sat Nov 13 07:34:48 2021 +0100

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

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

diff --git a/include/comphelper/IdPropArrayHelper.hxx 
b/include/comphelper/IdPropArrayHelper.hxx
index 705de3db8925..8b70db849ed5 100644
--- a/include/comphelper/IdPropArrayHelper.hxx
+++ b/include/comphelper/IdPropArrayHelper.hxx
@@ -20,7 +20,7 @@
 
 #include 
 
-#include 
+#include 
 #include 
 #include 
 #include 
@@ -36,7 +36,7 @@ namespace comphelper
 OIdPropertyArrayUsageHelper();
 virtual ~OIdPropertyArrayUsageHelper()
 {
-::osl::MutexGuard aGuard(theMutex());
+std::unique_lock aGuard(theMutex());
 assert(s_nRefCount > 0 && 
"OIdPropertyArrayUsageHelper::~OIdPropertyArrayUsageHelper : suspicious call : 
have a refcount of 0 !");
 if (!--s_nRefCount)
 {
@@ -64,9 +64,9 @@ namespace comphelper
 private:
 static sal_Int32s_nRefCount;
 static OIdPropertyArrayMap* s_pMap;
-static osl::Mutex& theMutex()
+static std::mutex& theMutex()
 {
-static osl::Mutex SINGLETON;
+static std::mutex SINGLETON;
 return SINGLETON;
 }
 };
@@ -80,7 +80,7 @@ namespace comphelper
 template 
 OIdPropertyArrayUsageHelper::OIdPropertyArrayUsageHelper()
 {
-::osl::MutexGuard aGuard(theMutex());
+std::unique_lock aGuard(theMutex());
 // create the map if necessary
 if (!s_pMap)
 s_pMap = new OIdPropertyArrayMap;
@@ -91,7 +91,7 @@ namespace comphelper
 ::cppu::IPropertyArrayHelper* 
OIdPropertyArrayUsageHelper::getArrayHelper(sal_Int32 nId)
 {
 assert(s_nRefCount && "OIdPropertyArrayUsageHelper::getArrayHelper : 
suspicious call : have a refcount of 0 !");
-::osl::MutexGuard aGuard(theMutex());
+std::unique_lock aGuard(theMutex());
 // do we have the array already?
 auto& rEntry = (*s_pMap)[nId];
 if (!rEntry)


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

2021-11-12 Thread Noel Grandin (via logerrit)
 include/comphelper/IdPropArrayHelper.hxx |   15 ---
 1 file changed, 8 insertions(+), 7 deletions(-)

New commits:
commit f4a2c9e91e6b12d4d66b35146ec87b15b365f57d
Author: Noel Grandin 
AuthorDate: Thu Nov 11 20:40:22 2021 +0200
Commit: Noel Grandin 
CommitDate: Sat Nov 13 07:34:25 2021 +0100

rtl::Static->thread-safe static in OIdPropertyArrayUsageHelper

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

diff --git a/include/comphelper/IdPropArrayHelper.hxx 
b/include/comphelper/IdPropArrayHelper.hxx
index c702acb98065..705de3db8925 100644
--- a/include/comphelper/IdPropArrayHelper.hxx
+++ b/include/comphelper/IdPropArrayHelper.hxx
@@ -21,7 +21,6 @@
 #include 
 
 #include 
-#include 
 #include 
 #include 
 #include 
@@ -29,9 +28,6 @@
 namespace comphelper
 {
 
-template  struct OIdPropertyArrayUsageHelperMutex
-: public rtl::Static< ::osl::Mutex, 
OIdPropertyArrayUsageHelperMutex > {};
-
 typedef std::unordered_map< sal_Int32, ::cppu::IPropertyArrayHelper* > 
OIdPropertyArrayMap;
 template 
 class OIdPropertyArrayUsageHelper
@@ -40,7 +36,7 @@ namespace comphelper
 OIdPropertyArrayUsageHelper();
 virtual ~OIdPropertyArrayUsageHelper()
 {
-::osl::MutexGuard 
aGuard(OIdPropertyArrayUsageHelperMutex::get());
+::osl::MutexGuard aGuard(theMutex());
 assert(s_nRefCount > 0 && 
"OIdPropertyArrayUsageHelper::~OIdPropertyArrayUsageHelper : suspicious call : 
have a refcount of 0 !");
 if (!--s_nRefCount)
 {
@@ -68,6 +64,11 @@ namespace comphelper
 private:
 static sal_Int32s_nRefCount;
 static OIdPropertyArrayMap* s_pMap;
+static osl::Mutex& theMutex()
+{
+static osl::Mutex SINGLETON;
+return SINGLETON;
+}
 };
 
 template
@@ -79,7 +80,7 @@ namespace comphelper
 template 
 OIdPropertyArrayUsageHelper::OIdPropertyArrayUsageHelper()
 {
-::osl::MutexGuard 
aGuard(OIdPropertyArrayUsageHelperMutex::get());
+::osl::MutexGuard aGuard(theMutex());
 // create the map if necessary
 if (!s_pMap)
 s_pMap = new OIdPropertyArrayMap;
@@ -90,7 +91,7 @@ namespace comphelper
 ::cppu::IPropertyArrayHelper* 
OIdPropertyArrayUsageHelper::getArrayHelper(sal_Int32 nId)
 {
 assert(s_nRefCount && "OIdPropertyArrayUsageHelper::getArrayHelper : 
suspicious call : have a refcount of 0 !");
-::osl::MutexGuard 
aGuard(OIdPropertyArrayUsageHelperMutex::get());
+::osl::MutexGuard aGuard(theMutex());
 // do we have the array already?
 auto& rEntry = (*s_pMap)[nId];
 if (!rEntry)


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

2021-11-12 Thread Noel Grandin (via logerrit)
 include/comphelper/IdPropArrayHelper.hxx |   31 +++
 1 file changed, 11 insertions(+), 20 deletions(-)

New commits:
commit 98a2cef1ee9c76897af64ff0a1e1efd280796f36
Author: Noel Grandin 
AuthorDate: Thu Nov 11 19:08:17 2021 +0200
Commit: Noel Grandin 
CommitDate: Sat Nov 13 06:26:52 2021 +0100

modernise IdPropArrayHelper a little

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

diff --git a/include/comphelper/IdPropArrayHelper.hxx 
b/include/comphelper/IdPropArrayHelper.hxx
index 34e403b3ab0a..c702acb98065 100644
--- a/include/comphelper/IdPropArrayHelper.hxx
+++ b/include/comphelper/IdPropArrayHelper.hxx
@@ -16,40 +16,32 @@
  *   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_COMPHELPER_IDPROPARRAYHELPER_HXX
-#define INCLUDED_COMPHELPER_IDPROPARRAYHELPER_HXX
+#pragma once
 
 #include 
 
-#include 
-
 #include 
-#include 
 #include 
 #include 
+#include 
+#include 
 
 namespace comphelper
 {
 
-//  OIdPropertyArrayUsageHelper
-
 template  struct OIdPropertyArrayUsageHelperMutex
 : public rtl::Static< ::osl::Mutex, 
OIdPropertyArrayUsageHelperMutex > {};
 
-typedef std::map< sal_Int32, ::cppu::IPropertyArrayHelper* > 
OIdPropertyArrayMap;
+typedef std::unordered_map< sal_Int32, ::cppu::IPropertyArrayHelper* > 
OIdPropertyArrayMap;
 template 
 class OIdPropertyArrayUsageHelper
 {
-protected:
-static sal_Int32s_nRefCount;
-static OIdPropertyArrayMap* s_pMap;
-
 public:
 OIdPropertyArrayUsageHelper();
 virtual ~OIdPropertyArrayUsageHelper()
 {
 ::osl::MutexGuard 
aGuard(OIdPropertyArrayUsageHelperMutex::get());
-OSL_ENSURE(s_nRefCount > 0, 
"OIdPropertyArrayUsageHelper::~OIdPropertyArrayUsageHelper : suspicious call : 
have a refcount of 0 !");
+assert(s_nRefCount > 0 && 
"OIdPropertyArrayUsageHelper::~OIdPropertyArrayUsageHelper : suspicious call : 
have a refcount of 0 !");
 if (!--s_nRefCount)
 {
 // delete the element
@@ -73,42 +65,41 @@ namespace comphelper
 @return a pointer to the newly created 
array helper. Must not be NULL.
 */
 virtual ::cppu::IPropertyArrayHelper* createArrayHelper(sal_Int32 nId) 
const = 0;
+private:
+static sal_Int32s_nRefCount;
+static OIdPropertyArrayMap* s_pMap;
 };
 
-
 template
 sal_Int32   OIdPropertyArrayUsageHelper< TYPE 
>::s_nRefCount= 0;
 
 template
 OIdPropertyArrayMap*OIdPropertyArrayUsageHelper< TYPE 
>::s_pMap = nullptr;
 
-
 template 
 OIdPropertyArrayUsageHelper::OIdPropertyArrayUsageHelper()
 {
 ::osl::MutexGuard 
aGuard(OIdPropertyArrayUsageHelperMutex::get());
 // create the map if necessary
-if (s_pMap == nullptr)
+if (!s_pMap)
 s_pMap = new OIdPropertyArrayMap;
 ++s_nRefCount;
 }
 
-
 template 
 ::cppu::IPropertyArrayHelper* 
OIdPropertyArrayUsageHelper::getArrayHelper(sal_Int32 nId)
 {
-OSL_ENSURE(s_nRefCount, "OIdPropertyArrayUsageHelper::getArrayHelper : 
suspicious call : have a refcount of 0 !");
+assert(s_nRefCount && "OIdPropertyArrayUsageHelper::getArrayHelper : 
suspicious call : have a refcount of 0 !");
 ::osl::MutexGuard 
aGuard(OIdPropertyArrayUsageHelperMutex::get());
 // do we have the array already?
 auto& rEntry = (*s_pMap)[nId];
 if (!rEntry)
 {
 rEntry = createArrayHelper(nId);
-OSL_ENSURE((*s_pMap)[nId], 
"OIdPropertyArrayUsageHelper::getArrayHelper : createArrayHelper returned 
nonsense !");
+assert(rEntry && "OIdPropertyArrayUsageHelper::getArrayHelper : 
createArrayHelper returned nonsense !");
 }
 return (*s_pMap)[nId];
 }
 }
-#endif // INCLUDED_COMPHELPER_IDPROPARRAYHELPER_HXX
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */


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

2021-11-09 Thread Tor Lillqvist (via logerrit)
 include/comphelper/windowsdebugoutput.hxx |   25 +
 1 file changed, 25 insertions(+)

New commits:
commit 4e01639f2ce64f3f6c3281ef526b3e4645566b6b
Author: Tor Lillqvist 
AuthorDate: Tue Nov 9 14:14:02 2021 +0200
Commit: Tor Lillqvist 
CommitDate: Tue Nov 9 17:14:35 2021 +0100

Add DC_PAPERSIZE_array_to_string

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

diff --git a/include/comphelper/windowsdebugoutput.hxx 
b/include/comphelper/windowsdebugoutput.hxx
index 24185c678f4d..0315933c71cd 100644
--- a/include/comphelper/windowsdebugoutput.hxx
+++ b/include/comphelper/windowsdebugoutput.hxx
@@ -766,6 +766,31 @@ inline std::string DMPAPER_to_string(int dmpaper)
 }
 }
 
+inline std::string DC_PAPERSIZE_array_to_string(POINT* pPaperSizes, DWORD 
nCount)
+{
+std::string result;
+
+for (DWORD i = 0; i < nCount; i++)
+{
+if (i > 0)
+result += ", ";
+
+result += std::to_string(std::lround(pPaperSizes[i].x / 10.0)) + "x"
+  + std::to_string(std::lround(pPaperSizes[i].y / 10.0));
+
+#if 0
+// WIP. Printer::GetPaperName() should really be inline in 
 or
+// something, so that it can be used anywhere. We can't depend on vcl 
in this file as we
+// might be included in modules that precede vcl.
+PaperInfo paperInfo(pPaperSizes[i].x * 10, pPaperSizes[i].y * 10);
+paperInfo.doSloppyFit(true);
+if (paperInfo.getPaper() != PAPER_USER)
+result += "(" + 
std::string(Printer::GetPaperName(paperInfo.getPaper()).toUtf8().getStr()) + 
")";
+#endif
+}
+return result;
+}
+
 #endif // INCLUDED_COMPHELPER_WINDOWSDEBUGOUTPUT_HXX
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */


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

2021-11-08 Thread Tor Lillqvist (via logerrit)
 include/comphelper/windowsdebugoutput.hxx |  245 ++
 1 file changed, 245 insertions(+)

New commits:
commit 9c5acc28ce828751185382972b6421451bf5630c
Author: Tor Lillqvist 
AuthorDate: Mon Nov 8 15:47:46 2021 +0200
Commit: Tor Lillqvist 
CommitDate: Mon Nov 8 16:25:36 2021 +0100

Add DMPAPER_to_string()

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

diff --git a/include/comphelper/windowsdebugoutput.hxx 
b/include/comphelper/windowsdebugoutput.hxx
index a50fc2aa0c7e..24185c678f4d 100644
--- a/include/comphelper/windowsdebugoutput.hxx
+++ b/include/comphelper/windowsdebugoutput.hxx
@@ -521,6 +521,251 @@ inline std::basic_ostream& 
operator<<(std::basic_ostream

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

2021-11-01 Thread Mike Kaganski (via logerrit)
 include/comphelper/sequence.hxx |2 ++
 1 file changed, 2 insertions(+)

New commits:
commit 509b2039f72ff35c79bb6ff2f49525b9d1e9226c
Author: Mike Kaganski 
AuthorDate: Mon Nov 1 18:48:04 2021 +0200
Commit: Mike Kaganski 
CommitDate: Tue Nov 2 06:49:21 2021 +0100

Use braces to workaround a strange GCC bug

Using gcc version 9.3.0 (Ubuntu 9.3.0-17ubuntu1~20.04):

[CXX] ucb/source/ucp/cmis/certvalidation_handler.cxx
In file included from 
/home/user/core.git/workdir/UnpackedTarball/boost/boost/lexical_cast/detail/converter_lexical_streams.hpp:62,
 from 
/home/user/core.git/workdir/UnpackedTarball/boost/boost/lexical_cast/detail/converter_lexical.hpp:54,
 from 
/home/user/core.git/workdir/UnpackedTarball/boost/boost/lexical_cast/try_lexical_convert.hpp:44,
 from 
/home/user/core.git/workdir/UnpackedTarball/boost/boost/lexical_cast.hpp:32,
 from 
/home/user/core.git/external/boost/include/boost/lexical_cast.hpp:30,
 from 
/home/user/core.git/workdir/UnpackedTarball/boost/boost/date_time/format_date_parser.hpp:14,
 from 
/home/user/core.git/workdir/UnpackedTarball/boost/boost/date_time/date_generator_parser.hpp:20,
 from 
/home/user/core.git/workdir/UnpackedTarball/boost/boost/date_time/date_facet.hpp:25,
 from 
/home/user/core.git/workdir/UnpackedTarball/boost/boost/date_time/gregorian/gregorian_io.hpp:16,
 from 
/home/user/core.git/workdir/UnpackedTarball/boost/boost/date_time/gregorian/gregorian.hpp:31,
 from 
/home/user/core.git/workdir/UnpackedTarball/boost/boost/date_time/posix_time/time_formatters.hpp:12,
 from 
/home/user/core.git/workdir/UnpackedTarball/boost/boost/date_time/posix_time/posix_time.hpp:24,
 from 
/home/user/core.git/external/boost/include/boost/date_time/posix_time/posix_time.hpp:30,
 from 
/home/user/core.git/workdir/UnpackedTarball/boost/boost/date_time/local_time/local_time.hpp:11,
 from 
/home/user/core.git/workdir/UnpackedTarball/boost/boost/date_time.hpp:15,
 from 
/home/user/core.git/external/boost/include/boost/date_time.hpp:30,
 from 
/home/user/core.git/workdir/UnpackedTarball/libcmis/inc/libcmis/object.hxx:40,
 from 
/home/user/core.git/workdir/UnpackedTarball/libcmis/inc/libcmis/document.hxx:39,
 from 
/home/user/core.git/workdir/UnpackedTarball/libcmis/inc/libcmis/libcmis.hxx:34,
 from 
/home/user/core.git/ucb/source/ucp/cmis/certvalidation_handler.hxx:19,
 from 
/home/user/core.git/ucb/source/ucp/cmis/certvalidation_handler.cxx:23:

/home/user/core.git/workdir/UnpackedTarball/boost/boost/lexical_cast/detail/lcast_unsigned_converters.hpp:
 In member function ‘CharT* boost::detail::lcast_put_unsigned::main_convert_loop()’:

/home/user/core.git/workdir/UnpackedTarball/boost/boost/lexical_cast/detail/lcast_unsigned_converters.hpp:149:17:
 error: this ‘while’ clause does not guard... [-Werror=misleading-indentation]
  149 | inline CharT* main_convert_loop() BOOST_NOEXCEPT {
  | ^

/home/user/core.git/workdir/UnpackedTarball/boost/boost/lexical_cast/detail/lcast_unsigned_converters.hpp:150:17:
 note: ...this statement, but the latter is misleadingly indented as if it were 
guarded by the ‘while’
  150 | while (main_convert_iteration());
  | ^~

It surfaced after commit 00a76942e423589e3fdd4e059be753eab3393344,
apparently showing some version-specific compiler bug.

Change-Id: I92a989726cea5eafd762f724cfc0b3c1f986824c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/124474
Reviewed-by: Aron Budea 
Reviewed-by: Mike Kaganski 
Tested-by: Mike Kaganski 

diff --git a/include/comphelper/sequence.hxx b/include/comphelper/sequence.hxx
index 1aa3fbea803d..bc67559dfbee 100644
--- a/include/comphelper/sequence.hxx
+++ b/include/comphelper/sequence.hxx
@@ -122,7 +122,9 @@ namespace comphelper
 inline css::uno::Sequence< DstType > arrayToSequence( const SrcType* 
i_pArray, sal_Int32 nNum )
 {
 if constexpr (std::is_same_v< DstType, SrcType >)
+{
 return css::uno::Sequence< DstType >( i_pArray, nNum );
+}
 else
 {
 css::uno::Sequence< DstType > result( nNum );


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

2021-10-30 Thread Mike Kaganski (via logerrit)
 include/comphelper/sequence.hxx |   11 ---
 1 file changed, 8 insertions(+), 3 deletions(-)

New commits:
commit 00a76942e423589e3fdd4e059be753eab3393344
Author: Mike Kaganski 
AuthorDate: Fri Oct 29 16:23:53 2021 +0200
Commit: Mike Kaganski 
CommitDate: Sat Oct 30 08:01:28 2021 +0200

Optimize comphelper::arrayToSequence for same types case

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

diff --git a/include/comphelper/sequence.hxx b/include/comphelper/sequence.hxx
index a42ef2d2f341..1aa3fbea803d 100644
--- a/include/comphelper/sequence.hxx
+++ b/include/comphelper/sequence.hxx
@@ -121,9 +121,14 @@ namespace comphelper
 template < typename DstType, typename SrcType >
 inline css::uno::Sequence< DstType > arrayToSequence( const SrcType* 
i_pArray, sal_Int32 nNum )
 {
-css::uno::Sequence< DstType > result( nNum );
-::std::copy( i_pArray, i_pArray+nNum, result.getArray() );
-return result;
+if constexpr (std::is_same_v< DstType, SrcType >)
+return css::uno::Sequence< DstType >( i_pArray, nNum );
+else
+{
+css::uno::Sequence< DstType > result( nNum );
+::std::copy( i_pArray, i_pArray+nNum, result.getArray() );
+return result;
+}
 }
 
 


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

2021-10-23 Thread Mike Kaganski (via logerrit)
 include/comphelper/sequence.hxx |   10 --
 1 file changed, 4 insertions(+), 6 deletions(-)

New commits:
commit 667c2499d861cfcd26935fc0512cb5aaf602c4c5
Author: Mike Kaganski 
AuthorDate: Sat Oct 23 23:11:34 2021 +0200
Commit: Mike Kaganski 
CommitDate: Sun Oct 24 00:04:58 2021 +0200

Use std::transform instead of loop

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

diff --git a/include/comphelper/sequence.hxx b/include/comphelper/sequence.hxx
index d446894574e5..ada6ee27b4ef 100644
--- a/include/comphelper/sequence.hxx
+++ b/include/comphelper/sequence.hxx
@@ -291,9 +291,8 @@ namespace comphelper
 inline css::uno::Sequence< typename M::key_type > mapKeysToSequence( M 
const& map )
 {
 css::uno::Sequence< typename M::key_type > ret( 
static_cast(map.size()) );
-typename M::key_type* pArray = ret.getArray();
-for (const auto& i : map)
-*pArray++ = i.first;
+std::transform(map.begin(), map.end(), ret.getArray(),
+   [](const auto& i) { return i.first; });
 return ret;
 }
 
@@ -301,9 +300,8 @@ namespace comphelper
 inline css::uno::Sequence< typename M::mapped_type > mapValuesToSequence( 
M const& map )
 {
 css::uno::Sequence< typename M::mapped_type > ret( 
static_cast(map.size()) );
-typename M::mapped_type* pArray = ret.getArray();
-for (const auto& i : map)
-*pArray++ = i.second;
+std::transform(map.begin(), map.end(), ret.getArray(),
+   [](const auto& i) { return i.second; });
 return ret;
 }
 


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

2021-10-23 Thread Mike Kaganski (via logerrit)
 include/comphelper/sequence.hxx |8 +++-
 1 file changed, 3 insertions(+), 5 deletions(-)

New commits:
commit 911c74d0ec05a2b216936e3f58900a4aea137146
Author: Mike Kaganski 
AuthorDate: Sat Oct 23 19:43:31 2021 +0200
Commit: Mike Kaganski 
CommitDate: Sat Oct 23 21:23:36 2021 +0200

Use std::size/begin/end in comphelper::containerToSequence

This allows e.g. to use the function with valarrays, that don't have
own begin/end, but has std::begin/end overloads.

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

diff --git a/include/comphelper/sequence.hxx b/include/comphelper/sequence.hxx
index 7c999ec25059..d446894574e5 100644
--- a/include/comphelper/sequence.hxx
+++ b/include/comphelper/sequence.hxx
@@ -181,8 +181,8 @@ namespace comphelper
 template < typename DstElementType, typename SrcType >
 inline css::uno::Sequence< DstElementType > containerToSequence( const 
SrcType& i_Container )
 {
-css::uno::Sequence< DstElementType > result( i_Container.size() );
-::std::copy( i_Container.begin(), i_Container.end(), result.getArray() 
);
+css::uno::Sequence< DstElementType > result( ::std::size(i_Container) 
);
+::std::copy( ::std::begin(i_Container), ::std::end(i_Container), 
result.getArray() );
 return result;
 }
 
@@ -190,9 +190,7 @@ namespace comphelper
 template < typename SrcType >
 inline css::uno::Sequence< typename SrcType::value_type > 
containerToSequence( const SrcType& i_Container )
 {
-css::uno::Sequence< typename SrcType::value_type > result( 
i_Container.size() );
-::std::copy( i_Container.begin(), i_Container.end(), result.getArray() 
);
-return result;
+return containerToSequence(i_Container);
 }
 
 // handle arrays


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

2021-10-17 Thread Mike Kaganski (via logerrit)
 include/comphelper/propertyvalue.hxx |   10 +-
 1 file changed, 9 insertions(+), 1 deletion(-)

New commits:
commit 23cded985ba0131f85ee445492c04871fbfb6351
Author: Mike Kaganski 
AuthorDate: Sun Oct 17 10:02:17 2021 +0200
Commit: Mike Kaganski 
CommitDate: Sun Oct 17 14:36:51 2021 +0200

Specialize comphelper::makePropertyValue for arithmetic types

This allows to pass e.g. bit fields to the function, like

struct Foo { bool b : 1; };
Foo foo {true};
comphelper::makePropertyValue("foo", foo.b);

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

diff --git a/include/comphelper/propertyvalue.hxx 
b/include/comphelper/propertyvalue.hxx
index ac4f6886039e..9d0d94d3256a 100644
--- a/include/comphelper/propertyvalue.hxx
+++ b/include/comphelper/propertyvalue.hxx
@@ -12,6 +12,7 @@
 
 #include 
 
+#include 
 #include 
 
 #include 
@@ -25,11 +26,18 @@ namespace comphelper
  *
  * instead of writing 3 extra lines to set the name and value of the 
beans::PropertyValue.
  */
-template  css::beans::PropertyValue makePropertyValue(const 
OUString& rName, T&& rValue)
+template >, int> = 0>
+css::beans::PropertyValue makePropertyValue(const OUString& rName, T&& rValue)
 {
 return { rName, 0, css::uno::toAny(std::forward(rValue)),
  css::beans::PropertyState_DIRECT_VALUE };
 }
+// Allows to pass e.g. bit fields
+template >, int> = 0>
+css::beans::PropertyValue makePropertyValue(const OUString& rName, T aValue)
+{
+return makePropertyValue(rName, css::uno::toAny(aValue));
+}
 }
 
 #endif // INCLUDED_COMPHELPER_PROPERTYVALUE_HXX


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

2021-10-17 Thread Mike Kaganski (via logerrit)
 include/comphelper/propertyvalue.hxx |6 ++
 1 file changed, 2 insertions(+), 4 deletions(-)

New commits:
commit 6f725426f75a2876b348fc2c38cb6ed30f45d565
Author: Mike Kaganski 
AuthorDate: Sun Oct 17 08:29:54 2021 +0200
Commit: Mike Kaganski 
CommitDate: Sun Oct 17 14:36:14 2021 +0200

Simplify comphelper::makePropertyValue

Avoid default-constructing members that get immediately re-defined.

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

diff --git a/include/comphelper/propertyvalue.hxx 
b/include/comphelper/propertyvalue.hxx
index 85f3d67385c6..ac4f6886039e 100644
--- a/include/comphelper/propertyvalue.hxx
+++ b/include/comphelper/propertyvalue.hxx
@@ -27,10 +27,8 @@ namespace comphelper
  */
 template  css::beans::PropertyValue makePropertyValue(const 
OUString& rName, T&& rValue)
 {
-css::beans::PropertyValue aValue;
-aValue.Name = rName;
-aValue.Value = css::uno::toAny(std::forward(rValue));
-return aValue;
+return { rName, 0, css::uno::toAny(std::forward(rValue)),
+ css::beans::PropertyState_DIRECT_VALUE };
 }
 }
 


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

2021-10-15 Thread Stephan Bergmann (via logerrit)
 include/comphelper/parallelsort.hxx |3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

New commits:
commit 5bf4eb0f5e20a8c24e37e68f47988b3d9b29c570
Author: Stephan Bergmann 
AuthorDate: Fri Oct 15 10:06:57 2021 +0200
Commit: Stephan Bergmann 
CommitDate: Fri Oct 15 14:42:22 2021 +0200

Correctly use swap customization point in generic code (for pre C++20)

(see 
"Suggested Design for Customization Points")

Change-Id: If641ce84b1114fbe4e9819ebf4d958130301dc13
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123626
Reviewed-by: Dennis Francis 
Reviewed-by: Stephan Bergmann 
Tested-by: Jenkins

diff --git a/include/comphelper/parallelsort.hxx 
b/include/comphelper/parallelsort.hxx
index 57eccc4770e3..94d86e0d119b 100644
--- a/include/comphelper/parallelsort.hxx
+++ b/include/comphelper/parallelsort.hxx
@@ -147,7 +147,8 @@ template  struct Sampler
 for (size_t nIdx = 0; nIdx < nSamples; ++nIdx)
 {
 size_t nSel = aGenerator() % nLen--;
-std::swap(*(aBegin + nSel), *(aBegin + nLen));
+using namespace std;
+swap(*(aBegin + nSel), *(aBegin + nLen));
 pSamples[nIdx] = *(aBegin + nLen);
 }
 }


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

2021-09-27 Thread Luboš Luňák (via logerrit)
 include/comphelper/traceevent.hxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 26c40d37922b48b7f28953e4ab3049bafb97917d
Author: Luboš Luňák 
AuthorDate: Fri Sep 24 23:01:00 2021 +0200
Commit: Luboš Luňák 
CommitDate: Mon Sep 27 11:36:01 2021 +0200

do not call osl_getProcessInfo() for ProfileZone if not recording

This call actually shows up as 6% for me when CPU profiling
CallbackFlushHandler. And I assume ProfileZone is not designed
for switching pid's or starting recording in the middle of profile
zones, so this should be fine.

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

diff --git a/include/comphelper/traceevent.hxx 
b/include/comphelper/traceevent.hxx
index 044d1686b35e..0bf4428b73ac 100644
--- a/include/comphelper/traceevent.hxx
+++ b/include/comphelper/traceevent.hxx
@@ -86,7 +86,7 @@ protected:
 const OUString m_sArgs;
 
 TraceEvent(const OUString& sArgs)
-: m_nPid(getPid())
+: m_nPid(s_bRecording ? getPid() : 1)
 , m_sArgs(sArgs)
 {
 }


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

2021-08-17 Thread Andrea Gelmini (via logerrit)
 include/comphelper/multicontainer2.hxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 3be26178dc29ed4f8637218e0d49d1bf77e124d2
Author: Andrea Gelmini 
AuthorDate: Tue Aug 17 15:50:23 2021 +0200
Commit: Julien Nabet 
CommitDate: Tue Aug 17 19:33:32 2021 +0200

Fix typo

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

diff --git a/include/comphelper/multicontainer2.hxx 
b/include/comphelper/multicontainer2.hxx
index 33f82dcb5c20..ad5ffca7cb95 100644
--- a/include/comphelper/multicontainer2.hxx
+++ b/include/comphelper/multicontainer2.hxx
@@ -42,7 +42,7 @@ class XInterface;
 /** */ //for docpp
 namespace comphelper
 {
-/** This is a copy of cppu::OMultiTypeInterfaceContainerHelper2 in 
include/ccppuhelper/interfacecontainer.h,
+/** This is a copy of cppu::OMultiTypeInterfaceContainerHelper2 in 
include/cppuhelper/interfacecontainer.h,
 except that it uses comphelper::OInterfaceContainerHelper2, which is more 
efficient.
 */
 class COMPHELPER_DLLPUBLIC OMultiTypeInterfaceContainerHelper2


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

2021-08-07 Thread Noel Grandin (via logerrit)
 include/comphelper/interfacecontainer3.hxx |   13 +
 1 file changed, 9 insertions(+), 4 deletions(-)

New commits:
commit e20d997eb3eb5c81af907718989aba4a6f9fc950
Author: Noel Grandin 
AuthorDate: Fri Aug 6 15:48:22 2021 +0200
Commit: Noel Grandin 
CommitDate: Sat Aug 7 10:27:34 2021 +0200

address some review comments

from
   https://gerrit.libreoffice.org/c/core/+/77824

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

diff --git a/include/comphelper/interfacecontainer3.hxx 
b/include/comphelper/interfacecontainer3.hxx
index 56cbeca61433..82fa1f5e6b3d 100644
--- a/include/comphelper/interfacecontainer3.hxx
+++ b/include/comphelper/interfacecontainer3.hxx
@@ -40,12 +40,12 @@ namespace comphelper
 {
 template  class OInterfaceContainerHelper3;
 /**
-  This is the iterator of an InterfaceContainerHelper. Typically
+  This is the iterator of an OInterfaceContainerHelper3. Typically
   one constructs an instance on the stack for one firing session.
   It is not allowed to assign or copy an instance of this class.
 
   @tparam ListenerT UNO event listener type
-  @see OInterfaceContainerHelper
+  @see OInterfaceContainerHelper3
  */
 template  class OInterfaceIteratorHelper3
 {
@@ -106,7 +106,12 @@ template  void 
OInterfaceIteratorHelper3::remove()
 
 /**
   A container of interfaces. To access the elements use an iterator.
-  This implementation is thread safe.
+  This implementation is thread-safe.
+
+  This is a copy of the code at include/comphelper/interfacecontainer2.hxx,
+  except that it is templatized on the type of the listener, which allows
+  some parts of the code to avoid doing an UNO_QUERY that can be expensive
+  in bulk.
 
   @tparam ListenerT UNO event listener type
   @see OInterfaceIteratorHelper
@@ -147,7 +152,7 @@ public:
 listener interface).
 
 @param rxIFace
-   interface to be added; it is allowed to
+   interface to be added; it is allowed to insert
the same interface more than once
 @return
 the new count of elements in the container


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

2021-08-07 Thread Noel Grandin (via logerrit)
 include/comphelper/interfacecontainer2.hxx |   12 
 1 file changed, 8 insertions(+), 4 deletions(-)

New commits:
commit e54c167de6a15adc61dea8a1ac3a31e202573afa
Author: Noel Grandin 
AuthorDate: Fri Aug 6 15:40:23 2021 +0200
Commit: Noel Grandin 
CommitDate: Sat Aug 7 09:23:35 2021 +0200

address some review comments

from
   https://gerrit.libreoffice.org/c/core/+/21643/6/

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

diff --git a/include/comphelper/interfacecontainer2.hxx 
b/include/comphelper/interfacecontainer2.hxx
index 626ef830211d..e001f56e6245 100644
--- a/include/comphelper/interfacecontainer2.hxx
+++ b/include/comphelper/interfacecontainer2.hxx
@@ -53,11 +53,11 @@ namespace detail {
 
 class OInterfaceContainerHelper2;
 /**
-  This is the iterator of an InterfaceContainerHelper. Typically
+  This is the iterator of an OInterfaceContainerHelper2. Typically
   one constructs an instance on the stack for one firing session.
   It is not allowed to assign or copy an instance of this class.
 
-  @see OInterfaceContainerHelper
+  @see OInterfaceContainerHelper2
  */
 class COMPHELPER_DLLPUBLIC OInterfaceIteratorHelper2
 {
@@ -111,9 +111,13 @@ private:
 
 /**
   A container of interfaces. To access the elements use an iterator.
-  This implementation is thread save.
+  This implementation is thread-safe.
 
-  @see OInterfaceIteratorHelper
+  This is a copy of the code at include/cppuhelper/interfacecontainer.h,
+  Except that it uses a std::vector instead of a Sequence for the mutable 
listener
+  list, which provides far better performance.
+
+  @see OInterfaceIteratorHelper2
  */
 class COMPHELPER_DLLPUBLIC OInterfaceContainerHelper2
 {


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

2021-07-05 Thread Tor Lillqvist (via logerrit)
 include/comphelper/profilezone.hxx |5 +
 1 file changed, 1 insertion(+), 4 deletions(-)

New commits:
commit bcaf8b746ab4a5f8fa08217b1081fdad4532425e
Author: Tor Lillqvist 
AuthorDate: Mon Jul 5 10:55:04 2021 +0300
Commit: Tor Lillqvist 
CommitDate: Mon Jul 5 10:41:55 2021 +0200

Simplification: Use getNow() here, too

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

diff --git a/include/comphelper/profilezone.hxx 
b/include/comphelper/profilezone.hxx
index 772a1b6f51be..b96b26baffc1 100644
--- a/include/comphelper/profilezone.hxx
+++ b/include/comphelper/profilezone.hxx
@@ -35,10 +35,7 @@ class COMPHELPER_DLLPUBLIC ProfileZone : public NamedEvent
 {
 if (s_bRecording)
 {
-TimeValue systemTime;
-osl_getSystemTime();
-m_nCreateTime
-= static_cast(systemTime.Seconds) * 100 + 
systemTime.Nanosec / 1000;
+m_nCreateTime = getNow();
 
 m_nNesting = s_nNesting++;
 }
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2021-06-09 Thread Tor Lillqvist (via logerrit)
 include/comphelper/profilezone.hxx |   39 ++---
 include/comphelper/traceevent.hxx  |   20 ++
 2 files changed, 39 insertions(+), 20 deletions(-)

New commits:
commit 0fa2bb31b53c2b9114480ab77e0db4e011691440
Author: Tor Lillqvist 
AuthorDate: Mon May 31 15:55:20 2021 +0300
Commit: Tor Lillqvist 
CommitDate: Wed Jun 9 16:52:15 2021 +0200

Avoid empty std::map constructor

Change-Id: Ie1bc333409fb201d82dd2cff7597e281600f01db
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/116449
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Tor Lillqvist 
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/116849
Tested-by: Jenkins

diff --git a/include/comphelper/profilezone.hxx 
b/include/comphelper/profilezone.hxx
index babd11f5b93b..08e6a8b031e8 100644
--- a/include/comphelper/profilezone.hxx
+++ b/include/comphelper/profilezone.hxx
@@ -31,6 +31,24 @@ class COMPHELPER_DLLPUBLIC ProfileZone : public NamedEvent
 
 void addRecording();
 
+ProfileZone(const char* sName, const OUString& sArgs, bool bConsole)
+: NamedEvent(sName, sArgs)
+, m_bConsole(bConsole)
+, m_nNesting(-1)
+{
+if (s_bRecording || m_bConsole)
+{
+TimeValue systemTime;
+osl_getSystemTime();
+m_nCreateTime
+= static_cast(systemTime.Seconds) * 100 + 
systemTime.Nanosec / 1000;
+
+m_nNesting = s_nNesting++;
+}
+else
+m_nCreateTime = 0;
+}
+
 public:
 /**
  * Starts measuring the cost of a C++ scope.
@@ -47,23 +65,14 @@ public:
  * Similar to the DEBUG macro in sal/log.hxx, don't forget to remove these 
lines before
  * committing.
  */
-ProfileZone(const char* sName, bool bConsole = false,
-const std::map& args = std::map())
-: NamedEvent(sName, args)
-, m_bConsole(bConsole)
-, m_nNesting(-1)
+ProfileZone(const char* sName, const std::map& aArgs, 
bool bConsole = false)
+: ProfileZone(sName, createArgsString(aArgs), bConsole)
 {
-if (s_bRecording || m_bConsole)
-{
-TimeValue systemTime;
-osl_getSystemTime();
-m_nCreateTime
-= static_cast(systemTime.Seconds) * 100 + 
systemTime.Nanosec / 1000;
+}
 
-m_nNesting = s_nNesting++;
-}
-else
-m_nCreateTime = 0;
+ProfileZone(const char* sName, bool bConsole = false)
+: ProfileZone(sName, OUString(), bConsole)
+{
 }
 
 ~ProfileZone()
diff --git a/include/comphelper/traceevent.hxx 
b/include/comphelper/traceevent.hxx
index 6e614ec0552e..5e2502de72a1 100644
--- a/include/comphelper/traceevent.hxx
+++ b/include/comphelper/traceevent.hxx
@@ -82,9 +82,14 @@ protected:
 const int m_nPid;
 const OUString m_sArgs;
 
-TraceEvent(std::map args)
+TraceEvent(const OUString& sArgs)
 : m_nPid(getPid())
-, m_sArgs(createArgsString(args))
+, m_sArgs(sArgs)
+{
+}
+
+TraceEvent(std::map aArgs)
+: TraceEvent(createArgsString(aArgs))
 {
 }
 
@@ -105,9 +110,14 @@ class COMPHELPER_DLLPUBLIC NamedEvent : public TraceEvent
 protected:
 const char* m_sName;
 
-NamedEvent(const char* sName,
-   const std::map& args = std::map())
-: TraceEvent(args)
+NamedEvent(const char* sName, const OUString& sArgs)
+: TraceEvent(sArgs)
+, m_sName(sName ? sName : "(null)")
+{
+}
+
+NamedEvent(const char* sName, const std::map& aArgs)
+: TraceEvent(aArgs)
 , m_sName(sName ? sName : "(null)")
 {
 }
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2021-04-29 Thread Tor Lillqvist (via logerrit)
 include/comphelper/profilezone.hxx |2 ++
 1 file changed, 2 insertions(+)

New commits:
commit c1c4d50d08eff7a38617839a896392a34c5183a2
Author: Tor Lillqvist 
AuthorDate: Thu Apr 29 11:24:56 2021 +0300
Commit: Tor Lillqvist 
CommitDate: Thu Apr 29 11:57:57 2021 +0200

cid#1477405 Initialize members

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

diff --git a/include/comphelper/profilezone.hxx 
b/include/comphelper/profilezone.hxx
index 8eda2d773ac0..3431c20efcea 100644
--- a/include/comphelper/profilezone.hxx
+++ b/include/comphelper/profilezone.hxx
@@ -51,6 +51,8 @@ public:
 ProfileZone(const char* sName, bool bConsole = false)
 : NamedEvent(sName)
 , m_bConsole(bConsole)
+, m_nPid(-1)
+, m_nNesting(-1)
 {
 if (s_bRecording || m_bConsole)
 {
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2021-04-28 Thread Tor Lillqvist (via logerrit)
 include/comphelper/profilezone.hxx |4 
 1 file changed, 4 insertions(+)

New commits:
commit 2d867eff480c03ab125f4c0149dd73afee08db85
Author: Tor Lillqvist 
AuthorDate: Tue Apr 27 09:49:21 2021 +0300
Commit: Tor Lillqvist 
CommitDate: Wed Apr 28 13:43:19 2021 +0200

Make ProfileZone non-copyable

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

diff --git a/include/comphelper/profilezone.hxx 
b/include/comphelper/profilezone.hxx
index 529e3d411742..474b296f184c 100644
--- a/include/comphelper/profilezone.hxx
+++ b/include/comphelper/profilezone.hxx
@@ -71,6 +71,7 @@ public:
 startConsole();
 }
 }
+
 ~ProfileZone()
 {
 if (s_bRecording)
@@ -84,6 +85,9 @@ public:
 }
 }
 
+ProfileZone(const ProfileZone&) = delete;
+void operator=(const ProfileZone&) = delete;
+
 static void startRecording();
 static void stopRecording();
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2021-04-07 Thread Mike Kaganski (via logerrit)
 include/comphelper/servicehelper.hxx |7 ++-
 1 file changed, 2 insertions(+), 5 deletions(-)

New commits:
commit c89bfbc0d6491c02acfc391372750f787c17531b
Author: Mike Kaganski 
AuthorDate: Wed Apr 7 14:54:22 2021 +0300
Commit: Mike Kaganski 
CommitDate: Wed Apr 7 15:39:31 2021 +0200

rtl::Static -> function local static also for UNO3_GETIMPLEMENTATION*_IMPL

Follow-up to 07fd90cc7d85a89b9f74efba7ddc9ac457110ce3

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

diff --git a/include/comphelper/servicehelper.hxx 
b/include/comphelper/servicehelper.hxx
index 435a4c4ff5b7..2fe01bc5255c 100644
--- a/include/comphelper/servicehelper.hxx
+++ b/include/comphelper/servicehelper.hxx
@@ -77,13 +77,10 @@ inline bool isUnoTunnelId(const css::uno::Sequence< 
sal_Int8 >& rId)
 virtual sal_Int64 SAL_CALL getSomething( const css::uno::Sequence< 
sal_Int8 >& aIdentifier ) override;
 
 #define UNO3_GETIMPLEMENTATION_BASE_IMPL( classname ) \
-namespace \
-{ \
-class the##classname##UnoTunnelId : public rtl::Static< UnoTunnelIdInit, 
the##classname##UnoTunnelId> {}; \
-} \
 const css::uno::Sequence< sal_Int8 > & classname::getUnoTunnelId() throw() \
 { \
-return the##classname##UnoTunnelId::get().getSeq(); \
+static const UnoTunnelIdInit aId; \
+return aId.getSeq(); \
 }
 
 #define UNO3_GETIMPLEMENTATION_IMPL( classname )\
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2021-01-14 Thread Mike Kaganski (via logerrit)
 include/comphelper/stl_types.hxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit af343d6bc40cf97007632247c1af662a4587f155
Author: Mike Kaganski 
AuthorDate: Thu Jan 14 09:22:02 2021 +0100
Commit: Mike Kaganski 
CommitDate: Thu Jan 14 13:21:21 2021 +0100

Make lambda auto parameters explicitly const

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

diff --git a/include/comphelper/stl_types.hxx b/include/comphelper/stl_types.hxx
index 613644ad218a..983247a84713 100644
--- a/include/comphelper/stl_types.hxx
+++ b/include/comphelper/stl_types.hxx
@@ -84,7 +84,7 @@ bool ContainerUniquePtrEquals(
 {
 return lhs.size() == rhs.size()
&& std::equal(lhs.begin(), lhs.end(), rhs.begin(),
- [](auto& p1, auto& p2) { return *p1 == *p2; });
+ [](const auto& p1, const auto& p2) { return *p1 == 
*p2; });
 };
 
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2021-01-13 Thread Mike Kaganski (via logerrit)
 include/comphelper/stl_types.hxx |   18 --
 1 file changed, 4 insertions(+), 14 deletions(-)

New commits:
commit 1a24fef6b3e24645dccfa7f13dd71d8f5019dd94
Author: Mike Kaganski 
AuthorDate: Wed Jan 13 15:17:44 2021 +0100
Commit: Mike Kaganski 
CommitDate: Wed Jan 13 21:32:16 2021 +0100

Simplify comphelper::ContainerUniquePtrEquals

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

diff --git a/include/comphelper/stl_types.hxx b/include/comphelper/stl_types.hxx
index 73e16e1a6d03..613644ad218a 100644
--- a/include/comphelper/stl_types.hxx
+++ b/include/comphelper/stl_types.hxx
@@ -21,6 +21,7 @@
 
 #include 
 
+#include 
 #include 
 #include 
 
@@ -81,20 +82,9 @@ bool ContainerUniquePtrEquals(
 C, Etc...> const& lhs,
 C, Etc...> const& rhs)
 {
-if (lhs.size() != rhs.size())
-{
-return false;
-}
-for (auto iter1 = lhs.begin(), iter2 = rhs.begin();
- iter1 != lhs.end();
- ++iter1, ++iter2)
-{
-if (!(**iter1 == **iter2))
-{
-return false;
-}
-}
-return true;
+return lhs.size() == rhs.size()
+   && std::equal(lhs.begin(), lhs.end(), rhs.begin(),
+ [](auto& p1, auto& p2) { return *p1 == *p2; });
 };
 
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2020-11-18 Thread Ashod Nakashian (via logerrit)
 include/comphelper/lok.hxx |   10 --
 1 file changed, 10 deletions(-)

New commits:
commit 8f79f590662145b054661846e018a4fc1837db8a
Author: Ashod Nakashian 
AuthorDate: Fri Sep 18 17:11:09 2020 -0400
Commit: Ashod Nakashian 
CommitDate: Thu Nov 19 05:55:00 2020 +0100

lok: remove unused API

Change-Id: Ibf3039f0f5d8b580e8d93c77d7adb9c4b90ba67a
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/105365
Tested-by: Jenkins
Reviewed-by: Ashod Nakashian 

diff --git a/include/comphelper/lok.hxx b/include/comphelper/lok.hxx
index b8276ea49fc6..2391ceab3661 100644
--- a/include/comphelper/lok.hxx
+++ b/include/comphelper/lok.hxx
@@ -26,16 +26,6 @@ namespace comphelper::LibreOfficeKit
 
 COMPHELPER_DLLPUBLIC void setActive(bool bActive = true);
 
-// Call either setMobilePhone() or setTablet() for a view, and at most once. 
(If neither is called,
-// the view is assumed to be on a desktop browser.) In the future, this will 
possibly be changed
-// into using an enum for the kind of the view, that can be DESKTOP, 
MOBILEPHONE, or TABLET.
-
-// Tell that LOK view is on a mobile phone (regardless what its pixel 
resolution is, whether its form factor is "phablet" or not)
-COMPHELPER_DLLPUBLIC void setMobilePhone(int nViewId);
-
-// Tell that LOK view is on a tablet
-COMPHELPER_DLLPUBLIC void setTablet(int nViewId);
-
 enum class statusIndicatorCallbackType { Start, SetValue, Finish };
 
 COMPHELPER_DLLPUBLIC void setStatusIndicatorCallback(void (*callback)(void 
*data, statusIndicatorCallbackType type, int percent), void *data);
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: include/comphelper include/dbaccess include/test

2020-09-25 Thread Andrea Gelmini (via logerrit)
 include/comphelper/AccessibleImplementationHelper.hxx |5 +
 include/dbaccess/AsynchronousLink.hxx |4 +---
 include/test/sheet/xarrayformularange.hxx |5 +
 3 files changed, 3 insertions(+), 11 deletions(-)

New commits:
commit 6505f43b09fda83f26159746083b971bfab8054a
Author: Andrea Gelmini 
AuthorDate: Thu Sep 24 12:55:55 2020 +0200
Commit: Andrea Gelmini 
CommitDate: Fri Sep 25 08:27:22 2020 +0200

tdf#124176 Use #pragma once in some include/

switch to #pragma

It passed "make check" on Linux

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

diff --git a/include/comphelper/AccessibleImplementationHelper.hxx 
b/include/comphelper/AccessibleImplementationHelper.hxx
index 742c56f195bb..b6c8d9ab0d85 100644
--- a/include/comphelper/AccessibleImplementationHelper.hxx
+++ b/include/comphelper/AccessibleImplementationHelper.hxx
@@ -17,8 +17,7 @@
  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
  */
 
-#ifndef INCLUDED_COMPHELPER_ACESSIBLEIMPLEMENTATIONHELPER_HXX
-#define INCLUDED_COMPHELPER_ACESSIBLEIMPLEMENTATIONHELPER_HXX
+#pragma once
 
 #include 
 #include 
@@ -43,6 +42,4 @@ COMPHELPER_DLLPUBLIC OUString
 GetkeyBindingStrByXkeyBinding(const css::uno::Sequence& 
keySet);
 }
 
-#endif // INCLUDED_COMPHELPER_ACESSIBLEIMPLEMENTATIONHELPER_HXX
-
 /* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s 
cinkeys+=0=break: */
diff --git a/include/dbaccess/AsynchronousLink.hxx 
b/include/dbaccess/AsynchronousLink.hxx
index c2779be5334a..0b63cbed957d 100644
--- a/include/dbaccess/AsynchronousLink.hxx
+++ b/include/dbaccess/AsynchronousLink.hxx
@@ -17,8 +17,7 @@
  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
  */
 
-#ifndef INCLUDED_DBACCESS_ASYNCRONOUSLINK_HXX
-#define INCLUDED_DBACCESS_ASYNCRONOUSLINK_HXX
+#pragma once
 
 #include 
 #include 
@@ -57,6 +56,5 @@ namespace dbaui
 void CancelCall();
 };
 }
-#endif // INCLUDED_DBACCESS_ASYNCRONOUSLINK_HXX
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/test/sheet/xarrayformularange.hxx 
b/include/test/sheet/xarrayformularange.hxx
index 8f54f7097ba6..2529b8153fc5 100644
--- a/include/test/sheet/xarrayformularange.hxx
+++ b/include/test/sheet/xarrayformularange.hxx
@@ -7,8 +7,7 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/.
  */
 
-#ifndef INCLUDED_TEST_SHEET_XARRAUFORMULARANGE_HXX
-#define INCLUDED_TEST_SHEET_XARRAUFORMULARANGE_HXX
+#pragma once
 
 #include 
 #include 
@@ -30,6 +29,4 @@ protected:
 };
 } // namespace apitest
 
-#endif // INCLUDED_TEST_SHEET_XARRAUFORMULARANGE_HXX
-
 /* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s 
cinkeys+=0=break: */
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2020-09-01 Thread Andrea Gelmini (via logerrit)
 include/comphelper/propertycontainerhelper.hxx |4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

New commits:
commit 453c7070692b6adfdf019c50238dc48c66d2a590
Author: Andrea Gelmini 
AuthorDate: Mon Aug 31 16:12:06 2020 +0200
Commit: Julien Nabet 
CommitDate: Tue Sep 1 08:43:43 2020 +0200

Fix typo

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

diff --git a/include/comphelper/propertycontainerhelper.hxx 
b/include/comphelper/propertycontainerhelper.hxx
index 6564cc0f85b3..eb213e4541ec 100644
--- a/include/comphelper/propertycontainerhelper.hxx
+++ b/include/comphelper/propertycontainerhelper.hxx
@@ -86,7 +86,7 @@ protected:
 ~OPropertyContainerHelper();
 
 /** register a property. The property is represented through a member of 
the derived class which calls
-this methdod.
+this method.
 @param  _rName  the name of the property
 @param  _nHandlethe handle of the property
 @param  _nAttributesthe attributes of the property
@@ -100,7 +100,7 @@ protected:
 
 
 /** register a property. The property is represented through a 
css::uno::Any member of the
-derived class which calls this methdod.
+derived class which calls this method.
 @param  _rName  the name of the property
 @param  _nHandlethe handle of the property
 @param  _nAttributesthe attributes of the property
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: include/comphelper sc/source xmloff/source

2020-07-25 Thread Mike Kaganski (via logerrit)
 include/comphelper/SetFlagContextHelper.hxx |8 
 sc/source/ui/view/prevwsh.cxx   |5 +
 xmloff/source/core/xmlexp.cxx   |7 ++-
 3 files changed, 19 insertions(+), 1 deletion(-)

New commits:
commit 592a02b2869aa04cb6d95cb3d491cd7c5455bd0a
Author: Mike Kaganski 
AuthorDate: Sat Jul 25 14:21:33 2020 +0300
Commit: Mike Kaganski 
CommitDate: Sat Jul 25 14:37:17 2020 +0200

tdf#130559: don't export preview view data to ODS

... because trying to activate this view on load will throw and crash

Unlike in Writer (SwPagePreview), Calc's ScPreviewShell overrides
WriteUserDataSequence to export the view data. This was implemented
in commit 1f51730f3c5b05c3afaa35431c925482e8152783. That does not
give any clue why is this necessary, so I don't want to revert it.
So to pass the flag to XViewDataSupplier::getViewData, this patch
sets the flag in current context using comphelper::NewFlagContext.
This allows to only skip providing the data conditionally.

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

diff --git a/include/comphelper/SetFlagContextHelper.hxx 
b/include/comphelper/SetFlagContextHelper.hxx
index d209e398aeab..1f1e2743cea9 100644
--- a/include/comphelper/SetFlagContextHelper.hxx
+++ b/include/comphelper/SetFlagContextHelper.hxx
@@ -56,6 +56,14 @@ inline css::uno::Reference 
NoEnableJavaInteractionCon
 return NewFlagContext("DontEnableJava");
 }
 
+inline bool IsContextFlagActive(const OUString& sName)
+{
+bool bFlag = false;
+if (const auto xContext = css::uno::getCurrentContext())
+xContext->getValueByName(sName) >>= bFlag;
+return bFlag;
+}
+
 } // namespace comphelper
 
 #endif // INCLUDED_COMPHELPER_SETFLAGCONTEXTHELPER_HXX
diff --git a/sc/source/ui/view/prevwsh.cxx b/sc/source/ui/view/prevwsh.cxx
index dbb23ca68e42..86986ee99fb6 100644
--- a/sc/source/ui/view/prevwsh.cxx
+++ b/sc/source/ui/view/prevwsh.cxx
@@ -21,6 +21,7 @@
 
 #include 
 
+#include 
 #include 
 #include 
 #include 
@@ -916,6 +917,10 @@ void ScPreviewShell::ReadUserData(const OUString& rData, 
bool /* bBrowse */)
 
 void ScPreviewShell::WriteUserDataSequence(uno::Sequence < 
beans::PropertyValue >& rSeq)
 {
+// tdf#130559: don't export preview view data if active
+if (comphelper::IsContextFlagActive("NoPreviewData"))
+return;
+
 rSeq.realloc(3);
 beans::PropertyValue* pSeq = rSeq.getArray();
 sal_uInt16 nViewID(GetViewFrame()->GetCurViewId());
diff --git a/xmloff/source/core/xmlexp.cxx b/xmloff/source/core/xmlexp.cxx
index 59a3c9a00a35..235aa867c221 100644
--- a/xmloff/source/core/xmlexp.cxx
+++ b/xmloff/source/core/xmlexp.cxx
@@ -81,6 +81,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 
 #include 
@@ -1735,7 +1736,11 @@ void 
SvXMLExport::GetViewSettingsAndViews(uno::Sequence& r
 {
 uno::Reference xIndexAccess;
 xViewDataSupplier->setViewData( xIndexAccess ); // make sure we get a 
newly created sequence
-xIndexAccess = xViewDataSupplier->getViewData();
+{
+// tdf#130559: don't export preview view data if active
+css::uno::ContextLayer 
layer(comphelper::NewFlagContext("NoPreviewData"));
+xIndexAccess = xViewDataSupplier->getViewData();
+}
 bool bAdd = false;
 uno::Any aAny;
 if(xIndexAccess.is() && xIndexAccess->hasElements() )
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2020-07-19 Thread Noel Grandin (via logerrit)
 include/comphelper/automationinvokedzone.hxx |5 +
 include/comphelper/graphicmimetype.hxx   |   22 ++
 include/comphelper/interfacecontainer3.hxx   |   11 +--
 include/comphelper/lok.hxx   |6 +-
 include/comphelper/ofopxmlhelper.hxx |9 ++---
 include/comphelper/random.hxx|7 +--
 include/comphelper/servicedecl.hxx   |6 ++
 include/comphelper/xmlsechelper.hxx  |7 ++-
 include/comphelper/xmltools.hxx  |6 +-
 9 files changed, 13 insertions(+), 66 deletions(-)

New commits:
commit a8503fd5b8a72309f4d643b1db7ae41ced38ba80
Author: Noel Grandin 
AuthorDate: Sun Jul 19 18:45:07 2020 +0200
Commit: Noel Grandin 
CommitDate: Sun Jul 19 19:44:54 2020 +0200

compact namespace: comphelper

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

diff --git a/include/comphelper/automationinvokedzone.hxx 
b/include/comphelper/automationinvokedzone.hxx
index 13b674efa7e1..81b0bfab6b4d 100644
--- a/include/comphelper/automationinvokedzone.hxx
+++ b/include/comphelper/automationinvokedzone.hxx
@@ -15,9 +15,7 @@
 // Helpers for use when calling into LO from an Automation (OLE
 // Automation) client.
 
-namespace comphelper
-{
-namespace Automation
+namespace comphelper::Automation
 {
 // Create an object of this class at the start of a function directly invoked 
from an Automation
 // client.
@@ -32,7 +30,6 @@ public:
 static bool isActive();
 };
 }
-}
 
 #endif // INCLUDED_COMPHELPER_AUTOMATIONINVOKEDZONE_HXX
 
diff --git a/include/comphelper/graphicmimetype.hxx 
b/include/comphelper/graphicmimetype.hxx
index c278ee669d03..5380c43a4cb0 100644
--- a/include/comphelper/graphicmimetype.hxx
+++ b/include/comphelper/graphicmimetype.hxx
@@ -16,32 +16,14 @@
 
 #include 
 
-namespace com
-{
-namespace sun
-{
-namespace star
-{
-namespace graphic
+namespace com::sun::star::graphic
 {
 class XGraphic;
 }
-}
-}
-}
-namespace com
-{
-namespace sun
-{
-namespace star
-{
-namespace io
+namespace com::sun::star::io
 {
 class XInputStream;
 }
-}
-}
-}
 
 namespace comphelper
 {
diff --git a/include/comphelper/interfacecontainer3.hxx 
b/include/comphelper/interfacecontainer3.hxx
index d912777fe724..56cbeca61433 100644
--- a/include/comphelper/interfacecontainer3.hxx
+++ b/include/comphelper/interfacecontainer3.hxx
@@ -26,19 +26,10 @@
 #include 
 #include 
 
-namespace com
-{
-namespace sun
-{
-namespace star
-{
-namespace uno
+namespace com::sun::star::uno
 {
 class XInterface;
 }
-}
-}
-}
 namespace osl
 {
 class Mutex;
diff --git a/include/comphelper/lok.hxx b/include/comphelper/lok.hxx
index a457c47b00a5..b8276ea49fc6 100644
--- a/include/comphelper/lok.hxx
+++ b/include/comphelper/lok.hxx
@@ -18,10 +18,7 @@ class LanguageTag;
 // Interface between the LibreOfficeKit implementation called by 
LibreOfficeKit clients and other
 // LibreOffice code.
 
-namespace comphelper
-{
-
-namespace LibreOfficeKit
+namespace comphelper::LibreOfficeKit
 {
 
 // Functions to be called only from the LibreOfficeKit implementation in 
desktop, not from other
@@ -118,7 +115,6 @@ COMPHELPER_DLLPUBLIC void statusIndicatorStart();
 COMPHELPER_DLLPUBLIC void statusIndicatorSetValue(int percent);
 COMPHELPER_DLLPUBLIC void statusIndicatorFinish();
 
-}
 }
 
 #endif // INCLUDED_COMPHELPER_LOK_HXX
diff --git a/include/comphelper/ofopxmlhelper.hxx 
b/include/comphelper/ofopxmlhelper.hxx
index d4efbf39b4f4..2fa651406411 100644
--- a/include/comphelper/ofopxmlhelper.hxx
+++ b/include/comphelper/ofopxmlhelper.hxx
@@ -30,10 +30,7 @@ namespace com::sun::star::io { class XOutputStream; }
 namespace com::sun::star::uno { class XComponentContext; }
 namespace com::sun::star::uno { template  class 
Reference; }
 
-namespace comphelper
-{
-
-namespace OFOPXMLHelper {
+namespace comphelper::OFOPXMLHelper {
 
 // returns sequence of elements, where each element is described by 
sequence of tags,
 // where each tag is described by StringPair ( First - name, Second - 
value )
@@ -93,9 +90,7 @@ namespace OFOPXMLHelper {
 const css::uno::Sequence< css::beans::StringPair >& aOverridesSequence,
 const css::uno::Reference< css::uno::XComponentContext >& rContext );
 
-} // namespace OFOPXMLHelper
-
-} // namespace comphelper
+} // namespace comphelper::OFOPXMLHelper
 
 #endif
 
diff --git a/include/comphelper/random.hxx b/include/comphelper/random.hxx
index 218d61683a1c..4eee4ff2de1f 100644
--- a/include/comphelper/random.hxx
+++ b/include/comphelper/random.hxx
@@ -12,10 +12,7 @@
 
 #include 
 
-namespace comphelper
-{
-
-namespace rng
+namespace comphelper::rng
 {
 
 // These functions obey the SAL_RAND_REPEATABLE environment
@@ -38,8 +35,6 @@ COMPHELPER_DLLPUBLIC size_t uniform_size_distribution(size_t 
a, size_t b);
 
 } // namespace
 
-} // namespace
-
 #endif
 
 /* 

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

2020-04-28 Thread Andrea Gelmini (via logerrit)
 include/comphelper/evtmethodhelper.hxx |6 ++
 1 file changed, 2 insertions(+), 4 deletions(-)

New commits:
commit f6b828275af11f8b04a52a9ad5f44e210d4fec0b
Author: Andrea Gelmini 
AuthorDate: Sun Apr 26 17:21:37 2020 +0200
Commit: Julien Nabet 
CommitDate: Tue Apr 28 17:32:51 2020 +0200

tdf#124176: Use pragma once instead of include guards

Started to fix typo, eventually #pragma

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

diff --git a/include/comphelper/evtmethodhelper.hxx 
b/include/comphelper/evtmethodhelper.hxx
index 2539ea0b8441..7c900a1a8324 100644
--- a/include/comphelper/evtmethodhelper.hxx
+++ b/include/comphelper/evtmethodhelper.hxx
@@ -16,8 +16,8 @@
  *   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_COMPHELPER_EVTMETHODHELPER_HXX
-#define INCLUDED_COMPHELPER_EVTMETHODHELPER_HXX
+
+#pragma once
 
 #include 
 #include 
@@ -29,6 +29,4 @@ namespace comphelper
 
 }   // namespace comphelper
 
-#endif // COMPHELPER_EVENTMEHODHELPER_HXX
-
 /* 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: include/comphelper sw/source

2020-03-31 Thread Mike Kaganski (via logerrit)
 include/comphelper/flagguard.hxx   |   29 -
 sw/source/filter/ww8/docxsdrexport.cxx |   15 +++
 2 files changed, 19 insertions(+), 25 deletions(-)

New commits:
commit 00748b30660abe34ae980cdc7b1a24ac305a90b2
Author: Mike Kaganski 
AuthorDate: Tue Mar 31 17:15:36 2020 +0300
Commit: Mike Kaganski 
CommitDate: Tue Mar 31 18:11:45 2020 +0200

Introduce comphelper::ValueRestorationGuard extending FlagRestorationGuard

... to any value type.

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

diff --git a/include/comphelper/flagguard.hxx b/include/comphelper/flagguard.hxx
index 44d2f4f73ab4..14eee07a8401 100644
--- a/include/comphelper/flagguard.hxx
+++ b/include/comphelper/flagguard.hxx
@@ -21,37 +21,40 @@
 #define INCLUDED_COMPHELPER_FLAGGUARD_HXX
 
 #include 
-
+#include 
 
 namespace comphelper
 {
 
-//= FlagRestorationGuard
+//= ValueRestorationGuard
 
-// note: can't store the originalValue in a FlagRestorationGuard member,
+// note: can't store the originalValue in a ValueRestorationGuard member,
 // because it will be used from base class dtor
-struct FlagRestorationGuard_Impl
+template  struct ValueRestorationGuard_Impl
 {
-bool & rFlag;
-bool const originalValue;
-FlagRestorationGuard_Impl(bool & i_flagRef)
-: rFlag(i_flagRef), originalValue(i_flagRef) {}
+T& rVal;
+T const originalValue;
+ValueRestorationGuard_Impl(T& i_valRef)
+: rVal(i_valRef), originalValue(i_valRef) {}
 void operator()()
 {
-rFlag = originalValue;
+rVal = originalValue;
 }
 };
 
-class FlagRestorationGuard : public ScopeGuard
+template 
+class ValueRestorationGuard : public 
ScopeGuard>
 {
 public:
-FlagRestorationGuard( bool& i_flagRef, bool i_temporaryValue )
-: ScopeGuard(FlagRestorationGuard_Impl(i_flagRef))
+template 
+ValueRestorationGuard(T& i_valRef, T1&& i_temporaryValue)
+: 
ScopeGuard>(ValueRestorationGuard_Impl(i_valRef))
 {
-i_flagRef = i_temporaryValue;
+i_valRef = std::forward(i_temporaryValue);
 }
 };
 
+typedef ValueRestorationGuard FlagRestorationGuard;
 
 //= FlagGuard
 
diff --git a/sw/source/filter/ww8/docxsdrexport.cxx 
b/sw/source/filter/ww8/docxsdrexport.cxx
index 62a35f1ab3b5..55b0a4169ac2 100644
--- a/sw/source/filter/ww8/docxsdrexport.cxx
+++ b/sw/source/filter/ww8/docxsdrexport.cxx
@@ -1129,10 +1129,7 @@ void DocxSdrExport::writeOnlyTextOfFrame(ww8::Frame 
const* pParentFrame)
 
 
m_pImpl->setBodyPrAttrList(sax_fastparser::FastSerializerHelper::createAttrList());
 ::comphelper::FlagRestorationGuard const g(m_pImpl->m_bFlyFrameGraphic, 
true);
-auto const nTextTyp(m_pImpl->getExport().m_nTextTyp);
-m_pImpl->getExport().m_nTextTyp = TXT_TXTBOX;
-::comphelper::ScopeGuard const sg(
-[this, nTextTyp]() { m_pImpl->getExport().m_nTextTyp = nTextTyp; });
+comphelper::ValueRestorationGuard vg(m_pImpl->getExport().m_nTextTyp, 
TXT_TXTBOX);
 m_pImpl->getExport().WriteText();
 }
 
@@ -1388,10 +1385,7 @@ void DocxSdrExport::writeDMLTextFrame(ww8::Frame const* 
pParentFrame, int nAncho
 
 {
 ::comphelper::FlagRestorationGuard const 
g(m_pImpl->m_bFlyFrameGraphic, true);
-auto const nTextTyp(m_pImpl->getExport().m_nTextTyp);
-m_pImpl->getExport().m_nTextTyp = TXT_TXTBOX;
-::comphelper::ScopeGuard const sg(
-[this, nTextTyp]() { m_pImpl->getExport().m_nTextTyp = 
nTextTyp; });
+comphelper::ValueRestorationGuard 
vg(m_pImpl->getExport().m_nTextTyp, TXT_TXTBOX);
 m_pImpl->getExport().WriteText();
 if (m_pImpl->getParagraphSdtOpen())
 {
@@ -1542,10 +1536,7 @@ void DocxSdrExport::writeVMLTextFrame(ww8::Frame const* 
pParentFrame, bool bText
 pFS->startElementNS(XML_w, XML_txbxContent);
 {
 ::comphelper::FlagRestorationGuard const 
g(m_pImpl->m_bFlyFrameGraphic, true);
-auto const nTextTyp(m_pImpl->getExport().m_nTextTyp);
-m_pImpl->getExport().m_nTextTyp = TXT_TXTBOX;
-::comphelper::ScopeGuard const sg(
-[this, nTextTyp]() { m_pImpl->getExport().m_nTextTyp = nTextTyp; 
});
+comphelper::ValueRestorationGuard vg(m_pImpl->getExport().m_nTextTyp, 
TXT_TXTBOX);
 m_pImpl->getExport().WriteText();
 if (m_pImpl->getParagraphSdtOpen())
 {
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2020-03-20 Thread Tor Lillqvist (via logerrit)
 include/comphelper/lok.hxx |5 +
 1 file changed, 5 insertions(+)

New commits:
commit f4cb7a249ebe62c7009bf0ca2f02ea89c1a75a68
Author: Tor Lillqvist 
AuthorDate: Wed Mar 18 10:58:52 2020 +0200
Commit: Tor Lillqvist 
CommitDate: Fri Mar 20 15:11:27 2020 +0100

Clarify the WIP-ness of setMobilePhone() and setTablet() a bit

Change-Id: Iee8b773e23ebd3fbc1ba5bf2c56d644d0844cb2d
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/90682
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Tor Lillqvist 
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/90779
Tested-by: Jenkins

diff --git a/include/comphelper/lok.hxx b/include/comphelper/lok.hxx
index d88ddfd1dfa5..43191db90ec0 100644
--- a/include/comphelper/lok.hxx
+++ b/include/comphelper/lok.hxx
@@ -29,6 +29,11 @@ namespace LibreOfficeKit
 
 COMPHELPER_DLLPUBLIC void setActive(bool bActive = true);
 
+// Note that currently it is undefined behaviour to call both setMobilePhone() 
and setTablet(). This
+// will be remedied in the future. For now, just make sure you call just 
either for a view, and just
+// once, with the bool parameter as true. In the future, this will probably be 
changed into using an
+// enum for the kind of the view, that can be DESKTOP, MOBILEPHONE, or TABLET.
+
 // Tell that LOK view is on a mobile phone (regardless what its pixel 
resolution is, whether its form factor is "phablet" or not)
 COMPHELPER_DLLPUBLIC void setMobilePhone(int nViewId, bool bIsMobilePhone);
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2019-12-12 Thread Mike Kaganski (via logerrit)
 include/comphelper/propertysequence.hxx |   27 ---
 1 file changed, 12 insertions(+), 15 deletions(-)

New commits:
commit 4a8d3b80283cec4a93dd697eab70afcb82f04f4f
Author: Mike Kaganski 
AuthorDate: Thu Dec 12 09:24:25 2019 +0100
Commit: Mike Kaganski 
CommitDate: Thu Dec 12 10:21:37 2019 +0100

Use std::transform instead of for loop

This simplifies the functions, and avoids repeated non-const operator[] on
sequences, which has significant overhead.

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

diff --git a/include/comphelper/propertysequence.hxx 
b/include/comphelper/propertysequence.hxx
index c384edb2848d..3f9838f9ab8f 100644
--- a/include/comphelper/propertysequence.hxx
+++ b/include/comphelper/propertysequence.hxx
@@ -11,6 +11,7 @@
 #define INCLUDED_COMPHELPER_PROPERTYSEQUENCE_HXX
 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -23,15 +24,11 @@ namespace comphelper
 ::std::initializer_list< ::std::pair< OUString, css::uno::Any > > 
vInit)
 {
 css::uno::Sequence< css::beans::PropertyValue> 
vResult{static_cast(vInit.size())};
-size_t nCount{0};
-for(const auto& aEntry : vInit)
-{
-vResult[nCount].Name = aEntry.first;
-vResult[nCount].Handle = -1;
-vResult[nCount].Value = aEntry.second;
-// State is default-initialized to DIRECT_VALUE
-++nCount;
-}
+std::transform(vInit.begin(), vInit.end(), vResult.begin(),
+   [](const std::pair& rInit) {
+   return css::beans::PropertyValue(rInit.first, -1, 
rInit.second,
+
css::beans::PropertyState_DIRECT_VALUE);
+   });
 return vResult;
 }
 
@@ -43,12 +40,12 @@ namespace comphelper
 ::std::initializer_list< ::std::pair< OUString, css::uno::Any > > 
vInit)
 {
 css::uno::Sequence 
vResult{static_cast(vInit.size())};
-size_t nCount{0};
-for(const auto& aEntry : vInit)
-{
-vResult[nCount] <<= css::beans::PropertyValue(aEntry.first, -1, 
aEntry.second, css::beans::PropertyState_DIRECT_VALUE);
-++nCount;
-}
+std::transform(vInit.begin(), vInit.end(), vResult.begin(),
+   [](const std::pair& rInit) {
+   return css::uno::Any(
+   css::beans::PropertyValue(rInit.first, -1, 
rInit.second,
+ 
css::beans::PropertyState_DIRECT_VALUE));
+   });
 return vResult;
 }
 }   // namespace comphelper
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: include/comphelper offapi/com sc/source sd/source svx/source sw/source

2019-11-18 Thread Noel Grandin (via logerrit)
 include/comphelper/accflowenum.hxx|   10 
 offapi/com/sun/star/accessibility/XAccessibleGetAccFlowTo.idl |1 
 sc/source/ui/Accessibility/AccessibleDocument.cxx |  101 +---
 sd/source/ui/accessibility/AccessibleDrawDocumentView.cxx |   97 ++--
 svx/source/dialog/srchdlg.cxx |8 
 sw/source/core/access/accdoc.cxx  |  119 ++
 6 files changed, 94 insertions(+), 242 deletions(-)

New commits:
commit efab55fee25c5a2f5a0c491c1ceab721c267af17
Author: Noel Grandin 
AuthorDate: Mon Nov 18 10:15:15 2019 +0200
Commit: Noel Grandin 
CommitDate: Mon Nov 18 11:15:48 2019 +0100

convert AccessibilityFlowTo to scoped enum

and drop the unused FORSPELLCHECKFLOWTO

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

diff --git a/include/comphelper/accflowenum.hxx 
b/include/comphelper/accflowenum.hxx
index fc6b7ea2d8ec..a5e3b9eb680a 100644
--- a/include/comphelper/accflowenum.hxx
+++ b/include/comphelper/accflowenum.hxx
@@ -22,11 +22,13 @@
 
 #include 
 
-enum AccessibilityFlowTo : sal_Int32
+/**
+  enum for css::accessibility::XAccessibleGetAccFlowTo::getAccFlowTo method
+*/
+enum class AccessibilityFlowTo : sal_Int32
 {
-FORSPELLCHECKFLOWTO = 1,
-FORFINDREPLACEFLOWTO_ITEM = 2,
-FORFINDREPLACEFLOWTO_RANGE = 3
+ForFindReplaceItem = 2,
+ForFindReplaceRange = 3
 };
 
 #endif // INCLUDED_COMPHELPER_ACCFLOWENUM_HXX
diff --git a/offapi/com/sun/star/accessibility/XAccessibleGetAccFlowTo.idl 
b/offapi/com/sun/star/accessibility/XAccessibleGetAccFlowTo.idl
index 56246775b5cc..0e8f9cd69ae4 100644
--- a/offapi/com/sun/star/accessibility/XAccessibleGetAccFlowTo.idl
+++ b/offapi/com/sun/star/accessibility/XAccessibleGetAccFlowTo.idl
@@ -28,6 +28,7 @@ module com { module sun { module star { module accessibility {
 // !!!
 interface XAccessibleGetAccFlowTo : ::com::sun::star::uno::XInterface
 {
+// @param nType see include/comphelper/accflowenum.hxx
 sequence getAccFlowTo([in] any aXShape, [in] long nType);
 };
 
diff --git a/sc/source/ui/Accessibility/AccessibleDocument.cxx 
b/sc/source/ui/Accessibility/AccessibleDocument.cxx
index e10636b5e678..836106cf193e 100644
--- a/sc/source/ui/Accessibility/AccessibleDocument.cxx
+++ b/sc/source/ui/Accessibility/AccessibleDocument.cxx
@@ -2279,95 +2279,34 @@ css::uno::Sequence< css::uno::Any > 
ScAccessibleDocument::GetScAccFlowToSequence
 css::uno::Sequence< css::uno::Any >
 SAL_CALL ScAccessibleDocument::getAccFlowTo(const css::uno::Any& rAny, 
sal_Int32 nType)
 {
+AccessibilityFlowTo eType = static_cast(nType);
+
+#if OSL_DEBUG_LEVEL > 0 && !defined NDEBUG
+assert(eType == AccessibilityFlowTo::ForFindReplaceItem || eType == 
AccessibilityFlowTo::ForFindReplaceRange);
+#endif
+
 SolarMutexGuard g;
 
-if (nType == AccessibilityFlowTo::FORSPELLCHECKFLOWTO)
+bool bSuccess(false);
+rAny >>= bSuccess;
+if ( bSuccess )
 {
-uno::Reference< css::drawing::XShape > xShape;
-rAny >>= xShape;
-if ( xShape.is() )
+if (eType == AccessibilityFlowTo::ForFindReplaceRange)
 {
-uno::Reference < XAccessible > xAcc = 
mpChildrenShapes->GetAccessibleCaption(xShape);
-uno::Reference < XAccessibleSelection > xAccSelection( xAcc, 
uno::UNO_QUERY );
-if ( xAccSelection.is() )
+uno::Sequence< uno::Any> aSeq = GetScAccFlowToSequence();
+if ( aSeq.hasElements() )
 {
-if ( xAccSelection->getSelectedAccessibleChildCount() )
-{
-uno::Reference < XAccessible > xSel = 
xAccSelection->getSelectedAccessibleChild( 0 );
-if ( xSel.is() )
-{
-uno::Reference < XAccessibleContext > xSelContext( 
xSel->getAccessibleContext() );
-if ( xSelContext.is() )
-{
-//if in sw we find the selected paragraph here
-if ( xSelContext->getAccessibleRole() == 
AccessibleRole::PARAGRAPH )
-{
-uno::Sequence aRet( 1 );
-aRet[0] <<= xSel;
-return aRet;
-}
-}
-}
-}
+return aSeq;
 }
 }
-else
-{
-if ( getSelectedAccessibleChildCount() )
-{
-uno::Reference < XAccessible > xSel = 
getSelectedAccessibleChild( 0 );
-if ( xSel.is() )
-{
-uno::Reference < XAccessibleContext > xSelContext( 
xSel->getAccessibleContext() );
-if ( 

[Libreoffice-commits] core.git: include/comphelper include/svx sc/source sd/source svx/source sw/source

2019-10-23 Thread Caolán McNamara (via logerrit)
 include/comphelper/accflowenum.hxx|3 +
 include/svx/srchdlg.hxx   |3 +
 sc/source/ui/Accessibility/AccessibleDocument.cxx |   14 +---
 sc/source/ui/view/tabvwshe.cxx|4 +-
 sd/source/ui/accessibility/AccessibleDrawDocumentView.cxx |2 -
 sd/source/ui/view/Outliner.cxx|2 -
 svx/source/dialog/srchdlg.cxx |   22 --
 sw/source/core/access/accdoc.cxx  |4 +-
 sw/source/uibase/uiview/viewsrch.cxx  |   11 +++
 9 files changed, 45 insertions(+), 20 deletions(-)

New commits:
commit 12eb32fccec16a436a6c3eca725b9d6d449f8e19
Author: Caolán McNamara 
AuthorDate: Wed Oct 23 15:30:51 2019 +0100
Commit: Caolán McNamara 
CommitDate: Wed Oct 23 21:51:39 2019 +0200

Resolves: tdf#128313 disambiguate flow-to search results

for a11y between find/replace where our result is a single thing, and
find-all/replace-all where the result is potentially many things, which 
allows
that searching in a selected calc column will flow-to the current cell, not 
the
entire ~infinite set of cells in the column

Change-Id: Ib3e56fceb90d869f157427f090cdffe986a5a588
Reviewed-on: https://gerrit.libreoffice.org/81396
Tested-by: Jenkins
Reviewed-by: Caolán McNamara 
Tested-by: Caolán McNamara 

diff --git a/include/comphelper/accflowenum.hxx 
b/include/comphelper/accflowenum.hxx
index c34b42e277cf..fc6b7ea2d8ec 100644
--- a/include/comphelper/accflowenum.hxx
+++ b/include/comphelper/accflowenum.hxx
@@ -25,7 +25,8 @@
 enum AccessibilityFlowTo : sal_Int32
 {
 FORSPELLCHECKFLOWTO = 1,
-FORFINDREPLACEFLOWTO = 2
+FORFINDREPLACEFLOWTO_ITEM = 2,
+FORFINDREPLACEFLOWTO_RANGE = 3
 };
 
 #endif // INCLUDED_COMPHELPER_ACCFLOWENUM_HXX
diff --git a/include/svx/srchdlg.hxx b/include/svx/srchdlg.hxx
index 3e3a73f92815..1a613f913554 100644
--- a/include/svx/srchdlg.hxx
+++ b/include/svx/srchdlg.hxx
@@ -23,6 +23,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -125,7 +126,7 @@ public:
 
 TransliterationFlagsGetTransliterationFlags() const;
 
-void SetDocWin(vcl::Window* pDocWin);
+void SetDocWin(vcl::Window* pDocWin, SvxSearchCmd eCommand);
 void SetSrchFlag( bool bSuccess ) { mbSuccess = bSuccess; }
 bool GetSrchFlag() const { return mbSuccess; }
 voidSetSaveToModule(bool b);
diff --git a/sc/source/ui/Accessibility/AccessibleDocument.cxx 
b/sc/source/ui/Accessibility/AccessibleDocument.cxx
index 5ad1c1d41a31..d4ffbbaac88b 100644
--- a/sc/source/ui/Accessibility/AccessibleDocument.cxx
+++ b/sc/source/ui/Accessibility/AccessibleDocument.cxx
@@ -2352,18 +2352,22 @@ css::uno::Sequence< css::uno::Any >
 }
 }
 }
-else if (nType == AccessibilityFlowTo::FORFINDREPLACEFLOWTO)
+else if (nType == AccessibilityFlowTo::FORFINDREPLACEFLOWTO_ITEM || nType 
== AccessibilityFlowTo::FORFINDREPLACEFLOWTO_RANGE)
 {
 bool bSuccess(false);
 rAny >>= bSuccess;
 if ( bSuccess )
 {
-uno::Sequence< uno::Any> aSeq = GetScAccFlowToSequence();
-if ( aSeq.hasElements() )
+if (nType == AccessibilityFlowTo::FORFINDREPLACEFLOWTO_RANGE)
 {
-return aSeq;
+uno::Sequence< uno::Any> aSeq = GetScAccFlowToSequence();
+if ( aSeq.hasElements() )
+{
+return aSeq;
+}
 }
-else if( mpAccessibleSpreadsheet.is() )
+
+if( mpAccessibleSpreadsheet.is() )
 {
 uno::Reference < XAccessible > xFindCellAcc = 
mpAccessibleSpreadsheet->GetActiveCell();
 // add xFindCellAcc to the return the Sequence
diff --git a/sc/source/ui/view/tabvwshe.cxx b/sc/source/ui/view/tabvwshe.cxx
index 61bdf4e285ae..fece06e7d8ec 100644
--- a/sc/source/ui/view/tabvwshe.cxx
+++ b/sc/source/ui/view/tabvwshe.cxx
@@ -244,7 +244,7 @@ void ScTabViewShell::ExecSearch( SfxRequest& rReq )
 vcl::Window* pWin = pTabView->GetActiveWin();
 if( pWin )
 {
-pSearchDlg->SetDocWin( pWin );
+pSearchDlg->SetDocWin( pWin, 
pSearchItem->GetCommand() );
 pSearchDlg->SetSrchFlag( bSuccess );
 }
 }
@@ -314,7 +314,7 @@ void ScTabViewShell::ExecSearch( SfxRequest& rReq )
 vcl::Window* pWin = pTabView->GetActiveWin();
 if( pWin )
 {
-pSearchDlg->SetDocWin( pWin );
+

[Libreoffice-commits] core.git: include/comphelper sc/source sd/source svx/source sw/source

2019-10-23 Thread Caolán McNamara (via logerrit)
 include/comphelper/accflowenum.hxx|   33 ++
 sc/source/ui/Accessibility/AccessibleDocument.cxx |7 +-
 sd/source/ui/accessibility/AccessibleDrawDocumentView.cxx |7 +-
 svx/source/dialog/srchdlg.cxx |4 -
 sw/source/core/access/accdoc.cxx  |7 +-
 5 files changed, 44 insertions(+), 14 deletions(-)

New commits:
commit 42dfdd2f8b4e4f3b6857fa416600e708358c5baa
Author: Caolán McNamara 
AuthorDate: Wed Oct 23 14:58:43 2019 +0100
Commit: Caolán McNamara 
CommitDate: Wed Oct 23 20:35:13 2019 +0200

put together the 'magic' flow-to constants

as a side note, there's no actual use of FORSPELLCHECKFLOWTO anywhere
that I can see

Change-Id: I90d50d7f98dede3803fec1d22d32d5d57858c1e3
Reviewed-on: https://gerrit.libreoffice.org/81394
Tested-by: Jenkins
Reviewed-by: Caolán McNamara 
Tested-by: Caolán McNamara 

diff --git a/include/comphelper/accflowenum.hxx 
b/include/comphelper/accflowenum.hxx
new file mode 100644
index ..c34b42e277cf
--- /dev/null
+++ b/include/comphelper/accflowenum.hxx
@@ -0,0 +1,33 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ *   Licensed to the Apache Software Foundation (ASF) under one or more
+ *   contributor license agreements. See the NOTICE file distributed
+ *   with this work for additional information regarding copyright
+ *   ownership. The ASF licenses this file to you under the Apache
+ *   License, Version 2.0 (the "License"); you may not use this file
+ *   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_COMPHELPER_ACCFLOWENUM_HXX
+#define INCLUDED_COMPHELPER_ACCFLOWENUM_HXX
+
+#include 
+
+enum AccessibilityFlowTo : sal_Int32
+{
+FORSPELLCHECKFLOWTO = 1,
+FORFINDREPLACEFLOWTO = 2
+};
+
+#endif // INCLUDED_COMPHELPER_ACCFLOWENUM_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/Accessibility/AccessibleDocument.cxx 
b/sc/source/ui/Accessibility/AccessibleDocument.cxx
index ee68adf3fdb0..5ad1c1d41a31 100644
--- a/sc/source/ui/Accessibility/AccessibleDocument.cxx
+++ b/sc/source/ui/Accessibility/AccessibleDocument.cxx
@@ -52,6 +52,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -2287,9 +2288,7 @@ css::uno::Sequence< css::uno::Any >
 {
 SolarMutexGuard g;
 
-const sal_Int32 SPELLCHECKFLOWTO = 1;
-const sal_Int32 FINDREPLACEFLOWTO = 2;
-if ( nType == SPELLCHECKFLOWTO )
+if (nType == AccessibilityFlowTo::FORSPELLCHECKFLOWTO)
 {
 uno::Reference< css::drawing::XShape > xShape;
 rAny >>= xShape;
@@ -2353,7 +2352,7 @@ css::uno::Sequence< css::uno::Any >
 }
 }
 }
-else if ( nType == FINDREPLACEFLOWTO )
+else if (nType == AccessibilityFlowTo::FORFINDREPLACEFLOWTO)
 {
 bool bSuccess(false);
 rAny >>= bSuccess;
diff --git a/sd/source/ui/accessibility/AccessibleDrawDocumentView.cxx 
b/sd/source/ui/accessibility/AccessibleDrawDocumentView.cxx
index b84ba0c59127..800cad560d3c 100644
--- a/sd/source/ui/accessibility/AccessibleDrawDocumentView.cxx
+++ b/sd/source/ui/accessibility/AccessibleDrawDocumentView.cxx
@@ -30,6 +30,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -741,9 +742,7 @@ css::uno::Sequence< css::uno::Any >
 {
 SolarMutexGuard g;
 
-const sal_Int32 SPELLCHECKFLOWTO = 1;
-const sal_Int32 FINDREPLACEFLOWTO = 2;
-if ( nType == SPELLCHECKFLOWTO )
+if (nType == AccessibilityFlowTo::FORSPELLCHECKFLOWTO)
 {
 uno::Reference< css::drawing::XShape > xShape;
 rAny >>= xShape;
@@ -785,7 +784,7 @@ css::uno::Sequence< css::uno::Any >
 goto Rt;
 }
 }
-else if ( nType == FINDREPLACEFLOWTO )
+else if (nType == AccessibilityFlowTo::FORFINDREPLACEFLOWTO)
 {
 sal_Int32 nChildCount = getSelectedAccessibleChildCount();
 if ( nChildCount )
diff --git a/svx/source/dialog/srchdlg.cxx b/svx/source/dialog/srchdlg.cxx
index fc36f99258f5..ef831b92f2bf 100644
--- a/svx/source/dialog/srchdlg.cxx
+++ b/svx/source/dialog/srchdlg.cxx
@@ -48,6 +48,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -2304,8 +2305,7 @@ void SvxSearchDialog::SetDocWin(vcl::Window* pDocWin)
 return;
 }
 
-const sal_Int32 FORFINDREPLACEFLOWTO = 2;
-uno::Sequence aAnySeq = 
xGetAccFlowTo->getAccFlowTo(Any(GetSrchFlag()),  FORFINDREPLACEFLOWTO);
+  

[Libreoffice-commits] core.git: include/comphelper include/drawinglayer

2019-08-22 Thread Mike Kaganski (via logerrit)
 include/comphelper/sequence.hxx  |   16 +---
 include/drawinglayer/primitive2d/baseprimitive2d.hxx |2 ++
 include/drawinglayer/primitive3d/baseprimitive3d.hxx |2 ++
 3 files changed, 9 insertions(+), 11 deletions(-)

New commits:
commit 64f03e7bed015ea0626e5218c03078d08257a27f
Author: Mike Kaganski 
AuthorDate: Wed Aug 21 17:56:29 2019 +0200
Commit: Mike Kaganski 
CommitDate: Thu Aug 22 08:47:06 2019 +0200

Use range ctor to avoid default-insertion of elements before assignment

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

diff --git a/include/comphelper/sequence.hxx b/include/comphelper/sequence.hxx
index 6eadc5e917cb..6c51311daf29 100644
--- a/include/comphelper/sequence.hxx
+++ b/include/comphelper/sequence.hxx
@@ -219,15 +219,13 @@ namespace comphelper
 elements
 
 @tpl DstType
-Container type. This type must fulfill the STL container and
-sequence concepts, in particular, the begin(), end() and the
-unary constructor DstType(int) methods must be available and
-have the usual semantics.
+Container type. This type must have a constructor taking a pair
+of iterators defining a range to copy from
 
 @param i_Sequence
 Reference to a Sequence of SrcType elements
 
-@return the generated container
+@return the generated container. C++17 copy elision rules apply
 
 @attention this function always performs a copy. Furthermore,
 when copying from e.g. a Sequence to a vector, no
@@ -238,18 +236,14 @@ namespace comphelper
 template < typename DstType, typename SrcType >
 inline DstType sequenceToContainer( const css::uno::Sequence< SrcType >& 
i_Sequence )
 {
-DstType result( i_Sequence.getLength() );
-::std::copy( i_Sequence.begin(), i_Sequence.end(), result.begin() );
-return result;
+return DstType(i_Sequence.begin(), i_Sequence.end());
 }
 
 // this one does better type deduction, but does not allow us to copy into 
a different element type
 template < typename DstType >
 inline DstType sequenceToContainer( const css::uno::Sequence< typename 
DstType::value_type >& i_Sequence )
 {
-DstType result( i_Sequence.getLength() );
-::std::copy( i_Sequence.begin(), i_Sequence.end(), result.begin() );
-return result;
+return DstType(i_Sequence.begin(), i_Sequence.end());
 }
 
 /** Copy from a Sequence into an existing container
diff --git a/include/drawinglayer/primitive2d/baseprimitive2d.hxx 
b/include/drawinglayer/primitive2d/baseprimitive2d.hxx
index 67a40d77e4c6..5725908fb523 100644
--- a/include/drawinglayer/primitive2d/baseprimitive2d.hxx
+++ b/include/drawinglayer/primitive2d/baseprimitive2d.hxx
@@ -79,6 +79,8 @@ namespace drawinglayer { namespace primitive2d {
 Primitive2DContainer( const Primitive2DContainer&& other ) : 
deque(other) {}
 Primitive2DContainer( const std::deque< Primitive2DReference >& other 
) : deque(other) {}
 Primitive2DContainer( std::initializer_list init 
) : deque(init) {}
+template 
+Primitive2DContainer(Iter first, Iter last) : deque(first, last) {}
 
 virtual void append(const Primitive2DReference&) override;
 virtual void append(const Primitive2DContainer& rSource) override;
diff --git a/include/drawinglayer/primitive3d/baseprimitive3d.hxx 
b/include/drawinglayer/primitive3d/baseprimitive3d.hxx
index 4e93523f8e8e..70c9f63ab1af 100644
--- a/include/drawinglayer/primitive3d/baseprimitive3d.hxx
+++ b/include/drawinglayer/primitive3d/baseprimitive3d.hxx
@@ -62,6 +62,8 @@ namespace drawinglayer { namespace primitive3d {
 Primitive3DContainer( const Primitive3DContainer& other ) : 
deque(other) {}
 Primitive3DContainer( const Primitive3DContainer&& other ) : 
deque(other) {}
 Primitive3DContainer( std::initializer_list init 
) : deque(init) {}
+template 
+Primitive3DContainer(Iter first, Iter last) : deque(first, last) {}
 
 void append(const Primitive3DContainer& rSource);
 Primitive3DContainer& operator=(const Primitive3DContainer& r) { 
deque::operator=(r); return *this; }
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

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

2019-08-20 Thread Noel Grandin (via logerrit)
 include/comphelper/interfacecontainer3.hxx  |  356 
 sc/source/ui/Accessibility/DrawModelBroadcaster.cxx |4 
 sc/source/ui/inc/DrawModelBroadcaster.hxx   |4 
 3 files changed, 360 insertions(+), 4 deletions(-)

New commits:
commit 89ea9340aca77a87ef10785a734201d2f400a933
Author: Noel Grandin 
AuthorDate: Tue Aug 20 13:46:01 2019 +0200
Commit: Noel Grandin 
CommitDate: Tue Aug 20 20:35:01 2019 +0200

tdf#119388 speed up listener broadcast

when deleting columns with lots of shapes. The UNO_QUERY is expensive in
this case, so create a new comphelper::OInterfaceContainerHelper3 that
knows what type the listener interface is.

Takes the time from 47s to 41s for me.

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

diff --git a/include/comphelper/interfacecontainer3.hxx 
b/include/comphelper/interfacecontainer3.hxx
new file mode 100644
index ..087dc45e12cc
--- /dev/null
+++ b/include/comphelper/interfacecontainer3.hxx
@@ -0,0 +1,356 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ *   Licensed to the Apache Software Foundation (ASF) under one or more
+ *   contributor license agreements. See the NOTICE file distributed
+ *   with this work for additional information regarding copyright
+ *   ownership. The ASF licenses this file to you under the Apache
+ *   License, Version 2.0 (the "License"); you may not use this file
+ *   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_COMPHELPER_INTERFACECONTAINER3_H
+#define INCLUDED_COMPHELPER_INTERFACECONTAINER3_H
+
+#include 
+
+#include 
+#include 
+#include 
+#include 
+#include 
+
+namespace com
+{
+namespace sun
+{
+namespace star
+{
+namespace uno
+{
+class XInterface;
+}
+}
+}
+}
+namespace osl
+{
+class Mutex;
+}
+
+/** */ //for docpp
+namespace comphelper
+{
+template  class OInterfaceContainerHelper3;
+/**
+  This is the iterator of an InterfaceContainerHelper. Typically
+  one constructs an instance on the stack for one firing session.
+  It is not allowed to assign or copy an instance of this class.
+
+  @tparam ListenerT UNO event listener type
+  @see OInterfaceContainerHelper
+ */
+template  class OInterfaceIteratorHelper3
+{
+public:
+/**
+   Create an iterator over the elements of the container. The iterator
+   copies the elements of the container. A change to the container
+   during the lifetime of an iterator is allowed and does not
+   affect the iterator-instance. The iterator and the container take cares
+   themself for concurrent access, no additional guarding is necessary.
+
+   Remark: The copy is on demand. The iterator copy the elements only if 
the container
+   change the contents..
+
+   @param rCont the container of the elements.
+ */
+OInterfaceIteratorHelper3(OInterfaceContainerHelper3& rCont_)
+: rCont(rCont_)
+, maData(rCont.maData)
+, nRemain(maData->size())
+{
+}
+
+/** Return true, if there are more elements in the iterator. */
+bool hasMoreElements() const { return nRemain != 0; }
+/** Return the next element of the iterator. Calling this method if
+hasMoreElements() has returned false, is an error.
+ */
+css::uno::Reference const& next();
+
+/** Removes the current element (the last one returned by next())
+from the underlying container. Calling this method before
+next() has been called or calling it twice with no next()
+in between is an error.
+*/
+void remove();
+
+private:
+OInterfaceContainerHelper3& rCont;
+o3tl::cow_wrapper>> maData;
+sal_Int32 nRemain;
+
+OInterfaceIteratorHelper3(const OInterfaceIteratorHelper3&) = delete;
+OInterfaceIteratorHelper3& operator=(const OInterfaceIteratorHelper3&) = 
delete;
+};
+
+template 
+const css::uno::Reference& 
OInterfaceIteratorHelper3::next()
+{
+nRemain--;
+return (*maData)[nRemain];
+}
+
+template  void OInterfaceIteratorHelper3::remove()
+{
+rCont.removeInterface((*maData)[nRemain]);
+}
+
+/**
+  A container of interfaces. To access the elements use an iterator.
+  This implementation is thread safe.
+
+  @tparam ListenerT UNO event listener type
+  @see OInterfaceIteratorHelper
+ */
+template  class OInterfaceContainerHelper3
+{
+public:
+/**
+   Create an interface container.
+
+   @param rMutexthe 

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

2019-08-11 Thread Mike Kaganski (via logerrit)
 include/comphelper/sequence.hxx |   22 ++
 1 file changed, 6 insertions(+), 16 deletions(-)

New commits:
commit 753e9592e5fe6cfd8f437d0049b9604d1e414a14
Author: Mike Kaganski 
AuthorDate: Sun Aug 11 17:49:31 2019 +0200
Commit: Mike Kaganski 
CommitDate: Sun Aug 11 18:36:16 2019 +0200

Use standard algorithms instead of custom copy function

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

diff --git a/include/comphelper/sequence.hxx b/include/comphelper/sequence.hxx
index a9cd6f137fd5..3c448cd6573a 100644
--- a/include/comphelper/sequence.hxx
+++ b/include/comphelper/sequence.hxx
@@ -24,6 +24,7 @@
 #include 
 #include 
 
+#include 
 #include 
 
 namespace comphelper
@@ -33,25 +34,15 @@ namespace comphelper
 */
 COMPHELPER_DLLPUBLIC sal_Int32 findValue(const css::uno::Sequence< 
OUString >& _rList, const OUString& _rValue);
 
-namespace internal
-{
-template 
-inline void implCopySequence(const T* _pSource, T*& _pDest, sal_Int32 
_nSourceLen)
-{
-for (sal_Int32 i=0; i<_nSourceLen; ++i, ++_pSource, ++_pDest)
-*_pDest = *_pSource;
-}
-}
-
 /// concat several sequences
 template 
 inline css::uno::Sequence concatSequences(const css::uno::Sequence& 
rS1, const Ss&... rSn)
 {
 // unary fold to disallow empty parameter pack: at least have one 
sequence in rSn
 css::uno::Sequence aReturn(rS1.getLength() + (... + 
rSn.getLength()));
-T* pReturn = aReturn.getArray();
-(internal::implCopySequence(rS1.getConstArray(), pReturn, 
rS1.getLength()), ...,
- internal::implCopySequence(rSn.getConstArray(), pReturn, 
rSn.getLength()));
+T* pReturn;
+((pReturn = std::copy_n(rS1.getConstArray(), rS1.getLength(), 
aReturn.getArray())), ...,
+ (pReturn = std::copy_n(rSn.getConstArray(), rSn.getLength(), 
pReturn)));
 return aReturn;
 }
 
@@ -64,8 +55,7 @@ namespace comphelper
 sal_Int32 n1 = left.getLength();
 css::uno::Sequence ret(n1 + right.getLength());
 //TODO: check for overflow
-T * p = ret.getArray();
-internal::implCopySequence(left.getConstArray(), p, n1);
+std::copy_n(left.getConstArray(), n1, ret.getArray());
 sal_Int32 n2 = n1;
 for (sal_Int32 i = 0; i != right.getLength(); ++i) {
 bool found = false;
@@ -92,7 +82,7 @@ namespace comphelper
 OSL_ENSURE(0 <= _nPos && _nPos < nLength, "invalid index");
 
 T* pPos = _rSeq.getArray() + _nPos;
-internal::implCopySequence(pPos + 1, pPos, nLength - _nPos - 1);
+std::move(pPos + 1, pPos + nLength - _nPos, pPos);
 
 _rSeq.realloc(nLength-1);
 }
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

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

2019-07-01 Thread Andrea Gelmini (via logerrit)
 include/comphelper/numbers.hxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit a96490730c082b086c805f5c3c07738a04e6b846
Author: Andrea Gelmini 
AuthorDate: Sun Jun 30 22:26:26 2019 +
Commit: Julien Nabet 
CommitDate: Tue Jul 2 07:12:41 2019 +0200

Fix typo

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

diff --git a/include/comphelper/numbers.hxx b/include/comphelper/numbers.hxx
index 9699a8b1d515..919be8aac187 100644
--- a/include/comphelper/numbers.hxx
+++ b/include/comphelper/numbers.hxx
@@ -39,7 +39,7 @@ namespace comphelper
 /// returns the decimals of the given numeric number formatunder the given 
formats
 COMPHELPER_DLLPUBLIC css::uno::Any getNumberFormatDecimals(const 
css::uno::Reference& xFormats, sal_Int32 nKey);
 
-/** retrieves a the value of a given property for a given format key, 
relating to a given formatter
+/** retrieves the value of a given property for a given format key, 
relating to a given formatter
 */
 COMPHELPER_DLLPUBLIC css::uno::Any getNumberFormatProperty(
 const css::uno::Reference< css::util::XNumberFormatter >& _rxFormatter,
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

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

2019-07-01 Thread Andrea Gelmini (via logerrit)
 include/comphelper/propagg.hxx |6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

New commits:
commit 47caf3adb79f4db0461834155b1beb0bdb14e399
Author: Andrea Gelmini 
AuthorDate: Sun Jun 30 22:26:25 2019 +
Commit: Julien Nabet 
CommitDate: Tue Jul 2 07:13:11 2019 +0200

Fix typo

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

diff --git a/include/comphelper/propagg.hxx b/include/comphelper/propagg.hxx
index 3e153a64a39b..9c750e85a584 100644
--- a/include/comphelper/propagg.hxx
+++ b/include/comphelper/propagg.hxx
@@ -66,7 +66,7 @@ namespace internal
 
 
 /**
- * used as callback for a OPropertyArrayAggregationHelper
+ * used as callback for an OPropertyArrayAggregationHelper
  */
 class IPropertyInfoService
 {
@@ -83,7 +83,7 @@ protected:
 };
 
 /**
- * used for implementing an cppu::IPropertyArrayHelper for classes
+ * used for implementing a cppu::IPropertyArrayHelper for classes
  * aggregating property sets
  */
 
@@ -101,7 +101,7 @@ public:
 @param  _rPropertiesthe properties of the object doing the 
aggregation. These properties
 are used without any checks, so the caller has 
to ensure that the names and
 handles are valid.
-@param  _rAggProperties the properties of the aggregate, usually got 
via an call to getProperties on the
+@param  _rAggProperties the properties of the aggregate, usually got 
via a call to getProperties on the
 XPropertySetInfo of the aggregate.
 The names of the properties are used without 
any checks, so the caller has to ensure
 that there are no doubles.
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

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

2019-07-01 Thread Andrea Gelmini (via logerrit)
 include/comphelper/proparrhlp.hxx |4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

New commits:
commit 1a56f1a08ca780aaf6c0aec91e7fc6e82ff1e1b1
Author: Andrea Gelmini 
AuthorDate: Sun Jun 30 22:26:24 2019 +
Commit: Julien Nabet 
CommitDate: Tue Jul 2 07:10:14 2019 +0200

Fix typo

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

diff --git a/include/comphelper/proparrhlp.hxx 
b/include/comphelper/proparrhlp.hxx
index 1c755188ef6e..a53b718c2697 100644
--- a/include/comphelper/proparrhlp.hxx
+++ b/include/comphelper/proparrhlp.hxx
@@ -53,12 +53,12 @@ protected:
 This method needs to be implemented in derived classes.
 
 The method gets called with Mutex acquired.
-@return an pointer to the newly created array 
helper. Must not be NULL.
+@return a pointer to the newly created array 
helper. Must not be NULL.
 */
 virtual ::cppu::IPropertyArrayHelper* createArrayHelper( ) const = 0;
 };
 
-/** a OPropertyArrayUsageHelper which will create an 
OPropertyArrayAggregationHelper
+/** an OPropertyArrayUsageHelper which will create an 
OPropertyArrayAggregationHelper
 */
 template 
 class OAggregationArrayUsageHelper: public OPropertyArrayUsageHelper
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

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

2019-07-01 Thread Andrea Gelmini (via logerrit)
 include/comphelper/sequence.hxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 25cebc1ad228a5a2e008727cd4d319baf496eddf
Author: Andrea Gelmini 
AuthorDate: Sun Jun 30 22:26:22 2019 +
Commit: Julien Nabet 
CommitDate: Tue Jul 2 07:09:26 2019 +0200

Fix typo

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

diff --git a/include/comphelper/sequence.hxx b/include/comphelper/sequence.hxx
index 3c52c4715965..a9cd6f137fd5 100644
--- a/include/comphelper/sequence.hxx
+++ b/include/comphelper/sequence.hxx
@@ -290,7 +290,7 @@ namespace comphelper
 return o_Output;
 }
 
-/** Copy (keys or values) from a associate container into a Sequence
+/** Copy (keys or values) from an associate container into a Sequence
 
 @tpl M map container type eg. std::map/std::unordered_map
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

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

2019-06-30 Thread Andrea Gelmini (via logerrit)
 include/comphelper/enumhelper.hxx |6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

New commits:
commit 5db683d1c1fea95565e96bbaa6d848c742a7e85a
Author: Andrea Gelmini 
AuthorDate: Fri Jun 14 22:41:49 2019 +
Commit: Julien Nabet 
CommitDate: Mon Jul 1 07:42:17 2019 +0200

Fix typo

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

diff --git a/include/comphelper/enumhelper.hxx 
b/include/comphelper/enumhelper.hxx
index 32d2427267ca..7612ecb5fc43 100644
--- a/include/comphelper/enumhelper.hxx
+++ b/include/comphelper/enumhelper.hxx
@@ -38,7 +38,7 @@ struct OEnumerationLock
 ::osl::Mutex m_aLock;
 };
 
-/** provides an com.sun.star.container::XEnumeration access based
+/** provides a com.sun.star.container::XEnumeration access based
 on an object implementing the com.sun.star.container::XNameAccess interface
 */
 class COMPHELPER_DLLPUBLIC OEnumerationByName : private OEnumerationLock
@@ -66,7 +66,7 @@ private:
 COMPHELPER_DLLPRIVATE void impl_stopDisposeListening();
 };
 
-/** provides an com.sun.star.container::XEnumeration access based
+/** provides a com.sun.star.container::XEnumeration access based
 on an object implementing the com.sun.star.container::XNameAccess interface
 */
 class COMPHELPER_DLLPUBLIC OEnumerationByIndex : private OEnumerationLock
@@ -95,7 +95,7 @@ private:
 class SAL_DLLPUBLIC_TEMPLATE OAnyEnumeration_BASE
 : public ::cppu::WeakImplHelper {};
 
-/** provides an com.sun.star.container::XEnumeration
+/** provides a com.sun.star.container::XEnumeration
 for an outside set vector of Any's.
 
 */
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

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

2019-06-30 Thread Andrea Gelmini (via logerrit)
 include/comphelper/logging.hxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit f5696bdc243bb615973fd32e22933b4b4ff33acd
Author: Andrea Gelmini 
AuthorDate: Fri Jun 14 22:41:46 2019 +
Commit: Julien Nabet 
CommitDate: Mon Jul 1 07:41:55 2019 +0200

Fix typo

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

diff --git a/include/comphelper/logging.hxx b/include/comphelper/logging.hxx
index 34d9f4cef5d2..67898408bef6 100644
--- a/include/comphelper/logging.hxx
+++ b/include/comphelper/logging.hxx
@@ -67,7 +67,7 @@ namespace comphelper
 class EventLogger_Impl;
 typedef ::boost::optional< OUString >OptionalString;
 
-/** encapsulates an css::logging::XLogger
+/** encapsulates a css::logging::XLogger
 
 The class silences several (unlikely) errors which could potentially 
happen
 when working with a logger. Additionally, it provides some convenience 
methods
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

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

2019-06-30 Thread Andrea Gelmini (via logerrit)
 include/comphelper/configuration.hxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit e9a723693885ab7ab0017cc8209f52a1f0b09b1c
Author: Andrea Gelmini 
AuthorDate: Fri Jun 14 22:41:52 2019 +
Commit: Julien Nabet 
CommitDate: Sun Jun 30 09:25:48 2019 +0200

Fix typo

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

diff --git a/include/comphelper/configuration.hxx 
b/include/comphelper/configuration.hxx
index fa298c54a621..237ad3e317c9 100644
--- a/include/comphelper/configuration.hxx
+++ b/include/comphelper/configuration.hxx
@@ -135,7 +135,7 @@ private:
 css::uno::Reference< css::uno::XComponentContext >  context_;
 
 css::uno::Reference< css::configuration::XReadWriteAccess > access_;
-// should really be an css.configuration.ReadOnlyAccess (with added
+// should really be a css.configuration.ReadOnlyAccess (with added
 // css.beans.XHierarchicalPropertySetInfo), but then
 // configmgr::Access::asProperty() would report all properties as
 // READONLY, so isReadOnly() would not work
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

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

2019-06-30 Thread Andrea Gelmini (via logerrit)
 include/comphelper/backupfilehelper.hxx |6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

New commits:
commit 32c71a7740ce9ac66889c2ab31b941831efc56af
Author: Andrea Gelmini 
AuthorDate: Fri Jun 14 22:41:54 2019 +
Commit: Julien Nabet 
CommitDate: Sun Jun 30 09:25:08 2019 +0200

Fix typo

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

diff --git a/include/comphelper/backupfilehelper.hxx 
b/include/comphelper/backupfilehelper.hxx
index 70dd77667826..11a2593aeb4e 100644
--- a/include/comphelper/backupfilehelper.hxx
+++ b/include/comphelper/backupfilehelper.hxx
@@ -36,15 +36,15 @@ namespace comphelper
  *
  *  You need to hand over the URL of the file to look at and
  *  a maximum number of allowed copies. That number is internally
- *  limited to a absolute max of 10 (see implementation). The number
+ *  limited to an absolute max of 10 (see implementation). The number
  *  of allowed copies is limited to [1..max].
  *
  *  Calling tryPush() will check if there is no backup yet or if
  *  there is one that the file has changed. If yes, a new copy is
- *  created on a kind of 'stack' of copies. Tre return value can
+ *  created on a kind of 'stack' of copies. The return value can
  *  be used to see if a backup was indeed created.
  *
- *  Calling tryPop() will do the opposite: If a backup is available,
+ *  Calling tryPop() will do the opposite: if a backup is available,
  *  delete the orig file and re-instantiate the backup. The backup
  *  is taken off the 'stack' of copies. The return value can be
  *  used to check if this was done.
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

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

2019-06-30 Thread Andrea Gelmini (via logerrit)
 include/comphelper/broadcasthelper.hxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit d58ee4cbfa04f12a84f71ccf0f1bcd6bbbdfe61a
Author: Andrea Gelmini 
AuthorDate: Fri Jun 14 22:41:53 2019 +
Commit: Julien Nabet 
CommitDate: Sun Jun 30 09:24:16 2019 +0200

Fix typo

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

diff --git a/include/comphelper/broadcasthelper.hxx 
b/include/comphelper/broadcasthelper.hxx
index d9586ee5b4f7..65fa6d315f09 100644
--- a/include/comphelper/broadcasthelper.hxx
+++ b/include/comphelper/broadcasthelper.hxx
@@ -25,7 +25,7 @@
 
 namespace comphelper
 {
-// OMutexAndBroadcastHelper - a class which holds a Mutex and a 
OBroadcastHelper;
+// OMutexAndBroadcastHelper - a class which holds a Mutex and an 
OBroadcastHelper;
 // needed because when deriving from OPropertySetHelper,
 // the OBroadcastHelper has to be initialized before
 // the OPropertySetHelper
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

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

2019-06-29 Thread Andrea Gelmini (via logerrit)
 include/comphelper/asyncnotification.hxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit ceca6c7e69169123bab5ca515a3ff1c96c13
Author: Andrea Gelmini 
AuthorDate: Fri Jun 14 22:41:55 2019 +
Commit: Julien Nabet 
CommitDate: Sat Jun 29 19:42:37 2019 +0200

Fix typo

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

diff --git a/include/comphelper/asyncnotification.hxx 
b/include/comphelper/asyncnotification.hxx
index 3ec50176f786..9eb61c4c50c9 100644
--- a/include/comphelper/asyncnotification.hxx
+++ b/include/comphelper/asyncnotification.hxx
@@ -195,7 +195,7 @@ namespace comphelper
 
 //= EventHolder
 
-/** AnyEvent derivee holding an foreign event instance
+/** AnyEvent derivee holding a foreign event instance
 */
 template < typename EVENT_OBJECT >
 class SAL_DLLPUBLIC_RTTI EventHolder : public AnyEvent
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

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

2019-06-29 Thread Andrea Gelmini (via logerrit)
 include/comphelper/accessiblecontexthelper.hxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit f6fa05292be928f8ca24256c7640e8a833d61e64
Author: Andrea Gelmini 
AuthorDate: Fri Jun 14 22:41:57 2019 +
Commit: Julien Nabet 
CommitDate: Sat Jun 29 19:40:45 2019 +0200

Fix typo

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

diff --git a/include/comphelper/accessiblecontexthelper.hxx 
b/include/comphelper/accessiblecontexthelper.hxx
index f8182526b280..e22dacbe6411 100644
--- a/include/comphelper/accessiblecontexthelper.hxx
+++ b/include/comphelper/accessiblecontexthelper.hxx
@@ -156,7 +156,7 @@ namespace comphelper
 
 The class has two responsibilities:
 it locks the mutex of an OAccessibleContextHelper instance, as 
long as the guard lives
-it checks if an given OAccessibleContextHelper instance is 
alive, else an exception is thrown
+it checks if a given OAccessibleContextHelper instance is 
alive, else an exception is thrown
 our of the constructor of the guard
 
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

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

2019-06-29 Thread Andrea Gelmini (via logerrit)
 include/comphelper/IdPropArrayHelper.hxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit dad1c7858b13b4fc9ca95e2aba3ffb03ddfe57bf
Author: Andrea Gelmini 
AuthorDate: Fri Jun 14 22:41:58 2019 +
Commit: Julien Nabet 
CommitDate: Sat Jun 29 19:40:16 2019 +0200

Fix typo

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

diff --git a/include/comphelper/IdPropArrayHelper.hxx 
b/include/comphelper/IdPropArrayHelper.hxx
index 55598ff1df1a..49c324beab2e 100644
--- a/include/comphelper/IdPropArrayHelper.hxx
+++ b/include/comphelper/IdPropArrayHelper.hxx
@@ -70,7 +70,7 @@ namespace comphelper
 This method needs to be implemented in derived classes.
 
 The method gets called with Mutex acquired.
-@return an pointer to the newly created 
array helper. Must not be NULL.
+@return a pointer to the newly created 
array helper. Must not be NULL.
 */
 virtual ::cppu::IPropertyArrayHelper* createArrayHelper(sal_Int32 nId) 
const = 0;
 };
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

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

2019-06-18 Thread Andrea Gelmini (via logerrit)
 include/comphelper/accessiblewrapper.hxx |2 +-
 sc/source/filter/inc/htmlpars.hxx|2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

New commits:
commit ab5e1b485ca11941294d980ed3aa4272d693dbc5
Author: Andrea Gelmini 
AuthorDate: Tue Jun 18 08:54:09 2019 +
Commit: Julien Nabet 
CommitDate: Tue Jun 18 12:21:23 2019 +0200

Fix typos

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

diff --git a/include/comphelper/accessiblewrapper.hxx 
b/include/comphelper/accessiblewrapper.hxx
index 34b3cb8edad4..89e2c332917c 100644
--- a/include/comphelper/accessiblewrapper.hxx
+++ b/include/comphelper/accessiblewrapper.hxx
@@ -361,7 +361,7 @@ namespace comphelper
 /// invalidates (i.e. empties) the map
 voidinvalidateAll( );
 
-/** disposes (i.e. cleares) the manager
+/** disposes (i.e. clears) the manager
 
 Note that the XAccessibleContext's of the mapped XAccessible 
objects are disposed, too.
 */
diff --git a/sc/source/filter/inc/htmlpars.hxx 
b/sc/source/filter/inc/htmlpars.hxx
index d3523e9de602..1f5ef2a9a8ae 100644
--- a/sc/source/filter/inc/htmlpars.hxx
+++ b/sc/source/filter/inc/htmlpars.hxx
@@ -284,7 +284,7 @@ public:
 /** Returns true, if the entry represents a table. */
 ScHTMLTableId GetTableId() const { return nTab; }
 
-/** Sets or cleares the import always state. */
+/** Sets or clears the import always state. */
 void SetImportAlways() { mbImportAlways = true; }
 /** Sets start point of the entry selection to the start of the import 
info object. */
 voidAdjustStart( const HtmlImportInfo& rInfo );
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

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

2019-04-29 Thread Mike Kaganski (via logerrit)
 include/comphelper/scopeguard.hxx |   28 
 1 file changed, 28 insertions(+)

New commits:
commit f24e50c90fb802cba0a9d77ecb0f105ea4516ebb
Author: Mike Kaganski 
AuthorDate: Mon Apr 29 11:36:51 2019 +0300
Commit: Mike Kaganski 
CommitDate: Mon Apr 29 12:22:51 2019 +0200

Fix Android build after commit ac419786b3244d909901db053841862abf5e7a2f

... giving this error:

   In file included from
   
/home/android/lo/master-android-arm/filter/source/xmlfilteradaptor/XmlFilterAdaptor.cxx:50:
   
/home/android/lo/master-android-arm/include/comphelper/scopeguard.hxx:36:14:
   error: function 'comphelper::<(lambda at
   
/home/android/lo/master-android-arm/filter/source/xmlfilteradaptor/XmlFilterAdaptor.cxx:146:34)>'
   has internal linkage but is not defined [-Werror,-Wundefined-internal]
   explicit ScopeGuard( Func && func ) : m_func( std::move(func) ) {}
^
   
/home/android/lo/master-android-arm/filter/source/xmlfilteradaptor/XmlFilterAdaptor.cxx:146:28:
   note: used here
   comphelper::ScopeGuard guard([&]() {
  ^

See 
https://lists.freedesktop.org/archives/libreoffice/2019-April/082599.html

Change-Id: If719d183d2ce15fa4877cd8bbf457d79097765be
Reviewed-on: https://gerrit.libreoffice.org/71510
Reviewed-by: Miklos Vajna 
Tested-by: Mike Kaganski 

diff --git a/include/comphelper/scopeguard.hxx 
b/include/comphelper/scopeguard.hxx
index 60836a7661c7..6b5b397686f4 100644
--- a/include/comphelper/scopeguard.hxx
+++ b/include/comphelper/scopeguard.hxx
@@ -24,6 +24,28 @@
 #include 
 #include 
 
+
+// For some reason, Android buildbot issues -Werror like this:
+//   In file included from
+//   
/home/android/lo/master-android-arm/filter/source/xmlfilteradaptor/XmlFilterAdaptor.cxx:50:
+//   
/home/android/lo/master-android-arm/include/comphelper/scopeguard.hxx:36:14:
+//   error: function 'comphelper::<(lambda at
+//   
/home/android/lo/master-android-arm/filter/source/xmlfilteradaptor/XmlFilterAdaptor.cxx:146:34)>'
+//   has internal linkage but is not defined [-Werror,-Wundefined-internal]
+//   explicit ScopeGuard( Func && func ) : m_func( std::move(func) ) {}
+//^
+//   
/home/android/lo/master-android-arm/filter/source/xmlfilteradaptor/XmlFilterAdaptor.cxx:146:28:
+//   note: used here
+//   comphelper::ScopeGuard guard([&]() {
+//  ^
+#ifdef ANDROID
+#if defined __clang__
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wundefined-internal"
+#endif
+#endif
+
+
 namespace comphelper {
 
 /** ScopeGuard to ease writing exception-safe code.
@@ -69,6 +91,12 @@ private:
 
 } // namespace comphelper
 
+#ifdef ANDROID
+#if defined __clang__
+#pragma clang diagnostic pop
+#endif
+#endif
+
 #endif // ! defined(INCLUDED_COMPHELPER_SCOPEGUARD_HXX)
 
 /* 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: include/comphelper

2019-04-11 Thread Mike Kaganski (via logerrit)
 include/comphelper/windowsdebugoutput.hxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 74288f5af28de3d14044c951e7e5d62bb2e22301
Author: Mike Kaganski 
AuthorDate: Fri Apr 12 01:56:03 2019 +0200
Commit: Mike Kaganski 
CommitDate: Fri Apr 12 01:59:17 2019 +0200

Fix build after 9be7991df15da9d4d954eeac1ec342ad1a2b7467

Change-Id: Ie4b756000c478a2e0a745571c6eda021665406b4
Reviewed-on: https://gerrit.libreoffice.org/70616
Reviewed-by: Mike Kaganski 
Tested-by: Mike Kaganski 

diff --git a/include/comphelper/windowsdebugoutput.hxx 
b/include/comphelper/windowsdebugoutput.hxx
index 7033b811a66c..45a38d007bc3 100644
--- a/include/comphelper/windowsdebugoutput.hxx
+++ b/include/comphelper/windowsdebugoutput.hxx
@@ -424,7 +424,7 @@ inline std::basic_ostream& 
operator<<(std::basic_ostream, 
wchar_t>().to_bytes(
-rVariant.bstrVal));
+rVariant.bstrVal);
 break;
 case VT_DISPATCH:
 stream << rVariant.pdispVal;
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

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

2019-04-11 Thread Tor Lillqvist (via logerrit)
 include/comphelper/windowsdebugoutput.hxx |7 +--
 1 file changed, 5 insertions(+), 2 deletions(-)

New commits:
commit 9be7991df15da9d4d954eeac1ec342ad1a2b7467
Author: Tor Lillqvist 
AuthorDate: Thu Apr 11 23:23:46 2019 +0300
Commit: Tor Lillqvist 
CommitDate: Fri Apr 12 01:26:02 2019 +0300

Don't crash if the BSTR pointer in a VARIANT is (weirdly) null

Change-Id: I8473b1f411a45c7c17e742ca0d69245d77f078f7

diff --git a/include/comphelper/windowsdebugoutput.hxx 
b/include/comphelper/windowsdebugoutput.hxx
index 26c95fea5c22..7033b811a66c 100644
--- a/include/comphelper/windowsdebugoutput.hxx
+++ b/include/comphelper/windowsdebugoutput.hxx
@@ -420,8 +420,11 @@ inline std::basic_ostream& 
operator<<(std::basic_ostream(rVariant.date);
 break; // FIXME
 case VT_BSTR:
-stream << std::wstring_convert, 
wchar_t>().to_bytes(
-rVariant.bstrVal);
+if (rVariant.bstrVal == nullptr)
+stream << "(null)";
+else
+stream << std::wstring_convert, 
wchar_t>().to_bytes(
+rVariant.bstrVal));
 break;
 case VT_DISPATCH:
 stream << rVariant.pdispVal;
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

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

2019-04-10 Thread Andrea Gelmini (via logerrit)
 include/comphelper/namedvaluecollection.hxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 265494644b0e97f8438f0d2588ef1fdab61f9e66
Author: Andrea Gelmini 
AuthorDate: Wed Apr 10 19:35:04 2019 +0200
Commit: Julien Nabet 
CommitDate: Wed Apr 10 22:03:30 2019 +0200

Fix typo

Change-Id: Iee5dcd363e87318fa17695d9d069a462b55e4a44
Reviewed-on: https://gerrit.libreoffice.org/70535
Reviewed-by: himajin10 
Reviewed-by: Julien Nabet 
Tested-by: Julien Nabet 

diff --git a/include/comphelper/namedvaluecollection.hxx 
b/include/comphelper/namedvaluecollection.hxx
index 3f3e405f5d0f..46a2594d1028 100644
--- a/include/comphelper/namedvaluecollection.hxx
+++ b/include/comphelper/namedvaluecollection.hxx
@@ -136,7 +136,7 @@ namespace comphelper
 
 @retval
 true if there is a value with the given name, which could 
successfully
-be extraced. In this case, @c _out_rValue will contain the 
requested
+be extracted. In this case, @c _out_rValue will contain the 
requested
 value.
 @retval
 false, if there is no value with the given name.
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

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

2019-03-02 Thread Libreoffice Gerrit user
 include/comphelper/sequence.hxx |6 ++
 1 file changed, 2 insertions(+), 4 deletions(-)

New commits:
commit e9c9848d30c90bd430193dd1b408db6889400063
Author: Mike Kaganski 
AuthorDate: Sat Mar 2 14:31:04 2019 +0100
Commit: Mike Kaganski 
CommitDate: Sat Mar 2 15:46:27 2019 +0100

Use implCopySequence to avoid overhead of non-const operator[]

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

diff --git a/include/comphelper/sequence.hxx b/include/comphelper/sequence.hxx
index 59cd74fb1b83..7f134294ea57 100644
--- a/include/comphelper/sequence.hxx
+++ b/include/comphelper/sequence.hxx
@@ -91,10 +91,8 @@ namespace comphelper
 
 OSL_ENSURE(0 <= _nPos && _nPos < nLength, "invalid index");
 
-for (sal_Int32 i = _nPos + 1; i < nLength; ++i)
-{
-_rSeq[i-1] = _rSeq[i];
-}
+T* pPos = _rSeq.getArray() + _nPos;
+internal::implCopySequence(pPos + 1, pPos, nLength - _nPos - 1);
 
 _rSeq.realloc(nLength-1);
 }
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

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

2019-03-01 Thread Libreoffice Gerrit user
 include/comphelper/sequence.hxx |   41 ++--
 1 file changed, 7 insertions(+), 34 deletions(-)

New commits:
commit 289cff91eb67c27874ba5b9188a05ea8768d
Author: Mike Kaganski 
AuthorDate: Fri Mar 1 11:33:28 2019 +0100
Commit: Mike Kaganski 
CommitDate: Fri Mar 1 21:27:10 2019 +0100

Use parameter pack + folding to have only one concatSequences

Change-Id: I4a303f8aab7a0e2af83dd9be7c269dc6855311a9
Reviewed-on: https://gerrit.libreoffice.org/68542
Reviewed-by: Mike Kaganski 
Tested-by: Mike Kaganski 

diff --git a/include/comphelper/sequence.hxx b/include/comphelper/sequence.hxx
index d80534f4a8c7..59cd74fb1b83 100644
--- a/include/comphelper/sequence.hxx
+++ b/include/comphelper/sequence.hxx
@@ -43,21 +43,15 @@ namespace comphelper
 }
 }
 
-/// concat two sequences
-template 
-inline css::uno::Sequence concatSequences(const css::uno::Sequence& 
_rLeft, const css::uno::Sequence& _rRight)
+/// concat several sequences
+template 
+inline css::uno::Sequence concatSequences(const css::uno::Sequence& 
rS1, const Ss&... rSn)
 {
-sal_Int32 nLeft(_rLeft.getLength()), nRight(_rRight.getLength());
-const T* pLeft = _rLeft.getConstArray();
-const T* pRight = _rRight.getConstArray();
-
-sal_Int32 nReturnLen(nLeft + nRight);
-css::uno::Sequence aReturn(nReturnLen);
+// unary fold to disallow empty parameter pack: at least have one 
sequence in rSn
+css::uno::Sequence aReturn(rS1.getLength() + (... + 
rSn.getLength()));
 T* pReturn = aReturn.getArray();
-
-internal::implCopySequence(pLeft, pReturn, nLeft);
-internal::implCopySequence(pRight, pReturn, nRight);
-
+(internal::implCopySequence(rS1.getConstArray(), pReturn, 
rS1.getLength()), ...,
+ internal::implCopySequence(rSn.getConstArray(), pReturn, 
rSn.getLength()));
 return aReturn;
 }
 
@@ -89,27 +83,6 @@ namespace comphelper
 return ret;
 }
 
-/// concat three sequences
-template 
-inline css::uno::Sequence concatSequences(const css::uno::Sequence& 
_rLeft, const css::uno::Sequence& _rMiddle, const css::uno::Sequence& 
_rRight)
-{
-sal_Int32 nLeft(_rLeft.getLength()), nMiddle(_rMiddle.getLength()), 
nRight(_rRight.getLength());
-const T* pLeft = _rLeft.getConstArray();
-const T* pMiddle = _rMiddle.getConstArray();
-const T* pRight = _rRight.getConstArray();
-
-sal_Int32 nReturnLen(nLeft + nMiddle + nRight);
-css::uno::Sequence aReturn(nReturnLen);
-T* pReturn = aReturn.getArray();
-
-internal::implCopySequence(pLeft, pReturn, nLeft);
-internal::implCopySequence(pMiddle, pReturn, nMiddle);
-internal::implCopySequence(pRight, pReturn, nRight);
-
-return aReturn;
-}
-
-
 /// remove a specified element from a sequences
 template
 inline void removeElementAt(css::uno::Sequence& _rSeq, sal_Int32 _nPos)
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

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

2018-10-08 Thread Libreoffice Gerrit user
 include/comphelper/processfactory.hxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 078a81d5ba9f44b642e3e8b838fc4fe48a91810a
Author: Stephan Bergmann 
AuthorDate: Mon Oct 8 15:35:17 2018 +0200
Commit: Stephan Bergmann 
CommitDate: Mon Oct 8 15:35:17 2018 +0200

Fix undefined css::uno::Reference dtor

...when compiling desktop/source/app/crashreport.cxx, after
2a962cb122f796aef9a10252ab224f5cd70569cf "tdf#42949 Fix IWYU warnings in
include/comphelper/[m-z]*"

Change-Id: Icefe8f8d0a10ed6357daf0530afc01598dd99e22

diff --git a/include/comphelper/processfactory.hxx 
b/include/comphelper/processfactory.hxx
index 7531ee4fbebe..33b72f51cbed 100644
--- a/include/comphelper/processfactory.hxx
+++ b/include/comphelper/processfactory.hxx
@@ -20,7 +20,7 @@
 #ifndef INCLUDED_COMPHELPER_PROCESSFACTORY_HXX
 #define INCLUDED_COMPHELPER_PROCESSFACTORY_HXX
 
-#include 
+#include 
 #include 
 
 namespace com { namespace sun { namespace star { namespace lang {
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: include/comphelper include/vcl

2018-09-20 Thread Libreoffice Gerrit user
 include/comphelper/interfacecontainer2.hxx |   12 
 include/vcl/scheduler.hxx  |2 +-
 2 files changed, 5 insertions(+), 9 deletions(-)

New commits:
commit 2369b23256df2e910722800f14aec4eba41b6f5d
Author: Stephan Bergmann 
AuthorDate: Thu Sep 20 11:15:49 2018 +0200
Commit: Stephan Bergmann 
CommitDate: Thu Sep 20 13:05:01 2018 +0200

Replace SAL_DELETED_FUNCTION with = delete in internal code

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

diff --git a/include/comphelper/interfacecontainer2.hxx 
b/include/comphelper/interfacecontainer2.hxx
index 60bf7e74a1db..22c1277e5fe0 100644
--- a/include/comphelper/interfacecontainer2.hxx
+++ b/include/comphelper/interfacecontainer2.hxx
@@ -109,10 +109,8 @@ private:
 detail::element_alias2   aData;
 sal_Int32nRemain;
 
-OInterfaceIteratorHelper2( const OInterfaceIteratorHelper2 & )
-SAL_DELETED_FUNCTION;
-OInterfaceIteratorHelper2 &  operator = ( const OInterfaceIteratorHelper2 
& )
-SAL_DELETED_FUNCTION;
+OInterfaceIteratorHelper2( const OInterfaceIteratorHelper2 & ) = delete;
+OInterfaceIteratorHelper2 &  operator = ( const OInterfaceIteratorHelper2 
& ) = delete;
 };
 
 
@@ -235,10 +233,8 @@ friend class OInterfaceIteratorHelper2;
 /** TRUE -> aData.pAsVector is of type Sequence< XInterfaceSequence >. */
 boolbIsList;
 
-OInterfaceContainerHelper2( const OInterfaceContainerHelper2 & )
-SAL_DELETED_FUNCTION;
-OInterfaceContainerHelper2 & operator = ( const OInterfaceContainerHelper2 
& )
-SAL_DELETED_FUNCTION;
+OInterfaceContainerHelper2( const OInterfaceContainerHelper2 & ) = delete;
+OInterfaceContainerHelper2 & operator = ( const OInterfaceContainerHelper2 
& ) = delete;
 
 /*
   Duplicate content of the container and release the old one without 
destroying.
diff --git a/include/vcl/scheduler.hxx b/include/vcl/scheduler.hxx
index 6233d134a8ed..0d0d58962185 100644
--- a/include/vcl/scheduler.hxx
+++ b/include/vcl/scheduler.hxx
@@ -32,7 +32,7 @@ class VCL_DLLPUBLIC Scheduler final
 {
 friend class SchedulerGuard;
 friend class Task;
-Scheduler() SAL_DELETED_FUNCTION;
+Scheduler() = delete;
 
 static inline void UpdateSystemTimer( ImplSchedulerContext ,
   sal_uInt64 nMinPeriod,
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: include/comphelper vcl/headless vcl/inc vcl/osx vcl/qt5 vcl/source vcl/unx vcl/win

2018-09-18 Thread Libreoffice Gerrit user
 include/comphelper/solarmutex.hxx |6 +++---
 vcl/headless/svpinst.cxx  |   18 +-
 vcl/inc/osx/salinst.h |4 
 vcl/inc/qt5/Qt5Instance.hxx   |2 +-
 vcl/inc/salinst.hxx   |   13 +++--
 vcl/inc/unx/geninst.h |   11 +++
 vcl/inc/win/salinst.h |5 -
 vcl/osx/salinst.cxx   |   30 +++---
 vcl/qt5/Qt5Instance.cxx   |6 +++---
 vcl/source/app/salvtables.cxx |   20 
 vcl/unx/generic/app/geninst.cxx   |   15 ---
 vcl/unx/kde5/KDE5SalInstance.cxx  |6 +++---
 vcl/unx/kde5/KDE5SalInstance.hxx  |2 +-
 vcl/win/app/salinst.cxx   |   32 
 14 files changed, 65 insertions(+), 105 deletions(-)

New commits:
commit 0c27134fb993b30e1a0ce827364c35f8fbaac359
Author: Jan-Marek Glogowski 
AuthorDate: Thu Sep 13 13:12:00 2018 +0200
Commit: Jan-Marek Glogowski 
CommitDate: Tue Sep 18 11:41:52 2018 +0200

Move yield mutex handling into SalInstance

After the refectoring in commit 4c93de2c921b ("merge
GenericSolarMutex and SolarMutex"), there is no more need to
prevent instantiation of comphelper::SolarMutex objects.

Since every VCL backend implements the yield mutex management in
the same way, we can move the general implementation into the
SalInstance.

While at it use std::unique_ptr for the yield mutex on Mac and
Windows platforms.

Change-Id: Ibe0610bd92b4623152ee14e7a35b52465d403720
Reviewed-on: https://gerrit.libreoffice.org/60570
Tested-by: Jenkins
Reviewed-by: Jan-Marek Glogowski 

diff --git a/include/comphelper/solarmutex.hxx 
b/include/comphelper/solarmutex.hxx
index 890b3e3762dd..fdecd0d09b9c 100644
--- a/include/comphelper/solarmutex.hxx
+++ b/include/comphelper/solarmutex.hxx
@@ -44,6 +44,9 @@ class COMPHELPER_DLLPUBLIC SolarMutex {
 public:
 typedef void (*BeforeReleaseHandler) ();
 
+SolarMutex();
+virtual ~SolarMutex();
+
 void SetBeforeReleaseHandler( const BeforeReleaseHandler& rLink )
  { m_aBeforeReleaseHandler = rLink; }
 
@@ -59,9 +62,6 @@ public:
 static SolarMutex *get();
 
 protected:
-SolarMutex();
-virtual ~SolarMutex();
-
 virtual sal_uInt32 doRelease( bool bUnlockAll );
 virtual void doAcquire( sal_uInt32 nLockCount );
 
diff --git a/vcl/headless/svpinst.cxx b/vcl/headless/svpinst.cxx
index c5d0c89b4778..a711d693f00e 100644
--- a/vcl/headless/svpinst.cxx
+++ b/vcl/headless/svpinst.cxx
@@ -94,7 +94,7 @@ SvpSalInstance::~SvpSalInstance()
 
 void SvpSalInstance::CloseWakeupPipe(bool log)
 {
-SvpSalYieldMutex *const 
pMutex(dynamic_cast(mpSalYieldMutex.get()));
+SvpSalYieldMutex *const 
pMutex(dynamic_cast(GetYieldMutex()));
 if (!pMutex)
 return;
 if (pMutex->m_FeedbackFDs[0] != -1)
@@ -111,7 +111,7 @@ void SvpSalInstance::CloseWakeupPipe(bool log)
 
 void SvpSalInstance::CreateWakeupPipe(bool log)
 {
-SvpSalYieldMutex *const 
pMutex(dynamic_cast(mpSalYieldMutex.get()));
+SvpSalYieldMutex *const 
pMutex(dynamic_cast(GetYieldMutex()));
 if (!pMutex)
 return;
 if (pipe (pMutex->m_FeedbackFDs) == -1)
@@ -163,7 +163,7 @@ void SvpSalInstance::Wakeup(SvpRequest const request)
 #ifndef NDEBUG
 if (!g_CheckedMutex)
 {
-assert(dynamic_cast(mpSalYieldMutex.get()) != 
nullptr
+assert(dynamic_cast(GetYieldMutex()) != nullptr
 && "This SvpSalInstance function requires use of 
SvpSalYieldMutex");
 g_CheckedMutex = true;
 }
@@ -171,7 +171,7 @@ void SvpSalInstance::Wakeup(SvpRequest const request)
 #ifdef IOS
 (void)request;
 #else
-SvpSalYieldMutex *const 
pMutex(static_cast(mpSalYieldMutex.get()));
+SvpSalYieldMutex *const 
pMutex(static_cast(GetYieldMutex()));
 std::unique_lock g(pMutex->m_WakeUpMainMutex);
 if (request != SvpRequest::NONE)
 {
@@ -198,7 +198,7 @@ bool SvpSalInstance::CheckTimeout( bool bExecuteTimers )
 m_aTimeout = aTimeOfDay;
 m_aTimeout += m_nTimeoutMS;
 
-osl::Guard< comphelper::SolarMutex > aGuard( 
mpSalYieldMutex.get() );
+osl::Guard< comphelper::SolarMutex > aGuard( GetYieldMutex() );
 
 // notify
 ImplSVData* pSVData = ImplGetSVData();
@@ -287,12 +287,12 @@ void SvpSalInstance::ProcessEvent( SalUserEvent aEvent )
 #ifndef NDEBUG
 if (!g_CheckedMutex)
 {
-assert(dynamic_cast(mpSalYieldMutex.get()) != 
nullptr
+assert(dynamic_cast(GetYieldMutex()) != nullptr
 && "This SvpSalInstance function requires use of 
SvpSalYieldMutex");
 g_CheckedMutex = true;
 }
 #endif
-SvpSalYieldMutex *const 
pMutex(static_cast(mpSalYieldMutex.get()));
+SvpSalYieldMutex *const 
pMutex(static_cast(GetYieldMutex()));
 pMutex->m_NonMainWaitingYieldCond.set();
 }
 
@@ -404,7 +404,7 @@ bool 

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

2018-07-26 Thread Libreoffice Gerrit user
 include/comphelper/stl_types.hxx |   10 +++---
 1 file changed, 3 insertions(+), 7 deletions(-)

New commits:
commit bd8cb3ff962417e3f79ae19e7d802e433ea174ac
Author: Stephan Bergmann 
AuthorDate: Thu Jul 26 09:55:57 2018 +0200
Commit: Stephan Bergmann 
CommitDate: Thu Jul 26 12:30:20 2018 +0200

Iterators must be CopyAssignable

...so make sure the (implicitly defined) copy assignment op is not deleted 
and
has sane semantics

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

diff --git a/include/comphelper/stl_types.hxx b/include/comphelper/stl_types.hxx
index c3539bbe21a0..bf8cc2b70494 100644
--- a/include/comphelper/stl_types.hxx
+++ b/include/comphelper/stl_types.hxx
@@ -143,21 +143,17 @@ public:
 typedef size_t difference_type;
 
 OUStringBufferAppender(OUStringBuffer & i_rBuffer)
-: m_rBuffer(i_rBuffer) { }
-Self & operator=(Self const &)
-{   // MSVC 2013 with non-debug runtime requires this in xutility.hpp:289
-return *this;
-}
+: m_rBuffer(_rBuffer) { }
 Self & operator=(OUString const & i_rStr)
 {
-m_rBuffer.append( i_rStr );
+m_rBuffer->append( i_rStr );
 return *this;
 }
 Self & operator*() { return *this; } // so operator= works
 Self & operator++() { return *this; }
 
 private:
-OUStringBuffer & m_rBuffer;
+OUStringBuffer * m_rBuffer;
 };
 
 /** algorithm similar to std::copy, but inserts a separator between elements.
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2018-07-25 Thread Libreoffice Gerrit user
 include/comphelper/windowsdebugoutput.hxx |   74 +++---
 1 file changed, 37 insertions(+), 37 deletions(-)

New commits:
commit 4728dfc10830eba57a084b0cbd495f691e09d066
Author: Stephan Bergmann 
AuthorDate: Wed Jul 25 18:47:49 2018 +0200
Commit: Stephan Bergmann 
CommitDate: Wed Jul 25 21:54:40 2018 +0200

loplugin:cstylecast (clang-cl)

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

diff --git a/include/comphelper/windowsdebugoutput.hxx 
b/include/comphelper/windowsdebugoutput.hxx
index b42808ba4ada..26c95fea5c22 100644
--- a/include/comphelper/windowsdebugoutput.hxx
+++ b/include/comphelper/windowsdebugoutput.hxx
@@ -277,26 +277,26 @@ inline std::basic_ostream& 
operator<<(std::basic_ostream(rVariant.byref);
 break;
 case VT_I4:
-stream << *(int*)rVariant.byref;
+stream << *static_cast(rVariant.byref);
 break;
 case VT_R4:
-stream << *(float*)rVariant.byref;
+stream << *static_cast(rVariant.byref);
 break;
 case VT_R8:
-stream << *(double*)rVariant.byref;
+stream << *static_cast(rVariant.byref);
 break;
 case VT_CY:
-stream << ((CY*)rVariant.byref)->int64;
+stream << static_cast(rVariant.byref)->int64;
 break;
 case VT_DATE:
-stream << *(double*)rVariant.byref;
+stream << *static_cast(rVariant.byref);
 break; // FIXME
 case VT_BSTR:
 stream << std::wstring_convert, 
wchar_t>().to_bytes(
-*(OLECHAR**)rVariant.byref);
+*static_cast(rVariant.byref));
 break;
 case VT_DISPATCH:
 stream << rVariant.byref;
@@ -304,70 +304,70 @@ inline std::basic_ostream& 
operator<<(std::basic_ostream(rVariant.byref);
 stream.setf(flags);
 break;
 case VT_BOOL:
-stream << (*(VARIANT_BOOL*)rVariant.byref ? "YES" : "NO");
+stream << (*static_cast(rVariant.byref) ? "YES" 
: "NO");
 break;
 case VT_VARIANT:
-stream << *(VARIANT*)rVariant.byref;
+stream << *static_cast(rVariant.byref);
 break;
 case VT_UNKNOWN:
-stream << *(IUnknown**)rVariant.byref;
+stream << *static_cast(rVariant.byref);
 break;
 case VT_DECIMAL:
 flags = stream.flags();
 width = stream.width();
 fill = stream.fill();
 stream << std::hex << std::setw(8) << std::setfill('0')
-   << ((DECIMAL*)rVariant.byref)->Hi32;
-stream << std::setw(16) << ((DECIMAL*)rVariant.byref)->Lo64;
+   << static_cast(rVariant.byref)->Hi32;
+stream << std::setw(16) << 
static_cast(rVariant.byref)->Lo64;
 stream.setf(flags);
 stream << std::setw(width) << std::setfill(fill);
 break;
 case VT_I1:
-stream << (int)*(char*)rVariant.byref;
+stream << 
static_cast(*static_cast(rVariant.byref));
 break;
 case VT_UI1:
-stream << (unsigned int)*(unsigned char*)rVariant.byref;
+stream << static_cast(*static_cast(rVariant.byref));
 break;
 case VT_UI2:
-stream << *(unsigned short*)rVariant.byref;
+stream << *static_cast(rVariant.byref);
 break;
 case VT_UI4:
-stream << *(unsigned int*)rVariant.byref;
+stream << *static_cast(rVariant.byref);
 break;
 case VT_I8:
-stream << *(long long*)rVariant.byref;
+stream << *static_cast(rVariant.byref);
 break;
 case VT_UI8:
-stream << *(unsigned long long*)rVariant.byref;
+stream << *static_cast(rVariant.byref);
 break;
 case VT_INT:
-stream << *(int*)rVariant.byref;
+stream << *static_cast(rVariant.byref);
 break;
 case VT_UINT:
-stream << *(unsigned int*)rVariant.byref;
+stream << *static_cast(rVariant.byref);
 break;
 case VT_INT_PTR:
-stream << *(intptr_t*)rVariant.byref;
+stream << *static_cast(rVariant.byref);
 break;
 case VT_UINT_PTR:
-stream << *(uintptr_t*)rVariant.byref;
+stream << 

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

2018-07-25 Thread Libreoffice Gerrit user
 include/comphelper/stl_types.hxx |3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

New commits:
commit 58222feb7fee0c08fb54b9ee29f8f0674c5cf508
Author: Stephan Bergmann 
AuthorDate: Wed Jul 25 18:46:30 2018 +0200
Commit: Stephan Bergmann 
CommitDate: Wed Jul 25 21:54:18 2018 +0200

warning STL4015: std::iterator is deprecated (clang-cl)

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

diff --git a/include/comphelper/stl_types.hxx b/include/comphelper/stl_types.hxx
index 927a3d39df40..c3539bbe21a0 100644
--- a/include/comphelper/stl_types.hxx
+++ b/include/comphelper/stl_types.hxx
@@ -132,8 +132,7 @@ inline mem_fun1_t mem_fun(void (Tp::*f)(Arg))
 
 /** output iterator that appends OUStrings into an OUStringBuffer.
  */
-class OUStringBufferAppender :
-public ::std::iterator< ::std::output_iterator_tag, void, void, void, void>
+class OUStringBufferAppender
 {
 public:
 typedef OUStringBufferAppender Self;
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


  1   2   >