rpms/unrtf/FC-6 unrtf-0.20.2-fb2ansi.patch, NONE, 1.1 unrtf-0.20.2-in_pict.patch, NONE, 1.1 unrtf.spec, 1.9, 1.10

Aurelien Bompard (abompard) fedora-extras-commits at redhat.com
Sat Mar 3 09:59:31 UTC 2007


Author: abompard

Update of /cvs/extras/rpms/unrtf/FC-6
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv20622/FC-6

Modified Files:
	unrtf.spec 
Added Files:
	unrtf-0.20.2-fb2ansi.patch unrtf-0.20.2-in_pict.patch 
Log Message:
* Sat Mar 03 2007 Aurelien Bompard <abompard at fedoraproject.org> 0.20.2-2
- add patches from bugs 225188 and 225184


unrtf-0.20.2-fb2ansi.patch:

--- NEW FILE unrtf-0.20.2-fb2ansi.patch ---
	This patch implements a fall-back from Unicode to plain ANSI
	conversion.
	I think this is what was originally intended when writing the
	Codepage tables with that many 0's (in convert.c).
	With this patch, e. g. conversion of "umlauts" works again when
	using codepage 1252.
	
diff -u unrtf_0.20.2/src/output.c.fb2ansi unrtf_0.20.2/src/output.c
--- unrtf_0.20.2/src/output.c.fb2ansi	2006-06-18 10:45:19.000000000 +0200
+++ unrtf_0.20.2/src/output.c	2006-08-04 13:50:16.000000000 +0200
@@ -150,8 +150,9 @@
 			if (codepage->chars[ch - 0x80]) {
 				result = op->unisymbol_print(codepage->chars[ch - 0x80]);
 			}
-		} else {
-		start = op->ansi_first_char;
+		}
+		if (!result) {
+			start = op->ansi_first_char;
 			if (ch >= start &&
 			    ch <= op->ansi_last_char)
 				result = op->ansi_translation_table [ch-start];

unrtf-0.20.2-in_pict.patch:

--- NEW FILE unrtf-0.20.2-in_pict.patch ---
	This patch fixes the handling of \pict's which was broken when
	nopict_mode was introduced to convert.c.

	Before nopict_mode was there, pictfile was used to control the
	"reset" of within_picture to FALSE.  After the "nopict_mode changes"
	and without this patch, within_picture gets reset too early when
	the \pict has sub-groups/children because within_picture is
	a global variable and word_print_core() is used recursively.
	We need a local variable to control this operation, and this patch
	introduces the new local variable in_pict_data for this purpose.

diff -u unrtf_0.20.2/src/convert.c.in_pict unrtf_0.20.2/src/convert.c
--- unrtf_0.20.2/src/convert.c.in_pict	2006-06-18 10:52:33.000000000 +0200
+++ unrtf_0.20.2/src/convert.c	2006-08-04 10:29:19.000000000 +0200
@@ -3280,6 +3280,7 @@
 {
 	char *s;
 	FILE *pictfile=NULL;
+	int in_pict_data=FALSE;
 	int is_cell_group=FALSE;
 	int paragraph_begined=FALSE;
 	int paragraph_align=ALIGN_LEFT;
@@ -3319,20 +3320,23 @@
 				/*----------------------------------------*/
 				if (within_picture) {
 					starting_body();
-					if (!pictfile && !nopict_mode) {
-						char *ext=NULL;
-						switch (picture_type) {
-						case PICT_WB: ext="bmp"; break;
-						case PICT_WM: ext="wmf"; break;
-						case PICT_MAC: ext="pict"; break;
-						case PICT_JPEG: ext="jpg"; break;
-						case PICT_PNG: ext="png"; break;
-						case PICT_DI: ext="dib"; break; /* Device independent bitmap=??? */
-						case PICT_PM: ext="pmm"; break; /* OS/2 metafile=??? */
+					if (!in_pict_data) {
+						in_pict_data=TRUE;
+						if (!nopict_mode) {
+							char *ext=NULL;
+							switch (picture_type) {
+							case PICT_WB: ext="bmp"; break;
+							case PICT_WM: ext="wmf"; break;
+							case PICT_MAC: ext="pict"; break;
+							case PICT_JPEG: ext="jpg"; break;
+							case PICT_PNG: ext="png"; break;
+							case PICT_DI: ext="dib"; break; /* Device independent bitmap=??? */
+							case PICT_PM: ext="pmm"; break; /* OS/2 metafile=??? */
+							}
+							sprintf(picture_path, "pict%03d.%s", 
+								picture_file_number++,ext);
+							pictfile=fopen(picture_path,"w");
 						}
-						sprintf(picture_path, "pict%03d.%s", 
-							picture_file_number++,ext);
-						pictfile=fopen(picture_path,"w");
 					}
 
 					if (s[0]!=' ') {
@@ -3586,7 +3590,7 @@
 			w = w->next;
 	}
 
-	if (within_picture) {
+	if (in_pict_data) {
 		if(pictfile) { 
 			fclose(pictfile);
 			printf(op->imagelink_begin);


Index: unrtf.spec
===================================================================
RCS file: /cvs/extras/rpms/unrtf/FC-6/unrtf.spec,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -r1.9 -r1.10
--- unrtf.spec	8 Sep 2006 14:15:15 -0000	1.9
+++ unrtf.spec	3 Mar 2007 09:58:59 -0000	1.10
@@ -1,12 +1,14 @@
 Name:		unrtf
 Summary:	RTF to other formats converter
 Version:	0.20.2
-Release:	1%{?dist}
+Release:	2%{?dist}
 
 Group:		Applications/Text
 License:	GPL
 URL:		http://www.gnu.org/software/unrtf/unrtf.html
 Source0:	http://www.gnu.org/software/unrtf/unrtf_%{version}.tar.gz
+Patch0:     unrtf-0.20.2-fb2ansi.patch
+Patch1:     unrtf-0.20.2-in_pict.patch
 Buildroot:	%{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
 
 %description
@@ -18,6 +20,8 @@
 
 %prep
 %setup -q -n %{name}_%{version}
+%patch0 -p1 -b .fb2ansi
+%patch1 -p1 -b .in_pict
 
 %build
 %configure
@@ -37,6 +41,9 @@
 rm -rf $RPM_BUILD_ROOT
 
 %changelog
+* Sat Mar 03 2007 Aurelien Bompard <abompard at fedoraproject.org> 0.20.2-2
+- add patches from bugs 225188 and 225184
+
 * Fri Sep 08 2006 Aurelien Bompard <abompard at fedoraproject.org> 0.20.2-1
 - version 0.20.2
 




More information about the fedora-extras-commits mailing list