View Issue Details

IDProjectCategoryView StatusLast Update
0002150ScribusInternalpublic2005-07-06 04:43
Reporterjghali Assigned Tocbradney  
PrioritynormalSeveritytweakReproducibilityalways
Status closedResolutionfixed 
PlatformWindowsOSWindows 9x/2k/XpOS VersionWin2k SP4
Product Version1.3.0cvs 
Fixed in Version1.3.0cvs 
Summary0002150: Value Names in Unit enum conflicts with declarations in windows.h
DescriptionValue Names in Unit enum conflicts with declarations in windows.h. Rename values :
POINTS => SC_POINTS
PT => SC_PT
etc...
Provide patch for 1.3.0 cvs.
Patch for 1.2.x to come.
TagsNo tags attached.
Patch

Relationships

child of 0000015 closedjghali Windows Port 

Activities

2005-06-28 19:16

 

units_renames.diff (12,238 bytes)   
Index: scribus/gtmeasure.h
===================================================================
RCS file: /cvs/Scribus/scribus/gtmeasure.h,v
retrieving revision 1.3.2.5
diff -u -r1.3.2.5 gtmeasure.h
--- scribus/gtmeasure.h	6 Jun 2005 10:13:58 -0000	1.3.2.5
+++ scribus/gtmeasure.h	28 Jun 2005 21:02:39 -0000
@@ -37,11 +37,11 @@
 	static double convert2(int value);
 	static double parse(const QString& value);
 public:
-	static double convert(double value, Unit from, Unit to = PT);
-	static double convert(int value, Unit from, Unit to = PT);
-	static double d2d(double value, Unit from, Unit to = PT);
-	static double i2d(int value, Unit from, Unit to = PT);
-	static double qs2d(const QString& value, Unit to = PT);
+	static double convert(double value, Unit from, Unit to = SC_PT);
+	static double convert(int value, Unit from, Unit to = SC_PT);
+	static double d2d(double value, Unit from, Unit to = SC_PT);
+	static double i2d(int value, Unit from, Unit to = SC_PT);
+	static double qs2d(const QString& value, Unit to = SC_PT);
 
 };
 
Index: scribus/mspinbox.cpp
===================================================================
RCS file: /cvs/Scribus/scribus/mspinbox.cpp,v
retrieving revision 1.21.2.7
diff -u -r1.21.2.7 mspinbox.cpp
--- scribus/mspinbox.cpp	28 Jun 2005 08:35:44 -0000	1.21.2.7
+++ scribus/mspinbox.cpp	28 Jun 2005 21:02:39 -0000
@@ -150,19 +150,19 @@
 	QString su = suffix().stripWhiteSpace();
 	ts.replace(",", ".");
 	ts.replace("%", "");
-	QString strPT=unitGetStrFromIndex(PT);
-	QString strMM=unitGetStrFromIndex(MM);
-	QString strIN=unitGetStrFromIndex(IN);
-	QString strP =unitGetStrFromIndex(P);
-	QString strCM=unitGetStrFromIndex(CM);
-	QString strC =unitGetStrFromIndex(C);
+	QString strPT=unitGetStrFromIndex(SC_PT);
+	QString strMM=unitGetStrFromIndex(SC_MM);
+	QString strIN=unitGetStrFromIndex(SC_IN);
+	QString strP =unitGetStrFromIndex(SC_P);
+	QString strCM=unitGetStrFromIndex(SC_CM);
+	QString strC =unitGetStrFromIndex(SC_C);
 	
-	QString suffPT=unitGetSuffixFromIndex(PT);
-	QString suffMM=unitGetSuffixFromIndex(MM);
-	QString suffIN=unitGetSuffixFromIndex(IN);
-	QString suffP =unitGetSuffixFromIndex(P);
-	QString suffCM=unitGetSuffixFromIndex(CM);
-	QString suffC =unitGetSuffixFromIndex(C);
+	QString suffPT=unitGetSuffixFromIndex(SC_PT);
+	QString suffMM=unitGetSuffixFromIndex(SC_MM);
+	QString suffIN=unitGetSuffixFromIndex(SC_IN);
+	QString suffP =unitGetSuffixFromIndex(SC_P);
+	QString suffCM=unitGetSuffixFromIndex(SC_CM);
+	QString suffC =unitGetSuffixFromIndex(SC_C);
 		
 	if ((su == suffPT) || (su == strPT))
 	{
Index: scribus/pagesize.cpp
===================================================================
RCS file: /cvs/Scribus/scribus/Attic/pagesize.cpp,v
retrieving revision 1.1.2.3
diff -u -r1.1.2.3 pagesize.cpp
--- scribus/pagesize.cpp	28 Feb 2005 09:52:48 -0000	1.1.2.3
+++ scribus/pagesize.cpp	28 Jun 2005 21:02:39 -0000
@@ -144,20 +144,20 @@
 	//4A0
 	info.width=mm2pts(width*2.0);
 	info.height=mm2pts(height*2.0);
-	info.pageUnitIndex=MM;
+	info.pageUnitIndex=SC_MM;
 	info.trSizeName=QObject::tr("4A0");
 	pageSizeList.insert("4A0", info); 
 	//2A0
 	info.width=mm2pts(height);
 	info.height=mm2pts(width*2.0);
-	info.pageUnitIndex=MM;
+	info.pageUnitIndex=SC_MM;
 	info.trSizeName=QObject::tr("2A0");
 	pageSizeList.insert("2A0", info); 
 	//Continue with rest of A series
 	for (format = 0; format <= 10; format++) {
 		info.width=mm2pts(width);
 		info.height=mm2pts(height);
-		info.pageUnitIndex=MM;
+		info.pageUnitIndex=SC_MM;
 		name=QString("A%1").arg(format);
 		info.trSizeName=name;
 		pageSizeList.insert(name, info);
@@ -173,7 +173,7 @@
 	for (format = 0; format <= 10; format++) {
 		info.width=mm2pts(width);
 		info.height=mm2pts(height);
-		info.pageUnitIndex=MM;
+		info.pageUnitIndex=SC_MM;
 		name=QString("B%1").arg(format);
 		info.trSizeName=name;
 		pageSizeList.insert(name, info);
@@ -190,7 +190,7 @@
 	for (format = 0; format <= 10; format++) {
 		info.width=mm2pts(width);
 		info.height=mm2pts(height);
-		info.pageUnitIndex=MM;
+		info.pageUnitIndex=SC_MM;
 		name=QString("C%1").arg(format);
 		info.trSizeName=name;
 		pageSizeList.insert(name, info);
@@ -218,20 +218,20 @@
 	{
 		info.width=in2pts(impWidths[i]);
 		info.height=in2pts(impHeights[i]);
-		info.pageUnitIndex=IN;
+		info.pageUnitIndex=SC_IN;
 		info.trSizeName=impTrNames[i];
 		pageSizeList.insert(impNames[i], info);
 	}
 	//Comm10E
 	info.width=in2pts(4.125);
 	info.height=in2pts(9.5);
-	info.pageUnitIndex=IN;
+	info.pageUnitIndex=SC_IN;
 	info.trSizeName=QObject::tr("Comm10E");
 	pageSizeList.insert("Comm10E", info); 
 	//DLE
 	info.width=mm2pts(110);
 	info.height=mm2pts(220);
-	info.pageUnitIndex=MM;
+	info.pageUnitIndex=SC_MM;
 	info.trSizeName=QObject::tr("DLE");
 	pageSizeList.insert("DLE", info); 
 	//Executive
Index: scribus/units.cpp
===================================================================
RCS file: /cvs/Scribus/scribus/Attic/units.cpp,v
retrieving revision 1.1.2.13
diff -u -r1.1.2.13 units.cpp
--- scribus/units.cpp	28 Jun 2005 08:35:44 -0000	1.1.2.13
+++ scribus/units.cpp	28 Jun 2005 21:02:39 -0000
@@ -78,30 +78,30 @@
 	Unit retVal;
 	if (lowerValue.find("pt") != -1)
 	{
-		retVal=PT;
+		retVal=SC_PT;
 	}
 	else if (lowerValue.find("mm") != -1)
 	{
-		retVal=MM;
+		retVal=SC_MM;
 	}
 	else if (lowerValue.find("in") != -1)
 	{
-		retVal=IN;
+		retVal=SC_IN;
 	}
 	else if (lowerValue.find("p") != -1)
 	{
-		retVal=P;
+		retVal=SC_P;
 	}
 	else if (lowerValue.find("cm") != -1)
 	{
-		retVal=CM;
+		retVal=SC_CM;
 	}
 	else if (lowerValue.find("c") != -1)
 	{
-		retVal=C;
+		retVal=SC_C;
 	}	
 	else
-		retVal=PT;
+		retVal=SC_PT;
 	return retVal;
 }
 
@@ -180,7 +180,7 @@
  */
 const double mm2pts(double mm)
 {
-	return mm / unitGetRatioFromIndex(MM);
+	return mm / unitGetRatioFromIndex(SC_MM);
 }
 
 /*!
@@ -188,7 +188,7 @@
  */
 const double in2pts(double in)
 {
-	return in / unitGetRatioFromIndex(IN);
+	return in / unitGetRatioFromIndex(SC_IN);
 }
 
 /*!
@@ -196,7 +196,7 @@
  */
 const double p2pts(double p)
 {
-	return p / unitGetRatioFromIndex(P);
+	return p / unitGetRatioFromIndex(SC_P);
 }
 
 /*!
@@ -204,7 +204,7 @@
  */
 const double cm2pts(double cm)
 {
-	return cm / unitGetRatioFromIndex(CM);
+	return cm / unitGetRatioFromIndex(SC_CM);
 }
 
 /*!
@@ -212,7 +212,7 @@
  */
 const double c2pts(double c)
 {
-	return c / unitGetRatioFromIndex(C);
+	return c / unitGetRatioFromIndex(SC_C);
 }
 
 /*!
@@ -220,7 +220,7 @@
  */
 const double pts2mm(double pts)
 {
-	return pts * unitGetRatioFromIndex(MM);
+	return pts * unitGetRatioFromIndex(SC_MM);
 }
 
 /*!
@@ -228,7 +228,7 @@
  */
 const double pts2in(double pts)
 {
-	return pts * unitGetRatioFromIndex(IN);
+	return pts * unitGetRatioFromIndex(SC_IN);
 }
 
 /*!
@@ -236,7 +236,7 @@
  */
 const double pts2p(double pts)
 {
-	return pts * unitGetRatioFromIndex(P);
+	return pts * unitGetRatioFromIndex(SC_P);
 }
 
 /*!
@@ -244,7 +244,7 @@
  */
 const double pts2cm(double pts)
 {
-	return pts * unitGetRatioFromIndex(CM);
+	return pts * unitGetRatioFromIndex(SC_CM);
 }
 
 /*!
@@ -252,7 +252,7 @@
  */
 const double pts2c(double pts)
 {
-	return pts * unitGetRatioFromIndex(C);
+	return pts * unitGetRatioFromIndex(SC_C);
 }
 
 /*!
Index: scribus/units.h
===================================================================
RCS file: /cvs/Scribus/scribus/Attic/units.h,v
retrieving revision 1.1.2.11
diff -u -r1.1.2.11 units.h
--- scribus/units.h	28 Jun 2005 08:35:44 -0000	1.1.2.11
+++ scribus/units.h	28 Jun 2005 21:02:39 -0000
@@ -22,18 +22,18 @@
 #define UNITCOUNT 5
 
 enum Unit {
-	POINTS      = 0,
-	PT          = 0,
-	MILLIMETERS = 1,
-	MM          = 1,
-	INCHES      = 2,
-	IN          = 2,
-	PICAS       = 3,
-	P           = 3,
-	CENTIMETERS = 4,
-	CM          = 4,
-	CICERO      = 5,
-	C           = 5
+	SC_POINTS      = 0,
+	SC_PT          = 0,
+	SC_MILLIMETERS = 1,
+	SC_MM          = 1,
+	SC_INCHES      = 2,
+	SC_IN          = 2,
+	SC_PICAS       = 3,
+	SC_P           = 3,
+	SC_CENTIMETERS = 4,
+	SC_CM          = 4,
+	SC_CICERO      = 5,
+	SC_C           = 5
 };
 
 const double unitGetRatioFromIndex(const int index);
Index: scribus/plugins/gettext/htmlim/htmlreader.cpp
===================================================================
RCS file: /cvs/Scribus/scribus/plugins/gettext/htmlim/htmlreader.cpp,v
retrieving revision 1.4.2.4
diff -u -r1.4.2.4 htmlreader.cpp
--- scribus/plugins/gettext/htmlim/htmlreader.cpp	10 Mar 2005 18:12:17 -0000	1.4.2.4
+++ scribus/plugins/gettext/htmlim/htmlreader.cpp	28 Jun 2005 21:02:39 -0000
@@ -99,7 +99,7 @@
 	pstylecode->getFont()->setName("Courier Regular");
 	pstylecode->setName("HTML_code");
 	pstylep = new gtParagraphStyle(*pstyle);
-	pstylep->setSpaceBelow(gtMeasure::i2d(5, MM));
+	pstylep->setSpaceBelow(gtMeasure::i2d(5, SC_MM));
 	pstylep->setName("HTML_p");
 	pstylepre = new gtParagraphStyle(*pstyle);
 	pstylepre->setName("HTML_pre");
Index: scribus/plugins/gettext/odtim/stylereader.cpp
===================================================================
RCS file: /cvs/Scribus/scribus/plugins/gettext/odtim/stylereader.cpp,v
retrieving revision 1.1.2.6
diff -u -r1.1.2.6 stylereader.cpp
--- scribus/plugins/gettext/odtim/stylereader.cpp	17 Jun 2005 12:46:05 -0000	1.1.2.6
+++ scribus/plugins/gettext/odtim/stylereader.cpp	28 Jun 2005 21:02:39 -0000
@@ -709,29 +709,29 @@
  	if (lowerValue.find("pt") != -1)
  	{
  		dbl = lowerValue.remove("pt");
- 		ret = gtMeasure::d2d(dbl.toDouble(), PT);
+ 		ret = gtMeasure::d2d(dbl.toDouble(), SC_PT);
  	}
  	else if (lowerValue.find("mm") != -1)
  	{
  		dbl = lowerValue.remove("mm");
- 		ret = gtMeasure::d2d(dbl.toDouble(), MM);
+ 		ret = gtMeasure::d2d(dbl.toDouble(), SC_MM);
  	}
  	else if (lowerValue.find("cm") != -1)
  	{
  		dbl = lowerValue.remove("cm");
- 		ret = gtMeasure::d2d(dbl.toDouble() * 10, MM);
+ 		ret = gtMeasure::d2d(dbl.toDouble() * 10, SC_MM);
  	}
  	else if (lowerValue.find("in") != -1)
  	{
  		dbl = lowerValue.remove("inch");
  		dbl = lowerValue.remove("in");
- 		ret = gtMeasure::d2d(dbl.toDouble(), IN);
+ 		ret = gtMeasure::d2d(dbl.toDouble(), SC_IN);
  	}
  	else if (lowerValue.find("pi") != -1)
  	{
  		dbl = lowerValue.remove("pica");
  		dbl = lowerValue.remove("pi");
- 		ret = gtMeasure::d2d(dbl.toDouble(), P);
+ 		ret = gtMeasure::d2d(dbl.toDouble(), SC_P);
  	}
  	else if (lowerValue.find("%") != -1)
  	{
Index: scribus/plugins/gettext/sxwim/stylereader.cpp
===================================================================
RCS file: /cvs/Scribus/scribus/plugins/gettext/sxwim/stylereader.cpp,v
retrieving revision 1.5.2.7
diff -u -r1.5.2.7 stylereader.cpp
--- scribus/plugins/gettext/sxwim/stylereader.cpp	17 Jun 2005 12:46:05 -0000	1.5.2.7
+++ scribus/plugins/gettext/sxwim/stylereader.cpp	28 Jun 2005 21:02:39 -0000
@@ -650,29 +650,29 @@
  	if (lowerValue.find("pt") != -1)
  	{
  		dbl = lowerValue.remove("pt");
- 		ret = gtMeasure::d2d(dbl.toDouble(), PT);
+ 		ret = gtMeasure::d2d(dbl.toDouble(), SC_PT);
  	}
  	else if (lowerValue.find("mm") != -1)
  	{
  		dbl = lowerValue.remove("mm");
- 		ret = gtMeasure::d2d(dbl.toDouble(), MM);
+ 		ret = gtMeasure::d2d(dbl.toDouble(), SC_MM);
  	}
  	else if (lowerValue.find("cm") != -1)
  	{
  		dbl = lowerValue.remove("cm");
- 		ret = gtMeasure::d2d(dbl.toDouble() * 10, MM);
+ 		ret = gtMeasure::d2d(dbl.toDouble() * 10, SC_MM);
  	}
  	else if (lowerValue.find("in") != -1)
  	{
  		dbl = lowerValue.remove("inch");
  		dbl = lowerValue.remove("in");
- 		ret = gtMeasure::d2d(dbl.toDouble(), IN);
+ 		ret = gtMeasure::d2d(dbl.toDouble(), SC_IN);
  	}
  	else if (lowerValue.find("pi") != -1)
  	{
  		dbl = lowerValue.remove("pica");
  		dbl = lowerValue.remove("pi");
- 		ret = gtMeasure::d2d(dbl.toDouble(), P);
+ 		ret = gtMeasure::d2d(dbl.toDouble(), SC_P);
  	}
  	else if (lowerValue.find("%") != -1)
  	{
units_renames.diff (12,238 bytes)   

cbradney

2005-06-28 19:40

administrator   ~0005197

1.3.0 patch is in CVS now.

jghali

2005-06-28 19:48

administrator   ~0005198

Thanks!

Issue History

Date Modified Username Field Change
2005-06-28 19:16 jghali New Issue
2005-06-28 19:16 jghali File Added: units_renames.diff
2005-06-28 19:21 cbradney Status new => assigned
2005-06-28 19:21 cbradney Assigned To => cbradney
2005-06-28 19:40 cbradney Note Added: 0005197
2005-06-28 19:48 jghali Note Added: 0005198
2005-06-28 19:58 cbradney Status assigned => resolved
2005-06-28 19:58 cbradney Fixed in Version => 1.3.0cvs
2005-06-28 19:58 cbradney Resolution open => fixed
2005-06-28 20:06 cbradney Status resolved => closed
2005-07-06 04:43 ringerc Relationship added child of 0000015