Advanced Diagram support: Move data classes to svx
As preparation for own im/export move data classes for which that is now possible to svx Made TypeConstant more safe, also sorted it. Corrected an error there. Secured TypeConstant usage by identifying usages (mnType -> mnXMLType). Had to convert from oox::OptValue to std::optional since 1st is not available in svx in datamodelcontext.cxx. That makes the test work and the test-file load corrrectly. Change-Id: Ifee008caf486ddb6b52a347dc08e7e053c49ef49 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132195 Tested-by: Jenkins Reviewed-by: Armin Le Grand <Armin.Le.Grand@me.com>
This commit is contained in:
committed by
Armin Le Grand
parent
c168f15a74
commit
f41d048172
@@ -0,0 +1,121 @@
|
||||
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
|
||||
/*
|
||||
* This file is part of the LibreOffice project.
|
||||
*
|
||||
* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
*
|
||||
* This file incorporates work covered by the following license notice:
|
||||
*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed
|
||||
* with this work for additional information regarding copyright
|
||||
* ownership. The ASF licenses this file to you under the Apache
|
||||
* License, Version 2.0 (the "License"); you may not use this file
|
||||
* except in compliance with the License. You may obtain a copy of
|
||||
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
|
||||
*/
|
||||
|
||||
#ifndef INCLUDED_SVX_DIAGRAM_DATAMODEL_HXX
|
||||
#define INCLUDED_SVX_DIAGRAM_DATAMODEL_HXX
|
||||
|
||||
#include <vector>
|
||||
#include <optional>
|
||||
|
||||
#include <svx/svxdllapi.h>
|
||||
#include <rtl/ustring.hxx>
|
||||
|
||||
namespace svx::diagram {
|
||||
|
||||
enum TypeConstant {
|
||||
XML_none = 0,
|
||||
XML_type = 395,
|
||||
XML_asst = 680,
|
||||
XML_doc = 1924,
|
||||
XML_node = 3596,
|
||||
XML_norm = 3609,
|
||||
XML_parOf = 3878,
|
||||
XML_parTrans = 3879,
|
||||
XML_pres = 4085,
|
||||
XML_presOf = 4090,
|
||||
XML_presParOf = 4091,
|
||||
XML_rel = 4298,
|
||||
XML_sibTrans = 4746,
|
||||
};
|
||||
|
||||
/** A Connection
|
||||
*/
|
||||
struct SVXCORE_DLLPUBLIC Connection
|
||||
{
|
||||
Connection();
|
||||
|
||||
TypeConstant mnXMLType;
|
||||
OUString msModelId;
|
||||
OUString msSourceId;
|
||||
OUString msDestId;
|
||||
OUString msParTransId;
|
||||
OUString msPresId;
|
||||
OUString msSibTransId;
|
||||
sal_Int32 mnSourceOrder;
|
||||
sal_Int32 mnDestOrder;
|
||||
|
||||
};
|
||||
|
||||
typedef std::vector< Connection > Connections;
|
||||
|
||||
/** A point
|
||||
*/
|
||||
struct SVXCORE_DLLPUBLIC Point
|
||||
{
|
||||
Point();
|
||||
|
||||
OUString msCnxId;
|
||||
OUString msModelId;
|
||||
OUString msColorTransformCategoryId;
|
||||
OUString msColorTransformTypeId;
|
||||
OUString msLayoutCategoryId;
|
||||
OUString msLayoutTypeId;
|
||||
OUString msPlaceholderText;
|
||||
OUString msPresentationAssociationId;
|
||||
OUString msPresentationLayoutName;
|
||||
OUString msPresentationLayoutStyleLabel;
|
||||
OUString msQuickStyleCategoryId;
|
||||
OUString msQuickStyleTypeId;
|
||||
|
||||
TypeConstant mnXMLType;
|
||||
sal_Int32 mnMaxChildren;
|
||||
sal_Int32 mnPreferredChildren;
|
||||
sal_Int32 mnDirection;
|
||||
std::optional<sal_Int32> moHierarchyBranch;
|
||||
sal_Int32 mnResizeHandles;
|
||||
sal_Int32 mnCustomAngle;
|
||||
sal_Int32 mnPercentageNeighbourWidth;
|
||||
sal_Int32 mnPercentageNeighbourHeight;
|
||||
sal_Int32 mnPercentageOwnWidth;
|
||||
sal_Int32 mnPercentageOwnHeight;
|
||||
sal_Int32 mnIncludeAngleScale;
|
||||
sal_Int32 mnRadiusScale;
|
||||
sal_Int32 mnWidthScale;
|
||||
sal_Int32 mnHeightScale;
|
||||
sal_Int32 mnWidthOverride;
|
||||
sal_Int32 mnHeightOverride;
|
||||
sal_Int32 mnLayoutStyleCount;
|
||||
sal_Int32 mnLayoutStyleIndex;
|
||||
|
||||
bool mbOrgChartEnabled;
|
||||
bool mbBulletEnabled;
|
||||
bool mbCoherent3DOffset;
|
||||
bool mbCustomHorizontalFlip;
|
||||
bool mbCustomVerticalFlip;
|
||||
bool mbCustomText;
|
||||
bool mbIsPlaceholder;
|
||||
};
|
||||
|
||||
typedef std::vector< Point > Points;
|
||||
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|
||||
@@ -34,29 +34,7 @@ using namespace ::com::sun::star;
|
||||
|
||||
namespace oox::drawingml {
|
||||
|
||||
namespace dgm {
|
||||
|
||||
void Connection::dump() const
|
||||
{
|
||||
SAL_INFO(
|
||||
"oox.drawingml",
|
||||
"cnx modelId " << msModelId << ", srcId " << msSourceId << ", dstId "
|
||||
<< msDestId << ", parTransId " << msParTransId << ", presId "
|
||||
<< msPresId << ", sibTransId " << msSibTransId << ", srcOrd "
|
||||
<< mnSourceOrder << ", dstOrd " << mnDestOrder);
|
||||
}
|
||||
|
||||
void Point::dump(const Shape* pShape) const
|
||||
{
|
||||
SAL_INFO(
|
||||
"oox.drawingml",
|
||||
"pt text " << pShape << ", cnxId " << msCnxId << ", modelId "
|
||||
<< msModelId << ", type " << mnType);
|
||||
}
|
||||
|
||||
} // oox::drawingml::dgm namespace
|
||||
|
||||
Shape* DiagramData::getOrCreateAssociatedShape(const dgm::Point& rPoint, bool bCreateOnDemand) const
|
||||
Shape* DiagramData::getOrCreateAssociatedShape(const svx::diagram::Point& rPoint, bool bCreateOnDemand) const
|
||||
{
|
||||
if(maPointShapeMap.end() == maPointShapeMap.find(rPoint.msModelId))
|
||||
{
|
||||
@@ -77,7 +55,7 @@ Shape* DiagramData::getOrCreateAssociatedShape(const dgm::Point& rPoint, bool bC
|
||||
return rShapePtr.get();
|
||||
}
|
||||
|
||||
void DiagramData::restoreDataFromModelToShapeAfterReCreation(const dgm::Point& rPoint, Shape& rNewShape) const
|
||||
void DiagramData::restoreDataFromModelToShapeAfterReCreation(const svx::diagram::Point& rPoint, Shape& rNewShape) const
|
||||
{
|
||||
// If we did create a new oox::drawingml::Shape, directly apply
|
||||
// available data from the Diagram ModelData to it as preparation
|
||||
@@ -120,28 +98,49 @@ DiagramData::DiagramData() :
|
||||
{
|
||||
}
|
||||
|
||||
const dgm::Point* DiagramData::getRootPoint() const
|
||||
const svx::diagram::Point* DiagramData::getRootPoint() const
|
||||
{
|
||||
for (const auto & aCurrPoint : maPoints)
|
||||
if (aCurrPoint.mnType == XML_doc)
|
||||
if (aCurrPoint.mnXMLType == svx::diagram::TypeConstant::XML_doc)
|
||||
return &aCurrPoint;
|
||||
|
||||
SAL_WARN("oox.drawingml", "No root point");
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
static void Connection_dump(const svx::diagram::Connection& rConnection)
|
||||
{
|
||||
SAL_INFO(
|
||||
"oox.drawingml",
|
||||
"cnx modelId " << rConnection.msModelId << ", srcId " << rConnection.msSourceId << ", dstId "
|
||||
<< rConnection.msDestId << ", parTransId " << rConnection.msParTransId << ", presId "
|
||||
<< rConnection.msPresId << ", sibTransId " << rConnection.msSibTransId << ", srcOrd "
|
||||
<< rConnection.mnSourceOrder << ", dstOrd " << rConnection.mnDestOrder);
|
||||
}
|
||||
|
||||
static void Point_dump(const svx::diagram::Point& rPoint, const Shape* pShape)
|
||||
{
|
||||
SAL_INFO(
|
||||
"oox.drawingml",
|
||||
"pt text " << pShape << ", cnxId " << rPoint.msCnxId << ", modelId "
|
||||
<< rPoint.msModelId << ", type " << rPoint.mnXMLType);
|
||||
}
|
||||
|
||||
void DiagramData::dump() const
|
||||
{
|
||||
SAL_INFO("oox.drawingml", "Dgm: DiagramData # of cnx: " << maConnections.size() );
|
||||
for (const auto& rConnection : maConnections)
|
||||
rConnection.dump();
|
||||
Connection_dump(rConnection);
|
||||
|
||||
SAL_INFO("oox.drawingml", "Dgm: DiagramData # of pt: " << maPoints.size() );
|
||||
for (const auto& rPoint : maPoints)
|
||||
rPoint.dump(getOrCreateAssociatedShape(rPoint));
|
||||
Point_dump(rPoint, getOrCreateAssociatedShape(rPoint));
|
||||
}
|
||||
|
||||
void DiagramData::getChildrenString(OUStringBuffer& rBuf, const dgm::Point* pPoint, sal_Int32 nLevel) const
|
||||
void DiagramData::getChildrenString(
|
||||
OUStringBuffer& rBuf,
|
||||
const svx::diagram::Point* pPoint,
|
||||
sal_Int32 nLevel) const
|
||||
{
|
||||
if (!pPoint)
|
||||
return;
|
||||
@@ -161,9 +160,9 @@ void DiagramData::getChildrenString(OUStringBuffer& rBuf, const dgm::Point* pPoi
|
||||
rBuf.append('\n');
|
||||
}
|
||||
|
||||
std::vector<const dgm::Point*> aChildren;
|
||||
std::vector< const svx::diagram::Point* > aChildren;
|
||||
for (const auto& rCxn : maConnections)
|
||||
if (rCxn.mnType == XML_parOf && rCxn.msSourceId == pPoint->msModelId)
|
||||
if (rCxn.mnXMLType == svx::diagram::TypeConstant::XML_parOf && rCxn.msSourceId == pPoint->msModelId)
|
||||
{
|
||||
if (rCxn.mnSourceOrder >= static_cast<sal_Int32>(aChildren.size()))
|
||||
aChildren.resize(rCxn.mnSourceOrder + 1);
|
||||
@@ -179,7 +178,7 @@ void DiagramData::getChildrenString(OUStringBuffer& rBuf, const dgm::Point* pPoi
|
||||
OUString DiagramData::getString() const
|
||||
{
|
||||
OUStringBuffer aBuf;
|
||||
const dgm::Point* pPoint = getRootPoint();
|
||||
const svx::diagram::Point* pPoint = getRootPoint();
|
||||
getChildrenString(aBuf, pPoint, 0);
|
||||
return aBuf.makeStringAndClear();
|
||||
}
|
||||
@@ -189,7 +188,7 @@ std::vector<std::pair<OUString, OUString>> DiagramData::getChildren(const OUStri
|
||||
const OUString sModelId = rParentId.isEmpty() ? getRootPoint()->msModelId : rParentId;
|
||||
std::vector<std::pair<OUString, OUString>> aChildren;
|
||||
for (const auto& rCxn : maConnections)
|
||||
if (rCxn.mnType == XML_parOf && rCxn.msSourceId == sModelId)
|
||||
if (rCxn.mnXMLType == svx::diagram::TypeConstant::XML_parOf && rCxn.msSourceId == sModelId)
|
||||
{
|
||||
if (rCxn.mnSourceOrder >= static_cast<sal_Int32>(aChildren.size()))
|
||||
aChildren.resize(rCxn.mnSourceOrder + 1);
|
||||
@@ -211,15 +210,15 @@ std::vector<std::pair<OUString, OUString>> DiagramData::getChildren(const OUStri
|
||||
return aChildren;
|
||||
}
|
||||
|
||||
void DiagramData::addConnection(sal_Int32 nType, const OUString& sSourceId, const OUString& sDestId)
|
||||
void DiagramData::addConnection(svx::diagram::TypeConstant nType, const OUString& sSourceId, const OUString& sDestId)
|
||||
{
|
||||
sal_Int32 nMaxOrd = -1;
|
||||
for (const auto& aCxn : maConnections)
|
||||
if (aCxn.mnType == nType && aCxn.msSourceId == sSourceId)
|
||||
if (aCxn.mnXMLType == nType && aCxn.msSourceId == sSourceId)
|
||||
nMaxOrd = std::max(nMaxOrd, aCxn.mnSourceOrder);
|
||||
|
||||
dgm::Connection& rCxn = maConnections.emplace_back();
|
||||
rCxn.mnType = nType;
|
||||
svx::diagram::Connection& rCxn = maConnections.emplace_back();
|
||||
rCxn.mnXMLType = nType;
|
||||
rCxn.msSourceId = sSourceId;
|
||||
rCxn.msDestId = sDestId;
|
||||
rCxn.mnSourceOrder = nMaxOrd + 1;
|
||||
@@ -227,10 +226,10 @@ void DiagramData::addConnection(sal_Int32 nType, const OUString& sSourceId, cons
|
||||
|
||||
OUString DiagramData::addNode(const OUString& rText)
|
||||
{
|
||||
const dgm::Point& rDataRoot = *getRootPoint();
|
||||
const svx::diagram::Point& rDataRoot = *getRootPoint();
|
||||
OUString sPresRoot;
|
||||
for (const auto& aCxn : maConnections)
|
||||
if (aCxn.mnType == XML_presOf && aCxn.msSourceId == rDataRoot.msModelId)
|
||||
if (aCxn.mnXMLType == svx::diagram::TypeConstant::XML_presOf && aCxn.msSourceId == rDataRoot.msModelId)
|
||||
sPresRoot = aCxn.msDestId;
|
||||
|
||||
if (sPresRoot.isEmpty())
|
||||
@@ -238,8 +237,8 @@ OUString DiagramData::addNode(const OUString& rText)
|
||||
|
||||
OUString sNewNodeId = OStringToOUString(comphelper::xml::generateGUIDString(), RTL_TEXTENCODING_UTF8);
|
||||
|
||||
dgm::Point aDataPoint;
|
||||
aDataPoint.mnType = XML_node;
|
||||
svx::diagram::Point aDataPoint;
|
||||
aDataPoint.mnXMLType = svx::diagram::TypeConstant::XML_node;
|
||||
aDataPoint.msModelId = sNewNodeId;
|
||||
|
||||
Shape* pShape(getOrCreateAssociatedShape(aDataPoint, true));
|
||||
@@ -250,16 +249,16 @@ OUString DiagramData::addNode(const OUString& rText)
|
||||
|
||||
OUString sDataSibling;
|
||||
for (const auto& aCxn : maConnections)
|
||||
if (aCxn.mnType == XML_parOf && aCxn.msSourceId == rDataRoot.msModelId)
|
||||
if (aCxn.mnXMLType == svx::diagram::TypeConstant::XML_parOf && aCxn.msSourceId == rDataRoot.msModelId)
|
||||
sDataSibling = aCxn.msDestId;
|
||||
|
||||
OUString sPresSibling;
|
||||
for (const auto& aCxn : maConnections)
|
||||
if (aCxn.mnType == XML_presOf && aCxn.msSourceId == sDataSibling)
|
||||
if (aCxn.mnXMLType == svx::diagram::TypeConstant::XML_presOf && aCxn.msSourceId == sDataSibling)
|
||||
sPresSibling = aCxn.msDestId;
|
||||
|
||||
dgm::Point aPresPoint;
|
||||
aPresPoint.mnType = XML_pres;
|
||||
svx::diagram::Point aPresPoint;
|
||||
aPresPoint.mnXMLType = svx::diagram::TypeConstant::XML_pres;
|
||||
aPresPoint.msModelId = OStringToOUString(comphelper::xml::generateGUIDString(), RTL_TEXTENCODING_UTF8);
|
||||
|
||||
// create pesPoint shape
|
||||
@@ -269,16 +268,16 @@ OUString DiagramData::addNode(const OUString& rText)
|
||||
if (!sPresSibling.isEmpty())
|
||||
{
|
||||
// no idea where to get these values from, so copy from previous sibling
|
||||
const dgm::Point* pSiblingPoint = maPointNameMap[sPresSibling];
|
||||
const svx::diagram::Point* pSiblingPoint = maPointNameMap[sPresSibling];
|
||||
aPresPoint.msPresentationLayoutName = pSiblingPoint->msPresentationLayoutName;
|
||||
aPresPoint.msPresentationLayoutStyleLabel = pSiblingPoint->msPresentationLayoutStyleLabel;
|
||||
aPresPoint.mnLayoutStyleIndex = pSiblingPoint->mnLayoutStyleIndex;
|
||||
aPresPoint.mnLayoutStyleCount = pSiblingPoint->mnLayoutStyleCount;
|
||||
}
|
||||
|
||||
addConnection(XML_parOf, rDataRoot.msModelId, aDataPoint.msModelId);
|
||||
addConnection(XML_presParOf, sPresRoot, aPresPoint.msModelId);
|
||||
addConnection(XML_presOf, aDataPoint.msModelId, aPresPoint.msModelId);
|
||||
addConnection(svx::diagram::TypeConstant::XML_parOf, rDataRoot.msModelId, aDataPoint.msModelId);
|
||||
addConnection(svx::diagram::TypeConstant::XML_presParOf, sPresRoot, aPresPoint.msModelId);
|
||||
addConnection(svx::diagram::TypeConstant::XML_presOf, aDataPoint.msModelId, aPresPoint.msModelId);
|
||||
|
||||
// adding at the end, so that references are not invalidated in between
|
||||
maPoints.push_back(aDataPoint);
|
||||
@@ -292,15 +291,15 @@ bool DiagramData::removeNode(const OUString& rNodeId)
|
||||
{
|
||||
// check if it doesn't have children
|
||||
for (const auto& aCxn : maConnections)
|
||||
if (aCxn.mnType == XML_parOf && aCxn.msSourceId == rNodeId)
|
||||
if (aCxn.mnXMLType == svx::diagram::TypeConstant::XML_parOf && aCxn.msSourceId == rNodeId)
|
||||
{
|
||||
SAL_WARN("oox.drawingml", "Node has children - can't be removed");
|
||||
return false;
|
||||
}
|
||||
|
||||
dgm::Connection aParCxn;
|
||||
svx::diagram::Connection aParCxn;
|
||||
for (const auto& aCxn : maConnections)
|
||||
if (aCxn.mnType == XML_parOf && aCxn.msDestId == rNodeId)
|
||||
if (aCxn.mnXMLType == svx::diagram::TypeConstant::XML_parOf && aCxn.msDestId == rNodeId)
|
||||
aParCxn = aCxn;
|
||||
|
||||
std::unordered_set<OUString> aIdsToRemove;
|
||||
@@ -310,7 +309,7 @@ bool DiagramData::removeNode(const OUString& rNodeId)
|
||||
if (!aParCxn.msSibTransId.isEmpty())
|
||||
aIdsToRemove.insert(aParCxn.msSibTransId);
|
||||
|
||||
for (const dgm::Point& rPoint : maPoints)
|
||||
for (const svx::diagram::Point& rPoint : maPoints)
|
||||
if (aIdsToRemove.count(rPoint.msPresentationAssociationId))
|
||||
aIdsToRemove.insert(rPoint.msModelId);
|
||||
|
||||
@@ -322,14 +321,14 @@ bool DiagramData::removeNode(const OUString& rNodeId)
|
||||
|
||||
// remove connections
|
||||
maConnections.erase(std::remove_if(maConnections.begin(), maConnections.end(),
|
||||
[aIdsToRemove](const dgm::Connection& rCxn) {
|
||||
[aIdsToRemove](const svx::diagram::Connection& rCxn) {
|
||||
return aIdsToRemove.count(rCxn.msSourceId) || aIdsToRemove.count(rCxn.msDestId);
|
||||
}),
|
||||
maConnections.end());
|
||||
|
||||
// remove data and presentation nodes
|
||||
maPoints.erase(std::remove_if(maPoints.begin(), maPoints.end(),
|
||||
[aIdsToRemove](const dgm::Point& rPoint) {
|
||||
[aIdsToRemove](const svx::diagram::Point& rPoint) {
|
||||
return aIdsToRemove.count(rPoint.msModelId);
|
||||
}),
|
||||
maPoints.end());
|
||||
@@ -361,7 +360,7 @@ OString normalizeDotName( const OUString& rStr )
|
||||
#endif
|
||||
|
||||
static sal_Int32 calcDepth( std::u16string_view rNodeName,
|
||||
const dgm::Connections& rCnx )
|
||||
const svx::diagram::Connections& rCnx )
|
||||
{
|
||||
// find length of longest path in 'isChild' graph, ending with rNodeName
|
||||
for (auto const& elem : rCnx)
|
||||
@@ -370,7 +369,7 @@ static sal_Int32 calcDepth( std::u16string_view rNodeName,
|
||||
!elem.msSibTransId.isEmpty() &&
|
||||
!elem.msSourceId.isEmpty() &&
|
||||
!elem.msDestId.isEmpty() &&
|
||||
elem.mnType == XML_parOf &&
|
||||
elem.mnXMLType == svx::diagram::TypeConstant::XML_parOf &&
|
||||
rNodeName == elem.msDestId )
|
||||
{
|
||||
return calcDepth(elem.msSourceId, rCnx) + 1;
|
||||
@@ -399,7 +398,7 @@ void DiagramData::build(bool bClearOoxShapes)
|
||||
|
||||
output << "digraph datatree {" << std::endl;
|
||||
#endif
|
||||
dgm::Points& rPoints = getPoints();
|
||||
svx::diagram::Points& rPoints = getPoints();
|
||||
for (auto & point : rPoints)
|
||||
{
|
||||
#ifdef DEBUG_OOX_DIAGRAM
|
||||
@@ -470,7 +469,7 @@ void DiagramData::build(bool bClearOoxShapes)
|
||||
}
|
||||
}
|
||||
|
||||
const dgm::Connections& rConnections = getConnections();
|
||||
const svx::diagram::Connections& rConnections = getConnections();
|
||||
for (auto const& connection : rConnections)
|
||||
{
|
||||
#ifdef DEBUG_OOX_DIAGRAM
|
||||
@@ -527,7 +526,7 @@ void DiagramData::build(bool bClearOoxShapes)
|
||||
|
||||
SAL_WARN_IF(!bInserted1, "oox.drawingml", "DiagramData::build(): non-unique connection model id");
|
||||
|
||||
if( connection.mnType == XML_presOf )
|
||||
if( connection.mnXMLType == svx::diagram::TypeConstant::XML_presOf )
|
||||
{
|
||||
DiagramData::StringMap::value_type::second_type& rVec = getPresOfNameMap()[connection.msDestId];
|
||||
rVec[connection.mnDestOrder] = { connection.msSourceId, sal_Int32(0) };
|
||||
|
||||
@@ -26,130 +26,21 @@
|
||||
|
||||
#include <rtl/ustring.hxx>
|
||||
|
||||
#include <svx/diagram/datamodel.hxx>
|
||||
#include <oox/drawingml/drawingmltypes.hxx>
|
||||
#include <oox/helper/helper.hxx>
|
||||
#include <oox/token/tokens.hxx>
|
||||
|
||||
namespace oox::drawingml {
|
||||
|
||||
namespace dgm {
|
||||
|
||||
/** A Connection
|
||||
*/
|
||||
struct Connection
|
||||
{
|
||||
Connection() :
|
||||
mnType( 0 ),
|
||||
mnSourceOrder( 0 ),
|
||||
mnDestOrder( 0 )
|
||||
{}
|
||||
|
||||
void dump() const;
|
||||
|
||||
sal_Int32 mnType;
|
||||
OUString msModelId;
|
||||
OUString msSourceId;
|
||||
OUString msDestId;
|
||||
OUString msParTransId;
|
||||
OUString msPresId;
|
||||
OUString msSibTransId;
|
||||
sal_Int32 mnSourceOrder;
|
||||
sal_Int32 mnDestOrder;
|
||||
|
||||
};
|
||||
|
||||
typedef std::vector< Connection > Connections;
|
||||
|
||||
/** A point
|
||||
*/
|
||||
struct Point
|
||||
{
|
||||
Point() :
|
||||
mnType(0),
|
||||
mnMaxChildren(-1),
|
||||
mnPreferredChildren(-1),
|
||||
mnDirection(XML_norm),
|
||||
mnResizeHandles(XML_rel),
|
||||
mnCustomAngle(-1),
|
||||
mnPercentageNeighbourWidth(-1),
|
||||
mnPercentageNeighbourHeight(-1),
|
||||
mnPercentageOwnWidth(-1),
|
||||
mnPercentageOwnHeight(-1),
|
||||
mnIncludeAngleScale(-1),
|
||||
mnRadiusScale(-1),
|
||||
mnWidthScale(-1),
|
||||
mnHeightScale(-1),
|
||||
mnWidthOverride(-1),
|
||||
mnHeightOverride(-1),
|
||||
mnLayoutStyleCount(-1),
|
||||
mnLayoutStyleIndex(-1),
|
||||
|
||||
mbOrgChartEnabled(false),
|
||||
mbBulletEnabled(false),
|
||||
mbCoherent3DOffset(false),
|
||||
mbCustomHorizontalFlip(false),
|
||||
mbCustomVerticalFlip(false),
|
||||
mbCustomText(false),
|
||||
mbIsPlaceholder(false)
|
||||
{}
|
||||
|
||||
void dump(const Shape* pShape) const;
|
||||
|
||||
OUString msCnxId;
|
||||
OUString msModelId;
|
||||
OUString msColorTransformCategoryId;
|
||||
OUString msColorTransformTypeId;
|
||||
OUString msLayoutCategoryId;
|
||||
OUString msLayoutTypeId;
|
||||
OUString msPlaceholderText;
|
||||
OUString msPresentationAssociationId;
|
||||
OUString msPresentationLayoutName;
|
||||
OUString msPresentationLayoutStyleLabel;
|
||||
OUString msQuickStyleCategoryId;
|
||||
OUString msQuickStyleTypeId;
|
||||
|
||||
sal_Int32 mnType;
|
||||
sal_Int32 mnMaxChildren;
|
||||
sal_Int32 mnPreferredChildren;
|
||||
sal_Int32 mnDirection;
|
||||
OptValue<sal_Int32> moHierarchyBranch;
|
||||
sal_Int32 mnResizeHandles;
|
||||
sal_Int32 mnCustomAngle;
|
||||
sal_Int32 mnPercentageNeighbourWidth;
|
||||
sal_Int32 mnPercentageNeighbourHeight;
|
||||
sal_Int32 mnPercentageOwnWidth;
|
||||
sal_Int32 mnPercentageOwnHeight;
|
||||
sal_Int32 mnIncludeAngleScale;
|
||||
sal_Int32 mnRadiusScale;
|
||||
sal_Int32 mnWidthScale;
|
||||
sal_Int32 mnHeightScale;
|
||||
sal_Int32 mnWidthOverride;
|
||||
sal_Int32 mnHeightOverride;
|
||||
sal_Int32 mnLayoutStyleCount;
|
||||
sal_Int32 mnLayoutStyleIndex;
|
||||
|
||||
bool mbOrgChartEnabled;
|
||||
bool mbBulletEnabled;
|
||||
bool mbCoherent3DOffset;
|
||||
bool mbCustomHorizontalFlip;
|
||||
bool mbCustomVerticalFlip;
|
||||
bool mbCustomText;
|
||||
bool mbIsPlaceholder;
|
||||
};
|
||||
|
||||
typedef std::vector< Point > Points;
|
||||
|
||||
}
|
||||
|
||||
// class DiagramData : public DiagramDataInterface
|
||||
class DiagramData
|
||||
{
|
||||
public:
|
||||
typedef std::map< OUString, ShapePtr > PointShapeMap;
|
||||
typedef std::map< OUString, TextBodyPtr > PointTextMap;
|
||||
typedef std::map< OUString, dgm::Point* > PointNameMap;
|
||||
typedef std::map< OUString, std::vector<dgm::Point*> > PointsNameMap;
|
||||
typedef std::map< OUString, const dgm::Connection* > ConnectionNameMap;
|
||||
typedef std::map< OUString, svx::diagram::Point* > PointNameMap;
|
||||
typedef std::map< OUString, std::vector< svx::diagram::Point* > > PointsNameMap;
|
||||
typedef std::map< OUString, const svx::diagram::Connection* > ConnectionNameMap;
|
||||
|
||||
struct SourceIdAndDepth
|
||||
{
|
||||
@@ -168,9 +59,9 @@ public:
|
||||
|
||||
FillPropertiesPtr & getFillProperties()
|
||||
{ return mpFillProperties; }
|
||||
dgm::Connections & getConnections()
|
||||
svx::diagram::Connections & getConnections()
|
||||
{ return maConnections; }
|
||||
dgm::Points & getPoints()
|
||||
svx::diagram::Points & getPoints()
|
||||
{ return maPoints; }
|
||||
StringMap & getPresOfNameMap()
|
||||
{ return maPresOfNameMap; }
|
||||
@@ -180,7 +71,7 @@ public:
|
||||
{ return maPointsPresNameMap; }
|
||||
::std::vector<OUString> &getExtDrawings()
|
||||
{ return maExtDrawings; }
|
||||
const dgm::Point* getRootPoint() const;
|
||||
const svx::diagram::Point* getRootPoint() const;
|
||||
void dump() const;
|
||||
|
||||
OUString getString() const;
|
||||
@@ -188,28 +79,28 @@ public:
|
||||
OUString addNode(const OUString& rText);
|
||||
bool removeNode(const OUString& rNodeId);
|
||||
|
||||
Shape* getOrCreateAssociatedShape(const dgm::Point& rPoint, bool bCreateOnDemand = false) const;
|
||||
Shape* getOrCreateAssociatedShape(const svx::diagram::Point& rPoint, bool bCreateOnDemand = false) const;
|
||||
|
||||
// get/set data between Diagram DataModel and oox::drawingml::Shape
|
||||
void secureDataFromShapeToModelAfterDiagramImport();
|
||||
void restoreDataFromModelToShapeAfterReCreation(const dgm::Point& rPoint, Shape& rNewShape) const;
|
||||
void restoreDataFromModelToShapeAfterReCreation(const svx::diagram::Point& rPoint, Shape& rNewShape) const;
|
||||
|
||||
private:
|
||||
void getChildrenString(OUStringBuffer& rBuf, const dgm::Point* pPoint, sal_Int32 nLevel) const;
|
||||
void addConnection(sal_Int32 nType, const OUString& sSourceId, const OUString& sDestId);
|
||||
void getChildrenString(OUStringBuffer& rBuf, const svx::diagram::Point* pPoint, sal_Int32 nLevel) const;
|
||||
void addConnection(svx::diagram::TypeConstant nType, const OUString& sSourceId, const OUString& sDestId);
|
||||
|
||||
// evtl. existing alternative imported visualization identifier
|
||||
::std::vector<OUString> maExtDrawings;
|
||||
|
||||
// the model definition,
|
||||
// - FillStyle
|
||||
// - Texts for oox::drawingml::Points/dgm::Points, associated by ModelId
|
||||
// - Texts for oox::drawingml::Points/svx::diagram::Points, associated by ModelId
|
||||
// - logic connections/associations
|
||||
// - data point entries
|
||||
FillPropertiesPtr mpFillProperties;
|
||||
PointTextMap maPointTextMap;
|
||||
dgm::Connections maConnections;
|
||||
dgm::Points maPoints;
|
||||
svx::diagram::Connections maConnections;
|
||||
svx::diagram::Points maPoints;
|
||||
|
||||
// temporary processing data
|
||||
PointShapeMap maPointShapeMap;
|
||||
|
||||
@@ -39,7 +39,7 @@ class CxnListContext
|
||||
{
|
||||
public:
|
||||
CxnListContext( ContextHandler2Helper const & rParent,
|
||||
dgm::Connections & aConnections )
|
||||
svx::diagram::Connections & aConnections )
|
||||
: ContextHandler2( rParent )
|
||||
, mrConnection( aConnections )
|
||||
{
|
||||
@@ -54,9 +54,9 @@ public:
|
||||
case DGM_TOKEN( cxn ):
|
||||
{
|
||||
mrConnection.emplace_back( );
|
||||
dgm::Connection& rConnection=mrConnection.back();
|
||||
svx::diagram::Connection& rConnection=mrConnection.back();
|
||||
|
||||
rConnection.mnType = rAttribs.getToken( XML_type, XML_parOf );
|
||||
rConnection.mnXMLType = static_cast<svx::diagram::TypeConstant>(rAttribs.getToken( XML_type, XML_parOf ));
|
||||
rConnection.msModelId = rAttribs.getString( XML_modelId ).get();
|
||||
rConnection.msSourceId = rAttribs.getString( XML_srcId ).get();
|
||||
rConnection.msDestId = rAttribs.getString( XML_destId ).get();
|
||||
@@ -76,7 +76,7 @@ public:
|
||||
return this;
|
||||
}
|
||||
private:
|
||||
dgm::Connections& mrConnection;
|
||||
svx::diagram::Connections& mrConnection;
|
||||
};
|
||||
|
||||
// CT_presLayoutVars
|
||||
@@ -85,7 +85,7 @@ class PresLayoutVarsContext
|
||||
{
|
||||
public:
|
||||
PresLayoutVarsContext( ContextHandler2Helper const & rParent,
|
||||
dgm::Point & rPoint ) :
|
||||
svx::diagram::Point & rPoint ) :
|
||||
ContextHandler2( rParent ),
|
||||
mrPoint( rPoint )
|
||||
{
|
||||
@@ -113,8 +113,13 @@ public:
|
||||
mrPoint.mnDirection = rAttribs.getToken( XML_val, XML_norm );
|
||||
break;
|
||||
case DGM_TOKEN( hierBranch ):
|
||||
mrPoint.moHierarchyBranch = rAttribs.getToken( XML_val );
|
||||
{
|
||||
// need to convert from oox::OptValue to std::optional since 1st is not available in svx
|
||||
const OptValue< sal_Int32 > aOptVal(rAttribs.getToken( XML_val ));
|
||||
if(aOptVal.has())
|
||||
mrPoint.moHierarchyBranch = aOptVal.get();
|
||||
break;
|
||||
}
|
||||
case DGM_TOKEN( orgChart ):
|
||||
mrPoint.mbOrgChartEnabled = rAttribs.getBool( XML_val, false );
|
||||
break;
|
||||
@@ -129,7 +134,7 @@ public:
|
||||
}
|
||||
|
||||
private:
|
||||
dgm::Point& mrPoint;
|
||||
svx::diagram::Point& mrPoint;
|
||||
};
|
||||
|
||||
// CT_prSet
|
||||
@@ -138,7 +143,7 @@ class PropertiesContext
|
||||
{
|
||||
public:
|
||||
PropertiesContext( ContextHandler2Helper const & rParent,
|
||||
dgm::Point & rPoint,
|
||||
svx::diagram::Point & rPoint,
|
||||
const AttributeList& rAttribs ) :
|
||||
ContextHandler2( rParent ),
|
||||
mrPoint( rPoint )
|
||||
@@ -193,7 +198,7 @@ public:
|
||||
}
|
||||
|
||||
private:
|
||||
dgm::Point& mrPoint;
|
||||
svx::diagram::Point& mrPoint;
|
||||
};
|
||||
|
||||
// CL_Pt
|
||||
@@ -203,7 +208,7 @@ class PtContext
|
||||
public:
|
||||
PtContext( ContextHandler2Helper const & rParent,
|
||||
const AttributeList& rAttribs,
|
||||
dgm::Point & rPoint,
|
||||
svx::diagram::Point & rPoint,
|
||||
DiagramData& rDiagramData):
|
||||
ContextHandler2( rParent ),
|
||||
mrPoint( rPoint ),
|
||||
@@ -213,7 +218,7 @@ public:
|
||||
|
||||
// the default type is XML_node
|
||||
const sal_Int32 nType = rAttribs.getToken( XML_type, XML_node );
|
||||
mrPoint.mnType = nType;
|
||||
mrPoint.mnXMLType = static_cast<svx::diagram::TypeConstant>(nType);
|
||||
|
||||
// ignore the cxnId unless it is this type. See 5.15.3.1.3 in Primer
|
||||
if( ( nType == XML_parTrans ) || ( nType == XML_sibTrans ) )
|
||||
@@ -249,7 +254,7 @@ public:
|
||||
}
|
||||
|
||||
private:
|
||||
dgm::Point& mrPoint;
|
||||
svx::diagram::Point& mrPoint;
|
||||
DiagramData& mrDiagramData;
|
||||
};
|
||||
|
||||
@@ -258,7 +263,7 @@ class PtListContext
|
||||
: public ContextHandler2
|
||||
{
|
||||
public:
|
||||
PtListContext( ContextHandler2Helper const & rParent, dgm::Points& rPoints, DiagramData& rDiagramData) :
|
||||
PtListContext( ContextHandler2Helper const & rParent, svx::diagram::Points& rPoints, DiagramData& rDiagramData) :
|
||||
ContextHandler2( rParent ),
|
||||
mrPoints( rPoints ),
|
||||
mrDiagramData( rDiagramData )
|
||||
@@ -282,7 +287,7 @@ public:
|
||||
}
|
||||
|
||||
private:
|
||||
dgm::Points& mrPoints;
|
||||
svx::diagram::Points& mrPoints;
|
||||
DiagramData& mrDiagramData;
|
||||
};
|
||||
|
||||
|
||||
@@ -111,7 +111,7 @@ void Diagram::addTo( const ShapePtr & pParentShape )
|
||||
|
||||
pParentShape->setChildSize(pParentShape->getSize());
|
||||
|
||||
const dgm::Point* pRootPoint = mpData->getRootPoint();
|
||||
const svx::diagram::Point* pRootPoint = mpData->getRootPoint();
|
||||
if (mpLayout->getNode() && pRootPoint)
|
||||
{
|
||||
// create Shape hierarchy
|
||||
|
||||
@@ -39,12 +39,10 @@ class Diagram;
|
||||
class LayoutNode;
|
||||
typedef std::shared_ptr< LayoutNode > LayoutNodePtr;
|
||||
class LayoutAtom;
|
||||
typedef std::shared_ptr<LayoutAtom> LayoutAtomPtr;
|
||||
|
||||
typedef std::shared_ptr< LayoutAtom > LayoutAtomPtr;
|
||||
typedef std::map< OUString, css::uno::Reference<css::xml::dom::XDocument> > DiagramDomMap;
|
||||
|
||||
typedef std::map<OUString, LayoutAtomPtr> LayoutAtomMap;
|
||||
typedef std::map<const dgm::Point*, ShapePtr> PresPointShapeMap;
|
||||
typedef std::map< OUString, LayoutAtomPtr > LayoutAtomMap;
|
||||
typedef std::map< const svx::diagram::Point*, ShapePtr > PresPointShapeMap;
|
||||
|
||||
class DiagramLayout
|
||||
{
|
||||
|
||||
@@ -834,12 +834,12 @@ namespace
|
||||
* Takes the connection list from rLayoutNode, navigates from rFrom on an edge
|
||||
* of type nType, using a direction determined by bSourceToDestination.
|
||||
*/
|
||||
OUString navigate(LayoutNode& rLayoutNode, sal_Int32 nType, std::u16string_view rFrom,
|
||||
OUString navigate(LayoutNode& rLayoutNode, svx::diagram::TypeConstant nType, std::u16string_view rFrom,
|
||||
bool bSourceToDestination)
|
||||
{
|
||||
for (const auto& rConnection : rLayoutNode.getDiagram().getData()->getConnections())
|
||||
{
|
||||
if (rConnection.mnType != nType)
|
||||
if (rConnection.mnXMLType != nType)
|
||||
continue;
|
||||
|
||||
if (bSourceToDestination)
|
||||
@@ -857,37 +857,37 @@ OUString navigate(LayoutNode& rLayoutNode, sal_Int32 nType, std::u16string_view
|
||||
return OUString();
|
||||
}
|
||||
|
||||
sal_Int32 calcMaxDepth(std::u16string_view rNodeName, const dgm::Connections& rConnections)
|
||||
sal_Int32 calcMaxDepth(std::u16string_view rNodeName, const svx::diagram::Connections& rConnections)
|
||||
{
|
||||
sal_Int32 nMaxLength = 0;
|
||||
for (auto const& aCxn : rConnections)
|
||||
if (aCxn.mnType == XML_parOf && aCxn.msSourceId == rNodeName)
|
||||
if (aCxn.mnXMLType == svx::diagram::TypeConstant::XML_parOf && aCxn.msSourceId == rNodeName)
|
||||
nMaxLength = std::max(nMaxLength, calcMaxDepth(aCxn.msDestId, rConnections) + 1);
|
||||
|
||||
return nMaxLength;
|
||||
}
|
||||
}
|
||||
|
||||
sal_Int32 ConditionAtom::getNodeCount(const dgm::Point* pPresPoint) const
|
||||
sal_Int32 ConditionAtom::getNodeCount(const svx::diagram::Point* pPresPoint) const
|
||||
{
|
||||
sal_Int32 nCount = 0;
|
||||
OUString sNodeId = pPresPoint->msPresentationAssociationId;
|
||||
|
||||
// HACK: special case - count children of first child
|
||||
if (maIter.maAxis.size() == 2 && maIter.maAxis[0] == XML_ch && maIter.maAxis[1] == XML_ch)
|
||||
sNodeId = navigate(mrLayoutNode, XML_parOf, sNodeId, /*bSourceToDestination*/ true);
|
||||
sNodeId = navigate(mrLayoutNode, svx::diagram::TypeConstant::XML_parOf, sNodeId, /*bSourceToDestination*/ true);
|
||||
|
||||
if (!sNodeId.isEmpty())
|
||||
{
|
||||
for (const auto& aCxn : mrLayoutNode.getDiagram().getData()->getConnections())
|
||||
if (aCxn.mnType == XML_parOf && aCxn.msSourceId == sNodeId)
|
||||
if (aCxn.mnXMLType == svx::diagram::TypeConstant::XML_parOf && aCxn.msSourceId == sNodeId)
|
||||
nCount++;
|
||||
}
|
||||
|
||||
return nCount;
|
||||
}
|
||||
|
||||
bool ConditionAtom::getDecision(const dgm::Point* pPresPoint) const
|
||||
bool ConditionAtom::getDecision(const svx::diagram::Point* pPresPoint) const
|
||||
{
|
||||
if (mIsElse)
|
||||
return true;
|
||||
@@ -902,21 +902,21 @@ bool ConditionAtom::getDecision(const dgm::Point* pPresPoint) const
|
||||
return compareResult(maCond.mnOp, pPresPoint->mnDirection, maCond.mnVal);
|
||||
else if (maCond.mnArg == XML_hierBranch)
|
||||
{
|
||||
sal_Int32 nHierarchyBranch = pPresPoint->moHierarchyBranch.get(XML_std);
|
||||
if (!pPresPoint->moHierarchyBranch.has())
|
||||
sal_Int32 nHierarchyBranch = pPresPoint->moHierarchyBranch.value_or(XML_std);
|
||||
if (!pPresPoint->moHierarchyBranch.has_value())
|
||||
{
|
||||
// If <dgm:hierBranch> is missing in the current presentation
|
||||
// point, ask the parent.
|
||||
OUString aParent = navigate(mrLayoutNode, XML_presParOf, pPresPoint->msModelId,
|
||||
OUString aParent = navigate(mrLayoutNode, svx::diagram::TypeConstant::XML_presParOf, pPresPoint->msModelId,
|
||||
/*bSourceToDestination*/ false);
|
||||
DiagramData::PointNameMap& rPointNameMap
|
||||
= mrLayoutNode.getDiagram().getData()->getPointNameMap();
|
||||
auto it = rPointNameMap.find(aParent);
|
||||
if (it != rPointNameMap.end())
|
||||
{
|
||||
const dgm::Point* pParent = it->second;
|
||||
if (pParent->moHierarchyBranch.has())
|
||||
nHierarchyBranch = pParent->moHierarchyBranch.get();
|
||||
const svx::diagram::Point* pParent = it->second;
|
||||
if (pParent->moHierarchyBranch.has_value())
|
||||
nHierarchyBranch = pParent->moHierarchyBranch.value();
|
||||
}
|
||||
}
|
||||
return compareResult(maCond.mnOp, nHierarchyBranch, maCond.mnVal);
|
||||
@@ -1080,7 +1080,7 @@ bool HasCustomText(const ShapePtr& rShape, LayoutNode& rLayoutNode)
|
||||
const DiagramData::PointNameMap& rPointNameMap
|
||||
= rLayoutNode.getDiagram().getData()->getPointNameMap();
|
||||
// Get the first presentation node of the shape.
|
||||
const dgm::Point* pPresNode = nullptr;
|
||||
const svx::diagram::Point* pPresNode = nullptr;
|
||||
for (const auto& rPair : rPresPointShapeMap)
|
||||
{
|
||||
if (rPair.second == rShape)
|
||||
@@ -1090,7 +1090,7 @@ bool HasCustomText(const ShapePtr& rShape, LayoutNode& rLayoutNode)
|
||||
}
|
||||
}
|
||||
// Get the first data node of the presentation node.
|
||||
dgm::Point* pDataNode = nullptr;
|
||||
svx::diagram::Point* pDataNode = nullptr;
|
||||
if (pPresNode)
|
||||
{
|
||||
auto itPresToData = rPresOfNameMap.find(pPresNode->msModelId);
|
||||
@@ -1866,7 +1866,7 @@ void LayoutNode::accept( LayoutAtomVisitor& rVisitor )
|
||||
rVisitor.visit(*this);
|
||||
}
|
||||
|
||||
bool LayoutNode::setupShape( const ShapePtr& rShape, const dgm::Point* pPresNode, sal_Int32 nCurrIdx ) const
|
||||
bool LayoutNode::setupShape( const ShapePtr& rShape, const svx::diagram::Point* pPresNode, sal_Int32 nCurrIdx ) const
|
||||
{
|
||||
SAL_INFO(
|
||||
"oox.drawingml",
|
||||
@@ -1905,7 +1905,7 @@ bool LayoutNode::setupShape( const ShapePtr& rShape, const dgm::Point* pPresNode
|
||||
continue;
|
||||
}
|
||||
|
||||
rShape->setDataNodeType(aDataNode2->second->mnType);
|
||||
rShape->setDataNodeType(aDataNode2->second->mnXMLType);
|
||||
|
||||
if (rItem.mnDepth == 0)
|
||||
{
|
||||
|
||||
@@ -276,11 +276,11 @@ class ConditionAtom
|
||||
public:
|
||||
explicit ConditionAtom(LayoutNode& rLayoutNode, bool isElse, const css::uno::Reference< css::xml::sax::XFastAttributeList >& xAttributes);
|
||||
virtual void accept( LayoutAtomVisitor& ) override;
|
||||
bool getDecision(const dgm::Point* pPresPoint) const;
|
||||
bool getDecision(const svx::diagram::Point* pPresPoint) const;
|
||||
|
||||
private:
|
||||
static bool compareResult(sal_Int32 nOperator, sal_Int32 nFirst, sal_Int32 nSecond);
|
||||
sal_Int32 getNodeCount(const dgm::Point* pPresPoint) const;
|
||||
sal_Int32 getNodeCount(const svx::diagram::Point* pPresPoint) const;
|
||||
|
||||
bool mIsElse;
|
||||
IteratorAttr maIter;
|
||||
@@ -333,7 +333,7 @@ public:
|
||||
{ mpNodeShapes.push_back(pShape); }
|
||||
|
||||
bool setupShape( const ShapePtr& rShape,
|
||||
const dgm::Point* pPresNode,
|
||||
const svx::diagram::Point* pPresNode,
|
||||
sal_Int32 nCurrIdx ) const;
|
||||
|
||||
const LayoutNode* getParentLayoutNode() const;
|
||||
|
||||
@@ -116,7 +116,7 @@ void LayoutAtomVisitorBase::visit(LayoutNode& rAtom)
|
||||
|| mnCurrIdx >= static_cast<sal_Int32>(aDataNode->second.size()))
|
||||
return;
|
||||
|
||||
const dgm::Point* pNewNode = aDataNode->second.at(mnCurrIdx);
|
||||
const svx::diagram::Point* pNewNode = aDataNode->second.at(mnCurrIdx);
|
||||
if (!mpCurrentNode || !pNewNode)
|
||||
return;
|
||||
|
||||
@@ -129,7 +129,7 @@ void LayoutAtomVisitorBase::visit(LayoutNode& rAtom)
|
||||
if (!bIsChild)
|
||||
return;
|
||||
|
||||
const dgm::Point* pPreviousNode = mpCurrentNode;
|
||||
const svx::diagram::Point* pPreviousNode = mpCurrentNode;
|
||||
mpCurrentNode = pNewNode;
|
||||
|
||||
defaultVisit(rAtom);
|
||||
|
||||
@@ -43,7 +43,7 @@ struct LayoutAtomVisitor
|
||||
class LayoutAtomVisitorBase : public LayoutAtomVisitor
|
||||
{
|
||||
public:
|
||||
LayoutAtomVisitorBase(const Diagram& rDgm, const dgm::Point* pRootPoint) :
|
||||
LayoutAtomVisitorBase(const Diagram& rDgm, const svx::diagram::Point* pRootPoint) :
|
||||
mrDgm(rDgm),
|
||||
mpCurrentNode(pRootPoint),
|
||||
mnCurrIdx(0),
|
||||
@@ -62,7 +62,7 @@ public:
|
||||
|
||||
protected:
|
||||
const Diagram& mrDgm;
|
||||
const dgm::Point* mpCurrentNode;
|
||||
const svx::diagram::Point* mpCurrentNode;
|
||||
sal_Int32 mnCurrIdx;
|
||||
sal_Int32 mnCurrStep;
|
||||
sal_Int32 mnCurrCnt;
|
||||
@@ -72,7 +72,7 @@ protected:
|
||||
class ShallowPresNameVisitor : public LayoutAtomVisitorBase
|
||||
{
|
||||
public:
|
||||
explicit ShallowPresNameVisitor(const Diagram& rDgm, const dgm::Point* pRootPoint) :
|
||||
explicit ShallowPresNameVisitor(const Diagram& rDgm, const svx::diagram::Point* pRootPoint) :
|
||||
LayoutAtomVisitorBase(rDgm, pRootPoint),
|
||||
mnCnt(0)
|
||||
{}
|
||||
|
||||
@@ -62,7 +62,7 @@ void ShapeCreationVisitor::visit(LayoutNode& rAtom)
|
||||
|| mnCurrIdx >= static_cast<sal_Int32>(aDataNode->second.size()))
|
||||
return;
|
||||
|
||||
const dgm::Point* pNewNode = aDataNode->second.at(mnCurrIdx);
|
||||
const svx::diagram::Point* pNewNode = aDataNode->second.at(mnCurrIdx);
|
||||
if (!mpCurrentNode || !pNewNode)
|
||||
return;
|
||||
|
||||
@@ -117,7 +117,7 @@ void ShapeCreationVisitor::visit(LayoutNode& rAtom)
|
||||
}
|
||||
}
|
||||
|
||||
const dgm::Point* pPreviousNode = mpCurrentNode;
|
||||
const svx::diagram::Point* pPreviousNode = mpCurrentNode;
|
||||
mpCurrentNode = pNewNode;
|
||||
|
||||
// set new parent for children
|
||||
@@ -222,7 +222,7 @@ void ShapeLayoutingVisitor::visit(LayoutNode& rAtom)
|
||||
|| mnCurrIdx >= static_cast<sal_Int32>(aDataNode->second.size()))
|
||||
return;
|
||||
|
||||
const dgm::Point* pNewNode = aDataNode->second.at(mnCurrIdx);
|
||||
const svx::diagram::Point* pNewNode = aDataNode->second.at(mnCurrIdx);
|
||||
if (!mpCurrentNode || !pNewNode)
|
||||
return;
|
||||
|
||||
@@ -237,7 +237,7 @@ void ShapeLayoutingVisitor::visit(LayoutNode& rAtom)
|
||||
|
||||
size_t nParentConstraintsNumber = maConstraints.size();
|
||||
|
||||
const dgm::Point* pPreviousNode = mpCurrentNode;
|
||||
const svx::diagram::Point* pPreviousNode = mpCurrentNode;
|
||||
mpCurrentNode = pNewNode;
|
||||
|
||||
// process alg atoms first, nested layout nodes afterwards
|
||||
|
||||
@@ -31,7 +31,7 @@ class ShapeCreationVisitor : public LayoutAtomVisitorBase
|
||||
{
|
||||
public:
|
||||
ShapeCreationVisitor(const Diagram& rDgm,
|
||||
const dgm::Point* pRootPoint,
|
||||
const svx::diagram::Point* pRootPoint,
|
||||
const ShapePtr& rParentShape) :
|
||||
LayoutAtomVisitorBase(rDgm, pRootPoint),
|
||||
mpParentShape(rParentShape)
|
||||
@@ -51,7 +51,7 @@ private:
|
||||
class ShapeTemplateVisitor : public LayoutAtomVisitorBase
|
||||
{
|
||||
public:
|
||||
ShapeTemplateVisitor(const Diagram& rDgm, const dgm::Point* pRootPoint)
|
||||
ShapeTemplateVisitor(const Diagram& rDgm, const svx::diagram::Point* pRootPoint)
|
||||
: LayoutAtomVisitorBase(rDgm, pRootPoint)
|
||||
{}
|
||||
|
||||
@@ -73,7 +73,7 @@ private:
|
||||
class ShapeLayoutingVisitor : public LayoutAtomVisitorBase
|
||||
{
|
||||
public:
|
||||
ShapeLayoutingVisitor(const Diagram& rDgm, const dgm::Point* pRootPoint) :
|
||||
ShapeLayoutingVisitor(const Diagram& rDgm, const svx::diagram::Point* pRootPoint) :
|
||||
LayoutAtomVisitorBase(rDgm, pRootPoint)
|
||||
{}
|
||||
|
||||
|
||||
@@ -5949,6 +5949,7 @@ include/svx/sdgmoitm.hxx
|
||||
include/svx/sdmetitm.hxx
|
||||
include/svx/sdooitm.hxx
|
||||
include/svx/sdprcitm.hxx
|
||||
include/svx/diagram/datamodel.hxx
|
||||
include/svx/sdr/animation/animationstate.hxx
|
||||
include/svx/sdr/animation/objectanimator.hxx
|
||||
include/svx/sdr/animation/scheduler.hxx
|
||||
@@ -11512,6 +11513,7 @@ svx/source/customshapes/EnhancedCustomShapeGeometry.cxx
|
||||
svx/source/customshapes/EnhancedCustomShapeHandle.cxx
|
||||
svx/source/customshapes/EnhancedCustomShapeHandle.hxx
|
||||
svx/source/customshapes/EnhancedCustomShapeTypeNames.cxx
|
||||
svx/source/diagram/datamodel.cxx
|
||||
svx/source/dialog/ClassificationDialog.cxx
|
||||
svx/source/dialog/ClassificationEditView.cxx
|
||||
svx/source/dialog/ClassificationEditView.hxx
|
||||
|
||||
@@ -110,6 +110,7 @@ $(eval $(call gb_Library_add_exception_objects,svxcore,\
|
||||
svx/source/customshapes/EnhancedCustomShapeFunctionParser \
|
||||
svx/source/customshapes/EnhancedCustomShapeGeometry \
|
||||
svx/source/customshapes/EnhancedCustomShapeTypeNames \
|
||||
svx/source/diagram/datamodel \
|
||||
svx/source/dialog/dialmgr \
|
||||
svx/source/dialog/dlgutil \
|
||||
svx/source/dialog/hexcolorcontrol \
|
||||
|
||||
@@ -0,0 +1,61 @@
|
||||
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
|
||||
/*
|
||||
* This file is part of the LibreOffice project.
|
||||
*
|
||||
* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
*
|
||||
* This file incorporates work covered by the following license notice:
|
||||
*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed
|
||||
* with this work for additional information regarding copyright
|
||||
* ownership. The ASF licenses this file to you under the Apache
|
||||
* License, Version 2.0 (the "License"); you may not use this file
|
||||
* except in compliance with the License. You may obtain a copy of
|
||||
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
|
||||
*/
|
||||
|
||||
#include <svx/diagram/datamodel.hxx>
|
||||
#include <sal/log.hxx>
|
||||
|
||||
namespace svx::diagram {
|
||||
|
||||
Connection::Connection()
|
||||
: mnXMLType( XML_none )
|
||||
, mnSourceOrder( 0 )
|
||||
, mnDestOrder( 0 )
|
||||
{}
|
||||
|
||||
Point::Point()
|
||||
: mnXMLType(XML_none)
|
||||
, mnMaxChildren(-1)
|
||||
, mnPreferredChildren(-1)
|
||||
, mnDirection(XML_norm)
|
||||
, mnResizeHandles(XML_rel)
|
||||
, mnCustomAngle(-1)
|
||||
, mnPercentageNeighbourWidth(-1)
|
||||
, mnPercentageNeighbourHeight(-1)
|
||||
, mnPercentageOwnWidth(-1)
|
||||
, mnPercentageOwnHeight(-1)
|
||||
, mnIncludeAngleScale(-1)
|
||||
, mnRadiusScale(-1)
|
||||
, mnWidthScale(-1)
|
||||
, mnHeightScale(-1)
|
||||
, mnWidthOverride(-1)
|
||||
, mnHeightOverride(-1)
|
||||
, mnLayoutStyleCount(-1)
|
||||
, mnLayoutStyleIndex(-1)
|
||||
, mbOrgChartEnabled(false)
|
||||
, mbBulletEnabled(false)
|
||||
, mbCoherent3DOffset(false)
|
||||
, mbCustomHorizontalFlip(false)
|
||||
, mbCustomVerticalFlip(false)
|
||||
, mbCustomText(false)
|
||||
, mbIsPlaceholder(false)
|
||||
{}
|
||||
|
||||
}
|
||||
|
||||
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|
||||
Reference in New Issue
Block a user