summaryrefslogtreecommitdiff
path: root/oox
AgeCommit message (Collapse)Author
2014-05-28oox: detect <wpg:graphicFrame> inside <wpg:wgp>Miklos Vajna
Change-Id: Ifdbf7d69ecee226e551bc9c65de6c3a53acef53b
2014-05-28update_pchThomas Arnhold
Change-Id: I5316693452427ed76a7738b090de023b110caa40
2014-05-27Remove unnecessary semicolonsPeter Senna Tschudin
A simplified version of the semantic match that finds this problem is follows: (http://coccinelle.lip6.fr/) // <smpl> @r1@ statement S; position p,p1; @@ S@p1;@p @script:python r2@ p << r1.p; p1 << r1.p1; @@ if p[0].line != p1[0].line_end: cocci.include_match(False) @@ position r1.p; @@ -;@p // </smpl> Change-Id: Ib9708d37fbb4c6060f88d5dae3814a2d37b2091e Reviewed-on: https://gerrit.libreoffice.org/9493 Reviewed-by: Noel Grandin <noelgrandin@gmail.com> Tested-by: Noel Grandin <noelgrandin@gmail.com>
2014-05-24Resolves: fdo#79137 Crash in oox::vml::InputStream::updateBufferJulien Nabet
bt shows: Program received signal SIGSEGV, Segmentation fault. 0x00002aaadba213fb in oox::vml::InputStream::updateBuffer (this=0x8d7fd80) at /home/julien/compile-libreoffice/libreoffice/oox/source/vml/vmlinputstream.cxx:339 339 while( (mnBufferPos >= maBuffer.getLength()) && !mxTextStrm->isEOF() ) (gdb) bt 0x00002aaadba213fb in oox::vml::InputStream::updateBuffer (this=0x8d7fd80) at /home/julien/compile-libreoffice/libreoffice/oox/source/vml/vmlinputstream.cxx:339 0x00002aaadba21048 in oox::vml::InputStream::available (this=0x8d7fd80) at /home/julien/compile-libreoffice/libreoffice/oox/source/vml/vmlinputstream.cxx:326 0x00002aaacf5a0249 in sax_fastparser::FastSaxParserImpl::parseStream (this=0x89aea30, maStructSource=...) at /home/julien/compile-libreoffice/libreoffice/sax/source/fastparser/fastparser.cxx:810 Indeed, mxTextStrm is invalid, so let's test its validity in InputStream constructor Change-Id: Ifed79603e33b64d11eb07656df17824b7f98058f
2014-05-23Prefer cppu::UnoType<T>::get() to ::getCppuType((T*)0) part20Julien Nabet
Change-Id: If87cdfb2c605254f6d69baa4ca5aec09091caa68
2014-05-23coverity#1213283 Resource leakCaolán McNamara
Change-Id: I5002f3e935edcc9f09603a5b535e2b339ebed402
2014-05-23coverity#1215289 Resource leakCaolán McNamara
Change-Id: Ie4a0334ddb393726d982e9f4e51a45e391a1b1f0
2014-05-23coverity#1215290 Resource leakCaolán McNamara
Change-Id: Ia49f4e99e6663ea95dc85d4dd09e161413a2f419
2014-05-23coverity#1215291 Resource leakCaolán McNamara
Change-Id: Ia62459945cd45f493754a1412b74242d3994f7f0
2014-05-23coverity#1215292 Resource leakCaolán McNamara
Change-Id: Ibabd73d06135a3ee500ce9d52fef42caa3ad7f35
2014-05-23coverity#1215293 Resource leakCaolán McNamara
Change-Id: I4a74eb76e5fcda915e5d12257fedf3ee84b62baa
2014-05-23coverity#1215294 Resource leakCaolán McNamara
Change-Id: I6fc18afd6189060de6943b003dea933713e19773
2014-05-23remove boilerplate in UNO Exception constructor callsNoel Grandin
Now that we have default values for Exception constructor params, remove lots of boilerplate code. Change-Id: I620bd641eecfed38e6123873b3b94aaf47922e74
2014-05-23WaE: passing class rtl::OUString by value, rather pass by referenceTor Lillqvist
Change-Id: I05aa9a5ad5d97a1ead3d30298f45e7aeb62d0652
2014-05-23ooxml: Do not repeat wdp files in artistic effectsJacobo Aragunde Pérez
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-23ooxml: Preserve the original picture in artistic effectsJacobo Aragunde Pérez
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-23ooxml: preserve artistic effects on shapes.Jacobo Aragunde Pérez
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-23oox, writerfilter: add a14 namespace and tokensJacobo Aragunde Pérez
Added the artistic effects defined in the MS-ODRAWXML extension. Ref: http://msdn.microsoft.com/en-us/library/dd905216(v=office.12).aspx Change-Id: I24c5e5bbe569f160d300a7a7293ca047cb7a1b88.
2014-05-23DOCX import: recurse into w:ins in groupshape textMiklos Vajna
Groupshape text is provided by editeng, redlining is available in Writer text only. But still, instead of ignoring both deletions and insertions in group shape text, we could at least show the latest version correctly, i.e. ignore deletions but import insertions. Change-Id: I12df2ca1a8d27f9496a8036e521f8820d7075053
2014-05-23DOCX import: detect inline shape inside shape textMiklos Vajna
Change-Id: Ia1614759558e73686fce137eb52fb623eae4a4e5
2014-05-23DOCX import: detect table in groupshapeMiklos Vajna
Change-Id: Iba7bb88139a97e919739363cd85f3e822062b694
2014-05-22oox: fix export of OOXML generator infoMiklos Vajna
This time we did preserve this info, and we should not. Change-Id: If2ddd7a266cd7da5642dc234411ce34e94bd3384
2014-05-20fdo#78290 : The File gets corrupted when saved in LOBisal Singh Nayal
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-20fdo#78658 Corruption: lockedCanvas tag is missing from RT fileDinesh Patil
While export, locked Canvas is missing and drawing is exported inside textbox. However a locked Canvas has to be exported inside a text-box and drawing should fall under locked Canvas for the RT file to work in MS Office 2010. Reviewed on: https://gerrit.libreoffice.org/9377 Change-Id: Iea2c411302b552db18527001cc4c6d0290085afe
2014-05-19oox: remove using namespace from headersThomas Arnhold
Change-Id: Iaf33c536c86a372aed2a719b6f87a8e03a5481ea
2014-05-19fdo78474:Corruption a:graphicData has no info for the image.Sourav
The original file contains two text boxes one contains image and the other contains chart. Image in text box is not getting imported in LO which leads to no contents inside the a:graphicData tag which is causing the corruption. Root cause is found in ShapeContextHandler::getShape. mxChartShapeContext.is() returns true even when mnStartToken is not set as NMSP_dmlChart which is causing the issue. I have added one more condition to handle this. Change-Id: I6c567d7618b34c1a24f6809801e4460af6894c67 Reviewed-on: https://gerrit.libreoffice.org/9363 Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk> Tested-by: Miklos Vajna <vmiklos@collabora.co.uk>
2014-05-17Correct common misspellings, and remove some ASCII art along the way.Chris Laplante
Change-Id: I42787db31769e8bde984c5f4f0aa90335e889b1c Reviewed-on: https://gerrit.libreoffice.org/9356 Reviewed-by: Thomas Arnhold <thomas@arnhold.org> Tested-by: LibreOffice gerrit bot <gerrit@libreoffice.org>
2014-05-16Use SVM (metafile) instead of PNG for diagrams (SmartArt)Tor Lillqvist
It seemed a bit pointless to waste CPU cycles on PNG-compressing a bitmap image only to later then uncompress it anyway. vcl's PNG writing code showed up as 13% on the time profile of TiledLibreOffice when displaying a document full of SmartArts. Miklos suggested I try using SVM (which I guess means "StarView Metafile") instead. When using SVM, no rendering of diagrams to bitmaps during loading is done, but the diagram stays stored in a resolution-independent (vector-ish) form. Which means it will be rendered nicely and crisply regardless of the zoom level. At least, that is my understanding, and experimentation (on OS X and Linux) seems to confirm. ce8c0ff07559ddcc729bffd7a68f4c6f281882e3 Change-Id: Ice8c0ff07559ddcc729bffd7a68f4c6f281882e3
2014-05-16ooxml: Preserve effects on picturesJacobo Aragunde Pérez
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-16ooxml: Preserve shape effects when there's more than oneJacobo Aragunde Pérez
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-16oox: always save all kinds of 3d effects to the grab bag.Jacobo Aragunde Pérez
This was actually a bug. It didn't matter much because a document with an a:sp3d tag but without a:scene3d section would be invalid, but the code was logically wrong. Change-Id: Ifa838e425849642c2a1bf6fca6b6a8dc8ed3b465
2014-05-15Resolves fdo#70681: fixincludeguards.pl: all that's leftThomas Arnhold
Change-Id: I3e51a62710bb46c8255fd228d41d9300c90a1fb5 Reviewed-on: https://gerrit.libreoffice.org/9360 Reviewed-by: Thomas Arnhold <thomas@arnhold.org> Tested-by: Thomas Arnhold <thomas@arnhold.org>
2014-05-14WaE: warning C4701: potentially uninitialized local variableThomas Arnhold
Change-Id: I00a4ebdcfc278274a567403bc1ccb5332ada836f
2014-05-14Find places where uno::Sequence is passed by value.Noel Grandin
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-13Work around another seeminly random mis-optimization by Apple's Clang with -OzTor Lillqvist
If it wasn't for the desperate need to minimize code size for LO-based iOS apps, I definitely wouldn't use -Oz in gb_COMPILERDEFAULTOPTFLAGS (in solenv/gbuild/platform/IOS_ARM_GCC.mk). Change-Id: Icb231b5f30b32afe1c0f3b43e5744bf0e41e96df
2014-05-13oox: Use references to prevent unnecessary object copiesJacobo Aragunde Pérez
Change-Id: I5113bc581a8ac98b97c6598a5355e050c7ad7860
2014-05-13ooxml: Preserve shape 3d effects: extrusion and contour colorsJacobo Aragunde Pérez
Shapes 3D effects can specify colors for extrusion and contours like in the following example: <a:sp3d extrusionH="25400" prstMaterial="metal"> <a:extrusionClr> <a:schemeClr val="accent5"> <a:lumMod val="40000"/> <a:lumOff val="60000"/> </a:schemeClr> </a:extrusionClr> <a:contourClr> <a:srgbClr val="3333FF"/> </a:contourClr> </a:sp3d> Colors can be theme-defined or set in RGB and can contain transformations. This patch preserves all the color information using the shape grab bag and modifies an existing unit test to add this check. Change-Id: Ida168affd4ca2135d0bd8f97135dc1cd1e74165a
2014-05-13ooxml: Preserve shape 3d effects: materialJacobo Aragunde Pérez
Shapes 3D effects can specify a material like in the following example: <a:sp3d prstMaterial="metal" z="488950" /> This patch preserves the prstMaterial attribute in the sp3d tag using the shape grab bag and modifies an existing unit test to add this check. Change-Id: I7be2dbbcc7e599d5f0fb8fa53ec1d180c18d8ebd
2014-05-10coverity#1079343 Uninitialized pointer fieldCaolán McNamara
Change-Id: I05ec88144273c15181e9afa8f616b0ab11695f04
2014-05-10Prefer cppu::UnoType<T>::get() to ::getCppuType((T*)0) part8Julien Nabet
Change-Id: Ie16923d17541e84e0d7424fffe37caf410786abf
2014-05-09ooxml: Preserve shape 3d effects: top and bottom bevelJacobo Aragunde Pérez
Shapes 3D effects can specify top and bottom bevels like in the following example: <a:sp3d z="488950" extrusionH="63500" contourW="50800"> <a:bevelT w="139700" h="88900" prst="cross"/> <a:bevelB h="88900" prst="relaxedInset"/> </a:sp3d> This patch preserves the a:bevel* tags and their attributes using the shape grab bag and modifies an existing unit test to add this check. Change-Id: I4762111e4d2f75ba2fd3721a126aa324a28a853c
2014-05-09ooxml: Preserve shape 3d effects: z, contour and extrusionJacobo Aragunde Pérez
Shapes can contain 3D effects like in the following example: <a:sp3d z="488950" extrusionH="63500" contourW="50800"/> This patch preserves the a:sp3d tag and its attributes using the shape grab bag and modifies an existing unit test to add this check. Change-Id: Ice3cae39c71784be0f6c7f2700b07c21a5e1fb6e
2014-05-09oox: preserve scene3d/lightRig effects on shapes.Jacobo Aragunde Pérez
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:rot lat="0" lon="0" rev="4800000"/> </a:lightRig> </a:scene3d> This patch preserves the a:lightRig tag, its attributes and the child element a:rot using the shape grab bag. It also adds a unit test for this case. Change-Id: I66b6de3c2b5ef89223b10da54006e28113b8ba5f
2014-05-06oox: unused CustomShapeProviderMiklos Vajna
Change-Id: Ia8b23df9a78385f9129d5cea1195a8ba210113d2
2014-05-06oox: prepare for importing a TextBox property on shapesMiklos Vajna
Writer's SwXShape doesn't have that property yet, though. Change-Id: I997eb188574fab93d35595972fdc2eaebabc015b
2014-05-06oox: preserve camera rotation on shape 3D effects.Jacobo Aragunde Pérez
Camera options in shape 3D effects can have rotation settings like in the following example: <a:camera prst="perspectiveRelaxedModerately" zoom="150000"> <a:rot lat="19490639" lon="0" rev="12900001"/> </a:camera> This patch preserves the a:rot tag and its attributes using the shape grab bag. We created the class Scene3DRotationPropertiesContext to be piled on top of a Scene3DPropertiesContext and process the contents of the child item. It also adds a unit test for this case. Change-Id: Id6bf58ad05fe5b49061619b6750ed0658badc9af
2014-05-06oox: preserve scene3d/camera effects on shapes.Jacobo Aragunde Pérez
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-06oox: Integrate Shape3DProperties and Scene3DPropertiesContextJacobo Aragunde Pérez
Code for these two classes was already present but it was commented out or left outside of the build system because it didn't even compile. I've brought it back and made it compile, but it has no use yet. The goal is using it to preserve 3D transformations. At scene3dcontext.cxx I removed the text chunks found in the middle of the source and corrected some mistakes; I also modified the conversion of "fov" attribute. At shape3dproperties.hxx I removed all the struct members because they seemed to have been copied&pasted from another file, and added only those members that made sense. Removed useless function definitions. Change-Id: I2c00ea638e1a4fb1a3820bc4c322488296d3e6d7
2014-05-06oox custom shape preset data: fix typo in parsing awt::SizeMiklos Vajna
Regression from commit f5ccbfdc561c68099872d1abe07ac72fcddedd35 (oox customshapepreset: switch to generated data -> code, 2014-04-17). Change-Id: I2106271e2f43e7936237628e47cd4e01ab34441c
2014-05-05oox: don't try to set Writer-specific properties on non-TextFrames...Miklos Vajna
... during DOCX import of shapes with text, so that we don't crash when the currently always active setServiceName("com.sun.star.text.TextFrame") call is not present. Change-Id: I5b005583ddcee81b9683e3b34e8f0a2e5faa4f95