summaryrefslogtreecommitdiff
path: root/basic
AgeCommit message (Collapse)AuthorFilesLines
2015-10-17tdf#94617 allow to store nStart information greater than sal_Int16 limitLaurent Godard2-6/+41
- preserve backward compatibility - nDebugFlag is stored but not used when loaded - Flag nDebugFlag set the top bit to 1 - stores the multiplier of sal_Int16 limit to reach nStart - in load, test this flag bit - rebuild correct nStart - new B_CURVERSION file format for binary storage macro - unit test for big modules Change-Id: Iaa037982d828fef7195615e6eda546b7199a4fe8 Reviewed-on: https://gerrit.libreoffice.org/18926 Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com> (cherry picked from commit db17079fcff6f9a068c499b17f2501cc4c82d10b)
2015-08-31tdf#75973 : User Defined Types in password encrypted macrosLaurent Godard4-8/+203
save/load basic script so that when executing password protected the user defined types can be rebuilt supports array and nested types New identifier B_USERTYPE for save/open macro with user defined types No version bump but saves binary format now to current_version a unit test in sc macros-test.cxx full round trip on password protected document (ie. use binary storage) master --(0)--> master --(1)--> libreoffice 4.4 --(2)--> master --(3)--> master (0) in master, User type supported, big module supported (1) in libreoffice 4.4, user type not supported, big module supported, no loss of code (2) in master, user type not supported, big module not found, no loss of code it is OK as libreoffice 4.4 saves to LegacyVersion (see sbxmod.cxx changes) (3) in master, User type supported, big module supported (all is restored) it is OK as module was saved with CURRENT_VERSION (see sbxmod.cxx changes) Change-Id: Idab5de85e948dc11f4aba631b1569a1cc1cb4bf6 Reviewed-on: https://gerrit.libreoffice.org/17841 Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2015-08-20tdf#92446: Revert apparently bogus attempt at fixing a memory leakStephan Bergmann1-6/+1
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)
2015-08-06Apply new VclPtr clang plugin to catch potential problems.Noel Grandin2-2/+2
Omit the plugin, and sw's FrameControlsManager for now. Change-Id: Ifb98a2e6e03a9d099efc1668305b96bd9142ca5f Reviewed-on: https://gerrit.libreoffice.org/16117 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Michael Meeks <michael.meeks@collabora.com> Tested-by: Michael Meeks <michael.meeks@collabora.com>
2015-08-06tdf#91702 - fix stack-based MessBox allocation.Michael Meeks2-3/+4
Change-Id: I62dd164e281911d9db3de453789a5badc7cd5fd7 Reviewed-on: https://gerrit.libreoffice.org/15954 Reviewed-by: Michael Meeks <michael.meeks@collabora.com> Tested-by: Michael Meeks <michael.meeks@collabora.com>
2015-05-28Rewrite all calls like Dialog(params).Execute()Philippe Jung1-2/+2
Replace all calls looking like ADialog(some params).Execute() by ScopedVclPtrInstance<ADialog>::Create(some parms)->Execute() Change-Id: I0b6f0a9ea5ef0a749ffa30ce131e9dc989604639 Reviewed-on: https://gerrit.libreoffice.org/15915 Tested-by: Jenkins <ci@libreoffice.org> Tested-by: Michael Meeks <michael.meeks@collabora.com> Reviewed-by: Michael Meeks <michael.meeks@collabora.com>
2015-05-19tdf#90110: basic: fix Randomize statementMichael Stahl2-8/+40
- time() is used to seed the RNG but since it only has second resolution, the same values will be generated if it's called multiple times like in the bug report - BASIC using the global rng would be fine except that BASIC Randomize takes an optional parameter to set the seed, which should continue to be supported, but should not affect the RNG state for non-BASIC users of comphelper::random (regression from df466d79cb126667cc9d5c108367bfa4f5ce76c8, but the old implementation was even more delightfully absurd, where Randomize was essentially srand((sal_uInt16)rand()) ...) Change-Id: I0f30e509de08f933c02ac77c5d932b20e79586c5
2015-05-19basic: used typed LINKsNoel Grandin4-18/+18
Change-Id: I8770a782e7ff5529e30aee13558711bdd8a4070d
2015-05-18missing semiCaolán McNamara1-1/+1
Change-Id: I3253f09d10cbe733fdf6387d90ab04d65ba9328e
2015-05-18cppunit: noExplicitConstructorCaolán McNamara1-4/+5
Change-Id: Iaf1387ea236bf3a5db9b2165d5b827dbdcf95207
2015-05-18Remove include stdio (part2)Julien Nabet2-4/+0
Change-Id: Iae58d107d8df1c543a165086fb2b7c288e7121dd Reviewed-on: https://gerrit.libreoffice.org/15775 Reviewed-by: Julien Nabet <serval2412@yahoo.fr> Tested-by: Julien Nabet <serval2412@yahoo.fr>
2015-05-17remove unnecessary header fileNoel Grandin15-46/+18
Change-Id: I3b86a54a773341be7e7e69e88c59dc531ea49c5b
2015-05-15tdf#62475: partial handmade fixesAndrea Gelmini2-18/+0
Change-Id: Ib9af202c43b916b9af4b4e18db35d470a8692fe4 Reviewed-on: https://gerrit.libreoffice.org/15712 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Adolfo Jayme Barrientos <fitojb@ubuntu.com>
2015-05-12Missing disposeAndClear in MsgBox basic functionPhilippe Jung1-0/+1
Change-Id: Ida3d792a6f3797a6173b31b86a49b72ad7353340 Reviewed-on: https://gerrit.libreoffice.org/15717 Reviewed-by: Michael Meeks <michael.meeks@collabora.com> Tested-by: Michael Meeks <michael.meeks@collabora.com>
2015-05-12tdf#90969: basic: add horrible hack to avoid crash due to ...Michael Stahl1-3/+16
... the stupid global variable GaDocBasicItems. Change-Id: Ib849e0e2b661e54005d00091f6d6fc474dc5549b
2015-05-12Basic: Doesn't allow non ASCII characters in numeric literalsArnaud Versini1-1/+1
Change-Id: I8b7755dbea56953a04cd7687181ec246fc680c43 Reviewed-on: https://gerrit.libreoffice.org/14691 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2015-05-11loplugin:cstylecast: nop between pointer types of exactly same spellingStephan Bergmann8-28/+28
Change-Id: I1e4363f917a978434fb11368918435da12531dc6
2015-05-10NOINSTANCE is implied now in IMPL_STATIC_LINK...Stephan Bergmann1-1/+1
Change-Id: Ifb032457d6c1b279c4183282ef2b271c706dd71a
2015-05-08lopluign:staticmethods: Handle DECL_LINKStephan Bergmann1-2/+2
Change-Id: Ib27854a8470f3ff5b208cb949a7bd02f2a86c969
2015-05-07Unwind SotStorageStreamRef typedefStephan Bergmann1-5/+5
Change-Id: If7652a7c0251b741660365848a717c06954ca419
2015-05-07Unwind SotStorageRef typedefStephan Bergmann3-9/+9
Change-Id: I8d5363bb2ad813ef29b4078848914f4b0989b9f1
2015-04-30tdf#84435: Mod operator does not deal with decimals as described in helpJulien Nabet1-4/+4
Change-Id: I8dbfdf4bb2eceac0b5afbddd3f35e1dcde2db68b Reviewed-on: https://gerrit.libreoffice.org/14611 Reviewed-by: Eike Rathke <erack@redhat.com> Tested-by: Eike Rathke <erack@redhat.com>
2015-04-30Gradually typed LinkStephan Bergmann4-7/+7
Turn the Link class into a template abstracting over the link's argument and return types, but provide default template arguments that keep the generic, unsafe "void* in, sal_IntPtr out" behvior. That way, individual uses of the Link class can be updated over time. All the related macros are duplicated with ..._TYPED counterparts, that additionally take the RetType (except for LINK_TYPED, which manages to infer the relevant types from the supplied Member). (It would have been attractive to change the "untyped" LinkStubs from taking a void* to a properly typed ArgType parameter, too, but that would cause -fsanitize=function to flag uses of "untyped" Link::Call.) Change-Id: I3b0140378bad99abbf240140ebb4a46a05d2d2f8
2015-04-29Remove unnecessary IMPL_LINK[_NOARG]_INLINE_START/ENDStephan Bergmann2-9/+4
...just use IMPL_LINK[_NOARG] and let the compiler decide what to inline Change-Id: I63ec5116df7e79093ebf31193f8c674f1351c0e6
2015-04-29Remove unnecessary IMPL_LINK_INLINE macroStephan Bergmann1-2/+1
Change-Id: I81cbec049b98d2d2619b0480e0cf54bd1d7b6718
2015-04-29convert STR_EVENT constants to scoped enumNoel Grandin1-1/+1
- also add needed infrastructure to o3tl::enumarray so we can use std::find on it - move the Impl inside the .cxx file, no need to expose it in the header Change-Id: I7758a6175849f46723d97b1e657f846524c3b7cd
2015-04-28Merge remote-tracking branch 'origin/feature/vclptr'Michael Meeks3-50/+71
Resolve several thousand lines of conflicts. Conflicts: accessibility/source/extended/accessiblelistbox.cxx accessibility/source/standard/vclxaccessiblecombobox.cxx accessibility/source/standard/vclxaccessibledropdowncombobox.cxx accessibility/source/standard/vclxaccessibledropdownlistbox.cxx accessibility/source/standard/vclxaccessiblelistbox.cxx accessibility/source/standard/vclxaccessibletextfield.cxx basctl/source/basicide/basidesh.cxx cui/source/inc/chardlg.hxx cui/source/tabpages/tpbitmap.cxx dbaccess/source/ui/dlg/UserAdmin.cxx dbaccess/source/ui/querydesign/ConnectionLineAccess.cxx extensions/source/propctrlr/propertyeditor.hxx extensions/source/scanner/sanedlg.cxx filter/source/pdf/impdialog.cxx include/sfx2/mgetempl.hxx include/sfx2/sidebar/SidebarToolBox.hxx include/sfx2/viewsh.hxx include/svtools/brwbox.hxx include/svtools/filectrl.hxx include/svtools/scrwin.hxx include/svx/dlgctrl.hxx include/svx/sidebar/Popup.hxx include/svx/sidebar/PopupContainer.hxx include/svx/sidebar/PopupControl.hxx include/svx/sidebar/SidebarDialControl.hxx include/svx/sidebar/ValueSetWithTextControl.hxx sc/source/ui/condformat/condformatdlgentry.cxx sc/source/ui/navipi/navipi.cxx sc/source/ui/sidebar/CellBorderStyleControl.hxx sd/source/ui/animations/CustomAnimationDialog.cxx sd/source/ui/inc/DrawViewShell.hxx sd/source/ui/inc/Ruler.hxx sd/source/ui/inc/SlideSorter.hxx sd/source/ui/inc/ViewTabBar.hxx sd/source/ui/inc/Window.hxx sd/source/ui/inc/morphdlg.hxx sd/source/ui/inc/sdpreslt.hxx sd/source/ui/sidebar/CurrentMasterPagesSelector.hxx sd/source/ui/sidebar/LayoutMenu.hxx sd/source/ui/sidebar/MasterPagesSelector.hxx sd/source/ui/sidebar/NavigatorWrapper.hxx sd/source/ui/sidebar/PanelBase.hxx sd/source/ui/sidebar/RecentMasterPagesSelector.cxx sd/source/ui/sidebar/RecentMasterPagesSelector.hxx sd/source/ui/slideshow/showwindow.hxx sd/source/ui/slidesorter/view/SlsInsertAnimator.cxx sd/source/ui/slidesorter/view/SlsLayeredDevice.hxx sd/source/ui/view/ViewShellBase.cxx sd/source/ui/view/drviewsa.cxx sfx2/source/appl/fileobj.hxx sfx2/source/appl/opengrf.cxx sfx2/source/control/thumbnailviewacc.hxx sfx2/source/dialog/securitypage.cxx sfx2/source/dialog/templdlg.cxx sfx2/source/doc/docinsert.cxx sfx2/source/doc/guisaveas.cxx sfx2/source/inc/alienwarn.hxx sfx2/source/sidebar/Deck.cxx sfx2/source/sidebar/Deck.hxx sfx2/source/sidebar/DeckTitleBar.cxx sfx2/source/sidebar/DeckTitleBar.hxx sfx2/source/sidebar/MenuButton.cxx sfx2/source/sidebar/MenuButton.hxx sfx2/source/sidebar/Panel.cxx sfx2/source/sidebar/Panel.hxx sfx2/source/sidebar/PanelTitleBar.hxx sfx2/source/sidebar/SidebarDockingWindow.hxx sfx2/source/sidebar/SidebarToolBox.cxx sfx2/source/sidebar/TabBar.hxx sfx2/source/sidebar/TabItem.cxx sfx2/source/sidebar/TabItem.hxx sfx2/source/sidebar/TitleBar.hxx sfx2/source/toolbox/imgmgr.cxx starmath/inc/edit.hxx starmath/inc/smmod.hxx starmath/qa/cppunit/test_starmath.cxx starmath/source/edit.cxx starmath/source/smmod.cxx svtools/source/brwbox/brwbox1.cxx svtools/source/brwbox/datwin.hxx svtools/source/contnr/fileview.cxx svtools/source/contnr/simptabl.cxx svtools/source/control/filectrl.cxx svtools/source/control/valueimp.hxx svx/inc/GalleryControl.hxx svx/source/dialog/dlgctrl.cxx svx/source/dialog/swframeexample.cxx svx/source/fmcomp/fmgridif.cxx svx/source/gallery2/GalleryControl.cxx svx/source/sidebar/EmptyPanel.hxx svx/source/sidebar/area/AreaPropertyPanel.hxx svx/source/sidebar/area/AreaTransparencyGradientControl.hxx svx/source/sidebar/graphic/GraphicPropertyPanel.hxx svx/source/sidebar/insert/InsertPropertyPanel.cxx svx/source/sidebar/insert/InsertPropertyPanel.hxx svx/source/sidebar/line/LinePropertyPanel.hxx svx/source/sidebar/line/LineWidthControl.cxx svx/source/sidebar/line/LineWidthControl.hxx svx/source/sidebar/line/LineWidthValueSet.hxx svx/source/sidebar/paragraph/ParaPropertyPanel.hxx svx/source/sidebar/possize/SidebarDialControl.cxx svx/source/sidebar/text/TextCharacterSpacingPopup.hxx svx/source/sidebar/text/TextPropertyPanel.hxx svx/source/sidebar/tools/PopupContainer.cxx svx/source/sidebar/tools/PopupControl.cxx svx/source/sidebar/tools/ValueSetWithTextControl.cxx svx/source/svdraw/svdfmtf.hxx svx/source/svdraw/svdibrow.cxx svx/source/tbxctrls/colrctrl.cxx svx/source/tbxctrls/tbcontrl.cxx sw/source/ui/dbui/mmaddressblockpage.cxx sw/source/ui/dialog/uiregionsw.cxx sw/source/ui/index/cnttab.cxx sw/source/uibase/inc/drpcps.hxx sw/source/uibase/sidebar/PageColumnControl.hxx sw/source/uibase/sidebar/PageMarginControl.hxx sw/source/uibase/sidebar/PageOrientationControl.hxx sw/source/uibase/sidebar/PagePropertyPanel.hxx sw/source/uibase/sidebar/PageSizeControl.hxx sw/source/uibase/uiview/view2.cxx sw/source/uibase/utlui/navipi.cxx vcl/inc/svdata.hxx vcl/source/control/combobox.cxx vcl/source/control/lstbox.cxx vcl/source/window/dockwin.cxx vcl/source/window/winproc.cxx Change-Id: I056cf3026ff17d65cca0b6e6588bda4a88fa8d95
2015-04-28Rephrase comparisons between bool and sal_BoolStephan Bergmann1-2/+2
...to cater for forthcoming loplugin:implicitboolconversion improvements Change-Id: I801b6b73648715448198d582a087cc834f6e20c8
2015-04-28Dialog::Execute returns short/VclResponseTypeStephan Bergmann1-5/+1
Change-Id: I48d63276ae0aaeba169e1e783c44b428a58314ac
2015-04-28SbModule::Run return value is unusedStephan Bergmann1-5/+1
Change-Id: I7cd697d944dc0efbd35b852fc553ba85bc88c15e
2015-04-24loplugin:simplifyboolStephan Bergmann4-5/+5
Change-Id: I6e181bc4b144c2559ede99d3bae0496cf546415c
2015-04-23Improved loplugin:literaltoboolconversion looking into cond. exprs.Stephan Bergmann2-3/+3
...automatic rewriter fixes Change-Id: I6b04ca80f08f8a71ff94e309fd52f44d736751ee
2015-04-22Update to XDocumentEventBroadcaster et alStephan Bergmann1-6/+6
Change-Id: Ie09223824af45e5e214169182a5cd189fd04f6ef
2015-04-19Related tdf#55502: Harden a bitJulien Nabet1-1/+1
Change-Id: I56155e234b13ca3e9fb95565d08a38252eeba712
2015-04-19callcatcher: update unusedcodeCaolán McNamara1-18/+0
Change-Id: I4b2a7ea03aafbfbf1fece1533da801a4326d80f9
2015-04-18tdf#55502: Shell BASIC function with empty third param hangsJulien Nabet1-2/+6
bt: 2 0x00002aaaab2b5226 in __assert_fail_base (fmt=0x2aaaab3ebce8 "%s%s%s:%u: %s%sAssertion `%s' failed. %n", assertion=assertion@entry=0x2aaaae2ecf10 "index >= 0 && static_cast<sal_uInt32>(index) < static_cast<sal_uInt32>(getLength())", file=file@entry=0x2aaaae2ecec8 "/home/julien/compile-libreoffice/libreoffice/include/rtl/ustring.hxx", line=line@entry=500, function=function@entry=0x2aaaae2ed740 <rtl::OUString::operator[](int) const::__PRETTY_FUNCTION__> "sal_Unicode rtl::OUString::operator[](sal_Int32) const") at assert.c:92 3 0x00002aaaab2b52d2 in __GI___assert_fail (assertion=0x2aaaae2ecf10 "index >= 0 && static_cast<sal_uInt32>(index) < static_cast<sal_uInt32>(getLength())", file=0x2aaaae2ecec8 "/home/julien/compile-libreoffice/libreoffice/include/rtl/ustring.hxx", line=500, function=0x2aaaae2ed740 <rtl::OUString::operator[](int) const::__PRETTY_FUNCTION__> "sal_Unicode rtl::OUString::operator[](sal_Int32) const") at assert.c:101 4 0x00002aaaae1f44f8 in rtl::OUString::operator[] (this=0x7fffffff36b0, index=13) at /home/julien/compile-libreoffice/libreoffice/include/rtl/ustring.hxx:500 5 0x00002aaaae274036 in SbRtl_Shell (pBasic=0x3531fc0, rPar=..., bWrite=false) at /home/julien/compile-libreoffice/libreoffice/basic/source/runtime/methods.cxx:3613 Check if third param isn't empty, if not, aCmdLine finishes with a space character Change-Id: I095b6dc7c7d2d4c826fb47aa1414c558bbc27c04
2015-04-17SvStream: WriteUChar -> WriteBoolStephan Bergmann2-2/+2
Change-Id: I89aa0e22c31d368ab36fe46917db6aacb11c7b14
2015-04-17basctl, basic: convert new to ::Create.Michael Meeks3-9/+9
Change-Id: I1fc2c69640ed625425a679380d6f25178bc5aeb1
2015-04-15remove unnecessary use of void in function declarationsNoel Grandin37-154/+154
ie. void f(void); becomes void f(); I used the following command to make the changes: git grep -lP '\(\s*void\s*\)' -- *.cxx \ | xargs perl -pi -w -e 's/(\w+)\s*\(\s*void\s*\)/$1\(\)/g;' and ran it for both .cxx and .hxx files. Change-Id: I314a1b56e9c14d10726e32841736b0ad5eef8ddd
2015-04-13loplugin:staticmethodsNoel Grandin12-30/+27
Change-Id: If97f01a05294fa7efd59a8934c7b6f65cda5084a
2015-04-13BASIC: Merge BasicLibs with BasicManagerImpl and use boost::ptr_vector.Arnaud Versini1-184/+83
Change-Id: I36fc3ce26b129b11fc2d6d2829a146b3fa57b783 Reviewed-on: https://gerrit.libreoffice.org/15267 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: David Tardon <dtardon@redhat.com>
2015-04-10Automated conversion of VclPtr construction to use Instance template.Michael Meeks1-1/+1
Change-Id: I8be9141b9653e73ebd23a5a3d810f240c376f97e
2015-04-10first half of non-scriptable, Instance constructor conversion.Michael Meeks1-2/+2
Change-Id: If73bb41bfa805e22609748f25971724b4778edb3
2015-04-10vclwidget: fixup locally allocated vcl::Window objectsNoel Grandin1-1/+1
They need to be wrapped in ScopedVclPtr in order to be disposed properly. Change-Id: Ib64dba353774f54711e4de7f5d15d859c6a4dc7e
2015-04-10vclwidget: fix more places that should be wrapping in VclPtrNoel Grandin2-2/+2
Change-Id: I31c9115662da2f81e1b22be91ee58e2862076b8e
2015-04-10vclwidget: only call dispose() onceNoel Grandin2-2/+2
by using a new utility method in vcl::Window This means that we don't have to make all our dispose methods safe to call more than once. Change-Id: I2110c7de4a86c70fdc97dd8fd318c86b56865374
2015-04-09vclwidgets: wrap all vcl::Window subclasses allocated on stack in VclPtrNoel Grandin1-3/+3
Change-Id: Ia8b0d84bbf69f9d8f85505d019acdded14e25133 Conflicts: sw/qa/tiledrendering/tiledrendering.cxx
2015-04-09vcl: VclPtr conversion in basicNoel Grandin2-39/+60
Change-Id: Ia0330d596b696f914a8ee2f81f0399e9456ff87c
2015-04-08A UNO Any can't contain an AnyStephan Bergmann1-1/+1
...and css::uno::makeAny<css::uno::Any>() was never meant to be used. Introduce css::uno::toAny for the (template-code) cases that shall return an Any for both Any and non-Any inputs. Change-Id: Ifa977d73f1da71b2fedde7e8140b19497c4a0257
2015-04-07Remove dead INetProtocol::VimStephan Bergmann1-1/+1
...which removes the need to abstract over the standard URI '%' escape prefix vs. the silly vim '=' special case invention. Change-Id: I54a52dd912c3aafc38275a0ac2466a6daeec328f