writerperfect/source/filter/OdtGenerator.cxx |   16 +++++++++++++---
 writerperfect/source/filter/TextRunStyle.cxx |    4 ++--
 2 files changed, 15 insertions(+), 5 deletions(-)

New commits:
commit 5f6e5f766252fab44cf0c5ab4b1bca18b884695c
Author: Laurent Alonso <[email protected]>
Date:   Tue Oct 25 22:16:15 2011 +0200

    Fix a typo + don't open a row or cell if no table is started

diff --git a/writerperfect/source/filter/OdtGenerator.cxx 
b/writerperfect/source/filter/OdtGenerator.cxx
index 72f816c..9533803 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 36e16ac..35c6d27 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());
_______________________________________________
Libreoffice-commits mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to