summaryrefslogtreecommitdiff
path: root/vbahelper
AgeCommit message (Collapse)AuthorFilesLines
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>
2018-05-25Improve re-throwing of UNO exceptionsNoel Grandin1-2/+4
(*) if we are already throwing a Wrapped*Exception, get the exception using cppu::getCaughtexception. (*) when catching and then immediately throwing UNO exceptions, use cppu::getCaughtException to prevent exception slicing (*) if we are going to catch an exception and then immediately throw a RuntimeException, rather throw a WrappedTargetRuntimeException and preserve the original exception information. Change-Id: Ia7a501a50ae0e6f4d05186333c8517fdcb17d558 Reviewed-on: https://gerrit.libreoffice.org/54692 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-05-25Bin some ASCII graphicsTor Lillqvist1-6/+0
Change-Id: I53ef86a997f4ae1c0ad84bb381327cba3143dd4c
2018-05-22vbahelper, xmloff: Ask current datetime only onceTakeshi Abe1-5/+4
Change-Id: I930983fab11d30f0887965fe30b07c5ac6eef8ef Reviewed-on: https://gerrit.libreoffice.org/54651 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-05-17loplugin:unusedfields in tools..xmlhelpNoel Grandin1-4/+3
Change-Id: I5e909a8def86ce9ad150440e6c6ad304e855cc69 Reviewed-on: https://gerrit.libreoffice.org/54415 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-04-15remove some unused comphelper includesJochen Nitschke1-1/+0
and fix the fallout Change-Id: I5d0c2040f57a3ac354a7e277592da31d09a5f359 Reviewed-on: https://gerrit.libreoffice.org/52894 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Jochen Nitschke <j.nitschke+logerrit@ok.de>
2018-04-03pass area param to DBG_UNHANDLED_EXCEPTIONNoel Grandin1-1/+1
and update sallogareas plugin to enforce this Change-Id: Id0782c8a1f619372e10d931aec3c6a4743a4c86a Reviewed-on: https://gerrit.libreoffice.org/52249 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-04-01remove unused processfactory.hxx includesJochen Nitschke3-3/+0
and fix fallout Change-Id: Id06bf31f2075111e426ba40c84c885ae70697bee Reviewed-on: https://gerrit.libreoffice.org/52206 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Jochen Nitschke <j.nitschke+logerrit@ok.de>
2018-03-12loplugin:redundantfcast look for redundant copies in return statementsNoel Grandin1-1/+1
Change-Id: I5f416c865dfe1c36018784246a8007452eb42008 Reviewed-on: https://gerrit.libreoffice.org/50996 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-03-06use more Color in vbahelperNoel Grandin3-2/+3
Change-Id: I9d153b184a394ac21d504cb503731f8c5c8ec1de Reviewed-on: https://gerrit.libreoffice.org/50797 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-03-02delete colordata.hxxNoel Grandin1-1/+0
move what we still need into color.hxx Change-Id: Ied7e31eb16468aa334c666b1499a6262f16a6350 Reviewed-on: https://gerrit.libreoffice.org/50561 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-02-09Decrease fragility in odd use cases with no current documentTor Lillqvist2-3/+13
Change-Id: I9966166561d4c6e577f3f7e8e04572f97a0b295e Reviewed-on: https://gerrit.libreoffice.org/49450 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Tor Lillqvist <tml@collabora.com>
2018-02-07Fix typosAndrea Gelmini1-1/+1
Change-Id: I90e3a9b3c1b8053362ff938374dd781d30618279 Reviewed-on: https://gerrit.libreoffice.org/49368 Reviewed-by: Julien Nabet <serval2412@yahoo.fr> Tested-by: Julien Nabet <serval2412@yahoo.fr>
2018-01-18Fix typosAndrea Gelmini1-1/+1
Change-Id: I633e4921042809c628e55825b70c540767eba1d3 Reviewed-on: https://gerrit.libreoffice.org/48140 Reviewed-by: Julien Nabet <serval2412@yahoo.fr> Tested-by: Julien Nabet <serval2412@yahoo.fr>
2018-01-15More loplugin:cstylecast: vbahelperStephan Bergmann1-1/+1
Change-Id: I3d9d907dc675cf6d9d95539700ce9d443a9fda98
2018-01-14Fix typosAndrea Gelmini1-1/+1
Change-Id: I2a578961837076ebce3c1fb2681b0785d1d490ac Reviewed-on: https://gerrit.libreoffice.org/47857 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2018-01-12More loplugin:cstylecast: vbahelperStephan Bergmann6-14/+14
auto-rewrite with <https://gerrit.libreoffice.org/#/c/47798/> "Enable loplugin:cstylecast for some more cases" plus solenv/clang-format/reformat-formatted-files Change-Id: I4ab5ca8cc7c3e26b43937ec9edae3d106f11cf56
2017-12-19inline use-once typedefsNoel Grandin1-2/+1
Change-Id: I5c3ffc03c26b3428f1f336e6ecba7838a1cf1157 Reviewed-on: https://gerrit.libreoffice.org/46764 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-12-11loplugin:salcall fix functionsNoel Grandin1-1/+1
since cdecl is the default calling convention on Windows for such functions, the annotation is redundant. Change-Id: I1a85fa27e5ac65ce0e04a19bde74c90800ffaa2d Reviewed-on: https://gerrit.libreoffice.org/46164 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-12-06loplugin:salcall handle virtual methodsNoel Grandin1-4/+4
Change-Id: Iab95db31188ea2914a46d63a7ebef3d825e6ec42 Reviewed-on: https://gerrit.libreoffice.org/45851 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-12-05loplugin:salcall fix non-virtual methodsNoel Grandin2-12/+12
first, since those are safer to change than virtual methods Change-Id: Ie3b624019d75ee2b793cee33b3c5f64e994e8bfe Reviewed-on: https://gerrit.libreoffice.org/45798 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-11-29loplugin:unusedmethodsNoel Grandin1-13/+0
Change-Id: I2efb5c0e5735c179314c6c5de87821cee3b033e1 Reviewed-on: https://gerrit.libreoffice.org/45386 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-11-18loplugin:flatten in toolkit..writerfilterNoel Grandin1-33/+33
Change-Id: I4da2a768b6b55869c3a3d6f8a8d50dc018709acd Reviewed-on: https://gerrit.libreoffice.org/44865 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-11-13Fix typosAndrea Gelmini1-1/+1
Change-Id: Ia544298334364ece3b3963a4adc00c5e01189b91 Reviewed-on: https://gerrit.libreoffice.org/44654 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Mark Page <aptitude@btconnect.com>
2017-10-26More loplugin:unnecessaryparenStephan Bergmann1-2/+2
81892b2037453108b9bde1512a500cf3b2ce438a "loplugin:unnecessaryparen when compiling as C++17, so the ParenExpr is no longer hidden behind ExprWithCleanups/CXXConstructExpr/MaterializedTemporaryExpr wrappers" gave me the idea to generally look though IgnoreImplicit instead of IngoreImpCasts in loplugin:unnecessaryparen. However, that would still not look through implicit CXXConstructExpr, so would still not have found the occurrences in 81892b2037453108b9bde1512a500cf3b2ce438a when compiling in pre-C++17 mode. Therefore, let ignoreAllImplicit also look through CXXConstructExpr. (I am not entirely sure in which situations non-implicit CXXConstructExpr---that should thus not be ignored---would occur, but assume they would be underneath something like a CXXFunctionalCastExpr, which is not ignored.) Change-Id: I947d08742e1809150ecc34a7abe84cca5e0ce843
2017-10-23loplugin:includeform: vbahelperStephan Bergmann10-17/+17
Change-Id: I9a53a4a235b298a565679eddcae86bceaedb5652
2017-10-23overload std::hash for OUString and OStringNoel Grandin2-2/+2
no need to explicitly specify it anymore Change-Id: I6ad9259cce77201fdd75152533f5151aae83e9ec Reviewed-on: https://gerrit.libreoffice.org/43567 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-10-05loplugin:finalclasses in unotools..vbahelperNoel Grandin1-1/+0
Change-Id: I9350f9d37eaba99a1d74e103c969a9dcfe795497 Reviewed-on: https://gerrit.libreoffice.org/43160 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-09-29loplugin:flatten check for throw in then clauseNoel Grandin2-10/+4
also make the plugin ignore the case where we have var decl's in the clause we want to flatten, which could lead to problematic extension of variable lifetime Change-Id: I3061f7104e8c6a460bf74f5eac325a516ec50c59 Reviewed-on: https://gerrit.libreoffice.org/42889 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-09-27loplugin:flatten in toolkit..vbahelperNoel Grandin5-57/+49
Change-Id: I6d4be3e1cc29b2b91d5c39b757ff3b903c47112d Reviewed-on: https://gerrit.libreoffice.org/42794 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-09-22Fresh run of bin/update_pch.shMike Kaganski2-118/+30
Change-Id: I69d4157aaf6570cecd51ea59df20556914942e06 Reviewed-on: https://gerrit.libreoffice.org/42565 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2017-09-14clang-tidy modernize-use-emplace in test..vbahelperNoel Grandin2-2/+2
Change-Id: Ifbe1dd7c9d5dde33f7419548670434591b1a1d82 Reviewed-on: https://gerrit.libreoffice.org/42258 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-09-08oovbaapi: create XOval and XLine shape typesTamas Bunth1-0/+42
This is needed in order to make "TypeOf myLine Is Line" or similar expressions return the expected "true" value. The implementation of the basic interpreter of TypeOf uses XTypeProvider to determine the type of an object by getting the last part of the type name. E.g. "ooo:vba::msforms::XLine" is determined as a "Line". That's why I created the XLine and XOval blank classes. TypeOf doc: https://docs.microsoft.com/en-us/dotnet/visual-basic/language-reference/operators/typeof-operator Change-Id: Ia49cc92d672e30d0126f02d61a55a956ac1425f0 Reviewed-on: https://gerrit.libreoffice.org/42083 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Tamás Bunth <btomi96@gmail.com>
2017-08-31inline some use-once typedefsNoel Grandin1-3/+1
and remove some dead ones Change-Id: I6946d717d3c15dc5207489ed3d56d985dd953d59 Reviewed-on: https://gerrit.libreoffice.org/41746 Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-08-01move resmgr to unotoolsCaolán McNamara1-1/+1
and the vast majority of translations is to the ui language so default ctor with that arg and now drop OModuleResourceClient Change-Id: I3b85a560ffdfe5f019c2271ac56a5fe4a361522b
2017-08-01loplugin:constparams in variousNoel Grandin4-7/+7
Change-Id: Id15f3562f42afa6c679cea3c839172557ead0395 Reviewed-on: https://gerrit.libreoffice.org/40624 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-08-01loplugin:checkunusedparamsNoel Grandin4-6/+5
the "check for taking address of function" part was generating false+ Change-Id: Iad6203850901229b7b1b2f8938c68ec703cd343f Reviewed-on: https://gerrit.libreoffice.org/40613 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-07-21migrate to boost::gettextCaolán McNamara2-6/+0
* all .ui files go from <interface> to <interface domain="MODULE"> e.g. vcl * all .src files go away and the english source strings folded into the .hrc as NC_("context", "source string") * ResMgr is dropped in favour of std::locale imbued by boost::locale::generator pointed at matching MODULE .mo files * UIConfig translations are folded into the module .mo, so e.g. UIConfig_cui goes from l10n target to normal one, so the res/lang.zips of UI files go away * translation via Translation::get(hrc-define-key, imbued-std::locale) * python can now be translated with its inbuilt gettext support (we keep the name strings.hrc there to keep finding the .hrc file uniform) so magic numbers can go away there * java and starbasic components can be translated via the pre-existing css.resource.StringResourceWithLocation mechanism * en-US res files go away, their strings are now the .hrc keys in the source code * remaining .res files are replaced by .mo files * in .res/.ui-lang-zip files, the old scheme missing translations of strings results in inserting the english original so something can be found, now the standard fallback of using the english original from the source key is used, so partial translations shrink dramatically in size * extract .hrc strings with hrcex which backs onto xgettext -C --add-comments --keyword=NC_:1c,2 --from-code=UTF-8 --no-wrap * extract .ui strings with uiex which backs onto xgettext --add-comments --no-wrap * qtz for gettext translations is generated at runtime as ascii-ified crc32 of content + "|" + msgid * [API CHANGE] remove deprecated binary .res resouce loader related uno apis com::sun::star::resource::OfficeResourceLoader com::sun::star::resource::XResourceBundleLoader com::sun::star::resource::XResourceBundle when translating strings via uno apis com.sun.star.resource.StringResourceWithLocation can continue to be used Change-Id: Ia2594a2672b7301d9c3421fdf31b6cfe7f3f8d0a
2017-07-15emfplus: create a wmf/emf/emf+ primitive based importerArmin Le Grand1-1/+1
First steps to organize an importer that can read/interpret wmf/emf/emf+ and deliver a primitive representation for the content by parsing it. Use the same mechanisms as already applied for Svg, so to reuse abilities to keep original binary data to allow save again and embedding in files and have an implemented replacement bitmap based representation. For this, unify the used helper classes to handle more than just Svg. For 1st try, add test code and static bool switches Change-Id: I6e0a82943541d811a8f8d65a84115569fcd8cee7
2017-07-14use more OUString::operator== in test..xmlsecurityNoel Grandin4-8/+7
Change-Id: If5bdd1532be44a47ff7cc3b769be3ea585aea562 Reviewed-on: https://gerrit.libreoffice.org/39685 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-07-06Create vba library if it did not exist beforeTamas Bunth1-0/+9
Add basicLibraries to the library container in the ensure function. It is needed in case of an xlsm file, because the VBAProject library was not added by the filter. Change-Id: I13f78384b9b1bbff1d9d5b1cd36d5a3b878f63e6 Reviewed-on: https://gerrit.libreoffice.org/39622 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Tamás Bunth <btomi96@gmail.com>
2017-07-05new loplugin unnecessaryparenNoel Grandin1-1/+1
Change-Id: Ic883a07b30069ca6342d7521c8ad890f4326f0ec Reviewed-on: https://gerrit.libreoffice.org/39549 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>