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

rpms/openoffice.org/devel openoffice.org-2.0.3.rh127576.gtkunixprintdialog.patch, 1.10, 1.11 openoffice.org.spec, 1.741, 1.742



Author: caolanm

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

Modified Files:
	openoffice.org-2.0.3.rh127576.gtkunixprintdialog.patch 
	openoffice.org.spec 
Log Message:
adjust for new printing api

openoffice.org-2.0.3.rh127576.gtkunixprintdialog.patch:
 inc/jobset.hxx                      |    0 
 inc/print.hxx                       |    0 
 inc/psprint/ppdparser.hxx           |    0 
 psprint/inc/psprint/ppdparser.hxx   |    2 
 psprint/source/printer/cupsmgr.cxx  |    7 -
 source/dialogs/makefile.mk          |    0 
 source/dialogs/printdlg.cxx         |    0 
 source/gdi/jobset.cxx               |    0 
 source/printer/cupsmgr.cxx          |    0 
 svtools/source/dialogs/makefile.mk  |    4 
 svtools/source/dialogs/printdlg.cxx |  252 ++++++++++++++++++++++++++++++++++--
 svtools/util/makefile.mk            |    8 +
 util/makefile.mk                    |    0 
 vcl/inc/jobset.hxx                  |    1 
 vcl/inc/print.hxx                   |    1 
 vcl/source/gdi/jobset.cxx           |  173 ++++++++++++++++++++++++
 16 files changed, 437 insertions(+), 11 deletions(-)

Index: openoffice.org-2.0.3.rh127576.gtkunixprintdialog.patch
===================================================================
RCS file: /cvs/dist/rpms/openoffice.org/devel/openoffice.org-2.0.3.rh127576.gtkunixprintdialog.patch,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -r1.10 -r1.11
--- openoffice.org-2.0.3.rh127576.gtkunixprintdialog.patch	22 Jun 2006 17:38:33 -0000	1.10
+++ openoffice.org-2.0.3.rh127576.gtkunixprintdialog.patch	22 Jun 2006 21:06:32 -0000	1.11
@@ -293,7 +293,7 @@
 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,8 +83,38 @@
+@@ -83,8 +83,37 @@
  #include <comphelper/processfactory.hxx>
  #endif
  
@@ -316,7 +316,6 @@
 +#ifndef INCLUDED_SVTOOLS_MISCOPT_HXX
 +#include "miscopt.hxx"
 +#endif
-+#include <gtk/gtkprintsettings.h>
 +#include <gtk/gtkprintunixdialog.h>
 +#include <gtk/gtkstock.h>
 +#include <gtk/gtkcheckbutton.h>
@@ -396,7 +395,7 @@
  short PrintDialog::Execute()
  {
  	if ( !mpPrinter || mpPrinter->IsPrinting() || mpPrinter->IsJobActive() )
-@@ -621,15 +707,155 @@
+@@ -621,15 +707,166 @@
  	ImplInitControls();
  	ImplModifyControlHdl( NULL );
  
@@ -419,7 +418,7 @@
 +			aOptions = aOptions.replace('~','_');
 +			gtk_print_unix_dialog_set_manual_capabilities(GTK_PRINT_UNIX_DIALOG(pDialog), 
 +				GtkPrintCapabilities(GTK_PRINT_CAPABILITY_COPIES | GTK_PRINT_CAPABILITY_COLLATE | 
-+				GTK_PRINT_CAPABILITY_REVERSE));
++				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), 
@@ -461,18 +460,32 @@
 +				rtl::OUString sNewPrinterName((const sal_Char *)pStr, strlen((const sal_Char*)(pStr)), RTL_TEXTENCODING_UTF8);
 +				GtkPrintSettings* pSettings = gtk_print_unix_dialog_get_settings (GTK_PRINT_UNIX_DIALOG(pDialog));
 +
-+				if (gtk_print_settings_has_key(pSettings, "pdf-filename"))
++				rtl::OUString sPath;
++				if (const gchar *uri = gtk_print_settings_get(pSettings, GTK_PRINT_SETTINGS_OUTPUT_URI))
++				{
++					if (gchar *pFile = g_filename_from_uri (uri, NULL, NULL))
++					{
++						sPath = rtl::OUString((const sal_Char *)pFile, strlen((const sal_Char*)(pFile)), osl_getThreadTextEncoding());
++						g_free(pFile);
++					}
++				}
++				pStr = 0;
++
++				if (sPath.getLength())
++					pStr = gtk_print_settings_get(pSettings, GTK_PRINT_SETTINGS_OUTPUT_FILE_FORMAT);
++
++				if (pStr && !strcmp(pStr, "pdf"))
 +				{
 +					gtk_widget_hide( pDialog );
-+					pStr = gtk_print_settings_get(pSettings, "pdf-filename");
-+					rtl::OUString sPath((const sal_Char *)pStr, strlen((const sal_Char*)(pStr)), osl_getThreadTextEncoding());
 +					rtl::OUString sFileURL;
 +					FileBase::getFileURLFromSystemPath(sPath, sFileURL);
 +					ExportAsPDF(sFileURL);
 +				}
 +				else
 +				{
-+					pStr = gtk_print_settings_get(pSettings, "print-pages");
++					nRet = TRUE;
++
++					pStr = gtk_print_settings_get(pSettings, GTK_PRINT_SETTINGS_PRINT_PAGES);
 +					if (pStr && !strcmp(pStr, "ranges"))
 +					{
 +						maRangeText = String();
@@ -499,41 +512,38 @@
 +					else
 +						meCheckRange = PRINTDIALOG_ALL;
 +
-+					SetCopyCount(gtk_print_settings_get_int_with_default (pSettings, "n-copies", 1));
++					SetCopyCount(gtk_print_settings_get_int_with_default (pSettings, GTK_PRINT_SETTINGS_N_COPIES, 1));
 +					EnableCollate(gtk_print_settings_get_collate(pSettings));
 +
-+					nRet = TRUE;
++					if (sPath.getLength())
++					{
++						mpPrinter->EnablePrintFile(true);
++						mpPrinter->SetPrintFile(sPath);
++						sNewPrinterName = ASCII_STR("Generic Printer");
++					}
++					
 +					OUString sOldPrinterName(mpPrinter->GetName());
 +					if (sNewPrinterName != sOldPrinterName)
 +					{
-+						USHORT nCount = Printer::GetQueueCount();
 +						USHORT i = 0;
-+						for (i = 0; i < nCount; ++i)
++						USHORT nCount = Printer::GetQueueCount();
++						if (nCount)
 +						{
-+							const QueueInfo& rInfo = Printer::GetQueueInfo(i, false);
-+							if (OUString(rInfo.GetPrinterName()) == sNewPrinterName)
++							for (i = 0; i < nCount; ++i)
 +							{
-+								Printer aTempPrinter(rInfo);
-+								mpPrinter->SetPrinterProps(&aTempPrinter);
-+								break;
++								const QueueInfo& rInfo = Printer::GetQueueInfo(i, false);
++								if (OUString(rInfo.GetPrinterName()) == sNewPrinterName)
++								{
++									Printer aTempPrinter(rInfo);
++									mpPrinter->SetPrinterProps(&aTempPrinter);
++									break;
++								}
 +							}
 +						}
 +						if (i == nCount)
-+						{
-+							fprintf(stderr, "OOo UNKNOWN PRINTER, oh dear\n");
-+							const QueueInfo& rInfo = Printer::GetQueueInfo(0, false);
-+							Printer aTempPrinter(rInfo);
-+							mpPrinter->SetPrinterProps(&aTempPrinter);
-+						}
++							fprintf(stderr, "OOo UNKNOWN PRINTER \"%s\"\n", rtl::OUStringToOString(sNewPrinterName, RTL_TEXTENCODING_UTF8).getStr());
 +					}
 +					gtk_print_settings_foreach(pSettings, setcupskey, mpPrinter);
-+					if (gboolean bPrintToFile = gtk_print_settings_get_print_to_file(pSettings))
-+					{
-+						mpPrinter->EnablePrintFile(bPrintToFile);
-+						pStr = gtk_print_settings_get(pSettings, "pdf-filename");
-+						rtl::OUString sPath((const sal_Char *)pStr, strlen((const sal_Char*)(pStr)), osl_getThreadTextEncoding());
-+						mpPrinter->SetPrintFile(sPath);
-+					}
 +				}
 +				g_object_unref(pSettings);
 +				}
@@ -559,8 +569,38 @@
  	}
  
  	maStatusTimer.Stop();
-@@ -644,4 +870,3 @@
+@@ -644,4 +881,3 @@
  	mpPrinterImpl->m_bHelpDisabled = sal_True;
  	maBtnHelp.Disable();
  }
 -
+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: openoffice.org.spec
===================================================================
RCS file: /cvs/dist/rpms/openoffice.org/devel/openoffice.org.spec,v
retrieving revision 1.741
retrieving revision 1.742
diff -u -r1.741 -r1.742
--- openoffice.org.spec	22 Jun 2006 15:45:54 -0000	1.741
+++ openoffice.org.spec	22 Jun 2006 21:06:32 -0000	1.742
@@ -50,7 +50,7 @@
 BuildRequires:	autoconf, make >= 3.79.1, flex, bison, perl-Compress-Zlib
 BuildRequires:	gcc >= 3.4.3, gcc-c++ >= 3.4.3, binutils, gcc-java >= 4.0.2
 BuildRequires:	libgcj-devel >= 4.0.2, java-1.4.2-gcj-compat-devel, zlib-devel
-BuildRequires:	freetype-devel, gtk2-devel >= 2.4.8, gnome-vfs2-devel
+BuildRequires:	freetype-devel, gtk2-devel >= 2.9.4, gnome-vfs2-devel
 BuildRequires:	cups-devel, curl-devel, boost-devel >= 1.31.0, python-devel
 BuildRequires:	expat-devel, libxml2-devel, neon-devel >= 0.24, libidn-devel
 BuildRequires:	pam-devel, libjpeg-devel, sane-backends-devel, libXt-devel
@@ -3313,6 +3313,7 @@
 * Thu Jun 22 2006 Caolan McNamara <caolanm redhat com> - 1:2.0.3-6.1
 - next milestone
 - drop hack and use new gtk_print_unix_dialog_set_manual_capabilities api instead
+- readjust printing stuff for new "print to file" mechanism
 
 * Wed Jun 07 2006 Caolan McNamara <caolanm redhat com> - 1:2.0.3-5.3
 - rh#185806# update croatian dictionaries, and add spanish, norwegian thesaruses


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