diff options
-rw-r--r-- | oox/source/drawingml/shape.cxx | 16 | ||||
-rw-r--r-- | oox/source/shape/WpsContext.cxx | 1 | ||||
-rw-r--r-- | writerfilter/source/dmapper/DomainMapper_Impl.cxx | 34 |
3 files changed, 47 insertions, 4 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()) diff --git a/writerfilter/source/dmapper/DomainMapper_Impl.cxx b/writerfilter/source/dmapper/DomainMapper_Impl.cxx index 7748a332085a..b4b4dde014d1 100644 --- a/writerfilter/source/dmapper/DomainMapper_Impl.cxx +++ b/writerfilter/source/dmapper/DomainMapper_Impl.cxx @@ -1881,6 +1881,14 @@ void DomainMapper_Impl::PushShapeContext( const uno::Reference< drawing::XShape xShapePropertySet->setPropertyValue(rPropNameSupplier.GetName( PROP_OPAQUE ), uno::makeAny( false ) ); checkZOredrStatus = true; } + else if ( aGrabBag[i].Name == "TxbxHasLink" ) + { + //Chaining of textboxes will happen in ~DomainMapper_Impl + //i.e when all the textboxes are read and all its attributes + //have been set ( basically the Name/LinkedDisplayName ) + //which is set in Graphic Import. + m_vTextFramesForChaining.push_back(xShape); + } } } if (!m_bInHeaderFooterImport && !checkZOredrStatus) @@ -2324,8 +2332,17 @@ void DomainMapper_Impl::ChainTextFrames() uno::Reference<text::XTextContent> xTextContent1(*outer_itr, uno::UNO_QUERY_THROW); uno::Reference<beans::XPropertySet> xPropertySet1(xTextContent1, uno::UNO_QUERY); uno::Sequence<beans::PropertyValue> aGrabBag1; - xPropertySet1->getPropertyValue("FrameInteropGrabBag") >>= aGrabBag1; - xPropertySet1->getPropertyValue("LinkDisplayName") >>= sName1; + uno::Reference<lang::XServiceInfo> xServiceInfo1(xPropertySet1, uno::UNO_QUERY); + if (xServiceInfo1->supportsService("com.sun.star.text.TextFrame")) + { + xPropertySet1->getPropertyValue("FrameInteropGrabBag") >>= aGrabBag1; + xPropertySet1->getPropertyValue("LinkDisplayName") >>= sName1; + } + else + { + xPropertySet1->getPropertyValue("InteropGrabBag") >>= aGrabBag1; + xPropertySet1->getPropertyValue("ChainName") >>= sName1; + } lcl_getGrabBagValue( aGrabBag1, "Txbx-Id") >>= nTxbxId1; lcl_getGrabBagValue( aGrabBag1, "Txbx-Seq") >>= nTxbxSeq1; @@ -2337,8 +2354,17 @@ void DomainMapper_Impl::ChainTextFrames() uno::Reference<text::XTextContent> xTextContent2(*inner_itr, uno::UNO_QUERY_THROW); uno::Reference<beans::XPropertySet> xPropertySet2(xTextContent2, uno::UNO_QUERY); uno::Sequence<beans::PropertyValue> aGrabBag2; - xPropertySet2->getPropertyValue("FrameInteropGrabBag") >>= aGrabBag2; - xPropertySet2->getPropertyValue("LinkDisplayName") >>= sName2; + uno::Reference<lang::XServiceInfo> xServiceInfo2(xPropertySet1, uno::UNO_QUERY); + if (xServiceInfo2->supportsService("com.sun.star.text.TextFrame")) + { + xPropertySet2->getPropertyValue("FrameInteropGrabBag") >>= aGrabBag2; + xPropertySet2->getPropertyValue("LinkDisplayName") >>= sName2; + } + else + { + xPropertySet2->getPropertyValue("InteropGrabBag") >>= aGrabBag2; + xPropertySet2->getPropertyValue("ChainName") >>= sName2; + } lcl_getGrabBagValue( aGrabBag2, "Txbx-Id") >>= nTxbxId2; lcl_getGrabBagValue( aGrabBag2, "Txbx-Seq") >>= nTxbxSeq2; |