summaryrefslogtreecommitdiff
path: root/writerfilter
AgeCommit message (Collapse)AuthorFilesLines
2014-12-17fix Windows buildLászló Németh1-1/+1
Change-Id: I690163d7ab6d62c93da33d416e8757311f5d35c1
2014-12-16(related fdo#84685): writerfilter: RTF import: support \tc TOC entryMichael Stahl2-1/+10
Change-Id: Icda252e1f092707728d3a24df50fba7080e759bb (cherry picked from commit 1dd1dfc152c7cbeb374fe4f38b08c6af9cef2c06)
2014-12-16fdo#84685: writerfilter: RTF import: support \xe index entryMichael Stahl2-0/+19
Change-Id: Ia957541a5997961aa86b2eb8537ebd29d3092691 (cherry picked from commit f14e6e06b9e3c82c267649d63512a3538e5ee2f5)
2014-12-14fdo#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. Change-Id: Iffee41066d42822b699c478821645b9742df3f58 (cherry picked from commit 4568d1d298bf4fc98dcd86384743a04587a2fe6f)
2014-12-08fdo#86750 RTF import: fix table of contents linksMiklos Vajna1-0/+9
Change-Id: I0f3d35a0e64c9ce5646fa63eda317bee42de5540 (cherry picked from commit 4517c94000153eab6c034ea548698953dd93f794)
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)
2014-11-26always pass bookmark name through to domainmapperCaolán McNamara1-8/+5
the rtf doc has three bookmark starts but only two matching bookmark ends. The tokenizer has three starts 0, 1, 2, but 0 is missing an end. Without the end of 0, the mapper never inserts an entry for it, so later inserts the start of rtftok index 1 as mapper index 0, and passing the end for a bare "1" cannot be found by index. If we pass the name then it finds it by name as mapper index 0 and all is well. Change-Id: I344db84e4f1c7d55fca59cdfe692080c7d0b8033 (cherry picked from commit 2b54caceab9d975bffa7e24bf732cb877b16632f) Reviewed-on: https://gerrit.libreoffice.org/13133 Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk> Tested-by: Miklos Vajna <vmiklos@collabora.co.uk>
2014-11-24fdo#85889 handle pc, pca and mac rtf keywords in writerfilterAndras Timar1-0/+12
Change-Id: Ic54f2233a37562bdc516e440af0b4b7973f56342 (cherry picked from commit 7839633fb356285652ed96f4bf3f85bcd5b561a4)
2014-11-22fdo#82006 RTF filter: import \sbauto and \saautoMiklos Vajna1-0/+8
Change-Id: Iabff543c8191fc86dceb9274ea1552f60d73dabd (cherry picked from commit bb77fd64f9219f1b8f990f5041d81cfddd021213)
2014-11-22RTF import: fix handling of multiple \lfolevel control wordsMiklos Vajna1-1/+1
Change-Id: I242853d491c2ef83f192486fa6fe5a3407700047 (cherry picked from commit 74249cb6f4f52b7c10ebaa92f943920f6f94aaf4)
2014-11-20DOCX filter: import <w:startOverride>Miklos Vajna1-0/+11
Change-Id: Id95518c7ea38a974593a1880b4ef581ff49bcb90
2014-11-19Fix rtf outline importing issue.Mark Hung1-1/+7
When importing RTF files, the outline is treated as normal numbering list. Open the tools>chapter, outline doesn't correspond to heading styles correctly. This patch is to handle RTF keyword \s in a \listlevel. The patch use style name as its id so that is consistent with the one already used by StyleSheetEntry. Change-Id: I5ab6602b5ce64ca65ec08e0adb34d60ae7293650 Reviewed-on: https://gerrit.libreoffice.org/12960 Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk> Tested-by: Miklos Vajna <vmiklos@collabora.co.uk>
2014-11-19writerfilter: indentation fixesMiklos Vajna1-7/+7
Change-Id: Ib9bee587931cd020848b033ce4429f36d04e61b1
2014-11-19DOCX import: handle <w:lvlOverride> without <w:lvlText>Miklos Vajna1-1/+2
Change-Id: I0b941bd7a733408655db192b8608ed3987b9c1fc
2014-11-19Resolves: fdo#86451 guard all the tops post popCaolán McNamara1-71/+85
Change-Id: Ic89edb94c6c12a66fd46e0630115a458857cc6cc
2014-11-18Fix outline numbering for ooxml import filter.Mark Hung1-5/+5
Conflicts: sw/qa/extras/ooxmlimport/ooxmlimport.cxx Reviewed on: https://gerrit.libreoffice.org/12519 Change-Id: Ifd8a562bcee4f57cc99ed3215e6d8d6dd95216b0
2014-11-17fdo#85542: fix DOCX import of overlapping bookmarksBjoern Michaelsen3-14/+29
This was broken by 345a3a394e082595924bf219796627f6c00ae2dd. Kill the static variable and instead have some more state in the implementation. Still not ideal, but at least fixes the regression. Change-Id: I562f7d88a1983bd0ec2e01d6bb1e4a53551d0953 Reviewed-on: https://gerrit.libreoffice.org/12491 Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk> Tested-by: Miklos Vajna <vmiklos@collabora.co.uk>
2014-11-17DOCX import: handle <w:numId> from parent styles as wellMiklos Vajna1-2/+27
Without this, we may miss the <w:numId> of a paragraph and set no numbering style name; and that leads to not restarting numberings when needed. Change-Id: I9a4896266c5b7f1d7cc2adc43b84e227c004da7c
2014-11-17sal: clean up public headers with include-what-you-useMichael Stahl11-0/+11
Sadly cannot forward declare "struct {...} TimeValue;". rtl/(u)?string.hxx still include sal/log.hxx but removing osl/diagnose.h was painful enough for now... Change-Id: Id41e17f3870c4f24c53ce7b11f2c40a3d14d1f05
2014-11-17loplugin:implicitboolconversionStephan Bergmann1-1/+1
Change-Id: I389fa692e4a8f99d8de21cf0af3f2a7f0ac1a6f5
2014-11-16Improve rtf import filter to handle Chinese suffixes of numbered lists.Mark Hung1-4/+3
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-16writerfilter: this is expected to be UTF-8Miklos Vajna1-2/+1
Change-Id: I7408be90f1ff552f4bb33e8a89d4b9075634e3e5
2014-11-16fdo#83204 RTF import: handle \pard<para props> after \bkmkstartMiklos Vajna1-0/+2
Change-Id: I4f5f0f653f2ce7782ec1d1fc5ef550a21a9c1d35
2014-11-16writerfilter: these are expected to be UTF-8Miklos Vajna5-8/+8
Change-Id: I8cd2ce341996a219ee885969de3482be422730b3
2014-11-15RTF import: handle right-to-left tablesMiklos Vajna1-1/+1
Change-Id: If2e60557b7551839c344d56cb3a720ae3659e93c
2014-11-14fdo#86023 - O[U]String needs a 'clear' methodBrij Mohan Lal Srivastava4-4/+4
Added clear() method to OString and OUString class, Updated appropriate call-sites. Change-Id: I0ba97fa6dc7af3e31b605953089a4e8e9c3e61ac Signed-off-by: Stephan Bergmann <sbergman@redhat.com>
2014-11-12Fix common typos. No automatic tools. Handmade…Andrea Gelmini5-5/+5
Change-Id: I1ab4e23b0539f8d39974787f226e57a21f96e959 Reviewed-on: https://gerrit.libreoffice.org/12164 Reviewed-by: Noel Grandin <noelgrandin@gmail.com> Tested-by: Noel Grandin <noelgrandin@gmail.com>
2014-11-09test for membership should be 'not in'Miklos Vajna2-4/+4
Change-Id: I493bad18ed3f728bcf42049377d7f4c6039264c8
2014-11-08fdo#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. Change-Id: Ib30f9b386e204b8b2987832ab17ee0cc53b3f0bc
2014-11-08writerfilter: SW_DEBUG_RTF_PASTE_{TO,FROM} is expected to be UTF-8Miklos Vajna1-2/+2
Change-Id: Ibcfa71cf9820db0b397a88e22aa6cc964048b71c
2014-11-07Correct number format mapping for CJK numbered lists in rtf/doc/docx filters.Mark Hung2-19/+77
Reviewed on: https://gerrit.libreoffice.org/12252 Change-Id: I2d8760c7ecb3677464e167528b2424aaca19a0d7
2014-11-07writerfilter: handle ooxml:CT_TblPrBase_bidiVisualMiklos Vajna1-0/+7
Change-Id: I619a6b161e5ed7e902406b288552b06fe7da487e
2014-11-07DOCX import: fix rounding error in table cell widthsMiklos Vajna1-2/+2
Change-Id: I733fd4b998ba4d0bde2f91f2b3d76205f0dc8020
2014-11-06Revert "use the new OUString::fromUtf8 method"Stephan Bergmann6-12/+12
This reverts commit 05050cdb23de586870bf479a9df5ced06828d498, not all places that use e.g. OStringToOUString to convert potential UTF-8 are guaranteed to fulfil the prerequisites necessary to use fromUtf8 (and some places like e.g. in codemaker are happy with the best-effort effect of OStringToOUString's OSTRING_TO_OUSTRING_CVTFLAGS).
2014-11-06DOCX import: fix <w:tblW w:type="auto"/> handling when cells have fixed widthsMiklos Vajna1-10/+1
Commit 74c5ed19f430327988194cdcd6bdff09591a93fa (DOCX import fix for table with auto size, 2013-06-26) correctly recognized that in case the width type is auto, that doesn't always mean text::SizeType::VARIABLE. However, when the size is fixed, then we should simply not do anything, and that'll lead to the right behavior (by setting the column separators on each row), don't try to be smart and try to set TablePropertyMap::TABLE_WIDTH here. Change-Id: I997b88e5fa34bbabe7c6940879c81a1d62d69043
2014-11-06use the new OUString::fromUtf8 methodNoel Grandin6-12/+12
Change-Id: I771004b7ccab3344a67e827e45bc34c22ffa5f77
2014-11-05fdo#85812: RTF import: better fix for run type in new groupsMichael Stahl1-2/+3
Apparently Word treats \ltrch \rtlch differently from \loch \hich \dbch when groups are opened. Change-Id: I257712521e8e77fa66e76857489797ecc675506e
2014-11-05fdo#38835 strip out OUString globalsNoel Grandin6-69/+69
they are largely unnecessary these days, since our OUString infrastructure gained optimised handling for static char constants. Change-Id: I07f73484f82d0582252cb4324d4107c998432c37
2014-11-05fdo#85812: RTF import: fix run type in new groupsMichael Stahl1-0/+2
Apparently the run type resets to LTR in a new group. (regression from fc49c052dbdbb5ab3b0a02a13143705f769b9662) Change-Id: I61c0fcbe4e44b488a14cc78823063a1a1ad4f4b1
2014-11-04Use comphelper::SequenceAsVectorMiklos Vajna2-8/+3
Change-Id: Iaf5fb72b065cc0d2a412b027d41d7618654d30b1
2014-11-03be a little more consistent stylewiseCaolán McNamara1-1/+1
Change-Id: If1d822e0e6c87e792ff4a769a525e161505325c9
2014-11-02unused includes in RTF filter and related filesMiklos Vajna8-47/+0
Change-Id: Id13e10f2ceed3985c78ccc542e6677eccc0cb1c7
2014-11-01fdo#82512 RTF import: fix position of column breakMiklos Vajna1-0/+8
Change-Id: Ib0f39c4af7cc32d0f4491f13ea207d90a449a47d
2014-11-01coverity#1000600 Division or modulo by float zeroCaolán McNamara1-11/+18
Change-Id: If39679b54ef1bb0a7af794c2f7a6186ebd69c2e0
2014-11-01oox: introduce W_TOKEN() macroMiklos Vajna1-4/+4
It was inconsistent that when parsing <a:foo> elements, A_TOKEN(foo) was available, but for <w:foo> elements there was no W_TOKEN() macro. Also, there were two manual variants (NMSP_doc|XML_foo or via OOX_TOKEN(doc, foo)), replace both of them with W_TOKEN() for easier searching. Change-Id: Ic5cd027f07518535b92671ffe3c486016a3f9f0a
2014-10-31Removed duplicated includesAndrea Gelmini3-3/+0
Change-Id: I5362d997bfa086c9fb1726efcb15132a966684f6 Reviewed-on: https://gerrit.libreoffice.org/12160 Tested-by: LibreOffice gerrit bot <gerrit@libreoffice.org> Reviewed-by: Michael Stahl <mstahl@redhat.com>
2014-10-31Use oox::drawingml::convertEmuToHmm()Miklos Vajna4-17/+11
And get rid of the writerfilter copy, that does no rounding. Adjusted testcases: - testFdo80555: 245 -> 247 (should be 246.944444444, so a good change) - testDMLGroupShapeChildPosition: roundtripped values are now closer to the initial ones, so also a good change Change-Id: I4dec7857a0df77face01b7a8ba1da7c647a24b6c
2014-10-30Fixed typos. No automatic tools (sed, and so on).Andrea Gelmini1-1/+1
Change-Id: Ia43976d84eede6f699381bc4f3daf89b95e4cb4f Reviewed-on: https://gerrit.libreoffice.org/12150 Reviewed-by: Bryan Quigley <gquigs@gmail.com> Reviewed-by: Michael Stahl <mstahl@redhat.com> Tested-by: Michael Stahl <mstahl@redhat.com>
2014-10-30fdo#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. Change-Id: I0952f568a933c137bd03070759989cac3517d8b9
2014-10-29coverity#1202781 Division or modulo by zeroCaolán McNamara1-1/+2
Change-Id: I2908c57badd079c8f19c679f40ed815ce2cba374