1217 Commits

Author SHA1 Message Date
Miklos Vajna
cfb5b20cdc DocxAttributeOutput::OutputFlyFrame_Impl: enable DML export by default
This was only available in experimental mode previously. Also note that
export of Writer TextFrames are handled separately, there DML export is
still off by default.

Change-Id: Ie8eaa1670610d92a363a8558b68064e7d7de2cdd
2013-12-18 11:09:47 +01:00
Adam Co
c7e66b3214 Revert code that push copy of 'rPr' inside 'pPr' in DOCX export
There was code that was inserted by commit id
'8c178a50334109b34ef456ca6aa51cd3d98699ae' that added logic to
also export 'rPr' in the 'pPr' node.
The 'rPr' represents the paragraph marker formatting.
However - simply copying the last run's formatting and assuming
it is the same for the paragraph marker should not be used.

Also refer to 'aafffe6d1c3734fb2acef4b2bb1385c1e2f49043' for
details on test-case disable.

Change-Id: I6004e4c706abfeb5f51d86d11d3ebf46256a68c5
Reviewed-on: https://gerrit.libreoffice.org/7121
Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
Tested-by: Miklos Vajna <vmiklos@collabora.co.uk>
2013-12-18 09:02:09 +00:00
Michael Stahl
8272ffb8ed fix integral ambiguity
Change-Id: Idf022c8a4cd78c525a5c40ec8fe7a1e304b9aecc
2013-12-18 00:20:02 +01:00
Miklos Vajna
73a808f6b3 test::FiltersTest: add support for export tests
For now, this is only implemented for the Writer RTF filter.

Change-Id: I0c7ae5b0e544bd4738652a38474f4d262ce65661
2013-12-17 20:52:35 +01:00
Jacobo Aragunde Pérez
25dc9aaf69 ooxml: preserve font theme color shade property
Change-Id: I40fa3f172f98b319a97a855231b854651be2d784
2013-12-17 19:51:18 +01:00
Jacobo Aragunde Pérez
3d126bcf1f ooxml: preserve font theme color property
The property is called w:themeColor and it belongs to the w:color tag
inside run properties.

On import, the themeColor prop is stored in the character interop
grab bag together with the val prop.

On export, the current color of a text run is compared with the
stored val prop to know if the color has been changed during the
document edition. If it hasn't changed, the themeColor property
must be written to the document; if it has, it must not be written to
avoid overwriting the new color.

Also added a unit test for this property.

Change-Id: Icc95ee023aecc741adcba23d23206aadd6c30e1f
2013-12-17 19:51:18 +01:00
Miklos Vajna
0d1e734739 CppunitTest_sw_ooxmlexport: handle mc namespace in assertions
Change-Id: I17c8e5b4716652585d5612a4796140e7f54aaddb
2013-12-17 16:38:54 +01:00
Miklos Vajna
5964792a5a sw/qa/extras: document XPath checks
Change-Id: I78cd22485bd5d76ca37fa07e2e2eeae1da5bfea3
2013-12-16 16:28:38 +01:00
Tushar Bende
bee397a1e3 fdo#68211: Fix for "General input/output error" while opening file
Description: Docx containing floating table with formula was giving
"General input/output error" while opening in LibreOffice. Reason being within xLoader->filter() it was calling
EmbeddedObjectContainer::RemoveEmbeddedObject() with bClose value as sal_True(default value in function declaration)
and hence it was removing embedded object from container and also it was closing it.Fix includes passing this bClose
value as sal_false (which means remove object from container but don't close it.)

verified code changes for various floating table docx and normal docx containing tables and formulas.

Conflicts:
	sw/qa/extras/ooxmlexport/ooxmlexport.cxx
Reviewed on:
	https://gerrit.libreoffice.org/7009

Change-Id: I9c2d3f8c4099f9f753b2a1b027f9072cd4effeb5
2013-12-16 13:08:26 +01:00
Rohit Deshmukh
29c079f048 fdo#71594: Fix for LO crash while saving of file.
1] Libreoffice gets crashed while saving.

    2] This caused:
        "testCrashWhileSave.docx" file crashes on save
         Tested on Libreoffice 4.2

    Implementation:
    1] It crashes when we are trying to access cell number 2 from
       cells vector which contains only single cell. So put check
       for cell number which we are accessing and Number of cells
       in single row.
    2] As we are exporting Header and footer in between when we are
       exporting document.xml. In this case we are facing issue in
       table export for header and footer. Because flags for table
       is getting shared in both export.
       So we are switching between flags in between exporting
       "document.xml" and Header & footer
       export.

    After fix:
    1] No crash on save for "testCrashWhileSave.docx" and
       opens successfully on MS Office 2010
       Added Unit test case in export.

Conflicts:
	sw/qa/extras/ooxmlexport/ooxmlexport.cxx
Reviewed on:
	https://gerrit.libreoffice.org/6676

Change-Id: Iefbf565f7b512d76ac68e9353e225edca425ef06
2013-12-13 13:49:14 +01:00
YogeshBharate
0f6240fa92 fdo#71785: File hangs LibreOffice on Save
Problem Description: While saving the file LO shows the error
"This file could not be save".
The root cause was memory leak.

Conflicts:
	sw/qa/extras/ooxmlexport/ooxmlexport.cxx
Reviewed on:
	https://gerrit.libreoffice.org/6850

Change-Id: Iacc185780c14760056a7d690eb113d4dde1de034
2013-12-13 12:09:50 +01:00
Rohit Deshmukh
88b9e7f391 fdo#71786 : Implemented Glossary folder
1. Glosary folder is imported as Intrograb and exported.
   2. Added unit test case

Reviewed on:
	https://gerrit.libreoffice.org/6825

Conflicts:
	sw/qa/extras/ooxmlexport/ooxmlexport.cxx
	writerfilter/source/filter/ImportFilter.cxx

Change-Id: Ifd51a75a65e030d44d30e02cd7ab51fb088186b3
2013-12-13 11:19:42 +01:00
Faisal M. Al-Otaibi
b0db93d00e DOCX: fdo#72560 better solution for exchange alignment for RTL
Change-Id: I39462fc722a58b32e8829a9f2005a411871f255d
2013-12-12 08:37:28 +03:00
Jacobo Aragunde Pérez
ece66b11bd fdo#64232: export w:themeFontLang setting to docx
We store the values of themeFontLang tag to the document grab bag so
we can save it back to the document on export time.

Added unit tests to check that the attribute is properly set back and
also that the theme fonts are correctly applied to the text.

Change-Id: Ia54c513796ba38a571396ca7b72dfd28463c15fd
2013-12-11 17:39:02 +01:00
Miklos Vajna
adc68965d5 i#23357 RTF export: fix crash on groupshapes
Change-Id: I3329663060aeb06ac552bd5d1615d19efe160091
2013-12-10 10:55:21 +01:00
Miklos Vajna
826d133ccf drawingml import: handle w:b (found in docx groupshape textboxes)
Change-Id: I105d068a6b8d454fac963cd30f6f812cf2b96170
2013-12-09 14:01:57 +01:00
Miklos Vajna
f5b3a728ce drawingml import: handle wps:bodyPr inside a groupshape
Change-Id: I1f059ae653ab13a7c867f77b2b1b4265e9e71b4e
2013-12-09 14:01:57 +01:00
Miklos Vajna
f7a8a5e48a drawingml import: read w:color
Change-Id: I6ae7ea8b58e262e5b6226f8f789e39ebcc6077ca
2013-12-09 12:01:09 +01:00
Miklos Vajna
1cc1a89376 abi#10201 RTF export: fix crash when handling table::BorderLineStyle::NONE
Change-Id: I811820c0d550ce24ad2180a8917ef0087968c30b
2013-12-09 09:48:12 +01:00
Vinaya Mandke
0c61ffc15e Fix for Column Break if it appears in w:r which is not the first run.
Explicitly ended paragraph when the column break appears in a run
(which is not the first run in the paragraph), as Writer adds a
column break only for new paragraph. Also the created paragraph
must have the same para properties as the earlier one. Hence avoided
pushing new para properties if paragraph is split to adjust a col break.
Added UT for the same.

Conflicts:
	sw/qa/extras/ooxmlexport/ooxmlexport.cxx
Reviewed on:
	https://gerrit.libreoffice.org/6953

Change-Id: If7d503b7a4bfab31f40ceb0119876e5909252b2f
2013-12-09 08:50:52 +01:00
Miklos Vajna
627bfee263 sw: remove unused zorder data from bugdocs
Expecting that the shapes are on the drawpage in the same order as they
are in the file and providing zorder info at the same time doesn't work.
Either using names is required or the simpler way is not providing
zorder info. Fixed earlier bugdocs not to provide zorder info, so when
zorder will be handled, these tests will still work.

Change-Id: I771b0574eba489322998c84a60d5acb94fd09189
2013-12-06 17:18:00 +01:00
Miklos Vajna
c8e9a95363 DOCX import: fix import of wpg shapes after a wps textframe
Change-Id: I30844062bf4d4f15ca70d9f441f0505fa4f26bb7
2013-12-06 16:02:38 +01:00
Miklos Vajna
51a61bd4ac DOCX import: fix relativeFrom=page, align=right handling
Change-Id: I9c1df594457a8ccbbebf4ede61cc3a637ecc7023
2013-12-06 15:25:41 +01:00
Miklos Vajna
c2c7e4d8d9 DOCX import: handle groupshapes inside wpg elements (groupshapes)
Change-Id: Icb44f91219f75103f469f38f96d843b8e8251e92
2013-12-06 15:07:29 +01:00
Tushar Bende
9a37ce1898 fdo#71784: Invalid Sections getting added to the document after RT
Description: There was a problem for some documents, during export Invalid sectPr were getting added.
The root cause was faulty calculation of PageDesc value.
This was the reason for increasing number of pages in RT doc.

Conflicts:
	sw/qa/extras/ooxmlexport/ooxmlexport.cxx

Change-Id: I0700c735545614730d26be187d9047fd20ebf134
Reviewed-on: https://gerrit.libreoffice.org/6813
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
2013-12-06 05:25:44 -06:00
Miklos Vajna
a5c475c25b Santa Claus brings fixed background color of textframes in drawingml import
Change-Id: Ie2b6885aae5e26c3d29d372da730837cb7dc97ce
2013-12-06 10:38:52 +01:00
Tushar Bende
5efc2a34a5 fdo#71784:Preserve prop "allow row to break across pages" during export
Description:
If in original doc for table if "allow row to break across pages" is checked then during export
it used to write <w:cantSplit w:val="false"/> in trPr which was causing problem that all the cell
data was getting displayed on same page.

Change-Id: I5a20976ca91099de191eb1e2a7290b96dcdc6777
2013-12-06 09:38:14 +00:00
Miklos Vajna
31c65a129a DOCX import: never call lcl_start/endElement if handling mce elements
The problem was that after handling the mce elements
(AlternativeContent, Choice, Fallback) we still invoked the lcl version
of these methods and this resulted in duplicated properties in the
dmapper, finally resulting in incorrect position of the textbox.

Change-Id: Ib581162cba703fc1e2e44c1a9e63358891d6f78c
2013-12-05 18:34:54 +01:00
Miklos Vajna
8c73b16f5f DOCX import: declare wpg as a supported feature
This is the same as wps, just for group shapes.

Change-Id: I321b19ed538a6cb8f9068c7de6fbe9a8eb0bd82f
2013-12-05 14:19:15 +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
Jacobo Aragunde Pérez
13ce74fd9b fdo#64232: Unit test for font theme attributes preservation
The unit test checks three cases:
 * attributes in run properties
 * attributes in default run properties
 * attributes in style definitions

Change-Id: Ie3224f41bd29e8b258dbd6823b7c9549e1ef5b1e
2013-12-04 18:52:04 +01:00
Miklos Vajna
5003431057 DOCX drawingML shape import: always set Opaque
If behindDoc was 0, we did not set Opaque, so it went into the
background, fix this.

Change-Id: Id5aa683ffb388b1f4de33dcb19559729db5a4e02
2013-12-04 15:17:46 +01:00
Miklos Vajna
798a563db1 drawingml import: don't set CharEscapementHeight unconditionally
Commit 840a8573c8cebe67ddd3c9fe106c7dbd789bb334 (Fix fdo#70220
Superscript not imported from pptx., 2013-10-07) made it possible to set
CharEscapementHeight even if moBaseline is not set, but this causes
problems in the docx importer + not necessary, according to the bugdoc;
so just don't do that.

Change-Id: Ib95ac449bd8fdf6376261ddc86108f0d23f2200e
2013-12-04 14:52:26 +01:00
Miklos Vajna
cbeb028519 DOCX import: parse drawingML group shapes in oox only
This is similar to commit d5c934d150cb6cea5f96cbbee4fb5e8312bf027e
(n#792778 DOCX import: parse group shapes in oox only, 2012-12-14),
except that was for the VML importer.

The only difference is that in case of drawingML,
OOXMLFastContextHandlerShape::lcl_createFastChildContext() is only
called for the children of the group shape, not for the element itself,
so compare against the start token, not the current element.

Change-Id: Iddeabb20bbd5f0153e2fc4e6df463830126fdd37
2013-12-04 12:13:33 +01:00
Miklos Vajna
197ec9cf1b DOCX drawingML groupshape import: fix relative position
Change-Id: Ice07f423707b48a013a9b6325b11f88206c38e60
2013-12-03 15:39:04 +01:00
Miklos Vajna
57450afb76 DOCX import: declare wps as a supported feature
This means in case we hit an mc:AlternateContent element, we will read
the mc:Choice branch of it, in case wps is the required feature, not the
mc:Fallback one, which contains the information in VML format (after a
lossy conversion).

Change-Id: I476156bd1a39927dda903d14540155d1e62a211e
2013-12-03 15:39:04 +01:00
Jan Holesovsky
5a23dee064 sw unit tests: Introduce hasProperty(), make the redlining check more elegant.
Change-Id: I123bdfd7f21b78cbee6db2ceb9b98c2e473415d1
2013-12-03 12:31:39 +01:00
Miklos Vajna
a44e42b9cd filter: handle ooxml shapes in EscherPropertyContainer::GetCustomShapeType()
The problem was that the shapes produced by the drawingML import had
types like ooxml-triangle, and EnhancedCustomShapeTypeNames::Get() only
handles VML/binary MSO shapes (e.g. isosceles-triangle). Add an OOXML
mode, and in that case use msfilter::util::GETVMLShapeType() instead,
and only fall back to EnhancedCustomShapeTypeNames::Get() if necessary.

Change-Id: Ic93ba4719133dd3e96c17d2562642a03e559fefa
2013-12-03 11:58:23 +01:00
Miklos Vajna
4a0f0d714c CppunitTest_sw_ooxmlexport: speed up activex*
There were quite some unrelated content in these test documents...

1m24.754s -> 1m4.757s

Change-Id: I5e12a4c82c8c6f4454d2b2113d11aa289e125832
2013-11-28 18:03:57 +01:00
Miklos Vajna
a7806c318e SwModelTestBase: write csv output to stdout
This way a 2>/dev/null output still gives a csv, even if there were
various other warnings in the meantime.

Change-Id: I6ed3de4058c829e856286c7d484d6ed436c362a4
2013-11-28 18:03:56 +01:00
Miklos Vajna
8518cf42f4 DOCX drawingML shape import: fix position of group shapes
Change-Id: Ib5db40ecd5782d729d406b285d3399cc2626e335
2013-11-27 15:32:19 +01:00
Miklos Vajna
4932775dae DOCX drawingML shape import: handle wp:align for wps:txbx positioning
I.e. previously only absolutely positioned textboxes were handled, with
this, centered textboxes are fine as well. Given that the drawingml
picture import code already supported this, refactor common code to a
common method.

Change-Id: I56e0dbfa0ffc7e27a70a0e8fb8477681389a51cf
2013-11-26 17:15:53 +01:00
Miklos Vajna
0205f0a271 DOCX drawingML shape import: initial wps:txbx positioning
Change-Id: Id779ed88d657257b614d910a2191ed4974612c8f
2013-11-26 16:33:16 +01:00
Miklos Vajna
fee379666a oox: avoid crash in ContextHandler2Helper::processCollectedChars()
Change-Id: Ie70c9914745364c7f2beb3cb84a610ec919a950c
2013-11-26 15:50:22 +01:00
Miklos Vajna
1da6609eb8 DOCX import: default para style has priority over table styles
Since commit 23b67c536537c91020cf5a45ab5cb36d7316ed89 (DOCX import: fix
import of font size in table styles, 2013-03-04) we simply ignored all
table style run props, that indeed fixed testTableStylerPrSz, but broke
cases when otherwise reasonable run properties were specified in table
styles.

Fix this by only ignoring run props of table styles if the default para
style should have priority.

Change-Id: Ic10f635f4b8688af252214d5d38216b4d5c8fa8e
2013-11-26 13:07:18 +01:00
Miklos Vajna
74bf915fb4 DOCX import: tblHeader implies firstRow
If a table row is marked as tblHeader, then the firstRow section of the
table style should be applied, even if that row is in fact not the first
row.

Change-Id: I10605f404160e72c620e9204503203fea1c6d6d8
2013-11-25 17:32:36 +01:00
Miklos Vajna
1581b1fc3a CppunitTest_sw_ooxmlexport: make it possible to use ..._TEST_ONLY with -Werror
Change-Id: I451f81495a8e8535c8e0194198602ee5732164c6
2013-11-25 17:32:36 +01:00
Miklos Vajna
a6fe1a5b28 DOCX import: handle NS_sprm::LN_CFSmallCaps == 0 after NS_sprm::LN_CFCaps
"caps and no smallcaps" means style::CaseMap::UPPERCASE, not
style::CaseMap::NONE. Different XML elements in DOCX, single UNO
property.

Change-Id: I8cbc719f2c307d5d2cbd4af93ea61e35b640ad1d
2013-11-25 12:28:37 +01:00
PriyankaGaikwad
c6e333e73b Fixed for libreoffice crashes while opening file.
Change-Id: I85a16e4ef8d75f19250115d5522046a968d5fc91
Reviewed-on: https://gerrit.libreoffice.org/6760
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
2013-11-25 05:14:54 -06:00