1656 Commits

Author SHA1 Message Date
Tor Lillqvist
d77dec325e Blind fix attempt for error: no matching function for call to 'assertEquals'
Change-Id: Icd90d8e765af4bce6e4c56068fcdf40ff2ed3af4
2014-04-24 22:39:22 +03:00
Bjoern Michaelsen
66b1b690ab add unittest for moving around the marks
Change-Id: I31849e655ab9e9c9acc62f1fdc124d40342deb49
Reviewed-on: https://gerrit.libreoffice.org/9069
Reviewed-by: Björn Michaelsen <bjoern.michaelsen@canonical.com>
Tested-by: Björn Michaelsen <bjoern.michaelsen@canonical.com>
2014-04-24 16:15:20 +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
Stephan Bergmann
0cc8a2bb7e Remove dead code
Change-Id: I6034174b2273def43d176c3f463c1161757c8f70
2014-04-15 16:10:54 +02:00
Stephan Bergmann
2afe4c170d Clean up function declarations and some unused functions
Change-Id: I58c425ab9d2c01f8844226aff820dd56d88ec09c
2014-04-15 13:56:21 +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
Miklos Vajna
2df53ef500 fdo#74599 RTF import: enable StylesNoDefault compat setting
The Writer 'Heading 3' paragraph style is gray by default, but (just
like in case of DOCX) that shouldn't have any influence on the RTF
import result.

Fix this by moving the compat setting from the DOCX filter
implementation to the common dmapper.

Change-Id: I86c7cf1a66f82b438ce8379467773a88c9e229af
2014-04-12 16:46:26 +02:00
Rajashri
07f90c89ef fdo#76635 : Table borders not preserved after RT
The document containing a custom table is getting crashed.
In the document the user has created his own costume table styles and
in the created custom table style the user has set  repeat first row as header property.
The corresponding tag for this property is 'tblHeader'
LO was adding this property as a part of cellProperties in DomainMapperTableHandler.cxx.
But it is a part of a Row Property. That is why there was a crash @ open.

In DomainMapperTableHandler.cxx : 'endTableGetCellProperties' tblHeader property is removed from
style as it is not allowed for a cell.

Change-Id: I83cd369aa4497ec3f4b567174f23ddee9be2864e
Reviewed-on: https://gerrit.libreoffice.org/8848
Tested-by: David Tardon <dtardon@redhat.com>
Reviewed-by: David Tardon <dtardon@redhat.com>
2014-04-11 12:30:45 +00:00
Tor Lillqvist
84272d115d Introduce twip/mm100 conversion functions instead of duplicated macros
Change-Id: Ib689e35b417e0e9016cd6a239c986e0603a99d62
Reviewed-on: https://gerrit.libreoffice.org/8837
Tested-by: LibreOffice gerrit bot <gerrit@libreoffice.org>
Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
2014-04-11 10:19:05 +00:00
Rohit Deshmukh
05c5da4c37 fdo#76597: Fix preservation issue of Spacing between paragraph
Change-Id: I458bed111893a8d2fef79b11e28263a5bd2ed9cf
Reviewed-on: https://gerrit.libreoffice.org/8842
Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
Tested-by: Miklos Vajna <vmiklos@collabora.co.uk>
2014-04-11 07:52:57 +00:00
Jan Holesovsky
492c1da6be Off by one.
Compared to 4c8d29f4f26bfa30689b2b98414fe874225b9a2e, we do not have to
provide 0 to mark the end.

Change-Id: I3b9a3de61df48caf271cb06b27cf9cfa174dc4ed
2014-04-10 11:03:42 +02:00
YogeshBharate
a7bc9c1e49 fdo#77051: Preservation of Index field flag '\f'.
Problem Description:
- In LibreOffice, the index field flag '\f' was not
  getting preserved after roundtrip as there was no
  support for it.
- '\f' field flag is used for Specific Entry Type.
  ex. In our case it is "Syn"

Implementation:
- Provided import & export support for Index field flag '\f'
  and added UT for the same.

Change-Id: I97c2456dd73c8bdf89ab105f8cac71bf7e2ad164
Reviewed-on: https://gerrit.libreoffice.org/8839
Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
Tested-by: Miklos Vajna <vmiklos@collabora.co.uk>
2014-04-10 08:15:54 +00:00
Norbert Thiebaud
066288976b tweak the height value in testDmlRectangleResize once again to pass on Mac
Change-Id: I4d4780bdd8491c00140babc7651fc80a711bcf20
2014-04-09 12:05:08 -05:00
Luke Deller
19644e657d Unit test for .doc export of full colour borders
This test exercises the *export* component of recent work to add support
for full colour borders in .doc import/export.

Change-Id: I2da0b8b488e399d0cd4791678fac6e1c85921c2c
Reviewed-on: https://gerrit.libreoffice.org/8887
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
2014-04-09 10:23:38 +00:00
Miklos Vajna
8329afc2ba SwModelTestBase: use rtl::ByteSequence
Change-Id: I39dde5fa13f6d393ebac05138e1deadd98689199
2014-04-09 11:45:52 +02:00
Jan Holesovsky
4c8d29f4f2 html export: Simplify & speed-up the test.
Change-Id: I619e4441898fe10e319d9f95413f078003364579
2014-04-09 09:50:30 +02:00
umeshkadam
48dd437039 fdo#76583 DOCX import: Floating table information is not preserved in RT file.
- Earlier the table width was compared with the text area to decide if the
  fly has to be created for the floating table.
- In most of the cases such floating tables were the ones which did not have
  any text around them and not importing such tables as fly made sense.
- But there are some scenarios where in the floating tables have width
  greater than the text area but are positioned in a way such that they begin
  before left margin and end before the right margin moreover they appear to be
  really floating (unlike in first scenario) as they have text around them since
  there is still room for the text.
- Handled this scenario and added a UT.

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

Change-Id: I7ea25e04ed7c6315e4e4fe4b67badf451c30cd0c
2014-04-09 10:06:36 +02:00
Michael Stahl
36532778a6 sw: initialize FieldResult::m_eType
Change-Id: Ia41ceb42b360a17021a30b5ed420d36759116255
2014-04-08 15:47:51 +02:00
Tor Lillqvist
51c2cbf539 WaE: passing OUString by value, rather pass by reference
Change-Id: I72a1617e54157129bdbfd10f39deaf280006b6c9
2014-04-08 15:55:59 +03:00
Tor Lillqvist
009db0e3a7 WaE: overriding virtual function declaration not marked 'override'
Change-Id: Ie799cd4a2d9c4c9de70712dbfd5de57944d8ecbc
2014-04-08 15:55:59 +03:00
Tomaž Vajngerl
5f7e661732 sw html: Add missing textAndImage.docx document..
Change-Id: I0dc99a17625101673281403c3000d3293782b05d
2014-04-08 14:01:32 +02:00
Tomaž Vajngerl
011cd3926f sw html: HTML export test - option with or without "skipImages"
Additionally add loading of HTML document and parsing the document
with libxml - to be able to assert with xpath expression.

Change-Id: I7c62082a124c3705626cd76c8a4cdabc16372399
2014-04-08 13:15:57 +02:00