3441 Commits

Author SHA1 Message Date
Caolán McNamara
b35f3dfb1a coverity#706240 Uncaught exception
Change-Id: Ie31f5e1ff74ff8b9f35d7ce08e1f02a780375890
2014-07-01 16:43:05 +01:00
Norbert Thiebaud
42fcd888ae coverity#735397 dead code
Change-Id: If8d82a39af7a506f42b6c13d8408ffc479b564e7
2014-07-01 12:44:06 +02:00
Caolán McNamara
5ace3f3b4f clang scan-build: various warnings
Change-Id: I4bdfb074b3cf6fcb49765322308dfa4b9ed67713
2014-07-01 10:56:14 +01:00
Stephan Bergmann
e48a233960 loplugin:unreffun: also warn about redundant redeclarations
Change-Id: I9a812220b58cf6da00d854e65794f7c673ab239d
2014-06-27 15:27:39 +02:00
Caolán McNamara
daa6898578 clang: Dead initialization
Change-Id: Ieae5303e55f21044ef8e91e63c4896696cfad51c
2014-06-26 16:29:15 +01:00
Caolán McNamara
a7fcb3ed07 clang: Returning null reference
Change-Id: I2cfc14e73696a027283dfa5eef98f784505dc5a3
2014-06-26 16:29:13 +01:00
Caolán McNamara
2daceb87b9 clang: Uninitialized argument value
Change-Id: Id65c5815185cf022171e3523c6ad92545830104c
2014-06-26 16:29:13 +01:00
Kohei Yoshida
ec1636fa09 Remove this weird inheritance from smart-pointer-wrapped class.
SbxVarEntry is now its own class.

Change-Id: I5c5ce1990fa83930acced1d507f5b0de60bf221e
2014-06-25 15:03:46 -04:00
Kohei Yoshida
e14abb13dc Use boost::optional to store alias name.
Change-Id: I809b21ea156061a265c0d83d58534df10bc273bc
2014-06-25 15:03:46 -04:00
Kohei Yoshida
ff0ecb2621 pData -> mpVarEntries.
pData is a nightmare with grepping as it's too generic of a name.

Change-Id: I01b3f1b503f21ee13c97733fa66804874a2cddc4
2014-06-25 15:03:46 -04:00
Kohei Yoshida
bb6d9b0123 Remove this class that only derives from std::vector and not much else.
Change-Id: Ibc584f4148cec49a9ac34a240cc2fa3e87daf443
2014-06-25 15:03:46 -04:00
Noel Grandin
533c6cb6ba fixes for up-casting to Reference<XInterface>
Fix regressions introduced with
6a043e9c0acff20e1618ca8ec15c21d5d0fd0d37 "Use the new type-checking
Reference constructor to reduce code noise"

Change-Id: I85662856f21c810a7db497fe3b0e116f075b1687
Signed-off-by: Stephan Bergmann <sbergman@redhat.com>
2014-06-25 17:10:43 +02:00
Miklos Vajna
f870059a5a basic: silence expected SAL_WARN output
These were HACK() and DbgOut() messages previously, none of these ended
up on stderr. It seems that they are more or less harmless, so as long
as nobody fixes them, silence them, so more useful warnings are not
hidden when one does e.g. xray on a drawinglayer shape.

Change-Id: I7343d93d2916d9978852418aca725d027eb09128
2014-06-19 11:29:31 +02:00
Caolán McNamara
136a2bc384 coverity#1210096 Uncaught exception
Change-Id: I1d06c7a6a61556c2b501a16c224ccc6fe52307d0
2014-06-17 10:58:01 +01:00
Caolán McNamara
66f98136fd coverity#1210098 Uncaught exception
Change-Id: I531891fa1cce10a331dd651ee9ce52d1f8d0c169
2014-06-17 10:58:01 +01:00
Noel Grandin
3e82897353 improve the inlinesimplememberfunctions clang plugin
Change-Id: I6d5a952901648e01904ef5c37f953c517304d31e
2014-06-17 10:55:17 +02:00
Stephan Bergmann
f8ef1fe95b loplugin:staticcall
Change-Id: I6cd46964c523c9393e9d249fdb43aaa38679fa06
2014-06-13 17:54:23 +02:00
Caolán McNamara
2278e8f80e coverity#1213486 Uncaught exception
Change-Id: Ia4d919d88bf22168aa770ad35fd8360b0b155efe
2014-06-13 09:50:53 +01:00
Markus Mohrhard
9284a63add iprevent violation of exception spec
Change-Id: I1f638ae3a2e88e0cadaab0046ef087fe77e16b06
2014-06-10 15:58:24 +02:00
Noel Grandin
184a00b962 loplugin: inlinesimplememberfunctions
Change-Id: I42119f656ca528286fb25d2d36c0af54b7d04a6b
2014-06-09 10:10:13 +02:00
Stephan Bergmann
457933f1aa Do not both _use_library_objects and _use_libraries sb
Change-Id: I11f667104a0ca7279542fab53ad754d4de8c807d
2014-06-04 16:53:54 +02:00
Stephan Bergmann
e6655225e6 Avoid static BasicDLL (that would be destroyed after DeInitVCL now)
Change-Id: Id8968a7746815ecce79b6eb1ce971b74e770efa4
2014-06-04 10:16:06 +02:00
Stephan Bergmann
369d95931f DeInitVCL at end of tests
This required some changes to the framework:

* Init-/DeInitVCL is no longer done per individual test in BootstrapFixture, but
  once per CppunitTest invocation in a new vclbootstrapprotector (similarly to
  the exisiting unobootstrapprotector).  CppunitTests that need VCL now need to
  declare gb_CppunitTest_use_vcl.

* For things to work properly, the UNO component context needs to be disposed
  from within DeInitVCL (cf. Desktop's Application::DeInit called from
  DeInitVCL).  The easiest solution was to introduce an
  Application::setDeInitHook (where the hook is called from DeInitVCL)
  specifically for vclbootstrapprotector to call.

* PythonTests don't (yet) call DeInitVCL; they still hook into
  BootstrapFixture's original test_init functionality (to call InitVCL), and do
  not make use of the vclbootstrapprotector.

Change-Id: I4f3a3c75db30b58c1cd49d81c51db14902ed68b2
2014-06-04 08:55:12 +02:00
Thomas Arnhold
dd8f095940 WaE: warning C4101: 'ex' : unreferenced local variable
Change-Id: Ib8b71b50fe52a7cc4e261626549ac3e067851797
2014-06-04 08:30:26 +02:00
Thomas Arnhold
3038794d2e basic: typo
Change-Id: I10c9e480a94a966dac4f6c17fc69fa8892c56955
2014-06-02 12:04:31 +02:00
Stephan Bergmann
6b4c596b01 Fix memory leak for BASIC sub (as well as void function)
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-06-02 11:12:11 +02:00
Takeshi Abe
6a53ea218c Avoid possible memory leaks in case of exceptions
Change-Id: Iad3de981a1c9660b1322315640e531c9891db0bf
2014-05-31 00:35:27 +09:00
Kohei Yoshida
a916b6ff7f Detach all DocBasicItem objects upon process termination.
To prevent rogue DocBasicItem objects (which are global objects) from
attempting to stop listening after the main app is dead.

Change-Id: I68a667137ca4e0eff18278f4d2d5dd67466eaf34
2014-05-29 21:59:48 -04:00
Kohei Yoshida
5a827671d1 Avoid static local of a singleton. This crashed writer unit tests.
Change-Id: I7c5f2d372676cdb317a8dad636bf1aab7dd5db37
2014-05-29 21:59:42 -04:00
Takeshi Abe
a71ae24a23 Avoid possible memory leaks in case of exceptions
Change-Id: Iac63a5d60478e5cd8e2b77c889c7b312d3d15f67
2014-05-29 09:29:15 +09:00
Caolán McNamara
3d046b753d coverity#706235 Uncaught exception
Change-Id: I06321ca2b686207a1d9bd698461aedf84daf31e1
2014-05-28 13:49:50 +01:00
Caolán McNamara
9986fe77f4 coverity#706234 Uncaught exception
Change-Id: I7542008369ed3433cd8bfce7702f036148195516
2014-05-28 13:49:50 +01:00
Caolán McNamara
cf16d4eb9d coverity#706232 Uncaught exception
Change-Id: I07e13af4f4578d5d6823b6d10aa9c37d04ecc395
2014-05-28 13:49:49 +01:00
Caolán McNamara
1b48561586 coverity#706231 Uncaught exception
Change-Id: I1f1acb91a97ff7c9fb50ad36eca7b91d361a1276
2014-05-28 13:49:49 +01:00
Stephan Bergmann
145b64c4eb Avoid undefined signed integer overflow
Change-Id: I3f32ea88dbb34a05baccba49c15b6691d923753e
2014-05-28 14:34:13 +02:00
Stephan Bergmann
a77a7f6083 Fix memory leak
...by using css::uno::Type instead of a naked typelib_TypeDescription.

Change-Id: I387692265e9e032cb5ed6519739ebb3307db6f28
2014-05-28 14:34:12 +02:00
Stephan Bergmann
b8a329989c Fix memory leak (missing typelib_TypeDescription_release)
...by radically simplifying TypeToIdlClass().  It is unclear to me why this was
so complicated.  The only mildly plausible reaons would be that the old code
was careful to return null instead of throwing an exception for an unknown type,
but the TypeToIdlClass-call-sites either strongly expect a non-null return value
(by dereferencing it without any further checking) or use OSL_ASSERT or similar
to verify it.  So lets hope this is good.

Change-Id: I3e24eb6117e84c9d33f4c5f0e2fa88da4c4f2c30
2014-05-28 14:34:12 +02:00
Thomas Arnhold
ea491d056d OSL_TRACE -> SAL_INFO
Change-Id: Ib9e1ed6119b5286871ac10136f7fcbefffe7aebe
2014-05-27 12:34:30 +02:00
Noel Grandin
0f2824b117 remove more unnecessary use of OUString constructor
Change-Id: Iae14cb3df65295b6894fd9e05411c5698e9c8aba
2014-05-27 08:20:12 +02:00
Noel Grandin
e7bc3cab01 remove boilerplate in UNO Exception constructor calls
Now that we have default values for Exception constructor params,
remove lots of boilerplate code.

Change-Id: I620bd641eecfed38e6123873b3b94aaf47922e74
2014-05-23 15:06:00 +02:00
Noel Grandin
c5d47c327a add default value for Context param in uno::Exception constructors
and all it's subtypes, which is almost never used, so this allows us to
simplify lots of call sites.

Change-Id: I0b05793ea2bdd1027679f63252d42ce4af89433b
2014-05-23 15:05:59 +02:00
Julien Nabet
b09b5f8f7c Prefer cppu::UnoType<T>::get() to ::getCppuType((T*)0) part19
Change-Id: Iab50c52a132c90389992ef68c2d31df95a193ab9
2014-05-22 23:21:18 +02:00
Michael Stahl
5246fa2624 fdo#68983: basic: if the library is not loaded fully, copy source storage
Also fixes fdo#42899 and fdo#67685 in a different way; the previous fix
for fdo#42899 caused the problem with password-protected libraries for
which the password is not known: only the binary representation of the
BAISC module was stored, not the source code; by simply copying from the
source storage the problem can be avoided.

It would be possible to ask for the password when storing, but that
would not work when non-interactive (called via API).

An alternative fix would be to pass in the
SfxObjectShell::IsSetModifyEnabled() flag and actually reset the BASIC
library's modify flag correctly, but that requires adding a
parameter to XStorageBasedLibraryContainer::storeLibrariesToStorage().

(regression from af34774d260a68fc02cd78ba90dd8d4afaf1a2a4 )

Change-Id: I4701401f35171139fc2fe8d225d13d4e533091a0
2014-05-22 13:12:55 +02:00
Michael Stahl
5ca4b9d510 Revert "fdo#67685 open xSourceLibrariesStor only when needed"
This reverts commit fc9080a0c60f263d00eb71111fcda72b3c0a2ebb.

This bug was apparently introduced by
af34774d260a68fc02cd78ba90dd8d4afaf1a2a4, which will be reverted
in the next commit.

Change-Id: I81ccb5bf9cc7e29fbf1e66d02f38268ee1fd1d0c
2014-05-22 13:12:55 +02:00
Michael Stahl
0e21019e0d fdo#68983: Revert "remove #if 0 block (from ...
... af34774d260a68fc02cd78ba90dd8d4afaf1a2a4)"

This reverts commit cbd1a89676f39135ed2e9c47d20475b2053289b9.

Conflicts:
	basic/source/uno/namecont.cxx

Change-Id: I665f2e875c6b339ad718ca53fd0e54328efaeaff
2014-05-22 13:12:55 +02:00
Thomas Arnhold
df466d79cb fdo#70474: Random number generation weak with Rnd in BASIC
Just reuse the rng functionality. This improves the randomness.

Initialize seed with system time if no argument for RANDOMIZE is given. As the help text
states: "If Number is omitted, the generator uses the current value of the system timer".

Change-Id: I5fa46e8344b2402dff66a8db2449d43e2ca27d6d
Reviewed-on: https://gerrit.libreoffice.org/9349
Reviewed-by: Thomas Arnhold <thomas@arnhold.org>
Tested-by: Thomas Arnhold <thomas@arnhold.org>
2014-05-17 12:40:58 +00:00
Julien Nabet
68741d0055 Prefer cppu::UnoType<T>::get() to ::getCppuType((T*)0) part13
Change-Id: Ieecfd7ccb10c75ac639d0ba8e7cb588607097c2a
2014-05-15 22:52:22 +02:00
Caolán McNamara
9831dc20ab coverity#441607 Dereference null return value
Change-Id: Ibec5bb74a708786e71f9e9a53be71e9cc50c5b69
2014-05-15 10:21:21 +01:00
Thomas Arnhold
4aa690c2e4 basic: use prewin.h
Change-Id: I49b797b170b3fd74324eede9d3b6b6ec106e62e4
2014-05-14 17:57:32 +02:00
Noel Grandin
b2096deaff various loplugin:passsequencebyref
Change-Id: Id1045a7f66b4fa10b6491587ba07246a31ceba72
2014-05-14 16:54:27 +02:00