summaryrefslogtreecommitdiff
path: root/sw/qa/extras/rtfimport
AgeCommit message (Collapse)AuthorFilesLines
2014-11-17CppunitTest_sw_rtfimport: indentation fixesMiklos Vajna1-3/+3
Change-Id: I696489a60729426b9b14df6c9e79a2d8247d21fb
2014-11-16Improve rtf import filter to handle Chinese suffixes of numbered lists.Mark Hung4-0/+627
Currently rtftok doesn't handle multibyte string as destination text very well. For example, RTF files created by MSO 2010 Traditional Chinese version use CP950 (aka BIG5) for unicode to ansi conversion. When a Chinsese numbered list was picked, the Chinese dot ( unicode 0x3001, big5 0xa142 ), was used by default as a list number suffix. However when it is imported , only a single B (0x42) were left. The theory of the patch is to collect both hex string and normal character with m_aHexBuffer, and convert it into OUString as late as possible. It allows prefixes and suffixes to be imported from RTF files created by MSO 2010 TC correctly. Reviewed on: https://gerrit.libreoffice.org/12435 Conflicts: sw/qa/extras/rtfimport/rtfimport.cxx Change-Id: I63062da39bf36ea27ec11e5d0eb1d1abf5018d96
2014-11-16fdo#83204 RTF import: handle \pard<para props> after \bkmkstartMiklos Vajna2-0/+15
Change-Id: I4f5f0f653f2ce7782ec1d1fc5ef550a21a9c1d35
2014-11-08fdo#84645 RTF import: set DontBalanceTextColumns=true for the last section ...Miklos Vajna2-0/+13
... 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. Change-Id: Ib30f9b386e204b8b2987832ab17ee0cc53b3f0bc
2014-11-07Correct number format mapping for CJK numbered lists in rtf/doc/docx filters.Mark Hung1-1/+0
Reviewed on: https://gerrit.libreoffice.org/12252 Change-Id: I2d8760c7ecb3677464e167528b2424aaca19a0d7
2014-11-07indentation fixesMiklos Vajna1-32/+16
Change-Id: Ia548dd0382a6991a2d9914bf0d1fc1286319c5e9
2014-11-05fdo#85812: RTF import: better fix for run type in new groupsMichael Stahl2-1/+94
Apparently Word treats \ltrch \rtlch differently from \loch \hich \dbch when groups are opened. Change-Id: I257712521e8e77fa66e76857489797ecc675506e
2014-11-05fdo#85812: RTF import: fix run type in new groupsMichael Stahl2-0/+18
Apparently the run type resets to LTR in a new group. (regression from fc49c052dbdbb5ab3b0a02a13143705f769b9662) Change-Id: I61c0fcbe4e44b488a14cc78823063a1a1ad4f4b1
2014-11-01fdo#82512 RTF import: fix position of column breakMiklos Vajna2-0/+16
Change-Id: Ib0f39c4af7cc32d0f4491f13ea207d90a449a47d
2014-10-26fdo#82076 RTF import: handle footnote in table cellMiklos Vajna2-0/+24
Change-Id: I69def7936c320e93db5d4504922d52346caaf9cf
2014-10-25fdo#82859 RTF import: fillColor is unsignedMiklos Vajna2-0/+31
Otherwise ARGB 0xFFFFFFFF would turn into black. Change-Id: I690f34d888ca9a013e8ce1af2c7ef8ed88ee28b0
2014-10-25fdo#85179 RTF filter: import image borderMiklos Vajna2-0/+40
Also adjust CppunitTest_sw_htmlexport that implicitly tested that there is no color around the image. Change-Id: I8e14dfa7e7be80c4f8c492999071decae6a492e8
2014-10-19fdo#83464 RTF import: \plain should reset \rtlch and \hich as wellMiklos Vajna2-0/+33
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. Change-Id: Ia6b0bdf25563dd5300e108b46731751f0886f67d
2014-10-14fdo#82071 RTF import: get rid of unexpected underlining in TOC fieldMiklos Vajna2-0/+57
Regression from commit 9679e9c23216decb5f9f25f85b04cb3f25211111 (fdo#69649 Fix for pre-rendered Table Of Contents, 2013-12-30), now that we handle hand-edited TOC, it's necessary to properly track correctly if a property came from a style or as a direct formatting. Fix RTFDocumentImpl::getProperties() to detect direct formatting that cames from a char style and would result in attribute tokens. Change-Id: Iab5a14770de43249961c280a5dc698200abc8f49
2014-10-10fdo#84679 RTF import: fix paragraph spacing handling in tablesMiklos Vajna2-0/+23
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. Change-Id: I0673408088d9d83768f0780ea92ece87913d03f3
2014-09-30sw: when getting a property value in a unit test, a void result is a bugMichael Stahl1-5/+5
Change-Id: Iba0e43c198c3380426d0572427c591f4d77ba09b
2014-09-30actually the LineStyle property is *write-only*Michael Stahl1-1/+2
... which is highly suspect in any case, but whatever. Change-Id: Ibeff36a7d30750fc33e9729b067f86b3901d1c76
2014-09-12fdo#44984 RTF import: handle form fields inside tablesMiklos Vajna2-0/+40
Change-Id: I84b3d5186e99b8313cfb32398869de028a267b49
2014-09-11fdo#82114 RTF import: fix handling of first page in non-first sectionMiklos Vajna2-0/+23
Change-Id: If06c6bcdda97447e6014223d997c7ff8abd64b48
2014-09-07RTF import: adapt getProperties() to createStyleProperties()Miklos Vajna2-0/+18
Change-Id: I8561aa1532a863bf7f8dd44fbd40e8e0187e4967
2014-09-06fdo#82078 RTF import: fix bold text spilling over to non-bold textMiklos Vajna2-0/+20
Regression from commit 41890bf714803969515578b47e63fa9730ea7090 (fdo#54473 fdo#57133 fix RTF import of character styles, 2012-12-04), the problem was that the style undoing magic introduced in 1be0a3fa9ebb22b607c54b47739d4467acfed259 (n#825305: writerfilter RTF import: override style properties like Word, 2014-06-17) was not used for character styles. Change-Id: Id31cfd5574a83bcf2895f0c2fd496fa60791cbb3
2014-09-03RTF export: handle wrap polygon of Writer picturesMiklos Vajna2-62/+0
Change-Id: I712d8f73466c662659a7b76ff363a44a71bba324
2014-08-29fdo#79959 RTF import: trim whitespace around style namesMiklos Vajna2-0/+10
Change-Id: Id23cbd62b057442c577fef124a5705e4d551076f
2014-08-28fdo#74229 import RTF_TRGAPHMiklos Vajna2-0/+43
Regression from commit c4b91ae3178011c66c76c711c1a6469ba658872e (fdo#55525 import RTF_TRLEFT, 2012-11-13). Change-Id: I90f2c6399cfaf8399de0cf3488a23af6cc84710d
2014-08-17remove executable bitsThomas Arnhold1-0/+0
Change-Id: Iec785ae538de81325812b1e6fe33115789b39770
2014-08-16RTF import: handle pWrapPolygonVertices shape propertyMiklos Vajna2-0/+63
Change-Id: I512713e9b9aa1ceb3d98af7a1a6abd144e370689
2014-08-13RTF import: fix handling of RTF_SHPFBLWTXTMiklos Vajna2-0/+28
Commit 6cac123a8de8357cf11d9b5f818233889d729939 (fdo#45183 import RTF_SHPFBLWTXT, 2012-12-27) fixed this already once in the past -- fix it again, this time with a testcase. Change-Id: I0cbbfb1ba4eef42b2ee32f6f77065afaad3ddc1b
2014-08-10fdo#82106 RTF import: fix missing tab after special footnoteMiklos Vajna2-0/+10
Change-Id: I5ea45dbed652231acdcc3632ced728ed8bcb621a
2014-08-02fdo#80742 RTF filter: import RTF_OUTLINELEVELMiklos Vajna2-0/+13
Change-Id: I49d94bd72af610e88128cd405e4786d2e9ba65ed
2014-08-02fdo#81944: writerfilter: RTF import: don't drop fonts in stylesheetMichael Stahl2-0/+28
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
2014-08-01RTF import: fix as-char anchored OLE objectsMiklos Vajna2-2/+194
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. Change-Id: I0f7e1a71052f337793d6f844fe5476c3868c03f4
2014-08-01fdo#81892: oops forgot the test documentMichael Stahl1-0/+26
Change-Id: If9a9a0a75a35ce4808228f554d7d186a3a3daa4a
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
2014-08-01fdo#81892: writerfilter: RTF import: add support for table row alignmentMichael Stahl1-0/+9
These keywords were simply not implemented. Change-Id: Ib4d07a4b2dfb07cfd56a4ee07d7c14d1c59323f9
2014-07-28(related: fdo#81033) writerfilter: default tab fill character is spaceMichael Stahl1-1/+1
This avoids an ugly "Character" box in the dialog with a null byte in it. Change-Id: Iee35a8e1bd6b57fb4eb8ae06722bd79ee1d5d8de
2014-07-28fdo#81033: writerfilter: RTF import: fix tab stop inheritance from styleMichael Stahl2-0/+26
For RTF, the tab stops that are set directly on the paragraph are the tab stops the paragraph has effectively; there is no equivalent of OOXML <w:tab w:val="clear" w:pos="4536"/> that would override a tab stop of the applied style; that is done by simply omitting the tab stop. It would perhaps be possible to implement something to synthesize a NS_ooxml::LN_Value_ST_TabJc_clear in the RTF tokenizer for this case, but it's simpler to just generally disable domain mapper's InitTabStopFromStyle() for RTF. Change-Id: I7b0581be8db19ffda81c8d1da290abf0a0f69529
2014-07-27indentation fixesMiklos Vajna1-2/+1
Change-Id: I0a0f04d0f0e008e8947a5a7e3ed6083c1589e61b
2014-07-22fdo#80486 writerfilter: RTF import: ignore \par inside \ftnsepMichael Stahl2-4/+7
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
2014-07-22fdo#77996: writerfilter: RTF import: re-work destination text bufferingMichael Stahl2-0/+57
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. Change-Id: Ica276a8b730e4a707530471ba27bfdd1582b8890
2014-07-19indentation fixesMiklos Vajna1-6/+3
Change-Id: I2c1f99128698778233b0bd46256b571d3f794713
2014-07-19fdo#78502: actually empty parameter to getParagraph() is not testedMichael Stahl2-1/+2
Change-Id: Ia0423eaa6454480979795f9443296919c44a0051
2014-07-19fdo#78502: writerfilter: RTF import: handle \u keyword inside levelnumbersMichael Stahl2-0/+17
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. Change-Id: I1e19c9df39597cb1b22bbda97853c829d7812e29
2014-07-18(related: fdo#79319): writerfilter: RTF imoprt: don't lose shapes in headerMichael Stahl2-0/+78
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. Change-Id: I4840417880c98203866c9dcde51627516618f2d0
2014-07-18writerfilter: import RTF_NOCOLBALMiklos Vajna2-0/+15
Change-Id: If2efab82c0adc2f3dc52733c335693565c350bfa
2014-07-13fdo#80905 SwXTextFieldMasters::hasByName(): sync with SwXFieldMasterMiklos Vajna2-0/+22
Normally a mail merge field has a name like "css.text.fieldmaster.DataBase.<datasource name>.<table name>.<column name>", however this isn't enforced: just "css.text.fieldmaster.DataBase.TEST" is also accepted (even if its semantics are ~undefined). If SwXFieldMaster::setPropertyValue() allows setting such a field master name, then SwXTextFieldMasters::hasByName() should not ignore such field masters that have no dot in their name ("TEST") or use "Database", not "DataBase", otherwise (sane) client code in writerfilter ends up with hasByName() returning false, but setPropertyValue() throwing an exception, because the field master does have such a name. This fixes DOCX/RTF import of multiple mail merge fields with the same field command. Change-Id: I498eabace25f8e466b3504ba13fa3060d4ba22da
2014-07-05fdo#73241 RTF import: ignore page break in tablesMiklos Vajna2-0/+14
Change-Id: Ibee9fec0f421b4c2ff3d45c861bc3fcfc97cbf15
2014-07-05make rtfimport pass again (testFdo52989)Norbert Thiebaud1-1/+1
Change-Id: I5166027b8bff0e1c293a3d0d6dab4c3758c27954
2014-07-05rtfimport test: add message with the value found on top of expectedNorbert Thiebaud1-1/+4
Change-Id: Ic17d66bd2b9f4cc4124b13ef7c962649d83ee60c
2014-07-01Activate the "suspicious cast to sal_Bool" parts of loplugin:salboolStephan Bergmann1-2/+2
Change-Id: I78a368ef2899b2462251b45a327fc7b1f31fe764
2014-06-20RTF import: handle column break at the very start of the documentMiklos Vajna2-0/+7
Change-Id: Ib7d166bf1b1e5d5216d822b2b0396aa4dc535c6f