[Libreoffice-commits] core.git: solenv/vs

2019-07-11 Thread Mike Kaganski (via logerrit)
 solenv/vs/LibreOffice.natvis |3 +++
 1 file changed, 3 insertions(+)

New commits:
commit 00c98220e624866956294e8a1af3e826808399f9
Author: Mike Kaganski 
AuthorDate: Thu Jul 11 07:58:21 2019 +0200
Commit: Mike Kaganski 
CommitDate: Thu Jul 11 08:01:39 2019 +0200

Natvis: add ErrCode visualizer

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

diff --git a/solenv/vs/LibreOffice.natvis b/solenv/vs/LibreOffice.natvis
index 8640779ac7bd..a9b9f561b791 100644
--- a/solenv/vs/LibreOffice.natvis
+++ b/solenv/vs/LibreOffice.natvis
@@ -468,4 +468,7 @@
   *reinterpret_cast$T1 
*(m_storage.dummy_.data)
 
   
+  
+Area: {static_castErrCodeArea((m_value >> 13)  
0x01fff),en}, class: {static_castErrCodeClass((m_value >> 8)  
0x1f),en}, code: {m_value  0xff}
+  
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

[Libreoffice-commits] core.git: Branch 'libreoffice-6-3' - ucb/source

2019-07-11 Thread Mike Kaganski (via logerrit)
 ucb/source/ucp/webdav-neon/NeonSession.cxx |   16 ++--
 1 file changed, 14 insertions(+), 2 deletions(-)

New commits:
commit c8b91cc5356d670a3b0a7ca0efaccb56b7125bb5
Author: Mike Kaganski 
AuthorDate: Mon Jul 8 16:25:16 2019 +1000
Commit: Michael Stahl 
CommitDate: Thu Jul 11 11:03:15 2019 +0200

tdf#126279: reinitialize session after NE_AUTH errors in (UN)LOCK

This just fixes the crash; but there's still a problem left/TODO, because
the lock is kept registered with NeonLockStore; following attempts to lock
and unlock fail.

The NE_AUTH error is returned from this call stack:

neon.dll!clean_session(auth_session * sess) Line 275
at 
C:\cygwin\home\user\lode\dev\core\workdir\UnpackedTarball\neon\src\ne_auth.c(275)
neon.dll!ah_post_send(ne_request_s * req, void * cookie, const ne_status * 
status) Line 1554
at 
C:\cygwin\home\user\lode\dev\core\workdir\UnpackedTarball\neon\src\ne_auth.c(1554)
neon.dll!ne_end_request(ne_request_s * req) Line 1399
at 
C:\cygwin\home\user\lode\dev\core\workdir\UnpackedTarball\neon\src\ne_request.c(1399)
neon.dll!ne_xml_dispatch_request(ne_request_s * req, ne_xml_parser_s * 
parser) Line 105
at 
C:\cygwin\home\user\lode\dev\core\workdir\UnpackedTarball\neon\src\ne_xmlreq.c(105)
neon.dll!ne_lock_refresh(ne_session_s * sess, ne_lock * lock) Line 849
at 
C:\cygwin\home\user\lode\dev\core\workdir\UnpackedTarball\neon\src\ne_locks.c(849)
ucpdav1.dll!webdav_ucp::NeonSession::LOCK(ne_lock * pLock, long & 
rlastChanceToSendRefreshRequest) Line 1663
at 
C:\cygwin\home\user\lode\dev\core\ucb\source\ucp\webdav-neon\NeonSession.cxx(1663)
ucpdav1.dll!webdav_ucp::NeonLockStore::refreshLocks() Line 216
at 
C:\cygwin\home\user\lode\dev\core\ucb\source\ucp\webdav-neon\NeonLockStore.cxx(216)
ucpdav1.dll!webdav_ucp::TickerThread::execute() Line 78
at 
C:\cygwin\home\user\lode\dev\core\ucb\source\ucp\webdav-neon\NeonLockStore.cxx(78)
salhelper3MSC.dll!salhelper::Thread::run() Line 40
at C:\cygwin\home\user\lode\dev\core\salhelper\source\thread.cxx(40)
salhelper3MSC.dll!threadFunc(void * param) Line 186
at C:\cygwin\home\user\lode\dev\core\include\osl\thread.hxx(186)
sal3.dll!oslWorkerWrapperFunction(void * pData) Line 58
at C:\cygwin\home\user\lode\dev\core\sal\osl\w32\thread.cxx(58)
ucrtbased.dll!thread_start(void * const 
parameter) Line 97
at minkernel\crts\ucrt\src\appcrt\startup\thread.cpp(97)
kernel32.dll!BaseThreadInitThunk()
ntdll.dll!RtlUserThreadStart()

If not reinitialized, then on next access, it SEGFAULTs (hostname is 
nullptr):

neon.dll!ne_addr_resolve(const char * hostname, int flags) Line 926
at 
C:\cygwin\home\user\lode\dev\core\workdir\UnpackedTarball\neon\src\ne_socket.c(926)
neon.dll!canonical_hostname(const char * serverName) Line 382
at 
C:\cygwin\home\user\lode\dev\core\workdir\UnpackedTarball\neon\src\ne_sspi.c(382)
neon.dll!ne_sspi_create_context(void * * context, char * serverName, int 
ntlm) Line 423
at 
C:\cygwin\home\user\lode\dev\core\workdir\UnpackedTarball\neon\src\ne_sspi.c(423)
neon.dll!continue_sspi(auth_session * sess, int ntlm, const char * hdr, int 
attempt, auth_challenge * parms, ne_buffer * * errmsg) Line 639
at 
C:\cygwin\home\user\lode\dev\core\workdir\UnpackedTarball\neon\src\ne_auth.c(639)
neon.dll!sspi_challenge(auth_session * sess, int attempt, auth_challenge * 
parms, ne_buffer * * errmsg) Line 675
at 
C:\cygwin\home\user\lode\dev\core\workdir\UnpackedTarball\neon\src\ne_auth.c(675)
neon.dll!auth_challenge(auth_session * sess, int attempt, const char * 
value) Line 1419
at 
C:\cygwin\home\user\lode\dev\core\workdir\UnpackedTarball\neon\src\ne_auth.c(1419)
neon.dll!ah_post_send(ne_request_s * req, void * cookie, const ne_status * 
status) Line 1550
at 
C:\cygwin\home\user\lode\dev\core\workdir\UnpackedTarball\neon\src\ne_auth.c(1550)
neon.dll!ne_end_request(ne_request_s * req) Line 1399
at 
C:\cygwin\home\user\lode\dev\core\workdir\UnpackedTarball\neon\src\ne_request.c(1399)
neon.dll!ne_request_dispatch(ne_request_s * req) Line 1458
at 
C:\cygwin\home\user\lode\dev\core\workdir\UnpackedTarball\neon\src\ne_request.c(1458)
ucpdav1.dll!webdav_ucp::NeonSession::OPTIONS(const rtl::OUString & inPath, 
webdav_ucp::DAVOptions & rOptions, const webdav_ucp::DAVRequestEnvironment & 
rEnv) Line 913
at 
C:\cygwin\home\user\lode\dev\core\ucb\source\ucp\webdav-neon\NeonSession.cxx(913)
ucpdav1.dll!webdav_ucp::DAVResourceAccess::OPTIONS(webdav_ucp::DAVOptions & 
rOptions, const 
com::sun::star::uno::Reference & 
xEnv) Line 187
at 
C:\cygwin\home\user\lode\dev\core\ucb\source\ucp\webdav-neon\DAVResourceAccess.cxx(187)

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

2019-07-11 Thread Mike Kaganski (via logerrit)
 sfx2/source/view/viewfrm.cxx |   11 +++
 1 file changed, 11 insertions(+)

New commits:
commit df9adfc95429bdaf085e9927ec5b326cee6b7a2a
Author: Mike Kaganski 
AuthorDate: Thu Jul 11 22:24:41 2019 +1000
Commit: Mike Kaganski 
CommitDate: Thu Jul 11 15:25:57 2019 +0200

Restore original value of SID_DOC_READONLY item on cancel or SID_EDITDOC

Otherwise, SfxObjectShell::DoSaveCompleted later calls
SfxMedium::LockOrigFileOnDemand, which sets error state for the medium
reopened in read-only mode, as if it were opened in read-write mode.

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

diff --git a/sfx2/source/view/viewfrm.cxx b/sfx2/source/view/viewfrm.cxx
index e26587be9cb4..495b640c7856 100644
--- a/sfx2/source/view/viewfrm.cxx
+++ b/sfx2/source/view/viewfrm.cxx
@@ -460,6 +460,13 @@ void SfxViewFrame::ExecReload_Impl( SfxRequest& rReq )
 bool bOK = false;
 bool bRetryIgnoringLock = false;
 bool bOpenTemplate = false;
+boost::optional aOrigROVal;
+if (!pVersionItem)
+{
+auto pRO = 
pMed->GetItemSet()->GetItem(SID_DOC_READONLY, false);
+if (pRO)
+aOrigROVal = pRO->GetValue();
+}
 do {
 LockFileEntry aLockData;
 if ( !pVersionItem )
@@ -524,6 +531,10 @@ void SfxViewFrame::ExecReload_Impl( SfxRequest& rReq )
 {
 pMed->ResetError();
 pMed->SetOpenMode( SFX_STREAM_READONLY );
+if (aOrigROVal)
+
pMed->GetItemSet()->Put(SfxBoolItem(SID_DOC_READONLY, *aOrigROVal));
+else
+pMed->GetItemSet()->ClearItem(SID_DOC_READONLY);
 pMed->ReOpen();
 pSh->DoSaveCompleted( pMed );
 }
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

[Libreoffice-commits] core.git: sw/qa

2019-07-11 Thread Mike Kaganski (via logerrit)
 sw/qa/extras/ooxmlexport/ooxmlexport7.cxx |   22 --
 1 file changed, 12 insertions(+), 10 deletions(-)

New commits:
commit bce7a874d121871dab7976cb148bfe2615a6bcb4
Author: Mike Kaganski 
AuthorDate: Thu Jul 11 09:44:43 2019 +0200
Commit: Mike Kaganski 
CommitDate: Thu Jul 11 11:05:42 2019 +0200

Compare coordinates with tolerance

The test was excluded from macOS in commit
bdad941d7349f330dab2c3d47237bd380d5b7391, because of "hard to
smooth out Retina-related rounding roundtrip error". But this
is also unreliable e.g. on Windows, where it might fail with
"Expected: 3171 Actual: 3170".

Use CPPUNIT_ASSERT_DOUBLES_EQUAL with a tolerance (set to 1 for now),
and restore testing on macOS.

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

diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport7.cxx 
b/sw/qa/extras/ooxmlexport/ooxmlexport7.cxx
index a99d2e2c6ad7..e89134d6ab65 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport7.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport7.cxx
@@ -1108,16 +1108,18 @@ DECLARE_OOXMLEXPORT_TEST(testFlipAndRotateCustomShape, 
"flip_and_rotate.odt")
 // check rotation angle
 assertXPath(pXmlDoc, "//a:xfrm", "rot", "1350");
 // check the first few coordinates of the polygon
-#ifndef MACOSX /* Retina-related rounding roundtrip error
-* hard to smooth out due to the use of string compare
-* instead of number */
-assertXPath(pXmlDoc, "//a:custGeom/a:pathLst/a:path/a:lnTo[1]/a:pt", "x", 
"2351");
-assertXPath(pXmlDoc, "//a:custGeom/a:pathLst/a:path/a:lnTo[1]/a:pt", "y", 
"3171");
-assertXPath(pXmlDoc, "//a:custGeom/a:pathLst/a:path/a:lnTo[2]/a:pt", "x", 
"1695");
-assertXPath(pXmlDoc, "//a:custGeom/a:pathLst/a:path/a:lnTo[2]/a:pt", "y", 
"3171");
-assertXPath(pXmlDoc, "//a:custGeom/a:pathLst/a:path/a:lnTo[3]/a:pt", "x", 
"1695");
-assertXPath(pXmlDoc, "//a:custGeom/a:pathLst/a:path/a:lnTo[3]/a:pt", "y", 
"1701");
-#endif
+CPPUNIT_ASSERT_DOUBLES_EQUAL(
+2351, getXPath(pXmlDoc, 
"//a:custGeom/a:pathLst/a:path/a:lnTo[1]/a:pt", "x").toInt32(), 1);
+CPPUNIT_ASSERT_DOUBLES_EQUAL(
+3171, getXPath(pXmlDoc, 
"//a:custGeom/a:pathLst/a:path/a:lnTo[1]/a:pt", "y").toInt32(), 1);
+CPPUNIT_ASSERT_DOUBLES_EQUAL(
+1695, getXPath(pXmlDoc, 
"//a:custGeom/a:pathLst/a:path/a:lnTo[2]/a:pt", "x").toInt32(), 1);
+CPPUNIT_ASSERT_DOUBLES_EQUAL(
+3171, getXPath(pXmlDoc, 
"//a:custGeom/a:pathLst/a:path/a:lnTo[2]/a:pt", "y").toInt32(), 1);
+CPPUNIT_ASSERT_DOUBLES_EQUAL(
+1695, getXPath(pXmlDoc, 
"//a:custGeom/a:pathLst/a:path/a:lnTo[3]/a:pt", "x").toInt32(), 1);
+CPPUNIT_ASSERT_DOUBLES_EQUAL(
+1701, getXPath(pXmlDoc, 
"//a:custGeom/a:pathLst/a:path/a:lnTo[3]/a:pt", "y").toInt32(), 1);
 }
 
 DECLARE_OOXMLEXPORT_TEST(testTdf92335, "tdf92335.docx")
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

[Libreoffice-commits] core.git: Branch 'libreoffice-6-3' - ucb/source

2019-07-11 Thread Mike Kaganski (via logerrit)
 ucb/source/ucp/webdav-neon/NeonLockStore.cxx |   13 -
 ucb/source/ucp/webdav-neon/NeonLockStore.hxx |2 ++
 ucb/source/ucp/webdav-neon/NeonSession.cxx   |1 +
 3 files changed, 15 insertions(+), 1 deletion(-)

New commits:
commit d0af88819e9b569f7b2584921e910422b8aaff9e
Author: Mike Kaganski 
AuthorDate: Mon Jul 8 23:47:12 2019 +1000
Commit: Michael Stahl 
CommitDate: Thu Jul 11 13:12:23 2019 +0200

tdf#126279 related: remove locks from NeonLockStore after NE_AUTH error

Change-Id: Idbbb9bb215e3a56e72a29f798c5a5f84afaf2213
Reviewed-on: https://gerrit.libreoffice.org/75224
Tested-by: Jenkins
Reviewed-by: Mike Kaganski 
(cherry picked from commit 94e4695bcfcb9356d37942c47359b94531ef7b95)
Reviewed-on: https://gerrit.libreoffice.org/75407
Reviewed-by: Michael Stahl 

diff --git a/ucb/source/ucp/webdav-neon/NeonLockStore.cxx 
b/ucb/source/ucp/webdav-neon/NeonLockStore.cxx
index 13b24f7b665d..8ac218915a4d 100644
--- a/ucb/source/ucp/webdav-neon/NeonLockStore.cxx
+++ b/ucb/source/ucp/webdav-neon/NeonLockStore.cxx
@@ -151,7 +151,7 @@ void NeonLockStore::stopTicker(osl::ClearableMutexGuard & 
rGuard)
 
 rGuard.clear();
 
-if (pTickerThread.is())
+if (pTickerThread.is() && pTickerThread->getIdentifier() != 
osl::Thread::getCurrentIdentifier())
 pTickerThread->join(); // without m_aMutex locked (to prevent deadlock)
 }
 
@@ -196,6 +196,13 @@ void NeonLockStore::removeLock( NeonLock * pLock )
 stopTicker(aGuard);
 }
 
+void NeonLockStore::removeLockDeferred(NeonLock* pLock)
+{
+osl::MutexGuard aGuard(m_aMutex);
+
+m_aRemoveDeferred.push_back(pLock);
+}
+
 void NeonLockStore::refreshLocks()
 {
 osl::MutexGuard aGuard( m_aMutex );
@@ -228,6 +235,10 @@ void NeonLockStore::refreshLocks()
 }
 }
 }
+// removeLock will not need to actually release the lock, because this is 
run from TickerThread
+for (auto pLock : m_aRemoveDeferred)
+removeLock(pLock);
+m_aRemoveDeferred.clear();
 }
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/ucb/source/ucp/webdav-neon/NeonLockStore.hxx 
b/ucb/source/ucp/webdav-neon/NeonLockStore.hxx
index 0cee2063fd31..86fccb68a50f 100644
--- a/ucb/source/ucp/webdav-neon/NeonLockStore.hxx
+++ b/ucb/source/ucp/webdav-neon/NeonLockStore.hxx
@@ -66,6 +66,7 @@ class NeonLockStore
 ne_lock_store * const m_pNeonLockStore;
 rtl::Reference< TickerThread > m_pTickerThread;
 LockInfoMapm_aLockInfoMap;
+std::vector m_aRemoveDeferred;
 
 public:
 NeonLockStore();
@@ -82,6 +83,7 @@ public:
   sal_Int32 nLastChanceToSendRefreshRequest );
 
 void removeLock( NeonLock * pLock );
+void removeLockDeferred(NeonLock* pLock);
 
 void refreshLocks();
 
diff --git a/ucb/source/ucp/webdav-neon/NeonSession.cxx 
b/ucb/source/ucp/webdav-neon/NeonSession.cxx
index d4dab49ae37e..e5ab416c84ba 100644
--- a/ucb/source/ucp/webdav-neon/NeonSession.cxx
+++ b/ucb/source/ucp/webdav-neon/NeonSession.cxx
@@ -1682,6 +1682,7 @@ bool NeonSession::LOCK( NeonLock * pLock,
 {
 // tdf#126279: see handling of NE_AUTH in HandleError
 m_bNeedNewSession = true;
+m_aNeonLockStore.removeLockDeferred(pLock);
 }
 return false;
 }
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

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

2019-07-11 Thread Mike Kaganski (via logerrit)
 include/vcl/errcode.hxx |4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

New commits:
commit cb53a3508d086beecb440c78789932fb8eb30756
Author: Mike Kaganski 
AuthorDate: Thu Jul 11 07:29:10 2019 +0200
Commit: Mike Kaganski 
CommitDate: Thu Jul 11 13:09:26 2019 +0200

Return constexpr to ErrCode ctors

... removed in commit e9c74a075c3c0809b993c017c11d1505bd244dc8.
assert should not prevent constexpr since C++14.

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

diff --git a/include/vcl/errcode.hxx b/include/vcl/errcode.hxx
index a6ef02762c5a..d189f038539b 100644
--- a/include/vcl/errcode.hxx
+++ b/include/vcl/errcode.hxx
@@ -63,12 +63,12 @@ enum class WarningFlag { Yes };
 class SAL_WARN_UNUSED ErrCode final
 {
 public:
-explicit ErrCode(WarningFlag, ErrCodeArea nArea, ErrCodeClass nClass, 
sal_uInt16 nCode)
+explicit constexpr ErrCode(WarningFlag, ErrCodeArea nArea, ErrCodeClass 
nClass, sal_uInt16 nCode)
 : m_value(ERRCODE_WARNING_MASK | (sal_uInt32(nArea) << 
ERRCODE_AREA_SHIFT) | (sal_uInt32(nClass) << ERRCODE_CLASS_SHIFT) | nCode)
 {
 assert(nCode <= 0xff && "code out of range");
 }
-explicit ErrCode(ErrCodeArea nArea, ErrCodeClass nClass, sal_uInt16 nCode)
+explicit constexpr ErrCode(ErrCodeArea nArea, ErrCodeClass nClass, 
sal_uInt16 nCode)
 : m_value((sal_uInt32(nArea) << ERRCODE_AREA_SHIFT) | 
(sal_uInt32(nClass) << ERRCODE_CLASS_SHIFT) | nCode)
 {
 assert(nCode <= 0xff && "code out of range");
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

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

2019-07-12 Thread Mike Kaganski (via logerrit)
 sfx2/source/view/viewfrm.cxx |   15 +--
 1 file changed, 13 insertions(+), 2 deletions(-)

New commits:
commit 60dffd80468e5ca4471bc67d02c58c8c784a86f1
Author: Mike Kaganski 
AuthorDate: Fri Jul 12 15:46:45 2019 +1000
Commit: Mike Kaganski 
CommitDate: Fri Jul 12 13:38:48 2019 +0200

tdf#126241: make sure to fill input stream before LockOrigFileOnDemand

Otherwise, the function returns early, without providing lock file
information to the caller.

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

diff --git a/sfx2/source/view/viewfrm.cxx b/sfx2/source/view/viewfrm.cxx
index 495b640c7856..406e4ce22fff 100644
--- a/sfx2/source/view/viewfrm.cxx
+++ b/sfx2/source/view/viewfrm.cxx
@@ -484,10 +484,21 @@ void SfxViewFrame::ExecReload_Impl( SfxRequest& rReq )
 }
 
 pMed->CloseAndRelease();
-pMed->GetItemSet()->Put( SfxBoolItem( 
SID_DOC_READONLY, !( nOpenMode & StreamMode::WRITE ) ) );
 pMed->SetOpenMode( nOpenMode );
-
+// We need to clear the SID_DOC_READONLY item from the 
set, to allow
+// MediaDescriptor::impl_openStreamWithURL (called 
indirectly by
+// SfxMedium::CompleteReOpen) to properly fill input 
stream of the
+// descriptor, even when the file can't be open in 
read-write mode.
+// Only then can following call to 
SfxMedium::LockOrigFileOnDemand
+// return proper information about who has locked the 
file, to show
+// in the SfxQueryOpenAsTemplate box below; otherwise 
it exits right
+// after call to SfxMedium::GetMedium_Impl. This 
mimics what happens
+// when the file is opened initially, when filter 
detection code also
+// calls MediaDescriptor::impl_openStreamWithURL 
without the item set.
+pMed->GetItemSet()->ClearItem(SID_DOC_READONLY);
 pMed->CompleteReOpen();
+pMed->GetItemSet()->Put(
+SfxBoolItem(SID_DOC_READONLY, !(nOpenMode & 
StreamMode::WRITE)));
 if ( nOpenMode & StreamMode::WRITE )
 {
 auto eResult = pMed->LockOrigFileOnDemand(
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

[Libreoffice-commits] help.git: source/text

2019-07-12 Thread Mike Kaganski (via logerrit)
 source/text/scalc/05/0214.xhp |   26 +-
 1 file changed, 25 insertions(+), 1 deletion(-)

New commits:
commit 4dcfe928580c1492bb265eb6070f66459a4c03db
Author: Mike Kaganski 
AuthorDate: Mon Jun 10 02:16:56 2019 +0200
Commit: Mike Kaganski 
CommitDate: Sat Jul 13 05:03:15 2019 +0200

Add missing Calc error codes

See include/formula/errorcodes.hxx; added those that return true from
isPublishedFormulaError.

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

diff --git a/source/text/scalc/05/0214.xhp 
b/source/text/scalc/05/0214.xhp
index d7c66841b..bb3be0f7d 100644
--- a/source/text/scalc/05/0214.xhp
+++ b/source/text/scalc/05/0214.xhp
@@ -108,7 +108,7 @@
  
  
 
-   508
+   507, 508
 
 
Error: Pair missing
@@ -322,6 +322,30 @@
  
  
 
+   530
+
+
+   No AddIn
+
+
+   
+  Interpreter: AddIn not found.
+
+ 
+ 
+
+   531
+
+
+   No Macro
+
+
+   
+  Interpreter: Macro not found.
+
+ 
+ 
+
532#DIV/0!
 
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

[Libreoffice-commits] core.git: helpcontent2

2019-07-12 Thread Mike Kaganski (via logerrit)
 helpcontent2 |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit a871265f202255702541e990d67b605d778d5a92
Author: Mike Kaganski 
AuthorDate: Mon Jun 10 02:16:56 2019 +0200
Commit: Gerrit Code Review 
CommitDate: Sat Jul 13 05:03:15 2019 +0200

Update git submodules

* Update helpcontent2 from branch 'master'
  - Add missing Calc error codes

See include/formula/errorcodes.hxx; added those that return true from
isPublishedFormulaError.

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

diff --git a/helpcontent2 b/helpcontent2
index 965724a89fb8..4dcfe928580c 16
--- a/helpcontent2
+++ b/helpcontent2
@@ -1 +1 @@
-Subproject commit 965724a89fb88f693e85da64a1e8b6a1556d373c
+Subproject commit 4dcfe928580c1492bb265eb6070f66459a4c03db
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

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

2019-07-08 Thread Mike Kaganski (via logerrit)
 sc/source/core/inc/arraysumfunctor.hxx |4 
 1 file changed, 4 insertions(+)

New commits:
commit 1f25fd18f006c89c5e387b4ca8546025bc3a969b
Author: Mike Kaganski 
AuthorDate: Tue Jul 9 12:13:13 2019 +1000
Commit: Mike Kaganski 
CommitDate: Tue Jul 9 04:30:26 2019 +0200

Fix Windows x64 build after commit f43f9b99603736a4d54f550052509eb5f4d04b45

... and Windows x32, if it's built with sse2 baseline (will be the default
when we drop support for Windows 7).

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

diff --git a/sc/source/core/inc/arraysumfunctor.hxx 
b/sc/source/core/inc/arraysumfunctor.hxx
index 05977c026361..b4da4d9d4064 100644
--- a/sc/source/core/inc/arraysumfunctor.hxx
+++ b/sc/source/core/inc/arraysumfunctor.hxx
@@ -19,8 +19,12 @@
 #include 
 
 #if defined(LO_SSE2_AVAILABLE)
+#ifdef _WIN32
+#include 
+#else
 #include 
 #endif
+#endif
 
 namespace sc
 {
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

[Libreoffice-commits] core.git: sal/osl

2019-07-08 Thread Mike Kaganski (via logerrit)
 sal/osl/w32/time.cxx |   36 
 1 file changed, 20 insertions(+), 16 deletions(-)

New commits:
commit f65905dd0ff464774f338db44d69925f98e1766c
Author: Mike Kaganski 
AuthorDate: Tue Jul 9 01:09:35 2019 +0200
Commit: Mike Kaganski 
CommitDate: Tue Jul 9 02:03:44 2019 +0200

Optimize osl_getSystemTime on Windows

Make OffTime static const; don't cast from FILETIME to __int64 (see

https://docs.microsoft.com/en-us/windows/win32/api/minwinbase/ns-minwinbase-filetime
for explanation: "it can cause alignment faults on 64-bit Windows").
Instead, cast in opposite direction: from 8-byte-aligned 64-bit integer
to FILETIME.

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

diff --git a/sal/osl/w32/time.cxx b/sal/osl/w32/time.cxx
index 135aab368fc8..ae499dcf8a8c 100644
--- a/sal/osl/w32/time.cxx
+++ b/sal/osl/w32/time.cxx
@@ -29,9 +29,7 @@
 
 sal_Bool SAL_CALL osl_getSystemTime(TimeValue* pTimeVal)
 {
-SYSTEMTIME SystemTime;
-FILETIME   CurTime, OffTime;
-__int64Value;
+unsigned __int64 CurTime;
 
 typedef VOID (WINAPI *GetSystemTimePreciseAsFileTime_PROC)(LPFILETIME);
 
@@ -46,25 +44,31 @@ sal_Bool SAL_CALL osl_getSystemTime(TimeValue* pTimeVal)
 
 // use ~1 microsecond resolution if available
 if (pGetSystemTimePreciseAsFileTime)
-pGetSystemTimePreciseAsFileTime();
+
pGetSystemTimePreciseAsFileTime(reinterpret_cast());
 else
 {
+SYSTEMTIME SystemTime;
 GetSystemTime();
-SystemTimeToFileTime(, );
+SystemTimeToFileTime(, 
reinterpret_cast());
 }
 
-SystemTime.wYear = 1970;
-SystemTime.wMonth= 1;
-SystemTime.wDayOfWeek= 0;
-SystemTime.wDay  = 1;
-SystemTime.wHour = 0;
-SystemTime.wMinute   = 0;
-SystemTime.wSecond   = 0;
-SystemTime.wMilliseconds = 0;
-
-SystemTimeToFileTime(, );
+static const unsigned __int64 OffTime = [] {
+SYSTEMTIME SystemTime;
+SystemTime.wYear = 1970;
+SystemTime.wMonth = 1;
+SystemTime.wDayOfWeek = 0;
+SystemTime.wDay = 1;
+SystemTime.wHour = 0;
+SystemTime.wMinute = 0;
+SystemTime.wSecond = 0;
+SystemTime.wMilliseconds = 0;
+
+unsigned __int64 ft;
+SystemTimeToFileTime(, reinterpret_cast());
+return ft;
+}();
 
-Value = *reinterpret_cast<__int64 *>() - *reinterpret_cast<__int64 
*>();
+const unsigned __int64 Value = CurTime - OffTime;
 
 pTimeVal->Seconds  = static_cast(Value / 1000L);
 pTimeVal->Nanosec  = static_cast((Value % 1000L) * 100);
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

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

2019-07-08 Thread Mike Kaganski (via logerrit)
 tools/source/misc/cpuid.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 11d0cc07433206d5cc52fdfa7e91c2e28ef276ca
Author: Mike Kaganski 
AuthorDate: Tue Jul 9 04:41:51 2019 +0200
Commit: Mike Kaganski 
CommitDate: Tue Jul 9 04:43:09 2019 +0200

Fix Android build after commit fc0850d2784eaa79257cf1ea8c5d078c5241b5bf

The second parameter is unused

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

diff --git a/tools/source/misc/cpuid.cxx b/tools/source/misc/cpuid.cxx
index c4d4b8147595..41791be27897 100644
--- a/tools/source/misc/cpuid.cxx
+++ b/tools/source/misc/cpuid.cxx
@@ -28,7 +28,7 @@ void getCpuId(uint32_t array[4], uint32_t nInfoType)
 __cpuid_count(nInfoType, 0, *(array + 0), *(array + 1), *(array + 2), 
*(array + 3));
 }
 #else
-void getCpuId(uint32_t array[4], uint32_t nInfoType)
+void getCpuId(uint32_t array[4], uint32_t /*nInfoType*/)
 {
array[0] = array[1] =  array[2] = array[3] = 0;
 }
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

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

2019-07-08 Thread Mike Kaganski (via logerrit)
 ucb/source/ucp/webdav-neon/NeonLockStore.cxx |7 ++-
 1 file changed, 2 insertions(+), 5 deletions(-)

New commits:
commit e22adfad195c22e98a47fd09c439ec96da247488
Author: Mike Kaganski 
AuthorDate: Tue Jul 9 00:01:02 2019 +0200
Commit: Mike Kaganski 
CommitDate: Tue Jul 9 01:14:24 2019 +0200

Use constexpr ctor to simplify TimeValue initialization

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

diff --git a/ucb/source/ucp/webdav-neon/NeonLockStore.cxx 
b/ucb/source/ucp/webdav-neon/NeonLockStore.cxx
index 8ac218915a4d..a4d25b4b1e31 100644
--- a/ucb/source/ucp/webdav-neon/NeonLockStore.cxx
+++ b/ucb/source/ucp/webdav-neon/NeonLockStore.cxx
@@ -72,16 +72,13 @@ void TickerThread::execute()
 int nCount = nNth;
 while ( !m_bFinish )
 {
-if ( nCount-- <= 0 )
+if (--nCount < 0)
 {
 m_rLockStore.refreshLocks();
 nCount = nNth;
 }
 
-TimeValue aTV;
-aTV.Seconds = 0;
-aTV.Nanosec = 10 / nNth;
-salhelper::Thread::wait( aTV );
+salhelper::Thread::wait(TimeValue(0, 10 / nNth));
 }
 
 SAL_INFO( "ucb.ucp.webdav", "TickerThread: stop." );
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-6.2' - sc/source sd/source sw/source

2019-07-09 Thread Mike Kaganski (via logerrit)
 sc/source/ui/view/tabvwsh2.cxx   |9 -
 sd/source/ui/view/drviewse.cxx   |8 +++-
 sw/source/uibase/uiview/viewdraw.cxx |8 +++-
 3 files changed, 22 insertions(+), 3 deletions(-)

New commits:
commit 94c82ded1944f8cfe333e5058e05acd70faa0d8f
Author: Mike Kaganski 
AuthorDate: Thu Nov 22 12:12:07 2018 +0100
Commit: Andras Timar 
CommitDate: Tue Jul 9 11:42:14 2019 +0200

lok: Insert shapes directly into the document.

Change-Id: I182aa395ce0f4e4185c9c85a866dec89499842f9
Reviewed-on: https://gerrit.libreoffice.org/74240
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Andras Timar 

diff --git a/sc/source/ui/view/tabvwsh2.cxx b/sc/source/ui/view/tabvwsh2.cxx
index ea962224f9a8..531aa9052f9c 100644
--- a/sc/source/ui/view/tabvwsh2.cxx
+++ b/sc/source/ui/view/tabvwsh2.cxx
@@ -17,6 +17,7 @@
  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
  */
 
+#include 
 #include 
 #include 
 #include 
@@ -210,6 +211,9 @@ void ScTabViewShell::ExecDraw(SfxRequest& rReq)
 
 assert(nNewId != SID_DRAW_CHART); //#i71254# handled already above
 
+// for LibreOfficeKit - choosing a shape should construct it directly
+bool bCreateDirectly = false;
+
 switch (nNewId)
 {
 case SID_OBJECT_SELECT:
@@ -279,6 +283,9 @@ void ScTabViewShell::ExecDraw(SfxRequest& rReq)
 case SID_DRAW_CS_ID :
 {
 pTabView->SetDrawFuncPtr(new FuConstCustomShape(*this, pWin, 
pView, pDoc, aNewReq));
+
+bCreateDirectly = comphelper::LibreOfficeKit::isActive();
+
 if ( nNewId != SID_DRAW_CS_ID )
 {
 const SfxStringItem* pEnumCommand = 
rReq.GetArg(nNewId);
@@ -309,7 +316,7 @@ void ScTabViewShell::ExecDraw(SfxRequest& rReq)
 // with qualifier construct directly
 FuPoor* pFuActual = GetDrawFuncPtr();
 
-if(pFuActual && (rReq.GetModifier() & KEY_MOD1))
+if(pFuActual && ((rReq.GetModifier() & KEY_MOD1) || bCreateDirectly))
 {
 // Create default drawing objects via keyboard
 const ScAppOptions& rAppOpt = SC_MOD()->GetAppOptions();
diff --git a/sd/source/ui/view/drviewse.cxx b/sd/source/ui/view/drviewse.cxx
index 4645d63f6212..0d89b22eb3bd 100644
--- a/sd/source/ui/view/drviewse.cxx
+++ b/sd/source/ui/view/drviewse.cxx
@@ -27,6 +27,7 @@
 #include 
 #include 
 
+#include 
 #include 
 #include 
 #include 
@@ -227,6 +228,9 @@ void DrawViewShell::FuPermanent(SfxRequest& rReq)
 rBind.Update(nOldSId);
 }
 
+// for LibreOfficeKit - choosing a shape should construct it directly
+bool bCreateDirectly = false;
+
 switch ( nSId )
 {
 case SID_TEXTEDIT:  // BASIC ???
@@ -521,6 +525,8 @@ void DrawViewShell::FuPermanent(SfxRequest& rReq)
 SetCurrentFunction( FuConstructCustomShape::Create( this, 
GetActiveWindow(), mpDrawView.get(), GetDoc(), rReq, bPermanent ) );
 rReq.Done();
 
+bCreateDirectly = comphelper::LibreOfficeKit::isActive();
+
 if ( nSId != SID_DRAW_CS_ID )
 {
 SfxBindings& rBind = GetViewFrame()->GetBindings();
@@ -598,7 +604,7 @@ void DrawViewShell::FuPermanent(SfxRequest& rReq)
 }
 
 // with qualifier construct directly
-if(HasCurrentFunction() && (rReq.GetModifier() & KEY_MOD1))
+if(HasCurrentFunction() && ((rReq.GetModifier() & KEY_MOD1) || 
bCreateDirectly))
 {
 // get SdOptions
 SdOptions* pOptions = 
SD_MOD()->GetSdOptions(GetDoc()->GetDocumentType());
diff --git a/sw/source/uibase/uiview/viewdraw.cxx 
b/sw/source/uibase/uiview/viewdraw.cxx
index 5a836876255b..8420e9f3a9f5 100644
--- a/sw/source/uibase/uiview/viewdraw.cxx
+++ b/sw/source/uibase/uiview/viewdraw.cxx
@@ -229,6 +229,9 @@ void SwView::ExecDraw(SfxRequest& rReq)
 
 std::unique_ptr pFuncPtr;
 
+// for LibreOfficeKit - choosing a shape should construct it directly
+bool bCreateDirectly = false;
+
 switch (nSlotId)
 {
 case SID_OBJECT_SELECT:
@@ -300,6 +303,9 @@ void SwView::ExecDraw(SfxRequest& rReq)
 case SID_DRAW_CS_ID :
 {
 pFuncPtr.reset( new ConstCustomShape(m_pWrtShell.get(), 
m_pEditWin, this, rReq ) );
+
+bCreateDirectly = comphelper::LibreOfficeKit::isActive();
+
 m_nDrawSfxId = nSlotId;
 if ( nSlotId != SID_DRAW_CS_ID )
 {
@@ -334,7 +340,7 @@ void SwView::ExecDraw(SfxRequest& rReq)
 
 pTempFuncPtr->Activate(nSlotId);
 NoRotate();
-if(rReq.GetModifier() == KEY_MOD1)
+if(rReq.GetModifier() == KEY_MOD1 || bCreateDirectly)
 {
 if(SID_OBJECT_SELECT == m_nDrawSfxId )
 {
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-6.2' - include/svtools svtools/source

2019-07-09 Thread Mike Kaganski (via logerrit)
 include/svtools/valueset.hxx|8 -
 svtools/source/control/valueset.cxx |  162 ++--
 2 files changed, 49 insertions(+), 121 deletions(-)

New commits:
commit 02b18afcfc75bdc714ad4569be41ad14fb2f1392
Author: Mike Kaganski 
AuthorDate: Thu Nov 22 15:20:16 2018 +0300
Commit: Andras Timar 
CommitDate: Tue Jul 9 11:40:27 2019 +0200

Get rid of ValueSet's internal VirtualDevice, draw to RenderContext

This improves support for Online HiDPI scenarios.

Change-Id: I1d4d13d8877b761cabaefa028dcd50d8345d9893
Reviewed-on: https://gerrit.libreoffice.org/74241
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Andras Timar 

diff --git a/include/svtools/valueset.hxx b/include/svtools/valueset.hxx
index b085a3e9e314..dacdd25eb5eb 100644
--- a/include/svtools/valueset.hxx
+++ b/include/svtools/valueset.hxx
@@ -197,8 +197,6 @@ typedef std::vector> 
SvtValueItemList;
 class SVT_DLLPUBLIC ValueSet : public Control
 {
 private:
-
-ScopedVclPtr maVirDev;
 Timer   maTimer;
 ValueItemList   mItemList;
 std::unique_ptr mpNoneItem;
@@ -248,11 +246,10 @@ private:
 
 SVT_DLLPRIVATE void ImplInitScrollBar();
 SVT_DLLPRIVATE void ImplDeleteItems();
-SVT_DLLPRIVATE void ImplFormatItem(vcl::RenderContext const & 
rRenderContext, ValueSetItem* pItem, tools::Rectangle aRect);
+SVT_DLLPRIVATE void ImplFormatItem(vcl::RenderContext& 
rRenderContext, ValueSetItem* pItem, tools::Rectangle aRect);
 SVT_DLLPRIVATE void ImplDrawItemText(vcl::RenderContext& 
rRenderContext, const OUString& rStr);
 SVT_DLLPRIVATE void ImplDrawSelect(vcl::RenderContext& 
rRenderContext, sal_uInt16 nItemId, const bool bFocus, const bool bDrawSel);
 SVT_DLLPRIVATE void ImplDrawSelect(vcl::RenderContext& 
rRenderContext);
-SVT_DLLPRIVATE void ImplHideSelect(sal_uInt16 nItemId);
 SVT_DLLPRIVATE void ImplHighlightItem(sal_uInt16 nItemId, bool 
bIsSelection = true);
 SVT_DLLPRIVATE void ImplDraw(vcl::RenderContext& rRenderContext);
 using Window::ImplScroll;
@@ -273,6 +270,8 @@ private:
 ValueSet (const ValueSet &) = delete;
 ValueSet & operator= (const ValueSet &) = delete;
 
+SVT_DLLPRIVATE void Format(vcl::RenderContext& rRenderContext);
+
 protected:
 void StartDrag( const CommandEvent& rCEvt, vcl::Region& rRegion );
 
@@ -372,7 +371,6 @@ public:
 
 voidSetExtraSpacing( sal_uInt16 nNewSpacing );
 
-voidFormat(vcl::RenderContext const & rRenderContext);
 voidSetFormat();
 
 voidStartSelection();
diff --git a/svtools/source/control/valueset.cxx 
b/svtools/source/control/valueset.cxx
index ad6101bb6cae..0ccb65e01917 100644
--- a/svtools/source/control/valueset.cxx
+++ b/svtools/source/control/valueset.cxx
@@ -59,7 +59,6 @@ enum
 
 ValueSet::ValueSet( vcl::Window* pParent, WinBits nWinStyle ) :
 Control( pParent, nWinStyle ),
-maVirDev( VclPtr::Create(*this) ),
 maColor( COL_TRANSPARENT )
 {
 mpNoneItem.reset(nullptr);
@@ -93,9 +92,6 @@ ValueSet::ValueSet( vcl::Window* pParent, WinBits nWinStyle ) 
:
 mbEdgeBlending  = false;
 mbHasVisibleItems   = false;
 
-// #106446#, #106601# force mirroring of virtual device
-maVirDev->EnableRTL( GetParent()->IsRTLEnabled() );
-
 ImplInitSettings( true, true, true );
 }
 
@@ -203,7 +199,7 @@ void ValueSet::ImplInitScrollBar()
 }
 }
 
-void ValueSet::ImplFormatItem(vcl::RenderContext const & rRenderContext, 
ValueSetItem* pItem, tools::Rectangle aRect)
+void ValueSet::ImplFormatItem(vcl::RenderContext& rRenderContext, 
ValueSetItem* pItem, tools::Rectangle aRect)
 {
 WinBits nStyle = GetStyle();
 if (nStyle & WB_ITEMBORDER)
@@ -224,7 +220,7 @@ void ValueSet::ImplFormatItem(vcl::RenderContext const & 
rRenderContext, ValueSe
 }
 else
 {
-DecorationView aView(maVirDev.get());
+DecorationView aView();
 aRect = aView.DrawFrame(aRect, mnFrameStyle);
 }
 }
@@ -239,42 +235,45 @@ void ValueSet::ImplFormatItem(vcl::RenderContext const & 
rRenderContext, ValueSe
 
 if (pItem == mpNoneItem.get())
 {
-maVirDev->SetFont(rRenderContext.GetFont());
-maVirDev->SetTextColor((nStyle & WB_MENUSTYLEVALUESET) ? 
rStyleSettings.GetMenuTextColor() : rStyleSettings.GetWindowTextColor());
-maVirDev->SetTextFillColor();
-maVirDev->SetFillColor((nStyle & WB_MENUSTYLEVALUESET) ? 
rStyleSettings.GetMenuColor() : rStyleSettings.GetWindowColor());
-maVirDev->DrawRect(aRect);
+rRenderContext.SetTextColor((nStyle & WB_MENUSTYLEVALUESET)
+? rStyleSettings.GetMenuTextColor()
+: rStyleSettings.GetWindowTextColor());
+rRenderContext.SetTextFillColor();
+rRenderContext.SetFillColor((nStyle & 

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

2019-07-09 Thread Mike Kaganski (via logerrit)
 oox/source/drawingml/shape.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit d4b687a503159c8c1385db9d7fbff5c92ace6900
Author: Mike Kaganski 
AuthorDate: Tue Jul 9 13:33:13 2019 +0200
Commit: Mike Kaganski 
CommitDate: Tue Jul 9 15:25:57 2019 +0200

mxShape.is() is always true here

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

diff --git a/oox/source/drawingml/shape.cxx b/oox/source/drawingml/shape.cxx
index 88ed816c21c0..7be3aa837657 100644
--- a/oox/source/drawingml/shape.cxx
+++ b/oox/source/drawingml/shape.cxx
@@ -887,7 +887,7 @@ Reference< XShape > const & Shape::createAndInsert(
 mxShape.set( xServiceFact->createInstance( aServiceName ), 
UNO_QUERY_THROW );
 
 Reference< XPropertySet > xSet( mxShape, UNO_QUERY );
-if( mxShape.is() && xSet.is() )
+if (xSet.is())
 {
 if( !msName.isEmpty() )
 {
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-6.0' - include/sfx2 sfx2/source

2019-07-09 Thread Mike Kaganski (via logerrit)
 include/sfx2/docfile.hxx |3 +
 include/sfx2/strings.hrc |3 +
 sfx2/source/doc/docfile.cxx  |   73 ++-
 sfx2/source/view/viewfrm.cxx |   41 
 4 files changed, 84 insertions(+), 36 deletions(-)

New commits:
commit 45bb41b169844ed913b42833a1c130c2d92678ec
Author: Mike Kaganski 
AuthorDate: Fri Jul 5 17:56:38 2019 +1000
Commit: Mike Kaganski 
CommitDate: Tue Jul 9 07:59:20 2019 +0200

Show who has locked the document when reopening a read-only document

Pass the locking data from SfxMedium::LockOrigFileOnDemand, to allow
clients to show it themselves when required.

Change-Id: I6afe46a1896e1b60771c080efa2f58794dbed8a6
Reviewed-on: https://gerrit.libreoffice.org/75113
Tested-by: Jenkins
Reviewed-by: Mike Kaganski 
Reviewed-on: https://gerrit.libreoffice.org/75137
Tested-by: Mike Kaganski 
Reviewed-on: https://gerrit.libreoffice.org/75285
Tested-by: Jenkins CollaboraOffice 

diff --git a/include/sfx2/docfile.hxx b/include/sfx2/docfile.hxx
index eae58edf0823..5e53c412763b 100644
--- a/include/sfx2/docfile.hxx
+++ b/include/sfx2/docfile.hxx
@@ -169,7 +169,8 @@ public:
 FailedLockFile, // there was only lock file that prevented success - 
no syslock or IO error
 Succeeded,
 };
-LockFileResult  LockOrigFileOnDemand( bool bLoading, bool bNoUI, bool 
bTryIgnoreLockFile = false );
+LockFileResult LockOrigFileOnDemand(bool bLoading, bool bNoUI, bool 
bTryIgnoreLockFile = false,
+LockFileEntry* pLockData = nullptr);
 voidDisableUnlockWebDAV( bool bDisableUnlockWebDAV = true 
);
 voidUnlockFile( bool bReleaseLockStream );
 /// Lets Transfer_Impl() not fsync the output file.
diff --git a/include/sfx2/strings.hrc b/include/sfx2/strings.hrc
index 597afd21836f..7508ce813e0f 100644
--- a/include/sfx2/strings.hrc
+++ b/include/sfx2/strings.hrc
@@ -239,7 +239,8 @@
 #define STR_ERROR_SEND_MAIL_CODE
NC_("STR_ERROR_SEND_MAIL_CODE", "An error occurred in sending the message. 
Possible errors could be a missing user account or a defective setup.\n\nError 
code is $1")
 #define STR_ERROR_SEND_MAIL_HEADER  
NC_("STR_ERROR_SEND_MAIL_HEADER", "Error sending mail")
 #define STR_QUERY_OPENASTEMPLATE
NC_("STR_QUERY_OPENASTEMPLATE", "This document cannot be edited, possibly due 
to missing access rights. Do you want to edit a copy of the document?")
-#define STR_QUERY_OPENASTEMPLATE_ALLOW_IGNORE   
NC_("STR_QUERY_OPENASTEMPLATE_ALLOW_IGNORE", "This document cannot be edited, 
because it is locked in another session. Do you want to edit a copy of the 
document?\n\nYou can also try to ignore the lock and open the file for 
editing.")
+#define STR_QUERY_OPENASTEMPLATE_LOCKED 
NC_("STR_QUERY_OPENASTEMPLATE_LOCKED", "This document cannot be edited, because 
it is locked in another session.%LOCKINFO\nDo you want to edit a copy of the 
document?")
+#define STR_QUERY_OPENASTEMPLATE_ALLOW_IGNORE   
NC_("STR_QUERY_OPENASTEMPLATE_ALLOW_IGNORE", "You can also try to ignore the 
lock and open the file for editing.")
 #define STR_QUERY_OPENASTEMPLATE_OPENCOPY_BTN   
NC_("STR_QUERY_OPENASTEMPLATE_OPENCOPY_BTN", "Open ~Copy")
 #define STR_QUERY_OPENASTEMPLATE_OPEN_BTN   
NC_("STR_QUERY_OPENASTEMPLATE_OPEN_BTN", "~Open")
 #define STR_REPAIREDDOCUMENTNC_("STR_REPAIREDDOCUMENT", " 
(repaired document)")
diff --git a/sfx2/source/doc/docfile.cxx b/sfx2/source/doc/docfile.cxx
index ed96ed98395b..012481c849fd 100644
--- a/sfx2/source/doc/docfile.cxx
+++ b/sfx2/source/doc/docfile.cxx
@@ -1063,7 +1063,9 @@ namespace
 
 // sets SID_DOC_READONLY if the document cannot be opened for editing
 // if user cancel the loading the ERROR_ABORT is set
-SfxMedium::LockFileResult SfxMedium::LockOrigFileOnDemand( bool bLoading, bool 
bNoUI, bool bTryIgnoreLockFile )
+SfxMedium::LockFileResult SfxMedium::LockOrigFileOnDemand(bool bLoading, bool 
bNoUI,
+  bool 
bTryIgnoreLockFile,
+  LockFileEntry* 
pLockData)
 {
 #if !HAVE_FEATURE_MULTIUSER_ENVIRONMENT
 (void) bLoading;
@@ -1114,37 +1116,47 @@ SfxMedium::LockFileResult 
SfxMedium::LockOrigFileOnDemand( bool bLoading, bool b
 catch ( ucb::InteractiveLockingLockedException& )
 {
 // received when the resource is already locked
-// get the lock owner, using a special ucb.webdav 
property
-// the owner property retrieved here is  what the 
other principal send the server
-// when activating the lock.
-// See 
http://tools.ietf.org/html/rfc4918#section-14.17 for details
-

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

2019-07-08 Thread Mike Kaganski (via logerrit)
 ucb/source/ucp/webdav-neon/NeonLockStore.cxx |   13 -
 ucb/source/ucp/webdav-neon/NeonLockStore.hxx |2 ++
 ucb/source/ucp/webdav-neon/NeonSession.cxx   |1 +
 3 files changed, 15 insertions(+), 1 deletion(-)

New commits:
commit 94e4695bcfcb9356d37942c47359b94531ef7b95
Author: Mike Kaganski 
AuthorDate: Mon Jul 8 23:47:12 2019 +1000
Commit: Mike Kaganski 
CommitDate: Mon Jul 8 23:56:50 2019 +0200

tdf#126279 related: remove locks from NeonLockStore after NE_AUTH error

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

diff --git a/ucb/source/ucp/webdav-neon/NeonLockStore.cxx 
b/ucb/source/ucp/webdav-neon/NeonLockStore.cxx
index 13b24f7b665d..8ac218915a4d 100644
--- a/ucb/source/ucp/webdav-neon/NeonLockStore.cxx
+++ b/ucb/source/ucp/webdav-neon/NeonLockStore.cxx
@@ -151,7 +151,7 @@ void NeonLockStore::stopTicker(osl::ClearableMutexGuard & 
rGuard)
 
 rGuard.clear();
 
-if (pTickerThread.is())
+if (pTickerThread.is() && pTickerThread->getIdentifier() != 
osl::Thread::getCurrentIdentifier())
 pTickerThread->join(); // without m_aMutex locked (to prevent deadlock)
 }
 
@@ -196,6 +196,13 @@ void NeonLockStore::removeLock( NeonLock * pLock )
 stopTicker(aGuard);
 }
 
+void NeonLockStore::removeLockDeferred(NeonLock* pLock)
+{
+osl::MutexGuard aGuard(m_aMutex);
+
+m_aRemoveDeferred.push_back(pLock);
+}
+
 void NeonLockStore::refreshLocks()
 {
 osl::MutexGuard aGuard( m_aMutex );
@@ -228,6 +235,10 @@ void NeonLockStore::refreshLocks()
 }
 }
 }
+// removeLock will not need to actually release the lock, because this is 
run from TickerThread
+for (auto pLock : m_aRemoveDeferred)
+removeLock(pLock);
+m_aRemoveDeferred.clear();
 }
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/ucb/source/ucp/webdav-neon/NeonLockStore.hxx 
b/ucb/source/ucp/webdav-neon/NeonLockStore.hxx
index 0cee2063fd31..86fccb68a50f 100644
--- a/ucb/source/ucp/webdav-neon/NeonLockStore.hxx
+++ b/ucb/source/ucp/webdav-neon/NeonLockStore.hxx
@@ -66,6 +66,7 @@ class NeonLockStore
 ne_lock_store * const m_pNeonLockStore;
 rtl::Reference< TickerThread > m_pTickerThread;
 LockInfoMapm_aLockInfoMap;
+std::vector m_aRemoveDeferred;
 
 public:
 NeonLockStore();
@@ -82,6 +83,7 @@ public:
   sal_Int32 nLastChanceToSendRefreshRequest );
 
 void removeLock( NeonLock * pLock );
+void removeLockDeferred(NeonLock* pLock);
 
 void refreshLocks();
 
diff --git a/ucb/source/ucp/webdav-neon/NeonSession.cxx 
b/ucb/source/ucp/webdav-neon/NeonSession.cxx
index cd8b31f9d359..ed0d43723d05 100644
--- a/ucb/source/ucp/webdav-neon/NeonSession.cxx
+++ b/ucb/source/ucp/webdav-neon/NeonSession.cxx
@@ -1679,6 +1679,7 @@ bool NeonSession::LOCK( NeonLock * pLock,
 {
 // tdf#126279: see handling of NE_AUTH in HandleError
 m_bNeedNewSession = true;
+m_aNeonLockStore.removeLockDeferred(pLock);
 }
 return false;
 }
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-6.0' - sfx2/source

2019-07-15 Thread Mike Kaganski (via logerrit)
 sfx2/source/view/viewfrm.cxx |   11 +++
 1 file changed, 11 insertions(+)

New commits:
commit a148813cec0c4da58686cac199a2de7d9b543b06
Author: Mike Kaganski 
AuthorDate: Thu Jul 11 22:24:41 2019 +1000
Commit: Miklos Vajna 
CommitDate: Mon Jul 15 09:06:17 2019 +0200

Restore original value of SID_DOC_READONLY item on cancel or SID_EDITDOC

Otherwise, SfxObjectShell::DoSaveCompleted later calls
SfxMedium::LockOrigFileOnDemand, which sets error state for the medium
reopened in read-only mode, as if it were opened in read-write mode.

Change-Id: Ib2df62470878ea609552ccc76df84a3fdde30646
Reviewed-on: https://gerrit.libreoffice.org/75413
Tested-by: Jenkins
Reviewed-by: Mike Kaganski 
(cherry picked from commit df9adfc95429bdaf085e9927ec5b326cee6b7a2a)
Reviewed-on: https://gerrit.libreoffice.org/75493
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Miklos Vajna 

diff --git a/sfx2/source/view/viewfrm.cxx b/sfx2/source/view/viewfrm.cxx
index 0d9b905e2382..d814ed43e5a0 100644
--- a/sfx2/source/view/viewfrm.cxx
+++ b/sfx2/source/view/viewfrm.cxx
@@ -469,6 +469,13 @@ void SfxViewFrame::ExecReload_Impl( SfxRequest& rReq )
 bool bOK = false;
 bool bRetryIgnoringLock = false;
 bool bOpenTemplate = false;
+boost::optional aOrigROVal;
+if (!pVersionItem)
+{
+auto pRO = 
pMed->GetItemSet()->GetItem(SID_DOC_READONLY, false);
+if (pRO)
+aOrigROVal = pRO->GetValue();
+}
 do {
 LockFileEntry aLockData;
 if ( !pVersionItem )
@@ -533,6 +540,10 @@ void SfxViewFrame::ExecReload_Impl( SfxRequest& rReq )
 {
 pMed->ResetError();
 pMed->SetOpenMode( SFX_STREAM_READONLY );
+if (aOrigROVal)
+
pMed->GetItemSet()->Put(SfxBoolItem(SID_DOC_READONLY, *aOrigROVal));
+else
+pMed->GetItemSet()->ClearItem(SID_DOC_READONLY);
 pMed->ReOpen();
 pSh->DoSaveCompleted( pMed );
 }
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-6.2' - sfx2/source

2019-07-15 Thread Mike Kaganski (via logerrit)
 sfx2/source/view/viewfrm.cxx |   11 +++
 1 file changed, 11 insertions(+)

New commits:
commit 46e06cb2e13236f38e0428fc7226c7e1a25bd355
Author: Mike Kaganski 
AuthorDate: Thu Jul 11 22:24:41 2019 +1000
Commit: Mike Kaganski 
CommitDate: Mon Jul 15 10:17:22 2019 +0200

Restore original value of SID_DOC_READONLY item on cancel or SID_EDITDOC

Otherwise, SfxObjectShell::DoSaveCompleted later calls
SfxMedium::LockOrigFileOnDemand, which sets error state for the medium
reopened in read-only mode, as if it were opened in read-write mode.

Change-Id: Ib2df62470878ea609552ccc76df84a3fdde30646
Reviewed-on: https://gerrit.libreoffice.org/75413
Tested-by: Jenkins
Reviewed-by: Mike Kaganski 
(cherry picked from commit df9adfc95429bdaf085e9927ec5b326cee6b7a2a)
Reviewed-on: https://gerrit.libreoffice.org/75492
Tested-by: Jenkins CollaboraOffice 

diff --git a/sfx2/source/view/viewfrm.cxx b/sfx2/source/view/viewfrm.cxx
index 42a4fa7ec3c7..7aeac3d8f066 100644
--- a/sfx2/source/view/viewfrm.cxx
+++ b/sfx2/source/view/viewfrm.cxx
@@ -459,6 +459,13 @@ void SfxViewFrame::ExecReload_Impl( SfxRequest& rReq )
 bool bOK = false;
 bool bRetryIgnoringLock = false;
 bool bOpenTemplate = false;
+boost::optional aOrigROVal;
+if (!pVersionItem)
+{
+auto pRO = 
pMed->GetItemSet()->GetItem(SID_DOC_READONLY, false);
+if (pRO)
+aOrigROVal = pRO->GetValue();
+}
 do {
 LockFileEntry aLockData;
 if ( !pVersionItem )
@@ -523,6 +530,10 @@ void SfxViewFrame::ExecReload_Impl( SfxRequest& rReq )
 {
 pMed->ResetError();
 pMed->SetOpenMode( SFX_STREAM_READONLY );
+if (aOrigROVal)
+
pMed->GetItemSet()->Put(SfxBoolItem(SID_DOC_READONLY, *aOrigROVal));
+else
+pMed->GetItemSet()->ClearItem(SID_DOC_READONLY);
 pMed->ReOpen();
 pSh->DoSaveCompleted( pMed );
 }
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-6.2' - ucb/source

2019-07-15 Thread Mike Kaganski (via logerrit)
 ucb/source/ucp/webdav-neon/NeonSession.cxx |   16 ++--
 1 file changed, 14 insertions(+), 2 deletions(-)

New commits:
commit 83d04630305f85cd72b1ec32951d8eaa47ecd4cb
Author: Mike Kaganski 
AuthorDate: Mon Jul 8 16:25:16 2019 +1000
Commit: Mike Kaganski 
CommitDate: Mon Jul 15 10:13:04 2019 +0200

tdf#126279: reinitialize session after NE_AUTH errors in (UN)LOCK

This just fixes the crash; but there's still a problem left/TODO, because
the lock is kept registered with NeonLockStore; following attempts to lock
and unlock fail.

The NE_AUTH error is returned from this call stack:

neon.dll!clean_session(auth_session * sess) Line 275
at 
C:\cygwin\home\user\lode\dev\core\workdir\UnpackedTarball\neon\src\ne_auth.c(275)
neon.dll!ah_post_send(ne_request_s * req, void * cookie, const ne_status * 
status) Line 1554
at 
C:\cygwin\home\user\lode\dev\core\workdir\UnpackedTarball\neon\src\ne_auth.c(1554)
neon.dll!ne_end_request(ne_request_s * req) Line 1399
at 
C:\cygwin\home\user\lode\dev\core\workdir\UnpackedTarball\neon\src\ne_request.c(1399)
neon.dll!ne_xml_dispatch_request(ne_request_s * req, ne_xml_parser_s * 
parser) Line 105
at 
C:\cygwin\home\user\lode\dev\core\workdir\UnpackedTarball\neon\src\ne_xmlreq.c(105)
neon.dll!ne_lock_refresh(ne_session_s * sess, ne_lock * lock) Line 849
at 
C:\cygwin\home\user\lode\dev\core\workdir\UnpackedTarball\neon\src\ne_locks.c(849)
ucpdav1.dll!webdav_ucp::NeonSession::LOCK(ne_lock * pLock, long & 
rlastChanceToSendRefreshRequest) Line 1663
at 
C:\cygwin\home\user\lode\dev\core\ucb\source\ucp\webdav-neon\NeonSession.cxx(1663)
ucpdav1.dll!webdav_ucp::NeonLockStore::refreshLocks() Line 216
at 
C:\cygwin\home\user\lode\dev\core\ucb\source\ucp\webdav-neon\NeonLockStore.cxx(216)
ucpdav1.dll!webdav_ucp::TickerThread::execute() Line 78
at 
C:\cygwin\home\user\lode\dev\core\ucb\source\ucp\webdav-neon\NeonLockStore.cxx(78)
salhelper3MSC.dll!salhelper::Thread::run() Line 40
at C:\cygwin\home\user\lode\dev\core\salhelper\source\thread.cxx(40)
salhelper3MSC.dll!threadFunc(void * param) Line 186
at C:\cygwin\home\user\lode\dev\core\include\osl\thread.hxx(186)
sal3.dll!oslWorkerWrapperFunction(void * pData) Line 58
at C:\cygwin\home\user\lode\dev\core\sal\osl\w32\thread.cxx(58)
ucrtbased.dll!thread_start(void * const 
parameter) Line 97
at minkernel\crts\ucrt\src\appcrt\startup\thread.cpp(97)
kernel32.dll!BaseThreadInitThunk()
ntdll.dll!RtlUserThreadStart()

If not reinitialized, then on next access, it SEGFAULTs (hostname is 
nullptr):

neon.dll!ne_addr_resolve(const char * hostname, int flags) Line 926
at 
C:\cygwin\home\user\lode\dev\core\workdir\UnpackedTarball\neon\src\ne_socket.c(926)
neon.dll!canonical_hostname(const char * serverName) Line 382
at 
C:\cygwin\home\user\lode\dev\core\workdir\UnpackedTarball\neon\src\ne_sspi.c(382)
neon.dll!ne_sspi_create_context(void * * context, char * serverName, int 
ntlm) Line 423
at 
C:\cygwin\home\user\lode\dev\core\workdir\UnpackedTarball\neon\src\ne_sspi.c(423)
neon.dll!continue_sspi(auth_session * sess, int ntlm, const char * hdr, int 
attempt, auth_challenge * parms, ne_buffer * * errmsg) Line 639
at 
C:\cygwin\home\user\lode\dev\core\workdir\UnpackedTarball\neon\src\ne_auth.c(639)
neon.dll!sspi_challenge(auth_session * sess, int attempt, auth_challenge * 
parms, ne_buffer * * errmsg) Line 675
at 
C:\cygwin\home\user\lode\dev\core\workdir\UnpackedTarball\neon\src\ne_auth.c(675)
neon.dll!auth_challenge(auth_session * sess, int attempt, const char * 
value) Line 1419
at 
C:\cygwin\home\user\lode\dev\core\workdir\UnpackedTarball\neon\src\ne_auth.c(1419)
neon.dll!ah_post_send(ne_request_s * req, void * cookie, const ne_status * 
status) Line 1550
at 
C:\cygwin\home\user\lode\dev\core\workdir\UnpackedTarball\neon\src\ne_auth.c(1550)
neon.dll!ne_end_request(ne_request_s * req) Line 1399
at 
C:\cygwin\home\user\lode\dev\core\workdir\UnpackedTarball\neon\src\ne_request.c(1399)
neon.dll!ne_request_dispatch(ne_request_s * req) Line 1458
at 
C:\cygwin\home\user\lode\dev\core\workdir\UnpackedTarball\neon\src\ne_request.c(1458)
ucpdav1.dll!webdav_ucp::NeonSession::OPTIONS(const rtl::OUString & inPath, 
webdav_ucp::DAVOptions & rOptions, const webdav_ucp::DAVRequestEnvironment & 
rEnv) Line 913
at 
C:\cygwin\home\user\lode\dev\core\ucb\source\ucp\webdav-neon\NeonSession.cxx(913)
ucpdav1.dll!webdav_ucp::DAVResourceAccess::OPTIONS(webdav_ucp::DAVOptions & 
rOptions, const 
com::sun::star::uno::Reference & 
xEnv) Line 187
at 
C:\cygwin\home\user\lode\dev\core\ucb\source\ucp\webdav-neon\DAVResourceAccess.cxx(187)

[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-6.2' - ucb/source

2019-07-15 Thread Mike Kaganski (via logerrit)
 ucb/source/ucp/webdav-neon/NeonLockStore.cxx |   13 -
 ucb/source/ucp/webdav-neon/NeonLockStore.hxx |2 ++
 ucb/source/ucp/webdav-neon/NeonSession.cxx   |1 +
 3 files changed, 15 insertions(+), 1 deletion(-)

New commits:
commit 716dff2767aad7060fc1b48377cdfeedd9487428
Author: Mike Kaganski 
AuthorDate: Mon Jul 8 23:47:12 2019 +1000
Commit: Mike Kaganski 
CommitDate: Mon Jul 15 10:57:51 2019 +0200

tdf#126279 related: remove locks from NeonLockStore after NE_AUTH error

Change-Id: Idbbb9bb215e3a56e72a29f798c5a5f84afaf2213
Reviewed-on: https://gerrit.libreoffice.org/75224
Tested-by: Jenkins
Reviewed-by: Mike Kaganski 
(cherry picked from commit 94e4695bcfcb9356d37942c47359b94531ef7b95)
Reviewed-on: https://gerrit.libreoffice.org/75611
Tested-by: Jenkins CollaboraOffice 

diff --git a/ucb/source/ucp/webdav-neon/NeonLockStore.cxx 
b/ucb/source/ucp/webdav-neon/NeonLockStore.cxx
index 4543778fa81a..5e8c469dfedd 100644
--- a/ucb/source/ucp/webdav-neon/NeonLockStore.cxx
+++ b/ucb/source/ucp/webdav-neon/NeonLockStore.cxx
@@ -150,7 +150,7 @@ void NeonLockStore::stopTicker(osl::ClearableMutexGuard & 
rGuard)
 
 rGuard.clear();
 
-if (pTickerThread.is())
+if (pTickerThread.is() && pTickerThread->getIdentifier() != 
osl::Thread::getCurrentIdentifier())
 pTickerThread->join(); // without m_aMutex locked (to prevent deadlock)
 }
 
@@ -195,6 +195,13 @@ void NeonLockStore::removeLock( NeonLock * pLock )
 stopTicker(aGuard);
 }
 
+void NeonLockStore::removeLockDeferred(NeonLock* pLock)
+{
+osl::MutexGuard aGuard(m_aMutex);
+
+m_aRemoveDeferred.push_back(pLock);
+}
+
 void NeonLockStore::refreshLocks()
 {
 osl::MutexGuard aGuard( m_aMutex );
@@ -227,6 +234,10 @@ void NeonLockStore::refreshLocks()
 }
 }
 }
+// removeLock will not need to actually release the lock, because this is 
run from TickerThread
+for (auto pLock : m_aRemoveDeferred)
+removeLock(pLock);
+m_aRemoveDeferred.clear();
 }
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/ucb/source/ucp/webdav-neon/NeonLockStore.hxx 
b/ucb/source/ucp/webdav-neon/NeonLockStore.hxx
index 0cee2063fd31..86fccb68a50f 100644
--- a/ucb/source/ucp/webdav-neon/NeonLockStore.hxx
+++ b/ucb/source/ucp/webdav-neon/NeonLockStore.hxx
@@ -66,6 +66,7 @@ class NeonLockStore
 ne_lock_store * const m_pNeonLockStore;
 rtl::Reference< TickerThread > m_pTickerThread;
 LockInfoMapm_aLockInfoMap;
+std::vector m_aRemoveDeferred;
 
 public:
 NeonLockStore();
@@ -82,6 +83,7 @@ public:
   sal_Int32 nLastChanceToSendRefreshRequest );
 
 void removeLock( NeonLock * pLock );
+void removeLockDeferred(NeonLock* pLock);
 
 void refreshLocks();
 
diff --git a/ucb/source/ucp/webdav-neon/NeonSession.cxx 
b/ucb/source/ucp/webdav-neon/NeonSession.cxx
index 2f989b5ee48a..6b9e88e2f8e2 100644
--- a/ucb/source/ucp/webdav-neon/NeonSession.cxx
+++ b/ucb/source/ucp/webdav-neon/NeonSession.cxx
@@ -1682,6 +1682,7 @@ bool NeonSession::LOCK( NeonLock * pLock,
 {
 // tdf#126279: see handling of NE_AUTH in HandleError
 m_bNeedNewSession = true;
+m_aNeonLockStore.removeLockDeferred(pLock);
 }
 return false;
 }
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-6.0' - sfx2/source

2019-07-15 Thread Mike Kaganski (via logerrit)
 sfx2/source/view/viewfrm.cxx |   15 +--
 1 file changed, 13 insertions(+), 2 deletions(-)

New commits:
commit 68f5e5038147d8537e7046fc67b11157bb3064fe
Author: Mike Kaganski 
AuthorDate: Fri Jul 12 15:46:45 2019 +1000
Commit: Miklos Vajna 
CommitDate: Mon Jul 15 09:07:17 2019 +0200

tdf#126241: make sure to fill input stream before LockOrigFileOnDemand

Otherwise, the function returns early, without providing lock file
information to the caller.

Change-Id: I1740ff0f5a982f7b22f9e3dcdf97631ab6ea6fe0
Reviewed-on: https://gerrit.libreoffice.org/75465
Tested-by: Jenkins
Reviewed-by: Mike Kaganski 
Reviewed-on: https://gerrit.libreoffice.org/75496
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Miklos Vajna 

diff --git a/sfx2/source/view/viewfrm.cxx b/sfx2/source/view/viewfrm.cxx
index d814ed43e5a0..5eeeaddf8a42 100644
--- a/sfx2/source/view/viewfrm.cxx
+++ b/sfx2/source/view/viewfrm.cxx
@@ -493,10 +493,21 @@ void SfxViewFrame::ExecReload_Impl( SfxRequest& rReq )
 }
 
 pMed->CloseAndRelease();
-pMed->GetItemSet()->Put( SfxBoolItem( 
SID_DOC_READONLY, !( nOpenMode & StreamMode::WRITE ) ) );
 pMed->SetOpenMode( nOpenMode );
-
+// We need to clear the SID_DOC_READONLY item from the 
set, to allow
+// MediaDescriptor::impl_openStreamWithURL (called 
indirectly by
+// SfxMedium::CompleteReOpen) to properly fill input 
stream of the
+// descriptor, even when the file can't be open in 
read-write mode.
+// Only then can following call to 
SfxMedium::LockOrigFileOnDemand
+// return proper information about who has locked the 
file, to show
+// in the SfxQueryOpenAsTemplate box below; otherwise 
it exits right
+// after call to SfxMedium::GetMedium_Impl. This 
mimics what happens
+// when the file is opened initially, when filter 
detection code also
+// calls MediaDescriptor::impl_openStreamWithURL 
without the item set.
+pMed->GetItemSet()->ClearItem(SID_DOC_READONLY);
 pMed->CompleteReOpen();
+pMed->GetItemSet()->Put(
+SfxBoolItem(SID_DOC_READONLY, !(nOpenMode & 
StreamMode::WRITE)));
 if ( nOpenMode & StreamMode::WRITE )
 {
 auto eResult = pMed->LockOrigFileOnDemand(
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-6.2' - sfx2/source

2019-07-15 Thread Mike Kaganski (via logerrit)
 sfx2/source/view/viewfrm.cxx |   15 +--
 1 file changed, 13 insertions(+), 2 deletions(-)

New commits:
commit db5c6dbf3da3e99f045c98fcc122a6c0623bfbc4
Author: Mike Kaganski 
AuthorDate: Fri Jul 12 15:46:45 2019 +1000
Commit: Mike Kaganski 
CommitDate: Mon Jul 15 11:30:48 2019 +0200

tdf#126241: make sure to fill input stream before LockOrigFileOnDemand

Otherwise, the function returns early, without providing lock file
information to the caller.

Change-Id: I1740ff0f5a982f7b22f9e3dcdf97631ab6ea6fe0
Reviewed-on: https://gerrit.libreoffice.org/75465
Tested-by: Jenkins
Reviewed-by: Mike Kaganski 
(cherry picked from commit 60dffd80468e5ca4471bc67d02c58c8c784a86f1)
Reviewed-on: https://gerrit.libreoffice.org/75612
Tested-by: Jenkins CollaboraOffice 

diff --git a/sfx2/source/view/viewfrm.cxx b/sfx2/source/view/viewfrm.cxx
index 7aeac3d8f066..ee298b2bc55c 100644
--- a/sfx2/source/view/viewfrm.cxx
+++ b/sfx2/source/view/viewfrm.cxx
@@ -483,10 +483,21 @@ void SfxViewFrame::ExecReload_Impl( SfxRequest& rReq )
 }
 
 pMed->CloseAndRelease();
-pMed->GetItemSet()->Put( SfxBoolItem( 
SID_DOC_READONLY, !( nOpenMode & StreamMode::WRITE ) ) );
 pMed->SetOpenMode( nOpenMode );
-
+// We need to clear the SID_DOC_READONLY item from the 
set, to allow
+// MediaDescriptor::impl_openStreamWithURL (called 
indirectly by
+// SfxMedium::CompleteReOpen) to properly fill input 
stream of the
+// descriptor, even when the file can't be open in 
read-write mode.
+// Only then can following call to 
SfxMedium::LockOrigFileOnDemand
+// return proper information about who has locked the 
file, to show
+// in the SfxQueryOpenAsTemplate box below; otherwise 
it exits right
+// after call to SfxMedium::GetMedium_Impl. This 
mimics what happens
+// when the file is opened initially, when filter 
detection code also
+// calls MediaDescriptor::impl_openStreamWithURL 
without the item set.
+pMed->GetItemSet()->ClearItem(SID_DOC_READONLY);
 pMed->CompleteReOpen();
+pMed->GetItemSet()->Put(
+SfxBoolItem(SID_DOC_READONLY, !(nOpenMode & 
StreamMode::WRITE)));
 if ( nOpenMode & StreamMode::WRITE )
 {
 auto eResult = pMed->LockOrigFileOnDemand(
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

[Libreoffice-commits] core.git: external/gpgmepp xmlsecurity/source

2019-04-21 Thread Mike Kaganski (via logerrit)
 external/gpgmepp/UnpackedTarball_gpgmepp.mk  |1 
 external/gpgmepp/add-gpgme_set_global_flag-wrapper.patch |   27 ++
 xmlsecurity/source/gpg/SecurityEnvironment.cxx   |   38 +++
 3 files changed, 66 insertions(+)

New commits:
commit cca6830288f8d4f541077ead5ee229e02304601d
Author: Mike Kaganski 
AuthorDate: Sat Apr 20 17:36:51 2019 +0300
Commit: Mike Kaganski 
CommitDate: Sun Apr 21 08:17:14 2019 +0200

Properly initialize gpgme-w32spawn.exe path on Windows

On Windows, gpgme expects gpgme-w32spawn.exe to be in the same directory as 
the current
process executable. This assumption might be wrong, e.g., for bundled 
python, which is
in instdir/program/python-core-x.y.z/bin, while gpgme-w32spawn.exe is in 
instdir/program.
In this case, if an operation in a python script requires initializing 
gpgme, it will be
interrupted by a modal warning box telling that gpgme-w32spawn.exe was not 
found.

If we can't find gpgme-w32spawn.exe in the current executable location, 
then try to find
the spawn executable, and inform gpgme about actual location using 
gpgme_set_global_flag.

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

diff --git a/external/gpgmepp/UnpackedTarball_gpgmepp.mk 
b/external/gpgmepp/UnpackedTarball_gpgmepp.mk
index d7472a27a18d..4dfee72890b5 100644
--- a/external/gpgmepp/UnpackedTarball_gpgmepp.mk
+++ b/external/gpgmepp/UnpackedTarball_gpgmepp.mk
@@ -25,6 +25,7 @@ $(eval $(call gb_UnpackedTarball_add_patches,gpgmepp, \
 $(if $(filter MSC,$(COM)),external/gpgmepp/w32-fix-libtool.patch.1) \
 $(if $(filter MSC,$(COM)),external/gpgmepp/w32-add-initializer.patch.1) \
 external/gpgmepp/w32-build-fixes-2.patch \
+external/gpgmepp/add-gpgme_set_global_flag-wrapper.patch \
 $(if $(filter LINUX,$(OS)),external/gpgmepp/asan.patch) \
 $(if $(filter LINUX,$(OS)),external/gpgmepp/rpath.patch) \
 external/gpgmepp/gcc9.patch \
diff --git a/external/gpgmepp/add-gpgme_set_global_flag-wrapper.patch 
b/external/gpgmepp/add-gpgme_set_global_flag-wrapper.patch
new file mode 100644
index ..fade88a3e2b2
--- /dev/null
+++ b/external/gpgmepp/add-gpgme_set_global_flag-wrapper.patch
@@ -0,0 +1,27 @@
+diff -ur lang/cpp/src/context.cpp.old lang/cpp/src/context.cpp
+--- lang/cpp/src/context.cpp.old   2019-04-20 16:03:09.575605300 +0300
 lang/cpp/src/context.cpp   2019-04-20 16:06:43.078419700 +0300
+@@ -1656,6 +1656,11 @@
+ return Error(gpgme_engine_check_version(p));
+ }
+ 
++int GpgME::setGlobalFlag(const char *name, const char *value)
++{
++return gpgme_set_global_flag(name, value);
++}
++
+ static const unsigned long supported_features = 0
+ | GpgME::ValidatingKeylistModeFeature
+ | GpgME::CancelOperationFeature
+diff -ur lang/cpp/src/global.h lang/cpp/src/global.h
+--- lang/cpp/src/global.h.old  2016-09-07 09:48:44.0 +0300
 lang/cpp/src/global.h  2019-04-20 16:06:41.918912600 +0300
+@@ -95,6 +95,8 @@
+ GPGMEPP_EXPORT Error checkEngine(Protocol proto);
+ GPGMEPP_EXPORT Error checkEngine(Engine engine);
+ 
++GPGMEPP_EXPORT int setGlobalFlag(const char *name, const char *value);
++
+ GPGMEPP_EXPORT GIOChannel *getGIOChannel(int fd);
+ GPGMEPP_EXPORT QIODevice   *getQIODevice(int fd);
+ 
diff --git a/xmlsecurity/source/gpg/SecurityEnvironment.cxx 
b/xmlsecurity/source/gpg/SecurityEnvironment.cxx
index 152e8c600019..6ba1bced5cfa 100644
--- a/xmlsecurity/source/gpg/SecurityEnvironment.cxx
+++ b/xmlsecurity/source/gpg/SecurityEnvironment.cxx
@@ -16,6 +16,14 @@
 #include 
 #include 
 
+#ifdef _WIN32
+#include 
+#include 
+#include 
+#include 
+#include 
+#endif
+
 #include 
 #include 
 #include 
@@ -27,6 +35,36 @@ using namespace css::lang;
 
 SecurityEnvironmentGpg::SecurityEnvironmentGpg()
 {
+#ifdef _WIN32
+// On Windows, gpgme expects gpgme-w32spawn.exe to be in the same 
directory as the current
+// process executable. This assumption might be wrong, e.g., for bundled 
python, which is
+// in instdir/program/python-core-x.y.z/bin, while gpgme-w32spawn.exe is 
in instdir/program.
+// If we can't find gpgme-w32spawn.exe in the current executable location, 
then try to find
+// the spawn executable, and inform gpgme about actual location using 
gpgme_set_global_flag.
+static bool bSpawnPathInitialized = [] {
+auto accessUrl = [](const INetURLObject& url) {
+osl::File 
file(url.GetMainURL(INetURLObject::DecodeMechanism::NONE));
+return file.open(osl_File_OpenFlag_Read) == osl::FileBase::E_None;
+};
+OUString sPath;
+osl_getExecutableFile();
+INetURLObject aPathUrl(sPath);
+aPathUrl.setName("gpgme-w32spawn.exe");
+if (!accessUrl(aPathUrl))
+{
+sPath = "$BRAND_BASE_DIR/" LIBO_LIBEXEC_FOLDER 

[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-6.0' - external/gpgmepp xmlsecurity/source

2019-04-21 Thread Mike Kaganski (via logerrit)
 external/gpgmepp/UnpackedTarball_gpgmepp.mk  |1 
 external/gpgmepp/add-gpgme_set_global_flag-wrapper.patch |   27 ++
 xmlsecurity/source/gpg/SecurityEnvironment.cxx   |   38 +++
 3 files changed, 66 insertions(+)

New commits:
commit dbad2c7f57ebc1aac5ef8d80cb15ccfbdbb428cb
Author: Mike Kaganski 
AuthorDate: Sat Apr 20 17:36:51 2019 +0300
Commit: Mike Kaganski 
CommitDate: Sun Apr 21 08:51:15 2019 +0200

Properly initialize gpgme-w32spawn.exe path on Windows

On Windows, gpgme expects gpgme-w32spawn.exe to be in the same directory as 
the current
process executable. This assumption might be wrong, e.g., for bundled 
python, which is
in instdir/program/python-core-x.y.z/bin, while gpgme-w32spawn.exe is in 
instdir/program.
In this case, if an operation in a python script requires initializing 
gpgme, it will be
interrupted by a modal warning box telling that gpgme-w32spawn.exe was not 
found.

If we can't find gpgme-w32spawn.exe in the current executable location, 
then try to find
the spawn executable, and inform gpgme about actual location using 
gpgme_set_global_flag.

Change-Id: Ie30a0d4a767e8c54f1bdc67b67570d6ea47a
Reviewed-on: https://gerrit.libreoffice.org/71014
Tested-by: Jenkins
Reviewed-by: Mike Kaganski 
(cherry picked from commit cca6830288f8d4f541077ead5ee229e02304601d)
Reviewed-on: https://gerrit.libreoffice.org/71036
Tested-by: Mike Kaganski 

diff --git a/external/gpgmepp/UnpackedTarball_gpgmepp.mk 
b/external/gpgmepp/UnpackedTarball_gpgmepp.mk
index 1f7496b9b043..c4e52811af54 100644
--- a/external/gpgmepp/UnpackedTarball_gpgmepp.mk
+++ b/external/gpgmepp/UnpackedTarball_gpgmepp.mk
@@ -23,6 +23,7 @@ $(eval $(call gb_UnpackedTarball_add_patches,gpgmepp, \
 $(if $(filter MSC,$(COM)),external/gpgmepp/w32-fix-libtool.patch.1) \
 $(if $(filter MSC,$(COM)),external/gpgmepp/w32-add-initializer.patch.1) \
 external/gpgmepp/w32-build-fixes-2.patch \
+external/gpgmepp/add-gpgme_set_global_flag-wrapper.patch \
 $(if $(filter LINUX,$(OS)),external/gpgmepp/asan.patch) \
 $(if $(filter LINUX,$(OS)),external/gpgmepp/rpath.patch) \
 ))
diff --git a/external/gpgmepp/add-gpgme_set_global_flag-wrapper.patch 
b/external/gpgmepp/add-gpgme_set_global_flag-wrapper.patch
new file mode 100644
index ..fade88a3e2b2
--- /dev/null
+++ b/external/gpgmepp/add-gpgme_set_global_flag-wrapper.patch
@@ -0,0 +1,27 @@
+diff -ur lang/cpp/src/context.cpp.old lang/cpp/src/context.cpp
+--- lang/cpp/src/context.cpp.old   2019-04-20 16:03:09.575605300 +0300
 lang/cpp/src/context.cpp   2019-04-20 16:06:43.078419700 +0300
+@@ -1656,6 +1656,11 @@
+ return Error(gpgme_engine_check_version(p));
+ }
+ 
++int GpgME::setGlobalFlag(const char *name, const char *value)
++{
++return gpgme_set_global_flag(name, value);
++}
++
+ static const unsigned long supported_features = 0
+ | GpgME::ValidatingKeylistModeFeature
+ | GpgME::CancelOperationFeature
+diff -ur lang/cpp/src/global.h lang/cpp/src/global.h
+--- lang/cpp/src/global.h.old  2016-09-07 09:48:44.0 +0300
 lang/cpp/src/global.h  2019-04-20 16:06:41.918912600 +0300
+@@ -95,6 +95,8 @@
+ GPGMEPP_EXPORT Error checkEngine(Protocol proto);
+ GPGMEPP_EXPORT Error checkEngine(Engine engine);
+ 
++GPGMEPP_EXPORT int setGlobalFlag(const char *name, const char *value);
++
+ GPGMEPP_EXPORT GIOChannel *getGIOChannel(int fd);
+ GPGMEPP_EXPORT QIODevice   *getQIODevice(int fd);
+ 
diff --git a/xmlsecurity/source/gpg/SecurityEnvironment.cxx 
b/xmlsecurity/source/gpg/SecurityEnvironment.cxx
index 152e8c600019..6ba1bced5cfa 100644
--- a/xmlsecurity/source/gpg/SecurityEnvironment.cxx
+++ b/xmlsecurity/source/gpg/SecurityEnvironment.cxx
@@ -16,6 +16,14 @@
 #include 
 #include 
 
+#ifdef _WIN32
+#include 
+#include 
+#include 
+#include 
+#include 
+#endif
+
 #include 
 #include 
 #include 
@@ -27,6 +35,36 @@ using namespace css::lang;
 
 SecurityEnvironmentGpg::SecurityEnvironmentGpg()
 {
+#ifdef _WIN32
+// On Windows, gpgme expects gpgme-w32spawn.exe to be in the same 
directory as the current
+// process executable. This assumption might be wrong, e.g., for bundled 
python, which is
+// in instdir/program/python-core-x.y.z/bin, while gpgme-w32spawn.exe is 
in instdir/program.
+// If we can't find gpgme-w32spawn.exe in the current executable location, 
then try to find
+// the spawn executable, and inform gpgme about actual location using 
gpgme_set_global_flag.
+static bool bSpawnPathInitialized = [] {
+auto accessUrl = [](const INetURLObject& url) {
+osl::File 
file(url.GetMainURL(INetURLObject::DecodeMechanism::NONE));
+return file.open(osl_File_OpenFlag_Read) == osl::FileBase::E_None;
+};
+OUString sPath;
+osl_getExecutableFile();
+INetURLObject aPathUrl(sPath);
+

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

2019-04-22 Thread Mike Kaganski (via logerrit)
 sc/source/filter/inc/xestream.hxx |4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

New commits:
commit 960ac92107c8095368f4a29337a5644d99094f4f
Author: Mike Kaganski 
AuthorDate: Mon Apr 22 07:47:07 2019 +0200
Commit: Mike Kaganski 
CommitDate: Mon Apr 22 08:48:49 2019 +0200

Simplify parameter pack handling: use if constexpr to drop extra function

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

diff --git a/sc/source/filter/inc/xestream.hxx 
b/sc/source/filter/inc/xestream.hxx
index ecbe291621f7..0df1a030011d 100644
--- a/sc/source/filter/inc/xestream.hxx
+++ b/sc/source/filter/inc/xestream.hxx
@@ -290,9 +290,9 @@ public:
 void WriteAttributes(sal_Int32 nAttribute, const Str& value, Args... rest)
 {
 WriteAttribute(nAttribute, value);
-WriteAttributes(rest...);
+if constexpr(sizeof...(rest) > 0)
+WriteAttributes(rest...);
 }
-static void WriteAttributes() {}
 
 sax_fastparser::FSHelperPtr CreateOutputStream (
 const OUString& sFullStream,
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

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

2019-04-21 Thread Mike Kaganski (via logerrit)
 setup_native/source/win32/customactions/inst_msu/inst_msu.cxx |  136 +++---
 1 file changed, 96 insertions(+), 40 deletions(-)

New commits:
commit bb6906b66d7ceac8465b43d7e2b1f05976d43600
Author: Mike Kaganski 
AuthorDate: Sun Apr 21 22:39:43 2019 +0300
Commit: Mike Kaganski 
CommitDate: Mon Apr 22 04:22:57 2019 +0200

tdf#124794: Wait for WU service stopped before launching wusa.exe

It seems that wusa.exe would fail with error code 0x80080005
if launched too soon after WU service was sent a stop control
(which was added in tdf#123832).

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

diff --git a/setup_native/source/win32/customactions/inst_msu/inst_msu.cxx 
b/setup_native/source/win32/customactions/inst_msu/inst_msu.cxx
index ebcb96c5a4da..6ce517f2f863 100644
--- a/setup_native/source/win32/customactions/inst_msu/inst_msu.cxx
+++ b/setup_native/source/win32/customactions/inst_msu/inst_msu.cxx
@@ -141,14 +141,14 @@ void ShowWarning(MSIHANDLE hInst, const std::wstring& 
sKBNo, const char* sMessag
 }
 
 // Set custom action description visible in progress dialog
-void SetStatusText(MSIHANDLE hInst, const std::wstring& sKBNo)
+void SetStatusText(MSIHANDLE hInst, const std::wstring& actName, const 
std::wstring& actDesc)
 {
 PMSIHANDLE hRec = MsiCreateRecord(3);
 // For INSTALLMESSAGE_ACTIONSTART, record's Field 0 must be null
-std::wstring s(sKBNo + L" installation");
-MsiRecordSetStringW(hRec, 1, s.c_str()); // Field 1: Action name - must be 
non-null
-s = L"Installing " + sKBNo;
-MsiRecordSetStringW(hRec, 2, s.c_str()); // Field 2: Action description - 
displayed in dialog
+// Field 1: Action name - must be non-null
+MsiRecordSetStringW(hRec, 1, actName.c_str());
+// Field 2: Action description - displayed in dialog
+MsiRecordSetStringW(hRec, 2, actDesc.c_str());
 // Let Field 3 stay null - no action template
 MsiProcessMessage(hInst, INSTALLMESSAGE_ACTIONSTART, hRec);
 }
@@ -199,6 +199,46 @@ bool IsWow64Process()
 #endif
 }
 
+// This class uses MsiProcessMessage to check for user input: it returns 
IDCANCEL when user cancels
+// installation. It throws a special exception, to be intercepted in main 
action function to return
+// corresponding exit code.
+class UserInputChecker
+{
+public:
+class eUserCancelled
+{
+};
+
+UserInputChecker(MSIHANDLE hInstall)
+: m_hInstall(hInstall)
+, m_hProgressRec(MsiCreateRecord(3))
+{
+// Use explicit progress messages
+MsiRecordSetInteger(m_hProgressRec, 1, 1);
+MsiRecordSetInteger(m_hProgressRec, 2, 1);
+MsiRecordSetInteger(m_hProgressRec, 3, 0);
+int nResult = MsiProcessMessage(m_hInstall, INSTALLMESSAGE_PROGRESS, 
m_hProgressRec);
+if (nResult == IDCANCEL)
+throw eUserCancelled();
+// Prepare the record to following progress update calls
+MsiRecordSetInteger(m_hProgressRec, 1, 2);
+MsiRecordSetInteger(m_hProgressRec, 2, 0); // step by 0 - don't move 
progress
+MsiRecordSetInteger(m_hProgressRec, 3, 0);
+}
+
+void ThrowIfUserCancelled()
+{
+// Check if user has cancelled
+int nResult = MsiProcessMessage(m_hInstall, INSTALLMESSAGE_PROGRESS, 
m_hProgressRec);
+if (nResult == IDCANCEL)
+throw eUserCancelled();
+}
+
+private:
+MSIHANDLE m_hInstall;
+PMSIHANDLE m_hProgressRec;
+};
+
 // Checks if Windows Update service is disabled, and if it is, enables it 
temporarily.
 // Also stops the service if it's currently running, because it seems that 
wusa.exe
 // does not freeze when it starts the service itself.
@@ -218,7 +258,7 @@ public:
 if (mhService)
 {
 EnsureServiceEnabled(mhInstall, mhService.get(), false);
-StopService(mhInstall, mhService.get());
+StopService(mhInstall, mhService.get(), false);
 }
 }
 catch (std::exception& e)
@@ -246,8 +286,9 @@ private:
 // Stop currently running service to prevent wusa.exe from hanging 
trying to detect if the
 // update is applicable (sometimes this freezes it ~indefinitely; it 
seems that it doesn't
 // happen if wusa.exe starts the service itself: 
https://superuser.com/questions/1044528/).
+// tdf#124794: Wait for service to stop.
 if (nCurrentStatus == SERVICE_RUNNING)
-StopService(hInstall, hService.get());
+StopService(hInstall, hService.get(), true);
 
 if (nCurrentStatus == SERVICE_RUNNING
 || !EnsureServiceEnabled(hInstall, hService.get(), true))
@@ -268,9 +309,8 @@ private:
 DWORD nCbRequired = 0;
 if (!QueryServiceConfigW(hService, nullptr, 0, ))
 {
-DWORD nError = GetLastError();
-if (nError != 

[Libreoffice-commits] core.git: sc/inc sc/qa sc/source

2019-04-22 Thread Mike Kaganski (via logerrit)
 sc/inc/dputil.hxx  |4 ++--
 sc/qa/unit/pivottable_filters_test.cxx |3 ++-
 sc/source/filter/excel/xepivotxml.cxx  |   11 +++
 3 files changed, 11 insertions(+), 7 deletions(-)

New commits:
commit e913727c7ee3af0bb4031c6829abfb3373306492
Author: Mike Kaganski 
AuthorDate: Mon Apr 22 12:16:38 2019 +0300
Commit: Mike Kaganski 
CommitDate: Mon Apr 22 12:14:17 2019 +0200

tdf#124881: Provide a non-empty name for pivot table's data field

Otherwise, the empty string is used by Excel, so the field arrives
unnamed, disappearing from pivot table's cells upon refresh, etc.

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

diff --git a/sc/inc/dputil.hxx b/sc/inc/dputil.hxx
index 735843b84578..742c69da0e6a 100644
--- a/sc/inc/dputil.hxx
+++ b/sc/inc/dputil.hxx
@@ -47,9 +47,9 @@ public:
 double fValue, const ScDPNumGroupInfo* pInfo, sal_Int32 nDatePart,
 const SvNumberFormatter* pFormatter);
 
-static OUString getDisplayedMeasureName(const OUString& rName, 
ScSubTotalFunc eFunc);
+SC_DLLPUBLIC static OUString getDisplayedMeasureName(const OUString& 
rName, ScSubTotalFunc eFunc);
 
-static ScSubTotalFunc toSubTotalFunc(ScGeneralFunction eGenFunc);
+SC_DLLPUBLIC static ScSubTotalFunc toSubTotalFunc(ScGeneralFunction 
eGenFunc);
 };
 
 #endif
diff --git a/sc/qa/unit/pivottable_filters_test.cxx 
b/sc/qa/unit/pivottable_filters_test.cxx
index 11fb1de65a23..9682b2a10131 100644
--- a/sc/qa/unit/pivottable_filters_test.cxx
+++ b/sc/qa/unit/pivottable_filters_test.cxx
@@ -2485,7 +2485,8 @@ void ScPivotTableFiltersTest::testTdf124651()
 CPPUNIT_ASSERT(pDoc);
 // We have to export name attribute, even though it's optional according 
to ECMA-376 standard,
 // because Excel (at least 2016) seems to require it.
-assertXPath(pDoc, "/x:pivotTableDefinition/x:dataFields/x:dataField", 
"name", "");
+// tdf#124881: this shouldn't be an empty string
+assertXPath(pDoc, "/x:pivotTableDefinition/x:dataFields/x:dataField", 
"name", "Sum - num");
 }
 
 void ScPivotTableFiltersTest::testTdf124736()
diff --git a/sc/source/filter/excel/xepivotxml.cxx 
b/sc/source/filter/excel/xepivotxml.cxx
index ca7faa1bccff..75cb94dd2baa 100644
--- a/sc/source/filter/excel/xepivotxml.cxx
+++ b/sc/source/filter/excel/xepivotxml.cxx
@@ -1078,13 +1078,16 @@ void XclExpXmlPivotTables::SavePivotTableXml( 
XclExpXmlStream& rStrm, const ScDP
 long nDimIdx = rDataField.mnPos;
 assert(aCachedDims[nDimIdx]); // the loop above should have 
screened for NULL's.
 const ScDPSaveDimension& rDim = *rDataField.mpDim;
-const boost::optional & pName = rDim.GetLayoutName();
+boost::optional pName = rDim.GetLayoutName();
 // tdf#124651: despite being optional in CT_DataField according to 
ECMA-376 Part 1,
 // Excel (at least 2016) seems to insist on the presence of "name" 
attribute in
-// dataField element, even if empty
-const OString sName = pName ? pName->toUtf8() : "";
+// dataField element.
+// tdf#124881: try to create a meaningful name; don't use empty 
string.
+if (!pName)
+pName = ScDPUtil::getDisplayedMeasureName(
+rDim.GetName(), 
ScDPUtil::toSubTotalFunc(rDim.GetFunction()));
 auto pItemAttList = 
sax_fastparser::FastSerializerHelper::createAttrList();
-pItemAttList->add(XML_name, sName);
+pItemAttList->add(XML_name, pName->toUtf8());
 pItemAttList->add(XML_fld, OString::number(nDimIdx));
 const char* pSubtotal = toOOXMLSubtotalType(rDim.GetFunction());
 if (pSubtotal)
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

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

2019-04-24 Thread Mike Kaganski (via logerrit)
 l10ntools/source/ulfconv/msi-encodinglist.txt |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 5dea045b87a923654d6876acec947d973e0df4bc
Author: Mike Kaganski 
AuthorDate: Wed Apr 24 16:22:59 2019 +0200
Commit: Mike Kaganski 
CommitDate: Wed Apr 24 16:45:28 2019 +0200

tdf#124791: Fix Gaelic (Scotland) (gd-GB) LCID in MSI installer

... which was obviously omitted in commit
6b678c135da07f34da1bf7b19562366361e95085, which introduced the correct
value of 0x0491 (1169) in addition to the pre-existing 0x043C (1084).
The new value is used when user sets relevant entry in Region and
Language control panel applet (intl.cpl); having the old value in MSI
summary information blocks auto-detection of proper installer language.

[MS-LCID] Appendix A mentions that the new code is available since Win7,
so we are good with the fix.

[MS-LCID] 
https://docs.microsoft.com/en-us/openspecs/windows_protocols/ms-lcid/a9eac961-e77d-41a6-90a5-ce1a8b0cdb9c

Co-authored-by: Eike Rathke 

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

diff --git a/l10ntools/source/ulfconv/msi-encodinglist.txt 
b/l10ntools/source/ulfconv/msi-encodinglist.txt
index 4116eca69a1e..96f87341ae13 100644
--- a/l10ntools/source/ulfconv/msi-encodinglist.txt
+++ b/l10ntools/source/ulfconv/msi-encodinglist.txt
@@ -62,7 +62,7 @@ fr-CA0  3084
 fy   0  1122   # Frisian
 fur  0  1585
 ga   0  2108   # Irish
-gd   0  1084   # Gaelic (Scotland)
+gd   0  1169   # Gaelic (Scotland)
 gl   0  1110   # Galician
 gu   0  1095   # Gujarati
 gu-IN0  1095   # Gujarati
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

[Libreoffice-commits] core.git: Branch 'libreoffice-6-2' - l10ntools/source

2019-04-24 Thread Mike Kaganski (via logerrit)
 l10ntools/source/ulfconv/msi-encodinglist.txt |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 086701be50e9d95c67f6fdee97b4080419b55e61
Author: Mike Kaganski 
AuthorDate: Wed Apr 24 16:22:59 2019 +0200
Commit: Adolfo Jayme Barrientos 
CommitDate: Thu Apr 25 03:05:26 2019 +0200

tdf#124791: Fix Gaelic (Scotland) (gd-GB) LCID in MSI installer

... which was obviously omitted in commit
6b678c135da07f34da1bf7b19562366361e95085, which introduced the correct
value of 0x0491 (1169) in addition to the pre-existing 0x043C (1084).
The new value is used when user sets relevant entry in Region and
Language control panel applet (intl.cpl); having the old value in MSI
summary information blocks auto-detection of proper installer language.

[MS-LCID] Appendix A mentions that the new code is available since Win7,
so we are good with the fix.

[MS-LCID] 
https://docs.microsoft.com/en-us/openspecs/windows_protocols/ms-lcid/a9eac961-e77d-41a6-90a5-ce1a8b0cdb9c

Co-authored-by: Eike Rathke 

Change-Id: Ic03b0e8eaf145c662fde48846cd5307e362d4d63
Reviewed-on: https://gerrit.libreoffice.org/71242
Reviewed-by: Mike Kaganski 
Tested-by: Mike Kaganski 
(cherry picked from commit 5dea045b87a923654d6876acec947d973e0df4bc)
Reviewed-on: https://gerrit.libreoffice.org/71250
Reviewed-by: Eike Rathke 
Tested-by: Jenkins

diff --git a/l10ntools/source/ulfconv/msi-encodinglist.txt 
b/l10ntools/source/ulfconv/msi-encodinglist.txt
index 4116eca69a1e..96f87341ae13 100644
--- a/l10ntools/source/ulfconv/msi-encodinglist.txt
+++ b/l10ntools/source/ulfconv/msi-encodinglist.txt
@@ -62,7 +62,7 @@ fr-CA0  3084
 fy   0  1122   # Frisian
 fur  0  1585
 ga   0  2108   # Irish
-gd   0  1084   # Gaelic (Scotland)
+gd   0  1169   # Gaelic (Scotland)
 gl   0  1110   # Galician
 gu   0  1095   # Gujarati
 gu-IN0  1095   # Gujarati
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

[Libreoffice-commits] core.git: Branch 'libreoffice-6-2-3' - fpicker/source

2019-04-09 Thread Mike Kaganski (via logerrit)
 fpicker/source/win32/asyncrequests.cxx |5 +
 1 file changed, 5 insertions(+)

New commits:
commit 3196dffa5c14ed7b74c29f2abfa9c618bfb8b7ef
Author: Mike Kaganski 
AuthorDate: Fri Apr 5 15:24:31 2019 +0300
Commit: Christian Lohmaier 
CommitDate: Tue Apr 9 15:14:40 2019 +0200

tdf#123502: Make sure to hold the mutex before releasing it

Fixes a regression after commit 5b2f1243bd44b450da26c8344b3ee459f8e88f6c

The destruction of the dialog is initiated by a callback executed from
VCLXButton::ProcessWindowEvent, which notifies listeners, using a call
to VCLXWindow::ImplExecuteAsyncWithoutSolarLock. The stack looks like
this:

ucrtbased.dll!issue_debug_notification(const wchar_t * const message) Line 
28
at 
minkernel\crts\ucrt\src\appcrt\internal\report_runtime_error.cpp(28)
ucrtbased.dll!__acrt_report_runtime_error(const wchar_t * message) Line 154
at 
minkernel\crts\ucrt\src\appcrt\internal\report_runtime_error.cpp(154)
ucrtbased.dll!abort() Line 51
at minkernel\crts\ucrt\src\appcrt\startup\abort.cpp(51)
comphelper.dll!comphelper::SolarMutex::doRelease(bool bUnlockAll) Line 65
at c:\lo\src\core2\comphelper\source\misc\solarmutex.cxx(65)
vclplug_winlo.dll!SalYieldMutex::doRelease(bool bUnlockAll) Line 169
at c:\lo\src\core2\vcl\win\app\salinst.cxx(169)
comphelper.dll!comphelper::SolarMutex::release(bool bUnlockAll) Line 89
at c:\lo\src\core2\include\comphelper\solarmutex.hxx(89)
vcllo.dll!SalInstance::ReleaseYieldMutexAll() Line 114
at c:\lo\src\core2\vcl\source\app\salvtables.cxx(114)
vcllo.dll!Application::ReleaseSolarMutex() Line 548
at c:\lo\src\core2\vcl\source\app\svapp.cxx(548)
fps.dll!SolarMutexReleaser::SolarMutexReleaser() Line 1479
at c:\lo\src\core2\include\vcl\svapp.hxx(1479)
fps.dll!fpicker::win32::vista::AsyncRequests::~AsyncRequests() Line 84
at c:\lo\src\core2\fpicker\source\win32\asyncrequests.cxx(84)
fps.dll!fpicker::win32::vista::VistaFilePicker::~VistaFilePicker() Line 72
at c:\lo\src\core2\fpicker\source\win32\vistafilepicker.cxx(72)
fps.dll!fpicker::win32::vista::VistaFilePicker::`scalar deleting 
destructor'(unsigned int)
cppuhelper3MSC.dll!cppu::OWeakObject::release() Line 233
at c:\lo\src\core2\cppuhelper\source\weak.cxx(233)
cppuhelper3MSC.dll!cppu::WeakComponentImplHelperBase::release() Line 84
at c:\lo\src\core2\cppuhelper\source\implbase.cxx(84)

fps.dll!cppu::PartialWeakComponentImplHelper::release()
 Line 86
at c:\lo\src\core2\include\cppuhelper\compbase.hxx(86)
invocationlo.dll!com::sun::star::uno::cpp_release(void * pCppI) Line 48
at c:\lo\src\core2\include\com\sun\star\uno\genfunc.hxx(48)
cppu3.dll!cppu::_release(void * p, void(*)(void *) release) Line 86
at c:\lo\src\core2\cppu\source\uno\prim.hxx(86)
cppu3.dll!cppu::_destructAny(_uno_Any * pAny, void(*)(void *) release) Line 
130
at c:\lo\src\core2\cppu\source\uno\destr.hxx(130)
cppu3.dll!uno_any_destruct(_uno_Any * pValue, void(*)(void *) release) Line 
131
at c:\lo\src\core2\cppu\source\uno\any.cxx(131)
invocationlo.dll!com::sun::star::uno::Any::~Any() Line 111
at c:\lo\src\core2\include\com\sun\star\uno\any.hxx(111)
invocationlo.dll!stoc_inv::Invocation_Impl::~Invocation_Impl()
invocationlo.dll!stoc_inv::Invocation_Impl::`scalar deleting 
destructor'(unsigned int)
cppuhelper3MSC.dll!cppu::OWeakObject::release() Line 233
at c:\lo\src\core2\cppuhelper\source\weak.cxx(233)
invocationlo.dll!stoc_inv::Invocation_Impl::release() Line 110
at c:\lo\src\core2\stoc\source\invocation\invocation.cxx(110)

pyuno_d.pyd!com::sun::star::uno::Reference::~Reference()
 Line 110
at c:\lo\src\core2\include\com\sun\star\uno\reference.hxx(110)
pyuno_d.pyd!pyuno::PyUNOInternals::~PyUNOInternals()
pyuno_d.pyd!pyuno::PyUNOInternals::`scalar deleting destructor'(unsigned 
int)
pyuno_d.pyd!pyuno::PyUNO_del(_object * self) Line 81
at c:\lo\src\core2\pyuno\source\module\pyuno.cxx(81)
python35_d.dll!_Py_Dealloc(_object * op) Line 1795
at 
c:\lo\src\core2\workdir\unpackedtarball\python3\objects\object.c(1795)
python35_d.dll!dict_dealloc(PyDictObject * mp) Line 1646
at 
c:\lo\src\core2\workdir\unpackedtarball\python3\objects\dictobject.c(1646)
python35_d.dll!_Py_Dealloc(_object * op) Line 1795
at 
c:\lo\src\core2\workdir\unpackedtarball\python3\objects\object.c(1795)
python35_d.dll!subtype_dealloc(_object * self) Line 1194
at 
c:\lo\src\core2\workdir\unpackedtarball\python3\objects\typeobject.c(1194)
python35_d.dll!_Py_Dealloc(_object * op) Line 1795
at 
c:\lo\src\core2\workdir\unpackedtarball\python3\objects\object.c(1795)

[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-6.0' - desktop/win32

2019-04-10 Thread Mike Kaganski (via logerrit)
 desktop/win32/source/officeloader/officeloader.cxx |9 -
 1 file changed, 8 insertions(+), 1 deletion(-)

New commits:
commit 9649057c4c0d0e81ac46d41849ab9d0134a84de0
Author: Mike Kaganski 
AuthorDate: Mon Oct 1 21:29:47 2018 +0300
Commit: Tor Lillqvist 
CommitDate: Wed Apr 10 22:09:36 2019 +0200

tdf#120249: escape trailing backslash in argument passed to soffice.bin

... to avoid treating \" as in-argument " instead of end of argument

See 
https://docs.microsoft.com/en-us/windows/desktop/api/shellapi/nf-shellapi-commandlinetoargvw

Change-Id: Ie283ba04117e13bc06c5b92412a945f945e67ff3
Reviewed-on: https://gerrit.libreoffice.org/61214
Tested-by: Jenkins
Reviewed-by: Mike Kaganski 
(cherry picked from commit f4103a42d58535e21c48ff94ab000ab0305c62e3)
Reviewed-on: https://gerrit.libreoffice.org/61222
Reviewed-by: Caolán McNamara 
Tested-by: Caolán McNamara 
(cherry picked from commit 9bb9be742d74d412d27be3db4ce5ac5e9508cb5b)
Reviewed-on: https://gerrit.libreoffice.org/70524
Reviewed-by: Tor Lillqvist 
Tested-by: Tor Lillqvist 

diff --git a/desktop/win32/source/officeloader/officeloader.cxx 
b/desktop/win32/source/officeloader/officeloader.cxx
index 45b94a8e128d..77c9a063532d 100644
--- a/desktop/win32/source/officeloader/officeloader.cxx
+++ b/desktop/win32/source/officeloader/officeloader.cxx
@@ -71,7 +71,7 @@ int WINAPI wWinMain( HINSTANCE, HINSTANCE, LPWSTR, int )
 argv = GetCommandArgs();
 std::size_t n = wcslen(argv[0]) + 2;
 for (int i = 1; i < argc; ++i) {
-n += wcslen(argv[i]) + 3;
+n += wcslen(argv[i]) + 4; // 2 doublequotes + a space + 
optional trailing backslash
 }
 n += MY_LENGTH(L" \"-env:OOO_CWD=2") + 4 * cwdLen +
 MY_LENGTH(L"\"") + 1;
@@ -86,6 +86,13 @@ int WINAPI wWinMain( HINSTANCE, HINSTANCE, LPWSTR, int )
 if (bFirst || EXITHELPER_NORMAL_RESTART == dwExitCode || 
wcsncmp(argv[i], MY_STRING(L"-env:")) == 0) {
 p = desktop_win32::commandLineAppend(p, MY_STRING(L"\" \""));
 p = desktop_win32::commandLineAppend(p, argv[i]);
+const size_t arglen = wcslen(argv[i]);
+// tdf#120249: if an argument ends with backslash, we should 
escape it with another
+// backslash; otherwise, the trailing backslash will be 
treated as an escapement
+// character for the following doublequote by 
CommandLineToArgvW in soffice.bin. See
+// 
https://docs.microsoft.com/en-us/windows/desktop/api/shellapi/nf-shellapi-commandlinetoargvw
+if (arglen && argv[i][arglen-1] == '\\')
+p = desktop_win32::commandLineAppend(p, MY_STRING(L"\\"));
 }
 }
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

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

2019-04-25 Thread Mike Kaganski (via logerrit)
 include/test/xmltesttools.hxx |   12 +++-
 test/source/xmltesttools.cxx  |5 +
 2 files changed, 12 insertions(+), 5 deletions(-)

New commits:
commit 3fef9fa3f5d260dd1264b67d8b42aad476332eea
Author: Mike Kaganski 
AuthorDate: Thu Apr 25 12:51:40 2019 +0300
Commit: Mike Kaganski 
CommitDate: Thu Apr 25 14:42:13 2019 +0200

assertXPath: disallow passing rAttribute without rExpectedValue

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

diff --git a/include/test/xmltesttools.hxx b/include/test/xmltesttools.hxx
index 4f725f5948c5..c24a81eb65d6 100644
--- a/include/test/xmltesttools.hxx
+++ b/include/test/xmltesttools.hxx
@@ -61,12 +61,14 @@ protected:
 int   getXPathPosition(xmlDocPtr pXmlDoc, const OString& rXPath, 
const OUString& rChildName);
 /**
  * Assert that rXPath exists, and returns exactly one node.
- * In case rAttribute is provided, the rXPath's attribute's value must
- * equal to the rExpected value.
  */
-void  assertXPath(xmlDocPtr pXmlDoc, const OString& rXPath,
-  const OString& rAttribute = OString(),
-  const OUString& rExpectedValue = OUString());
+void  assertXPath(xmlDocPtr pXmlDoc, const OString& rXPath);
+/**
+ * Assert that rXPath exists, returns exactly one node, and the rXPath's 
attribute's value
+ * equals to the rExpected value.
+ */
+void  assertXPath(xmlDocPtr pXmlDoc, const OString& rXPath, const 
OString& rAttribute,
+  const OUString& rExpectedValue);
 void  assertXPathAttrs(xmlDocPtr pXmlDoc, const OString& rXPath,
   const std::vector>& 
aPairVector);
 /**
diff --git a/test/source/xmltesttools.cxx b/test/source/xmltesttools.cxx
index 123af01b28db..20149cc03c37 100644
--- a/test/source/xmltesttools.cxx
+++ b/test/source/xmltesttools.cxx
@@ -135,6 +135,11 @@ OUString XmlTestTools::getXPathContent(xmlDocPtr pXmlDoc, 
const OString& rXPath)
 CPPUNIT_FAIL("Invalid XPath type");
 }
 
+void XmlTestTools::assertXPath(xmlDocPtr pXmlDoc, const OString& rXPath)
+{
+getXPath(pXmlDoc, rXPath, ""); // it asserts that rXPath exists, and 
returns exactly one node
+}
+
 void XmlTestTools::assertXPath(xmlDocPtr pXmlDoc, const OString& rXPath, const 
OString& rAttribute, const OUString& rExpectedValue)
 {
 OUString aValue = getXPath(pXmlDoc, rXPath, rAttribute);
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

[Libreoffice-commits] core.git: Branch 'libreoffice-6-2' - setup_native/source

2019-04-25 Thread Mike Kaganski (via logerrit)
 setup_native/source/win32/customactions/inst_msu/inst_msu.cxx |  120 +++---
 1 file changed, 86 insertions(+), 34 deletions(-)

New commits:
commit 1151e8fe6c8061f8b9c4777fba9665464ab5b5b8
Author: Mike Kaganski 
AuthorDate: Sun Apr 21 22:39:43 2019 +0300
Commit: Caolán McNamara 
CommitDate: Thu Apr 25 13:00:55 2019 +0200

tdf#124794: Wait for WU service stopped before launching wusa.exe

It seems that wusa.exe would fail with error code 0x80080005
if launched too soon after WU service was sent a stop control
(which was added in tdf#123832).

Change-Id: I470a8a8e933e8a0cd6208c095ed63c1761b3b434
Reviewed-on: https://gerrit.libreoffice.org/71045
Tested-by: Jenkins
Reviewed-by: Mike Kaganski 
Reviewed-on: https://gerrit.libreoffice.org/71062
Reviewed-by: Caolán McNamara 
Tested-by: Caolán McNamara 

diff --git a/setup_native/source/win32/customactions/inst_msu/inst_msu.cxx 
b/setup_native/source/win32/customactions/inst_msu/inst_msu.cxx
index d81532020cce..d8c196ccd1a8 100644
--- a/setup_native/source/win32/customactions/inst_msu/inst_msu.cxx
+++ b/setup_native/source/win32/customactions/inst_msu/inst_msu.cxx
@@ -181,6 +181,46 @@ public:
 }
 };
 
+// This class uses MsiProcessMessage to check for user input: it returns 
IDCANCEL when user cancels
+// installation. It throws a special exception, to be intercepted in main 
action function to return
+// corresponding exit code.
+class UserInputChecker
+{
+public:
+class eUserCancelled
+{
+};
+
+UserInputChecker(MSIHANDLE hInstall)
+: m_hInstall(hInstall)
+, m_hProgressRec(MsiCreateRecord(3))
+{
+// Use explicit progress messages
+MsiRecordSetInteger(m_hProgressRec, 1, 1);
+MsiRecordSetInteger(m_hProgressRec, 2, 1);
+MsiRecordSetInteger(m_hProgressRec, 3, 0);
+int nResult = MsiProcessMessage(m_hInstall, INSTALLMESSAGE_PROGRESS, 
m_hProgressRec);
+if (nResult == IDCANCEL)
+throw eUserCancelled();
+// Prepare the record to following progress update calls
+MsiRecordSetInteger(m_hProgressRec, 1, 2);
+MsiRecordSetInteger(m_hProgressRec, 2, 0); // step by 0 - don't move 
progress
+MsiRecordSetInteger(m_hProgressRec, 3, 0);
+}
+
+void ThrowIfUserCancelled()
+{
+// Check if user has cancelled
+int nResult = MsiProcessMessage(m_hInstall, INSTALLMESSAGE_PROGRESS, 
m_hProgressRec);
+if (nResult == IDCANCEL)
+throw eUserCancelled();
+}
+
+private:
+MSIHANDLE m_hInstall;
+PMSIHANDLE m_hProgressRec;
+};
+
 // Checks if Windows Update service is disabled, and if it is, enables it 
temporarily.
 // Also stops the service if it's currently running, because it seems that 
wusa.exe
 // does not freeze when it starts the service itself.
@@ -200,7 +240,7 @@ public:
 if (mhService)
 {
 EnsureServiceEnabled(mhInstall, mhService.get(), false);
-StopService(mhInstall, mhService.get());
+StopService(mhInstall, mhService.get(), false);
 }
 }
 catch (std::exception& e)
@@ -230,8 +270,9 @@ private:
 // Stop currently running service to prevent wusa.exe from hanging 
trying to detect if the
 // update is applicable (sometimes this freezes it ~indefinitely; 
it seems that it doesn't
 // happen if wusa.exe starts the service itself: 
https://superuser.com/questions/1044528/).
+// tdf#124794: Wait for service to stop.
 if (nCurrentStatus == SERVICE_RUNNING)
-StopService(hInstall, hService.get());
+StopService(hInstall, hService.get(), true);
 
 if (nCurrentStatus == SERVICE_RUNNING
 || !EnsureServiceEnabled(hInstall, hService.get(), true))
@@ -260,9 +301,8 @@ private:
 DWORD nCbRequired = 0;
 if (!QueryServiceConfigW(hService, nullptr, 0, ))
 {
-DWORD nError = GetLastError();
-if (nError != ERROR_INSUFFICIENT_BUFFER)
-ThrowLastError("QueryServiceConfigW");
+if (DWORD nError = GetLastError(); nError != 
ERROR_INSUFFICIENT_BUFFER)
+ThrowWin32Error("QueryServiceConfigW", nError);
 }
 std::unique_ptr pBuf(new char[nCbRequired]);
 LPQUERY_SERVICE_CONFIGW pConfig = 
reinterpret_cast(pBuf.get());
@@ -336,7 +376,7 @@ private:
 return aServiceStatus.dwCurrentState;
 }
 
-static void StopService(MSIHANDLE hInstall, SC_HANDLE hService)
+static void StopService(MSIHANDLE hInstall, SC_HANDLE hService, bool bWait)
 {
 try
 {
@@ -344,12 +384,34 @@ private:
 {
 SERVICE_STATUS aServiceStatus{};
 if (!ControlService(hService, SERVICE_CONTROL_STOP, 
))
-WriteLog(hInstall, Win32ErrorMessage("ControlService", 
GetLastError()));
-

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

2019-04-25 Thread Mike Kaganski (via logerrit)
 sc/qa/unit/subsequent_filters-test.cxx |   15 +++
 sc/source/filter/excel/colrowst.cxx|2 +-
 2 files changed, 16 insertions(+), 1 deletion(-)

New commits:
commit e056abae09796f2b3806e94e62cae7f0d262d4d5
Author: Mike Kaganski 
AuthorDate: Thu Apr 25 15:30:49 2019 +0300
Commit: Mike Kaganski 
CommitDate: Thu Apr 25 20:09:39 2019 +0200

tdf#50916: XLS: make sure to set default widths to all columns

See 
https://lists.freedesktop.org/archives/libreoffice/2019-April/082479.html
Ths partially reverts commit 1463625ae26900d2461fd72a5a2c894b9f1b8726

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

diff --git a/sc/qa/unit/subsequent_filters-test.cxx 
b/sc/qa/unit/subsequent_filters-test.cxx
index 578ff72435d2..fa9abf92f4f1 100644
--- a/sc/qa/unit/subsequent_filters-test.cxx
+++ b/sc/qa/unit/subsequent_filters-test.cxx
@@ -248,6 +248,7 @@ public:
 void testTdf62268();
 void testVBAMacroFunctionODS();
 void testAutoheight2Rows();
+void testXLSDefColWidth();
 
 CPPUNIT_TEST_SUITE(ScFiltersTest);
 CPPUNIT_TEST(testBooleanFormatXLSX);
@@ -387,6 +388,7 @@ public:
 CPPUNIT_TEST(testTdf62268);
 CPPUNIT_TEST(testVBAMacroFunctionODS);
 CPPUNIT_TEST(testAutoheight2Rows);
+CPPUNIT_TEST(testXLSDefColWidth);
 
 CPPUNIT_TEST_SUITE_END();
 
@@ -4269,6 +4271,19 @@ void ScFiltersTest::testAutoheight2Rows()
 xDocSh->DoClose();
 }
 
+void ScFiltersTest::testXLSDefColWidth()
+{
+// XLS has only 256 columns; but on import, we need to set default width 
to all above that limit
+ScDocShellRef xDocSh = loadDoc("chartx.", FORMAT_XLS); // just some XLS 
with narrow columns
+ScDocument& rDoc = xDocSh->GetDocument();
+
+int nWidth = rDoc.GetColWidth(MAXCOL, 0, false);
+// This was 1280
+CPPUNIT_ASSERT_EQUAL(1005, nWidth);
+
+xDocSh->DoClose();
+}
+
 ScFiltersTest::ScFiltersTest()
   : ScBootstrapFixture( "sc/qa/unit/data" )
 {
diff --git a/sc/source/filter/excel/colrowst.cxx 
b/sc/source/filter/excel/colrowst.cxx
index 5640335f08b8..fb8e3e1c3836 100644
--- a/sc/source/filter/excel/colrowst.cxx
+++ b/sc/source/filter/excel/colrowst.cxx
@@ -184,7 +184,7 @@ void XclImpColRowSettings::Convert( SCTAB nScTab )
 // column widths --
 
 maColWidths.build_tree();
-for( SCCOL nCol : rDoc.GetColumnsRange(nScTab, 0, MAXCOL) )
+for (SCCOL nCol = 0; nCol <= MAXCOL; ++nCol)
 {
 sal_uInt16 nWidth = mnDefWidth;
 if (GetColFlag(nCol, ExcColRowFlags::Used))
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

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

2019-04-17 Thread Mike Kaganski (via logerrit)
 sc/qa/unit/data/ods/pivot-table-num-fmt.ods |binary
 sc/qa/unit/pivottable_filters_test.cxx  |   27 +
 sc/source/filter/excel/xepivotxml.cxx   |   44 +---
 3 files changed, 61 insertions(+), 10 deletions(-)

New commits:
commit 26e85974a0287ab5869e7ff0145a66b853d66a02
Author: Mike Kaganski 
AuthorDate: Wed Apr 17 11:11:58 2019 +0300
Commit: Mike Kaganski 
CommitDate: Wed Apr 17 13:01:47 2019 +0200

tdf#124772: export data field number format to XLSX

... otherwise Excel would reset data formatting e.g. from currency
to plain numbers upon refresh.

Excel relies on per-field format setting in pivot tables, while Calc
takes fields formatting from source.

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

diff --git a/sc/qa/unit/data/ods/pivot-table-num-fmt.ods 
b/sc/qa/unit/data/ods/pivot-table-num-fmt.ods
new file mode 100644
index ..e6cfd138c12d
Binary files /dev/null and b/sc/qa/unit/data/ods/pivot-table-num-fmt.ods differ
diff --git a/sc/qa/unit/pivottable_filters_test.cxx 
b/sc/qa/unit/pivottable_filters_test.cxx
index e6ccb4914ef9..f9d10f9f4451 100644
--- a/sc/qa/unit/pivottable_filters_test.cxx
+++ b/sc/qa/unit/pivottable_filters_test.cxx
@@ -88,6 +88,7 @@ public:
 void testTdf123939();
 void testTdf124651();
 void testTdf124736();
+void tesTtdf124772NumFmt();
 
 CPPUNIT_TEST_SUITE(ScPivotTableFiltersTest);
 
@@ -133,6 +134,7 @@ public:
 CPPUNIT_TEST(testTdf123939);
 CPPUNIT_TEST(testTdf124651);
 CPPUNIT_TEST(testTdf124736);
+CPPUNIT_TEST(tesTtdf124772NumFmt);
 
 CPPUNIT_TEST_SUITE_END();
 
@@ -2538,6 +2540,31 @@ void ScPivotTableFiltersTest::testTdf124736()
 "t", "default");
 }
 
+void ScPivotTableFiltersTest::tesTtdf124772NumFmt()
+{
+ScDocShellRef xDocSh = loadDoc("pivot-table-num-fmt.", FORMAT_ODS);
+CPPUNIT_ASSERT(xDocSh.is());
+
+std::shared_ptr pXPathFile
+= ScBootstrapFixture::exportTo(xDocSh.get(), FORMAT_XLSX);
+xDocSh->DoClose();
+
+xmlDocPtr pTable
+= XPathHelper::parseExport(pXPathFile, m_xSFactory, 
"xl/pivotTables/pivotTable1.xml");
+CPPUNIT_ASSERT(pTable);
+
+// This asserts that numFmtId attribute is present
+const OUString sXclNumFmt
+= getXPath(pTable, "/x:pivotTableDefinition/x:dataFields/x:dataField", 
"numFmtId");
+
+pTable = XPathHelper::parseExport(pXPathFile, m_xSFactory, 
"xl/styles.xml");
+CPPUNIT_ASSERT(pTable);
+
+// Check that we refer to correct format
+assertXPath(pTable, "/x:styleSheet/x:numFmts/x:numFmt[@numFmtId='" + 
sXclNumFmt.toUtf8() + "']",
+"formatCode", "\\$#,##0");
+}
+
 CPPUNIT_TEST_SUITE_REGISTRATION(ScPivotTableFiltersTest);
 
 CPPUNIT_PLUGIN_IMPLEMENT();
diff --git a/sc/source/filter/excel/xepivotxml.cxx 
b/sc/source/filter/excel/xepivotxml.cxx
index 2161f68d6478..43dc30196160 100644
--- a/sc/source/filter/excel/xepivotxml.cxx
+++ b/sc/source/filter/excel/xepivotxml.cxx
@@ -16,6 +16,9 @@
 #include 
 #include 
 #include 
+#include 
+#include 
+#include 
 
 #include 
 #include 
@@ -23,10 +26,12 @@
 #include 
 #include 
 
+#include 
 #include 
 #include 
 #include 
 #include 
+#include 
 
 #include 
 
@@ -1063,6 +1068,10 @@ void XclExpXmlPivotTables::SavePivotTableXml( 
XclExpXmlStream& rStrm, const ScDP
 
 if (!aDataFields.empty())
 {
+css::uno::Reference xDimsByName;
+if (auto xDimSupplier = const_cast(rDPObj).GetSource())
+xDimsByName = xDimSupplier->getDimensions();
+
 pPivotStrm->startElement(XML_dataFields,
 XML_count, OString::number(static_cast(aDataFields.size())),
 FSEND);
@@ -1077,17 +1086,32 @@ void XclExpXmlPivotTables::SavePivotTableXml( 
XclExpXmlStream& rStrm, const ScDP
 // Excel (at least 2016) seems to insist on the presence of "name" 
attribute in
 // dataField element, even if empty
 const OString sName = pName ? pName->toUtf8() : "";
-pPivotStrm->write("<")->writeId(XML_dataField);
-rStrm.WriteAttributes(XML_name, sName, FSEND);
-
-rStrm.WriteAttributes(XML_fld, OString::number(nDimIdx).getStr(), 
FSEND);
-
-ScGeneralFunction eFunc = rDim.GetFunction();
-const char* pSubtotal = toOOXMLSubtotalType(eFunc);
+auto pItemAttList = 
sax_fastparser::FastSerializerHelper::createAttrList();
+pItemAttList->add(XML_name, sName);
+pItemAttList->add(XML_fld, OString::number(nDimIdx));
+const char* pSubtotal = toOOXMLSubtotalType(rDim.GetFunction());
 if (pSubtotal)
-rStrm.WriteAttributes(XML_subtotal, pSubtotal, FSEND);
-
-pPivotStrm->write("/>");
+pItemAttList->add(XML_subtotal, pSubtotal);
+if (xDimsByName)
+   

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

2019-04-16 Thread Mike Kaganski (via logerrit)
 sc/qa/unit/pivottable_filters_test.cxx |   56 +
 sc/source/filter/excel/xepivotxml.cxx  |   87 +
 2 files changed, 112 insertions(+), 31 deletions(-)

New commits:
commit 0871804bab38e1b2fdc19ff176189356e155f367
Author: Mike Kaganski 
AuthorDate: Mon Apr 15 23:33:38 2019 +0300
Commit: Mike Kaganski 
CommitDate: Tue Apr 16 09:48:21 2019 +0200

tdf#124736: Sort group field items

Excel expects the group field items to be in ascending order starting
from "<01/02/2010", then "Jan", "Feb", ..., then end with ">01/02/2020".

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

diff --git a/sc/qa/unit/pivottable_filters_test.cxx 
b/sc/qa/unit/pivottable_filters_test.cxx
index cc8bcc042ab8..e6ccb4914ef9 100644
--- a/sc/qa/unit/pivottable_filters_test.cxx
+++ b/sc/qa/unit/pivottable_filters_test.cxx
@@ -87,6 +87,7 @@ public:
 void testTdf123923();
 void testTdf123939();
 void testTdf124651();
+void testTdf124736();
 
 CPPUNIT_TEST_SUITE(ScPivotTableFiltersTest);
 
@@ -131,6 +132,7 @@ public:
 CPPUNIT_TEST(testTdf123923);
 CPPUNIT_TEST(testTdf123939);
 CPPUNIT_TEST(testTdf124651);
+CPPUNIT_TEST(testTdf124736);
 
 CPPUNIT_TEST_SUITE_END();
 
@@ -2482,6 +2484,60 @@ void ScPivotTableFiltersTest::testTdf124651()
 assertXPath(pDoc, "/x:pivotTableDefinition/x:dataFields/x:dataField", 
"name", "");
 }
 
+void ScPivotTableFiltersTest::testTdf124736()
+{
+ScDocShellRef xDocSh = loadDoc("pivot-table/shared-dategroup.", 
FORMAT_XLSX);
+CPPUNIT_ASSERT(xDocSh.is());
+
+std::shared_ptr pXPathFile
+= ScBootstrapFixture::exportTo(xDocSh.get(), FORMAT_XLSX);
+xDocSh->DoClose();
+
+xmlDocPtr pTable = XPathHelper::parseExport(pXPathFile, m_xSFactory,
+
"xl/pivotCache/pivotCacheDefinition1.xml");
+CPPUNIT_ASSERT(pTable);
+
+assertXPath(pTable,
+
"/x:pivotCacheDefinition/x:cacheFields/x:cacheField[1]/x:fieldGroup/x:groupItems",
+"count", "45");
+// Group items must start with "<05/16/1958", then years sorted ascending, 
then ">06/11/2009"
+// They used to have years in the beginning, then "<05/16/1958", then 
">06/11/2009".
+// The "<" and ">" date strings are locale-dependent, so test depends on 
en_US locale
+assertXPath(
+pTable,
+
"/x:pivotCacheDefinition/x:cacheFields/x:cacheField[1]/x:fieldGroup/x:groupItems/x:s[1]",
+"v", "<05/16/1958");
+for (int i = 2; i <= 44; ++i)
+assertXPath(
+pTable,
+
"/x:pivotCacheDefinition/x:cacheFields/x:cacheField[1]/x:fieldGroup/x:groupItems/x:s["
++ OString::number(i) + "]",
+"v", OUString::number(1963 + i));
+assertXPath(
+pTable,
+
"/x:pivotCacheDefinition/x:cacheFields/x:cacheField[1]/x:fieldGroup/x:groupItems/x:s[45]",
+"v", ">06/11/2009");
+
+// Now check that table references these in correct order 
(document-dependent, so this is how
+// it should be in this specific testdoc which shows "<" and ">" values in 
the end)
+pTable = XPathHelper::parseExport(pXPathFile, m_xSFactory, 
"xl/pivotTables/pivotTable1.xml");
+CPPUNIT_ASSERT(pTable);
+assertXPath(pTable, 
"/x:pivotTableDefinition/x:pivotFields/x:pivotField[1]/x:items", "count",
+"46");
+const int vals[] = { 1,  2,  3,  4,  5,  6,  7,  8,  9,  10, 11, 12, 13, 
14, 15,
+ 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 
29, 30,
+ 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 
0,  44 };
+for (size_t i = 0; i < SAL_N_ELEMENTS(vals); ++i)
+{
+assertXPath(pTable,
+
"/x:pivotTableDefinition/x:pivotFields/x:pivotField[1]/x:items/x:item["
++ OString::number(i + 1) + "]",
+"x", OUString::number(vals[i]));
+}
+assertXPath(pTable, 
"/x:pivotTableDefinition/x:pivotFields/x:pivotField[1]/x:items/x:item[46]",
+"t", "default");
+}
+
 CPPUNIT_TEST_SUITE_REGISTRATION(ScPivotTableFiltersTest);
 
 CPPUNIT_PLUGIN_IMPLEMENT();
diff --git a/sc/source/filter/excel/xepivotxml.cxx 
b/sc/source/filter/excel/xepivotxml.cxx
index 6f98ffddcaa4..2161f68d6478 100644
--- a/sc/source/filter/excel/xepivotxml.cxx
+++ b/sc/source/filter/excel/xepivotxml.cxx
@@ -197,7 +197,42 @@ OUString GetExcelFormattedDate( double fSerialDateTime, 
const SvNumberFormatter&
 ::sax::Converter::convertDateTime(sBuf, aUDateTime, nullptr, true);
 return sBuf.makeStringAndClear();
 }
+
+// Excel seems to expect different order of group item values; we need to 
rearrange elements
+// to output "date2" last.
+// Since ScDPItemData::DateFirst is -1, ScDPItemData::DateLast is 1, and 
other date group
+// items 

[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-6.0' - sc/qa sc/source

2019-04-16 Thread Mike Kaganski (via logerrit)
 sc/qa/unit/pivottable_filters_test.cxx |   56 ++
 sc/source/filter/excel/xepivotxml.cxx  |   99 +++--
 2 files changed, 115 insertions(+), 40 deletions(-)

New commits:
commit a4c2ae0e039534367c51c5e4f4041dd0b0bf1365
Author: Mike Kaganski 
AuthorDate: Mon Apr 15 23:33:38 2019 +0300
Commit: Mike Kaganski 
CommitDate: Tue Apr 16 12:24:59 2019 +0200

tdf#124736: Sort group field items

Excel expects the group field items to be in ascending order starting
from "<01/02/2010", then "Jan", "Feb", ..., then end with ">01/02/2020".

Change-Id: I29e9b55f43091ed007f59e10dec64f46a37c7d5f
Reviewed-on: https://gerrit.libreoffice.org/70800
Tested-by: Jenkins
Reviewed-by: Mike Kaganski 
Reviewed-on: https://gerrit.libreoffice.org/70815
Tested-by: Mike Kaganski 

diff --git a/sc/qa/unit/pivottable_filters_test.cxx 
b/sc/qa/unit/pivottable_filters_test.cxx
index 4f1134c7c686..eea645d7d3c7 100644
--- a/sc/qa/unit/pivottable_filters_test.cxx
+++ b/sc/qa/unit/pivottable_filters_test.cxx
@@ -90,6 +90,7 @@ public:
 void testTdf123923();
 void testTdf123939();
 void testTdf124651();
+void testTdf124736();
 
 CPPUNIT_TEST_SUITE(ScPivotTableFiltersTest);
 
@@ -134,6 +135,7 @@ public:
 CPPUNIT_TEST(testTdf123923);
 CPPUNIT_TEST(testTdf123939);
 CPPUNIT_TEST(testTdf124651);
+CPPUNIT_TEST(testTdf124736);
 
 CPPUNIT_TEST_SUITE_END();
 
@@ -2477,6 +2479,60 @@ void ScPivotTableFiltersTest::testTdf124651()
 assertXPath(pDoc, "/x:pivotTableDefinition/x:dataFields/x:dataField", 
"name", "");
 }
 
+void ScPivotTableFiltersTest::testTdf124736()
+{
+ScDocShellRef xDocSh = loadDoc("pivot-table/shared-dategroup.", 
FORMAT_XLSX);
+CPPUNIT_ASSERT(xDocSh.is());
+
+std::shared_ptr pXPathFile
+= ScBootstrapFixture::exportTo(xDocSh.get(), FORMAT_XLSX);
+xDocSh->DoClose();
+
+xmlDocPtr pTable = XPathHelper::parseExport(pXPathFile, m_xSFactory,
+
"xl/pivotCache/pivotCacheDefinition1.xml");
+CPPUNIT_ASSERT(pTable);
+
+assertXPath(pTable,
+
"/x:pivotCacheDefinition/x:cacheFields/x:cacheField[1]/x:fieldGroup/x:groupItems",
+"count", "45");
+// Group items must start with "<05/16/1958", then years sorted ascending, 
then ">06/11/2009"
+// They used to have years in the beginning, then "<05/16/1958", then 
">06/11/2009".
+// The "<" and ">" date strings are locale-dependent, so test depends on 
en_US locale
+assertXPath(
+pTable,
+
"/x:pivotCacheDefinition/x:cacheFields/x:cacheField[1]/x:fieldGroup/x:groupItems/x:s[1]",
+"v", "<05/16/1958");
+for (int i = 2; i <= 44; ++i)
+assertXPath(
+pTable,
+
"/x:pivotCacheDefinition/x:cacheFields/x:cacheField[1]/x:fieldGroup/x:groupItems/x:s["
++ OString::number(i) + "]",
+"v", OUString::number(1963 + i));
+assertXPath(
+pTable,
+
"/x:pivotCacheDefinition/x:cacheFields/x:cacheField[1]/x:fieldGroup/x:groupItems/x:s[45]",
+"v", ">06/11/2009");
+
+// Now check that table references these in correct order 
(document-dependent, so this is how
+// it should be in this specific testdoc which shows "<" and ">" values in 
the end)
+pTable = XPathHelper::parseExport(pXPathFile, m_xSFactory, 
"xl/pivotTables/pivotTable1.xml");
+CPPUNIT_ASSERT(pTable);
+assertXPath(pTable, 
"/x:pivotTableDefinition/x:pivotFields/x:pivotField[1]/x:items", "count",
+"46");
+const int vals[] = { 1,  2,  3,  4,  5,  6,  7,  8,  9,  10, 11, 12, 13, 
14, 15,
+ 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 
29, 30,
+ 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 
0,  44 };
+for (size_t i = 0; i < SAL_N_ELEMENTS(vals); ++i)
+{
+assertXPath(pTable,
+
"/x:pivotTableDefinition/x:pivotFields/x:pivotField[1]/x:items/x:item["
++ OString::number(i + 1) + "]",
+"x", OUString::number(vals[i]));
+}
+assertXPath(pTable, 
"/x:pivotTableDefinition/x:pivotFields/x:pivotField[1]/x:items/x:item[46]",
+"t", "default");
+}
+
 CPPUNIT_TEST_SUITE_REGISTRATION(ScPivotTableFiltersTest);
 
 CPPUNIT_PLUGIN_IMPLEMENT();
diff --git a/sc/source/filter/excel/xepivotxml.cxx 
b/sc/source/filter/excel/xepivotxml.cxx
index 8648f27e7539..694eee0469d3 100644
--- a/sc/source/filter/excel/xepivotxml.cxx
+++ b/sc/source/filter/excel/xepivotxml.cxx
@@ -197,7 +197,42 @@ OUString GetExcelFormattedDate( double fSerialDateTime, 
SvNumberFormatter& rForm
 ::sax::Converter::convertDateTime(sBuf, aUDateTime, nullptr, true);
 return sBuf.makeStringAndClear();
 }
+
+// Excel seems to expect different order of group item values; we need to 
rearrange elements
+// to output "date2" last.
+// Since 

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

2019-04-24 Thread Mike Kaganski (via logerrit)
 sc/qa/unit/subsequent_export-test.cxx |  104 --
 sc/source/filter/excel/xetable.cxx|   43 --
 sc/source/filter/inc/xetable.hxx  |9 +-
 3 files changed, 69 insertions(+), 87 deletions(-)

New commits:
commit 071d72cc3662168c58358ce53a77ceacbf80f545
Author: Mike Kaganski 
AuthorDate: Tue Apr 23 15:59:24 2019 +0300
Commit: Mike Kaganski 
CommitDate: Wed Apr 24 09:22:56 2019 +0200

tdf#124741: export default column width to XLSX

For some reason, we have never exported the default column width
to XLSX, although we have such export for XLS. This led to bugs
like tdf#100946. Workarounds applied to those bugs have made LO
to export columns which shouldn't have been exported, abusing
"customWidth" attribute in XclExpColinfo::XclExpColinfo depending
on if the column has size different from an app-global default;
after that, sheet-local default was determined, and then columns
which have mbCustomWidth set (i.e., different from app default),
as well as those different from sheet-local default, were stored.
Effectively, the hack had disabled the removal of defaults from
maColInfos in XclExpColinfoBuffer::Finalize. We even had unit
tests explicitly testing that we export those columns that Excel
skips. The effect of that is not only unnecessary data in the file;
the data was actually wrong (customWidth actually means that the
width was edited manually by user, even if equal to the default,
thus changing Excel handling of the column); and also Calc
initializes all columns to the right of last used column for such
a file. Only in case when app-global default happened to match
sheet-local one, columns would have properties allowing them to
be removed from maColInfos in the end of XclExpColinfoBuffer::Finalize,
which still resulted in problems similar to the workarounded one.

This patch implements proper export of the default column width
to XLSX, thus partially reverting changes made for tdf#100946 in
commit 40d892a2db4d750aaf0562c63004e693c028273c. Actually, our
export to XLSX does not depend on the 5-pixel correction (see
ECMA-376-1:2016 18.3.1.81), since the exported default depends
only on most-used column width. XclExpDefcolwidth implementation
was edited to only take the correction into account when exporting
to XLS (to keep status quo; it's clear that XLS widths export
and import implementation is incorrect: some empirical formula
is used in XclTools::GetXclDefColWidthCorrection, that was
introduced in commit 555d702903fb0857122024e1ab78a72d122d3f16 for
i#3006, that doesn't match any documentation, and changes widths
of columns in exported XLS - something to be fixed independently).

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

diff --git a/sc/qa/unit/subsequent_export-test.cxx 
b/sc/qa/unit/subsequent_export-test.cxx
index 57c4469355f7..23727d5b17c7 100644
--- a/sc/qa/unit/subsequent_export-test.cxx
+++ b/sc/qa/unit/subsequent_export-test.cxx
@@ -782,80 +782,60 @@ void ScExportTest::testCustomColumnWidthExportXLSX()
 xmlDocPtr pSheet = XPathHelper::parseExport(pXPathFile, m_xSFactory, 
"xl/worksheets/sheet1.xml");
 CPPUNIT_ASSERT(pSheet);
 
-// First column, has everything default (width in Calc: 1280)
+// tdf#124741: check that we export default width, otherwise the skipped 
columns would have
+// wrong width. Previously defaultColWidth attribute was missing
+double nDefWidth
+= getXPath(pSheet, "/x:worksheet/x:sheetFormatPr", 
"defaultColWidth").toDouble();
+CPPUNIT_ASSERT_DOUBLES_EQUAL(11.53515625, nDefWidth, 0.01);
+
+// First column, has everything default (width in Calc: 1280), skipped
+
+// Second column, has custom width (width in Calc: 1225)
 assertXPath(pSheet, "/x:worksheet/x:cols/x:col[1]", "hidden", "false");
 assertXPath(pSheet, "/x:worksheet/x:cols/x:col[1]", "outlineLevel", "0");
-assertXPath(pSheet, "/x:worksheet/x:cols/x:col[1]", "customWidth", 
"false");
+assertXPath(pSheet, "/x:worksheet/x:cols/x:col[1]", "customWidth", "true");
 assertXPath(pSheet, "/x:worksheet/x:cols/x:col[1]", "collapsed", "false");
-assertXPath(pSheet, "/x:worksheet/x:cols/x:col[1]", "min", "1");
-assertXPath(pSheet, "/x:worksheet/x:cols/x:col[1]", "max", "1");
+assertXPath(pSheet, "/x:worksheet/x:cols/x:col[1]", "min", "2");
+assertXPath(pSheet, "/x:worksheet/x:cols/x:col[1]", "max", "2");
 
-// Second column, has custom width (width in Calc: 1225)
-assertXPath(pSheet, "/x:worksheet/x:cols/x:col[2]", "hidden", "false");
+// Third column, has everything default (width in Calc: 1280), skipped
+
+// Fourth column has custom width. Columns from 4 to 7 are hidden
+assertXPath(pSheet, 

[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-6.0' - sc/qa sc/source

2019-04-24 Thread Mike Kaganski (via logerrit)
 sc/qa/unit/subsequent_export-test.cxx |  104 --
 sc/source/filter/excel/xetable.cxx|   43 --
 sc/source/filter/inc/xetable.hxx  |9 +-
 3 files changed, 69 insertions(+), 87 deletions(-)

New commits:
commit 225e10cda96b16479f45658817a22e2cbe72b82c
Author: Mike Kaganski 
AuthorDate: Tue Apr 23 15:59:24 2019 +0300
Commit: Mike Kaganski 
CommitDate: Wed Apr 24 10:23:14 2019 +0200

tdf#124741: export default column width to XLSX

For some reason, we have never exported the default column width
to XLSX, although we have such export for XLS. This led to bugs
like tdf#100946. Workarounds applied to those bugs have made LO
to export columns which shouldn't have been exported, abusing
"customWidth" attribute in XclExpColinfo::XclExpColinfo depending
on if the column has size different from an app-global default;
after that, sheet-local default was determined, and then columns
which have mbCustomWidth set (i.e., different from app default),
as well as those different from sheet-local default, were stored.
Effectively, the hack had disabled the removal of defaults from
maColInfos in XclExpColinfoBuffer::Finalize. We even had unit
tests explicitly testing that we export those columns that Excel
skips. The effect of that is not only unnecessary data in the file;
the data was actually wrong (customWidth actually means that the
width was edited manually by user, even if equal to the default,
thus changing Excel handling of the column); and also Calc
initializes all columns to the right of last used column for such
a file. Only in case when app-global default happened to match
sheet-local one, columns would have properties allowing them to
be removed from maColInfos in the end of XclExpColinfoBuffer::Finalize,
which still resulted in problems similar to the workarounded one.

This patch implements proper export of the default column width
to XLSX, thus partially reverting changes made for tdf#100946 in
commit 40d892a2db4d750aaf0562c63004e693c028273c. Actually, our
export to XLSX does not depend on the 5-pixel correction (see
ECMA-376-1:2016 18.3.1.81), since the exported default depends
only on most-used column width. XclExpDefcolwidth implementation
was edited to only take the correction into account when exporting
to XLS (to keep status quo; it's clear that XLS widths export
and import implementation is incorrect: some empirical formula
is used in XclTools::GetXclDefColWidthCorrection, that was
introduced in commit 555d702903fb0857122024e1ab78a72d122d3f16 for
i#3006, that doesn't match any documentation, and changes widths
of columns in exported XLS - something to be fixed independently).

Change-Id: I227aca17e56247cbb839444717066a898987c4f1
Reviewed-on: https://gerrit.libreoffice.org/71132
Reviewed-by: Mike Kaganski 
Tested-by: Mike Kaganski 
Reviewed-on: https://gerrit.libreoffice.org/71222

diff --git a/sc/qa/unit/subsequent_export-test.cxx 
b/sc/qa/unit/subsequent_export-test.cxx
index 787f3e43f13d..fd3b6c3eaa04 100644
--- a/sc/qa/unit/subsequent_export-test.cxx
+++ b/sc/qa/unit/subsequent_export-test.cxx
@@ -723,80 +723,60 @@ void ScExportTest::testCustomColumnWidthExportXLSX()
 xmlDocPtr pSheet = XPathHelper::parseExport(pXPathFile, m_xSFactory, 
"xl/worksheets/sheet1.xml");
 CPPUNIT_ASSERT(pSheet);
 
-// First column, has everything default (width in Calc: 1280)
+// tdf#124741: check that we export default width, otherwise the skipped 
columns would have
+// wrong width. Previously defaultColWidth attribute was missing
+double nDefWidth
+= getXPath(pSheet, "/x:worksheet/x:sheetFormatPr", 
"defaultColWidth").toDouble();
+CPPUNIT_ASSERT_DOUBLES_EQUAL(11.53515625, nDefWidth, 0.01);
+
+// First column, has everything default (width in Calc: 1280), skipped
+
+// Second column, has custom width (width in Calc: 1225)
 assertXPath(pSheet, "/x:worksheet/x:cols/x:col[1]", "hidden", "false");
 assertXPath(pSheet, "/x:worksheet/x:cols/x:col[1]", "outlineLevel", "0");
-assertXPath(pSheet, "/x:worksheet/x:cols/x:col[1]", "customWidth", 
"false");
+assertXPath(pSheet, "/x:worksheet/x:cols/x:col[1]", "customWidth", "true");
 assertXPath(pSheet, "/x:worksheet/x:cols/x:col[1]", "collapsed", "false");
-assertXPath(pSheet, "/x:worksheet/x:cols/x:col[1]", "min", "1");
-assertXPath(pSheet, "/x:worksheet/x:cols/x:col[1]", "max", "1");
+assertXPath(pSheet, "/x:worksheet/x:cols/x:col[1]", "min", "2");
+assertXPath(pSheet, "/x:worksheet/x:cols/x:col[1]", "max", "2");
 
-// Second column, has custom width (width in Calc: 1225)
-assertXPath(pSheet, "/x:worksheet/x:cols/x:col[2]", "hidden", "false");
+// Third column, has everything default (width in Calc: 1280), skipped
+
+// Fourth column has custom width. 

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

2019-04-24 Thread Mike Kaganski (via logerrit)
 sc/source/core/data/document.cxx |3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

New commits:
commit 230fa66d96d632287bbf06f257c00105293ef1a6
Author: Mike Kaganski 
AuthorDate: Wed Apr 24 13:40:03 2019 +0200
Commit: Mike Kaganski 
CommitDate: Wed Apr 24 13:41:45 2019 +0200

simplify condition (remove always true part)

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

diff --git a/sc/source/core/data/document.cxx b/sc/source/core/data/document.cxx
index d9cd4417f067..acc436a1b036 100644
--- a/sc/source/core/data/document.cxx
+++ b/sc/source/core/data/document.cxx
@@ -2570,8 +2570,7 @@ void ScDocument::SetClipParam(const ScClipParam& rParam)
 
 bool ScDocument::IsClipboardSource() const
 {
-if (bIsClip || mpShell == nullptr ||
-(mpShell && mpShell->IsLoading()))
+if (bIsClip || mpShell == nullptr || mpShell->IsLoading())
 return false;
 
 ScDocument* pClipDoc = ScModule::GetClipDoc();
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

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

2019-04-22 Thread Mike Kaganski (via logerrit)
 sc/qa/unit/pivottable_filters_test.cxx|   19 +++
 sc/source/filter/oox/pivottablebuffer.cxx |3 +++
 sc/source/ui/unoobj/dapiuno.cxx   |8 
 3 files changed, 30 insertions(+)

New commits:
commit 7f6a6664a1f3a37a97d02d5f0894300aff0d8db5
Author: Mike Kaganski 
AuthorDate: Mon Apr 22 14:56:07 2019 +0300
Commit: Mike Kaganski 
CommitDate: Mon Apr 22 15:56:31 2019 +0200

tdf#124883: don't drop data field names on import

The name attribute of dataField element was already read in
PivotTable::importDataField; and then it was ignored in
PivotTableField::convertDataField. ScDataPilotFieldObj had no
handler for name in its ScDataPilotFieldObj::[gs]etPropertyValue,
although it has [gs]etName for that - so this change puts pieces
together to allow to use the imported name correctly.

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

diff --git a/sc/qa/unit/pivottable_filters_test.cxx 
b/sc/qa/unit/pivottable_filters_test.cxx
index 9682b2a10131..222772b48866 100644
--- a/sc/qa/unit/pivottable_filters_test.cxx
+++ b/sc/qa/unit/pivottable_filters_test.cxx
@@ -90,6 +90,7 @@ public:
 void testTdf124736();
 void tesTtdf124772NumFmt();
 void testTdf124810();
+void testTdf124883();
 
 CPPUNIT_TEST_SUITE(ScPivotTableFiltersTest);
 
@@ -137,6 +138,7 @@ public:
 CPPUNIT_TEST(testTdf124736);
 CPPUNIT_TEST(tesTtdf124772NumFmt);
 CPPUNIT_TEST(testTdf124810);
+CPPUNIT_TEST(testTdf124883);
 
 CPPUNIT_TEST_SUITE_END();
 
@@ -2613,6 +2615,23 @@ void ScPivotTableFiltersTest::testTdf124810()
 }
 }
 
+void ScPivotTableFiltersTest::testTdf124883()
+{
+ScDocShellRef xDocSh = loadDoc("pivot-table/two-data-fields.", 
FORMAT_XLSX);
+CPPUNIT_ASSERT(xDocSh.is());
+
+xmlDocPtr pTable = XPathHelper::parseExport2(*this, *xDocSh, m_xSFactory,
+"xl/pivotTables/pivotTable1.xml", FORMAT_XLSX);
+xDocSh->DoClose();
+CPPUNIT_ASSERT(pTable);
+
+// The field names must be kept just as they appear in original XLSX
+assertXPath(pTable, "/x:pivotTableDefinition/x:dataFields/x:dataField[1]", 
"name",
+"Sum of Value");
+assertXPath(pTable, "/x:pivotTableDefinition/x:dataFields/x:dataField[2]", 
"name",
+"Count of Value2");
+}
+
 CPPUNIT_TEST_SUITE_REGISTRATION(ScPivotTableFiltersTest);
 
 CPPUNIT_PLUGIN_IMPLEMENT();
diff --git a/sc/source/filter/oox/pivottablebuffer.cxx 
b/sc/source/filter/oox/pivottablebuffer.cxx
index 772637feb674..8af348942bcd 100644
--- a/sc/source/filter/oox/pivottablebuffer.cxx
+++ b/sc/source/filter/oox/pivottablebuffer.cxx
@@ -577,6 +577,9 @@ void PivotTableField::convertDataField( const 
PTDataFieldModel& rDataField )
 // field orientation
 aPropSet.setProperty( PROP_Orientation, DataPilotFieldOrientation_DATA 
);
 
+if (!rDataField.maName.isEmpty())
+aPropSet.setProperty(PROP_Name, rDataField.maName);
+
 /*  Field aggregation function. Documentation is a little bit confused
 about which names to use for the count functions. The name 'count'
 means 'count all', and 'countNum' means 'count numbers'. On the
diff --git a/sc/source/ui/unoobj/dapiuno.cxx b/sc/source/ui/unoobj/dapiuno.cxx
index ab921ea659b5..0f3fa929ef4a 100644
--- a/sc/source/ui/unoobj/dapiuno.cxx
+++ b/sc/source/ui/unoobj/dapiuno.cxx
@@ -1910,6 +1910,12 @@ void SAL_CALL ScDataPilotFieldObj::setPropertyValue( 
const OUString& aPropertyNa
 {
 setRepeatItemLabels(cppu::any2bool(aValue));
 }
+else if (aPropertyName == SC_UNONAME_NAME)
+{
+OUString sName;
+if (aValue >>= sName)
+setName(sName);
+}
 }
 
 Any SAL_CALL ScDataPilotFieldObj::getPropertyValue( const OUString& 
aPropertyName )
@@ -1999,6 +2005,8 @@ Any SAL_CALL ScDataPilotFieldObj::getPropertyValue( const 
OUString& aPropertyNam
 aRet <<= getShowEmpty();
 else if ( aPropertyName == SC_UNONAME_REPEATITEMLABELS )
 aRet <<= getRepeatItemLabels();
+else if (aPropertyName == SC_UNONAME_NAME)
+aRet <<= getName();
 
 return aRet;
 }
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-6.0' - sc/inc sc/qa sc/source

2019-04-22 Thread Mike Kaganski (via logerrit)
 sc/inc/dputil.hxx  |4 ++--
 sc/qa/unit/pivottable_filters_test.cxx |3 ++-
 sc/source/filter/excel/xepivotxml.cxx  |8 ++--
 3 files changed, 10 insertions(+), 5 deletions(-)

New commits:
commit 7d73c3b82c795b0fa13507054786f1a4a03fafa7
Author: Mike Kaganski 
AuthorDate: Mon Apr 22 12:16:38 2019 +0300
Commit: Mike Kaganski 
CommitDate: Mon Apr 22 16:03:38 2019 +0200

tdf#124881: Provide a non-empty name for pivot table's data field

Otherwise, the empty string is used by Excel, so the field arrives
unnamed, disappearing from pivot table's cells upon refresh, etc.

Change-Id: I2e0f9fad2d766829f2b06425bec24ff182e3a869
Reviewed-on: https://gerrit.libreoffice.org/71065
Tested-by: Jenkins
Reviewed-by: Mike Kaganski 
Reviewed-on: https://gerrit.libreoffice.org/71067
Tested-by: Mike Kaganski 

diff --git a/sc/inc/dputil.hxx b/sc/inc/dputil.hxx
index 6d76441da6f9..76cfd2ced7c9 100644
--- a/sc/inc/dputil.hxx
+++ b/sc/inc/dputil.hxx
@@ -49,9 +49,9 @@ public:
 double fValue, const ScDPNumGroupInfo* pInfo, sal_Int32 nDatePart,
 SvNumberFormatter* pFormatter);
 
-static OUString getDisplayedMeasureName(const OUString& rName, 
ScSubTotalFunc eFunc);
+SC_DLLPUBLIC static OUString getDisplayedMeasureName(const OUString& 
rName, ScSubTotalFunc eFunc);
 
-static ScSubTotalFunc toSubTotalFunc(ScGeneralFunction eGenFunc);
+SC_DLLPUBLIC static ScSubTotalFunc toSubTotalFunc(ScGeneralFunction 
eGenFunc);
 };
 
 #endif
diff --git a/sc/qa/unit/pivottable_filters_test.cxx 
b/sc/qa/unit/pivottable_filters_test.cxx
index bd44a8fc4282..42d3d87a6e57 100644
--- a/sc/qa/unit/pivottable_filters_test.cxx
+++ b/sc/qa/unit/pivottable_filters_test.cxx
@@ -2480,7 +2480,8 @@ void ScPivotTableFiltersTest::testTdf124651()
 CPPUNIT_ASSERT(pDoc);
 // We have to export name attribute, even though it's optional according 
to ECMA-376 standard,
 // because Excel (at least 2016) seems to require it.
-assertXPath(pDoc, "/x:pivotTableDefinition/x:dataFields/x:dataField", 
"name", "");
+// tdf#124881: this shouldn't be an empty string
+assertXPath(pDoc, "/x:pivotTableDefinition/x:dataFields/x:dataField", 
"name", "Sum - num");
 }
 
 void ScPivotTableFiltersTest::testTdf124736()
diff --git a/sc/source/filter/excel/xepivotxml.cxx 
b/sc/source/filter/excel/xepivotxml.cxx
index 5c3ff71da8a2..332c2ff2d8e3 100644
--- a/sc/source/filter/excel/xepivotxml.cxx
+++ b/sc/source/filter/excel/xepivotxml.cxx
@@ -1136,8 +1136,12 @@ void XclExpXmlPivotTables::SavePivotTableXml( 
XclExpXmlStream& rStrm, const ScDP
 const OUString* pName = rDim.GetLayoutName();
 // tdf#124651: despite being optional in CT_DataField according to 
ECMA-376 Part 1,
 // Excel (at least 2016) seems to insist on the presence of "name" 
attribute in
-// dataField element, even if empty
-const OString sName = pName ? XclXmlUtils::ToOString(*pName) : "";
+// dataField element.
+// tdf#124881: try to create a meaningful name; don't use empty 
string.
+const OString sName = XclXmlUtils::ToOString(
+pName ? *pName
+  : ScDPUtil::getDisplayedMeasureName(
+rDim.GetName(), 
ScDPUtil::toSubTotalFunc(rDim.GetFunction(;
 auto pItemAttList = 
sax_fastparser::FastSerializerHelper::createAttrList();
 pItemAttList->add(XML_name, sName);
 pItemAttList->add(XML_fld, OString::number(nDimIdx));
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-6.0' - sc/qa sc/source

2019-04-22 Thread Mike Kaganski (via logerrit)
 sc/qa/unit/pivottable_filters_test.cxx|   22 ++
 sc/source/filter/oox/pivottablebuffer.cxx |3 +++
 sc/source/ui/unoobj/dapiuno.cxx   |8 
 3 files changed, 33 insertions(+)

New commits:
commit cdf7363d2fc371f16153365ed607e611bf1556db
Author: Mike Kaganski 
AuthorDate: Mon Apr 22 14:56:07 2019 +0300
Commit: Mike Kaganski 
CommitDate: Mon Apr 22 18:02:03 2019 +0200

tdf#124883: don't drop data field names on import

The name attribute of dataField element was already read in
PivotTable::importDataField; and then it was ignored in
PivotTableField::convertDataField. ScDataPilotFieldObj had no
handler for name in its ScDataPilotFieldObj::[gs]etPropertyValue,
although it has [gs]etName for that - so this change puts pieces
together to allow to use the imported name correctly.

Reviewed-on: https://gerrit.libreoffice.org/71068
Tested-by: Jenkins
Reviewed-by: Mike Kaganski 
(cherry picked from commit 7f6a6664a1f3a37a97d02d5f0894300aff0d8db5)

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

diff --git a/sc/qa/unit/pivottable_filters_test.cxx 
b/sc/qa/unit/pivottable_filters_test.cxx
index 42d3d87a6e57..3684497ca39a 100644
--- a/sc/qa/unit/pivottable_filters_test.cxx
+++ b/sc/qa/unit/pivottable_filters_test.cxx
@@ -93,6 +93,7 @@ public:
 void testTdf124736();
 void tesTtdf124772NumFmt();
 void testTdf124810();
+void testTdf124883();
 
 CPPUNIT_TEST_SUITE(ScPivotTableFiltersTest);
 
@@ -140,6 +141,7 @@ public:
 CPPUNIT_TEST(testTdf124736);
 CPPUNIT_TEST(tesTtdf124772NumFmt);
 CPPUNIT_TEST(testTdf124810);
+CPPUNIT_TEST(testTdf124883);
 
 CPPUNIT_TEST_SUITE_END();
 
@@ -2614,6 +2616,26 @@ void ScPivotTableFiltersTest::testTdf124810()
 }
 }
 
+void ScPivotTableFiltersTest::testTdf124883()
+{
+ScDocShellRef xDocSh = loadDoc("pivot-table/two-data-fields.", 
FORMAT_XLSX);
+CPPUNIT_ASSERT(xDocSh.is());
+
+std::shared_ptr pXPathFile
+= ScBootstrapFixture::exportTo(xDocSh.get(), FORMAT_XLSX);
+xDocSh->DoClose();
+
+xmlDocPtr pTable
+= XPathHelper::parseExport(pXPathFile, m_xSFactory, 
"xl/pivotTables/pivotTable1.xml");
+CPPUNIT_ASSERT(pTable);
+
+// The field names must be kept just as they appear in original XLSX
+assertXPath(pTable, "/x:pivotTableDefinition/x:dataFields/x:dataField[1]", 
"name",
+"Sum of Value");
+assertXPath(pTable, "/x:pivotTableDefinition/x:dataFields/x:dataField[2]", 
"name",
+"Count of Value2");
+}
+
 CPPUNIT_TEST_SUITE_REGISTRATION(ScPivotTableFiltersTest);
 
 CPPUNIT_PLUGIN_IMPLEMENT();
diff --git a/sc/source/filter/oox/pivottablebuffer.cxx 
b/sc/source/filter/oox/pivottablebuffer.cxx
index fa54a0e59330..a3b47b4b3a11 100644
--- a/sc/source/filter/oox/pivottablebuffer.cxx
+++ b/sc/source/filter/oox/pivottablebuffer.cxx
@@ -572,6 +572,9 @@ void PivotTableField::convertDataField( const 
PTDataFieldModel& rDataField )
 // field orientation
 aPropSet.setProperty( PROP_Orientation, DataPilotFieldOrientation_DATA 
);
 
+if (!rDataField.maName.isEmpty())
+aPropSet.setProperty(PROP_Name, rDataField.maName);
+
 /*  Field aggregation function. Documentation is a little bit confused
 about which names to use for the count functions. The name 'count'
 means 'count all', and 'countNum' means 'count numbers'. On the
diff --git a/sc/source/ui/unoobj/dapiuno.cxx b/sc/source/ui/unoobj/dapiuno.cxx
index 5522e9555970..857cc8c36f04 100644
--- a/sc/source/ui/unoobj/dapiuno.cxx
+++ b/sc/source/ui/unoobj/dapiuno.cxx
@@ -1922,6 +1922,12 @@ void SAL_CALL ScDataPilotFieldObj::setPropertyValue( 
const OUString& aPropertyNa
 {
 setRepeatItemLabels(cppu::any2bool(aValue));
 }
+else if (aPropertyName == SC_UNONAME_NAME)
+{
+OUString sName;
+if (aValue >>= sName)
+setName(sName);
+}
 }
 
 Any SAL_CALL ScDataPilotFieldObj::getPropertyValue( const OUString& 
aPropertyName )
@@ -2011,6 +2017,8 @@ Any SAL_CALL ScDataPilotFieldObj::getPropertyValue( const 
OUString& aPropertyNam
 aRet <<= getShowEmpty();
 else if ( aPropertyName == SC_UNONAME_REPEATITEMLABELS )
 aRet <<= getRepeatItemLabels();
+else if (aPropertyName == SC_UNONAME_NAME)
+aRet <<= getName();
 
 return aRet;
 }
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

[Libreoffice-commits] core.git: comphelper/CppunitTest_comphelper_test.mk comphelper/qa

2019-04-26 Thread Mike Kaganski (via logerrit)
 comphelper/CppunitTest_comphelper_test.mk |1 
 comphelper/qa/unit/test_guards.cxx|   57 ++
 2 files changed, 58 insertions(+)

New commits:
commit 6ec6d013227e66156e00c1d5ac9d0d2ddd208fae
Author: Mike Kaganski 
AuthorDate: Fri Apr 26 13:29:28 2019 +0300
Commit: Mike Kaganski 
CommitDate: Fri Apr 26 15:33:55 2019 +0200

Add a unit test for comphelper's guards

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

diff --git a/comphelper/CppunitTest_comphelper_test.mk 
b/comphelper/CppunitTest_comphelper_test.mk
index 20503e65bd06..8bb335aa24dc 100644
--- a/comphelper/CppunitTest_comphelper_test.mk
+++ b/comphelper/CppunitTest_comphelper_test.mk
@@ -15,6 +15,7 @@ $(eval $(call 
gb_CppunitTest_add_exception_objects,comphelper_test, \
 comphelper/qa/unit/test_hash \
 comphelper/qa/unit/base64_test \
 comphelper/qa/unit/types_test \
+comphelper/qa/unit/test_guards \
 ))
 
 $(eval $(call gb_CppunitTest_use_sdk_api,comphelper_test))
diff --git a/comphelper/qa/unit/test_guards.cxx 
b/comphelper/qa/unit/test_guards.cxx
new file mode 100644
index ..39d8f80e0c68
--- /dev/null
+++ b/comphelper/qa/unit/test_guards.cxx
@@ -0,0 +1,57 @@
+/* -*- 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/.
+ */
+
+#include 
+#include 
+#include 
+
+CPPUNIT_TEST_FIXTURE(CppUnit::TestFixture, test_comphelperGuards)
+{
+bool bFlag = true;
+{
+// Test that comphelper::ScopeGuard executes its parameter on 
destruction
+comphelper::ScopeGuard aGuard([] { bFlag = false; });
+CPPUNIT_ASSERT(bFlag);
+}
+CPPUNIT_ASSERT(!bFlag);
+
+{
+// Test that comphelper::FlagGuard properly sets and resets the flag
+comphelper::FlagGuard aGuard(bFlag);
+CPPUNIT_ASSERT(bFlag);
+}
+CPPUNIT_ASSERT(!bFlag);
+
+bFlag = true;
+{
+// Test that comphelper::FlagGuard properly sets and resets the flag
+comphelper::FlagGuard aGuard(bFlag);
+CPPUNIT_ASSERT(bFlag);
+}
+// comphelper::FlagGuard must reset flag to false on destruction 
unconditionally
+CPPUNIT_ASSERT(!bFlag);
+
+{
+// Test that comphelper::FlagRestorationGuard properly sets and resets 
the flag
+comphelper::FlagRestorationGuard aGuard(bFlag, true);
+CPPUNIT_ASSERT(bFlag);
+}
+CPPUNIT_ASSERT(!bFlag);
+
+bFlag = true;
+{
+// Test that comphelper::FlagRestorationGuard properly sets and resets 
the flag
+comphelper::FlagRestorationGuard aGuard(bFlag, false);
+CPPUNIT_ASSERT(!bFlag);
+}
+// comphelper::FlagGuard must reset flag to initial state on destruction
+CPPUNIT_ASSERT(bFlag);
+}
+
+/* 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: Branch 'distro/collabora/cp-6.2' - shell/inc shell/source

2019-06-27 Thread Mike Kaganski (via logerrit)
 shell/inc/spsupp/registrar.hpp   |   21 +---
 shell/source/win32/spsupp/registrar.cxx  |   51 ---
 shell/source/win32/spsupp/spsuppServ.cxx |   20 
 3 files changed, 64 insertions(+), 28 deletions(-)

New commits:
commit 04146296b204da35c01420844930ae0c58fc8c89
Author: Mike Kaganski 
AuthorDate: Thu Jun 27 14:46:36 2019 +1000
Commit: Mike Kaganski 
CommitDate: Thu Jun 27 10:55:49 2019 +0200

Register versions from 1 to 5 for SharePoint OpenDocuments object

This is required fro two reasons:
1. For our custom LOSPSupport.OpenDocuments, it allows SharePoint site's
js code to properly find out the supported methods of the object.
Previously we only registered v.1 for it, and that made SharePoint to
assume that only older subset of methods is supported.
2. For SharePoint.OpenDocuments, which is used to register MS component
to point to our implementation, leaving out v.4 and v.5 made problems on
systems with co-existing MS Office; leftover registration of v.4 and v.5
resulted in mixed results: when opened from web view, documents used MS
ActiveX, while for documents opened from list view in SharePoint, our
ActiveX was used. Registering all versions produces consistent results.

Change-Id: I7e8d4216cce1708e676c834a465654751f079c89
Reviewed-on: https://gerrit.libreoffice.org/74776
Tested-by: Jenkins
Reviewed-by: Mike Kaganski 
(cherry picked from commit b8ecabc07a04537a1d1f317c83556e9d58abd318)
Reviewed-on: https://gerrit.libreoffice.org/74779
Tested-by: Mike Kaganski 

diff --git a/shell/inc/spsupp/registrar.hpp b/shell/inc/spsupp/registrar.hpp
index b055ac8b0d42..920e076de97c 100644
--- a/shell/inc/spsupp/registrar.hpp
+++ b/shell/inc/spsupp/registrar.hpp
@@ -10,6 +10,8 @@
 #ifndef INCLUDED_SHELL_INC_SPSUPP_REGISTRAR_H
 #define INCLUDED_SHELL_INC_SPSUPP_REGISTRAR_H
 
+#include 
+
 #if !defined WIN32_LEAN_AND_MEAN
 # define WIN32_LEAN_AND_MEAN
 #endif
@@ -18,16 +20,25 @@
 class Registrar {
 public:
 explicit Registrar(REFIID riidCLSID);
+// First version in list becomes default
 HRESULT RegisterObject(REFIID riidTypeLib,
const wchar_t* sProgram,
const wchar_t* sComponent,
-   int nVersion,
-   const wchar_t* Path,
+   std::initializer_list aVersions,
+   const wchar_t* Path);
+HRESULT UnRegisterObject(const wchar_t* sProgram, const wchar_t* 
sComponent,
+ std::initializer_list aVersions);
+// First version in list becomes the default
+HRESULT RegisterProgIDs(const wchar_t* sProgram, const wchar_t* sComponent,
+std::initializer_list aVersions);
+HRESULT UnRegisterProgIDs(const wchar_t* sProgram, const wchar_t* 
sComponent,
+  std::initializer_list aVersions);
+
+private:
+HRESULT RegisterProgID(const wchar_t* sProgram, const wchar_t* sComponent, 
int nVersion,
bool bSetDefault);
-HRESULT UnRegisterObject(const wchar_t* sProgram, const wchar_t* 
sComponent, int nVersion);
-HRESULT RegisterProgID(const wchar_t* sProgram, const wchar_t* sComponent, 
int nVersion, bool bSetDefault);
 HRESULT UnRegisterProgID(const wchar_t* sProgram, const wchar_t* 
sComponent, int nVersion);
-private:
+
 static const size_t nGUIDlen = 40;
 wchar_t m_sCLSID[nGUIDlen];
 HRESULT m_ConstructionResult;
diff --git a/shell/source/win32/spsupp/registrar.cxx 
b/shell/source/win32/spsupp/registrar.cxx
index 7c3bbb881612..008c2ac59c82 100644
--- a/shell/source/win32/spsupp/registrar.cxx
+++ b/shell/source/win32/spsupp/registrar.cxx
@@ -76,7 +76,7 @@ namespace {
 return HRESULT_FROM_WIN32(iRetVal);
 }
 
-}
+} // namespace
 
 // see http://stackoverflow.com/questions/284619
 // see https://msdn.microsoft.com/en-us/library/ms691424
@@ -88,12 +88,9 @@ Registrar::Registrar(REFIID riidCLSID)
 E_UNEXPECTED: S_OK;
 }
 
-HRESULT Registrar::RegisterObject(REFIID riidTypeLib,
-   const wchar_t* sProgram,
-   const wchar_t* sComponent,
-   int nVersion,
-   const wchar_t* Path,
-   bool bSetDefault)
+HRESULT Registrar::RegisterObject(REFIID riidTypeLib, const wchar_t* sProgram,
+  const wchar_t* sComponent, 
std::initializer_list aVersions,
+  const wchar_t* Path)
 {
 if (!wcslen(sComponent) || !wcslen(sProgram))
 return E_INVALIDARG;
@@ -167,15 +164,16 @@ HRESULT Registrar::RegisterObject(REFIID riidTypeLib,
 }
 
 // ProgID
-return RegisterProgID(sProgram, sComponent, nVersion, bSetDefault);
+return RegisterProgIDs(sProgram, sComponent, aVersions);
 }
 
-HRESULT 

[Libreoffice-commits] core.git: configure.ac

2019-07-01 Thread Mike Kaganski (via logerrit)
 configure.ac |   30 --
 1 file changed, 24 insertions(+), 6 deletions(-)

New commits:
commit 19724cb7f886cbcc60cd8a1f5e6eda6fdca41155
Author: Mike Kaganski 
AuthorDate: Mon Jul 1 17:55:34 2019 +1000
Commit: Mike Kaganski 
CommitDate: Tue Jul 2 02:54:39 2019 +0200

Improve pathmunge to properly detect/cleanup duplicates

E.g. on Windows, I see three duplicated paths in the resulting PATH,
so this aims to make PATH tidy.

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

diff --git a/configure.ac b/configure.ac
index f7683b0350e8..3aefd18cd107 100644
--- a/configure.ac
+++ b/configure.ac
@@ -2367,6 +2367,26 @@ if test "$libo_fuzzed_enable_dbus" = yes -a 
"$libo_fuzzed_enable_avahi" -a \
 enable_avahi=$enable_dbus
 fi
 
+add_lopath_after ()
+{
+if ! echo "$LO_PATH" | $EGREP -q "(^|${P_SEP})$1($|${P_SEP})"; then
+LO_PATH="${LO_PATH:+$LO_PATH$P_SEP}$1"
+fi
+}
+
+add_lopath_before ()
+{
+local IFS=${P_SEP}
+local path_cleanup
+local dir
+for dir in $LO_PATH ; do
+if test "$dir" != "$1" ; then
+path_cleanup=${path_cleanup:+$path_cleanup$P_SEP}$dir
+fi
+done
+LO_PATH="$1${path_cleanup:+$P_SEP$path_cleanup}"
+}
+
 dnl ===
 dnl check for required programs (grep, awk, sed, bash)
 dnl ===
@@ -2385,12 +2405,10 @@ pathmunge ()
 else
 new_path="$1"
 fi
-if ! echo "$LO_PATH" | $EGREP -q "(^|:)$1($|:)"; then
-if test "$2" = "after"; then
-LO_PATH="$LO_PATH${P_SEP}$new_path"
-else
-LO_PATH="$new_path${P_SEP}$LO_PATH"
-fi
+if test "$2" = "after"; then
+add_lopath_after "$new_path"
+else
+add_lopath_before "$new_path"
 fi
 unset new_path
 fi
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

[Libreoffice-commits] core.git: configure.ac

2019-07-01 Thread Mike Kaganski (via logerrit)
 configure.ac |   82 +++
 1 file changed, 32 insertions(+), 50 deletions(-)

New commits:
commit 81ab6abe574a75f1ed229a88ceee9eb3b143a18a
Author: Mike Kaganski 
AuthorDate: Tue Jul 2 00:03:57 2019 +1000
Commit: Mike Kaganski 
CommitDate: Tue Jul 2 03:06:13 2019 +0200

Use tools for proper architecture for both x64 and x86 builds

This allows to use 64-bit tools on x64 hosts for all modules,
both 32- and 64-bit, and so avoid memory problems, like in
https://ci.libreoffice.org/job/gerrit_windows/39174/console

LINK : the 32-bit linker 
(C:\PROGRA~2\MIB055~1\2017\COMMUN~1\VC\Tools\MSVC\1414~1.264\bin\HostX86\x86\link.exe)
 failed to do memory mapped file I/O on `out\zlib.lib' and is going to restart 
linking with a 64-bit linker for better throughput
LINK : restarting link with 64-bit linker `C:/cygwin/bin\link.exe'

where it then picks wrong linker, failing the build.

Also, it theoretically allows using 32-bit tools when building on
32-bit host, and build both 32- and 64-bit modules (no idea if it
is actually possible though).

Removed checks for tools locations from older VS versions.

Change-Id: I4798a1c66df580027243ca8c7b4d375148214984
Co-authored-by: Jan-Marek Glogowski 
Reviewed-on: https://gerrit.libreoffice.org/74924
Reviewed-by: Mike Kaganski 
Tested-by: Mike Kaganski 

diff --git a/configure.ac b/configure.ac
index 3aefd18cd107..b73d0b73f644 100644
--- a/configure.ac
+++ b/configure.ac
@@ -3372,20 +3372,16 @@ if test "$_os" = "WINNT"; then
 fi
 
 if test "$BITNESS_OVERRIDE" = ""; then
-if test -f "$vctest/bin/cl.exe"; then
-VC_PRODUCT_DIR=$vctest
-elif test -f 
"$vctest/VC/Tools/MSVC/$vcbuildnumber/bin/HostX86/x86/cl.exe"; then
+if test -f 
"$vctest/VC/Tools/MSVC/$vcbuildnumber/bin/HostX86/x86/cl.exe"; then
 VC_PRODUCT_DIR=$vctest/VC
 else
-AC_MSG_ERROR([No compiler (cl.exe) in $vctest/bin/cl.exe])
+AC_MSG_ERROR([No compiler (cl.exe) in 
$vctest/VC/Tools/MSVC/$vcbuildnumber/bin/HostX86/x86])
 fi
 else
-if test -f "$vctest/bin/amd64/cl.exe"; then
-VC_PRODUCT_DIR=$vctest
-elif test -f 
"$vctest/VC/Tools/MSVC/$vcbuildnumber/bin/HostX64/x64/cl.exe"; then
+if test -f 
"$vctest/VC/Tools/MSVC/$vcbuildnumber/bin/HostX64/x64/cl.exe"; then
 VC_PRODUCT_DIR=$vctest/VC
 else
-AC_MSG_ERROR([No compiler (cl.exe) in 
$vctest/VC/Tools/MSVC/$vcbuildnumber/bin/HostX64/x64/cl.exe or 
$vctest/bin/amd64/cl.exe or $vctest/bin/x86_amd64/cl.exe])
+AC_MSG_ERROR([No compiler (cl.exe) in 
$vctest/VC/Tools/MSVC/$vcbuildnumber/bin/HostX64/x64])
 fi
 fi
 
@@ -3448,16 +3444,22 @@ if test "$_os" = "WINNT"; then
 dnl  Check for the corresponding mspdb*.dll
 dnl ===
 
+VC_HOST_DIR=
 MSPDB_PATH=
-CL_DIR=
-CL_LIB=
+CL_PATH=
+
+if "$VC_PRODUCT_DIR/Tools/MSVC/$vcbuildnumber/bin/HostX64/x64/cl.exe" -? 
/dev/null 2>&1; then
+VC_HOST_DIR="HostX64"
+
MSPDB_PATH="$VC_PRODUCT_DIR/Tools/MSVC/$vcbuildnumber/bin/$VC_HOST_DIR/x64"
+else
+VC_HOST_DIR="HostX86"
+
MSPDB_PATH="$VC_PRODUCT_DIR/Tools/MSVC/$vcbuildnumber/bin/$VC_HOST_DIR/x86"
+fi
 
 if test "$BITNESS_OVERRIDE" = ""; then
-MSPDB_PATH="$VC_PRODUCT_DIR/Tools/MSVC/$vcbuildnumber/bin/HostX86/x86"
-CL_DIR=Tools/MSVC/$vcbuildnumber/bin/HostX86/x86
+
CL_PATH="$VC_PRODUCT_DIR/Tools/MSVC/$vcbuildnumber/bin/$VC_HOST_DIR/x86"
 else
-MSPDB_PATH="$VC_PRODUCT_DIR/Tools/MSVC/$vcbuildnumber/bin/HostX64/x64"
-CL_DIR=Tools/MSVC/$vcbuildnumber/bin/HostX64/x64
+
CL_PATH="$VC_PRODUCT_DIR/Tools/MSVC/$vcbuildnumber/bin/$VC_HOST_DIR/x64"
 fi
 
 # MSVC 15.0 has libraries from 14.0?
@@ -3467,11 +3469,9 @@ if test "$_os" = "WINNT"; then
 AC_MSG_ERROR([No mspdb${mspdbnum}.dll in $MSPDB_PATH, Visual Studio 
installation broken?])
 fi
 
-MSPDB_PATH=`cygpath -d "$MSPDB_PATH"`
-MSPDB_PATH=`cygpath -u "$MSPDB_PATH"`
-
 dnl The path needs to be added before cl is called
-PATH="$MSPDB_PATH:$PATH"
+TEMP_PATH=`cygpath -d "$MSPDB_PATH"`
+PATH="`cygpath -u "$TEMP_PATH"`:$PATH"
 
 AC_MSG_CHECKING([cl.exe])
 
@@ -3483,8 +3483,8 @@ if test "$_os" = "WINNT"; then
 dnl Save the true MSVC cl.exe for use when CC/CXX is actually clang-cl,
 dnl needed when building CLR code:
 if test -z "$MSVC_CXX"; then
-if test -f "$VC_PRODUCT_DIR/$CL_DIR/cl.exe"; then
-MSVC_CXX="$VC_PRODUCT_DIR/$CL_DIR/cl.exe"
+if test -f "$CL_PATH/cl.exe"; then
+MSVC_CXX="$CL_PATH/cl.exe"
 fi
 
 # This gives us a posix path with 8.3 filename restrictions
@@ -3574,22 +3574,11 @@ if test "$_os" = "WINNT"; then
 
 if test 

[Libreoffice-commits] core.git: configure.ac

2019-07-01 Thread Mike Kaganski (via logerrit)
 configure.ac |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit b1d90b52b325a90fd877aaf440ef9da83b73ea60
Author: Mike Kaganski 
AuthorDate: Tue Jul 2 14:22:55 2019 +1000
Commit: Mike Kaganski 
CommitDate: Tue Jul 2 06:25:31 2019 +0200

Fix typo after commit 81ab6abe574a75f1ed229a88ceee9eb3b143a18a

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

diff --git a/configure.ac b/configure.ac
index b73d0b73f644..22f6bf110b8c 100644
--- a/configure.ac
+++ b/configure.ac
@@ -3607,7 +3607,7 @@ if test "$_os" = "WINNT"; then
 AC_MSG_RESULT([preset])
 elif 
"$VC_PRODUCT_DIR/Tools/MSVC/$vcbuildnumber/bin/$VC_HOST_DIR/x86/cl.exe" -? 
/dev/null 2>&1; then
 BUILD_X86=TRUE
-CXX_X86_BINARY=`win_short_path_for_make 
"$VC_PRODUCT_DIR/Tools/MSVC/$vcbuildnumber/bin/VC_HOST_DIR/x86/cl.exe"`
+CXX_X86_BINARY=`win_short_path_for_make 
"$VC_PRODUCT_DIR/Tools/MSVC/$vcbuildnumber/bin/$VC_HOST_DIR/x86/cl.exe"`
 CXX_X86_BINARY+=" /arch:SSE"
 AC_MSG_RESULT([found])
 else
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

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

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

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

Optimize cppu::supportsService to use const methods of Sequence

... and standard algorithm instead of loop.

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

diff --git a/cppuhelper/source/supportsservice.cxx 
b/cppuhelper/source/supportsservice.cxx
index 629981310354..eea82602a2ef 100644
--- a/cppuhelper/source/supportsservice.cxx
+++ b/cppuhelper/source/supportsservice.cxx
@@ -9,6 +9,7 @@
 
 #include 
 
+#include 
 #include 
 
 #include 
@@ -21,14 +22,9 @@ bool cppu::supportsService(
 css::lang::XServiceInfo * implementation, OUString const & name)
 {
 assert(implementation != nullptr);
-css::uno::Sequence< OUString > s(
+const css::uno::Sequence< OUString > s(
 implementation->getSupportedServiceNames());
-for (sal_Int32 i = 0; i != s.getLength(); ++i) {
-if (s[i] == name) {
-return true;
-}
-}
-return false;
+return std::find(s.begin(), s.end(), name) != s.end();
 }
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

[Libreoffice-commits] core.git: Branch 'libreoffice-6-3' - cui/source include/editeng sw/source

2019-08-14 Thread Mike Kaganski (via logerrit)
 cui/source/tabpages/border.cxx|2 +-
 include/editeng/editids.hrc   |1 +
 sw/source/core/bastyp/init.cxx|2 +-
 sw/source/uibase/utlui/uitool.cxx |   21 -
 4 files changed, 19 insertions(+), 7 deletions(-)

New commits:
commit 1b9d52949239f0dd2e982ae986dcb812085eee03
Author: Mike Kaganski 
AuthorDate: Mon Aug 5 14:36:19 2019 +0300
Commit: Miklos Vajna 
CommitDate: Wed Aug 14 09:29:43 2019 +0200

tdf#126684: store "DialogUseCharAttr" in RES_PARATR_GRABBAG

... because RES_CHRATR_GRABBAG value may be later reset by initial
value read from char format, when it's present there.
OTOH, RES_PARATR_GRABBAG shouldn't be present in character format,
so it should be safe to pass the grabbag item there.

Regression after commit 074fc4a1499aac6eb67cd0b2dca00a51071cff0e.

Change-Id: Iebbee04929714d6a3fb72274a211699b2a80b3d2
Reviewed-on: https://gerrit.libreoffice.org/76981
Reviewed-by: Mike Kaganski 
Tested-by: Mike Kaganski 
(cherry picked from commit 30d03b495f437e9b2edbb0f8ceebe3020ba7459c)
Reviewed-on: https://gerrit.libreoffice.org/77016
Tested-by: Jenkins
Reviewed-by: Miklos Vajna 

diff --git a/cui/source/tabpages/border.cxx b/cui/source/tabpages/border.cxx
index a0449ef7379c..5777a0e3c1cc 100644
--- a/cui/source/tabpages/border.cxx
+++ b/cui/source/tabpages/border.cxx
@@ -489,7 +489,7 @@ SvxBorderTabPage::SvxBorderTabPage(TabPageParent pParent, 
const SfxItemSet& rCor
 FillLineListBox_Impl();
 
 // connections
-if (rCoreAttrs.HasItem(GetWhich(SID_ATTR_CHAR_GRABBAG), ))
+if (rCoreAttrs.HasItem(GetWhich(SID_ATTR_PARA_GRABBAG), ))
 {
 const SfxGrabBagItem* pGrabBag = static_cast(pItem);
 auto it = pGrabBag->GetGrabBag().find("DialogUseCharAttr");
diff --git a/include/editeng/editids.hrc b/include/editeng/editids.hrc
index 0afd36701129..129afc52234e 100644
--- a/include/editeng/editids.hrc
+++ b/include/editeng/editids.hrc
@@ -135,6 +135,7 @@
 #define SID_ATTR_CHAR_ENDPREVIEW_FONT   ( SID_EDIT_START + 75 )
 #define SID_ATTR_CHAR_BOX   ( SID_EDIT_START + 76 )
 #define SID_ATTR_CHAR_SHADOW( SID_EDIT_START + 77 )
+#define SID_ATTR_PARA_GRABBAG   ( SID_EDIT_START + 78 )
 
 
 #if 95 > (SID_EDIT_END-SID_EDIT_START)
diff --git a/sw/source/core/bastyp/init.cxx b/sw/source/core/bastyp/init.cxx
index 4245a2284878..e900d1d9f4e8 100644
--- a/sw/source/core/bastyp/init.cxx
+++ b/sw/source/core/bastyp/init.cxx
@@ -348,7 +348,7 @@ SfxItemInfo aSlotTab[] =
 
 { SID_ATTR_PARA_OUTLINE_LEVEL, true }, // RES_PARATR_OUTLINELEVEL 
//#outline level
 { 0, true },   // RES_PARATR_RSID
-{ 0, true },   // RES_PARATR_GRABBAG
+{ SID_ATTR_PARA_GRABBAG, true },   // RES_PARATR_GRABBAG
 { 0, true },   // RES_PARATR_LIST_ID
 { 0, true },   // RES_PARATR_LIST_LEVEL
 { 0, true },   // RES_PARATR_LIST_ISRESTART
diff --git a/sw/source/uibase/utlui/uitool.cxx 
b/sw/source/uibase/utlui/uitool.cxx
index 92fe3bf3bc3a..c3581e6df888 100644
--- a/sw/source/uibase/utlui/uitool.cxx
+++ b/sw/source/uibase/utlui/uitool.cxx
@@ -143,12 +143,14 @@ void ConvertAttrCharToGen(SfxItemSet& rSet)
 }
 
 // Tell dialogs to use character-specific slots/whichIds
+// tdf#126684: We use RES_PARATR_GRABBAG, because RES_CHRATR_GRABBAG may 
be overwritten later in
+// SwDocStyleSheet::GetItemSet when applying attributes from char format
 std::unique_ptr pGrabBag;
 const SfxPoolItem *pTmpItem;
-if (SfxItemState::SET == rSet.GetItemState(RES_CHRATR_GRABBAG, false, 
))
+if (SfxItemState::SET == rSet.GetItemState(RES_PARATR_GRABBAG, false, 
))
 pGrabBag.reset(static_cast(pTmpItem->Clone()));
 else
-pGrabBag.reset(new SfxGrabBagItem(RES_CHRATR_GRABBAG));
+pGrabBag.reset(new SfxGrabBagItem(RES_PARATR_GRABBAG));
 pGrabBag->GetGrabBag()["DialogUseCharAttr"] <<= true;
 rSet.Put(std::move(pGrabBag));
 }
@@ -164,7 +166,7 @@ void ConvertAttrGenToChar(SfxItemSet& rSet, const 
SfxItemSet& rOrigSet)
 rSet.Put( SvxBrushItem(RES_CHRATR_HIGHLIGHT) );
 
 // Remove shading marker
-if( SfxItemState::SET == rOrigSet.GetItemState( RES_CHRATR_GRABBAG, 
false,  ) )
+if (SfxItemState::SET == rOrigSet.GetItemState(RES_CHRATR_GRABBAG, 
false, ))
 {
 SfxGrabBagItem aGrabBag(*static_cast(pTmpItem));
 std::map& rMap = aGrabBag.GetGrabBag();
@@ -173,10 +175,19 @@ void ConvertAttrGenToChar(SfxItemSet& rSet, const 
SfxItemSet& rOrigSet)
 {
 aIterator->second <<= false;
 }
-// Remove temporary GrabBag entry before writing to destination set
-rMap.erase("DialogUseCharAttr");
 rSet.Put( aGrabBag );
 }
+   

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

2019-08-14 Thread Mike Kaganski (via logerrit)
 sc/source/core/data/table2.cxx |  115 +
 1 file changed, 82 insertions(+), 33 deletions(-)

New commits:
commit 159db459418a2c831bf00dca5a2c5087d65e9ab6
Author: Mike Kaganski 
AuthorDate: Tue Jul 16 16:14:49 2019 +1000
Commit: Mike Kaganski 
CommitDate: Wed Aug 14 09:37:45 2019 +0200

tdf#126418: add some more checks for allocated columns

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

diff --git a/sc/source/core/data/table2.cxx b/sc/source/core/data/table2.cxx
index 09aa36d30f53..25779341e2f5 100644
--- a/sc/source/core/data/table2.cxx
+++ b/sc/source/core/data/table2.cxx
@@ -534,15 +534,39 @@ void ScTable::CopyToClip(
 void ScTable::CopyStaticToDocument(
 SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2, const 
SvNumberFormatterMergeMap& rMap, ScTable* pDestTab )
 {
-if (nCol1 > nCol2)
+if (nCol1 > nCol2 || nRow1 > nRow2)
 return;
 
-for (SCCOL i = nCol1; i <= nCol2; ++i)
+const SCCOL nFirstUnallocated = 
std::clamp(GetAllocatedColumnsCount(), nCol1, nCol2 + 1);
+if (nFirstUnallocated > nCol1)
+pDestTab->CreateColumnIfNotExists(nFirstUnallocated - 1);
+
+for (SCCOL i = nCol1; i < nFirstUnallocated; ++i)
 {
 ScColumn& rSrcCol = aCol[i];
 ScColumn& rDestCol = pDestTab->aCol[i];
 rSrcCol.CopyStaticToDocument(nRow1, nRow2, rMap, rDestCol);
 }
+
+// Maybe copy this table's default attrs to dest not limiting to already 
allocated in dest?
+const SCCOL nLastInDest = 
std::min(pDestTab->GetAllocatedColumnsCount() - 1, nCol2);
+for (SCCOL i = nFirstUnallocated; i <= nLastInDest; ++i)
+{
+ScColumn& rDestCol = pDestTab->aCol[i];
+rDestCol.maCellTextAttrs.set_empty(nRow1, nRow2);
+rDestCol.maCells.set_empty(nRow1, nRow2);
+for (SCROW nRow = nRow1; nRow <= nRow2; ++nRow)
+{
+sal_uInt32 nNumFmt = 
aDefaultColAttrArray.GetPattern(nRow)->GetNumberFormat(
+pDocument->GetNonThreadedContext().GetFormatTable());
+SvNumberFormatterMergeMap::const_iterator itNum = 
rMap.find(nNumFmt);
+if (itNum != rMap.end())
+nNumFmt = itNum->second;
+
+rDestCol.SetNumberFormat(nRow, nNumFmt);
+}
+rDestCol.CellStorageModified();
+}
 }
 
 void ScTable::CopyCellToDocument(SCCOL nSrcCol, SCROW nSrcRow, SCCOL nDestCol, 
SCROW nDestRow, ScTable& rDestTab )
@@ -550,8 +574,21 @@ void ScTable::CopyCellToDocument(SCCOL nSrcCol, SCROW 
nSrcRow, SCCOL nDestCol, S
 if (!ValidColRow(nSrcCol, nSrcRow) || !ValidColRow(nDestCol, nDestRow))
 return;
 
+if (nSrcCol >= GetAllocatedColumnsCount())
+{
+if (nDestCol < rDestTab.GetAllocatedColumnsCount())
+{
+ScColumn& rDestCol = rDestTab.aCol[nDestCol];
+rDestCol.maCells.set_empty(nDestRow, nDestRow);
+rDestCol.maCellTextAttrs.set_empty(nDestRow, nDestRow);
+rDestCol.maCellNotes.set_empty(nDestRow, nDestRow);
+rDestCol.CellStorageModified();
+}
+return;
+}
+
 ScColumn& rSrcCol = aCol[nSrcCol];
-ScColumn& rDestCol = rDestTab.aCol[nDestCol];
+ScColumn& rDestCol = rDestTab.CreateColumnIfNotExists(nDestCol);
 rSrcCol.CopyCellToDocument(nSrcRow, nDestRow, rDestCol);
 }
 
@@ -1055,7 +1092,7 @@ ScColumn* ScTable::FetchColumn( SCCOL nCol )
 
 const ScColumn* ScTable::FetchColumn( SCCOL nCol ) const
 {
-if (!ValidCol(nCol))
+if (!ValidCol(nCol) || nCol >= GetAllocatedColumnsCount())
 return nullptr;
 
 return [nCol];
@@ -1084,6 +1121,7 @@ void ScTable::StartListeners( sc::StartListeningContext& 
rCxt, bool bAll )
 void ScTable::AttachFormulaCells(
 sc::StartListeningContext& rCxt, SCCOL nCol1, SCROW nRow1, SCCOL nCol2, 
SCROW nRow2 )
 {
+nCol2 = ClampToAllocatedColumns(nCol2);
 for (SCCOL nCol = nCol1; nCol <= nCol2; ++nCol)
 aCol[nCol].AttachFormulaCells(rCxt, nRow1, nRow2);
 }
@@ -1091,6 +1129,7 @@ void ScTable::AttachFormulaCells(
 void ScTable::DetachFormulaCells(
 sc::EndListeningContext& rCxt, SCCOL nCol1, SCROW nRow1, SCCOL nCol2, 
SCROW nRow2 )
 {
+nCol2 = ClampToAllocatedColumns(nCol2);
 for (SCCOL nCol = nCol1; nCol <= nCol2; ++nCol)
 aCol[nCol].DetachFormulaCells(rCxt, nRow1, nRow2, nullptr);
 }
@@ -1438,7 +1477,7 @@ void ScTable::SetEditText( SCCOL nCol, SCROW nRow, const 
EditTextObject& rEditTe
 if (!ValidColRow(nCol, nRow))
 return;
 
-aCol[nCol].SetEditText(nRow, rEditText, pEditPool);
+CreateColumnIfNotExists(nCol).SetEditText(nRow, rEditText, pEditPool);
 }
 
 SCROW ScTable::GetFirstEditTextRow( SCCOL nCol1, SCROW nRow1, SCCOL nCol2, 
SCROW nRow2 ) const
@@ -1449,6 +1488,7 @@ SCROW ScTable::GetFirstEditTextRow( SCCOL nCol1, SCROW 
nRow1, SCCOL nCol2, SCROW
 if (!ValidRow(nRow1) || 

[Libreoffice-commits] core.git: xmlsecurity/Library_xmlsecurity.mk xmlsecurity/source

2019-08-14 Thread Mike Kaganski (via logerrit)
 xmlsecurity/Library_xmlsecurity.mk |2 +
 xmlsecurity/source/dialogs/digitalsignaturesdialog.cxx |   23 +++--
 2 files changed, 23 insertions(+), 2 deletions(-)

New commits:
commit 9c8854b7d6e5c9debc7eeae57c0d51a3f151a03e
Author: Mike Kaganski 
AuthorDate: Wed Aug 14 12:58:49 2019 +0300
Commit: Mike Kaganski 
CommitDate: Wed Aug 14 13:26:02 2019 +0200

Don't hardcode "C:\\Program Files (x86)" path on Windows

It might be simple "Program Files" on 32-bit system; or localized (see

https://www.samlogic.net/articles/program-files-folder-different-languages.htm),
or on a different drive (if system isn't on C:), etc.

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

diff --git a/xmlsecurity/Library_xmlsecurity.mk 
b/xmlsecurity/Library_xmlsecurity.mk
index 9a65dd2152a9..5a80e6e17591 100644
--- a/xmlsecurity/Library_xmlsecurity.mk
+++ b/xmlsecurity/Library_xmlsecurity.mk
@@ -83,6 +83,8 @@ $(eval $(call gb_Library_add_defs,xmlsecurity,\
 ))
 $(eval $(call gb_Library_use_system_win32_libs,xmlsecurity,\
 crypt32 \
+Ole32 \
+Shell32 \
 ))
 else
 ifneq (,$(filter DESKTOP,$(BUILD_TYPE))$(filter ANDROID,$(OS)))
diff --git a/xmlsecurity/source/dialogs/digitalsignaturesdialog.cxx 
b/xmlsecurity/source/dialogs/digitalsignaturesdialog.cxx
index 032171928c88..67545e3bb561 100644
--- a/xmlsecurity/source/dialogs/digitalsignaturesdialog.cxx
+++ b/xmlsecurity/source/dialogs/digitalsignaturesdialog.cxx
@@ -59,6 +59,12 @@
 #include 
 #include 
 
+#ifdef _WIN32
+#include 
+#include 
+#include 
+#endif
+
 using namespace comphelper;
 using namespace css::security;
 using namespace css::uno;
@@ -457,15 +463,28 @@ IMPL_LINK_NOARG(DigitalSignaturesDialog, 
CertMgrButtonHdl, weld::Button&, void)
  
OUString("GNU\\GnuPG\\bin\\kleopatra.exe"),
  
OUString("GNU\\GnuPG\\bin\\launch-gpa.exe"),
  OUString("GNU\\GnuPG\\bin\\gpa.exe") };
-const char* const cPath = "C:\\Program Files (x86)";
+static const OUString aPath = [] {
+OUString sRet;
+PWSTR sPath = nullptr;
+HRESULT hr
+= SHGetKnownFolderPath(FOLDERID_ProgramFilesX86, KF_FLAG_DEFAULT, 
nullptr, );
+if (SUCCEEDED(hr))
+{
+sRet = o3tl::toU(sPath);
+CoTaskMemFree(sPath);
+}
+return sRet;
+}();
+if (aPath.isEmpty())
+return;
 #else
 const OUString aGUIServers[] = { OUString("kleopatra"), 
OUString("seahorse"),  OUString("gpa"), OUString("kgpg") };
 const char* cPath = getenv("PATH");
 if (!cPath)
 return;
+OUString aPath(cPath, strlen(cPath), osl_getThreadTextEncoding());
 #endif
 
-OUString aPath(cPath, strlen(cPath), osl_getThreadTextEncoding());
 OUString sFoundGUIServer, sExecutable;
 
 for ( auto const  : aGUIServers )
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

[Libreoffice-commits] core.git: Branch 'libreoffice-6-3' - shell/source

2019-08-02 Thread Mike Kaganski (via logerrit)
 shell/source/win32/SysShExec.cxx |4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

New commits:
commit dd2b7919058fc0e23a7117d39110d3ecaaad1fb2
Author: Mike Kaganski 
AuthorDate: Thu Aug 1 10:52:12 2019 +0200
Commit: Stephan Bergmann 
CommitDate: Fri Aug 2 17:37:29 2019 +0200

tdf#126641: don't fail on file URLs with fragment

This only fixes part that the URL refuses to open the target file.
Honoring fragment isn't fixed here, since it's the system call to
ShellExecuteExW that in this case internally converts the file URL
into a system path, and strips the fragment from it.

Regression from commit d59ec4cd1660410fa1b18c50d2d83b1417a82ddc.

Change-Id: I6c9ed27e9a5bd7f2780dd3be96f816a6e825e043
Reviewed-on: https://gerrit.libreoffice.org/76778
Tested-by: Jenkins
Reviewed-by: Mike Kaganski 
(cherry picked from commit 2207269a84c7c9920af3385b837ce67978c720b4)
Reviewed-on: https://gerrit.libreoffice.org/76848
Reviewed-by: Stephan Bergmann 

diff --git a/shell/source/win32/SysShExec.cxx b/shell/source/win32/SysShExec.cxx
index 4786e4ddedc7..910aae1c095f 100644
--- a/shell/source/win32/SysShExec.cxx
+++ b/shell/source/win32/SysShExec.cxx
@@ -315,7 +315,9 @@ void SAL_CALL CSysShExec::execute( const OUString& 
aCommand, const OUString& aPa
 }
 if (uri->getScheme().equalsIgnoreAsciiCase("file")) {
 OUString pathname;
-auto const e1 = osl::FileBase::getSystemPathFromFileURL(aCommand, 
pathname);
+uri->clearFragment(); // getSystemPathFromFileURL fails for URLs 
with fragment
+auto const e1
+= 
osl::FileBase::getSystemPathFromFileURL(uri->getUriReference(), pathname);
 if (e1 != osl::FileBase::E_None) {
 throw css::lang::IllegalArgumentException(
 ("XSystemShellExecute.execute, getSystemPathFromFileURL <" 
+ aCommand
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

[Libreoffice-commits] core.git: Branch 'libreoffice-6-3' - cui/source

2019-08-03 Thread Mike Kaganski (via logerrit)
 cui/source/dialogs/scriptdlg.cxx |   26 +++---
 1 file changed, 19 insertions(+), 7 deletions(-)

New commits:
commit 60b6288bc1aec17d04b45f62ba6f117fc43f8ab4
Author: Mike Kaganski 
AuthorDate: Fri Aug 2 07:08:04 2019 +1000
Commit: Caolán McNamara 
CommitDate: Sat Aug 3 20:15:58 2019 +0200

tdf#126643: avoid unnecessary asking for JRE in script organizer dialog

Use two-pass search for the needed language node; if it fails with Java
interaction disabled, only then repeat the search with it enabled, like
in commit f3ce30ec75a4d7116b9cd4d7b21d9aaa0e237eeb.

Change-Id: Icde5dbeb552a6837af02182f7b8cbbc90765c5a5
Reviewed-on: https://gerrit.libreoffice.org/76831
Tested-by: Jenkins
Reviewed-by: Mike Kaganski 
(cherry picked from commit 1a1f4e73b7ab9e5b071aab74c8d7e27ba2b2d29c)
Reviewed-on: https://gerrit.libreoffice.org/76878
Reviewed-by: Caolán McNamara 
Tested-by: Caolán McNamara 

diff --git a/cui/source/dialogs/scriptdlg.cxx b/cui/source/dialogs/scriptdlg.cxx
index 11ef3a8820e2..99ac608b17af 100644
--- a/cui/source/dialogs/scriptdlg.cxx
+++ b/cui/source/dialogs/scriptdlg.cxx
@@ -24,6 +24,7 @@
 #include 
 #include 
 #include 
+#include 
 
 #include 
 #include 
@@ -47,6 +48,7 @@
 #include 
 #include 
 
+#include 
 #include 
 #include 
 
@@ -247,14 +249,24 @@ SvxScriptOrgDialog::getLangNodeFromRootNode( Reference< 
browse::XBrowseNode > co
 
 try
 {
-Sequence < Reference< browse::XBrowseNode > > children = 
rootNode->getChildNodes();
-for ( sal_Int32 n = 0; n < children.getLength(); n++ )
+auto tryFind = [&] {
+const Sequence> children = 
rootNode->getChildNodes();
+const auto it = std::find_if(children.begin(), children.end(),
+ [&](const 
Reference& child) {
+ return child->getName() == 
language;
+ });
+return (it != children.end()) ? *it : nullptr;
+};
 {
-if ( children[ n ]->getName() == language )
-{
-langNode = children[ n ];
-break;
-}
+// First try without Java interaction, to avoid warnings for 
non-JRE-dependent providers
+css::uno::ContextLayer layer(
+new 
comphelper::NoEnableJavaInteractionContext(css::uno::getCurrentContext()));
+langNode = tryFind();
+}
+if (!langNode)
+{
+// Now try with Java interaction enabled
+langNode = tryFind();
 }
 }
 catch ( Exception& )
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

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

2019-08-16 Thread Mike Kaganski (via logerrit)
 svl/source/items/itemset.cxx |7 ---
 1 file changed, 4 insertions(+), 3 deletions(-)

New commits:
commit 336afaa77fa2b8d08871de7b90e27c0ada32a81e
Author: Mike Kaganski 
AuthorDate: Fri Aug 16 14:01:19 2019 +0200
Commit: Mike Kaganski 
CommitDate: Fri Aug 16 16:44:41 2019 +0200

Reorder to only get item state when necessary

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

diff --git a/svl/source/items/itemset.cxx b/svl/source/items/itemset.cxx
index 4841123eed0a..75709c3f4072 100644
--- a/svl/source/items/itemset.cxx
+++ b/svl/source/items/itemset.cxx
@@ -656,9 +656,10 @@ void SfxItemSet::PutExtended
 void SfxItemSet::MergeRange( sal_uInt16 nFrom, sal_uInt16 nTo )
 {
 // special case: exactly one sal_uInt16 which is already included?
-SfxItemState eItemState = GetItemState(nFrom, false);
-if ( nFrom == nTo && ( eItemState == SfxItemState::DEFAULT || eItemState 
== SfxItemState::SET ) )
-return;
+if (nFrom == nTo)
+if (SfxItemState eItemState = GetItemState(nFrom, false);
+eItemState == SfxItemState::DEFAULT || eItemState == 
SfxItemState::SET)
+return;
 
 #ifdef DBG_UTIL
 assert(nFrom <= nTo);
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

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

2019-08-16 Thread Mike Kaganski (via logerrit)
 sw/qa/extras/unowriter/unowriter.cxx |   23 +++
 sw/source/core/unocore/unoobj.cxx|   12 ++--
 2 files changed, 29 insertions(+), 6 deletions(-)

New commits:
commit 6dc0f6b65e79ca4af69338411e3887d9aaef1cac
Author: Mike Kaganski 
AuthorDate: Fri Aug 16 15:04:15 2019 +0200
Commit: Mike Kaganski 
CommitDate: Fri Aug 16 20:46:06 2019 +0200

This was meant to be 'continue', not 'break'

... when commit ee0bf5d58bc59052923c4ced928a989956e71456 had introduced
SwUnoCursorHelper::SetPropertyValues, and the intent obviously was to
skip bad values, populating relevant error messages, and set all correct
values.

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

diff --git a/sw/qa/extras/unowriter/unowriter.cxx 
b/sw/qa/extras/unowriter/unowriter.cxx
index e819cb9d7d7d..ffb57d836f48 100644
--- a/sw/qa/extras/unowriter/unowriter.cxx
+++ b/sw/qa/extras/unowriter/unowriter.cxx
@@ -621,6 +621,29 @@ CPPUNIT_TEST_FIXTURE(SwUnoWriter, testViewCursorPageStyle)
 CPPUNIT_ASSERT_EQUAL(OUString("Standard"), aActualPageStyleName);
 }
 
+CPPUNIT_TEST_FIXTURE(SwUnoWriter, testXTextCursor_setPropertyValues)
+{
+// Create a new document, type a character, pass a set of property/value 
pairs consisting of one
+// unknown property and CharStyleName, assert that it threw 
UnknownPropertyException (actually
+// wrapped into WrappedTargetException), and assert the style was set, not 
discarded.
+loadURL("private:factory/swriter", nullptr);
+
+uno::Reference xTextDocument(mxComponent, 
uno::UNO_QUERY);
+uno::Reference xBodyText = xTextDocument->getText();
+xBodyText->insertString(xBodyText->getStart(), "x", false);
+
+uno::Reference xCursor(xBodyText->createTextCursor());
+xCursor->goLeft(1, true);
+
+uno::Reference xCursorProps(xCursor, 
uno::UNO_QUERY);
+uno::Sequence aPropNames = { "OneUnknownProperty", 
"CharStyleName" };
+uno::Sequence aPropValues = { uno::Any(), 
uno::Any(OUString("Emphasis")) };
+CPPUNIT_ASSERT_THROW(xCursorProps->setPropertyValues(aPropNames, 
aPropValues),
+ lang::WrappedTargetException);
+CPPUNIT_ASSERT_EQUAL(OUString("Emphasis"),
+ getProperty(xCursorProps, "CharStyleName"));
+}
+
 CPPUNIT_PLUGIN_IMPLEMENT();
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/unocore/unoobj.cxx 
b/sw/source/core/unocore/unoobj.cxx
index 7da731df197a..0b1b3c78b083 100644
--- a/sw/source/core/unocore/unoobj.cxx
+++ b/sw/source/core/unocore/unoobj.cxx
@@ -1784,7 +1784,7 @@ void SwUnoCursorHelper::SetPropertyValues(
 
 // Build set of attributes we want to fetch
 std::vector aWhichPairs;
-std::vector aEntries;
+std::vector> 
aEntries;
 aEntries.reserve(rPropertyValues.getLength());
 for (const auto& rPropVal : rPropertyValues)
 {
@@ -1797,18 +1797,18 @@ void SwUnoCursorHelper::SetPropertyValues(
 if (!pEntry)
 {
 aUnknownExMsg += "Unknown property: '" + rPropertyName + "' ";
-break;
+continue;
 }
 else if (pEntry->nFlags & beans::PropertyAttribute::READONLY)
 {
 aPropertyVetoExMsg += "Property is read-only: '" + rPropertyName + 
"' ";
-break;
+continue;
 } else {
 // FIXME: we should have some nice way of merging ranges surely ?
 aWhichPairs.push_back(pEntry->nWID);
 aWhichPairs.push_back(pEntry->nWID);
 }
-aEntries.push_back(pEntry);
+aEntries.emplace_back(pEntry, rPropVal.Value);
 }
 
 if (!aWhichPairs.empty())
@@ -1821,7 +1821,7 @@ void SwUnoCursorHelper::SetPropertyValues(
 bool bPreviousPropertyCausesSideEffectsInNodes = false;
 for (size_t i = 0; i < aEntries.size(); ++i)
 {
-SfxItemPropertySimpleEntry const*const pEntry = aEntries[i];
+SfxItemPropertySimpleEntry const*const pEntry = aEntries[i].first;
 bool bPropertyCausesSideEffectsInNodes =
 propertyCausesSideEffectsInNodes(pEntry->nWID);
 
@@ -1832,7 +1832,7 @@ void SwUnoCursorHelper::SetPropertyValues(
 SwUnoCursorHelper::GetCursorAttr(rPaM, aItemSet);
 }
 
-const uno::Any  = rPropertyValues[i].Value;
+const uno::Any  = aEntries[i].second;
 // this can set some attributes in nodes' mpAttrSet
 if (!SwUnoCursorHelper::SetCursorPropertyValue(*pEntry, rValue, 
rPaM, aItemSet))
 rPropSet.setPropertyValue(*pEntry, rValue, aItemSet);
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

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

2019-08-18 Thread Mike Kaganski (via logerrit)
 extensions/source/scanner/twain32shim.cxx |3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

New commits:
commit 53e4d5fe73d98b109d79fc2c1f5032faea88afb9
Author: Mike Kaganski 
AuthorDate: Sun Aug 18 10:43:51 2019 +0200
Commit: Mike Kaganski 
CommitDate: Sun Aug 18 13:41:18 2019 +0200

tdf#126989: always terminate shim after fallback complete

It seems that DSM may not send MSG_CLOSEDSREQ (or we may already have
unloaded DSM), so don't rely on it.

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

diff --git a/extensions/source/scanner/twain32shim.cxx 
b/extensions/source/scanner/twain32shim.cxx
index 49d6787eb69f..f813ff83d4cb 100644
--- a/extensions/source/scanner/twain32shim.cxx
+++ b/extensions/source/scanner/twain32shim.cxx
@@ -511,8 +511,7 @@ void ImpTwain::ImplFallbackHdl(WPARAM nEvent)
 {
 if (nEvent > TWAIN_EVENT_NONE)
 NotifyParent(nEvent, reinterpret_cast(m_hMap));
-if (nEvent == TWAIN_EVENT_QUIT)
-PostQuitMessage(0);
+PostQuitMessage(0);
 
 bFallback = false;
 }
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

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

2019-08-18 Thread Mike Kaganski (via logerrit)
 extensions/source/scanner/twain32shim.cxx |  136 +++---
 1 file changed, 69 insertions(+), 67 deletions(-)

New commits:
commit ed128e17e7f090af06dfe5776a238c40f3a68fc9
Author: Mike Kaganski 
AuthorDate: Sun Aug 18 10:53:19 2019 +0200
Commit: Mike Kaganski 
CommitDate: Sun Aug 18 13:41:43 2019 +0200

Use mnemonic TWAIN state names; some simplification

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

diff --git a/extensions/source/scanner/twain32shim.cxx 
b/extensions/source/scanner/twain32shim.cxx
index f813ff83d4cb..8ccd2bd1b32d 100644
--- a/extensions/source/scanner/twain32shim.cxx
+++ b/extensions/source/scanner/twain32shim.cxx
@@ -49,13 +49,24 @@ public:
 ~ImpTwain();
 
 private:
+enum class TWAINState
+{
+DSMunloaded = 1,
+DSMloaded = 2,
+DSMopened = 3,
+DSopened = 4,
+DSenabled = 5,
+DSreadyToXfer = 6,
+Xferring = 7,
+};
+
 TW_IDENTITY m_aAppId;
 TW_IDENTITY m_aSrcId;
 DWORD m_nParentThreadId;
 HANDLE m_hProc;
 DSMENTRYPROC m_pDSM = nullptr;
 HMODULE m_hMod = nullptr;
-ULONG_PTR m_nCurState = 1;
+TWAINState m_nCurState = TWAINState::DSMunloaded;
 HWND m_hTwainWnd = nullptr;
 HHOOK m_hTwainHook = nullptr;
 HANDLE m_hMap = nullptr; // the *duplicated* handle
@@ -66,7 +77,7 @@ private:
 static LRESULT CALLBACK WndProc(HWND hWnd, UINT nMsg, WPARAM wParam, 
LPARAM lParam);
 static LRESULT CALLBACK MsgHook(int nCode, WPARAM wParam, LPARAM lParam);
 
-void Destroy();
+void Destroy() { ImplFallback(TWAIN_EVENT_QUIT); }
 bool SelectSource();
 bool InitXfer();
 
@@ -199,15 +210,13 @@ ImpTwain::~ImpTwain()
 UnhookWindowsHookEx(m_hTwainHook);
 }
 
-void ImpTwain::Destroy() { ImplFallback(TWAIN_EVENT_QUIT); }
-
 bool ImpTwain::SelectSource()
 {
 TW_UINT16 nRet = TWRC_FAILURE;
 
 ImplOpenSourceManager();
 
-if (3 == m_nCurState)
+if (TWAINState::DSMopened == m_nCurState)
 {
 TW_IDENTITY aIdent;
 
@@ -217,8 +226,7 @@ bool ImpTwain::SelectSource()
 nRet = m_pDSM(_aAppId, nullptr, DG_CONTROL, DAT_IDENTITY, 
MSG_USERSELECT, );
 }
 
-ImplFallback(TWAIN_EVENT_QUIT);
-
+Destroy();
 return (TWRC_SUCCESS == nRet);
 }
 
@@ -228,34 +236,34 @@ bool ImpTwain::InitXfer()
 
 ImplOpenSourceManager();
 
-if (3 == m_nCurState)
+if (TWAINState::DSMopened == m_nCurState)
 {
 ImplOpenSource();
 
-if (4 == m_nCurState)
+if (TWAINState::DSopened == m_nCurState)
 bRet = ImplEnableSource();
 }
 
 if (!bRet)
-ImplFallback(TWAIN_EVENT_QUIT);
+Destroy();
 
 return bRet;
 }
 
 void ImpTwain::ImplOpenSourceManager()
 {
-if (1 == m_nCurState)
+if (TWAINState::DSMunloaded == m_nCurState)
 {
 if ((m_hMod = LoadLibraryW(L"TWAIN_32.DLL")))
 {
-m_nCurState = 2;
+m_nCurState = TWAINState::DSMloaded;
 
 m_pDSM = reinterpret_cast(GetProcAddress(m_hMod, 
"DSM_Entry"));
 if (m_pDSM
 && (m_pDSM(_aAppId, nullptr, DG_CONTROL, DAT_PARENT, 
MSG_OPENDSM, _hTwainWnd)
 == TWRC_SUCCESS))
 {
-m_nCurState = 3;
+m_nCurState = TWAINState::DSMopened;
 }
 }
 }
@@ -263,7 +271,7 @@ void ImpTwain::ImplOpenSourceManager()
 
 void ImpTwain::ImplOpenSource()
 {
-if (3 == m_nCurState)
+if (TWAINState::DSMopened == m_nCurState)
 {
 if ((m_pDSM(_aAppId, nullptr, DG_CONTROL, DAT_IDENTITY, 
MSG_GETDEFAULT, _aSrcId)
  == TWRC_SUCCESS)
@@ -279,7 +287,7 @@ void ImpTwain::ImplOpenSource()
 GlobalUnlock(aCap.hContainer);
 m_pDSM(_aAppId, _aSrcId, DG_CONTROL, DAT_CAPABILITY, MSG_SET, 
);
 GlobalFree(aCap.hContainer);
-m_nCurState = 4;
+m_nCurState = TWAINState::DSopened;
 }
 }
 }
@@ -288,12 +296,12 @@ bool ImpTwain::ImplEnableSource()
 {
 bool bRet = false;
 
-if (4 == m_nCurState)
+if (TWAINState::DSopened == m_nCurState)
 {
 TW_USERINTERFACE aUI = { true, true, m_hTwainWnd };
 
 NotifyParent(TWAIN_EVENT_SCANNING, 0);
-m_nCurState = 5;
+m_nCurState = TWAINState::DSenabled;
 
 if (m_pDSM(_aAppId, _aSrcId, DG_CONTROL, DAT_USERINTERFACE, 
MSG_ENABLEDS, )
 == TWRC_SUCCESS)
@@ -303,7 +311,7 @@ bool ImpTwain::ImplEnableSource()
 else
 {
 // dialog failed
-m_nCurState = 4;
+m_nCurState = TWAINState::DSopened;
 }
 }
 
@@ -317,58 +325,52 @@ void ImpTwain::NotifyParent(WPARAM nEvent, LPARAM lParam)
 
 bool ImpTwain::ImplHandleMsg(MSG* pMsg)
 {
-TW_UINT16 nRet;
-TW_EVENT aEvt = { pMsg, MSG_NULL };
+if (!m_pDSM)
+return false;
 
-if 

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

2019-08-17 Thread Mike Kaganski (via logerrit)
 sw/source/uibase/utlui/uitool.cxx |   52 ++
 1 file changed, 42 insertions(+), 10 deletions(-)

New commits:
commit 202c9a7d826c95fc05db912a8d19c598a240f1cd
Author: Mike Kaganski 
AuthorDate: Sat Aug 17 10:52:14 2019 +0300
Commit: Mike Kaganski 
CommitDate: Sat Aug 17 11:26:47 2019 +0200

tdf#126787: extend/restore item set ranges to hold RES_PARATR_GRABBAG

The original item set did not include that in its ranges list, so it
ignored attempts to set its value.

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

diff --git a/sw/source/uibase/utlui/uitool.cxx 
b/sw/source/uibase/utlui/uitool.cxx
index c3581e6df888..0ed3fe8b24a5 100644
--- a/sw/source/uibase/utlui/uitool.cxx
+++ b/sw/source/uibase/utlui/uitool.cxx
@@ -148,10 +148,21 @@ void ConvertAttrCharToGen(SfxItemSet& rSet)
 std::unique_ptr pGrabBag;
 const SfxPoolItem *pTmpItem;
 if (SfxItemState::SET == rSet.GetItemState(RES_PARATR_GRABBAG, false, 
))
+{
+SAL_WARN("sw.ui", "Unexpected: non-empty paragraph grab bag in 
character item set!");
 pGrabBag.reset(static_cast(pTmpItem->Clone()));
+}
 else
 pGrabBag.reset(new SfxGrabBagItem(RES_PARATR_GRABBAG));
 pGrabBag->GetGrabBag()["DialogUseCharAttr"] <<= true;
+// Store initial ranges to allow restoring later
+const sal_uInt16* pRanges = rSet.GetRanges();
+const sal_uInt16* pEnd = pRanges;
+while (*pEnd)
+++pEnd;
+const uno::Sequence aOrigRanges(pRanges, pEnd - pRanges + 1);
+pGrabBag->GetGrabBag()["OrigItemSetRanges"] <<= aOrigRanges;
+rSet.MergeRange(RES_PARATR_GRABBAG, RES_PARATR_GRABBAG);
 rSet.Put(std::move(pGrabBag));
 }
 
@@ -177,19 +188,40 @@ void ConvertAttrGenToChar(SfxItemSet& rSet, const 
SfxItemSet& rOrigSet)
 }
 rSet.Put( aGrabBag );
 }
-if (SfxItemState::SET == rOrigSet.GetItemState(RES_PARATR_GRABBAG, 
false, ))
+}
+rSet.ClearItem( RES_BACKGROUND );
+
+if (SfxItemState::SET == rOrigSet.GetItemState(RES_PARATR_GRABBAG, false, 
))
+{
+SfxGrabBagItem aGrabBag(*static_cast(pTmpItem));
+std::map& rMap = aGrabBag.GetGrabBag();
+auto aIterator = rMap.find("OrigItemSetRanges");
+if (aIterator != rMap.end())
 {
-SfxGrabBagItem aGrabBag(*static_cast(pTmpItem));
-std::map& rMap = aGrabBag.GetGrabBag();
-// Remove temporary GrabBag entry
-rMap.erase("DialogUseCharAttr");
-if (rMap.empty())
-rSet.ClearItem(RES_PARATR_GRABBAG);
-else
-rSet.Put(aGrabBag);
+if (uno::Sequence aOrigRanges; (aIterator->second >>= 
aOrigRanges)
+   && 
aOrigRanges.getLength() % 2 == 1
+   && 
*(std::cend(aOrigRanges) - 1) == 0)
+rSet.SetRanges(aOrigRanges.getConstArray());
+}
+}
+if (SfxItemState::SET == rSet.GetItemState(RES_PARATR_GRABBAG, false, 
))
+{
+// In fact, we should not reach here: it shouldn't have been there; 
and even if it was, it
+// should have been erased on the previous step when restoring 
original ranges
+SAL_WARN("sw.ui", "Unexpected: paragraph grab bag in character item 
set!");
+SfxGrabBagItem aGrabBag(*static_cast(pTmpItem));
+std::map& rMap = aGrabBag.GetGrabBag();
+// Remove temporary GrabBag entries
+rMap.erase("DialogUseCharAttr");
+rMap.erase("OrigItemSetRanges");
+if (rMap.empty())
+rSet.ClearItem(RES_PARATR_GRABBAG);
+else
+{
+SAL_WARN("sw.ui", "Unexpected: non-empty paragraph grab bag in 
character item set!");
+rSet.Put(aGrabBag);
 }
 }
-rSet.ClearItem( RES_BACKGROUND );
 }
 
 void ApplyCharBackground(const Color& rBackgroundColor, SwWrtShell& rShell)
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

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

2019-08-16 Thread Mike Kaganski (via logerrit)
 dbaccess/source/ui/misc/TokenWriter.cxx |   15 ++-
 1 file changed, 10 insertions(+), 5 deletions(-)

New commits:
commit 61e02561aa659d829a6786609fc57d99fd8652b4
Author: Mike Kaganski 
AuthorDate: Thu Aug 15 22:02:20 2019 +0300
Commit: Mike Kaganski 
CommitDate: Fri Aug 16 08:01:25 2019 +0200

tdf#126940: export ansicpg in RTF when copying database

This allows correctly detect encoding of 8-bit characters on paste

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

diff --git a/dbaccess/source/ui/misc/TokenWriter.cxx 
b/dbaccess/source/ui/misc/TokenWriter.cxx
index 5a56d78dcc18..fb82d00d1e77 100644
--- a/dbaccess/source/ui/misc/TokenWriter.cxx
+++ b/dbaccess/source/ui/misc/TokenWriter.cxx
@@ -22,6 +22,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -320,8 +321,12 @@ bool ORTFImportExport::Write()
 {
 ODatabaseImportExport::Write();
 m_pStream->WriteChar( '{' ).WriteCharPtr( OOO_STRING_SVTOOLS_RTF_RTF );
-m_pStream->WriteCharPtr( OOO_STRING_SVTOOLS_RTF_ANSI ).WriteCharPtr( 
SAL_NEWLINE_STRING );
-rtl_TextEncoding eDestEnc = RTL_TEXTENCODING_MS_1252;
+m_pStream->WriteCharPtr(OOO_STRING_SVTOOLS_RTF_ANSI);
+if (sal_uInt32 nCpg = rtl_getWindowsCodePageFromTextEncoding(m_eDestEnc); 
nCpg && nCpg != 65001)
+{
+
m_pStream->WriteCharPtr(OOO_STRING_SVTOOLS_RTF_ANSICPG).WriteUInt32AsString(nCpg);
+}
+m_pStream->WriteCharPtr(SAL_NEWLINE_STRING);
 
 bool bBold  = ( css::awt::FontWeight::BOLD == m_aFont.Weight );
 bool bItalic= ( css::awt::FontSlant_ITALIC == m_aFont.Slant );
@@ -333,11 +338,11 @@ bool ORTFImportExport::Write()
 m_xObject->getPropertyValue(PROPERTY_TEXTCOLOR) >>= nColor;
 ::Color aColor(nColor);
 
-OString aFonts(OUStringToOString(m_aFont.Name, eDestEnc));
+OString aFonts(OUStringToOString(m_aFont.Name, RTL_TEXTENCODING_MS_1252));
 if (aFonts.isEmpty())
 {
 OUString aName = 
Application::GetSettings().GetStyleSettings().GetAppFont().GetFamilyName();
-aFonts = OUStringToOString(aName, eDestEnc);
+aFonts = OUStringToOString(aName, RTL_TEXTENCODING_MS_1252);
 }
 
 m_pStream->WriteCharPtr( "{\\fonttbl" );
@@ -437,7 +442,7 @@ bool ORTFImportExport::Write()
 
 m_pStream->WriteCharPtr( "\\fs20\\f0\\cf0\\cb2" );
 m_pStream->WriteChar( ' ' );
-RTFOutFuncs::Out_String(*m_pStream,sColumnName,eDestEnc);
+RTFOutFuncs::Out_String(*m_pStream, sColumnName, m_eDestEnc);
 
 m_pStream->WriteCharPtr( OOO_STRING_SVTOOLS_RTF_CELL );
 m_pStream->WriteChar( '}' );
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

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

2019-08-13 Thread Mike Kaganski (via logerrit)
 sc/source/ui/unoobj/cursuno.cxx |   16 +++-
 1 file changed, 3 insertions(+), 13 deletions(-)

New commits:
commit 23cf31c175f1c60da89c6594c5db25dddaaa57d5
Author: Mike Kaganski 
AuthorDate: Mon Aug 12 13:34:03 2019 +0200
Commit: Mike Kaganski 
CommitDate: Tue Aug 13 11:34:55 2019 +0200

Simplify ScCellCursorObj::getSupportedServiceNames

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

diff --git a/sc/source/ui/unoobj/cursuno.cxx b/sc/source/ui/unoobj/cursuno.cxx
index e5aef385d361..28e6c92f6f50 100644
--- a/sc/source/ui/unoobj/cursuno.cxx
+++ b/sc/source/ui/unoobj/cursuno.cxx
@@ -439,20 +439,10 @@ sal_Bool SAL_CALL ScCellCursorObj::supportsService( const 
OUString& rServiceName
 
 uno::Sequence SAL_CALL ScCellCursorObj::getSupportedServiceNames()
 {
-//  get all service names from cell range
-const uno::Sequence 
aParentSeq(ScCellRangeObj::getSupportedServiceNames());
-sal_Int32 nParentLen = aParentSeq.getLength();
-
 //  SheetCellCursor should be first (?)
-uno::Sequence aTotalSeq( nParentLen + 2 );
-OUString* pTotalArr = aTotalSeq.getArray();
-pTotalArr[0] = SCSHEETCELLCURSOR_SERVICE;
-pTotalArr[1] = SCCELLCURSOR_SERVICE;
-
-//  append cell range services
-std::copy_n(aParentSeq.begin(), nParentLen, std::next(pTotalArr, 2));
-
-return aTotalSeq;
+return comphelper::concatSequences(
+{ SCSHEETCELLCURSOR_SERVICE, SCCELLCURSOR_SERVICE },
+ScCellRangeObj::getSupportedServiceNames());
 }
 
 /* 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-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: Branch 'distro/collabora/cp-6.0' - shell/source

2019-08-19 Thread Mike Kaganski (via logerrit)
 shell/source/win32/SysShExec.cxx |4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

New commits:
commit 0620d7e6a98a34d526447a7e7fd597d364814bdf
Author: Mike Kaganski 
AuthorDate: Thu Aug 1 10:52:12 2019 +0200
Commit: Mike Kaganski 
CommitDate: Mon Aug 19 22:13:53 2019 +0200

tdf#126641: don't fail on file URLs with fragment

This only fixes part that the URL refuses to open the target file.
Honoring fragment isn't fixed here, since it's the system call to
ShellExecuteExW that in this case internally converts the file URL
into a system path, and strips the fragment from it.

Regression from commit d59ec4cd1660410fa1b18c50d2d83b1417a82ddc.

Change-Id: I6c9ed27e9a5bd7f2780dd3be96f816a6e825e043
Reviewed-on: https://gerrit.libreoffice.org/76778
Tested-by: Jenkins
Reviewed-by: Mike Kaganski 
(cherry picked from commit 2207269a84c7c9920af3385b837ce67978c720b4)
Reviewed-on: https://gerrit.libreoffice.org/77730
Tested-by: Jenkins CollaboraOffice 

diff --git a/shell/source/win32/SysShExec.cxx b/shell/source/win32/SysShExec.cxx
index 33554bd5608f..c30816816b59 100644
--- a/shell/source/win32/SysShExec.cxx
+++ b/shell/source/win32/SysShExec.cxx
@@ -320,7 +320,9 @@ void SAL_CALL CSysShExec::execute( const OUString& 
aCommand, const OUString& aPa
 }
 if (uri->getScheme().equalsIgnoreAsciiCase("file")) {
 OUString pathname;
-auto const e1 = osl::FileBase::getSystemPathFromFileURL(aCommand, 
pathname);
+uri->clearFragment(); // getSystemPathFromFileURL fails for URLs 
with fragment
+auto const e1
+= 
osl::FileBase::getSystemPathFromFileURL(uri->getUriReference(), pathname);
 if (e1 != osl::FileBase::E_None) {
 throw css::lang::IllegalArgumentException(
 ("XSystemShellExecute.execute, getSystemPathFromFileURL <" 
+ aCommand
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-6.0' - sfx2/source

2019-08-19 Thread Mike Kaganski (via logerrit)
 sfx2/source/doc/objserv.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit d971c1b68651174d0c75907abb0ebcbf2b67770f
Author: Mike Kaganski 
AuthorDate: Mon Aug 19 22:02:26 2019 +0200
Commit: Mike Kaganski 
CommitDate: Tue Aug 20 06:34:45 2019 +0200

Fix Windows build after commit 2a97d38fbf89ef6f17452fa9d93c2d6fb062f233

> C:/lo/core/sfx2/source/doc/objserv.cxx(561): error C2429: attribute
  'fallthrough' requires compiler flag '/std:c++17'

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

diff --git a/sfx2/source/doc/objserv.cxx b/sfx2/source/doc/objserv.cxx
index 1f01253d742d..77cd8458bfc1 100644
--- a/sfx2/source/doc/objserv.cxx
+++ b/sfx2/source/doc/objserv.cxx
@@ -558,7 +558,7 @@ void SfxObjectShell::ExecFile_Impl(SfxRequest )
 bIsAutoRedact = true;
 //aDlg.getTargets(aRedactionTargets);
 
-[[fallthrough]];
+SAL_FALLTHROUGH;
 }
 
 case SID_REDACTDOC:
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

[Libreoffice-commits] core.git: Branch 'libreoffice-6-3' - sc/source

2019-08-19 Thread Mike Kaganski (via logerrit)
 sc/source/core/data/table2.cxx |  115 +
 1 file changed, 82 insertions(+), 33 deletions(-)

New commits:
commit 7a42bf4caa46093ced87a4db54b94f6b4c4decd0
Author: Mike Kaganski 
AuthorDate: Tue Jul 16 16:14:49 2019 +1000
Commit: Noel Grandin 
CommitDate: Mon Aug 19 10:25:45 2019 +0200

tdf#126418: add some more checks for allocated columns

Change-Id: Ia91f0f11c9d7bcec5b9ecc2f8a28d9e4f6212dc5
Reviewed-on: https://gerrit.libreoffice.org/75671
Tested-by: Jenkins
Reviewed-by: Mike Kaganski 
(cherry picked from commit 159db459418a2c831bf00dca5a2c5087d65e9ab6)
Reviewed-on: https://gerrit.libreoffice.org/77442
Reviewed-by: Noel Grandin 

diff --git a/sc/source/core/data/table2.cxx b/sc/source/core/data/table2.cxx
index 98f316424cbd..1f62b1a9418d 100644
--- a/sc/source/core/data/table2.cxx
+++ b/sc/source/core/data/table2.cxx
@@ -534,15 +534,39 @@ void ScTable::CopyToClip(
 void ScTable::CopyStaticToDocument(
 SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2, const 
SvNumberFormatterMergeMap& rMap, ScTable* pDestTab )
 {
-if (nCol1 > nCol2)
+if (nCol1 > nCol2 || nRow1 > nRow2)
 return;
 
-for (SCCOL i = nCol1; i <= nCol2; ++i)
+const SCCOL nFirstUnallocated = 
std::clamp(GetAllocatedColumnsCount(), nCol1, nCol2 + 1);
+if (nFirstUnallocated > nCol1)
+pDestTab->CreateColumnIfNotExists(nFirstUnallocated - 1);
+
+for (SCCOL i = nCol1; i < nFirstUnallocated; ++i)
 {
 ScColumn& rSrcCol = aCol[i];
 ScColumn& rDestCol = pDestTab->aCol[i];
 rSrcCol.CopyStaticToDocument(nRow1, nRow2, rMap, rDestCol);
 }
+
+// Maybe copy this table's default attrs to dest not limiting to already 
allocated in dest?
+const SCCOL nLastInDest = 
std::min(pDestTab->GetAllocatedColumnsCount() - 1, nCol2);
+for (SCCOL i = nFirstUnallocated; i <= nLastInDest; ++i)
+{
+ScColumn& rDestCol = pDestTab->aCol[i];
+rDestCol.maCellTextAttrs.set_empty(nRow1, nRow2);
+rDestCol.maCells.set_empty(nRow1, nRow2);
+for (SCROW nRow = nRow1; nRow <= nRow2; ++nRow)
+{
+sal_uInt32 nNumFmt = 
aDefaultColAttrArray.GetPattern(nRow)->GetNumberFormat(
+pDocument->GetNonThreadedContext().GetFormatTable());
+SvNumberFormatterMergeMap::const_iterator itNum = 
rMap.find(nNumFmt);
+if (itNum != rMap.end())
+nNumFmt = itNum->second;
+
+rDestCol.SetNumberFormat(nRow, nNumFmt);
+}
+rDestCol.CellStorageModified();
+}
 }
 
 void ScTable::CopyCellToDocument(SCCOL nSrcCol, SCROW nSrcRow, SCCOL nDestCol, 
SCROW nDestRow, ScTable& rDestTab )
@@ -550,8 +574,21 @@ void ScTable::CopyCellToDocument(SCCOL nSrcCol, SCROW 
nSrcRow, SCCOL nDestCol, S
 if (!ValidColRow(nSrcCol, nSrcRow) || !ValidColRow(nDestCol, nDestRow))
 return;
 
+if (nSrcCol >= GetAllocatedColumnsCount())
+{
+if (nDestCol < rDestTab.GetAllocatedColumnsCount())
+{
+ScColumn& rDestCol = rDestTab.aCol[nDestCol];
+rDestCol.maCells.set_empty(nDestRow, nDestRow);
+rDestCol.maCellTextAttrs.set_empty(nDestRow, nDestRow);
+rDestCol.maCellNotes.set_empty(nDestRow, nDestRow);
+rDestCol.CellStorageModified();
+}
+return;
+}
+
 ScColumn& rSrcCol = aCol[nSrcCol];
-ScColumn& rDestCol = rDestTab.aCol[nDestCol];
+ScColumn& rDestCol = rDestTab.CreateColumnIfNotExists(nDestCol);
 rSrcCol.CopyCellToDocument(nSrcRow, nDestRow, rDestCol);
 }
 
@@ -1055,7 +1092,7 @@ ScColumn* ScTable::FetchColumn( SCCOL nCol )
 
 const ScColumn* ScTable::FetchColumn( SCCOL nCol ) const
 {
-if (!ValidCol(nCol))
+if (!ValidCol(nCol) || nCol >= GetAllocatedColumnsCount())
 return nullptr;
 
 return [nCol];
@@ -1084,6 +1121,7 @@ void ScTable::StartListeners( sc::StartListeningContext& 
rCxt, bool bAll )
 void ScTable::AttachFormulaCells(
 sc::StartListeningContext& rCxt, SCCOL nCol1, SCROW nRow1, SCCOL nCol2, 
SCROW nRow2 )
 {
+nCol2 = ClampToAllocatedColumns(nCol2);
 for (SCCOL nCol = nCol1; nCol <= nCol2; ++nCol)
 aCol[nCol].AttachFormulaCells(rCxt, nRow1, nRow2);
 }
@@ -1091,6 +1129,7 @@ void ScTable::AttachFormulaCells(
 void ScTable::DetachFormulaCells(
 sc::EndListeningContext& rCxt, SCCOL nCol1, SCROW nRow1, SCCOL nCol2, 
SCROW nRow2 )
 {
+nCol2 = ClampToAllocatedColumns(nCol2);
 for (SCCOL nCol = nCol1; nCol <= nCol2; ++nCol)
 aCol[nCol].DetachFormulaCells(rCxt, nRow1, nRow2, nullptr);
 }
@@ -1438,7 +1477,7 @@ void ScTable::SetEditText( SCCOL nCol, SCROW nRow, const 
EditTextObject& rEditTe
 if (!ValidColRow(nCol, nRow))
 return;
 
-aCol[nCol].SetEditText(nRow, rEditText, pEditPool);
+CreateColumnIfNotExists(nCol).SetEditText(nRow, rEditText, pEditPool);
 }
 
 SCROW ScTable::GetFirstEditTextRow( SCCOL nCol1, SCROW nRow1, SCCOL nCol2, 

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

2019-08-14 Thread Mike Kaganski (via logerrit)
 xmlsecurity/source/dialogs/digitalsignaturesdialog.cxx |   21 -
 1 file changed, 11 insertions(+), 10 deletions(-)

New commits:
commit 7001ddff6303734f0276b863c9fd8908443f05da
Author: Mike Kaganski 
AuthorDate: Wed Aug 14 13:18:05 2019 +0200
Commit: Mike Kaganski 
CommitDate: Wed Aug 14 18:31:39 2019 +0200

Simplify OUString array initialization

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

diff --git a/xmlsecurity/source/dialogs/digitalsignaturesdialog.cxx 
b/xmlsecurity/source/dialogs/digitalsignaturesdialog.cxx
index 67545e3bb561..6f0407433f2f 100644
--- a/xmlsecurity/source/dialogs/digitalsignaturesdialog.cxx
+++ b/xmlsecurity/source/dialogs/digitalsignaturesdialog.cxx
@@ -454,15 +454,16 @@ IMPL_LINK_NOARG(DigitalSignaturesDialog, 
CertMgrButtonHdl, weld::Button&, void)
 // FIXME: call GpgME::dirInfo("bindir") somewhere in
 // SecurityEnvironmentGpg or whatnot
 // FIXME: perhaps poke GpgME for uiserver, and hope it returns something 
useful?
-const OUString aGUIServers[] = { OUString("Gpg4win\\kleopatra.exe"),
- OUString("Gpg4win\\bin\\kleopatra.exe"),
- OUString("GNU\\GnuPG\\kleopatra.exe"),
- OUString("GNU\\GnuPG\\launch-gpa.exe"),
- OUString("GNU\\GnuPG\\gpa.exe"),
- OUString("GnuPG\\bin\\gpa.exe"),
- 
OUString("GNU\\GnuPG\\bin\\kleopatra.exe"),
- 
OUString("GNU\\GnuPG\\bin\\launch-gpa.exe"),
- OUString("GNU\\GnuPG\\bin\\gpa.exe") };
+static const OUStringLiteral aGUIServers[] = { "Gpg4win\\kleopatra.exe",
+   
"Gpg4win\\bin\\kleopatra.exe",
+   "GNU\\GnuPG\\kleopatra.exe",
+   
"GNU\\GnuPG\\launch-gpa.exe",
+   "GNU\\GnuPG\\gpa.exe",
+   "GnuPG\\bin\\gpa.exe",
+   
"GNU\\GnuPG\\bin\\kleopatra.exe",
+   
"GNU\\GnuPG\\bin\\launch-gpa.exe",
+   "GNU\\GnuPG\\bin\\gpa.exe",
+ };
 static const OUString aPath = [] {
 OUString sRet;
 PWSTR sPath = nullptr;
@@ -478,7 +479,7 @@ IMPL_LINK_NOARG(DigitalSignaturesDialog, CertMgrButtonHdl, 
weld::Button&, void)
 if (aPath.isEmpty())
 return;
 #else
-const OUString aGUIServers[] = { OUString("kleopatra"), 
OUString("seahorse"),  OUString("gpa"), OUString("kgpg") };
+static const OUStringLiteral aGUIServers[] = { "kleopatra", "seahorse", 
"gpa", "kgpg" };
 const char* cPath = getenv("PATH");
 if (!cPath)
 return;
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

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

2019-08-16 Thread Mike Kaganski (via logerrit)
 sw/source/core/unocore/unoobj.cxx |   13 -
 1 file changed, 4 insertions(+), 9 deletions(-)

New commits:
commit 17eb2f4d403cdbbacb8fa2c14a006b25241815d4
Author: Mike Kaganski 
AuthorDate: Fri Aug 16 15:07:12 2019 +0200
Commit: Mike Kaganski 
CommitDate: Sat Aug 17 07:05:07 2019 +0200

Use a nice way of merging ranges

... which will ensure correct sorted order of the ranges.

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

diff --git a/sw/source/core/unocore/unoobj.cxx 
b/sw/source/core/unocore/unoobj.cxx
index 0b1b3c78b083..e47a0b11a904 100644
--- a/sw/source/core/unocore/unoobj.cxx
+++ b/sw/source/core/unocore/unoobj.cxx
@@ -1783,7 +1783,8 @@ void SwUnoCursorHelper::SetPropertyValues(
 OUString aUnknownExMsg, aPropertyVetoExMsg;
 
 // Build set of attributes we want to fetch
-std::vector aWhichPairs;
+const sal_uInt16 zero = 0;
+SfxItemSet aItemSet(pDoc->GetAttrPool(), );
 std::vector> 
aEntries;
 aEntries.reserve(rPropertyValues.getLength());
 for (const auto& rPropVal : rPropertyValues)
@@ -1803,19 +1804,13 @@ void SwUnoCursorHelper::SetPropertyValues(
 {
 aPropertyVetoExMsg += "Property is read-only: '" + rPropertyName + 
"' ";
 continue;
-} else {
-// FIXME: we should have some nice way of merging ranges surely ?
-aWhichPairs.push_back(pEntry->nWID);
-aWhichPairs.push_back(pEntry->nWID);
 }
+aItemSet.MergeRange(pEntry->nWID, pEntry->nWID);
 aEntries.emplace_back(pEntry, rPropVal.Value);
 }
 
-if (!aWhichPairs.empty())
+if (!aEntries.empty())
 {
-aWhichPairs.push_back(0); // terminate
-SfxItemSet aItemSet(pDoc->GetAttrPool(), aWhichPairs.data());
-
 // Fetch, overwrite, and re-set the attributes from the core
 
 bool bPreviousPropertyCausesSideEffectsInNodes = false;
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

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

2019-08-17 Thread Mike Kaganski (via logerrit)
 sw/source/uibase/utlui/uitool.cxx |   36 ++--
 1 file changed, 6 insertions(+), 30 deletions(-)

New commits:
commit e0826f8e18b5ad8f8743a4aa2fb78bffda2524f8
Author: Mike Kaganski 
AuthorDate: Sat Aug 17 18:20:09 2019 +0300
Commit: Mike Kaganski 
CommitDate: Sun Aug 18 07:31:08 2019 +0200

Related: tdf#126787: remove some defensive programming parts

I assume that these shouldn't be possible. If I am wrong, this commit
is easy to revert.

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

diff --git a/sw/source/uibase/utlui/uitool.cxx 
b/sw/source/uibase/utlui/uitool.cxx
index 0ed3fe8b24a5..034bb5eaf990 100644
--- a/sw/source/uibase/utlui/uitool.cxx
+++ b/sw/source/uibase/utlui/uitool.cxx
@@ -145,25 +145,18 @@ void ConvertAttrCharToGen(SfxItemSet& rSet)
 // Tell dialogs to use character-specific slots/whichIds
 // tdf#126684: We use RES_PARATR_GRABBAG, because RES_CHRATR_GRABBAG may 
be overwritten later in
 // SwDocStyleSheet::GetItemSet when applying attributes from char format
-std::unique_ptr pGrabBag;
-const SfxPoolItem *pTmpItem;
-if (SfxItemState::SET == rSet.GetItemState(RES_PARATR_GRABBAG, false, 
))
-{
-SAL_WARN("sw.ui", "Unexpected: non-empty paragraph grab bag in 
character item set!");
-pGrabBag.reset(static_cast(pTmpItem->Clone()));
-}
-else
-pGrabBag.reset(new SfxGrabBagItem(RES_PARATR_GRABBAG));
-pGrabBag->GetGrabBag()["DialogUseCharAttr"] <<= true;
+assert(SfxItemState::SET != rSet.GetItemState(RES_PARATR_GRABBAG, false));
+SfxGrabBagItem aGrabBag(RES_PARATR_GRABBAG);
+aGrabBag.GetGrabBag()["DialogUseCharAttr"] <<= true;
 // Store initial ranges to allow restoring later
 const sal_uInt16* pRanges = rSet.GetRanges();
 const sal_uInt16* pEnd = pRanges;
 while (*pEnd)
 ++pEnd;
 const uno::Sequence aOrigRanges(pRanges, pEnd - pRanges + 1);
-pGrabBag->GetGrabBag()["OrigItemSetRanges"] <<= aOrigRanges;
+aGrabBag.GetGrabBag()["OrigItemSetRanges"] <<= aOrigRanges;
 rSet.MergeRange(RES_PARATR_GRABBAG, RES_PARATR_GRABBAG);
-rSet.Put(std::move(pGrabBag));
+rSet.Put(aGrabBag);
 }
 
 void ConvertAttrGenToChar(SfxItemSet& rSet, const SfxItemSet& rOrigSet)
@@ -204,24 +197,7 @@ void ConvertAttrGenToChar(SfxItemSet& rSet, const 
SfxItemSet& rOrigSet)
 rSet.SetRanges(aOrigRanges.getConstArray());
 }
 }
-if (SfxItemState::SET == rSet.GetItemState(RES_PARATR_GRABBAG, false, 
))
-{
-// In fact, we should not reach here: it shouldn't have been there; 
and even if it was, it
-// should have been erased on the previous step when restoring 
original ranges
-SAL_WARN("sw.ui", "Unexpected: paragraph grab bag in character item 
set!");
-SfxGrabBagItem aGrabBag(*static_cast(pTmpItem));
-std::map& rMap = aGrabBag.GetGrabBag();
-// Remove temporary GrabBag entries
-rMap.erase("DialogUseCharAttr");
-rMap.erase("OrigItemSetRanges");
-if (rMap.empty())
-rSet.ClearItem(RES_PARATR_GRABBAG);
-else
-{
-SAL_WARN("sw.ui", "Unexpected: non-empty paragraph grab bag in 
character item set!");
-rSet.Put(aGrabBag);
-}
-}
+assert(SfxItemState::SET != rSet.GetItemState(RES_PARATR_GRABBAG, false));
 }
 
 void ApplyCharBackground(const Color& rBackgroundColor, SwWrtShell& rShell)
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

[Libreoffice-commits] core.git: Branch 'libreoffice-6-3' - extensions/source

2019-08-19 Thread Mike Kaganski (via logerrit)
 extensions/source/scanner/twain32shim.cxx |3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

New commits:
commit 704a9a86600a5a60d668140790fc916b5014bef9
Author: Mike Kaganski 
AuthorDate: Sun Aug 18 10:43:51 2019 +0200
Commit: Xisco Faulí 
CommitDate: Mon Aug 19 12:23:35 2019 +0200

tdf#126989: always terminate shim after fallback complete

It seems that DSM may not send MSG_CLOSEDSREQ (or we may already have
unloaded DSM), so don't rely on it.

Change-Id: I3ed2e0e70f4dc79c89b430b4bad6954bf9224c71
Reviewed-on: https://gerrit.libreoffice.org/77659
Tested-by: Jenkins
Reviewed-by: Mike Kaganski 
(cherry picked from commit 53e4d5fe73d98b109d79fc2c1f5032faea88afb9)
Reviewed-on: https://gerrit.libreoffice.org/77664
Reviewed-by: Xisco Faulí 

diff --git a/extensions/source/scanner/twain32shim.cxx 
b/extensions/source/scanner/twain32shim.cxx
index 49d6787eb69f..f813ff83d4cb 100644
--- a/extensions/source/scanner/twain32shim.cxx
+++ b/extensions/source/scanner/twain32shim.cxx
@@ -511,8 +511,7 @@ void ImpTwain::ImplFallbackHdl(WPARAM nEvent)
 {
 if (nEvent > TWAIN_EVENT_NONE)
 NotifyParent(nEvent, reinterpret_cast(m_hMap));
-if (nEvent == TWAIN_EVENT_QUIT)
-PostQuitMessage(0);
+PostQuitMessage(0);
 
 bFallback = false;
 }
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-6.2' - 3 commits - scripting/source sfx2/source shell/source

2019-08-21 Thread Mike Kaganski (via logerrit)
 scripting/source/protocolhandler/scripthandler.cxx |9 +++--
 scripting/source/pyprov/pythonscript.py|4 +++-
 sfx2/source/doc/objmisc.cxx|   21 -
 shell/source/win32/SysShExec.cxx   |4 +++-
 4 files changed, 25 insertions(+), 13 deletions(-)

New commits:
commit 34c38548620ec20d34741badf94356c6987291da
Author: Mike Kaganski 
AuthorDate: Thu Aug 1 10:52:12 2019 +0200
Commit: Andras Timar 
CommitDate: Wed Aug 21 20:31:16 2019 +0200

tdf#126641: don't fail on file URLs with fragment

This only fixes part that the URL refuses to open the target file.
Honoring fragment isn't fixed here, since it's the system call to
ShellExecuteExW that in this case internally converts the file URL
into a system path, and strips the fragment from it.

Regression from commit d59ec4cd1660410fa1b18c50d2d83b1417a82ddc.

Change-Id: I6c9ed27e9a5bd7f2780dd3be96f816a6e825e043
Reviewed-on: https://gerrit.libreoffice.org/76778
Tested-by: Jenkins
Reviewed-by: Mike Kaganski 
(cherry picked from commit 2207269a84c7c9920af3385b837ce67978c720b4)
Reviewed-on: https://gerrit.libreoffice.org/76848
Reviewed-by: Stephan Bergmann 
(cherry picked from commit dd2b7919058fc0e23a7117d39110d3ecaaad1fb2)
Reviewed-on: https://gerrit.libreoffice.org/76881
Reviewed-by: Michael Stahl 
Reviewed-on: https://gerrit.libreoffice.org/77893
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Andras Timar 

diff --git a/shell/source/win32/SysShExec.cxx b/shell/source/win32/SysShExec.cxx
index 4786e4ddedc7..910aae1c095f 100644
--- a/shell/source/win32/SysShExec.cxx
+++ b/shell/source/win32/SysShExec.cxx
@@ -315,7 +315,9 @@ void SAL_CALL CSysShExec::execute( const OUString& 
aCommand, const OUString& aPa
 }
 if (uri->getScheme().equalsIgnoreAsciiCase("file")) {
 OUString pathname;
-auto const e1 = osl::FileBase::getSystemPathFromFileURL(aCommand, 
pathname);
+uri->clearFragment(); // getSystemPathFromFileURL fails for URLs 
with fragment
+auto const e1
+= 
osl::FileBase::getSystemPathFromFileURL(uri->getUriReference(), pathname);
 if (e1 != osl::FileBase::E_None) {
 throw css::lang::IllegalArgumentException(
 ("XSystemShellExecute.execute, getSystemPathFromFileURL <" 
+ aCommand
commit 8ac0acb0e4a9017fdde8515fd5f7957307767e5b
Author: Stephan Bergmann 
AuthorDate: Sat Aug 3 16:37:48 2019 +0100
Commit: Andras Timar 
CommitDate: Wed Aug 21 20:30:57 2019 +0200

keep name percent-encoded

Change-Id: I470c4b24192c3e3c9b556a9bbb3b084359e0033b
Reviewed-on: https://gerrit.libreoffice.org/77006
Tested-by: Jenkins
Reviewed-by: Caolán McNamara 
Tested-by: Caolán McNamara 
Reviewed-on: https://gerrit.libreoffice.org/77896
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Andras Timar 

diff --git a/scripting/source/pyprov/pythonscript.py 
b/scripting/source/pyprov/pythonscript.py
index f1b2bfc75ee3..64e1337d642e 100644
--- a/scripting/source/pyprov/pythonscript.py
+++ b/scripting/source/pyprov/pythonscript.py
@@ -219,7 +219,9 @@ class MyUriHelper:
 
 # path to the .py file + "$functionname, arguments, etc
 xStorageUri = self.m_uriRefFac.parse(scriptURI)
-sStorageUri = xStorageUri.getName().replace( "|", "/" );
+# getName will apply url-decoding to the name, so encode back
+sStorageUri = xStorageUri.getName().replace("%", "%25")
+sStorageUri = sStorageUri.replace( "|", "/" )
 
 # path to the .py file, relative to the base
 sFileUri = sStorageUri[0:sStorageUri.find("$")]
commit 1c1207a220577afb12ea3e53b9c244c8a8076bce
Author: Stephan Bergmann 
AuthorDate: Tue Aug 6 13:29:22 2019 +0200
Commit: Andras Timar 
CommitDate: Wed Aug 21 20:30:40 2019 +0200

Properly obtain location

Change-Id: I9fb0d883a3623394343cd54ef61e5610544198c8
Reviewed-on: https://gerrit.libreoffice.org/77019
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann 
(cherry picked from commit a9cde2557242a0c343d99533f3ee032599c66f42)
Reviewed-on: https://gerrit.libreoffice.org/77023
Reviewed-by: Caolán McNamara 
Tested-by: Caolán McNamara 
Reviewed-on: https://gerrit.libreoffice.org/77897
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Andras Timar 

diff --git a/scripting/source/protocolhandler/scripthandler.cxx 
b/scripting/source/protocolhandler/scripthandler.cxx
index f8ad8c7fd63d..332d4833a6f2 100644
--- a/scripting/source/protocolhandler/scripthandler.cxx
+++ b/scripting/source/protocolhandler/scripthandler.cxx
@@ -49,6 +49,7 @@
 
 #include 
 #include 
+#include 
 #include 
 
 #include 
@@ -135,8 +136,12 @@ void SAL_CALL 
ScriptProtocolHandler::dispatchWithNotification(
 {
 try
 {
-

[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: package/source

2019-08-21 Thread Mike Kaganski (via logerrit)
 package/source/xstor/owriteablestream.cxx |   41 +++---
 1 file changed, 16 insertions(+), 25 deletions(-)

New commits:
commit 0d1490dbbdd6a4cbe2486f993517383cc8112003
Author: Mike Kaganski 
AuthorDate: Wed Aug 21 17:00:35 2019 +0200
Commit: Mike Kaganski 
CommitDate: Thu Aug 22 06:57:52 2019 +0200

Deduplicate some code

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

diff --git a/package/source/xstor/owriteablestream.cxx 
b/package/source/xstor/owriteablestream.cxx
index 041363cb5142..1c9332e9e845 100644
--- a/package/source/xstor/owriteablestream.cxx
+++ b/package/source/xstor/owriteablestream.cxx
@@ -930,43 +930,34 @@ uno::Sequence< beans::PropertyValue > 
OWriteStream_Impl::InsertOwnProps(
 bool 
bUseCommonEncryption )
 {
 uno::Sequence< beans::PropertyValue > aResult( aProps );
-sal_Int32 nLen = aResult.getLength();
+beans::PropertyValue aPropVal;
 
 if ( m_nStorageType == embed::StorageFormats::PACKAGE )
 {
-for ( sal_Int32 nInd = 0; nInd < nLen; nInd++ )
-if ( aResult[nInd].Name == "UseCommonStoragePasswordEncryption" )
-{
-aResult[nInd].Value <<= bUseCommonEncryption;
-return aResult;
-}
-
-aResult.realloc( ++nLen );
-aResult[nLen - 1].Name = "UseCommonStoragePasswordEncryption";
-aResult[nLen - 1].Value <<= bUseCommonEncryption;
+aPropVal.Name = "UseCommonStoragePasswordEncryption";
+aPropVal.Value <<= bUseCommonEncryption;
 }
 else if ( m_nStorageType == embed::StorageFormats::OFOPXML )
 {
 ReadRelInfoIfNecessary();
 
-uno::Any aValue;
+aPropVal.Name = "RelationsInfo";
 if ( m_nRelInfoStatus == RELINFO_READ )
-aValue <<= m_aOrigRelInfo;
+aPropVal.Value <<= m_aOrigRelInfo;
 else if ( m_nRelInfoStatus == RELINFO_CHANGED_STREAM_READ || 
m_nRelInfoStatus == RELINFO_CHANGED )
-aValue <<= m_aNewRelInfo;
+aPropVal.Value <<= m_aNewRelInfo;
 else // m_nRelInfoStatus == RELINFO_CHANGED_BROKEN || m_nRelInfoStatus 
== RELINFO_BROKEN
 throw io::IOException( "Wrong relinfo stream!" );
-
-for ( sal_Int32 nInd = 0; nInd < nLen; nInd++ )
-if ( aResult[nInd].Name == "RelationsInfo" )
-{
-aResult[nInd].Value = aValue;
-return aResult;
-}
-
-aResult.realloc( ++nLen );
-aResult[nLen - 1].Name = "RelationsInfo";
-aResult[nLen - 1].Value = aValue;
+}
+if (!aPropVal.Name.isEmpty())
+{
+sal_Int32 i = 0;
+for (auto p = aResult.getConstArray(); i < aResult.getLength(); ++i)
+if (p[i].Name == aPropVal.Name)
+break;
+if (i == aResult.getLength())
+aResult.realloc(i + 1);
+aResult[i] = aPropVal;
 }
 
 return aResult;
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

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

2019-08-22 Thread Mike Kaganski (via logerrit)
 include/drawinglayer/primitive2d/baseprimitive2d.hxx |4 ++--
 include/drawinglayer/primitive3d/baseprimitive3d.hxx |4 ++--
 sc/inc/rangelst.hxx  |2 +-
 sc/source/core/tool/rangelst.cxx |4 ++--
 4 files changed, 7 insertions(+), 7 deletions(-)

New commits:
commit fe546ea0c2e2b2cb8ad68a0d4e0955fc3c963c1e
Author: Mike Kaganski 
AuthorDate: Thu Aug 22 12:19:08 2019 +0300
Commit: Mike Kaganski 
CommitDate: Thu Aug 22 13:20:10 2019 +0200

Move ctors/assignments need non-const rvalue reference to actually move

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

diff --git a/include/drawinglayer/primitive2d/baseprimitive2d.hxx 
b/include/drawinglayer/primitive2d/baseprimitive2d.hxx
index 5725908fb523..e7e83d9e06c3 100644
--- a/include/drawinglayer/primitive2d/baseprimitive2d.hxx
+++ b/include/drawinglayer/primitive2d/baseprimitive2d.hxx
@@ -76,7 +76,7 @@ namespace drawinglayer { namespace primitive2d {
 explicit Primitive2DContainer( size_type count ) : deque(count) {}
 virtual ~Primitive2DContainer() override;
 Primitive2DContainer( const Primitive2DContainer& other ) : 
deque(other) {}
-Primitive2DContainer( const Primitive2DContainer&& other ) : 
deque(other) {}
+Primitive2DContainer( Primitive2DContainer&& other ) : 
deque(std::move(other)) {}
 Primitive2DContainer( const std::deque< Primitive2DReference >& other 
) : deque(other) {}
 Primitive2DContainer( std::initializer_list init 
) : deque(init) {}
 template 
@@ -87,7 +87,7 @@ namespace drawinglayer { namespace primitive2d {
 virtual void append(Primitive2DContainer&& rSource) override;
 void append(const Primitive2DSequence& rSource);
 Primitive2DContainer& operator=(const Primitive2DContainer& r) { 
deque::operator=(r); return *this; }
-Primitive2DContainer& operator=(const Primitive2DContainer&& r) { 
deque::operator=(r); return *this; }
+Primitive2DContainer& operator=(Primitive2DContainer&& r) { 
deque::operator=(std::move(r)); return *this; }
 bool operator==(const Primitive2DContainer& rB) const;
 bool operator!=(const Primitive2DContainer& rB) const { return 
!operator==(rB); }
 basegfx::B2DRange getB2DRange(const geometry::ViewInformation2D& 
aViewInformation) const;
diff --git a/include/drawinglayer/primitive3d/baseprimitive3d.hxx 
b/include/drawinglayer/primitive3d/baseprimitive3d.hxx
index 70c9f63ab1af..8d4f683ef267 100644
--- a/include/drawinglayer/primitive3d/baseprimitive3d.hxx
+++ b/include/drawinglayer/primitive3d/baseprimitive3d.hxx
@@ -60,14 +60,14 @@ namespace drawinglayer { namespace primitive3d {
 explicit Primitive3DContainer() {}
 explicit Primitive3DContainer( size_type count ) : deque(count) {}
 Primitive3DContainer( const Primitive3DContainer& other ) : 
deque(other) {}
-Primitive3DContainer( const Primitive3DContainer&& other ) : 
deque(other) {}
+Primitive3DContainer( Primitive3DContainer&& other ) : 
deque(std::move(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; }
-Primitive3DContainer& operator=(const Primitive3DContainer&& r) { 
deque::operator=(r); return *this; }
+Primitive3DContainer& operator=(Primitive3DContainer&& r) { 
deque::operator=(std::move(r)); return *this; }
 bool operator==(const Primitive3DContainer& rB) const;
 bool operator!=(const Primitive3DContainer& rB) const { return 
!operator==(rB); }
 basegfx::B3DRange getB3DRange(const geometry::ViewInformation3D& 
aViewInformation) const;
diff --git a/sc/inc/rangelst.hxx b/sc/inc/rangelst.hxx
index 4aff9611e885..079e1a646ab5 100644
--- a/sc/inc/rangelst.hxx
+++ b/sc/inc/rangelst.hxx
@@ -34,7 +34,7 @@ class SAL_WARN_UNUSED SC_DLLPUBLIC ScRangeList final : public 
SvRefBase
 public:
 ScRangeList();
 ScRangeList( const ScRangeList& rList );
-ScRangeList( const ScRangeList&& rList );
+ScRangeList( ScRangeList&& rList );
 ScRangeList( const ScRange& rRange );
 virtual ~ScRangeList() override;
 
diff --git a/sc/source/core/tool/rangelst.cxx b/sc/source/core/tool/rangelst.cxx
index 4298bb1ea92e..ce5e75bd403c 100644
--- a/sc/source/core/tool/rangelst.cxx
+++ b/sc/source/core/tool/rangelst.cxx
@@ -983,9 +983,9 @@ ScRangeList::ScRangeList( const ScRangeList& rList ) :
 {
 }
 
-ScRangeList::ScRangeList( const ScRangeList&& rList ) :
+ScRangeList::ScRangeList( ScRangeList&& rList ) :
 SvRefBase(),
-maRanges(rList.maRanges),
+

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

2019-08-20 Thread Mike Kaganski (via logerrit)
 xmloff/source/style/XMLFontAutoStylePool.cxx |5 +
 1 file changed, 1 insertion(+), 4 deletions(-)

New commits:
commit 3e52f67c49b5cde7661d0cca2ea72ff10d55a12c
Author: Mike Kaganski 
AuthorDate: Tue Aug 20 14:32:46 2019 +0200
Commit: Mike Kaganski 
CommitDate: Tue Aug 20 15:56:03 2019 +0200

Simplify iteration over XMLFontAutoStylePool_Impl

... which has begin() and end().

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

diff --git a/xmloff/source/style/XMLFontAutoStylePool.cxx 
b/xmloff/source/style/XMLFontAutoStylePool.cxx
index af44e28525d7..d8e9462f965c 100644
--- a/xmloff/source/style/XMLFontAutoStylePool.cxx
+++ b/xmloff/source/style/XMLFontAutoStylePool.cxx
@@ -394,16 +394,13 @@ void XMLFontAutoStylePool::exportXML()
 const SvXMLUnitConverter& rUnitConv = GetExport().GetMM100UnitConverter();
 
 std::map fontFilesMap; // our url to document url
-sal_uInt32 nCount = m_pFontAutoStylePool->size();
 
 std::unordered_set aUsedFontNames;
 if (m_bEmbedUsedOnly)
 aUsedFontNames = getUsedFontList();
 
-for (sal_uInt32 i = 0; i < nCount; i++)
+for (const auto& pEntry : *m_pFontAutoStylePool)
 {
-const XMLFontAutoStylePoolEntry_Impl* pEntry = 
(*m_pFontAutoStylePool)[i].get();
-
 GetExport().AddAttribute(XML_NAMESPACE_STYLE, XML_NAME, 
pEntry->GetName());
 
 aAny <<= pEntry->GetFamilyName();
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

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

2019-08-24 Thread Mike Kaganski (via logerrit)
 connectivity/source/drivers/odbc/OTools.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 3ab2e7ba46eac104738ab074a7df42e1bddd4d37
Author: Mike Kaganski 
AuthorDate: Sat Aug 24 23:18:37 2019 +0200
Commit: Mike Kaganski 
CommitDate: Sun Aug 25 01:38:19 2019 +0200

Fix build on big-endian platforms with clang

Reportedly, this builds OK with gcc, but not with clang (rightfully).


/tmp/usr/ports/editors/libreoffice/work/libreoffice-6.3.0.4/connectivity/source/drivers/odbc/OTools.cxx:148:21:
error: arithmetic on a pointer to void
_pValue += _nSize - properSize;
~~~ ^
1 error generated.

The pointer arithmetics on void* was introduced in 2012 in commit
63b6b1d6120d82c4baf5cb679d75dcc5427dbbc3.

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

diff --git a/connectivity/source/drivers/odbc/OTools.cxx 
b/connectivity/source/drivers/odbc/OTools.cxx
index a4c3200c5b53..a5395aaf7ff3 100644
--- a/connectivity/source/drivers/odbc/OTools.cxx
+++ b/connectivity/source/drivers/odbc/OTools.cxx
@@ -145,7 +145,7 @@ void OTools::getValue(  OConnection const * _pConnection,
 memset(_pValue, 0, _nSize);
 #ifdef OSL_BIGENDIAN
 // This is skewed in favour of integer types
-_pValue += _nSize - properSize;
+_pValue = static_cast(_pValue) + _nSize - properSize;
 #endif
 }
 }
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

[Libreoffice-commits] core.git: external/gpgmepp

2019-08-27 Thread Mike Kaganski (via logerrit)
 external/gpgmepp/UnpackedTarball_gpgmepp.mk |2 ++
 1 file changed, 2 insertions(+)

New commits:
commit ff898ea321299b370d3776430c490ad4acc3b0d2
Author: Mike Kaganski 
AuthorDate: Tue Aug 27 15:33:36 2019 +0200
Commit: Mike Kaganski 
CommitDate: Wed Aug 28 07:32:27 2019 +0200

Record patch as upstreamed

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

diff --git a/external/gpgmepp/UnpackedTarball_gpgmepp.mk 
b/external/gpgmepp/UnpackedTarball_gpgmepp.mk
index 4dfee72890b5..9fc213c7e51c 100644
--- a/external/gpgmepp/UnpackedTarball_gpgmepp.mk
+++ b/external/gpgmepp/UnpackedTarball_gpgmepp.mk
@@ -13,6 +13,8 @@ $(eval $(call 
gb_UnpackedTarball_set_tarball,gpgmepp,$(GPGME_TARBALL)))
 
 $(eval $(call gb_UnpackedTarball_set_patchlevel,gpgmepp,0))
 
+# * external/gpgmepp/add-gpgme_set_global_flag-wrapper.patch upstreamed at
+#    "No gpgmepp API to call 
gpgme_set_global_flag"
 # * external/gpgmepp/version.patch upstream at  
"gpgme: `make dist`
 #   introduced VERSION can clash with new C++ ":
 $(eval $(call gb_UnpackedTarball_add_patches,gpgmepp, \
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

[Libreoffice-commits] core.git: Repository.mk scp2/AutoInstall.mk scp2/InstallModule_spsupp.mk scp2/InstallScript_setup_osl.mk scp2/Module_scp2.mk scp2/source

2019-08-30 Thread Mike Kaganski (via logerrit)
 Repository.mk|   14 +-
 scp2/AutoInstall.mk  |1 +
 scp2/InstallModule_spsupp.mk |   20 
 scp2/InstallScript_setup_osl.mk  |1 +
 scp2/Module_scp2.mk  |1 +
 scp2/source/spsupp/module_spsupp.scp |   26 ++
 6 files changed, 54 insertions(+), 9 deletions(-)

New commits:
commit 99dd418c94e2b85fca1a13a0c15aa117582da574
Author: Mike Kaganski 
AuthorDate: Thu Aug 29 16:56:23 2019 +0300
Commit: Mike Kaganski 
CommitDate: Fri Aug 30 15:02:00 2019 +0200

Move spsupp components to a separate installer feature

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

diff --git a/Repository.mk b/Repository.mk
index d292bd461201..e4eadbd2b927 100644
--- a/Repository.mk
+++ b/Repository.mk
@@ -208,7 +208,6 @@ $(eval $(call 
gb_Helper_register_executables_for_install,OOO,ooo, \
) \
$(if $(filter WNT,$(OS)), \
senddoc \
-   spsupp_helper \
) \
$(if $(filter OPENCL,$(BUILD_TYPE)),opencltest) \
 ))
@@ -673,17 +672,14 @@ $(eval $(call 
gb_Helper_register_libraries_for_install,PLAINLIBS_OOO,activexwin6
 ))
 endif
 
-ifneq ($(CXX_X64_BINARY),)
-$(eval $(call gb_Helper_register_libraries_for_install,PLAINLIBS_OOO,ooo, \
-   spsupp_x64 \
+$(eval $(call gb_Helper_register_executables_for_install,OOO,spsuppfiles, \
+   spsupp_helper \
 ))
-endif
 
-ifneq ($(CXX_X86_BINARY),)
-$(eval $(call gb_Helper_register_libraries_for_install,PLAINLIBS_OOO,ooo, \
-   spsupp_x86 \
+$(eval $(call 
gb_Helper_register_libraries_for_install,PLAINLIBS_OOO,spsuppfiles, \
+   $(if $(CXX_X64_BINARY),spsupp_x64) \
+   $(if $(CXX_X86_BINARY),spsupp_x86) \
 ))
-endif
 
 $(eval $(call 
gb_Helper_register_libraries_for_install,PLAINLIBS_OOO,ooobinarytable, \
$(if $(WINDOWS_SDK_HOME),\
diff --git a/scp2/AutoInstall.mk b/scp2/AutoInstall.mk
index 7c9d6c4538bd..9b18c1ecce08 100644
--- a/scp2/AutoInstall.mk
+++ b/scp2/AutoInstall.mk
@@ -45,6 +45,7 @@ $(eval $(call 
gb_AutoInstall_add_module,pdfimport,LIBO_LIB_FILE,LIBO_EXECUTABLE,
 $(eval $(call gb_AutoInstall_add_module,quickstart,,LIBO_EXECUTABLE))
 $(eval $(call 
gb_AutoInstall_add_module,reportbuilder,LIBO_LIB_FILE,,LIBO_JAR_FILE,PACKAGE_FILELIST))
 $(eval $(call 
gb_AutoInstall_add_module,sdk,,SDK_EXECUTABLE,,SDK_PACKAGE_FILELIST))
+$(eval $(call 
gb_AutoInstall_add_module,spsuppfiles,LIBO_LIB_FILE,LIBO_EXECUTABLE))
 $(eval $(call 
gb_AutoInstall_add_module,ure,URE_PRIVATE_LIB,URE_EXECUTABLE,URE_JAR_FILE,PACKAGE_FILELIST))
 $(eval $(call 
gb_AutoInstall_add_module,winexplorerextbinarytable,LIBO_LIB_FILE_BINARYTABLE))
 $(eval $(call gb_AutoInstall_add_module,winexplorerext,SHLXTHDL_LIB_FILE))
diff --git a/scp2/InstallModule_spsupp.mk b/scp2/InstallModule_spsupp.mk
new file mode 100644
index ..7d01a7b020ed
--- /dev/null
+++ b/scp2/InstallModule_spsupp.mk
@@ -0,0 +1,20 @@
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#
+# 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/.
+#
+
+$(eval $(call gb_InstallModule_InstallModule,scp2/spsupp))
+
+$(eval $(call gb_InstallModule_use_auto_install_libs,scp2/spsupp,\
+spsuppfiles \
+))
+
+$(eval $(call gb_InstallModule_add_scpfiles,scp2/spsupp,\
+scp2/source/spsupp/module_spsupp \
+))
+
+# vim: set shiftwidth=4 tabstop=4 noexpandtab:
diff --git a/scp2/InstallScript_setup_osl.mk b/scp2/InstallScript_setup_osl.mk
index 081f9dc6e26c..0c3b97bef6d7 100644
--- a/scp2/InstallScript_setup_osl.mk
+++ b/scp2/InstallScript_setup_osl.mk
@@ -24,6 +24,7 @@ $(eval $(call gb_InstallScript_use_modules,setup_osl,\
$(if $(filter WNT,$(OS)),\
scp2/activex \
scp2/quickstart \
+   scp2/spsupp \
scp2/windows \
$(if $(filter MSC,$(COM)),\
scp2/winexplorerext \
diff --git a/scp2/Module_scp2.mk b/scp2/Module_scp2.mk
index 33e89172afac..aa06d6301f85 100644
--- a/scp2/Module_scp2.mk
+++ b/scp2/Module_scp2.mk
@@ -22,6 +22,7 @@ $(eval $(call gb_Module_add_targets,scp2,\
InstallModule_onlineupdate \
InstallModule_ooo \
InstallModule_python \
+   InstallModule_spsupp \
InstallModule_ure \
InstallModule_writer \
InstallModule_xsltfilter \
diff --git a/scp2/source/spsupp/module_spsupp.scp 
b/scp2/source/spsupp/module_spsupp.scp
new file mode 100644
index ..39c547a5fa5c
--- /dev/null
+++ b/scp2/source/spsupp/module_spsupp.scp
@@ -0,0 +1,26 @@
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the 

[Libreoffice-commits] core.git: shell/Executable_spsupp_helper.mk solenv/gbuild

2019-08-30 Thread Mike Kaganski (via logerrit)
 shell/Executable_spsupp_helper.mk   |2 ++
 solenv/gbuild/platform/com_MSC_class.mk |   17 +
 2 files changed, 19 insertions(+)

New commits:
commit e607beeed1b391ee2a622494700d78d68dd2868f
Author: Mike Kaganski 
AuthorDate: Fri Aug 30 13:29:56 2019 +0300
Commit: Mike Kaganski 
CommitDate: Fri Aug 30 17:46:52 2019 +0200

Introduce gb_Executable_add_default_nativeres to add version resource

... to executables on Windows

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

diff --git a/shell/Executable_spsupp_helper.mk 
b/shell/Executable_spsupp_helper.mk
index 5daeff28da56..c905118bef58 100644
--- a/shell/Executable_spsupp_helper.mk
+++ b/shell/Executable_spsupp_helper.mk
@@ -30,6 +30,8 @@ $(eval $(call 
gb_Executable_add_exception_objects,spsupp_helper,\
 
 $(eval $(call gb_Executable_add_nativeres,spsupp_helper,spsupp_dlg))
 
+$(eval $(call gb_Executable_add_default_nativeres,spsupp_helper))
+
 $(eval $(call gb_Executable_use_system_win32_libs,spsupp_helper,\
 shell32 \
 ))
diff --git a/solenv/gbuild/platform/com_MSC_class.mk 
b/solenv/gbuild/platform/com_MSC_class.mk
index 64615ea13282..b77f9f98d731 100644
--- a/solenv/gbuild/platform/com_MSC_class.mk
+++ b/solenv/gbuild/platform/com_MSC_class.mk
@@ -328,6 +328,23 @@ $(call gb_Library_get_clean_target,$(1)) : $(call 
gb_WinResTarget_get_clean_targ
 
 endef
 
+define gb_Executable_add_default_nativeres
+$(call gb_WinResTarget_WinResTarget_init,$(1)/default)
+$(call gb_WinResTarget_set_rcfile,$(1)/default,include/default)
+$(call gb_WinResTarget_add_defs,$(1)/default,\
+   -DVERVARIANT="$(LIBO_VERSION_PATCH)" \
+   -DRES_APP_VENDOR="$(OOO_VENDOR)" \
+   -DORG_NAME="$(call gb_Executable_get_filename,$(1))"\
+   -DINTERNAL_NAME="$(subst $(gb_Executable_EXT),,$(call 
gb_Executable_get_filename,$(1)))" \
+   -DADDITIONAL_VERINFO1="" \
+   -DADDITIONAL_VERINFO2="" \
+   -DADDITIONAL_VERINFO3="" \
+)
+$(call gb_Executable_add_nativeres,$(1),$(1)/default)
+$(call gb_Executable_get_clean_target,$(1)) : $(call 
gb_WinResTarget_get_clean_target,$(1)/default)
+
+endef
+
 define gb_LinkTarget_add_nativeres
 $(call gb_LinkTarget_get_target,$(1)) : $(call gb_WinResTarget_get_target,$(2))
 $(call gb_LinkTarget_get_target,$(1)) : NATIVERES += $(call 
gb_WinResTarget_get_target,$(2))
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

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

2019-08-30 Thread Mike Kaganski (via logerrit)
 desktop/source/app/sofficemain.cxx |4 
 1 file changed, 4 insertions(+)

New commits:
commit 4e527f55d74e3220873075a8ec2799e2206fdb2d
Author: Mike Kaganski 
AuthorDate: Sat Aug 31 02:23:38 2019 +0200
Commit: Mike Kaganski 
CommitDate: Sat Aug 31 03:17:40 2019 +0200

Fix MSVC2019 build after 629dfff3c7289f185268c7088e67931f6bbd9ce0

... failing like this:

  [CXX] desktop/source/app/sofficemain.cxx
  C:\PROGRA~2\WI3CF2~1\10\Include\10.0.18362.0\um\winnt.h(656): error 
C4005: 'DECLARE_HANDLE': macro redefinition
  C:\lo\src\core\include\sal/main.h(91): note: see previous definition of 
'DECLARE_HANDLE'
  C:\PROGRA~2\WI3CF2~1\10\Include\10.0.18362.0\shared\minwindef.h(250): 
error C2371: 'HINSTANCE': redefinition; different basic types
  C:\lo\src\core\include\sal/main.h(93): note: see declaration of 
'HINSTANCE'
  make[1]: *** [C:/lo/src/core/solenv/gbuild/LinkTarget.mk:293: 
C:/lo/src/core/workdir/CxxObject/desktop/source/app/sofficemain.o] Error 2

Apparently MSVC2017 isn't affected, since the problematic commit passed
CI happliy (didn't test myself if MSVC version is actually the problem,
or maybe specific Windows SDK version).

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

diff --git a/desktop/source/app/sofficemain.cxx 
b/desktop/source/app/sofficemain.cxx
index 2a692fdae8d4..917361ebf0d3 100644
--- a/desktop/source/app/sofficemain.cxx
+++ b/desktop/source/app/sofficemain.cxx
@@ -28,6 +28,9 @@
 #include "cmdlineargs.hxx"
 #include "cmdlinehelp.hxx"
 
+// needed before sal/main.h to avoid redefinition of macros
+#include 
+
 #include 
 #include 
 #include 
@@ -62,6 +65,7 @@
 
 #endif
 
+#include 
 
 #ifdef ANDROID
 #  include 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

[Libreoffice-commits] core.git: desktop/Executable_sbase.mk desktop/Executable_scalc.mk desktop/Executable_sdraw.mk desktop/Executable_simpress.mk desktop/Executable_smath.mk desktop/Executable_soffic

2019-08-30 Thread Mike Kaganski (via logerrit)
 desktop/Executable_sbase.mk  |2 +
 desktop/Executable_scalc.mk  |2 +
 desktop/Executable_sdraw.mk  |2 +
 desktop/Executable_simpress.mk   |2 +
 desktop/Executable_smath.mk  |2 +
 desktop/Executable_soffice_bin.mk|2 +
 desktop/Executable_soffice_com.mk|2 +
 desktop/Executable_soffice_exe.mk|2 +
 desktop/Executable_sweb.mk   |2 +
 desktop/Executable_swriter.mk|2 +
 desktop/WinResTarget_sbase.mk|4 --
 desktop/WinResTarget_scalc.mk|4 --
 desktop/WinResTarget_sdraw.mk|4 --
 desktop/WinResTarget_simpress.mk |4 --
 desktop/WinResTarget_smath.mk|4 --
 desktop/WinResTarget_soffice.mk  |4 --
 desktop/WinResTarget_sofficebin.mk   |4 --
 desktop/WinResTarget_sweb.mk |4 --
 desktop/WinResTarget_swriter.mk  |4 --
 desktop/util/officeloader.rc |   41 ---
 desktop/win32/source/applauncher/launcher.rc |   41 ---
 solenv/gbuild/platform/com_MSC_class.mk  |2 -
 22 files changed, 21 insertions(+), 119 deletions(-)

New commits:
commit cb204a382da220f8b282d6da507716c918716272
Author: Mike Kaganski 
AuthorDate: Sat Aug 31 01:17:31 2019 +0300
Commit: Mike Kaganski 
CommitDate: Sat Aug 31 02:48:18 2019 +0200

Unify executables to take version resource from default.rc

Pass file description in optional second argument to
gb_Executable_add_default_nativeres.
Remove duplicating version resources from officeloader.rc and launcher.rc.

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

diff --git a/desktop/Executable_sbase.mk b/desktop/Executable_sbase.mk
index d3a4fafea810..9c36165b8b3d 100644
--- a/desktop/Executable_sbase.mk
+++ b/desktop/Executable_sbase.mk
@@ -25,4 +25,6 @@ $(eval $(call gb_Executable_add_exception_objects,sbase,\
 
 $(eval $(call gb_Executable_add_nativeres,sbase,sbase/launcher))
 
+$(eval $(call gb_Executable_add_default_nativeres,sbase,$(PRODUCTNAME) Base))
+
 # vim: set ts=4 sw=4 et:
diff --git a/desktop/Executable_scalc.mk b/desktop/Executable_scalc.mk
index 1a21840a3306..b6845690dfdb 100644
--- a/desktop/Executable_scalc.mk
+++ b/desktop/Executable_scalc.mk
@@ -25,4 +25,6 @@ $(eval $(call gb_Executable_add_exception_objects,scalc,\
 
 $(eval $(call gb_Executable_add_nativeres,scalc,scalc/launcher))
 
+$(eval $(call gb_Executable_add_default_nativeres,scalc,$(PRODUCTNAME) Calc))
+
 # vim: set ts=4 sw=4 et:
diff --git a/desktop/Executable_sdraw.mk b/desktop/Executable_sdraw.mk
index c6fd96373de1..164b65876568 100644
--- a/desktop/Executable_sdraw.mk
+++ b/desktop/Executable_sdraw.mk
@@ -25,4 +25,6 @@ $(eval $(call gb_Executable_add_exception_objects,sdraw,\
 
 $(eval $(call gb_Executable_add_nativeres,sdraw,sdraw/launcher))
 
+$(eval $(call gb_Executable_add_default_nativeres,sdraw,$(PRODUCTNAME) Draw))
+
 # vim: set ts=4 sw=4 et:
diff --git a/desktop/Executable_simpress.mk b/desktop/Executable_simpress.mk
index d06205486020..8d3bdd0543ee 100644
--- a/desktop/Executable_simpress.mk
+++ b/desktop/Executable_simpress.mk
@@ -25,4 +25,6 @@ $(eval $(call gb_Executable_add_exception_objects,simpress,\
 
 $(eval $(call gb_Executable_add_nativeres,simpress,simpress/launcher))
 
+$(eval $(call gb_Executable_add_default_nativeres,simpress,$(PRODUCTNAME) 
Impress))
+
 # vim: set ts=4 sw=4 et:
diff --git a/desktop/Executable_smath.mk b/desktop/Executable_smath.mk
index 94aa8b915f30..797354d47461 100644
--- a/desktop/Executable_smath.mk
+++ b/desktop/Executable_smath.mk
@@ -25,4 +25,6 @@ $(eval $(call gb_Executable_add_exception_objects,smath,\
 
 $(eval $(call gb_Executable_add_nativeres,smath,smath/launcher))
 
+$(eval $(call gb_Executable_add_default_nativeres,smath,$(PRODUCTNAME) Math))
+
 # vim: set ts=4 sw=4 et:
diff --git a/desktop/Executable_soffice_bin.mk 
b/desktop/Executable_soffice_bin.mk
index d8084cddeb1f..cabd31af29f2 100644
--- a/desktop/Executable_soffice_bin.mk
+++ b/desktop/Executable_soffice_bin.mk
@@ -37,6 +37,8 @@ $(eval $(call 
gb_Executable_set_targettype_gui,soffice_bin,NO))
 
 $(eval $(call gb_Executable_add_nativeres,soffice_bin,sofficebin/officeloader))
 
+$(eval $(call gb_Executable_add_default_nativeres,soffice_bin,$(PRODUCTNAME)))
+
 ifeq ($(COM),MSC)
 
 $(eval $(call gb_Executable_add_ldflags,soffice_bin,\
diff --git a/desktop/Executable_soffice_com.mk 
b/desktop/Executable_soffice_com.mk
index 8b4da6b9d94b..bc1460634421 100644
--- a/desktop/Executable_soffice_com.mk
+++ b/desktop/Executable_soffice_com.mk
@@ -26,4 +26,6 @@ $(eval $(call 
gb_Executable_add_exception_objects,soffice_com,\
 
 $(eval $(call 

[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-6.2' - Repository.mk scp2/AutoInstall.mk scp2/InstallModule_spsupp.mk scp2/InstallScript_setup_osl.mk scp2/Module_scp2.mk scp2/source

2019-08-30 Thread Mike Kaganski (via logerrit)
 Repository.mk|   14 +-
 scp2/AutoInstall.mk  |1 +
 scp2/InstallModule_spsupp.mk |   20 
 scp2/InstallScript_setup_osl.mk  |1 +
 scp2/Module_scp2.mk  |1 +
 scp2/source/spsupp/module_spsupp.scp |   26 ++
 6 files changed, 54 insertions(+), 9 deletions(-)

New commits:
commit 48e7a4eda8fd136f7d9b5a86e0d928e18ad0ad94
Author: Mike Kaganski 
AuthorDate: Thu Aug 29 16:56:23 2019 +0300
Commit: Mike Kaganski 
CommitDate: Sat Aug 31 03:32:41 2019 +0200

Move spsupp components to a separate installer feature

Change-Id: Ic95b9f887da83d0931ed54b76d23465660786a79
Reviewed-on: https://gerrit.libreoffice.org/78273
Tested-by: Jenkins
Reviewed-by: Mike Kaganski 
(cherry picked from commit 99dd418c94e2b85fca1a13a0c15aa117582da574)
Reviewed-on: https://gerrit.libreoffice.org/78295
Tested-by: Mike Kaganski 

diff --git a/Repository.mk b/Repository.mk
index 949605a8a29e..0de098bd6b1f 100644
--- a/Repository.mk
+++ b/Repository.mk
@@ -206,7 +206,6 @@ $(eval $(call 
gb_Helper_register_executables_for_install,OOO,ooo, \
) \
$(if $(filter WNT,$(OS)), \
senddoc \
-   spsupp_helper \
) \
 ))
 
@@ -674,17 +673,14 @@ $(eval $(call 
gb_Helper_register_libraries_for_install,PLAINLIBS_OOO,activexwin6
 ))
 endif
 
-ifneq ($(CXX_X64_BINARY),)
-$(eval $(call gb_Helper_register_libraries_for_install,PLAINLIBS_OOO,ooo, \
-   spsupp_x64 \
+$(eval $(call gb_Helper_register_executables_for_install,OOO,spsuppfiles, \
+   spsupp_helper \
 ))
-endif
 
-ifneq ($(CXX_X86_BINARY),)
-$(eval $(call gb_Helper_register_libraries_for_install,PLAINLIBS_OOO,ooo, \
-   spsupp_x86 \
+$(eval $(call 
gb_Helper_register_libraries_for_install,PLAINLIBS_OOO,spsuppfiles, \
+   $(if $(CXX_X64_BINARY),spsupp_x64) \
+   $(if $(CXX_X86_BINARY),spsupp_x86) \
 ))
-endif
 
 $(eval $(call 
gb_Helper_register_libraries_for_install,PLAINLIBS_OOO,ooobinarytable, \
$(if $(WINDOWS_SDK_HOME),\
diff --git a/scp2/AutoInstall.mk b/scp2/AutoInstall.mk
index 7c9d6c4538bd..9b18c1ecce08 100644
--- a/scp2/AutoInstall.mk
+++ b/scp2/AutoInstall.mk
@@ -45,6 +45,7 @@ $(eval $(call 
gb_AutoInstall_add_module,pdfimport,LIBO_LIB_FILE,LIBO_EXECUTABLE,
 $(eval $(call gb_AutoInstall_add_module,quickstart,,LIBO_EXECUTABLE))
 $(eval $(call 
gb_AutoInstall_add_module,reportbuilder,LIBO_LIB_FILE,,LIBO_JAR_FILE,PACKAGE_FILELIST))
 $(eval $(call 
gb_AutoInstall_add_module,sdk,,SDK_EXECUTABLE,,SDK_PACKAGE_FILELIST))
+$(eval $(call 
gb_AutoInstall_add_module,spsuppfiles,LIBO_LIB_FILE,LIBO_EXECUTABLE))
 $(eval $(call 
gb_AutoInstall_add_module,ure,URE_PRIVATE_LIB,URE_EXECUTABLE,URE_JAR_FILE,PACKAGE_FILELIST))
 $(eval $(call 
gb_AutoInstall_add_module,winexplorerextbinarytable,LIBO_LIB_FILE_BINARYTABLE))
 $(eval $(call gb_AutoInstall_add_module,winexplorerext,SHLXTHDL_LIB_FILE))
diff --git a/scp2/InstallModule_spsupp.mk b/scp2/InstallModule_spsupp.mk
new file mode 100644
index ..7d01a7b020ed
--- /dev/null
+++ b/scp2/InstallModule_spsupp.mk
@@ -0,0 +1,20 @@
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#
+# 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/.
+#
+
+$(eval $(call gb_InstallModule_InstallModule,scp2/spsupp))
+
+$(eval $(call gb_InstallModule_use_auto_install_libs,scp2/spsupp,\
+spsuppfiles \
+))
+
+$(eval $(call gb_InstallModule_add_scpfiles,scp2/spsupp,\
+scp2/source/spsupp/module_spsupp \
+))
+
+# vim: set shiftwidth=4 tabstop=4 noexpandtab:
diff --git a/scp2/InstallScript_setup_osl.mk b/scp2/InstallScript_setup_osl.mk
index a37a4552c139..f6522cbcdc97 100644
--- a/scp2/InstallScript_setup_osl.mk
+++ b/scp2/InstallScript_setup_osl.mk
@@ -24,6 +24,7 @@ $(eval $(call gb_InstallScript_use_modules,setup_osl,\
$(if $(filter WNT,$(OS)),\
scp2/activex \
scp2/quickstart \
+   scp2/spsupp \
scp2/windows \
$(if $(filter MSC,$(COM)),\
scp2/winexplorerext \
diff --git a/scp2/Module_scp2.mk b/scp2/Module_scp2.mk
index c414e09045cb..c65e462a7bb2 100644
--- a/scp2/Module_scp2.mk
+++ b/scp2/Module_scp2.mk
@@ -22,6 +22,7 @@ $(eval $(call gb_Module_add_targets,scp2,\
InstallModule_onlineupdate \
InstallModule_ooo \
InstallModule_python \
+   InstallModule_spsupp \
InstallModule_ure \
InstallModule_writer \
InstallModule_xsltfilter \
diff --git a/scp2/source/spsupp/module_spsupp.scp 
b/scp2/source/spsupp/module_spsupp.scp
new file mode 100644
index ..39c547a5fa5c
--- /dev/null
+++ b/scp2/source/spsupp/module_spsupp.scp
@@ -0,0 +1,26 @@
+/*
+ * This 

[Libreoffice-commits] core.git: cpputools/Executable_uno.mk dbaccess/Executable_odbcconfig.mk desktop/Executable_minidump_upload.mk desktop/Executable_quickstart.mk desktop/Executable_unoinfo.mk deskt

2019-08-30 Thread Mike Kaganski (via logerrit)
 cpputools/Executable_uno.mk   |2 ++
 dbaccess/Executable_odbcconfig.mk |2 ++
 desktop/Executable_minidump_upload.mk |2 ++
 desktop/Executable_quickstart.mk  |2 ++
 desktop/Executable_unoinfo.mk |2 ++
 desktop/Executable_unopkg.mk  |2 ++
 desktop/Executable_unopkg_bin.mk  |2 ++
 desktop/Executable_unopkg_com.mk  |2 ++
 extensions/Executable_twain32shim.mk  |2 ++
 opencl/Executable_opencltest.mk   |2 ++
 pyuno/Executable_python.mk|2 ++
 registry/Executable_regmerge.mk   |2 ++
 registry/Executable_regview.mk|2 ++
 sdext/Executable_xpdfimport.mk|2 ++
 shell/Executable_senddoc.mk   |2 ++
 svx/Executable_gengal.mk  |2 ++
 vcl/Executable_ui-previewer.mk|2 ++
 17 files changed, 34 insertions(+)

New commits:
commit c598ea1427250b50c1f3a4b0eacb34a11b2751fb
Author: Mike Kaganski 
AuthorDate: Fri Aug 30 23:01:07 2019 +0300
Commit: Mike Kaganski 
CommitDate: Sat Aug 31 00:22:28 2019 +0200

Add version resource to executables where it was missing

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

diff --git a/cpputools/Executable_uno.mk b/cpputools/Executable_uno.mk
index 4a766c57d5cf..ba3b22fb6337 100644
--- a/cpputools/Executable_uno.mk
+++ b/cpputools/Executable_uno.mk
@@ -28,4 +28,6 @@ $(eval $(call gb_Executable_add_exception_objects,uno,\
 cpputools/source/unoexe/unoexe \
 ))
 
+$(eval $(call gb_Executable_add_default_nativeres,uno))
+
 # vim:set noet sw=4 ts=4:
diff --git a/dbaccess/Executable_odbcconfig.mk 
b/dbaccess/Executable_odbcconfig.mk
index de40bdd2a6da..862c77b3b5af 100644
--- a/dbaccess/Executable_odbcconfig.mk
+++ b/dbaccess/Executable_odbcconfig.mk
@@ -26,4 +26,6 @@ $(eval $(call gb_Executable_add_exception_objects,odbcconfig,\
 dbaccess/win32/source/odbcconfig/odbcconfig \
 ))
 
+$(eval $(call gb_Executable_add_default_nativeres,odbcconfig))
+
 # vim: set noet sw=4 ts=4:
diff --git a/desktop/Executable_minidump_upload.mk 
b/desktop/Executable_minidump_upload.mk
index ccdcc97e743d..600c171e2646 100644
--- a/desktop/Executable_minidump_upload.mk
+++ b/desktop/Executable_minidump_upload.mk
@@ -20,4 +20,6 @@ $(eval $(call 
gb_Executable_add_exception_objects,minidump_upload,\
 desktop/source/minidump/minidump_upload \
 ))
 
+$(eval $(call gb_Executable_add_default_nativeres,minidump_upload))
+
 # vim: set noet sw=4 ts=4:
diff --git a/desktop/Executable_quickstart.mk b/desktop/Executable_quickstart.mk
index 02b31fef736c..f0df0bbe7abb 100644
--- a/desktop/Executable_quickstart.mk
+++ b/desktop/Executable_quickstart.mk
@@ -39,4 +39,6 @@ $(eval $(call gb_Executable_add_exception_objects,quickstart,\
 
 $(eval $(call gb_Executable_add_nativeres,quickstart,quickstart/QuickStart))
 
+$(eval $(call gb_Executable_add_default_nativeres,quickstart))
+
 # vim: set ts=4 sw=4 et:
diff --git a/desktop/Executable_unoinfo.mk b/desktop/Executable_unoinfo.mk
index 032b1a74cf21..77d1778e0242 100644
--- a/desktop/Executable_unoinfo.mk
+++ b/desktop/Executable_unoinfo.mk
@@ -17,4 +17,6 @@ $(eval $(call gb_Executable_add_exception_objects,unoinfo,\
 desktop/win32/source/unoinfo \
 ))
 
+$(eval $(call gb_Executable_add_default_nativeres,unoinfo))
+
 # vim: set ts=4 sw=4 et:
diff --git a/desktop/Executable_unopkg.mk b/desktop/Executable_unopkg.mk
index c5b341521b9f..f1b6d6be6db9 100644
--- a/desktop/Executable_unopkg.mk
+++ b/desktop/Executable_unopkg.mk
@@ -24,4 +24,6 @@ $(eval $(call gb_Executable_add_exception_objects,unopkg,\
 desktop/win32/source/guiloader/genericloader \
 ))
 
+$(eval $(call gb_Executable_add_default_nativeres,unopkg))
+
 # vim: set ts=4 sw=4 et:
diff --git a/desktop/Executable_unopkg_bin.mk b/desktop/Executable_unopkg_bin.mk
index 27ebc5db1eca..d2e1175be236 100644
--- a/desktop/Executable_unopkg_bin.mk
+++ b/desktop/Executable_unopkg_bin.mk
@@ -27,4 +27,6 @@ $(eval $(call gb_Executable_add_cobjects,unopkg_bin,\
 desktop/source/pkgchk/unopkg/unopkg_main \
 ))
 
+$(eval $(call gb_Executable_add_default_nativeres,unopkg_bin))
+
 # vim: set ts=4 sw=4 et:
diff --git a/desktop/Executable_unopkg_com.mk b/desktop/Executable_unopkg_com.mk
index 4db7d96c4f94..616a757a7fa8 100644
--- a/desktop/Executable_unopkg_com.mk
+++ b/desktop/Executable_unopkg_com.mk
@@ -15,4 +15,6 @@ $(eval $(call gb_Executable_add_exception_objects,unopkg_com,\
 desktop/win32/source/guistdio/unopkgio \
 ))
 
+$(eval $(call gb_Executable_add_default_nativeres,unopkg_com))
+
 # vim: set ts=4 sw=4 et:
diff --git a/extensions/Executable_twain32shim.mk 
b/extensions/Executable_twain32shim.mk
index 29a6e6427198..6f53ca3924ab 100644
--- a/extensions/Executable_twain32shim.mk
+++ b/extensions/Executable_twain32shim.mk
@@ -30,4 +30,6 @@ $(eval $(call 
gb_Executable_use_system_win32_libs,twain32shim,\
 shell32 \
 ))
 

[Libreoffice-commits] core.git: compilerplugins/clang cui/source dbaccess/source include/vcl sfx2/source svtools/source svx/source sw/source vcl/source

2019-09-03 Thread Mike Kaganski (via logerrit)
 compilerplugins/clang/methodcycles.py |4 ++--
 cui/source/options/optcolor.cxx   |2 +-
 dbaccess/source/ui/dlg/indexfieldscontrol.cxx |2 +-
 include/vcl/NotebookBarAddonsMerger.hxx   |2 +-
 include/vcl/builder.hxx   |2 +-
 include/vcl/builderfactory.hxx|8 
 sfx2/source/appl/newhelp.cxx  |   10 +-
 sfx2/source/sidebar/SidebarToolBox.cxx|4 ++--
 svtools/source/contnr/fileview.cxx|2 +-
 svtools/source/control/ctrlbox.cxx|6 +++---
 svtools/source/control/inettbc.cxx|2 +-
 svx/source/dialog/langbox.cxx |4 ++--
 svx/source/dialog/relfld.cxx  |2 +-
 svx/source/dialog/txencbox.cxx|2 +-
 sw/source/uibase/utlui/numfmtlb.cxx   |2 +-
 vcl/source/window/builder.cxx |3 +--
 vcl/source/window/printdlg.cxx|4 ++--
 17 files changed, 30 insertions(+), 31 deletions(-)

New commits:
commit a06b83ff927d8973c8b4a2de9a0c7ce5cd4b1f96
Author: Mike Kaganski 
AuthorDate: Tue Sep 3 10:47:07 2019 +0300
Commit: Noel Grandin 
CommitDate: Tue Sep 3 12:00:40 2019 +0200

Parent reference should be const in VCL builder entry points

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

diff --git a/compilerplugins/clang/methodcycles.py 
b/compilerplugins/clang/methodcycles.py
index 9093cebc420c..18b63c71f777 100755
--- a/compilerplugins/clang/methodcycles.py
+++ b/compilerplugins/clang/methodcycles.py
@@ -119,9 +119,9 @@ for caller in definitionSet:
 if "::~" in caller:
 to_be_removed.add(caller)
 # dyload entry points for VCL builder
-if "(VclPtr & rRet, VclPtr & pParent, 
VclBuilder::stringmap & rMap)" in caller:
+if "(VclPtr & rRet, const VclPtr & pParent, 
VclBuilder::stringmap & rMap)" in caller:
 to_be_removed.add(caller)
-if "(VclPtr &,VclPtr &,stdmap, std::allocator > > &)" in caller:
+if "(VclPtr &,const VclPtr 
&,stdmap, 
std::allocator > > &)" in caller:
 to_be_removed.add(caller)
 # find all the UNO load-by-symbol-name entrypoints
 uno_constructor_entrypoints = set()
diff --git a/cui/source/options/optcolor.cxx b/cui/source/options/optcolor.cxx
index 8e241ce744db..7cf455e821fd 100644
--- a/cui/source/options/optcolor.cxx
+++ b/cui/source/options/optcolor.cxx
@@ -859,7 +859,7 @@ void ColorConfigCtrl_Impl::dispose()
 VclVBox::dispose();
 }
 
-extern "C" SAL_DLLPUBLIC_EXPORT void makeColorConfigCtrl(VclPtr & 
rRet, VclPtr & pParent, VclBuilder::stringmap &)
+extern "C" SAL_DLLPUBLIC_EXPORT void makeColorConfigCtrl(VclPtr & 
rRet, const VclPtr & pParent, VclBuilder::stringmap &)
 {
 rRet = VclPtr::Create(pParent);
 }
diff --git a/dbaccess/source/ui/dlg/indexfieldscontrol.cxx 
b/dbaccess/source/ui/dlg/indexfieldscontrol.cxx
index e7782a560c8a..cfc8143a2288 100644
--- a/dbaccess/source/ui/dlg/indexfieldscontrol.cxx
+++ b/dbaccess/source/ui/dlg/indexfieldscontrol.cxx
@@ -79,7 +79,7 @@ static constexpr auto BROWSER_STANDARD_FLAGS = 
BrowserMode::COLUMNSELECTION | Br
 {
 }
 
-extern "C" SAL_DLLPUBLIC_EXPORT void 
makeDbaIndexFieldsControl(VclPtr & rRet, VclPtr & 
pParent, VclBuilder::stringmap &)
+extern "C" SAL_DLLPUBLIC_EXPORT void 
makeDbaIndexFieldsControl(VclPtr & rRet, const VclPtr 
& pParent, VclBuilder::stringmap &)
 {
 rRet = VclPtr::Create(pParent, WB_BORDER | 
WB_NOTABSTOP);
 }
diff --git a/include/vcl/NotebookBarAddonsMerger.hxx 
b/include/vcl/NotebookBarAddonsMerger.hxx
index ef6a3291e9f8..913e50734472 100644
--- a/include/vcl/NotebookBarAddonsMerger.hxx
+++ b/include/vcl/NotebookBarAddonsMerger.hxx
@@ -61,7 +61,7 @@ class NotebookBarAddonsMerger
 {
 public:
 typedef std::map stringmap;
-typedef void (*customMakeWidget)(VclPtr& rRet, 
VclPtr& pParent,
+typedef void (*customMakeWidget)(VclPtr& rRet, const 
VclPtr& pParent,
  stringmap& rVec);
 NotebookBarAddonsMerger();
 ~NotebookBarAddonsMerger();
diff --git a/include/vcl/builder.hxx b/include/vcl/builder.hxx
index adefc6d39713..4cdd10930dea 100644
--- a/include/vcl/builder.hxx
+++ b/include/vcl/builder.hxx
@@ -65,7 +65,7 @@ public:
 typedef std::map stringmap;
 typedef std::map> accelmap;
 /// These functions create a new widget with parent pParent and return it 
in rRet
-typedef void (*customMakeWidget)(VclPtr , 
VclPtr , stringmap );
+typedef void (*customMakeWidget)(VclPtr , const 
VclPtr , stringmap );
 
 public:
 VclBuilder(vcl::Window* pParent, const OUString& sUIRootDir, const 
OUString& sUIFile,
diff --git a/include/vcl/builderfactory.hxx b/include/vcl/builderfactory.hxx
index 0781726c0ffb..719f1d8b206c 100644
--- a/include/vcl/builderfactory.hxx
+++ b/include/vcl/builderfactory.hxx

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

2019-09-02 Thread Mike Kaganski (via logerrit)
 vcl/source/window/builder.cxx |  116 ++
 1 file changed, 63 insertions(+), 53 deletions(-)

New commits:
commit fd67c89e52441387dffab1c788007271e717571b
Author: Mike Kaganski 
AuthorDate: Mon Sep 2 23:14:29 2019 +0300
Commit: Mike Kaganski 
CommitDate: Tue Sep 3 06:42:20 2019 +0200

Extract code to get GetCustomMakeWidget address into a separate function

... to simplify the logic

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

diff --git a/vcl/source/window/builder.cxx b/vcl/source/window/builder.cxx
index 2c4d6c3119da..1606c18625fb 100644
--- a/vcl/source/window/builder.cxx
+++ b/vcl/source/window/builder.cxx
@@ -1628,6 +1628,59 @@ void VclBuilder::preload()
 extern "C" VclBuilder::customMakeWidget lo_get_custom_widget_func(const char* 
name);
 #endif
 
+namespace
+{
+// Takes a string like "sfxlo-SidebarToolBox"
+VclBuilder::customMakeWidget GetCustomMakeWidget(const OString& name)
+{
+VclBuilder::customMakeWidget pFunction = nullptr;
+if (sal_Int32 nDelim = name.indexOf('-'); nDelim != -1)
+{
+const OUString sFunction("make"
+ + OStringToOUString(name.copy(nDelim + 1), 
RTL_TEXTENCODING_UTF8));
+
+#ifndef DISABLE_DYNLOADING
+const OUString sModule = SAL_DLLPREFIX
+ + OStringToOUString(name.copy(0, nDelim), 
RTL_TEXTENCODING_UTF8)
+ + SAL_DLLEXTENSION;
+ModuleMap::iterator aI = g_aModuleMap.find(sModule);
+if (aI == g_aModuleMap.end())
+{
+std::shared_ptr pModule;
+#if ENABLE_MERGELIBS
+if (!g_pMergedLib->is())
+g_pMergedLib->loadRelative(, SVLIBRARY("merged"));
+if ((pFunction = reinterpret_cast(
+ g_pMergedLib->getFunctionSymbol(sFunction
+pModule = g_pMergedLib;
+#endif
+if (!pFunction)
+{
+pModule.reset(new NoAutoUnloadModule);
+bool ok = pModule->loadRelative(, sModule);
+assert(ok && "bad module name in .ui");
+(void)ok;
+pFunction = reinterpret_cast(
+pModule->getFunctionSymbol(sFunction));
+}
+g_aModuleMap.insert(std::make_pair(sModule, pModule));
+}
+else
+pFunction = reinterpret_cast(
+aI->second->getFunctionSymbol(sFunction));
+#elif !HAVE_FEATURE_DESKTOP
+pFunction = lo_get_custom_widget_func(sFunction.toUtf8().getStr());
+SAL_WARN_IF(!pFunction, "vcl.layout", "Could not find " << sFunction);
+assert(pFunction);
+#else
+pFunction = reinterpret_cast(
+osl_getFunctionSymbol((oslModule)RTLD_DEFAULT, sFunction.pData));
+#endif
+}
+return pFunction;
+}
+}
+
 VclPtr VclBuilder::makeObject(vcl::Window *pParent, const OString 
, const OString ,
 stringmap )
 {
@@ -2275,61 +2328,18 @@ VclPtr VclBuilder::makeObject(vcl::Window 
*pParent, const OString &
 }
 else
 {
-sal_Int32 nDelim = name.indexOf('-');
-if (nDelim != -1)
+if (customMakeWidget pFunction = GetCustomMakeWidget(name))
 {
-OUString sFunction(OStringToOUString(OString("make") + 
name.copy(nDelim+1), RTL_TEXTENCODING_UTF8));
-
-customMakeWidget pFunction = nullptr;
-#ifndef DISABLE_DYNLOADING
-OUStringBuffer sModuleBuf;
-sModuleBuf.append(SAL_DLLPREFIX);
-sModuleBuf.append(OStringToOUString(name.copy(0, nDelim), 
RTL_TEXTENCODING_UTF8));
-sModuleBuf.append(SAL_DLLEXTENSION);
-
-OUString sModule = sModuleBuf.makeStringAndClear();
-ModuleMap::iterator aI = g_aModuleMap.find(sModule);
-if (aI == g_aModuleMap.end())
+VclPtr xParent(pParent);
+pFunction(xWindow, xParent, rMap);
+if (xWindow->GetType() == WindowType::PUSHBUTTON)
+setupFromActionName(static_cast(xWindow.get()), rMap, 
m_xFrame);
+else if (xWindow->GetType() == WindowType::MENUBUTTON)
 {
-std::shared_ptr pModule;
-#if ENABLE_MERGELIBS
-if (!g_pMergedLib->is())
-g_pMergedLib->loadRelative(, 
SVLIBRARY("merged"));
-if ((pFunction = 
reinterpret_cast(g_pMergedLib->getFunctionSymbol(sFunction
-pModule = g_pMergedLib;
-#endif
-if (!pFunction)
-{
-pModule.reset(new NoAutoUnloadModule);
-bool ok = pModule->loadRelative(, sModule);
-assert(ok && "bad module name in .ui");
-(void) ok;
-pFunction = 
reinterpret_cast(pModule->getFunctionSymbol(sFunction));
-}
- 

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

2019-09-03 Thread Mike Kaganski (via logerrit)
 vcl/source/window/builder.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 750fc507939595e8eb6071f70e748d6b1bb7c38c
Author: Mike Kaganski 
AuthorDate: Tue Sep 3 13:02:01 2019 +0200
Commit: Mike Kaganski 
CommitDate: Tue Sep 3 18:21:24 2019 +0200

Omission from commit fd67c89e52441387dffab1c788007271e717571b

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

diff --git a/vcl/source/window/builder.cxx b/vcl/source/window/builder.cxx
index 3f81651e15eb..ad9706cd7339 100644
--- a/vcl/source/window/builder.cxx
+++ b/vcl/source/window/builder.cxx
@@ -1673,7 +1673,7 @@ VclBuilder::customMakeWidget GetCustomMakeWidget(const 
OString& name)
 SAL_WARN_IF(!pFunction, "vcl.layout", "Could not find " << sFunction);
 assert(pFunction);
 #else
-pFunction = reinterpret_cast(
+pFunction = reinterpret_cast(
 osl_getFunctionSymbol((oslModule)RTLD_DEFAULT, sFunction.pData));
 #endif
 }
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

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

2019-09-03 Thread Mike Kaganski (via logerrit)
 sw/source/uibase/sidebar/StylePresetsPanel.cxx |1 +
 1 file changed, 1 insertion(+)

New commits:
commit 570e5345bcb88add0b095fe3d5585915f288925d
Author: Mike Kaganski 
AuthorDate: Tue Sep 3 16:36:58 2019 +0200
Commit: Mike Kaganski 
CommitDate: Tue Sep 3 18:21:06 2019 +0200

Missing include

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

diff --git a/sw/source/uibase/sidebar/StylePresetsPanel.cxx 
b/sw/source/uibase/sidebar/StylePresetsPanel.cxx
index f296fe1cb3e4..915d740a6a68 100644
--- a/sw/source/uibase/sidebar/StylePresetsPanel.cxx
+++ b/sw/source/uibase/sidebar/StylePresetsPanel.cxx
@@ -19,6 +19,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

[Libreoffice-commits] core.git: cui/source dbaccess/source include/vcl sfx2/source svtools/source svx/source sw/source vcl/source

2019-09-03 Thread Mike Kaganski (via logerrit)
 cui/source/options/optcolor.cxx   |2 ++
 dbaccess/source/ui/dlg/indexfieldscontrol.cxx |2 ++
 include/vcl/NotebookBarAddonsMerger.hxx   |9 -
 include/vcl/builder.hxx   |7 ---
 include/vcl/builderfactory.hxx|6 ++
 sfx2/source/appl/newhelp.cxx  |   10 ++
 sfx2/source/sidebar/SidebarToolBox.cxx|4 
 svtools/source/contnr/fileview.cxx|2 ++
 svtools/source/control/ctrlbox.cxx|6 ++
 svtools/source/control/inettbc.cxx|2 ++
 svx/source/dialog/langbox.cxx |4 
 svx/source/dialog/relfld.cxx  |2 ++
 svx/source/dialog/txencbox.cxx|2 ++
 sw/source/uibase/utlui/numfmtlb.cxx   |2 ++
 vcl/source/control/notebookbar.cxx|2 +-
 vcl/source/window/NotebookBarAddonsMerger.cxx |4 ++--
 vcl/source/window/builder.cxx |   12 +++-
 vcl/source/window/printdlg.cxx|4 
 18 files changed, 66 insertions(+), 16 deletions(-)

New commits:
commit e44db461ca135fcbef7854c7304c894b65fcd497
Author: Mike Kaganski 
AuthorDate: Tue Sep 3 12:54:48 2019 +0300
Commit: Mike Kaganski 
CommitDate: Tue Sep 3 22:24:23 2019 +0200

Ensure that VCL builder entry points use proper function type

This removes duplicating typedefs from NotebookBarAddonsMerger,
and removes dependency of include/vcl/builder.hxx on
include/vcl/NotebookBarAddonsMerger.hxx.

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

diff --git a/cui/source/options/optcolor.cxx b/cui/source/options/optcolor.cxx
index 7cf455e821fd..d85381cc70a5 100644
--- a/cui/source/options/optcolor.cxx
+++ b/cui/source/options/optcolor.cxx
@@ -861,6 +861,8 @@ void ColorConfigCtrl_Impl::dispose()
 
 extern "C" SAL_DLLPUBLIC_EXPORT void makeColorConfigCtrl(VclPtr & 
rRet, const VclPtr & pParent, VclBuilder::stringmap &)
 {
+
static_assert(std::is_same_v,
+ decltype(makeColorConfigCtrl)>);
 rRet = VclPtr::Create(pParent);
 }
 
diff --git a/dbaccess/source/ui/dlg/indexfieldscontrol.cxx 
b/dbaccess/source/ui/dlg/indexfieldscontrol.cxx
index cfc8143a2288..dc3296a7187a 100644
--- a/dbaccess/source/ui/dlg/indexfieldscontrol.cxx
+++ b/dbaccess/source/ui/dlg/indexfieldscontrol.cxx
@@ -81,6 +81,8 @@ static constexpr auto BROWSER_STANDARD_FLAGS = 
BrowserMode::COLUMNSELECTION | Br
 
 extern "C" SAL_DLLPUBLIC_EXPORT void 
makeDbaIndexFieldsControl(VclPtr & rRet, const VclPtr 
& pParent, VclBuilder::stringmap &)
 {
+
static_assert(std::is_same_v,
+ decltype(makeDbaIndexFieldsControl)>);
 rRet = VclPtr::Create(pParent, WB_BORDER | 
WB_NOTABSTOP);
 }
 
diff --git a/include/vcl/NotebookBarAddonsMerger.hxx 
b/include/vcl/NotebookBarAddonsMerger.hxx
index 913e50734472..9b13ff145625 100644
--- a/include/vcl/NotebookBarAddonsMerger.hxx
+++ b/include/vcl/NotebookBarAddonsMerger.hxx
@@ -20,6 +20,7 @@
 #ifndef INCLUDED_VCL_NOTEBOOKBARADDONSMERGER_HXX
 #define INCLUDED_VCL_NOTEBOOKBARADDONSMERGER_HXX
 
+#include 
 #include 
 #include 
 #include 
@@ -60,15 +61,13 @@ struct AddonNotebookBarItem
 class NotebookBarAddonsMerger
 {
 public:
-typedef std::map stringmap;
-typedef void (*customMakeWidget)(VclPtr& rRet, const 
VclPtr& pParent,
- stringmap& rVec);
 NotebookBarAddonsMerger();
 ~NotebookBarAddonsMerger();
-static void MergeNotebookBarAddons(vcl::Window* pParent, const 
customMakeWidget& pFunction,
+static void MergeNotebookBarAddons(vcl::Window* pParent,
+   const VclBuilder::customMakeWidget& 
pFunction,
const 
css::uno::Reference& rFrame,
const NotebookBarAddonsItem& 
aNotebookBarAddonsItem,
-   stringmap rVec);
+   VclBuilder::stringmap& rVec);
 static void MergeNotebookBarMenuAddons(PopupMenu* pPopupMenu, sal_Int16 
nItemId,
const OString& sItemIdName,
NotebookBarAddonsItem& 
aNotebookBarAddonsItem);
diff --git a/include/vcl/builder.hxx b/include/vcl/builder.hxx
index 4cdd10930dea..35504dc0d701 100644
--- a/include/vcl/builder.hxx
+++ b/include/vcl/builder.hxx
@@ -15,7 +15,6 @@
 #include 
 #include 
 #include 
-#include 
 #include 
 #include 
 #include 
@@ -45,6 +44,7 @@ class DateField;
 class TimeField;
 class VclExpander;
 class VclMultiLineEdit;
+struct NotebookBarAddonsItem;
 namespace xmlreader { class XmlReader; }
 namespace com { namespace sun { namespace star { namespace frame { class 
XFrame; } } } }
 
@@ -73,11 

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

2019-09-03 Thread Mike Kaganski (via logerrit)
 sd/source/ui/slidesorter/shell/SlideSorter.cxx |2 ++
 1 file changed, 2 insertions(+)

New commits:
commit 446f4b086ccd4cdb9524637e4808dbe6b7d40f7e
Author: Mike Kaganski 
AuthorDate: Tue Sep 3 21:01:32 2019 +0200
Commit: Mike Kaganski 
CommitDate: Tue Sep 3 21:52:59 2019 +0200

Missing include

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

diff --git a/sd/source/ui/slidesorter/shell/SlideSorter.cxx 
b/sd/source/ui/slidesorter/shell/SlideSorter.cxx
index f2ba97cd35d0..b59e2a3d9512 100644
--- a/sd/source/ui/slidesorter/shell/SlideSorter.cxx
+++ b/sd/source/ui/slidesorter/shell/SlideSorter.cxx
@@ -19,6 +19,8 @@
 
 #include 
 
+#include 
+
 #include 
 #include 
 #include 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

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

2019-09-03 Thread Mike Kaganski (via logerrit)
 sd/source/ui/framework/tools/FrameworkHelper.cxx |1 +
 1 file changed, 1 insertion(+)

New commits:
commit a96b0e1b28dc48e6d92365cfffca232f4db30848
Author: Mike Kaganski 
AuthorDate: Tue Sep 3 18:29:28 2019 +0200
Commit: Mike Kaganski 
CommitDate: Tue Sep 3 19:41:37 2019 +0200

Missing include

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

diff --git a/sd/source/ui/framework/tools/FrameworkHelper.cxx 
b/sd/source/ui/framework/tools/FrameworkHelper.cxx
index 1f51a6bba052..917d3abb3b1b 100644
--- a/sd/source/ui/framework/tools/FrameworkHelper.cxx
+++ b/sd/source/ui/framework/tools/FrameworkHelper.cxx
@@ -29,6 +29,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

[Libreoffice-commits] core.git: Branch 'libreoffice-6-3' - xmlsecurity/Library_xmlsecurity.mk xmlsecurity/source

2019-08-29 Thread Mike Kaganski (via logerrit)
 xmlsecurity/Library_xmlsecurity.mk |2 +
 xmlsecurity/source/dialogs/digitalsignaturesdialog.cxx |   23 +++--
 2 files changed, 23 insertions(+), 2 deletions(-)

New commits:
commit 482a97009a729e6198a4eae07869913f90a90c3c
Author: Mike Kaganski 
AuthorDate: Wed Aug 14 12:58:49 2019 +0300
Commit: Michael Stahl 
CommitDate: Thu Aug 29 10:24:53 2019 +0200

Don't hardcode "C:\\Program Files (x86)" path on Windows

It might be simple "Program Files" on 32-bit system; or localized (see

https://www.samlogic.net/articles/program-files-folder-different-languages.htm),
or on a different drive (if system isn't on C:), etc.

Change-Id: Id0f28b4c4920fcda53a58fbff9f42bcfde6668f6
Reviewed-on: https://gerrit.libreoffice.org/77448
Tested-by: Jenkins
Reviewed-by: Mike Kaganski 
(cherry picked from commit 9c8854b7d6e5c9debc7eeae57c0d51a3f151a03e)
Reviewed-on: https://gerrit.libreoffice.org/77535
Reviewed-by: Michael Stahl 

diff --git a/xmlsecurity/Library_xmlsecurity.mk 
b/xmlsecurity/Library_xmlsecurity.mk
index 9a65dd2152a9..5a80e6e17591 100644
--- a/xmlsecurity/Library_xmlsecurity.mk
+++ b/xmlsecurity/Library_xmlsecurity.mk
@@ -83,6 +83,8 @@ $(eval $(call gb_Library_add_defs,xmlsecurity,\
 ))
 $(eval $(call gb_Library_use_system_win32_libs,xmlsecurity,\
 crypt32 \
+Ole32 \
+Shell32 \
 ))
 else
 ifneq (,$(filter DESKTOP,$(BUILD_TYPE))$(filter ANDROID,$(OS)))
diff --git a/xmlsecurity/source/dialogs/digitalsignaturesdialog.cxx 
b/xmlsecurity/source/dialogs/digitalsignaturesdialog.cxx
index 93f988649490..b893a593944c 100644
--- a/xmlsecurity/source/dialogs/digitalsignaturesdialog.cxx
+++ b/xmlsecurity/source/dialogs/digitalsignaturesdialog.cxx
@@ -59,6 +59,12 @@
 #include 
 #include 
 
+#ifdef _WIN32
+#include 
+#include 
+#include 
+#endif
+
 using namespace comphelper;
 using namespace css::security;
 using namespace css::uno;
@@ -457,15 +463,28 @@ IMPL_LINK_NOARG(DigitalSignaturesDialog, 
CertMgrButtonHdl, weld::Button&, void)
  
OUString("GNU\\GnuPG\\bin\\kleopatra.exe"),
  
OUString("GNU\\GnuPG\\bin\\launch-gpa.exe"),
  OUString("GNU\\GnuPG\\bin\\gpa.exe") };
-const char* const cPath = "C:\\Program Files (x86)";
+static const OUString aPath = [] {
+OUString sRet;
+PWSTR sPath = nullptr;
+HRESULT hr
+= SHGetKnownFolderPath(FOLDERID_ProgramFilesX86, KF_FLAG_DEFAULT, 
nullptr, );
+if (SUCCEEDED(hr))
+{
+sRet = o3tl::toU(sPath);
+CoTaskMemFree(sPath);
+}
+return sRet;
+}();
+if (aPath.isEmpty())
+return;
 #else
 const OUString aGUIServers[] = { OUString("kleopatra"), 
OUString("seahorse"),  OUString("gpa"), OUString("kgpg") };
 const char* cPath = getenv("PATH");
 if (!cPath)
 return;
+OUString aPath(cPath, strlen(cPath), osl_getThreadTextEncoding());
 #endif
 
-OUString aPath(cPath, strlen(cPath), osl_getThreadTextEncoding());
 OUString sFoundGUIServer, sExecutable;
 
 for ( auto const  : aGUIServers )
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

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

2019-08-28 Thread Mike Kaganski (via logerrit)
 sw/source/filter/ww8/attributeoutputbase.hxx |6 -
 sw/source/filter/ww8/docxattributeoutput.cxx |3 +-
 sw/source/filter/ww8/rtfattributeoutput.cxx  |3 +-
 sw/source/filter/ww8/wrtw8nds.cxx|   28 +--
 sw/source/filter/ww8/ww8attributeoutput.hxx  |4 ++-
 5 files changed, 14 insertions(+), 30 deletions(-)

New commits:
commit a1a401acaafee0b1f154d368a247d74d61c62191
Author: Mike Kaganski 
AuthorDate: Wed Aug 28 17:02:31 2019 +0300
Commit: Mike Kaganski 
CommitDate: Wed Aug 28 17:19:54 2019 +0200

Avoid dynamic_cast in AttributeOutputBase::ConvertURL

This unifies the code for any format using the function.

Note: RTF code currently doesn't use the function, so an empty string
is used in its ctor.

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

diff --git a/sw/source/filter/ww8/attributeoutputbase.hxx 
b/sw/source/filter/ww8/attributeoutputbase.hxx
index 72116df53bc2..b6eca7f2da22 100644
--- a/sw/source/filter/ww8/attributeoutputbase.hxx
+++ b/sw/source/filter/ww8/attributeoutputbase.hxx
@@ -146,6 +146,7 @@ class AttributeOutputBase
 {
 private:
 SvtSaveOptions const m_aSaveOpt;
+OUString m_sBaseURL; // To be used in ConvertURL
 
 OUString ConvertURL( const OUString& rUrl, bool bAbsoluteOut );
 
@@ -636,7 +637,10 @@ protected:
 ww8::WidthsPtr   GetColumnWidths( ww8::WW8TableNodeInfoInner::Pointer_t 
const & pTableTextNodeInfoInner );
 
 public:
-AttributeOutputBase() {}
+AttributeOutputBase(const OUString& sBaseURL)
+: m_sBaseURL(sBaseURL)
+{
+}
 virtual ~AttributeOutputBase() {}
 
 /// Return the right export class.
diff --git a/sw/source/filter/ww8/docxattributeoutput.cxx 
b/sw/source/filter/ww8/docxattributeoutput.cxx
index 3d705d76a83a..209a1a1aec0a 100644
--- a/sw/source/filter/ww8/docxattributeoutput.cxx
+++ b/sw/source/filter/ww8/docxattributeoutput.cxx
@@ -9029,7 +9029,8 @@ void DocxAttributeOutput::CharGrabBag( const 
SfxGrabBagItem& rItem )
 }
 
 DocxAttributeOutput::DocxAttributeOutput( DocxExport , const 
FSHelperPtr& pSerializer, oox::drawingml::DrawingML* pDrawingML )
-: m_rExport( rExport ),
+: AttributeOutputBase(rExport.GetFilter().getFileUrl()),
+  m_rExport( rExport ),
   m_pSerializer( pSerializer ),
   m_rDrawingML( *pDrawingML ),
   m_bEndCharSdt(false),
diff --git a/sw/source/filter/ww8/rtfattributeoutput.cxx 
b/sw/source/filter/ww8/rtfattributeoutput.cxx
index d8afcc351867..c9705c740717 100644
--- a/sw/source/filter/ww8/rtfattributeoutput.cxx
+++ b/sw/source/filter/ww8/rtfattributeoutput.cxx
@@ -3672,7 +3672,8 @@ bool RtfAttributeOutput::PlaceholderField(const SwField* 
pField)
 }
 
 RtfAttributeOutput::RtfAttributeOutput(RtfExport& rExport)
-: m_rExport(rExport)
+: AttributeOutputBase("") // ConvertURL isn't used now in RTF output
+, m_rExport(rExport)
 , m_pPrevPageDesc(nullptr)
 , m_nStyleId(0)
 , m_nListId(0)
diff --git a/sw/source/filter/ww8/wrtw8nds.cxx 
b/sw/source/filter/ww8/wrtw8nds.cxx
index 080e24bbfcdc..c67c9e05b9d5 100644
--- a/sw/source/filter/ww8/wrtw8nds.cxx
+++ b/sw/source/filter/ww8/wrtw8nds.cxx
@@ -874,32 +874,10 @@ static OUString ( OUString  )
 OUString AttributeOutputBase::ConvertURL( const OUString& rUrl, bool 
bAbsoluteOut )
 {
 OUString sURL = rUrl;
-OUString sExportedDocumentURL = "";
-{
-DocxExport* pDocxExport = dynamic_cast(());
-if ( pDocxExport )
-{
-// DOCX
-DocxExportFilter& rFilter = pDocxExport->GetFilter();
-sExportedDocumentURL = rFilter.getFileUrl();
-}
-else
-{
-// DOC
-WW8Export* pWW8Export = dynamic_cast(());
-if ( pWW8Export )
-{
-SwWW8Writer& rWriter = pWW8Export->GetWriter();
-INetURLObject parent(rWriter.GetMedia()->GetURLObject());
-parent.removeSegment();
-sExportedDocumentURL = 
parent.GetMainURL(INetURLObject::DecodeMechanism::NONE);
-}
-}
-}
 
-INetURLObject anAbsoluteParent( sExportedDocumentURL );
+INetURLObject anAbsoluteParent(m_sBaseURL);
 OUString sConvertedParent = INetURLObject::GetScheme( 
anAbsoluteParent.GetProtocol() ) + anAbsoluteParent.GetURLPath();
-OUString sParentPath = sConvertedParent.isEmpty() ? sExportedDocumentURL : 
sConvertedParent;
+OUString sParentPath = sConvertedParent.isEmpty() ? m_sBaseURL : 
sConvertedParent;
 
 if ( bAbsoluteOut )
 {
@@ -907,8 +885,6 @@ OUString AttributeOutputBase::ConvertURL( const OUString& 
rUrl, bool bAbsoluteOu
 
 if ( anAbsoluteParent.GetNewAbsURL( rUrl,  ) )
 sURL = anAbsoluteNew.GetMainURL( 
INetURLObject::DecodeMechanism::NONE );
-else
-sURL = rUrl;
 }
 else
 {
diff 

[Libreoffice-commits] core.git: chart2/source comphelper/source connectivity/source editeng/source extensions/source filter/source include/canvas include/comphelper include/connectivity include/drawin

2019-08-23 Thread Mike Kaganski (via logerrit)
 chart2/source/controller/drawinglayer/ViewElementListProvider.cxx |2 -
 chart2/source/controller/inc/ViewElementListProvider.hxx  |2 -
 chart2/source/view/charttypes/VSeriesPlotter.cxx  |4 +-
 chart2/source/view/inc/VSeriesPlotter.hxx |2 -
 comphelper/source/misc/namedvaluecollection.cxx   |4 +-
 connectivity/source/commontools/FValue.cxx|4 +-
 connectivity/source/commontools/dbmetadata.cxx|4 +-
 connectivity/source/drivers/dbase/dindexnode.cxx  |2 -
 connectivity/source/inc/dbase/dindexnode.hxx  |2 -
 editeng/source/items/frmitems.cxx |2 -
 extensions/source/abpilot/datasourcehandling.cxx  |2 -
 extensions/source/abpilot/datasourcehandling.hxx  |2 -
 filter/source/svg/svgwriter.hxx   |2 -
 include/canvas/vclwrapper.hxx |7 +---
 include/comphelper/namedvaluecollection.hxx   |4 +-
 include/connectivity/FValue.hxx   |8 ++---
 include/connectivity/dbmetadata.hxx   |4 +-
 include/drawinglayer/primitive2d/baseprimitive2d.hxx  |4 +-
 include/drawinglayer/primitive3d/baseprimitive3d.hxx  |4 +-
 include/editeng/brushitem.hxx |2 -
 include/o3tl/cow_wrapper.hxx  |4 +-
 include/svl/itemset.hxx   |2 -
 include/svl/sharedstring.hxx  |4 +-
 include/svl/svdde.hxx |4 +-
 include/svx/dataaccessdescriptor.hxx  |4 +-
 include/svx/sdr/attribute/sdrformtextattribute.hxx|4 +-
 include/svx/sdr/attribute/sdrtextattribute.hxx|4 +-
 include/tools/ref.hxx |2 -
 include/ucbhelper/content.hxx |4 +-
 include/vcl/bitmap.hxx|2 -
 include/vcl/graph.hxx |4 +-
 include/vcl/transfer.hxx  |2 -
 l10ntools/inc/po.hxx  |2 -
 l10ntools/source/po.cxx   |2 -
 o3tl/qa/cow_wrapper_clients.cxx   |   12 
+++
 o3tl/qa/cow_wrapper_clients.hxx   |   12 
+++
 sc/inc/attrib.hxx |2 -
 sc/inc/cellvalue.hxx  |6 +--
 sc/inc/formulalogger.hxx  |2 -
 sc/inc/markarr.hxx|4 +-
 sc/inc/mtvelements.hxx|2 -
 sc/inc/postit.hxx |6 +--
 sc/inc/rangelst.hxx   |4 +-
 sc/source/core/data/attrib.cxx|2 -
 sc/source/core/data/cellvalue.cxx |6 +--
 sc/source/core/data/markarr.cxx   |4 +-
 sc/source/core/data/mtvelements.cxx   |2 -
 sc/source/core/data/postit.cxx|8 ++---
 sc/source/core/tool/formulalogger.cxx |2 -
 sc/source/core/tool/rangelst.cxx  |4 +-
 sc/source/core/tool/scmatrix.cxx  |   16 
+-
 sd/inc/OutlinerIterator.hxx   |4 +-
 sd/source/ui/view/OutlinerIterator.cxx|4 +-
 svl/source/items/itemset.cxx  |2 -
 svl/source/misc/sharedstring.cxx  |4 +-
 svl/source/svdde/ddedata.cxx  |4 +-
 svl/unx/source/svdde/ddedummy.cxx |4 +-
 svx/inc/sdr/attribute/sdrformtextoutlineattribute.hxx |2 -
 svx/source/form/dataaccessdescriptor.cxx  |4 +-
 svx/source/sdr/attribute/sdrformtextattribute.cxx |4 +-
 svx/source/sdr/attribute/sdrformtextoutlineattribute.cxx  |2 -
 svx/source/sdr/attribute/sdrtextattribute.cxx |4 +-
 ucbhelper/source/client/content.cxx   |4 +-
 vcl/inc/impgraph.hxx  |2 -
 vcl/inc/opengl/texture.hxx  

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

2019-08-25 Thread Mike Kaganski (via logerrit)
 include/com/sun/star/uno/Sequence.h |   10 ++
 include/comphelper/sequence.hxx |7 +++
 2 files changed, 13 insertions(+), 4 deletions(-)

New commits:
commit 8fc9c698ee643dd4363c5ad1daa7bbc0a13982d5
Author: Mike Kaganski 
AuthorDate: Mon Aug 26 01:26:34 2019 +0300
Commit: Mike Kaganski 
CommitDate: Mon Aug 26 07:25:18 2019 +0200

Generalize comphelper::concatSequences to accept other container types

... as second and following arguments.

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

diff --git a/include/com/sun/star/uno/Sequence.h 
b/include/com/sun/star/uno/Sequence.h
index f5c9c384eeef..78d1124ba504 100644
--- a/include/com/sun/star/uno/Sequence.h
+++ b/include/com/sun/star/uno/Sequence.h
@@ -272,6 +272,16 @@ inline ::com::sun::star::uno::Sequence< sal_Int8 > 
SAL_CALL toUnoSequence(
 }
 }
 
+#if defined LIBO_INTERNAL_ONLY
+namespace std
+{
+template  sal_Int32 size(const ::com::sun::star::uno::Sequence& s)
+{
+return s.getLength();
+}
+}
+#endif
+
 /** Gets the meta type of IDL sequence.
 
 There are cases (involving templates) where uses of getCppuType are known 
to
diff --git a/include/comphelper/sequence.hxx b/include/comphelper/sequence.hxx
index 6c51311daf29..18e269173627 100644
--- a/include/comphelper/sequence.hxx
+++ b/include/comphelper/sequence.hxx
@@ -49,10 +49,9 @@ namespace comphelper
 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;
-((pReturn = std::copy_n(rS1.getConstArray(), rS1.getLength(), 
aReturn.getArray())), ...,
- (pReturn = std::copy_n(rSn.getConstArray(), rSn.getLength(), 
pReturn)));
+css::uno::Sequence aReturn(std::size(rS1) + (... + std::size(rSn)));
+T* pReturn = std::copy(std::begin(rS1), std::end(rS1), 
aReturn.begin());
+(..., (pReturn = std::copy(std::begin(rSn), std::end(rSn), pReturn)));
 return aReturn;
 }
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

[Libreoffice-commits] core.git: Branch 'libreoffice-6-3-1' - sc/source

2019-08-23 Thread Mike Kaganski (via logerrit)
 sc/source/core/data/table2.cxx |  115 +
 1 file changed, 82 insertions(+), 33 deletions(-)

New commits:
commit effde02da2ec4fed5e9e0552be99bd20ac15566c
Author: Mike Kaganski 
AuthorDate: Tue Jul 16 16:14:49 2019 +1000
Commit: Caolán McNamara 
CommitDate: Fri Aug 23 20:39:16 2019 +0200

tdf#126418: add some more checks for allocated columns

Change-Id: Ia91f0f11c9d7bcec5b9ecc2f8a28d9e4f6212dc5
Reviewed-on: https://gerrit.libreoffice.org/75671
Tested-by: Jenkins
Reviewed-by: Mike Kaganski 
(cherry picked from commit 159db459418a2c831bf00dca5a2c5087d65e9ab6)
Reviewed-on: https://gerrit.libreoffice.org/77442
Reviewed-by: Noel Grandin 
(cherry picked from commit 7a42bf4caa46093ced87a4db54b94f6b4c4decd0)
Reviewed-on: https://gerrit.libreoffice.org/77704
Reviewed-by: Eike Rathke 
Reviewed-by: Caolán McNamara 
Tested-by: Caolán McNamara 

diff --git a/sc/source/core/data/table2.cxx b/sc/source/core/data/table2.cxx
index 98f316424cbd..1f62b1a9418d 100644
--- a/sc/source/core/data/table2.cxx
+++ b/sc/source/core/data/table2.cxx
@@ -534,15 +534,39 @@ void ScTable::CopyToClip(
 void ScTable::CopyStaticToDocument(
 SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2, const 
SvNumberFormatterMergeMap& rMap, ScTable* pDestTab )
 {
-if (nCol1 > nCol2)
+if (nCol1 > nCol2 || nRow1 > nRow2)
 return;
 
-for (SCCOL i = nCol1; i <= nCol2; ++i)
+const SCCOL nFirstUnallocated = 
std::clamp(GetAllocatedColumnsCount(), nCol1, nCol2 + 1);
+if (nFirstUnallocated > nCol1)
+pDestTab->CreateColumnIfNotExists(nFirstUnallocated - 1);
+
+for (SCCOL i = nCol1; i < nFirstUnallocated; ++i)
 {
 ScColumn& rSrcCol = aCol[i];
 ScColumn& rDestCol = pDestTab->aCol[i];
 rSrcCol.CopyStaticToDocument(nRow1, nRow2, rMap, rDestCol);
 }
+
+// Maybe copy this table's default attrs to dest not limiting to already 
allocated in dest?
+const SCCOL nLastInDest = 
std::min(pDestTab->GetAllocatedColumnsCount() - 1, nCol2);
+for (SCCOL i = nFirstUnallocated; i <= nLastInDest; ++i)
+{
+ScColumn& rDestCol = pDestTab->aCol[i];
+rDestCol.maCellTextAttrs.set_empty(nRow1, nRow2);
+rDestCol.maCells.set_empty(nRow1, nRow2);
+for (SCROW nRow = nRow1; nRow <= nRow2; ++nRow)
+{
+sal_uInt32 nNumFmt = 
aDefaultColAttrArray.GetPattern(nRow)->GetNumberFormat(
+pDocument->GetNonThreadedContext().GetFormatTable());
+SvNumberFormatterMergeMap::const_iterator itNum = 
rMap.find(nNumFmt);
+if (itNum != rMap.end())
+nNumFmt = itNum->second;
+
+rDestCol.SetNumberFormat(nRow, nNumFmt);
+}
+rDestCol.CellStorageModified();
+}
 }
 
 void ScTable::CopyCellToDocument(SCCOL nSrcCol, SCROW nSrcRow, SCCOL nDestCol, 
SCROW nDestRow, ScTable& rDestTab )
@@ -550,8 +574,21 @@ void ScTable::CopyCellToDocument(SCCOL nSrcCol, SCROW 
nSrcRow, SCCOL nDestCol, S
 if (!ValidColRow(nSrcCol, nSrcRow) || !ValidColRow(nDestCol, nDestRow))
 return;
 
+if (nSrcCol >= GetAllocatedColumnsCount())
+{
+if (nDestCol < rDestTab.GetAllocatedColumnsCount())
+{
+ScColumn& rDestCol = rDestTab.aCol[nDestCol];
+rDestCol.maCells.set_empty(nDestRow, nDestRow);
+rDestCol.maCellTextAttrs.set_empty(nDestRow, nDestRow);
+rDestCol.maCellNotes.set_empty(nDestRow, nDestRow);
+rDestCol.CellStorageModified();
+}
+return;
+}
+
 ScColumn& rSrcCol = aCol[nSrcCol];
-ScColumn& rDestCol = rDestTab.aCol[nDestCol];
+ScColumn& rDestCol = rDestTab.CreateColumnIfNotExists(nDestCol);
 rSrcCol.CopyCellToDocument(nSrcRow, nDestRow, rDestCol);
 }
 
@@ -1055,7 +1092,7 @@ ScColumn* ScTable::FetchColumn( SCCOL nCol )
 
 const ScColumn* ScTable::FetchColumn( SCCOL nCol ) const
 {
-if (!ValidCol(nCol))
+if (!ValidCol(nCol) || nCol >= GetAllocatedColumnsCount())
 return nullptr;
 
 return [nCol];
@@ -1084,6 +1121,7 @@ void ScTable::StartListeners( sc::StartListeningContext& 
rCxt, bool bAll )
 void ScTable::AttachFormulaCells(
 sc::StartListeningContext& rCxt, SCCOL nCol1, SCROW nRow1, SCCOL nCol2, 
SCROW nRow2 )
 {
+nCol2 = ClampToAllocatedColumns(nCol2);
 for (SCCOL nCol = nCol1; nCol <= nCol2; ++nCol)
 aCol[nCol].AttachFormulaCells(rCxt, nRow1, nRow2);
 }
@@ -1091,6 +1129,7 @@ void ScTable::AttachFormulaCells(
 void ScTable::DetachFormulaCells(
 sc::EndListeningContext& rCxt, SCCOL nCol1, SCROW nRow1, SCCOL nCol2, 
SCROW nRow2 )
 {
+nCol2 = ClampToAllocatedColumns(nCol2);
 for (SCCOL nCol = nCol1; nCol <= nCol2; ++nCol)
 aCol[nCol].DetachFormulaCells(rCxt, nRow1, nRow2, nullptr);
 }
@@ -1438,7 +1477,7 @@ void ScTable::SetEditText( SCCOL nCol, SCROW nRow, const 
EditTextObject& rEditTe
 if (!ValidColRow(nCol, nRow))
 

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

2019-08-26 Thread Mike Kaganski (via logerrit)
 include/com/sun/star/uno/Sequence.h |   20 ++--
 1 file changed, 10 insertions(+), 10 deletions(-)

New commits:
commit b5317b2a41e6369e2804462e2ab73f1447f1533a
Author: Mike Kaganski 
AuthorDate: Mon Aug 26 15:04:47 2019 +0200
Commit: Mike Kaganski 
CommitDate: Mon Aug 26 17:51:01 2019 +0200

Introduce Sequence::size() instead of specialization of std::size

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

diff --git a/include/com/sun/star/uno/Sequence.h 
b/include/com/sun/star/uno/Sequence.h
index 78d1124ba504..2ba8c71f8be8 100644
--- a/include/com/sun/star/uno/Sequence.h
+++ b/include/com/sun/star/uno/Sequence.h
@@ -27,6 +27,7 @@
 #include 
 
 #if defined LIBO_INTERNAL_ONLY
+#include 
 #include 
 #endif
 
@@ -151,6 +152,15 @@ public:
 bool SAL_CALL hasElements() const
 { return (_pSequence->nElements > 0); }
 
+#if defined LIBO_INTERNAL_ONLY
+/** This function allows to use Sequence in cases where  std::size is 
needed, and the like.
+
+@since LibreOffice 6.4
+*/
+sal_uInt32 size() const
+{ assert(getLength() >= 0); return 
static_cast(getLength()); }
+#endif
+
 /** Gets a pointer to elements array for reading.
 If the sequence has a length of 0, then the returned pointer is
 undefined.
@@ -272,16 +282,6 @@ inline ::com::sun::star::uno::Sequence< sal_Int8 > 
SAL_CALL toUnoSequence(
 }
 }
 
-#if defined LIBO_INTERNAL_ONLY
-namespace std
-{
-template  sal_Int32 size(const ::com::sun::star::uno::Sequence& s)
-{
-return s.getLength();
-}
-}
-#endif
-
 /** Gets the meta type of IDL sequence.
 
 There are cases (involving templates) where uses of getCppuType are known 
to
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

[Libreoffice-commits] core.git: Branch 'libreoffice-6-3' - sw/source

2019-08-21 Thread Mike Kaganski (via logerrit)
 sw/source/uibase/utlui/uitool.cxx |   52 ++
 1 file changed, 42 insertions(+), 10 deletions(-)

New commits:
commit ad2fde8797bd7753987dc1bbbae35fb1cc5ce1df
Author: Mike Kaganski 
AuthorDate: Sat Aug 17 10:52:14 2019 +0300
Commit: Miklos Vajna 
CommitDate: Wed Aug 21 15:57:57 2019 +0200

tdf#126787: extend/restore item set ranges to hold RES_PARATR_GRABBAG

The original item set did not include that in its ranges list, so it
ignored attempts to set its value.

Change-Id: I5f928206f0614f0cfd54652e77d7dc6b9833fb26
Reviewed-on: https://gerrit.libreoffice.org/77617
Tested-by: Jenkins
Reviewed-by: Mike Kaganski 
(cherry picked from commit 202c9a7d826c95fc05db912a8d19c598a240f1cd)
Reviewed-on: https://gerrit.libreoffice.org/77620
Reviewed-by: Miklos Vajna 

diff --git a/sw/source/uibase/utlui/uitool.cxx 
b/sw/source/uibase/utlui/uitool.cxx
index c3581e6df888..0ed3fe8b24a5 100644
--- a/sw/source/uibase/utlui/uitool.cxx
+++ b/sw/source/uibase/utlui/uitool.cxx
@@ -148,10 +148,21 @@ void ConvertAttrCharToGen(SfxItemSet& rSet)
 std::unique_ptr pGrabBag;
 const SfxPoolItem *pTmpItem;
 if (SfxItemState::SET == rSet.GetItemState(RES_PARATR_GRABBAG, false, 
))
+{
+SAL_WARN("sw.ui", "Unexpected: non-empty paragraph grab bag in 
character item set!");
 pGrabBag.reset(static_cast(pTmpItem->Clone()));
+}
 else
 pGrabBag.reset(new SfxGrabBagItem(RES_PARATR_GRABBAG));
 pGrabBag->GetGrabBag()["DialogUseCharAttr"] <<= true;
+// Store initial ranges to allow restoring later
+const sal_uInt16* pRanges = rSet.GetRanges();
+const sal_uInt16* pEnd = pRanges;
+while (*pEnd)
+++pEnd;
+const uno::Sequence aOrigRanges(pRanges, pEnd - pRanges + 1);
+pGrabBag->GetGrabBag()["OrigItemSetRanges"] <<= aOrigRanges;
+rSet.MergeRange(RES_PARATR_GRABBAG, RES_PARATR_GRABBAG);
 rSet.Put(std::move(pGrabBag));
 }
 
@@ -177,19 +188,40 @@ void ConvertAttrGenToChar(SfxItemSet& rSet, const 
SfxItemSet& rOrigSet)
 }
 rSet.Put( aGrabBag );
 }
-if (SfxItemState::SET == rOrigSet.GetItemState(RES_PARATR_GRABBAG, 
false, ))
+}
+rSet.ClearItem( RES_BACKGROUND );
+
+if (SfxItemState::SET == rOrigSet.GetItemState(RES_PARATR_GRABBAG, false, 
))
+{
+SfxGrabBagItem aGrabBag(*static_cast(pTmpItem));
+std::map& rMap = aGrabBag.GetGrabBag();
+auto aIterator = rMap.find("OrigItemSetRanges");
+if (aIterator != rMap.end())
 {
-SfxGrabBagItem aGrabBag(*static_cast(pTmpItem));
-std::map& rMap = aGrabBag.GetGrabBag();
-// Remove temporary GrabBag entry
-rMap.erase("DialogUseCharAttr");
-if (rMap.empty())
-rSet.ClearItem(RES_PARATR_GRABBAG);
-else
-rSet.Put(aGrabBag);
+if (uno::Sequence aOrigRanges; (aIterator->second >>= 
aOrigRanges)
+   && 
aOrigRanges.getLength() % 2 == 1
+   && 
*(std::cend(aOrigRanges) - 1) == 0)
+rSet.SetRanges(aOrigRanges.getConstArray());
+}
+}
+if (SfxItemState::SET == rSet.GetItemState(RES_PARATR_GRABBAG, false, 
))
+{
+// In fact, we should not reach here: it shouldn't have been there; 
and even if it was, it
+// should have been erased on the previous step when restoring 
original ranges
+SAL_WARN("sw.ui", "Unexpected: paragraph grab bag in character item 
set!");
+SfxGrabBagItem aGrabBag(*static_cast(pTmpItem));
+std::map& rMap = aGrabBag.GetGrabBag();
+// Remove temporary GrabBag entries
+rMap.erase("DialogUseCharAttr");
+rMap.erase("OrigItemSetRanges");
+if (rMap.empty())
+rSet.ClearItem(RES_PARATR_GRABBAG);
+else
+{
+SAL_WARN("sw.ui", "Unexpected: non-empty paragraph grab bag in 
character item set!");
+rSet.Put(aGrabBag);
 }
 }
-rSet.ClearItem( RES_BACKGROUND );
 }
 
 void ApplyCharBackground(const Color& rBackgroundColor, SwWrtShell& rShell)
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

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

2019-08-21 Thread Mike Kaganski (via logerrit)
 comphelper/Library_comphelper.mk|1 
 comphelper/source/misc/sequence.cxx |   42 
 include/comphelper/sequence.hxx |   16 +++--
 3 files changed, 13 insertions(+), 46 deletions(-)

New commits:
commit 8c01d962ee98138acc1a61512f3775610be529be
Author: Mike Kaganski 
AuthorDate: Wed Aug 21 13:58:45 2019 +0200
Commit: Mike Kaganski 
CommitDate: Wed Aug 21 16:38:20 2019 +0200

Make comphelper::findValue inline template and drop sequence.cxx

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

diff --git a/comphelper/Library_comphelper.mk b/comphelper/Library_comphelper.mk
index 62b59e0f72de..727766a1ec0c 100644
--- a/comphelper/Library_comphelper.mk
+++ b/comphelper/Library_comphelper.mk
@@ -126,7 +126,6 @@ $(eval $(call gb_Library_add_exception_objects,comphelper,\
 comphelper/source/misc/random \
 comphelper/source/misc/SelectionMultiplex \
 comphelper/source/misc/sequenceashashmap \
-comphelper/source/misc/sequence \
 comphelper/source/misc/servicedecl \
 comphelper/source/misc/serviceinfohelper \
 comphelper/source/misc/sharedmutex \
diff --git a/comphelper/source/misc/sequence.cxx 
b/comphelper/source/misc/sequence.cxx
deleted file mode 100644
index 81079de2223c..
--- a/comphelper/source/misc/sequence.cxx
+++ /dev/null
@@ -1,42 +0,0 @@
-/* -*- 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 .
- */
-
-#include 
-
-namespace comphelper
-{
-sal_Int32 findValue(const css::uno::Sequence< OUString >& _rList, const 
OUString& _rValue)
-{
-sal_Int32 nLength = _rList.getLength();
-
-// at which position do I find the value?
-const OUString* pTArray = _rList.getConstArray();
-for (sal_Int32 i = 0; i < nLength; ++i, ++pTArray)
-{
-if( *pTArray == _rValue )
-{
-return i;
-}
-}
-
-return -1;
-}
-}   // namespace comphelper
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/comphelper/sequence.hxx b/include/comphelper/sequence.hxx
index 3c448cd6573a..6eadc5e917cb 100644
--- a/include/comphelper/sequence.hxx
+++ b/include/comphelper/sequence.hxx
@@ -22,17 +22,27 @@
 
 #include 
 #include 
-#include 
 
 #include 
 #include 
 
 namespace comphelper
 {
-/** Search the given string within the given sequence, return the position 
of the first occurrence.
+/** Search the given value within the given sequence, return the position 
of the first occurrence.
 Returns -1 if nothing found.
 */
-COMPHELPER_DLLPUBLIC sal_Int32 findValue(const css::uno::Sequence< 
OUString >& _rList, const OUString& _rValue);
+template 
+inline sal_Int32 findValue(const css::uno::Sequence& _rList, const T2& 
_rValue)
+{
+// at which position do I find the value?
+for (sal_Int32 i = 0; i < _rList.getLength(); ++i)
+{
+if (_rList[i] == _rValue)
+return i;
+}
+
+return -1;
+}
 
 /// concat several sequences
 template 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

[Libreoffice-commits] core.git: Branch 'libreoffice-6-3-1' - extensions/source

2019-08-28 Thread Mike Kaganski (via logerrit)
 extensions/source/scanner/twain32shim.cxx |3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

New commits:
commit 8317bd50771c38e720d493f92e32c1b41c510e1f
Author: Mike Kaganski 
AuthorDate: Sun Aug 18 10:43:51 2019 +0200
Commit: Adolfo Jayme Barrientos 
CommitDate: Thu Aug 29 06:07:54 2019 +0200

tdf#126989: always terminate shim after fallback complete

It seems that DSM may not send MSG_CLOSEDSREQ (or we may already have
unloaded DSM), so don't rely on it.

Change-Id: I3ed2e0e70f4dc79c89b430b4bad6954bf9224c71
Reviewed-on: https://gerrit.libreoffice.org/77659
Tested-by: Jenkins
Reviewed-by: Mike Kaganski 
(cherry picked from commit 53e4d5fe73d98b109d79fc2c1f5032faea88afb9)
Reviewed-on: https://gerrit.libreoffice.org/77664
Reviewed-by: Xisco Faulí 
(cherry picked from commit 704a9a86600a5a60d668140790fc916b5014bef9)
Reviewed-on: https://gerrit.libreoffice.org/77711
Reviewed-by: Caolán McNamara 
Reviewed-by: Michael Stahl 
Reviewed-by: Adolfo Jayme Barrientos 
Tested-by: Adolfo Jayme Barrientos 

diff --git a/extensions/source/scanner/twain32shim.cxx 
b/extensions/source/scanner/twain32shim.cxx
index 49d6787eb69f..f813ff83d4cb 100644
--- a/extensions/source/scanner/twain32shim.cxx
+++ b/extensions/source/scanner/twain32shim.cxx
@@ -511,8 +511,7 @@ void ImpTwain::ImplFallbackHdl(WPARAM nEvent)
 {
 if (nEvent > TWAIN_EVENT_NONE)
 NotifyParent(nEvent, reinterpret_cast(m_hMap));
-if (nEvent == TWAIN_EVENT_QUIT)
-PostQuitMessage(0);
+PostQuitMessage(0);
 
 bFallback = false;
 }
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

<    1   2   3   4   5   6   7   8   9   10   >