Commit Graph

200 Commits

Author SHA1 Message Date
790920befb GraphicManager: fix crash when swapping out graphics
GraphicManager::ImplCheckSizeOfSwappedInGraphics() may access a deleted
GraphicObject because swapping out one GraphicObject may actually delete
other ones, by deleting SdrGrafPrimitive2D instances via
sdr::contact::ViewContactOfGraphic::flushGraphicObjects().

(regression from 0ca0202a0994c0b7c99c366fd5cafd8a655df203)

Change-Id: I94bd465d90afbfdd14da28e42de3ecdff3a9d9f9
Reviewed-on: https://gerrit.libreoffice.org/11215
Reviewed-by: Michael Stahl <mstahl@redhat.com>
Tested-by: Michael Stahl <mstahl@redhat.com>
2014-08-31 07:51:46 -05:00
ac2ffe70ce GraphicManager: let's assert GraphicObjects are inserted and deleted once
Change-Id: Ie3bfb78434fa25fdbbdfb90cb9590649fec2dc28
Reviewed-on: https://gerrit.libreoffice.org/11214
Reviewed-by: Michael Stahl <mstahl@redhat.com>
Tested-by: Michael Stahl <mstahl@redhat.com>
2014-08-31 07:50:59 -05:00
e06014e0db bnc#719994: We need the proper alpha mask
Change-Id: Ic16dceaca431929238fcef6be31ee95e068b91e4
2014-08-26 16:30:54 +03:00
5b9c8241ea Avoid incomplete type in fn sig to keep ubsan's RTTI-based checks happy
Change-Id: I11db6f87f3b8b32578c0c83d3df7b11d3533b5ef
2014-08-07 18:40:50 +02:00
f9b22d7c7a coverity#1226481 Dereference after null check
Change-Id: I93f9bfb7a360b2851d179f6c4535b416fff339bc
2014-07-18 15:36:13 +01:00
60de576a29 use same swap stategy on all platforms
Change-Id: I565dfd9233088feae69de6261d1081fc51f10806
2014-07-15 16:15:17 +01:00
0ca0202a09 Resolves: #i125111# limit mem footprint for GraphicObjects...
in 32Bit environments

Conflicts:
	svtools/inc/svtools/grfmgr.hxx
	svtools/source/graphic/grfmgr.cxx
	svtools/source/graphic/grfmgr2.cxx
	sw/source/core/doc/notxtfrm.cxx
	sw/source/core/graphic/ndgrf.cxx

"commit 62b0eaf37c08dd27244e77b8bc90c691b000ebd6
 Related: fdo#50697 reset the cache timeout on GetGraphic

 so the graphic gets swapped out Xms after the last use and not Xms after
 initial creation regardless of if it got used a moment earlier."

corrected place for stl sort function for linux

(cherry picked from commit a48414a396f7de4e00510e82e3744c097ce3d5d6)

Conflicts:
	svtools/source/graphic/grfmgr2.cxx

Change-Id: I79158b7d42629f8dec2bc5565540701bcd3ef6f4
6f21c7fd4d2681446fc1a6d9607366a1e69165a1
2014-07-15 16:15:17 +01:00
dd9a1bae7c coverity#983902 Uncaught exception
Change-Id: Ic4e7413ac0c4c6c8eda9808e88572926e6b00be5
2014-07-14 09:21:01 +01:00
1edd367928 Avoid possible memory leaks in case of exceptions
Change-Id: I957c0662c56e7cad3d10c8bcc1d6b22352da688f
2014-07-05 20:19:42 +09:00
30069114fe loplugin:staticcall
Change-Id: If7b285a2214bc878e8464a986538d0445078fcb3
2014-06-13 17:54:34 +02:00
3558f9c059 Prefer cppu::UnoType<T>::get() to ::getCppuType((T*)0) part17
Change-Id: Ie6dbe87599c9cf53c7b9cc6becb9438e62cdb537
2014-05-18 01:14:29 +02:00
7d6e159df4 fix memory leak on pasting metafiles into writer
copying from mspaint to writer and then deleting the image in a loop will
eventually exhaust all memory.

regression since 004a29b9ac66f68af5ea12a2303a4b2be77d8145

Change-Id: I381285cda3823de7df0c1725a339943caf9536fe
2014-05-16 21:05:01 +01:00
a325ce63db fix-includes.pl: svtools
Change-Id: I509299306ab6cd97c96e9a26d4674f983bbffbec
2014-05-11 01:55:40 +02:00
b7d30cb50e svtools: sal_Bool->bool
Change-Id: Idd9a3ccf0eb6d14cec158daa17a6b2da625f7ffa
2014-05-08 11:48:13 +02:00
893fe88469 handle brightness+contrast from msoffice (bnc#875713)
This is the same like 1139d618b8bc6ab823a96184bd0f0257980aad24, for docx.

Change-Id: I1ef4e18444e8c60e9ae8f67249bcef1053f0d62d
2014-04-30 23:40:26 +02:00
62b0eaf37c Related: fdo#50697 reset the cache timeout on GetGraphic
so the graphic gets swapped out Xms after the last use and not Xms after
initial creation regardless of if it got used a moment earlier.

Change-Id: I1458f307d090ecd8d8d031b545f23e78bf1bcb67
2014-04-29 15:24:27 +01:00
3a374a50a2 coverity#707218 Uncaught exception
Change-Id: Ia7ed41a0d0bfa24a64f6d140922c095de5dd9c0c
2014-04-23 09:40:02 +01:00
fa72a0e94d Remove unused code
Change-Id: Ifaab2aecec65ec6e81056e5fca430df8ca3af908
2014-04-09 10:15:47 +02:00
362d4f0cd4 Explicitly mark overriding destructors as "virtual"
It appears that the C++ standard allows overriding destructors to be marked
"override," but at least some MSVC versions complain about it, so at least make
sure such destructors are explicitly marked "virtual."

Change-Id: I0e1cafa7584fd16ebdce61f569eae2373a71b0a1
2014-04-01 19:22:54 +02:00
70cc2b191b First batch of adding SAL_OVERRRIDE to overriding function declarations
...mostly done with a rewriting Clang plugin, with just some manual tweaking
necessary to fix poor macro usage.

Change-Id: I71fa20213e86be10de332ece0aa273239df7b61a
2014-03-26 16:39:26 +01:00
554e54429c svtools: sal_Bool->bool
Change-Id: Ic9b4838c4d1b4d2d2ea4665811dd396bdbec31b7
2014-03-24 08:12:09 +02:00
78a4b4247b SwapIn/SwapOut can return bool + sal_Bool to bool
Change-Id: Ia5477d6bb83af38435b9ac44359fe2f46b00807c
2014-03-16 09:51:13 +01:00
62fae8bda8 svtools: simplify deprecated XTypeProvider.getImplementationId
Change-Id: I2534ad4a720dd5d13324ac6fb19b8676ae50ff4e
2014-03-10 17:39:58 +01:00
b901f7699d x->getSomething(x->getImplementationId()) doesn't make any sense
...the point of the aIdentifier parameter to css.lang.XUnoTunnel.getSomething is
so that caller and callee can verify they know each other and the value passed
back (pointer in local address space, in this case) will actually make sense for
the caller.

Change-Id: Id79c419307992b30ea6ef7997b74a015631ad21c
2014-03-07 19:46:26 +01:00
b2371492df Use cstdlib std::abs instead of stdlib.h abs
...because the latter lacks the abs(long) overload in some popular environments,
cf. <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60401> "stdlib.h does not
provide abs(long) overload."

Similarly, stdlib.h lacks the abs(float), abs(double), abs(long double)
overloads compared to cmath there, whose use was apparently intended in
sw/qa/extras/ooxmlexport/ooxmlsdrexport.cxx.  Rewrote that to use
CPPUNIT_ASSERT_DOUBLES_EQUAL instead, which revealed that the comparisons need
rather large deltas of .1 resp. .2 (which the original code hid with an
implicit conversion to integral type, thus using an effective delta of 1).

Discovered with -Wabsolute-value ("absolute value function 'abs' given an
argument of type 'long' but has parameter of type 'int' which may cause
truncation of value") recently introduced on Clang trunk towards 3.5.

Change-Id: I4c41575ffdccb2944498b662bd3a53fd510cb0c0
2014-03-03 18:36:55 +01:00
af63727b9f Resolves: #i15508# Added support for BMP file type
(cherry picked from commit 9956ed1303545cd61901e33b110698c4e5e224c4)

Conflicts:
	filter/source/msfilter/escherex.cxx
	include/vcl/gfxlink.hxx
	svx/source/xml/xmlgrhlp.cxx
	sw/source/ui/docvw/romenu.cxx
	vcl/source/filter/graphicfilter.cxx

Change-Id: Ibcbb69b9c57cd8a438788e9a9c95744e99b6fcdd
2014-02-27 19:30:40 +00:00
5e21a413c7 cppuhelper: retrofit std::exception into overriding exception specs
Change-Id: I56e32131b7991ee9948ce46765632eb823d463b3
2014-02-26 18:22:20 +01:00
bee1cc83ec Remove visual noise from svtools
Change-Id: I7c2b74a449fb20aae5bc643e24a22cf6f732136d
Reviewed-on: https://gerrit.libreoffice.org/8320
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
2014-02-25 21:14:09 +00:00
4a9347fa32 Replace deprecated std::auto_ptr with boost::scoped_ptr
Change-Id: I8e11ffe888aac8887c4c0875c41de51f343debae
2014-02-25 16:33:15 +09:00
0ce0c369aa Remove unneccessary comments
Change-Id: I939160ae72fecbe3d4a60ce755730bd4c38497fb
Reviewed-on: https://gerrit.libreoffice.org/8182
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
2014-02-23 03:38:49 +00:00
e8f8f24c84 vcl: sal_Bool -> bool
Change-Id: I2a3e3d3e3266ea0f0fafdd91362076a4aa160f0e
2014-02-21 12:53:51 +01:00
a18a1a4545 Remove vcl/settings.hxx from vcl/svapp.hxx and vcl/outdev.hxx
Added vcl/settings.hxx to all cxx files which require it.
This helps to speed up compilation after changes to the settings.

Conflicts:
	sc/source/ui/dbgui/pvlaydlg.cxx

Change-Id: I211a0735c47f72d6879f6f15339355abfe0e3cf4
Reviewed-on: https://gerrit.libreoffice.org/7933
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
2014-02-20 16:22:17 +00:00
b2878af322 more SvStream:operator>> conversion
Convert the template based read_lenPrefixed methods to regular
methods.

Change-Id: Ifd0e93aca055e55a0575e4377ec2b8e266dfb019
Reviewed-on: https://gerrit.libreoffice.org/7895
Reviewed-by: Michael Stahl <mstahl@redhat.com>
Tested-by: Michael Stahl <mstahl@redhat.com>
2014-02-12 15:32:11 +00:00
15535e32dd convert SvStream::operator>> methods to ReadXXX methods
First, I updated the clang rewriter to do the conversion.
Then I lightly hand-tweaked the output for the few places where
the rewriter messed up, mostly when dealing with calls on "this".

Change-Id: I40a6a977959cd97415c678eafc8507de8aa3b1a9
Reviewed-on: https://gerrit.libreoffice.org/7879
Reviewed-by: Michael Stahl <mstahl@redhat.com>
Tested-by: Michael Stahl <mstahl@redhat.com>
2014-02-12 15:31:40 +00:00
186b4ebc99 convert specialised SvStream::operator>> methods to ReadXXX methods
as preparation for converting the SvStream::operator>> methods on
primitive types

Change-Id: I62f134bced15c687d6e0d46924f56e8d1c3d95b9
Reviewed-on: https://gerrit.libreoffice.org/7798
Tested-by: LibreOffice gerrit bot <gerrit@libreoffice.org>
Reviewed-by: Michael Stahl <mstahl@redhat.com>
2014-02-04 22:50:39 +00:00
6ef04640ab remove GraphicObject::SetSwapStreamHdl() timeout parameter
Every call to SetSwapStreamHdl uses the same timeout now so move the
function that determines that to svtools.

Change-Id: Ib7395d43dd132a9e14e7a7862ff2c2279f319536
2014-02-03 12:34:07 +01:00
bd9581d46d bool improvements
Change-Id: I23e29995bc7af791067de4996923b6279f7f8892
2014-01-28 20:24:40 +01:00
426d096383 coverity#440831 Dereference before null check
Change-Id: If19c17088bfbc43e5079d88a3110491e56805749
2014-01-28 11:29:19 +00:00
16a2e90335 remove SvStream::operator<< methods
.. and convert the last few places still using those methods.

Change-Id: Id2cd8f9c0dd281df43af439d4fef65881f34a6fd
Reviewed-on: https://gerrit.libreoffice.org/7495
Tested-by: LibreOffice gerrit bot <gerrit@libreoffice.org>
Reviewed-by: Michael Stahl <mstahl@redhat.com>
2014-01-22 22:00:47 +00:00
d803483f6a convert more SvStream::operator<< calls
.. to more explicit SvStream::Write* calls
This was done using another run of the clang rewriter, and then
a lot of hand tweaking to fix all the places where the rewriter
did not play nice with various macros.

Change-Id: I7bcab93851c8dfb59cde6bc76290c6484d88fb18
Reviewed-on: https://gerrit.libreoffice.org/7494
Reviewed-by: Michael Stahl <mstahl@redhat.com>
Tested-by: Michael Stahl <mstahl@redhat.com>
2014-01-22 22:00:39 +00:00
c2c530da69 Introduce static inline cppu::acquire(), and make use of that.
This is much better approach compared to the callback function, as it allows
passing arguments to the c++ constructor directly, while still allowing some
additional initialization after having acquired the instance.

Change-Id: I5a0f981915dd58f1522ee6054e53a3550b29d624
2014-01-22 15:09:28 +01:00
f278397787 Change _get_implementation()'s not to do initialization directly.
Many of the initalizations (in eg. framework) have to be done on an
acquire()'d object, so instead of doing the initialization directly, return
the initialization member function back to the createInstance() /
createInstanceWithContext() / ... and perform the initialization there.

As a sideeffect, I belive the calling initialize() from servicemanager is not
that much a hack any more - whoever converts the implementation to be
constructor-base has the choice to provide the callback, or still initialize
through XInitialization, where the callback is preferred by servicemanager
when it exists.

Change-Id: I8a87b75c54c1441ca0f184967d31ff4902fc4081
2014-01-21 21:25:22 +01:00
306efefe22 Minimize the constructor functions to a bare minimum.
Most of the constructors are supposed to be only a call of

  new TheInstance(arguments)

or an equivalent; so let's just change the constructor caller accordingly, to
accept unacquired new instance.

If there are exceptions that need to do more heavy lifting, they do not have
to use the constructor feature, or there can be a wrapper for the real
implementation, doing the additional work in their (C++) constructor.

Change-Id: I035c378778aeda60d15af4e56ca3761c586d5ded
2014-01-20 17:37:40 +01:00
73eca35b0a Unify ctor functions for component implementations.
There is no need to use different styles for writing the same thing.
It also makes it easier in future to use search & replace.
But of course, there are also some more complicated functions.

Change-Id: I773da20378af0e0d5a27689d3903df7063fb8ac0
2014-01-18 17:02:40 +01:00
c648d08720 convert SvStream::operator<< overloads to more explicit methods
This is in preparation for more conversion of SvStream::operator<< calls
to use more explicit method names.
This converts the subclasses that have their own convenience overloads
of operator<< to use normal methods.

Change-Id: I5efd5d9a24c264cb86d2471303dd5849bf91ba80
2014-01-16 16:08:34 +01:00
cf51afb026 fdo#54938: Convert svtools to cppu::supportsService...
...final part

Conflicts:
	svtools/source/filter/SvFilterOptionsDialog.cxx

Change-Id: Ie4a0a7ea8ec65b3e632d06627bba40a26c9a7a91
2014-01-16 10:24:56 +01:00
67bb39e380 svt: Use constructor feature for GObjectImpl.
Change-Id: I324dd00205319fe4e8f7b0b352ed2ab6422fcbbd
2014-01-16 10:24:52 +01:00
4337a0664f Use const& arguments parameter for ctor functions.
Change-Id: I19ce8bd1a23123ac9a62a7fc95cd54fea5315221
2014-01-15 08:51:27 +01:00
b69864f3f8 re-write SvStream operator<< to non-overloaded methods
This is the actual re-write.

Use a clang rewriter to rewrite SvStream::operator<< to methods
like WriteuInt32.
Note that the rewriter is not perfect, and I hand-tweaked the output.
In particular, I had to adjust places doing things like
  (*this) << 1;

Change-Id: I5923eda3f4ebaa8b452b6ef109e726e116235a2a
Reviewed-on: https://gerrit.libreoffice.org/7342
Tested-by: LibreOffice gerrit bot <gerrit@libreoffice.org>
Reviewed-by: Michael Stahl <mstahl@redhat.com>
2014-01-10 13:26:24 +00:00
732c0f929f svt: Use constructor feature for GraphicProvider.
Change-Id: I0cb66814c3dcbe38a92ada0dfcc0374313784a2b
2013-12-23 10:28:41 +01:00