125 Commits
Author SHA1 Message Date
Caolán McNamara 4ceb8b2f27 fix build with MSVC >= 1931
It was too optimistic to think this worked on msvc

Change-Id: I66c85619d5ad1c93dbc2e03bdc228cf4d674ea88
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/187778
Tested-by: Jenkins
Tested-by: Caolán McNamara <caolan.mcnamara@collabora.com>
Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
2025-07-12 19:49:42 +02:00
Caolán McNamara 11db9b5fd5 use constexpr for idl "a ... Slots_Impl" objects
after const clean up of the Slot* argument

objdump -t instdir/program/libsclo.so |grep -v data.rel.ro|grep \\\.data|c++filt|grep -v s_cd|wc

before: 96
after: 78

while:

pmap -px PID|grep 'rw.--'|grep -v anon|awk '{ sum+=$4 } END { print sum }'

for a --with-distro=CPLinux-LOKit build and spawned kit calc process from
2352 to 1860 pages

Change-Id: Ic0ea3e7934ac469f7c6225c252506adb5b62a4c2
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/187742
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
2025-07-12 11:19:47 +02:00
Caolán McNamara bc6ea55b41 use constexpr for idl "a ... Args_Impl" objects
objdump -t instdir/program/libsclo.so |grep -v data.rel.ro|grep \\\.data|c++filt|grep -v s_cd|wc

before: 115
after: 96
Change-Id: I880d1934d7794fb57567f1e542e8a4feff645a83
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/187651
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
2025-07-11 18:30:35 +02:00
Noel Grandin d4c0e39d93 make the slot data constinit
because it takes a surprising amount of time to initialise it
at runtime during startup

(*) have to convert the std::function in SfxType to a
function pointer, because the std::function constructor
is not constinit compatible.

(*) the SfxType0..SfxTypeN types need some reinterpret_cast
to work around the lack of zero-sized trailing arrays in c++

(*) Sadly MSVC does not support taking the address of symbols
in constinit structures, so we cannot make the SfxSlot
array constinit.

Change-Id: I300ee770cc115d30bc25c819f2ad34b29633876c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/166963
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2024-05-02 14:37:56 +02:00
Noel Grandin b265b547b9 use more OUString in sfx slots
Change-Id: I900d9f1d35bc1e620822eedd5722a502704d6de0
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/166959
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2024-05-01 19:29:37 +02:00
Stephan Bergmann f8087b516a Extended loplugin:ostr: idl
Change-Id: I22adb7f3750f1e1b9910f37046c5da98ac7ab5be
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159697
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2023-11-20 07:27:30 +01:00
Yli875 6759434463 tdf#145538 Use range based for loops in idl:object
Change-Id: I7c9935254be5bea050a09859cebbc4112894999b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156858
Tested-by: Jenkins
Tested-by: Ilmari Lauhakangas <ilmari.lauhakangas@libreoffice.org>
Reviewed-by: Ilmari Lauhakangas <ilmari.lauhakangas@libreoffice.org>
2023-10-03 22:08:54 +02:00
Mike Kaganski 5fe96b6dce Drop SvStream::WriteCharPtr
WriteOString is a better replacement

Change-Id: Ic431b9aeb98d19fe61cff71360eee555105cc2bf
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/150192
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2023-04-10 23:13:32 +02:00
anfanite396 34f7c8cce9 tdf#145538 Use range based for loops
Change-Id: I546bbcd6de02f9a31db6dcb34b4493bd165c0661
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/148527
Tested-by: Jenkins
Reviewed-by: Andreas Heinisch <andreas.heinisch@yahoo.de>
2023-03-17 14:25:46 +00:00
Adoche Onaji 8429f5ca37 tdf#114441 Convert sal_uLong to a better type
In slot.cxx, GetAttrCount() return a size_t type and same type can
be assigned directly to nSCount. In hash.hxx, sal_uLong was declared
in SvStringHashEntry, the only default parameter it the class takes
is aName (type OString) while nValue was directly initialized as 0
in the constructor. The interface to change nValue is through a method
setValue of same type.Also In idl/inc/hash.hxx SetValue() and GetValue functionsb are used in idl/source/prj/database.cxx with sal_uInt32 parameter and return type and thus, sal_uInt32  is suitable here.The instances of sal_uLong in source/objects/object.cxx are replaced with sal_uInt32. In object.cxx an iterator was declared using std::find
to find nId in rSuperList (originally declared as std::vector<sal_uLong>),
therefore if nId is sal_uInt32, the parent vector, rSuperList
should be sal_uInt32. This change is now applicable to the void method
InsertSlot's parameter rSuperList in object.hxx and also variables n,
nId, iter, rSuperList in InsertSlot definition block in the file
object.cxx. Variable aSuperList in obect.cxx is also changed to
sal_uInt32 because its an argument for rSuperList parameter.
nC1 and nC2 in idl/source/prj/svidl.cxx are chnaged from sal_uLong to size_t as this is suitable here.

Change-Id: Ie075875229a676ea32dbf9e3049881a479773703
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/147220
Reviewed-by: Hossein <hossein@libreoffice.org>
Tested-by: Hossein <hossein@libreoffice.org>
2023-02-24 12:29:38 +00:00
Gabor Kelemen 67478f9d63 Recheck modules [i-l]* with IWYU
See tdf#42949 for motivation

Change-Id: I758bb27e93779e3df21c463714e49354748f446f
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/128715
Tested-by: Jenkins
Reviewed-by: Thorsten Behrens <thorsten.behrens@allotropia.de>
2022-01-27 18:52:16 +01:00
Noel Grandin bfc1600c6a loplugin:indentation improve checks for brace alignment
Change-Id: I333100fda7e181f68f36b03279b3fbb8cb768310
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/117615
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-06-28 10:47:34 +02:00
Noel Grandin 62f6d6ee8b use more string_view in tools/stream
Change-Id: I2a957cd72d71fea717734488cdb3670e0bcdd6f4
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/114657
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-04-27 09:27:44 +02:00
Bayram Çiçek a88effc4f5 tdf#114441: Convert use of sal_uLong to better integer types
Change-Id: Ibb432c3db6d99343514c412c4c1b968808b733c8
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/110886
Tested-by: Jenkins
Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
2021-03-11 11:37:49 +01:00
Noel Grandin 0f874472c6 size some stringbuffer to prevent re-alloc
found by the simple expidient of putting asserts in
the resize routine. Where an explicit const size is used,
I started with 32 and kept doubling until that site
did not need resizing anymore.

Change-Id: I998787edc940d0a3ba23b5ac37131ab9ecd300f4
Reviewed-on: https://gerrit.libreoffice.org/81138
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-10-21 08:36:01 +02:00
Noel Grandin acc711238d loplugin:useuniqueptr in SvMetaSlot
no need to store ref-counted object like OString on the heap

Change-Id: Ifd031ae68dfd615e99f54414cb2dc32aac60daa8
Reviewed-on: https://gerrit.libreoffice.org/60623
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-09-18 09:08:10 +02:00
Gabor Kelemen bdb0775a26 Add missing sal/log.hxx headers
rtl/string.hxx and rtl/ustring.hxx both unnecessarily #include <sal/log.hxx> (and don't make use of it themselves), but many other files happen to depend on it.
This is a continuation of commit 6ff2d84ade to be able to remove those unneeded includes.

This commit adds missing headers to every file found by:
grep -FwL sal/log.hxx $(git grep -Elw 'SAL_INFO|SAL_INFO_IF|SAL_WARN|SAL_WARN_IF|SAL_DETAIL_LOG_STREAM|SAL_WHERE|SAL_STREAM|SAL_DEBUG')
to directories from filter to jvmfwk

Change-Id: I2a73d63f2aaef5f26d7d08957daaa8a30b412ac5
Reviewed-on: https://gerrit.libreoffice.org/58204
Tested-by: Jenkins
Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
2018-07-30 09:28:40 +02:00
Arkadiy Illarionov 3bd8759f5e tdf#96099 Remove some trivial std::vector typedefs
Change-Id: I0e60ec7a3edae42b25ff0917828d0a893ed39a38
Reviewed-on: https://gerrit.libreoffice.org/55245
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-06-11 08:57:06 +02:00
Mike Kaganski 6ab9f0cfcd SDI: don't #define/#undef names of actual classes for slot headers
Visual Studio 2015/2017 cannot handle that correctly, and emits a lot
of intellisense errors. So, just prepend the define with "ShellClass_"

Change-Id: I473ceb7e0a88e114b92e6342fd4ae63015cafd3e
Reviewed-on: https://gerrit.libreoffice.org/51135
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2018-03-13 14:14:12 +01:00
Andrea Gelmini e07606fdd0 Fix typos
Change-Id: Ia30f466d08a9366b527225bbc0965f85881c7431
Reviewed-on: https://gerrit.libreoffice.org/43714
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2017-10-23 15:17:01 +02:00
Noel Grandin f2964b9cdb convert SfxGroupId to scoped enum
in the process I had to teach the idl compiler to cope with identifiers
like SfxGroupID::Math, which has the side effect of requiring a space
before a ':' in some of the .sdi files.

Change-Id: If256599cb8aa1dfc0a33642c5070c5560702f3ba
Reviewed-on: https://gerrit.libreoffice.org/40441
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-07-26 11:42:49 +02:00
Johnny_M c6f4fd1942 tdf#39468 Translate German comments and dbg strings (leftovers in h.. to i..)
Translates all (leftovers) found using a custom regex, in directories not shown by
/bin/find-german-comments and beginning with "h" to "i".

Additionally:
- Fixed a few spellings

Change-Id: I54ea06f8e0cf1bd4bd6c84b171bec1bd342a8df8
Reviewed-on: https://gerrit.libreoffice.org/38390
Reviewed-by: Michael Stahl <mstahl@redhat.com>
Tested-by: Michael Stahl <mstahl@redhat.com>
2017-06-06 13:51:55 +02:00
Noel Grandin ef513fd4b0 remove unnecessary use of OString::getStr
Change-Id: I0490efedf459190521f4339854b3394d57765fdb
Reviewed-on: https://gerrit.libreoffice.org/38058
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-05-28 19:44:08 +02:00
Noel Grandin a12dfa3531 create SfxGroupId based on o3tl::strong_int
Change-Id: Iaccf16f29b6f4b1a2c712d1e5e2bd0fa4fdb5e71
Reviewed-on: https://gerrit.libreoffice.org/37108
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-05-02 08:18:14 +02:00
Noel Grandin 71403558cb remove PseudoSlot support from idl compiler
Since we have removed the last usage with
commit 12c6caa84a
"Kill remaining PseudoSlots usage"

And remove corresponding support from the list-dispatch-commands script.

Also remove the now unused SFX_NEW_SLOT_ENUM macro

Change-Id: Id07c431de4404acf61a8bdd3507e390e5249879a
Reviewed-on: https://gerrit.libreoffice.org/35754
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-03-28 08:24:51 +00:00
Stephan Bergmann 6291574d94 Remove unused #include <ctype.h>
Change-Id: I8bf3e30687e20151a9e1936e69362abfe9b3a99d
2017-03-23 17:55:31 +01:00
Noel Grandin 4978328534 convert method names in tools::SvRef to be more like our other..
reference classes, uno::Reference and rtl::Reference.

Specifically rename Is()->is() and Clear()->clear().

Change-Id: Icb7e05e2d09cb9977121508b837ba0961dabb4ae
Reviewed-on: https://gerrit.libreoffice.org/33576
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-02-02 08:02:54 +00:00
Jacek Fraczek f004aa9951 tdf#89307: Removed SvRef::operator T*()
Conditional statements are using SvRef::Is() method.
Changed static_cast<T*>(svRef<T>) occurances to svRef.get().
Added operator == and != to SvRef.

SbxObject::Execute is using SbxVariableRef internally.
SbxObject::FindQualified is using SbxVariableRef internally.

Change-Id: I45b553e35d8fca9bf71163e6eefc60802a066395
Reviewed-on: https://gerrit.libreoffice.org/29621
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2016-10-10 08:48:30 +00:00
Noel Grandin 4d87443bf5 loplugin:constantparam
Change-Id: Idbe8c8e6b3d44cacce296ec8c79b2b244281057c
Reviewed-on: https://gerrit.libreoffice.org/29321
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2016-09-30 06:57:26 +00:00
Noel Grandin 43b4903db3 teach stylepolice plugin about ref-counted-pointer naming
Change-Id: I6e91d22fc1826038c05ddb6fc065563c6a250752
Reviewed-on: https://gerrit.libreoffice.org/24459
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
2016-04-28 09:31:16 +00:00
Julien Nabet 33b2d58895 Remove some unused include stdio
Change-Id: Ifdb9d133237eecd3132dffb0f85c005beac169d2
Reviewed-on: https://gerrit.libreoffice.org/23174
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
2016-03-12 14:43:17 +00:00
Noel Grandin 314cb543fe parse shell/interface entries in SvIdlParser
Change-Id: Ief68b26be0a0890ffdfa02a5904ba9d2cb364c65
2016-02-16 11:59:05 +02:00
Noel Grandin f7520bbc80 move interface/shell parsing to SvIdlParser
Change-Id: I95cce21c6c9beb5637dd4f4a769f455eaacbec2b
2016-02-15 15:47:30 +02:00
Noel Grandin 0c6d6aa47e rename Read()->ReadIf() and ReadDelimiter()->ReadIfDelimiter()
Change-Id: I589dc0280c5bb587aa024b0f1dcf0b623d719aa4
2016-02-12 09:13:43 +02:00
Noel Grandin 4e13a69112 use exceptions for error handling in .SDI parsing
to simplify the normal control flow

Change-Id: If325ec0507a51d8e2d3340fc5b628bb75a078a44
2016-02-11 14:47:01 +02:00
Noel Grandin 09d58f7be8 GetToken never returns null, so use a reference
Change-Id: I0164e546b0ee0b40acc7b9253d3c0ecded97280c
2016-02-11 14:47:01 +02:00
Noel Grandin 4bcc7ddf78 simplify error handling code
Change-Id: I8f70d6bde7018d5b4455f95373f1b7d5dbc4d76e
2016-02-11 10:01:45 +02:00
Noel Grandin e755ac76e0 rename Back2Delemitter->Back2Delimiter
Change-Id: I8e4cf6fa936bc94db3f8a865731d00878354ad99
2016-02-11 10:01:45 +02:00
Noel Grandin ae7f6dc8af use WriteOString to reduce the code a little
Change-Id: I5378478500a18b2d7156b7047867bc53f6513b45
2016-02-11 10:01:45 +02:00
Noel Grandin 8bbcbcec91 simplify SvSlotElement
Change-Id: I4699dca35c0197944df97005ff032e1d16139e5f
2016-02-09 09:43:53 +02:00
Noel Grandin 8d6e4896d9 simplify SvClassElement
no need for it to be ref-counted

Change-Id: I663266c9f59930b1f5bc53f1f27b594dbbc08b46
2016-02-09 09:43:52 +02:00
Noel Grandin 7a6c044e97 split MetaTypeType::Class into Interface and Shell
Change-Id: Id405be797d516e3e608044a375c40b2138c89aa3
2016-02-09 08:16:26 +02:00
Noel Grandin c4f056c01b disambiguate the two GetType methods
Change-Id: I922af3a2ebe8cdaa6465542a5d6de365e1bc6dff
2016-02-08 14:00:39 +02:00
Noel Grandin d61b45016e SvString is a just thin wrapper around OString
eliminate it

Change-Id: Icb91d25cc7bffb3060b9392f71d37e5a95844aa3
2016-02-08 14:00:38 +02:00
Noel Grandin 0b7337bfa0 remove some dead code, found using LCOV
Change-Id: Ibdca0a70722290bbb560726c88e9821c3ae0af14
Reviewed-on: https://gerrit.libreoffice.org/22151
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
Tested-by: Noel Grandin <noelgrandin@gmail.com>
2016-02-07 06:54:39 +00:00
Noel Grandin e90f4e18fd convert TYPE_ enum to scoped
Change-Id: I514cf8591d8e7b3ff26bafba8fdbac2ad26249b8
Reviewed-on: https://gerrit.libreoffice.org/22150
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
2016-02-07 06:53:43 +00:00
Noel Grandin 8beb3e713f .SDI compiler: expand out some typedefs
Change-Id: I898bc1d95b1d3394cae74776c0e7dcbaafa934e4
Reviewed-on: https://gerrit.libreoffice.org/22146
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
Tested-by: Noel Grandin <noelgrandin@gmail.com>
2016-02-07 06:50:41 +00:00
Noel Grandin fd97858e1a remove unused Automation from .SDI files
Change-Id: I65e1ca6e022dc76ac96ed75da2c5e78e9356a3e9
Reviewed-on: https://gerrit.libreoffice.org/22107
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
2016-02-05 05:59:17 +00:00
Stephan Bergmann 6c1cab5680 Missing include
Change-Id: Icba84b4921cdb7c4a9e88975ec98dddc91e9f79b
2016-01-06 07:52:56 +01:00
Oliver Specht fa91dd31f3 5th step to remove tools/rtti.hxx
tools/rtti.hxx removed
completed the interface of some Sdr.*  Items
and removed pseudo items

Change-Id: I0cdcd01494be35b97a27d5985aa908affa96048a
Reviewed-on: https://gerrit.libreoffice.org/19837
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Oliver Specht <oliver.specht@cib.de>
2015-11-11 10:49:30 +00:00