Subversion Repositories Scribus

Compare Revisions

Ignore whitespace Rev 438 → Rev 439

/trunk/Scribus/scribus/plugins/gettext/sxwim/stylereader.cpp
72,7 → 72,8
inList = true;
}
else if (((name == "text:list-level-style-bullet") ||
(name == "text:list-level-style-number")) && (inList))
(name == "text:list-level-style-number") ||
(name == "text:list-level-style-image")) && (inList))
{
QString level = "";
for (int i = 0; i < attrs.count(); ++i)
398,7 → 399,8
}
else if (((name == "style:style") ||
(name == "text:list-level-style-bullet") ||
(name == "text:list-level-style-number")) && (currentStyle != NULL))
(name == "text:list-level-style-number") ||
(name == "text:list-level-style-image")) && (currentStyle != NULL))
{
setStyle(currentStyle->getName(), currentStyle);
currentStyle = NULL;
429,7 → 431,8
return tmp;
}
else
return styles["default-style"];
return styles["default-style"];
 
}
void StyleReader::setStyle(const QString& name, gtStyle* style)
/trunk/Scribus/scribus/plugins/gettext/sxwim/contentreader.cpp
51,18 → 51,28
if ((name == "text:p") || (name == "text:h"))
{
append = true;
if (!inList)
QString name = "";
for (int i = 0; i < attrs.count(); ++i)
{
for (int i = 0; i < attrs.count(); ++i)
if (attrs.localName(i) == "text:style-name")
{
if (attrs.localName(i) == "text:style-name")
{
pstyle = sreader->getStyle(attrs.value(i));
currentStyle = pstyle;
styleNames.push_back(attrs.value(i));
}
name = attrs.value(i);
styleNames.push_back(attrs.value(i));
}
}
if (!inList)
{
pstyle = sreader->getStyle(name);
currentStyle = pstyle;
}
else
{
gtStyle *tmp = sreader->getStyle(getName());
if ((tmp->getName()).find("default-style") != -1)
getStyle();
else
currentStyle = tmp;
}
}
else if (name == "text:span")
{
95,6 → 105,8
currentList = attrs.value(i);
}
currentStyle = sreader->getStyle(QString(currentList + "_%1").arg(listLevel));
styleNames.clear();
styleNames.push_back(QString(currentList + "_%1").arg(listLevel));
if (name == "text:ordered-list")
{
isOrdered = true;
182,8 → 194,10
{
write("\n");
append = false;
if (styleNames.size() != 0)
if (inList)
styleNames.pop_back();
else
styleNames.clear();
}
else if (name == "text:span")
{
190,7 → 204,7
inSpan = false;
currentStyle = pstyle;
if (styleNames.size() != 0)
styleNames.pop_back();
styleNames.pop_back();
currentStyle = sreader->getStyle(getName());
}
else if (name == "text:line-break")
200,6 → 214,7
else if ((name == "text:unordered-list") || (name == "text:ordered-list"))
{
--listLevel;
styleNames.clear();
if (listLevel == 0)
{
inList = false;
206,7 → 221,10
listIndex2.clear();
}
else
{
currentStyle = sreader->getStyle(QString(currentList + "_%1").arg(listLevel));
styleNames.push_back(QString(currentList + "_%1").arg(listLevel));
}
}
else if ((name == "style:style") && (inT))
{
309,7 → 327,11
 
void ContentReader::getStyle()
{
gtParagraphStyle* par = dynamic_cast<gtParagraphStyle*>(sreader->getStyle(styleNames[0]));
gtParagraphStyle* par = NULL;
if (styleNames.size() == 0)
par = dynamic_cast<gtParagraphStyle*>(sreader->getStyle("default-style"));
else
par = dynamic_cast<gtParagraphStyle*>(sreader->getStyle(styleNames[0]));
gtParagraphStyle* tmp = new gtParagraphStyle(*par);
for (uint i = 1; i < styleNames.size(); ++i)
{
317,8 → 339,6
for (uint j = 0; j < p.size(); ++j)
sreader->updateStyle(tmp, sreader->getStyle(styleNames[i - 1]), p[j].first, p[j].second);
}
// gtParagraphStyle* s = new gtParagraphStyle(*dynamic_cast<gtParagraphStyle*>(lastStyle));
// s->setAutoLineSpacing(true);
 
currentStyle = tmp;
sreader->setStyle(getName(), tmp);