SVN commit 1203640 by clicea: Read the fill whenever we're reading a style. M +6 -5 kpresenter/pptx/PptxXmlDocumentReader.cpp M +30 -2 libmsooxml/MsooXmlDrawingTableStyleReader.cpp M +1 -0 libmsooxml/MsooXmlDrawingTableStyleReader.h --- branches/work/koffice-essen/filters/kpresenter/pptx/PptxXmlDocumentReader.cpp #1203639:1203640 @@ -294,6 +294,9 @@ const QString slideMasterPathAndFile = m_context->relationships->targetForType(slideMasterPath, slideMasterFile, QLatin1String(MSOOXML::Schemas::officeDocument::relationships) + "/slideMaster"); PptxSlideProperties *masterSlideProperties = d->masterSlidePropertiesMap.contains(slideMasterPathAndFile) ? d->masterSlidePropertiesMap[slideMasterPathAndFile] : 0; + // Delay the reding of a tableStyle until we find a table as we need the clrMap from the master slide + const QString tableStylesFilePath = m_context->relationships->targetForType(m_context->path, m_context->file, MSOOXML::Relationships::tableStyles); + PptxXmlSlideReaderContext context( *m_context->import, slidePath, slideFile, @@ -306,7 +309,8 @@ *m_context->relationships, d->commentAuthors, d->slideMasterPageProperties[slideLayoutProperties->m_slideMasterName].colorMap, - vmlreader.content() + vmlreader.content(), + tableStylesFilePath ); // In first round we only read possible colorMap override @@ -427,9 +431,6 @@ KoFilter::ConversionStatus status = m_context->import->loadAndParseDocument(&themesReader, slideThemePathAndFile, errorMessage, &themecontext); - // Delay the reding of a tableStyle until we find a table as we need the clrMap from the master slide - const QString tableStylesFilePath = m_context->relationships->targetForType(m_context->path, m_context->file, MSOOXML::Relationships::tableStyles); - //empty map used here as slideMaster is the place where the map is created QMap dummyMap; QMap dummyOles; @@ -448,7 +449,7 @@ d->commentAuthors, dummyMap, dummyOles, - tableStylesFilePath + QString() ); PptxXmlSlideReader slideMasterReader(this); --- branches/work/koffice-essen/filters/libmsooxml/MsooXmlDrawingTableStyleReader.cpp #1203639:1203640 @@ -169,9 +169,9 @@ BREAK_IF_END_OF(CURRENT_EL); if(isStartElement()) { // TRY_READ_IF(cell3D) -// ELSE_TRY_READ_IF(fill) + /*ELSE_*/TRY_READ_IF(fill) // ELSE_TRY_READ_IF(fillRef) - /*ELSE_*/TRY_READ_IF(tcBdr) + ELSE_TRY_READ_IF(tcBdr) // ELSE_WRONG_FORMAT } } @@ -458,6 +458,34 @@ READ_EPILOGUE } +#undef CURRENT_EL +#define CURRENT_EL fill +KoFilter::ConversionStatus MsooXmlDrawingTableStyleReader::read_fill() +{ + READ_PROLOGUE + Q_ASSERT(false); + while(!atEnd()) { + readNext(); + BREAK_IF_END_OF(CURRENT_EL); + if(isStartElement()) { +// TRY_READ_IF(blipFill) +// ELSE_TRY_READ_IF(grandFill) +// ELSE_TRY_READ_IF(grpFill) + /*else */if(QUALIFIED_NAME_IS(noFill)) { + SKIP_EVERYTHING_AND_RETURN + } +// ELSE_TRY_READ_IF(pattFill) + else if(QUALIFIED_NAME_IS(solidFill)) { + TRY_READ(solidFill) + m_currentTableStyleProperties->backgroundColor = m_currentColor; + } +// ELSE_WRONG_FORMAT + } + } + + READ_EPILOGUE +} + #define blipFill_NS "a" #define SETUP_PARA_STYLE_IN_READ_P --- branches/work/koffice-essen/filters/libmsooxml/MsooXmlDrawingTableStyleReader.h #1203639:1203640 @@ -77,6 +77,7 @@ KoFilter::ConversionStatus read_tr2bl(); KoFilter::ConversionStatus read_tcBdr(); KoFilter::ConversionStatus read_Table_ln(); + KoFilter::ConversionStatus read_fill(); //get read_ln and friends, it's a shame I have to get a lot of crap alongside #include