[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-commits
Subject: koffice/filters/libmsooxml
From: Lassi Taneli Nieminen <lassniem () gmail ! com>
Date: 2010-09-12 10:53:26
Message-ID: 20100912105326.2EC7BAC887 () svn ! kde ! org
[Download RAW message or body]
SVN commit 1174419 by lassin:
Fixed pptx bug where fld-type fields would not get right text style.
M +97 -22 MsooXmlCommonReaderDrawingMLImpl.h
--- trunk/koffice/filters/libmsooxml/MsooXmlCommonReaderDrawingMLImpl.h \
#1174418:1174419 @@ -1620,11 +1620,6 @@
if (listStyle) {
m_currentTextStyleProperties->copyProperties(listStyle->m_characterStyle);
}
- //m_currentTextStyleProperties->saveOdf(m_currentTextStyle);
-
- //delete m_currentTextStyleProperties;
- //m_currentTextStyleProperties = new KoCharacterStyle();
-
const QString styleId(d->phStyleId());
if (!styleId.isEmpty()) {
MSOOXML::Utils::copyPropertiesFromStyle(m_context->slideLayoutProperties->textStyles[styleId][listLevel],
@@ -1639,21 +1634,20 @@
}
}
else if (m_context->type == SlideLayout) {
+ PptxSlideMasterTextStyle *slideMasterTextStyle = 0;
if ((d->phType).isEmpty()) {
// If layout does not define any type, we assume it needs to use \
bodyStyle
- PptxSlideMasterTextStyle *slideMasterTextStyle = \
m_context->slideMasterPageProperties->textStyle("body"); + \
slideMasterTextStyle = m_context->slideMasterPageProperties->textStyle("body"); + \
} + else {
+ slideMasterTextStyle = \
m_context->slideMasterPageProperties->textStyle(d->phType); + }
const int listLevel = qMax(1, m_currentListLevel); // if \
m_currentListLevel==0 then use level1
PptxSlideMasterListLevelTextStyle *listStyle = \
slideMasterTextStyle->listStyle(listLevel); if (listStyle) {
m_currentTextStyleProperties->copyProperties(listStyle->m_characterStyle);
}
- m_currentTextStyleProperties->saveOdf(m_currentTextStyle);
-
- delete m_currentTextStyleProperties;
- m_currentTextStyleProperties = new KoCharacterStyle();
- m_context->slideLayoutProperties->textStyles[d->phStyleId()][m_currentListLevel] \
= m_currentTextStyle; }
- }
// Styles of texts for slidemaster are read in first round of reading \
slidemasterX.xml
// When we get here, we are in 2nd round, and can actually apply them.
else if (m_context->type == SlideMaster) {
@@ -1663,10 +1657,6 @@
if (listStyle) {
m_currentTextStyleProperties->copyProperties(listStyle->m_characterStyle);
}
- m_currentTextStyleProperties->saveOdf(m_currentTextStyle);
-
- delete m_currentTextStyleProperties;
- m_currentTextStyleProperties = new KoCharacterStyle();
}
#endif
@@ -1685,9 +1675,6 @@
// elements
m_currentTextStyleProperties->saveOdf(m_currentTextStyle);
- delete m_currentTextStyleProperties;
- m_currentTextStyleProperties = 0;
-
body = rBuf.originalWriter();
if (m_hyperLink) {
@@ -1699,9 +1686,27 @@
const QString currentTextStyleName(mainStyles->insert(m_currentTextStyle));
#ifdef PPTXXMLSLIDEREADER_H
+ if (m_context->type == SlideLayout) {
+ if (!(d->phType).isEmpty()) {
+ m_context->slideLayoutProperties->textStyles[d->phType][m_currentListLevel] \
= m_currentTextStyle; + }
+ if (!(d->phIdx).isEmpty()) {
+ m_context->slideLayoutProperties->textStyles[d->phIdx][m_currentListLevel] \
= m_currentTextStyle; + }
+ }
+
if (m_context->type == SlideMaster) {
mainStyles->markStyleForStylesXml(currentTextStyleName);
+ // It is possible, the slideMaster updates the style here
+ PptxSlideMasterTextStyle *slideMasterTextStyle = \
m_context->slideMasterPageProperties->textStyle(d->phType); + const int \
listLevel = qMax(1, m_currentListLevel); // if m_currentListLevel==0 then use level1 \
+ PptxSlideMasterListLevelTextStyle *listStyle = \
slideMasterTextStyle->listStyle(listLevel); + if (listStyle) {
+ delete listStyle->m_characterStyle;
+ listStyle->m_characterStyle = m_currentTextStyleProperties;
+ m_currentTextStyleProperties = 0;
}
+ }
#endif
body->startElement("text:span", false);
@@ -1714,6 +1719,9 @@
body->endElement(); // text:a
}
+ delete m_currentTextStyleProperties;
+ m_currentTextStyleProperties = 0;
+
READ_EPILOGUE
}
@@ -4396,6 +4404,55 @@
MSOOXML::Utils::XmlWriteBuffer fldBuf;
body = fldBuf.setWriter(body);
+#ifdef PPTXXMLSLIDEREADER_H
+ // We must apply properties outside rpr, since it is possible that we do not \
enter rpr at all + if (m_context->type == Slide) {
+ // pass properties from master to slide
+ PptxSlideMasterTextStyle *slideMasterTextStyle = \
m_context->slideMasterPageProperties->textStyle(d->phType); + const int \
listLevel = qMax(1, m_currentListLevel); // if m_currentListLevel==0 then use level1 \
+ PptxSlideMasterListLevelTextStyle *listStyle = \
slideMasterTextStyle->listStyle(listLevel); + if (listStyle) {
+ m_currentTextStyleProperties->copyProperties(listStyle->m_characterStyle);
+ }
+ const QString styleId(d->phStyleId());
+ if (!styleId.isEmpty()) {
+ MSOOXML::Utils::copyPropertiesFromStyle(m_context->slideLayoutProperties->textStyles[styleId][listLevel],
+ m_currentTextStyle, \
KoGenStyle::TextType); + }
+ else { // Case that there's no style, we apply "other", maybe should read \
default and apply that? + slideMasterTextStyle = \
m_context->slideMasterPageProperties->textStyle("other"); + listStyle = \
slideMasterTextStyle->listStyle(listLevel); + if (listStyle) {
+ m_currentTextStyleProperties->copyProperties(listStyle->m_characterStyle);
+ }
+ }
+ }
+ else if (m_context->type == SlideLayout) {
+ PptxSlideMasterTextStyle *slideMasterTextStyle = 0;
+ if ((d->phType).isEmpty()) {
+ // If layout does not define any type, we assume it needs to use \
bodyStyle + slideMasterTextStyle = \
m_context->slideMasterPageProperties->textStyle("body"); + }
+ else {
+ slideMasterTextStyle = \
m_context->slideMasterPageProperties->textStyle(d->phType); + }
+ const int listLevel = qMax(1, m_currentListLevel); // if \
m_currentListLevel==0 then use level1 + PptxSlideMasterListLevelTextStyle \
*listStyle = slideMasterTextStyle->listStyle(listLevel); + if (listStyle) {
+ m_currentTextStyleProperties->copyProperties(listStyle->m_characterStyle);
+ }
+ }
+ // Styles of texts for slidemaster are read in first round of reading \
slidemasterX.xml + // When we get here, we are in 2nd round, and can actually \
apply them. + else if (m_context->type == SlideMaster) {
+ PptxSlideMasterTextStyle *slideMasterTextStyle = \
m_context->slideMasterPageProperties->textStyle(d->phType); + const int \
listLevel = qMax(1, m_currentListLevel); // if m_currentListLevel==0 then use level1 \
+ PptxSlideMasterListLevelTextStyle *listStyle = \
slideMasterTextStyle->listStyle(listLevel); + if (listStyle) {
+ m_currentTextStyleProperties->copyProperties(listStyle->m_characterStyle);
+ }
+ }
+#endif
while (!atEnd()) {
readNext();
@@ -4413,15 +4470,30 @@
m_currentTextStyleProperties->saveOdf(m_currentTextStyle);
- delete m_currentTextStyleProperties;
- m_currentTextStyleProperties = 0;
-
const QString currentTextStyleName(mainStyles->insert(m_currentTextStyle));
#ifdef PPTXXMLSLIDEREADER_H
+ if (m_context->type == SlideLayout) {
+ if (!(d->phType).isEmpty()) {
+ m_context->slideLayoutProperties->textStyles[d->phType][m_currentListLevel] \
= m_currentTextStyle; + }
+ if (!(d->phIdx).isEmpty()) {
+ m_context->slideLayoutProperties->textStyles[d->phIdx][m_currentListLevel] \
= m_currentTextStyle; + }
+ }
+
if (m_context->type == SlideMaster) {
mainStyles->markStyleForStylesXml(currentTextStyleName);
+ // It is possible, the slideMaster updates the style here
+ PptxSlideMasterTextStyle *slideMasterTextStyle = \
m_context->slideMasterPageProperties->textStyle(d->phType); + const int \
listLevel = qMax(1, m_currentListLevel); // if m_currentListLevel==0 then use level1 \
+ PptxSlideMasterListLevelTextStyle *listStyle = \
slideMasterTextStyle->listStyle(listLevel); + if (listStyle) {
+ delete listStyle->m_characterStyle;
+ listStyle->m_characterStyle = m_currentTextStyleProperties;
+ m_currentTextStyleProperties = 0;
}
+ }
#endif
body = fldBuf.originalWriter();
@@ -4433,6 +4505,9 @@
body->endElement(); //text:span
+ delete m_currentTextStyleProperties;
+ m_currentTextStyleProperties = 0;
+
READ_EPILOGUE
}
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic