summaryrefslogtreecommitdiff
path: root/shell
AgeCommit message (Collapse)Author
2020-06-23Remove a fragment from a file URL early onStephan Bergmann
...as ShellExecuteExW would ignore it anyway Reviewed-on: https://gerrit.libreoffice.org/c/core/+/86868 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com> (cherry picked from commit 14b36a16b225bf7c988f118d499a7287c47cd83e) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/86877 Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com> (cherry picked from commit 51da0d22ff42b20ab38130b7874651ef136ecceb) Change-Id: I969db094bb7d2ea230ac8c36eb23d71a90fbe466
2019-04-04Filter out problematic file URLsStephan Bergmann
Change-Id: I87fd37e56326bef4888354b923407530c6f70760 Reviewed-on: https://gerrit.libreoffice.org/70177 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2019-04-04tdf#120703 PVS: V547 Fix activation of launched process' windowMike Kaganski
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 <mike.kaganski@collabora.com>
2018-04-03tdf#116516: INTERNET_PROXY_INFO always contains char* dataMike Kaganski
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 <ci@libreoffice.org> Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com> (cherry picked from commit 3837901ef422d432f709dd95352796a54b58aae6) Reviewed-on: https://gerrit.libreoffice.org/51633 Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com> (cherry picked from commit 873814828f8db91cf622e900a59ec1009dcc03a2)
2018-03-26Don't return local variable addressMike Kaganski
Oversight in 2f061dad7f875f704e3744fc5780c1d145b22e9f Change-Id: I4cd4fcab7f5fa87f49ecc193a3f481fb9ac33932 Reviewed-on: https://gerrit.libreoffice.org/50857 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com> (cherry picked from commit 01c71fba5f525b035f8a723215669d499bc27a3f)
2018-03-26tdf#116074: Don't block on sending email interactivelyMike Kaganski
When sending e-mail using a MAPI mail client that doesn't recognize MAPI_DIALOG_MODELESS flag, and doesn't return from MAPISendMail until message compose dialog is closed (like MS Outlook 2010 and older), waiting for the senddoc process blocks UI, which is unexpected and prevents users from copying stuff from documents to the mail body. Waiting for senddoc process completion is used for two things: 1. To serialize sending multiple mails (e.g., using mailmerge); 2. To show error in case when it failed. This patch allows to avoid blocking the UI in case when compose UI is requested - i.e., user interaction with the mail client is expected, and serialization is not required. In this case, the senddoc process will show the error message itself -> no need for main application to wait for its return. The error message now includes actual error code. To avoid cases when closing main program would remove temporary attachment files before they were used by mail client, they are copied to base temporary directory (instead of default session temporary directory that gets deleted upon program shutdown). senddoc cleans up its temporaries itself. The temporary attachment files are copied to files with ASCII-only filenames, and their original filenames are passed to mail clients using MAPI. This allows to avoid cases when the filenames contain characters outside of current Windows codepage, and the mail client does not support Unicode MAPI, thus receiving wrong filename and erroring out from the send. Reviewed-on: https://gerrit.libreoffice.org/50826 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com> (cherry picked from commit 2f061dad7f875f704e3744fc5780c1d145b22e9f) Change-Id: I4a517bd7a797e76e4c0b7ea48bb1a7b652741a81
2018-03-25Remove obsolete commentMike Kaganski
Obsoleted by commit 7ce1e0e1ecbb1b3ec5e3cc15306a9df7e786c564 Change-Id: I479455ba704c7e2bf1df2308950e7a9b682762b6 Reviewed-on: https://gerrit.libreoffice.org/50433 Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com> Tested-by: Mike Kaganski <mike.kaganski@collabora.com> (cherry picked from commit 0ea41fea75cd1ac1d81fa57c4411e75a6b4001f0)
2018-03-25tdf#116074: Use modeless dialogs with supporting mailersMike Kaganski
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 <mike.kaganski@collabora.com> Tested-by: Mike Kaganski <mike.kaganski@collabora.com> (cherry picked from commit 5874c76371562c3e2d8564b1fb04df1997091d27)
2018-03-25Use Unicode for senddocMike Kaganski
Also removes unused code and unnecessary dependencies from it. Reviewed-on: https://gerrit.libreoffice.org/50444 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com> (cherry picked from commit c2f7759e85f3e5cc9f56aaf03eefa0f1ba834734) Change-Id: Ib6de29358098846ca5e7330b10e67a88cfff8a6a
2018-03-19LOK: fix URL launching, so that Help buttons work.Michael Meeks
Change-Id: I9efe0173c35341043c3402042d9aa364a03e4fc5 Reviewed-on: https://gerrit.libreoffice.org/46419 Reviewed-by: Jan Holesovsky <kendy@collabora.com> Tested-by: Jan Holesovsky <kendy@collabora.com> (cherry picked from commit 2ccf578372cd77060abb6db520985165e779de3f) (cherry picked from commit 7978eb8f6efa64fb0d5fba993f029793672a78ba)
2017-12-07Handle conversion from glibc locale to BCP 47 language tagEike Rathke
The backend's ImplGetLocale() didn't handle variants, so ca_ES@valencia ended up as ca-ES instead of ca-ES-valencia, which made a difference with for example the UI language being set to Default resulting in only ca instead of ca-valencia, which then is also written to /org.openoffice.Setup/L10N/ooLocale during startup and obtained later. This only for the *iX branch, no idea if and what could be adjusted for Windows or MacOSX. Change-Id: I050f6f643571ccdc669fb91b06f3bb516f96e8d5 Reviewed-on: https://gerrit.libreoffice.org/45946 Reviewed-by: Eike Rathke <erack@redhat.com> Tested-by: Jenkins <ci@libreoffice.org> (cherry picked from commit c2bd06120b932bf3757f19bdf8c8d9ee8a31f557) Reviewed-on: https://gerrit.libreoffice.org/45980
2017-11-13Fix typosAndrea Gelmini
Change-Id: Ia544298334364ece3b3963a4adc00c5e01189b91 Reviewed-on: https://gerrit.libreoffice.org/44654 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Mark Page <aptitude@btconnect.com>
2017-11-04Make Windows error reporting more robustMike Kaganski
https://msdn.microsoft.com/en-us/library/ms679351 describes that "it is unsafe to take an arbitrary system error code returned from an API and use FORMAT_MESSAGE_FROM_SYSTEM without FORMAT_MESSAGE_IGNORE_INSERTS" Previously in case when an error string would contain inserts, function returned error, so the error message wasn't shown (at least it didn't crash, thanks to nullptr as the function's last argument). As the function may fail, we now pre-nullify the buffer pointer to avoid dereferencing uninitialized pointer later (though at least for some Windows versions, the function nullifies the pointer in case of FORMAT_MESSAGE_ALLOCATE_BUFFER, but there's no explicit guarantee of this). Also release of allocated buffer is changed to recommended use of HeapFree. The code that doesn't make use of OUString is left directly calling FormatMessage, to avoid introducing new dependencies. Where it makes sense, we now use WindowsErrorString from <comphelper/windowserrorstring.hxx> Change-Id: I834c08eb6d92987e7d3d01e2c36ec55e42aea848 Reviewed-on: https://gerrit.libreoffice.org/44206 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2017-10-27loplugin:includeform: shell (Windows)Stephan Bergmann
Change-Id: I80109e4e60b0f72efee53509d5539918cec789bd
2017-10-24loplugin:finalclasses in sfx2..svlNoel Grandin
Change-Id: I71b78135b3d0259657438c4401340bb35ab5c6e0 Reviewed-on: https://gerrit.libreoffice.org/43742 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-10-24loplugin:includeform: shell (macOS)Stephan Bergmann
Change-Id: I2a254633124caa03d48ec9e6d21751b0b8750c0b
2017-10-23loplugin:includeform: shellStephan Bergmann
Change-Id: I73be2f09a4b27509b62936daa414efb51977277f
2017-10-05Rename and move SAL_U/W to o3tl::toU/WMike Kaganski
Previosly (since commit 9ac98e6e3488e434bf4864ecfb13a121784f640b) it was expected to gradually remove SAL_U/W usage in Windows code by replacing with reinterpret_cast or changing to some bettertypes. But as it's useful to make use of fact that LibreOffice and Windows use compatible representation of strings, this commit puts these functions to a better-suited o3tl, and recommends that the functions be consistently used throughout Windows-specific code to reflect the compatibility and keep the casts safe. Change-Id: I2f7c65606d0e2d0c01a00f08812bb4ab7659c5f6 Reviewed-on: https://gerrit.libreoffice.org/43150 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2017-10-04add << operator for css::uno::ExceptionNoel Grandin
Change-Id: Ia23dafd07133779144965682df3b7125a3214235 Reviewed-on: https://gerrit.libreoffice.org/43046 Reviewed-by: Stephan Bergmann <sbergman@redhat.com> Tested-by: Jenkins <ci@libreoffice.org>
2017-09-30Use SAL_W/SAL_U instead of reinterpret_cast btwn wchar_t* and sal_Unicode*Mike Kaganski
This is type-safe, and allows to catch cases where a source type is changed for some reason, but reinterpret_cast masks that Change-Id: Ib64b6fa2e22d94a6bba890f0ccc3e20325c6f0a1 Reviewed-on: https://gerrit.libreoffice.org/42961 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2017-09-29Drop check for Windows versions we don't supportMike Kaganski
Since we dropped support of Vista and below in master toward 6.0, those checks are needless. Removing the code that only worked in older versions, and streamlining the resulting code. Also, use kernel32.dll version for Windows version, instead of deprecated GetVersionEx, and inconvenient VersionHelpers. Since both GetVersion(Ex) and VersionHelpers (based on VerifyVersionInfo) are subject to manifest-based behavior since Windows 8.1, this move will hopefully result in more reliable OS version detection. Change-Id: I3edd8fc1843e64b6a65bd3a126be6a085511f13c Reviewed-on: https://gerrit.libreoffice.org/42905 Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com> Tested-by: Mike Kaganski <mike.kaganski@collabora.com>
2017-09-28shell: use Unicode on WindowsMike Kaganski
Change-Id: I9f7962db320f8832879ba327108425a7592b4b77 Reviewed-on: https://gerrit.libreoffice.org/42885 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2017-09-27loplugin:redundantcast (clang-cl)Stephan Bergmann
Change-Id: I37e7e217d89fb51cdfe28ec37be901e20068c309
2017-09-26loplugin:cstylecast (clang-cl)Stephan Bergmann
Change-Id: Ic61a2d58e260e11f3698524891201e8b761c97fc
2017-09-23loplugin:flatten in sdext..stocNoel Grandin
Change-Id: I460e813e20a691c53738373376d3363f553bbab2 Reviewed-on: https://gerrit.libreoffice.org/42636 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-09-23Fix typoAndrea Gelmini
Change-Id: I970201eb99c56db3ac5fefb9e113c0bb3b8c754b Reviewed-on: https://gerrit.libreoffice.org/42678 Reviewed-by: Julien Nabet <serval2412@yahoo.fr> Tested-by: Julien Nabet <serval2412@yahoo.fr>
2017-09-22Windows: avoid dependence on UNICODE define; prefer W functionsMike Kaganski
Change-Id: I95b90128e93f0d88ed73601bcc5a7ca9279d4cf1 Reviewed-on: https://gerrit.libreoffice.org/42560 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2017-09-18Some more WIN32_LEAN_AND_MEANMike Kaganski
Change-Id: Iadb0ebb66809c192fb817b8c7cf2f8cdb4d0b874 Reviewed-on: https://gerrit.libreoffice.org/42419 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2017-09-18Use even more WIN32_LEAN_AND_MEANMike Kaganski
Change-Id: I538fe5b41156366e0e87b3a93e58a3947afd18f5 Reviewed-on: https://gerrit.libreoffice.org/42398 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2017-09-16Use more WIN32_LEAN_AND_MEANMike Kaganski
https://msdn.microsoft.com/en-us/aa383745 Change-Id: I83528dc8e6a5e119e7aa816219d35f1ea3723b96 Reviewed-on: https://gerrit.libreoffice.org/42338 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2017-08-31loplugin:constparams: shell (clang-cl)Stephan Bergmann
Change-Id: I7ffe60d53f4c4b7690efc8bec9d29a4959740d9a
2017-08-17remove unnecessary use of OUString::getStrNoel Grandin
Change-Id: I3d13e1c0bb6aa4a7aacc463198747c1368ebc9b4 Reviewed-on: https://gerrit.libreoffice.org/38114 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-08-17remove UL/L suffixes from integer constants on the RHS of expressionsNoel Grandin
Change-Id: I899a8126c9d971601fea6c77eca165718aea0ac5 Reviewed-on: https://gerrit.libreoffice.org/41237 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-07-31loplugin:oncevarNoel Grandin
extend oncevar to any POD type Change-Id: Ia98ee0a67f183e40fb0c38477760124b2c411dc0 Reviewed-on: https://gerrit.libreoffice.org/40564 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-07-17loplugin:useuniqueptr: shell (clang-cl)Stephan Bergmann
Change-Id: Icf6cd85f9e4792ad09dd1a97a8802da13da942c2
2017-07-17loplugin:unnecessaryparen: shell (clang-cl)Stephan Bergmann
Change-Id: If038a119b0b01bff9f452bb66e855e35c10d06eb
2017-07-17loplugin:constparams in basegfx,sax,shellNoel Grandin
Change-Id: I90a9d105a6db146ae64cff56983def94b9472a95 Reviewed-on: https://gerrit.libreoffice.org/40043 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-07-05tdf#108287 replace std::bind2nd with lambdaJochen Nitschke
in preparation of removal of deprecated std::binary_function Change-Id: Iabb02b100975f67665be9d6d562b7206ef846107 Reviewed-on: https://gerrit.libreoffice.org/39513 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-07-03Revert "Workaround to call /app/bin/xdg-open when run under flatpak"Stephan Bergmann
This reverts commit 28a03248b1d1649e157b788e43dfe8326f165379 (and removes a stry empty line). There is no more need for our own /app/bin/xdg-open, as xdg-open in the freedesktop.org (and thus also GNOME) runtime (see <https://github.com/flatpak/flatpak-xdg-utils/blob/master/src/xdg-open.c>) by now knows to ask the Desktop portal, too. Change-Id: Ie4141d02ba5f43c0264afcfae9edfc2d3a8cdb16
2017-07-03loplugin:oncevar (clang-cl): shellStephan Bergmann
Change-Id: I594596f27aa6f223d2294586357b11595377e1fe
2017-07-03C++11 remove std::unary_function bases from functorsJochen Nitschke
std::unary_function is deprecated since C++11 and removed in C++17 90% done with regexp magic. removed obsolete <functional> includes. The std::unary_function base class was used in 3 places: * chart2/source/tools/DataSeriesHelper.cxx: lcl_MatchesRole is used in a std::not1 function helper who uses the members return_type and argument_type. - replace deprecated std::not1 with a lambda * chart2/source/tools/ModifyListenerHelper.cxx: lcl_weakReferenceToSame used the argument_type member in the operator() parameter. - inline the parameter type. * xmloff/source/chart/SchXMLExport.cxx: lcl_SequenceToMapElement used result_type and argument_type in operator(). - inline the types Also fix compile error with gcc about finding std::for_each. Change-Id: I073673beb01410c3108e7d0346d9e7d6b9ad2e2f Reviewed-on: https://gerrit.libreoffice.org/39358 Reviewed-by: Stephan Bergmann <sbergman@redhat.com> Tested-by: Stephan Bergmann <sbergman@redhat.com>
2017-06-29loplugin:oncevarStephan Bergmann
Change-Id: I62fbef4959390161509e20a41f687a967db6c2fe
2017-06-29loplugin:oncevarStephan Bergmann
Change-Id: Id5309e2d06551da6df05d06e436678b570740f78
2017-06-18remove unused osl/mutex.hxx includesJochen Nitschke
Change-Id: I3b50e45fdb99e9cd8bfda07356ee3ddb4dd0f8bb Reviewed-on: https://gerrit.libreoffice.org/38905 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Jochen Nitschke <j.nitschke+logerrit@ok.de>
2017-06-13remove TDE integration (vclplug, address book, config backend)Michael Stahl
It has ~no users, can't even be built on modern Linuxes, and it annoys folks who want to refactor VCL. Per ESC decision from 2017-06-08, remove --enable-tde and --enable-tdeab. Change-Id: I51ce4786f29f8fcac2e2bb2a654c41fbfbbd8afd Reviewed-on: https://gerrit.libreoffice.org/38718 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Michael Stahl <mstahl@redhat.com>
2017-06-02loplugin:redundantcast (clang-cl)Stephan Bergmann
Change-Id: I465469471dc95e5dd61ecafd8ee8c9424b1b8030
2017-05-30Revert those quotes that look brokenStephan Bergmann
...from 2b916da6cdcf3f7abe7e10f83321576ae2695954 "tdf#105204 fix shellcheck warning in shell/source/unix/misc/senddoc.sh" Change-Id: Iad55c5f4ff97f39ba117e525f2e660b537b00367
2017-05-21tdf#105204 fix shellcheck warning in shell/source/unix/misc/senddoc.shYeliz Taneroğlu
Change-Id: I2e402186c4a8177031a8bf80f051ef0ca70063b0 SC2006: Use $(STATEMENT) instead of legacy `STATEMENT` SC2086: Double quote to prevent globbing and word splitting. Reviewed-on: https://gerrit.libreoffice.org/37824 Reviewed-by: Chris Sherlock <chris.sherlock79@gmail.com> Tested-by: Chris Sherlock <chris.sherlock79@gmail.com>
2017-05-20cleanup unused css/uri/ includesJochen Nitschke
Change-Id: I08c7981ecce45e343ff9e98277dd3aea4ed68ab9 Reviewed-on: https://gerrit.libreoffice.org/37860 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-05-11cid#1403658: Try harder to make Coverity Scan happyStephan Bergmann
Change-Id: I109f95a55875b7795fc366825b3a6bb2e897d676