Commit Graph

1113 Commits

Author SHA1 Message Date
305ecd1848 fdo#79959 RTF import: trim whitespace around style names
Change-Id: Id23cbd62b057442c577fef124a5705e4d551076f
2014-08-29 18:32:49 +02:00
54bdfe0a89 fdo#74229 import RTF_TRGAPH
Regression from commit c4b91ae3178011c66c76c711c1a6469ba658872e
(fdo#55525 import RTF_TRLEFT, 2012-11-13).

Change-Id: I90f2c6399cfaf8399de0cf3488a23af6cc84710d
2014-08-28 16:35:18 +02:00
b3698a6ac2 NS_ooxml::LN_CT_LevelText_val might be missing
Change-Id: I2683dd30d521b91cf026b3553ed4f75ee4172b3a
2014-08-21 08:33:04 +01:00
e324771991 empty m_aStates
valgrind + bff

Change-Id: I3bd526b7ebf0f4fce5d0c7054809e0dc2908e73f
2014-08-20 08:43:09 +01:00
28df98abec empty m_aStates
valgrind + bff

Change-Id: I7b45e10471de77bd0481adf0bccdbf852c36d815
2014-08-19 08:40:54 +01:00
e2b9531e43 check for empty m_aStates
valgrind + bff

Change-Id: Ib818d508e10877a845b733c4aa223d1e2cbbc05e
2014-08-18 08:32:30 +01:00
63fa1a7bc8 RTF import: handle pWrapPolygonVertices shape property
Change-Id: I512713e9b9aa1ceb3d98af7a1a6abd144e370689
2014-08-16 18:26:00 +02:00
dc0149869b RTF import: handle negative SHPLEFT / SHPTOP
Change-Id: Id82d6d54b160b5b78a53c526e6ccab0514c21312
2014-08-16 18:25:59 +02:00
4dd5338f38 RTF import: let SHPRW == 4 imply ooxml:EG_WrapType_wrapTight
This does not have an effect on the resulting document yet, but handling
"tight" properly is necessary to support wrap polygons in the future.

Change-Id: Iff057a1f9aff792b9c0ad5e601f2024bc60383cf
2014-08-13 20:04:31 +02:00
bbcbfd515b [loplugin:implicitboolconversion]
Change-Id: Icb50487eb466f547f6b382155f6ce9099fb32aaa
2014-08-13 17:19:12 +02:00
37ecf08237 RTF import: fix handling of RTF_SHPFBLWTXT
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-13 14:45:59 +02:00
656ab07b29 Sync oox -> writerfilter alias for wordprocessingml
The motivation is that once all the namespace aliases in
writerfilter/source/ooxml/model.xml match the ones in
oox/source/token/namespaces.txt, then the writerfilter copies could be
dropped.

Change-Id: I1f9abb8bb457189997f28c99b0f6b00660252c14
2014-08-10 21:04:49 +02:00
459603e36a writerfilter: bin OOXML_something duplication of oox::XML_something constants
workdir/CustomTarget/writerfilter/source/ooxml/OOXMLFastTokens.hxx was a
duplication of workdir/CustomTarget/oox/generated/oox/token/tokens.hxx,
except when the oox generator changed, the writerfilter copy was not
adjusted and Bad Things happened. We don't need this.

Change-Id: Id92481f110b04ec24cb424421aa0ec029b7896f3
2014-08-05 19:16:03 +02:00
eec640d9a0 writerfilter: avoid 'using' in generated header
Change-Id: Ib9510aed34e451c529133c9c114b770c374fe403
2014-08-05 18:39:36 +02:00
544fa45ead indentation fixes
Change-Id: Iacdaf8bcae8df6ba380a9fb6d78db22f51a4d6f9
2014-08-02 22:00:36 +02:00
c3657be928 fdo#80742 RTF filter: import RTF_OUTLINELEVEL
Change-Id: I49d94bd72af610e88128cd405e4786d2e9ba65ed
2014-08-02 21:44:02 +02:00
f8e8e476aa fdo#81944: writerfilter: RTF import: don't drop fonts in stylesheet
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-02 19:09:44 +02:00
b46956e73b writerfilter: RTF import: ignore content of \upr, except for \ud
The content of \upr and its nested \ud destination should be the same
modulo text encoding, so ignore the legacy one.

Change-Id: I007151e3075a9ac879a486ec3b5fb8549435dbba
2014-08-02 19:09:43 +02:00
43b88364b0 RTF import: fix as-char anchored OLE objects
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-01 17:25:29 +02:00
008d1187a9 fdo#81893: writerfilter: RTF import: \qc before \page was lost
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-01 11:02:33 +02:00
df041e468b fdo#81892: writerfilter: RTF import: add support for table row alignment
These keywords were simply not implemented.

Change-Id: Ib4d07a4b2dfb07cfd56a4ee07d7c14d1c59323f9
2014-08-01 11:02:32 +02:00
b9b9fea12e writerfilter: fix ubsan complaints about "-42" enum value
Apparently the StyleType enum is specific to the domain-mapper, the
OOXML filter has integer constants in its model.xml file...

Also surprisingly the section styles only exist in RTF; w_ST_StyleType
in "ECMA-376 3rd Edition" only contains the 4 values of StyleType enum.

Change-Id: I5407800f801824676df309b3705e233cf1382721
2014-07-31 12:05:09 +02:00
2197777816 indentation fixes
Change-Id: I0a0f04d0f0e008e8947a5a7e3ed6083c1589e61b
2014-07-27 17:30:48 +02:00
75c5679a96 fdo#80486 writerfilter: RTF import: ignore \par inside \ftnsep
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-22 16:32:37 +02:00
82e17dbb2a fdo#77996: writerfilter: RTF import: re-work destination text buffering
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-22 16:32:36 +02:00
d9c4aa3838 writerfilter: pass uno::Reference by reference in RTFSdrImport
Change-Id: I3a0821caccc37beb37f4ad8ecb4b0fdb5d2d5a58
2014-07-22 16:32:35 +02:00
2354d22b7c writerfilter: pass uno::Reference by reference in RTFValue
Change-Id: I21d81d4454e65cf7f341f659b70b684dc3aa4621
2014-07-22 16:32:35 +02:00
90d2ebf7a7 indentation fixes
Change-Id: I2c1f99128698778233b0bd46256b571d3f794713
2014-07-19 10:29:30 +02:00
ab18e62bd7 writerfilter: RTF import: ignore \listname destination differently
This adds a skeleton for \listname but not immediately obvious what it
should do...

Change-Id: Icd8dd3b5d597f1c4038044ec2eba8b63718e0d3d
2014-07-19 00:23:19 +02:00
e93f085247 fdo#78502: writerfilter: RTF import: handle \u keyword inside levelnumbers
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-19 00:23:11 +02:00
b94bd40b91 (related: fdo#78502) writerfilter: RTF import: fix invalid string copy
... in leveltext destination.

Change-Id: I74de6d14170130bf33923854a0c9851dc7cc390f
2014-07-19 00:21:46 +02:00
9aa80fcb29 (related: fdo#79319): writerfilter: RTF imoprt: don't lose shapes in header
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-18 12:42:26 +02:00
589ca2a5e8 fdo#79319: writerfilter: RTF import: support horizontal rule
There are special properties to create a "horizontal rule" shape
that apparently set some specific defaults; this prevents the
shape being imported as a big fat rectangle over the document.

Change-Id: I402376d7306e870ad895beaa657750cbf3290d98
2014-07-18 12:42:26 +02:00
2b9e782497 (related: fdo#79319) writerfilter: RTF import: fix crash on "fake" pict
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)

Change-Id: Iec94852ddc4c1ca3d8284119e6f1818a8dbb4149
2014-07-18 12:42:25 +02:00
6f2b2e1436 writerfilter: import RTF_NOCOLBAL
Change-Id: If2efab82c0adc2f3dc52733c335693565c350bfa
2014-07-18 10:59:37 +02:00
14898bc385 writerfilter: identation fixes
At least the ones detected by astyle, as requested at
<https://gerrit.libreoffice.org/10351>.

Change-Id: If87d847f260b4e7ed71115bd8cc1af55cd349b02
2014-07-16 22:14:57 +02:00
083b2b1471 fdo#80924: writerfilter: RTF import: fix shapeType PictureFrame import
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)

Change-Id: I6539c4286850dff2d8564006487cc765f1d117be
2014-07-16 11:15:34 +02:00
25b02fffbb Use comphelper::SequenceAsVector
Change-Id: I5458687f9a63b91c43c6ecce2cb4535e50e4a23e
2014-07-07 11:53:47 +02:00
f46e392050 writerfilter: remove unused getKind()
Change-Id: I7d98d1fb400e1a73ca0d935d5cfbb82de43d795e
2014-07-06 19:51:25 +02:00
fdc235126d fdo#73241 RTF import: ignore page break in tables
Change-Id: Ibee9fec0f421b4c2ff3d45c861bc3fcfc97cbf15
2014-07-05 14:03:16 +02:00
2ff63282f7 Use comphelper::SequenceAsHashMap
Change-Id: I555514cb8647ff4a53eeff14933cfc4a868a3ab3
2014-07-05 10:18:31 +02:00
c64a54bc3e Use comphelper::SequenceAsVector
Change-Id: I8c0328b1bae3d2c3f327d241acf3df0c078ea4cf
2014-06-30 18:44:51 +02:00
d4feafb064 Use comphelper::SequenceAsVector
Change-Id: I603a683bfce243db2ceae0ae946768a5d7a63fe5
2014-06-29 21:59:27 +02:00
2f46f8b937 Use comphelper::SequenceAsVector
Change-Id: I4bdd7c18e5ccf652a2fc0d651ce50c005254fa8a
2014-06-22 21:04:47 +02:00
3ea80a4686 RTF import: handle column break at the very start of the document
Change-Id: Ib7d166bf1b1e5d5216d822b2b0396aa4dc535c6f
2014-06-20 12:59:11 +02:00
aca657b380 whitespace
Change-Id: I2db68597c83285571da2ddd1257a61a4603a90ef
2014-06-19 21:51:06 +02:00
7eafd8ccac fdo#79599: use \highlightN instead of \chcbpatN in RTF import and export
Reviewed on:
	https://gerrit.libreoffice.org/9776

Change-Id: I98ef606fb73368a3c275819cb83b936e2162769d
2014-06-19 21:51:06 +02:00
3cab1adf19 abi#2720 RTF import: handle non-graphic object after a graphic one
Change-Id: I9416b6e7cf3677006215fcbde458ed341c4e3e9e
2014-06-19 18:01:16 +02:00
f8c5a61e05 writerfilter: Hide more debug-only stuff behind the DEBUG_DOMAINMAPPER.
Change-Id: I0e86cafab97f0adad516660c6fdf40e13d114bf2
2014-06-19 13:07:19 +02:00
19863db337 indentation fixes
Change-Id: Ia391ccc9889a135730f0fead11eb0b6c2f748ec4
2014-06-19 09:57:33 +02:00