4054 Commits

Author SHA1 Message Date
Stephan Bergmann
c0ee13464f Avoid OUString::operator[] out-of-bounds assertion when line ends with "&"
Change-Id: I430e1df81a378243b139c654869589f1a75f5897
2016-08-22 16:20:56 +02:00
Caolán McNamara
4a647a04a7 Resolves: tdf#88953 byref args incorrectly passed in basic->c++
partial revert

of

commit 22b094f5d8e1e82375b135abd3a6f99a9a555244
Date:   Tue Jul 14 14:50:07 2015 +0200

    loplugin:unusedmethods basic

and partial revert of...

commit e2080e70fe8b085f18e868e46340454720fa94ca
Date:   Wed Jun 18 12:14:29 2014 +0200

    new compilerplugin returnbyref

and revert of...

commit 536051f8862203e0e115a5394a6379acd83cc8fe
Date:   Wed Jul 15 14:04:01 2015 +0200

    fix Windows build

    after commit 22b094f5d8e1e82375b135abd3a6f99a9a555244
    "loplugin:unusedmethods basic"

Change-Id: I612937334fdb75365080c98a9d4da5ed7ae647e3
2016-08-19 16:55:56 +01:00
Stephan Bergmann
8f30da6386 Some clang-tidy misc-move-constructor-init
...by turning the relevant ctor parameters into "const &".

Change-Id: Ia8d0aba5da10ad6b25f8689e2281e45b3d71c1fc
2016-08-19 16:55:06 +02:00
Arnaud Versini
93de766121 basic: Simplify SbxArray
Change-Id: Idcc1e35d0a1d80591e2cebdae37a70cf029b022e
Reviewed-on: https://gerrit.libreoffice.org/28147
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
Tested-by: Noel Grandin <noelgrandin@gmail.com>
2016-08-16 06:42:36 +00:00
Arnaud Versini
3093732c17 basic: SbxBase should be abstract
Change-Id: Ief4297e5c64cfb29645463aca3cc677dc06fc95a
Reviewed-on: https://gerrit.libreoffice.org/28112
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
2016-08-15 06:54:11 +00:00
Arnaud Versini
cb3a00514a BASIC: Use more often std::unique_ptr
Change-Id: I37f3b35afcf3b4dba30a6ba841a59e0d851f1ebb
Reviewed-on: https://gerrit.libreoffice.org/27930
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
Tested-by: Noel Grandin <noelgrandin@gmail.com>
2016-08-13 11:47:50 +00:00
Arnaud Versini
a22328eea3 BASIC: Use rtl/character.hxx in basic/source/sbx/sbxscan.cxx
Change-Id: I018bc2881bca1973ef5e5133f3954252d5cea65e
Reviewed-on: https://gerrit.libreoffice.org/27993
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
2016-08-09 06:26:50 +00:00
Arnaud Versini
31186a1c71 BASIC: Remove useless BasicManagerImpl streams.
Change-Id: Iac5683afd20d8a2b7bc43474580bd1d05ace562b
Reviewed-on: https://gerrit.libreoffice.org/27934
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
2016-08-08 06:33:45 +00:00
Arnaud Versini
f5615df5e8 BASIC: Move SbiParser's destructor to cpp file.
Change-Id: Id920a83693969ab2d93047524a9affa267a231dc
Reviewed-on: https://gerrit.libreoffice.org/27931
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
2016-08-08 06:32:32 +00:00
nadith
c85a3ac70d tdf#100726: Improve readability of OUString concatenation
all most all of the places in the basic basctl modules this bug fixed

Change-Id: I1a4a03e207c1b520449c31a05265585120da07f6
Reviewed-on: https://gerrit.libreoffice.org/27662
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
2016-08-04 05:53:34 +00:00
Noel Grandin
e5e7475feb loplugin:countusersofdefaultparams in basctl..basic
Change-Id: I16fac3317ebf55581cb9aaef676a9759de51d695
Reviewed-on: https://gerrit.libreoffice.org/27793
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
2016-08-04 05:46:22 +00:00
Arnaud Versini
8b03ea6555 BASIC: Remove completly useless osl/thread include
Change-Id: I60c0b5d273344cb23c1226d7f2da81b6ee55892b
Reviewed-on: https://gerrit.libreoffice.org/27753
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
2016-07-31 19:42:16 +00:00
Noel Grandin
508c95f1b6 improve passstuffbyref return analysis
Change-Id: I4258bcc97273d8bb7a8c4879fac02a427f76e18c
Reviewed-on: https://gerrit.libreoffice.org/27317
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
2016-07-27 06:48:25 +00:00
Caolán McNamara
a860df25dd masses of MessBoxes not being disposed promptly
since...

commit ba81e5c6bd420b41a84ade6ccd774011a8089f7f
Date:   Thu May 28 21:35:43 2015 +0100

    tdf#91702 - fix stack-based MessBox allocation.

There is no special ScopedVclPtr<X>::Create or
ScopedVclPtrInstance<X>::Create just
VclPtr<X>::Create and a raw VclPtr<X>::Create()->foo
doesn't call dispose on the owned X

Change-Id: Ifacc8d5e742820701307c3c37b9b86487667d84f
2016-07-26 11:26:52 +01:00
Miklos Vajna
4e6d0f6fe7 basic: fix loplugin:cppunitassertequals warnings
Change-Id: I80c773f3127ebbce4b9b2a122a91a2e2ca4f505b
Reviewed-on: https://gerrit.libreoffice.org/27424
Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
Tested-by: Jenkins <ci@libreoffice.org>
2016-07-22 08:32:36 +00:00
Caolán McNamara
2aed0d49d7 Resolves: tdf#98778 fix parsing of exponents
regression from...

commit 9e9f39d171cafa035d7b8e74187e25c3581cb89d
Date:   Tue Mar 19 23:23:16 2013 +0100

    resolved rhbz#919020 Basic CDbl() and CSng() scan localized number

Change-Id: I96535fd9bc9ec59d6e07739a3118c96eb2d8bd05
Reviewed-on: https://gerrit.libreoffice.org/27342
Reviewed-by: Eike Rathke <erack@redhat.com>
Tested-by: Eike Rathke <erack@redhat.com>
2016-07-20 15:55:01 +00:00
Arnaud Versini
ee2ad513de BASIC: Remove useless overrides
Change-Id: I49eb680bb0945a65a98978e98750fd62669fd820
Reviewed-on: https://gerrit.libreoffice.org/27255
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
2016-07-18 07:03:43 +00:00
nadith
054cf21948 tdf#100726: Improve readability of OUString concatenation in basic module
Change-Id: I96c3215cf9f8932127e681aaaaee649774cac2e4
Reviewed-on: https://gerrit.libreoffice.org/27229
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
2016-07-15 08:39:51 +00:00
Noel Grandin
38ae35db26 tdf#84635 - Slow layout of large tables
Based on suggestion from Aron Budea.
And do something similar to most other places keeping vectors
of weak references where the code looks like it will hold more than
a few entries.

Measurements:
the 26 page file file takes
    51s without my path
    15s with this patch
the 69 page file file takes
    5m28 without my path
    51s with this patch
the 84 page file file takes
    8m28 without my path
    58s with this patch

Change-Id: I8da94c525fc73ebd969e0343c6f074be4f0063b1
Reviewed-on: https://gerrit.libreoffice.org/27093
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
2016-07-13 13:08:16 +00:00
Arnaud Versini
9b0995439e BASIC : Remove useless 16bits Remove function from SbxArray
Change-Id: I050a034437d3370a28c9e5ab47abee369e634f7d
Reviewed-on: https://gerrit.libreoffice.org/27089
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
2016-07-11 07:28:16 +00:00
Eike Rathke
6d4f2dcc7c Resolves: tdf#100452 class Date full (BCE,CE) proleptic Gregorian calendar
... implementing signed years with year 0 gap.
Date(31,12,-1) last day BCE
Date(1,1,1) first day CE

New class Date member functions:
* AddYears(sal_Int16) to be used instead of
  aDate.SetYear(aDate.GetYear()+sal_Int16) to handle year 0 gap.
* convenience GetNextYear() to be used insted of GetYear()+1
* convenience GetPrevYear() to be used insted of GetYear()-1
* AddMonths(sal_Int32)
* operator=(const css::util::Date&)

New class DateTime member functions:
* operator=(const css::util::DateTime&)

Made some conversion ctors explicit, specifically Date(sal_Int32)

Adapted hopefully all places that used a sal_uInt16 year to use
sal_Int16 where appropriate.

Eliminated some quirks in date handling found on the fly.

Added era handling to i18npool icu calendar setting interface, which
missing was responsible for 0001-01-01 entered in Calc being set as
-0001-01-01, hence subtracting one day resulted in -0002-12-31.

Change-Id: I77b39fba9599ebd5067d7864f6c9ebe01f6f578f
Reviewed-on: https://gerrit.libreoffice.org/27049
Reviewed-by: Eike Rathke <erack@redhat.com>
Tested-by: Jenkins <ci@libreoffice.org>
2016-07-08 20:41:02 +00:00
Stephan Bergmann
7fdbdc5367 loplugin:redundantcast: redundant static_casts in basic
Change-Id: I6504cb70518f8770a0d44b1fb4d8ad91e43dc2b6
2016-07-08 16:47:31 +02:00
Stephan Bergmann
0b424c2506 loplugin:passstuffbyref also for {css::uno,rtl}::Reference
Change-Id: I614d91e7e4a686613dc0cbe1b9f4fabb978ffc77
2016-07-07 18:59:55 +02:00
Muhammet Kara
d5784e91e9 Improve readability of OUString concatanation in LibPage
, ScriptDocument
, PropBrw
, VBATest
, SbUnoClass
, SbModule
, and SbiSymPool

It is more readable and more efficient as a bonus.
See: https://goo.gl/jsVAwy:

Change-Id: I73926989345193b133e538d5aeca36f12723162c
Reviewed-on: https://gerrit.libreoffice.org/26853
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Markus Mohrhard <markus.mohrhard@googlemail.com>
2016-07-03 15:46:58 +00:00
apurvapriyadarshi
e4b3323587 tdf#96505 Get rid of cargo cult long integer literals
Cleanup in basic/source/runtime/runtime.cxx

Change-Id: I1176251af9c4ca56c29dfafab20caccd7a28d60f
Reviewed-on: https://gerrit.libreoffice.org/26627
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
2016-06-27 06:20:18 +00:00
Noel Grandin
cea4c1afdf loplugin:singlevalfields in basic and fix leak
And fix leak in BasicManagerImpl where it would never have freed
the streams.

Change-Id: I1e99c2c6a70a8cac27dd5c86a7042efc3de7a578
Reviewed-on: https://gerrit.libreoffice.org/26632
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
2016-06-27 05:17:31 +00:00
Michael Stahl
136a2fd6c0 compilerplugins: add OWeakObject::release() override check
Change-Id: I767857545d7c91615cf162790c04f0016de9fdf6
Reviewed-on: https://gerrit.libreoffice.org/26555
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Tested-by: Stephan Bergmann <sbergman@redhat.com>
2016-06-24 12:05:09 +00:00
Gökhan Gurbetoğlu
9b9e5cfd2f tdf#99589 - tolower / toupper - dangerous to Turks ...
Change-Id: I8b0fe9354232a7b60f3605fa6f90f6741f7bf683
Reviewed-on: https://gerrit.libreoffice.org/26537
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: jan iversen <jani@documentfoundation.org>
2016-06-23 09:59:49 +00:00
Muhammet Kara
fafb309d2e prefer OUStringBuffer to concatenating OUString in a loop
And improve OUString readability and efficiency.
See: https://goo.gl/jsVAwy:

Change-Id: I8d847b1ca3cde7cb8733d6f8a649612745cf6aae
Reviewed-on: https://gerrit.libreoffice.org/26511
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
2016-06-21 06:43:57 +00:00
Caolán McNamara
9f0997eb16 Resolves: tdf#59222 Crash in Basic with an array of values...
from a range address

trying to make all SbxVariables reference count their parents
is ludiciously hard, so just reference count this one known
crashing case

Change-Id: Ie1fa6624e8184146dd00d766cdbacef674153ef6
Reviewed-on: https://gerrit.libreoffice.org/26272
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
2016-06-14 19:54:26 +00:00
Caolán McNamara
4e596d1cb1 drop dramatic distracting comment
Change-Id: Ic4b5537075e7ea9a713409982bb21e12f6b53e3f
Reviewed-on: https://gerrit.libreoffice.org/26271
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
2016-06-14 14:53:44 +00:00
Stephan Bergmann
9c6a58f8c4 Clean up uses of Any::getValue() in basic
Change-Id: Ice269eae6b0278d5e089d973aae72b3f871c1272
2016-06-14 16:02:55 +02:00
Noel Grandin
272a8afa60 convert more DBG_ASSERT(false to SAL_WARN
Change-Id: Ie52f28f28c67a91c4d3d4517d5c6a466890c7a55
Reviewed-on: https://gerrit.libreoffice.org/26195
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
2016-06-12 18:10:44 +00:00
Arnaud Versini
c0d7dfa56c BASIC : Add SbModule::FindMethod
Change-Id: I3418c4a3d24b3b6630d6c80a6c8aa9d4ffb7e73a
Reviewed-on: https://gerrit.libreoffice.org/24346
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
2016-06-12 07:43:03 +00:00
Stephan Bergmann
4d49c9601c Let loplugin:passstuffbyref also look at fn defn not preceded by any decl
Change-Id: I752bc96d2d521d790e919283cabb14b6526626f4
2016-06-08 17:14:34 +02:00
Michael Stahl
62d270116b tools: rename SvStream::Read/Write to ReadBytes/WriteBytes
Change-Id: Ib788a30d413436aa03f813aa2fddcbc4d6cd2f9a
Reviewed-on: https://gerrit.libreoffice.org/25972
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Michael Stahl <mstahl@redhat.com>
2016-06-06 18:09:11 +00:00
Xisco Fauli
0216b8dc61 tdf#89329: use unique_ptr for pImpl in sbxvar
Change-Id: I74734c34e72ba5d508830dbcff88f0d3b93a0766
Reviewed-on: https://gerrit.libreoffice.org/25742
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
2016-06-03 10:25:36 +00:00
Noel Grandin
f3c1d240bd loplugin:constantparams
Change-Id: Ib162ba9297b9d900ea42c7e5216e152d3e58a361
Reviewed-on: https://gerrit.libreoffice.org/25769
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
2016-06-03 09:08:42 +00:00
Caolán McNamara
9a0fd9c7f4 Resolves: tdf#93386 crash when closing a Database with macro editor open
Change-Id: Id3ecee744cb10f539f2b57e83a4b6e4c7744d3d5
2016-05-31 17:33:52 +01:00
Noel Grandin
0b23eec200 teach refcounting clang plugin about uno::Reference
uno::Reference is only allowed to used with classes that have a
::static_type member.
So convert all those places to rtl::Reference.

Maybe we need some LIBO_INTERNAL_ONLY constructors on rtl::Reference and
uno::Reference to make this a little smoother?

Change-Id: Icdcb35d71ca40a87b1dc474096776412adbfc7e3
Reviewed-on: https://gerrit.libreoffice.org/25516
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
2016-05-31 06:25:45 +00:00
Stephan Bergmann
e630df7853 Just use Any::operator <<= for sal_Unicode values
...now that sal_Unicode no longer clashes with sal_uInt16 on any platform (in
LIBO_INTERNAL_ONLY code), after e16fa715c43dcdf836ce8c400b6d54eae87b627d "Handle
wchar_t as native C++11 type on windows"

Change-Id: Id423dd6235bf14823fa5611b804c0974edbe64b3
2016-05-30 14:31:24 +02:00
Tomofumi Yagi
d2a44e6270 tdf#99696 fix build error for 64bit Windows in unit tests using ADODB
This patch fixes the problem that the build for x64 fails in basic module
on 64bit Windows installed 32bit Excel Application.

New code checks the existance of ODBC driver for excel insted of the
existance of Excel application(at this time the bitness of ODBC driver for
excel would match that of building LibreOffice).

What we need is probably not Excel Application but ODBC drivers for proper
bitness.

Change-Id: I62285eb2351f2022754fc34cb2d54db1bd9e8142
Reviewed-on: https://gerrit.libreoffice.org/25301
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Michael Stahl <mstahl@redhat.com>
2016-05-30 09:30:33 +00:00
Noel Grandin
850a8d27ca Convert GRAPHIC to scoped enum
Change-Id: I1fd09a729cbda00f99841532e0dd3fa66bce7bea
Reviewed-on: https://gerrit.libreoffice.org/25534
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
2016-05-27 12:59:23 +00:00
Xisco Fauli
132f7b2a8c tdf#89329: use unique_ptr for pImpl in basmgr
Change-Id: I2d6c6b997155183b058872db354de1b407998d3a
Reviewed-on: https://gerrit.libreoffice.org/25472
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
2016-05-26 07:46:38 +00:00
Andrea Gelmini
2af018e4dd Fix typos
Change-Id: I860cc4aa04b4e5cd1437b2f24176ee2ccdec3266
Reviewed-on: https://gerrit.libreoffice.org/25420
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
Tested-by: Noel Grandin <noelgrandin@gmail.com>
2016-05-25 09:50:55 +00:00
Caolán McNamara
fef6bb7af2 Resolves: tdf#93474 crash on importing a macro library
its a SfxLibrary which is not a XLibraryContainer

(a SfxLibraryContainer is however)

I think the issue is simply an empty name making code go down the container
rather than library route.

Change-Id: Ib0245d402fe375ac26ab9f2b14fe708b2a34a7a7
2016-05-24 19:09:51 +01:00
Noel Grandin
f107d45381 Convert SbxClassType to scoped enum
Change-Id: I48afcdd9924d22b52a8db21aa253061e4d38c85b
Reviewed-on: https://gerrit.libreoffice.org/25259
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
2016-05-23 11:49:32 +00:00
Noel Grandin
d4d2fc2479 clang-tidy modernize-make-unique
Change-Id: I550bb69ddcef69906027516ccde62cf8e87c295b
Reviewed-on: https://gerrit.libreoffice.org/25138
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
2016-05-19 08:33:10 +00:00
Noel Grandin
2c8fe2e737 update unusedmethods plugin to deal with constructors
and fix the operator< implementations in some of the other
plugins too.

Change-Id: Ie5631e0cdc8d2a994ad2af2533cdb558a6cfc035
Reviewed-on: https://gerrit.libreoffice.org/25057
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
2016-05-18 10:03:44 +00:00
Andrea Gelmini
a9ff36a1e9 Fix typos
Change-Id: If7262e114b5b4cd40e9c0a8929940199ea747595
Reviewed-on: https://gerrit.libreoffice.org/25025
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: jan iversen <jani@documentfoundation.org>
2016-05-16 06:18:47 +00:00