rpms/openoffice.org/FC-6 openoffice.org-2.0.3.rh127576.gtkunixprintdialog.patch, 1.14, 1.15 openoffice.org.spec, 1.907, 1.908

fedora-cvs-commits at redhat.com fedora-cvs-commits at redhat.com
Thu Nov 16 14:23:23 UTC 2006


Author: caolanm

Update of /cvs/dist/rpms/openoffice.org/FC-6
In directory cvs.devel.redhat.com:/tmp/cvs-serv10686

Modified Files:
	openoffice.org-2.0.3.rh127576.gtkunixprintdialog.patch 
	openoffice.org.spec 
Log Message:
rhbz#215511 printing brochure on landscape paper

openoffice.org-2.0.3.rh127576.gtkunixprintdialog.patch:
 inc/jobset.hxx                                          |    0 
 inc/print.hxx                                           |    0 
 inc/printdlg.hxx                                        |    0 
 inc/psprint/ppdparser.hxx                               |    0 
 openoffice.org.orig/svtools/source/dialogs/printdlg.src |   10 
 psprint/inc/psprint/ppdparser.hxx                       |    4 
 psprint/source/printer/cupsmgr.cxx                      |    7 
 psprint/source/printergfx/printerjob.cxx                |    3 
 source/dialogs/makefile.mk                              |    0 
 source/dialogs/printdlg.cxx                             |    0 
 source/dialogs/printdlg.hrc                             |    0 
 source/dialogs/printdlg.src                             |    0 
 source/gdi/jobset.cxx                                   |    0 
 source/printer/cupsmgr.cxx                              |    0 
 source/printergfx/printerjob.cxx                        |    0 
 svtools/inc/printdlg.hxx                                |    2 
 svtools/source/dialogs/makefile.mk                      |    4 
 svtools/source/dialogs/printdlg.cxx                     |  498 +++++++++++++++-
 svtools/source/dialogs/printdlg.hrc                     |    2 
 svtools/util/makefile.mk                                |    8 
 util/makefile.mk                                        |    0 
 vcl/inc/jobset.hxx                                      |    1 
 vcl/inc/print.hxx                                       |    1 
 vcl/source/gdi/jobset.cxx                               |  174 +++++
 24 files changed, 702 insertions(+), 12 deletions(-)

Index: openoffice.org-2.0.3.rh127576.gtkunixprintdialog.patch
===================================================================
RCS file: /cvs/dist/rpms/openoffice.org/FC-6/openoffice.org-2.0.3.rh127576.gtkunixprintdialog.patch,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -r1.14 -r1.15
--- openoffice.org-2.0.3.rh127576.gtkunixprintdialog.patch	10 Nov 2006 13:24:51 -0000	1.14
+++ openoffice.org-2.0.3.rh127576.gtkunixprintdialog.patch	16 Nov 2006 14:23:20 -0000	1.15
@@ -313,14 +313,60 @@
  }
  
  // -----------------------------------------------------------------------
+Index: source/printer/cupsmgr.cxx
+===================================================================
+RCS file: /cvs/gsl/psprint/source/printer/cupsmgr.cxx,v
+retrieving revision 1.12
+diff -u -p -u -r1.12 cupsmgr.cxx
+--- openoffice.org.orig/psprint/source/printer/cupsmgr.cxx	6 Jun 2005 16:07:42 -0000	1.12
++++ openoffice.org/psprint/source/printer/cupsmgr.cxx	25 Jul 2005 15:02:37 -0000
+@@ -475,9 +487,10 @@ void CUPSManager::initialize()
+ 
+     // clear old stuff
+     m_aCUPSDestMap.clear();
+-
++#if 0
+     if( ! (m_nDests && m_pDests ) )
+         return;
++#endif
+ 
+     rtl_TextEncoding aEncoding = osl_getThreadTextEncoding();
+     int nPrinter = m_nDests;
+@@ -550,6 +563,10 @@ void CUPSManager::initialize()
+ 
+     m_pCUPSWrapper->cupsSetPasswordCB( setPasswordCallback );
+ #endif // ENABLE_CUPS
++
++	addPrinter(rtl::OUString::createFromAscii("Generic Printer"),
++		rtl::OUString::createFromAscii("SGENPRT"));
++
+ }
+ 
+ #ifdef ENABLE_CUPS
+Index: inc/printdlg.hxx
+===================================================================
+RCS file: /cvs/util/svtools/inc/printdlg.hxx,v
+retrieving revision 1.9
+diff -u -r1.9 printdlg.hxx
+--- openoffice.org.orig/svtools/inc/printdlg.hxx	8 Sep 2005 10:06:06 -0000	1.9
++++ openoffice.org/svtools/inc/printdlg.hxx	16 Nov 2006 14:14:18 -0000
+@@ -140,6 +140,8 @@
+ 	Link				maOKHdlLink;	  // Link zum OK-Handler
+ 
+     String				maAllFilterStr;
++    String				maPaperFormatStr;
++    String				maOrientationStr;
+ 
+ 	SVT_DLLPRIVATE void				ImplCheckOK();
+ 	SVT_DLLPRIVATE void				ImplInitControls();
 Index: source/dialogs/printdlg.cxx
 ===================================================================
 RCS file: /cvs/util/svtools/source/dialogs/printdlg.cxx,v
-retrieving revision 1.21
-diff -u -r1.21 printdlg.cxx
---- openoffice.org.orig/svtools/source/dialogs/printdlg.cxx	8 Sep 2005 15:17:00 -0000	1.21
-+++ openoffice.org/svtools/source/dialogs/printdlg.cxx	19 May 2006 14:58:56 -0000
-@@ -83,9 +83,50 @@
+retrieving revision 1.23
+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
+@@ -85,9 +85,55 @@
  #include <comphelper/processfactory.hxx>
  #endif
  
@@ -356,6 +402,11 @@
 +#include <gtk/gtkstock.h>
 +#include <gtk/gtkcheckbutton.h>
 +#include <gtk/gtkcombobox.h>
++#include <gtk/gtklabel.h>
++#include <gtk/gtktable.h>
++#include <gtk/gtkcombobox.h>
++#include <gtk/gtkvbox.h>
++#include <gtk/gtknotebook.h>
 +#include <psprint/printerinfomanager.hxx>
 +
 +using namespace osl;
@@ -371,7 +422,18 @@
  using namespace rtl;
  
  struct SvtPrinterImpl
-@@ -606,6 +647,106 @@
+@@ -139,7 +185,9 @@
+ 	maBtnHelp		( this, SvtResId( BTN_HELP ) ),
+     maFlSepCopiesRange( this, SvtResId( FL_SEPCOPIESRANGE ) ),
+     maFlSepButtonLine( this, SvtResId( FL_SEPBUTTONLINE ) ),
+-    maAllFilterStr	( SvtResId( STR_ALLFILTER ) )
++    maAllFilterStr	( SvtResId( STR_ALLFILTER ) ),
++    maPaperFormatStr ( SvtResId( STR_PAPER_PAPER_TXT ) ),
++    maOrientationStr ( SvtResId( STR_PAPER_ORIENTATION_TXT ) )
+ {
+ 	FreeResource();
+ 
+@@ -608,6 +656,210 @@
  
  // -----------------------------------------------------------------------
  
@@ -386,7 +448,7 @@
 +		pPrinter->SetJobCupsKey(String::CreateFromAscii("OutputOrder"), String::CreateFromAscii("Reverse"));
 +}
 +
-+void ExportAsPDF(const rtl::OUString &rFileURL, sal_Bool bCollate, sal_uInt32 nCopies, PrintDialogRange eRange, const OUString &rRange)
++void ExportAsPDF(const rtl::OUString &rFileURL, sal_Bool, sal_uInt32, PrintDialogRange eRange, const OUString &rRange)
 +{
 +		Reference < XFramesSupplier > xDesktop =
 +                Reference < XFramesSupplier >(
@@ -422,6 +484,7 @@
 +			switch (eRange)
 +			{
 +       			case PRINTDIALOG_ALL:
++				case PRINTDIALOG_FROMTO:
 +					break;
 +        		case PRINTDIALOG_RANGE:
 +					aFilterData.realloc(aFilterData.getLength()+1);
@@ -461,24 +524,127 @@
 +        }
 +}
 +
-+static void
-+dialog_remove_buttons( GtkDialog *pDialog )
++struct ourhandle
++{
++  	int papers;
++	GtkWidget *pDialog;
++	GtkWidget *notebook;
++   	GtkWidget *orientwidget;
++   	GtkWidget *paperwidget;
++	Printer *pPrinter;
++	rtl::OUString sPrinter;
++	ourhandle() : papers(0), pDialog(0), notebook(0), orientwidget(0), paperwidget(0), pPrinter(0) {}
++};
++
++static rtl::OUString OOoPrintName(GtkWidget *pDialog)
++{
++	rtl::OUString sPrinterName(ASCII_STR("Generic Printer"));
++
++	if (GtkPrintSettings* pSettings = gtk_print_unix_dialog_get_settings (GTK_PRINT_UNIX_DIALOG(pDialog)))
++	{
++		if (const gchar *uri = gtk_print_settings_get(pSettings, GTK_PRINT_SETTINGS_OUTPUT_URI))
++		{
++			if (gchar *pFile = g_filename_from_uri (uri, NULL, NULL))
++			{
++				if (pFile && strlen(pFile))
++				{
++					const gchar *pStr = gtk_print_settings_get(pSettings, GTK_PRINT_SETTINGS_OUTPUT_FILE_FORMAT);
++					if (pStr && !strcmp(pStr, "pdf"))
++						sPrinterName = rtl::OUString();
++				}
++				g_free(pFile);
++				g_object_unref(pSettings);
++				return sPrinterName;
++			}
++		}
++	
++		if (GtkPrinter* pPrinter = gtk_print_unix_dialog_get_selected_printer(GTK_PRINT_UNIX_DIALOG(pDialog)))
++		{
++			const gchar *pStr = gtk_printer_get_name(pPrinter);
++			sPrinterName = rtl::OUString((const sal_Char *)pStr, strlen((const sal_Char*)(pStr)), RTL_TEXTENCODING_UTF8);
++		}
++		g_object_unref(pSettings);
++	}
++
++	return sPrinterName;
++}
++
++void SetProperties(ourhandle &rHandle)
 +{
-+    g_return_if_fail( GTK_IS_DIALOG( pDialog ) );
++	rtl::OUString sPrinter = OOoPrintName(rHandle.pDialog);
++
++	if (rHandle.sPrinter == sPrinter)
++		return;
++
++	rHandle.sPrinter = sPrinter;
++
++	gtk_combo_box_set_active(GTK_COMBO_BOX(rHandle.orientwidget), 0);
++	while (rHandle.papers)
++		gtk_combo_box_remove_text(GTK_COMBO_BOX(rHandle.paperwidget), --rHandle.papers);
++
++	gtk_widget_set_sensitive(rHandle.orientwidget, sPrinter.getLength());
++	gtk_widget_set_sensitive(rHandle.paperwidget, sPrinter.getLength());
++
++	if (!sPrinter.getLength())
++		return;
++
++	using namespace psp;
++
++	PrinterInfoManager& rManager = PrinterInfoManager::get();
++	PrinterInfo aInfo(rManager.getPrinterInfo(sPrinter));
 +
-+    GList *pChildren =
-+        gtk_container_get_children( GTK_CONTAINER( pDialog->action_area ) );
++	gtk_combo_box_set_active(GTK_COMBO_BOX(rHandle.orientwidget), aInfo.m_eOrientation == orientation::Landscape ? 1 : 0);
++
++	String sSelectedPaper;
++	if (rHandle.pPrinter)
++	{
++		::Orientation orient = rHandle.pPrinter->GetOrientation();
++		gtk_combo_box_set_active(GTK_COMBO_BOX(rHandle.orientwidget), orient == ORIENTATION_LANDSCAPE ? 1 : 0);
++
++		rHandle.pPrinter->SetOrientation(ORIENTATION_PORTRAIT);
++		const vcl::PaperInfo &rPaperInfo = rHandle.pPrinter->GetCurrentPaperInfo();
++		rHandle.pPrinter->SetOrientation(orient);
++
++		sSelectedPaper = rPaperInfo.m_aPaperName;
++	}
++
++	// paper
++	const PPDKey* pKey = NULL;
++	if( aInfo.m_pParser && (pKey = aInfo.m_pParser->getKey(String(RTL_CONSTASCII_USTRINGPARAM("PageSize")))))
++	{
++		int select = -1;
++		const PPDValue* pSelectValue = sSelectedPaper.Len() ? 0 : aInfo.m_aContext.getValue(pKey);
++		for (int i = 0; i < pKey->countValues(); i++)
++		{
++			const PPDValue* pValue = pKey->getValue(i);
++			String aOptionText = pValue->m_aOptionTranslation.Len() ? 
++				pValue->m_aOptionTranslation : pValue->m_aOption;
++              
++			if (aInfo.m_aContext.checkConstraints(pKey, pValue))
++			{
++				gtk_combo_box_append_text(GTK_COMBO_BOX(rHandle.paperwidget), 
++					rtl::OUStringToOString(aOptionText, RTL_TEXTENCODING_UTF8).getStr());
++				if (pValue == pSelectValue || sSelectedPaper == aOptionText)
++					select = i;
++				++rHandle.papers;
++			}
++		}
 +
-+    for( GList *p = pChildren; p; p = p->next )
-+        gtk_widget_destroy( GTK_WIDGET( p->data ) );
++      	if (select != -1)
++			gtk_combo_box_set_active(GTK_COMBO_BOX(rHandle.paperwidget), select);
++ 	}
++}
 +
-+    g_list_free( pChildren );
++void switch_page_cb(GtkNotebook *, GtkNotebookPage *, guint, ourhandle *pHandle)
++{
++	if (pHandle)
++		SetProperties(*pHandle);
 +}
 +
  short PrintDialog::Execute()
  {
  	if ( !mpPrinter || mpPrinter->IsPrinting() || mpPrinter->IsJobActive() )
-@@ -621,15 +762,171 @@
+@@ -623,15 +875,244 @@
  	ImplInitControls();
  	ImplModifyControlHdl( NULL );
  
@@ -493,52 +659,104 @@
 -		if ( TEMPPRINTER() )
 -			mpPrinter->SetPrinterProps( TEMPPRINTER() );
 -		ImplFillDialogData();
-+		static GtkWidget* pDialog=0;
-+		if (!pDialog)
++		static ourhandle aHandle;
++		if (!aHandle.pDialog)
 +		{
-+			pDialog = gtk_print_unix_dialog_new (NULL, NULL);
++			aHandle.pDialog = gtk_print_unix_dialog_new (NULL, NULL);
++
 +			rtl::OString aOptions(OUStringToOString(maBtnOptions.GetText(), RTL_TEXTENCODING_UTF8));
 +			aOptions = aOptions.replace('~','_');
-+			gtk_print_unix_dialog_set_manual_capabilities(GTK_PRINT_UNIX_DIALOG(pDialog), 
++
++//			dialog_remove_buttons( GTK_DIALOG( aHandle.pDialog ) );
++			gtk_dialog_add_button( GTK_DIALOG( aHandle.pDialog ), aOptions.getStr(), GTK_RESPONSE_HELP);
++
++			rtl::OString aProperties(OUStringToOString(maBtnProperties.GetText(), RTL_TEXTENCODING_UTF8));
++			aProperties = aProperties.copy(0, aProperties.lastIndexOf(OString("...")));
++			aProperties = aProperties.replaceAt(aProperties.indexOf('~'), 1, OString());
++
++			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));
-+			dialog_remove_buttons( GTK_DIALOG( pDialog ) );
-+			gtk_dialog_add_button( GTK_DIALOG( pDialog ), aOptions.getStr(), 10);
-+			gtk_dialog_add_buttons (GTK_DIALOG (pDialog), 
-+				GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL, GTK_STOCK_PRINT, GTK_RESPONSE_OK, NULL);
-+			//gtk_dialog_set_default_response (GTK_DIALOG (pDialog), GTK_RESPONSE_OK);
++
++			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);
++
++			gtk_box_pack_start (GTK_BOX (box), tablewidget, FALSE, FALSE, 0); 
++
++
++			aHandle.orientwidget = gtk_combo_box_new_text();
++			gtk_combo_box_append_text(GTK_COMBO_BOX(aHandle.orientwidget), "Portrait");
++			gtk_combo_box_append_text(GTK_COMBO_BOX(aHandle.orientwidget), "Landscape");
++
++			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_widget_show_all(box);
++
++			gtk_print_unix_dialog_add_custom_tab(GTK_PRINT_UNIX_DIALOG(aHandle.pDialog), box,
++				gtk_label_new(aProperties.getStr()));
++
++			g_object_get(G_OBJECT(box),"parent", &aHandle.notebook,NULL);
 +		}
 +
-+		GtkPrintSettings* pTempSettings = gtk_print_unix_dialog_get_settings(GTK_PRINT_UNIX_DIALOG(pDialog));
++		GtkPrintSettings* 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(), RTL_TEXTENCODING_UTF8).getStr());
++		{
++			gtk_print_settings_set_printer(pTempSettings, rtl::OUStringToOString(pInfo->GetPrinterName(), 
++				RTL_TEXTENCODING_UTF8).getStr());
++		}
++
 +		gtk_print_settings_set_int(pTempSettings, "n-copies", GetCopyCount());
-+		gtk_print_settings_set_collate(pTempSettings, IsCollateEnabled());
++		gtk_print_settings_set_collate(pTempSettings, IsCollateEnabled() && IsCollateChecked());
 +		if (mbRange)
 +		{
 +			GtkPageRange page_ranges;
 +			page_ranges.start = page_ranges.end = maRangeText.ToInt32()-1;
 +			gtk_print_settings_set_page_ranges(pTempSettings, &page_ranges, 1);
++			gtk_print_unix_dialog_set_current_page(GTK_PRINT_UNIX_DIALOG(aHandle.pDialog), page_ranges.start);
 +		}
-+		gtk_print_unix_dialog_set_settings(GTK_PRINT_UNIX_DIALOG(pDialog), pTempSettings);
++		gtk_print_unix_dialog_set_settings(GTK_PRINT_UNIX_DIALOG(aHandle.pDialog), pTempSettings);
 +		g_object_unref(pTempSettings);
-+		//FIXME: current != selection
-+		gtk_print_unix_dialog_set_current_page(GTK_PRINT_UNIX_DIALOG(pDialog), mbSelection ? 0 : -1);
++
++		aHandle.pPrinter = mpPrinter;
++
++		SetProperties(aHandle);
++
++		gulong nHID_PageChange=0;
++		if (aHandle.notebook && GTK_IS_NOTEBOOK(aHandle.notebook))
++		{
++			gtk_notebook_set_current_page(GTK_NOTEBOOK(aHandle.notebook), 0);
++			nHID_PageChange = g_signal_connect(G_OBJECT(aHandle.notebook), "switch-page", G_CALLBACK(switch_page_cb), &aHandle);
++		}
 +
 +		bool bContinue = true;
 +		while(bContinue)
 +		{
 +			bContinue = false;
-+			gint nStatus = gtk_dialog_run( GTK_DIALOG( pDialog ) );
++			gint nStatus = gtk_dialog_run( GTK_DIALOG( aHandle.pDialog ) );
 +			switch( nStatus )
 +			{
-+			    case 10:
++			    case GTK_RESPONSE_HELP:
 +				ClickOptionsHdl();
 +				bContinue = true;
 +				break;
 +			    case GTK_RESPONSE_OK:
 +				{
-+				GtkPrintSettings* pSettings = gtk_print_unix_dialog_get_settings (GTK_PRINT_UNIX_DIALOG(pDialog));
++				GtkPrintSettings* pSettings = gtk_print_unix_dialog_get_settings (GTK_PRINT_UNIX_DIALOG(aHandle.pDialog));
 +
 +				rtl::OUString sPath;
 +				if (const gchar *uri = gtk_print_settings_get(pSettings, GTK_PRINT_SETTINGS_OUTPUT_URI))
@@ -570,16 +788,14 @@
 +					meCheckRange = PRINTDIALOG_RANGE;
 +				}
 +				else if (pStr && !strcmp(pStr, "current"))
-+				{
-+					//FIXME: current != selection
-+					meCheckRange = PRINTDIALOG_SELECTION;
-+				}
++					meCheckRange = PRINTDIALOG_RANGE;
 +				else
 +					meCheckRange = PRINTDIALOG_ALL;
 +
 +				SetCopyCount(gtk_print_settings_get_int_with_default (pSettings, GTK_PRINT_SETTINGS_N_COPIES, 1));
-+				EnableCollate(gtk_print_settings_get_collate(pSettings));
-+				CheckCollate(gtk_print_settings_get_collate(pSettings));
++				BOOL bGtkCollate = gtk_print_settings_get_collate(pSettings);
++				EnableCollate(bGtkCollate);
++				CheckCollate(bGtkCollate);
 +
 +				pStr = 0;
 +
@@ -588,7 +804,7 @@
 +
 +				if (pStr && !strcmp(pStr, "pdf"))
 +				{
-+					gtk_widget_hide( pDialog );
++					gtk_widget_hide( aHandle.pDialog );
 +					rtl::OUString sFileURL;
 +					FileBase::getFileURLFromSystemPath(sPath, sFileURL);
 +					ExportAsPDF(sFileURL, IsCollateEnabled(), GetCopyCount(), meCheckRange, maRangeText);
@@ -604,7 +820,7 @@
 +						mpPrinter->SetPrintFile(sPath);
 +						sNewPrinterName = ASCII_STR("Generic Printer");
 +					}
-+					else if (GtkPrinter* pPrinter = gtk_print_unix_dialog_get_selected_printer(GTK_PRINT_UNIX_DIALOG(pDialog)))
++					else if (GtkPrinter* pPrinter = gtk_print_unix_dialog_get_selected_printer(GTK_PRINT_UNIX_DIALOG(aHandle.pDialog)))
 +					{
 +						pStr = gtk_printer_get_name(pPrinter);
 +						sNewPrinterName = rtl::OUString((const sal_Char *)pStr, strlen((const sal_Char*)(pStr)), RTL_TEXTENCODING_UTF8);
@@ -629,9 +845,30 @@
 +							}
 +						}
 +						if (i == nCount)
-+							fprintf(stderr, "OOo UNKNOWN PRINTER \"%s\"\n", rtl::OUStringToOString(sNewPrinterName, RTL_TEXTENCODING_UTF8).getStr());
++						{
++							fprintf(stderr, "OOo UNKNOWN PRINTER \"%s\"\n", 
++								rtl::OUStringToOString(sNewPrinterName, RTL_TEXTENCODING_UTF8).getStr());
++						}
 +					}
 +					gtk_print_settings_foreach(pSettings, setcupskey, mpPrinter);
++
++					mpPrinter->SetOrientation(ORIENTATION_PORTRAIT);
++
++					int nPapers = mpPrinter->GetPaperInfoCount();
++					pStr = gtk_combo_box_get_active_text(GTK_COMBO_BOX(aHandle.paperwidget)); 
++					rtl::OUString sPaper((const sal_Char*)pStr, strlen((const sal_Char*)(pStr)), RTL_TEXTENCODING_UTF8);
++					for (int i = 0; i < nPapers; ++i)
++					{
++						const vcl::PaperInfo &rInfo = mpPrinter->GetPaperInfo(i);
++						if (rtl::OUString(rInfo.m_aPaperName) == sPaper)
++						{
++							mpPrinter->SetPaperFromInfo(rInfo);
++							break;
++						}
++					}
++
++					if (1 == gtk_combo_box_get_active(GTK_COMBO_BOX(aHandle.orientwidget)))
++						mpPrinter->SetOrientation(ORIENTATION_LANDSCAPE);
 +				}
 +				g_object_unref(pSettings);
 +				}
@@ -640,7 +877,9 @@
 +				break;
 +			}
 +		}
-+		gtk_widget_hide( pDialog );
++		gtk_widget_hide( aHandle.pDialog );
++		if (nHID_PageChange)
++        	g_signal_handler_disconnect(G_OBJECT(aHandle.notebook), nHID_PageChange);
 +	}
 +	else
 +	{
@@ -657,38 +896,45 @@
  	}
  
  	maStatusTimer.Stop();
-@@ -644,4 +940,3 @@
+@@ -646,4 +1127,3 @@
  	mpPrinterImpl->m_bHelpDisabled = sal_True;
  	maBtnHelp.Disable();
  }
 -
-Index: source/printer/cupsmgr.cxx
+Index: source/dialogs/printdlg.hrc
 ===================================================================
-RCS file: /cvs/gsl/psprint/source/printer/cupsmgr.cxx,v
-retrieving revision 1.12
-diff -u -p -u -r1.12 cupsmgr.cxx
---- openoffice.org.orig/psprint/source/printer/cupsmgr.cxx	6 Jun 2005 16:07:42 -0000	1.12
-+++ openoffice.org/psprint/source/printer/cupsmgr.cxx	25 Jul 2005 15:02:37 -0000
-@@ -475,9 +487,10 @@ void CUPSManager::initialize()
- 
-     // clear old stuff
-     m_aCUPSDestMap.clear();
--
-+#if 0
-     if( ! (m_nDests && m_pDests ) )
-         return;
-+#endif
- 
-     rtl_TextEncoding aEncoding = osl_getThreadTextEncoding();
-     int nPrinter = m_nDests;
-@@ -550,6 +563,10 @@ void CUPSManager::initialize()
- 
-     m_pCUPSWrapper->cupsSetPasswordCB( setPasswordCallback );
- #endif // ENABLE_CUPS
-+
-+	addPrinter(rtl::OUString::createFromAscii("Generic Printer"),
-+		rtl::OUString::createFromAscii("SGENPRT"));
-+
- }
+RCS file: /cvs/util/svtools/source/dialogs/printdlg.hrc,v
+retrieving revision 1.5
+diff -u -r1.5 printdlg.hrc
+--- openoffice.org.orig/svtools/source/dialogs/printdlg.hrc	8 Sep 2005 15:17:16 -0000	1.5
++++ openoffice.org/svtools/source/dialogs/printdlg.hrc	16 Nov 2006 14:14:40 -0000
+@@ -73,3 +73,5 @@
+ #define FL_SEPCOPIESRANGE		33
+ #define FL_SEPBUTTONLINE		34
+ #define STR_ALLFILTER			35
++#define STR_PAPER_PAPER_TXT 	36
++#define STR_PAPER_ORIENTATION_TXT	37
+Index: source/dialogs/printdlg.src
+===================================================================
+RCS file: /cvs/util/svtools/source/dialogs/printdlg.src,v
+retrieving revision 1.45
+diff -u -r1.45 printdlg.src
+--- openoffice.org.orig/svtools/source/dialogs/printdlg.src	23 Sep 2005 14:52:41 -0000	1.45
++++ openoffice.org.orig/svtools/source/dialogs/printdlg.src	16 Nov 2006 14:14:44 -0000
+@@ -291,6 +291,16 @@
+         Text [ de ] = "<Alle>";
+     	Text [ en-US ] = "<All>";
+ 	};
++    String STR_PAPER_PAPER_TXT
++    {
++        Text [ de ] = "Papierformat:";
++        Text [ en-US ] = "Paper size:";
++    };
++    String STR_PAPER_ORIENTATION_TXT
++    {
++        Text [ de ] = "Orientierung:";
++        Text [ en-US ] = "Orientation:";
++    };
+ 	Text [ x-comment ] = " ";
+ };
  
- #ifdef ENABLE_CUPS


Index: openoffice.org.spec
===================================================================
RCS file: /cvs/dist/rpms/openoffice.org/FC-6/openoffice.org.spec,v
retrieving revision 1.907
retrieving revision 1.908
diff -u -r1.907 -r1.908
--- openoffice.org.spec	15 Nov 2006 19:29:57 -0000	1.907
+++ openoffice.org.spec	16 Nov 2006 14:23:20 -0000	1.908
@@ -145,6 +145,7 @@
 Patch77: openoffice.org-2.1.0.ooo61812.svx.a11ycrash.patch
 Patch78: openoffice.org-2.0.4.ooo71562.svx.64bitcrash.patch
 Patch79: openoffice.org-2.0.4.ooo71570.psprint.noonecopy.patch
+Patch80: openoffice.org-2.0.3.rh127576.gtkunixprintdialog.localize
 
 %define instdir %{_libdir}/openoffice.org2.0
 
@@ -1024,6 +1025,7 @@
 %patch77 -p1 -b .ooo61812.svx.a11ycrash.patch
 %patch78 -p1 -b .ooo71562.svx.64bitcrash.patch
 %patch79 -p1 -b .ooo71570.psprint.noonecopy.patch
+cat %{PATCH80} >> svtools/dialogs/localize.sdf
 
 tar xzf %{SOURCE1}
 
@@ -2552,6 +2554,7 @@
 * Wed Nov 15 2006 Caolan McNamara <caolanm at redhat.com> - 1:2.0.4-5.5.4
 - Resolves: rhbz#215694 add openoffice.org-2.0.4.ooo71562.svx.64bitcrash.patch
 - Resolves: rhbz#215582 add openoffice.org-2.0.4.ooo71570.psprint.noonecopy.patch
+- Resolves: rhbz#215511 can't print brochure on landscape mode
 
 * Fri Nov 10 2006 Caolan McNamara <caolanm at redhat.com> - 1:2.0.4-5.5.3
 - rhbz#214973 collate print setting




More information about the fedora-cvs-commits mailing list