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 /oox | |
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 'oox')
-rw-r--r-- | oox/source/export/vmlexport.cxx | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/oox/source/export/vmlexport.cxx b/oox/source/export/vmlexport.cxx index 4fa1e6cf7764..06f1745ab5b6 100644 --- a/oox/source/export/vmlexport.cxx +++ b/oox/source/export/vmlexport.cxx @@ -1001,6 +1001,8 @@ void VMLExport::Commit( EscherPropertyContainer& rProps, const tools::Rectangle& if (!IsWaterMarkShape(m_pSdrObject->GetName()) && !m_bSkipwzName) m_pShapeAttrList->add(XML_ID, idStr); + // note that XML_ID is different from XML_id (although it looks like a LO + // implementation distinction without valid justification to me). bAlreadyWritten[ESCHER_Prop_wzName] = true; } break; @@ -1383,8 +1385,13 @@ sal_Int32 VMLExport::StartShape() "_x0000_t" + OString::number( m_nShapeType ) ); } + // allow legacy id (which in form controls and textboxes + // by definition seems to have this otherwise illegal name). + m_pSerializer->setAllowXEscape(!m_sShapeIDPrefix.startsWith("_x0000_")); + // start of the shape m_pSerializer->startElementNS( XML_v, nShapeElement, m_pShapeAttrList ); + m_pSerializer->setAllowXEscape(true); OString const textboxStyle(m_TextboxStyle.makeStringAndClear()); @@ -1492,7 +1499,7 @@ OString const & VMLExport::AddSdrObject( const SdrObject& rObj, bool const bIsFollowingTextFlow, sal_Int16 eHOri, sal_Int16 eVOri, sal_Int16 eHRel, sal_Int16 eVRel, FastAttributeList* pWrapAttrList, - const bool bOOxmlExport ) + const bool bOOxmlExport, sal_uInt32 nId) { m_pSdrObject = &rObj; m_eHOri = eHOri; @@ -1502,7 +1509,7 @@ OString const & VMLExport::AddSdrObject( const SdrObject& rObj, m_pWrapAttrList = pWrapAttrList; m_bInline = false; m_IsFollowingTextFlow = bIsFollowingTextFlow; - EscherEx::AddSdrObject(rObj, bOOxmlExport); + EscherEx::AddSdrObject(rObj, bOOxmlExport, nId); return m_sShapeId; } |