r14991 by cbradney - Hide some more basic doc variables and progress the new doc setup code a little

scribus-commit scribus-commit at lists.scribus.net
Tue Apr 20 00:22:33 CEST 2010


Revision: 14991
Author: cbradney
Date: 2010-04-19T22:15:39.740829Z
Commit message: Hide some more basic doc variables and progress the new doc setup code a little

Changeset: 
M  /trunk/Scribus/scribus/plugins/fileloader/scribus134format/scribus134format_save.cpp
M  /trunk/Scribus/scribus/ui/reformdoc.cpp
M  /trunk/Scribus/scribus/scribusdoc.cpp
M  /trunk/Scribus/scribus/plugins/import/pct/importpct.cpp
M  /trunk/Scribus/scribus/ui/inspage.cpp
M  /trunk/Scribus/scribus/plugins/fileloader/scribus12format/scribus12format.cpp
M  /trunk/Scribus/scribus/ui/preferencesdialog.h
M  /trunk/Scribus/scribus/plugins/fileloader/scribus13format/scribus13format.cpp
M  /trunk/Scribus/scribus/plugins/scriptplugin/objpdffile.cpp
M  /trunk/Scribus/scribus/plugins/import/ai/importai.cpp
M  /trunk/Scribus/scribus/plugins/import/svg/svgplugin.cpp
M  /trunk/Scribus/scribus/pslib.cpp
M  /trunk/Scribus/scribus/plugins/fileloader/scribus150format/scribus150format.cpp
M  /trunk/Scribus/scribus/scribus.cpp
M  /trunk/Scribus/scribus/plugins/import/xar/importxar.cpp
M  /trunk/Scribus/scribus/plugins/saveastemplateplugin/satemplate.cpp
M  /trunk/Scribus/scribus/plugins/fileloader/scribus134format/scribus134format.cpp
M  /trunk/Scribus/scribus/plugins/import/drw/importdrw.cpp
M  /trunk/Scribus/scribus/plugins/import/wpg/importwpg.cpp
M  /trunk/Scribus/scribus/plugins/import/xfig/importxfig.cpp
M  /trunk/Scribus/scribus/plugins/pixmapexport/dialog.cpp
M  /trunk/Scribus/scribus/plugins/scriptplugin/objprinter.cpp
M  /trunk/Scribus/scribus/plugins/import/ps/importps.cpp
M  /trunk/Scribus/scribus/ui/pdfopts.cpp
M  /trunk/Scribus/scribus/ui/preferencesdialog.cpp
M  /trunk/Scribus/scribus/plugins/import/cgm/importcgm.cpp
M  /trunk/Scribus/scribus/plugins/scriptplugin/cmdpage.cpp
M  /trunk/Scribus/scribus/scribusdoc.h
M  /trunk/Scribus/scribus/plugins/import/wmf/wmfimport.cpp
M  /trunk/Scribus/scribus/scprintengine_ps.cpp
M  /trunk/Scribus/scribus/ui/tabdocument.cpp
M  /trunk/Scribus/scribus/plugins/scripter/api_document.cpp
M  /trunk/Scribus/scribus/plugins/scriptplugin/objimageexport.cpp
M  /trunk/Scribus/scribus/plugins/import/cvg/importcvg.cpp
M  /trunk/Scribus/scribus/plugins/fileloader/scribus150format/scribus150format_save.cpp
M  /trunk/Scribus/scribus/plugins/import/oodraw/oodrawimp.cpp

Diffs:
Index: scribus/scprintengine_ps.cpp
===================================================================
--- scribus/scprintengine_ps.cpp	(revision 14990)
+++ scribus/scprintengine_ps.cpp	(revision 14991)
@@ -50,8 +50,8 @@
 				// use gs to convert our PS to a lower version
 				QString tmp;
 				QStringList opts;
-				opts.append( QString("-dDEVICEWIDTHPOINTS=%1").arg(tmp.setNum(doc.pageWidth)) );
-				opts.append( QString("-dDEVICEHEIGHTPOINTS=%1").arg(tmp.setNum(doc.pageHeight)) );
+				opts.append( QString("-dDEVICEWIDTHPOINTS=%1").arg(tmp.setNum(doc.pageWidth())) );
+				opts.append( QString("-dDEVICEHEIGHTPOINTS=%1").arg(tmp.setNum(doc.pageHeight())) );
 				convertPS2PS(filename, filename + ".tmp", opts, options.prnEngine);
 				moveFile( filename + ".tmp", filename );
 			}
Index: scribus/scribusdoc.cpp
===================================================================
--- scribus/scribusdoc.cpp	(revision 14990)
+++ scribus/scribusdoc.cpp	(revision 14991)
@@ -190,11 +190,12 @@
 	MasterNames(),
 	Items(0), MasterItems(), DocItems(), FrameItems(),
 	m_Selection(new Selection(this, true)),
-	pageWidth(0), pageHeight(0),
+	//->Prefs pageWidth(0), pageHeight(0),
 	//->Prefs pageSets(appPrefsData.pageSets),
 	PageSp(1), PageSpa(0),
 	currentPageLayout(0),
-	PageOri(0), m_pageSize(),
+	//->Prefs PageOri(0),
+	//->Prefs m_pageSize(),
 	FirstPnum(1),
 	useRaster(false),
 	PageColors(this, true),
@@ -261,6 +262,8 @@
 	m_docUpdater(NULL)
 {
 	docUnitRatio=unitGetRatioFromIndex(docPrefsData.docSetupPrefs.docUnitIndex);
+	docPrefsData.docSetupPrefs.pageHeight=0;
+	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;
@@ -305,13 +308,14 @@
 	MasterNames(),
 	Items(0), MasterItems(), DocItems(), FrameItems(),
 	m_Selection(new Selection(this, true)),
-	pageWidth(pagesize.width()), pageHeight(pagesize.height()),
+	//->Prefs pageWidth(pagesize.width()), pageHeight(pagesize.height()),
 	pageMargins(margins),
 	marginPreset(appPrefsData.docSetupPrefs.marginPreset),
-//->Prefs	pageSets(appPrefsData.pageSets),
+	//->Prefs pageSets(appPrefsData.pageSets),
 	PageSp(pagesSetup.columnCount), PageSpa(pagesSetup.columnDistance),
 	currentPageLayout(pagesSetup.pageArrangement),
-	PageOri(pagesSetup.orientation), m_pageSize(pagesize.name()),
+	//->Prefs PageOri(pagesSetup.orientation),
+	//->Prefs m_pageSize(pagesize.name()),
 	FirstPnum(pagesSetup.firstPageNumber),
 	useRaster(false),
 	PageColors(this, true),
@@ -378,6 +382,9 @@
 	m_docUpdater(NULL)
 {
 	docPrefsData.docSetupPrefs.docUnitIndex=unitindex;
+	docPrefsData.docSetupPrefs.pageHeight=pagesize.height();
+	docPrefsData.docSetupPrefs.pageWidth=pagesize.width();
+	docPrefsData.docSetupPrefs.pageSize=pagesize.name();
 	maxCanvasCoordinate=(FPoint(docPrefsData.displayPrefs.scratch.Left + docPrefsData.displayPrefs.scratch.Right, docPrefsData.displayPrefs.scratch.Top + docPrefsData.displayPrefs.scratch.Bottom)),
 	setPageSetFirstPage(pagesSetup.pageArrangement, pagesSetup.firstPageLocation);
 	//->Prefs pageSets[pagesSetup.pageArrangement].FirstPage = pagesSetup.firstPageLocation;
@@ -385,6 +392,7 @@
 	bleeds = appPrefsData.docSetupPrefs.bleeds;
 	docPrefsData.pdfPrefs.bleeds = bleeds;
 	docPrefsData.pdfPrefs.useDocBleeds = true;
+	docPrefsData.docSetupPrefs.pageOrientation=pagesSetup.orientation;
 	Print_Options.firstUse = true;
 }
 
@@ -618,8 +626,8 @@
 	docPrefsData.docSetupPrefs.docUnitIndex=unitIndex;
 	setPageSetFirstPage(fp, firstLeft);
 	//->Prefs pageSets[fp].FirstPage = firstLeft;
-	PageOri = orientation;
-	m_pageSize = defaultPageSize;
+	docPrefsData.docSetupPrefs.pageOrientation = orientation;
+	docPrefsData.docSetupPrefs.pageSize = defaultPageSize;
 	FirstPnum = firstPageNumber;
 	currentPageLayout = fp;
 	setName(documentName);
@@ -1531,8 +1539,8 @@
 /** sets page properties */
 void ScribusDoc::setPage(double b, double h, double t, double l, double r, double bo, double sp, double ab, bool atf, int fp)
 {
-	pageWidth = b;
-	pageHeight = h;
+	docPrefsData.docSetupPrefs.pageWidth = b;
+	docPrefsData.docSetupPrefs.pageHeight = h;
 	pageMargins.Top = t;
 	pageMargins.Left = l;
 	pageMargins.Right = r;
@@ -1726,7 +1734,7 @@
 Page* ScribusDoc::addPage(const int pageIndex, const QString& masterPageName, const bool addAutoFrame)
 {
 	assert(masterPageMode()==false);
-	Page* addedPage = new Page(docPrefsData.displayPrefs.scratch.Left, DocPages.count()*(pageHeight+docPrefsData.displayPrefs.scratch.Bottom+docPrefsData.displayPrefs.scratch.Top)+docPrefsData.displayPrefs.scratch.Top, pageWidth, pageHeight);
+	Page* addedPage = new Page(docPrefsData.displayPrefs.scratch.Left, DocPages.count()*(docPrefsData.docSetupPrefs.pageHeight+docPrefsData.displayPrefs.scratch.Bottom+docPrefsData.displayPrefs.scratch.Top)+docPrefsData.displayPrefs.scratch.Top, docPrefsData.docSetupPrefs.pageWidth, docPrefsData.docSetupPrefs.pageHeight);
 	assert(addedPage!=NULL);
 	addedPage->setDocument(this);
 	addedPage->Margins.Top = pageMargins.Top;
@@ -1736,8 +1744,8 @@
 	addedPage->initialMargins.Left = pageMargins.Left;
 	addedPage->initialMargins.Right = pageMargins.Right;
 	addedPage->setPageNr(pageIndex);
-	addedPage->m_pageSize = m_pageSize;
-	addedPage->setOrientation(PageOri);
+	addedPage->m_pageSize = docPrefsData.docSetupPrefs.pageSize;
+	addedPage->setOrientation(docPrefsData.docSetupPrefs.pageOrientation);
 	addedPage->marginPreset = marginPreset;
 	DocPages.insert(pageIndex, addedPage);
 	assert(DocPages.at(pageIndex)!=NULL);
@@ -1758,7 +1766,7 @@
 {
 	//CB We dont create master pages (yet) with a pageCount based location
 	//Page* addedPage = new Page(ScratchLeft, MasterPages.count()*(pageHeight+ScratchBottom+ScratchTop)+ScratchTop, pageWidth, pageHeight);
-	Page* addedPage = new Page(docPrefsData.displayPrefs.scratch.Left, docPrefsData.displayPrefs.scratch.Top, pageWidth, pageHeight);
+	Page* addedPage = new Page(docPrefsData.displayPrefs.scratch.Left, docPrefsData.displayPrefs.scratch.Top, docPrefsData.docSetupPrefs.pageWidth, docPrefsData.docSetupPrefs.pageHeight);
 	assert(addedPage!=NULL);
 	addedPage->setDocument(this);
 	addedPage->Margins.Top = pageMargins.Top;
@@ -1769,8 +1777,8 @@
 	addedPage->initialMargins.Bottom = pageMargins.Bottom;
 	addedPage->initialMargins.Left = pageMargins.Left;
 	addedPage->initialMargins.Right = pageMargins.Right;
-	addedPage->m_pageSize = m_pageSize;
-	addedPage->setOrientation(PageOri);
+	addedPage->m_pageSize = docPrefsData.docSetupPrefs.pageSize;
+	addedPage->setOrientation(docPrefsData.docSetupPrefs.pageOrientation);
 	addedPage->marginPreset = marginPreset;
 	addedPage->MPageNam = "";
 	addedPage->setPageName(pageName);
@@ -1948,8 +1956,8 @@
 	{
 		int z = itemAdd(PageItem::TextFrame, PageItem::Unspecified,
 		                     addToPage->Margins.Left+addToPage->xOffset(),
-		                     addToPage->Margins.Top+addToPage->yOffset(), pageWidth-addToPage->Margins.Right-addToPage->Margins.Left,
-		                     pageHeight-addToPage->Margins.Bottom-addToPage->Margins.Top,
+							 addToPage->Margins.Top+addToPage->yOffset(), docPrefsData.docSetupPrefs.pageWidth-addToPage->Margins.Right-addToPage->Margins.Left,
+							 docPrefsData.docSetupPrefs.pageHeight-addToPage->Margins.Bottom-addToPage->Margins.Top,
 							 1, CommonStrings::None, docPrefsData.itemToolPrefs.shapeLineColor, true);
 		Items->at(z)->isAutoText = true;
 		Items->at(z)->Cols = qRound(PageSp);
@@ -4854,7 +4862,7 @@
 	double maxYPos=0.0, maxXPos=0.0;
 	double currentXPos=docPrefsData.displayPrefs.scratch.Left, currentYPos=docPrefsData.displayPrefs.scratch.Top, lastYPos=Pages->at(0)->initialHeight();
 //	currentXPos += (pageWidth+pageSets[currentPageLayout].GapHorizontal) * counter;
-	currentXPos += (pageWidth+docPrefsData.displayPrefs.pageGapHorizontal) * counter;
+	currentXPos += (docPrefsData.docSetupPrefs.pageWidth+docPrefsData.displayPrefs.pageGapHorizontal) * counter;
 
 	lastYPos = Pages->at(0)->initialHeight();
 	Page* Seite;
@@ -5553,7 +5561,7 @@
 			--destLocation;
 		else if (whereToInsert==2)
 			destLocation=DocPages.count();
-		Page* destination = new Page(docPrefsData.displayPrefs.scratch.Left, DocPages.count()*(pageHeight+docPrefsData.displayPrefs.scratch.Bottom+docPrefsData.displayPrefs.scratch.Top)+docPrefsData.displayPrefs.scratch.Top, pageWidth, pageHeight);
+		Page* destination = new Page(docPrefsData.displayPrefs.scratch.Left, DocPages.count()*(docPrefsData.docSetupPrefs.pageHeight+docPrefsData.displayPrefs.scratch.Bottom+docPrefsData.displayPrefs.scratch.Top)+docPrefsData.displayPrefs.scratch.Top, docPrefsData.docSetupPrefs.pageWidth, docPrefsData.docSetupPrefs.pageHeight);
 		destination->setDocument(this);
 		destination->setPageNr(destLocation);
 		lastDest = destination;
@@ -12107,5 +12115,420 @@
 	docPrefsData.pageSets[layout].FirstPage=fp;
 }
 
+void ScribusDoc::setNewPrefs(const ApplicationPrefs& prefsData)
+{
+	docPrefsData=prefsData;
 
+	/*
+	MarginStruct updatedMargins(tabPage->marginGroup->margins());
+	int fp = tabPage->choosenLayout;
+	currDoc->setPageSetFirstPage(fp, tabPage->docLayout->firstPage->currentIndex());
+//	currDoc->pageSets[fp].GapHorizontal = tabView->gapHorizontal->value() / currDoc->unitRatio();
+	currDoc->setPageGapHorizontal(tabView->gapHorizontal->value() / currDoc->unitRatio());
+	currDoc->setPageGapVertical(tabView->gapVertical->value() / currDoc->unitRatio());
+//	currDoc->pageSets[fp].GapBelow = tabView->gapVertical->value() / currDoc->unitRatio();
+	//currDoc->FirstPnum = pageNumber->value();
+	currDoc->resetPage(updatedMargins, fp);
+	currDoc->PageOri = tabPage->pageOrientationComboBox->currentIndex();
+	currDoc->m_pageSize = tabPage->prefsPageSizeName;
+	currDoc->pageWidth = tabPage->pageW;
+	currDoc->pageHeight = tabPage->pageH;
+	currDoc->marginPreset = 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());
+//	currDoc->scratch.Bottom = tabView->bottomScratch->value() / currDoc->unitRatio();
+//	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();
+	for (int p = 0; p < currDoc->Pages->count(); ++p)
+	{
+		Page *pp = currDoc->Pages->at(p);
+		if (tabPage->sizeAllPages->isChecked())
+		{
+			pp->setInitialWidth(currDoc->pageWidth);
+			pp->setInitialHeight(currDoc->pageHeight);
+			pp->setHeight(currDoc->pageHeight);
+			pp->setWidth(currDoc->pageWidth);
+			pp->m_pageSize = currDoc->m_pageSize;
+			pp->setOrientation(currDoc->PageOri);
+		}
+		if (tabPage->marginGroup->getMarginsForAllPages())
+		{
+			pp->initialMargins=updatedMargins;
+			pp->marginPreset=currDoc->marginPreset;
+		}
+		else
+		if (tabPage->marginGroup->getMarginsForAllMasterPages())
+		{
+			//CB #6796: find the master page (*mp) for the current page (*pp)
+			//check if *pp's margins are the same as the *mp's current margins
+			//apply new margins if same
+			const int masterPageNumber = currDoc->MasterNames[pp->MPageNam];
+			const Page* mp = currDoc->MasterPages.at(masterPageNumber);
+			if (pp->initialMargins.Left == mp->initialMargins.Left &&
+				pp->initialMargins.Right == mp->initialMargins.Right &&
+				pp->initialMargins.Top == mp->initialMargins.Top &&
+				pp->initialMargins.Bottom == mp->initialMargins.Bottom)
+			{
+				pp->initialMargins=updatedMargins;
+				pp->marginPreset=currDoc->marginPreset;
+			}
+		}
+	}
+	for (int p = 0; p < currDoc->MasterPages.count(); ++p)
+	{
+		Page *pp = currDoc->MasterPages.at(p);
+		if (tabPage->sizeAllMasterPages->isChecked())
+		{
+			pp->setInitialWidth(currDoc->pageWidth);
+			pp->setInitialHeight(currDoc->pageHeight);
+			pp->setHeight(currDoc->pageHeight);
+			pp->setWidth(currDoc->pageWidth);
+			pp->m_pageSize = currDoc->m_pageSize;
+			pp->setOrientation(currDoc->PageOri);
+		}
+		if (tabPage->marginGroup->getMarginsForAllMasterPages())
+		{
+			pp->initialMargins=updatedMargins;
+			pp->marginPreset=currDoc->marginPreset;
+		}
+		pp->setXOffset(currDoc->scratch()->Left);
+		pp->setYOffset(currDoc->scratch()->Top);
+	}
+	uint docItemsCount = currDoc->MasterItems.count();
+	for (uint ite = 0; ite < docItemsCount; ++ite)
+	{
+		PageItem *item = currDoc->MasterItems.at(ite);
+		item->moveBy(LeftD, TopD);
+		item->setRedrawBounding();
+	}
+	currDoc->guidesPrefs().guidePlacement = tabGuides->inBackground->isChecked();
+	currDoc->setMarginColored(tabView->checkUnprintable->isChecked());
+	currDoc->setPaperColor(tabView->colorPaper);
+	currDoc->guidesPrefs().marginsShown = tabGuides->marginBox->isChecked();
+	currDoc->guidesPrefs().showBleed = tabView->checkBleed->isChecked();
+	currDoc->guidesPrefs().framesShown = tabView->checkFrame->isChecked();
+	currDoc->guidesPrefs().layerMarkersShown = tabView->checkLayerM->isChecked();
+	currDoc->guidesPrefs().gridShown = tabGuides->checkGrid->isChecked();
+	currDoc->guidesPrefs().guidesShown = tabGuides->guideBox->isChecked();
+	currDoc->guidesPrefs().baselineGridShown = tabGuides->baselineBox->isChecked();
+	currDoc->guidesPrefs().showPic = tabView->checkPictures->isChecked();
+	currDoc->guidesPrefs().linkShown = tabView->checkLink->isChecked();
+	currDoc->guidesPrefs().showControls = tabView->checkControl->isChecked();
+	currDoc->guidesPrefs().rulerMode = tabView->checkRuler->isChecked();
+	currDoc->guidesPrefs().grabRadius = tabGuides->grabDistance->value();
+	currDoc->guidesPrefs().guideRad = tabGuides->snapDistance->value();
+	currDoc->guidesPrefs().minorGridSpacing = tabGuides->minorSpace->value() / currDoc->unitRatio();
+	currDoc->guidesPrefs().majorGridSpacing = tabGuides->majorSpace->value() / currDoc->unitRatio();
+	currDoc->guidesPrefs().minorGridColor = tabGuides->colorMinorGrid;
+	currDoc->guidesPrefs().majorGridColor = tabGuides->colorMajorGrid;
+	currDoc->guidesPrefs().marginColor = tabGuides->colorMargin;
+	currDoc->guidesPrefs().guideColor = tabGuides->colorGuides;
+	currDoc->guidesPrefs().baselineGridColor = tabGuides->colorBaselineGrid;
+	currDoc->setCheckerProfiles(tabDocChecker->checkerProfile);
+	currDoc->setCurCheckProfile(tabDocChecker->curCheckProfile->currentText());
+	currDoc->typographicPrefs().valueSuperScript = tabTypo->superDisplacement->value();
+	currDoc->typographicPrefs().scalingSuperScript = tabTypo->superScaling->value();
+	currDoc->typographicPrefs().valueSubScript = tabTypo->subDisplacement->value();
+	currDoc->typographicPrefs().scalingSubScript = tabTypo->subScaling->value();
+	currDoc->typographicPrefs().valueSmallCaps = tabTypo->capsScaling->value();
+	currDoc->typographicPrefs().autoLineSpacing = tabTypo->autoLine->value();
+	currDoc->guidesPrefs().valueBaselineGrid = tabGuides->baseGrid->value(); // / currDoc->unitRatio();
+	currDoc->guidesPrefs().offsetBaselineGrid = tabGuides->baseOffset->value(); // / currDoc->unitRatio();
+	currDoc->typographicPrefs().valueUnderlinePos = qRound(tabTypo->underlinePos->value() * 10);
+	currDoc->typographicPrefs().valueUnderlineWidth = qRound(tabTypo->underlineWidth->value() * 10);
+	currDoc->typographicPrefs().valueStrikeThruPos = qRound(tabTypo->strikethruPos->value() * 10);
+	currDoc->typographicPrefs().valueStrikeThruWidth = qRound(tabTypo->strikethruWidth->value() * 10);
+	currDoc->itemToolPrefs().textFont = tabTools->fontComboText->currentText();
+	currDoc->itemToolPrefs().textSize = tabTools->sizeComboText->currentText().left(2).toInt() * 10;
+	currDoc->itemToolPrefs().textStrokeColor = tabTools->colorComboStrokeText->currentText();
+	switch (tabTools->tabFillCombo->currentIndex())
+	{
+		case 0:
+			currDoc->itemToolPrefs().textTabFillChar = "";
+			break;
+		case 1:
+			currDoc->itemToolPrefs().textTabFillChar = ".";
+			break;
+		case 2:
+			currDoc->itemToolPrefs().textTabFillChar = "-";
+			break;
+		case 3:
+			currDoc->itemToolPrefs().textTabFillChar = "_";
+			break;
+		case 4:
+			currDoc->itemToolPrefs().textTabFillChar = tabTools->tabFillCombo->currentText().right(1);
+			break;
+	}
+	if (currDoc->itemToolPrefs().textStrokeColor == CommonStrings::tr_NoneColor)
+		currDoc->itemToolPrefs().textStrokeColor = CommonStrings::None;
+	currDoc->itemToolPrefs().textColor = tabTools->colorComboText->currentText();
+	if (currDoc->itemToolPrefs().textColor == CommonStrings::tr_NoneColor)
+		currDoc->itemToolPrefs().textColor = CommonStrings::None;
+	currDoc->itemToolPrefs().textFillColor = tabTools->colorComboTextBackground->currentText();
+	if (currDoc->itemToolPrefs().textFillColor == CommonStrings::tr_NoneColor)
+		currDoc->itemToolPrefs().textFillColor = CommonStrings::None;
+	currDoc->itemToolPrefs().textLineColor = tabTools->colorComboTextLine->currentText();
+	if (currDoc->itemToolPrefs().textLineColor == CommonStrings::tr_NoneColor)
+		currDoc->itemToolPrefs().textLineColor = CommonStrings::None;
+	currDoc->itemToolPrefs().textFillColorShade = tabTools->shadingTextBack->value();
+	currDoc->itemToolPrefs().textLineColorShade = tabTools->shadingTextLine->value();
+	currDoc->itemToolPrefs().textShade = tabTools->shadingText->value();
+	currDoc->itemToolPrefs().textStrokeShade = tabTools->shadingTextStroke->value();
+	currDoc->itemToolPrefs().textColumns = tabTools->columnsText->value();
+	currDoc->itemToolPrefs().textColumnGap = tabTools->gapText->value() / currDoc->unitRatio();
+	currDoc->itemToolPrefs().textTabWidth = tabTools->gapTab->value() / currDoc->unitRatio();
+	currDoc->itemToolPrefs().shapeLineColor = tabTools->colorComboLineShape->currentText();
+	if (currDoc->itemToolPrefs().shapeLineColor == CommonStrings::tr_NoneColor)
+		currDoc->itemToolPrefs().shapeLineColor = CommonStrings::None;
+	currDoc->itemToolPrefs().shapeFillColor = tabTools->comboFillShape->currentText();
+	if (currDoc->itemToolPrefs().shapeFillColor == CommonStrings::tr_NoneColor)
+		currDoc->itemToolPrefs().shapeFillColor = CommonStrings::None;
+	currDoc->itemToolPrefs().shapeFillColorShade = tabTools->shadingFillShape->value();
+	currDoc->itemToolPrefs().shapeLineColorShade = tabTools->shadingLineShape->value();
+	currDoc->itemToolPrefs().shapeLineStyle = static_cast<Qt::PenStyle>(tabTools->comboStyleShape->currentIndex()) + 1;
+	currDoc->itemToolPrefs().shapeLineWidth = tabTools->lineWidthShape->value();
+	currDoc->itemToolPrefs().lineStartArrow = tabTools->startArrow->currentIndex();
+	currDoc->itemToolPrefs().lineEndArrow = tabTools->endArrow->currentIndex();
+	currDoc->opToolPrefs().magMin = tabTools->minimumZoom->value();
+	currDoc->opToolPrefs().magMax = tabTools->maximumZoom->value();
+	currDoc->opToolPrefs().magStep = tabTools->zoomStep->value();
+	currDoc->itemToolPrefs().lineColor = tabTools->colorComboLine->currentText();
+	if (currDoc->itemToolPrefs().lineColor == CommonStrings::tr_NoneColor)
+		currDoc->itemToolPrefs().lineColor = CommonStrings::None;
+	currDoc->itemToolPrefs().lineColorShade = tabTools->shadingLine->value();
+	currDoc->itemToolPrefs().lineStyle = static_cast<Qt::PenStyle>(tabTools->comboStyleLine->currentIndex()) + 1;
+	currDoc->itemToolPrefs().lineWidth = tabTools->lineWidthLine->value();
+	currDoc->itemToolPrefs().imageFillColor = tabTools->comboFillImage->currentText();
+	if (currDoc->itemToolPrefs().imageFillColor == CommonStrings::tr_NoneColor)
+		currDoc->itemToolPrefs().imageFillColor = CommonStrings::None;
+	currDoc->itemToolPrefs().imageFillColorShade = tabTools->shadingFillImage->value();
+	currDoc->itemToolPrefs().imageScaleX = static_cast<double>(tabTools->scalingHorizontal->value()) / 100.0;
+	currDoc->itemToolPrefs().imageScaleY = static_cast<double>(tabTools->scalingVertical->value()) / 100.0;
+	currDoc->itemToolPrefs().imageScaleType = tabTools->buttonGroup3->isChecked();
+	currDoc->itemToolPrefs().imageAspectRatio = tabTools->checkRatioImage->isChecked();
+	currDoc->itemToolPrefs().imageUseEmbeddedPath = tabTools->embeddedPath->isChecked();
+	int haRes = 0;
+	if (tabTools->checkFullRes->isChecked())
+		haRes = 0;
+	if (tabTools->checkNormalRes->isChecked())
+		haRes = 1;
+	if (tabTools->checkHalfRes->isChecked())
+		haRes = 2;
+	if (currDoc->itemToolPrefs().imageLowResType != haRes)
+	{
+		currDoc->itemToolPrefs().imageLowResType = haRes;
+		viewToRecalcPictureRes=true;
+	}
+	else
+		viewToRecalcPictureRes=false;
+	currDoc->opToolPrefs().dispX = tabTools->genDispX->value();
+	currDoc->opToolPrefs().dispY = tabTools->genDispY->value();
+	currDoc->opToolPrefs().constrain = tabTools->genRot->value();
+	tabTools->polyWidget->getValues(&currDoc->itemToolPrefs().polyCorners,
+									&currDoc->itemToolPrefs().polyFactorGuiVal,
+									&currDoc->itemToolPrefs().polyFactor,
+									&currDoc->itemToolPrefs().polyUseFactor,
+									&currDoc->itemToolPrefs().polyRotation,
+									&currDoc->itemToolPrefs().polyCurvature);
+	currDoc->setAutoSave(tabPage->GroupAS->isChecked());
+	currDoc->setAutoSaveTime(tabPage->ASTime->value() * 60 * 1000);
+	currDoc->autoSaveTimer->stop();
+	if (currDoc->autoSave())
+		currDoc->autoSaveTimer->start(currDoc->autoSaveTime());
+*/
+/*	FIXME: scribus determines dict by charstyle now, so this setting should go into the doc's default charstyle
+		currDoc->docHyphenator->slotNewDict(ScMW->GetLang(tabHyphenator->language->currentText()));
+*/
+	/*
+	currDoc->setHyphLanguage(tabHyphenator->getLanguage());
 
+	currDoc->docHyphenator->slotNewSettings(tabHyphenator->getWordLen(),
+											!tabHyphenator->getVerbose(),
+											tabHyphenator->getInput(),
+											tabHyphenator->getMaxCount());
+	currDoc->docHyphenator->ignoredWords = tabHyphenator->getIgnoreList();
+	currDoc->docHyphenator->specialWords = tabHyphenator->getExceptionList();
+	if (ScCore->haveCMS())
+	{
+		bool oldCM = currDoc->CMSSettings.CMSinUse;
+		tabColorManagement->updateDocSettings(currDoc);
+		if (tabColorManagement->changed)
+		{
+			ScMW->setStatusBarInfoText( tr("Adjusting Colors"));
+			ScMW->mainWindowProgressBar->reset();
+			int cc = currDoc->PageColors.count() + currDoc->Items->count();
+			ScMW->mainWindowProgressBar->setMaximum(cc);
+			qApp->changeOverrideCursor(QCursor(Qt::WaitCursor));
+			bool newCM  = currDoc->CMSSettings.CMSinUse;
+			bool updCol = false;
+			currDoc->CMSSettings.CMSinUse = oldCM;
+			currDoc->CloseCMSProfiles();
+			currDoc->CMSSettings.CMSinUse = newCM;
+			currDoc->HasCMS = currDoc->CMSSettings.CMSinUse;
+			currDoc->SoftProofing = currDoc->CMSSettings.SoftProofOn;
+			currDoc->Gamut = currDoc->CMSSettings.GamutCheck;
+			currDoc->IntentColors = currDoc->CMSSettings.DefaultIntentColors;
+			currDoc->IntentImages = currDoc->CMSSettings.DefaultIntentImages;
+			if (!currDoc->CMSSettings.CMSinUse)
+			{
+				currDoc->HasCMS = false;
+				if	(oldCM)
+				{
+					currDoc->SetDefaultCMSParams();
+					updCol = true;
+				}
+			}
+			else if ( currDoc->OpenCMSProfiles(ScCore->InputProfiles, ScCore->InputProfilesCMYK, ScCore->MonitorProfiles, ScCore->PrinterProfiles) )
+			{
+				currDoc->HasCMS = true;
+				currDoc->pdfOptions().SComp = currDoc->CMSSettings.ComponentsInput2;
+				currDoc->pdfOptions().SolidProf = currDoc->CMSSettings.DefaultSolidColorRGBProfile;
+				currDoc->pdfOptions().ImageProf = currDoc->CMSSettings.DefaultImageRGBProfile;
+				currDoc->pdfOptions().PrintProf = currDoc->CMSSettings.DefaultPrinterProfile;
+				currDoc->pdfOptions().Intent = currDoc->CMSSettings.DefaultIntentColors;
+				updCol = true;
+			}
+			else
+			{
+				currDoc->SetDefaultCMSParams();
+				currDoc->HasCMS = false;
+			}
+			if (updCol)
+			{
+				ScMW->recalcColors(ScMW->mainWindowProgressBar);
+				currDoc->RecalcPictures(&ScCore->InputProfiles, &ScCore->InputProfilesCMYK, ScMW->mainWindowProgressBar);
+			}
+			ScMW->mainWindowProgressBar->setValue(cc);
+			qApp->changeOverrideCursor(QCursor(Qt::ArrowCursor));
+			ScMW->setStatusBarInfoText("");
+			ScMW->mainWindowProgressBar->reset();
+		}
+	}
+	PrefsManager* prefsManager=PrefsManager::instance();
+// 	SCFontsIterator it(prefsManager->appPrefs.AvailFonts);
+// 	for ( ; it.hasNext() ; it.next())
+// 	{
+// 		it.current().embedPs(tabFonts->fontFlags[it.currentKey()].FlagPS);
+// 		it.current().usable(tabFonts->fontFlags[it.currentKey()].FlagUse);
+// 		it.current().subset(tabFonts->fontFlags[it.currentKey()].FlagSub);
+// 	}
+	uint a = 0;
+	prefsManager->appPrefs.fontPrefs.GFontSub.clear();
+	QMap<QString,QString>::Iterator itfsu;
+	QMap<QString,QString>::Iterator itfsuend=tabFonts->RList.end();
+	for (itfsu = tabFonts->RList.begin(); itfsu != itfsuend; ++itfsu)
+		prefsManager->appPrefs.fontPrefs.GFontSub[itfsu.key()] = tabFonts->FlagsRepl.at(a++)->currentText();
+	QStringList uf = currDoc->UsedFonts.keys();
+	QMap<QString,int>::Iterator it3;
+//	for (it3 = currDoc->UsedFonts.begin(); it3 != currDoc->UsedFonts.end(); ++it3)
+//		FT_Done_Face(currDoc->FFonts[it3.key()]);
+	currDoc->UsedFonts.clear();
+	QStringList::Iterator it3a;
+	QStringList::Iterator it3aend=uf.end();
+	for (it3a = uf.begin(); it3a != it3aend; ++it3a)
+		currDoc->AddFont(*it3a);
+
+	currDoc->pdfOptions().Thumbnails = tabPDF->CheckBox1->isChecked();
+	currDoc->pdfOptions().Compress = tabPDF->Compression->isChecked();
+	currDoc->pdfOptions().CompressMethod = (PDFOptions::PDFCompression) tabPDF->CMethod->currentIndex();
+	currDoc->pdfOptions().Quality = tabPDF->CQuality->currentIndex();
+	currDoc->pdfOptions().embedPDF = tabPDF->EmbedPDF->isChecked();
+	currDoc->pdfOptions().Resolution = tabPDF->Resolution->value();
+	currDoc->pdfOptions().RecalcPic = tabPDF->DSColor->isChecked();
+	currDoc->pdfOptions().PicRes = tabPDF->ValC->value();
+	currDoc->pdfOptions().Bookmarks = tabPDF->CheckBM->isChecked();
+	currDoc->pdfOptions().Binding = tabPDF->ComboBind->currentIndex();
+	currDoc->pdfOptions().MirrorH = tabPDF->MirrorH->isChecked();
+	currDoc->pdfOptions().MirrorV = tabPDF->MirrorV->isChecked();
+	currDoc->pdfOptions().RotateDeg = tabPDF->RotateDeg->currentIndex() * 90;
+	currDoc->pdfOptions().Articles = tabPDF->Article->isChecked();
+	currDoc->pdfOptions().Encrypt = tabPDF->Encry->isChecked();
+	currDoc->pdfOptions().UseLPI = tabPDF->UseLPI->isChecked();
+	currDoc->pdfOptions().useLayers = tabPDF->useLayers->isChecked();
+	currDoc->pdfOptions().UseSpotColors = !tabPDF->useSpot->isChecked();
+	currDoc->pdfOptions().doMultiFile = false;
+	currDoc->pdfOptions().bleeds.Bottom = tabPDF->BleedBottom->value() / currDoc->unitRatio();
+	currDoc->pdfOptions().bleeds.Top = tabPDF->BleedTop->value() / currDoc->unitRatio();
+	currDoc->pdfOptions().bleeds.Left = tabPDF->BleedLeft->value() / currDoc->unitRatio();
+	currDoc->pdfOptions().bleeds.Right = tabPDF->BleedRight->value() / currDoc->unitRatio();
+	currDoc->pdfOptions().doClip = tabPDF->ClipMarg->isChecked();
+	currDoc->pdfOptions().openAction = "";
+	if (tabPDF->Encry->isChecked())
+	{
+		int Perm = -64;
+		if (tabPDF->PDFVersionCombo->currentIndex() == 1)
+			Perm &= ~0x00240000;
+		if (tabPDF->PrintSec->isChecked())
+			Perm += 4;
+		if (tabPDF->ModifySec->isChecked())
+			Perm += 8;
+		if (tabPDF->CopySec->isChecked())
+			Perm += 16;
+		if (tabPDF->AddSec->isChecked())
+			Perm += 32;
+		currDoc->pdfOptions().Permissions = Perm;
+		currDoc->pdfOptions().PassOwner = tabPDF->PassOwner->text();
+		currDoc->pdfOptions().PassUser = tabPDF->PassUser->text();
+	}
+	if (tabPDF->PDFVersionCombo->currentIndex() == 0)
+		currDoc->pdfOptions().Version = PDFOptions::PDFVersion_13;
+	if (tabPDF->PDFVersionCombo->currentIndex() == 1)
+		currDoc->pdfOptions().Version = PDFOptions::PDFVersion_14;
+	if (tabPDF->PDFVersionCombo->currentIndex() == 2)
+		currDoc->pdfOptions().Version = PDFOptions::PDFVersion_15;
+	if (tabPDF->PDFVersionCombo->currentIndex() == 3)
+		currDoc->pdfOptions().Version = PDFOptions::PDFVersion_X3;
+	if (tabPDF->OutCombo->currentIndex() == 0)
+	{
+		currDoc->pdfOptions().isGrayscale = false;
+		currDoc->pdfOptions().UseRGB = true;
+		currDoc->pdfOptions().UseProfiles = false;
+		currDoc->pdfOptions().UseProfiles2 = false;
+	}
+	else
+	{
+		if (tabPDF->OutCombo->currentIndex() == 3)
+		{
+			currDoc->pdfOptions().isGrayscale = true;
+			currDoc->pdfOptions().UseRGB = false;
+			currDoc->pdfOptions().UseProfiles = false;
+			currDoc->pdfOptions().UseProfiles2 = false;
+		}
+		else
+		{
+			currDoc->pdfOptions().isGrayscale = false;
+			currDoc->pdfOptions().UseRGB = false;
+			if (currDoc->HasCMS)
+			{
+				currDoc->pdfOptions().UseProfiles = tabPDF->EmbedProfs->isChecked();
+				currDoc->pdfOptions().UseProfiles2 = tabPDF->EmbedProfs2->isChecked();
+				currDoc->pdfOptions().Intent = tabPDF->IntendS->currentIndex();
+				currDoc->pdfOptions().Intent2 = tabPDF->IntendI->currentIndex();
+				currDoc->pdfOptions().EmbeddedI = tabPDF->NoEmbedded->isChecked();
+				currDoc->pdfOptions().SolidProf = tabPDF->SolidPr->currentText();
+				currDoc->pdfOptions().ImageProf = tabPDF->ImageP->currentText();
+				currDoc->pdfOptions().PrintProf = tabPDF->PrintProfC->currentText();
+			}
+		}
+	}
+
+	currDoc->documentInfo = docInfos->getDocInfo();
+	currDoc->setItemAttributes(*(tabDocItemAttributes->getNewAttributes()));
+	currDoc->setTocSetups(*(tabTOCIndexPrefs->getNewToCs()));
+	currDoc->sections = tabDocSections->getNewSections();
+
+	uint itemCount=currDoc->Items->count();
+	for (uint b=0; b<itemCount; ++b)
+	{
+		if (currDoc->Items->at(b)->itemType() == PageItem::ImageFrame)
+			currDoc->Items->at(b)->setImageShown(currDoc->guidesPrefs().showPic);
+	}
+	*/
+}
+
Index: scribus/scribusdoc.h
===================================================================
--- scribus/scribusdoc.h	(revision 14990)
+++ scribus/scribusdoc.h	(revision 14991)
@@ -192,12 +192,23 @@
 	void clearCheckerProfiles() { docPrefsData.verifierPrefs.checkerPrefsList.clear(); }
 	const QString& curCheckProfile() const { return docPrefsData.verifierPrefs.curCheckProfile; }
 	void setCurCheckProfile(const QString& s) { docPrefsData.verifierPrefs.curCheckProfile=s; }
+	int pageOrientation() const { return docPrefsData.docSetupPrefs.pageOrientation; }
+	void setPageOrientation(int o) { docPrefsData.docSetupPrefs.pageOrientation=o; }
+	double pageHeight() const { return docPrefsData.docSetupPrefs.pageHeight; }
+	double pageWidth() const { return docPrefsData.docSetupPrefs.pageWidth; }
+	const QString& pageSize() const { return docPrefsData.docSetupPrefs.pageSize; }
+	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; }
 
 	TypoPrefs& typographicPrefs() { return docPrefsData.typoPrefs; }
 	GuidesPrefs& guidesPrefs() { return docPrefsData.guidesPrefs; }
 	ItemToolPrefs& itemToolPrefs() { return docPrefsData.itemToolPrefs; }
 	OperatorToolPrefs& opToolPrefs() { return docPrefsData.opToolPrefs; }
 
+	const ApplicationPrefs& prefsData() { return docPrefsData; }
+	void setNewPrefs(const ApplicationPrefs& prefsData);
+
 	// Add, delete and move pages
 	
 	Page* addPage(const int pageNumber, const QString& masterPageName=QString::null, const bool addAutoFrame=false);
@@ -1029,10 +1040,10 @@
 	QList<PageItem*> DocItems;
 	QList<PageItem*> FrameItems;
 	Selection* const m_Selection;
-	/** \brief Pagewidth  */
-	double pageWidth;
-	/** \brief Pageheight */
-	double pageHeight;
+	//->Prefs /** \brief Pagewidth  */
+	//->Prefs double pageWidth;
+	//->Prefs /** \brief Pageheight */
+	//->Prefs double pageHeight;
 	/* Number of Pages */
 	// int pageCount; Disabled CR no longer required
 	/** \brief Margins */
@@ -1050,9 +1061,9 @@
 	double PageSpa;
 	/** \brief current Pagelayout */
 	int currentPageLayout;
-	/** \brief Flag fuer Hoch- oder Querformat 0 = Hochformat */
-	int PageOri;
-	QString m_pageSize;
+	///** \brief Flag fuer Hoch- oder Querformat 0 = Hochformat */
+	//->Prefs int PageOri;
+	//->Prefs QString m_pageSize;
 	/** \brief Erste Seitennummer im Dokument */
 	int FirstPnum;
 	/** \brief Flag fuer Rasterbenutzung */
Index: scribus/ui/pdfopts.cpp
===================================================================
--- scribus/ui/pdfopts.cpp	(revision 14990)
+++ scribus/ui/pdfopts.cpp	(revision 14991)
@@ -100,8 +100,8 @@
 	NameLayout->addWidget( multiFile, 1, 0 );
 	PDFExportLayout->addWidget( Name );
 	Options = new TabPDFOptions( this, pdfOptions, AllFonts, PDFXProfiles, DocFonts,
-								Eff, currView->Doc->unitIndex(), currView->Doc->pageHeight,
-								currView->Doc->pageWidth, currView->Doc, true );
+								Eff, currView->Doc->unitIndex(), currView->Doc->pageHeight(),
+								currView->Doc->pageWidth(), currView->Doc, true );
 	PDFExportLayout->addWidget( Options );
 	Layout7 = new QHBoxLayout;
 	Layout7->setSpacing( 5 );
Index: scribus/ui/tabdocument.cpp
===================================================================
--- scribus/ui/tabdocument.cpp	(revision 14990)
+++ scribus/ui/tabdocument.cpp	(revision 14991)
@@ -251,24 +251,24 @@
 	unitRatio = unitGetRatioFromIndex(prefsData->unitIndex());
 
 //	setSize(prefsData->m_pageSize);
-	if (prefsData->m_pageSize == CommonStrings::customPageSize)
+	if (prefsData->pageSize() == CommonStrings::customPageSize)
 		setCurrentComboItem(pageSizeComboBox, CommonStrings::trCustomPageSize);
 	else
-		setCurrentComboItem(pageSizeComboBox, prefsData->m_pageSize);
-	prefsPageSizeName = prefsData->m_pageSize;
+		setCurrentComboItem(pageSizeComboBox, prefsData->pageSize());
+	prefsPageSizeName = prefsData->pageSize();
 //	setOrien(prefsData->PageOri);
 
 	docLayout->selectItem(prefsData->currentPageLayout);
 	docLayout->firstPage->setCurrentIndex(prefsData->pageSets()[prefsData->currentPageLayout].FirstPage);
-	pageOrientationComboBox->setCurrentIndex(prefsData->PageOri);
+	pageOrientationComboBox->setCurrentIndex(prefsData->pageOrientation());
 	unitCombo->setCurrentIndex(prefsData->unitIndex());
-	pageWidth->setValue(prefsData->pageWidth * unitRatio);
-	pageHeight->setValue(prefsData->pageHeight * unitRatio);
-	pageW = prefsData->pageWidth;
-	pageH = prefsData->pageHeight;
+	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);
+	marginGroup->setPageWidthHeight(prefsData->pageWidth(), prefsData->pageHeight());
 	marginGroup->setPageSize(prefsPageSizeName);
 	marginGroup->setMarginPreset(prefsData->marginPreset);
 	GroupAS->setChecked( prefsData->autoSave() );
Index: scribus/ui/preferencesdialog.h
===================================================================
--- scribus/ui/preferencesdialog.h	(revision 14990)
+++ scribus/ui/preferencesdialog.h	(revision 14991)
@@ -50,7 +50,7 @@
 	Q_OBJECT
 
 	public:
-		PreferencesDialog(QWidget* parent);
+		PreferencesDialog(QWidget* parent, ApplicationPrefs& prefsData);
 		~PreferencesDialog();
 
 		virtual void changeEvent(QEvent *e);
Index: scribus/ui/reformdoc.cpp
===================================================================
--- scribus/ui/reformdoc.cpp	(revision 14990)
+++ scribus/ui/reformdoc.cpp	(revision 14991)
@@ -92,7 +92,7 @@
 
 	tabPDF = new TabPDFOptions( prefsWidgets, doc->pdfOptions(), PrefsManager::instance()->appPrefs.fontPrefs.AvailFonts,
 								ScCore->PDFXProfiles, doc->UsedFonts, doc->pdfOptions().PresentVals,
-								docUnitIndex, doc->pageHeight, doc->pageWidth, doc );
+								docUnitIndex, doc->pageHeight(), doc->pageWidth(), doc );
 	addItem( tr("PDF Export"), loadIcon("acroread32.png"), tabPDF);
 
 	tabDocItemAttributes = new DocumentItemAttributes(prefsWidgets);
@@ -154,7 +154,7 @@
 	tabDocChecker->restoreDefaults(&currDoc->checkerProfiles(), currDoc->curCheckProfile());
 	tabPDF->restoreDefaults(currDoc->pdfOptions(), PrefsManager::instance()->appPrefs.fontPrefs.AvailFonts,
 							ScCore->PDFXProfiles, currDoc->UsedFonts, currDoc->pdfOptions().PresentVals,
-							docUnitIndex, currDoc->pageHeight, currDoc->pageWidth, currDoc, false);
+							docUnitIndex, currDoc->pageHeight(), currDoc->pageWidth(), currDoc, false);
 	if (ScCore->haveCMS())
 		tabColorManagement->restoreDefaults(&currDoc->CMSSettings, &ScCore->InputProfiles,
 										 &ScCore->InputProfilesCMYK,
@@ -229,10 +229,10 @@
 //	currDoc->pageSets[fp].GapBelow = tabView->gapVertical->value() / currDoc->unitRatio();
 	//currDoc->FirstPnum = pageNumber->value();
 	currDoc->resetPage(updatedMargins, fp);
-	currDoc->PageOri = tabPage->pageOrientationComboBox->currentIndex();
-	currDoc->m_pageSize = tabPage->prefsPageSizeName;
-	currDoc->pageWidth = tabPage->pageW;
-	currDoc->pageHeight = tabPage->pageH;
+	currDoc->setPageOrientation(tabPage->pageOrientationComboBox->currentIndex());
+	currDoc->setPageSize(tabPage->prefsPageSizeName);
+	currDoc->setPageWidth(tabPage->pageW);
+	currDoc->setPageHeight(tabPage->pageH);
 	currDoc->marginPreset = tabPage->marginGroup->getMarginPreset();
 	double TopD = tabView->topScratch->value() / currDoc->unitRatio() - currDoc->scratch()->Top;
 	double LeftD = tabView->leftScratch->value() / currDoc->unitRatio() - currDoc->scratch()->Left;
@@ -250,12 +250,12 @@
 		Page *pp = currDoc->Pages->at(p);
 		if (tabPage->sizeAllPages->isChecked())
 		{
-			pp->setInitialWidth(currDoc->pageWidth);
-			pp->setInitialHeight(currDoc->pageHeight);
-			pp->setHeight(currDoc->pageHeight);
-			pp->setWidth(currDoc->pageWidth);
-			pp->m_pageSize = currDoc->m_pageSize;
-			pp->setOrientation(currDoc->PageOri);
+			pp->setInitialWidth(currDoc->pageWidth());
+			pp->setInitialHeight(currDoc->pageHeight());
+			pp->setHeight(currDoc->pageHeight());
+			pp->setWidth(currDoc->pageWidth());
+			pp->m_pageSize = currDoc->pageSize();
+			pp->setOrientation(currDoc->pageOrientation());
 		}
 		if (tabPage->marginGroup->getMarginsForAllPages())
 		{
@@ -285,12 +285,12 @@
 		Page *pp = currDoc->MasterPages.at(p);
 		if (tabPage->sizeAllMasterPages->isChecked())
 		{
-			pp->setInitialWidth(currDoc->pageWidth);
-			pp->setInitialHeight(currDoc->pageHeight);
-			pp->setHeight(currDoc->pageHeight);
-			pp->setWidth(currDoc->pageWidth);
-			pp->m_pageSize = currDoc->m_pageSize;
-			pp->setOrientation(currDoc->PageOri);
+			pp->setInitialWidth(currDoc->pageWidth());
+			pp->setInitialHeight(currDoc->pageHeight());
+			pp->setHeight(currDoc->pageHeight());
+			pp->setWidth(currDoc->pageWidth());
+			pp->m_pageSize = currDoc->pageSize();
+			pp->setOrientation(currDoc->pageOrientation());
 		}
 		if (tabPage->marginGroup->getMarginsForAllMasterPages())
 		{
Index: scribus/ui/preferencesdialog.cpp
===================================================================
--- scribus/ui/preferencesdialog.cpp	(revision 14990)
+++ scribus/ui/preferencesdialog.cpp	(revision 14991)
@@ -22,7 +22,7 @@
 #include "units.h"
 #include "util_icon.h"
 
-PreferencesDialog::PreferencesDialog( QWidget* parent )
+PreferencesDialog::PreferencesDialog(QWidget* parent, ApplicationPrefs& prefsData)
 	: QDialog(parent),
 	counter(0)
 {
@@ -87,6 +87,7 @@
 	connect(applyButton, SIGNAL(clicked()), this, SLOT(applyButtonClicked()));
 	connect(preferencesTypeList, SIGNAL(itemSelectionChanged()), this, SLOT(newItemSelected()));
 
+	localPrefs=prefsData;
 	initPreferenceValues();
 	setupGui();
 	addPlugins();
@@ -106,7 +107,6 @@
 void PreferencesDialog::initPreferenceValues()
 {
 	prefsManager=PrefsManager::instance();
-	localPrefs=prefsManager->appPrefs;
 	mainWin = (ScribusMainWindow*)parent();
 	docUnitIndex = localPrefs.docSetupPrefs.docUnitIndex;
 	unitRatio = unitGetRatioFromIndex(docUnitIndex);
Index: scribus/ui/inspage.cpp
===================================================================
--- scribus/ui/inspage.cpp	(revision 14990)
+++ scribus/ui/inspage.cpp	(revision 14991)
@@ -211,7 +211,7 @@
 	dsGroupBox7Layout->setMargin( 5 );
 	TextLabel1 = new QLabel( tr( "&Size:" ), dsGroupBox7);
 	dsGroupBox7Layout->addWidget( TextLabel1, 0, 0);
-	PageSize *ps=new PageSize(currentDoc->m_pageSize);
+	PageSize *ps=new PageSize(currentDoc->pageSize());
 	sizeQComboBox = new QComboBox(dsGroupBox7);
 	QStringList pageSizes=ps->sizeList();
 	sizeQComboBox->addItems(ps->sizeTRList());
@@ -229,17 +229,17 @@
 	orientationQComboBox = new QComboBox(dsGroupBox7);
 	orientationQComboBox->addItem( tr( "Portrait" ) );
 	orientationQComboBox->addItem( tr( "Landscape" ) );
-	orientationQComboBox->setCurrentIndex(currentDoc->PageOri );
+	orientationQComboBox->setCurrentIndex(currentDoc->pageOrientation() );
 	TextLabel2->setBuddy(orientationQComboBox);
 	dsGroupBox7Layout->addWidget( orientationQComboBox, 1, 1, 1, 3 );
 	widthSpinBox = new ScrSpinBox( 1, 10000, dsGroupBox7, currentDoc->unitIndex() );
 	widthQLabel = new QLabel( tr( "&Width:" ), dsGroupBox7);
-	widthSpinBox->setValue(currentDoc->pageWidth * currentDoc->unitRatio());
+	widthSpinBox->setValue(currentDoc->pageWidth() * currentDoc->unitRatio());
 	widthQLabel->setBuddy(widthSpinBox);
 	dsGroupBox7Layout->addWidget( widthQLabel, 2, 0 );
 	dsGroupBox7Layout->addWidget( widthSpinBox, 2, 1 );
 	heightSpinBox = new ScrSpinBox( 1, 10000, dsGroupBox7, currentDoc->unitIndex() );
-	heightSpinBox->setValue(currentDoc->pageHeight * currentDoc->unitRatio());
+	heightSpinBox->setValue(currentDoc->pageHeight() * currentDoc->unitRatio());
 	heightQLabel = new QLabel(tr( "&Height:" ), dsGroupBox7);
 	heightQLabel->setBuddy(heightSpinBox);
 	dsGroupBox7Layout->addWidget( heightQLabel, 2, 2 );
Index: scribus/scribus.cpp
===================================================================
--- scribus/scribus.cpp	(revision 14990)
+++ scribus/scribus.cpp	(revision 14991)
@@ -636,7 +636,7 @@
 	scrMenuMgr->addMenuItem(scrActions["fileExportAsPDF"], "FileExport", false);
 	scrMenuMgr->addMenuSeparator("File");
 	scrMenuMgr->addMenuItem(scrActions["fileDocSetup"], "File", false);
-	//scrMenuMgr->addMenuItem(scrActions["fileDocSetup150"], "File", false);
+//	scrMenuMgr->addMenuItem(scrActions["fileDocSetup150"], "File", false);
 	scrMenuMgr->addMenuItem(scrActions["filePreferences"], "File", true);
 	scrMenuMgr->addMenuItem(scrActions["filePreferences150"], "File", true);
 	scrMenuMgr->addMenuSeparator("File");
@@ -3452,7 +3452,7 @@
 				startPage = dia->getImportWherePage() + 1;
 			else
 				startPage = doc->DocPages.count() + 1;
-			addNewPages(dia->getImportWherePage(), importWhere, nrToImport, doc->pageHeight, doc->pageWidth, doc->PageOri, doc->m_pageSize, true);
+			addNewPages(dia->getImportWherePage(), importWhere, nrToImport, doc->pageHeight(), doc->pageWidth(), doc->pageOrientation(), doc->pageSize(), true);
 		}
 		else
 		{
@@ -3473,7 +3473,7 @@
 					case 0:
 						addNewPages(doc->DocPages.count(), 2,
 									nrToImport - (doc->DocPages.count() - doc->currentPage()->pageNr()),
-									doc->pageHeight, doc->pageWidth, doc->PageOri, doc->m_pageSize, true);
+									doc->pageHeight(), doc->pageWidth(), doc->pageOrientation(), doc->pageSize(), true);
 						break;
 					case 1:
 						nrToImport = doc->DocPages.count() - doc->currentPage()->pageNr();
@@ -7510,7 +7510,7 @@
 	QString oldMonitorProfile(ScCore->monitorProfile.productDescription());
 	slotSelect();
 	struct ApplicationPrefs oldPrefs(prefsManager->appPrefs);
-	PreferencesDialog prefsDialog(this);
+	PreferencesDialog prefsDialog(this, oldPrefs);
 	int prefsResult=prefsDialog.exec();
 	if (prefsResult==QDialog::Accepted)
 	{
@@ -7673,12 +7673,56 @@
 {
 	if (!doc)
 		return;
-	//struct ApplicationPrefs oldDocPrefs(doc->docPrefsData);
-	PreferencesDialog prefsDialog(this);
+	struct ApplicationPrefs oldDocPrefs(doc->prefsData());
+	PreferencesDialog prefsDialog(this, oldDocPrefs);
 	int prefsResult=prefsDialog.exec();
 	if (prefsResult==QDialog::Accepted)
 	{
-	//	struct ApplicationPrefs newPrefs(prefsDialog.prefs());
+		struct ApplicationPrefs newDocPrefs(prefsDialog.prefs());
+		doc->setNewPrefs(newDocPrefs);
+
+
+		slotChangeUnit(doc->unitIndex(), false);
+		//dia->updateDocumentSettings();
+		if (oldDocPrefs.itemToolPrefs.imageLowResType!=newDocPrefs.itemToolPrefs.imageLowResType)
+		{
+			setStatusBarInfoText( tr("Updating Images"));
+			mainWindowProgressBar->reset();
+			qApp->changeOverrideCursor(QCursor(Qt::WaitCursor));
+			qApp->processEvents();
+			doc->recalcPicturesRes(true);
+			qApp->changeOverrideCursor(QCursor(Qt::ArrowCursor));
+			setStatusBarInfoText("");
+			mainWindowProgressBar->reset();
+			view->previewQualitySwitcher->blockSignals(true);
+			view->previewQualitySwitcher->setCurrentIndex(doc->itemToolPrefs().imageLowResType);
+			view->previewQualitySwitcher->blockSignals(false);
+		}
+		propertiesPalette->Fonts->RebuildList(doc);
+		scrActions["viewShowMargins"]->setChecked(doc->guidesPrefs().marginsShown);
+		scrActions["viewShowBleeds"]->setChecked(doc->guidesPrefs().showBleed);
+		scrActions["viewShowFrames"]->setChecked(doc->guidesPrefs().framesShown);
+		scrActions["viewShowLayerMarkers"]->setChecked(doc->guidesPrefs().layerMarkersShown);
+		scrActions["viewShowGrid"]->setChecked(doc->guidesPrefs().gridShown);
+		scrActions["viewShowGuides"]->setChecked(doc->guidesPrefs().guidesShown);
+		scrActions["viewShowColumnBorders"]->setChecked(doc->guidesPrefs().colBordersShown);
+		scrActions["viewShowBaseline"]->setChecked(doc->guidesPrefs().baselineGridShown);
+		scrActions["viewShowImages"]->setChecked(doc->guidesPrefs().showPic);
+		scrActions["viewShowTextChain"]->setChecked(doc->guidesPrefs().linkShown);
+		scrActions["viewShowTextControls"]->setChecked(doc->guidesPrefs().showControls);
+		scrActions["viewShowRulers"]->setChecked(doc->guidesPrefs().rulersShown);
+		scrActions["viewRulerMode"]->setChecked(doc->guidesPrefs().rulerMode);
+		scrActions["extrasGenerateTableOfContents"]->setEnabled(doc->hasTOCSetup());
+		view->cmsToolbarButton->setChecked(doc->HasCMS);
+		//doc emits changed() via this
+		doc->setMasterPageMode(true);
+		view->reformPages();
+		doc->setMasterPageMode(false);
+		view->reformPages();
+		view->GotoPage(doc->currentPage()->pageNr());
+		view->DrawNew();
+		propertiesPalette->ShowCMS();
+		pagePalette->rebuildPages();
 	}
 }
 void ScribusMainWindow::ShowSubs()
@@ -8526,7 +8570,7 @@
 		}
 		else
 		{
-			addNewPages(wo, where, 1, doc->pageHeight, doc->pageWidth, doc->PageOri, doc->m_pageSize, true, &tmpl);
+			addNewPages(wo, where, 1, doc->pageHeight(), doc->pageWidth(), doc->pageOrientation(), doc->pageSize(), true, &tmpl);
 		}
 		UndoObject *tmp =
 			undoManager->replaceObject(state->getUInt("DUMMY_ID"), doc->Pages->at(pagenr - 1));
@@ -8780,7 +8824,7 @@
 			int AnActType = currItem->annotation().ActionType();
 			QString AnAction = currItem->annotation().Action();
 			QString An_Extern = currItem->annotation().Extern();
-			Annota *dia = new Annota(this, currItem, doc->DocPages.count(), static_cast<int>(doc->pageWidth), static_cast<int>(doc->pageHeight), view);
+			Annota *dia = new Annota(this, currItem, doc->DocPages.count(), static_cast<int>(doc->pageWidth()), static_cast<int>(doc->pageHeight()), view);
 			if (dia->exec())
 				slotDocCh();
 			else
@@ -8794,7 +8838,7 @@
 		}
 		else
 		{
-			Annot *dia = new Annot(this, currItem, doc->DocPages.count(), static_cast<int>(doc->pageWidth), static_cast<int>(doc->pageHeight), doc->PageColors, view);
+			Annot *dia = new Annot(this, currItem, doc->DocPages.count(), static_cast<int>(doc->pageWidth()), static_cast<int>(doc->pageHeight()), doc->PageColors, view);
 			if (dia->exec())
 				slotDocCh();
 			delete dia;
Index: scribus/plugins/scriptplugin/cmdpage.cpp
===================================================================
--- scribus/plugins/scriptplugin/cmdpage.cpp	(revision 14990)
+++ scribus/plugins/scriptplugin/cmdpage.cpp	(revision 14991)
@@ -171,8 +171,8 @@
 	PyObject *t;
 	t = Py_BuildValue(
 			"(dd)",
-			PointToValue(ScCore->primaryMainWindow()->doc->pageWidth), // it's just view scale... * ScCore->primaryMainWindow()->doc->Scale),
-			PointToValue(ScCore->primaryMainWindow()->doc->pageHeight)  // * ScCore->primaryMainWindow()->doc->Scale)
+			PointToValue(ScCore->primaryMainWindow()->doc->pageWidth()), // it's just view scale... * ScCore->primaryMainWindow()->doc->Scale),
+			PointToValue(ScCore->primaryMainWindow()->doc->pageHeight())  // * ScCore->primaryMainWindow()->doc->Scale)
 		);
 	return t;
 }
Index: scribus/plugins/scriptplugin/objimageexport.cpp
===================================================================
--- scribus/plugins/scriptplugin/objimageexport.cpp	(revision 14990)
+++ scribus/plugins/scriptplugin/objimageexport.cpp	(revision 14991)
@@ -146,9 +146,9 @@
 	* portrait and user defined sizes.
 	*/
 	double pixmapSize;
-	(ScCore->primaryMainWindow()->doc->pageHeight > ScCore->primaryMainWindow()->doc->pageWidth)
-			? pixmapSize = ScCore->primaryMainWindow()->doc->pageHeight
-			: pixmapSize = ScCore->primaryMainWindow()->doc->pageWidth;
+	(ScCore->primaryMainWindow()->doc->pageHeight() > ScCore->primaryMainWindow()->doc->pageWidth())
+			? pixmapSize = ScCore->primaryMainWindow()->doc->pageHeight()
+			: pixmapSize = ScCore->primaryMainWindow()->doc->pageWidth();
 	QImage im = ScCore->primaryMainWindow()->view->PageToPixmap(ScCore->primaryMainWindow()->doc->currentPage()->pageNr(), qRound(pixmapSize * self->scale * (self->dpi / 72.0) / 100.0), false);
 	int dpi = qRound(100.0 / 2.54 * self->dpi);
 	im.setDotsPerMeterY(dpi);
@@ -177,9 +177,9 @@
 	* portrait and user defined sizes.
 	*/
 	double pixmapSize;
-	(ScCore->primaryMainWindow()->doc->pageHeight > ScCore->primaryMainWindow()->doc->pageWidth)
-			? pixmapSize = ScCore->primaryMainWindow()->doc->pageHeight
-			: pixmapSize = ScCore->primaryMainWindow()->doc->pageWidth;
+	(ScCore->primaryMainWindow()->doc->pageHeight() > ScCore->primaryMainWindow()->doc->pageWidth())
+			? pixmapSize = ScCore->primaryMainWindow()->doc->pageHeight()
+			: pixmapSize = ScCore->primaryMainWindow()->doc->pageWidth();
 	QImage im = ScCore->primaryMainWindow()->view->PageToPixmap(ScCore->primaryMainWindow()->doc->currentPage()->pageNr(), qRound(pixmapSize * self->scale * (self->dpi / 72.0) / 100.0), false);
 	int dpi = qRound(100.0 / 2.54 * self->dpi);
 	im.setDotsPerMeterY(dpi);
Index: scribus/plugins/scriptplugin/objpdffile.cpp
===================================================================
--- scribus/plugins/scriptplugin/objpdffile.cpp	(revision 14990)
+++ scribus/plugins/scriptplugin/objpdffile.cpp	(revision 14991)
@@ -1172,13 +1172,13 @@
 				if (profile.colorSpace() == ColorSpace_Cmy)
 					Components = 3;
 				ScCore->primaryMainWindow()->doc->pdfOptions().Info = PyString_AsString(self->info);
-				self->bleedt = minmaxd(self->bleedt, 0, ScCore->primaryMainWindow()->view->Doc->pageHeight*ScCore->primaryMainWindow()->view->Doc->unitRatio());
+				self->bleedt = minmaxd(self->bleedt, 0, ScCore->primaryMainWindow()->view->Doc->pageHeight()*ScCore->primaryMainWindow()->view->Doc->unitRatio());
 				ScCore->primaryMainWindow()->doc->pdfOptions().bleeds.Top = self->bleedt/ScCore->primaryMainWindow()->view->Doc->unitRatio();
-				self->bleedl = minmaxd(self->bleedl, 0, ScCore->primaryMainWindow()->view->Doc->pageWidth*ScCore->primaryMainWindow()->view->Doc->unitRatio());
+				self->bleedl = minmaxd(self->bleedl, 0, ScCore->primaryMainWindow()->view->Doc->pageWidth()*ScCore->primaryMainWindow()->view->Doc->unitRatio());
 				ScCore->primaryMainWindow()->doc->pdfOptions().bleeds.Left = self->bleedl/ScCore->primaryMainWindow()->view->Doc->unitRatio();
-				self->bleedr = minmaxd(self->bleedr, 0, ScCore->primaryMainWindow()->view->Doc->pageWidth*ScCore->primaryMainWindow()->view->Doc->unitRatio());
+				self->bleedr = minmaxd(self->bleedr, 0, ScCore->primaryMainWindow()->view->Doc->pageWidth()*ScCore->primaryMainWindow()->view->Doc->unitRatio());
 				ScCore->primaryMainWindow()->doc->pdfOptions().bleeds.Right = self->bleedr/ScCore->primaryMainWindow()->view->Doc->unitRatio();
-				self->bleedb = minmaxd(self->bleedb, 0, ScCore->primaryMainWindow()->view->Doc->pageHeight*ScCore->primaryMainWindow()->view->Doc->unitRatio());
+				self->bleedb = minmaxd(self->bleedb, 0, ScCore->primaryMainWindow()->view->Doc->pageHeight()*ScCore->primaryMainWindow()->view->Doc->unitRatio());
 				ScCore->primaryMainWindow()->doc->pdfOptions().bleeds.Bottom = self->bleedb/ScCore->primaryMainWindow()->view->Doc->unitRatio();
 				ScCore->primaryMainWindow()->doc->pdfOptions().Encrypt = false;
 				ScCore->primaryMainWindow()->doc->pdfOptions().PresentMode = false;
Index: scribus/plugins/scriptplugin/objprinter.cpp
===================================================================
--- scribus/plugins/scriptplugin/objprinter.cpp	(revision 14990)
+++ scribus/plugins/scriptplugin/objprinter.cpp	(revision 14991)
@@ -477,8 +477,8 @@
 				{
 					QString tmp;
 					QStringList opts;
-					opts.append( QString("-dDEVICEWIDTHPOINTS=%1").arg(tmp.setNum(ScCore->primaryMainWindow()->doc->pageWidth)) );
-					opts.append( QString("-dDEVICEHEIGHTPOINTS=%1").arg(tmp.setNum(ScCore->primaryMainWindow()->doc->pageHeight)) );
+					opts.append( QString("-dDEVICEWIDTHPOINTS=%1").arg(tmp.setNum(ScCore->primaryMainWindow()->doc->pageWidth())) );
+					opts.append( QString("-dDEVICEHEIGHTPOINTS=%1").arg(tmp.setNum(ScCore->primaryMainWindow()->doc->pageHeight())) );
 					convertPS2PS(fna, fna+".tmp", opts, options.prnEngine);
 					moveFile( fna + ".tmp", fna );
 				}
Index: scribus/plugins/scripter/api_document.cpp
===================================================================
--- scribus/plugins/scripter/api_document.cpp	(revision 14990)
+++ scribus/plugins/scripter/api_document.cpp	(revision 14991)
@@ -182,7 +182,7 @@
  */
 double Dimensions::width()
 {
-    return ScCore->primaryMainWindow()->doc->pageWidth;
+	return ScCore->primaryMainWindow()->doc->pageWidth();
 }
 
 
@@ -194,7 +194,7 @@
  */
 double Dimensions::height()
 {
-    return ScCore->primaryMainWindow()->doc->pageHeight;
+	return ScCore->primaryMainWindow()->doc->pageHeight();
 }
 
 
Index: scribus/plugins/saveastemplateplugin/satemplate.cpp
===================================================================
--- scribus/plugins/saveastemplateplugin/satemplate.cpp	(revision 14990)
+++ scribus/plugins/saveastemplateplugin/satemplate.cpp	(revision 14991)
@@ -146,8 +146,8 @@
 	if (currentFile !=  doc->DocName)
 	{
 		satdialog* satdia = new satdialog(doc->scMW(),docName,
-                                          static_cast<int>(doc->pageWidth + 0.5),
-                                          static_cast<int>(doc->pageHeight + 0.5));
+										  static_cast<int>(doc->pageWidth() + 0.5),
+										  static_cast<int>(doc->pageHeight() + 0.5));
 		if (satdia->exec())
 		{
 			sat* s = new sat(doc, satdia, docPath.right(docPath.length() - docPath.lastIndexOf('/') - 1),docDir);
@@ -208,8 +208,8 @@
 {
 	QString tnsmallName = dia->nameEdit->text() + "tn.png";
 	QString tnlargeName = dia->nameEdit->text() + ".png";
-	double pageh = m_Doc->pageHeight;
-	double pagew = m_Doc->pageWidth;
+	double pageh = m_Doc->pageHeight();
+	double pagew = m_Doc->pageWidth();
 	int pageSizeSmall = 0;
 	int pageSizeLarge = 0;
 	if (pageh > pagew)
Index: scribus/plugins/pixmapexport/dialog.cpp
===================================================================
--- scribus/plugins/pixmapexport/dialog.cpp	(revision 14990)
+++ scribus/plugins/pixmapexport/dialog.cpp	(revision 14991)
@@ -66,8 +66,8 @@
 void ExportForm::computeSize()
 {
 	double pixmapSize;
-	double pw = (onePageRadio->isChecked() && m_doc->currentPage()) ? m_doc->currentPage()->width() : m_doc->pageWidth;
-	double ph = (onePageRadio->isChecked() && m_doc->currentPage()) ? m_doc->currentPage()->height() : m_doc->pageHeight;
+	double pw = (onePageRadio->isChecked() && m_doc->currentPage()) ? m_doc->currentPage()->width() : m_doc->pageWidth();
+	double ph = (onePageRadio->isChecked() && m_doc->currentPage()) ? m_doc->currentPage()->height() : m_doc->pageHeight();
 	(ph > pw) ? pixmapSize = ph : pixmapSize = pw;
 	int maxGr = qRound(pixmapSize * enlargementBox->value() * (DPIBox->value() / 72.0) / 100.0);
 	double sc = qMin(maxGr / pw, maxGr / ph);
Index: scribus/plugins/fileloader/scribus12format/scribus12format.cpp
===================================================================
--- scribus/plugins/fileloader/scribus12format/scribus12format.cpp	(revision 14990)
+++ scribus/plugins/fileloader/scribus12format/scribus12format.cpp	(revision 14991)
@@ -269,17 +269,17 @@
 	* Attribute von DOCUMENT auslesen
 	*/
 		if (dc.hasAttribute("PAGEWIDTH"))
-			m_Doc->pageWidth=ScCLocale::toDoubleC(dc.attribute("PAGEWIDTH"));
+			m_Doc->setPageWidth(ScCLocale::toDoubleC(dc.attribute("PAGEWIDTH")));
 		else
-			m_Doc->pageWidth=ScCLocale::toDoubleC(dc.attribute("PAGEWITH"));
-		m_Doc->pageHeight=ScCLocale::toDoubleC(dc.attribute("PAGEHEIGHT"));
+			m_Doc->setPageWidth(ScCLocale::toDoubleC(dc.attribute("PAGEWITH")));
+		m_Doc->setPageHeight(ScCLocale::toDoubleC(dc.attribute("PAGEHEIGHT")));
 		m_Doc->pageMargins.Left=qMax(0.0, ScCLocale::toDoubleC(dc.attribute("BORDERLEFT")));
 		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->PageOri = dc.attribute("ORIENTATION", "0").toInt();
-		m_Doc->m_pageSize = dc.attribute("PAGESIZE");
+		m_Doc->setPageOrientation(dc.attribute("ORIENTATION", "0").toInt());
+		m_Doc->setPageSize(dc.attribute("PAGESIZE"));
 		m_Doc->FirstPnum = dc.attribute("FIRSTNUM", "1").toInt();
 		m_Doc->currentPageLayout=dc.attribute("BOOK", "0").toInt();
 		int fp;
Index: scribus/plugins/fileloader/scribus13format/scribus13format.cpp
===================================================================
--- scribus/plugins/fileloader/scribus13format/scribus13format.cpp	(revision 14990)
+++ scribus/plugins/fileloader/scribus13format/scribus13format.cpp	(revision 14991)
@@ -245,8 +245,8 @@
 	*/
 		//CB Add this in to set this in the file in memory. Its saved, why not load it.
 		//Will of course be replaced by per page settings although we still probably need a document default
-		m_Doc->m_pageSize = dc.attribute("PAGESIZE");
-		m_Doc->PageOri = dc.attribute("ORIENTATION", "0").toInt();
+		m_Doc->setPageSize(dc.attribute("PAGESIZE"));
+		m_Doc->setPageOrientation(dc.attribute("ORIENTATION", "0").toInt());
 		m_Doc->FirstPnum = dc.attribute("FIRSTNUM", "1").toInt();
 		m_Doc->currentPageLayout=dc.attribute("BOOK", "0").toInt();
 		int fp;
@@ -330,10 +330,10 @@
 		m_Doc->setHyphMinimumWordLength(dc.attribute("MINWORDLEN", "3").toInt());
 		m_Doc->setHyphConsecutiveLines(dc.attribute("HYCOUNT", "2").toInt());
 		if (dc.hasAttribute("PAGEWIDTH"))
-			m_Doc->pageWidth = ScCLocale::toDoubleC(dc.attribute("PAGEWIDTH"));
+			m_Doc->setPageWidth(ScCLocale::toDoubleC(dc.attribute("PAGEWIDTH")));
 		else
-			m_Doc->pageWidth = ScCLocale::toDoubleC(dc.attribute("PAGEWITH"));
-		m_Doc->pageHeight = ScCLocale::toDoubleC(dc.attribute("PAGEHEIGHT"));
+			m_Doc->setPageWidth(ScCLocale::toDoubleC(dc.attribute("PAGEWITH")));
+		m_Doc->setPageHeight(ScCLocale::toDoubleC(dc.attribute("PAGEHEIGHT")));
 		m_Doc->pageMargins.Left  = qMax(0.0, ScCLocale::toDoubleC("BORDERLEFT"));
 		m_Doc->pageMargins.Right = qMax(0.0, ScCLocale::toDoubleC("BORDERRIGHT"));
 		m_Doc->pageMargins.Top   = qMax(0.0, ScCLocale::toDoubleC("BORDERTOP"));
@@ -1187,15 +1187,15 @@
 	elem.setAttribute("Version", QString(VERSION));
 	QDomElement dc=docu.createElement("DOCUMENT");
 	dc.setAttribute("ANZPAGES",m_Doc->DocPages.count());
-	dc.setAttribute("PAGEWIDTH",m_Doc->pageWidth);
-	dc.setAttribute("PAGEHEIGHT",m_Doc->pageHeight);
+	dc.setAttribute("PAGEWIDTH",m_Doc->pageWidth());
+	dc.setAttribute("PAGEHEIGHT",m_Doc->pageHeight());
 	dc.setAttribute("BORDERLEFT",m_Doc->pageMargins.Left);
 	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("ORIENTATION",m_Doc->PageOri);
-	dc.setAttribute("PAGESIZE",m_Doc->m_pageSize);
+	dc.setAttribute("ORIENTATION",m_Doc->pageOrientation());
+	dc.setAttribute("PAGESIZE",m_Doc->pageSize());
 	dc.setAttribute("FIRSTNUM",m_Doc->FirstPnum);
 	dc.setAttribute("BOOK", m_Doc->currentPageLayout);
 	if(m_Doc->usesAutomaticTextFrames())
Index: scribus/plugins/fileloader/scribus150format/scribus150format_save.cpp
===================================================================
--- scribus/plugins/fileloader/scribus150format/scribus150format_save.cpp	(revision 14990)
+++ scribus/plugins/fileloader/scribus150format/scribus150format_save.cpp	(revision 14991)
@@ -80,8 +80,8 @@
 
 	docu.writeStartElement("DOCUMENT");
 	docu.writeAttribute("ANZPAGES"    , m_Doc->DocPages.count());
-	docu.writeAttribute("PAGEWIDTH"   , m_Doc->pageWidth);
-	docu.writeAttribute("PAGEHEIGHT"  , m_Doc->pageHeight);
+	docu.writeAttribute("PAGEWIDTH"   , m_Doc->pageWidth());
+	docu.writeAttribute("PAGEHEIGHT"  , m_Doc->pageHeight());
 	docu.writeAttribute("BORDERLEFT"  , m_Doc->pageMargins.Left);
 	docu.writeAttribute("BORDERRIGHT" , m_Doc->pageMargins.Right);
 	docu.writeAttribute("BORDERTOP"   , m_Doc->pageMargins.Top);
@@ -91,8 +91,8 @@
 	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->PageOri);
-	docu.writeAttribute("PAGESIZE"    , m_Doc->m_pageSize);
+	docu.writeAttribute("ORIENTATION" , m_Doc->pageOrientation());
+	docu.writeAttribute("PAGESIZE"    , m_Doc->pageSize());
 	docu.writeAttribute("FIRSTNUM"    , m_Doc->FirstPnum);
 	docu.writeAttribute("BOOK"        , m_Doc->currentPageLayout);
 	if(m_Doc->usesAutomaticTextFrames())
Index: scribus/plugins/fileloader/scribus150format/scribus150format.cpp
===================================================================
--- scribus/plugins/fileloader/scribus150format/scribus150format.cpp	(revision 14990)
+++ scribus/plugins/fileloader/scribus150format/scribus150format.cpp	(revision 14991)
@@ -733,8 +733,8 @@
 
 void Scribus150Format::readDocAttributes(ScribusDoc* doc, ScXmlStreamAttributes& attrs)
 {
-	m_Doc->m_pageSize = attrs.valueAsString("PAGESIZE");
-	m_Doc->PageOri    = attrs.valueAsInt("ORIENTATION", 0);
+	m_Doc->setPageSize(attrs.valueAsString("PAGESIZE"));
+	m_Doc->setPageOrientation(attrs.valueAsInt("ORIENTATION", 0));
 	m_Doc->FirstPnum  = attrs.valueAsInt("FIRSTNUM", 1);
 	m_Doc->currentPageLayout = attrs.valueAsInt("BOOK", 0);
 
@@ -748,10 +748,10 @@
 	m_Doc->setHyphConsecutiveLines(attrs.valueAsInt("HYCOUNT", 2));
 
 	if (attrs.hasAttribute("PAGEWIDTH"))
-		m_Doc->pageWidth = attrs.valueAsDouble("PAGEWIDTH");
+		m_Doc->setPageWidth(attrs.valueAsDouble("PAGEWIDTH"));
 	else
-		m_Doc->pageWidth = attrs.valueAsDouble("PAGEWITH");
-	m_Doc->pageHeight = attrs.valueAsDouble("PAGEHEIGHT");
+		m_Doc->setPageWidth(attrs.valueAsDouble("PAGEWITH"));
+	m_Doc->setPageHeight(attrs.valueAsDouble("PAGEHEIGHT"));
 	m_Doc->pageMargins.Left  = qMax(0.0, attrs.valueAsDouble("BORDERLEFT"));
 	m_Doc->pageMargins.Right = qMax(0.0, attrs.valueAsDouble("BORDERRIGHT"));
 	m_Doc->pageMargins.Top   = qMax(0.0, attrs.valueAsDouble("BORDERTOP"));
Index: scribus/plugins/fileloader/scribus134format/scribus134format_save.cpp
===================================================================
--- scribus/plugins/fileloader/scribus134format/scribus134format_save.cpp	(revision 14990)
+++ scribus/plugins/fileloader/scribus134format/scribus134format_save.cpp	(revision 14991)
@@ -77,8 +77,8 @@
 
 	docu.writeStartElement("DOCUMENT");
 	docu.writeAttribute("ANZPAGES"    , m_Doc->DocPages.count());
-	docu.writeAttribute("PAGEWIDTH"   , m_Doc->pageWidth);
-	docu.writeAttribute("PAGEHEIGHT"  , m_Doc->pageHeight);
+	docu.writeAttribute("PAGEWIDTH"   , m_Doc->pageWidth());
+	docu.writeAttribute("PAGEHEIGHT"  , m_Doc->pageHeight());
 	docu.writeAttribute("BORDERLEFT"  , m_Doc->pageMargins.Left);
 	docu.writeAttribute("BORDERRIGHT" , m_Doc->pageMargins.Right);
 	docu.writeAttribute("BORDERTOP"   , m_Doc->pageMargins.Top);
@@ -88,8 +88,8 @@
 	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->PageOri);
-	docu.writeAttribute("PAGESIZE"    , m_Doc->m_pageSize);
+	docu.writeAttribute("ORIENTATION" , m_Doc->pageOrientation());
+	docu.writeAttribute("PAGESIZE"    , m_Doc->pageSize());
 	docu.writeAttribute("FIRSTNUM"    , m_Doc->FirstPnum);
 	docu.writeAttribute("BOOK"        , m_Doc->currentPageLayout);
 	if(m_Doc->usesAutomaticTextFrames())
Index: scribus/plugins/fileloader/scribus134format/scribus134format.cpp
===================================================================
--- scribus/plugins/fileloader/scribus134format/scribus134format.cpp	(revision 14990)
+++ scribus/plugins/fileloader/scribus134format/scribus134format.cpp	(revision 14991)
@@ -728,8 +728,8 @@
 
 void Scribus134Format::readDocAttributes(ScribusDoc* doc, ScXmlStreamAttributes& attrs)
 {
-	m_Doc->m_pageSize = attrs.valueAsString("PAGESIZE");
-	m_Doc->PageOri    = attrs.valueAsInt("ORIENTATION", 0);
+	m_Doc->setPageSize(attrs.valueAsString("PAGESIZE"));
+	m_Doc->setPageOrientation(attrs.valueAsInt("ORIENTATION", 0));
 	m_Doc->FirstPnum  = attrs.valueAsInt("FIRSTNUM", 1);
 	m_Doc->currentPageLayout = attrs.valueAsInt("BOOK", 0);
 
@@ -743,10 +743,10 @@
 	m_Doc->setHyphConsecutiveLines(attrs.valueAsInt("HYCOUNT", 2));
 
 	if (attrs.hasAttribute("PAGEWIDTH"))
-		m_Doc->pageWidth = attrs.valueAsDouble("PAGEWIDTH");
+		m_Doc->setPageWidth(attrs.valueAsDouble("PAGEWIDTH"));
 	else
-		m_Doc->pageWidth = attrs.valueAsDouble("PAGEWITH");
-	m_Doc->pageHeight = attrs.valueAsDouble("PAGEHEIGHT");
+		m_Doc->setPageWidth(attrs.valueAsDouble("PAGEWITH"));
+	m_Doc->setPageHeight(attrs.valueAsDouble("PAGEHEIGHT"));
 	m_Doc->pageMargins.Left  = qMax(0.0, attrs.valueAsDouble("BORDERLEFT"));
 	m_Doc->pageMargins.Right = qMax(0.0, attrs.valueAsDouble("BORDERRIGHT"));
 	m_Doc->pageMargins.Top   = qMax(0.0, attrs.valueAsDouble("BORDERTOP"));
Index: scribus/plugins/import/cvg/importcvg.cpp
===================================================================
--- scribus/plugins/import/cvg/importcvg.cpp	(revision 14990)
+++ scribus/plugins/import/cvg/importcvg.cpp	(revision 14991)
@@ -264,10 +264,10 @@
 	if ((ret) || (!interactive))
 	{
 		if (docWidth > docHeight)
-			m_Doc->PageOri = 1;
+			m_Doc->setPageOrientation(1);
 		else
-			m_Doc->PageOri = 0;
-		m_Doc->m_pageSize = "Custom";
+			m_Doc->setPageOrientation(0);
+		m_Doc->setPageSize("Custom");
 	}
 	Elements.clear();
 	FPoint minSize = m_Doc->minCanvasCoordinate;
Index: scribus/plugins/import/svg/svgplugin.cpp
===================================================================
--- scribus/plugins/import/svg/svgplugin.cpp	(revision 14990)
+++ scribus/plugins/import/svg/svgplugin.cpp	(revision 14991)
@@ -447,10 +447,10 @@
 	if ((ret) || (!interactive))
 	{
 		if (width > height)
-			m_Doc->PageOri = 1;
+			m_Doc->setPageOrientation(1);
 		else
-			m_Doc->PageOri = 0;
-		m_Doc->m_pageSize = "Custom";
+			m_Doc->setPageOrientation(0);
+		m_Doc->setPageSize("Custom");
 	}
 	FPoint minSize = m_Doc->minCanvasCoordinate;
 	FPoint maxSize = m_Doc->maxCanvasCoordinate;
Index: scribus/plugins/import/ps/importps.cpp
===================================================================
--- scribus/plugins/import/ps/importps.cpp	(revision 14990)
+++ scribus/plugins/import/ps/importps.cpp	(revision 14991)
@@ -199,10 +199,10 @@
 	if ((ret) || (!interactive))
 	{
 		if (b-x > h-y)
-			m_Doc->PageOri = 1;
+			m_Doc->setPageOrientation(1);
 		else
-			m_Doc->PageOri = 0;
-		m_Doc->m_pageSize = "Custom";
+			m_Doc->setPageOrientation(0);
+		m_Doc->setPageSize("Custom");
 	}
 	ColorList::Iterator it;
 	for (it = CustColors.begin(); it != CustColors.end(); ++it)
Index: scribus/plugins/import/cgm/importcgm.cpp
===================================================================
--- scribus/plugins/import/cgm/importcgm.cpp	(revision 14990)
+++ scribus/plugins/import/cgm/importcgm.cpp	(revision 14991)
@@ -265,10 +265,10 @@
 	if ((ret) || (!interactive))
 	{
 		if (docWidth > docHeight)
-			m_Doc->PageOri = 1;
+			m_Doc->setPageOrientation(1);
 		else
-			m_Doc->PageOri = 0;
-		m_Doc->m_pageSize = "Custom";
+			m_Doc->setPageOrientation(0);
+		m_Doc->setPageSize("Custom");
 	}
 	Elements.clear();
 	FPoint minSize = m_Doc->minCanvasCoordinate;
@@ -2537,11 +2537,11 @@
 		{
 			m_Doc->setPage(width, height, 0, 0, 0, 0, 0, 0, false, false);
 			if (width > height)
-				m_Doc->PageOri = 1;
+				m_Doc->setPageOrientation(1);
 			else
-				m_Doc->PageOri = 0;
-			m_Doc->m_pageSize = "Custom";
-			m_Doc->changePageMargins(0, 0, 0, 0, height, width, height, width, m_Doc->PageOri, m_Doc->m_pageSize, m_Doc->currentPage()->pageNr(), 0);
+				m_Doc->setPageOrientation(0);
+			m_Doc->setPageSize("Custom");
+			m_Doc->changePageMargins(0, 0, 0, 0, height, width, height, width, m_Doc->pageOrientation(), m_Doc->pageSize(), m_Doc->currentPage()->pageNr(), 0);
 		}
 		else
 		{
Index: scribus/plugins/import/pct/importpct.cpp
===================================================================
--- scribus/plugins/import/pct/importpct.cpp	(revision 14990)
+++ scribus/plugins/import/pct/importpct.cpp	(revision 14991)
@@ -265,10 +265,10 @@
 	if ((ret) || (!interactive))
 	{
 		if (docWidth > docHeight)
-			m_Doc->PageOri = 1;
+			m_Doc->setPageOrientation(1);
 		else
-			m_Doc->PageOri = 0;
-		m_Doc->m_pageSize = "Custom";
+			m_Doc->setPageOrientation(0);
+		m_Doc->setPageSize("Custom");
 	}
 	Elements.clear();
 	FPoint minSize = m_Doc->minCanvasCoordinate;
Index: scribus/plugins/import/ai/importai.cpp
===================================================================
--- scribus/plugins/import/ai/importai.cpp	(revision 14990)
+++ scribus/plugins/import/ai/importai.cpp	(revision 14991)
@@ -463,10 +463,10 @@
 	if ((ret) || (!interactive))
 	{
 		if (b-x > h-y)
-			m_Doc->PageOri = 1;
+			m_Doc->setPageOrientation(1);
 		else
-			m_Doc->PageOri = 0;
-		m_Doc->m_pageSize = "Custom";
+			m_Doc->setPageOrientation(0);
+		m_Doc->setPageSize("Custom");
 	}
 	ColorList::Iterator it;
 	for (it = CustColors.begin(); it != CustColors.end(); ++it)
Index: scribus/plugins/import/wmf/wmfimport.cpp
===================================================================
--- scribus/plugins/import/wmf/wmfimport.cpp	(revision 14990)
+++ scribus/plugins/import/wmf/wmfimport.cpp	(revision 14991)
@@ -668,10 +668,10 @@
 	if ((ret) || (!interactive))
 	{
 		if (width > height)
-			m_Doc->PageOri = 1;
+			m_Doc->setPageOrientation(1);
 		else
-			m_Doc->PageOri = 0;
-		m_Doc->m_pageSize = "Custom";
+			m_Doc->setPageOrientation(0);
+		m_Doc->setPageSize("Custom");
 	}
 	FPoint minSize = m_Doc->minCanvasCoordinate;
 	FPoint maxSize = m_Doc->maxCanvasCoordinate;
Index: scribus/plugins/import/xar/importxar.cpp
===================================================================
--- scribus/plugins/import/xar/importxar.cpp	(revision 14990)
+++ scribus/plugins/import/xar/importxar.cpp	(revision 14991)
@@ -223,10 +223,10 @@
 	if ((ret) || (!interactive))
 	{
 		if (docWidth > docHeight)
-			m_Doc->PageOri = 1;
+			m_Doc->setPageOrientation(1);
 		else
-			m_Doc->PageOri = 0;
-		m_Doc->m_pageSize = "Custom";
+			m_Doc->setPageOrientation(0);
+		m_Doc->setPageSize("Custom");
 	}
 	Elements.clear();
 	FPoint minSize = m_Doc->minCanvasCoordinate;
@@ -3163,11 +3163,11 @@
 	{
 		m_Doc->setPage(w, h, 0, 0, 0, 0, 0, 0, false, false);
 		if (w > h)
-			m_Doc->PageOri = 1;
+			m_Doc->setPageOrientation(1);
 		else
-			m_Doc->PageOri = 0;
-		m_Doc->m_pageSize = "Custom";
-		m_Doc->changePageMargins(0, 0, 0, 0, h, w, h, w, m_Doc->PageOri, m_Doc->m_pageSize, m_Doc->currentPage()->pageNr(), 0);
+			m_Doc->setPageOrientation(0);
+		m_Doc->setPageSize("Custom");
+		m_Doc->changePageMargins(0, 0, 0, 0, h, w, h, w, m_Doc->pageOrientation(), m_Doc->pageSize(), m_Doc->currentPage()->pageNr(), 0);
 	}
 	docHeight = h;
 	docWidth = w;
Index: scribus/plugins/import/oodraw/oodrawimp.cpp
===================================================================
--- scribus/plugins/import/oodraw/oodrawimp.cpp	(revision 14990)
+++ scribus/plugins/import/oodraw/oodrawimp.cpp	(revision 14991)
@@ -556,10 +556,10 @@
 	if ((ret) || (!interactive))
 	{
 		if (width > height)
-			m_Doc->PageOri = 1;
+			m_Doc->setPageOrientation(1);
 		else
-			m_Doc->PageOri = 0;
-		m_Doc->m_pageSize = "Custom";
+			m_Doc->setPageOrientation(0);
+		m_Doc->setPageSize("Custom");
 		QDomNode mpg;
 		QDomElement metaElem = inpMeta.documentElement();
 		QDomElement mp = metaElem.namedItem( "office:meta" ).toElement();
Index: scribus/plugins/import/drw/importdrw.cpp
===================================================================
--- scribus/plugins/import/drw/importdrw.cpp	(revision 14990)
+++ scribus/plugins/import/drw/importdrw.cpp	(revision 14991)
@@ -279,10 +279,10 @@
 	if ((ret) || (!interactive))
 	{
 		if (docWidth > docHeight)
-			m_Doc->PageOri = 1;
+			m_Doc->setPageOrientation(1);
 		else
-			m_Doc->PageOri = 0;
-		m_Doc->m_pageSize = "Custom";
+			m_Doc->setPageOrientation(0);
+		m_Doc->setPageSize("Custom");
 	}
 	Elements.clear();
 	FPoint minSize = m_Doc->minCanvasCoordinate;
@@ -898,11 +898,11 @@
 			{
 				m_Doc->setPage(docWidth, docHeight, 0, 0, 0, 0, 0, 0, false, false);
 				if (docWidth > docHeight)
-					m_Doc->PageOri = 1;
+					m_Doc->setPageOrientation(1);
 				else
-					m_Doc->PageOri = 0;
-				m_Doc->m_pageSize = "Custom";
-				m_Doc->changePageMargins(0, 0, 0, 0, docHeight, docWidth, docHeight, docWidth, m_Doc->PageOri, m_Doc->m_pageSize, m_Doc->currentPage()->pageNr(), 0);
+					m_Doc->setPageOrientation(0);
+				m_Doc->setPageSize("Custom");
+				m_Doc->changePageMargins(0, 0, 0, 0, docHeight, docWidth, docHeight, docWidth, m_Doc->pageOrientation(), m_Doc->pageSize(), m_Doc->currentPage()->pageNr(), 0);
 				cmdText = QString("DRW Page  Width %1  Height %2").arg(docWidth).arg(docHeight);
 			}
 			break;
Index: scribus/plugins/import/wpg/importwpg.cpp
===================================================================
--- scribus/plugins/import/wpg/importwpg.cpp	(revision 14990)
+++ scribus/plugins/import/wpg/importwpg.cpp	(revision 14991)
@@ -81,11 +81,11 @@
 	{
 		m_Doc->setPage(72 * width, 72 * height, 0, 0, 0, 0, 0, 0, false, false);
 		if (width > height)
-			m_Doc->PageOri = 1;
+			m_Doc->setPageOrientation(1);
 		else
-			m_Doc->PageOri = 0;
-		m_Doc->m_pageSize = "Custom";
-		m_Doc->changePageMargins(0, 0, 0, 0, 72 * height, 72 * width, 72 * height, 72 * width, m_Doc->PageOri, m_Doc->m_pageSize, m_Doc->currentPage()->pageNr(), 0);
+			m_Doc->setPageOrientation(0);
+		m_Doc->setPageSize("Custom");
+		m_Doc->changePageMargins(0, 0, 0, 0, 72 * height, 72 * width, 72 * height, 72 * width, m_Doc->pageOrientation(), m_Doc->pageSize(), m_Doc->currentPage()->pageNr(), 0);
 	}
 	firstLayer = true;
 }
@@ -673,10 +673,10 @@
 	if ((ret) || (!interactive))
 	{
 		if (docWidth > docHeight)
-			m_Doc->PageOri = 1;
+			m_Doc->setPageOrientation(1);
 		else
-			m_Doc->PageOri = 0;
-		m_Doc->m_pageSize = "Custom";
+			m_Doc->setPageOrientation(0);
+		m_Doc->setPageSize("Custom");
 	}
 	Elements.clear();
 	FPoint minSize = m_Doc->minCanvasCoordinate;
Index: scribus/plugins/import/xfig/importxfig.cpp
===================================================================
--- scribus/plugins/import/xfig/importxfig.cpp	(revision 14990)
+++ scribus/plugins/import/xfig/importxfig.cpp	(revision 14991)
@@ -400,10 +400,10 @@
 	if ((ret) || (!interactive))
 	{
 		if (b-x > h-y)
-			m_Doc->PageOri = 1;
+			m_Doc->setPageOrientation(1);
 		else
-			m_Doc->PageOri = 0;
-		m_Doc->m_pageSize = "Custom";
+			m_Doc->setPageOrientation(0);
+		m_Doc->setPageSize("Custom");
 	}
 	Elements.clear();
 	FPoint minSize = m_Doc->minCanvasCoordinate;
Index: scribus/pslib.cpp
===================================================================
--- scribus/pslib.cpp	(revision 14990)
+++ scribus/pslib.cpp	(revision 14991)
@@ -1566,7 +1566,7 @@
 		int pgNum = pageNs[0]-1;
 		gx -= Doc->Pages->at(pgNum)->xOffset();
 		gy -= Doc->Pages->at(pgNum)->yOffset();
-		errorOccured = !PS_begin_doc(Doc, gx, Doc->pageHeight - (gy+gh), gx + gw, Doc->pageHeight - gy, 1*pagemult, false, sep, farb, Ic, gcr);
+		errorOccured = !PS_begin_doc(Doc, gx, Doc->pageHeight() - (gy+gh), gx + gw, Doc->pageHeight() - gy, 1*pagemult, false, sep, farb, Ic, gcr);
 	}
 	else
 	{




More information about the scribus-commit mailing list