summaryrefslogtreecommitdiff
path: root/filter
AgeCommit message (Collapse)Author
2018-08-29replace rtl_allocateMemory with std::mallocNoel Grandin
where used directly, since rtl_allocateMemory now just calls into std::malloc Change-Id: I59f85bdb7efdf6baa30e8fcd2370c0f8e9c999ad Reviewed-on: https://gerrit.libreoffice.org/59685 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-08-29new loplugin:oustringbufferNoel Grandin
look for places where we are appending the temporary result of adding strings together, to an OUStringBuffer, where we could rather call append repeatedly and avoid the temporary creation Change-Id: I481435124291ac7fb54b91a78344a9fe5b379a82 Reviewed-on: https://gerrit.libreoffice.org/59708 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-08-24Fix typosAndrea Gelmini
Change-Id: Ie6e3f3edabcd1ef9b44aefeb81ea84ca28654606 Reviewed-on: https://gerrit.libreoffice.org/59578 Tested-by: Jenkins Reviewed-by: Jens Carl <j.carl43@gmx.de>
2018-08-24iRelated rhbz#1618703: Properly handle failure en-/decoding PDF fileStephan Bergmann
...when e.g. FIPS mode makes the various calls to rtl_cipher_initARCFOUR fail. Change-Id: Id1b2222249c151470e233ab814b21228f3a8b561 Reviewed-on: https://gerrit.libreoffice.org/59543 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2018-08-21loplugin:useuniqueptr in PPTNumberFormatCreatorNoel Grandin
Change-Id: I6c2e155834d3c75807bee12b1ab03d575b6a8413 Reviewed-on: https://gerrit.libreoffice.org/59355 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-08-20loplugin:useuniqueptr in svt::DialogNoel Grandin
Change-Id: Ib13cd74f186de0db1be4414e893b2d4f66048b44 Reviewed-on: https://gerrit.libreoffice.org/59304 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-08-17Consolidate: basegfx::clamp -> o3tl::clampStephan Bergmann
Change-Id: Iffd8b0a19d4479b6c70dc834c6f64499e87e01b1 Reviewed-on: https://gerrit.libreoffice.org/59265 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2018-08-16Fix typo: s/an other/another/gAndrea Gelmini
Change-Id: I203c546cfca841e7853282267190e20b60919add Reviewed-on: https://gerrit.libreoffice.org/59098 Tested-by: Jenkins Reviewed-by: Jens Carl <j.carl43@gmx.de>
2018-08-16PDF export: allow API users to opt in for version 1.6Miklos Vajna
Don't make it the default yet, though. Change-Id: Ida56eb25a84bf5425d4879c062c084bb68984d9a Reviewed-on: https://gerrit.libreoffice.org/59180 Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk> Tested-by: Jenkins
2018-08-16loplugin:useuniqueptr in swf::WriterNoel Grandin
Change-Id: Id10d9b120cf81b1576da48840f84353537466d17 Reviewed-on: https://gerrit.libreoffice.org/59027 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-08-15loplugin:useuniqueptr in CGMChartNoel Grandin
Change-Id: I55e11d158c50a76b0fad1da0e1adc3712990aa8f Reviewed-on: https://gerrit.libreoffice.org/59028 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-08-06coverity#1438216 Resource leakCaolán McNamara
Change-Id: I2b105221cd90ac224bb140a005ed40c30ad92837 Reviewed-on: https://gerrit.libreoffice.org/58627 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2018-08-05Fix typosAndrea Gelmini
Change-Id: I2ea9b44f180a44efb0bfd37d4273009cf3f44480 Reviewed-on: https://gerrit.libreoffice.org/58591 Reviewed-by: Julien Nabet <serval2412@yahoo.fr> Tested-by: Jenkins
2018-08-04Use more basegfx deg<->rad functions, instead of direct formulasMike Kaganski
Also make the functions constexpr. Due to slight changes in floating-point arithmetics (90.0 instead of 180.0, M_PI2 instead of M_PI resp.), results might differ in last digits (usually 17th decimal digit). This has lead to need to tweak char2dump's PieChartTest unit test. Change-Id: I20323dd7dab27e4deb408ea4181e390cc05e7cd3 Reviewed-on: https://gerrit.libreoffice.org/58583 Tested-by: Jenkins Reviewed-by: Tamás Zolnai <tamas.zolnai@collabora.com> Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2018-08-03Move angle normalization code from various places to toolsMike Kaganski
Also rename svx angle normalization functions in include/svx/svdtrans.hxx, that deal with 100ths of degree, to avoid confusion: NormAngle180 -> NormAngle18000; NormAngle360 -> NormAngle36000. Some places were fixed that previously returned inclusive ranges (i.e., both 0 and 360), see changes in these files: chart2/source/view/main/PlottingPositionHelper.cxx chart2/source/view/main/PolarLabelPositionHelper.cxx chart2/source/view/main/ShapeFactory.cxx filter/source/graphicfilter/idxf/dxf2mtf.cxx sw/source/core/graphic/grfatr.cxx (the latter now matches the comment in the function). Change-Id: I9f274bbb4168360d60dceff02aeba6332c519a59 Reviewed-on: https://gerrit.libreoffice.org/58556 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2018-08-03forcepoint#70 give all escher client data objects a common parent classCaolán McNamara
and make NotifyFreeObj a virtual method of SvxMSDffClientData, finding the sc case where the client data was neither SvxMSDffImportData nor ProcessData. make the sc case a XclImpDrawObjClientData whose NotifyFreeObj is a noop Change-Id: I07422e7a3415114674bb1e3c1ef120299adf2dc8 Reviewed-on: https://gerrit.libreoffice.org/58551 Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2018-08-02loplugin:returnconstant in filterNoel Grandin
Change-Id: I0ebbd835ddc50e984920950e1559faf163c2c30f Reviewed-on: https://gerrit.libreoffice.org/58429 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-08-01fix up non standard indent and stray ;Caolán McNamara
Change-Id: Ica713270278046ec8f64531eb67be17787fbedf7 Reviewed-on: https://gerrit.libreoffice.org/58413 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2018-08-01forcepoint#63 null derefCaolán McNamara
Change-Id: Ib22ff870cd0d8cdd2350b2aa8698f5a2e3866bdc Reviewed-on: https://gerrit.libreoffice.org/58410 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2018-07-30Add missing sal/log.hxx headersGabor Kelemen
rtl/string.hxx and rtl/ustring.hxx both unnecessarily #include <sal/log.hxx> (and don't make use of it themselves), but many other files happen to depend on it. This is a continuation of commit 6ff2d84ade299cb3d14d4110e4cf1a4b8070c030 to be able to remove those unneeded includes. This commit adds missing headers to every file found by: grep -FwL sal/log.hxx $(git grep -Elw 'SAL_INFO|SAL_INFO_IF|SAL_WARN|SAL_WARN_IF|SAL_DETAIL_LOG_STREAM|SAL_WHERE|SAL_STREAM|SAL_DEBUG') to directories from filter to jvmfwk Change-Id: I2a73d63f2aaef5f26d7d08957daaa8a30b412ac5 Reviewed-on: https://gerrit.libreoffice.org/58204 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
2018-07-28loplugin:stringloop in filterNoel Grandin
Change-Id: Icb2df9854975544ae3e164b5d25a6628824027e5 Reviewed-on: https://gerrit.libreoffice.org/58212 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-07-27use boost::optional for OUString instead of std::unique_ptrNoel Grandin
Change-Id: I4539380956dad232f3ce92498b8f58a205fe00b1 Reviewed-on: https://gerrit.libreoffice.org/58196 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-07-26filter: avoid -Werror=deprecated-copy (GCC trunk towards GCC 9)Stephan Bergmann
...by explicitly defaulting the copy/move functions (and, where needed in turn, also a default ctor) for classes that have a user-declared dtor that does nothing other than an implicitly-defined one would do, but needs to be user- declared because it is virtual and potentially serves as a key function to emit the vtable, or is non-public, etc.; and by removing explicitly user- provided functions that do the same as their implicitly-defined counterparts, but may prevent implicitly declared copy functions from being defined as non- deleted in the future. (Even if such a user-provided function was declared non-inline in an include file, the apparently-used implicitly-defined copy functions are already include, so why bother with non-inline functions.) Change-Id: I20a2c713f0fea62659d44298c1d98dc9b7f2d5aa Reviewed-on: https://gerrit.libreoffice.org/58076 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2018-07-25ofz#8539 share LineInfo to save memoryCaolán McNamara
Change-Id: I6a97d82e55fb91f2c45add4d066522f36fabff6c Reviewed-on: https://gerrit.libreoffice.org/57983 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2018-07-24Fix typosAndrea Gelmini
Change-Id: I07cf04cd2acc5b50d64224edb9f2c2de2c61e356 Reviewed-on: https://gerrit.libreoffice.org/57884 Reviewed-by: Julien Nabet <serval2412@yahoo.fr> Tested-by: Jenkins
2018-07-22Fix typosAndrea Gelmini
Change-Id: Ia78310bd85c9a582245074bd46154516a1f21c86 Reviewed-on: https://gerrit.libreoffice.org/57826 Tested-by: Jenkins Reviewed-by: Jens Carl <j.carl43@gmx.de>
2018-07-22Fix typosAndrea Gelmini
Change-Id: I326827c394347cbe9fad242e9da5702cba7a4d95 Reviewed-on: https://gerrit.libreoffice.org/57761 Tested-by: Jenkins Reviewed-by: Jens Carl <j.carl43@gmx.de>
2018-07-21Fix typosAndrea Gelmini
Change-Id: I8dd681eebf5534224d1b5e886d6a0600767f9c98 Reviewed-on: https://gerrit.libreoffice.org/57600 Tested-by: Jenkins Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2018-07-18Related: rhbz#1602589 dead_error_line: Execution cannot reach this statementCaolán McNamara
Change-Id: If0e4ea982ede92d564aafb247c789cc6cc3013ca Reviewed-on: https://gerrit.libreoffice.org/57638 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2018-07-18Related: rhbz#1602589 copy_paste_error: 'getKeyTimes'Caolán McNamara
Change-Id: I2b48d8c75af42429ce41a8f809fc3ac82cb354de Reviewed-on: https://gerrit.libreoffice.org/57636 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2018-07-13tdf#110987: type detection, binary Office formats > templatesAron Budea
The templates for binary MS Office formats were higher prioritized than non-templates, this caused files in binary format and lacking file extension to be identified as templates. Change-Id: I5638b38dfa0a7520dd09cb497c05b6af0eb00834 Reviewed-on: https://gerrit.libreoffice.org/40651 Tested-by: Jenkins Reviewed-by: Jan Holesovsky <kendy@collabora.com>
2018-07-11tdf#118232 Allow load and insert of SVGs with no GeometryArmin Le Grand
Change-Id: Iaf3d6a0423c5f11dda1e623dd730af01dbd6551c Reviewed-on: https://gerrit.libreoffice.org/57284 Tested-by: Jenkins Reviewed-by: Armin Le Grand <Armin.Le.Grand@cib.de>
2018-07-10Make EscherPropertyContainer::CreatePolygonProperties saferArmin Le Grand
Additionally adapted EscherPropertyContainer's AddOpt methods to be more safe and flexible. Added support for SvMemoryStream. Changed Data handling in EscherPropSortStruct to use std::vector<sal_uInt8>, adapted all usages and converions throgh all modules. This makes memorty handling for these parts much safer (no more local new-ops, no longer delete[] there). Currently there are quite some usages of nProp.size() and &nProp[0] to access the data. but the base for further changes to work more on std::vector is done. Change-Id: I982225c5bfc06fdd9e195d18cd3c550d15f1d48d Reviewed-on: https://gerrit.libreoffice.org/57061 Tested-by: Jenkins Reviewed-by: Armin Le Grand <Armin.Le.Grand@cib.de>
2018-07-10tdf#42949 Fix IWYU warnings in include/osl/*hxxGabor Kelemen
Found with bin/find-unneeded-includes Only removal proposals are dealt with here. Change-Id: I7b19938246ca8498fa300f781589bf17b3d486aa Reviewed-on: https://gerrit.libreoffice.org/56723 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
2018-07-10pass SvStream around by std::unique_ptrNoel Grandin
and give utl::OStreamWrapper a new constructor so that it knows it is taking ownership of the SvStream, which appears to fix several leaks Change-Id: Idcbcca9b81a4f0345fd8b8c8a2f4e84213686a6b Reviewed-on: https://gerrit.libreoffice.org/57187 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-07-09tdf#112690: make page size of exported PDF closer to what is setAron Budea
regression from 3a2ccb419c5face6fbf56b1a4877e675d4cd5fe8 Change-Id: Ia0fddeb112fa0867ec367c085e3682eac078d5f8 Reviewed-on: https://gerrit.libreoffice.org/57166 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
2018-07-06tdf#118254 Do not rely on XStatusIndicator for SVG importArmin Le Grand
For SVGs loaded as Document and status 'hidden' is used, there is no xStatusIndicator handed over to the SVGFilter. Compared with old filter - there it was used setting it somewhere else, but not required. Remove code that it requires it. Change-Id: I9fbf2b4ea02d8c5aae234f78f96b4acd37b7341b Reviewed-on: https://gerrit.libreoffice.org/57062 Tested-by: Jenkins Reviewed-by: Katarina Behrens <Katarina.Behrens@cib.de>
2018-07-05Only access css::drawing::PointSequence when not emptyArmin Le Grand
Had to adapt EscherPropertyContainer::GetPolyPolygon due to it using conversions from UNO API drawing::PointSequence to old tools::polygon, containing unsafe memory accesses. It is not useful to fix that, use new tooling instead. Before correctly testing nCount for zero in b2dpolygontools.cxx when you look closely always a point was added - a random one due to accessing random memory. This is corrected, so in test case for "tdf104115.docx" a PolyPolygon with two polys is used, the first being empty (had one point due to the error mentioned above). When having no points, CreatePolygonProperties in escherex.cxx does badly calculate and alloc the pSegmentBuf array used to write to doc formats (in the test case - 20 bytes alloced, 22 written). This did not happen before due to having always a point due to the error before - argh! Corrected that and hopefully this will work now. To be on the safe side and to not need to redefine that whole CreatePolygonProperties I will turn back that little change and better sort-out empty polygons inside GetPolyPolygon alrteady. That should bring us back to the original state, at the same time avoiding that CreatePolygonProperties has to handle empty Polygons at all. That stuff urgently needs cleanup - I took a look and thought about using std::vector<sal_uInt8> so no wrong alloc or write too much could happen, but that nTotalBezPoints needs to be pre-calculated because it gets itself written to that buffers... Change-Id: Iefc885928f5bb29bceaf36c2a1555346bb21fd26 Reviewed-on: https://gerrit.libreoffice.org/56927 Tested-by: Jenkins Reviewed-by: Armin Le Grand <Armin.Le.Grand@cib.de>
2018-07-04sw HTML export: use PNG fallback + RTF native data for all images for ReqIFMiklos Vajna
ReqIF says the image should be either PNG or has a PNG fallback and then it can be something else. We used to convert images to PNG to avoid writing any native data, but results in data loss. So instead: 1) Write the original image as an RTF fragment, so it's not lost. 2) Some ReqIF parsers expect an RTF fragment even for PNG, so make sure we always write the RTF fragment, even if that means a small duplication. Change-Id: Ida0fcaa58d56b9e11f81992307505599807353b5 Reviewed-on: https://gerrit.libreoffice.org/55430 Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk> Tested-by: Jenkins
2018-07-02loplugin:constantparamNoel Grandin
Change-Id: I9fbfa6163c1d4650c52b00dc911972f07fe7c0e5 Reviewed-on: https://gerrit.libreoffice.org/56778 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-07-02pass OutlinerParaObject around by std::unique_ptrNoel Grandin
SdrText::SetOutlinerParaObject was modified to not check for self-assign, and instead assert because the existing check was no longer possible. Fix bug in SdrUndoObjSetText::Undo(), where it was calling SdrText::SetOutlinerParaObject unnecessarily, because NbcSetOutlinerParaObjectForText already does that. Optimise Outliner::GetEmptyParaObject by creating a new constructor for OutlinerParaObject, so we don't need to copy the new object we get back from GetEmptyTextObject, unnecessarily. Change-Id: I57c475583d6c31658c154e24992b3d587bad9841 Reviewed-on: https://gerrit.libreoffice.org/56730 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-06-29Improved loplugin:redundantcast (const-qualified typedefs): filterStephan Bergmann
Change-Id: I200be1277904d346dd02e64612e6f1bed24f17a3 Reviewed-on: https://gerrit.libreoffice.org/56695 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2018-06-27Suspiciously, copy ops of Bundle-derived classes didn't copy Bundle::mnColorStephan Bergmann
Lets assume that that was an oversight, and change all those user-provided copy assignment ops into implicitly-defined ones (that will now also copy Bundle::mnColor). Avoids -Wdeprecated-copy with GCC trunk towards GCC 9, as the copy ctors were already left implicitly-defined (and so already copied Bundle::mnColor). Change-Id: I43e323b55d059c7afecaddab0d777b6df47182c8 Reviewed-on: https://gerrit.libreoffice.org/56539 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2018-06-22Fix typosAndrea Gelmini
Change-Id: Ia3590ef4fd38f1a71badefb867117a1c08a591c6 Reviewed-on: https://gerrit.libreoffice.org/54569 Reviewed-by: Julien Nabet <serval2412@yahoo.fr> Tested-by: Christian Lohmaier <lohmaier+LibreOffice@googlemail.com>
2018-06-20filter clean-up: remove duplicate of checking EMF magic headerLászló Németh
Change-Id: I63fd380be974c1d15beef0d2cfec42350119ae2f Reviewed-on: https://gerrit.libreoffice.org/56050 Tested-by: Jenkins Reviewed-by: László Németh <nemeth@numbertext.org>
2018-06-20Removed executable permission on source filesAndrea Gelmini
chmod -x Change-Id: I3aeae8d171591f09ffa6b96bbdabe235ab6f4a4d Reviewed-on: https://gerrit.libreoffice.org/55802 Tested-by: Jenkins Reviewed-by: Jens Carl <j.carl43@gmx.de>
2018-06-19tidy up setting parentsCaolán McNamara
Change-Id: Ic0d30d066c76f2b30a5c4e6c864d80c8242c2444 Reviewed-on: https://gerrit.libreoffice.org/56067 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2018-06-18weld ImpPDFTabDialogCaolán McNamara
Change-Id: I0b7f439a6e712c9824008b21bfc511432641dbee Reviewed-on: https://gerrit.libreoffice.org/56041 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2018-06-18weld ImpPDFTabGeneralPageCaolán McNamara
Change-Id: Ic72572f775f68ee5378203c9d0cded1baa02b297 Reviewed-on: https://gerrit.libreoffice.org/56026 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2018-06-18weld ImpPDFTabOpnFtrPageCaolán McNamara
Change-Id: Icafd88d41f2f0757fcf788882196e7ac07d7c745 Reviewed-on: https://gerrit.libreoffice.org/56024 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>