r16244 by jghali - merge trunk revisions up to r16243

scribus-commit scribus-commit at lists.scribus.net
Wed Jan 12 12:15:31 CET 2011


Author: jghali
Date: Wed Jan 12 11:15:30 2011
New Revision: 16244

URL: http://scribus.info/websvn/listing.php?repname=Scribus&sc=1&rev=16244
Log:
merge trunk revisions up to r16243

Modified:
    branches/ScribusOIF/scribus/canvas.cpp
    branches/ScribusOIF/scribus/canvas.h
    branches/ScribusOIF/scribus/pageitem.cpp
    branches/ScribusOIF/scribus/plugins/fileloader/scribus12format/scribus12format.cpp
    branches/ScribusOIF/scribus/plugins/import/ps/importps.cpp
    branches/ScribusOIF/scribus/plugins/svgexplugin/svgexplugin.cpp
    branches/ScribusOIF/scribus/scribusdoc.cpp
    branches/ScribusOIF/scribus/scribusdoc.h
    branches/ScribusOIF/scribus/scribusview.cpp

Modified: branches/ScribusOIF/scribus/canvas.cpp
URL: http://scribus.info/websvn/diff.php?repname=Scribus&rev=16244&path=/branches/ScribusOIF/scribus/canvas.cpp
==============================================================================
--- branches/ScribusOIF/scribus/canvas.cpp (original)
+++ branches/ScribusOIF/scribus/canvas.cpp Wed Jan 12 11:15:30 2011
@@ -114,7 +114,12 @@
 	m_renderMode = RENDER_NORMAL;
 }
 
-
+void Canvas::setPreviewVisual(int mode)
+{
+	m_viewMode.previewVisual = qMax(0, mode);
+	m_viewMode.viewAsPreview = (mode >= 0);
+
+}
 // ______________________________
 // Coordinate Conversion Routines:
 

Modified: branches/ScribusOIF/scribus/canvas.h
URL: http://scribus.info/websvn/diff.php?repname=Scribus&rev=16244&path=/branches/ScribusOIF/scribus/canvas.h
==============================================================================
--- branches/ScribusOIF/scribus/canvas.h (original)
+++ branches/ScribusOIF/scribus/canvas.h Wed Jan 12 11:15:30 2011
@@ -183,7 +183,7 @@
 	bool isPreviewMode() const { return m_viewMode.previewMode || m_viewMode.viewAsPreview; }
 	bool usePreviewVisual() const { return m_viewMode.viewAsPreview && m_viewMode.previewVisual != 0; }
 	int previewVisual() const { return m_viewMode.previewVisual; }
-	void setPreviewVisual(int mode) { m_viewMode.previewVisual = qMax(0, mode); m_viewMode.viewAsPreview = (mode >= 0); }
+	void setPreviewVisual(int mode);
 	
 	void DrawMasterItems(ScPainter *painter, Page *page, ScLayer& layer, QRect clip);
 	void DrawPageItems(ScPainter *painter, ScLayer& layer, QRect clip);

Modified: branches/ScribusOIF/scribus/pageitem.cpp
URL: http://scribus.info/websvn/diff.php?repname=Scribus&rev=16244&path=/branches/ScribusOIF/scribus/pageitem.cpp
==============================================================================
--- branches/ScribusOIF/scribus/pageitem.cpp (original)
+++ branches/ScribusOIF/scribus/pageitem.cpp Wed Jan 12 11:15:30 2011
@@ -2095,10 +2095,10 @@
 {
 	const ScColor& col = m_Doc->PageColors[farbe];
 	*tmp = ScColorEngine::getShadeColorProof(col, m_Doc, shad);
-	if ((m_Doc->view()) && (m_Doc->view()->m_canvas->usePreviewVisual()))
+	if (m_Doc->viewAsPreview)
 	{
 		VisionDefectColor defect;
-		*tmp = defect.convertDefect(*tmp, m_Doc->view()->m_canvas->previewVisual());
+		*tmp = defect.convertDefect(*tmp, m_Doc->previewVisual);
 	}
 }
 
@@ -2601,10 +2601,10 @@
 	}
 	else
 		GrColorP1QColor = QColor(255, 255, 255, 0);
-	if ((m_Doc->view()) && (m_Doc->view()->m_canvas->usePreviewVisual()))
+	if (m_Doc->viewAsPreview)
 	{
 		VisionDefectColor defect;
-		GrColorP1QColor = defect.convertDefect(GrColorP1QColor, m_Doc->view()->m_canvas->previewVisual());
+		GrColorP1QColor = defect.convertDefect(GrColorP1QColor, m_Doc->previewVisual);
 	}
 	GrColorP2 = col2;
 	if (GrColorP2 != CommonStrings::None)
@@ -2638,10 +2638,10 @@
 	}
 	else
 		GrColorP2QColor = QColor(255, 255, 255, 0);
-	if ((m_Doc->view()) && (m_Doc->view()->m_canvas->usePreviewVisual()))
+	if (m_Doc->viewAsPreview)
 	{
 		VisionDefectColor defect;
-		GrColorP2QColor = defect.convertDefect(GrColorP2QColor, m_Doc->view()->m_canvas->previewVisual());
+		GrColorP2QColor = defect.convertDefect(GrColorP2QColor, m_Doc->previewVisual);
 	}
 	GrColorP3 = col3;
 	if (GrColorP3 != CommonStrings::None)
@@ -2675,10 +2675,10 @@
 	}
 	else
 		GrColorP3QColor = QColor(255, 255, 255, 0);
-	if ((m_Doc->view()) && (m_Doc->view()->m_canvas->usePreviewVisual()))
+	if (m_Doc->viewAsPreview)
 	{
 		VisionDefectColor defect;
-		GrColorP3QColor = defect.convertDefect(GrColorP3QColor, m_Doc->view()->m_canvas->previewVisual());
+		GrColorP3QColor = defect.convertDefect(GrColorP3QColor, m_Doc->previewVisual);
 	}
 	GrColorP4 = col4;
 	if (GrColorP4 != CommonStrings::None)
@@ -2712,10 +2712,10 @@
 	}
 	else
 		GrColorP4QColor = QColor(255, 255, 255, 0);
-	if ((m_Doc->view()) && (m_Doc->view()->m_canvas->usePreviewVisual()))
+	if (m_Doc->viewAsPreview)
 	{
 		VisionDefectColor defect;
-		GrColorP4QColor = defect.convertDefect(GrColorP4QColor, m_Doc->view()->m_canvas->previewVisual());
+		GrColorP4QColor = defect.convertDefect(GrColorP4QColor, m_Doc->previewVisual);
 	}
 }
 
@@ -2778,10 +2778,10 @@
 	}
 	else
 		MQColor = QColor(255, 255, 255, 0);
-	if ((m_Doc->view()) && (m_Doc->view()->m_canvas->usePreviewVisual()))
+	if (m_Doc->viewAsPreview)
 	{
 		VisionDefectColor defect;
-		MQColor = defect.convertDefect(MQColor, m_Doc->view()->m_canvas->previewVisual());
+		MQColor = defect.convertDefect(MQColor, m_Doc->previewVisual);
 	}
 	if ((x > -1) && (y > -1))
 	{
@@ -2827,10 +2827,10 @@
 	}
 	else
 		MQColor = QColor(255, 255, 255, 0);
-	if ((m_Doc->view()) && (m_Doc->view()->m_canvas->usePreviewVisual()))
+	if (m_Doc->viewAsPreview)
 	{
 		VisionDefectColor defect;
-		MQColor = defect.convertDefect(MQColor, m_Doc->view()->m_canvas->previewVisual());
+		MQColor = defect.convertDefect(MQColor, m_Doc->previewVisual);
 	}
 	meshGradientArray.clear();
 	double xoffs = Width / static_cast<double>(cols);
@@ -3342,10 +3342,10 @@
 		const ScColor& col = m_Doc->PageColors[lineColorVal];
 		strokeQColor = ScColorEngine::getShadeColorProof(col, m_Doc, lineShadeVal);
 	}
-	if ((m_Doc->view()) && (m_Doc->view()->m_canvas->usePreviewVisual()))
+	if (m_Doc->viewAsPreview)
 	{
 		VisionDefectColor defect;
-		strokeQColor = defect.convertDefect(strokeQColor, m_Doc->view()->m_canvas->previewVisual());
+		strokeQColor = defect.convertDefect(strokeQColor, m_Doc->previewVisual);
 	}
 }
 
@@ -3379,10 +3379,10 @@
 		const ScColor& col = m_Doc->PageColors[fillColorVal];
 		fillQColor = ScColorEngine::getShadeColorProof(col, m_Doc, fillShadeVal);
 	}
-	if ((m_Doc->view()) && (m_Doc->view()->m_canvas->usePreviewVisual()))
+	if (m_Doc->viewAsPreview)
 	{
 		VisionDefectColor defect;
-		fillQColor = defect.convertDefect(fillQColor, m_Doc->view()->m_canvas->previewVisual());
+		fillQColor = defect.convertDefect(fillQColor, m_Doc->previewVisual);
 	}
 }
 
@@ -4174,42 +4174,19 @@
 	double   w = state->getDouble("NEW_RWIDTH");
 	double   h = state->getDouble("NEW_RHEIGHT");
 	int  stateCode = state->transactionCode;
-	bool redraw = ((stateCode != 1) && (stateCode != 3));;
-	//CB Commented out test code
-	//QRect oldR(getRedrawBounding(view->scale()));
-	//double mx = ox - x;
-	//double my = oy - y;
+	bool redraw = ((stateCode != 1) && (stateCode != 3));
 	if (isUndo)
 	{
-		/*Rot=ort;
-		Xpos+=mx;
-		Ypos+=my;
-		Width=ow;
-		Height=oh;*/
 		m_Doc->RotateItem(ort, this);
 		m_Doc->MoveItem(ox - Xpos, oy - Ypos, this, false);
 		m_Doc->SizeItem(ow, oh, this, false, true, redraw);
 	}
 	else
 	{
-		/*mx = -mx;
-		my = -my;
-		Rot=rt;
-		Xpos-=mx;
-		Ypos-=my;
-		Width=w;
-		Height=h;
-		*/
 		m_Doc->RotateItem(rt, this);
 		m_Doc->MoveItem(x - Xpos, y - Ypos, this, false);
 		m_Doc->SizeItem(w, h, this, false, true, redraw);
 	}
-	/*
-	m_Doc->setRedrawBounding(this);
-	QRect newR(getRedrawBounding(view->scale()));
-	view->updateContents(newR.unite(oldR));
-	OwnPage = m_Doc->OnPage(this);
-	*/
 	oldRot = Rot;
 	oldXpos = Xpos;
 	oldYpos = Ypos;
@@ -5842,7 +5819,7 @@
 	}
 	if (PictureIsAvailable)
 	{
-		if (m_Doc->view() && (m_Doc->view()->m_canvas->usePreviewVisual()))
+		if (m_Doc->viewAsPreview)
 		{
 			VisionDefectColor defect;
 			QColor tmpC;
@@ -5858,7 +5835,7 @@
 				{
 					rgb = *s;
 					tmpC.setRgb(rgb);
-					tmpC = defect.convertDefect(tmpC, m_Doc->view()->m_canvas->previewVisual());
+					tmpC = defect.convertDefect(tmpC, m_Doc->previewVisual);
 					a = qAlpha(rgb);
 					tmpC.getRgb(&r, &g, &b);
 					*s = qRgba(r, g, b, a);

Modified: branches/ScribusOIF/scribus/plugins/fileloader/scribus12format/scribus12format.cpp
URL: http://scribus.info/websvn/diff.php?repname=Scribus&rev=16244&path=/branches/ScribusOIF/scribus/plugins/fileloader/scribus12format/scribus12format.cpp
==============================================================================
--- branches/ScribusOIF/scribus/plugins/fileloader/scribus12format/scribus12format.cpp (original)
+++ branches/ScribusOIF/scribus/plugins/fileloader/scribus12format/scribus12format.cpp Wed Jan 12 11:15:30 2011
@@ -369,6 +369,8 @@
 		m_Doc->Items->at(z)->groupHeight = Buffer->groupHeight;
 		break;
 	case PageItem::Multiple:
+	case PageItem::RegularPolygon:
+	case PageItem::Arc:
 		Q_ASSERT(false);
 		break;
 	case PageItem::LatexFrame:

Modified: branches/ScribusOIF/scribus/plugins/import/ps/importps.cpp
URL: http://scribus.info/websvn/diff.php?repname=Scribus&rev=16244&path=/branches/ScribusOIF/scribus/plugins/import/ps/importps.cpp
==============================================================================
--- branches/ScribusOIF/scribus/plugins/import/ps/importps.cpp (original)
+++ branches/ScribusOIF/scribus/plugins/import/ps/importps.cpp Wed Jan 12 11:15:30 2011
@@ -627,7 +627,7 @@
 						FPoint wh = getMaxClipF(&ite->PoLine);
 						ite->setWidthHeight(wh.x(),wh.y());
 						ite->Clip = FlattenPath(ite->PoLine, ite->Segments);
-						m_Doc->AdjustItemSize(ite);
+						m_Doc->AdjustItemSize(ite, true);
 						ite->setItemName( tr("Group%1").arg(m_Doc->GroupCounter));
 						ite->AutoName = false;
 						ite->setTextFlowMode(PageItem::TextFlowDisabled);
@@ -656,7 +656,7 @@
 							FPoint wh = getMaxClipF(&ite->PoLine);
 							ite->setWidthHeight(wh.x(),wh.y());
 							ite->Clip = FlattenPath(ite->PoLine, ite->Segments);
-							m_Doc->AdjustItemSize(ite);
+							m_Doc->AdjustItemSize(ite, true);
 							ite->setItemName( tr("Group%1").arg(m_Doc->GroupCounter));
 							ite->AutoName = false;
 							ite->setTextFlowMode(PageItem::TextFlowDisabled);

Modified: branches/ScribusOIF/scribus/plugins/svgexplugin/svgexplugin.cpp
URL: http://scribus.info/websvn/diff.php?repname=Scribus&rev=16244&path=/branches/ScribusOIF/scribus/plugins/svgexplugin/svgexplugin.cpp
==============================================================================
--- branches/ScribusOIF/scribus/plugins/svgexplugin/svgexplugin.cpp (original)
+++ branches/ScribusOIF/scribus/plugins/svgexplugin/svgexplugin.cpp Wed Jan 12 11:15:30 2011
@@ -28,7 +28,7 @@
 #include <QBuffer>
 #include <QList>
 #include <QCheckBox>
-#include <QSharedPointer>
+#include <QScopedPointer>
 
 #include "svgexplugin.h"
 
@@ -124,7 +124,7 @@
 	{
 		PrefsContext* prefs = PrefsManager::instance()->prefsFile->getPluginContext("svgex");
 		QString wdir = prefs->get("wdir", ".");
-		QSharedPointer<CustomFDialog> openDia( new CustomFDialog(doc->scMW(), wdir, QObject::tr("Save as"), QObject::tr("%1;;All Files (*)").arg(FormatsManager::instance()->extensionsForFormat(FormatsManager::SVG)), fdHidePreviewCheckBox) );
+		QScopedPointer<CustomFDialog> openDia( new CustomFDialog(doc->scMW(), wdir, QObject::tr("Save as"), QObject::tr("%1;;All Files (*)").arg(FormatsManager::instance()->extensionsForFormat(FormatsManager::SVG)), fdHidePreviewCheckBox) );
 		openDia->setSelection(getFileNameByPage(doc, doc->currentPage()->pageNr(), "svg"));
 		openDia->setExtension("svg");
 		openDia->setZipExtension("svgz");
@@ -157,7 +157,6 @@
 		Options.inlineImages = inlineImages->isChecked();
 		Options.exportPageBackground = exportBack->isChecked();
 		Options.compressFile = compress->isChecked();
-		openDia.clear();
 
 		if (fileName.isEmpty())
 			return true;
@@ -209,6 +208,7 @@
 	docElement.setAttribute("height", FToStr(pageHeight)+"pt");
 	docElement.setAttribute("viewBox", QString("0 0 %1 %2").arg(pageWidth).arg(pageHeight));
 	docElement.setAttribute("xmlns", "http://www.w3.org/2000/svg");
+	docElement.setAttribute("xmlns:inkscape","http://www.inkscape.org/namespaces/inkscape");
 	docElement.setAttribute("xmlns:xlink","http://www.w3.org/1999/xlink");
 	docElement.setAttribute("version","1.1");
 	if (!m_Doc->documentInfo().title().isEmpty())
@@ -292,6 +292,8 @@
 
 	layerGroup = docu.createElement("g");
 	layerGroup.setAttribute("id", layer.Name);
+	layerGroup.setAttribute("inkscape:label", layer.Name);
+	layerGroup.setAttribute("inkscape:groupmode", "layer");
 	if (layer.transparency != 1.0)
 		layerGroup.setAttribute("opacity", FToStr(layer.transparency));
 	for(int j = 0; j < Items.count(); ++j)

Modified: branches/ScribusOIF/scribus/scribusdoc.cpp
URL: http://scribus.info/websvn/diff.php?repname=Scribus&rev=16244&path=/branches/ScribusOIF/scribus/scribusdoc.cpp
==============================================================================
--- branches/ScribusOIF/scribus/scribusdoc.cpp (original)
+++ branches/ScribusOIF/scribus/scribusdoc.cpp Wed Jan 12 11:15:30 2011
@@ -246,6 +246,8 @@
 	docPrefsData.pdfPrefs.useDocBleeds = true;
 	Print_Options.firstUse = true;
 	drawAsPreview = false;
+	viewAsPreview = false;
+	previewVisual = -1;
 }
 
 
@@ -337,6 +339,8 @@
 	docPrefsData.docSetupPrefs.pagePositioning=pagesSetup.pageArrangement;
 	Print_Options.firstUse = true;
 	drawAsPreview = false;
+	viewAsPreview = false;
+	previewVisual = -1;
 }
 
 
@@ -3755,10 +3759,10 @@
 		{
 			const ScColor& col = PageColors[cstops.at(cst)->name];
 			QColor tmp = ScColorEngine::getShadeColorProof(col, this, cstops.at(cst)->shade);
-			if ((view()) && (view()->m_canvas->usePreviewVisual()))
+			if (viewAsPreview)
 			{
 				VisionDefectColor defect;
-				tmp = defect.convertDefect(tmp, view()->m_canvas->previewVisual());
+				tmp = defect.convertDefect(tmp, previewVisual);
 			}
 			cstops.at(cst)->color = tmp;
 		}
@@ -7296,10 +7300,6 @@
 			connect(this, SIGNAL(firstSelectedItemType(int)), m_ScMW, SLOT(HaveNewSel(int)));
 			connect(autoSaveTimer, SIGNAL(timeout()), WinHan, SLOT(slotAutoSave()));
 		}
-//		connect(this, SIGNAL(refreshItem(PageItem*)), view(), SLOT(RefreshItem(PageItem*)));
-//		connect(this, SIGNAL(updateContents()), view(), SLOT(slotUpdateContents()));
-//		connect(this, SIGNAL(updateContents(const QRect&)), view(), SLOT(slotUpdateContents(const QRect&)));
-//		connect(this, SIGNAL(canvasAdjusted(double, double, double, double)), view(), SLOT(adjustCanvas(double, double, double, double)));
 	}
 }
 

Modified: branches/ScribusOIF/scribus/scribusdoc.h
URL: http://scribus.info/websvn/diff.php?repname=Scribus&rev=16244&path=/branches/ScribusOIF/scribus/scribusdoc.h
==============================================================================
--- branches/ScribusOIF/scribus/scribusdoc.h (original)
+++ branches/ScribusOIF/scribus/scribusdoc.h Wed Jan 12 11:15:30 2011
@@ -1172,6 +1172,8 @@
 	QWidget* WinHan;
 	bool DoDrawing;
 	bool drawAsPreview;
+	bool viewAsPreview;
+	int previewVisual;
 	struct OpenNodesList
 	{
 		int type;

Modified: branches/ScribusOIF/scribus/scribusview.cpp
URL: http://scribus.info/websvn/diff.php?repname=Scribus&rev=16244&path=/branches/ScribusOIF/scribus/scribusview.cpp
==============================================================================
--- branches/ScribusOIF/scribus/scribusview.cpp (original)
+++ branches/ScribusOIF/scribus/scribusview.cpp Wed Jan 12 11:15:30 2011
@@ -408,6 +408,8 @@
 void ScribusView::switchPreviewVisual(int vis)
 {
 	m_canvas->setPreviewVisual(vis);
+	Doc->viewAsPreview = m_canvas->usePreviewVisual();
+	Doc->previewVisual = m_canvas->previewVisual();
 	Doc->recalculateColors();
 	Doc->recalcPicturesRes();
 	DrawNew();




More information about the scribus-commit mailing list