diff options
author | Miklos Vajna <vmiklos@collabora.co.uk> | 2014-06-13 21:19:50 +0200 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.co.uk> | 2014-06-13 21:29:22 +0200 |
commit | 7b0eb08459f95986f2606c8ffd04ccab84d65fa0 (patch) | |
tree | ab2fbf68153e9b75d7373cbad32e790a1acffeb3 /oox | |
parent | cd94a84b89c476760ad74bf088a5d6f8ba4ce209 (diff) |
DOCX import: implement linking for shapes having textboxes
Change-Id: I90deb68ab6a1029cf5df8170676638bf7e3cb469
Diffstat (limited to 'oox')
-rw-r--r-- | oox/source/drawingml/shape.cxx | 16 | ||||
-rw-r--r-- | oox/source/shape/WpsContext.cxx | 1 |
2 files changed, 17 insertions, 0 deletions
diff --git a/oox/source/drawingml/shape.cxx b/oox/source/drawingml/shape.cxx index 6948f46a32f6..815887db35b5 100644 --- a/oox/source/drawingml/shape.cxx +++ b/oox/source/drawingml/shape.cxx @@ -820,6 +820,22 @@ Reference< XShape > Shape::createAndInsert( //aShapeProps.setProperty(PROP_TextBox, uno::makeAny(true)); } + if (aServiceName != "com.sun.star.text.TextFrame" && isLinkedTxbx()) + { + uno::Reference<beans::XPropertySet> propertySet (mxShape, uno::UNO_QUERY); + uno::Sequence<beans::PropertyValue> aGrabBag; + propertySet->getPropertyValue("InteropGrabBag") >>= aGrabBag; + sal_Int32 length = aGrabBag.getLength(); + aGrabBag.realloc( length + 3 ); + aGrabBag[length].Name = "TxbxHasLink"; + aGrabBag[length].Value = uno::makeAny(this->isLinkedTxbx()); + aGrabBag[length + 1 ].Name = "Txbx-Id"; + aGrabBag[length + 1 ].Value = uno::makeAny(this->getLinkedTxbxAttributes().id); + aGrabBag[length + 2 ].Name = "Txbx-Seq"; + aGrabBag[length + 2 ].Value = uno::makeAny(this->getLinkedTxbxAttributes().seq); + propertySet->setPropertyValue("InteropGrabBag",uno::makeAny(aGrabBag)); + } + PropertySet( xSet ).setProperties( aShapeProps ); if (mbLockedCanvas) { diff --git a/oox/source/shape/WpsContext.cxx b/oox/source/shape/WpsContext.cxx index 63a5f7cb2480..c17405ee7048 100644 --- a/oox/source/shape/WpsContext.cxx +++ b/oox/source/shape/WpsContext.cxx @@ -149,6 +149,7 @@ oox::core::ContextHandlerRef WpsContext::onCreateContext(sal_Int32 nElementToken //for further processing. mpShape->getCustomShapeProperties()->setShapeTypeOverride(true); mpShape->setServiceName("com.sun.star.text.TextFrame"); + mpShape->setTextBox(true); OptValue<OUString> id = rAttribs.getString(XML_id); OptValue<OUString> seq = rAttribs.getString(XML_seq); if (id.has() && seq.has()) |