core.git: shell/source

2024-05-31 Thread Michael Weghorn (via logerrit)
 shell/source/backends/kf5be/kfaccess.cxx |5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

New commits:
commit eff8497fa2ab9c0e4889e1cf38fdeff1b2ec195a
Author: Michael Weghorn 
AuthorDate: Thu May 30 14:29:05 2024 +0200
Commit: Michael Weghorn 
CommitDate: Fri May 31 14:29:01 2024 +0200

kf5be: Make fromQStringToOUString work for Qt 6

Sync `fromQStringToOUString` with the `toOUString`
implementation in `vcl/inc/qt5/QtTools.hxx`, which
makes it work with Qt 6 as well.

Without this, building this with a planned upcoming
change that introduces a KF 6 desktop backend would fail
like this:

In file included from 
/home/user/development/git/libreoffice/shell/source/backends/kf6be/kfaccess.cxx:10:

/home/user/development/git/libreoffice/shell/source/backends/kf6be/../kf5be/kfaccess.cxx:53:60:
 error: non-constant-expression cannot be narrowed from type 'qsizetype' (aka 
'long long') to 'sal_Int32' (aka 'int') in initializer list [-Wc++11-narrowing]
   53 | return { reinterpret_cast(s.utf16()), 
s.size() };
  |
^~~~

/home/user/development/git/libreoffice/shell/source/backends/kf6be/../kf5be/kfaccess.cxx:53:60:
 note: insert an explicit cast to silence this issue
   53 | return { reinterpret_cast(s.utf16()), 
s.size() };
  |
^~~~
  |
static_cast( )

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

diff --git a/shell/source/backends/kf5be/kfaccess.cxx 
b/shell/source/backends/kf5be/kfaccess.cxx
index 93fe1ed49b20..498fb9e1efb5 100644
--- a/shell/source/backends/kf5be/kfaccess.cxx
+++ b/shell/source/backends/kf5be/kfaccess.cxx
@@ -47,10 +47,9 @@ namespace uno = css::uno;
 
 namespace
 {
-OUString fromQStringToOUString(QString const& s)
+OUString fromQStringToOUString(const QString& s)
 {
-// Conversion from QString size()'s int to OUString's sal_Int32 should be 
non-narrowing:
-return { reinterpret_cast(s.utf16()), s.size() };
+return OUString(reinterpret_cast(s.data()), 
s.length());
 }
 }
 


core.git: shell/source

2024-03-30 Thread Gabor Kelemen (via logerrit)
 shell/source/cmdmail/cmdmailmsg.cxx |1 -
 1 file changed, 1 deletion(-)

New commits:
commit f7ccf46b13ddf4501d5952ec38b1c680398f2101
Author: Gabor Kelemen 
AuthorDate: Fri Mar 29 13:30:24 2024 +0100
Commit: Gabor Kelemen 
CommitDate: Sat Mar 30 20:50:06 2024 +0100

tdf#146619 Drop unused 'using namespace' in: shell/

Change-Id: I4194a1e3b92ec5bd25a8f313f7ff441566079bac
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/165517
Tested-by: Jenkins
Reviewed-by: Gabor Kelemen 

diff --git a/shell/source/cmdmail/cmdmailmsg.cxx 
b/shell/source/cmdmail/cmdmailmsg.cxx
index 8d6c0865a609..b62d99ab9a0b 100644
--- a/shell/source/cmdmail/cmdmailmsg.cxx
+++ b/shell/source/cmdmail/cmdmailmsg.cxx
@@ -22,7 +22,6 @@
 using com::sun::star::container::NoSuchElementException;
 using com::sun::star::container::XNameAccess;
 
-using namespace cppu;
 using namespace com::sun::star::uno;
 
 


core.git: shell/source

2024-02-25 Thread Mike Kaganski (via logerrit)
 shell/source/win32/spsupp/spsuppServ.cxx |   12 ++--
 1 file changed, 6 insertions(+), 6 deletions(-)

New commits:
commit ad4d3a960206e409a6bf3891e49147fc3ce822f7
Author: Mike Kaganski 
AuthorDate: Sun Feb 25 19:15:54 2024 +0600
Commit: Mike Kaganski 
CommitDate: Mon Feb 26 03:22:27 2024 +0100

Replace an instance of MAX_PATH with 32767

... which is the approximate maximum of Windows API, as documented in

https://learn.microsoft.com/en-us/windows/win32/fileio/maximum-file-path-limitation

Change-Id: I2bfc2f2fa8a405ed36d6bb0c52f961028dd2fe6d
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/163911
Tested-by: Mike Kaganski 
Reviewed-by: Mike Kaganski 

diff --git a/shell/source/win32/spsupp/spsuppServ.cxx 
b/shell/source/win32/spsupp/spsuppServ.cxx
index abd5ec6070d2..f2afd288e5bb 100644
--- a/shell/source/win32/spsupp/spsuppServ.cxx
+++ b/shell/source/win32/spsupp/spsuppServ.cxx
@@ -40,8 +40,8 @@ ITypeLib* GetTypeLib()
 typedef std::unique_ptr ITypeLibGuard;
 static ITypeLibGuard s_aITypeLibGuard = [] {
 ITypeLibGuard aITypeLibGuard(nullptr, [](IUnknown* p) { if (p) 
p->Release(); });
-wchar_t szFile[MAX_PATH];
-if (GetModuleFileNameW(GetHModule(), szFile, MAX_PATH) == 0)
+wchar_t szFile[32767];
+if (GetModuleFileNameW(GetHModule(), szFile, std::size(szFile)) == 0)
 return aITypeLibGuard;
 ITypeLib* pTypeLib;
 if (FAILED(LoadTypeLib(szFile, )))
@@ -55,8 +55,8 @@ ITypeLib* GetTypeLib()
 const wchar_t* GetHelperExe()
 {
 static wchar_t* s_sPath = []() -> wchar_t* {
-static wchar_t sPath[MAX_PATH];
-if (GetModuleFileNameW(GetHModule(), sPath, MAX_PATH) == 0)
+static wchar_t sPath[32767];
+if (GetModuleFileNameW(GetHModule(), sPath, std::size(sPath)) == 0)
 return nullptr;
 wchar_t* pSlashPos = wcsrchr(sPath, L'\');
 if (pSlashPos == nullptr)
@@ -120,8 +120,8 @@ STDAPI DllRegisterServer(void)
 if (!pTypeLib)
 return ResultFromScode(SELFREG_E_TYPELIB);
 
-wchar_t szFile[MAX_PATH];
-if (GetModuleFileNameW(GetHModule(), szFile, MAX_PATH) == 0)
+wchar_t szFile[32767];
+if (GetModuleFileNameW(GetHModule(), szFile, std::size(szFile)) == 0)
 return HRESULT_FROM_WIN32(GetLastError());
 
 HRESULT hr = RegisterTypeLib(pTypeLib, szFile, nullptr);


core.git: shell/source

2024-02-25 Thread Mike Kaganski (via logerrit)
 shell/source/win32/spsupp/spsuppHelper.cxx |4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

New commits:
commit fa86d95014242225e4c61bf644d3c3197f13d10b
Author: Mike Kaganski 
AuthorDate: Sun Feb 25 19:15:13 2024 +0600
Commit: Mike Kaganski 
CommitDate: Mon Feb 26 03:19:36 2024 +0100

Replace an instance of MAX_PATH with 32767

... which is the approximate maximum of Windows API, as documented in

https://learn.microsoft.com/en-us/windows/win32/fileio/maximum-file-path-limitation

Change-Id: I152b0b499374167720d73a475f2502e52fc5a5dc
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/163910
Tested-by: Mike Kaganski 
Reviewed-by: Mike Kaganski 

diff --git a/shell/source/win32/spsupp/spsuppHelper.cxx 
b/shell/source/win32/spsupp/spsuppHelper.cxx
index af3509b87c8b..9ee49401a3c8 100644
--- a/shell/source/win32/spsupp/spsuppHelper.cxx
+++ b/shell/source/win32/spsupp/spsuppHelper.cxx
@@ -31,8 +31,8 @@ const OUString& GetSofficeExe()
 {
 static const OUString s_sPath = []() {
 OUString result;
-wchar_t sPath[MAX_PATH];
-if (GetModuleFileNameW(nullptr, sPath, MAX_PATH) == 0)
+wchar_t sPath[32767];
+if (GetModuleFileNameW(nullptr, sPath, std::size(sPath)) == 0)
 return result;
 wchar_t* pSlashPos = wcsrchr(sPath, L'\');
 if (pSlashPos == nullptr)


core.git: shell/source

2024-02-25 Thread Mike Kaganski (via logerrit)
 shell/source/win32/simplemail/smplmailclient.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 3fef8ba99222f5c82d56b4acfb3a07afbaa8364b
Author: Mike Kaganski 
AuthorDate: Sun Feb 25 19:14:00 2024 +0600
Commit: Mike Kaganski 
CommitDate: Mon Feb 26 03:19:21 2024 +0100

Replace an instance of MAX_PATH with 32767

... which is the approximate maximum of Windows API, as documented in

https://learn.microsoft.com/en-us/windows/win32/fileio/maximum-file-path-limitation

Change-Id: I78524891d89e34fb1569bf1d32161a96079f0f6e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/163909
Tested-by: Mike Kaganski 
Reviewed-by: Mike Kaganski 

diff --git a/shell/source/win32/simplemail/smplmailclient.cxx 
b/shell/source/win32/simplemail/smplmailclient.cxx
index d40577892cb3..333277353d03 100644
--- a/shell/source/win32/simplemail/smplmailclient.cxx
+++ b/shell/source/win32/simplemail/smplmailclient.cxx
@@ -67,7 +67,7 @@ namespace /* private */
 LONG lret = RegOpenKeyW(HKEY_CURRENT_USER, 
L"Software\LibreOffice\SendAsEMailClient", );
 if (lret == ERROR_SUCCESS)
 {
-wchar_t buff[MAX_PATH];
+wchar_t buff[32767];
 LONG sz = sizeof(buff);
 lret = RegQueryValueW(hkey, nullptr, buff, );
 if (lret == ERROR_SUCCESS)


core.git: shell/source

2024-02-25 Thread Mike Kaganski (via logerrit)
 shell/source/win32/shlxthandler/shlxthdl.cxx |4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

New commits:
commit cb12053fc519ddeac07cabd76d178a2729ec14d1
Author: Mike Kaganski 
AuthorDate: Sun Feb 25 19:13:10 2024 +0600
Commit: Mike Kaganski 
CommitDate: Mon Feb 26 03:19:03 2024 +0100

Replace an instance of MAX_PATH with 32767

... which is the approximate maximum of Windows API, as documented in

https://learn.microsoft.com/en-us/windows/win32/fileio/maximum-file-path-limitation

Change-Id: I5cd3c5e384005341aa2c39b18b3302521e71a805
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/163908
Tested-by: Mike Kaganski 
Reviewed-by: Mike Kaganski 

diff --git a/shell/source/win32/shlxthandler/shlxthdl.cxx 
b/shell/source/win32/shlxthandler/shlxthdl.cxx
index 9a5b8a37917c..13f687ad5a6b 100644
--- a/shell/source/win32/shlxthandler/shlxthdl.cxx
+++ b/shell/source/win32/shlxthandler/shlxthdl.cxx
@@ -300,12 +300,12 @@ namespace /* private */
 
 STDAPI DllRegisterServer()
 {
-WCHAR ModuleFileName[MAX_PATH];
+WCHAR ModuleFileName[32767];
 
 GetModuleFileNameW(
 GetCurrentModuleHandle(),
 ModuleFileName,
-sizeof(ModuleFileName)/sizeof(ModuleFileName[0]));
+std::size(ModuleFileName));
 
 HRESULT hr = S_OK;
 


core.git: shell/source

2024-02-25 Thread Mike Kaganski (via logerrit)
 shell/source/win32/jumplist/JumpList.cxx |4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

New commits:
commit 7dd7cdc7afc57fbcf6f0a23ea2b7a45d7d114a09
Author: Mike Kaganski 
AuthorDate: Sun Feb 25 19:12:39 2024 +0600
Commit: Mike Kaganski 
CommitDate: Mon Feb 26 03:18:45 2024 +0100

Replace an instance of MAX_PATH with 32767

... which is the approximate maximum of Windows API, as documented in

https://learn.microsoft.com/en-us/windows/win32/fileio/maximum-file-path-limitation

Change-Id: I7029d18eaa721a0db1b1869cfe6425715e80eda1
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/163907
Tested-by: Mike Kaganski 
Reviewed-by: Mike Kaganski 

diff --git a/shell/source/win32/jumplist/JumpList.cxx 
b/shell/source/win32/jumplist/JumpList.cxx
index 2773294be717..182af345c18e 100644
--- a/shell/source/win32/jumplist/JumpList.cxx
+++ b/shell/source/win32/jumplist/JumpList.cxx
@@ -477,13 +477,13 @@ Sequence SAL_CALL 
JumpListImpl::getRemovedItems(const OUString& sA
 item.arguments = 
o3tl::toU(PropVariantToStringWithDefault(propvar, L""));
 PropVariantClear();
 
-wchar_t itemDesc[MAX_PATH];
+wchar_t itemDesc[32767];
 ThrowIfFailed(pShellLinkItem->GetDescription(
   itemDesc, 
std::extent::value),
   "GetDescription failed.");
 item.description = o3tl::toU(itemDesc);
 
-wchar_t path[MAX_PATH];
+wchar_t path[32767];
 int icon_index;
 ThrowIfFailed(pShellLinkItem->GetIconLocation(
   path, 
std::extent::value, _index),


core.git: shell/source

2024-01-31 Thread Andrea Gelmini (via logerrit)
 shell/source/unix/exec/shellexec.cxx |4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

New commits:
commit 658d4d013a0f454cca3bc20a23f8f3133ea19151
Author: Andrea Gelmini 
AuthorDate: Wed Jan 31 10:36:04 2024 +0100
Commit: Julien Nabet 
CommitDate: Wed Jan 31 11:20:57 2024 +0100

Fix typo

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

diff --git a/shell/source/unix/exec/shellexec.cxx 
b/shell/source/unix/exec/shellexec.cxx
index 153827a003a7..a5a01dfd5799 100644
--- a/shell/source/unix/exec/shellexec.cxx
+++ b/shell/source/unix/exec/shellexec.cxx
@@ -168,7 +168,7 @@ void SAL_CALL ShellExec::execute( const OUString& aCommand, 
const OUString& aPar
 //  in "mailto:foo?
[0] cancel
[1] Open the file   mailto:foo
[2] 
 //  Open the URL   mailto:foo

Which did you mean? Cancelled." on
 //  stderr and SystemShellExecuteException.
-// 1.2  If it does not match an exitsting pathname (relative to CWD):
+// 1.2  If it does not match an existing pathname (relative to CWD):
 //  Results in the corresponding application being opened with the 
given
 //  document (e.g., Mail with a New Message).
 // 2  If the given URI reference does not match a supported scheme
@@ -179,7 +179,7 @@ void SAL_CALL ShellExec::execute( const OUString& aCommand, 
const OUString& aPar
 //  a non-executable regular file:  Results in opening it in TextEdit.
 // 2.3  If it matches an existing pathname (relative to CWD) pointing 
to
 //  a directory:  Results in opening it in Finder.
-// 2.4  If it does not match an exitsting pathname (relative to CWD):
+// 2.4  If it does not match an existing pathname (relative to CWD):
 //  Results in "The file /.../foo:bar does not exits." (where "/..." is
 //  the CWD) on stderr and SystemShellExecuteException.
 aBuffer.append("open");


core.git: shell/source

2024-01-31 Thread Stephan Bergmann (via logerrit)
 shell/source/unix/exec/shellexec.cxx |   30 +-
 1 file changed, 25 insertions(+), 5 deletions(-)

New commits:
commit 2b1f5fa987f02ec8014dbf6837c6b090faf11f2d
Author: Stephan Bergmann 
AuthorDate: Tue Jan 30 16:59:03 2024 +0100
Commit: Stephan Bergmann 
CommitDate: Wed Jan 31 09:33:27 2024 +0100

tdf#159307 Let non-URIS_ONLY execute() handle .app directories on macOS

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

diff --git a/shell/source/unix/exec/shellexec.cxx 
b/shell/source/unix/exec/shellexec.cxx
index 71137c7d6703..153827a003a7 100644
--- a/shell/source/unix/exec/shellexec.cxx
+++ b/shell/source/unix/exec/shellexec.cxx
@@ -207,12 +207,32 @@ void SAL_CALL ShellExec::execute( const OUString& 
aCommand, const OUString& aPar
  + aCommand,
 getXWeak(), 0);
 } else {
+#if defined MACOSX
+auto usingOpen = false;
+if (OString pathname8;
+aCommand.convertToString(
+, RTL_TEXTENCODING_UTF8,
+RTL_UNICODETOTEXT_FLAGS_UNDEFINED_ERROR | 
RTL_UNICODETOTEXT_FLAGS_INVALID_ERROR))
+{
+if (struct stat st; stat(pathname8.getStr(), ) == 0 && 
S_ISDIR(st.st_mode)) {
+usingOpen = true;
+aBuffer.append("open -a ");
+}
+}
+#endif
 escapeForShell(aBuffer, OUStringToOString(aCommand, 
osl_getThreadTextEncoding()));
-aBuffer.append(" ");
-if( nFlags != 42 )
-escapeForShell(aBuffer, OUStringToOString(aParameter, 
osl_getThreadTextEncoding()));
-else
-aBuffer.append(OUStringToOString(aParameter, 
osl_getThreadTextEncoding()));
+if (!aParameter.isEmpty()) {
+aBuffer.append(" ");
+#if defined MACOSX
+if (usingOpen) {
+aBuffer.append("--args ");
+}
+#endif
+if( nFlags != 42 )
+escapeForShell(aBuffer, OUStringToOString(aParameter, 
osl_getThreadTextEncoding()));
+else
+aBuffer.append(OUStringToOString(aParameter, 
osl_getThreadTextEncoding()));
+}
 }
 
 // Prefer DESKTOP_LAUNCH when available


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

2023-04-30 Thread Mike Kaganski (via logerrit)
 shell/source/backends/desktopbe/desktopbackend.cxx |6 +++---
 shell/source/backends/kf5be/kf5backend.cxx |5 ++---
 shell/source/backends/localebe/localebackend.cxx   |4 ++--
 shell/source/backends/macbe/macbackend.mm  |4 ++--
 shell/source/backends/wininetbe/wininetbackend.cxx |4 ++--
 shell/source/unix/exec/shellexec.cxx   |4 ++--
 shell/source/win32/SysShExec.cxx   |2 +-
 shell/source/win32/jumplist/JumpList.cxx   |   13 ++---
 8 files changed, 20 insertions(+), 22 deletions(-)

New commits:
commit f220acf3aad954e20f3b15b30910432fac97ed15
Author: Mike Kaganski 
AuthorDate: Sun Apr 23 20:14:45 2023 +0300
Commit: Mike Kaganski 
CommitDate: Sun Apr 30 17:05:28 2023 +0200

Use getXWeak in shell

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

diff --git a/shell/source/backends/desktopbe/desktopbackend.cxx 
b/shell/source/backends/desktopbe/desktopbackend.cxx
index b6f49e37ed24..8d001499bad0 100644
--- a/shell/source/backends/desktopbe/desktopbackend.cxx
+++ b/shell/source/backends/desktopbe/desktopbackend.cxx
@@ -106,7 +106,7 @@ void Default::setPropertyValue(OUString const &, 
css::uno::Any const &)
 {
 throw css::lang::IllegalArgumentException(
 "setPropertyValue not supported",
-static_cast< cppu::OWeakObject * >(this), -1);
+getXWeak(), -1);
 }
 
 OUString xdg_user_dir_lookup (const char *type, bool bAllowHomeDir)
@@ -252,7 +252,7 @@ css::uno::Any Default::getPropertyValue(OUString const & 
PropertyName)
 }
 
 throw css::beans::UnknownPropertyException(
-PropertyName, static_cast< cppu::OWeakObject * >(this));
+PropertyName, getXWeak());
 }
 
 css::uno::Reference< css::uno::XInterface > createBackend(
@@ -290,7 +290,7 @@ shell_DesktopBackend_get_implementation(
 backend = createBackend(context,
 "com.sun.star.configuration.backend.KF5Backend");
 if (!backend)
-backend = static_cast< cppu::OWeakObject * >(new Default);
+backend = getXWeak(new Default);
 backend->acquire();
 return backend.get();
 }
diff --git a/shell/source/backends/kf5be/kf5backend.cxx 
b/shell/source/backends/kf5be/kf5backend.cxx
index 7137a873..b811300a8e6e 100644
--- a/shell/source/backends/kf5be/kf5backend.cxx
+++ b/shell/source/backends/kf5be/kf5backend.cxx
@@ -220,8 +220,7 @@ Service::Service()
 
 void Service::setPropertyValue(OUString const&, css::uno::Any const&)
 {
-throw css::lang::IllegalArgumentException("setPropertyValue not supported",
-  
static_cast(this), -1);
+throw css::lang::IllegalArgumentException("setPropertyValue not 
supported", getXWeak(), -1);
 }
 
 css::uno::Any Service::getPropertyValue(OUString const& PropertyName)
@@ -247,7 +246,7 @@ css::uno::Any Service::getPropertyValue(OUString const& 
PropertyName)
 return css::uno::Any(css::beans::Optional());
 //TODO: obtain values from KDE?
 }
-throw css::beans::UnknownPropertyException(PropertyName, 
static_cast(this));
+throw css::beans::UnknownPropertyException(PropertyName, getXWeak());
 }
 
 extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface*
diff --git a/shell/source/backends/localebe/localebackend.cxx 
b/shell/source/backends/localebe/localebackend.cxx
index 9f1d22fef93e..d34c3441e6bc 100644
--- a/shell/source/backends/localebe/localebackend.cxx
+++ b/shell/source/backends/localebe/localebackend.cxx
@@ -286,7 +286,7 @@ void LocaleBackend::setPropertyValue(
 {
 throw css::lang::IllegalArgumentException(
 "setPropertyValue not supported",
-static_cast< cppu::OWeakObject * >(this), -1);
+getXWeak(), -1);
 }
 
 css::uno::Any LocaleBackend::getPropertyValue(
@@ -302,7 +302,7 @@ css::uno::Any LocaleBackend::getPropertyValue(
 return css::uno::Any(getUILocale());
 } else {
 throw css::beans::UnknownPropertyException(
-PropertyName, static_cast< cppu::OWeakObject * >(this));
+PropertyName, getXWeak());
 }
 }
 
diff --git a/shell/source/backends/macbe/macbackend.mm 
b/shell/source/backends/macbe/macbackend.mm
index cb35a4b9d066..e84ecd4b8013 100644
--- a/shell/source/backends/macbe/macbackend.mm
+++ b/shell/source/backends/macbe/macbackend.mm
@@ -186,7 +186,7 @@ void MacOSXBackend::setPropertyValue(
 {
 throw css::lang::IllegalArgumentException(
 "setPropertyValue not supported",
-static_cast< cppu::OWeakObject * >(this), -1);
+getXWeak(), -1);
 }
 
 css::uno::Any MacOSXBackend::getPropertyValue(
@@ -365,7 +365,7 @@ css::uno::Any MacOSXBackend::getPropertyValue(
 return css::uno::Any(css::beans::Optional< css::uno::Any >());
 } else {
 throw css::beans::UnknownPropertyException(
-PropertyName, static_cast< 

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

2023-04-17 Thread Mike Kaganski (via logerrit)
 shell/source/win32/spsupp/res/spsuppDlg.rc |   56 ++---
 1 file changed, 28 insertions(+), 28 deletions(-)

New commits:
commit 7b55e994338ab5e7d9056f84d1aa2989534f59fb
Author: Mike Kaganski 
AuthorDate: Mon Apr 17 12:58:43 2023 +0300
Commit: Mike Kaganski 
CommitDate: Mon Apr 17 15:32:16 2023 +0200

Normalize line endings

Change-Id: I8daa44961ae7a92fc6bbc728e5387dc0b5e32f31
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/150487
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 f4ce83a157fc..4c43c663c6dd 100644
--- a/shell/source/win32/spsupp/res/spsuppDlg.rc
+++ b/shell/source/win32/spsupp/res/spsuppDlg.rc
@@ -1,29 +1,29 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*
-* This file is part of the LibreOffice project.
-*
-* This Source Code Form is subject to the terms of the Mozilla Public
-* License, v. 2.0. If a copy of the MPL was not distributed with this
-* file, You can obtain one at http://mozilla.org/MPL/2.0/.
-*/
-
-#include "spsuppDlg.h"
-// We need to include windows.h to use IDI_QUESTION
-#define WIN32_LEAN_AND_MEAN
-#include 
-
-LANGUAGE LANG_NEUTRAL, SUBLANG_DEFAULT
-
-// Dialog
-
-IDD_EDIT_OR_RO DIALOGEX 0, 0, 309, 87
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+* This file is part of the LibreOffice project.
+*
+* This Source Code Form is subject to the terms of the Mozilla Public
+* License, v. 2.0. If a copy of the MPL was not distributed with this
+* file, You can obtain one at http://mozilla.org/MPL/2.0/.
+*/
+
+#include "spsuppDlg.h"
+// We need to include windows.h to use IDI_QUESTION
+#define WIN32_LEAN_AND_MEAN
+#include 
+
+LANGUAGE LANG_NEUTRAL, SUBLANG_DEFAULT
+
+// Dialog
+
+IDD_EDIT_OR_RO DIALOGEX 0, 0, 309, 87
 STYLE DS_MODALFRAME | DS_CENTER | WS_POPUP | WS_CAPTION | WS_SYSMENU
-EXSTYLE WS_EX_TOPMOST
-CAPTION "Open Document"
-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
-DEFPUSHBUTTON   "View",ID_RO,91,66,77,14
-PUSHBUTTON  "Edit",ID_EDIT,171,66,77,14
-PUSHBUTTON  "Cancel",IDCANCEL,252,66,50,14
-END
+EXSTYLE WS_EX_TOPMOST
+CAPTION "Open Document"
+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
+DEFPUSHBUTTON   "View",ID_RO,91,66,77,14
+PUSHBUTTON  "Edit",ID_EDIT,171,66,77,14
+PUSHBUTTON  "Cancel",IDCANCEL,252,66,50,14
+END


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

2023-04-11 Thread Stephan Bergmann (via logerrit)
 shell/source/backends/localebe/localebackend.cxx |3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

New commits:
commit 5b6ed0abb8279a0b2858dad60435cb2494887014
Author: Stephan Bergmann 
AuthorDate: Tue Apr 11 16:09:27 2023 +0200
Commit: Stephan Bergmann 
CommitDate: Tue Apr 11 20:44:21 2023 +0200

loplugin:stringadd

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

diff --git a/shell/source/backends/localebe/localebackend.cxx 
b/shell/source/backends/localebe/localebackend.cxx
index 558926d8febd..9f1d22fef93e 100644
--- a/shell/source/backends/localebe/localebackend.cxx
+++ b/shell/source/backends/localebe/localebackend.cxx
@@ -123,8 +123,7 @@ namespace /* private */
 CFStringRef sref = ImplGetAppPreference(pref);
 CFStringGuard srefGuard(sref);
 
-OUStringBuffer aLocaleBuffer;
-aLocaleBuffer.append("en-US"); // initialize with fallback value
+OUStringBuffer aLocaleBuffer("en-US"); // initialize with fallback 
value
 
 if (sref != nullptr)
 {


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

2022-10-10 Thread Martin Schumann (via logerrit)
 shell/source/unix/misc/senddoc.sh |4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

New commits:
commit 42fe257fa4d970f58543ca40f5158c04f607bc61
Author: Martin Schumann 
AuthorDate: Mon Oct 10 15:13:23 2022 +0200
Commit: Adolfo Jayme Barrientos 
CommitDate: Mon Oct 10 16:55:54 2022 +0200

tdf#151314 add Betterbird to Thunderbird-like mail clients in senddoc.sh

Change-Id: Ie145aba936138968b31f1f89d85ad23ad937a367
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/141158
Reviewed-by: Stephan Bergmann 
Tested-by: Jenkins
Reviewed-by: Adolfo Jayme Barrientos 

diff --git a/shell/source/unix/misc/senddoc.sh 
b/shell/source/unix/misc/senddoc.sh
index d4f9b08de89c..c37a2dcf8ed0 100755
--- a/shell/source/unix/misc/senddoc.sh
+++ b/shell/source/unix/misc/senddoc.sh
@@ -80,7 +80,7 @@ fi
 # autodetect mail client from executable name
 case $(basename "$MAILER" | sed 's/-.*$//') in
 
-iceape | mozilla | netscape | seamonkey | icedove | thunderbird)
+iceape | mozilla | netscape | seamonkey | icedove | thunderbird | 
betterbird)
 
 while [ "$1" != "" ]; do
 case $1 in
@@ -361,7 +361,7 @@ case $(basename "$MAILER" | sed 's/-.*$//') in
  ${MAILER} ${TO:+--compose} ${TO:-} ${ATTACH:+--attach} ${ATTACH:-}
 ;;
 
-Mail | Thunderbird | *.app )
+Mail | Thunderbird | Betterbird | *.app )
 
 while [ "$1" != "" ]; do
 case $1 in


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

2022-09-15 Thread Mahdi Tizabi (via logerrit)
 shell/source/sessioninstall/SyncDbusSessionHelper.hxx |4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

New commits:
commit cab4fd84ff9f59027d4de5a0bb96d50b7b07df13
Author: Mahdi Tizabi 
AuthorDate: Wed Jun 29 22:08:34 2022 +0430
Commit: Hossein 
CommitDate: Thu Sep 15 15:10:35 2022 +0200

tdf#42982 Improved UNO API error reporting

Making `RuntimeException` instances's messages in  
'SyncDbusSessionHelper.hxx' more clear.

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

diff --git a/shell/source/sessioninstall/SyncDbusSessionHelper.hxx 
b/shell/source/sessioninstall/SyncDbusSessionHelper.hxx
index 7812604c9e01..4daa458509bf 100644
--- a/shell/source/sessioninstall/SyncDbusSessionHelper.hxx
+++ b/shell/source/sessioninstall/SyncDbusSessionHelper.hxx
@@ -43,7 +43,7 @@ namespace shell::sessioninstall
 virtual void SAL_CALL InstallGStreamerResources( const 
css::uno::Sequence< OUString >& resources, const OUString& interaction ) 
override;
 
 virtual void SAL_CALL InstallResources( const css::uno::Sequence< 
OUString >& /* types */, const css::uno::Sequence< OUString >& /* resources */, 
const OUString& /* interaction */ ) override
-{ throw css::uno::RuntimeException(); } // not implemented
+{ throw css::uno::RuntimeException("InstallResources is not 
implemented"); } // not implemented
 
 virtual void SAL_CALL RemovePackageByFiles( const 
css::uno::Sequence< OUString >& files, const OUString& interaction ) override;
 
@@ -53,7 +53,7 @@ namespace shell::sessioninstall
 virtual void SAL_CALL IsInstalled( const OUString& /* package_name 
*/, const OUString& /* interaction */, sal_Bool& /* installed */ ) override;
 
 virtual void SAL_CALL SearchFile( const OUString& /* file_name */, 
const OUString& /* interaction */, sal_Bool& /* installed */, OUString& /* 
package_name */ ) override
-{ throw css::uno::RuntimeException(); } // not implemented
+{ throw css::uno::RuntimeException("SearchFile is not 
implemented"); } // not implemented
 
 private:
 SyncDbusSessionHelper( const SyncDbusSessionHelper& ) = delete;


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

2022-08-30 Thread Mike Kaganski (via logerrit)
 shell/source/tools/lngconvex/lngconvex.cxx |   20 +++-
 1 file changed, 7 insertions(+), 13 deletions(-)

New commits:
commit 6daa9cd1331f70b5bfa55d5306c2216331ede680
Author: Mike Kaganski 
AuthorDate: Tue Aug 30 14:13:53 2022 +0300
Commit: Mike Kaganski 
CommitDate: Tue Aug 30 14:43:27 2022 +0200

Inline some macro wizardry

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

diff --git a/shell/source/tools/lngconvex/lngconvex.cxx 
b/shell/source/tools/lngconvex/lngconvex.cxx
index fc81964494f0..4a5e03395bc8 100644
--- a/shell/source/tools/lngconvex/lngconvex.cxx
+++ b/shell/source/tools/lngconvex/lngconvex.cxx
@@ -115,11 +115,11 @@ OUString get_absolute_path(
 return abs_sys_path;
 }
 
-OString get_absolute_file_path(const std::string& file_name)
+std::string make_absolute(const std::string& file_name)
 {
 OUString fp = get_absolute_path(
 get_module_path(), OStringToOUString(file_name.c_str()));
-return OUStringToOString(fp);
+return std::string(OUStringToOString(fp));
 }
 
 /** A helper class, enables stream exceptions
@@ -487,12 +487,6 @@ void inflate_rc_template_to_file(
   for every language using the substitutor
5. append the footer
 */
-#define MAKE_ABSOLUTE(s) (get_absolute_file_path((s)).getStr())
-#define ULF_FILE(c)MAKE_ABSOLUTE((c).get_arg("-ulf"))
-#define RC_TEMPLATE(c) MAKE_ABSOLUTE((c).get_arg("-rct"))
-#define RC_FILE(c) MAKE_ABSOLUTE((c).get_arg("-rc"))
-#define RC_HEADER(c)   MAKE_ABSOLUTE((c).get_arg("-rch"))
-#define RC_FOOTER(c)   MAKE_ABSOLUTE((c).get_arg("-rcf"))
 
 SAL_IMPLEMENT_MAIN_WITH_ARGS(argc, argv)
 {
@@ -501,18 +495,18 @@ SAL_IMPLEMENT_MAIN_WITH_ARGS(argc, argv)
 CommandLine cmdline(argc, argv);
 
 Substitutor substitutor;
-read_ulf_file(ULF_FILE(cmdline), substitutor);
+read_ulf_file(make_absolute(cmdline.get_arg("-ulf")), substitutor);
 
 std::vector rc_tmpl;
-read_file(RC_TEMPLATE(cmdline), rc_tmpl);
+read_file(make_absolute(cmdline.get_arg("-rct")), rc_tmpl);
 
-std::ofstream rc_file(RC_FILE(cmdline));
-std::ifstream in_header(RC_HEADER(cmdline));
+std::ofstream rc_file(make_absolute(cmdline.get_arg("-rc")));
+std::ifstream in_header(make_absolute(cmdline.get_arg("-rch")));
 concatenate_files(rc_file, in_header);
 
 inflate_rc_template_to_file(rc_file, rc_tmpl, substitutor);
 
-std::ifstream in_footer(RC_FOOTER(cmdline));
+std::ifstream in_footer(make_absolute(cmdline.get_arg("-rcf")));
 concatenate_files(rc_file, in_footer);
 }
 catch(const std::ios::failure& ex)


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

2022-07-27 Thread Vasily Melenchuk (via logerrit)
 shell/source/win32/simplemail/smplmailclient.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 772f7a2dc3508bdebb53b6de4a43685d517cf1ef
Author: Vasily Melenchuk 
AuthorDate: Tue Jul 26 20:41:34 2022 +0300
Commit: Thorsten Behrens 
CommitDate: Wed Jul 27 14:27:03 2022 +0200

tdf#150161: senddoc: use corrected name url: original can be a file path

...and in this case file name will be not parsed and --attach-name
parameter will be empty. This leads to missing file name of
attachment. In case of Thunderbird it is not a big problem,
but Outlook does not want to attach .tmp files: it is "potentially
unsafe attachment".

Change-Id: I7c2f696391e1183211a169b08004c6668771f288
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/137480
Tested-by: Gabor Kelemen 
Reviewed-by: Mike Kaganski 
Reviewed-by: Thorsten Behrens 

diff --git a/shell/source/win32/simplemail/smplmailclient.cxx 
b/shell/source/win32/simplemail/smplmailclient.cxx
index 075eaa34579d..8e85ca0868ee 100644
--- a/shell/source/win32/simplemail/smplmailclient.cxx
+++ b/shell/source/win32/simplemail/smplmailclient.cxx
@@ -201,7 +201,7 @@ OUString CSmplMailClient::CopyAttachment(const OUString& 
sOrigAttachURL, OUStrin
 osl::FileBase::getFileURLFromSystemPath(sCorrectedOrigAttachURL, 
sCorrectedOrigAttachURL);
 if (osl::File::copy(sCorrectedOrigAttachURL, sNewAttachmentURL) == 
osl::FileBase::RC::E_None)
 {
-INetURLObject url(sOrigAttachURL, 
INetURLObject::EncodeMechanism::WasEncoded);
+INetURLObject url(sCorrectedOrigAttachURL, 
INetURLObject::EncodeMechanism::WasEncoded);
 sUserVisibleName = url.getName(INetURLObject::LAST_SEGMENT, true,
 INetURLObject::DecodeMechanism::WithCharset);
 nodelete = false;


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

2022-05-03 Thread Stephan Bergmann (via logerrit)
 shell/source/backends/wininetbe/wininetbackend.cxx |   16 
 1 file changed, 8 insertions(+), 8 deletions(-)

New commits:
commit b34f6f3b5ae6b889fbfd84719ee255282cb45e0e
Author: Stephan Bergmann 
AuthorDate: Tue May 3 23:19:33 2022 +0200
Commit: Stephan Bergmann 
CommitDate: Wed May 4 06:54:00 2022 +0200

Just use Any ctor instead of makeAny in shell

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

diff --git a/shell/source/backends/wininetbe/wininetbackend.cxx 
b/shell/source/backends/wininetbe/wininetbackend.cxx
index cc059e3e..71de3b135b4c 100644
--- a/shell/source/backends/wininetbe/wininetbackend.cxx
+++ b/shell/source/backends/wininetbe/wininetbackend.cxx
@@ -309,28 +309,28 @@ css::uno::Any WinInetBackend::getPropertyValue(
 {
 if ( PropertyName == "ooInetFTPProxyName" )
 {
-return css::uno::makeAny(valueFtpProxyName_);
+return css::uno::Any(valueFtpProxyName_);
 } else if ( PropertyName == "ooInetFTPProxyPort" )
 {
-return css::uno::makeAny(valueFtpProxyPort_);
+return css::uno::Any(valueFtpProxyPort_);
 } else if ( PropertyName == "ooInetHTTPProxyName" )
 {
-return css::uno::makeAny(valueHttpProxyName_);
+return css::uno::Any(valueHttpProxyName_);
 } else if ( PropertyName == "ooInetHTTPProxyPort" )
 {
-return css::uno::makeAny(valueHttpProxyPort_);
+return css::uno::Any(valueHttpProxyPort_);
 } else if ( PropertyName == "ooInetHTTPSProxyName" )
 {
-return css::uno::makeAny(valueHttpsProxyName_);
+return css::uno::Any(valueHttpsProxyName_);
 } else if ( PropertyName == "ooInetHTTPSProxyPort" )
 {
-return css::uno::makeAny(valueHttpsProxyPort_);
+return css::uno::Any(valueHttpsProxyPort_);
 } else if ( PropertyName == "ooInetNoProxy" )
 {
-return css::uno::makeAny(valueNoProxy_);
+return css::uno::Any(valueNoProxy_);
 } else if ( PropertyName == "ooInetProxyType" )
 {
-return css::uno::makeAny(valueProxyType_);
+return css::uno::Any(valueProxyType_);
 } else {
 throw css::beans::UnknownPropertyException(
 PropertyName, static_cast< cppu::OWeakObject * >(this));


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

2022-04-15 Thread Stephan Bergmann (via logerrit)
 shell/source/backends/wininetbe/wininetbackend.cxx |   38 -
 1 file changed, 22 insertions(+), 16 deletions(-)

New commits:
commit 6fd447aaf2f21a4708ca4e4268e209f4499cbeee
Author: Stephan Bergmann 
AuthorDate: Thu Apr 14 22:59:11 2022 +0200
Commit: Stephan Bergmann 
CommitDate: Fri Apr 15 13:42:34 2022 +0200

loplugin:stringviewparam

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

diff --git a/shell/source/backends/wininetbe/wininetbackend.cxx 
b/shell/source/backends/wininetbe/wininetbackend.cxx
index 8ac38b5517b3..cc059e3e 100644
--- a/shell/source/backends/wininetbe/wininetbackend.cxx
+++ b/shell/source/backends/wininetbe/wininetbackend.cxx
@@ -17,8 +17,14 @@
  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
  */
 
+#include 
+
+#include 
+#include 
+
 #include 
 #include 
+#include 
 #include 
 #include 
 
@@ -53,38 +59,38 @@ struct ProxyEntry
 OUString Port;
 };
 
-ProxyEntry ReadProxyEntry(const OUString& aProxy, sal_Int32& i)
+ProxyEntry ReadProxyEntry(std::u16string_view aProxy, std::size_t& i)
 {
 ProxyEntry aProxyEntry;
 
-aProxyEntry.Server = aProxy.getToken( 0, COLON, i );
-if ( i > -1 )
-aProxyEntry.Port = aProxy.getToken( 0, COLON, i );
+aProxyEntry.Server = o3tl::getToken( aProxy, COLON, i );
+if ( i != std::u16string_view::npos )
+aProxyEntry.Port = o3tl::getToken( aProxy, COLON, i );
 
 return aProxyEntry;
 }
 
-ProxyEntry FindProxyEntry(const OUString& aProxyList, const OUString& 
aType)
+ProxyEntry FindProxyEntry(std::u16string_view aProxyList, 
std::u16string_view aType)
 {
-sal_Int32 nIndex = 0;
+std::size_t nIndex = 0;
 
 do
 {
 // get the next token, e.g. ftp=server:port
-OUString nextToken = aProxyList.getToken( 0, SPACE, nIndex );
+std::u16string_view nextToken = o3tl::getToken( aProxyList, SPACE, 
nIndex );
 
 // split the next token again into the parts separated
 // through '=', e.g. ftp=server:port -> ftp and server:port
-sal_Int32 i = 0;
-if( nextToken.indexOf( EQUAL_SIGN ) > -1 )
+std::size_t i = 0;
+if( nextToken.find( EQUAL_SIGN ) != std::u16string_view::npos )
 {
-if( aType.equals( nextToken.getToken( 0, EQUAL_SIGN, i ) ) )
+if( aType == o3tl::getToken( nextToken, EQUAL_SIGN, i ) )
 return ReadProxyEntry(nextToken, i);
 }
-else if( aType.isEmpty())
+else if( aType.empty())
 return ReadProxyEntry(nextToken, i);
 
-} while ( nIndex >= 0 );
+} while ( nIndex != std::u16string_view::npos );
 
 return ProxyEntry();
 }
@@ -215,11 +221,11 @@ WinInetBackend::WinInetBackend()
 // there is one and it has a port
 
 
-ProxyEntry aTypeIndepProxy = FindProxyEntry( aProxyList, 
OUString());
-ProxyEntry aHttpProxy = FindProxyEntry( aProxyList, "http" );
-ProxyEntry aHttpsProxy  = FindProxyEntry( aProxyList, "https" 
);
+ProxyEntry aTypeIndepProxy = FindProxyEntry( aProxyList, u"");
+ProxyEntry aHttpProxy = FindProxyEntry( aProxyList, u"http" );
+ProxyEntry aHttpsProxy  = FindProxyEntry( aProxyList, u"https" 
);
 
-ProxyEntry aFtpProxy  = FindProxyEntry( aProxyList, "ftp" );
+ProxyEntry aFtpProxy  = FindProxyEntry( aProxyList, u"ftp" );
 
 if( aTypeIndepProxy.Server.getLength() )
 {


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

2022-04-15 Thread Stephan Bergmann (via logerrit)
 shell/source/win32/SysShExec.cxx |   17 ++---
 1 file changed, 10 insertions(+), 7 deletions(-)

New commits:
commit dcd969ba5237e897c5767854df30f31fc8b4ee32
Author: Stephan Bergmann 
AuthorDate: Thu Apr 14 23:00:06 2022 +0200
Commit: Stephan Bergmann 
CommitDate: Fri Apr 15 08:38:07 2022 +0200

loplugin:stringviewparam

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

diff --git a/shell/source/win32/SysShExec.cxx b/shell/source/win32/SysShExec.cxx
index d01c01f839ea..066b818abe92 100644
--- a/shell/source/win32/SysShExec.cxx
+++ b/shell/source/win32/SysShExec.cxx
@@ -19,6 +19,8 @@
 
 #include 
 #include 
+#include 
+#include 
 
 #include 
 #include 
@@ -34,6 +36,7 @@
 #include 
 #include 
 #include 
+#include 
 
 #include 
 #include 
@@ -166,12 +169,12 @@ CSysShExec::~CSysShExec()
 
 namespace
 {
-bool checkExtension(OUString const & extension, OUString const & denylist) {
-assert(!extension.isEmpty());
-for (sal_Int32 i = 0; i != -1;) {
-OUString tok = denylist.getToken(0, ';', i);
-tok.startsWith(".", );
-if (extension.equalsIgnoreAsciiCase(tok)) {
+bool checkExtension(std::u16string_view extension, std::u16string_view 
denylist) {
+assert(!extension.empty());
+for (std::size_t i = 0; i != std::u16string_view::npos;) {
+std::u16string_view tok = o3tl::getToken(denylist, ';', i);
+o3tl::starts_with(tok, u'.', );
+if (o3tl::equalsIgnoreAsciiCase(extension, tok)) {
 return false;
 }
 }
@@ -343,7 +346,7 @@ void SAL_CALL CSysShExec::execute( const OUString& 
aCommand, const OUString& aPa
 if (!(checkExtension(ext, env)
   && checkExtension(
   ext,
-  
".ADE;.ADP;.APK;.APPLICATION;.APPX;.APPXBUNDLE;.BAT;.CAB;.CHM;.CLASS;"
+  
u".ADE;.ADP;.APK;.APPLICATION;.APPX;.APPXBUNDLE;.BAT;.CAB;.CHM;.CLASS;"
   
".CMD;.COM;.CPL;.DLL;.DMG;.EX;.EX_;.EXE;.GADGET;.HTA;.INF;.INS;.IPA;"
   
".ISO;.ISP;.JAR;.JS;.JSE;.LIB;.LNK;.MDE;.MSC;.MSH;.MSH1;.MSH2;.MSHXML;"
   
".MSH1XML;.MSH2XML;.MSI;.MSIX;.MSIXBUNDLE;.MSP;.MST;.NSH;.PIF;.PS1;"


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

2022-04-10 Thread Stephan Bergmann (via logerrit)
 shell/source/win32/jumplist/JumpList.cxx |   32 ++-
 1 file changed, 15 insertions(+), 17 deletions(-)

New commits:
commit 7e3d93fd5776244e9028ff4fb3b551222b49cd87
Author: Stephan Bergmann 
AuthorDate: Sun Apr 10 09:54:26 2022 +0200
Commit: Stephan Bergmann 
CommitDate: Sun Apr 10 10:54:32 2022 +0200

Various loplugin warnings (in new Windows-only code)

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

diff --git a/shell/source/win32/jumplist/JumpList.cxx 
b/shell/source/win32/jumplist/JumpList.cxx
index a8770840d38e..f5d8ca8532cd 100644
--- a/shell/source/win32/jumplist/JumpList.cxx
+++ b/shell/source/win32/jumplist/JumpList.cxx
@@ -46,13 +46,14 @@ using namespace css::system::windows;
 using namespace osl;
 using namespace sal::systools;
 
+namespace
+{
 class JumpListImpl : public BaseMutex, public 
WeakComponentImplHelper
 {
 Reference m_xContext;
 
 public:
 explicit JumpListImpl(const Reference& xContext);
-~JumpListImpl();
 
 // XJumpList
 virtual void SAL_CALL appendCategory(const OUString& sCategory,
@@ -73,10 +74,6 @@ JumpListImpl::JumpListImpl(const 
Reference& xContext)
 {
 }
 
-JumpListImpl::~JumpListImpl() {}
-
-namespace
-{
 // Determines if the provided IShellLinkItem is listed in the array of items 
that the user has removed
 bool lcl_isItemInArray(COMReference pShellLinkItem,
COMReference poaRemoved)
@@ -155,7 +152,7 @@ void SAL_CALL JumpListImpl::appendCategory(const OUString& 
sCategory,
 COMReference 
aCollection(CLSID_EnumerableObjectCollection, nullptr,
 CLSCTX_INPROC_SERVER);
 
-for (auto item : aJumpListItems)
+for (auto const& item : aJumpListItems)
 {
 if (item.name.isEmpty())
 continue;
@@ -178,20 +175,21 @@ void SAL_CALL JumpListImpl::appendCategory(const 
OUString& sCategory,
 
 PropVariantClear();
 }
-ThrowIfFailed(
-
pShellLinkItem->SetDescription(o3tl::toW(item.description.getStr())),
-OString("Setting description '" + 
item.description.toUtf8() + "' failed."));
-
-
ThrowIfFailed(pShellLinkItem->SetPath(o3tl::toW(sofficePath.getStr())),
-  OString("Setting path '" + sofficePath.toUtf8() 
+ "' failed."));
+
ThrowIfFailed(pShellLinkItem->SetDescription(o3tl::toW(item.description.getStr())),
+  OStringConcatenation("Setting description '"
+   + item.description.toUtf8() 
+ "' failed."));
 
 ThrowIfFailed(
-
pShellLinkItem->SetArguments(o3tl::toW(item.arguments.getStr())),
-OString("Setting arguments '" + item.arguments.toUtf8() + 
"' failed."));
+pShellLinkItem->SetPath(o3tl::toW(sofficePath.getStr())),
+OStringConcatenation("Setting path '" + 
sofficePath.toUtf8() + "' failed."));
 
-ThrowIfFailed(
-
pShellLinkItem->SetIconLocation(o3tl::toW(item.iconPath.getStr()), 0),
-OString("Setting icon path '" + item.iconPath.toUtf8() + 
"' failed."));
+
ThrowIfFailed(pShellLinkItem->SetArguments(o3tl::toW(item.arguments.getStr())),
+  OStringConcatenation("Setting arguments '" + 
item.arguments.toUtf8()
+   + "' failed."));
+
+
ThrowIfFailed(pShellLinkItem->SetIconLocation(o3tl::toW(item.iconPath.getStr()),
 0),
+  OStringConcatenation("Setting icon path '" + 
item.iconPath.toUtf8()
+   + "' failed."));
 
 if (lcl_isItemInArray(pShellLinkItem, removed))
 {


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

2022-03-03 Thread Stephan Bergmann (via logerrit)
 shell/source/unix/exec/shellexec.cxx |6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

New commits:
commit c1ac79906bde5c902be5cb0ae6b530da96e52169
Author: Stephan Bergmann 
AuthorDate: Thu Mar 3 16:13:42 2022 +0100
Commit: Stephan Bergmann 
CommitDate: Thu Mar 3 18:59:16 2022 +0100

Handle symlinks

LIBREOFFICE-PQ967WYM

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

diff --git a/shell/source/unix/exec/shellexec.cxx 
b/shell/source/unix/exec/shellexec.cxx
index d33553022471..240113ae8271 100644
--- a/shell/source/unix/exec/shellexec.cxx
+++ b/shell/source/unix/exec/shellexec.cxx
@@ -131,12 +131,12 @@ void SAL_CALL ShellExec::execute( const OUString& 
aCommand, const OUString& aPar
 0);
 }
 struct stat st;
-auto const e2 = stat(pathname8.getStr(), );
+auto const e2 = lstat(pathname8.getStr(), );
 if (e2 != 0) {
 auto const e3 = errno;
-SAL_INFO("shell", "stat(" << pathname8 << ") failed with errno 
" << e3);
+SAL_INFO("shell", "lstat(" << pathname8 << ") failed with 
errno " << e3);
 }
-if (e2 == 0 && S_ISDIR(st.st_mode)) {
+if (e2 == 0 && (S_ISDIR(st.st_mode) || S_ISLNK(st.st_mode))) {
 dir = true;
 } else if (e2 != 0 || !S_ISREG(st.st_mode)
|| (st.st_mode & (S_IXUSR | S_IXGRP | S_IXOTH)) != 0)


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

2022-02-23 Thread Caolán McNamara (via logerrit)
 shell/source/unix/exec/shellexec.cxx |2 ++
 1 file changed, 2 insertions(+)

New commits:
commit 3e67678af2f6f8f7d25c5ad67b3828e96bc293b8
Author: Caolán McNamara 
AuthorDate: Tue Feb 22 20:38:55 2022 +
Commit: Stephan Bergmann 
CommitDate: Thu Feb 24 08:54:18 2022 +0100

add to suffix denylist

add the macOS specific suffixes from
https: 
//support.google.com/mail/answer/6590?hl=en#zippy=%2Cmessages-that-have-attachments

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

diff --git a/shell/source/unix/exec/shellexec.cxx 
b/shell/source/unix/exec/shellexec.cxx
index ada512b47ba3..d33553022471 100644
--- a/shell/source/unix/exec/shellexec.cxx
+++ b/shell/source/unix/exec/shellexec.cxx
@@ -144,8 +144,10 @@ void SAL_CALL ShellExec::execute( const OUString& 
aCommand, const OUString& aPar
 throw css::lang::IllegalArgumentException(
 "XSystemShellExecute.execute, cannot process <" + aCommand 
+ ">", {}, 0);
 } else if (pathname.endsWithIgnoreAsciiCase(".class")
+   || pathname.endsWithIgnoreAsciiCase(".dmg")
|| pathname.endsWithIgnoreAsciiCase(".fileloc")
|| pathname.endsWithIgnoreAsciiCase(".inetloc")
+   || pathname.endsWithIgnoreAsciiCase(".ipa")
|| pathname.endsWithIgnoreAsciiCase(".jar")
|| pathname.endsWithIgnoreAsciiCase(".terminal"))
 {


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

2022-02-23 Thread Caolán McNamara (via logerrit)
 shell/source/win32/SysShExec.cxx |8 ++--
 1 file changed, 6 insertions(+), 2 deletions(-)

New commits:
commit 4751853b19dabfb57963c58183b0c3557328b3b8
Author: Caolán McNamara 
AuthorDate: Tue Feb 22 20:27:18 2022 +
Commit: Caolán McNamara 
CommitDate: Wed Feb 23 15:41:41 2022 +0100

add to suffix denylist

mostly https: 
//support.google.com/mail/answer/6590?hl=en#zippy=%2Cmessages-that-have-attachments

but see also:

https://www.howtogeek.com/137270/50-file-extensions-that-are-potentially-dangerous-on-windows

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

diff --git a/shell/source/win32/SysShExec.cxx b/shell/source/win32/SysShExec.cxx
index 27243b1c5dc3..d01c01f839ea 100644
--- a/shell/source/win32/SysShExec.cxx
+++ b/shell/source/win32/SysShExec.cxx
@@ -343,8 +343,12 @@ void SAL_CALL CSysShExec::execute( const OUString& 
aCommand, const OUString& aPa
 if (!(checkExtension(ext, env)
   && checkExtension(
   ext,
-  
".APPLICATION;.BAT;.CLASS;.CMD;.COM;.EXE;.JAR;.JS;"
-  
".JSE;.LNK;.MSC;.MSI;.PY;.SCR;.VBE;.VBS;.WSF;.WSH;")))
+  
".ADE;.ADP;.APK;.APPLICATION;.APPX;.APPXBUNDLE;.BAT;.CAB;.CHM;.CLASS;"
+  
".CMD;.COM;.CPL;.DLL;.DMG;.EX;.EX_;.EXE;.GADGET;.HTA;.INF;.INS;.IPA;"
+  
".ISO;.ISP;.JAR;.JS;.JSE;.LIB;.LNK;.MDE;.MSC;.MSH;.MSH1;.MSH2;.MSHXML;"
+  
".MSH1XML;.MSH2XML;.MSI;.MSIX;.MSIXBUNDLE;.MSP;.MST;.NSH;.PIF;.PS1;"
+  
".PS1XML;.PS2;.PS2XML;.PSC1;.PSC2;.PY;.REG;.SCF;.SCR;.SCT;.SHB;.SYS;"
+  ".VB;.VBE;.VBS;.VXD;.WS;.WSC;.WSF;.WSH;")))
 {
 throw css::lang::IllegalArgumentException(
 "XSystemShellExecute.execute, cannot process <" + 
aCommand + ">", {},


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

2022-02-22 Thread Caolán McNamara (via logerrit)
 shell/source/win32/SysShExec.cxx |4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

New commits:
commit ff66c1d82b34ea8efbfb61835f6ec951e5b32caa
Author: Caolán McNamara 
AuthorDate: Tue Feb 22 09:41:26 2022 +
Commit: Caolán McNamara 
CommitDate: Tue Feb 22 13:40:46 2022 +0100

sort these alphabetically

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

diff --git a/shell/source/win32/SysShExec.cxx b/shell/source/win32/SysShExec.cxx
index ba8dc4e8a3ae..27243b1c5dc3 100644
--- a/shell/source/win32/SysShExec.cxx
+++ b/shell/source/win32/SysShExec.cxx
@@ -343,8 +343,8 @@ void SAL_CALL CSysShExec::execute( const OUString& 
aCommand, const OUString& aPa
 if (!(checkExtension(ext, env)
   && checkExtension(
   ext,
-  
".COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.MSC;.MSI;.PY;.CLASS;"
-  ".JAR;.APPLICATION;.LNK;.SCR")))
+  
".APPLICATION;.BAT;.CLASS;.CMD;.COM;.EXE;.JAR;.JS;"
+  
".JSE;.LNK;.MSC;.MSI;.PY;.SCR;.VBE;.VBS;.WSF;.WSH;")))
 {
 throw css::lang::IllegalArgumentException(
 "XSystemShellExecute.execute, cannot process <" + 
aCommand + ">", {},


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

2022-02-22 Thread Renwa Hiwa (via logerrit)
 shell/source/win32/SysShExec.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 0b0b1820d2e287a193b83ae8a64cb2c53521c7d6
Author: Renwa Hiwa 
AuthorDate: Tue Feb 22 09:36:29 2022 +
Commit: Caolán McNamara 
CommitDate: Tue Feb 22 12:40:12 2022 +0100

Better handling of msi

LIBREOFFICE-SK4E5D8N

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

diff --git a/shell/source/win32/SysShExec.cxx b/shell/source/win32/SysShExec.cxx
index 8eec8b52d96f..ba8dc4e8a3ae 100644
--- a/shell/source/win32/SysShExec.cxx
+++ b/shell/source/win32/SysShExec.cxx
@@ -343,7 +343,7 @@ void SAL_CALL CSysShExec::execute( const OUString& 
aCommand, const OUString& aPa
 if (!(checkExtension(ext, env)
   && checkExtension(
   ext,
-  
".COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.MSC;.PY;.CLASS;"
+  
".COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.MSC;.MSI;.PY;.CLASS;"
   ".JAR;.APPLICATION;.LNK;.SCR")))
 {
 throw css::lang::IllegalArgumentException(


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

2022-02-17 Thread Renwa Hiwa (via logerrit)
 shell/source/unix/exec/shellexec.cxx |3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

New commits:
commit 7d92ec5ae18fdec8a3182b1138a62b65e2d14c10
Author: Renwa Hiwa 
AuthorDate: Thu Feb 17 16:30:37 2022 +
Commit: Caolán McNamara 
CommitDate: Thu Feb 17 19:43:46 2022 +0100

Better handling of terminals

LIBREOFFICE-3MQTR80G

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

diff --git a/shell/source/unix/exec/shellexec.cxx 
b/shell/source/unix/exec/shellexec.cxx
index e3d4308df78f..ada512b47ba3 100644
--- a/shell/source/unix/exec/shellexec.cxx
+++ b/shell/source/unix/exec/shellexec.cxx
@@ -146,7 +146,8 @@ void SAL_CALL ShellExec::execute( const OUString& aCommand, 
const OUString& aPar
 } else if (pathname.endsWithIgnoreAsciiCase(".class")
|| pathname.endsWithIgnoreAsciiCase(".fileloc")
|| pathname.endsWithIgnoreAsciiCase(".inetloc")
-   || pathname.endsWithIgnoreAsciiCase(".jar"))
+   || pathname.endsWithIgnoreAsciiCase(".jar")
+   || pathname.endsWithIgnoreAsciiCase(".terminal"))
 {
 dir = true;
 }


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

2022-02-09 Thread Caolán McNamara (via logerrit)
 shell/source/unix/exec/shellexec.cxx |4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

New commits:
commit 0a1d94d58d6eff85f6266ea01ae1722217ae0b01
Author: Caolán McNamara 
AuthorDate: Wed Feb 9 13:25:29 2022 +0100
Commit: Caolán McNamara 
CommitDate: Wed Feb 9 20:57:51 2022 +0100

Revert "add webloc and url extensions"

This reverts commit e4c3fa614d9be6e32dde49970ace55d9a2b57368.

Reason for revert: there's no evidence that they should be in this list

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

diff --git a/shell/source/unix/exec/shellexec.cxx 
b/shell/source/unix/exec/shellexec.cxx
index e2df20e026ac..e3d4308df78f 100644
--- a/shell/source/unix/exec/shellexec.cxx
+++ b/shell/source/unix/exec/shellexec.cxx
@@ -146,9 +146,7 @@ void SAL_CALL ShellExec::execute( const OUString& aCommand, 
const OUString& aPar
 } else if (pathname.endsWithIgnoreAsciiCase(".class")
|| pathname.endsWithIgnoreAsciiCase(".fileloc")
|| pathname.endsWithIgnoreAsciiCase(".inetloc")
-   || pathname.endsWithIgnoreAsciiCase(".jar")
-   || pathname.endsWithIgnoreAsciiCase(".url")
-   || pathname.endsWithIgnoreAsciiCase(".webloc"))
+   || pathname.endsWithIgnoreAsciiCase(".jar"))
 {
 dir = true;
 }


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

2022-02-09 Thread Caolán McNamara (via logerrit)
 shell/source/unix/exec/shellexec.cxx |4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

New commits:
commit e4c3fa614d9be6e32dde49970ace55d9a2b57368
Author: Caolán McNamara 
AuthorDate: Wed Feb 9 10:10:52 2022 +
Commit: Caolán McNamara 
CommitDate: Wed Feb 9 13:05:44 2022 +0100

add webloc and url extensions

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

diff --git a/shell/source/unix/exec/shellexec.cxx 
b/shell/source/unix/exec/shellexec.cxx
index e3d4308df78f..e2df20e026ac 100644
--- a/shell/source/unix/exec/shellexec.cxx
+++ b/shell/source/unix/exec/shellexec.cxx
@@ -146,7 +146,9 @@ void SAL_CALL ShellExec::execute( const OUString& aCommand, 
const OUString& aPar
 } else if (pathname.endsWithIgnoreAsciiCase(".class")
|| pathname.endsWithIgnoreAsciiCase(".fileloc")
|| pathname.endsWithIgnoreAsciiCase(".inetloc")
-   || pathname.endsWithIgnoreAsciiCase(".jar"))
+   || pathname.endsWithIgnoreAsciiCase(".jar")
+   || pathname.endsWithIgnoreAsciiCase(".url")
+   || pathname.endsWithIgnoreAsciiCase(".webloc"))
 {
 dir = true;
 }


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

2022-02-09 Thread Renwa Hiwa (via logerrit)
 shell/source/unix/exec/shellexec.cxx |1 +
 1 file changed, 1 insertion(+)

New commits:
commit 7484c3393dc2216239cdb730983725fe2e08e730
Author: Renwa Hiwa 
AuthorDate: Wed Feb 9 10:02:14 2022 +
Commit: Caolán McNamara 
CommitDate: Wed Feb 9 13:05:28 2022 +0100

Better handling of inetlocs

LIBREOFFICE-39BBF6YM

Change-Id: Iadae856a524a0ccda238785f60c8f3459e7b6157
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/129714
Reviewed-by: Stephan Bergmann 
Reviewed-by: Caolán McNamara 
Tested-by: Caolán McNamara 

diff --git a/shell/source/unix/exec/shellexec.cxx 
b/shell/source/unix/exec/shellexec.cxx
index 2e2b2040af1b..e3d4308df78f 100644
--- a/shell/source/unix/exec/shellexec.cxx
+++ b/shell/source/unix/exec/shellexec.cxx
@@ -145,6 +145,7 @@ void SAL_CALL ShellExec::execute( const OUString& aCommand, 
const OUString& aPar
 "XSystemShellExecute.execute, cannot process <" + aCommand 
+ ">", {}, 0);
 } else if (pathname.endsWithIgnoreAsciiCase(".class")
|| pathname.endsWithIgnoreAsciiCase(".fileloc")
+   || pathname.endsWithIgnoreAsciiCase(".inetloc")
|| pathname.endsWithIgnoreAsciiCase(".jar"))
 {
 dir = true;


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

2022-01-08 Thread Mike Kaganski (via logerrit)
 shell/source/win32/spsupp/spsuppHelper.cxx |   17 +
 1 file changed, 5 insertions(+), 12 deletions(-)

New commits:
commit d0445802a86d67b55b5e333a4c815d062b5e6036
Author: Mike Kaganski 
AuthorDate: Fri Jan 7 13:16:58 2022 +0300
Commit: Mike Kaganski 
CommitDate: Sat Jan 8 10:07:54 2022 +0100

Use WindowsErrorString instead of FormatMessageW

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

diff --git a/shell/source/win32/spsupp/spsuppHelper.cxx 
b/shell/source/win32/spsupp/spsuppHelper.cxx
index b5f6514decd6..af3509b87c8b 100644
--- a/shell/source/win32/spsupp/spsuppHelper.cxx
+++ b/shell/source/win32/spsupp/spsuppHelper.cxx
@@ -10,6 +10,7 @@
 #include 
 #include 
 
+#include 
 #include 
 #include 
 #include 
@@ -132,20 +133,12 @@ DWORD LOStart(const wchar_t* sModeArg, const wchar_t* 
sFilePath)
 if (!CreateProcessW(nullptr, pCmdLine, nullptr, nullptr, FALSE, 0, 
nullptr, nullptr, , ))
 {
 DWORD dwError = GetLastError();
-wchar_t* sMsgBuf = nullptr;
-FormatMessageW(FORMAT_MESSAGE_ALLOCATE_BUFFER | 
FORMAT_MESSAGE_FROM_SYSTEM
-   | FORMAT_MESSAGE_IGNORE_INSERTS,
-   nullptr, dwError, MAKELANGID(LANG_NEUTRAL, 
SUBLANG_DEFAULT),
-   reinterpret_cast(), 0, nullptr);
-
-size_t nBufSize = wcslen(sMsgBuf) + 100;
-std::vector sDisplayBuf(nBufSize);
-swprintf(sDisplayBuf.data(), nBufSize,
- L"Could not start LibreOffice. Error is 0x%08X:\n\n%s", 
dwError, sMsgBuf);
-HeapFree(GetProcessHeap(), 0, sMsgBuf);
+const OUString sErrorMsg = "Could not start LibreOffice. Error is 0x"
+   + OUString::number(dwError, 16) + ":\n\n"
+   + WindowsErrorString(dwError);
 
 // Report the error to user and return error
-MessageBoxW(nullptr, sDisplayBuf.data(), nullptr, MB_ICONERROR);
+MessageBoxW(nullptr, o3tl::toW(sErrorMsg.getStr()), nullptr, 
MB_ICONERROR);
 return dwError;
 }
 CloseHandle(pi.hProcess);


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

2021-10-30 Thread Mike Kaganski (via logerrit)
 shell/source/cmdmail/cmdmailmsg.cxx   |   15 ---
 shell/source/cmdmail/cmdmailsuppl.cxx |3 +--
 2 files changed, 9 insertions(+), 9 deletions(-)

New commits:
commit c6af59b234e8eb8182dc7f686290524feafd6ed6
Author: Mike Kaganski 
AuthorDate: Fri Oct 29 10:04:32 2021 +0300
Commit: Mike Kaganski 
CommitDate: Sat Oct 30 23:18:51 2021 +0200

Prepare for removal of non-const operator[] from Sequence in shell

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

diff --git a/shell/source/cmdmail/cmdmailmsg.cxx 
b/shell/source/cmdmail/cmdmailmsg.cxx
index 2a6a5f843af2..bb8c8bc05559 100644
--- a/shell/source/cmdmail/cmdmailmsg.cxx
+++ b/shell/source/cmdmail/cmdmailmsg.cxx
@@ -145,27 +145,28 @@ Sequence< OUString > SAL_CALL 
CmdMailMsg::getElementNames(  )
 
 sal_Int32 nItems = 0;
 Sequence< OUString > aRet( 7 );
+auto pRet = aRet.getArray();
 
 if( !m_aBody.isEmpty() )
-aRet[nItems++] = "body";
+pRet[nItems++] = "body";
 
 if( !m_aOriginator.isEmpty() )
-aRet[nItems++] = "from";
+pRet[nItems++] = "from";
 
 if( !m_aRecipient.isEmpty() )
-aRet[nItems++] = "to";
+pRet[nItems++] = "to";
 
 if( m_CcRecipients.hasElements() )
-aRet[nItems++] = "cc";
+pRet[nItems++] = "cc";
 
 if( m_BccRecipients.hasElements() )
-aRet[nItems++] = "bcc";
+pRet[nItems++] = "bcc";
 
 if( !m_aSubject.isEmpty() )
-aRet[nItems++] = "subject";
+pRet[nItems++] = "subject";
 
 if( m_Attachments.hasElements() )
-aRet[nItems++] = "attachment";
+pRet[nItems++] = "attachment";
 
 aRet.realloc( nItems );
 return aRet;
diff --git a/shell/source/cmdmail/cmdmailsuppl.cxx 
b/shell/source/cmdmail/cmdmailsuppl.cxx
index c65372f5430e..00b6517c4648 100644
--- a/shell/source/cmdmail/cmdmailsuppl.cxx
+++ b/shell/source/cmdmail/cmdmailsuppl.cxx
@@ -147,8 +147,7 @@ void SAL_CALL CmdMailSuppl::sendSimpleMailMessage( const 
Reference< XSimpleMailM
 aProperty.Name = "nodepath";
 aProperty.Value <<= 
OUString("org.openoffice.Office.Common/ExternalMailer");
 
-Sequence< Any > aArgumentList( 1 );
-aArgumentList[0] <<= aProperty;
+Sequence< Any > aArgumentList{ Any(aProperty) };
 
 Reference< XNameAccess > xNameAccess(
 m_xConfigurationProvider->createInstanceWithArguments(


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

2021-09-30 Thread Stephan Bergmann (via logerrit)
 shell/source/win32/shlxthandler/classfactory.cxx|2 -
 shell/source/win32/shlxthandler/columninfo/columninfo.cxx   |2 -
 shell/source/win32/shlxthandler/ooofilt/ooofilt.cxx |   16 ++--
 shell/source/win32/shlxthandler/thumbviewer/thumbviewer.cxx |2 -
 4 files changed, 11 insertions(+), 11 deletions(-)

New commits:
commit bf59a45b043b4bcea276bd862f3c6e5c3175e1e9
Author: Stephan Bergmann 
AuthorDate: Thu Sep 30 12:42:36 2021 +0200
Commit: Stephan Bergmann 
CommitDate: Thu Sep 30 15:09:21 2021 +0200

Extended loplugin:referencecasting/redundantcast (clang-cl): shell

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

diff --git a/shell/source/win32/shlxthandler/classfactory.cxx 
b/shell/source/win32/shlxthandler/classfactory.cxx
index e7384d36b577..95da69252089 100644
--- a/shell/source/win32/shlxthandler/classfactory.cxx
+++ b/shell/source/win32/shlxthandler/classfactory.cxx
@@ -99,7 +99,7 @@ HRESULT STDMETHODCALLTYPE CClassFactory::CreateInstance(
 pUnk = static_cast(new CInfoTip());
 
 else if (CLSID_COLUMN_HANDLER == m_Clsid)
-pUnk = static_cast(new CColumnInfo());
+pUnk = new CColumnInfo();
 
 else if (CLSID_THUMBVIEWER_HANDLER == m_Clsid)
 pUnk = static_cast(new CThumbviewer());
diff --git a/shell/source/win32/shlxthandler/columninfo/columninfo.cxx 
b/shell/source/win32/shlxthandler/columninfo/columninfo.cxx
index c036a63f8f7d..81393140d51c 100644
--- a/shell/source/win32/shlxthandler/columninfo/columninfo.cxx
+++ b/shell/source/win32/shlxthandler/columninfo/columninfo.cxx
@@ -77,7 +77,7 @@ COM_DECLSPEC_NOTHROW HRESULT STDMETHODCALLTYPE 
CColumnInfo::QueryInterface(REFII
 
 if (IID_IUnknown == riid || IID_IColumnProvider == riid)
 {
-IUnknown* pUnk = static_cast(this);
+IUnknown* pUnk = this;
 pUnk->AddRef();
 *ppvObject = pUnk;
 return S_OK;
diff --git a/shell/source/win32/shlxthandler/ooofilt/ooofilt.cxx 
b/shell/source/win32/shlxthandler/ooofilt/ooofilt.cxx
index 7088dfbc027b..c45c69930cfb 100644
--- a/shell/source/win32/shlxthandler/ooofilt/ooofilt.cxx
+++ b/shell/source/win32/shlxthandler/ooofilt/ooofilt.cxx
@@ -127,15 +127,15 @@ HRESULT STDMETHODCALLTYPE COooFilter::QueryInterface(
 {
 IUnknown *pUnkTemp = nullptr;
 if ( IID_IFilter == riid )
-pUnkTemp = static_cast(static_cast(this));
+pUnkTemp = static_cast(this);
 else if ( IID_IPersistFile == riid )
-pUnkTemp = static_cast(static_cast(this));
+pUnkTemp = static_cast(this);
 else if ( IID_IPersist == riid )
-pUnkTemp = static_cast(static_cast(static_cast(this)));
+pUnkTemp = static_cast(this);
 else if (IID_IPersistStream == riid)
-pUnkTemp = static_cast(static_cast(this));
+pUnkTemp = static_cast(this);
 else if ( IID_IUnknown == riid )
-pUnkTemp = static_cast(static_cast(static_cast(this)));
+pUnkTemp = static_cast(this);
 else
 {
 *ppvObject = nullptr;
@@ -723,9 +723,9 @@ HRESULT STDMETHODCALLTYPE 
COooFilterCF::QueryInterface(REFIID riid, void  ** ppv
 IUnknown *pUnkTemp;
 
 if ( IID_IClassFactory == riid )
-pUnkTemp = static_cast(static_cast(this));
+pUnkTemp = this;
 else if ( IID_IUnknown == riid )
-pUnkTemp = static_cast(this);
+pUnkTemp = this;
 else
 {
 *ppvObject = nullptr;
@@ -882,7 +882,7 @@ extern "C" HRESULT STDMETHODCALLTYPE DllGetClassObject(
 if ( CLSID_COooFilter == cid )
 {
 pImpl = new COooFilterCF;
-pResult = static_cast(pImpl);
+pResult = pImpl;
 }
 else
 return CLASS_E_CLASSNOTAVAILABLE;
diff --git a/shell/source/win32/shlxthandler/thumbviewer/thumbviewer.cxx 
b/shell/source/win32/shlxthandler/thumbviewer/thumbviewer.cxx
index ad5cbe03b0e1..657664ff5866 100644
--- a/shell/source/win32/shlxthandler/thumbviewer/thumbviewer.cxx
+++ b/shell/source/win32/shlxthandler/thumbviewer/thumbviewer.cxx
@@ -157,7 +157,7 @@ HRESULT STDMETHODCALLTYPE 
StreamOnZipBuffer::QueryInterface(REFIID riid, void __
 
 if ((IID_IUnknown == riid) || (IID_IStream == riid))
 {
-pUnk = static_cast(this);
+pUnk = this;
 pUnk->AddRef();
 *ppvObject = pUnk;
 return S_OK;


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

2021-09-24 Thread Stephan Bergmann (via logerrit)
 shell/source/sessioninstall/SyncDbusSessionHelper.cxx |4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

New commits:
commit a93c3f2eb07fc15d1ebb0fd70ab58ecea27bd4f1
Author: Stephan Bergmann 
AuthorDate: Fri Sep 24 16:54:48 2021 +0200
Commit: Stephan Bergmann 
CommitDate: Fri Sep 24 20:53:42 2021 +0200

GError::message is UTF-8

This caused CppunitTest_sw_dialogs_test to fail for LO_TEST_LOCALE=or 
hitting

> sal/rtl/ustring.cxx:530: void rtl_uString_newFromAscii(rtl_uString**, 
const char*): Assertion `static_cast(*pCharStr) < 0x80' failed.

at

> #4  0x7fd18a844f74 in rtl_uString_newFromAscii(rtl_uString**, char 
const*) (ppThis=0x7ffcb73e6e90, pCharStr=0x6191180 "ସମୟ ସୀମା ପହଞ୍ଚିଯାଇଛି") at 
sal/rtl/ustring.cxx:530
> #5  0x7fd1525af9c1 in rtl::OUString::createFromAscii(char const*) 
(value=0x6191180 "ସମୟ ସୀମା ପହଞ୍ଚିଯାଇଛି") at include/rtl/ustring.hxx:3328
> #6  0x7fd1525ad026 in (anonymous 
namespace)::GErrorWrapper::~GErrorWrapper() (this=0x7ffcb73e6f38, 
__in_chrg=) at 
shell/source/sessioninstall/SyncDbusSessionHelper.cxx:35
> #7  0x7fd1525ad6a5 in (anonymous namespace)::request(char const*, 
com::sun::star::uno::Sequence const&, std::u16string_view) 
(method=0x7fd1525b481d "InstallFontconfigResources", resources=uno::Sequence of 
length 1 = {...}, interaction=u"hide-finished") at 
shell/source/sessioninstall/SyncDbusSessionHelper.cxx:91
> #8  0x7fd1525ada9d in 
shell::sessioninstall::SyncDbusSessionHelper::InstallFontconfigResources(com::sun::star::uno::Sequence
 const&, rtl::OUString const&) (this=0x5d22380, resources=uno::Sequence of 
length 1 = {...}, interaction="hide-finished") at 
shell/source/sessioninstall/SyncDbusSessionHelper.cxx:158
> #9  0x7fd178670daa in 
psp::PrintFontManager::autoInstallFontLangSupport(Timer*) (this=0x2e3ed90) at 
vcl/unx/generic/fontmanager/fontconfig.cxx:962
> #10 0x7fd178670cd9 in 
psp::PrintFontManager::LinkStubautoInstallFontLangSupport(void*, Timer*) 
(instance=0x2e3ed90, data=0x2e3efa0) at 
vcl/unx/generic/fontmanager/fontconfig.cxx:956
> #11 0x7fd178341e03 in Link::Call(Timer*) const 
(this=0x2e3efc0, data=0x2e3efa0) at include/tools/link.hxx:111
[...]

(But probably better to use the lenient OUString-from-rtl_TextEncoding ctor
rather than OUString::fromUtf8, in case GError::message happens to not 
contain
proper UTF-8 after all, which would make the latter assert.)

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

diff --git a/shell/source/sessioninstall/SyncDbusSessionHelper.cxx 
b/shell/source/sessioninstall/SyncDbusSessionHelper.cxx
index df2ef3529145..606eeb8fef03 100644
--- a/shell/source/sessioninstall/SyncDbusSessionHelper.cxx
+++ b/shell/source/sessioninstall/SyncDbusSessionHelper.cxx
@@ -11,6 +11,7 @@
 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -32,7 +33,8 @@ namespace
 {
 if(!m_pError)
 return;
-OUString sMsg = OUString::createFromAscii(m_pError->message);
+OUString sMsg(
+m_pError->message, std::strlen(m_pError->message), 
RTL_TEXTENCODING_UTF8);
 g_error_free(m_pError);
 throw RuntimeException(sMsg);
 }


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

2021-08-10 Thread Caolán McNamara (via logerrit)
 shell/source/backends/kf5be/kf5backend.cxx |8 +---
 1 file changed, 5 insertions(+), 3 deletions(-)

New commits:
commit 626cf243134961511b71351d65e4161d7c25c45e
Author: Caolán McNamara 
AuthorDate: Tue Aug 10 16:34:03 2021 +0100
Commit: Caolán McNamara 
CommitDate: Tue Aug 10 20:24:00 2021 +0200

drop final boost::noncopyable use

we replaced all the others, so replace this one too

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

diff --git a/shell/source/backends/kf5be/kf5backend.cxx 
b/shell/source/backends/kf5be/kf5backend.cxx
index e448c124d88a..e9e10e60fd27 100644
--- a/shell/source/backends/kf5be/kf5backend.cxx
+++ b/shell/source/backends/kf5be/kf5backend.cxx
@@ -23,7 +23,6 @@
 
 #include 
 
-#include 
 #include 
 #include 
 #include 
@@ -50,13 +49,16 @@
 
 namespace
 {
-class Service : public cppu::WeakImplHelper,
-private boost::noncopyable
+class Service : public cppu::WeakImplHelper
 {
 public:
 Service();
 
 private:
+// noncopyable until we have good reasons...
+Service(const Service&) = delete;
+Service& operator=(const Service&) = delete;
+
 virtual ~Service() override {}
 
 virtual OUString SAL_CALL getImplementationName() override


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

2021-06-25 Thread Stephan Bergmann (via logerrit)
 shell/source/win32/shlxthandler/infotips/infotips.cxx   |2 +-
 shell/source/win32/shlxthandler/thumbviewer/thumbviewer.cxx |2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

New commits:
commit 7d5346eb09a9e4acc72c646800e77f363fe10e2f
Author: Stephan Bergmann 
AuthorDate: Fri Jun 25 10:25:45 2021 +0200
Commit: Stephan Bergmann 
CommitDate: Fri Jun 25 21:10:28 2021 +0200

-Werror,-Wunused-but-set-parameter (clang-cl 13 trunk)

...revealing that these places apparently wanted to assign to *pClassID 
rather
than pClassID ever since their introduction with
b718f390bf3dcc85dc97b2ef7483d93bbe3968ec "INTEGRATION: CWS desktintgr01" and
9b1b1b00818d177ed32f5a3d0e0d1f41b40de926 "INTEGRATION: CWS desktintgr02"

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

diff --git a/shell/source/win32/shlxthandler/infotips/infotips.cxx 
b/shell/source/win32/shlxthandler/infotips/infotips.cxx
index 60343e1a4c0b..af03f4a32faa 100644
--- a/shell/source/win32/shlxthandler/infotips/infotips.cxx
+++ b/shell/source/win32/shlxthandler/infotips/infotips.cxx
@@ -308,7 +308,7 @@ COM_DECLSPEC_NOTHROW HRESULT STDMETHODCALLTYPE 
CInfoTip::GetInfoFlags(DWORD * /*
 
 HRESULT STDMETHODCALLTYPE CInfoTip::GetClassID(CLSID* pClassID)
 {
-pClassID = const_cast(_INFOTIP_HANDLER);
+*pClassID = CLSID_INFOTIP_HANDLER;
 return S_OK;
 }
 
diff --git a/shell/source/win32/shlxthandler/thumbviewer/thumbviewer.cxx 
b/shell/source/win32/shlxthandler/thumbviewer/thumbviewer.cxx
index a2ae80dd0daf..ad5cbe03b0e1 100644
--- a/shell/source/win32/shlxthandler/thumbviewer/thumbviewer.cxx
+++ b/shell/source/win32/shlxthandler/thumbviewer/thumbviewer.cxx
@@ -470,7 +470,7 @@ HRESULT STDMETHODCALLTYPE CThumbviewer::GetLocation(
 
 HRESULT STDMETHODCALLTYPE CThumbviewer::GetClassID(CLSID* pClassID)
 {
-pClassID = const_cast(_THUMBVIEWER_HANDLER);
+*pClassID = CLSID_THUMBVIEWER_HANDLER;
 return S_OK;
 }
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2021-05-28 Thread Linus Heckemann (via logerrit)
 shell/source/unix/exec/shellexec.cxx |2 +-
 shell/source/unix/misc/senddoc.sh|2 ++
 2 files changed, 3 insertions(+), 1 deletion(-)

New commits:
commit 85462ef7aed85bcfb0e0628c5252a07c369ff606
Author: Linus Heckemann 
AuthorDate: Sun Feb 7 12:55:24 2021 +0200
Commit: Caolán McNamara 
CommitDate: Fri May 28 11:25:25 2021 +0200

tdf#108591 Don't hardcode xdg-open path

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

diff --git a/shell/source/unix/exec/shellexec.cxx 
b/shell/source/unix/exec/shellexec.cxx
index 014782e62d27..87b78fe1d882 100644
--- a/shell/source/unix/exec/shellexec.cxx
+++ b/shell/source/unix/exec/shellexec.cxx
@@ -173,7 +173,7 @@ void SAL_CALL ShellExec::execute( const OUString& aCommand, 
const OUString& aPar
 aBuffer.append(" --");
 #else
 // Just use xdg-open on non-Mac
-aBuffer.append("/usr/bin/xdg-open");
+aBuffer.append("xdg-open");
 #endif
 aBuffer.append(" ");
 escapeForShell(aBuffer, OUStringToOString(aURL, 
osl_getThreadTextEncoding()));
diff --git a/shell/source/unix/misc/senddoc.sh 
b/shell/source/unix/misc/senddoc.sh
index 394087156a74..d4f9b08de89c 100755
--- a/shell/source/unix/misc/senddoc.sh
+++ b/shell/source/unix/misc/senddoc.sh
@@ -393,6 +393,8 @@ case $(basename "$MAILER" | sed 's/-.*$//') in
 MAILER=/usr/bin/kde-open
 elif [ -x /usr/bin/xdg-open ] ; then
 MAILER=/usr/bin/xdg-open
+elif command -v xdg-open >/dev/null 2>&1 ; then
+MAILER=$(command -v xdg-open)
 else
 echo "Unsupported mail client: $(basename $MAILER | sed 
's/-.*^//')"
 exit 2
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2021-05-20 Thread Arnaud Versini (via logerrit)
 shell/source/cmdmail/cmdmailmsg.cxx |   35 +--
 shell/source/cmdmail/cmdmailmsg.hxx |3 ++-
 2 files changed, 19 insertions(+), 19 deletions(-)

New commits:
commit 7a4fffb19fb3d573d9afd3f7136cd0e5b545b706
Author: Arnaud Versini 
AuthorDate: Sun Apr 18 16:28:49 2021 +0200
Commit: Michael Stahl 
CommitDate: Thu May 20 12:02:32 2021 +0200

shell : use std::mutex in CmdMailMsg

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

diff --git a/shell/source/cmdmail/cmdmailmsg.cxx 
b/shell/source/cmdmail/cmdmailmsg.cxx
index bd8657577b75..2a6a5f843af2 100644
--- a/shell/source/cmdmail/cmdmailmsg.cxx
+++ b/shell/source/cmdmail/cmdmailmsg.cxx
@@ -21,7 +21,6 @@
 
 using com::sun::star::container::NoSuchElementException;
 using com::sun::star::container::XNameAccess;
-using osl::MutexGuard;
 
 using namespace cppu;
 using namespace com::sun::star::uno;
@@ -29,91 +28,91 @@ using namespace com::sun::star::uno;
 
 void SAL_CALL CmdMailMsg::setBody( const OUString& aBody )
 {
-MutexGuard aGuard( m_aMutex );
+std::scoped_lock aGuard( m_aMutex );
 m_aBody = aBody;
 }
 
 OUString SAL_CALL CmdMailMsg::getBody(  )
 {
-MutexGuard aGuard( m_aMutex );
+std::scoped_lock aGuard( m_aMutex );
 return m_aBody;
 }
 
 void SAL_CALL CmdMailMsg::setRecipient( const OUString& aRecipient )
 {
-MutexGuard aGuard( m_aMutex );
+std::scoped_lock aGuard( m_aMutex );
 m_aRecipient = aRecipient;
 }
 
 OUString SAL_CALL CmdMailMsg::getRecipient(  )
 {
-MutexGuard aGuard( m_aMutex );
+std::scoped_lock aGuard( m_aMutex );
 return m_aRecipient;
 }
 
 void SAL_CALL CmdMailMsg::setCcRecipient( const Sequence< OUString >& 
aCcRecipient )
 {
-MutexGuard aGuard( m_aMutex );
+std::scoped_lock aGuard( m_aMutex );
 m_CcRecipients = aCcRecipient;
 }
 
 Sequence< OUString > SAL_CALL CmdMailMsg::getCcRecipient(  )
 {
-MutexGuard aGuard( m_aMutex );
+std::scoped_lock aGuard( m_aMutex );
 return m_CcRecipients;
 }
 
 void SAL_CALL CmdMailMsg::setBccRecipient( const Sequence< OUString >& 
aBccRecipient )
 {
-MutexGuard aGuard( m_aMutex );
+std::scoped_lock aGuard( m_aMutex );
 m_BccRecipients = aBccRecipient;
 }
 
 Sequence< OUString > SAL_CALL CmdMailMsg::getBccRecipient(  )
 {
-MutexGuard aGuard( m_aMutex );
+std::scoped_lock aGuard( m_aMutex );
 return m_BccRecipients;
 }
 
 void SAL_CALL CmdMailMsg::setOriginator( const OUString& aOriginator )
 {
-MutexGuard aGuard( m_aMutex );
+std::scoped_lock aGuard( m_aMutex );
 m_aOriginator = aOriginator;
 }
 
 OUString SAL_CALL CmdMailMsg::getOriginator(  )
 {
-MutexGuard aGuard( m_aMutex );
+std::scoped_lock aGuard( m_aMutex );
 return m_aOriginator;
 }
 
 void SAL_CALL CmdMailMsg::setSubject( const OUString& aSubject )
 {
-MutexGuard aGuard( m_aMutex );
+std::scoped_lock aGuard( m_aMutex );
 m_aSubject = aSubject;
 }
 
 OUString SAL_CALL CmdMailMsg::getSubject(  )
 {
-MutexGuard aGuard( m_aMutex );
+std::scoped_lock aGuard( m_aMutex );
 return m_aSubject;
 }
 
 void SAL_CALL CmdMailMsg::setAttachement( const Sequence< OUString >& 
aAttachment )
 {
-MutexGuard aGuard( m_aMutex );
+std::scoped_lock aGuard( m_aMutex );
 m_Attachments = aAttachment;
 }
 
 Sequence< OUString > SAL_CALL CmdMailMsg::getAttachement(  )
 {
-MutexGuard aGuard( m_aMutex );
+std::scoped_lock aGuard( m_aMutex );
 return m_Attachments;
 }
 
 Any SAL_CALL CmdMailMsg::getByName( const OUString& aName )
 {
-MutexGuard aGuard( m_aMutex );
+std::scoped_lock aGuard( m_aMutex );
 
 if( aName == "body" &&  !m_aBody.isEmpty() )
 return makeAny( m_aBody );
@@ -142,7 +141,7 @@ Any SAL_CALL CmdMailMsg::getByName( const OUString& aName )
 
 Sequence< OUString > SAL_CALL CmdMailMsg::getElementNames(  )
 {
-MutexGuard aGuard( m_aMutex );
+std::scoped_lock aGuard( m_aMutex );
 
 sal_Int32 nItems = 0;
 Sequence< OUString > aRet( 7 );
@@ -174,7 +173,7 @@ Sequence< OUString > SAL_CALL CmdMailMsg::getElementNames(  
)
 
  sal_Bool SAL_CALL CmdMailMsg::hasByName( const OUString& aName )
 {
-MutexGuard aGuard( m_aMutex );
+std::scoped_lock aGuard( m_aMutex );
 
 if( aName == "body" &&  !m_aBody.isEmpty() )
 return true;
diff --git a/shell/source/cmdmail/cmdmailmsg.hxx 
b/shell/source/cmdmail/cmdmailmsg.hxx
index 43e40c1abf77..b481403953a5 100644
--- a/shell/source/cmdmail/cmdmailmsg.hxx
+++ b/shell/source/cmdmail/cmdmailmsg.hxx
@@ -20,6 +20,7 @@
 #ifndef INCLUDED_SHELL_SOURCE_CMDMAIL_CMDMAILMSG_HXX
 #define INCLUDED_SHELL_SOURCE_CMDMAIL_CMDMAILMSG_HXX
 
+#include 
 #include 
 #include 
 
@@ -41,7 +42,7 @@ class CmdMailMsg :
 css::uno::Sequence< OUString >  m_BccRecipients;
 css::uno::Sequence< OUString >  m_Attachments;
 
-::osl::Mutexm_aMutex;

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

2021-04-20 Thread Stephan Bergmann (via logerrit)
 shell/source/unix/exec/shellexec.cxx |1 +
 1 file changed, 1 insertion(+)

New commits:
commit 177dcfec4e833f83f1f11c7bdbfc6f1977ebcee7
Author: Stephan Bergmann 
AuthorDate: Tue Apr 20 15:44:18 2021 +0200
Commit: Stephan Bergmann 
CommitDate: Tue Apr 20 17:52:58 2021 +0200

Better handling of filelocs

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

diff --git a/shell/source/unix/exec/shellexec.cxx 
b/shell/source/unix/exec/shellexec.cxx
index bbd614a66355..9ec32a35f630 100644
--- a/shell/source/unix/exec/shellexec.cxx
+++ b/shell/source/unix/exec/shellexec.cxx
@@ -137,6 +137,7 @@ void SAL_CALL ShellExec::execute( const OUString& aCommand, 
const OUString& aPar
 throw css::lang::IllegalArgumentException(
 "XSystemShellExecute.execute, cannot process <" + aCommand 
+ ">", {}, 0);
 } else if (pathname.endsWithIgnoreAsciiCase(".class")
+   || pathname.endsWithIgnoreAsciiCase(".fileloc")
|| pathname.endsWithIgnoreAsciiCase(".jar"))
 {
 dir = true;
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2021-02-16 Thread Stephan Bergmann (via logerrit)
 shell/source/win32/SysShExec.cxx |   31 +++
 1 file changed, 19 insertions(+), 12 deletions(-)

New commits:
commit f456c4dacf700e064e112ef068ff7edb04239754
Author: Stephan Bergmann 
AuthorDate: Tue Feb 16 09:30:09 2021 +0100
Commit: Stephan Bergmann 
CommitDate: Tue Feb 16 11:08:33 2021 +0100

Improve checkExtension

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

diff --git a/shell/source/win32/SysShExec.cxx b/shell/source/win32/SysShExec.cxx
index 660729339521..fde14e268c26 100644
--- a/shell/source/win32/SysShExec.cxx
+++ b/shell/source/win32/SysShExec.cxx
@@ -326,21 +326,28 @@ void SAL_CALL CSysShExec::execute( const OUString& 
aCommand, const OUString& aPa
 }
 }
 pathname = o3tl::toU(path);
+// ShellExecuteExW appears to ignore trailing dots, so remove them:
+while (pathname.endsWith(".", )) {}
 auto const n = pathname.lastIndexOf('.');
 if (n > pathname.lastIndexOf('\\')) {
 auto const ext = pathname.copy(n + 1);
-OUString env;
-if (osl_getEnvironment(OUString("PATHEXT").pData, ) 
!= osl_Process_E_None)
-{
-SAL_INFO("shell", "osl_getEnvironment(PATHEXT) failed");
-}
-if (!(checkExtension(ext, env)
-  && checkExtension(
-  ext,
-  
".COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.MSC;.PY;.CLASS;.JAR")))
-{
-throw css::lang::IllegalArgumentException(
-"XSystemShellExecute.execute, cannot process <" + 
aCommand + ">", {}, 0);
+if (!ext.isEmpty()) {
+OUString env;
+if (osl_getEnvironment(OUString("PATHEXT").pData, 
)
+!= osl_Process_E_None)
+{
+SAL_INFO("shell", "osl_getEnvironment(PATHEXT) 
failed");
+}
+if (!(checkExtension(ext, env)
+  && checkExtension(
+  ext,
+  
".COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.MSC;.PY;.CLASS;"
+  ".JAR;.APPLICATION;.LNK;.SCR")))
+{
+throw css::lang::IllegalArgumentException(
+"XSystemShellExecute.execute, cannot process <" + 
aCommand + ">", {},
+0);
+}
 }
 }
 }
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2020-11-30 Thread Stephan Bergmann (via logerrit)
 shell/source/backends/kf5be/kf5access.cxx |   28 ++--
 shell/source/backends/kf5be/kf5access.hxx |4 +++-
 2 files changed, 17 insertions(+), 15 deletions(-)

New commits:
commit e5022a5e5225dca593e0d00ec1eaab903c5065ea
Author: Stephan Bergmann 
AuthorDate: Mon Nov 30 14:11:42 2020 +0100
Commit: Stephan Bergmann 
CommitDate: Mon Nov 30 16:04:49 2020 +0100

loplugin:stringviewparam (Library_kf5be1)

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

diff --git a/shell/source/backends/kf5be/kf5access.cxx 
b/shell/source/backends/kf5be/kf5access.cxx
index 27d047d640d1..67056ad5544b 100644
--- a/shell/source/backends/kf5be/kf5access.cxx
+++ b/shell/source/backends/kf5be/kf5access.cxx
@@ -54,9 +54,9 @@ OUString fromQStringToOUString(QString const& s)
 }
 }
 
-css::beans::Optional getValue(OUString const& id)
+css::beans::Optional getValue(std::u16string_view id)
 {
-if (id == "ExternalMailer")
+if (id == u"ExternalMailer")
 {
 KEMailSettings aEmailSettings;
 QString aClientProgram;
@@ -70,27 +70,27 @@ css::beans::Optional getValue(OUString 
const& id)
 sClientProgram = fromQStringToOUString(aClientProgram);
 return css::beans::Optional(true, 
uno::makeAny(sClientProgram));
 }
-else if (id == "SourceViewFontHeight")
+else if (id == u"SourceViewFontHeight")
 {
 const QFont aFixedFont = 
QFontDatabase::systemFont(QFontDatabase::FixedFont);
 const short nFontHeight = aFixedFont.pointSize();
 return css::beans::Optional(true, 
uno::makeAny(nFontHeight));
 }
-else if (id == "SourceViewFontName")
+else if (id == u"SourceViewFontName")
 {
 const QFont aFixedFont = 
QFontDatabase::systemFont(QFontDatabase::FixedFont);
 const QString aFontName = aFixedFont.family();
 const OUString sFontName = fromQStringToOUString(aFontName);
 return css::beans::Optional(true, 
uno::makeAny(sFontName));
 }
-else if (id == "EnableATToolSupport")
+else if (id == u"EnableATToolSupport")
 {
 /* does not make much sense without an accessibility bridge */
 bool ATToolSupport = false;
 return css::beans::Optional(true,

uno::makeAny(OUString::boolean(ATToolSupport)));
 }
-else if (id == "WorkPathVariable")
+else if (id == u"WorkPathVariable")
 {
 QString 
aDocumentsDir(QStandardPaths::writableLocation(QStandardPaths::DocumentsLocation));
 if (aDocumentsDir.isEmpty())
@@ -103,7 +103,7 @@ css::beans::Optional getValue(OUString 
const& id)
 osl_getFileURLFromSystemPath(sDocumentsDir.pData, 
);
 return css::beans::Optional(true, 
uno::makeAny(sDocumentsURL));
 }
-else if (id == "ooInetFTPProxyName")
+else if (id == u"ooInetFTPProxyName")
 {
 QString aFTPProxy;
 switch (KProtocolManager::proxyType())
@@ -130,7 +130,7 @@ css::beans::Optional getValue(OUString 
const& id)
 return css::beans::Optional(true, 
uno::makeAny(sProxy));
 }
 }
-else if (id == "ooInetFTPProxyPort")
+else if (id == u"ooInetFTPProxyPort")
 {
 QString aFTPProxy;
 switch (KProtocolManager::proxyType())
@@ -157,7 +157,7 @@ css::beans::Optional getValue(OUString 
const& id)
 return css::beans::Optional(true, 
uno::makeAny(nPort));
 }
 }
-else if (id == "ooInetHTTPProxyName")
+else if (id == u"ooInetHTTPProxyName")
 {
 QString aHTTPProxy;
 switch (KProtocolManager::proxyType())
@@ -184,7 +184,7 @@ css::beans::Optional getValue(OUString 
const& id)
 return css::beans::Optional(true, 
uno::makeAny(sProxy));
 }
 }
-else if (id == "ooInetHTTPProxyPort")
+else if (id == u"ooInetHTTPProxyPort")
 {
 QString aHTTPProxy;
 switch (KProtocolManager::proxyType())
@@ -211,7 +211,7 @@ css::beans::Optional getValue(OUString 
const& id)
 return css::beans::Optional(true, 
uno::makeAny(nPort));
 }
 }
-else if (id == "ooInetHTTPSProxyName")
+else if (id == u"ooInetHTTPSProxyName")
 {
 QString aHTTPSProxy;
 switch (KProtocolManager::proxyType())
@@ -238,7 +238,7 @@ css::beans::Optional getValue(OUString 
const& id)
 return css::beans::Optional(true, 
uno::makeAny(sProxy));
 }
 }
-else if (id == "ooInetHTTPSProxyPort")
+else if (id == u"ooInetHTTPSProxyPort")
 {
 QString aHTTPSProxy;
 switch (KProtocolManager::proxyType())
@@ -265,7 +265,7 @@ css::beans::Optional getValue(OUString 
const& id)
 return css::beans::Optional(true, 
uno::makeAny(nPort));
 }
 }
-else if (id == "ooInetNoProxy")
+else if (id == u"ooInetNoProxy")
 {
 QString 

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

2020-11-27 Thread Stephan Bergmann (via logerrit)
 shell/source/win32/spsupp/registrar.cxx |6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

New commits:
commit a63087f58090418b6a7c8b046698b372ddc903cf
Author: Stephan Bergmann 
AuthorDate: Fri Nov 27 10:52:12 2020 +0100
Commit: Stephan Bergmann 
CommitDate: Fri Nov 27 13:19:24 2020 +0100

RegCreateKeyExW etc. return LSTATUS

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

diff --git a/shell/source/win32/spsupp/registrar.cxx 
b/shell/source/win32/spsupp/registrar.cxx
index 008c2ac59c82..1d647f3a556c 100644
--- a/shell/source/win32/spsupp/registrar.cxx
+++ b/shell/source/win32/spsupp/registrar.cxx
@@ -16,7 +16,7 @@ namespace {
 HRESULT RegRead(HKEY hRootKey, const wchar_t* subKey, const wchar_t* 
valName, wchar_t* valData, size_t cchData)
 {
 HKEY hKey;
-long iRetVal = RegCreateKeyExW(
+LSTATUS iRetVal = RegCreateKeyExW(
 hRootKey,
 subKey,
 0,
@@ -43,7 +43,7 @@ namespace {
 HRESULT RegWrite(HKEY hRootKey, const wchar_t* subKey, const wchar_t* 
valName, const wchar_t* valData, HKEY *hKeyResult = nullptr)
 {
 HKEY hKey;
-long iRetVal = RegCreateKeyExW(
+LSTATUS iRetVal = RegCreateKeyExW(
 hRootKey,
 subKey,
 0,
@@ -72,7 +72,7 @@ namespace {
 
 HRESULT RegDel(HKEY hRootKey, const wchar_t* subKey)
 {
-long iRetVal = RegDeleteKeyW(hRootKey, subKey);
+LSTATUS iRetVal = RegDeleteKeyW(hRootKey, subKey);
 return HRESULT_FROM_WIN32(iRetVal);
 }
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2020-11-27 Thread Stephan Bergmann (via logerrit)
 shell/source/win32/shlxthandler/util/utilities.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit d52ea2baa0885d49f3b5eaa74d782315d01d36ea
Author: Stephan Bergmann 
AuthorDate: Fri Nov 27 10:49:33 2020 +0100
Commit: Stephan Bergmann 
CommitDate: Fri Nov 27 13:17:49 2020 +0100

GetShortPathNameW returns DWORD

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

diff --git a/shell/source/win32/shlxthandler/util/utilities.cxx 
b/shell/source/win32/shlxthandler/util/utilities.cxx
index 80bd6a1cb4fa..489474b53baf 100644
--- a/shell/source/win32/shlxthandler/util/utilities.cxx
+++ b/shell/source/win32/shlxthandler/util/utilities.cxx
@@ -121,7 +121,7 @@ bool HasOnlySpaces(const std::wstring& String)
 std::wstring getShortPathName( const std::wstring& aLongName )
 {
 std::wstring shortName = aLongName;
-long length= GetShortPathNameW( aLongName.c_str(), nullptr, 0 
);
+DWORDlength= GetShortPathNameW( aLongName.c_str(), nullptr, 0 
);
 
 if ( length != 0 )
 {
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2020-11-25 Thread Stephan Bergmann (via logerrit)
 shell/source/unix/exec/shellexec.cxx |4 
 shell/source/win32/SysShExec.cxx |3 ++-
 2 files changed, 6 insertions(+), 1 deletion(-)

New commits:
commit 696739056f37430154d6333b8f7228d1c44d09b3
Author: Stephan Bergmann 
AuthorDate: Wed Nov 25 09:13:12 2020 +0100
Commit: Stephan Bergmann 
CommitDate: Wed Nov 25 10:51:36 2020 +0100

Better handling of Java files

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

diff --git a/shell/source/unix/exec/shellexec.cxx 
b/shell/source/unix/exec/shellexec.cxx
index 7d4e9cb36fb6..bbd614a66355 100644
--- a/shell/source/unix/exec/shellexec.cxx
+++ b/shell/source/unix/exec/shellexec.cxx
@@ -136,6 +136,10 @@ void SAL_CALL ShellExec::execute( const OUString& 
aCommand, const OUString& aPar
 {
 throw css::lang::IllegalArgumentException(
 "XSystemShellExecute.execute, cannot process <" + aCommand 
+ ">", {}, 0);
+} else if (pathname.endsWithIgnoreAsciiCase(".class")
+   || pathname.endsWithIgnoreAsciiCase(".jar"))
+{
+dir = true;
 }
 }
 
diff --git a/shell/source/win32/SysShExec.cxx b/shell/source/win32/SysShExec.cxx
index 4cf00a70e3ed..660729339521 100644
--- a/shell/source/win32/SysShExec.cxx
+++ b/shell/source/win32/SysShExec.cxx
@@ -336,7 +336,8 @@ void SAL_CALL CSysShExec::execute( const OUString& 
aCommand, const OUString& aPa
 }
 if (!(checkExtension(ext, env)
   && checkExtension(
-  ext, 
".COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.MSC;.PY")))
+  ext,
+  
".COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.MSC;.PY;.CLASS;.JAR")))
 {
 throw css::lang::IllegalArgumentException(
 "XSystemShellExecute.execute, cannot process <" + 
aCommand + ">", {}, 0);
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2020-10-02 Thread Stephan Bergmann (via logerrit)
 shell/source/win32/simplemail/smplmail.component |2 +-
 shell/source/win32/simplemail/smplmailsuppl.cxx  |6 ++
 2 files changed, 3 insertions(+), 5 deletions(-)

New commits:
commit ed3eda5d752b988411616c8cd96953ae6a2fe20f
Author: Stephan Bergmann 
AuthorDate: Fri Oct 2 14:19:32 2020 +0200
Commit: Stephan Bergmann 
CommitDate: Fri Oct 2 20:41:23 2020 +0200

Use the new single-instance="true" attribute in shell

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

diff --git a/shell/source/win32/simplemail/smplmail.component 
b/shell/source/win32/simplemail/smplmail.component
index 6b95bd8cdc5c..32446884ddc3 100644
--- a/shell/source/win32/simplemail/smplmail.component
+++ b/shell/source/win32/simplemail/smplmail.component
@@ -20,7 +20,7 @@
 http://openoffice.org/2010/uno-components;>
   
+constructor="shell_CSmplMailSuppl_get_implementation" 
single-instance="true">
 
   
 
diff --git a/shell/source/win32/simplemail/smplmailsuppl.cxx 
b/shell/source/win32/simplemail/smplmailsuppl.cxx
index eba930b09107..8e6cdfcd2403 100644
--- a/shell/source/win32/simplemail/smplmailsuppl.cxx
+++ b/shell/source/win32/simplemail/smplmailsuppl.cxx
@@ -18,8 +18,8 @@
  */
 
 #include 
+#include 
 #include 
-#include 
 #include "smplmailsuppl.hxx"
 #include "smplmailclient.hxx"
 
@@ -79,9 +79,7 @@ extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface*
 shell_CSmplMailSuppl_get_implementation(
 css::uno::XComponentContext* , css::uno::Sequence const&)
 {
-static rtl::Reference g_Instance(new CSmplMailSuppl());
-g_Instance->acquire();
-return static_cast(g_Instance.get());
+return cppu::acquire(static_cast(new 
CSmplMailSuppl()));
 }
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2020-09-05 Thread Stephan Bergmann (via logerrit)
 shell/source/backends/kf5be/kf5access.cxx |   23 ---
 1 file changed, 16 insertions(+), 7 deletions(-)

New commits:
commit 1bc728580364c626aa04df624e2afac8fa92890e
Author: Stephan Bergmann 
AuthorDate: Sat Sep 5 18:29:59 2020 +0200
Commit: Stephan Bergmann 
CommitDate: Sat Sep 5 21:19:56 2020 +0200

Improve QString to OUString conversion

...assuming the way of constructing an OUString from just a QString::utf16
pointer, ignoring QString::size, was not chosen deliberately to cut of the 
input
string at a potential embedded NUL.

(This change is a prerequisite for making the OUString ctor taking a raw 
pointer
explicit.)

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

diff --git a/shell/source/backends/kf5be/kf5access.cxx 
b/shell/source/backends/kf5be/kf5access.cxx
index d983b6d308ca..27d047d640d1 100644
--- a/shell/source/backends/kf5be/kf5access.cxx
+++ b/shell/source/backends/kf5be/kf5access.cxx
@@ -45,6 +45,15 @@ namespace
 namespace uno = css::uno;
 }
 
+namespace
+{
+OUString fromQStringToOUString(QString const& s)
+{
+// Conversion from QString size()'s int to OUString's sal_Int32 should be 
non-narrowing:
+return { reinterpret_cast(s.utf16()), s.size() };
+}
+}
+
 css::beans::Optional getValue(OUString const& id)
 {
 if (id == "ExternalMailer")
@@ -58,7 +67,7 @@ css::beans::Optional getValue(OUString const& 
id)
 aClientProgram = QStringLiteral("kmail");
 else
 aClientProgram = aClientProgram.section(QLatin1Char(' '), 0, 0);
-sClientProgram = reinterpret_cast(aClientProgram.utf16());
+sClientProgram = fromQStringToOUString(aClientProgram);
 return css::beans::Optional(true, 
uno::makeAny(sClientProgram));
 }
 else if (id == "SourceViewFontHeight")
@@ -71,7 +80,7 @@ css::beans::Optional getValue(OUString const& 
id)
 {
 const QFont aFixedFont = 
QFontDatabase::systemFont(QFontDatabase::FixedFont);
 const QString aFontName = aFixedFont.family();
-const OUString sFontName = reinterpret_cast(aFontName.utf16());
+const OUString sFontName = fromQStringToOUString(aFontName);
 return css::beans::Optional(true, 
uno::makeAny(sFontName));
 }
 else if (id == "EnableATToolSupport")
@@ -90,7 +99,7 @@ css::beans::Optional getValue(OUString const& 
id)
 OUString sDocumentsURL;
 if (aDocumentsDir.endsWith(QLatin1Char('/')))
 aDocumentsDir.truncate(aDocumentsDir.length() - 1);
-sDocumentsDir = reinterpret_cast(aDocumentsDir.utf16());
+sDocumentsDir = fromQStringToOUString(aDocumentsDir);
 osl_getFileURLFromSystemPath(sDocumentsDir.pData, 
);
 return css::beans::Optional(true, 
uno::makeAny(sDocumentsURL));
 }
@@ -117,7 +126,7 @@ css::beans::Optional getValue(OUString 
const& id)
 if (!aFTPProxy.isEmpty())
 {
 QUrl aProxy(aFTPProxy);
-OUString sProxy = reinterpret_cast(aProxy.host().utf16());
+OUString sProxy = fromQStringToOUString(aProxy.host());
 return css::beans::Optional(true, 
uno::makeAny(sProxy));
 }
 }
@@ -171,7 +180,7 @@ css::beans::Optional getValue(OUString 
const& id)
 if (!aHTTPProxy.isEmpty())
 {
 QUrl aProxy(aHTTPProxy);
-OUString sProxy = reinterpret_cast(aProxy.host().utf16());
+OUString sProxy = fromQStringToOUString(aProxy.host());
 return css::beans::Optional(true, 
uno::makeAny(sProxy));
 }
 }
@@ -225,7 +234,7 @@ css::beans::Optional getValue(OUString 
const& id)
 if (!aHTTPSProxy.isEmpty())
 {
 QUrl aProxy(aHTTPSProxy);
-OUString sProxy = reinterpret_cast(aProxy.host().utf16());
+OUString sProxy = fromQStringToOUString(aProxy.host());
 return css::beans::Optional(true, 
uno::makeAny(sProxy));
 }
 }
@@ -275,7 +284,7 @@ css::beans::Optional getValue(OUString 
const& id)
 OUString sNoProxyFor;
 
 aNoProxyFor = aNoProxyFor.replace(QLatin1Char(','), 
QLatin1Char(';'));
-sNoProxyFor = reinterpret_cast(aNoProxyFor.utf16());
+sNoProxyFor = fromQStringToOUString(aNoProxyFor);
 return css::beans::Optional(true, 
uno::makeAny(sNoProxyFor));
 }
 }
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2020-08-21 Thread Andrea Gelmini (via logerrit)
 shell/source/win32/shlxthandler/ooofilt/propspec.cxx |2 +-
 shell/source/win32/shlxthandler/ooofilt/propspec.hxx |2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

New commits:
commit eab5ce4647ee76d9eae73008a6db76a35ce9066c
Author: Andrea Gelmini 
AuthorDate: Thu Aug 20 13:11:39 2020 +0200
Commit: Julien Nabet 
CommitDate: Fri Aug 21 12:22:56 2020 +0200

Fix typo

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

diff --git a/shell/source/win32/shlxthandler/ooofilt/propspec.cxx 
b/shell/source/win32/shlxthandler/ooofilt/propspec.cxx
index bfb924803a1f..dd83326f5e2c 100644
--- a/shell/source/win32/shlxthandler/ooofilt/propspec.cxx
+++ b/shell/source/win32/shlxthandler/ooofilt/propspec.cxx
@@ -36,7 +36,7 @@
 
 //refer to ms-help://MS.VSCC/MS.MSDNVS.2052/com/stgasstg_7agk.htm
 //FMTID_SummaryInformation
-//GUID CLSID_SummaryInforation = {
+//GUID CLSID_SummaryInformation = {
 //0xF29F85E0,
 //0x4FF9,
 //0x1068,
diff --git a/shell/source/win32/shlxthandler/ooofilt/propspec.hxx 
b/shell/source/win32/shlxthandler/ooofilt/propspec.hxx
index aa14257d779d..f9e1fc289757 100644
--- a/shell/source/win32/shlxthandler/ooofilt/propspec.hxx
+++ b/shell/source/win32/shlxthandler/ooofilt/propspec.hxx
@@ -31,7 +31,7 @@
 #include 
 #include 
 //+-
-//  Declare:CLSID_SummaryInforation, GUID
+//  Declare:CLSID_SummaryInformation, GUID
 //  CLSID_Storage, GUID
 //  Contents:   Definitions of OpenOffice.org Document properties
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2020-07-16 Thread Noel Grandin (via logerrit)
 shell/source/backends/desktopbe/desktopbackend.cxx   |   37 ---
 shell/source/backends/desktopbe/desktopbe1.component |5 +-
 2 files changed, 12 insertions(+), 30 deletions(-)

New commits:
commit 0790a1445cb7e4fc004d060fa86934c747c3af41
Author: Noel Grandin 
AuthorDate: Thu Jul 16 10:32:00 2020 +0200
Commit: Noel Grandin 
CommitDate: Thu Jul 16 15:17:15 2020 +0200

shell/desktop: create instances with uno constructors

See tdf#74608 for motivation.

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

diff --git a/shell/source/backends/desktopbe/desktopbackend.cxx 
b/shell/source/backends/desktopbe/desktopbackend.cxx
index 92cb062d2496..e34ad8a9d5ff 100644
--- a/shell/source/backends/desktopbe/desktopbackend.cxx
+++ b/shell/source/backends/desktopbe/desktopbackend.cxx
@@ -51,15 +51,6 @@
 
 namespace {
 
-OUString getDefaultImplementationName() {
-return
-"com.sun.star.comp.configuration.backend.DesktopBackend";
-}
-
-css::uno::Sequence< OUString > getDefaultSupportedServiceNames() {
-return { "com.sun.star.configuration.backend.DesktopBackend" };
-}
-
 class Default:
 public cppu::WeakImplHelper<
 css::lang::XServiceInfo, css::beans::XPropertySet >
@@ -73,14 +64,14 @@ private:
 virtual ~Default() override {}
 
 virtual OUString SAL_CALL getImplementationName() override
-{ return getDefaultImplementationName(); }
+{ return "com.sun.star.comp.configuration.backend.DesktopBackend"; }
 
 virtual sal_Bool SAL_CALL supportsService(OUString const & ServiceName) 
override
 { return ServiceName == getSupportedServiceNames()[0]; }
 
 virtual css::uno::Sequence< OUString > SAL_CALL
 getSupportedServiceNames() override
-{ return getDefaultSupportedServiceNames(); }
+{ return { "com.sun.star.configuration.backend.DesktopBackend" }; }
 
 virtual css::uno::Reference< css::beans::XPropertySetInfo > SAL_CALL
 getPropertySetInfo() override
@@ -284,8 +275,9 @@ css::uno::Reference< css::uno::XInterface > createBackend(
 }
 }
 
-css::uno::Reference< css::uno::XInterface > createInstance(
-css::uno::Reference< css::uno::XComponentContext > const & context)
+extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface*
+shell_DesktopBackend_get_implementation(
+css::uno::XComponentContext* context , css::uno::Sequence 
const&)
 {
 OUString desktop;
 css::uno::Reference< css::uno::XCurrentContext > current(
@@ -299,24 +291,13 @@ css::uno::Reference< css::uno::XInterface > 
createInstance(
 if (desktop == "PLASMA5")
 backend = createBackend(context,
 "com.sun.star.configuration.backend.KF5Backend");
-return backend.is()
-? backend : static_cast< cppu::OWeakObject * >(new Default);
+if (!backend)
+backend = static_cast< cppu::OWeakObject * >(new Default);
+backend->acquire();
+return backend.get();
 }
 
-cppu::ImplementationEntry const services[] = {
-{ , ,
-  , ::createSingleComponentFactory, 
nullptr,
-  0 },
-{ nullptr, nullptr, nullptr, nullptr, nullptr, 0 }
-};
-
 }
 
-extern "C" SAL_DLLPUBLIC_EXPORT void * desktopbe1_component_getFactory(
-char const * pImplName, void * pServiceManager, void * pRegistryKey)
-{
-return cppu::component_getFactoryHelper(
-pImplName, pServiceManager, pRegistryKey, services);
-}
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/shell/source/backends/desktopbe/desktopbe1.component 
b/shell/source/backends/desktopbe/desktopbe1.component
index 10b30a665f8d..abc47f0425ce 100644
--- a/shell/source/backends/desktopbe/desktopbe1.component
+++ b/shell/source/backends/desktopbe/desktopbe1.component
@@ -18,8 +18,9 @@
  -->
 
 http://openoffice.org/2010/uno-components;>
-  
+xmlns="http://openoffice.org/2010/uno-components;>
+  
 
   
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2020-07-16 Thread Noel Grandin (via logerrit)
 shell/source/backends/kf5be/kf5backend.cxx   |   34 ---
 shell/source/backends/kf5be/kf5be1.component |5 ++-
 2 files changed, 9 insertions(+), 30 deletions(-)

New commits:
commit 3e572e8c058d202a8266aa66af3e658cd9c54db4
Author: Noel Grandin 
AuthorDate: Thu Jul 16 10:43:21 2020 +0200
Commit: Noel Grandin 
CommitDate: Thu Jul 16 12:33:26 2020 +0200

shell/kf5: create instances with uno constructors

See tdf#74608 for motivation.

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

diff --git a/shell/source/backends/kf5be/kf5backend.cxx 
b/shell/source/backends/kf5be/kf5backend.cxx
index 44d0134d394f..9948e41a9888 100644
--- a/shell/source/backends/kf5be/kf5backend.cxx
+++ b/shell/source/backends/kf5be/kf5backend.cxx
@@ -50,17 +50,6 @@
 
 namespace
 {
-OUString getServiceImplementationName()
-{
-return "com.sun.star.comp.configuration.backend.KF5Backend";
-}
-
-css::uno::Sequence getServiceSupportedServiceNames()
-{
-OUString name("com.sun.star.configuration.backend.KF5Backend");
-return css::uno::Sequence(, 1);
-}
-
 class Service : public cppu::WeakImplHelper,
 private boost::noncopyable
 {
@@ -72,7 +61,7 @@ private:
 
 virtual OUString SAL_CALL getImplementationName() override
 {
-return getServiceImplementationName();
+return "com.sun.star.comp.configuration.backend.KF5Backend";
 }
 
 virtual sal_Bool SAL_CALL supportsService(OUString const& ServiceName) 
override
@@ -82,7 +71,7 @@ private:
 
 virtual css::uno::Sequence SAL_CALL getSupportedServiceNames() 
override
 {
-return getServiceSupportedServiceNames();
+return { "com.sun.star.configuration.backend.KF5Backend" };
 }
 
 virtual css::uno::Reference SAL_CALL 
getPropertySetInfo() override
@@ -252,22 +241,11 @@ css::uno::Any Service::getPropertyValue(OUString const& 
PropertyName)
 throw css::beans::UnknownPropertyException(PropertyName, 
static_cast(this));
 }
 
-css::uno::Reference
-createInstance(css::uno::Reference const&)
+extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface*
+shell_kf5desktop_get_implementation(css::uno::XComponentContext*,
+css::uno::Sequence const&)
 {
-return static_cast(new Service);
+return cppu::acquire(new Service());
 }
-
-cppu::ImplementationEntry const services[]
-= { { , , 
,
-  ::createSingleComponentFactory, nullptr, 0 },
-{ nullptr, nullptr, nullptr, nullptr, nullptr, 0 } };
 }
-
-extern "C" SAL_DLLPUBLIC_EXPORT void*
-kf5be1_component_getFactory(char const* pImplName, void* pServiceManager, 
void* pRegistryKey)
-{
-return cppu::component_getFactoryHelper(pImplName, pServiceManager, 
pRegistryKey, services);
-}
-
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/shell/source/backends/kf5be/kf5be1.component 
b/shell/source/backends/kf5be/kf5be1.component
index ad217dc80e66..dd893bcb6708 100644
--- a/shell/source/backends/kf5be/kf5be1.component
+++ b/shell/source/backends/kf5be/kf5be1.component
@@ -18,8 +18,9 @@
  -->
 
 http://openoffice.org/2010/uno-components;>
-  
+xmlns="http://openoffice.org/2010/uno-components;>
+  
 
   
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2020-07-01 Thread Stephan Bergmann (via logerrit)
 shell/source/backends/desktopbe/desktopbackend.cxx |2 +-
 shell/source/backends/kf5be/kf5backend.cxx |2 +-
 shell/source/backends/localebe/localebecdef.cxx|2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

New commits:
commit b0a21fb21f7a3ce4aca2db1eaa839e4b6fc5ed6d
Author: Stephan Bergmann 
AuthorDate: Wed Jul 1 23:46:41 2020 +0200
Commit: Stephan Bergmann 
CommitDate: Thu Jul 2 07:10:24 2020 +0200

Upcoming improved loplugin:staticanonymous -> redundantstatic: shell

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

diff --git a/shell/source/backends/desktopbe/desktopbackend.cxx 
b/shell/source/backends/desktopbe/desktopbackend.cxx
index 5f024f0679e8..92cb062d2496 100644
--- a/shell/source/backends/desktopbe/desktopbackend.cxx
+++ b/shell/source/backends/desktopbe/desktopbackend.cxx
@@ -303,7 +303,7 @@ css::uno::Reference< css::uno::XInterface > createInstance(
 ? backend : static_cast< cppu::OWeakObject * >(new Default);
 }
 
-static cppu::ImplementationEntry const services[] = {
+cppu::ImplementationEntry const services[] = {
 { , ,
   , ::createSingleComponentFactory, 
nullptr,
   0 },
diff --git a/shell/source/backends/kf5be/kf5backend.cxx 
b/shell/source/backends/kf5be/kf5backend.cxx
index cb3f382b8cdd..44d0134d394f 100644
--- a/shell/source/backends/kf5be/kf5backend.cxx
+++ b/shell/source/backends/kf5be/kf5backend.cxx
@@ -258,7 +258,7 @@ 
createInstance(css::uno::Reference const&)
 return static_cast(new Service);
 }
 
-static cppu::ImplementationEntry const services[]
+cppu::ImplementationEntry const services[]
 = { { , , 
,
   ::createSingleComponentFactory, nullptr, 0 },
 { nullptr, nullptr, nullptr, nullptr, nullptr, 0 } };
diff --git a/shell/source/backends/localebe/localebecdef.cxx 
b/shell/source/backends/localebe/localebecdef.cxx
index fbbd63690d55..ed6e4c98b699 100644
--- a/shell/source/backends/localebe/localebecdef.cxx
+++ b/shell/source/backends/localebe/localebecdef.cxx
@@ -33,7 +33,7 @@ static uno::Reference createLocaleBackend(
 }
 
 
-static const cppu::ImplementationEntry kImplementations_entries[] =
+const cppu::ImplementationEntry kImplementations_entries[] =
 {
 {
 createLocaleBackend,
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2020-06-07 Thread Julien Nabet (via logerrit)
 shell/source/win32/SysShExec.cxx |   11 ---
 shell/source/win32/SysShExec.hxx |3 +++
 2 files changed, 11 insertions(+), 3 deletions(-)

New commits:
commit 6d2c6d827e827b62271c9636fe212045a4d68d42
Author: Julien Nabet 
AuthorDate: Sat Jun 6 12:25:07 2020 +0200
Commit: Julien Nabet 
CommitDate: Sun Jun 7 09:40:24 2020 +0200

Use o3tl::safeCoInitializeEx/safeCoUninitializeReinit (shell/SysShExec)

Change-Id: Ice97c2db27085fefed098ee01f3aaeb55fc90cca
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/95643
Tested-by: Jenkins
Reviewed-by: Mike Kaganski 
Reviewed-by: Julien Nabet 

diff --git a/shell/source/win32/SysShExec.cxx b/shell/source/win32/SysShExec.cxx
index 93eeaee36f03..a68315e8d3e6 100644
--- a/shell/source/win32/SysShExec.cxx
+++ b/shell/source/win32/SysShExec.cxx
@@ -33,6 +33,7 @@
 #include 
 #include 
 #include 
+#include 
 
 #include 
 #include 
@@ -146,7 +147,8 @@ namespace
 
 CSysShExec::CSysShExec( const css::uno::Reference< css::uno::XComponentContext 
>& xContext ) :
 WeakComponentImplHelper< css::system::XSystemShellExecute, 
css::lang::XServiceInfo >( m_aMutex ),
-m_xContext(xContext)
+m_xContext(xContext),
+mnNbCallCoInitializeExForReinit(0)
 {
 /*
  * As this service is declared thread-affine, it is ensured to be called 
from a
@@ -155,8 +157,11 @@ CSysShExec::CSysShExec( const css::uno::Reference< 
css::uno::XComponentContext >
  * We need COM to be initialized for STA, but osl thread get initialized 
for MTA.
  * Once this changed, we can remove the uninitialize call.
  */
-CoUninitialize();
-CoInitializeEx( nullptr, COINIT_APARTMENTTHREADED );
+o3tl::safeCoInitializeEx(COINIT_APARTMENTTHREADED, 
mnNbCallCoInitializeExForReinit);
+}
+CSysShExec::~CSysShExec()
+{
+o3tl::safeCoUninitializeReinit(COINIT_MULTITHREADED, 
mnNbCallCoInitializeExForReinit);
 }
 
 namespace
diff --git a/shell/source/win32/SysShExec.hxx b/shell/source/win32/SysShExec.hxx
index 63069cc5e52f..8a4e65ffa5e9 100644
--- a/shell/source/win32/SysShExec.hxx
+++ b/shell/source/win32/SysShExec.hxx
@@ -43,9 +43,12 @@ class CSysShExec :
 css::lang::XServiceInfo >
 {
 css::uno::Reference< css::uno::XComponentContext > m_xContext;
+// to put back all the inits with COINIT_MULTITHREADED if needed
+int mnNbCallCoInitializeExForReinit;
 
 public:
 explicit CSysShExec(const css::uno::Reference< css::uno::XComponentContext 
>& xContext);
+~CSysShExec();
 
 
 // XSystemShellExecute
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2020-06-05 Thread Stephan Bergmann (via logerrit)
 shell/source/cmdmail/cmdmailsuppl.cxx |3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

New commits:
commit 91f13f44f26e817b6211c48ca38dcffee4f8fa37
Author: Stephan Bergmann 
AuthorDate: Fri Jun 5 07:37:06 2020 +0200
Commit: Stephan Bergmann 
CommitDate: Fri Jun 5 08:47:00 2020 +0200

Upcoming loplugin:elidestringvar: shell

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

diff --git a/shell/source/cmdmail/cmdmailsuppl.cxx 
b/shell/source/cmdmail/cmdmailsuppl.cxx
index bbd0ae07d4cf..415a6c4d0051 100644
--- a/shell/source/cmdmail/cmdmailsuppl.cxx
+++ b/shell/source/cmdmail/cmdmailsuppl.cxx
@@ -159,11 +159,10 @@ void SAL_CALL CmdMailSuppl::sendSimpleMailMessage( const 
Reference< XSimpleMailM
 // Query XNameAccess interface of the 
org.openoffice.Office.Common/ExternalMailer
 // configuration node to retrieve the users preferred email 
application. This may
 // transparently by redirected to e.g. the corresponding GConf setting 
in GNOME.
-OUString aConfigRoot = "org.openoffice.Office.Common/ExternalMailer";
 
 PropertyValue aProperty;
 aProperty.Name = "nodepath";
-aProperty.Value <<= aConfigRoot;
+aProperty.Value <<= 
OUString("org.openoffice.Office.Common/ExternalMailer");
 
 Sequence< Any > aArgumentList( 1 );
 aArgumentList[0] <<= aProperty;
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2020-03-20 Thread Stephan Bergmann (via logerrit)
 shell/source/win32/shlxthandler/thumbviewer/thumbviewer.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 3ca8fe5c0d51e6728dae949a143e63291d7043bc
Author: Stephan Bergmann 
AuthorDate: Fri Mar 20 15:28:44 2020 +0100
Commit: Stephan Bergmann 
CommitDate: Fri Mar 20 19:14:43 2020 +0100

Fix passing RT_RCDATA into FindResourceW

RT_RCDATA is defined as MAKEINTRESOURCE(10) in WinUser.h, and 
MAKEINTRESOURCE is
defined as MAKEINTRESOURCEA in WinUser.h absent a definition of UNICODE.

649854544e28f388774492f27eb1b75485202148 "WinAPI: Fix some leftovers having
UNICODE-define-dependency" had changed this

> -HRSRC hrc = FindResourceW(g_hModule, L"#2000", RT_RCDATA);
> +HRSRC hrc = FindResourceW(g_hModule, L"#2000", 
MAKEINTRESOURCEW(RT_RCDATA));

before 558956dc811a1f0f07411e348f7081a467bbc3b5 "Drop UNICODE/_UNICODE 
defines"
dropped defining UNICODE.  But that change was technically wrong, as now 
flagged
by LLVM 10 trunk clang-cl:

> 
C:/lo-clang/core/shell/source/win32/shlxthandler/thumbviewer/thumbviewer.cxx(50,56):
 error: cast to smaller integer type 'unsigned short' from 'char *' 
[-Werror,-Wpointer-to-int-cast]
> HRSRC hrc = FindResourceW(g_hModule, L"#2000", 
MAKEINTRESOURCEW(RT_RCDATA));
>
^~~
> C:/PROGRA~2/WI3CF2~1/10/Include/10.0.18362.0/um\winuser.h(236,51): note: 
expanded from macro 'MAKEINTRESOURCEW'
> #define MAKEINTRESOURCEW(i) ((LPWSTR)((ULONG_PTR)((WORD)(i
>   ^

There appears to be no explicit define for MAKEINTRESOURCEW(10), and the fix
presented here seems like a cleaner way than replacing the use of RC_RCDATA 
with
MAKEINTRESOURCEW(10).

Change-Id: I36f60a8647ac264085656fc9ec3b129c2d81f480
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/90799
Reviewed-by: Mike Kaganski 
Reviewed-by: Stephan Bergmann 
Tested-by: Jenkins

diff --git a/shell/source/win32/shlxthandler/thumbviewer/thumbviewer.cxx 
b/shell/source/win32/shlxthandler/thumbviewer/thumbviewer.cxx
index 484b7236f3e0..7cc013b87b91 100644
--- a/shell/source/win32/shlxthandler/thumbviewer/thumbviewer.cxx
+++ b/shell/source/win32/shlxthandler/thumbviewer/thumbviewer.cxx
@@ -47,7 +47,7 @@ namespace internal
id is 2000 */
 static void LoadSignetImageFromResource(ZipFile::ZipContentBuffer_t& 
buffer)
 {
-HRSRC hrc = FindResourceW(g_hModule, L"#2000", 
MAKEINTRESOURCEW(RT_RCDATA));
+HRSRC hrc = FindResourceW(g_hModule, L"#2000", 
reinterpret_cast(RT_RCDATA));
 DWORD size = SizeofResource(g_hModule, hrc);
 HGLOBAL hglob = LoadResource(g_hModule, hrc);
 char* data = static_cast(LockResource(hglob));
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2020-02-03 Thread Stephan Bergmann (via logerrit)
 shell/source/win32/SysShExec.cxx |4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

New commits:
commit d81affe8ae1010093521731f863d6a6b29f3510d
Author: Stephan Bergmann 
AuthorDate: Mon Feb 3 16:28:04 2020 +0100
Commit: Stephan Bergmann 
CommitDate: Mon Feb 3 23:47:01 2020 +0100

loplugin:stringadd (clang-cl)

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

diff --git a/shell/source/win32/SysShExec.cxx b/shell/source/win32/SysShExec.cxx
index 73142d8a0fce..874c4f5e94cf 100644
--- a/shell/source/win32/SysShExec.cxx
+++ b/shell/source/win32/SysShExec.cxx
@@ -253,7 +253,7 @@ void SAL_CALL CSysShExec::execute( const OUString& 
aCommand, const OUString& aPa
 if (PathResolve(path, nullptr, PRF_VERIFYEXISTS | 
PRF_REQUIREABSOLUTE) == 0)
 {
 throw css::lang::IllegalArgumentException(
-"XSystemShellExecute.execute, PathResolve(" + 
OUString(o3tl::toU(path))
+OUStringLiteral("XSystemShellExecute.execute, 
PathResolve(") + o3tl::toU(path)
 + ") failed",
 {}, 0);
 }
@@ -266,7 +266,7 @@ void SAL_CALL CSysShExec::execute( const OUString& 
aCommand, const OUString& aPa
 if (SHGetFileInfoW(path, 0, , sizeof info, 
SHGFI_ATTRIBUTES) == 0)
 {
 throw css::lang::IllegalArgumentException(
-"XSystemShellExecute.execute, SHGetFileInfoW(" + 
OUString(o3tl::toU(path)) + ") failed", {},
+OUStringLiteral("XSystemShellExecute.execute, 
SHGetFileInfoW(") + o3tl::toU(path) + ") failed", {},
 0);
 }
 if ((info.dwAttributes & SFGAO_LINK) == 0) {
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2020-01-28 Thread iakarsu (via logerrit)
 shell/source/backends/desktopbe/desktopbackend.cxx |4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

New commits:
commit f29cd4d26921ac22cecdee1d52fce7b3a1672efa
Author: iakarsu 
AuthorDate: Mon Jan 27 14:15:15 2020 +0300
Commit: Muhammet Kara 
CommitDate: Tue Jan 28 14:44:30 2020 +0100

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

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

diff --git a/shell/source/backends/desktopbe/desktopbackend.cxx 
b/shell/source/backends/desktopbe/desktopbackend.cxx
index 03fe834506b9..001adefd2e4d 100644
--- a/shell/source/backends/desktopbe/desktopbackend.cxx
+++ b/shell/source/backends/desktopbe/desktopbackend.cxx
@@ -63,9 +63,7 @@ OUString getDefaultImplementationName() {
 }
 
 css::uno::Sequence< OUString > getDefaultSupportedServiceNames() {
-OUString name(
-"com.sun.star.configuration.backend.DesktopBackend");
-return css::uno::Sequence< OUString >(, 1);
+return { "com.sun.star.configuration.backend.DesktopBackend" };
 }
 
 class Default:
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2020-01-28 Thread Mike Kaganski (via logerrit)
 shell/source/win32/SysShExec.cxx |   47 ++-
 1 file changed, 13 insertions(+), 34 deletions(-)

New commits:
commit 72302338f9eb5e965dd84dca9990841151e2f79c
Author: Mike Kaganski 
AuthorDate: Tue Jan 28 10:03:55 2020 +0300
Commit: Mike Kaganski 
CommitDate: Tue Jan 28 09:10:59 2020 +0100

Simplify the code

Unify Windows header usage (wrap into prewin/postwin, remove redundant);
replace "using" with explicit namespace usage; drop some indirection.

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

diff --git a/shell/source/win32/SysShExec.cxx b/shell/source/win32/SysShExec.cxx
index 09ac1814e51d..73142d8a0fce 100644
--- a/shell/source/win32/SysShExec.cxx
+++ b/shell/source/win32/SysShExec.cxx
@@ -34,36 +34,15 @@
 #include 
 #include 
 
-#define WIN32_LEAN_AND_MEAN
-#include 
-#include 
+#include 
 #include 
-#include 
-#include 
-
 #include 
-
-using com::sun::star::uno::Reference;
-using com::sun::star::uno::RuntimeException;
-using com::sun::star::uno::Sequence;
-using com::sun::star::lang::XServiceInfo;
-using com::sun::star::lang::IllegalArgumentException;
-using com::sun::star::system::XSystemShellExecute;
-using com::sun::star::system::SystemShellExecuteException;
+#include 
 
 using namespace ::com::sun::star::system::SystemShellExecuteFlags;
-using namespace cppu;
-
-#define SYSSHEXEC_IMPL_NAME  "com.sun.star.sys.shell.SystemShellExecute"
 
 namespace
 {
-Sequence< OUString > SysShExec_getSupportedServiceNames()
-{
-Sequence< OUString > aRet { "com.sun.star.system.SystemShellExecute" };
-return aRet;
-}
-
 /* This is the error table that defines the mapping between OS error
 codes and errno values */
 
@@ -165,8 +144,8 @@ namespace
 #define E_UNKNOWN_EXEC_ERROR -1
 }
 
-CSysShExec::CSysShExec( const Reference< css::uno::XComponentContext >& 
xContext ) :
-WeakComponentImplHelper< XSystemShellExecute, XServiceInfo >( m_aMutex ),
+CSysShExec::CSysShExec( const css::uno::Reference< css::uno::XComponentContext 
>& xContext ) :
+WeakComponentImplHelper< css::system::XSystemShellExecute, 
css::lang::XServiceInfo >( m_aMutex ),
 m_xContext(xContext)
 {
 /*
@@ -224,15 +203,15 @@ void SAL_CALL CSysShExec::execute( const OUString& 
aCommand, const OUString& aPa
 {
 // parameter checking
 if (0 == aCommand.getLength())
-throw IllegalArgumentException(
+throw css::lang::IllegalArgumentException(
 "Empty command",
-static_cast< XSystemShellExecute* >( this ),
+static_cast< css::system::XSystemShellExecute* >( this ),
 1 );
 
 if ((nFlags & ~(NO_SYSTEM_ERROR_MESSAGE | URIS_ONLY)) != 0)
-throw IllegalArgumentException(
+throw css::lang::IllegalArgumentException(
 "Invalid Flags specified",
-static_cast< XSystemShellExecute* >( this ),
+static_cast< css::system::XSystemShellExecute* >( this ),
 3 );
 
 OUString preprocessed_command(aCommand);
@@ -387,9 +366,9 @@ void SAL_CALL CSysShExec::execute( const OUString& 
aCommand, const OUString& aPa
 else
 psxErr = MapError(psxErr);
 
-throw SystemShellExecuteException(
+throw css::system::SystemShellExecuteException(
 "Error executing command",
-static_cast< XSystemShellExecute* >(this),
+static_cast< css::system::XSystemShellExecute* >(this),
 psxErr);
 }
 else
@@ -412,7 +391,7 @@ void SAL_CALL CSysShExec::execute( const OUString& 
aCommand, const OUString& aPa
 
 OUString SAL_CALL CSysShExec::getImplementationName(  )
 {
-return SYSSHEXEC_IMPL_NAME;
+return "com.sun.star.sys.shell.SystemShellExecute";
 }
 
 sal_Bool SAL_CALL CSysShExec::supportsService( const OUString& ServiceName )
@@ -420,9 +399,9 @@ sal_Bool SAL_CALL CSysShExec::supportsService( const 
OUString& ServiceName )
 return cppu::supportsService(this, ServiceName);
 }
 
-Sequence< OUString > SAL_CALL CSysShExec::getSupportedServiceNames(  )
+css::uno::Sequence< OUString > SAL_CALL CSysShExec::getSupportedServiceNames(  
)
 {
-return SysShExec_getSupportedServiceNames();
+return { "com.sun.star.system.SystemShellExecute" };
 }
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2020-01-27 Thread Mike Kaganski (via logerrit)
 shell/source/win32/SysShExec.cxx |   34 +++---
 1 file changed, 23 insertions(+), 11 deletions(-)

New commits:
commit f772ccb8008c4e9429982a226eab3341da1cdeed
Author: Mike Kaganski 
AuthorDate: Tue Jan 28 01:28:24 2020 +0300
Commit: Mike Kaganski 
CommitDate: Tue Jan 28 08:13:42 2020 +0100

tdf#130216: normalize paths with .. segments

... which obviously are rejected by SHGetFileInfoW and SHParseDisplayName
that it calls internally.

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

diff --git a/shell/source/win32/SysShExec.cxx b/shell/source/win32/SysShExec.cxx
index 42ef1b63e761..09ac1814e51d 100644
--- a/shell/source/win32/SysShExec.cxx
+++ b/shell/source/win32/SysShExec.cxx
@@ -37,6 +37,7 @@
 #define WIN32_LEAN_AND_MEAN
 #include 
 #include 
+#include 
 #include 
 #include 
 
@@ -259,22 +260,34 @@ void SAL_CALL CSysShExec::execute( const OUString& 
aCommand, const OUString& aPa
  + "> failed with " + OUString::number(e1)),
 {}, 0);
 }
+const int MAX_LONG_PATH = 32767; // max longpath on WinNT
+if (pathname.getLength() >= MAX_LONG_PATH)
+{
+throw css::lang::IllegalArgumentException(
+"XSystemShellExecute.execute, path <" + pathname + "> too 
long", {}, 0);
+}
 preprocessed_command = pathname;
+wchar_t path[MAX_LONG_PATH];
+wcscpy_s(path, o3tl::toW(pathname.getStr()));
 for (int i = 0;; ++i) {
+// tdf#130216: normalize c:\path\to\something\..\else into 
c:\path\to\else
+if (PathResolve(path, nullptr, PRF_VERIFYEXISTS | 
PRF_REQUIREABSOLUTE) == 0)
+{
+throw css::lang::IllegalArgumentException(
+"XSystemShellExecute.execute, PathResolve(" + 
OUString(o3tl::toU(path))
++ ") failed",
+{}, 0);
+}
 SHFILEINFOW info;
-if (SHGetFileInfoW(
-o3tl::toW(pathname.getStr()), 0, , sizeof info, 
SHGFI_EXETYPE)
-!= 0)
+if (SHGetFileInfoW(path, 0, , sizeof info, SHGFI_EXETYPE) 
!= 0)
 {
 throw css::lang::IllegalArgumentException(
 "XSystemShellExecute.execute, cannot process <" + 
aCommand + ">", {}, 0);
 }
-if (SHGetFileInfoW(
-o3tl::toW(pathname.getStr()), 0, , sizeof info, 
SHGFI_ATTRIBUTES)
-== 0)
+if (SHGetFileInfoW(path, 0, , sizeof info, 
SHGFI_ATTRIBUTES) == 0)
 {
 throw css::lang::IllegalArgumentException(
-"XSystemShellExecute.execute, SHGetFileInfoW(" + 
pathname + ") failed", {},
+"XSystemShellExecute.execute, SHGetFileInfoW(" + 
OUString(o3tl::toU(path)) + ") failed", {},
 0);
 }
 if ((info.dwAttributes & SFGAO_LINK) == 0) {
@@ -299,7 +312,7 @@ void SAL_CALL CSysShExec::execute( const OUString& 
aCommand, const OUString& aPa
  + o3tl::runtimeToOUString(e3.what())),
 {}, 0);
 }
-e2 = file->Load(o3tl::toW(pathname.getStr()), STGM_READ);
+e2 = file->Load(path, STGM_READ);
 if (FAILED(e2)) {
 throw css::lang::IllegalArgumentException(
 ("XSystemShellExecute.execute, IPersistFile.Load 
failed with "
@@ -313,16 +326,14 @@ void SAL_CALL CSysShExec::execute( const OUString& 
aCommand, const OUString& aPa
  + OUString::number(e2)),
 {}, 0);
 }
-wchar_t path[MAX_PATH];
 WIN32_FIND_DATAW wfd;
-e2 = link->GetPath(path, MAX_PATH, , SLGP_RAWPATH);
+e2 = link->GetPath(path, SAL_N_ELEMENTS(path), , 
SLGP_RAWPATH);
 if (FAILED(e2)) {
 throw css::lang::IllegalArgumentException(
 ("XSystemShellExecute.execute, IShellLink.GetPath 
failed with "
  + OUString::number(e2)),
 {}, 0);
 }
-pathname = o3tl::toU(path);
 // Fail at some arbitrary nesting depth, to avoid an infinite 
loop:
 if (i == 30) {
 throw css::lang::IllegalArgumentException(
@@ -330,6 +341,7 @@ void SAL_CALL CSysShExec::execute( const OUString& 
aCommand, const OUString& aPa
 {}, 0);
 }
 }
+pathname = o3tl::toU(path);
 auto 

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

2020-01-17 Thread Stephan Bergmann (via logerrit)
 shell/source/win32/SysShExec.cxx |   93 ---
 1 file changed, 1 insertion(+), 92 deletions(-)

New commits:
commit bee9f15317d8a9ac909f54791e86f29fdf6a679d
Author: Stephan Bergmann 
AuthorDate: Fri Jan 17 13:16:52 2020 +0100
Commit: Stephan Bergmann 
CommitDate: Fri Jan 17 16:08:50 2020 +0100

Clean up computation of preprocessed_command passed to ShellExecuteExW

* In the URIS_ONLY case (which is intended to open documents etc.), set
  preprocessed_command to the filesystem pathname the first time that is
  computed (and which will no longer fail for file URLs with fragment since
  14b36a16b225bf7c988f118d499a7287c47cd83e "Remove a fragment from a file 
URL
  early on").

* In the !URIS_ONLY case (which is intended to run other programs), we will
  generally be called with aCommand already being a filesystem pathname.  
But
  even if it should be a file URL, it appears to be OK to pass that as-is to
  ShellExecuteExW:  At least on Windows 8, passing
  "file:///C:/Windows/System32/notepad.exe" does start it.

* The code for  "Hyperlinks
  doesnt works" should no longer be relevant:  In the URIS_ONLY case, any
  fragment (called a "jump mark" in that code) has already been removed 
from the
  incoming URL now.  In the !URIS_ONLY case, we should generally not be 
called
  with a URL with a fragment, but even if we are, it should be OK to pass 
that
  as-is to ShellExecuteExW and let it handle that (see above).

* Similarly, the code for
   "Hyperlinks
  between documents not works if link contains anchor at the end" is no 
longer
  relevant for the same reason.

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

diff --git a/shell/source/win32/SysShExec.cxx b/shell/source/win32/SysShExec.cxx
index 74b4ee584f9f..42ef1b63e761 100644
--- a/shell/source/win32/SysShExec.cxx
+++ b/shell/source/win32/SysShExec.cxx
@@ -33,7 +33,6 @@
 #include 
 #include 
 #include 
-#include 
 
 #define WIN32_LEAN_AND_MEAN
 #include 
@@ -163,73 +162,6 @@ namespace
 #define MapError( oserror ) _mapError( oserror )
 
 #define E_UNKNOWN_EXEC_ERROR -1
-
-
-bool is_system_path(const OUString& path_or_uri)
-{
-OUString url;
-osl::FileBase::RC rc = 
osl::FileBase::getFileURLFromSystemPath(path_or_uri, url);
-return (rc == osl::FileBase::E_None);
-}
-
-
-// trying to identify a jump mark
-
-
-const OUStringJUMP_MARK_HTM(".htm#");
-const OUStringJUMP_MARK_HTML(".html#");
-const sal_Unicode HASH_MARK  = '#';
-
-bool has_jump_mark(const OUString& system_path, sal_Int32* jmp_mark_start 
= nullptr)
-{
-sal_Int32 jmp_mark = std::max(
-system_path.lastIndexOf(JUMP_MARK_HTM),
-system_path.lastIndexOf(JUMP_MARK_HTML));
-
-if (jmp_mark_start)
-*jmp_mark_start = jmp_mark;
-
-return (jmp_mark > -1);
-}
-
-
-bool is_existing_file(const OUString& file_name)
-{
-OSL_ASSERT(is_system_path(file_name));
-
-bool exist = false;
-
-OUString file_url;
-osl::FileBase::RC rc = 
osl::FileBase::getFileURLFromSystemPath(file_name, file_url);
-
-if (osl::FileBase::E_None == rc)
-{
-osl::DirectoryItem dir_item;
-rc = osl::DirectoryItem::get(file_url, dir_item);
-exist = (osl::FileBase::E_None == rc);
-}
-return exist;
-}
-
-
-// Jump marks in file urls are illegal.
-
-
-void remove_jump_mark(OUString* p_command)
-{
-OSL_PRECOND(p_command, "invalid parameter");
-
-sal_Int32 pos;
-if (has_jump_mark(*p_command, ))
-{
-const sal_Unicode* p_jmp_mark = p_command->getStr() + pos;
-while (*p_jmp_mark && (*p_jmp_mark != HASH_MARK))
-p_jmp_mark++;
-
-*p_command = OUString(p_command->getStr(), p_jmp_mark - 
p_command->getStr());
-}
-}
-
 }
 
 CSysShExec::CSysShExec( const Reference< css::uno::XComponentContext >& 
xContext ) :
@@ -318,7 +250,6 @@ void SAL_CALL CSysShExec::execute( const OUString& 
aCommand, const OUString& aPa
 if (uri->getScheme().equalsIgnoreAsciiCase("file")) {
 // ShellExecuteExW appears to ignore the fragment of a file URL 
anyway, so remove it:
 uri->clearFragment();
-preprocessed_command = uri->getUriReference();
 OUString pathname;
 auto const e1
 = 
osl::FileBase::getSystemPathFromFileURL(uri->getUriReference(), pathname);
@@ -328,6 +259,7 @@ void SAL_CALL CSysShExec::execute( const OUString& 
aCommand, const OUString& aPa

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

2020-01-15 Thread Stephan Bergmann (via logerrit)
 shell/source/win32/SysShExec.cxx |6 --
 1 file changed, 4 insertions(+), 2 deletions(-)

New commits:
commit 14b36a16b225bf7c988f118d499a7287c47cd83e
Author: Stephan Bergmann 
AuthorDate: Wed Jan 15 17:16:02 2020 +0100
Commit: Stephan Bergmann 
CommitDate: Wed Jan 15 19:16:27 2020 +0100

Remove a fragment from a file URL early on

...as ShellExecuteExW would ignore it anyway

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

diff --git a/shell/source/win32/SysShExec.cxx b/shell/source/win32/SysShExec.cxx
index ccf932e71d03..74b4ee584f9f 100644
--- a/shell/source/win32/SysShExec.cxx
+++ b/shell/source/win32/SysShExec.cxx
@@ -302,6 +302,7 @@ void SAL_CALL CSysShExec::execute( const OUString& 
aCommand, const OUString& aPa
 static_cast< XSystemShellExecute* >( this ),
 3 );
 
+OUString preprocessed_command(aCommand);
 if ((nFlags & URIS_ONLY) != 0)
 {
 css::uno::Reference< css::uri::XUriReference > uri(
@@ -315,8 +316,10 @@ void SAL_CALL CSysShExec::execute( const OUString& 
aCommand, const OUString& aPa
 static_cast< cppu::OWeakObject * >(this), 0);
 }
 if (uri->getScheme().equalsIgnoreAsciiCase("file")) {
+// ShellExecuteExW appears to ignore the fragment of a file URL 
anyway, so remove it:
+uri->clearFragment();
+preprocessed_command = uri->getUriReference();
 OUString pathname;
-uri->clearFragment(); // getSystemPathFromFileURL fails for URLs 
with fragment
 auto const e1
 = 
osl::FileBase::getSystemPathFromFileURL(uri->getUriReference(), pathname);
 if (e1 != osl::FileBase::E_None) {
@@ -420,7 +423,6 @@ void SAL_CALL CSysShExec::execute( const OUString& 
aCommand, const OUString& aPa
 and names no existing file (remember the jump mark
 sign '#' is a valid file name character we remove
 the jump mark, else ShellExecuteEx fails */
-OUString preprocessed_command(aCommand);
 if (is_system_path(preprocessed_command))
 {
 if (has_jump_mark(preprocessed_command) && 
!is_existing_file(preprocessed_command))
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2019-11-19 Thread Stephan Bergmann (via logerrit)
 shell/source/win32/ooofilereader/contentreader.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 1a83975ff44141595f9bce3088550aee545b6622
Author: Stephan Bergmann 
AuthorDate: Tue Nov 19 15:19:18 2019 +0100
Commit: Stephan Bergmann 
CommitDate: Tue Nov 19 18:28:34 2019 +0100

loplugin:indentation (clang-cl)

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

diff --git a/shell/source/win32/ooofilereader/contentreader.cxx 
b/shell/source/win32/ooofilereader/contentreader.cxx
index f6ad69eebef5..efdf5ba1ecd3 100644
--- a/shell/source/win32/ooofilereader/contentreader.cxx
+++ b/shell/source/win32/ooofilereader/contentreader.cxx
@@ -87,7 +87,7 @@ ITag* CContentReader::chooseTagReader( const std::wstring& 
tag_name, const XmlTa
 // if style:style | style:name is exist,, fill the style field, 
otherwise do nothing;
 if  ( XmlAttributes.find(CONTENT_STYLE_STYLE_NAME) != 
XmlAttributes.end())
 return new CAutoStyleTag(XmlAttributes);
-   else
+else
 return new CDummyTag;
 }
 else if ( ( tag_name == CONTENT_STYLE_PROPERTIES ) || ( tag_name == 
CONTENT_TEXT_STYLE_PROPERTIES ) )
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

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

2019-11-15 Thread Stephan Bergmann (via logerrit)
 shell/source/unix/exec/shellexec.cxx |   13 ++---
 1 file changed, 10 insertions(+), 3 deletions(-)

New commits:
commit 1ff1466b055890b2ca0ff3a47262bc048ad78542
Author: Stephan Bergmann 
AuthorDate: Fri Nov 15 08:45:20 2019 +0100
Commit: Stephan Bergmann 
CommitDate: Fri Nov 15 09:44:28 2019 +0100

tdf#128538: Open filesystem directories in Finder after all

Where option "-R" means, according to the open(1) man page: "Reveals the 
file(s)
in the Finder instead of opening them."  This appears to always reveal in
Finder, even for *.app "application directories", so should not affect
CVE-2019-9847.)

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

diff --git a/shell/source/unix/exec/shellexec.cxx 
b/shell/source/unix/exec/shellexec.cxx
index 2448a045105d..3daea4a2b18a 100644
--- a/shell/source/unix/exec/shellexec.cxx
+++ b/shell/source/unix/exec/shellexec.cxx
@@ -117,6 +117,7 @@ void SAL_CALL ShellExec::execute( const OUString& aCommand, 
const OUString& aPar
 }
 
 #ifdef MACOSX
+bool dir = false;
 if (uri->getScheme().equalsIgnoreAsciiCase("file")) {
 OUString pathname;
 auto const e1 = osl::FileBase::getSystemPathFromFileURL(aCommand, 
pathname);
@@ -142,8 +143,10 @@ void SAL_CALL ShellExec::execute( const OUString& 
aCommand, const OUString& aPar
 auto const e3 = errno;
 SAL_INFO("shell", "stat(" << pathname8 << ") failed with errno 
" << e3);
 }
-if (e2 != 0 || !S_ISREG(st.st_mode)
-|| (st.st_mode & (S_IXUSR | S_IXGRP | S_IXOTH)) != 0)
+if (e2 == 0 && S_ISDIR(st.st_mode)) {
+dir = true;
+} else if (e2 != 0 || !S_ISREG(st.st_mode)
+   || (st.st_mode & (S_IXUSR | S_IXGRP | S_IXOTH)) != 0)
 {
 throw css::lang::IllegalArgumentException(
 "XSystemShellExecute.execute, cannot process <" + aCommand 
+ ">", {}, 0);
@@ -172,7 +175,11 @@ void SAL_CALL ShellExec::execute( const OUString& 
aCommand, const OUString& aPar
 // 2.4  If it does not match an exitsting pathname (relative to CWD):
 //  Results in "The file /.../foo:bar does not exits." (where "/..." is
 //  the CWD) on stderr and SystemShellExecuteException.
-aBuffer.append("open --");
+aBuffer.append("open");
+if (dir) {
+aBuffer.append(" -R");
+}
+aBuffer.append(" --");
 #else
 // Just use xdg-open on non-Mac
 aBuffer.append("/usr/bin/xdg-open");
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

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

2019-11-12 Thread Tünde Tóth (via logerrit)
 shell/source/win32/SysShExec.cxx |5 +
 1 file changed, 5 insertions(+)

New commits:
commit 739e6aa3b3cff6d63901f253e145b65a2fef2682
Author: Tünde Tóth 
AuthorDate: Thu Nov 7 14:06:57 2019 +0100
Commit: Stephan Bergmann 
CommitDate: Tue Nov 12 22:23:45 2019 +0100

tdf#54204 File URLs with fragment need toIUri conversion

Non-ASCII file links didn't work when the link contains anchor at
the end.

Note: The "correct" way to convert from a LO-internal to -external
file URL would be the translateToExternal method of the
css.uri.ExternalUriReferenceTranslator UNO service.  But that
translates the URL to be interpreted according to the current Windows
code page (i.e., osl_getThreadTextEncoding), so only supports
characters covered by that code page, and given that  the result is
passed into a Windows wchar_t API, ToIUri nicely avoids such potential
conversion failure.

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

diff --git a/shell/source/win32/SysShExec.cxx b/shell/source/win32/SysShExec.cxx
index 73ef77bbe6a1..ccf932e71d03 100644
--- a/shell/source/win32/SysShExec.cxx
+++ b/shell/source/win32/SysShExec.cxx
@@ -33,6 +33,7 @@
 #include 
 #include 
 #include 
+#include 
 
 #define WIN32_LEAN_AND_MEAN
 #include 
@@ -431,6 +432,10 @@ void SAL_CALL CSysShExec::execute( const OUString& 
aCommand, const OUString& aPa
 OUString aSystemPath;
 if (::osl::FileBase::E_None == 
::osl::FileBase::getSystemPathFromFileURL(preprocessed_command, aSystemPath))
 preprocessed_command = aSystemPath;
+else if (preprocessed_command.startsWithIgnoreAsciiCase("file:"))
+//I use ToIUri conversion instead of the translateToExternal 
method of the css.uri.ExternalUriReferenceTranslator
+//UNO service, because the translateToExternal method only 
supports characters covered by the current Windows code page.
+preprocessed_command = rtl::Uri::decode(preprocessed_command, 
rtl_UriDecodeToIuri, RTL_TEXTENCODING_UTF8);
 }
 
 SHELLEXECUTEINFOW sei;
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

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

2019-10-01 Thread Stephan Bergmann (via logerrit)
 shell/source/win32/ooofilereader/autostyletag.hxx |2 +-
 shell/source/win32/ooofilereader/dummytag.hxx |2 +-
 shell/source/win32/ooofilereader/itag.hxx |2 +-
 shell/source/win32/ooofilereader/keywordstag.hxx  |2 +-
 shell/source/win32/ooofilereader/simpletag.cxx|2 +-
 shell/source/win32/ooofilereader/simpletag.hxx|2 +-
 6 files changed, 6 insertions(+), 6 deletions(-)

New commits:
commit ac8cb02cfdeef48dac0baa6646253170d1e1f2c9
Author: Stephan Bergmann 
AuthorDate: Tue Oct 1 14:00:28 2019 +0200
Commit: Stephan Bergmann 
CommitDate: Tue Oct 1 21:42:00 2019 +0200

loplugin:returnconstval (clang-cl)

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

diff --git a/shell/source/win32/ooofilereader/autostyletag.hxx 
b/shell/source/win32/ooofilereader/autostyletag.hxx
index b1a5cfb546f1..2bfe4f8f4d20 100644
--- a/shell/source/win32/ooofilereader/autostyletag.hxx
+++ b/shell/source/win32/ooofilereader/autostyletag.hxx
@@ -45,7 +45,7 @@ class CAutoStyleTag : public ITag
 virtual void addCharacters(const std::wstring& characters) override;
 virtual void addAttributes(const XmlTagAttributes_t& attributes) 
override;
 virtual std::wstring getTagContent() override { return EMPTY_STRING; };
-virtual ::std::wstring const getTagAttribute( ::std::wstring  const & 
/*attrname*/ ) override { return ::std::wstring() ; }
+virtual ::std::wstring getTagAttribute( ::std::wstring  const & 
/*attrname*/ ) override { return ::std::wstring() ; }
 
 void setStyle( ::std::wstring const & Style );
 void setLocale(const LocaleSet_t& Locale);
diff --git a/shell/source/win32/ooofilereader/dummytag.hxx 
b/shell/source/win32/ooofilereader/dummytag.hxx
index ca16b5503e33..8af406d35d27 100644
--- a/shell/source/win32/ooofilereader/dummytag.hxx
+++ b/shell/source/win32/ooofilereader/dummytag.hxx
@@ -46,7 +46,7 @@ class CDummyTag : public ITag
 return EMPTY_STRING;
 };
 
-virtual ::std::wstring const getTagAttribute( ::std::wstring  const & 
/*attrname*/ ) override { return ::std::wstring(EMPTY_STRING); };
+virtual ::std::wstring getTagAttribute( ::std::wstring  const & 
/*attrname*/ ) override { return ::std::wstring(EMPTY_STRING); };
 };
 
 
diff --git a/shell/source/win32/ooofilereader/itag.hxx 
b/shell/source/win32/ooofilereader/itag.hxx
index 841771818257..64a3f8bd7e79 100644
--- a/shell/source/win32/ooofilereader/itag.hxx
+++ b/shell/source/win32/ooofilereader/itag.hxx
@@ -38,7 +38,7 @@ class ITag
 virtual void addCharacters(const std::wstring& characters) = 0;
 virtual void addAttributes(const XmlTagAttributes_t& attributes) = 0;
 virtual ::std::wstring getTagContent() = 0;
-virtual ::std::wstring const getTagAttribute( ::std::wstring  const & 
attrname ) = 0;
+virtual ::std::wstring getTagAttribute( ::std::wstring  const & 
attrname ) = 0;
 };
 
 #endif
diff --git a/shell/source/win32/ooofilereader/keywordstag.hxx 
b/shell/source/win32/ooofilereader/keywordstag.hxx
index 3fb5372c47eb..2ec3de1cf1c5 100644
--- a/shell/source/win32/ooofilereader/keywordstag.hxx
+++ b/shell/source/win32/ooofilereader/keywordstag.hxx
@@ -36,7 +36,7 @@ class CKeywordsTag : public ITag
 virtual void addCharacters(const std::wstring& characters) override;
 virtual void addAttributes(const XmlTagAttributes_t& attributes) 
override;
 virtual std::wstring getTagContent() override;
-virtual ::std::wstring const getTagAttribute( ::std::wstring  const & 
/*attrname*/ ) override { return ::std::wstring(); };
+virtual ::std::wstring getTagAttribute( ::std::wstring  const & 
/*attrname*/ ) override { return ::std::wstring(); };
 
 private:
 std::vector m_slKeywords;
diff --git a/shell/source/win32/ooofilereader/simpletag.cxx 
b/shell/source/win32/ooofilereader/simpletag.cxx
index 717437bfdb11..82b85aec5ce3 100644
--- a/shell/source/win32/ooofilereader/simpletag.cxx
+++ b/shell/source/win32/ooofilereader/simpletag.cxx
@@ -46,7 +46,7 @@ std::wstring CSimpleTag::getTagContent( )
 return m_SimpleContent;
 }
 
-::std::wstring const CSimpleTag::getTagAttribute( ::std::wstring const & 
attrname )
+::std::wstring CSimpleTag::getTagAttribute( ::std::wstring const & attrname )
 {
 if  ( m_SimpleAttributes.find(attrname) != m_SimpleAttributes.end())
 return m_SimpleAttributes[attrname];
diff --git a/shell/source/win32/ooofilereader/simpletag.hxx 
b/shell/source/win32/ooofilereader/simpletag.hxx
index 5f167681ec4d..4d878fc483d3 100644
--- a/shell/source/win32/ooofilereader/simpletag.hxx
+++ b/shell/source/win32/ooofilereader/simpletag.hxx
@@ -40,7 +40,7 @@ class CSimpleTag : public ITag
 virtual void addAttributes(const XmlTagAttributes_t& attributes) 
override;
 virtual std::wstring 

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

2019-09-27 Thread Caolán McNamara (via logerrit)
 shell/source/tools/lngconvex/lngconvex.cxx |1 +
 1 file changed, 1 insertion(+)

New commits:
commit 1c53f4c0774c3696af9d927651ec625c36567555
Author: Caolán McNamara 
AuthorDate: Fri Sep 27 09:27:01 2019 +0100
Commit: Caolán McNamara 
CommitDate: Fri Sep 27 13:30:36 2019 +0200

cid#1448334 silence Untrusted value as argument

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

diff --git a/shell/source/tools/lngconvex/lngconvex.cxx 
b/shell/source/tools/lngconvex/lngconvex.cxx
index 819f08852575..0fe8d2364441 100644
--- a/shell/source/tools/lngconvex/lngconvex.cxx
+++ b/shell/source/tools/lngconvex/lngconvex.cxx
@@ -462,6 +462,7 @@ void inflate_rc_template_to_file(
 // a particular language that others
 // don't have in order to keep the
 // build
+// coverity[tainted_data] - trusted data source
 if (is_placeholder(token))
 token = make_winrc_unicode_string(token);
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

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

2019-09-24 Thread Julien Nabet (via logerrit)
 shell/source/unix/misc/senddoc.sh |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 1c03df6e82e4bf30294fc0b9e64de5cc39efc5c4
Author: Julien Nabet 
AuthorDate: Mon Sep 23 21:10:59 2019 +0200
Commit: Julien Nabet 
CommitDate: Tue Sep 24 16:15:49 2019 +0200

tdf#127710: fix sending documents to Claws Mail

Thanks to the Paul's (p...@claws-mail.org) contribution

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

diff --git a/shell/source/unix/misc/senddoc.sh 
b/shell/source/unix/misc/senddoc.sh
index 372cee475fe2..394087156a74 100755
--- a/shell/source/unix/misc/senddoc.sh
+++ b/shell/source/unix/misc/senddoc.sh
@@ -349,7 +349,7 @@ case $(basename "$MAILER" | sed 's/-.*$//') in
 shift
 ;;
 --attach)
-ATTACH="${ATTACH:-}${ATTACH:+ }$2"
+ATTACH=${ATTACH:-}${ATTACH:+,}$(echo "file://$2" | 
"${URI_ENCODE}")
 shift
 ;;
 *)
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

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

2019-08-22 Thread Michael Weghorn (via logerrit)
 shell/source/backends/kf5be/kf5backend.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit ff398785bede2b403f8f8e6391ce07538f6cc213
Author: Michael Weghorn 
AuthorDate: Thu Aug 22 19:09:46 2019 +0200
Commit: Michael Weghorn 
CommitDate: Thu Aug 22 22:58:41 2019 +0200

kf5backend.cxx: Use 'free()' instead of 'delete'

'strdup' doc [1] mentions:
"The returned pointer must be passed to 'free' to avoid a memory leak."

This silences a "Mismatched free() / delete / delete []" error that
valgrind outputs.

[1] https://en.cppreference.com/w/c/experimental/dynamic/strdup

Change-Id: I28877be762256a7b995c09415a8ad9977b7998c4
Reviewed-on: https://gerrit.libreoffice.org/77974
Tested-by: Jenkins
Reviewed-by: Michael Weghorn 

diff --git a/shell/source/backends/kf5be/kf5backend.cxx 
b/shell/source/backends/kf5be/kf5backend.cxx
index a2cae6c6c4fd..f55a5150bd3f 100644
--- a/shell/source/backends/kf5be/kf5backend.cxx
+++ b/shell/source/backends/kf5be/kf5backend.cxx
@@ -190,7 +190,7 @@ void initQApp(std::map>& rSettings
 std::unique_ptr app(new QApplication(nFakeArgc, pFakeArgv));
 QObject::connect(app.get(), ::destroyed, app.get(), [nFakeArgc, 
pFakeArgv]() {
 for (int i = 0; i < nFakeArgc; ++i)
-delete pFakeArgv[i];
+free(pFakeArgv[i]);
 delete[] pFakeArgv;
 });
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

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

2019-08-15 Thread Noel Grandin (via logerrit)
 shell/source/cmdmail/cmdmailsuppl.cxx|6 +++---
 slideshow/source/engine/shapes/shapeimporter.cxx |2 +-
 slideshow/source/engine/slide/slideimpl.cxx  |2 +-
 sot/source/sdstor/ucbstorage.cxx |2 +-
 sot/source/unoolestorage/xolesimplestorage.cxx   |2 +-
 5 files changed, 7 insertions(+), 7 deletions(-)

New commits:
commit 8e0918a04ee6797909264943eba23707b224c34c
Author: Noel Grandin 
AuthorDate: Thu Aug 15 13:35:20 2019 +0200
Commit: Noel Grandin 
CommitDate: Thu Aug 15 20:51:38 2019 +0200

loplugin:sequenceloop in shell..sot

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

diff --git a/shell/source/cmdmail/cmdmailsuppl.cxx 
b/shell/source/cmdmail/cmdmailsuppl.cxx
index df8e1f5c170e..bbd0ae07d4cf 100644
--- a/shell/source/cmdmail/cmdmailsuppl.cxx
+++ b/shell/source/cmdmail/cmdmailsuppl.cxx
@@ -237,7 +237,7 @@ void SAL_CALL CmdMailSuppl::sendSimpleMailMessage( const 
Reference< XSimpleMailM
 
 // Append carbon copy recipients set in the message
 Sequence< OUString > aStringList = xSimpleMailMessage->getCcRecipient();
-for ( const auto& rString : aStringList )
+for ( const auto& rString : std::as_const(aStringList) )
 {
 aBuffer.append(" --cc ");
 appendShellWord(aBuffer, rString, false);
@@ -245,7 +245,7 @@ void SAL_CALL CmdMailSuppl::sendSimpleMailMessage( const 
Reference< XSimpleMailM
 
 // Append blind carbon copy recipients set in the message
 aStringList = xSimpleMailMessage->getBccRecipient();
-for ( const auto& rString : aStringList )
+for ( const auto& rString : std::as_const(aStringList) )
 {
 aBuffer.append(" --bcc ");
 appendShellWord(aBuffer, rString, false);
@@ -260,7 +260,7 @@ void SAL_CALL CmdMailSuppl::sendSimpleMailMessage( const 
Reference< XSimpleMailM
 
 // Append attachments set in the message
 aStringList = xSimpleMailMessage->getAttachement();
-for ( const auto& rString : aStringList )
+for ( const auto& rString : std::as_const(aStringList) )
 {
 OUString aSystemPath;
 if ( FileBase::E_None == FileBase::getSystemPathFromFileURL(rString, 
aSystemPath) )
diff --git a/slideshow/source/engine/shapes/shapeimporter.cxx 
b/slideshow/source/engine/shapes/shapeimporter.cxx
index 2b2139ab63b8..65b0414d2645 100644
--- a/slideshow/source/engine/shapes/shapeimporter.cxx
+++ b/slideshow/source/engine/shapes/shapeimporter.cxx
@@ -397,7 +397,7 @@ void 
ShapeImporter::importPolygons(uno::Reference const& xP
 getPropertyValue( nLineColor, xPropSet, "LineColor" );
 getPropertyValue( fLineWidth, xPropSet, "LineWidth" );
 
-drawing::PointSequence* pOuterSequence = aRetval.getArray();
+const drawing::PointSequence* pOuterSequence = aRetval.getArray();
 
 ::basegfx::B2DPolygon aPoly;
 basegfx::B2DPoint aPoint;
diff --git a/slideshow/source/engine/slide/slideimpl.cxx 
b/slideshow/source/engine/slide/slideimpl.cxx
index 3786a00786c2..911f9866074d 100644
--- a/slideshow/source/engine/slide/slideimpl.cxx
+++ b/slideshow/source/engine/slide/slideimpl.cxx
@@ -841,7 +841,7 @@ void SlideImpl::applyShapeAttributes(
 const css::uno::Reference< css::animations::XAnimationNode >& 
xRootAnimationNode,
 bool bInitial) const
 {
-uno::Sequence< animations::TargetProperties > aProps(
+const uno::Sequence< animations::TargetProperties > aProps(
 TargetPropertiesCreator::createTargetProperties( xRootAnimationNode, 
bInitial ) );
 
 // apply extracted values to our shapes
diff --git a/sot/source/sdstor/ucbstorage.cxx b/sot/source/sdstor/ucbstorage.cxx
index 0aa9fff0b3c9..1b3bd3381e8a 100644
--- a/sot/source/sdstor/ucbstorage.cxx
+++ b/sot/source/sdstor/ucbstorage.cxx
@@ -1941,7 +1941,7 @@ bool UCBStorage_Impl::Insert( ::ucbhelper::Content 
*pContent )
 
 try
 {
-Sequence< ContentInfo > aInfo = pContent->queryCreatableContentsInfo();
+const Sequence< ContentInfo > aInfo = 
pContent->queryCreatableContentsInfo();
 if ( !aInfo.hasElements() )
 return false;
 
diff --git a/sot/source/unoolestorage/xolesimplestorage.cxx 
b/sot/source/unoolestorage/xolesimplestorage.cxx
index 82d7f8bbb7a5..5a7f561b0a22 100644
--- a/sot/source/unoolestorage/xolesimplestorage.cxx
+++ b/sot/source/unoolestorage/xolesimplestorage.cxx
@@ -236,7 +236,7 @@ void OLESimpleStorage::InsertNameAccessToStorage_Impl( 
BaseStorage* pStorage, co
 
 try
 {
-uno::Sequence< OUString > aElements = xNameAccess->getElementNames();
+const uno::Sequence< OUString > aElements = 
xNameAccess->getElementNames();
 for ( const auto& rElement : aElements )
 {
 uno::Reference< io::XInputStream > xInputStream;
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org

[Libreoffice-commits] core.git: shell/source slideshow/source solenv/bin solenv/doc solenv/gbuild

2019-08-12 Thread Andrea Gelmini (via logerrit)
 shell/source/tools/lngconvex/lngconvex.cxx |2 +-
 slideshow/source/engine/slideshowimpl.cxx  |2 +-
 solenv/bin/desktop-translate.pl|2 +-
 solenv/bin/fix-includes.pl |2 +-
 solenv/doc/gbuild/doxygen.cfg  |2 +-
 solenv/doc/gbuild/solenv/gbuild/helper.mk  |2 +-
 solenv/gbuild/UnpackedTarball.mk   |2 +-
 7 files changed, 7 insertions(+), 7 deletions(-)

New commits:
commit 5eb6f2d08d133a042a5dbd450bdb206f39399ce4
Author: Andrea Gelmini 
AuthorDate: Sun Aug 11 18:32:30 2019 +0200
Commit: Julien Nabet 
CommitDate: Mon Aug 12 11:40:36 2019 +0200

Fix typos

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

diff --git a/shell/source/tools/lngconvex/lngconvex.cxx 
b/shell/source/tools/lngconvex/lngconvex.cxx
index 452e88e29147..819f08852575 100644
--- a/shell/source/tools/lngconvex/lngconvex.cxx
+++ b/shell/source/tools/lngconvex/lngconvex.cxx
@@ -169,7 +169,7 @@ private:
 OString maBcp47;
 };
 
-/** Convert a OUString to the MS resource
+/** Convert an OUString to the MS resource
 file format string e.g.
 OUString -> L"\x1A00\x2200\x3400" */
 std::string make_winrc_unicode_string(const OUString& str)
diff --git a/slideshow/source/engine/slideshowimpl.cxx 
b/slideshow/source/engine/slideshowimpl.cxx
index b3d21f3fff3a..5830c56c2c91 100644
--- a/slideshow/source/engine/slideshowimpl.cxx
+++ b/slideshow/source/engine/slideshowimpl.cxx
@@ -1356,7 +1356,7 @@ sal_Bool SlideShowImpl::addView(
   slideSize.getY() ) );
 }
 
-// clear view area (since its newly added,
+// clear view area (since it's newly added,
 // we need a clean slate)
 pView->clearAll();
 
diff --git a/solenv/bin/desktop-translate.pl b/solenv/bin/desktop-translate.pl
index 259e7da752fb..a888fc48ec71 100644
--- a/solenv/bin/desktop-translate.pl
+++ b/solenv/bin/desktop-translate.pl
@@ -22,7 +22,7 @@ eval 'exec perl -wS $0 ${1+"$@"}'
 
 #
 # Translates multiple .desktop files at once with strings from .ulf
-# files; if you add new translateable .ulf files please add them to
+# files; if you add new translatable .ulf files please add them to
 # l10ntools/source/localize.cxx
 #
 
diff --git a/solenv/bin/fix-includes.pl b/solenv/bin/fix-includes.pl
index 740424dcccdb..837fcf2d8cac 100755
--- a/solenv/bin/fix-includes.pl
+++ b/solenv/bin/fix-includes.pl
@@ -36,7 +36,7 @@ sub check_headers
   seek $fh,0,0;
   foreach $line (@content){
 if($line =~ m/#include "(\w*)\//){
-  # If a include is local and it should be global, make it global
+  # If an include is local and it should be global, make it global
   if($1 ~~ @includes){
 print "local header $line\n";
 $line =~ s/"/https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

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

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

New commits:
commit 2207269a84c7c9920af3385b837ce67978c720b4
Author: Mike Kaganski 
AuthorDate: Thu Aug 1 10:52:12 2019 +0200
Commit: Mike Kaganski 
CommitDate: Thu Aug 1 14:49:31 2019 +0200

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

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

Regression from commit d59ec4cd1660410fa1b18c50d2d83b1417a82ddc.

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

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

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

2019-07-30 Thread Jan-Marek Glogowski (via logerrit)
 shell/source/win32/simplemail/senddoc.cxx |5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

New commits:
commit e79f61340405dcc75f3fe41f727dea4ba4202c2e
Author: Jan-Marek Glogowski 
AuthorDate: Tue Jul 23 13:48:47 2019 +0200
Commit: Jan-Marek Glogowski 
CommitDate: Tue Jul 30 16:15:16 2019 +0200

tdf#126597 don't use modeless dialog for senddoc.exe

There is already a large comment in initAttachmentList about
problems with MAPI_DIALOG_MODELESS. Using MAPI_DIALOG_MODELESS with
Outlook 2016 and multiple attachments sometimes produces a
MAPI_E_FAILURE, but most times it crashes for me. And it's not a
problem with the removed temporary files, as uncommenting that
shows the same problem. And there seems to be many more problems:


https://social.msdn.microsoft.com/Forums/en-US/5d8fece6-9d93-490c-9331-625c17e3291d/mapisendmailhelper-and-mapidialogmodeless

But actually I don't see any blocking of LO, if I switch to
using MAPI_DIALOG, as senddoc.exe already runs in the background.

So this switches MAPI_DIALOG_MODELESS to MAPI_DIALOG.

This reverts commit 5874c76371562c3e2d8564b1fb04df1997091d27
("tdf#116074: Use modeless dialogs with supporting mailers").

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

diff --git a/shell/source/win32/simplemail/senddoc.cxx 
b/shell/source/win32/simplemail/senddoc.cxx
index b685cc906104..a7a87fdb2a25 100644
--- a/shell/source/win32/simplemail/senddoc.cxx
+++ b/shell/source/win32/simplemail/senddoc.cxx
@@ -207,8 +207,9 @@ static void initParameter(int argc, wchar_t* argv[])
 
 if (_wcsicmp(argv[i], L"--mapi-dialog") == 0)
 {
-// Outlook 2013+; for earlier versions this equals to MAPI_DIALOG
-gMapiFlags |= MAPI_DIALOG_MODELESS;
+// MAPI_DIALOG_MODELESS has many problems and crashes Outlook 2016.
+// see the commit message for a lengthy description.
+gMapiFlags |= MAPI_DIALOG;
 }
 else if (_wcsicmp(argv[i], L"--mapi-logon-ui") == 0)
 {
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

[Libreoffice-commits] core.git: shell/source slideshow/source sot/source starmath/source stoc/Library_bootstrap.mk stoc/source svgio/qa

2019-07-22 Thread Arkadiy Illarionov (via logerrit)
 shell/source/cmdmail/cmdmailsuppl.cxx|   15 -
 slideshow/source/engine/activities/activitiesfactory.cxx |4 
 slideshow/source/engine/opengl/TransitionerImpl.cxx  |   93 ++
 slideshow/source/engine/shapes/shapeimporter.cxx |7 
 slideshow/source/engine/slide/slideimpl.cxx  |   16 -
 slideshow/source/engine/tools.cxx|6 
 sot/source/sdstor/ucbstorage.cxx |   12 
 sot/source/unoolestorage/xolesimplestorage.cxx   |8 
 starmath/source/cfgitem.cxx  |   38 --
 starmath/source/mathmlimport.cxx |   39 +-
 starmath/source/unomodel.cxx |   28 -
 stoc/Library_bootstrap.mk|1 
 stoc/source/corereflection/criface.cxx   |8 
 stoc/source/defaultregistry/defaultregistry.cxx  |   96 --
 stoc/source/implementationregistration/implreg.cxx   |  215 ---
 stoc/source/inspect/introspection.cxx|   55 +--
 stoc/source/invocation/invocation.cxx|8 
 stoc/source/servicemanager/servicemanager.cxx|   50 +--
 stoc/source/simpleregistry/simpleregistry.cxx|   18 -
 svgio/qa/cppunit/SvgImportTest.cxx   |   14 
 20 files changed, 221 insertions(+), 510 deletions(-)

New commits:
commit 6ffdc88e79904882e319bdd0b901e7491abae0b3
Author: Arkadiy Illarionov 
AuthorDate: Sat Jul 20 20:03:15 2019 +0300
Commit: Arkadiy Illarionov 
CommitDate: Mon Jul 22 18:42:35 2019 +0200

Simplify Sequence iterations in shell..svgio

Use range-based loops, STL and comphelper functions

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

diff --git a/shell/source/cmdmail/cmdmailsuppl.cxx 
b/shell/source/cmdmail/cmdmailsuppl.cxx
index 6a076a632806..b4e4322a2ff2 100644
--- a/shell/source/cmdmail/cmdmailsuppl.cxx
+++ b/shell/source/cmdmail/cmdmailsuppl.cxx
@@ -237,20 +237,18 @@ void SAL_CALL CmdMailSuppl::sendSimpleMailMessage( const 
Reference< XSimpleMailM
 
 // Append carbon copy recipients set in the message
 Sequence< OUString > aStringList = xSimpleMailMessage->getCcRecipient();
-sal_Int32 n, nmax = aStringList.getLength();
-for ( n = 0; n < nmax; n++ )
+for ( const auto& rString : aStringList )
 {
 aBuffer.append(" --cc ");
-appendShellWord(aBuffer, aStringList[n], false);
+appendShellWord(aBuffer, rString, false);
 }
 
 // Append blind carbon copy recipients set in the message
 aStringList = xSimpleMailMessage->getBccRecipient();
-nmax = aStringList.getLength();
-for ( n = 0; n < nmax; n++ )
+for ( const auto& rString : aStringList )
 {
 aBuffer.append(" --bcc ");
-appendShellWord(aBuffer, aStringList[n], false);
+appendShellWord(aBuffer, rString, false);
 }
 
 // Append subject if set in the message
@@ -262,11 +260,10 @@ void SAL_CALL CmdMailSuppl::sendSimpleMailMessage( const 
Reference< XSimpleMailM
 
 // Append attachments set in the message
 aStringList = xSimpleMailMessage->getAttachement();
-nmax = aStringList.getLength();
-for ( n = 0; n < nmax; n++ )
+for ( const auto& rString : aStringList )
 {
 OUString aSystemPath;
-if ( FileBase::E_None == 
FileBase::getSystemPathFromFileURL(aStringList[n], aSystemPath) )
+if ( FileBase::E_None == FileBase::getSystemPathFromFileURL(rString, 
aSystemPath) )
 {
 aBuffer.append(" --attach ");
 appendShellWord(aBuffer, aSystemPath, true);
diff --git a/slideshow/source/engine/activities/activitiesfactory.cxx 
b/slideshow/source/engine/activities/activitiesfactory.cxx
index ba75b46eb5a1..e2cc9987e998 100644
--- a/slideshow/source/engine/activities/activitiesfactory.cxx
+++ b/slideshow/source/engine/activities/activitiesfactory.cxx
@@ -621,11 +621,11 @@ AnimationActivitySharedPtr createValueListActivity(
 ValueVectorType aValueVector;
 aValueVector.reserve( rValues.getLength() );
 
-for( ::std::size_t i=0, nLen=rValues.getLength(); i SAL_CALL convertFromRGB( const 
uno::Sequence< rendering::RGBColor >& rgbColor ) override
 {
-const rendering::RGBColor* pIn( rgbColor.getConstArray() );
-const std::size_t nLen( rgbColor.getLength() );
+const sal_Int32 nLen( rgbColor.getLength() );
 
 uno::Sequence< double > aRes(nLen*4);
 double* pColors=aRes.getArray();
-for( std::size_t i=0; iRed;
-*pColors++ = pIn->Green;
-*pColors++ = pIn->Blue;
+*pColors++ = rIn.Red;
+*pColors++ = rIn.Green;
+*pColors++ = rIn.Blue;
 *pColors++ = 1.0;
-++pIn;
 }
 return aRes;
 }
 

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

2019-07-18 Thread Caolán McNamara (via logerrit)
 shell/source/tools/lngconvex/lngconvex.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit fa7ca0a1c7f899f9df09e96ffe7f7bb3f48c850f
Author: Caolán McNamara 
AuthorDate: Thu Jul 18 10:54:59 2019 +0100
Commit: Caolán McNamara 
CommitDate: Thu Jul 18 22:46:05 2019 +0200

cid#1448418 Unchecked return value

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

diff --git a/shell/source/tools/lngconvex/lngconvex.cxx 
b/shell/source/tools/lngconvex/lngconvex.cxx
index ff8126285ff6..452e88e29147 100644
--- a/shell/source/tools/lngconvex/lngconvex.cxx
+++ b/shell/source/tools/lngconvex/lngconvex.cxx
@@ -108,7 +108,7 @@ OUString get_absolute_path(
 osl::FileBase::getFileURLFromSystemPath(RelDir, rel_url);
 
 OUString abs_url;
-osl::FileBase::getAbsoluteFileURL(base_url, rel_url, abs_url);
+(void)osl::FileBase::getAbsoluteFileURL(base_url, rel_url, abs_url);
 
 OUString abs_sys_path;
 osl::FileBase::getSystemPathFromFileURL(abs_url, abs_sys_path);
___
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: shell/source

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

New commits:
commit fa7412039f7d89a9b15aeabb99b0f5380b690cfa
Author: Mike Kaganski 
AuthorDate: Fri May 17 14:39:04 2019 +0200
Commit: Mike Kaganski 
CommitDate: Fri May 17 16:25:12 2019 +0200

Add license statement

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

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: shell/source

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

New commits:
commit 04b055f111be7044bdd97865a8f0b11215b25191
Author: Mike Kaganski 
AuthorDate: Thu May 16 07:49:46 2019 +0200
Commit: Mike Kaganski 
CommitDate: Thu May 16 10:21:42 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 

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: shell/source

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

New commits:
commit bb62eff4b4202ac85f3366d21fb1cbef52958b6d
Author: Mike Kaganski 
AuthorDate: Wed May 15 08:59:01 2019 +0200
Commit: Mike Kaganski 
CommitDate: Wed May 15 10:23:35 2019 +0200

Check passed pointers

Change-Id: Idf5e77e4122ad4b5b91f25c50fdaaf25e34a76ae
Reviewed-on: https://gerrit.libreoffice.org/72336
Tested-by: Jenkins
Reviewed-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: shell/source

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

New commits:
commit a11536d5ea695826844581c8c8f883970e0c8294
Author: Mike Kaganski 
AuthorDate: Wed May 15 08:31:44 2019 +0200
Commit: Mike Kaganski 
CommitDate: Wed May 15 10:06:17 2019 +0200

Use lambdas to initialize statics

Change-Id: Ib03bfd795967ba70333d71d9e5eeec97be90be79
Reviewed-on: https://gerrit.libreoffice.org/72334
Tested-by: Jenkins
Reviewed-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, );
-if (FAILED(hr))
-return nullptr;
+if (FAILED(LoadTypeLib(szFile, )))
+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: shell/source

2019-05-14 Thread Mike Kaganski (via logerrit)
 shell/source/win32/spsupp/COMOpenDocuments.cxx |   17 -
 1 file changed, 12 insertions(+), 5 deletions(-)

New commits:
commit 31cc28ca7c02f28b64e9d757c9fc17e2a81ba352
Author: Mike Kaganski 
AuthorDate: Tue May 14 19:15:59 2019 +0200
Commit: Mike Kaganski 
CommitDate: Wed May 15 05:32:15 2019 +0200

Use proper VARIANT_BOOL values: VARIANT_TRUE is actually -1

Who was that idiot who initially used wrong values??? Hmm... oh damn,
that was me :-(

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

diff --git a/shell/source/win32/spsupp/COMOpenDocuments.cxx 
b/shell/source/win32/spsupp/COMOpenDocuments.cxx
index 319cd8c1751a..4d00b8de6c46 100644
--- a/shell/source/win32/spsupp/COMOpenDocuments.cxx
+++ b/shell/source/win32/spsupp/COMOpenDocuments.cxx
@@ -16,8 +16,11 @@
 #include 
 #include 
 
+namespace
+{
+
 // Display confirmation dialog, return false on negative answer
-static bool SecurityWarning(const wchar_t* sProgram, const wchar_t* sDocument)
+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];
@@ -30,7 +33,7 @@ static bool SecurityWarning(const wchar_t* sProgram, const 
wchar_t* sDocument)
 }
 
 // Returns S_OK if successful
-static HRESULT LOStart(const wchar_t* sModeArg, const wchar_t* sFilePath, bool 
bDoSecurityWarning)
+HRESULT LOStart(const wchar_t* sModeArg, const wchar_t* sFilePath, bool 
bDoSecurityWarning)
 {
 const wchar_t* sProgram = GetLOPath();
 if (bDoSecurityWarning && !SecurityWarning(sProgram, sFilePath))
@@ -76,6 +79,10 @@ static HRESULT LOStart(const wchar_t* sModeArg, const 
wchar_t* sFilePath, bool b
 return S_OK;
 }
 
+VARIANT_BOOL toVBool(bool b) { return b ? VARIANT_TRUE : VARIANT_FALSE; }
+
+} // namespace
+
 // IObjectSafety methods
 
 void COMOpenDocuments::COMObjectSafety::SetMaskedOptions(DWORD iMask, DWORD 
iOptions)
@@ -309,7 +316,7 @@ STDMETHODIMP COMOpenDocuments::CreateNewDocument2(
 {
 // TODO: resolve the program from varProgID (nullptr -> default?)
 HRESULT hr = LOStart(L"-n", bstrTemplateLocation, 
m_aObjectSafety.GetSafe_forUntrustedCaller() || 
m_aObjectSafety.GetSafe_forUntrustedData());
-*pbResult = VARIANT_BOOL(SUCCEEDED(hr));
+*pbResult = toVBool(SUCCEEDED(hr));
 return hr;
 }
 
@@ -360,7 +367,7 @@ STDMETHODIMP COMOpenDocuments::ViewDocument3(
 {
 // TODO: resolve the program from varProgID (nullptr -> default?)
 HRESULT hr = LOStart(L"--view", bstrDocumentLocation, 
m_aObjectSafety.GetSafe_forUntrustedCaller() || 
m_aObjectSafety.GetSafe_forUntrustedData());
-*pbResult = VARIANT_BOOL(SUCCEEDED(hr));
+*pbResult = toVBool(SUCCEEDED(hr));
 return hr;
 }
 
@@ -422,7 +429,7 @@ STDMETHODIMP COMOpenDocuments::EditDocument3(
 {
 // TODO: resolve the program from varProgID (nullptr -> default?)
 HRESULT hr = LOStart(L"-o", bstrDocumentLocation, 
m_aObjectSafety.GetSafe_forUntrustedCaller() || 
m_aObjectSafety.GetSafe_forUntrustedData());
-*pbResult = VARIANT_BOOL(SUCCEEDED(hr));
+*pbResult = toVBool(SUCCEEDED(hr));
 return hr;
 }
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

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

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

New commits:
commit 430c352139b96c7f26b95d730dc19123869520ee
Author: Mike Kaganski 
AuthorDate: Tue May 14 09:52:20 2019 +0200
Commit: Mike Kaganski 
CommitDate: Tue May 14 10:46:44 2019 +0200

Implement OpenDocuments::PromptedOnLastOpen

This prevents SharePoint from trying to download documents in browser
after they were already opened by LibreOffice SharePoint integration
ActiveX control.

The implementation just returns true, to avoid instant refresh of the
site in browser. TODO: fine-tune when understood when and why it makes
sense to return false.

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

diff --git a/shell/source/win32/spsupp/COMOpenDocuments.cxx 
b/shell/source/win32/spsupp/COMOpenDocuments.cxx
index 68940e016147..319cd8c1751a 100644
--- a/shell/source/win32/spsupp/COMOpenDocuments.cxx
+++ b/shell/source/win32/spsupp/COMOpenDocuments.cxx
@@ -320,10 +320,23 @@ STDMETHODIMP COMOpenDocuments::CreateNewDocument2(
 // refreshes itself the next time it receives focus. One refresh can occur 
after the new document
 // is saved to the server
 STDMETHODIMP COMOpenDocuments::PromptedOnLastOpen(
-VARIANT_BOOL* /*pbResult*/) // true if the security dialog box that 
appears when a document is opened has already appeared; otherwise false
+VARIANT_BOOL* pbResult) // true if the security dialog box that appears 
when a document is opened has already appeared; otherwise false
 {
-// TODO
-return E_NOTIMPL;
+// This method is used by SharePoint e.g. after calling ViewDocument3. 
Needs to be implemented,
+// otherwise IE would show download bar ("Do you want to open Foo.xls?"), 
as if opening with
+// LibreOffice failed, even if actually it succeeded.
+if (!pbResult)
+return E_POINTER;
+// Returning true makes SharePoint library to refresh only when focused 
next time; false makes
+// it refresh instantly. The JavaScript code involved is this:
+// var fRefreshOnNextFocus=stsOpen.PromptedOnLastOpen();
+// if (fRefreshOnNextFocus)
+// window.onfocus=RefreshOnNextFocus;
+// else
+// SetWindowRefreshOnFocus();
+// It seems to be no reason to require immediate refresh, so just return 
true.
+*pbResult = VARIANT_TRUE;
+return S_OK;
 }
 
 // IOWSNewDocument3 methods
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

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

2019-04-17 Thread Katarina Behrens (via logerrit)
 shell/source/backends/kde5be/kde5backend.cxx |   56 ---
 1 file changed, 42 insertions(+), 14 deletions(-)

New commits:
commit 5a64bc2b1214e6ad8424f57576aa5752a09815d4
Author: Katarina Behrens 
AuthorDate: Tue Apr 16 09:47:31 2019 +0200
Commit: Thorsten Behrens 
CommitDate: Wed Apr 17 17:37:52 2019 +0200

Stop qt event loop after KDE settings have been read

Two use-cases here in kde5backend
1) kde or qt vclplug has already started qt event loop => just use this
loop to read KDE settings
2) no qt event loop runs (we're most likely in gtk3_kde5 vclplug) =>
start a new event loop, read the settings and stop it

In case 2) letting qt event loop run means subsequently all UI ops
need to happen in main thread. This is problematic to enforce in
non-qt-based vclplugs

In both cases, cache those settings for future use - the assumption is,
most of them are static during a session anyway.

Change-Id: Ifa203f4cdb9a753db808f945762fb131ee83393c
Reviewed-on: https://gerrit.libreoffice.org/70808
Tested-by: Jenkins
Reviewed-by: Thorsten Behrens 

diff --git a/shell/source/backends/kde5be/kde5backend.cxx 
b/shell/source/backends/kde5be/kde5backend.cxx
index e2f6e25c0764..101a21387a4c 100644
--- a/shell/source/backends/kde5be/kde5backend.cxx
+++ b/shell/source/backends/kde5be/kde5backend.cxx
@@ -120,7 +120,7 @@ private:
 {
 }
 
-bool enabled_;
+std::map> m_KDESettings;
 };
 
 OString getDisplayArg()
@@ -148,10 +148,28 @@ OString getExecutable()
 return OUStringToOString(aBin, osl_getThreadTextEncoding());
 }
 
+void readKDESettings(std::map>& 
rSettings)
+{
+const std::vector aKeys
+= { "EnableATToolSupport",  "ExternalMailer",   
"SourceViewFontHeight",
+"SourceViewFontName",   "WorkPathVariable", 
"ooInetFTPProxyName",
+"ooInetFTPProxyPort",   "ooInetHTTPProxyName",  
"ooInetHTTPProxyPort",
+"ooInetHTTPSProxyName", "ooInetHTTPSProxyPort", "ooInetNoProxy",
+"ooInetProxyType" };
+
+for (const OUString& aKey : aKeys)
+{
+css::beans::Optional aValue = 
kde5access::getValue(aKey);
+std::pair> elem
+= std::make_pair(aKey, aValue);
+rSettings.insert(elem);
+}
+}
+
 // init the QApplication when we load the kde5backend into a non-Qt vclplug 
(e.g. Gtk3KDE5)
 // TODO: use a helper process to read these values without linking to Qt 
directly?
 // TODO: share this code somehow with Qt5Instance.cxx?
-void initQApp()
+void initQApp(std::map>& 
rSettings)
 {
 const auto aDisplay = getDisplayArg();
 int nFakeArgc = aDisplay.isEmpty() ? 2 : 3;
@@ -169,36 +187,42 @@ void initQApp()
 unsetenv("SESSION_MANAGER");
 }
 
-auto app = new QApplication(nFakeArgc, pFakeArgv);
-QObject::connect(app, ::destroyed, app, [nFakeArgc, pFakeArgv]() {
+std::unique_ptr app(new QApplication(nFakeArgc, pFakeArgv));
+QObject::connect(app.get(), ::destroyed, app.get(), [nFakeArgc, 
pFakeArgv]() {
 for (int i = 0; i < nFakeArgc; ++i)
 delete pFakeArgv[i];
 delete[] pFakeArgv;
 });
 
+readKDESettings(rSettings);
+
 if (session_manager != nullptr)
 {
 // coverity[tainted_string] - trusted source for setenv
 setenv("SESSION_MANAGER", session_manager, 1);
 free(session_manager);
 }
-
-QApplication::setQuitOnLastWindowClosed(false);
 }
 
 Service::Service()
-: enabled_(false)
 {
 css::uno::Reference 
context(css::uno::getCurrentContext());
 if (context.is())
 {
-if (!qApp)
-{
-initQApp();
-}
 OUString desktop;
 context->getValueByName("system.desktop-environment") >>= desktop;
-enabled_ = desktop == "KDE5" && qApp != nullptr;
+
+if (desktop == "KDE5")
+{
+if (!qApp) // no qt event loop yet
+{
+// so we start one and read KDE settings
+initQApp(m_KDESettings);
+}
+else // someone else (most likely kde/qt vclplug) has started qt 
event loop
+// all that is left to do is to read KDE settings
+readKDESettings(m_KDESettings);
+}
 }
 }
 
@@ -218,8 +242,12 @@ css::uno::Any Service::getPropertyValue(OUString const& 
PropertyName)
 || PropertyName == "ooInetHTTPSProxyPort" || PropertyName == 
"ooInetNoProxy"
 || PropertyName == "ooInetProxyType")
 {
-return css::uno::makeAny(enabled_ ? kde5access::getValue(PropertyName)
-  : 
css::beans::Optional());
+std::map>::iterator it
+= m_KDESettings.find(PropertyName);
+if (it != m_KDESettings.end())
+return css::uno::makeAny(it->second);
+else
+return css::uno::makeAny(css::beans::Optional());
 }
 else if (PropertyName == "givenname" 

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

2019-04-16 Thread Katarina Behrens (via logerrit)
 shell/source/backends/kde5be/kde5access.cxx |   32 ++--
 1 file changed, 12 insertions(+), 20 deletions(-)

New commits:
commit cc191e4f5da18c3b223316f39aac23003ca54671
Author: Katarina Behrens 
AuthorDate: Tue Apr 16 08:58:38 2019 +0200
Commit: Thorsten Behrens 
CommitDate: Wed Apr 17 00:58:50 2019 +0200

Fix wrong proxy setting URLs in kde5backend

this copy'n'pasta blunder looks innocuous but can slow down loading
of JVM (which reads proxy settings among others) in KDE environment
significantly

Change-Id: I98f0fb107a2ee825bcd47731a5a9d15017ba63bc
Reviewed-on: https://gerrit.libreoffice.org/70806
Tested-by: Jenkins
Reviewed-by: Thorsten Behrens 

diff --git a/shell/source/backends/kde5be/kde5access.cxx 
b/shell/source/backends/kde5be/kde5access.cxx
index 0f2218551d5f..6147c8f0a83d 100644
--- a/shell/source/backends/kde5be/kde5access.cxx
+++ b/shell/source/backends/kde5be/kde5access.cxx
@@ -106,8 +106,7 @@ css::beans::Optional getValue(OUString 
const& id)
 break;
 case KProtocolManager::PACProxy: // A proxy configuration URL has 
been given
 case KProtocolManager::WPADProxy: // A proxy should be 
automatically discovered
-case KProtocolManager::
-EnvVarProxy: // Use the proxy values set through environment 
variables
+case KProtocolManager::EnvVarProxy: // Proxy values set through 
environment variables
 // In such cases, the proxy address is not stored in KDE, but 
determined dynamically.
 // The proxy address may depend on the requested address, on 
the time of the day, on the speed of the wind...
 // The best we can do here is to ask the current value for a 
given address.
@@ -134,8 +133,7 @@ css::beans::Optional getValue(OUString 
const& id)
 break;
 case KProtocolManager::PACProxy: // A proxy configuration URL has 
been given
 case KProtocolManager::WPADProxy: // A proxy should be 
automatically discovered
-case KProtocolManager::
-EnvVarProxy: // Use the proxy values set through environment 
variables
+case KProtocolManager::EnvVarProxy: // Proxy values set through 
environment variables
 // In such cases, the proxy address is not stored in KDE, but 
determined dynamically.
 // The proxy address may depend on the requested address, on 
the time of the day, on the speed of the wind...
 // The best we can do here is to ask the current value for a 
given address.
@@ -162,13 +160,12 @@ css::beans::Optional getValue(OUString 
const& id)
 break;
 case KProtocolManager::PACProxy: // A proxy configuration URL has 
been given
 case KProtocolManager::WPADProxy: // A proxy should be 
automatically discovered
-case KProtocolManager::
-EnvVarProxy: // Use the proxy values set through environment 
variables
+case KProtocolManager::EnvVarProxy: // Proxy values set through 
environment variables
 // In such cases, the proxy address is not stored in KDE, but 
determined dynamically.
 // The proxy address may depend on the requested address, on 
the time of the day, on the speed of the wind...
 // The best we can do here is to ask the current value for a 
given address.
 aHTTPProxy = KProtocolManager::proxyForUrl(
-QUrl(QStringLiteral("ftp://ftp.libreoffice.org;)));
+QUrl(QStringLiteral("http://www.libreoffice.org;)));
 break;
 default: // No proxy is used
 break;
@@ -190,13 +187,12 @@ css::beans::Optional getValue(OUString 
const& id)
 break;
 case KProtocolManager::PACProxy: // A proxy configuration URL has 
been given
 case KProtocolManager::WPADProxy: // A proxy should be 
automatically discovered
-case KProtocolManager::
-EnvVarProxy: // Use the proxy values set through environment 
variables
+case KProtocolManager::EnvVarProxy: // Proxy values set through 
environment variables
 // In such cases, the proxy address is not stored in KDE, but 
determined dynamically.
 // The proxy address may depend on the requested address, on 
the time of the day, on the speed of the wind...
 // The best we can do here is to ask the current value for a 
given address.
 aHTTPProxy = KProtocolManager::proxyForUrl(
-QUrl(QStringLiteral("ftp://ftp.libreoffice.org;)));
+QUrl(QStringLiteral("http://www.libreoffice.org;)));
 break;
 default: // No proxy is used
 break;
@@ -218,13 +214,12 @@ css::beans::Optional getValue(OUString 
const& id)
 

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

2019-04-13 Thread Takeshi Abe (via logerrit)
 shell/source/backends/desktopbe/desktopbackend.cxx |   21 +
 1 file changed, 13 insertions(+), 8 deletions(-)

New commits:
commit 88d46ba32e4a03d848d82210071c42208e0d6eca
Author: Takeshi Abe 
AuthorDate: Thu Mar 28 19:04:30 2019 +0900
Commit: Caolán McNamara 
CommitDate: Sat Apr 13 14:59:48 2019 +0200

tdf#119890 followup: Forbid HOME to be the default dir

... of user templates

This is kludgy yet better than making innocent users waiting for
the template dialog ~forever as pointed out in the comments in
.

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

diff --git a/shell/source/backends/desktopbe/desktopbackend.cxx 
b/shell/source/backends/desktopbe/desktopbackend.cxx
index 4f3c2940869b..14b22b033fb1 100644
--- a/shell/source/backends/desktopbe/desktopbackend.cxx
+++ b/shell/source/backends/desktopbe/desktopbackend.cxx
@@ -127,7 +127,7 @@ void Default::setPropertyValue(OUString const &, 
css::uno::Any const &)
 static_cast< cppu::OWeakObject * >(this), -1);
 }
 
-OUString xdg_user_dir_lookup (const char *type)
+OUString xdg_user_dir_lookup (const char *type, bool bAllowHomeDir)
 {
 size_t nLenType = strlen(type);
 char *config_home;
@@ -218,16 +218,20 @@ OUString xdg_user_dir_lookup (const char *type)
 if (aUserDirBuf.getLength()>0 && !bError)
 {
 aDocumentsDirURL = aUserDirBuf.makeStringAndClear();
-osl::Directory aDocumentsDir( aDocumentsDirURL );
-if( osl::FileBase::E_None == aDocumentsDir.open() )
-return aDocumentsDirURL;
+if ( bAllowHomeDir ||
+ (aDocumentsDirURL != aHomeDirURL && aDocumentsDirURL != 
aHomeDirURL + "/") )
+{
+osl::Directory aDocumentsDir( aDocumentsDirURL );
+if( osl::FileBase::E_None == aDocumentsDir.open() )
+return aDocumentsDirURL;
+}
 }
 /* Use fallbacks historical compatibility if nothing else exists */
 return aHomeDirURL + "/" + OUString::createFromAscii(type);
 }
 
-css::uno::Any xdgDirectoryIfExists(char const * type) {
-auto url = xdg_user_dir_lookup(type);
+css::uno::Any xdgDirectoryIfExists(char const * type, bool bAllowHomeDir) {
+auto url = xdg_user_dir_lookup(type, bAllowHomeDir);
 return css::uno::Any(
 osl::Directory(url).open() == osl::FileBase::E_None
 ? css::beans::Optional(true, css::uno::Any(url))
@@ -238,12 +242,13 @@ css::uno::Any Default::getPropertyValue(OUString const & 
PropertyName)
 {
 if (PropertyName == "TemplatePathVariable")
 {
-return xdgDirectoryIfExists("Templates");
+// Never pick up the HOME directory as the default location of user's 
templates
+return xdgDirectoryIfExists("Templates", false);
 }
 
 if (PropertyName == "WorkPathVariable")
 {
-return xdgDirectoryIfExists("Documents");
+return xdgDirectoryIfExists("Documents", true);
 }
 
 if ( PropertyName == "EnableATToolSupport" ||
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

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

2019-04-03 Thread Mike Kaganski (via logerrit)
 shell/source/win32/shlxthandler/propsheets/propsheets.cxx   |   12 ++--
 shell/source/win32/shlxthandler/thumbviewer/thumbviewer.cxx |2 +-
 winaccessibility/source/UAccCOM/AccRelation.cxx |6 +++---
 3 files changed, 10 insertions(+), 10 deletions(-)

New commits:
commit 649854544e28f388774492f27eb1b75485202148
Author: Mike Kaganski 
AuthorDate: Wed Apr 3 12:01:52 2019 +0100
Commit: Mike Kaganski 
CommitDate: Wed Apr 3 16:58:26 2019 +0200

WinAPI: Fix some leftovers having UNICODE-define-dependency

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

diff --git a/shell/source/win32/shlxthandler/propsheets/propsheets.cxx 
b/shell/source/win32/shlxthandler/propsheets/propsheets.cxx
index bea4566fdba6..603495de817e 100644
--- a/shell/source/win32/shlxthandler/propsheets/propsheets.cxx
+++ b/shell/source/win32/shlxthandler/propsheets/propsheets.cxx
@@ -163,26 +163,26 @@ HRESULT STDMETHODCALLTYPE 
CPropertySheet::AddPages(LPFNSVADDPROPSHEETPAGE lpfnAd
 {
 std::wstring proppage_header;
 
-PROPSHEETPAGE psp;
-ZeroMemory(, sizeof(PROPSHEETPAGEA));
+PROPSHEETPAGEW psp;
+ZeroMemory(, sizeof(psp));
 
 // add the summary property page
-psp.dwSize  = sizeof(PROPSHEETPAGE);
+psp.dwSize  = sizeof(psp);
 psp.dwFlags = PSP_DEFAULT | PSP_USETITLE | PSP_USECALLBACK;
 psp.hInstance   = GetModuleHandleW(MODULE_NAME);
 psp.lParam  = reinterpret_cast(this);
-psp.pfnCallback = 
reinterpret_cast(CPropertySheet::PropPageSummaryCallback);
+psp.pfnCallback = 
reinterpret_cast(CPropertySheet::PropPageSummaryCallback);
 
 HPROPSHEETPAGE hPage = nullptr;
 
 // add the statistics property page
 proppage_header = GetResString(IDS_PROPPAGE_STATISTICS_TITLE);
 
-psp.pszTemplate = MAKEINTRESOURCE(IDD_PROPPAGE_STATISTICS);
+psp.pszTemplate = MAKEINTRESOURCEW(IDD_PROPPAGE_STATISTICS);
 psp.pszTitle= proppage_header.c_str();
 psp.pfnDlgProc  = 
reinterpret_cast(CPropertySheet::PropPageStatisticsProc);
 
-hPage = CreatePropertySheetPage();
+hPage = CreatePropertySheetPageW();
 
 if (hPage)
 {
diff --git a/shell/source/win32/shlxthandler/thumbviewer/thumbviewer.cxx 
b/shell/source/win32/shlxthandler/thumbviewer/thumbviewer.cxx
index df3a63d7fd66..4ea6f7e06577 100644
--- a/shell/source/win32/shlxthandler/thumbviewer/thumbviewer.cxx
+++ b/shell/source/win32/shlxthandler/thumbviewer/thumbviewer.cxx
@@ -47,7 +47,7 @@ namespace internal
id is 2000 */
 static void LoadSignetImageFromResource(ZipFile::ZipContentBuffer_t& 
buffer)
 {
-HRSRC hrc = FindResourceW(g_hModule, L"#2000", RT_RCDATA);
+HRSRC hrc = FindResourceW(g_hModule, L"#2000", 
MAKEINTRESOURCEW(RT_RCDATA));
 DWORD size = SizeofResource(g_hModule, hrc);
 HGLOBAL hglob = LoadResource(g_hModule, hrc);
 char* data = static_cast(LockResource(hglob));
diff --git a/winaccessibility/source/UAccCOM/AccRelation.cxx 
b/winaccessibility/source/UAccCOM/AccRelation.cxx
index 6da0cf0acebf..052bd8785204 100644
--- a/winaccessibility/source/UAccCOM/AccRelation.cxx
+++ b/winaccessibility/source/UAccCOM/AccRelation.cxx
@@ -195,9 +195,9 @@ STDMETHODIMP CAccRelation::put_XSubInterface(hyper 
pXSubInterface)
 */
 BSTR CAccRelation::getRelationTypeBSTR(int type)
 {
-static LPCTSTR map[] =
+static LPCWSTR map[] =
 {
-_T("INVALID"),   // AccessibleRelationType::INVALID
+L"INVALID",  // AccessibleRelationType::INVALID
 IA2_RELATION_FLOWS_FROM, // 
AccessibleRelationType::CONTENT_FLOWS_FROM
 IA2_RELATION_FLOWS_TO,   // 
AccessibleRelationType::CONTENT_FLOWS_TO
 IA2_RELATION_CONTROLLED_BY,  // 
AccessibleRelationType::CONTROLLED_BY
@@ -211,7 +211,7 @@ BSTR CAccRelation::getRelationTypeBSTR(int type)
 };
 
 return ::SysAllocString( (type >= AccessibleRelationType::INVALID && type 
<= AccessibleRelationType::DESCRIBED_BY)
- ? map[type] : _T(""));
+ ? map[type] : L"");
 }
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

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

2019-04-03 Thread Stephan Bergmann (via logerrit)
 shell/source/unix/exec/shellexec.cxx |   37 +++
 shell/source/win32/SysShExec.cxx |  114 +++
 2 files changed, 151 insertions(+)

New commits:
commit d59ec4cd1660410fa1b18c50d2d83b1417a82ddc
Author: Stephan Bergmann 
AuthorDate: Fri Mar 29 14:01:19 2019 +0100
Commit: Stephan Bergmann 
CommitDate: Wed Apr 3 12:08:14 2019 +0200

Filter out problematic file URLs

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

diff --git a/shell/source/unix/exec/shellexec.cxx 
b/shell/source/unix/exec/shellexec.cxx
index 7deeb5caa8a7..7355eaea0db6 100644
--- a/shell/source/unix/exec/shellexec.cxx
+++ b/shell/source/unix/exec/shellexec.cxx
@@ -43,6 +43,10 @@
 #include 
 #include 
 
+#if defined MACOSX
+#include 
+#endif
+
 using com::sun::star::system::XSystemShellExecute;
 using com::sun::star::system::SystemShellExecuteException;
 
@@ -113,6 +117,39 @@ void SAL_CALL ShellExec::execute( const OUString& 
aCommand, const OUString& aPar
 }
 
 #ifdef MACOSX
+if (uri->getScheme().equalsIgnoreAsciiCase("file")) {
+OUString pathname;
+auto const e1 = osl::FileBase::getSystemPathFromFileURL(aCommand, 
pathname);
+if (e1 != osl::FileBase::E_None) {
+throw css::lang::IllegalArgumentException(
+("XSystemShellExecute.execute, getSystemPathFromFileURL <" 
+ aCommand
+ + "> failed with " + OUString::number(e1)),
+{}, 0);
+}
+OString pathname8;
+if (!pathname.convertToString(
+, RTL_TEXTENCODING_UTF8,
+(RTL_UNICODETOTEXT_FLAGS_UNDEFINED_ERROR
+ | RTL_UNICODETOTEXT_FLAGS_INVALID_ERROR)))
+{
+throw css::lang::IllegalArgumentException(
+"XSystemShellExecute.execute, cannot convert \"" + 
pathname + "\" to UTF-8", {},
+0);
+}
+struct stat st;
+auto const e2 = stat(pathname8.getStr(), );
+if (e2 != 0) {
+auto const e3 = errno;
+SAL_INFO("shell", "stat(" << pathname8 << ") failed with errno 
" << e3);
+}
+if (e2 != 0 || !S_ISREG(st.st_mode)
+|| (st.st_mode & (S_IXUSR | S_IXGRP | S_IXOTH)) != 0)
+{
+throw css::lang::IllegalArgumentException(
+"XSystemShellExecute.execute, cannot process <" + aCommand 
+ ">", {}, 0);
+}
+}
+
 //TODO: Using open(1) with an argument that syntactically is an 
absolute
 // URI reference does not necessarily give expected results:
 // 1  If the given URI reference matches a supported scheme (e.g.,
diff --git a/shell/source/win32/SysShExec.cxx b/shell/source/win32/SysShExec.cxx
index 11ca42005b10..4786e4ddedc7 100644
--- a/shell/source/win32/SysShExec.cxx
+++ b/shell/source/win32/SysShExec.cxx
@@ -18,8 +18,10 @@
  */
 
 #include 
+#include 
 
 #include 
+#include 
 #include 
 #include "SysShExec.hxx"
 #include 
@@ -30,12 +32,16 @@
 #include 
 #include 
 #include 
+#include 
 
 #define WIN32_LEAN_AND_MEAN
 #include 
 #include 
+#include 
 #include 
 
+#include 
+
 using com::sun::star::uno::Reference;
 using com::sun::star::uno::RuntimeException;
 using com::sun::star::uno::Sequence;
@@ -242,6 +248,18 @@ CSysShExec::CSysShExec( const Reference< 
css::uno::XComponentContext >& xContext
 
 namespace
 {
+bool checkExtension(OUString const & extension, OUString const & blacklist) {
+assert(!extension.isEmpty());
+for (sal_Int32 i = 0; i != -1;) {
+OUString tok = blacklist.getToken(0, ';', i);
+tok.startsWith(".", );
+if (extension.equalsIgnoreAsciiCase(tok)) {
+return false;
+}
+}
+return true;
+}
+
 // This callback checks if the found window is the specified process's 
top-level window,
 // and activates the first found such window.
 BOOL CALLBACK FindAndActivateProcWnd(HWND hwnd, LPARAM lParam)
@@ -295,6 +313,102 @@ void SAL_CALL CSysShExec::execute( const OUString& 
aCommand, const OUString& aPa
  + aCommand,
 static_cast< cppu::OWeakObject * >(this), 0);
 }
+if (uri->getScheme().equalsIgnoreAsciiCase("file")) {
+OUString pathname;
+auto const e1 = osl::FileBase::getSystemPathFromFileURL(aCommand, 
pathname);
+if (e1 != osl::FileBase::E_None) {
+throw css::lang::IllegalArgumentException(
+("XSystemShellExecute.execute, getSystemPathFromFileURL <" 
+ aCommand
+ + "> failed with " + OUString::number(e1)),
+{}, 0);
+}
+for (int i = 0;; ++i) {
+SHFILEINFOW info;
+if 

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

2019-02-13 Thread Libreoffice Gerrit user
 shell/source/backends/desktopbe/desktopbackend.cxx |   10 +-
 1 file changed, 5 insertions(+), 5 deletions(-)

New commits:
commit 91731a8674d764293e2988333027f82f15b2577e
Author: Takeshi Abe 
AuthorDate: Tue Feb 12 23:38:29 2019 +0900
Commit: Caolán McNamara 
CommitDate: Wed Feb 13 10:02:02 2019 +0100

tdf#119890 Lookup XDG_(DOCUMENTS|TEMPLATES)_DIR correctly

... for My Documents and My Templates.

It seems customary to name XDG_*_DIR in all uppercase.  This also
fixes buffer overrun IIUC, as osl_readLine() does not return the
newline delimiter.

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

diff --git a/shell/source/backends/desktopbe/desktopbackend.cxx 
b/shell/source/backends/desktopbe/desktopbackend.cxx
index 0860bcd421a1..4f3c2940869b 100644
--- a/shell/source/backends/desktopbe/desktopbackend.cxx
+++ b/shell/source/backends/desktopbe/desktopbackend.cxx
@@ -129,6 +129,7 @@ void Default::setPropertyValue(OUString const &, 
css::uno::Any const &)
 
 OUString xdg_user_dir_lookup (const char *type)
 {
+size_t nLenType = strlen(type);
 char *config_home;
 char *p;
 bool bError = false;
@@ -161,11 +162,10 @@ OUString xdg_user_dir_lookup (const char *type)
 rtl::ByteSequence seq;
 while (osl_File_E_None == osl_readLine(handle , 
reinterpret_cast()))
 {
-/* Remove newline at end */
 int relative = 0;
 int len = seq.getLength();
-if(len>0 && seq[len-1] == '\n')
-seq[len-1] = 0;
+seq.realloc(len + 1);
+seq[len] = 0;
 
 p = reinterpret_cast(seq.getArray());
 while (*p == ' ' || *p == '\t')
@@ -173,9 +173,9 @@ OUString xdg_user_dir_lookup (const char *type)
 if (strncmp (p, "XDG_", 4) != 0)
 continue;
 p += 4;
-if (strncmp (p, type, strlen (type)) != 0)
+if (strncmp (p, OString(type, 
nLenType).toAsciiUpperCase().getStr(), nLenType) != 0)
 continue;
-p += strlen (type);
+p += nLenType;
 if (strncmp (p, "_DIR", 4) != 0)
 continue;
 p += 4;
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

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

2019-02-06 Thread Libreoffice Gerrit user
 shell/source/all/xml_parser.cxx   |   22 +++---
 shell/source/unix/sysshell/recently_used_file_handler.cxx |   22 +++---
 2 files changed, 22 insertions(+), 22 deletions(-)

New commits:
commit 202d9af5ab4291a8f867791293477a18ae48051d
Author: Noel Grandin 
AuthorDate: Wed Feb 6 09:26:46 2019 +0200
Commit: Noel Grandin 
CommitDate: Wed Feb 6 09:59:59 2019 +0100

loplugin:flatten in shell

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

diff --git a/shell/source/all/xml_parser.cxx b/shell/source/all/xml_parser.cxx
index fd24e3c16919..b067c6231b81 100644
--- a/shell/source/all/xml_parser.cxx
+++ b/shell/source/all/xml_parser.cxx
@@ -94,21 +94,21 @@ static void xml_start_element_handler(void* UserData, const 
XML_Char* name, cons
 xml_parser* pImpl  = get_parser_instance(UserData);
 
 i_xml_parser_event_handler* pDocHdl = pImpl->get_document_handler();
-if (pDocHdl)
-{
-xml_tag_attribute_container_t attributes;
+if (!pDocHdl)
+return;
 
-int i = 0;
+xml_tag_attribute_container_t attributes;
 
-while(atts[i])
-{
-attributes[UTF8ToWString(reinterpret_cast(get_local_name(atts[i])))] = UTF8ToWString(reinterpret_cast(atts[i+1]));
-i += 2; // skip to next pair
-}
+int i = 0;
 
-pDocHdl->start_element(
-UTF8ToWString(reinterpret_cast(name)), 
UTF8ToWString(reinterpret_cast(get_local_name(name))), attributes);
+while(atts[i])
+{
+attributes[UTF8ToWString(reinterpret_cast(get_local_name(atts[i])))] = UTF8ToWString(reinterpret_cast(atts[i+1]));
+i += 2; // skip to next pair
 }
+
+pDocHdl->start_element(
+UTF8ToWString(reinterpret_cast(name)), 
UTF8ToWString(reinterpret_cast(get_local_name(name))), attributes);
 }
 
 static void xml_end_element_handler(void* UserData, const XML_Char* name)
diff --git a/shell/source/unix/sysshell/recently_used_file_handler.cxx 
b/shell/source/unix/sysshell/recently_used_file_handler.cxx
index d85861346f21..b2c2a419adf3 100644
--- a/shell/source/unix/sysshell/recently_used_file_handler.cxx
+++ b/shell/source/unix/sysshell/recently_used_file_handler.cxx
@@ -313,20 +313,20 @@ namespace /* private */ {
 recently_used_file& file,
 recently_used_item_list_t& item_list)
 {
-if (!item_list.empty())
-{
-file.truncate();
-file.reset();
+if (item_list.empty())
+return;
 
-file.write(XML_HEADER, strlen(XML_HEADER));
+file.truncate();
+file.reset();
 
-std::for_each(
-item_list.begin(),
-item_list.end(),
-recent_item_writer(file));
+file.write(XML_HEADER, strlen(XML_HEADER));
 
-file.write(XML_FOOTER, strlen(XML_FOOTER));
-}
+std::for_each(
+item_list.begin(),
+item_list.end(),
+recent_item_writer(file));
+
+file.write(XML_FOOTER, strlen(XML_FOOTER));
 }
 
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2018-10-28 Thread Libreoffice Gerrit user
 shell/source/win32/SysShExec.cxx |   49 +++
 1 file changed, 35 insertions(+), 14 deletions(-)

New commits:
commit de26ed225eb03ab36efed592774e460b21e695fa
Author: Mike Kaganski 
AuthorDate: Sun Oct 28 19:14:28 2018 +0300
Commit: Mike Kaganski 
CommitDate: Sun Oct 28 20:27:52 2018 +0100

tdf#120703 PVS: V547 Fix activation of launched process' window

V547 Expression 'procHandle != nullptr' is always false.

The code was nonsensical overall. First, the launched process handle
was never returned by ShellExecuteExW, because SEE_MASK_NOCLOSEPROCESS
wasn't used, so GetProcessId couldn't succeed. Then, nullptr window
handle was passed to GetWindowThreadProcessId, thus never returning a
meaningful result.

This reimplements this to find the launched process' main window by
first waiting for process idle (up to 1-second delay is possible),
then enumerating all the top-level windows and checking their process.

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

diff --git a/shell/source/win32/SysShExec.cxx b/shell/source/win32/SysShExec.cxx
index e9e5909991c5..11ca42005b10 100644
--- a/shell/source/win32/SysShExec.cxx
+++ b/shell/source/win32/SysShExec.cxx
@@ -240,6 +240,34 @@ CSysShExec::CSysShExec( const Reference< 
css::uno::XComponentContext >& xContext
 CoInitialize( nullptr );
 }
 
+namespace
+{
+// This callback checks if the found window is the specified process's 
top-level window,
+// and activates the first found such window.
+BOOL CALLBACK FindAndActivateProcWnd(HWND hwnd, LPARAM lParam)
+{
+if (!IsWindowVisible(hwnd))
+return TRUE; // continue enumeration
+if (GetWindow(hwnd, GW_OWNER)) // not a top-level window
+return TRUE; // continue enumeration
+const DWORD nParamProcId = static_cast(lParam);
+assert(nParamProcId != 0);
+DWORD nWndProcId = 0;
+(void)GetWindowThreadProcessId(hwnd, );
+if (nWndProcId != nParamProcId)
+return TRUE; // continue enumeration
+
+// Found it! Bring it to front
+if (IsIconic(hwnd))
+{
+ShowWindow(hwnd, SW_RESTORE);
+}
+SetForegroundWindow(hwnd);
+SetActiveWindow(hwnd);
+return FALSE; // stop enumeration
+}
+}
+
 void SAL_CALL CSysShExec::execute( const OUString& aCommand, const OUString& 
aParameter, sal_Int32 nFlags )
 {
 // parameter checking
@@ -296,9 +324,10 @@ void SAL_CALL CSysShExec::execute( const OUString& 
aCommand, const OUString& aPa
 sei.lpFile   = o3tl::toW(preprocessed_command.getStr());
 sei.lpParameters = o3tl::toW(aParameter.getStr());
 sei.nShow= SW_SHOWNORMAL;
+sei.fMask = SEE_MASK_NOCLOSEPROCESS; // we need sei.hProcess
 
 if (NO_SYSTEM_ERROR_MESSAGE & nFlags)
-sei.fMask = SEE_MASK_FLAG_NO_UI;
+sei.fMask |= SEE_MASK_FLAG_NO_UI;
 
 SetLastError( 0 );
 
@@ -322,20 +351,12 @@ void SAL_CALL CSysShExec::execute( const OUString& 
aCommand, const OUString& aPa
 else
 {
 // Get Permission make changes to the Window of the created Process
-HWND procHandle = nullptr;
-DWORD procId = GetProcessId(sei.hProcess);
-AllowSetForegroundWindow(procId);
-
-// Get the handle of the created Window
-DWORD check = 0;
-GetWindowThreadProcessId(procHandle, );
-SAL_WARN_IF(check != procId, "shell", "Could not get handle of process 
called by shell.");
-
-// Move created Window into the foreground
-if(procHandle != nullptr)
+const DWORD procId = GetProcessId(sei.hProcess);
+if (procId != 0)
 {
-SetForegroundWindow(procHandle);
-SetActiveWindow(procHandle);
+AllowSetForegroundWindow(procId);
+WaitForInputIdle(sei.hProcess, 1000); // so that main window is 
created; imperfect
+EnumWindows(FindAndActivateProcWnd, static_cast(procId));
 }
 }
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2018-09-25 Thread Libreoffice Gerrit user
 shell/source/win32/spsupp/COMOpenDocuments.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 191dda3eca5518aa866ddada48bc8465c8aba1ba
Author: Andrea Gelmini 
AuthorDate: Tue Sep 25 12:43:30 2018 +0200
Commit: Julien Nabet 
CommitDate: Tue Sep 25 14:15:13 2018 +0200

Fix typo

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

diff --git a/shell/source/win32/spsupp/COMOpenDocuments.cxx 
b/shell/source/win32/spsupp/COMOpenDocuments.cxx
index c4818263b832..68940e016147 100644
--- a/shell/source/win32/spsupp/COMOpenDocuments.cxx
+++ b/shell/source/win32/spsupp/COMOpenDocuments.cxx
@@ -313,7 +313,7 @@ STDMETHODIMP COMOpenDocuments::CreateNewDocument2(
 return hr;
 }
 
-// Used with the OpenDocuments.CreateNewDocument2 Method method to determine
+// Used with the OpenDocuments.CreateNewDocument2 method to determine
 // whether the security dialog box that appears when a document is opened has 
already appeared
 //
 // If the PromptedOnLastOpen method returns true, the window containing the 
document library view
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2018-09-14 Thread Libreoffice Gerrit user
 shell/source/backends/kde5be/kde5backend.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 2fdafe62ef3959ec34e05daf312088a8f0534d9a
Author: Michael Weghorn 
AuthorDate: Fri Sep 14 09:11:09 2018 +0200
Commit: Michael Weghorn 
CommitDate: Fri Sep 14 12:33:07 2018 +0200

kde5backend.cxx: Fix inverted logic leading to invalid write

Only write to 'pFakeArgv[2]' when 'aDisplay' is NON-empty.

Otherwise, the 'pFakeArgv' array only has size 2 and the write
is invalid.

(Found by valgrind while looking at another issue.)

Change-Id: I58aff6d25c8647bc6ef346af8ac09b0b0fc030b8
Reviewed-on: https://gerrit.libreoffice.org/60476
Reviewed-by: Julien Nabet 
Tested-by: Jenkins
Reviewed-by: Michael Weghorn 

diff --git a/shell/source/backends/kde5be/kde5backend.cxx 
b/shell/source/backends/kde5be/kde5backend.cxx
index 0c0472b0233a..e2f6e25c0764 100644
--- a/shell/source/backends/kde5be/kde5backend.cxx
+++ b/shell/source/backends/kde5be/kde5backend.cxx
@@ -159,7 +159,7 @@ void initQApp()
 
 pFakeArgv[0] = strdup(getExecutable().getStr());
 pFakeArgv[1] = strdup("--nocrashhandler");
-if (aDisplay.isEmpty())
+if (!aDisplay.isEmpty())
 pFakeArgv[2] = strdup(aDisplay.getStr());
 
 char* session_manager = nullptr;
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2018-05-21 Thread Arkadiy Illarionov
 shell/source/tools/lngconvex/cmdline.hxx |4 +--
 shell/source/tools/lngconvex/defs.hxx|   32 ---
 solenv/clang-format/blacklist|1 
 3 files changed, 2 insertions(+), 35 deletions(-)

New commits:
commit 5dab28cdada9a24ad2ddae1083ac977fe87cb1c1
Author: Arkadiy Illarionov 
Date:   Sun May 20 16:57:25 2018 +0300

tdf#96099 Remove unused typedef from shell/source/tools/lngconvex

Also remove empty defs.hxx

Change-Id: I35f70cc13f0198623d99cfd1e294808ac90f5f02
Reviewed-on: https://gerrit.libreoffice.org/54600
Tested-by: Jenkins 
Reviewed-by: Tor Lillqvist 

diff --git a/shell/source/tools/lngconvex/cmdline.hxx 
b/shell/source/tools/lngconvex/cmdline.hxx
index 9cbc34e5e343..04cb7101aee0 100644
--- a/shell/source/tools/lngconvex/cmdline.hxx
+++ b/shell/source/tools/lngconvex/cmdline.hxx
@@ -20,12 +20,12 @@
 #ifndef INCLUDED_SHELL_SOURCE_TOOLS_LNGCONVEX_CMDLINE_HXX
 #define INCLUDED_SHELL_SOURCE_TOOLS_LNGCONVEX_CMDLINE_HXX
 
+#include 
+
 #include 
 
 #include 
 
-#include "defs.hxx"
-
 
 /** Simple command line abstraction
 */
diff --git a/shell/source/tools/lngconvex/defs.hxx 
b/shell/source/tools/lngconvex/defs.hxx
deleted file mode 100644
index 86745877e66e..
--- a/shell/source/tools/lngconvex/defs.hxx
+++ /dev/null
@@ -1,32 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*
- * This file is part of the LibreOffice project.
- *
- * This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/.
- *
- * This file incorporates work covered by the following license notice:
- *
- *   Licensed to the Apache Software Foundation (ASF) under one or more
- *   contributor license agreements. See the NOTICE file distributed
- *   with this work for additional information regarding copyright
- *   ownership. The ASF licenses this file to you under the Apache
- *   License, Version 2.0 (the "License"); you may not use this file
- *   except in compliance with the License. You may obtain a copy of
- *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
- */
-
-#ifndef INCLUDED_SHELL_SOURCE_TOOLS_LNGCONVEX_DEFS_HXX
-#define INCLUDED_SHELL_SOURCE_TOOLS_LNGCONVEX_DEFS_HXX
-
-#include 
-#include 
-#include 
-
-typedef std::vector StringList_t;
-
-
-#endif
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/solenv/clang-format/blacklist b/solenv/clang-format/blacklist
index cc3dfe0e8843..90ec26ee74a6 100644
--- a/solenv/clang-format/blacklist
+++ b/solenv/clang-format/blacklist
@@ -13173,7 +13173,6 @@ shell/source/sessioninstall/SyncDbusSessionHelper.hxx
 shell/source/sessioninstall/services.cxx
 shell/source/tools/lngconvex/cmdline.cxx
 shell/source/tools/lngconvex/cmdline.hxx
-shell/source/tools/lngconvex/defs.hxx
 shell/source/tools/lngconvex/lngconvex.cxx
 shell/source/tools/regsvrex/regsvrex.cxx
 shell/source/unix/exec/shellexec.cxx
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2018-04-20 Thread Stephan Bergmann
 shell/source/win32/ooofilereader/contentreader.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit bb589f8e5b267a663c5034343f96808a4814f7b3
Author: Stephan Bergmann 
Date:   Fri Apr 20 08:51:12 2018 +0200

loplugin:redundantfcast (clang-cl)

Change-Id: I2ce9f8bcf4631ea93407eeaa49ca27eed3eb8e23

diff --git a/shell/source/win32/ooofilereader/contentreader.cxx 
b/shell/source/win32/ooofilereader/contentreader.cxx
index af6bb81df648..2093c837fcba 100644
--- a/shell/source/win32/ooofilereader/contentreader.cxx
+++ b/shell/source/win32/ooofilereader/contentreader.cxx
@@ -208,7 +208,7 @@ void CContentReader::characters( const std::wstring& 
character )
 {
 if ( character.length() > 0 && !HasOnlySpaces( character ) )
 {
-addChunk( getLocale( getCurrentContentStyle() ), ::std::wstring( 
character ) );
+addChunk( getLocale( getCurrentContentStyle() ), character );
 
 ITag* pTagBuilder = m_TagBuilderStack.top();
 pTagBuilder->addCharacters( character );
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2018-04-12 Thread Noel Grandin
 shell/source/sessioninstall/SyncDbusSessionHelper.cxx |3 +++
 1 file changed, 3 insertions(+)

New commits:
commit 24a57e2b854a1b8b3b8533ac72a6614ee29e374a
Author: Noel Grandin 
Date:   Thu Apr 12 09:11:03 2018 +0200

Keep strings alive again as necessary

regression from
commit 49eb02f07a5af44da59008a238e828b4a9532bef
new loplugin:unusedvariablemore

Change-Id: If92be219368a0dc33f40cd425efc6028c28c5e53

diff --git a/shell/source/sessioninstall/SyncDbusSessionHelper.cxx 
b/shell/source/sessioninstall/SyncDbusSessionHelper.cxx
index cf95c1c568f9..09673698de9e 100644
--- a/shell/source/sessioninstall/SyncDbusSessionHelper.cxx
+++ b/shell/source/sessioninstall/SyncDbusSessionHelper.cxx
@@ -67,10 +67,13 @@ void request(
 css::uno::Sequence const & resources,
 OUString const & interaction)
 {
+// Keep strings alive until after call to g_dbus_proxy_call_sync
+std::vector resUtf8;
 std::shared_ptr builder(
 g_variant_builder_new(G_VARIANT_TYPE ("as")), 
GVariantBuilderDeleter());
 for (auto & i: resources) {
 auto s(OUStringToOString(i, RTL_TEXTENCODING_UTF8));
+resUtf8.push_back(s);
 g_variant_builder_add(builder.get(), "s", s.getStr());
 }
 auto iactUtf8(OUStringToOString(interaction, RTL_TEXTENCODING_UTF8));
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2018-03-21 Thread Andrea Gelmini
 shell/source/backends/wininetbe/wininetbackend.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit c262048da915614cf0349d6e4293ad82cc0667d9
Author: Andrea Gelmini 
Date:   Wed Mar 21 08:35:35 2018 +0100

Fix typo

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

diff --git a/shell/source/backends/wininetbe/wininetbackend.cxx 
b/shell/source/backends/wininetbe/wininetbackend.cxx
index b6bcae4a8fc5..5334877d3451 100644
--- a/shell/source/backends/wininetbe/wininetbackend.cxx
+++ b/shell/source/backends/wininetbe/wininetbackend.cxx
@@ -160,7 +160,7 @@ WinInetBackend::WinInetBackend()
 // proxy is enabled or not
 
 // We use InternetQueryOptionW (see 
https://msdn.microsoft.com/en-us/library/aa385101);
-// it fills INTERNET_PROXY_INFO struct which is definned in 
WinInet.h to have LPCTSTR
+// it fills INTERNET_PROXY_INFO struct which is defined in 
WinInet.h to have LPCTSTR
 // (i.e., the UNICODE-dependent generic string type expanding to 
const wchar_t* when
 // UNICODE is defined, and InternetQueryOption macro expands to 
InternetQueryOptionW).
 // Thus, it's natural to expect that W version would return wide 
strings. But it's not
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2018-03-20 Thread Mike Kaganski
 shell/source/backends/wininetbe/wininetbackend.cxx |   12 
 1 file changed, 8 insertions(+), 4 deletions(-)

New commits:
commit 3837901ef422d432f709dd95352796a54b58aae6
Author: Mike Kaganski 
Date:   Tue Mar 20 11:43:59 2018 +0100

tdf#116516: INTERNET_PROXY_INFO always contains char* data

Regression from e80aef4e032f08ef0c4cfbb028bf83b81002f112

The InternetQueryOption has two variants: ANSI (A) and Unicode (W)
(see https://msdn.microsoft.com/en-us/library/aa385101).
INTERNET_PROXY_INFO struct we are using is defined to contain two
LPCTSTR members (see https://msdn.microsoft.com/en-us/library/aa385148).
When UNICODE is defined, InternetQueryOption expands to W variant,
and at the same time, all MS-specific generic string types (like
TCHAR or LPCTSTR) are expanded to wchar_t-based types.

So, the expectation is that InternetQueryOptionW fills the struct
with pointers to widechar strings.

But actually this is not true: InternetQueryOptionW still returns
char-based strings in the struct; so just revert partially commit
above.

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

diff --git a/shell/source/backends/wininetbe/wininetbackend.cxx 
b/shell/source/backends/wininetbe/wininetbackend.cxx
index bd9583717724..b6bcae4a8fc5 100644
--- a/shell/source/backends/wininetbe/wininetbackend.cxx
+++ b/shell/source/backends/wininetbe/wininetbackend.cxx
@@ -159,10 +159,14 @@ WinInetBackend::WinInetBackend()
 // an empty proxy list, so we don't have to check if
 // proxy is enabled or not
 
-// We use a W-version of InternetQueryOption; it returns struct 
with pointers to wide strings
-// There's no INTERNET_PROXY_INFOW, so we simply cast returned 
struct's members
-OUString aProxyList   = reinterpret_cast( 
lpi->lpszProxy );
-OUString aProxyBypassList = reinterpret_cast( 
lpi->lpszProxyBypass );
+// We use InternetQueryOptionW (see 
https://msdn.microsoft.com/en-us/library/aa385101);
+// it fills INTERNET_PROXY_INFO struct which is definned in 
WinInet.h to have LPCTSTR
+// (i.e., the UNICODE-dependent generic string type expanding to 
const wchar_t* when
+// UNICODE is defined, and InternetQueryOption macro expands to 
InternetQueryOptionW).
+// Thus, it's natural to expect that W version would return wide 
strings. But it's not
+// true. The W version still returns const char* in 
INTERNET_PROXY_INFO.
+OUString aProxyList   = OUString::createFromAscii( 
lpi->lpszProxy );
+OUString aProxyBypassList = OUString::createFromAscii( 
lpi->lpszProxyBypass );
 
 // override default for ProxyType, which is "0" meaning "No 
proxies".
 valueProxyType_.IsPresent = true;
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2018-03-20 Thread Mike Kaganski
 shell/source/backends/wininetbe/wininetbackend.cxx |4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

New commits:
commit 021340e7568e75344784a9a573c0602cd3679443
Author: Mike Kaganski 
Date:   Tue Mar 20 08:31:50 2018 +0100

Fix comment

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

diff --git a/shell/source/backends/wininetbe/wininetbackend.cxx 
b/shell/source/backends/wininetbe/wininetbackend.cxx
index 1cfdd63cf114..bd9583717724 100644
--- a/shell/source/backends/wininetbe/wininetbackend.cxx
+++ b/shell/source/backends/wininetbe/wininetbackend.cxx
@@ -125,8 +125,8 @@ WinInetBackend::WinInetBackend()
 DWORD err = GetLastError();
 if (err == ERROR_INSUFFICIENT_BUFFER)
 {
-// allocate sufficient space on the heap
-// insufficient space on the heap results
+// allocate sufficient space on the stack
+// insufficient space on the stack results
 // in a stack overflow exception, we assume
 // this never happens, because of the relatively
 // small amount of memory we need
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2018-03-06 Thread Mike Kaganski
 shell/source/win32/simplemail/smplmailclient.cxx |4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

New commits:
commit 01c71fba5f525b035f8a723215669d499bc27a3f
Author: Mike Kaganski 
Date:   Wed Mar 7 06:45:51 2018 +0100

Don't return local variable address

Oversight in 2f061dad7f875f704e3744fc5780c1d145b22e9f

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

diff --git a/shell/source/win32/simplemail/smplmailclient.cxx 
b/shell/source/win32/simplemail/smplmailclient.cxx
index 3a659548bbd1..87e324b4eeb5 100644
--- a/shell/source/win32/simplemail/smplmailclient.cxx
+++ b/shell/source/win32/simplemail/smplmailclient.cxx
@@ -170,7 +170,7 @@ namespace {
 // senddoc process lifetime. So we use base temppath for the attachments,
 // and let the senddoc to do the cleanup if it was started successfully.
 // This function works like Desktop::CreateTemporaryDirectory()
-OUString&& InitBaseTempDirURL()
+OUString InitBaseTempDirURL()
 {
 // No need to intercept an exception here, since
 // Desktop::CreateTemporaryDirectory() has ensured that path manager is 
available
@@ -183,7 +183,7 @@ OUString&& InitBaseTempDirURL()
 if (aRetURL.endsWith("/"))
 aRetURL = aRetURL.copy(0, aRetURL.getLength() - 1);
 
-return std::move(aRetURL);
+return aRetURL;
 }
 
 const OUString& GetBaseTempDirURL()
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2018-02-27 Thread Mike Kaganski
 shell/source/win32/simplemail/senddoc.cxx |6 --
 1 file changed, 6 deletions(-)

New commits:
commit 0ea41fea75cd1ac1d81fa57c4411e75a6b4001f0
Author: Mike Kaganski 
Date:   Tue Feb 27 12:47:31 2018 +0100

Remove obsolete comment

Obsoleted by commit 7ce1e0e1ecbb1b3ec5e3cc15306a9df7e786c564

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

diff --git a/shell/source/win32/simplemail/senddoc.cxx 
b/shell/source/win32/simplemail/senddoc.cxx
index 0e1d0859bcc2..d972bad5f71e 100644
--- a/shell/source/win32/simplemail/senddoc.cxx
+++ b/shell/source/win32/simplemail/senddoc.cxx
@@ -242,12 +242,6 @@ int wmain(int argc, wchar_t* argv[])
 
 try
 {
-// we have to set the flag MAPI_NEW_SESSION,
-// because in the case Outlook xxx (not Outlook Express!)
-// is installed as Exchange and Mail Client a Profile
-// selection dialog must appear because we specify no
-// profile name, so the user has to specify a profile
-
 LHANDLE const hSession = 0;
 
 MapiRecipDescW mapiOriginator;
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2018-02-27 Thread Mike Kaganski
 shell/source/win32/simplemail/senddoc.cxx |6 +-
 1 file changed, 5 insertions(+), 1 deletion(-)

New commits:
commit 5874c76371562c3e2d8564b1fb04df1997091d27
Author: Mike Kaganski 
Date:   Wed Feb 28 03:00:19 2018 +0300

tdf#116074: Use modeless dialogs with supporting mailers

When sending mail using MS Outlook, our UI gets locked until user
closes the Outlook's compose message window.

This patch uses Outlook 2013+ option to show modeless window.

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

diff --git a/shell/source/win32/simplemail/senddoc.cxx 
b/shell/source/win32/simplemail/senddoc.cxx
index f3fe6112b4eb..0e1d0859bcc2 100644
--- a/shell/source/win32/simplemail/senddoc.cxx
+++ b/shell/source/win32/simplemail/senddoc.cxx
@@ -119,6 +119,9 @@ void initAttachmentList(MapiAttachmentList_t* 
pMapiAttachmentList)
 MapiFileDescW mfd;
 ZeroMemory(, sizeof(mfd));
 mfd.lpszPathName = const_cast(attachment.c_str());
+// This is required for Outlook 2013 - otherwise using 
MAPI_DIALOG_MODELESS results in MAPI_E_FAILURE
+// See 
http://peach.ease.lsoft.com/scripts/wa-PEACH.exe?A2=MAPI-L;d2bf3060.1604
+mfd.lpszFileName = L"";
 mfd.nPosition = sal::static_int_cast(-1);
 pMapiAttachmentList->push_back(mfd);
 }
@@ -190,7 +193,8 @@ void initParameter(int argc, wchar_t* argv[])
 
 if (_wcsicmp(argv[i], L"--mapi-dialog") == 0)
 {
-gMapiFlags |= MAPI_DIALOG;
+// Outlook 2013+; for earlier versions this equals to MAPI_DIALOG
+gMapiFlags |= MAPI_DIALOG_MODELESS;
 }
 else if (_wcsicmp(argv[i], L"--mapi-logon-ui") == 0)
 {
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2018-01-23 Thread Stephan Bergmann
 shell/source/backends/kde5be/kde5access.cxx  |6 +++---
 shell/source/backends/kde5be/kde5backend.cxx |   15 +++
 2 files changed, 10 insertions(+), 11 deletions(-)

New commits:
commit 8b6c90098f69870231a315df192b44e6507adcfc
Author: Stephan Bergmann 
Date:   Tue Jan 23 17:29:35 2018 +0100

Various loplugin in --enable-gtk3-kde5 code

Change-Id: I5d5bb6b57a9e9ed2c66d304c18fe7ef233aae072

diff --git a/shell/source/backends/kde5be/kde5access.cxx 
b/shell/source/backends/kde5be/kde5access.cxx
index 5c4c0a0173f1..0f2218551d5f 100644
--- a/shell/source/backends/kde5be/kde5access.cxx
+++ b/shell/source/backends/kde5be/kde5access.cxx
@@ -17,7 +17,7 @@
  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
  */
 
-#include "sal/config.h"
+#include 
 
 #include "kde5access.hxx"
 
@@ -290,7 +290,7 @@ css::beans::Optional getValue(OUString 
const& id)
 }
 else if (id == "ooInetProxyType")
 {
-int nProxyType;
+sal_Int32 nProxyType;
 switch (KProtocolManager::proxyType())
 {
 case KProtocolManager::ManualProxy: // Proxies are manually 
configured
@@ -303,7 +303,7 @@ css::beans::Optional getValue(OUString 
const& id)
 default: // No proxy is used
 nProxyType = 0;
 }
-return css::beans::Optional(true, 
uno::makeAny((sal_Int32)nProxyType));
+return css::beans::Optional(true, 
uno::makeAny(nProxyType));
 }
 else
 {
diff --git a/shell/source/backends/kde5be/kde5backend.cxx 
b/shell/source/backends/kde5be/kde5backend.cxx
index c89869579159..0c0472b0233a 100644
--- a/shell/source/backends/kde5be/kde5backend.cxx
+++ b/shell/source/backends/kde5be/kde5backend.cxx
@@ -56,12 +56,12 @@
 
 namespace
 {
-OUString SAL_CALL getServiceImplementationName()
+OUString getServiceImplementationName()
 {
 return OUString("com.sun.star.comp.configuration.backend.KDE5Backend");
 }
 
-css::uno::Sequence SAL_CALL getServiceSupportedServiceNames()
+css::uno::Sequence getServiceSupportedServiceNames()
 {
 OUString name("com.sun.star.configuration.backend.KDE5Backend");
 return css::uno::Sequence(, 1);
@@ -74,7 +74,7 @@ public:
 Service();
 
 private:
-virtual ~Service() {}
+virtual ~Service() override {}
 
 virtual OUString SAL_CALL getImplementationName() override
 {
@@ -204,7 +204,7 @@ Service::Service()
 
 void Service::setPropertyValue(OUString const&, css::uno::Any const&)
 {
-throw css::lang::IllegalArgumentException(OUString("setPropertyValue not 
supported"),
+throw css::lang::IllegalArgumentException("setPropertyValue not supported",
   
static_cast(this), -1);
 }
 
@@ -231,7 +231,7 @@ css::uno::Any Service::getPropertyValue(OUString const& 
PropertyName)
 }
 
 css::uno::Reference
-SAL_CALL createInstance(css::uno::Reference 
const&)
+createInstance(css::uno::Reference const&)
 {
 return static_cast(new Service);
 }
@@ -242,9 +242,8 @@ static cppu::ImplementationEntry const services[]
 { nullptr, nullptr, nullptr, nullptr, nullptr, 0 } };
 }
 
-extern "C" SAL_DLLPUBLIC_EXPORT void* SAL_CALL 
kde5be1_component_getFactory(char const* pImplName,
-
void* pServiceManager,
-
void* pRegistryKey)
+extern "C" SAL_DLLPUBLIC_EXPORT void*
+kde5be1_component_getFactory(char const* pImplName, void* pServiceManager, 
void* pRegistryKey)
 {
 return cppu::component_getFactoryHelper(pImplName, pServiceManager, 
pRegistryKey, services);
 }
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2018-01-23 Thread Tor Lillqvist
 0 files changed

New commits:
commit 53c304789eb8da8f5a7b2209ece68eeaec819a8f
Author: Tor Lillqvist 
Date:   Tue Jan 23 12:08:18 2018 +0200

chmod -x

Change-Id: I05021e1d86412c3a0703e71f43fe2238bb094762

diff --git a/shell/source/win32/shlxthandler/propsheets/listviewbuilder.cxx 
b/shell/source/win32/shlxthandler/propsheets/listviewbuilder.cxx
old mode 100755
new mode 100644
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2018-01-22 Thread Stephan Bergmann
 shell/source/win32/shlxthandler/propsheets/listviewbuilder.cxx |6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

New commits:
commit d4b7c6fabb4973e71ac2ce6b456b03d3d54c759a
Author: Stephan Bergmann 
Date:   Mon Jan 22 13:08:01 2018 +0100

loplugin:cstylecast (clang-cl)

manual fix in macro code too difficult for current rewriting plugin

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

diff --git a/shell/source/win32/shlxthandler/propsheets/listviewbuilder.cxx 
b/shell/source/win32/shlxthandler/propsheets/listviewbuilder.cxx
old mode 100644
new mode 100755
index a3143f966ae6..87a8f591f393
--- a/shell/source/win32/shlxthandler/propsheets/listviewbuilder.cxx
+++ b/shell/source/win32/shlxthandler/propsheets/listviewbuilder.cxx
@@ -33,17 +33,17 @@
 // Unicode-only defines to break dependence on UNICODE define
 #if !defined ListView_InsertColumnW
 #define ListView_InsertColumnW(hwnd, iCol, pcol) \
-(int)SNDMSG((hwnd), LVM_INSERTCOLUMNW, (WPARAM)(int)(iCol), 
reinterpret_cast(pcol))
+static_cast(SNDMSG((hwnd), LVM_INSERTCOLUMNW, WPARAM(int(iCol)), 
reinterpret_cast(pcol)))
 #endif
 
 #if !defined ListView_InsertItemW
 #define ListView_InsertItemW(hwnd, pitem)   \
-(int)SNDMSG((hwnd), LVM_INSERTITEMW, 0, reinterpret_cast(pitem))
+static_cast(SNDMSG((hwnd), LVM_INSERTITEMW, 0, 
reinterpret_cast(pitem)))
 #endif
 
 #if !defined ListView_SetItemW
 #define ListView_SetItemW(hwnd, pitem) \
-(BOOL)SNDMSG((hwnd), LVM_SETITEMW, 0, reinterpret_cast(pitem))
+static_cast(SNDMSG((hwnd), LVM_SETITEMW, 0, 
reinterpret_cast(pitem)))
 #endif
 
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


  1   2   >