[PATCH] fdo#35791 Added cases for unsupported VML commands

2013-03-27 Thread Eilidh McAdam (via Code Review)
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.

2013-01-11 Thread Eilidh McAdam (via Code Review)
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 eilidh.mca...@gmail.com

___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice


[PATCH] docx fine dashed table border import test case.

2012-11-19 Thread Eilidh McAdam (via Code Review)
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 eilidh.mca...@gmail.com

___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice


[PATCH] Export finely dashed borders to docx.

2012-11-19 Thread Eilidh McAdam (via Code Review)
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 eilidh.mca...@gmail.com

___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice


[PATCH] Export image shadow effects to docx.

2012-09-27 Thread Eilidh McAdam (via Code Review)
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 eilidh.mca...@gmail.com

___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice


[PATCH] Import shadow effect properties for shapes in docx.

2012-09-26 Thread Eilidh McAdam (via Code Review)
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 eilidh.mca...@gmail.com

___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice


[PATCH] DOCX image drop shadow testcase.

2012-09-26 Thread Eilidh McAdam (via Code Review)
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 eilidh.mca...@gmail.com

___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice


[PATCH] Apply shadow effect to graphics when importing from docx.

2012-09-26 Thread Eilidh McAdam (via Code Review)
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 eilidh.mca...@gmail.com

___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice


[PATCH] Add VML path parsing to .docx import filter.

2012-09-19 Thread Eilidh McAdam (via Code Review)
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 eilidh.mca...@gmail.com

___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice


[PATCH] Correctly import multiple-point curves from RTF document.

2012-09-19 Thread Eilidh McAdam (via Code Review)
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 eilidh.mca...@gmail.com

___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice