summaryrefslogtreecommitdiff
path: root/writerfilter
AgeCommit message (Collapse)Author
2015-09-28tdf#90046: RTF import: ensure that a run is started before \footnoteMichael Stahl
Avoids crashing with empty context stacks. (cherry picked from commit a61fd02c819433a1206b3b3e61017ba2d0d3d467) Reviewed-on: https://gerrit.libreoffice.org/17333 Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com> (cherry picked from commit 7e086276cd27bac93040bfd7ff5f5dbdfc0b9f86) Conflicts: writerfilter/source/rtftok/rtfdocumentimpl.cxx Change-Id: I0ee8b457fdbb19b55f5c15876b7253680cde6e23
2015-09-28tdf#90611 DOCX import: fix missing paragraph style on footnotesMiklos Vajna
One one hand, a problem since commit 330b860205c7ba69dd6603f65324d0f89ad9cd5f (fdo#68787 DOCX import: handle when w:separator is missing for footnotes, 2013-09-04) was that the type attribute from <w:footnote w:type="separator"> resulted in two ooxml:CT_FtnEdn_type tokens, ignoring too many paragraph ends for footnotes, which resulted in missing paragraph style on footnotes. On the other hand, fixing the first problem showed that it wasn't correct that commit 9389cf78e304a5a99bcf1745b9388e14ac36281a (cp#1000018 RTF import: empty para at the end of footnote text got lost, 2013-11-15) unconditionally removed the RemoveLastParagraph() call in DomainMapper_Impl::PopFootOrEndnote(). It turns out that RTF and DOCX have different semantics here, the footnote is always within a <p></p> pair in DOCX, while in RTF a \par at the end of a footnote means an empty paragraph. Fix that by conditionally restoring the removed RemoveLastParagraph() call. (cherry picked from commit 519b34300f73b1e08f6194d6ba49d4fc010cf186) Reviewed-on: https://gerrit.libreoffice.org/16879 Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com> (cherry picked from commit 884dd05b7c22db2b51bb2c34e81561c43b86b225) Conflicts: sw/qa/extras/ooxmlimport/ooxmlimport.cxx writerfilter/source/dmapper/DomainMapper.cxx Change-Id: I33020ac761c94addfec8164a17863565e4453b07
2015-09-28tdf#89698 DOCX import: inline picture should have no spacingMiklos Vajna
Commit 3d7e168a2a43c2414b0633379102ddb29437e75b (n#783638 DOCX import of wp:inline's distT/B/L/R attributes, 2012-10-11) was about a picture that had non-zero spacing in LO, but zero in Word. The hope was that the problem is just that the value is not imported. Then commit a88ac708403c03d0f950f09ec29c0d5a1e5a85b4 (fdo#63685 wp:inline's distT/B/L/R is in EMU's, not twips, 2013-04-19) was about a picture that had so large spacing that the picture become invisible. Fixing the unit of the spacing value made the picture visible again. What was missed is that this value is just stored in the doc model, but layout in Word doesn't use it at all till the anchoring is as-char. Given that in LO as-char anchoring supports real spacing, just don't import these values to have the same layout. That's what the WW8 import does, too. (cherry picked from commit 9781a8786da5c32e2250cbe1ae97bd10f84f39bb) Reviewed-on: https://gerrit.libreoffice.org/16786 Reviewed-by: Michael Stahl <mstahl@redhat.com> Tested-by: Michael Stahl <mstahl@redhat.com> (cherry picked from commit e3afafb236e273516b94bf6ed3fc9de403843245) Conflicts: writerfilter/source/dmapper/GraphicImport.cxx Change-Id: I1244269e06c5d190e8340349ddc12ae7b0572a4d
2015-09-28tdf#92061 RTF import: fix missing body text after footnoteMiklos Vajna
A missing seek in the \footnote handler could result in a situation that the missed text contained a "{" but not its matching "}", which resulted in the parser terminating earlier than the end of the document. (cherry picked from commit 7b08304b55cf2284a3c583426c60baef618ba206) Conflicts: sw/qa/extras/rtfimport/rtfimport.cxx Reviewed-on: https://gerrit.libreoffice.org/16501 Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com> (cherry picked from commit 326ca9e0710d17274eb0a6cdc0d95d4f933784f0) Conflicts: writerfilter/source/rtftok/rtfdocumentimpl.cxx Change-Id: I6df476b2d6397dfa918111b33854dc2f95fbe81d
2015-04-27cp#1000125 DOCX import: fix non-zero para indentMiklos Vajna
This only affects libreoffice-4-3 and earlier, libreoffice-4-4 and newer is unaffected. The problem is that the document had this XML fragment: <w:p> <w:pPr> <w:numPr> ... </w:numPr> <w:ind w:left="0" w:firstLine="0"/> </w:pPr> </w:p> The order of generated tokens for the left and firstLine attributes is ~random (but with the exact CPLinux config or on Windows, it's "firstLine, left"), while it's always "left, firstLine" on newer versions, since iterating over the keys of the boost::unordered_map has been cleaned up. When "left" is the later attribute, then the ParaFirstLineIndent property should be set in the "left" handler only in case "firstLine" did not set it already, so switch off overwriting. Change-Id: Ifd0f6f7e1e85ac485be326d52b6db89f32d77357
2015-04-14tdf#75614 RTF import: fix missing text after footnoteMiklos Vajna
(cherry picked from commit cec5f2eab25578a9859134d697c200089c597faa) Conflicts: sw/qa/extras/rtfimport/rtfimport.cxx Change-Id: I5901094cb603c35a1cd8ac718fd434a9dd55729b Reviewed-on: https://gerrit.libreoffice.org/15271 Tested-by: David Tardon <dtardon@redhat.com> Reviewed-by: David Tardon <dtardon@redhat.com>
2015-01-24rhbz#1180114: writerfilter: don't crash on w:customXmlDelRangeStart etc.Michael Stahl
We can't do anything sensible with these CustomXML elements but now we have to handle them because. (regression from 9dbf817fe5c5253fba0831aefa17575ae0ba3af1) Change-Id: If4247890ff9961a77434587802670d28608a7922 (cherry picked from commit f22964e0e622af1168e241f933e5cf98e093ec2b) Reviewed-on: https://gerrit.libreoffice.org/13914 Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2015-01-24fdo#82114 RTF import: fix handling of first page in non-first sectionMiklos Vajna
Change-Id: If06c6bcdda97447e6014223d997c7ff8abd64b48 (cherry picked from commit 04fe5e6a31c9701177a744bbc8a53b2f664fe71c)
2015-01-24fdo#79959 RTF import: trim whitespace around style namesMiklos Vajna
Change-Id: Id23cbd62b057442c577fef124a5705e4d551076f (cherry picked from commit 305ecd1848a802a6c43ecc6e76f4c6bc36a03418)
2015-01-24fdo#74229 import RTF_TRGAPHMiklos Vajna
Regression from commit c4b91ae3178011c66c76c711c1a6469ba658872e (fdo#55525 import RTF_TRLEFT, 2012-11-13). Change-Id: I90f2c6399cfaf8399de0cf3488a23af6cc84710d (cherry picked from commit 54bdfe0a891f2119bc35c5d82ecbc94c8cb13c0b)
2015-01-08fdo#84685: writerfilter: RTF import: support \xe index entryMichael Stahl
(cherry picked from commit f14e6e06b9e3c82c267649d63512a3538e5ee2f5) (related fdo#84685): writerfilter: RTF import: support \tc TOC entry (cherry picked from commit 1dd1dfc152c7cbeb374fe4f38b08c6af9cef2c06) fix Windows build (cherry picked from commit acfd640fd8547d3275c5db714b88d52b3fe7c4d5) Change-Id: Ia957541a5997961aa86b2eb8537ebd29d3092691 Reviewed-on: https://gerrit.libreoffice.org/13508 Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk> Tested-by: Miklos Vajna <vmiklos@collabora.co.uk> (cherry picked from commit d90c5fbf67dc76c18cf703267139e7ad6b26564b)
2015-01-08DOCX import: handle section break right after a ToC fieldMiklos Vajna
The symptom was that during the handling of the XE field, we tried to access the top of the text append stack, but the stack was empty. The situation is the following: 1) There is a multi-page TOC field. 2) The page break inside the field is described using a section break, featuring headers, and the header contains a field that we map to a fieldmark. 3) There is an XE field after all this. The root cause was that during parsing of the header, some of the state should be stashed away and restored when we're done. The new HeaderFooterContext does exactly this, and now the number of push/pop calls on the text append context match again. (cherry picked from commit 153af84762f98d6c86c4c060b01402f40b2b0c24) Conflicts: sw/qa/extras/ooxmlexport/ooxmlexport.cxx Change-Id: I10f259fd9edb8bd719ae5bc8a43ed5ef8c708071 Reviewed-on: https://gerrit.libreoffice.org/13524 Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com> (cherry picked from commit 99b3e159726b51537563790e8f73b43a88970e13)
2015-01-08fdo#86761 RTF import: positive border width and fLine=0 means no borderMiklos Vajna
Regression from 01a32b7d074511bed24044dc94e1159aea62722b (fdo#85179 RTF filter: import image border, 2014-10-23), there were a number of problems here: - CppunitTest_sw_htmlexport: revert back to the old behavior, where in case there is no border, we don't set the color of it. - The testcase of the above commit omitted fLine=1 shape property, which is present in the original bugdoc, and only with that should we put a border around the shape. - Let fLine=1 explicitly change the line style from NONE. - dmapper: if line style is NONE, then don't bother setting the border color and width. (cherry picked from commit 4568d1d298bf4fc98dcd86384743a04587a2fe6f) Conflicts: writerfilter/source/dmapper/GraphicImport.cxx Change-Id: Iffee41066d42822b699c478821645b9742df3f58 Reviewed-on: https://gerrit.libreoffice.org/13470 Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com> (cherry picked from commit cfb770dc619fc33796b98ca900eb3fd7f714139e)
2014-12-13Resolves: fdo#86662 don't crash on docx loadCaolán McNamara
ok in master, so just don't crash in 4-3 series Change-Id: I2dcb7b0434341ff8058bdbdfc065ad08bd0600bc Reviewed-on: https://gerrit.libreoffice.org/13374 Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk> Tested-by: Miklos Vajna <vmiklos@collabora.co.uk>
2014-12-13fdo#86750 RTF import: fix table of contents linksMiklos Vajna
(cherry picked from commit 4517c94000153eab6c034ea548698953dd93f794) Change-Id: I0f3d35a0e64c9ce5646fa63eda317bee42de5540 Reviewed-on: https://gerrit.libreoffice.org/13372 Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2014-12-13fdo#72031 RTF import: bogus call to getBestTextEncodingFromLocale()Miklos Vajna
There were two problems here. First, commit bbe3627eece0c3486e7ea11f2f13377aaa3a8fed (rtftok: stop sending sprm:CRgFtc{0,1,2} tokens, 2014-03-05) broke the use-case when the font encoding is 0, but it's present. Before that commit, we parsed the font encoding instantly; after that commit we parse it once we have a font name. If we do that, then we have to have an idea if we have a font encoding. Given that 0 is a valid encoding, use -1 for the "have no encoding" case instead. Second, commit 7839633fb356285652ed96f4bf3f85bcd5b561a4 (fdo#85889 handle pc, pca and mac rtf keywords in writerfilter, 2014-11-24) abused m_nCurrentEncoding, which is meant to be used within the font table only. The problem with this is that this way only the first font will get the encoding, while the spec says it should be used in every context where there is no other explicit encoding. Fix this by setting the default encoding for those 3 control words instead -- and consider the default encoding in getEncoding(). Change-Id: Ia1d71f8ce70f2a53a3770b4840e21362d082e71f (cherry picked from commit fa15d039e3a553da8500c17190d27169a9477cf2) Signed-off-by: Andras Timar <andras.timar@collabora.com>
2014-12-13fdo#85889 handle pc, pca and mac rtf keywords in writerfilterAndras Timar
(cherry picked from commit 7839633fb356285652ed96f4bf3f85bcd5b561a4) Conflicts: sw/qa/extras/rtfimport/rtfimport.cxx Change-Id: Ic54f2233a37562bdc516e440af0b4b7973f56342 Reviewed-on: https://gerrit.libreoffice.org/13106 Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk> Tested-by: Miklos Vajna <vmiklos@collabora.co.uk>
2014-11-23fdo#82006 RTF filter: import \sbauto and \saautoMiklos Vajna
(cherry picked from commit bb77fd64f9219f1b8f990f5041d81cfddd021213) Conflicts: sw/qa/extras/rtfexport/rtfexport.cxx Change-Id: Iabff543c8191fc86dceb9274ea1552f60d73dabd Reviewed-on: https://gerrit.libreoffice.org/13054 Reviewed-by: Andras Timar <andras.timar@collabora.com> Tested-by: Andras Timar <andras.timar@collabora.com>
2014-11-23Resolves: fdo#86451 guard all the tops post popCaolán McNamara
Change-Id: I98be6f014893dfc7cee770c44cd9d0be32b39f5c Reviewed-on: https://gerrit.libreoffice.org/12966 Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk> Tested-by: Miklos Vajna <vmiklos@collabora.co.uk>
2014-11-23Resolves: fdo#86449 backport rtf fixesCaolán McNamara
empty Reference valgrind + bff (cherry picked from commit 0a42632a74596cbc781746931bf8f2650994b80f) empty m_aStates valgrind + bff (cherry picked from commit e3247719911f4e9b61ec43ea1c9ce04bcddc4ff8) Change-Id: Id3c039a46dec5d2d4a4642dfb53d23a76972dde2 3bd526b7ebf0f4fce5d0c7054809e0dc2908e73f Reviewed-on: https://gerrit.libreoffice.org/12965 Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk> Tested-by: Miklos Vajna <vmiklos@collabora.co.uk>
2014-11-23fdo#83204 RTF import: handle \pard<para props> after \bkmkstartMiklos Vajna
(cherry picked from commit 8a30ba573470d59dbb0501b488f8a655b015ffd2) Change-Id: I4f5f0f653f2ce7782ec1d1fc5ef550a21a9c1d35 Reviewed-on: https://gerrit.libreoffice.org/12527 Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2014-11-23fdo#84645 RTF import: set DontBalanceTextColumns=true for the last section ...Miklos Vajna
... if it has multiple columns. See commit d185204737031955c56a24356ed003d342548434 (DOCX import: set DontBalanceTextColumns=true for the last section, 2014-07-17) for the DOCX equivalent of this problem; this just adapts the RTF tokenizer to dmapper. (cherry picked from commit d185204737031955c56a24356ed003d342548434) (cherry picked from commit f4bb73164a51ec83fe1d5975b1232d35f8a9e88a) Change-Id: Ib30f9b386e204b8b2987832ab17ee0cc53b3f0bc Reviewed-on: https://gerrit.libreoffice.org/12462 Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2014-11-23fdo#82512 RTF import: fix position of column breakMiklos Vajna
(cherry picked from commit dcb37dcebcde6188eb58ef7d8d34d08fea4badb8) Change-Id: Ib0f39c4af7cc32d0f4491f13ea207d90a449a47d Reviewed-on: https://gerrit.libreoffice.org/12309 Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2014-11-23fdo#85812: RTF import: fix run type in new groupsMichael Stahl
Apparently the run type resets to LTR in a new group. (regression from fc49c052dbdbb5ab3b0a02a13143705f769b9662) (cherry picked from commit 88d3f9e4cf64e4ef037063b26ddf347fd42d8d84) fdo#85812: RTF import: better fix for run type in new groups Apparently Word treats \ltrch \rtlch differently from \loch \hich \dbch when groups are opened. Change-Id: I257712521e8e77fa66e76857489797ecc675506e (cherry picked from commit a9a9718bb1f64318429562ecdaa3d3763d9e2f4a) Reviewed-on: https://gerrit.libreoffice.org/12269 Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk> Tested-by: Miklos Vajna <vmiklos@collabora.co.uk>
2014-11-23fdo#82076 RTF import: handle footnote in table cellMiklos Vajna
(cherry picked from commit 956c3ff3d43e1b181f7c91518edee1c7c4dc2a0a) Change-Id: I69def7936c320e93db5d4504922d52346caaf9cf Reviewed-on: https://gerrit.libreoffice.org/12242 Reviewed-by: Michael Stahl <mstahl@redhat.com> Tested-by: Michael Stahl <mstahl@redhat.com>
2014-11-23fdo#79602: sw: add new compatibiltiy flag PropLineSpacingShrinksFirstLineMichael Stahl
This is enabled by default, to get the new formatting where the first line of a paragraph is shrunk if a proportional line spacing < 100% is applied; existing OOo documents get the previous (before LO 3.3) formatting. Since the formatting in LO releases is broken anyway, it does not matter much which way documents written by old LO get formatted. (cherry picked from commit 9605763e3dc8c85137787c77c31e8639553a35ed) Conflicts: sw/source/filter/ww8/ww8par.cxx Change-Id: I0952f568a933c137bd03070759989cac3517d8b9 Reviewed-on: https://gerrit.libreoffice.org/12157 Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk> Tested-by: Miklos Vajna <vmiklos@collabora.co.uk>
2014-11-23fdo#82859 RTF import: fillColor is unsignedMiklos Vajna
Otherwise ARGB 0xFFFFFFFF would turn into black. (cherry picked from commit 04ea7b24ec1b5a027efa0b850f2bc3ac7116c52e) Change-Id: I690f34d888ca9a013e8ce1af2c7ef8ed88ee28b0 Reviewed-on: https://gerrit.libreoffice.org/12153 Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2014-11-23fdo#82859 RTF import: don't try to set CustomShapeGeometry on a TextFrameMiklos Vajna
(cherry picked from commit 6b7239855d8babdc1bcc7742f79ce2df64d1e476) Conflicts: writerfilter/source/rtftok/rtfsdrimport.cxx Change-Id: I687fa609559f0484fe6bb804265243de154c3760 Reviewed-on: https://gerrit.libreoffice.org/12122 Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2014-11-23fdo#85179 RTF filter: import image borderMiklos Vajna
Also adjust CppunitTest_sw_htmlexport that implicitly tested that there is no color around the image. (cherry picked from commit 01a32b7d074511bed24044dc94e1159aea62722b) Conflicts: writerfilter/source/dmapper/GraphicImport.cxx Change-Id: I8e14dfa7e7be80c4f8c492999071decae6a492e8 Reviewed-on: https://gerrit.libreoffice.org/12092 Reviewed-by: Michael Stahl <mstahl@redhat.com> Tested-by: Michael Stahl <mstahl@redhat.com>
2014-11-23fdo#83464 RTF import: \plain should reset \rtlch and \hich as wellMiklos Vajna
Regression from 36246aa9fb57c9fe4e546c91a8274d8828b1424e (RTF import: fix handling of \loch \hich \dbch \ltrch \rtlch, 2014-06-03), now that \f no longer means the ascii font name, \plain should reset a few more parser state members. (cherry picked from commit 69bf37136c1386c7220f38a896aa9865bdae665f) Conflicts: sw/qa/extras/rtfimport/rtfimport.cxx writerfilter/source/rtftok/rtfdocumentimpl.cxx Change-Id: Ia6b0bdf25563dd5300e108b46731751f0886f67d Reviewed-on: https://gerrit.libreoffice.org/12034 Reviewed-by: Markus Mohrhard <markus.mohrhard@googlemail.com> Tested-by: Markus Mohrhard <markus.mohrhard@googlemail.com>
2014-11-23fdo#81486:custom property with the same name as Document Property not importedCharu Tyagi
Change-Id: Ieb9cba7b8969787140d6db3b77765e3a15bf89e1 Reviewed-on: https://gerrit.libreoffice.org/10381 Reviewed-by: Michael Stahl <mstahl@redhat.com> Tested-by: Michael Stahl <mstahl@redhat.com> Reviewed-on: https://gerrit.libreoffice.org/11960 Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk> Tested-by: Miklos Vajna <vmiklos@collabora.co.uk>
2014-10-14fdo#84679 RTF import: fix paragraph spacing handling in tablesMiklos Vajna
Regression from commit 1be0a3fa9ebb22b607c54b47739d4467acfed259 (n#825305: writerfilter RTF import: override style properties like Word, 2014-06-17), we failed to do the proper deduplication in buffered content, like tables. Fix this by adapting RTFDocumentImpl::replayBuffer() to RTFDocumentImpl::checkNeedPap(), which already did the proper deduplication. To be fair, the inconsistency was there earlier since 9f5263c477b82fef5aa9c3e79fb6af92aa049e24 (fdo#44736 RTF import: ignore direct formatting which equals to style, 2012-11-25), but it caused no real harm earlier. (cherry picked from commit e34906d20c9febc420b115fa2a8b171826dea0be) Change-Id: I0673408088d9d83768f0780ea92ece87913d03f3 Reviewed-on: https://gerrit.libreoffice.org/11914 Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2014-10-14fix docx redline import (bnc#821804)Luboš Luňák
This is a squash of commits b6969634..fd26de3b. Change-Id: I8984001d7f85c00eb9b9943b25b8abb6e2ee28d3 Reviewed-on: https://gerrit.libreoffice.org/11789 Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk> Tested-by: Miklos Vajna <vmiklos@collabora.co.uk>
2014-10-14fdo#84536 RTF import: don't try to rotate TextFramesMiklos Vajna
Regression from 818d80eb0cee65d1bcc4fdb74b32a7c42cc1336e (RTF import: support shapes inside tables, 2013-06-28). (cherry picked from commit 53b9a9bc7c84738545b5c7b791cea1e3d6a16c72) Change-Id: I05eb2f4f2e3467e35f96b280e3a79f69906a56de Reviewed-on: https://gerrit.libreoffice.org/11746 Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2014-10-14Don't assign NULL to boost::shared_ptrJan-Marek Glogowski
This is already done by the constructor. Fixes the libreoffic-4-3 build on Ubuntu 12.04. Change-Id: I7bbec905c0d1efb5670c61c975f36f2e37a74cac Reviewed-on: https://gerrit.libreoffice.org/11778 Reviewed-by: David Tardon <dtardon@redhat.com> Tested-by: David Tardon <dtardon@redhat.com>
2014-10-14Related: fdo#37691 \shptxt ... \jpegblipCaolán McNamara
text shape with jpeg data, should we throw away the text shape here or keep it ? Change-Id: I9e4463b5863bf68cdcd18ea5d1f6c831a0de8ec9 (cherry picked from commit cfbcce701cd6dc3af6086428399136efef33ff59) Signed-off-by: Michael Stahl <mstahl@redhat.com>
2014-10-14Related: fdo#73608 don't crash on missing table stylesCaolán McNamara
(cherry picked from commit 5fd7382651d64f77e8ad1d9a5c053f52f3641f9f) Conflicts: writerfilter/source/dmapper/DomainMapperTableHandler.cxx Change-Id: I340b43b7afc4c5c4d6dc8e4ed182279240306540 Resolves: fdo#73608 bail out on loop in style sheet hierarchy Change-Id: I03975d1ce8eaceceb4d5c263eb11c1521bcd57eb (cherry picked from commit be18133e84120625734a09380594ee89b23c4322) Reviewed-on: https://gerrit.libreoffice.org/11679 Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk> Tested-by: Miklos Vajna <vmiklos@collabora.co.uk>
2014-10-14Resolves: fdo#79130 Crash in DomainMapper_Impl::CloseFieldCommandCaolán McNamara
Change-Id: Ia59e0c79ec7f2066891b78657559f41eaeb80a09 (cherry picked from commit a392a1deb0bb55f39f0232f9b3df8ad9ac9062af) Reviewed-on: https://gerrit.libreoffice.org/11665 Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk> Tested-by: Miklos Vajna <vmiklos@collabora.co.uk>
2014-10-14handle docx's w:anchor layoutInCell attribute (bnc#891663)Luboš Luňák
Change-Id: I8268567b84aa0f6e42624bfd0f79c8c49c153edd Reviewed-on: https://gerrit.libreoffice.org/11568 Reviewed-by: Andras Timar <andras.timar@collabora.com> Tested-by: Andras Timar <andras.timar@collabora.com>
2014-10-14Revert "handle docx's w:anchor layoutInCell attribute (bnc#891663)"Andras Timar
This reverts commit 2a632bb30f78f02042ce333d426468087639305b.
2014-10-14handle docx's w:anchor layoutInCell attribute (bnc#891663)Luboš Luňák
Change-Id: I8268567b84aa0f6e42624bfd0f79c8c49c153edd Reviewed-on: https://gerrit.libreoffice.org/11568 Reviewed-by: Andras Timar <andras.timar@collabora.com> Tested-by: Andras Timar <andras.timar@collabora.com>
2014-09-23Resolves: fdo#66496 don't crash on loading specific .docxCaolán McNamara
Change-Id: I4db5dfeb0ce1494039a051f552ce3f69b2b5dae3 (cherry picked from commit 48a679cbc5775a7a033dfe494c2a0a513aba9b1f) Reviewed-on: https://gerrit.libreoffice.org/11459 Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk> Tested-by: Miklos Vajna <vmiklos@collabora.co.uk>
2014-09-05fdo#82067 RTF import: handle negative SHPLEFT / SHPTOPMiklos Vajna
(cherry picked from commit dc0149869bc0cc09e92816ae6f34831bf5353e3b) Change-Id: Id82d6d54b160b5b78a53c526e6ccab0514c21312 Reviewed-on: https://gerrit.libreoffice.org/11283 Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2014-08-27DOCX import: fix handling of embedded DOCX filesMiklos Vajna
The problem was that SwXTextEmbeddedObject::getEmbeddedObject() returned an empty reference for those embedded objects, so the HTML filter couldn't extract their content when it wanted to do so. It turns out the reason for this was that the DOCX importer only handled the replacement image + raw native data for the object. Fix this by creating the embedded object with the correct CLSID and import the raw data into the empty embedded document model. This is similar to what is done for XLSX-in-PPTX in oox::drawingml::ShapeExport::WriteOLE2Shape(), just for the import part. (cherry picked from commit 41aa970b3120837ca9cadb12997a53ad322145a4) Conflicts: writerfilter/source/dmapper/OLEHandler.cxx writerfilter/source/dmapper/OLEHandler.hxx Also squash in 3 fixes on top of that in the HTML filter which are relevant only after the embedded DOCX import is fixed: 1) sw HTML export: don't crash on embedded object without native data (cherry picked from commit 35e954149d976e0e69a9f8b382fc67f5abc5eaa7) 2) sw HTML export: handle embedded text documents (cherry picked from commit 8d670c9452e930460be600212d73e22acd61cc0f) 3) sw HTML export: avoid invalid output for embedded documents When an sw document is embedded inside an sw one, then the inner sw HTML export should just write what's inside the <body>. Add a filter option for that in sw, similar to the one already existing in sc. (cherry picked from commit 8760b2b05c23e5fdf8ad7ad3f447a7489c2ddeac) Conflicts: sw/source/filter/html/wrthtml.cxx Change-Id: Id2cef966c1022ba45a3540bff234029c1d396778 Reviewed-on: https://gerrit.libreoffice.org/11151 Reviewed-by: Tomaž Vajngerl <quikee@gmail.com> Tested-by: Tomaž Vajngerl <quikee@gmail.com>
2014-08-26DOCX import: list styles don't support automatic updatesMiklos Vajna
The problem was the following: setPropertyValue("IsAutoUpdate") on the style failed -> a number of styles was not imported in StyleSheetTable::ApplyStyleSheets() due to the exception, then when we tried to use one of the not imported styles, we also got an exception in DomainMapper_Impl::finishParagraph(), which resulted in not calling DomainMapperTableManager::handle(), so multiple cells of the same table wanted the same range for cell contents, and that resulted in a crash. Regression from cf33af732ed0d3d553bb74636e3b14c55d44c153 (handle w:gridBefore by faking cells (fdo#38414), 2014-04-23), but that commit just made the previously hidden problem visible. (cherry picked from commit 7c02c7b0216f642074b690cce889f1a02a2ef6b0) Change-Id: I788cb6b4a2c7b7efbfa48297c658bb26450bf583 Reviewed-on: https://gerrit.libreoffice.org/11068 Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2014-08-22fix reading even/odd page breaks from .docx (bnc#519228)Luboš Luňák
We map Word's even/odd page breaks to Writer's left/right page styles. And we cannot just set any page style to be left/right, because that could set e.g. the default page style as such, which would make all normal pages that way. So instead we need to make a copy of the relevant page style, as the original page style as its follow, copy all the properties and headers/footers, and use this copy to get the page break. (cherry picked from commit b32881b6723072c8d1a652ea147d12e75766d504) Conflicts: sw/qa/extras/ooxmlimport/ooxmlimport.cxx Change-Id: Id0d2568de91ac2de4afb0ba3a6eedd9cec46f878 Reviewed-on: https://gerrit.libreoffice.org/11025 Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk> Tested-by: Miklos Vajna <vmiklos@collabora.co.uk>
2014-08-19DOCX import: fix FooterBodyDistance for first pagesMiklos Vajna
The root cause was that code in SectionPropertyMap::PrepareHeaderFooterProperties() saved member variables on the stack, modified them, then restored them at the end of the method, but forgot to restore m_nBottomMargin there. The result of this was that First Page's FooterBodyDistance got set to zero, which is not the same as Default Style's FooterBodyDistance (150), so on export sw::util::IsPlausableSingleWordSection() returned false, which turned the page break into a section break. Change-Id: I1afa2603de1313ae1e2aaefd4b7c771fce27e21e (cherry picked from commit 8cf681c5049970573020d8b808c990441b9cf828) Signed-off-by: Luboš Luňák <l.lunak@collabora.com>
2014-08-19Copy first-header-footer test from ww8 to ooxmlLuke Deller
The test document was converted from doc to docx using MS Word 2010. Several fixes were required to make this test pass: - Do not clear the "FirstIsShared" property on page styles, as the code instead uses the old fashioned method of translating a Word section with "different first page header/footer": two page styles linked together, the first page style and the follow page style. (Also remove a wrong test case which checks the FirstIsShared property) - Do not clear the "HeaderIsShared"/"FooterIsShared" properties on the first page style, only on the follow page style. - Actually set the "FollowStyle" property on the first page style to link it to the follow page style. This didn't matter for the very first Word section because it was mapped to the default page styles "First Page" and "Standard" which are already linked, but it does matter for subsequent Word sections. - For some reason setting a new page style at a section break was excluded in the case where the following section had a title page. Remove this exclusion. - The exclusion mentioned in the last point was masking that bnc#751077 was not entirely fixed. To resolve that issue: When checking if the last paragraph of the section is empty, consider not just text content but also shapes. - Remove a workaround for bnc#780843 involving copying of headers and footers from the "Standard" (first section) page style in the case where the following section had a title page. This workaround is no longer needed as the test case passes without it. Change-Id: Iacc9bba0720c11414da3e852892cff301ebbc4fe (cherry picked from commit b4ccde72b8e2e45e7276d5b08b182495a1b1a617) Signed-off-by: Luboš Luňák <l.lunak@collabora.com>
2014-08-19fix build, coverity#1209547 Unchecked dynamic_castCaolán McNamara
(cherry picked from commit f4c80aaf3f2b97661ecf1cfd014aaa5ad00da846) Change-Id: Ibf614156aeafcd74be444cf388e02a9273d38d5f Reviewed-on: https://gerrit.libreoffice.org/11018 Reviewed-by: David Tardon <dtardon@redhat.com> Tested-by: David Tardon <dtardon@redhat.com>
2014-08-18check for empty m_aStatesCaolán McNamara
valgrind + bff Change-Id: Ib818d508e10877a845b733c4aa223d1e2cbbc05e (cherry picked from commit e2b9531e43d37677109aa13eb6e2ebf857961016) Reviewed-on: https://gerrit.libreoffice.org/10958 Reviewed-by: David Tardon <dtardon@redhat.com> Tested-by: David Tardon <dtardon@redhat.com>