summaryrefslogtreecommitdiff
path: root/basic/source/classes/sbxmod.cxx
AgeCommit message (Collapse)Author
2015-08-17tdf#92446: Revert apparently bogus attempt at fixing a memory leakStephan Bergmann
6b4c596b01039324cfe78f38c4e3ffb9080bcd34 "Fix memory leak for BASIC sub (as well as void function)," from just looking at the few lines of code in isolation, and their revision history, looked like a plausible and effective approach to fix the leaks reported by CppunitTest_basci_vba when run under lsan. However, tdf#92446 indicates that that innocent-looking change had rather dire consequences. So revert it and leave a fix for the memory leak to somebody who actually understands all this code. Change-Id: Ic81b1c14a1cfb07c6ec4415cc26b2f826adbc8ca (cherry picked from commit 9d094b9f0a05d2ea62181201efb8f9e46ecfc8f1) Reviewed-on: https://gerrit.libreoffice.org/17760 Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2014-11-14fdo#86023 - O[U]String needs a 'clear' methodBrij Mohan Lal Srivastava
Added clear() method to OString and OUString class, Updated appropriate call-sites. Change-Id: I0ba97fa6dc7af3e31b605953089a4e8e9c3e61ac Signed-off-by: Stephan Bergmann <sbergman@redhat.com>
2014-11-12Fix common typos. No automatic tools. Handmade…Andrea Gelmini
Change-Id: I1ab4e23b0539f8d39974787f226e57a21f96e959 Reviewed-on: https://gerrit.libreoffice.org/12164 Reviewed-by: Noel Grandin <noelgrandin@gmail.com> Tested-by: Noel Grandin <noelgrandin@gmail.com>
2014-11-05fdo#38835 strip out OUString globalsNoel Grandin
they are largely unnecessary these days, since our OUString infrastructure gained optimised handling for static char constants. Change-Id: I07f73484f82d0582252cb4324d4107c998432c37
2014-10-03rename SvRef::AddRef to AddFirstRefNoel Grandin
to make it's intended purpose clearly distinguishable from AddNextRef Change-Id: I5da780b48b19fd873667b648031bc394113f953b Reviewed-on: https://gerrit.libreoffice.org/11763 Reviewed-by: Noel Grandin <noelgrandin@gmail.com> Tested-by: Noel Grandin <noelgrandin@gmail.com>
2014-10-02loplugin: cstylecastNoel Grandin
Change-Id: Ic7c9c978baf5602a508aff5976220a02ed03a680
2014-09-26remove unnecessary casts in calls to SvStream.WriteInt16Noel Grandin
left over from our conversion of the SvStream output operators to more specific methods Change-Id: Ie44bec6b988f3e46fe78d14b740818c9141f5df0
2014-09-26remove unnecessary casts in calls to SvStream.WriteUCharNoel Grandin
left over from our conversion of the SvStream output operators to more specific methods Change-Id: I2ea4c7d97e745b3e6a3834f41ac7bfefa4883c7a
2014-09-06SfxHint: convert home-grown RTTI to normal C++ RTTINoel Grandin
Also note that I fixed a bug in SvxFontMenuControl::Notify where the if statement had the check the wrong way around. Change-Id: I611e8929c65818191e36bd80f2b985820ada4411 Reviewed-on: https://gerrit.libreoffice.org/11147 Reviewed-by: Norbert Thiebaud <nthiebaud@gmail.com> Tested-by: Norbert Thiebaud <nthiebaud@gmail.com>
2014-08-26convert SBX flag bits to type-safe enumNoel Grandin
Change-Id: I18d5d6a27f06ee60a5cb3dc393bf05b51bba4817 Reviewed-on: https://gerrit.libreoffice.org/11070 Reviewed-by: Noel Grandin <noelgrandin@gmail.com> Tested-by: Noel Grandin <noelgrandin@gmail.com>
2014-08-18drop unnecessary shl.hxx includesCaolán McNamara
Change-Id: Ieb984987c4a4f888a563377e0500444b12f43506
2014-07-17Renamed brdcst.[hc]xx to SfxBroadcaster.[hc]xxTobias Lippert
- Remove includes from files where they are not needed. - Update pch files Change-Id: I0188e3934ef429008c1ef495ab1d5b27f38664d5 Reviewed-on: https://gerrit.libreoffice.org/10342 Reviewed-by: Thomas Arnhold <thomas@arnhold.org> Tested-by: Thomas Arnhold <thomas@arnhold.org>
2014-07-11new loplugin: externalandnotdefinedNoel Grandin
Find "missing headers," where a function is declared directly in the .cxx (as extern) and not defined, and should arguably instead be declared in an include file. Change-Id: I6d83ee432b2ab0cd050aec2b27c3658d32ac02a2
2014-06-17improve the inlinesimplememberfunctions clang pluginNoel Grandin
Change-Id: I6d5a952901648e01904ef5c37f953c517304d31e
2014-06-13loplugin:staticcallStephan Bergmann
Change-Id: I6cd46964c523c9393e9d249fdb43aaa38679fa06
2014-06-09loplugin: inlinesimplememberfunctionsNoel Grandin
Change-Id: I42119f656ca528286fb25d2d36c0af54b7d04a6b
2014-06-02basic: typoThomas Arnhold
Change-Id: I10c9e480a94a966dac4f6c17fc69fa8892c56955
2014-06-02Fix memory leak for BASIC sub (as well as void function)Stephan Bergmann
d88593af59d9126cdbcd6c0a5b06fb9c673dc6f9 "INTEGRATION: CWS ab34: #i73457# Prevent sub from beeing set as param 0 for return type void" to fix i#73457 "Memory Leak in all Basic type void Method calls" had made the PutDirect call dependent on != SbxVOID only (which would cover void functions) but not also on != SbxEMPTY (which would apparently be required to also cover subs, as seen with CppunitTest_basic_vba run under lsan). Either this was an oversight with the original fix, or subs have meanwhile changed from GetType() == SbxVOID to SbxEMPTY? Change-Id: I3e5dbf79bfd5eea3cfec8ed3fa984d13167aa501
2014-05-29Avoid possible memory leaks in case of exceptionsTakeshi Abe
Change-Id: Iac63a5d60478e5cd8e2b77c889c7b312d3d15f67
2014-05-23add default value for Context param in uno::Exception constructorsNoel Grandin
and all it's subtypes, which is almost never used, so this allows us to simplify lots of call sites. Change-Id: I0b05793ea2bdd1027679f63252d42ce4af89433b
2014-04-14typo: implicitely -> implicitlyThomas Arnhold
2014-04-09Clean up function declarations and some unused functionsStephan Bergmann
Change-Id: I63c4c61847fea4500b667a5ea9f2b32207692033
2014-04-07basic: sal_Bool->boolNoel Grandin
Change-Id: I1c084ca86c0b1308eb2fc1451ba34d2e702c6a7f
2014-04-04SbxObject::isClass sal_Bool->boolNoel Grandin
Change-Id: I71f7b3603df43924d7374969444b929e1eecca4e
2014-04-03remove unnecessary scope qualifier from sal_Bool usesNoel Grandin
i.e. convert "::sal_Bool" to "sal_Bool" Change-Id: Ie5943aee4fee617bf2670655558927ed25b7e067
2014-03-31Remove unused BASIC CaptureAssertions functionalityStephan Bergmann
...that had originally been introduced to catch DBG_ASSERTs during smoketest, but since made effectively unused when basing DBG_ASSERT on the sal/log.hxx functionality, and obsoleted by the ongoing clean-up of using true assert where appliable. Change-Id: I2fb4f5d0873d29595b178057f83c1404c0085575
2014-03-27Second batch of adding SAL_OVERRIDE to overriding function declarationsStephan Bergmann
...mostly done with a rewriting Clang plugin, with just some manual tweaking necessary to fix poor macro usage. Change-Id: Ie656f9d653fc716f72ac175925272696d509038f
2014-03-27basic: sal_Bool->boolNoel Grandin
Change-Id: Icd78d21495f305c8f00280eee76e7262e542317d
2014-03-27basic: sal_Bool->boolNoel Grandin
Change-Id: Id4952b6f97f9e8f917fea5651dee91499d109e48
2014-03-13basic: prefer passing OUString and OString by referenceNoel Grandin
Change-Id: I8121204cdb37d4e1d8967397f3e45bdab6aaddad
2014-03-10basic: simplify deprecated XTypeProvider.getImplementationIdStephan Bergmann
Change-Id: I7f0d75c5eaa62f012cb2ae19c5107c09cbc6936a
2014-02-26cppuhelper: retrofit std::exception into overriding exception specsStephan Bergmann
Change-Id: I56e32131b7991ee9948ce46765632eb823d463b3
2014-02-25Remove visual noise from basicAlexander Wilms
Change-Id: I10865b94f67de39e9dbcbe71ede42aa94d81db61 Reviewed-on: https://gerrit.libreoffice.org/8234 Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2014-02-20svl: sal_Bool -> boolStephan Bergmann
Change-Id: Ic31455a1f5ffffa35d4fdde901dd70734207b6f4
2014-02-12convert SvStream::operator>> methods to ReadXXX methodsNoel Grandin
First, I updated the clang rewriter to do the conversion. Then I lightly hand-tweaked the output for the few places where the rewriter messed up, mostly when dealing with calls on "this". Change-Id: I40a6a977959cd97415c678eafc8507de8aa3b1a9 Reviewed-on: https://gerrit.libreoffice.org/7879 Reviewed-by: Michael Stahl <mstahl@redhat.com> Tested-by: Michael Stahl <mstahl@redhat.com>
2014-02-06typo fixes in commentsAndras Timar
Change-Id: Idd49478d59cd062118fbf8e99d1c8bc5250013fc
2014-01-24coverity#736909 Allocation too small for typeCaolán McNamara
Change-Id: I330ebdfd94d0c30b40e180e307d7543c09fd334b
2014-01-24coverity#736908 Allocation too small for typeCaolán McNamara
Change-Id: Ic41c5071957f5e95322971f8ec3ef864edecdb20
2014-01-10re-write SvStream operator<< to non-overloaded methodsNoel Grandin
This is the actual re-write. Use a clang rewriter to rewrite SvStream::operator<< to methods like WriteuInt32. Note that the rewriter is not perfect, and I hand-tweaked the output. In particular, I had to adjust places doing things like (*this) << 1; Change-Id: I5923eda3f4ebaa8b452b6ef109e726e116235a2a Reviewed-on: https://gerrit.libreoffice.org/7342 Tested-by: LibreOffice gerrit bot <gerrit@libreoffice.org> Reviewed-by: Michael Stahl <mstahl@redhat.com>
2013-12-12Do not use C++-UNO internal static_type functions in client codeStephan Bergmann
...use cppu::UnoType instead. Change-Id: I507914b30ef8acda910ee4ecc0589fd328eb6f31
2013-12-11sbobjmod.hxx is private to basicTor Lillqvist
Change-Id: I4ad28b049de5f7268ee1ca2e8992e2f29ed05380
2013-11-11basic: include <> for external includesNorbert Thiebaud
Change-Id: I4715bbe853d60ef15f20a4d2441c688003ca568e
2013-10-02sal_Bool to boolTakeshi Abe
Change-Id: I16ddbcf100e21d6c05fccbe24faca2932a605902
2013-09-11Easier conversion between Basic Date and UNO Date/TimeLionel Elie Mamane
Utility functions to convert between Basic Date type and the representations of Date and Time in UNO, namely: - com.sun.star.util.Date - com.sun.star.util.Time - com.sun.star.util.DateTime Name of new functions: - CDateToUnoDate - CDateFromUnoDate - CDateToUnoTime - CDateFromUnoTime - CDateToUnoDateTime - CDateFromUnoDateTime Change-Id: I2b971df20df1c0351d071023e042169b548894f1 Reviewed-on: https://gerrit.libreoffice.org/5897 Reviewed-by: Noel Power <noel.power@suse.com> Tested-by: Noel Power <noel.power@suse.com>
2013-09-02GSOC work, autocorrect procedures+variablesGergo Mocsi
Fixed some small issue with the right arrow key in the ListBox. Autocorrection now correct all variable types and procedure names. Change-Id: Iff1abaf10c621aef04772837faa272bb6f987e37
2013-09-02GSOC work, behavior fixesGergo Mocsi
Code completition: left/right arrow keys handled. Left arrow dismisses the dialog when reaches the dot. Right arrow dismissed the dialog when reaches the next line. ListBox appearance fixed. TAB key can insert the first matching entry. Autocorrect: "Autocorrect Keywords" has been renamed to "Autcorrect" (in the UI, and the config file, after this patch a make dev-install is needed). Keyword case correction is not just capitalizing the first letter ( eg. Elseif -> ElseIf ). Autoclose procedures: cursor is being placed inside the preocedure. Change-Id: Ie7e9ae96b49bd94562db83f96e1c4ad63ab3f3d6
2013-09-02GSOC work, ListBox appearance fix (at the borders) + code fixesGergo Mocsi
ListBox appearance fixed at the borders: a) bottom: it it placed over the current line (not under) b) right side: listbox's right side is adjusted to the window's right side Coed fixes: CodeCompleteOptions now intializes itself from the configuration file BasicIDE.xcs Added a checkbox for enabling extended types in the options dialog. Cursor is visible when the listbox is active. Fixed the small issue when deleting a character. Change-Id: I68b80143de245cebfce65cdd8af37ea4694aa81b
2013-09-02GSOC work, "autocomplete procedures" fix + new featureGergo Mocsi
Fixed the procedure autoclose function. Now, autoclose is based on the syntax higlighter: if finds an opening token, starts searching forward to a close token. If there is another sub/function keyword, or EOF is reached, the procedure is considered incomplete. If the end token is found, the procedure is considered to be closed. Added function autocorrect symbol spelling, wich corrects the ascii case of the keywords, and corrects the spelling of the extended types. Change-Id: Ibd17f319a6d6ff5c3f91f4adb7a10dc701f0468a
2013-09-02GSOC work, procedure autoclose implementationGergo Mocsi
Now, function procedure autoclose is working. Created a struct named IncompleteProcData to store the line number, type and name of the inclomplete procedure. Procedures are store in a vector (IncompleteProcedures), and are as a member in SbModule. I've created a function called SbModule::GetIncompleteProcedures() to extract the data. Data extraction uses SbModule::SetSource32, beacuse that one tokenizes sthe source file, and recognizes procedures. Closing procedures is triggered ky pressing the Enter key when typing. It checks the actual sub, and if it's incomplete, adds the correct ending( End Sub/End Function). There is only one problem: function SbModule::SetSource32 is not too often calle, maybe extraction should be done by a timer. Change-Id: Id88daaef329e8b5c194b765c5261d356bfb3a0c9
2013-09-02GSOC work, cache implementation fix, code fixesGergo Mocsi
The CodeCompleteDataCache got a new implementation: global variables are stored separately. The "static const" OUString-s were removed from the class. Data extraction is only done when pressing the dot key. Change-Id: I3ff94c0c6eabe328761336d4c74744eb7efc6056