summaryrefslogtreecommitdiff
path: root/vcl/source/filter
AgeCommit message (Collapse)AuthorFilesLines
2017-07-15emfplus: make VectorFormats Emf/Wmf/Svg workArmin Le Grand1-15/+71
make complete turn around and internal buffering for Emf/Wmf/Svg work, including images in ODF and re-save from UI. The correct FileType has to be determined. It has shown that *.wmf exist that really contain *.emf, so this turn around will not alter the binary data, but may change the mimetype Change-Id: I4fd92629236c12114f7b7c30234a3d3a9917dfaf
2017-07-15emfplus: create a wmf/emf/emf+ primitive based importerArmin Le Grand1-16/+49
First steps to organize an importer that can read/interpret wmf/emf/emf+ and deliver a primitive representation for the content by parsing it. Use the same mechanisms as already applied for Svg, so to reuse abilities to keep original binary data to allow save again and embedding in files and have an implemented replacement bitmap based representation. For this, unify the used helper classes to handle more than just Svg. For 1st try, add test code and static bool switches Change-Id: I6e0a82943541d811a8f8d65a84115569fcd8cee7
2017-07-13unused ResMgrCaolán McNamara1-2/+0
Change-Id: I0bb25a89ddc76c91d01d1cee785be0337eb1f1d0 Reviewed-on: https://gerrit.libreoffice.org/39897 Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2017-07-13loplugin:oncevar: empty strings: vclStephan Bergmann3-6/+3
Change-Id: Ic9a3b72dbff3333cba45b9ad4b75e8de12bc4c06
2017-07-10loplugin:useuniqueptr in vclNoel Grandin2-14/+14
Change-Id: Ieece2f9728755a8ae91275535eaa39319eea274e Reviewed-on: https://gerrit.libreoffice.org/39740 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-07-10teach unnecessaryparen loplugin about identifiersNoel Grandin1-1/+1
Change-Id: I5710b51e53779c222cec0bf08cd34bda330fec4b Reviewed-on: https://gerrit.libreoffice.org/39737 Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-07-07loplugin:unnecessaryparen handle parens inside call exprNoel Grandin1-1/+1
stick to single-arg function calls, sometimes parens in multi-arg calls might be there for clarity Change-Id: Ib80190c571ce65b5d219a88056687042de749e74 Reviewed-on: https://gerrit.libreoffice.org/39676 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-07-06loplugin unnecessaryparan improvementsNoel Grandin1-1/+1
Change-Id: I73e945d6ec53537a0da45f6b6291018c7f251a7e Reviewed-on: https://gerrit.libreoffice.org/39587 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-07-05coverity#1414484 Division or modulo by zeroCaolán McNamara1-4/+2
this looks wrong since initial checkin, why check that xres is non 0 before dividing by yres Change-Id: I5f1c19dadafe561cac8fde4f2bf371587c4ef5f0 Reviewed-on: https://gerrit.libreoffice.org/39573 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2017-07-05vcl: Fix memory leak at importing graphic from a URLTakeshi Abe1-4/+2
Change-Id: I9e511f69f489e35ff5805af8fadcdd0d69cdb8d6 Reviewed-on: https://gerrit.libreoffice.org/39553 Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-07-05new loplugin unnecessaryparenNoel Grandin4-6/+6
Change-Id: Ic883a07b30069ca6342d7521c8ad890f4326f0ec Reviewed-on: https://gerrit.libreoffice.org/39549 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-07-03tdf#39468 Translate German comments/termsJens Carl1-1/+1
Change-Id: I9edef3138964d3f43745be39956bc6bb66d0cc4d Reviewed-on: https://gerrit.libreoffice.org/39403 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Johnny_M <klasse@partyheld.de> Reviewed-by: Eike Rathke <erack@redhat.com>
2017-07-03Fix typosAndrea Gelmini1-1/+1
Change-Id: Iaf63c488f895c446bb54119d8c9f15e0adcd1eff Reviewed-on: https://gerrit.libreoffice.org/39454 Reviewed-by: Julien Nabet <serval2412@yahoo.fr> Tested-by: Julien Nabet <serval2412@yahoo.fr>
2017-06-28loplugin:oncevar in vclNoel Grandin5-17/+12
Change-Id: I37a6dacda12e1c2910737d74aa344c7e2e195aeb Reviewed-on: https://gerrit.libreoffice.org/39328 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-06-23convert to std::vectorCaolán McNamara1-5/+5
Change-Id: I37a866f4248ad6441cb73b826c13b3602b96e03a
2017-06-23coverity#1412987 Untrusted value as argumentCaolán McNamara1-3/+11
Change-Id: Ia41c81d7cf864a5b38594b85577139bdaf5fc7bb
2017-06-23move pBuffer out of classCaolán McNamara3-30/+28
Change-Id: I88120530b21ebe72796ddee39c2446a70c3fd193
2017-06-21convert ErrCode to strong typedefNoel Grandin2-31/+18
would have preferred to re-use o3tl::strong_int, of which this is a modified copy, but there are lots of convenience accessors which are nice to define on the class. Change-Id: I301b807aaf02fbced3bf75de1e1692cde6c0340a Reviewed-on: https://gerrit.libreoffice.org/38497 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-06-17loplugin:unusedfields in vcl part2Noel Grandin3-16/+10
Change-Id: Icd02f63e9738c0bb91348e2084649f9edc281e67 Reviewed-on: https://gerrit.libreoffice.org/38833 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-06-17loplugin:unusedfields in vcl part1Noel Grandin3-17/+3
Change-Id: I67d176003f39992cd0ff9271a7d6ce26d2cb6619 Reviewed-on: https://gerrit.libreoffice.org/38828 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-06-09clang-tidy readability-non-const-parameterNoel Grandin3-6/+6
Change-Id: I7b2680898dbfc49185fb949349d81f4ac615a470 Reviewed-on: https://gerrit.libreoffice.org/38593 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-06-05Improved loplugin:cstylecast to reference types: vclStephan Bergmann1-3/+3
Change-Id: I86d31a6dcd01700d6ac8712134f82f0cc83e46f6
2017-06-04no need to construct unique_ptr hereJochen Nitschke1-4/+4
and std::move is not needed when returning unique_ptr Change-Id: I9b4d2d6b8a41b570a9bd99e44a743ff161b78c59 Reviewed-on: https://gerrit.libreoffice.org/38385 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-06-02convert GRFILTER constants to ERRCODE_GRFILTER_Noel Grandin1-88/+88
since various code mixes these constants in with ErrCode values from other code, let us just make it into real ErrCode values. Change-Id: Ifa3d0f7526172609a44e6749bed9f730ab6b1a95 Reviewed-on: https://gerrit.libreoffice.org/38313 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-05-24vcl: parallelize JPEG import from ImportGraphics()Miklos Vajna1-3/+40
Just the expensive, pixel reading part, not the bitmap creation, which isn't thread-safe. Change-Id: I3723d80aa29ee5f2e604800cb2061c59b0b0324d Reviewed-on: https://gerrit.libreoffice.org/37978 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
2017-05-24vcl: factor out graphic import filter state to GraphicImportContextMiklos Vajna1-46/+73
Have all the data needed to read pixel data at one place. Change-Id: Ie00b154b941c775d6ff4bf11019464423b3e2425 Reviewed-on: https://gerrit.libreoffice.org/37975 Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk> Tested-by: Jenkins <ci@libreoffice.org>
2017-05-23vcl GraphicFilter: invoke JPEG import directly in ImportGraphics()Miklos Vajna1-1/+68
So that later the two ImportJPEG() calls can be invoked in separate for loops. Change-Id: I7b806d7c604d406411d5113731229eb9f761eee4 Reviewed-on: https://gerrit.libreoffice.org/37955 Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk> Tested-by: Jenkins <ci@libreoffice.org>
2017-05-23vcl GraphicFilter: add ImportGraphics()Miklos Vajna1-0/+17
This is similar to ImportGraphic(), but can handle multiple streams with one function call. Change-Id: I8d5dc8de64321c3c1fb9e1037527b411fd68dca8 Reviewed-on: https://gerrit.libreoffice.org/37953 Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk> Tested-by: Jenkins <ci@libreoffice.org>
2017-05-19loplugin:stringcopy: vclStephan Bergmann1-1/+1
Change-Id: I41a9642a8707e9da5be55ddb942a83ebbb9f9c3f
2017-05-18Revert "Fix typos"Stephan Bergmann1-1/+1
This reverts commit 26a67002fcb9381b54de6cae1aaa37120d49066a. "Iff" is not a typo, see 2a65bf32ec270484dcea4d22d3c93552dc0c24dd "Revert 'Typo: iff->if'".
2017-05-18Fix typosAndrea Gelmini1-1/+1
Only replaced "iff" with "if" Change-Id: Ib9dfa5c12b05500043147fe3b65f923b1b12a581 Reviewed-on: https://gerrit.libreoffice.org/37782 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Eike Rathke <erack@redhat.com>
2017-05-15ofz#1612 avoid oomCaolán McNamara1-0/+2
Change-Id: I2e327ea449dad8ec88963b6b9429e478a3332e22
2017-05-09cleanup osl/diagnose.h includesJochen Nitschke1-1/+0
with command > git grep -l osl/diagnose.h *.cxx | xargs grep -L -w 'OSL_\w*' | xargs sed -i '/#include *\(<\|\"\)osl\/diagnose.h\(>\|\"\).*/d' headers need more work Change-Id: I906519ebbd47a04703b4fa5943b2f7abea7a97ab Reviewed-on: https://gerrit.libreoffice.org/37350 Tested-by: Jochen Nitschke <j.nitschke+logerrit@ok.de> Reviewed-by: Michael Stahl <mstahl@redhat.com>
2017-05-08vcl: split jpeg import into two partsMiklos Vajna7-35/+73
Split the import into two: 1) Just create the bitmap, this part is not thread-safe (e.g. OpenGLContext::makeCurrent() is called when OpenGL is enabled). 2) Import the image into an existing bitmap. The point is that the second part takes much more time than the first, and in the future that part may be executed on a thread, while without such a split the whole ImportJPEG() can't do that. For now GraphicFilter::ImportGraphic() simply invokes the two parts after each other, so no real functional changes yet. Change-Id: Iee742a2cd3c581aeaf1a1ed9f55cd543955a85e0 Reviewed-on: https://gerrit.libreoffice.org/37397 Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk> Tested-by: Jenkins <ci@libreoffice.org>
2017-05-04Replace all OUString("") with OUString()Arnaud Versini1-14/+14
Change-Id: Ie14c4d76cb61cfbe0410103adfc1afc8ade0f3e0 Reviewed-on: https://gerrit.libreoffice.org/37146 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-04-28loplugin:salunicodeliteral: vclStephan Bergmann1-1/+1
Change-Id: I4a982da10ad76f8ae05355cec9629b906c95afdb
2017-04-26tdf#39674: Rename Fehler to ErrorJens Carl1-5/+5
Change-Id: Ib8288db4ddde159f274a0ca251230c7d721e0079 Reviewed-on: https://gerrit.libreoffice.org/36972 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2017-04-25clang-tidy readability-simplify-boolean-expr in vclNoel Grandin1-7/+2
Change-Id: I10ad38bcb5b05a754de9a396f4aaa79d97458d6f Reviewed-on: https://gerrit.libreoffice.org/36930 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-04-25tools: svstream.hxx needs only errcode.hxx & not errinf.hxxChris Sherlock3-0/+3
Change-Id: Ia28e35ae5af4f601e9a586a3deffbcd61702b0ca Reviewed-on: https://gerrit.libreoffice.org/36896 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Chris Sherlock <chris.sherlock79@gmail.com>
2017-04-25loplugin:checkunusedparams in vclNoel Grandin5-11/+10
Change-Id: I26661684e634aa15a18f78442de15c9db832f319 Reviewed-on: https://gerrit.libreoffice.org/36886 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-04-24drop old WinMtfOutput::DrawPolygon methodNoel Grandin3-11/+6
Change-Id: I7e9696718149f0d708e029efa0edbfa2b4f62b89 Reviewed-on: https://gerrit.libreoffice.org/36880 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-04-19remove freshly unused menu support from src filesCaolán McNamara1-0/+1
Change-Id: I038711a0c4d440d452d5b2ae1bfcba5c9305815b Reviewed-on: https://gerrit.libreoffice.org/36646 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2017-04-19vcl JPEG import: remove unused pCallerDataMiklos Vajna5-6/+6
Which is always set to nullptr, is passed around, finally just ignored. Change-Id: I81aecbed33ea249e63fbb412a54345fbb8335e47 Reviewed-on: https://gerrit.libreoffice.org/36662 Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk> Tested-by: Jenkins <ci@libreoffice.org>
2017-04-15Fix typosAndrea Gelmini1-1/+1
Change-Id: I0238202c0dc0380b0e33a9c4567a9513c0afbe91 Reviewed-on: https://gerrit.libreoffice.org/36556 Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-04-14vcl PDF import: don't assume larger offset -> newer trailerMiklos Vajna1-3/+34
Usually when the PDF file contains incremental updates the updates are appended at the end of the document. But this is not required, the various trailers can be in any order. Make sure that we look at the last trailer (logically last, not the one with the largest file offset) when looking for pages. Change-Id: Idcd85a7c6bbf08c9436dd73933d79cdb683f482c Reviewed-on: https://gerrit.libreoffice.org/36527 Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk> Tested-by: Jenkins <ci@libreoffice.org>
2017-04-11Related: tdf#106972 vcl PDF import: downgrade PDF >= 1.5Miklos Vajna1-4/+103
There are two problems with these newer PDF versions: - the current PDF export code doesn't know how to roundtrip such PDF images (needs work on both the import and export side) - upgrading the default PDF export version would upset readers who can't parse PDF >= 1.5 So instead of raising the default PDF export version, for now just be conservative and depend on pdfium to downgrade the PDF image version to 1.4 if it would be higher. Given that this modifies the input of the graphic filter this also needs changes in the ODF export, so that the filter result will contain that downgraded data, not the original one. Change-Id: I1efa97af8110e9a6ee3e8a7339bcc7d70457cfb0 Reviewed-on: https://gerrit.libreoffice.org/36413 Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk> Tested-by: Jenkins <ci@libreoffice.org>
2017-04-09std::unique[]->std::vectorCaolán McNamara1-7/+7
Change-Id: If1b66f273e412f2206274a903a06bee90a2a6c91 Reviewed-on: https://gerrit.libreoffice.org/36307 Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2017-04-09make this more readableCaolán McNamara1-29/+32
no logic change intended Change-Id: I097247ab1da409e56dce01fdb000e8d416e82add Reviewed-on: https://gerrit.libreoffice.org/36306 Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2017-04-08ofz#1069 avoid oomCaolán McNamara1-0/+2
Change-Id: I7b567f49651496969ca0da56de702f10e6a39494
2017-04-07tdf#107018 PDF export of PDF images: handle references in nested dictionariesMiklos Vajna1-16/+11
Also get rid of the GetKeyOffset() and GetKeyValueLength() calls when copying dictionaries: the reference already knows its offset and length, so no need to call them. This makes the dictionary and the array handling more similar. Change-Id: I65936acfaf857636a8d83da3a4cec69289eb89d8 Reviewed-on: https://gerrit.libreoffice.org/36282 Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk> Tested-by: Jenkins <ci@libreoffice.org>