summaryrefslogtreecommitdiff
path: root/sw/source/filter/ww8
AgeCommit message (Collapse)Author
2018-11-04coverity#1440840 Uninitialized pointer fieldCaolán McNamara
Change-Id: I794ec0a173fb20dc0e0d1cf1717a5ad903f9ba7d Reviewed-on: https://gerrit.libreoffice.org/62848 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2018-11-03tdf#120703 PVS: V547 Expression is always true/falseMike Kaganski
Change-Id: I75082c85862b83ed2503900186ce9c70783e54db Reviewed-on: https://gerrit.libreoffice.org/62817 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2018-11-03Simplify containers iterations in sw/source/filterArkadiy Illarionov
Use range-based loop or replace with STL functions. Change-Id: Ifffb7ba08b3a9950ee076558ec4048b0788a38c8 Reviewed-on: https://gerrit.libreoffice.org/62806 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-11-02fix signatures of deleted copy/assign operatorsNoel Grandin
Change-Id: Id1a0749b78a7021be3564487fb974d7084705129 Reviewed-on: https://gerrit.libreoffice.org/62718 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-10-31Translate German commentsJohnny_M
Change-Id: I94cdb753d01dfd0d5b8f78ede1819b281b840ab2 Reviewed-on: https://gerrit.libreoffice.org/62669 Tested-by: Jenkins Reviewed-by: Adolfo Jayme Barrientos <fitojb@ubuntu.com>
2018-10-31sw: turn on clang-format for docxtablestyleexportMiklos Vajna
This had (consistent) manual formatting before, but recently I broke it. Change-Id: Ifd925797c5599aa55852b2e2fb7d16c5812cd159 Reviewed-on: https://gerrit.libreoffice.org/62673 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
2018-10-30tdf#42949 Fix IWYU warnings in include/sax/*Gabor Kelemen
Found with bin/find-unneeded-includes Only removal proposals are dealt with here. Change-Id: I8061ef6a7a8c04baf350844fae1f97836ac03554 Reviewed-on: https://gerrit.libreoffice.org/62399 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
2018-10-30sw: make members of DocxTableStyleExport::Impl privateMiklos Vajna
Change-Id: I1d2a1ac7c651a706e4ef03d04df4222d4e2aaba5 Reviewed-on: https://gerrit.libreoffice.org/62525 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
2018-10-29tdf#108954 docxexport: only emit section if diff from currentJustin Luth
For the very last paragraph, if a header or footer was defined in the section, then a dummy section was always being added, but that should only happen if the section is different from the current one. If they are the same, then the pageDesc will be created anyway, so a dummy isn't needed to prevent it from getting lost. Change-Id: I5e3a53e2810622c7232aa23575740bd775c5a595 Reviewed-on: https://gerrit.libreoffice.org/62430 Tested-by: Jenkins Reviewed-by: Justin Luth <justin_luth@sil.org>
2018-10-28ofz#11125 pass param len aroundCaolán McNamara
Change-Id: I4b382271df21c58de0e102af6e0b07a88a1d9610 Reviewed-on: https://gerrit.libreoffice.org/62443 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2018-10-27use comphelper::SequenceAsHashMap to avoid manual iterationJustin Luth
Thanks for the suggestion Miklos Change-Id: Ie37259a1f05919fa50194afde7171efbe5473771 Reviewed-on: https://gerrit.libreoffice.org/62409 Tested-by: Jenkins Reviewed-by: Justin Luth <justin_luth@sil.org>
2018-10-27tdf#120703 (PVS): V519 The variable is assigned values twice successivelyMike Kaganski
Change-Id: I9265425a215609ef6bf4298ba39c8399f215ce27 Reviewed-on: https://gerrit.libreoffice.org/62406 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2018-10-26tdf#42949 Fix IWYU warnings in include/unotools/*Gabor Kelemen
Found with bin/find-unneeded-includes Only removal proposals are dealt with here. Change-Id: I444c43b9d549977039f25bec2b5bf666c3e15e0e Reviewed-on: https://gerrit.libreoffice.org/62041 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
2018-10-26use unique_ptr when Clone()'ing PoolItemsNoel Grandin
and fix a handful of small leaks in the process Change-Id: I876e12ff5305f9dda84532d4182fb91657d6fa0c Reviewed-on: https://gerrit.libreoffice.org/62389 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-10-24remove more rtl::OUString and OString prefixesNoel Grandin
which seem to have snuck back in since the great rounds of removals. Change-Id: I85f7f5f4801c0b48dae8b50f51f83595b286d6a1 Reviewed-on: https://gerrit.libreoffice.org/62229 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-10-24ww8export roundtrip forms passwordJustin Luth
This was already done for docx in LO6.0 with commit 2694162969cf86ef366d3ce812fccd0630acc800 Patch initially developed to support tdf#120499 and depnds on commit 953dad97c7ef7881c2ac6d73fe5266b44b15f3e2 Change-Id: I04b0693ed1e90f70b079040030c5bd9d2ccfbf13 Reviewed-on: https://gerrit.libreoffice.org/61952 Tested-by: Justin Luth <justin_luth@sil.org> Reviewed-by: Justin Luth <justin_luth@sil.org>
2018-10-24clang-tidy performance-unnecessary-copy-init in swNoel Grandin
Change-Id: I515e3e8ddaee3e3ddc4bf3827fb85f3489e84539 Reviewed-on: https://gerrit.libreoffice.org/62253 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-10-22pvs-studio: V728 An excessive check can be simplifiedCaolán McNamara
for... "The '(A && !B) || (!A && B)' expression is equivalent to the 'bool(A) != bool(B)' expression" subcases, where the args are already bool Change-Id: Ica8b5c4974c513f7f7ad8acf17ca931e85ebc8af Reviewed-on: https://gerrit.libreoffice.org/62146 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2018-10-21pvs-studio: condition always falseCaolán McNamara
Change-Id: I7dcb927028c89f06545fe92c75cb5660767a4817 Reviewed-on: https://gerrit.libreoffice.org/62106 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2018-10-20permissionIdAndName is empty in permission-for-user caseCaolán McNamara
merge the two identical branches and make it do what it probably wants to do Change-Id: I38390a18fcd90349c6bd86f14c67850166b6aeaa Reviewed-on: https://gerrit.libreoffice.org/62001 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2018-10-20sw mso export: PROTECT_FORM shouldn't force section to protectedJustin Luth
PROTECT_FORM maps to enforcement = true, not "everything is protected". "The enforcement of this property is determined by the documentProtection element (§17.15.1.29), as it is possible to specify protection without turning it on." So, sections should retain their protected on/off status regardless of the value of PROTECT_FORM. My guess was that this was to offset the fact that DOCX import did not import protected status, so this helped to protect the sections that should not be unprotected. A followup patch will address the import side. patch initially developed to support tdf#120499. Change-Id: I8ff6d31711651a4827cbb8520fd68e88273d6799 Reviewed-on: https://gerrit.libreoffice.org/61905 Tested-by: Jenkins Reviewed-by: Justin Luth <justin_luth@sil.org>
2018-10-19expression is excessiveCaolán McNamara
Change-Id: Idb6b2af0a3d37ff9ebf13a0413f9656000296b48 Reviewed-on: https://gerrit.libreoffice.org/61996 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2018-10-19NFC ww8 cleanup: remove unused variables, simplify, whitespaceJustin Luth
Change-Id: Ib4f100d4019643cde893ef1d8643a5c08b55ff8f Reviewed-on: https://gerrit.libreoffice.org/61951 Tested-by: Jenkins Reviewed-by: Justin Luth <justin_luth@sil.org>
2018-10-19clang-tidy readability-container-size-emptyNoel Grandin
Change-Id: I1df70b7dff5ebb6048f7fc618789faa15ca5d422 Reviewed-on: https://gerrit.libreoffice.org/61967 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-10-19ww8import: always protect document if setJustin Luth
Just because some sections are unprotected doesn't mean that the document should not open in forms mode. MSWord 2016 opens it in "forms view" mode which also doesn't allow editing those unrestricted settings. Only when choosing the "Edit Document" view are the unprotected sections editable - similar to LO turning off the Compatibility: Protect Forms flag. Unfortunately, the "I want to address this" comment was from 2011, so obviously his temporarly solution became more permanent that expected. If this patch now blocks someone from being able to edit a document (because now only the forms components of the document are editable) they can remove the forms protection by going to tools - options - LibreOffice Writer - compatability - and disable Protect Form. patch developed to support tdf#120499 and depends on the patch for tdf#37778. Change-Id: I86e26095ade6b2cf0ab8ea8fc941a92fa672a2f7 Reviewed-on: https://gerrit.libreoffice.org/61901 Tested-by: Jenkins Reviewed-by: Justin Luth <justin_luth@sil.org>
2018-10-18clang-tidy readability-simplify-boolean-exprNoel Grandin
Change-Id: I78fa01a6c803dec782488490b730af3a11814d64 Reviewed-on: https://gerrit.libreoffice.org/61902 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-10-18tdf#37778 ww8import: protect section only if protEnabledJustin Luth
Protection is not related to fReadOnlyRecommended In Word, documentProtection enforcement is a document level setting which is required for the section protection setting to be enforced. formprot: "The enforcement of this property is determined by the documentProtection element (§17.15.1.29), as it is possible to specify protection without turning it on." In LO, section protection is honored if it is simply enabled, so only enable a section's protection if the enforcement variable is set. Round-tripping will lose the fact that sections are marked as protected if the enforcement is off. patch initially developed to support tdf#120499 where the focus is on sections, not on read-only and the fake section that was being created. Change-Id: I08c37ea6a9cc8fd1bdf7f36771b2d719bf9c93d6 Reviewed-on: https://gerrit.libreoffice.org/61899 Reviewed-by: Justin Luth <justin_luth@sil.org> Tested-by: Justin Luth <justin_luth@sil.org>
2018-10-17Resolves: tdf#120003 missing prefix to link url in .doc importCaolán McNamara
regression from... commit 9b77f8142bf665a47c3a179e3fe3f82623a99f8a Author: Caolán McNamara <caolanm@redhat.com> Date: Thu Apr 6 15:08:45 2017 +0100 ditch ReadRawUniString three argument lclGetString32 variant mistaken for two argument lclGetString32 variant Change-Id: I163aad0de7873487d9f9c8b6c28d162159fe7ad4 Reviewed-on: https://gerrit.libreoffice.org/61884 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2018-10-17sw, writerfilter: avoid some unnecessary value parametersMiklos Vajna
Change-Id: I409eb644bdf519e097c87911b90f83c5ecd913ee Reviewed-on: https://gerrit.libreoffice.org/61853 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
2018-10-17clang-tidy readability-redundant-smartptr-getNoel Grandin
redundant get() call on smart pointer Change-Id: Icb5a03bbc15e79a30d3d135a507d22914d15c2bd Reviewed-on: https://gerrit.libreoffice.org/61837 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-10-16tdf#119885: OOXML import: try to get cell paddings as Word doesMike Kaganski
Change-Id: I7abd715b6bb71d6e2e01939c4cf849d94eb6a103 Reviewed-on: https://gerrit.libreoffice.org/61843 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2018-10-16ofz#10994 move the reset of trailing fly paras to before redline processingCaolán McNamara
Change-Id: I906c29848acc3917f76cb8c21e0bd581e0ded421 Reviewed-on: https://gerrit.libreoffice.org/61819 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2018-10-16tdf#112520 RTF export: write ZOrder only for toplevel shapesMiklos Vajna
RTF export at the moment exports children of group shapes as a flat shape list. This means that the order inside the group shape is not relevant for the toplevel ZOrder, so just don't write it. Change-Id: I870707cb28c2f177c0e5d9cf5328260e76b661f3 Reviewed-on: https://gerrit.libreoffice.org/61805 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
2018-10-15clang-tidy misc-redundant-expressionNoel Grandin
Change-Id: I708b0b486a233071f95592ccdb97f27fc35a23c4 Reviewed-on: https://gerrit.libreoffice.org/61783 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-10-15add SvStream::TellEndNoel Grandin
and simplify callsites to use it instead of the current "seek to end, find pos, seek back to original pos" pattern Change-Id: Ib5828868f73c341891efc759af8bd4695ae2f33c Reviewed-on: https://gerrit.libreoffice.org/61738 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-10-12sw: create DocxExport instances with an uno constructorMiklos Vajna
Change-Id: I34e674e4f3225e724fd9ed6d513fb66c2d5ebdd9 Reviewed-on: https://gerrit.libreoffice.org/61696 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
2018-10-12tdf120224 docx export: don't double up field bookmarksJustin Luth
fields are internal bookmarks. When the exporter runs through the bookmarks, it will already write out a bookmark entry, so don't output a separate one for the fieldmark. Change-Id: I84af2989035507ac745d028f1585d60d8823ff8b Reviewed-on: https://gerrit.libreoffice.org/61616 Tested-by: Jenkins Reviewed-by: Justin Luth <justin_luth@sil.org>
2018-10-11related tdf#120225 ww8export: save PROTECT_FORMJustin Luth
Change-Id: I20664f8c2dc2c49feec17ee6a1df72776d43cc40 Reviewed-on: https://gerrit.libreoffice.org/61635 Tested-by: Jenkins Reviewed-by: Justin Luth <justin_luth@sil.org>
2018-10-09Extend loplugin:redundantinline to catch inline functions w/o external linkageStephan Bergmann
...where "inline" (in its meaning of "this function can be defined in multiple translation units") thus doesn't make much sense. (As discussed in compilerplugins/clang/redundantinline.cxx, exempt such "static inline" functions in include files for now.) All the rewriting has been done automatically by the plugin, except for one instance in sw/source/ui/frmdlg/column.cxx that used to involve an #if), plus some subsequent solenv/clang-format/reformat-formatted-files. Change-Id: Ib8b996b651aeafc03bbdc8890faa05ed50517224 Reviewed-on: https://gerrit.libreoffice.org/61573 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2018-10-08tdf#42949 Fix IWYU warnings in include/comphelper/[m-z]*Gabor Kelemen
Found with bin/find-unneeded-includes Only removal proposals are dealt with here. Change-Id: I04c5ba277d5b3398c07de6ae66713d977636088d Reviewed-on: https://gerrit.libreoffice.org/61347 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
2018-10-05Fix typoAndrea Gelmini
Change-Id: Ic491b7f63726abe25acb61c619c15967e496094d Reviewed-on: https://gerrit.libreoffice.org/61422 Reviewed-by: Julien Nabet <serval2412@yahoo.fr> Tested-by: Julien Nabet <serval2412@yahoo.fr>
2018-10-05sw: create RtfExport instances with an uno constructorMiklos Vajna
Change-Id: I08cbfa2b9ccc7bc1c5d1ebeb9e06238472b2fa26 Reviewed-on: https://gerrit.libreoffice.org/61393 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
2018-10-05use more std::move in sw/Noel Grandin
Change-Id: Id2f063550db3a3110e4bae8e18d0e7b9a7bf5df3 Reviewed-on: https://gerrit.libreoffice.org/61368 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-10-03no need to call empty() before clear()Noel Grandin
found with git grep -A2 -nP '!.*\.empty()' | grep -B1 -w clear Change-Id: I87013eab9c6988048b891d20577e1f7efbce1b6c Reviewed-on: https://gerrit.libreoffice.org/61295 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-10-03loplugin:constfields in swNoel Grandin
Change-Id: I1eb6583bb9ec815bc0564b0d7c676f5b1fb9045f Reviewed-on: https://gerrit.libreoffice.org/61177 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-10-02Silence new Clang trunk -Wdefaulted-function-deletedStephan Bergmann
This mostly affects explicitly defaulted functions that had recently been user- declared to silence new GCC trunk -Wdeprecated-copy. It is not entirely clear to me what the best approach is overall, see my mail <http://lists.llvm.org/pipermail/cfe-commits/Week-of-Mon-20181001/245321.html> "Re: r343285 - [cxx2a] P0641R2: (Some) type mismatches on defaulted functions only", but lets just explicitly delete those functions for now. Change-Id: If8c72f612f67a8feb8b03c2fb988c807e704ef03 Reviewed-on: https://gerrit.libreoffice.org/61259 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2018-10-02coverity#1439597 it's not possible for SwPaM::End to return nullMichael Stahl
Change-Id: I1289721e2e62e258237096d79182779ca3f15bdb Reviewed-on: https://gerrit.libreoffice.org/61205 Tested-by: Jenkins Reviewed-by: Michael Stahl <Michael.Stahl@cib.de>
2018-09-29tdf#92026 docxexport: eliminate fake tblBordersJustin Luth
This patch depends on tdf#119760. The border was based on whatever cell A1 had, but that fake default was never passed to the cell's functions, so the table border definition served no purpose whatsoever. Cells had no idea whether they needed to override those default borders, and this was bad for non-borders, because then the default borders were assigned instead of none. The other option would be to properly fill m_aTableStyleConf, but that didn't seem valuable. Better, and less code churn, to just eliminate the function altogether. (Well, the empty function kept in place as a placeholder for someone who decides it could be useful to reduce the number of borders written out per cell.) Unit test fdo80097.docx's fix was just trying to prevent an invalid table border. Since that is still obviously true when no table border is defined, it is valid to just eliminate this part of the test. (Having a table definition wouldn't be invalid in the future, so I'm not testing for zero instances.) Change-Id: I983dbe120bfc3354fefd14bc95ac01abccea7ea8 Reviewed-on: https://gerrit.libreoffice.org/60989 Tested-by: Jenkins Reviewed-by: Justin Luth <justin_luth@sil.org>
2018-09-28Fix DI_TITEL -> DI_TITLEAndrea Gelmini
It passed "make check" on Linux. Change-Id: I3239622286c07914f88727ffdbb0be8d2ca724ea Reviewed-on: https://gerrit.libreoffice.org/61084 Tested-by: Jenkins Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2018-09-27tdf#119037 rtf (im/ex)port: new borderlinesJustin Luth
"new" borderlines (from 2012, 2014) defined in offapi/com/sun/star/table/BorderLineStyle.idl where no supported in export yet!!! Sad. const short FINE_DASHED = 14; (rtf) const short DOUBLE_THIN = 15; (rtf/doc/docx) const short DASH_DOT = 16; (rtf/docx) const short DASH_DOT_DOT = 17; (rtf/docx) Change-Id: I07fee08e17171db4baec489864fc47da107cee75 Reviewed-on: https://gerrit.libreoffice.org/60992 Tested-by: Jenkins Reviewed-by: Justin Luth <justin_luth@sil.org>