summaryrefslogtreecommitdiff
path: root/writerfilter
AgeCommit message (Collapse)AuthorFilesLines
2014-04-06RTFSprms::set: replace two bool arguments with an enumMiklos Vajna3-44/+45
The primary motivation is that the two bools allow 4 combinations, but we only handle 3 of them. Also, caller code is much more readable, now that a non-default overwrite mode is written explicitly. Change-Id: Iedf7dee1ab2d33de849aef6d7a51138d35048e5a
2014-04-05fdo#74823 RTF import: work around wrong table column width on invalid inputMiklos Vajna2-7/+54
This scenario is not a valid one, Word doesn't handle it, either -- but the old LO 3.4 parser did. So add minimal support for it to avoid the regression. Change-Id: Icc2e8d3bf314e9cadda57956668033aa6d092457
2014-04-04fdo#76628 RTF import: allow the same font to have multiple encodingsMiklos Vajna2-15/+14
Commit bbe3627eece0c3486e7ea11f2f13377aaa3a8fed (rtftok: stop sending sprm:CRgFtc{0,1,2} tokens, 2014-03-05) dropped support for case when a font name is used in multiple entries in the font table, but with different encodings. Turns out that this is a valid use-case, so revert back to the old behavior where the key of the encoding table is the font index, not the font name. Change-Id: I048dff58af801d704fd4bc75a6a4dcb0f03bf185
2014-04-03oox: Do not overwrite table style propertiesJacobo Aragunde Pérez1-1/+29
Some table properties can be defined by the table style but cells can overwrite them in their cell properties section. Our exporter was writing all the cell properties in all cases, regardless of them being defined by the theme or not, and we shouldn't do that if we want the document to work properly in Word. To fix the issue I store the style-defined cell properties (the format of all four borders) in the table grab bag. The exporter recovers them and compares with the cell properties before writing them; if the cell property matches the stlye-defined one, we don't write it to the document. An existing unit test was slightly modified to check that the actual cell properties are not being skipped. Change-Id: I3aa12d76fb8f73d3fd300f254d19e1683fb6146c
2014-04-03TyposJulien Nabet1-1/+1
Change-Id: Ia406e2efb1eb2685eeffdf07dcc5fad4fc2b6e94
2014-04-03writerfilter: DEBUG_PROTOCOL is never definedMiklos Vajna5-322/+0
Change-Id: I0f6de2041237282c770bd3926140836008d7d12b
2014-04-03writerfilter: unused WRITERFILTER_OOXML_DLLPUBLICMiklos Vajna3-10/+4
Change-Id: I3f14017d6816d59b951c947827ca9497f2cd97fc
2014-04-03oox: Preserve table style.Jacobo Aragunde Pérez3-0/+13
Table style is a property that defines a set of background and line attributes for cells. These attributes depend on theme settings (e.g. theme colors). We added a grabbag to the table object to save the table style name. We detect that name on export and write it back to the document. Finally, modified an existing unit test to check this attribute too. TODO: To get the table style working properly after a roundtrip, we must preserve it and also check that its values are not being overwritten by different cell or table properties. Change-Id: Id0e022a389561960c21ab874db33649499735024
2014-04-03oox: Preserve cell theme color.Jacobo Aragunde Pérez3-4/+8
When some background color is set to a table cell, it is stored in the cell properties tag <tcPr> like this: <w:shd w:fill="ECD2B6" w:color="auto" w:themeFill="accent6" w:themeFillTint="66" w:val="clear"/> The theme-related attributes in w:shd were not being preserved. To fix this I added an InteropGrabBag to the cell properties object, which is filled with the attributes of w:shd to be checked on export. The exporter checks if the cell color is still the original color that was imported from the file, if it is not it means the user has manually changed it during the edition and the new color is written instead. Finally, added a unit test for theme attributes on tables. Change-Id: Ica8091b5eb4075e51912a255650a1d9d64f5767a
2014-04-02writerfilter: unused Exception classMiklos Vajna1-54/+0
Change-Id: I127ef1183a2c146471668680965fa3d72f6a8f81
2014-04-02writerfilter: unused SubSequence classMiklos Vajna1-247/+0
Change-Id: Ib52309202714e67af78ef5a47f519779d849931c
2014-04-02unused WRITERFILTER_RESOURCEMODEL_DLLPUBLICMiklos Vajna11-29/+23
Change-Id: Ia09cd8738e7bfbb942690efb193c0de30e93f69c
2014-04-02fdo#76586 Table column separators from individual cell widthsVinaya Mandke1-2/+8
In the test file Table Grid had only one value for entire table width while there are two cells in a table row. So the table was not imported with the correct Column Separators. Added fix to calculate column seperators from cell widths if unable to calculate from Table Grid, and all the cells have individual cell widths and there are no after and before cells. Change-Id: I466737437a18d3373e75fea5ad56c9e31eb149ec Reviewed-on: https://gerrit.libreoffice.org/8767 Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk> Tested-by: Miklos Vajna <vmiklos@collabora.co.uk>
2014-04-01Explicitly mark overriding destructors as "virtual"Stephan Bergmann6-10/+10
It appears that the C++ standard allows overriding destructors to be marked "override," but at least some MSVC versions complain about it, so at least make sure such destructors are explicitly marked "virtual." Change-Id: I0e1cafa7584fd16ebdce61f569eae2373a71b0a1
2014-03-31oox, writerfilter: add missing headers for C++ containersDouglas Mencken7-1/+7
Change-Id: Ied05627a0b5fdb8e5fd4a1b071ce32d901f07961 Signed-off-by: Stephan Bergmann <sbergman@redhat.com>
2014-03-30writerfilter: unused sprmcodetostr*Miklos Vajna2-40/+0
Change-Id: Ia35b098033c92fdc7d2313d12b01324ef7232b1f
2014-03-29coverity#736006 Unchecked dynamic_castMiklos Vajna1-1/+2
Change-Id: Id4b0f5e6e4369a850bc159992540e024a4c37c3c
2014-03-29coverity#705083 Unchecked dynamic_castMiklos Vajna1-3/+4
Change-Id: I58e7be8d7b78ba83356e169290c289f246e93057
2014-03-29coverity#705082 Unchecked dynamic_castMiklos Vajna1-3/+4
Change-Id: Ic4665f2cbd2bfc4b65a0f3d9d746e344d4f3bef8
2014-03-29coverity#736005 Unchecked dynamic_castMiklos Vajna1-0/+2
Change-Id: Ieca4f06f3ca4fecb8a0e87e7528f8583a549013c
2014-03-29coverity#1194911 Unchecked dynamic_castMiklos Vajna1-1/+1
Change-Id: I1e7f4bcd8f54219d86ad7a003469d5a486090f47
2014-03-29coverity#705071 Unchecked dynamic_castMiklos Vajna1-1/+2
Change-Id: Ic7b120daf4d5456ed882ffa3724c53d1246e7b4d
2014-03-29coverity#705070 Unchecked dynamic_castMiklos Vajna1-2/+4
Change-Id: Ibb4cf1e8bd002d4c36030f5567e1a16f86ea1668
2014-03-29coverity#736004 Unchecked dynamic_castMiklos Vajna1-0/+2
Change-Id: Icca4946543409adb0ac6f7bf78915f8ef5b0fa40
2014-03-29coverity#736003 Unchecked dynamic_castMiklos Vajna1-1/+3
Change-Id: Ie7451b1c96437df444198152230190d07689c1f1
2014-03-29coverity#705068 Unchecked dynamic_castMiklos Vajna1-1/+1
Change-Id: I3573618670d5975d02ec67e3314d734be05fcbe5
2014-03-29coverity#736001 Unchecked dynamic_castMiklos Vajna1-1/+2
Change-Id: I39622eb9c0d5f91c910b9c828beead2d1763af0e
2014-03-29coverity#1194902 Unchecked dynamic_castMiklos Vajna1-1/+2
Change-Id: I7a7c8d365e9f90096c98120e448a5571ca5e54a5
2014-03-29coverity#1194901 Unchecked dynamic_castMiklos Vajna1-1/+2
Change-Id: I63f91359f4232c5897de77905b3375e9c2f30d2e
2014-03-29writerfilter: remove unused genclass.xslMiklos Vajna1-710/+0
Change-Id: I4a76c13fb01e728613211ae3e4959f75a151ff33
2014-03-27Work around MSC "'override' cannot be used with 'inline'" bugStephan Bergmann1-4/+4
Change-Id: Ibf7094c750c665cf14a104091e8ff148d743bccc
2014-03-27Second batch of adding SAL_OVERRIDE to overriding function declarationsStephan Bergmann51-454/+454
...mostly done with a rewriting Clang plugin, with just some manual tweaking necessary to fix poor macro usage. Change-Id: Ie656f9d653fc716f72ac175925272696d509038f
2014-03-26apparently some table .docx properties shouldn't be < 0Luboš Luňák3-3/+10
Somewhat related to 10b4da63e3143108ba75891e9e98fdaa2f7953ab , a similar doc has negative value inside w:tblCellMar, which MSO seems to ignore (altering the value has no visible effect), so ignore it as well. Change-Id: I846e9b55fea0d4e66f03ce615584516360b8b7dd
2014-03-26Revert "rhbz#1075124: writerfilter: fix tables with negative left margin"Luboš Luňák2-14/+14
It appears that this was just a workaround that incidentally worked. Making the negative value even larger (in abs value) doesn't seem to make a difference for MSO, but LO fails again. A proper fix (better workaround?) will follow. This reverts commit 76aa23c59b4c81ea7b9d974a1a0a9e39c6bf8741.
2014-03-26RTF import: handle Relative{Height,Width}{,Relation}Miklos Vajna1-0/+57
Change-Id: Ic3a578af9c0808b188a4d196b1c132c0b23f15f7
2014-03-25Resolves: rhbz#1077780 crash on loading .docxCaolán McNamara1-0/+2
Change-Id: I92670b9c46a2c745ba47c6dcc1b4dd672942cf59
2014-03-25fdo#76563 DOCX import: speed up importing lots of hyperlinksMiklos Vajna2-4/+44
The problem was that in writerfilter::ooxml::OOXMLStreamImpl::lcl_getTarget(), we went over the list of all hyperlinks for each request. Instead, let's do it once, and in the remaining cases just look up the result from a map. Numbers before on my machine (ms, load time): 2215, 2243, 2205 After: 1362, 1358, 1358 So that causes about 39% speedup for a non-debug build. Change-Id: Ib4718abbe834c5ba49a85469148b656e3c808041
2014-03-23a -> r prefix for referencesMiklos Vajna1-16/+16
Change-Id: I62d54ba948a78dceef1d50fa684e2051111a9709
2014-03-23WaE: -Werror=maybe-uninitializedCaolán McNamara1-1/+1
Change-Id: I3271aaba6d0c6bcbdfc87b1f63a0c311463aad1e
2014-03-23include vectorCaolán McNamara1-0/+2
Change-Id: Ief3e0475f4a5ef85ce8ab92ef7a20d7697a1523d
2014-03-23fdo#76356 : Docx file contianing chart in footer/header gets corrupted.sushil_shinde4-17/+79
- Docx file with chart in footer/header or .bin file referred in chart was getting corrupted. - Embedded file for footer.xml was not grabbaged. - .bin embedded files were not grab baged. - Added grab bag support for both case. - Added UT to check .bin files are grab baged properly. Reviewed on: https://gerrit.libreoffice.org/8674 Change-Id: I221e3867798fc2a3a42f6385d687e80b80a3678f
2014-03-23WaE: passing OUString by value, rather pass by reference [loplugin]Tor Lillqvist2-2/+2
Change-Id: Ib2c0469155874134c0a43c5c8982e40cf3c57208
2014-03-22ooxml: preserve rich text sdt controlsJacobo Aragunde Pérez3-1/+10
These controls don't have a special property, like for example unformatted text controls have. So we use the id property as a marker; we will grab-bag it together with other sdt properties and use the existing mechanism to write the sdt block on export. A grab bag that only contains an id property is for sure a rich text control so we add it to the character props and not to the paragraph props, like in the case of the unformatted text control. Word doesn't allow us to write an empty <w:id/> tag, so we fill it with a random number. Finally, modified an existing unit test to add a rich text control and check it is exported correctly. Change-Id: If403a4a2393d4ee069a628645e364d21f104a859
2014-03-22ooxml: preserve text sdt propertyJacobo Aragunde Pérez2-1/+3
Change-Id: I46b857298ae5d86fe6055efb86d046da48882e8a
2014-03-22ooxml: Make SdtHelper grab bag more genericJacobo Aragunde Pérez3-38/+37
Flexibilize the way the grab bag in SdtHelper works, enabling it to store several children of SdtPr. For every tag inside SdtPr, we enable the DomainMapper grab bag, store the children properties there, and insert the full grab bag inside the SdtHelper grab bag. In this way, the SdtHelper grab bag becomes a Sequence of pairs "SdtPr token name" -> "Bag with children tokens and values". The first advantage of this implementation is that we can preserve dataBinding sdt property plus another one of those supported; until now the second property overwrote the first one in SdtHelper bag. In further patches we will add support for other tags. Some lines are incorrectly indented to make the purpose of this patch more evident, and will be corrected in the next patch. Change-Id: I0ec7be7b96dca455bbbeb03fc2fed230df04c52a
2014-03-21coverity#705975 Dereference before null checkCaolán McNamara1-6/+3
Change-Id: I5499cba6f72c9bcf4b47363da7003fa9bc94dfa6
2014-03-21coverity#705974 Dereference before null checkCaolán McNamara1-9/+3
Change-Id: I6286888f85214a82ad232dd26b7b23e175de39d4
2014-03-21DOCX import: implement progressbarMiklos Vajna5-8/+75
The design follows what we do in case of ODT import already: read the number of paragraphs from the document statistics metadata, and then estimate progress based on the number of already imported paragraphs. Change-Id: I042cc6014c05ca7456fdf1c8d7247b615ba3a244
2014-03-21Remove unnecessary dynamic_castMiklos Vajna6-15/+14
OOXMLDocumentImpl is the only implementation of OOXMLDocument, though code outside the ooxml directory has no access to OOXMLDocumentImpl. However, in that directory passing OOXMLDocumentImpl* as OOXMLDocument*, then using dynamic_cast to get back OOXMLDocumentImpl* is quite pointless. Change-Id: I06dcf85180def1db33b57bd356749f5d92aefa80
2014-03-21coverity#736084 Missing break in switchCaolán McNamara1-0/+2
Change-Id: I3c7a032441402455d0a6ed28fc2cd5ce958ead04