rpms/openoffice.org/devel openoffice.org-2.0.3.rh127576.gtkunixprintdialog.patch, 1.52, 1.53

Caolan McNamara caolanm at fedoraproject.org
Mon Feb 9 13:18:14 UTC 2009


Author: caolanm

Update of /cvs/pkgs/rpms/openoffice.org/devel
In directory cvs1.fedora.phx.redhat.com:/tmp/cvs-serv6570

Modified Files:
	openoffice.org-2.0.3.rh127576.gtkunixprintdialog.patch 
Log Message:
Resolves: rhbz#480369 throw away gtk dialog when finished printing and store state with new apis

openoffice.org-2.0.3.rh127576.gtkunixprintdialog.patch:

Index: openoffice.org-2.0.3.rh127576.gtkunixprintdialog.patch
===================================================================
RCS file: /cvs/pkgs/rpms/openoffice.org/devel/openoffice.org-2.0.3.rh127576.gtkunixprintdialog.patch,v
retrieving revision 1.52
retrieving revision 1.53
diff -u -r1.52 -r1.53
--- openoffice.org-2.0.3.rh127576.gtkunixprintdialog.patch	10 Dec 2008 13:52:27 -0000	1.52
+++ openoffice.org-2.0.3.rh127576.gtkunixprintdialog.patch	9 Feb 2009 13:18:13 -0000	1.53
@@ -759,7 +759,7 @@
 diff -u -r1.23 printdlg.cxx
 --- openoffice.org.orig/svtools/source/dialogs/printdlg.cxx	17 Sep 2006 14:45:21 -0000	1.23
 +++ openoffice.org/svtools/source/dialogs/printdlg.cxx	16 Nov 2006 14:14:35 -0000
-@@ -57,9 +57,48 @@
+@@ -57,9 +57,49 @@
  #include <com/sun/star/ui/dialogs/XFilterManager.hpp>
  #include <com/sun/star/lang/XMultiServiceFactory.hpp>
  #include <comphelper/processfactory.hxx>
@@ -779,6 +779,7 @@
 +#include <com/sun/star/container/XNamed.hpp>
 +#include <unotools/streamwrap.hxx>
 +#include <unotools/ucbstreamhelper.hxx>
++#include <rtl/bootstrap.hxx>
 +
 +#include "svtools/miscopt.hxx"
 +
@@ -821,7 +822,7 @@
  {
  	FreeResource();
  
-@@ -753,6 +794,284 @@
+@@ -753,6 +794,287 @@
  
  // -----------------------------------------------------------------------
  
@@ -1028,8 +1029,11 @@
 +				else if (pVal->m_aOption.EqualsIgnoreCaseAscii("DuplexTumble", 0, 12))
 +					eDuplex = GTK_PRINT_DUPLEX_VERTICAL;
 +
-+				gtk_print_settings_set_duplex(pTempSettings, eDuplex);
-+	        	gtk_print_unix_dialog_set_settings(GTK_PRINT_UNIX_DIALOG(rHandle.pDialog), pTempSettings);
++				if (gtk_print_settings_get_duplex(pTempSettings) != eDuplex)
++				{
++				   gtk_print_settings_set_duplex(pTempSettings, eDuplex);
++	        	   gtk_print_unix_dialog_set_settings(GTK_PRINT_UNIX_DIALOG(rHandle.pDialog), pTempSettings);
++				}
 +	        	g_object_unref(pTempSettings);
 +			}
 +		}
@@ -1127,64 +1131,63 @@
 + 		unsigned long handle = GetParent() ? GetParent()->GetNativeHandle() : 0;
 + 		GtkWindow *parent = handle ? GTK_WINDOW(handle) : NULL;
 + 		
-+ 		static ourhandle aHandle;
-+ 		if (!aHandle.pDialog)
-+ 		{
-+			lcl_setGTKLanguage(::comphelper::getProcessServiceFactory());
-+ 			aHandle.pDialog = gtk_print_unix_dialog_new (NULL, parent);
++		lcl_setGTKLanguage(::comphelper::getProcessServiceFactory());
++ 		ourhandle aHandle;
++ 		aHandle.pDialog = gtk_print_unix_dialog_new (NULL, parent);
 + 
-+ 			rtl::OString aOptions(rtl::OUStringToOString(maBtnOptions.GetText(), RTL_TEXTENCODING_UTF8));
-+ 			aOptions = aOptions.replace('~','_');
++ 		rtl::OString aOptions(rtl::OUStringToOString(maBtnOptions.GetText(), RTL_TEXTENCODING_UTF8));
++ 		aOptions = aOptions.replace('~','_');
 + 
-+ 			gtk_dialog_add_button( GTK_DIALOG( aHandle.pDialog ), aOptions.getStr(), GTK_RESPONSE_HELP);
++ 		gtk_dialog_add_button( GTK_DIALOG( aHandle.pDialog ), aOptions.getStr(), GTK_RESPONSE_HELP);
 + 
-+ 			rtl::OUString aProperties(maBtnProperties.GetText());
-+ 			aProperties = aProperties.copy(0, aProperties.lastIndexOf(OUString(RTL_CONSTASCII_USTRINGPARAM(("...")))));
-+ 			aProperties = aProperties.replaceAt(aProperties.indexOf('~'), 1, OUString());
++ 		rtl::OUString aProperties(maBtnProperties.GetText());
++ 		aProperties = aProperties.copy(0, aProperties.lastIndexOf(OUString(RTL_CONSTASCII_USTRINGPARAM(("...")))));
++ 		aProperties = aProperties.replaceAt(aProperties.indexOf('~'), 1, OUString());
 + 
-+ 			gtk_print_unix_dialog_set_manual_capabilities(GTK_PRINT_UNIX_DIALOG(aHandle.pDialog), 
-+ 				GtkPrintCapabilities(GTK_PRINT_CAPABILITY_COPIES | GTK_PRINT_CAPABILITY_COLLATE | 
-+ 				GTK_PRINT_CAPABILITY_REVERSE|GTK_PRINT_CAPABILITY_GENERATE_PDF|GTK_PRINT_CAPABILITY_GENERATE_PS));
++ 		gtk_print_unix_dialog_set_manual_capabilities(GTK_PRINT_UNIX_DIALOG(aHandle.pDialog), 
++ 			GtkPrintCapabilities(GTK_PRINT_CAPABILITY_COPIES | GTK_PRINT_CAPABILITY_COLLATE | 
++ 			GTK_PRINT_CAPABILITY_REVERSE|GTK_PRINT_CAPABILITY_GENERATE_PDF|GTK_PRINT_CAPABILITY_GENERATE_PS));
 + 
-+ 			GtkWidget *box = gtk_vbox_new(FALSE, 18);
-+ 			gtk_container_set_border_width (GTK_CONTAINER (box), 12);
++ 		GtkWidget *box = gtk_vbox_new(FALSE, 18);
++ 		gtk_container_set_border_width (GTK_CONTAINER (box), 12);
 + 
-+ 			GtkWidget *tablewidget = gtk_table_new (2, 2, FALSE);
-+ 			gtk_table_set_row_spacings (GTK_TABLE (tablewidget), 6);
-+ 			gtk_table_set_col_spacings (GTK_TABLE (tablewidget), 12);
++ 		GtkWidget *tablewidget = gtk_table_new (2, 2, FALSE);
++ 		gtk_table_set_row_spacings (GTK_TABLE (tablewidget), 6);
++ 		gtk_table_set_col_spacings (GTK_TABLE (tablewidget), 12);
 + 
-+ 			gtk_box_pack_start (GTK_BOX (box), tablewidget, FALSE, FALSE, 0); 
++ 		gtk_box_pack_start (GTK_BOX (box), tablewidget, FALSE, FALSE, 0); 
 + 
 + 
-+ 			aHandle.orientwidget = gtk_combo_box_new_text();
-+ 			aHandle.paperwidget = gtk_combo_box_new_text();
++ 		aHandle.orientwidget = gtk_combo_box_new_text();
++ 		aHandle.paperwidget = gtk_combo_box_new_text();
 + 
-+ 			gtk_table_attach(GTK_TABLE(tablewidget), gtk_label_new(
-+ 					rtl::OUStringToOString(maOrientationStr, RTL_TEXTENCODING_UTF8).getStr()), 
-+ 				0, 1, 0, 1, GTK_FILL, GTK_EXPAND, 0, 0);
-+ 			gtk_table_attach(GTK_TABLE(tablewidget), aHandle.orientwidget, 1, 2, 0, 1,
-+ 				GTK_FILL, GTK_EXPAND, 0, 0);
-+ 			gtk_table_attach(GTK_TABLE(tablewidget),  gtk_label_new(
-+ 					rtl::OUStringToOString(maPaperFormatStr, RTL_TEXTENCODING_UTF8).getStr()),
-+ 				0, 1, 1, 2, GTK_FILL, GTK_EXPAND, 0, 0);
-+ 			gtk_table_attach(GTK_TABLE(tablewidget), aHandle.paperwidget, 1, 2, 1, 2,
-+ 				GTK_FILL, GTK_EXPAND, 0, 0);
++ 		gtk_table_attach(GTK_TABLE(tablewidget), gtk_label_new(
++ 				rtl::OUStringToOString(maOrientationStr, RTL_TEXTENCODING_UTF8).getStr()), 
++ 			0, 1, 0, 1, GTK_FILL, GTK_EXPAND, 0, 0);
++ 		gtk_table_attach(GTK_TABLE(tablewidget), aHandle.orientwidget, 1, 2, 0, 1,
++ 			GTK_FILL, GTK_EXPAND, 0, 0);
++ 		gtk_table_attach(GTK_TABLE(tablewidget),  gtk_label_new(
++ 				rtl::OUStringToOString(maPaperFormatStr, RTL_TEXTENCODING_UTF8).getStr()),
++ 			0, 1, 1, 2, GTK_FILL, GTK_EXPAND, 0, 0);
++ 		gtk_table_attach(GTK_TABLE(tablewidget), aHandle.paperwidget, 1, 2, 1, 2,
++ 			GTK_FILL, GTK_EXPAND, 0, 0);
 + 
-+ 			gtk_widget_show_all(box);
++ 		gtk_widget_show_all(box);
 + 
-+ 			rtl::OString sProperties(OUStringToOString(aProperties, RTL_TEXTENCODING_UTF8));
-+ 			gtk_print_unix_dialog_add_custom_tab(GTK_PRINT_UNIX_DIALOG(aHandle.pDialog), box,
-+ 				gtk_label_new(sProperties.getStr()));
-+ 
-+ 			g_object_get(G_OBJECT(box),"parent", &aHandle.notebook,NULL);
-+ 		}
++ 		rtl::OString sProperties(OUStringToOString(aProperties, RTL_TEXTENCODING_UTF8));
++ 		gtk_print_unix_dialog_add_custom_tab(GTK_PRINT_UNIX_DIALOG(aHandle.pDialog), box,
++			gtk_label_new(sProperties.getStr()));
++
++ 		g_object_get(G_OBJECT(box),"parent", &aHandle.notebook,NULL);
 + 
 + 		//make this the child of the OOo document window, and make it
 + 		//the parent of the future OOo options window
 + 		if (parent) gtk_window_set_transient_for(GTK_WINDOW(aHandle.pDialog), parent);
 + 		mnNativeHandle = reinterpret_cast<unsigned long>(aHandle.pDialog);
 + 
-+ 		GtkPrintSettings* pTempSettings = gtk_print_unix_dialog_get_settings(GTK_PRINT_UNIX_DIALOG(aHandle.pDialog));
++ 		GtkPrintSettings* pTempSettings = gtk_print_settings_new_from_file(getPrintDialogSettings().getStr(), NULL);
++ 		if (!pTempSettings)
++ 			pTempSettings = gtk_print_unix_dialog_get_settings(GTK_PRINT_UNIX_DIALOG(aHandle.pDialog));
 + 		if (const QueueInfo* pInfo = (const QueueInfo*)(maLbName.GetEntryData(maLbName.GetSelectEntryPos())))
 + 		{
 + 			gtk_print_settings_set_printer(pTempSettings, rtl::OUStringToOString(pInfo->GetPrinterName(), 
@@ -1420,6 +1423,7 @@
 + 					if (1 == gtk_combo_box_get_active(GTK_COMBO_BOX(aHandle.orientwidget)))
 + 						mpPrinter->SetOrientation(ORIENTATION_LANDSCAPE);
 + 				}
++ 				gtk_print_settings_to_file(pSettings, getPrintDialogSettings().getStr(), NULL);
 + 				g_object_unref(pSettings);
 + 				}
 + 				break;
@@ -1430,7 +1434,7 @@
 + 		gtk_widget_hide( aHandle.pDialog );
 + 		if (nHID_PageChange)
 +         	g_signal_handler_disconnect(G_OBJECT(aHandle.notebook), nHID_PageChange);
-+ //		gtk_widget_destroy( aHandle.pDialog );
++ 		gtk_widget_destroy( aHandle.pDialog );
 + 	}
 + 	else
 + 	{




More information about the fedora-extras-commits mailing list