summaryrefslogtreecommitdiff
path: root/vbahelper
AgeCommit message (Collapse)AuthorFilesLines
2019-06-20Simplify Sequence iterations in vbahelperArkadiy Illarionov10-133/+64
Use range-based loops or replace with comphelper or STL functions Change-Id: I7613057ba7063e04ca39a654f8a15c0354694783 Reviewed-on: https://gerrit.libreoffice.org/74309 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-05-13fix wrong SET/QUERY flags passed to uno::ReferenceNoel Grandin7-26/+26
By creating deleted methods for the wrong calls. Avoids the compiler needing to construct a temporary Change-Id: I3b8c648d6bb22d22827bf74f21ea5a2a17fc0f6a Reviewed-on: https://gerrit.libreoffice.org/72103 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-05-09regenerate PCH headers for the 4 new levelsLuboš Luňák2-131/+32
Plus some build fixes triggered by this. Change-Id: I59b21def706598ceffd45ae5b1f0262ec9c1ad50 Reviewed-on: https://gerrit.libreoffice.org/71581 Tested-by: Jenkins Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
2019-05-02Use hasElements to check Sequence emptiness in [v-x]*Arkadiy Illarionov3-5/+5
Similar to clang-tidy readability-container-size-empty Change-Id: I71e7af4ac3043d8d40922e99f8a4798f0993294c Reviewed-on: https://gerrit.libreoffice.org/71603 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-04-28rename animate.hxx to animate/Animation.hxx, more changes followTomaž Vajngerl1-1/+1
This is the first step of refactoring Animation where it is needed to separate AnimationBitmap(s) from the Animation class, which is also responsible for displaying of animation. General idea is to make Graphic work only with AnimationBitmaps, which can be freely be swapped out and in, make copies - all transparantly from the actually displaying them and possibly it will also remove the need to copy the animation objects. Change-Id: If5d55ac1a5b26c3880d4f7602be57742b086f9da Reviewed-on: https://gerrit.libreoffice.org/71406 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2019-04-23Fix typoAndrea Gelmini1-1/+1
Change-Id: I9fa72190a843d1f229deec8dad7f8ef0d5dd5570 Reviewed-on: https://gerrit.libreoffice.org/71081 Tested-by: Jenkins Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2019-04-15loplugin:sequentialassign in ucb..vbahelperNoel Grandin5-17/+8
Change-Id: I0fff9ee06225d4ff2e9c0611b1b11f1d3b896be2 Reviewed-on: https://gerrit.libreoffice.org/70733 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-04-08tdf#42949 Fix IWYU warnings in include/sfx2/[t-z]*Gabor Kelemen1-0/+2
Found with bin/find-unneeded-includes Only removal proposals are dealt with here. Change-Id: Ib3252828385d1dc8faf48a428b1593199647a679 Reviewed-on: https://gerrit.libreoffice.org/70383 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2019-04-08improve combining in hash functionsNoel Grandin1-3/+6
specifically, use boost::hash_combine to combine values in hash functions, except for a couple of places where I use the small-prime-number strategy popular in the Java world, to avoid including boost in header files that are widely shared. Change-Id: I0e184c9ec8803bf09fc6e84fe20131b203e1652a Reviewed-on: https://gerrit.libreoffice.org/70384 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-04-02Add a few SAL_INFOsTor Lillqvist1-1/+7
Change-Id: Ibdb013f4eeee8a2b2e29e3adb56943b5fccf9772
2019-04-02Implement the FullName property correctly in the Automation caseTor Lillqvist1-0/+10
Return a complete pathname. For or internal Basic, keep the existing semantics, that for some reason returns just the filename. Change-Id: I897cc797ca2158ca7c798f3e8adcdfa57a41ee3b
2019-03-07tdf#123819: Revert "Use comphelper::getProcessComponentContext()"Tor Lillqvist1-3/+2
Even though in theory it was worse to get an exception and return an empty Any for CommandBars, in practice there are not resources to figure out why that change apparently then caused a crash in the customer application. Let's hope that it doesn't actually need the CommandBars object for anything essential. This reverts commit 87b4bd61792b28fe475c71d4484cd219c1e533ae. Change-Id: Id2ec3a7254c5dd5a36ce2d5e930a457b9abd44f1 Reviewed-on: https://gerrit.libreoffice.org/68881 Reviewed-by: Tor Lillqvist <tml@collabora.com> Tested-by: Tor Lillqvist <tml@collabora.com>
2019-03-07tdf#42949 Fix IWYU warnings in include/basic/*Gabor Kelemen2-0/+3
Found with bin/find-unneeded-includes Only removal proposals are dealt with here. Change-Id: I9dd7984affc4343f148c66077feaac19176adf51 Reviewed-on: https://gerrit.libreoffice.org/68769 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2019-03-02Use comphelper::getProcessComponentContext()Tor Lillqvist1-2/+4
The context in the mxContext member does not seem to be usable for what we need it for here. Using what comphelper::getProcessComponentContext() returns works better. Let's hope it has no unintended side-effects. This likely makes the mxContext member unused, but I did not bother removing it yet, to keep this commit minimal. Change-Id: Ic048683b066af7952e2e84b03ea306e7daaba259 Reviewed-on: https://gerrit.libreoffice.org/68592 Tested-by: Jenkins Reviewed-by: Tor Lillqvist <tml@collabora.com>
2019-03-02Use sal_Int32 for the index as it comes in as a LONG at least from VBScriptTor Lillqvist1-1/+1
Change-Id: If39054148f72211eae3c897675708aab58f425b2 Reviewed-on: https://gerrit.libreoffice.org/68593 Tested-by: Jenkins Reviewed-by: Tor Lillqvist <tml@collabora.com>
2019-02-25I did figure it outTor Lillqvist1-6/+0
Change-Id: Iabf2dd2daf9d079e7588a1175a2d1e763ccc1c64
2019-02-22loplugin:unusedfields in vbahelperNoel Grandin1-7/+4
Change-Id: I5b5820f236fa81a08faa8bd4d928ace2cc49cf25 Reviewed-on: https://gerrit.libreoffice.org/68157 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-02-15Add a FIXME noteTor Lillqvist1-0/+6
Change-Id: Iedda7ca9cff1bda763845e665e0e21656b253793
2019-02-13Pointer is pointlessNoel Grandin4-11/+8
since it is just a wrapper around PointerStyle Change-Id: I51f065e0d4ad8bd91f5c84c5819048c720a19267 Reviewed-on: https://gerrit.libreoffice.org/67711 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-02-11loplugin:indentation in unotools..vbahelperNoel Grandin8-33/+33
Change-Id: I76de5678dd21f207e9e9c2a0c446f2c0b9be974e Reviewed-on: https://gerrit.libreoffice.org/67609 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-02-08o3tl::make_unique -> std::make_unique in tools..xmloffGabor Kelemen1-2/+1
Since it is now possible to use C++14, it's time to replace the temporary solution with the standard one Change-Id: Ib3201f865d43f372007cdf381c7e244e9cbeae26 Reviewed-on: https://gerrit.libreoffice.org/67474 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2019-01-11Replace OUStringBuffer::appendCopy with append(std::u16string_view)Stephan Bergmann1-2/+3
...which is more general Change-Id: I94f28f8eda887120cf5f143b4549e0339b60e6a7 Reviewed-on: https://gerrit.libreoffice.org/66155 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2018-12-10tdf#42949 Fix IWYU warnings in include/vcl/s*Gabor Kelemen1-0/+1
Found with bin/find-unneeded-includes Only removal proposals are dealt with here. Change-Id: Ie87d27dd2c385a63349e0b322fd067ba03d2d152 Reviewed-on: https://gerrit.libreoffice.org/64479 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2018-12-05loplugin:unnecessaryparen include more assignmentsNoel Grandin2-2/+2
Change-Id: I9fb8366634b31230b732dd38a98f800075529714 Reviewed-on: https://gerrit.libreoffice.org/64510 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-11-29tdf#42949 Fix IWYU warnings in include/vcl/[i-m]*Gabor Kelemen1-0/+1
Found with bin/find-unneeded-includes Only removal proposals are dealt with here. Change-Id: If1b2e04872eb0dd6725802c1709a9085f4cd8c91 Reviewed-on: https://gerrit.libreoffice.org/64141 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2018-11-22improve function-local statics in vbahelperNoel Grandin33-186/+109
Change-Id: Id54660390baa337d8bd54a19924e138c2ccb0bc7 Reviewed-on: https://gerrit.libreoffice.org/63790 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-10-27tdf#120703 (PVS): V519 The variable is assigned values twice successivelyMike Kaganski1-2/+2
Change-Id: I9265425a215609ef6bf4298ba39c8399f215ce27 Reviewed-on: https://gerrit.libreoffice.org/62406 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2018-10-24clang-tidy performance-unnecessary-copy-init in test..xmlscriptNoel Grandin1-1/+1
Change-Id: I1ae16467a8e58e8a50f59b7a140e9f8b68bde07e Reviewed-on: https://gerrit.libreoffice.org/62254 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-10-19clang-tidy readability-misleading-indentationNoel Grandin1-2/+2
Change-Id: I4673fc7c694924b41d048a1918ddb8b0e0af1f79 Reviewed-on: https://gerrit.libreoffice.org/61935 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-10-15Simplify containers iterations in unotools, unoxml, uui, vbahelperArkadiy Illarionov3-14/+8
Use range-based loop or replace with STL functions. Change-Id: I5a43f6fc62c81453dcef3820bb715f4da76915af Reviewed-on: https://gerrit.libreoffice.org/61762 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-10-08tdf#42949 Fix IWYU warnings in include/comphelper/[m-z]*Gabor Kelemen1-0/+1
Found with bin/find-unneeded-includes Only removal proposals are dealt with here. Change-Id: I04c5ba277d5b3398c07de6ae66713d977636088d Reviewed-on: https://gerrit.libreoffice.org/61347 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
2018-10-04pass AbstractGeometryAttributes around by std::unique_ptrNoel Grandin33-70/+85
Change-Id: I6e06c89b5e4b77c8fc5e3e1a6bf7d76d8ebd7810 Reviewed-on: https://gerrit.libreoffice.org/61349 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-09-26loplugin:useuniqueptr in VbaApplicationBase_ImplNoel Grandin1-16/+2
Change-Id: I4ce3cba4a6f5cfec677550a4263bb3e4cc795c49 Reviewed-on: https://gerrit.libreoffice.org/60974 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-09-18loplugin:constfields in vbahelperNoel Grandin10-15/+15
Change-Id: I6121e2b41a5e6116be8027fe5197ce53d8f6797f Reviewed-on: https://gerrit.libreoffice.org/60562 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-09-17New loplugin:externalStephan Bergmann2-4/+4
...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-10tdf#42949 Fix IWYU warnings in include/cppuhelper/*Gabor Kelemen1-0/+1
Found with bin/find-unneeded-includes Only removal proposals are dealt with here. Change-Id: Ib420e9216b8313f5ed7634ec375e39ceb741fd45 Reviewed-on: https://gerrit.libreoffice.org/59297 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
2018-08-22new loplugin:conststringfieldNoel Grandin1-7/+7
Look for const string fields which can be static, and mostly convert them to OUStringLiteral And add a getLength() method to OUStringLiteral to make the transition easier. Remove dead code in XclExpRoot::GenerateDefaultEncryptionData, default password is never empty. Change-Id: Iae75514d9dbb87289fd5b016222f640abe755091 Reviewed-on: https://gerrit.libreoffice.org/59204 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-08-14create appendCopy method in OUStringBufferNoel Grandin1-2/+2
so we can avoid temporary copies when appending a substring of an OUString to the buffer. I would have preferred to call the method just "append" but that results in ambiguous method errors when the callsite is something like sal_Int32 n; OUStringBuffer s; s.append(n, 10); I'm not sure why Change-Id: I6b5b6641fcb5b26ce2269f89ef06e03c0b6aa76f Reviewed-on: https://gerrit.libreoffice.org/58666 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-08-02Add missing sal/log.hxx headersGabor Kelemen11-0/+11
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 6ff2d84ade299cb3d14d4110e4cf1a4b8070c030 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 test to vbahelper Change-Id: Ia7f773511624099505d6a36a8d6e23c0cde4a737 Reviewed-on: https://gerrit.libreoffice.org/58225 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
2018-07-29loplugin:stringloop in variousNoel Grandin1-2/+1
Change-Id: Ic2436c6d94729211cd5bc72fee18af228381e4a3 Reviewed-on: https://gerrit.libreoffice.org/58250 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-07-23Fix typosAndrea Gelmini1-1/+1
Change-Id: If6e6df9ac592c77f19e381e50b7eb26fbf429f61 Reviewed-on: https://gerrit.libreoffice.org/57831 Reviewed-by: Julien Nabet <serval2412@yahoo.fr> Tested-by: Jenkins
2018-06-08look for unnecessary calls to Reference::is() after an UNO_QUERY_THROWNoel Grandin1-19/+13
Since the previous call would throw if there was nothing to be assigned to the value. Idea from tml. Used the following script to find places: git grep -A3 -n UNO_QUERY_THROW | grep -B3 -F 'is()' Change-Id: I36ba7b00bcd014bdf16c0455ab91056f82194969 Reviewed-on: https://gerrit.libreoffice.org/55417 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Tor Lillqvist <tml@collabora.com> Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2018-06-05Also in getInteractive() we want to return true, not false, if no modelTor Lillqvist1-1/+1
Change-Id: I6b2d24792a16e934f7386c235b7d0cd78300b2b3 Reviewed-on: https://gerrit.libreoffice.org/55328 Reviewed-by: Michael Meeks <michael.meeks@collabora.com> Tested-by: Michael Meeks <michael.meeks@collabora.com>
2018-06-05We want screen updating when used from Automation with no current document yetTor Lillqvist1-1/+1
Change-Id: Iec831ef4b4bf47a58bc67b3beb924e75cd42434e Reviewed-on: https://gerrit.libreoffice.org/55327 Reviewed-by: Michael Meeks <michael.meeks@collabora.com> Tested-by: Michael Meeks <michael.meeks@collabora.com>
2018-06-05tdf#42949 remove unused compheler includes ..Jochen Nitschke2-3/+0
and fix the fallout Change-Id: I15bc5d626f4d157cbc69a87392078b41e621d14e Reviewed-on: https://gerrit.libreoffice.org/54882 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
2018-05-31Avoid a SolarMutex assertion failure in some use cases from AutomationTor Lillqvist1-1/+8
For instance when opening a Calc Document through ooo::vba::excel:: XWorkbooks::Open(). Instead just let the function return null. It does seem that callers are prepared for that. Change-Id: I7136133155f95a696b5ed3e661a9adb98396c9c5
2018-05-31Decrease fragility in odd use cases with no current document (yet)Tor Lillqvist1-1/+7
Especially, this happens when an Automation client wants to open a Calc document. Equivalent to the code for the same situation in getCurrentWordDoc(). Change-Id: I209a72dcae49f18cd265e0c6c2790618e1ebb4a1
2018-05-30Add Caption property to ooo::vba::XApplicationBaseTor Lillqvist1-0/+34
Implementation is just a dummy, though. At first I thought that it would work to get the XModel of the "current" document (as returned by getCurrentDocument()), and then get the XFrame of that, and then use the XFrame's getName() and setName(). But, it seems that getCurrentDocument() and what it calls is tightly coupled to StarBasic, and it doesn't do anything sane in the case of Automation clients. Change-Id: I74ded5114ecce06e72862f69d0c06d963e55fd75 Reviewed-on: https://gerrit.libreoffice.org/55064 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Tor Lillqvist <tml@collabora.com>
2018-05-30Add code to VbaApplicationBase::Quit() for the Automation client caseTor Lillqvist1-1/+13
Change-Id: I4354adf5353bdfb0b080b24a5c49e3d22539eb23 Reviewed-on: https://gerrit.libreoffice.org/55051 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Tor Lillqvist <tml@collabora.com>
2018-05-29Add missing includeSamuel Mehrbrodt1-0/+1
Change-Id: I0b3af7ac36631748c0d33afb6d06d19761af9c41 Reviewed-on: https://gerrit.libreoffice.org/54926 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de>