Commit Graph

4246 Commits

Author SHA1 Message Date
03276df2ae Remove unused xmlns:fn namespace aliases
Change-Id: I634fdfd2b206fbb91e8032fe2fbf4ec66c8623a2
2014-09-02 07:47:44 +02:00
5b7d7f35e0 Clean up duplicated xmlns:c definitions
Change-Id: Ibd8fdfeeac89da8c8c259bae3de22f87a0d59b2a
2014-09-02 07:47:44 +02:00
314241ed0e Clean up 6 times duplicated xmlns:a definition
Change-Id: I935856965bcb1f710059801621124685aeb65a03
2014-09-01 08:04:22 +02:00
61ed5a1f95 fdo#83048: DOCX: Corrupt: LO exports wrong SDT properties of Date
Issue :
	-File was getting corrupt due to wrong SDT Properties were getting export
 	 and only one SDT tag was getting written.
	-Issue file contained a Date SDT and a FieldChar SDT(Page numbers)
	-Issue was at Import side.
 	 LO GRAB BAGS Properties of SDT using PARA_GRAB_BAG or CHAR_GRAB_BAG
	-For Date SDT it should be grab bagged using CHAR_GRAB_BAG in order to get
         correct data inside <w:sdtPr>
 	 But LO was handling it with PARA_GRAB_BAG due to which wrong properties were
         getting written and
 	file was getting corrupt.

	Implementation :
	-Added a check for Date SDT to handle it through CHAR_GRAB_BAG
	-Now correct SDT properties are getting exported due to which Date is getting
         written inside an SDT tag.
	-Added UT at export side.

Change-Id: Ibcfb6dbbec1c23ffd14ba924ab56dc4122b98595
Reviewed-on: https://gerrit.libreoffice.org/11160
Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
Tested-by: Miklos Vajna <vmiklos@collabora.co.uk>
2014-09-01 00:54:10 -05:00
024d135a5b Unused arguments / variables
Change-Id: I5903b2f72314f8518beb1821c218fca6a3550d7f
2014-08-31 13:23:46 +02:00
6561358611 Remove not needed xmlns:xsd attributes
Change-Id: I3ed897a7d5a3182d9ae9f64269e3eb6851eeab73
2014-08-31 13:21:35 +02:00
24a55a1250 writerfilter: fix namespace of CT_PictureLayer's r:embed
I just wanted to get rid of the duplicated xmlns:r attributes, but seems
model.xml had some inconsistency as well, that's how this refactoring
fixes a bug as a side effect.

Change-Id: I95d753253f03a001c68dbbac7c86740040a180fa
2014-08-31 11:26:22 +02:00
4e0d84c2c1 writerfilter: fix namespace of CT_SaveThroughXslt's r:id
We only tried to read "id", not "r:id".

Change-Id: I35580fda05841d8c8a11b961016ec4be5059c5f8
2014-08-30 13:30:04 +02:00
0da23c0922 Remove unused prefix attribute of namespace elements
Change-Id: I6fd33f9050eb3f7394315bbd0c617513767adce6
2014-08-29 23:29:11 +02:00
305ecd1848 fdo#79959 RTF import: trim whitespace around style names
Change-Id: Id23cbd62b057442c577fef124a5705e4d551076f
2014-08-29 18:32:49 +02:00
9f05a87092 Remove unused url attribute
And also make sure that the model is re-checked when the schema changes.

Change-Id: I348d11aa770255329cd47535dff4b15a95e4bd8e
2014-08-29 18:32:48 +02:00
cf5a6919e1 coverity#705090 Unchecked dynamic_cast
Change-Id: I4cd2dcd457c8f41c1c7fd82e2c99d056cf2a8c37
2014-08-29 16:08:02 +02:00
4034d96aee writerfilter: respect WinWordToWriter config setting
The binary filter uses this setting to decide if the embedded object is
converted into a native Writer document (so it can be edited) or not (so
it's preserved better), let's do the same.

Change-Id: I47b48867b3d0abf6cd8de2430513587a6776461e
2014-08-28 17:19:27 +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
6465857e02 Remove pointless WriterFilter::initialize()
Change-Id: I2341f9665835b4591d0e7c26f32a0fa120b6e7b9
2014-08-28 12:03:20 +02:00
1babe37e48 Use comphelper::SequenceAsHashMap
Change-Id: I21302361e89b9f01af04cf1a1ed78627097b9d8c
2014-08-28 08:27:27 +02:00
41aa970b31 DOCX import: fix handling of embedded DOCX files
The problem was that SwXTextEmbeddedObject::getEmbeddedObject() returned
an empty reference for those embedded objects, so the HTML filter
couldn't extract their content when it wanted to do so.

It turns out the reason for this was that the DOCX importer only handled
the replacement image + raw native data for the object. Fix this by
creating the embedded object with the correct CLSID and import the
raw data into the empty embedded document model.

This is similar to what is done for XLSX-in-PPTX in
oox::drawingml::ShapeExport::WriteOLE2Shape(), just for the import part.

Change-Id: Ieb1dcb1774d2d4da00117e3a35160053066c78aa
2014-08-27 15:34:41 +02:00
5170d822aa writerfilter: remove unused application attribute
Change-Id: Ic4e16f8303611197e7d2a149e85c7b73dc30bcc8
2014-08-25 09:40:31 +02:00
7163f563ce Indentation fixes
This makes model.xml about 20kb smaller. Most inconsistencies were
introduced when unused tags were removed, like <optional>.

Change-Id: I5e77860cf09bad4cad3e9dd7383371a10386c260
2014-08-24 13:43:34 +02:00
552f139d2a writerfilter: remove mce token generator
Commit af7d4a5ebf3e6a09cd2079f241dee16aa22e0276 (n#820503: initial MCE
support in writerfilter ooxml tokenizer, 2013-07-03) added these, but in
fact only the namespace-alias part was necessary. Now that oox provides
the list of namespaces to be registered, it can be removed completely.

Change-Id: If8f1b0c07602a0170c63b53d806a5b466d485747
2014-08-23 11:46:13 +02:00
9767f9becc Use comphelper::SequenceAsVector
Change-Id: I115b17da8cc246bf1b2502ed53ef00edad70a21d
2014-08-22 16:37:30 +02:00
7c02c7b021 DOCX import: list styles don't support automatic updates
The problem was the following: setPropertyValue("IsAutoUpdate") on the
style failed -> a number of styles was not imported in
StyleSheetTable::ApplyStyleSheets() due to the exception, then when we
tried to use one of the not imported styles, we also got an exception in
DomainMapper_Impl::finishParagraph(), which resulted in not calling
DomainMapperTableManager::handle(), so multiple cells of the same table
wanted the same range for cell contents, and that resulted in a crash.

Regression from cf33af732ed0d3d553bb74636e3b14c55d44c153 (handle
w:gridBefore by faking cells (fdo#38414), 2014-04-23), but that commit
just made the previously hidden problem visible.

Change-Id: I788cb6b4a2c7b7efbfa48297c658bb26450bf583
2014-08-22 14:13:31 +02:00
8e9c340362 writerfilter: unused namespacealias attribute
Change-Id: I12f59c6d06323d3d9ebcd55ee5fe7e43597a11b4
2014-08-22 14:13:30 +02:00
42faa9f051 writerfilter: remove unused qname attribute
Change-Id: I412390fba4caa4579dec0dab68f4a1c276284118
2014-08-21 15:28:20 +02:00
67c98f6f64 Simplify ((A && B) || !A) to (!A || B)
Change-Id: Iae4f45f1e64effa1369e9aba13b6b972a5ba76a0
2014-08-21 14:30:39 +02:00
0eabc890cc Avoid invalid downcasts
Change-Id: I8550da2c6afb4e7de394879ef75312a0c9c2df25
2014-08-21 14:27:38 +02:00
c52e417505 Avoid invalid downcasts
Change-Id: I1666321916d08b326bb0c1c1f21273d568523691
2014-08-21 14:13:27 +02:00
b3698a6ac2 NS_ooxml::LN_CT_LevelText_val might be missing
Change-Id: I2683dd30d521b91cf026b3553ed4f75ee4172b3a
2014-08-21 08:33:04 +01:00
0a42632a74 empty Reference
valgrind + bff

Change-Id: Id3c039a46dec5d2d4a4642dfb53d23a76972dde2
2014-08-20 08:57:06 +01:00
e324771991 empty m_aStates
valgrind + bff

Change-Id: I3bd526b7ebf0f4fce5d0c7054809e0dc2908e73f
2014-08-20 08:43:09 +01:00
8b6ce55b90 writerfilter: remove now unused namespace-alias elements
Change-Id: If58b3a9f5b1d79d164bb1c2a7c18aa4f99f00ca8
2014-08-19 23:26:09 +02:00
a5396d64a4 writerfilter: stop reading namespace-alias elements
The same info is already available from oox.

Change-Id: I0725799e1f3ffebf6140ad38a0ce376e5417265d
2014-08-19 23:26:09 +02:00
1c06dc14a1 writerfilter: stop reading namespace-alias elements in factoryimpl
Change-Id: I52c2298c9583617481069040e118520cf8935c6d
2014-08-19 18:19:03 +02:00
28df98abec empty m_aStates
valgrind + bff

Change-Id: I7b45e10471de77bd0481adf0bccdbf852c36d815
2014-08-19 08:40:54 +01:00
23b49f2390 writerfilter: fail on mistyped namespace URL's
And also fix one typo detected by this new check.

Change-Id: Iaa7a4bb0b6dc3f81e5dd0b352584029cfed4ffbb
2014-08-19 08:17:34 +02:00
a3a5d4fcdc writerfilter: sort namespaces in OOXMLStreamImpl::getFastParser()
The motivation is that <namespace-alias> elements in model.xml are
redundant, as the same info is available from oox as well. But without
sorting, it's impossible to generate the same output, as the (not
interesting) order isn't the same there.

Change-Id: I634c62e43d1b54100bfa623c6f43dddd34279fb1
2014-08-18 22:17:37 +02:00
221d874ec8 Fix -Werror=sign-compare
Change-Id: I5c5f31a4970c1c5f2930dd3ae99a46c568101ac4
2014-08-18 16:15:21 +02:00
8b9988163c fdo#82492 : DOCX: Corruption: File was getting corrupt fafter RT
Issue :
	- In issue file there were two runs(first run=SDT, second run=Shape).
	- These two runs were consecutive(no text/space/tab was there in between two runs).
	- Due to such scenario, "SdtEndBefore" was not getting set on Shape.
	- Hence at Export EndSdtBlock() was getting called from EndParagraph().
	  Due to this SDT was not getting end after first run.
	  In order to end SDT after run, EndSdtBlock() should get called from EndRun()
	  (as in Original file)

	Implementation :
	- Set "SdtEndBefore" on Shape in DomainMapper_Impl::PushShapeContext()
	- Retrieved same property at export.
	- Added export unit test case.

	Note :
	Added common functions at Import and Export with reference to
	https://gerrit.libreoffice.org/#/c/10827/

Conflicts:
	sw/source/filter/ww8/docxattributeoutput.cxx
Reviewed on:
	https://gerrit.libreoffice.org/10912

Change-Id: I357d77cd179c83b8ae976db331ee46c8993b6cb8
2014-08-18 12:52:30 +02:00
e2b9531e43 check for empty m_aStates
valgrind + bff

Change-Id: Ib818d508e10877a845b733c4aa223d1e2cbbc05e
2014-08-18 08:32:30 +01:00
b32881b672 fix reading even/odd page breaks from .docx (bnc#519228)
We map Word's even/odd page breaks to Writer's left/right page styles. And we cannot
just set any page style to be left/right, because that could set e.g. the default
page style as such, which would make all normal pages that way. So instead we need
to make a copy of the relevant page style, as the original page style as its follow,
copy all the properties and headers/footers, and use this copy to get the page break.

Change-Id: Id0d2568de91ac2de4afb0ba3a6eedd9cec46f878
2014-08-17 21:39:39 +02:00
33959c7177 fix dbglevel=2 build
Change-Id: Ie570a84bfca530c6763c6aa7b0ca12ae1a16f0f3
2014-08-17 15:53:27 +02:00
bb19f58ed0 writerfilter: remove now not necessary namespaceids.py
Change-Id: Ic15362b9a7687c7cba2e3b1554f2eac593afab3b
2014-08-17 15:53:27 +02:00
8b0e5be91b writerfilter: OOXMLnamespaceids.hxx -> namespaces.hxx
Change-Id: Icfb104b0f77d5303751a30f9188319bca7a14e6b
2014-08-17 15:53:27 +02:00
54ac480baf Sync oox -> writerfilter alias for remaining namespaces
Change-Id: I47bb934102dd18695b3e4647c0f6216ee98f059c
2014-08-17 15:53:27 +02:00
99b9e06b7c Sync oox -> writerfilter namespace includes
Change-Id: I940efc1197e0694c93d25e5c4542eeef12cbb10f
2014-08-17 13:06:29 +02:00
7791b3f600 writerfilter: sort namespaces in generated header
Change-Id: I1c08fbe841161323325c6ffd153f09daf30c095b
2014-08-17 13:06:28 +02:00
e33f6f499f Sync oox -> writerfilter alias for generic VML
See 656ab07b2924dd2703f31f460c8586c375c7878a (Sync oox -> writerfilter
alias for wordprocessingml, 2014-08-10).

Change-Id: I5179961b683473a502693923422171bb274fc845
2014-08-16 18:56:35 +02:00
28bf20625c Sync oox -> writerfilter namespace prefixes
Change-Id: Ifbcb7716640cd05d4b98eef22f9ddf49f3bd79aa
2014-08-16 18:56:35 +02: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