diff options
author | Nikhil Walvekar <nikhil.walvekar@synerzip.com> | 2014-01-10 20:21:45 +0530 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.co.uk> | 2014-01-13 18:17:42 +0100 |
commit | 3cf58da99ef152db31fa8378045d4bff041f7ff4 (patch) | |
tree | 8cd1366664e98e93692071e529e248f8d7ddabb7 /oox | |
parent | Work around G_DEFINE_TYPE -Werror,-Wunused-function (diff) | |
download | core-3cf58da99ef152db31fa8378045d4bff041f7ff4.tar.gz core-3cf58da99ef152db31fa8378045d4bff041f7ff4.zip |
fdo#70942 Preserve original shape type, if shape contains text.
Currently we change shape type to textframe if a shape contains
text. Due to this shape information is not preserved when file
is saved.
Conflicts:
sw/qa/extras/ooxmlexport/ooxmlexport.cxx
Reviewed on:
https://gerrit.libreoffice.org/7372
Change-Id: I7af3ce29f857d6fa2ceab0350937d91638361e7c
Diffstat (limited to 'oox')
-rw-r--r-- | oox/source/drawingml/customshapeproperties.cxx | 1 | ||||
-rw-r--r-- | oox/source/drawingml/shape.cxx | 12 | ||||
-rw-r--r-- | oox/source/shape/WpsContext.cxx | 1 |
3 files changed, 14 insertions, 0 deletions
diff --git a/oox/source/drawingml/customshapeproperties.cxx b/oox/source/drawingml/customshapeproperties.cxx index 247e8cf9880e..cdc69741ec05 100644 --- a/oox/source/drawingml/customshapeproperties.cxx +++ b/oox/source/drawingml/customshapeproperties.cxx @@ -44,6 +44,7 @@ namespace oox { namespace drawingml { CustomShapeProperties::CustomShapeProperties() : mnShapePresetType ( -1 ) +, mbShapeTypeOverride(sal_False) , mbMirroredX ( sal_False ) , mbMirroredY ( sal_False ) , mnTextRotateAngle ( 0 ) diff --git a/oox/source/drawingml/shape.cxx b/oox/source/drawingml/shape.cxx index 9437f0252499..eff9ad408424 100644 --- a/oox/source/drawingml/shape.cxx +++ b/oox/source/drawingml/shape.cxx @@ -621,6 +621,18 @@ Reference< XShape > Shape::createAndInsert( { if (aServiceName == "com.sun.star.text.TextFrame") { + if (mpCustomShapePropertiesPtr != NULL && mpCustomShapePropertiesPtr->getShapeTypeOverride()) + { + uno::Reference<beans::XPropertySet> propertySet (mxShape, uno::UNO_QUERY); + uno::Sequence<beans::PropertyValue> aGrabBag; + propertySet->getPropertyValue("FrameInteropGrabBag") >>= aGrabBag; + sal_Int32 length = aGrabBag.getLength(); + aGrabBag.realloc( length+1); + aGrabBag[length].Name = "mso-orig-shape-type"; + aGrabBag[length].Value = uno::makeAny(mpCustomShapePropertiesPtr->getShapePresetTypeName()); + propertySet->setPropertyValue("FrameInteropGrabBag",uno::makeAny(aGrabBag)); + } + // TextFrames have BackColor, not FillColor if (aShapeProps.hasProperty(PROP_FillColor)) { diff --git a/oox/source/shape/WpsContext.cxx b/oox/source/shape/WpsContext.cxx index e2bbb0eda362..04e8a232332c 100644 --- a/oox/source/shape/WpsContext.cxx +++ b/oox/source/shape/WpsContext.cxx @@ -101,6 +101,7 @@ oox::core::ContextHandlerRef WpsContext::onCreateContext(sal_Int32 nElementToken } break; case XML_txbx: + mpShape->getCustomShapeProperties()->setShapeTypeOverride(true); mpShape->setServiceName("com.sun.star.text.TextFrame"); break; default: |