summaryrefslogtreecommitdiff
path: root/oox
AgeCommit message (Collapse)Author
2018-09-17ofz#10395 Null-dereferenceCaolán McNamara
Change-Id: I7bde5987a51949d60174335327652186e0ad8998 Reviewed-on: https://gerrit.libreoffice.org/60559 Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2018-09-17New loplugin:externalStephan Bergmann
...warning about (for now only) functions and variables with external linkage that likely don't need it. The problems with moving entities into unnamed namespacs and breaking ADL (as alluded to in comments in compilerplugins/clang/external.cxx) are illustrated by the fact that while struct S1 { int f() { return 0; } }; int f(S1 s) { return s.f(); } namespace N { struct S2: S1 { int f() { return 1; } }; int f(S2 s) { return s.f(); } } int main() { return f(N::S2()); } returns 1, both moving just the struct S2 into an nunnamed namespace, struct S1 { int f() { return 0; } }; int f(S1 s) { return s.f(); } namespace N { namespace { struct S2: S1 { int f() { return 1; } }; } int f(S2 s) { return s.f(); } } int main() { return f(N::S2()); } as well as moving just the function f overload into an unnamed namespace, struct S1 { int f() { return 0; } }; int f(S1 s) { return s.f(); } namespace N { struct S2: S1 { int f() { return 1; } }; namespace { int f(S2 s) { return s.f(); } } } int main() { return f(N::S2()); } would each change the program to return 0 instead. Change-Id: I4d09f7ac5e8f9bcd6e6bde4712608444b642265c Reviewed-on: https://gerrit.libreoffice.org/60539 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2018-09-14oox: create QuickDiagrammingImport instances with an uno constructorMiklos Vajna
This is effectively dead code as commit 547217ecf2348cf511b1f058ecbab6f15f2bceff (Document seemingly dead QuickDiagrammingImport, QuickDiagrammingLayout, 2013-06-03) found, so the primary motivation is to just get this out of oox_component_getFactory(). Change-Id: If0a585c2fc4b87ceb00e6f772fef2ac65d10dc67 Reviewed-on: https://gerrit.libreoffice.org/60470 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
2018-09-14tdf#108064 OOXML export: fixing linestyle export in chartsAdam Kovacs
getLineDash function copy paste from ChartLinePanel.cxx. We query the actual linedash value associated to the LineDashName of the chart line via DashTable service. Thanks for the guidance of László Németh! Change-Id: I565fc968ce009803f9872da1f01dd56cfe07ddb3 Reviewed-on: https://gerrit.libreoffice.org/60424 Reviewed-by: László Németh <nemeth@numbertext.org> Tested-by: László Németh <nemeth@numbertext.org>
2018-09-13crashtesting: divide by zeroCaolán McNamara
since... commit f3d6c44c9cb533fe4f1cd28fc95adc36cac4bfd5 Date: Mon Sep 3 11:05:44 2018 -0400 tdf#108064 OOXML export: keep preset dashes with any line width Change-Id: I948123977f48d1f1005788f6a2c117e8971cab6f Reviewed-on: https://gerrit.libreoffice.org/60423 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2018-09-11tdf#119617 Fix export of Autofit property of shapes to PPTXBalazs Varga
With this patch the "Resize shape to fit text" property (TextAutoGrowHeight-->spAutofit/noAutofit) will be exported correctly to PPTX format. Change-Id: I5fa975c6390a17bad30c360b3b17aa944bbe72af Reviewed-on: https://gerrit.libreoffice.org/60043 Tested-by: Jenkins Reviewed-by: László Németh <nemeth@numbertext.org>
2018-09-11clang-tidy bugprone-copy-constructor-initNoel Grandin
Change-Id: Idd435b3a4d081f6d3af26ff8add69ad4af50db57 warning: calling a base constructor other than the copy constructor Reviewed-on: https://gerrit.libreoffice.org/60239 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-09-10tdf#42949 Fix IWYU warnings in include/cppuhelper/*Gabor Kelemen
Found with bin/find-unneeded-includes Only removal proposals are dealt with here. Change-Id: Ib420e9216b8313f5ed7634ec375e39ceb741fd45 Reviewed-on: https://gerrit.libreoffice.org/59297 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
2018-09-10tdf#108064 OOXML export: keep preset dashes with any line widthAdam Kovacs
Change-Id: I496e1cbac527383837a4e8fcdee42967ecf555e4 Reviewed-on: https://gerrit.libreoffice.org/59968 Tested-by: Jenkins Reviewed-by: László Németh <nemeth@numbertext.org>
2018-09-09Avoid getTokenCountMatteo Casalin
Change-Id: I60d11dab9bc04462cf3cc0412a356ec51212fb6e
2018-09-09loplugin:simplifyconstruct in l10ntools..packageNoel Grandin
Change-Id: I8dba8ef1e7455af1e55bbd6086b49c0606bf4927 Reviewed-on: https://gerrit.libreoffice.org/60212 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-09-09Revert "clang-tidy performance-move-const-arg"Noel Grandin
This reverts commit 3d604d1cd6cc70ef96782ef769f0479b509987a8. comments from sberg: I assume dropping the std::move from aCurSel(std::move(aSel)) is caused by performance-move-const-arg's warning "if std::move() is called with an argument of a trivially-copyable type" (<https://clang.llvm.org/extra/clang-tidy/checks/performance-move-const-arg.html>). For my taste, that approach is too tightly tied to a class's current implementation details, something that may change over time. Imagine a trivially copyable class C with a raw pointer member (where the lifecycle of the pointed-to object is tracked by some higher-level, likely broken protocol). Now, that protocol is fixed and the raw pointer member is replaced with a std::shared_ptr. C is no longer trivially copyable, and the dropped std::move would turn out to be beneficial again. (Also, if Clang and clang-tidy did implement the fixed rules for trivially copyable classes from CWG1734/C++17, where a subset of a trivially copyable class's copy/move members may be deleted, the above rule to warn "if std::move() is called with an argument of a trivially-copyable type" would no longer make sense as written; consider a trivially copyable class whose copy ctor has been deleted.) Change-Id: Icb91610e50ed98b8f55fe6323bdfa48c8cb9b4b9 Reviewed-on: https://gerrit.libreoffice.org/60166 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-09-07tdf#108691, tdf#119639 Don't print hidden objects in XLS(X)Aron Budea
In Excel hidden drawing objects aren't printed. When not hidden, printing is controlled by a separate 'Print object' setting. Only rely visibility setting for now, but properly: visible means also printed, hidden means not printed. Ie. import visible property also as printable, and only output visible property in XLS(X) formats. For the future, in XLSX format printability is controlled by attribute 'fPrintsWithSheet' of element 'clientData', don't know about XLS, there fUsefPrint/fPrint bits don't appear to be used anymore (see note in tdf#119639). Change-Id: I728107b30056f7bf073f2fefddece1bef1eb2e7a Reviewed-on: https://gerrit.libreoffice.org/59915 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2018-09-07oox: create PowerPointImport instances with an uno constructorMiklos Vajna
PowerPointImport_getSupportedServiceNames() was copy&pasted from oox::core::FilterBase::getSupportedServiceNames(), so it can go away entirely. Change-Id: Ia6352cea1c2d65ba94cae66b500de951d82f455a Reviewed-on: https://gerrit.libreoffice.org/60124 Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk> Tested-by: Jenkins
2018-09-06clang-tidy performance-unnecessary-value-paramNoel Grandin
Change-Id: I69247498e13331f6ef84afeb242479f8fb1178a8 Reviewed-on: https://gerrit.libreoffice.org/60068 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-09-06clang-tidy performance-move-const-argNoel Grandin
Change-Id: I607891e120688b746c8a4c577018d97147a79217 Reviewed-on: https://gerrit.libreoffice.org/60029 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-08-31oox: create DocumentPropertiesImporter instances with an uno constructorMiklos Vajna
Change-Id: I2600a59e4eac7375882aff0491ecf16bad449520 Reviewed-on: https://gerrit.libreoffice.org/59841 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
2018-08-30tdf#115670 vml shadow: shadow is off unless explicitly set onJustin Luth
The absence of "on=" is treated in Word (tested 2003) as off. Change-Id: Ibc6b0e5ca0f25a9c3ca1b9505fa24c4d821bfd0 Reviewed-on: https://gerrit.libreoffice.org/59457 Tested-by: Jenkins Reviewed-by: Justin Luth <justin_luth@sil.org> Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
2018-08-30tdf#119562 Fix export of AutoFit property of shapes to XLSXBalazs Varga
With this patch the "Resize shape to fit text" property (TextAutoGrowHeight) will be exported correctly to XLSX format. Change-Id: I488ceead452aef9096e7766f957de425c8486f85 Reviewed-on: https://gerrit.libreoffice.org/59778 Tested-by: Jenkins Reviewed-by: Tamás Zolnai <tamas.zolnai@collabora.com>
2018-08-29loplugin:constantparam (2)Noel Grandin
Change-Id: I528f22876497f87159e3b9453362ebbfb55b7092
2018-08-28tdf#39593 deduplicate code using existing functionArkadiy Illarionov
Change-Id: I437becdb0ed4840738d6c45d88cd3be2ff1243fb Reviewed-on: https://gerrit.libreoffice.org/59591 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-08-27Fix build in the !(USE_TLS_OPENSSL + USE_TLS_NSS > 0) caseTor Lillqvist
Change-Id: I746f0f322082e81cc47322989634322a0659aa73
2018-08-24tdf#73547 fix ooxml export / import custom dashes.Mark Hung
Fix import logic as well as arithmatic precion of both import and export. Change-Id: I97e9bde847e0a2425421af2f2175d4d0b7af0cab Reviewed-on: https://gerrit.libreoffice.org/59306 Tested-by: Jenkins Reviewed-by: Mark Hung <marklh9@gmail.com>
2018-08-23tdf#94502 Fix overlap export of Stacked Bar Chart to *.xlsxBalazs Varga
Export the Overlap value with 100% for stacked charts, because the default overlap value of the Bar/Column chart is 0% and LibreOffice do nothing with the overlap value in Stacked Chart case, unlike the MS Office. Change-Id: If4e20b88c2b1180f68a8d2b610c407d674a8498b Reviewed-on: https://gerrit.libreoffice.org/59448 Reviewed-by: Markus Mohrhard <markus.mohrhard@googlemail.com> Tested-by: Jenkins
2018-08-22new loplugin:conststringfieldNoel Grandin
Look for const string fields which can be static, and mostly convert them to OUStringLiteral And add a getLength() method to OUStringLiteral to make the transition easier. Remove dead code in XclExpRoot::GenerateDefaultEncryptionData, default password is never empty. Change-Id: Iae75514d9dbb87289fd5b016222f640abe755091 Reviewed-on: https://gerrit.libreoffice.org/59204 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-08-22tdf#119118 convert tmAbs value to second.Mark Hung
setInterval() of IterateContainer actually need second instead of percentage of the duration, we just need to convert tmAbs in millisecond to second to make iterate interval correct. Change-Id: I1dfc3c64187eb5b7fd8f0b6a91f41dc55466b58b Reviewed-on: https://gerrit.libreoffice.org/59412 Tested-by: Jenkins Reviewed-by: Mark Hung <marklh9@gmail.com>
2018-08-17tdf108064 OOXML export: keep preset dashes in shape outlinesAdam Kovacs
Extending commit d7551e32609d0e0de8ac419576ca42d65c5015be to all default MSO 2016 preset dashes: Saving an ooxml file with LibreOffice now preserves the prstDash tags with the values sysDot, sysDash, dash, dashDot, lgDash, lgDashDot, lgDashDotDot, instead of converting them to custDash tags. Note: the import of the preset dash outlines are still not relative to the line width, in spite of their original behaviour in MSO. Change-Id: I65eaf06952a968019495664067010c874fce1352 Reviewed-on: https://gerrit.libreoffice.org/59203 Tested-by: Jenkins Reviewed-by: László Németh <nemeth@numbertext.org> Tested-by: László Németh <nemeth@numbertext.org>
2018-08-16ofz: timeoutCaolán McNamara
Change-Id: I98fd5135eb47b518a97238ae981a0083f2e29f67 Reviewed-on: https://gerrit.libreoffice.org/59214 Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2018-08-16ofz#9932 Null-derefCaolán McNamara
Change-Id: I6a917e118fa9263069c13122765fc6c1ace2bddb Reviewed-on: https://gerrit.libreoffice.org/59183 Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2018-08-16tdf#118385 Avoid crash on loading documentSzymon Kłos
Change-Id: Ifb18fee79667a5d0284407e84877b0d4d89536d9 Reviewed-on: https://gerrit.libreoffice.org/59173 Tested-by: Jenkins Reviewed-by: Szymon Kłos <szymon.klos@collabora.com>
2018-08-16tdf#116350 Better text layout for big shapesSzymon Kłos
Added some horizontal padding - for bigger shapes and vertical adjustment for multi-line labels. Change-Id: I665b238b0d08a499cd846952d831fe449f72f575 Reviewed-on: https://gerrit.libreoffice.org/58975 Tested-by: Jenkins Reviewed-by: Szymon Kłos <szymon.klos@collabora.com>
2018-08-15ofz#9892 Null-dereferenceCaolán McNamara
Change-Id: I8ab1948e5760da365bdddaf45955912a18b20ead Reviewed-on: https://gerrit.libreoffice.org/59055 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2018-08-14tdf#119234 OOXML Shapes from Word fail to renderNoel Grandin
regression from commit 65e4a776e8315fd61fd67ad00d28985b11f0b79e simplify some OUString::copy calls I got the params switched around Change-Id: I68da0ae681f2b886e35f74bd72de0c482c843ae9 Reviewed-on: https://gerrit.libreoffice.org/58986 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-08-14create appendCopy method in OUStringBufferNoel Grandin
so we can avoid temporary copies when appending a substring of an OUString to the buffer. I would have preferred to call the method just "append" but that results in ambiguous method errors when the callsite is something like sal_Int32 n; OUStringBuffer s; s.append(n, 10); I'm not sure why Change-Id: I6b5b6641fcb5b26ce2269f89ef06e03c0b6aa76f Reviewed-on: https://gerrit.libreoffice.org/58666 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-08-14Revert "Work around what looks like MSVC 2013 miscompilation"Stephan Bergmann
This reverts commit e58f9cad29404670085803a8010729a735759088 (plus follow-up 5378963b262ade09f5a55ecb185164b2eac8c782 "Turns out this was a non-debug build" that merely tweaked the comment). Lets hope that the alleged MSVC 2013 miscompile is no longer an issue with our current MSVC 2017 baseline. (And Clang's new -fsanitize=implicit-conversion complained about return nProjKey; truncating from sal_uInt32 2271 to sal_uInt8 223 during CppunitTest_oox_vba_encryption.) Change-Id: I0dd55e658899833899a8da1ce2111edb1524e7d5 Reviewed-on: https://gerrit.libreoffice.org/58944 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2018-08-13loplugin:returnconstant in oox,packageNoel Grandin
Change-Id: I1dade7ddde6b1e226861d32f24f65be5bb9d9352 Reviewed-on: https://gerrit.libreoffice.org/58880 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-08-10tdf#119160 remove fill from all fontwork shapesSzymon Kłos
Change-Id: I66cd5ab39c3f3b8635eb4e9b5261e100a8037abf Reviewed-on: https://gerrit.libreoffice.org/58817 Tested-by: Jenkins Reviewed-by: Szymon Kłos <szymon.klos@collabora.com>
2018-08-10tdf#91999 export/drawingml: shape rotate 180 is not specialJustin Luth
This commit reverts the first (LO 4.3ish) regression commit 6063555744ed89d8a757b667cddcdd4357839466 and most of the two commits that tried to fix that: commit 9ae1e094d5a8a5b4432c88ebea0ca9fc1c79f602 and commit ee45d881efab230e7682f964d6ad4d00f85b0006 in LO6.0/6.2. The ooxmlexport6 unit test shows that there is nothing special about 180degrees. So, all transformations need to be avoided in docx format - not just 180 degree ones. I removed IsInGroupShape() since it is no longer being used - as per standard procedures. Change-Id: Id2bba5bc542875a10ac21fbb67f29b2d59705493 Reviewed-on: https://gerrit.libreoffice.org/58434 Tested-by: Jenkins Reviewed-by: Justin Luth <justin_luth@sil.org> Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
2018-08-10Resolves: rhbz#1614419 FIPS mode PK11_ImportSymKey failureCaolán McNamara
use rhbz#1461450 style workaround Change-Id: I9e3b17deb9bac6af76ac253634c91d5e8ccd4963 Reviewed-on: https://gerrit.libreoffice.org/58816 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2018-08-10oox: create FilterDetect instances with an uno constructorMiklos Vajna
Change-Id: Ic9baba6a4ca37af18c5f5175aadcc59bf47c7b64 Reviewed-on: https://gerrit.libreoffice.org/58798 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
2018-08-10unnecessary null check before dynamic_cast, in variousNoel Grandin
Change-Id: I76ad0b3152030c29ee28f6a6cc80d0832188d02b Reviewed-on: https://gerrit.libreoffice.org/58774 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-08-10tdf#96469 Export Data Point properties in Charts on DOCX/XLSXBalazs Varga
If the color or other property of a datapoint in the chart deviates from the dataseries property, this patch will write it into a separate dPt tag and fixing the lost properies during OOXML export. Change-Id: I3d975675ac3691fcafe76de16e46851561eb2807 Reviewed-on: https://gerrit.libreoffice.org/58752 Tested-by: Jenkins Reviewed-by: Bartosz Kosiorek <gang65@poczta.onet.pl>
2018-08-08tdf#116350 Fix export of fontworkSzymon Kłos
Change-Id: Icf3a07c6b79296feb233bbe08a6d69ab21a41414 Reviewed-on: https://gerrit.libreoffice.org/58746 Tested-by: Jenkins Reviewed-by: Szymon Kłos <szymon.klos@collabora.com>
2018-08-08tdf#116350 Correctly display text on arcSzymon Kłos
Change-Id: Ice8c141db20d43ccc8d6e2b56004a4a28d2b257a Reviewed-on: https://gerrit.libreoffice.org/58729 Tested-by: Jenkins Reviewed-by: Szymon Kłos <szymon.klos@collabora.com>
2018-08-07ofz#9747 Indirect-leakCaolán McNamara
Change-Id: I1063fbe9f41833c70e28343dd8d2392acd579d6d Reviewed-on: https://gerrit.libreoffice.org/58665 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2018-08-06tdf#113822 handle letter-by-letter animations in pptx documents.Mark Hung
Unlike odp that has anim:iterate (IterateContainer) node, both parallel time container and interate container appear as p:par in ooxml so that we have to alter the node type in the end. We also have to set the target of the iterate container to make animation work. Change-Id: Ic50b5f1d85716a67712ed1e812bcb0e7f25fb5a8 Reviewed-on: https://gerrit.libreoffice.org/58576 Tested-by: Jenkins Reviewed-by: Mark Hung <marklh9@gmail.com>
2018-08-05coverity#1438225 Improper use of negative valueCaolán McNamara
and coverity#1438221 Argument cannot be negative coverity#1438213 Argument cannot be negative coverity#1438227 Argument cannot be negative coverity#1438223 Argument cannot be negative coverity#1438222 Argument cannot be negative coverity#1438215 Improper use of negative value coverity#1438220 Improper use of negative value coverity#1438217 Improper use of negative value Change-Id: I398ae9901b27f6b65f03aad03638939b5880a671 Reviewed-on: https://gerrit.libreoffice.org/58626 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2018-08-05coverity#1438224 Dereference null return valueCaolán McNamara
Change-Id: I794c54867b83d738a075f9fa0dbd31fe62de49b9 Reviewed-on: https://gerrit.libreoffice.org/58610 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
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>