Commit Graph

342 Commits

Author SHA1 Message Date
63308b1e6c fix OOXML validation issue, related fdo#33951
Change-Id: I6e455ee4bb649a299023f1dba88a01ef5674e074
2014-03-01 16:23:09 +01:00
af63727b9f Resolves: #i15508# Added support for BMP file type
(cherry picked from commit 9956ed1303545cd61901e33b110698c4e5e224c4)

Conflicts:
	filter/source/msfilter/escherex.cxx
	include/vcl/gfxlink.hxx
	svx/source/xml/xmlgrhlp.cxx
	sw/source/ui/docvw/romenu.cxx
	vcl/source/filter/graphicfilter.cxx

Change-Id: Ibcbb69b9c57cd8a438788e9a9c95744e99b6fcdd
2014-02-27 19:30:40 +00:00
5e21a413c7 cppuhelper: retrofit std::exception into overriding exception specs
Change-Id: I56e32131b7991ee9948ce46765632eb823d463b3
2014-02-26 18:22:20 +01:00
40961d7bcd Remove visual noise from oox
Change-Id: Ie25838f20f00dc32d9d22959308c118cef688e94
Reviewed-on: https://gerrit.libreoffice.org/8288
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
2014-02-26 09:37:22 -06:00
c816729beb fix OOXML validation error for text shapes, related fdo#31551
blipFill and other fill elements are not allowed to appear together. See
EG_FillProperties in the OOXML spec.

See fdo31551-2.ods

Change-Id: If5869ab9dc69815938c1f4c6fb180b0c1652ddcc
2014-02-26 07:37:28 +01:00
3ca2069f0d use const reference for OUString
Change-Id: I66b5f144da7951f36e32a840b8ed70f38539f105
2014-02-26 07:37:28 +01:00
66cbbe4f3a fix indentation
Change-Id: Iae492bf19edffe84f86bfa9bf247f120f8c9cb79
2014-02-26 07:37:28 +01:00
c26ebdb818 reduntant check
Change-Id: I7969af2e6c73175b020816156478021dcaf8afb0
2014-02-26 07:37:28 +01:00
75f5eb2646 first step in improving the OOXML validation result
Change-Id: Ie4b99e2791cd3575d6544bfca6c6b4e386ac04ea
2014-02-26 07:37:27 +01:00
1efe2782de fix OOXML validation error
Change-Id: Ia27f9615b063393a0733e061df7dd1666283badb
2014-02-25 10:55:02 +01:00
76b114f849 implicitboolconversion: warn about implicit conversion of call args to bool
...to be able to find problems like 6e0bdf04add338b7d5b29fc7b3fc9f08cfd5e96f
"sal_Bool arg of SetUseImagesInMenus was abused to squeeze '2' through it"
earlier when converting occurrences of sal_Bool to bool.

Restricting this check to function call arguments avoids too much noise while
hopefully still catching all the relevant problems.

(This check partially overlaps the pointertobool check, so implicit conversions
from pointers to bool call arguments will now generate two loplugin warnings,
but that's harmless.)

Change-Id: I0b03b1d1615aaf8bc18e7a84c56fff3ef9903508
2014-02-24 17:25:05 +01:00
18ab4793d9 prevent invalid OOXML chart files, related #i82905#
Change-Id: I27166772c6eefb4e49eb4c097683a1c6aea4476a
2014-02-23 06:42:01 +01:00
783a0757da prevent invalid OOXML chart files, related #i75121#
Change-Id: I8e34fd2941ce98a30d27861db2c6a625ff873aa6
2014-02-23 06:42:01 +01:00
c68ea7ef4a don't write axId for dougnught chart, related fdo#63114
Change-Id: I75168888ff8da6f18089311a99135c124c7a7e72
2014-02-23 06:42:01 +01:00
0ce0c369aa Remove unneccessary comments
Change-Id: I939160ae72fecbe3d4a60ce755730bd4c38497fb
Reviewed-on: https://gerrit.libreoffice.org/8182
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
2014-02-23 03:38:49 +00:00
191f648ffd drawingML export: gradient fill defined by imported theme
Plus avoid writing out empty <a:gradFill></a:gradFill>.

Change-Id: I50fa92b2cc30eedfe28a8c6af697d43d98a3aee8
2014-02-21 09:28:24 +01:00
a18a1a4545 Remove vcl/settings.hxx from vcl/svapp.hxx and vcl/outdev.hxx
Added vcl/settings.hxx to all cxx files which require it.
This helps to speed up compilation after changes to the settings.

Conflicts:
	sc/source/ui/dbgui/pvlaydlg.cxx

Change-Id: I211a0735c47f72d6879f6f15339355abfe0e3cf4
Reviewed-on: https://gerrit.libreoffice.org/7933
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
2014-02-20 16:22:17 +00:00
53146f93ad prevent invalid OOXML files with trendlines, related #i88825#
Change-Id: I503b24233060400cf4bbb40701bec0a3e101512a
2014-02-18 02:25:45 +01:00
dd0c9e6483 fix indentation
Change-Id: I36be2de793d3d32433530bf71632cb73a676bb9a
2014-02-18 02:25:45 +01:00
5ecf769266 prevent invalid ooxml files during notes export, related #i83060#
Change-Id: I151c14cd75477445465e0221271f9bf17385af9f
2014-02-17 16:44:11 +01:00
c7c761455f drawingML export: make WritePolyPolygon robuster
Make sure a:cubicBezTo conatins three a:pt elements.

escherex: It seems a cubic bezier curve last point has
a POLY_NORMAL flag and not POLY_CONTROL.

Change-Id: Id6dc2160c7ae171a720e4a1aa9161cef2b3b9413
2014-02-16 17:45:37 +01:00
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
f16368777b drawingML export: hatching of shapes
Change-Id: I7111d4064d033e27659c7b45650d596df22c593f
2014-02-13 15:25:58 +01:00
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
45c7b349d7 oox: warning C4101: 'rEx' : unreferenced local variable
Change-Id: I79722b33a0c193a8bb0c0dd357787ee213909051
2014-02-12 23:26:20 +01:00
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
1779d2a3dd nasty merge error
Change-Id: I5afaf03c5aee417ea40cea65b2ac51dde7c35918
2014-02-12 03:34:54 +01:00
ffb1053b28 fdo#74115 Fix for DOCX BitmapFill for Chart Wall
Fixed import and export for chart wall Bitmap Fill in DOCX
Added UT for the same.

Conflicts:
	oox/source/export/chartexport.cxx

Change-Id: Id066b0e4c2007fcdfdbbfa67b40307463bf0cfe7
2014-02-12 02:46:32 +01:00
f38a223d6d small stylistic changes
Change-Id: I31cbdc8e09474252205edb837bfd1a8a7299b52b
2014-02-12 02:40:06 +01:00
a5f0344b41 fdo#74115 Fix for DOCX GradientFill for Chart Wall
Fixed import and export for chart wall Gradient Fill in DOCX
Added UT for the same.

Conflicts:
	chart2/qa/extras/chart2export.cxx

Change-Id: Ie6caa2b238aeb70f7225145da8c5c78003e73002
2014-02-12 02:40:06 +01:00
f0d232f7b7 prevent invalid OOXML chart files
Change-Id: I2ccf988a26e5c69f4f14547cfea7cb4fb574b317
2014-02-12 01:01:36 +01:00
a67f56f78c until we support custUnit make sure that all files are valid
Change-Id: I759a4cc97e2a2adf71322d2aa18fdb11873a538e
2014-02-12 01:01:36 +01:00
1d497297ec fdo#74112 Write Chart Displayunits information back to XML.
During export access properties stored during import
   and write back those. Currently we just support basic chart
   display unit information such as builtinunit, there are more
   properties ex. custUnit, dispUnitsLbl, extLst.
   which are pending.

Conflicts:

	chart2/qa/extras/chart2export.cxx

Change-Id: I87e0a8322fc0b0c3df2b8053b7f29fffea611040
Reviewed-on: https://gerrit.libreoffice.org/7722
Tested-by: Markus Mohrhard <markus.mohrhard@googlemail.com>
Reviewed-by: Markus Mohrhard <markus.mohrhard@googlemail.com>
2014-02-11 23:24:00 +00:00
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
d505d2ef49 Werror=maybe-uninitialized in drawingml export
Change-Id: Ib04a464483c43a999db82bfaa539193c526d5041
2014-02-10 18:54:28 +01:00
aec959dea0 drawingML: remove code duplication: use WriteStretch()
Change-Id: I0d589da01bf6afed86b5811d6b27f72f6e1bb160
2014-02-08 02:59:51 +01:00
718203e370 drawingML export/import: text frames with vertical alignment
Change-Id: I469da0a8234dd2979facfed3d66907aad1a138ab
2014-02-08 02:59:50 +01:00
41324964f5 oox: make sure debug output appears on stderr
So that profiling unit tests (finding out the largets test documents
based on the CSV output on stdout) is possible again.

Change-Id: Ib870d6f424c3219f37715daef5400a0181867be7
2014-02-07 11:18:12 +01:00
651756a5f4 WaE: statement aligned as ... [loplugin:bodynotinblock]
Change-Id: I4e3078ab29ff6ad2d89f68ef6413d2f3fb1fcb80
2014-02-05 10:52:34 +02:00
fb4e16c90e Trivial syntax fix
Change-Id: Icfcea4a4e86a85d67786d0a87d8d2eb665860e0e
2014-02-05 08:22:24 +01:00
b8a863a219 drawingML: do not write empty schemeClr tags
Change-Id: I8508f00f6af218605d1d43d3efcefbf545387ab8
2014-02-05 02:00:03 +01:00
2fcf3a871c ooxml: preserve gradient shape fill
LibreOffice is unable to properly import the custom gradient fills
defined in ooxml documents. To prevent data loss, we save the
original gradient fill definition in the shape interopgrabbag and we
write it back to the document on export.

In case the user has changed the fill properties of a shape, the
original fill will be discarded in favor of the new fill.

We have added a new ooxmlexport unit test to test this feature.

We have also added some missing transformations to the methods
getColorTransformationName and getColorTransformationToken in Color
class, and refactored some code in class DrawingML to the method
WriteColor( OUString, Sequence ).

Change-Id: Ie71f89eaa20313561aa9180ea33b76f3fb5e5df6
2014-02-05 02:00:03 +01:00
5c39b6b997 drawingML export: custom geometry with cubic bezier curves
When the custom shape is not a preset shape then construct a
PolyPolygon and use DrawingML::WritePolyPolygon() to export it.

Change-Id: I6598976a475bfcb92305338af9016e09df4c9456
2014-02-03 02:46:30 +01:00
d48568d37c don't generate invalid xml files
VmlCommentExporter::StartShape already adds a XML_type to the attribute
list, so we would be exporting the same attribute twice which makes the
xml file invalid. This file could therefore not be imported again.

Change-Id: I2aed2805ea59c15b1f7e60ab9cab10f7a8e81412
Reviewed-on: https://gerrit.libreoffice.org/6980
Tested-by: Markus Mohrhard <markus.mohrhard@googlemail.com>
Reviewed-by: Markus Mohrhard <markus.mohrhard@googlemail.com>
2014-01-31 01:30:11 +00:00
491b348a64 drawingML: complete the fix of nAlpha param in DrawingML
Change-Id: I1aec870ee52180d1b1b96762f69fab94370acbde
2014-01-30 16:11:21 +01:00
28db7d7919 drawingML: fix transparency of shape solid fill
The empty value for transparency in drawingML is 100% and not 0.

Change-Id: I5f34f03b9b72cc20e92e32f9c9bc1bdfae73ff55
2014-01-30 12:29:06 +01:00
4fa88a5a63 drawingML export: transparency of solid filled shape
Change-Id: I97968dd5f5233e17870bdfdf2864ae8ce9179080
2014-01-30 09:17:28 +01:00
0d6cb9c123 ooxml: Preserve shape style effect attributes
Preserve <a:effectRef> tag and its contents from inside shape style
properties tag <wps:style>.

Added some lines to existing unit tests to check for the preservation
of these attributes.

Change-Id: I6e47b228dcc9788a4a2dfe87bd1186d2f04dbeea
2014-01-28 17:07:26 +01:00
5391d4872e ooxml: Preserve shape style and theme attributes for line
Line style and color can be defined by the shape style attributes or
can be directly assigned by the user (and even using a theme color in
the case of color attribute). This patch aims to preserve the
relevant attributes of this feature after a roundtrip.

For style attributes (wps:style/a:lnRef), they are kept and preserved
in the "StyleLnRef" property of the shape InteropGrabBag. To be able
to access to some of them, the methods getLineStyle, getLineJoint and
getLineWidth were added to LineProperties object.

For the line theme color (a:ln/a:solidFill/a:schemeClr), the original
line color and the theme color name are preserved in the properties
"OriginalLnSolidFillClr" and "SpPrLnSolidFillSchemeClr"of the Shape
InteropGrabBag.

On export time, we must check if the user has changed any properties
of the shape line, this is done comparing the new shape attributes
with the original values coming from the style and theme definitions.
In case some of the attributes is different, the new attribute must
be saved overwriting the old one.

The data files for some /sd/qa/ unit tests were updated to reflect
the new properties inside the Shape InteropGrabBag. Besides, an
existing unit test in ooxmlexport was modified to include checks for
the preservation of line style, line theme color and custom line
style that override the style attributes.

Change-Id: Iabb0cef9e3cc433676c201bc296fb7b373839a3f
2014-01-28 11:00:37 +01:00
007f260e0b ooxml: Preserve color transformations in shape style definitions
Color tags like <a:schemeClr> can have children tags that modify the
specified color. These modifications were applied on import time in
the Color object, but they were not preserved.

We added a member to Color object to preserve the unaltered list of
transformations. The method getTransformations() returns that member,
and the methods getColorTransformationName and
getColorTransformationToken were added to transform the tokens into
strings that can be added to an InteropGrabBag and viceversa.

The transformations are added to the Shape InteropGrabBag in the
method Shape::createAndInsert, and they are written back on export
time at DrawingML::WriteStyleProperties.

The data files for some /sd/qa/ unit tests were updated to reflect
the new properties inside the Shape InteropGrabBag.

Change-Id: Ieb164268c3b79f2d9b7ed3a4954b5de3b7a5811c
2014-01-28 11:00:37 +01:00