summaryrefslogtreecommitdiff
path: root/writerfilter
AgeCommit message (Collapse)AuthorFilesLines
2016-05-26loplugin:unusedmethodsNoel Grandin3-8/+0
Change-Id: Ib36bc0e87d00abb638cbfec511cd13b6179eabda Reviewed-on: https://gerrit.libreoffice.org/25431 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
2016-05-26We indeed can't do anything with LN_CT_Font_notTrueType hereJulien Nabet1-0/+2
Avoid this warn:writerfilter:18041:1:writerfilter/source/dmapper/FontTable.cxx:144: FontTable::lcl_sprm: unhandled token: 93155 when testing https://bugs.documentfoundation.org/attachment.cgi?id=125266 Change-Id: I7bc7cea8398b4430a2e67130f5869057ec0cd256 Reviewed-on: https://gerrit.libreoffice.org/25469 Reviewed-by: Julien Nabet <serval2412@yahoo.fr> Tested-by: Julien Nabet <serval2412@yahoo.fr>
2016-05-25tdf#74795 RTF import: handle row-level default cell marginsMiklos Vajna2-0/+63
Change-Id: I5bdd7b8624a9e2ac1aef963ccc5ed457ebda3f84 Reviewed-on: https://gerrit.libreoffice.org/25443 Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk> Tested-by: Jenkins <ci@libreoffice.org>
2016-05-23writerfilter: use auto where it improves code readabilityMiklos Vajna7-194/+187
for (std::vector< std::pair<Id, RTFValue::Pointer_t> >::const_iterator i = m_pSprms->begin(); i != m_pSprms->end(); ++i) vs for (auto& rSprm : *m_pSprms) and so on. Change-Id: I2b4d975af096fb59815b074cbcb9934bead9e6f0 Reviewed-on: https://gerrit.libreoffice.org/25350 Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk> Tested-by: Jenkins <ci@libreoffice.org>
2016-05-20writerfilter: use '= default;'Miklos Vajna15-49/+14
Replace default bodies of these trivial special member functions. Also remove RTFSprms::operator=() as it matches what the compiler would generate anyway. Change-Id: Ib5e30dfdd9b428a6d7800cec056c3f55ca92f4a4 Reviewed-on: https://gerrit.libreoffice.org/25187 Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk> Tested-by: Jenkins <ci@libreoffice.org>
2016-05-19loplugin:unusedmethods in writerfilter to xmloffNoel Grandin5-9/+1
Change-Id: If95890eff0f785111e8b511ac1d5481c6910f099 Reviewed-on: https://gerrit.libreoffice.org/25148 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
2016-05-18tdf#82073 RTF import: handle \clcbpatrawMiklos Vajna1-0/+1
Quoting the RTF spec: "Same as \clcbpatN for use with table styles." Change-Id: Icdb89bac5b41036dadb1901f18aeb21ef2512908 Reviewed-on: https://gerrit.libreoffice.org/25077 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
2016-05-18clang-tidy modernize-make-sharedNoel Grandin3-5/+4
Change-Id: I3fa866bfb3093fc876474a9d9db29fe05dc2af3a Reviewed-on: https://gerrit.libreoffice.org/25056 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
2016-05-17sw, writerfilter: indentation fixesMiklos Vajna3-4/+4
These files had a consistent style perviously, don't break that. Change-Id: I8d204e78463e7fe302a172a1af6ad3de51997977
2016-05-14crashtesting: Error: attempt to increment a singular iteratorCaolán McNamara1-1/+3
revert commit 96fab0513215cc416e96e1b2089466afd0d2791c Author: Noel Grandin <noel@peralex.com> Date: Thu May 12 10:07:50 2016 +0200 clang-tidy modernize-loop-convert in writerfilter to xmlsecurity for OOXMLPropertySet::resolve which modifies the mProperties it iterates over e.g. fdo67086-1.docx, fdo72640-6.docx etc Change-Id: I14f829d1425d56110c0aa8d42e751bd2f1d3dd2a
2016-05-13clang-tidy modernize-loop-convert in writerfilter to xmlsecurityNoel Grandin13-72/+65
Change-Id: I334411c6b57c028ffb41b5deb72002f9d54038c3 Reviewed-on: https://gerrit.libreoffice.org/24923 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
2016-05-10tdf#42949: clean up includes in include/oox/helper with iwyuJorenz Paragas1-0/+1
...and fix the many compiler errors that occurred as a result. Change-Id: I497c326272b2f02737ca3765720d6815b735423b Reviewed-on: https://gerrit.libreoffice.org/24735 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Michael Stahl <mstahl@redhat.com>
2016-05-10Fix typosAndrea Gelmini1-1/+1
Change-Id: I1c1894fcf533291b34a662b6efb96dcfa75b92b3 Reviewed-on: https://gerrit.libreoffice.org/24760 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Michael Stahl <mstahl@redhat.com>
2016-05-10Replace fallthrough comments with new SAL_FALLTHROUGH macroStephan Bergmann6-13/+20
...which (in LIBO_INTERNAL_ONLY) for Clang expands to [[clang::fallthrough]] in preparation of enabling -Wimplicit-fallthrough. (This is only relevant for C++11, as neither C nor old C++ has a way to annotate intended fallthroughs.) Could use BOOST_FALLTHROUGH instead of introducing our own SAL_FALLTHROUGH, but that would require adding back in dependencies on boost_headers to many libraries where we carefully removed any remaining Boost dependencies only recently. (At least make SAL_FALLTHROUGH strictly LIBO_INTERNAL_ONLY, so its future evolution will not have any impact on the stable URE interface.) C++17 will have a proper [[fallthroug]], eventually removing the need for a macro altogether. Change-Id: I342a7610a107db7d7a344ea9cbddfd9714d7e9ca
2016-05-10tdf#96275 RTF import: fix anchor of shapes inside tablesMiklos Vajna2-2/+13
Table text is buffered, so buffer the shape import as well, otherwise the anchor will precede the buffered text -> incorrect anchor position. Change-Id: I527b898e2cd5fafaf122a20e11df66ba8d3185cf Reviewed-on: https://gerrit.libreoffice.org/24822 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
2016-05-10rtf: m_aStates can be empty in the inner conditionCaolán McNamara1-3/+7
Change-Id: Id262a3019a693f236630b798579f360c9462d12e
2016-05-09writerfilter: extract dispatch{destination,flag,symbol,value} from rtfdocimplMiklos Vajna9-3362/+3512
These were half of the lines of rtfdocumentimpl. Change-Id: I3f24cd5d23c91bf0d53b898266c187699ae6ee56 Reviewed-on: https://gerrit.libreoffice.org/24790 Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk> Tested-by: Jenkins <ci@libreoffice.org>
2016-05-06writerfilter: replace 's_m_' prefixes with just 's_'Miklos Vajna2-30/+30
The intention was to replace m_ with s_ for static members, not to prepend s_ to the existing prefix. Change-Id: If8538061de8b1d22a89c8987201f4cae4ed484df Reviewed-on: https://gerrit.libreoffice.org/24700 Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk> Tested-by: Jenkins <ci@libreoffice.org>
2016-05-06teach passstuffbyref plugin to check for..Noel Grandin5-39/+39
unnecessarily passing primitives by const ref. Suggested by Tor Lillqvist Change-Id: I445e220542969ca3e252581e5953fb01cb2b2be6 Reviewed-on: https://gerrit.libreoffice.org/24672 Reviewed-by: Tor Lillqvist <tml@collabora.com> Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
2016-05-04use Any constructor instead of temporariesNoel Grandin2-20/+8
Change-Id: Iffb82a2cee1a28d89eeea2b905aaa14086ee475a
2016-05-03tdf#95707 RTF import: handle device-independent bitmapsMiklos Vajna3-3/+25
See <https://msdn.microsoft.com/en-us/library/dd183374%28v=vs.85%29.aspx> for more info about the header structure that has to be prepended to the real data to make our BMP import filter happy. Change-Id: Iabdf4cd169b82ea951d1c1b12432d97d61b7af51 Reviewed-on: https://gerrit.libreoffice.org/24604 Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk> Tested-by: Jenkins <ci@libreoffice.org>
2016-04-29tdf#99434: import/export documentProtection-forms from .docx incl. testOliver Specht3-1/+13
the setting <w:documentProtection w:edit="forms"> disables editing of content outside of form controls. Change-Id: I0d11373d9010778ed5798598020e453cde06fa0f Reviewed-on: https://gerrit.libreoffice.org/24365 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Oliver Specht <oliver.specht@cib.de>
2016-04-28Related: tdf#65642 RTF filter: import \pgndecMiklos Vajna2-1/+10
This as a side effect also implements support for DOCX <w:pgNumType w:fmt="decimal" .../>. Change-Id: I747c3f610dc13f614b6f962c2a498c987765ebb6 Reviewed-on: https://gerrit.libreoffice.org/24457 Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk> Tested-by: Jenkins <ci@libreoffice.org>
2016-04-27Resolves: tdf#99498 don't overwrite trwWidth value if set on a tableCaolán McNamara1-4/+14
Change-Id: Ia39da999a2de1ca2b8bec5fc7f35d2f9ffe2dd19 Reviewed-on: https://gerrit.libreoffice.org/24430 Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2016-04-26update loplugin stylepolice to check local pointers varsNoel Grandin2-13/+13
are actually pointer vars. Also convert from regex to normal code, so we can enable this plugin all the time. Change-Id: Ie36a25ecba61c18f99c77c77646d6459a443cbd1 Reviewed-on: https://gerrit.libreoffice.org/24391 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
2016-04-26tdf#90097 RTF import: handle fRelFlipV property for line shapesMiklos Vajna2-0/+32
Can be extended later in every direction: fFlipV, fRelFlipH, non-line shapes. See oox::drawingml::Shape::createAndInsert() on why the convertMm100ToTwip() conversion is necessary. Change-Id: Ifee401dd8dd392c2c9ff85cc871ca0169fcf930b Reviewed-on: https://gerrit.libreoffice.org/24385 Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk> Tested-by: Jenkins <ci@libreoffice.org>
2016-04-25Some more sal_Bool -> boolStephan Bergmann1-1/+1
Change-Id: I576f264f31fabf58de6cafa28eb7ba5e5f43c148
2016-04-22Avoid reserved identifiersStephan Bergmann8-28/+28
Change-Id: Ie1830e7645b8bb8b8020fdb384471801a1aaca31
2016-04-21Related: tdf#65642 RTF filter: import \pgnlcrmMiklos Vajna2-1/+10
This as a side effect also implements support for DOCX <w:pgNumType w:fmt="lowerRoman" .../>. Change-Id: Ifb524b25236a8bc774690266a4fa205154204109 Reviewed-on: https://gerrit.libreoffice.org/24273 Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk> Tested-by: Jenkins <ci@libreoffice.org>
2016-04-20loplugin:salbool: Automatic rewrite of sal_False/TrueStephan Bergmann9-59/+59
Change-Id: I5f38167cc2fd0104ad388c63f766bda6acae96e2
2016-04-18clang-tidy performance-unnecessary-copy-initializationNoel Grandin1-1/+1
probably not much performance benefit, but it sure is good at identifying leftover intermediate variables from previous refactorings. Change-Id: I3ce16fe496ac2733c1cb0a35f74c0fc9193cc657 Reviewed-on: https://gerrit.libreoffice.org/24026 Reviewed-by: Noel Grandin <noelgrandin@gmail.com> Tested-by: Noel Grandin <noelgrandin@gmail.com>
2016-04-14Related: tdf#65642 RTF filter: import \pgnucrmMiklos Vajna2-1/+10
This as a side effect also implements support for DOCX <w:pgNumType w:fmt="upperRoman" .../>. Change-Id: Ibf3bedca03c6c2a2b96eecb36ff6c4cf6e2281b4 Reviewed-on: https://gerrit.libreoffice.org/24073 Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk> Tested-by: Jenkins <ci@libreoffice.org>
2016-04-14loplugin:passstuffbyref in writerfilterNoel Grandin16-47/+47
Change-Id: Ia85f5a7a9846802de7a1495e70d16c9e3418dc3e
2016-04-12clang-tidy performance-unnecessary-value-param in writerfilterNoel Grandin39-166/+165
Change-Id: I1f61be80ac1ebe42668580b09a261e7e3af1a403
2016-04-12cleanup: remove unused com/sun/star/uno includesJochen Nitschke1-1/+0
Sequence.h(xx), Any.h(xx) and Type.h(xx) and remove unused using-declarations from these files. Add a few missing includes provided by them. Change-Id: I6b91b6d1fdf9d0496dd546c0aab9bdcc6831a5d4 Reviewed-on: https://gerrit.libreoffice.org/23805 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
2016-04-08tdf#99140 DOCX import: fix table horizontal aligment to be 'from left' ...Miklos Vajna1-6/+7
... when it was 'manual'. Regression from commit c1e563f6efd09cd3463f1b92a3022ae288c92087 (fdo#76741 [DOCX] Table Alignment and width type, 2014-04-04), DOCX import code had to deal with two kinds of horizontal alignment when it came to floating tables: the alignment of the table itself, and the alignment of the float parameters. The problem is, in general it's wanted that the table is aligned according to the floating parameters, but in Writer the "from left" UI setting is described differently for tables and fly frames: tables use LEFT_AND_WIDTH for that, while fly frames use NONE. Fix the problem by touching the default only in case the floating parameters have something that's different from NONE. With this, the width of tables is no longer lost when they are described to be floating ones in the DOCX markup, but FloatingTableConversion() decides to ignore that. Change-Id: Idd41c3e03e6ded8552e9d15b6080e4b45eb18d3d Reviewed-on: https://gerrit.libreoffice.org/23923 Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk> Tested-by: Jenkins <ci@libreoffice.org>
2016-04-08tdf#99140 DOCX import: fix table at the bottom of the page to span over ...Miklos Vajna1-1/+24
... multiple pages. In short, one more blacklist entry when conversion should not be performed. Change-Id: I764f02cc58ae1b7af802b81e570e4feaf73ee2c1 Reviewed-on: https://gerrit.libreoffice.org/23912 Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk> Tested-by: Jenkins <ci@libreoffice.org>
2016-04-07tdf#99140 Factor out FloatingTableConversion() from CloseSectionGroup()Miklos Vajna2-19/+39
No logic changes intended, but makes it easier to add new rules when making the decision. Change-Id: I84d8e6a2b8a4b9ae6fe5cefd381292c2f68be45f Reviewed-on: https://gerrit.libreoffice.org/23901 Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk> Tested-by: Jenkins <ci@libreoffice.org>
2016-04-05sequence->vector in writerfilterNoel Grandin2-5/+6
Change-Id: Ibc86ecc2b5dbeefd4d0411491a73f388ce303b4b Reviewed-on: https://gerrit.libreoffice.org/23763 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
2016-04-04tdf#99074 DOCX import: handle <w:view w:val="web"/>Miklos Vajna1-0/+4
Instead of always using the Normal view, use the Web view when the DOCX file contains Web Layout. For this to work, expose sw's DocumentSettingId::BROWSE_MODE via css.document.Settings. Change-Id: I7787ca058d8cb8a346b2001a2bd70c3df86d8673 Reviewed-on: https://gerrit.libreoffice.org/23806 Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk> Tested-by: Jenkins <ci@libreoffice.org>
2016-04-04Use std::size_tMiklos Vajna5-12/+12
And include <cstddef> where necessary. Change-Id: Icc1208528d6a8b04375d55ccbf3cd6ef046b454f Reviewed-on: https://gerrit.libreoffice.org/23796 Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk> Tested-by: Jenkins <ci@libreoffice.org>
2016-03-31tdf#98987 sw: add AddVerticalFrameOffsets compat modeMiklos Vajna1-0/+1
The situation is the following: we have a text frame, with at least two anchored objects: one is wrapped not-wrap-through, the other is. In case the non-wrap-though one shifts the text content of the text frame right or down, then layout may or may not want to re-consider what is the top left corner of the text frame for anchoring purposes. Regarding the x position, sw layout repositioned the anchor point depending on the AddFrameOffsets compat mode: it's enabled for documents imported from Word, disabled otherwise. Regarding the y position, no repositioning was done, however the bugdoc shows that Word does the same repositioning on the vertical axis as well. Add a new AddVerticalFrameOffsets compat mode that enables vertical repositioning as well, and enable that mode for documents imported from DOCX. Change-Id: Idc5cad7d86662008a92ff3bf5fbb3806aa2c7b07 Reviewed-on: https://gerrit.libreoffice.org/23702 Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk> Tested-by: Jenkins <ci@libreoffice.org>
2016-03-31use SAL_N_ELEMENTS in for loopsNoel Grandin2-6/+5
for with git grep -n 'for.*sizeof' Change-Id: I6211024385e03ac5eeeb38690d2c1c699e015c2f Reviewed-on: https://gerrit.libreoffice.org/23569 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
2016-03-31tdf#98806 RTF import: handle bookmarks in table textMiklos Vajna1-4/+10
Mapper().props() was called directly, so all bookmarks pointed to the start of the A1 cell instead of the correct text range. Change-Id: I40eeb85b61d2ae9138cd666d4a6a3c08eda47da3
2016-03-30Related: tdf#65642 RTF filter: import \pgnlcltrMiklos Vajna2-1/+10
This as a side effect also implements support for DOCX <w:pgNumType w:fmt="lowerLetter" .../>. Change-Id: I47b60a0390ef081dc15b26e40393e35bf7bad130
2016-03-29loplugin:staticmethodsStephan Bergmann1-3/+3
Change-Id: I090c01ef2fc52b8bec74ec78e23f1104877c734f
2016-03-29tdf#98882 DOCX import: set default para properties on the Standard para styleMiklos Vajna1-27/+45
That's what the DOC import does, and that's the reason e.g. the strange unwanted crop of the as-char anchored picture doesn't happen there. This also needs the "reset all existing style properties back to default" logic to be adapted: the Standard style has to be reset before the default are set, and later it should be left alone, otherwise the defaults are lost. Change-Id: Ie422a0b64b80a826fa4f469145a26283fb32d734 Reviewed-on: https://gerrit.libreoffice.org/23593 Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk> Tested-by: Jenkins <ci@libreoffice.org>
2016-03-22tdf#65642 RTF filter: import \pgnrestart and \pgnucltrMiklos Vajna4-1/+28
This implicitly adds support for DOCX import of <w:pgNumType w:fmt="upperLetter"> as well. Change-Id: Ib19ecb8f7ca0c867ae3be2b41e49ac4cacfd5bb6
2016-03-14remove some unused typedefs, and inline some use-onceNoel Grandin3-4/+1
Change-Id: I5ada1cff98c0a3e065d126444f8052f444323743 Reviewed-on: https://gerrit.libreoffice.org/23234 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
2016-03-11writerfilter: avoid ugly cross-directory includeMiklos Vajna6-30/+30
Change-Id: I16db4e16e5c2fa3aa3bfb22f83d2c36695499b5c