Subversion Repositories Scribus

Compare Revisions

Ignore whitespace Rev 12486 → Rev 12487

/trunk/Scribus/scribus/scribus.cpp
5763,12 → 5763,7
{
locationEntries << CommonStrings::translatePageSetLocString(*pNames);
}
if (doc->currentPage()->LeftPg == 1)
pageLocationIndex=0;
else if (doc->currentPage()->LeftPg == 0)
pageLocationIndex=locationEntries.count()-1;
else
pageLocationIndex=doc->currentPage()->LeftPg-1;
pageLocationIndex=doc->columnOfPage(doc->currentPageNumber());
pageLocationCount=locationEntries.count();
}
 
/trunk/Scribus/scribus/scribusdoc.cpp
4163,33 → 4163,6
getBleeds(Pages->at(pageNumber), bleedData);
else
qCritical() << "Attempting to get bleeds for non-existant page";
/*
*bleedBottom = bleeds.Bottom;
*bleedTop = bleeds.Top;
if (pageSets[currentPageLayout].Columns == 1)
{
*bleedRight = bleeds.Right;
*bleedLeft = bleeds.Left;
}
else
{
if (locationOfPage(Pages->at(pageNumber)->pageNr()) == LeftPage)
{
*bleedRight = bleeds.Left;
*bleedLeft = bleeds.Right;
}
else if (locationOfPage(Pages->at(pageNumber)->pageNr()) == RightPage)
{
*bleedRight = bleeds.Right;
*bleedLeft = bleeds.Left;
}
else
{
*bleedRight = bleeds.Left;
*bleedLeft = bleeds.Left;
}
}
*/
}
 
 
4570,21 → 4543,6
const QString ScribusDoc::getSectionPageNumberForPageIndex(const uint pageIndex) const
{
QString retVal(QString::null);
/*
bool found=false;
 
DocumentSectionMap::ConstIterator it = sections.begin();
for (; it!= sections.end(); ++it)
{
if (pageIndex>=it.data().fromindex && pageIndex<=it.data().toindex)
{
found=true;
break;
}
}
if (!found)
return retVal;
*/
int key=getSectionKeyForPageIndex(pageIndex);
if (key==-1)
return retVal;
4879,19 → 4837,22
 
PageLocation ScribusDoc::locationOfPage(int pageIndex) const
{
int setcol=pageSets[currentPageLayout].Columns;
if (setcol==1)
return LeftPage;
int myCol = ((pageIndex % setcol)+pageSets[currentPageLayout].FirstPage)%setcol;
int myCol=columnOfPage(pageIndex);
if (myCol==0) //Left hand page
return LeftPage;
else if (myCol>= setcol-1) // Right hand page
else if (myCol>= pageSets[currentPageLayout].Columns-1) // Right hand page
return RightPage;
else //Middle pages
return MiddlePage;
}
 
int ScribusDoc::columnOfPage(int pageIndex) const
{
int setcol=pageSets[currentPageLayout].Columns;
return ((pageIndex % setcol) + pageSets[currentPageLayout].FirstPage) % setcol;
}
 
 
void ScribusDoc::updateAllItemQColors()
{
for (int c=0; c<DocItems.count(); ++c)
/trunk/Scribus/scribus/scribusdoc.h
768,6 → 768,12
* @return LeftPage, MiddlePage, RightPage, enum from pagestructs.h
*/
PageLocation locationOfPage(int pageIndex) const;
/**
* \brief Get the column of the page on the canvas, ie, left, middle, or right
* @param pageIndex Index of page to find location for
* @return int of 0,1,2,3
*/
int columnOfPage(int pageIndex) const;
bool sendItemSelectionToBack();
bool bringItemSelectionToFront();