1217 Commits

Author SHA1 Message Date
Miklos Vajna
f7a7a5a686 SwAnchoredDrawObject::GetObjBoundRect: ignore relative size of group shapes
Instead of not reading the relative size of group shapes at all, read it
into the document model, just ignore it during painting. Visually this
doesn't change anything, however this way we can write the information
back to the file.

Change-Id: Ic24fceaacec0f831d657a35e52493e1c0e9bf626
2014-02-17 17:16:15 +01:00
Miklos Vajna
2d93aee9bf DOCX export: handle relative size of drawinglayer shapes
Change-Id: If4548f7b7a530402158ce5f84febe4fe5eaf2184
2014-02-17 14:49:21 +01:00
Miklos Vajna
ea47fed157 DOCX export: try harder to detect in-background shapes
Change-Id: If7a4a5b9aad564d026173b942fd0b4a2fb52e157
2014-02-17 12:56:25 +01:00
Miklos Vajna
8b6ff51bb8 fdo#74357 DOCX import: avoid layout problem with automatic spacing
Commit 279ff2e03371542d014bf281e73282ba8080cf6b (bnc#816593 DOCX import:
fix auto para spacing without compat option, 2013-08-28) corrected the
value of "auto" paragraph spacing, but unfortunately this triggers a
layout problem:

warn:legacy.osl:12692:1:sw/source/core/layout/tabfrm.cxx:2513: debug assertion: <SwTabFrm::MakeAll()> - format of table lowers suppressed by fix i44910

resulting in "the rest of the table is not rendered by the layout".

Given that we backported the original fix to stable branches as well,
just stay on the safe side and revert back to the original behavior in
case the document requests the web layout.

Change-Id: I72683530b5218beff084bec8218cc99946b44802
2014-02-17 10:24:32 +01:00
Miklos Vajna
e5fd7c2dac fdo#74357 DOCX import: fix nested tables anchored inside tables
Regression from bbef85c157169efa958ea1014d91d467cb243e6f (bnc#779620
DOCX import: try harder to convert floating tables to text frames,
2013-10-01), the conversion of nested tables is delayed by default till
we know the page size. However, in case the anchor is in a table, we
should convert it right away, because the conversion of the parent table
would invalidate our XTextRange references.

Change-Id: Id41556e721c6e1c7239e4ea25abd57c999d2219b
2014-02-17 09:56:36 +01:00
Zolnai Tamás
6357031a32 DOCX import: floating tables belong to the same paragraph
When two floating tables were belong to the same paragraph,
import makes one of them anchored to the other instead of
anchorig both to the corresponding paragraph.

Modifications:
- Check the whole text range for anchored frames not
just one point of it.
- Save frame format's name because SwFrmFmt pointers can
become invalid.

Change-Id: Ide7c894065b619095a8e713ff0622bbea4f199b6
2014-02-16 17:44:51 +01:00
Zolnai Tamás
05955dd209 DOCX export: nested text frames
In Word it is not allowed to anchor a shape to
an onther shape.
That's why this code write text boxes only on the first level,
nested frames is also written out on the same level because
writeDMLText/WriteVMLText will push nested frames
into m_aFramesOfParagraph's back.

Change-Id: Ie1956ac9ac0ed56ff9611ff9763eb454f02558b9
2014-02-16 17:35:14 +01:00
Miklos Vajna
a6278bc3a9 drawingML import: fix inheritance of character height
The problem was that in case a shape had multiple (e.g. two) paragraphs,
and in case the first paragraph had an explicit character height, but
not the second, then the cursor carried over the explicit character
height to the second paragraph, but it shouldn't, as that leads to
incorrect character height in the second paragraph.

Fix this by remembering the default character height and using that in
case nothing is set explicitly.

Change-Id: I66e06d5cf192739fb254f7280c74617171d9ee6a
2014-02-14 16:50:19 +01:00
YogeshBharate
e3b03a0285 Added unit test for fdo#73872:
- Issue related to footer reference.
- Added unit test to check footer1.xml.rels
  is contains in doc after roundtrip.
- Also check Id = rId1 in footer1.xml.rels file.

Conflicts:
	chart2/qa/extras/chart2export.cxx
Reviewed on:
	https://gerrit.libreoffice.org/7851

Change-Id: I52fa8017abb7552c7752185873ff2bfb46689367
2014-02-14 12:53:13 +01:00
umeshkadam
cf4e5e4979 FDO#74774 : issue with number of child nodes of tag CubicBezierTo.
Issue :
 - Number of child nodes required by cubicBexTo should be 3 of type "pt".
   While exporting, sometimes the child nodes are less than 3.
   The sequence of writing these tags was getting messed up.

Implementation :
 - corrected the logic for writing the sequence of cubicBexTo tag.

Change-Id: Ic26db72b2c516276c2e6452a21b4106d6a0a1a80
Reviewed-on: https://gerrit.libreoffice.org/7990
Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
Tested-by: Miklos Vajna <vmiklos@collabora.co.uk>
2014-02-14 11:12:19 +00:00
PriyankaGaikwad
0ff99adddc fdo#74605 negative value for wp:extents value causing corruption
Description:
After roundtrip
<wp:extent cx="-22327235" cy="149225" />
The cx value is negative so that the roundtrip file gives error while opening.

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

Change-Id: I563f292ac5aaaeb0726159db1f4852a7e237f7ea
2014-02-14 12:04:23 +01:00
YogeshBharate
fa9d574ae1 Code changes for fdo#74107:File Corruption - Issue with outerShdw
Problem Description:
- In document.xml, outerShdw dist contains the negative value after roundtrip.
- Due to negative value file get corrupted.

XML difference:
 Roundtrip: Before fix
 <a:outerShdw dist="-1363652116480" dir="2700000">

 Roundtrip: After fix
 <a:outerShdw dist="57811035" dir="2700000">

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

Change-Id: Ied752672244d5768dee554e907f2f4d7a9d077d5
2014-02-14 10:42:13 +01:00
Rajashri
d738b06313 fdo#74431 : Captions' are preserved but remove a space
For the below captions :
ALPHABETIC
alphabetic
ROMAN
roman
ARABIC
in document.xml, captions were added as
<w:instrText xml:space="preserve"> SEQ "scientific" *ROMAN </w:instrText>
-no space after *
-Double quotes added for scientific
-For Caption ARABIC, it was comming as
<w:instrText xml:space="preserve"> SEQ scientific *Arabic </w:instrText>
it should be
<w:instrText xml:space="preserve"> SEQ scientific * ARABIC </w:instrText>
- After adding the above code, anchor value for a hyperlink tag was getting
corrupted. So aaded a fix for that.
UT which was failing due to above code changes :testBnc834035
"equality assertion failed
- Expected: _Toc363553908
- Actual  : Figure!1|sequence"

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

Change-Id: I9124eefa0ae63baf7ee3eaa2148f3c739d6fa699
2014-02-14 10:25:03 +01:00
Zolnai Tamás
5e5ec33eb4 Revert "DOCX import: fix relative width of floating tables"
This reverts commit 7ff8414a411ae35e1fe56e9724646d0e94fa17f6,
which was the result of a misunderstending.
2014-02-13 20:19:49 +01:00
Tushar Bende
d9809c68f6 fdo#74141 :In <w:ind> Right margin gets added even if not present in orig doc.
There was a problem that in style.xml and document.xml in <w:ind> tag "right" & "left" margin
attributes gets added(w:right=0 & w:left=0),if these attributes are not set in original document.
(In this case LO should not write these attributes in <w:ind>)

eg. if original doc has implicit right and left indentation values set(In style.xml) and there is no
explicit values provided for some para (In document.xml) still it used to write w:right=0 and w:left=0
in <w:ind> tag of document.xml which overrides an entry from style.xml.

XML difference :
- Original file:
<w:ind w:left="567" />
- Roundtrip file Before Fix:
<w:ind w:left="567" w:right="0" w:hanging="0"/>
- Roundtrip file After Fix:
<w:ind w:left="567" w:hanging="0"/>

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

Change-Id: Ifa01bae24d48bb38d5e255356247c46a43beefcc
2014-02-13 17:43:47 +01:00
Zolnai Tamás
7ff8414a41 DOCX import: fix relative width of floating tables
Relative width of tables means relative to the page
and not to the paragraph area so we have to set
the RelativeWidthRelation property of the containing
text frame.

Change-Id: I054d22e1883eb0ed9b07b9141bb2bea956e8367e
2014-02-13 15:25:58 +01:00
Zolnai Tamás
f16368777b drawingML export: hatching of shapes
Change-Id: I7111d4064d033e27659c7b45650d596df22c593f
2014-02-13 15:25:58 +01:00
Pallavi Jadhav
78c5cbc720 fdo#74153 : Preservation of Column Break with column_count = 0
Issue :
	1] DOCX containing column break with column_count = 0
	   was not getting preserved after RT.
	2] LO was writing column break only when column_count > 1

	Implementation :
	1] Removed check column_count > 1. So that if LO
	   encounters a column break with column_count >=0,
	   it should preserve it.
	2] Added export Unit Test case.

	Behavior after Fix :
	LO is able to preserve Column Break with
	column_count = 0.

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

Change-Id: I29c77f27184ec5afed354be01fc68e0d3471bfee
2014-02-13 15:18:43 +01:00
umeshkadam
515b5c7688 fdo#74110 : Issue with <a:prstGeom prst="rect"> tag in document.xml
Issue:
 - While exporting the system used to write adjustment values for preset shape type "rect" in document.xml
   with the shape guide name(adjustment name) being empty.
 - This is not accepted by MS Office. Hence the file was resulting as corrupt.

Implementation:
 - The preset shapes are being picked up from GetOOXMLPresetGeometry(), which refers pCustomShapeTypeTranslationTable[] array
   for the mapping.
 - Most of the shape types have been commented in the pCustomShapeTypeTranslationTable[] array therefore the GetOOXMLPresetGeometry()
   defaults the shapetype as rect, whereas the adjustment values are being picked up for the actual shape type(s).
 - Uncommenting the commented shape type translations( for instance textInflateTop) in pCustomShapeTypeTranslationTable will
   eventually write prst="textInflateTop" under the tag prstGeom which is invalid.
 - It should probably go under prstTxWrap.
 - In order to avoid the corruption, thought of adding a check before writing the adjustment values. If the shape type is "rect"( which is defaulted
   and does not have adjustment values defined in presetShapeDefinitions.xml) then avoid writing the adjustment values under this tag.

Conflicts:
	oox/source/export/drawingml.cxx
	sw/qa/extras/ooxmlexport/ooxmlexport.cxx
Reviewed on:
	https://gerrit.libreoffice.org/7765

Change-Id: I6511e9a3ee0c01962d6e82997705a484161086ef
2014-02-13 14:19:08 +01:00
Ravindra Vidhate
cc1c838942 fdo#74215:Fix for empty imagedata in Number Pic bullet
1. While exporting through LO, it writes numPicBullet with imagedata of size 0,0.
2. Because of this image file of 0KB is added in media folder
3. While opening the document in MS-Office, it shows the image missing at the top
which is of 0 KB size.

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

Change-Id: I5f8f187fc4fe678dceb3f2b594de74a6b52cbe74
2014-02-13 12:55:03 +01:00
Rohit Deshmukh
1f34909fd7 fdo#74106: Fix for Hebrew Text-Bulleted List converted to Numbered List
Problem:
   Hebrew Text-Bulleted List converted to Numbered List in round trip file

Implementaion:
   - Added Hebrew support for import and export for list.
   - Added Unit test case.

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

Change-Id: I739f4b74fb0451f6da80be06114c48074d1e4cdf
2014-02-13 12:14:04 +01:00
Vinaya Mandke
8c6ee9360b fdo#73541 "Page Margins : Mirrored" was not preserved on export to DOCX
Mapped Property at import, so Page margins mirrored are imported correctly.
Also exported the mirrorMargins in settings.xml
Added export UT for the same.

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

Change-Id: I2d90643f55e1dc1d96c809e28ce37dee4653bf57
2014-02-13 11:51:50 +01:00
Pallavi Jadhav
e5a891793b Fix for: DOCX-Preservation of Line style Dash type of "Shape with text inside"
Issue :
        File containing Shape with text inside it having Line style as
        Dash type is not getting preserved after RT in MS office 2007.

    Implementation :
        1] Added XML element <v:stroke> with attribute  dashstyle="dash".
        2] Written Export Unit test case.

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

Change-Id: Id01c5975c2c1cf176a7459f65973f4c9c3c9b9d8
2014-02-13 11:00:08 +01:00
sushil_shinde
18044a6095 fdo#69646 Export of table with auto-width, at least one column with auto-width
- In case of auto width to table it should export as auto.
 - Added Unit Test to check it is properly exporting table.

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

Change-Id: Id448111b81110bbc6c109f3da9195075b9b8a9fc
2014-02-13 10:49:56 +01:00
Miklos Vajna
08ab574732 CppunitTest_sw_ooxmlimport: make this actually test something again
Change-Id: I05d8b0dafcdea68d57137873ea52d4ab28a9b12b
2014-02-13 10:25:17 +01:00
sushil_shinde
4d34d43b29 fdo#69656 table with auto-width and at least one column with auto-width.
- In case of auto width of table and atleast one cell of table
    is auto width It was setting table width to 100% relative width.
  - hence it was causing rederening problem, table width was wrong
    while rendering.
  - Changed 100% hardcoded value, now setting total width of table
    as per grid values.
  - modified one UT since we no longer setting width of table to
    100% default in case of 'auto' width.
  - Added one UT to check proper table width while importing.

Conflicts:
	sw/qa/extras/ooxmlimport/ooxmlimport.cxx
Reviewed on:
	https://gerrit.libreoffice.org/7593

Change-Id: Iae396c632eb1ef0c06efaa8c1965e4a68f12c6b1
2014-02-13 10:25:16 +01:00
Noel Grandin
15535e32dd convert SvStream::operator>> methods to ReadXXX methods
First, I updated the clang rewriter to do the conversion.
Then I lightly hand-tweaked the output for the few places where
the rewriter messed up, mostly when dealing with calls on "this".

Change-Id: I40a6a977959cd97415c678eafc8507de8aa3b1a9
Reviewed-on: https://gerrit.libreoffice.org/7879
Reviewed-by: Michael Stahl <mstahl@redhat.com>
Tested-by: Michael Stahl <mstahl@redhat.com>
2014-02-12 15:31:40 +00:00
Miklos Vajna
02a17688f3 DOCX drawingML import: fix relative size of group shapes
Change-Id: I5a126bd9eaacaee2e080837a34d8ac41cbb9ea10
2014-02-12 16:12:01 +01:00
Zolnai Tamás
2efd433478 drawingML import: picture with scheme color
Theme fragment must be loaded for pictures too.

Change-Id: If4c412926319df2beaecfc120065bd011fc3eb57
2014-02-12 13:20:31 +01:00
Zolnai Tamás
682ab83252 drawingML export\import: cropping of shape's fill texture
In Writer shapes had no cropping property so far. With this
commit this is introduced as a FillProperty and has the same
type as the cropping used for pictures
(Picture context menu > Picture > Crop).

Layout and UI will be an other step. On the UI it would be placed
on the Shape context menu -> Area, when Bitmap is selected as fill type.

Note: In case of picture/graphic, cropping property is imported from
and exported to a:srcRect instead of a:fillRect.

Change-Id: Idc1ed2d40cb20b6992e94f14e7e4d853e1f55d02
2014-02-12 13:20:31 +01:00
Miklos Vajna
9e3e7f89a0 DOCX export: avoid 0 or 1 relativeHeight when it's a real value
The z-order can be any number, Word uses kind of random 32bit integers,
we count from 0. It turns out 0 and 1 may have some special meaning, as
counting from 2 (instead of 0) fixes the visibility the problems in the
bugdoc.

Change-Id: I695a625fc0ab8206cc09896bcf02ff7689f1defc
2014-02-12 11:31:20 +01:00
Adam Co
2eb142f420 Add unit-tests for DOCX preservation of 'table cell redline'
Added unit-tests to make sure that 'table cell redlines'
(e.g. - table cell was inserted \ removed) are being round
tripped correctly from a DOCX file.

Change-Id: I773cb51a39654d2640200489d5199361b56396c7
Reviewed-on: https://gerrit.libreoffice.org/7878
Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
Tested-by: Miklos Vajna <vmiklos@collabora.co.uk>
2014-02-12 10:12:43 +00:00
Adam Co
8995956302 Add unit-tests for DOCX preservation of 'table row redline'
Added unit-tests to make sure that 'table row redlines'
(e.g. - table row was inserted \ removed) are being round
tripped correctly from a DOCX file.

Change-Id: I369dd32e7372d0cf0add19197f07d0ad604e9ef0
Reviewed-on: https://gerrit.libreoffice.org/7849
Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
Tested-by: Miklos Vajna <vmiklos@collabora.co.uk>
2014-02-12 09:00:14 +00:00
Jacobo Aragunde Pérez
42e4d23769 ooxml: Preserve color transformations for shape theme colors
Colors can have modifiers like in the following example:

  <a:schemeClr val="accent6">
    <a:lumMod val="40000"/>
    <a:lumOff val="60000"/>
  </a:schemeClr>

In the case of RGB colors, the transformations are merged within the
RGB color itself on import, so there's no need to preserve the
original transformations, but that's necessary in the case of scheme
colors.

Slightly modified an existing unit test to check this feature too.

Change-Id: I3a03a56f2b633f283c392e54842b326bd4df316b
2014-02-11 22:20:14 +01:00
Miklos Vajna
be7d41a2be Revert "fdo#72563 : PAGEREF field tag not preserved during Roundtrip"
This reverts commit 138bd3d656c30911d5f45a8b6804e50857f6b30c. See
comment 5 in the bugreport, the fix in its current form causes more
trouble than it fixes.

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

Change-Id: I64f64f02a2e073b96e165c81bd2f85928e5527bc
2014-02-11 09:51:17 +01:00
Jacobo Aragunde Pérez
05506b377a ooxml: preserve font theme color tint property
Change-Id: I5cbc8fda63a9fd2999555d5a46ea3a063685ffc7
2014-02-10 20:57:09 +01:00
Miklos Vajna
d6ee755e35 drawingML import: ignore zero relative size
Zero means ignore me, use absolute size in this context.

Change-Id: I872810a9abf9e25c576f483a77494e1b87f3510a
2014-02-10 13:52:23 +01:00
Miklos Vajna
e86a602df7 drawingML import: handle RelativeWidth/Height for drawinglayer shapes
This was already handled in the VML importer previously.

Change-Id: Ie04ed0cec632222c5f6481943ad7f4db66a752e5
2014-02-10 12:32:29 +01:00
Caolán McNamara
b74f9e31b2 coverity#1130361 Unchecked dynamic_cast
Change-Id: I2c93a085fe55098777ae7b41953f2610903b5a54
2014-02-10 11:21:11 +00:00
Caolán McNamara
758cf90bdb coverity#1130362 Unchecked dynamic_cast
Change-Id: I58d9c7e933152e0d8ca69125572c820b8dbe7405
2014-02-10 11:21:11 +00:00
Caolán McNamara
74dd647e76 coverity#1130363 Unchecked dynamic_cast
Change-Id: Ibc1e6f5e7c7f2a0546847194de5f77ab51b2d578
2014-02-10 11:21:10 +00:00
Caolán McNamara
c02e3b47af coverity#1130364 Unchecked dynamic_cast
Change-Id: Ic8eab1630b79b49b67646eea52b26e0f24fd2d49
2014-02-10 11:21:10 +00:00
Caolán McNamara
778e88e863 coverity#1130365 Unchecked dynamic_cast
Change-Id: I1298d220c42aa7282cdc6c256727620ee1a6f749
2014-02-10 11:21:10 +00:00
Caolán McNamara
87015e5433 coverity#1130366 Unchecked dynamic_cast
Change-Id: Icf7576b12fe3c876193fd87ce07c18e57a3dfad7
2014-02-10 11:21:09 +00:00
Miklos Vajna
6b5ef795ed fdo#74709 RTF import: implement RTF_CLPAD*
Change-Id: I482735e3fc4091be983b2c7484e086f5d0dd283a
2014-02-10 09:58:14 +01:00
Miklos Vajna
43feacd533 sw: fix build
1edca1fe0aaadbd48ea23b691dc244ad2a6b6f73 (fdo#74499: - FILESAVE:System
throws a segmentation fault while saving files, 2014-02-06) added a unit
test to make sure a crash doesn't occur, except that it forgot to fix
the problem itself. Disable that for now till the real fix arrives.

Change-Id: I2dd2e2f2bb6f518acf082534bb048fb2d13e58e8
2014-02-08 12:28:55 +01:00
Zolnai Tamás
feae30c4ce ODF export/import: text vertical adjustment attribute of text frames
ODF standard handle 'textarea-vertical-align' as a
'graphic-property' which "specifies formatting
properties for chart, draw, graphic, and frame elements".
So this change fit to the standard.

Change-Id: I956f512953380983c2c882e943178335fd4dbfeb
2014-02-08 02:59:50 +01:00
Zolnai Tamás
718203e370 drawingML export/import: text frames with vertical alignment
Change-Id: I469da0a8234dd2979facfed3d66907aad1a138ab
2014-02-08 02:59:50 +01:00
Tushar Bende
1edca1fe0a fdo#74499: - FILESAVE:System throws a segmentation fault while saving files
Description: Docx containing text frame giving segmentation fault while saving file.
Reason found is inside writeDMLTextFrame() it was getting SdrObject pointer which is NULL
and accessing this NULL pointer was giving seg fault.
issue is fixed with commit 4de30fa7fd6abb5c2ea2b63a0e306954f7acc1b1 here is the export test.

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

Change-Id: I0ab4bbf2126abbfa0fa37d2156aa3390ded0997c
Reviewed-on: https://gerrit.libreoffice.org/7894
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
2014-02-07 20:37:16 +00:00
Tushar Bende
138bd3d656 fdo#72563 : PAGEREF field tag not preserved during Roundtrip
There was a problem that in case of TOC,PAGEREF field tag was not preserved inside <hyperlink> during Roundtrip.
Reason found, there was no code support to handle PAGEREF in export.
Added code support in export code to handle PAGEREF.

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

Change-Id: I1785360684d8772b71c3f45fdd2c654f94777067
2014-02-07 10:43:52 +01:00