Subversion Repositories Scribus

Compare Revisions

Ignore whitespace Rev 4679 → Rev 4678

/branches/Version13x/Scribus/scribus/fileloader.cpp
506,6 → 506,21
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;
739,26 → 754,6
}
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)
1228,7 → 1223,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");
1242,7 → 1237,7
bok.Next = pg.attribute("Next").toInt();
bok.Parent = pg.attribute("Parent").toInt();
doc->BookMarks.append(bok);
} */
}
if(pg.tagName()=="MultiLine")
{
multiLine ml;
1699,26 → 1694,6
}
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)
2087,6 → 2062,7
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/plugins/scriptplugin/scripter2/scripter2_scribus_pageitem.cpp
133,6 → 133,7
.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/scribusview.cpp
4217,6 → 4217,12
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();
}
4612,7 → 4618,12
ss=NULL;
if (Doc->docHyphenator->AutoCheck)
Doc->docHyphenator->slotHyphenate(currItem);
emit ChBMText(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);
}
ScMW->outlinePalette->BuildTree();
}
else
4711,6 → 4722,12
{
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();
7840,6 → 7857,13
{
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();
7851,6 → 7875,13
{
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();
7906,6 → 7937,8
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)
7967,6 → 8000,8
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)
8112,11 → 8147,13
undoManager->action(target, is, currItem->getUPixmap());
}
}
Doc->updateFrameItems();
for (uint 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->updateFrameItems();
if (docSelectionCount > 1)
undoManager->commit();
updateContents();
9253,7 → 9290,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())
9401,6 → 9438,8
emit DocChanged();
updateContents();
}
/* if ((currItem->isBookmark) && (!loading))
emit NewBMNr(currItem->BMnr, z); */
}
 
void ScribusView::QueryFarben()
/branches/Version13x/Scribus/scribus/scribusdoc.cpp
3470,10 → 3470,13
{
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;
3500,10 → 3503,14
{
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,6 → 397,7
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/scribusdoc.h
735,8 → 735,9
QString Title;
QString Text;
QString Aktion;
PageItem *PageObject;
int Parent;
int Seite;
int Element;
int ItemNr;
int First;
int Last;
/branches/Version13x/Scribus/scribus/scribus.cpp
555,7 → 555,8
connect(layerPalette, SIGNAL(LayerChanged()), this, SLOT(showLayer()));
 
connect(bookmarkPalette->BView, SIGNAL(MarkMoved()), this, SLOT(StoreBookmarks()));
connect(bookmarkPalette->BView, SIGNAL(SelectElement(PageItem *)), this, SLOT(selectItemsFromOutlines(PageItem *)));
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)));
}
 
void ScribusMainWindow::initScrapbook()
2245,6 → 2246,7
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)));
3646,10 → 3648,11
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->ChangeText(doc->Items->at(a));
bookmarkPalette->BView->ChangeItem(doc->Items->at(a)->BMnr, a);
}
// outlinePalette->BuildTree();
outlinePalette->BuildTree();
view->DrawNew();
slotDocCh();
}
4866,6 → 4869,8
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();
5578,6 → 5583,29
}
}
 
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;
5627,6 → 5655,7
view->pageSelector->GotoPg(0);
connect(view->pageSelector, SIGNAL(GotoPage(int)), view, SLOT(GotoPa(int)));
view->reformPages();
AdjustBM();
view->DrawNew();
doc->OpenNodes.clear();
outlinePalette->BuildTree();
5672,6 → 5701,7
doc->selection->addItem(ite);
}
}
AdjustBM();
}
if (doc->selection->count() != 0)
view->DeleteItem();
5732,6 → 5762,7
}
slotDocCh();
view->DrawNew();
AdjustBM();
pagePalette->RebuildPage();
outlinePalette->BuildTree();
outlinePalette->reopenTree(doc->OpenNodes);
5755,6 → 5786,7
slotDocCh();
pagePalette->RebuildPage();
outlinePalette->BuildTree();
AdjustBM();
}
delete dia;
}
6714,12 → 6746,6
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();
7218,7 → 7244,7
 
void ScribusMainWindow::DelBookMark(PageItem *ite)
{
bookmarkPalette->BView->DeleteItem(ite);
bookmarkPalette->BView->DeleteItem(ite->BMnr);
StoreBookmarks();
}
 
7228,6 → 7254,11
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();
7300,9 → 7331,8
Boma.Text = ip->text(0);
Boma.Aktion = ip->Action;
Boma.ItemNr = ip->ItemNr;
Boma.PageObject = ip->PageObject;
// Boma.Seite = ip->Seite;
// Boma.Element = ip->Element;
Boma.Seite = ip->Seite;
Boma.Element = ip->Element;
Boma.Parent = ip->Pare;
Boma.First = ip->First;
Boma.Prev = ip->Prev;
/branches/Version13x/Scribus/scribus/pageitem.h
381,6 → 381,7
StoryText itemText;
/** Flag fuer PDF-Bookmark */
bool isBookmark;
int BMnr;
/** Flag fuer neuzeichnen im EditMode */
bool Dirty;
/** Flag fuer Auswahl */
/branches/Version13x/Scribus/scribus/pageitem.cpp
128,6 → 128,7
CPos(other.CPos),
itemText(other.itemText),
isBookmark(other.isBookmark),
BMnr(other.BMnr),
HasSel(other.HasSel),
FrameOnly(other.FrameOnly),
BackBox(other.BackBox),
367,6 → 368,7
PicAvail = false;
isPrintable = true;
isBookmark = false;
BMnr = 0;
m_isAnnotation = false;
/*
m_annotation.setType(0);
2969,7 → 2971,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/scpreview.cpp
243,8 → 243,11
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;
/branches/Version13x/Scribus/scribus/scribus.h
161,6 → 161,7
void recalcColors(QProgressBar *dia = 0);
void SwitchWin();
void RestoreBookMarks();
void AdjustBM();
void ReorgFonts();
 
void emergencySave();
264,6 → 265,7
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);
471,7 → 473,6
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/pdflib.cpp
1107,9 → 1107,8
PutPage("q\n");
if (((ite->fillTransparency() != 0) || (ite->lineTransparency() != 0)) && (Options.Version >= 14))
PutPage(PDF_Transparenz(ite));
/* 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->isBookmark) && (Options.Bookmarks))
PDF_Bookmark(ite->BMnr, pag->height() - (ite->yPos() - pag->yOffset()));
if (!ite->printable() || ((ite->itemType() == PageItem::TextFrame) && (!pag->PageNam.isEmpty())))
{
PutPage("Q\n");
2153,7 → 2152,7
if (((ite->fillTransparency() != 0) || (ite->lineTransparency() != 0)) && (Options.Version >= 14))
tmp += PDF_Transparenz(ite);
if ((ite->isBookmark) && (Options.Bookmarks))
PDF_Bookmark(ite, pag->height() - (ite->yPos() - pag->yOffset()));
PDF_Bookmark(ite->BMnr, pag->height() - (ite->yPos() - pag->yOffset()));
if (!ite->printable() || ((ite->itemType() == PageItem::TextFrame) && (!pag->PageNam.isEmpty())))
{
tmp += "Q\n";
4479,9 → 4478,9
PutDoc(">>\nstream\n"+EncStream(im, ObjCounter-1)+"\nendstream\nendobj\n");
}
 
void PDFlib::PDF_Bookmark(PageItem *currItem, double ypos)
void PDFlib::PDF_Bookmark(int nr, double ypos)
{
Bvie->SetAction(currItem, "/XYZ 0 "+FToStr(ypos)+" 0]");
Bvie->SetAction(nr, "/XYZ 0 "+FToStr(ypos)+" 0]");
BookMinUse = true;
}
 
5050,8 → 5049,8
Inhal += "/Last "+QString::number(ip->Last+Basis)+" 0 R\n";
if (ip->firstChild())
Inhal += "/Count -"+QString::number(ip->childCount())+"\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";
if (ip->Seite < static_cast<int>(PageTree.Kids.count()))
Inhal += "/Dest ["+QString::number(PageTree.Kids[ip->Seite])+" 0 R "+ip->Action+"\n";
Inhal += ">>\nendobj\n";
Inha[ip->ItemNr] = Inhal;
}
/branches/Version13x/Scribus/scribus/scribusXml.cpp
932,6 → 932,21
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;
1034,6 → 1049,7
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())
1061,22 → 1077,22
}
else
OB.Groups.clear();
QDomNode IT=OBJ.firstChild();
while(!IT.isNull())
QDomNode IT=OBJ.firstChild();
while(!IT.isNull())
{
QDomElement it=IT.toElement();
if (it.tagName()=="CSTOP")
{
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();
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();
}
OB.itemText = "";
view->PasteItem(&OB, true);
Neu = doc->Items->at(counter);
1154,31 → 1170,11
}
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;
}
1432,6 → 1428,21
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;
1538,6 → 1549,7
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;
1657,20 → 1669,6
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());
2029,6 → 2027,7
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())
2827,6 → 2826,7
}
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,7 → 3247,8
fn.setAttribute("Text",(*itbm).Text);
fn.setAttribute("Aktion",(*itbm).Aktion);
fn.setAttribute("ItemNr", (*itbm).ItemNr);
fn.setAttribute("Element", (*itbm).PageObject->ItemNr);
fn.setAttribute("Seite", (*itbm).Seite);
fn.setAttribute("Element", (*itbm).Element);
fn.setAttribute("First", (*itbm).First);
fn.setAttribute("Last", (*itbm).Last);
fn.setAttribute("Prev", (*itbm).Prev);
/branches/Version13x/Scribus/scribus/scribusstructs.h
80,8 → 80,11
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/pdflib.h
104,7 → 104,7
void WritePDFStream(const QString& cc);
QString PDFEncode(const QString & in);
QByteArray ComputeMD5(const QString& in);
void PDF_Bookmark(PageItem *currItem, double ypos);
void PDF_Bookmark(int nr, 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/bookmwin.h
46,13 → 46,14
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, PageItem *PObject);
BookMItem(QListView* parent, int nr, PageItem *PObject);
BookMItem(QListView* parent, QListViewItem* after, int nr, int s, int el);
BookMItem(QListView* parent, int nr, int s, int el);
~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;
70,9 → 71,9
public:
BookMView(QWidget* parent);
~BookMView() {};
void AddItem(QString text, QString Tit, PageItem *PageObject);
void DeleteItem(PageItem *PageObject);
void SetAction(PageItem *currItem, QString Act);
void AddItem(QString text, QString Tit, int s, int el);
void DeleteItem(int nr);
void SetAction(int nr, QString Act);
int NrItems;
bool Mpressed;
QPoint Mpos;
82,6 → 83,7
 
public slots:
void AddPageItem(PageItem* ite);
void ChangeItem(int nr, int itnr);
void ChangeText(PageItem *currItem);
void languageChange();
 
88,7 → 90,7
signals:
void MarkMoved();
void ChangeBMNr(int, int, int);
void SelectElement(PageItem *);
void SelectElement(int, int);
 
protected:
void contentsMouseReleaseEvent(QMouseEvent *m);
/branches/Version13x/Scribus/scribus/bookmwin.cpp
51,10 → 51,11
SetUp(Bm);
}
 
BookMItem::BookMItem(QListView* parent, QListViewItem* after, int nr, PageItem* PObject) : QListViewItem(parent, after)
BookMItem::BookMItem(QListView* parent, QListViewItem* after, int nr, int s, int el) : QListViewItem(parent, after)
{
ItemNr = nr;
PageObject = PObject;
Seite = s;
Element = el;
PdfObj = 0;
Action = "";
First = 0;
64,10 → 65,11
Pare = 0;
}
 
BookMItem::BookMItem(QListView* parent, int nr, PageItem* PObject) : QListViewItem(parent)
BookMItem::BookMItem(QListView* parent, int nr, int s, int el) : QListViewItem(parent)
{
ItemNr = nr;
PageObject = PObject;
Seite = s;
Element = el;
PdfObj = 0;
Action = "";
First = 0;
80,6 → 82,8
void BookMItem::SetUp(struct ScribusDoc::BookMa *Bm)
{
ItemNr = Bm->ItemNr;
Seite = Bm->Seite;
Element = Bm->Element;
PdfObj = 0;
Action = Bm->Aktion;
First = Bm->First;
88,7 → 92,6
Next = Bm->Next;
Pare = Bm->Parent;
Titel = Bm->Title;
PageObject = Bm->PageObject;
setText(0, Bm->Text);
}
 
134,7 → 137,8
bm += cc;
bm2 += cc;
}
AddItem(bm, bm2, ite);
AddItem(bm, bm2, ite->OwnPage, ite->ItemNr);
ite->BMnr = NrItems;
Last = NrItems;
}
 
151,7 → 155,7
{
BookMItem *ip;
ip = (BookMItem*)i;
emit SelectElement(ip->PageObject);
emit SelectElement(ip->Seite, ip->Element);
}
}
}
389,7 → 393,7
e->ignore();
}
 
void BookMView::AddItem(QString text, QString Tit, PageItem *PageObject)
void BookMView::AddItem(QString text, QString Tit, int s, int el)
{
QListViewItem *lv = firstChild();
while (lv)
401,9 → 405,9
BookMItem *ip;
BookMItem *ite;
if (lv)
ite = new BookMItem(this, lv, NrItems+1, PageObject);
ite = new BookMItem(this, lv, NrItems+1, s, el);
else
ite = new BookMItem(this, NrItems+1, PageObject);
ite = new BookMItem(this, NrItems+1, s, el);
ite->setText(0, text);
ite->Titel = Tit;
ite->Next = 0;
416,20 → 420,9
NrItems++;
}
 
void BookMView::DeleteItem(PageItem *pObject)
void BookMView::DeleteItem(int nr)
{
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;
492,10 → 485,11
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::SetAction(PageItem *currItem, QString Act)
void BookMView::ChangeItem(int nr, int itnr)
{
BookMItem *ite;
QListViewItemIterator it(this);
502,8 → 496,23
for ( ; it.current(); ++it)
{
ite = (BookMItem*)it.current();
if (ite->PageObject == currItem)
if (ite->ItemNr == nr)
{
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;
}
516,6 → 525,7
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;
530,7 → 540,7
for ( ; it.current(); ++it)
{
ite = (BookMItem*)it.current();
if (ite->PageObject == currItem)
if (ite->ItemNr == nr)
{
ite->setText(0, bm);
ite->Titel = bm2;