Subversion Repositories Scribus

Compare Revisions

Ignore whitespace Rev 3726 → Rev 3727

/branches/Version13x/Scribus/scribus/fileloader.cpp
410,7 → 410,7
if (elem.hasAttribute("Version"))
newVersion = true;
QDomNode DOC=elem.firstChild();
counter = doc->Items.count();
counter = doc->Items->count();
baseobj = counter;
while(!DOC.isNull())
{
599,7 → 599,7
if (QStoInt(pg.attribute("NEXTITEM")) != -1)
{
if (QStoInt(pg.attribute("BACKITEM")) == -1)
LFrames.append(doc->Items.count());
LFrames.append(doc->Items->count());
}
int docGc = doc->GroupCounter;
doc->GroupCounter = 0;
704,7 → 704,7
}
if (pg.tagName()=="FRAMEOBJECT")
{
doc->FrameItems.append(doc->Items.take(Neu->ItemNr));
doc->FrameItems.append(doc->Items->take(Neu->ItemNr));
Neu->ItemNr = doc->FrameItems.count()-1;
}
}
720,19 → 720,19
{
PageItem* ta = TableItems.at(ttc);
if (ta->TopLinkID != -1)
ta->TopLink = doc->Items.at(TableID[ta->TopLinkID]);
ta->TopLink = doc->Items->at(TableID[ta->TopLinkID]);
else
ta->TopLink = 0;
if (ta->LeftLinkID != -1)
ta->LeftLink = doc->Items.at(TableID[ta->LeftLinkID]);
ta->LeftLink = doc->Items->at(TableID[ta->LeftLinkID]);
else
ta->LeftLink = 0;
if (ta->RightLinkID != -1)
ta->RightLink = doc->Items.at(TableID[ta->RightLinkID]);
ta->RightLink = doc->Items->at(TableID[ta->RightLinkID]);
else
ta->RightLink = 0;
if (ta->BottomLinkID != -1)
ta->BottomLink = doc->Items.at(TableID[ta->BottomLinkID]);
ta->BottomLink = doc->Items->at(TableID[ta->BottomLinkID]);
else
ta->BottomLink = 0;
}
745,14 → 745,14
QValueList<int>::Iterator lc;
for (lc = LFrames.begin(); lc != LFrames.end(); ++lc)
{
Its = doc->Items.at((*lc));
Its = doc->Items->at((*lc));
Itr = Its;
Its->BackBox = 0;
while (Its->NextIt != -1)
{
if (Its->NextIt < static_cast<int>(doc->Items.count()))
if (Its->NextIt < static_cast<int>(doc->Items->count()))
{
Itn = doc->Items.at(Its->NextIt);
Itn = doc->Items->at(Its->NextIt);
Its->NextBox = Itn;
Itn->BackBox = Its;
Its = Itn;
1464,13 → 1464,13
{
if ((pg.tagName()=="PAGEOBJECT") || (pg.tagName()=="FRAMEOBJECT"))
{
doc->Items = doc->DocItems;
//doc->Items = doc->DocItems;
//doc->Pages = &doc->DocPages;
doc->setMasterPageMode(false);
}
else
{
doc->Items = doc->MasterItems;
//doc->Items = doc->MasterItems;
//doc->Pages = &doc->MasterPages;
doc->setMasterPageMode(true);
}
1479,7 → 1479,7
if ((QStoInt(pg.attribute("NEXTITEM")) != -1) || (static_cast<bool>(QStoInt(pg.attribute("AUTOTEXT")))))
{
if (QStoInt(pg.attribute("BACKITEM")) == -1)
LFrames.append(doc->Items.count());
LFrames.append(doc->Items->count());
}
int docGc = doc->GroupCounter;
doc->GroupCounter = 0;
1581,19 → 1581,21
}
if (pg.tagName()=="FRAMEOBJECT")
{
doc->FrameItems.append(doc->Items.take(Neu->ItemNr));
doc->FrameItems.append(doc->Items->take(Neu->ItemNr));
Neu->ItemNr = doc->FrameItems.count()-1;
}
/*
if ((pg.tagName()=="PAGEOBJECT") || (pg.tagName()=="FRAMEOBJECT"))
{
doc->DocItems = doc->Items;
//doc->DocItems = doc->Items;
//doc->DocPages = doc->Pages;
}
else
{
doc->MasterItems = doc->Items;
//doc->MasterItems = doc->Items;
//doc->MasterPages = doc->Pages;
}
*/
doc->setMasterPageMode(false);
//doc->Pages=&doc->DocPages;
counter++;
1608,19 → 1610,19
{
PageItem* ta = TableItems.at(ttc);
if (ta->TopLinkID != -1)
ta->TopLink = doc->Items.at(TableID[ta->TopLinkID]);
ta->TopLink = doc->Items->at(TableID[ta->TopLinkID]);
else
ta->TopLink = 0;
if (ta->LeftLinkID != -1)
ta->LeftLink = doc->Items.at(TableID[ta->LeftLinkID]);
ta->LeftLink = doc->Items->at(TableID[ta->LeftLinkID]);
else
ta->LeftLink = 0;
if (ta->RightLinkID != -1)
ta->RightLink = doc->Items.at(TableID[ta->RightLinkID]);
ta->RightLink = doc->Items->at(TableID[ta->RightLinkID]);
else
ta->RightLink = 0;
if (ta->BottomLinkID != -1)
ta->BottomLink = doc->Items.at(TableID[ta->BottomLinkID]);
ta->BottomLink = doc->Items->at(TableID[ta->BottomLinkID]);
else
ta->BottomLink = 0;
}
1628,7 → 1630,7
//doc->Pages = &doc->DocPages;
doc->setMasterPageMode(false);
doc->pageCount = doc->Pages->count();
doc->Items = doc->DocItems;
//doc->Items = doc->DocItems;
//ScApp->view->reformPages();
doc->reformPages(maximumX, maximumY);
if (doc->Layers.count() == 0)
1648,7 → 1650,7
QValueList<int>::Iterator lc;
for (lc = LFrames.begin(); lc != LFrames.end(); ++lc)
{
Its = doc->Items.at((*lc));
Its = doc->Items->at((*lc));
Itr = Its;
Its->BackBox = 0;
if (Its->isAutoText)
1655,7 → 1657,7
doc->FirstAuto = Its;
while (Its->NextIt != -1)
{
Itn = doc->Items.at(Its->NextIt);
Itn = doc->Items->at(Its->NextIt);
Its->NextBox = Itn;
Itn->BackBox = Its;
Its = Itn;
1819,12 → 1821,12
// OBSOLETE CR 2005-02-06
case PageItem::ItemType1:
z = doc->itemAdd(PageItem::Polygon, PageItem::Ellipse, x, y, w, h, pw, Pcolor, Pcolor2, true);
currItem = doc->Items.at(z);
currItem = doc->Items->at(z);
break;
//
case PageItem::ImageFrame:
z = doc->itemAdd(PageItem::ImageFrame, PageItem::Unspecified, x, y, w, h, 1, doc->toolSettings.dBrushPict, "None", true);
currItem = doc->Items.at(z);
currItem = doc->Items->at(z);
currItem->LocalScX = scx;
currItem->LocalScY = scy;
currItem->LocalX = QStodouble(obj->attribute("LOCALX"));
1876,12 → 1878,12
// OBSOLETE CR 2005-02-06
case PageItem::ItemType3:
z = doc->itemAdd(PageItem::Polygon, PageItem::Rectangle, x, y, w, h, pw, Pcolor, Pcolor2, true);
currItem = doc->Items.at(z);
currItem = doc->Items->at(z);
break;
//
case PageItem::PathText:
z = doc->itemAdd(PageItem::PathText, PageItem::Unspecified, x, y, w, h, pw, "None", Pcolor, true);
currItem = doc->Items.at(z);
currItem = doc->Items->at(z);
if ((QStoInt(obj->attribute("ANNOTATION","0"))) && (static_cast<bool>(QStoInt(obj->attribute("ANICON","0")))))
{
currItem->LocalScX = scx;
1910,7 → 1912,7
break;
case PageItem::TextFrame:
z = doc->itemAdd(PageItem::TextFrame, PageItem::Unspecified, x, y, w, h, pw, "None", Pcolor, true);
currItem = doc->Items.at(z);
currItem = doc->Items->at(z);
if ((QStoInt(obj->attribute("ANNOTATION","0"))) && (static_cast<bool>(QStoInt(obj->attribute("ANICON","0")))))
{
currItem->LocalScX = scx;
1939,15 → 1941,15
break;
case PageItem::Line:
z = doc->itemAdd(PageItem::Line, PageItem::Unspecified, x, y, w, h, pw, "None", Pcolor2, true);
currItem = doc->Items.at(z);
currItem = doc->Items->at(z);
break;
case PageItem::Polygon:
z = doc->itemAdd(PageItem::Polygon, PageItem::Unspecified, x, y, w, h, pw, Pcolor, Pcolor2, true);
currItem = doc->Items.at(z);
currItem = doc->Items->at(z);
break;
case PageItem::PolyLine:
z = doc->itemAdd(PageItem::PolyLine, PageItem::Unspecified, x, y, w, h, pw, Pcolor, Pcolor2, true);
currItem = doc->Items.at(z);
currItem = doc->Items->at(z);
break;
}
currItem->FrameType = QStoInt(obj->attribute("FRTYPE", "0"));
/branches/Version13x/Scribus/scribus/mpalette.cpp
3359,9 → 3359,9
return;
}
bool found = false;
for (uint b = 0; b < doc->Items.count(); ++b)
for (uint b = 0; b < doc->Items->count(); ++b)
{
if ((NameNew == doc->Items.at(b)->itemName()) && (doc->Items.at(b) != CurItem))
if ((NameNew == doc->Items->at(b)->itemName()) && (doc->Items->at(b) != CurItem))
{
found = true;
break;
/branches/Version13x/Scribus/scribus/util.cpp
918,9 → 918,9
if (currItem->itemType() == PageItem::PathText)
currItem->DrawObj(painter, rd);
}
for (uint azz=0; azz<currentDoc->Items.count(); ++azz)
for (uint azz=0; azz<currentDoc->Items->count(); ++azz)
{
PageItem *currItem = currentDoc->Items.at(azz);
PageItem *currItem = currentDoc->Items->at(azz);
if ((currItem->itemType() == PageItem::TextFrame) || (currItem->itemType() == PageItem::PathText))
currItem->DrawObj(painter, rd);
}
/branches/Version13x/Scribus/scribus/page.cpp
279,12 → 279,14
}
else
{
ScApp->doc->Items.append(ite);
ScApp->doc->Items->append(ite);
/*
if (ScApp->doc->masterPageMode())
ScApp->doc->MasterItems = ScApp->doc->Items;
else
ScApp->doc->DocItems = ScApp->doc->Items;
ite->ItemNr = ScApp->doc->Items.count()-1;
*/
ite->ItemNr = ScApp->doc->Items->count()-1;
}
}
 
295,12 → 297,14
PageItem *ite = state->getItem();
if (isUndo)
{
ScApp->doc->Items.append(ite);
ScApp->doc->Items->append(ite);
/*
if (ScApp->doc->masterPageMode())
ScApp->doc->MasterItems = ScApp->doc->Items;
else
ScApp->doc->DocItems = ScApp->doc->Items;
ite->ItemNr = ScApp->doc->Items.count()-1;
*/
ite->ItemNr = ScApp->doc->Items->count()-1;
}
else
{
320,22 → 324,24
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;
ScApp->doc->Items->take(newItem->ItemNr);
ScApp->doc->Items->append(oldItem);
oldItem->ItemNr = ScApp->doc->Items->count()-1;
oldItem->UpdatePolyClip();
ScApp->view->AdjustItemSize(oldItem);
}
else
{
ScApp->doc->Items.take(oldItem->ItemNr);
ScApp->doc->Items.append(newItem);
newItem->ItemNr = ScApp->doc->Items.count()-1;
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()
/branches/Version13x/Scribus/scribus/annot.cpp
1101,9 → 1101,9
return;
}
bool found = false;
for (uint b = 0; b < view->Doc->Items.count(); ++b)
for (uint b = 0; b < view->Doc->Items->count(); ++b)
{
if ((NameNew == view->Doc->Items.at(b)->itemName()) && (view->Doc->Items.at(b) != item))
if ((NameNew == view->Doc->Items->at(b)->itemName()) && (view->Doc->Items->at(b) != item))
{
found = true;
break;
/branches/Version13x/Scribus/scribus/reformdoc.cpp
1089,10 → 1089,10
currDoc->docItemAttributes = *(tabDocItemAttributes->getNewAttributes());
currDoc->docToCSetups = *(tabTOCIndexPrefs->getNewToCs());
 
uint itemCount=currDoc->Items.count();
uint itemCount=currDoc->Items->count();
for (uint b=0; b<itemCount; ++b)
{
if (currDoc->Items.at(b)->itemType() == PageItem::ImageFrame)
currDoc->Items.at(b)->PicArt = currDoc->guidesSettings.showPic;
if (currDoc->Items->at(b)->itemType() == PageItem::ImageFrame)
currDoc->Items->at(b)->PicArt = currDoc->guidesSettings.showPic;
}
}
/branches/Version13x/Scribus/scribus/pdflib.cpp
560,9 → 560,9
}
}
}
for (uint d = 0; d < doc->Items.count(); ++d)
for (uint d = 0; d < doc->Items->count(); ++d)
{
pgit = doc->Items.at(d);
pgit = doc->Items->at(d);
if ((pgit->itemType() == PageItem::TextFrame) || (pgit->itemType() == PageItem::PathText))
{
for (uint e = 0; e < pgit->itemText.count(); ++e)
1905,7 → 1905,7
if (!pag->PageNam.isEmpty())
PItems = doc->MasterItems;
else
PItems = doc->Items;
PItems = doc->DocItems;
if (ll.isPrintable)
{
if ((Options->Version == 15) && (Options->useLayers))
4833,9 → 4833,9
Threads.clear();
if (Options->Articles)
{
for (uint ele = 0; ele < doc->Items.count(); ++ele)
for (uint ele = 0; ele < doc->Items->count(); ++ele)
{
PageItem* tel = doc->Items.at(ele);
PageItem* tel = doc->Items->at(ele);
if ((tel->asTextFrame()) && (tel->BackBox == 0) && (tel->NextBox != 0) &&
(!tel->Redrawn))
{
4897,8 → 4897,8
}
}
}
for (uint ele = 0; ele < doc->Items.count(); ++ele)
doc->Items.at(ele)->Redrawn = false;
for (uint ele = 0; ele < doc->Items->count(); ++ele)
doc->Items->at(ele)->Redrawn = false;
}
XRef[7] = Dokument;
PutDoc("8 0 obj\n[");
/branches/Version13x/Scribus/scribus/scribusdoc.cpp
321,7 → 321,7
MasterPages.clear();
DocPages.clear();
//Pages=&DocPages;
Items.clear();
//Items.clear();
MasterItems.clear();
DocItems.clear();
FrameItems.clear();
2004,10 → 2004,10
for (it = PageColors.begin(); it != itend; ++it)
PageColors[it.key()].RecalcRGB();
//Adjust Items of the 3 types to the colors
uint itemsCount=Items.count();
uint itemsCount=Items->count();
for (uint c=0; c<itemsCount; ++c)
{
PageItem *ite = Items.at(c);
PageItem *ite = Items->at(c);
if (ite->fillColor() != "None")
ite->fillQColor = PageColors[ite->fillColor()].getShadeColorProof(ite->fillShade());
if (ite->lineColor() != "None")
2095,14 → 2095,14
/*
DocPages = Pages;
Pages = MasterPages;
*/
DocItems = Items;
Items = MasterItems;
*/
//masterPageMode = true;
MasterNames.insert(masterPageName, nr);
//MasterNames.insert(masterPageName, nr);
pageCount = 0;
bool atf = automaticTextFrames;
automaticTextFrames = false;
//bool atf = automaticTextFrames;
//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);
2139,6 → 2139,8
}
struct CopyPasteBuffer BufferT;
uint end = DocItems.count();
//CB Need to set this so the paste works correctly. Should not need it really, but its a quick op.
setMasterPageMode(true);
for (uint a = 0; a < end; ++a)
{
PageItem *itemToCopy = DocItems.at(a);
2161,8 → 2163,9
}
}
ScApp->view->PasteItem(&BufferT, true, true);
PageItem* Neu = Items.at(Items.count()-1);
PageItem* Neu = Items->at(Items->count()-1);
Neu->OnMasterPage = masterPageName;
Neu->OwnPage=MasterNames[masterPageName];
if (Neu->isTableItem)
{
TableItems.append(Neu);
2177,19 → 2180,19
{
PageItem* ta = TableItems.at(ttc);
if (ta->TopLinkID != -1)
ta->TopLink = Items.at(TableID[ta->TopLinkID]);
ta->TopLink = Items->at(TableID[ta->TopLinkID]);
else
ta->TopLink = 0;
if (ta->LeftLinkID != -1)
ta->LeftLink = Items.at(TableID[ta->LeftLinkID]);
ta->LeftLink = Items->at(TableID[ta->LeftLinkID]);
else
ta->LeftLink = 0;
if (ta->RightLinkID != -1)
ta->RightLink = Items.at(TableID[ta->RightLinkID]);
ta->RightLink = Items->at(TableID[ta->RightLinkID]);
else
ta->RightLink = 0;
if (ta->BottomLinkID != -1)
ta->BottomLink = Items.at(TableID[ta->BottomLinkID]);
ta->BottomLink = Items->at(TableID[ta->BottomLinkID]);
else
ta->BottomLink = 0;
}
2197,15 → 2200,16
//MasterPages = Pages;
//pageCount = DocPages.count();
//Pages = DocPages;
MasterItems = Items;
Items = DocItems;
//MasterItems = Items;
//Items = DocItems;
//masterPageMode = false;
//targetPage->setPageName(masterPageName);
targetPage->MPageNam = "";
automaticTextFrames = atf;
//automaticTextFrames = atf;
setLoading(false);
GroupCounter = GrMax + 1;
//Reset the current page..
setMasterPageMode(false);
currentPage=sourcePage;
return true;
}
2261,12 → 2265,14
Q_CHECK_PTR(newItem);
if (newItem==NULL)
return -1;
Items.append(newItem);
newItem->ItemNr = Items.count()-1;
Items->append(newItem);
newItem->ItemNr = Items->count()-1;
/*
if (masterPageMode())
MasterItems = Items;
else
DocItems = Items;
*/
//Add in item default values based on itemType and frameType
itemAddDetails(itemType, frameType, newItem->ItemNr);
if (UndoManager::undoEnabled())
2293,7 → 2299,7
 
void ScribusDoc::itemAddDetails(const PageItem::ItemType itemType, const PageItem::ItemFrameType frameType, const int itemNumber)
{
PageItem* newItem=Items.at(itemNumber);
PageItem* newItem=Items->at(itemNumber);
Q_ASSERT(newItem->itemType()==itemType);
switch( itemType )
{
2407,7 → 2413,7
 
const bool ScribusDoc::LoadPict(QString fn, int ItNr, bool reload)
{
return loadPict(fn, Items.at(ItNr), reload);
return loadPict(fn, Items->at(ItNr), reload);
}
 
const bool ScribusDoc::loadPict(QString fn, PageItem *pageItem, bool reload)
2442,10 → 2448,10
double miny = 99999.9;
double maxx = -99999.9;
double maxy = -99999.9;
uint docItemsCount=Items.count();
uint docItemsCount=Items->count();
for (uint ic = 0; ic < docItemsCount; ++ic)
{
currItem = Items.at(ic);
currItem = Items->at(ic);
if (currItem->Rot != 0)
{
FPointArray pb;
2561,10 → 2567,10
if (currItem->Groups.count() == 0)
return;
int ObjGroup = currItem->Groups.top();
uint docItemCount=Items.count();
uint docItemCount=Items->count();
for (uint a = 0; a < docItemCount; ++a)
{
item = Items.at(a);
item = Items->at(a);
if (item->Groups.top() == ObjGroup)
Objects.append(item);
}
2676,10 → 2682,10
}
if (!isLoading())
{
uint docItemsCount=Items.count();
uint docItemsCount=Items->count();
for (uint ite = 0; ite < docItemsCount; ++ite)
{
PageItem *item = Items.at(ite);
PageItem *item = Items->at(ite);
if (item->OwnPage < 0)
{
if (item->Groups.count() != 0)
2735,7 → 2741,7
if (currItem->itemType()==PageItem::Line || newType==PageItem::Line)
return false;
//Take the item to convert from the docs Items list
PageItem *oldItem = Items.take(currItem->ItemNr);
PageItem *oldItem = Items->take(currItem->ItemNr);
//Create a new item from the old one
bool transactionConversion=false;
PageItem *newItem;
2799,7 → 2805,7
if (oldItem->itemType()==PageItem::PathText)
{
uint newPolyItemNo = itemAdd(PageItem::PolyLine, PageItem::Unspecified, currItem->Xpos, currItem->Ypos, currItem->Width, currItem->Height, currItem->Pwidth, "None", currItem->lineColor(), true);
PageItem *polyLineItem = Items.at(newPolyItemNo);
PageItem *polyLineItem = Items->at(newPolyItemNo);
polyLineItem->PoLine = currItem->PoLine.copy();
polyLineItem->ClipEdited = true;
polyLineItem->FrameType = 3;
2865,8 → 2871,8
break;
}
//Insert the new item into the docs items list
Items.append(newItem);
newItem->ItemNr = Items.count()-1;
Items->append(newItem);
newItem->ItemNr = Items->count()-1;
//If converting text to path, delete the bezier
if (newType==PageItem::PathText)
{
2876,6 → 2882,7
ScApp->view->updateContents();
ScApp->view->Deselect(true);
}
/*
//<<At some point we HAVE to stop this!
if (masterPageMode())
MasterItems = Items;
2882,6 → 2889,7
else
DocItems = Items;
//>>
*/
//Create the undo action for the new item
if (UndoManager::undoEnabled())
{
2911,10 → 2919,10
bool ScribusDoc::itemNameExists(const QString checkItemName)
{
bool found = false;
uint docItemCount=Items.count();
uint docItemCount=Items->count();
for (uint i = 0; i < docItemCount; ++i)
{
if (checkItemName == Items.at(i)->itemName())
if (checkItemName == Items->at(i)->itemName())
{
found = true;
break;
2929,13 → 2937,13
return;
if (changeToMasterPageMode)
{
//Need to add in item pointer switching later too
Pages=&MasterPages;
Items=&MasterItems;
}
else
{
//Need to add in item pointer switching later too
Pages=&DocPages;
Items=&DocItems;
}
m_masterPageMode=changeToMasterPageMode;
}
/branches/Version13x/Scribus/scribus/scribusXml.cpp
1022,7 → 1022,7
else
doc->Pages->at(a)->XGuides.clear();
QDomNode OBJ=PAGE.firstChild();
counter = doc->Items.count();
counter = doc->Items->count();
baseobj = counter;
while(!OBJ.isNull())
{
1094,7 → 1094,7
}
OB.itemText = "";
view->PasteItem(&OB, true);
Neu = doc->Items.at(counter);
Neu = doc->Items->at(counter);
IT=OBJ.firstChild();
while(!IT.isNull())
{
1124,19 → 1124,19
{
PageItem* ta = TableItems.at(ttc);
if (ta->TopLinkID != -1)
ta->TopLink = doc->Items.at(TableID[ta->TopLinkID]);
ta->TopLink = doc->Items->at(TableID[ta->TopLinkID]);
else
ta->TopLink = 0;
if (ta->LeftLinkID != -1)
ta->LeftLink = doc->Items.at(TableID[ta->LeftLinkID]);
ta->LeftLink = doc->Items->at(TableID[ta->LeftLinkID]);
else
ta->LeftLink = 0;
if (ta->RightLinkID != -1)
ta->RightLink = doc->Items.at(TableID[ta->RightLinkID]);
ta->RightLink = doc->Items->at(TableID[ta->RightLinkID]);
else
ta->RightLink = 0;
if (ta->BottomLinkID != -1)
ta->BottomLink = doc->Items.at(TableID[ta->BottomLinkID]);
ta->BottomLink = doc->Items->at(TableID[ta->BottomLinkID]);
else
ta->BottomLink = 0;
}
1149,7 → 1149,7
QValueList<Linked>::Iterator lc;
for (lc = LFrames.begin(); lc != LFrames.end(); ++lc)
{
Its = doc->Items.at((*lc).Start);
Its = doc->Items->at((*lc).Start);
Itr = Its;
Its->BackBox = 0;
while (Its->NextIt != -1)
1156,7 → 1156,7
{
if (Its->NextPg == a)
{
Itn = doc->Items.at(Its->NextIt);
Itn = doc->Items->at(Its->NextIt);
Its->NextBox = Itn;
Itn->BackBox = Its;
Its = Itn;
1477,7 → 1477,7
//doc->Pages = &doc->DocPages;
doc->setUsesAutomaticTextFrames(AtFl);
doc->setMasterPageMode(false);
doc->Items = doc->DocItems;
//doc->Items = doc->DocItems;
}
else
{
1485,7 → 1485,7
doc->setUsesAutomaticTextFrames(false);
//doc->Pages = &doc->MasterPages;
doc->setMasterPageMode(true);
doc->Items = doc->MasterItems;
//doc->Items = doc->MasterItems;
}
//CB: Remove this unnecessarily "slow" slot call when we have no gui for the doc yet!
//Items dont appear in the right place if we just doc->addPage(a); for <=1.2.x docs
1613,10 → 1613,10
OB.itemText = "";
int docGc = doc->GroupCounter;
doc->GroupCounter = 0;
uint last = doc->Items.count();
uint last = doc->Items->count();
view->PasteItem(&OB, true);
doc->GroupCounter = docGc;
Neu = doc->Items.at(last);
Neu = doc->Items->at(last);
Neu->OnMasterPage = PgNam;
IT=OBJ.firstChild();
while(!IT.isNull())
1645,19 → 1645,19
{
PageItem* ta = TableItems.at(ttc);
if (ta->TopLinkID != -1)
ta->TopLink = doc->Items.at(TableID[ta->TopLinkID]);
ta->TopLink = doc->Items->at(TableID[ta->TopLinkID]);
else
ta->TopLink = 0;
if (ta->LeftLinkID != -1)
ta->LeftLink = doc->Items.at(TableID[ta->LeftLinkID]);
ta->LeftLink = doc->Items->at(TableID[ta->LeftLinkID]);
else
ta->LeftLink = 0;
if (ta->RightLinkID != -1)
ta->RightLink = doc->Items.at(TableID[ta->RightLinkID]);
ta->RightLink = doc->Items->at(TableID[ta->RightLinkID]);
else
ta->RightLink = 0;
if (ta->BottomLinkID != -1)
ta->BottomLink = doc->Items.at(TableID[ta->BottomLinkID]);
ta->BottomLink = doc->Items->at(TableID[ta->BottomLinkID]);
else
ta->BottomLink = 0;
}
1665,7 → 1665,7
if (PgNam.isEmpty())
{
//doc->DocPages = doc->Pages;
doc->DocItems = doc->Items;
//doc->DocItems = doc->Items;
}
else
{
1672,7 → 1672,7
doc->Pages->at(a)->setPageName(PgNam);
doc->MasterNames[PgNam] = a;
//doc->MasterPages = doc->Pages;
doc->MasterItems = doc->Items;
//doc->MasterItems = doc->Items;
}
doc->setMasterPageMode(false);
//doc->Pages=&doc->DocPages;
1777,7 → 1777,7
}
//doc->Pages = &doc->DocPages;
doc->pageCount = doc->Pages->count();
doc->Items = doc->DocItems;
//doc->Items = doc->DocItems;
doc->setMasterPageMode(false);
view->reformPages();
if (doc->layerCount() == 0)
1797,7 → 1797,7
QValueList<Linked>::Iterator lc;
for (lc = LFrames.begin(); lc != LFrames.end(); ++lc)
{
Its = doc->Items.at((*lc).Start);
Its = doc->Items->at((*lc).Start);
Itr = Its;
Its->BackBox = 0;
if (Its->isAutoText)
1805,9 → 1805,9
while (Its->NextIt != -1)
{
int itnr = 0;
for (uint nn = 0; nn < doc->Items.count(); ++nn)
for (uint nn = 0; nn < doc->Items->count(); ++nn)
{
if (doc->Items.at(nn)->OwnPage == Its->NextPg)
if (doc->Items->at(nn)->OwnPage == Its->NextPg)
{
if (itnr == Its->NextIt)
{
1817,7 → 1817,7
itnr++;
}
}
Itn = doc->Items.at(itnr);
Itn = doc->Items->at(itnr);
Its->NextBox = Itn;
Itn->BackBox = Its;
Its = Itn;
2098,7 → 2098,7
OB.itemText = "";
OB.LayerNr = -1;
view->PasteItem(&OB, true, true);
PageItem* Neu = doc->Items.at(doc->Items.count()-1);
PageItem* Neu = doc->Items->at(doc->Items->count()-1);
IT=DOC.firstChild();
while(!IT.isNull())
{
2121,19 → 2121,19
{
PageItem* ta = TableItems.at(ttc);
if (ta->TopLinkID != -1)
ta->TopLink = doc->Items.at(TableID[ta->TopLinkID]);
ta->TopLink = doc->Items->at(TableID[ta->TopLinkID]);
else
ta->TopLink = 0;
if (ta->LeftLinkID != -1)
ta->LeftLink = doc->Items.at(TableID[ta->LeftLinkID]);
ta->LeftLink = doc->Items->at(TableID[ta->LeftLinkID]);
else
ta->LeftLink = 0;
if (ta->RightLinkID != -1)
ta->RightLink = doc->Items.at(TableID[ta->RightLinkID]);
ta->RightLink = doc->Items->at(TableID[ta->RightLinkID]);
else
ta->RightLink = 0;
if (ta->BottomLinkID != -1)
ta->BottomLink = doc->Items.at(TableID[ta->BottomLinkID]);
ta->BottomLink = doc->Items->at(TableID[ta->BottomLinkID]);
else
ta->BottomLink = 0;
}
2202,7 → 2202,7
{
for (uint co=0; co<Selitems->count(); ++co)
{
item = doc->Items.at(ELL[co]);
item = doc->Items->at(ELL[co]);
if (item->textAlignment > 4)
{
vg.Vname = doc->docParagraphStyles[item->textAlignment].Vname;
2360,7 → 2360,7
struct ArrowDesc arrow;
for (uint co=0; co<Selitems->count(); ++co)
{
item = doc->Items.at(ELL[co]);
item = doc->Items->at(ELL[co]);
if (item->startArrowIndex != 0)
{
arrow.points = (*doc->arrowStyles.at(item->startArrowIndex-1)).points.copy();
2400,7 → 2400,7
{
QString CurDirP = QDir::currentDirPath();
QDir::setCurrent(QDir::homeDirPath());
item = doc->Items.at(ELL[co]);
item = doc->Items->at(ELL[co]);
QDomElement ob=docu.createElement("ITEM");
if (item->textAlignment > 4)
ob.setAttribute("ALIGN",UsedMapped2Saved[item->textAlignment]);
/branches/Version13x/Scribus/scribus/picstatus.cpp
94,9 → 94,9
ItemNrs.append(i);
}
}
for (i=0; i<doc->Items.count(); ++i)
for (i=0; i<doc->Items->count(); ++i)
{
if (doc->Items.at(i)->itemType() == PageItem::ImageFrame)
if (doc->Items->at(i)->itemType() == PageItem::ImageFrame)
{
Zeilen++;
ItemNrs.append(i);
138,14 → 138,14
Zeilen2++;
}
}
for (i=0; i< doc->Items.count(); ++i)
for (i=0; i< doc->Items->count(); ++i)
{
if (doc->Items.at(i)->itemType() == PageItem::ImageFrame)
if (doc->Items->at(i)->itemType() == PageItem::ImageFrame)
{
QFileInfo fi = QFileInfo(doc->Items.at(i)->Pfile);
QFileInfo fi = QFileInfo(doc->Items->at(i)->Pfile);
PicTable->setText(Zeilen2, COL_FILENAME, fi.fileName());
PicTable->setText(Zeilen2, COL_PATH, fi.dirPath());
p = doc->Items.at(i)->OwnPage;
p = doc->Items->at(i)->OwnPage;
PicTable->setText(Zeilen2, COL_PAGE, tmp.setNum(p+1));
QToolButton *tb2 = new QToolButton(this, tmp.setNum(Zeilen2));
tb2->setText( trGoto);
155,12 → 155,12
connect(tb2, SIGNAL(clicked()), this, SLOT(GotoPic()));
QCheckBox *cp2 = new QCheckBox(this, tmp.setNum(Zeilen2));
cp2->setText( tr("Yes"));
cp2->setChecked(doc->Items.at(i)->printable());
cp2->setChecked(doc->Items->at(i)->printable());
cp2->setEraseColor(white);
FlagsPic.append(cp2);
PicTable->setCellWidget(Zeilen2, COL_PRINT, cp2);
connect(cp2, SIGNAL(clicked()), this, SLOT(PrintPic()));
if (doc->Items.at(i)->PicAvail)
if (doc->Items->at(i)->PicAvail)
PicTable->setText(Zeilen2, COL_STATUS, trOK);
else
PicTable->setText(Zeilen2, COL_STATUS, trMissing);
315,7 → 315,7
doc->LoadPict(newFilePath, itemNumber);
// WTF?
bool isMaster = PicTable->cellWidget(row, COL_GOTO)->isEnabled();
PageItem* item = isMaster ? doc->Items.at(itemNumber) : doc->MasterItems.at(itemNumber);
PageItem* item = isMaster ? doc->DocItems.at(itemNumber) : doc->MasterItems.at(itemNumber);
// Set missing flag again. Since we do no error checking of the load,
// missing will generally mean "failed to load".
PicTable->setText(row, COL_STATUS, item->PicAvail ? trOK : trMissing);
374,7 → 374,7
uint ItNr = ItemNrs[ZNr];
// uint PgNr = PicTable->text(ZNr, 2).toInt()-1;
if (PicTable->cellWidget(ZNr, 3)->isEnabled())
doc->Items.at(ItNr)->setPrintable(FlagsPic.at(ZNr)->isChecked());
doc->DocItems.at(ItNr)->setPrintable(FlagsPic.at(ZNr)->isChecked());
else
doc->MasterItems.at(ItNr)->setPrintable(FlagsPic.at(ZNr)->isChecked());
}
/branches/Version13x/Scribus/scribus/scribusdoc.h
436,7 → 436,7
/** Mapping Master Page Name to Master Page numbers */
QMap<QString,int> MasterNames;
/** List of Objects */
QPtrList<PageItem> Items;
QPtrList<PageItem>* Items;
QPtrList<PageItem> MasterItems;
QPtrList<PageItem> DocItems;
QPtrList<PageItem> FrameItems;
/branches/Version13x/Scribus/scribus/scribusview.cpp
635,7 → 635,7
{
linkedFramesToShow.clear();
double z = painter->zoomFactor();
if (Doc->Items.count() != 0)
if (Doc->Items->count() != 0)
{
QPainter p;
int Lnr=0;
653,7 → 653,7
pr = false;
if ((ll.isViewable) && (pr))
{
QPtrListIterator<PageItem> docItem(Doc->Items);
QPtrListIterator<PageItem> docItem(*Doc->Items);
while ( (currItem = docItem.current()) != 0)
{
++docItem;
722,7 → 722,7
}
}
}
QPtrListIterator<PageItem> docItem2(Doc->Items);
QPtrListIterator<PageItem> docItem2(*Doc->Items);
while ( (currItem = docItem2.current()) != 0 )
{
++docItem2;
1101,11 → 1101,11
}
else
{ */
for (uint as = 0; as < Doc->Items.count(); ++as)
for (uint as = 0; as < Doc->Items->count(); ++as)
{
Doc->Items.at(as)->Select = false;
Doc->Items->at(as)->Select = false;
}
uint ac = Doc->Items.count();
uint ac = Doc->Items->count();
if ((!img) && (Doc->DraggedElem == 0))
{
if ((fi.exists()) && (!img))
1113,9 → 1113,9
else
emit LoadElem(QString(text), ex, ey, false, false, Doc, this);
SelItem.clear();
for (uint as = ac; as < Doc->Items.count(); ++as)
for (uint as = ac; as < Doc->Items->count(); ++as)
{
currItem = Doc->Items.at(as);
currItem = Doc->Items->at(as);
currItem->Select = true;
SelItem.append(currItem);
if (currItem->isBookmark)
1148,14 → 1148,14
{
QPtrList<PageItem> pasted;
emit LoadElem(QString(text), ex, ey, false, false, Doc, this);
for (uint as = ac; as < Doc->Items.count(); ++as)
for (uint as = ac; as < Doc->Items->count(); ++as)
{
pasted.append(Doc->Items.at(as));
pasted.append(Doc->Items->at(as));
}
SelItem.clear();
for (uint dre=0; dre<Doc->DragElements.count(); ++dre)
{
SelItem.append(Doc->Items.at(Doc->DragElements[dre]));
SelItem.append(Doc->Items->at(Doc->DragElements[dre]));
}
PageItem* bb;
int fin;
1198,9 → 1198,9
Doc->DraggedElem = 0;
Doc->DragElements.clear();
SelItem.clear();
for (uint as = ac; as < Doc->Items.count(); ++as)
for (uint as = ac; as < Doc->Items->count(); ++as)
{
currItem = Doc->Items.at(as);
currItem = Doc->Items->at(as);
currItem->Select = true;
SelItem.append(currItem);
if (currItem->isBookmark)
1429,7 → 1429,7
{
//z = PaintText(Tx + offX, Ty + offY, deltaX, deltaY, Doc->toolSettings.dWidth, Doc->toolSettings.dPenText);
z = Doc->itemAdd(PageItem::TextFrame, PageItem::Unspecified, Tx + offX, Ty + offY, deltaX, deltaY, Doc->toolSettings.dWidth, "None", Doc->toolSettings.dPenText, !Mpressed);
currItem = Doc->Items.at(z);
currItem = Doc->Items->at(z);
currItem->isTableItem = true;
currItem->setTextFlowsAroundFrame(true);
currItem->setTextFlowUsesBoundingBox(true);
1479,7 → 1479,7
{
//uint z = PaintPolyLine(0, 0, 1, 1, Doc->toolSettings.dWidth, "None", Doc->toolSettings.dPenLine);
uint z = Doc->itemAdd(PageItem::PolyLine, PageItem::Unspecified, 0, 0, 1, 1, Doc->toolSettings.dWidth, "None", Doc->toolSettings.dPenLine, !Mpressed);
currItem = Doc->Items.at(z);
currItem = Doc->Items->at(z);
currItem->PoLine.resize(0);
currItem->PoLine.addPoint(RecordP.point(0));
currItem->PoLine.addPoint(RecordP.point(0));
2704,12 → 2704,12
Myp=static_cast<int>(tmp);
}
QRect Sele = QRect(static_cast<int>(Mxp*sc), static_cast<int>(Myp*sc), static_cast<int>((SeRx-Mxp)*sc), static_cast<int>((SeRy-Myp)*sc));
uint docItemCount=Doc->Items.count();
uint docItemCount=Doc->Items->count();
if (docItemCount != 0)
{
for (uint a = 0; a < docItemCount; ++a)
{
PageItem* docItem = Doc->Items.at(a);
PageItem* docItem = Doc->Items->at(a);
p.begin(viewport());
Transform(docItem, &p);
QRegion apr = QRegion(p.xForm(docItem->Clip));
2874,7 → 2874,7
if (currItem->PoLine.size() < 4)
{
// emit DelObj(Doc->currentPage->pageNr(), currItem->ItemNr);
Doc->Items.remove(currItem->ItemNr);
Doc->Items->remove(currItem->ItemNr);
SelItem.removeFirst();
emit HaveSel(-1);
}
4025,7 → 4025,7
cli.putPoints(0, EndInd-StartInd, Clip, StartInd);
//z = PaintPoly(currItem->Xpos, currItem->Ypos, currItem->Width, currItem->Height, currItem->Pwidth, currItem->fillColor(), currItem->lineColor());
z = Doc->itemAdd(PageItem::Polygon, PageItem::Unspecified, currItem->Xpos, currItem->Ypos, currItem->Width, currItem->Height, currItem->Pwidth, currItem->fillColor(), currItem->lineColor(), !Mpressed);
bb = Doc->Items.at(z);
bb = Doc->Items->at(z);
if (EditContour)
bb->ContourLine.resize(0);
else
4053,13 → 4053,13
bb->Rot = currItem->Rot;
AdjustItemSize(bb);
bb->ClipEdited = true;
PageItem *bx = Doc-> Items.take(bb->ItemNr);
Doc->Items.insert(bb->ItemNr-1, bx);
for (uint al = 0; al < Doc->Items.count(); ++al)
PageItem *bx = Doc->Items->take(bb->ItemNr);
Doc->Items->insert(bb->ItemNr-1, bx);
for (uint al = 0; al < Doc->Items->count(); ++al)
{
Doc->Items.at(al)->ItemNr = al;
if (Doc->Items.at(al)->isBookmark)
emit NewBMNr(Doc->Items.at(al)->BMnr, al);
Doc->Items->at(al)->ItemNr = al;
if (Doc->Items->at(al)->isBookmark)
emit NewBMNr(Doc->Items->at(al)->BMnr, al);
}
}
currItem->PoLine = cli.copy();
4080,7 → 4080,7
{
//z = PaintPolyLine(currItem->Xpos, currItem->Ypos, currItem->Width, currItem->Height, currItem->Pwidth, currItem->fillColor(), currItem->lineColor());
z = Doc->itemAdd(PageItem::PolyLine, PageItem::Unspecified, currItem->Xpos, currItem->Ypos, currItem->Width, currItem->Height, currItem->Pwidth, currItem->fillColor(), currItem->lineColor(), !Mpressed);
bb = Doc->Items.at(z);
bb = Doc->Items->at(z);
if (EditContour)
bb->ContourLine.putPoints(0, Clip.size()-(ClRe+2), Clip, ClRe+2);
else
4339,9 → 4339,9
break;
default:
z = Doc->itemAdd(PageItem::Polygon, PageItem::Unspecified, Rxp, Ryp, 1+Rxpd, 1+Rypd, Doc->toolSettings.dWidth, Doc->toolSettings.dBrush, Doc->toolSettings.dPen, !Mpressed);
Doc->Items.at(z)->SetFrameShape(Doc->ValCount, Doc->ShapeValues);
setRedrawBounding(Doc->Items.at(z));
Doc->Items.at(z)->FrameType = Doc->SubMode+2;
Doc->Items->at(z)->SetFrameShape(Doc->ValCount, Doc->ShapeValues);
setRedrawBounding(Doc->Items->at(z));
Doc->Items->at(z)->FrameType = Doc->SubMode+2;
SetupDraw(z);
break;
}
4441,16 → 4441,18
ss=NULL;
if (Doc->docHyphenator->AutoCheck)
Doc->docHyphenator->slotHyphenate(currItem);
for (uint a = 0; a < Doc->Items.count(); ++a)
for (uint a = 0; a < Doc->Items->count(); ++a)
{
Doc->Items.at(a)->ItemNr = a;
if (Doc->Items.at(a)->isBookmark)
emit NewBMNr(Doc->Items.at(a)->BMnr, a);
Doc->Items->at(a)->ItemNr = a;
if (Doc->Items->at(a)->isBookmark)
emit NewBMNr(Doc->Items->at(a)->BMnr, a);
}
/*
if (Doc->masterPageMode())
Doc->MasterItems = Doc->Items;
else
Doc->DocItems = Doc->Items;
*/
ScApp->outlinePalette->BuildTree();
}
else
4466,7 → 4468,7
selectPage(m);
//z = PaintLine(Rxp, Ryp, 1+Rxpd, Rypd, Doc->toolSettings.dWidthLine, Doc->toolSettings.dPenLine);
z = Doc->itemAdd(PageItem::Line, PageItem::Unspecified, Rxp, Ryp, 1+Rxpd, Rypd, Doc->toolSettings.dWidthLine, "None", Doc->toolSettings.dPenLine, !Mpressed);
currItem = Doc->Items.at(z);
currItem = Doc->Items->at(z);
currItem->Select = true;
qApp->setOverrideCursor(QCursor(SizeFDiagCursor), true);
SelItem.clear();
4550,13 → 4552,13
bb->BackBox = currItem;
if (bb->ItemNr < currItem->ItemNr)
{
Doc->Items.insert(currItem->ItemNr+1, bb);
bb = Doc->Items.take(bb->ItemNr);
for (uint a = 0; a < Doc->Items.count(); ++a)
Doc->Items->insert(currItem->ItemNr+1, bb);
bb = Doc->Items->take(bb->ItemNr);
for (uint a = 0; a < Doc->Items->count(); ++a)
{
Doc->Items.at(a)->ItemNr = a;
if (Doc->Items.at(a)->isBookmark)
emit NewBMNr(Doc->Items.at(a)->BMnr, a);
Doc->Items->at(a)->ItemNr = a;
if (Doc->Items->at(a)->isBookmark)
emit NewBMNr(Doc->Items->at(a)->BMnr, a);
}
}
updateContents();
4569,10 → 4571,12
}
else
Doc->ElemToLink = NULL;
/*
if (Doc->masterPageMode())
Doc->MasterItems = Doc->Items;
else
Doc->DocItems = Doc->Items;
*/
break;
case modeUnlinkFrames:
SeleItem(m);
4600,10 → 4604,12
emit DocChanged();
updateContents();
}
/*
if (Doc->masterPageMode())
Doc->MasterItems = Doc->Items;
else
Doc->DocItems = Doc->Items;
*/
break;
case modeDrawRegularPolygon:
{
4610,7 → 4616,7
selectPage(m);
//z = PaintPoly(Rxp, Ryp, 1+Rxpd, 1+Rypd, Doc->toolSettings.dWidth, Doc->toolSettings.dBrush, Doc->toolSettings.dPen);
z = Doc->itemAdd(PageItem::Polygon, PageItem::Unspecified, Rxp, Ryp, 1+Rxpd, 1+Rypd, Doc->toolSettings.dWidth, Doc->toolSettings.dBrush, Doc->toolSettings.dPen, !Mpressed);
currItem = Doc->Items.at(z);
currItem = Doc->Items->at(z);
FPointArray cli = RegularPolygonF(currItem->Width, currItem->Height, Doc->toolSettings.polyC, Doc->toolSettings.polyS, Doc->toolSettings.polyF, Doc->toolSettings.polyR);
FPoint np = FPoint(cli.point(0));
currItem->PoLine.resize(2);
4647,7 → 4653,7
selectPage(m);
//z = PaintPolyLine(Rxp, Ryp, 1+Rxpd, 1+Rypd, Doc->toolSettings.dWidth, "None", Doc->toolSettings.dPenLine);
z = Doc->itemAdd(PageItem::PolyLine, PageItem::Unspecified, Rxp, Ryp, 1+Rxpd, 1+Rypd, Doc->toolSettings.dWidth, "None", Doc->toolSettings.dPenLine, !Mpressed);
currItem = Doc->Items.at(z);
currItem = Doc->Items->at(z);
SelItem.clear();
SelItem.append(currItem);
currItem->Select = true;
4693,7 → 4699,7
selectPage(m);
//z = PaintText(Rxp, Ryp, 1+Rxpd, 1+Rypd, Doc->toolSettings.dWidth, Doc->toolSettings.dPenText);
z = Doc->itemAdd(PageItem::TextFrame, PageItem::Unspecified, Rxp, Ryp, 1+Rxpd, 1+Rypd, Doc->toolSettings.dWidth, "None", Doc->toolSettings.dPenText, !Mpressed);
currItem = Doc->Items.at(z);
currItem = Doc->Items->at(z);
currItem->isAnnotation = true;
switch (Doc->appMode)
{
5936,7 → 5942,7
 
bool ScribusView::SizeItem(double newX, double newY, int ite, bool fromMP, bool DoUpdateClip, bool redraw)
{
return SizeItem(newX, newY, Doc->Items.at(ite), fromMP, DoUpdateClip, redraw);
return SizeItem(newX, newY, Doc->Items->at(ite), fromMP, DoUpdateClip, redraw);
}
 
bool ScribusView::SizeItem(double newX, double newY, PageItem *pi, bool fromMP, bool DoUpdateClip, bool redraw)
6076,7 → 6082,7
 
bool ScribusView::MoveSizeItem(FPoint newX, FPoint newY, int ite, bool fromMP)
{
PageItem *currItem = Doc->Items.at(ite);
PageItem *currItem = Doc->Items->at(ite);
QRect oldR(currItem->getRedrawBounding(Scale));
if (currItem->asLine())
{
6398,7 → 6404,7
 
void ScribusView::RotateItem(double win, int ite)
{
RotateItem(win, Doc->Items.at(ite));
RotateItem(win, Doc->Items->at(ite));
}
 
void ScribusView::RotateItem(double win, PageItem *currItem)
7102,7 → 7108,7
 
void ScribusView::SelectItemNr(int nr, bool draw, bool single)
{
SelectItem(Doc->Items.at(nr), draw, single);
SelectItem(Doc->Items->at(nr), draw, single);
}
 
void ScribusView::SelectItem(PageItem *currItem, bool draw, bool single)
7128,20 → 7134,20
}
else
SelItem.append(currItem);
for (uint ga=0; ga<Doc->Items.count(); ++ga)
for (uint ga=0; ga<Doc->Items->count(); ++ga)
{
if (Doc->Items.at(ga)->Groups.count() != 0)
if (Doc->Items->at(ga)->Groups.count() != 0)
{
if (Doc->Items.at(ga)->Groups.top() == currItem->Groups.top())
if (Doc->Items->at(ga)->Groups.top() == currItem->Groups.top())
{
if (Doc->Items.at(ga)->ItemNr != currItem->ItemNr)
if (Doc->Items->at(ga)->ItemNr != currItem->ItemNr)
{
if (SelItem.find(Doc->Items.at(ga)) == -1)
SelItem.append(Doc->Items.at(ga));
if (SelItem.find(Doc->Items->at(ga)) == -1)
SelItem.append(Doc->Items->at(ga));
}
Doc->Items.at(ga)->Select = true;
Doc->Items.at(ga)->FrameOnly = true;
Doc->Items.at(ga)->paintObj();
Doc->Items->at(ga)->Select = true;
Doc->Items->at(ga)->FrameOnly = true;
Doc->Items->at(ga)->paintObj();
}
}
}
7250,7 → 7256,7
if ((SelItem.count() != 0) && (m->state() == ControlButton))
currItem = SelItem.at(0);
else
currItem = Doc->Items.last();
currItem = Doc->Items->last();
if (!Doc->masterPageMode())
{
for (a = 0; a < Doc->Pages->count(); ++a)
7310,20 → 7316,20
SelItem.append(currItem);
if (m->state() != (ControlButton | AltButton))
{
for (uint ga=0; ga<Doc->Items.count(); ++ga)
for (uint ga=0; ga<Doc->Items->count(); ++ga)
{
if (Doc->Items.at(ga)->Groups.count() != 0)
if (Doc->Items->at(ga)->Groups.count() != 0)
{
if (Doc->Items.at(ga)->Groups.top() == currItem->Groups.top())
if (Doc->Items->at(ga)->Groups.top() == currItem->Groups.top())
{
if (Doc->Items.at(ga)->ItemNr != currItem->ItemNr)
if (Doc->Items->at(ga)->ItemNr != currItem->ItemNr)
{
if (SelItem.find(Doc->Items.at(ga)) == -1)
SelItem.append(Doc->Items.at(ga));
if (SelItem.find(Doc->Items->at(ga)) == -1)
SelItem.append(Doc->Items->at(ga));
}
Doc->Items.at(ga)->isSingleSel = false;
Doc->Items.at(ga)->Select = true;
Doc->Items.at(ga)->FrameOnly = true;
Doc->Items->at(ga)->isSingleSel = false;
Doc->Items->at(ga)->Select = true;
Doc->Items->at(ga)->FrameOnly = true;
}
}
}
7399,22 → 7405,22
}
if ((m->state() == (ControlButton | ShiftButton)) && (SelItem.count() != 0))
{
for (a = 0; a < Doc->Items.count(); ++a)
for (a = 0; a < Doc->Items->count(); ++a)
{
if (currItem->Select)
{
if (currItem->ItemNr == 0)
{
currItem = Doc->Items.last();
currItem = Doc->Items->last();
break;
}
currItem = Doc->Items.prev();
currItem = Doc->Items->prev();
break;
}
currItem = Doc->Items.prev();
currItem = Doc->Items->prev();
}
}
for (a = 0; a < Doc->Items.count(); ++a)
for (a = 0; a < Doc->Items->count(); ++a)
{
if (currItem == NULL)
{
7424,7 → 7430,7
}
if ((Doc->masterPageMode()) && (!((currItem->OwnPage == -1) || (currItem->OwnPage == static_cast<int>(Doc->currentPage->pageNr())))))
{
currItem = Doc->Items.prev();
currItem = Doc->Items->prev();
continue;
}
if (currItem->LayerNr == Doc->activeLayer())
7449,20 → 7455,20
SelItem.append(currItem);
if (m->state() != (ControlButton | AltButton))
{
for (uint ga=0; ga<Doc->Items.count(); ++ga)
for (uint ga=0; ga<Doc->Items->count(); ++ga)
{
if (Doc->Items.at(ga)->Groups.count() != 0)
if (Doc->Items->at(ga)->Groups.count() != 0)
{
if (Doc->Items.at(ga)->Groups.top() == currItem->Groups.top())
if (Doc->Items->at(ga)->Groups.top() == currItem->Groups.top())
{
if (Doc->Items.at(ga)->ItemNr != currItem->ItemNr)
if (Doc->Items->at(ga)->ItemNr != currItem->ItemNr)
{
if (SelItem.find(Doc->Items.at(ga)) == -1)
SelItem.append(Doc->Items.at(ga));
if (SelItem.find(Doc->Items->at(ga)) == -1)
SelItem.append(Doc->Items->at(ga));
}
Doc->Items.at(ga)->isSingleSel = false;
Doc->Items.at(ga)->Select = true;
Doc->Items.at(ga)->FrameOnly = true;
Doc->Items->at(ga)->isSingleSel = false;
Doc->Items->at(ga)->Select = true;
Doc->Items->at(ga)->FrameOnly = true;
}
}
}
7535,7 → 7541,7
}
p.end();
}
currItem = Doc->Items.prev();
currItem = Doc->Items->prev();
}
if ((Doc->guidesSettings.guidesShown) && (Doc->appMode == modeNormal) && (!Doc->GuideLock) && (Doc->OnPage(MxpS, MypS) != -1))
{
7715,7 → 7721,7
 
void ScribusView::SetupDraw(int nr)
{
PageItem* currItem = Doc->Items.at(nr);
PageItem* currItem = Doc->Items->at(nr);
currItem->Select = true;
currItem->IFont = Doc->toolSettings.defFont;
currItem->ISize = Doc->toolSettings.defSize;
7874,7 → 7880,7
int d;
QMap<int, uint> ObjOrder;
PageItem *currItem;
if ((Doc->Items.count() > 1) && (SelItem.count() != 0))
if ((Doc->Items->count() > 1) && (SelItem.count() != 0))
{
for (uint c = 0; c < SelItem.count(); ++c)
{
7882,24 → 7888,26
if (currItem->isTableItem && currItem->isSingleSel)
return;
ObjOrder.insert(currItem->ItemNr, c);
d = Doc->Items.findRef(currItem);
Doc->Items.take(d);
d = Doc->Items->findRef(currItem);
Doc->Items->take(d);
}
QValueList<uint> Oindex = ObjOrder.values();
for (int c = static_cast<int>(Oindex.count()-1); c > -1; c--)
{
Doc->Items.prepend(SelItem.at(Oindex[c]));
Doc->Items->prepend(SelItem.at(Oindex[c]));
}
for (uint a = 0; a < Doc->Items.count(); ++a)
for (uint a = 0; a < Doc->Items->count(); ++a)
{
Doc->Items.at(a)->ItemNr = a;
if (Doc->Items.at(a)->isBookmark)
emit NewBMNr(Doc->Items.at(a)->BMnr, a);
Doc->Items->at(a)->ItemNr = a;
if (Doc->Items->at(a)->isBookmark)
emit NewBMNr(Doc->Items->at(a)->BMnr, a);
}
/*
if (Doc->masterPageMode())
Doc->MasterItems = Doc->Items;
else
Doc->DocItems = Doc->Items;
*/
ScApp->outlinePalette->BuildTree();
emit LevelChanged(0);
emit DocChanged();
7912,7 → 7920,7
int d;
QMap<int, uint> ObjOrder;
PageItem *currItem;
if ((Doc->Items.count() > 1) && (SelItem.count() != 0))
if ((Doc->Items->count() > 1) && (SelItem.count() != 0))
{
for (uint c = 0; c < SelItem.count(); ++c)
{
7920,24 → 7928,26
if (currItem->isTableItem && currItem->isSingleSel)
return;
ObjOrder.insert(currItem->ItemNr, c);
d = Doc->Items.findRef(currItem);
Doc->Items.take(d);
d = Doc->Items->findRef(currItem);
Doc->Items->take(d);
}
QValueList<uint> Oindex = ObjOrder.values();
for (int c = 0; c <static_cast<int>(Oindex.count()); ++c)
{
Doc->Items.append(SelItem.at(Oindex[c]));
Doc->Items->append(SelItem.at(Oindex[c]));
}
for (uint a = 0; a < Doc->Items.count(); ++a)
for (uint a = 0; a < Doc->Items->count(); ++a)
{
Doc->Items.at(a)->ItemNr = a;
if (Doc->Items.at(a)->isBookmark)
emit NewBMNr(Doc->Items.at(a)->BMnr, a);
Doc->Items->at(a)->ItemNr = a;
if (Doc->Items->at(a)->isBookmark)
emit NewBMNr(Doc->Items->at(a)->BMnr, a);
}
/*
if (Doc->masterPageMode())
Doc->MasterItems = Doc->Items;
else
Doc->DocItems = Doc->Items;
*/
ScApp->outlinePalette->BuildTree();
emit LevelChanged(SelItem.at(0)->ItemNr);
emit DocChanged();
7947,13 → 7957,13
 
void ScribusView::LowerItem()
{
uint low = Doc->Items.count();
uint low = Doc->Items->count();
uint high = 0;
int d;
QMap<int, uint> ObjOrder;
PageItem *currItem;
PageItem *b2;
if ((Doc->Items.count() > 1) && (SelItem.count() != 0))
if ((Doc->Items->count() > 1) && (SelItem.count() != 0))
{
for (uint c = 0; c < SelItem.count(); ++c)
{
7965,7 → 7975,7
}
if (low == 0)
return;
b2 = Doc->Items.at(high);
b2 = Doc->Items->at(high);
SelItem.clear();
SelectItemNr(low-1, false);
for (uint c = 0; c < SelItem.count(); ++c)
7973,28 → 7983,30
currItem = SelItem.at(c);
currItem->Select = false;
ObjOrder.insert(currItem->ItemNr, c);
d = Doc->Items.findRef(currItem);
Doc->Items.take(d);
d = Doc->Items->findRef(currItem);
Doc->Items->take(d);
}
d = Doc->Items.findRef(b2);
d = Doc->Items->findRef(b2);
QValueList<uint> Oindex = ObjOrder.values();
for (int c = static_cast<int>(Oindex.count()-1); c > -1; c--)
{
Doc->Items.insert(d+1, SelItem.at(Oindex[c]));
Doc->Items->insert(d+1, SelItem.at(Oindex[c]));
}
SelItem.clear();
for (uint a = 0; a < Doc->Items.count(); ++a)
for (uint a = 0; a < Doc->Items->count(); ++a)
{
Doc->Items.at(a)->ItemNr = a;
if (Doc->Items.at(a)->isBookmark)
emit NewBMNr(Doc->Items.at(a)->BMnr, a);
if (Doc->Items.at(a)->Select)
SelItem.append(Doc->Items.at(a));
Doc->Items->at(a)->ItemNr = a;
if (Doc->Items->at(a)->isBookmark)
emit NewBMNr(Doc->Items->at(a)->BMnr, a);
if (Doc->Items->at(a)->Select)
SelItem.append(Doc->Items->at(a));
}
/*
if (Doc->masterPageMode())
Doc->MasterItems = Doc->Items;
else
Doc->DocItems = Doc->Items;
*/
ScApp->outlinePalette->BuildTree();
emit LevelChanged(SelItem.at(0)->ItemNr);
emit DocChanged();
8004,13 → 8016,13
 
void ScribusView::RaiseItem()
{
uint low = Doc->Items.count();
uint low = Doc->Items->count();
uint high = 0;
int d;
QMap<int, uint> ObjOrder;
PageItem *currItem;
PageItem *b2;
if ((Doc->Items.count() > 1) && (SelItem.count() != 0))
if ((Doc->Items->count() > 1) && (SelItem.count() != 0))
{
for (uint c = 0; c < SelItem.count(); ++c)
{
8020,9 → 8032,9
low = QMIN(currItem->ItemNr, low);
high = QMAX(currItem->ItemNr, high);
}
if (high == Doc->Items.count()-1)
if (high == Doc->Items->count()-1)
return;
b2 = Doc->Items.at(low);
b2 = Doc->Items->at(low);
SelItem.clear();
SelectItemNr(high+1, false);
for (uint c = 0; c < SelItem.count(); ++c)
8030,28 → 8042,30
currItem = SelItem.at(c);
currItem->Select = false;
ObjOrder.insert(currItem->ItemNr, c);
d = Doc->Items.findRef(currItem);
Doc->Items.take(d);
d = Doc->Items->findRef(currItem);
Doc->Items->take(d);
}
QValueList<uint> Oindex = ObjOrder.values();
for (int c = 0; c <static_cast<int>(Oindex.count()); ++c)
{
d = Doc->Items.findRef(b2);
Doc->Items.insert(d, SelItem.at(Oindex[c]));
d = Doc->Items->findRef(b2);
Doc->Items->insert(d, SelItem.at(Oindex[c]));
}
SelItem.clear();
for (uint a = 0; a < Doc->Items.count(); ++a)
for (uint a = 0; a < Doc->Items->count(); ++a)
{
Doc->Items.at(a)->ItemNr = a;
if (Doc->Items.at(a)->isBookmark)
emit NewBMNr(Doc->Items.at(a)->BMnr, a);
if (Doc->Items.at(a)->Select)
SelItem.append(Doc->Items.at(a));
Doc->Items->at(a)->ItemNr = a;
if (Doc->Items->at(a)->isBookmark)
emit NewBMNr(Doc->Items->at(a)->BMnr, a);
if (Doc->Items->at(a)->Select)
SelItem.append(Doc->Items->at(a));
}
/*
if (Doc->masterPageMode())
Doc->MasterItems = Doc->Items;
else
Doc->DocItems = Doc->Items;
*/
ScApp->outlinePalette->BuildTree();
emit LevelChanged(SelItem.at(0)->ItemNr);
emit DocChanged();
8239,7 → 8253,7
}
if (currItem->isBookmark)
emit DelBM(currItem);
Doc->Items.remove(currItem);
Doc->Items->remove(currItem);
currItem->Select = false;
//delItems.removeFirst();
delItems.removeLast();
8257,11 → 8271,11
undoManager->action(target, is, currItem->getUPixmap());
}
}
for (a = 0; a < Doc->Items.count(); ++a)
for (a = 0; a < Doc->Items->count(); ++a)
{
Doc->Items.at(a)->ItemNr = a;
if (Doc->Items.at(a)->isBookmark)
emit NewBMNr(Doc->Items.at(a)->BMnr, a);
Doc->Items->at(a)->ItemNr = a;
if (Doc->Items->at(a)->isBookmark)
emit NewBMNr(Doc->Items->at(a)->BMnr, a);
}
Doc->updateFrameItems();
if (anz > 1)
8268,10 → 8282,12
undoManager->commit();
updateContents();
qApp->setOverrideCursor(QCursor(ArrowCursor), true);
/*
if (Doc->masterPageMode())
Doc->MasterItems = Doc->Items;
else
Doc->DocItems = Doc->Items;
*/
ScApp->outlinePalette->BuildTree();
if (SelItem.count() == 0)
emit HaveSel(-1);
8283,7 → 8299,7
 
void ScribusView::PasteToPage()
{
uint ac = Doc->Items.count();
uint ac = Doc->Items->count();
if (UndoManager::undoEnabled())
undoManager->beginTransaction(Doc->currentPage->getUName(), 0, Um::Paste, "", Um::IPaste);
emit LoadElem(ScApp->Buffer2, qRound(Mxp/Scale), qRound(Myp/Scale), false, false, Doc, this);
8290,9 → 8306,9
Doc->DraggedElem = 0;
Doc->DragElements.clear();
updateContents();
for (uint as = ac; as < Doc->Items.count(); ++as)
for (uint as = ac; as < Doc->Items->count(); ++as)
{
PageItem* currItem = Doc->Items.at(as);
PageItem* currItem = Doc->Items->at(as);
if (currItem->isBookmark)
emit AddBM(currItem);
}
8409,16 → 8425,16
fe->Margins.Top+fe->yOffset(), Doc->pageWidth-fe->Margins.Right-fe->Margins.Left,
Doc->pageHeight-fe->Margins.Bottom-fe->Margins.Top,
1, "None", Doc->toolSettings.dPen, !Mpressed);
Doc->Items.at(z)->isAutoText = true;
Doc->Items.at(z)->BackBox = Doc->LastAuto;
Doc->Items.at(z)->Cols = qRound(Doc->PageSp);
Doc->Items.at(z)->ColGap = Doc->PageSpa;
Doc->Items->at(z)->isAutoText = true;
Doc->Items->at(z)->BackBox = Doc->LastAuto;
Doc->Items->at(z)->Cols = qRound(Doc->PageSp);
Doc->Items->at(z)->ColGap = Doc->PageSpa;
if (Doc->LastAuto != 0)
Doc->LastAuto->NextBox = Doc->Items.at(z);
Doc->LastAuto->NextBox = Doc->Items->at(z);
else
Doc->FirstAuto = Doc->Items.at(z);
Doc->LastAuto = Doc->Items.at(z);
setRedrawBounding(Doc->Items.at(z));
Doc->FirstAuto = Doc->Items->at(z);
Doc->LastAuto = Doc->Items->at(z);
setRedrawBounding(Doc->Items->at(z));
if (nr > 0)
{
bool savre = Doc->RePos;
8426,8 → 8442,8
QPixmap pgPix(1, 1);
ScPainter *painter = new ScPainter(&pgPix, 1, 1);
// painter->translate(0.5, 0.5);
if (Doc->Items.at(z)->BackBox != 0)
Doc->Items.at(z)->BackBox->DrawObj(painter, QRect(0, 0, 1, 1));
if (Doc->Items->at(z)->BackBox != 0)
Doc->Items->at(z)->BackBox->DrawObj(painter, QRect(0, 0, 1, 1));
painter->end();
delete painter;
painter=NULL;
8700,6 → 8716,7
{
Deselect(false);
OldScale = Scale;
/*
if (!Doc->masterPageMode())
{
//Doc->DocPages = Doc->Pages;
8708,6 → 8725,7
Doc->Items = Doc->MasterItems;
//Doc->masterPageMode = true;
}
*/
Doc->setMasterPageMode(true);
Doc->pageCount = 1;
Doc->currentPage = Doc->Pages->at(nr);
8725,8 → 8743,8
void ScribusView::hideMasterPage()
{
Deselect(true);
Doc->MasterItems = Doc->Items;
Doc->Items = Doc->DocItems;
//Doc->MasterItems = Doc->Items;
//Doc->Items = Doc->DocItems;
//Doc->MasterPages = Doc->Pages;
Doc->pageCount = Doc->DocPages.count();
//Doc->Pages = &Doc->DocPages;
8746,12 → 8764,12
 
int ScribusView::CountElements()
{
return static_cast<int>(Doc->Items.count());
return static_cast<int>(Doc->Items->count());
}
 
void ScribusView::RecalcPictures(ProfilesL *Pr, QProgressBar *dia)
{
uint docItemCount=Doc->Items.count();
uint docItemCount=Doc->Items->count();
if ( docItemCount!= 0)
{
int counter;
8762,7 → 8780,7
PageItem* it;
for (uint i=0; i < docItemCount; ++i)
{
it = Doc->Items.at(i);
it = Doc->Items->at(i);
if ((it->itemType() == PageItem::ImageFrame) && (it->PicAvail))
{
if (!Pr->contains(it->IProfile))
8789,14 → 8807,16
{
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)
{
Doc->DocItems = Doc->Items;
Doc->Items = Doc->MasterItems;
}
*/
Doc->guidesSettings.framesShown = false;
setScale(1.0);
previewMode = true;
8811,11 → 8831,13
Doc->guidesSettings.framesShown = frs;
setScale(sca);
Doc->currentPage = act;
/*
if (!mas)
{
Doc->MasterItems = Doc->Items;
Doc->Items = Doc->DocItems;
}
*/
//Doc->masterPageMode = mas;
painter->end();
double sx = im.width() / static_cast<double>(maxGr);
10539,25 → 10561,25
//
case PageItem::ImageFrame:
z = Doc->itemAdd(PageItem::ImageFrame, PageItem::Unspecified, x, y, w, h, 1, Doc->toolSettings.dBrushPict, "None", !Mpressed);
Doc->Items.at(z)->LocalScX = Buffer->LocalScX;
Doc->Items.at(z)->LocalScY = Buffer->LocalScY;
Doc->Items.at(z)->LocalX = Buffer->LocalX;
Doc->Items.at(z)->LocalY = Buffer->LocalY;
Doc->Items.at(z)->Pfile = Buffer->Pfile;
Doc->Items.at(z)->IProfile = Buffer->IProfile;
Doc->Items.at(z)->EmProfile = Buffer->EmProfile;
Doc->Items.at(z)->IRender = Buffer->IRender;
Doc->Items.at(z)->UseEmbedded = Buffer->UseEmbedded;
if (!Doc->Items.at(z)->Pfile.isEmpty())
Doc->LoadPict(Doc->Items.at(z)->Pfile, z);
Doc->Items.at(z)->LocalScX = Buffer->LocalScX;
Doc->Items.at(z)->LocalScY = Buffer->LocalScY;
Doc->Items.at(z)->PicArt = Buffer->PicArt;
Doc->Items.at(z)->BBoxX = Buffer->BBoxX;
Doc->Items.at(z)->BBoxH = Buffer->BBoxH;
Doc->Items.at(z)->ScaleType = Buffer->ScaleType;
Doc->Items.at(z)->AspectRatio = Buffer->AspectRatio;
Doc->Items.at(z)->Pwidth = Buffer->Pwidth;
Doc->Items->at(z)->LocalScX = Buffer->LocalScX;
Doc->Items->at(z)->LocalScY = Buffer->LocalScY;
Doc->Items->at(z)->LocalX = Buffer->LocalX;
Doc->Items->at(z)->LocalY = Buffer->LocalY;
Doc->Items->at(z)->Pfile = Buffer->Pfile;
Doc->Items->at(z)->IProfile = Buffer->IProfile;
Doc->Items->at(z)->EmProfile = Buffer->EmProfile;
Doc->Items->at(z)->IRender = Buffer->IRender;
Doc->Items->at(z)->UseEmbedded = Buffer->UseEmbedded;
if (!Doc->Items->at(z)->Pfile.isEmpty())
Doc->LoadPict(Doc->Items->at(z)->Pfile, z);
Doc->Items->at(z)->LocalScX = Buffer->LocalScX;
Doc->Items->at(z)->LocalScY = Buffer->LocalScY;
Doc->Items->at(z)->PicArt = Buffer->PicArt;
Doc->Items->at(z)->BBoxX = Buffer->BBoxX;
Doc->Items->at(z)->BBoxH = Buffer->BBoxH;
Doc->Items->at(z)->ScaleType = Buffer->ScaleType;
Doc->Items->at(z)->AspectRatio = Buffer->AspectRatio;
Doc->Items->at(z)->Pwidth = Buffer->Pwidth;
break;
// OBSOLETE CR 2005-02-06
case PageItem::ItemType3:
10569,23 → 10591,23
z = Doc->itemAdd(PageItem::TextFrame, PageItem::Unspecified, x, y, w, h, pw, "None", Buffer->Pcolor, !Mpressed);
if ((Buffer->isAnnotation) && (Buffer->AnUseIcons))
{
Doc->Items.at(z)->LocalScX = Buffer->LocalScX;
Doc->Items.at(z)->LocalScY = Buffer->LocalScY;
Doc->Items.at(z)->LocalX = Buffer->LocalX;
Doc->Items.at(z)->LocalY = Buffer->LocalY;
Doc->Items.at(z)->Pfile = Buffer->Pfile;
Doc->Items.at(z)->Pfile2 = Buffer->Pfile2;
Doc->Items.at(z)->Pfile3 = Buffer->Pfile3;
Doc->Items.at(z)->IProfile = Buffer->IProfile;
Doc->Items.at(z)->EmProfile = Buffer->EmProfile;
Doc->Items.at(z)->IRender = Buffer->IRender;
Doc->Items.at(z)->UseEmbedded = Buffer->UseEmbedded;
Doc->LoadPict(Doc->Items.at(z)->Pfile, z);
Doc->Items.at(z)->LocalScX = Buffer->LocalScX;
Doc->Items.at(z)->LocalScY = Buffer->LocalScY;
Doc->Items.at(z)->PicArt = Buffer->PicArt;
Doc->Items.at(z)->BBoxX = Buffer->BBoxX;
Doc->Items.at(z)->BBoxH = Buffer->BBoxH;
Doc->Items->at(z)->LocalScX = Buffer->LocalScX;
Doc->Items->at(z)->LocalScY = Buffer->LocalScY;
Doc->Items->at(z)->LocalX = Buffer->LocalX;
Doc->Items->at(z)->LocalY = Buffer->LocalY;
Doc->Items->at(z)->Pfile = Buffer->Pfile;
Doc->Items->at(z)->Pfile2 = Buffer->Pfile2;
Doc->Items->at(z)->Pfile3 = Buffer->Pfile3;
Doc->Items->at(z)->IProfile = Buffer->IProfile;
Doc->Items->at(z)->EmProfile = Buffer->EmProfile;
Doc->Items->at(z)->IRender = Buffer->IRender;
Doc->Items->at(z)->UseEmbedded = Buffer->UseEmbedded;
Doc->LoadPict(Doc->Items->at(z)->Pfile, z);
Doc->Items->at(z)->LocalScX = Buffer->LocalScX;
Doc->Items->at(z)->LocalScY = Buffer->LocalScY;
Doc->Items->at(z)->PicArt = Buffer->PicArt;
Doc->Items->at(z)->BBoxX = Buffer->BBoxX;
Doc->Items->at(z)->BBoxH = Buffer->BBoxH;
}
if (!Buffer->itemText.isEmpty())
{
10656,11 → 10678,11
hg->PRot = 0;
hg->PtransX = 0;
hg->PtransY = 0;
Doc->Items.at(z)->itemText.append(hg);
Doc->Items->at(z)->itemText.append(hg);
}
}
Doc->Items.at(z)->LineSp = Buffer->LineSp;
Doc->Items.at(z)->convertTo(Buffer->PType);
Doc->Items->at(z)->LineSp = Buffer->LineSp;
Doc->Items->at(z)->convertTo(Buffer->PType);
break;
case PageItem::Line:
z = Doc->itemAdd(PageItem::Line, PageItem::Unspecified, x, y, w ,0, pw, "None", Buffer->Pcolor2, !Mpressed);
10672,7 → 10694,7
z = Doc->itemAdd(PageItem::PolyLine, PageItem::Unspecified, x, y, w, h, pw, Buffer->Pcolor, Buffer->Pcolor2, !Mpressed);
break;
}
PageItem *currItem = Doc->Items.at(z);
PageItem *currItem = Doc->Items->at(z);
currItem->LineSpMode = Buffer->LineSpMode;
if (currItem->LineSpMode == 3)
{
11199,7 → 11221,7
pts.map(chma);
}
uint z = Doc->itemAdd(PageItem::Polygon, PageItem::Unspecified, currItem->Xpos, currItem->Ypos, currItem->Width, currItem->Height, currItem->Pwidth, currItem->lineColor(), currItem->fillColor(), !Mpressed);
bb = Doc->Items.at(z);
bb = Doc->Items->at(z);
bb->setTextFlowsAroundFrame(currItem->textFlowsAroundFrame());
bb->setTextFlowUsesBoundingBox(currItem->textFlowUsesBoundingBox());
bb->setSizeLocked(currItem->sizeLocked());
11259,7 → 11281,7
if ((currItem->asPathText()) && (currItem->PoShow))
{
uint z = Doc->itemAdd(PageItem::PolyLine, PageItem::Unspecified, currItem->Xpos, currItem->Ypos, currItem->Width, currItem->Height, currItem->Pwidth, "None", currItem->lineColor(), !Mpressed);
PageItem *bb = Doc->Items.at(z);
PageItem *bb = Doc->Items->at(z);
bb->PoLine = currItem->PoLine.copy();
bb->ClipEdited = true;
bb->FrameType = 3;
11344,7 → 11366,7
{
StartInd = a + 1;
z = Doc->itemAdd(PageItem::Polygon, PageItem::Unspecified, currItem->Xpos, currItem->Ypos, currItem->Width, currItem->Height, currItem->Pwidth, currItem->fillColor(), currItem->lineColor(), !Mpressed);
bb = Doc->Items.at(z);
bb = Doc->Items->at(z);
bb->PoLine.resize(0);
bb->PoLine.putPoints(0, EndInd - StartInd, currItem->PoLine, StartInd);
bb->Rot = currItem->Rot;
/branches/Version13x/Scribus/scribus/pageitem_textframe.cpp
400,7 → 400,7
Doc->docParagraphStyles[0].LineSpa = LineSp;
QRegion cl = QRegion(pf2.xForm(Clip));
int LayerLev = Doc->layerLevelFromNumber(LayerNr);
uint docItemsCount=Doc->Items.count();
uint docItemsCount=Doc->Items->count();
if (!isEmbedded)
{
if (!OnMasterPage.isEmpty())
446,7 → 446,7
}
for (a = 0; a < docItemsCount; ++a)
{
PageItem* docItem = Doc->Items.at(a);
PageItem* docItem = Doc->Items->at(a);
if (docItem->textFlowsAroundFrame())
{
pp.begin(ScApp->view->viewport());
480,7 → 480,7
}
for (a = 0; a < docItemsCount; ++a)
{
PageItem* docItem = Doc->Items.at(a);
PageItem* docItem = Doc->Items->at(a);
int LayerLevItem = Doc->layerLevelFromNumber(docItem->LayerNr);
if (((docItem->ItemNr > ItemNr) && (docItem->LayerNr == LayerNr)) || (LayerLevItem > LayerLev))
{
/branches/Version13x/Scribus/scribus/muster.cpp
175,12 → 175,12
}
qHeapSort(currentDoc->currentPage->XGuides);
}
uint end = currentDoc->Items.count();
uint end = currentDoc->Items->count();
int GrMax = currentDoc->GroupCounter;
for (uint a = 0; a < end; ++a)
{
PageItem *itemToCopy = currentDoc->Items.at(a);
if (currentDoc->Items.at(a)->OwnPage == inde)
PageItem *itemToCopy = currentDoc->Items->at(a);
if (currentDoc->Items->at(a)->OwnPage == inde)
{
itemToCopy->copyToCopyPasteBuffer(&Buffer);
if (itemToCopy->Groups.count() != 0)
199,7 → 199,7
}
}
currentView->PasteItem(&Buffer, true, true);
PageItem* Neu = currentDoc->Items.at(currentDoc->Items.count()-1);
PageItem* Neu = currentDoc->Items->at(currentDoc->Items->count()-1);
Neu->OnMasterPage = MasterPageName;
if (Neu->isTableItem)
{
214,19 → 214,19
{
PageItem* ta = TableItems.at(ttc);
if (ta->TopLinkID != -1)
ta->TopLink = currentDoc->Items.at(TableID[ta->TopLinkID]);
ta->TopLink = currentDoc->Items->at(TableID[ta->TopLinkID]);
else
ta->TopLink = 0;
if (ta->LeftLinkID != -1)
ta->LeftLink = currentDoc->Items.at(TableID[ta->LeftLinkID]);
ta->LeftLink = currentDoc->Items->at(TableID[ta->LeftLinkID]);
else
ta->LeftLink = 0;
if (ta->RightLinkID != -1)
ta->RightLink = currentDoc->Items.at(TableID[ta->RightLinkID]);
ta->RightLink = currentDoc->Items->at(TableID[ta->RightLinkID]);
else
ta->RightLink = 0;
if (ta->BottomLinkID != -1)
ta->BottomLink = currentDoc->Items.at(TableID[ta->BottomLinkID]);
ta->BottomLink = currentDoc->Items->at(TableID[ta->BottomLinkID]);
else
ta->BottomLink = 0;
}
/branches/Version13x/Scribus/scribus/scribus.cpp
1272,7 → 1272,7
if (doc->SubMode != -1)
{
view->Deselect(false);
doc->Items.remove(currItem->ItemNr);
doc->Items->remove(currItem->ItemNr);
}
break;
case modeLinkFrames:
1287,7 → 1287,7
if (currItem->PoLine.size() < 4)
{
view->Deselect(false);
doc->Items.remove(currItem->ItemNr);
doc->Items->remove(currItem->ItemNr);
}
else
{
1303,7 → 1303,7
break;
default:
view->Deselect(false);
doc->Items.remove(currItem->ItemNr);
doc->Items->remove(currItem->ItemNr);
break;
}
}
2410,7 → 2410,7
 
doc->setModified(false);
doc->setLoading(false);
doc->DocItems = doc->Items;
//doc->DocItems = doc->Items;
doc->currentPage = doc->Pages->at(0);
doc->OpenNodes.clear();
//<<View and window code
2602,10 → 2602,12
bool ScribusApp::SetupDoc()
{
bool ret = false;
/*
if (doc->masterPageMode())
doc->MasterItems = doc->Items;
else
doc->DocItems = doc->Items;
*/
ReformDoc* dia = new ReformDoc(this, doc);
if (dia->exec())
{
3617,7 → 3619,7
return false;
}
doc->setLoading(true);
uint oldItemsCount = doc->Items.count();
uint oldItemsCount = doc->Items->count();
if(!fl->LoadPage(Nr, Mpa))
{
delete fl;
3630,10 → 3632,10
recalcColors();
view->RecalcPictures(&InputProfiles);
}
uint docItemsCount=doc->Items.count();
uint docItemsCount=doc->Items->count();
for (uint i = oldItemsCount; i < docItemsCount; ++i)
{
PageItem *ite = doc->Items.at(i);
PageItem *ite = doc->Items->at(i);
if ((ite->asTextFrame()) && (ite->isBookmark))
bookmarkPalette->BView->AddPageItem(ite);
}
3944,7 → 3946,7
doc->addMasterPage(0, "Normal");
doc->pageCount = doc->DocPages.count();
doc->setLoading(false);
doc->DocItems = doc->Items;
//doc->DocItems = doc->Items;
doc->RePos = true;
QPixmap pgPix(10, 10);
QRect rd = QRect(0,0,9,9);
3952,7 → 3954,7
doc->setMasterPageMode(true);
//doc->Pages = &doc->MasterPages;
//doc->masterPageMode = true;
doc->Items = doc->MasterItems;
//doc->Items = doc->MasterItems;
for (uint azz=0; azz<doc->MasterItems.count(); ++azz)
{
PageItem *ite = doc->MasterItems.at(azz);
3987,10 → 3989,10
// RestoreBookMarks();
//doc->Pages = &doc->DocPages;
doc->setMasterPageMode(false);
doc->Items = doc->DocItems;
for (uint azz=0; azz<doc->Items.count(); ++azz)
//doc->Items = doc->DocItems;
for (uint azz=0; azz<doc->Items->count(); ++azz)
{
PageItem *ite = doc->Items.at(azz);
PageItem *ite = doc->Items->at(azz);
if (ite->Groups.count() != 0)
doc->GroupOnPage(ite);
else
4188,16 → 4190,18
delete gt;
if (doc->docHyphenator->AutoCheck)
doc->docHyphenator->slotHyphenate(currItem);
for (uint a = 0; a < doc->Items.count(); ++a)
for (uint a = 0; a < doc->Items->count(); ++a)
{
doc->Items.at(a)->ItemNr = a;
if (doc->Items.at(a)->isBookmark)
bookmarkPalette->BView->ChangeItem(doc->Items.at(a)->BMnr, a);
doc->Items->at(a)->ItemNr = a;
if (doc->Items->at(a)->isBookmark)
bookmarkPalette->BView->ChangeItem(doc->Items->at(a)->BMnr, a);
}
/*
if (doc->masterPageMode())
doc->MasterItems = doc->Items;
else
doc->DocItems = doc->Items;
*/
outlinePalette->BuildTree();
view->DrawNew();
slotDocCh();
4400,9 → 4404,9
disconnect(doc->WinHan, SIGNAL(AutoSaved()), this, SLOT(slotAutoSaved()));
disconnect(fileWatcher, SIGNAL(fileChanged(QString )), view, SLOT(updatePict(QString)));
disconnect(fileWatcher, SIGNAL(fileDeleted(QString )), view, SLOT(removePict(QString)));
for (uint a = 0; a < doc->Items.count(); ++a)
for (uint a = 0; a < doc->Items->count(); ++a)
{
PageItem *currItem = doc->Items.at(a);
PageItem *currItem = doc->Items->at(a);
if (currItem->PicAvail)
fileWatcher->removeFile(currItem->Pfile);
}
4422,6 → 4426,7
bookmarkPalette->BView->First = 1;
bookmarkPalette->BView->Last = 0;
outlinePalette->unsetDoc();
alignDistributePalette->setView(NULL);
//>>
if ((wsp->windowList().isEmpty()) || (wsp->windowList().count() == 1))
{
5012,7 → 5017,7
{
bool savedAlignGrid = doc->useRaster;
bool savedAlignGuides = doc->SnapGuides;
uint ac = doc->Items.count();
uint ac = doc->Items->count();
bool isGroup = false;
double gx, gy, gh, gw;
FPoint minSize = doc->minCanvasCoordinate;
5024,22 → 5029,22
doc->SnapGuides = savedAlignGuides;
QPtrList<PageItem> bSel = view->SelItem;
view->SelItem.clear();
if (doc->Items.count() - ac > 1)
if (doc->Items->count() - ac > 1)
isGroup = true;
for (uint as = ac; as < doc->Items.count(); ++as)
for (uint as = ac; as < doc->Items->count(); ++as)
{
view->SelItem.append(doc->Items.at(as));
view->SelItem.append(doc->Items->at(as));
if (isGroup)
doc->Items.at(as)->Groups.push(doc->GroupCounter);
doc->Items->at(as)->Groups.push(doc->GroupCounter);
}
if (isGroup)
doc->GroupCounter++;
view->setGroupRect();
view->getGroupRect(&gx, &gy, &gw, &gh);
PageItem* currItem3 = doc->Items.at(ac);
for (uint as = ac; as < doc->Items.count(); ++as)
PageItem* currItem3 = doc->Items->at(ac);
for (uint as = ac; as < doc->Items->count(); ++as)
{
PageItem* currItem2 = doc->Items.at(as);
PageItem* currItem2 = doc->Items->at(as);
currItem2->isEmbedded = true;
currItem2->isAnnotation = false;
currItem2->isBookmark = false;
5050,15 → 5055,17
currItem2->ItemNr = doc->FrameItems.count();
doc->FrameItems.append(currItem2);
}
uint acc = doc->Items.count();
uint acc = doc->Items->count();
for (uint as = ac; as < acc; ++as)
{
doc->Items.take(ac);
doc->Items->take(ac);
}
/*
if (doc->masterPageMode())
doc->MasterItems = doc->Items;
else
doc->DocItems = doc->Items;
*/
view->SelItem.clear();
view->SelItem = bSel;
view->resizeContents(qRound((maxSize.x() - minSize.x()) * view->getScale()), qRound((maxSize.y() - minSize.y()) * view->getScale()));
5099,7 → 5106,7
if (Buffer2.startsWith("<SCRIBUSELEM"))
{
view->Deselect(true);
uint ac = doc->Items.count();
uint ac = doc->Items->count();
bool savedAlignGrid = doc->useRaster;
bool savedAlignGuides = doc->SnapGuides;
doc->useRaster = false;
5107,9 → 5114,9
slotElemRead(Buffer2, 0, 0, false, true, doc, view);
doc->useRaster = savedAlignGrid;
doc->SnapGuides = savedAlignGuides;
for (uint as = ac; as < doc->Items.count(); ++as)
for (uint as = ac; as < doc->Items->count(); ++as)
{
PageItem* currItem = doc->Items.at(as);
PageItem* currItem = doc->Items->at(as);
if (currItem->isBookmark)
AddBookMark(currItem);
view->SelectItemNr(as);
5149,10 → 5156,10
{
PageItem *currItem;
view->Deselect();
uint docItemsCount=doc->Items.count();
uint docItemsCount=doc->Items->count();
for (uint a = 0; a < docItemsCount; ++a)
{
currItem = doc->Items.at(a);
currItem = doc->Items->at(a);
if (currItem->LayerNr == doc->activeLayer())
{
if (!currItem->Select)
5619,10 → 5626,10
void ScribusApp::TogglePics()
{
doc->guidesSettings.showPic = !doc->guidesSettings.showPic;
for (uint b=0; b<doc->Items.count(); ++b)
for (uint b=0; b<doc->Items->count(); ++b)
{
if (doc->Items.at(b)->asImageFrame())
doc->Items.at(b)->PicArt = doc->guidesSettings.showPic;
if (doc->Items->at(b)->asImageFrame())
doc->Items->at(b)->PicArt = doc->guidesSettings.showPic;
}
view->DrawNew();
}
6153,9 → 6160,9
 
void ScribusApp::AdjustBM()
{
for (uint b = 0; b < doc->Items.count(); ++b)
for (uint b = 0; b < doc->Items->count(); ++b)
{
PageItem* bb = doc->Items.at(b);
PageItem* bb = doc->Items->at(b);
if (bb->isBookmark)
{
int it = bb->BMnr;
6185,9 → 6192,9
/* if (!doc->masterPageMode)
disconnect(doc->currentPage, SIGNAL(DelObj(uint, uint)), outlinePalette, SLOT(slotRemoveElement(uint, uint))); */
view->SelItem.clear();
for (uint d = 0; d < doc->Items.count(); ++d)
for (uint d = 0; d < doc->Items->count(); ++d)
{
ite = doc->Items.at(d);
ite = doc->Items->at(d);
if (ite->OwnPage == pg)
{
ite->setLocked(false);
6249,9 → 6256,9
view->SelItem.clear();
for (int a = to - 1; a >= from - 1; a--)
{
for (uint d = 0; d < doc->Items.count(); ++d)
for (uint d = 0; d < doc->Items->count(); ++d)
{
ite = doc->Items.at(d);
ite = doc->Items->at(d);
if (ite->OwnPage == a)
{
ite->setLocked(false);
6366,10 → 6373,10
QPtrList<PageItem> TableItems;
TableID.clear();
TableItems.clear();
uint oldItems = doc->Items.count();
uint oldItems = doc->Items->count();
for (uint ite = 0; ite < oldItems; ++ite)
{
PageItem *itemToCopy = doc->Items.at(ite);
PageItem *itemToCopy = doc->Items->at(ite);
if (itemToCopy->OwnPage == static_cast<int>(from->pageNr()))
{
itemToCopy->copyToCopyPasteBuffer(&Buffer);
6391,7 → 6398,7
}
}
view->PasteItem(&Buffer, true, true);
PageItem* Neu = doc->Items.at(doc->Items.count()-1);
PageItem* Neu = doc->Items->at(doc->Items->count()-1);
Neu->OnMasterPage = "";
if (itemToCopy->isBookmark)
AddBookMark(Neu);
6408,19 → 6415,19
{
PageItem* ta = TableItems.at(ttc);
if (ta->TopLinkID != -1)
ta->TopLink = doc->Items.at(TableID[ta->TopLinkID]);
ta->TopLink = doc->Items->at(TableID[ta->TopLinkID]);
else
ta->TopLink = 0;
if (ta->LeftLinkID != -1)
ta->LeftLink = doc->Items.at(TableID[ta->LeftLinkID]);
ta->LeftLink = doc->Items->at(TableID[ta->LeftLinkID]);
else
ta->LeftLink = 0;
if (ta->RightLinkID != -1)
ta->RightLink = doc->Items.at(TableID[ta->RightLinkID]);
ta->RightLink = doc->Items->at(TableID[ta->RightLinkID]);
else
ta->RightLink = 0;
if (ta->BottomLinkID != -1)
ta->BottomLink = doc->Items.at(TableID[ta->BottomLinkID]);
ta->BottomLink = doc->Items->at(TableID[ta->BottomLinkID]);
else
ta->BottomLink = 0;
}
6680,10 → 6687,12
 
void ScribusApp::saveLStyles(LineFormate *dia)
{
/*
if (doc->masterPageMode())
doc->MasterItems = doc->Items;
else
doc->DocItems = doc->Items;
*/
PageItem* ite;
doc->MLineStyles = dia->TempStyles;
for (uint d = 0; d < doc->DocItems.count(); ++d)
6744,10 → 6753,12
ers.append(2);
ers.append(3);
ers.append(4);
/*
if (doc->masterPageMode())
doc->MasterItems = doc->Items;
else
doc->DocItems = doc->Items;
*/
for (uint a=5; a<doc->docParagraphStyles.count(); ++a)
{
ff = false;
6864,7 → 6875,7
counter = doc->MasterItems.count();
break;
case 1:
counter = doc->Items.count();
counter = doc->DocItems.count();
break;
case 2:
counter = doc->FrameItems.count();
6878,7 → 6889,7
ite = doc->MasterItems.at(d);
break;
case 1:
ite = doc->Items.at(d);
ite = doc->DocItems.at(d);
break;
case 2:
ite = doc->FrameItems.at(d);
/branches/Version13x/Scribus/scribus/plugins/scriptplugin/cmdobj.cpp
19,10 → 19,10
int i = ScApp->doc->itemAdd(PageItem::Polygon, PageItem::Rectangle, pageUnitXToDocX(x), pageUnitYToDocY(y),
ValueToPoint(b), ValueToPoint(h), ScApp->doc->toolSettings.dWidth,
ScApp->doc->toolSettings.dBrush, ScApp->doc->toolSettings.dPen, true);
ScApp->view->setRedrawBounding(ScApp->doc->Items.at(i));
ScApp->view->setRedrawBounding(ScApp->doc->Items->at(i));
if (Name != "")
ScApp->doc->Items.at(i)->setItemName(QString::fromUtf8(Name));
return PyString_FromString(ScApp->doc->Items.at(i)->itemName().utf8());
ScApp->doc->Items->at(i)->setItemName(QString::fromUtf8(Name));
return PyString_FromString(ScApp->doc->Items->at(i)->itemName().utf8());
}
 
 
45,10 → 45,10
PyErr_SetString(NameExistsError, QObject::tr("An object with the requested name already exists.","python error"));
return NULL;
}
ScApp->view->setRedrawBounding(ScApp->doc->Items.at(i));
ScApp->view->setRedrawBounding(ScApp->doc->Items->at(i));
if (Name != "")
ScApp->doc->Items.at(i)->setItemName(QString::fromUtf8(Name));
return PyString_FromString(ScApp->doc->Items.at(i)->itemName().utf8());
ScApp->doc->Items->at(i)->setItemName(QString::fromUtf8(Name));
return PyString_FromString(ScApp->doc->Items->at(i)->itemName().utf8());
}
 
 
66,10 → 66,10
PyErr_SetString(NameExistsError, QObject::tr("An object with the requested name already exists.","python error"));
return NULL;
}
ScApp->view->setRedrawBounding(ScApp->doc->Items.at(i));
ScApp->view->setRedrawBounding(ScApp->doc->Items->at(i));
if (Name != "")
ScApp->doc->Items.at(i)->setItemName(QString::fromUtf8(Name));
return PyString_FromString(ScApp->doc->Items.at(i)->itemName().utf8());
ScApp->doc->Items->at(i)->setItemName(QString::fromUtf8(Name));
return PyString_FromString(ScApp->doc->Items->at(i)->itemName().utf8());
}
 
 
87,10 → 87,10
PyErr_SetString(NameExistsError, QObject::tr("An object with the requested name already exists.","python error"));
return NULL;
}
ScApp->view->setRedrawBounding(ScApp->doc->Items.at(i));
ScApp->view->setRedrawBounding(ScApp->doc->Items->at(i));
if (Name != "")
ScApp->doc->Items.at(i)->setItemName(QString::fromUtf8(Name));
return PyString_FromString(ScApp->doc->Items.at(i)->itemName().utf8());
ScApp->doc->Items->at(i)->setItemName(QString::fromUtf8(Name));
return PyString_FromString(ScApp->doc->Items->at(i)->itemName().utf8());
}
 
 
113,7 → 113,7
}
int i = ScApp->doc->itemAdd(PageItem::Line, PageItem::Unspecified, x, y, 1, 1, ScApp->doc->toolSettings.dWidth, ScApp->doc->toolSettings.dBrush, ScApp->doc->toolSettings.dPen, true);
PageItem *it = ScApp->doc->Items.at(i);
PageItem *it = ScApp->doc->Items->at(i);
it->PoLine.resize(4);
it->PoLine.setPoint(0, 0, 0);
it->PoLine.setPoint(1, 0, 0);
170,7 → 170,7
y = pageUnitYToDocY(static_cast<double>(PyFloat_AsDouble(PyList_GetItem(il, i))));
i++;
int ic = ScApp->doc->itemAdd(PageItem::PolyLine, PageItem::Unspecified, x, y, 1, 1, ScApp->doc->toolSettings.dWidth, ScApp->doc->toolSettings.dBrush, ScApp->doc->toolSettings.dPen, true);
PageItem *it = ScApp->doc->Items.at(ic);
PageItem *it = ScApp->doc->Items->at(ic);
it->PoLine.resize(2);
it->PoLine.setPoint(0, 0, 0);
it->PoLine.setPoint(1, 0, 0);
245,7 → 245,7
y = pageUnitYToDocY(static_cast<double>(PyFloat_AsDouble(PyList_GetItem(il, i))));
i++;
int ic = ScApp->doc->itemAdd(PageItem::Polygon, PageItem::Unspecified, x, y, 1, 1, ScApp->doc->toolSettings.dWidth, ScApp->doc->toolSettings.dBrush, ScApp->doc->toolSettings.dPen, true);
PageItem *it = ScApp->doc->Items.at(ic);
PageItem *it = ScApp->doc->Items->at(ic);
it->PoLine.resize(2);
it->PoLine.setPoint(0, 0, 0);
it->PoLine.setPoint(1, 0, 0);
331,7 → 331,7
i++;
//int ic = ScApp->view->PaintPolyLine(x, y, 1, 1, ScApp->doc->toolSettings.dWidth, ScApp->doc->toolSettings.dBrush, ScApp->doc->toolSettings.dPen);
int ic = ScApp->doc->itemAdd(PageItem::PolyLine, PageItem::Unspecified, x, y, 1, 1, ScApp->doc->toolSettings.dWidth, ScApp->doc->toolSettings.dBrush, ScApp->doc->toolSettings.dPen, true);
PageItem *it = ScApp->doc->Items.at(ic);
PageItem *it = ScApp->doc->Items->at(ic);
it->PoLine.resize(2);
it->PoLine.setPoint(0, 0, 0);
it->PoLine.setPoint(1, kx-x, ky-y);
405,9 → 405,9
return NULL;
}
ScApp->view->SelItem.clear();
ScApp->view->SelItem.append(ScApp->doc->Items.at(i));
ScApp->view->SelItem.append(ScApp->doc->Items.at(ii));
PageItem *it = ScApp->doc->Items.at(i);
ScApp->view->SelItem.append(ScApp->doc->Items->at(i));
ScApp->view->SelItem.append(ScApp->doc->Items->at(ii));
PageItem *it = ScApp->doc->Items->at(i);
ScApp->view->ToPathText();
ScApp->view->MoveItem(pageUnitXToDocX(x) - it->Xpos, pageUnitYToDocY(y) - it->Ypos, it);
if (Name != "")
/branches/Version13x/Scribus/scribus/plugins/scriptplugin/cmdpage.cpp
119,26 → 119,26
{
if(!checkHaveDocument())
return NULL;
if (ScApp->doc->Items.count() == 0)
if (ScApp->doc->Items->count() == 0)
return Py_BuildValue((char*)"[]");
uint counter = 0;
uint pageNr = ScApp->doc->currentPageNumber();
for (uint lam2 = 0; lam2 < ScApp->doc->Items.count(); ++lam2)
for (uint lam2 = 0; lam2 < ScApp->doc->Items->count(); ++lam2)
{
if (pageNr == ScApp->doc->Items.at(lam2)->OwnPage)
if (pageNr == ScApp->doc->Items->at(lam2)->OwnPage)
counter++;
}
PyObject *l = PyList_New(counter);
PyObject *row;
counter = 0;
for (uint i = 0; i<ScApp->doc->Items.count(); ++i)
for (uint i = 0; i<ScApp->doc->Items->count(); ++i)
{
if (pageNr == ScApp->doc->Items.at(i)->OwnPage)
if (pageNr == ScApp->doc->Items->at(i)->OwnPage)
{
row = Py_BuildValue((char*)"(sii)",
ScApp->doc->Items.at(i)->itemName().ascii(),
ScApp->doc->Items.at(i)->itemType(),
ScApp->doc->Items.at(i)->ItemNr
ScApp->doc->Items->at(i)->itemName().ascii(),
ScApp->doc->Items->at(i)->itemType(),
ScApp->doc->Items->at(i)->ItemNr
);
PyList_SetItem(l, counter, row);
counter++;
/branches/Version13x/Scribus/scribus/plugins/scriptplugin/cmdutil.cpp
48,9 → 48,9
{
if (!Name.isEmpty())
{
for (uint a = 0; a < ScApp->doc->Items.count(); a++)
for (uint a = 0; a < ScApp->doc->Items->count(); a++)
{
if (ScApp->doc->Items.at(a)->itemName() == Name)
if (ScApp->doc->Items->at(a)->itemName() == Name)
return static_cast<int>(a);
}
}
65,9 → 65,9
void ReplaceColor(QString col, QString rep)
{
QColor tmpc;
for (uint c = 0; c < ScApp->doc->Items.count(); c++)
for (uint c = 0; c < ScApp->doc->Items->count(); c++)
{
PageItem *ite = ScApp->doc->Items.at(c);
PageItem *ite = ScApp->doc->Items->at(c);
if (ite->itemType() == PageItem::TextFrame)
{
for (uint d = 0; d < ite->itemText.count(); d++)
145,10 → 145,10
PyErr_SetString(PyExc_ValueError, QString("Cannot accept empty name for pageitem"));
return NULL;
}
for (uint j = 0; j<ScApp->doc->Items.count(); j++)
for (uint j = 0; j<ScApp->doc->Items->count(); j++)
{
if (name==ScApp->doc->Items.at(j)->itemName())
return ScApp->doc->Items.at(j);
if (name==ScApp->doc->Items->at(j)->itemName())
return ScApp->doc->Items->at(j);
} // for items
PyErr_SetString(NoValidObjectError, QString("Object not found"));
return NULL;
164,9 → 164,9
{
if (name.length() == 0)
return false;
for (uint j = 0; j<ScApp->doc->Items.count(); j++)
for (uint j = 0; j<ScApp->doc->Items->count(); j++)
{
if (name==ScApp->doc->Items.at(j)->itemName())
if (name==ScApp->doc->Items->at(j)->itemName())
return true;
} // for items
return false;
206,9 → 206,9
{
// Search for the named item
PageItem* item = 0;
for (uint j = 0; j < ScApp->doc->Items.count(); j++)
if (*it == ScApp->doc->Items.at(j)->itemName())
item = ScApp->doc->Items.at(j);
for (uint j = 0; j < ScApp->doc->Items->count(); j++)
if (*it == ScApp->doc->Items->at(j)->itemName())
item = ScApp->doc->Items->at(j);
if (!item)
return false;
// and select it
/branches/Version13x/Scribus/scribus/plugins/scriptplugin/cmdgetprop.cpp
199,37 → 199,37
// have doc already
if (typ != -1)
{
for (uint lam2 = 0; lam2 < ScApp->doc->Items.count(); ++lam2)
for (uint lam2 = 0; lam2 < ScApp->doc->Items->count(); ++lam2)
{
if ((ScApp->doc->Items.at(lam2)->itemType() == typ) && (pageNr == ScApp->doc->Items.at(lam2)->OwnPage))
if ((ScApp->doc->Items->at(lam2)->itemType() == typ) && (pageNr == ScApp->doc->Items->at(lam2)->OwnPage))
counter++;
}
}
else
{
for (uint lam2 = 0; lam2 < ScApp->doc->Items.count(); ++lam2)
for (uint lam2 = 0; lam2 < ScApp->doc->Items->count(); ++lam2)
{
if (pageNr == ScApp->doc->Items.at(lam2)->OwnPage)
if (pageNr == ScApp->doc->Items->at(lam2)->OwnPage)
counter++;
}
}
 
l = PyList_New(counter);
for (uint lam=0; lam < ScApp->doc->Items.count(); ++lam)
for (uint lam=0; lam < ScApp->doc->Items->count(); ++lam)
{
if (pageNr == ScApp->doc->Items.at(lam)->OwnPage)
if (pageNr == ScApp->doc->Items->at(lam)->OwnPage)
{
if (typ != -1)
{
if (ScApp->doc->Items.at(lam)->itemType() == typ)
if (ScApp->doc->Items->at(lam)->itemType() == typ)
{
PyList_SetItem(l, counter2, PyString_FromString(ScApp->doc->Items.at(lam)->itemName().utf8()));
PyList_SetItem(l, counter2, PyString_FromString(ScApp->doc->Items->at(lam)->itemName().utf8()));
counter2++;
}
}
else
{
PyList_SetItem(l, counter2, PyString_FromString(ScApp->doc->Items.at(lam)->itemName().utf8()));
PyList_SetItem(l, counter2, PyString_FromString(ScApp->doc->Items->at(lam)->itemName().utf8()));
counter2++;
}
}
/branches/Version13x/Scribus/scribus/plugins/scriptplugin/scriptercore.cpp
147,9 → 147,9
QPixmap pgPix(10, 10);
QRect rd = QRect(0,0,9,9);
ScPainter *painter = new ScPainter(&pgPix, pgPix.width(), pgPix.height());
for (uint azz=0; azz<ScApp->doc->Items.count(); ++azz)
for (uint azz=0; azz<ScApp->doc->Items->count(); ++azz)
{
PageItem *ite = ScApp->doc->Items.at(azz);
PageItem *ite = ScApp->doc->Items->at(azz);
if (ite->Groups.count() != 0)
ScApp->doc->GroupOnPage(ite);
else
/branches/Version13x/Scribus/scribus/plugins/svgimplugin/svgplugin.cpp
424,7 → 424,7
parseStyle( gc, b );
//z = ScApp->view->PaintRect(BaseX, BaseY, width, height, gc->LWidth, gc->FillCol, gc->StrokeCol);
z = currDoc->itemAdd(PageItem::Polygon, PageItem::Rectangle, BaseX, BaseY, width, height, gc->LWidth, gc->FillCol, gc->StrokeCol, !ScApp->view->Mpressed);
PageItem* ite = currDoc->Items.at(z);
PageItem* ite = currDoc->Items->at(z);
if ((rx != 0) || (ry != 0))
{
ite->RadRect = QMAX(rx, ry);
449,7 → 449,7
parseStyle( gc, b );
//z = ScApp->view->PaintEllipse(BaseX, BaseY, rx * 2.0, ry * 2.0, gc->LWidth, gc->FillCol, gc->StrokeCol);
z = currDoc->itemAdd(PageItem::Polygon, PageItem::Ellipse, BaseX, BaseY, rx * 2.0, ry * 2.0, gc->LWidth, gc->FillCol, gc->StrokeCol, !ScApp->view->Mpressed);
PageItem* ite = currDoc->Items.at(z);
PageItem* ite = currDoc->Items->at(z);
QWMatrix mm = QWMatrix();
mm.translate(x, y);
ite->PoLine.map(mm);
467,7 → 467,7
parseStyle( gc, b );
//z = ScApp->view->PaintEllipse(BaseX, BaseY, r * 2.0, r * 2.0, gc->LWidth, gc->FillCol, gc->StrokeCol);
z = currDoc->itemAdd(PageItem::Polygon, PageItem::Ellipse, BaseX, BaseY, r * 2.0, r * 2.0, gc->LWidth, gc->FillCol, gc->StrokeCol, !ScApp->view->Mpressed);
PageItem* ite = currDoc->Items.at(z);
PageItem* ite = currDoc->Items->at(z);
QWMatrix mm = QWMatrix();
mm.translate(x, y);
ite->PoLine.map(mm);
486,7 → 486,7
parseStyle( gc, b );
//z = ScApp->view->PaintPoly(BaseX, BaseY, 10, 10, gc->LWidth, gc->FillCol, gc->StrokeCol);
z = currDoc->itemAdd(PageItem::Polygon, PageItem::Unspecified, BaseX, BaseY, 10, 10, gc->LWidth, gc->FillCol, gc->StrokeCol, !ScApp->view->Mpressed);
PageItem* ite = currDoc->Items.at(z);
PageItem* ite = currDoc->Items->at(z);
ite->PoLine.resize(4);
ite->PoLine.setPoint(0, FPoint(x1, y1));
ite->PoLine.setPoint(1, FPoint(x1, y1));
507,7 → 507,7
parseStyle( gc, b );
//z = ScApp->view->PaintPoly(BaseX, BaseY, 10, 10, gc->LWidth, gc->FillCol, gc->StrokeCol);
z = currDoc->itemAdd(PageItem::Polygon, PageItem::Unspecified, BaseX, BaseY, 10, 10, gc->LWidth, gc->FillCol, gc->StrokeCol, !ScApp->view->Mpressed);
PageItem* ite = currDoc->Items.at(z);
PageItem* ite = currDoc->Items->at(z);
ite->PoLine.resize(0);
if (parseSVG( b.attribute( "d" ), &ite->PoLine ))
ite->convertTo(PageItem::PolyLine);
529,7 → 529,7
else
//z = ScApp->view->PaintPolyLine(BaseX, BaseY, 10, 10, gc->LWidth, gc->FillCol, gc->StrokeCol);
z = currDoc->itemAdd(PageItem::PolyLine, PageItem::Unspecified, BaseX, BaseY, 10, 10, gc->LWidth, gc->FillCol, gc->StrokeCol, !ScApp->view->Mpressed);
PageItem* ite = currDoc->Items.at(z);
PageItem* ite = currDoc->Items->at(z);
ite->PoLine.resize(0);
bool bFirst = true;
double x = 0.0;
588,7 → 588,7
z = currDoc->itemAdd(PageItem::ImageFrame, PageItem::Unspecified, x+BaseX, y+BaseY, w, h, 1, currDoc->toolSettings.dBrushPict, "None", !ScApp->view->Mpressed);
if (!fname.isEmpty())
currDoc->LoadPict(fname, z);
PageItem* ite = currDoc->Items.at(z);
PageItem* ite = currDoc->Items->at(z);
if (ImgClip.size() != 0)
ite->PoLine = ImgClip.copy();
ImgClip.resize(0);
600,7 → 600,7
{
setupTransform( b );
SvgStyle *gc = m_gc.current();
PageItem* ite = currDoc->Items.at(z);
PageItem* ite = currDoc->Items->at(z);
switch (ite->itemType())
{
case PageItem::ImageFrame:
1956,7 → 1956,7
parseStyle(gc, tspan);
//int z = ScApp->view->PaintText(x, y, 10, 10, gc->LWidth, gc->FillCol);
int z = currDoc->itemAdd(PageItem::TextFrame, PageItem::Unspecified, x, y, 10, 10, gc->LWidth, "None", gc->FillCol, !ScApp->view->Mpressed);
PageItem* ite = currDoc->Items.at(z);
PageItem* ite = currDoc->Items->at(z);
ite->Extra = 0;
ite->TExtra = 0;
ite->BExtra = 0;
2080,7 → 2080,7
SvgStyle *gc = m_gc.current();
//int z = ScApp->view->PaintText(x, y - qRound(gc->FontSize / 10.0), 10, 10, gc->LWidth, gc->FillCol);
int z = currDoc->itemAdd(PageItem::TextFrame, PageItem::Unspecified, x, y - qRound(gc->FontSize / 10.0), 10, 10, gc->LWidth, "None", gc->FillCol, !ScApp->view->Mpressed);
PageItem* ite = currDoc->Items.at(z);
PageItem* ite = currDoc->Items->at(z);
ite->Extra = 0;
ite->TExtra = 0;
ite->BExtra = 0;
/branches/Version13x/Scribus/scribus/plugins/fileloader/oodraw/oodrawimp.cpp
526,7 → 526,7
h = parseUnit(b.attribute("svg:height"));
double corner = parseUnit(b.attribute("draw:corner-radius"));
z = Doku->itemAdd(PageItem::Polygon, PageItem::Rectangle, BaseX+x, BaseY+y, w, h, lwidth, FillColor, StrokeColor, !ScApp->view->Mpressed);
PageItem* ite = Doku->Items.at(z);
PageItem* ite = Doku->Items->at(z);
if (corner != 0)
{
ite->RadRect = corner;
549,7 → 549,7
double x2 = b.attribute( "svg:x2" ).isEmpty() ? 0.0 : parseUnit( b.attribute( "svg:x2" ) );
double y2 = b.attribute( "svg:y2" ).isEmpty() ? 0.0 : parseUnit( b.attribute( "svg:y2" ) );
z = Doku->itemAdd(PageItem::Polygon, PageItem::Unspecified, BaseX, BaseY, 10, 10, lwidth, "None", StrokeColor, !ScApp->view->Mpressed);
PageItem* ite = Doku->Items.at(z);
PageItem* ite = Doku->Items->at(z);
ite->PoLine.resize(4);
ite->PoLine.setPoint(0, FPoint(x1, y1));
ite->PoLine.setPoint(1, FPoint(x1, y1));
569,7 → 569,7
else if ( STag == "draw:polygon" )
{
z = Doku->itemAdd(PageItem::Polygon, PageItem::Unspecified, BaseX, BaseY, 10, 10, lwidth, FillColor, StrokeColor, !ScApp->view->Mpressed);
PageItem* ite = Doku->Items.at(z);
PageItem* ite = Doku->Items->at(z);
ite->PoLine.resize(0);
appendPoints(&ite->PoLine, b);
FPoint wh = getMaxClipF(&ite->PoLine);
586,7 → 586,7
else if( STag == "draw:polyline" )
{
z = Doku->itemAdd(PageItem::PolyLine, PageItem::Unspecified, BaseX, BaseY, 10, 10, lwidth, "None", StrokeColor, !ScApp->view->Mpressed);
PageItem* ite = Doku->Items.at(z);
PageItem* ite = Doku->Items->at(z);
ite->PoLine.resize(0);
appendPoints(&ite->PoLine, b);
FPoint wh = getMaxClipF(&ite->PoLine);
603,7 → 603,7
else if( STag == "draw:path" )
{
z = Doku->itemAdd(PageItem::Polygon, PageItem::Unspecified, BaseX, BaseY, 10, 10, lwidth, FillColor, StrokeColor, !ScApp->view->Mpressed);
PageItem* ite = Doku->Items.at(z);
PageItem* ite = Doku->Items->at(z);
ite->PoLine.resize(0);
if (parseSVG( b.attribute( "svg:d" ), &ite->PoLine ))
ite->convertTo(PageItem::PolyLine);
655,7 → 655,7
}
if (z != -1)
{
PageItem* ite = Doku->Items.at(z);
PageItem* ite = Doku->Items->at(z);
ite->Extra = 0;
ite->TExtra = 0;
ite->BExtra = 0;
/branches/Version13x/Scribus/scribus/plugins/short-words/parse.cpp
127,10 → 127,10
void SWParse::parsePage(int page)
{
uint cnt = 0;
uint docItemsCount=ScApp->doc->Items.count();
uint docItemsCount=ScApp->doc->Items->count();
for (uint a = 0; a < docItemsCount; ++a)
{
PageItem* b = ScApp->doc->Items.at(a);
PageItem* b = ScApp->doc->Items->at(a);
if (b->OwnPage == page)
++cnt;
}
139,7 → 139,7
uint i = 0;
for (uint a = 0; a < docItemsCount; ++a)
{
PageItem* b = ScApp->doc->Items.at(a);
PageItem* b = ScApp->doc->Items->at(a);
if (b->OwnPage == page)
{
ScApp->mainWindowProgressBar->setProgress(++i);
/branches/Version13x/Scribus/scribus/plugins/psimport/importps.cpp
364,7 → 364,7
else
//z = ScApp->view->PaintPolyLine(0, 0, 10, 10, LineW, CurrColor, "None");
z = ScApp->doc->itemAdd(PageItem::PolyLine, PageItem::Unspecified, 0, 0, 10, 10, LineW, CurrColor, "None", !ScApp->view->Mpressed);
ite = ScApp->doc->Items.at(z);
ite = ScApp->doc->Items->at(z);
ite->PoLine = Coords.copy();
ite->PoLine.translate(ScApp->doc->currentPage->xOffset(), ScApp->doc->currentPage->yOffset());
ite->ClipEdited = true;
406,7 → 406,7
else
//z = ScApp->view->PaintPolyLine(0, 0, 10, 10, LineW, "None", CurrColor);
z = Doku->itemAdd(PageItem::PolyLine, PageItem::Unspecified, 0, 0, 10, 10, LineW, "None", CurrColor, !ScApp->view->Mpressed);
ite = Doku->Items.at(z);
ite = Doku->Items->at(z);
ite->PoLine = Coords.copy();
ite->PoLine.translate(Doku->currentPage->xOffset(), Doku->currentPage->yOffset());
ite->ClipEdited = true;
/branches/Version13x/Scribus/scribus/selfield.cpp
22,9 → 22,9
Layout1->addWidget( Text1 );
AvailFields = new QListBox( this, "AvailFields" );
AvailFields->setMinimumSize( QSize( 130, 180 ) );
for (uint se = 0; se < Doc->Items.count(); ++se)
for (uint se = 0; se < Doc->Items->count(); ++se)
{
PageItem* item = Doc->Items.at(se);
PageItem* item = Doc->Items->at(se);
if (Art < 2)
{
if ((item->isAnnotation) && (item->AnType > 1))
/branches/Version13x/Scribus/scribus/pslib.cpp
1820,7 → 1820,7
if (!a->PageNam.isEmpty())
PItems = Doc->MasterItems;
else
PItems = Doc->Items;
PItems = Doc->DocItems;
if (ll.isPrintable)
{
for (b = 0; b < PItems.count(); ++b)