diff options
author | Justin Luth <justin.luth@collabora.com> | 2023-01-12 11:18:55 -0500 |
---|---|---|
committer | Justin Luth <jluth@mail.com> | 2023-01-15 02:09:06 +0000 |
commit | d50eca2a30bdabdc1735c590d6ec1913c6dd22fd (patch) | |
tree | f8d8a738c60fa0c69954a9fbf684a2e7640d8740 /filter/source | |
parent | 37e3455a13ab5741104bf41d05a80e60a4612682 (diff) |
tdf#117266 sc oox: export vml button with a correct name
Without a correctly formatted ID, LO was unable to import
the shape into the spreadsheet. Now at least the button
shows up and can be pressed.
MS Word already showed the button before the patch,
so nothing there has changed. That suggests that our
problem may be more during import.
This code path is also followed by DOC and DOCX formats,
but they do completely different things with the results.
This is super nasty code...
Change-Id: I383736a7de9c3e94b427d5747e5949c0348dcecd
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/145509
Tested-by: Jenkins
Reviewed-by: Justin Luth <jluth@mail.com>
Diffstat (limited to 'filter/source')
-rw-r--r-- | filter/source/msfilter/eschesdo.cxx | 18 | ||||
-rw-r--r-- | filter/source/msfilter/eschesdo.hxx | 2 |
2 files changed, 12 insertions, 8 deletions
diff --git a/filter/source/msfilter/eschesdo.cxx b/filter/source/msfilter/eschesdo.cxx index fe16862df69a..8c39297f1e59 100644 --- a/filter/source/msfilter/eschesdo.cxx +++ b/filter/source/msfilter/eschesdo.cxx @@ -430,13 +430,17 @@ sal_uInt32 ImplEESdrWriter::ImplWriteShape( ImplEESdrObject& rObj, } mpEscherEx->OpenContainer( ESCHER_SpContainer ); - if(bInline) + nShapeType = bInline ? ESCHER_ShpInst_PictureFrame : ESCHER_ShpInst_HostControl; + const ShapeFlag nFlags = ShapeFlag::HaveShapeProperty | ShapeFlag::HaveAnchor; + nShapeID = rObj.GetShapeId(); + if (nShapeID) { - addShape( ESCHER_ShpInst_PictureFrame, ShapeFlag::HaveShapeProperty | ShapeFlag::HaveAnchor ); + mpEscherEx->AddShape(nShapeType, nFlags, nShapeID ); + rSolverContainer.AddShape(rObj.GetShapeRef(), nShapeID); } else { - addShape( ESCHER_ShpInst_HostControl, ShapeFlag::HaveShapeProperty | ShapeFlag::HaveAnchor ); + addShape(nShapeType, nFlags); } } else @@ -946,9 +950,9 @@ void EscherEx::AddUnoShapes( const Reference< XShapes >& rxShapes, bool ooxmlExp mpImplEESdrWriter->ImplWriteCurrentPage(ooxmlExport); } -sal_uInt32 EscherEx::AddSdrObject( const SdrObject& rObj, bool ooxmlExport ) +sal_uInt32 EscherEx::AddSdrObject(const SdrObject& rObj, bool ooxmlExport, sal_uInt32 nId) { - ImplEESdrObject aObj( *mpImplEESdrWriter, rObj, mbOOXML ); + ImplEESdrObject aObj(*mpImplEESdrWriter, rObj, mbOOXML , nId); if( aObj.IsValid() ) return mpImplEESdrWriter->ImplWriteTheShape( aObj, ooxmlExport ); return 0; @@ -995,8 +999,8 @@ const SdrObject* EscherEx::GetSdrObject( const Reference< XShape >& rShape ) ImplEESdrObject::ImplEESdrObject( ImplEESdrWriter& rEx, - const SdrObject& rObj, bool bOOXML ) : - mnShapeId( 0 ), + const SdrObject& rObj, bool bOOXML, sal_uInt32 nId) : + mnShapeId(nId), mnTextSize( 0 ), mnAngle( 0 ), mbValid( false ), diff --git a/filter/source/msfilter/eschesdo.hxx b/filter/source/msfilter/eschesdo.hxx index cf46f49b6bee..ae3fe91ec1cd 100644 --- a/filter/source/msfilter/eschesdo.hxx +++ b/filter/source/msfilter/eschesdo.hxx @@ -45,7 +45,7 @@ class ImplEESdrObject public: css::uno::Reference< css::beans::XPropertySet > mXPropSet; - ImplEESdrObject( ImplEESdrWriter& rEx, const SdrObject& rObj, bool bOOXML ); + ImplEESdrObject(ImplEESdrWriter& rEx, const SdrObject& rObj, bool bOOXML, sal_uInt32 nId = 0); ImplEESdrObject( const css::uno::Reference< css::drawing::XShape >& rShape ); ~ImplEESdrObject(); |