[gnumeric] xls: export line widths.



commit 07f684477872e5fd23d80d0c22a5d8ca8a832f40
Author: Morten Welinder <terra gnome org>
Date:   Wed Oct 7 10:24:49 2009 -0400

    xls: export line widths.

 NEWS                           |    2 +-
 plugins/excel/ChangeLog        |    4 ++--
 plugins/excel/ms-escher.h      |    3 ++-
 plugins/excel/ms-excel-write.c |   10 ++++++++--
 4 files changed, 13 insertions(+), 6 deletions(-)
---
diff --git a/NEWS b/NEWS
index 80caec7..55440df 100644
--- a/NEWS
+++ b/NEWS
@@ -31,7 +31,7 @@ Morten:
 	* Plug xls export leaks.
 	* Implement export of lines and arrows to xls.  [Part of #597035]
 	* Fix xls reading of sheet object colours.
-	* Export line and textbox colouring.  [Part of #597035]
+	* Export line and textbox colouring and widths.  [Part of #597035]
 
 --------------------------------------------------------------------------
 Gnumeric 1.9.13
diff --git a/plugins/excel/ChangeLog b/plugins/excel/ChangeLog
index 5113e4b..cc13de2 100644
--- a/plugins/excel/ChangeLog
+++ b/plugins/excel/ChangeLog
@@ -4,8 +4,8 @@
 
 	* ms-excel-write.c (excel_write_textbox_v8): Make sure the textbox
 	gets to be part of the container.  Export line and background
-	colours.
-	(excel_write_line_v8): Export line colour.
+	colours.  Export outline width.
+	(excel_write_line_v8): Export line colour and width.
 
 	* ms-escher.c (ms_escher_opt_end): Docs were wrong.  Do not
 	include own header in length.
diff --git a/plugins/excel/ms-escher.h b/plugins/excel/ms-escher.h
index 51e81b6..68dc227 100644
--- a/plugins/excel/ms-escher.h
+++ b/plugins/excel/ms-escher.h
@@ -19,7 +19,8 @@
 
 enum {
 	MSEP_FILLCOLOR = 0x0181,
-	MSEP_LINECOLOR = 0x01c0
+	MSEP_LINECOLOR = 0x01c0,
+	MSEP_LINEWIDTH = 0x01cb
 };
 
 
diff --git a/plugins/excel/ms-excel-write.c b/plugins/excel/ms-excel-write.c
index 36b9578..3555ea3 100644
--- a/plugins/excel/ms-excel-write.c
+++ b/plugins/excel/ms-excel-write.c
@@ -4339,6 +4339,10 @@ excel_write_textbox_v8 (ExcelWriteSheet *esheet, SheetObject *so)
 				 style == NULL || style->line.auto_color
 				 ? GO_COLOR_BLACK
 				 : style->line.color);
+	if (style && style->line.width > 0) {
+		guint16 w = CLAMP (12700 * style->line.width, 0, 65535);
+		ms_escher_opt_add_simple (escher, optmark, MSEP_LINEWIDTH, w);
+	}
 	if (name)
 		ms_escher_opt_add_str_wchar (escher, optmark, extra,
 					     0x0380, name);
@@ -4430,8 +4434,10 @@ excel_write_line_v8 (ExcelWriteSheet *esheet, SheetObject *so)
 				 style->line.auto_color
 				 ? GO_COLOR_BLACK
 				 : style->line.color);
-	ms_escher_opt_add_simple (escher, optmark,
-				  0x01cb, 19050); /* lineWidth */
+	if (style->line.width > 0) {
+		guint16 w = CLAMP (12700 * style->line.width, 0, 65535);
+		ms_escher_opt_add_simple (escher, optmark, MSEP_LINEWIDTH, w);
+	}
 	if (is_arrow)
 		ms_escher_opt_add_simple (escher, optmark,
 					  0x01d1, 1);  /* lineEndArrowhead */



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]