Commit Graph

67 Commits

Author SHA1 Message Date
368374a67b correct include guard comment
Change-Id: Ie94573f7c43c834cd636493bed32f07aa792da49
2014-09-01 23:03:30 +02:00
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
57dcc9f3e9 I forgot to check this in.
Change-Id: Icc32c336495a1d0a29b24b976dd5f359d03a0bba
2014-08-07 20:44:03 -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
77d6ac27e1 WaE: passing class rtl::OUString by value, rather pass by reference
Change-Id: Ib332d04fa27501ec35267b5e389c2979c9c55be2
2014-07-21 19:20:27 +03: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
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
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
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
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
be415a0f9a ooxml: Preserve shape effects when there's more than one
Transformed the preservation process of shape effects to be able to
store more than one effect. For that we:

* Created the Effect struct and added a vector member to the
  EffectProperties struct.
* Changed the shadow effect to use the new Effect struct,
  EffectShadowProperties struct is preserved because the direction
  field still has some use but we should remove it.
* Changed the structure of the grab bag to store more than one effect.
* Modified an existing unit test to check shapes with several effects.

Change-Id: I0dd908fa1d9578827c02ef6272fc9e2b914391be
2014-05-16 14:11:22 +02:00
248145f99e Find places where uno::Sequence is passed by value.
Implement a clang plugin to find them, and clean up existing code
to pass them by reference.

Change-Id: If642d87407c73346d9c0164b9fc77c5c3c4354b8
Reviewed-on: https://gerrit.libreoffice.org/9351
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
Tested-by: Noel Grandin <noelgrandin@gmail.com>
2014-05-14 08:10:22 +00:00
fe88fac28a oox: Use references to prevent unnecessary object copies
Change-Id: I5113bc581a8ac98b97c6598a5355e050c7ad7860
2014-05-13 10:28:55 +02:00
1b7773cb07 oox: preserve scene3d/camera effects on shapes.
Shapes can contain 3D effects like in the following example:

  <a:scene3d>
    <a:camera prst="isometricLeftDown" zoom="150000"/>
    <a:lightRig rig="threePt" dir="t"/>
  </a:scene3d>

This patch preserves the a:camera tag and its attributes using the
shape grab bag. It also adds a unit test for this case.

Change-Id: Ic6a78031d2e1fb84a2bacd97b5cc9c55d9dbaa95
2014-05-06 16:32:28 +02:00
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
4074f6f92d improve chart series symbol export
Using the chart2 service allows us to export series symbols instead of
the diagram settings.

Change-Id: Ic46f067b60c972af35c0628b3ec4f7851580d725
2014-04-06 01:45:31 +02:00
e8f4a2541b oox: sal_Bool->bool
Change-Id: I50788585dbcc489325dc9536a8e4d974a710e30d
2014-04-03 09:17:51 +02:00
567ef6d578 Second batch of adding SAL_OVERRIDE to overriding function declarations
...mostly done with a rewriting Clang plugin, with just some manual tweaking
necessary to fix poor macro usage.

Change-Id: Ie656f9d653fc716f72ac175925272696d509038f
2014-03-27 18:12:18 +01:00
c66229bfa4 oox: prefer passing OUString by reference
Change-Id: Iace276878e7ae668bba5bb6e36af1e5d5d72d6cb
2014-03-17 09:00:08 +02:00
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
b1fbb1513a fix OOXML validation error, related fdo#42698
Missing percentage sign in type. The values of XML_d and XML_sp seem
insane.

Change-Id: If6762ed70d3536c0eeea3ee687991dad60f5e71e
2014-03-08 14:35:11 +01:00
1ca73256f9 remove whitespaces
Change-Id: I7937b154d0417876634711224ed5678eefa2654d
2014-03-08 14:35:11 +01:00
9ca4fa05eb fdo#74826: File corruption-Issue related to Series idx & order val.
Problem Description:
- If the document contains more than one charts together.
  ex.Bar & Line chart
- In that case, LO writes idx & order val equal to 0,
  instead of 1 for second chart series.
- After roundtrip, the document get corrupted.

Implementation:
- Added varible to take the series count
  in case of multiple chart.

Note:
- Some of the UT's are failing when --enable-dbgutil is enabled.

Change-Id: I40606b4d69026939fa19ae534dd7b2bb36ec97fc
2014-03-03 13:41:08 +01:00
8792ec7b21 Remove visual noise from include
Conflicts:
	include/framework/preventduplicateinteraction.hxx
	include/sfx2/sfxbasecontroller.hxx
	include/sfx2/sfxbasemodel.hxx
	include/toolkit/awt/vclxtabpagemodel.hxx
	include/vcl/field.hxx
	include/vcl/settings.hxx

Change-Id: Ibccf9f88c68267a3d7e656012b51eaf644c418c2
Reviewed-on: https://gerrit.libreoffice.org/8272
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
2014-03-01 09:51:32 -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
f16368777b drawingML export: hatching of shapes
Change-Id: I7111d4064d033e27659c7b45650d596df22c593f
2014-02-13 15:25:58 +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
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
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
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
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
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
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
f1ec5dcfca fdo#69616: Fix for VML part missing for group.
Cause:
 - In altenrate content, Fallback contains only group tag.
Implementation:
 - Added export logic in Vml export.
 - Added unit test case for vml group.

Change-Id: Ia1c9834950528dc892caea1cb675a7f42165d9ba
Reviewed-on: https://gerrit.libreoffice.org/7276
Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
Tested-by: Miklos Vajna <vmiklos@collabora.co.uk>
2014-01-24 08:43:08 +00:00
6063555744 drawingML export: fix position of shape in case rotation is 180 degrees
This is the other case when position shouldn't be adjusted.

Change-Id: I9265bf1c762fd519e3a12e97d767b5d213644e6d
2014-01-23 15:30:11 +01:00
bc0a9076aa ooxml: Preserve shape theme attribute for solid fill
Users can select the fill color for a shape among the theme-defined
colors. This results in the following XML:

  <wps:spPr>
    ...
    <a:solidFill>
      <a:schemeClr val="accent2"/>
    </a:solidFill>
    ...
  </wps:spPr>

Now we store both the original fill color and the name of the
theme-defined color, if it exists, on the import phase. They are put
into the InteropGrabBag of the shape with the names
OriginalSolidFillClr and SpPrSolidFillSchemeClr. Additionally, we
needed to to store the decoded theme color inside StyleFillRef.

On the export phase we have to take into account several combinations
of factors:
* If the final color for the shape fill is different from the
  original color, we must ignore any theme attributes and write the
  new color.
* If the fill color is unchanged and some theme color exists, we must
  write the theme color.
* If the fill color is unchanged and no theme color exists, we must
  check if the original color matches the style-defined color. If it
  does, we must not write any <a:solidFill> tag.
* Otherwise we must write the <a:solidFill> tag with the RGB color.

The method putPropertiesToGrabBag was added to the Shape object for
convenience.

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

Change-Id: If0915c5442872a8acab0a8a081f60c89c97277bd
2014-01-18 14:51:43 +01:00
15e01d90b9 ooxml: Preserve shape style attribute fillRef
Shape style attributes contain the default format for the shape in
case that no direct format is specified for it. This is an example
of the attribute we want to preserve with this patch:

  <wps:style>
    ...
    <a:fillRef idx="1">
      <a:schemeClr val="accent1"/>
    </a:fillRef>
    ...
  </wps:style>

The relevant values in these tags are stored at the maShapeStyleRefs
member in the Shape object. The storage happens at
ShapeStyleContext::onCreateContext which is run when the <a:fillRef>
tag is opened. The ShapeStyleRef object contains the idx value and a
Color object which will contain the inner tag <a:schemeClr>.

The Color object has been modified to store the string value of
schemeClr. The storage happens at ColorValueContext::onStartElement
which is run when the tag <a:schemeClr> is opened.

Later, Shape::createAndInsert is called by the ShapeContextHandler to
create the actual XShape, this happens when the tag <wps:wsp> is
closed. createAndInsert puts idx and schemeClr values into the
InteropGrabBag property of the XShape with the name StyleFillRef.

On export time, when the shape data is written at
ShapeExport::WriteCustomShape, we added a call to
DrawingML::WriteShapeStyle. This method will check the existence of
the InteropGrabBag property in the shape, read the StyleFillRef prop
inside it and output the proper XML to the style definition.

DrawingML::WriteShapeStyle also writes some mock tags into the
<wps:style> because we found that they are compulsory. We will
replace them with the proper data in further patches.

The method putPropertyToGrabBag was added to the Shape object for
convenience.

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

Change-Id: I5ffa5242852461a1a709a8f169d40f0d7a2c9aa3
2014-01-18 14:51:42 +01:00
b1e6269d1c fdo#72520 : Exporting sheet external data for chart for docx files.
- Adding external data path relationship for chart[n].xml
     for docx files.
   - Added Unit Test.

Change-Id: If48ed21237433ddf6659454dda95d720aabdb300
2014-01-16 14:41:05 +01:00
c4ff46485f fdo#65833 Fix to preserve VML Canvas Information
Grab-bagged the "editas" attribute of v:group and added UT for
the same

Please verify this fix on MS Office 2007 as it renders the mc:Fallback VML part

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

Change-Id: I4e4456997621089967514009005ee775b71d6d69
2014-01-13 17:48:18 +01:00
cf5c3e97b6 fdo#72304 Write Chart Data Table information back to XML.
During export access properties stored during import and write
back those. Currently we just support basic chart data table information
such as border and outline, there are more properties, which are pending.

Conflicts:
	chart2/qa/extras/chart2export.cxx

Change-Id: Icbc1245fc829f49833a8c307e029c3dd3dc2e0bd
2013-12-19 03:55:05 +01:00
6483f39e89 also export hiLowLines for lineChart
Change-Id: I7b96fcb1e537517a80de87d997818d372d03f74a
2013-12-13 20:48:31 +01:00
077213c23e fdo#72345: Fixed for Charts - Up Down Bars are missing after Round trip
UpDownBars missing after Roundtrip in case of LineChart.

Change-Id: Ia3e574aefb9436a2f5b2b88e8824625d09d35c38
2013-12-13 20:48:31 +01:00
445d3d8484 drawingml export: handle child shapes when exporting groupshapes
Change-Id: I4ed800ad17750c87788108417c8a7b1817853115
2013-12-13 15:11:20 +01:00