r14788 by jghali - fix display going awery when dropping master page to trash in page palette
scribus-commit
scribus-commit at lists.scribus.net
Sun Feb 21 02:10:35 CET 2010
Revision: 14788
Author: jghali
Date: 2010-02-21T01:05:44.237065Z
Commit message: fix display going awery when dropping master page to trash in page palette
Changeset:
M /trunk/Scribus/scribus/ui/pagepalette.cpp
Diffs:
Index: scribus/ui/pagepalette.cpp
===================================================================
--- scribus/ui/pagepalette.cpp (revision 14787)
+++ scribus/ui/pagepalette.cpp (revision 14788)
@@ -642,6 +642,10 @@
if (exit == QMessageBox::Yes)
{
bool oldMPMode = currView->Doc->masterPageMode();
+ int storedPageNum = currView->Doc->currentPageNumber();
+ int storedViewXCoor = currView->horizontalScrollBar()->value();
+ int storedViewYCoor = currView->verticalScrollBar()->value();
+
currView->Doc->setMasterPageMode(true);
currView->Doc->scMW()->DeletePage2(currView->Doc->MasterNames[tmp]);
//<<CB TODO Move back into ScribusDoc::deleteMasterPage();
@@ -651,6 +655,11 @@
currView->Doc->replaceMasterPage(tmp);
currView->Doc->setMasterPageMode(oldMPMode);
currView->Doc->setModified(true);
+
+ currView->Doc->setCurrentPage(currView->Doc->DocPages.at(storedPageNum));
+ currView->reformPages(false);
+ currView->setContentsPos(storedViewXCoor, storedViewYCoor);
+ currView->DrawNew();
}
}
@@ -750,12 +759,12 @@
pageLayout->updateLayoutSelector(currView->Doc->pageSets);
pageLayout->selectItem(currView->Doc->currentPageLayout);
pageLayout->firstPage->setCurrentIndex(currView->Doc->pageSets[currView->Doc->currentPageLayout].FirstPage);
- pageView->MaxC = currView->Doc->Pages->count()-1;
+ pageView->MaxC = currView->Doc->DocPages.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;
- int rows = (currView->Doc->Pages->count()+counter) / currView->Doc->pageSets[currView->Doc->currentPageLayout].Columns;
- if (((currView->Doc->Pages->count()+counter) % currView->Doc->pageSets[currView->Doc->currentPageLayout].Columns) != 0)
+ int rows = (currView->Doc->DocPages.count()+counter) / currView->Doc->pageSets[currView->Doc->currentPageLayout].Columns;
+ if (((currView->Doc->DocPages.count()+counter) % currView->Doc->pageSets[currView->Doc->currentPageLayout].Columns) != 0)
rows++;
rowcounter = 0;
if (cols == 1)
@@ -792,9 +801,9 @@
pageView->firstP = counter;
pageView->cols = currView->Doc->pageSets[currView->Doc->currentPageLayout].Columns;
pageList.clear();
- for (int a = 0; a < currView->Doc->Pages->count(); ++a)
+ for (int a = 0; a < currView->Doc->DocPages.count(); ++a)
{
- str = currView->Doc->Pages->at(a)->MPageNam;
+ str = currView->Doc->DocPages.at(a)->MPageNam;
SeItem *it = new SeItem(str, a, CreateIcon(a, pix));
pageList.append(it);
pageView->setItem(rowcounter*rowmult+rowadd, counter*colmult+coladd, (QTableWidgetItem *)it);
More information about the scribus-commit
mailing list