[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-commits
Subject: koffice/filters
From: Lassi Taneli Nieminen <lassniem () gmail ! com>
Date: 2010-11-16 11:05:28
Message-ID: 20101116110528.73905AC8A0 () svn ! kde ! org
[Download RAW message or body]
SVN commit 1197656 by lassin:
Fixed docx filter to support colored bullets (note that kword does not support them \
yet).
M +24 -3 kword/docx/DocxXmlNumberingReader.cpp
M +2 -2 kword/docx/DocxXmlNumberingReader.h
M +1 -1 libmsooxml/MsooXmlCommonReaderDrawingMLImpl.h
M +8 -3 libmsooxml/MsooXmlUtils.cpp
M +3 -1 libmsooxml/MsooXmlUtils.h
--- trunk/koffice/filters/kword/docx/DocxXmlNumberingReader.cpp #1197655:1197656
@@ -158,7 +158,6 @@
}
m_bulletCharacter = QString();
- m_bulletFont = QString();
m_bulletStyle = false;
bool pictureType = false;
@@ -317,7 +316,7 @@
TRY_READ_ATTR(val)
if (!val.isEmpty()) {
- m_currentBulletProperties.m_startValue = val.toInt();
+ m_currentBulletProperties.setStartValue(val);
}
readNext();
@@ -410,8 +409,11 @@
if (qualifiedName() == QLatin1String("w:rFonts")) {
TRY_READ(rFonts_numbering)
}
+ else if (qualifiedName() == QLatin1String("w:color")) {
+ TRY_READ(color_numbering)
}
}
+ }
READ_EPILOGUE
}
@@ -546,6 +548,25 @@
}
#undef CURRENT_EL
+#define CURRENT_EL color
+//! w:color handler (bullet color)
+KoFilter::ConversionStatus DocxXmlNumberingReader::read_color_numbering()
+{
+ READ_PROLOGUE
+ const QXmlStreamAttributes attrs(attributes());
+
+ TRY_READ_ATTR(val)
+
+ if (!val.isEmpty())
+ {
+ m_currentBulletProperties.setBulletColor(QString("#").append(val));
+ }
+
+ readNext();
+ READ_EPILOGUE
+}
+
+#undef CURRENT_EL
#define CURRENT_EL rFonts
//! w:rFonts handler (Run Fonts)
/*!
@@ -564,7 +585,7 @@
TRY_READ_ATTR(ascii)
if (!ascii.isEmpty()) {
- m_bulletFont = ascii;
+ m_currentBulletProperties.setBulletFont(ascii);
}
readNext();
--- trunk/koffice/filters/kword/docx/DocxXmlNumberingReader.h #1197655:1197656
@@ -58,12 +58,13 @@
KoFilter::ConversionStatus read_lvlPicBulletId();
KoFilter::ConversionStatus read_numPicBullet();
- // Note we read pPr here for now because we are only interested in subset of pPr \
features + // Note we read pPr here for now because we are only interested in \
subset of pPr/rPr features // which can be used with lists.
KoFilter::ConversionStatus read_pPr_numbering();
KoFilter::ConversionStatus read_ind_numbering();
KoFilter::ConversionStatus read_rPr_numbering();
KoFilter::ConversionStatus read_rFonts_numbering();
+ KoFilter::ConversionStatus read_color_numbering();
bool m_bulletStyle;
@@ -72,7 +73,6 @@
QMap<QString, QSize> m_picBulletSizes;
QString m_bulletCharacter;
- QString m_bulletFont;
private:
void init();
--- trunk/koffice/filters/libmsooxml/MsooXmlCommonReaderDrawingMLImpl.h \
#1197655:1197656 @@ -4762,7 +4762,7 @@
TRY_READ_ATTR_WITHOUT_NS(startAt)
if (!startAt.isEmpty()) {
- m_currentBulletProperties.m_startValue = startAt.toInt();
+ m_currentBulletProperties.setStartValue(startAt);
}
m_listStylePropertiesAltered = true;
--- trunk/koffice/filters/libmsooxml/MsooXmlUtils.cpp #1197655:1197656
@@ -1308,7 +1308,7 @@
// </units> -------------------
MSOOXML_EXPORT Utils::ParagraphBulletProperties::ParagraphBulletProperties() :
- m_startValue(0), m_type(ParagraphBulletProperties::DefaultType), \
m_bulletFont(UNUSED), + m_type(ParagraphBulletProperties::DefaultType), \
m_startValue(UNUSED), m_bulletFont(UNUSED),
m_bulletChar(UNUSED), m_numFormat(UNUSED), m_suffix(UNUSED), m_align(UNUSED),
m_indent(UNUSED), m_picturePath(UNUSED), m_bulletColor(UNUSED), \
m_bulletRelativeSize(UNUSED) {
@@ -1324,7 +1324,7 @@
MSOOXML_EXPORT void Utils::ParagraphBulletProperties::clear()
{
- m_startValue = 0;
+ m_startValue = UNUSED;
m_type = ParagraphBulletProperties::DefaultType;
m_bulletFont = UNUSED;
m_bulletChar = UNUSED;
@@ -1353,6 +1353,11 @@
m_type = ParagraphBulletProperties::BulletType;
}
+MSOOXML_EXPORT void Utils::ParagraphBulletProperties::setStartValue(const QString& \
value) +{
+ m_startValue = value;
+}
+
MSOOXML_EXPORT void Utils::ParagraphBulletProperties::setIndent(const qreal indent)
{
m_indent = QString("%1").arg(indent);
@@ -1453,7 +1458,7 @@
if (m_type == ParagraphBulletProperties::NumberType) {
returnValue = QString("<text:list-level-style-number text:level=\"%1\" \
").arg(m_level);
returnValue += QString("style:num-suffix=\"%1\" style:num-format=\"%2\" \
").arg(m_suffix).arg(m_numFormat);
- if (m_startValue != 0) {
+ if (m_startValue != UNUSED) {
returnValue += QString("text:start-value=\"%1\" ").arg(m_startValue);
}
ending = "</text:list-level-style-number>";
--- trunk/koffice/filters/libmsooxml/MsooXmlUtils.h #1197655:1197656
@@ -108,13 +108,15 @@
QString bulletRelativeSize() const;
+ void setStartValue(const QString& value);
+
int m_level;
- int m_startValue;
private:
enum ParagraphBulletType {BulletType, NumberType, PictureType, DefaultType};
ParagraphBulletType m_type;
+ QString m_startValue;
QString m_bulletFont;
QString m_bulletChar;
QString m_numFormat;
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic