Subversion Repositories Scribus

Compare Revisions

Ignore whitespace Rev 22991 → Rev 22992

/trunk/Scribus/scribus/scribusdoc.cpp
7883,7 → 7883,7
{
ParagraphStyle newStyle;
newStyle.setParent(name.isEmpty()? BaseStyle::INHERIT_PARENT : name);
itemSelection_ApplyParagraphStyle(newStyle, customSelection, true);
itemSelection_ApplyParagraphStyle(newStyle, customSelection, false);
}
 
 
/trunk/Scribus/scribus/text/storytext.cpp
58,6 → 58,7
m_shapedTextCache = new ShapedTextCache();
d->len = 0;
orphanedCharStyle = defaultStyle().charStyle();
invalidateAll();
}
 
555,6 → 556,13
if (pos + static_cast<int>(len) > length())
len = length() - pos;
 
if (pos == 0 && len > 0 && len == length())
{
int lastChar = length() - 1;
while (lastChar > 0 && text(lastChar) == SpecialChars::PARSEP)
--lastChar;
orphanedCharStyle = charStyle(lastChar);
}
for (int i = pos + static_cast<int>(len) - 1; i >= pos; --i)
{
ScText *it = d->at(i);
1152,7 → 1160,7
if (length() == 0)
{
// qDebug() << "storytext::charstyle: default";
return defaultStyle().charStyle();
return orphanedCharStyle;
}
if (pos == length())
{
/trunk/Scribus/scribus/text/storytext.h
283,6 → 283,7
private:
ScribusDoc * m_doc;
int m_selFirst, m_selLast;
CharStyle orphanedCharStyle;
ShapedTextCache* m_shapedTextCache;
static BreakIterator* m_graphemeIterator;
static BreakIterator* m_wordIterator;
/trunk/Scribus/scribus/ui/spalette.cpp
32,7 → 32,7
ParaStyleComboBox::ParaStyleComboBox(QWidget* parent) : QComboBox(parent)
{
setEditable(false);
addItem( tr("No Style"));
addItem( CommonStrings::trDefaultParagraphStyle );
currentDoc = nullptr;
connect(this, SIGNAL(activated(int)), this, SLOT(selFormat(int)));
}
45,7 → 45,7
 
void ParaStyleComboBox::setFormat(const QString& name)
{
setCurrentComboItem(this, name.isEmpty() ? tr("No Style") : name);
setCurrentComboItem(this, name.isEmpty() ? CommonStrings::trDefaultParagraphStyle : name);
}
 
void ParaStyleComboBox::updateFormatList()
59,10 → 59,10
if (currentDoc != nullptr)
{
QStringList st;
addItem( tr("No Style"));
addItem( CommonStrings::trDefaultParagraphStyle );
for (int x = 0; x < currentDoc->paragraphStyles().count(); ++x)
{
if ( !currentDoc->paragraphStyles()[x].name().isEmpty() )
if ( !currentDoc->paragraphStyles()[x].name().isEmpty() && !currentDoc->paragraphStyles()[x].isDefaultStyle())
st.append(currentDoc->paragraphStyles()[x].name());
}
st.sort();
96,7 → 96,7
CharStyleComboBox::CharStyleComboBox(QWidget* parent) : QComboBox(parent)
{
setEditable(false);
addItem( tr("No Style"));
addItem( CommonStrings::trDefaultCharacterStyle );
currentDoc = nullptr;
connect(this, SIGNAL(activated(int)), this, SLOT(selFormat(int)));
}
109,7 → 109,7
 
void CharStyleComboBox::setFormat(const QString& name)
{
setCurrentComboItem(this, name.isEmpty() ? tr("No Style") : name);
setCurrentComboItem(this, name.isEmpty() ? CommonStrings::trDefaultCharacterStyle : name);
}
 
void CharStyleComboBox::updateFormatList()
123,10 → 123,11
if (currentDoc != nullptr)
{
QStringList st;
addItem( tr("No Style"));
addItem( CommonStrings::trDefaultCharacterStyle );
for (int x = 0; x < currentDoc->charStyles().count(); ++x)
{
if ( !currentDoc->charStyles()[x].name().isEmpty() )
if ( !currentDoc->charStyles()[x].name().isEmpty() &&
!currentDoc->charStyles()[x].isDefaultStyle())
st.append(currentDoc->charStyles()[x].name());
}
st.sort();
160,7 → 161,7
CellStyleComboBox::CellStyleComboBox(QWidget* parent) : QComboBox(parent)
{
setEditable(false);
addItem( tr("No Style"));
addItem( CommonStrings::trDefaultCellStyle );
currentDoc = nullptr;
connect(this, SIGNAL(activated(int)), this, SLOT(selFormat(int)));
}
173,7 → 174,7
 
void CellStyleComboBox::setFormat(const QString& name)
{
setCurrentComboItem(this, name.isEmpty() ? tr("No Style") : name);
setCurrentComboItem(this, name.isEmpty() ? CommonStrings::trDefaultCellStyle : name);
}
 
void CellStyleComboBox::updateFormatList()
187,10 → 188,11
if (currentDoc != nullptr)
{
QStringList st;
addItem( tr("No Style"));
addItem( CommonStrings::trDefaultCellStyle );
for (int x = 0; x < currentDoc->cellStyles().count(); ++x)
{
if ( !currentDoc->cellStyles()[x].name().isEmpty() )
if ( !currentDoc->cellStyles()[x].name().isEmpty() &&
!currentDoc->cellStyles()[x].isDefaultStyle())
st.append(currentDoc->cellStyles()[x].name());
}
st.sort();
225,7 → 227,7
TableStyleComboBox::TableStyleComboBox(QWidget* parent) : QComboBox(parent)
{
setEditable(false);
addItem( tr("No Style"));
addItem( CommonStrings::trDefaultTableStyle );
currentDoc = nullptr;
connect(this, SIGNAL(activated(int)), this, SLOT(selFormat(int)));
}
238,7 → 240,7
 
void TableStyleComboBox::setFormat(const QString& name)
{
setCurrentComboItem(this, name.isEmpty() ? tr("No Style") : name);
setCurrentComboItem(this, name.isEmpty() ? CommonStrings::trDefaultTableStyle : name);
}
 
void TableStyleComboBox::updateFormatList()
252,10 → 254,11
if (currentDoc != nullptr)
{
QStringList st;
addItem( tr("No Style"));
addItem( CommonStrings::trDefaultTableStyle );
for (int x = 0; x < currentDoc->tableStyles().count(); ++x)
{
if ( !currentDoc->tableStyles()[x].name().isEmpty() )
if ( !currentDoc->tableStyles()[x].name().isEmpty() &&
!currentDoc->tableStyles()[x].isDefaultStyle())
st.append(currentDoc->tableStyles()[x].name());
}
st.sort();