summaryrefslogtreecommitdiff
path: root/vbahelper
AgeCommit message (Collapse)AuthorFilesLines
2019-08-21More hacks for quit requests from an OLE Automation clientTor Lillqvist1-0/+4
Actually I am now not so sure whether the TerminationVetoer thing is needed or not. Will have to experiment later with the customer use case what happens if I remove all that. Maybe adding it was a mistake, as misinterpretation of what was going on. Change-Id: I252e1233cae1622099bc3310814132dae58b2aed
2019-08-14Try harder to avoid exceptions screwing stuff up for OLE clientsTor Lillqvist2-4/+30
Change-Id: I5e9ae8669c4f5c561a09f5f21f11a675a40e5929
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-04-02Add a few SAL_INFOsTor Lillqvist1-1/+7
Change-Id: Ibdb013f4eeee8a2b2e29e3adb56943b5fccf9772
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.
2019-03-02Use sal_Int32 for the index as it comes in as a LONG at least from VBScriptTor Lillqvist1-1/+1
An Any containing a LONG with value 1 won't be put into a sal_Int16 by the >>= operator, even if it obviously would fit... But maybe consistency is good here. Change-Id: If39054148f72211eae3c897675708aab58f425b2
2019-03-02Use comphelper::getProcessComponentContext()Tor Lillqvist1-2/+3
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
2019-02-15Add a FIXME noteTor Lillqvist1-0/+6
Change-Id: Iedda7ca9cff1bda763845e665e0e21656b253793
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-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 (cherry picked from commit 1b55ed02a4c5b7f6d1ff39220af6e7624995f9d3)
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 (cherry picked from commit 5cc28c5e9455a7923153f82dcf18e76570e36717)
2018-05-31Add 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> (cherry picked from commit 857a33404626f8df04882478d026969691624cbb)
2018-05-31Add 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> (cherry picked from commit d7f69b1cb4dbdd39970d56d0c340d7abb92fbdc1)
2018-05-31Bin some ASCII graphicsTor Lillqvist1-6/+0
Change-Id: I53ef86a997f4ae1c0ad84bb381327cba3143dd4c (cherry picked from commit 3ebaf1a9fb28be42358f5460e5ab7322d4f1dee8)
2018-03-25Decrease 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> (cherry picked from commit 73256b918119e378c762f6a3d79d04f311a075cc)
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>
2017-06-28loplugin:oncevar in ucb..vbahelperNoel Grandin5-21/+11
Change-Id: I1fc7c7505a42b3bf9d4a5ab22961930b9831d4ae Reviewed-on: https://gerrit.libreoffice.org/39327 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-06-24oovbaapi: use autoshape in case of EllipseShapeTamas Bunth1-1/+3
Required for msoShapeOval autoshape type Change-Id: I62ef053e8f387f4d87b28b7d17b82209d28fe0fd Reviewed-on: https://gerrit.libreoffice.org/39209 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Tamás Bunth <btomi96@gmail.com>
2017-06-21convert ErrCode to strong typedefNoel Grandin1-5/+5
would have preferred to re-use o3tl::strong_int, of which this is a modified copy, but there are lots of convenience accessors which are nice to define on the class. Change-Id: I301b807aaf02fbced3bf75de1e1692cde6c0340a Reviewed-on: https://gerrit.libreoffice.org/38497 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-06-18vbahelper: remove unused variableJochen Nitschke1-5/+1
unused since commit a975624bfeeb08670b90944eda372d6d4755ae34 loplugin:unusedfields in tools..vbahelper Change-Id: I7643ec97e724c9aedab99993509e3c6132fb7d24 Reviewed-on: https://gerrit.libreoffice.org/38921 Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-06-18remove unused osl/mutex.hxx includesJochen Nitschke1-1/+0
Change-Id: I3b50e45fdb99e9cd8bfda07356ee3ddb4dd0f8bb Reviewed-on: https://gerrit.libreoffice.org/38905 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Jochen Nitschke <j.nitschke+logerrit@ok.de>
2017-06-16loplugin:unusedfields in tools..vbahelperNoel Grandin5-17/+10
Change-Id: Ief7d4c8e1866604eda6308ea2a5c1ce4b1c093bc Reviewed-on: https://gerrit.libreoffice.org/38836 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-06-12cleanup unused css/frame/* includesJochen Nitschke7-11/+1
Change-Id: I173a29fd1ee889127369d2bc2fce8e010b89ca65 Reviewed-on: https://gerrit.libreoffice.org/38633 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-05-31clang-tidy readability-redundant-control-flowNoel Grandin1-1/+0
Change-Id: I832f7ef0f1bd55e365db7e49823fe8bc30390c04 Reviewed-on: https://gerrit.libreoffice.org/38215 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-05-20cleanup unused css/uri/ includesJochen Nitschke1-2/+0
Change-Id: I08c7981ecce45e343ff9e98277dd3aea4ed68ab9 Reviewed-on: https://gerrit.libreoffice.org/37860 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-05-20cleanup unused css/script/ includesJochen Nitschke1-1/+0
but keep exception includes in headers for now Change-Id: I826828675a2d14b906e57068cbced2e790e12bce Reviewed-on: https://gerrit.libreoffice.org/37846 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-05-09make loplugin constantparam smarter about string paramsNoel Grandin1-4/+4
Change-Id: Id3df69b38fd35f46735246a6d307a89aa10d4294 Reviewed-on: https://gerrit.libreoffice.org/37426 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-05-05loplugin:checkunusedparams in toolkit..vbahelperNoel Grandin4-7/+7
the extra argument on the runtimeexception method was only ever passed an "OUString()" Change-Id: I0ea19ae9328760918f1267f27ba103432fff0b47 Reviewed-on: https://gerrit.libreoffice.org/37274 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-04-27tools: move errcode.hxx to the vcl moduleChris Sherlock2-2/+2
Change-Id: I17e5a033de5f0aeb0a726744f7b464cdab6e2ee3 Reviewed-on: https://gerrit.libreoffice.org/36854 Reviewed-by: Chris Sherlock <chris.sherlock79@gmail.com> Tested-by: Chris Sherlock <chris.sherlock79@gmail.com>
2017-04-25errinf.hxx moved out of tools and into vcl moduleChris Sherlock1-1/+1
ErrorInfo has a hard depency on VCL, yet is in the tools package. It is more appropriate to have it reside in the VCL module. Change-Id: Ica54a46c3a7f86cf0331ed7245234bea69c05650 Reviewed-on: https://gerrit.libreoffice.org/36839 Reviewed-by: Chris Sherlock <chris.sherlock79@gmail.com> Tested-by: Chris Sherlock <chris.sherlock79@gmail.com>