tdf#164775 PPTX export: fix connector shape regression
A connector shape can be connected to a shape, if the end of connector shape is released inside the target shape, it will automatically attach to the best possible connection point.
It takes into account the shape type, geometric properties, and
user-defined glue points.
In this case, if we export the ODP file to PPTX, we need to use the GetConnectorRule() method to get the correct connection index(idx).
this regression is
caused by commit 4d15351718
(tdf#149697 PPTX export: fix changing place of connection points).
Change-Id: I8eda059e72f595edc62fd5bc7f3e6466988af5bb
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/181226
Tested-by: Jenkins
Reviewed-by: Nagy Tibor <tibor.nagy.extern@allotropia.de>
This commit is contained in:
@@ -452,7 +452,7 @@ namespace com::sun::star {
|
||||
}
|
||||
}
|
||||
|
||||
struct UNLESS_MERGELIBS(MSFILTER_DLLPUBLIC) EscherConnectorListEntry
|
||||
struct MSFILTER_DLLPUBLIC EscherConnectorListEntry
|
||||
{
|
||||
css::uno::Reference< css::drawing::XShape > mXConnector;
|
||||
css::awt::Point maPointA;
|
||||
|
@@ -1893,16 +1893,6 @@ ShapeExport& ShapeExport::WriteConnectorShape( const Reference< XShape >& xShape
|
||||
if (GetProperty(rXPropSet, u"EdgeEndConnection"_ustr))
|
||||
mAny >>= rXShapeB;
|
||||
|
||||
if (GetProperty(rXPropSet, u"StartGluePointIndex"_ustr))
|
||||
mAny >>= nStartGlueId;
|
||||
if (nStartGlueId != -1)
|
||||
nStartGlueId = lcl_GetGluePointId(rXShapeA, nStartGlueId);
|
||||
|
||||
if (GetProperty(rXPropSet, u"EndGluePointIndex"_ustr))
|
||||
mAny >>= nEndGlueId;
|
||||
if (nEndGlueId != -1)
|
||||
nEndGlueId = lcl_GetGluePointId(rXShapeB, nEndGlueId);
|
||||
|
||||
// Position is relative to group in Word, but relative to anchor of group in API.
|
||||
if (GetDocumentType() == DOCUMENT_DOCX && !mbUserShapes && m_xParent.is())
|
||||
{
|
||||
@@ -1914,6 +1904,24 @@ ShapeExport& ShapeExport::WriteConnectorShape( const Reference< XShape >& xShape
|
||||
}
|
||||
EscherConnectorListEntry aConnectorEntry( xShape, aStartPoint, rXShapeA, aEndPoint, rXShapeB );
|
||||
|
||||
if (GetProperty(rXPropSet, u"StartGluePointIndex"_ustr))
|
||||
{
|
||||
mAny >>= nStartGlueId;
|
||||
nStartGlueId = (nStartGlueId != -1) ? lcl_GetGluePointId(rXShapeA, nStartGlueId)
|
||||
: (aConnectorEntry.mXConnectToA.is()
|
||||
? aConnectorEntry.GetConnectorRule(true)
|
||||
: -1);
|
||||
}
|
||||
|
||||
if (GetProperty(rXPropSet, u"EndGluePointIndex"_ustr))
|
||||
{
|
||||
mAny >>= nEndGlueId;
|
||||
nEndGlueId = (nEndGlueId != -1) ? lcl_GetGluePointId(rXShapeB, nEndGlueId)
|
||||
: (aConnectorEntry.mXConnectToB.is()
|
||||
? aConnectorEntry.GetConnectorRule(false)
|
||||
: -1);
|
||||
}
|
||||
|
||||
if (eConnectorType != ConnectorType_LINE)
|
||||
{
|
||||
tools::PolyPolygon aPolyPolygon = EscherPropertyContainer::GetPolyPolygon(xShape);
|
||||
|
BIN
sd/qa/unit/data/odp/tdf164775.odp
Normal file
BIN
sd/qa/unit/data/odp/tdf164775.odp
Normal file
Binary file not shown.
@@ -27,6 +27,18 @@ public:
|
||||
int testTdf115005_FallBack_Images(bool bAddReplacementImages);
|
||||
};
|
||||
|
||||
CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest3, testTdf164775_ConnectorShape)
|
||||
{
|
||||
createSdImpressDoc("odp/tdf164775.odp");
|
||||
save(u"Impress Office Open XML"_ustr);
|
||||
|
||||
xmlDocUniquePtr pXmlDoc1 = parseExport(u"ppt/slides/slide1.xml"_ustr);
|
||||
assertXPath(pXmlDoc1, "/p:sld/p:cSld/p:spTree/p:cxnSp/p:nvCxnSpPr/p:cNvCxnSpPr/a:stCxn", "idx",
|
||||
u"3");
|
||||
assertXPath(pXmlDoc1, "/p:sld/p:cSld/p:spTree/p:cxnSp/p:nvCxnSpPr/p:cNvCxnSpPr/a:endCxn", "idx",
|
||||
u"1");
|
||||
}
|
||||
|
||||
CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest3, testTdf153105)
|
||||
{
|
||||
createSdImpressDoc("odp/tdf153105.odp");
|
||||
|
Reference in New Issue
Block a user