r14992 by cbradney - Move bleeds and margin preset into docprefsdata

scribus-commit scribus-commit at lists.scribus.net
Wed Apr 21 21:11:37 CEST 2010


Revision: 14992
Author: cbradney
Date: 2010-04-21T19:07:18.433065Z
Commit message: Move bleeds and margin preset into docprefsdata

Changeset: 
M  /trunk/Scribus/scribus/canvasmode_normal.cpp
M  /trunk/Scribus/scribus/ui/printdialog.cpp
M  /trunk/Scribus/scribus/ui/tabpdfoptions.cpp
M  /trunk/Scribus/scribus/plugins/fileloader/scribus134format/scribus134format_save.cpp
M  /trunk/Scribus/scribus/canvasmode_framelinks.cpp
M  /trunk/Scribus/scribus/ui/reformdoc.cpp
M  /trunk/Scribus/scribus/scribusdoc.cpp
M  /trunk/Scribus/scribus/guidemanagercore.cpp
M  /trunk/Scribus/scribus/plugins/fileloader/scribus12format/scribus12format.cpp
M  /trunk/Scribus/scribus/canvasmode_legacy.cpp
M  /trunk/Scribus/scribus/scribusdoc.h
M  /trunk/Scribus/scribus/plugins/fileloader/scribus13format/scribus13format.cpp
M  /trunk/Scribus/scribus/plugins/fileloader/scribus150format/scribus150format.cpp
M  /trunk/Scribus/scribus/scribus.cpp
M  /trunk/Scribus/scribus/canvas.cpp
M  /trunk/Scribus/scribus/guidesdelegate.cpp
M  /trunk/Scribus/scribus/plugins/fileloader/scribus134format/scribus134format.cpp
M  /trunk/Scribus/scribus/ui/tabdocument.cpp
M  /trunk/Scribus/scribus/canvasmode_edit.cpp
M  /trunk/Scribus/scribus/ui/about.cpp
M  /trunk/Scribus/scribus/canvasmode_copyproperties.cpp
M  /trunk/Scribus/scribus/plugins/fileloader/scribus150format/scribus150format_save.cpp
M  /trunk/Scribus/scribus/ui/tabdocument.h

Diffs:
Index: scribus/canvasmode_legacy.cpp
===================================================================
--- scribus/canvasmode_legacy.cpp	(revision 14991)
+++ scribus/canvasmode_legacy.cpp	(revision 14992)
@@ -4302,7 +4302,7 @@
 		int docPageCount = static_cast<int>(m_doc->Pages->count() - 1);
 		MarginStruct pageBleeds;
 		bool drawBleed = false;
-		if (m_doc->bleeds.hasNonZeroValue() && m_doc->guidesPrefs().showBleed)
+		if (m_doc->bleeds()->hasNonZeroValue() && m_doc->guidesPrefs().showBleed)
 			drawBleed = true;
 		for (int a = docPageCount; a > -1; a--)
 		{
Index: scribus/guidesdelegate.cpp
===================================================================
--- scribus/guidesdelegate.cpp	(revision 14991)
+++ scribus/guidesdelegate.cpp	(revision 14992)
@@ -75,9 +75,9 @@
 	Q_ASSERT_X(m_doc != 0, "GuidesHDelegate::createEditor",
 			   "No reference to the doc");
 	double uix = unitGetRatioFromIndex(m_doc->unitIndex());
-	double min = 0.0 - (m_doc->bleeds.Top * uix);
+	double min = 0.0 - (m_doc->bleeds()->Top * uix);
 	double max = (m_doc->currentPage()->height() * uix)
-	             + (m_doc->bleeds.Bottom * uix);
+				 + (m_doc->bleeds()->Bottom * uix);
 	ScrSpinBox *editor =
 			new ScrSpinBox(min,
 						   max,
@@ -99,9 +99,9 @@
 	Q_ASSERT_X(m_doc != 0, "GuidesVDelegate::createEditor",
 			   "No reference to the doc");
 	double uix = unitGetRatioFromIndex(m_doc->unitIndex());
-	double min = 0.0 - (m_doc->bleeds.Left * uix);
+	double min = 0.0 - (m_doc->bleeds()->Left * uix);
 	double max = (m_doc->currentPage()->width() * uix)
-	             + (m_doc->bleeds.Right * uix);
+				 + (m_doc->bleeds()->Right * uix);
 	ScrSpinBox *editor =
 			new ScrSpinBox(min,
 						   max,
Index: scribus/canvasmode_copyproperties.cpp
===================================================================
--- scribus/canvasmode_copyproperties.cpp	(revision 14991)
+++ scribus/canvasmode_copyproperties.cpp	(revision 14992)
@@ -250,7 +250,7 @@
 		int docPageCount = static_cast<int>(m_doc->Pages->count() - 1);
 		MarginStruct pageBleeds;
 		bool drawBleed = false;
-		if (m_doc->bleeds.hasNonZeroValue() && m_doc->guidesPrefs().showBleed)
+		if (m_doc->bleeds()->hasNonZeroValue() && m_doc->guidesPrefs().showBleed)
 			drawBleed = true;
 		for (int a = docPageCount; a > -1; a--)
 		{
Index: scribus/scribusdoc.cpp
===================================================================
--- scribus/scribusdoc.cpp	(revision 14991)
+++ scribus/scribusdoc.cpp	(revision 14992)
@@ -266,8 +266,8 @@
 	docPrefsData.docSetupPrefs.pageWidth=0;
 	maxCanvasCoordinate=(FPoint(docPrefsData.displayPrefs.scratch.Left + docPrefsData.displayPrefs.scratch.Right, docPrefsData.displayPrefs.scratch.Top + docPrefsData.displayPrefs.scratch.Bottom)),
 	init();
-	bleeds = appPrefsData.docSetupPrefs.bleeds;
-	docPrefsData.pdfPrefs.bleeds = bleeds;
+	//->Prefs bleeds = appPrefsData.docSetupPrefs.bleeds;
+	docPrefsData.pdfPrefs.bleeds = docPrefsData.docSetupPrefs.bleeds;
 	docPrefsData.pdfPrefs.useDocBleeds = true;
 	Print_Options.firstUse = true;
 }
@@ -310,7 +310,7 @@
 	m_Selection(new Selection(this, true)),
 	//->Prefs pageWidth(pagesize.width()), pageHeight(pagesize.height()),
 	pageMargins(margins),
-	marginPreset(appPrefsData.docSetupPrefs.marginPreset),
+	//->Prefs marginPreset(appPrefsData.docSetupPrefs.marginPreset),
 	//->Prefs pageSets(appPrefsData.pageSets),
 	PageSp(pagesSetup.columnCount), PageSpa(pagesSetup.columnDistance),
 	currentPageLayout(pagesSetup.pageArrangement),
@@ -389,8 +389,8 @@
 	setPageSetFirstPage(pagesSetup.pageArrangement, pagesSetup.firstPageLocation);
 	//->Prefs pageSets[pagesSetup.pageArrangement].FirstPage = pagesSetup.firstPageLocation;
 	init();
-	bleeds = appPrefsData.docSetupPrefs.bleeds;
-	docPrefsData.pdfPrefs.bleeds = bleeds;
+	//->Prefs bleeds = appPrefsData.docSetupPrefs.bleeds;
+	docPrefsData.pdfPrefs.bleeds = docPrefsData.docSetupPrefs.bleeds;
 	docPrefsData.pdfPrefs.useDocBleeds = true;
 	docPrefsData.docSetupPrefs.pageOrientation=pagesSetup.orientation;
 	Print_Options.firstUse = true;
@@ -1746,7 +1746,7 @@
 	addedPage->setPageNr(pageIndex);
 	addedPage->m_pageSize = docPrefsData.docSetupPrefs.pageSize;
 	addedPage->setOrientation(docPrefsData.docSetupPrefs.pageOrientation);
-	addedPage->marginPreset = marginPreset;
+	addedPage->marginPreset = docPrefsData.docSetupPrefs.marginPreset;
 	DocPages.insert(pageIndex, addedPage);
 	assert(DocPages.at(pageIndex)!=NULL);
 	setCurrentPage(addedPage);
@@ -1779,7 +1779,7 @@
 	addedPage->initialMargins.Right = pageMargins.Right;
 	addedPage->m_pageSize = docPrefsData.docSetupPrefs.pageSize;
 	addedPage->setOrientation(docPrefsData.docSetupPrefs.pageOrientation);
-	addedPage->marginPreset = marginPreset;
+	addedPage->marginPreset = docPrefsData.docSetupPrefs.marginPreset;
 	addedPage->MPageNam = "";
 	addedPage->setPageName(pageName);
 	addedPage->setPageNr(pageNumber);
@@ -4312,8 +4312,8 @@
 		else
 		if (iafData.positionType==2) // Frame starts at top left of page - bleeds
 		{
-			x1=targetPage->xOffset()-bleeds.Left;
-			y1=targetPage->yOffset()-bleeds.Top;
+			x1=targetPage->xOffset()-docPrefsData.docSetupPrefs.bleeds.Left;
+			y1=targetPage->yOffset()-docPrefsData.docSetupPrefs.bleeds.Top;
 		}
 		else if (iafData.positionType==3) // Frame starts at custom position
 		{
@@ -4334,8 +4334,8 @@
 		else
 		if (iafData.sizeType==2) // Frame is size of page + bleed 
 		{
-			w1=targetPage->width()+bleeds.Right+bleeds.Left;
-			h1=targetPage->height()+bleeds.Bottom+bleeds.Top;
+			w1=targetPage->width()+docPrefsData.docSetupPrefs.bleeds.Right+docPrefsData.docSetupPrefs.bleeds.Left;
+			h1=targetPage->height()+docPrefsData.docSetupPrefs.bleeds.Bottom+docPrefsData.docSetupPrefs.bleeds.Top;
 		}
 		else if (iafData.sizeType==3) //Frame is size of imported image, we resize below when we load it
 		{
@@ -4714,10 +4714,10 @@
 	int retw = -1;
 	if (masterPageMode())
 	{
-		int x = static_cast<int>(currentPage()->xOffset() - bleeds.Left);
-		int y = static_cast<int>(currentPage()->yOffset() - bleeds.Top);
-		int w = static_cast<int>(currentPage()->width() + bleeds.Left + bleeds.Right);
-		int h = static_cast<int>(currentPage()->height() + bleeds.Bottom + bleeds.Top);
+		int x = static_cast<int>(currentPage()->xOffset() - docPrefsData.docSetupPrefs.bleeds.Left);
+		int y = static_cast<int>(currentPage()->yOffset() - docPrefsData.docSetupPrefs.bleeds.Top);
+		int w = static_cast<int>(currentPage()->width() + docPrefsData.docSetupPrefs.bleeds.Left + docPrefsData.docSetupPrefs.bleeds.Right);
+		int h = static_cast<int>(currentPage()->height() + docPrefsData.docSetupPrefs.bleeds.Bottom + docPrefsData.docSetupPrefs.bleeds.Top);
 		if (QRect(x, y, w, h).contains(qRound(x2), qRound(y2)))
 			retw = currentPage()->pageNr();
 	}
@@ -4754,10 +4754,10 @@
 		int h = static_cast<int>(currentPage()->height());
 		QRect itemRect(qRound(currItem->BoundingX), qRound(currItem->BoundingY), qRound(currItem->BoundingW), qRound(currItem->BoundingH));
 		if (QRect(x, y, w, h).intersects(itemRect)) */
-		double x = currentPage()->xOffset() - bleeds.Left;
-		double y = currentPage()->yOffset() - bleeds.Top;
-		double w = currentPage()->width() + bleeds.Left + bleeds.Right;
-		double h1 = currentPage()->height() + bleeds.Bottom + bleeds.Top;
+		double x = currentPage()->xOffset() - docPrefsData.docSetupPrefs.bleeds.Left;
+		double y = currentPage()->yOffset() - docPrefsData.docSetupPrefs.bleeds.Top;
+		double w = currentPage()->width() + docPrefsData.docSetupPrefs.bleeds.Left + docPrefsData.docSetupPrefs.bleeds.Right;
+		double h1 = currentPage()->height() + docPrefsData.docSetupPrefs.bleeds.Bottom + docPrefsData.docSetupPrefs.bleeds.Top;
 		double x2 = currItem->BoundingX;
 		double y2 = currItem->BoundingY;
 		double w2 = currItem->BoundingW;
@@ -5025,7 +5025,7 @@
 
 void ScribusDoc::getBleeds(const Page* page, MarginStruct& bleedData)
 {
-	getBleeds(page, bleeds, bleedData);
+	getBleeds(page, docPrefsData.docSetupPrefs.bleeds, bleedData);
 }
 
 void ScribusDoc::getBleeds(const Page* page, const MarginStruct& baseValues, MarginStruct& bleedData)
Index: scribus/canvasmode_edit.cpp
===================================================================
--- scribus/canvasmode_edit.cpp	(revision 14991)
+++ scribus/canvasmode_edit.cpp	(revision 14992)
@@ -942,7 +942,7 @@
 		int docPageCount = static_cast<int>(m_doc->Pages->count() - 1);
 		MarginStruct pageBleeds;
 		bool drawBleed = false;
-		if (m_doc->bleeds.hasNonZeroValue() && m_doc->guidesPrefs().showBleed)
+		if (m_doc->bleeds()->hasNonZeroValue() && m_doc->guidesPrefs().showBleed)
 			drawBleed = true;
 		for (int a = docPageCount; a > -1; a--)
 		{
Index: scribus/guidemanagercore.cpp
===================================================================
--- scribus/guidemanagercore.cpp	(revision 14991)
+++ scribus/guidemanagercore.cpp	(revision 14992)
@@ -483,10 +483,10 @@
 		return;
 
 	// real painting margins including bleeds
-	double verticalFrom = 0.0 - doc->bleeds.Top;
-	double verticalTo = m_page->height() + doc->bleeds.Bottom;
-	double horizontalFrom = 0.0 - doc->bleeds.Left;
-	double horizontalTo = m_page->width() + doc->bleeds.Right;
+	double verticalFrom = 0.0 - doc->bleeds()->Top;
+	double verticalTo = m_page->height() + doc->bleeds()->Bottom;
+	double horizontalFrom = 0.0 - doc->bleeds()->Left;
+	double horizontalTo = m_page->width() + doc->bleeds()->Right;
 
 	// all standard
 	p->setPen(color, lineWidth, Qt::DashDotLine, Qt::FlatCap, Qt::MiterJoin);
Index: scribus/canvas.cpp
===================================================================
--- scribus/canvas.cpp	(revision 14991)
+++ scribus/canvas.cpp	(revision 14992)
@@ -1841,7 +1841,7 @@
 //		painter->beginLayer(1.0, 0);
 		painter->setAntialiasing(false);
 		painter->setPen(Qt::black, 1 / m_viewMode.scale, Qt::SolidLine, Qt::FlatCap, Qt::MiterJoin);
-		if (m_doc->bleeds.hasNonZeroValue() && m_doc->guidesPrefs().showBleed)
+		if (m_doc->bleeds()->hasNonZeroValue() && m_doc->guidesPrefs().showBleed)
 		{
 //			painter->drawRect(m_doc->scratch.Left - bleedLeft+5 / m_viewMode.scale, m_doc->scratch.Top - bleedTop+5 / m_viewMode.scale, m_doc->currentPage()->width() + bleedLeft + bleedRight, m_doc->currentPage()->height() + bleedBottom + bleedTop);
 			if (PrefsManager::instance()->appPrefs.displayPrefs.showPageShadow)
@@ -1908,7 +1908,7 @@
 				}
 //				painter->drawRect(blx2 + 5 /* m_viewMode.scale */, bly2 + 5 /* m_viewMode.scale */, blw2, blh2);
 				painter->drawRect(blx2 + 5, bly2 + 5, blw2, blh2);
-				if (m_doc->bleeds.hasNonZeroValue() && m_doc->guidesPrefs().showBleed)
+				if (m_doc->bleeds()->hasNonZeroValue() && m_doc->guidesPrefs().showBleed)
 				{
 					painter->setFillMode(ScPainter::None);
 					painter->setPen(Qt::black, 1.0 / m_viewMode.scale, Qt::SolidLine, Qt::FlatCap, Qt::MiterJoin);
@@ -1930,7 +1930,7 @@
 		double w = actPg->width();
 		double h = actPg->height();
 		bool drawBleed = false;
-		if (((m_doc->bleeds.Bottom != 0.0) || (m_doc->bleeds.Top != 0.0) || (m_doc->bleeds.Left != 0.0) || (m_doc->bleeds.Right != 0.0)) && (m_doc->guidesPrefs().showBleed))
+		if (((m_doc->bleeds()->Bottom != 0.0) || (m_doc->bleeds()->Top != 0.0) || (m_doc->bleeds()->Left != 0.0) || (m_doc->bleeds()->Right != 0.0)) && (m_doc->guidesPrefs().showBleed))
 		{
 			drawBleed = true;
 			m_doc->getBleeds(a, pageBleeds);
Index: scribus/canvasmode_framelinks.cpp
===================================================================
--- scribus/canvasmode_framelinks.cpp	(revision 14991)
+++ scribus/canvasmode_framelinks.cpp	(revision 14992)
@@ -343,7 +343,7 @@
 		int docPageCount = static_cast<int>(m_doc->Pages->count() - 1);
 		MarginStruct pageBleeds;
 		bool drawBleed = false;
-		if (m_doc->bleeds.hasNonZeroValue() && m_doc->guidesPrefs().showBleed)
+		if (m_doc->bleeds()->hasNonZeroValue() && m_doc->guidesPrefs().showBleed)
 			drawBleed = true;
 		for (int a = docPageCount; a > -1; a--)
 		{
Index: scribus/scribusdoc.h
===================================================================
--- scribus/scribusdoc.h	(revision 14991)
+++ scribus/scribusdoc.h	(revision 14992)
@@ -146,6 +146,7 @@
 
 
 	MarginStruct* scratch() { return &docPrefsData.displayPrefs.scratch; }
+	MarginStruct* bleeds() { return &docPrefsData.docSetupPrefs.bleeds; }
 	double pageGapHorizontal() const { return docPrefsData.displayPrefs.pageGapHorizontal; }
 	double pageGapVertical() const { return docPrefsData.displayPrefs.pageGapVertical; }
 	void setPageGapHorizontal(double h) { docPrefsData.displayPrefs.pageGapHorizontal=h; }
@@ -200,6 +201,8 @@
 	void setPageHeight(double h) { docPrefsData.docSetupPrefs.pageHeight=h; }
 	void setPageWidth(double w) { docPrefsData.docSetupPrefs.pageWidth=w; }
 	void setPageSize(const QString& s) { docPrefsData.docSetupPrefs.pageSize=s; }
+	int marginPreset() const { return docPrefsData.docSetupPrefs.marginPreset; }
+	void setMarginPreset(int mp) { docPrefsData.docSetupPrefs.marginPreset=mp; }
 
 	TypoPrefs& typographicPrefs() { return docPrefsData.typoPrefs; }
 	GuidesPrefs& guidesPrefs() { return docPrefsData.guidesPrefs; }
@@ -1048,9 +1051,9 @@
 	// int pageCount; Disabled CR no longer required
 	/** \brief Margins */
 	MarginStruct pageMargins;
-	int marginPreset;
+	//->Prefs int marginPreset;
 	//->Prefs QList<PageSet> pageSets;
-	MarginStruct bleeds;
+	//->Prefs MarginStruct bleeds;
 // 	double BleedTop;
 // 	double BleedLeft;
 // 	double BleedRight;
Index: scribus/ui/tabdocument.cpp
===================================================================
--- scribus/ui/tabdocument.cpp	(revision 14991)
+++ scribus/ui/tabdocument.cpp	(revision 14992)
@@ -242,37 +242,37 @@
 	unitChange();
 }
 
-void TabDocument::restoreDefaults(ScribusDoc *prefsData)
+void TabDocument::restoreDefaults(ScribusDoc *doc)
 {
 	disconnect(pageWidth, SIGNAL(valueChanged(double)), this, SLOT(setPageWidth(double)));
 	disconnect(pageHeight, SIGNAL(valueChanged(double)), this, SLOT(setPageHeight(double)));
 	disconnect(pageOrientationComboBox, SIGNAL(activated(int)), this, SLOT(setOrien(int)));
 	disconnect(pageSizeComboBox, SIGNAL(activated(const QString &)), this, SLOT(setPageSize()));
-	unitRatio = unitGetRatioFromIndex(prefsData->unitIndex());
+	unitRatio = unitGetRatioFromIndex(doc->unitIndex());
 
 //	setSize(prefsData->m_pageSize);
-	if (prefsData->pageSize() == CommonStrings::customPageSize)
+	if (doc->pageSize() == CommonStrings::customPageSize)
 		setCurrentComboItem(pageSizeComboBox, CommonStrings::trCustomPageSize);
 	else
-		setCurrentComboItem(pageSizeComboBox, prefsData->pageSize());
-	prefsPageSizeName = prefsData->pageSize();
+		setCurrentComboItem(pageSizeComboBox, doc->pageSize());
+	prefsPageSizeName = doc->pageSize();
 //	setOrien(prefsData->PageOri);
 
-	docLayout->selectItem(prefsData->currentPageLayout);
-	docLayout->firstPage->setCurrentIndex(prefsData->pageSets()[prefsData->currentPageLayout].FirstPage);
-	pageOrientationComboBox->setCurrentIndex(prefsData->pageOrientation());
-	unitCombo->setCurrentIndex(prefsData->unitIndex());
-	pageWidth->setValue(prefsData->pageWidth() * unitRatio);
-	pageHeight->setValue(prefsData->pageHeight() * unitRatio);
-	pageW = prefsData->pageWidth();
-	pageH = prefsData->pageHeight();
-	marginGroup->setNewBleeds(prefsData->bleeds);
-	marginGroup->setNewMargins(prefsData->pageMargins);
-	marginGroup->setPageWidthHeight(prefsData->pageWidth(), prefsData->pageHeight());
+	docLayout->selectItem(doc->currentPageLayout);
+	docLayout->firstPage->setCurrentIndex(doc->pageSets()[doc->currentPageLayout].FirstPage);
+	pageOrientationComboBox->setCurrentIndex(doc->pageOrientation());
+	unitCombo->setCurrentIndex(doc->unitIndex());
+	pageWidth->setValue(doc->pageWidth() * unitRatio);
+	pageHeight->setValue(doc->pageHeight() * unitRatio);
+	pageW = doc->pageWidth();
+	pageH = doc->pageHeight();
+	marginGroup->setNewBleeds(*doc->bleeds());
+	marginGroup->setNewMargins(doc->pageMargins);
+	marginGroup->setPageWidthHeight(doc->pageWidth(), doc->pageHeight());
 	marginGroup->setPageSize(prefsPageSizeName);
-	marginGroup->setMarginPreset(prefsData->marginPreset);
-	GroupAS->setChecked( prefsData->autoSave() );
-	ASTime->setValue(prefsData->autoSaveTime() / 1000 / 60);
+	marginGroup->setMarginPreset(doc->marginPreset());
+	GroupAS->setChecked( doc->autoSave() );
+	ASTime->setValue(doc->autoSaveTime() / 1000 / 60);
 	connect(pageWidth, SIGNAL(valueChanged(double)), this, SLOT(setPageWidth(double)));
 	connect(pageHeight, SIGNAL(valueChanged(double)), this, SLOT(setPageHeight(double)));
 	connect(pageOrientationComboBox, SIGNAL(activated(int)), this, SLOT(setOrien(int)));
Index: scribus/ui/about.cpp
===================================================================
--- scribus/ui/about.cpp	(revision 14991)
+++ scribus/ui/about.cpp	(revision 14992)
@@ -114,7 +114,7 @@
 	buildID = new QLabel( tab );
 	buildID->setAlignment(Qt::AlignCenter);
 	buildID->setTextInteractionFlags(Qt::TextSelectableByMouse);
-	QString BUILD_DAY = "17";
+	QString BUILD_DAY = "21";
 	QString BUILD_MONTH = CommonStrings::april;
 	QString BUILD_YEAR = "2010";
 	QString BUILD_TIME = "";
Index: scribus/ui/tabpdfoptions.cpp
===================================================================
--- scribus/ui/tabpdfoptions.cpp	(revision 14991)
+++ scribus/ui/tabpdfoptions.cpp	(revision 14992)
@@ -1499,10 +1499,10 @@
 		Opts.bleeds.Bottom = BleedBottom->value() / unitRatio;
 		Opts.bleeds.Right = BleedRight->value() / unitRatio;
 		Opts.bleeds.Left = BleedLeft->value() / unitRatio;
-		BleedTop->setValue(doc->bleeds.Top*unitRatio);
-		BleedBottom->setValue(doc->bleeds.Bottom*unitRatio);
-		BleedRight->setValue(doc->bleeds.Right*unitRatio);
-		BleedLeft->setValue(doc->bleeds.Left*unitRatio);
+		BleedTop->setValue(doc->bleeds()->Top*unitRatio);
+		BleedBottom->setValue(doc->bleeds()->Bottom*unitRatio);
+		BleedRight->setValue(doc->bleeds()->Right*unitRatio);
+		BleedLeft->setValue(doc->bleeds()->Left*unitRatio);
 		BleedTop->setEnabled(false);
 		BleedBottom->setEnabled(false);
 		BleedRight->setEnabled(false);
Index: scribus/ui/reformdoc.cpp
===================================================================
--- scribus/ui/reformdoc.cpp	(revision 14991)
+++ scribus/ui/reformdoc.cpp	(revision 14992)
@@ -233,7 +233,7 @@
 	currDoc->setPageSize(tabPage->prefsPageSizeName);
 	currDoc->setPageWidth(tabPage->pageW);
 	currDoc->setPageHeight(tabPage->pageH);
-	currDoc->marginPreset = tabPage->marginGroup->getMarginPreset();
+	currDoc->setMarginPreset(tabPage->marginGroup->getMarginPreset());
 	double TopD = tabView->topScratch->value() / currDoc->unitRatio() - currDoc->scratch()->Top;
 	double LeftD = tabView->leftScratch->value() / currDoc->unitRatio() - currDoc->scratch()->Left;
 	currDoc->scratch()->set(tabView->topScratch->value() / currDoc->unitRatio(), tabView->leftScratch->value() / currDoc->unitRatio(), tabView->bottomScratch->value() / currDoc->unitRatio(), tabView->rightScratch->value() / currDoc->unitRatio());
@@ -241,10 +241,7 @@
 //	currDoc->scratch.Left = tabView->leftScratch->value() / currDoc->unitRatio();
 //	currDoc->scratch.Right = tabView->rightScratch->value() / currDoc->unitRatio();
 //	currDoc->scratch.Top = tabView->topScratch->value() / currDoc->unitRatio();
-	currDoc->bleeds.Bottom = tabPage->marginGroup->bottomBleed();
-	currDoc->bleeds.Top = tabPage->marginGroup->topBleed();
-	currDoc->bleeds.Left = tabPage->marginGroup->leftBleed();
-	currDoc->bleeds.Right = tabPage->marginGroup->rightBleed();
+	currDoc->bleeds()->set(tabPage->marginGroup->topBleed(), tabPage->marginGroup->leftBleed(), tabPage->marginGroup->bottomBleed(), tabPage->marginGroup->rightBleed());
 	for (int p = 0; p < currDoc->Pages->count(); ++p)
 	{
 		Page *pp = currDoc->Pages->at(p);
@@ -260,7 +257,7 @@
 		if (tabPage->marginGroup->getMarginsForAllPages())
 		{
 			pp->initialMargins=updatedMargins;
-			pp->marginPreset=currDoc->marginPreset;
+			pp->marginPreset=currDoc->marginPreset();
 		}
 		else
 		if (tabPage->marginGroup->getMarginsForAllMasterPages())
@@ -276,7 +273,7 @@
 				pp->initialMargins.Bottom == mp->initialMargins.Bottom)
 			{
 				pp->initialMargins=updatedMargins;
-				pp->marginPreset=currDoc->marginPreset;
+				pp->marginPreset=currDoc->marginPreset();
 			}
 		}
 	}
@@ -295,7 +292,7 @@
 		if (tabPage->marginGroup->getMarginsForAllMasterPages())
 		{
 			pp->initialMargins=updatedMargins;
-			pp->marginPreset=currDoc->marginPreset;
+			pp->marginPreset=currDoc->marginPreset();
 		}
 		pp->setXOffset(currDoc->scratch()->Left);
 		pp->setYOffset(currDoc->scratch()->Top);
Index: scribus/ui/printdialog.cpp
===================================================================
--- scribus/ui/printdialog.cpp	(revision 14991)
+++ scribus/ui/printdialog.cpp	(revision 14992)
@@ -471,10 +471,7 @@
 	options.useSpotColors = prefs->getBool("doSpot", true);
 	options.useICC  = m_doc->HasCMS ? prefs->getBool("ICCinUse", false) : false;
 	options.useDocBleeds  = true;
-	options.bleeds.Top    = m_doc->bleeds.Top;
-	options.bleeds.Bottom = m_doc->bleeds.Bottom;
-	options.bleeds.Right  = m_doc->bleeds.Right;
-	options.bleeds.Left   = m_doc->bleeds.Left;
+	options.bleeds=*m_doc->bleeds();
 	options.markOffset = prefs->getDouble("markOffset",0.0);
 	options.cropMarks  = prefs->getBool("cropMarks", false);
 	options.bleedMarks = prefs->getBool("bleedMarks", false);
@@ -539,10 +536,10 @@
 	docBleeds->setChecked(m_doc->Print_Options.useDocBleeds);
 	if (docBleeds->isChecked())
 	{
-		BleedTop->setValue(m_doc->bleeds.Top*unitRatio);
-		BleedBottom->setValue(m_doc->bleeds.Bottom*unitRatio);
-		BleedRight->setValue(m_doc->bleeds.Right*unitRatio);
-		BleedLeft->setValue(m_doc->bleeds.Left*unitRatio);
+		BleedTop->setValue(m_doc->bleeds()->Top*unitRatio);
+		BleedBottom->setValue(m_doc->bleeds()->Bottom*unitRatio);
+		BleedRight->setValue(m_doc->bleeds()->Right*unitRatio);
+		BleedLeft->setValue(m_doc->bleeds()->Left*unitRatio);
 	}
 	else
 	{
@@ -674,10 +671,10 @@
 		prefs->set("BleedBottom", BleedBottom->value() / unitRatio);
 		prefs->set("BleedRight", BleedRight->value() / unitRatio);
 		prefs->set("BleedLeft", BleedLeft->value() / unitRatio);
-		BleedTop->setValue(m_doc->bleeds.Top*unitRatio);
-		BleedBottom->setValue(m_doc->bleeds.Bottom*unitRatio);
-		BleedRight->setValue(m_doc->bleeds.Right*unitRatio);
-		BleedLeft->setValue(m_doc->bleeds.Left*unitRatio);
+		BleedTop->setValue(m_doc->bleeds()->Top*unitRatio);
+		BleedBottom->setValue(m_doc->bleeds()->Bottom*unitRatio);
+		BleedRight->setValue(m_doc->bleeds()->Right*unitRatio);
+		BleedLeft->setValue(m_doc->bleeds()->Left*unitRatio);
 	}
 	else
 	{
Index: scribus/ui/tabdocument.h
===================================================================
--- scribus/ui/tabdocument.h	(revision 14991)
+++ scribus/ui/tabdocument.h	(revision 14992)
@@ -36,7 +36,7 @@
 	TabDocument(QWidget* parent = 0, const char* name = 0, const bool reform = false);
 	~TabDocument(){};
 	void restoreDefaults(struct ApplicationPrefs *prefsData);
-	void restoreDefaults(ScribusDoc *prefsData);
+	void restoreDefaults(ScribusDoc *doc);
 	void unitChange();
 	//! \brief Hide non-needed GUI for ReformDoc
 	void hideReform();
Index: scribus/scribus.cpp
===================================================================
--- scribus/scribus.cpp	(revision 14991)
+++ scribus/scribus.cpp	(revision 14992)
@@ -1699,10 +1699,7 @@
 			}
 			doFileNew(pageWidth, pageHeight, topMargin, leftMargin, rightMargin, bottomMargin, columnDistance, numberCols, autoframes, facingPages, dia->unitOfMeasureComboBox->currentIndex(), firstPage, orientation, 1, pagesize, true, pageCount, true, dia->marginGroup->getMarginPreset());
 			doc->setPageSetFirstPage(facingPages, firstPage);
-			doc->bleeds.Bottom = dia->bleedBottom();
-			doc->bleeds.Top = dia->bleedTop();
-			doc->bleeds.Left = dia->bleedLeft();
-			doc->bleeds.Right = dia->bleedRight();
+			doc->bleeds()->set(dia->bleedTop(), dia->bleedLeft(), dia->bleedBottom(), dia->bleedRight());
 			HaveNewDoc();
 			doc->reformPages(true);
 			// Don's disturb user with "save?" dialog just after new doc
@@ -1781,10 +1778,7 @@
 		if (doFileNew(pageWidth, pageHeight, topMargin, leftMargin, rightMargin, bottomMargin, columnDistance, numberCols, autoframes, facingPages, dia->unitOfMeasureComboBox->currentIndex(), firstPage, orientation, 1, pagesize, true, pageCount, true, dia->marginGroup->getMarginPreset()))
 		{
 			doc->setPageSetFirstPage(facingPages, firstPage);
-			doc->bleeds.Bottom = dia->bleedBottom();
-			doc->bleeds.Top = dia->bleedTop();
-			doc->bleeds.Left = dia->bleedLeft();
-			doc->bleeds.Right = dia->bleedRight();
+			doc->bleeds()->set(dia->bleedTop(), dia->bleedLeft(), dia->bleedBottom(), dia->bleedRight());
 			mainWindowStatusLabel->setText( tr("Ready"));
 			HaveNewDoc();
 			doc->reformPages(true);
@@ -1907,7 +1901,7 @@
 		recalcColors();
 	//CB NOTE should be all done now
 	tempDoc->setPage(width, height, topMargin, leftMargin, rightMargin, bottomMargin, columnCount, columnDistance, autoTextFrames, pageArrangement);
-	tempDoc->marginPreset = marginPreset;
+	tempDoc->setMarginPreset(marginPreset);
 	tempDoc->setMasterPageMode(false);
 	tempDoc->createDefaultMasterPages();
 	tempDoc->createNewDocPages(pageCount);
@@ -8091,7 +8085,7 @@
 		QString errorMsg;
 		parsePagesString(pageString, &pageNs, doc->DocPages.count());
 		if (doc->pdfOptions().useDocBleeds)
-			doc->pdfOptions().bleeds = doc->bleeds;
+			doc->pdfOptions().bleeds = *doc->bleeds();
 
 		if (doc->pdfOptions().doMultiFile)
 		{
Index: scribus/plugins/fileloader/scribus12format/scribus12format.cpp
===================================================================
--- scribus/plugins/fileloader/scribus12format/scribus12format.cpp	(revision 14991)
+++ scribus/plugins/fileloader/scribus12format/scribus12format.cpp	(revision 14992)
@@ -277,7 +277,7 @@
 		m_Doc->pageMargins.Right=qMax(0.0, ScCLocale::toDoubleC(dc.attribute("BORDERRIGHT")));
 		m_Doc->pageMargins.Top=qMax(0.0, ScCLocale::toDoubleC(dc.attribute("BORDERTOP")));
 		m_Doc->pageMargins.Bottom=qMax(0.0, ScCLocale::toDoubleC(dc.attribute("BORDERBOTTOM")));
-		m_Doc->marginPreset = dc.attribute("PRESET", "0").toInt();
+		m_Doc->setMarginPreset(dc.attribute("PRESET", "0").toInt());
 		m_Doc->setPageOrientation(dc.attribute("ORIENTATION", "0").toInt());
 		m_Doc->setPageSize(dc.attribute("PAGESIZE"));
 		m_Doc->FirstPnum = dc.attribute("FIRSTNUM", "1").toInt();
Index: scribus/plugins/fileloader/scribus13format/scribus13format.cpp
===================================================================
--- scribus/plugins/fileloader/scribus13format/scribus13format.cpp	(revision 14991)
+++ scribus/plugins/fileloader/scribus13format/scribus13format.cpp	(revision 14992)
@@ -338,7 +338,7 @@
 		m_Doc->pageMargins.Right = qMax(0.0, ScCLocale::toDoubleC("BORDERRIGHT"));
 		m_Doc->pageMargins.Top   = qMax(0.0, ScCLocale::toDoubleC("BORDERTOP"));
 		m_Doc->pageMargins.Bottom= qMax(0.0, ScCLocale::toDoubleC("BORDERBOTTOM"));
-		m_Doc->marginPreset = dc.attribute("PRESET", "0").toInt();
+		m_Doc->setMarginPreset(dc.attribute("PRESET", "0").toInt());
 		m_Doc->setHyphAutomatic(static_cast<bool>(dc.attribute("AUTOMATIC", "1").toInt()));
 		m_Doc->setHyphAutoCheck(static_cast<bool>(dc.attribute("AUTOCHECK", "0").toInt()));
 		m_Doc->GuideLock = static_cast<bool>(dc.attribute("GUIDELOCK", "0").toInt());
@@ -1193,7 +1193,7 @@
 	dc.setAttribute("BORDERRIGHT",m_Doc->pageMargins.Right);
 	dc.setAttribute("BORDERTOP",m_Doc->pageMargins.Top);
 	dc.setAttribute("BORDERBOTTOM",m_Doc->pageMargins.Bottom);
-	dc.setAttribute("PRESET",m_Doc->marginPreset);
+	dc.setAttribute("PRESET",m_Doc->marginPreset());
 	dc.setAttribute("ORIENTATION",m_Doc->pageOrientation());
 	dc.setAttribute("PAGESIZE",m_Doc->pageSize());
 	dc.setAttribute("FIRSTNUM",m_Doc->FirstPnum);
Index: scribus/plugins/fileloader/scribus150format/scribus150format_save.cpp
===================================================================
--- scribus/plugins/fileloader/scribus150format/scribus150format_save.cpp	(revision 14991)
+++ scribus/plugins/fileloader/scribus150format/scribus150format_save.cpp	(revision 14992)
@@ -86,11 +86,11 @@
 	docu.writeAttribute("BORDERRIGHT" , m_Doc->pageMargins.Right);
 	docu.writeAttribute("BORDERTOP"   , m_Doc->pageMargins.Top);
 	docu.writeAttribute("BORDERBOTTOM", m_Doc->pageMargins.Bottom);
-	docu.writeAttribute("PRESET"      ,m_Doc->marginPreset);
-	docu.writeAttribute("BleedTop"    , m_Doc->bleeds.Top);
-	docu.writeAttribute("BleedLeft"   , m_Doc->bleeds.Left);
-	docu.writeAttribute("BleedRight"  , m_Doc->bleeds.Right);
-	docu.writeAttribute("BleedBottom" , m_Doc->bleeds.Bottom);
+	docu.writeAttribute("PRESET"      ,m_Doc->marginPreset());
+	docu.writeAttribute("BleedTop"    , m_Doc->bleeds()->Top);
+	docu.writeAttribute("BleedLeft"   , m_Doc->bleeds()->Left);
+	docu.writeAttribute("BleedRight"  , m_Doc->bleeds()->Right);
+	docu.writeAttribute("BleedBottom" , m_Doc->bleeds()->Bottom);
 	docu.writeAttribute("ORIENTATION" , m_Doc->pageOrientation());
 	docu.writeAttribute("PAGESIZE"    , m_Doc->pageSize());
 	docu.writeAttribute("FIRSTNUM"    , m_Doc->FirstPnum);
Index: scribus/plugins/fileloader/scribus150format/scribus150format.cpp
===================================================================
--- scribus/plugins/fileloader/scribus150format/scribus150format.cpp	(revision 14991)
+++ scribus/plugins/fileloader/scribus150format/scribus150format.cpp	(revision 14992)
@@ -756,11 +756,11 @@
 	m_Doc->pageMargins.Right = qMax(0.0, attrs.valueAsDouble("BORDERRIGHT"));
 	m_Doc->pageMargins.Top   = qMax(0.0, attrs.valueAsDouble("BORDERTOP"));
 	m_Doc->pageMargins.Bottom= qMax(0.0, attrs.valueAsDouble("BORDERBOTTOM"));
-	m_Doc->marginPreset  = attrs.valueAsInt("PRESET", 0);
-	m_Doc->bleeds.Top    = attrs.valueAsDouble("BleedTop", 0.0);
-	m_Doc->bleeds.Left   = attrs.valueAsDouble("BleedLeft", 0.0);
-	m_Doc->bleeds.Right  = attrs.valueAsDouble("BleedRight", 0.0);
-	m_Doc->bleeds.Bottom = attrs.valueAsDouble("BleedBottom", 0.0);
+	m_Doc->setMarginPreset(attrs.valueAsInt("PRESET", 0));
+	m_Doc->bleeds()->Top    = attrs.valueAsDouble("BleedTop", 0.0);
+	m_Doc->bleeds()->Left   = attrs.valueAsDouble("BleedLeft", 0.0);
+	m_Doc->bleeds()->Right  = attrs.valueAsDouble("BleedRight", 0.0);
+	m_Doc->bleeds()->Bottom = attrs.valueAsDouble("BleedBottom", 0.0);
 	m_Doc->setHyphAutomatic(attrs.valueAsBool("AUTOMATIC", true));
 	m_Doc->setHyphAutoCheck(attrs.valueAsBool("AUTOCHECK", false));
 	m_Doc->GuideLock = attrs.valueAsBool("GUIDELOCK", false);
Index: scribus/plugins/fileloader/scribus134format/scribus134format_save.cpp
===================================================================
--- scribus/plugins/fileloader/scribus134format/scribus134format_save.cpp	(revision 14991)
+++ scribus/plugins/fileloader/scribus134format/scribus134format_save.cpp	(revision 14992)
@@ -83,11 +83,11 @@
 	docu.writeAttribute("BORDERRIGHT" , m_Doc->pageMargins.Right);
 	docu.writeAttribute("BORDERTOP"   , m_Doc->pageMargins.Top);
 	docu.writeAttribute("BORDERBOTTOM", m_Doc->pageMargins.Bottom);
-	docu.writeAttribute("PRESET"      ,m_Doc->marginPreset);
-	docu.writeAttribute("BleedTop"    , m_Doc->bleeds.Top);
-	docu.writeAttribute("BleedLeft"   , m_Doc->bleeds.Left);
-	docu.writeAttribute("BleedRight"  , m_Doc->bleeds.Right);
-	docu.writeAttribute("BleedBottom" , m_Doc->bleeds.Bottom);
+	docu.writeAttribute("PRESET"      , m_Doc->marginPreset());
+	docu.writeAttribute("BleedTop"    , m_Doc->bleeds()->Top);
+	docu.writeAttribute("BleedLeft"   , m_Doc->bleeds()->Left);
+	docu.writeAttribute("BleedRight"  , m_Doc->bleeds()->Right);
+	docu.writeAttribute("BleedBottom" , m_Doc->bleeds()->Bottom);
 	docu.writeAttribute("ORIENTATION" , m_Doc->pageOrientation());
 	docu.writeAttribute("PAGESIZE"    , m_Doc->pageSize());
 	docu.writeAttribute("FIRSTNUM"    , m_Doc->FirstPnum);
Index: scribus/plugins/fileloader/scribus134format/scribus134format.cpp
===================================================================
--- scribus/plugins/fileloader/scribus134format/scribus134format.cpp	(revision 14991)
+++ scribus/plugins/fileloader/scribus134format/scribus134format.cpp	(revision 14992)
@@ -751,11 +751,11 @@
 	m_Doc->pageMargins.Right = qMax(0.0, attrs.valueAsDouble("BORDERRIGHT"));
 	m_Doc->pageMargins.Top   = qMax(0.0, attrs.valueAsDouble("BORDERTOP"));
 	m_Doc->pageMargins.Bottom= qMax(0.0, attrs.valueAsDouble("BORDERBOTTOM"));
-	m_Doc->marginPreset  = attrs.valueAsInt("PRESET", 0);
-	m_Doc->bleeds.Top    = attrs.valueAsDouble("BleedTop", 0.0);
-	m_Doc->bleeds.Left   = attrs.valueAsDouble("BleedLeft", 0.0);
-	m_Doc->bleeds.Right  = attrs.valueAsDouble("BleedRight", 0.0);
-	m_Doc->bleeds.Bottom = attrs.valueAsDouble("BleedBottom", 0.0);
+	m_Doc->setMarginPreset(attrs.valueAsInt("PRESET", 0));
+	m_Doc->bleeds()->Top    = attrs.valueAsDouble("BleedTop", 0.0);
+	m_Doc->bleeds()->Left   = attrs.valueAsDouble("BleedLeft", 0.0);
+	m_Doc->bleeds()->Right  = attrs.valueAsDouble("BleedRight", 0.0);
+	m_Doc->bleeds()->Bottom = attrs.valueAsDouble("BleedBottom", 0.0);
 	m_Doc->setHyphAutomatic(attrs.valueAsBool("AUTOMATIC", true));
 	m_Doc->setHyphAutoCheck(attrs.valueAsBool("AUTOCHECK", false));
 	m_Doc->GuideLock = attrs.valueAsBool("GUIDELOCK", false);
Index: scribus/canvasmode_normal.cpp
===================================================================
--- scribus/canvasmode_normal.cpp	(revision 14991)
+++ scribus/canvasmode_normal.cpp	(revision 14992)
@@ -1069,7 +1069,7 @@
 		int docPageCount = static_cast<int>(m_doc->Pages->count() - 1);
 		MarginStruct pageBleeds;
 		bool drawBleed = false;
-		if (m_doc->bleeds.hasNonZeroValue() && m_doc->guidesPrefs().showBleed)
+		if (m_doc->bleeds()->hasNonZeroValue() && m_doc->guidesPrefs().showBleed)
 			drawBleed = true;
 		for (int a = docPageCount; a > -1; a--)
 		{




More information about the scribus-commit mailing list