Subversion Repositories Scribus

Compare Revisions

Ignore whitespace Rev 4678 → Rev 4679

/branches/Version13x/Scribus/scribus/fileloader.cpp
506,21 → 506,6
doc->Layers.append(la);
}
}
if(pg.tagName()=="Bookmark")
{
bok.Title = pg.attribute("Title");
bok.Text = pg.attribute("Text");
bok.Aktion = pg.attribute("Aktion");
bok.ItemNr = pg.attribute("ItemNr").toInt();
bok.Seite = pg.attribute("Seite").toInt();
bok.Element = pg.attribute("Element").toInt();
bok.First = pg.attribute("First").toInt();
bok.Last = pg.attribute("Last").toInt();
bok.Prev = pg.attribute("Prev").toInt();
bok.Next = pg.attribute("Next").toInt();
bok.Parent = pg.attribute("Parent").toInt();
doc->BookMarks.append(bok);
}
if(pg.tagName()=="MultiLine")
{
multiLine ml;
754,6 → 739,26
}
PAGE=PAGE.nextSibling();
}
PAGE=DOC.firstChild();
while(!PAGE.isNull())
{
QDomElement pg=PAGE.toElement();
if(pg.tagName()=="Bookmark")
{
bok.Title = pg.attribute("Title");
bok.Text = pg.attribute("Text");
bok.Aktion = pg.attribute("Aktion");
bok.ItemNr = pg.attribute("ItemNr").toInt();
bok.PageObject = doc->Items->at(pg.attribute("Element").toInt());
bok.First = pg.attribute("First").toInt();
bok.Last = pg.attribute("Last").toInt();
bok.Prev = pg.attribute("Prev").toInt();
bok.Next = pg.attribute("Next").toInt();
bok.Parent = pg.attribute("Parent").toInt();
doc->BookMarks.append(bok);
}
PAGE=PAGE.nextSibling();
}
DOC=DOC.nextSibling();
}
if (TableItems.count() != 0)
1223,7 → 1228,7
la.isPrintable = pg.attribute("DRUCKEN").toInt();
doc->Layers.append(la);
}
if(pg.tagName()=="Bookmark")
/* if(pg.tagName()=="Bookmark")
{
bok.Title = pg.attribute("Title");
bok.Text = pg.attribute("Text");
1237,7 → 1242,7
bok.Next = pg.attribute("Next").toInt();
bok.Parent = pg.attribute("Parent").toInt();
doc->BookMarks.append(bok);
}
} */
if(pg.tagName()=="MultiLine")
{
multiLine ml;
1694,6 → 1699,26
}
PAGE=PAGE.nextSibling();
}
PAGE=DOC.firstChild();
while(!PAGE.isNull())
{
QDomElement pg=PAGE.toElement();
if(pg.tagName()=="Bookmark")
{
bok.Title = pg.attribute("Title");
bok.Text = pg.attribute("Text");
bok.Aktion = pg.attribute("Aktion");
bok.ItemNr = pg.attribute("ItemNr").toInt();
bok.PageObject = doc->Items->at(pg.attribute("Element").toInt());
bok.First = pg.attribute("First").toInt();
bok.Last = pg.attribute("Last").toInt();
bok.Prev = pg.attribute("Prev").toInt();
bok.Next = pg.attribute("Next").toInt();
bok.Parent = pg.attribute("Parent").toInt();
doc->BookMarks.append(bok);
}
PAGE=PAGE.nextSibling();
}
DOC=DOC.nextSibling();
}
if (TableItems.count() != 0)
2062,7 → 2087,6
currItem->isBookmark = obj->attribute("BOOKMARK").toInt();
if ((currItem->isBookmark) && (doc->BookMarks.count() == 0))
doc->OldBM = true;
currItem->BMnr = obj->attribute("BookNr", "0").toInt();
currItem->textAlignment = obj->attribute("ALIGN", "0").toInt();
currItem->setImageFlippedH(obj->attribute("FLIPPEDH").toInt());
currItem->setImageFlippedV(obj->attribute("FLIPPEDV").toInt());
/branches/Version13x/Scribus/scribus/pdflib.cpp
1107,8 → 1107,9
PutPage("q\n");
if (((ite->fillTransparency() != 0) || (ite->lineTransparency() != 0)) && (Options.Version >= 14))
PutPage(PDF_Transparenz(ite));
if ((ite->isBookmark) && (Options.Bookmarks))
PDF_Bookmark(ite->BMnr, pag->height() - (ite->yPos() - pag->yOffset()));
/* Bookmarks on Master Pages do not make any sense */
// if ((ite->isBookmark) && (Options.Bookmarks))
// PDF_Bookmark(ite, pag->height() - (ite->yPos() - pag->yOffset()));
if (!ite->printable() || ((ite->itemType() == PageItem::TextFrame) && (!pag->PageNam.isEmpty())))
{
PutPage("Q\n");
2152,7 → 2153,7
if (((ite->fillTransparency() != 0) || (ite->lineTransparency() != 0)) && (Options.Version >= 14))
tmp += PDF_Transparenz(ite);
if ((ite->isBookmark) && (Options.Bookmarks))
PDF_Bookmark(ite->BMnr, pag->height() - (ite->yPos() - pag->yOffset()));
PDF_Bookmark(ite, pag->height() - (ite->yPos() - pag->yOffset()));
if (!ite->printable() || ((ite->itemType() == PageItem::TextFrame) && (!pag->PageNam.isEmpty())))
{
tmp += "Q\n";
4478,9 → 4479,9
PutDoc(">>\nstream\n"+EncStream(im, ObjCounter-1)+"\nendstream\nendobj\n");
}
 
void PDFlib::PDF_Bookmark(int nr, double ypos)
void PDFlib::PDF_Bookmark(PageItem *currItem, double ypos)
{
Bvie->SetAction(nr, "/XYZ 0 "+FToStr(ypos)+" 0]");
Bvie->SetAction(currItem, "/XYZ 0 "+FToStr(ypos)+" 0]");
BookMinUse = true;
}
 
5049,8 → 5050,8
Inhal += "/Last "+QString::number(ip->Last+Basis)+" 0 R\n";
if (ip->firstChild())
Inhal += "/Count -"+QString::number(ip->childCount())+"\n";
if (ip->Seite < static_cast<int>(PageTree.Kids.count()))
Inhal += "/Dest ["+QString::number(PageTree.Kids[ip->Seite])+" 0 R "+ip->Action+"\n";
if ((ip->PageObject->OwnPage != -1) && (ip->PageObject->OwnPage < static_cast<int>(PageTree.Kids.count())))
Inhal += "/Dest ["+QString::number(PageTree.Kids[ip->PageObject->OwnPage])+" 0 R "+ip->Action+"\n";
Inhal += ">>\nendobj\n";
Inha[ip->ItemNr] = Inhal;
}
/branches/Version13x/Scribus/scribus/scribusdoc.cpp
3470,13 → 3470,10
{
Items->prepend(selection->itemAt(Oindex[c]));
}
/*
for (uint a = 0; a < Items->count(); ++a)
{
Items->at(a)->ItemNr = a;
if (Items->at(a)->isBookmark)
emit NewBMNr(Items->at(a)->BMnr, a);
}*/
}
return true;
}
return false;
3503,14 → 3500,10
{
Items->append(selection->itemAt(Oindex[c]));
}
/*
for (uint a = 0; a < Items->count(); ++a)
{
Items->at(a)->ItemNr = a;
if (Items->at(a)->isBookmark)
emit NewBMNr(Items->at(a)->BMnr, a);
}
*/
return true;
}
return false;
/branches/Version13x/Scribus/scribus/scribusview.h
397,7 → 397,6
void Amode(int);
void AddBM(PageItem *);
void DelBM(PageItem *);
void NewBMNr(int, int);
void ChBMText(PageItem *);
void ToScrap(QString);
void LoadElem(QString, double, double, bool, bool, ScribusDoc *, ScribusView *);
/branches/Version13x/Scribus/scribus/bookmwin.h
46,14 → 46,13
BookMItem(QListViewItem* parent, QListViewItem* after, struct ScribusDoc::BookMa *Bm);
BookMItem(QListView* parent, QListViewItem* after, struct ScribusDoc::BookMa *Bm);
BookMItem(QListView* parent, struct ScribusDoc::BookMa *Bm);
BookMItem(QListView* parent, QListViewItem* after, int nr, int s, int el);
BookMItem(QListView* parent, int nr, int s, int el);
BookMItem(QListView* parent, QListViewItem* after, int nr, PageItem *PObject);
BookMItem(QListView* parent, int nr, PageItem *PObject);
~BookMItem() {};
void SetUp(struct ScribusDoc::BookMa *Bm);
virtual QString key(int, bool) const;
PageItem *PageObject;
int ItemNr;
int Seite;
int Element;
int PdfObj;
QString Action;
QString Titel;
71,9 → 70,9
public:
BookMView(QWidget* parent);
~BookMView() {};
void AddItem(QString text, QString Tit, int s, int el);
void DeleteItem(int nr);
void SetAction(int nr, QString Act);
void AddItem(QString text, QString Tit, PageItem *PageObject);
void DeleteItem(PageItem *PageObject);
void SetAction(PageItem *currItem, QString Act);
int NrItems;
bool Mpressed;
QPoint Mpos;
83,7 → 82,6
 
public slots:
void AddPageItem(PageItem* ite);
void ChangeItem(int nr, int itnr);
void ChangeText(PageItem *currItem);
void languageChange();
 
90,7 → 88,7
signals:
void MarkMoved();
void ChangeBMNr(int, int, int);
void SelectElement(int, int);
void SelectElement(PageItem *);
 
protected:
void contentsMouseReleaseEvent(QMouseEvent *m);
/branches/Version13x/Scribus/scribus/scribusXml.cpp
932,21 → 932,6
doc->Layers.append(la);
}
}
if(pg.tagName()=="Bookmark")
{
bok.Title = pg.attribute("Title");
bok.Text = pg.attribute("Text");
bok.Aktion = pg.attribute("Aktion");
bok.ItemNr = pg.attribute("ItemNr").toInt();
bok.Seite = pg.attribute("Seite").toInt();
bok.Element = pg.attribute("Element").toInt();
bok.First = pg.attribute("First").toInt();
bok.Last = pg.attribute("Last").toInt();
bok.Prev = pg.attribute("Prev").toInt();
bok.Next = pg.attribute("Next").toInt();
bok.Parent = pg.attribute("Parent").toInt();
doc->BookMarks.append(bok);
}
if(pg.tagName()=="MultiLine")
{
multiLine ml;
1049,7 → 1034,6
OB.isBookmark=obj.attribute("BOOKMARK").toInt();
if ((OB.isBookmark) && (doc->BookMarks.count() == 0))
doc->OldBM = true;
OB.BMnr = obj.attribute("BookNr", "0").toInt();
OB.textAlignment = DoVorl[obj.attribute("ALIGN", "0").toInt()].toUInt();
tmpf = obj.attribute("IFONT", doc->toolSettings.defFont);
if (tmpf.isEmpty())
1077,22 → 1061,22
}
else
OB.Groups.clear();
QDomNode IT=OBJ.firstChild();
while(!IT.isNull())
{
QDomElement it=IT.toElement();
if (it.tagName()=="CSTOP")
QDomNode IT=OBJ.firstChild();
while(!IT.isNull())
{
QString name = it.attribute("NAME");
double ramp = it.attribute("RAMP", "0.0").toDouble();
int shade = it.attribute("SHADE", "100").toInt();
double opa = it.attribute("TRANS", "1").toDouble();
OB.fill_gradient.addStop(SetColor(doc, name, shade), ramp, 0.5, opa, name, shade);
OB.GrColor = "";
OB.GrColor2 = "";
QDomElement it=IT.toElement();
if (it.tagName()=="CSTOP")
{
QString name = it.attribute("NAME");
double ramp = it.attribute("RAMP", "0.0").toDouble();
int shade = it.attribute("SHADE", "100").toInt();
double opa = it.attribute("TRANS", "1").toDouble();
OB.fill_gradient.addStop(SetColor(doc, name, shade), ramp, 0.5, opa, name, shade);
OB.GrColor = "";
OB.GrColor2 = "";
}
IT=IT.nextSibling();
}
IT=IT.nextSibling();
}
OB.itemText = "";
view->PasteItem(&OB, true);
Neu = doc->Items->at(counter);
1170,11 → 1154,31
}
if (!Mpage)
view->reformPages();
PAGE=DOC.firstChild();
while(!PAGE.isNull())
{
QDomElement pg=PAGE.toElement();
if(pg.tagName()=="Bookmark")
{
bok.Title = pg.attribute("Title");
bok.Text = pg.attribute("Text");
bok.Aktion = pg.attribute("Aktion");
bok.ItemNr = pg.attribute("ItemNr").toInt();
bok.PageObject = doc->Items->at(pg.attribute("Element").toInt());
bok.First = pg.attribute("First").toInt();
bok.Last = pg.attribute("Last").toInt();
bok.Prev = pg.attribute("Prev").toInt();
bok.Next = pg.attribute("Next").toInt();
bok.Parent = pg.attribute("Parent").toInt();
doc->BookMarks.append(bok);
}
PAGE=PAGE.nextSibling();
}
return true;
}
PAGE=PAGE.nextSibling();
PAGE=PAGE.nextSibling();
}
DOC=DOC.nextSibling();
DOC=DOC.nextSibling();
}
return false;
}
1428,21 → 1432,6
la.isPrintable = pg.attribute("DRUCKEN").toInt();
doc->Layers.append(la);
}
if(pg.tagName()=="Bookmark")
{
bok.Title = pg.attribute("Title");
bok.Text = pg.attribute("Text");
bok.Aktion = pg.attribute("Aktion");
bok.ItemNr = pg.attribute("ItemNr").toInt();
bok.Seite = pg.attribute("Seite").toInt();
bok.Element = pg.attribute("Element").toInt();
bok.First = pg.attribute("First").toInt();
bok.Last = pg.attribute("Last").toInt();
bok.Prev = pg.attribute("Prev").toInt();
bok.Next = pg.attribute("Next").toInt();
bok.Parent = pg.attribute("Parent").toInt();
doc->BookMarks.append(bok);
}
if(pg.tagName()=="MultiLine")
{
multiLine ml;
1549,7 → 1538,6
OB.isBookmark=obj.attribute("BOOKMARK").toInt();
if ((OB.isBookmark) && (doc->BookMarks.count() == 0))
doc->OldBM = true;
OB.BMnr = obj.attribute("BookNr", "0").toInt();
OB.textAlignment = obj.attribute("ALIGN", "0").toInt();
OB.startArrowIndex = 0;
OB.endArrowIndex = 0;
1669,6 → 1657,20
while(!PAGE.isNull())
{
QDomElement pg=PAGE.toElement();
if(pg.tagName()=="Bookmark")
{
bok.Title = pg.attribute("Title");
bok.Text = pg.attribute("Text");
bok.Aktion = pg.attribute("Aktion");
bok.ItemNr = pg.attribute("ItemNr").toInt();
bok.PageObject = doc->Items->at(pg.attribute("Element").toInt());
bok.First = pg.attribute("First").toInt();
bok.Last = pg.attribute("Last").toInt();
bok.Prev = pg.attribute("Prev").toInt();
bok.Next = pg.attribute("Next").toInt();
bok.Parent = pg.attribute("Parent").toInt();
doc->BookMarks.append(bok);
}
if(pg.tagName()=="PDF")
{
doc->PDF_Options.Articles = static_cast<bool>(pg.attribute("Articles").toInt());
2027,7 → 2029,6
OB.NamedLStyle = pg.attribute("NAMEDLST", "");
if (!doc->MLineStyles.contains(OB.NamedLStyle))
OB.NamedLStyle = "";
OB.BMnr = 0;
OB.textAlignment = DoVorl[pg.attribute("ALIGN", "0").toInt()].toUInt();
tmf = pg.attribute("IFONT", doc->toolSettings.defFont);
if (tmf.isEmpty())
2826,7 → 2827,6
}
ob.setAttribute("ALIGN",item->textAlignment);
ob.setAttribute("BOOKMARK", item->isBookmark ? 1 : 0);
ob.setAttribute("BookNr", item->BMnr);
for(uint k=0;k<item->itemText.count();++k)
{
ScText *itemTextAtK = item->itemText.at(k);
3247,8 → 3247,7
fn.setAttribute("Text",(*itbm).Text);
fn.setAttribute("Aktion",(*itbm).Aktion);
fn.setAttribute("ItemNr", (*itbm).ItemNr);
fn.setAttribute("Seite", (*itbm).Seite);
fn.setAttribute("Element", (*itbm).Element);
fn.setAttribute("Element", (*itbm).PageObject->ItemNr);
fn.setAttribute("First", (*itbm).First);
fn.setAttribute("Last", (*itbm).Last);
fn.setAttribute("Prev", (*itbm).Prev);
/branches/Version13x/Scribus/scribus/pageitem.h
381,7 → 381,6
StoryText itemText;
/** Flag fuer PDF-Bookmark */
bool isBookmark;
int BMnr;
/** Flag fuer neuzeichnen im EditMode */
bool Dirty;
/** Flag fuer Auswahl */
/branches/Version13x/Scribus/scribus/scribusstructs.h
80,11 → 80,8
bool PicArt;
bool flippedH;
bool flippedV;
/* double BBoxX;
double BBoxH; */
bool isPrintable;
bool isBookmark;
int BMnr;
bool m_isAnnotation;
Annotation m_annotation;
QString AnName;
/branches/Version13x/Scribus/scribus/pageitem.cpp
128,7 → 128,6
CPos(other.CPos),
itemText(other.itemText),
isBookmark(other.isBookmark),
BMnr(other.BMnr),
HasSel(other.HasSel),
FrameOnly(other.FrameOnly),
BackBox(other.BackBox),
368,7 → 367,6
PicAvail = false;
isPrintable = true;
isBookmark = false;
BMnr = 0;
m_isAnnotation = false;
/*
m_annotation.setType(0);
2971,7 → 2969,7
Buffer->BBoxH = BBoxH; */
Buffer->isPrintable = printable();
Buffer->isBookmark = isBookmark;
Buffer->BMnr = BMnr;
// Buffer->BMnr = BMnr;
Buffer->m_isAnnotation = m_isAnnotation;
Buffer->m_annotation = m_annotation;
/*
/branches/Version13x/Scribus/scribus/pdflib.h
104,7 → 104,7
void WritePDFStream(const QString& cc);
QString PDFEncode(const QString & in);
QByteArray ComputeMD5(const QString& in);
void PDF_Bookmark(int nr, double ypos);
void PDF_Bookmark(PageItem *currItem, double ypos);
QString PDF_Gradient(PageItem *currItem);
QString PDF_DoLinGradient(PageItem *currItem, QValueList<double> Stops, QValueList<double> Trans, const QStringList& Colors);
QString PDF_Transparenz(PageItem *currItem);
/branches/Version13x/Scribus/scribus/scribusdoc.h
735,9 → 735,8
QString Title;
QString Text;
QString Aktion;
PageItem *PageObject;
int Parent;
int Seite;
int Element;
int ItemNr;
int First;
int Last;
/branches/Version13x/Scribus/scribus/scribusview.cpp
4217,12 → 4217,6
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)
{
Doc->Items->at(al)->ItemNr = al;
if (Doc->Items->at(al)->isBookmark)
emit NewBMNr(Doc->Items->at(al)->BMnr, al);
}
}
currItem->PoLine = cli.copy();
}
4618,12 → 4612,7
ss=NULL;
if (Doc->docHyphenator->AutoCheck)
Doc->docHyphenator->slotHyphenate(currItem);
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);
}
emit ChBMText(currItem);
ScMW->outlinePalette->BuildTree();
}
else
4722,12 → 4711,6
{
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);
}
}
updateContents();
emit DocChanged();
7857,13 → 7840,6
{
if (Doc->sendItemSelectionToBack())
{
//CB TODO move this loop out of here
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);
}
ScMW->outlinePalette->BuildTree();
emit LevelChanged(0);
emit DocChanged();
7875,13 → 7851,6
{
if (Doc->bringItemSelectionToFront())
{
//CB TODO move this loop out of here
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);
}
ScMW->outlinePalette->BuildTree();
emit LevelChanged(Doc->selection->itemAt(0)->ItemNr);
emit DocChanged();
7937,8 → 7906,6
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);
}
ScMW->outlinePalette->BuildTree();
if (wasGUISelection)
8000,8 → 7967,6
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);
}
ScMW->outlinePalette->BuildTree();
if (wasGUISelection)
8147,13 → 8112,11
undoManager->action(target, is, currItem->getUPixmap());
}
}
for (a = 0; a < Doc->Items->count(); ++a)
Doc->updateFrameItems();
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->updateFrameItems();
if (docSelectionCount > 1)
undoManager->commit();
updateContents();
9290,7 → 9253,7
currItem->PLineJoin = PenJoinStyle(Buffer->PLineJoin);
currItem->setPrintable(Buffer->isPrintable);
currItem->isBookmark = Buffer->isBookmark;
currItem->BMnr = Buffer->BMnr;
// currItem->BMnr = Buffer->BMnr;
currItem->setIsAnnotation(Buffer->m_isAnnotation);
currItem->setAnnotation(Buffer->m_annotation);
if (!Buffer->AnName.isEmpty())
9438,8 → 9401,6
emit DocChanged();
updateContents();
}
/* if ((currItem->isBookmark) && (!loading))
emit NewBMNr(currItem->BMnr, z); */
}
 
void ScribusView::QueryFarben()
/branches/Version13x/Scribus/scribus/bookmwin.cpp
51,11 → 51,10
SetUp(Bm);
}
 
BookMItem::BookMItem(QListView* parent, QListViewItem* after, int nr, int s, int el) : QListViewItem(parent, after)
BookMItem::BookMItem(QListView* parent, QListViewItem* after, int nr, PageItem* PObject) : QListViewItem(parent, after)
{
ItemNr = nr;
Seite = s;
Element = el;
PageObject = PObject;
PdfObj = 0;
Action = "";
First = 0;
65,11 → 64,10
Pare = 0;
}
 
BookMItem::BookMItem(QListView* parent, int nr, int s, int el) : QListViewItem(parent)
BookMItem::BookMItem(QListView* parent, int nr, PageItem* PObject) : QListViewItem(parent)
{
ItemNr = nr;
Seite = s;
Element = el;
PageObject = PObject;
PdfObj = 0;
Action = "";
First = 0;
82,8 → 80,6
void BookMItem::SetUp(struct ScribusDoc::BookMa *Bm)
{
ItemNr = Bm->ItemNr;
Seite = Bm->Seite;
Element = Bm->Element;
PdfObj = 0;
Action = Bm->Aktion;
First = Bm->First;
92,6 → 88,7
Next = Bm->Next;
Pare = Bm->Parent;
Titel = Bm->Title;
PageObject = Bm->PageObject;
setText(0, Bm->Text);
}
 
137,8 → 134,7
bm += cc;
bm2 += cc;
}
AddItem(bm, bm2, ite->OwnPage, ite->ItemNr);
ite->BMnr = NrItems;
AddItem(bm, bm2, ite);
Last = NrItems;
}
 
155,7 → 151,7
{
BookMItem *ip;
ip = (BookMItem*)i;
emit SelectElement(ip->Seite, ip->Element);
emit SelectElement(ip->PageObject);
}
}
}
393,7 → 389,7
e->ignore();
}
 
void BookMView::AddItem(QString text, QString Tit, int s, int el)
void BookMView::AddItem(QString text, QString Tit, PageItem *PageObject)
{
QListViewItem *lv = firstChild();
while (lv)
405,9 → 401,9
BookMItem *ip;
BookMItem *ite;
if (lv)
ite = new BookMItem(this, lv, NrItems+1, s, el);
ite = new BookMItem(this, lv, NrItems+1, PageObject);
else
ite = new BookMItem(this, NrItems+1, s, el);
ite = new BookMItem(this, NrItems+1, PageObject);
ite->setText(0, text);
ite->Titel = Tit;
ite->Next = 0;
420,9 → 416,20
NrItems++;
}
 
void BookMView::DeleteItem(int nr)
void BookMView::DeleteItem(PageItem *pObject)
{
BookMItem *ite;
int nr;
QListViewItemIterator itx(this);
for ( ; itx.current(); ++itx)
{
ite = (BookMItem*)itx.current();
if (ite->PageObject == pObject)
{
nr = ite->ItemNr;
break;
}
}
BookMItem *ite2 = 0;
BookMItem *ite3;
BookMItem *ite4;
485,11 → 492,10
ite->Prev = Tabl[ite->Prev];
ite->First = Tabl[ite->First];
ite->Last = Tabl[ite->Last];
emit ChangeBMNr(ite->Seite, ite->Element, ite->ItemNr);
}
}
 
void BookMView::ChangeItem(int nr, int itnr)
void BookMView::SetAction(PageItem *currItem, QString Act)
{
BookMItem *ite;
QListViewItemIterator it(this);
496,23 → 502,8
for ( ; it.current(); ++it)
{
ite = (BookMItem*)it.current();
if (ite->ItemNr == nr)
if (ite->PageObject == currItem)
{
ite->Element = itnr;
break;
}
}
}
 
void BookMView::SetAction(int nr, QString Act)
{
BookMItem *ite;
QListViewItemIterator it(this);
for ( ; it.current(); ++it)
{
ite = (BookMItem*)it.current();
if (ite->ItemNr == nr)
{
ite->Action = Act;
break;
}
525,7 → 516,6
QString bm = "";
QString bm2 = "";
QString cc;
int nr = currItem->BMnr;
for (uint d = 0; d < currItem->itemText.count(); ++d)
{
cc = currItem->itemText.at(d)->ch;
540,7 → 530,7
for ( ; it.current(); ++it)
{
ite = (BookMItem*)it.current();
if (ite->ItemNr == nr)
if (ite->PageObject == currItem)
{
ite->setText(0, bm);
ite->Titel = bm2;
/branches/Version13x/Scribus/scribus/scribus.cpp
555,8 → 555,7
connect(layerPalette, SIGNAL(LayerChanged()), this, SLOT(showLayer()));
 
connect(bookmarkPalette->BView, SIGNAL(MarkMoved()), this, SLOT(StoreBookmarks()));
connect(bookmarkPalette->BView, SIGNAL(ChangeBMNr(int, int, int)), this, SLOT(ChBookmarks(int, int, int)));
connect(bookmarkPalette->BView, SIGNAL(SelectElement(int, int)), this, SLOT(selectItemsFromOutlines(int, int)));
connect(bookmarkPalette->BView, SIGNAL(SelectElement(PageItem *)), this, SLOT(selectItemsFromOutlines(PageItem *)));
}
 
void ScribusMainWindow::initScrapbook()
2246,7 → 2245,6
connect(view, SIGNAL(ItemPos(double, double)), propertiesPalette, SLOT(setXY(double, double)));
connect(view, SIGNAL(ItemGeom(double, double)), propertiesPalette, SLOT(setBH(double, double)));
connect(view, SIGNAL(ChBMText(PageItem *)), this, SLOT(BookMarkTxT(PageItem *)));
connect(view, SIGNAL(NewBMNr(int, int)), bookmarkPalette->BView, SLOT(ChangeItem(int, int)));
connect(view, SIGNAL(HaveSel(int)), this, SLOT(HaveNewSel(int)));
connect(view, SIGNAL(SetAngle(double)), propertiesPalette, SLOT(setR(double)));
connect(view, SIGNAL(SetSizeValue(double)), propertiesPalette, SLOT(setSvalue(double)));
3648,11 → 3646,10
doc->docHyphenator->slotHyphenate(currItem);
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);
bookmarkPalette->BView->ChangeText(doc->Items->at(a));
}
outlinePalette->BuildTree();
// outlinePalette->BuildTree();
view->DrawNew();
slotDocCh();
}
4869,8 → 4866,6
bool setter = doc->DocPages.count() > 1 ? true : false;
scrActions["pageDelete"]->setEnabled(setter);
scrActions["pageMove"]->setEnabled(setter);
if ((!doc->isLoading()) && (!doc->masterPageMode()))
AdjustBM();
/* if ((!doc->loading) && (!doc->masterPageMode))
{
AdjustBM();
5583,29 → 5578,6
}
}
 
void ScribusMainWindow::AdjustBM()
{
for (uint b = 0; b < doc->Items->count(); ++b)
{
PageItem* bb = doc->Items->at(b);
if (bb->isBookmark)
{
int it = bb->BMnr;
QListViewItemIterator itn(bookmarkPalette->BView);
for ( ; itn.current(); ++itn)
{
BookMItem *ite = (BookMItem*)itn.current();
if (ite->ItemNr == it)
{
ite->Seite = bb->OwnPage;
break;
}
}
}
}
StoreBookmarks();
}
 
void ScribusMainWindow::DeletePage2(int pg)
{
PageItem* ite;
5655,7 → 5627,6
view->pageSelector->GotoPg(0);
connect(view->pageSelector, SIGNAL(GotoPage(int)), view, SLOT(GotoPa(int)));
view->reformPages();
AdjustBM();
view->DrawNew();
doc->OpenNodes.clear();
outlinePalette->BuildTree();
5701,7 → 5672,6
doc->selection->addItem(ite);
}
}
AdjustBM();
}
if (doc->selection->count() != 0)
view->DeleteItem();
5762,7 → 5732,6
}
slotDocCh();
view->DrawNew();
AdjustBM();
pagePalette->RebuildPage();
outlinePalette->BuildTree();
outlinePalette->reopenTree(doc->OpenNodes);
5786,7 → 5755,6
slotDocCh();
pagePalette->RebuildPage();
outlinePalette->BuildTree();
AdjustBM();
}
delete dia;
}
6746,6 → 6714,12
delete dia;
}
 
void ScribusMainWindow::selectItemsFromOutlines(PageItem* ite)
{
int d = doc->Items->findRef(ite);
selectItemsFromOutlines(ite->OwnPage, d, true);
}
 
void ScribusMainWindow::selectItemsFromOutlines(int Page, int Item, bool single)
{
NoFrameEdit();
7244,7 → 7218,7
 
void ScribusMainWindow::DelBookMark(PageItem *ite)
{
bookmarkPalette->BView->DeleteItem(ite->BMnr);
bookmarkPalette->BView->DeleteItem(ite);
StoreBookmarks();
}
 
7254,11 → 7228,6
StoreBookmarks();
}
 
void ScribusMainWindow::ChBookmarks(int /*s*/, int /*e*/, int /*n*/)
{
// view->Pages.at(s)->Items.at(e)->BMnr = n;
}
 
void ScribusMainWindow::RestoreBookMarks()
{
QValueList<ScribusDoc::BookMa>::Iterator it2 = doc->BookMarks.begin();
7331,8 → 7300,9
Boma.Text = ip->text(0);
Boma.Aktion = ip->Action;
Boma.ItemNr = ip->ItemNr;
Boma.Seite = ip->Seite;
Boma.Element = ip->Element;
Boma.PageObject = ip->PageObject;
// Boma.Seite = ip->Seite;
// Boma.Element = ip->Element;
Boma.Parent = ip->Pare;
Boma.First = ip->First;
Boma.Prev = ip->Prev;
/branches/Version13x/Scribus/scribus/plugins/scriptplugin/scripter2/scripter2_scribus_pageitem.cpp
133,7 → 133,6
.def_readwrite("ContourLine", &PageItem::ContourLine)
.def_readwrite("imageClip", &PageItem::imageClip)
.def_readwrite("PoLine", &PageItem::PoLine)
.def_readwrite("BMnr", &PageItem::BMnr)
.def_readwrite("BottomLinkID", &PageItem::BottomLinkID)
.def_readwrite("Cols", &PageItem::Cols)
.def_readwrite("CPos", &PageItem::CPos)
/branches/Version13x/Scribus/scribus/scribus.h
161,7 → 161,6
void recalcColors(QProgressBar *dia = 0);
void SwitchWin();
void RestoreBookMarks();
void AdjustBM();
void ReorgFonts();
 
void emergencySave();
265,7 → 264,6
void slotCharSelect();
void ImageEffects();
QString Collect(const bool compress = false, const bool withFonts = false, const QString& newDirectory=QString::null);
void ChBookmarks(int s, int e, int n);
void AddBookMark(PageItem *ite);
void DelBookMark(PageItem *ite);
void BookMarkTxT(PageItem *ite);
473,6 → 471,7
void saveLStyles(LineFormate *dia);
void setNewAbStyle(int a);
void setAbsValue(int a);
void selectItemsFromOutlines(PageItem *ite);
void selectItemsFromOutlines(int Page, int Item, bool single = false);
void selectPagesFromOutlines(int Page);
void doPrintPreview();
/branches/Version13x/Scribus/scribus/scpreview.cpp
243,11 → 243,8
OB.flippedV = pg.attribute("FLIPPEDV").toInt();
OB.ScaleType = pg.attribute("SCALETYPE", "1").toInt();
OB.AspectRatio = pg.attribute("RATIO", "0").toInt();
/* OB.BBoxX = pg.attribute("BBOXX").toDouble();
OB.BBoxH = pg.attribute("BBOXH").toDouble(); */
OB.isPrintable = pg.attribute("PRINTABLE").toInt();
OB.isBookmark = false;
OB.BMnr = 0;
OB.m_isAnnotation = pg.attribute("ANNOTATION", "0").toInt();
if (pg.attribute("TRANSPARENT", "0").toInt() == 1)
OB.Pcolor = CommonStrings::None;