Commit Graph

134 Commits

Author SHA1 Message Date
194c17a7c7 fdo#80895 : Shape in Header&Footer is getting lost after RT
If there is a shape in Header or footer in a docx created in MSO-2010 that shape was
getting lost after RT(actually shape was there but it's properties were getting missed).
Root cause was : When LO processes Header it has msRelationFragmentPath= header.xml in
ShapeContextHandler::startFastElement() and searches for theme as there is No theme specific
to header or footer, aThemeFragmentPath becomes empty in that case.
This is because MS office shares same theme for both documentBody as well as Header or footer.

To fix Get Target for Type = "officeDocument" from _rels/.rels file this target is
 "word/document.xml" for docx & to "ppt/presentation.xml" for pptx and use this Target for fetching correct theme.xml.
Tested group shapes in header/footer,previously was not getting rendred and not preserved
 after RT.After this patch it's now working correctly.
Tested chart in header/footer previously chart colour was not coming properly
both during rendering as well as after RT.after this patch it's working correctly.

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

Change-Id: Id47008550da90c0d697b434b676765230e3258a7
2014-08-01 10:42:54 +02:00
2197777816 indentation fixes
Change-Id: I0a0f04d0f0e008e8947a5a7e3ed6083c1589e61b
2014-07-27 17:30:48 +02: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
25ffd3fad8 coverity#1038295 Unchecked dynamic_cast
Change-Id: I0206983f7dd57626a7d33a95d5025af1b12ed9d3
2014-07-18 15:36:19 +01:00
660b045c1a coverity#1226480 Unchecked dynamic_cast
Change-Id: I07c0ee479a384d213a1b9b9252846bd9873b0bdc
2014-07-18 15:36:13 +01:00
0d5b053436 DOCX FILEOPEN VML Shape (image) is lost on import fdo#81031
ShapeContextHandler::getDrawingShapeContext mxDrawingShapeContext is set once and never reset.
So in a file which has numPicBullets and vml shapes in document.xml there is a problem.
First the fragment path is set as word/numbering.xml.
But when msRelationFragmentPath changes to word/document.xml,
mxDrawingShapeContext is not reset and hence the relationships are not resolved.

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

Change-Id: I4a1401103797972731257145430f2048b94a04bc
2014-07-15 11:52:58 +02:00
ca362d6348 remove whitespaces
Change-Id: Ie14ba3dcb97f20479a04538748ef2c1c9e6c5dac
2014-06-25 05:41:11 +02:00
e787a84c69 Move oox/drawingml/table/ internal headers to oox/inc.
Change-Id: I9de33fdcd8b1ef73d57884033f502ac4a03f63d3
2014-06-23 10:47:35 +02:00
19863db337 indentation fixes
Change-Id: Ia391ccc9889a135730f0fead11eb0b6c2f748ec4
2014-06-19 09:57:33 +02:00
d379d18666 oox: import WPS shape with text as shape with textbox
This allows having real shapes (like having rounded corners) and complex
content (like containing a table) at the same time.

WPS shapes are wrappers around drawingML markup in DOCX files, so this
only affects the DOCX import.

Change-Id: Iad1c1c61233be1c17efa1821e680927aa9587215
2014-06-18 12:09:15 +02:00
3e82897353 improve the inlinesimplememberfunctions clang plugin
Change-Id: I6d5a952901648e01904ef5c37f953c517304d31e
2014-06-17 10:55:17 +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
7b0eb08459 DOCX import: implement linking for shapes having textboxes
Change-Id: I90deb68ab6a1029cf5df8170676638bf7e3cb469
2014-06-13 21:29:22 +02:00
e9261e8b41 DOCX drawingML filter: handle TextAutoGrowHeight for shapes having textboxes
Change-Id: I0cdc7edf851915f7fbc772eb42edd6ec08b09025
2014-06-11 19:03:34 +02: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
28e9b5bc01 oox: support non-TextFrame shapes in WpsContext::onCreateContext
Change-Id: I692fa22132cd3a722b58de22e3dbb759ff888e5d
2014-06-06 17:15:17 +02:00
866a4436d3 oox: handle textboxes in ShapeContextHandler::endFastElement()
DOCX shape import normally works by oox creating the shape, then
writerfilter handling the shape text. For drawingML shapes, having shape
text, this a bit more complicated, as there are shape properties after
the shape text as well.

ShapeContextHandler::endFastElement() assumed that shape text is only
possible on css.text.TextFrame shapes: also handle shapes having a
TextBox as well.

sw/qa/extras/ooxmlimport/data/mce-nested.docx is a reproducer for this
problem (group shape missing), when TextBoxes are enabled by default in
oox.

Change-Id: I7a412b31965cf363da0b0c7fcc732741f2037542
2014-06-04 14:30:25 +02:00
3f0a2a704f oox: detect <wpg:graphicFrame> inside <wpg:wgp>
Change-Id: Ifdbf7d69ecee226e551bc9c65de6c3a53acef53b
2014-05-28 16:33:44 +02:00
ca0be67434 fdo78474:Corruption a:graphicData has no info for the image.
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-19 02:35:49 -05:00
f0d6137c4e oox: prepare for importing a TextBox property on shapes
Writer's SwXShape doesn't have that property yet, though.

Change-Id: I997eb188574fab93d35595972fdc2eaebabc015b
2014-05-06 17:11:44 +02:00
315503314a oox: don't try to set Writer-specific properties on non-TextFrames...
... 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
2014-05-05 14:20:48 +02:00
255194801e fod#77122 DOCX filter: link between textboxes is not being preserved
Added support for linked textboxes for docx interoperability.

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

Change-Id: I7db4f5a1783afff53c64908d182788b262f5e863
2014-04-22 12:09:40 +02:00
e13022a825 Clean up function declarations and some unused functions
Change-Id: I2f5b3144e8d4ce3e497a030aa102985c3bc81645
2014-04-14 14:15:12 +02:00
f4b15d214a coverity#735766 Unchecked dynamic_cast
Change-Id: I7f69e2a9d83d4632a23c6b1b15156b8e084487e2
2014-04-05 14:26:01 +02:00
5babf1b903 remove unnecessary scope qualifier from sal_Bool uses
i.e. convert "::sal_Bool" to "sal_Bool"

Change-Id: Ie5943aee4fee617bf2670655558927ed25b7e067
2014-04-03 13:54:02 +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
058eb46c91 coverity#1038295 Unchecked dynamic_cast
Change-Id: I80488cc2c5edfaf5e3eb11bed1684d230549a663
2014-03-22 19:25:07 +00:00
291c3ae79c fix OOXML strict import
fix the problem introduced by 6536826f2f4c747582d60ed40b0418c6a67a9829

Change-Id: I6c499f8490d92badda0f086d48c2347fa112bb4e
2014-03-06 11:25:35 +01:00
6536826f2f fdo#74792 [DOCX] Grab-bag rels and images for SmartArt
Added support to grab-bag rels and associated Images for
data[i].xml, and drawing[i].xml.
Added UT for the same

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

Change-Id: I545825f67214f14037ab72b77764a07d575b8b5b
2014-03-05 10:13:40 +01:00
b7381c5197 make more places aware of OOXML strict relations
Change-Id: I292217537eb592cbad9af11f87402baa9f4cc442
2014-03-02 17:56:14 +01: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
c9b1fd6345 drawingML import: fix position of cildren in shape groups
Translate component of parent shapes' transformation
have to be applied to children when there is no explicit
child transformation.

Note. Export also use this concept.

Change-Id: I51bd3325fb53ee250402326ee361c8f07038ed07
2014-02-18 17:31:01 +01:00
7accbd8c0d drawingML import: wrong namespace for 'pic'
Change-Id: I97311b737c7cb706ddff95d1b1b8fe61241f055d
2014-02-12 16:20:21 +01:00
de7b3820d3 loplugin:implicitboolconversion
Presumably we need to specifically check whether Element is a
PPT pic token here too?

Change-Id: Id5c90099c8762042f9a2a886631faa72737704fb
2014-02-12 14:15:54 +00:00
5429888560 coverity#1103671 Unchecked dynamic_cast
Change-Id: I7a0e483550b0f7bbe91f20acde5a09ca43eb02c2
2014-02-12 13:03:52 +00:00
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
c96d1ddf57 oox: whitespace fix in WpsContext
Just make sure that these two new lines match the style of the
rest of the file, which was so far consistent.

Change-Id: I6113753157fec7fd0e0dc988885b36b477c301b2
2014-02-08 23:54:00 +01:00
718203e370 drawingML export/import: text frames with vertical alignment
Change-Id: I469da0a8234dd2979facfed3d66907aad1a138ab
2014-02-08 02:59:50 +01:00
f139c10fd3 fdo#54938 Convert oox, sc, vcl, svtools... to cppu::supportsService
Change-Id: I6268bc57417d53b9810c81071fbcd604e2a19507
Reviewed-on: https://gerrit.libreoffice.org/7886
Tested-by: LibreOffice gerrit bot <gerrit@libreoffice.org>
Reviewed-by: Marcos Souza <marcos.souza.org@gmail.com>
2014-02-06 15:47:54 +00:00
22e6916a82 oox: clear the saved shape when the shape really ends
Change-Id: Id0d644407bf1f5672e654082328434b9464c140a
2014-02-01 17:06:57 +01:00
f5fd26fda6 CID#1103719: fix memory leak 2014-01-31 18:47:30 +01:00
3cf58da99e fdo#70942 Preserve original shape type, if shape contains text.
Currently we change shape type to textframe if a shape contains
text. Due to this shape information is not preserved when file
is saved.

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

Change-Id: I7af3ce29f857d6fa2ceab0350937d91638361e7c
2014-01-13 18:17:42 +01:00
e7e6a5f985 oox: handle a:noAutofit/spAutoFit in WpsContext
Change-Id: I568e8d95f263b30579a2eec49abe8ae45f7f2e96
2014-01-06 16:37:26 +01:00
430246ef14 oox: handle pic:pic in WPG groupshape import
Change-Id: I7de11251bc4e1b58f9cb308e8b698d4c8c1a58d3
2014-01-06 10:16:28 +01:00
eb2b7d243d oox: fix handling of noop parent transformation from DOCX
It seems that in Word, a zero parent transformation, like:

<a:chOff x="0" y="0"/>
<a:chExt cx="0" cy="0"/>

means the child shapes will have an absolute position / size. We
actually use this feature in the exporter, but so far the importer
didn't handle this.

Change-Id: I250784a3dddd23649e391b548fc128dfdf153614
2014-01-03 17:22:00 +01:00
92518d513f drawingML import: fix default character height of WPG rectangles
The problem was that due to setting it to 18 in oox, the rectangle
didn't inherit the default 11 from the document.

Change-Id: I05c3b9c1d64eec58695e2039651a5f015df1f9e4
2014-01-03 12:39:26 +01:00
c7662eea85 oox: whitespace fixes in WpsContext
Change-Id: Idcd4409a02a5b0dc5f7b67d2a482bf4fe30f579c
2013-12-28 10:00:49 +01:00
8a6d84fc1a oox: whitespace fixes in WpgContext
Change-Id: I4b4a3f9c4ec2c49c178d2e6a175b3dc307295e97
2013-12-24 10:05:55 +01:00
c3fe7450e3 oox: whitespace fixes in LockedCanvasContext
Change-Id: Iee8cfce2b002e19762f7bd247729f6da52a543c6
2013-12-21 12:08:15 +01:00