summaryrefslogtreecommitdiff
path: root/include
AgeCommit message (Collapse)Author
2021-10-23Fix typosAndrea Gelmini
Change-Id: Iaba882b1bd000a068cfaa207c743be038d5db434 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/124087 Tested-by: Jenkins Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2021-10-23Prefix just nDataRowHeight in brwbox so we can fix a typoJulien Nabet
The other variable members should also be prefixed but I don't have an IDE to do it easily Change-Id: Ifce210a4de89ed4d7f05126e33555da231553283 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/124089 Tested-by: Jenkins Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2021-10-22qt: Adapt log area: "vcl.qt5" -> "vcl.qt"Michael Weghorn
And also: "vcl.opengl.qt5" -> "vcl.opengl.qt" Change-Id: I86f8a34cb8c1303a81ffbf40c801ba628f3fa0d4 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/124065 Tested-by: Jenkins Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
2021-10-22Rename SystemEnvData::Toolkit::{Qt5 -> Qt}Michael Weghorn
It's used for the qt6 VCL plugin as well. Change-Id: I3f57258c2c8e3c12532d79b44f24105a30590675 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/124064 Tested-by: Jenkins Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
2021-10-22LOK: maintain blocked command list per viewPranam Lashkari
Conflicts: include/LibreOfficeKit/LibreOfficeKitEnums.h include/sfx2/viewsh.hxx libreofficekit/source/gtk/lokdocview.cxx sfx2/source/view/viewsh.cxx Change-Id: I7c621accd84f49447ab3e08a4bb662a9b91b834a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/124049 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2021-10-22LOK: unify freemium APIs and uno command restriction APIsPranam Lashkari
Conflicts: include/LibreOfficeKit/LibreOfficeKit.hxx sfx2/source/control/unoctitm.cxx Change-Id: I3badb038822331ab5cb30df6a66ce9a0640cf340 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/124047 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2021-10-22properly flush LOK invalidations in testsLuboš Luňák
This should be done always before doing something with a flag related to the invalidations. Use an idle timer for simplicity, tests already usually process to idle. Change-Id: I979900da28061cc690ecbcce023dbb769239f205 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/124003 Tested-by: Jenkins Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
2021-10-22better name for a function overloadLuboš Luňák
It's better to add to the name what the overload does rather than just have a "mysterious" extra int. Change-Id: Iff89679c4a978a4596ac662ef74e934cdefefc9e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/124001 Tested-by: Jenkins Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
2021-10-22revert unittests to use plain text-based LibreOfficeKitCallbackLuboš Luňák
At least for now it seems that the more complex SfxLokCallbackInterface is just an unnecessary complication for unit tests. The performance doesn't matter, and handling all the specialized callbacks makes things more complicated. In the future it'd be also useful to make the tests (optionally?) use also CallbackFlushHandler as the provider of the messages, in order to test CallbackFlushHandler more thoroughly, so perhaps in the end it makes more sense to keep unit tests using the plain text interface. This reverts unittest-related parts of 3b729db05553c1a6d461fb41c89 and adds a smaller wrapper callback class that converts messages from SfxLokCallbackInterface to LibreOfficeKitCallback format. Change-Id: I6c14f0be4ed7b777444b131140be54188d309cca Reviewed-on: https://gerrit.libreoffice.org/c/core/+/124000 Tested-by: Jenkins Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
2021-10-22LOK: introduce way to restrict uno commandsPranam Lashkari
With this new API we can define which uno commands to restrict their functionality Conflicts: desktop/qa/desktop_lib/test_desktop_lib.cxx include/LibreOfficeKit/LibreOfficeKit.h include/LibreOfficeKit/LibreOfficeKit.hxx include/sfx2/viewsh.hxx Change-Id: I9f3fd659d373e56542c5323922a53564f1cfb27b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/124046 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2021-10-22return weld::Builder by unique_ptrNoel Grandin
Change-Id: Ifa4f5951d200eaad6c8aebd3f29eed053c927ff0 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/124051 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-10-22Optimize assignment from OUStringLiteral to OUStringStephan Bergmann
...by making the OUString's pData point to the OUStringLiteral, instead of copying the contained characters. This is one of the improvements that had not been done as part of e6dfaf9f44f9939abc338c83b3024108431d0f69 "Turn OUStringLiteral into a consteval'ed, static-refcound rtl_uString": "To keep individual commits reasonably manageable, some consumers of OUStringLiteral in rtl/ustrbuf.hxx and rtl/ustring.hxx are left in a somewhat odd state for now, where they don't take advantage of OUStringLiteral's equivalence to rtl_uString, but just keep extracting its contents and copy it elsewhere. In follow-up commits, those consumers should be changed appropriately, making them treat OUStringLiteral like an rtl_uString or dropping the OUStringLiteral overload in favor of an existing (and cheap to use now) OUString overload, etc." (Simply dropping the OUStringLiteral overload was not possible in this case, though, as that would have lead to ambiguities among the various OUString and std::u16string_view overloads.) The now-deleted OUStringLiteral rvalue reference overload means that some existing assignments from ternary-operator OUStringLiteral<N> to OUString no longer compile and had to be replaced with uses of std::u16string_view. Those had not already been replaced in e6dfaf9f44f9939abc338c83b3024108431d0f69 because they happened to use OUStringLiteral instances of identical length N in both arms of the ternary operator, so did not already start to fail to compile back then. Change-Id: I328e25b8324d045774e811d20a639f40d6a9a960 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/124040 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2021-10-20svx: Don't end text edit mode for all viewsTomaž Vajngerl
This allows multiple views to not disturb each other editing inside a impress document. With the ending of text edit for all views still enabled, one view can cancel other views text editing just by moving or resizing a unrelated shape in the document. To make this possible we also need a view-local undo manager for the text edit mode, which is independent of the document undo manager. When the text edit mode ends, all the changes will be added as one change to the document undo stack. This prevents any conflicts in the undo stack that could be made when 2 views are editing the same document at the same time. This also adds the test for the new use case and changes the existing tests to reflect the change. Change-Id: I04edb4f91d7e111a490c946f7121cbca75f818d7 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123220 Tested-by: Tomaž Vajngerl <quikee@gmail.com> Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2021-10-19Related: tdf#145173 Add English (Israel) {en-IL} 0xB409 to language listEike Rathke
Change-Id: I0c1d89a8869e3788f18851ae004bac24275923b5 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123829 Reviewed-by: Eike Rathke <erack@redhat.com> Tested-by: Jenkins
2021-10-19Remove a std::remove_reference_tStephan Bergmann
...which is unnecessary (short of dubious explicit invocations like `makePropertyValue<int const &>(i)`) as T can never be deduced to be a reference type there. And add some test code (that also tests the bit-field scenario mentioned in the commit message of 23cded985ba0131f85ee445492c04871fbfb6351 "Specialize comphelper::makePropertyValue for arithmetic types"). Change-Id: If41ce20ab643041dd9721d05373eeb32fd099ead Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123805 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2021-10-19Ditch that CharClass constructing ToLower() nonsenseEike Rathke
... and use SvtSysLocale CharClass instead. Change-Id: I300c3e8ffb1502ef4303cba859dc0b8311be54ab Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123788 Reviewed-by: Eike Rathke <erack@redhat.com> Tested-by: Jenkins
2021-10-19tdf#113512 Writer: 1.15 line spacing UNO commandJim Raykowski
Resolves the Writer 1.15 line spacing part of the request for 1.15, 2.5, and 3 line spacing UNO commands. Change-Id: I2a654063df3549e8a23021bc4fc76bc17c270d69 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123569 Tested-by: Jenkins Reviewed-by: Heiko Tietze <heiko.tietze@documentfoundation.org>
2021-10-18Introduce MsLangId::getConfiguredSystemLanguage()Eike Rathke
To be used instead of getSystemLanguage() in a subsequent change. For details see commit summary of commit aec5312ffab24236876693d7a8b55843847f2a48 CommitDate: Mon Oct 18 21:14:24 2021 +0200 Related: tdf#145173 Ensure known supported system and default document locale Change-Id: I5bed125e47c2a03fe2e7a4f84988b2e8841143c1 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123766 Reviewed-by: Eike Rathke <erack@redhat.com> Tested-by: Jenkins
2021-10-18vcl: test OutputDevice::DrawPolyPolygon()Chris Sherlock
Change-Id: I166f715489ecff3095ccfb485153629050bfca20 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/122977 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2021-10-18sw: avoid popup window for the EmbeddedObject property of an UNO OLE objectMiklos Vajna
The old behavior was that in case loading the native data of the embedded object failed, then we presented a popup to the user, but we still returned a valid com.sun.star.comp.embed.OCommonEmbeddedObject. Given that the return valid is desired even in the error case, don't turn the error popup into an UNO exception, rather redirect the popup to SAL_WARN(). This is meant to be consistent with other UNO API functions that pass down an "is API" boolean to internal code to control if interactive behavior is allowed or not. One extreme would be to do this only for the EmbeddedObject property of frames, the other one would be to do this for more object types. Go with a middle ground for now, so all properties of Writer frame objects use this, but leave other object types unchanged. Change-Id: I655fcb3780e96cecc7ed3f01ded52948d013172e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123752 Reviewed-by: Miklos Vajna <vmiklos@collabora.com> Tested-by: Jenkins
2021-10-17Specialize comphelper::makePropertyValue for arithmetic typesMike Kaganski
This allows to pass e.g. bit fields to the function, like struct Foo { bool b : 1; }; Foo foo {true}; comphelper::makePropertyValue("foo", foo.b); Change-Id: I8f725d0101d90fb8b6012375c085918d1cadc6f1 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123639 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2021-10-17Simplify comphelper::makePropertyValueMike Kaganski
Avoid default-constructing members that get immediately re-defined. Change-Id: Ib863745577983582c80e1b172060ba20ce6135a8 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123638 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2021-10-17Simplify Sequences in xmloff (+ merge 2 SetError)Julien Nabet
Change-Id: If4055bbeb858b1b87ecb3f8c0b87da4b008e3c16 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123716 Tested-by: Jenkins Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2021-10-16Use sal::systools::COMReference and drop ComSmartMike Kaganski
Change-Id: Ic6e0c87f607264629cdec1fdcd0c3144d8fbf8e6 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123695 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2021-10-15Correctly use swap customization point in generic code (for pre C++20)Stephan Bergmann
(see <http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2015/n4381.html> "Suggested Design for Customization Points") Change-Id: If641ce84b1114fbe4e9819ebf4d958130301dc13 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123626 Reviewed-by: Dennis Francis <dennis.francis@collabora.com> Reviewed-by: Stephan Bergmann <sbergman@redhat.com> Tested-by: Jenkins
2021-10-15delay, collect and compress LOK invalidations for Writer viewsLuboš Luňák
Due the to way views are updated on any document change, invalidations are at least O(n^2), and since LOK may use a number of views and for each view the entire document is considered to be the view area, this can lead to a huge number of invalidations that are mostly the same repeated rectangles. Change-Id: I63682958d2fc388344641dcd19fa1d2b39054b51 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123617 Tested-by: Jenkins Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
2021-10-15do not use text-based LOK callback internallyLuboš Luňák
CallbackFlushHandler post-processes LOK messages, but for things like dropping useless invalidations it needs to know the rectangle or the view id, and since the only data it gets are string messages, it needs to convert those back to binary form. Which is slow with large numbers of messages. Add internal LOK callback variant that allows also passing specific data in the original binary form. And then use directly the binary data in CallbackFlushHandler. Change-Id: I8dd30d2ff9c09feadebc31a44d8e6a8ccc306504 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123589 Tested-by: Jenkins Reviewed-by: Michael Meeks <michael.meeks@collabora.com>
2021-10-15vcl: test OutputDevice::DrawPolygon()Chris Sherlock
Change-Id: Ic295a5ef471d1cbb05bddbc0a3757feebc9a17f4 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/122976 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2021-10-15Remove non-const Sequence::begin()/end() in internal codeMike Kaganski
... to avoid hidden cost of multiple COW checks, because they call getArray() internally. This obsoletes [loplugin:sequenceloop]. Also rename toNonConstRange to asNonConstRange, to reflect that the result is a view of the sequence, not an independent object. TODO: also drop non-const operator[], but introduce operator[] in SequenceRange. Change-Id: Idd5fd7a3400fe65274d2a6343025e2ef8911635d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123518 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com> Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2021-10-14use std::vector::insert instead of push_backNoel Grandin
because it will pre-allocate space and often is optimised to memcpy Change-Id: I03ed7915f2762d3d27e378638052a47a28bbf096 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123588 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-10-14[API CHANGE] Fix all bad UNOIDL identifiers across offapiStephan Bergmann
Identifiers containing underscores must start with an uppercase letter. (So that the UNO implementation can use identifiers containing underscores and starting with a lowercase letter for internal purposes, see e.g. the static_type member functions in the C++ *.hdl files. idlc checks that with the -cid option, while unoidl-write silently allows bad identifiers for now, see the TODO in unoidl/source/sourceprovider-scanner.l, which can be dropped after this change.) All of the affected identifiers were present since early OOo times, but none of them appear to be used much, at least not across LO itself, so there is hope that we can get away with these incompatible changes. (For the constant group members, we could roll this out in two steps, introducing the new members alongside the old ones and deprecating the old ones in a first step, then removing the old, deprecated ones in a second step, so that third-party code would have more time to adapt. But that would not work for the enum members and interface methods, so just do all of this in one breaking step.) udkapi happened to not contain any bad identifiers. Change-Id: If2d4c16563606f9efb48b937c76af54746377428 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/121725 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2021-10-14Use more appropriate return type for some editeng functionsStephan Bergmann
...whose return values are OUString-length related: * ContentNode::GetExpandedLen from sal_uLong to sal_Int32 * EditDoc::GetTextLen from sal_uLong to sal_Int32 * EditEngine::GetTextLen from sal_uInt32 to sal_Int32 Change-Id: Ia5156e247906728e2130b321af15cda7669108ec Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123576 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2021-10-14Simplify JsonWriter a bitMike Kaganski
Move ensureSpace code to json_writer.cxx, and merge with reallocBuffer. The methods are private, and are only used in methods in the same .CXX, so the code will get inlined as compiler decides anyway, but becomes simpler. Make extractDataAs* to consider the known size of the data, to avoid calculating null-terminated size. To do that, the code is moved from extractData to private extractDataImpl, which returns both pointer and size. Change-Id: I7c0e425b5c584089c6e866c31d4cfdb5e242d66b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123568 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2021-10-14Avoid COW overhead using css::uno::SequenceMike Kaganski
The scenarios are: 1. Calling sequence's begin() and end() in pairs to pass to algorithms (both calls use getArray(), which does the COW checks) 2. In addition to #1, calling end() again when checking result of find algorithms, and/or begin() to calculate result's distance 3. Using non-const sequences in range-based for loops, which internally do #1 4. Assigning sequence to another sequence variable, and then modifying one of them In many cases, the sequences could be made const, or treated as const for the purposes of the algorithms (using std::as_const, std::cbegin, and std::cend). Where algorithm modifies the sequence, it was changed to only call getArray() once. For that, css::uno::toNonConstRange was introduced, which returns a struct (sublclass of std::pair) with two iterators [begin, end], that are calculated using one call to begin() and one call to getLength(). To handle #4, css::uno::Sequence::swap was introduced, that swaps the internal pointer to uno_Sequence. So when a local Sequence variable should be assigned to another variable, and the latter will be modified further, it's now possible to use swap instead, so the two sequences are kept independent. The modified places were found by temporarily removing non-const end(). Change-Id: I8fe2787f200eecb70744e8b77fbdf7a49653f628 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123542 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2021-10-13fix (cppunit test) build with --enable-mergelibs againRene Engelhard
=/home/rene/LibreOffice/git/master && I=$S/instdir && W=$S/workdir && /usr/bin/ccache x86_64-linux-gnu-g++ -pthread -shared -Wl,-z,noexecstack -flto=4 -fuse-linker-plugin -O2 -Wl,-z,origin '-Wl,-rpath,$ORIGIN/../Library' -Wl,-rpath-link,$I/program -Wl,-z,defs -Wl,-rpath-link,/lib:/usr/lib -Wl,-z,combreloc -Wl,--hash-style=gnu -Wl,-Bsymbolic-functions -L$W/LinkTarget/StaticLibrary -L$I/sdk/lib -L$I/program -L$I/program -L$W/LinkTarget/Library -Wl,-z,relro $W/CxxObject/vcl/qa/api/XGraphicTest.o -Wl,--start-group -lcppunit -Wl,--end-group -Wl,--no-as-needed -lmergedlo -luno_cppu -luno_cppuhelpergcc3 -luno_sal -ltest -lunotest -o $W/LinkTarget/CppunitTest/libtest_vcl_apitests.so /usr/bin/ld: /tmp/cc9oq9Pr.ltrans2.ltrans.o: in function `VclOutdevTest::testDrawPolyLine()': <artificial>:(.text+0x9e91): undefined reference to `typeinfo for MetaPolyLineAction' /usr/bin/ld: <artificial>:(.text+0xa115): undefined reference to `typeinfo for MetaPolyLineAction' /usr/bin/ld: <artificial>:(.text+0xa824): undefined reference to `typeinfo for MetaPolyLineAction' collect2: error: ld returned 1 exit status make[4]: *** [/home/rene/LibreOffice/git/master/solenv/gbuild/LinkTarget.mk:799: /home/rene/LibreOffice/git/master/workdir/LinkTarget/CppunitTest/libtest_vcl_outdev.so] Error 1 make[4]: *** Waiting for unfinished jobs.... Change-Id: I0c22c2b2786660060e39fb272396a6d9af20433f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123530 Reviewed-by: Tomaž Vajngerl <quikee@gmail.com> Tested-by: Tomaž Vajngerl <quikee@gmail.com>
2021-10-13Unify JsonWriter::put and putRaw a bitMike Kaganski
In the process, it turned out that there was unnecessary conversion of OStringBuffer to OString and back to OStringBuffer when using putRaw, which is avoided now. Change-Id: I1e3ee685679df0b025bee8f4430624ee5bc9ccb3 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123547 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2021-10-13tdf#144642 XLSX import: round down row height to 0.75 ptAttila Szűcs
like table layout of MSO does, e.g. 20 pt to 19.5 pt. Changing table row height is only for interoperability. To avoid of regressions, apply this workaround only for documents created in MSO. Note: likely this is an old adjustment for low-resolution monitors, where 0.75 is the factor between 96 ppi of Windows resolution and (originally) 72 ppi of monitor resolutions. Co-authored-by: Tibor Nagy (NISZ) Change-Id: Ie1e2c781d21174a877b18cd3250eb445222bd1c4 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/122428 Tested-by: László Németh <nemeth@numbertext.org> Reviewed-by: László Németh <nemeth@numbertext.org>
2021-10-12loplugin:unusedmethodsNoel Grandin
Change-Id: Ifd3a1ccef68ebc4cd4e7785357e6a476f6669eb8 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123456 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-10-12loplugin:unusedfieldsNoel Grandin
Change-Id: I5e9bb4417cf6f8e3c1de1c8570e0635fdf6364bc Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123453 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-10-12Revert "Use placement new to avoid one of the allocation calls..."Stephan Bergmann
This reverts commit 503ab1ca9ae11978d9717557546c01ff598aaf88, plus follow-up 17915ab5202a4d7456e9bc031c3f6a72bc861844 "fix ubsan alloc-dealloc-mismatch". It failed to properly destroy the object assembly, and caused e.g. CppunitTest_svl_items to fail with > ==850754==ERROR: AddressSanitizer: new-delete-type-mismatch on 0x6060000024e0 in thread T0: > object passed to delete has wrong type: > size of the allocated type: 64 bytes; > size of the deallocated type: 56 bytes. > #0 in operator delete(void*, unsigned long) at /home/sbergman/github.com/llvm/llvm-project/compiler-rt/lib/asan/asan_new_delete.cpp:164:3 (workdir/LinkTarget/Executable/cppunittester +0x330ae2) > #1 in SfxItemSet::~SfxItemSet() at svl/source/items/itemset.cxx:202:1 (instdir/program/libsvllo.so +0x110ccf6) > #2 in std::default_delete<SfxItemSet>::operator()(SfxItemSet*) const at /home/sbergman/gcc/trunk/inst/lib/gcc/x86_64-pc-linux-gnu/12.0.0/../../../../include/c++/12.0.0/bits/unique_ptr.h:85:2 (instdir/program/libsvllo.so +0x1142a28) > #3 in std::_Sp_counted_deleter<SfxItemSet*, std::default_delete<SfxItemSet>, std::allocator<void>, (__gnu_cxx::_Lock_policy)2>::_M_dispose() at /home/sbergman/gcc/trunk/inst/lib/gcc/x86_64-pc-linux-gnu/12.0.0/../../../../include/c++/12.0.0/bits/shared_ptr_base.h:442:9 (instdir/program/libsvllo.so +0x12696e4) > #4 in std::_Sp_counted_base<(__gnu_cxx::_Lock_policy)2>::_M_release() at /home/sbergman/gcc/trunk/inst/lib/gcc/x86_64-pc-linux-gnu/12.0.0/../../../../include/c++/12.0.0/bits/shared_ptr_base.h:168:6 (instdir/program/libsvllo.so +0xe500b5) [...] > 0x6060000024e0 is located 0 bytes inside of 64-byte region [0x6060000024e0,0x606000002520) > allocated by thread T0 here: > #0 in operator new(unsigned long) at /home/sbergman/github.com/llvm/llvm-project/compiler-rt/lib/asan/asan_new_delete.cpp:95:3 (workdir/LinkTarget/Executable/cppunittester +0x32fe7d) > #1 in SfxItemSet::Clone(bool, SfxItemPool*) const at svl/source/items/itemset.cxx:1270:34 (instdir/program/libsvllo.so +0x1127854) > #2 in (anonymous namespace)::Node::setItemSet(SfxItemSet const&) at svl/source/items/stylepool.cxx:65:107 (instdir/program/libsvllo.so +0x1212179) > #3 in StylePoolImpl::insertItemSet(SfxItemSet const&, rtl::OUString const*) at svl/source/items/stylepool.cxx:417:19 (instdir/program/libsvllo.so +0x12103e1) > #4 in StylePool::insertItemSet(SfxItemSet const&, rtl::OUString const*) at svl/source/items/stylepool.cxx:456:17 (instdir/program/libsvllo.so +0x1212ffb) [...] in Clang ASan builds done with -fsized-deallocation. Change-Id: I3ccba7e7d9712ecabf38a0149252d3cd70cdb446 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123446 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2021-10-12Don't #include within extern "C"Stephan Bergmann
At least when building against trunk libstdc++ on Fedora 35 beta now, that caused failures like > In file included from ~/lo/core/libreofficekit/qa/unit/checkapi.cxx:18: > In file included from ~/lo/core/workdir/UnpackedTarball/cppunit/include/cppunit/plugin/TestPlugIn.h:8: > In file included from ~/lo/core/workdir/UnpackedTarball/cppunit/include/cppunit/plugin/PlugInParameters.h:8: > In file included from ~/gcc/trunk/inst/lib/gcc/x86_64-pc-linux-gnu/12.0.0/../../../../include/c++/12.0.0/deque:70: > In file included from ~/gcc/trunk/inst/lib/gcc/x86_64-pc-linux-gnu/12.0.0/../../../../include/c++/12.0.0/debug/deque:40: > In file included from ~/gcc/trunk/inst/lib/gcc/x86_64-pc-linux-gnu/12.0.0/../../../../include/c++/12.0.0/debug/safe_sequence.h:35: > In file included from ~/gcc/trunk/inst/lib/gcc/x86_64-pc-linux-gnu/12.0.0/../../../../include/c++/12.0.0/debug/safe_base.h:32: > In file included from ~/gcc/trunk/inst/lib/gcc/x86_64-pc-linux-gnu/12.0.0/../../../../include/c++/12.0.0/ext/concurrence.h:34: > ~/gcc/trunk/inst/lib/gcc/x86_64-pc-linux-gnu/12.0.0/../../../../include/c++/12.0.0/exception:83:8: error: declaration of 'terminate' has a different language linkage > void terminate() _GLIBCXX_USE_NOEXCEPT __attribute__ ((__noreturn__)); > ^ > ~/gcc/trunk/inst/lib/gcc/x86_64-pc-linux-gnu/12.0.0/../../../../include/c++/12.0.0/x86_64-pc-linux-gnu/bits/c++config.h:302:10: note: previous declaration is here > void terminate() _GLIBCXX_USE_NOEXCEPT __attribute__ ((__noreturn__)); > ^ Change-Id: I81cf87d13c16fd10ce3e2435509ab462852fce2f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123447 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2021-10-12loplugin:moveparam in variousNoel Grandin
Change-Id: Ifa7c8ff2b21f63d234c29c28303d0bacd376c1e5 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123434 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-10-11Related: tdf#145033 don't print "There is no implementation..." warningCaolán McNamara
don't output "There is no implementation for QueryValue for this item!" for SfxObjectItem Change-Id: Ib4b944efa7e9d152d662ed447d8c02ec24d58391 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123392 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2021-10-11loplugin:moveparam in sfx2Noel Grandin
Change-Id: I5408e47d6e2179bc34170c1728aa16e327ffbe56 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123380 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-10-11In O[U]StringBuffer, make string_view params replacements for OUString onesStephan Bergmann
...for LIBO_INTERNAL_ONLY, instead of having them as additional overloads. That way, loplugin:bufferadd and loplugin:stringviewparam found many further opportunities for simplification (all addressed here). Some notes: * There is no longer an implicit conversion from O[U]String to O[U]StringBuffer (as that goes via user-defined conversions through string_view now), which was most noticeable in copy initializations like OStringBuffer buf = someStr; that had to be changed to direct initialization, OStringBuffer buf(someStr); But then again, it wasn't too many places that were affected and I think we can live with that. * I made the O[U]StringBuffer ctors taking string_view non-explicit, mainly to get them in line with their counterparts taking O[U]String. * I added an OUStringBuffer::lastIndexOf string_view overload that was missing (relative to OUStringBuffer::indexOf). * loplugin:stringconstant needed some addition to keep the compilerplugins/clang/test/stringconstant.cxx checks related to OStringBuffer::append and OStringBuffer::insert working. * loplugin:stringviewparam no longer needs the special O[U]StringBuffer-related code that had been introduced in 1250aecd71fabde4dba990bfceb61bbe8e06b8ea "loplugin:stringviewparam extend to new.." Change-Id: Ib1bb8c4632d99b744e742605a9fef6eae959fd72 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/122904 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2021-10-11loplugin:moveparam in formulaNoel Grandin
Change-Id: I358f5e8031c235be76bb96591bf33f59a39b00ba Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123350 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-10-11loplugin:moveparam in unoidlNoel Grandin
Change-Id: Id3069cad0b118b5593bb7a0faa9d7e33e5bef168 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123353 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-10-11fix MSVC mergelibs buildLuboš Luňák
Linker complains about duplicate symbols for the template, seems to be a case of https://codesynthesis.com/~boris/blog/2010/01/18/dll-export-cxx-templates/ Change-Id: Iaffa3ba55edf4e54c62757c64d6b340b55a514cb Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123362 Tested-by: Jenkins Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
2021-10-11loplugin:moveparam in unotoolsNoel Grandin
Change-Id: Idd014c93e2e85d2ffc7a2535a9c65cffc8a9d403 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123348 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-10-11Expand some defines and simplify loopsMike Kaganski
Change-Id: I5cbfa815fb2b3d92eac1959ece67160fae4cd556 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123170 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>