Commit Graph

446 Commits

Author SHA1 Message Date
fba7b58a9d fix typo Sufface->Surface
Change-Id: I90847d0edbc2c13e405562647b150012bc5df7e2
Reviewed-on: https://gerrit.libreoffice.org/11249
Reviewed-by: Markus Mohrhard <markus.mohrhard@googlemail.com>
Tested-by: Markus Mohrhard <markus.mohrhard@googlemail.com>
2014-09-01 15:39:42 -05:00
14fa2698f2 bnc#822347: if number type is not set, skip numbering
If numbering is detected then (level is > 0) and the number type
is not set, the defult bullet symbol is written. This is not
correct as the default should be SVX_NUM_NUMBER_NONE which should
skip numbering or set it to none. With this change the numbering
is skipped (as in MSO).

Change-Id: I8d08a6325509c7bd6f96f64c8d29e5f3045458ca
2014-08-28 13:50:48 +02:00
3f1f2d7100 drawingml: remove AUTONUM macro, unneded checks
Change-Id: Ie0ad7ed9df9d0d1b19fa09b3a4b93a5cbd6b41c6
2014-08-28 13:50:47 +02:00
c75bddd73b reduce nesting in WriteParagraphNumbering
Change-Id: I49a3c3449d8354ce5e2a6e42414fbefdfc489388
2014-08-28 13:50:47 +02:00
1edf2c0f1b drawingml: Use SVX_NUM_NUMBER_NONE as default numbering type
Change-Id: I159fcf41fdb6c49687004e959d4032aef28678a5
2014-08-28 13:50:47 +02:00
64c4a651c8 sanitize "using" and "using namespace" declarations
Change-Id: I0b0cccc2d9cfe721c1ed421e614c4350a6b3dc7c
2014-08-28 13:50:46 +02:00
35fa84f598 Forgot to add break here.
Change-Id: Ic7322f111ca6732243741296d7b5f577af28bf14
2014-08-08 09:34:44 -04:00
b385733098 Disable export of label placement properties for radar charts.
Change-Id: Ib9e5801bc13ccf146ddd5aa79b7cd7d2a640e203
2014-08-07 19:32:40 -04:00
7b8073906a Ensure we export correct labal placement value for percent/stacked charts.
Normal charts allow a variety of label placement options, but percent/stacked
charts only allow three variants, and exporting a wrong value would trigger
MS Office to think the file is corrupt.

Change-Id: I8bdc1dc072b29e8df2c506b6b16c61279df12045
2014-08-07 19:01:43 -04:00
f4677f58a2 Area chart also doesn't support label position property.
Change-Id: I612ca7426b2b3de07d4afe1d78cd809f1f6b37bb
2014-08-07 14:44:51 -04:00
fb1473692e Default data label placement may vary depending on chart types. Get it right.
If we export a wrong placement value, MS Office will flag the file corrupt and
the loading will fail.

Change-Id: I7ca1239cd390494c1181ecdb3310c5f88bb18f9b
2014-08-07 14:22:11 -04:00
ed39df130c Doughnut charts don't support label placement option. Don't export it.
Change-Id: I6d0e2c099869120bdf594813468a3c5ba4bb46fd
2014-08-07 14:21:59 -04:00
bb13f1a063 Avoid exporting label placement property when the chart is 3D.
MS Office has trouble loading the file if you do.  There is an exception,
however.  A pie chart allows label placement option even when 3D.  There
may be other chart types that allow variable label placement when 3D.

Change-Id: I6a9247041ca6ee3ae1b9c245f5919fcb35951f24
2014-08-05 13:26:29 -04:00
48f31a9242 bnc#885825: OOXML import and export of data label borders. 2014-07-26 16:26:08 -04:00
b6bfd2c795 WaE: extern prototype in main file without definition
Change-Id: I7121bf7bcc043065d4f10f7c67aaecd7059d6f89
2014-07-25 20:39:53 +03:00
77ea585350 Remove compiler warning.
nTransparancy will be left uninitialized if unstuffing the value from
the Any value fails.

Change-Id: I06a5853066edeb39b811bf12fd09afbc11792add
2014-07-24 17:34:40 -04:00
77d6ac27e1 WaE: passing class rtl::OUString by value, rather pass by reference
Change-Id: Ib332d04fa27501ec35267b5e389c2979c9c55be2
2014-07-21 19:20:27 +03:00
245df9b4b3 fdo#78663 : The File gets corrupted when saved in LO
Problem Description:
The docx file contains a word art inside a drawing tool.
After RT, nesting of <txbxContent> tag is happening which
is causing the corruption.

Solution: Created a service in util.cxx for checking
few shapetypes for which textbox with content is not
allowed. This check also helps to find that if we are
already inside a DML then we should purely read VML
Information.An existing UT testWordArtWithinDraingtool
was failing. The UT is related to same issue
(word art inside drawing tool) hence changed it
accordingly. Following is the commit id of the
UT-Change-Id: I00e94712e912ad1977fcb65a945fefb927795d77

Change-Id: I7e456c9f6a69af80da443e29eb02a64ba7d59468
Reviewed-on: https://gerrit.libreoffice.org/10229
Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
Tested-by: Luboš Luňák <l.lunak@collabora.com>
2014-07-21 15:03:25 +00:00
acd2c90978 fdo#80897: Preservation of text warp properties.
- Generic fix for all warp properties

Change-Id: I77c37759aa49706fc3cd1a80770a85face53f0a2
2014-07-21 16:29:06 +02:00
1bdd6d2129 fdo#80894 : Rotation value for textframe was missing after RT.
- Rotation property is not available for TextFrame in LO.
   - Hence grabbaged this value.
   - Roundtripped rotation value by converting it properly for both dml and vml textbox.
   - Added UT for it.

Change-Id: Ia040d55dc2ea79500df76877ba44a02971c872a8
Reviewed-on: https://gerrit.libreoffice.org/10190
Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
Tested-by: Miklos Vajna <vmiklos@collabora.co.uk>
2014-07-17 07:54:35 +00:00
ed64e620ea oh for the love of...
Change-Id: I5cb90f10112afda77e68035d89cb7026d6e32eec
2014-07-14 20:17:48 +01:00
6e580f3f53 Related: fdo#52226 ensure graphics are swapped in on DrawingML::WriteImage
I imagine it would be best that the Graphics were delivered pre-swapped in by
higher levels in case there are second level caches or more complex caching
systemed wrapped around it, so warn about it in debug mode but give it a
last-ditch shot anyway. i.e. while the .docx problem should be fixed there
is a report of a very similar .xlsx problem

Change-Id: Ie40ee10fe5cba8ff9c321f47b83e33ee2c1425fd
2014-07-14 15:18:08 +01:00
7af733d9ef tweak assert so comment appears in abort message
Change-Id: Ibf78e5cd1620f0b61cae030e3870be4a6f87e71d
2014-06-27 08:55:56 +01:00
2e04936721 Move more oox/drawingml/ internal headers to oox/inc.
Change-Id: I0963c92356f8388ce02fb36e172ad3b2af8ba8f8
2014-06-25 09:45:26 +02:00
ca362d6348 remove whitespaces
Change-Id: Ie14ba3dcb97f20479a04538748ef2c1c9e6c5dac
2014-06-25 05:41:11 +02:00
7ea1bbe712 fdo#79591 Values for docPr name and shape ID attributes were set invalid
Values set for docPr name and shape ID attributes in RT file were not valid
as per UTF-8 encoding format and hence was showing RT document as corrupt with
error message "invalid character".

Calling add() function with current parameters is causing issue and
setting invalid values so modified the second parameter which will
set valid values to the specified parameters.

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

Change-Id: I3b48e53adbe5ed844235e596bb98eb396133845a
2014-06-20 09:44:33 +02:00
e1386e32a8 DocxSdrExport::writeDMLAndVMLDrawing: fix handling of inline VML shapes
In general Writer supports having objects inside a TextFrame, Word does
not. It turns out that Word allows having certain shapes inside other
shapes, as long as they are VML-only. So do that for now: if we receive
a shape when we're already inside a shape, then just export it as VML,
not the usual drawingml+VML pair.

Also, blacklist one more VML shape type, where the shape text is already
exported inside <v:textpath>, so no dedicated <v:textbox> is needed.

Change-Id: I5786bd6827eae9756e7c179bb2ef5a5741a91878
2014-06-18 02:02:51 +02:00
5df0bfdddb DOCX filter: preserve AnchorId on shapes having a textbox
CppunitTest_sw_ooxmlsdrexport's testAnchorIdForWP14AndW14 would fail
without this, when "shape with text" is imported as "shape with
textbox".

Change-Id: I8705aee16270aa68416f0c830c429880fc76d85d
2014-06-17 17:41:01 +02:00
d7551e3260 drawingML export: recognize <a:prstDash val="dash"/>
We used to write out a custom dash definition all the time, even in case
it was imported from a dash preset. Recognize at least "dash", and write
that on export if the parameters match.

Change-Id: Ifaaec51be9ecf1e7667a8c8f85fbd4fb9636a325
2014-06-17 12:49:55 +02:00
6b5c0a5cb2 VML export: handle textbox text
Previously, we always exported the text of the shape itself. Bring the
VML export in sync with the drawingML export, where we only do that if
the shape doesn't have an associated textbox -- if that's the case, then
export the textbox's text instead.

CppunitTest_sw_ooxmlsdrexport's testFdo69636 is a reproducer for this
problem, the VML assert failed because of the lack of this.

Change-Id: Icb236579da4e3b74e983a95aa5675fed7862d1e1
2014-06-17 01:16:20 +02:00
71aa91ab7e oox: drawingML import/export of <wps:bodyPr vert="vert270"> for textboxes
As in, for shapes which have textboxes. CppunitTest_sw_ooxmlsdrexport's
testFdo69636 is a reproducer for this problem.

Change-Id: I6575d21b0802ada7f334ca9fbbea796605708ddd
2014-06-17 00:25:13 +02:00
e9261e8b41 DOCX drawingML filter: handle TextAutoGrowHeight for shapes having textboxes
Change-Id: I0cdc7edf851915f7fbc772eb42edd6ec08b09025
2014-06-11 19:03:34 +02:00
2211a67cc5 Rewrite import and export of custom dashes in ooxml filter (fix)
The import mechanism of custom-dash (a:custDash) was wrong, and imported
wrong values, which causes that if you would import-export-import-export -
you would get inflated values, which might cause a corruption.

The attributes for custom-dash nodes (a:ds) are of type 'PositivePercentage'.
Office will read percentages formatted with a trailing percent sign or
formatted as 1000th of a percent without a trailing percent sign, but only
write percentages as 1000th's of a percent without a trailing percent sign.

During import - LO did not check if it was in '%' format or in
'1000th of a percent' format. So that was fixed. Also - when exporting -
it always exports now in '1000th of a percent' format.

Change-Id: I6bd74df26951974f85173227c832386c70034afb
Reviewed-on: https://gerrit.libreoffice.org/9681
Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
Tested-by: Miklos Vajna <vmiklos@collabora.co.uk>
2014-06-10 17:22:40 +00:00
2b076a0d91 DOCX drawingML export of textboxes: write <wps:bodyPr> in oox
It's possible to write this tag in oox (so it represents the properties
of the shape) or in sw (so it represents the properties of the shape's
textbox). Do the previous, as the textbox is really just a container in
this use case, nothing more.

If we are at it, also fix the default value of <wps:bodyPr>'s l/r/t/bIns
attributes.

Change-Id: I0571b9d8ea7dc0acd5c61f3e28e18400d305eab3
2014-06-10 17:46:55 +02:00
8c677716c4 DOCX drawingML export: if shape has textbox, export its contents as shape text
Change-Id: I54a51189e1c595841b8b02f3b4436da4a29f1dac
2014-06-06 14:24:26 +02:00
80ef7a645a fdo#79256 Line Style with Long Dashes and dots is getting corrupt after RT
Description:
In RT file the dash length (d) is going out of range,
as after RT the dashing scheme changes to custom dash
which was causing the corruption. Changed code at export,
which will divide the DashLen, DotLen and Distance by
base line width.

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

Change-Id: I0e644b5a2b692a9e717026a14d1f0058199f53b1
2014-06-06 10:23:54 +02:00
a2d2c7f707 Be more sensible about checking buffers of VML points we write.
Change-Id: Id3811dbe0cf2510ef6a851804b3886c14eca01b6
2014-06-04 09:45:58 +01:00
ac76cc7e60 Prefer cppu::UnoType<T>::get() to ::getCppuType((T*)0) part20
Change-Id: If87cdfb2c605254f6d69baa4ca5aec09091caa68
2014-05-23 22:11:52 +02:00
40c77417d1 coverity#1213283 Resource leak
Change-Id: I5002f3e935edcc9f09603a5b535e2b339ebed402
2014-05-23 20:37:33 +01:00
505c7801bc coverity#1215289 Resource leak
Change-Id: Ie4a0334ddb393726d982e9f4e51a45e391a1b1f0
2014-05-23 14:16:00 +01:00
56152538a8 coverity#1215290 Resource leak
Change-Id: Ia49f4e99e6663ea95dc85d4dd09e161413a2f419
2014-05-23 14:16:00 +01:00
354411e83a coverity#1215291 Resource leak
Change-Id: Ia62459945cd45f493754a1412b74242d3994f7f0
2014-05-23 14:16:00 +01:00
16e425425f coverity#1215292 Resource leak
Change-Id: Ibabd73d06135a3ee500ce9d52fef42caa3ad7f35
2014-05-23 14:16:00 +01:00
b89524f740 coverity#1215293 Resource leak
Change-Id: I4a74eb76e5fcda915e5d12257fedf3ee84b62baa
2014-05-23 14:15:59 +01:00
be02c2b458 coverity#1215294 Resource leak
Change-Id: I6fc18afd6189060de6943b003dea933713e19773
2014-05-23 14:15:59 +01:00
b5f6a5cfc5 ooxml: Do not repeat wdp files in artistic effects
When two pictures apply different effects to the same picture, it is
only saved once in the original document. Added a cache to DrawingML
to know if the picture has already been exported, and added a test
for it.

Change-Id: Ia25f3d8f2f46d61f18aefc22fdfdbcdc72f2d916
2014-05-23 10:04:00 +02:00
2e68a1468c ooxml: Preserve the original picture in artistic effects
When Word applies an artistic effect, it creates two embedded files;
one contains the bitmap with the effect and the other one contains the
original bitmap to be able to undo the effect.

This patch reads the original bitmap, stores it in the shape grab bag
and saves it back to the docx file. Added unit tests too.

TODO: right now, if two effects point to the same original bitmap it
is stored twice, we should improve this.

Change-Id: Ia72034a257739abe4ffafa0f42b2a912e4bf9436
2014-05-23 10:04:00 +02:00
642a252cf1 ooxml: preserve artistic effects on shapes.
Bitmaps can define artistic effects like in the following example:

  <a:blip r:embed="rId5">
    <a:extLst>
      <a:ext uri="{BEBA8EAE-BF5A-486C-A8C5-ECC9F3942E4B}">
        <a14:imgProps
         xmlns:a14="http://schemas.microsoft.com/office/drawing/2010/main">
          <a14:imgLayer r:embed="rId6">
            <a14:imgEffect>
              <a14:artisticMarker trans="14000" size="80" />
            </a14:imgEffect>
          </a14:imgLayer>
        </a14:imgProps>
      </a:ext>
    </a:extLst>
  </a:blip>

LO core doesn't support them, but I'm preserving them using the shape
grab bag. Bitmaps must not be transformed to a SwXTextGraphicObject
so the grab bag of the XShape is not discarded.

Added several Context and Properties objects on the import side to
traverse and save the relevant tags, and added the corresponding code
on the export side to extract the grab bag and output the effect back.

Also added a unit test for a selection of artistic effects.

TODO: Word saves the original bitmap as an embedded wdp file so the
effect can be undone. We must preserve it too and add the reference to
the a14:imgLayer tag.

Change-Id: I61d427f83e4c8f353eb073da0114cd73ba50ba4b
2014-05-23 10:03:59 +02:00
ee0bb265c9 fdo#78290 : The File gets corrupted when saved in LO
Problem Description: Docx file containing a chart (line chart / scatter chart)which has used a builtin
marker'x' gets corrupted when we save it in LO.The reason was that while exporting LO was writing the
marker information 'x' as 'X' which MS Word doesn't recognize.‒<c:marker><c:symbol val="X" />. Also
the size of the marker was coming 1 less than the actual value. Ex: if size is 7 then it was being
written as  6.

Solution: During export I have made changes so that now LO writes 'x' in the tag information
‒<c:marker> <c:symbol val="x" />. Now the size of the marker is also being correctly exported.

Change-Id: I26b747f9576625bf3acb941322ae418a0bbc6b64
Reviewed-on: https://gerrit.libreoffice.org/9273
Tested-by: Miklos Vajna <vmiklos@collabora.co.uk>
Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
Tested-by: Markus Mohrhard <markus.mohrhard@googlemail.com>
Reviewed-by: Markus Mohrhard <markus.mohrhard@googlemail.com>
2014-05-20 05:12:08 -05:00
73ad72e820 ooxml: Preserve effects on pictures
If a picture contains some 2D (glow, shadow...) or 3D effect
(rotation, extrusion...), we prevent the importer from transforming
it into a XTextContent so the XShape grab bag is not removed and
the effects are preserved using the existing mechanisms. Added a unit
test for this issue, and modified some existing unit tests to match
the new behaviour.

Change-Id: I3b87069ea208604383a592d34d0a4ceb6b0f9fc7
2014-05-16 14:11:23 +02:00