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

2019-05-21 Thread Mike Kaganski (via logerrit)
 ucb/source/ucp/hierarchy/hierarchycontent.cxx |3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

New commits:
commit 165327d4ae442fb33b634577c32fe692a9293457
Author: Mike Kaganski 
AuthorDate: Tue May 21 18:52:54 2019 +0200
Commit: Mike Kaganski 
CommitDate: Tue May 21 21:54:04 2019 +0200

tdf#125424: properly reset temporarily cleared guard

Since the guard is only cleared optionally, most probably the code after
the conditional block is expected to be guarded until the second clear.

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

diff --git a/ucb/source/ucp/hierarchy/hierarchycontent.cxx 
b/ucb/source/ucp/hierarchy/hierarchycontent.cxx
index e0ac3c81fda7..923225a1df90 100644
--- a/ucb/source/ucp/hierarchy/hierarchycontent.cxx
+++ b/ucb/source/ucp/hierarchy/hierarchycontent.cxx
@@ -1002,7 +1002,7 @@ uno::Sequence< uno::Any > 
HierarchyContent::setPropertyValues(
 const uno::Sequence< beans::PropertyValue >& rValues,
 const uno::Reference< ucb::XCommandEnvironment > & xEnv )
 {
-osl::ClearableGuard< osl::Mutex > aGuard( m_aMutex );
+osl::ResettableGuard< osl::Mutex > aGuard( m_aMutex );
 
 uno::Sequence< uno::Any > aRet( rValues.getLength() );
 uno::Sequence< beans::PropertyChangeEvent > aChanges( rValues.getLength() 
);
@@ -1253,6 +1253,7 @@ uno::Sequence< uno::Any > 
HierarchyContent::setPropertyValues(
 "Exchange failed!",
 static_cast< cppu::OWeakObject * >( this ) );
 }
+aGuard.reset();
 }
 
 if ( !aOldTitle.isEmpty() )
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

[Libreoffice-commits] core.git: Branch 'feature/cib_contract57b' - instsetoo_native/inc_openoffice scp2/source

2019-05-21 Thread Mike Kaganski (via logerrit)
 instsetoo_native/inc_openoffice/windows/msi_templates/AppSearc.idt |1 +
 instsetoo_native/inc_openoffice/windows/msi_templates/Property.idt |2 +-
 instsetoo_native/inc_openoffice/windows/msi_templates/RegLocat.idt |1 +
 scp2/source/ooo/ucrt.scp   |4 ++--
 4 files changed, 5 insertions(+), 3 deletions(-)

New commits:
commit c8e3da67f457a268a888a4764d0bd3606347ab2f
Author: Mike Kaganski 
AuthorDate: Mon Dec 17 00:23:24 2018 +0300
Commit: Thorsten Behrens 
CommitDate: Wed May 22 03:08:55 2019 +0200

tdf#122134: use CurrentMajorVersionNumber to filter out Windows 10

On Windows 8.1, the one that is problematic to tell from Windows 10
(because the latter also exposes its version as 603 to the msiexec),
the registry value doesn't exist at
HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion
but let's play safe and also check for "#6" value just in case.

Reference:

https://stackoverflow.com/questions/31072543/reliable-way-to-get-windows-version-from-registry

Thanks to Mitchell  for the idea!

Reviewed-on: https://gerrit.libreoffice.org/65231
Reviewed-by: Mike Kaganski 
Tested-by: Mike Kaganski 
(cherry picked from commit d87fa557ff58c3b9f5c9079a1d7595e095694111)
Reviewed-on: https://gerrit.libreoffice.org/65242
Tested-by: Jenkins
Reviewed-by: Caolán McNamara 
Tested-by: Caolán McNamara 
(cherry picked from commit 72f2fbc75dc254ea8e13527b592bd0b4fb946bab)

Conflicts:
instsetoo_native/inc_openoffice/windows/msi_templates/AppSearc.idt

Change-Id: Ic907c4d992a7cb1d12e392686c19cd6fd6da3c7c

diff --git a/instsetoo_native/inc_openoffice/windows/msi_templates/AppSearc.idt 
b/instsetoo_native/inc_openoffice/windows/msi_templates/AppSearc.idt
index 3968375a8815..4bc5b05f6d9a 100644
--- a/instsetoo_native/inc_openoffice/windows/msi_templates/AppSearc.idt
+++ b/instsetoo_native/inc_openoffice/windows/msi_templates/AppSearc.idt
@@ -5,3 +5,4 @@ INSTALLLOCATION installuser
 INSTALLLOCATIONinstalluser_
 INSTALLLOCATIONinstallmachine
 INSTALLLOCATIONinstallmachine_
+WINMAJORVERWinMajorVer
diff --git a/instsetoo_native/inc_openoffice/windows/msi_templates/Property.idt 
b/instsetoo_native/inc_openoffice/windows/msi_templates/Property.idt
index 44fb9f500387..b3eaa2342d9f 100644
--- a/instsetoo_native/inc_openoffice/windows/msi_templates/Property.idt
+++ b/instsetoo_native/inc_openoffice/windows/msi_templates/Property.idt
@@ -42,7 +42,7 @@ ProgressType3 installs
 Quickstarterlinkname   QUICKSTARTERLINKNAMETEMPLATE
 RebootYesNoYes
 ReinstallModeText  omus
-SecureCustomProperties NEWPRODUCTS;OLDPRODUCTS;WIN81S14
+SecureCustomProperties NEWPRODUCTS;OLDPRODUCTS;WIN81S14;WINMAJORVER
 SetupType  Typical
 SELECT_WORD0
 SELECT_EXCEL   0
diff --git a/instsetoo_native/inc_openoffice/windows/msi_templates/RegLocat.idt 
b/instsetoo_native/inc_openoffice/windows/msi_templates/RegLocat.idt
index c082322086ad..7788815d3a6e 100644
--- a/instsetoo_native/inc_openoffice/windows/msi_templates/RegLocat.idt
+++ b/instsetoo_native/inc_openoffice/windows/msi_templates/RegLocat.idt
@@ -5,3 +5,4 @@ installuser 1   
Software\LibreOffice\Layers\[DEFINEDPRODUCT]\[BRANDPACKAGEVERSION]
 installuser_   1   
Software\LibreOffice\Layers_\[DEFINEDPRODUCT]\[BRANDPACKAGEVERSION] 
INSTALLLOCATION 2
 installmachine 2   
Software\LibreOffice\Layers\[DEFINEDPRODUCT]\[BRANDPACKAGEVERSION]  
INSTALLLOCATION 2
 installmachine_2   
Software\LibreOffice\Layers_\[DEFINEDPRODUCT]\[BRANDPACKAGEVERSION] 
INSTALLLOCATION 2
+WinMajorVer2   Software\Microsoft\Windows NT\CurrentVersion
CurrentMajorVersionNumber   2
diff --git a/scp2/source/ooo/ucrt.scp b/scp2/source/ooo/ucrt.scp
index ae2eb27a4dbe..a2d6965e2ecb 100644
--- a/scp2/source/ooo/ucrt.scp
+++ b/scp2/source/ooo/ucrt.scp
@@ -111,7 +111,7 @@ WindowsCustomAction gid_Customaction_check_win81x64_ucrt
Source = "InstMSUBinary";
Target = "Windows81-KB2999226-x64msu";
Inbinarytable = 0;
-   Assignment1 = ("InstallExecuteSequence", "Not Installed And VersionNT = 
603 And VersionNT64", "check_win8x64_ucrt");
+   Assignment1 = ("InstallExecuteSequence", "Not Installed And VersionNT = 
603 And (Not WINMAJORVER Or WINMAJORVER = \"#6\") And VersionNT64", 
"check_win8x64_ucrt");
Styles = "NO_FILE";
 End
 
@@ -147,7 +147,7 @@ WindowsCustomAction gid_Customaction_check_win81x32_ucrt
Source = "InstMSUBinary";
Target = "Windows81-KB2999226-x86msu";
Inbinarytable = 0;
-   Assignment1 = ("InstallExecuteSequence", "Not Installed And VersionNT = 
603 And Not VersionNT64", "check_win8x32_ucrt");
+   Assignment1 = ("InstallExecuteSequence", "Not Installed And VersionNT = 
603 And (Not WINMAJORVER Or WINMAJORVER = \"#6\") And Not VersionNT64", 
"check_win8x32_ucrt");
Styles = "NO_FILE";
 End
 

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

2019-05-24 Thread Mike Kaganski (via logerrit)
 scp2/source/winexplorerext/module_winexplorerext.ulf |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit d89054b3b3acd6c914c6ec8c3e5a530f9058a85b
Author: Mike Kaganski 
AuthorDate: Fri May 24 10:39:19 2019 +0200
Commit: Mike Kaganski 
CommitDate: Fri May 24 13:58:46 2019 +0200

Shell extension also enables full-text search on Windows

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

diff --git a/scp2/source/winexplorerext/module_winexplorerext.ulf 
b/scp2/source/winexplorerext/module_winexplorerext.ulf
index 2b476351b575..9da17602abc0 100644
--- a/scp2/source/winexplorerext/module_winexplorerext.ulf
+++ b/scp2/source/winexplorerext/module_winexplorerext.ulf
@@ -20,7 +20,7 @@
 en-US = "Windows Explorer Extension"
 
 [STR_DESC_MODULE_OPTIONAL_WINDOWS_EXPLORER_EXTENSIONS]
-en-US = "Enables the Microsoft Windows Explorer to show information about 
%PRODUCTNAME documents, such as thumbnail previews."
+en-US = "Enables the Microsoft Windows Explorer to show information about 
%PRODUCTNAME documents, such as thumbnail previews, and full-text search."
 
 
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

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

2019-05-30 Thread Mike Kaganski (via logerrit)
 configure.ac |7 ++-
 1 file changed, 6 insertions(+), 1 deletion(-)

New commits:
commit ad7dfdef5f9504dfcd600bf4d88a97c35b9d5d6d
Author: Mike Kaganski 
AuthorDate: Wed May 29 15:18:31 2019 +0200
Commit: Mike Kaganski 
CommitDate: Thu May 30 14:12:42 2019 +0200

Support VC++ 2019 tools v142

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

diff --git a/configure.ac b/configure.ac
index dfa860de51af..3ded6d71385d 100644
--- a/configure.ac
+++ b/configure.ac
@@ -5503,7 +5503,7 @@ find_msms()
 my_msm_files=Microsoft_VC${VCVER}_CRT_x86.msm
 case "$VCVER" in
 150|160)
-my_msm_files="Microsoft_VC141_CRT_x86.msm ${my_msm_files}"
+my_msm_files="Microsoft_VC141_CRT_x86.msm Microsoft_VC142_CRT_x86.msm 
${my_msm_files}"
 ;;
 esac
 AC_MSG_CHECKING([for ${my_msm_files}])
@@ -5577,6 +5577,11 @@ find_msvc_x64_dlls()
 
msvcdllpath="$VC_PRODUCT_DIR/redist/MSVC/$l/x64/Microsoft.VC141.CRT"
 break
 fi
+AC_MSG_CHECKING([for 
$VC_PRODUCT_DIR/redist/MSVC/$l/x64/Microsoft.VC142.CRT])
+if test -d 
"$VC_PRODUCT_DIR/redist/MSVC/$l/x64/Microsoft.VC142.CRT"; then
+
msvcdllpath="$VC_PRODUCT_DIR/redist/MSVC/$l/x64/Microsoft.VC142.CRT"
+break
+fi
 if test -d 
"$VC_PRODUCT_DIR/redist/MSVC/$l/onecore/x64/Microsoft.VC150.CRT"; then
 
msvcdllpath="$VC_PRODUCT_DIR/redist/MSVC/$l/onecore/x64/Microsoft.VC150.CRT"
 break
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

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

2019-05-30 Thread Mike Kaganski (via logerrit)
 vcl/inc/widgetdraw/WidgetDefinition.hxx |4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

New commits:
commit 831de14f660ba4faf4cac716e30246c8dc0386f1
Author: Mike Kaganski 
AuthorDate: Thu May 30 12:25:40 2019 +0200
Commit: Mike Kaganski 
CommitDate: Thu May 30 15:24:17 2019 +0200

Unconst members of ControlTypeAndPart

... which need to be assignable in auto-generated operator= in VS2019
toolset v142. Without that, a compile-time error is generated:

[CXX] vcl/source/gdi/WidgetDefinitionReader.cxx
[CXX] vcl/source/gdi/WidgetDefinition.cxx
[CXX] vcl/source/gdi/gdimetafiletools.cxx

C:\PROGRA~2\MICROS~2\2019\COMMUN~1\VC\Tools\MSVC\14.21.27702\Include\list(1076):
 error C2220: warning treated as error - no 'object' file generated

C:\PROGRA~2\MICROS~2\2019\COMMUN~1\VC\Tools\MSVC\14.21.27702\Include\list(1076):
 warning C4239: nonstandard extension used: 'argument': conversion from 'const 
std::pair' to 'volatile const std::pair<_Kty,_Ty> &'
with
[
_Kty=vcl::ControlTypeAndPart,
_Ty=std::shared_ptr
]

C:\PROGRA~2\MICROS~2\2019\COMMUN~1\VC\Tools\MSVC\14.21.27702\Include\list(1076):
 note: A non-const reference may only be bound to an lvalue; assignment 
operator takes a reference to non-const

C:\PROGRA~2\MICROS~2\2019\COMMUN~1\VC\Tools\MSVC\14.21.27702\Include\xhash(486):
 note: see reference to function template instantiation 'void 
std::list,std::allocator>>::_Assign_cast&,std::_List_unchecked_const_iterator>>,std::_Iterator_base0>>(_UIter,const _UIter)' being compiled
with
[
_Kty=vcl::ControlTypeAndPart,
_Ty=std::shared_ptr,

_UIter=std::_List_unchecked_const_iterator>>>,std::_Iterator_base0>
]

C:\PROGRA~2\MICROS~2\2019\COMMUN~1\VC\Tools\MSVC\14.21.27702\Include\xhash(485):
 note: see reference to function template instantiation 'void 
std::list,std::allocator>>::_Assign_cast&,std::_List_unchecked_const_iterator>>,std::_Iterator_base0>>(_UIter,const _UIter)' being compiled
with
[
_Kty=vcl::ControlTypeAndPart,
_Ty=std::shared_ptr,

_UIter=std::_List_unchecked_const_iterator>>>,std::_Iterator_base0>
]

C:\PROGRA~2\MICROS~2\2019\COMMUN~1\VC\Tools\MSVC\14.21.27702\Include\xhash(481):
 note: while compiling class template member function 'void 
std::_Hash,_Alloc,false>>::_Copy_assign(const
 
std::_Hash,_Alloc,false>>
 &,std::false_type)'
with
[
_Kty=vcl::ControlTypeAndPart,
_Ty=std::shared_ptr,
_Hasher=std::hash,
_Keyeq=std::equal_to,
_Alloc=std::allocator>>
]

C:\PROGRA~2\MICROS~2\2019\COMMUN~1\VC\Tools\MSVC\14.21.27702\Include\xhash(516):
 note: see reference to function template instantiation 'void 
std::_Hash,_Alloc,false>>::_Copy_assign(const
 
std::_Hash,_Alloc,false>>
 &,std::false_type)' being compiled
with
[
_Kty=vcl::ControlTypeAndPart,
_Ty=std::shared_ptr,
_Hasher=std::hash,
_Keyeq=std::equal_to,
_Alloc=std::allocator>>
]

C:\PROGRA~2\MICROS~2\2019\COMMUN~1\VC\Tools\MSVC\14.21.27702\Include\unordered_map(77):
 note: see reference to class template instantiation 
'std::_Hash,_Alloc,false>>'
 being compiled
with
[
_Kty=vcl::ControlTypeAndPart,
_Ty=std::shared_ptr,
_Hasher=std::hash,
_Keyeq=std::equal_to,
_Alloc=std::allocator>>
]

C:\cygwin\home\user\lode\dev\core\vcl\inc\widgetdraw/WidgetDefinition.hxx(260): 
note: see reference to class template instantiation 
'std::unordered_map,std::hash,std::equal_to<_Kty>,std::allocator>>' being compiled
with
[
_Kty=vcl::ControlTypeAndPart,
_Ty=std::shared_ptr
]

C:\PROGRA~2\MICROS~2\2019\COMMUN~1\VC\Tools\MSVC\14.21.27702\Include\list(1076):
 error C2280: 'std::pair<_Kty,_Ty> &std::pair<_Kty,_Ty>::operator =(volatile 
const std::pair<_Kty,_Ty> &)': attempting to reference a deleted function
with
[
_Kty=vcl::ControlTypeAndPart,
_Ty=std::shared_ptr
]

C:\PROGRA~2\MICROS~2\2019\COMMUN~1\VC\Tools\MSVC\14.21.27702\Include\utility(177):
 note: see declaration of 'std::pair<_Kty,_Ty>::operator ='
with
[
_Kty=vcl::ControlTypeAndPart,
_Ty=std::shared_ptr
]

C:\PROGRA~2\MICROS~2\2019\COMMUN~1\VC\Tools\MSVC\14.21.27702\Include\utility(177):
 note: 'std::pair<_Kty,_Ty> &std::pair<_Kty,_Ty>::operator =(volatile const 
std::pair<_Kty,_Ty> &)': function was explicitly deleted
with
[
_Kty=vcl::ControlTypeAndPart,
_Ty=std::shared_ptr
]

C:\PROGRA~2\MICROS~2\2019\COMMUN~1\VC\Tools\MSVC\14.21.27702\Include\list(1076):
 error C2220: warning treated as error - no 'object' file generated

C:\PROGRA~2\MICROS~2\2019\COMMUN~1\VC\Tools\MSVC\14.21.27702\Include\list(1076):
 warning C4239: nonstandard extension used: 'argument': conversion from 'const 
std::pair' to 'volatile const std::pair<_Kty,_Ty> &'
with
[
_Kty=vcl::ControlTypeAndPart,
_Ty=std::shared_ptr
]

C:\PROGRA~2\MICROS~2\2019\COMMUN~1\VC\Tools\MSVC\14.21.2

[Libreoffice-commits] core.git: Branch 'distro/lhm/libreoffice-6-1+backports' - dtrans/source

2019-06-04 Thread Mike Kaganski (via logerrit)
 dtrans/source/win32/dtobj/DOTransferable.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 5deaeab8705e43189d3541b55a41fe853e230c2e
Author: Mike Kaganski 
AuthorDate: Wed Oct 10 16:37:15 2018 +0200
Commit: Juergen Funk (CIB) 
CommitDate: Tue Jun 4 09:01:20 2019 +0200

Properly check HRESULT

Although the IEnumFORMATETC::Next documentation only mentions S_OK and
S_FALSE, there are error codes that also may be returned: e.g.,
0x800706BA RPC server unavailable (encountered locally in a unit test).
In that case, this used to loop infinitely.

We are only interested in S_OK result, so check for it.

Change-Id: I062e409e84efb68353321f7c48d922ec83191f73
Reviewed-on: https://gerrit.libreoffice.org/61621
Tested-by: Jenkins
Reviewed-by: Mike Kaganski 
(cherry picked from commit 9eb489da4682a89ab96b0d6a8ba13418aac4ca9d)
Reviewed-on: https://gerrit.libreoffice.org/73427
Reviewed-by: Juergen Funk (CIB) 
Tested-by: Juergen Funk (CIB) 

diff --git a/dtrans/source/win32/dtobj/DOTransferable.cxx 
b/dtrans/source/win32/dtobj/DOTransferable.cxx
index 2b3f5ff2e890..db70196e18a3 100644
--- a/dtrans/source/win32/dtobj/DOTransferable.cxx
+++ b/dtrans/source/win32/dtobj/DOTransferable.cxx
@@ -281,7 +281,7 @@ void CDOTransferable::initFlavorList( )
 pEnumFormatEtc->Reset( );
 
 FORMATETC fetc;
-while ( S_FALSE != pEnumFormatEtc->Next( 1, &fetc, nullptr ) )
+while ( S_OK == pEnumFormatEtc->Next( 1, &fetc, nullptr ) )
 {
 // we use locales only to determine the
 // charset if there is text on the cliboard
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

[Libreoffice-commits] core.git: Branch 'distro/lhm/libreoffice-6-1+backports' - dtrans/test sal/osl sfx2/source

2019-06-04 Thread Mike Kaganski (via logerrit)
 dtrans/test/win32/dnd/atlwindow.cxx  |2 +-
 sal/osl/w32/dllentry.cxx |6 +-
 sfx2/source/appl/shutdowniconw32.cxx |2 +-
 3 files changed, 7 insertions(+), 3 deletions(-)

New commits:
commit 0ae5ee9341f2dbd4b272b6d1302decaad0f9e152
Author: Mike Kaganski 
AuthorDate: Fri Sep 7 07:05:32 2018 +0200
Commit: Juergen Funk (CIB) 
CommitDate: Tue Jun 4 09:02:23 2019 +0200

Cppcheck: release the handle that CreateThread returns

Change-Id: I4d6d04873d69d2ff1e5409372b353e0bb9a5d68d
Reviewed-on: https://gerrit.libreoffice.org/60120
Reviewed-by: Noel Grandin 
Tested-by: Jenkins
Reviewed-by: Mike Kaganski 
(cherry picked from commit aef44b5a71d6d2bd8e399d2cb35bce6d6023fbf8)
Reviewed-on: https://gerrit.libreoffice.org/73429
Reviewed-by: Juergen Funk (CIB) 
Tested-by: Juergen Funk (CIB) 

diff --git a/dtrans/test/win32/dnd/atlwindow.cxx 
b/dtrans/test/win32/dnd/atlwindow.cxx
index 7aa0df7ce0ac..9e1e2e1fc693 100644
--- a/dtrans/test/win32/dnd/atlwindow.cxx
+++ b/dtrans/test/win32/dnd/atlwindow.cxx
@@ -181,7 +181,7 @@ LRESULT AWindow::OnTimer(UINT uMsg, WPARAM wParam, LPARAM 
lParam, BOOL& bHandled
 
 data.evtThreadReady= CreateEvent( NULL, FALSE, FALSE, NULL);
 
-HANDLE hThread= CreateThread( NULL, 0, MTAFunc, &data, 0, 
&mtaThreadId);
+CloseHandle(CreateThread(NULL, 0, MTAFunc, &data, 0, 
&mtaThreadId));
 // We must wait until the thread copied the ThreadData 
structure
 WaitForSingleObject( data.evtThreadReady, INFINITE);
 CloseHandle( data.evtThreadReady);
diff --git a/sal/osl/w32/dllentry.cxx b/sal/osl/w32/dllentry.cxx
index ffdaeb80dac9..5dd8151a58c3 100644
--- a/sal/osl/w32/dllentry.cxx
+++ b/sal/osl/w32/dllentry.cxx
@@ -222,13 +222,17 @@ BOOL WINAPI DllMain( HINSTANCE, DWORD fdwReason, LPVOID )
 {
 // No error check, it works or it does not
 // Thread should only be started for headless mode, see 
desktop/win32/source/officeloader.cxx
-CreateThread( nullptr, 0, ParentMonitorThreadProc, 
reinterpret_cast(dwParentProcessId), 0, &dwThreadId );
+HANDLE hThread
+= CreateThread(nullptr, 0, ParentMonitorThreadProc,
+   
reinterpret_cast(dwParentProcessId), 0, &dwThreadId);
 // Note: calling CreateThread in DllMain is discouraged
 // but this is only done in the headless mode and in
 // that case no other threads should be running at startup
 // when sal3.dll is loaded; also there is no
 // synchronization with the spawned thread, so there
 // does not appear to be a real risk of deadlock here
+if (hThread)
+CloseHandle(hThread);
 }
 }
 
diff --git a/sfx2/source/appl/shutdowniconw32.cxx 
b/sfx2/source/appl/shutdowniconw32.cxx
index f96968186948..37fc3a30e88d 100644
--- a/sfx2/source/appl/shutdowniconw32.cxx
+++ b/sfx2/source/appl/shutdowniconw32.cxx
@@ -527,7 +527,7 @@ void win32_init_sys_tray()
 );
 
 DWORD   dwThreadId;
-CreateThread( nullptr, 0, SystrayThread, nullptr, 0, &dwThreadId );
+CloseHandle(CreateThread(nullptr, 0, SystrayThread, nullptr, 0, 
&dwThreadId));
 }
 }
 
___
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-06-04 Thread Mike Kaganski (via logerrit)
 sw/qa/extras/ooxmlexport/data/tdf125657.docx |binary
 sw/qa/extras/ooxmlexport/ooxmlexport13.cxx   |   25 +
 sw/source/filter/ww8/docxattributeoutput.cxx |8 
 3 files changed, 29 insertions(+), 4 deletions(-)

New commits:
commit 166aafde5b716dfeb5325e7d1bee1c163ab56b12
Author: Mike Kaganski 
AuthorDate: Tue Jun 4 17:08:04 2019 +1000
Commit: Mike Kaganski 
CommitDate: Tue Jun 4 13:06:14 2019 +0200

tdf#125657: restore conversion of a:srcRect attributes to integers

Regression from commit 1fe24bb1e2fbe44a4bf2c03297e259b3a18b1235

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

diff --git a/sw/qa/extras/ooxmlexport/data/tdf125657.docx 
b/sw/qa/extras/ooxmlexport/data/tdf125657.docx
new file mode 100755
index ..eeaad7a4bb3d
Binary files /dev/null and b/sw/qa/extras/ooxmlexport/data/tdf125657.docx differ
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport13.cxx 
b/sw/qa/extras/ooxmlexport/ooxmlexport13.cxx
index edbc0964685d..804d25b9612e 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport13.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport13.cxx
@@ -323,6 +323,31 @@ DECLARE_OOXMLIMPORT_TEST(testTdf121784, "tdf121784.docx")
 CPPUNIT_ASSERT_EQUAL( OUString( "i" ), getRun( getParagraph( 2 ), 3 
)->getString());
 }
 
+DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testTdf125657, "tdf125657.docx")
+{
+xmlDocPtr pXmlDoc = parseExport("word/document.xml");
+CPPUNIT_ASSERT(pXmlDoc);
+auto checkAttrIsInt = [&](const OString& sAttrName) {
+OUString sAttr = getXPath(pXmlDoc,
+  
"/w:document/w:body/w:p[1]/w:r[1]/w:drawing/wp:inline/a:graphic/"
+  
"a:graphicData/pic:pic/pic:blipFill/a:srcRect",
+  sAttrName);
+OString sAssertMsg("Attribute " + sAttrName + " value " + 
sAttr.toUtf8()
+   + " is not a valid integer");
+CPPUNIT_ASSERT_MESSAGE(sAssertMsg.getStr(), !sAttr.isEmpty());
+// Only decimal characters allowed, optionally prepended with '-'; no 
'.'
+CPPUNIT_ASSERT_MESSAGE(sAssertMsg.getStr(),
+   sAttr[0] == '-' || (sAttr[0] >= '0' && sAttr[0] 
<= '9'));
+for (sal_Int32 i = 1; i < sAttr.getLength(); ++i)
+CPPUNIT_ASSERT_MESSAGE(sAssertMsg.getStr(), sAttr[i] >= '0' && 
sAttr[i] <= '9');
+};
+// check that we export all coordinates of srcRect as integers
+checkAttrIsInt("l");
+checkAttrIsInt("t");
+checkAttrIsInt("r");
+checkAttrIsInt("b");
+}
+
 CPPUNIT_PLUGIN_IMPLEMENT();
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/filter/ww8/docxattributeoutput.cxx 
b/sw/source/filter/ww8/docxattributeoutput.cxx
index 6e7fa0632e0d..472649c7585a 100644
--- a/sw/source/filter/ww8/docxattributeoutput.cxx
+++ b/sw/source/filter/ww8/docxattributeoutput.cxx
@@ -4668,10 +4668,10 @@ void DocxAttributeOutput::WriteSrcRect(const SdrObject* 
pSdrObj, const SwFrameFo
 double  widthMultiplier  = 10.0/aOriginalSize.Width();
 double  heightMultiplier = 10.0/aOriginalSize.Height();
 
-double left   = nCropL * widthMultiplier;
-double right  = nCropR * widthMultiplier;
-double top= nCropT * heightMultiplier;
-double bottom = nCropB * heightMultiplier;
+sal_Int32 left   = static_cast(rtl::math::round(nCropL * 
widthMultiplier));
+sal_Int32 right  = static_cast(rtl::math::round(nCropR * 
widthMultiplier));
+sal_Int32 top= static_cast(rtl::math::round(nCropT * 
heightMultiplier));
+sal_Int32 bottom = static_cast(rtl::math::round(nCropB * 
heightMultiplier));
 
 m_pSerializer->singleElementNS( XML_a, XML_srcRect,
  XML_l, OString::number(left),
___
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' - Repository.mk scp2/source setup_native/Library_reg_dlls.mk setup_native/Module_setup_native.mk setup_native/source

2019-06-04 Thread Mike Kaganski (via logerrit)
 Repository.mk |1 
 scp2/source/calc/module_calc.scp  |2 
 scp2/source/draw/module_draw.scp  |2 
 scp2/source/impress/module_impress.scp|2 
 scp2/source/ooo/windowscustomaction_ooo.scp   |   41 +
 scp2/source/writer/module_writer.scp  |2 
 setup_native/Library_reg_dlls.mk  |   40 +
 setup_native/Module_setup_native.mk   |1 
 setup_native/source/win32/customactions/reg_dlls/reg_dlls.cxx |  281 ++
 setup_native/source/win32/customactions/reg_dlls/reg_dlls.def |5 
 10 files changed, 373 insertions(+), 4 deletions(-)

New commits:
commit 7f0ef81cec7e4f64c7fbfce04372d84871244b11
Author: Mike Kaganski 
AuthorDate: Wed May 22 19:17:44 2019 +0300
Commit: Aron Budea 
CommitDate: Tue Jun 4 21:58:30 2019 +0200

Register spsupp*.dll during installation

This registers SharePoint integration libraries using regsvr.exe.
Both 32-bit and 64-bit libraries are registered; registration of
SharePoint.OpenDocuments is unconditional (subject to ActiveX
feature install state), substituting respective MSO component.

This only works for 32-bit MSI, because in case of 64-bit MSI, only
64-bit SharePoint DLL is included; this makes the library ~useless
in case of 64-bit MSI, because IE needs 32-bit component absent there.
Proper solution will be created for master branch.

Change-Id: Ic5bf9e7090acfaa17d47cb72b9ebfd483242f656
Reviewed-on: https://gerrit.libreoffice.org/72801
Reviewed-by: Aron Budea 
Tested-by: Aron Budea 

diff --git a/Repository.mk b/Repository.mk
index ca4b1031131c..889643183942 100644
--- a/Repository.mk
+++ b/Repository.mk
@@ -668,6 +668,7 @@ $(eval $(call 
gb_Helper_register_libraries_for_install,PLAINLIBS_OOO,ooobinaryta
instooofiltmsi \
inst_msu_msi \
qslnkmsi \
+   reg_dlls \
reg4allmsdoc \
sdqsmsi \
sellangmsi \
diff --git a/scp2/source/calc/module_calc.scp b/scp2/source/calc/module_calc.scp
index dd31007bb5ca..0f83dec54352 100644
--- a/scp2/source/calc/module_calc.scp
+++ b/scp2/source/calc/module_calc.scp
@@ -74,7 +74,7 @@ Module gid_Module_Prg_Calc_MSO_Reg
 Name = "gid_Module_Prg_Calc_MSO_Reg";
 Description = "gid_Module_Prg_Calc_MSO_Reg";
 Styles = (HIDDEN_ROOT);
-Default = YES;
+Default = NO;
 End
 
 Module gid_Module_Prg_Calc_Other_Reg
diff --git a/scp2/source/draw/module_draw.scp b/scp2/source/draw/module_draw.scp
index 87375797e1c6..c4c835b4ccc1 100644
--- a/scp2/source/draw/module_draw.scp
+++ b/scp2/source/draw/module_draw.scp
@@ -64,7 +64,7 @@ Module gid_Module_Prg_Draw_MSO_Reg
 Name = "gid_Module_Prg_Draw_MSO_Reg";
 Description = "gid_Module_Prg_Draw_MSO_Reg";
 Styles = (HIDDEN_ROOT);
-Default = YES;
+Default = NO;
 End
 
 Module gid_Module_Prg_Draw_Other_Reg
diff --git a/scp2/source/impress/module_impress.scp 
b/scp2/source/impress/module_impress.scp
index ca335d6973d9..42d62dd9e7c6 100644
--- a/scp2/source/impress/module_impress.scp
+++ b/scp2/source/impress/module_impress.scp
@@ -66,7 +66,7 @@ Module gid_Module_Prg_Impress_MSO_Reg
 Name = "gid_Module_Prg_Impress_MSO_Reg";
 Description = "gid_Module_Prg_Impress_MSO_Reg";
 Styles = (HIDDEN_ROOT);
-Default = YES;
+Default = NO;
 End
 
 Module gid_Module_Prg_Impress_Other_Reg
diff --git a/scp2/source/ooo/windowscustomaction_ooo.scp 
b/scp2/source/ooo/windowscustomaction_ooo.scp
index bc7201b9b2b4..f98296ca48dc 100644
--- a/scp2/source/ooo/windowscustomaction_ooo.scp
+++ b/scp2/source/ooo/windowscustomaction_ooo.scp
@@ -221,3 +221,44 @@ WindowsCustomAction gid_Customaction_RegisterSomeExtensions
 End
 
 #endif /* HAVE_WINDOWS_SDK */
+
+/* Deferred not-impersonated actions that will call regsvr32 to (un)register 
DLLs.
+   Custom action type 1 (msidbCustomActionTypeDll + 
msidbCustomActionTypeBinaryData)
+   + 64 (msidbCustomActionTypeContinue) + 1024 (msidbCustomActionTypeInScript)
+   + 2048 (msidbCustomActionTypeNoImpersonate).
+   Since deferred actions don't have access to current DB, the actions depend 
on
+   immediate-executed action prep_reg_unreg_dlls (see below) that precedes it, 
and
+   sets this action's CustomActionData property.
+*/
+
+WindowsCustomAction gid_Customaction_reg_dlls
+   Name = "reg_dlls";
+   Typ = "3137";
+   Source = "reg_dlls.dll";
+   Target = "RegDLLs";
+   Inbinarytable = 1;
+   Assignment1 = ("InstallExecuteSequence", "reg_dlls", "InstallFinalize");
+End
+
+WindowsCustomAction gid_Customaction_unreg_dlls
+   Name = "unreg_dlls";
+   Typ = "3137";
+   Source = "reg_dlls.dll";
+   Target = "UnregDLLs";
+   Inbinarytable = 1;
+   Assignment1 = ("InstallExecuteSequence", "unreg_dlls

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

2019-06-04 Thread Mike Kaganski (via logerrit)
 sw/qa/extras/ooxmlexport/data/tdf125657.docx |binary
 sw/qa/extras/ooxmlexport/ooxmlexport13.cxx   |   25 +
 sw/source/filter/ww8/docxattributeoutput.cxx |8 
 3 files changed, 29 insertions(+), 4 deletions(-)

New commits:
commit 66a5ab79b0a67e67ce196557ae4e768460807d98
Author: Mike Kaganski 
AuthorDate: Tue Jun 4 17:08:04 2019 +1000
Commit: Mike Kaganski 
CommitDate: Tue Jun 4 23:31:35 2019 +0200

tdf#125657: restore conversion of a:srcRect attributes to integers

Regression from commit 1fe24bb1e2fbe44a4bf2c03297e259b3a18b1235

Change-Id: I5597fe6a7f7c54ad9bf2634eba5245e2e4a1efbf
Reviewed-on: https://gerrit.libreoffice.org/73430
Tested-by: Jenkins
Reviewed-by: Mike Kaganski 
(cherry picked from commit 166aafde5b716dfeb5325e7d1bee1c163ab56b12)
Reviewed-on: https://gerrit.libreoffice.org/73452

diff --git a/sw/qa/extras/ooxmlexport/data/tdf125657.docx 
b/sw/qa/extras/ooxmlexport/data/tdf125657.docx
new file mode 100755
index ..eeaad7a4bb3d
Binary files /dev/null and b/sw/qa/extras/ooxmlexport/data/tdf125657.docx differ
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport13.cxx 
b/sw/qa/extras/ooxmlexport/ooxmlexport13.cxx
index edbc0964685d..804d25b9612e 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport13.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport13.cxx
@@ -323,6 +323,31 @@ DECLARE_OOXMLIMPORT_TEST(testTdf121784, "tdf121784.docx")
 CPPUNIT_ASSERT_EQUAL( OUString( "i" ), getRun( getParagraph( 2 ), 3 
)->getString());
 }
 
+DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testTdf125657, "tdf125657.docx")
+{
+xmlDocPtr pXmlDoc = parseExport("word/document.xml");
+CPPUNIT_ASSERT(pXmlDoc);
+auto checkAttrIsInt = [&](const OString& sAttrName) {
+OUString sAttr = getXPath(pXmlDoc,
+  
"/w:document/w:body/w:p[1]/w:r[1]/w:drawing/wp:inline/a:graphic/"
+  
"a:graphicData/pic:pic/pic:blipFill/a:srcRect",
+  sAttrName);
+OString sAssertMsg("Attribute " + sAttrName + " value " + 
sAttr.toUtf8()
+   + " is not a valid integer");
+CPPUNIT_ASSERT_MESSAGE(sAssertMsg.getStr(), !sAttr.isEmpty());
+// Only decimal characters allowed, optionally prepended with '-'; no 
'.'
+CPPUNIT_ASSERT_MESSAGE(sAssertMsg.getStr(),
+   sAttr[0] == '-' || (sAttr[0] >= '0' && sAttr[0] 
<= '9'));
+for (sal_Int32 i = 1; i < sAttr.getLength(); ++i)
+CPPUNIT_ASSERT_MESSAGE(sAssertMsg.getStr(), sAttr[i] >= '0' && 
sAttr[i] <= '9');
+};
+// check that we export all coordinates of srcRect as integers
+checkAttrIsInt("l");
+checkAttrIsInt("t");
+checkAttrIsInt("r");
+checkAttrIsInt("b");
+}
+
 CPPUNIT_PLUGIN_IMPLEMENT();
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/filter/ww8/docxattributeoutput.cxx 
b/sw/source/filter/ww8/docxattributeoutput.cxx
index 6e7fa0632e0d..472649c7585a 100644
--- a/sw/source/filter/ww8/docxattributeoutput.cxx
+++ b/sw/source/filter/ww8/docxattributeoutput.cxx
@@ -4668,10 +4668,10 @@ void DocxAttributeOutput::WriteSrcRect(const SdrObject* 
pSdrObj, const SwFrameFo
 double  widthMultiplier  = 10.0/aOriginalSize.Width();
 double  heightMultiplier = 10.0/aOriginalSize.Height();
 
-double left   = nCropL * widthMultiplier;
-double right  = nCropR * widthMultiplier;
-double top= nCropT * heightMultiplier;
-double bottom = nCropB * heightMultiplier;
+sal_Int32 left   = static_cast(rtl::math::round(nCropL * 
widthMultiplier));
+sal_Int32 right  = static_cast(rtl::math::round(nCropR * 
widthMultiplier));
+sal_Int32 top= static_cast(rtl::math::round(nCropT * 
heightMultiplier));
+sal_Int32 bottom = static_cast(rtl::math::round(nCropB * 
heightMultiplier));
 
 m_pSerializer->singleElementNS( XML_a, XML_srcRect,
  XML_l, OString::number(left),
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

[Libreoffice-commits] core.git: cui/uiconfig

2019-06-05 Thread Mike Kaganski (via logerrit)
 cui/uiconfig/ui/bulletandposition.ui |6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

New commits:
commit ada2b5be85f8c4d16c627a990e3f362ae0663d9f
Author: Mike Kaganski 
AuthorDate: Wed Jun 5 17:00:00 2019 +1000
Commit: Mike Kaganski 
CommitDate: Wed Jun 5 09:51:22 2019 +0200

Add GtkImage ids

An assert is failing without this:

ucrtbased.dll!abort() Line 61
at minkernel\crts\ucrt\src\appcrt\startup\abort.cpp(61)
ucrtbased.dll!common_assert_to_stderr(const wchar_t * const 
expression, const wchar_t * const file_name, const unsigned int line_number) 
Line 187
at minkernel\crts\ucrt\src\appcrt\startup\assert.cpp(187)
ucrtbased.dll!common_assert(const wchar_t * const expression, 
const wchar_t * const file_name, const unsigned int line_number, void * const 
return_address) Line 420
at minkernel\crts\ucrt\src\appcrt\startup\assert.cpp(420)
ucrtbased.dll!_wassert(const wchar_t * expression, const wchar_t * 
file_name, unsigned int line_number) Line 444
at minkernel\crts\ucrt\src\appcrt\startup\assert.cpp(444)
vcllo.dll!VclBuilder::get(const rtl::OString & sID) Line 446
at C:\cygwin\home\user\lode\dev\core\include\vcl\builder.hxx(446)
vcllo.dll!VclBuilder::VclBuilder(vcl::Window * pParent, const 
rtl::OUString & sUIDir, const rtl::OUString & sUIFile, const rtl::OString & 
sID, const com::sun::star::uno::Reference & 
rFrame, bool bLegacy) Line 698
at 
C:\cygwin\home\user\lode\dev\core\vcl\source\window\builder.cxx(698)
vcllo.dll!SalInstanceBuilder::SalInstanceBuilder(vcl::Window * pParent, 
const rtl::OUString & rUIRoot, const rtl::OUString & rUIFile) Line 4995
at 
C:\cygwin\home\user\lode\dev\core\vcl\source\app\salvtables.cxx(4995)
vcllo.dll!SalInstance::CreateBuilder(weld::Widget * pParent, const 
rtl::OUString & rUIRoot, const rtl::OUString & rUIFile) Line 5260
at 
C:\cygwin\home\user\lode\dev\core\vcl\source\app\salvtables.cxx(5260)
vcllo.dll!Application::CreateBuilder(weld::Widget * pParent, const 
rtl::OUString & rUIFile) Line 146
at 
C:\cygwin\home\user\lode\dev\core\vcl\source\window\builder.cxx(146)

vcllo.dll!weld::GenericDialogController::GenericDialogController(weld::Widget * 
pParent, const rtl::OUString & rUIFile, const rtl::OString & rDialogId) Line 
5347
at 
C:\cygwin\home\user\lode\dev\core\vcl\source\app\salvtables.cxx(5347)

sduilo.dll!SvxBulletAndPositionDlg::SvxBulletAndPositionDlg(weld::Window * 
pWindow, const SfxItemSet & rSet, sd::View * pView) Line 117
at 
C:\cygwin\home\user\lode\dev\core\sd\source\ui\dlg\BulletAndPositionDlg.cxx(117)
sduilo.dll!std::make_unique(weld::Window * & <_Args_0>, const 
SfxItemSet & <_Args_1>, sd::View * & <_Args_2>) Line 2042
at C:\Program Files (x86)\Microsoft Visual 
Studio\2019\Community\VC\Tools\MSVC\14.21.27702\include\memory(2042)

sduilo.dll!SdAbstractDialogFactory_Impl::CreateSvxBulletAndPositionDlg(weld::Window
 * pParent, const SfxItemSet * pAttr, sd::View * pView) Line 387
at 
C:\cygwin\home\user\lode\dev\core\sd\source\ui\dlg\sddlgfact.cxx(387)
sdlo.dll!sd::FuBulletAndPosition::DoExecute(SfxRequest & rReq) Line 92
at 
C:\cygwin\home\user\lode\dev\core\sd\source\ui\func\fuolbull.cxx(92)
sdlo.dll!sd::FuBulletAndPosition::Create(sd::ViewShell * pViewSh, 
sd::Window * pWin, sd::View * pView, SdDrawDocument * pDoc, SfxRequest & rReq) 
Line 57
at 
C:\cygwin\home\user\lode\dev\core\sd\source\ui\func\fuolbull.cxx(57)
sdlo.dll!sd::DrawViewShell::FuTemporary(SfxRequest & rReq) Line 1447
at 
C:\cygwin\home\user\lode\dev\core\sd\source\ui\view\drviews2.cxx(1447)
sdlo.dll!SfxStubDrawViewShellFuTemporary(SfxShell * pShell, SfxRequest 
& rReq) Line 1514
at 
C:\cygwin\home\user\lode\dev\core\workdir\SdiTarget\sd\sdi\sdslots.hxx(1514)
sfxlo.dll!SfxShell::CallExec(void(*)(SfxShell *, SfxRequest &) pFunc, 
SfxRequest & rReq) Line 197
at C:\cygwin\home\user\lode\dev\core\include\sfx2\shell.hxx(197)
sfxlo.dll!SfxDispatcher::Call_Impl(SfxShell & rShell, const SfxSlot & 
rSlot, SfxRequest & rReq, bool bRecord) Line 360
at 
C:\cygwin\home\user\lode\dev\core\sfx2\source\control\dispatch.cxx(360)
sfxlo.dll!SfxDispatcher::Execute_(SfxShell & rShell, const SfxSlot & 
rSlot, SfxRequest & rReq, SfxCallMode eCallMode) Line 857
at 
C:\cygwin\home\user\lode\dev\core\sfx2\source\control\dispatch.cxx(857)
sfxlo.dll!SfxBindings::Execute_Impl(SfxRequest & aReq, const SfxSlot * 
pSlot, SfxShell * pShell) Line 1066
at 
C:\cygwin\home\user\lode\dev\core\sfx2\source\control\bindings.cxx(1066)
sfxlo.dll!SfxDispatchController_Impl::dispatch(const 
com::sun::star::util::URL & aURL, const 
com::sun::star::uno::Sequence & aArgs, 
c

[Libreoffice-commits] core.git: cui/uiconfig

2019-06-05 Thread Mike Kaganski (via logerrit)
 cui/uiconfig/ui/bulletandposition.ui |   39 ---
 1 file changed, 18 insertions(+), 21 deletions(-)

New commits:
commit c3ce652b4a2a5891fa5664a0ad0ee8cb14aef908
Author: Mike Kaganski 
AuthorDate: Wed Jun 5 22:52:36 2019 +1000
Commit: Mike Kaganski 
CommitDate: Wed Jun 5 23:18:54 2019 +0200

Load align icons from theme

GTK stock images aren't available using other vcl plugins

Change-Id: I5ab23733d8d9c71fcf8db9f1867cb7d43516fff1
Co-authored-by: Caolán McNamara 
Reviewed-on: https://gerrit.libreoffice.org/73548
Tested-by: Jenkins
Reviewed-by: Mike Kaganski 

diff --git a/cui/uiconfig/ui/bulletandposition.ui 
b/cui/uiconfig/ui/bulletandposition.ui
index 0f2ae3140446..aae253f61f2a 100644
--- a/cui/uiconfig/ui/bulletandposition.ui
+++ b/cui/uiconfig/ui/bulletandposition.ui
@@ -66,6 +66,21 @@
   
 
   
+  
+True
+False
+cmd/sc_alignleft.png
+  
+  
+True
+False
+cmd/sc_alignhorizontalcenter.png
+  
+  
+True
+False
+cmd/sc_alignright.png
+  
   
 
   
@@ -797,14 +812,8 @@
 True
 True
 True
+image2
 True
-
-  
-True
-False
-gtk-justify-center
-  
-
   
   
 1
@@ -817,14 +826,8 @@
 True
 True
 88
+image1
 True
-
-  
-True
-False
-gtk-justify-left
-  
-
   
   
 0
@@ -836,14 +839,8 @@
 True
 True
 True
+image3
 True
-
-  
-True
-False
-gtk-justify-right
-  
-
   
   
 2
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

[Libreoffice-commits] core.git: cui/uiconfig

2019-06-05 Thread Mike Kaganski (via logerrit)
 cui/uiconfig/ui/bulletandposition.ui |7 +--
 1 file changed, 1 insertion(+), 6 deletions(-)

New commits:
commit 2265574dd571593e0070754ebd053eef6098ac98
Author: Mike Kaganski 
AuthorDate: Thu Jun 6 11:13:05 2019 +1000
Commit: Andras Timar 
CommitDate: Thu Jun 6 07:52:04 2019 +0200

tdf#125642: fix minimal sizes of dialog and its elements

Change-Id: I0232999866eb731fd74b3e954121f1960a3873bd
Reviewed-on: https://gerrit.libreoffice.org/73577
Tested-by: Jenkins
Reviewed-by: Andras Timar 

diff --git a/cui/uiconfig/ui/bulletandposition.ui 
b/cui/uiconfig/ui/bulletandposition.ui
index aae253f61f2a..e9d642e2a290 100644
--- a/cui/uiconfig/ui/bulletandposition.ui
+++ b/cui/uiconfig/ui/bulletandposition.ui
@@ -90,7 +90,6 @@
 
   
   
-300
 False
 6
 Bullets and Numbering
@@ -98,9 +97,6 @@
 0
 0
 dialog
-
-  
-
 
   
 False
@@ -979,8 +975,7 @@
 none
 
   
-0
-0
+150
 True
 False
 
___
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/uiconfig

2019-06-06 Thread Mike Kaganski (via logerrit)
 cui/uiconfig/ui/bulletandposition.ui |7 +--
 1 file changed, 1 insertion(+), 6 deletions(-)

New commits:
commit 4b2a8ca9297466fe82c002e5d9c40222e8cc84e1
Author: Mike Kaganski 
AuthorDate: Thu Jun 6 11:13:05 2019 +1000
Commit: Caolán McNamara 
CommitDate: Thu Jun 6 09:55:32 2019 +0200

tdf#125642: fix minimal sizes of dialog and its elements

Change-Id: I0232999866eb731fd74b3e954121f1960a3873bd
Reviewed-on: https://gerrit.libreoffice.org/73577
Tested-by: Jenkins
Reviewed-by: Andras Timar 
(cherry picked from commit 2265574dd571593e0070754ebd053eef6098ac98)
Reviewed-on: https://gerrit.libreoffice.org/73579
Reviewed-by: Caolán McNamara 
Tested-by: Caolán McNamara 

diff --git a/cui/uiconfig/ui/bulletandposition.ui 
b/cui/uiconfig/ui/bulletandposition.ui
index b0b723e2f924..c6e3a0e22f94 100644
--- a/cui/uiconfig/ui/bulletandposition.ui
+++ b/cui/uiconfig/ui/bulletandposition.ui
@@ -75,7 +75,6 @@
 
   
   
-300
 False
 6
 Bullets and Numbering
@@ -83,9 +82,6 @@
 0
 0
 dialog
-
-  
-
 
   
 False
@@ -982,8 +978,7 @@
 none
 
   
-0
-0
+150
 True
 False
 
___
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/uiconfig

2019-06-06 Thread Mike Kaganski (via logerrit)
 cui/uiconfig/ui/bulletandposition.ui |6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

New commits:
commit 0e14c700714d505c90f84018a3362b6dc258987a
Author: Mike Kaganski 
AuthorDate: Wed Jun 5 17:00:00 2019 +1000
Commit: Mike Kaganski 
CommitDate: Thu Jun 6 12:58:17 2019 +0200

Add GtkImage ids

An assert is failing without this:

ucrtbased.dll!abort() Line 61
at minkernel\crts\ucrt\src\appcrt\startup\abort.cpp(61)
ucrtbased.dll!common_assert_to_stderr(const wchar_t * const 
expression, const wchar_t * const file_name, const unsigned int line_number) 
Line 187
at minkernel\crts\ucrt\src\appcrt\startup\assert.cpp(187)
ucrtbased.dll!common_assert(const wchar_t * const expression, 
const wchar_t * const file_name, const unsigned int line_number, void * const 
return_address) Line 420
at minkernel\crts\ucrt\src\appcrt\startup\assert.cpp(420)
ucrtbased.dll!_wassert(const wchar_t * expression, const wchar_t * 
file_name, unsigned int line_number) Line 444
at minkernel\crts\ucrt\src\appcrt\startup\assert.cpp(444)
vcllo.dll!VclBuilder::get(const rtl::OString & sID) Line 446
at C:\cygwin\home\user\lode\dev\core\include\vcl\builder.hxx(446)
vcllo.dll!VclBuilder::VclBuilder(vcl::Window * pParent, const 
rtl::OUString & sUIDir, const rtl::OUString & sUIFile, const rtl::OString & 
sID, const com::sun::star::uno::Reference & 
rFrame, bool bLegacy) Line 698
at 
C:\cygwin\home\user\lode\dev\core\vcl\source\window\builder.cxx(698)
vcllo.dll!SalInstanceBuilder::SalInstanceBuilder(vcl::Window * pParent, 
const rtl::OUString & rUIRoot, const rtl::OUString & rUIFile) Line 4995
at 
C:\cygwin\home\user\lode\dev\core\vcl\source\app\salvtables.cxx(4995)
vcllo.dll!SalInstance::CreateBuilder(weld::Widget * pParent, const 
rtl::OUString & rUIRoot, const rtl::OUString & rUIFile) Line 5260
at 
C:\cygwin\home\user\lode\dev\core\vcl\source\app\salvtables.cxx(5260)
vcllo.dll!Application::CreateBuilder(weld::Widget * pParent, const 
rtl::OUString & rUIFile) Line 146
at 
C:\cygwin\home\user\lode\dev\core\vcl\source\window\builder.cxx(146)

vcllo.dll!weld::GenericDialogController::GenericDialogController(weld::Widget * 
pParent, const rtl::OUString & rUIFile, const rtl::OString & rDialogId) Line 
5347
at 
C:\cygwin\home\user\lode\dev\core\vcl\source\app\salvtables.cxx(5347)

sduilo.dll!SvxBulletAndPositionDlg::SvxBulletAndPositionDlg(weld::Window * 
pWindow, const SfxItemSet & rSet, sd::View * pView) Line 117
at 
C:\cygwin\home\user\lode\dev\core\sd\source\ui\dlg\BulletAndPositionDlg.cxx(117)
sduilo.dll!std::make_unique(weld::Window * & <_Args_0>, const 
SfxItemSet & <_Args_1>, sd::View * & <_Args_2>) Line 2042
at C:\Program Files (x86)\Microsoft Visual 
Studio\2019\Community\VC\Tools\MSVC\14.21.27702\include\memory(2042)

sduilo.dll!SdAbstractDialogFactory_Impl::CreateSvxBulletAndPositionDlg(weld::Window
 * pParent, const SfxItemSet * pAttr, sd::View * pView) Line 387
at 
C:\cygwin\home\user\lode\dev\core\sd\source\ui\dlg\sddlgfact.cxx(387)
sdlo.dll!sd::FuBulletAndPosition::DoExecute(SfxRequest & rReq) Line 92
at 
C:\cygwin\home\user\lode\dev\core\sd\source\ui\func\fuolbull.cxx(92)
sdlo.dll!sd::FuBulletAndPosition::Create(sd::ViewShell * pViewSh, 
sd::Window * pWin, sd::View * pView, SdDrawDocument * pDoc, SfxRequest & rReq) 
Line 57
at 
C:\cygwin\home\user\lode\dev\core\sd\source\ui\func\fuolbull.cxx(57)
sdlo.dll!sd::DrawViewShell::FuTemporary(SfxRequest & rReq) Line 1447
at 
C:\cygwin\home\user\lode\dev\core\sd\source\ui\view\drviews2.cxx(1447)
sdlo.dll!SfxStubDrawViewShellFuTemporary(SfxShell * pShell, SfxRequest 
& rReq) Line 1514
at 
C:\cygwin\home\user\lode\dev\core\workdir\SdiTarget\sd\sdi\sdslots.hxx(1514)
sfxlo.dll!SfxShell::CallExec(void(*)(SfxShell *, SfxRequest &) pFunc, 
SfxRequest & rReq) Line 197
at C:\cygwin\home\user\lode\dev\core\include\sfx2\shell.hxx(197)
sfxlo.dll!SfxDispatcher::Call_Impl(SfxShell & rShell, const SfxSlot & 
rSlot, SfxRequest & rReq, bool bRecord) Line 360
at 
C:\cygwin\home\user\lode\dev\core\sfx2\source\control\dispatch.cxx(360)
sfxlo.dll!SfxDispatcher::Execute_(SfxShell & rShell, const SfxSlot & 
rSlot, SfxRequest & rReq, SfxCallMode eCallMode) Line 857
at 
C:\cygwin\home\user\lode\dev\core\sfx2\source\control\dispatch.cxx(857)
sfxlo.dll!SfxBindings::Execute_Impl(SfxRequest & aReq, const SfxSlot * 
pSlot, SfxShell * pShell) Line 1066
at 
C:\cygwin\home\user\lode\dev\core\sfx2\source\control\bindings.cxx(1066)
sfxlo.dll!SfxDispatchController_Impl::dispatch(const 
com::sun::star::util::URL & aURL, const 
com::sun::star::uno::Sequence & aArgs, 
c

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

2019-06-06 Thread Mike Kaganski (via logerrit)
 cui/uiconfig/ui/bulletandposition.ui |   39 ---
 1 file changed, 18 insertions(+), 21 deletions(-)

New commits:
commit 9d78d85ca6678a13e99776637893b6e10b2cd337
Author: Mike Kaganski 
AuthorDate: Wed Jun 5 22:52:36 2019 +1000
Commit: Mike Kaganski 
CommitDate: Thu Jun 6 15:34:40 2019 +0200

Load align icons from theme

GTK stock images aren't available using other vcl plugins

Change-Id: I5ab23733d8d9c71fcf8db9f1867cb7d43516fff1
Co-authored-by: Caolán McNamara 
Reviewed-on: https://gerrit.libreoffice.org/73548
Tested-by: Jenkins
Reviewed-by: Mike Kaganski 
(cherry picked from commit c3ce652b4a2a5891fa5664a0ad0ee8cb14aef908)
Reviewed-on: https://gerrit.libreoffice.org/73600
Reviewed-by: Adolfo Jayme Barrientos 

diff --git a/cui/uiconfig/ui/bulletandposition.ui 
b/cui/uiconfig/ui/bulletandposition.ui
index 8ef2287792a0..d9d3a7e35fc4 100644
--- a/cui/uiconfig/ui/bulletandposition.ui
+++ b/cui/uiconfig/ui/bulletandposition.ui
@@ -66,6 +66,21 @@
   
 
   
+  
+True
+False
+cmd/sc_alignleft.png
+  
+  
+True
+False
+cmd/sc_alignhorizontalcenter.png
+  
+  
+True
+False
+cmd/sc_alignright.png
+  
   
 
   
@@ -796,14 +811,8 @@
 True
 True
 True
+image2
 True
-
-  
-True
-False
-gtk-justify-center
-  
-
   
   
 1
@@ -816,14 +825,8 @@
 True
 True
 88
+image1
 True
-
-  
-True
-False
-gtk-justify-left
-  
-
   
   
 0
@@ -835,14 +838,8 @@
 True
 True
 True
+image3
 True
-
-  
-True
-False
-gtk-justify-right
-  
-
   
   
 2
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

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

2019-06-07 Thread Mike Kaganski (via logerrit)
 sw/source/core/text/atrhndl.hxx |   10 +-
 sw/source/core/text/atrstck.cxx |   14 +++---
 2 files changed, 12 insertions(+), 12 deletions(-)

New commits:
commit 2d5821ceacf399ec9267a3704ee0b2cc8a598f04
Author: Mike Kaganski 
AuthorDate: Fri Jun 7 21:02:19 2019 +1000
Commit: Mike Kaganski 
CommitDate: Fri Jun 7 16:28:55 2019 +0200

tdf#125624: this bugdoc overflows sal_uInt16

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

diff --git a/sw/source/core/text/atrhndl.hxx b/sw/source/core/text/atrhndl.hxx
index f12bd76a34b1..81a141327e30 100644
--- a/sw/source/core/text/atrhndl.hxx
+++ b/sw/source/core/text/atrhndl.hxx
@@ -47,8 +47,8 @@ private:
 private:
 SwTextAttr*  m_pInitialArray[ INITIAL_NUM_ATTR ];
 SwTextAttr** m_pArray;
-sal_uInt16 m_nCount; // number of elements on stack
-sal_uInt16 m_nSize;  // number of positions in Array
+sal_uInt32 m_nCount; // number of elements on stack
+sal_uInt32 m_nSize;  // number of positions in Array
 
 public:
 // Ctor, Dtor
@@ -64,7 +64,7 @@ private:
 void Push( const SwTextAttr& rAttr ) { Insert(rAttr, m_nCount); };
 // insert at specified position, take care for not inserting behind
 // the value returned by Count()
-void Insert( const SwTextAttr& rAttr, const sal_uInt16 nPos );
+void Insert( const SwTextAttr& rAttr, const sal_uInt32 nPos );
 
 // remove specified attribute
 void Remove( const SwTextAttr& rAttr );
@@ -73,11 +73,11 @@ private:
 const SwTextAttr* Top() const;
 
 // number of elements on stack
-sal_uInt16 Count() const { return m_nCount; };
+sal_uInt32 Count() const { return m_nCount; };
 
 // returns position of rAttr on Stack if found, otherwise USHRT_MAX
 // can be used for Remove of an attribute
-sal_uInt16 Pos( const SwTextAttr& rAttr ) const;
+sal_uInt32 Pos( const SwTextAttr& rAttr ) const;
 };
 
 SwAttrStack m_aAttrStack[ NUM_ATTRIBUTE_STACKS ]; // stack collection
diff --git a/sw/source/core/text/atrstck.cxx b/sw/source/core/text/atrstck.cxx
index 9130208cc7c2..eb2762fffb40 100644
--- a/sw/source/core/text/atrstck.cxx
+++ b/sw/source/core/text/atrstck.cxx
@@ -270,7 +270,7 @@ inline SwAttrHandler::SwAttrStack::SwAttrStack()
 m_pArray = m_pInitialArray;
 }
 
-void SwAttrHandler::SwAttrStack::Insert( const SwTextAttr& rAttr, const 
sal_uInt16 nPos )
+void SwAttrHandler::SwAttrStack::Insert( const SwTextAttr& rAttr, const 
sal_uInt32 nPos )
 {
 // do we still have enough space?
 if (m_nCount >= m_nSize)
@@ -311,7 +311,7 @@ void SwAttrHandler::SwAttrStack::Insert( const SwTextAttr& 
rAttr, const sal_uInt
 
 void SwAttrHandler::SwAttrStack::Remove( const SwTextAttr& rAttr )
 {
-sal_uInt16 nPos = Pos( rAttr );
+sal_uInt32 nPos = Pos( rAttr );
 if (nPos < m_nCount)
 {
 memmove( m_pArray + nPos, m_pArray + nPos + 1,
@@ -326,20 +326,20 @@ const SwTextAttr* SwAttrHandler::SwAttrStack::Top() const
 return m_nCount ? m_pArray[ m_nCount - 1 ] : nullptr;
 }
 
-sal_uInt16 SwAttrHandler::SwAttrStack::Pos( const SwTextAttr& rAttr ) const
+sal_uInt32 SwAttrHandler::SwAttrStack::Pos( const SwTextAttr& rAttr ) const
 {
 if ( ! m_nCount )
 // empty stack
-return USHRT_MAX;
+return std::numeric_limits::max();
 
-for (sal_uInt16 nIdx = m_nCount; nIdx > 0;)
+for (sal_uInt32 nIdx = m_nCount; nIdx > 0;)
 {
 if (&rAttr == m_pArray[ --nIdx ])
 return nIdx;
 }
 
 // element not found
-return USHRT_MAX;
+return std::numeric_limits::max();
 }
 
 SwAttrHandler::SwAttrHandler()
@@ -487,7 +487,7 @@ bool SwAttrHandler::Push( const SwTextAttr& rAttr, const 
SfxPoolItem& rItem )
 return true;
 }
 
-const sal_uInt16 nPos = m_aAttrStack[ nStack ].Count();
+const sal_uInt32 nPos = m_aAttrStack[ nStack ].Count();
 OSL_ENSURE( nPos, "empty stack?" );
 m_aAttrStack[ nStack ].Insert( rAttr, nPos - 1 );
 return 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-06-07 Thread Mike Kaganski (via logerrit)
 sw/source/core/text/atrhndl.hxx |   47 +-
 sw/source/core/text/atrstck.cxx |  129 +---
 2 files changed, 35 insertions(+), 141 deletions(-)

New commits:
commit 5fca7ba2fd6031515636842b44996bac74287568
Author: Mike Kaganski 
AuthorDate: Fri Jun 7 23:22:13 2019 +1000
Commit: Mike Kaganski 
CommitDate: Sat Jun 8 03:50:29 2019 +0200

Drop SwAttrHandler::SwAttrStack; use std::vector instead

Change-Id: I3e6257cc34782ca32fb2a7c87c9976494b36907b
Reviewed-on: https://gerrit.libreoffice.org/73660
Reviewed-by: Noel Grandin 
Tested-by: Jenkins
Reviewed-by: Mike Kaganski 

diff --git a/sw/source/core/text/atrhndl.hxx b/sw/source/core/text/atrhndl.hxx
index 81a141327e30..8abb678ea9fd 100644
--- a/sw/source/core/text/atrhndl.hxx
+++ b/sw/source/core/text/atrhndl.hxx
@@ -20,10 +20,10 @@
 #ifndef INCLUDED_SW_SOURCE_CORE_TEXT_ATRHNDL_HXX
 #define INCLUDED_SW_SOURCE_CORE_TEXT_ATRHNDL_HXX
 
-#define INITIAL_NUM_ATTR 3
 #define NUM_ATTRIBUTE_STACKS 44
 
 #include 
+#include 
 #include 
 
 class SwTextAttr;
@@ -40,47 +40,7 @@ extern const sal_uInt8 StackPos[];
 class SwAttrHandler
 {
 private:
-
-/// Container for SwTextAttr Objects
-class SwAttrStack
-{
-private:
-SwTextAttr*  m_pInitialArray[ INITIAL_NUM_ATTR ];
-SwTextAttr** m_pArray;
-sal_uInt32 m_nCount; // number of elements on stack
-sal_uInt32 m_nSize;  // number of positions in Array
-
-public:
-// Ctor, Dtor
-inline SwAttrStack();
-~SwAttrStack() {
-if (m_nSize > INITIAL_NUM_ATTR) delete [] m_pArray;
-}
-
-// reset stack
-void Reset() { m_nCount = 0; };
-
-// insert on top
-void Push( const SwTextAttr& rAttr ) { Insert(rAttr, m_nCount); };
-// insert at specified position, take care for not inserting behind
-// the value returned by Count()
-void Insert( const SwTextAttr& rAttr, const sal_uInt32 nPos );
-
-// remove specified attribute
-void Remove( const SwTextAttr& rAttr );
-
-// get attribute from top if exists, otherwise 0
-const SwTextAttr* Top() const;
-
-// number of elements on stack
-sal_uInt32 Count() const { return m_nCount; };
-
-// returns position of rAttr on Stack if found, otherwise USHRT_MAX
-// can be used for Remove of an attribute
-sal_uInt32 Pos( const SwTextAttr& rAttr ) const;
-};
-
-SwAttrStack m_aAttrStack[ NUM_ATTRIBUTE_STACKS ]; // stack collection
+std::vector m_aAttrStack[NUM_ATTRIBUTE_STACKS]; // 
stack collection
 const SfxPoolItem* m_pDefaultArray[ NUM_DEFAULT_VALUES ];
 const IDocumentSettingAccess* m_pIDocumentSettingAccess;
 const SwViewShell* m_pShell;
@@ -91,6 +51,9 @@ private:
 
 bool m_bVertLayout;
 
+const SwTextAttr* GetTop(sal_uInt16 nStack);
+void RemoveFromStack(sal_uInt16 nWhich, const SwTextAttr& rAttr);
+
 // change font according to pool item
 void FontChg(const SfxPoolItem& rItem, SwFont& rFnt, bool bPush );
 
diff --git a/sw/source/core/text/atrstck.cxx b/sw/source/core/text/atrstck.cxx
index eb2762fffb40..39ea69a42b33 100644
--- a/sw/source/core/text/atrstck.cxx
+++ b/sw/source/core/text/atrstck.cxx
@@ -54,8 +54,6 @@
 #include 
 #include 
 
-#define STACK_INCREMENT 4
-
 /**
  * Attribute to Stack Mapping
  *
@@ -264,84 +262,6 @@ static bool lcl_ChgHyperLinkColor( const SwTextAttr& rAttr,
 return false;
 }
 
-inline SwAttrHandler::SwAttrStack::SwAttrStack()
-: m_nCount( 0 ), m_nSize( INITIAL_NUM_ATTR )
-{
-m_pArray = m_pInitialArray;
-}
-
-void SwAttrHandler::SwAttrStack::Insert( const SwTextAttr& rAttr, const 
sal_uInt32 nPos )
-{
-// do we still have enough space?
-if (m_nCount >= m_nSize)
-{
- // we are still in our initial array
-if (INITIAL_NUM_ATTR == m_nSize)
-{
-m_nSize += STACK_INCREMENT;
-m_pArray = new SwTextAttr*[ m_nSize ];
-// copy from pInitArray to new Array
-memcpy( m_pArray, m_pInitialArray,
-INITIAL_NUM_ATTR * sizeof(SwTextAttr*)
-);
-}
-// we are in new memory
-else
-{
-m_nSize += STACK_INCREMENT;
-SwTextAttr** pTmpArray = new SwTextAttr*[ m_nSize ];
-// copy from m_pArray to new Array
-memcpy( pTmpArray, m_pArray, m_nCount * sizeof(SwTextAttr*) );
-// free old array
-delete [] m_pArray;
-m_pArray = pTmpArray;
-}
-}
-
-OSL_ENSURE(nPos <= m_nCount, "wrong position for insert operation");
-
-if (nPos < m_nCount)
-memmove( m_pArray + nPos + 1, m_pArray + nPos,
-(m_nCount - nPos) * sizeof(SwTextAttr*)
-);
-m_pArray[ nPos ] = const_cast(&rAttr);
-
-m_nCount++;
-}
-
-void SwAttrHandler::SwAttrStack::Remove( const SwTextAttr& rAttr )
-{
-sa

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

2019-06-07 Thread Mike Kaganski (via logerrit)
 sw/source/core/text/atrhndl.hxx |   10 +-
 sw/source/core/text/atrstck.cxx |   14 +++---
 2 files changed, 12 insertions(+), 12 deletions(-)

New commits:
commit c744dac16ad808c73021cb2cecefe1d484934451
Author: Mike Kaganski 
AuthorDate: Fri Jun 7 21:02:19 2019 +1000
Commit: Mike Kaganski 
CommitDate: Sat Jun 8 03:53:00 2019 +0200

tdf#125624: this bugdoc overflows sal_uInt16

Change-Id: I8ecc08d3ef42b9f7cc501017e0e169bde2196317
Reviewed-on: https://gerrit.libreoffice.org/73654
Tested-by: Jenkins
Reviewed-by: Mike Kaganski 
(cherry picked from commit 2d5821ceacf399ec9267a3704ee0b2cc8a598f04)
Reviewed-on: https://gerrit.libreoffice.org/73671

diff --git a/sw/source/core/text/atrhndl.hxx b/sw/source/core/text/atrhndl.hxx
index f12bd76a34b1..81a141327e30 100644
--- a/sw/source/core/text/atrhndl.hxx
+++ b/sw/source/core/text/atrhndl.hxx
@@ -47,8 +47,8 @@ private:
 private:
 SwTextAttr*  m_pInitialArray[ INITIAL_NUM_ATTR ];
 SwTextAttr** m_pArray;
-sal_uInt16 m_nCount; // number of elements on stack
-sal_uInt16 m_nSize;  // number of positions in Array
+sal_uInt32 m_nCount; // number of elements on stack
+sal_uInt32 m_nSize;  // number of positions in Array
 
 public:
 // Ctor, Dtor
@@ -64,7 +64,7 @@ private:
 void Push( const SwTextAttr& rAttr ) { Insert(rAttr, m_nCount); };
 // insert at specified position, take care for not inserting behind
 // the value returned by Count()
-void Insert( const SwTextAttr& rAttr, const sal_uInt16 nPos );
+void Insert( const SwTextAttr& rAttr, const sal_uInt32 nPos );
 
 // remove specified attribute
 void Remove( const SwTextAttr& rAttr );
@@ -73,11 +73,11 @@ private:
 const SwTextAttr* Top() const;
 
 // number of elements on stack
-sal_uInt16 Count() const { return m_nCount; };
+sal_uInt32 Count() const { return m_nCount; };
 
 // returns position of rAttr on Stack if found, otherwise USHRT_MAX
 // can be used for Remove of an attribute
-sal_uInt16 Pos( const SwTextAttr& rAttr ) const;
+sal_uInt32 Pos( const SwTextAttr& rAttr ) const;
 };
 
 SwAttrStack m_aAttrStack[ NUM_ATTRIBUTE_STACKS ]; // stack collection
diff --git a/sw/source/core/text/atrstck.cxx b/sw/source/core/text/atrstck.cxx
index 9130208cc7c2..eb2762fffb40 100644
--- a/sw/source/core/text/atrstck.cxx
+++ b/sw/source/core/text/atrstck.cxx
@@ -270,7 +270,7 @@ inline SwAttrHandler::SwAttrStack::SwAttrStack()
 m_pArray = m_pInitialArray;
 }
 
-void SwAttrHandler::SwAttrStack::Insert( const SwTextAttr& rAttr, const 
sal_uInt16 nPos )
+void SwAttrHandler::SwAttrStack::Insert( const SwTextAttr& rAttr, const 
sal_uInt32 nPos )
 {
 // do we still have enough space?
 if (m_nCount >= m_nSize)
@@ -311,7 +311,7 @@ void SwAttrHandler::SwAttrStack::Insert( const SwTextAttr& 
rAttr, const sal_uInt
 
 void SwAttrHandler::SwAttrStack::Remove( const SwTextAttr& rAttr )
 {
-sal_uInt16 nPos = Pos( rAttr );
+sal_uInt32 nPos = Pos( rAttr );
 if (nPos < m_nCount)
 {
 memmove( m_pArray + nPos, m_pArray + nPos + 1,
@@ -326,20 +326,20 @@ const SwTextAttr* SwAttrHandler::SwAttrStack::Top() const
 return m_nCount ? m_pArray[ m_nCount - 1 ] : nullptr;
 }
 
-sal_uInt16 SwAttrHandler::SwAttrStack::Pos( const SwTextAttr& rAttr ) const
+sal_uInt32 SwAttrHandler::SwAttrStack::Pos( const SwTextAttr& rAttr ) const
 {
 if ( ! m_nCount )
 // empty stack
-return USHRT_MAX;
+return std::numeric_limits::max();
 
-for (sal_uInt16 nIdx = m_nCount; nIdx > 0;)
+for (sal_uInt32 nIdx = m_nCount; nIdx > 0;)
 {
 if (&rAttr == m_pArray[ --nIdx ])
 return nIdx;
 }
 
 // element not found
-return USHRT_MAX;
+return std::numeric_limits::max();
 }
 
 SwAttrHandler::SwAttrHandler()
@@ -487,7 +487,7 @@ bool SwAttrHandler::Push( const SwTextAttr& rAttr, const 
SfxPoolItem& rItem )
 return true;
 }
 
-const sal_uInt16 nPos = m_aAttrStack[ nStack ].Count();
+const sal_uInt32 nPos = m_aAttrStack[ nStack ].Count();
 OSL_ENSURE( nPos, "empty stack?" );
 m_aAttrStack[ nStack ].Insert( rAttr, nPos - 1 );
 return false;
___
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' - sw/source

2019-06-10 Thread Mike Kaganski (via logerrit)
 sw/source/core/text/atrhndl.hxx |   10 +-
 sw/source/core/text/atrstck.cxx |   14 +++---
 2 files changed, 12 insertions(+), 12 deletions(-)

New commits:
commit bc651b9157fa8f35e28774ffebda1bb7fadb455b
Author: Mike Kaganski 
AuthorDate: Fri Jun 7 21:02:19 2019 +1000
Commit: Xisco Faulí 
CommitDate: Mon Jun 10 10:55:52 2019 +0200

tdf#125624: this bugdoc overflows sal_uInt16

Change-Id: I8ecc08d3ef42b9f7cc501017e0e169bde2196317
Reviewed-on: https://gerrit.libreoffice.org/73654
Tested-by: Jenkins
Reviewed-by: Mike Kaganski 
(cherry picked from commit 2d5821ceacf399ec9267a3704ee0b2cc8a598f04)
Reviewed-on: https://gerrit.libreoffice.org/73672
Reviewed-by: Xisco Faulí 

diff --git a/sw/source/core/text/atrhndl.hxx b/sw/source/core/text/atrhndl.hxx
index 688b0aed12c5..07a1b67c16bb 100644
--- a/sw/source/core/text/atrhndl.hxx
+++ b/sw/source/core/text/atrhndl.hxx
@@ -47,8 +47,8 @@ private:
 private:
 SwTextAttr*  m_pInitialArray[ INITIAL_NUM_ATTR ];
 SwTextAttr** m_pArray;
-sal_uInt16 m_nCount; // number of elements on stack
-sal_uInt16 m_nSize;  // number of positions in Array
+sal_uInt32 m_nCount; // number of elements on stack
+sal_uInt32 m_nSize;  // number of positions in Array
 
 public:
 // Ctor, Dtor
@@ -64,7 +64,7 @@ private:
 void Push( const SwTextAttr& rAttr ) { Insert(rAttr, m_nCount); };
 // insert at specified position, take care for not inserting behind
 // the value returned by Count()
-void Insert( const SwTextAttr& rAttr, const sal_uInt16 nPos );
+void Insert( const SwTextAttr& rAttr, const sal_uInt32 nPos );
 
 // remove specified attribute
 void Remove( const SwTextAttr& rAttr );
@@ -73,11 +73,11 @@ private:
 const SwTextAttr* Top() const;
 
 // number of elements on stack
-sal_uInt16 Count() const { return m_nCount; };
+sal_uInt32 Count() const { return m_nCount; };
 
 // returns position of rAttr on Stack if found, otherwise USHRT_MAX
 // can be used for Remove of an attribute
-sal_uInt16 Pos( const SwTextAttr& rAttr ) const;
+sal_uInt32 Pos( const SwTextAttr& rAttr ) const;
 };
 
 SwAttrStack m_aAttrStack[ NUM_ATTRIBUTE_STACKS ]; // stack collection
diff --git a/sw/source/core/text/atrstck.cxx b/sw/source/core/text/atrstck.cxx
index ecae4e4a8385..626ab3fe30b4 100644
--- a/sw/source/core/text/atrstck.cxx
+++ b/sw/source/core/text/atrstck.cxx
@@ -270,7 +270,7 @@ inline SwAttrHandler::SwAttrStack::SwAttrStack()
 m_pArray = m_pInitialArray;
 }
 
-void SwAttrHandler::SwAttrStack::Insert( const SwTextAttr& rAttr, const 
sal_uInt16 nPos )
+void SwAttrHandler::SwAttrStack::Insert( const SwTextAttr& rAttr, const 
sal_uInt32 nPos )
 {
 // do we still have enough space?
 if (m_nCount >= m_nSize)
@@ -311,7 +311,7 @@ void SwAttrHandler::SwAttrStack::Insert( const SwTextAttr& 
rAttr, const sal_uInt
 
 void SwAttrHandler::SwAttrStack::Remove( const SwTextAttr& rAttr )
 {
-sal_uInt16 nPos = Pos( rAttr );
+sal_uInt32 nPos = Pos( rAttr );
 if (nPos < m_nCount)
 {
 memmove( m_pArray + nPos, m_pArray + nPos + 1,
@@ -326,20 +326,20 @@ const SwTextAttr* SwAttrHandler::SwAttrStack::Top() const
 return m_nCount ? m_pArray[ m_nCount - 1 ] : nullptr;
 }
 
-sal_uInt16 SwAttrHandler::SwAttrStack::Pos( const SwTextAttr& rAttr ) const
+sal_uInt32 SwAttrHandler::SwAttrStack::Pos( const SwTextAttr& rAttr ) const
 {
 if ( ! m_nCount )
 // empty stack
-return USHRT_MAX;
+return std::numeric_limits::max();
 
-for (sal_uInt16 nIdx = m_nCount; nIdx > 0;)
+for (sal_uInt32 nIdx = m_nCount; nIdx > 0;)
 {
 if (&rAttr == m_pArray[ --nIdx ])
 return nIdx;
 }
 
 // element not found
-return USHRT_MAX;
+return std::numeric_limits::max();
 }
 
 SwAttrHandler::SwAttrHandler()
@@ -487,7 +487,7 @@ bool SwAttrHandler::Push( const SwTextAttr& rAttr, const 
SfxPoolItem& rItem )
 return true;
 }
 
-const sal_uInt16 nPos = m_aAttrStack[ nStack ].Count();
+const sal_uInt32 nPos = m_aAttrStack[ nStack ].Count();
 OSL_ENSURE( nPos, "empty stack?" );
 m_aAttrStack[ nStack ].Insert( rAttr, nPos - 1 );
 return false;
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

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

2019-06-10 Thread Mike Kaganski (via logerrit)
 source/text/scalc/01/04060109.xhp |4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

New commits:
commit a42145547217fb6d12cd873e7af6c71abf301e90
Author: Mike Kaganski 
AuthorDate: Mon Jun 10 03:21:22 2019 +0200
Commit: Olivier Hallot 
CommitDate: Mon Jun 10 14:27:47 2019 +0200

Clarify HLOOKUP/VLOOKUP

Change-Id: I8093a173547850ff0a145a2985a25f46e3ae0297
Reviewed-on: https://gerrit.libreoffice.org/73746
Tested-by: Jenkins
Reviewed-by: Olivier Hallot 

diff --git a/source/text/scalc/01/04060109.xhp 
b/source/text/scalc/01/04060109.xhp
index 2a5d6d45b..5bfce339f 100644
--- a/source/text/scalc/01/04060109.xhp
+++ b/source/text/scalc/01/04060109.xhp
@@ -283,7 +283,7 @@
  
 Index is the number of the column in the array that 
contains the value to be returned. The first column has the number 
1.
  
-Sorted is an optional parameter that indicates 
whether the first column in the array is sorted in ascending order. Enter the 
Boolean value FALSE or zero if the first column is not sorted in ascending 
order. Sorted columns can be searched much faster and the function always 
returns a value, even if the search value was not matched exactly, if it is 
between the lowest and highest value of the sorted list. In unsorted lists, the 
search value must be matched exactly. Otherwise the function will return this 
message: Error: Value Not Available.
+Sorted is an optional parameter that indicates 
whether the first column in the array is sorted in ascending order. Enter the 
Boolean value FALSE or zero if the first column is not sorted in ascending 
order. Sorted columns can be searched much faster and the function always 
returns a value, even if the search value was not matched exactly, if it is 
greater than the lowest value of the sorted list. In unsorted lists, the search 
value must be matched exactly. Otherwise the function will return #N/A with 
message: Error: Value Not Available.
  
  
  You 
want to enter the number of a dish on the menu in cell A1, and the name of the 
dish is to appear as text in the neighboring cell (B1) immediately. The Number 
to Name assignment is contained in the D1:E100 array. D1 contains 100, E1 contains the name Vegetable 
Soup, and so forth, for 100 menu items. The numbers in column D are 
sorted in ascending order; thus, the optional Sorted parameter is not necessary.
@@ -454,7 +454,7 @@
  
  
  HLOOKUP(SearchCriterion; Array; Index; Sorted)
- See 
also: VLOOKUP (columns and rows are exchanged)
+ For 
an explanation on the parameters, see: VLOOKUP 
(columns and rows are exchanged)
  
   
   
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

[Libreoffice-commits] core.git: helpcontent2

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

New commits:
commit 40717718370de0467954e841cbfcd4cd4472a7d0
Author: Mike Kaganski 
AuthorDate: Mon Jun 10 03:21:22 2019 +0200
Commit: Gerrit Code Review 
CommitDate: Mon Jun 10 14:27:47 2019 +0200

Update git submodules

* Update helpcontent2 from branch 'master'
  - Clarify HLOOKUP/VLOOKUP

Change-Id: I8093a173547850ff0a145a2985a25f46e3ae0297
Reviewed-on: https://gerrit.libreoffice.org/73746
Tested-by: Jenkins
Reviewed-by: Olivier Hallot 

diff --git a/helpcontent2 b/helpcontent2
index 2c84c28bc304..a42145547217 16
--- a/helpcontent2
+++ b/helpcontent2
@@ -1 +1 @@
-Subproject commit 2c84c28bc30456c8eb4e0473887ce1d5ff3e4209
+Subproject commit a42145547217fb6d12cd873e7af6c71abf301e90
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

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

2019-06-12 Thread Mike Kaganski (via logerrit)
 writerfilter/source/rtftok/rtfdispatchflag.cxx |4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

New commits:
commit 8bafe19e22c496c79065a60622c9450bda1f
Author: Mike Kaganski 
AuthorDate: Wed Jun 12 09:11:47 2019 +0200
Commit: Miklos Vajna 
CommitDate: Wed Jun 12 13:53:39 2019 +0200

Comment correction

Writer does support collecting and restarting comments at end of section

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

diff --git a/writerfilter/source/rtftok/rtfdispatchflag.cxx 
b/writerfilter/source/rtftok/rtfdispatchflag.cxx
index d76dc4cb1d81..ce0eeec9d5d2 100644
--- a/writerfilter/source/rtftok/rtfdispatchflag.cxx
+++ b/writerfilter/source/rtftok/rtfdispatchflag.cxx
@@ -831,11 +831,11 @@ RTFError RTFDocumentImpl::dispatchFlag(RTFKeyword 
nKeyword)
 case RTF_AENDDOC:
 // Noop, this is the default in Writer.
 case RTF_AENDNOTES:
-// Noop, Writer does not support having endnotes at the end of 
section.
+// Noop
 case RTF_AFTNRSTCONT:
 // Noop, this is the default in Writer.
 case RTF_AFTNRESTART:
-// Noop, Writer does not support restarting endnotes at each 
section.
+// Noop
 case RTF_FTNBJ:
 // Noop, this is the default in Writer.
 break;
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

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

2019-07-04 Thread Mike Kaganski (via logerrit)
 shell/source/win32/spsupp/res/spsuppDlg.rc |4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

New commits:
commit 64376d29b4f02440544a1dc71118c2cf19b8df94
Author: Mike Kaganski 
AuthorDate: Thu Jul 4 19:46:35 2019 +1000
Commit: Mike Kaganski 
CommitDate: Thu Jul 4 15:18:30 2019 +0200

Center spsupp_helper dialog on screen; make it topmost

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

diff --git a/shell/source/win32/spsupp/res/spsuppDlg.rc 
b/shell/source/win32/spsupp/res/spsuppDlg.rc
index a27974661f30..f4ce83a157fc 100644
--- a/shell/source/win32/spsupp/res/spsuppDlg.rc
+++ b/shell/source/win32/spsupp/res/spsuppDlg.rc
@@ -17,9 +17,9 @@ LANGUAGE LANG_NEUTRAL, SUBLANG_DEFAULT
 // Dialog
 
 IDD_EDIT_OR_RO DIALOGEX 0, 0, 309, 87
-STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_CAPTION | 
WS_SYSMENU
+STYLE DS_MODALFRAME | DS_CENTER | WS_POPUP | WS_CAPTION | WS_SYSMENU
+EXSTYLE WS_EX_TOPMOST
 CAPTION "Open Document"
-FONT 8, "MS Shell Dlg", 400, 0, 0x1
 BEGIN
 ICONIDI_QUESTION,IDC_STATIC,7,7,21,20
 LTEXT   "Do you want to open the document to view or to 
edit?",IDC_EDIT_OR_RO,36,7,266,44
___
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/source

2019-07-04 Thread Mike Kaganski (via logerrit)
 shell/source/win32/spsupp/res/spsuppDlg.rc |4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

New commits:
commit 2edb7b1ddaa77229ce3655b91929eba3d95f90a7
Author: Mike Kaganski 
AuthorDate: Thu Jul 4 19:46:35 2019 +1000
Commit: Mike Kaganski 
CommitDate: Thu Jul 4 15:34:58 2019 +0200

Center spsupp_helper dialog on screen; make it topmost

Change-Id: I99cf333a24ddf99407b406e42930d58dc7b5fb96
Reviewed-on: https://gerrit.libreoffice.org/75076
Tested-by: Jenkins
Reviewed-by: Mike Kaganski 
(cherry picked from commit 64376d29b4f02440544a1dc71118c2cf19b8df94)
Reviewed-on: https://gerrit.libreoffice.org/75088
Tested-by: Mike Kaganski 

diff --git a/shell/source/win32/spsupp/res/spsuppDlg.rc 
b/shell/source/win32/spsupp/res/spsuppDlg.rc
index a27974661f30..f4ce83a157fc 100644
--- a/shell/source/win32/spsupp/res/spsuppDlg.rc
+++ b/shell/source/win32/spsupp/res/spsuppDlg.rc
@@ -17,9 +17,9 @@ LANGUAGE LANG_NEUTRAL, SUBLANG_DEFAULT
 // Dialog
 
 IDD_EDIT_OR_RO DIALOGEX 0, 0, 309, 87
-STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_CAPTION | 
WS_SYSMENU
+STYLE DS_MODALFRAME | DS_CENTER | WS_POPUP | WS_CAPTION | WS_SYSMENU
+EXSTYLE WS_EX_TOPMOST
 CAPTION "Open Document"
-FONT 8, "MS Shell Dlg", 400, 0, 0x1
 BEGIN
 ICONIDI_QUESTION,IDC_STATIC,7,7,21,20
 LTEXT   "Do you want to open the document to view or to 
edit?",IDC_EDIT_OR_RO,36,7,266,44
___
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-07-04 Thread Mike Kaganski (via logerrit)
 shell/source/win32/spsupp/res/spsuppDlg.rc |4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

New commits:
commit f7dd7546bb1e5f9e1d3f4c8fa24e6792279230e0
Author: Mike Kaganski 
AuthorDate: Thu Jul 4 15:38:33 2019 +0200
Commit: Mike Kaganski 
CommitDate: Fri Jul 5 00:12:11 2019 +0200

Center spsupp_helper dialog on screen; make it topmost

Change-Id: I99cf333a24ddf99407b406e42930d58dc7b5fb96
Reviewed-on: https://gerrit.libreoffice.org/75076
Tested-by: Jenkins
Reviewed-by: Mike Kaganski 
(cherry picked from commit 64376d29b4f02440544a1dc71118c2cf19b8df94)
Reviewed-on: https://gerrit.libreoffice.org/75088
Tested-by: Mike Kaganski 
Reviewed-on: https://gerrit.libreoffice.org/75090
Tested-by: Jenkins CollaboraOffice 

diff --git a/shell/source/win32/spsupp/res/spsuppDlg.rc 
b/shell/source/win32/spsupp/res/spsuppDlg.rc
index 6d144cc26789..5dd9b03abb3a 100644
--- a/shell/source/win32/spsupp/res/spsuppDlg.rc
+++ b/shell/source/win32/spsupp/res/spsuppDlg.rc
@@ -17,9 +17,9 @@ LANGUAGE LANG_NEUTRAL, SUBLANG_DEFAULT
 // Dialog
 
 IDD_EDIT_OR_RO DIALOGEX 0, 0, 309, 87
-STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_CAPTION | 
WS_SYSMENU
+STYLE DS_MODALFRAME | DS_CENTER | WS_POPUP | WS_CAPTION | WS_SYSMENU
+EXSTYLE WS_EX_TOPMOST
 CAPTION "Open Document"
-FONT 8, "MS Shell Dlg", 400, 0, 0x1
 BEGIN
 ICONIDI_QUESTION,IDC_STATIC,7,7,21,20
 LTEXT   "You are opening document\n\n  %DOCNAME\n\nDo you want to 
open it to view or to edit?",IDC_EDIT_OR_RO,36,7,266,44
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

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

2019-07-05 Thread Mike Kaganski (via logerrit)
 include/sfx2/docfile.hxx |3 +
 include/sfx2/strings.hrc |3 +
 sfx2/source/doc/docfile.cxx  |   74 ++-
 sfx2/source/view/viewfrm.cxx |   43 +---
 4 files changed, 86 insertions(+), 37 deletions(-)

New commits:
commit 0f9599b687c10f3887c8cc5f419278aa4375889a
Author: Mike Kaganski 
AuthorDate: Fri Jul 5 17:56:38 2019 +1000
Commit: Mike Kaganski 
CommitDate: Fri Jul 5 11:51:56 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 

diff --git a/include/sfx2/docfile.hxx b/include/sfx2/docfile.hxx
index 77950a473197..c5fc22c511bb 100644
--- a/include/sfx2/docfile.hxx
+++ b/include/sfx2/docfile.hxx
@@ -166,7 +166,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 98e547d2b515..96883a2384b0 100644
--- a/include/sfx2/strings.hrc
+++ b/include/sfx2/strings.hrc
@@ -238,7 +238,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 da295c476991..efb874b67f2a 100644
--- a/sfx2/source/doc/docfile.cxx
+++ b/sfx2/source/doc/docfile.cxx
@@ -1128,7 +1128,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;
@@ -1183,38 +1185,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
-LockFileEntry aLockData;
-aLockData[LockFileComponent::OOOUSERNAME] = 
"Unknown user";
-// This solution works right when the LO use

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

2019-07-07 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 |   43 +
 4 files changed, 86 insertions(+), 36 deletions(-)

New commits:
commit 7943a3b4b7ab5891e0be61bcfedd7c55a1ef8bf4
Author: Mike Kaganski 
AuthorDate: Fri Jul 5 17:56:38 2019 +1000
Commit: Mike Kaganski 
CommitDate: Mon Jul 8 04:47:48 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 

diff --git a/include/sfx2/docfile.hxx b/include/sfx2/docfile.hxx
index 2f7d9454c1e5..482c1e4ba3ce 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 a77dbc86d77d..373ca649fa48 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 bb153e5badb5..789f3b8b8dae 100644
--- a/sfx2/source/doc/docfile.cxx
+++ b/sfx2/source/doc/docfile.cxx
@@ -1117,7 +1117,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;
@@ -1168,37 +1170,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
-LockFileEntry aLockData;
-aLockData[LockFileComponent::OOOUSERNAME] = 
"Unk

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

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

New commits:
commit 351b730e012fd4562f341967f740f8146aa0538e
Author: Mike Kaganski 
AuthorDate: Mon Jul 8 16:25:16 2019 +1000
Commit: Mike Kaganski 
CommitDate: Mon Jul 8 14:01:26 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)
ucpdav1.dll

[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: 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: 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(&CurTime);
+
pGetSystemTimePreciseAsFileTime(reinterpret_cast(&CurTime));
 else
 {
+SYSTEMTIME SystemTime;
 GetSystemTime(&SystemTime);
-SystemTimeToFileTime(&SystemTime, &CurTime);
+SystemTimeToFileTime(&SystemTime, 
reinterpret_cast(&CurTime));
 }
 
-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(&SystemTime, &OffTime);
+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(&SystemTime, reinterpret_cast(&ft));
+return ft;
+}();
 
-Value = *reinterpret_cast<__int64 *>(&CurTime) - *reinterpret_cast<__int64 
*>(&OffTime);
+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: 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: 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: Branch 'distro/collabora/cp-6.0' - include/sfx2 sfx2/source

2019-07-08 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
-LockFileEn

[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(&rRenderContext);
 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(

[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: 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: sw/qa

2019-07-09 Thread Mike Kaganski (via logerrit)
 sw/qa/extras/ooxmlexport/ooxmlexport3.cxx |   38 ++
 1 file changed, 29 insertions(+), 9 deletions(-)

New commits:
commit 691e9427117f909273f648d167465802580ec770
Author: Mike Kaganski 
AuthorDate: Tue Jul 9 23:08:23 2019 +1000
Commit: Mike Kaganski 
CommitDate: Wed Jul 10 01:04:21 2019 +0200

Fix CppunitTest_sw_ooxmlexport3 on systems with DPI scaling

... after commit 3f7e8ddea89f6340cd18b5b34f5a7c5f503962be

The tests are DPI-dependent, and failed on systems with DPI other
than 96, so take that into account.

Change-Id: I0297aab7988c3b78cbd3132f21e5a101bc32c1f6
Reviewed-on: https://gerrit.libreoffice.org/75302
Tested-by: Jenkins
Reviewed-by: Jan-Marek Glogowski 
Reviewed-by: Mike Kaganski 

diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport3.cxx 
b/sw/qa/extras/ooxmlexport/ooxmlexport3.cxx
index bddb9323ac2f..405cba6c78a4 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport3.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport3.cxx
@@ -573,9 +573,15 @@ DECLARE_OOXMLEXPORT_TEST(testTdf106974_int32Crop, 
"tdf106974_int32Crop.docx")
 
 imageProperties->getPropertyValue( "GraphicCrop" ) >>= aGraphicCropStruct;
 
+// The crop is constructed in GraphicProperties::pushToPropMap, where
+// GraphicHelper::getOriginalSize tries to get graphic size in mm, then 
falls back to pixels,
+// which are then converted to mm taking screen DPI scaling into account. 
Thus, the resulting
+// values are DPI-dependent.
+const double fXScaleFactor = 96.0 / 
Application::GetDefaultDevice()->GetDPIX();
+
 CPPUNIT_ASSERT_MESSAGE(
 OString::number(aGraphicCropStruct.Right).getStr(),
-sal_Int32( 40470 ) < aGraphicCropStruct.Right );
+40470 * fXScaleFactor < aGraphicCropStruct.Right);
 }
 
 DECLARE_OOXMLEXPORT_TEST(testLineSpacingexport, "test_line_spacing.docx")
@@ -701,10 +707,17 @@ DECLARE_OOXMLEXPORT_TEST(testGIFImageCrop, 
"test_GIF_ImageCrop.docx")
 
 imageProperties->getPropertyValue( "GraphicCrop" ) >>= aGraphicCropStruct;
 
-CPPUNIT_ASSERT_EQUAL( sal_Int32( 1085 ), aGraphicCropStruct.Left );
-CPPUNIT_ASSERT_EQUAL( sal_Int32( 3651 ), aGraphicCropStruct.Right );
-CPPUNIT_ASSERT_EQUAL( sal_Int32( 953 ), aGraphicCropStruct.Top );
-CPPUNIT_ASSERT_EQUAL( sal_Int32( 1244 ), aGraphicCropStruct.Bottom );
+// The crop is constructed in GraphicProperties::pushToPropMap, where
+// GraphicHelper::getOriginalSize tries to get graphic size in mm, then 
falls back to pixels,
+// which are then converted to mm taking screen DPI scaling into account. 
Thus, the resulting
+// values are DPI-dependent.
+const double fXScaleFactor = 96.0 / 
Application::GetDefaultDevice()->GetDPIX();
+const double fYScaleFactor = 96.0 / 
Application::GetDefaultDevice()->GetDPIY();
+
+CPPUNIT_ASSERT_DOUBLES_EQUAL(1085 * fXScaleFactor, 
aGraphicCropStruct.Left, 1);
+CPPUNIT_ASSERT_DOUBLES_EQUAL(3651 * fXScaleFactor, 
aGraphicCropStruct.Right, 1);
+CPPUNIT_ASSERT_DOUBLES_EQUAL(953 * fYScaleFactor, aGraphicCropStruct.Top, 
1);
+CPPUNIT_ASSERT_DOUBLES_EQUAL(1244 * fYScaleFactor, 
aGraphicCropStruct.Bottom, 1);
 }
 
 DECLARE_OOXMLEXPORT_TEST(testPNGImageCrop, "test_PNG_ImageCrop.docx")
@@ -719,10 +732,17 @@ DECLARE_OOXMLEXPORT_TEST(testPNGImageCrop, 
"test_PNG_ImageCrop.docx")
 
 imageProperties->getPropertyValue( "GraphicCrop" ) >>= aGraphicCropStruct;
 
-CPPUNIT_ASSERT_EQUAL( sal_Int32( 1058 ), aGraphicCropStruct.Left );
-CPPUNIT_ASSERT_EQUAL( sal_Int32(  ), aGraphicCropStruct.Right );
-CPPUNIT_ASSERT_EQUAL( sal_Int32( 1164 ), aGraphicCropStruct.Top );
-CPPUNIT_ASSERT_EQUAL( sal_Int32( 635 ), aGraphicCropStruct.Bottom );
+// The crop is constructed in GraphicProperties::pushToPropMap, where
+// GraphicHelper::getOriginalSize tries to get graphic size in mm, then 
falls back to pixels,
+// which are then converted to mm taking screen DPI scaling into account. 
Thus, the resulting
+// values are DPI-dependent.
+const double fXScaleFactor = 96.0 / 
Application::GetDefaultDevice()->GetDPIX();
+const double fYScaleFactor = 96.0 / 
Application::GetDefaultDevice()->GetDPIY();
+
+CPPUNIT_ASSERT_DOUBLES_EQUAL(1058 * fXScaleFactor, 
aGraphicCropStruct.Left, 1);
+CPPUNIT_ASSERT_DOUBLES_EQUAL( * fXScaleFactor, 
aGraphicCropStruct.Right, 1);
+CPPUNIT_ASSERT_DOUBLES_EQUAL(1164 * fYScaleFactor, aGraphicCropStruct.Top, 
1);
+CPPUNIT_ASSERT_DOUBLES_EQUAL(635 * fYScaleFactor, 
aGraphicCropStruct.Bottom, 1);
 }
 
 DECLARE_OOXMLEXPORT_TEST(testTdf41542_imagePadding, 
"tdf41542_imagePadding.odt")
___
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-09 Thread Mike Kaganski (via logerrit)
 sc/source/ui/docshell/externalrefmgr.cxx |   23 ---
 1 file changed, 16 insertions(+), 7 deletions(-)

New commits:
commit 03c708bf085f91480c014d7fa31e7a317b2c7b8f
Author: Mike Kaganski 
AuthorDate: Tue Jul 9 18:44:42 2019 +1000
Commit: Mike Kaganski 
CommitDate: Wed Jul 10 06:08:43 2019 +0200

Postpone filter detection until link update is allowed

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

diff --git a/sc/source/ui/docshell/externalrefmgr.cxx 
b/sc/source/ui/docshell/externalrefmgr.cxx
index 8e995ebf0c40..d7010ca66463 100644
--- a/sc/source/ui/docshell/externalrefmgr.cxx
+++ b/sc/source/ui/docshell/externalrefmgr.cxx
@@ -2115,6 +2115,15 @@ void insertRefCellByIterator(
 }
 }
 
+bool IsLinkUpdateAllowedInDoc(const ScDocument& rDoc)
+{
+SfxObjectShell* pDocShell = rDoc.GetDocumentShell();
+if (!pDocShell)
+return false;
+
+return pDocShell->GetEmbeddedObjectContainer().getUserAllowsLinkUpdate();
+}
+
 }
 
 void ScExternalRefManager::insertRefCell(sal_uInt16 nFileId, const ScAddress& 
rCell)
@@ -2322,13 +2331,8 @@ ScDocument* 
ScExternalRefManager::getInMemorySrcDocument(sal_uInt16 nFileId)
 return nullptr;
 
 // Do not load document until it was allowed
-SfxObjectShell* pDocShell = mpDoc->GetDocumentShell();
-if ( pDocShell )
-{
-const comphelper::EmbeddedObjectContainer& rContainer = 
pDocShell->GetEmbeddedObjectContainer();
-if ( !rContainer.getUserAllowsLinkUpdate() )
-return nullptr;
-}
+if (!IsLinkUpdateAllowedInDoc(*mpDoc))
+return nullptr;
 
 ScDocument* pSrcDoc = nullptr;
 ScDocShell* pShell = 
static_cast(SfxObjectShell::GetFirst(checkSfxObjectShell,
 false));
@@ -2573,6 +2577,11 @@ void ScExternalRefManager::maybeLinkExternalFile( 
sal_uInt16 nFileId, bool bDefe
 aFilter = pFileData->maFilterName;
 aOptions = pFileData->maFilterOptions;
 }
+
+// Filter detection may access external links; defer it until we are 
allowed
+if (!bDeferFilterDetection)
+bDeferFilterDetection = !IsLinkUpdateAllowedInDoc(*mpDoc);
+
 // If a filter was already set (for example, loading the cached table),
 // don't call GetFilterName which has to access the source file.
 // If filter detection is deferred, the next successful loadSrcDocument()
___
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/source

2019-07-10 Thread Mike Kaganski (via logerrit)
 sc/source/ui/docshell/externalrefmgr.cxx |   23 ---
 1 file changed, 16 insertions(+), 7 deletions(-)

New commits:
commit df0f41ab7f3750775a18a070155bd328352e0b84
Author: Mike Kaganski 
AuthorDate: Tue Jul 9 18:44:42 2019 +1000
Commit: Mike Kaganski 
CommitDate: Wed Jul 10 11:58:33 2019 +0200

Postpone filter detection until link update is allowed

Change-Id: I85b2185e550f2a133ceb485241ef513b40593e34
Reviewed-on: https://gerrit.libreoffice.org/75301
Tested-by: Jenkins
Reviewed-by: Mike Kaganski 
(cherry picked from commit 03c708bf085f91480c014d7fa31e7a317b2c7b8f)
Reviewed-on: https://gerrit.libreoffice.org/75333
Tested-by: Jenkins CollaboraOffice 

diff --git a/sc/source/ui/docshell/externalrefmgr.cxx 
b/sc/source/ui/docshell/externalrefmgr.cxx
index d1b6e8994813..4243973a5b08 100644
--- a/sc/source/ui/docshell/externalrefmgr.cxx
+++ b/sc/source/ui/docshell/externalrefmgr.cxx
@@ -2158,6 +2158,15 @@ void insertRefCellByIterator(
 }
 }
 
+bool IsLinkUpdateAllowedInDoc(const ScDocument& rDoc)
+{
+SfxObjectShell* pDocShell = rDoc.GetDocumentShell();
+if (!pDocShell)
+return false;
+
+return pDocShell->GetEmbeddedObjectContainer().getUserAllowsLinkUpdate();
+}
+
 }
 
 void ScExternalRefManager::insertRefCell(sal_uInt16 nFileId, const ScAddress& 
rCell)
@@ -2369,13 +2378,8 @@ ScDocument* 
ScExternalRefManager::getInMemorySrcDocument(sal_uInt16 nFileId)
 return nullptr;
 
 // Do not load document until it was allowed
-SfxObjectShell* pDocShell = mpDoc->GetDocumentShell();
-if ( pDocShell )
-{
-const comphelper::EmbeddedObjectContainer& rContainer = 
pDocShell->GetEmbeddedObjectContainer();
-if ( !rContainer.getUserAllowsLinkUpdate() )
-return nullptr;
-}
+if (!IsLinkUpdateAllowedInDoc(*mpDoc))
+return nullptr;
 
 ScDocument* pSrcDoc = nullptr;
 ScDocShell* pShell = 
static_cast(SfxObjectShell::GetFirst(checkSfxObjectShell,
 false));
@@ -2620,6 +2624,11 @@ void ScExternalRefManager::maybeLinkExternalFile( 
sal_uInt16 nFileId, bool bDefe
 aFilter = pFileData->maFilterName;
 aOptions = pFileData->maFilterOptions;
 }
+
+// Filter detection may access external links; defer it until we are 
allowed
+if (!bDeferFilterDetection)
+bDeferFilterDetection = !IsLinkUpdateAllowedInDoc(*mpDoc);
+
 // If a filter was already set (for example, loading the cached table),
 // don't call GetFilterName which has to access the source file.
 // If filter detection is deferred, the next successful loadSrcDocument()
___
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

2019-07-10 Thread Mike Kaganski (via logerrit)
 sc/source/ui/docshell/externalrefmgr.cxx |   23 ---
 1 file changed, 16 insertions(+), 7 deletions(-)

New commits:
commit ee1520bd4caf13200efa5456583ac8b4dc2e1640
Author: Mike Kaganski 
AuthorDate: Tue Jul 9 18:44:42 2019 +1000
Commit: Mike Kaganski 
CommitDate: Wed Jul 10 13:20:16 2019 +0200

Postpone filter detection until link update is allowed

Change-Id: I85b2185e550f2a133ceb485241ef513b40593e34
Reviewed-on: https://gerrit.libreoffice.org/75301
Tested-by: Jenkins
Reviewed-by: Mike Kaganski 
(cherry picked from commit 03c708bf085f91480c014d7fa31e7a317b2c7b8f)
Reviewed-on: https://gerrit.libreoffice.org/75332
Tested-by: Jenkins CollaboraOffice 

diff --git a/sc/source/ui/docshell/externalrefmgr.cxx 
b/sc/source/ui/docshell/externalrefmgr.cxx
index c7086d6b70d1..e0d0e1dce1ae 100644
--- a/sc/source/ui/docshell/externalrefmgr.cxx
+++ b/sc/source/ui/docshell/externalrefmgr.cxx
@@ -2159,6 +2159,15 @@ void insertRefCellByIterator(
 }
 }
 
+bool IsLinkUpdateAllowedInDoc(const ScDocument& rDoc)
+{
+SfxObjectShell* pDocShell = rDoc.GetDocumentShell();
+if (!pDocShell)
+return false;
+
+return pDocShell->GetEmbeddedObjectContainer().getUserAllowsLinkUpdate();
+}
+
 }
 
 void ScExternalRefManager::insertRefCell(sal_uInt16 nFileId, const ScAddress& 
rCell)
@@ -2370,13 +2379,8 @@ ScDocument* 
ScExternalRefManager::getInMemorySrcDocument(sal_uInt16 nFileId)
 return nullptr;
 
 // Do not load document until it was allowed
-SfxObjectShell* pDocShell = mpDoc->GetDocumentShell();
-if ( pDocShell )
-{
-const comphelper::EmbeddedObjectContainer& rContainer = 
pDocShell->GetEmbeddedObjectContainer();
-if ( !rContainer.getUserAllowsLinkUpdate() )
-return nullptr;
-}
+if (!IsLinkUpdateAllowedInDoc(*mpDoc))
+return nullptr;
 
 ScDocument* pSrcDoc = nullptr;
 ScDocShell* pShell = 
static_cast(SfxObjectShell::GetFirst(checkSfxObjectShell,
 false));
@@ -2621,6 +2625,11 @@ void ScExternalRefManager::maybeLinkExternalFile( 
sal_uInt16 nFileId, bool bDefe
 aFilter = pFileData->maFilterName;
 aOptions = pFileData->maFilterOptions;
 }
+
+// Filter detection may access external links; defer it until we are 
allowed
+if (!bDeferFilterDetection)
+bDeferFilterDetection = !IsLinkUpdateAllowedInDoc(*mpDoc);
+
 // If a filter was already set (for example, loading the cached table),
 // don't call GetFilterName which has to access the source file.
 // If filter detection is deferred, the next successful loadSrcDocument()
___
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-10 Thread Mike Kaganski (via logerrit)
 configure.ac |   17 +++--
 1 file changed, 3 insertions(+), 14 deletions(-)

New commits:
commit a53f65b4a8240a6277f6eb00daf01b81e2514da8
Author: Mike Kaganski 
AuthorDate: Wed Jul 10 14:20:18 2019 +1000
Commit: Mike Kaganski 
CommitDate: Wed Jul 10 14:00:03 2019 +0200

We don't support building with Windows SDK 7.1A

... it's already impossible with 6.2; and was only needed prior to
6.0, where Windows XP support was needed.

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

diff --git a/configure.ac b/configure.ac
index 5b33d879c2d9..1a4725a2 100644
--- a/configure.ac
+++ b/configure.ac
@@ -2066,7 +2066,7 @@ AC_ARG_WITH(visual-studio,
 ,)
 
 AC_ARG_WITH(windows-sdk,
-AS_HELP_STRING([--with-windows-sdk=<7.1(A)/8.0(A)/8.1(A)/10>],
+AS_HELP_STRING([--with-windows-sdk=<8.0(A)/8.1(A)/10>],
 [Specify which Windows SDK, or "Windows Kit", version to use
  in case the one that came with the selected Visual Studio
  is not what you want for some reason. Note that not all compiler/SDK
@@ -3573,7 +3573,7 @@ if test "$_os" = "WINNT"; then
 
 case "$vcnum" in
 150|160)
-WINDOWS_SDK_ACCEPTABLE_VERSIONS="10.0 8.1A 8.1 8.0 7.1A"
+WINDOWS_SDK_ACCEPTABLE_VERSIONS="10.0 8.1A 8.1 8.0"
 ;;
 esac
 
@@ -5483,20 +5483,12 @@ find_dotnetsdk46()
 
 find_winsdk_version()
 {
-# Args: $1 : SDK version as in "6.0A", "7.0" etc
+# Args: $1 : SDK version as in "8.0", "8.1A" etc
 # Return values: $winsdktest, $winsdkbinsubdir, $winsdklibsubdir
 
 unset winsdktest winsdkbinsubdir winsdklibsubdir
 
 case "$1" in
-7.*)
-reg_get_value_32 "HKEY_LOCAL_MACHINE/SOFTWARE/Microsoft/Microsoft 
SDKs/Windows/v${1}/InstallationFolder"
-if test -n "$regvalue"; then
-winsdktest=$regvalue
-winsdklibsubdir=.
-return
-fi
-;;
 8.0|8.0A)
 reg_get_value_32 "HKEY_LOCAL_MACHINE/SOFTWARE/Microsoft/Windows 
Kits/Installed Roots/KitsRoot"
 if test -n "$regvalue"; then
@@ -5715,9 +5707,6 @@ the  Windows SDK are installed.])
 
 if test -z "$WINDOWS_SDK_HOME"; then
 AC_MSG_RESULT([no, hoping the necessary headers and libraries will be 
found anyway!?])
-elif echo $WINDOWS_SDK_HOME | grep "v7.1" >/dev/null 2>/dev/null; then
-WINDOWS_SDK_VERSION=70
-AC_MSG_RESULT([found Windows SDK 7 ($WINDOWS_SDK_HOME)])
 elif echo $WINDOWS_SDK_HOME | grep "8.0" >/dev/null 2>/dev/null; then
 WINDOWS_SDK_VERSION=80
 AC_MSG_RESULT([found Windows SDK 8.0 ($WINDOWS_SDK_HOME)])
___
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' - sc/source

2019-07-10 Thread Mike Kaganski (via logerrit)
 sc/source/ui/docshell/externalrefmgr.cxx |   23 ---
 1 file changed, 16 insertions(+), 7 deletions(-)

New commits:
commit 73bedffa28de5597a4882bed514ecaf0b416bfde
Author: Mike Kaganski 
AuthorDate: Tue Jul 9 18:44:42 2019 +1000
Commit: Eike Rathke 
CommitDate: Wed Jul 10 15:05:03 2019 +0200

Postpone filter detection until link update is allowed

Change-Id: I85b2185e550f2a133ceb485241ef513b40593e34
Reviewed-on: https://gerrit.libreoffice.org/75301
Tested-by: Jenkins
Reviewed-by: Mike Kaganski 
(cherry picked from commit 03c708bf085f91480c014d7fa31e7a317b2c7b8f)
Reviewed-on: https://gerrit.libreoffice.org/75331
Reviewed-by: Eike Rathke 

diff --git a/sc/source/ui/docshell/externalrefmgr.cxx 
b/sc/source/ui/docshell/externalrefmgr.cxx
index c7086d6b70d1..e0d0e1dce1ae 100644
--- a/sc/source/ui/docshell/externalrefmgr.cxx
+++ b/sc/source/ui/docshell/externalrefmgr.cxx
@@ -2159,6 +2159,15 @@ void insertRefCellByIterator(
 }
 }
 
+bool IsLinkUpdateAllowedInDoc(const ScDocument& rDoc)
+{
+SfxObjectShell* pDocShell = rDoc.GetDocumentShell();
+if (!pDocShell)
+return false;
+
+return pDocShell->GetEmbeddedObjectContainer().getUserAllowsLinkUpdate();
+}
+
 }
 
 void ScExternalRefManager::insertRefCell(sal_uInt16 nFileId, const ScAddress& 
rCell)
@@ -2370,13 +2379,8 @@ ScDocument* 
ScExternalRefManager::getInMemorySrcDocument(sal_uInt16 nFileId)
 return nullptr;
 
 // Do not load document until it was allowed
-SfxObjectShell* pDocShell = mpDoc->GetDocumentShell();
-if ( pDocShell )
-{
-const comphelper::EmbeddedObjectContainer& rContainer = 
pDocShell->GetEmbeddedObjectContainer();
-if ( !rContainer.getUserAllowsLinkUpdate() )
-return nullptr;
-}
+if (!IsLinkUpdateAllowedInDoc(*mpDoc))
+return nullptr;
 
 ScDocument* pSrcDoc = nullptr;
 ScDocShell* pShell = 
static_cast(SfxObjectShell::GetFirst(checkSfxObjectShell,
 false));
@@ -2621,6 +2625,11 @@ void ScExternalRefManager::maybeLinkExternalFile( 
sal_uInt16 nFileId, bool bDefe
 aFilter = pFileData->maFilterName;
 aOptions = pFileData->maFilterOptions;
 }
+
+// Filter detection may access external links; defer it until we are 
allowed
+if (!bDeferFilterDetection)
+bDeferFilterDetection = !IsLinkUpdateAllowedInDoc(*mpDoc);
+
 // If a filter was already set (for example, loading the cached table),
 // don't call GetFilterName which has to access the source file.
 // If filter detection is deferred, the next successful loadSrcDocument()
___
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-07-10 Thread Mike Kaganski (via logerrit)
 sc/source/ui/docshell/externalrefmgr.cxx |   23 ---
 1 file changed, 16 insertions(+), 7 deletions(-)

New commits:
commit 97585591eea9fa7af20c051d2ffb95240ce3d8c6
Author: Mike Kaganski 
AuthorDate: Tue Jul 9 18:44:42 2019 +1000
Commit: Eike Rathke 
CommitDate: Wed Jul 10 15:05:18 2019 +0200

Postpone filter detection until link update is allowed

Change-Id: I85b2185e550f2a133ceb485241ef513b40593e34
Reviewed-on: https://gerrit.libreoffice.org/75301
Tested-by: Jenkins
Reviewed-by: Mike Kaganski 
(cherry picked from commit 03c708bf085f91480c014d7fa31e7a317b2c7b8f)
Reviewed-on: https://gerrit.libreoffice.org/75330
Reviewed-by: Eike Rathke 

diff --git a/sc/source/ui/docshell/externalrefmgr.cxx 
b/sc/source/ui/docshell/externalrefmgr.cxx
index 36b4aac3fc79..f53c93c3cf22 100644
--- a/sc/source/ui/docshell/externalrefmgr.cxx
+++ b/sc/source/ui/docshell/externalrefmgr.cxx
@@ -2115,6 +2115,15 @@ void insertRefCellByIterator(
 }
 }
 
+bool IsLinkUpdateAllowedInDoc(const ScDocument& rDoc)
+{
+SfxObjectShell* pDocShell = rDoc.GetDocumentShell();
+if (!pDocShell)
+return false;
+
+return pDocShell->GetEmbeddedObjectContainer().getUserAllowsLinkUpdate();
+}
+
 }
 
 void ScExternalRefManager::insertRefCell(sal_uInt16 nFileId, const ScAddress& 
rCell)
@@ -2322,13 +2331,8 @@ ScDocument* 
ScExternalRefManager::getInMemorySrcDocument(sal_uInt16 nFileId)
 return nullptr;
 
 // Do not load document until it was allowed
-SfxObjectShell* pDocShell = mpDoc->GetDocumentShell();
-if ( pDocShell )
-{
-const comphelper::EmbeddedObjectContainer& rContainer = 
pDocShell->GetEmbeddedObjectContainer();
-if ( !rContainer.getUserAllowsLinkUpdate() )
-return nullptr;
-}
+if (!IsLinkUpdateAllowedInDoc(*mpDoc))
+return nullptr;
 
 ScDocument* pSrcDoc = nullptr;
 ScDocShell* pShell = 
static_cast(SfxObjectShell::GetFirst(checkSfxObjectShell,
 false));
@@ -2573,6 +2577,11 @@ void ScExternalRefManager::maybeLinkExternalFile( 
sal_uInt16 nFileId, bool bDefe
 aFilter = pFileData->maFilterName;
 aOptions = pFileData->maFilterOptions;
 }
+
+// Filter detection may access external links; defer it until we are 
allowed
+if (!bDeferFilterDetection)
+bDeferFilterDetection = !IsLinkUpdateAllowedInDoc(*mpDoc);
+
 // If a filter was already set (for example, loading the cached table),
 // don't call GetFilterName which has to access the source file.
 // If filter detection is deferred, the next successful loadSrcDocument()
___
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-10 Thread Mike Kaganski (via logerrit)
 sw/qa/extras/layout/layout.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 5583ee37101a748d901fae1da315aeb453278ecd
Author: Mike Kaganski 
AuthorDate: Wed Jul 10 14:28:13 2019 +1000
Commit: Mike Kaganski 
CommitDate: Wed Jul 10 15:15:11 2019 +0200

Disable (again) part of testBtlrCell on Windows

This test fails on my system; the actual values likely depend on DPI
scaling, but even with scale set to 100%, it fails. This is strange,
considering that the test passes on Windows buildbots.

After commit 3f7e8ddea89f6340cd18b5b34f5a7c5f503962be

Change-Id: Ia8c2e695ed918c3145dcd472e1da52398c1a8f52
Reviewed-on: https://gerrit.libreoffice.org/75335
Reviewed-by: Jan-Marek Glogowski 
Reviewed-by: Mike Kaganski 
Tested-by: Mike Kaganski 

diff --git a/sw/qa/extras/layout/layout.cxx b/sw/qa/extras/layout/layout.cxx
index b1e11c05e754..d13cda44b1b9 100644
--- a/sw/qa/extras/layout/layout.cxx
+++ b/sw/qa/extras/layout/layout.cxx
@@ -2865,7 +2865,7 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testBtlrCell)
 // doc model).
 assertXPath(pXmlDoc, "//font[1]", "orientation", "900");
 
-#ifndef MACOSX // macOS fails with x == 2662 for some reason.
+#if !defined(MACOSX) && !defined(_WIN32) // macOS fails with x == 2662 for 
some reason.
 // Without the accompanying fix in place, this test would have failed with 
'Expected: 1915;
 // Actual  : 1756', i.e. the AAA1 text was too close to the left cell 
border due to an ascent vs
 // descent mismatch when calculating the baseline offset of the text 
portion.
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

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

2019-07-10 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_cast((m_value >> 13) & 
0x01fff),en}, class: {static_cast((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)
ucpdav1.dl

[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: 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: 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: 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: 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: 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.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' - 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)
ucpdav1.dl

[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/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.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: sc/qa sc/source

2019-07-17 Thread Mike Kaganski (via logerrit)
 sc/qa/unit/copy_paste_test.cxx |   74 +
 sc/source/core/data/table2.cxx |7 ++-
 2 files changed, 79 insertions(+), 2 deletions(-)

New commits:
commit 2d4ccc58e9ef3b98a88407e1a7a3abf3379f0d20
Author: Mike Kaganski 
AuthorDate: Wed Jul 17 12:15:28 2019 +1000
Commit: Mike Kaganski 
CommitDate: Wed Jul 17 09:53:50 2019 +0200

tdf#126421: don't limit pasted data to allocated columns in destination

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

diff --git a/sc/qa/unit/copy_paste_test.cxx b/sc/qa/unit/copy_paste_test.cxx
index 8a65609b51b1..6d4e0fb3f6bf 100644
--- a/sc/qa/unit/copy_paste_test.cxx
+++ b/sc/qa/unit/copy_paste_test.cxx
@@ -33,11 +33,13 @@ public:
 void testCopyPasteXLS();
 void testTdf84411();
 void testTdf124565();
+void testTdf126421();
 
 CPPUNIT_TEST_SUITE(ScCopyPasteTest);
 CPPUNIT_TEST(testCopyPasteXLS);
 CPPUNIT_TEST(testTdf84411);
 CPPUNIT_TEST(testTdf124565);
+CPPUNIT_TEST(testTdf126421);
 CPPUNIT_TEST_SUITE_END();
 
 private:
@@ -126,6 +128,14 @@ void ScCopyPasteTest::testCopyPasteXLS()
 
 namespace {
 
+ScMarkData::MarkedTabsType TabsInRange(const ScRange& r)
+{
+ScMarkData::MarkedTabsType aResult;
+for (SCTAB i = r.aStart.Tab(); i <= r.aEnd.Tab(); ++i)
+aResult.insert(i);
+return aResult;
+}
+
 void lcl_copy( const OUString& rSrcRange, const OUString& rDstRange, 
ScDocument& rDoc, ScTabViewShell* pViewShell )
 {
 ScDocument aClipDoc(SCDOCMODE_CLIP);
@@ -135,6 +145,7 @@ void lcl_copy( const OUString& rSrcRange, const OUString& 
rDstRange, ScDocument&
 ScRefFlags nRes = aSrcRange.Parse(rSrcRange, &rDoc, 
rDoc.GetAddressConvention());
 CPPUNIT_ASSERT_MESSAGE("Failed to parse.", (nRes & ScRefFlags::VALID));
 pViewShell->GetViewData().GetMarkData().SetMarkArea(aSrcRange);
+
pViewShell->GetViewData().GetMarkData().SetSelectedTabs(TabsInRange(aSrcRange));
 pViewShell->GetViewData().GetView()->CopyToClip(&aClipDoc, false, false, 
false, false);
 
 // 2. Paste
@@ -142,6 +153,7 @@ void lcl_copy( const OUString& rSrcRange, const OUString& 
rDstRange, ScDocument&
 nRes = aDstRange.Parse(rDstRange, &rDoc, rDoc.GetAddressConvention());
 CPPUNIT_ASSERT_MESSAGE("Failed to parse.", (nRes & ScRefFlags::VALID));
 pViewShell->GetViewData().GetMarkData().SetMarkArea(aDstRange);
+
pViewShell->GetViewData().GetMarkData().SetSelectedTabs(TabsInRange(aDstRange));
 pViewShell->GetViewData().GetView()->PasteFromClip(InsertDeleteFlags::ALL, 
&aClipDoc);
 }
 
@@ -289,6 +301,68 @@ void ScCopyPasteTest::testTdf124565()
 xDocSh->DoClose();
 }
 
+void ScCopyPasteTest::testTdf126421()
+{
+uno::Reference xDesktop
+= frame::Desktop::create(::comphelper::getProcessComponentContext());
+CPPUNIT_ASSERT(xDesktop.is());
+
+// create a frame
+Reference xTargetFrame = xDesktop->findFrame("_blank", 0);
+CPPUNIT_ASSERT(xTargetFrame.is());
+
+// 1. Create spreadsheet
+uno::Sequence aEmptyArgList;
+uno::Reference xComponent
+= xDesktop->loadComponentFromURL("private:factory/scalc", "_blank", 0, 
aEmptyArgList);
+CPPUNIT_ASSERT(xComponent.is());
+
+// Get the document model
+SfxObjectShell* pFoundShell = 
SfxObjectShell::GetShellFromComponent(xComponent);
+CPPUNIT_ASSERT_MESSAGE("Failed to access document shell", pFoundShell);
+
+ScDocShellRef xDocSh = dynamic_cast(pFoundShell);
+CPPUNIT_ASSERT(xDocSh);
+
+uno::Reference xModel2(xDocSh->GetModel(), UNO_QUERY);
+CPPUNIT_ASSERT(xModel2.is());
+
+Reference 
xController(xModel2->createDefaultViewController(xTargetFrame),
+   UNO_QUERY);
+CPPUNIT_ASSERT(xController.is());
+
+// introduce model/view/controller to each other
+xController->attachModel(xModel2.get());
+xModel2->connectController(xController.get());
+xTargetFrame->setComponent(xController->getComponentWindow(), 
xController.get());
+xController->attachFrame(xTargetFrame);
+xModel2->setCurrentController(xController.get());
+
+ScDocument& rDoc = xDocSh->GetDocument();
+
+// Get the document controller
+ScTabViewShell* pViewShell = xDocSh->GetBestViewShell(false);
+CPPUNIT_ASSERT(pViewShell != nullptr);
+
+// 2. Setup data
+for (int r = 0; r < 2; ++r)
+for (int c = 0; c < 1024; ++c)
+rDoc.SetValue(c, r, 0, (c + 1) * 100 + (r + 1));
+
+const SCTAB n2ndTab = rDoc.GetMaxTableNumber() + 1;
+rDoc.MakeTable(n2ndTab);
+const auto aTabNames = rDoc.GetAllTableNames();
+
+lcl_copy(aTabNames[0] + ".A1:AMJ2", aTabNames[n2ndTab] + ".A1:AMJ2", rDoc, 
pViewShell);
+
+// 3. Check all cells in destination table
+for (int r = 0; r < 2; ++r)
+for (int c = 0; c < 1024; ++c)
+CPPUNIT_ASSERT_EQUAL(double((c + 1) * 100 + (r 

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

2019-07-17 Thread Mike Kaganski (via logerrit)
 sc/source/ui/app/inputhdl.cxx |6 --
 1 file changed, 4 insertions(+), 2 deletions(-)

New commits:
commit f74f7899fa2c8956fcd3a213d75fd7c84bd99bb7
Author: Mike Kaganski 
AuthorDate: Thu Jul 18 11:03:44 2019 +1000
Commit: Mike Kaganski 
CommitDate: Thu Jul 18 04:38:28 2019 +0200

tdf#126453: hide ScInputHandler's tooltips when loosing focus

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

diff --git a/sc/source/ui/app/inputhdl.cxx b/sc/source/ui/app/inputhdl.cxx
index eb8142a913cf..e9c1270272c2 100644
--- a/sc/source/ui/app/inputhdl.cxx
+++ b/sc/source/ui/app/inputhdl.cxx
@@ -829,13 +829,15 @@ void ScInputHandler::GetFormulaData()
 
 IMPL_LINK( ScInputHandler, ShowHideTipVisibleParentListener, VclWindowEvent&, 
rEvent, void )
 {
-if( rEvent.GetId() == VclEventId::ObjectDying || rEvent.GetId() == 
VclEventId::WindowHide )
+if (rEvent.GetId() == VclEventId::ObjectDying || rEvent.GetId() == 
VclEventId::WindowHide
+|| rEvent.GetId() == VclEventId::WindowLoseFocus)
 HideTip();
 }
 
 IMPL_LINK( ScInputHandler, ShowHideTipVisibleSecParentListener, 
VclWindowEvent&, rEvent, void )
 {
-if( rEvent.GetId() == VclEventId::ObjectDying || rEvent.GetId() == 
VclEventId::WindowHide )
+if (rEvent.GetId() == VclEventId::ObjectDying || rEvent.GetId() == 
VclEventId::WindowHide
+|| rEvent.GetId() == VclEventId::WindowLoseFocus)
 HideTipBelow();
 }
 
___
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/qa sc/source

2019-07-18 Thread Mike Kaganski (via logerrit)
 sc/qa/unit/copy_paste_test.cxx |   74 +
 sc/source/core/data/table2.cxx |7 ++-
 2 files changed, 79 insertions(+), 2 deletions(-)

New commits:
commit 7e803a348a020bc48a039c4f7f098ae17843c534
Author: Mike Kaganski 
AuthorDate: Wed Jul 17 12:15:28 2019 +1000
Commit: Christian Lohmaier 
CommitDate: Thu Jul 18 22:16:14 2019 +0200

tdf#126421: don't limit pasted data to allocated columns in destination

Change-Id: Ic30360795c5dac1dc232f95bd25f5a11946c7dee
Reviewed-on: https://gerrit.libreoffice.org/75738
Tested-by: Jenkins
Reviewed-by: Mike Kaganski 
(cherry picked from commit 2d4ccc58e9ef3b98a88407e1a7a3abf3379f0d20)
Reviewed-on: https://gerrit.libreoffice.org/75756
Reviewed-by: Christian Lohmaier 

diff --git a/sc/qa/unit/copy_paste_test.cxx b/sc/qa/unit/copy_paste_test.cxx
index 967faaadf13a..a31312c6fe6f 100644
--- a/sc/qa/unit/copy_paste_test.cxx
+++ b/sc/qa/unit/copy_paste_test.cxx
@@ -33,11 +33,13 @@ public:
 void testCopyPasteXLS();
 void testTdf84411();
 void testTdf124565();
+void testTdf126421();
 
 CPPUNIT_TEST_SUITE(ScCopyPasteTest);
 CPPUNIT_TEST(testCopyPasteXLS);
 CPPUNIT_TEST(testTdf84411);
 CPPUNIT_TEST(testTdf124565);
+CPPUNIT_TEST(testTdf126421);
 CPPUNIT_TEST_SUITE_END();
 
 private:
@@ -126,6 +128,14 @@ void ScCopyPasteTest::testCopyPasteXLS()
 
 namespace {
 
+ScMarkData::MarkedTabsType TabsInRange(const ScRange& r)
+{
+ScMarkData::MarkedTabsType aResult;
+for (SCTAB i = r.aStart.Tab(); i <= r.aEnd.Tab(); ++i)
+aResult.insert(i);
+return aResult;
+}
+
 void lcl_copy( const OUString& rSrcRange, const OUString& rDstRange, 
ScDocument& rDoc, ScTabViewShell* pViewShell )
 {
 ScDocument aClipDoc(SCDOCMODE_CLIP);
@@ -135,6 +145,7 @@ void lcl_copy( const OUString& rSrcRange, const OUString& 
rDstRange, ScDocument&
 ScRefFlags nRes = aSrcRange.Parse(rSrcRange, &rDoc, 
rDoc.GetAddressConvention());
 CPPUNIT_ASSERT_MESSAGE("Failed to parse.", (nRes & ScRefFlags::VALID));
 pViewShell->GetViewData().GetMarkData().SetMarkArea(aSrcRange);
+
pViewShell->GetViewData().GetMarkData().SetSelectedTabs(TabsInRange(aSrcRange));
 pViewShell->GetViewData().GetView()->CopyToClip(&aClipDoc, false, false, 
false, false);
 
 // 2. Paste
@@ -142,6 +153,7 @@ void lcl_copy( const OUString& rSrcRange, const OUString& 
rDstRange, ScDocument&
 nRes = aDstRange.Parse(rDstRange, &rDoc, rDoc.GetAddressConvention());
 CPPUNIT_ASSERT_MESSAGE("Failed to parse.", (nRes & ScRefFlags::VALID));
 pViewShell->GetViewData().GetMarkData().SetMarkArea(aDstRange);
+
pViewShell->GetViewData().GetMarkData().SetSelectedTabs(TabsInRange(aDstRange));
 pViewShell->GetViewData().GetView()->PasteFromClip(InsertDeleteFlags::ALL, 
&aClipDoc);
 }
 
@@ -289,6 +301,68 @@ void ScCopyPasteTest::testTdf124565()
 xDocSh->DoClose();
 }
 
+void ScCopyPasteTest::testTdf126421()
+{
+uno::Reference xDesktop
+= frame::Desktop::create(::comphelper::getProcessComponentContext());
+CPPUNIT_ASSERT(xDesktop.is());
+
+// create a frame
+Reference xTargetFrame = xDesktop->findFrame("_blank", 0);
+CPPUNIT_ASSERT(xTargetFrame.is());
+
+// 1. Create spreadsheet
+uno::Sequence aEmptyArgList;
+uno::Reference xComponent
+= xDesktop->loadComponentFromURL("private:factory/scalc", "_blank", 0, 
aEmptyArgList);
+CPPUNIT_ASSERT(xComponent.is());
+
+// Get the document model
+SfxObjectShell* pFoundShell = 
SfxObjectShell::GetShellFromComponent(xComponent);
+CPPUNIT_ASSERT_MESSAGE("Failed to access document shell", pFoundShell);
+
+ScDocShellRef xDocSh = dynamic_cast(pFoundShell);
+CPPUNIT_ASSERT(xDocSh);
+
+uno::Reference xModel2(xDocSh->GetModel(), UNO_QUERY);
+CPPUNIT_ASSERT(xModel2.is());
+
+Reference 
xController(xModel2->createDefaultViewController(xTargetFrame),
+   UNO_QUERY);
+CPPUNIT_ASSERT(xController.is());
+
+// introduce model/view/controller to each other
+xController->attachModel(xModel2.get());
+xModel2->connectController(xController.get());
+xTargetFrame->setComponent(xController->getComponentWindow(), 
xController.get());
+xController->attachFrame(xTargetFrame);
+xModel2->setCurrentController(xController.get());
+
+ScDocument& rDoc = xDocSh->GetDocument();
+
+// Get the document controller
+ScTabViewShell* pViewShell = xDocSh->GetBestViewShell(false);
+CPPUNIT_ASSERT(pViewShell != nullptr);
+
+// 2. Setup data
+for (int r = 0; r < 2; ++r)
+for (int c = 0; c < 1024; ++c)
+rDoc.SetValue(c, r, 0, (c + 1) * 100 + (r + 1));
+
+const SCTAB n2ndTab = rDoc.GetMaxTableNumber() + 1;
+rDoc.MakeTable(n2ndTab);
+const auto aTabNames = rDoc.GetAllTableNames();
+
+lcl_copy(aTabNames[0] + ".A1:AMJ2", aTabNames[n2ndTab] + ".A1:AMJ2", rDoc, 
pViewShell);
+
+// 3. C

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

2019-07-19 Thread Mike Kaganski (via logerrit)
 cui/source/factory/cuiexp.cxx |4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

New commits:
commit 9987bb6ee096afada1dac848db95b3c311f723f7
Author: Mike Kaganski 
AuthorDate: Fri Jul 19 10:10:48 2019 +0200
Commit: Mike Kaganski 
CommitDate: Fri Jul 19 13:50:23 2019 +0200

Move static into the getter function

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

diff --git a/cui/source/factory/cuiexp.cxx b/cui/source/factory/cuiexp.cxx
index 3c8f89be234d..1ee11a656c75 100644
--- a/cui/source/factory/cuiexp.cxx
+++ b/cui/source/factory/cuiexp.cxx
@@ -57,11 +57,9 @@
 
 namespace cui
 {
-static AbstractDialogFactory_Impl* pFactory=nullptr;
 static AbstractDialogFactory_Impl* GetFactory()
 {
-if ( !pFactory )
-pFactory = new AbstractDialogFactory_Impl;
+static AbstractDialogFactory_Impl* pFactory = new 
AbstractDialogFactory_Impl;
 return pFactory;
 }
 }
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

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

2019-07-23 Thread Mike Kaganski (via logerrit)
 comphelper/source/misc/lok.cxx |6 ++
 desktop/source/lib/init.cxx|3 +++
 include/comphelper/lok.hxx |   10 ++
 sc/source/ui/view/gridwin4.cxx |9 ++---
 4 files changed, 25 insertions(+), 3 deletions(-)

New commits:
commit 91a3f58ec3ac7998688cab665322d26d5aa3b015
Author: Mike Kaganski 
AuthorDate: Fri Jul 12 20:01:57 2019 +1000
Commit: Mike Kaganski 
CommitDate: Tue Jul 23 15:54:48 2019 +0200

Don't draw gridlines and document background in Online server process

... see https://gerrit.libreoffice.org/72417
They will be drawn client-side. Borders and explicit cell background are
still drawn in core. This mode is activated using "sc_no_grid_bg" option
in SAL_LOK_OPTIONS environment variable.

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

diff --git a/comphelper/source/misc/lok.cxx b/comphelper/source/misc/lok.cxx
index 0ea263f20885..0c43c3fc0822 100644
--- a/comphelper/source/misc/lok.cxx
+++ b/comphelper/source/misc/lok.cxx
@@ -35,6 +35,8 @@ static bool g_bViewIdForVisCursorInvalidation(false);
 
 static bool g_bLocalRendering(false);
 
+static Compat g_eCompatFlags(Compat::none);
+
 static LanguageTag g_aLanguageTag("en-US", true);
 
 /// Scaling of the cairo or CoreGraphics canvas painting for HiDPI or zooming 
in Calc.
@@ -130,6 +132,10 @@ bool isLocalRendering()
 return g_bLocalRendering;
 }
 
+void setCompatFlag(Compat flag) { g_eCompatFlags = 
static_cast(g_eCompatFlags | flag); }
+
+bool isCompatFlagSet(Compat flag) { return (g_eCompatFlags & flag) == flag; }
+
 void setLanguageTag(const LanguageTag& languageTag)
 {
 if (g_aLanguageTag != languageTag)
diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx
index 1a18e296a092..b553ba6b8b17 100644
--- a/desktop/source/lib/init.cxx
+++ b/desktop/source/lib/init.cxx
@@ -4909,6 +4909,9 @@ static int lo_initialize(LibreOfficeKit* pThis, const 
char* pAppPath, const char
 bUnipoll = true;
 else if (it == "profile_events")
 bProfileZones = true;
+else if (it == "sc_no_grid_bg")
+comphelper::LibreOfficeKit::setCompatFlag(
+comphelper::LibreOfficeKit::Compat::scNoGridBackground);
 }
 }
 
diff --git a/include/comphelper/lok.hxx b/include/comphelper/lok.hxx
index 5f132f9d15f8..aaa3b48e6ae0 100644
--- a/include/comphelper/lok.hxx
+++ b/include/comphelper/lok.hxx
@@ -72,6 +72,16 @@ COMPHELPER_DLLPUBLIC void setRangeHeaders(bool 
bTiledAnnotations);
 /// Check if range based header data is enabled
 COMPHELPER_DLLPUBLIC bool isRangeHeaders();
 
+enum Compat : sal_uInt32
+{
+none = 0,
+scNoGridBackground = 1,
+};
+/// Set compatibility flags
+COMPHELPER_DLLPUBLIC void setCompatFlag(Compat flag);
+/// Get compatibility flags
+COMPHELPER_DLLPUBLIC bool isCompatFlagSet(Compat flag);
+
 
 /// Check whether clients want viewId in visible cursor invalidation payload.
 COMPHELPER_DLLPUBLIC bool isViewIdForVisCursorInvalidation();
diff --git a/sc/source/ui/view/gridwin4.cxx b/sc/source/ui/view/gridwin4.cxx
index 5e1280cbd98f..8fc6391a665e 100644
--- a/sc/source/ui/view/gridwin4.cxx
+++ b/sc/source/ui/view/gridwin4.cxx
@@ -527,6 +527,9 @@ void ScGridWindow::DrawContent(OutputDevice &rDevice, const 
ScTableInfo& rTableI
 ScDocument& rDoc = *pViewData->GetDocument();
 const ScViewOptions& rOpts = pViewData->GetOptions();
 bool bIsTiledRendering = comphelper::LibreOfficeKit::isActive();
+bool bNoBackgroundAndGrid = bIsTiledRendering
+&& comphelper::LibreOfficeKit::isCompatFlagSet(
+   
comphelper::LibreOfficeKit::Compat::scNoGridBackground);
 
 SCTAB nTab = aOutputData.nTab;
 SCCOL nX1 = aOutputData.nX1;
@@ -710,16 +713,16 @@ void ScGridWindow::DrawContent(OutputDevice &rDevice, 
const ScTableInfo& rTableI
 DrawRedraw( aOutputData, SC_LAYER_BACK );
 }
 else
-aOutputData.SetSolidBackground(true);
+aOutputData.SetSolidBackground(!bNoBackgroundAndGrid);
 
 aOutputData.DrawDocumentBackground();
 
-if ( bGridFirst && ( bGrid || bPage ) )
+if (bGridFirst && (bGrid || bPage) && !bNoBackgroundAndGrid)
 aOutputData.DrawGrid(*pContentDev, bGrid, bPage);
 
 aOutputData.DrawBackground(*pContentDev);
 
-if ( !bGridFirst && ( bGrid || bPage ) )
+if (!bGridFirst && (bGrid || bPage) && !bNoBackgroundAndGrid)
 aOutputData.DrawGrid(*pContentDev, bGrid, bPage);
 
 pContentDev->SetMapMode(MapMode(MapUnit::MapPixel));
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

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

2019-07-23 Thread Mike Kaganski (via logerrit)
 desktop/source/lib/init.cxx |5 +
 1 file changed, 1 insertion(+), 4 deletions(-)

New commits:
commit f1fda07e126ddb1333ecbd2429ede8098ac9f1c0
Author: Mike Kaganski 
AuthorDate: Wed Jul 24 04:10:04 2019 +0200
Commit: Mike Kaganski 
CommitDate: Wed Jul 24 05:18:23 2019 +0200

Drop unneeded initialization

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

diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx
index b553ba6b8b17..5a908f2dd8f6 100644
--- a/desktop/source/lib/init.cxx
+++ b/desktop/source/lib/init.cxx
@@ -2216,15 +2216,12 @@ static void doc_iniUnoCommands ()
 
 for (const auto & sUnoCommand : sUnoCommands)
 {
-const SfxSlot* pSlot = nullptr;
-
 aCommandURL.Complete = sUnoCommand;
 xParser->parseStrict(aCommandURL);
-pSlot = rSlotPool.GetUnoSlot(aCommandURL.Path);
 
 // when null, this command is not supported by the given component
 // (like eg. Calc does not have ".uno:DefaultBullet" etc.)
-if (pSlot)
+if (const SfxSlot* pSlot = rSlotPool.GetUnoSlot(aCommandURL.Path))
 {
 // Initialize slot to dispatch .uno: Command.
 pViewFrame->GetBindings().GetDispatch(pSlot, aCommandURL, false);
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

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

2019-07-23 Thread Mike Kaganski (via logerrit)
 desktop/source/lib/init.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 29fbb2512c741bc34221b7d13b9958c832f0a3f7
Author: Mike Kaganski 
AuthorDate: Wed Jul 24 04:21:42 2019 +0200
Commit: Mike Kaganski 
CommitDate: Wed Jul 24 05:18:45 2019 +0200

Redundant condition

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

diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx
index 5a908f2dd8f6..f9ed2bdc76a8 100644
--- a/desktop/source/lib/init.cxx
+++ b/desktop/source/lib/init.cxx
@@ -2197,7 +2197,7 @@ static void doc_iniUnoCommands ()
 SfxViewFrame* pViewFrame = pViewShell? pViewShell->GetViewFrame(): nullptr;
 
 // check if Frame-Controller were created.
-if (!pViewShell && !pViewFrame)
+if (!pViewFrame)
 {
 SAL_WARN("lok", "iniUnoCommands: No Frame-Controller created.");
 return;
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

[Libreoffice-commits] core.git: configure.ac Repository.mk shell/Library_spsupp.mk shell/Library_spsupp_x86.mk shell/Module_shell.mk solenv/gbuild

2019-06-13 Thread Mike Kaganski (via logerrit)
 Repository.mk   |   12 +++-
 configure.ac|2 ++
 shell/Library_spsupp_x86.mk |   16 +---
 shell/Module_shell.mk   |   12 +++-
 solenv/gbuild/Library.mk|1 +
 5 files changed, 34 insertions(+), 9 deletions(-)

New commits:
commit 58ef8c188b6bb2ed307f5e825cc7e475c33d0c33
Author: Mike Kaganski 
AuthorDate: Tue May 7 21:22:08 2019 +0300
Commit: Mike Kaganski 
CommitDate: Fri Jun 14 01:16:22 2019 +0200

Make spsupp*.dll usable on 64-bit Windows

Build spsupp for both x64 and x86, regardless of target platform.
This allows to install the ActiveX component to be used by both
64-bit and 32-bit applications on 64-bit systems (especially IE,
which runs both 64-bit and 32-bit processes simultaneously at
least on Win10), no matter which LO (32/64) was installed.

Move the DLLs from activex feature to ooo, to copy unconditionally.
Registration of LO-specific component will be also unconditional;
registration of replacement of MSO component will need own feature.

This doesn't yet register the component in system: TODO later.

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

diff --git a/Repository.mk b/Repository.mk
index a0faa0d2a026..33cc24fd6881 100644
--- a/Repository.mk
+++ b/Repository.mk
@@ -665,16 +665,26 @@ $(eval $(call 
gb_Helper_register_libraries_for_install,PLAINLIBS_OOO,activexbina
 
 $(eval $(call gb_Helper_register_libraries_for_install,PLAINLIBS_OOO,activex, \
so_activex \
-   spsupp \
 ))
 
 ifneq ($(BUILD_X64),)
 $(eval $(call 
gb_Helper_register_libraries_for_install,PLAINLIBS_OOO,activexwin64, \
so_activex_x64 \
+))
+endif
+
+ifneq ($(CXX_X64_BINARY),)
+$(eval $(call gb_Helper_register_libraries_for_install,PLAINLIBS_OOO,ooo, \
spsupp_x64 \
 ))
 endif
 
+ifneq ($(CXX_X86_BINARY),)
+$(eval $(call gb_Helper_register_libraries_for_install,PLAINLIBS_OOO,ooo, \
+   spsupp_x86 \
+))
+endif
+
 $(eval $(call 
gb_Helper_register_libraries_for_install,PLAINLIBS_OOO,ooobinarytable, \
$(if $(WINDOWS_SDK_HOME),\
instooofiltmsi \
diff --git a/configure.ac b/configure.ac
index 56485ac37f6d..5a34fe080c33 100644
--- a/configure.ac
+++ b/configure.ac
@@ -3581,6 +3581,8 @@ if test "$_os" = "WINNT"; then
 AC_MSG_RESULT([not found])
 AC_MSG_WARN([Installation set will not contain 64-bit Explorer 
extensions])
 fi
+else
+CXX_X64_BINARY=$MSVC_CXX
 fi
 AC_SUBST(BUILD_X64)
 
diff --git a/shell/Library_spsupp.mk b/shell/Library_spsupp_x86.mk
similarity index 63%
rename from shell/Library_spsupp.mk
rename to shell/Library_spsupp_x86.mk
index 1963bbfaebda..ba101b7bb4ec 100644
--- a/shell/Library_spsupp.mk
+++ b/shell/Library_spsupp_x86.mk
@@ -7,18 +7,20 @@
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 #
 
-$(eval $(call gb_Library_Library,spsupp))
+$(eval $(call gb_Library_Library,spsupp_x86))
 
-$(eval $(call gb_Library_use_custom_headers,spsupp,\
+$(eval $(call gb_Library_set_x86,spsupp_x86,YES))
+
+$(eval $(call gb_Library_use_custom_headers,spsupp_x86,\
shell/source/win32/spsupp/idl \
 ))
 
-$(eval $(call gb_Library_set_include,spsupp,\
+$(eval $(call gb_Library_set_include,spsupp_x86,\
-I$(SRCDIR)/shell/inc/spsupp \
$$(INCLUDE) \
 ))
 
-$(eval $(call gb_Library_use_system_win32_libs,spsupp,\
+$(eval $(call gb_Library_use_system_win32_libs,spsupp_x86,\
advapi32 \
kernel32 \
ole32 \
@@ -26,13 +28,13 @@ $(eval $(call gb_Library_use_system_win32_libs,spsupp,\
user32 \
 ))
 
-$(eval $(call gb_Library_add_nativeres,spsupp,spsupp))
+$(eval $(call gb_Library_add_nativeres,spsupp_x86,spsupp))
 
-$(eval $(call gb_Library_add_ldflags,spsupp,\
+$(eval $(call gb_Library_add_ldflags,spsupp_x86,\
/DEF:$(SRCDIR)/shell/source/win32/spsupp/spsupp.def \
 ))
 
-$(eval $(call gb_Library_add_exception_objects,spsupp,\
+$(eval $(call gb_Library_add_exception_objects,spsupp_x86,\
 shell/source/win32/spsupp/COMOpenDocuments \
 shell/source/win32/spsupp/registrar \
 shell/source/win32/spsupp/spsuppClassFactory \
diff --git a/shell/Module_shell.mk b/shell/Module_shell.mk
index c0c42cc5bea5..a03e020bf4f7 100644
--- a/shell/Module_shell.mk
+++ b/shell/Module_shell.mk
@@ -56,7 +56,6 @@ $(eval $(call gb_Module_add_targets,shell,\
StaticLibrary_xmlparser \
WinResTarget_shlxthdl \
CustomTarget_spsupp_idl \
-   Library_spsupp \
WinResTarget_spsupp \
WinResTarget_spsupp_dlg \
 ))
@@ -74,10 +73,21 @@ $(eval $(call gb_Module_add_targets,shell,\
Library_shlxthdl_x64 \
StaticLibrary_shlxthandler_common_x64 \
StaticLibrary_xmlparser_x64 \
+))
+endif
+
+ifneq ($(CXX_X64_BINARY),)
+$(eval $(call gb_Module_add_targets,shell,\
Library_sps

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

2019-06-16 Thread Mike Kaganski (via logerrit)
 cui/source/customize/CustomNotebookbarGenerator.cxx |   11 +--
 1 file changed, 5 insertions(+), 6 deletions(-)

New commits:
commit abd059fcd81975e2e4f9188734fc8418299caf6b
Author: Mike Kaganski 
AuthorDate: Mon Jun 17 06:11:25 2019 +0200
Commit: Mike Kaganski 
CommitDate: Mon Jun 17 07:50:56 2019 +0200

Only call comphelper::getProcessComponentContext() once

Also remove useless initialization of eApp right before assigning
a value to it.

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

diff --git a/cui/source/customize/CustomNotebookbarGenerator.cxx 
b/cui/source/customize/CustomNotebookbarGenerator.cxx
index 40fbe9012183..a1aa63bca568 100644
--- a/cui/source/customize/CustomNotebookbarGenerator.cxx
+++ b/cui/source/customize/CustomNotebookbarGenerator.cxx
@@ -231,15 +231,14 @@ void 
CustomNotebookbarGenerator::modifyCustomizedUIFile(Sequence sUIIt
 void CustomNotebookbarGenerator::getFileNameAndAppName(OUString& sAppName,
OUString& 
sNotebookbarUIFileName)
 {
-utl::OConfigurationTreeRoot 
aRoot(::comphelper::getProcessComponentContext(),
-  "org.openoffice.Office.UI.ToolbarMode/", 
false);
+const auto xContext = comphelper::getProcessComponentContext();
+utl::OConfigurationTreeRoot aRoot(xContext, 
"org.openoffice.Office.UI.ToolbarMode/", false);
 const Reference& xFrame
 = SfxViewFrame::Current()->GetFrame().GetFrameInterface();
-const Reference xModuleManager
-= 
frame::ModuleManager::create(::comphelper::getProcessComponentContext());
+const Reference xModuleManager = 
frame::ModuleManager::create(xContext);
 
-vcl::EnumContext::Application eApp = vcl::EnumContext::Application::Any;
-eApp = 
vcl::EnumContext::GetApplicationEnum(xModuleManager->identify(xFrame));
+vcl::EnumContext::Application eApp
+= 
vcl::EnumContext::GetApplicationEnum(xModuleManager->identify(xFrame));
 OUString sActiveAppName(lcl_activeAppName(eApp));
 sAppName = lcl_getAppName(eApp);
 const Any aValue = aRoot.getNodeValue(sActiveAppName);
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

[Libreoffice-commits] core.git: bin/gbuild-to-ide Makefile.in

2019-06-17 Thread Mike Kaganski (via logerrit)
 Makefile.in   |1 +
 bin/gbuild-to-ide |3 ++-
 2 files changed, 3 insertions(+), 1 deletion(-)

New commits:
commit c8acd77fd08c0c02fa3e1b388f993e77aba3537e
Author: Mike Kaganski 
AuthorDate: Mon Jun 17 06:26:32 2019 +0200
Commit: Mike Kaganski 
CommitDate: Mon Jun 17 09:06:28 2019 +0200

Add vs2019-ide-integration

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

diff --git a/Makefile.in b/Makefile.in
index 5423596012e0..ba4b60a58b84 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -472,6 +472,7 @@ endef
 $(foreach ide,\
codelite \
vs2017 \
+   vs2019 \
kdevelop \
vim \
qtcreator \
diff --git a/bin/gbuild-to-ide b/bin/gbuild-to-ide
index e012c08c0828..f1121efddabb 100755
--- a/bin/gbuild-to-ide
+++ b/bin/gbuild-to-ide
@@ -925,7 +925,7 @@ class 
VisualStudioIntegrationGenerator(IdeIntegrationGenerator):
 }
 
 def retrieve_toolset(self, ide):
-ide_toolset_map = {'vs2017': 'v141'}
+ide_toolset_map = {'vs2017': 'v141', 'vs2019': 'v142'}
 return ide_toolset_map[ide]
 
 def module_make_command(self, targets):
@@ -1850,6 +1850,7 @@ if __name__ == '__main__':
 'kdevelop': KdevelopIntegrationGenerator,
 'xcode': XcodeIntegrationGenerator,
 'vs2017': VisualStudioIntegrationGenerator,
+'vs2019': VisualStudioIntegrationGenerator,
 'vim': VimIntegrationGenerator,
 'debug': DebugIntegrationGenerator,
 'qtcreator': QtCreatorIntegrationGenerator,
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

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

2019-06-17 Thread Mike Kaganski (via logerrit)
 cui/source/tabpages/tparea.cxx |5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

New commits:
commit 99971d009e9c96d1d47aec14ecfbfeaa06dc140d
Author: Mike Kaganski 
AuthorDate: Tue Jun 18 05:03:01 2019 +0200
Commit: Mike Kaganski 
CommitDate: Tue Jun 18 05:55:46 2019 +0200

Avoid needless copy of item

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

diff --git a/cui/source/tabpages/tparea.cxx b/cui/source/tabpages/tparea.cxx
index 1ec685daaafe..cb83563920b2 100644
--- a/cui/source/tabpages/tparea.cxx
+++ b/cui/source/tabpages/tparea.cxx
@@ -216,10 +216,11 @@ void SvxAreaTabPage::ActivatePage( const SfxItemSet& rSet 
)
 }
 case drawing::FillStyle_BITMAP:
 {
-XFillBitmapItem aItem(static_cast( 
rSet.Get( GetWhich( XATTR_FILLBITMAP ) ) ));
+const bool bPattern
+= 
rSet.Get(TypedWhichId(GetWhich(XATTR_FILLBITMAP))).isPattern();
 // pass full item set here, bitmap fill has many attributes 
(tiling, size, offset etc.)
 m_rXFSet.Put( rSet );
-if(!aItem.isPattern())
+if (!bPattern)
 SelectFillType(*m_xBtnBitmap);
 else
 SelectFillType(*m_xBtnPattern);
___
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' - readlicense_oo/Package_license.mk

2019-06-17 Thread Mike Kaganski (via logerrit)
 readlicense_oo/Package_license.mk |4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

New commits:
commit 808908907350b7705dbae870b22f042512a48ff0
Author: Mike Kaganski 
AuthorDate: Wed Mar 20 14:36:58 2019 +0300
Commit: Mike Kaganski 
CommitDate: Tue Jun 18 06:55:22 2019 +0200

Fix MSI build after commit 7a9f6df7fb83ec23d09cb5744c2c865fa22e7143

Change-Id: Ib659477a2358b14fbacc1638394c783995272eb5
Reviewed-on: https://gerrit.libreoffice.org/69466
Reviewed-by: Thorsten Behrens 
Tested-by: Thorsten Behrens 
(cherry picked from commit bfa7db29bd5077c4c8be6ccd9dfd80f974c1e148)
Reviewed-on: https://gerrit.libreoffice.org/74239
Reviewed-by: Mike Kaganski 
Tested-by: Mike Kaganski 

diff --git a/readlicense_oo/Package_license.mk 
b/readlicense_oo/Package_license.mk
index 473b3e44fbf4..7f1b5bb309c8 100644
--- a/readlicense_oo/Package_license.mk
+++ b/readlicense_oo/Package_license.mk
@@ -9,7 +9,9 @@
 
 $(eval $(call gb_Package_Package,readlicense_oo_license,$(call 
gb_CustomTarget_get_workdir,readlicense_oo/license)))
 
-ifneq ($(OS),WNT)
+ifeq ($(OS),WNT)
+$(eval $(call 
gb_Package_add_file,readlicense_oo_license,license.txt,license.txt))
+else
 ifneq ($(OS),MACOSX)
 $(eval $(call gb_Package_add_file,readlicense_oo_license,LICENSE,LICENSE))
 else
___
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' - 2 commits - sw/qa sw/source ucb/source

2019-06-18 Thread Mike Kaganski (via logerrit)
 sw/qa/extras/ooxmlexport/data/tdf116371.odt  |binary
 sw/qa/extras/ooxmlexport/ooxmlexport13.cxx   |   10 +++
 sw/source/filter/ww8/docxattributeoutput.cxx |   37 ---
 ucb/source/ucp/webdav-neon/NeonSession.cxx   |   14 --
 ucb/source/ucp/webdav-neon/NeonSession.hxx   |1 
 ucb/source/ucp/webdav-neon/webdavcontent.cxx |   10 ++-
 6 files changed, 50 insertions(+), 22 deletions(-)

New commits:
commit 0ba1cb36688baff5814ae61163d401f2ecb39e31
Author: Mike Kaganski 
AuthorDate: Tue Jan 8 05:47:04 2019 +0300
Commit: Mike Kaganski 
CommitDate: Tue Jun 18 13:57:52 2019 +0200

Don't crash when accessing WebDAV resource after auth failed

In my testing on Windows, the crashing scenario was this:
1. FileDialogHelper_Impl::updateVersions() creates storage calling
   comphelper::OStorageHelper::GetStorageFromURL;
2. Content::openStream() calls isDocument first;
3. Content::isDocument() indirectly initiates WebDAV session,
   creating a NeonSession;
4. All operations of NeonSession call Init() first; its first call
   initializes m_pHttpSession using ne_session_create, and then
   adds auth callbacks using ne_add_server_auth/ne_add_proxy_auth
5. Then NeonSession performs the rest of PROPFIND task, calling
   ah_post_send and auth_challenge; the latter fails, then
   ah_post_send calls clean_session, which cleans m_pHttpSession's
   auth_session's sspi_host;
6. NeonSession::HandleError throws DAVException for NE_AUTH error;
7. Content::isDocument() returns true to Content::openStream(),
   which proceeds to execute the command, which in turn re-uses
   the NeonSession and its m_pHttpSession;
8. NeonSession::OPTIONS then indirectly calls continue_sspi, which
   tries to dereference the m_pHttpSession's auth_session's
   sspi_host which is nullptr at this point.

So in case NeonSession detects the NE_AUTH error condition, let's
set a flag indicating that the next Init() should reinitialize its
m_pHttpSession.

Also fixed a case when xProps was used before initialization in
Content::getPropertyValues.

Change-Id: Ifc9eec4fe0333ff6be17c5089068441b4a6eb78c
Reviewed-on: https://gerrit.libreoffice.org/65950
Tested-by: Jenkins
Reviewed-by: Mike Kaganski 
(cherry picked from commit 162a472d55cf9fb9aaa6d5eae625b3da2273a516)
Reviewed-on: https://gerrit.libreoffice.org/74261
Tested-by: Mike Kaganski 

diff --git a/ucb/source/ucp/webdav-neon/NeonSession.cxx 
b/ucb/source/ucp/webdav-neon/NeonSession.cxx
index c10796a48e79..164d30e56ae3 100644
--- a/ucb/source/ucp/webdav-neon/NeonSession.cxx
+++ b/ucb/source/ucp/webdav-neon/NeonSession.cxx
@@ -671,7 +671,8 @@ void NeonSession::Init()
 {
 osl::Guard< osl::Mutex > theGuard( m_aMutex );
 
-bool bCreateNewSession = false;
+bool bCreateNewSession = m_bNeedNewSession;
+m_bNeedNewSession = false;
 
 if ( m_pHttpSession == nullptr )
 {
@@ -725,13 +726,17 @@ void NeonSession::Init()
 m_aProxyName = rProxyCfg.aName;
 m_nProxyPort = rProxyCfg.nPort;
 
+bCreateNewSession = true;
+}
+
+if (bCreateNewSession)
+{
 // new session needed, destroy old first
 {
 osl::Guard< osl::Mutex > theGlobalGuard(getGlobalNeonMutex());
 ne_session_destroy( m_pHttpSession );
 }
 m_pHttpSession = nullptr;
-bCreateNewSession = true;
 }
 }
 
@@ -1966,6 +1971,11 @@ void NeonSession::HandleError( int nError,
 m_aHostName, m_nPort ) );
 
 case NE_AUTH: // User authentication failed on server
+// m_pHttpSession could get invalidated, e.g., as result of 
clean_session called in
+// ah_post_send in case when auth_challenge failed, which 
invalidates the auth_session
+// which we established in Init(): the auth_session's sspi_host 
gets disposed, and
+// next attempt to authenticate would crash in continue_sspi 
trying to dereference it
+m_bNeedNewSession = true;
 throw DAVException( DAVException::DAV_HTTP_AUTH,
 NeonUri::makeConnectionEndPointString(
 m_aHostName, m_nPort ) );
diff --git a/ucb/source/ucp/webdav-neon/NeonSession.hxx 
b/ucb/source/ucp/webdav-neon/NeonSession.hxx
index 2adebaacd3fd..df4522da6e18 100644
--- a/ucb/source/ucp/webdav-neon/NeonSession.hxx
+++ b/ucb/source/ucp/webdav-neon/NeonSession.hxx
@@ -54,6 +54,7 @@ private:
 sal_Int32 m_nProxyPort;
 css::uno::Sequence< css::beans::NamedValue > const m_aFlags;
 HttpSession * m_pHttpSession;
+bool m_bNeedNewSession = false; // Something happened that could 
invalidate m_pHttpSession
 void * const  m_pRequestData;
 const ucbhelper::InternetProxyDecider &

[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-6.2' - 3 commits - cui/uiconfig editeng/source include/editeng include/sfx2 officecfg/registry sal/osl sfx2/source sw/qa sw/source

2019-06-18 Thread Mike Kaganski (via logerrit)
 cui/uiconfig/ui/acorexceptpage.ui  |6 
 editeng/source/misc/svxacorr.cxx   |8 
 include/editeng/svxacorr.hxx   |8 
 include/sfx2/docfile.hxx   |3 
 officecfg/registry/schema/org/openoffice/Office/Common.xcs |9 -
 sal/osl/w32/file.cxx   |2 
 sfx2/source/doc/docfile.cxx|  108 -
 sw/qa/extras/ww8import/data/tdf122425_1.doc|binary
 sw/qa/extras/ww8import/data/tdf122425_2.doc|binary
 sw/qa/extras/ww8import/ww8import.cxx   |   66 +++
 sw/source/filter/ww8/ww8graf.cxx   |1 
 sw/source/filter/ww8/ww8par.cxx|7 
 12 files changed, 200 insertions(+), 18 deletions(-)

New commits:
commit b833372df8d06c69809b656137826c3ca8dd53f8
Author: Mike Kaganski 
AuthorDate: Fri Dec 7 13:10:57 2018 +0300
Commit: Mike Kaganski 
CommitDate: Tue Jun 18 13:58:30 2019 +0200

tdf#121779: extend TWo CApitals list to also ignore sMALL iNITIALS

Now this list is used also in rules for capitalizing first letter of
every sentence, and for correcting accidental use of Caps Lock key.

Change-Id: I4fbdbccbae32743d5e9a6757344361eefd88e167
Reviewed-on: https://gerrit.libreoffice.org/64759
Tested-by: Jenkins
Reviewed-by: Heiko Tietze 
Reviewed-by: Sophie Gautier 
Reviewed-by: Mike Kaganski 
(cherry picked from commit 7bf6d0d9d8e3e2e07726ca6df246619ee1ead3a3)
Reviewed-on: https://gerrit.libreoffice.org/74258
Tested-by: Mike Kaganski 

diff --git a/cui/uiconfig/ui/acorexceptpage.ui 
b/cui/uiconfig/ui/acorexceptpage.ui
index b1568fbd3bed..505457430969 100644
--- a/cui/uiconfig/ui/acorexceptpage.ui
+++ b/cui/uiconfig/ui/acorexceptpage.ui
@@ -289,7 +289,7 @@
 True
 
   
-New words with 
two initial capitals
+New words with 
two initial capitals or small initial
   
 
   
@@ -325,7 +325,7 @@
 True
 
   
-Delete words 
with two initial capitals
+Delete words 
with two initial capitals or small initial
   
 
   
@@ -394,7 +394,7 @@
   
 True
 False
-Words With TWo INitial CApitals
+Words With TWo INitial CApitals or sMALL 
iNITIAL
 
   
 
diff --git a/editeng/source/misc/svxacorr.cxx b/editeng/source/misc/svxacorr.cxx
index e1a32bb154b5..0f06586be272 100644
--- a/editeng/source/misc/svxacorr.cxx
+++ b/editeng/source/misc/svxacorr.cxx
@@ -900,6 +900,10 @@ void SvxAutoCorrect::FnCapitalStartSentence( 
SvxAutoCorrDoc& rDoc,
 return; // no valid separator -> no replacement
 }
 
+// No replacement for words in TWo INitial CApitals or sMALL iNITIAL list
+if (FindInWrdSttExceptList(eLang, OUString(pWordStt, pDelim - pWordStt)))
+return;
+
 if( bAtStart )  // at the beginning of a paragraph?
 {
 // Check out the previous paragraph, if it exists.
@@ -1114,6 +1118,10 @@ bool SvxAutoCorrect::FnCorrectCapsLock( SvxAutoCorrDoc& 
rDoc, const OUString& rT
 aConverted.append( rCC.uppercase(OUString(rTxt[nSttPos])) );
 aConverted.append( rCC.lowercase(OUString(rTxt[nSttPos+1])) );
 
+// No replacement for words in TWo INitial CApitals or sMALL iNITIAL list
+if (FindInWrdSttExceptList(eLang, rTxt.copy(nSttPos, nEndPos - nSttPos)))
+return false;
+
 for( sal_Int32 i = nSttPos+2; i < nEndPos; ++i )
 {
 if ( IsLowerLetter(rCC.getCharacterType(rTxt, i)) )
diff --git a/include/editeng/svxacorr.hxx b/include/editeng/svxacorr.hxx
index 988680984e12..311ed4cfadf7 100644
--- a/include/editeng/svxacorr.hxx
+++ b/include/editeng/svxacorr.hxx
@@ -67,7 +67,7 @@ enum class ACFlags : sal_uInt32 {
 Autocorrect  = 0x0080,   // Call AutoCorrect
 ChgQuotes= 0x0100,   // replace double quotes
 SaveWordCplSttLst= 0x0200,   // Save Auto correction of Capital 
letter at beginning of sentence.
-SaveWordWrdSttLst= 0x0400,   // Save Auto correction of 2 Capital 
letter at beginning of word.
+SaveWordWrdSttLst= 0x0400,   // Save Auto correction of TWo 
INitial CApitals or sMALL iNITIAL.
 IgnoreDoubleSpace= 0x0800,   // Ignore 2 Spaces
 ChgSglQuotes = 0x1000,   // Replace simple quotes
 CorrectCapsLock  = 0x2000,   // Correct accidental use of cAPS 
LOCK key
@@ -209,8 +209,7 @@ public:
 SvStringsISortDtor* GetCplSttExceptList();
 bool A

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

2019-06-18 Thread Mike Kaganski (via logerrit)
 sal/osl/w32/file_url.cxx |5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

New commits:
commit 98cc9b6ae02dc6c10e1f24c478dfca4e128504a8
Author: Mike Kaganski 
AuthorDate: Fri Dec 14 12:44:57 2018 +0100
Commit: Mike Kaganski 
CommitDate: Tue Jun 18 13:58:36 2019 +0200

tdf#98343: ensure PathRemoveFileSpec does not remove UNC's "\\"

PathRemoveFileSpec is used exclusively in GetCaseCorrectPathName(Ex).
The GetCaseCorrectPathName function is only called for absolute or
relative paths, not some arbitrary that chunks. So initial double
backslashes are only possible for UNC paths.

This change fixes handling of UNC paths by the functions. Previously,
the UNC path was recursively shortened until it only consisted of a
single "\"; then, if bCheckExistence was requested, testing this path
failed, which resulted in the whole recursion to return empty result;
else when returning from the recursion, original path components were
appended, but initial double backslashes were never restored. This led
to transformation "\\SERVER\Path\file.ext" to "\SERVER\Path\file.ext".

The GetCaseCorrectPathName itself is only used in two places:
osl_getSystemPathFromFileURL_() and osl_getFileStatus().

osl_getSystemPathFromFileURL_ only calls GetCaseCorrectPathName for
paths longer than 248 characters; bCheckExistence is false. In that
case, the resulting wrong path (missing one initial backslash) was then
processed in /* it should be an UNC path, use the according prefix */
branch, where two initial characters of it were stripped, one of which
being the first character of SERVER name. So, all the following
manipulations with resulting path were incorrect. This code path was
the reason for the bug.

osl_getFileStatus calls GetCaseCorrectPathName always; it requires
to check existence. This led to 0 returned from GetCaseCorrectPathName,
then osl_getFileStatus continued with copying the original string, thus
ignoring the error.

Change-Id: If7409afa2c0dd6dd001c79e719acbfd271a6ab72
Reviewed-on: https://gerrit.libreoffice.org/65158
Tested-by: Jenkins
Reviewed-by: Mike Kaganski 
Reviewed-on: https://gerrit.libreoffice.org/74257
Tested-by: Mike Kaganski 

diff --git a/sal/osl/w32/file_url.cxx b/sal/osl/w32/file_url.cxx
index 28955cce4f3a..f2bfd8da7e0a 100644
--- a/sal/osl/w32/file_url.cxx
+++ b/sal/osl/w32/file_url.cxx
@@ -307,11 +307,12 @@ DWORD IsValidFilePath(rtl_uString *path, DWORD dwFlags, 
rtl_uString **corrected)
 return bValid ? dwPathType : PATHTYPE_ERROR;
 }
 
+// Expects a proper absolute or relative path
 static sal_Int32 PathRemoveFileSpec(LPWSTR lpPath, LPWSTR lpFileName, 
sal_Int32 nFileBufLen )
 {
 sal_Int32 nRemoved = 0;
 
-if ( nFileBufLen )
+if (nFileBufLen && wcscmp(lpPath, L"") != 0) // tdf#98343 do not 
remove leading UNC backslashes!
 {
 lpFileName[0] = 0;
 LPWSTR  lpLastBkSlash = wcsrchr( lpPath, '\\' );
@@ -361,7 +362,7 @@ static LPWSTR PathAddBackslash(LPWSTR lpPath, sal_uInt32 
nBufLen)
 return lpEndPath;
 }
 
-// Same as GetLongPathName but also 95/NT4
+// Expects a proper absolute or relative path. NB: It is different from 
GetLongPathName WinAPI!
 static DWORD GetCaseCorrectPathNameEx(
 LPWSTR  lpszPath,   // path buffer to convert
 sal_uInt32 cchBuffer,  // size of path buffer
___
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' - sw/CppunitTest_sw_ww8import.mk sw/qa sw/source

2019-06-18 Thread Mike Kaganski (via logerrit)
 sw/CppunitTest_sw_ww8import.mk|1 
 sw/qa/extras/ww8import/data/tdf121734.doc |binary
 sw/qa/extras/ww8import/ww8import.cxx  |   43 ++
 sw/source/filter/ww8/ww8par.cxx   |4 --
 sw/source/filter/ww8/ww8par4.cxx  |3 --
 sw/source/filter/ww8/ww8par6.cxx  |6 +---
 6 files changed, 47 insertions(+), 10 deletions(-)

New commits:
commit d03a76d0fa4c2fa5f9ecdf3ea36e257587f2c333
Author: Mike Kaganski 
AuthorDate: Wed Dec 12 00:31:13 2018 +0300
Commit: Mike Kaganski 
CommitDate: Tue Jun 18 14:45:08 2019 +0200

tdf#121734: ww8 import: use direct formatting for floating object frames

... and don't modify standard frame styles to have no borders and padding.
This makes "Frame", "OLE", and "Graphics" frame styles of imported DOC
files to have usual settings (for "Frame", it's 1.5 mm padding and all
borders set to 0.05 pt black line).

All objects that need invisible frame will have them with all necessary
settings set explicitly, which allows to copy and paste such frames to
other documents without problems.

This makes DOC import aligned with DOCX import in this regard.

Change-Id: I6f05cf71e63ceccb8e0ddebe23ec41bf69af9b52
Reviewed-on: https://gerrit.libreoffice.org/64992
Tested-by: Jenkins
Reviewed-by: Mike Kaganski 
Reviewed-on: https://gerrit.libreoffice.org/65012
Tested-by: Mike Kaganski 
Reviewed-by: Andras Timar 
Reviewed-on: https://gerrit.libreoffice.org/74242

diff --git a/sw/CppunitTest_sw_ww8import.mk b/sw/CppunitTest_sw_ww8import.mk
index 932878b0e557..31a7dcbe80ba 100644
--- a/sw/CppunitTest_sw_ww8import.mk
+++ b/sw/CppunitTest_sw_ww8import.mk
@@ -19,6 +19,7 @@ $(eval $(call gb_CppunitTest_use_libraries,sw_ww8import, \
 comphelper \
 cppu \
 cppuhelper \
+editeng \
 sal \
 test \
 unotest \
diff --git a/sw/qa/extras/ww8import/data/tdf121734.doc 
b/sw/qa/extras/ww8import/data/tdf121734.doc
new file mode 100644
index ..11a9bf503ca5
Binary files /dev/null and b/sw/qa/extras/ww8import/data/tdf121734.doc differ
diff --git a/sw/qa/extras/ww8import/ww8import.cxx 
b/sw/qa/extras/ww8import/ww8import.cxx
index 5068f7bbf38c..e3763e60ba17 100644
--- a/sw/qa/extras/ww8import/ww8import.cxx
+++ b/sw/qa/extras/ww8import/ww8import.cxx
@@ -17,6 +17,9 @@
 #include 
 #include 
 #include 
+#include 
+#include 
+#include 
 
 class Test : public SwModelTestBase
 {
@@ -264,6 +267,46 @@ DECLARE_WW8IMPORT_TEST(testTdf122425_2, "tdf122425_2.doc")
 }
 }
 
+DECLARE_WW8IMPORT_TEST(testTdf121734, "tdf121734.doc")
+{
+SwXTextDocument* pTextDoc = 
dynamic_cast(mxComponent.get());
+CPPUNIT_ASSERT(pTextDoc);
+SwDoc* pDoc = pTextDoc->GetDocShell()->GetDoc();
+SwPosFlyFrames aPosFlyFrames = pDoc->GetAllFlyFormats(nullptr, false);
+// There is only one fly frame in the document: the one with the imported 
floating table
+CPPUNIT_ASSERT_EQUAL(size_t(1), aPosFlyFrames.size());
+for (const auto& rPosFlyFrame : aPosFlyFrames)
+{
+const SwFrameFormat& rFormat = rPosFlyFrame->GetFormat();
+const SfxPoolItem* pItem = nullptr;
+
+// The LR and UL spacings and borders must all be set explicitly;
+// spacings and border distances must be 0; borders must be absent.
+
+CPPUNIT_ASSERT_EQUAL(SfxItemState::SET, 
rFormat.GetItemState(RES_LR_SPACE, false, &pItem));
+auto pLR = static_cast(pItem);
+CPPUNIT_ASSERT(pLR);
+CPPUNIT_ASSERT_EQUAL(long(0), pLR->GetLeft());
+CPPUNIT_ASSERT_EQUAL(long(0), pLR->GetRight());
+
+CPPUNIT_ASSERT_EQUAL(SfxItemState::SET, 
rFormat.GetItemState(RES_UL_SPACE, false, &pItem));
+auto pUL = static_cast(pItem);
+CPPUNIT_ASSERT(pUL);
+CPPUNIT_ASSERT_EQUAL(sal_uInt16(0), pUL->GetUpper());
+CPPUNIT_ASSERT_EQUAL(sal_uInt16(0), pUL->GetLower());
+
+CPPUNIT_ASSERT_EQUAL(SfxItemState::SET, rFormat.GetItemState(RES_BOX, 
false, &pItem));
+auto pBox = static_cast(pItem);
+CPPUNIT_ASSERT(pBox);
+for (auto eLine : { SvxBoxItemLine::TOP, SvxBoxItemLine::BOTTOM,
+SvxBoxItemLine::LEFT, SvxBoxItemLine::RIGHT })
+{
+CPPUNIT_ASSERT_EQUAL(sal_uInt16(0), pBox->GetDistance(eLine));
+CPPUNIT_ASSERT(!pBox->GetLine(eLine));
+}
+}
+}
+
 // tests should only be added to ww8IMPORT *if* they fail round-tripping in 
ww8EXPORT
 
 CPPUNIT_PLUGIN_IMPLEMENT();
diff --git a/sw/source/filter/ww8/ww8par.cxx b/sw/source/filter/ww8/ww8par.cxx
index bc5b7a864c98..612d0c200958 100644
--- a/sw/source/filter/ww8/ww8par.cxx
+++ b/sw/source/filter/ww8/ww8par.cxx
@@ -6333,12 +6333,8 @@ ErrCode WW8Reader::Read(SwDoc &rDoc, const OUString& 
rBaseURL, SwPaM &rPaM, cons
 rBaseURL, bNew, m_bSkipImages, *rPaM.GetPoint()));
 if (bNew)
 {
-// Remove Frame and offsets from Frame Templ

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

2019-06-18 Thread Mike Kaganski (via logerrit)
 sc/qa/unit/data/ods/pivot-table-str-and-err-in-data.ods |binary
 sc/qa/unit/pivottable_filters_test.cxx  |   29 
 sc/source/filter/excel/xepivotxml.cxx   |7 ++-
 3 files changed, 34 insertions(+), 2 deletions(-)

New commits:
commit f1d3eb7573352d9da591ccadec21f49e1a5f8cb6
Author: Mike Kaganski 
AuthorDate: Fri Mar 8 14:01:03 2019 +0300
Commit: Mike Kaganski 
CommitDate: Tue Jun 18 15:00:12 2019 +0200

tdf#123939: string and error are same type for pivot cache in XLSX

Change-Id: Id39d322661f7537e8999acafee655c0cc16a78c1
Reviewed-on: https://gerrit.libreoffice.org/68911
Tested-by: Jenkins
Reviewed-by: Mike Kaganski 
Reviewed-on: https://gerrit.libreoffice.org/74277
Tested-by: Mike Kaganski 

diff --git a/sc/qa/unit/data/ods/pivot-table-str-and-err-in-data.ods 
b/sc/qa/unit/data/ods/pivot-table-str-and-err-in-data.ods
new file mode 100644
index ..9c58dc8958ae
Binary files /dev/null and 
b/sc/qa/unit/data/ods/pivot-table-str-and-err-in-data.ods differ
diff --git a/sc/qa/unit/pivottable_filters_test.cxx 
b/sc/qa/unit/pivottable_filters_test.cxx
index c2546bc29cb7..a476e0d7b450 100644
--- a/sc/qa/unit/pivottable_filters_test.cxx
+++ b/sc/qa/unit/pivottable_filters_test.cxx
@@ -88,6 +88,7 @@ public:
 void testPivotTableDuplicateFields();
 void testTdf112106();
 void testTdf123923();
+void testTdf123939();
 
 CPPUNIT_TEST_SUITE(ScPivotTableFiltersTest);
 
@@ -130,6 +131,7 @@ public:
 CPPUNIT_TEST(testPivotTableDuplicateFields);
 CPPUNIT_TEST(testTdf112106);
 CPPUNIT_TEST(testTdf123923);
+CPPUNIT_TEST(testTdf123939);
 
 CPPUNIT_TEST_SUITE_END();
 
@@ -2414,6 +2416,33 @@ void ScPivotTableFiltersTest::testTdf123923()
 "v", "#REF!");
 }
 
+void ScPivotTableFiltersTest::testTdf123939()
+{
+// tdf#123939: Excel warns on containsMixedTypes="1" if sharedItems has 
only strings and errors
+
+ScDocShellRef xShell = loadDoc("pivot-table-str-and-err-in-data.", 
FORMAT_ODS);
+CPPUNIT_ASSERT(xShell.is());
+
+std::shared_ptr pXPathFile
+= ScBootstrapFixture::exportTo(&(*xShell), FORMAT_XLSX);
+xmlDocPtr pTable = XPathHelper::parseExport(pXPathFile, m_xSFactory,
+
"xl/pivotCache/pivotCacheDefinition1.xml");
+CPPUNIT_ASSERT(pTable);
+
+assertXPathNoAttribute(pTable,
+   
"/x:pivotCacheDefinition/x:cacheFields/x:cacheField[1]/x:sharedItems",
+   "containsMixedTypes");
+
+// But we must emit containsMixedTypes="1" for a mix of errors and 
non-string types!
+
+pTable = XPathHelper::parseExport(pXPathFile, m_xSFactory,
+  
"xl/pivotCache/pivotCacheDefinition2.xml");
+CPPUNIT_ASSERT(pTable);
+
+assertXPath(pTable, 
"/x:pivotCacheDefinition/x:cacheFields/x:cacheField[1]/x:sharedItems",
+"containsMixedTypes", "1");
+}
+
 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 611078fa4ec1..41fa2161f9c2 100644
--- a/sc/source/filter/excel/xepivotxml.cxx
+++ b/sc/source/filter/excel/xepivotxml.cxx
@@ -266,6 +266,9 @@ void XclExpXmlPivotCaches::SavePivotCacheXml( 
XclExpXmlStream& rStrm, const Entr
 for (; it != itEnd; ++it)
 {
 ScDPItemData::Type eType = it->GetType();
+// tdf#123939 : error and string are same for cache; if both are 
present, keep only one
+if (eType == ScDPItemData::Error)
+eType = ScDPItemData::String;
 aDPTypes.insert(eType);
 if (eType == ScDPItemData::Value)
 {
@@ -291,8 +294,8 @@ void XclExpXmlPivotCaches::SavePivotCacheXml( 
XclExpXmlStream& rStrm, const Entr
 std::set aDPTypesWithoutBlank = aDPTypes;
 aDPTypesWithoutBlank.erase(ScDPItemData::Empty);
 
-bool isContainsString = 
aDPTypesWithoutBlank.find(ScDPItemData::String) != aDPTypesWithoutBlank.end() ||
-aDPTypesWithoutBlank.find(ScDPItemData::Error) 
!= aDPTypesWithoutBlank.end();
+const bool isContainsString
+= aDPTypesWithoutBlank.find(ScDPItemData::String) != 
aDPTypesWithoutBlank.end();
 bool isContainsBlank = aDPTypes.find(ScDPItemData::Empty) != 
aDPTypeEnd;
 bool isContainsNumber = !isContainsDate && 
aDPTypesWithoutBlank.find(ScDPItemData::Value) != aDPTypesWithoutBlank.end();
 bool isContainsNonDate = !(isContainsDate && 
aDPTypesWithoutBlank.size() <= 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.2' - sfx2/source

2019-06-18 Thread Mike Kaganski (via logerrit)
 sfx2/source/doc/docfile.cxx |3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

New commits:
commit fda87834ae29dd0cba6cfc420c97ea79593c4738
Author: Mike Kaganski 
AuthorDate: Tue Dec 18 02:51:31 2018 +0100
Commit: Mike Kaganski 
CommitDate: Tue Jun 18 15:12:21 2019 +0200

tdf#116320: properly decode file name for File Locked dialog

Change-Id: I51bd7c6695ef52b08e0b6d809160d74daebb8505
Reviewed-on: https://gerrit.libreoffice.org/65298
Tested-by: Jenkins
Reviewed-by: Mike Kaganski 
(cherry picked from commit 8dc3fe631583228fe5bb49b44d2308470ec30df0)
Reviewed-on: https://gerrit.libreoffice.org/74278
Tested-by: Mike Kaganski 

diff --git a/sfx2/source/doc/docfile.cxx b/sfx2/source/doc/docfile.cxx
index dd1ff394894b..08848fd6808d 100644
--- a/sfx2/source/doc/docfile.cxx
+++ b/sfx2/source/doc/docfile.cxx
@@ -995,7 +995,8 @@ SfxMedium::ShowLockResult 
SfxMedium::ShowLockedDocumentDialog(const OUString& aD
 
 if ( ::svt::DocumentLockFile::IsInteractionAllowed() && xHandler.is() && ( 
bIsLoading || !bHandleSysLocked || bOwnLock ) )
 {
-OUString aDocumentURL = GetURLObject().GetLastName();
+OUString aDocumentURL
+= 
GetURLObject().GetLastName(INetURLObject::DecodeMechanism::WithCharset);
 OUString aInfo;
 ::rtl::Reference< ::ucbhelper::InteractionRequest > 
xInteractionRequestImpl;
 
___
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' - chart2/qa sc/qa sw/qa test/source

2019-06-18 Thread Mike Kaganski (via logerrit)
 chart2/qa/extras/chart2export.cxx |7 +--
 sc/qa/unit/subsequent_export-test.cxx |8 +---
 sw/qa/extras/ooxmlexport/ooxmlexport3.cxx |   18 --
 sw/qa/extras/ooxmlexport/ooxmlexport4.cxx |   10 +++---
 sw/qa/extras/ooxmlexport/ooxmlexport5.cxx |3 ++-
 sw/qa/extras/ooxmlexport/ooxmlexport6.cxx |3 ++-
 sw/qa/extras/ooxmlexport/ooxmlexport9.cxx |2 +-
 test/source/xmltesttools.cxx  |3 +++
 8 files changed, 37 insertions(+), 17 deletions(-)

New commits:
commit a57691e297427f857ca8daecba26293c5203960d
Author: Mike Kaganski 
AuthorDate: Wed Apr 10 15:18:07 2019 +0300
Commit: Mike Kaganski 
CommitDate: Tue Jun 18 17:32:34 2019 +0200

XmlTestTools::getXPath now asserts that non-empty attribute exists

It turns out that this change revealed unit tests written incorrectly
(and untested), or maybe which became broken (not testing) because of
some previous assertXPath change? They incorrectly used 3-arg form of
it to check node content equality to passed string, while in fact, an
attribute was looked for with that name, and its empty return tested
to match default empty 4th argument.

Change-Id: If24e18518543102d115a22a6282e4cca9cf694e2
Reviewed-on: https://gerrit.libreoffice.org/70581
Reviewed-by: Mike Kaganski 
Tested-by: Mike Kaganski 
Reviewed-on: https://gerrit.libreoffice.org/74296

diff --git a/chart2/qa/extras/chart2export.cxx 
b/chart2/qa/extras/chart2export.cxx
index 839ef8c71752..3d502039d5b1 100644
--- a/chart2/qa/extras/chart2export.cxx
+++ b/chart2/qa/extras/chart2export.cxx
@@ -554,7 +554,10 @@ void Chart2ExportTest::testStockChart()
 
 assertXPath(pXmlDoc, 
"/c:chartSpace/c:chart/c:plotArea/c:stockChart/c:ser[1]/c:idx", "val", "1");
 assertXPath(pXmlDoc, 
"/c:chartSpace/c:chart/c:plotArea/c:stockChart/c:ser[1]/c:order", "val", "1");
-assertXPath(pXmlDoc, 
"/c:chartSpace/c:chart/c:plotArea/c:stockChart/c:ser[1]/c:tx/c:strRef/c:strCache/c:pt/c:v",
 "Open");
+assertXPathContent(
+pXmlDoc,
+
"/c:chartSpace/c:chart/c:plotArea/c:stockChart/c:ser[1]/c:tx/c:strRef/c:strCache/c:pt/c:v",
+"Open");
 }
 
 void Chart2ExportTest::testBarChart()
@@ -710,7 +713,7 @@ void Chart2ExportTest::testDoughnutChart()
 xmlDocPtr pXmlDoc = parseExport("word/charts/chart", "Office Open XML 
Text");
 CPPUNIT_ASSERT(pXmlDoc);
 
-assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:doughnutChart", 
"1");
+assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:doughnutChart");
 }
 
 void Chart2ExportTest::testDisplayUnits()
diff --git a/sc/qa/unit/subsequent_export-test.cxx 
b/sc/qa/unit/subsequent_export-test.cxx
index 22851e9b5f5f..e7656233f979 100644
--- a/sc/qa/unit/subsequent_export-test.cxx
+++ b/sc/qa/unit/subsequent_export-test.cxx
@@ -716,10 +716,11 @@ void ScExportTest::testCommentExportXLSX()
 = XPathHelper::parseExport(pXPathFile, m_xSFactory, 
"xl/comments1.xml");
 CPPUNIT_ASSERT(pComments);
 
-assertXPath(pComments, "/x:comments/x:authors/x:author[1]", "BAKO");
+assertXPathContent(pComments, "/x:comments/x:authors/x:author[1]", "BAKO");
 assertXPath(pComments, "/x:comments/x:authors/x:author", 1);
 
-assertXPath(pComments, 
"/x:comments/x:commentList/x:comment/x:text/x:r/x:t", "Komentarz");
+assertXPathContent(pComments, 
"/x:comments/x:commentList/x:comment/x:text/x:r/x:t",
+   "Komentarz");
 
 const xmlDocPtr pVmlDrawing
 = XPathHelper::parseExport(pXPathFile, m_xSFactory, 
"xl/drawings/vmlDrawing1.vml");
@@ -757,7 +758,8 @@ void ScExportTest::testCommentExportXLSX_2_XLSX()
 = XPathHelper::parseExport(pXPathFile, m_xSFactory, 
"xl/comments1.xml");
 CPPUNIT_ASSERT(pComments);
 
-assertXPath(pComments, 
"/x:comments/x:commentList/x:comment/x:text/x:r/x:t", "visible comment");
+assertXPathContent(pComments, 
"/x:comments/x:commentList/x:comment/x:text/x:r/x:t",
+   "visible comment");
 
 const xmlDocPtr pVmlDrawing
 = XPathHelper::parseExport(pXPathFile, m_xSFactory, 
"xl/drawings/vmlDrawing1.vml");
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport3.cxx 
b/sw/qa/extras/ooxmlexport/ooxmlexport3.cxx
index 494a6791e85e..91301b44858d 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport3.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport3.cxx
@@ -714,8 +714,10 @@ DECLARE_OOXMLEXPORT_TEST(testParaAutoSpacing, 
"para-auto-spacing.docx")
 assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:pPr/w:spacing", 
"beforeAutospacing","1");
 assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:pPr/w:spacing", 
"afterAutospacing","1");
 
-assertXPath(pXmlDoc, "/w:document/w:body/w:p[2]/w:pPr/w:spacing", 
"beforeAutospacing","");
-assertXPath(pXmlDoc, "/w:document/w:body/w:p[2]/w:pPr/w:spacing", 
"afterAutospacing","");
+assertXPathNoAttribute(pXmlDoc, 
"/w:document/w:body/w:p[2]/w:pPr/w:spacing",
+   

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

2019-06-18 Thread Mike Kaganski (via logerrit)
 sw/qa/extras/ooxmlexport/ooxmlexport9.cxx |4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

New commits:
commit 9bf161ea08e7432dcfb76feda4e57bebf91f8cf4
Author: Mike Kaganski 
AuthorDate: Thu Apr 11 23:35:13 2019 +0300
Commit: Mike Kaganski 
CommitDate: Wed Jun 19 04:16:11 2019 +0200

f315fee54eee57e6e55e5fcacf2522534682c2ce follow-up: fix tdf#109310 unit test

The test should guarantee presense of w:val attribute of w:rStyle element.
Turns out we must not use w: namespace before attribute name; likely it
is true when attribute namespace is the same as of its element.

Change-Id: I28e2936b51f039473326c6debf4b5559e2baf24c
Reviewed-on: https://gerrit.libreoffice.org/70612
Tested-by: Jenkins
Reviewed-by: Mike Kaganski 
(cherry picked from commit 735964c39097ff952fcaffee6b35c79e210c019c)
Reviewed-on: https://gerrit.libreoffice.org/74326
Tested-by: Mike Kaganski 

diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport9.cxx 
b/sw/qa/extras/ooxmlexport/ooxmlexport9.cxx
index 4a3b1a0c412d..a44c8f78d9cf 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport9.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport9.cxx
@@ -488,7 +488,9 @@ DECLARE_OOXMLEXPORT_TEST(testTdf109310_endnoteStyleForMSO, 
"tdf109310_endnoteSty
 xmlDocPtr pXmlDoc = parseExport("word/endnotes.xml");
 if (!pXmlDoc)
 return;
-//assertXPath(pXmlDoc, 
"/w:endnotes/w:endnote[@w:id='2']/w:p/w:r[1]/w:rPr/w:rStyle", "w:val"); // what 
does it test?
+// Check w:rStyle element has w:val attribute - note that w: is not 
specified for attribute
+assertXPath(pXmlDoc, 
"/w:endnotes/w:endnote[@w:id='2']/w:p/w:r[1]/w:rPr/w:rStyle", "val",
+"EndnoteCharacters");
 }
 
 DECLARE_OOXMLEXPORT_TEST(testTdf103389, "tdf103389.docx")
___
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/qa sc/source

2019-06-18 Thread Mike Kaganski (via logerrit)
 sc/qa/unit/data/ods/tdf124651_simplePivotTable.ods |binary
 sc/qa/unit/pivottable_filters_test.cxx |   15 +++
 sc/source/filter/excel/xepivotxml.cxx  |7 +--
 3 files changed, 20 insertions(+), 2 deletions(-)

New commits:
commit 8c800d3cc9541a28e665707bda0bf68d81a3269b
Author: Mike Kaganski 
AuthorDate: Wed Apr 10 15:18:07 2019 +0300
Commit: Mike Kaganski 
CommitDate: Wed Jun 19 07:08:45 2019 +0200

tdf#124651: always write "name" attribute to dataField element

Despite being optional as per ECMA-376-1:2016, Excel 2016 seems to
require the presence of "name" attribute in dataField element of
pivot table definition, so make sure to write at least empty string
there.

Change-Id: Iaab5674f86b7dd0b267776678e11af47086635d7
Reviewed-on: https://gerrit.libreoffice.org/70522
Reviewed-by: Mike Kaganski 
Tested-by: Mike Kaganski 
Reviewed-on: https://gerrit.libreoffice.org/74327

diff --git a/sc/qa/unit/data/ods/tdf124651_simplePivotTable.ods 
b/sc/qa/unit/data/ods/tdf124651_simplePivotTable.ods
new file mode 100644
index ..05fd5fec838f
Binary files /dev/null and b/sc/qa/unit/data/ods/tdf124651_simplePivotTable.ods 
differ
diff --git a/sc/qa/unit/pivottable_filters_test.cxx 
b/sc/qa/unit/pivottable_filters_test.cxx
index a476e0d7b450..2c3448b78cfc 100644
--- a/sc/qa/unit/pivottable_filters_test.cxx
+++ b/sc/qa/unit/pivottable_filters_test.cxx
@@ -89,6 +89,7 @@ public:
 void testTdf112106();
 void testTdf123923();
 void testTdf123939();
+void testTdf124651();
 
 CPPUNIT_TEST_SUITE(ScPivotTableFiltersTest);
 
@@ -132,6 +133,7 @@ public:
 CPPUNIT_TEST(testTdf112106);
 CPPUNIT_TEST(testTdf123923);
 CPPUNIT_TEST(testTdf123939);
+CPPUNIT_TEST(testTdf124651);
 
 CPPUNIT_TEST_SUITE_END();
 
@@ -2443,6 +2445,19 @@ void ScPivotTableFiltersTest::testTdf123939()
 "containsMixedTypes", "1");
 }
 
+void ScPivotTableFiltersTest::testTdf124651()
+{
+ScDocShellRef xDocSh = loadDoc("tdf124651_simplePivotTable.", FORMAT_ODS);
+CPPUNIT_ASSERT(xDocSh.is());
+
+xmlDocPtr pDoc = XPathHelper::parseExport2(*this, *xDocSh, m_xSFactory,
+"xl/pivotTables/pivotTable1.xml", FORMAT_XLSX);
+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", "");
+}
+
 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 41fa2161f9c2..5538bd8770b1 100644
--- a/sc/source/filter/excel/xepivotxml.cxx
+++ b/sc/source/filter/excel/xepivotxml.cxx
@@ -968,9 +968,12 @@ void XclExpXmlPivotTables::SavePivotTableXml( 
XclExpXmlStream& rStrm, const ScDP
 assert(aCachedDims[nDimIdx]); // the loop above should have 
screened for NULL's.
 const ScDPSaveDimension& rDim = *it->mpDim;
 const 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() : "";
 pPivotStrm->write("<")->writeId(XML_dataField);
-if (pName)
-rStrm.WriteAttributes(XML_name, 
XclXmlUtils::ToOString(*pName), FSEND);
+rStrm.WriteAttributes(XML_name, sName, FSEND);
 
 rStrm.WriteAttributes(XML_fld, OString::number(nDimIdx).getStr(), 
FSEND);
 
___
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/inc sc/qa sc/source

2019-06-18 Thread Mike Kaganski (via logerrit)
 sc/inc/dputil.hxx  |2 
 sc/qa/unit/pivottable_filters_test.cxx |  167 +
 sc/source/core/data/dpobject.cxx   |5 
 sc/source/filter/excel/xepivotxml.cxx  |  120 ++-
 4 files changed, 208 insertions(+), 86 deletions(-)

New commits:
commit b4f61d5bb36130198a83a8cdcf060ebddea07b23
Author: Mike Kaganski 
AuthorDate: Fri Mar 22 14:06:19 2019 +0300
Commit: Mike Kaganski 
CommitDate: Wed Jun 19 07:09:02 2019 +0200

tdf#113908: Implement exporting pivot tables' groups fields to XSLX

Two tests in sc/qa/unit/pivottable_filters_test.cxx were extended
to also test round-trip of group fields in XLSX.

Change-Id: I70b7c15b09040c64fa1da2f88001af7ba16f2c6f
Reviewed-on: https://gerrit.libreoffice.org/69653
Tested-by: Jenkins
Reviewed-by: Mike Kaganski 
Reviewed-on: https://gerrit.libreoffice.org/70687
Tested-by: Mike Kaganski 
Reviewed-on: https://gerrit.libreoffice.org/74328

diff --git a/sc/inc/dputil.hxx b/sc/inc/dputil.hxx
index b2539a159bce..735843b84578 100644
--- a/sc/inc/dputil.hxx
+++ b/sc/inc/dputil.hxx
@@ -33,7 +33,7 @@ public:
 
 SC_DLLPUBLIC static OUString createDuplicateDimensionName(const OUString& 
rOriginal, size_t nDupCount);
 
-static OUString getDateGroupName(
+SC_DLLPUBLIC static OUString getDateGroupName(
 sal_Int32 nDatePart, sal_Int32 nValue, SvNumberFormatter* pFormatter,
 double fStart, double fEnd);
 
diff --git a/sc/qa/unit/pivottable_filters_test.cxx 
b/sc/qa/unit/pivottable_filters_test.cxx
index 2c3448b78cfc..84ad5eade972 100644
--- a/sc/qa/unit/pivottable_filters_test.cxx
+++ b/sc/qa/unit/pivottable_filters_test.cxx
@@ -53,8 +53,8 @@ public:
 void testPivotTableSharedCacheGroupODS();
 void testGetPivotDataXLS();
 void testPivotTableSharedGroupXLSX();
-void testPivotTableSharedDateGroupXLSX();
-void testPivotTableSharedNestedDateGroupXLSX();
+void testPivotTableSharedDateGroupXLSX(); // + export
+void testPivotTableSharedNestedDateGroupXLSX(); // + export
 void testPivotTableSharedNumGroupXLSX();
 void testPivotTableNoColumnsLayout();
 void testTdf112501();
@@ -532,86 +532,99 @@ void 
ScPivotTableFiltersTest::testPivotTableSharedGroupXLSX()
 
 void ScPivotTableFiltersTest::testPivotTableSharedDateGroupXLSX()
 {
-ScDocShellRef xDocSh = loadDoc("pivot-table/shared-dategroup.", 
FORMAT_XLSX);
-CPPUNIT_ASSERT_MESSAGE("Failed to load file", xDocSh.is());
-ScDocument& rDoc = xDocSh->GetDocument();
-
-// Check whether right date labels are imported for both tables
-// First table
-CPPUNIT_ASSERT_EQUAL(OUString("a"), rDoc.GetString(ScAddress(0, 3, 1)));
-CPPUNIT_ASSERT_EQUAL(OUString("1965"), rDoc.GetString(ScAddress(0, 4, 1)));
-CPPUNIT_ASSERT_EQUAL(OUString("1989"), rDoc.GetString(ScAddress(0, 5, 1)));
-CPPUNIT_ASSERT_EQUAL(OUString("2000"), rDoc.GetString(ScAddress(0, 6, 1)));
-CPPUNIT_ASSERT_EQUAL(OUString("2004"), rDoc.GetString(ScAddress(0, 7, 1)));
-// TODO: check why this fails with 2005
-// CPPUNIT_ASSERT_EQUAL(OUString("2007"), 
rDoc.GetString(ScAddress(0,8,1)));
-
-// Second table
-CPPUNIT_ASSERT_EQUAL(OUString("a"), rDoc.GetString(ScAddress(5, 3, 1)));
-CPPUNIT_ASSERT_EQUAL(OUString("1965"), rDoc.GetString(ScAddress(5, 4, 1)));
-CPPUNIT_ASSERT_EQUAL(OUString("1989"), rDoc.GetString(ScAddress(5, 5, 1)));
-CPPUNIT_ASSERT_EQUAL(OUString("2000"), rDoc.GetString(ScAddress(5, 6, 1)));
-CPPUNIT_ASSERT_EQUAL(OUString("2004"), rDoc.GetString(ScAddress(5, 7, 1)));
-// TODO: check why this fails with 2005
-// CPPUNIT_ASSERT_EQUAL(OUString("2007"), 
rDoc.GetString(ScAddress(5,8,1)));
-
-// There should be exactly 2 pivot tables and 1 cache.
-ScDPCollection* pDPs = rDoc.GetDPCollection();
-CPPUNIT_ASSERT_EQUAL(static_cast(2), pDPs->GetCount());
-
-ScDPCollection::SheetCaches& rSheetCaches = pDPs->GetSheetCaches();
-CPPUNIT_ASSERT_EQUAL(static_cast(1), rSheetCaches.size());
-
-const ScDPCache* pCache = rSheetCaches.getExistingCache(ScRange(0, 0, 0, 
9, 24, 0));
-CPPUNIT_ASSERT_MESSAGE("Pivot cache is expected for A1:J25 on the first 
sheet.", pCache);
-CPPUNIT_ASSERT_EQUAL(static_cast(10), pCache->GetFieldCount());
-
-xDocSh->DoClose();
+auto testThis = [](ScDocShellRef& xDocSh) {
+CPPUNIT_ASSERT_MESSAGE("Failed to load file", xDocSh.is());
+ScDocument& rDoc = xDocSh->GetDocument();
+
+// Check whether right date labels are imported for both tables
+// First table
+CPPUNIT_ASSERT_EQUAL(OUString("a"), rDoc.GetString(ScAddress(0, 3, 
1)));
+CPPUNIT_ASSERT_EQUAL(OUString("1965"), rDoc.GetString(ScAddress(0, 4, 
1)));
+CPPUNIT_ASSERT_EQUAL(OUString("1989"), rDoc.GetString(ScAddress(0, 5, 
1)));
+CPPUNIT_ASSERT_EQUAL(OUString("2000"), rDoc.GetString(ScAddress(0, 6, 
1)));
+CPPUNIT_ASSERT_EQUAL(OUString("2004"), r

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

2019-06-18 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 acdc657d0c1f9d03c8162104f2d5ead37343f07f
Author: Mike Kaganski 
AuthorDate: Mon Apr 15 23:33:38 2019 +0300
Commit: Mike Kaganski 
CommitDate: Wed Jun 19 07:27:15 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 
Reviewed-on: https://gerrit.libreoffice.org/74329

diff --git a/sc/qa/unit/pivottable_filters_test.cxx 
b/sc/qa/unit/pivottable_filters_test.cxx
index 84ad5eade972..5f546875af94 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();
 
@@ -2471,6 +2473,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 e6af90295288..c1e46ef1c5ee 100644
--- a/sc/source/filter/excel/xepivotxml.cxx
+++ b/sc/source/filter/excel/xepivotxml.cxx
@@ -200,7 +200,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
+

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

2019-06-19 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 81b36be47f103c267da30a2c300fd14b6a278c56
Author: Mike Kaganski 
AuthorDate: Wed Apr 17 11:11:58 2019 +0300
Commit: Mike Kaganski 
CommitDate: Wed Jun 19 09:20:42 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 
Reviewed-on: https://gerrit.libreoffice.org/74334

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 5f546875af94..62147268b047 100644
--- a/sc/qa/unit/pivottable_filters_test.cxx
+++ b/sc/qa/unit/pivottable_filters_test.cxx
@@ -91,6 +91,7 @@ public:
 void testTdf123939();
 void testTdf124651();
 void testTdf124736();
+void tesTtdf124772NumFmt();
 
 CPPUNIT_TEST_SUITE(ScPivotTableFiltersTest);
 
@@ -136,6 +137,7 @@ public:
 CPPUNIT_TEST(testTdf123939);
 CPPUNIT_TEST(testTdf124651);
 CPPUNIT_TEST(testTdf124736);
+CPPUNIT_TEST(tesTtdf124772NumFmt);
 
 CPPUNIT_TEST_SUITE_END();
 
@@ -2527,6 +2529,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 c1e46ef1c5ee..c866c690a3c3 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,11 +26,13 @@
 #include 
 #include 
 
+#include 
 #include 
 #include 
 #include 
 #include 
 #include 
+#include 
 
 #include 
 
@@ -1080,6 +1085,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);
@@ -1095,17 +1104,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-

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

2019-06-19 Thread Mike Kaganski (via logerrit)
 sc/inc/dpobject.hxx |   17 ++
 sc/qa/unit/data/xlsx/pivot_dark1.xlsx   |binary
 sc/qa/unit/pivottable_filters_test.cxx  |   47 
 sc/source/core/data/dpobject.cxx|3 +
 sc/source/filter/excel/xepivotxml.cxx   |   40 +++
 sc/source/filter/inc/pivottablebuffer.hxx   |3 +
 sc/source/filter/oox/pivottablebuffer.cxx   |   16 +
 sc/source/filter/oox/pivottablefragment.cxx |3 +
 8 files changed, 129 insertions(+)

New commits:
commit c2eac244912a7de8637befe62387916d3fdc1f89
Author: Mike Kaganski 
AuthorDate: Thu Apr 18 15:41:03 2019 +0300
Commit: Mike Kaganski 
CommitDate: Wed Jun 19 10:01:10 2019 +0200

tdf#124810: Roundtrip pivot table style info from XLSX.

Also provide a default pivot table style for those tables that don't
have a style info. Let's use the style settings that Excel uses.

Change-Id: I8006a33a0aa0e92629f7db0a9c24a6ff52d17945
Reviewed-on: https://gerrit.libreoffice.org/70933
Tested-by: Jenkins
Reviewed-by: Mike Kaganski 
Reviewed-on: https://gerrit.libreoffice.org/74335
Tested-by: Mike Kaganski 

diff --git a/sc/inc/dpobject.hxx b/sc/inc/dpobject.hxx
index 9be63f26db36..4d0011c17868 100644
--- a/sc/inc/dpobject.hxx
+++ b/sc/inc/dpobject.hxx
@@ -95,6 +95,11 @@ private:
 // cached data
 css::uno::Reference xSource;
 std::unique_ptr pOutput;
+
+// name -> sequence of sequences of css::xml::FastAttribute or 
css::xml::Attribute
+// see PivotTable::putToInteropGrabBag in 
sc/source/filter/oox/pivottablebuffer.cxx for details
+std::map maInteropGrabBag;
+
 longnHeaderRows;// page fields plus filter button
 boolmbHeaderLayout:1;  // true : grid, false : standard
 boolbAllowMove:1;
@@ -253,6 +258,18 @@ public:
 
 static bool IsOrientationAllowed( 
css::sheet::DataPilotFieldOrientation nOrient, sal_Int32 nDimFlags );
 
+void PutInteropGrabBag(std::map&& val)
+{
+maInteropGrabBag = std::move(val);
+}
+std::pair GetInteropGrabBagValue(const OUString& 
sName) const
+{
+if (const auto it = maInteropGrabBag.find(sName); it != 
maInteropGrabBag.end())
+return { true, it->second };
+
+return { false, css::uno::Any() };
+}
+
 #if DUMP_PIVOT_TABLE
 void Dump() const;
 void DumpCache() const;
diff --git a/sc/qa/unit/data/xlsx/pivot_dark1.xlsx 
b/sc/qa/unit/data/xlsx/pivot_dark1.xlsx
new file mode 100644
index ..8341e5b09d6d
Binary files /dev/null and b/sc/qa/unit/data/xlsx/pivot_dark1.xlsx differ
diff --git a/sc/qa/unit/pivottable_filters_test.cxx 
b/sc/qa/unit/pivottable_filters_test.cxx
index 62147268b047..b0868a5db88f 100644
--- a/sc/qa/unit/pivottable_filters_test.cxx
+++ b/sc/qa/unit/pivottable_filters_test.cxx
@@ -92,6 +92,7 @@ public:
 void testTdf124651();
 void testTdf124736();
 void tesTtdf124772NumFmt();
+void testTdf124810();
 
 CPPUNIT_TEST_SUITE(ScPivotTableFiltersTest);
 
@@ -138,6 +139,7 @@ public:
 CPPUNIT_TEST(testTdf124651);
 CPPUNIT_TEST(testTdf124736);
 CPPUNIT_TEST(tesTtdf124772NumFmt);
+CPPUNIT_TEST(testTdf124810);
 
 CPPUNIT_TEST_SUITE_END();
 
@@ -2554,6 +2556,51 @@ void ScPivotTableFiltersTest::tesTtdf124772NumFmt()
 "formatCode", "\\$#,##0");
 }
 
+void ScPivotTableFiltersTest::testTdf124810()
+{
+{
+// First, test that we roundtrip existing pivot table style 
information from XLSX.
+ScDocShellRef xDocSh = loadDoc("pivot_dark1.", 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);
+
+// All attributes must have been roundtripped correctly (testdoc uses 
some non-default values)
+assertXPath(pTable, "/x:pivotTableDefinition/x:pivotTableStyleInfo", 
"name",
+"PivotStyleDark1");
+assertXPath(pTable, "/x:pivotTableDefinition/x:pivotTableStyleInfo", 
"showRowHeaders", "1");
+assertXPath(pTable, "/x:pivotTableDefinition/x:pivotTableStyleInfo", 
"showColHeaders", "1");
+assertXPath(pTable, "/x:pivotTableDefinition/x:pivotTableStyleInfo", 
"showRowStripes", "1");
+assertXPath(pTable, "/x:pivotTableDefinition/x:pivotTableStyleInfo", 
"showColStripes", "0");
+assertXPath(pTable, "/x:pivotTableDefinition/x:pivotTableStyleInfo", 
"showLastColumn", "0");
+}
+
+{
+// Now check that we export default style information when there's no 
such information in
+// original document. Just use some ODS as source. This might be 
changed when we start
+// exporting better pivot table style information.
+ScDocShellRef xD

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

2019-06-19 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 c50a1c814b89f84aad04bb5cfb15be5f648bfcf6
Author: Mike Kaganski 
AuthorDate: Sat Apr 20 17:36:51 2019 +0300
Commit: Mike Kaganski 
CommitDate: Wed Jun 19 11:04:00 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/74340
Tested-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(&sPath.pData);
+INetURLObject aPathUrl(sPath);
+

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

2019-06-19 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 5c07424ea9ca514a4c42a615adf7faa7b8372a05
Author: Mike Kaganski 
AuthorDate: Mon Apr 22 12:16:38 2019 +0300
Commit: Mike Kaganski 
CommitDate: Wed Jun 19 11:46:01 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/74344
Tested-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 b0868a5db88f..17d5b32c3a2a 100644
--- a/sc/qa/unit/pivottable_filters_test.cxx
+++ b/sc/qa/unit/pivottable_filters_test.cxx
@@ -2474,7 +2474,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 cfa173cca627..e3b39e0dafe9 100644
--- a/sc/source/filter/excel/xepivotxml.cxx
+++ b/sc/source/filter/excel/xepivotxml.cxx
@@ -1130,13 +1130,16 @@ void XclExpXmlPivotTables::SavePivotTableXml( 
XclExpXmlStream& rStrm, const ScDP
 long nDimIdx = it->mnPos;
 assert(aCachedDims[nDimIdx]); // the loop above should have 
screened for NULL's.
 const ScDPSaveDimension& rDim = *it->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: Branch 'distro/collabora/cp-6.2' - sc/qa sc/source

2019-06-19 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 25bc89e2d8d6ab62e5fae24ecd50f642a87a73c2
Author: Mike Kaganski 
AuthorDate: Mon Apr 22 14:56:07 2019 +0300
Commit: Mike Kaganski 
CommitDate: Wed Jun 19 11:55:39 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 
(cherry picked from commit 7f6a6664a1f3a37a97d02d5f0894300aff0d8db5)
Reviewed-on: https://gerrit.libreoffice.org/74347
Tested-by: Mike Kaganski 

diff --git a/sc/qa/unit/pivottable_filters_test.cxx 
b/sc/qa/unit/pivottable_filters_test.cxx
index 17d5b32c3a2a..5e886036aecb 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();
 
@@ -2602,6 +2604,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 c23b0a039ee8..503ed2e6e7b4 100644
--- a/sc/source/filter/oox/pivottablebuffer.cxx
+++ b/sc/source/filter/oox/pivottablebuffer.cxx
@@ -575,6 +575,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 3a56fb138e25..bc15fc632df2 100644
--- a/sc/source/ui/unoobj/dapiuno.cxx
+++ b/sc/source/ui/unoobj/dapiuno.cxx
@@ -1921,6 +1921,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 )
@@ -2010,6 +2016,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.2' - sc/qa sc/source

2019-06-19 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 149fac648bd78578c2e6a0275bf832053721dcd3
Author: Mike Kaganski 
AuthorDate: Tue Apr 23 15:59:24 2019 +0300
Commit: Mike Kaganski 
CommitDate: Wed Jun 19 12:16:49 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/74348

diff --git a/sc/qa/unit/subsequent_export-test.cxx 
b/sc/qa/unit/subsequent_export-test.cxx
index e7656233f979..305fbced21e0 100644
--- a/sc/qa/unit/subsequent_export-test.cxx
+++ b/sc/qa/unit/subsequent_export-test.cxx
@@ -779,80 +779,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. Column

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

2019-06-19 Thread Mike Kaganski (via logerrit)
 sc/qa/unit/data/xlsx/pivottable_long_text.xlsx |binary
 sc/qa/unit/pivottable_filters_test.cxx |   14 ++
 sc/source/filter/excel/xepivotxml.cxx  |   11 +++
 3 files changed, 25 insertions(+)

New commits:
commit 7f0813c2c352529bfafd544edb260048e8828f03
Author: Mike Kaganski 
AuthorDate: Tue Apr 30 16:45:54 2019 +0300
Commit: Mike Kaganski 
CommitDate: Wed Jun 19 12:39:47 2019 +0200

tdf#125046: export longText attribute for sharedItems element

Change-Id: Id727f10763bc5017eeb3e267b425d6013786d6a2
Reviewed-on: https://gerrit.libreoffice.org/71585
Tested-by: Jenkins
Reviewed-by: Mike Kaganski 
Reviewed-on: https://gerrit.libreoffice.org/74349
Tested-by: Mike Kaganski 

diff --git a/sc/qa/unit/data/xlsx/pivottable_long_text.xlsx 
b/sc/qa/unit/data/xlsx/pivottable_long_text.xlsx
new file mode 100644
index ..f56db722e915
Binary files /dev/null and b/sc/qa/unit/data/xlsx/pivottable_long_text.xlsx 
differ
diff --git a/sc/qa/unit/pivottable_filters_test.cxx 
b/sc/qa/unit/pivottable_filters_test.cxx
index 5e886036aecb..5570d9b1fc52 100644
--- a/sc/qa/unit/pivottable_filters_test.cxx
+++ b/sc/qa/unit/pivottable_filters_test.cxx
@@ -94,6 +94,7 @@ public:
 void tesTtdf124772NumFmt();
 void testTdf124810();
 void testTdf124883();
+void testTdf125046();
 
 CPPUNIT_TEST_SUITE(ScPivotTableFiltersTest);
 
@@ -142,6 +143,7 @@ public:
 CPPUNIT_TEST(tesTtdf124772NumFmt);
 CPPUNIT_TEST(testTdf124810);
 CPPUNIT_TEST(testTdf124883);
+CPPUNIT_TEST(testTdf125046);
 
 CPPUNIT_TEST_SUITE_END();
 
@@ -2621,6 +2623,18 @@ void ScPivotTableFiltersTest::testTdf124883()
 "Count of Value2");
 }
 
+void ScPivotTableFiltersTest::testTdf125046()
+{
+ScDocShellRef xDocSh = loadDoc("pivottable_long_text.", FORMAT_XLSX);
+CPPUNIT_ASSERT(xDocSh.is());
+
+xmlDocPtr pDoc = XPathHelper::parseExport2(
+*this, *xDocSh, m_xSFactory, 
"xl/pivotCache/pivotCacheDefinition1.xml", FORMAT_XLSX);
+CPPUNIT_ASSERT(pDoc);
+assertXPath(pDoc, 
"/x:pivotCacheDefinition/x:cacheFields/x:cacheField[2]/x:sharedItems",
+"longText", "1");
+}
+
 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 e3b39e0dafe9..147658d8fafc 100644
--- a/sc/source/filter/excel/xepivotxml.cxx
+++ b/sc/source/filter/excel/xepivotxml.cxx
@@ -363,6 +363,7 @@ void XclExpXmlPivotCaches::SavePivotCacheXml( 
XclExpXmlStream& rStrm, const Entr
 double fMin = std::numeric_limits::infinity(), fMax = 
-std::numeric_limits::infinity();
 bool isValueInteger = true;
 bool isContainsDate = rCache.IsDateDimension(i);
+bool isLongText = false;
 for (; it != itEnd; ++it)
 {
 ScDPItemData::Type eType = it->GetType();
@@ -382,6 +383,10 @@ void XclExpXmlPivotCaches::SavePivotCacheXml( 
XclExpXmlStream& rStrm, const Entr
 isValueInteger = false;
 }
 }
+else if (eType == ScDPItemData::String && !isLongText)
+{
+isLongText = it->GetString().getLength() > 255;
+}
 }
 
 auto aDPTypeEnd = aDPTypes.cend();
@@ -459,6 +464,12 @@ void XclExpXmlPivotCaches::SavePivotCacheXml( 
XclExpXmlStream& rStrm, const Entr
 {
 pAttList->add(XML_count, 
OString::number(static_cast(rFieldItems.size(;
 }
+
+if (isLongText)
+{
+pAttList->add(XML_longText, ToPsz10(true));
+}
+
 sax_fastparser::XFastAttributeListRef xAttributeList(pAttList);
 
 pDefStrm->startElement(XML_sharedItems, xAttributeList);
___
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/qa sc/source

2019-06-19 Thread Mike Kaganski (via logerrit)
 sc/qa/unit/data/xlsx/pivottable_1s_difference.xlsx |binary
 sc/qa/unit/pivottable_filters_test.cxx |   38 +
 sc/source/filter/excel/xepivotxml.cxx  |6 ++-
 3 files changed, 42 insertions(+), 2 deletions(-)

New commits:
commit e6dd66b7d503910bffddcf59c8dcb801773c152e
Author: Mike Kaganski 
AuthorDate: Wed May 1 07:22:44 2019 +0300
Commit: Mike Kaganski 
CommitDate: Wed Jun 19 12:54:48 2019 +0200

tdf#125055: properly round fractions of seconds

... so that 2017-07-10T09:11:02.99... becomes 2017-07-10T09:11:03,
not 2017-07-10T09:11:02. The latter created duplicated items in pivot
table cache previously.

TODO: check what to do if the times are actually different by 100 ns?
What Excel does then? Should we increase cache item precision?

Change-Id: I622d1c784ee9fddf6b387bec2d8af87bae5668ba
Reviewed-on: https://gerrit.libreoffice.org/71610
Tested-by: Jenkins
Reviewed-by: Mike Kaganski 
(cherry picked from commit f8472069d451ec001e602bbc5329ad030fae1219)
Reviewed-on: https://gerrit.libreoffice.org/74350
Tested-by: Mike Kaganski 

diff --git a/sc/qa/unit/data/xlsx/pivottable_1s_difference.xlsx 
b/sc/qa/unit/data/xlsx/pivottable_1s_difference.xlsx
new file mode 100644
index ..de8906cf94ca
Binary files /dev/null and b/sc/qa/unit/data/xlsx/pivottable_1s_difference.xlsx 
differ
diff --git a/sc/qa/unit/pivottable_filters_test.cxx 
b/sc/qa/unit/pivottable_filters_test.cxx
index 5570d9b1fc52..7fd27759f9e2 100644
--- a/sc/qa/unit/pivottable_filters_test.cxx
+++ b/sc/qa/unit/pivottable_filters_test.cxx
@@ -95,6 +95,7 @@ public:
 void testTdf124810();
 void testTdf124883();
 void testTdf125046();
+void testTdf125055();
 
 CPPUNIT_TEST_SUITE(ScPivotTableFiltersTest);
 
@@ -144,6 +145,7 @@ public:
 CPPUNIT_TEST(testTdf124810);
 CPPUNIT_TEST(testTdf124883);
 CPPUNIT_TEST(testTdf125046);
+CPPUNIT_TEST(testTdf125055);
 
 CPPUNIT_TEST_SUITE_END();
 
@@ -2635,6 +2637,42 @@ void ScPivotTableFiltersTest::testTdf125046()
 "longText", "1");
 }
 
+void ScPivotTableFiltersTest::testTdf125055()
+{
+ScDocShellRef xDocSh = loadDoc("pivottable_1s_difference.", FORMAT_XLSX);
+CPPUNIT_ASSERT(xDocSh.is());
+
+xmlDocPtr pDoc = XPathHelper::parseExport2(
+*this, *xDocSh, m_xSFactory, 
"xl/pivotCache/pivotCacheDefinition1.xml", FORMAT_XLSX);
+CPPUNIT_ASSERT(pDoc);
+
+// 1-second precision should not result in duplicated entries for values 
different by ~1 s.
+// Previously truncating nanoseconds in GetExcelFormattedDate converted
+// "2017-07-10T09:11:02.9..." into "2017-07-10T09:11:02", creating two 
identical strings
+// Only compare times here: see comment to 
ScPivotTableFiltersTest::testPivotCacheExportXLSX
+// "TODO Date generator in tests are one day higher, than during standard 
xlsx export"
+OUString sISODateTime = getXPath(
+pDoc, 
"/x:pivotCacheDefinition/x:cacheFields/x:cacheField[2]/x:sharedItems", 
"minDate");
+CPPUNIT_ASSERT_EQUAL(OUString("T09:11:02"), sISODateTime.copy(10));
+sISODateTime = getXPath(
+pDoc, 
"/x:pivotCacheDefinition/x:cacheFields/x:cacheField[2]/x:sharedItems", 
"maxDate");
+CPPUNIT_ASSERT_EQUAL(OUString("T09:11:03"), sISODateTime.copy(10));
+assertXPath(pDoc, 
"/x:pivotCacheDefinition/x:cacheFields/x:cacheField[2]/x:sharedItems",
+"count", "3");
+assertXPathChildren(pDoc, 
"/x:pivotCacheDefinition/x:cacheFields/x:cacheField[2]/x:sharedItems",
+3); // 2 different values + empty
+sISODateTime = getXPath(
+pDoc, 
"/x:pivotCacheDefinition/x:cacheFields/x:cacheField[2]/x:sharedItems/x:d[1]", 
"v");
+CPPUNIT_ASSERT_EQUAL(OUString("T09:11:02"), sISODateTime.copy(10));
+sISODateTime = getXPath(
+pDoc, 
"/x:pivotCacheDefinition/x:cacheFields/x:cacheField[2]/x:sharedItems/x:d[2]", 
"v");
+CPPUNIT_ASSERT_EQUAL(OUString("T09:11:03"), sISODateTime.copy(10));
+// Trailing empty
+CPPUNIT_ASSERT_EQUAL(
+2, getXPathPosition(
+   pDoc, 
"/x:pivotCacheDefinition/x:cacheFields/x:cacheField[2]/x:sharedItems", "m"));
+}
+
 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 147658d8fafc..280cb1a82a2b 100644
--- a/sc/source/filter/excel/xepivotxml.cxx
+++ b/sc/source/filter/excel/xepivotxml.cxx
@@ -197,8 +197,10 @@ namespace {
  */
 OUString GetExcelFormattedDate( double fSerialDateTime, const 
SvNumberFormatter& rFormatter )
 {
-//::sax::Converter::convertDateTime(sBuf, 
(DateTime(rFormatter.GetNullDate()) + fSerialDateTime).GetUNODateTime(), 0, 
true);
-css::util::DateTime aUDateTime = (DateTime(rFormatter.GetNullDate()) + 
fSerialDateTime).GetUNODateTime();
+// tdf#125055: properly round the value to seconds whe

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

2019-06-19 Thread Mike Kaganski (via logerrit)
 desktop/source/lib/init.cxx |  240 ++--
 1 file changed, 99 insertions(+), 141 deletions(-)

New commits:
commit 5fdde854ff54926bc93d45192458adf5ed553b20
Author: Mike Kaganski 
AuthorDate: Sun Apr 28 23:29:49 2019 +0300
Commit: Mike Kaganski 
CommitDate: Wed Jun 19 13:32:54 2019 +0200

tdf#120703 PVS: dereference before nullptr check

Use a function to consistently check if gImpl is valid before assigning last
exception message.

V595 The 'gImpl' pointer was utilized before it was verified against 
nullptr.
 Check lines: 2673, 2683.

Change-Id: I18fc0d632c84f37b05e9d1c3c83689e6eaa6f66c
Reviewed-on: https://gerrit.libreoffice.org/71488
Tested-by: Jenkins
Reviewed-by: Miklos Vajna 
Reviewed-on: https://gerrit.libreoffice.org/74351
Reviewed-by: Mike Kaganski 
Tested-by: Mike Kaganski 

diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx
index 1ea6dd95eb03..5d2dd070ef30 100644
--- a/desktop/source/lib/init.cxx
+++ b/desktop/source/lib/init.cxx
@@ -150,6 +150,12 @@ static LibLibreOffice_Impl *gImpl = nullptr;
 static std::weak_ptr< LibreOfficeKitClass > gOfficeClass;
 static std::weak_ptr< LibreOfficeKitDocumentClass > gDocumentClass;
 
+static void SetLastExceptionMsg(const OUString& s = OUString())
+{
+if (gImpl)
+gImpl->maLastExceptionMsg = s;
+}
+
 typedef struct
 {
 const char *extn;
@@ -1643,8 +1649,7 @@ static void lo_registerCallback (LibreOfficeKit* pThis,
 static int doc_saveAs(LibreOfficeKitDocument* pThis, const char* sUrl, const 
char* pFormat, const char* pFilterOptions)
 {
 SolarMutexGuard aGuard;
-if (gImpl)
-gImpl->maLastExceptionMsg.clear();
+SetLastExceptionMsg();
 
 LibLODocument_Impl* pDocument = static_cast(pThis);
 
@@ -1652,7 +1657,7 @@ static int doc_saveAs(LibreOfficeKitDocument* pThis, 
const char* sUrl, const cha
 OUString aURL(getAbsoluteURL(sUrl));
 if (aURL.isEmpty())
 {
-gImpl->maLastExceptionMsg = "Filename to save to was not provided.";
+SetLastExceptionMsg("Filename to save to was not provided.");
 SAL_INFO("lok", "URL for save is empty");
 return false;
 }
@@ -1691,7 +1696,7 @@ static int doc_saveAs(LibreOfficeKitDocument* pThis, 
const char* sUrl, const cha
 }
 else
 {
-gImpl->maLastExceptionMsg = "input filename without a suffix";
+SetLastExceptionMsg("input filename without a suffix");
 return false;
 }
 }
@@ -1707,7 +1712,7 @@ static int doc_saveAs(LibreOfficeKitDocument* pThis, 
const char* sUrl, const cha
 }
 if (aFilterName.isEmpty())
 {
-gImpl->maLastExceptionMsg = "no output filter found for provided 
suffix";
+SetLastExceptionMsg("no output filter found for provided suffix");
 return false;
 }
 
@@ -1761,7 +1766,7 @@ static int doc_saveAs(LibreOfficeKitDocument* pThis, 
const char* sUrl, const cha
 }
 catch (const uno::Exception& exception)
 {
-gImpl->maLastExceptionMsg = "exception: " + exception.Message;
+SetLastExceptionMsg("exception: " + exception.Message);
 }
 return false;
 }
@@ -1769,8 +1774,7 @@ static int doc_saveAs(LibreOfficeKitDocument* pThis, 
const char* sUrl, const cha
 static void doc_iniUnoCommands ()
 {
 SolarMutexGuard aGuard;
-if (gImpl)
-gImpl->maLastExceptionMsg.clear();
+SetLastExceptionMsg();
 
 OUString sUnoCommands[] =
 {
@@ -1912,8 +1916,7 @@ static void doc_iniUnoCommands ()
 static int doc_getDocumentType (LibreOfficeKitDocument* pThis)
 {
 SolarMutexGuard aGuard;
-if (gImpl)
-gImpl->maLastExceptionMsg.clear();
+SetLastExceptionMsg();
 
 LibLODocument_Impl* pDocument = static_cast(pThis);
 
@@ -1939,12 +1942,12 @@ static int doc_getDocumentType (LibreOfficeKitDocument* 
pThis)
 }
 else
 {
-gImpl->maLastExceptionMsg = "unknown document type";
+SetLastExceptionMsg("unknown document type");
 }
 }
 catch (const uno::Exception& exception)
 {
-gImpl->maLastExceptionMsg = "exception: " + exception.Message;
+SetLastExceptionMsg("exception: " + exception.Message);
 }
 return LOK_DOCTYPE_OTHER;
 }
@@ -1956,7 +1959,7 @@ static int doc_getParts (LibreOfficeKitDocument* pThis)
 ITiledRenderable* pDoc = getTiledRenderable(pThis);
 if (!pDoc)
 {
-gImpl->maLastExceptionMsg = "Document doesn't support tiled rendering";
+SetLastExceptionMsg("Document doesn't support tiled rendering");
 return 0;
 }
 
@@ -1966,13 +1969,12 @@ static int doc_getParts (LibreOfficeKitDocument* pThis)
 static int doc_getPart (LibreOfficeKitDocument* pThis)
 {
 SolarMutexGuard aGuard;
-if (gImpl)
-gImpl->maLastExceptionMsg.clear();
+SetLastExceptionMsg();
 

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

2019-06-19 Thread Mike Kaganski (via logerrit)
 sc/qa/unit/data/ods/pivottable_fieldInRowsAndData.ods |binary
 sc/qa/unit/pivottable_filters_test.cxx|   15 +++
 sc/source/filter/excel/xepivotxml.cxx |   16 
 3 files changed, 31 insertions(+)

New commits:
commit 71e8190e20c4563c2c40d6974bfd9850bca23372
Author: Mike Kaganski 
AuthorDate: Thu May 2 19:44:47 2019 +0300
Commit: Mike Kaganski 
CommitDate: Wed Jun 19 16:10:33 2019 +0200

tdf#125086: Write dataField attribute for fields that also appear in Data

Change-Id: Id9f8f07bfdb1060f0c3d7ed6f8526a6bfdd84eb4
Reviewed-on: https://gerrit.libreoffice.org/71687
Tested-by: Jenkins
Reviewed-by: Mike Kaganski 
Reviewed-on: https://gerrit.libreoffice.org/74357
Tested-by: Mike Kaganski 

diff --git a/sc/qa/unit/data/ods/pivottable_fieldInRowsAndData.ods 
b/sc/qa/unit/data/ods/pivottable_fieldInRowsAndData.ods
new file mode 100644
index ..cbb773857605
Binary files /dev/null and 
b/sc/qa/unit/data/ods/pivottable_fieldInRowsAndData.ods differ
diff --git a/sc/qa/unit/pivottable_filters_test.cxx 
b/sc/qa/unit/pivottable_filters_test.cxx
index 7fd27759f9e2..0a9494e9e496 100644
--- a/sc/qa/unit/pivottable_filters_test.cxx
+++ b/sc/qa/unit/pivottable_filters_test.cxx
@@ -96,6 +96,7 @@ public:
 void testTdf124883();
 void testTdf125046();
 void testTdf125055();
+void testTdf125086();
 
 CPPUNIT_TEST_SUITE(ScPivotTableFiltersTest);
 
@@ -146,6 +147,7 @@ public:
 CPPUNIT_TEST(testTdf124883);
 CPPUNIT_TEST(testTdf125046);
 CPPUNIT_TEST(testTdf125055);
+CPPUNIT_TEST(testTdf125086);
 
 CPPUNIT_TEST_SUITE_END();
 
@@ -2673,6 +2675,19 @@ void ScPivotTableFiltersTest::testTdf125055()
pDoc, 
"/x:pivotCacheDefinition/x:cacheFields/x:cacheField[2]/x:sharedItems", "m"));
 }
 
+void ScPivotTableFiltersTest::testTdf125086()
+{
+ScDocShellRef xDocSh = loadDoc("pivottable_fieldInRowsAndData.", 
FORMAT_ODS);
+CPPUNIT_ASSERT(xDocSh.is());
+
+xmlDocPtr pDoc = XPathHelper::parseExport2(*this, *xDocSh, m_xSFactory,
+   
"xl/pivotTables/pivotTable1.xml", FORMAT_XLSX);
+CPPUNIT_ASSERT(pDoc);
+assertXPath(pDoc, "/x:pivotTableDefinition/x:pivotFields/x:pivotField[2]", 
"axis", "axisRow");
+// "dataField" attribute was not written for this "axisRow" field
+assertXPath(pDoc, "/x:pivotTableDefinition/x:pivotFields/x:pivotField[2]", 
"dataField", "1");
+}
+
 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 280cb1a82a2b..86ba16214100 100644
--- a/sc/source/filter/excel/xepivotxml.cxx
+++ b/sc/source/filter/excel/xepivotxml.cxx
@@ -1009,8 +1009,24 @@ void XclExpXmlPivotTables::SavePivotTableXml( 
XclExpXmlStream& rStrm, const ScDP
 aMemberSequence.emplace_back(nItem, true);
 }
 
+// tdf#125086: check if this field *also* appears in Data region
+bool bAppearsInData = false;
+{
+OUString aSrcName = 
ScDPUtil::getSourceDimensionName(pDim->GetName());
+const auto it = std::find_if(
+aDataFields.begin(), aDataFields.end(), [&aSrcName](const 
DataField& rDataField) {
+OUString aThisName
+= 
ScDPUtil::getSourceDimensionName(rDataField.mpDim->GetName());
+return aThisName == aSrcName;
+});
+if (it != aDataFields.end())
+bAppearsInData = true;
+}
+
 auto pAttList = sax_fastparser::FastSerializerHelper::createAttrList();
 pAttList->add(XML_axis, toOOXMLAxisType(eOrient));
+if (bAppearsInData)
+pAttList->add(XML_dataField, ToPsz10(true));
 pAttList->add(XML_showAll, ToPsz10(false));
 
 long nSubTotalCount = pDim->GetSubTotalsCount();
___
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/source

2019-06-19 Thread Mike Kaganski (via logerrit)
 shell/source/win32/spsupp/COMOpenDocuments.cxx |6 ++
 1 file changed, 6 insertions(+)

New commits:
commit b3074ab189922d54f19e29c9868d27211beca8b3
Author: Mike Kaganski 
AuthorDate: Wed May 15 08:59:01 2019 +0200
Commit: Mike Kaganski 
CommitDate: Thu Jun 20 04:53:54 2019 +0200

Check passed pointers

Change-Id: Idf5e77e4122ad4b5b91f25c50fdaaf25e34a76ae
Reviewed-on: https://gerrit.libreoffice.org/72336
Tested-by: Jenkins
Reviewed-by: Mike Kaganski 
(cherry picked from commit bb62eff4b4202ac85f3366d21fb1cbef52958b6d)
Reviewed-on: https://gerrit.libreoffice.org/74401
Tested-by: Mike Kaganski 

diff --git a/shell/source/win32/spsupp/COMOpenDocuments.cxx 
b/shell/source/win32/spsupp/COMOpenDocuments.cxx
index 4d00b8de6c46..13fdc6f8e5f3 100644
--- a/shell/source/win32/spsupp/COMOpenDocuments.cxx
+++ b/shell/source/win32/spsupp/COMOpenDocuments.cxx
@@ -314,6 +314,8 @@ STDMETHODIMP COMOpenDocuments::CreateNewDocument2(
 BSTR /*bstrDefaultSaveLocation*/, // A string that contains the path that 
specifies a suggested default location for saving the new document
 VARIANT_BOOL* pbResult)   // true if the document creation 
succeeds; otherwise false
 {
+if (!pbResult)
+return E_POINTER;
 // TODO: resolve the program from varProgID (nullptr -> default?)
 HRESULT hr = LOStart(L"-n", bstrTemplateLocation, 
m_aObjectSafety.GetSafe_forUntrustedCaller() || 
m_aObjectSafety.GetSafe_forUntrustedData());
 *pbResult = toVBool(SUCCEEDED(hr));
@@ -365,6 +367,8 @@ STDMETHODIMP COMOpenDocuments::ViewDocument3(
 VARIANT /*varProgID*/, // An optional string that contains the ProgID 
of the application with which to open the document. If this argument is 
omitted, the default viewer for the document is used
 VARIANT_BOOL *pbResult)// true if the document was successfully 
opened; otherwise false
 {
+if (!pbResult)
+return E_POINTER;
 // TODO: resolve the program from varProgID (nullptr -> default?)
 HRESULT hr = LOStart(L"--view", bstrDocumentLocation, 
m_aObjectSafety.GetSafe_forUntrustedCaller() || 
m_aObjectSafety.GetSafe_forUntrustedData());
 *pbResult = toVBool(SUCCEEDED(hr));
@@ -427,6 +431,8 @@ STDMETHODIMP COMOpenDocuments::EditDocument3(
 VARIANT /*varProgID*/,  // An optional string that contains the 
ProgID of the application with which to edit the document. If this argument is 
omitted, the default editor for the document is used
 VARIANT_BOOL *pbResult) // true if the document was successfully 
opened; otherwise false
 {
+if (!pbResult)
+return E_POINTER;
 // TODO: resolve the program from varProgID (nullptr -> default?)
 HRESULT hr = LOStart(L"-o", bstrDocumentLocation, 
m_aObjectSafety.GetSafe_forUntrustedCaller() || 
m_aObjectSafety.GetSafe_forUntrustedData());
 *pbResult = toVBool(SUCCEEDED(hr));
___
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/source

2019-06-19 Thread Mike Kaganski (via logerrit)
 shell/source/win32/spsupp/spsuppServ.cxx |   30 ++
 1 file changed, 14 insertions(+), 16 deletions(-)

New commits:
commit 00c65b6e2129cfccb1ff909ea88fe64e6c5f6f5b
Author: Mike Kaganski 
AuthorDate: Wed May 15 08:31:44 2019 +0200
Commit: Mike Kaganski 
CommitDate: Thu Jun 20 06:22:21 2019 +0200

Use lambdas to initialize statics

Change-Id: Ib03bfd795967ba70333d71d9e5eeec97be90be79
Reviewed-on: https://gerrit.libreoffice.org/72334
Tested-by: Jenkins
Reviewed-by: Mike Kaganski 
(cherry picked from commit a11536d5ea695826844581c8c8f883970e0c8294)
Reviewed-on: https://gerrit.libreoffice.org/74402
Tested-by: Mike Kaganski 

diff --git a/shell/source/win32/spsupp/spsuppServ.cxx 
b/shell/source/win32/spsupp/spsuppServ.cxx
index 78af725bec60..f15f505fd730 100644
--- a/shell/source/win32/spsupp/spsuppServ.cxx
+++ b/shell/source/win32/spsupp/spsuppServ.cxx
@@ -37,35 +37,33 @@ HANDLE g_hModule;
 ITypeLib* GetTypeLib()
 {
 typedef std::unique_ptr ITypeLibGuard;
-static ITypeLibGuard aITypeLibGuard(nullptr, [](IUnknown* p) { if (p) 
p->Release(); });
-if (!aITypeLibGuard.get())
-{
+static ITypeLibGuard s_aITypeLibGuard = [] {
+ITypeLibGuard aITypeLibGuard(nullptr, [](IUnknown* p) { if (p) 
p->Release(); });
 wchar_t szFile[MAX_PATH];
 if (GetModuleFileNameW(static_cast(g_hModule), szFile, 
MAX_PATH) == 0)
-return nullptr;
+return aITypeLibGuard;
 ITypeLib* pTypeLib;
-HRESULT hr = LoadTypeLib(szFile, &pTypeLib);
-if (FAILED(hr))
-return nullptr;
+if (FAILED(LoadTypeLib(szFile, &pTypeLib)))
+return aITypeLibGuard;
 aITypeLibGuard.reset(pTypeLib);
-}
-return aITypeLibGuard.get();
+return aITypeLibGuard;
+}();
+return s_aITypeLibGuard.get();
 }
 
 const wchar_t* GetLOPath()
 {
-static wchar_t sPath[MAX_PATH] = { 0 };
-if (*sPath == 0)
-{
-// Initialization
+static wchar_t* s_sPath = []() -> wchar_t* {
+static wchar_t sPath[MAX_PATH];
 if (GetModuleFileNameW(static_cast(g_hModule), sPath, 
MAX_PATH) == 0)
 return nullptr;
 wchar_t* pSlashPos = wcsrchr(sPath, L'\\');
 if (pSlashPos == nullptr)
 return nullptr;
-wcscpy(pSlashPos+1, L"soffice.exe");
-}
-return sPath;
+wcscpy(pSlashPos + 1, L"soffice.exe");
+return sPath;
+}();
+return s_sPath;
 }
 
 BOOL APIENTRY DllMain( HANDLE hinstDLL,
___
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-19 Thread Mike Kaganski (via logerrit)
 shell/inc/spsupp/COMOpenDocuments.hpp  |   65 ++-
 shell/inc/spsupp/COMRefCounted.hpp |4 
 shell/source/win32/spsupp/COMOpenDocuments.cxx |  140 -
 3 files changed, 67 insertions(+), 142 deletions(-)

New commits:
commit fcfdad9841eb224b363826b23f6bde4f2d3d639d
Author: Mike Kaganski 
AuthorDate: Wed May 15 09:41:45 2019 +0200
Commit: Mike Kaganski 
CommitDate: Thu Jun 20 06:28:26 2019 +0200

Reimplement IObjectSafety from aggregate object into ancestor

Also simplify it, don't issue warnings for now, until we understand
clearly what each its option implies.

Change-Id: I0d74a42b878991ad84c5c3bba36c8978d920b9be
Reviewed-on: https://gerrit.libreoffice.org/72337
Reviewed-by: Mike Kaganski 
Tested-by: Mike Kaganski 
(cherry picked from commit efca409b9917f290102bc0134f09fd037f705d2f)
Reviewed-on: https://gerrit.libreoffice.org/74403

diff --git a/shell/inc/spsupp/COMOpenDocuments.hpp 
b/shell/inc/spsupp/COMOpenDocuments.hpp
index f4543c948587..21b378d895e6 100644
--- a/shell/inc/spsupp/COMOpenDocuments.hpp
+++ b/shell/inc/spsupp/COMOpenDocuments.hpp
@@ -22,7 +22,7 @@
 #include 
 #include 
 
-class COMOpenDocuments : public COMRefCounted
+class COMOpenDocuments : public COMRefCounted
 {
 public:
 
@@ -158,62 +158,27 @@ public:
 BSTR bstrBlogUrl,
 BSTR bstrBlogName) override;
 
-// Non-COM methods
-
-static long GetObjectCount();
-
-private:
-//Aggregated object
-class COMObjectSafety : public IObjectSafety
-{
-public:
-COMObjectSafety(IUnknown* pOwner) : m_pOwner(pOwner) { 
assert(m_pOwner); }
-virtual ~COMObjectSafety() {}
-
-// IUnknown members delegate to the outer unknown
-// IUnknown members do not control lifetime of object
-
-HRESULT STDMETHODCALLTYPE QueryInterface(
-REFIID riid,
-void **ppvObject) override
-{
-return m_pOwner->QueryInterface(riid, ppvObject);
-}
-
-ULONG STDMETHODCALLTYPE AddRef() override { return m_pOwner->AddRef(); 
}
-
-ULONG STDMETHODCALLTYPE Release() override { return 
m_pOwner->Release(); }
+// IObjectSafety methods
 
-// IObjectSafety methods
-
-HRESULT STDMETHODCALLTYPE GetInterfaceSafetyOptions(
-REFIID riid,
-DWORD *pdwSupportedOptions,
-DWORD *pdwEnabledOptions) override;
-
-HRESULT STDMETHODCALLTYPE SetInterfaceSafetyOptions(
-REFIID riid,
-DWORD dwOptionSetMask,
-DWORD dwEnabledOptions) override;
-
-// Non-COM methods
+HRESULT STDMETHODCALLTYPE GetInterfaceSafetyOptions(
+REFIID riid,
+DWORD *pdwSupportedOptions,
+DWORD *pdwEnabledOptions) override;
 
-bool GetSafe_forUntrustedCaller() { return (m_iEnabledOptions & 
INTERFACESAFE_FOR_UNTRUSTED_CALLER) != 0; }
-bool GetSafe_forUntrustedData() { return (m_iEnabledOptions & 
INTERFACESAFE_FOR_UNTRUSTED_DATA) != 0; }
+HRESULT STDMETHODCALLTYPE SetInterfaceSafetyOptions(
+REFIID riid,
+DWORD dwOptionSetMask,
+DWORD dwEnabledOptions) override;
 
-private:
-IUnknown* m_pOwner;
-DWORD m_iEnabledOptions = 0;
-enum : DWORD { iSupportedOptionsMask = 
INTERFACESAFE_FOR_UNTRUSTED_CALLER | INTERFACESAFE_FOR_UNTRUSTED_DATA };
+// Non-COM methods
 
-void SetMaskedOptions(DWORD iMask, DWORD iOptions);
-void SetSafe_forUntrustedCaller(bool bSafe);
-void SetSafe_forUntrustedData(bool bSafe);
-};
+static long GetObjectCount();
 
+private:
 static long m_nObjCount;
 static ITypeInfo* m_pTypeInfo;
-COMObjectSafety m_aObjectSafety;
+static constexpr DWORD iSupportedOptionsMask = 
INTERFACESAFE_FOR_UNTRUSTED_CALLER | INTERFACESAFE_FOR_UNTRUSTED_DATA;
+DWORD m_iEnabledOptions = 0;
 };
 
 #endif
diff --git a/shell/inc/spsupp/COMRefCounted.hpp 
b/shell/inc/spsupp/COMRefCounted.hpp
index 5673b66517ae..0c2460ba2bf8 100644
--- a/shell/inc/spsupp/COMRefCounted.hpp
+++ b/shell/inc/spsupp/COMRefCounted.hpp
@@ -13,8 +13,8 @@
 #include 
 #include 
 
-template 
-class COMRefCounted : public Interface
+template 
+class COMRefCounted : public Interfaces...
 {
 public:
 COMRefCounted() {}
diff --git a/shell/source/win32/spsupp/COMOpenDocuments.cxx 
b/shell/source/win32/spsupp/COMOpenDocuments.cxx
index 13fdc6f8e5f3..14406cba1d2d 100644
--- a/shell/source/win32/spsupp/COMOpenDocuments.cxx
+++ b/shell/source/win32/spsupp/COMOpenDocuments.cxx
@@ -19,28 +19,10 @@
 namespace
 {
 
-// Display confirmation dialog, return false on negative answer
-bool SecurityWarning(const wchar_t* sProgram, const wchar_t* sDocument)
-{
-// TODO: change wording (currently taken from MS Office), use LO 
localization
-wchar_t sBuf[65536];
-swprintf(sBuf, sizeof(sBuf) / sizeof(sBuf[0]),
-L"Some files contain viruses that can be harmful to your compute

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

2019-06-19 Thread Mike Kaganski (via logerrit)
 shell/source/win32/spsupp/COMOpenDocuments.cxx |1 -
 1 file changed, 1 deletion(-)

New commits:
commit 46b1e36e369ecea4946ad6a3cc0223d3be30cc85
Author: Mike Kaganski 
AuthorDate: Thu May 16 07:49:46 2019 +0200
Commit: Mike Kaganski 
CommitDate: Thu Jun 20 06:30:35 2019 +0200

Drop obsolete commented out debug output

Change-Id: I60f7bbb2921b242396b4620077ca30e12a0d3b4b
Reviewed-on: https://gerrit.libreoffice.org/72393
Tested-by: Jenkins
Reviewed-by: Mike Kaganski 
(cherry picked from commit 04b055f111be7044bdd97865a8f0b11215b25191)
Reviewed-on: https://gerrit.libreoffice.org/74404
Tested-by: Mike Kaganski 

diff --git a/shell/source/win32/spsupp/COMOpenDocuments.cxx 
b/shell/source/win32/spsupp/COMOpenDocuments.cxx
index 14406cba1d2d..2e6b8cfad8ec 100644
--- a/shell/source/win32/spsupp/COMOpenDocuments.cxx
+++ b/shell/source/win32/spsupp/COMOpenDocuments.cxx
@@ -159,7 +159,6 @@ STDMETHODIMP COMOpenDocuments::Invoke(
 EXCEPINFO *pExcepInfo,
 UINT *puArgErr)
 {
-//ReportInvoke(m_pTypeInfo, dispIdMember, pDispParams);
 return DispInvoke(this, m_pTypeInfo, dispIdMember, wFlags, pDispParams, 
pVarResult, pExcepInfo, puArgErr);
 }
 
___
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/source

2019-06-19 Thread Mike Kaganski (via logerrit)
 shell/source/win32/spsupp/res/spsupp.rc |   13 -
 1 file changed, 12 insertions(+), 1 deletion(-)

New commits:
commit 1e5933f0e60ca44e908a4aab81fd8802f234b081
Author: Mike Kaganski 
AuthorDate: Fri May 17 14:39:04 2019 +0200
Commit: Mike Kaganski 
CommitDate: Thu Jun 20 06:33:23 2019 +0200

Add license statement

Change-Id: Ib7ed7b3d94c04c09debe910a76cd720802f1a6f6
Reviewed-on: https://gerrit.libreoffice.org/72475
Reviewed-by: Mike Kaganski 
Tested-by: Mike Kaganski 
(cherry picked from commit fa7412039f7d89a9b15aeabb99b0f5380b690cfa)
Reviewed-on: https://gerrit.libreoffice.org/74405

diff --git a/shell/source/win32/spsupp/res/spsupp.rc 
b/shell/source/win32/spsupp/res/spsupp.rc
index c7f62aeb24e3..20e323e16a7b 100644
--- a/shell/source/win32/spsupp/res/spsupp.rc
+++ b/shell/source/win32/spsupp/res/spsupp.rc
@@ -1 +1,12 @@
-1 TYPELIB TLB_FILE
\ No newline at end of file
+/* -*- 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/.
+*/
+
+// Type library
+
+1 TYPELIB TLB_FILE
___
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/CustomTarget_x64.mk shell/Library_spsupp_x64.mk shell/source solenv/gbuild

2019-06-19 Thread Mike Kaganski (via logerrit)
 shell/CustomTarget_x64.mk|8 +---
 shell/Library_spsupp_x64.mk  |   11 +--
 shell/source/win32/spsupp/COMOpenDocuments_x64.cxx   |   13 +
 shell/source/win32/spsupp/registrar_x64.cxx  |   13 +
 shell/source/win32/spsupp/spsuppClassFactory_x64.cxx |   13 +
 shell/source/win32/spsupp/spsuppServ_x64.cxx |   13 +
 solenv/gbuild/LinkTarget.mk  |1 -
 solenv/gbuild/platform/com_MSC_class.mk  |4 ++--
 8 files changed, 60 insertions(+), 16 deletions(-)

New commits:
commit 76b037180cba4e0c275560a7f7829bc820eb6ad6
Author: Mike Kaganski 
AuthorDate: Fri May 17 14:30:51 2019 +0200
Commit: Mike Kaganski 
CommitDate: Thu Jun 20 06:49:12 2019 +0200

Make spsupp_x64 independent of shell/CustomTarget_x64

... in preparation for further changes.
Thanks to Noel Grandin for the hint!

Change-Id: I2b223322d1d42099b56a74a92e3c39631d6b581c
Reviewed-on: https://gerrit.libreoffice.org/72470
Tested-by: Jenkins
Reviewed-by: Mike Kaganski 
Reviewed-on: https://gerrit.libreoffice.org/72501
Tested-by: Mike Kaganski 
(cherry picked from commit d35eec7b26c7807092b78144b6c71639b9439612)
Reviewed-on: https://gerrit.libreoffice.org/74406

diff --git a/shell/CustomTarget_x64.mk b/shell/CustomTarget_x64.mk
index 42dd36c03edb..79dcde80d0e3 100644
--- a/shell/CustomTarget_x64.mk
+++ b/shell/CustomTarget_x64.mk
@@ -44,12 +44,6 @@ SHELL_PROPERTYHDL_FILES := \
 SHELL_XMLPARSER_FILES := \
all/xml_parser
 
-SHELL_SPSUPP_FILES := \
-win32/spsupp/COMOpenDocuments \
-win32/spsupp/registrar \
-win32/spsupp/spsuppClassFactory \
-win32/spsupp/spsuppServ
-
 SHELL_HEADERS := \
win32/ooofilereader/autostyletag \
win32/ooofilereader/dummytag \
@@ -64,7 +58,7 @@ SHELL_HEADERS := \
win32/zipfile/zipexcptn
 
 $(call gb_CustomTarget_get_target,shell/source) : \
-   $(foreach source,$(SHELL_SHLXTHANDLER_COMMON_FILES) 
$(SHELL_SHLXTHDL_FILES) $(SHELL_OOOFILT_FILES) $(SHELL_PROPERTYHDL_FILES) 
$(SHELL_XMLPARSER_FILES) $(SHELL_SPSUPP_FILES),\
+   $(foreach source,$(SHELL_SHLXTHANDLER_COMMON_FILES) 
$(SHELL_SHLXTHDL_FILES) $(SHELL_OOOFILT_FILES) $(SHELL_PROPERTYHDL_FILES) 
$(SHELL_XMLPARSER_FILES),\
$(call gb_CustomTarget_get_workdir,shell/source)/$(source).cxx) 
\
$(foreach header,$(SHELL_HEADERS),\
$(call gb_CustomTarget_get_workdir,shell/source)/$(header).hxx)
diff --git a/shell/Library_spsupp_x64.mk b/shell/Library_spsupp_x64.mk
index 4b29f27e31d2..4b36a6c8d105 100644
--- a/shell/Library_spsupp_x64.mk
+++ b/shell/Library_spsupp_x64.mk
@@ -12,7 +12,6 @@ $(eval $(call gb_Library_Library,spsupp_x64))
 $(eval $(call gb_Library_set_x64,spsupp_x64,YES))
 
 $(eval $(call gb_Library_use_custom_headers,spsupp_x64,\
-   shell/source \
shell/source/win32/spsupp/idl \
 ))
 
@@ -40,11 +39,11 @@ $(eval $(call gb_Library_add_ldflags,spsupp_x64,\
/DEF:$(SRCDIR)/shell/source/win32/spsupp/spsupp.def \
 ))
 
-$(eval $(call gb_Library_add_x64_generated_exception_objects,spsupp_x64,\
-CustomTarget/shell/source/win32/spsupp/COMOpenDocuments \
-CustomTarget/shell/source/win32/spsupp/registrar \
-CustomTarget/shell/source/win32/spsupp/spsuppClassFactory \
-CustomTarget/shell/source/win32/spsupp/spsuppServ \
+$(eval $(call gb_Library_add_exception_objects,spsupp_x64,\
+shell/source/win32/spsupp/COMOpenDocuments_x64 \
+shell/source/win32/spsupp/registrar_x64 \
+shell/source/win32/spsupp/spsuppClassFactory_x64 \
+shell/source/win32/spsupp/spsuppServ_x64 \
 ))
 
 # vim: set shiftwidth=4 tabstop=4 noexpandtab:
diff --git a/shell/source/win32/spsupp/COMOpenDocuments_x64.cxx 
b/shell/source/win32/spsupp/COMOpenDocuments_x64.cxx
new file mode 100644
index ..2a155fefa303
--- /dev/null
+++ b/shell/source/win32/spsupp/COMOpenDocuments_x64.cxx
@@ -0,0 +1,13 @@
+/* -*- 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/.
+*/
+
+// A stub for generating x64 DLL without the need to copy source files to a 
temporary directory
+#include "COMOpenDocuments.cxx"
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/shell/source/win32/spsupp/registrar_x64.cxx 
b/shell/source/win32/spsupp/registrar_x64.cxx
new file mode 100644
index ..18372bb27cf3
--- /dev/null
+++ b/shell/source/win32/spsupp/registrar_x64.cxx
@@ -0,0 +1,13 @@
+/* -*- 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 Mozill

  1   2   3   4   5   6   7   8   9   10   >