r23215 by jghali - Small ScDocOutput refactoring

scribus-commit scribus-commit at lists.scribus.net
Wed Sep 25 11:36:03 UTC 2019


Author: jghali
Date: Wed Sep 25 11:36:03 2019
New Revision: 23215

URL: http://scribus.net/websvn/listing.php?repname=Scribus&sc=1&rev=23215
Log:
Small ScDocOutput refactoring

Modified:
    trunk/Scribus/scribus/scdocoutput.cpp
    trunk/Scribus/scribus/scdocoutput.h

Modified: trunk/Scribus/scribus/scdocoutput.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=23215&path=/trunk/Scribus/scribus/scdocoutput.cpp
==============================================================================
--- trunk/Scribus/scribus/scdocoutput.cpp	(original)
+++ trunk/Scribus/scribus/scdocoutput.cpp	Wed Sep 25 11:36:03 2019
@@ -9,7 +9,7 @@
 #include "scdocoutput.h"
 using namespace std;
 
-bool ScDocOutput::makeOutput(ScribusDoc* doc, vector<int>& pageNumbers)
+bool ScDocOutput::makeOutput(ScribusDoc* doc, const vector<int>& pageNumbers)
 {
 	if (!begin())
 		return false;
@@ -21,18 +21,15 @@
 	{
 		page = doc->Pages->at( pageNumbers[index] - 1 );
 		ScPageOutput* outputComponent = createPageOutputComponent(index + 1);
-		if (outputComponent != nullptr)
-		{
-			outputComponent->begin();
-			outputComponent->drawPage(page);
-			outputComponent->end();
-			delete outputComponent;
-		}
-		else
+		if (!outputComponent)
 		{
 			done = false;
 			break;
 		}
+		outputComponent->begin();
+		outputComponent->drawPage(page);
+		outputComponent->end();
+		delete outputComponent;
 	}
 	end();
 	return done;

Modified: trunk/Scribus/scribus/scdocoutput.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=23215&path=/trunk/Scribus/scribus/scdocoutput.h
==============================================================================
--- trunk/Scribus/scribus/scdocoutput.h	(original)
+++ trunk/Scribus/scribus/scdocoutput.h	Wed Sep 25 11:36:03 2019
@@ -26,9 +26,9 @@
 	virtual ScPageOutput* createPageOutputComponent(int pageIndex) { return nullptr; }
 
 public:
-virtual ~ScDocOutput() = default;
+	virtual ~ScDocOutput() = default;
 
-	virtual bool makeOutput(ScribusDoc* doc, std::vector<int>& pageNumbers);
+	virtual bool makeOutput(ScribusDoc* doc, const std::vector<int>& pageNumbers);
 };
 
 #endif




More information about the scribus-commit mailing list