Subversion Repositories Scribus

Compare Revisions

Ignore whitespace Rev 3669 → Rev 3670

/branches/Version13x/Scribus/scribus/fileloader.cpp
17,6 → 17,7
#include "fileloader.h"
#include "fontreplacedialog.h"
#include "missing.h"
#include "page.h"
#include "pluginmanager.h"
#include "pagestructs.h"
#include "scconfig.h"
/branches/Version13x/Scribus/scribus/page.h
18,6 → 18,8
#ifndef PAGE_H
#define PAGE_H
 
#include <utility>
 
class QString;
#include "qvaluelist.h"
#include "qptrlist.h"
80,6 → 82,7
UndoManager* undoManager;
void restorePageItemCreation(ItemState<PageItem*> *state, bool isUndo);
void restorePageItemDeletion(ItemState<PageItem*> *state, bool isUndo);
void restorePageItemConversion(ItemState<std::pair<PageItem*, PageItem*> >*state, bool isUndo);
double m_xOffset;
double m_yOffset;
/branches/Version13x/Scribus/scribus/page.cpp
259,6 → 259,8
restorePageItemCreation(dynamic_cast<ItemState<PageItem*>*>(ss), isUndo);
else if (ss->contains("DELETE_ITEM"))
restorePageItemDeletion(dynamic_cast<ItemState<PageItem*>*>(ss), isUndo);
else if (ss->contains("CONVERT_ITEM"))
restorePageItemConversion(dynamic_cast<ItemState<std::pair<PageItem*, PageItem*> >*>(ss), isUndo);
}
}
 
308,6 → 310,31
}
}
 
void Page::restorePageItemConversion(ItemState<std::pair<PageItem*, PageItem*> >*state, bool isUndo)
{
if (!state)
return;
 
PageItem *oldItem=state->getItem().first;
PageItem *newItem=state->getItem().second;
if (isUndo)
{
ScApp->doc->Items.take(newItem->ItemNr);
ScApp->doc->Items.append(oldItem);
oldItem->ItemNr = ScApp->doc->Items.count()-1;
}
else
{
ScApp->doc->Items.take(oldItem->ItemNr);
ScApp->doc->Items.append(newItem);
newItem->ItemNr = ScApp->doc->Items.count()-1;
}
if (ScApp->doc->masterPageMode)
ScApp->doc->MasterItems = ScApp->doc->Items;
else
ScApp->doc->DocItems = ScApp->doc->Items;
}
 
const double Page::xOffset()
{
return m_xOffset;
/branches/Version13x/Scribus/scribus/reformdoc.cpp
23,6 → 23,7
#include "docitemattrprefs.h"
#include "tocindexprefs.h"
#include "marginWidget.h"
#include "page.h"
#include "prefsmanager.h"
#include "pagelayout.h"
#include "fontcombo.h"
/branches/Version13x/Scribus/scribus/pdflib.cpp
36,6 → 36,7
#endif
#include "rc4.h"
 
#include "page.h"
#include "pageitem.h"
#include "bookmwin.h"
#include "scribus.h"
/branches/Version13x/Scribus/scribus/scribusdoc.cpp
20,6 → 20,7
#include "scribusdoc.h"
#include "scribusXml.h"
 
#include <utility>
#include <qfile.h>
 
#include "page.h"
2164,7 → 2165,7
 
int ScribusDoc::itemAdd(const PageItem::ItemType itemType, const PageItem::ItemFrameType frameType, const double x, const double y, const double b, const double h, const double w, const QString& fill, const QString& outline, const bool itemFinalised)
{
if (UndoManager::undoEnabled() && !_itemCreationTransactionStarted && false)
if (UndoManager::undoEnabled() && !_itemCreationTransactionStarted)
{
_itemCreationTransactionStarted = true;
undoManager->beginTransaction();
2219,7 → 2220,7
DocItems = Items;
//Add in item default values based on itemType and frameType
itemAddDetails(itemType, frameType, newItem->ItemNr);
if (UndoManager::undoEnabled() && false)
if (UndoManager::undoEnabled())
{
ItemState<PageItem*> *is = new ItemState<PageItem*>("Create PageItem");
is->set("CREATE_ITEM", "create_item");
2674,3 → 2675,40
return Pages.at(pageNumber)->yOffset();
return -1.0;
}
 
PageItem* ScribusDoc::convertToImageFrame(PageItem *currItem)
{
PageItem *oldItem = Items.take(currItem->ItemNr);
PageItem *newItem = new PageItem_ImageFrame(*oldItem);
Q_ASSERT(newItem!=NULL);
if (newItem==NULL)
return false;
newItem->convertTo(PageItem::ImageFrame);
newItem->Frame = true;
Items.append(newItem);
newItem->ItemNr = Items.count()-1;
//<<At some point we HAVE to stop this!
if (masterPageMode)
MasterItems = Items;
else
DocItems = Items;
//>>
if (UndoManager::undoEnabled())
{
ItemState<std::pair<PageItem*, PageItem*> > *is = new ItemState<std::pair<PageItem*, PageItem*> >("Convert Item");
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);
if (newItem->OwnPage > -1)
target = Pages.at(newItem->OwnPage);
undoManager->action(target, is);
}
 
return newItem;
}
 
const int ScribusDoc::currentPageNumber()
{
return currentPage->pageNr();
}
/branches/Version13x/Scribus/scribus/scribusview.h
41,7 → 41,7
#include "scribusdoc.h"
#include "scribusstructs.h"
#include "scpainter.h"
#include "page.h"
class Page;
#include "mspinbox.h"
#include "util.h"
class Hruler;
/branches/Version13x/Scribus/scribus/scribusXml.cpp
19,6 → 19,7
#include <cstdlib>
#include <cmath>
#include "missing.h"
#include "page.h"
#include "pageitem.h"
#include "units.h"
#include "prefsmanager.h"
/branches/Version13x/Scribus/scribus/seiten.cpp
3,6 → 3,7
#include <qcursor.h>
#include "scribus.h"
#include "dynamictip.h"
#include "page.h"
#include "pagelayout.h"
#include "sccombobox.h"
extern QPixmap loadIcon(QString nam);
614,7 → 615,7
currView->Doc->resetPage(tpr, lr, rr, br, layout);
currView->reformPages();
currView->DrawNew();
currView->GotoPage(currView->Doc->currentPage->pageNr());
currView->GotoPage(currView->Doc->currentPageNumber());
RebuildPage();
currView->Doc->setModified(true);
}
624,7 → 625,7
currView->Doc->pageSets[currView->Doc->currentPageLayout].FirstPage = fp;
currView->reformPages();
currView->DrawNew();
currView->GotoPage(currView->Doc->currentPage->pageNr());
currView->GotoPage(currView->Doc->currentPageNumber());
RebuildPage();
currView->Doc->setModified(true);
}
/branches/Version13x/Scribus/scribus/guidemanager.cpp
19,7 → 19,7
#include "scribus.h"
#include "guidemanager.h"
#include "guidemanager.moc"
 
#include "page.h"
#include "units.h"
#include <qradiobutton.h>
#include <qlayout.h>
/branches/Version13x/Scribus/scribus/scribusdoc.h
38,6 → 38,7
#include "prefsstructs.h"
#include "documentinformation.h"
#include "undoobject.h"
//#include "page.h"
#include "pageitem.h"
#include "pageitem_line.h"
#include "pageitem_textframe.h"
364,10 → 365,22
void reformPages(double& maxX, double& maxY, bool moveObjects = true);
/**
*
* @brief Return the x or y offset for a page on the canvas
* @retval double containing the offset. Returns -1.0 if page not in Pages list (as -ve is not possible).
* Mostly saves bringing in extra includes into files that already have scribusdoc.h
*/
const double getXOffsetForPage(const int);
const double getYOffsetForPage(const int);
/**
* @brief Item type conversion functions
*/
PageItem* convertToImageFrame(PageItem *);
/**
* @brief The page number of the current page
*/
const int currentPageNumber();
 
protected:
void addSymbols();
/branches/Version13x/Scribus/scribus/scribusview.cpp
8256,14 → 8256,14
void ScribusView::ToPicFrame()
{
//emit Amode(1);
PageItem *currItem = new PageItem_ImageFrame(*SelItem.at(0));
currItem->convertTo(PageItem::ImageFrame);
currItem->Frame = true;
RefreshItem(currItem);
emit HaveSel(currItem->itemType());
PageItem *currItem = SelItem.at(0);
Deselect(true);
PageItem* newItem=Doc->convertToImageFrame(currItem);
RefreshItem(newItem);
emit HaveSel(newItem->itemType());
if (!Doc->isLoading())
emit UpdtObj(Doc->currentPage->pageNr(), currItem->ItemNr);
EmitValues(currItem);
emit UpdtObj(Doc->currentPage->pageNr(), newItem->ItemNr);
EmitValues(newItem);
emit DocChanged();
}
 
/branches/Version13x/Scribus/scribus/muster.cpp
9,6 → 9,7
#include <qcursor.h>
#include <qstring.h>
#include <qtooltip.h>
#include "page.h"
#include "scribusdoc.h"
#include "scribusview.h"
#include "util.h"
/branches/Version13x/Scribus/scribus/plugins/pixmapexport/export.cpp
111,7 → 111,7
 
// interval widgets handling
QString tmp;
dia->RangeVal->setText(tmp.setNum(ScApp->doc->currentPage->pageNr()+1));
dia->RangeVal->setText(tmp.setNum(ScApp->doc->currentPageNumber()+1));
// main "loop"
if (dia->exec()==QDialog::Accepted)
{
216,7 → 216,7
 
bool ExportBitmap::exportActual()
{
return exportPage(ScApp->doc->currentPage->pageNr(), true);
return exportPage(ScApp->doc->currentPageNumber(), true);
}
 
bool ExportBitmap::exportInterval(std::vector<int> &pageNs)
/branches/Version13x/Scribus/scribus/plugins/scriptplugin/cmdpage.cpp
1,11 → 1,12
#include "cmdpage.h"
#include "cmdutil.h"
#include "page.h"
 
PyObject *scribus_actualpage(PyObject* /* self */)
{
if(!checkHaveDocument())
return NULL;
return PyInt_FromLong(static_cast<long>(ScApp->doc->currentPage->pageNr() + 1));
return PyInt_FromLong(static_cast<long>(ScApp->doc->currentPageNumber() + 1));
}
 
PyObject *scribus_redraw(PyObject* /* self */)
121,7 → 122,7
if (ScApp->doc->Items.count() == 0)
return Py_BuildValue((char*)"[]");
uint counter = 0;
uint pageNr = ScApp->doc->currentPage->pageNr();
uint pageNr = ScApp->doc->currentPageNumber();
for (uint lam2 = 0; lam2 < ScApp->doc->Items.count(); ++lam2)
{
if (pageNr == ScApp->doc->Items.at(lam2)->OwnPage)
/branches/Version13x/Scribus/scribus/plugins/scriptplugin/cmdutil.cpp
1,5 → 1,6
#include "cmdutil.h"
#include "units.h"
#include "page.h"
 
ScribusApp* Carrier;
ScribusDoc* doc;
/branches/Version13x/Scribus/scribus/plugins/scriptplugin/cmdgetprop.cpp
191,7 → 191,7
int typ = -1;
uint counter = 0;
uint counter2 = 0;
uint pageNr = ScApp->doc->currentPage->pageNr();
uint pageNr = ScApp->doc->currentPageNumber();
if (!PyArg_ParseTuple(args, "|i", &typ))
return NULL;
if(!checkHaveDocument())
/branches/Version13x/Scribus/scribus/plugins/scriptplugin/objimageexport.cpp
1,5 → 1,6
#include "objimageexport.h"
#include "cmdutil.h"
#include "page.h"
 
#include <structmember.h>
#include <qfileinfo.h>
/branches/Version13x/Scribus/scribus/plugins/scriptplugin/cmddoc.cpp
110,7 → 110,7
ScApp->doc->resetPage(tpr, lr, rr, btr, ScApp->doc->currentPageLayout);
ScApp->view->reformPages();
ScApp->doc->setModified(true);
ScApp->view->GotoPage(ScApp->doc->currentPage->pageNr());
ScApp->view->GotoPage(ScApp->doc->currentPageNumber());
ScApp->view->DrawNew();
Py_INCREF(Py_None);
return Py_None;
237,7 → 237,7
if (ScApp->doc->currentPageLayout = fp)
ScApp->doc->pageSets[ScApp->doc->currentPageLayout].FirstPage = fsl;
ScApp->view->reformPages();
ScApp->view->GotoPage(ScApp->doc->currentPage->pageNr()); // is this needed?
ScApp->view->GotoPage(ScApp->doc->currentPageNumber()); // is this needed?
ScApp->view->DrawNew(); // is this needed?
//CB TODO ScApp->pagePalette->RebuildPage(); // is this needed?
ScApp->slotDocCh();
/branches/Version13x/Scribus/scribus/plugins/short-words/shortwords.cpp
15,6 → 15,7
#include "vlnadialog.h"
#include "configuration.h"
#include "parse.h"
#include "page.h"
#include "swprefsgui.h"
#include "scpaths.h"
#include "scribus.h"
/branches/Version13x/Scribus/scribus/plugins/short-words/parse.cpp
17,6 → 17,7
#include "configuration.h"
 
#include "scribus.h"
#include "page.h"
#include "pageitem.h"
#include <qregexp.h>
 
120,7 → 121,7
 
void SWParse::parsePage()
{
parsePage(ScApp->doc->currentPage->pageNr());
parsePage(ScApp->doc->currentPageNumber());
}
 
void SWParse::parsePage(int page)
/branches/Version13x/Scribus/scribus/plugins/svgexplugin/svgexplugin.cpp
24,12 → 24,13
 
#include "customfdialog.h"
#include "scribus.h"
#include "page.h"
#ifdef HAVE_LIBZ
#include <zlib.h>
#endif
#include "prefsmanager.h"
#include <prefsfile.h>
#include <prefscontext.h>
#include "prefsfile.h"
#include "prefscontext.h"
#include "util.h"
 
int svgexplugin_getPluginAPIVersion()
/branches/Version13x/Scribus/scribus/plugins/psimport/importpsplugin.cpp
1,6 → 1,7
#include "importpsplugin.h"
#include "importps.h"
#include "scribus.h"
#include "page.h"
#include "prefsmanager.h"
#include "prefscontext.h"
#include "prefsfile.h"
/branches/Version13x/Scribus/scribus/tree.cpp
10,6 → 10,7
#include <qmessagebox.h>
 
#include "commonstrings.h"
#include "page.h"
#include "scribus.h"
 
extern QPixmap loadIcon(QString nam);
/branches/Version13x/Scribus/scribus/aligndistribute.cpp
29,7 → 29,7
#include <qlineedit.h>
 
#include "aligndistribute.moc"
 
#include "page.h"
#include "scribus.h"
#include "scribusdoc.h"
#include "undomanager.h"