Home » U++ TheIDE » U++ TheIDE: Installation, Compiling and Running of theide » Print.cpp compile error 
	
		
		
			| Print.cpp compile error [message #19502] | 
			Tue, 09 December 2008 11:15   | 
		 
		
			
				
				
				
					
						  
						masu
						 Messages: 378 Registered: February 2006 
						
					 | 
					Senior Member  | 
					 | 
		 
		 
	 | 
 
	
		I get: 
 
Print.cpp
c:\programs\upp-svn\uppsrc\ide\Print.cpp:69: error: expected `)' before '&' token
c:\programs\upp-svn\uppsrc\ide\Print.cpp:124: error: expected `}' at end of input
c:\programs\upp-svn\uppsrc\ide\Print.cpp:67: error: expected unqualified-id at end of input
  
 
when trying to compile latest SVN version (rev. 697). 
 
Latest running version I have is 811.r172. 
 
WinXP, Mingw 4.3.0 
 
Matthias
		
		
		
 |  
	| 
		
	 | 
 
 
 |  
	
		
		
			| Re: Print.cpp compile error [message #19587 is a reply to message #19502] | 
			Sun, 21 December 2008 06:29    | 
		 
		
			
				
				
				
					
						  
						Sender Ghost
						 Messages: 301 Registered: November 2008 
						
					 | 
					Senior Member  | 
					 | 
		 
		 
	 | 
 
	
		Hello, Matthias. 
 
Confirmed. 
PrintDlg defined in "commdlg.h" header file that included in "uppsrc\ide\PrinterJob.cpp". Unified diff for fixed "uppsrc\ide\Print.cpp" file below (or full file in attachment): 
@@ -1,26 +1,25 @@
 #include "ide.h"
 
-class PrintDlg : public WithPrintLayout<TopWindow> {
-	typedef PrintDlg CLASSNAME;
-
+class PrintDialog : public WithPrintLayout<TopWindow> {
 public:
-	PrintDlg();
+	typedef PrintDialog CLASSNAME;
+	PrintDialog();
 };
 
-PrintDlg::PrintDlg()
+PrintDialog::PrintDialog()
 {
 	CtrlLayoutOKCancel(*this, "Print");
 	columns <<= 1;
 	orientation <<= 0;
 	line <<= 100;
 }
 
 INITBLOCK {
-	RegisterGlobalConfig("PrintDlg");
-};
+	RegisterGlobalConfig("PrintDialog");
+}
 
 struct Printer {
 	Draw& w;
 	Size  page;
 	int   cols;
 	int   line;
@@ -63,15 +62,13 @@
 				x++;
 			}
 		}
 		NextLine();
 	}
 	
-	Printer(PrintDlg& dlg, Draw& w, int tabs) : w(w), tabs(tabs) {
-		cols = ~dlg.columns;
-		line = ~dlg.line;
+	Printer(Draw& w, int cols, int line, int tabs) : w(w), cols(cols), line(line), tabs(tabs) {
 		page = w.GetPagePixels();
 		columncx = page.cx / cols;
 		cx = page.cx / cols - 100;
 		int l = 0;
 		int h = 1000;
 		while(l < h) {
@@ -86,25 +83,26 @@
 		fcx = fi.GetWidth('x');
 		fcy = fi.GetHeight();
 		lines = page.cy / fcy;
 		y = coli = 0;
 		w.StartPage();
 	}
+
 	~Printer() {
 		w.EndPage();
 	}
 };
 
 void Ide::Print()
 {
 	if(designer)
 		return;
-	PrintDlg dlg;
-	LoadFromGlobal(dlg, "PrintDlg");
+	PrintDialog dlg;
+	LoadFromGlobal(dlg, "PrintDialog");
 	int c = dlg.Execute();
-	StoreToGlobal(dlg, "PrintDlg");
+	StoreToGlobal(dlg, "PrintDialog");
 	if(c != IDOK)
 		return;
 	PrinterJob job;
 	job.Landscape(dlg.orientation);
 	if(!job.Execute())
 		return;
@@ -115,10 +113,10 @@
 		h = editor.GetLine(h);
 	}
 	else {
 		l = 0;
 		h = editor.GetLineCount() - 1;
 	}
-	Printer p(dlg, job, editor.GetTabSize());
+	Printer p(job, ~dlg.columns, ~dlg.line, editor.GetTabSize());
 	for(int i = l; i <= h; i++)
 		p.PrintLine(editor.GetWLine(i));
 }
 
 
Another solution: 
#ifdef PrintDlg
	#undef PrintDlg
#endif
  
		
	- 
	
 
	Attachment: Print.zip
	 
	(Size: 1.05KB, Downloaded 404 times)
 
 
		
		[Updated on: Sun, 21 December 2008 22:14] Report message to a moderator  
 |  
	| 
		
	 | 
 
 
 |  
	| 
		
 |   
Goto Forum:
 
 Current Time: Tue Nov 04 06:45:10 CET 2025 
 Total time taken to generate the page: 0.05949 seconds 
 |