r23275 by jghali - #15870: Remove some unused class variables, variables, ifs and commented out code <ale>

scribus-commit scribus-commit at lists.scribus.net
Thu Oct 24 14:27:55 UTC 2019


Author: jghali
Date: Thu Oct 24 14:27:54 2019
New Revision: 23275

URL: http://scribus.net/websvn/listing.php?repname=Scribus&sc=1&rev=23275
Log:
#15870: Remove some unused class variables, variables, ifs and commented out code <ale>

Modified:
    trunk/Scribus/scribus/plugins/import/pdf/importpdf.cpp
    trunk/Scribus/scribus/plugins/import/pdf/importpdf.h

Modified: trunk/Scribus/scribus/plugins/import/pdf/importpdf.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=23275&path=/trunk/Scribus/scribus/plugins/import/pdf/importpdf.cpp
==============================================================================
--- trunk/Scribus/scribus/plugins/import/pdf/importpdf.cpp	(original)
+++ trunk/Scribus/scribus/plugins/import/pdf/importpdf.cpp	Thu Oct 24 14:27:54 2019
@@ -143,30 +143,6 @@
 	}
 	return QImage();
 }
-/*	Old Code to be backed up
-	QString tmp, cmd1, cmd2;
-	QString pdfFile = QDir::toNativeSeparators(fName);
-	QString tmpFile = QDir::toNativeSeparators(ScPaths::tempFileDir() + "sc.png");
-	int ret = -1;
-	tmp.setNum(1);
-	QStringList args;
-	args.append("-r72");
-	args.append("-sOutputFile="+tmpFile);
-	args.append("-dFirstPage="+tmp);
-	args.append("-dLastPage="+tmp);
-	args.append(pdfFile);
-	ret = callGS(args);
-	if (ret == 0)
-	{
-		QImage image;
-		image.load(tmpFile);
-		QFile::remove(tmpFile);
-		image.setText("XSize", QString("%1").arg(image.width()));
-		image.setText("YSize", QString("%1").arg(image.height()));
-		return image;
-	}
-	return QImage();
-*/
 
 bool PdfPlug::import(const QString& fNameIn, const TransactionSettings& trSettings, int flags, bool showProgress)
 {
@@ -177,7 +153,6 @@
 	interactive = (flags & LoadSavePlugin::lfInteractive);
 	importerFlags = flags;
 	cancel = false;
-	double b, h;
 	bool ret = false;
 	QFileInfo fi = QFileInfo(fNameIn);
 	if ( !ScCore->usingGUI() )
@@ -206,28 +181,18 @@
 	else
 		progressDialog = nullptr;
 /* Set default Page to size defined in Preferences */
-	b = 0.0;
-	h = 0.0;
 	if (progressDialog)
 	{
 		progressDialog->setOverallProgress(1);
 		qApp->processEvents();
 	}
-	if (b == 0.0)
-		b = PrefsManager::instance().appPrefs.docSetupPrefs.pageWidth;
-	if (h == 0.0)
-		h = PrefsManager::instance().appPrefs.docSetupPrefs.pageHeight;
-	docWidth = b;
-	docHeight = h;
-	baseX = 0;
-	baseY = 0;
+	double docWidth = PrefsManager::instance().appPrefs.docSetupPrefs.pageWidth;
+	double docHeight = PrefsManager::instance().appPrefs.docSetupPrefs.pageHeight;
 	if (!interactive || (flags & LoadSavePlugin::lfInsertPage))
 	{
 		m_Doc->setPage(docWidth, docHeight, 0, 0, 0, 0, 0, 0, false, false);
 		m_Doc->addPage(0);
 		m_Doc->view()->addPage(0, true);
-		baseX = 0;
-		baseY = 0;
 	}
 	else
 	{
@@ -236,17 +201,9 @@
 			m_Doc=ScCore->primaryMainWindow()->doFileNew(docWidth, docHeight, 0, 0, 0, 0, 0, 0, false, 0, 0, 0, 0, 1, "Custom", true);
 			ScCore->primaryMainWindow()->HaveNewDoc();
 			ret = true;
-			baseX = 0;
-			baseY = 0;
-			baseX = m_Doc->currentPage()->xOffset();
-			baseY = m_Doc->currentPage()->yOffset();
 		}
 	}
-	if ((!ret) && (interactive))
-	{
-		baseX = m_Doc->currentPage()->xOffset();
-		baseY = m_Doc->currentPage()->yOffset();
-	}
+
 	if ((ret) || (!interactive))
 	{
 		if (docWidth > docHeight)
@@ -488,11 +445,6 @@
 						useMediaBox = gFalse;
 					if (cropped)
 						useMediaBox = gTrue;
-				/*	if (cb > Media_Box)
-					{
-						cropped = true;
-						contentRect = cb;
-					} */
 					delete optImp;
 					qApp->changeOverrideCursor(QCursor(Qt::WaitCursor));
 					if (progressDialog)

Modified: trunk/Scribus/scribus/plugins/import/pdf/importpdf.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=23275&path=/trunk/Scribus/scribus/plugins/import/pdf/importpdf.h
==============================================================================
--- trunk/Scribus/scribus/plugins/import/pdf/importpdf.h	(original)
+++ trunk/Scribus/scribus/plugins/import/pdf/importpdf.h	Thu Oct 24 14:27:54 2019
@@ -1,108 +1,104 @@
-/*
-For general Scribus (>=1.3.2) copyright and licensing information please refer
-to the COPYING file provided with the program. Following this notice may exist
-a copyright and/or license notice that predates the release of Scribus 1.3.2
-for which a new license (GPL+exception) is in place.
-*/
-#ifndef IMPORTPDF_H
-#define IMPORTPDF_H
-
-#include <QList>
-#include <QTransform>
-#include <QMultiMap>
-#include <QtGlobal>
-#include <QObject>
-#include <QString>
-#include <QTextStream>
-#include <QSizeF>
-#include <QBuffer>
-#include <QColor>
-#include <QBrush>
-#include <QPen>
-#include <QImage>
-
-#include "fpointarray.h"
-#include "importpdfconfig.h"
-#include "pluginapi.h"
-#include "pageitem.h"
-#include "sccolor.h"
-
-class QColor;
-class QMatrix;
-
-class MultiProgressDialog;
-class ScribusDoc;
-class Selection;
-class TransactionSettings;
-
-class GooString;
-class PDFDoc;
-
-//! \brief PDF importer plugin
-class PdfPlug : public QObject
-{
-	Q_OBJECT
-
-public:
-	/*!
-	\author Franz Schmid
-	\date
-	\brief Create the PDF importer window.
-	\param fName QString
-	\param flags combination of loadFlags
-	\param showProgress if progress must be displayed
-	\retval EPSPlug plugin
-	*/
-	PdfPlug( ScribusDoc* doc, int flags );
-	~PdfPlug();
-
-	/*!
-	\author Franz Schmid
-	\date
-	\brief Perform import.
-	\param fn QString
-	\param trSettings undo transaction settings
-	\param flags combination of loadFlags
-	\param showProgress if progress must be displayed
-	\retval bool true if import was ok
-	 */
-	bool import(const QString& fn, const TransactionSettings& trSettings, int flags, bool showProgress = true);
-	QImage readThumbnail(const QString& fn);
-	QImage readPreview(int pgNum, int width, int height, int box);
-	enum PDF_Box_Type
-	{
-		Media_Box	= 0,
-		Bleed_Box	= 1,
-		Trim_Box	= 2,
-		Crop_Box	= 3,
-		Art_Box		= 4
-	};
-
-private:
-	bool convert(const QString& fn);
-	QRectF getCBox(int box, int pgNum);
-	QString UnicodeParsedString(POPPLER_CONST GooString *s1);
-	
-	QList<PageItem*> Elements;
-	double baseX, baseY;
-	double docWidth;
-	double docHeight;
-	qreal scPg;
-
-	QStringList importedColors;
-
-	bool interactive;
-	MultiProgressDialog * progressDialog;
-	bool cancel;
-	ScribusDoc* m_Doc;
-	Selection* tmpSele;
-	int importerFlags;
-	int oldDocItemCount;
-	QString baseFile;
-	PDFDoc *m_pdfDoc;
-
-public slots:
-	void cancelRequested() { cancel = true; }
-};
-
-#endif
+/*
+For general Scribus (>=1.3.2) copyright and licensing information please refer
+to the COPYING file provided with the program. Following this notice may exist
+a copyright and/or license notice that predates the release of Scribus 1.3.2
+for which a new license (GPL+exception) is in place.
+*/
+#ifndef IMPORTPDF_H
+#define IMPORTPDF_H
+
+#include <QList>
+#include <QTransform>
+#include <QMultiMap>
+#include <QtGlobal>
+#include <QObject>
+#include <QString>
+#include <QTextStream>
+#include <QSizeF>
+#include <QBuffer>
+#include <QColor>
+#include <QBrush>
+#include <QPen>
+#include <QImage>
+
+#include "fpointarray.h"
+#include "importpdfconfig.h"
+#include "pluginapi.h"
+#include "pageitem.h"
+#include "sccolor.h"
+
+class QColor;
+class QMatrix;
+
+class MultiProgressDialog;
+class ScribusDoc;
+class Selection;
+class TransactionSettings;
+
+class GooString;
+class PDFDoc;
+
+//! \brief PDF importer plugin
+class PdfPlug : public QObject
+{
+	Q_OBJECT
+
+public:
+	/*!
+	\author Franz Schmid
+	\date
+	\brief Create the PDF importer window.
+	\param fName QString
+	\param flags combination of loadFlags
+	\param showProgress if progress must be displayed
+	\retval EPSPlug plugin
+	*/
+	PdfPlug( ScribusDoc* doc, int flags );
+	~PdfPlug();
+
+	/*!
+	\author Franz Schmid
+	\date
+	\brief Perform import.
+	\param fn QString
+	\param trSettings undo transaction settings
+	\param flags combination of loadFlags
+	\param showProgress if progress must be displayed
+	\retval bool true if import was ok
+	 */
+	bool import(const QString& fn, const TransactionSettings& trSettings, int flags, bool showProgress = true);
+	QImage readThumbnail(const QString& fn);
+	QImage readPreview(int pgNum, int width, int height, int box);
+	enum PDF_Box_Type
+	{
+		Media_Box	= 0,
+		Bleed_Box	= 1,
+		Trim_Box	= 2,
+		Crop_Box	= 3,
+		Art_Box		= 4
+	};
+
+private:
+	bool convert(const QString& fn);
+	QRectF getCBox(int box, int pgNum);
+	QString UnicodeParsedString(POPPLER_CONST GooString *s1);
+	
+	QList<PageItem*> Elements;
+
+	QStringList importedColors;
+
+	bool interactive;
+	MultiProgressDialog * progressDialog;
+	bool cancel;
+	ScribusDoc* m_Doc;
+	Selection* tmpSele;
+	int importerFlags;
+	int oldDocItemCount;
+	QString baseFile;
+	PDFDoc *m_pdfDoc;
+
+public slots:
+	void cancelRequested() { cancel = true; }
+};
+
+#endif




More information about the scribus-commit mailing list