Subversion Repositories Scribus

Compare Revisions

Ignore whitespace Rev 12894 → Rev 12895

/trunk/Scribus/scribus/gtaction.cpp
96,6 → 96,44
textFrame->CPos = 0;
}
 
void gtAction::writeUnstyled(const QString& text)
{
if (isFirstWrite)
{
if (!doAppend)
{
if (it->nextInChain() != 0)
{
PageItem *nextItem = it->nextInChain();
while (nextItem != 0)
{
nextItem->itemText.clear();
nextItem->CPos = 0;
nextItem = nextItem->nextInChain();
}
}
it->itemText.clear();
it->CPos = 0;
}
}
 
QChar ch0(0), ch5(5), ch10(10), ch13(13);
for (int a = 0; a < text.length(); ++a)
{
if ((text.at(a) == ch0) || (text.at(a) == ch13))
continue;
QChar ch = text.at(a);
if ((ch == ch10) || (ch == ch5))
ch = ch13;
int pos = it->itemText.length();
it->itemText.insertChars(pos, QString(ch));
}
lastCharWasLineChange = text.right(1) == "\n";
isFirstWrite = false;
}
 
void gtAction::write(const QString& text, gtStyle *style)
{
if (isFirstWrite)
135,7 → 173,6
if ((inPara) && (!lastCharWasLineChange) && (text.left(1) != "\n") && (lastParagraphStyle != -1))
paragraphStyle = lastParagraphStyle;
 
 
if (paragraphStyle == -1)
paragraphStyle = 0; //::findParagraphStyle(textFrame->doc(), textFrame->doc()->currentStyle);
 
143,47 → 180,24
 
gtFont* font = style->getFont();
QString fontName = validateFont(font).scName();
gtFont font2(*font);
font2.setName(textFrame->doc()->paragraphStyles()[paragraphStyle].charStyle().font().scName());
QString fontName2 = validateFont(&font2).scName();
CharStyle lastStyle;
CharStyle lastStyle, newStyle;
int lastStyleStart = 0;
 
CharStyle newStyle;
if ((inPara) && (!overridePStyleFont))
{
if (textFrame->doc()->paragraphStyles()[paragraphStyle].charStyle().font().isNone())
if (paraStyle.charStyle().font().isNone())
{
gtFont font2(*font);
font2.setName(paraStyle.charStyle().font().scName());
QString fontName2 = validateFont(&font2).scName();
newStyle.setFont((*textFrame->doc()->AllFonts)[fontName2]);
else
newStyle.setFont(paraStyle.charStyle().font());
newStyle.setFontSize(paraStyle.charStyle().fontSize());
newStyle.setFillColor(paraStyle.charStyle().fillColor());
newStyle.setFillShade(paraStyle.charStyle().fillShade());
newStyle.setStrokeColor(paraStyle.charStyle().strokeColor());
newStyle.setStrokeShade(paraStyle.charStyle().strokeShade());
newStyle.setFeatures(paraStyle.charStyle().features());
}
}
else
{
newStyle.setFont((*textFrame->doc()->AllFonts)[fontName]);
newStyle.setFontSize(font->getSize());
newStyle.setFillColor(parseColor(font->getColor()));
newStyle.setFillShade(font->getShade());
newStyle.setStrokeColor(parseColor(font->getStrokeColor()));
newStyle.setStrokeShade(font->getStrokeShade());
newStyle.setFeatures(static_cast<StyleFlag>(font->getEffectsValue()).featureList());
setCharStyleAttributes(font, newStyle);
}
newStyle.setScaleH(font->getHscale());
newStyle.setScaleV(1000);
newStyle.setBaselineOffset(0);
newStyle.setShadowXOffset(50);
newStyle.setShadowYOffset(-50);
newStyle.setOutlineWidth(10);
newStyle.setUnderlineOffset(-1);
newStyle.setUnderlineWidth(-1);
newStyle.setStrikethruOffset(-1);
newStyle.setStrikethruWidth(-1);
newStyle.setTracking(font->getKerning());
/*newStyle.eraseCharStyle(paraStyle.charStyle());*/
 
lastStyle = newStyle;
lastStyleStart = it->itemText.length();
199,12 → 213,27
int pos = it->itemText.length();
it->itemText.insertChars(pos, QString(ch));
if (ch == SpecialChars::PARSEP) {
it->itemText.applyStyle(pos, paraStyle);
if (ch == SpecialChars::PARSEP)
{
if (paraStyle.hasName())
{
ParagraphStyle pstyle;
pstyle.setParent(paraStyle.name());
it->itemText.applyStyle(pos, pstyle);
}
else
it->itemText.applyStyle(pos, paraStyle);
}
}
it->itemText.applyCharStyle(lastStyleStart, it->itemText.length()-lastStyleStart, lastStyle);
it->itemText.applyStyle(qMax(0,it->itemText.length()-1), paraStyle);
if (paraStyle.hasName())
{
ParagraphStyle pStyle;
pStyle.setParent(paraStyle.name());
it->itemText.applyStyle(qMax(0,it->itemText.length()-1), pStyle);
}
else
it->itemText.applyStyle(qMax(0,it->itemText.length()-1), paraStyle);
lastCharWasLineChange = text.right(1) == "\n";
inPara = style->target() == "paragraph";
297,13 → 326,20
{
const CharStyle& style(textFrame->itemText.defaultStyle().charStyle());
font->setName(style.font().scName());
font->setSize(style.fontSize());
font->setColor(style.fillColor());
font->setShade(qRound(style.fillShade()));
font->setStrokeColor(style.strokeColor());
font->setStrokeShade(qRound(style.strokeShade()));
font->setHscale(qRound(style.scaleH()));
if (!style.isInhFont())
font->setName(style.font().scName());
if (!style.isInhFontSize())
font->setSize(style.fontSize());
if (!style.isInhFillColor())
font->setColor(style.fillColor());
if (!style.isInhFillShade())
font->setShade(qRound(style.fillShade()));
if (!style.isInhStrokeColor())
font->setStrokeColor(style.strokeColor());
if (!style.isInhStrokeShade())
font->setStrokeShade(qRound(style.strokeShade()));
if (!style.isInhScaleH())
font->setHscale(qRound(style.scaleH()));
font->setKerning(0);
}
 
317,15 → 353,23
const ParagraphStyle& vg(textFrame->itemText.defaultStyle());
fstyle->setName(vg.name());
fstyle->setLineSpacing(vg.lineSpacing());
fstyle->setAlignment(vg.alignment());
fstyle->setIndent(vg.leftMargin());
fstyle->setFirstLineIndent(vg.firstIndent());
fstyle->setSpaceAbove(vg.gapBefore());
fstyle->setSpaceBelow(vg.gapAfter());
fstyle->setDropCap(vg.hasDropCap());
fstyle->setDropCapHeight(vg.dropCapLines());
fstyle->setAdjToBaseline(vg.lineSpacingMode() == ParagraphStyle::BaselineGridLineSpacing);
 
if (!vg.isInhAlignment())
fstyle->setAlignment(vg.alignment());
if (!vg.isInhLeftMargin())
fstyle->setIndent(vg.leftMargin());
if (!vg.isInhFirstIndent())
fstyle->setFirstLineIndent(vg.firstIndent());
if (!vg.isInhGapBefore())
fstyle->setSpaceAbove(vg.gapBefore());
if (!vg.isInhGapAfter())
fstyle->setSpaceBelow(vg.gapAfter());
if (!vg.isInhHasDropCap())
fstyle->setDropCap(vg.hasDropCap());
if (!vg.isInhDropCapLines())
fstyle->setDropCapHeight(vg.dropCapLines());
 
gtFont font;
getFrameFont(&font);
fstyle->setFont(font);
341,32 → 385,13
return;
}
gtFont* font = pstyle->getFont();
ParagraphStyle vg;
vg.setName(pstyle->getName());
double linesp;
if (pstyle->getAutoLineSpacing())
linesp = getLineSpacing(pstyle->getFont()->getSize());
else
linesp = pstyle->getLineSpacing();
vg.setLineSpacingMode(pstyle->isAdjToBaseline() ? ParagraphStyle::BaselineGridLineSpacing : ParagraphStyle::FixedLineSpacing);
vg.setLineSpacing(linesp);
vg.setAlignment(static_cast<ParagraphStyle::AlignmentType>(pstyle->getAlignment()));
vg.setLeftMargin(pstyle->getIndent());
vg.setFirstIndent(pstyle->getFirstLineIndent());
vg.setGapBefore(pstyle->getSpaceAbove());
vg.setGapAfter(pstyle->getSpaceBelow());
vg.charStyle().setFont(validateFont(font));
vg.charStyle().setFontSize(font->getSize());
vg.setTabValues(*pstyle->getTabValues());
vg.setHasDropCap(pstyle->hasDropCap());
vg.setDropCapLines(pstyle->getDropCapHeight());
vg.setDropCapOffset(0);
vg.charStyle().setFeatures(static_cast<StyleFlag>(font->getEffectsValue()).featureList());
vg.charStyle().setFillColor(parseColor(font->getColor()));
vg.charStyle().setFillShade(font->getShade());
vg.charStyle().setStrokeColor(parseColor(font->getStrokeColor()));
vg.charStyle().setStrokeShade(font->getStrokeShade());
vg.charStyle().setShadowXOffset(50);
setParaStyleAttributes(pstyle, vg);
setCharStyleAttributes(font, vg.charStyle());
 
// Maybe set those attributes when target is the frame
/*vg.charStyle().setShadowXOffset(50);
vg.charStyle().setShadowYOffset(-50);
vg.charStyle().setOutlineWidth(10);
vg.charStyle().setScaleH(1000);
376,7 → 401,7
vg.charStyle().setUnderlineOffset(textFrame->doc()->typographicSettings.valueUnderlinePos);
vg.charStyle().setUnderlineWidth(textFrame->doc()->typographicSettings.valueUnderlineWidth);
vg.charStyle().setStrikethruOffset(textFrame->doc()->typographicSettings.valueStrikeThruPos);
vg.charStyle().setStrikethruWidth(textFrame->doc()->typographicSettings.valueStrikeThruPos);
vg.charStyle().setStrikethruWidth(textFrame->doc()->typographicSettings.valueStrikeThruPos);*/
 
StyleSet<ParagraphStyle> tmp;
tmp.create(vg);
385,6 → 410,64
m_ScMW->propertiesPalette->paraStyleCombo->updateFormatList();
}
 
void gtAction:: setCharStyleAttributes(gtFont *font, CharStyle& style)
{
int flags = font->getFlags();
style.erase();
 
if ((flags & gtFont::familyWasSet) || (flags & gtFont::weightWasSet))
style.setFont(validateFont(font));
if (flags & gtFont::sizeWasSet)
style.setFontSize(font->getSize());
if (flags & gtFont::effectWasSet)
style.setFeatures(static_cast<StyleFlag>(font->getEffectsValue()).featureList());
if (flags & gtFont::fillColorWasSet)
style.setFillColor(parseColor(font->getColor()));
if (flags & gtFont::fillShadeWasSet)
style.setFillShade(font->getShade());
if (flags & gtFont::strokeColorWasSet)
style.setStrokeColor(parseColor(font->getStrokeColor()));
if (flags & gtFont::strokeShadeWasSet)
style.setStrokeShade(font->getStrokeShade());
if (flags & gtFont::hscaleWasSet)
style.setScaleH(font->getHscale());
if (flags & gtFont::kerningWasSet)
style.setTracking(font->getKerning());
}
 
void gtAction::setParaStyleAttributes(gtParagraphStyle *pstyle, ParagraphStyle& style)
{
double linesp;
int flags = pstyle->getFlags();
style.erase();
 
style.setName(pstyle->getName());
if (pstyle->getAutoLineSpacing())
linesp = getLineSpacing(pstyle->getFont()->getSize());
else
linesp = pstyle->getLineSpacing();
style.setLineSpacingMode(pstyle->isAdjToBaseline() ? ParagraphStyle::BaselineGridLineSpacing : ParagraphStyle::FixedLineSpacing);
style.setLineSpacing(linesp);
 
if (flags & gtParagraphStyle::alignmentWasSet)
style.setAlignment(static_cast<ParagraphStyle::AlignmentType>(pstyle->getAlignment()));
if (flags & gtParagraphStyle::indentWasSet)
style.setLeftMargin(pstyle->getIndent());
if (flags & gtParagraphStyle::firstIndentWasSet)
style.setFirstIndent(pstyle->getFirstLineIndent());
if (flags & gtParagraphStyle::spaceAboveWasSet)
style.setGapBefore(pstyle->getSpaceAbove());
if (flags & gtParagraphStyle::spaceBelowWasSet)
style.setGapAfter(pstyle->getSpaceBelow());
if (flags & gtParagraphStyle::tabValueWasSet)
style.setTabValues(*pstyle->getTabValues());
if (flags & gtParagraphStyle::dropCapWasSet)
style.setHasDropCap(pstyle->hasDropCap());
if (flags & gtParagraphStyle::dropCapHeightWasSet)
style.setDropCapLines(pstyle->getDropCapHeight());
/*vg.setDropCapOffset(0);*/
}
 
void gtAction::removeParagraphStyle(const QString& name)
{
int index = findParagraphStyle(name);
410,31 → 493,12
{
gtFont* font = pstyle->getFont();
ParagraphStyle vg;
vg.setName(pstyle->getName());
double linesp;
if (pstyle->getAutoLineSpacing())
linesp = getLineSpacing(pstyle->getFont()->getSize());
else
linesp = pstyle->getLineSpacing();
vg.setLineSpacingMode(pstyle->isAdjToBaseline() ? ParagraphStyle::BaselineGridLineSpacing : ParagraphStyle::FixedLineSpacing);
vg.setLineSpacing(linesp);
vg.setAlignment(static_cast<ParagraphStyle::AlignmentType>(pstyle->getAlignment()));
vg.setLeftMargin(pstyle->getIndent());
vg.setFirstIndent(pstyle->getFirstLineIndent());
vg.setGapBefore(pstyle->getSpaceAbove());
vg.setGapAfter(pstyle->getSpaceBelow());
vg.charStyle().setFont(validateFont(font));
vg.charStyle().setFontSize(font->getSize());
vg.setTabValues(*pstyle->getTabValues());
vg.setHasDropCap(pstyle->hasDropCap());
vg.setDropCapLines(pstyle->getDropCapHeight());
vg.setDropCapOffset(0);
vg.charStyle().setFeatures(static_cast<StyleFlag>(font->getEffectsValue()).featureList());
vg.charStyle().setFillColor(parseColor(font->getColor()));
vg.charStyle().setFillShade(font->getShade());
vg.charStyle().setStrokeColor(parseColor(font->getStrokeColor()));
vg.charStyle().setStrokeShade(font->getStrokeShade());
vg.charStyle().setShadowXOffset(50);
 
setParaStyleAttributes(pstyle, vg);
setCharStyleAttributes(font, vg.charStyle());
 
// Maybe set those attributes when target is the frame
/*vg.charStyle().setShadowXOffset(50);
vg.charStyle().setShadowYOffset(-50);
vg.charStyle().setOutlineWidth(10);
vg.charStyle().setScaleH(1000);
444,7 → 508,8
vg.charStyle().setUnderlineOffset(textFrame->doc()->typographicSettings.valueUnderlinePos);
vg.charStyle().setUnderlineWidth(textFrame->doc()->typographicSettings.valueUnderlineWidth);
vg.charStyle().setStrikethruOffset(textFrame->doc()->typographicSettings.valueStrikeThruPos);
vg.charStyle().setStrikethruWidth(textFrame->doc()->typographicSettings.valueStrikeThruPos);
vg.charStyle().setStrikethruWidth(textFrame->doc()->typographicSettings.valueStrikeThruPos);*/
 
StyleSet<ParagraphStyle> tmp;
tmp.create(vg);
textFrame->doc()->redefineStyles(tmp, false);
/trunk/Scribus/scribus/gtwriter.h
57,6 → 57,7
void append(const QString& text); // Use the styles set beforehand
void append(const QString& text, gtStyle *style); // Use the style provided as a parameter
void append(const QString& text, gtStyle *style, bool updatePStyle);
void appendUnstyled(const QString& text); // Do not apply any formatting
double getFrameWidth();
QString getFrameName();
bool getUpdateParagraphStyles();
/trunk/Scribus/scribus/gtwriter.cpp
102,7 → 102,7
 
void gtWriter::append(const QString& text)
{
if (text.isNull())
if (text.isEmpty())
return;
if (text.length() == 0)
return;
120,6 → 120,15
}
}
 
void gtWriter::appendUnstyled(const QString& text)
{
if (text.isEmpty())
return;
if (text.length() == 0)
return;
action->writeUnstyled(text);
}
 
double gtWriter::getFrameWidth()
{
return action->getFrameWidth();
/trunk/Scribus/scribus/gtaction.h
42,6 → 42,8
#include "gtstyle.h"
#include "scribusapi.h"
 
class CharStyle;
class ParagraphStyle;
class ScribusDoc;
class ScribusMainWindow;
 
65,14 → 67,16
bool overridePStyleFont;
QString currentFrameStyle;
FontFamilyMap families;
 
int findParagraphStyle(const QString& name);
int findParagraphStyle(gtParagraphStyle* pstyle);
int applyParagraphStyle(gtParagraphStyle* pstyle);
ScFace validateFont(gtFont* font);
 
ScFace validateFont(gtFont* font);
QString findFontName(gtFont* font);
void updateParagraphStyle(int pstyleIndex, gtParagraphStyle* pstyle);
void updateParagraphStyle(int pstyleIndex, gtParagraphStyle* pstyle);
QString parseColor(const QString &s);
QColor parseColorN(const QString &rgbColor);
QColor parseColorN(const QString &rgbColor);
void finalize();
PrefsManager *prefsManager;
public:
88,8 → 92,11
void getFrameFont(gtFont *font);
void getFrameStyle(gtFrameStyle *fstyle);
void write(const QString& text, gtStyle *style);
void writeUnstyled(const QString& text);
void applyFrameStyle(gtFrameStyle* fstyle);
void createParagraphStyle(gtParagraphStyle* pstyle);
void setCharStyleAttributes(gtFont *font, CharStyle& style);
void setParaStyleAttributes(gtParagraphStyle *gtstyle, ParagraphStyle& style);
void updateParagraphStyle(const QString& pstyleName, gtParagraphStyle* pstyle);
void removeParagraphStyle(const QString& name);
void removeParagraphStyle(int index);
/trunk/Scribus/scribus/gtfont.cpp
69,6 → 69,7
 
gtFont::gtFont()
{
setflags = 0;
noEffects();
name = "";
family = "";
127,8 → 128,14
fontEffects[SUPERSCRIPT] = f.fontEffects[SUPERSCRIPT];
fontEffects[SUBSCRIPT] = f.fontEffects[SUBSCRIPT];
fontEffects[OUTLINE] = f.fontEffects[OUTLINE];
setflags = f.setflags;
}
 
int gtFont::getFlags()
{
return setflags;
}
 
bool gtFont::isToggled(FontEffect fe)
{
return fontEffects[fe];
163,6 → 170,7
if (fontEffects[fe])
fontEffects[NORMAL] = false;
}
setflags |= effectWasSet;
return fontEffects[fe];
}
 
194,6 → 202,7
setWidth(NO_WIDTH);
parseName();
useFullName = true;
setflags |= familyWasSet;
}
 
void gtFont::setFamily(QString newFamily)
200,6 → 209,7
{
family = newFamily;
useFullName = false;
setflags |= familyWasSet;
}
 
QString gtFont::getFamily()
211,10 → 221,12
{
weight = fontWeights[newWeight];
useFullName = false;
setflags |= weightWasSet;
if ((newWeight == ROMAN) || (newWeight == REGULAR))
{
setSlant(NO_SLANT);
setWidth(NO_WIDTH);
setflags &= ~weightWasSet;
}
if (weightIndex < 0)
{
228,11 → 240,13
{
weight = newWeight;
useFullName = false;
setflags |= weightWasSet;
if ((newWeight == fontWeights[ROMAN]) ||
(newWeight == fontWeights[REGULAR]))
{
setSlant(NO_SLANT);
setWidth(NO_WIDTH);
setflags |= ~weightWasSet;
}
if (weightIndex < 0)
{
251,6 → 265,7
{
slant = fontSlants[newSlant];
useFullName = false;
setflags &= ~slantWasSet;
if (newSlant != NO_SLANT)
{
if (weight == fontWeights[REGULAR])
257,6 → 272,7
setWeight(NO_WEIGHT);
else if (weight == fontWeights[ROMAN])
setWeight(NO_WEIGHT);
setflags |= slantWasSet;
}
if (slantIndex < 0)
{
270,6 → 286,7
{
slant = newSlant;
useFullName = false;
setflags &= ~slantWasSet;
if (!newSlant.isEmpty())
{
if (weight == fontWeights[REGULAR])
276,6 → 293,7
setWeight(NO_WEIGHT);
else if (weight == fontWeights[ROMAN])
setWeight(NO_WEIGHT);
setflags |= slantWasSet;
}
if (slantIndex < 0)
{
294,6 → 312,7
{
width = fontWidths[newWidth];
useFullName = false;
setflags &= ~widthWasSet;
if (newWidth != NO_WIDTH)
{
if (weight == fontWeights[REGULAR])
300,6 → 319,7
setWeight(NO_WEIGHT);
else if (weight == fontWeights[ROMAN])
setWeight(NO_WEIGHT);
setflags |= widthWasSet;
}
if (widthIndex < 0)
{
313,6 → 333,7
{
width = newWidth;
useFullName = false;
setflags &= ~widthWasSet;
if (!newWidth.isEmpty())
{
if (weight == fontWeights[REGULAR])
319,6 → 340,7
setWeight(NO_WEIGHT);
else if (weight == fontWeights[ROMAN])
setWeight(NO_WEIGHT);
setflags |= widthWasSet;
}
if (widthIndex < 0)
{
336,31 → 358,37
void gtFont::setSize(int newSize)
{
size = newSize;
setflags |= sizeWasSet;
}
 
void gtFont::setSize(double newSize)
{
size = static_cast<int>(newSize);
setflags |= sizeWasSet;
}
 
void gtFont::setColor(QString newColor)
{
color = newColor;
setflags |= fillColorWasSet;
}
 
void gtFont::setShade(int newShade)
{
shade = newShade;
setflags |= fillShadeWasSet;
}
 
void gtFont::setStrokeColor(QString newColor)
{
strokeColor = newColor;
setflags |= strokeColorWasSet;
}
 
void gtFont::setStrokeShade(int newShade)
{
strokeShade = newShade;
setflags |= strokeShadeWasSet;
}
 
QString gtFont::getName()
484,6 → 512,7
fontEffects[SUPERSCRIPT] = false;
fontEffects[SUBSCRIPT] = false;
fontEffects[OUTLINE] = false;
setflags &= ~effectWasSet;
}
 
int gtFont::getHscale()
491,9 → 520,10
return hscale;
}
 
void gtFont::setHscale(int newHscale)
void gtFont::setHscale(int newHscale)
{
hscale = newHscale;
setflags |= hscaleWasSet;
}
 
int gtFont::getKerning()
504,6 → 534,7
void gtFont::setKerning(int newKerning)
{
kerning = newKerning;
setflags |= kerningWasSet;
}
 
void gtFont::parseName()
518,8 → 549,6
parseSlant();
parseWidth();
parseFamily();
 
 
}
 
void gtFont::parseWeight()
/trunk/Scribus/scribus/gtparagraphstyle.cpp
46,6 → 46,7
adjToBaseline = p.adjToBaseline;
autoLineSpacing = p.autoLineSpacing;
isVisible = p.isVisible;
flags = p.flags;
}
 
gtParagraphStyle::gtParagraphStyle(const gtStyle& s) : gtStyle(s)
67,6 → 68,7
adjToBaseline = false;
autoLineSpacing = false;
isVisible = true;
flags = 0;
}
 
QString gtParagraphStyle::target()
74,6 → 76,11
return QString("paragraph");
}
 
int gtParagraphStyle::getFlags()
{
return flags;
}
 
bool gtParagraphStyle::isDefaultStyle()
{
return defaultStyle;
92,6 → 99,7
void gtParagraphStyle::setLineSpacing(double newLineSpacing)
{
lineSpacing = newLineSpacing;
flags |= lineSpacingWasSet;
}
 
bool gtParagraphStyle::getAutoLineSpacing()
102,6 → 110,7
void gtParagraphStyle::setAutoLineSpacing(bool newALS)
{
autoLineSpacing = newALS;
flags |= autoLineSpacingWasSet;
}
 
int gtParagraphStyle::getAlignment()
112,12 → 121,16
void gtParagraphStyle::setAlignment(Alignment newAlignment)
{
alignment = newAlignment;
flags |= alignmentWasSet;
}
 
void gtParagraphStyle::setAlignment(int newAlignment)
{
if ((newAlignment > -1) && (newAlignment < AlignmentMAX))
{
alignment = newAlignment;
flags |= alignmentWasSet;
}
}
 
double gtParagraphStyle::getIndent()
128,6 → 141,7
void gtParagraphStyle::setIndent(double newIndent)
{
indent = newIndent;
flags |= indentWasSet;
}
 
double gtParagraphStyle::getFirstLineIndent()
138,6 → 152,7
void gtParagraphStyle::setFirstLineIndent(double newFirstLineIndent)
{
firstLineIndent = newFirstLineIndent;
flags |= firstIndentWasSet;
}
 
double gtParagraphStyle::getSpaceAbove()
148,6 → 163,7
void gtParagraphStyle::setSpaceAbove(double newSpaceAbove)
{
spaceAbove = newSpaceAbove;
flags |= spaceAboveWasSet;
}
 
double gtParagraphStyle::getSpaceBelow()
158,6 → 174,7
void gtParagraphStyle::setSpaceBelow(double newSpaceBelow)
{
spaceBelow = newSpaceBelow;
flags |= spaceBelowWasSet;
}
 
QList<ParagraphStyle::TabRecord>* gtParagraphStyle::getTabValues()
172,6 → 189,7
tb.tabType = ttype;
tb.tabFillChar = QChar();
tabValues.append(tb);
flags |= tabValueWasSet;
}
 
bool gtParagraphStyle::hasDropCap()
182,6 → 200,7
void gtParagraphStyle::setDropCap(bool newDropCap)
{
dropCap = newDropCap;
flags |= dropCapWasSet;
}
 
void gtParagraphStyle::setDropCap(int newHeight)
188,6 → 207,7
{
setDropCap(true);
dropCapHeight = newHeight;
flags |= dropCapHeightWasSet;
}
 
int gtParagraphStyle::getDropCapHeight()
198,6 → 218,7
void gtParagraphStyle::setDropCapHeight(int newHeight)
{
dropCapHeight = newHeight;
flags |= dropCapHeightWasSet;
}
 
bool gtParagraphStyle::isAdjToBaseline()
208,6 → 229,7
void gtParagraphStyle::setAdjToBaseline(bool newAdjToBaseline)
{
adjToBaseline = newAdjToBaseline;
flags |= adjToBaselineWasSet;
}
 
void gtParagraphStyle::getStyle(gtStyle* style)
/trunk/Scribus/scribus/gtfont.h
91,6 → 91,7
class SCRIBUS_API gtFont
{
private:
int setflags;
QString name;
QString family;
QString weight;
123,13 → 124,33
void parseWidth();
void parseFamily();
int find(const QString& where, const QString& what);
 
public:
 
typedef enum
{
familyWasSet = 1,
weightWasSet = 2,
slantWasSet = 4,
widthWasSet = 8,
sizeWasSet = 16,
effectWasSet = 32,
fillColorWasSet = 64,
fillShadeWasSet = 128,
strokeColorWasSet = 256,
strokeShadeWasSet = 512,
hscaleWasSet = 1024,
kerningWasSet = 2048
} wasSetFlags;
 
static const QString fontWeights[];
static const QString fontSlants[];
static const QString fontWidths[];
 
void noEffects();
bool isToggled(FontEffect fe);
bool toggleEffect(FontEffect fe);
int getFlags();
int getEffectsValue();
void setName(QString newName);
void setFamily(QString newFamily);
159,7 → 180,7
int getStrokeShade();
int getHscale();
void setHscale(int newHscale);
int getKerning();
int getKerning();
void setKerning(int newKerning);
gtFont();
gtFont(const gtFont& f);
/trunk/Scribus/scribus/plugins/gettext/txtim/txtim.cpp
44,7 → 44,7
 
void TxtIm::write()
{
writer->append(text);
writer->appendUnstyled(text);
}
 
void TxtIm::loadText()
/trunk/Scribus/scribus/plugins/gettext/sxwim/contentreader.cpp
263,7 → 263,7
if (!inNote && !inNoteBody) // Disable notes import for now
{
if (importTextOnly)
writer->append(text);
writer->appendUnstyled(text);
else if (inSpan)
writer->append(text, currentStyle, false);
else
/trunk/Scribus/scribus/plugins/gettext/htmlim/htmlreader.cpp
272,7 → 272,7
}
 
if (noFormatting)
writer->append(tmp);
writer->appendUnstyled(tmp);
else if (inP)
writer->append(tmp, pstylep);
else if (inLI)
/trunk/Scribus/scribus/plugins/gettext/docim/docim.cpp
166,7 → 166,7
void DocIm::write()
{
if (!failed)
writer->append(text);
writer->appendUnstyled(text);
else
QMessageBox::information(0, tr("Importing failed"),
tr("Importing Word document failed \n%1").arg(error),
/trunk/Scribus/scribus/plugins/gettext/pdbim/pdbim.cpp
71,10 → 71,12
else
codec = QTextCodec::codecForName(encoding.toLocal8Bit());
data = codec->toUnicode(data.toLocal8Bit());
gtParagraphStyle *pstyle = new gtParagraphStyle(*(writer->getDefaultStyle()));
// Applying default style is of very limited use with 135svn style system
/*gtParagraphStyle *pstyle = new gtParagraphStyle(*(writer->getDefaultStyle()));
pstyle->setName(writer->getFrameName() + "-" + QObject::tr("PDB_data", "PDB Importer"));
writer->append(data, pstyle);
delete pstyle;
delete pstyle;*/
writer->appendUnstyled(data);
}
 
void PdbIm::loadFile(QString fname)
/trunk/Scribus/scribus/plugins/gettext/odtim/contentreader.cpp
266,7 → 266,7
if (!inNote && !inNoteBody) // Disable notes import for now
{
if (importTextOnly)
writer->append(text);
writer->appendUnstyled(text);
else if (inSpan)
writer->append(text, currentStyle, false);
else
/trunk/Scribus/scribus/gtparagraphstyle.h
53,6 → 53,7
private:
void init();
protected:
int flags;
bool defaultStyle;
double lineSpacing;
int alignment;
67,6 → 68,24
bool autoLineSpacing;
bool isVisible;
public:
 
typedef enum
{
lineSpacingWasSet = 1,
alignmentWasSet = 2,
indentWasSet = 4,
firstIndentWasSet = 8,
spaceAboveWasSet = 16,
spaceBelowWasSet = 32,
tabValueWasSet = 64,
fillShadeWasSet = 128,
dropCapWasSet = 256,
dropCapHeightWasSet = 512,
adjToBaselineWasSet = 1024,
autoLineSpacingWasSet = 2048,
} wasSetFlags;
 
int getFlags();
bool isDefaultStyle();
void setDefaultStyle(bool defStyle);
double getLineSpacing();