171 Commits

Author SHA1 Message Date
Miklos Vajna
6eb02ac8a7 fdo#65090 RTF filter: import RTF_CLMGF and RTF_CLMRG
These describe an explicit horizontal merge, that is not something Word
itself creates, but it turns out the Calc RTF export does.

Change-Id: I1b6ec10bb8e8bd40e24791ccc96f2f066dd0d5d5
2013-12-28 10:00:49 +01:00
Andras Timar
b55259eeb5 typo fixes
Change-Id: Ia5f104bfd707bcf4e159c78ca2764c861fb0b6d9
2013-12-20 15:55:00 +01:00
Michael Stahl
fb9d14f6a6 RTF: use "InsertMode" insead of "IsNewDoc" for consistency
... with other filters.

Change-Id: I563d6f7713d882b834978699c492a43a70e072cd
2013-12-05 13:00:28 +01:00
Miklos Vajna
b38629ae21 cp#1000017 DOCX/RTF import: avoid fake tab char in footnotes
Word wants this, so it's added by the exporter to the document, but on
import we should ignore it.

Change-Id: Idcb669ba624bf462a50a85eb4aacf397afb6efe6
2013-12-05 11:50:42 +01:00
Tor Lillqvist
3e7b69ae35 WaE: macro is not used
Change-Id: I7748517d2298c20e4fd6c6ebf403a2ccc8228054
2013-11-23 09:33:00 +02:00
Miklos Vajna
a56bfe734a cp#1000016 DOCX/RTF import: fix RemoveLastParagraph() on Windows
Change-Id: I3f9d69ddbb2144c60a724e4242128b65ae167455
2013-11-22 16:59:56 +01:00
Miklos Vajna
9389cf78e3 cp#1000018 RTF import: empty para at the end of footnote text got lost
Updated 3 testcases, in all cases first checked that the new behavior
matches what Word does.

Also added a new test, to check that empty para at footnote end is now
kept.

Change-Id: I96b8788feb4d730b5a64ba3a743311a0180ab41f
2013-11-15 15:45:20 +01:00
Miklos Vajna
a76daca815 Make CppunitTest_sw_rtfimport use DECLARE_SW_IMPORT_TEST()
Change-Id: I670e0460f15951f99f0f750d2798c771f64c3095
2013-11-04 21:33:11 +01:00
Miklos Vajna
a35fa8d8b1 fdo#70221 fix RTF import of multi-group pictures
Pictures typically have a single RTF group, so we imported them at the
end of that group. Though multiple inner groups are also allowed, so
make sure we only do the import at the very end, instead of at the end
of all inner groups as well, resulting in multiple (fake) pictures.

Regression from 13c00ce322e78eb4e0f50ab84ded19cd6aae1ded (Enable the
writerfilter-based RTF import in non-experimental mode, 2011-08-18).

Change-Id: Id895b2c6d3b824d09d89bfa01ce59aba76c55d42
2013-10-21 09:36:33 +02:00
Miklos Vajna
5ebe826caf fdo#69384 fix impress -> writer copy&paste
Regression from 2ade07126971b79c92f729fae5709f2e2e2b495c (fdo#62044 RTF
import: don't overwrite existing styles when pasting, 2013-06-04),
during paste, if existing style was found, then the intention was to
skip that style, but instead we tried to create one.

Change-Id: I83adaf9fe6b8a578fa60c21b9463fabde7707d7e
2013-10-04 12:19:11 +02:00
Miklos Vajna
b226dcb50d fdo#68291 RTF paste: don't set PageDescName during paste
In general, paste should not deal with page styles. In this case, it
even caused an additional page break.

Change-Id: Ia7c5a9ad844821b6622babfbd94469ec3c04cf0a
2013-09-09 10:44:18 +02:00
Miklos Vajna
d9f1c11dfa Reduce copy&paste by adding SwModelTestBase::getShape()
Change-Id: I3b73405c546427bb5676db30e297af36c18043e6
2013-08-27 18:26:39 +02:00
Miklos Vajna
f1e5e271f9 fdo#68076 RTF import: default font had priority over the specified one
Regression from 60c17b2873506ed8b068b34840aecda0c1d9bd65.

Change-Id: Ie16d611622e6a814d5cbea00c3f992cd9ecba027
2013-08-22 11:39:31 +02:00
Miklos Vajna
b9c1a9b9aa fdo#44715 RTF import: reset styles in tables on RTF_PARD
Commit 4a507f732d82c188ad81b022cbe3037951e58ac3 added an exception to
RTF_PARD (reset paragraph properties) handling: when we're inside a
table, it should not reset the fact that we're inside a table (which is
a paragraph property).

However, instead of just re-adding that property, it disabled resetting
for all properties, and we had a growing list of exceptions since then.
The next thing to add there would be the paragraph attributes, which
contains the style information. Instead of growing that ad-hoc list,
reset everything again and just re-add the "in table" SPRM.

This makes the second and later paragraphs in the A1 cell of the bugdoc
have proper font size.

Change-Id: I2de80894fcd5da3bf45d221af9a04a307c70a29b
2013-08-17 12:30:56 +02:00
Miklos Vajna
774b689917 RTF import: handle rotation on groupshapes
Change-Id: I7892224a118b6566e26b3ffc472c88f3c7f58620
2013-08-13 11:02:19 +02:00
Miklos Vajna
c73b8072a1 fdo#63428 writerfilter: fix paste of commented text ranges
There were multiple problems here:

- xFoo->createTextCursorByRange() got a text range argument,
  where the text range wasn't from the xFoo text
- it was assumed that all XText implements text::XParagraphCursor as
  well, but this is not true for e.g. comment text
- commented text ranges were pasted as normal comments (once again, the
  insert position wasn't passed around)

Change-Id: I9a975a08b08a7f32b1ee71e42f58736cc0dbb09d
2013-08-12 12:35:19 +02:00
Miklos Vajna
aa6959ba2c fdo#53556 testcase
Change-Id: If58376aec31ab00cab19221beed73e8275a834d2
2013-08-09 16:12:18 +02:00
Miklos Vajna
b755df14a4 fdo#47440 import RTF_SHPBX/YPAGE for Writer pictures, too
Previously this was only handled for drawinglayer shapes.

Change-Id: I7ce440a27ebe44fc867b8a7f4ee62217076677f0
2013-08-06 16:57:26 +02:00
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