103 Commits

Author SHA1 Message Date
Miklos Vajna
c7884509a8 fdo#67498 RTF import: fix missing margins vs continuous section breaks
The document had 3 sections, separated by continuous section breaks.
Previously only margins from the last section were imported, this way
the first page had default margins.

Now margins are also applied when we hit continuous section breaks. This
way margin values from the last section break affecting the page wins. A
later commit could improve this further by setting the minimum of these
and setting a section margin for each non-minimal sections.

Change-Id: I4d9a4585e795220533909bd1d467d933caaa0d71
2013-08-05 17:38:20 +02:00
Tor Lillqvist
3e48277e36 Convert utf-8 bytes to \xNN hex representation
Change-Id: I5d1cc0331278f09a6e32345980c660d877d606fa
2013-07-31 12:46:45 +02:00
Fridrich Štrba
c7a8462b83 Revert "fdo#66246 fdo#66395 BOM for MSVC with UTF-8 unfriendly codepage"
This breaks tinderbox builds. Better fix on the way.

This reverts commit ded871e9c1a69f640d6283ae6f79820689f0d612.
2013-07-31 11:36:27 +02:00
Isamu Mogi
ded871e9c1 fdo#66246 fdo#66395 BOM for MSVC with UTF-8 unfriendly codepage
MSVC misinterprets UTF-8 source code without BOM as ANSI/OEM codepage.
For that reason if local codepage is unfriendly to UTF-8, it sometimes
causes compilation error.

Change-Id: I8acd5500e581e020fd60b5a2ec20629f92fdf87c
2013-07-31 09:29:07 +01:00
Miklos Vajna
83e0489217 fdo#67365 testcase
Change-Id: I921eda30f60e5466e381922193c2a46be10ad65c
2013-07-27 01:09:46 +02:00
Miklos Vajna
e849f5d84a RTF import: fix groupshape import when shapes don't contain text
Without this, the groupshape itself was created, not it had no child
shapes.

Change-Id: I5d3276498eb3ffe840f3d42dad16661849596da4
2013-07-26 12:55:02 +02:00
Miklos Vajna
50a76af9d1 Related: bnc#820504 RTF import: don't anchor shapes TO_PAGE
This is the RTF equivalent of f5b7acac624f07fa95835b6054b8d295901bb1dd,
which avoided TO_PAGE-anchored shapes in the VML importer.

Change-Id: I58a5cdb311ac43ddba00bc441005fb37a4899cee
2013-07-26 11:13:44 +02:00
Miklos Vajna
bb67e709b7 fdo#64637 RTF import: handle multiple RTF_COMPANY
Instead of unconditionally calling addProperty(), first check the
existence with hasPropertyByName() and call setPropertyValue() instead,
if necessary.

Change-Id: Ie0a075bbfe6eaa1f66726c456105dcdef9001d30
2013-07-23 12:37:06 +02:00
Miklos Vajna
431853bfae fdo#54900 RTF import: support setting para align after text
Both Word and Writer typically write all paragraph properties before the
first text in each paragraph, but at least for paragraph alignment, it's
valid to write them at the end.

Change-Id: I0337e63678ad45c662a204ab2fc59378607abe74
2013-07-15 11:44:35 +02:00
Michael Stahl
4721fbbccd writerfilter: move the crash test file to "pass" directory
Change-Id: I8a97eac789e3e8234673de87653b78c39dafe14c
2013-07-10 13:08:37 +02:00
Michael Stahl
b3944f124a rhbz#960019 : RTF import: handle extra groups in listoverride entry
This crashed because for a single listoverride entry 2 SPRMs were sent
to the domain-mapper, and the second one was empty.

Change-Id: Ic41ffd8bd4edcff065f49ecef3464efedd909d63
2013-07-10 12:44:34 +02:00
Miklos Vajna
f6a00c8848 fdo#66565 RTF import: don't produce cell widths smaller than MINLAY
In case we have a table of a given width and the second (or later) row
has fewer cells, we have to add a fake cell to such a row. However, it
doesn't make sense to do this when the difference is only a few twips:
we can't create such a small frame inside the cell later anyway.

Regression from c3b0f13546b30e5db3aecd311c7178e4e0933208.

Change-Id: Ibc0f02d4184b58bd423c3405e786e1ec25b9dd13
2013-07-09 12:58:55 +02:00
Miklos Vajna
2e11cb276e Related: fdo#66040 RTF import: by default, do create a group shape for \shpgrp
The bugfix was just for the special case when we must create textframes
due to the contained tables, this one add support for the default case
when we want a real group shape.

Change-Id: I74b77b233235959266a24660c970a79e41d8b272
2013-07-08 17:16:10 +02:00
Miklos Vajna
4108f28520 fdo#39001 RTF import: fix fake empty page at the end of the doc
In case we have a \sect, there was no \sbknone (so it counts as a page
break as well) and there is nothing after it, we should not make extra
efforts to make that have some effect, but adding at least one empty
paragraph to that new page.

Change-Id: Ibcbecabcb590ed34ef96a97698e4ab8f638d3483
2013-07-05 12:02:07 +02:00
Miklos Vajna
d892671c11 fdo#47802 testcase
Change-Id: Ib3e399efb0d1116473bc5ff0e1b858b2cfa4aec8
2013-07-01 11:43:57 +02:00
Miklos Vajna
55162d7422 bnc#823675 RTF import: fix import of numbering bullet associated font
There were multiple problems here:

- \f had a special handler for the listlevel destination, \af had not
- in case of multiple \f or \af, the first one is used for the bullet
  font
- in case only \af is used for the bullet font, its value should be used
  for \f as well

Change-Id: I6631504c1aa9f2e0792a3469a5fdce5b7bd49518
2013-06-26 17:30:02 +02:00
Miklos Vajna
a8ee2ee752 fdo#66040 RTF import: initial groupshape support
There are two cases here: if the shapes contain tables (or other
Writer-specific features), we should use text frames and we should not
create the actual group shape, as Writer textframes can't be part of
such group shapes.  The other case is when the shapes contain simple
text, OTOH there are groupshape-level transformations defined, in that
case we should choose drawinglayer rectangles and actually create a
group shape.

This commit implements support for the first case only.

Change-Id: I9dc99b0711ce5c7a29ea0b14539df0121f9de3d0
2013-06-25 15:35:02 +02:00
Miklos Vajna
ddddfe8d6f bnc#823655 fix RTF import of freeform shape coordinates
E.g. 0,1 was imported as 1,0, as we did not differentiate between not
having the coordinate yet and having it as zero.

Change-Id: Ia5fbbcc791dc9c6866ffd4c146793690661d81b4
2013-06-24 15:11:15 +02:00
Miklos Vajna
c6a941b51b bnc#823655 RTF import: ignore styles without a type
Regression from 29dcdf6b56f8dbc1b7de0478afb04122f8dbf0f9.

Change-Id: I970c0e7b3652d7e6f093815b90e04e0c45904b28
2013-06-21 16:11:01 +02:00
Miklos Vajna
2af60e2eff bnc#825305 RTF import of fFilled shape property
Change-Id: Iaa2ff9d5d1a28aec046f885acecbd1a44c734ec0
2013-06-18 17:13:39 +02:00
Miklos Vajna
f0ed219c8f sw: move the textframe-table testcase from rtfimport to rtfexport
Change-Id: I7e9d26ec1f47d16e35e24fc4bd9482f5d899e79c
2013-06-16 18:34:09 +02:00
Miklos Vajna
aa0f3ca1cd RTF import of fFitShapeToText shape property
Change-Id: I1d0cd0d34284e6ecabd0b4dc9bf25bc31b7ff4c1
2013-06-16 12:11:03 +02:00
Miklos Vajna
843735fca9 testcase for 4ab658b56f5c6ff0082d38d8ace1924d11e30e96
Change-Id: Ic36463f127eb266e74e7ea4445fc1c8a3126bfe0
2013-06-16 01:29:01 +02:00
Miklos Vajna
9d640dc6ad RTF filter: import posh/posv property of shapes
Change-Id: I55eccccf7f9ed06bba1ada18574890b5bee296f4
2013-06-15 19:32:14 +02:00
Miklos Vajna
2ade071269 fdo#62044 RTF import: don't overwrite existing styles when pasting
Change-Id: I80a83caebc8fa3f038cf2ff080c6c6ec8e93fb70
2013-06-04 12:42:20 +02:00
Miklos Vajna
14e163b0ca import RTF_BACKGROUND
That destination contains a whole shape, but the only interesing detail
of it is the fill color, which is the page background color.

Change-Id: I9527db8954c48c980f8734c9bbeaa6ccd3c48fbc
2013-05-29 10:25:28 +02:00
Miklos Vajna
ec8e012e98 testcase for bfb93ffc6d72d22a833acf9d8c9d166153dad7c0
Change-Id: If61739d54cb2572f20b118a2cf56ab2bd0f306e5
2013-05-27 10:48:25 +02:00
Miklos Vajna
b40fe8e5a5 bnc#818997 RTF import: don't ignore page breaks between shapes
Change-Id: Ief71ba9a3c60356714e73d08e88d0a3105b17b1a
2013-05-21 15:18:45 +02:00
Miklos Vajna
4a816a816e fdo#62977 allow SAL_MAX_INT16..SAL_MAX_UINT16 when importing RTF_U
Change-Id: Ie36d5881b0ebe8c38526690ca27d02bfb7af7829
2013-05-15 10:30:37 +02:00
Miklos Vajna
95d8fa0bcd bnc#816603 testcase
Make sure that at least full-page-width multi-page floating tables are
imported on multiple pages.

Change-Id: Ifb974d50c50b1495634ac2652a3ae46235bb5f52
2013-05-13 12:19:18 +02:00
Miklos Vajna
b4a74af711 testcase for 133f4d750a46dc67797d2f23f25a1bb39620d59f
Change-Id: Ibdb06d50ca79b2882ad7bd984e30beb09e7c7b95
2013-05-11 18:10:16 +02:00
Michael Meeks
62badf3828 Move to MPLv2 license headers, with ESC decision and author's permission. 2013-04-22 09:37:38 +01:00
Miklos Vajna
3d4fef85d0 fdo#63023 incorrect RTF background color in header
Change-Id: I33f5c8a856206860ac9cdb23dd6b5222cb785bf7
2013-04-18 15:54:05 +02:00
Miklos Vajna
e7664052d6 fdo#61193 fix crash on RTF paste of footnote
Regression from 232ad2f2588beff50cb5c1f3b689c581ba317583.

Change-Id: Ia0873851979df5bba0a4693f044aab2aeff2b8e4
2013-04-16 10:36:49 +02:00
Miklos Vajna
91a151085a restore disabled rtfimport tests
There were two problems here:

- Writer textframes don't have an AnchorPosition property, use
  compareRegionStarts() instead
- turns out DOC/DOCX import doesn't create Write textframes when the
  shape has no text, doing so in the RTF import fixes the other two
  testcase as well.

Change-Id: Ib2b4a0b7f8317d300fd532daea22568e33eceb53
2013-04-10 13:13:06 +02:00
Miklos Vajna
a6475acf45 CppunitTest_sw_rtfimport: disable 3 checks for now
I'm not sure yet if the tests should be updated or they signal real
problems, I'll came back to this later.

Change-Id: Ie2570f01e07e557281d2577471a49a730a894393
2013-04-10 08:01:15 +02:00
Miklos Vajna
7006ef460b fdo#51916 testcase
Change-Id: I27ffbab64cfb6763235d4dfd7fb47aa98235274d
2013-04-03 17:37:51 +02:00
Miklos Vajna
584322cbbd fix failing testcases
Change-Id: I2f4deaca308b64f1dc923e3d0a9c10c6f974a33b
2013-03-28 16:57:33 +01:00
Miklos Vajna
9c06d2bd25 fdo#37716 implement import of RTF_NOWRAP
Change-Id: Ic2c0f4c1924811a6ee1c40221db447babdd74a3a
2013-03-28 14:46:50 +01:00
Maxime de Roucy
54b5973ded unit test for fdo#62805
Change-Id: Iebc1a63496aaf54b9e459d0ed53db5cae49929ac
Reviewed-on: https://gerrit.libreoffice.org/3086
Reviewed-by: Miklos Vajna <vmiklos@suse.cz>
Tested-by: Miklos Vajna <vmiklos@suse.cz>
2013-03-27 12:19:47 +00:00
Miklos Vajna
24d5261f5a fdo#62288 fix RTF import of table paragraph margins
Regression from 4a507f732d82c188ad81b022cbe3037951e58ac3. The problem
was that in some cases \pard can't reset all paragraph properties. The
original commit just made this keyword a noop when it occurred between
\cell and \row, but this is too much. At least margins do need
resetting.

Change-Id: I5cbb1df72bf1211f85ef69ab64d5b46cbce5c742
2013-03-22 11:48:02 +01:00
Miklos Vajna
c412cba28e fdo#61909 fix import of RTF_HIGHLIGHT
It's an index in the color table, not a color value.

Change-Id: Ifa7b14e88231e5053c84dfbdd9b453715df1aaa6
2013-03-18 15:06:30 +01:00
Miklos Vajna
60c17b2873 fdo#61909 fix RTF import of default font without RTF_PLAIN
Change-Id: Ia86548bddb7b87ec9653192c2e5989ce0dc50057
2013-03-18 13:03:16 +01:00
Miklos Vajna
ea66024d4d fdo#60722 testcase
Change-Id: Ib6097c844b2bc929c6ece31bcec62f27bfbf386c
2013-03-06 16:31:13 +01:00
Miklos Vajna
58c30a3545 fdo#59638 handle RTF_F inside RTF_LISTLEVEL
Word typically uses the Symbol font to describe bullet characters
instead of using a sane Unicode value, the previous can only be handled
if we parse the custom font set for the list.

Change-Id: I1491f07c40953949e381a035c1596c207cdc4c35
2013-03-01 17:53:57 +01:00
Maxime de Roucy
50822d4405 testcase for fdo#53594
Change-Id: I834b3cf0b5a46627ff0b532e27a73deeaefe7c47
Reviewed-on: https://gerrit.libreoffice.org/2376
Reviewed-by: Miklos Vajna <vmiklos@suse.cz>
Tested-by: Miklos Vajna <vmiklos@suse.cz>
2013-02-25 09:43:45 +00:00
Miklos Vajna
e15f9ceafd fdo#59953 RTF import: fix unreadable graphic and nested cell contents
There were two issues here:

1) c3b0f13546b30e5db3aecd311c7178e4e0933208 added a mechanism to work
around broken documents, but that didn't deal with nested tables.
Additionally, the check compared the max row width with the width of the
last cell, not the last row.

2) d276d3f3ae112a11c8cb5768650d147cbb94275e cleaned up implicit
horizontal merge detection, but didn't deal with valid documents, where
each row definition is available twice.

Change-Id: I1a32ec2fcb0d1a8fca7a7bd26501d3daf17880c9
2013-02-08 14:33:28 +01:00
Michael Stahl
c4696e7c04 RTF import: fix import of \line symbol
"Required line break" was eaten by the newly added code in text() to
ignore \'0a.  (regression from f593a2e4179b05ae1019372cde612cb242d1d27f)

Change-Id: Id32687c40a17ddb99196635cedfc850182705799
2013-02-05 21:05:45 +01:00
Miklos Vajna
878c6f7cb4 fdo#58076 import RTF_SHPLEFT/TOP of ESCHER_ShpInst_PictureFrame
Change-Id: Ia655743710778ea7d48a9b2221f22f55a4ccce32
2013-02-05 18:38:11 +01:00
Miklos Vajna
f593a2e417 fdo#59419 fix RTF import of hex form of \r and \n
Change-Id: Ic700cdc67f756cafc454c326b73f680a8a47a6e8
2013-02-03 14:50:19 +01:00