Regression from commit abe1e852a232e3bdab7b9177d099fe3929f5a4aa (handle
properly page breaks even if a page contains only a frame (fdo#55381),
2014-04-21), DomainMapper::lcl_endSectionGroup() inserted an empty
paragraph before and after the real footnote text. Disable addition of
the dummy paragraph for footnotes.
Change-Id: I6e1954c9bd5520ac284d66244ce1c9004e970305
Problem Description : For some documents containing redLine data there was already processing done for paragraph properties pPr
but when it comes to DocxAttributeOutput::EndParagraphProperties() instead of writing these pPr, LO was calling Redline( pRedlineData )
which has it's pPr inside w:pPrChange.
This was the reason when LO calls WriteCollectedParagraphProperties() after calling Redline() it was writing both paragraph properties
inside single w:shd element.Hence the RT document was getting Corrupt.
Added condition in DocxAttributeOutput::EndParagraphProperties() which is checking for RedlineData and if it's there call
WriteCollectedParagraphProperties() before calling Redline().
Added Export Test case.
Change-Id: I7000c27fe6ee372cac81d6f22e0d3ca9219a24d7
Reviewed-on: https://gerrit.libreoffice.org/9712
Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
Tested-by: Miklos Vajna <vmiklos@collabora.co.uk>
File contains SDT content, in which after export databinding have duplicate attribute.
Conflicts:
sw/qa/extras/ooxmlexport/ooxmlexport.cxx
Reviewed on:
https://gerrit.libreoffice.org/9693
Change-Id: Ibe828964c054bdd5a63b5c0c903bc7441d953d72
Issue :
- In file there is a WordArt inside Table.
- In RT, LO exports <w:drawing> inside <w:drawing>.
- The xml sequence was :
<mc:AltrnateContent>
<mc:Choice>
<w:drawing> // first start of drawing
<w:txbxContent>
<w:tbl>
<w:drawing> // second start of drawing. MSO does not allow.
Implementation :
- In DocxAttributeOutput::OutputFlyFrame_Impl() under "case sw::Frame::eDrawing",
if drawing is already open then Postpone the Inner Drawing.
- Added Export Unit Test case to check two separate drawings are
now written in document.xml of RT.
Change-Id: I01d06621576d60d26cd51489ee9718dd79eb9c72
Reviewed-on: https://gerrit.libreoffice.org/9653
Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
Tested-by: Miklos Vajna <vmiklos@collabora.co.uk>
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>
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
Decription :
- Docx file contain smartart and it was created in MS word 2007.
- MS word 2007 does not create any drawing.xml for smartart
- So in DocxSdrExport::writeDiagram() diagramDrawing was not set in this case.
- File crashing at diagramDrawing[0] >>= drawingDom as diagramDrawing is empty.
Change-Id: I6bc38e702f731ad8074b562572fd50f2e29a41b7
Reviewed-on: https://gerrit.libreoffice.org/9706
Tested-by: Michael Stahl <mstahl@redhat.com>
Reviewed-by: Michael Stahl <mstahl@redhat.com>
http://opengrok.libreoffice.org/xref/core/sw/source/core/unocore/unosett.cxx#1884
Modifies the refernced style of the numbering rule to use the current numbering rule.
Actually the refernced style is not supposed to be modified.
As the numbering level formatonly uses that properties particular style,
which may or may not be a numbering style
For this Particular document the numbering format refers the "Default Style" (Normal).
Almost all of the styles in style.xml are based on it. Normal was modified,
and as a result the whole document was bulletized; Which caused the hang while opening
Removed the addition of style as a PARA_STYLE, as the properties of the
refernced style are already added in ListLevel::AddParaProperties
Conflicts:
sw/qa/extras/ooxmlimport/ooxmlimport.cxx
Reviewed on:
https://gerrit.libreoffice.org/9668
Change-Id: I8cc143805a38613908d2e2cb4827882d4cf40a78
When a w:shd has some pattern with two colors, LO blends both to
render the paragraph background. We must compare that blended color
with the paragraph color on export to know if the user has edited it
or not. We were using the w:fill attribute to compare, but that was
incorrect.
Modified an existing unit test to check this behaviour. The unit test
had to be retouched because Word remove some redundant information
from the original .docx file when I saved it again with some
background changes.
Change-Id: Ia2f1ddc4afd2637e1d87b6eccd441c26853045c4
Description:
In RT file the dash length (d) is going out of range,
as after RT the dashing scheme changes to custom dash
which was causing the corruption. Changed code at export,
which will divide the DashLen, DotLen and Distance by
base line width.
Reviewed on:
https://gerrit.libreoffice.org/9559
Change-Id: I0e644b5a2b692a9e717026a14d1f0058199f53b1
These are the remaining changes: with these, if we import "drawingML
shape with text in DOCX" as "shape with textbox", no testcase in this
suite fails.
Change-Id: Ic39cc204e3cfb662f14db1810f7138df0829eb27
getShape() doesn't case if the object is on a drawinglayer one or a
Writer TextFrame, and that's exactly what we want. (Currently is a
TextFrame, but will be a drawinglayer object when shape with text will
be imported as shape with textbox.)
Change-Id: I6ae981700d214447f326e6a0fb550b98380bc10c
Problem Description : While setting ExtraData for Redline LO calls SwRangeRedline::SetExtraData() with
argument of type SwRedlineExtraData_FormattingChanges* which contains SfxItemSet*
In function SwRedlineExtraData_FormattingChanges() without Null checking SfxItemSet*,
LO was trying to get rCpy.pSet->Count() which was the reason for segmentation fault
while opening some documents in LO.
Added Null check before accessing a pointer.
Change-Id: I33299d2be2777ab6a8af0621595c9453145f1069
Reviewed-on: https://gerrit.libreoffice.org/9647
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
When we have a style to import and the name is already taken, we reuse
the style (we can't use replaceByName(), it only works with user-defined
styles). If that happens, reset non-default properties of it, so the
result will be what was in the file, not a merge of Writer defaults and
what was in the file.
Change-Id: Ifb1098f78254a061b11fd6c6d2a2fa8d85a00d60
<vmiklos> sberg: the comment says that it was 2, so unless you're interested in
debugging it, i would just lower the barrier (423 -> 369)
Change-Id: I0269eab4eee594c4d7aad1c710ed389443208bc4
- There is pagebreak in file and footer has nested table.
- While exporting LO write section break instead of PAGE_BREAK.
- Due to this it was writing two sections in file and same footer
for both sections.
- This was causing wrong table depth values due to this it was crashing
while writing table.
- So in MSWordExportBase::OutputSectionBreaks if next node has
RES_BREAK(page break) then bNewPageDesc value should be false.
Change-Id: I2ccc4e48a26253716253a7280a244f06e172770a
Reviewed-on: https://gerrit.libreoffice.org/9568
Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
Tested-by: Miklos Vajna <vmiklos@collabora.co.uk>
This is a variable-length encoding, and the second byte may be a RTF
syntax character like \, {, }.
Change-Id: I813ccafda18388af3bf05eb7ce9a0253c627b1c4
There is a lot more to test here, but for now just test that we can have
tables and rounded corners at the same time.
Change-Id: Ia9a4877202d1d040209f49a428b83633c58fc7c7
The problem was that right after the import, the document wasn't marked
as modified, but as layout settled, it got marked as modified.
Given that we already have code to avoid modification when updating the
replacement image, do something similar here: when setting the view
area, make sure the embedded object's component is not marked as
modified.
Change-Id: I88a42829ec48db54178553661863a571cd2a268b
Issue :
- In styles.xml, beforeAutospacing property was set to true.
- In code LO grab bags AustoSpacing property using "ParaInteropGrabBag".
- But ParaInteropGrabBag had only an entry for direct paragraph properties,
not paragraph styles.
- Hence while importing AustoSpacing property from styles.xml, LO was throwing exception
as "Some style properties could not be set: Unknown property: ParaInteropGrabBag".
Implementation :
- Added "ParaInteropGarbBag" entry for Paragraph styles in
sw/source/core/unocore/unomap.cxx
- Removed code from StyleSheetTable::ApplyStyleSheets() as it was previously added to
"Ignore" the AutoSpacing property.
The code was previously added beacuse due to AutpSpacing in styles.xml,
LO was throwing an exception and this was causing unhandling of properties after AutoSpacing.
So to prevent unhandling of other properties due to AutoSpacing property, a check was added to
"Ignore" AutoSpacing, thus enabling handling of properties after AutoSpacing.
Please refer to : https://gerrit.libreoffice.org/#/c/8902/
But as now we have to "Preserve AutoSpacing" this check needs to be removed in order to set
it in StyelSheetTable.cxx.
- Added Export Unit test case
Change-Id: I6748f97befcdf40643e75388766e05740290306b
Reviewed-on: https://gerrit.libreoffice.org/9561
Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
Tested-by: Miklos Vajna <vmiklos@collabora.co.uk>
Added header guards to files in directory sw/
Change-Id: I5859f986c6f954d41a7940dc9ae8febaa714d34f
Reviewed-on: https://gerrit.libreoffice.org/9587
Reviewed-by: Thomas Arnhold <thomas@arnhold.org>
Tested-by: Thomas Arnhold <thomas@arnhold.org>
Description:
Writer getting Hang while opening document because of loop in layout.
Root cause: For Documents containing table with direct formatting for
Para line spacing along with style w:type="table" in style.xml LO was
erasing PROP_PARA_LINE_SPACING Prop from pAllCellProps in
DomainMapperTableHandler::endTableGetCellProperties(). But for
Documents without direct formatting for Para line spacing this deletion
was causing problem, as after deletion there is no formatting available
to apply.
To fix this checking whether there is a Direct formatting available for
table, if Yes then proceed with this deletion logic.
Change-Id: Ibaf51ebd1aca93eff44a9edfbe8fa13832ab2b70
Signed-off-by: Michael Stahl <mstahl@redhat.com>
A vert orient position was already handled in case a floating table was
imported as a TextFrame, but in case we didn't do that, the vert orient
position was simply lost.
Fix this by importing it as the upper margin of the table (assuming that
the position is relative from the anchor position).
Change-Id: I3e96f3068605fd6313dfb3e55483e1bce6c063a5
Any DOCX export test that is related to shapes should go to the sdr
suite to be able to execute in parallel.
Change-Id: I719cd6eda973c5daa1f11bb0e1f57bbacab9f812
When we do the export of the file, In the footnotes.xml,
the w14 namespaces were not being added.
This issue exists for EndNotes as well.
Change-Id: I6494bbf1beaa0666743d9c1bb85a64f8bda20398
Reviewed-on: https://gerrit.libreoffice.org/9439
Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
Tested-by: Miklos Vajna <vmiklos@collabora.co.uk>
...result still unsigned at sw/source/filter/ww8/docxsdrexport.cxx(441)
Just use SAL_{MAX,MIN}_INT32 (change -2147483648 to (-2147483647-1)) which fixes this warning for MSVC.
Change-Id: Ia039906602d3b00193a364bddb81626afa928f2d
If the old width was that small, then something larger should be also
fine. (Seen 564 instead of 423.)
Change-Id: Ife0fd4a55738268cdc1691b90e28b51adba829ef
The negative crop values were imported as large positive values, which
caused the image to be rendered with 1 pixel width after commit
2e5167528f7566dd9b000e50fc1610b7bf99132a.
Change-Id: I0e01b9d9a05d90e868699832085a06ba5aab7e54
782adba4d436c65cdf85d48f28486321873b15ed discards unneeded headers/footers,
but only the text, not e.g. frames or fields. The test document therefore
ends up with a frame with a page number inside the body text, because the text
in the footer it should be anchored to was discarded. This commit fixes
this by discarding more (although probably the whole header/footer
shouldn't even be parsed to begin with).
The test from b349d2483e1fe64316d87b55d0b3b4c8f2293e2e actually checked
for this incorrect frame, so change that (the whole test is suspicious, as
the end result is quite far away from what the original doc looks like).
Change-Id: I2e7192e00237db1f030d0524c5667fe92c9e496b
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