1217 Commits

Author SHA1 Message Date
Jacobo Aragunde Pérez
222489744c sw/qa: add missing file for unit test
Change-Id: Ia940f4adc13df3a8a6df80ca4ed4f395a5f9c089
2014-05-06 16:56:15 +02:00
Jacobo Aragunde Pérez
36e22e83a1 oox: preserve camera rotation on shape 3D effects.
Camera options in shape 3D effects can have rotation settings like in
the following example:

  <a:camera prst="perspectiveRelaxedModerately" zoom="150000">
     <a:rot lat="19490639" lon="0" rev="12900001"/>
  </a:camera>

This patch preserves the a:rot tag and its attributes using the
shape grab bag. We created the class Scene3DRotationPropertiesContext
to be piled on top of a Scene3DPropertiesContext and process the
contents of the child item. It also adds a unit test for this case.

Change-Id: Id6bf58ad05fe5b49061619b6750ed0658badc9af
2014-05-06 16:32:28 +02:00
Jacobo Aragunde Pérez
1b7773cb07 oox: preserve scene3d/camera effects on shapes.
Shapes can contain 3D effects like in the following example:

  <a:scene3d>
    <a:camera prst="isometricLeftDown" zoom="150000"/>
    <a:lightRig rig="threePt" dir="t"/>
  </a:scene3d>

This patch preserves the a:camera tag and its attributes using the
shape grab bag. It also adds a unit test for this case.

Change-Id: Ic6a78031d2e1fb84a2bacd97b5cc9c55d9dbaa95
2014-05-06 16:32:28 +02:00
Jacobo Aragunde Pérez
9bb6956197 ooxml: fix cell theme color and shade preservation
The cell property w:shd was not being properly preserved when the
shade value was different from "clear". The shading affects the cell
color and the exporter was not taking that into account when comparing
the cell color with the original color to know if the user had changed
it.

Besides, we were not preserving the attributes themeColor, themeTint
and themeShade.

I have modified the existing unit test testTableThemePreservation to
add a check for those new attributes.

Change-Id: I06d2e668486803cba039eacb717a69413bd5a1df
2014-05-06 16:32:27 +02:00
Miklos Vajna
aa3a25ca74 oox custom shape preset data: fix typo in parsing awt::Size
Regression from commit f5ccbfdc561c68099872d1abe07ac72fcddedd35 (oox
customshapepreset: switch to generated data -> code, 2014-04-17).

Change-Id: I2106271e2f43e7936237628e47cd4e01ab34441c
2014-05-06 14:22:50 +02:00
Ravindra Vidhate
cbcc6189e3 fdo#77887 : Floating Table positions are not preserved when doing Export
The margin of the floating table from top of the page is not being preserved correctly and it also get increased.

The w:tblpPr tag is also not preserved.

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

Change-Id: I8a27a4bab94a1afd27a7ba49ca55ff014918fffc
2014-05-06 09:57:59 +02:00
sushil_shinde
61e8452c62 fdo#77727 PAGEBREAK In first paragraph was not rendered and exported.
Case 1: If PAGEBREAK appears in first paragraph, LO was inserting
       BreakType_PAGE_BEFORE but since it was first paragraph, PAGEBREAK
       was not rendered in LO hence not exported back to docx file properly.
  case 2: If PAGEBREAK appears after first run of any paragraph in document
       LO was rendering it in wrong paragraph.
  case 3: If COLUMNBREAK appears in first paragraph of section, LO was not
       rendering and exporting it.

Change-Id: Ic557b3e6f80cfa6dd3eb6b4204be7e6531b9ecbf
Reviewed-on: https://gerrit.libreoffice.org/9191
Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
Tested-by: Miklos Vajna <vmiklos@collabora.co.uk>
2014-05-05 07:34:45 +00:00
Luboš Luňák
2dda1cd4d1 tests for msoffice brightness+contrast
For commits 1139d618b8bc6ab823a96184bd0f0257980aad24 and
893fe88469dec5b727d96f8ea1b4edb9e88288a7 .

Change-Id: Ia59ec5c4226944280c4b585c87179d28303bda4b
2014-04-30 23:41:34 +02:00
Jacobo Aragunde Pérez
f519bfdef1 ooxml: Preserve reflection effect on shapes.
Reused most of the code of other effects, but adding some new
attributes specific for this effect. Finally, modified an existing
unit test to add a check for reflection.

Change-Id: Iffd0c1203e9c66a8d7b7f748d98d9c3ef01c7bbf
2014-04-30 16:46:10 +02:00
Jacobo Aragunde Pérez
9a61470eb1 ooxml: Preserve glow effect on shapes.
Reused most of the code of outerShdw and innerShdw effects. Modified
an existing unit test to add a check for innerShdw.

Change-Id: I7328fe696721d28c35b26ca1b702c7f64c63ab21
2014-04-30 16:46:10 +02:00
Jacobo Aragunde Pérez
5b3f88bfea ooxml: Preserve soft edge effect on shapes.
Reused most of the code of outerShdw and innerShdw effects, but adding
a new attribute "rad" and a flag to check if a color definition must
be written inside the effect definition. Finally, modified an existing
unit test to add a check for softEdge.

Change-Id: I0d32714bde9a5b05c726acd47b85b1dea3c6a581
2014-04-30 16:46:09 +02:00
Ravindra Vidhate
74126c42c3 fdo#77725 LO not able to open/save file when exported multiple times.
Problem description:
The LO is not able to save the file if exported multiple times and the exported file is used as input.
The main root cause is Extra Line breaks getting added even though there is no text available.

Change-Id: I0afb52380912cae140d7ded694cb7cae9a8362a9
Reviewed-on: https://gerrit.libreoffice.org/9112
Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
Tested-by: Miklos Vajna <vmiklos@collabora.co.uk>
2014-04-30 07:58:40 +00:00
Tor Lillqvist
7a83960b95 WaE: virtual function declaration not marked 'override'
Change-Id: I5142142cea4a9f3ffdb61c7df61a5845572b6e0d
2014-04-30 10:15:02 +03:00
Tomaž Vajngerl
dde833575e tests: add XML and HTML test tools to test module
XML and HTML parsing and XPath asserts are used by many test in
sw, sc and sd modules. This commit moves this functionallity to
test module, where it is available to all modules.

Change-Id: I53ad9c45b24f4c9bf106cb58ea619002968bfeda
2014-04-29 23:57:33 +02:00
Miklos Vajna
236c05bb1c CppunitTest_sw_ooxmlexport: move sdr-related tests to the dedicated suite
Given that CppunitTest_sw_ooxmlexport and
CppunitTest_sw_ooxmlsdrexport run in parallel, the
CppunitTest_sw_ooxmlsdrexport is way smaller, moving stuff from
CppunitTest_sw_ooxmlexport to CppunitTest_sw_ooxmlsdrexport speeds up a
toplevel 'make' a bit.

Change-Id: I97297404bc3a02b6ca65552670edf16137deb264
2014-04-28 10:14:45 +02:00
Sourav
f0860625e2 fdo#77719 File containing CusGeom gets corrupted on RT.
RT file gets corrupted because in presetgeometry tag shapetype is coming as blank.
A check is introduced to handle that.

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

Change-Id: Ie79db0f5dcadfa3cd5d3f54d4a676393b3a882c5
2014-04-28 10:04:21 +02:00
Rajashri
d9de57dd2a fdo#77713 : File Corruption - Header.xml
Document containing track changes within a SDT content
is getting corrupted.
Reason for corruption: In export side,parent tag [SDT] is
getting closed before child tag ['del' tag].
The corruption is resolved now.

Change-Id: I42451495f80e30ddfebab8b81bcf1e309b0c2ca2
Reviewed-on: https://gerrit.libreoffice.org/9146
Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
Tested-by: Miklos Vajna <vmiklos@collabora.co.uk>
2014-04-28 07:47:33 +00:00
Dinesh Patil
c865de60a7 fdo#77715: Fix for TOC flag field \c
Description:
If SEQIdentifier for TOC field \c is not there then blank "" are getting added
due to which opening of RT file in LO was causing system hang.

Implementation:
1) Check added for SEQIdentifier, if found then add SEQIdentifier with ""
e.g. {TOC \c "SEQ"}
2) If SEQIdentifier not found then don't add ""
e.g. {TOC \c}

Change-Id: I9dbfa1db51358908b246456201428de8b4104e10
Reviewed-on: https://gerrit.libreoffice.org/9145
Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
Tested-by: Miklos Vajna <vmiklos@collabora.co.uk>
2014-04-28 07:28:57 +00:00
Ravindra Vidhate
a3c00ee3c7 fdo#77759 : Embedded excel getting renamed to binary object.
The embedded excel (xlsx) when inserted on its own (unlike with chart) is getting converted to ".bin".
Note that only extension differs otherwise its an excel file only.
There is no loss of user experience in editing the file in MS Word.

The similar case is also exists when power point is inserted on it's own.

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

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

Change-Id: Ie13c098a794179c3b27100a7b9e30884fb47f656
2014-04-28 09:20:16 +02:00
umeshkadam
825265f093 fdo#77718: Picture inside SmartArt changes after RT
- The image data stream for the targets of relId's were getting overwritten,
 therefore the data was getting loss.
- Added anchor id as part of computing a unique name for images.
- Added UT for the same.

Change-Id: I999ba1b3701ef357641dd0365403a5d7ad8d18aa
Reviewed-on: https://gerrit.libreoffice.org/9121
Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
Tested-by: Miklos Vajna <vmiklos@collabora.co.uk>
2014-04-27 18:14:53 +00:00
Vinaya Mandke
2e8aad6d45 fdo#39056 fdo#75431 Section Properties if section starts with table
Section properties are not imported if the section starts with a table for DOCX,
and also for a few RTF files with combination of tables and section breaks.
SwXBodyText::createTextCursorByRange is not able to find the start of section and hence
section properties are not applied.

As a workaround added an empty paragraph at the beginning of every section
which has the the first element as a table. And then removed it when the
section ends ( DomainMapper::lcl_endSectionGroup is called).

Also handled to add the paragraph earlier, if there is a bookmark
so that the bookmark is not attached to the dummy paragraph.

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

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

Change-Id: I717ba40e22b055d974bc83d4414aeb2945e16d26
2014-04-24 12:57:51 +02:00
Stephan Bergmann
513a21aa6c Revert "sw: disable failing checks"
This reverts commit e7646e7e389a6a8c6481bd75127207b5090b126d.
2014-04-23 22:52:06 +02:00
Stephan Bergmann
8485a27602 Change RGB "FFFF00" -> "ffff00" to keep roundtrip test happy
Change-Id: I14e48d56b6f34be31a1580d448352b925f9aadde
2014-04-23 22:51:37 +02:00
Miklos Vajna
e7646e7e38 sw: disable failing checks
Test name: testShapeEffectPreservation::Import_Export_Import
equality assertion failed
- Expected: FFFF00
- Actual  : ffffffff
- Attribute 'val' of '/w:document/w:body/w:p[3]/w:r/mc:AlternateContent/mc:Choi
ce/w:drawing/wp:anchor/a:graphic/a:graphicData/wps:wsp/wps:spPr/a:effectLst/a:i
nnerShdw/a:srgbClr' incorrect value.

Test name: testShapeEffectPreservation::Import_Export_Import
equality assertion failed
- Expected: 1
- Actual  : 0
- XPath '/w:document/w:body/w:p[3]/w:r/mc:AlternateContent/mc:Choice/w:drawing/
wp:anchor/a:graphic/a:graphicData/wps:wsp/wps:spPr/a:effectLst/a:innerShdw/a:sr
gbClr/a:alpha' number of nodes is incorrect

Change-Id: Ia21a96009137e7e68900ff0d3b61656a9a7b7659
2014-04-23 22:42:39 +02:00
Stephan Bergmann
358eb6fe53 Fix XPath expressions
Change-Id: I5980ba6b77f8adfe9a57fd2cffd8034e26bb086d
2014-04-23 22:00:01 +02:00
Luboš Luňák
e5261dbd93 fix broken tests from cf33af732ed0d3d553bb74636e3b14c55d44c153
Change-Id: Ice31af80c3a837b2ee3a32ac973260476900ff35
2014-04-23 18:10:32 +02:00
Luboš Luňák
93ef2c3efa link to the latest xray version
Change-Id: Ib4971227af78787cc98fc6b6c0def76871583dcd
2014-04-23 18:10:32 +02:00
Jacobo Aragunde Pérez
211637d575 ooxml: Preserve inner shadow effect on shapes.
Reused most of the code of outerShdw effect. Modified an existing
unit test to add a check for innerShdw.

Change-Id: Ifdd77850bfd3b5fa250594469455b1b66c338611
2014-04-23 17:42:20 +02:00
Luboš Luňák
cf33af732e handle w:gridBefore by faking cells (fdo#38414)
Docx's w:gridBefore means that there should be this given space in the table
grid before any cells come. But writer requires tables to be rectangular, so
the space needs to be faked using cells without border. So far so good, but
now reality in the form of the retarded overdesigned writerfilter comes.
The internal representation of table data (and not just one actually) is
pretty non-obvious and hard to modify, seems to be modelled just to follow
the parser data the way it comes. Moreover dmapper gets notified of w:gridBefore
only after cells in the row have been already processed. So after futile attempts
to add the fake cells somehow in dmapper I've eventually given up and hacked up
input handling to fake input as if the fake cells were actually there (which
was tedious to find out as well, but at least it's reasonably doable).

Change-Id: I7107e13f28dd3f7093688782f64238167cead76f
2014-04-23 14:57:36 +02:00
Jacobo Aragunde Pérez
71b4af858e ooxml: Preserve outer shadow effect on shapes.
The goal is preserving the shadow effect with all its attributes using
the shape grab bag. This is the relevant piece of XML in the document:

    <a:effectLst>
      <a:outerShdw blurRad="50800" dist="38100"
      dir="2700000" algn="tl" rotWithShape="0">
        <a:schemeClr val="accent1">
          <a:alpha val="40000" />
        </a:schemeClr>
      </a:outerShdw>
    </a:effectLst>

In first place, we added members to the structure EffectProperties to
store the effect name and attributes. Later, when we create the shape,
we add them to the shape grab bag together with the shadow color (if
it is a theme color we store its name and transformations like in
other cases). Finally, we read back all these data from the shape grab
bag and write them back to the document.

I added a unit test for this shape property.

Change-Id: Idda2d5e2970cb8563e2ed13a84b2fa2d4b99aa70
2014-04-23 14:50:59 +02:00
Rohit Deshmukh
3d1046cfcd Fix of run properties of text box in nested group shape
- Textbox run character properties are change after roundtrip
	- Italic case was not handled in textcharacter properties

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

Change-Id: Ia38fcadce489ef0bfffb9bda402d13058cf6129a
2014-04-23 09:50:36 +02:00
Miklos Vajna
55c832d86e fdo#77600 RTF export: always close URL's before the end of run
In case the URL text has multiple portions, then MSWordExportBase
generates multiple URL's anyway, and this helps to avoid loosing some
direct formatting of the remaining portions of the paragraph.

Change-Id: Ifd72741de610ce69b9ae0978aa8f9a532a3aeed2
2014-04-22 15:08:48 +02:00
Miklos Vajna
8e8f9388c3 Related: fdo#77600 RTF import: RTFValue::equals: compare attribute content
Previously only the number of nested sprms / attributes was compared.
With this, the font of the bugdoc is correctly Arial, not Times.

Change-Id: I351de414b6734336b31c1334dbd2349072f16002
2014-04-22 13:10:57 +02:00
umeshkadam
255194801e fod#77122 DOCX filter: link between textboxes is not being preserved
Added support for linked textboxes for docx interoperability.

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

Change-Id: I7db4f5a1783afff53c64908d182788b262f5e863
2014-04-22 12:09:40 +02:00
Luboš Luňák
abe1e852a2 handle properly page breaks even if a page contains only a frame (fdo#55381)
The test document has 4 pages which only contain frames, first 3 pages
(sections) have <p> block with <framePr> and another <p> with just <sectPr>,
and the second paragraph would be removed, thus there would be no nodes on which
to actually set the page style and they would be set on nodes for the previous
page, overwriting its page style. The last page does not have its own <p>
at all, so it needs to be faked.

The changes in finishParagraph() are because of e.g. the comments-nested.odt
sw test, which there causes exception because of unknown property ParaStyleName
(comments do not use those it seems) and the code is skipped over (which
is probably a bug on its own, but it's unrelated to this change otherwise).

Change-Id: I9d37f992407a9b649c710d2a031ec4447fb11771
2014-04-21 19:18:40 +02:00
Thomas Arnhold
e9f918cefc fixincludeguards.sh: sw
Change-Id: I2b0625453ddc1c4cc2fa1626efff07beda17caf6
2014-04-19 11:10:12 +02:00
Miklos Vajna
6b6e4d471c fdo#75735 RTF import: fix COW when writing a nested structure
Regression from a48e2fd9049797110b3b2505c363557284987ca8 (fdo#44736 -
convert RTFSprms to a copy-on-write structure., 2012-12-07)

Change-Id: I2538f440e29cef6d40db2ea914e4afcbfe411890
2014-04-18 17:34:36 +02:00
Rajashri
a7f68538f5 fdo#74150:Numbered list getting display after RT -table-within-table-1.docx
Description:
For pStyle = 'NumberedList1', iLvl and numId was not preserved.
These tags needs to be preserved under numPr in document.xml
These tags are preserved  now.

Conflicts:

	sw/qa/extras/ooxmlexport/ooxmlexport.cxx

Change-Id: Ib6734c9ae55bd72d4fbc0f6d6cae85764ac1a244
Reviewed-on: https://gerrit.libreoffice.org/7767
Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
Tested-by: Miklos Vajna <vmiklos@collabora.co.uk>
2014-04-18 09:15:11 +00:00
Andras Timar
c79a5f87b1 remove executable bit
Change-Id: I91f6e861f6d0dbea1b57ac73857e0c706b27f681
2014-04-17 15:11:14 +02:00
Ravindra Vidhate
2496eaa5c4 fdo#77219 Image property Z-index [behindDoc] not preserved after RT
Problem description:
For the images who has the "Text wrapping" property set as Behind Text
 is not preserved after saving the file in DOCX format using LO.

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

Change-Id: Ic8555103909c0f1ed1cb58fba4dc2ef2f84cc9dd
2014-04-17 10:10:37 +02:00
Ravindra Vidhate
ccfc02f769 fdo#77476:FILE_SAVE : 'TIF' is changed to 'TIFF' in RT
1. Open the attached file in LO which has images [.TIF] format
2. Save the document as DOCX
3. Open the saved document in MS-Office or extract the content of the saved docx file.
 In [Content_Types].xml , .tif extension is changed to .tiff.

Change-Id: I73baea9ad6cd991b04d47e23865b77432127a510
Reviewed-on: https://gerrit.libreoffice.org/9010
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
2014-04-16 15:53:43 +00:00
Tushar Bende
cebb4abec1 fdo#74652 : Extra image gets added to the document body after RT.
Description: There was a problem for some documents, that when opened in LibreOffice
extra image was getting added to the first page of the doc and same could be noticed
even in RoundTripped doc.

The root cause was if picture bullet is added to the doc and there is no <w:lvlPicBulletId> tag
in <w:lvl> of <w:abstractNum> then removal of extra added graphic object from document body was
getting missed because currently that is handled in ListsManager::lcl_sprm() inside "case NS_ooxml::LN_CT_Lvl_lvlPicBulletId".

Checking if there is any remaining item in m_aNumPicBullets when LO hits the ListsManager destructor.
If there is any calling dispose() for all of them.

Change-Id: Ibfc3c93b68ff7d6ef0909fe789dda6db67ac11e2
Reviewed-on: https://gerrit.libreoffice.org/8940
Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
Tested-by: Miklos Vajna <vmiklos@collabora.co.uk>
2014-04-16 08:43:57 +00:00
Stephan Bergmann
1f742c520d Properly #ifdef some per-platform test code
Change-Id: I286fb35e223f205ecc649aa388471ef1b0823d86
2014-04-15 23:29:14 +02:00
Jacobo Aragunde Pérez
f8e0482fd6 fdo#75722: Push missing unit test files
Change-Id: If66aadaf0c17c078ab1030e86c3f11af5bd430ab
2014-04-15 11:49:04 +02:00
Jacobo Aragunde Pérez
1393ba60b1 fdo#70838: fix rotation transformation in DML exporter
This patch fixes an error in commit
c6ff03f37a6898f50a5ca07152168fb4fe911e05.

And now that fdo#75722 is fixed, I completed the existing unit test
for this bug with absolute position checks.

Change-Id: I76b4fa046db9b946fd23194e91686ffa4fcb5362
2014-04-15 11:35:49 +02:00
Jacobo Aragunde Pérez
b65de36ecb fdo#75722: fix incorrect import of rotated DML shapes
The DML importer used a tranformation matrix to rotate the shape, but
I replaced it with the same code that's being used in the VML importer
in which the position is correctly set.

I've noticed that I cannot use that code in all cases thanks to the
existing unit tests; that's why I added the bUseRotationTransform. In
case it is set to true the existing transformation matrix rotation is
used.

Finally I added a unit test for this case.

Change-Id: I260c14b42d169def786e15484e4ecb1d8e8584e4
2014-04-15 11:35:49 +02:00
Stephan Bergmann
cd0b935d55 Avoid undefined beahvior in test code
Change-Id: I721785a56c9adb2781c4afe14ed2a9e7254acab8
2014-04-15 11:24:49 +02:00
PriyankaGaikwad
1f274be55e Line spacing is not preserved for styles.
Description :
In StyleSheetTable.cxx, while setting the property "ParaInteropGrabBag" throws an exception.
Hence rest of the properties are not set.

Implimentation :
Skip that property so that rest of the properties will not be lost.

Change-Id: Id488de71bc5f893a7401420d9e63e4405b90f760
Reviewed-on: https://gerrit.libreoffice.org/8902
Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
Tested-by: Miklos Vajna <vmiklos@collabora.co.uk>
2014-04-15 08:55:29 +00:00
Miklos Vajna
904630a227 fdo#77267 RTF import: pard should reset current paragraph style
Change-Id: I8d78ce262a4e57161325231a78e48750909b1bad
2014-04-14 09:06:23 +02:00
Vinaya Mandke
c1e563f6ef fdo#76741 [DOCX] Table Alignment and width type
There are two issue related to table in the saved(exported) file
     - the table alignment in saved file is "left" instead of "center"
     - the table width type in properties is "auto" instead of "dxa"

     In the issue file alignment was specified in w:tblpXSpec="center"
     and so were missed at import. Added support to fetch
     HORI_ORIENT from frame properties if its not set in Table Properties

     The ::GetTablePageSize returns 0 if the table width is FIXED.
     Modified it to return the tableWidth in such case.

Conflicts:
	writerfilter/source/dmapper/DomainMapperTableHandler.cxx
Reviewed on:
	https://gerrit.libreoffice.org/8846

Change-Id: I02a3af5e9d8ef3746c4d6bec0a07a24e01cc12a4
2014-04-14 08:49:58 +02:00