1217 Commits

Author SHA1 Message Date
Miklos Vajna
f9b62506b2 fdo#75110 SwEditShell::DeleteSel fix start of selection when bSelAll == true
Change-Id: I3e8ce585b29619061b18ab1ab8f0cf6c7d421074
2014-03-12 18:11:40 +01:00
Miklos Vajna
970160f78e bnc#865381 DOCX import: fix w:trHeight for cells with btLr text direction
Also extend testcase: I made sure that the new version fails without
this fix and without the fix from
48b5b7641d0df960558082e8948da8598f801264 as well.

Change-Id: If33aa6d33cdc287620c12b84ad3f50279568bc8d
2014-03-12 16:11:33 +01:00
Miklos Vajna
48b5b7641d bnc#865381 DOCX import: fix btLr cell direction when having vertical merge
Change-Id: I527955671e1100f05da717bffe002131baaf0291
2014-03-12 15:47:59 +01:00
Luboš Luňák
ff768da111 test for ignoring large twips values (cp#1000043)
Change-Id: I366539b83c7a93a81fd72f3f2355b09c59f7ae58
2014-03-12 14:02:34 +01:00
Miklos Vajna
442192db68 sw: document that parseDump() uses the F12-generated layout dump
Change-Id: I9613cda8f08ce6a92235b00a053aca4541bba81d
2014-03-12 13:22:36 +01:00
sushil_shinde
df0b8665b5 fdo#76015 : Oleobject relationship entry was exported into wrong file.
- In given file header contains oleobject.
  - Relationship for oleobject was wrongly exported into
    document.xml.rels file.
  - serializer for writeoleobject was wrong.
  - fixed issue and added UT For it.

Change-Id: I03ab3a14def62b8061f58f7001684e0e945ad74a
Reviewed-on: https://gerrit.libreoffice.org/8534
Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
Tested-by: Miklos Vajna <vmiklos@collabora.co.uk>
2014-03-12 03:51:54 -05:00
Michael Stahl
76aa23c59b rhbz#1075124: writerfilter: fix tables with negative left margin
SvxBoxItem::nLeftDist is unsigned; the bugdoc sets a very large value
due to wrap-around which causes the table content not to be displayed.

DomainMapperTableHandler::endTableGetTableStyle() tweaks the
rInfo.nLeftBorderDistance by adding half the border line width to it,
which makes it positive; at that point the value has already been used
to init table::TableBorderDistances, so move that downward so it gets
the positive value too.

Change-Id: Ied2331b93f2e95845d7e8b2cc06e89e1ab24296e
2014-03-11 23:34:09 +01:00
Tomaž Vajngerl
e1323462b2 ooxml round-trip tests: Move w14 tests to its own test suite.
Change-Id: I42c7cd0aef3f9811440e70d8ea2c31432e1d32ff
2014-03-11 16:54:42 +01:00
Tomaž Vajngerl
2cf94cf173 oox: roundtrip-test for w14 elements in groupshapes
Change-Id: I51152c016d6a9e9604fd93c115577020373d964c
2014-03-11 16:54:41 +01:00
Miklos Vajna
30d94b0c40 i#124106 testcase
Change-Id: I732b4f8d758aac30e039d30e059aad0597307081
2014-03-11 16:37:46 +01:00
Ravindra Vidhate
ff2f55d6f0 fdo#35324: Text and picture water are not imported and not preserved in RT.
Problem : Open docx file which has Text/Picture as water mark.
1. The text is not imported properly also picture water mark is also considered as shape.
2. It writes the watermarks in Document.xml, while it should write in only Header.xml.

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

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

Change-Id: Ic988858da25a4cba3ae16e614d920e2e16053a5f
2014-03-11 10:57:46 +01:00
Caolán McNamara
1dec3cfba8 vexing parse
Change-Id: Ie541a8b6384cec6e067e7f7b75f5c17ce1a4d4a5
2014-03-11 09:15:32 +00:00
Jacobo Aragunde Pérez
554a0ca639 ooxml: export combo box controls
Export combo box controls as <sdt> elements. Added unit test.

Change-Id: I9eda25101240ec61f78ede0f0462d3ab8e77b09b
2014-03-10 22:36:17 +01:00
Jacobo Aragunde Pérez
c483e0eeb8 ooxml: preserve locale attribute in date controls
It is stored in the shape grab bag on import and saved back on export.
Defaults to "en-US" if not present in the bag.

Added a check for this attribute in the unit test.

Change-Id: Ib9c74f120628dbfc5e035500424cbad8caed53fe
2014-03-10 22:36:17 +01:00
Jacobo Aragunde Pérez
e172825b53 ooxml: preserve dateFormat for unchanged date controls
When saving a date control in a docx document, we were overwriting its
date format with "dd/MM/yyyy" because it's tricky to support all the
possible combinations. Nonetheless, there is no need to overwrite it
if the date in the control remains unchanged during edition.

We preserve the original date of the control, its date format and the
formatted date string on import, and we compare the date in the
control with the original one on export to check if we can write the
old values or we have to re-generate them. Only in case the date has
changed the format will be reset to "dd/MM/yyyy".

We had to add an InteropGrabBag field to the XControlShape because it
didn't have one, unlike other shapes.

Unit tests were modified to check that the dateFormat field is
preserved unchanged.

Change-Id: I01e5c990e90ff190b5a6d7ea3853e049ff24ef0a
2014-03-10 22:36:17 +01:00
Miklos Vajna
c98d649117 DOCX strict import: handle math
Change-Id: I8b1419cb71ef67f91bfa532faa283204dae0e25c
2014-03-10 10:51:26 +01:00
Miklos Vajna
d795fb224e DOCX strict import: handle lockedCanvas
Change-Id: I44c936a8972e1ae101aeab62ace61f4470d92b34
2014-03-10 10:51:26 +01:00
Miklos Vajna
f5985685dd DOCX strict import: handle SmartArt
Change-Id: I8c45f3153eafe882f3d9ee3be533c3c0e673527e
2014-03-10 10:51:25 +01:00
Miklos Vajna
49c3aff8d8 DOCX strict import: handle charts
Change-Id: I1933b3272ff735ae1ecb500fcd693e3ca99bf264
2014-03-10 10:51:25 +01:00
Markus Mohrhard
54195c53a9 add disabled support for export validation in writer tests
Still too many validation errors to enable it.

Change-Id: I45830f6cff8ef52bc63fdda61a99985f4f7d242a
2014-03-08 18:31:13 +01:00
Jacobo Aragunde Pérez
25cd2f4bb4 Fix types in a test
Change-Id: I2f857f564e100cc4cf6b885c5a8f96e506b4046f
2014-03-08 17:59:21 +01:00
Jacobo Aragunde Pérez
b238583071 ooxml: export date controls properly
Export date controls as ooxml Standard Document Tags (SDT) instead
of replacing them with plain text.

SDT date controls contain the date in ISO format as an attribute of
<date> tag, a custom date format that can be specified by the user
in the <dateFormat> tag and the date formatted in that custom format
in the <w:sdtContent> tag.

The unit test testFormControl from ooxmlexport suite was removed,
it only checked if the date control was exported as text and it
obviously fails now. A new test that checks the values of the
exported control was written instead.

A pair of date format functions were added to datetimeutils.hxx.

TODO: to avoid supporting all the posible custom formats that can be
specified in the <dateFormat> tag, it is forced to dd/mm/yyyy on
export.

Change-Id: I9d1b6f840ee9e133831fdb04ad399fe31bcb2063
2014-03-08 17:50:59 +01:00
Miklos Vajna
aaef39de32 DOCX strict import: fix pictures as well
Change-Id: I29f12eb1e5bfc39dc7d76efcff50dced061f7969
2014-03-07 18:07:56 +01:00
Miklos Vajna
195b8491d0 DOCX strict import: fix headers
Now that the document has a header, better to just test the bottom
margin, as in case there is a header, the top margin has different
semantics in Word and Writer.

Change-Id: I11212965ecd364cdc8a205c3ab3b8b71ed12944b
2014-03-07 17:36:14 +01:00
Miklos Vajna
37cc7e7471 DOCX import: handle points in ST_TwipsMeasure and ST_SignedTwipsMeasure
This fixes page size and margins in case of strict DOCX.

Change-Id: I65894eeef191a0f4bd92d1fa69a17e820aae3a43
2014-03-07 15:10:26 +01:00
Miklos Vajna
312e3c38be drawingML export: fix handling of dkVert pattern fill preset
We convert the dkVert preset to a certain hatch configuration (style,
distance, angle), but when we exported it back, then we didn't recognize
it, and wrote ltVert instead.

Change-Id: I021885496843f5ea5453af3473453bbec50d928f
2014-03-07 11:14:43 +01:00
sushil_shinde
c6b99eedda fdo#75158 : Handled unsupported fields for docx file.
- Handled unsupported fields using fieldmark API.
  - Added Unit Test.

Change-Id: I0c69458f330fa2e98821c392ea97410fe1b1e20e
Reviewed-on: https://gerrit.libreoffice.org/8391
Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
Tested-by: Miklos Vajna <vmiklos@collabora.co.uk>
2014-03-07 03:19:07 -06:00
Muthu Subramanian
ad737e7ff4 Re-enable the unit test (BackGraphicURL). 2014-03-06 21:24:19 +05:30
Muthu Subramanian
f8062328bc Disable unit-test BackGraphicURL test temporarily. 2014-03-06 18:00:10 +05:30
Miklos Vajna
8556cd8812 cp#1000039 DOC import: ignore symbol charset of the symbol font
Otherwise characters unhandled by our OpenSymbol font (like Arabic 0-9
numbers) won't be rendered using an other font, as no other font
provides the symbol charset. Do this in
SwWW8ImplReader::GetFontParams(), where we already have font name ->
font family mappings for a few well-known fonts.

The DOCX filter does the same for quite some time, and that's how Arabic
numbers in text using the Symbol font were rendered, instead of little
rectangles.

Change-Id: Ib794cac19ad7b073e39f3cbd7d4bad3994151c14
2014-03-06 10:02:57 +01:00
Michael Stahl
2b78f2cd7b rhbz#988516: DOCX import: fix context stack when importing header/footer
When a header/footer substream is parsed, a ParagraphGroup is started,
but not ended; so the properties of the last paragraph in the
header/footer are applied to a paragraph in the body.

The obvious fix to add a call to endParagraphGroup() at the end of w:p
element breaks table cells.  So add a call to endParagraphGroup() at
the end of the "hdr"/"ftr" element.

(The problem in the bugdoc became much more visible with commit
ca555c596043c88894b964ac5e21f5a7271d5f3b, but was there before)

Change-Id: Ib054f1882793049b39424c1076ba5d4b319cd027
2014-03-06 00:20:00 +01:00
Tomaž Vajngerl
477684669a ooxml: round-trip test for w14:anchorId & wp14:anchorId
Change-Id: Iada0ba2b6d1450167977915fe95a38b5bab2559c
2014-03-05 20:24:03 +01:00
Jan Holesovsky
27e57531b4 sw tests: Fix description of the new assertXPathContent() and use it broadly.
Change-Id: I3c8d5e491fcf9f871d72fb2d138bb7094ff69746
2014-03-05 12:06:02 +01:00
Tushar Bende
7b7b64f26b fdo#75557 : OLE Objects of type .zip not being preserved in RT
Problem was Document containing ole object if RoundTripped then after Roundtripping the OLE object was not working.
Which means if doc contains .zip file as ole object then after RoundTripping that .zip object was not getting opened .

Reason found that it was because of missing o:title attribute during RoundTrip for <v:imagedata> inside <v:shape>.

XML file difference :
        In document.xml,
        Before - <v:shape id="ole_rId2" style="width:72pt;height:40.3pt" o:ole="">
                   <v:imagedata r:id="rId3" />
                 </v:shape>
	After -  <v:shape id="ole_rId2" style="width:72pt;height:40.3pt" o:ole="">
                   <v:imagedata r:id="rId3" o:title="" />
                 </v:shape>

Verified that code changes working for other ole objects as well which are: Equations ,Excel Sheet and .zip.

Change-Id: I813de38bcd6e334ce38a661fdfcfa434ef246ed0
Reviewed-on: https://gerrit.libreoffice.org/8458
Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
Tested-by: Miklos Vajna <vmiklos@collabora.co.uk>
2014-03-05 04:22:30 -06:00
Vinaya Mandke
7691532a89 fdo#73596 [DOCX] Index:distance between columns
Import the "w:space" or the distance between multiple
columns of an Index
Modifies existing UT for the same

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

Change-Id: I6d38e106208524cb22d0b98b0071360865e64bc0
2014-03-05 11:07:19 +01:00
PriyankaGaikwad
0415e26961 fdo#73219 File corruption: Table in header
Description:
File corrupt due to the end tag </w:tc> </w:tr> </w:tbl> are missing after roundtrip in header4.xml

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

Change-Id: Ib05a50b3b3beca6c744b93360f9341ddcaa1a22a
2014-03-05 10:53:01 +01:00
Vinaya Mandke
6536826f2f fdo#74792 [DOCX] Grab-bag rels and images for SmartArt
Added support to grab-bag rels and associated Images for
data[i].xml, and drawing[i].xml.
Added UT for the same

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

Change-Id: I545825f67214f14037ab72b77764a07d575b8b5b
2014-03-05 10:13:40 +01:00
Nikhil Walvekar
d043c9e3be fdo#73596 Added support to import and export \r,\h Index flags.
This supports \r flag run-in type index. If \r is specified then we don't
have to write \e flag (separator char).
\h is Alphabetic separator, where indexes are grouped as per starting
character.

Change-Id: I690b29cef3d24b2a71b01f1deef0e418162d71aa
Reviewed-on: https://gerrit.libreoffice.org/8099
Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
Tested-by: Miklos Vajna <vmiklos@collabora.co.uk>
2014-03-05 02:48:29 -06:00
Miklos Vajna
e88ee8aa30 bnc#821208 DOC import: don't overwrite WW8Num* character styles
In general we're overwriting styles on import in case we're not pasting.
But these WW8Num* character styles are in general not from the document,
they are created because Writer needs a character style for each
numbering level to handle what's in the DOC file.

So, in case there is a character style with the same name as our
"character style for numbering" styles, prefer the later ones, as that's
intended most likely.

Change-Id: I675f867722360aca765bb96b0b43ea47deab9847
2014-03-04 15:38:55 +01:00
Miklos Vajna
f3a79ea8c3 CppunitTest_sw_ooxmlsdrexport: make this failure a bit more readable
Change-Id: Ia71f5ea712ad16d6eef3af1136613d38cd27b581
2014-03-04 10:17:47 +01:00
Norbert Thiebaud
a7db7c5ee2 make sw_ooxmlsdrexport 'work' on mac
Change-Id: I35558dfb71007932e9a371408e6306216cfbd0f9
2014-03-03 18:17:43 -06:00
Stephan Bergmann
b2371492df Use cstdlib std::abs instead of stdlib.h abs
...because the latter lacks the abs(long) overload in some popular environments,
cf. <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60401> "stdlib.h does not
provide abs(long) overload."

Similarly, stdlib.h lacks the abs(float), abs(double), abs(long double)
overloads compared to cmath there, whose use was apparently intended in
sw/qa/extras/ooxmlexport/ooxmlsdrexport.cxx.  Rewrote that to use
CPPUNIT_ASSERT_DOUBLES_EQUAL instead, which revealed that the comparisons need
rather large deltas of .1 resp. .2 (which the original code hid with an
implicit conversion to integral type, thus using an effective delta of 1).

Discovered with -Wabsolute-value ("absolute value function 'abs' given an
argument of type 'long' but has parameter of type 'int' which may cause
truncation of value") recently introduced on Clang trunk towards 3.5.

Change-Id: I4c41575ffdccb2944498b662bd3a53fd510cb0c0
2014-03-03 18:36:55 +01:00
Miklos Vajna
ec39578e5c sw/qa: clean up xray instructions
Change-Id: I34ed7b81a838a2c994bb028e92f463d7b08f242f
2014-03-03 17:34:09 +01:00
Michael Stahl
74b3f4f007 RTF import: fix paragraphs in header/footer
Change-Id: I91f04cad7a39428ce6f9555d18b974f0d45181f7
2014-03-03 13:53:22 +01:00
Michael Stahl
f03218f43e RTF import: add unit test for page break in continuous section
Change-Id: I8b766aa61b1121f9b7068f5ccbdc24ef97253432
2014-03-03 13:53:22 +01:00
Michael Stahl
e3f254ab82 RTF import: fix spurious page breaks at doc end (related: rhbz#1065629)
When a document ends with \sect it's possible that a spurious page break
is created.  In fact the spurious page break is always created by the
RTF importer, sometimes it is deleted again by
DomainMapper_Impl::RemoveLastParagraph() and sometimes not.

It is created because on the final \sect RTFDocumentImpl::sectBreak()
still calls startSectionGroup(), and the popState() for the \rtf1 group
then calls sectBreak() another time.

To prevent this, do not call startSectionGroup() from sectBreak() but
instead from setNeedSect(), and ensure that it is called as soon as
anything after \sect is read.

One unit test fails because the \page is not handled properly: the
conversion to \skbpage \sect \skbnone is not correct, because the \skb*
keywords are an exception and affect the \sect that precedes them, not
the following one; sending the \skbpage later unfortunately requires
additional cleanup later.

Change-Id: I3c1a3bceb2c8b75bbecdc748170562451ce5f5c3
2014-03-03 13:53:21 +01:00
Tomaž Vajngerl
7934120376 ooxml: rountrip test for w:compatSettings and mc:Ignorable
Change-Id: I69a602f3a5eb83f116113b1dbe8bb9f208bd5e5d
2014-02-28 20:24:39 +01:00
Miklos Vajna
440fbd6090 DOCX import: handle font theme references in group shape text
Change-Id: I1d5b86ad17b2c4a0945f483c94ac6abf410cf1d6
2014-02-28 13:51:35 +01:00
Tomaž Vajngerl
b731909d3c ooxml: extend roundtrip test - stylisticSets, cntxtAlts
Change-Id: I727df93d112e28be31b196c7f861cf1d0133bfe1
2014-02-27 17:35:04 +01:00
Tomaž Vajngerl
22d5d14d1a ooxml: extend roundtrip test - ligatures, numForm, numSpacing
Change-Id: Ibab36ef0e6352f740d339b12c81385053af84be1
2014-02-27 17:35:02 +01:00