diff options
author | Laurent Alonso <alonso@loria.fr> | 2011-10-25 22:16:15 +0200 |
---|---|---|
committer | Fridrich Štrba <fridrich.strba@bluewin.ch> | 2011-10-25 22:17:00 +0200 |
commit | 5f6e5f766252fab44cf0c5ab4b1bca18b884695c (patch) | |
tree | 7e5a9b9b8ad4af13b605ed98ef0b1bb615c580d5 /writerperfect | |
parent | 8e2170523c4214149ac79783ebffd745c506d511 (diff) |
Fix a typo + don't open a row or cell if no table is started
Diffstat (limited to 'writerperfect')
-rw-r--r-- | writerperfect/source/filter/OdtGenerator.cxx | 16 | ||||
-rw-r--r-- | writerperfect/source/filter/TextRunStyle.cxx | 4 |
2 files changed, 15 insertions, 5 deletions
diff --git a/writerperfect/source/filter/OdtGenerator.cxx b/writerperfect/source/filter/OdtGenerator.cxx index 72f816c2bd45..95338036e225 100644 --- a/writerperfect/source/filter/OdtGenerator.cxx +++ b/writerperfect/source/filter/OdtGenerator.cxx @@ -966,6 +966,11 @@ void OdtGenerator::openTable(const WPXPropertyList &propList, const WPXPropertyL void OdtGenerator::openTableRow(const WPXPropertyList &propList) { + if (!mpImpl->mpCurrentTableStyle) + { + WRITER_DEBUG_MSG(("OdtGenerator::openTableRow called with no table\n")); + return; + } if (!mpImpl->mWriterDocumentStates.top().mbInNote) { if (propList["libwpd:is-header-row"] && (propList["libwpd:is-header-row"]->getInt())) @@ -987,7 +992,7 @@ void OdtGenerator::openTableRow(const WPXPropertyList &propList) void OdtGenerator::closeTableRow() { - if (!mpImpl->mWriterDocumentStates.top().mbInNote) + if (!mpImpl->mWriterDocumentStates.top().mbInNote && mpImpl->mpCurrentTableStyle) { mpImpl->mpCurrentContentElements->push_back(new TagCloseElement("table:table-row")); if (mpImpl->mWriterDocumentStates.top().mbHeaderRow) @@ -1000,6 +1005,11 @@ void OdtGenerator::closeTableRow() void OdtGenerator::openTableCell(const WPXPropertyList &propList) { + if (!mpImpl->mpCurrentTableStyle) + { + WRITER_DEBUG_MSG(("OdtGenerator::openTableCell called with no table\n")); + return; + } if (!mpImpl->mWriterDocumentStates.top().mbInNote) { WPXString sTableCellStyleName; @@ -1024,7 +1034,7 @@ void OdtGenerator::openTableCell(const WPXPropertyList &propList) void OdtGenerator::closeTableCell() { - if (!mpImpl->mWriterDocumentStates.top().mbInNote) + if (!mpImpl->mWriterDocumentStates.top().mbInNote && mpImpl->mpCurrentTableStyle) { mpImpl->mpCurrentContentElements->push_back(new TagCloseElement("table:table-cell")); mpImpl->mWriterDocumentStates.top().mbTableCellOpened = false; @@ -1033,7 +1043,7 @@ void OdtGenerator::closeTableCell() void OdtGenerator::insertCoveredTableCell(const WPXPropertyList &) { - if (!mpImpl->mWriterDocumentStates.top().mbInNote) + if (!mpImpl->mWriterDocumentStates.top().mbInNote && mpImpl->mpCurrentTableStyle) { mpImpl->mpCurrentContentElements->push_back(new TagOpenElement("table:covered-table-cell")); mpImpl->mpCurrentContentElements->push_back(new TagCloseElement("table:covered-table-cell")); diff --git a/writerperfect/source/filter/TextRunStyle.cxx b/writerperfect/source/filter/TextRunStyle.cxx index 36e16ace4ce8..35c6d274d135 100644 --- a/writerperfect/source/filter/TextRunStyle.cxx +++ b/writerperfect/source/filter/TextRunStyle.cxx @@ -222,7 +222,7 @@ WPXString ParagraphStyleManager::findOrAdd (const WPXPropertyList &propList, con return iter->second->getName(); // ok create a new list - WRITER_DEBUG_MSG(("ParagraphStyleManager::findOrAdd: Paragraph Hash Key: %s\n", hasKey.cstr())); + WRITER_DEBUG_MSG(("ParagraphStyleManager::findOrAdd: Paragraph Hash Key: %s\n", hashKey.cstr())); WPXString sName; sName.sprintf("S%i", mHash.size()); @@ -254,7 +254,7 @@ WPXString SpanStyleManager::findOrAdd(const WPXPropertyList &propList) return iter->second->getName(); // ok create a new list - WRITER_DEBUG_MSG(("SpanStyleManager::findOrAdd: Span Hash Key: %s\n", hasKey.cstr())); + WRITER_DEBUG_MSG(("SpanStyleManager::findOrAdd: Span Hash Key: %s\n", hashKey.cstr())); WPXString sName; sName.sprintf("Span%i", mHash.size()); |