summaryrefslogtreecommitdiff
path: root/oox/source/vml/vmlshape.cxx
diff options
context:
space:
mode:
authorJustin Luth <justin_luth@sil.org>2015-06-30 12:55:18 +0300
committerMiklos Vajna <vmiklos@collabora.co.uk>2015-07-02 10:07:18 +0000
commit091fe76b6329b4bb974987554369cbfadd8f2401 (patch)
tree0d6a466cfb1bbdcded8199bf38a58bd854b3d712 /oox/source/vml/vmlshape.cxx
parent996b16dcb590ebf779f5d95caf15e9ab18036b07 (diff)
tdf#87348 implement mso-next-textbox vml-style textbox chaining import
Change-Id: Ic62769cf5bb1589dd4de3a66b3d7dd896e5b5711 Reviewed-on: https://gerrit.libreoffice.org/16366 Reviewed-by: Justin Luth <justin_luth@sil.org> Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
Diffstat (limited to 'oox/source/vml/vmlshape.cxx')
-rw-r--r--oox/source/vml/vmlshape.cxx77
1 files changed, 72 insertions, 5 deletions
diff --git a/oox/source/vml/vmlshape.cxx b/oox/source/vml/vmlshape.cxx
index 55b17d99a741..2c2f6eb4a685 100644
--- a/oox/source/vml/vmlshape.cxx
+++ b/oox/source/vml/vmlshape.cxx
@@ -312,21 +312,64 @@ Reference< XShape > ShapeBase::convertAndInsert( const Reference< XShapes >& rxS
if( aShapeProp.hasProperty( PROP_Name ) )
aShapeProp.setProperty( PROP_Name, getShapeName() );
uno::Reference< lang::XServiceInfo > xSInfo( xShape, uno::UNO_QUERY_THROW );
+
+ OUString sLinkChainName = getTypeModel().maLegacyId;
+ sal_Int32 id = 0;
+ sal_Int32 idPos = sLinkChainName.indexOf("_x");
+ sal_Int32 seq = 0;
+ sal_Int32 seqPos = sLinkChainName.indexOf("_s",idPos);
+ if( idPos >= 0 && idPos < seqPos )
+ {
+ id = sLinkChainName.copy(idPos+2,seqPos-idPos+2).toInt32();
+ seq = sLinkChainName.copy(seqPos+2).toInt32();
+ }
+
+ OUString s_mso_next_textbox;
+ if( getTextBox() )
+ s_mso_next_textbox = getTextBox()->msNextTextbox;
+ if( s_mso_next_textbox.startsWith("#") )
+ s_mso_next_textbox = s_mso_next_textbox.copy(1);
+
if (xSInfo->supportsService("com.sun.star.text.TextFrame"))
{
uno::Sequence<beans::PropertyValue> aGrabBag;
uno::Reference<beans::XPropertySet> propertySet (xShape, uno::UNO_QUERY);
propertySet->getPropertyValue("FrameInteropGrabBag") >>= aGrabBag;
- sal_Int32 length = aGrabBag.getLength();
+ sal_Int32 length;
+ length = aGrabBag.getLength();
aGrabBag.realloc( length+1 );
aGrabBag[length].Name = "VML-Z-ORDER";
aGrabBag[length].Value = uno::makeAny( maTypeModel.maZIndex.toInt32() );
+
+ if( !s_mso_next_textbox.isEmpty() )
+ {
+ length = aGrabBag.getLength();
+ aGrabBag.realloc( length+1 );
+ aGrabBag[length].Name = "mso-next-textbox";
+ aGrabBag[length].Value = uno::makeAny( s_mso_next_textbox );
+ }
+
+ if( !sLinkChainName.isEmpty() )
+ {
+ length = aGrabBag.getLength();
+ aGrabBag.realloc( length+4 );
+ aGrabBag[length].Name = "TxbxHasLink";
+ aGrabBag[length].Value = uno::makeAny( true );
+ aGrabBag[length+1].Name = "Txbx-Id";
+ aGrabBag[length+1].Value = uno::makeAny( id );
+ aGrabBag[length+2].Name = "Txbx-Seq";
+ aGrabBag[length+2].Value = uno::makeAny( seq );
+ aGrabBag[length+3].Name = "LinkChainName";
+ aGrabBag[length+3].Value = uno::makeAny( sLinkChainName );
+ }
+
if(!(maTypeModel.maRotation).isEmpty())
{
- aGrabBag.realloc( length+2 );
- aGrabBag[length+1].Name = "mso-rotation-angle";
- aGrabBag[length+1].Value = uno::makeAny(sal_Int32(NormAngle360((maTypeModel.maRotation.toInt32()) * -100)));
+ length = aGrabBag.getLength();
+ aGrabBag.realloc( length+1 );
+ aGrabBag[length].Name = "mso-rotation-angle";
+ aGrabBag[length].Value = uno::makeAny(sal_Int32(NormAngle360((maTypeModel.maRotation.toInt32()) * -100)));
}
propertySet->setPropertyValue( "FrameInteropGrabBag", uno::makeAny(aGrabBag) );
sal_Int32 backColorTransparency = 0;
@@ -346,10 +389,34 @@ Reference< XShape > ShapeBase::convertAndInsert( const Reference< XShapes >& rxS
uno::Sequence<beans::PropertyValue> aGrabBag;
uno::Reference<beans::XPropertySet> propertySet (xShape, uno::UNO_QUERY);
propertySet->getPropertyValue("InteropGrabBag") >>= aGrabBag;
- sal_Int32 length = aGrabBag.getLength();
+ sal_Int32 length;
+
+ length = aGrabBag.getLength();
aGrabBag.realloc( length+1 );
aGrabBag[length].Name = "VML-Z-ORDER";
aGrabBag[length].Value = uno::makeAny( maTypeModel.maZIndex.toInt32() );
+
+ if( !s_mso_next_textbox.isEmpty() )
+ {
+ length = aGrabBag.getLength();
+ aGrabBag.realloc( length+1 );
+ aGrabBag[length].Name = "mso-next-textbox";
+ aGrabBag[length].Value = uno::makeAny( s_mso_next_textbox );
+ }
+
+ if( !sLinkChainName.isEmpty() )
+ {
+ length = aGrabBag.getLength();
+ aGrabBag.realloc( length+4 );
+ aGrabBag[length].Name = "TxbxHasLink";
+ aGrabBag[length].Value = uno::makeAny( true );
+ aGrabBag[length+1].Name = "Txbx-Id";
+ aGrabBag[length+1].Value = uno::makeAny( id );
+ aGrabBag[length+2].Name = "Txbx-Seq";
+ aGrabBag[length+2].Value = uno::makeAny( seq );
+ aGrabBag[length+3].Name = "LinkChainName";
+ aGrabBag[length+3].Value = uno::makeAny( sLinkChainName );
+ }
propertySet->setPropertyValue( "InteropGrabBag", uno::makeAny(aGrabBag) );
}
}