Subversion Repositories Scribus

Compare Revisions

Ignore whitespace Rev 233 → Rev 234

/trunk/Scribus/ChangeLogCVS
1,4 → 1,10
Changes since Version 1.1.5
17.03.2004 Printing and Exporting to PDF for Tables is now working too.
 
16.03.2004 Loading and Saving of Tables is working, including Drag&Drop.
 
15.03.2004 Resizing of TableItems works now properly.
 
14.03.2004 Added first basic Support for Tables.
Jean-Jacques Sarton completed the Textselection with the Cursor Keys:
Shift+Cursor Key selects Chararcters.
/trunk/Scribus/scribus/lineformats.cpp
75,7 → 75,10
connect(DublicateB, SIGNAL(clicked()), this, SLOT(dupFormat()));
connect(DeleteB, SIGNAL(clicked()), this, SLOT(deleteFormat()));
connect(ListBox1, SIGNAL(highlighted(QListBoxItem*)), this, SLOT(selFormat(QListBoxItem*)));
sFnumber = ListBox1->count() > 0 ? TempStyles.begin().key() : QString("");
if (ListBox1->count() > 0)
sFnumber = TempStyles.begin().key();
else
sFnumber = "";
UpdateFList();
}
 
/trunk/Scribus/scribus/mpalette.cpp
1945,7 → 1945,38
doc->ActPage->SizeItem(w, CurItem->Height, CurItem->ItemNr, true);
}
else
doc->ActPage->SizeItem(w, CurItem->Height, CurItem->ItemNr, true);
{
if (CurItem->isTableItem)
{
double dist = w - CurItem->Width;
PageItem* bb2;
PageItem* bb = CurItem;
while (bb->TopLink != 0)
{
bb = bb->TopLink;
}
while (bb->BottomLink != 0)
{
bb2 = bb;
while (bb2->RightLink != 0)
{
doc->ActPage->MoveItem(dist, 0, bb2->RightLink, true);
bb2 = bb2->RightLink;
}
doc->ActPage->SizeItem(w, bb->Height, bb->ItemNr, true);
bb = bb->BottomLink;
}
bb2 = bb;
while (bb2->RightLink != 0)
{
doc->ActPage->MoveItem(dist, 0, bb2->RightLink, true);
bb2 = bb2->RightLink;
}
doc->ActPage->SizeItem(w, bb->Height, bb->ItemNr, true);
}
else
doc->ActPage->SizeItem(w, CurItem->Height, CurItem->ItemNr, true);
}
emit DocChanged();
}
}
1984,7 → 2015,38
doc->ActPage->SizeItem(w, CurItem->Height, CurItem->ItemNr, true);
}
else
doc->ActPage->SizeItem(CurItem->Width, h, CurItem->ItemNr, true);
{
if (CurItem->isTableItem)
{
double dist = h - CurItem->Height;
PageItem* bb2;
PageItem* bb = CurItem;
while (bb->LeftLink != 0)
{
bb = bb->LeftLink;
}
while (bb->RightLink != 0)
{
bb2 = bb;
while (bb2->BottomLink != 0)
{
doc->ActPage->MoveItem(0, dist, bb2->BottomLink, true);
bb2 = bb2->BottomLink;
}
doc->ActPage->SizeItem(bb->Width, h, bb->ItemNr, true);
bb = bb->RightLink;
}
bb2 = bb;
while (bb2->BottomLink != 0)
{
doc->ActPage->MoveItem(0, dist, bb2->BottomLink, true);
bb2 = bb2->BottomLink;
}
doc->ActPage->SizeItem(bb->Width, h, bb->ItemNr, true);
}
else
doc->ActPage->SizeItem(CurItem->Width, h, CurItem->ItemNr, true);
}
}
emit DocChanged();
}
2548,15 → 2610,46
if (dd != 0)
{
QMap<QString,multiLine>::Iterator it;
for (it = doc->MLineStyles.begin(); it != doc->MLineStyles.end(); ++it)
StyledLine->insertItem(it.key());
for (it = dd->MLineStyles.begin(); it != dd->MLineStyles.end(); ++it)
{
QPixmap pm = QPixmap(37, 37);
pm.fill(white);
QPainter p;
p.begin(&pm);
QColor tmpf;
int h, s, v, sneu;
multiLine ml = it.data();
for (int its = ml.size()-1; its > -1; its--)
{
dd->PageColors[ml[its].Color].getRGBColor().rgb(&h, &s, &v);
if ((h == s) && (s == v))
{
dd->PageColors[ml[its].Color].getRGBColor().hsv(&h, &s, &v);
sneu = 255 - ((255 - v) * ml[its].Shade / 100);
tmpf.setHsv(h, s, sneu);
}
else
{
dd->PageColors[ml[its].Color].getRGBColor().hsv(&h, &s, &v);
sneu = s * ml[its].Shade / 100;
tmpf.setHsv(h, sneu, v);
}
p.setPen(QPen(tmpf,
QMAX(static_cast<int>(ml[its].Width), 1),
static_cast<PenStyle>(ml[its].Dash),
static_cast<PenCapStyle>(ml[its].LineEnd),
static_cast<PenJoinStyle>(ml[its].LineJoin)));
p.drawLine(0, 18, 37, 18);
}
p.end();
StyledLine->insertItem(pm, it.key());
}
/* PFJ - 29.02.04 - Changed from TRUE to true */
StyledLine->sort( true );
StyledLine->insertItem( tr("No Style"), 0);
StyledLine->setSelected(StyledLine->currentItem(), false);
}
connect(StyledLine, SIGNAL(clicked(QListBoxItem*)), this,
SLOT(SetSTline(QListBoxItem*)));
connect(StyledLine, SIGNAL(clicked(QListBoxItem*)), this, SLOT(SetSTline(QListBoxItem*)));
}
 
void Mpalette::SetSTline(QListBoxItem *c)
/trunk/Scribus/scribus/util.cpp
1736,6 → 1736,25
Buffer->LeftLine = b->LeftLine;
Buffer->RightLine = b->RightLine;
Buffer->BottomLine = b->BottomLine;
if (b->isTableItem)
{
if (b->TopLink != 0)
Buffer->TopLinkID = b->TopLink->ItemNr;
else
Buffer->TopLinkID = -1;
if (b->LeftLink != 0)
Buffer->LeftLinkID = b->LeftLink->ItemNr;
else
Buffer->LeftLinkID = -1;
if (b->RightLink != 0)
Buffer->RightLinkID = b->RightLink->ItemNr;
else
Buffer->RightLinkID = -1;
if (b->BottomLink != 0)
Buffer->BottomLinkID = b->BottomLink->ItemNr;
else
Buffer->BottomLinkID = -1;
}
}
 
void WordAndPara(PageItem* b, int *w, int *p, int *c, int *wN, int *pN, int *cN)
/trunk/Scribus/scribus/pageitem.h
268,6 → 268,10
PageItem* RightLink;
PageItem* TopLink;
PageItem* BottomLink;
int LeftLinkID;
int RightLinkID;
int TopLinkID;
int BottomLinkID;
bool LeftLine;
bool RightLine;
bool TopLine;
/trunk/Scribus/scribus/pageitem.cpp
213,6 → 213,10
RightLink = 0;
TopLink = 0;
BottomLink = 0;
LeftLinkID = 0;
RightLinkID = 0;
TopLinkID = 0;
BottomLinkID = 0;
LeftLine = 0;
RightLine = false;
TopLine = false;
/trunk/Scribus/scribus/scribusdoc.h
188,6 → 188,10
bool LeftLine;
bool RightLine;
bool BottomLine;
int LeftLinkID;
int RightLinkID;
int TopLinkID;
int BottomLinkID;
};
 
/** Seitenraender */
/trunk/Scribus/scribus/scribusview.cpp
1017,10 → 1017,10
if ((ite->PicAvail) && (ite->Pfile != ""))
{
p->PS_translate(0, -ite->BBoxH*ite->LocalScY);
p->PS_image(ite->InvPict, -ite->BBoxX+ite->LocalX, -ite->LocalY, ite->Pfile, ite->LocalScX, ite->LocalScY, ite->IProfile, ite->UseEmbedded, Ic);
p->PS_image(ite->InvPict, -ite->BBoxX+ite->LocalX, -ite->LocalY, ite->Pfile, ite->LocalScX, ite->LocalScY, ite->IProfile, ite->UseEmbedded, Ic, ite->AnName);
}
p->PS_restore();
if ((ite->Pcolor2 != "None") || (ite->NamedLStyle != ""))
if (((ite->Pcolor2 != "None") || (ite->NamedLStyle != "")) && (!ite->isTableItem))
{
if (ite->NamedLStyle == "")
{
1321,7 → 1321,7
}
}
}
if ((ite->Pcolor2 != "None") || (ite->NamedLStyle != ""))
if (((ite->Pcolor2 != "None") || (ite->NamedLStyle != "")) && (!ite->isTableItem))
{
SetFarbe(ite->Pcolor2, ite->Shade2, &h, &s, &v, &k);
p->PS_setcmykcolor_stroke(h / 255.0, s / 255.0, v / 255.0, k / 255.0);
1352,6 → 1352,54
}
}
}
for (uint am = 0; am < mPage->Items.count(); ++am)
{
PageItem *ite = mPage->Items.at(am);
if ((ite->PType == 2) && ((sep) || (!farb)))
continue;
if (ite->isPrintable)
{
p->PS_save();
if (ite->Pcolor2 != "None")
{
SetFarbe(ite->Pcolor2, ite->Shade2, &h, &s, &v, &k);
p->PS_setcmykcolor_stroke(h / 255.0, s / 255.0, v / 255.0, k / 255.0);
}
p->PS_setlinewidth(ite->Pwidth);
p->PS_setdash(ite->PLineArt, Qt::SquareCap, ite->PLineJoin);
p->PS_translate(ite->Xpos, Doc->PageH - ite->Ypos);
if (ite->Rot != 0)
p->PS_rotate(-ite->Rot);
if (ite->isTableItem)
{
if ((ite->TopLine) || (ite->RightLine) || (ite->BottomLine) || (ite->LeftLine))
{
if (ite->TopLine)
{
p->PS_moveto(0, 0);
p->PS_lineto(ite->Width, 0);
}
if (ite->RightLine)
{
p->PS_moveto(ite->Width, 0);
p->PS_lineto(ite->Width, -ite->Height);
}
if (ite->BottomLine)
{
p->PS_moveto(0, -ite->Height);
p->PS_lineto(ite->Width, -ite->Height);
}
if (ite->LeftLine)
{
p->PS_moveto(0, 0);
p->PS_lineto(0, -ite->Height);
}
p->PS_stroke();
}
}
p->PS_restore();
}
}
Lnr++;
}
}
1483,7 → 1531,7
p->PS_image(c->InvPict, -c->BBoxX+c->LocalX, -c->LocalY, c->Pfile, c->LocalScX, c->LocalScY, c->IProfile, c->UseEmbedded, ic);
}
p->PS_restore();
if ((c->Pcolor2 != "None") || (c->NamedLStyle != ""))
if (((c->Pcolor2 != "None") || (c->NamedLStyle != "")) && (!c->isTableItem))
{
if (c->NamedLStyle == "")
{
1818,7 → 1866,7
}
}
}
if ((c->Pcolor2 != "None") || (c->NamedLStyle != ""))
if (((c->Pcolor2 != "None") || (c->NamedLStyle != "")) && (!c->isTableItem))
{
SetFarbe(c->Pcolor2, c->Shade2, &h, &s, &v, &k);
p->PS_setcmykcolor_stroke(h / 255.0, s / 255.0, v / 255.0, k / 255.0);
2051,6 → 2099,58
}
}
}
for (b = 0; b < a->Items.count(); ++b)
{
c = a->Items.at(b);
if (c->LayerNr != ll.LNr)
continue;
if ((a->PageNam != "") && (c->PType == 4))
continue;
if ((a->PageNam != "") && (c->PType == 2) && ((sep) || (!farb)))
continue;
if (c->isPrintable)
{
p->PS_save();
if (c->Pcolor2 != "None")
{
SetFarbe(c->Pcolor2, c->Shade2, &h, &s, &v, &k);
p->PS_setcmykcolor_stroke(h / 255.0, s / 255.0, v / 255.0, k / 255.0);
}
p->PS_setlinewidth(c->Pwidth);
p->PS_setdash(c->PLineArt, Qt::SquareCap, c->PLineJoin);
p->PS_translate(c->Xpos, Doc->PageH - c->Ypos);
if (c->Rot != 0)
p->PS_rotate(-c->Rot);
if (c->isTableItem)
{
if ((c->TopLine) || (c->RightLine) || (c->BottomLine) || (c->LeftLine))
{
if (c->TopLine)
{
p->PS_moveto(0, 0);
p->PS_lineto(c->Width, 0);
}
if (c->RightLine)
{
p->PS_moveto(c->Width, 0);
p->PS_lineto(c->Width, -c->Height);
}
if (c->BottomLine)
{
p->PS_moveto(0, -c->Height);
p->PS_lineto(c->Width, -c->Height);
}
if (c->LeftLine)
{
p->PS_moveto(0, 0);
p->PS_lineto(0, -c->Height);
}
p->PS_stroke();
}
}
p->PS_restore();
}
}
Lnr++;
}
}
/trunk/Scribus/scribus/muster.cpp
145,11 → 145,44
if (Doc->PageFP)
View->Pages.at(nr)->LeftPg = dia->Links->currentItem() == 0 ? true : false;
int inde = View->MasterNames[sMuster];
QMap<int,int> TableID;
QPtrList<PageItem> TableItems;
TableID.clear();
TableItems.clear();
for (uint a=0; a<View->Pages.at(inde)->Items.count(); ++a)
{
CopyPageItem(&Buffer, View->Pages.at(inde)->Items.at(a));
Doc->ActPage->PasteItem(&Buffer, true, true);
PageItem* Neu = Doc->ActPage->Items.at(Doc->ActPage->Items.count()-1);
if (Neu->isTableItem)
{
TableItems.append(Neu);
TableID.insert(a, Neu->ItemNr);
}
}
if (TableItems.count() != 0)
{
for (uint ttc = 0; ttc < TableItems.count(); ++ttc)
{
PageItem* ta = TableItems.at(ttc);
if (ta->TopLinkID != -1)
ta->TopLink = Doc->ActPage->Items.at(TableID[ta->TopLinkID]);
else
ta->TopLink = 0;
if (ta->LeftLinkID != -1)
ta->LeftLink = Doc->ActPage->Items.at(TableID[ta->LeftLinkID]);
else
ta->LeftLink = 0;
if (ta->RightLinkID != -1)
ta->RightLink = Doc->ActPage->Items.at(TableID[ta->RightLinkID]);
else
ta->RightLink = 0;
if (ta->BottomLinkID != -1)
ta->BottomLink = Doc->ActPage->Items.at(TableID[ta->BottomLinkID]);
else
ta->BottomLink = 0;
}
}
Doc->ActPage->Deselect(true);
View->DrawNew();
View->Pages.at(nr)->PageNam = nam;
/trunk/Scribus/scribus/libpostscript/pslib.cpp
880,8 → 880,7
PutSeite(" /Height " + IToStr(h) + "\n");
PutSeite(" /BitsPerComponent 1\n");
PutSeite(" /Decode [1 0]\n");
PutSeite(" /ImageMatrix [" + IToStr(w) + " 0 0 " + IToStr(-h) + " 0 " + IToStr(h) +
"]\n");
PutSeite(" /ImageMatrix [" + IToStr(w) + " 0 0 " + IToStr(-h) + " 0 " + IToStr(h) + "]\n");
PutSeite(" /DataSource "+PSEncode(Name)+"Mask\n");
PutSeite(">>\n");
PutSeite("imagemask\n");
910,6 → 909,7
PutSeite(PSEncode(Name)+"Bild resetfile\n");
}
else
{
PutSeite ( CompAvail ? " /DataSource currentfile /ASCIIHexDecode filter /FlateDecode filter >>\n" :
" /DataSource currentfile /ASCIIHexDecode filter >>\n");
PutSeite("image\n");
944,6 → 944,7
PutSeite("\n>\n");
}
}
}
}
 
 
/trunk/Scribus/scribus/libabout/about.cpp
54,7 → 54,7
tabLayout1->addWidget( PixmapLabel1 );
BuildID = new QLabel( tab, "BB" );
BuildID->setAlignment(Qt::AlignCenter);
QString bu = tr("%1. %2 %3 ").arg("14").arg("March").arg("2004");
QString bu = tr("%1. %2 %3 ").arg("17").arg("March").arg("2004");
#ifdef HAVE_CMS
bu += "C";
#else
/trunk/Scribus/scribus/scribus.cpp
4623,13 → 4623,46
break;
}
Page* Ziel = doc->ActPage;
QMap<int,int> TableID;
QPtrList<PageItem> TableItems;
TableID.clear();
TableItems.clear();
for (uint ite = 0; ite < from->Items.count(); ++ite)
{
{
CopyPageItem(&Buffer, from->Items.at(ite));
Ziel->PasteItem(&Buffer, true, true);
if (from->Items.at(ite)->isBookmark)
AddBookMark(Ziel->Items.at(Ziel->Items.count()-1));
PageItem* Neu = Ziel->Items.at(Ziel->Items.count()-1);
if (Neu->isTableItem)
{
TableItems.append(Neu);
TableID.insert(ite, Neu->ItemNr);
}
}
if (TableItems.count() != 0)
{
for (uint ttc = 0; ttc < TableItems.count(); ++ttc)
{
PageItem* ta = TableItems.at(ttc);
if (ta->TopLinkID != -1)
ta->TopLink = Ziel->Items.at(TableID[ta->TopLinkID]);
else
ta->TopLink = 0;
if (ta->LeftLinkID != -1)
ta->LeftLink = Ziel->Items.at(TableID[ta->LeftLinkID]);
else
ta->LeftLink = 0;
if (ta->RightLinkID != -1)
ta->RightLink = Ziel->Items.at(TableID[ta->RightLinkID]);
else
ta->RightLink = 0;
if (ta->BottomLinkID != -1)
ta->BottomLink = Ziel->Items.at(TableID[ta->BottomLinkID]);
else
ta->BottomLink = 0;
}
}
Ziel->MPageNam = from->MPageNam;
Ziel->Deselect(true);
doc->loading = false;
/trunk/Scribus/scribus/page.cpp
1550,6 → 1550,8
 
void Page::AdjustItemSize(PageItem *b)
{
bool siz = b->Sizing;
b->Sizing = false;
FPointArray Clip;
Clip = b->PoLine;
FPoint tp2 = GetMinClipF(Clip);
1578,6 → 1580,7
SetPolyClip(b, qRound(QMAX(b->Pwidth / 2, 1)), qRound(QMAX(b->Pwidth / 2, 1)));
else
b->Clip = FlattenPath(b->PoLine, b->Segments);
b->Sizing = siz;
}
 
void Page::MirrorPolyH()
1960,11 → 1963,13
bb->OldH2 = bb->Height;
bb->Sizing = false;
FPoint b, b1, t, t1, h, h1, g, tes, tes2;
double oldRot;
double oldRot, oldLocalX, oldLocalY;
switch (HowTo)
{
case 1:
oldRot = bb->Rot;
oldLocalX = bb->LocalX;
oldLocalY = bb->LocalY;
g = FPoint(gx, gy);
b = transformPoint(FPoint(0, 0), bb->Xpos, bb->Ypos, bb->Rot, 1, 1);
b -= g;
2013,15 → 2018,18
}
}
bb->ISize = QMAX(qRound(bb->ISize*((scx+scy)/2)), 1);
if (bb->Ptext.count() != 0)
if ((bb->Ptext.count() != 0) && (!bb->isTableItem))
{
bb->LineSp = ((bb->ISize / 10.0) * static_cast<double>(doku->AutoLine) / 100) +
(bb->ISize / 10.0);
bb->LineSp = ((bb->ISize / 10.0) * static_cast<double>(doku->AutoLine) / 100) + (bb->ISize / 10.0);
for (aa = 0; aa < bb->Ptext.count(); ++aa)
bb->Ptext.at(aa)->csize = QMAX(qRound(bb->Ptext.at(aa)->csize*((scx+scy)/2)), 1);
if (bb->PType == 8)
UpdatePolyClip(bb);
}
bb->LocalX = oldLocalX;
bb->LocalY = oldLocalY;
bb->OldB2 = bb->Width;
bb->OldH2 = bb->Height;
break;
}
}
2162,8 → 2170,8
z = PaintText(Tx + offX, Ty + offY, deltaX, deltaY, doku->Dwidth, doku->DpenText);
b = Items.at(z);
b->isTableItem = true;
b->LineSp = static_cast<int>(deltaY - 3);
b->ISize = static_cast<int>((b->LineSp - (b->LineSp * static_cast<double>(doku->AutoLine) / 100.0))) * 10;
// b->LineSp = static_cast<int>(deltaY - 3);
// b->ISize = static_cast<int>((b->LineSp - (b->LineSp * static_cast<double>(doku->AutoLine) / 100.0))) * 10;
SelItem.append(b);
offX += deltaX;
}
2170,8 → 2178,31
offY += deltaY;
offX = 0.0;
}
for (int rc = 0; rc < Rows; ++rc)
{
for (int cc = 0; cc < Cols; ++cc)
{
b = SelItem.at((rc * Cols) + cc);
if (rc == 0)
b->TopLink = 0;
else
b->TopLink = SelItem.at(((rc-1)*Cols)+cc);
if (rc == Rows-1)
b->BottomLink = 0;
else
b->BottomLink = SelItem.at(((rc+1)*Cols)+cc);
if (cc == 0)
b->LeftLink = 0;
else
b->LeftLink = SelItem.at((rc*Cols)+cc-1);
if (cc == Cols-1)
b->RightLink = 0;
else
b->RightLink = SelItem.at((rc*Cols)+cc+1);
}
}
emit DoGroup();
}
emit DoGroup();
doku->AppMode = 1;
emit PaintingDone();
emit DocChanged();
2625,6 → 2656,69
case 1:
if (b->PType != 5)
{
if (b->isTableItem)
{
double dist;
if (b->LeftLink != 0)
dist = npx.y() - b->LeftLink->Height;
else if (b->RightLink != 0)
dist = npx.y() - b->RightLink->Height;
else
dist = npx.y() - b->Height;
PageItem* bb2;
PageItem* bb = b;
while (bb->LeftLink != 0)
{
bb = bb->LeftLink;
}
while (bb->RightLink != 0)
{
bb2 = bb;
while (bb2->BottomLink != 0)
{
MoveItem(0, dist, bb2->BottomLink, false);
bb2 = bb2->BottomLink;
}
SizeItem(bb->Width, npx.y(), bb->ItemNr);
bb = bb->RightLink;
}
bb2 = bb;
while (bb2->BottomLink != 0)
{
MoveItem(0, dist, bb2->BottomLink, false);
bb2 = bb2->BottomLink;
}
SizeItem(bb->Width, npx.y(), bb->ItemNr);
bb = b;
if (b->TopLink != 0)
dist = npx.x() - b->TopLink->Width;
else if (b->BottomLink != 0)
dist = npx.x() - b->BottomLink->Width;
else
dist = npx.x() - b->Width;
while (bb->TopLink != 0)
{
bb = bb->TopLink;
}
while (bb->BottomLink != 0)
{
bb2 = bb;
while (bb2->RightLink != 0)
{
MoveItem(dist, 0, bb2->RightLink, false);
bb2 = bb2->RightLink;
}
SizeItem(npx.x(), bb->Height, bb->ItemNr);
bb = bb->BottomLink;
}
bb2 = bb;
while (bb2->RightLink != 0)
{
MoveItem(dist, 0, bb2->RightLink, false);
bb2 = bb2->RightLink;
}
SizeItem(npx.x(), bb->Height, bb->ItemNr);
}
if (b->flippedH % 2 != 0)
MoveItemI(-(b->Width - b->OldB2)/b->LocalScX, 0, b->ItemNr);
if (b->flippedV % 2 != 0)
2656,7 → 2750,58
case 2:
if (b->PType != 5)
{
MoveSizeItem(npx, npx, b->ItemNr);
if (b->isTableItem)
{
PageItem* bb2;
PageItem* bb = b;
while (bb->TopLink != 0)
{
bb = bb->TopLink;
}
while (bb->BottomLink != 0)
{
bb2 = bb;
while (bb2->LeftLink != 0)
{
MoveItem(npx.x(), 0, bb2->LeftLink, false);
bb2 = bb2->LeftLink;
}
MoveSizeItem(FPoint(npx.x(), 0), FPoint(npx.x(), 0), bb->ItemNr);
bb = bb->BottomLink;
}
bb2 = bb;
while (bb2->LeftLink != 0)
{
MoveItem(npx.x(), 0, bb2->LeftLink, false);
bb2 = bb2->LeftLink;
}
MoveSizeItem(FPoint(npx.x(), 0), FPoint(npx.x(), 0), bb->ItemNr);
bb = b;
while (bb->LeftLink != 0)
{
bb = bb->LeftLink;
}
while (bb->RightLink != 0)
{
bb2 = bb;
while (bb2->TopLink != 0)
{
MoveItem(0, npx.y(), bb2->TopLink, false);
bb2 = bb2->TopLink;
}
MoveSizeItem(FPoint(0, npx.y()), FPoint(0, npx.y()), bb->ItemNr);
bb = bb->RightLink;
}
bb2 = bb;
while (bb2->TopLink != 0)
{
MoveItem(0, npx.y(), bb2->TopLink, false);
bb2 = bb2->TopLink;
}
MoveSizeItem(FPoint(0, npx.y()), FPoint(0, npx.y()), bb->ItemNr);
}
else
MoveSizeItem(npx, npx, b->ItemNr);
b->Sizing = false;
if (b->flippedH % 2 == 0)
MoveItemI((b->Width - b->OldB2)/b->LocalScX, 0, b->ItemNr);
2693,7 → 2838,59
}
break;
case 3:
MoveSizeItem(FPoint(0, npx.y()), FPoint(b->Width - npx.x(), npx.y()), b->ItemNr);
if (b->isTableItem)
{
double dist = npx.x() - b->Width;
PageItem* bb2;
PageItem* bb = b;
while (bb->TopLink != 0)
{
bb = bb->TopLink;
}
while (bb->BottomLink != 0)
{
bb2 = bb;
while (bb2->RightLink != 0)
{
MoveItem(dist, 0, bb2->RightLink, false);
bb2 = bb2->RightLink;
}
SizeItem(npx.x(), bb->Height, bb->ItemNr);
bb = bb->BottomLink;
}
bb2 = bb;
while (bb2->RightLink != 0)
{
MoveItem(dist, 0, bb2->RightLink, false);
bb2 = bb2->RightLink;
}
SizeItem(npx.x(), bb->Height, bb->ItemNr);
bb = b;
while (bb->LeftLink != 0)
{
bb = bb->LeftLink;
}
while (bb->RightLink != 0)
{
bb2 = bb;
while (bb2->TopLink != 0)
{
MoveItem(0, npx.y(), bb2->TopLink, false);
bb2 = bb2->TopLink;
}
MoveSizeItem(FPoint(0, npx.y()), FPoint(0, npx.y()), bb->ItemNr);
bb = bb->RightLink;
}
bb2 = bb;
while (bb2->TopLink != 0)
{
MoveItem(0, npx.y(), bb2->TopLink, false);
bb2 = bb2->TopLink;
}
MoveSizeItem(FPoint(0, npx.y()), FPoint(0, npx.y()), bb->ItemNr);
}
else
MoveSizeItem(FPoint(0, npx.y()), FPoint(b->Width - npx.x(), npx.y()), b->ItemNr);
b->Sizing = false;
if (b->flippedH % 2 != 0)
MoveItemI(-(b->Width - b->OldB2)/b->LocalScX, 0, b->ItemNr);
2701,7 → 2898,59
MoveItemI(0, (b->Height - b->OldH2)/b->LocalScY, b->ItemNr);
break;
case 4:
MoveSizeItem(FPoint(npx.x(), 0), FPoint(npx.x(), b->Height - npx.y()), b->ItemNr);
if (b->isTableItem)
{
double dist = npx.y() - b->Height;
PageItem* bb2;
PageItem* bb = b;
while (bb->LeftLink != 0)
{
bb = bb->LeftLink;
}
while (bb->RightLink != 0)
{
bb2 = bb;
while (bb2->BottomLink != 0)
{
MoveItem(0, dist, bb2->BottomLink, false);
bb2 = bb2->BottomLink;
}
SizeItem(bb->Width, npx.y(), bb->ItemNr);
bb = bb->RightLink;
}
bb2 = bb;
while (bb2->BottomLink != 0)
{
MoveItem(0, dist, bb2->BottomLink, false);
bb2 = bb2->BottomLink;
}
SizeItem(bb->Width, npx.y(), bb->ItemNr);
bb = b;
while (bb->TopLink != 0)
{
bb = bb->TopLink;
}
while (bb->BottomLink != 0)
{
bb2 = bb;
while (bb2->LeftLink != 0)
{
MoveItem(npx.x(), 0, bb2->LeftLink, false);
bb2 = bb2->LeftLink;
}
MoveSizeItem(FPoint(npx.x(), 0), FPoint(npx.x(), 0), bb->ItemNr);
bb = bb->BottomLink;
}
bb2 = bb;
while (bb2->LeftLink != 0)
{
MoveItem(npx.x(), 0, bb2->LeftLink, false);
bb2 = bb2->LeftLink;
}
MoveSizeItem(FPoint(npx.x(), 0), FPoint(npx.x(), 0), bb->ItemNr);
}
else
MoveSizeItem(FPoint(npx.x(), 0), FPoint(npx.x(), b->Height - npx.y()), b->ItemNr);
b->Sizing = false;
if (b->flippedH % 2 == 0)
MoveItemI((b->Width - b->OldB2)/b->LocalScX, 0, b->ItemNr);
2709,19 → 2958,105
MoveItemI(0, -(b->Height - b->OldH2)/b->LocalScY, b->ItemNr);
break;
case 5:
MoveSizeItem(FPoint(0, 0), FPoint(0, b->Height - npx.y()), b->ItemNr);
if (b->isTableItem)
{
double dist = npx.y() - b->Height;
PageItem* bb2;
PageItem* bb = b;
while (bb->LeftLink != 0)
{
bb = bb->LeftLink;
}
while (bb->RightLink != 0)
{
bb2 = bb;
while (bb2->BottomLink != 0)
{
MoveItem(0, dist, bb2->BottomLink, false);
bb2 = bb2->BottomLink;
}
SizeItem(bb->Width, npx.y(), bb->ItemNr);
bb = bb->RightLink;
}
bb2 = bb;
while (bb2->BottomLink != 0)
{
MoveItem(0, dist, bb2->BottomLink, false);
bb2 = bb2->BottomLink;
}
SizeItem(bb->Width, npx.y(), bb->ItemNr);
}
else
MoveSizeItem(FPoint(0, 0), FPoint(0, b->Height - npx.y()), b->ItemNr);
b->Sizing = false;
if (b->flippedV % 2 != 0)
MoveItemI(0, -(b->Height - b->OldH2)/b->LocalScY, b->ItemNr);
break;
case 6:
MoveSizeItem(FPoint(0, 0), FPoint(b->Width - npx.x(), 0), b->ItemNr);
b->Sizing = false;
if (b->isTableItem)
{
double dist = npx.x() - b->Width;
PageItem* bb2;
PageItem* bb = b;
while (bb->TopLink != 0)
{
bb = bb->TopLink;
}
while (bb->BottomLink != 0)
{
bb2 = bb;
while (bb2->RightLink != 0)
{
MoveItem(dist, 0, bb2->RightLink, false);
bb2 = bb2->RightLink;
}
SizeItem(npx.x(), bb->Height, bb->ItemNr);
bb = bb->BottomLink;
}
bb2 = bb;
while (bb2->RightLink != 0)
{
MoveItem(dist, 0, bb2->RightLink, false);
bb2 = bb2->RightLink;
}
SizeItem(npx.x(), bb->Height, bb->ItemNr);
}
else
MoveSizeItem(FPoint(0, 0), FPoint(b->Width - npx.x(), 0), b->ItemNr);
if (b->flippedH % 2 != 0)
MoveItemI(-(b->Width - b->OldB2)/b->LocalScX, 0, b->ItemNr);
break;
case 7:
MoveSizeItem(FPoint(npx.x(), 0), FPoint(npx.x(), 0), b->ItemNr);
if (b->isTableItem)
{
PageItem* bb2;
PageItem* bb = b;
while (bb->TopLink != 0)
{
bb = bb->TopLink;
}
while (bb->BottomLink != 0)
{
bb2 = bb;
while (bb2->LeftLink != 0)
{
MoveItem(npx.x(), 0, bb2->LeftLink, false);
bb2 = bb2->LeftLink;
}
MoveSizeItem(FPoint(npx.x(), 0), FPoint(npx.x(), 0), bb->ItemNr);
bb = bb->BottomLink;
}
bb2 = bb;
while (bb2->LeftLink != 0)
{
MoveItem(npx.x(), 0, bb2->LeftLink, false);
bb2 = bb2->LeftLink;
}
MoveSizeItem(FPoint(npx.x(), 0), FPoint(npx.x(), 0), bb->ItemNr);
}
else
MoveSizeItem(FPoint(npx.x(), 0), FPoint(npx.x(), 0), b->ItemNr);
b->Sizing = false;
if (b->flippedH % 2 == 0)
MoveItemI((b->Width - b->OldB2)/b->LocalScX, 0, b->ItemNr);
2729,7 → 3064,35
MoveItemI(0, -(b->Height - b->OldH2)/b->LocalScY, b->ItemNr);
break;
case 8:
MoveSizeItem(FPoint(0, npx.y()), FPoint(0, npx.y()), b->ItemNr);
if (b->isTableItem)
{
PageItem* bb2;
PageItem* bb = b;
while (bb->LeftLink != 0)
{
bb = bb->LeftLink;
}
while (bb->RightLink != 0)
{
bb2 = bb;
while (bb2->TopLink != 0)
{
MoveItem(0, npx.y(), bb2->TopLink, false);
bb2 = bb2->TopLink;
}
MoveSizeItem(FPoint(0, npx.y()), FPoint(0, npx.y()), bb->ItemNr);
bb = bb->RightLink;
}
bb2 = bb;
while (bb2->TopLink != 0)
{
MoveItem(0, npx.y(), bb2->TopLink, false);
bb2 = bb2->TopLink;
}
MoveSizeItem(FPoint(0, npx.y()), FPoint(0, npx.y()), bb->ItemNr);
}
else
MoveSizeItem(FPoint(0, npx.y()), FPoint(0, npx.y()), b->ItemNr);
b->Sizing = false;
if (b->flippedH % 2 != 0)
MoveItemI(-(b->Width - b->OldB2)/b->LocalScX, 0, b->ItemNr);
7246,6 → 7609,7
Items.at(z)->BBoxH = Buffer->BBoxH;
Items.at(z)->ScaleType = Buffer->ScaleType;
Items.at(z)->AspectRatio = Buffer->AspectRatio;
Items.at(z)->Pwidth = Buffer->Pwidth;
break;
case 3:
z = PaintRect(x, y, w, h, pw, Buffer->Pcolor, Buffer->Pcolor2);
7381,6 → 7745,10
b->LeftLine = Buffer->LeftLine;
b->BottomLine = Buffer->BottomLine;
b->isTableItem = Buffer->isTableItem;
b->TopLinkID = Buffer->TopLinkID;
b->LeftLinkID = Buffer->LeftLinkID;
b->RightLinkID = Buffer->RightLinkID;
b->BottomLinkID = Buffer->BottomLinkID;
if (Buffer->AnName != "")
{
if (!drag)
/trunk/Scribus/scribus/libpdf/pdflib.cpp
1140,13 → 1140,136
if ((ite->flippedH % 2) != 0)
PutPage("-1 0 0 1 "+FToStr(ite->Width)+" 0 cm\n");
if ((ite->flippedV % 2) != 0)
PutPage("1 0 0 -1 0 "+FToStr(-ite->Height)+
" cm\n");
PutPage("1 0 0 -1 0 "+FToStr(-ite->Height)+" cm\n");
PutPage(setTextSt(ite, PNr));
PutPage("Q\n");
}
}
for (uint am = 0; am < mPage->Items.count(); ++am)
{
ite = mPage->Items.at(am);
if ((ite->LayerNr != ll.LNr) || (!ite->isPrintable) || (ite->PType != 4))
continue;
PutPage("q\n");
if (((ite->Transparency != 0) || (ite->TranspStroke != 0)) &&
(Options->Version == 14))
PDF_Transparenz(ite);
if (Options->UseRGB)
{
if (ite->Pcolor != "None")
PutPage(SetFarbe(ite->Pcolor, ite->Shade)+" rg\n");
if (ite->Pcolor2 != "None")
PutPage(SetFarbe(ite->Pcolor2, ite->Shade2)+" RG\n");
}
else
{
#ifdef HAVE_CMS
if ((CMSuse) && (Options->UseProfiles))
{
char *tmp[] = {"/Perceptual", "/RelativeColorimetric",
"/Saturation", "/AbsoluteColorimetric"};
PutPage(tmp[Options->Intent]);
PutPage(" ri\n");
PutPage("/"+ICCProfiles[Options->SolidProf].ResName+" cs\n");
PutPage("/"+ICCProfiles[Options->SolidProf].ResName+" CS\n");
if (ite->Pcolor != "None")
PutPage(SetFarbe(ite->Pcolor, ite->Shade)+" scn\n");
if (ite->Pcolor2 != "None")
PutPage(SetFarbe(ite->Pcolor2, ite->Shade2)+" SCN\n");
}
else
{
#endif
if (ite->Pcolor != "None")
PutPage(SetFarbe(ite->Pcolor, ite->Shade)+" k\n");
if (ite->Pcolor2 != "None")
PutPage(SetFarbe(ite->Pcolor2, ite->Shade2)+" K\n");
}
#ifdef HAVE_CMS
}
#endif
Inhalt += FToStr(ite->Pwidth)+" w\n";
QString Dt = FToStr(QMAX(ite->Pwidth, 1));
QString Da = FToStr(QMAX(3*ite->Pwidth, 1));
switch (ite->PLineArt)
{
case Qt::SolidLine:
PutPage("[] 0 d\n");
break;
case Qt::DashLine:
PutPage("["+Da+" "+Dt+"] 0 d\n");
break;
case Qt::DotLine:
PutPage("["+Dt+"] 0 d\n");
break;
case Qt::DashDotLine:
PutPage("["+Da+" "+Dt+" "+Dt+" "+Dt+"] 0 d\n");
break;
case Qt::DashDotDotLine:
PutPage("["+Da+" "+Dt+" "+Dt+" "+Dt+" "+Dt+" "+Dt+"] 0 d\n");
break;
default:
PutPage("[] 0 d\n");
break;
}
PutPage("2 J\n");
switch (ite->PLineJoin)
{
case Qt::MiterJoin:
PutPage("0 j\n");
break;
case Qt::BevelJoin:
PutPage("2 j\n");
break;
case Qt::RoundJoin:
PutPage("1 j\n");
break;
default:
PutPage("0 j\n");
break;
}
PutPage("1 0 0 1 "+FToStr(ite->Xpos)+" "+FToStr(doc->PageH - ite->Ypos)+" cm\n");
if (ite->Rot != 0)
{
double sr = sin(-ite->Rot* 3.1415927 / 180.0);
double cr = cos(-ite->Rot* 3.1415927 / 180.0);
if ((cr * cr) < 0.001)
cr = 0;
if ((sr * sr) < 0.001)
sr = 0;
PutPage(FToStr(cr)+" "+FToStr(sr)+" "+FToStr(-sr)+" "+FToStr(cr)+ " 0 0 cm\n");
}
if (ite->isTableItem)
{
if ((ite->TopLine) || (ite->RightLine) || (ite->BottomLine) || (ite->LeftLine))
{
PutPage("h\n");
if (ite->TopLine)
{
PutPage("0 0 m\n");
PutPage(FToStr(ite->Width)+" 0 l\n");
}
if (ite->RightLine)
{
PutPage(FToStr(ite->Width)+" 0 m\n");
PutPage(FToStr(ite->Width)+" "+FToStr(-ite->Height)+" l\n");
}
if (ite->BottomLine)
{
PutPage("0 "+FToStr(-ite->Height)+" m\n");
PutPage(FToStr(ite->Width)+" "+FToStr(-ite->Height)+" l\n");
}
if (ite->LeftLine)
{
PutPage("0 0 m\n");
PutPage("0 "+FToStr(-ite->Height)+" l\n");
}
PutPage("S\n");
}
}
PutPage("Q\n");
}
}
}
}
}
1299,7 → 1422,7
false, ite->IProfile, ite->UseEmbedded,
ite->IRender);
PutPage("Q\n");
if ((ite->Pcolor2 != "None") || (ite->NamedLStyle != ""))
if (((ite->Pcolor2 != "None") || (ite->NamedLStyle != "")) && (!ite->isTableItem))
{
if (ite->NamedLStyle == "")
{
1340,7 → 1463,7
PutPage("1 0 0 -1 0 "+FToStr(-ite->Height)+" cm\n");
PutPage(setTextSt(ite, PNr));
PutPage("Q\n");
if ((ite->Pcolor2 != "None") || (ite->NamedLStyle != ""))
if (((ite->Pcolor2 != "None") || (ite->NamedLStyle != "")) && (!ite->isTableItem))
{
if (ite->NamedLStyle == "")
{
1467,6 → 1590,135
}
PutPage("Q\n");
}
for (uint a = 0; a < ActPageP->Items.count(); ++a)
{
ite = ActPageP->Items.at(a);
if (ite->LayerNr != ll.LNr)
continue;
PutPage("q\n");
if (((ite->Transparency != 0) || (ite->TranspStroke != 0)) &&
(Options->Version == 14))
PDF_Transparenz(ite);
if (!ite->isPrintable)
{
PutPage("Q\n");
continue;
}
if (Options->UseRGB)
{
if (ite->Pcolor != "None")
PutPage(SetFarbe(ite->Pcolor, ite->Shade)+" rg\n");
if (ite->Pcolor2 != "None")
PutPage(SetFarbe(ite->Pcolor2, ite->Shade2)+" RG\n");
}
else
{
#ifdef HAVE_CMS
if ((CMSuse) && (Options->UseProfiles))
{
char *tmp[] = {"/Perceptual", "/RelativeColorimetric",
"/Saturation", "/AbsoluteColorimetric"};
PutPage(tmp[Options->Intent]);
PutPage(" ri\n");
PutPage("/"+ICCProfiles[Options->SolidProf].ResName+" cs\n");
PutPage("/"+ICCProfiles[Options->SolidProf].ResName+" CS\n");
if (ite->Pcolor != "None")
PutPage(SetFarbe(ite->Pcolor, ite->Shade)+" scn\n");
if (ite->Pcolor2 != "None")
PutPage(SetFarbe(ite->Pcolor2, ite->Shade2)+" SCN\n");
}
else
{
#endif
if (ite->Pcolor != "None")
PutPage(SetFarbe(ite->Pcolor, ite->Shade)+" k\n");
if (ite->Pcolor2 != "None")
PutPage(SetFarbe(ite->Pcolor2, ite->Shade2)+" K\n");
}
#ifdef HAVE_CMS
}
#endif
Inhalt += FToStr(ite->Pwidth)+" w\n";
QString Dt = FToStr(QMAX(ite->Pwidth, 1));
QString Da = FToStr(QMAX(3*ite->Pwidth, 1));
switch (ite->PLineArt)
{
case Qt::SolidLine:
PutPage("[] 0 d\n");
break;
case Qt::DashLine:
PutPage("["+Da+" "+Dt+"] 0 d\n");
break;
case Qt::DotLine:
PutPage("["+Dt+"] 0 d\n");
break;
case Qt::DashDotLine:
PutPage("["+Da+" "+Dt+" "+Dt+" "+Dt+"] 0 d\n");
break;
case Qt::DashDotDotLine:
PutPage("["+Da+" "+Dt+" "+Dt+" "+Dt+" "+Dt+" "+Dt+"] 0 d\n");
break;
default:
PutPage("[] 0 d\n");
break;
}
PutPage("2 J\n");
switch (ite->PLineJoin)
{
case Qt::MiterJoin:
PutPage("0 j\n");
break;
case Qt::BevelJoin:
PutPage("2 j\n");
break;
case Qt::RoundJoin:
PutPage("1 j\n");
break;
default:
PutPage("0 j\n");
break;
}
PutPage("1 0 0 1 "+FToStr(ite->Xpos)+" "+FToStr(doc->PageH - ite->Ypos)+" cm\n");
if (ite->Rot != 0)
{
double sr = sin(-ite->Rot* 3.1415927 / 180.0);
double cr = cos(-ite->Rot* 3.1415927 / 180.0);
if ((cr * cr) < 0.001)
cr = 0;
if ((sr * sr) < 0.001)
sr = 0;
PutPage(FToStr(cr)+" "+FToStr(sr)+" "+FToStr(-sr)+" "+FToStr(cr)+ " 0 0 cm\n");
}
if (ite->isTableItem)
{
if ((ite->TopLine) || (ite->RightLine) || (ite->BottomLine) || (ite->LeftLine))
{
PutPage("h\n");
if (ite->TopLine)
{
PutPage("0 0 m\n");
PutPage(FToStr(ite->Width)+" 0 l\n");
}
if (ite->RightLine)
{
PutPage(FToStr(ite->Width)+" 0 m\n");
PutPage(FToStr(ite->Width)+" "+FToStr(-ite->Height)+" l\n");
}
if (ite->BottomLine)
{
PutPage("0 "+FToStr(-ite->Height)+" m\n");
PutPage(FToStr(ite->Width)+" "+FToStr(-ite->Height)+" l\n");
}
if (ite->LeftLine)
{
PutPage("0 0 m\n");
PutPage("0 "+FToStr(-ite->Height)+" l\n");
}
PutPage("S\n");
}
}
PutPage("Q\n");
}
}
Lnr++;
}
/trunk/Scribus/scribus/scribusXml.cpp
368,6 → 368,8
QFont fo;
QMap<QString,QString> DoFonts;
QMap<uint,QString> DoVorl;
QMap<int,int> TableID;
QPtrList<PageItem> TableItems;
uint VorlC;
int x, y, a, counter, baseobj;
double xf, yf;
613,6 → 615,8
view->Pages.at(a)->LeftPg=QStoInt(pg.attribute("LEFT","0"));
view->Pages.at(a)->PageNam = pg.attribute("NAM","");
}
TableItems.clear();
TableID.clear();
/*
* Attribute von PAGE auslesen
*/
796,6 → 800,10
OB.LeftLine = static_cast<bool>(QStoInt(obj.attribute("LeftLine","0")));
OB.RightLine = static_cast<bool>(QStoInt(obj.attribute("RightLine","0")));
OB.BottomLine = static_cast<bool>(QStoInt(obj.attribute("BottomLine","0")));
OB.TopLinkID = QStoInt(obj.attribute("TopLINK","-1"));
OB.LeftLinkID = QStoInt(obj.attribute("LeftLINK","-1"));
OB.RightLinkID = QStoInt(obj.attribute("RightLINK","-1"));
OB.BottomLinkID = QStoInt(obj.attribute("BottomLINK","-1"));
OB.LayerNr = QStoInt(obj.attribute("LAYER","0"));
OB.Language = obj.attribute("LANGUAGE", doc->Language);
OB.Transparency = QStodouble(obj.attribute("TransValue","0.0"));
927,9 → 935,37
Neu->NextIt = baseobj + QStoInt(obj.attribute("NEXTITEM"));
Neu->NextPg = a; // QStoInt(obj.attribute("NEXTPAGE"));
}
if (Neu->isTableItem)
{
TableItems.append(Neu);
TableID.insert(QStoInt(obj.attribute("OwnLINK","0")), Neu->ItemNr);
}
counter++;
OBJ=OBJ.nextSibling();
}
if (TableItems.count() != 0)
{
for (uint ttc = 0; ttc < TableItems.count(); ++ttc)
{
PageItem* ta = TableItems.at(ttc);
if (ta->TopLinkID != -1)
ta->TopLink = view->Pages.at(a)->Items.at(TableID[ta->TopLinkID]);
else
ta->TopLink = 0;
if (ta->LeftLinkID != -1)
ta->LeftLink = view->Pages.at(a)->Items.at(TableID[ta->LeftLinkID]);
else
ta->LeftLink = 0;
if (ta->RightLinkID != -1)
ta->RightLink = view->Pages.at(a)->Items.at(TableID[ta->RightLinkID]);
else
ta->RightLink = 0;
if (ta->BottomLinkID != -1)
ta->BottomLink = view->Pages.at(a)->Items.at(TableID[ta->BottomLinkID]);
else
ta->BottomLink = 0;
}
}
if (LFrames.count() != 0)
{
PageItem *Its;
982,6 → 1018,8
QString tmp, tmpf, tmp2, tmp3, tmp4, PgNam, Defont, tmf;
QFont fo;
QMap<QString,QString> DoFonts;
QMap<int,int> TableID;
QPtrList<PageItem> TableItems;
int x, y, a;
double xf, yf;
PageItem *Neu;
1246,6 → 1284,8
}
if(pg.tagName()=="PAGE")
{
TableItems.clear();
TableID.clear();
/*
* Attribute von PAGE auslesen
*/
1453,6 → 1493,10
OB.LeftLine = static_cast<bool>(QStoInt(obj.attribute("LeftLine","0")));
OB.RightLine = static_cast<bool>(QStoInt(obj.attribute("RightLine","0")));
OB.BottomLine = static_cast<bool>(QStoInt(obj.attribute("BottomLine","0")));
OB.TopLinkID = QStoInt(obj.attribute("TopLINK","-1"));
OB.LeftLinkID = QStoInt(obj.attribute("LeftLINK","-1"));
OB.RightLinkID = QStoInt(obj.attribute("RightLINK","-1"));
OB.BottomLinkID = QStoInt(obj.attribute("BottomLINK","-1"));
OB.LayerNr = QStoInt(obj.attribute("LAYER","0"));
OB.Language = obj.attribute("LANGUAGE", doc->Language);
OB.Transparency = QStodouble(obj.attribute("TransValue","0.0"));
1579,9 → 1623,37
doc->LastAuto = Neu;
Neu->NextIt = QStoInt(obj.attribute("NEXTITEM"));
Neu->NextPg = QStoInt(obj.attribute("NEXTPAGE"));
if (Neu->isTableItem)
{
TableItems.append(Neu);
TableID.insert(QStoInt(obj.attribute("OwnLINK","0")), Neu->ItemNr);
}
counter++;
OBJ=OBJ.nextSibling();
}
if (TableItems.count() != 0)
{
for (uint ttc = 0; ttc < TableItems.count(); ++ttc)
{
PageItem* ta = TableItems.at(ttc);
if (ta->TopLinkID != -1)
ta->TopLink = view->Pages.at(a)->Items.at(TableID[ta->TopLinkID]);
else
ta->TopLink = 0;
if (ta->LeftLinkID != -1)
ta->LeftLink = view->Pages.at(a)->Items.at(TableID[ta->LeftLinkID]);
else
ta->LeftLink = 0;
if (ta->RightLinkID != -1)
ta->RightLink = view->Pages.at(a)->Items.at(TableID[ta->RightLinkID]);
else
ta->RightLink = 0;
if (ta->BottomLinkID != -1)
ta->BottomLink = view->Pages.at(a)->Items.at(TableID[ta->BottomLinkID]);
else
ta->BottomLink = 0;
}
}
if (PgNam == "")
view->DocPages = view->Pages;
else
1687,6 → 1759,8
QMap<QString,QString> DoFonts;
QMap<uint,QString> DoVorl;
QMap<QString,QString> DoMul;
QMap<int,int> TableID;
QPtrList<PageItem> TableItems;
uint VorlC;
bool fou;
bool VorLFound = false;
1743,6 → 1817,8
DoVorl[3] = "3";
DoVorl[4] = "4";
VorlC = 5;
TableItems.clear();
TableID.clear();
QString CurDirP = QDir::currentDirPath();
QDir::setCurrent(QString(getenv("HOME")));
while(!DOC.isNull())
2013,6 → 2089,10
OB.LeftLine = static_cast<bool>(QStoInt(pg.attribute("LeftLine","0")));
OB.RightLine = static_cast<bool>(QStoInt(pg.attribute("RightLine","0")));
OB.BottomLine = static_cast<bool>(QStoInt(pg.attribute("BottomLine","0")));
OB.TopLinkID = QStoInt(pg.attribute("TopLINK","-1"));
OB.LeftLinkID = QStoInt(pg.attribute("LeftLINK","-1"));
OB.RightLinkID = QStoInt(pg.attribute("RightLINK","-1"));
OB.BottomLinkID = QStoInt(pg.attribute("BottomLINK","-1"));
OB.Language = pg.attribute("LANGUAGE", doc->Language);
OB.Transparency = QStodouble(pg.attribute("TransValue","0.0"));
if (pg.hasAttribute("TransValueS"))
2140,9 → 2220,38
}
OB.LayerNr = -1;
doc->ActPage->PasteItem(&OB, true, true);
PageItem* Neu = doc->ActPage->Items.at(doc->ActPage->Items.count()-1);
if (Neu->isTableItem)
{
TableItems.append(Neu);
TableID.insert(QStoInt(pg.attribute("OwnLINK","0")), Neu->ItemNr);
}
}
DOC=DOC.nextSibling();
}
if (TableItems.count() != 0)
{
for (uint ttc = 0; ttc < TableItems.count(); ++ttc)
{
PageItem* ta = TableItems.at(ttc);
if (ta->TopLinkID != -1)
ta->TopLink = doc->ActPage->Items.at(TableID[ta->TopLinkID]);
else
ta->TopLink = 0;
if (ta->LeftLinkID != -1)
ta->LeftLink = doc->ActPage->Items.at(TableID[ta->LeftLinkID]);
else
ta->LeftLink = 0;
if (ta->RightLinkID != -1)
ta->RightLink = doc->ActPage->Items.at(TableID[ta->RightLinkID]);
else
ta->RightLink = 0;
if (ta->BottomLinkID != -1)
ta->BottomLink = doc->ActPage->Items.at(TableID[ta->BottomLinkID]);
else
ta->BottomLink = 0;
}
}
doc->GroupCounter = GrMax + 1;
QDir::setCurrent(CurDirP);
return true;
2330,6 → 2439,26
ob.setAttribute("LeftLine", static_cast<int>(item->LeftLine));
ob.setAttribute("RightLine", static_cast<int>(item->RightLine));
ob.setAttribute("BottomLine", static_cast<int>(item->BottomLine));
if (item->isTableItem)
{
if (item->TopLink != 0)
ob.setAttribute("TopLINK", item->TopLink->ItemNr);
else
ob.setAttribute("TopLINK", -1);
if (item->LeftLink != 0)
ob.setAttribute("LeftLINK", item->LeftLink->ItemNr);
else
ob.setAttribute("LeftLINK", -1);
if (item->RightLink != 0)
ob.setAttribute("RightLINK", item->RightLink->ItemNr);
else
ob.setAttribute("RightLINK", -1);
if (item->BottomLink != 0)
ob.setAttribute("BottomLINK", item->BottomLink->ItemNr);
else
ob.setAttribute("BottomLINK", -1);
ob.setAttribute("OwnLINK", item->ItemNr);
}
for(uint k=0;k<item->Ptext.count();++k)
{
QDomElement it=docu.createElement("ITEXT");
2691,6 → 2820,26
ob.setAttribute("LeftLine", static_cast<int>(item->LeftLine));
ob.setAttribute("RightLine", static_cast<int>(item->RightLine));
ob.setAttribute("BottomLine", static_cast<int>(item->BottomLine));
if (item->isTableItem)
{
if (item->TopLink != 0)
ob.setAttribute("TopLINK", item->TopLink->ItemNr);
else
ob.setAttribute("TopLINK", -1);
if (item->LeftLink != 0)
ob.setAttribute("LeftLINK", item->LeftLink->ItemNr);
else
ob.setAttribute("LeftLINK", -1);
if (item->RightLink != 0)
ob.setAttribute("RightLINK", item->RightLink->ItemNr);
else
ob.setAttribute("RightLINK", -1);
if (item->BottomLink != 0)
ob.setAttribute("BottomLINK", item->BottomLink->ItemNr);
else
ob.setAttribute("BottomLINK", -1);
ob.setAttribute("OwnLINK", item->ItemNr);
}
for(uint k=0;k<item->Ptext.count();++k)
{
QDomElement it=docu.createElement("ITEXT");