Subversion Repositories Scribus

Compare Revisions

Ignore whitespace Rev 2308 → Rev 2309

/branches/Version13x/Scribus/scribus/fileloader.cpp
543,6 → 543,7
if(pg.tagName()=="STYLE")
{
vg.Vname = pg.attribute("NAME");
vg.LineSpaMode = QStoInt(pg.attribute("LINESPMode","0"));
vg.LineSpa = QStodouble(pg.attribute("LINESP"));
vg.Indent = QStodouble(pg.attribute("INDENT","0"));
vg.First = QStodouble(pg.attribute("FIRST","0"));
1050,6 → 1051,11
}
Neu->Language = app->GetLang(pg.attribute("LANGUAGE", doc->Language));
Neu->isAutoText=static_cast<bool>(QStoInt(pg.attribute("AUTOTEXT")));
if (Neu->LineSpMode == 3)
{
doc->docParagraphStyles[0].BaseAdj = true;
Neu->LineSp = doc->typographicSetttings.valueBaseGrid-1;
}
if (Neu->isAutoText)
doc->LastAuto = Neu;
Neu->NextIt = QStoInt(pg.attribute("NEXTITEM"));
1353,6 → 1359,7
currItem->AspectRatio = QStoInt(obj->attribute("RATIO","0"));
}
currItem->LineSp = QStodouble(obj->attribute("LINESP"));
currItem->LineSpMode = QStoInt(obj->attribute("LINESPMode","0"));
currItem->convertTo(pt);
break;
case PageItem::Line:
/branches/Version13x/Scribus/scribus/mpalette.h
21,6 → 21,7
#include <qlineedit.h>
#include <qtimer.h>
#include <qtoolbox.h>
#include <qpopupmenu.h>
#include "scrpalettebase.h"
#include "mspinbox.h"
#include "pageitem.h"
189,7 → 190,6
QLabel* leftLabel;
QLabel* rightLabel;
QLabel* trackingLabel;
QLabel* linespacingLabel;
QLabel* fontsizeLabel;
QLabel* yscaleLabel;
QLabel* xscaleLabel;
258,6 → 258,9
QFrame* Line5_2;
QFrame* Frame4;
 
QPopupMenu* lineSpacingPop;
 
QToolButton* linespacingLabel;
QToolButton* FlipH;
QToolButton* FlipV;
QToolButton* Locked;
280,6 → 283,7
void setR(double r);
void setRR(double r);
void setCols(int r, double g);
void setLspMode(int id);
void setLsp(double r);
void setSize(int s);
void setExtra(double e);
/branches/Version13x/Scribus/scribus/edit1format.h
47,7 → 47,7
QLabel* AligLabel;
AlignSelect* AligS;
QGroupBox* GroupBox10;
QGroupBox* AbstandV;
QButtonGroup* AbstandV;
QGroupBox* GroupFont;
QLabel* TextF1;
FontCombo* FontC;
60,7 → 60,9
QComboBox* TxFill;
ShadeButton *PM2;
QCheckBox* DropCaps;
QCheckBox* BaseGrid;
QRadioButton* BaseGrid;
QRadioButton* FixedLsp;
QRadioButton* AutoLsp;
QLabel* CapLabel;
QSpinBox* DropLines;
QPushButton* Cancel;
83,6 → 85,7
ApplicationPrefs *PrefsData;
 
private slots:
void toggleLsp();
void Verlassen();
void FontChange();
void ManageDrops();
/branches/Version13x/Scribus/scribus/gtaction.cpp
237,7 → 237,7
else
linesp = fstyle->getLineSpacing();
textFrame->LineSp = linesp;
 
textFrame->LineSpMode = 0;
gtFont* font = fstyle->getFont();
QString fontName = validateFont(font);
textFrame->IFont = fontName;
314,6 → 314,7
linesp = getLineSpacing(pstyle->getFont()->getSize());
else
linesp = pstyle->getLineSpacing();
vg.LineSpaMode = 0;
vg.LineSpa = linesp;
vg.textAlignment = pstyle->getAlignment();
vg.Indent = pstyle->getIndent();
378,6 → 379,7
linesp = getLineSpacing(pstyle->getFont()->getSize());
else
linesp = pstyle->getLineSpacing();
vg.LineSpaMode = 0;
vg.LineSpa = linesp;
vg.textAlignment = pstyle->getAlignment();
vg.Indent = pstyle->getIndent();
/branches/Version13x/Scribus/scribus/mpalette.cpp
447,9 → 447,16
layout41->addWidget( ChBase, 1, 3 );
LineSp = new MSpinBox( page_3, 1 );
layout41->addWidget( LineSp, 2, 1 );
linespacingLabel = new QLabel( "", page_3, "linespacingLabel" );
lineSpacingPop = new QPopupMenu();
lineSpacingPop->insertItem( tr("Fixed Linespacing"));
lineSpacingPop->insertItem( tr("Automatic Linespacing"));
lineSpacingPop->insertItem( tr("Align to Baseline Grid"));
linespacingLabel = new QToolButton(page_3, "linespacingLabel" );
linespacingLabel->setText("");
linespacingLabel->setPixmap(loadIcon("linespacing.png"));
linespacingLabel->setPopup(lineSpacingPop);
linespacingLabel->setPopupDelay(400);
linespacingLabel->setAutoRaise(true);
layout41->addWidget( linespacingLabel, 2, 0 );
Extra = new MSpinBox( page_3, 1 );
layout41->addWidget( Extra, 2, 3 );
779,6 → 786,7
connect( Cpal, SIGNAL(editGradient()), this, SLOT(toggleGradientEdit()));
connect(startArrow, SIGNAL(activated(int)), this, SLOT(setStartArrow(int )));
connect(endArrow, SIGNAL(activated(int)), this, SLOT(setEndArrow(int )));
connect(lineSpacingPop, SIGNAL(activated(int)), this, SLOT(setLspMode(int )));
HaveItem = false;
Xpos->setValue(0);
Ypos->setValue(0);
1470,6 → 1478,15
HaveItem = tmp;
}
 
void Mpalette::setLspMode(int id)
{
if ((HaveDoc) && (HaveItem))
{
ScApp->view->ChLineSpaMode(lineSpacingPop->indexOf(id));
emit DocChanged();
}
}
 
void Mpalette::setLsp(double r)
{
if (ScApp->ScriptRunning)
1477,6 → 1494,18
bool tmp = HaveItem;
HaveItem = false;
LineSp->setValue(r);
if (tmp)
{
if (CurItem->LineSpMode > 0)
LineSp->setEnabled(false);
else
LineSp->setEnabled(true);
for (uint al = 0; al < lineSpacingPop->count(); ++al)
{
lineSpacingPop->setItemChecked(lineSpacingPop->idAt(al), false);
}
lineSpacingPop->setItemChecked(lineSpacingPop->idAt(CurItem->LineSpMode), true);
}
HaveItem = tmp;
}
 
3333,6 → 3362,9
Aspect->setText(tr("P&roportional"));
TextCms1->setText(tr("Input Profile:"));
TextCms2->setText(tr("Rendering Intent:"));
lineSpacingPop->changeItem(lineSpacingPop->idAt(0), tr("Fixed Linespacing"));
lineSpacingPop->changeItem(lineSpacingPop->idAt(1), tr("Automatic Linespacing"));
lineSpacingPop->changeItem(lineSpacingPop->idAt(2), tr("Align to Baseline Grid"));
int oldMonitorI=MonitorI->currentItem();
MonitorI->clear();
MonitorI->insertItem(tr("Perceptual"));
/branches/Version13x/Scribus/scribus/util.cpp
129,6 → 129,7
double RealCWidth(ScribusDoc *currentDoc, Foi* name, QString ch, int Siz);
double RealCAscent(ScribusDoc *currentDoc, Foi* name, QString ch, int Size);
double RealCHeight(ScribusDoc *currentDoc, Foi* name, QString ch, int Size);
double RealFHeight(ScribusDoc *currentDoc, Foi* name, int Size);
double QStodouble(QString in);
int QStoInt(QString in);
QString GetAttr(QDomElement *el, QString at, QString def="0");
454,6 → 455,12
return static_cast<double>(Size / 10.0);
}
 
double RealFHeight(ScribusDoc *currentDoc, Foi* name, int Size)
{
FT_Face face = currentDoc->FFonts[name->SCName];
return face->height / name->uniEM * (Size / 10.0);
}
 
QPointArray RegularPolygon(double w, double h, uint c, bool star, double factor, double rota)
{
uint cx = star ? c * 2 : c;
1518,6 → 1525,7
OB->PLineEnd=Qt::PenCapStyle(QStoInt(obj->attribute("PLINEEND","0")));
OB->PLineJoin=Qt::PenJoinStyle(QStoInt(obj->attribute("PLINEJOIN","0")));
OB->LineSp=QStodouble(obj->attribute("LINESP"));
OB->LineSpMode = QStoInt(obj->attribute("LINESPMode","0"));
OB->ExtraV=QStodouble(obj->attribute("EXTRAV","0"));
OB->LocalScX=QStodouble(obj->attribute("LOCALSCX"));
OB->LocalScY=QStodouble(obj->attribute("LOCALSCY"));
/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("29").arg("May").arg("2005");
QString bu = tr("%1 %2 %3 ").arg("31").arg("May").arg("2005");
#ifdef HAVE_CMS
bu += "C";
#else
/branches/Version13x/Scribus/scribus/scribusdoc.cpp
149,6 → 149,7
docParagraphStyles.clear();
struct ParagraphStyle vg;
vg.Vname = "Normal Internal";
vg.LineSpaMode = 0;
vg.LineSpa = 15;
vg.textAlignment = 0;
vg.Indent = 0;
420,6 → 421,7
{
struct ParagraphStyle sty;
sty.Vname = ss->docParagraphStyles[xx].Vname;
sty.LineSpaMode = ss->docParagraphStyles[xx].LineSpaMode;
sty.LineSpa = ss->docParagraphStyles[xx].LineSpa;
sty.textAlignment = ss->docParagraphStyles[xx].textAlignment;
sty.Indent = ss->docParagraphStyles[xx].Indent;
/branches/Version13x/Scribus/scribus/scribusview.h
231,6 → 231,7
void ChLineJoin(PenJoinStyle w);
void ChLineEnd(PenCapStyle w);
void ChLineSpa(double w);
void ChLineSpaMode(int w);
void ChLocalXY(double x, double y);
void ChLocalSc(double x, double y);
void ItemFont(QString fon);
/branches/Version13x/Scribus/scribus/editformats.cpp
61,7 → 61,7
}
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) && (tabEQ)
(vg.LineSpaMode == vg2.LineSpaMode) && (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.txtShadowX == vg2.txtShadowX) && (vg.txtShadowY == vg2.txtShadowY) &&
210,6 → 210,7
{
struct ParagraphStyle sty;
sty.Vname = tr("Copy of %1").arg(TempVorl[sFnumber].Vname);
sty.LineSpaMode = TempVorl[sFnumber].LineSpaMode;
sty.LineSpa = TempVorl[sFnumber].LineSpa;
sty.textAlignment = TempVorl[sFnumber].textAlignment;
sty.Indent = TempVorl[sFnumber].Indent;
248,6 → 249,7
{
struct ParagraphStyle sty;
sty.Vname = tr("New Style");
sty.LineSpaMode = 0;
sty.LineSpa = ((Docu->toolSettings.defSize / 10.0) * static_cast<double>(Docu->typographicSetttings.autoLineSpacing) / 100) + (Docu->toolSettings.defSize / 10.0);
sty.textAlignment = 0;
sty.Indent = 0;
/branches/Version13x/Scribus/scribus/scribusXml.cpp
352,6 → 352,7
ob->setAttribute("PLINEEND", item->PLineEnd);
ob->setAttribute("PLINEJOIN", item->PLineJoin);
ob->setAttribute("LINESP",item->LineSp);
ob->setAttribute("LINESPMode", item->LineSpMode);
ob->setAttribute("EXTRAV",item->ExtraV);
ob->setAttribute("LOCALSCX",item->LocalScX);
ob->setAttribute("LOCALSCY",item->LocalScY);
562,6 → 563,7
fou = false;
bool tabEQ = false;
vg->Vname = pg->attribute("NAME");
vg->LineSpaMode = QStoInt(pg->attribute("LINESPMode","0"));
vg->LineSpa = QStodouble(pg->attribute("LINESP"));
vg->Indent = QStodouble(pg->attribute("INDENT","0"));
vg->First = QStodouble(pg->attribute("FIRST","0"));
660,6 → 662,7
break;
}
if ((vg->LineSpa == docParagraphStyles[xx].LineSpa) &&
(vg->LineSpaMode == docParagraphStyles[xx].LineSpaMode) &&
(vg->Indent == docParagraphStyles[xx].Indent) &&
(vg->First == docParagraphStyles[xx].First) &&
(vg->textAlignment == docParagraphStyles[xx].textAlignment) &&
725,6 → 728,7
break;
}
if ((vg->LineSpa == docParagraphStyles[xx].LineSpa) &&
(vg->LineSpaMode == docParagraphStyles[xx].LineSpaMode) &&
(vg->Indent == docParagraphStyles[xx].Indent) &&
(vg->First == docParagraphStyles[xx].First) &&
(vg->textAlignment == docParagraphStyles[xx].textAlignment) &&
1402,6 → 1406,7
if(pg.tagName()=="STYLE")
{
vg.Vname = pg.attribute("NAME");
vg.LineSpaMode = QStoInt(pg.attribute("LINESPMode","0"));
vg.LineSpa = QStodouble(pg.attribute("LINESP"));
vg.Indent = QStodouble(pg.attribute("INDENT","0"));
vg.First = QStodouble(pg.attribute("FIRST","0"));
2240,6 → 2245,7
if (item->textAlignment > 4)
{
vg.Vname = doc->docParagraphStyles[item->textAlignment].Vname;
vg.LineSpaMode = doc->docParagraphStyles[item->textAlignment].LineSpaMode;
vg.LineSpa = doc->docParagraphStyles[item->textAlignment].LineSpa;
vg.textAlignment = doc->docParagraphStyles[item->textAlignment].textAlignment;
vg.Indent = doc->docParagraphStyles[item->textAlignment].Indent;
2273,6 → 2279,7
if (item->itemText.at(tx)->cab > 4)
{
vg.Vname = doc->docParagraphStyles[item->itemText.at(tx)->cab].Vname;
vg.LineSpaMode = doc->docParagraphStyles[item->itemText.at(tx)->cab].LineSpaMode;
vg.LineSpa = doc->docParagraphStyles[item->itemText.at(tx)->cab].LineSpa;
vg.textAlignment = doc->docParagraphStyles[item->itemText.at(tx)->cab].textAlignment;
vg.Indent = doc->docParagraphStyles[item->itemText.at(tx)->cab].Indent;
2312,6 → 2319,7
QDomElement fo=docu.createElement("STYLE");
fo.setAttribute("NAME",UsedStyles[actSt].Vname);
fo.setAttribute("ALIGN",UsedStyles[actSt].textAlignment);
fo.setAttribute("LINESPMode",UsedStyles[actSt].LineSpaMode);
fo.setAttribute("LINESP",UsedStyles[actSt].LineSpa);
fo.setAttribute("INDENT",UsedStyles[actSt].Indent);
fo.setAttribute("FIRST",UsedStyles[actSt].First);
3175,6 → 3183,7
QDomElement fo=docu.createElement("STYLE");
fo.setAttribute("NAME",doc->docParagraphStyles[ff].Vname);
fo.setAttribute("ALIGN",doc->docParagraphStyles[ff].textAlignment);
fo.setAttribute("LINESPMode",doc->docParagraphStyles[ff].LineSpaMode);
fo.setAttribute("LINESP",doc->docParagraphStyles[ff].LineSpa);
fo.setAttribute("INDENT",doc->docParagraphStyles[ff].Indent);
fo.setAttribute("FIRST",doc->docParagraphStyles[ff].First);
/branches/Version13x/Scribus/scribus/edit1format.cpp
139,7 → 139,7
 
EditStyleLayout->addWidget( GroupFont, 2, 0 );
 
AbstandV = new QGroupBox( tr("Vertical Spaces"), this, "AbstandV" );
AbstandV = new QButtonGroup( tr("Vertical Spaces"), this, "AbstandV" );
AbstandV->setColumnLayout(0, Qt::Vertical );
AbstandV->layout()->setSpacing( 0 );
AbstandV->layout()->setMargin( 0 );
148,23 → 148,26
AbstandVLayout->setSpacing( 5 );
AbstandVLayout->setMargin( 10 );
 
BaseGrid = new QCheckBox( tr("Align to Baseline &Grid"), AbstandV, "BaseGrid" );
BaseGrid->setChecked(vor->BaseAdj);
BaseGrid = new QRadioButton( tr("Align to Baseline &Grid"), AbstandV, "BaseGrid" );
AbstandVLayout->addMultiCellWidget( BaseGrid, 0, 0, 0, 1 );
AutoLsp = new QRadioButton( tr("Automatic Linespacing"), AbstandV, "AutoLsp" );
AbstandVLayout->addMultiCellWidget( AutoLsp, 1, 1, 0, 1 );
FixedLsp = new QRadioButton( tr("Fixed Linespacing"), AbstandV, "FixedLsp" );
AbstandVLayout->addMultiCellWidget( FixedLsp, 2, 2, 0, 1 );
LineSpVal = new MSpinBox( 1, 300, AbstandV, 1 );
LineSpVal->setMinimumSize( QSize( 70, 22 ) );
LineSpVal->setSuffix( tr( " pt" ) );
LineSpVal->setValue(vor->LineSpa);
AbstandVLayout->addWidget( LineSpVal, 3, 1 );
 
AboveV = new MSpinBox( 0, 300, AbstandV, 1 );
AboveV->setMinimumSize( QSize( 70, 22 ) );
AbstandVLayout->addWidget( AboveV, 1, 1 );
AbstandVLayout->addWidget( AboveV, 4, 1 );
 
BelowV = new MSpinBox( 0, 300, AbstandV, 1 );
BelowV->setMinimumSize( QSize( 70, 22 ) );
AbstandVLayout->addWidget( BelowV, 2, 1 );
AbstandVLayout->addWidget( BelowV, 5, 1 );
 
LineSpVal = new MSpinBox( 1, 300, AbstandV, 1 );
LineSpVal->setMinimumSize( QSize( 70, 22 ) );
LineSpVal->setSuffix( tr( " pt" ) );
LineSpVal->setValue(vor->LineSpa);
AbstandVLayout->addWidget( LineSpVal, 3, 1 );
 
TextLabel3 = new QLabel( LineSpVal, tr("Line &Spacing:"), AbstandV, "TextLabel3" );
TextLabel3->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)3, (QSizePolicy::SizeType)1,
TextLabel3->sizePolicy().hasHeightForWidth() ) );
174,12 → 177,27
TextLabel1_2_2->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)3, (QSizePolicy::SizeType)1,
TextLabel1_2_2->sizePolicy().hasHeightForWidth() ) );
TextLabel1_2_2->setMinimumSize( QSize( 90, 22 ) );
AbstandVLayout->addWidget( TextLabel1_2_2, 1, 0 );
AbstandVLayout->addWidget( TextLabel1_2_2, 4, 0 );
TextLabel1_2_3 = new QLabel( BelowV, tr("&Below:"), AbstandV, "TextLabel1_2_3" );
TextLabel1_2_3->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)3, (QSizePolicy::SizeType)1,
TextLabel1_2_3->sizePolicy().hasHeightForWidth() ) );
TextLabel1_2_3->setMinimumSize( QSize( 90, 22 ) );
AbstandVLayout->addWidget( TextLabel1_2_3, 2, 0 );
AbstandVLayout->addWidget( TextLabel1_2_3, 5, 0 );
if (vor->BaseAdj)
{
BaseGrid->setChecked(vor->BaseAdj);
LineSpVal->setEnabled(false);
}
else
{
if (vor->LineSpaMode == 0)
FixedLsp->setChecked(true);
else
{
LineSpVal->setEnabled(false);
AutoLsp->setChecked(true);
}
}
EditStyleLayout->addWidget( AbstandV, 2, 1 );
 
GroupBox10 = new QGroupBox( tr("Tabulators and Indentation"), this, "GroupBox10" );
279,6 → 297,9
connect(BaseGrid, SIGNAL(stateChanged(int)), this, SLOT(updatePreview()));
connect(DropLines, SIGNAL(valueChanged(int)), this, SLOT(updatePreview()));
connect(previewCaption, SIGNAL( clicked() ), this, SLOT( togglePreview() ) );
connect(BaseGrid, SIGNAL(clicked()), this, SLOT(toggleLsp()));
connect(FixedLsp, SIGNAL(clicked()), this, SLOT(toggleLsp()));
connect(AutoLsp, SIGNAL(clicked()), this, SLOT(toggleLsp()));
 
AboveV->setDecimals(10);
BelowV->setDecimals(10);
297,6 → 318,19
togglePreview();
}
 
void EditStyle::toggleLsp()
{
if (BaseGrid->isChecked())
LineSpVal->setEnabled(false);
else
{
if (FixedLsp->isChecked())
LineSpVal->setEnabled(true);
else
LineSpVal->setEnabled(false);
}
}
 
void EditStyle::togglePreview()
{
if (previewCaption->isChecked())
379,6 → 413,13
}
werte->FontEffect = EffeS->getStyle();
werte->textAlignment = AligS->getStyle();
if (!BaseGrid->isChecked())
{
if (FixedLsp->isChecked())
werte->LineSpaMode = 0;
else
werte->LineSpaMode = 1;
}
werte->LineSpa = LineSpVal->value();
werte->Indent = QMAX(TabList->getLeftIndent(), 0.0);
werte->First = TabList->getFirstLine();
421,6 → 462,13
tmpStyle.Vname = Name->text() + " (preview temporary)";
tmpStyle.FontEffect = EffeS->getStyle();
tmpStyle.textAlignment = AligS->getStyle();
if (!BaseGrid->isChecked())
{
if (FixedLsp->isChecked())
tmpStyle.LineSpaMode = 0;
else
tmpStyle.LineSpaMode = 1;
}
tmpStyle.LineSpa = LineSpVal->value();
tmpStyle.Indent = TabList->getLeftIndent();
tmpStyle.First = TabList->getFirstLine();
/branches/Version13x/Scribus/scribus/icons/linespacing.png
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/branches/Version13x/Scribus/scribus/pageitem.h
286,6 → 286,7
double RExtra;
/** Linespacing */
double LineSp;
int LineSpMode;
/** Zeichen X-Position */
double CurX;
/** Zeichen Y-Position */
/branches/Version13x/Scribus/scribus/scribusstructs.h
113,6 → 113,7
int PLineJoin;
int PLineEnd;
double LineSp;
int LineSpMode;
double ExtraV;
double LocalScX;
double LocalScY;
227,6 → 228,7
struct ParagraphStyle
{
QString Vname;
int LineSpaMode; // 0 = fixed; 1 = Automatic
double LineSpa;
int textAlignment;
double Indent;
/branches/Version13x/Scribus/scribus/pageitem.cpp
54,6 → 54,7
extern double RealCWidth(ScribusDoc *doc, Foi* name, QString ch, int Siz);
extern double RealCAscent(ScribusDoc *currentDoc, Foi* name, QString ch, int Size);
extern double RealCHeight(ScribusDoc *currentDoc, Foi* name, QString ch, int Size);
extern double RealFHeight(ScribusDoc *currentDoc, Foi* name, int Size);
extern QPointArray FlattenPath(FPointArray ina, QValueList<uint> &Segs);
extern double xy2Deg(double x, double y);
extern void BezierPoints(QPointArray *ar, QPoint n1, QPoint n2, QPoint n3, QPoint n4);
132,6 → 133,7
FrameType = 0;
IFont = Doc->toolSettings.defFont;
ISize = Doc->toolSettings.defSize;
LineSpMode = 0;
LineSp = ((Doc->toolSettings.defSize / 10.0) * static_cast<double>(Doc->typographicSetttings.autoLineSpacing) / 100) + (Doc->toolSettings.defSize / 10.0);
Doc->docParagraphStyles[0].LineSpa = LineSp;
CurX = 0;
606,6 → 608,11
for (int xxx=0; xxx<5; ++xxx)
{
Doc->docParagraphStyles[xxx].LineSpaMode = LineSpMode;
if (LineSpMode == 2)
Doc->docParagraphStyles[xxx].BaseAdj = true;
else
Doc->docParagraphStyles[xxx].BaseAdj = false;
Doc->docParagraphStyles[xxx].LineSpa = LineSp;
Doc->docParagraphStyles[xxx].FontSize = ISize;
Doc->docParagraphStyles[xxx].Indent = 0;
663,7 → 670,7
uint tabCc = 0;
for (a = 0; a < itemText.count(); ++a)
{
if (a > MaxChars)
if (a >= MaxChars)
break;
hl = itemText.at(a);
if (hl->cab < 5)
695,7 → 702,15
if (Doc->docParagraphStyles[hl->cab].BaseAdj)
chs = qRound(10 * ((Doc->typographicSetttings.valueBaseGrid * (Doc->docParagraphStyles[hl->cab].DropLin-1)+(hl->cfont->numAscent * (Doc->docParagraphStyles[hl->cab].FontSize / 10.0))) / (RealCHeight(Doc, hl->cfont, chx, 10))));
else
chs = qRound(10 * ((Doc->docParagraphStyles[hl->cab].LineSpa * (Doc->docParagraphStyles[hl->cab].DropLin-1)+(hl->cfont->numAscent * (Doc->docParagraphStyles[hl->cab].FontSize / 10.0))) / (RealCHeight(Doc, hl->cfont, chx, 10))));
{
if (Doc->docParagraphStyles[hl->cab].LineSpaMode == 0)
chs = qRound(10 * ((Doc->docParagraphStyles[hl->cab].LineSpa * (Doc->docParagraphStyles[hl->cab].DropLin-1)+(hl->cfont->numAscent * (Doc->docParagraphStyles[hl->cab].FontSize / 10.0))) / (RealCHeight(Doc, hl->cfont, chx, 10))));
else
{
double currasce = RealFHeight(Doc, hl->cfont, hl->csize);
chs = qRound(10 * ((currasce * (Doc->docParagraphStyles[hl->cab].DropLin-1)+(hl->cfont->numAscent * (Doc->docParagraphStyles[hl->cab].FontSize / 10.0))) / RealCHeight(Doc, hl->cfont, chx, 10)));
}
}
}
oldCurY = SetZeichAttr(hl, &chs, &chx);
if ((chx == QChar(9)) && (tTabValues.count() != 0) && (tabCc < tTabValues.count()) && (!tTabValues[tabCc].tabFillChar.isNull()))
997,6 → 1012,8
if (hl->ch == QChar(30))
chx = ExpandToken(a);
absa = hl->cab;
if (Doc->docParagraphStyles[absa].LineSpaMode == 1)
Doc->docParagraphStyles[absa].LineSpa = RealFHeight(Doc, hl->cfont, hl->csize);
if (a == 0)
{
if (BackBox != 0)
1057,7 → 1074,12
if (Doc->docParagraphStyles[hl->cab].BaseAdj)
CurY += Doc->typographicSetttings.valueBaseGrid * (DropLines-1);
else
CurY += Doc->docParagraphStyles[absa].LineSpa * (DropLines-1);
{
if (Doc->docParagraphStyles[absa].LineSpaMode == 0)
CurY += Doc->docParagraphStyles[absa].LineSpa * (DropLines-1);
else
CurY += RealFHeight(Doc, hl->cfont, hl->csize) * (DropLines-1);
}
}
}
}
1070,8 → 1092,17
}
else
{
chsd = qRound(10 * ((Doc->docParagraphStyles[absa].LineSpa * (DropLines-1)+(hl->cfont->numAscent * (Doc->docParagraphStyles[hl->cab].FontSize / 10.0))) / (RealCHeight(Doc, hl->cfont, chx, 10))));
chs = qRound(10 * ((Doc->docParagraphStyles[absa].LineSpa * (DropLines-1)+(hl->cfont->numAscent * (Doc->docParagraphStyles[hl->cab].FontSize / 10.0))) / RealCAscent(Doc, hl->cfont, chx, 10)));
if (Doc->docParagraphStyles[absa].LineSpaMode == 0)
{
chsd = qRound(10 * ((Doc->docParagraphStyles[absa].LineSpa * (DropLines-1)+(hl->cfont->numAscent * (Doc->docParagraphStyles[hl->cab].FontSize / 10.0))) / (RealCHeight(Doc, hl->cfont, chx, 10))));
chs = qRound(10 * ((Doc->docParagraphStyles[absa].LineSpa * (DropLines-1)+(hl->cfont->numAscent * (Doc->docParagraphStyles[hl->cab].FontSize / 10.0))) / RealCAscent(Doc, hl->cfont, chx, 10)));
}
else
{
double currasce = RealFHeight(Doc, hl->cfont, hl->csize);
chsd = qRound(10 * ((currasce * (DropLines-1)+(hl->cfont->numAscent * (Doc->docParagraphStyles[hl->cab].FontSize / 10.0))) / (RealCHeight(Doc, hl->cfont, chx, 10))));
chs = qRound(10 * ((currasce * (DropLines-1)+(hl->cfont->numAscent * (Doc->docParagraphStyles[hl->cab].FontSize / 10.0))) / RealCAscent(Doc, hl->cfont, chx, 10)));
}
}
hl->cstyle |= 2048;
}
1423,9 → 1454,19
}
else
{
CurY -= Doc->docParagraphStyles[absa].LineSpa * (DropLines-1);
tcli.setPoint(0, QPoint(qRound(hl->xp), qRound(maxDY-DropLines*Doc->docParagraphStyles[absa].LineSpa)));
tcli.setPoint(1, QPoint(qRound(hl->xp+wide), qRound(maxDY-DropLines*Doc->docParagraphStyles[absa].LineSpa)));
if (Doc->docParagraphStyles[absa].LineSpaMode == 0)
{
CurY -= Doc->docParagraphStyles[absa].LineSpa * (DropLines-1);
tcli.setPoint(0, QPoint(qRound(hl->xp), qRound(maxDY-DropLines*Doc->docParagraphStyles[absa].LineSpa)));
tcli.setPoint(1, QPoint(qRound(hl->xp+wide), qRound(maxDY-DropLines*Doc->docParagraphStyles[absa].LineSpa)));
}
else
{
double currasce = RealFHeight(Doc, hl->cfont, hl->csize);
CurY -= currasce * (DropLines-1);
tcli.setPoint(0, QPoint(qRound(hl->xp), qRound(maxDY-DropLines*currasce)));
tcli.setPoint(1, QPoint(qRound(hl->xp+wide), qRound(maxDY-DropLines*currasce)));
}
}
tcli.setPoint(2, QPoint(qRound(hl->xp+wide), qRound(maxDY)));
tcli.setPoint(3, QPoint(qRound(hl->xp), qRound(maxDY)));
1602,7 → 1643,10
if (CurX+RExtra+lineCorr > ColBound.y())
{
fromOut = false;
CurY += Doc->docParagraphStyles[hl->cab].LineSpa;
if (Doc->docParagraphStyles[hl->cab].BaseAdj)
CurY += Doc->typographicSetttings.valueBaseGrid;
else
CurY += Doc->docParagraphStyles[hl->cab].LineSpa;
if ((CurY+desc+BExtra+lineCorr > Height) && (CurrCol+1 == Cols))
{
goNoRoom = true;
1651,7 → 1695,10
if (CurY < maxDY)
CurY = maxDY;
}
CurY += Doc->docParagraphStyles[hl->cab].LineSpa;
if (Doc->docParagraphStyles[hl->cab].BaseAdj)
CurY += Doc->typographicSetttings.valueBaseGrid;
else
CurY += Doc->docParagraphStyles[hl->cab].LineSpa;
if (AbsHasDrop)
{
if ((CurY > maxDY) && (CurY - asce > maxDY))
1676,7 → 1723,7
hl->yp = CurY;
LiList.at(LiList.count()-1)->xco = hl->xp;
LiList.at(LiList.count()-1)->yco = hl->yp;
if ((!AbsHasDrop) && (StartOfCol) && (!Doc->docParagraphStyles[hl->cab].BaseAdj))
if ((!AbsHasDrop) && (StartOfCol) && (!Doc->docParagraphStyles[hl->cab].BaseAdj) && (LiList.count() != 0))
{
Zli2 = LiList.at(0);
double firstasce = Zli2->ZFo->numAscent * (Zli2->Siz / 10.0);
1684,6 → 1731,8
for (uint zc = 0; zc < LiList.count(); ++zc)
{
Zli2 = LiList.at(zc);
if ((Zli2->Zeich == QChar(13)) || (Zli2->Zeich == QChar(10)) || (Zli2->Zeich == QChar(28)) || (Zli2->Zeich == QChar(9)))
continue;
currasce = QMAX(currasce, RealCAscent(Doc, Zli2->ZFo, Zli2->Zeich, Zli2->Siz));
}
double adj = firstasce - currasce;
1693,6 → 1742,25
}
CurY -= adj;
}
if ((!StartOfCol) && (!Doc->docParagraphStyles[hl->cab].BaseAdj) && (Doc->docParagraphStyles[hl->cab].LineSpaMode == 1) && (LiList.count() != 0))
{
Zli2 = LiList.at(0);
double firstasce = Doc->docParagraphStyles[hl->cab].LineSpa;
double currasce = RealFHeight(Doc, Zli2->ZFo, Zli2->realSiz);
for (uint zc = 0; zc < LiList.count(); ++zc)
{
Zli2 = LiList.at(zc);
if ((Zli2->Zeich == QChar(13)) || (Zli2->Zeich == QChar(10)) || (Zli2->Zeich == QChar(28)) || (Zli2->Zeich == QChar(9)))
continue;
currasce = QMAX(currasce, RealFHeight(Doc, Zli2->ZFo, Zli2->realSiz));
}
double adj = firstasce - currasce;
for (uint zc = 0; zc < LiList.count(); ++zc)
{
LiList.at(zc)->yco -= adj;
}
CurY -= adj;
}
StartOfCol = false;
tabDist = ColBound.x();
uint tabCc = 0;
1840,7 → 1908,7
}
}
}
if ((!AbsHasDrop) && (StartOfCol) && (!Doc->docParagraphStyles[hl->cab].BaseAdj))
if ((!AbsHasDrop) && (StartOfCol) && (!Doc->docParagraphStyles[hl->cab].BaseAdj) && (LiList.count() != 0))
{
Zli2 = LiList.at(0);
double firstasce = Zli2->ZFo->numAscent * (Zli2->Siz / 10.0);
1848,6 → 1916,8
for (uint zc = 0; zc < LiList.count(); ++zc)
{
Zli2 = LiList.at(zc);
if ((Zli2->Zeich == QChar(13)) || (Zli2->Zeich == QChar(10)) || (Zli2->Zeich == QChar(28)) || (Zli2->Zeich == QChar(9)))
continue;
currasce = QMAX(currasce, RealCAscent(Doc, Zli2->ZFo, Zli2->Zeich, Zli2->Siz));
}
double adj = firstasce - currasce;
1857,6 → 1927,25
}
CurY -= adj;
}
if ((!StartOfCol) && (!Doc->docParagraphStyles[hl->cab].BaseAdj) && (Doc->docParagraphStyles[hl->cab].LineSpaMode == 1) && (LiList.count() != 0))
{
Zli2 = LiList.at(0);
double firstasce = Doc->docParagraphStyles[hl->cab].LineSpa;
double currasce = RealFHeight(Doc, Zli2->ZFo, Zli2->realSiz);
for (uint zc = 0; zc < LiList.count(); ++zc)
{
Zli2 = LiList.at(zc);
if ((Zli2->Zeich == QChar(13)) || (Zli2->Zeich == QChar(10)) || (Zli2->Zeich == QChar(28)) || (Zli2->Zeich == QChar(9)))
continue;
currasce = QMAX(currasce, RealFHeight(Doc, Zli2->ZFo, Zli2->realSiz));
}
double adj = firstasce - currasce;
for (uint zc = 0; zc < LiList.count(); ++zc)
{
LiList.at(zc)->yco -= adj;
}
CurY -= adj;
}
StartOfCol = false;
tabDist = ColBound.x();
uint tabCc = 0;
/branches/Version13x/Scribus/scribus/scribusview.cpp
78,6 → 78,7
 
extern void Level2Layer(ScribusDoc *doc, struct Layer *ll, int Level);
extern double Cwidth(ScribusDoc *doc, Foi* name, QString ch, int Siz, QString ch2 = " ");
extern double RealFHeight(ScribusDoc *currentDoc, Foi* name, int Size);
extern ScribusApp* ScApp;
extern QPointArray FlattenPath(FPointArray ina, QValueList<uint> &Segs);
extern QPixmap loadIcon(QString nam);
10545,6 → 10546,40
}
}
 
void ScribusView::ChLineSpaMode(int w)
{
if (Doc->appMode != EditMode)
{
if (SelItem.count() != 0)
{
for (uint a = 0; a < SelItem.count(); ++a)
{
PageItem* currItem = SelItem.at(a);
currItem->LineSpMode = w;
if (w == 0)
{
currItem->LineSp = ((currItem->ISize / 10.0) * static_cast<double>(Doc->typographicSetttings.autoLineSpacing) / 100) + (currItem->ISize / 10.0);
Doc->docParagraphStyles[0].BaseAdj = false;
}
else if (w == 1)
{
Doc->docParagraphStyles[0].BaseAdj = false;
currItem->LineSp = RealFHeight(Doc, (*Doc->AllFonts)[currItem->IFont], currItem->ISize);
}
else
{
Doc->docParagraphStyles[0].BaseAdj = true;
currItem->LineSp = Doc->typographicSetttings.valueBaseGrid-1;
}
Doc->docParagraphStyles[0].LineSpa = currItem->LineSp;
emit ItemTextAttr(currItem->LineSp);
RefreshItem(currItem);
}
Doc->docParagraphStyles[0].LineSpaMode = w;
}
}
}
 
void ScribusView::chFSize(int size)
{
if (SelItem.count() != 0)
10558,9 → 10593,23
Doc->CurrFontSize = size;
if (Doc->appMode != EditMode)
{
currItem->LineSp = ((size / 10.0) * static_cast<double>(Doc->typographicSetttings.autoLineSpacing) / 100) + (size / 10.0);
Doc->docParagraphStyles[0].LineSpa = currItem->LineSp;
emit ItemTextAttr(currItem->LineSp);
if (currItem->LineSpMode == 0)
{
currItem->LineSp = ((size / 10.0) * static_cast<double>(Doc->typographicSetttings.autoLineSpacing) / 100) + (size / 10.0);
Doc->docParagraphStyles[0].LineSpa = currItem->LineSp;
emit ItemTextAttr(currItem->LineSp);
}
else if (currItem->LineSpMode == 1)
{
currItem->LineSp = RealFHeight(Doc, (*Doc->AllFonts)[currItem->IFont], currItem->ISize);
Doc->docParagraphStyles[0].LineSpa = currItem->LineSp;
emit ItemTextAttr(currItem->LineSp);
}
else
{
currItem->LineSp = Doc->typographicSetttings.valueBaseGrid-1;
emit ItemTextAttr(currItem->LineSp);
}
currItem->setFontSize(size);
emit ItemTextSize(currItem->ISize);
emit ItemTextCols(currItem->Cols, currItem->ColGap);
11133,6 → 11182,12
break;
}
PageItem *currItem = Doc->Items.at(z);
currItem->LineSpMode = Buffer->LineSpMode;
if (currItem->LineSpMode == 3)
{
Doc->docParagraphStyles[0].BaseAdj = true;
currItem->LineSp = Doc->typographicSetttings.valueBaseGrid-1;
}
currItem->setImageFlippedH(Buffer->flippedH);
currItem->setImageFlippedV(Buffer->flippedV);
currItem->RadRect = Buffer->RadRect;
/branches/Version13x/Scribus/scribus/scribus.cpp
3840,6 → 3840,7
emit TextOutline(doc->CurrTextOutline);
setStilvalue(doc->CurrentStyle);
}
doc->docParagraphStyles[0].LineSpaMode = currItem->LineSpMode;
doc->docParagraphStyles[0].LineSpa = currItem->LineSp;
doc->docParagraphStyles[0].textAlignment = currItem->textAlignment;
break;
7198,6 → 7199,7
break;
}
if ((doc->docParagraphStyles[a].LineSpa == dia->TempVorl[b].LineSpa) &&
(doc->docParagraphStyles[a].LineSpaMode == dia->TempVorl[b].LineSpaMode) &&
(doc->docParagraphStyles[a].Indent == dia->TempVorl[b].Indent) &&
(doc->docParagraphStyles[a].First == dia->TempVorl[b].First) &&
(doc->docParagraphStyles[a].textAlignment == dia->TempVorl[b].textAlignment) &&