[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-10-18 13:52:25
Message-ID: 20101018135225.59848AC896 () svn ! kde ! org
[Download RAW message or body]
SVN commit 1187164 by lassin:
Fixed pptx cases where partial list override would override list for everything in \
the frame.
M +1 -0 kpresenter/pptx/PptxXmlSlideReader.cpp
M +11 -25 libmsooxml/MsooXmlCommonReaderDrawingMLImpl.h
M +1 -1 libmsooxml/MsooXmlCommonReaderDrawingMLMethods.h
M +15 -0 libmsooxml/MsooXmlUtils.cpp
M +7 -0 libmsooxml/MsooXmlUtils.h
--- trunk/koffice/filters/kpresenter/pptx/PptxXmlSlideReader.cpp #1187163:1187164
@@ -1259,6 +1259,7 @@
m_prevListLevel = 0;
m_currentListLevel = 0;
m_pPr_lvl = 0;
+ m_previousListWasAltered = false;
MSOOXML::Utils::XmlWriteBuffer listBuf;
body = listBuf.setWriter(body);
--- trunk/koffice/filters/libmsooxml/MsooXmlCommonReaderDrawingMLImpl.h \
#1187163:1187164 @@ -1573,7 +1573,6 @@
{
READ_PROLOGUE2(DrawingML_p)
- const read_p_args args = m_read_DrawingML_p_args;
m_read_DrawingML_p_args = 0;
m_paragraphStyleNameWritten = false;
m_listStylePropertiesAltered = false;
@@ -1601,12 +1600,8 @@
MSOOXML::Utils::XmlWriteBuffer textPBuf;
- if (args & read_p_Skip) {
- kDebug() << "SKIP!";
- } else {
body = textPBuf.setWriter(body);
m_currentParagraphStyle = KoGenStyle(KoGenStyle::ParagraphAutoStyle, \
"paragraph");
- }
bool pprRead = false;
bool rRead = false;
@@ -1616,13 +1611,8 @@
kDebug() << "isStartElement:" << isStartElement();
BREAK_IF_END_OF(CURRENT_EL);
if (isStartElement()) {
- if (QUALIFIED_NAME_IS(p)) {
-// CASE #301: avoid nested paragaraphs
- kDebug() << "Nested" << qualifiedName() << "detected: skipping the \
inner element";
- TRY_READ_WITH_ARGS(DrawingML_p, read_p_Skip;)
- }
// CASE #400.1
- else if (QUALIFIED_NAME_IS(pPr)) {
+ if (QUALIFIED_NAME_IS(pPr)) {
TRY_READ(DrawingML_pPr)
pprRead = true;
}
@@ -1657,11 +1647,8 @@
}
#endif
- if (args & read_p_Skip) {
- //nothing
- } else {
body = textPBuf.originalWriter();
- if (m_listStylePropertiesAltered) {
+ if (m_listStylePropertiesAltered || m_previousListWasAltered) {
if (m_prevListLevel > 0) {
// Ending our current level
body->endElement(); // text:list
@@ -1672,8 +1659,13 @@
}
m_prevListLevel = 0;
}
+ m_previousListWasAltered = false;
}
+ if (m_listStylePropertiesAltered) {
+ m_previousListWasAltered = true;
+ }
+
if (!rRead) {
// Making sure that if we were previously in a list and if there's an \
empty line, that // we don't output a bullet to it
@@ -1746,10 +1738,9 @@
if (m_currentListLevel > 0) {
body->endElement(); // text:list-item
}
-#endif
-#ifdef PPTXXMLSLIDEREADER_H
m_prevListLevel = m_currentListLevel;
+
#else
// For !=powerpoint we create a new list for each paragraph rather then \
nesting the lists cause the word
// and excel filters still need to be adjusted to proper handle nested \
lists. @@ -1764,7 +1755,6 @@
m_prevListLevel = m_currentListLevel;
}
#endif
- }
READ_EPILOGUE
}
@@ -2140,8 +2130,6 @@
m_currentParagraphStyle.addPropertyPt("style:tab-stop-distance", tabSize);
}
- m_bulletFont = "";
-
while (!atEnd()) {
readNext();
BREAK_IF_END_OF(CURRENT_EL);
@@ -2166,7 +2154,7 @@
}
}
- if (m_bulletFont == "Wingdings") {
+ if (m_currentBulletProperties.bulletFont() == "Wingdings" && \
m_currentBulletProperties.bulletChar() != "") {
// Ooxml files have very often wingdings fonts, but usually they are not \
installed // Making the bullet character look ugly, thus defaulting to "-"
m_listStylePropertiesAltered = true;
@@ -4229,8 +4217,6 @@
m_currentTextStyle = KoGenStyle(KoGenStyle::TextAutoStyle, "text");
- m_bulletFont = "";
-
while (!atEnd()) {
readNext();
kDebug() << *this;
@@ -4260,7 +4246,7 @@
}
}
- if (m_bulletFont == "Wingdings") {
+ if (m_currentBulletProperties.bulletFont() == "Wingdings" && \
m_currentBulletProperties.bulletChar() != "") {
// Ooxml files have very often wingdings fonts, but usually they are not \
installed // Making the bullet character look ugly, thus defaulting to "-"
m_currentBulletProperties.setBulletChar("-");
@@ -4505,7 +4491,7 @@
TRY_READ_ATTR_WITHOUT_NS(typeface)
if (!typeface.isEmpty()) {
- m_bulletFont = typeface;
+ m_currentBulletProperties.setBulletFont(attrs.value("typeface").toString());
}
readNext();
--- trunk/koffice/filters/libmsooxml/MsooXmlCommonReaderDrawingMLMethods.h \
#1187163:1187164 @@ -148,11 +148,11 @@
QString m_shapeTextRightOff;
bool m_listStylePropertiesAltered;
+bool m_previousListWasAltered;
KoFilter::ConversionStatus read_buChar();
KoFilter::ConversionStatus read_buBlip();
KoFilter::ConversionStatus read_buNone();
-QString m_bulletFont; // set by buFont;
KoFilter::ConversionStatus read_buFont();
KoFilter::ConversionStatus read_buAutoNum();
KoFilter::ConversionStatus lvlHelper(const QString& level);
--- trunk/koffice/filters/libmsooxml/MsooXmlUtils.cpp #1187163:1187164
@@ -1364,6 +1364,21 @@
m_pictureSize = size;
}
+MSOOXML_EXPORT void Utils::ParagraphBulletProperties::setBulletFont(const QString& \
font) +{
+ m_bulletFont = font;
+}
+
+MSOOXML_EXPORT QString Utils::ParagraphBulletProperties::bulletChar() const
+{
+ return m_bulletChar;
+}
+
+MSOOXML_EXPORT QString Utils::ParagraphBulletProperties::bulletFont() const
+{
+ return m_bulletFont;
+}
+
MSOOXML_EXPORT QString Utils::ParagraphBulletProperties::convertToListProperties() \
const {
QString returnValue;
--- trunk/koffice/filters/libmsooxml/MsooXmlUtils.h #1187163:1187164
@@ -89,6 +89,12 @@
void setPictureSize(const QSize& size);
+ void setBulletFont(const QString& font);
+
+ QString bulletChar() const;
+
+ QString bulletFont() const;
+
int m_level;
int m_startValue;
@@ -96,6 +102,7 @@
enum ParagraphBulletType {BulletType, NumberType, PictureType};
ParagraphBulletType m_type;
+ QString m_bulletFont;
QString m_bulletChar;
QString m_numFormat;
QString m_suffix;
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic