r14588 by fschmid - Improved import of patterns.

scribus-commit scribus-commit at lists.scribus.net
Mon Feb 1 05:46:24 CET 2010


Revision: 14588
Author: fschmid
Date: 2010-01-28T12:13:37.138150Z
Commit message: Improved import of patterns.

Changeset: 
M  /trunk/Scribus/scribus/plugins/import/xar/importxar.cpp
M  /trunk/Scribus/scribus/plugins/import/drw/importdrw.cpp
M  /trunk/Scribus/scribus/plugins/import/pct/importpct.cpp

Diffs:
Index: scribus/plugins/import/pct/importpct.cpp
===================================================================
--- scribus/plugins/import/pct/importpct.cpp	(revision 14587)
+++ scribus/plugins/import/pct/importpct.cpp	(revision 14588)
@@ -2118,6 +2118,8 @@
 		QString fileName = getLongPathName(newItem->tempImageFile->fileName());
 		newItem->tempImageFile->close();
 		newItem->isInlineImage = true;
+		image.setDotsPerMeterY(2834);
+		image.setDotsPerMeterX(2834);
 		image.save(fileName, "PNG");
 		if (newItem->loadImage(fileName, false, 72, false))
 		{
Index: scribus/plugins/import/xar/importxar.cpp
===================================================================
--- scribus/plugins/import/xar/importxar.cpp	(revision 14587)
+++ scribus/plugins/import/xar/importxar.cpp	(revision 14588)
@@ -1677,6 +1677,8 @@
 		QString fileName = getLongPathName(newItem->tempImageFile->fileName());
 		newItem->tempImageFile->close();
 		newItem->isInlineImage = true;
+		image.setDotsPerMeterY(2834);
+		image.setDotsPerMeterX(2834);
 		image.save(fileName, "PNG");
 		if (newItem->loadImage(fileName, false, 72, false))
 		{
@@ -2261,6 +2263,8 @@
 		QString fileName = getLongPathName(newItem->tempImageFile->fileName());
 		newItem->tempImageFile->close();
 		newItem->isInlineImage = true;
+		image.setDotsPerMeterY(2834);
+		image.setDotsPerMeterX(2834);
 		image.save(fileName, "PNG");
 		if (newItem->loadImage(fileName, false, 72, false))
 		{
@@ -2411,6 +2415,8 @@
 		QString fileName = getLongPathName(newItem->tempImageFile->fileName());
 		newItem->tempImageFile->close();
 		newItem->isInlineImage = true;
+		image.setDotsPerMeterY(2834);
+		image.setDotsPerMeterX(2834);
 		image.save(fileName, "PNG");
 		if (newItem->loadImage(fileName, false, 72, false))
 		{
Index: scribus/plugins/import/drw/importdrw.cpp
===================================================================
--- scribus/plugins/import/drw/importdrw.cpp	(revision 14587)
+++ scribus/plugins/import/drw/importdrw.cpp	(revision 14588)
@@ -1727,12 +1727,12 @@
 				uint oldNum = m_Doc->TotalItems;
 				QByteArray data = patternDataMap[ind];
 				QVector<QRgb> colors;
-				colors.append(back.rgb());
-				colors.append(fore.rgb());
 				int offs = 0;
 				QImage image;
 				if (patternIndex > 0xC0)
 				{
+					colors.append(qRgb(255,255,255));
+					colors.append(back.rgb());
 					image = QImage(16, 8, QImage::Format_Mono);
 					image.setColorTable(colors);
 					for (int rr = 0; rr < 8; rr++)
@@ -1744,6 +1744,8 @@
 				}
 				else
 				{
+					colors.append(back.rgb());
+					colors.append(fore.rgb());
 					image = QImage(8, 8, QImage::Format_Mono);
 					image.setColorTable(colors);
 					for (int rr = 0; rr < 8; rr++)
@@ -1757,11 +1759,13 @@
 				ScPattern pat = ScPattern();
 				pat.setDoc(m_Doc);
 				PageItem* newItem = new PageItem_ImageFrame(m_Doc, 0, 0, 1, 1, 0, CommonStrings::None, CommonStrings::None);
-				newItem->tempImageFile = new QTemporaryFile(QDir::tempPath() + "/scribus_temp_pct_XXXXXX.png");
+				newItem->tempImageFile = new QTemporaryFile(QDir::tempPath() + "/scribus_temp_drw_XXXXXX.png");
 				newItem->tempImageFile->open();
 				QString fileName = getLongPathName(newItem->tempImageFile->fileName());
 				newItem->tempImageFile->close();
 				newItem->isInlineImage = true;
+				image.setDotsPerMeterY(2834);
+				image.setDotsPerMeterX(2834);
 				image.save(fileName, "PNG");
 				if (newItem->loadImage(fileName, false, 72, false))
 				{




More information about the scribus-commit mailing list