r23598 by craig - Remove ScribusDoc::resetPage as it is just setting margins or page

scribus-commit scribus-commit at lists.scribus.net
Sun Apr 12 20:59:13 UTC 2020


Author: craig
Date: Sun Apr 12 20:59:12 2020
New Revision: 23598

URL: http://scribus.net/websvn/listing.php?repname=Scribus&sc=1&rev=23598
Log:
Remove ScribusDoc::resetPage as it is just setting margins or page
position and we have separate functions for that already. Add setBleeds

Modified:
    trunk/Scribus/scribus/plugins/import/pdf/importpdf.cpp
    trunk/Scribus/scribus/plugins/scriptplugin/cmddoc.cpp
    trunk/Scribus/scribus/scribusdoc.cpp
    trunk/Scribus/scribus/scribusdoc.h
    trunk/Scribus/scribus/ui/pagepalette_pages.cpp

Modified: trunk/Scribus/scribus/plugins/import/pdf/importpdf.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=23598&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	Sun Apr 12 20:59:12 2020
@@ -842,13 +842,13 @@
 							m_Doc->pdfOptions().PageLayout = PDFOptions::OneColumn;
 						else if ((pgl == Catalog::pageLayoutTwoColumnLeft) || (pgl == Catalog::pageLayoutTwoPageLeft))
 						{
-							m_Doc->resetPage(1);
+							m_Doc->setPagePositioning(1);
 							m_Doc->setPageSetFirstPage(1, 0);
 							m_Doc->pdfOptions().PageLayout = PDFOptions::TwoColumnLeft;
 						}
 						else if ((pgl == Catalog::pageLayoutTwoColumnRight) || (pgl == Catalog::pageLayoutTwoPageRight))
 						{
-							m_Doc->resetPage(1);
+							m_Doc->setPagePositioning(1);
 							m_Doc->setPageSetFirstPage(1, 1);
 							m_Doc->pdfOptions().PageLayout = PDFOptions::TwoColumnRight;
 						}

Modified: trunk/Scribus/scribus/plugins/scriptplugin/cmddoc.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=23598&path=/trunk/Scribus/scribus/plugins/scriptplugin/cmddoc.cpp
==============================================================================
--- trunk/Scribus/scribus/plugins/scriptplugin/cmddoc.cpp	(original)
+++ trunk/Scribus/scribus/plugins/scriptplugin/cmddoc.cpp	Sun Apr 12 20:59:12 2020
@@ -123,7 +123,7 @@
 
 	ScribusDoc* currentDoc = ScCore->primaryMainWindow()->doc;
 	ScribusView* currentView = ScCore->primaryMainWindow()->view;
-	currentDoc->resetPage(currentDoc->pagePositioning(), &margins);
+	currentDoc->setMargins(margins);
 	currentView->reformPages();
 	currentDoc->setModified(true);
 	currentView->GotoPage(currentDoc->currentPageNumber());

Modified: trunk/Scribus/scribus/scribusdoc.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=23598&path=/trunk/Scribus/scribus/scribusdoc.cpp
==============================================================================
--- trunk/Scribus/scribus/scribusdoc.cpp	(original)
+++ trunk/Scribus/scribus/scribusdoc.cpp	Sun Apr 12 20:59:12 2020
@@ -2308,12 +2308,6 @@
 	m_automaticTextFrames = atf;
 }
 
-void ScribusDoc::resetPage(int fp, MarginStruct* newMargins)
-{
-	if (newMargins != nullptr)
-		m_docPrefsData.docSetupPrefs.margins = *newMargins;
-	m_docPrefsData.docSetupPrefs.pagePositioning = fp;
-}
 
 
 bool ScribusDoc::AddFont(const QString& name, int fsize)

Modified: trunk/Scribus/scribus/scribusdoc.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=23598&path=/trunk/Scribus/scribus/scribusdoc.h
==============================================================================
--- trunk/Scribus/scribus/scribusdoc.h	(original)
+++ trunk/Scribus/scribus/scribusdoc.h	Sun Apr 12 20:59:12 2020
@@ -108,7 +108,6 @@
 	bool isModified() const;
 /** Setzt die Seitenattribute */
 	void setPage(double w, double h, double t, double l, double r, double b, double sp, double ab, bool atf, int fp);
-	void resetPage(int fp, MarginStruct* newMargins=nullptr);
 
 	/**
 	 * @brief Return the view associated with the document
@@ -136,8 +135,10 @@
 	MarginStruct* scratch() { return &m_docPrefsData.displayPrefs.scratch; }
 	MarginStruct* bleeds() { return &m_docPrefsData.docSetupPrefs.bleeds; }
 	MarginStruct& bleedsVal() { return m_docPrefsData.docSetupPrefs.bleeds; }
+	void setBleeds(MarginStruct& newBleeds) { m_docPrefsData.docSetupPrefs.bleeds = newBleeds; }
 	MarginStruct* margins() { return &m_docPrefsData.docSetupPrefs.margins; }
 	MarginStruct& marginsVal() { return m_docPrefsData.docSetupPrefs.margins; }
+	void setMargins(MarginStruct& newMargins) { m_docPrefsData.docSetupPrefs.margins = newMargins; }
 	double pageGapHorizontal() const { return m_docPrefsData.displayPrefs.pageGapHorizontal; }
 	double pageGapVertical() const { return m_docPrefsData.displayPrefs.pageGapVertical; }
 	void setPageGapHorizontal(double h) { m_docPrefsData.displayPrefs.pageGapHorizontal=h; }

Modified: trunk/Scribus/scribus/ui/pagepalette_pages.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=23598&path=/trunk/Scribus/scribus/ui/pagepalette_pages.cpp
==============================================================================
--- trunk/Scribus/scribus/ui/pagepalette_pages.cpp	(original)
+++ trunk/Scribus/scribus/ui/pagepalette_pages.cpp	Sun Apr 12 20:59:12 2020
@@ -170,7 +170,7 @@
 void PagePalette_Pages::handlePageLayout(int layout)
 {
 	pageLayout->selectFirstP(currView->m_doc->pageSets()[layout].FirstPage);
-	currView->m_doc->resetPage(layout);
+	currView->m_doc->setPagePositioning(layout);
 	currView->reformPages();
 	currView->DrawNew();
 	currView->GotoPage(currView->m_doc->currentPageNumber());




More information about the scribus-commit mailing list