3700 Commits

Author SHA1 Message Date
Stephan Bergmann
b000faba86 loplugin:cstylecast: deal with those that are (technically) const_cast
Change-Id: I1788ad7d9f9dec892b31a0610d0f44ae1ccd2e64
2015-06-02 11:25:21 +02:00
Caolán McNamara
8e22cd40ec cppcheck: noExplicitConstructor
Change-Id: I8ae8623252546ca94f65fc04b331dd9cafa4fc92
2015-06-02 08:57:56 +01:00
Michael Meeks
ba81e5c6bd tdf#91702 - fix stack-based MessBox allocation.
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-29 12:16:28 +00:00
Noel Grandin
afcf1ecee1 loplugin:loopvartoosmall
Change-Id: I1e9768c08af0bc7caac6a39c13842ee9d8ad962c
2015-05-29 08:48:41 +02:00
Philippe Jung
1379e2feaa Rewrite all calls like Dialog(params).Execute()
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-28 08:44:31 +00:00
Arnaud Versini
563a3935b8 BASIC: Remove BasicCharClass::IsLetterTab
Change-Id: Ib6a13cb7a5725d451c0f8d64c2c543a8a9ec2ad0
Reviewed-on: https://gerrit.libreoffice.org/15876
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: David Tardon <dtardon@redhat.com>
2015-05-26 08:46:32 +00:00
Arnaud Versini
6a4a55d5f4 BASIC: User std::unique_ptr in basic runtime
Change-Id: Iac7efdad78cf2f827cbddbc671dd0d1b5ae1d467
Reviewed-on: https://gerrit.libreoffice.org/15874
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
2015-05-26 08:13:35 +00:00
Julien Nabet
4d9595637c Wrong comment since 642cfe8ac206af4fe82bc695d38b5c7f0edf7dc7
nEndPos is in fact sal_uInt32 type

Change-Id: I434564eebff2138709807676ae855a8f487f4c09
2015-05-23 16:53:57 +02:00
Michael Stahl
564fc48393 tdf#90110: basic: fix Randomize statement
- 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-19 22:02:41 +02:00
Noel Grandin
ae451af87d basic: used typed LINKs
Change-Id: I8770a782e7ff5529e30aee13558711bdd8a4070d
2015-05-19 11:10:54 +02:00
Julien Nabet
3aebc670e1 Remove include stdio (part2)
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-18 05:33:52 +00:00
Noel Grandin
539ba642d7 remove unnecessary header file
Change-Id: I3b86a54a773341be7e7e69e88c59dc531ea49c5b
2015-05-17 10:08:59 +02:00
Andrea Gelmini
5b1337f7b2 tdf#62475: partial handmade fixes
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-15 17:55:15 +00:00
Philippe Jung
2bb4d6cad4 Missing disposeAndClear in MsgBox basic function
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-12 14:03:35 +00:00
Michael Stahl
be88e305ee tdf#90969: basic: add horrible hack to avoid crash due to ...
... the stupid global variable GaDocBasicItems.

Change-Id: Ib849e0e2b661e54005d00091f6d6fc474dc5549b
2015-05-12 14:15:24 +02:00
Arnaud Versini
7ff58e1a89 Basic: Doesn't allow non ASCII characters in numeric literals
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-12 09:25:18 +00:00
Stephan Bergmann
ef6877c167 loplugin:cstylecast: nop between pointer types of exactly same spelling
Change-Id: I1e4363f917a978434fb11368918435da12531dc6
2015-05-11 12:49:03 +02:00
Stephan Bergmann
9bb254fc85 NOINSTANCE is implied now in IMPL_STATIC_LINK...
Change-Id: Ifb032457d6c1b279c4183282ef2b271c706dd71a
2015-05-10 11:25:47 +02:00
Stephan Bergmann
5eb6bd4db7 lopluign:staticmethods: Handle DECL_LINK
Change-Id: Ib27854a8470f3ff5b208cb949a7bd02f2a86c969
2015-05-08 19:15:32 +02:00
Stephan Bergmann
0241519f32 Unwind SotStorageStreamRef typedef
Change-Id: If7652a7c0251b741660365848a717c06954ca419
2015-05-07 11:05:04 +02:00
Stephan Bergmann
dc47b2e513 Unwind SotStorageRef typedef
Change-Id: I8d5363bb2ad813ef29b4078848914f4b0989b9f1
2015-05-07 11:05:04 +02:00
Julien Nabet
0f79a5ff07 tdf#84435: Mod operator does not deal with decimals as described in help
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-30 14:27:06 +00:00
Stephan Bergmann
3ead3ad52f Gradually typed Link
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-30 10:20:00 +02:00
Stephan Bergmann
0acd47f68e Remove unnecessary IMPL_LINK[_NOARG]_INLINE_START/END
...just use IMPL_LINK[_NOARG] and let the compiler decide what to inline

Change-Id: I63ec5116df7e79093ebf31193f8c674f1351c0e6
2015-04-29 18:29:59 +02:00
Stephan Bergmann
17cb3391ec Remove unnecessary IMPL_LINK_INLINE macro
Change-Id: I81cbec049b98d2d2619b0480e0cf54bd1d7b6718
2015-04-29 18:29:59 +02:00
Noel Grandin
6bb742b9cb convert STR_EVENT constants to scoped enum
- 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-29 10:41:40 +02:00
Michael Meeks
e8b97a52c9 Merge remote-tracking branch 'origin/feature/vclptr'
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-28 15:08:48 +01:00
Stephan Bergmann
e19cd844be Rephrase comparisons between bool and sal_Bool
...to cater for forthcoming loplugin:implicitboolconversion improvements

Change-Id: I801b6b73648715448198d582a087cc834f6e20c8
2015-04-28 10:21:01 +02:00
Stephan Bergmann
d0e9aa6a2b Dialog::Execute returns short/VclResponseType
Change-Id: I48d63276ae0aaeba169e1e783c44b428a58314ac
2015-04-28 10:19:37 +02:00
Stephan Bergmann
4911135f8b SbModule::Run return value is unused
Change-Id: I7cd697d944dc0efbd35b852fc553ba85bc88c15e
2015-04-28 10:19:37 +02:00
Stephan Bergmann
ed83ba34a5 loplugin:simplifybool
Change-Id: I6e181bc4b144c2559ede99d3bae0496cf546415c
2015-04-24 12:36:18 +02:00
Stephan Bergmann
2240118177 Improved loplugin:literaltoboolconversion looking into cond. exprs.
...automatic rewriter fixes

Change-Id: I6b04ca80f08f8a71ff94e309fd52f44d736751ee
2015-04-23 18:39:07 +02:00
Stephan Bergmann
b87db6a187 Update to XDocumentEventBroadcaster et al
Change-Id: Ie09223824af45e5e214169182a5cd189fd04f6ef
2015-04-22 15:38:43 +02:00
Julien Nabet
a75d907406 Related tdf#55502: Harden a bit
Change-Id: I56155e234b13ca3e9fb95565d08a38252eeba712
2015-04-19 15:40:56 +02:00
Caolán McNamara
4950c579d1 callcatcher: update unusedcode
Change-Id: I4b2a7ea03aafbfbf1fece1533da801a4326d80f9
2015-04-19 13:03:01 +01:00
Julien Nabet
41392516ca tdf#55502: Shell BASIC function with empty third param hangs
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-18 23:42:06 +02:00
Stephan Bergmann
9f23260105 SvStream: WriteUChar -> WriteBool
Change-Id: I89aa0e22c31d368ab36fe46917db6aacb11c7b14
2015-04-17 15:20:43 +02:00
Michael Meeks
5cc560f6c2 basctl, basic: convert new to ::Create.
Change-Id: I1fc2c69640ed625425a679380d6f25178bc5aeb1
2015-04-17 09:15:06 +01:00
Noel Grandin
71b809959b remove unnecessary use of void in function declarations
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-15 11:47:12 +02:00
Noel Grandin
ee094bd46f loplugin:staticmethods
Change-Id: If97f01a05294fa7efd59a8934c7b6f65cda5084a
2015-04-13 09:37:12 +02:00
Arnaud Versini
4e0d2fcdda BASIC: Merge BasicLibs with BasicManagerImpl and use boost::ptr_vector.
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-13 06:19:23 +00:00
Michael Meeks
8a65284fe3 Automated conversion of VclPtr construction to use Instance template.
Change-Id: I8be9141b9653e73ebd23a5a3d810f240c376f97e
2015-04-10 13:40:25 +01:00
Michael Meeks
5d133eb621 first half of non-scriptable, Instance constructor conversion.
Change-Id: If73bb41bfa805e22609748f25971724b4778edb3
2015-04-10 13:27:16 +01:00
Noel Grandin
61b224f392 vclwidget: fixup locally allocated vcl::Window objects
They need to be wrapped in ScopedVclPtr in order to be disposed properly.

Change-Id: Ib64dba353774f54711e4de7f5d15d859c6a4dc7e
2015-04-10 12:37:44 +01:00
Noel Grandin
6d0c89123f vclwidget: fix more places that should be wrapping in VclPtr
Change-Id: I31c9115662da2f81e1b22be91ee58e2862076b8e
2015-04-10 11:40:50 +01:00
Noel Grandin
d7a84ce840 vclwidget: only call dispose() once
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-10 10:55:36 +01:00
Noel Grandin
00f2787a4a vclwidgets: wrap all vcl::Window subclasses allocated on stack in VclPtr
Change-Id: Ia8b0d84bbf69f9d8f85505d019acdded14e25133

Conflicts:
	sw/qa/tiledrendering/tiledrendering.cxx
2015-04-09 22:17:00 +01:00
Noel Grandin
28c2cf4f56 vcl: VclPtr conversion in basic
Change-Id: Ia0330d596b696f914a8ee2f81f0399e9456ff87c
2015-04-09 21:02:13 +01:00
Stephan Bergmann
9222f5d065 A UNO Any can't contain an Any
...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-08 17:45:08 +02:00
Stephan Bergmann
5ba54aacd5 Remove dead INetProtocol::Vim
...which removes the need to abstract over the standard URI '%' escape prefix
vs. the silly vim '=' special case invention.

Change-Id: I54a52dd912c3aafc38275a0ac2466a6daeec328f
2015-04-07 20:21:21 +02:00