summaryrefslogtreecommitdiff
path: root/writerfilter/source
AgeCommit message (Collapse)AuthorFilesLines
2015-01-24rhbz#1180114: writerfilter: don't crash on w:customXmlDelRangeStart etc.Michael Stahl3-1/+24
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 Vajna1-4/+9
Change-Id: If06c6bcdda97447e6014223d997c7ff8abd64b48 (cherry picked from commit 04fe5e6a31c9701177a744bbc8a53b2f664fe71c)
2015-01-24fdo#79959 RTF import: trim whitespace around style namesMiklos Vajna1-2/+3
Change-Id: Id23cbd62b057442c577fef124a5705e4d551076f (cherry picked from commit 305ecd1848a802a6c43ecc6e76f4c6bc36a03418)
2015-01-24fdo#74229 import RTF_TRGAPHMiklos Vajna1-0/+11
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 Stahl2-0/+28
(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 Vajna2-0/+36
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 Vajna2-1/+4
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 McNamara1-4/+7
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 Vajna1-0/+9
(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 Vajna1-10/+16
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 Timar1-0/+12
(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 Vajna1-0/+8
(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 McNamara1-80/+97
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 McNamara2-7/+14
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 Vajna1-0/+2
(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 Vajna9-4/+34
... 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 Vajna1-0/+8
(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 Stahl1-0/+3
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 Vajna2-2/+20
(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 Stahl1-0/+1
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 Vajna1-1/+1
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 Vajna1-1/+1
(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 Vajna2-8/+26
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 Vajna1-0/+2
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 Tyagi1-1/+10
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 Vajna1-4/+5
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ňák5-93/+107
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 Vajna1-1/+4
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 Glogowski1-1/+2
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 McNamara1-2/+7
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 McNamara1-1/+15
(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 McNamara1-1/+1
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ňák3-0/+10
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 Timar3-9/+0
This reverts commit 2a632bb30f78f02042ce333d426468087639305b.
2014-10-14handle docx's w:anchor layoutInCell attribute (bnc#891663)Luboš Luňák3-0/+9
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 McNamara1-1/+1
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 Vajna1-2/+2
(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 Vajna3-4/+92
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 Vajna1-1/+2
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ňák2-75/+107
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 Vajna1-0/+1
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 Deller2-41/+15
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 McNamara1-4/+7
(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 McNamara1-0/+4
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>
2014-08-18bnc#865381 DOCX import: handle <w:hideMark> table cell propertyMiklos Vajna4-0/+58
(cherry picked from commit d1278ef4849661b9ae0eb7aaf4d74fbf91ccaf11) Conflicts: writerfilter/source/dmapper/PropertyIds.cxx writerfilter/source/dmapper/PropertyIds.hxx Change-Id: Id0dd34110376168e34df4956869608895b86abfe Reviewed-on: https://gerrit.libreoffice.org/10922 Reviewed-by: David Tardon <dtardon@redhat.com> Tested-by: David Tardon <dtardon@redhat.com>
2014-08-11fdo#82106 RTF import: fix missing tab after special footnoteMiklos Vajna1-0/+3
(cherry picked from commit 8ae087b8fcc25f5ce83e339d447d2899d3059d45) Change-Id: I5ea45dbed652231acdcc3632ced728ed8bcb621a Reviewed-on: https://gerrit.libreoffice.org/10861 Reviewed-by: Michael Stahl <mstahl@redhat.com> Tested-by: Michael Stahl <mstahl@redhat.com>
2014-08-08fdo#79599: use \highlightN instead of \chcbpatN in RTF import and exportnrbrtx@gmail.com2-1/+3
Reviewed on: https://gerrit.libreoffice.org/9776 (cherry picked from commit 7eafd8ccac56d7503b4287dfa3acac2cf0560b20) Conflicts: sw/qa/extras/rtfexport/rtfexport.cxx Change-Id: I98ef606fb73368a3c275819cb83b936e2162769d Reviewed-on: https://gerrit.libreoffice.org/10813 Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk> Tested-by: Miklos Vajna <vmiklos@collabora.co.uk>
2014-08-05fdo#81993: Revert "Resolves: #i119464# Update default alignment ...Michael Stahl1-17/+1
... value for docx [Sub]Title" This reverts commit acc671ec74c874ffd22803bb2ee54a1f2c027155. The commit is clearly unnecessary: 1) commit 3f9e7e72c53ecbe8ee1ab060f811cb41eadfc7e1 appears to be a better fix for alignment 2) commit b95d203bc17c83ec0fe5139f519d53ed1d842d3a should have disabled the Center default in Writer already Change-Id: Ib0cc60af037f12be0a1ab94ab32c743f7fca2b1d (cherry picked from commit d4b96b45727314585d02394bb5a084393b647729) Reviewed-on: https://gerrit.libreoffice.org/10733 Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk> Tested-by: Miklos Vajna <vmiklos@collabora.co.uk>
2014-08-04fdo#80742 RTF filter: import RTF_OUTLINELEVELMiklos Vajna1-0/+3
(cherry picked from commit c3657be928732f1b3b3b238f625de304a90a1ae1) Change-Id: I49d94bd72af610e88128cd405e4786d2e9ba65ed Reviewed-on: https://gerrit.libreoffice.org/10727 Reviewed-by: Michael Stahl <mstahl@redhat.com> Tested-by: Michael Stahl <mstahl@redhat.com>
2014-08-04RTF import: fix as-char anchored OLE objectsMiklos Vajna1-0/+3
Regression from 2a35f5c7945d00b6f6e21fc7cf5b05b184eba88f (DOCX OLE import: inherit anchor type from replacement graphic, 2014-02-18), then problem was that dmapper expected that the anchor type of the replacement graphic is set, but the RTF tokenizer wasn't adapted to fulfill this requirement. (cherry picked from commit 43b88364b0b05def27899d585a1dab46ba3fb729) Conflicts: sw/qa/extras/inc/swmodeltestbase.hxx sw/qa/extras/rtfimport/rtfimport.cxx Change-Id: I0f7e1a71052f337793d6f844fe5476c3868c03f4 Reviewed-on: https://gerrit.libreoffice.org/10677 Reviewed-by: Michael Stahl <mstahl@redhat.com> Tested-by: Michael Stahl <mstahl@redhat.com>