Subversion Repositories Scribus

Compare Revisions

Ignore whitespace Rev 2281 → Rev 2282

/branches/Version13x/Scribus/scribus/fileloader.cpp
314,7 → 314,7
QMap<int,int> TableID;
QPtrList<PageItem> TableItems;
int a;
double xf;
double xf, xf2;
PageItem *Neu;
Page* Apage;
LFrames.clear();
582,21 → 582,45
vg.txtUnderWidth=qRound(QStodouble(pg.attribute("TXTULW", "-0.1")) * 10);
vg.txtStrikePos=qRound(QStodouble(pg.attribute("TXTSTP", "-0.1")) * 10);
vg.txtStrikeWidth=qRound(QStodouble(pg.attribute("TXTSTW", "-0.1")) * 10);
vg.TabValues.clear();
if ((pg.hasAttribute("NUMTAB")) && (QStoInt(pg.attribute("NUMTAB","0")) != 0))
{
struct PageItem::TabRecord tb;
tmp = pg.attribute("TABS");
QTextStream tgv(&tmp, IO_ReadOnly);
vg.TabValues.clear();
for (int cxv = 0; cxv < QStoInt(pg.attribute("NUMTAB","0")); ++cxv)
for (int cxv = 0; cxv < QStoInt(pg.attribute("NUMTAB","0")); cxv += 2)
{
tgv >> xf;
vg.TabValues.append(xf);
tgv >> xf2;
tb.tabPosition = xf2;
tb.tabType = static_cast<int>(xf);
tb.tabFillChar = QChar();
vg.TabValues.append(tb);
}
tmp = "";
}
else
vg.TabValues.clear();
vg.tabFillChar = pg.attribute("TabFill", "");
{
QDomNode IT = pg.firstChild();
while(!IT.isNull())
{
QDomElement it = IT.toElement();
if (it.tagName()=="Tabs")
{
struct PageItem::TabRecord tb;
tb.tabPosition = QStodouble(it.attribute("Pos"));
tb.tabType = QStoInt(it.attribute("Type"));
QString tbCh = "";
tbCh = it.attribute("Fill","");
if (tbCh == "")
tb.tabFillChar = QChar();
else
tb.tabFillChar = tbCh[0];
vg.TabValues.append(tb);
}
IT=IT.nextSibling();
}
}
doc->docParagraphStyles.append(vg);
}
if(pg.tagName()=="JAVA")
1231,7 → 1255,7
PageItem *currItem;
QString tmp;
int xi;
double xf, yf;
double xf, yf, xf2;
QString clPath;
QDomNode IT;
switch (pt)
1475,20 → 1499,45
else
currItem->Groups.clear();
tmp = "";
currItem->TabValues.clear();
if ((obj->hasAttribute("NUMTAB")) && (QStoInt(obj->attribute("NUMTAB","0")) != 0))
{
struct PageItem::TabRecord tb;
tmp = obj->attribute("TABS");
QTextStream tgv(&tmp, IO_ReadOnly);
currItem->TabValues.clear();
for (int cxv = 0; cxv < QStoInt(obj->attribute("NUMTAB","0")); ++cxv)
for (int cxv = 0; cxv < QStoInt(obj->attribute("NUMTAB","0")); cxv += 2)
{
tgv >> xf;
currItem->TabValues.append(xf);
tgv >> xf2;
tb.tabPosition = xf2;
tb.tabType = static_cast<int>(xf);
tb.tabFillChar = QChar();
currItem->TabValues.append(tb);
}
tmp = "";
}
else
currItem->TabValues.clear();
{
IT = obj->firstChild();
while(!IT.isNull())
{
QDomElement it = IT.toElement();
if (it.tagName()=="Tabs")
{
struct PageItem::TabRecord tb;
tb.tabPosition = QStodouble(it.attribute("Pos"));
tb.tabType = QStoInt(it.attribute("Type"));
QString tbCh = "";
tbCh = it.attribute("Fill","");
if (tbCh == "")
tb.tabFillChar = QChar();
else
tb.tabFillChar = tbCh[0];
currItem->TabValues.append(tb);
}
IT=IT.nextSibling();
}
}
if ((obj->hasAttribute("NUMDASH")) && (QStoInt(obj->attribute("NUMDASH","0")) != 0))
{
tmp = obj->attribute("DASHS");
/branches/Version13x/Scribus/scribus/edit1format.h
63,8 → 63,6
QCheckBox* BaseGrid;
QLabel* CapLabel;
QSpinBox* DropLines;
QComboBox* tabFillCombo;
QLabel* tabFillComboT;
QPushButton* Cancel;
QPushButton* OkButton;
struct ParagraphStyle *werte;
/branches/Version13x/Scribus/scribus/tabtools.h
118,6 → 118,8
virtual void changeImageScalingRatio(int);
virtual void setSample();
virtual void setTool();
virtual void setFillChar();
virtual void setCustomFillChar(const QString &txt);
 
protected:
QHBoxLayout* tabToolsLayout;
/branches/Version13x/Scribus/scribus/gtaction.cpp
223,7 → 223,7
textFrame->ColGap = fstyle->getColumnsGap();
textFrame->setFillColor(parseColor(fstyle->getBgColor()));
textFrame->setFillShade(fstyle->getBgShade());
textFrame->TabValues = QValueList<double>(*(fstyle->getTabValues()));
textFrame->TabValues = QValueList<PageItem::TabRecord>(*(fstyle->getTabValues()));
// gtParagraphStyle* pstyle = new gtParagraphStyle(*fstyle);
// int pstyleIndex = findParagraphStyle(pstyle);
323,10 → 323,10
vg.Font = validateFont(font);
vg.FontSize = font->getSize();
vg.TabValues.clear();
QValueList<double> *tabs = pstyle->getTabValues();
QValueList<PageItem::TabRecord> *tabs = pstyle->getTabValues();
for (uint i = 0; i < tabs->size(); ++i)
{
double tmp = (*tabs)[i];
struct PageItem::TabRecord tmp = (*tabs)[i];
vg.TabValues.append(tmp);
}
vg.Drop = pstyle->hasDropCap();
337,7 → 337,6
vg.SColor = parseColor(font->getStrokeColor());
vg.SShade = font->getStrokeShade();
vg.BaseAdj = pstyle->isAdjToBaseline();
vg.tabFillChar = ScApp->doc->toolSettings.tabFillChar;
vg.txtShadowX = 50;
vg.txtShadowY = -50;
vg.txtOutline = 10;
388,10 → 387,10
vg.Font = validateFont(font);
vg.FontSize = font->getSize();
vg.TabValues.clear();
QValueList<double> *tabs = pstyle->getTabValues();
QValueList<PageItem::TabRecord> *tabs = pstyle->getTabValues();
for (uint i = 0; i < tabs->size(); ++i)
{
double tmp = (*tabs)[i];
struct PageItem::TabRecord tmp = (*tabs)[i];
vg.TabValues.append(tmp);
}
vg.Drop = pstyle->hasDropCap();
402,7 → 401,6
vg.SColor = parseColor(font->getStrokeColor());
vg.SShade = font->getStrokeShade();
vg.BaseAdj = pstyle->isAdjToBaseline();
vg.tabFillChar = ScApp->doc->toolSettings.tabFillChar;
vg.txtShadowX = 50;
vg.txtShadowY = -50;
vg.txtOutline = 10;
/branches/Version13x/Scribus/scribus/util.cpp
1352,7 → 1352,7
{
QString tmp;
int x, y;
double xf, yf;
double xf, yf, xf2;
OB->PType = static_cast<PageItem::ItemType>(QStoInt(obj->attribute("PTYPE")));
OB->Width=QStodouble(obj->attribute("WIDTH"));
OB->Height=QStodouble(obj->attribute("HEIGHT"));
1548,13 → 1548,18
tmp = "";
if ((obj->hasAttribute("NUMTAB")) && (QStoInt(obj->attribute("NUMTAB","0")) != 0))
{
struct PageItem::TabRecord tb;
tmp = obj->attribute("TABS");
QTextStream tgv(&tmp, IO_ReadOnly);
OB->TabValues.clear();
for (int cxv = 0; cxv < QStoInt(obj->attribute("NUMTAB","0")); ++cxv)
for (int cxv = 0; cxv < QStoInt(obj->attribute("NUMTAB","0")); cxv += 2)
{
tgv >> xf;
OB->TabValues.append(xf);
tgv >> xf2;
tb.tabPosition = xf2;
tb.tabType = static_cast<int>(xf);
tb.tabFillChar = QChar();
OB->TabValues.append(tb);
}
tmp = "";
}
/branches/Version13x/Scribus/scribus/tabmanager.h
4,6 → 4,7
#include <qvariant.h>
#include <qdialog.h>
#include <qvaluelist.h>
#include "pageitem.h"
 
class QVBoxLayout;
class QHBoxLayout;
15,12 → 16,12
Q_OBJECT
 
public:
TabManager( QWidget* parent, int dEin, QValueList<double> inTab, double wid);
TabManager( QWidget* parent, int dEin, QValueList<PageItem::TabRecord> inTab, double wid);
~TabManager() {};
Tabruler* TabList;
QPushButton* OKButton;
QPushButton* CancelButton;
QValueList<double> tmpTab;
QValueList<PageItem::TabRecord> tmpTab;
 
public slots:
void exitOK();
/branches/Version13x/Scribus/scribus/hruler.cpp
100,9 → 100,9
}
if (TabValues.count() != 0)
{
for (int yg = 0; yg < static_cast<int>(TabValues.count()-1); yg += 2)
for (int yg = 0; yg < static_cast<int>(TabValues.count()); yg++)
{
Pos = (ItemPos+TabValues[yg+1]+(ColWidth+ColGap)*(ActCol-1)+Offset+Extra+lineCorr)*Scaling-offs;
Pos = (ItemPos+TabValues[yg].tabPosition+(ColWidth+ColGap)*(ActCol-1)+Offset+Extra+lineCorr)*Scaling-offs;
fpo = QRect(static_cast<int>(Pos)-3, 15, 8, 8);
if (fpo.contains(m->pos()))
{
116,8 → 116,11
{
double Pos = (ItemPos+Extra+lineCorr+Offset)*Scaling-offs;
int newY = m->x() - static_cast<int>(Pos);
TabValues.prepend(newY / Scaling);
TabValues.prepend(0);
struct PageItem::TabRecord tb;
tb.tabPosition = newY / Scaling;
tb.tabType = 0;
tb.tabFillChar = doku->toolSettings.tabFillChar[0];
TabValues.prepend(tb);
ActTab = 0;
RulerCode = 5;
UpdateTabList();
170,9 → 173,9
case 5:
if (m->button() == RightButton)
{
TabValues[ActTab] += 1.0;
if (TabValues[ActTab] > 4.0)
TabValues[ActTab] = 0.0;
TabValues[ActTab].tabType += 1;
if (TabValues[ActTab].tabType > 4)
TabValues[ActTab].tabType = 0;
}
if (doku->currentParaStyle > 4)
doku->docParagraphStyles[doku->currentParaStyle].TabValues = TabValues;
188,9 → 191,8
{
if (RulerCode == 5)
{
QValueList<double>::Iterator it;
QValueList<PageItem::TabRecord>::Iterator it;
it = TabValues.at(ActTab);
it = TabValues.remove(it);
TabValues.remove(it);
ActTab = 0;
if (doku->currentParaStyle > 4)
283,12 → 285,12
repaint();
break;
case 5:
TabValues[ActTab+1] -= (MouseX - m->x()) / Scaling;
if (TabValues[ActTab+1] < 0)
TabValues[ActTab+1] = 0;
if (TabValues[ActTab+1] > ColWidth-1)
TabValues[ActTab+1] = ColWidth-1;
emit MarkerMoved(TabValues[ActTab+1], 0);
TabValues[ActTab].tabPosition -= (MouseX - m->x()) / Scaling;
if (TabValues[ActTab].tabPosition < 0)
TabValues[ActTab].tabPosition = 0;
if (TabValues[ActTab].tabPosition > ColWidth-1)
TabValues[ActTab].tabPosition = ColWidth-1;
emit MarkerMoved(TabValues[ActTab].tabPosition, 0);
UpdateTabList();
repaint();
break;
346,9 → 348,9
{
for (int CurrCol = 0; CurrCol < Cols; ++CurrCol)
{
for (int yg = 0; yg < static_cast<int>(TabValues.count()-1); yg += 2)
for (int yg = 0; yg < static_cast<int>(TabValues.count()); yg++)
{
Pos = (ItemPos+TabValues[yg+1]+(ColWidth+ColGap)*CurrCol+Offset+Extra+lineCorr)*Scaling-offs;
Pos = (ItemPos+TabValues[yg].tabPosition+(ColWidth+ColGap)*CurrCol+Offset+Extra+lineCorr)*Scaling-offs;
fpo = QRect(static_cast<int>(Pos)-3, 15, 8, 8);
if (fpo.contains(m->pos()))
{
628,17 → 630,17
if (TabValues.count() != 0)
{
p.setPen(QPen(black, 2, SolidLine, FlatCap, MiterJoin));
for (int yg = 0; yg < static_cast<int>(TabValues.count()-1); yg += 2)
for (int yg = 0; yg < static_cast<int>(TabValues.count()); yg++)
{
if (Pos+TabValues[yg+1] < EndPos)
if (Pos+TabValues[yg].tabPosition < EndPos)
{
switch (static_cast<int>(TabValues[yg]))
switch (static_cast<int>(TabValues[yg].tabType))
{
case 0:
if (Revers)
{
p.save();
p.translate(qRound((Pos+TabValues[yg+1])*sc),0);
p.translate(qRound((Pos+TabValues[yg].tabPosition)*sc),0);
p.scale(-1,1);
p.drawLine(0, 15, 0, 23);
p.drawLine(0, 23, 8, 23);
646,8 → 648,8
}
else
{
p.drawLine(qRound((Pos+TabValues[yg+1])*sc), 15, qRound((Pos+TabValues[yg+1])*sc), 23);
p.drawLine(qRound((Pos+TabValues[yg+1])*sc), 23, qRound((Pos+TabValues[yg+1]+8/sc)*sc), 23);
p.drawLine(qRound((Pos+TabValues[yg].tabPosition)*sc), 15, qRound((Pos+TabValues[yg].tabPosition)*sc), 23);
p.drawLine(qRound((Pos+TabValues[yg].tabPosition)*sc), 23, qRound((Pos+TabValues[yg].tabPosition+8/sc)*sc), 23);
}
break;
case 1:
654,7 → 656,7
if (Revers)
{
p.save();
p.translate(qRound((Pos+TabValues[yg+1])*sc),0);
p.translate(qRound((Pos+TabValues[yg].tabPosition)*sc),0);
p.scale(-1,1);
p.drawLine(0, 15, 0, 23);
p.drawLine(0, 23, -8, 23);
662,19 → 664,19
}
else
{
p.drawLine(qRound((Pos+TabValues[yg+1])*sc), 15, qRound((Pos+TabValues[yg+1])*sc), 23);
p.drawLine(qRound((Pos+TabValues[yg+1])*sc), 23, qRound((Pos+TabValues[yg+1]-8/sc)*sc), 23);
p.drawLine(qRound((Pos+TabValues[yg].tabPosition)*sc), 15, qRound((Pos+TabValues[yg].tabPosition)*sc), 23);
p.drawLine(qRound((Pos+TabValues[yg].tabPosition)*sc), 23, qRound((Pos+TabValues[yg].tabPosition-8/sc)*sc), 23);
}
break;
case 2:
case 3:
p.drawLine(qRound((Pos+TabValues[yg+1])*sc), 15, qRound((Pos+TabValues[yg+1])*sc), 23);
p.drawLine(qRound((Pos+TabValues[yg+1]-4/sc)*sc), 23, qRound((Pos+TabValues[yg+1]+4/sc)*sc), 23);
p.drawLine(qRound((Pos+TabValues[yg+1]+3/sc)*sc), 20, qRound((Pos+TabValues[yg+1]+2/sc)*sc), 20);
p.drawLine(qRound((Pos+TabValues[yg].tabPosition)*sc), 15, qRound((Pos+TabValues[yg].tabPosition)*sc), 23);
p.drawLine(qRound((Pos+TabValues[yg].tabPosition-4/sc)*sc), 23, qRound((Pos+TabValues[yg].tabPosition+4/sc)*sc), 23);
p.drawLine(qRound((Pos+TabValues[yg].tabPosition+3/sc)*sc), 20, qRound((Pos+TabValues[yg].tabPosition+2/sc)*sc), 20);
break;
case 4:
p.drawLine(qRound((Pos+TabValues[yg+1])*sc), 15, qRound((Pos+TabValues[yg+1])*sc), 23);
p.drawLine(qRound((Pos+TabValues[yg+1]-4/sc)*sc), 23, qRound((Pos+TabValues[yg+1]+4/sc)*sc), 23);
p.drawLine(qRound((Pos+TabValues[yg].tabPosition)*sc), 15, qRound((Pos+TabValues[yg].tabPosition)*sc), 23);
p.drawLine(qRound((Pos+TabValues[yg].tabPosition-4/sc)*sc), 23, qRound((Pos+TabValues[yg].tabPosition+4/sc)*sc), 23);
break;
default:
break;
707,30 → 709,29
 
void Hruler::UpdateTabList()
{
QValueList<double>::Iterator it;
double CurX = TabValues[ActTab+1];
int gg = static_cast<int>(TabValues.count()-1);
struct PageItem::TabRecord tb;
tb.tabPosition = TabValues[ActTab].tabPosition;
tb.tabType = TabValues[ActTab].tabType;
tb.tabFillChar = TabValues[ActTab].tabFillChar;
QValueList<PageItem::TabRecord>::Iterator it;
int gg = static_cast<int>(TabValues.count());
int g = gg;
double type = TabValues[ActTab];
it = TabValues.at(ActTab);
it = TabValues.remove(it);
TabValues.remove(it);
for (int yg = static_cast<int>(TabValues.count()-1); yg > 0; yg -= 2)
for (int yg = static_cast<int>(TabValues.count()-1); yg > -1; yg--)
{
if (CurX < TabValues[yg])
if (tb.tabPosition < TabValues[yg].tabPosition)
g = yg;
}
ActTab = g-1;
ActTab = g;
if (gg == g)
{
TabValues.append(type);
TabValues.append(CurX);
ActTab = static_cast<int>(TabValues.count()-2);
TabValues.append(tb);
ActTab = static_cast<int>(TabValues.count()-1);
}
else
{
it = TabValues.at(ActTab);
it = TabValues.insert(it, CurX);
TabValues.insert(it, type);
TabValues.insert(it, tb);
}
}
/branches/Version13x/Scribus/scribus/about.cpp
51,7 → 51,7
tabLayout1->addWidget( pixmapLabel1 );
buildID = new QLabel( tab, "BB" );
buildID->setAlignment(Qt::AlignCenter);
QString bu = tr("%1 %2 %3 ").arg("27").arg("May").arg("2005");
QString bu = tr("%1 %2 %3 ").arg("28").arg("May").arg("2005");
#ifdef HAVE_CMS
bu += "C";
#else
/branches/Version13x/Scribus/scribus/scribusdoc.cpp
165,7 → 165,6
vg.SColor = toolSettings.dPen;
vg.SShade = toolSettings.dShade2;
vg.BaseAdj = false;
vg.tabFillChar = toolSettings.tabFillChar;
vg.txtShadowX = 50;
vg.txtShadowY = -50;
vg.txtOutline = 10;
/branches/Version13x/Scribus/scribus/editformats.cpp
25,6 → 25,7
StyleView->header()->setResizeEnabled( FALSE, StyleView->header()->count() - 1 );
StyleView->setSorting(-1);
int counter = 5;
bool tabEQ = false;
for (uint x = 5; x < styleList->count(); ++x)
{
struct ParagraphStyle vg;
36,12 → 37,34
vg2 = (*styleOld)[xx];
if (vg.Vname == vg2.Vname)
{
struct PageItem::TabRecord tb;
tabEQ = false;
for (uint t1 = 0; t1 < vg2.TabValues.count(); t1++)
{
tb.tabPosition = vg2.TabValues[t1].tabPosition;
tb.tabType = vg2.TabValues[t1].tabType;
tb.tabFillChar = vg2.TabValues[t1].tabFillChar;
for (uint t2 = 0; t2 < vg.TabValues.count(); t2++)
{
struct PageItem::TabRecord tb2;
tb2.tabPosition = vg.TabValues[t2].tabPosition;
tb2.tabType = vg.TabValues[t2].tabType;
tb2.tabFillChar = vg.TabValues[t2].tabFillChar;
if ((tb2.tabFillChar == tb.tabFillChar) && (tb2.tabPosition == tb.tabPosition) && (tb2.tabType == tb.tabType))
{
tabEQ = true;
break;
}
}
if (tabEQ)
break;
}
if ((vg.LineSpa == vg2.LineSpa) && (vg.Indent == vg2.Indent) && (vg.First == vg2.First) &&
(vg.textAlignment == vg2.textAlignment) && (vg.gapBefore == vg2.gapBefore) &&
(vg.gapAfter == vg2.gapAfter) && (vg.Font == vg2.Font) && (vg.TabValues == vg2.TabValues) &&
(vg.Drop == vg2.Drop) && (vg.DropLin == vg2.DropLin) && (vg.FontEffect == vg2.FontEffect) &&
(vg.gapAfter == vg2.gapAfter) && (vg.Font == vg2.Font) && (tabEQ)
&& (vg.Drop == vg2.Drop) && (vg.DropLin == vg2.DropLin) && (vg.FontEffect == vg2.FontEffect) &&
(vg.FColor == vg2.FColor) && (vg.FShade == vg2.FShade) && (vg.SColor == vg2.SColor) &&
(vg.tabFillChar == vg2.tabFillChar) && (vg.txtShadowX == vg2.txtShadowX) && (vg.txtShadowY == vg2.txtShadowY) &&
(vg.txtShadowX == vg2.txtShadowX) && (vg.txtShadowY == vg2.txtShadowY) &&
(vg.txtOutline == vg2.txtOutline) && (vg.txtUnderPos == vg2.txtUnderPos) && (vg.txtUnderWidth == vg2.txtUnderWidth) &&
(vg.txtStrikePos == vg2.txtStrikePos) && (vg.txtStrikeWidth == vg2.txtStrikeWidth) &&
(vg.SShade == vg2.SShade) && (vg.BaseAdj == vg2.BaseAdj) && (vg.FontSize == vg2.FontSize))
204,7 → 227,6
sty.SColor = TempVorl[sFnumber].SColor;
sty.SShade = TempVorl[sFnumber].SShade;
sty.BaseAdj = TempVorl[sFnumber].BaseAdj;
sty.tabFillChar = TempVorl[sFnumber].tabFillChar;
sty.txtShadowX = TempVorl[sFnumber].txtShadowX;
sty.txtShadowY = TempVorl[sFnumber].txtShadowY;
sty.txtOutline = TempVorl[sFnumber].txtOutline;
243,7 → 265,6
sty.SColor = Docu->toolSettings.dPen;
sty.SShade = Docu->toolSettings.dShade2;
sty.BaseAdj = false;
sty.tabFillChar = Docu->toolSettings.tabFillChar;
sty.txtShadowX = 50;
sty.txtShadowY = -50;
sty.txtOutline = 10;
/branches/Version13x/Scribus/scribus/hruler.h
20,6 → 20,7
 
#include <qwidget.h>
#include <qpainter.h>
#include "pageitem.h"
 
class ScribusView;
class ScribusDoc;
44,7 → 45,7
int Markp;
bool repX;
bool Mpressed;
QValueList<double> TabValues;
QValueList<PageItem::TabRecord> TabValues;
double ItemPos;
double ItemEndPos;
int Cols;
/branches/Version13x/Scribus/scribus/scribusXml.cpp
489,12 → 489,6
colp += tmp.setNum(xf) + " " + tmpy.setNum(yf) + " ";
}
ob->setAttribute("COCOOR", colp);
ob->setAttribute("NUMTAB", static_cast<int>(item->TabValues.count()));
QString tlp = "";
QValueList<double>::Iterator tax;
for (tax = item->TabValues.begin(); tax != item->TabValues.end(); ++tax)
tlp += tmp.setNum((*tax)) + " ";
ob->setAttribute("TABS", tlp);
ob->setAttribute("NUMGROUP", static_cast<int>(item->Groups.count()));
QString glp = "";
QValueStack<int>::Iterator nx;
564,8 → 558,9
{
bool fou;
QString tmpf, tmf, tmV;
double xf;
double xf, xf2;
fou = false;
bool tabEQ = false;
vg->Vname = pg->attribute("NAME");
vg->LineSpa = QStodouble(pg->attribute("LINESP"));
vg->Indent = QStodouble(pg->attribute("INDENT","0"));
598,25 → 593,72
vg->txtUnderWidth=qRound(QStodouble(pg->attribute("TXTULW", "-0.1")) * 10);
vg->txtStrikePos=qRound(QStodouble(pg->attribute("TXTSTP", "-0.1")) * 10);
vg->txtStrikeWidth=qRound(QStodouble(pg->attribute("TXTSTW", "-0.1")) * 10);
vg->TabValues.clear();
if ((pg->hasAttribute("NUMTAB")) && (QStoInt(pg->attribute("NUMTAB","0")) != 0))
{
struct PageItem::TabRecord tb;
QString tmp = pg->attribute("TABS");
QTextStream tgv(&tmp, IO_ReadOnly);
vg->TabValues.clear();
for (int cxv = 0; cxv < QStoInt(pg->attribute("NUMTAB","0")); ++cxv)
for (int cxv = 0; cxv < QStoInt(pg->attribute("NUMTAB","0")); cxv += 2)
{
tgv >> xf;
vg->TabValues.append(xf);
tgv >> xf2;
tb.tabPosition = xf2;
tb.tabType = static_cast<int>(xf);
tb.tabFillChar = QChar();
vg->TabValues.append(tb);
}
tmp = "";
}
else
vg->TabValues.clear();
vg->tabFillChar = pg->attribute("TabFill", "");
{
QDomNode IT = pg->firstChild();
while(!IT.isNull())
{
QDomElement it = IT.toElement();
if (it.tagName()=="Tabs")
{
struct PageItem::TabRecord tb;
tb.tabPosition = QStodouble(it.attribute("Pos"));
tb.tabType = QStoInt(it.attribute("Type"));
QString tbCh = "";
tbCh = it.attribute("Fill","");
if (tbCh == "")
tb.tabFillChar = QChar();
else
tb.tabFillChar = tbCh[0];
vg->TabValues.append(tb);
}
IT=IT.nextSibling();
}
}
for (uint xx=0; xx<docParagraphStyles.count(); ++xx)
{
if (vg->Vname == docParagraphStyles[xx].Vname)
{
struct PageItem::TabRecord tb;
tabEQ = false;
for (uint t1 = 0; t1 < docParagraphStyles[xx].TabValues.count(); t1++)
{
tb.tabPosition = docParagraphStyles[xx].TabValues[t1].tabPosition;
tb.tabType = docParagraphStyles[xx].TabValues[t1].tabType;
tb.tabFillChar = docParagraphStyles[xx].TabValues[t1].tabFillChar;
for (uint t2 = 0; t2 < vg->TabValues.count(); t2++)
{
struct PageItem::TabRecord tb2;
tb2.tabPosition = vg->TabValues[t2].tabPosition;
tb2.tabType = vg->TabValues[t2].tabType;
tb2.tabFillChar = vg->TabValues[t2].tabFillChar;
if ((tb2.tabFillChar == tb.tabFillChar) && (tb2.tabPosition == tb.tabPosition) && (tb2.tabType == tb.tabType))
{
tabEQ = true;
break;
}
}
if (tabEQ)
break;
}
if ((vg->LineSpa == docParagraphStyles[xx].LineSpa) &&
(vg->Indent == docParagraphStyles[xx].Indent) &&
(vg->First == docParagraphStyles[xx].First) &&
623,8 → 665,7
(vg->textAlignment == docParagraphStyles[xx].textAlignment) &&
(vg->gapBefore == docParagraphStyles[xx].gapBefore) &&
(vg->gapAfter == docParagraphStyles[xx].gapAfter) &&
(vg->Font == docParagraphStyles[xx].Font) &&
(vg->TabValues == docParagraphStyles[xx].TabValues) &&
(vg->Font == docParagraphStyles[xx].Font) && (tabEQ) &&
(vg->Drop == docParagraphStyles[xx].Drop) &&
(vg->DropLin == docParagraphStyles[xx].DropLin) &&
(vg->FontEffect == docParagraphStyles[xx].FontEffect) &&
633,7 → 674,6
(vg->SColor == docParagraphStyles[xx].SColor) &&
(vg->SShade == docParagraphStyles[xx].SShade) &&
(vg->BaseAdj == docParagraphStyles[xx].BaseAdj) &&
(vg->tabFillChar == docParagraphStyles[xx].tabFillChar) &&
(vg->txtShadowX == docParagraphStyles[xx].txtShadowX) &&
(vg->txtShadowY == docParagraphStyles[xx].txtShadowY) &&
(vg->txtOutline == docParagraphStyles[xx].txtOutline) &&
662,6 → 702,28
{
for (uint xx=0; xx< docParagraphStyles.count(); ++xx)
{
struct PageItem::TabRecord tb;
tabEQ = false;
for (uint t1 = 0; t1 < docParagraphStyles[xx].TabValues.count(); t1++)
{
tb.tabPosition = docParagraphStyles[xx].TabValues[t1].tabPosition;
tb.tabType = docParagraphStyles[xx].TabValues[t1].tabType;
tb.tabFillChar = docParagraphStyles[xx].TabValues[t1].tabFillChar;
for (uint t2 = 0; t2 < vg->TabValues.count(); t2++)
{
struct PageItem::TabRecord tb2;
tb2.tabPosition = vg->TabValues[t2].tabPosition;
tb2.tabType = vg->TabValues[t2].tabType;
tb2.tabFillChar = vg->TabValues[t2].tabFillChar;
if ((tb2.tabFillChar == tb.tabFillChar) && (tb2.tabPosition == tb.tabPosition) && (tb2.tabType == tb.tabType))
{
tabEQ = true;
break;
}
}
if (tabEQ)
break;
}
if ((vg->LineSpa == docParagraphStyles[xx].LineSpa) &&
(vg->Indent == docParagraphStyles[xx].Indent) &&
(vg->First == docParagraphStyles[xx].First) &&
668,8 → 730,7
(vg->textAlignment == docParagraphStyles[xx].textAlignment) &&
(vg->gapBefore == docParagraphStyles[xx].gapBefore) &&
(vg->gapAfter == docParagraphStyles[xx].gapAfter) &&
(vg->Font == docParagraphStyles[xx].Font) &&
(vg->TabValues == docParagraphStyles[xx].TabValues) &&
(vg->Font == docParagraphStyles[xx].Font) && (tabEQ) &&
(vg->Drop == docParagraphStyles[xx].Drop) &&
(vg->DropLin == docParagraphStyles[xx].DropLin) &&
(vg->FontEffect == docParagraphStyles[xx].FontEffect) &&
678,7 → 739,6
(vg->SColor == docParagraphStyles[xx].SColor) &&
(vg->SShade == docParagraphStyles[xx].SShade) &&
(vg->BaseAdj == docParagraphStyles[xx].BaseAdj) &&
(vg->tabFillChar == docParagraphStyles[xx].tabFillChar) &&
(vg->txtShadowX == docParagraphStyles[xx].txtShadowX) &&
(vg->txtShadowY == docParagraphStyles[xx].txtShadowY) &&
(vg->txtOutline == docParagraphStyles[xx].txtOutline) &&
1184,7 → 1244,7
QMap<int,int> TableID;
QPtrList<PageItem> TableItems;
int x, a;
double xf;
double xf, xf2;
PageItem *Neu;
LFrames.clear();
QDomDocument docu("scridoc");
1387,16 → 1447,20
tmp = pg.attribute("TABS");
QTextStream tgv(&tmp, IO_ReadOnly);
vg.TabValues.clear();
for (int cxv = 0; cxv < QStoInt(pg.attribute("NUMTAB","0")); ++cxv)
struct PageItem::TabRecord tb;
for (int cxv = 0; cxv < QStoInt(pg.attribute("NUMTAB","0")); cxv += 2)
{
tgv >> xf;
vg.TabValues.append(xf);
tgv >> xf2;
tb.tabPosition = xf2;
tb.tabType = static_cast<int>(xf);
tb.tabFillChar = QChar();
vg.TabValues.append(tb);
}
tmp = "";
}
else
vg.TabValues.clear();
vg.tabFillChar = "";
doc->docParagraphStyles.append(vg);
}
if(pg.tagName()=="JAVA")
2055,6 → 2119,19
OB.GrColor = "";
OB.GrColor2 = "";
}
if (it.tagName()=="Tabs")
{
struct PageItem::TabRecord tb;
tb.tabPosition = QStodouble(it.attribute("Pos"));
tb.tabType = QStoInt(it.attribute("Type"));
QString tbCh = "";
tbCh = it.attribute("Fill","");
if (tbCh == "")
tb.tabFillChar = QChar();
else
tb.tabFillChar = tbCh[0];
OB.TabValues.append(tb);
}
if (it.tagName()=="ITEXT")
tmp += GetItemText(&it, doc, Prefs, VorLFound, true, false);
IT=IT.nextSibling();
2177,7 → 2254,6
vg.SColor = doc->docParagraphStyles[item->textAlignment].SColor;
vg.SShade = doc->docParagraphStyles[item->textAlignment].SShade;
vg.BaseAdj = doc->docParagraphStyles[item->textAlignment].BaseAdj;
vg.tabFillChar = doc->docParagraphStyles[item->textAlignment].tabFillChar;
vg.txtShadowX = doc->docParagraphStyles[item->textAlignment].txtShadowX;
vg.txtShadowY = doc->docParagraphStyles[item->textAlignment].txtShadowY;
vg.txtOutline = doc->docParagraphStyles[item->textAlignment].txtOutline;
2211,7 → 2287,6
vg.SColor = doc->docParagraphStyles[item->itemText.at(tx)->cab].SColor;
vg.SShade = doc->docParagraphStyles[item->itemText.at(tx)->cab].SShade;
vg.BaseAdj = doc->docParagraphStyles[item->itemText.at(tx)->cab].BaseAdj;
vg.tabFillChar = doc->docParagraphStyles[item->itemText.at(tx)->cab].tabFillChar;
vg.txtShadowX = doc->docParagraphStyles[item->itemText.at(tx)->cab].txtShadowX;
vg.txtShadowY = doc->docParagraphStyles[item->itemText.at(tx)->cab].txtShadowY;
vg.txtOutline = doc->docParagraphStyles[item->itemText.at(tx)->cab].txtOutline;
2244,17 → 2319,24
fo.setAttribute("DROP", static_cast<int>(UsedStyles[actSt].Drop));
fo.setAttribute("DROPLIN", UsedStyles[actSt].DropLin);
fo.setAttribute("EFFECT", UsedStyles[actSt].FontEffect);
fo.setAttribute("NUMTAB", static_cast<int>(UsedStyles[actSt].TabValues.count()));
QString tlp = "";
QValueList<double>::Iterator tax;
for (tax = UsedStyles[actSt].TabValues.begin(); tax != UsedStyles[actSt].TabValues.end(); ++tax)
tlp += tmp.setNum((*tax)) + " ";
fo.setAttribute("TABS", tlp);
if (UsedStyles[actSt].TabValues.count() != 0)
{
for (uint a = 0; a < UsedStyles[actSt].TabValues.count(); ++a)
{
QDomElement tabs = docu.createElement("Tabs");
tabs.setAttribute("Type", (*UsedStyles[actSt].TabValues.at(a)).tabType);
tabs.setAttribute("Pos", (*UsedStyles[actSt].TabValues.at(a)).tabPosition);
QString tabCh = "";
if (!(*UsedStyles[actSt].TabValues.at(a)).tabFillChar.isNull())
tabCh = QString((*UsedStyles[actSt].TabValues.at(a)).tabFillChar);
tabs.setAttribute("Fill", tabCh);
fo.appendChild(tabs);
}
}
fo.setAttribute("FCOLOR",UsedStyles[actSt].FColor);
fo.setAttribute("FSHADE",UsedStyles[actSt].FShade);
fo.setAttribute("SCOLOR",UsedStyles[actSt].SColor);
fo.setAttribute("SSHADE",UsedStyles[actSt].SShade);
fo.setAttribute("TabFill",UsedStyles[actSt].tabFillChar);
fo.setAttribute("BASE", static_cast<int>(UsedStyles[actSt].BaseAdj));
fo.setAttribute("TXTSHX",UsedStyles[actSt].txtShadowX / 10.0);
fo.setAttribute("TXTSHY",UsedStyles[actSt].txtShadowY / 10.0);
2349,6 → 2431,20
ob.appendChild(imeff);
}
}
if (item->TabValues.count() != 0)
{
for (uint a = 0; a < item->TabValues.count(); ++a)
{
QDomElement tabs = docu.createElement("Tabs");
tabs.setAttribute("Type", (*item->TabValues.at(a)).tabType);
tabs.setAttribute("Pos", (*item->TabValues.at(a)).tabPosition);
QString tabCh = "";
if (!(*item->TabValues.at(a)).tabFillChar.isNull())
tabCh = QString((*item->TabValues.at(a)).tabFillChar);
tabs.setAttribute("Fill", tabCh);
ob.appendChild(tabs);
}
}
if (item->GrType != 0)
{
QPtrVector<VColorStop> cstops = item->fill_gradient.colorStops();
2646,6 → 2742,20
ob.appendChild(imeff);
}
}
if (item->TabValues.count() != 0)
{
for (uint a = 0; a < item->TabValues.count(); ++a)
{
QDomElement tabs = docu->createElement("Tabs");
tabs.setAttribute("Type", (*item->TabValues.at(a)).tabType);
tabs.setAttribute("Pos", (*item->TabValues.at(a)).tabPosition);
QString tabCh = "";
if (!(*item->TabValues.at(a)).tabFillChar.isNull())
tabCh = QString((*item->TabValues.at(a)).tabFillChar);
tabs.setAttribute("Fill", tabCh);
ob.appendChild(tabs);
}
}
ob.setAttribute("ALIGN",item->textAlignment);
ob.setAttribute("BOOKMARK", item->isBookmark ? 1 : 0);
ob.setAttribute("BookNr", item->BMnr);
3071,19 → 3181,25
fo.setAttribute("DROP", static_cast<int>(doc->docParagraphStyles[ff].Drop));
fo.setAttribute("DROPLIN", doc->docParagraphStyles[ff].DropLin);
fo.setAttribute("EFFECT", doc->docParagraphStyles[ff].FontEffect);
fo.setAttribute("NUMTAB", static_cast<int>(doc->docParagraphStyles[ff].TabValues.count()));
QString tlp = "";
QString tmp = "";
QValueList<double>::Iterator tax;
for (tax = doc->docParagraphStyles[ff].TabValues.begin(); tax != doc->docParagraphStyles[ff].TabValues.end(); ++tax)
tlp += tmp.setNum((*tax)) + " ";
fo.setAttribute("TABS", tlp);
if (doc->docParagraphStyles[ff].TabValues.count() != 0)
{
for (uint a = 0; a < doc->docParagraphStyles[ff].TabValues.count(); ++a)
{
QDomElement tabs = docu.createElement("Tabs");
tabs.setAttribute("Type", (*doc->docParagraphStyles[ff].TabValues.at(a)).tabType);
tabs.setAttribute("Pos", (*doc->docParagraphStyles[ff].TabValues.at(a)).tabPosition);
QString tabCh = "";
if (!(*doc->docParagraphStyles[ff].TabValues.at(a)).tabFillChar.isNull())
tabCh = QString((*doc->docParagraphStyles[ff].TabValues.at(a)).tabFillChar);
tabs.setAttribute("Fill", tabCh);
fo.appendChild(tabs);
}
}
fo.setAttribute("FCOLOR",doc->docParagraphStyles[ff].FColor);
fo.setAttribute("FSHADE",doc->docParagraphStyles[ff].FShade);
fo.setAttribute("SCOLOR",doc->docParagraphStyles[ff].SColor);
fo.setAttribute("SSHADE",doc->docParagraphStyles[ff].SShade);
fo.setAttribute("BASE", static_cast<int>(doc->docParagraphStyles[ff].BaseAdj));
fo.setAttribute("TabFill",doc->docParagraphStyles[ff].tabFillChar);
fo.setAttribute("TXTSHX",doc->docParagraphStyles[ff].txtShadowX / 10.0);
fo.setAttribute("TXTSHY",doc->docParagraphStyles[ff].txtShadowY / 10.0);
fo.setAttribute("TXTOUT",doc->docParagraphStyles[ff].txtOutline / 10.0);
/branches/Version13x/Scribus/scribus/edit1format.cpp
101,25 → 101,6
bool enable = vor->Drop ? true : false;
DropLines->setEnabled(enable);
CapLabel->setEnabled(enable);
tabFillCombo = new QComboBox( true, GroupFont, "tabFillCombo" );
tabFillCombo->setEditable(false);
tabFillCombo->insertItem( tr("None"));
tabFillCombo->insertItem( "...");
tabFillCombo->insertItem( "---");
tabFillCombo->insertItem( "___");
if (vor->tabFillChar == "")
tabFillCombo->setCurrentItem(0);
if (vor->tabFillChar == ".")
tabFillCombo->setCurrentItem(1);
if (vor->tabFillChar == "-")
tabFillCombo->setCurrentItem(2);
if (vor->tabFillChar == "_")
tabFillCombo->setCurrentItem(3);
GroupFontLayout->addWidget( tabFillCombo, 3, 4 );
tabFillComboT = new QLabel(tabFillCombo, tr( "Tab Fill Char:" ), GroupFont, "textLabel3b2t" );
GroupFontLayout->addWidget( tabFillComboT, 3, 3 );
 
TxFill = new QComboBox( true, GroupFont, "TxFill" );
TxFill->setEditable(false);
FillIcon = new QLabel( TxFill, tr( "F&ill Color:" ), GroupFont, "FillIcon" );
414,21 → 395,6
werte->SShade = PM1->getValue();
werte->BaseAdj = BaseGrid->isChecked();
werte->TabValues = TabList->getTabVals();
switch (tabFillCombo->currentItem())
{
case 0:
werte->tabFillChar = "";
break;
case 1:
werte->tabFillChar = ".";
break;
case 2:
werte->tabFillChar = "-";
break;
case 3:
werte->tabFillChar = "_";
break;
}
werte->txtShadowX = qRound(EffeS->ShadowVal->Xoffset->value() * 10.0);
werte->txtShadowY = qRound(EffeS->ShadowVal->Yoffset->value() * 10.0);
werte->txtOutline = qRound(EffeS->OutlineVal->LWidth->value() * 10.0);
470,21 → 436,6
tmpStyle.SShade = PM1->getValue();
tmpStyle.BaseAdj = BaseGrid->isChecked();
tmpStyle.TabValues = TabList->getTabVals();
switch (tabFillCombo->currentItem())
{
case 0:
tmpStyle.tabFillChar = "";
break;
case 1:
tmpStyle.tabFillChar = ".";
break;
case 2:
tmpStyle.tabFillChar = "-";
break;
case 3:
tmpStyle.tabFillChar = "_";
break;
}
tmpStyle.txtShadowX = qRound(EffeS->ShadowVal->Xoffset->value() * 10.0);
tmpStyle.txtShadowY = qRound(EffeS->ShadowVal->Yoffset->value() * 10.0);
tmpStyle.txtOutline = qRound(EffeS->OutlineVal->LWidth->value() * 10.0);
/branches/Version13x/Scribus/scribus/tabtools.cpp
159,17 → 159,36
tabFillCombo = new QComboBox( true, subTabText, "tabFillCombo" );
tabFillCombo->setEditable(false);
tabFillCombo->insertItem( tr("None"));
tabFillCombo->insertItem( "...");
tabFillCombo->insertItem( "---");
tabFillCombo->insertItem( "___");
tabFillCombo->insertItem( "Dot");
tabFillCombo->insertItem( "Hypen");
tabFillCombo->insertItem( "Underscore");
tabFillCombo->insertItem( "Custom");
if (prefsData->tabFillChar == "")
{
tabFillCombo->setEditable(false);
tabFillCombo->setCurrentItem(0);
if (prefsData->tabFillChar == ".")
}
else if (prefsData->tabFillChar == ".")
{
tabFillCombo->setEditable(false);
tabFillCombo->setCurrentItem(1);
if (prefsData->tabFillChar == "-")
}
else if (prefsData->tabFillChar == "-")
{
tabFillCombo->setEditable(false);
tabFillCombo->setCurrentItem(2);
if (prefsData->tabFillChar == "_")
}
else if (prefsData->tabFillChar == "_")
{
tabFillCombo->setEditable(false);
tabFillCombo->setCurrentItem(3);
}
else
{
tabFillCombo->setCurrentItem(4);
tabFillCombo->setEditable(true);
tabFillCombo->setEditText( tr("Custom: "+prefsData->tabFillChar));
}
subTabTextLayout->addMultiCellWidget( tabFillCombo, 4, 4, 1, 3, Qt::AlignLeft );
textLabel3b2t = new QLabel(tabFillCombo, tr( "Tab Fill Character:" ), subTabText, "textLabel3b2t" );
subTabTextLayout->addWidget( textLabel3b2t, 4, 0 );
601,6 → 620,8
connect(chainButton, SIGNAL(clicked()), this, SLOT(toggleChain()));
connect(scalingHorizontal, SIGNAL(valueChanged(int)), this, SLOT(hChange()));
connect(scalingVertical, SIGNAL(valueChanged(int)), this, SLOT(vChange()));
connect(tabFillCombo, SIGNAL(activated(int)), this, SLOT(setFillChar()));
connect(tabFillCombo, SIGNAL(textChanged(const QString &)), this, SLOT(setCustomFillChar(const QString &)));
}
 
void TabTools::restoreDefaults()
607,6 → 628,51
{
}
 
void TabTools::setCustomFillChar(const QString &txt)
{
if (txt == tr("Custom:"))
return;
disconnect(tabFillCombo, SIGNAL(textChanged(const QString &)), this, SLOT(setCustomFillChar(const QString &)));
disconnect(tabFillCombo, SIGNAL(activated(int)), this, SLOT(setFillChar()));
QString ret = txt.right(1);
if (tabFillCombo->editable())
{
tabFillCombo->setCurrentItem(4);
tabFillCombo->setEditText( tr("Custom: ")+ret);
tabFillCombo->changeItem( tr("Custom: ")+ret, 4);
}
connect(tabFillCombo, SIGNAL(textChanged(const QString &)), this, SLOT(setCustomFillChar(const QString &)));
connect(tabFillCombo, SIGNAL(activated(int)), this, SLOT(setFillChar()));
}
 
void TabTools::setFillChar()
{
disconnect(tabFillCombo, SIGNAL(textChanged(const QString &)), this, SLOT(setCustomFillChar(const QString &)));
disconnect(tabFillCombo, SIGNAL(activated(int)), this, SLOT(setFillChar()));
switch (tabFillCombo->currentItem())
{
case 0:
tabFillCombo->setEditable(false);
break;
case 1:
tabFillCombo->setEditable(false);
break;
case 2:
tabFillCombo->setEditable(false);
break;
case 3:
tabFillCombo->setEditable(false);
break;
case 4:
tabFillCombo->setEditable(true);
tabFillCombo->setEditText( tr("Custom:"));
tabFillCombo->changeItem( tr("Custom: "), 4);
break;
}
connect(tabFillCombo, SIGNAL(activated(int)), this, SLOT(setFillChar()));
connect(tabFillCombo, SIGNAL(textChanged(const QString &)), this, SLOT(setCustomFillChar(const QString &)));
}
 
/*!
\fn void TabTools::ToggleKette()
\author Franz Schmid
/branches/Version13x/Scribus/scribus/pageitem.h
112,7 → 112,14
PathText = 8
};
 
struct TabRecord
{
double tabPosition;
int tabType;
QChar tabFillChar;
};
 
 
PageItem(ScribusDoc *pa, ItemType newType, double x, double y, double w, double h, double w2, QString fill, QString outline);
~PageItem() {};
struct ZZ {
360,7 → 367,7
bool AspectRatio;
QValueStack<int> Groups;
QValueList<double> DashValues;
QValueList<double> TabValues;
QValueList<TabRecord> TabValues;
double DashOffset;
VGradient fill_gradient;
bool fillRule;
/branches/Version13x/Scribus/scribus/scribusstructs.h
198,7 → 198,7
QString guiLanguage;
int Cols;
double ColGap;
QValueList<double> TabValues;
QValueList<PageItem::TabRecord> TabValues;
QValueList<double> DashValues;
double DashOffset;
bool isTableItem;
235,8 → 235,7
double gapAfter;
QString Font;
int FontSize;
QValueList<double> TabValues;
QString tabFillChar;
QValueList<PageItem::TabRecord> TabValues;
bool Drop;
int DropLin;
int FontEffect;
/branches/Version13x/Scribus/scribus/tabruler.cpp
15,7 → 15,7
#include "units.h"
extern QPixmap loadIcon(QString nam);
 
RulerT::RulerT(QWidget *pa, int ein, QValueList<double> Tabs, bool ind, double wid) : QWidget(pa)
RulerT::RulerT(QWidget *pa, int ein, QValueList<PageItem::TabRecord> Tabs, bool ind, double wid) : QWidget(pa)
{
setEraseColor(QColor(255,255,255));
unitIndex = ein;
26,6 → 26,7
leftIndent = 0;
mousePressed = false;
rulerCode = 0;
actTab = -1;
setMouseTracking(true);
if (wid < 0)
{
38,7 → 39,7
{
Width = wid;
setMinimumSize(QSize(QMIN(static_cast<int>(Width), 400),25));
setMaximumSize(QSize(QMIN(static_cast<int>(Width), 400),25));
setMaximumSize(QSize(4000,25));
resize(QMIN(static_cast<int>(wid), 400), 25);
}
}
111,31 → 112,31
}
if (tabValues.count() != 0)
{
for (int yg = 0; yg < static_cast<int>(tabValues.count()-1); yg += 2)
for (int yg = 0; yg < static_cast<int>(tabValues.count()); yg++)
{
if (yg == actTab)
p.setPen(QPen(red, 2, SolidLine, FlatCap, MiterJoin));
else
p.setPen(QPen(black, 2, SolidLine, FlatCap, MiterJoin));
switch (static_cast<int>(tabValues[yg]))
switch (static_cast<int>(tabValues[yg].tabType))
{
case 0:
p.drawLine(qRound(tabValues[yg+1]), 15, qRound(tabValues[yg+1]), 23);
p.drawLine(qRound(tabValues[yg+1]), 23, qRound(tabValues[yg+1]+8), 23);
p.drawLine(qRound(tabValues[yg].tabPosition), 15, qRound(tabValues[yg].tabPosition), 23);
p.drawLine(qRound(tabValues[yg].tabPosition), 23, qRound(tabValues[yg].tabPosition+8), 23);
break;
case 1:
p.drawLine(qRound(tabValues[yg+1]), 15, qRound(tabValues[yg+1]), 23);
p.drawLine(qRound(tabValues[yg+1]), 23, qRound(tabValues[yg+1]-8), 23);
p.drawLine(qRound(tabValues[yg].tabPosition), 15, qRound(tabValues[yg].tabPosition), 23);
p.drawLine(qRound(tabValues[yg].tabPosition), 23, qRound(tabValues[yg].tabPosition-8), 23);
break;
case 2:
case 3:
p.drawLine(qRound(tabValues[yg+1]), 15, qRound(tabValues[yg+1]), 23);
p.drawLine(qRound(tabValues[yg+1]-4), 23, qRound(tabValues[yg+1]+4), 23);
p.drawLine(qRound(tabValues[yg+1]+3), 20, qRound(tabValues[yg+1]+2), 20);
p.drawLine(qRound(tabValues[yg].tabPosition), 15, qRound(tabValues[yg].tabPosition), 23);
p.drawLine(qRound(tabValues[yg].tabPosition-4), 23, qRound(tabValues[yg].tabPosition+4), 23);
p.drawLine(qRound(tabValues[yg].tabPosition+3), 20, qRound(tabValues[yg].tabPosition+2), 20);
break;
case 4:
p.drawLine(qRound(tabValues[yg+1]), 15, qRound(tabValues[yg+1]), 23);
p.drawLine(qRound(tabValues[yg+1]-4), 23, qRound(tabValues[yg+1]+4), 23);
p.drawLine(qRound(tabValues[yg].tabPosition), 15, qRound(tabValues[yg].tabPosition), 23);
p.drawLine(qRound(tabValues[yg].tabPosition-4), 23, qRound(tabValues[yg].tabPosition+4), 23);
break;
default:
break;
180,16 → 181,18
}
if (tabValues.count() != 0)
{
for (int yg = 0; yg < static_cast<int>(tabValues.count()-1); yg += 2)
for (int yg = 0; yg < static_cast<int>(tabValues.count()); yg++)
{
fpo = QRect(static_cast<int>(tabValues[yg+1]-offset)-3, 15, 8, 8);
fpo = QRect(static_cast<int>(tabValues[yg].tabPosition-offset)-3, 15, 8, 8);
if (fpo.contains(m->pos()))
{
rulerCode = 3;
actTab = yg;
mouseX = m->x();
emit typeChanged(static_cast<int>(tabValues[actTab]));
emit tabMoved(tabValues[actTab+1]);
emit tabSelected();
emit typeChanged(tabValues[actTab].tabType);
emit tabMoved(tabValues[actTab].tabPosition);
emit fillCharChanged(tabValues[actTab].tabFillChar);
repaint();
return;
}
197,15 → 200,19
}
if ((rulerCode == 0) && (m->button() == LeftButton))
{
tabValues.prepend(static_cast<double>(m->x() + offset));
tabValues.prepend(0);
struct PageItem::TabRecord tb;
tb.tabPosition = static_cast<double>(m->x() + offset);
tb.tabType = 0;
tb.tabFillChar = QChar();
tabValues.prepend(tb);
actTab = 0;
rulerCode = 3;
updateTabList();
repaint();
emit newTab();
emit typeChanged(static_cast<int>(tabValues[actTab]));
emit tabMoved(tabValues[actTab+1]);
emit typeChanged(tabValues[actTab].tabType);
emit tabMoved(tabValues[actTab].tabPosition);
emit fillCharChanged(tabValues[actTab].tabFillChar);
qApp->setOverrideCursor(QCursor(SizeHorCursor), true);
}
mouseX = m->x();
220,10 → 227,10
{
if (m->button() == RightButton)
{
tabValues[actTab] += 1.0;
if (tabValues[actTab] > 4.0)
tabValues[actTab] = 0.0;
emit typeChanged(static_cast<int>(tabValues[actTab]));
tabValues[actTab].tabType += 1;
if (tabValues[actTab].tabType > 4)
tabValues[actTab].tabType = 0;
emit typeChanged(tabValues[actTab].tabType);
repaint();
}
}
232,15 → 239,15
{
if (rulerCode == 3)
{
QValueList<double>::Iterator it;
QValueList<PageItem::TabRecord>::Iterator it;
it = tabValues.at(actTab);
it = tabValues.remove(it);
tabValues.remove(it);
actTab = 0;
if (tabValues.count() != 0)
{
emit typeChanged(static_cast<int>(tabValues[actTab]));
emit tabMoved(tabValues[actTab+1]);
emit typeChanged(tabValues[actTab].tabType);
emit tabMoved(tabValues[actTab].tabPosition);
emit fillCharChanged(tabValues[actTab].tabFillChar);
}
else
emit noTabs();
283,13 → 290,13
repaint();
break;
case 3:
tabValues[actTab+1] -= mouseX - m->x();
if (tabValues[actTab+1] < 0)
tabValues[actTab+1] = 0;
if (tabValues[actTab+1] > Width-1)
tabValues[actTab+1] = Width-1;
tabValues[actTab].tabPosition -= mouseX - m->x();
if (tabValues[actTab].tabPosition < 0)
tabValues[actTab].tabPosition = 0;
if (tabValues[actTab].tabPosition > Width-1)
tabValues[actTab].tabPosition = Width-1;
updateTabList();
emit tabMoved(tabValues[actTab+1]);
emit tabMoved(tabValues[actTab].tabPosition);
repaint();
break;
default:
318,9 → 325,9
}
if (tabValues.count() != 0)
{
for (int yg = 0; yg < static_cast<int>(tabValues.count()-1); yg += 2)
for (int yg = 0; yg < static_cast<int>(tabValues.count()); yg++)
{
fpo = QRect(static_cast<int>(tabValues[yg+1]-offset)-3, 15, 8, 8);
fpo = QRect(static_cast<int>(tabValues[yg].tabPosition-offset)-3, 15, 8, 8);
if (fpo.contains(m->pos()))
{
qApp->setOverrideCursor(QCursor(SizeHorCursor), true);
344,31 → 351,30
 
void RulerT::updateTabList()
{
QValueList<double>::Iterator it;
double CurX = tabValues[actTab+1];
struct PageItem::TabRecord tb;
tb.tabPosition = tabValues[actTab].tabPosition;
tb.tabType = tabValues[actTab].tabType;
tb.tabFillChar = tabValues[actTab].tabFillChar;
QValueList<PageItem::TabRecord>::Iterator it;
int gg = static_cast<int>(tabValues.count()-1);
int g = gg;
double type = tabValues[actTab];
it = tabValues.at(actTab);
it = tabValues.remove(it);
tabValues.remove(it);
for (int yg = static_cast<int>(tabValues.count()-1); yg > 0; yg -= 2)
for (int yg = static_cast<int>(tabValues.count()); yg > -1; yg--)
{
if (CurX < tabValues[yg])
if (tb.tabPosition < tabValues[yg].tabPosition)
g = yg;
}
actTab = g-1;
actTab = g;
if (gg == g)
{
tabValues.append(type);
tabValues.append(CurX);
actTab = static_cast<int>(tabValues.count()-2);
tabValues.append(tb);
actTab = static_cast<int>(tabValues.count()-1);
}
else
{
it = tabValues.at(actTab);
it = tabValues.insert(it, CurX);
tabValues.insert(it, type);
tabValues.insert(it, tb);
}
}
 
390,13 → 396,19
 
void RulerT::changeTab(int t)
{
tabValues[actTab] = static_cast<double>(t);
tabValues[actTab].tabType = t;
repaint();
}
 
void RulerT::changeTabChar(QChar t)
{
tabValues[actTab].tabFillChar = t;
repaint();
}
 
void RulerT::moveTab(double t)
{
tabValues[actTab+1] = t;
tabValues[actTab].tabPosition = t;
updateTabList();
repaint();
}
431,7 → 443,7
repaint();
}
 
Tabruler::Tabruler( QWidget* parent, bool haveFirst, int dEin, QValueList<double> Tabs, double wid ) : QWidget( parent )
Tabruler::Tabruler( QWidget* parent, bool haveFirst, int dEin, QValueList<PageItem::TabRecord> Tabs, double wid ) : QWidget( parent )
{
docUnitRatio=unitGetRatioFromIndex(dEin);
double ww;
457,12 → 469,23
rulerScrollR->setAutoRepeat( true );
layout2->addWidget( rulerScrollR );
tabrulerLayout->addLayout( layout2 );
layout1 = new QHBoxLayout( 0, 0, 6, "layout1");
layout1 = new QHBoxLayout( 0, 0, 6, "layout1" );
layout1->setAlignment( Qt::AlignTop );
tabData = new MSpinBox( 0, ww, this, 1 );
tabData->setValue(0);
positionLabel = new QLabel( tabData, tr("&Position:"), this, "positionLabel" );
layout1->addWidget( positionLabel );
layout1->addWidget( tabData );
tabFillCombo = new QComboBox( true, this, "tabFillCombo" );
tabFillCombo->setEditable(false);
tabFillCombo->insertItem( tr("None"));
tabFillCombo->insertItem( "Dot");
tabFillCombo->insertItem( "Hypen");
tabFillCombo->insertItem( "Underscore");
tabFillCombo->insertItem( "Custom");
tabFillComboT = new QLabel(tabFillCombo, tr( "Fill Char:" ), this, "tabFillComboT" );
layout1->addWidget( tabFillComboT );
layout1->addWidget( tabFillCombo );
if (haveFirst)
{
firstLineData = new MSpinBox( -3000, ww, this, 1);
485,18 → 508,21
layout1->addItem( spacer );
}
tabrulerLayout->addLayout( layout1 );
TypeCombo->setEnabled(false);
tabData->setEnabled(false);
tabFillCombo->setEnabled(false);
if (Tabs.count() == 0)
{
TypeCombo->setEnabled(false);
tabData->setEnabled(false);
clearButton->setEnabled(false);
}
resize( minimumSizeHint() );
connect(rulerScrollL, SIGNAL(clicked()), ruler, SLOT(decreaseOffset()));
connect(rulerScrollR, SIGNAL(clicked()), ruler, SLOT(increaseOffset()));
connect(ruler, SIGNAL(typeChanged(int)) , this, SLOT(setTabType(int)));
connect(ruler, SIGNAL(fillCharChanged(QChar)) , this, SLOT(setTabFillChar(QChar)));
connect(TypeCombo, SIGNAL(activated(int)), this, SLOT(setType()));
connect(tabFillCombo, SIGNAL(activated(int)), this, SLOT(setFillChar()));
connect(tabFillCombo, SIGNAL(textChanged(const QString &)), this, SLOT(setCustomFillChar(const QString &)));
connect(ruler, SIGNAL(tabMoved(double)) , this, SLOT(setTabData(double)));
connect(ruler, SIGNAL(tabSelected()), this, SLOT(tabAdded()));
connect(ruler, SIGNAL(newTab()), this, SLOT(tabAdded()));
connect(ruler, SIGNAL(noTabs()), this, SLOT(lastTabRemoved()));
connect(tabData, SIGNAL(valueChanged(int)), this, SLOT(setTab()));
544,6 → 570,7
TypeCombo->setEnabled(true);
tabData->setEnabled(true);
clearButton->setEnabled(true);
tabFillCombo->setEnabled(true);
emit tabrulerChanged();
}
 
552,9 → 579,87
TypeCombo->setEnabled(false);
tabData->setEnabled(false);
clearButton->setEnabled(false);
tabFillCombo->setEnabled(false);
emit tabrulerChanged();
}
 
void Tabruler::setFillChar()
{
disconnect(tabFillCombo, SIGNAL(textChanged(const QString &)), this, SLOT(setCustomFillChar(const QString &)));
disconnect(tabFillCombo, SIGNAL(activated(int)), this, SLOT(setFillChar()));
QChar ret;
switch (tabFillCombo->currentItem())
{
case 0:
tabFillCombo->setEditable(false);
ret = QChar();
break;
case 1:
tabFillCombo->setEditable(false);
ret = '.';
break;
case 2:
tabFillCombo->setEditable(false);
ret = '-';
break;
case 3:
tabFillCombo->setEditable(false);
ret = '_';
break;
case 4:
tabFillCombo->setEditable(true);
tabFillCombo->setEditText( tr("Custom:"));
break;
}
if (tabFillCombo->currentItem() != 4)
ruler->changeTabChar(ret);
connect(tabFillCombo, SIGNAL(activated(int)), this, SLOT(setFillChar()));
connect(tabFillCombo, SIGNAL(textChanged(const QString &)), this, SLOT(setCustomFillChar(const QString &)));
}
 
void Tabruler::setCustomFillChar(const QString &txt)
{
if (txt == tr("Custom:"))
return;
disconnect(tabFillCombo, SIGNAL(textChanged(const QString &)), this, SLOT(setCustomFillChar(const QString &)));
disconnect(tabFillCombo, SIGNAL(activated(int)), this, SLOT(setFillChar()));
QChar ret = txt[txt.length()-1];
ruler->changeTabChar(ret);
connect(tabFillCombo, SIGNAL(activated(int)), this, SLOT(setFillChar()));
connect(tabFillCombo, SIGNAL(textChanged(const QString &)), this, SLOT(setCustomFillChar(const QString &)));
}
 
void Tabruler::setTabFillChar(QChar t)
{
if (t.isNull())
{
tabFillCombo->setEditable(false);
tabFillCombo->setCurrentItem(0);
}
else if (t == ".")
{
tabFillCombo->setEditable(false);
tabFillCombo->setCurrentItem(1);
}
else if (t == "-")
{
tabFillCombo->setEditable(false);
tabFillCombo->setCurrentItem(2);
}
else if (t == "_")
{
tabFillCombo->setEditable(false);
tabFillCombo->setCurrentItem(3);
}
else
{
tabFillCombo->setCurrentItem(4);
tabFillCombo->setEditable(true);
tabFillCombo->setEditText( tr("Custom: ")+QString(t));
}
emit tabrulerChanged();
}
 
void Tabruler::setTabType(int t)
{
TypeCombo->setCurrentItem(t);
614,7 → 719,7
emit tabrulerChanged();
}
 
QValueList<double> Tabruler::getTabVals()
QValueList<PageItem::TabRecord> Tabruler::getTabVals()
{
return ruler->tabValues;
}
/branches/Version13x/Scribus/scribus/gtparagraphstyle.cpp
141,7 → 141,7
spaceBelow = newSpaceBelow;
}
 
QValueList<double>* gtParagraphStyle::getTabValues()
QValueList<PageItem::TabRecord>* gtParagraphStyle::getTabValues()
{
return &tabValues;
}
148,8 → 148,11
 
void gtParagraphStyle::setTabValue(double newTabValue, TabType ttype)
{
tabValues.append(static_cast<double>(ttype));
tabValues.append(newTabValue);
struct PageItem::TabRecord tb;
tb.tabPosition = newTabValue;
tb.tabType = ttype;
tb.tabFillChar = QChar();
tabValues.append(tb);
}
 
bool gtParagraphStyle::hasDropCap()
/branches/Version13x/Scribus/scribus/pageitem.cpp
594,7 → 594,7
uint StartRT, StartRT2;
int TabCode = 0;
int HyphenCount = 0;
QValueList<double> tTabValues;
QValueList<TabRecord> tTabValues;
bool DropCmode = false;
bool AbsHasDrop = false;
double desc, asce, maxDY, firstDes, desc2, maxDX, tabDist;
658,11 → 658,18
ColBound = FPoint((ColWidth + ColGap) * CurrCol+Extra + lineCorr, ColWidth * (CurrCol+1) + ColGap * CurrCol + Extra+lineCorr);
ColBound = FPoint(ColBound.x(), ColBound.y()+RExtra+lineCorr);
tabDist = ColBound.x();
uint tabCc = 0;
for (a = 0; a < itemText.count(); ++a)
{
if (a > MaxChars)
break;
hl = itemText.at(a);
if (hl->cab < 5)
tTabValues = TabValues;
else
tTabValues = Doc->docParagraphStyles[hl->cab].TabValues;
if (hl->cstyle & 16384)
tabCc = 0;
chx = hl->ch;
if (hl->yp == 0)
continue;
682,14 → 689,14
}
chs = hl->csize;
oldCurY = SetZeichAttr(hl, &chs, &chx);
if ((chx == QChar(9)) && (!Doc->RePos) && (Doc->docParagraphStyles[hl->cab].tabFillChar != ""))
if ((chx == QChar(9)) && (!Doc->RePos) && (!tTabValues[tabCc].tabFillChar.isNull()) && (tabCc < tTabValues.count()))
{
double wt = Cwidth(Doc, hl->cfont, Doc->docParagraphStyles[hl->cab].tabFillChar, chs);
double wt = Cwidth(Doc, hl->cfont, QString(tTabValues[tabCc].tabFillChar), chs);
int coun = static_cast<int>((hl->xp - tabDist) / wt);
double sPos = hl->xp - (hl->xp - tabDist) + 1;
desc = hl->cfont->numDescender * (-chs / 10.0);
asce = hl->cfont->numAscent * (chs / 10.0);
Zli3.Zeich = Doc->docParagraphStyles[hl->cab].tabFillChar;
Zli3.Zeich = QString(tTabValues[tabCc].tabFillChar);
Zli3.Farb = hl->ccolor;
Zli3.Farb2 = hl->cstroke;
Zli3.shade = hl->cshade;
719,6 → 726,8
DrawZeichenS(p, &Zli3);
}
}
if (chx == QChar(9))
tabCc++;
Zli3.Zeich = chx;
Zli3.Farb = hl->ccolor;
Zli3.Farb2 = hl->cstroke;
1246,12 → 1255,12
{
double tCurX = CurX - ColBound.x();
double oCurX = tCurX + wide;
for (int yg = static_cast<int>(tTabValues.count()-1); yg > 0; yg -= 2)
for (int yg = static_cast<int>(tTabValues.count()-1); yg > -1; yg--)
{
if (oCurX < tTabValues[yg])
if (oCurX < tTabValues[yg].tabPosition)
{
tCurX = tTabValues[yg];
TabCode = static_cast<int>(tTabValues[yg-1]);
tCurX = tTabValues[yg].tabPosition;
TabCode = static_cast<int>(tTabValues[yg].tabType);
}
}
if (TabCode == 0)
1656,6 → 1665,7
LiList.at(LiList.count()-1)->xco = hl->xp;
LiList.at(LiList.count()-1)->yco = hl->yp;
tabDist = ColBound.x();
uint tabCc = 0;
for (uint zc = 0; zc<BuPos3; ++zc)
{
double wide2 = 0;
1663,6 → 1673,10
double xcoZli = Zli2->xco;
itemText.at(startLin+zc)->xp = Zli2->xco;
itemText.at(startLin+zc)->yp = Zli2->yco;
if (itemText.at(startLin+zc)->cab < 5)
tTabValues = TabValues;
else
tTabValues = Doc->docParagraphStyles[itemText.at(startLin+zc)->cab].TabValues;
if (Zli2->Farb != "None")
{
QColor tmp;
1695,13 → 1709,13
}
if (!Doc->RePos)
{
if ((Zli2->Zeich == QChar(9)) && (Doc->docParagraphStyles[itemText.at(startLin+zc)->cab].tabFillChar != ""))
if ((Zli2->Zeich == QChar(9)) && (!tTabValues[tabCc].tabFillChar.isNull()) && (tabCc < tTabValues.count()))
{
double wt = Cwidth(Doc, Zli2->ZFo, Doc->docParagraphStyles[itemText.at(startLin+zc)->cab].tabFillChar, Zli2->Siz);
double wt = Cwidth(Doc, Zli2->ZFo, QString(tTabValues[tabCc].tabFillChar), Zli2->Siz);
int coun = static_cast<int>((Zli2->xco - tabDist) / wt);
double sPos = Zli2->xco - (Zli2->xco - tabDist) + 1;
Zli = new ZZ;
Zli->Zeich = Doc->docParagraphStyles[itemText.at(startLin+zc)->cab].tabFillChar;
Zli->Zeich = QString(tTabValues[tabCc].tabFillChar);
Zli->Farb = Zli2->Farb;
Zli->Farb2 = Zli2->Farb2;
Zli->shade = Zli2->shade;
1732,6 → 1746,8
}
delete Zli;
}
if (Zli2->Zeich == QChar(9))
tabCc++;
if (e2.intersects(pf2.xForm(QRect(qRound(Zli2->xco),qRound(Zli2->yco-asce), qRound(Zli2->wide+1), qRound(asce+desc)))))
DrawZeichenS(p, Zli2);
}
1795,6 → 1811,7
}
}
tabDist = ColBound.x();
uint tabCc = 0;
for (uint zc = 0; zc<LiList.count(); ++zc)
{
double wide2 = 0;
1802,6 → 1819,10
double xcoZli = Zli2->xco;
itemText.at(startLin+zc)->xp = Zli2->xco;
itemText.at(startLin+zc)->yp = Zli2->yco;
if (itemText.at(startLin+zc)->cab < 5)
tTabValues = TabValues;
else
tTabValues = Doc->docParagraphStyles[itemText.at(startLin+zc)->cab].TabValues;
if (Zli2->Farb != "None")
{
QColor tmp;
1834,13 → 1855,13
}
if (!Doc->RePos)
{
if ((Zli2->Zeich == QChar(9)) && (Doc->docParagraphStyles[itemText.at(startLin+zc)->cab].tabFillChar != ""))
if ((Zli2->Zeich == QChar(9)) && (!tTabValues[tabCc].tabFillChar.isNull()) && (tabCc < tTabValues.count()))
{
double wt = Cwidth(Doc, Zli2->ZFo, Doc->docParagraphStyles[itemText.at(startLin+zc)->cab].tabFillChar, Zli2->Siz);
double wt = Cwidth(Doc, Zli2->ZFo, QString(tTabValues[tabCc].tabFillChar), Zli2->Siz);
int coun = static_cast<int>((Zli2->xco - tabDist) / wt);
double sPos = Zli2->xco - (Zli2->xco - tabDist) + 1;
Zli = new ZZ;
Zli->Zeich = Doc->docParagraphStyles[itemText.at(startLin+zc)->cab].tabFillChar;
Zli->Zeich = QString(tTabValues[tabCc].tabFillChar);
Zli->Farb = Zli2->Farb;
Zli->Farb2 = Zli2->Farb2;
Zli->shade = Zli2->shade;
1871,6 → 1892,8
}
delete Zli;
}
if (Zli2->Zeich == QChar(9))
tabCc++;
if (e2.intersects(pf2.xForm(QRect(qRound(Zli2->xco),qRound(Zli2->yco-asce), qRound(Zli2->wide+1), qRound(asce+desc)))))
DrawZeichenS(p, Zli2);
}
/branches/Version13x/Scribus/scribus/libpostscript/pslib.cpp
1970,6 → 1970,8
{
struct ScText *hl;
double tabDist;
uint tabCc = 0;
QValueList<PageItem::TabRecord> tTabValues;
if (ite->lineColor() != "None")
tabDist = ite->Extra + ite->Pwidth / 2.0;
else
1983,15 → 1985,21
continue;
if (hl->yp == 0)
continue;
if (hl->cab < 5)
tTabValues = ite->TabValues;
else
tTabValues = Doc->docParagraphStyles[hl->cab].TabValues;
if (hl->cstyle & 16384)
tabCc = 0;
if (hl->ch == QChar(9))
{
if (Doc->docParagraphStyles[hl->cab].tabFillChar != "")
if ((!tTabValues[tabCc].tabFillChar.isNull()) && (tabCc < tTabValues.count()))
{
struct ScText hl2;
double wt = Cwidth(Doc, hl->cfont, Doc->docParagraphStyles[hl->cab].tabFillChar, hl->csize);
double wt = Cwidth(Doc, hl->cfont, QString(tTabValues[tabCc].tabFillChar), hl->csize);
int coun = static_cast<int>((hl->xp - tabDist) / wt);
double sPos = hl->xp - (hl->xp - tabDist) + 1;
hl2.ch = Doc->docParagraphStyles[hl->cab].tabFillChar;
hl2.ch = QString(tTabValues[tabCc].tabFillChar);
hl2.ccolor = hl->ccolor;
hl2.cstroke = hl->cstroke;
hl2.cshade = hl->cshade;
2040,10 → 2048,14
}
setTextCh(Doc, ite, gcr, a, d, &hl2);
}
tabCc++;
continue;
}
else
{
tabCc++;
continue;
}
}
if ((hl->cstyle & 256) && (hl->cstroke != "None"))
{
/branches/Version13x/Scribus/scribus/scribus.cpp
3064,11 → 3064,10
case 3:
doc->toolSettings.tabFillChar = "_";
break;
case 4:
doc->toolSettings.tabFillChar = dia->tabTools->tabFillCombo->currentText().right(1);
break;
}
for (int xxx=0; xxx<5; ++xxx)
{
doc->docParagraphStyles[xxx].tabFillChar = doc->toolSettings.tabFillChar;
}
if (doc->toolSettings.dStrokeText == tr("None"))
doc->toolSettings.dStrokeText = "None";
doc->toolSettings.dPenText = dia->tabTools->colorComboText->currentText();
4644,10 → 4643,6
doc->Pages = doc->DocPages;
doc->MasterP = false;
}
for (int xxx=0; xxx<5; ++xxx)
{
doc->docParagraphStyles[xxx].tabFillChar = doc->toolSettings.tabFillChar;
}
doc->loading = false;
view->slotDoZoom();
view->GotoPage(0);
7146,6 → 7141,7
PageItem* ite = 0;
bool ff;
uint nr;
bool tabEQ = false;
ers.clear();
ers.append(0);
ers.append(1);
7175,6 → 7171,28
{
for (uint b=0; b<dia->TempVorl.count(); ++b)
{
struct PageItem::TabRecord tb;
tabEQ = false;
for (uint t1 = 0; t1 < dia->TempVorl[b].TabValues.count(); t1++)
{
tb.tabPosition = dia->TempVorl[b].TabValues[t1].tabPosition;
tb.tabType = dia->TempVorl[b].TabValues[t1].tabType;
tb.tabFillChar = dia->TempVorl[b].TabValues[t1].tabFillChar;
for (uint t2 = 0; t2 < doc->docParagraphStyles[a].TabValues.count(); t2++)
{
struct PageItem::TabRecord tb2;
tb2.tabPosition = doc->docParagraphStyles[a].TabValues[t2].tabPosition;
tb2.tabType = doc->docParagraphStyles[a].TabValues[t2].tabType;
tb2.tabFillChar = doc->docParagraphStyles[a].TabValues[t2].tabFillChar;
if ((tb2.tabFillChar == tb.tabFillChar) && (tb2.tabPosition == tb.tabPosition) && (tb2.tabType == tb.tabType))
{
tabEQ = true;
break;
}
}
if (tabEQ)
break;
}
if ((doc->docParagraphStyles[a].LineSpa == dia->TempVorl[b].LineSpa) &&
(doc->docParagraphStyles[a].Indent == dia->TempVorl[b].Indent) &&
(doc->docParagraphStyles[a].First == dia->TempVorl[b].First) &&
7182,7 → 7200,7
(doc->docParagraphStyles[a].gapBefore == dia->TempVorl[b].gapBefore) &&
(doc->docParagraphStyles[a].gapAfter == dia->TempVorl[b].gapAfter) &&
(doc->docParagraphStyles[a].Font == dia->TempVorl[b].Font) &&
(doc->docParagraphStyles[a].TabValues == dia->TempVorl[b].TabValues) &&
(tabEQ) &&
(doc->docParagraphStyles[a].Drop == dia->TempVorl[b].Drop) &&
(doc->docParagraphStyles[a].DropLin == dia->TempVorl[b].DropLin) &&
(doc->docParagraphStyles[a].FontEffect == dia->TempVorl[b].FontEffect) &&
7191,7 → 7209,6
(doc->docParagraphStyles[a].SColor == dia->TempVorl[b].SColor) &&
(doc->docParagraphStyles[a].SShade == dia->TempVorl[b].SShade) &&
(doc->docParagraphStyles[a].BaseAdj == dia->TempVorl[b].BaseAdj) &&
(doc->docParagraphStyles[a].tabFillChar == dia->TempVorl[b].tabFillChar) &&
(doc->docParagraphStyles[a].txtShadowX == dia->TempVorl[b].txtShadowX) &&
(doc->docParagraphStyles[a].txtShadowY == dia->TempVorl[b].txtShadowY) &&
(doc->docParagraphStyles[a].txtOutline == dia->TempVorl[b].txtOutline) &&
8080,6 → 8097,9
case 3:
Prefs.toolSettings.tabFillChar = "_";
break;
case 4:
Prefs.toolSettings.tabFillChar = dia->tabTools->tabFillCombo->currentText().right(1);
break;
}
switch (dia->tabTools->comboStyleShape->currentItem())
{
10206,12 → 10226,26
uint chr = it->itemText.at(e)->ch[0].unicode();
if ((chr == 13) || (chr == 32) || (chr == 29))
continue;
if ((chr == 9) && (doc->docParagraphStyles[it->itemText.at(e)->cab].tabFillChar != ""))
if (chr == 9)
{
chx = doc->docParagraphStyles[it->itemText.at(e)->cab].tabFillChar;
chr = chx[0].unicode();
gly = it->itemText.at(e)->cfont->GlyphArray[chr].Outlines.copy();
it->itemText.at(e)->cfont->RealGlyphs.insert(chr, gly);
for (uint t1 = 0; t1 < doc->docParagraphStyles[it->itemText.at(e)->cab].TabValues.count(); t1++)
{
if (doc->docParagraphStyles[it->itemText.at(e)->cab].TabValues[t1].tabFillChar.isNull())
continue;
chx = QString(doc->docParagraphStyles[it->itemText.at(e)->cab].TabValues[t1].tabFillChar);
chr = chx[0].unicode();
gly = it->itemText.at(e)->cfont->GlyphArray[chr].Outlines.copy();
it->itemText.at(e)->cfont->RealGlyphs.insert(chr, gly);
}
for (uint t1 = 0; t1 < it->TabValues.count(); t1++)
{
if (it->TabValues[t1].tabFillChar.isNull())
continue;
chx = QString(it->TabValues[t1].tabFillChar);
chr = chx[0].unicode();
gly = it->itemText.at(e)->cfont->GlyphArray[chr].Outlines.copy();
it->itemText.at(e)->cfont->RealGlyphs.insert(chr, gly);
}
continue;
}
if (chr == 30)
10252,12 → 10286,26
uint chr = it->itemText.at(e)->ch[0].unicode();
if ((chr == 13) || (chr == 32) || (chr == 29))
continue;
if ((chr == 9) && (doc->docParagraphStyles[it->itemText.at(e)->cab].tabFillChar != ""))
if (chr == 9)
{
chx = doc->docParagraphStyles[it->itemText.at(e)->cab].tabFillChar;
chr = chx[0].unicode();
gly = it->itemText.at(e)->cfont->GlyphArray[chr].Outlines.copy();
it->itemText.at(e)->cfont->RealGlyphs.insert(chr, gly);
for (uint t1 = 0; t1 < doc->docParagraphStyles[it->itemText.at(e)->cab].TabValues.count(); t1++)
{
if (doc->docParagraphStyles[it->itemText.at(e)->cab].TabValues[t1].tabFillChar.isNull())
continue;
chx = QString(doc->docParagraphStyles[it->itemText.at(e)->cab].TabValues[t1].tabFillChar);
chr = chx[0].unicode();
gly = it->itemText.at(e)->cfont->GlyphArray[chr].Outlines.copy();
it->itemText.at(e)->cfont->RealGlyphs.insert(chr, gly);
}
for (uint t1 = 0; t1 < it->TabValues.count(); t1++)
{
if (it->TabValues[t1].tabFillChar.isNull())
continue;
chx = QString(it->TabValues[t1].tabFillChar);
chr = chx[0].unicode();
gly = it->itemText.at(e)->cfont->GlyphArray[chr].Outlines.copy();
it->itemText.at(e)->cfont->RealGlyphs.insert(chr, gly);
}
continue;
}
if (chr == 30)
/branches/Version13x/Scribus/scribus/plugins/gettext/sxwim/stylereader.cpp
467,12 → 467,13
nameByAttrs += QString("%1-").arg(s->hasDropCap());
nameByAttrs += QString("%1-").arg(s->getFont()->getColor());
nameByAttrs += QString("%1-").arg(s->getFont()->getStrokeColor());
QValueList<double>* tmp = s->getTabValues();
// TODO is this important ??
/* QValueList<double>* tmp = s->getTabValues();
for (uint i = 0; i < tmp->count(); ++i)
{
double td = (*tmp)[i];
nameByAttrs += QString("%1-").arg(td);
}
} */
if (attrsStyles.contains(nameByAttrs))
{
tname = attrsStyles[nameByAttrs]->getName();
/branches/Version13x/Scribus/scribus/plugins/gettext/odtim/stylereader.cpp
518,12 → 518,13
nameByAttrs += QString("%1-").arg(s->hasDropCap());
nameByAttrs += QString("%1-").arg(s->getFont()->getColor());
nameByAttrs += QString("%1-").arg(s->getFont()->getStrokeColor());
QValueList<double>* tmp = s->getTabValues();
// TODO is this important ??
/* QValueList<double>* tmp = s->getTabValues();
for (uint i = 0; i < tmp->count(); ++i)
{
double td = (*tmp)[i];
nameByAttrs += QString("%1-").arg(td);
}
} */
if (attrsStyles.contains(nameByAttrs))
{
tname = attrsStyles[nameByAttrs]->getName();
/branches/Version13x/Scribus/scribus/libpdf/pdflib.cpp
2548,6 → 2548,8
QString tmp = "";
QString tmp2 = "";
double tabDist;
uint tabCc = 0;
QValueList<PageItem::TabRecord> tTabValues;
if (ite->lineColor() != "None")
tabDist = ite->Extra + ite->Pwidth / 2.0;
else
2563,15 → 2565,21
continue;
if ((hl->yp == 0) && (ite->itemType() == PageItem::TextFrame))
continue;
if (hl->cab < 5)
tTabValues = ite->TabValues;
else
tTabValues = doc->docParagraphStyles[hl->cab].TabValues;
if (hl->cstyle & 16384)
tabCc = 0;
if (hl->ch == QChar(9))
{
if (doc->docParagraphStyles[hl->cab].tabFillChar != "")
if ((!tTabValues[tabCc].tabFillChar.isNull()) && (tabCc < tTabValues.count()))
{
struct ScText hl2;
double wt = Cwidth(doc, hl->cfont, doc->docParagraphStyles[hl->cab].tabFillChar, hl->csize);
double wt = Cwidth(doc, hl->cfont, QString(tTabValues[tabCc].tabFillChar), hl->csize);
int coun = static_cast<int>((hl->xp - tabDist) / wt);
double sPos = hl->xp - (hl->xp - tabDist) + 1;
hl2.ch = doc->docParagraphStyles[hl->cab].tabFillChar;
hl2.ch = QString(tTabValues[tabCc].tabFillChar);
hl2.ccolor = hl->ccolor;
hl2.cstroke = hl->cstroke;
hl2.cshade = hl->cshade;
2621,10 → 2629,14
}
setTextCh(ite, PNr, d, tmp, tmp2, &hl2);
}
tabCc++;
continue;
}
else
{
tabCc++;
continue;
}
}
if ((hl->cstyle & 256) && (hl->cstroke != "None"))
{
/branches/Version13x/Scribus/scribus/gtparagraphstyle.h
23,6 → 23,7
 
#include <qvaluelist.h>
#include "gtstyle.h"
#include "pageitem.h"
 
enum Alignment {
LEFT,
52,7 → 53,7
double firstLineIndent;
double spaceAbove;
double spaceBelow;
QValueList<double> tabValues;
QValueList<PageItem::TabRecord> tabValues;
bool dropCap;
int dropCapHeight;
bool adjToBaseline;
74,7 → 75,7
void setSpaceAbove(double newSpaceAbove);
double getSpaceBelow();
void setSpaceBelow(double newSpaceBelow);
QValueList<double>* getTabValues();
QValueList<PageItem::TabRecord>* getTabValues();
void setTabValue(double newTabValue, TabType ttype = LEFT_T);
bool hasDropCap();
void setDropCap(bool newDropCap);
/branches/Version13x/Scribus/scribus/tabmanager.cpp
9,7 → 9,7
#include "units.h"
extern QPixmap loadIcon(QString nam);
 
TabManager::TabManager( QWidget* parent, int dEin, QValueList<double> inTab, double wid) : QDialog( parent, "TabManager", true, 0 )
TabManager::TabManager( QWidget* parent, int dEin, QValueList<PageItem::TabRecord> inTab, double wid) : QDialog( parent, "TabManager", true, 0 )
{
setCaption( tr( "Manage Tabulators" ) );
setIcon(loadIcon("AppIcon.png"));
/branches/Version13x/Scribus/scribus/tabruler.h
4,6 → 4,8
#include <qvariant.h>
#include <qwidget.h>
 
#include "pageitem.h"
 
class QVBoxLayout;
class QHBoxLayout;
class QGridLayout;
18,11 → 20,11
Q_OBJECT
 
public:
RulerT(QWidget* parent, int ein, QValueList<double> Tabs, bool ind, double wid);
RulerT(QWidget* parent, int ein, QValueList<PageItem::TabRecord> Tabs, bool ind, double wid);
~RulerT() {};
void updateTabList();
bool mousePressed;
QValueList<double> tabValues;
QValueList<PageItem::TabRecord> tabValues;
bool haveInd;
int unitIndex;
int offset;
37,6 → 39,7
void decreaseOffset();
void increaseOffset();
void changeTab(int t);
void changeTabChar(QChar t);
void moveTab(double t);
void moveFirstLine(double t);
void moveLeftIndent(double t);
44,11 → 47,13
signals:
void tabMoved(double);
void typeChanged(int);
void fillCharChanged(QChar);
void leftIndentMoved(double);
void firstLineMoved(double);
void noTabs();
void newTab();
void mouseReleased();
void tabSelected();
 
protected:
virtual void paintEvent(QPaintEvent *);
63,9 → 68,9
Q_OBJECT
 
public:
Tabruler( QWidget* parent, bool haveFirst, int ein, QValueList<double> Tabs, double wid );
Tabruler( QWidget* parent, bool haveFirst, int ein, QValueList<PageItem::TabRecord> Tabs, double wid );
~Tabruler() {};
QValueList<double> getTabVals();
QValueList<PageItem::TabRecord> getTabVals();
bool haveF;
double getFirstLine();
double getLeftIndent();
82,6 → 87,9
void setFirstLine();
void setLeftIndentData(double t);
void setLeftIndent();
void setTabFillChar(QChar t);
void setFillChar();
void setCustomFillChar(const QString &txt);
 
signals:
/*! This signal is emited when is something changed in the tab ruler dialog/widget.
92,7 → 100,10
QVBoxLayout* tabrulerLayout;
QHBoxLayout* layout2;
QHBoxLayout* layout1;
QVBoxLayout* layout3;
QComboBox* TypeCombo;
QComboBox* tabFillCombo;
QLabel* tabFillComboT;
RulerT* ruler;
QToolButton* rulerScrollL;
QToolButton* rulerScrollR;