summaryrefslogtreecommitdiff
path: root/writerfilter/source/rtftok/rtfdocumentimpl.cxx
AgeCommit message (Collapse)AuthorFilesLines
2015-04-13tdf#75614 RTF import: fix missing text after footnoteMiklos Vajna1-1/+5
(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>
2014-12-18fdo#84685: writerfilter: RTF import: support \xe index entryMichael Stahl1-0/+26
(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>
2014-11-30fdo#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-11-24fdo#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-19Resolves: 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-19Resolves: fdo#86449 backport rtf fixesCaolán McNamara1-6/+7
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-18fdo#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-17fdo#84645 RTF import: set DontBalanceTextColumns=true for the last section ...Miklos Vajna1-0/+6
... 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-06fdo#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-04fdo#82076 RTF import: handle footnote in table cellMiklos Vajna1-1/+18
(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-10-20fdo#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-10-11fdo#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-02Related: 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-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-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-08fdo#79599: use \highlightN instead of \chcbpatN in RTF import and exportnrbrtx@gmail.com1-1/+1
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-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>
2014-08-03fdo#81944: writerfilter: RTF import: don't drop fonts in stylesheetMichael Stahl1-32/+19
The font definitions in the style sheet meet an untimely death in StyleSheetTable::lcl_sprm(), which special-cases LN_EG_RPrBase_rFonts, routing it into TblStylePrHandler. Avoid this by sending style entries to the domain mapper in the same way as the OOXML tokenizer, i.e., with paragraph and run properties nested below CT_Style_pPr/rPr. This reveals that the CT_Style_basedOn was wrongly handled as paragraph property. Change-Id: Ic724ba48fe36bf782b1b430bdafdb1df480d5ad3 (cherry picked from commit f8e8e476aa0a5576234dbb4daac9dc299e044e61) Reviewed-on: https://gerrit.libreoffice.org/10698 Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk> Tested-by: Miklos Vajna <vmiklos@collabora.co.uk>
2014-08-02writerfilter: RTF import: ignore content of \upr, except for \udMichael Stahl1-6/+9
The content of \upr and its nested \ud destination should be the same modulo text encoding, so ignore the legacy one. Change-Id: I007151e3075a9ac879a486ec3b5fb8549435dbba (cherry picked from commit b46956e73b6daff2578110c0395fd80150dc0b0b) Reviewed-on: https://gerrit.libreoffice.org/10699 Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk> Tested-by: Miklos Vajna <vmiklos@collabora.co.uk>
2014-08-01fdo#81893: writerfilter: RTF import: \qc before \page was lostMichael Stahl1-0/+4
The paragraph properties need to be applied to the paragraph following the \page too, which did not happen in this case. Also the minimized test doc shows that checkNeedPap() must be preceded by checkFirstRun(), since there is no run preceding the \page. (regression from 94765a1b3f543b3b60f8c1de05048d12f2576be4) Change-Id: Id286c4fbdeee688fa4f6b24063b634bac637eab6 (cherry picked from commit 008d1187a9f3b36d6cbf31742632d237afecf1bd) Reviewed-on: https://gerrit.libreoffice.org/10675 Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk> Tested-by: Miklos Vajna <vmiklos@collabora.co.uk>
2014-08-01fdo#81892: writerfilter: RTF import: add support for table row alignmentMichael Stahl1-0/+21
These keywords were simply not implemented. (cherry picked from commit df041e468baf604f6e2606e5b632aa654b19a65d) fdo#81892: oops forgot the test document (cherry picked from commit bac3cdb1b8afd2fa8fdfea99d1d01dc2770d1ef1) Change-Id: Ib4d07a4b2dfb07cfd56a4ee07d7c14d1c59323f9 Reviewed-on: https://gerrit.libreoffice.org/10674 Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk> Tested-by: Miklos Vajna <vmiklos@collabora.co.uk>
2014-07-29fdo#80486 writerfilter: RTF import: ignore \par inside \ftnsepMichael Stahl1-7/+3
Word can apparently have complex footnote separators, but the domain-mapper only sets a single flag that there is a separator (m_bHasFtnSep), so the only thing that makes sense for \par here is to completely ignore it. (regression from e1afe4318787425dc40f2d0b1f02fa17e925c8da) Change-Id: I32d9b01a0a9248ba646654295a74953a6cb74fb3 (cherry picked from commit 75c5679a96437caa6041d2550562f2a4db80d586) Reviewed-on: https://gerrit.libreoffice.org/10465 Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk> Tested-by: Miklos Vajna <vmiklos@collabora.co.uk>
2014-07-29fdo#77996: writerfilter: RTF import: re-work destination text bufferingMichael Stahl1-45/+102
The problem in the bugdoc is that the ';' style terminator is encoded as {\uc1 \u59 ?}, i.e. inside a group, so when reading the ';' the aDestinationText of the top group is empty and the style name is lost. Or since the style name characters are encoded in the same way, every character is lost once the group closes. The same problem affects some of the document properties. Introduce an abstraction of RTFParserState::aDestinationText so that for every destination only one of these buffers is used, regardless of nested group structures; the aDestinationText buffer is only switched when entering a new destination. Also, the \revtbl and \stylesheet destinations do not contain entries directly, i.e., every entry must be in a sub-group, so remove some special-casing for these; however, for \fonttbl the entries may be in groups or not. (cherry picked from commit 82e17dbb2a16c7653a163139f0eea51faa4d46b8) Conflicts: writerfilter/source/rtftok/rtfdocumentimpl.cxx Change-Id: Ica276a8b730e4a707530471ba27bfdd1582b8890 Reviewed-on: https://gerrit.libreoffice.org/10464 Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk> Tested-by: Miklos Vajna <vmiklos@collabora.co.uk>
2014-07-29fdo#78502: writerfilter: RTF import: handle \u keyword inside levelnumbersMichael Stahl1-3/+8
The ";" terminates an entry and shall not be inserted as text, even if some over-engineered producer encodes it as {\uc1 \u59 ?}. Also, remove the special-casing of the \leveltext destination, since the bugdoc does contain \uc inside it and it's not obvious why that should be ignored. (cherry picked from commit e93f0852477b44df986807860c821319a921b199) fdo#78502: actually empty parameter to getParagraph() is not tested (cherry picked from commit b9dca968c6fd0ab5ca140c65b0e54d153cd34986) Change-Id: I1e19c9df39597cb1b22bbda97853c829d7812e29 Reviewed-on: https://gerrit.libreoffice.org/10396 Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk> Tested-by: Miklos Vajna <vmiklos@collabora.co.uk>
2014-07-25(related: fdo#79319): writerfilter: RTF import: don't lose shapes in headerMichael Stahl1-0/+2
With a horizontal rule, it's possible that there is no \par following it in a header, so RemoveLastParagraph() will delete the paragraph where the shape is anchored (and so the shape as well). Avoid that by adding an extra \par if there is no \par following a shape. (cherry picked from commit 9aa80fcb291083dc2a396db3d1be756eb4a0e54b) Change-Id: I4840417880c98203866c9dcde51627516618f2d0 Reviewed-on: https://gerrit.libreoffice.org/10389 Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2014-07-25(related: fdo#79319) writerfilter: RTF import: fix crash on "fake" pictMichael Stahl1-3/+7
The document has a \pict with {\sp{\sn shapeType}{\sv 1}}, i.e. it's actually a rectangle shape; Word seems to ignore the picture data in this case, so try to do the same. Also consolidate the shape creation in a new function RTFSdrImport::initShape(). (regression from ba9b63d8101197d3fd8612193b1ca188271dfc1a) (cherry picked from commit 2b9e782497cb962d9ca74a851a1389b0e29df49c) Conflicts: writerfilter/source/rtftok/rtfsdrimport.cxx writerfilter/source/rtftok/rtfsdrimport.hxx Change-Id: Iec94852ddc4c1ca3d8284119e6f1818a8dbb4149 Reviewed-on: https://gerrit.libreoffice.org/10387 Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2014-07-21(related: fdo#78502) writerfilter: RTF import: fix invalid string copyMichael Stahl1-1/+1
... in leveltext destination. Change-Id: I74de6d14170130bf33923854a0c9851dc7cc390f (cherry picked from commit b94bd40b915ab32d18d43fc60dfda932e4e00ca8) Reviewed-on: https://gerrit.libreoffice.org/10395 Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2014-07-16fdo#80924: writerfilter: RTF import: fix shapeType PictureFrame importMichael Stahl1-8/+6
For shapeType PictureFrame, a default CustomShape was created and then RTFDocumentImpl::resolvePict() crashes because it actually operates on a previous shape, because in this special case RTFSdrImport::m_xShape is never actually set to the new shape, so contains the previous one. Also the new shape needs to be added to the draw-page, at least otherwise the assertion of the supported service fails because some SvxShape::mpObj weak-reference is dead? This essentially reverts commit 3cab1adf19d553663685e8198f0ec3f258a37c36 (except for the added testcase, which was slightly different because it did not have a "pib" property). (regression from ba9b63d8101197d3fd8612193b1ca188271dfc1a) (cherry picked from commit 083b2b1471fff9e75f4b27a8769f95b8a0ebf5a1) Conflicts: writerfilter/source/rtftok/rtfdocumentimpl.cxx Change-Id: I6539c4286850dff2d8564006487cc765f1d117be Reviewed-on: https://gerrit.libreoffice.org/10351 Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk> Tested-by: Miklos Vajna <vmiklos@collabora.co.uk>
2014-07-16abi#2720 RTF import: handle non-graphic object after a graphic oneMiklos Vajna1-3/+5
Change-Id: I9416b6e7cf3677006215fcbde458ed341c4e3e9e (cherry picked from commit 3cab1adf19d553663685e8198f0ec3f258a37c36) Signed-off-by: Michael Stahl <mstahl@redhat.com>
2014-07-07fdo#73241 RTF import: ignore page break in tablesMiklos Vajna1-0/+4
(cherry picked from commit fdc235126d6d73f47a5b56d453e1d3db8ba3e816) Conflicts: sw/qa/extras/rtfimport/rtfimport.cxx Change-Id: Ibee9fec0f421b4c2ff3d45c861bc3fcfc97cbf15 Reviewed-on: https://gerrit.libreoffice.org/10092 Reviewed-by: Muthu Subramanian K <muthusuba@gmail.com> Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2014-06-27writerfilter: RTF import: fix handling of associated char propertiesMichael Stahl1-14/+27
These are all dependent on the active \lrtch \rtlch \loch \hich \dbch. There does not appear to be a SPRM Id for CJK bold / italic / fontsize. Change-Id: I055ac29700ccd3b32b02c3f7685629254a6c3fd6 (cherry picked from commit fc49c052dbdbb5ab3b0a02a13143705f769b9662) Reviewed-on: https://gerrit.libreoffice.org/9915 Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk> Tested-by: Miklos Vajna <vmiklos@collabora.co.uk>
2014-06-17n#825305: writerfilter RTF import: override style properties like WordMichael Stahl1-3/+21
It would certainly be immediately obvious to any reader of the RTF spec that \sN will apply the style with index N to the current paragraph. But actually, that is not what Word does when it reads \sN... what it really does is to apply the style with index N, and then for every attribute in that style, apply the same attribute with a default value to the paragraph, effectively overriding what's in the style. If that doesn't make any sense to you, well, have you heard the joke about how many Microsoft engineers it takes to change a light bulb? Also, \pard apparently implies \s0. To implement that, change RTFSprms::deduplicate() to recursively look for style SPRMs that are missing in the properties, and put in default ones, currently just for 2 keywords \sa and \sb. This requires changing deduplicate() to be const and return a new value, since it is no longer idempotent, as the erased SPRMs would get defaulted on the next run. While at it, fix RTFValue::equals() which did not compare m_sValue. This fixes the testParaBottomMargin test that was broken by the fix for fdo#70578. Change-Id: I4ced38628d76f6c41b488d608a804883493ff00b (cherry picked from commit 1be0a3fa9ebb22b607c54b47739d4467acfed259)
2014-06-17fdo#70578: writerfilter RTF import: by default style is para style 0Michael Stahl1-0/+24
quoth the spec: "For <style>, both <styledef> and <stylename> are optional; the default is paragraph style 0." Of course in order to do that we need to add support for at least recognizing the \dsN and \tsN keywords to override the default, so that table styles don't become paragraph styles. Change-Id: Ic100768581f9e8c327063ff776fbd61ac4242483 (cherry picked from commit 6c0e1270889deb513f961f864dfc1c02ee8705f4)
2014-06-13fdo#76633: writerfilter: RTF import: do not leak the XShape of imageMichael Stahl1-8/+21
RTFSdrImport::resolve() is called for \picprop and creates an XShape that is stored in RTFSdrImport::m_xShape and also DomainMapper_Impl::m_aPendingShapes; later RTFDocumentImpl::resolvePict() completely ignores that XShape and creates a new one, which is also inserted in the document; the first XShape is effectively leaked. Try to avoid that by re-using the exising m_xShape in resolvePict(). Not sure if there are any problems with doing this, it's all a bit confusing. Change-Id: I98456242acb0766f547eb8f7d877f51d53323f3a (cherry picked from commit ba9b63d8101197d3fd8612193b1ca188271dfc1a)
2014-06-13fdo#76633: writerfilter RTF import: disappear the rectangle shapes on imagesMichael Stahl1-3/+9
If the shape properties are inside \picprop destination, don't set shapeType. (regression from 9f1f7199736e2ae07b34849ba66f61a1ef5782e8) Actually this does not fix the root cause, this is just a work-around, the extra shape is still inserted but it's invisible now. Change-Id: I6cf093de2a5657533f393863ed8010ae083bec16 (cherry picked from commit b7857e5cfe9d5d007785ae93e5505620fc8ed475)
2014-06-12related: fdo#77979: writerfilter RTF import: read encoded font nameMichael Stahl1-4/+5
The font name is encoded in the font's charset given by \fcharset. (cherry picked from commit 04d5a280beeeb6e056df68395dc9c3b3a674361b) Conflicts: writerfilter/source/rtftok/rtfdocumentimpl.cxx Change-Id: Id9520649a1eb3b55f4314e140abda7399f23d925
2014-06-03writerfilter: fix log areaMichael Stahl1-1/+1
Change-Id: Iddedd58dbcdd122ec4177bfdd5e97b9ceca18435 (cherry picked from commit 634f647912c07d366e31bfc168fa1294f1613cd6)
2014-06-03(related: bnc#823675) RTF import: get rid of hacks for \f in LISTLEVELMichael Stahl1-6/+3
These weird hacks are apparently needed only because the \loch \hich \dbch were mapped wrongly; for the list level destination it's only important that the existing fonts are not overwritten. Change-Id: Ie2b9adf332b74c2744e9b1dbc4e878638e5ee078 (cherry picked from commit c087b60b0dd70c4a711ba1b4d556206a136fa468)
2014-06-03RTF import: fix handling of \loch \hich \dbch \ltrch \rtlchMichael Stahl1-5/+18
The logic is not immediately obvious from the RTF spec; let's do what the editengine RTF import does, but without the unnecessary complexity. Change-Id: I60e69130e6e5aed1f5d237f64b1656c3141e402a (cherry picked from commit 36246aa9fb57c9fe4e546c91a8274d8828b1424e)
2014-06-03fdo#79384: replace the work-around with a different oneMichael Stahl1-7/+7
Word will reject Shift-JIS following \loch, but apparently OOo could read and (worse) write such documents, so accept Shift-JIS regardless of run charset type. Change-Id: Ib181956e9f218548a52037dd76fa1d3ecdc006bd (cherry picked from commit d71387ca81b61416b9a7b82cd6cf67d496b81fc2)
2014-06-03fdo#79384: RTF import: fix literal Shift-JIS textMichael Stahl1-4/+30
This is a variable-length encoding, and the second byte may be a RTF syntax character like \, {, }. Change-Id: I813ccafda18388af3bf05eb7ce9a0253c627b1c4 (cherry picked from commit 061190a62fcdbfb3a0b266d5afffbd257a3e692e)
2014-06-02fdo#79384 RTF import: allow { without } in style namesMiklos Vajna1-1/+6
This is not valid, but LO 3.4 supported it, so add a workaround... (cherry picked from commit 6092e2eba3f74c9632f7862b2368b0fcf7732f85) Change-Id: Ib8eefdf41fe9801db6f7e5873eaa1436518912fb
2014-05-26fdo#78900 RTF import: allow \dpxsize inside \dptxbxtextMiklos Vajna1-0/+11
Previously we assumed that they always appear under \do directly. Change-Id: Ie3a978da856986f604a3815d6127abb4191323c0 (cherry picked from commit 21c11ffe254612ac46aa891addacb0024d5b93f0)
2014-05-17Correct common misspellings, and remove some ASCII art along the way.Chris Laplante1-1/+1
Change-Id: I42787db31769e8bde984c5f4f0aa90335e889b1c Reviewed-on: https://gerrit.libreoffice.org/9356 Reviewed-by: Thomas Arnhold <thomas@arnhold.org> Tested-by: LibreOffice gerrit bot <gerrit@libreoffice.org>
2014-05-12writerfilter: unused 'using' in rtftokMiklos Vajna1-2/+0
Change-Id: Ie28d898d490ff695143e9f09502fa10db092ccc7
2014-05-08Fix 'outset' and 'inset' table border type import in DOCX and RTFAdam Co1-2/+2
In the past, LO did not support 'outset' and 'inset' border types for tables, so when encountering them - LO converted them to other types of border. Now that LO supports it - DOCX and RTF filters were changed to import these border types correctly. DOC filter was not changed, because creating a proper DOC sample file that has these border types (needed for the 'bordertest.hxx' file) was not possible right now. So at least DOCX and RTF filters are fixed. Change-Id: Ida2449d45a0ac138388f3cbfeb41657db1d4cda9 Signed-off-by: Michael Stahl <mstahl@redhat.com>
2014-05-04writerfilter: fix indentation in rtfdocumentimplMiklos Vajna1-3507/+3974
Change-Id: I5588e84a486ca751e94e097bc8bceaa35fe8b969
2014-04-18fdo#75735 RTF import: fix COW when writing a nested structureMiklos Vajna1-1/+1
Regression from a48e2fd9049797110b3b2505c363557284987ca8 (fdo#44736 - convert RTFSprms to a copy-on-write structure., 2012-12-07) Change-Id: I2538f440e29cef6d40db2ea914e4afcbfe411890