summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCédric Bosdonnat <cedric.bosdonnat@free.fr>2013-02-18 17:34:06 +0100
committerCédric Bosdonnat <cedric.bosdonnat@free.fr>2013-02-18 17:54:44 +0100
commitfbe103ee6ca81fb4e2e8eec3875311d350908722 (patch)
treeb54d107bf5d4ec4591015a52384bb5ab7af16f56
parentc4f266977004abecab5bbcdd257e301bdc618c9c (diff)
n#779642: ignore framePr inside table or the table import won't work
Conflicts: sw/qa/extras/ooxmlimport/ooxmlimport.cxx
-rw-r--r--writerfilter/inc/resourcemodel/TableManager.hxx14
-rw-r--r--writerfilter/source/dmapper/DomainMapper.cxx3
-rw-r--r--writerfilter/source/dmapper/DomainMapper_Impl.cxx4
3 files changed, 18 insertions, 3 deletions
diff --git a/writerfilter/inc/resourcemodel/TableManager.hxx b/writerfilter/inc/resourcemodel/TableManager.hxx
index 72b575a97b5e..1c24be50a583 100644
--- a/writerfilter/inc/resourcemodel/TableManager.hxx
+++ b/writerfilter/inc/resourcemodel/TableManager.hxx
@@ -530,6 +530,11 @@ public:
virtual void endLevel();
/**
+ Tells whether a table has been started or not
+ */
+ bool isInTable();
+
+ /**
Handle the start of a paragraph group.
*/
virtual void startParagraphGroup();
@@ -702,6 +707,15 @@ void TableManager<T, PropertiesPointer>::handle(const T & rHandle)
}
template <typename T, typename PropertiesPointer>
+bool TableManager<T, PropertiesPointer>::isInTable()
+{
+ bool bInTable = false;
+ if ( !mTableDataStack.empty() )
+ bInTable = mTableDataStack.top()->getDepth() > 0;
+ return bInTable;
+}
+
+template <typename T, typename PropertiesPointer>
void TableManager<T, PropertiesPointer>::startLevel()
{
#ifdef DEBUG_TABLE
diff --git a/writerfilter/source/dmapper/DomainMapper.cxx b/writerfilter/source/dmapper/DomainMapper.cxx
index df6317baa4e0..0969f8a46ef9 100644
--- a/writerfilter/source/dmapper/DomainMapper.cxx
+++ b/writerfilter/source/dmapper/DomainMapper.cxx
@@ -2968,7 +2968,7 @@ void DomainMapper::sprmWithProps( Sprm& rSprm, PropertyMapPtr rContext, SprmType
}
break;
case NS_ooxml::LN_CT_PPrBase_framePr:
- // Avoid frames if we're inside a structured document tag, would just cause outher tables fail to create.
+ // Avoid frames if we're inside a structured document tag, would just cause outer tables fail to create.
if (!m_pImpl->GetSdt())
{
PropertyMapPtr pContext = m_pImpl->GetTopContextOfType(CONTEXT_PARAGRAPH);
@@ -2976,7 +2976,6 @@ void DomainMapper::sprmWithProps( Sprm& rSprm, PropertyMapPtr rContext, SprmType
{
ParagraphPropertyMap* pParaContext = dynamic_cast< ParagraphPropertyMap* >( pContext.get() );
pParaContext->SetFrameMode();
-
}
else
{
diff --git a/writerfilter/source/dmapper/DomainMapper_Impl.cxx b/writerfilter/source/dmapper/DomainMapper_Impl.cxx
index 00f5f2f7ea1c..80d128feba06 100644
--- a/writerfilter/source/dmapper/DomainMapper_Impl.cxx
+++ b/writerfilter/source/dmapper/DomainMapper_Impl.cxx
@@ -738,7 +738,9 @@ void DomainMapper_Impl::CheckUnregisteredFrameConversion( )
{
PropertyNameSupplier& rPropNameSupplier = PropertyNameSupplier::GetPropertyNameSupplier();
TextAppendContext& rAppendContext = m_aTextAppendStack.top();
- if( rAppendContext.pLastParagraphProperties.get() && rAppendContext.pLastParagraphProperties->IsFrameMode() )
+ // n#779642: ignore fly frame inside table as it could lead to messy situations
+ if( rAppendContext.pLastParagraphProperties.get() && rAppendContext.pLastParagraphProperties->IsFrameMode()
+ && !getTableManager().isInTable() )
{
try
{