Subversion Repositories Scribus

Compare Revisions

Ignore whitespace Rev 5777 → Rev 5778

/branches/Version13x/Scribus/scribus/scribusdoc.cpp
5053,7 → 5053,31
emit updateContents();
}
}
/*
template<typename Arg, void (PageItem::*Fun)(Arg)>
void ScribusDoc::itemSelection_forall(Arg newVal)
{
uint docSelectionCount=m_Selection->count();
if (docSelectionCount != 0)
{
if (docSelectionCount > 1)
undoManager->beginTransaction(Um::SelectionGroup, Um::IGroup, Um::ApplyTextStyle,
newstyle.asString(), Um::IFont);
for (uint aa = 0; aa < docSelectionCount; ++aa)
{
PageItem *currItem = m_Selection->itemAt(aa);
currItem->Fun(newVal);
}
}
if (docSelectionCount > 1)
undoManager->commit();
emit updateContents();
}
*/
 
 
 
 
/* CB Dont delete, backups
void ScribusDoc::FlipImageH()
{
/branches/Version13x/Scribus/scribus/style.cpp
234,6 → 234,7
 
ParagraphStyle& ParagraphStyle::operator=(const ParagraphStyle& other)
{
setParent(other.parent());
cstyle = other.charStyle();
LineSpaMode = other.LineSpaMode;
LineSpa = (other.LineSpa);
/branches/Version13x/Scribus/scribus/pageitem_textframe.cpp
164,6 → 164,20
#include "text/pageitem_textframe.cpp"
#else
 
static void dumpIt(const ParagraphStyle& pstyle, QString indent = QString("->"))
{
qDebug(QString("%6%1/%2 @ %3: %4--%5")
.arg(pstyle.name())
.arg(pstyle.parent()? pstyle.parent()->name() : "-")
.arg( (unsigned int) &pstyle)
.arg(pstyle.leftMargin())
.arg(pstyle.rightMargin())
.arg(indent));
static QString more(" ");
if (pstyle.parent())
dumpIt(*dynamic_cast<const ParagraphStyle*>(pstyle.parent()), more + indent);
}
 
static const bool opticalMargins = true;
 
void PageItem_TextFrame::layout()
225,6 → 239,17
}
*/
// dump styles
/*
for (int i=0; i < itemText.nrOfParagraphs(); ++i) {
const ParagraphStyle& pstyle(itemText.paragraphStyle(itemText.endOfParagraph(i)));
qDebug(QString("par %1:").arg(i));
dumpIt(pstyle);
}
qDebug(QString("default:"));
dumpIt(itemText.defaultStyle());
*/
QPtrList<ZZ> LiList;
LiList.setAutoDelete(true);
 
283,6 → 308,10
{
hl = itemText.item(0);
style = itemText.paragraphStyle(0);
if (style.rightMargin() < 0) {
qDebug(QString("style pos 0:"));
dumpIt(style);
}
// qDebug(QString("style @0: %1 -- %2, %4/%5 char: %3").arg(style.leftMargin()).arg(style.rightMargin())
// .arg(style.charStyle().asString()).arg(style.name()).arg(style.parent()?style.parent()->name():""));
if (style.hasDropCap())
319,6 → 348,11
{
hl = itemText.item(a);
style = itemText.paragraphStyle(a);
if (style.rightMargin() < 0) {
qDebug(QString("style pos %1:").arg(a));
dumpIt(style);
dumpIt(itemText.paragraphStyle(a));
}
// qDebug(QString("style @%6: %1 -- %2, %4/%5 char: %3").arg(style.leftMargin()).arg(style.rightMargin())
// .arg(style.charStyle().asString()).arg(style.name()).arg(style.parent()?style.parent()->name():"")
// .arg(a));
1051,9 → 1085,14
if (LastSP != 0) // Hier koenen auch andere Trennungen eingebaut werden
{
// go back to last break position
// qDebug(QString("new break pos a=%1 BuPos=%2 LastSP=%3").arg(a).arg(BuPos).arg(LastSP));
a -= BuPos - LastSP;
hl = itemText.item(a);
style = itemText.paragraphStyle(a);
if (style.rightMargin() < 0) {
qDebug(QString("style pos < %1:").arg(a));
dumpIt(style);
}
// qDebug(QString("style <@%6: %1 -- %2, %4/%5 char: %3").arg(style.leftMargin()).arg(style.rightMargin())
// .arg(style.charStyle().asString()).arg(style.name()).arg(style.parent()?style.parent()->name():"")
// .arg(a));
1197,6 → 1236,16
else // no break position
{
a--;
hl = itemText.item(a);
style = itemText.paragraphStyle(a);
if (style.rightMargin() < 0) {
qDebug(QString("style nb pos %1:").arg(a));
dumpIt(style);
}
// qDebug(QString("style nb @%6: %1 -- %2, %4/%5 char: %3").arg(style.leftMargin()).arg(style.rightMargin())
// .arg(style.charStyle().asString()).arg(style.name()).arg(style.parent()?style.parent()->name():"")
// .arg(a));
 
BuPos--;
}
}
/branches/Version13x/Scribus/scribus/text/storytext.cpp
168,9 → 168,9
 
 
/**
A CharStyle's parent is usually the default paragraphstyle, unless explicitly
changed. This routines makes sure that all parent pointers to the default
paragraphStyle are up-to-date
A CharStyle's parent is usually the charstyle of default paragraphstyle,
unless explicitly changed. This routines makes sure that all parent pointers
to the default paragraphStyle's charstyle are up-to-date
*/
static void replaceParentStyle(StoryText* that, int pos, const CharStyle* oldP, const CharStyle* newP)
{
191,7 → 191,8
{
ScText* it = that->item(pos);
const ParagraphStyle& pstyle(that->paragraphStyle(pos));
it->parstyle = new ParagraphStyle(pstyle);
if(!it->parstyle)
it->parstyle = new ParagraphStyle(pstyle);
const CharStyle* oldP = & pstyle.charStyle();
const CharStyle* newP = & it->parstyle->charStyle();
replaceParentStyle(that, pos, oldP, newP);
207,7 → 208,7
const CharStyle* oldP = & it->parstyle->charStyle();
const CharStyle* newP = & that->paragraphStyle(pos+1).charStyle();
replaceParentStyle(that, pos, oldP, newP);
delete oldP;
delete it->parstyle;
}
}
 
406,12 → 407,17
++pos;
that->d->next();
}
if (pos == length())
return defaultStyle();
if (pos == length()) {
// qDebug(QString("using default parstyle at end (%1)").arg(pos));
return that->d->defaultStyle;
}
else if ( !that->d->current()->parstyle ) {
qDebug(QString("using default parstyle at %1").arg(pos));
qDebug(QString("inserting default parstyle at %1").arg(pos));
that->d->current()->parstyle = new ParagraphStyle(defaultStyle());
}
else {
// qDebug(QString("using parstyle at %1").arg(pos));
}
return *that->d->current()->parstyle;
}