summaryrefslogtreecommitdiff
path: root/writerfilter
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.co.uk>2014-11-28 18:11:23 +0100
committerMiklos Vajna <vmiklos@collabora.co.uk>2014-11-28 18:11:23 +0100
commitc1e1757cdab6e61b94244761227b0a1f112e6b0c (patch)
tree8703023eb62da88ae80abb348ba34eb376f74ec5 /writerfilter
parentb2d3f9b5a12928127b476b10599069efea0ddcde (diff)
DOCX import: ignore <w:tblpPr> in shape text
Floating tables are kind of anchored objects, which are not supported in shape text by Word, so we should ignore their flotation on import as well. Note that there is no need for a setIsInShape(false) in PopShapeContext() as we pop the whole table manager from the stack anyway. Change-Id: Ie9e88d2c83c0c34a01922e6e89f69f6089585b4b
Diffstat (limited to 'writerfilter')
-rw-r--r--writerfilter/source/dmapper/DomainMapperTableManager.cxx9
-rw-r--r--writerfilter/source/dmapper/DomainMapperTableManager.hxx4
-rw-r--r--writerfilter/source/dmapper/DomainMapper_Impl.cxx1
3 files changed, 13 insertions, 1 deletions
diff --git a/writerfilter/source/dmapper/DomainMapperTableManager.cxx b/writerfilter/source/dmapper/DomainMapperTableManager.cxx
index 3a9153c328dd..1085a94d297a 100644
--- a/writerfilter/source/dmapper/DomainMapperTableManager.cxx
+++ b/writerfilter/source/dmapper/DomainMapperTableManager.cxx
@@ -53,6 +53,7 @@ DomainMapperTableManager::DomainMapperTableManager(bool bOOXML) :
m_nHeaderRepeat(0),
m_nTableWidth(0),
m_bOOXML( bOOXML ),
+ m_bIsInShape(false),
m_aTmpPosition(),
m_aTmpTableProperties(),
m_bPushCurrentWidth(false),
@@ -432,7 +433,8 @@ bool DomainMapperTableManager::sprm(Sprm & rSprm)
case NS_ooxml::LN_CT_TblPrBase_tblpPr:
{
writerfilter::Reference<Properties>::Pointer_t pProperties = rSprm.getProps();
- if (pProperties.get())
+ // Ignore <w:tblpPr> in shape text, those tables should be always non-floating ones.
+ if (!m_bIsInShape && pProperties.get())
{
TablePositionHandlerPtr pHandler = m_aTmpPosition.back();
if ( !pHandler )
@@ -512,6 +514,11 @@ TablePositionHandler* DomainMapperTableManager::getCurrentTableRealPosition()
return nullptr;
}
+void DomainMapperTableManager::setIsInShape(bool bIsInShape)
+{
+ m_bIsInShape = bIsInShape;
+}
+
void DomainMapperTableManager::startLevel( )
{
DomainMapperTableManager_Base_t::startLevel( );
diff --git a/writerfilter/source/dmapper/DomainMapperTableManager.hxx b/writerfilter/source/dmapper/DomainMapperTableManager.hxx
index e810a89dffb4..65aecc7a11af 100644
--- a/writerfilter/source/dmapper/DomainMapperTableManager.hxx
+++ b/writerfilter/source/dmapper/DomainMapperTableManager.hxx
@@ -47,6 +47,8 @@ class DomainMapperTableManager : public DomainMapperTableManager_Base_t
sal_Int32 m_nHeaderRepeat; //counter of repeated headers - if == -1 then the repeating stops
sal_Int32 m_nTableWidth; //might be set directly or has to be calculated from the column positions
bool m_bOOXML;
+ /// Are we in a shape (text append stack is not empty) or in the body document?
+ bool m_bIsInShape;
OUString m_sTableStyleName;
/// Grab-bag of table look attributes for preserving.
comphelper::SequenceAsHashMap m_aTableLook;
@@ -161,6 +163,8 @@ public:
return DomainMapperTableManager_Base_t::isInCell();
}
+ void setIsInShape(bool bIsInShape);
+
};
}}
diff --git a/writerfilter/source/dmapper/DomainMapper_Impl.cxx b/writerfilter/source/dmapper/DomainMapper_Impl.cxx
index 462c44940aba..1a1ccdccc55a 100644
--- a/writerfilter/source/dmapper/DomainMapper_Impl.cxx
+++ b/writerfilter/source/dmapper/DomainMapper_Impl.cxx
@@ -1961,6 +1961,7 @@ void DomainMapper_Impl::PushShapeContext( const uno::Reference< drawing::XShape
uno::makeAny( true ) );
}
m_bParaChanged = true;
+ getTableManager().setIsInShape(true);
}
catch ( const uno::Exception& e )
{