Subversion Repositories Scribus

Compare Revisions

Ignore whitespace Rev 3792 → Rev 3793

/branches/Version13x/Scribus/scribus/util.cpp
1626,4 → 1626,4
pageNs->push_back(pageNr);
}
} while (!tmp.isEmpty());
}
}
/branches/Version13x/Scribus/scribus/scribusdoc.cpp
3081,7 → 3081,8
}
}
Q_ASSERT(found);
if (!found)
return;
DocumentSectionMap::Iterator it2(it);
//For this if: We are adding before the beginning of a section, so we must put this
3099,3 → 3100,39
//Now update the Pages' internal storage of their page number
updateSectionPageNumbersToPages();
}
 
 
void ScribusDoc::removePageFromSection(const uint pageIndex)
{
//Get the section of the new page index.
bool found=false;
DocumentSectionMap::Iterator it = sections.begin();
for (; it!= sections.end(); ++it)
{
if (pageIndex>=it.data().fromindex && pageIndex<=it.data().toindex)
{
found=true;
break;
}
}
Q_ASSERT(found);
if (!found)
return;
--it.data().toindex;
++it;
while (it!=sections.end())
{
--it.data().fromindex;
--it.data().toindex;
++it;
}
//Now update the Pages' internal storage of their page number
updateSectionPageNumbersToPages();
}
 
void ScribusDoc::setFirstSectionFromFirstPageNumber()
{
DocumentSectionMap::Iterator it = sections.begin();
it.data().sectionstartindex=FirstPnum;
updateSectionPageNumbersToPages();
}
/branches/Version13x/Scribus/scribus/scribusdoc.h
435,6 → 435,8
*
*/
void addPageToSection(const uint otherPageIndex, const uint location, const uint count=1);
void removePageFromSection(const uint pageIndex);
void setFirstSectionFromFirstPageNumber();
 
protected:
/branches/Version13x/Scribus/scribus/scribus.cpp
2302,6 → 2302,7
 
doc->pageCount = doc->DocPages.count();
doc->addSection();
doc->setFirstSectionFromFirstPageNumber();
doc->setModified(false);
doc->setLoading(false);
doc->currentPage = doc->Pages->at(0);
3830,7 → 3831,11
doc->addMasterPage(0, "Normal");
doc->pageCount = doc->DocPages.count();
//Add doc sections if we have none
doc->addSection(-1);
if (doc->sections.count()==0)
{
doc->addSection(-1);
doc->setFirstSectionFromFirstPageNumber();
}
doc->setLoading(false);
doc->RePos = true;
QPixmap pgPix(10, 10);
5267,7 → 5272,8
}
break;
}
doc->addPageToSection(wot, where, numPages);
//Must use wo-1 as the dialog currently returns a page Index +1 due to old numbering scheme
doc->addPageToSection(wo-1, where, numPages);
pagePalette->RebuildPage();
view->reformPages(mov);
view->DrawNew();
6156,6 → 6162,7
undoManager->action(this, ss);
}
view->delPage(a);
doc->removePageFromSection(a);
}
view->reformPages();
view->DrawNew();