Subversion Repositories Scribus

Compare Revisions

Ignore whitespace Rev 3723 → Rev 3724

/branches/Version13x/Scribus/scribus/fileloader.cpp
530,7 → 530,7
if (((pg.tagName()=="PAGE") || (pg.tagName()=="MASTERPAGE")) && (QStoInt(pg.attribute("NUM")) == PageToLoad))
{
a = doc->currentPage->pageNr();
Apage = doc->Pages.at(a);
Apage = doc->Pages->at(a);
if ((pg.tagName()!="MASTERPAGE") && (Mpage))
{
PAGE=PAGE.nextSibling();
1372,16 → 1372,16
if (PgNam.isEmpty())
{
doc->pageCount = Pgc;
doc->Pages = doc->DocPages;
//doc->Pages = &doc->DocPages;
doc->setUsesAutomaticTextFrames(AtFl);
doc->masterPageMode = false;
doc->setMasterPageMode(false);
}
else
{
doc->pageCount = 0;
doc->setUsesAutomaticTextFrames(false);
doc->Pages = doc->MasterPages;
doc->masterPageMode = true;
//doc->Pages = &doc->MasterPages;
doc->setMasterPageMode(true);
}
//CB: Stop calling damn GUI code in loading docs! IT doesnt *look* like
//this makes a difference apart from being faster, of course.
1390,7 → 1390,7
Apage = doc->addPage(a);
if (PgNam.isEmpty())
{
doc->DocPages = doc->Pages;
//doc->DocPages = doc->Pages;
doc->pageCount = Pgc+1;
}
else
1397,7 → 1397,7
{
Apage->setPageName(PgNam);
doc->MasterNames[PgNam] = a;
doc->MasterPages = doc->Pages;
//doc->MasterPages = doc->Pages;
doc->pageCount = Pgc;
}
doc->setUsesAutomaticTextFrames(AtFl);
1404,7 → 1404,7
Apage->LeftPg=QStoInt(pg.attribute("LEFT","0"));
QString Mus = "";
Mus = pg.attribute("MNAM","Normal");
if (!doc->masterPageMode)
if (!doc->masterPageMode())
Apage->MPageNam = Mus;
else
Apage->MPageNam = "";
1427,7 → 1427,8
Apage->initialMargins.Right = QStodouble(pg.attribute("BORDERRIGHT"));
Apage->Margins.Top = Apage->initialMargins.Top;
Apage->Margins.Bottom = Apage->initialMargins.Bottom;
doc->masterPageMode = false;
doc->setMasterPageMode(false);
//doc->Pages=&doc->DocPages;
if ((pg.hasAttribute("NumVGuides")) && (QStoInt(pg.attribute("NumVGuides","0")) != 0))
{
tmp = pg.attribute("VerticalGuides");
1464,14 → 1465,14
if ((pg.tagName()=="PAGEOBJECT") || (pg.tagName()=="FRAMEOBJECT"))
{
doc->Items = doc->DocItems;
doc->Pages = doc->DocPages;
doc->masterPageMode = false;
//doc->Pages = &doc->DocPages;
doc->setMasterPageMode(false);
}
else
{
doc->Items = doc->MasterItems;
doc->Pages = doc->MasterPages;
doc->masterPageMode = true;
//doc->Pages = &doc->MasterPages;
doc->setMasterPageMode(true);
}
if ((!pg.attribute("OnMasterPage").isEmpty()) && (pg.tagName()=="MASTEROBJECT"))
doc->currentPage = doc->MasterPages.at(doc->MasterNames[pg.attribute("OnMasterPage")]);
1586,14 → 1587,15
if ((pg.tagName()=="PAGEOBJECT") || (pg.tagName()=="FRAMEOBJECT"))
{
doc->DocItems = doc->Items;
doc->DocPages = doc->Pages;
//doc->DocPages = doc->Pages;
}
else
{
doc->MasterItems = doc->Items;
doc->MasterPages = doc->Pages;
//doc->MasterPages = doc->Pages;
}
doc->masterPageMode = false;
doc->setMasterPageMode(false);
//doc->Pages=&doc->DocPages;
counter++;
}
PAGE=PAGE.nextSibling();
1623,10 → 1625,10
ta->BottomLink = 0;
}
}
doc->Pages = doc->DocPages;
doc->pageCount = doc->Pages.count();
//doc->Pages = &doc->DocPages;
doc->setMasterPageMode(false);
doc->pageCount = doc->Pages->count();
doc->Items = doc->DocItems;
doc->masterPageMode = false;
//ScApp->view->reformPages();
doc->reformPages(maximumX, maximumY);
if (doc->Layers.count() == 0)
/branches/Version13x/Scribus/scribus/checkDocument.cpp
191,7 → 191,7
}
if (masterPageItemMap.contains(ite))
{
if (!document->masterPageMode)
if (!document->masterPageMode())
emit selectMasterPage(document->MasterItems.at(masterPageItemMap[ite])->OnMasterPage);
emit selectElement(-1, masterPageItemMap[ite]);
return;
/branches/Version13x/Scribus/scribus/preview.cpp
442,8 → 442,8
return ret;
}
QString tmp, tmp2, tmp3;
double b = doc->Pages.at(Seite)->width() * Res / 72.0;
double h = doc->Pages.at(Seite)->height() * Res / 72.0;
double b = doc->Pages->at(Seite)->width() * Res / 72.0;
double h = doc->Pages->at(Seite)->height() * Res / 72.0;
cmd1 = getShortPathName(prefsManager->ghostscriptExecutable());
cmd1 += " -q -dNOPAUSE -dPARANOIDSAFER -r"+tmp.setNum(qRound(Res))+" -g"+tmp2.setNum(qRound(b))+"x"+tmp3.setNum(qRound(h));
if (EnableCMYK->isChecked())
515,8 → 515,8
return ret;
}
QString tmp, tmp2, tmp3;
double b = doc->Pages.at(Seite)->width() * Res / 72.0;
double h = doc->Pages.at(Seite)->height() * Res / 72.0;
double b = doc->Pages->at(Seite)->width() * Res / 72.0;
double h = doc->Pages->at(Seite)->height() * Res / 72.0;
cmd1 = getShortPathName(prefsManager->ghostscriptExecutable());
cmd1 += " -q -dNOPAUSE -dPARANOIDSAFER -r"+tmp.setNum(qRound(Res))+" -g"+tmp2.setNum(qRound(b))+"x"+tmp3.setNum(qRound(h));
if (AliasText->isChecked())
633,8 → 633,8
{
int ret = -1;
QPixmap Bild;
double b = doc->Pages.at(Seite)->width() * Res / 72.0;
double h = doc->Pages.at(Seite)->height() * Res / 72.0;
double b = doc->Pages->at(Seite)->width() * Res / 72.0;
double h = doc->Pages->at(Seite)->height() * Res / 72.0;
qApp->setOverrideCursor(QCursor(waitCursor), true);
if ((Seite != APage) || (EnableCMYK->isChecked() != CMode) || (SMode != scaleBox->currentItem())
|| (AliasText->isChecked() != TxtAl) || (AliasGr->isChecked() != GrAl) || (EnableGCR->isChecked() != GMode)
/branches/Version13x/Scribus/scribus/margindialog.cpp
78,7 → 78,7
moveObjects->setText( tr( "Move Objects with their Page" ) );
moveObjects->setChecked( true );
dsGroupBox7Layout->addMultiCellWidget( moveObjects, 3, 3, 0, 3 );
if ((doc->currentPageLayout != singlePage) && (doc->masterPageMode))
if ((doc->currentPageLayout != singlePage) && (doc->masterPageMode()))
{
TextLabel3 = new QLabel( tr( "Type:" ), dsGroupBox7, "TextLabel3" );
dsGroupBox7Layout->addMultiCellWidget( TextLabel3, 4, 4, 0, 1 );
/branches/Version13x/Scribus/scribus/page.cpp
280,7 → 280,7
else
{
ScApp->doc->Items.append(ite);
if (ScApp->doc->masterPageMode)
if (ScApp->doc->masterPageMode())
ScApp->doc->MasterItems = ScApp->doc->Items;
else
ScApp->doc->DocItems = ScApp->doc->Items;
296,7 → 296,7
if (isUndo)
{
ScApp->doc->Items.append(ite);
if (ScApp->doc->masterPageMode)
if (ScApp->doc->masterPageMode())
ScApp->doc->MasterItems = ScApp->doc->Items;
else
ScApp->doc->DocItems = ScApp->doc->Items;
332,7 → 332,7
ScApp->doc->Items.append(newItem);
newItem->ItemNr = ScApp->doc->Items.count()-1;
}
if (ScApp->doc->masterPageMode)
if (ScApp->doc->masterPageMode())
ScApp->doc->MasterItems = ScApp->doc->Items;
else
ScApp->doc->DocItems = ScApp->doc->Items;
/branches/Version13x/Scribus/scribus/tabpdfoptions.cpp
326,7 → 326,7
struct PDFPresentationData ef;
if (EffVal.count() != 0)
{
for (uint pg2 = 0; pg2 < view->Doc->Pages.count(); ++pg2)
for (uint pg2 = 0; pg2 < view->Doc->Pages->count(); ++pg2)
{
Pages->insertItem( tr("Page")+" "+tmp.setNum(pg2+1));
if (EffVal.count()-1 < pg2)
343,7 → 343,7
}
else
{
for (uint pg = 0; pg < view->Doc->Pages.count(); ++pg)
for (uint pg = 0; pg < view->Doc->Pages->count(); ++pg)
{
Pages->insertItem( tr("Page")+" "+tmp.setNum(pg+1));
ef.pageEffectDuration = 1;
1152,7 → 1152,7
 
void TabPDFOptions::EffectOnAll()
{
for (uint pg = 0; pg < view->Doc->Pages.count(); ++pg)
for (uint pg = 0; pg < view->Doc->Pages->count(); ++pg)
{
EffVal[pg].pageViewDuration = PageTime->value();
EffVal[pg].pageEffectDuration = EffectTime->value();
1260,7 → 1260,7
int ci = Pages->currentItem();
if (PagePrev->isChecked())
{
for (uint pg = 0; pg < view->Doc->Pages.count(); ++pg)
for (uint pg = 0; pg < view->Doc->Pages->count(); ++pg)
{
pm.convertFromImage(view->PageToPixmap(pg, 70));
Pages->changeItem(pm, tr("Page")+" "+tmp.setNum(pg+1), pg);
1268,7 → 1268,7
}
else
{
for (uint pg = 0; pg < view->Doc->Pages.count(); ++pg)
for (uint pg = 0; pg < view->Doc->Pages->count(); ++pg)
Pages->changeItem( tr("Page")+" "+tmp.setNum(pg+1), pg);
}
if (ci != -1)
/branches/Version13x/Scribus/scribus/reformdoc.cpp
711,9 → 711,9
currDoc->PageSize = prefsPageSizeName;
currDoc->pageWidth = pageWidth;
currDoc->pageHeight = pageHeight;
for (uint p = 0; p < currDoc->Pages.count(); ++p)
for (uint p = 0; p < currDoc->Pages->count(); ++p)
{
Page *pp = currDoc->Pages.at(p);
Page *pp = currDoc->Pages->at(p);
if (sizeAllPages->isChecked())
{
pp->setInitialWidth(currDoc->pageWidth);
/branches/Version13x/Scribus/scribus/collect4output.cpp
126,10 → 126,12
 
bool CollectForOutput::collectItems()
{
/*
if (ScApp->doc->masterPageMode)
ScApp->doc->MasterPages = ScApp->doc->Pages;
else
ScApp->doc->DocPages = ScApp->doc->Pages;
*/
uint counter = 0;
for (uint lc = 0; lc < 3; ++lc)
{
/branches/Version13x/Scribus/scribus/pdflib.cpp
123,7 → 123,7
QMap<int, int> pageNsMpa;
for (uint a = 0; a < pageNs.size(); ++a)
{
pageNsMpa.insert(doc->MasterNames[doc->Pages.at(pageNs[a]-1)->MPageNam], 0);
pageNsMpa.insert(doc->MasterNames[doc->Pages->at(pageNs[a]-1)->MPageNam], 0);
}
dia2->reset();
dia2->setTotalSteps(pageNsMpa.count()+pageNs.size());
144,8 → 144,8
{
if (doc->PDF_Options.Thumbnails)
pm = thumbs[pageNs[a]];
PDF_Begin_Page(doc->Pages.at(pageNs[a]-1), pm);
PDF_ProcessPage(doc->Pages.at(pageNs[a]-1), pageNs[a]-1);
PDF_Begin_Page(doc->Pages->at(pageNs[a]-1), pm);
PDF_ProcessPage(doc->Pages->at(pageNs[a]-1), pageNs[a]-1);
PDF_End_Page();
progresscount++;
dia2->setProgress(progresscount);
1644,7 → 1644,7
PutPage("0 0 "+FToStr(ActPageP->width())+" "+FToStr(ActPageP->height())+" re W n\n");
if (!pag->MPageNam.isEmpty())
{
Page* mPage = doc->MasterPages.at(doc->MasterNames[doc->Pages.at(PNr)->MPageNam]);
Page* mPage = doc->MasterPages.at(doc->MasterNames[doc->Pages->at(PNr)->MPageNam]);
if (doc->MasterItems.count() != 0)
{
if (!Options->MirrorH)
4858,8 → 4858,8
bd.Prev = ccb - 1;
ccb++;
bd.Page = PageTree.Kids[tel->OwnPage];
bd.Recht = QRect(static_cast<int>(tel->Xpos - doc->Pages.at(tel->OwnPage)->xOffset()),
static_cast<int>(doc->Pages.at(tel->OwnPage)->height() - (tel->Ypos - doc->Pages.at(tel->OwnPage)->yOffset())),
bd.Recht = QRect(static_cast<int>(tel->Xpos - doc->Pages->at(tel->OwnPage)->xOffset()),
static_cast<int>(doc->Pages->at(tel->OwnPage)->height() - (tel->Ypos - doc->Pages->at(tel->OwnPage)->yOffset())),
static_cast<int>(tel->Width),
static_cast<int>(tel->Height));
Beads.append(bd);
4872,8 → 4872,8
if (tel->OwnPage != -1)
{
bd.Page = PageTree.Kids[tel->OwnPage];
bd.Recht = QRect(static_cast<int>(tel->Xpos - doc->Pages.at(tel->OwnPage)->xOffset()),
static_cast<int>(doc->Pages.at(tel->OwnPage)->height() - (tel->Ypos - doc->Pages.at(tel->OwnPage)->yOffset())),
bd.Recht = QRect(static_cast<int>(tel->Xpos - doc->Pages->at(tel->OwnPage)->xOffset()),
static_cast<int>(doc->Pages->at(tel->OwnPage)->height() - (tel->Ypos - doc->Pages->at(tel->OwnPage)->yOffset())),
static_cast<int>(tel->Width),
static_cast<int>(tel->Height));
Beads.append(bd);
/branches/Version13x/Scribus/scribus/scribusdoc.cpp
69,7 → 69,6
{
ApplicationPrefs* prefsData=&(PrefsManager::instance()->appPrefs);
modified = false;
masterPageMode = false;
_itemCreationTransactionStarted=false;
NrItems = 0;
First = 1;
257,7 → 256,7
CurrentStyle = 0;
currentParaStyle = 0;
TotalItems = 0;
masterPageMode = false;
//masterPageMode = false;
PDF_Options.Thumbnails = prefsData->PDF_Options.Thumbnails;
PDF_Options.Articles = prefsData->PDF_Options.Articles;
PDF_Options.Compress = prefsData->PDF_Options.Compress;
318,13 → 317,17
SubMode = -1;
autoSaveTimer = new QTimer(this);
MLineStyles.clear();
Pages.clear();
//Pages.clear();
MasterPages.clear();
DocPages.clear();
//Pages=&DocPages;
Items.clear();
MasterItems.clear();
DocItems.clear();
FrameItems.clear();
//Do this after all the collections have been created and cleared!
m_masterPageMode=true; // quick hack to force the change of pointers in setMasterPageMode();
setMasterPageMode(false);
ScratchLeft = prefsData->ScratchLeft;
ScratchRight = prefsData->ScratchRight;
ScratchTop = prefsData->ScratchTop;
964,12 → 967,14
addedPage->setPageNr(pageNumber);
addedPage->PageSize = PageSize;
addedPage->PageOri = PageOri;
bool insertsuccess=Pages.insert(pageNumber, addedPage);
Q_ASSERT(insertsuccess==true && Pages.at(pageNumber)!=NULL);
bool insertsuccess=Pages->insert(pageNumber, addedPage);
Q_ASSERT(insertsuccess==true && Pages->at(pageNumber)!=NULL);
/*
if (masterPageMode)
MasterPages = Pages;
else
DocPages = Pages;
*/
currentPage = addedPage;
pageCount++;
return addedPage;
1003,7 → 1008,7
return false;
if (pageCount < pageNumber-1)
return false;
Page* Seite = Pages.at(pageNumber);
Page* Seite = Pages->at(pageNumber);
PageItem *currItem;
for (currItem = Seite->FromMaster.first(); currItem; currItem = Seite->FromMaster.next())
{
1014,14 → 1019,16
}
}
Seite->FromMaster.clear();
Pages.remove(pageNumber);
Pages->remove(pageNumber);
delete Seite;
pageCount -= 1;
currentPage = Pages.at(0);
currentPage = Pages->at(0);
/*
if (masterPageMode)
MasterPages = Pages;
else
DocPages = Pages;
*/
return true;
}
 
1032,8 → 1039,8
Buf.clear();
for (int a = from; a < to; a++)
{
Buf.append(Pages.at(from));
Pages.remove(from);
Buf.append(Pages->at(from));
Pages->remove(from);
if (a <= zz)
zz--;
}
1041,21 → 1048,23
{
case 0:
for (uint b = 0; b < Buf.count(); b++)
Pages.insert(zz++, Buf.at(b));
Pages->insert(zz++, Buf.at(b));
break;
case 1:
for (uint b = 0; b < Buf.count(); b++)
Pages.insert(++zz, Buf.at(b));
Pages->insert(++zz, Buf.at(b));
break;
case 2:
for (uint b = 0; b < Buf.count(); b++)
Pages.append(Buf.at(b));
Pages->append(Buf.at(b));
break;
}
/*
if (masterPageMode)
MasterPages = Pages;
else
DocPages = Pages;
*/
}
 
const int ScribusDoc::addLayer(const QString& layerName=QString::null, const bool activate=false)
1446,10 → 1455,12
 
const bool ScribusDoc::layerContainsItems(const int layerNumber)
{
/*
if (masterPageMode)
MasterPages = Pages;
else
DocPages = Pages;
*/
uint masterItemsCount=MasterItems.count();
for (uint i = 0; i < masterItemsCount; ++i)
{
1778,8 → 1789,8
QMap<QString,int> Really;
//QMap<QString,QFont> DocF;
//DocF = UsedFonts;
if (!masterPageMode)
DocPages = Pages;
//if (!masterPageMode)
// DocPages = Pages;
uint counter = 0;
for (uint lc = 0; lc < 3; ++lc)
{
1858,11 → 1869,11
{
if (UndoManager::undoEnabled())
{
if (Pages.at(pageNumber)->MPageNam != in)
if (Pages->at(pageNumber)->MPageNam != in)
{
SimpleState *ss = new SimpleState(Um::ApplyMasterPage, QString(Um::FromTo).arg(Pages.at(pageNumber)->MPageNam).arg(in));
SimpleState *ss = new SimpleState(Um::ApplyMasterPage, QString(Um::FromTo).arg(Pages->at(pageNumber)->MPageNam).arg(in));
ss->set("PAGE_NUMBER", pageNumber);
ss->set("OLD_MASTERPAGE", Pages.at(pageNumber)->MPageNam);
ss->set("OLD_MASTERPAGE", Pages->at(pageNumber)->MPageNam);
ss->set("NEW_MASTERPAGE", in);
undoManager->action(this, ss);
}
1873,7 → 1884,7
mna = "Normal";
if (!MasterNames.contains(mna))
mna = "Normal";
Page* Ap = Pages.at(pageNumber);
Page* Ap = Pages->at(pageNumber);
Ap->MPageNam = mna;
int MpNr = MasterNames[mna];
Page* Mp = MasterPages.at(MpNr);
1981,10 → 1992,12
 
void ScribusDoc::recalculateColors()
{
/*
if (masterPageMode)
MasterPages = Pages;
else
DocPages = Pages;
*/
//Recalculate the RGB or CMYK calues to new CMS settings
ColorList::Iterator it;
ColorList::Iterator itend=PageColors.end();
2072,18 → 2085,20
 
const bool ScribusDoc::copyPageToMasterPage(const int pageNumber, const int leftPage, const int maxLeftPage, const QString& masterPageName)
{
Q_ASSERT(!masterPageMode);
if (masterPageMode)
Q_ASSERT(!masterPageMode());
if (masterPageMode())
return false;
//TODO Add Undo here
int GrMax = GroupCounter;
Page* sourcePage = Pages.at(pageNumber);
Page* sourcePage = Pages->at(pageNumber);
int nr = MasterPages.count();
/*
DocPages = Pages;
Pages = MasterPages;
*/
DocItems = Items;
Items = MasterItems;
masterPageMode = true;
//masterPageMode = true;
MasterNames.insert(masterPageName, nr);
pageCount = 0;
bool atf = automaticTextFrames;
2090,8 → 2105,8
automaticTextFrames = false;
//Note we are bypassing the view here, but things seem fine. The master page is offscreen anyway.
//ScApp->slotNewPage(nr);
//Page* targetPage = Pages.at(nr);
Page* targetPage=addPage(nr);
//Page* targetPage = Pages->at(nr);
Page* targetPage=addMasterPage(nr, masterPageName);
Q_ASSERT(targetPage!=NULL);
setLoading(true);
//Grab the left page setting for the current document layout from the dialog, and increment, singlePage==1 remember.
2104,7 → 2119,7
lp = 0;
else
++lp;
Pages.at(nr)->LeftPg = lp;
Pages->at(nr)->LeftPg = lp;
}
QMap<int,int> TableID;
QPtrList<PageItem> TableItems;
2179,13 → 2194,13
ta->BottomLink = 0;
}
}
MasterPages = Pages;
pageCount = DocPages.count();
Pages = DocPages;
//MasterPages = Pages;
//pageCount = DocPages.count();
//Pages = DocPages;
MasterItems = Items;
Items = DocItems;
masterPageMode = false;
targetPage->setPageName(masterPageName);
//masterPageMode = false;
//targetPage->setPageName(masterPageName);
targetPage->MPageNam = "";
automaticTextFrames = atf;
setLoading(false);
2248,7 → 2263,7
return -1;
Items.append(newItem);
newItem->ItemNr = Items.count()-1;
if (masterPageMode)
if (masterPageMode())
MasterItems = Items;
else
DocItems = Items;
2260,15 → 2275,15
is->set("CREATE_ITEM", "create_item");
is->setItem(newItem);
//Undo target rests with the Page for object specific undo
UndoObject *target = Pages.at(0);
UndoObject *target = Pages->at(0);
if (newItem->OwnPage > -1)
target = Pages.at(newItem->OwnPage);
target = Pages->at(newItem->OwnPage);
undoManager->action(target, is);
//If the item is created "complete" (ie, not being created by drag/resize, commit to undomanager)
if (itemFinalised)
{
//dont think we need this now ... newItem->checkChanges(true);
undoManager->commit(Pages.at(newItem->OwnPage)->getUName(), newItem->getUPixmap(),
undoManager->commit(Pages->at(newItem->OwnPage)->getUName(), newItem->getUPixmap(),
Um::Create + " " + newItem->getUName(), "", Um::ICreate);
_itemCreationTransactionStarted = false;
}
2362,7 → 2377,7
createdItem->checkChanges(true);
QString targetName = Um::ScratchSpace;
if (createdItem->OwnPage > -1)
targetName = Pages.at(createdItem->OwnPage)->getUName();
targetName = Pages->at(createdItem->OwnPage)->getUName();
undoManager->commit(targetName, createdItem->getUPixmap(),
Um::Create + " " + createdItem->getUName(), "", Um::ICreate);
_itemCreationTransactionStarted = false;
2467,7 → 2482,7
int ScribusDoc::OnPage(double x2, double y2)
{
int retw = -1;
if (masterPageMode)
if (masterPageMode())
{
int x = static_cast<int>(currentPage->xOffset());
int y = static_cast<int>(currentPage->yOffset());
2478,13 → 2493,13
}
else
{
uint docPageCount=Pages.count();
uint docPageCount=Pages->count();
for (uint a = 0; a < docPageCount; ++a)
{
int x = static_cast<int>(Pages.at(a)->xOffset());
int y = static_cast<int>(Pages.at(a)->yOffset());
int w = static_cast<int>(Pages.at(a)->width());
int h = static_cast<int>(Pages.at(a)->height());
int x = static_cast<int>(Pages->at(a)->xOffset());
int y = static_cast<int>(Pages->at(a)->yOffset());
int w = static_cast<int>(Pages->at(a)->width());
int h = static_cast<int>(Pages->at(a)->height());
if (QRect(x, y, w, h).contains(QPoint(qRound(x2), qRound(y2))))
{
retw = static_cast<int>(a);
2498,7 → 2513,7
int ScribusDoc::OnPage(PageItem *currItem)
{
int retw = -1;
if (masterPageMode)
if (masterPageMode())
{
int x = static_cast<int>(currentPage->xOffset());
int y = static_cast<int>(currentPage->yOffset());
2513,13 → 2528,13
}
else
{
uint docPageCount=Pages.count();
uint docPageCount=Pages->count();
for (uint a = 0; a < docPageCount; ++a)
{
int x = static_cast<int>(Pages.at(a)->xOffset());
int y = static_cast<int>(Pages.at(a)->yOffset());
int w = static_cast<int>(Pages.at(a)->width());
int h = static_cast<int>(Pages.at(a)->height());
int x = static_cast<int>(Pages->at(a)->xOffset());
int y = static_cast<int>(Pages->at(a)->yOffset());
int w = static_cast<int>(Pages->at(a)->width());
int h = static_cast<int>(Pages->at(a)->height());
int x2 = static_cast<int>(currItem->Xpos);
int y2 = static_cast<int>(currItem->Ypos);
int w2 = QMAX(static_cast<int>(currItem->Width), 1);
2579,21 → 2594,21
int counter = pageSets[currentPageLayout].FirstPage;
int rowcounter = 0;
double maxYPos=0.0, maxXPos=0.0;
double currentXPos=ScratchLeft, currentYPos=ScratchTop, lastYPos=Pages.at(0)->initialHeight();
double currentXPos=ScratchLeft, currentYPos=ScratchTop, lastYPos=Pages->at(0)->initialHeight();
currentXPos += (pageWidth+pageSets[currentPageLayout].GapHorizontal) * counter;
 
lastYPos = Pages.at(0)->initialHeight();
lastYPos = Pages->at(0)->initialHeight();
Page* Seite;
uint docPageCount=Pages.count();
uint docPageCount=Pages->count();
for (uint a = 0; a < docPageCount; ++a)
{
Seite = Pages.at(a);
Seite = Pages->at(a);
oldPg.oldXO = Seite->xOffset();
oldPg.oldYO = Seite->yOffset();
oldPg.newPg = a;
pageTable.insert(Seite->pageNr(), oldPg);
Seite->setPageNr(a);
if (masterPageMode)
if (masterPageMode())
{
Seite->setXOffset(ScratchLeft);
Seite->setYOffset(ScratchTop);
2677,8 → 2692,8
if (moveObjects)
{
oldPg = pageTable[item->OwnPage];
item->Xpos = item->Xpos - oldPg.oldXO + Pages.at(oldPg.newPg)->xOffset();
item->Ypos = item->Ypos - oldPg.oldYO + Pages.at(oldPg.newPg)->yOffset();
item->Xpos = item->Xpos - oldPg.oldXO + Pages->at(oldPg.newPg)->xOffset();
item->Ypos = item->Ypos - oldPg.oldYO + Pages->at(oldPg.newPg)->yOffset();
item->OwnPage = static_cast<int>(oldPg.newPg);
}
else
2698,15 → 2713,15
 
const double ScribusDoc::getXOffsetForPage(const int pageNumber)
{
if (Pages.at(pageNumber)!=NULL)
return Pages.at(pageNumber)->xOffset();
if (Pages->at(pageNumber)!=NULL)
return Pages->at(pageNumber)->xOffset();
return -1.0;
}
 
const double ScribusDoc::getYOffsetForPage(const int pageNumber)
{
if (Pages.at(pageNumber)!=NULL)
return Pages.at(pageNumber)->yOffset();
if (Pages->at(pageNumber)!=NULL)
return Pages->at(pageNumber)->yOffset();
return -1.0;
}
 
2862,7 → 2877,7
ScApp->view->Deselect(true);
}
//<<At some point we HAVE to stop this!
if (masterPageMode)
if (masterPageMode())
MasterItems = Items;
else
DocItems = Items;
2874,9 → 2889,9
is->set("CONVERT_ITEM", "convert_item");
is->setItem(std::pair<PageItem*, PageItem*>(oldItem, newItem));
//Undo target rests with the Page for object specific undo
UndoObject *target = Pages.at(0);
UndoObject *target = Pages->at(0);
if (newItem->OwnPage > -1)
target = Pages.at(newItem->OwnPage);
target = Pages->at(newItem->OwnPage);
undoManager->action(target, is);
}
//Close any undo transaction
2907,3 → 2922,25
}
return found;
}
 
void ScribusDoc::setMasterPageMode(const bool changeToMasterPageMode)
{
if (changeToMasterPageMode==m_masterPageMode)
return;
if (changeToMasterPageMode)
{
//Need to add in item pointer switching later too
Pages=&MasterPages;
}
else
{
//Need to add in item pointer switching later too
Pages=&DocPages;
}
m_masterPageMode=changeToMasterPageMode;
}
 
const bool ScribusDoc::masterPageMode()
{
return m_masterPageMode;
}
/branches/Version13x/Scribus/scribus/applytemplatedialog.cpp
150,7 → 150,7
masterPageComboBox->setCurrentItem(cc);
++cc;
}
const unsigned int docPagesCount = view->Pages.count();
const unsigned int docPagesCount = view->Pages->count();
if (docPagesCount < 2)
evenPagesRadioButton->setEnabled(false);
fromPageSpinBox->setMaxValue(docPagesCount);
/branches/Version13x/Scribus/scribus/scribusXml.cpp
983,8 → 983,8
}
if (Mpage)
{
doc->Pages.at(a)->LeftPg=QStoInt(pg.attribute("LEFT","0"));
doc->Pages.at(a)->setPageName(pg.attribute("NAM",""));
doc->Pages->at(a)->LeftPg=QStoInt(pg.attribute("LEFT","0"));
doc->Pages->at(a)->setPageName(pg.attribute("NAM",""));
}
TableItems.clear();
TableID.clear();
995,32 → 995,32
{
tmp = pg.attribute("VerticalGuides");
QTextStream fgv(&tmp, IO_ReadOnly);
doc->Pages.at(a)->YGuides.clear();
doc->Pages->at(a)->YGuides.clear();
for (int cxv = 0; cxv < QStoInt(pg.attribute("NumVGuides","0")); ++cxv)
{
fgv >> xf;
doc->Pages.at(a)->YGuides.append(xf);
doc->Pages->at(a)->YGuides.append(xf);
}
qHeapSort(doc->Pages.at(a)->YGuides);
qHeapSort(doc->Pages->at(a)->YGuides);
tmp = "";
}
else
doc->Pages.at(a)->YGuides.clear();
doc->Pages->at(a)->YGuides.clear();
if ((pg.hasAttribute("NumHGuides")) && (QStoInt(pg.attribute("NumHGuides","0")) != 0))
{
tmp = pg.attribute("HorizontalGuides");
QTextStream fgh(&tmp, IO_ReadOnly);
doc->Pages.at(a)->XGuides.clear();
doc->Pages->at(a)->XGuides.clear();
for (int cxh = 0; cxh < QStoInt(pg.attribute("NumHGuides","0")); ++cxh)
{
fgh >> xf;
doc->Pages.at(a)->XGuides.append(xf);
doc->Pages->at(a)->XGuides.append(xf);
}
qHeapSort(doc->Pages.at(a)->XGuides);
qHeapSort(doc->Pages->at(a)->XGuides);
tmp = "";
}
else
doc->Pages.at(a)->XGuides.clear();
doc->Pages->at(a)->XGuides.clear();
QDomNode OBJ=PAGE.firstChild();
counter = doc->Items.count();
baseobj = counter;
1040,8 → 1040,8
}
}
GetItemProps(newVersion, &obj, &OB);
OB.Xpos = QStodouble(obj.attribute("XPOS"))+doc->Pages.at(a)->xOffset();
OB.Ypos=QStodouble(obj.attribute("YPOS"))+doc->Pages.at(a)->yOffset();
OB.Xpos = QStodouble(obj.attribute("XPOS"))+doc->Pages->at(a)->xOffset();
OB.Ypos=QStodouble(obj.attribute("YPOS"))+doc->Pages->at(a)->yOffset();
OB.NamedLStyle = obj.attribute("NAMEDLST", "");
if (!doc->MLineStyles.contains(OB.NamedLStyle))
OB.NamedLStyle = "";
1474,9 → 1474,9
if (PgNam.isEmpty())
{
doc->pageCount = Pgc;
doc->Pages = doc->DocPages;
//doc->Pages = &doc->DocPages;
doc->setUsesAutomaticTextFrames(AtFl);
doc->masterPageMode = false;
doc->setMasterPageMode(false);
doc->Items = doc->DocItems;
}
else
1483,8 → 1483,8
{
doc->pageCount = 0;
doc->setUsesAutomaticTextFrames(false);
doc->Pages = doc->MasterPages;
doc->masterPageMode = true;
//doc->Pages = &doc->MasterPages;
doc->setMasterPageMode(true);
doc->Items = doc->MasterItems;
}
//CB: Remove this unnecessarily "slow" slot call when we have no gui for the doc yet!
1492,43 → 1492,43
//so we have to call the view, but we certainly dont need to emit to the mainwindow!
view->addPage(a);
//emit NewPage(a);
doc->Pages.at(a)->LeftPg=QStoInt(pg.attribute("LEFT","0"));
doc->Pages->at(a)->LeftPg=QStoInt(pg.attribute("LEFT","0"));
QString Mus = "";
Mus = pg.attribute("MNAM","Normal");
if (!doc->masterPageMode)
doc->Pages.at(a)->MPageNam = Mus;
if (!doc->masterPageMode())
doc->Pages->at(a)->MPageNam = Mus;
else
doc->Pages.at(a)->MPageNam = "";
doc->Pages->at(a)->MPageNam = "";
if ((pg.hasAttribute("NumVGuides")) && (QStoInt(pg.attribute("NumVGuides","0")) != 0))
{
tmp = pg.attribute("VerticalGuides");
QTextStream fgv(&tmp, IO_ReadOnly);
doc->Pages.at(a)->YGuides.clear();
doc->Pages->at(a)->YGuides.clear();
for (int cxv = 0; cxv < QStoInt(pg.attribute("NumVGuides","0")); ++cxv)
{
fgv >> xf;
doc->Pages.at(a)->YGuides.append(xf);
doc->Pages->at(a)->YGuides.append(xf);
}
qHeapSort(doc->Pages.at(a)->YGuides);
qHeapSort(doc->Pages->at(a)->YGuides);
tmp = "";
}
else
doc->Pages.at(a)->YGuides.clear();
doc->Pages->at(a)->YGuides.clear();
if ((pg.hasAttribute("NumHGuides")) && (QStoInt(pg.attribute("NumHGuides","0")) != 0))
{
tmp = pg.attribute("HorizontalGuides");
QTextStream fgh(&tmp, IO_ReadOnly);
doc->Pages.at(a)->XGuides.clear();
doc->Pages->at(a)->XGuides.clear();
for (int cxh = 0; cxh < QStoInt(pg.attribute("NumHGuides","0")); ++cxh)
{
fgh >> xf;
doc->Pages.at(a)->XGuides.append(xf);
doc->Pages->at(a)->XGuides.append(xf);
}
qHeapSort(doc->Pages.at(a)->XGuides);
qHeapSort(doc->Pages->at(a)->XGuides);
tmp = "";
}
else
doc->Pages.at(a)->XGuides.clear();
doc->Pages->at(a)->XGuides.clear();
QDomNode OBJ=PAGE.firstChild();
while(!OBJ.isNull())
{
1546,8 → 1546,8
}
}
GetItemProps(newVersion, &obj, &OB);
OB.Xpos = QStodouble(obj.attribute("XPOS"))+doc->Pages.at(a)->xOffset();
OB.Ypos=QStodouble(obj.attribute("YPOS"))+doc->Pages.at(a)->yOffset();
OB.Xpos = QStodouble(obj.attribute("XPOS"))+doc->Pages->at(a)->xOffset();
OB.Ypos=QStodouble(obj.attribute("YPOS"))+doc->Pages->at(a)->yOffset();
OB.NamedLStyle = obj.attribute("NAMEDLST", "");
OB.isBookmark=QStoInt(obj.attribute("BOOKMARK"));
if ((OB.isBookmark) && (doc->BookMarks.count() == 0))
1664,17 → 1664,18
}
if (PgNam.isEmpty())
{
doc->DocPages = doc->Pages;
//doc->DocPages = doc->Pages;
doc->DocItems = doc->Items;
}
else
{
doc->Pages.at(a)->setPageName(PgNam);
doc->Pages->at(a)->setPageName(PgNam);
doc->MasterNames[PgNam] = a;
doc->MasterPages = doc->Pages;
//doc->MasterPages = doc->Pages;
doc->MasterItems = doc->Items;
}
doc->masterPageMode = false;
doc->setMasterPageMode(false);
//doc->Pages=&doc->DocPages;
doc->pageCount = Pgc+1;
doc->setUsesAutomaticTextFrames(AtFl);
}
1774,10 → 1775,10
}
DOC=DOC.nextSibling();
}
doc->Pages = doc->DocPages;
doc->pageCount = doc->Pages.count();
//doc->Pages = &doc->DocPages;
doc->pageCount = doc->Pages->count();
doc->Items = doc->DocItems;
doc->masterPageMode = false;
doc->setMasterPageMode(false);
view->reformPages();
if (doc->layerCount() == 0)
{
/branches/Version13x/Scribus/scribus/seiten.cpp
670,7 → 670,7
pageLayout->updateLayoutSelector(currView->Doc->pageSets);
pageLayout->selectItem(currView->Doc->currentPageLayout);
pageLayout->firstPage->setCurrentItem(currView->Doc->pageSets[currView->Doc->currentPageLayout].FirstPage);
pageView->MaxC = currView->Doc->Pages.count()-1;
pageView->MaxC = currView->Doc->Pages->count()-1;
int counter, rowcounter, colmult, rowmult, coladd,rowadd;
counter = currView->Doc->pageSets[currView->Doc->currentPageLayout].FirstPage;
int cols = currView->Doc->pageSets[currView->Doc->currentPageLayout].Columns;
702,9 → 702,9
pageView->rowmult = rowmult;
pageView->firstP = counter;
pageView->cols = currView->Doc->pageSets[currView->Doc->currentPageLayout].Columns;
for (uint a = 0; a < currView->Doc->Pages.count(); ++a)
for (uint a = 0; a < currView->Doc->Pages->count(); ++a)
{
str = currView->Doc->Pages.at(a)->MPageNam;
str = currView->Doc->Pages->at(a)->MPageNam;
QTableItem *it = new SeItem( pageView, str, CreateIcon(a, pix));
pageView->setItem(rowcounter*rowmult+rowadd, counter*colmult+coladd, it);
pageView->setColumnWidth(counter*colmult+coladd, pix.width());
/branches/Version13x/Scribus/scribus/pageitem.cpp
929,7 → 929,7
uint zae = 0;
uint za2 = base;
QString chx("#");
if ((!Doc->masterPageMode) && (OwnPage != -1))
if ((!Doc->masterPageMode()) && (OwnPage != -1))
{
do
{
2748,7 → 2748,6
++countFound;
foundIt=objAttrIt;
}
 
}
ObjectAttribute returnAttribute;
if(countFound==1)
/branches/Version13x/Scribus/scribus/scribusdoc.h
38,7 → 38,7
#include "prefsstructs.h"
#include "documentinformation.h"
#include "undoobject.h"
//#include "page.h"
#include "page.h"
#include "pageitem.h"
#include "pageitem_line.h"
#include "pageitem_textframe.h"
50,7 → 50,6
#include <ft2build.h>
#include FT_FREETYPE_H
 
class Page;
class UndoManager;
class UndoState;
class PDFOptions;
390,6 → 389,13
** CB Moved from PageItem
*/
bool itemNameExists(const QString itemName);
/**
* @brief Set the doc into Master page mode
* Do we need to return if the move to master page mode was successful?
*/
void setMasterPageMode(const bool);
const bool masterPageMode();
 
protected:
void addSymbols();
400,6 → 406,7
double docUnitRatio;
UndoManager *undoManager;
bool automaticTextFrames; // Flag for automatic Textframes
bool m_masterPageMode;
 
public: // Public attributes
bool is12doc; //public for now, it will be removed later
421,7 → 428,7
double rulerXoffset;
double rulerYoffset;
/** List of Pages */
QPtrList<Page> Pages;
QPtrList<Page>* Pages;
/** List of Master Pages */
QPtrList<Page> MasterPages;
/** List of Document Pages */
535,7 → 542,7
QString Language;
bool Automatic;
bool AutoCheck;
bool masterPageMode;
PDFOptions PDF_Options;
bool RePos;
struct BookMa {
/branches/Version13x/Scribus/scribus/scribusview.cpp
250,15 → 250,15
// painter->translate(0.5, 0.5);
painter->setZoomFactor(1.0);
/* Draw Page Outlines */
if (!Doc->masterPageMode)
if (!Doc->masterPageMode())
{
uint docPagesCount=Doc->Pages.count();
uint docPagesCount=Doc->Pages->count();
for (int a = 0; a < static_cast<int>(docPagesCount); ++a)
{
int x = static_cast<int>(Doc->Pages.at(a)->xOffset() * Scale);
int y = static_cast<int>(Doc->Pages.at(a)->yOffset() * Scale);
int w = static_cast<int>(Doc->Pages.at(a)->width() * Scale);
int h = static_cast<int>(Doc->Pages.at(a)->height() * Scale);
int x = static_cast<int>(Doc->Pages->at(a)->xOffset() * Scale);
int y = static_cast<int>(Doc->Pages->at(a)->yOffset() * Scale);
int w = static_cast<int>(Doc->Pages->at(a)->width() * Scale);
int h = static_cast<int>(Doc->Pages->at(a)->height() * Scale);
QRect drawRect = QRect(x, y, w+5, h+5);
drawRect.moveBy(qRound(-Doc->minCanvasCoordinate.x() * Scale), qRound(-Doc->minCanvasCoordinate.y() * Scale));
if (drawRect.intersects(QRect(clipx, clipy, clipw, cliph)))
274,9 → 274,9
painter->setBrush(Doc->papColor);
painter->drawRect(x, y, w, h);
if (Doc->guidesSettings.before)
DrawPageMarks(painter, Doc->Pages.at(a), QRect(clipx, clipy, clipw, cliph));
DrawPageMarks(painter, Doc->Pages->at(a), QRect(clipx, clipy, clipw, cliph));
}
DrawMasterItems(painter, Doc->Pages.at(a), QRect(clipx, clipy, clipw, cliph));
DrawMasterItems(painter, Doc->Pages->at(a), QRect(clipx, clipy, clipw, cliph));
}
DrawPageItems(painter, QRect(clipx, clipy, clipw, cliph));
if (!Doc->guidesSettings.before)
283,14 → 283,14
{
for (uint a = 0; a < docPagesCount; ++a)
{
int x = static_cast<int>(Doc->Pages.at(a)->xOffset() * Scale);
int y = static_cast<int>(Doc->Pages.at(a)->yOffset() * Scale);
int w = static_cast<int>(Doc->Pages.at(a)->width() * Scale);
int h = static_cast<int>(Doc->Pages.at(a)->height() * Scale);
int x = static_cast<int>(Doc->Pages->at(a)->xOffset() * Scale);
int y = static_cast<int>(Doc->Pages->at(a)->yOffset() * Scale);
int w = static_cast<int>(Doc->Pages->at(a)->width() * Scale);
int h = static_cast<int>(Doc->Pages->at(a)->height() * Scale);
QRect drawRect = QRect(x, y, w+5, h+5);
drawRect.moveBy(qRound(-Doc->minCanvasCoordinate.x() * Scale), qRound(-Doc->minCanvasCoordinate.y() * Scale));
if (drawRect.intersects(QRect(clipx, clipy, clipw, cliph)))
DrawPageMarks(painter, Doc->Pages.at(a), QRect(clipx, clipy, clipw, cliph));
DrawPageMarks(painter, Doc->Pages->at(a), QRect(clipx, clipy, clipw, cliph));
}
}
}
661,9 → 661,9
continue;
if ((previewMode) && (!currItem->printable()))
continue;
if ((Doc->masterPageMode) && ((currItem->OwnPage != -1) && (currItem->OwnPage != docCurrPageNo)))
if ((Doc->masterPageMode()) && ((currItem->OwnPage != -1) && (currItem->OwnPage != docCurrPageNo)))
continue;
if (!Doc->masterPageMode && !currItem->OnMasterPage.isEmpty())
if (!Doc->masterPageMode() && !currItem->OnMasterPage.isEmpty())
{
if (currItem->OnMasterPage != Doc->currentPage->PageNam)
continue;
2671,7 → 2671,7
currItem->OwnPage = Doc->OnPage(currItem);
if (currItem->OwnPage != -1)
{
Doc->currentPage = Doc->Pages.at(currItem->OwnPage);
Doc->currentPage = Doc->Pages->at(currItem->OwnPage);
setMenTxt(currItem->OwnPage);
}
emit HaveSel(currItem->itemType());
2715,7 → 2715,7
QRegion apr = QRegion(p.xForm(docItem->Clip));
QRect apr2(docItem->getRedrawBounding(Scale));
p.end();
if ((Doc->masterPageMode) && (docItem->OnMasterPage != Doc->currentPage->PageNam))
if ((Doc->masterPageMode()) && (docItem->OnMasterPage != Doc->currentPage->PageNam))
continue;
if (((Sele.contains(apr.boundingRect())) || (Sele.contains(apr2))) && (docItem->LayerNr == Doc->activeLayer()))
SelectItemNr(a, false);
4447,7 → 4447,7
if (Doc->Items.at(a)->isBookmark)
emit NewBMNr(Doc->Items.at(a)->BMnr, a);
}
if (Doc->masterPageMode)
if (Doc->masterPageMode())
Doc->MasterItems = Doc->Items;
else
Doc->DocItems = Doc->Items;
4569,7 → 4569,7
}
else
Doc->ElemToLink = NULL;
if (Doc->masterPageMode)
if (Doc->masterPageMode())
Doc->MasterItems = Doc->Items;
else
Doc->DocItems = Doc->Items;
4600,7 → 4600,7
emit DocChanged();
updateContents();
}
if (Doc->masterPageMode)
if (Doc->masterPageMode())
Doc->MasterItems = Doc->Items;
else
Doc->DocItems = Doc->Items;
4796,7 → 4796,7
int pg = Doc->OnPage(*x, *y);
if (pg == -1)
return ret;
Page* page = Doc->Pages.at(pg);
Page* page = Doc->Pages->at(pg);
if (Doc->SnapGuides)
{
if (page->YGuides.count() != 0)
4852,7 → 4852,7
int pg = Doc->OnPage(currItem);
if (pg == -1)
return;
Page* page = Doc->Pages.at(pg);
Page* page = Doc->Pages->at(pg);
if (page->YGuides.count() != 0)
{
for (uint yg = 0; yg < page->YGuides.count(); ++yg)
4925,8 → 4925,8
int onp = Doc->OnPage(in.x(), in.y());
if ((Doc->useRaster) && (onp != -1))
{
np.setX(static_cast<int>(qRound((in.x() - Doc->Pages.at(onp)->xOffset()) / Doc->guidesSettings.minorGrid) * Doc->guidesSettings.minorGrid + Doc->Pages.at(onp)->xOffset()));
np.setY(static_cast<int>(qRound((in.y() - Doc->Pages.at(onp)->yOffset()) / Doc->guidesSettings.minorGrid) * Doc->guidesSettings.minorGrid + Doc->Pages.at(onp)->yOffset()));
np.setX(static_cast<int>(qRound((in.x() - Doc->Pages->at(onp)->xOffset()) / Doc->guidesSettings.minorGrid) * Doc->guidesSettings.minorGrid + Doc->Pages->at(onp)->xOffset()));
np.setY(static_cast<int>(qRound((in.y() - Doc->Pages->at(onp)->yOffset()) / Doc->guidesSettings.minorGrid) * Doc->guidesSettings.minorGrid + Doc->Pages->at(onp)->yOffset()));
}
else
np = in;
4940,8 → 4940,8
if ((Doc->useRaster) && (onp != -1))
{
 
np.setX(qRound((in.x() - Doc->Pages.at(onp)->xOffset()) / Doc->guidesSettings.minorGrid) * Doc->guidesSettings.minorGrid + Doc->Pages.at(onp)->xOffset());
np.setY(qRound((in.y() - Doc->Pages.at(onp)->yOffset()) / Doc->guidesSettings.minorGrid) * Doc->guidesSettings.minorGrid + Doc->Pages.at(onp)->yOffset());
np.setX(qRound((in.x() - Doc->Pages->at(onp)->xOffset()) / Doc->guidesSettings.minorGrid) * Doc->guidesSettings.minorGrid + Doc->Pages->at(onp)->xOffset());
np.setY(qRound((in.y() - Doc->Pages->at(onp)->yOffset()) / Doc->guidesSettings.minorGrid) * Doc->guidesSettings.minorGrid + Doc->Pages->at(onp)->yOffset());
}
else
np = in;
7208,21 → 7208,21
mpo.moveBy(qRound(Doc->minCanvasCoordinate.x() * Scale), qRound(Doc->minCanvasCoordinate.y() * Scale));
ClRe = -1;
Deselect(false);
if (!Doc->masterPageMode)
if (!Doc->masterPageMode())
{
uint docPagesCount=Doc->Pages.count();
uint docPagesCount=Doc->Pages->count();
uint docCurrPageNo=Doc->currentPageNumber();
for (uint i = 0; i < docPagesCount; ++i)
{
int x = static_cast<int>(Doc->Pages.at(i)->xOffset() * Scale);
int y = static_cast<int>(Doc->Pages.at(i)->yOffset() * Scale);
int w = static_cast<int>(Doc->Pages.at(i)->width() * Scale);
int h = static_cast<int>(Doc->Pages.at(i)->height() * Scale);
int x = static_cast<int>(Doc->Pages->at(i)->xOffset() * Scale);
int y = static_cast<int>(Doc->Pages->at(i)->yOffset() * Scale);
int w = static_cast<int>(Doc->Pages->at(i)->width() * Scale);
int h = static_cast<int>(Doc->Pages->at(i)->height() * Scale);
if (QRect(x, y, w, h).intersects(mpo))
{
if (docCurrPageNo != i)
{
Doc->currentPage = Doc->Pages.at(i);
Doc->currentPage = Doc->Pages->at(i);
setMenTxt(i);
DrawNew();
}
7251,19 → 7251,19
currItem = SelItem.at(0);
else
currItem = Doc->Items.last();
if (!Doc->masterPageMode)
if (!Doc->masterPageMode())
{
for (a = 0; a < Doc->Pages.count(); ++a)
for (a = 0; a < Doc->Pages->count(); ++a)
{
int x = static_cast<int>(Doc->Pages.at(a)->xOffset() * Scale);
int y = static_cast<int>(Doc->Pages.at(a)->yOffset() * Scale);
int w = static_cast<int>(Doc->Pages.at(a)->width() * Scale);
int h = static_cast<int>(Doc->Pages.at(a)->height() * Scale);
int x = static_cast<int>(Doc->Pages->at(a)->xOffset() * Scale);
int y = static_cast<int>(Doc->Pages->at(a)->yOffset() * Scale);
int w = static_cast<int>(Doc->Pages->at(a)->width() * Scale);
int h = static_cast<int>(Doc->Pages->at(a)->height() * Scale);
if (QRect(x, y, w, h).intersects(mpo))
{
if (Doc->currentPage->pageNr() != a)
{
Doc->currentPage = Doc->Pages.at(a);
Doc->currentPage = Doc->Pages->at(a);
setMenTxt(a);
DrawNew();
}
7275,7 → 7275,7
if (m->state() == (ControlButton | AltButton))
Deselect(false);
 
if ((m->state() == (ShiftButton | AltButton)) && (!Doc->masterPageMode) && (Doc->currentPage->FromMaster.count() != 0))
if ((m->state() == (ShiftButton | AltButton)) && (!Doc->masterPageMode()) && (Doc->currentPage->FromMaster.count() != 0))
{
Page* Mp = Doc->MasterPages.at(Doc->MasterNames[Doc->currentPage->MPageNam]);
currItem = Doc->currentPage->FromMaster.last();
7422,7 → 7422,7
SelItem.clear();
return false;
}
if ((Doc->masterPageMode) && (!((currItem->OwnPage == -1) || (currItem->OwnPage == static_cast<int>(Doc->currentPage->pageNr())))))
if ((Doc->masterPageMode()) && (!((currItem->OwnPage == -1) || (currItem->OwnPage == static_cast<int>(Doc->currentPage->pageNr())))))
{
currItem = Doc->Items.prev();
continue;
7896,7 → 7896,7
if (Doc->Items.at(a)->isBookmark)
emit NewBMNr(Doc->Items.at(a)->BMnr, a);
}
if (Doc->masterPageMode)
if (Doc->masterPageMode())
Doc->MasterItems = Doc->Items;
else
Doc->DocItems = Doc->Items;
7934,7 → 7934,7
if (Doc->Items.at(a)->isBookmark)
emit NewBMNr(Doc->Items.at(a)->BMnr, a);
}
if (Doc->masterPageMode)
if (Doc->masterPageMode())
Doc->MasterItems = Doc->Items;
else
Doc->DocItems = Doc->Items;
7991,7 → 7991,7
if (Doc->Items.at(a)->Select)
SelItem.append(Doc->Items.at(a));
}
if (Doc->masterPageMode)
if (Doc->masterPageMode())
Doc->MasterItems = Doc->Items;
else
Doc->DocItems = Doc->Items;
8048,7 → 8048,7
if (Doc->Items.at(a)->Select)
SelItem.append(Doc->Items.at(a));
}
if (Doc->masterPageMode)
if (Doc->masterPageMode())
Doc->MasterItems = Doc->Items;
else
Doc->DocItems = Doc->Items;
8251,9 → 8251,9
is->set("DELETE_ITEM", "delete_item");
UndoObject *target;
if (currItem->OwnPage > -1)
target = Doc->Pages.at(currItem->OwnPage);
target = Doc->Pages->at(currItem->OwnPage);
else
target = Doc->Pages.at(0);
target = Doc->Pages->at(0);
undoManager->action(target, is, currItem->getUPixmap());
}
}
8268,7 → 8268,7
undoManager->commit();
updateContents();
qApp->setOverrideCursor(QCursor(ArrowCursor), true);
if (Doc->masterPageMode)
if (Doc->masterPageMode())
Doc->MasterItems = Doc->Items;
else
Doc->DocItems = Doc->Items;
8364,13 → 8364,13
{
QValueList<int> pag;
pag.clear();
uint docPageCount=Doc->Pages.count();
uint docPageCount=Doc->Pages->count();
for (uint a = 0; a < docPageCount; ++a)
{
int xs = static_cast<int>(Doc->Pages.at(a)->xOffset() * Scale);
int ys = static_cast<int>(Doc->Pages.at(a)->yOffset() * Scale);
int ws = static_cast<int>(Doc->Pages.at(a)->width() * Scale);
int hs = static_cast<int>(Doc->Pages.at(a)->height() * Scale);
int xs = static_cast<int>(Doc->Pages->at(a)->xOffset() * Scale);
int ys = static_cast<int>(Doc->Pages->at(a)->yOffset() * Scale);
int ws = static_cast<int>(Doc->Pages->at(a)->width() * Scale);
int hs = static_cast<int>(Doc->Pages->at(a)->height() * Scale);
QRect drawRect = QRect(x, y, visibleWidth(), visibleHeight());
drawRect.moveBy(qRound(-Doc->minCanvasCoordinate.x() * Scale), qRound(-Doc->minCanvasCoordinate.y() * Scale));
if (drawRect.intersects(QRect(xs, ys, ws, hs)))
8434,7 → 8434,7
Doc->RePos = savre;
}
}
if ((!ScApp->ScriptRunning) && (!Doc->isLoading()) && (!Doc->masterPageMode))
if ((!ScApp->ScriptRunning) && (!Doc->isLoading()) && (!Doc->masterPageMode()))
pageSelector->GotoPg(nr);
connect(pageSelector, SIGNAL(GotoPage(int)), this, SLOT(GotoPa(int)));
Mpressed = false;
8509,7 → 8509,7
return;
disconnect(pageSelector, SIGNAL(GotoPage(int)), this, SLOT(GotoPa(int)));
pageSelector->setMaxValue(Doc->pageCount);
if ((!Doc->isLoading()) && (!Doc->masterPageMode))
if ((!Doc->isLoading()) && (!Doc->masterPageMode()))
pageSelector->GotoPg(Seite);
connect(pageSelector, SIGNAL(GotoPage(int)), this, SLOT(GotoPa(int)));
}
8685,13 → 8685,13
 
void ScribusView::GotoPage(int Seite)
{
Doc->currentPage = Doc->Pages.at(Seite);
Doc->currentPage = Doc->Pages->at(Seite);
if (ScApp->ScriptRunning)
return;
disconnect(pageSelector, SIGNAL(GotoPage(int)), this, SLOT(GotoPa(int)));
SetCPo(qRound(Doc->currentPage->xOffset()-10), qRound(Doc->currentPage->yOffset()-10));
pageSelector->setMaxValue(Doc->pageCount);
if ((!Doc->isLoading()) && (!Doc->masterPageMode))
if ((!Doc->isLoading()) && (!Doc->masterPageMode()))
pageSelector->GotoPg(Seite);
connect(pageSelector, SIGNAL(GotoPage(int)), this, SLOT(GotoPa(int)));
}
8700,16 → 8700,17
{
Deselect(false);
OldScale = Scale;
if (!Doc->masterPageMode)
if (!Doc->masterPageMode())
{
Doc->DocPages = Doc->Pages;
Doc->Pages = Doc->MasterPages;
//Doc->DocPages = Doc->Pages;
//Doc->Pages = &Doc->MasterPages;
Doc->DocItems = Doc->Items;
Doc->Items = Doc->MasterItems;
//Doc->masterPageMode = true;
}
Doc->setMasterPageMode(true);
Doc->pageCount = 1;
Doc->masterPageMode = true;
Doc->currentPage = Doc->Pages.at(nr);
Doc->currentPage = Doc->Pages->at(nr);
pageSelector->setEnabled(false);
updateOn = false;
// reformPages();
8726,11 → 8727,11
Deselect(true);
Doc->MasterItems = Doc->Items;
Doc->Items = Doc->DocItems;
Doc->MasterPages = Doc->Pages;
//Doc->MasterPages = Doc->Pages;
Doc->pageCount = Doc->DocPages.count();
Doc->Pages = Doc->DocPages;
Doc->masterPageMode = false;
Doc->currentPage = Doc->Pages.at(0);
//Doc->Pages = &Doc->DocPages;
Doc->setMasterPageMode(false);
Doc->currentPage = Doc->Pages->at(0);
pageSelector->setEnabled(true);
setScale(OldScale);
updateOn = false;
8788,7 → 8789,7
{
double sca = Scale;
bool frs = Doc->guidesSettings.framesShown;
bool mas = Doc->masterPageMode;
bool mas = Doc->masterPageMode();
Page* act = Doc->currentPage;
Doc->currentPage = Doc->MasterPages.at(Nr);
if (!mas)
8815,7 → 8816,7
Doc->MasterItems = Doc->Items;
Doc->Items = Doc->DocItems;
}
Doc->masterPageMode = mas;
//Doc->masterPageMode = mas;
painter->end();
double sx = im.width() / static_cast<double>(maxGr);
double sy = im.height() / static_cast<double>(maxGr);
8834,10 → 8835,10
{
QImage pm;
QImage im;
int clipx = static_cast<int>(Doc->Pages.at(Nr)->xOffset());
int clipy = static_cast<int>(Doc->Pages.at(Nr)->yOffset());
int clipw = qRound(Doc->Pages.at(Nr)->width());
int cliph = qRound(Doc->Pages.at(Nr)->height());
int clipx = static_cast<int>(Doc->Pages->at(Nr)->xOffset());
int clipy = static_cast<int>(Doc->Pages->at(Nr)->yOffset());
int clipw = qRound(Doc->Pages->at(Nr)->width());
int cliph = qRound(Doc->Pages->at(Nr)->height());
if ((clipw > 0) && (cliph > 0))
{
double sca = Scale;
8846,7 → 8847,7
setScale(1.0);
previewMode = true;
Page* act = Doc->currentPage;
Doc->currentPage = Doc->Pages.at(Nr);
Doc->currentPage = Doc->Pages->at(Nr);
pm = QImage(clipw, cliph, 32, QImage::BigEndian);
ScPainter *painter = new ScPainter(&pm, pm.width(), pm.height());
painter->clear(Doc->papColor);
8856,7 → 8857,7
painter->setBrush(Doc->papColor);
painter->drawRect(clipx, clipy, clipw, cliph);
// painter->translate(0.5, 0.5);
DrawMasterItems(painter, Doc->Pages.at(Nr), QRect(clipx, clipy, clipw, cliph));
DrawMasterItems(painter, Doc->Pages->at(Nr), QRect(clipx, clipy, clipw, cliph));
DrawPageItems(painter, QRect(clipx, clipy, clipw, cliph));
painter->end();
Doc->guidesSettings.framesShown = frs;
8968,11 → 8969,11
if (pg != -1)
{
if (oldIndex < 0)
Doc->Pages.at(pg)->addYGuide(newY-Doc->Pages.at(pg)->yOffset());
Doc->Pages->at(pg)->addYGuide(newY-Doc->Pages->at(pg)->yOffset());
else
Doc->Pages.at(pg)->moveYGuide(oldIndex, newY-Doc->Pages.at(pg)->yOffset());
Doc->Pages->at(pg)->moveYGuide(oldIndex, newY-Doc->Pages->at(pg)->yOffset());
emit DocChanged();
emit signalGuideInformation(0, qRound((newY-Doc->Pages.at(pg)->yOffset()) * 10000.0) / 10000.0);
emit signalGuideInformation(0, qRound((newY-Doc->Pages->at(pg)->yOffset()) * 10000.0) / 10000.0);
}
else if (oldIndex >= 0)
{
8991,11 → 8992,11
if (pg != -1)
{
if (oldIndex < 0)
Doc->Pages.at(pg)->addXGuide(newX-Doc->Pages.at(pg)->xOffset());
Doc->Pages->at(pg)->addXGuide(newX-Doc->Pages->at(pg)->xOffset());
else
Doc->Pages.at(pg)->moveXGuide(oldIndex, newX-Doc->Pages.at(pg)->xOffset());
Doc->Pages->at(pg)->moveXGuide(oldIndex, newX-Doc->Pages->at(pg)->xOffset());
emit DocChanged();
emit signalGuideInformation(1, qRound((newX-Doc->Pages.at(pg)->xOffset()) * 10000.0) / 10000.0);
emit signalGuideInformation(1, qRound((newX-Doc->Pages->at(pg)->xOffset()) * 10000.0) / 10000.0);
}
else if (oldIndex >= 0)
{
/branches/Version13x/Scribus/scribus/pageitem_textframe.cpp
406,7 → 406,7
if (!OnMasterPage.isEmpty())
{
Page* Mp = Doc->MasterPages.at(Doc->MasterNames[OnMasterPage]);
Page* Dp = Doc->Pages.at(savedOwnPage);
Page* Dp = Doc->Pages->at(savedOwnPage);
for (a = 0; a < Doc->MasterItems.count(); ++a)
{
PageItem* docItem = Doc->MasterItems.at(a);
780,7 → 780,7
{
double by = Ypos;
if (OwnPage != -1)
by = Ypos - Doc->Pages.at(OwnPage)->yOffset();
by = Ypos - Doc->Pages->at(OwnPage)->yOffset();
int ol1 = qRound((by + CurY - Doc->typographicSettings.offsetBaseGrid) * 10000.0);
int ol2 = static_cast<int>(ol1 / Doc->typographicSettings.valueBaseGrid);
CurY = ceil( ol2 / 10000.0 ) * Doc->typographicSettings.valueBaseGrid + Doc->typographicSettings.offsetBaseGrid - by;
808,7 → 808,7
{
double by = Ypos;
if (OwnPage != -1)
by = Ypos - Doc->Pages.at(OwnPage)->yOffset();
by = Ypos - Doc->Pages->at(OwnPage)->yOffset();
int ol1 = qRound((by + CurY - Doc->typographicSettings.offsetBaseGrid) * 10000.0);
int ol2 = static_cast<int>(ol1 / Doc->typographicSettings.valueBaseGrid);
CurY = ceil( ol2 / 10000.0 ) * Doc->typographicSettings.valueBaseGrid + Doc->typographicSettings.offsetBaseGrid - by;
838,7 → 838,7
{
double by = Ypos;
if (OwnPage != -1)
by = Ypos - Doc->Pages.at(OwnPage)->yOffset();
by = Ypos - Doc->Pages->at(OwnPage)->yOffset();
int ol1 = qRound((by + CurY - Doc->typographicSettings.offsetBaseGrid) * 10000.0);
int ol2 = static_cast<int>(ol1 / Doc->typographicSettings.valueBaseGrid);
CurY = ceil( ol2 / 10000.0 ) * Doc->typographicSettings.valueBaseGrid + Doc->typographicSettings.offsetBaseGrid - by;
875,7 → 875,7
{
double by = Ypos;
if (OwnPage != -1)
by = Ypos - Doc->Pages.at(OwnPage)->yOffset();
by = Ypos - Doc->Pages->at(OwnPage)->yOffset();
int ol1 = qRound((by + CurY - Doc->typographicSettings.offsetBaseGrid) * 10000.0);
int ol2 = static_cast<int>(ol1 / Doc->typographicSettings.valueBaseGrid);
CurY = ceil( ol2 / 10000.0 ) * Doc->typographicSettings.valueBaseGrid + Doc->typographicSettings.offsetBaseGrid - by;
1128,7 → 1128,7
CurY -= Doc->typographicSettings.valueBaseGrid * (DropLines-1);
double by = Ypos;
if (OwnPage != -1)
by = Ypos - Doc->Pages.at(OwnPage)->yOffset();
by = Ypos - Doc->Pages->at(OwnPage)->yOffset();
int ol1 = qRound((by + CurY - Doc->typographicSettings.offsetBaseGrid) * 10000.0);
int ol2 = static_cast<int>(ol1 / Doc->typographicSettings.valueBaseGrid);
CurY = ceil( ol2 / 10000.0 ) * Doc->typographicSettings.valueBaseGrid + Doc->typographicSettings.offsetBaseGrid - by;
/branches/Version13x/Scribus/scribus/muster.cpp
95,11 → 95,11
0, QMessageBox::No, QMessageBox::Yes);
if (exit == 1)
{
currentDoc->pageCount = currentDoc->Pages.count();
currentDoc->pageCount = currentDoc->Pages->count();
emit removePage(currentDoc->MasterNames[sMuster]);
currentDoc->MasterNames.clear();
for (uint a = 0; a < currentDoc->Pages.count(); ++a)
currentDoc->MasterNames[currentDoc->Pages.at(a)->PageNam] = currentDoc->Pages.at(a)->pageNr();
for (uint a = 0; a < currentDoc->Pages->count(); ++a)
currentDoc->MasterNames[currentDoc->Pages->at(a)->PageNam] = currentDoc->Pages->at(a)->pageNr();
for (uint b = 0; b < currentDoc->DocPages.count(); ++b)
{
if (currentDoc->DocPages.at(b)->MPageNam == sMuster)
108,7 → 108,7
currentDoc->pageCount = 1;
sMuster = "Normal";
updateMasterPageList(sMuster);
currentDoc->MasterPages = currentDoc->Pages;
//currentDoc->MasterPages = currentDoc->Pages;
emit docAltered();
}
}
134,7 → 134,7
}
MasterPageName = dia->Answer->text();
}
nr = currentDoc->Pages.count();
nr = currentDoc->Pages->count();
currentDoc->MasterNames.insert(MasterPageName, nr);
currentDoc->pageCount = 0;
atf = currentDoc->usesAutomaticTextFrames();
150,7 → 150,7
lp = 0;
else
lp++;
currentDoc->Pages.at(nr)->LeftPg = lp;
currentDoc->Pages->at(nr)->LeftPg = lp;
}
int inde = currentDoc->MasterNames[sMuster];
QMap<int,int> TableID;
157,21 → 157,21
QPtrList<PageItem> TableItems;
TableID.clear();
TableItems.clear();
if (currentDoc->Pages.at(inde)->YGuides.count() != 0)
if (currentDoc->Pages->at(inde)->YGuides.count() != 0)
{
currentDoc->currentPage->YGuides.clear();
for (uint y = 0; y < currentDoc->Pages.at(inde)->YGuides.count(); ++y)
for (uint y = 0; y < currentDoc->Pages->at(inde)->YGuides.count(); ++y)
{
currentDoc->currentPage->YGuides.append(currentDoc->Pages.at(inde)->YGuides[y]);
currentDoc->currentPage->YGuides.append(currentDoc->Pages->at(inde)->YGuides[y]);
}
qHeapSort(currentDoc->currentPage->YGuides);
}
if (currentDoc->Pages.at(inde)->XGuides.count() != 0)
if (currentDoc->Pages->at(inde)->XGuides.count() != 0)
{
currentDoc->currentPage->XGuides.clear();
for (uint x = 0; x < currentDoc->Pages.at(inde)->XGuides.count(); ++x)
for (uint x = 0; x < currentDoc->Pages->at(inde)->XGuides.count(); ++x)
{
currentDoc->currentPage->XGuides.append(currentDoc->Pages.at(inde)->XGuides[x]);
currentDoc->currentPage->XGuides.append(currentDoc->Pages->at(inde)->XGuides[x]);
}
qHeapSort(currentDoc->currentPage->XGuides);
}
233,11 → 233,11
}
currentView->Deselect(true);
currentView->DrawNew();
currentDoc->Pages.at(nr)->setPageName(MasterPageName);
currentDoc->Pages.at(nr)->MPageNam = "";
currentDoc->Pages->at(nr)->setPageName(MasterPageName);
currentDoc->Pages->at(nr)->MPageNam = "";
updateMasterPageList(MasterPageName);
currentDoc->setUsesAutomaticTextFrames(atf);
currentDoc->MasterPages = currentDoc->Pages;
//currentDoc->MasterPages = currentDoc->Pages;
currentDoc->setLoading(false);
currentView->DrawNew();
currentDoc->GroupCounter = GrMax + 1;
266,7 → 266,7
}
MasterPageName = dia->Answer->text();
}
nr = currentDoc->Pages.count();
nr = currentDoc->Pages->count();
currentDoc->MasterNames.insert(MasterPageName, nr);
currentDoc->pageCount = 0;
atf = currentDoc->usesAutomaticTextFrames();
281,15 → 281,15
lp = 0;
else
lp++;
currentDoc->Pages.at(nr)->LeftPg = lp;
currentDoc->Pages->at(nr)->LeftPg = lp;
}
currentDoc->Pages.at(nr)->setPageName(MasterPageName);
currentDoc->Pages.at(nr)->MPageNam = "";
currentDoc->Pages->at(nr)->setPageName(MasterPageName);
currentDoc->Pages->at(nr)->MPageNam = "";
updateMasterPageList(MasterPageName);
currentDoc->setUsesAutomaticTextFrames(atf);
currentView->showMasterPage(currentDoc->MasterNames[MasterPageName]);
currentView->reformPages();
currentDoc->MasterPages = currentDoc->Pages;
//currentDoc->MasterPages = currentDoc->Pages;
emit docAltered();
}
delete dia;
304,7 → 304,7
if (dia->exec())
{
qApp->setOverrideCursor(QCursor(waitCursor), true);
nr = currentDoc->Pages.count();
nr = currentDoc->Pages->count();
currentDoc->pageCount = 0;
atf = currentDoc->usesAutomaticTextFrames();
currentDoc->setUsesAutomaticTextFrames(false);
312,7 → 312,7
qApp->processEvents();
emit loadPage(dia->getFromDoc(), dia->getMasterPageNameItem(), true);
qApp->processEvents();
MasterPageName = currentDoc->Pages.at(nr)->PageNam;
MasterPageName = currentDoc->Pages->at(nr)->PageNam;
MasterPageName2 = MasterPageName;
int copyC = 1;
while (currentDoc->MasterNames.contains(MasterPageName2))
321,13 → 321,13
copyC++;
}
currentDoc->MasterNames.insert(MasterPageName2, nr);
currentDoc->Pages.at(nr)->setPageName(MasterPageName2);
currentDoc->Pages.at(nr)->MPageNam = "";
currentDoc->Pages->at(nr)->setPageName(MasterPageName2);
currentDoc->Pages->at(nr)->MPageNam = "";
updateMasterPageList(MasterPageName2);
currentDoc->setUsesAutomaticTextFrames(atf);
currentView->showMasterPage(currentDoc->MasterNames[MasterPageName2]);
qApp->setOverrideCursor(QCursor(arrowCursor), true);
currentDoc->MasterPages = currentDoc->Pages;
//currentDoc->MasterPages = currentDoc->Pages;
emit docAltered();
}
delete dia;
/branches/Version13x/Scribus/scribus/scribus.cpp
2308,7 → 2308,7
{
slotNewPage(pg);
applyNewMaster( tr("Normal"));
doc->DocPages = doc->Pages;
//doc->DocPages = doc->Pages;
}
view->show();
view->GotoPage(0);
2370,7 → 2370,7
{
slotNewPage(pg);
applyNewMaster( tr("Normal"));
doc->DocPages = doc->Pages;
//doc->DocPages = doc->Pages;
}
view->show();
view->GotoPage(0);
2399,18 → 2399,19
if (CMSavail && doc->CMSSettings.CMSinUse)
recalcColors();
doc->setPage(width, h, tpr, lr, rr, br, sp, ab, atf, fp);
//--doc->setLoading(false);
doc->setMasterPageMode(false);
doc->addMasterPage(0, "Normal");
//TODO CB Make addPage take a master page name
doc->addPage(0);
doc->DocPages = doc->Pages;
doc->Pages.at(0)->MPageNam = "Normal";
doc->pageCount = doc->Pages.count();
//doc->DocPages = doc->Pages;
//doc->Pages = &doc->DocPages;
doc->Pages->at(0)->MPageNam = "Normal";
doc->pageCount = doc->Pages->count();
 
doc->setModified(false);
doc->setLoading(false);
doc->DocItems = doc->Items;
doc->currentPage = doc->Pages.at(0);
doc->currentPage = doc->Pages->at(0);
doc->OpenNodes.clear();
//<<View and window code
ScribusWin* w = new ScribusWin(wsp, doc);
2551,7 → 2552,7
if (swin->muster != NULL)
swin->muster->hide();
}
if (doc->masterPageMode)
if (doc->masterPageMode())
ActWin->muster->show();
setAppMode(doc->appMode);
}
2566,7 → 2567,7
scrActions["viewShowTextChain"]->setOn(doc->guidesSettings.linkShown);
scrActions["viewShowTextControls"]->setOn(doc->guidesSettings.showControls);
scrActions["viewRulerMode"]->setOn(doc->guidesSettings.rulerMode);
if (!doc->masterPageMode)
if (!doc->masterPageMode())
pagePalette->Rebuild();
outlinePalette->setDoc(doc);
outlinePalette->BuildTree();
2601,7 → 2602,7
bool ScribusApp::SetupDoc()
{
bool ret = false;
if (doc->masterPageMode)
if (doc->masterPageMode())
doc->MasterItems = doc->Items;
else
doc->DocItems = doc->Items;
2683,7 → 2684,7
ToggleFrameEdit();
}
scrActions["fileClose"]->setEnabled(true);
if (doc->masterPageMode)
if (doc->masterPageMode())
{
scrActions["pageInsert"]->setEnabled(false);
scrActions["pageDelete"]->setEnabled(false);
2714,7 → 2715,7
scrActions["fileRevert"]->setEnabled(false);
scrMenuMgr->setMenuEnabled("FileOpenRecent", true);
 
bool setter = doc->Pages.count() > 1 ? true : false;
bool setter = doc->Pages->count() > 1 ? true : false;
scrActions["pageDelete"]->setEnabled(setter);
scrActions["pageMove"]->setEnabled(setter);
 
2768,7 → 2769,7
mainToolBar->setEnabled(true);
pdfToolBar->setEnabled(true);
 
bool setter = doc->Pages.count() > 1 ? true : false;
bool setter = doc->Pages->count() > 1 ? true : false;
scrActions["pageDelete"]->setEnabled(setter);
scrActions["pageMove"]->setEnabled(setter);
 
3030,7 → 3031,7
scrActions["toolsEditContents"]->setEnabled(true);
if (currItem->NextBox == 0)
scrActions["toolsLinkTextFrame"]->setEnabled(true);
if (doc->masterPageMode)
if (doc->masterPageMode())
scrActions["toolsLinkTextFrame"]->setEnabled(false);
if (doc->appMode == modeEdit)
{
3333,7 → 3334,7
scrActions["fileSave"]->setEnabled(true);
scrActions["fileSaveAs"]->setEnabled(true);
scrActions["fileCollect"]->setEnabled(true);
if (!doc->masterPageMode)
if (!doc->masterPageMode())
{
scrActions["fileClose"]->setEnabled(true);
if (doc->hasName)
3516,7 → 3517,7
parsePagesString(dia->getPageNumbers(), &pageNs, dia->getPageCounter());
int startPage, nrToImport;
bool doIt = true;
if (doc->masterPageMode)
if (doc->masterPageMode())
{
if (pageNs.size() > 1)
loadPage(dia->getFromDoc(), pageNs[0] - 1, false);
3932,7 → 3933,9
}
else
doc->setName(FName);
doc->masterPageMode = false;
doc->setMasterPageMode(false);
//doc->masterPageMode = false;
//doc->Pages=&doc->DocPages;
doc->Language = GetLang(doc->Language);
HaveNewDoc();
propertiesPalette->updateCList();
3939,9 → 3942,9
doc->hasName = true;
if (doc->MasterPages.count() == 0)
{
doc->masterPageMode = true;
doc->DocPages = doc->Pages;
doc->Pages = doc->MasterPages;
doc->setMasterPageMode(true);
//doc->DocPages = doc->Pages;
//doc->Pages = &doc->MasterPages;
doc->pageCount = doc->MasterPages.count();
bool atf = doc->usesAutomaticTextFrames();
doc->setUsesAutomaticTextFrames(false);
3948,11 → 3951,11
slotNewPage(0);
doc->setUsesAutomaticTextFrames(atf);
doc->MasterNames["Normal"] = 0;
doc->Pages.at(0)->setPageName("Normal");
doc->MasterPages = doc->Pages;
doc->Pages->at(0)->setPageName("Normal");
//doc->MasterPages = doc->Pages;
doc->setMasterPageMode(false);
doc->pageCount = doc->DocPages.count();
doc->Pages = doc->DocPages;
doc->masterPageMode = false;
//doc->Pages = &doc->DocPages;
}
doc->setLoading(false);
doc->DocItems = doc->Items;
3960,8 → 3963,9
QPixmap pgPix(10, 10);
QRect rd = QRect(0,0,9,9);
ScPainter *painter = new ScPainter(&pgPix, pgPix.width(), pgPix.height());
doc->Pages = doc->MasterPages;
doc->masterPageMode = true;
doc->setMasterPageMode(true);
//doc->Pages = &doc->MasterPages;
//doc->masterPageMode = true;
doc->Items = doc->MasterItems;
for (uint azz=0; azz<doc->MasterItems.count(); ++azz)
{
3995,8 → 3999,8
}
}
// RestoreBookMarks();
doc->Pages = doc->DocPages;
doc->masterPageMode = false;
//doc->Pages = &doc->DocPages;
doc->setMasterPageMode(false);
doc->Items = doc->DocItems;
for (uint azz=0; azz<doc->Items.count(); ++azz)
{
4065,9 → 4069,9
updateRecent(FName);
mainWindowStatusLabel->setText( tr("Ready"));
ret = true;
for (uint p = 0; p < doc->Pages.count(); ++p)
for (uint p = 0; p < doc->Pages->count(); ++p)
{
Apply_MasterPage(doc->Pages.at(p)->MPageNam, p, false);
Apply_MasterPage(doc->Pages->at(p)->MPageNam, p, false);
}
if (fileLoader->FileType > 1)
{
4204,7 → 4208,7
if (doc->Items.at(a)->isBookmark)
bookmarkPalette->BView->ChangeItem(doc->Items.at(a)->BMnr, a);
}
if (doc->masterPageMode)
if (doc->masterPageMode())
doc->MasterItems = doc->Items;
else
doc->DocItems = doc->Items;
4239,7 → 4243,7
 
void ScribusApp::slotFileRevert()
{
if ((doc->hasName) && (doc->isModified()) && (!doc->masterPageMode))
if ((doc->hasName) && (doc->isModified()) && (!doc->masterPageMode()))
{
int t = ScMessageBox::warning(this, CommonStrings::trWarning, "<qt>" +
QObject::tr("The changes to your document have not been saved and you have requested to revert them. Do you wish to continue?") + "</qt>",
4578,7 → 4582,7
doc->getUsedColors(usedSpots, true);
QStringList spots = usedSpots.keys();
Druck *printer = new Druck(this, options.filename, options.printer, PDef.Command, prefsManager->appPrefs.GCRMode, spots);
printer->setMinMax(1, doc->Pages.count(), doc->currentPage->pageNr()+1);
printer->setMinMax(1, doc->Pages->count(), doc->currentPage->pageNr()+1);
printDinUse = true;
connect(printer, SIGNAL(doPreview()), this, SLOT(doPrintPreview()));
if (printer->exec())
5065,7 → 5069,7
{
doc->Items.take(ac);
}
if (doc->masterPageMode)
if (doc->masterPageMode())
doc->MasterItems = doc->Items;
else
doc->DocItems = doc->Items;
5303,10 → 5307,12
view->Deselect(true);
slotNewPage(wo);
applyNewMaster(templ);
/*
if (doc->masterPageMode)
doc->MasterPages = doc->Pages;
else
doc->DocPages = doc->Pages;
*/
outlinePalette->BuildTree();
pagePalette->RebuildPage();
}
5317,7 → 5323,7
NoFrameEdit();
view->Deselect(true);
QStringList base;
InsPage *dia = new InsPage(this, doc, doc->currentPage->pageNr(), doc->Pages.count());
InsPage *dia = new InsPage(this, doc, doc->currentPage->pageNr(), doc->Pages->count());
if (dia->exec())
{
base = dia->getMasterPages();
5396,7 → 5402,7
case 2:
for (cc = 0; cc < numPages; ++cc)
{
slotNewPage(doc->Pages.count(), mov);
slotNewPage(doc->Pages->count(), mov);
doc->currentPage->setInitialHeight(height);
doc->currentPage->setInitialWidth(width);
doc->currentPage->PageOri = orient;
5408,10 → 5414,12
pagePalette->RebuildPage();
view->reformPages(mov);
view->DrawNew();
/*
if (doc->masterPageMode)
doc->MasterPages = doc->Pages;
else
doc->DocPages = doc->Pages;
*/
outlinePalette->BuildTree();
if (UndoManager::undoEnabled())
undoManager->commit();
5419,7 → 5427,7
 
void ScribusApp::slotNewMasterPage(int w)
{
if (doc->masterPageMode)
if (doc->masterPageMode())
slotNewPage(w);
}
 
5428,10 → 5436,10
view->addPage(w, mov);
/* if ((!doc->loading) && (!doc->masterPageMode))
outlinePalette->BuildTree(doc); */
bool setter = doc->Pages.count() > 1 ? true : false;
bool setter = doc->Pages->count() > 1 ? true : false;
scrActions["pageDelete"]->setEnabled(setter);
scrActions["pageMove"]->setEnabled(setter);
if ((!doc->isLoading()) && (!doc->masterPageMode))
if ((!doc->isLoading()) && (!doc->masterPageMode()))
AdjustBM();
/* if ((!doc->loading) && (!doc->masterPageMode))
{
6184,7 → 6192,7
{
PageItem* ite;
NoFrameEdit();
if (doc->Pages.count() == 1)
if (doc->Pages->count() == 1)
return;
if (UndoManager::undoEnabled())
undoManager->beginTransaction(doc->DocName, Um::IDocument, Um::DeletePage, "", Um::IDelete);
6211,12 → 6219,12
SimpleState *ss = new SimpleState(Um::DeletePage, "", Um::ICreate);
ss->set("DELETE_PAGE", "delete_page");
ss->set("PAGENR", pg + 1);
ss->set("MASTERPAGE", doc->Pages.at(pg)->MPageNam);
ss->set("MASTERPAGE", doc->Pages->at(pg)->MPageNam);
// replace the deleted page in the undostack by a dummy object that will
// replaced with the "undone" page if user choose to undo the action
DummyUndoObject *duo = new DummyUndoObject();
uint id = static_cast<uint>(duo->getUId());
undoManager->replaceObject(doc->Pages.at(pg)->getUId(), duo);
undoManager->replaceObject(doc->Pages->at(pg)->getUId(), duo);
ss->set("DUMMY_ID", id);
undoManager->action(this, ss);
}
6226,7 → 6234,7
view->DrawNew();
doc->OpenNodes.clear();
outlinePalette->BuildTree();
bool setter = doc->Pages.count() > 1 ? true : false;
bool setter = doc->Pages->count() > 1 ? true : false;
scrActions["pageDelete"]->setEnabled(setter);
scrActions["pageMove"]->setEnabled(setter);
slotDocCh();
6239,7 → 6247,7
{
NoFrameEdit();
view->Deselect(true);
DelPages *dia = new DelPages(this, doc->currentPage->pageNr()+1, doc->Pages.count());
DelPages *dia = new DelPages(this, doc->currentPage->pageNr()+1, doc->Pages->count());
if (dia->exec())
DeletePage(dia->getFromPage(), dia->getToPage());
delete dia;
6279,12 → 6287,12
SimpleState *ss = new SimpleState(Um::DeletePage, "", Um::ICreate);
ss->set("DELETE_PAGE", "delete_page");
ss->set("PAGENR", a + 1);
ss->set("MASTERPAGE", doc->Pages.at(a)->MPageNam);
ss->set("MASTERPAGE", doc->Pages->at(a)->MPageNam);
// replace the deleted page in the undostack by a dummy object that will
// replaced with the "undone" page if user choose to undo the action
DummyUndoObject *duo = new DummyUndoObject();
uint id = static_cast<uint>(duo->getUId());
undoManager->replaceObject(doc->Pages.at(a)->getUId(), duo);
undoManager->replaceObject(doc->Pages->at(a)->getUId(), duo);
ss->set("DUMMY_ID", id);
undoManager->action(this, ss);
}
6294,7 → 6302,7
view->DrawNew();
// doc->OpenNodes.clear();
outlinePalette->BuildTree();
bool setter = doc->Pages.count() > 1 ? true : false;
bool setter = doc->Pages->count() > 1 ? true : false;
scrActions["pageDelete"]->setEnabled(setter);
scrActions["pageMove"]->setEnabled(setter);
slotDocCh();
6306,7 → 6314,7
void ScribusApp::MovePage()
{
NoFrameEdit();
MovePages *dia = new MovePages(this, doc->currentPage->pageNr()+1, doc->Pages.count(), true);
MovePages *dia = new MovePages(this, doc->currentPage->pageNr()+1, doc->Pages->count(), true);
if (dia->exec())
{
// doc->OpenNodes = outlinePalette->buildReopenVals();
6333,12 → 6341,12
{
int GrMax = doc->GroupCounter;
NoFrameEdit();
MovePages *dia = new MovePages(this, doc->currentPage->pageNr()+1, doc->Pages.count(), false);
MovePages *dia = new MovePages(this, doc->currentPage->pageNr()+1, doc->Pages->count(), false);
if (dia->exec())
{
bool autoText = doc->usesAutomaticTextFrames();
doc->setUsesAutomaticTextFrames(false);
Page* from = doc->Pages.at(dia->getFromPage()-1);
Page* from = doc->Pages->at(dia->getFromPage()-1);
int wo = dia->getWherePage();
int copyCount=dia->getCopyCount();
int whereToInsert=dia->getWhere();
6354,7 → 6362,7
slotNewPage(wo);
break;
case 2:
slotNewPage(doc->Pages.count());
slotNewPage(doc->Pages->count());
break;
}
doc->setUsesAutomaticTextFrames(autoText);
6469,7 → 6477,7
MarginDialog *dia = new MarginDialog(this, doc);
if (dia->exec())
{
if (doc->masterPageMode)
if (doc->masterPageMode())
{
if (doc->currentPageLayout != singlePage)
{
6686,7 → 6694,7
 
void ScribusApp::saveLStyles(LineFormate *dia)
{
if (doc->masterPageMode)
if (doc->masterPageMode())
doc->MasterItems = doc->Items;
else
doc->DocItems = doc->Items;
6750,7 → 6758,7
ers.append(2);
ers.append(3);
ers.append(4);
if (doc->masterPageMode)
if (doc->masterPageMode())
doc->MasterItems = doc->Items;
else
doc->DocItems = doc->Items;
8109,7 → 8117,7
if (HaveDoc)
{
view->Deselect(true);
if (doc->masterPageMode)
if (doc->masterPageMode())
{
ActWin->muster->updateMasterPageList(temp);
ActWin->muster->selectMasterPage(temp);
8170,13 → 8178,14
scrActions["pageImport"]->setEnabled(true);
scrActions["pageApplyMasterPage"]->setEnabled(true);
scrActions["pageCopyToMasterPage"]->setEnabled(true);
bool setter = doc->Pages.count() > 1 ? true : false;
bool setter = doc->Pages->count() > 1 ? true : false;
scrActions["pageDelete"]->setEnabled(setter);
scrActions["pageMove"]->setEnabled(setter);
uint pageCount=doc->Pages.count();
uint pageCount=doc->Pages->count();
for (uint c=0; c<pageCount; ++c)
Apply_MasterPage(doc->Pages.at(c)->MPageNam, c, false);
doc->masterPageMode = false;
Apply_MasterPage(doc->Pages->at(c)->MPageNam, c, false);
doc->setMasterPageMode(false);
//doc->Pages=&doc->DocPages;
pagePalette->enablePalette(true);
pagePalette->RebuildTemp();
ActWin->muster = NULL;
8369,10 → 8378,10
where = 0;
wo = 1;
}
else if (pagenr > doc->Pages.count())
else if (pagenr > doc->Pages->count())
{
where = 2;
wo = doc->Pages.count();
wo = doc->Pages->count();
}
else
{
8383,7 → 8392,7
{
addNewPages(wo, where, 1, doc->pageHeight, doc->pageWidth, doc->PageOri, doc->PageSize, true, &tmpl);
UndoObject *tmp =
undoManager->replaceObject(state->getUInt("DUMMY_ID"), doc->Pages.at(pagenr - 1));
undoManager->replaceObject(state->getUInt("DUMMY_ID"), doc->Pages->at(pagenr - 1));
delete tmp;
}
else
8390,7 → 8399,7
{
DummyUndoObject *duo = new DummyUndoObject();
uint id = static_cast<uint>(duo->getUId());
undoManager->replaceObject(doc->Pages.at(pagenr - 1)->getUId(), duo);
undoManager->replaceObject(doc->Pages->at(pagenr - 1)->getUId(), duo);
state->set("DUMMY_ID", id);
DeletePage(pagenr, pagenr);
}
8420,8 → 8429,8
delTo = wo + count;
break;
case 2:
delTo = doc->Pages.count();
delFrom = doc->Pages.count() - count + 1;
delTo = doc->Pages->count();
delFrom = doc->Pages->count() - count + 1;
if (!isUndo)
{
delFrom += count;
8435,7 → 8444,7
{
DummyUndoObject *duo = new DummyUndoObject();
ulong did = duo->getUId();
undoManager->replaceObject(doc->Pages.at(i)->getUId(), duo);
undoManager->replaceObject(doc->Pages->at(i)->getUId(), duo);
state->set(QString("Page%1").arg(i), static_cast<uint>(did));
}
NoFrameEdit();
8448,7 → 8457,7
for (int i = delFrom - 1; i < delTo; ++i)
{
UndoObject *tmp = undoManager->replaceObject(
state->getUInt(QString("Page%1").arg(i)), doc->Pages.at(i));
state->getUInt(QString("Page%1").arg(i)), doc->Pages->at(i));
delete tmp;
}
}
8746,10 → 8755,12
//TODO replace with the ScribusDoc::deleteTaggedItems
void ScribusApp::LayerRemove(int l, bool dl)
{
/*
if (doc->masterPageMode)
doc->MasterPages = doc->Pages;
else
doc->DocPages = doc->Pages;
*/
view->Deselect();
for (uint b = 0; b < doc->MasterItems.count(); ++b)
{
9216,9 → 9227,9
delete ss;
}
view->close();
uint numPages=doc->Pages.count();
uint numPages=doc->Pages->count();
for (uint a=0; a<numPages; ++a)
delete doc->Pages.at(a);
delete doc->Pages->at(a);
delete doc;
ActWin->close();
}
9599,7 → 9610,7
{
if (!HaveDoc)
return;
if(doc->masterPageMode)
if(doc->masterPageMode())
{
ActWin->muster->close();
qApp->processEvents();
/branches/Version13x/Scribus/scribus/plugins/pixmapexport/export.cpp
155,7 → 155,7
uint over = 0;
QString fileName = getFileName(pageNr);
 
if (!ScApp->doc->Pages.at(pageNr))
if (!ScApp->doc->Pages->at(pageNr))
return false;
 
/* a little magic here - I need to compute the "maxGr" value...
/branches/Version13x/Scribus/scribus/plugins/scriptplugin/cmdpage.cpp
43,7 → 43,7
if(!checkHaveDocument())
return NULL;
e--;
if ((e < 0) || (e > static_cast<int>(ScApp->doc->Pages.count())-1))
if ((e < 0) || (e > static_cast<int>(ScApp->doc->Pages->count())-1))
{
PyErr_SetString(PyExc_IndexError, QObject::tr("Page number out of range.","python error"));
return NULL;
61,7 → 61,7
if(!checkHaveDocument())
return NULL;
e--;
if ((e < 0) || (e > static_cast<int>(ScApp->doc->Pages.count())-1))
if ((e < 0) || (e > static_cast<int>(ScApp->doc->Pages->count())-1))
{
PyErr_SetString(PyExc_IndexError, QObject::tr("Page number out of range.","python error"));
return NULL;
80,11 → 80,11
if(!checkHaveDocument())
return NULL;
if (e < 0)
ScApp->slotNewPageP(ScApp->doc->Pages.count(), QString::fromUtf8(name));
ScApp->slotNewPageP(ScApp->doc->Pages->count(), QString::fromUtf8(name));
else
{
e--;
if ((e < 0) || (e > static_cast<int>(ScApp->doc->Pages.count())-1))
if ((e < 0) || (e > static_cast<int>(ScApp->doc->Pages->count())-1))
{
PyErr_SetString(PyExc_IndexError, QObject::tr("Page number out of range.","python error"));
return NULL;
99,7 → 99,7
{
if(!checkHaveDocument())
return NULL;
return PyInt_FromLong(static_cast<long>(ScApp->doc->Pages.count()));
return PyInt_FromLong(static_cast<long>(ScApp->doc->Pages->count()));
}
 
PyObject *scribus_pagedimension(PyObject* /* self */)
/branches/Version13x/Scribus/scribus/plugins/short-words/parse.cpp
127,7 → 127,8
void SWParse::parsePage(int page)
{
uint cnt = 0;
for (uint a = 0; a < ScApp->doc->Items.count(); ++a)
uint docItemsCount=ScApp->doc->Items.count();
for (uint a = 0; a < docItemsCount; ++a)
{
PageItem* b = ScApp->doc->Items.at(a);
if (b->OwnPage == page)
136,7 → 137,7
ScApp->mainWindowProgressBar->setTotalSteps(cnt);
ScApp->view->GotoPage(page);
uint i = 0;
for (uint a = 0; a < ScApp->doc->Items.count(); ++a)
for (uint a = 0; a < docItemsCount; ++a)
{
PageItem* b = ScApp->doc->Items.at(a);
if (b->OwnPage == page)
150,6 → 151,6
 
void SWParse::parseAll()
{
for (uint i=0; i < ScApp->doc->Pages.count(); ++i)
for (uint i=0; i < ScApp->doc->Pages->count(); ++i)
parsePage(i);
}
/branches/Version13x/Scribus/scribus/tree.cpp
159,7 → 159,7
QListViewItem* Tree::getListItem(uint SNr, int Nr)
{
QListViewItem *retVal = 0;
if (currDoc->masterPageMode)
if (currDoc->masterPageMode())
{
if (Nr == -1)
retVal = masterPageMapRev[currDoc->MasterPages.at(SNr)->PageNam];
239,7 → 239,7
return;
}
PageItem* pgItem;
if (currDoc->masterPageMode)
if (currDoc->masterPageMode())
pgItem = currDoc->MasterItems.at(Nr);
else
pgItem = currDoc->DocItems.at(Nr);
491,7 → 491,7
}
if (masterPageItemMap.contains(ite))
{
if (!currDoc->masterPageMode)
if (!currDoc->masterPageMode())
emit selectMasterPage(currDoc->MasterItems.at(masterPageItemMap[ite])->OnMasterPage);
if (currDoc->MasterItems.at(masterPageItemMap[ite])->Groups.count() == 0)
emit selectElement(-1, masterPageItemMap[ite], false);
502,7 → 502,7
}
if (masterPageGroupMap.contains(ite))
{
if (!currDoc->masterPageMode)
if (!currDoc->masterPageMode())
emit selectMasterPage(currDoc->MasterItems.at(masterPageGroupMap[ite])->OnMasterPage);
emit selectElement(-1, masterPageGroupMap[ite], false);
selectionTriggered = false;
/branches/Version13x/Scribus/scribus/pslib.cpp
1012,8 → 1012,8
gw = maxx - minx;
gh = maxy - miny;
int pgNum = pageNs[0]-1;
gx -= Doc->Pages.at(pgNum)->xOffset();
gy -= Doc->Pages.at(pgNum)->yOffset();
gx -= Doc->Pages->at(pgNum)->xOffset();
gy -= Doc->Pages->at(pgNum)->yOffset();
PS_begin_doc(Doc->PageOri, gx, Doc->pageHeight - (gy+gh), gx + gw, Doc->pageHeight - gy, 1*pagemult, false, sep);
}
else
1070,20 → 1070,20
struct MarginStruct Ma;
Ma.Left = gx;
Ma.Top = gy;
Ma.Bottom = Doc->Pages.at(a)->height() - (gy + gh);
Ma.Right = Doc->Pages.at(a)->width() - (gx + gw);
PS_begin_page(Doc->Pages.at(a)->width(), Doc->Pages.at(a)->height(), &Ma, true);
Ma.Bottom = Doc->Pages->at(a)->height() - (gy + gh);
Ma.Right = Doc->Pages->at(a)->width() - (gx + gw);
PS_begin_page(Doc->Pages->at(a)->width(), Doc->Pages->at(a)->height(), &Ma, true);
}
else
PS_begin_page(Doc->Pages.at(a)->width(), Doc->Pages.at(a)->height(), &Doc->Pages.at(a)->Margins, view->Prefs->ClipMargin);
PS_begin_page(Doc->Pages->at(a)->width(), Doc->Pages->at(a)->height(), &Doc->Pages->at(a)->Margins, view->Prefs->ClipMargin);
if (Hm)
{
PS_translate(Doc->Pages.at(a)->width(), 0);
PS_translate(Doc->Pages->at(a)->width(), 0);
PS_scale(-1, 1);
}
if (Vm)
{
PS_translate(0, Doc->Pages.at(a)->height());
PS_translate(0, Doc->Pages->at(a)->height());
PS_scale(1, -1);
}
if (sep)
1101,7 → 1101,7
else
PS_plate(4, SepNam);
}
if (!Doc->Pages.at(a)->MPageNam.isEmpty())
if (!Doc->Pages->at(a)->MPageNam.isEmpty())
{
int h, s, v, k;
QCString chxc;
1110,7 → 1110,7
struct Layer ll;
ll.isPrintable = false;
ll.LNr = 0;
Page* mPage = Doc->MasterPages.at(Doc->MasterNames[Doc->Pages.at(a)->MPageNam]);
Page* mPage = Doc->MasterPages.at(Doc->MasterNames[Doc->Pages->at(a)->MPageNam]);
if (Doc->MasterItems.count() != 0)
{
for (uint lam = 0; lam < Doc->Layers.count(); ++lam)
1118,14 → 1118,14
Level2Layer(Doc, &ll, Lnr);
if (ll.isPrintable)
{
for (uint am = 0; am < Doc->Pages.at(a)->FromMaster.count(); ++am)
for (uint am = 0; am < Doc->Pages->at(a)->FromMaster.count(); ++am)
{
QString tmps;
PageItem *ite = Doc->Pages.at(a)->FromMaster.at(am);
PageItem *ite = Doc->Pages->at(a)->FromMaster.at(am);
if ((ite->LayerNr != ll.LNr) || (!ite->printable()))
continue;
if (!(ite->asTextFrame()) && !(ite->asImageFrame()))
PS_UseTemplate(Doc->Pages.at(a)->MPageNam + tmps.setNum(ite->ItemNr));
PS_UseTemplate(Doc->Pages->at(a)->MPageNam + tmps.setNum(ite->ItemNr));
else if (ite->asImageFrame())
{
PS_save();
1260,9 → 1260,9
}
}
}
for (uint am = 0; am < Doc->Pages.at(a)->FromMaster.count(); ++am)
for (uint am = 0; am < Doc->Pages->at(a)->FromMaster.count(); ++am)
{
PageItem *ite = Doc->Pages.at(a)->FromMaster.at(am);
PageItem *ite = Doc->Pages->at(a)->FromMaster.at(am);
if (!ite->isTableItem)
continue;
if (ite->printable())
1310,7 → 1310,7
}
}
}
ProcessPage(Doc, view, Doc->Pages.at(a), a+1, sep, farb, Ic, gcr);
ProcessPage(Doc, view, Doc->Pages->at(a), a+1, sep, farb, Ic, gcr);
PS_end_page();
if (sep)
{
2224,7 → 2224,7
chx = " ";
if (hl->ch == QChar(30))
{
if (Doc->masterPageMode)
if (Doc->masterPageMode())
chx = "#";
else
{