summaryrefslogtreecommitdiff
path: root/editeng
AgeCommit message (Collapse)AuthorFilesLines
2019-11-20Remove comphelper::OUStringLiteralListStephan Bergmann2-7/+10
...that had been introduced with 51eb969cb77f8b54681033f4959b15ce32116b56 "Replace comphelper::ServiceInfoHelper::addToSequence" and obsoleted by <https://gerrit.libreoffice.org/#/c/83291/> "loplugin:redundantfcast: Don't warn about cast from braced-init-list" Change-Id: Ic5bb63cf4f528285587f46437a27bafbb05a07ac Reviewed-on: https://gerrit.libreoffice.org/83315 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2019-11-19editeng: add UNO API for semi-transparent textMiklos Vajna1-2/+4
Keep the type internally as sal_uInt8, to be used as an alpha channel. Keep the type externally as sal_Int16, so it's consistent with the fill area transparency. Change-Id: I5138a6b73526f20a40f93df4cff4951e2b11bd6d Reviewed-on: https://gerrit.libreoffice.org/83179 Reviewed-by: Miklos Vajna <vmiklos@collabora.com> Tested-by: Jenkins
2019-11-19use FasterParser for LoadXMLExceptList_ImpNoel Grandin1-6/+3
the SvXMLImport superclass of XMLVersionListImport already constructs a parser, so we can just use that one Change-Id: I33b7f70982d78d2303a62cae40335f3c04b73579 Reviewed-on: https://gerrit.libreoffice.org/83083 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-11-18editeng: add doc model for semi-transparent textMiklos Vajna1-4/+34
tools Color can handle the alpha just fine, but add a separate member ID for transparency to be consistent with the existing border and fill color API. Change-Id: I8466da9fb40ab1d0c97b06a0594f89719ccc1959 Reviewed-on: https://gerrit.libreoffice.org/83116 Reviewed-by: Miklos Vajna <vmiklos@collabora.com> Tested-by: Jenkins
2019-11-18use FasterParser for SvxReadXMLNoel Grandin1-6/+2
the SvXMLImport superclass of XMLVersionListImport already constructs a parser, so we can just use that one Change-Id: I09d946a9d0e978582fbecc67c74cd1ae5c97178e Reviewed-on: https://gerrit.libreoffice.org/83076 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-11-17cid#1430104 Arguments in wrong orderCaolán McNamara1-0/+1
add an annotation Change-Id: I2e9356fa1d56e579336f1fb7346112edf576232f Reviewed-on: https://gerrit.libreoffice.org/83026 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2019-11-17Extend loplugin:external to warn about enumsStephan Bergmann2-0/+7
To mitigate the dangers of silently breaking ADL when moving enums into unnamed namespaces (see the commit message of 206b5b2661be37efdff3c6aedb6f248c4636be79 "New loplugin:external"), note all functions that are affected. (The plan is to extend loplugin:external further to also warn about classes and class templates, and the code to identify affected functions already takes that into account, so some parts of that code are not actually relevant for enums.) But it appears that none of the functions that are actually affected by the changes in this commit relied on being found through ADL, so no adaptions were necessary for them. (clang::DeclContext::collectAllContexts is non-const, which recursively means that External's Visit... functions must take non-const Decl*. Which required compilerplugins/clang/sharedvisitor/analyzer.cxx to be generalized to support such Visit... functions with non-const Decl* parameters.) Change-Id: Ia215291402bf850d43defdab3cff4db5b270d1bd Reviewed-on: https://gerrit.libreoffice.org/83001 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2019-11-16Replace comphelper::ServiceInfoHelper::addToSequenceMike Kaganski2-18/+20
Change-Id: I325e16fdf9bbbc6f2ba2d06c417da5eeb0d48023 Reviewed-on: https://gerrit.libreoffice.org/82975 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2019-11-15editeng: extend SvxColorItem xml dumpMiklos Vajna1-1/+6
Show the raw ARGB color as a value, and use the current "human-friendly string" only as a presentation. Change-Id: I4e17a44db967f1a4c7018b507d9e68058d988783 Reviewed-on: https://gerrit.libreoffice.org/82813 Reviewed-by: Miklos Vajna <vmiklos@collabora.com> Tested-by: Jenkins
2019-11-06make some classes module-privateNoel Grandin1-1/+1
Change-Id: I00ab3a3f6a8bbc85320e7b4fd1aa13af798e7e4c Reviewed-on: https://gerrit.libreoffice.org/82062 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-11-06loplugin:indentation find broken if statementsNoel Grandin2-2/+2
so I don't read the "then" block as being a sequential statements Change-Id: Ib2004acd3518bd4ebd2246f02a26c2c0a8bbab4c Reviewed-on: https://gerrit.libreoffice.org/82069 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-11-03size some stringbuffer to prevent re-allocNoel Grandin1-1/+1
I started with 32 and kept doubling the size until the site did not need re-alloc, but clamped it at 512. Change-Id: I55fe36b31cd3d40f86e5729337a927cf920f2af6 Reviewed-on: https://gerrit.libreoffice.org/81960 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-11-03loplugin:stringaddNoel Grandin1-4/+4
tweak the plugin to be more permissive, then validate by hand afterwards Change-Id: I40c5c911fe6ff7e45baaca372abf7dac211d9654 Reviewed-on: https://gerrit.libreoffice.org/81942 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-10-31avoid intermediate vcl::WindowsCaolán McNamara4-21/+15
Change-Id: Iac6bc83265e007a699a8993b89ac2efaa3739d95 Reviewed-on: https://gerrit.libreoffice.org/81761 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2019-10-29remove unnecessary includesCaolán McNamara3-3/+2
Change-Id: Ia4a622b34ff3f71963cff7a1aa8658a4df12f04f Reviewed-on: https://gerrit.libreoffice.org/81676 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2019-10-23loplugin:unusedfieldsNoel Grandin3-7/+3
Change-Id: I1f69ec45e7d44e45a6ece1fe9d9eef8a2be2d6ff Reviewed-on: https://gerrit.libreoffice.org/81361 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-10-23size some stringbuffer to prevent re-allocNoel Grandin2-2/+2
Change-Id: I385587a922c555c320a45dcc6d644315b72510e9 Reviewed-on: https://gerrit.libreoffice.org/81278 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-10-21loplugin:virtualdead unused param in EditEngine::FieldClickedNoel Grandin7-11/+9
Change-Id: Iffe075960308d5058cb7535e9216caa37aabe0c5 Reviewed-on: https://gerrit.libreoffice.org/81232 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-10-21loplugin:virtualdead unused param in UnknownAttrTokenNoel Grandin3-5/+5
Change-Id: Iccf88b919cfc40419271e6f18d101027ef2bb9df Reviewed-on: https://gerrit.libreoffice.org/81218 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-10-19Fix typo and dotsAndrea Gelmini1-1/+1
Change-Id: Ia34130dbab42d61074a73a2b16e03360b5b123b6 Reviewed-on: https://gerrit.libreoffice.org/81086 Reviewed-by: Julien Nabet <serval2412@yahoo.fr> Tested-by: Jenkins
2019-10-18make bin/update_pch.s always include code in trivial #if'sLuboš Luňák1-2/+12
E.g. #ifdef LIBO_INTERNAL_ONLY is always true for code that builds with our PCHs. Change-Id: I3cf311ea3621b909105754cfea2cb0116b8b67f5 Reviewed-on: https://gerrit.libreoffice.org/80961 Tested-by: Jenkins Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
2019-10-17Rename OUStringLiteral1 to OUStringCharStephan Bergmann9-13/+13
It started out as a wrapper around character literals, but has by now become a wrapper around arbitrary single characters. Besides updating the documentation, this change is a mechanical for i in $(git grep -Fl OUStringLiteral1); do sed -i -e s/OUStringLiteral1/OUStringChar/g "$i"; done Change-Id: I1b9eaa4b3fbc9025ce4a4bffea3db1c16188b76f Reviewed-on: https://gerrit.libreoffice.org/80892 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2019-10-16Resolves: tdf#127961 Add NBSP to quotation marks for all French except fr-CHEike Rathke1-12/+2
Change-Id: I71e8377bf44c2db5ef291d2990528ec16aaf3b44 Reviewed-on: https://gerrit.libreoffice.org/80909 Reviewed-by: Eike Rathke <erack@redhat.com> Tested-by: Jenkins
2019-10-16loplugin:bufferadd loosen some constraintsNoel Grandin1-4/+1
and extend O*StringView to have a constructor that takes a pointer and a length Change-Id: I6120e96280f030757e855a6596efdae438b7e1e8 Reviewed-on: https://gerrit.libreoffice.org/80872 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-10-16loplugin:stringadd look through a couple more known-good methodsNoel Grandin1-2/+2
Change-Id: Ifbdb3e41eae665f7dcaf5301aaba2b6e4662cf48 Reviewed-on: https://gerrit.libreoffice.org/80855 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-10-14loplugin:stringadd look for unnecessary temporariesNoel Grandin4-14/+14
which defeat the *StringConcat optimisation. Also make StringConcat conversions treat a nullptr as an empty string, to match the O*String(char*) constructors. Change-Id: If45f5b4b6a535c97bfeeacd9ec472a7603a52e5b Reviewed-on: https://gerrit.libreoffice.org/80724 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-10-11simplify "a = a +" to "a +="Noel Grandin5-46/+29
mostly so that my stringadd loplugin can point out places to improve Change-Id: I9920ee1c99cdb6b811ba67ff9d8e32aa261884b5 Reviewed-on: https://gerrit.libreoffice.org/80618 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-10-10convert WriteCharPtr..getStr to WriteOStringNoel Grandin1-4/+3
and improve the WriteOString method, we can avoid the strlen here, we already have the length One change in behaviour to be noted - if the string contains trailing zero bytes, which ARE INCLUDED IN THE STRING LENGTH, i.e. I'm not talking about the normal terminating zero, then this patch changes behaviour because we will now write those zeros to the stream. Change-Id: I4668b9b9eb877f820b1dc70d6cd10ba2623bc0a2 Reviewed-on: https://gerrit.libreoffice.org/80597 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-10-08tdf#128009: Allow spaces in AutoText suggestionsMike Kaganski1-10/+44
Currently autotext entries with long names starting with spaces, or containing spaces after first or second character, would never be suggested when SvxAutoCorrCfg::IsAutoTextTip() gives true (set in Tools -> AutoCorrect -> [x] Display remainder of name as suggestion while typing), because only a single word no less than 3 chars long left to cursor is considered a candidate for the name matching. This change allows to consider multiple chunks of text left to the cursor as the candidates for name matching. The chunks are 3-9 characters long, may start only between words, and have spaces, including leading. Thus, AutoText entries with long names like " Dr Foo" will now be suggested for an entry like "lorem dr f". Change-Id: If91c957341a4f4b281acb0e4ada558706ea2f8c1 Reviewed-on: https://gerrit.libreoffice.org/80392 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2019-10-08loplugin:redundantpointerops simplify *p.get()Noel Grandin9-38/+38
Change-Id: I12517651fb3f777fd08e384992bb3e84b340ad85 Reviewed-on: https://gerrit.libreoffice.org/80382 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-10-07InsertQuote can be constMike Kaganski1-1/+1
Change-Id: I57b50e72b68b71406d1745304d24b52d75b3d082 Reviewed-on: https://gerrit.libreoffice.org/80342 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2019-10-07enable -Wrange-loop-analysis on clangNoel Grandin1-2/+2
Change-Id: I2095308943c94ad16c110d5fac47715398eb5d39 Reviewed-on: https://gerrit.libreoffice.org/80187 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-10-06improve SfxPoolItem operator== implementationsNoel Grandin6-27/+6
(*) make them all call the superclass operator== (*) make the base class check which and typeid to ensure we are only comparing the safe subclasses together (*) remove a couple of operator== that were not doing anything useful Change-Id: Ia6234aed42df04157a5d6a323dc951916a9cb316 Reviewed-on: https://gerrit.libreoffice.org/80308 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-10-05Drop bogus memsetStephan Bergmann1-1/+0
...that is both bad and unnecessary since 76643b208c7f0c43b0603e08a3b37f29878c42ea "loplugin:useuniqueptr in SvxNumRule" changed SvxNumRule::aFmts from an array or raw pointers to an array of std::unique_ptr. Change-Id: I889da7973958d5546ded67be4f51f6312b240ea9 Reviewed-on: https://gerrit.libreoffice.org/80275 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2019-10-04SvxAutoCorrect::GetPrevAutoCorrWord should not be constMike Kaganski1-3/+2
Change-Id: Icc5f8eae4347e097f7ff22212dd94467d0702353 Reviewed-on: https://gerrit.libreoffice.org/80198 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2019-10-04loplugin:unusedfieldsNoel Grandin1-2/+0
Change-Id: If0df5216dccd2c0a7aa790668471993f5d4d5d32 Reviewed-on: https://gerrit.libreoffice.org/80183 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-10-01Avoid redundant IsAtEnd: NextItem returns nullptr iif iterator is at endMike Kaganski2-20/+14
To keep the check efficient, split NextItem to inline and Impl parts Change-Id: Id5877a3c5bed73aac9c39c655b106a715cf888ea Reviewed-on: https://gerrit.libreoffice.org/79894 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2019-09-29Move Rectangle,Point,Size serialization to GenericTypeSerializerTomaž Vajngerl1-3/+5
Change-Id: Iae489fc31b13b836e1df5327ba2fa07e0325907a Reviewed-on: https://gerrit.libreoffice.org/79793 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2019-09-29constmethod for accessor-type methodsNoel Grandin1-2/+2
Apply the constmethod plugin, but only to accessor-type methods, e.g. IsFoo(), GetBar(), etc, where we can be sure of that constifying is a reasonable thing to do. Change-Id: Ibc97f5f359a0992dd1ce2d66f0189f8a0a43d98a Reviewed-on: https://gerrit.libreoffice.org/74269 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-09-28loplugin:virtualdead in editengNoel Grandin3-20/+1
Change-Id: I72f9cf62f9daeaed5108ede41dd41544204a9745 Reviewed-on: https://gerrit.libreoffice.org/79643 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-09-26add property name when throwing css::uno::UnknownPropertyExceptionNoel Grandin2-7/+7
Change-Id: I17f06c9415b9d43b6d8896360e07216c2856367a Reviewed-on: https://gerrit.libreoffice.org/79627 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-09-26drop unnecessary includes and update pchCaolán McNamara1-0/+1
Change-Id: Id7fa7d5b95c32fdc738a18208eb95eaec102d937 Reviewed-on: https://gerrit.libreoffice.org/79523 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2019-09-26tdf#127748: crash on modify a frame style, which has writing-mode bt-lrJulien Nabet1-1/+2
bt here: https://bugs.documentfoundation.org/attachment.cgi?id=154474 Change-Id: I6e6e0927ea85c4f0f4f59bf327ce5468fc428328 Reviewed-on: https://gerrit.libreoffice.org/79572 Tested-by: Jenkins Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2019-09-24support O(U)String::number() for fast string concatenationLuboš Luňák1-5/+5
When I did the fast string concatenation, I didn't add any support for number(), which simply returned a O(U)String, and so it did the extra allocation/deallocation, although that could be avoided. In order to support this, number() now returns a special temporary return type, similarly to O(U)StringConcat, which allows delaying the concatenation the same way. Also similarly, the change of the return type in some cases requires explicit cast to the actual string type. Usage of OString::getStr() is so extensive in the codebase that I actually added it to the helper class, after that it's only relatively few cases. Change-Id: Iba6e158010e1e458089698c426803052b6f46031 Reviewed-on: https://gerrit.libreoffice.org/78873 Tested-by: Jenkins Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
2019-09-23do not require $(SRCDIR) in every gb_Library_set_precompiled_headerLuboš Luňák1-1/+1
Change-Id: I7b3a22584bb2e4d501f509ffcd80929feed23a4c Reviewed-on: https://gerrit.libreoffice.org/79360 Tested-by: Jenkins Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
2019-09-20tdf#109158 improve load time of autocorrect XML fileNoel Grandin1-0/+2
Before, it seems to be doing a lot of unnecessary work because, by default, startFastElement will call startUnknownElement, which constructs various objects, etc. It seems to me that if the class already implements createFastChildContext, it is already using XFastParser, and so it should implement startFastElement to avoid that work. By avoiding going down the startUnknownElement path, reduces load time from 1.7s to 1.4s Change-Id: Ifd745cf2cc22a8cb988a5668332cf6e70bb996da Reviewed-on: https://gerrit.libreoffice.org/79269 Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-09-20tdf#109158 improve sorting when loading large autocorrect fileNoel Grandin2-70/+81
reduces time from 2.0s to 1.7s reduce work by (*) reserving some arrays (*) pre-sorting with a cheaper comparator (*) don't copy when returning result, just return a const& (*) flattening the data-structures to reduce pointer-chasing Change-Id: I972bd7ffdbf2121c2d38c24aca9618ca708e920c Reviewed-on: https://gerrit.libreoffice.org/79119 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-09-06use unique_ptr in OutlinerNoel Grandin2-7/+7
Change-Id: I022cf01f2c36f8846227a89418735271880d1f95 Reviewed-on: https://gerrit.libreoffice.org/78715 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-09-06use unique_ptr in EditNodeIdxNoel Grandin2-6/+6
Change-Id: I59702aa3d54f60cb3e41410e82b0532bac05274f Reviewed-on: https://gerrit.libreoffice.org/78717 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-09-06TyposAndrea Gelmini9-19/+19
Mainly fixing '....' and '..' Change-Id: Ic928701b319868671b826d757dd94c296fd5e942 Reviewed-on: https://gerrit.libreoffice.org/78668 Reviewed-by: Julien Nabet <serval2412@yahoo.fr> Tested-by: Julien Nabet <serval2412@yahoo.fr>