rpms/openoffice.org/devel openoffice.org-2.0.3.rh127576.gtkunixprintdialog.patch, 1.35, 1.36 openoffice.org.spec, 1.1311, 1.1312

Caolan McNamara (caolanm) fedora-extras-commits at redhat.com
Thu Oct 4 11:31:24 UTC 2007


Author: caolanm

Update of /cvs/pkgs/rpms/openoffice.org/devel
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv22903

Modified Files:
	openoffice.org-2.0.3.rh127576.gtkunixprintdialog.patch 
	openoffice.org.spec 
Log Message:
Resolves: rhbz#303431 some printing problems

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.35
retrieving revision 1.36
diff -u -r1.35 -r1.36
--- openoffice.org-2.0.3.rh127576.gtkunixprintdialog.patch	3 Oct 2007 07:35:04 -0000	1.35
+++ openoffice.org-2.0.3.rh127576.gtkunixprintdialog.patch	4 Oct 2007 11:31:19 -0000	1.36
@@ -98,15 +98,89 @@
  };
  
  // ----------------------------------------------------------------------
-@@ -139,7 +141,7 @@
+@@ -89,6 +90,7 @@
+ private:
+ 
+     bool				m_bUIOption;
++    bool                		m_bPseudo;
+     String				m_aUITranslation;
+     UIType				m_eUIType;
+     int					m_nOrderDependency;
+@@ -110,6 +112,8 @@
+ 
+     const String&       getKey() const { return m_aKey; }
+     bool                isUIKey() const { return m_bUIOption; }
++    bool                isPseudoKey() const { return m_bPseudo; }
++    void                setPseudoKey() { m_bPseudo = true; }
+     const String&       getUITranslation() const { return m_aUITranslation; }
+     UIType              getUIType() const { return m_eUIType; }
+     SetupType           getSetupType() const { return m_eSetupType; }
+@@ -139,8 +143,9 @@
  
      typedef ::std::hash_map< ::rtl::OUString, PPDKey*, ::rtl::OUStringHash > hash_type;
      typedef ::std::vector< PPDKey* > value_type;
 -
 +public:
      void insertKey( const String& rKey, PPDKey* pKey );
++    void Reset();
  public:
      struct PPDConstraint
+     {
+@@ -302,6 +307,7 @@
+     // returns false: check failed, new value is constrained
+     //         true:  check succeded, new value can be set
+     bool checkConstraints( const PPDKey*, const PPDValue*, bool bDoReset );
++public:
+     bool resetValue( const PPDKey*, bool bDefaultable = false );
+ public:
+     PPDContext( const PPDParser* pParser = NULL );
+Index: source/helper/ppdparser.cxx
+===================================================================
+RCS file: /cvs/gsl/psprint/source/helper/ppdparser.cxx,v
+retrieving revision 1.24
+diff -u -r1.24 ppdparser.cxx
+--- openoffice.org.orig/psprint/source/helper/ppdparser.cxx	25 Jan 2007 11:20:15 -0000	1.24
++++ openoffice.org/psprint/source/helper/ppdparser.cxx	4 Oct 2007 11:25:31 -0000
+@@ -53,6 +53,7 @@
+ #include <osl/thread.h>
+ #include <rtl/strbuf.hxx>
+ #include <rtl/ustrbuf.hxx>
++#include <algorithm>
+ 
+ #define PRINTER_PPDDIR "driver"
+ 
+@@ -486,6 +487,23 @@
+         delete it->second;
+ }
+ 
++void PPDParser::Reset()
++{
++    for( PPDParser::hash_type::iterator it = m_aKeys.begin(); it != m_aKeys.end(); /*nothing*/ )
++    {
++        PPDKey* pKey = it->second;
++        if (pKey->isPseudoKey())
++	{
++	    m_aOrderedKeys.erase(::std::remove(m_aOrderedKeys.begin(), 
++                m_aOrderedKeys.end(), pKey), m_aOrderedKeys.end());
++            delete it->second;
++	    m_aKeys.erase(it++);
++	}
++	else
++	    ++it;
++    }
++}
++
+ void PPDParser::insertKey( const String& rKey, PPDKey* pKey )
+ {
+     m_aKeys[ rKey ] = pKey;
+@@ -1238,6 +1256,7 @@
+         m_pDefaultValue( NULL ),
+         m_bQueryValue( false ),
+         m_bUIOption( false ),
++        m_bPseudo( false ),
+         m_eUIType( PickOne ),
+         m_nOrderDependency( 100 ),
+         m_eSetupType( AnySetup )
 Index: source/dialogs/makefile.mk
 ===================================================================
 RCS file: /cvs/util/svtools/source/dialogs/makefile.mk,v
@@ -170,11 +244,12 @@
  
  class SvStream;
  struct ImplJobSetup;
-@@ -87,6 +88,8 @@
+@@ -87,6 +88,9 @@
  	 */
  	String				GetValue( const String& rKey ) const;
  	void				SetValue( const String& rKey, const String& rValue );
 +        void                            SetCupsKey( const String& rKey, const String& rValue );
++        void                            Reset( );
 +        psp::PrinterInfo                GetPrinterInfo() const;
  
  	JobSetup&			operator=( const JobSetup& rJob );
@@ -186,11 +261,12 @@
 diff -u -r1.22 print.hxx
 --- openoffice.org.orig/vcl/inc/vcl/print.hxx	9 Sep 2005 11:15:40 -0000	1.22
 +++ openoffice.org/vcl/inc/vcl/print.hxx	19 May 2006 13:16:55 -0000
-@@ -355,6 +355,9 @@
+@@ -355,6 +355,10 @@
  	const JobSetup& 			GetJobSetup() const { return maJobSetup; }
  	String						GetJobValue( const String& rKey ) const { return maJobSetup.GetValue( rKey ); }
  	void						SetJobValue( const String& rKey, const String& rValue ) { maJobSetup.SetValue( rKey, rValue ); }
 +	void                        SetJobCupsKey( const String& rKey, const String& rValue ) { maJobSetup.SetCupsKey( rKey, rValue ); }
++	Reset( ) { maJobSetup.Reset(); }
 +    psp::PrinterInfo            GetPrinterInfo() const;
 +
  
@@ -211,7 +287,7 @@
  // =======================================================================
  
  DBG_NAME( JobSetup )
-@@ -244,6 +245,198 @@
+@@ -244,6 +245,229 @@
  		mpData = new ImplJobSetup();
  
  	mpData->maValueMap[ rKey ] = rValue;
@@ -339,6 +415,35 @@
 +	return aInfo;
 +}
 +
++void JobSetup::Reset( )
++{
++	if( ! mpData )
++		mpData = new ImplJobSetup();
++
++	using namespace psp;
++
++	PrinterInfoManager& rManager = PrinterInfoManager::get();
++	PrinterInfo aInfo(rManager.getPrinterInfo(mpData->maPrinterName));
++	if (mpData->mpDriverData )
++	{
++		JobData::constructFromStreamBuffer(mpData->mpDriverData, 
++		mpData->mnDriverDataLen, aInfo);
++	}
++
++	int nDifferent = aInfo.m_aContext.countValuesModified();
++	for (int i = 0; i < nDifferent; ++i)
++	{
++		const PPDKey* pKey = aInfo.m_aContext.getModifiedKey(i);
++		bool bResult = aInfo.m_aContext.resetValue(pKey, true);
++	}
++
++	if (aInfo.m_pParser)
++        const_cast<PPDParser*>(aInfo.m_pParser)->Reset();
++
++    aInfo.m_bCupsJob=false;
++    copyJobDataToJobSetup( mpData, aInfo );
++}
++
 +void JobSetup::SetCupsKey( const String& rKey, const String& rValue )
 +{
 +	if( ! mpData )
@@ -397,6 +502,8 @@
 +		else
 +		{
 +			PPDKey* pNewKey = new PPDKey( rKey );
++            pNewKey->setPseudoKey();
++			 pNewKey->insertValue(String(RTL_CONSTASCII_USTRINGPARAM("None")));
 +            PPDValue* pValue = pNewKey->insertValue(rValue);
 +            pValue->m_eType = eInvocation;
 +            pValue->m_aValue = rValue;
@@ -646,7 +753,7 @@
 +	else if ((!strcmp(key, "collate")) && (!strcmp(value, "true")))
 +		pPrinter->SetJobCupsKey(String::CreateFromAscii("Collate"), String::CreateFromAscii("True"));
 +	else if (!strcmp(key, "n-copies"))
-+		pPrinter->SetJobCupsKey(String::CreateFromAscii("Copies"), String::CreateFromAscii(value));
++		pPrinter->SetJobCupsKey(String::CreateFromAscii("copies"), String::CreateFromAscii(value));
 +}
 +
 +void ExportAsPDF(const rtl::OUString &rFileURL, PrintDialogRange eRange, const OUString &rRange)
@@ -876,7 +983,7 @@
  short PrintDialog::Execute()
  {
  	if ( !mpPrinter || mpPrinter->IsPrinting() || mpPrinter->IsJobActive() )
-@@ -622,15 +922,321 @@
+@@ -622,15 +922,322 @@
  	ImplInitControls();
  	ImplModifyControlHdl( NULL );
  
@@ -1155,6 +1262,7 @@
 +							}
 +						}
 +					}
++					mpPrinter->Reset();
 +					gtk_print_settings_foreach(pSettings, setcupskey, mpPrinter);
 +
 +					mpPrinter->SetOrientation(ORIENTATION_PORTRAIT);


Index: openoffice.org.spec
===================================================================
RCS file: /cvs/pkgs/rpms/openoffice.org/devel/openoffice.org.spec,v
retrieving revision 1.1311
retrieving revision 1.1312
diff -u -r1.1311 -r1.1312
--- openoffice.org.spec	2 Oct 2007 15:17:53 -0000	1.1311
+++ openoffice.org.spec	4 Oct 2007 11:31:19 -0000	1.1312
@@ -2780,9 +2780,10 @@
 %{instdir}/share/registry/modules/org/openoffice/Office/Scripting/Scripting-python.xcu
 
 %changelog
-* Tue Oct 02 2007 Caolan McNamara <caolanm at redhat.com> - 1:2.3.0-5.2
+* Thu Oct 04 2007 Caolan McNamara <caolanm at redhat.com> - 1:2.3.0-5.2
 - Resolves: rhbz#299391 Serbian langpack name update
 - Resolves: rhbz#286221 allow custom printing commands
+- Resolves: rhbz#303431 some printing problems
 - add openoffice.org-2.3.0.ooo81936.sc.maketypesagree.patch
 
 * Mon Sep 17 2007 Jan Navratil <jnavrati at redhat.com> - 1:2.3.0-5.1




More information about the fedora-extras-commits mailing list