789 Commits

Author SHA1 Message Date
Andrea Gelmini
534b2a4b58 Fix typos
Change-Id: Ice72f8d9971e15dd6ef365e64cd567b8581a92d3
Reviewed-on: https://gerrit.libreoffice.org/21797
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
2016-02-05 06:48:38 +00:00
Noel Grandin
c2a8ee9c56 more Windows build fixes
after my OInterfaceContainer2 change

Change-Id: I4adb4a1937c12c1f6cb9183d567afb729d4e78ea
2016-01-25 15:26:00 +02:00
Noel Grandin
752cd07d08 InterfaceContainer2 with vector instead of Sequence
create an InterfaceContainer2 class to replace InterfaceContainer.
It uses a std::vector instead of a Sequence for the mutable listener
list, which provides far better performance.

Switch all our internal use-sites to the new class.

Change-Id: I6b56cfa511ded2395faa22e68fab3b2f16c3cb88
2016-01-25 08:52:03 +02:00
Stephan Bergmann
13ca560d13 Fix memory leak
Change-Id: I82ce013a42ac1cd9bb4f3842e9fba8fbc6056b3c
2016-01-13 08:04:49 +01:00
Andrea Gelmini
64d624b651 Fix typos
Change-Id: I9a5940027423ff0791fa7da0b79b617412ce6b86
Reviewed-on: https://gerrit.libreoffice.org/21209
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
2016-01-10 14:17:20 +00:00
Caolán McNamara
c9be2744d8 cppcheck: noExplicitConstructor
Change-Id: Ifdcb1cc12645d6cdba81d16f94f0268696187cde
Reviewed-on: https://gerrit.libreoffice.org/21201
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
2016-01-07 19:27:28 +00:00
Noel Grandin
004803c0d8 loplugin:unusedfields in desktop
Change-Id: Ic816a7faf4d357d16c13f67533b3b409a531d14c
2015-12-23 08:13:54 +02:00
Michael Stahl
17662cd7d4 embeddedobj: do not automatically convert alien objects to own
OleEmbeddedObject::changeState() calls TryToConvertToOOo() on non-WNT
platforms, which appears highly questionable to me, added in commit
0c3d5fb0ad35ff7fc18917fc86fa58d9312fe3ae.

What this does effectively is load the embedded object, store it as ODF,
and then load it again as ODF.

For one, it doesn't work in all cases currently.  If changeState() is
not called from the UI but from some filter code, then no m_xClient may
be set on the OleEmbeddedObject, hence no m_xClient will be set on the
new m_xWrappedObject.  Then loading the embedded object will raise
errors due to missing BaseURL, and storing it will fail in
SfxObjectShell::SaveTo_Impl().  (It would be possible to solve that by
copying the "DefaultParentBaseURL" handling code from
OCommonEmbeddedObject.)

The only reason why the previous code in ShapeExport::WriteOLE2Shape()
was able to export the object despite the error is that it does not call
SfxBaseModel functions but directly invokes the export filter, so the
sfx2 code does not get an opportunity to check its error status.

For another, doing this only on non-WNT platforms is also hazardous.

It's probably better to leave conversion to own formats to an explicit
UI action, as the OleEmbeddedObject::doVerb(-9) magic currently does,
where it can hopefully be assumed that the caller at least established
the client connection first.

Change-Id: Ice3d8f8ceabe81b6e9025957c3eb87de9dbfe61a
2015-12-20 00:56:06 +01:00
Michael Stahl
1a18c92a52 consolidate MSO format ClassID magic numbers in msfilter/classids.hxx
Change-Id: I673eeaa4168f769cb002995c43d986ee5f2030b2
2015-12-08 22:11:43 +01:00
Stephan Bergmann
018b561aa4 -Werror,-Wunused-function
Change-Id: I6103a8539c4d788fff1a7e3c3530a6ec7cd1f0c6
2015-11-28 08:44:46 +01:00
Noel Grandin
a508f639a0 mark UNO structs as SAL_WARN_UNUSED, where possible
Change-Id: Ie3de518f60c9f1313c68df54dbdc1fb2804f1f0d
2015-11-26 13:26:25 +02:00
Stephan Bergmann
09efeeb41a loplugin:nullptr (automatic rewrite)
Change-Id: I225d5fe2e3476121e2ca307d815d5615e32311d7
2015-11-10 10:31:24 +01:00
Stephan Bergmann
4770941171 loplugin:stringconstant: elide explicit ctor usage (automatic rewrite)
Change-Id: I5528b17c106aefde4c58dfef00e30fdcf62f7db7
2015-11-06 09:35:43 +01:00
Noel Grandin
59b072e22b yyyyy
Change-Id: I9a947beefd2dfe21da8239e841ea3fb416bd1548
2015-11-04 14:10:44 +02:00
Noel Grandin
3c971162b5 use uno::Reference::set method instead of assignment
Change-Id: I150f213ab033f5fc1b50abe4e1529292206c9feb
Reviewed-on: https://gerrit.libreoffice.org/19689
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
2015-10-31 12:56:38 +00:00
Noel Grandin
3bc5df7f32 UNO: no need to use OUString constructor when calling createInstance
Change-Id: I37da28539b94706574116d0fff5f008aabfb5526
Reviewed-on: https://gerrit.libreoffice.org/19682
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
Tested-by: Noel Grandin <noelgrandin@gmail.com>
2015-10-30 08:59:59 +00:00
Stephan Bergmann
b36963c0a6 Replace "SAL_OVERRIDE" with "override" in LIBO_INTERNAL_ONLY code
Change-Id: I2ea407acd763ef2d7dae2d3b8f32525523ac8274
2015-10-12 17:52:29 +02:00
Noel Grandin
e6534a6099 com::sun::star->css in embeddedobj/
Change-Id: Ia04fc28ce8e1d70f86520edf2df8c98f7b455465
Reviewed-on: https://gerrit.libreoffice.org/19024
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
Tested-by: Noel Grandin <noelgrandin@gmail.com>
2015-10-01 08:03:29 +00:00
Andrea Gelmini
00d2eeebc8 Fix typos
Change-Id: Iaa9dd3f02f21947742643349d3b878126017477d
Reviewed-on: https://gerrit.libreoffice.org/18947
Reviewed-by: Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de>
Tested-by: Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de>
2015-09-30 12:25:15 +00:00
Caolán McNamara
35fd0cf311 cppcheck: noExplicitConstructor
Change-Id: I39194062ba68c4cb1ccc9b93c629f005ccd02497
2015-09-13 22:42:35 +01:00
Noel Grandin
719c55cda7 loplugin: defaultparams
Change-Id: I455b200febc9939f3fb81597938b26c0e9eb5f74
2015-08-14 10:52:47 +02:00
Takeshi Abe
b03f6f45f4 tdf#88206 replace cppu::WeakImplHelper* etc.
with the variadic variants in embeddedobj.

Change-Id: I60aad1267b664825f781c085fb33612bce3f7221
Reviewed-on: https://gerrit.libreoffice.org/17474
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
2015-08-03 06:50:37 +00:00
Noel Grandin
38023af6c1 loplugin:unusedmethods
Change-Id: If5090c330e12d6e537766bf4a9be0a2360381a7a
Reviewed-on: https://gerrit.libreoffice.org/17312
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
2015-07-24 10:36:20 +00:00
Markus Mohrhard
faed29cac9 for now show chart sidebar
This is a hack that needs to be cleaned up later.

Change-Id: I2772fe6ff8a4792d746a29653635d3eca4088e68
2015-07-16 08:15:17 +02:00
Markus Mohrhard
4ecd67b7ed fix indentation
Change-Id: I4bceb79ed4adda085727dfcee1ba3573811e53b3
2015-07-16 08:15:16 +02:00
Markus Mohrhard
f2b218468f fix indentation
Change-Id: Ifda010d2a8f51c6981cac889bfaa1edaacd22df2
2015-07-16 08:15:16 +02:00
Caolán McNamara
7e5e4ac54c coverity#1308586 Uncaught exception
Change-Id: I86097e94dd47153a919bb7721376c5b98b50354e
2015-06-29 12:58:03 +01:00
Andrea Gelmini
69c88a32aa Fix typos
Change-Id: Ifd126a535f18db79a18aaec61b76cdf26ab33dff
Reviewed-on: https://gerrit.libreoffice.org/16522
Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
Tested-by: Julien Nabet <serval2412@yahoo.fr>
2015-06-28 12:28:31 +00:00
Caolán McNamara
4ec27ad35f Resolves: tdf#91683 Revert avoid activating chart objects...
just to get their mapunit or set visual size.

Will have to try something different here apparently

This reverts commit 757f461ef12548af0be470f7c05ff67df3dc1314.

(cherry picked from commit f2b3519c6b2aceacbe2fd9d53eb52dd36a356ecc)
2015-06-23 09:13:35 +01:00
Takeshi Abe
0980095619 Replace boost::scoped_array<T> with std::unique_ptr<T[]>
This may reduce some degree of dependency on boost.
Done by running a script like:

git grep -l '#include  *.boost/scoped_array.hpp.' \
 | xargs sed -i -e 's@#include  *.boost/scoped_array.hpp.@#include <memory>@'
git grep -l '\(boost::\)\?scoped_array<\([^<>]*\)>' \
 | xargs sed -i -e 's/\(boost::\)\?scoped_array<\([^<>]*\)>/std::unique_ptr<\2[]>/'

... and then killing duplicate or unnecessary includes,
while changing manually
m_xOutlineStylesCandidates in xmloff/source/text/txtimp.cxx,
extensions/source/ole/unoconversionutilities.hxx, and
extensions/source/ole/oleobjw.cxx.

Change-Id: I3955ed3ad99b94499a7bd0e6e3a09078771f9bfd
Reviewed-on: https://gerrit.libreoffice.org/16289
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
2015-06-17 15:50:45 +00:00
Lionel Elie Mamane
8992def7c0 More helpful exception message
Change-Id: I63dcc98667ebfc94cc16407d283e65e1514d89fb
2015-06-17 14:37:45 +02:00
Andrea Gelmini
3fa7b0b70f Fix typos
Change-Id: Id8c7cf460cba5af89891c470e1aaa61b227d356e
Reviewed-on: https://gerrit.libreoffice.org/16310
Reviewed-by: Michael Stahl <mstahl@redhat.com>
Tested-by: Michael Stahl <mstahl@redhat.com>
2015-06-16 11:25:13 +00:00
Noel Grandin
4729774b24 remove unnecessary check for null when calling delete
Idea originally from caolan.
Found using the following command:
find . -name *.cxx | xargs /opt/local/bin/grep -zlP '(?m)if\s*\(\s*\w+\s*\)\s*delete\s+\w+\;'

Change-Id: I3338f4e22193a6dfd6219c8c75835224a3392763
2015-06-15 14:46:41 +02:00
Stephan Bergmann
d5dde72908 loplugin:cstylecast: deal with remaining pointer casts
Change-Id: Ie55f464ef2eca344d3c1292713ded2710c47cc53
2015-06-08 16:24:55 +02:00
Mike Kaganski
b717bda1f6 tdf#67421: Prevent unloading objects due to cache full
When an object is added to OLE objects cache, when cache is full,
old objects are tried to be unloaded. This triggers notifications
that cause all loaded objects to become active, and to be added to
cache (moved to front).

As the new object already was added to front of the cache, later
activity pushes it to back, until it is the last object in cache.
The cache in this process is overfilled, so each next refresh tries
to unload current last OLE object. So, in the end, this effectively
unloads all cached OLE objects.

This patch prevents this by first unloading last object, and then
adding new object to front of cache.

Also, removed needless creation of reference (makes at least 200
function calls for no reason).

Change-Id: Ia903f4df101971df1b0b0148320fc8e45ac1e79c
Reviewed-on: https://gerrit.libreoffice.org/15772
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Michael Stahl <mstahl@redhat.com>
2015-05-19 14:44:20 +00:00
Miklos Vajna
ed85e11a1b embeddedobj: allow creating objects lacking a FileFormatVersion=6800 filter
dbaccess::ODatabaseDocument::loadFromStorage() is still not implemented,
though.

Change-Id: I1be11f2a2274f67dd0a11f96a718394d5f72605f
2015-05-04 16:12:14 +02:00
Miklos Vajna
112e5f302e embeddedobj: allow embedding objects lacking a FileFormatVersion=6800 filter
The "own" filter of Base has FileFormatVersion=6200.

Change-Id: I3bbd28ebcf4d517ea9cefe692b01b688358c51e8
2015-04-30 15:41:25 +02: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
26ec80f47d loplugin:staticmethods
Change-Id: I33a8ca28b0c3bf1c31758d93238e74927bebde9c
2015-04-13 09:37:12 +02:00
Stephan Bergmann
e78a3bfdc8 Replace remaining getCppuType et al with cppu::UnoType
Change-Id: I1ee944679d509929e47218f88b6fe4be4905a202
2015-04-01 08:39:02 +02:00
Stephan Bergmann
91261d6da0 Reduce to static_cast any reinterpret_cast from void pointers
Change-Id: Iad5d2858976ed789823aaac3aa7f2937233f1dfc
2015-03-31 13:13:53 +02:00
Caolán McNamara
757f461ef1 avoid activating chart objects just to get their mapunit or set visual size
the motivation is SwWrtShell::CalcAndSetScale

and the assert/crash triggered by

ooo58458-1.odt ooo84729-2.odt ooo75058-1.odt ooo123605-1.odt ooo102990-1.odt
fdo57249-1.odt fdo50880-1.odt fdo70223-5.odt ooo30052-2.odt ooo119280-1.odt
ooo79009-1.odt ooo58182-2.odt ooo59992-1.odt ooo123607-1.odt ooo89304-1.odt
ooo91578-5.odt ooo89303-1.odt ooo30052-1.odt fdo65664-3.odt ooo119941-1.odt
ooo55761-1.odt fdo57249-2.odt ooo83229-3.odt ooo84729-1.odt ooo102990-2.odt
ooo37749-1.sxw ooo38798-1.sxw ooo27909-1.sxw

getMapUnit activates the object which can cause chart object to load data from
the current document and appears to attempt to stop and resume pending layout
actions which can't be done if layout is underway, hence the assert from the
inner SwLayAction::SwLayAction triggered by the runstate while an SwLayAction::SwLayAction
is already active for counting the number of pdf output pages.

getMapUnit always returns the same result regardless of anything else and the
assumption is that we don't need to be in run state to setVisualSize on it

Change-Id: Ie75b159b140de223a56324b39699d703c3b40bb9
2015-03-27 10:45:38 +00:00
Caolán McNamara
924b2923b8 V801: Decreased performance
Change-Id: I9e9a00acf9503980f0c6c7cd0a20378e5ca7390d
2015-03-09 20:56:26 +00:00
Lionel Elie Mamane
5b81128f77 tdf#88624 set DocumentBaseURL when saving report
regression from 1d38cb365543924f9c50014e6b2227e77de1d0c9

Change-Id: Ia8cfe47b9d92889b3724f394db5090a59e69dd48
2015-02-14 19:54:56 +01:00
Caolán McNamara
d9da9b4411 add an explicit virtual keyword here, like the other ones
Change-Id: I4c5acf42d5ec33df1dd18dc3a70be7de838c9ff3
2015-02-02 16:26:18 +00:00
Stephan Bergmann
c33c309f13 OOoEmbeddedObjectFactory does implement optional XLinkFactory
regression from 251f1b0b38be7d1267339898e44e320f05849e22 "fdo#46808, Adapt
embed::*EmbeddedObjectCreator UNO services to new style"

Change-Id: Id8b49c04183d3bc98f22398a8e43c80909c1ea11
2015-02-02 13:38:30 +01:00
Caolán McNamara
52c2111e4f callcatcher: remove some unused methods
Change-Id: Id3ca991e9ede13512a39865496429aabb7e71088
2015-02-02 12:37:11 +00:00
Caolán McNamara
309574394b callcatcher: large newly detected unused methods post de-virtualization
i.e lots now able to be detected after...

commit b44cbb26efe1d0b0950b1e1613e131b506dc3876
Author: Noel Grandin <noel@peralex.com>
Date:   Tue Jan 20 12:38:10 2015 +0200

    new loplugin: change virtual methods to non-virtual

    Where we can prove that the virtual method is never overriden.

    In the case of pure-virtual methods, we remove the method entirely.
    Sometimes this leads to entire methods and fields being
    eliminated.

Change-Id: I605e2fa56f7186c3d3a764f3cd30f5cf7f881f9d
2015-01-29 23:42:26 +00:00
Noel Grandin
b44cbb26ef new loplugin: change virtual methods to non-virtual
Where we can prove that the virtual method is never overriden.

In the case of pure-virtual methods, we remove the method entirely.
Sometimes this leads to entire methods and fields being
eliminated.

Change-Id: I138ef81c95f115dbd8c023a83cfc7e9d5d6d14ae
2015-01-26 08:42:28 +02:00
Stephan Bergmann
9240485311 Some more loplugin:cstylecast: embeddedobj
Change-Id: Iea3b2ca4f2598c501206ab631f86d9aa44a0407c
2015-01-20 09:06:47 +01:00