r17245 by fschmid - Fixed unwanted resizing of the canvas area when importing vector files.

scribus-commit scribus-commit at lists.scribus.net
Fri Jan 27 21:05:48 UTC 2012


Author: fschmid
Date: Fri Jan 27 21:05:48 2012
New Revision: 17245

URL: http://scribus.net/websvn/listing.php?repname=Scribus&sc=1&rev=17245
Log:
Fixed unwanted resizing of the canvas area when importing vector files.

Modified:
    trunk/Scribus/scribus/canvasmode_normal.cpp
    trunk/Scribus/scribus/scribus.cpp
    trunk/Scribus/scribus/scribusdoc.cpp
    trunk/Scribus/scribus/scribusdoc.h
    trunk/Scribus/scribus/scribusview.cpp

Modified: trunk/Scribus/scribus/canvasmode_normal.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=17245&path=/trunk/Scribus/scribus/canvasmode_normal.cpp
==============================================================================
--- trunk/Scribus/scribus/canvasmode_normal.cpp (original)
+++ trunk/Scribus/scribus/canvasmode_normal.cpp Fri Jan 27 21:05:48 2012
@@ -1372,6 +1372,7 @@
 			m_ScMW->slotElemRead(fileName, pastePoint.x(), pastePoint.y(), true, false, m_doc, m_doc->view());
 		else
 		{
+			m_doc->dontResize = true;
 			FileLoader *fileLoader = new FileLoader(fileName);
 			int testResult = fileLoader->TestFile();
 			delete fileLoader;
@@ -1390,6 +1391,7 @@
 				m_doc->moveGroup(pastePoint.x() - x2, pastePoint.y() - y2);
 				m_ScMW->requestUpdate(reqColorsUpdate | reqLineStylesUpdate | reqTextStylesUpdate);
 			}
+			m_doc->dontResize = false;
 		}
 		for (int a = 0; a < m_doc->m_Selection->count(); ++a)
 		{

Modified: trunk/Scribus/scribus/scribus.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=17245&path=/trunk/Scribus/scribus/scribus.cpp
==============================================================================
--- trunk/Scribus/scribus/scribus.cpp (original)
+++ trunk/Scribus/scribus/scribus.cpp Fri Jan 27 21:05:48 2012
@@ -3474,7 +3474,9 @@
 				const FileFormat * fmt = LoadSavePlugin::getFormatById(testResult);
 				if( fmt )
 				{
+					doc->dontResize = true;
 					fmt->loadFile(fileName, LoadSavePlugin::lfUseCurrentPage|LoadSavePlugin::lfInteractive);
+					doc->dontResize = false;
 				}
 			}
 		}

Modified: trunk/Scribus/scribus/scribusdoc.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=17245&path=/trunk/Scribus/scribus/scribusdoc.cpp
==============================================================================
--- trunk/Scribus/scribus/scribusdoc.cpp (original)
+++ trunk/Scribus/scribus/scribusdoc.cpp Fri Jan 27 21:05:48 2012
@@ -269,6 +269,7 @@
 	drawAsPreview = false;
 	viewAsPreview = false;
 	previewVisual = -1;
+	dontResize = false;
 }
 
 
@@ -364,6 +365,7 @@
 	drawAsPreview = false;
 	viewAsPreview = false;
 	previewVisual = -1;
+	dontResize = false;
 }
 
 
@@ -8389,6 +8391,8 @@
 
 void ScribusDoc::adjustCanvas(FPoint minPos, FPoint maxPos, bool absolute)
 {
+	if (dontResize)
+		return;
 	double newMaxX, newMaxY, newMinX, newMinY;
 	if (absolute)
 	{

Modified: trunk/Scribus/scribus/scribusdoc.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=17245&path=/trunk/Scribus/scribus/scribusdoc.h
==============================================================================
--- trunk/Scribus/scribus/scribusdoc.h (original)
+++ trunk/Scribus/scribus/scribusdoc.h Fri Jan 27 21:05:48 2012
@@ -1116,6 +1116,7 @@
 	int viewID;
 	bool SnapGuides;
 	bool GuideLock;
+	bool dontResize;
 	/** \brief Minimum and Maximum Points of Document */
 	FPoint minCanvasCoordinate;
 	FPoint maxCanvasCoordinate;

Modified: trunk/Scribus/scribus/scribusview.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=17245&path=/trunk/Scribus/scribus/scribusview.cpp
==============================================================================
--- trunk/Scribus/scribus/scribusview.cpp (original)
+++ trunk/Scribus/scribus/scribusview.cpp Fri Jan 27 21:05:48 2012
@@ -1018,6 +1018,7 @@
 								// We disable undo here as we are only interested by the item creation undo actions
 								// We create them manually after import
 								undoManager->setUndoEnabled(false);
+								Doc->dontResize = true;
 								fmt->loadFile(url.toLocalFile(), LoadSavePlugin::lfUseCurrentPage|LoadSavePlugin::lfInteractive|LoadSavePlugin::lfScripted);
 								undoManager->setUndoEnabled(true);
 								if (Doc->m_Selection->count() > 0)
@@ -1046,6 +1047,7 @@
 									m_ScMW->requestUpdate(reqColorsUpdate | reqSymbolsUpdate | reqTextStylesUpdate | reqLineStylesUpdate);
 									undoManager->setUndoEnabled(true);
 								}
+								Doc->dontResize = false;
 							}
 						}
 					}




More information about the scribus-commit mailing list