summaryrefslogtreecommitdiff
path: root/vcl
AgeCommit message (Collapse)AuthorFilesLines
2014-11-22All image cleanup related change in one commit for perf testZolnai Tamás4-6/+16
Change-Id: I5baac12f97ea7fa36293844331ca548b7bc2cdfd Always call ImplAfterDataChange() when data is changed Call it inside ImplAssignGraphicData() which assign GraphicObject members using Graphic's data. With that ImplAfterDataChange() method also called in constructors. It's important to call ImplAfterDataChange(), because this will trigger the auto swaping mechanism. Change-Id: I45af91f8df2fb5b0143fcc5eb05e82e4d408d0bc Avoid using null pointer as a special indicator When ImpGraphic::ImplSwapOut() is called with null pointer it was assumed that it is becase the graphic is a link and so we don't need to swap out it actually (we can load it anytime using the link), only clear the graphic's internal data. The problem with that it can happen that ImplSwapOut() is called with null pointer accidentally on a non-link graphic object which leads to that we loose the graphic. Seems more robust to use an explicit indicator (GRFMGR_AUTOSWAPSTREAM_LINK) for links swapout. indicator Change-Id: Icf31524a192c7866278ba6a13eb85648aa69f554 Remove manual SwapOut() call in ODF export We have a good auto swapout mechanism which will prevent excessive memory use. Change-Id: I362f51c724ac31704561abe8b961910f5d490f04 MS export: don't need to manually swapout images after swapin them We have some good auto mechanisms for that. Change-Id: I487dbf4a5fc69c7563dfbc5c21f9ebdb05ba6b9e DOC import: avoid manual swapout call. No reason to swapout the image directly after the import because it will be used for rendering just a second later. Change-Id: I78c8ef9225c55f306182dc5efd7bcaf0e88521c0 Make SetSwapState() an internal method So we can be sure it is always called when user data changed. Change-Id: If107907afffb85a7a57817f5807847a5c028416c Swap in graphic by SwGrfNode and not manually It's a Writer specific problem, that images lost during export because of not swapped in graphic data. Other components (Impress, Calc...) use SdrGrafObj to get the graphic and SdrGrafObj calls swap in before retrun with the graphic. Change-Id: I7398d8e3f6535199b10de048acd58543bdb42531 Avoid an image loss situation of auto swapping Before an image data is used GraphicObject should be swapped in. When a GraphicObject is swapped in auto swapping mechanism is triggered which can swap out some of the images. We should avoid to swap out the same image on which the swap in method was called before because the caller code assumes that the image data is there. Change-Id: Ia4addc370742aea5fbf185cf87e3c062a5ebf5be Assign graphic data also during auto swap in Change-Id: I09b8d11027f4a1e8470b81677388d4a573b372a6 Ignore the swapped in graphic, but use its size Change-Id: I75f17ab5e55119965fcede2b220979cefc1e26ab Remove these useless static bool variables. Change-Id: I7a8ad7814231f129d5d1146ceb36eb2c22b2aff1 More useless static bool variables. Change-Id: If09aa23768f73bbf659966e4e5aac82dca83d1b6 Paint background images always via drawinglayer Painting via GraphicObject is obsolete. See fdo#68927 where the problem was the quality of svg graphics, it seems a good idea to extend this improvement to all graphic type. Change-Id: I57a26d4fcfea8e4f666504a90281365e8a9a7e1d Remove unused IsInSwap() method Change-Id: Ib295bd71b5cf16fd75d04818dfd415ff24cb2655 Printing: remove an other manual swap out call Change-Id: I2b6d6eaa072d9948eb5734e978d68d3bc37701b2 SvxGraphicObject: remove more manual swap out calls Tested with importing large *.rtf and *.docx test documents with lots of images -> auto swapp out works. Change-Id: Ib040edaa89c9bcb966c58b75f0392e6d9f7a165e SdrUndoDelObj: one more manual swap out call This thing seems a good optimization to me, but it would be good to hide all of this swapping thing inside GraphicObject class, to make our code more robust (e.g. no image loss because of missing manual swap in / swap out call). Auto swapping mechanism will take care of that, anyway. Change-Id: I933dafd95597ffff038dc6aeb0a64fcaa3941bd8 Remove duplicated swapping methods Change-Id: I0e61aeb0705ed13872d252ee1594f9ab4aab4f8a ForceSwap{In,Out}Objects methods are unused now They are called only by themselves recuirsively, but not from outside. Change-Id: I1cde392c95bbc60ac7937d0bf3cd4b0fd062568b More unused swapping related methods / member of SdrPage Change-Id: I4a979dd09418df4526409d9026d6abb98c6bf954 Make GetTwipSize() call SwapIn() by itself in case of invalid size Change-Id: I5bc6cf097e61d65007dde531af4a213b19e8ca5b More replacements of manual swapping with SwGrfNode::GetGrf()/GetGrfObj() Change-Id: Ie56584c03af8a6d3ea8f8d4294f5492a841933b7 Be explicit here when to swap out as a link Change-Id: I70dd00d5f82c5f4f622805e1d6ee1dfc30900b31 Remove unused Graphic member of SwOLENode Change-Id: Iaff7e86a8e11e9befc6feacdafd3a78a1971bbcd Swapping Graphic is a privilage of GraphicObject. This means more things: * Graphic won't swap out itself, so those classes which uses Graphic without GraphicObject won't need to deal with swapping. * When a Graphic is queried from GraphicObject the caller won't need to deal with swapping, because GraphicObject swaps it in before return. * GraphicObject will swap in the Graphic always when a swapping dependent data is queried (e.g. whole graphic, transformed graphic or AnimationNotifyHdl) Change-Id: I2bf6e37291ec94146f10aac4a35084682437ed16 Why to have this compromise, do that what we say the users we do. Change-Id: Ia599644ff1f7591ac84bdca988883eaf5860297e Make SwGrfNode swapping methods private Change the filter test accordingly. Conflicts: sw/CppunitTest_sw_globalfilter.mk sw/qa/extras/globalfilter/globalfilter.cxx Change-Id: Ide3043f2f245c097a7b4c07ba2e0713510296b3e Remove some useless swapping call inside SwGrfNode Change-Id: I4cd2677197c7a6cff71e2966c2b2dd2285032c07 Make SdrGrafObj swapping methods private. Plus remove some useless call of them. Change the tests accordingly. Conflicts: sc/qa/unit/data/ods/document_with_two_images.ods sc/qa/unit/subsequent_export-test.cxx sd/qa/unit/export-tests.cxx Change-Id: I47a50b5734d799ac02ee7221c95f82415afb9497 Optimize ImplCheckSizeOfSwappedInGraphics() a bit Store used size as a member so we don't need to recalculate it all the time and no need to use a size map. Change-Id: I1f929c5d3a56f545cef123bda087ecaf8ca0be4a Avoid DelStreamName because it can lead to image loss. See also: f811e628411bda29a76ebb1f72eb107ce67d27f0 The problem is that more images can have the same stream name so we can't decide here when to remove one stream name. Better to leak in the storage as to loose images (actually we already leak here, so) Change-Id: I2c2afe87e024c2521fe22d62126b567931604101 Set back these lines, later it can be useful Removed in: 9dc3b49c891fb9fe45c24de4b7e1e88fe400afe0 Change-Id: Id8cee4e17d214ca0eaa5cd11dc25849e5f68851e Logically dead code related to embedded stream name in SwGrfNode\SdrGrafObj See also: 286e2f5c6ec829bc0987b1be7016699f7ef03e5e Since embedded URL exists until the first swap in these lines are not needed anymore. Change-Id: Ie6bf8efe7808cf42f20f7b4b3f8cb927555c0ea8 Remove now useless setTextEmbeddedGraphicURL() Since this commit: 286e2f5c6ec829bc0987b1be7016699f7ef03e5e it's not necessary to update the package URL. Change-Id: I25c829e9bc0c666838baf19cd60f19938ebb430c
2014-11-18Bitmap::Crop test: does it make difference?Matúš Kukan1-1/+1
Change-Id: I001210840d535ac54837fff092c90835f9f2f547
2014-11-14Replace internal jpeg with jpeg-turboMatúš Kukan1-1/+2
Unfortunately requires nasm - the netwide assembler - http://www.nasm.us/ Upstream libjpeg-turbo is meant to be built with CMake on Windows but thanks to our gcc-wrappers we are able to avoid that. Change-Id: Id87b7072a8acc2578c3abf7e82cb1499e5094dbf
2014-11-05vcl: parallelize image scaling.Michael Meeks1-27/+94
Change-Id: Ia452487c0c8c66a35c4b9fba225348bdef1a27f7
2014-11-05idle: unit test.Michael Meeks1-4/+22
Change-Id: Ie48fb4260bf580010715777bc63974e4d635aed8
2014-11-05idle: implement ProcessAllIdleHandlers.László Németh2-13/+72
It is often useful to flush all pending idle / GUI work for testing and/or profiling - so make that easy to do with this new method. Also tag idle Timers with a boolean, for ease of use. Change-Id: I57e883be8fe8637b3715008e8074d0fa258ca0c3
2014-11-05Basic Idle handler implementationTobias Madl5-18/+75
An idle handler will ultimately be a zero time timeout with prioritisation layered on top of that. Change-Id: I3f0802d5001172fc7b8409274bc5a3632e5dad34
2014-11-05markup with event type not checker typeCaolán McNamara3-11/+10
Change-Id: I14c0c5d90b67000cb4fe9e6be647854abfe784da
2014-11-05coverity#1215387 Uncaught exceptionCaolán McNamara1-13/+21
Change-Id: I3e34d078772c701d07c14de0da45bbdcb7b44838
2014-11-05coverity#1215395 Uncaught exceptionCaolán McNamara1-10/+18
Change-Id: I44246f85acf197fa1707b37691f21e6e996bc2d3
2014-11-05coverity#1215391 Uncaught exceptionCaolán McNamara1-9/+17
Change-Id: I8a57ad303666cfcb3e338fc1933c29a887240a5a
2014-11-05coverity#1215389 Uncaught exceptionCaolán McNamara1-13/+21
Change-Id: I107817e730ca0bd94d66ecf9719c3a6eb273e4f1
2014-11-05vcl: renamed OutputDevice::PaintLineGeometryWithEvtlExpand()Chris Sherlock2-5/+3
I asked on the LO dev mailing list what Evtl means and what is being expanded, and Michael Stahl kindly responded: > "Evtl" usually means German "eventuell" which means "possible" or > "optional" (i.e. totally different meaning from English "eventual"). So in other words, it means paint using line geometry and optionally expand. Or in other words, it just draws a line using a B2DPolyPolygon. Thus, I have renamed it to drawLine(), which is a private function of OutputDevice. I think this makes it somewhat clearer :-) Change-Id: I7eec23c61eda9dc1074922f5f2f67eacbc7fd725 Reviewed-on: https://gerrit.libreoffice.org/12264 Reviewed-by: Chris Sherlock <chris.sherlock79@gmail.com> Tested-by: Chris Sherlock <chris.sherlock79@gmail.com>
2014-11-05fdo#84938: replace TOOLBOXITEM_ constants with enumNoel Grandin2-36/+36
Change-Id: I08c4a456f9e80f70719ca8c3ad5c0f0d2d8282f6 Reviewed-on: https://gerrit.libreoffice.org/12258 Tested-by: LibreOffice gerrit bot <gerrit@libreoffice.org> Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
2014-11-05fdo#38835 strip out OUString globalsNoel Grandin3-6/+6
they are largely unnecessary these days, since our OUString infrastructure gained optimised handling for static char constants. Change-Id: I07f73484f82d0582252cb4324d4107c998432c37
2014-11-04coverity#735660 coverity#735661 division by zeroDavid Tardon1-0/+2
Change-Id: I86f503f740565bfef27a68636074a38d44046196
2014-11-04coverity#735658 coverity#735659 division by zeroDavid Tardon1-0/+4
Change-Id: I2e73cd105af7aa9d926659d3275bf10de9993d62
2014-11-04vcl: gtk 2.4 is checked at configure timeRiccardo Magliocchetti1-3/+0
Change-Id: I08993551473fb9a8284e2a1ed772c99050f785d8 Reviewed-on: https://gerrit.libreoffice.org/12251 Reviewed-by: Michael Stahl <mstahl@redhat.com> Tested-by: Michael Stahl <mstahl@redhat.com>
2014-11-04translate "bEnde" variableMichael Stahl1-5/+5
Change-Id: Ic29b569df25f8966326101d5179506b24483cb43
2014-11-04rename Dreh->RotationNoel Grandin1-3/+3
Change-Id: Ibc9345959462b5a1cb9e47791742217e567b3cd0
2014-11-04some random renaming of Wink fields -> AngleNoel Grandin2-8/+8
Change-Id: Icd4df8610072f5283276738896cb5c01762838ea
2014-11-04rename DrehWink to RotationAngleNoel Grandin3-29/+29
Change-Id: I4dfa2d3fa2d0c0b5029eb2cd3d724e7e6f2e3d6e
2014-11-04-Werror=sign-compareNoel Grandin1-4/+4
Change-Id: I5e1b6ebb4af3a602233bfb09ba6397569f18aac9
2014-11-04WaE: unused variable 'aClipPolyPoly'Tor Lillqvist1-2/+0
Change-Id: I8dd9b2a5dd09d5d0be123e9f8a303ad8e280b0f2
2014-11-03vcl: Allow SalGraphics to draw gradients nativelyChris Sherlock8-89/+455
The aim of this patch is to allow for native gradient rendering in SalGraphics (i.e. let OpenGL do this natively). It is a two step process: 1. I need to allow gradient draw into SalGraphics, however the current completely intertwined with the metafile code in OutputDevice. I am seperating the gradient metafile code from the gradient drawing code. 2. After splitting the metafile stuff from the actual gradient drawing, I am now able to call on SalGraphics::DrawGradient(). This just calls on SalGraphics::drawGradient() which returns false if there is no way of drawing native gradients, and true if there is. If false, then we use OutputDevice's DrawGradient() functionality. Change-Id: Ibaaabe13b76a8e7a037d9f751b5f662653a50566 Reviewed-on: https://gerrit.libreoffice.org/12119 Reviewed-by: Chris Sherlock <chris.sherlock79@gmail.com> Tested-by: Chris Sherlock <chris.sherlock79@gmail.com>
2014-11-03coverity#1242811 untrusted pointer readDavid Tardon1-3/+9
Change-Id: I74c29a39367e7781e5e6cf9795c7176ef599f97e
2014-11-03coverity#1242806 untrusted pointer readDavid Tardon2-13/+20
Change-Id: Ib92e1a22d7d25f4498272731af12c485937f38ef
2014-11-03coverity#1209010 Unchecked return valueCaolán McNamara2-6/+8
Change-Id: I92c2472a34aca9f7f1a617666607040cadb0b643
2014-11-03coverity#1250699 Dereference null return valueCaolán McNamara1-0/+5
Change-Id: Iaddc47087d796d96fa0ed054c254b3cf83c90b5e
2014-11-03be a little more consistent stylewiseCaolán McNamara1-1/+1
Change-Id: If1d822e0e6c87e792ff4a769a525e161505325c9
2014-11-03coverity#1209395 Dereference after null checkCaolán McNamara3-25/+17
since commit 808d273db098e2269e53813595a6bfc7b160e28e Date: Fri Apr 25 11:56:54 2014 +1000 Remove ImpInitOutDevData and ImplDeInitOutDevData in OutputDevice All these do is some very, very basic initialization. There is no need to lazy load the structure, it should be initialized when OutputDevice is created in the constructor and deinitialized in the destructor. mpOutDevData is never NULL Change-Id: Ie08f7520e8c09b57e056c086bba3089abe2486fa
2014-11-03fdo#84795 Menu, DropDown-List don't disappear with right mouse clickJuergen Funk3-24/+33
this includes a fix to leave disabled menu entries disabled. This reverts commit 454f5c3018c6d61d5872f7c23c7590c2157444e4. Change-Id: Ifb66b0b241378437f040af19ec163da3cb8d815d Reviewed-on: https://gerrit.libreoffice.org/12061 Reviewed-by: Samuel Mehrbrodt <s.mehrbrodt@gmail.com> Tested-by: Samuel Mehrbrodt <s.mehrbrodt@gmail.com>
2014-11-03Detect KDE5 and fallback to KDE4UI thereTomáš Chvátal1-0/+21
Change-Id: I8da53d7b81d28b0051be96c0c4ee0a29d8ed8360 Reviewed-on: https://gerrit.libreoffice.org/12209 Reviewed-by: Samuel Mehrbrodt <s.mehrbrodt@gmail.com> Tested-by: Samuel Mehrbrodt <s.mehrbrodt@gmail.com>
2014-11-03vcl: typo in variable name in PaintLineGeometryWithEvtlExpandChris Sherlock1-3/+3
Change-Id: I87084cbc4d6a8b6f5edbf8b90791c2b1e75b4afb Reviewed-on: https://gerrit.libreoffice.org/12211 Reviewed-by: Chris Sherlock <chris.sherlock79@gmail.com> Tested-by: Chris Sherlock <chris.sherlock79@gmail.com>
2014-11-03vcl: merge DrawPolyLineDirect() and drawPolyLineDirectNoAACheck()Chris Sherlock1-52/+44
I've merged these two functions, I just added a new function parameter to switch on and off the AA check, this function parameter defaults to false so DrawPolyLineDirect needs to do the AA check each time. If bBypassAACheck is set to true, then we automatically enable AA. Change-Id: Id2d9b2036a41716590f7b87f658f5bb210964392 Reviewed-on: https://gerrit.libreoffice.org/12191 Reviewed-by: Chris Sherlock <chris.sherlock79@gmail.com> Tested-by: Chris Sherlock <chris.sherlock79@gmail.com>
2014-11-02coverity#1242508: swapped argumentsThorsten Behrens1-1/+1
Change-Id: If86cc3cd9ea40dc826c93d6adb6e11fab20a15eb
2014-11-02vcl: Refactor OutputDevice::TryDrawPolyLineDirect()Chris Sherlock1-36/+25
I've renamed TryDrawPolyLineDirect() to DrawPolyLineDirect() and also renamed TryDrawPolyLineDirectNoAACheck() to drawPolyLineDirectNoAACheck(). However, at the same time I feel that there is no need to call on drawPolyLineDirectNoAACheck in most instances, because DrawPolyLineDirect does an AA check before it can continue anyway. There is one instance where constantly checking the AA check is inefficient because it's in a loop, in that case then we call directly on drawPolyLineDirectNoAACheck, but this is the only case it is necessary. Change-Id: Ie0320bfc45b5c0e1ac6ce35912da3e2897af9429 Reviewed-on: https://gerrit.libreoffice.org/12190 Reviewed-by: Chris Sherlock <chris.sherlock79@gmail.com> Tested-by: Chris Sherlock <chris.sherlock79@gmail.com>
2014-11-02vcl: rename OutputDevice::DrawPolyLineWithLineInfo() to drawPolyLine()Chris Sherlock1-3/+3
Change-Id: I145ebcfb92fc75f4558d3bf090093aef9e848136 Reviewed-on: https://gerrit.libreoffice.org/12188 Reviewed-by: Chris Sherlock <chris.sherlock79@gmail.com> Tested-by: Chris Sherlock <chris.sherlock79@gmail.com>
2014-11-01tools & vcl: move OutputDevice::ImplRotatePos() to Point::RotateAbout()Chris Sherlock4-63/+28
OutputDevice has a private function that rotates a point around another point. However, there is no real reason why OutputDevice should be responsible for this - it's really the responsibility of the Point class in the tools module. Therefore, I've moved this functionality out of OutputDevice and into Point, but I've renamed it from the rather confusing name "ImplRotatePos" to "RotateAround", which is what it actually does. Change-Id: If12fb40a7b476653224d4edfc01887bc91a80c7d Reviewed-on: https://gerrit.libreoffice.org/12171 Reviewed-by: Chris Sherlock <chris.sherlock79@gmail.com> Tested-by: Chris Sherlock <chris.sherlock79@gmail.com>
2014-11-01coverity#735654 Division or modulo by zeroCaolán McNamara1-1/+1
Change-Id: I9ab09d65ba7587230de320e22a79e9c7224f4ade
2014-11-01coverity#1250405 Division or modulo by float zeroCaolán McNamara1-1/+4
Change-Id: Ifbb7ab559d161fdc8b6838ea34a4519286423997
2014-11-01coverity#1250439 Structurally dead codeCaolán McNamara1-6/+3
Change-Id: Ib0e8fefb154417dde95bc70765ad675a1824db44
2014-11-01coverity#735338 Unchecked return valueCaolán McNamara1-1/+1
Change-Id: If19a61c82f1cf723c8e78e8d27461a543ddbfd40
2014-11-01fdo#84938: replace MIB_ constants with enumNoel Grandin8-34/+34
Change-Id: I58c1b4c9e4c4b3751b233d2fe10b9c953b945c4a Reviewed-on: https://gerrit.libreoffice.org/12179 Reviewed-by: Noel Grandin <noelgrandin@gmail.com> Tested-by: Noel Grandin <noelgrandin@gmail.com>
2014-11-01vcl/source: get rid of redundant svsys.h includesDouglas Mencken3-5/+4
+ adapted for WNT (it does really need it for app/settings.cxx) Change-Id: I33a65d24f7c6c46a36718e4421ae88de180a9739 Reviewed-on: https://gerrit.libreoffice.org/11814 Reviewed-by: Douglas Mencken <dougmencken@gmail.com> Reviewed-by: Samuel Mehrbrodt <s.mehrbrodt@gmail.com> Tested-by: Samuel Mehrbrodt <s.mehrbrodt@gmail.com>
2014-10-31Removed duplicated includesAndrea Gelmini1-4/+3
Change-Id: I5362d997bfa086c9fb1726efcb15132a966684f6 Reviewed-on: https://gerrit.libreoffice.org/12160 Tested-by: LibreOffice gerrit bot <gerrit@libreoffice.org> Reviewed-by: Michael Stahl <mstahl@redhat.com>
2014-10-31callcatcher: a titchy bit more ww1 filter falloutCaolán McNamara1-6/+0
Change-Id: I38517bb7fbf4ab1e9314a28973b707223d7120e7
2014-10-31coverity#1202803 Explicit null dereferencedCaolán McNamara1-0/+3
Change-Id: Ia914c4842e69b3ea57692f1f8ac52c321240b7c4
2014-10-31coverity#735346 Unchecked return valueCaolán McNamara1-26/+34
Change-Id: Ic9aab232667a9b0a3a995d7b033b7ba508fd42dc
2014-10-31quieten warningCaolán McNamara1-1/+1
Change-Id: I91bf3bce86d6b7fb01a26a6785d5bcfd7677878c