[PATCH] fdo#35791 Added cases for unsupported VML commands
Hi, I have submitted a patch for review: https://gerrit.libreoffice.org/3093 To pull it, you can do: git pull ssh://gerrit.libreoffice.org:29418/core refs/changes/93/3093/1 fdo#35791 Added cases for unsupported VML commands Change-Id: Ia1abca37352b1feb20a41b4bac68ecb9e40ed8dc --- M oox/source/vml/vmlformatting.cxx 1 file changed, 96 insertions(+), 11 deletions(-) diff --git a/oox/source/vml/vmlformatting.cxx b/oox/source/vml/vmlformatting.cxx index 05940f9..b3cac88 100644 --- a/oox/source/vml/vmlformatting.cxx +++ b/oox/source/vml/vmlformatting.cxx @@ -273,8 +273,9 @@ sal_Int32 nTokenStart = 0; sal_Int32 nTokenLen = 0; sal_Int32 nParamCount = 0; +bool bCommand = false; enum VML_State { START, MOVE_REL, MOVE_ABS, BEZIER_REL, BEZIER_ABS, - LINE_REL, LINE_ABS, CLOSE, END }; + LINE_REL, LINE_ABS, CLOSE, END, UNSUPPORTED }; VML_State state = START; rPointLists.push_back( ::std::vector< Point>() ); @@ -288,7 +289,7 @@ else if ( rPath[ i ] != ' ' ) { // Store coordinate from current token -if ( state != START ) +if ( state != START && state != UNSUPPORTED ) { if ( nTokenLen > 0 ) aCoordList.push_back( rPath.copy( nTokenStart, nTokenLen ).toInt32() ); @@ -374,25 +375,109 @@ break; case START: +case UNSUPPORTED: break; } aCoordList.clear(); } -// Move on to current command state +// Allow two-char commands to peek ahead to the next character +char nextChar = '\0'; +if (i+1 < rPath.getLength()) +nextChar = rPath[i+1]; + +// Move to relevant state upon finding a command +bCommand = true; switch ( rPath[ i ] ) { -case 't': state = MOVE_REL; nTokenLen = 0; nParamCount = 2 * 2; break; -case 'm': state = MOVE_ABS; nTokenLen = 0; nParamCount = 2 * 2; break; -case 'v': state = BEZIER_REL; nTokenLen = 0; nParamCount = 2 * 6; break; -case 'c': state = BEZIER_ABS; nTokenLen = 0; nParamCount = 2 * 6; break; -case 'r': state = LINE_REL; nTokenLen = 0; nParamCount = 2 * 2; break; -case 'l': state = LINE_ABS; nTokenLen = 0; nParamCount = 2 * 2; break; -case 'x': state = CLOSE; nTokenLen = 0; break; -case 'e': state = END; break; +// Single-character commands +case 't': // rmoveto +state = MOVE_REL; nParamCount = 2 * 2; break; +case 'm': // moveto +state = MOVE_ABS; nParamCount = 2 * 2; break; +case 'v': // rcurveto +state = BEZIER_REL; nParamCount = 2 * 6; break; +case 'c': // curveto +state = BEZIER_ABS; nParamCount = 2 * 6; break; +case 'r': // rlineto +state = LINE_REL; nParamCount = 2 * 2; break; +case 'l': // lineto +state = LINE_ABS; nParamCount = 2 * 2; break; +case 'x': // close +state = CLOSE; break; +case 'e': // end +state = END; break; + +// Two-character commands +case 'n': +{ +switch ( nextChar ) +{ +case 'f': // nf - nofill +case 's': // ns - nostroke +state = UNSUPPORTED; i++; break; +} +break; +} +case 'a': // Elliptical curves +{ +switch ( nextChar ) +{ +case 'e': // ae - angleellipseto +case 'l': // al - angleellipse +state = UNSUPPORTED; i++; break; +case 't': // at - arcto +case 'r': // ar - arc +state = UNSUPPORTED; i++; break; +} +break; +} +case 'w': // Clockwise elliptical arcs +{ +switch ( nextChar ) +{ +case 'a': // wa - clockwisearcto +case 'r': // wr - clockwisearc +state = UNSUPPORTED; i++; break; +} +break; +} +case 'q': +{ +switch ( nextChar ) +{ +case 'x': // qx - ellipticalquadrantx +case 'y': // qy - ellipticalquadranty +state = UNSUPPORTED; i++; break; +case 'b': // qb - quadraticbezier +state = UNSUPPORTED; i++; break; +} +break; +} +case 'h': // behaviour extensions +{ +switch ( nextChar ) +
[PATCH] Fixes image drop shadow export to DOCX.
Hi, I have submitted a patch for review: https://gerrit.libreoffice.org/1655 To pull it, you can do: git pull ssh://gerrit.libreoffice.org:29418/core refs/changes/55/1655/1 Fixes image drop shadow export to DOCX. Word has problems if the effect extent element is omitted. This gets the minimum required extent using the shadow position. Change-Id: I69d0d7a694c34f50289253e5cb7c4265198deaa8 --- M sw/source/filter/ww8/docxattributeoutput.cxx 1 file changed, 28 insertions(+), 3 deletions(-) diff --git a/sw/source/filter/ww8/docxattributeoutput.cxx b/sw/source/filter/ww8/docxattributeoutput.cxx index b97b368..2669b5f 100644 --- a/sw/source/filter/ww8/docxattributeoutput.cxx +++ b/sw/source/filter/ww8/docxattributeoutput.cxx @@ -2141,9 +2141,35 @@ XML_cx, aWidth.getStr(), XML_cy, aHeight.getStr(), FSEND ); -// TODO - the right effectExtent, extent including the effect + +// effectExtent, extent including the effect (shadow only for now) +SvxShadowItem aShadowItem = pFrmFmt->GetShadow(); +OString aLeftExt("0"), aRightExt("0"), aTopExt("0"), aBottomExt("0"); +if ( aShadowItem.GetLocation() != SVX_SHADOW_NONE ) +{ +OString aShadowWidth( OString::valueOf( TwipsToEMU( aShadowItem.GetWidth() ) ) ); +switch ( aShadowItem.GetLocation() ) +{ +case SVX_SHADOW_TOPLEFT: +aTopExt = aLeftExt = aShadowWidth; +break; +case SVX_SHADOW_TOPRIGHT: +aTopExt = aRightExt = aShadowWidth; +break; +case SVX_SHADOW_BOTTOMLEFT: +aBottomExt = aLeftExt = aShadowWidth; +break; +case SVX_SHADOW_BOTTOMRIGHT: +aBottomExt = aRightExt = aShadowWidth; +break; +case SVX_SHADOW_NONE: +case SVX_SHADOW_END: +break; +} +} + m_pSerializer->singleElementNS( XML_wp, XML_effectExtent, -XML_l, "0", XML_t, "0", XML_r, "0", XML_b, "0", +XML_l, aLeftExt, XML_t, aTopExt, XML_r, aRightExt, XML_b, aBottomExt, FSEND ); if( isAnchor ) @@ -2275,7 +2301,6 @@ m_pSerializer->endElementNS( XML_a, XML_ln ); // Output effects -SvxShadowItem aShadowItem = pFrmFmt->GetShadow(); if ( aShadowItem.GetLocation() != SVX_SHADOW_NONE ) { // Distance is measured diagonally from corner -- To view, visit https://gerrit.libreoffice.org/1655 To unsubscribe, visit https://gerrit.libreoffice.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I69d0d7a694c34f50289253e5cb7c4265198deaa8 Gerrit-PatchSet: 1 Gerrit-Project: core Gerrit-Branch: master Gerrit-Owner: Eilidh McAdam ___ LibreOffice mailing list LibreOffice@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice
[PATCH] Export finely dashed borders to docx.
Hi, I have submitted a patch for review: https://gerrit.libreoffice.org/1124 To pull it, you can do: git pull ssh://gerrit.libreoffice.org:29418/core refs/changes/24/1124/1 Export finely dashed borders to docx. Change-Id: I4a65f8e874abe406a9cd2d3a088ea52f0850088f --- M sw/source/filter/ww8/docxattributeoutput.cxx 1 file changed, 3 insertions(+), 0 deletions(-) -- To view, visit https://gerrit.libreoffice.org/1124 To unsubscribe, visit https://gerrit.libreoffice.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I4a65f8e874abe406a9cd2d3a088ea52f0850088f Gerrit-PatchSet: 1 Gerrit-Project: core Gerrit-Branch: master Gerrit-Owner: Eilidh McAdam ___ LibreOffice mailing list LibreOffice@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice
[PATCH] Support added for fine dashing on table borders.
Hi, I have submitted a patch for review: https://gerrit.libreoffice.org/1123 To pull it, you can do: git pull ssh://gerrit.libreoffice.org:29418/core refs/changes/23/1123/1 Support added for fine dashing on table borders. When reading in docx documents, fine dashing provides a better visual match for some border types. Added in this patch: - FINE_DASHED in BorderLineStyle UNO enum and in internals - Import of docx table borders using this border style Change-Id: I39cfa18c915ec94d8e4ecfc6a2ca637076d1e468 --- M editeng/source/items/borderline.cxx M editeng/source/items/frmitems.cxx M offapi/com/sun/star/table/BorderLineStyle.idl M svtools/inc/svtools/ctrlbox.hxx M svtools/source/control/ctrlbox.cxx 5 files changed, 20 insertions(+), 2 deletions(-) -- To view, visit https://gerrit.libreoffice.org/1123 To unsubscribe, visit https://gerrit.libreoffice.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I39cfa18c915ec94d8e4ecfc6a2ca637076d1e468 Gerrit-PatchSet: 1 Gerrit-Project: core Gerrit-Branch: master Gerrit-Owner: Eilidh McAdam ___ LibreOffice mailing list LibreOffice@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice
[PATCH] docx fine dashed table border import test case.
Hi, I have submitted a patch for review: https://gerrit.libreoffice.org/1125 To pull it, you can do: git pull ssh://gerrit.libreoffice.org:29418/core refs/changes/25/1125/1 docx fine dashed table border import test case. Change-Id: I27ee8e360b8fd530f8cfefc58c8a0f96d706b979 --- A sw/qa/extras/ooxmlimport/data/tableborder-finedash.docx M sw/qa/extras/ooxmlimport/ooxmlimport.cxx 2 files changed, 16 insertions(+), 1 deletion(-) -- To view, visit https://gerrit.libreoffice.org/1125 To unsubscribe, visit https://gerrit.libreoffice.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I27ee8e360b8fd530f8cfefc58c8a0f96d706b979 Gerrit-PatchSet: 1 Gerrit-Project: core Gerrit-Branch: master Gerrit-Owner: Eilidh McAdam ___ LibreOffice mailing list LibreOffice@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice
[PATCH] Export image shadow effects to docx.
Hi, I have submitted a patch for review: https://gerrit.libreoffice.org/709 To pull it, you can do: git pull ssh://gerrit.libreoffice.org:29418/core refs/changes/09/709/1 Export image shadow effects to docx. Change-Id: Ic8be107eeaeed286359869fd7e6712c3f740fba5 --- M sw/source/filter/ww8/docxattributeoutput.cxx 1 file changed, 32 insertions(+), 0 deletions(-) -- To view, visit https://gerrit.libreoffice.org/709 To unsubscribe, visit https://gerrit.libreoffice.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ic8be107eeaeed286359869fd7e6712c3f740fba5 Gerrit-PatchSet: 1 Gerrit-Project: core Gerrit-Branch: master Gerrit-Owner: Eilidh McAdam ___ LibreOffice mailing list LibreOffice@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice
[PATCH] Apply shadow effect to graphics when importing from docx.
Hi, I have submitted a patch for review: https://gerrit.libreoffice.org/703 To pull it, you can do: git pull ssh://gerrit.libreoffice.org:29418/core refs/changes/03/703/1 Apply shadow effect to graphics when importing from docx. Graphical objects imported into a text document do not seem to support differing X and Y distances for shadows, so the distance has been approximated by using the average of the two components. Change-Id: Ifd0c6d73b618cb2836837348d6f48c0efc0a9dc3 --- M writerfilter/source/dmapper/GraphicImport.cxx M writerfilter/source/dmapper/PropertyIds.cxx M writerfilter/source/dmapper/PropertyIds.hxx 3 files changed, 48 insertions(+), 0 deletions(-) -- To view, visit https://gerrit.libreoffice.org/703 To unsubscribe, visit https://gerrit.libreoffice.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ifd0c6d73b618cb2836837348d6f48c0efc0a9dc3 Gerrit-PatchSet: 1 Gerrit-Project: core Gerrit-Branch: master Gerrit-Owner: Eilidh McAdam ___ LibreOffice mailing list LibreOffice@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice
[PATCH] DOCX image drop shadow testcase.
Hi, I have submitted a patch for review: https://gerrit.libreoffice.org/704 To pull it, you can do: git pull ssh://gerrit.libreoffice.org:29418/core refs/changes/04/704/1 DOCX image drop shadow testcase. Change-Id: I27fdf0abff997d31ae8814812f7af1ec15af --- A sw/qa/extras/ooxmlimport/data/imgshadow.docx M sw/qa/extras/ooxmlimport/ooxmlimport.cxx 2 files changed, 19 insertions(+), 1 deletion(-) -- To view, visit https://gerrit.libreoffice.org/704 To unsubscribe, visit https://gerrit.libreoffice.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I27fdf0abff997d31ae8814812f7af1ec15af Gerrit-PatchSet: 1 Gerrit-Project: core Gerrit-Branch: master Gerrit-Owner: Eilidh McAdam ___ LibreOffice mailing list LibreOffice@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice
[PATCH] Import shadow effect properties for shapes in docx.
Hi, I have submitted a patch for review: https://gerrit.libreoffice.org/702 To pull it, you can do: git pull ssh://gerrit.libreoffice.org:29418/core refs/changes/02/702/1 Import shadow effect properties for shapes in docx. Change-Id: I0cfd6b45be268d688b7389c79c5e9ad7f48eb12d --- M oox/Library_oox.mk M oox/inc/oox/drawingml/drawingmltypes.hxx A oox/inc/oox/drawingml/effectproperties.hxx A oox/inc/oox/drawingml/effectpropertiescontext.hxx M oox/inc/oox/drawingml/shape.hxx M oox/inc/oox/drawingml/shapepropertymap.hxx A oox/source/drawingml/effectproperties.cxx A oox/source/drawingml/effectpropertiescontext.cxx M oox/source/drawingml/shape.cxx M oox/source/drawingml/shapepropertiescontext.cxx M oox/source/token/properties.txt 11 files changed, 274 insertions(+), 0 deletions(-) -- To view, visit https://gerrit.libreoffice.org/702 To unsubscribe, visit https://gerrit.libreoffice.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I0cfd6b45be268d688b7389c79c5e9ad7f48eb12d Gerrit-PatchSet: 1 Gerrit-Project: core Gerrit-Branch: master Gerrit-Owner: Eilidh McAdam ___ LibreOffice mailing list LibreOffice@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice
[PATCH] Import bezier curves from .docx.
Hi, I have submitted a patch for review: https://gerrit.libreoffice.org/649 To pull it, you can do: git pull ssh://gerrit.libreoffice.org:29418/core refs/changes/49/649/1 Import bezier curves from .docx. A shape element with a path attribute is interpreted as a bezier. We can support both curve and line commands by using the correct co-ordinate flags when using the UNO interface (omit control points for lines). Alternatively, curves may be specified using the to, from, control1 and control2 attributes of a curve element. Note that when setting the PolyPolygonBezier property of the xshape, the shape size and position are set too large somehow. The workaround for now is manually forcing the pre-calculated shape size and position. Change-Id: If3563474df357d161a2ed2e7a20856d5aed80a94 --- M oox/inc/oox/vml/vmlshape.hxx M oox/inc/oox/vml/vmlshapecontext.hxx M oox/source/token/properties.txt M oox/source/vml/vmlshape.cxx M oox/source/vml/vmlshapecontext.cxx 5 files changed, 138 insertions(+), 2 deletions(-) -- To view, visit https://gerrit.libreoffice.org/649 To unsubscribe, visit https://gerrit.libreoffice.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: If3563474df357d161a2ed2e7a20856d5aed80a94 Gerrit-PatchSet: 1 Gerrit-Project: core Gerrit-Branch: master Gerrit-Owner: Eilidh McAdam ___ LibreOffice mailing list LibreOffice@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice
[PATCH] Import RTF shape wrap property.
Hi, I have submitted a patch for review: https://gerrit.libreoffice.org/647 To pull it, you can do: git pull ssh://gerrit.libreoffice.org:29418/core refs/changes/47/647/1 Import RTF shape wrap property. Property \shpwrN, where N can be 1: Wrap at top and bottom (no wrap at sides) 2: Wrap around shape 3: None (wrap as though shape isn't there) 4: Wrap tightly around shape 5: Wrap text through shape Change-Id: Ic700e06bf9ef894a6efa7e8d033888ed80a7082f --- M writerfilter/source/rtftok/rtfdocumentimpl.cxx M writerfilter/source/rtftok/rtfdocumentimpl.hxx M writerfilter/source/rtftok/rtfsdrimport.cxx 3 files changed, 23 insertions(+), 2 deletions(-) -- To view, visit https://gerrit.libreoffice.org/647 To unsubscribe, visit https://gerrit.libreoffice.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ic700e06bf9ef894a6efa7e8d033888ed80a7082f Gerrit-PatchSet: 1 Gerrit-Project: core Gerrit-Branch: master Gerrit-Owner: Eilidh McAdam ___ LibreOffice mailing list LibreOffice@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice
[PATCH] Correctly import multiple-point curves from RTF document.
Hi, I have submitted a patch for review: https://gerrit.libreoffice.org/646 To pull it, you can do: git pull ssh://gerrit.libreoffice.org:29418/core refs/changes/46/646/1 Correctly import multiple-point curves from RTF document. The RTF segment specifier seems to indicate the type of segment with the first two bytes and how many points the specifier applies to with the last two bytes. Note that without further test docs, this hypothesis is yet to be thoroughly tested. Change-Id: I6f85435f52ef244b9c417e67d54c236ef4c7f149 --- M writerfilter/source/rtftok/rtfsdrimport.cxx 1 file changed, 11 insertions(+), 2 deletions(-) -- To view, visit https://gerrit.libreoffice.org/646 To unsubscribe, visit https://gerrit.libreoffice.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I6f85435f52ef244b9c417e67d54c236ef4c7f149 Gerrit-PatchSet: 1 Gerrit-Project: core Gerrit-Branch: master Gerrit-Owner: Eilidh McAdam ___ LibreOffice mailing list LibreOffice@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice
[PATCH] Add VML path parsing to .docx import filter.
Hi, I have submitted a patch for review: https://gerrit.libreoffice.org/648 To pull it, you can do: git pull ssh://gerrit.libreoffice.org:29418/core refs/changes/48/648/1 Add VML path parsing to .docx import filter. Change-Id: Ibb90ff437f6de1cab98b64deeccfa38e0e30756b --- M oox/inc/oox/vml/vmlformatting.hxx M oox/source/vml/vmlformatting.cxx 2 files changed, 142 insertions(+), 0 deletions(-) -- To view, visit https://gerrit.libreoffice.org/648 To unsubscribe, visit https://gerrit.libreoffice.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ibb90ff437f6de1cab98b64deeccfa38e0e30756b Gerrit-PatchSet: 1 Gerrit-Project: core Gerrit-Branch: master Gerrit-Owner: Eilidh McAdam ___ LibreOffice mailing list LibreOffice@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice