summaryrefslogtreecommitdiffstats
path: root/writerfilter
Commit message (Collapse)AuthorAgeFilesLines
* writerfilter: OOXML theme saved in InteropGrabBagAndres Gomez2013-09-204-1/+94
| | | | | | | | | | | | | | | | | | | | | | | | | | The XDocuments representing the DOM of an OOXML's theme document is now stored as the PropertyValue "OOXTheme" into the "InteropGraBag" property of the SwXTextDocument. Added the importSubStream() method to the writerfilter::ooxml::OOXMLDocumentImpl class in order to create the XDocument for the theme XML fragment stream and invoked it during the resolve() method. Modified the writerfilter::ooxml::OOXMLDocument abstract class to be able to hold the OOXML's theme XDocument. Added the set/getTheme() methods to store and obtain the XDocument directly. Modified the WriterFilter::filter() method to store the OOXML's theme XDocument in the "InteropGrabBag" property of the TextDocument service SwXTextDocument implementation. Updated the UTs accordingly. Change-Id: I3960590fcf4856caf770908b983ffb6898f061c0 Reviewed-on: https://gerrit.libreoffice.org/6002 Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk> Tested-by: Miklos Vajna <vmiklos@collabora.co.uk>
* fdo#40594 Fix for chart missing issue in Writer (for docx)Vinaya Mandke2013-09-205-1/+61
| | | | | | | | | | | | 1. Enabled parsing of chart in writer module. 2. While parsing chart is read as ole2shape. Then converted into TextEmbedded object for chart. 3. While exporting postponed chart writing after rpr tag. 4. Generated unique id for each chart. 5. Corrected content type of chart in export. Change-Id: I6a1ca0c34e03e17cc3dd8a183580132ea7af5c48 Reviewed-on: https://gerrit.libreoffice.org/5976 Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
* DOCX styles: Another fix in <w:next> style handling.Jan Holesovsky2013-09-191-1/+1
| | | | | | Compare styleId against styleId, not style name against styleId. Change-Id: I42bbb8a04424780772065585cc8ff56d906a48e4
* Improve readability.Jan Holesovsky2013-09-191-6/+5
| | | | Change-Id: Iacb9b09f237ddab3d68f4993014efb3b4793b8e7
* DOCX styles: Fix the reading of <w:next> style.Jan Holesovsky2013-09-191-2/+2
| | | | | | Wow, has been broken like this since 2007... Change-Id: I32a84e1444ed6fd89161f2060a35296044516863
* Make the comments readable in the code.Jan Holesovsky2013-09-181-9/+15
| | | | | | [And kill one unhelpful one - comments a removal of something.] Change-Id: Ia4229fe889aa0aae115e6ab9b6808e0f054bb199
* DOCX import: fix default section break type inside multiple columnsMiklos Vajna2013-09-111-1/+3
| | | | Change-Id: I7c44a2bdb69563953d3257b435aeed5bae50f7b2
* writerfilter: remove old unit testsJelle van der Waa2013-09-108-1267/+0
| | | | | | | Change-Id: Icaa0560b812b96e41c52d7a43267873fe364ceb7 Reviewed-on: https://gerrit.libreoffice.org/5904 Reviewed-by: Andrzej J.R. Hunt <andrzej@ahunt.org> Tested-by: Andrzej J.R. Hunt <andrzej@ahunt.org>
* remove old unit testsJelle van der Waa2013-09-102-7552/+0
| | | | | | | Change-Id: I83619c47d435b9ee7bd0de3121832f84046a6d18 Reviewed-on: https://gerrit.libreoffice.org/5903 Reviewed-by: Markus Mohrhard <markus.mohrhard@googlemail.com> Tested-by: Markus Mohrhard <markus.mohrhard@googlemail.com>
* Mark as const / staticTakeshi Abe2013-09-101-1/+1
| | | | Change-Id: I9bcf02b270200fd146d2bfee6f15ff1f9ad8888b
* fdo#68291 RTF paste: don't set PageDescName during pasteMiklos Vajna2013-09-091-1/+1
| | | | | | | In general, paste should not deal with page styles. In this case, it even caused an additional page break. Change-Id: Ia7c5a9ad844821b6622babfbd94469ec3c04cf0a
* CharBrd 9.3: RTF filtersZolnai Tamás2013-09-082-1/+19
| | | | | | | | | | -Use sprm:CBrc attribute for all MS filter (for ooxml too). -Extract general code to FormatCharBorder() method, it selects the border side and decides whether add shadow to the border. -RTF export has a color table, which must be filled with border colors before the actual export.temp Change-Id: Ic3ceae6e19ddc2ed5aaa8de85617f9a592289b4f
* CharBrd 9.2: DOCX filtersZolnai Tamás2013-09-083-1/+44
| | | | | | | | | | | | - Modify HasTextItem() method to able to get character attributes during export. (in this case RES_CHARTR_SHADOW) - Only one side of the border can be exported. Selecting order: (top, left, bottom, right) - During import set all four side and use the Word default shadow type (back, bottom-right, border width wide) Change-Id: I3e1e27a2ef2d77b397f2ca8efe578e09271bcf8c
* update pchThomas Arnhold2013-09-051-0/+7
| | | | Change-Id: I6d5e8d3fd69189935a3338fee19b60022f70a7eb
* fdo#68787 DOCX import: handle when w:separator is missing for footnotesMiklos Vajna2013-09-049-4/+47
| | | | | | | | | | | | | | | | | There were two problems here: 1) OOXML has no way to explicitly disable the footnote separator, what is does is that it omits the <w:separator/> element in that case. We didn't parse that previously -- now we do, and if it's missing, the separator is disabled. 2) The footnote stream isn't read by the importer, only when the main stream references the footnote one, the relevant part of it is parsed. At the moment we always parse the first (special, "separator") entry in the footnote stream, that may be optimized later if it becomes a bottleneck. Change-Id: Ie588270a212fc90fc41095029a362cfd832b24f8
* fdo#68607 bnc#816593 DomainMapperTableHandler: don't always start a frameMiklos Vajna2013-09-033-1/+22
| | | | | | | | | | This is a port of commit 8fe8bd6c3b5b1a539b7370f8c457fa69c061d2de "Related: fdo#61594 SwWW8ImplReader::StartApo: don't always start a frame" from the WW8 filter to the DOCX one. (regression from edc4861a68e0269b83b17e0ec57912a1ce4220ad) Change-Id: If1bb4a8a3786aacd618585cf859b57ce9be85c51
* bnc#816593 DOCX import: ignore page breaks in tablesMiklos Vajna2013-09-025-1/+33
| | | | Change-Id: Ibb250148d41d1929fa17dd993bb71c93c0e09dcf
* writerfilter: mark these as staticMiklos Vajna2013-08-311-2/+2
| | | | Change-Id: I240b95e09d3555c0fdcdf6c4b9eb458ad82460e4
* fdo#41068: writerfilter: fix image wrap polygon importMichael Stahl2013-08-302-3/+5
| | | | | | | | | | Mainly the problem seems to be that Stein's GCD algorithm requires non-negative input parameters, and the document has this: <wp:lineTo x="-480" y="6104"/> (regression from 86898639d4144a078ed295d0a8bef406868802cb) Change-Id: I8da1272c3caae84f43472aa4acb65ed66dfbd8ae
* bnc#816593 DOCX filter: import paragraph spacing from table styleMiklos Vajna2013-08-291-0/+38
| | | | Change-Id: I9dce59ecd8a2d2bfadb8c7273cd46c6c0cf17774
* bnc#816593 DOCX import: fix auto table width wrt nested tablesMiklos Vajna2013-08-281-0/+9
| | | | | | | | | | | | | | The bugdoc has a table with a single cell, and also a nested table in that cell. Both tables have auto width. The problem was that the width of the outer table was too large. There is a trick in DomainMapperTableManager::startLevel() to get the cell widths at the correct level: do the same in DomainMapperTableManager::endLevel(), and that'll fix the table width problem. (Because with that, the outer table will correctly have access to its cell width.) Change-Id: Ib750f0475364fd7e47c445cb54f2df34f3af085d
* bnc#816593 DOCX import: let w:before not overwrite w:beforeAutospacingMiklos Vajna2013-08-281-2/+4
| | | | | | | | | And do the same for w:after / w:afterAutospacing. The spec says that if w:beforeAutospacing is read, w:before should be ignored, this implies that if we already had w:beforeAutospacing, w:before should not overwrite the already existing top margin. Change-Id: I9437cb5c6fc352a360e27aa279d0a789706c5578
* bnc#816593 DOCX import: fix auto para spacing without compat optionMiklos Vajna2013-08-281-4/+3
| | | | | | | Paragraph auto spacing (before and after) without the w:doNotUseHTMLParagraphAutoSpacing compat option was incorrect. Change-Id: I56d6153f7c489de7fceaf6fab7325c42ee8f9cae
* WaE: OUString::valueOf in higher debug levelsCaolán McNamara2013-08-261-1/+1
| | | | Change-Id: I2aed7907c79905158714dc1b26ae1aefc1fcccc6
* Introduce msfilter::util::findQuotedText()Miklos Vajna2013-08-261-24/+4
| | | | | | | This was in writerfilter, but we'll need it soon in sw as well, so move it down to msfilter. Change-Id: I8efe02b6bbe8f391d9e14857ed58dbae184d5632
* DOCX import of picture shadow transparencyMiklos Vajna2013-08-231-1/+3
| | | | Change-Id: I15e09017eccc3f0e5ed8cab9c3de3677c8a580fa
* fdo#44689: fix for DOCX import+export of page number start valuePiao Jing Nan2013-08-221-0/+13
| | | | | | | | Change-Id: If4940b17bcee0d06fa8dc9bf9faa708cf6d0db1c Signed-off-by: Adam Co <rattles2013@gmail.com> Reviewed-on: https://gerrit.libreoffice.org/5528 Reviewed-by: Miklos Vajna <vmiklos@suse.cz> Tested-by: Miklos Vajna <vmiklos@suse.cz>
* fdo#68076 RTF import: default font had priority over the specified oneMiklos Vajna2013-08-221-2/+3
| | | | | | Regression from 60c17b2873506ed8b068b34840aecda0c1d9bd65. Change-Id: Ie16d611622e6a814d5cbea00c3f992cd9ecba027
* DOCX import: fix handling of textframes having shape text ending with a tableMiklos Vajna2013-08-212-0/+14
| | | | Change-Id: I82ef1072bfeb1195152ef7f1ea743653ac102b37
* finish deprecation of O(U)String::valueOf()Luboš Luňák2013-08-2110-26/+26
| | | | | | | Compiler plugin to replace with matching number(), boolean() or OUString ctor, ran it, few manual tweaks, mark as really deprecated. Change-Id: I4a79bdbcf4c460d21e73b635d2bd3725c22876b2
* fdo#44715 RTF import: reset styles in tables on RTF_PARDMiklos Vajna2013-08-171-9/+5
| | | | | | | | | | | | | | | | | | Commit 4a507f732d82c188ad81b022cbe3037951e58ac3 added an exception to RTF_PARD (reset paragraph properties) handling: when we're inside a table, it should not reset the fact that we're inside a table (which is a paragraph property). However, instead of just re-adding that property, it disabled resetting for all properties, and we had a growing list of exceptions since then. The next thing to add there would be the paragraph attributes, which contains the style information. Instead of growing that ad-hoc list, reset everything again and just re-add the "in table" SPRM. This makes the second and later paragraphs in the A1 cell of the bugdoc have proper font size. Change-Id: I2de80894fcd5da3bf45d221af9a04a307c70a29b
* fdo#68084: OOXML import: handle exceptions if stream is missingMichael Stahl2013-08-161-2/+11
| | | | | | | The bugdoc does not have a styles.xml but a stylesWithEffects.xml, whatever that may mean. (the app.xml contains "Microsoft Macintosh Word") Change-Id: If3d11c5d166dcaf3d94129339559787c20e6db46
* RTF import/export of paragraph drop shadowMiklos Vajna2013-08-151-0/+3
| | | | Change-Id: I8d2485962947eac8acc9ada384a9c1bd4cb22503
* DOCX import: handle custom left cell margin for float table positionMiklos Vajna2013-08-154-21/+24
| | | | Change-Id: I5bc51b739c663d3e123c9d7fb4c2a70f01f8c841
* DOCX import: handle w:leftFromText and w:rightFromText for floating tablesMiklos Vajna2013-08-153-11/+18
| | | | | | | | | | | Left margin wasn't implemented, that's simple. Right margin of the table was set to the cell margin in commit 53d27a30ce5f2c9f7d37a4089286116854c16215, which turns out to be wrong: it's true that the right margin should be >0, but not because of the cell margin but because of the table margin. The new behavior matches what the binary import always did. Change-Id: Ifc24e4f086c49d5d575defdfca1d27e497fa03dc
* DOCX import: handle w:topFromText and w:bottomFromText for floating tablesMiklos Vajna2013-08-153-4/+16
| | | | Change-Id: Ia3a95d785d19f7be750e3723c1c159395ae8476f
* Reduce scopeJulien Nabet2013-08-141-2/+1
| | | | Change-Id: I5cbb44df09291b8a1b74e8aa176d6471960b3391
* DOCX import: fixed horizontal position of floating tablesMiklos Vajna2013-08-144-11/+37
| | | | | | | | | | | | In Word, just like normal tables, floating tables should be positioned in a way that the start of the cell text has the same horizontal position as normal paragraph text. To emulate this, first the table should be moved left by the table border distance, then also by the border with / 2; as done for non-floating tables already. Change-Id: I581311fbb08009e6c1839106e8f615d078a4a705
* DOCX import: fix table auto width for multiple tablesMiklos Vajna2013-08-141-0/+2
| | | | | | | | | m_nMaxFixedWidth wasn't reset across tables, so the counted width for the first table in the bugdoc affected the second as well. Regression from 74c5ed19f430327988194cdcd6bdff09591a93fa. Change-Id: I69a5fa402f2e0170a1ea0269fd73e4ad8f7fede1
* w:spacing in a paragraph should also apply to as-char objects (bnc#780044)Luboš Luňák2013-08-141-0/+9
| | | | | | Otherwise global w:spacing will be used even if overriden locally. Change-Id: I01f0a3a323566f6e29faf73bf9d2ba874565eb42
* DOCX import of paragraph border drop shadowMiklos Vajna2013-08-135-8/+24
| | | | Change-Id: I566c491d65b65def65b78afb583624d8272027e0
* RTF import: handle rotation on groupshapesMiklos Vajna2013-08-135-7/+32
| | | | Change-Id: I7892224a118b6566e26b3ffc472c88f3c7f58620
* fdo#63428 writerfilter: fix paste of commented text rangesMiklos Vajna2013-08-121-4/+9
| | | | | | | | | | | | | There were multiple problems here: - xFoo->createTextCursorByRange() got a text range argument, where the text range wasn't from the xFoo text - it was assumed that all XText implements text::XParagraphCursor as well, but this is not true for e.g. comment text - commented text ranges were pasted as normal comments (once again, the insert position wasn't passed around) Change-Id: I9a975a08b08a7f32b1ee71e42f58736cc0dbb09d
* OSL_FAIL -> SAL_WARNMiklos Vajna2013-08-121-2/+2
| | | | Change-Id: Ifbf7db8044ee28f5f24c03480391a315358a2db4
* fdo#53556 RTF import: fix handling of default shapeTypeMiklos Vajna2013-08-091-0/+7
| | | | | | | | It was a customshape, but Word seems to handle the shape as a rectangle when shapeType is missing. This makes the text in the textboxes of the bugdoc wrap properly. Change-Id: I56e044f42ead348bbb79addc36fa13c82a7ffc29
* fdo#53556 RTF import of fFilled shape property for drwainglayer shapesMiklos Vajna2013-08-092-11/+20
| | | | | | | | | | | The real change is in RTFSdrImport::applyProperty(), the rest is just refactoring to be able to read the "is textframe" property from that method. With this, the transparent big rectangle in the bugdoc no longer hides the text on the first page. Change-Id: I04cca3ade93a63edf608df047bef3bdccf8d3605
* compatibility setting for MS Word wrapping text in less space (bnc#822908)Luboš Luňák2013-08-063-0/+5
| | | | | | | | | | | | | The document itself is stupid and uses a SURROUND_THROUGH object with a number of empty lines that make it act is if it in fact was SURROUND_NONE, rather than actually disabling wrapping for the object and be done with it. But the difference was that Word still managed to fit those empty lines next to the object into the little space that was there, while LO already considered the space too small. So keep a compatibility setting for Word documents in order to avoid problems with such lame documents and hopefully that's enough. Change-Id: I7d17b90de381fd86914ce5efd9c5a29fe4850edc
* fdo#47440 import RTF_SHPBX/YPAGE for Writer pictures, tooMiklos Vajna2013-08-062-9/+18
| | | | | | Previously this was only handled for drawinglayer shapes. Change-Id: I7ce440a27ebe44fc867b8a7f4ee62217076677f0
* fdo#67498 RTF import: fix missing margins vs continuous section breaksMiklos Vajna2013-08-052-19/+30
| | | | | | | | | | | | | The document had 3 sections, separated by continuous section breaks. Previously only margins from the last section were imported, this way the first page had default margins. Now margins are also applied when we hit continuous section breaks. This way margin values from the last section break affecting the page wins. A later commit could improve this further by setting the minimum of these and setting a section margin for each non-minimal sections. Change-Id: I4d9a4585e795220533909bd1d467d933caaa0d71
* cppcheck: Prefer prefix ++/-- operators for non-primitive typesJulien Nabet2013-07-291-1/+1
| | | | Change-Id: If1bd91f28a96bd0eb53e4057e51db900f8b2c52b