Subversion Repositories Scribus

Compare Revisions

Ignore whitespace Rev 4748 → Rev 4749

/branches/Version13x/Scribus/scribus/scribusdoc.cpp
1536,11 → 1536,11
}
if ((ite->itemType() == PageItem::TextFrame) || (ite->itemType() == PageItem::PathText))
{
for (uint d=0; d<ite->itemText.count(); ++d)
for (int d=0; d<ite->itemText.length(); ++d)
{
if (it.key() == ite->itemText.at(d)->ccolor)
if (it.key() == ite->itemText.charStyle(d).ccolor)
found = true;
if (it.key() == ite->itemText.at(d)->cstroke)
if (it.key() == ite->itemText.charStyle(d).cstroke)
found = true;
if (found)
break;
1576,10 → 1576,10
}
if ((ite->itemType() == PageItem::TextFrame) || (ite->itemType() == PageItem::PathText))
{
for (uint d=0; d<ite->itemText.count(); ++d)
for (int d=0; d<ite->itemText.length(); ++d)
{
/* PFJ - 29.02.04 - Merged if's */
if ((it.key() == ite->itemText.at(d)->ccolor) || (it.key() == ite->itemText.at(d)->cstroke))
if ((it.key() == ite->itemText.charStyle(d).ccolor) || (it.key() == ite->itemText.charStyle(d).cstroke))
found = true;
if (found)
break;
1615,10 → 1615,10
}
if ((ite->itemType() == PageItem::TextFrame) || (ite->itemType() == PageItem::PathText))
{
for (uint d=0; d<ite->itemText.count(); ++d)
for (int d=0; d<ite->itemText.length(); ++d)
{
/* PFJ - 29.02.04 - Merged if's */
if ((it.key() == ite->itemText.at(d)->ccolor) || (it.key() == ite->itemText.at(d)->cstroke))
if ((it.key() == ite->itemText.charStyle(d).ccolor) || (it.key() == ite->itemText.charStyle(d).cstroke))
found = true;
if (found)
break;
1680,10 → 1680,10
}
if ((it->itemType() == PageItem::TextFrame) || (it->itemType() == PageItem::PathText))
{
for (uint e = 0; e < it->itemText.count(); ++e)
for (int e = 0; e < it->itemText.length(); ++e)
{
Really->insert(it->itemText.at(e)->cfont->scName(), UsedFonts[it->itemText.at(e)->cfont->scName()]);
uint chr = it->itemText.at(e)->ch[0].unicode();
Really->insert(it->itemText.charStyle(e).cfont->scName(), UsedFonts[it->itemText.charStyle(e).cfont->scName()]);
uint chr = it->itemText.text(e).unicode();
if ((chr == 13) || (chr == 32) || (chr == 29))
continue;
if (chr == 9)
1693,14 → 1693,14
if (docParagraphStyles[it->itemText.at(e)->cab].TabValues[t1].tabFillChar.isNull())
continue;
chx = QString(docParagraphStyles[it->itemText.at(e)->cab].TabValues[t1].tabFillChar);
if ((it->itemText.at(e)->cstyle & 64) || (it->itemText.at(e)->cstyle & 32))
if ((it->itemText.charStyle(e).cstyle & ScStyle_SmallCaps) || (it->itemText.charStyle(e).cstyle & ScStyle_AllCaps))
{
if (chx.upper() != QString(docParagraphStyles[it->itemText.at(e)->cab].TabValues[t1].tabFillChar))
chx = chx.upper();
}
chr = chx[0].unicode();
gly = it->itemText.at(e)->cfont->GlyphArray[chr].Outlines.copy();
it->itemText.at(e)->cfont->RealGlyphs.insert(chr, gly);
gly = it->itemText.charStyle(e).cfont->GlyphArray[chr].Outlines.copy();
it->itemText.charStyle(e).cfont->RealGlyphs.insert(chr, gly);
}
for (uint t1 = 0; t1 < it->TabValues.count(); t1++)
{
1707,14 → 1707,14
if (it->TabValues[t1].tabFillChar.isNull())
continue;
chx = QString(it->TabValues[t1].tabFillChar);
if ((it->itemText.at(e)->cstyle & 64) || (it->itemText.at(e)->cstyle & 32))
if ((it->itemText.charStyle(e).cstyle & ScStyle_SmallCaps) || (it->itemText.charStyle(e).cstyle & ScStyle_AllCaps))
{
if (chx.upper() != QString(it->TabValues[t1].tabFillChar))
chx = chx.upper();
}
chr = chx[0].unicode();
gly = it->itemText.at(e)->cfont->GlyphArray[chr].Outlines.copy();
it->itemText.at(e)->cfont->RealGlyphs.insert(chr, gly);
gly = it->itemText.charStyle(e).cfont->GlyphArray[chr].Outlines.copy();
it->itemText.charStyle(e).cfont->RealGlyphs.insert(chr, gly);
}
continue;
}
1723,10 → 1723,10
/* CB Removed forced loading of 0-9 for section based numbering
for (uint numco = 0x30; numco < 0x3A; ++numco)
{
if (it->itemText.at(e)->cfont->CharWidth.contains(numco))
if (it->itemText.charStyle(e)->cfont->CharWidth.contains(numco))
{
gly = it->itemText.at(e)->cfont->GlyphArray[numco].Outlines.copy();
it->itemText.at(e)->cfont->RealGlyphs.insert(numco, gly);
gly = it->itemText.charStyle(e)->cfont->GlyphArray[numco].Outlines.copy();
it->itemText.charStyle(e)->cfont->RealGlyphs.insert(numco, gly);
}
}*/
//Our page number collection string
1757,25 → 1757,25
for (uint pnti=0;pnti<pageNumberText.length(); ++pnti)
{
uint chr = pageNumberText[pnti].unicode();
if (it->itemText.at(e)->cfont->CharWidth.contains(chr))
if (it->itemText.charStyle(e).cfont->CharWidth.contains(chr))
{
FPointArray gly(it->itemText.at(e)->cfont->GlyphArray[chr].Outlines.copy());
it->itemText.at(e)->cfont->RealGlyphs.insert(chr, gly);
FPointArray gly(it->itemText.charStyle(e).cfont->GlyphArray[chr].Outlines.copy());
it->itemText.charStyle(e).cfont->RealGlyphs.insert(chr, gly);
}
}
continue;
}
if ((it->itemText.at(e)->cstyle & 64) || (it->itemText.at(e)->cstyle & 32))
if ((it->itemText.charStyle(e).cstyle & ScStyle_SmallCaps) || (it->itemText.charStyle(e).cstyle & ScStyle_AllCaps))
{
chx = it->itemText.at(e)->ch;
if (chx.upper() != it->itemText.at(e)->ch)
chx = it->itemText.text(e, 1);
if (chx.upper() != it->itemText.text(e, 1))
chx = chx.upper();
chr = chx[0].unicode();
}
if (it->itemText.at(e)->cfont->CharWidth.contains(chr))
if (it->itemText.charStyle(e).cfont->CharWidth.contains(chr))
{
gly = it->itemText.at(e)->cfont->GlyphArray[chr].Outlines.copy();
it->itemText.at(e)->cfont->RealGlyphs.insert(chr, gly);
gly = it->itemText.charStyle(e).cfont->GlyphArray[chr].Outlines.copy();
it->itemText.charStyle(e).cfont->RealGlyphs.insert(chr, gly);
}
}
}
1821,10 → 1821,10
Really.insert(it->font(), UsedFonts[it->font()]);
if ((it->itemType() == PageItem::TextFrame) || (it->itemType() == PageItem::PathText))
{
uint itemTextCount=it->itemText.count();
uint itemTextCount=it->itemText.length();
for (uint e = 0; e < itemTextCount; ++e)
{
Really.insert(it->itemText.at(e)->cfont->scName(), UsedFonts[it->itemText.at(e)->cfont->scName()]);
Really.insert(it->itemText.charStyle(e).cfont->scName(), UsedFonts[it->itemText.charStyle(e).cfont->scName()]);
}
}
}
3669,9 → 3669,9
if (appMode == modeNormal)
{
currItem->setFont(fon);
if (currItem->itemText.count() != 0)
if (currItem->itemText.length() != 0)
{
for (uint a = 0; a < currItem->itemText.count(); ++a)
for (int a = 0; a < currItem->itemText.length(); ++a)
currItem->itemText.at(a)->cfont = (*AllFonts)[fon];
if (currItem->asPathText())
{
3685,11 → 3685,11
}
if ((currItem->HasSel) && (appMode == modeEdit))
{
if (currItem->itemText.count() != 0)
if (currItem->itemText.length() != 0)
{
for (uint a = 0; a < currItem->itemText.count(); ++a)
for (int a = 0; a < currItem->itemText.length(); ++a)
{
if (currItem->itemText.at(a)->cselect)
if (currItem->itemText.selected(a))
currItem->itemText.at(a)->cfont = (*AllFonts)[fon];
}
emit refreshItem(currItem);
4209,7 → 4209,7
{
if (currItem->itemText.at(a)->cselect)
{
currItem->itemText.at(a)->cstyle &= ~1919;
currItem->itemText.at(a)->cstyle &= ~1919; // 0x11101111111
currItem->itemText.at(a)->cstyle |= s;
}
}
4218,7 → 4218,7
{
for (uint a = 0; a < currItem->itemText.count(); ++a)
{
currItem->itemText.at(a)->cstyle &= ~1919;
currItem->itemText.at(a)->cstyle &= ~1919; // 1024+512+256+64+32+16+8+4+2+1
currItem->itemText.at(a)->cstyle |= s;
}
}
5299,11 → 5299,6
ScMW->fileWatcher->removeFile(currItem->Pfile);
if (currItem->asTextFrame())
{
for (ScText *it = currItem->itemText.first(); it != 0; it = currItem->itemText.next())
{
if ((it->ch == QChar(25)) && (it->cembedded != 0))
FrameItems.remove(it->cembedded);
}
if ((currItem->NextBox != 0) || (currItem->BackBox != 0))
{
if (currItem->BackBox == 0)
5332,6 → 5327,7
}
else
{
currItem->itemText.clear();
if (currItem->isAutoText)
{
LastAuto = 0;
/branches/Version13x/Scribus/scribus/sctextstruct.h
37,22 → 37,23
*/
 
enum StyleFlag {
ScStyle_Default=0,
ScStyle_Superscript=1,
ScStyle_Subcript=2,
ScStyle_Outline=4,
ScStyle_Underline=8,
ScStyle_Strikethrough=16,
ScStyle_AllCaps=32,
ScStyle_SmallCaps=64,
ScStyle_Default = 0,
ScStyle_Superscript = 1,
ScStyle_Subcript = 2,
ScStyle_Outline = 4,
ScStyle_Underline = 8,
ScStyle_Strikethrough = 16,
ScStyle_AllCaps = 32,
ScStyle_SmallCaps = 64,
ScStyle_HyphenationPossible=128, //Hyphenation possible here (Smart Hyphen)
ScStyle_Shadowed=256,
ScStyle_Shadowed = 256,
ScStyle_UnderlineWords=512,
ScStyle_Reserved01=1024, //free, not used in the moment
ScStyle_DropCap=2048,
ScStyle_SuppressSpace=4096,//internal use in PageItem (Suppresses spaces when in Block alignment)
ScStyle_Reserved01 = 1024, //free, not used in the moment
ScStyle_DropCap = 2048,
ScStyle_SuppressSpace = 4096,//internal use in PageItem (Suppresses spaces when in Block alignment)
ScStyle_SmartHyphenVisible=8192, //Smart Hyphen visible at line end
ScStyle_StartOfLine=16384
ScStyle_StartOfLine = 16384,
ScStyle_UserStyles = 1919
};
 
 
214,7 → 215,7
if (other.cshade2 != NOVALUE)
cshade2 = other.cshade2;
if (other.cstyle != NOVALUE)
cstyle = other.cstyle;
cstyle = (cstyle & ScStyle_UserStyles) | (other.cstyle & ScStyle_UserStyles);
if (other.cscale != NOVALUE)
cscale = other.cscale;
if (other.cscalev != NOVALUE)
253,7 → 254,7
cshade = NOVALUE;
if (other.cshade2 == cshade2)
cshade2 = NOVALUE;
if (other.cstyle == cstyle)
if (other.cstyle & ScStyle_UserStyles == cstyle & ScStyle_UserStyles)
cstyle = NOVALUE;
if (other.cscale == cscale)
cscale = NOVALUE;
/branches/Version13x/Scribus/scribus/text/storytext.cpp
66,8 → 66,15
firstFrameItem = 0;
lastFrameItem = -1;
for (ScText *it = first(); it != 0; it = next())
{
if ((it->ch == SpecialChars::OBJECT) && (it->cembedded != 0)) {
doc->FrameItems.remove(it->cembedded);
it->cembedded = 0;
}
}
QPtrList<ScText>::clear();
//FIXME:NLS add deletion of embedded objects here
invalidateAll();
}
 
80,11 → 87,20
assert( len > 0 );
assert( pos >= 0 );
assert( pos + static_cast<int>(len) <= length() );
//FIXME:NLS
invalidate(pos, pos + len);
 
for ( int i=0; i < len; ++i )
{
ScText *it = take(i);
if ((it->ch == SpecialChars::OBJECT) && (it->cembedded != 0)) {
doc->FrameItems.remove(it->cembedded);
it->cembedded = 0;
}
delete it;
}
invalidate(pos, -1);
}
 
void StoryText::insertChars(int pos, QString txt)
void StoryText::insertChars(int pos, QString txt) //, const CharStyle&
{
if (pos < 0)
pos += length();
92,7 → 108,16
assert(txt.length() > 0);
assert(pos >= 0);
assert(pos <= length());
//FIXME:NLS
const CharStyle style = charStyle(pos);
for (int i = 0; i < txt.length(); ++i) {
ScText * item = new ScText();
item->ch= txt.mid(i, 1);
*static_cast<CharStyle *>(item) = style;
insert(pos + i, item);
}
 
invalidate(pos, pos + txt.length());
}
 
203,8 → 228,8
if (len == 0)
return;
 
// for (uint i=pos; i < pos+len; ++i)
// at(i).applyStyle(&style);
for (uint i=pos; i < pos+len; ++i)
at(i)->applyStyle(style);
 
invalidate(pos, pos + len);
}
288,7 → 313,8
 
bool StoryText::selected(int pos) const
{
return selFirst <= pos && pos <= selLast;
return (selFirst <= pos && pos <= selLast)
|| (pos >= 0 && pos < length() && at(pos)->cselect);
}
 
void StoryText::select(int pos, uint len, bool on)
374,7 → 400,7
{
}
 
void StoryText::invalidate(int firstRun, int lastRun)
void StoryText::invalidate(int firstitem, int lastitem)
{
}