summaryrefslogtreecommitdiff
path: root/writerfilter
diff options
context:
space:
mode:
authorLuboš Luňák <l.lunak@collabora.com>2014-09-21 17:52:58 +0200
committerAndras Timar <andras.timar@collabora.com>2014-09-25 11:55:51 +0200
commitef0f5acbf2bb177526ff54e7b7cd09228fd7099d (patch)
tree2b5d6c0265bdd9b4792adc1cf532e2b2c5ed951e /writerfilter
parent801bd49a4c394bd0f7bc9cc05ffa95b38ce17a60 (diff)
handle docx's w:anchor layoutInCell attribute (bnc#891663)
(cherry picked from commit 3891ba42a886fa85eb43da24d1badf44e765d54c) Conflicts: sw/qa/extras/ooxmlimport/ooxmlimport.cxx writerfilter/source/dmapper/PropertyIds.cxx writerfilter/source/dmapper/PropertyIds.hxx Change-Id: I8268567b84aa0f6e42624bfd0f79c8c49c153edd Reviewed-on: https://gerrit.libreoffice.org/11569 Reviewed-by: Andras Timar <andras.timar@collabora.com> Tested-by: Andras Timar <andras.timar@collabora.com>
Diffstat (limited to 'writerfilter')
-rw-r--r--writerfilter/source/dmapper/GraphicImport.cxx8
-rw-r--r--writerfilter/source/dmapper/PropertyIds.cxx1
-rw-r--r--writerfilter/source/dmapper/PropertyIds.hxx1
3 files changed, 10 insertions, 0 deletions
diff --git a/writerfilter/source/dmapper/GraphicImport.cxx b/writerfilter/source/dmapper/GraphicImport.cxx
index 607d92b7c535..9cda86a4daad 100644
--- a/writerfilter/source/dmapper/GraphicImport.cxx
+++ b/writerfilter/source/dmapper/GraphicImport.cxx
@@ -210,6 +210,7 @@ public:
sal_Int16 nVertOrient;
sal_Int16 nVertRelation;
sal_Int32 nWrap;
+ bool bLayoutInCell;
bool bOpaque;
bool bContour;
bool bContourOutside;
@@ -282,6 +283,7 @@ public:
,nVertOrient( text::VertOrientation::NONE )
,nVertRelation( text::RelOrientation::FRAME )
,nWrap(0)
+ ,bLayoutInCell(false)
,bOpaque( true )
,bContour(false)
,bContourOutside(true)
@@ -855,7 +857,10 @@ void GraphicImport::lcl_attribute(Id nName, Value & val)
m_pImpl->bOpaque = false;
break;
case NS_ooxml::LN_CT_Anchor_locked: // 90990; - ignored
+ break;
case NS_ooxml::LN_CT_Anchor_layoutInCell: // 90991; - ignored
+ m_pImpl->bLayoutInCell = nIntValue != 0;
+ break;
case NS_ooxml::LN_CT_Anchor_hidden: // 90992; - ignored
break;
case NS_ooxml::LN_CT_Anchor_allowOverlap: // 90993;
@@ -1508,6 +1513,9 @@ uno::Reference< text::XTextContent > GraphicImport::createGraphicObject( const b
}
xGraphicObjectProperties->setPropertyValue(rPropNameSupplier.GetName( PROP_SURROUND ),
uno::makeAny(m_pImpl->nWrap));
+ if( m_pImpl->bLayoutInCell && m_pImpl->nWrap != text::WrapTextMode_THROUGHT )
+ xGraphicObjectProperties->setPropertyValue(rPropNameSupplier.GetName( PROP_FOLLOW_TEXT_FLOW ),
+ uno::makeAny(true));
xGraphicObjectProperties->setPropertyValue(rPropNameSupplier.GetName( PROP_SURROUND_CONTOUR ),
uno::makeAny(m_pImpl->bContour));
diff --git a/writerfilter/source/dmapper/PropertyIds.cxx b/writerfilter/source/dmapper/PropertyIds.cxx
index d693ddbe475d..14dbc25f44ab 100644
--- a/writerfilter/source/dmapper/PropertyIds.cxx
+++ b/writerfilter/source/dmapper/PropertyIds.cxx
@@ -347,6 +347,7 @@ const OUString& PropertyNameSupplier::GetName( PropertyIds eId ) const
case PROP_HORIZONTAL_MERGE: sName = "HorizontalMerge"; break;
case PROP_APPLY_PARAGRAPH_MARK_FORMAT_TO_NUMBERING : sName = "ApplyParagraphMarkFormatToNumbering"; break;
case PROP_CELL_DIRECTION: sName = "CellDirection"; break;
+ case PROP_FOLLOW_TEXT_FLOW: sName = "IsFollowingTextFlow"; break;
}
::std::pair<PropertyNameMap_t::iterator,bool> aInsertIt =
m_pImpl->aNameMap.insert( PropertyNameMap_t::value_type( eId, sName ));
diff --git a/writerfilter/source/dmapper/PropertyIds.hxx b/writerfilter/source/dmapper/PropertyIds.hxx
index 1f6317985588..3c03ed3fe1b9 100644
--- a/writerfilter/source/dmapper/PropertyIds.hxx
+++ b/writerfilter/source/dmapper/PropertyIds.hxx
@@ -318,6 +318,7 @@ enum PropertyIds
,PROP_HORIZONTAL_MERGE
,PROP_APPLY_PARAGRAPH_MARK_FORMAT_TO_NUMBERING
,PROP_CELL_DIRECTION
+ ,PROP_FOLLOW_TEXT_FLOW
};
struct PropertyNameSupplier_Impl;
class PropertyNameSupplier