Used the same algorithm that we had for VML to update the position of
the DML anchor taking into account the rotation of the shape.
Complemented the unit test to check the values in the generated DML.
Change-Id: Ie0293c3cf4d1309fad58c0387f1589e69071fd9a
Field inside a hyperlink closed after the ending tag of hyperlink, which corrupted the RT file.
Reviewed on:
https://gerrit.libreoffice.org/8688
Change-Id: Ie6fb5eff19c941819ca8c6193b3a6471de12c3e6
The document contains an empty table with borders.
LO was treating this table as a nested table, which lead to
a TC tag mismatch.
In docxattributeoutput.cxx, inside 'switchHeaderFooter'
added a check against 'm_oldTableReference->m_pOldTablepInner'
For some documents, even if the above value was null, still
it was getting assigned to 'm_tableReference' . Thus in such situations
it leads to a crash.
Change-Id: I883267585cb804f961989797de57c4b843b96821
Reviewed-on: https://gerrit.libreoffice.org/8677
Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
Tested-by: Miklos Vajna <vmiklos@collabora.co.uk>
Re-enable the unit test with the fixed xPath expression.
This reverts commit 0e5f9958a57a68a3707db5b1eb9f82e0326327c1.
Conflicts:
sw/qa/extras/ooxmlexport/ooxmlexport.cxx
Change-Id: Ibc848b2ae89b3fb7f009cd984d0ecc5fc165673a
Reviewed-on: https://gerrit.libreoffice.org/8679
Tested-by: LibreOffice gerrit bot <gerrit@libreoffice.org>
Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
- m_oldTableReference values were not being reset.
- A call for DocxAttributeOutput::switchHeaderFooter from
DocxExport::WriteHeadersFooters would end up using the m_oldTableReference
value saved by DocxAttributeOutput::EndParagraph, which is incorrect.
- Fixed this issue and added an UT for the same.
Change-Id: I5ac51c3449e78bd26389e93e0d733d429dcc6874
Reviewed-on: https://gerrit.libreoffice.org/8659
Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
Tested-by: Miklos Vajna <vmiklos@collabora.co.uk>
MS Office has an internal limitation of 4091 styles in styles.xml
and cannot load a .docx with more. However the documentation seems to allow
that. So if there are more styles, don't export those.
MS Office follows the same principle and repairs the corrupt document by
removing extra styles.
Change-Id: I20c8775ee9d697a6613be96eb01283844c1d78f5
Reviewed-on: https://gerrit.libreoffice.org/8653
Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
Tested-by: Miklos Vajna <vmiklos@collabora.co.uk>
SDT blocks can contain document properties, like the author. This is
done with the dataBinding tag inside sdtPr.
Added a resource definition to the ooxml model file, so the parser can
process this tag. The attributes are stored in the existing grab bag
used for other sdt properties and written back on export.
The code to write the SDT block in the exporter has been modified to
be able to extract the new tag from the grab bag and write it to the
document.
Added a unit test.
Change-Id: I18f35a61784eb0a03ab9ca2cc398ca0df289956c
The exporter writes the sdt blocks enclosing an entire paragraph, but
that's not the proper behaviour in all cases. The documents that mix
checkboxes and text in the same paragraph export the text inside the
sdt box and that's incorrect.
We have added code to be able to write sdt blocks that enclose
paragraphs or text runs, depending on the type of block. We have
applied it to checkboxes now.
There are two sets of properties in DocxAttributeOutput that store
sdt properties for the text run and for the paragraph. We have
modified the method WriteParagraphSdt to be generic enough to support
both cases. To write the sdt block enclosing the text run we used
parser marks.
We have renamed the property id PROP_PARA_SDTPR to the more generic
name PROP_SDTPR.
Checkbox unit test was modified to match the new structure of the
generated document.
Change-Id: I81ffe0062e1a5f80fc4638f7ee454a9bc18e63ee
Checkbox controls in docx are implemented with a sdt block containing
the property w:14:checkbox, which has several child elements.
To implement the preservation of the field, we had to add several
tags to the ooxml model file. Notice they belong to namespace w14,
that's why we had to add a redundant definitions of CT_STRING,
ST_STRING and their actions. Then, we just used the existing
mechanisms on the importer and the exporter.
Finally, added a unit test.
TODO: the checkbox is preserved on export but it cannot be modified.
We should import it like we do for combo and date boxes.
Change-Id: I40f29b48ec24719c48482b9c8cff10176d1b188d
There are two issues that are handled in this fix.
1)File created in MSO2K10 on RT gets corrupted.The root cause is found in CustomShapeProperties::pushToPropSet
2)File created in MSO2K7 on RT gets corrupted.There is an issue in shape import <a:gd> values for any shape (ex. circular arrow, hexagon etc).LO cannot import right <a:gd> values for any shape which is created in MSO-2007.Due to missing values of <a:gd> tag, after roundtrip the file gets corrupted.To avoid corruption a check introduced:-
if(aAdjustments.size() == nLength)
after http://opengrok.libreoffice.org/xref/core/oox/source/export/drawingml.cxx#1784
that will verify the number of <a:gd> tags associated with the shape during import and the number of <a:gd> tags during export.If there is a mismatch <a:gd> willnot be written.Changes made in DrawingML::WritePresetShape.
I have written 2 test cases for the same.
Conflicts:
sw/qa/extras/ooxmlexport/ooxmlexport.cxx
Reviewed on:
https://gerrit.libreoffice.org/8657
Change-Id: Ibb1e2dc1c098b7399c06d7b4f59fac4e80887062
Issue :
DOCX containing nested Hyperlinks, have mismatch xml tags.
End tag for outer Hyperlinks does not get closed.
Implementation :
1] Added code at Export side to maintain Count of
Hyperlinks started and ended.
Added check endParagraph() to to close Hyperlink tag
if not yet closed but started.
2] Written Export Unit Test case.
NOTE : Corruption was occurring on "Without debug-util" build and Crash was occurring on "WITH debug-util build".
Reviewed on:
https://gerrit.libreoffice.org/8654
Change-Id: I9a0ab48578f3d5f4a13c615f4e42a69e790d3ced
Regression from commit 75934fc178ed90b56d77eb1efebed5bdac8427b6 (VML
import: handle shape with text inside groupshape as TextShape,
2014-01-17), the problem was that TextShape is also a kind of rectangle,
so that shouldn't be used for all shape with text in groupshapes, just
for v:rect elements.
This fix gives the required text wrapping for the referenced bugdoc
without turning the rest of the shapes into rectangles.
Change-Id: I6e343c65a869e335b641728adbc7984ee85377b5
So that e.g. parseDump() in case of an incorrect xpath does not just
plain give an equality assertion failure, which on its own is confusing.
Change-Id: Ib9fc2b4f6720b5c472773afbe8dc18cd8961465c
Description: There was a problem for some documents, when opened in LibreOffice
there was continuous increase in page numbers.And this was the reason for LO getting hang.
The wrap property "NS_ooxml::LN_Value_wordprocessingml_ST_Wrap_auto" was not handled in DomainMapper::lcl_attribute() and hence paragraph's wrap property was getting set to
"text::WrapTextMode_NONE" this was the reason for increasing number of pages while opening doc in LO.
added condition to handle NS_ooxml::LN_Value_wordprocessingml_ST_Wrap_auto.
*added test case to verify that the document is opening properly and checking it's page count.
Conflicts:
sw/qa/extras/ooxmlimport/ooxmlimport.cxx
Reviewed on:
https://gerrit.libreoffice.org/8632
Change-Id: Id24ebc8409e7fd53915e5130beb9ad6f8bb8571f
The Locked Canvas is imported correctly,
but while exporting the drawing is exported inside a textbox.
However a locked Canvas has to be exported inside a text-box
for the RT file to work in MS Word 2010.
As dml drawing elements are not allowed in the dml textboxes.
Export as Locked Canvas iff the drawing was originally a Locked Canvas
and is now inside a DML Text Frame.
As otherwise the Locked Canvas is exported correctly as a DMLDrawing.
Reviewed on:
https://gerrit.libreoffice.org/8618
Change-Id: Ifa350d8922a22c4e480411530aa4d953bd3ed2ac
This patch is to preserve the sdt blocks for several simple sdt types:
equation, picture, citation and group.
This patch reuses the infrastructure created at commit
55211e612d2cbed03dd81c039d07ea4e936c2804 to grab-bag the properties of
the sdt block and write them back on export, with small modifications
in particular related with the fact that these tags don't have
children.
The type of the property tags equation, picture, citation and group
was modified in the ooxml model file to be able to process them. They
were previously empty.
A unit test was added to check the preservation of these fields.
Another had to be modified.
Change-Id: Ica1a340f589f5d6c85c1a35d2a3a4bf930eb2d8a
Description:The RT file is getting corrupted.
The <w:fldChar w:fldCharType="end" /> tag is there inside the hyperlink tag where as the <w:fldChar w:fldCharType="begin"> is starting before the hyperlink tag.This is causing the issue.
The rootcause found is in DocxAttributeOutput::EndRun().
A check is introduced before the code that writes the <w:fldChar w:fldCharType="end" /> after the hyperlink to check if the m_startedHyperlink is false.
I have added test case to verify that now the RT file is opening
I also verified this change on a set of 440 real world documents (containing many combinations of MS Office features) to make sure there is no regression because of this change.
Conflicts:
sw/qa/extras/ooxmlexport/ooxmlexport.cxx
Reviewed on:
https://gerrit.libreoffice.org/8603
Change-Id: Ibc3ca8edcfb68d52a9394580bac1ce878eda9405
- In case of multiple paragraph comments/ page comments there used to be a
mismatch while relating the comment id's in document.xml and comments.xml
- This was happening because the annotation mark id's were getting overwritten.
- Fixed this issue and added UT for the same.
Change-Id: Ie0ac6b5c865555d143115a79b3fc146f9a4ef5fc
Reviewed-on: https://gerrit.libreoffice.org/8602
Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
Tested-by: Miklos Vajna <vmiklos@collabora.co.uk>
- DOCX file containing fields BIBLIOGRAPHY on first line, BIDIOUTLINE on
second line and CITATION on third line is getting crashed while opening in LO
- Fixed this issue and added unit test case for the same.
Change-Id: Ia8394a3a26157f88693edcf60b0161947d8a9ac0
Reviewed-on: https://gerrit.libreoffice.org/8589
Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
Tested-by: Miklos Vajna <vmiklos@collabora.co.uk>
The <w:docPartObj> property inside <w:sdt> blocks determines a block
inside the document that can be dinamically updated and enables Word
2010 to show a hover button to update it. It is used for TOCs,
bibliography, etc. LibreOffice ignored these blocks and removed them
from the document on export.
In this patch, we make the importer save the <w:docPartObj> tag and
its contents in the paragraph interop grab bag.
On export we read the paragraph grab bag and restore the sdt block
back to the document; we don't know if the paragraph must be enclosed
in a sdt block when we start it, so we used the parser marks to be
able to prepend the start of the block before the paragraph opening
tag.
The grab bag on import is managed by the SdtHelper class. Added a set
of methods for that purpose.
The ooxml model file was modified to assign token ids to the children
of w:docPartObj.
Fixed several unit tests that didn't expect the <w:sdt> tag to be
exported. Also modified testBibliography inside ooxmlexport test
suite to add checks for this patch.
TODO: in the imported documents the sdtContent block may contain
several paragraphs but the exporter code as it is can only wrap one
paragraph. As a result, if the sdt block contained several paragraphs
the second and next paragraphs will be outside the block in the
exported document.
Change-Id: I5333fc5ad91a3c50198a4f7647424a2101268c12
1. Open a File which has Pie Chart in LO.
2. The content type of Pie Chart should Macro Enabled.
3. using LO, SAVE this file.
4. Opened the Save file in MS-Office.
5. The file gets corrupted due to the ContentType gets changed.
Conflicts:
sw/qa/extras/inc/swmodeltestbase.hxx
Reviewed on:
https://gerrit.libreoffice.org/8572
Change-Id: I20f92f52cc79df4fc5e10c4e4867e2e704ba3c86
Problem Description:
- If the document contains, text box & group shape having
text, after roundtrip file get corrupted.
- Due this the text box exported inside the another group shape.
(i.e nested alternateContent which is not allowed in MS office 2010.)
Implementation:
- Use the variable which avoid the nested alternateContent.
- This keeps the various text frame on same level in different
run.
Conflicts:
sw/qa/extras/ooxmlexport/ooxmlexport.cxx
Reviewed on:
https://gerrit.libreoffice.org/8555
Change-Id: Ia18eb2b8cf17a451ebe344a811efae1328134215
- The original file contains an image which has invalid link.
- since the link is invalid the import throws an exception while loading
the image & the link is lost.
- while exporting the system used to write an empty image for an unhandled
graphic type, which is incorrect and the RT file would result in corrupt.
- Fixed this issue and added UT.
Conflicts:
sw/qa/extras/ooxmlexport/ooxmlexport.cxx
Reviewed on:
https://gerrit.libreoffice.org/8549
Change-Id: If884f154d1fba921280d63930e7fccb979ea5608
oox/source/export/presetShapeDefinitions.xml had
multiple entries for "upDownArrow" instead of an entry
for "upArrow".
Whereas drawingml/customshapes/presetShapeDefinitions.xml
has correct entries.
Changed CustomTarget_generated.mk to use
drawingml/customshapes/presetShapeDefinitions.xml instead of
oox/source/export/presetShapeDefinitions.xml. Also deleted the latter
to avoid duplication.
Conflicts:
sw/qa/extras/ooxmlexport/ooxmlexport.cxx
Reviewed on:
https://gerrit.libreoffice.org/8540
Change-Id: Ic46496af7fb79edf0780b04731a882d914e89a24
Commit 1eaab77c718ffa254068ae6032862dfb5a03db67 (fdo#60722 import
RTF_SHPZ, 2013-03-06) changed how we handle z-order, in case two shapes
have the same value. Turns out for drawing-objects the order is the
opposite in this situation.
So fix this by adding a new mode, that keeps the original testcase happy
without breaking older documents.
Change-Id: Ib2d284cefc3c0dce40ac2e516ba260d6cd04ce43
The problem was that dobxpage arrived first, set HoriOrientRelation to
FRAME, then dptxbx tried to apply defaults, which overwrote the already
set HoriOrientRelation. Fix this by only applying properties which are
not set yet.
Change-Id: I108f3363a2758eee0242533fe92e511e8c522b68
- System handles an equation having opening brace and closing brace.
- Whereas it fails to handle equations having only opening brace and no closing
brace, due to which LO crashes with assertion while exporting.
- Fixed this issue and added unit test case for the same.
- Also fixed the same for closing brace alone.
Change-Id: I34a8a635b42bfdfac265fb70b977c0001cd2b4ff
Reviewed-on: https://gerrit.libreoffice.org/8561
Tested-by: Michael Stahl <mstahl@redhat.com>
Reviewed-by: Michael Stahl <mstahl@redhat.com>
- A File containing a graphic shape bullet is captured as a numPictBullet in
MS office[in numbering.xml].
- Currently LO has support for graphic bullet as Image. Graphic bullet as Shape
needs to be preserved in LO.
- Since the numPictBullet is not exported in LO, but in <abstractNum>
<lvlPicBulletId> was exported which lead to corruption.
- Fixed the corruption caused due to lvlPicBulletId.
- However the shape is not getting retained. Need to add implementation
for gprahic bullet as a shape.
Conflicts:
sw/qa/extras/ooxmlexport/ooxmlexport.cxx
Change-Id: I2fc2b1ab4b75e8a050e66837a64578b235059473
These have changed a few times, notably in LO 4.0 with commit
895890563cb0cc5fa872bdfd06918a46cdda172d and AOO 4.0 with commit
c0eb5e7772c848806db8ab461f77f9549c1d8b2b; unfortunately historic OOo and
current AOO do not write the values into ODF files, whereas LO 4.x does
(probably by accident, since 45d3577bc5726eee44f491fd30a7f11dc428431a
by design).
Try to set the defaults depending on the generator; since the defaults
are not specified by ODF they are implementation defined anyway so this
should be OK.
Change-Id: I1270d6e0cdeea5cb493724a0998f661a0cf644f1