summaryrefslogtreecommitdiff
path: root/oox
diff options
context:
space:
mode:
authorDaniel Arato (NISZ) <arato.daniel@nisz.hu>2020-08-31 12:48:07 +0200
committerXisco Fauli <xiscofauli@libreoffice.org>2020-09-16 13:55:19 +0200
commit10184fcab1f314e0861ad152b320ed1ee31ccdd5 (patch)
treec99eede6e8f664ffb149b725cb5aa170047d2481 /oox
parentb27137a7091104cce177791478e86d127680c9af (diff)
tdf#131537 DOCX export: fix OLE "Display as icon"
for example to avoid converting OLE icons of an ODF document to an icon-size embedded spreadsheet. When creating a new OLE object in Writer the user has an option called "Display as icon" which causes the actual contents of the OLE to be hidden when rendered in the document. This setting, referred to internally as the DrawAspect of the object, was imported fine, but when exported to a .docx it always had the value "Content" (corresponding to "Display as icon" being unchecked). Now OLE objects with "Display as icon" checked are saved with DrawAspect="Icon". A grab bag entry was previously used to let the DrawAspect setting flow through Writer from OOXML import to export. Now this workaround is no longer needed and is removed by the present commit. Change-Id: I46ea4fc95a26bcd1f85e19a506c0965f73d4257a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/101711 Tested-by: László Németh <nemeth@numbertext.org> Reviewed-by: László Németh <nemeth@numbertext.org> (cherry picked from commit 07dcb0dab759d4ab535d99c0e6d326959906b87e) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/102652 Reviewed-by: Dániel Arató <arato.daniel@nisz.hu> Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org> Tested-by: Jenkins
Diffstat (limited to 'oox')
-rw-r--r--oox/source/ole/oleobjecthelper.cxx10
1 files changed, 3 insertions, 7 deletions
diff --git a/oox/source/ole/oleobjecthelper.cxx b/oox/source/ole/oleobjecthelper.cxx
index a77a784af629..4ec40af8073e 100644
--- a/oox/source/ole/oleobjecthelper.cxx
+++ b/oox/source/ole/oleobjecthelper.cxx
@@ -87,7 +87,7 @@ OleObjectHelper::~OleObjectHelper()
// just "application/vnd.sun.star.oleobject"
void SaveInteropProperties(uno::Reference<frame::XModel> const& xModel,
OUString const& rObjectName, OUString const*const pOldObjectName,
- OUString const& rProgId, OUString const& rDrawAspect)
+ OUString const& rProgId)
{
static const char sEmbeddingsPropName[] = "EmbeddedObjects";
@@ -100,11 +100,9 @@ void SaveInteropProperties(uno::Reference<frame::XModel> const& xModel,
if (aGrabBag.find(sEmbeddingsPropName) != aGrabBag.end())
objectsList << aGrabBag[sEmbeddingsPropName];
- uno::Sequence< beans::PropertyValue > aGrabBagAttribute(2);
+ uno::Sequence< beans::PropertyValue > aGrabBagAttribute(1);
aGrabBagAttribute[0].Name = "ProgID";
aGrabBagAttribute[0].Value <<= rProgId;
- aGrabBagAttribute[1].Name = "DrawAspect";
- aGrabBagAttribute[1].Value <<= rDrawAspect;
// If we got an "old name", erase that first.
if (pOldObjectName)
@@ -148,9 +146,7 @@ bool OleObjectHelper::importOleObject( PropertyMap& rPropMap, const OleObjectInf
xOutStrm->writeBytes( rOleObject.maEmbeddedData );
xOutStrm->closeOutput();
- SaveInteropProperties(m_xModel, aObjectId, nullptr,
- rOleObject.maProgId,
- rOleObject.mbShowAsIcon ? OUString("Icon") : OUString("Content"));
+ SaveInteropProperties(m_xModel, aObjectId, nullptr, rOleObject.maProgId);
OUString aUrl = mxResolver->resolveEmbeddedObjectURL( aObjectId );
OSL_ENSURE( aUrl.match( g_aEmbeddedObjScheme ), "OleObjectHelper::importOleObject - unexpected URL scheme" );