Commit Graph
151 Commits
Author SHA1 Message Date
Hossein 228c03d878 Make odk unoapploader C code build with GCC 15.2
With GCC 15.2, compiler produces this error message:

[LOC] top level modules: odk
odk/source/unoapploader/unx/unoapploader.c: In function ‘createCommandName’:
odk/source/unoapploader/unx/unoapploader.c:285:13: error: assignment discards
‘const’ qualifier from pointer target type [-Werror=discarded-qualifiers]
  285 |         sep = strrchr( prgname, SEPARATOR );
      |             ^
cc1: all warnings being treated as errors

By defining sep as "const char*" instead of "char*", the problem goes away.

Change-Id: If1d628dba8bb4ec657b916fa61927b250d3039c3
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/202942
Tested-by: Jenkins
Reviewed-by: Hossein <hossein@libreoffice.org>
2026-03-30 17:41:16 +02:00
Mike Kaganski 7e5a704e7c Use _wputenv_s instead of _wputenv
Avoids unneeded concatenations; also it's documented as "more secure".

Change-Id: Idbe0bd330992833bc70231a069ddbd808ea94b62
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/183502
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2025-03-30 14:38:05 +02:00
Ilmari Lauhakangas 558b20d1ac comphelper, msicreator, odk: fix issues found by Ruff linter
Change-Id: I5ef65baeb0100b9d70b5c59c1d5f6f43ab951a22
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/171092
Reviewed-by: Ilmari Lauhakangas <ilmari.lauhakangas@libreoffice.org>
Tested-by: Jenkins
Tested-by: Ilmari Lauhakangas <ilmari.lauhakangas@libreoffice.org>
2024-07-27 15:42:26 +02:00
varshneydevansh 5e8813b22a tdf#97448 Add helper script to generate Addons.xcu
This patch adds a new Python helper script to generate Addons.xcu for
LibreOffice extensions. The script works like a wizard, and asks user
about the needed details. It provides these options for the application
module context:

    1. Writer
    2. Spreadsheet
    3. Presentation
    4. Draw
    5. Formula
    6. Chart
    7. Bibliography

After selection of the module, appropriate Addons.xcu is generated, and
user is asked to choose between 'desktop' or a custom folder to save the
resulting file.

Change-Id: I22a878f0bde19a870674a357d7085ad3c12fc50c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/163382
Tested-by: Jenkins
Reviewed-by: Hossein <hossein@libreoffice.org>
2024-04-25 10:58:49 +02:00
Mike Kaganski 8f6b412581 Define a name for the extended path buffer size, instead of a literal
Change-Id: If6d40c818e021b3241d6b6b33aceca07c6393511
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/163926
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2024-02-26 05:59:10 +01:00
Mike Kaganski 6cbb60688a Replace an instance of MAX_PATH (plus some) 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: Id166f425238e50d4131f72bcfd22b5268dea0c3f
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/163915
Tested-by: Mike Kaganski <mike.kaganski@collabora.com>
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2024-02-26 04:17:19 +01:00
Stephan Bergmann 70bcf9e8be Remove support for AIX
As discussed in the mailing list thread starting at
<https://lists.freedesktop.org/archives/libreoffice/2023-January/089808.html>
"Plan to remove dead C++ UNO bridge implementations (bridges/source/cpp_uno/*)",
the bridge implementation at bridges/source/cpp_uno/gcc3_aix_powerpc is
apparently dead and should thus be removed.  However, that was the only bridge
implementation for AIX, which implies that support for the AIX platform as a
whole is dead and should thus be removed.

Change-Id: I96de3f7f97d4fd770ff78256f0ea435383688be9
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/146057
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2023-01-27 07:28:16 +00:00
Caolán McNamara b370b510af cid#1500416 Resource leak
Change-Id: I090e10604562665cf22aa98758e81dd398f4f9c5
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/139997
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2022-09-15 15:30:35 +02:00
Caolán McNamara 6105706deb cid#1500586 Resource leak
Change-Id: I32d837af7574f6eb4ac7db4759139d0b78f63e75
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/138479
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2022-08-18 16:05:26 +02:00
Stephan Bergmann de46531735 -Werror,-Wstrict-prototypes (clang-cl)
Change-Id: I72e35f51eb607662608ccaf944bec64ed422cef4
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132835
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2022-04-11 19:40:51 +02:00
Stephan Bergmann ffb1a9f3d5 Silence cid#1470402 FB.DM_DEFAULT_ENCODING
...where the default encoding should be the appropriate one for reading the
Runtime.exec output

Change-Id: Ib64bfcbcca985f2de506f8628b506e6dc7bfc035
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/107255
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2020-12-05 16:06:15 +01:00
Stephan Bergmann 0124111394 Replace unowinreg.dll with execution of reg QUERY
The SDK's <https://wiki.openoffice.org/wiki/Documentation/DevGuide/ProUNO/Java/
Transparent_Use_of_Office_UNO_Components> on all platforms included the Windows-
specific unowinreg.dll in generated jars (so that those jars, when distributed
to a Windows environment, would find a LO installation by inspecting the Windows
registry).  That unowinreg.dll was originally built as a 32-bit DLL (though when
building a 64-bit Windows LO, it happened to be built as a 64-bit DLL).  For
non-Windows LO builds, it could either be built locally with a MinGW toolchain
(--enable-build-unowinreg) or downloaded from dev-www.libreoffice.org.

However, that had various issues:

For one, unowinreg.dll was not necessarily available in a distributed jar as a
64-bit DLL for use with a 64-bit JRE on Windows.  (Theoretically, running such a
jar with a 32-bit JRE to access a 64-bit LO installation's URE jars could have
worked.  But practically, those URE jars in turn require native DLLs, which
would then not have been available as 32-bit DLLs for use in the 32-bit JRE.)

For another, at least the unowinreg.dll resulting from --enable-build-unowinreg
on Fedora 33 would have had a dependency on libgcc_s_dw2-1.dll that would
generally not have been available in a target Windows environment.

There appears to be no pure Java way to read the Windows registry, but instead
of using a native code DLL for that, it appears to work just as well to call out
to reg.exe and parse its output.

This removes the --enable-build-unowinreg and --with-mingw-cross-compiler
configuration options.  (The sole use of the MinGW toolchain in LO was for
building unowinreg.dll.)

Change-Id: I3283ea38c884d3221a205e5ab6ec99a2691ef474
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/107140
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Tested-by: Jenkins
2020-12-03 15:01:00 +01:00
Andrea Gelmini a33a8f2216 Fix typos
Change-Id: I8dc0cdcfe6bd90efc596df28e6c6d968b92618b5
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/101098
Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
Tested-by: Jenkins
2020-08-21 18:18:36 +02:00
Stephan Bergmann 5a11fe87a6 loplugin:fakebool (clang-cl)
...plus follow-up loplugin:implicitboolconversion and loplugin:redundantcast

Change-Id: I9fc9c5cb46fbb50da87ff80af64cb0dfda3e5f90
Reviewed-on: https://gerrit.libreoffice.org/83207
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2019-11-19 21:34:30 +01:00
Caolán McNamara 10be651210 cid#706181 Use of untrusted string value
use an annotation here and add one to the windows equivalent

Change-Id: Ife54949c2e89ae606d7931be82807db4bbb132dc
Reviewed-on: https://gerrit.libreoffice.org/83024
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
2019-11-17 20:46:33 +01:00
Mike Kaganski 3b25ea6d83 tdf#120703 PVS: Silence V575 warnings
V575 The potential null pointer is passed into 'foo' function

Add asserts to those cases that are related to OOM cases. There's
nothing to be done if the assertions fail anyway.

Change-Id: I92ac95d44f512aa1948b1552b0e1f6da695a9f92
Reviewed-on: https://gerrit.libreoffice.org/70008
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2019-03-31 16:43:44 +02:00
Stephan Bergmann 928b1b04ad loplugin:external (clang-cl)
Including:

* expanding STDAPI to its definition (as per
  <https://msdn.microsoft.com/library/ms686631(vs.85).aspx> "STDAPI"), to add
  __declspec(dllexport) into its middle, in
  extensions/source/activex/so_activex.cxx; as discussed in the comments at
  <https://gerrit.libreoffice.org/#/c/60691/> "Get rid of Windows .def files in
  setup_native, use __declspec(dllexport)", having a function both listed in a
  .def file EXPORTS and marking it dllexport is OK, and the latter helps the
  heuristics of loplugin:external; however, the relevant functions in
  extensions/source/activex/so_activex.cxx probably don't even need to be
  exported in the first place?

* follow-up loplugin:salcall in sal/osl/w32/file-impl.hxx

Change-Id: Ida6e17eba19cfa3d7e5c72dda57409005c0a0191
Reviewed-on: https://gerrit.libreoffice.org/60938
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2018-09-24 17:22:05 +02:00
Stephan Bergmann 433221d66b Get rid of redundant odk/source/unowinreg/win/unowinreg.def
...similar to 28b4f4aeaf "Get rid of Windows .def
files in setup_native, use __declspec(dllexport)".  And JNIEXPORT (with which
the listed functions are decorated in odk/source/unowinreg/win/unowinreg.cxx)
already implies __declspec(dllexport).

Change-Id: I45fd1d50cd3b072d124002e469c70eb1d6ed7610
Reviewed-on: https://gerrit.libreoffice.org/60819
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2018-09-21 09:42:06 +02:00
Stephan Bergmann 206b5b2661 New loplugin:external
...warning about (for now only) functions and variables with external linkage
that likely don't need it.

The problems with moving entities into unnamed namespacs and breaking ADL
(as alluded to in comments in compilerplugins/clang/external.cxx) are
illustrated by the fact that while

  struct S1 { int f() { return 0; } };
  int f(S1 s) { return s.f(); }
  namespace N {
    struct S2: S1 { int f() { return 1; } };
    int f(S2 s) { return s.f(); }
  }
  int main() { return f(N::S2()); }

returns 1, both moving just the struct S2 into an nunnamed namespace,

  struct S1 { int f() { return 0; } };
  int f(S1 s) { return s.f(); }
  namespace N {
    namespace { struct S2: S1 { int f() { return 1; } }; }
    int f(S2 s) { return s.f(); }
  }
  int main() { return f(N::S2()); }

as well as moving just the function f overload into an unnamed namespace,

  struct S1 { int f() { return 0; } };
  int f(S1 s) { return s.f(); }
  namespace N {
    struct S2: S1 { int f() { return 1; } };
    namespace { int f(S2 s) { return s.f(); } }
  }
  int main() { return f(N::S2()); }

would each change the program to return 0 instead.

Change-Id: I4d09f7ac5e8f9bcd6e6bde4712608444b642265c
Reviewed-on: https://gerrit.libreoffice.org/60539
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2018-09-17 09:05:38 +02:00
Mike Kaganski 682cef7d37 odk: MSVC: pragma warning: make more specific, remove obsolete
Change-Id: Ie5957edb3954507505a7df9fad9f8da6b87b09d0
Reviewed-on: https://gerrit.libreoffice.org/49038
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2018-02-01 17:56:03 +01:00
Stephan Bergmann 57763d2e79 loplugin:includeform: odk (Windows)
Change-Id: I654aa2cf1175f91619b70c9257e88f7006b0c04c
2017-10-27 19:28:51 +02:00
Stephan Bergmann f6ad25f67b loplugin:includeform: odk
Change-Id: Ic8ede7a0377d9ec4f360b63889e0ccf3c5dda93f
2017-10-23 22:46:01 +02:00
Mike Kaganski d32506e9f4 cppuhelper_detail_findSofficePath: use Unicode on Windows
On Windows, UTF-8 is never current locale encoding; so using 8-bit
strings will always fail for paths containing characters outside
of current codepage.
Also fix leaks caused by failing to release its result: previously
it could return either result of getenv (that shouldn't get freed),
or an allocated string, but never got freed; now the result is
always allocated and properly freed.

Change-Id: I8b255dea20040eec0572de2b34280749fe8f071c
Reviewed-on: https://gerrit.libreoffice.org/42743
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2017-09-27 06:24:24 +02:00
Mike Kaganski aaa26a58ba Some more WIN32_LEAN_AND_MEAN
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-18 19:24:31 +02:00
Stephan Bergmann f27e98f9a7 loplugin:constparams: odk (clang-cl)
Change-Id: I2daf0b0868d4bdfb412575b25dbe644e76607342
2017-08-31 12:14:40 +02:00
Andrea Gelmini 095438e52c Fix typos
Change-Id: I14dca0d55c09187690dc1d94936c40b890ca5cea
Reviewed-on: https://gerrit.libreoffice.org/35637
Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
Tested-by: Julien Nabet <serval2412@yahoo.fr>
2017-03-25 12:36:37 +00:00
Stephan Bergmann b63fbe006f New loplugin:externvar: odk
Change-Id: I1f60c6b606a1ac96acbfa0777797acdaaea38c3c
2017-01-09 15:42:00 +01:00
Stephan Bergmann 2e54c5a0b4 -Werror,-Wstrict-prototypes (clang-cl)
(sal/inc/rtllifecycle.h only hits on Windows as that is the only platform that happens to
actually include it in a C compilation unit, sal/osl/w32/dllentry.c)

Change-Id: I2878b52daf713ea45eaa2968cc5d2686b86abfe6
2016-12-16 15:28:39 +01:00
Stephan Bergmann 932c1c57a0 clang-cl loplugin: odk
Change-Id: I8c524bd6522a04339d5e30d6e315347a48b6473f
Reviewed-on: https://gerrit.libreoffice.org/29859
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2016-10-16 14:18:33 +00:00
Miklos Vajna 44aefdf90d odk: add missing modelines
Change-Id: I0bd2d761b5a75681c8c3e53664084dd3b8176107
Reviewed-on: https://gerrit.libreoffice.org/25051
Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
Tested-by: Jenkins <ci@libreoffice.org>
2016-05-17 09:03:30 +00:00
Stephan Bergmann abbf4777f2 cid#1326844: DP: Use doPrivileged
Change-Id: Id86b4afc0d00864e02c978e0b8d4aa1fde7263c3
2016-02-24 15:08:51 +01:00
Stephan Bergmann 736f265c46 cid#1326523,1326524: Resource leak on an exceptional path
Change-Id: I34016e7124ff33700bb33801145f478ed34e9262
2016-02-24 14:00:50 +01:00
Caolán McNamara 3c48764e4f coverity#1326434 Dereference null return value
Change-Id: I409a8f43ff2533a676546065405010a7fb877295
2016-02-18 17:21:18 +00:00
Stephan Bergmann 353b7dde33 -Werror,-Wstring-plus-int
Change-Id: Ie16ca73ac3d622d00583ef454780f9a01b32d436
2015-11-28 08:44:50 +01:00
Caolán McNamara ab22d11279 coverity#1326731 Dm: Dubious method used
and

coverity#1326732 Dm: Dubious method used
coverity#1326734 Dm: Dubious method used
coverity#1326735 Dm: Dubious method used
coverity#1326739 Dm: Dubious method used

Change-Id: Id9d39decf7442b503079ebcfe8c881f0f2fe3eb3
2015-10-15 14:26:05 +01:00
Noel Grandin 26b4f5be81 java:use System.arrayCopy to copy arrays
instead of a for loop

Change-Id: I3fbd92c5f96970543c2da3843e54a733bf811e72
2015-06-09 13:10:44 +02:00
Noel Grandin 441407571e java:Non-synchronized method should not override a synchronized method
Change-Id: I46307828757ee1142747c14d2942515340083605
2015-06-09 13:10:43 +02:00
Michael Stahl 1a8b6b3f1d odk: PVS-Studio V618 non-const format string
Change-Id: I38c5abfc503fae11e6cb7233f4163b41ed6c699e
2015-03-12 11:28:25 +01:00
Michael Stahl 405cb8bc58 remove executable bit from c / h / cxx / hxx / l files
Change-Id: I90d7788208fb86c8aea36c4944ca11d881f11720
2015-03-02 14:05:51 +01:00
David Ostrovsky c4e37b8ec4 ODK: Fix WError on windows x64 bit
Change-Id: I39534e171806d47e154c82de89b8b9e3883771b4
Reviewed-on: https://gerrit.libreoffice.org/14541
Reviewed-by: Michael Stahl <mstahl@redhat.com>
Tested-by: Michael Stahl <mstahl@redhat.com>
2015-02-19 22:25:21 +00:00
Noel Grandin 3757c03fc8 java: simplify array creation
and remove the need to worry about keeping indexes correct

Change-Id: I9a5fc00f7e28f305279b41099274c96daebebb95
2015-01-09 15:10:51 +02:00
Noel Grandin 454ddddd99 java: remove some unused fields and variables
Change-Id: I5d6071096307adbe7df0178000346cf915afa3e7
Reviewed-on: https://gerrit.libreoffice.org/13477
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
Tested-by: Noel Grandin <noelgrandin@gmail.com>
2014-12-15 12:36:40 +00:00
Noel Grandin a3a57bebcd java: fix some raw types warnings
Change-Id: I0e00739ac36ccc8704ad3c4e4adfa377a6b01f43
2014-11-18 12:44:34 +02:00
Noel Grandin 0063cf2856 java: make fields final where possible
found by PMD

Change-Id: I87780366119c141cd2dafe6ca1bf2d9798b10aec
2014-11-18 12:44:28 +02:00
Caolán McNamara 5208856b3b document coverity#706181 Use of untrusted string value
Change-Id: If8c80568175b3a5380ee78dda5ebd161c5dba2f6
2014-11-17 14:53:22 +00:00
Noel Grandin 973eb2f6db java: reduce the depth of some deeply nested if blocks
Change-Id: I3c0c7f08d4d8ea594e72fc0d9b93d085d4ab4bf5
2014-10-16 08:15:48 +02:00
Noel Grandin 81968336ea java: use equalsIgnoreCase() instead of toLowerCase().equals()
Change-Id: I8f4afc7e15a9d85d99ea80edbbbd2b507b254ddc
2014-10-07 13:20:03 +02:00
Noel Grandin 60f152caee java: avoid unnecessary comparisons in boolean expressions
i.e. stuff like "x == true"

Change-Id: Ib82a4a30e736df392405332fa197b588482cffcf
2014-08-20 10:35:53 +02:00
Chris Sherlock 3579f76f15 Suppress unchecked warning - this is fine
Change-Id: I69f47cf975a9ed91d4a1408351b5ad1751aab19e
2014-08-16 22:24:48 +10:00
Noel Grandin 0477e6c39b java: add @Override annotation to overriding methods
Change-Id: I086964c6f6ce52c60c52b6dbc445d3c21d22c80a
2014-08-12 09:41:28 +02:00