31#include <oox/token/properties.hxx>
38#include <com/sun/star/drawing/TextFitToSizeType.hpp>
49 const OUString& rInternalName, sal_Int32 nProperty)
51 std::optional<sal_Int32> oRet;
53 auto it = rProperties.find(rInternalName);
54 if (it != rProperties.end())
57 auto itProperty = rProperty.find(nProperty);
58 if (itProperty != rProperty.end())
59 oRet = itProperty->second;
69bool isFontUnit(sal_Int32 nUnit)
71 return nUnit == oox::XML_primFontSz || nUnit == oox::XML_secFontSz;
75sal_Int32 getPropertyFromConstraint(sal_Int32 nConstraint)
80 return oox::PROP_TextLeftDistance;
82 return oox::PROP_TextRightDistance;
84 return oox::PROP_TextUpperDistance;
86 return oox::PROP_TextLowerDistance;
98 if (pShape->getDataNodeType() == nType)
101 for (
const auto& pChild : pShape->getChildren())
103 if (containsDataNodeType(pChild, nType))
113 const std::vector<Constraint>& rConstraints)
115 if (rShape->getChildren().empty() || rShape->getSize().Width == 0
116 || rShape->getSize().Height == 0)
120 double fChildAspectRatio = rShape->getChildren()[0]->getAspectRatio();
121 double fShapeHeight = rShape->getSize().Height;
122 double fShapeWidth = rShape->getSize().Width;
125 if (fChildAspectRatio && fShapeHeight && fChildAspectRatio < (fShapeWidth / fShapeHeight))
127 fShapeWidth = fShapeHeight * fChildAspectRatio;
130 double fSpaceFromConstraint = 1.0;
132 std::map<sal_Int32, LayoutProperty> aPropertiesByType;
134 rParent[XML_w] = fShapeWidth;
135 rParent[XML_h] = fShapeHeight;
136 for (
const auto& rConstr : rConstraints)
138 if (rConstr.mnRefType == XML_w || rConstr.mnRefType == XML_h)
140 if (rConstr.mnType == XML_sp && rConstr.msForName.isEmpty())
141 fSpaceFromConstraint = rConstr.mfFactor;
144 auto itRefForName = aPropertiesByName.find(rConstr.msRefForName);
145 if (itRefForName == aPropertiesByName.end())
150 auto it = itRefForName->second.find(rConstr.mnRefType);
151 if (it == itRefForName->second.end())
156 if (rConstr.mfValue != 0.0)
161 sal_Int32
nValue = it->second * rConstr.mfFactor;
163 if (rConstr.mnPointType ==
XML_none)
165 aPropertiesByName[rConstr.msForName][rConstr.mnType] =
nValue;
169 aPropertiesByType[rConstr.mnPointType][rConstr.mnType] =
nValue;
173 std::vector<sal_Int32> aShapeWidths(rShape->getChildren().size());
174 for (
size_t i = 0;
i < rShape->getChildren().
size(); ++
i)
176 ShapePtr pChild = rShape->getChildren()[
i];
177 if (!pChild->getDataNodeType())
180 aShapeWidths[
i] = fShapeWidth;
184 auto itNodeType = aPropertiesByType.find(pChild->getDataNodeType());
185 if (itNodeType == aPropertiesByType.end())
187 aShapeWidths[
i] = fShapeWidth;
191 auto it = itNodeType->second.find(XML_w);
192 if (it == itNodeType->second.end())
194 aShapeWidths[
i] = fShapeWidth;
198 aShapeWidths[
i] = it->second;
201 bool bSpaceFromConstraints = fSpaceFromConstraint != 1.0;
204 const sal_Int32 nDir = rMap.count(XML_grDir) ? rMap.find(XML_grDir)->second : XML_tL;
207 bool bHorizontal =
true;
230 sal_Int32
nCount = rShape->getChildren().size();
232 double fSpace = bSpaceFromConstraints ? fSpaceFromConstraint : 0.3;
233 double fAspectRatio = 0.54;
237 sal_Int32 nMaxRowWidth = 0;
238 if (
nCount <= fChildAspectRatio)
244 for (; nRow <
nCount; nRow++)
246 nCol = std::ceil(
static_cast<double>(
nCount) / nRow);
247 sal_Int32 nRowWidth = 0;
248 for (sal_Int32
i = 0;
i < nCol; ++
i)
255 nRowWidth += aShapeWidths[
i];
257 double fTotalShapesHeight = fShapeHeight * nRow;
258 if (nRowWidth && fTotalShapesHeight / nRowWidth >= fAspectRatio)
260 if (nRowWidth > nMaxRowWidth)
262 nMaxRowWidth = nRowWidth;
269 SAL_INFO(
"oox.drawingml",
"Snake layout grid: " << nCol <<
"x" << nRow);
271 sal_Int32 nWidth = rShape->getSize().Width / (nCol + (nCol - 1) * fSpace);
272 awt::Size aChildSize(nWidth, nWidth * fAspectRatio);
273 if (nCol == 1 && nRow > 1)
279 sal_Int32 nNumSpaces = -1;
280 if (bSpaceFromConstraints)
282 sal_Int32 nHeight = rShape->getSize().Height / (nRow + (nRow + nNumSpaces) * fSpace);
284 if (fChildAspectRatio > 1)
287 nWidth = std::min(rShape->getSize().Width,
288 static_cast<sal_Int32
>(nHeight * fChildAspectRatio));
289 aChildSize = awt::Size(nWidth, nHeight);
295 awt::Point aCurrPos(0, 0);
297 aCurrPos.X = rShape->getSize().Width - aChildSize.Width;
299 aCurrPos.Y = rShape->getSize().Height - aChildSize.Height;
300 else if (bSpaceFromConstraints)
305 aCurrPos.Y = aChildSize.Height * fSpace * 2;
309 sal_Int32 nStartX = aCurrPos.X;
310 sal_Int32 nColIdx = 0,
index = 0;
312 const sal_Int32 aContDir
313 = rMap.count(XML_contDir) ? rMap.find(XML_contDir)->second : XML_sameDir;
319 sal_Int32 nRowHeight = 0;
320 for (
auto& aCurrShape : rShape->getChildren())
322 aCurrShape->setPosition(aCurrPos);
323 awt::Size aCurrSize(aChildSize);
326 bool bWidthsFromConstraints
328 if (bWidthsFromConstraints && nMaxRowWidth)
330 double fWidthFactor =
static_cast<double>(aShapeWidths[
index]) / nMaxRowWidth;
333 aCurrSize.Width = rShape->getSize().Width * fWidthFactor;
335 if (fChildAspectRatio)
337 aCurrSize.Height = aCurrSize.Width / fChildAspectRatio;
340 aCurrSize.Height = std::min<sal_Int32>(
341 aCurrSize.Height, rShape->getSize().Height / (nRow + (nRow - 1) * fSpace));
343 if (aCurrSize.Height > nRowHeight)
345 nRowHeight = aCurrSize.Height;
347 aCurrShape->setSize(aCurrSize);
348 aCurrShape->setChildSize(aCurrSize);
352 if (
index % nCol == 0 || ((
index / nCol) + 1) != nRow)
353 aCurrPos.X += nIncX * (aCurrSize.Width + fSpace * aCurrSize.Width);
355 if (++nColIdx == nCol)
358 if ((
index + 1) % nCol != 0 && (
index + 1) >= 3
359 && ((
index + 1) / nCol + 1) == nRow &&
nCount != nRow * nCol)
362 if (bWidthsFromConstraints)
364 aCurrPos.X = nStartX;
371 + (nIncX * (aCurrSize.Width + fSpace * aCurrSize.Width)) / 2;
376 aCurrPos.X = nStartX;
377 aCurrPos.Y += nIncY * (nRowHeight + fSpace * nRowHeight);
384 aCurrPos.X += (nIncX * (aCurrSize.Width + fSpace * aCurrSize.Width));
389 for (
auto& aCurrShape : rShape->getChildren())
391 aCurrShape->setPosition(aCurrPos);
392 aCurrShape->setSize(aChildSize);
393 aCurrShape->setChildSize(aChildSize);
404 if ((
index % nCol == 0 || ((
index / nCol) + 1) != nRow)
405 && ((
index / nCol) + 1) % 2 != 0)
406 aCurrPos.X += (aChildSize.Width + fSpace * aChildSize.Width);
407 else if (
index % nCol != 0
408 && ((
index / nCol) + 1) != nRow)
409 aCurrPos.X -= (aChildSize.Width + fSpace * aChildSize.Width);
411 if (++nColIdx == nCol)
414 if ((
index + 1) % nCol != 0 && (
index + 1) >= 4
415 && ((
index + 1) / nCol + 1) == nRow &&
nCount != nRow * nCol
416 && ((
index / nCol) + 1) % 2 == 0)
418 aCurrPos.X -= aChildSize.Width * 3 / 2;
419 else if ((
index + 1) % nCol != 0 && (
index + 1) >= 4
420 && ((
index + 1) / nCol + 1) == nRow &&
nCount != nRow * nCol
421 && ((
index / nCol) + 1) % 2 != 0)
423 + (nIncX * (aChildSize.Width + fSpace * aChildSize.Width)) / 2;
424 else if (((
index / nCol) + 1) % 2 != 0)
425 aCurrPos.X = nStartX;
427 aCurrPos.Y += nIncY * (aChildSize.Height + fSpace * aChildSize.Height);
433 && ((
index / nCol) + 1) % 2 == 0)
435 aCurrPos.X -= (nIncX * (aChildSize.Width + fSpace * aChildSize.Width));
436 else if (
index % nCol != 0 &&
index >= 3 && ((
index / nCol) + 1) == nRow
437 && ((
index / nCol) + 1) % 2 != 0)
439 aCurrPos.X += (nIncX * (aChildSize.Width + fSpace * aChildSize.Width));
447 if (rShape->getChildren().empty() || rShape->getSize().Width == 0
448 || rShape->getSize().Height == 0)
457 sal_Int32
nCount = rShape->getChildren().size();
458 double fAspectRatio = 0.32;
460 awt::Size aChildSize = rShape->getSize();
461 aChildSize.Width /=
nCount;
462 aChildSize.Height /=
nCount;
464 awt::Point aCurrPos(0, 0);
465 aCurrPos.X = fAspectRatio * aChildSize.Width * (
nCount - 1);
466 aCurrPos.Y = fAspectRatio * aChildSize.Height;
468 for (
auto& aCurrShape : rShape->getChildren())
470 aCurrShape->setPosition(aCurrPos);
473 aCurrPos.X -= aChildSize.Height / (
nCount - 1);
475 aChildSize.Width += aChildSize.Height;
476 aCurrShape->setSize(aChildSize);
477 aCurrShape->setChildSize(aChildSize);
478 aCurrPos.Y += (aChildSize.Height);
489 auto it = rMap.find(XML_l);
490 if (it == rMap.end())
494 sal_Int32 nLeft = it->second;
495 it = rMap.find(XML_w);
496 if (it == rMap.end())
500 rValue = nLeft + it->second;
519 const LayoutPropertyMap::const_iterator aRef = rProperties.find(rConstraint.
msRefForName);
520 if (aRef == rProperties.end())
523 const LayoutProperty::const_iterator aRefType = aRef->second.find(rConstraint.
mnRefType);
524 sal_Int32 nInferredValue = 0;
525 if (aRefType != aRef->second.end())
529 = aRefType->second * rConstraint.
mfFactor;
535 = nInferredValue * rConstraint.
mfFactor;
551 const std::vector<Constraint>& rConstraints)
556 sal_Int32 nParentXOffset = 0;
559 sal_Int32 nVertMin = std::numeric_limits<sal_Int32>::max();
560 sal_Int32 nVertMax = 0;
564 rParent[XML_w] = rShape->getSize().Width;
565 rParent[XML_h] = rShape->getSize().Height;
568 rParent[XML_r] = rShape->getSize().Width;
569 rParent[XML_b] = rShape->getSize().Height;
574 rParent[XML_w] = std::min(rShape->getSize().Width, rShape->getSize().Height);
575 rParent[XML_h] = rShape->getSize().Height;
576 if (rParent[XML_w] < rShape->getSize().Width)
577 nParentXOffset = (rShape->getSize().Width - rParent[XML_w]) / 2;
578 rParent[XML_l] = nParentXOffset;
580 rParent[XML_r] = rShape->getSize().Width - rParent[XML_l];
581 rParent[XML_b] = rShape->getSize().Height;
584 for (
const auto& rConstr : rConstraints)
590 for (
auto& aCurrShape : rShape->getChildren())
594 for (
const auto& rConstr : rConstraints)
596 if (rConstr.msForName != aCurrShape->getInternalName())
608 for (
const auto& pDirectChild : rLayoutNode.
getChildren())
610 auto pLayoutNode =
dynamic_cast<LayoutNode*
>(pDirectChild.get());
616 if (pLayoutNode->getName() != aCurrShape->getInternalName())
621 for (
const auto& pChild : pLayoutNode->getChildren())
623 auto pConstraintAtom =
dynamic_cast<ConstraintAtom*
>(pChild.get());
624 if (!pConstraintAtom)
629 const Constraint& rConstraint = pConstraintAtom->getConstraint();
647 aConstraint.
msForName = pLayoutNode->getName();
654 awt::Size aSize = rShape->getSize();
655 awt::Point aPos(0, 0);
657 const LayoutPropertyMap::const_iterator aPropIt
662 LayoutProperty::const_iterator it, it2;
664 if ((it = rProp.find(XML_w)) != rProp.end())
665 aSize.Width = std::min(it->second, rShape->getSize().Width);
666 if ((it = rProp.find(XML_h)) != rProp.end())
667 aSize.Height = std::min(it->second, rShape->getSize().Height);
669 if ((it = rProp.find(XML_l)) != rProp.end())
671 else if ((it = rProp.find(XML_ctrX)) != rProp.end())
672 aPos.X = it->second - aSize.Width / 2;
673 else if ((it = rProp.find(XML_r)) != rProp.end())
674 aPos.X = it->second - aSize.Width;
676 if ((it = rProp.find(XML_t)) != rProp.end())
678 else if ((it = rProp.find(XML_ctrY)) != rProp.end())
679 aPos.Y = it->second - aSize.Height / 2;
680 else if ((it = rProp.find(XML_b)) != rProp.end())
681 aPos.Y = it->second - aSize.Height;
683 if ((it = rProp.find(XML_l)) != rProp.end() && (it2 = rProp.find(XML_r)) != rProp.end())
684 aSize.Width = it2->second - it->second;
685 if ((it = rProp.find(XML_t)) != rProp.end() && (it2 = rProp.find(XML_b)) != rProp.end())
686 aSize.Height = it2->second - it->second;
688 aPos.X += nParentXOffset;
689 aSize.Width = std::min(aSize.Width, rShape->getSize().Width - aPos.X);
690 aSize.Height = std::min(aSize.Height, rShape->getSize().Height - aPos.Y);
693 SAL_WARN(
"oox.drawingml",
"composite layout properties not found for shape "
694 << aCurrShape->getInternalName());
696 aCurrShape->setSize(aSize);
697 aCurrShape->setChildSize(aSize);
698 aCurrShape->setPosition(aPos);
700 nVertMin = std::min(aPos.Y, nVertMin);
701 nVertMax = std::max(aPos.Y + aSize.Height, nVertMax);
705 auto it = rDiagramFontHeights.find(aCurrShape->getInternalName());
706 if (it != rDiagramFontHeights.end())
710 it->second.insert({ aCurrShape, {} });
715 if (!(nVertMin >= 0 && nVertMin <= nVertMax && nVertMax <= rParent[XML_h]))
718 sal_Int32 nDiff = rParent[XML_h] - (nVertMax - nVertMin);
721 for (
auto& aCurrShape : rShape->getChildren())
723 awt::Point aPosition = aCurrShape->getPosition();
724 aPosition.Y += nDiff / 2;
725 aCurrShape->setPosition(aPosition);
732 , mbHideLastTrans( true )
749 std::vector<sal_Int32> aPtTypes = attr.
getTokenList(XML_ptType);
750 mnPtType = aPtTypes.empty() ? XML_all : aPtTypes.front();
763 mnFunc = xAttr->getOptionalValueToken( XML_func, 0 );
765 mnOp = xAttr->getOptionalValueToken( XML_op, 0 );
766 msVal = xAttr->getOptionalValue( XML_val );
767 mnVal = xAttr->getOptionalValueToken( XML_val, 0 );
772 SAL_INFO(
"oox.drawingml",
"level = " << level <<
" - " <<
msName <<
" of type " <<
typeid(*this).name() );
774 pAtom->dump(level + 1);
785 rVisitor.
visit(*
this);
790 if (!
msRef.isEmpty())
793 LayoutAtomMap::const_iterator pRefAtom = rLayoutAtomMap.find(
msRef);
794 if (pRefAtom != rLayoutAtomMap.end())
795 return pRefAtom->second;
797 SAL_WARN(
"oox.drawingml",
"ForEach reference \"" <<
msRef <<
"\" not found");
804 rVisitor.
visit(*
this);
819 case XML_equ:
return nFirst == nSecond;
820 case XML_gt:
return nFirst > nSecond;
821 case XML_gte:
return nFirst >= nSecond;
822 case XML_lt:
return nFirst < nSecond;
823 case XML_lte:
return nFirst <= nSecond;
824 case XML_neq:
return nFirst != nSecond;
826 SAL_WARN(
"oox.drawingml",
"unsupported operator: " << nOperator);
838 bool bSourceToDestination)
840 for (
const auto& rConnection : rLayoutNode.
getDiagram().
getData()->getConnections())
842 if (rConnection.mnXMLType != nType)
845 if (bSourceToDestination)
847 if (rConnection.msSourceId == rFrom)
848 return rConnection.msDestId;
852 if (rConnection.msDestId == rFrom)
853 return rConnection.msSourceId;
862 sal_Int32 nMaxLength = 0;
863 for (
auto const& aCxn : rConnections)
864 if (aCxn.mnXMLType == svx::diagram::TypeConstant::XML_parOf && aCxn.msSourceId == rNodeName)
865 nMaxLength = std::max(nMaxLength, calcMaxDepth(aCxn.msDestId, rConnections) + 1);
878 sNodeId = navigate(
mrLayoutNode, svx::diagram::TypeConstant::XML_parOf, sNodeId,
true);
880 if (!sNodeId.isEmpty())
883 if (aCxn.mnXMLType == svx::diagram::TypeConstant::XML_parOf && aCxn.msSourceId == sNodeId)
910 OUString aParent = navigate(
mrLayoutNode, svx::diagram::TypeConstant::XML_presParOf, pPresPoint->
msModelId,
914 auto it = rPointNameMap.find(aParent);
915 if (it != rPointNameMap.end())
952 rVisitor.
visit(*
this);
957 rVisitor.
visit(*
this);
962 rVisitor.
visit(*
this);
966 bool bRequireForName)
const
978 bRequireForName =
false;
984 bRequireForName =
false;
1004 rRules.push_back(
maRule);
1010 rVisitor.
visit(*
this);
1015 sal_Int32 nConnRout = 0;
1016 sal_Int32 nBegSty = 0;
1017 sal_Int32 nEndSty = 0;
1018 if (
maMap.count(oox::XML_connRout))
1019 nConnRout =
maMap.find(oox::XML_connRout)->second;
1020 if (
maMap.count(oox::XML_begSty))
1021 nBegSty =
maMap.find(oox::XML_begSty)->second;
1022 if (
maMap.count(oox::XML_endSty))
1023 nEndSty =
maMap.find(oox::XML_endSty)->second;
1025 if (nConnRout == oox::XML_bend)
1027 if (nBegSty == oox::XML_arr && nEndSty == oox::XML_arr)
1028 return oox::XML_leftRightArrow;
1029 if (nBegSty == oox::XML_arr)
1030 return oox::XML_leftArrow;
1031 if (nEndSty == oox::XML_arr)
1032 return oox::XML_rightArrow;
1034 return oox::XML_rightArrow;
1039 if (rShape->getChildren().empty())
1040 return (rShape->getSubType() != XML_conn) ? 1 : 0;
1042 sal_Int32 nDir = XML_fromL;
1043 if (
mnType == XML_hierRoot)
1045 else if (
maMap.count(XML_linDir))
1046 nDir =
maMap.find(XML_linDir)->second;
1048 const sal_Int32 nSecDir =
maMap.count(XML_secLinDir) ?
maMap.find(XML_secLinDir)->second : 0;
1051 if (nDir == XML_fromT || nDir == XML_fromB)
1053 for (
const ShapePtr& pChild : rShape->getChildren())
1054 nCount += pChild->getVerticalShapesCount();
1056 else if ((nDir == XML_fromL || nDir == XML_fromR) && nSecDir == XML_fromT)
1058 for (
const ShapePtr& pChild : rShape->getChildren())
1059 nCount += pChild->getVerticalShapesCount();
1064 for (
const ShapePtr& pChild : rShape->getChildren())
1065 nCount = std::max(
nCount, pChild->getVerticalShapesCount());
1084 for (
const auto& rPair : rPresPointShapeMap)
1086 if (rPair.second == rShape)
1088 pPresNode = rPair.first;
1096 auto itPresToData = rPresOfNameMap.find(pPresNode->
msModelId);
1097 if (itPresToData != rPresOfNameMap.end())
1099 for (
const auto& rPair : itPresToData->second)
1101 const DiagramData::SourceIdAndDepth& rItem = rPair.second;
1102 auto it = rPointNameMap.find(rItem.msSourceId);
1103 if (it != rPointNameMap.end())
1105 pDataNode = it->second;
1123 const std::vector<Rule>& rRules)
1128 rShape->getChildren().erase(
1129 std::remove_if(rShape->getChildren().begin(), rShape->getChildren().end(),
1131 return aChild->getServiceName() ==
"com.sun.star.drawing.GroupShape"
1132 && aChild->getChildren().empty();
1134 rShape->getChildren().end());
1147 if (rShape->getSubType() == XML_conn)
1153 rShape->setSubType(
nType);
1154 rShape->getCustomShapeProperties()->setShapePresetType(
nType);
1158 std::vector<Constraint> aDirectConstraints;
1160 for (
const auto& pChild : rLayoutNode.
getChildren())
1162 auto pConstraintAtom =
dynamic_cast<ConstraintAtom*
>(pChild.get());
1163 if (pConstraintAtom)
1169 rParent[XML_w] = rShape->getSize().Width;
1170 rParent[XML_h] = rShape->getSize().Height;
1173 rParent[XML_r] = rShape->getSize().Width;
1174 rParent[XML_b] = rShape->getSize().Height;
1175 for (
const auto& rConstr : aDirectConstraints)
1177 const LayoutPropertyMap::const_iterator aRef
1181 const LayoutProperty::const_iterator aRefType
1182 = aRef->second.find(rConstr.mnRefType);
1183 if (aRefType != aRef->second.end())
1185 = aRefType->second * rConstr.mfFactor;
1189 aSize.Width = rParent[XML_w];
1190 aSize.Height = rParent[XML_h];
1192 awt::Point aPos = rShape->getPosition();
1193 aPos.X += (rShape->getSize().Width - aSize.Width) / 2;
1194 aPos.Y += (rShape->getSize().Height - aSize.Height) / 2;
1195 rShape->setPosition(aPos);
1196 rShape->setSize(aSize);
1202 if (rShape->getChildren().empty())
1205 const sal_Int32 nStartAngle =
maMap.count(XML_stAng) ?
maMap.find(XML_stAng)->second : 0;
1206 const sal_Int32 nSpanAngle =
maMap.count(XML_spanAng) ?
maMap.find(XML_spanAng)->second : 360;
1207 const sal_Int32 nRotationPath =
maMap.count(XML_rotPath) ?
maMap.find(XML_rotPath)->second :
XML_none;
1208 const sal_Int32 nctrShpMap =
maMap.count(XML_ctrShpMap) ?
maMap.find(XML_ctrShpMap)->second :
XML_none;
1209 const awt::Size aCenter(rShape->getSize().Width / 2, rShape->getSize().Height / 2);
1210 const awt::Size aChildSize(rShape->getSize().Width / 4, rShape->getSize().Height / 4);
1211 const awt::Size aConnectorSize(rShape->getSize().Width / 12, rShape->getSize().Height / 12);
1212 const sal_Int32 nRadius = std::min(
1213 (rShape->getSize().Width - aChildSize.Width) / 2,
1214 (rShape->getSize().Height - aChildSize.Height) / 2);
1216 std::vector<oox::drawingml::ShapePtr> aCycleChildren = rShape->getChildren();
1218 if (nctrShpMap == XML_fNode)
1222 aCycleChildren.erase(aCycleChildren.begin());
1223 const awt::Point aCurrPos(aCenter.Width - aChildSize.Width / 2,
1224 aCenter.Height - aChildSize.Height / 2);
1225 pCenterShape->setPosition(aCurrPos);
1226 pCenterShape->setSize(aChildSize);
1227 pCenterShape->setChildSize(aChildSize);
1230 const sal_Int32 nShapes = aCycleChildren.size();
1233 const sal_Int32 nConnectorRadius = nRadius * cos(
basegfx::deg2rad(nSpanAngle / nShapes));
1234 const sal_Int32 nConnectorAngle = nSpanAngle > 0 ? 0 : 180;
1237 for (
auto & aCurrShape : aCycleChildren)
1239 const double fAngle =
static_cast<double>(
idx)*nSpanAngle/nShapes + nStartAngle;
1240 awt::Size aCurrSize = aChildSize;
1241 sal_Int32 nCurrRadius = nRadius;
1242 if (aCurrShape->getSubType() == XML_conn)
1244 aCurrSize = aConnectorSize;
1245 nCurrRadius = nConnectorRadius;
1247 const awt::Point aCurrPos(
1248 aCenter.Width + nCurrRadius*sin(
basegfx::deg2rad(fAngle)) - aCurrSize.Width/2,
1249 aCenter.Height - nCurrRadius*cos(
basegfx::deg2rad(fAngle)) - aCurrSize.Height/2);
1251 aCurrShape->setPosition(aCurrPos);
1252 aCurrShape->setSize(aCurrSize);
1253 aCurrShape->setChildSize(aCurrSize);
1255 if (nRotationPath == XML_alongPath)
1256 aCurrShape->setRotation(fAngle *
PER_DEGREE);
1260 if (aCurrShape->getSubType() == XML_conn)
1261 aCurrShape->setRotation((nConnectorAngle + fAngle) *
PER_DEGREE);
1272 if (rShape->getChildren().empty() || rShape->getSize().Width == 0 || rShape->getSize().Height == 0)
1278 sal_Int32 nDir = XML_fromL;
1279 if (
mnType == XML_hierRoot)
1281 else if (
maMap.count(XML_linDir))
1282 nDir =
maMap.find(XML_linDir)->second;
1284 const sal_Int32 nSecDir =
maMap.count(XML_secLinDir) ?
maMap.find(XML_secLinDir)->second : 0;
1286 sal_Int32
nCount = rShape->getChildren().size();
1288 if (
mnType == XML_hierChild)
1292 rShape->getChildren().begin(), rShape->getChildren().end(),
1293 [](
const ShapePtr& pShape) { return pShape->getSubType() != XML_conn; });
1296 const double fSpaceWidth = 0.1;
1297 const double fSpaceHeight = 0.3;
1302 std::vector<ShapePtr>& rChildren = rShape->getChildren();
1303 if (!containsDataNodeType(rChildren[1],
XML_asst)
1304 && containsDataNodeType(rChildren[2],
XML_asst))
1305 std::swap(rChildren[1], rChildren[2]);
1308 sal_Int32 nHorizontalShapesCount = 1;
1309 if (nSecDir == XML_fromT)
1310 nHorizontalShapesCount = 2;
1311 else if (nDir == XML_fromL || nDir == XML_fromR)
1312 nHorizontalShapesCount =
nCount;
1314 awt::Size aChildSize = rShape->getSize();
1315 aChildSize.Height /= (rShape->getVerticalShapesCount() + (rShape->getVerticalShapesCount() - 1) * fSpaceHeight);
1316 aChildSize.Width /= (nHorizontalShapesCount + (nHorizontalShapesCount - 1) * fSpaceWidth);
1318 awt::Size aConnectorSize = aChildSize;
1319 aConnectorSize.Width = 1;
1321 awt::Point aChildPos(0, 0);
1324 if (
mnType == XML_hierChild && nHorizontalShapesCount == 1)
1326 const double fChildIndent = 0.1;
1327 aChildPos.X = aChildSize.Width * fChildIndent;
1328 aChildSize.Width *= (1 - 2 * fChildIndent);
1332 sal_Int32 nRowHeight = 0;
1333 for (
auto& pChild : rShape->getChildren())
1335 pChild->setPosition(aChildPos);
1337 if (
mnType == XML_hierChild && pChild->getSubType() == XML_conn)
1341 pChild->setSize(aConnectorSize);
1342 pChild->setChildSize(aConnectorSize);
1346 awt::Size aCurrSize = aChildSize;
1347 aCurrSize.Height *= pChild->getVerticalShapesCount() + (pChild->getVerticalShapesCount() - 1) * fSpaceHeight;
1349 pChild->setSize(aCurrSize);
1350 pChild->setChildSize(aCurrSize);
1352 if (nDir == XML_fromT || nDir == XML_fromB)
1353 aChildPos.Y += aCurrSize.Height + aChildSize.Height * fSpaceHeight;
1355 aChildPos.X += aCurrSize.Width + aCurrSize.Width * fSpaceWidth;
1357 nRowHeight = std::max(nRowHeight, aCurrSize.Height);
1359 if (nSecDir == XML_fromT && nIdx % 2 == 1)
1362 aChildPos.Y += nRowHeight + aChildSize.Height * fSpaceHeight;
1376 if (rShape->getChildren().empty() || rShape->getSize().Width == 0 || rShape->getSize().Height == 0)
1379 const sal_Int32 nDir =
maMap.count(XML_linDir) ?
maMap.find(XML_linDir)->second : XML_fromL;
1380 const sal_Int32 nIncX = nDir==XML_fromL ? 1 : (nDir==XML_fromR ? -1 : 0);
1381 const sal_Int32 nIncY = nDir==XML_fromT ? 1 : (nDir==XML_fromB ? -1 : 0);
1383 double fCount = rShape->getChildren().size();
1384 sal_Int32 nConnectorAngle = 0;
1387 case XML_fromL: nConnectorAngle = 0;
break;
1388 case XML_fromR: nConnectorAngle = 180;
break;
1389 case XML_fromT: nConnectorAngle = 270;
break;
1390 case XML_fromB: nConnectorAngle = 90;
break;
1393 awt::Size aSpaceSize;
1397 for (
const auto& rConstraint : rConstraints)
1399 if (rConstraint.msForName.isEmpty())
1403 if (rConstraint.mnType == XML_w)
1405 rProperty[XML_w] = rShape->getSize().Width * rConstraint.mfFactor;
1406 if (rProperty[XML_w] > rShape->getSize().Width)
1408 rProperty[XML_w] = rShape->getSize().Width;
1411 if (rConstraint.mnType == XML_h)
1413 rProperty[XML_h] = rShape->getSize().Height * rConstraint.mfFactor;
1414 if (rProperty[XML_h] > rShape->getSize().Height)
1416 rProperty[XML_h] = rShape->getSize().Height;
1420 if (rConstraint.mnType == XML_primFontSz && rConstraint.mnFor == XML_des
1421 && rConstraint.mnOperator == XML_equ)
1425 auto it = rDiagramFontHeights.find(rConstraint.msForName);
1426 if (it == rDiagramFontHeights.end())
1430 rDiagramFontHeights[rConstraint.msForName] = {};
1435 if (rConstraint.msForName ==
"sp" || rConstraint.msForName ==
"space" || rConstraint.msForName ==
"sibTrans")
1437 if (rConstraint.mnType == XML_w)
1438 aSpaceSize.Width = rShape->getSize().Width * rConstraint.mfFactor;
1439 if (rConstraint.mnType == XML_h)
1440 aSpaceSize.Height = rShape->getSize().Height * rConstraint.mfFactor;
1445 std::set<OUString> aChildrenToShrink;
1446 for (
const auto& rRule : rRules)
1450 aChildrenToShrink.insert(rRule.msForName);
1453 if (nDir == XML_fromT || nDir == XML_fromB)
1456 aChildrenToShrink.clear();
1459 if (!aChildrenToShrink.empty())
1463 std::set<OUString> aChildrenToShrinkDeps;
1464 for (
auto& aCurrShape : rShape->getChildren())
1466 if (aChildrenToShrink.find(aCurrShape->getInternalName())
1467 == aChildrenToShrink.end())
1473 bool bIsDependency =
false;
1475 for (
const auto& rConstraint : rConstraints)
1477 if (rConstraint.msForName != aCurrShape->getInternalName())
1482 if ((nDir == XML_fromL || nDir == XML_fromR) && rConstraint.mnType != XML_w)
1486 if ((nDir == XML_fromL || nDir == XML_fromR) && rConstraint.mnType == XML_w)
1488 fFactor = rConstraint.mfFactor;
1491 if ((nDir == XML_fromT || nDir == XML_fromB) && rConstraint.mnType != XML_h)
1495 if ((nDir == XML_fromT || nDir == XML_fromB) && rConstraint.mnType == XML_h)
1497 fFactor = rConstraint.mfFactor;
1500 if (aChildrenToShrink.find(rConstraint.msRefForName) == aChildrenToShrink.end())
1507 fCount += rConstraint.mfFactor;
1508 aChildrenToShrinkDeps.insert(aCurrShape->getInternalName());
1509 bIsDependency =
true;
1513 if (!bIsDependency && aCurrShape->getServiceName() ==
"com.sun.star.drawing.GroupShape")
1515 bool bScaleDownEmptySpacing =
false;
1516 if (nDir == XML_fromL || nDir == XML_fromR)
1518 std::optional<sal_Int32> oWidth = findProperty(
aProperties, aCurrShape->getInternalName(), XML_w);
1519 bScaleDownEmptySpacing = oWidth.has_value() && oWidth.value() > 0;
1521 if (!bScaleDownEmptySpacing && (nDir == XML_fromT || nDir == XML_fromB))
1523 std::optional<sal_Int32> oHeight = findProperty(
aProperties, aCurrShape->getInternalName(), XML_h);
1524 bScaleDownEmptySpacing = oHeight.has_value() && oHeight.value() > 0;
1526 if (bScaleDownEmptySpacing && aCurrShape->getChildren().empty())
1529 aChildrenToShrinkDeps.insert(aCurrShape->getInternalName());
1536 aChildrenToShrink.insert(aChildrenToShrinkDeps.begin(), aChildrenToShrinkDeps.end());
1539 aSpaceSize = awt::Size();
1544 rShape->getChildren().erase(
1545 std::remove_if(rShape->getChildren().begin(), rShape->getChildren().end(),
1547 return aChild->getServiceName()
1548 ==
"com.sun.star.drawing.GroupShape"
1549 && aChild->getChildren().empty();
1551 rShape->getChildren().end());
1552 fCount = rShape->getChildren().size();
1554 awt::Size aChildSize = rShape->getSize();
1555 if (nDir == XML_fromL || nDir == XML_fromR)
1556 aChildSize.Width /= fCount;
1557 else if (nDir == XML_fromT || nDir == XML_fromB)
1558 aChildSize.Height /= fCount;
1560 awt::Point aCurrPos(0, 0);
1562 aCurrPos.X = rShape->getSize().Width - aChildSize.Width;
1564 aCurrPos.Y = rShape->getSize().Height - aChildSize.Height;
1568 awt::Size aTotalSize;
1569 for (
const auto & aCurrShape : rShape->getChildren())
1571 std::optional<sal_Int32> oWidth = findProperty(
aProperties, aCurrShape->getInternalName(), XML_w);
1572 std::optional<sal_Int32> oHeight = findProperty(
aProperties, aCurrShape->getInternalName(), XML_h);
1573 awt::Size aSize = aChildSize;
1574 if (oWidth.has_value())
1575 aSize.Width = oWidth.value();
1576 if (oHeight.has_value())
1577 aSize.Height = oHeight.value();
1578 aTotalSize.Width += aSize.Width;
1579 aTotalSize.Height += aSize.Height;
1582 aTotalSize.Width += (fCount-1) * aSpaceSize.Width;
1583 aTotalSize.Height += (fCount-1) * aSpaceSize.Height;
1585 double fWidthScale = 1.0;
1586 double fHeightScale = 1.0;
1587 if (nIncX && aTotalSize.Width > rShape->getSize().Width)
1588 fWidthScale =
static_cast<double>(rShape->getSize().Width) / aTotalSize.Width;
1589 if (nIncY && aTotalSize.Height > rShape->getSize().Height)
1590 fHeightScale =
static_cast<double>(rShape->getSize().Height) / aTotalSize.Height;
1591 aSpaceSize.Width *= fWidthScale;
1592 aSpaceSize.Height *= fHeightScale;
1594 for (
auto& aCurrShape : rShape->getChildren())
1597 std::optional<sal_Int32> oWidth = findProperty(
aProperties, aCurrShape->getInternalName(), XML_w);
1598 std::optional<sal_Int32> oHeight = findProperty(
aProperties, aCurrShape->getInternalName(), XML_h);
1600 awt::Size aSize = aChildSize;
1601 if (oWidth.has_value())
1602 aSize.Width = oWidth.value();
1603 if (oHeight.has_value())
1604 aSize.Height = oHeight.value();
1605 if (aChildrenToShrink.empty()
1606 || aChildrenToShrink.find(aCurrShape->getInternalName())
1607 != aChildrenToShrink.end())
1609 aSize.Width *= fWidthScale;
1611 if (aChildrenToShrink.empty()
1612 || aChildrenToShrink.find(aCurrShape->getInternalName())
1613 != aChildrenToShrink.end())
1615 aSize.Height *= fHeightScale;
1617 aCurrShape->setSize(aSize);
1618 aCurrShape->setChildSize(aSize);
1622 aCurrPos.Y = (rShape->getSize().Height - aSize.Height) / 2;
1624 aCurrPos.X = (rShape->getSize().Width - aSize.Width) / 2;
1634 aCurrShape->setPosition(aCurrPos);
1636 aCurrPos.X += nIncX * (aSize.Width + aSpaceSize.Width);
1637 aCurrPos.Y += nIncY * (aSize.Height + aSpaceSize.Height);
1641 if (aCurrShape->getSubType() == XML_conn)
1642 aCurrShape->setRotation(nConnectorAngle *
PER_DEGREE);
1646 sal_Int32 nChildOrder = XML_b;
1647 const LayoutNode* pParentLayoutNode =
nullptr;
1650 auto pLayoutNode =
dynamic_cast<LayoutNode*
>(pAtom.get());
1653 pParentLayoutNode = pLayoutNode;
1657 if (pParentLayoutNode)
1661 if (nChildOrder == XML_t)
1663 std::reverse(rShape->getChildren().begin(), rShape->getChildren().end());
1694 double fFontSize = 0;
1695 for (
const auto& rConstr : rConstraints)
1697 if (rConstr.mnRefType == XML_w)
1699 if (!rConstr.msForName.isEmpty())
1702 sal_Int32 nProperty = getPropertyFromConstraint(rConstr.mnType);
1713 rShape->getShapeProperties().setProperty(nProperty,
nValue);
1715 if (rConstr.mnType == XML_primFontSz)
1716 fFontSize = rConstr.mfValue;
1720 if (!pTextBody || pTextBody->isEmpty())
1726 for (
auto& aParagraph : pTextBody->getParagraphs())
1727 for (
auto& aRun : aParagraph->getRuns())
1728 if (!aRun->getTextCharacterProperties().moHeight.has_value())
1729 aRun->getTextCharacterProperties().moHeight = fFontSize * 100;
1735 pTextBody->getTextProperties().maPropertyMap.setProperty(
1740 const sal_Int32 nautoTxRot =
maMap.count(XML_autoTxRot) ?
maMap.find(XML_autoTxRot)->second : XML_upr;
1741 sal_Int32 nShapeRot = rShape->getRotation();
1742 while (nShapeRot < 0)
1760 pTextBody->getTextProperties().moTextPreRotation = n90x * 90 *
PER_DEGREE;
1766 pTextBody->getTextProperties().moTextPreRotation = -180 *
PER_DEGREE;
1773 const sal_Int32 atxAnchorVert =
maMap.count(XML_txAnchorVert) ?
maMap.find(XML_txAnchorVert)->second : XML_mid;
1775 switch(atxAnchorVert)
1778 pTextBody->getTextProperties().meVA = css::drawing::TextVerticalAdjust_TOP;
1781 pTextBody->getTextProperties().meVA = css::drawing::TextVerticalAdjust_BOTTOM;
1786 pTextBody->getTextProperties().meVA = css::drawing::TextVerticalAdjust_CENTER;
1790 pTextBody->getTextProperties().maPropertyMap.setProperty(
PROP_TextVerticalAdjust, pTextBody->getTextProperties().meVA);
1793 sal_Int32 nBaseLevel = pTextBody->getParagraphs().front()->getProperties().getLevel();
1794 for (
auto & aParagraph : pTextBody->getParagraphs())
1796 if (aParagraph->getProperties().getLevel() < nBaseLevel)
1797 nBaseLevel = aParagraph->getProperties().getLevel();
1803 int nStartBulletsAtLevel = 2;
1804 ParamMap::const_iterator aBulletLvl =
maMap.find(XML_stBulletLvl);
1805 if (aBulletLvl !=
maMap.end())
1806 nStartBulletsAtLevel = aBulletLvl->second;
1807 nStartBulletsAtLevel--;
1809 bool isBulletList =
false;
1810 for (
auto & aParagraph : pTextBody->getParagraphs())
1812 sal_Int32 nLevel = aParagraph->getProperties().getLevel() - nBaseLevel;
1813 aParagraph->getProperties().setLevel(nLevel);
1814 if (nLevel >= nStartBulletsAtLevel)
1816 if (!aParagraph->getProperties().getParaLeftMargin().has_value())
1819 =
o3tl::convert(285750 * (nLevel - nStartBulletsAtLevel + 1),
1821 aParagraph->getProperties().getParaLeftMargin() =
nLeftMargin;
1824 if (!aParagraph->getProperties().getFirstLineIndentation().has_value())
1825 aParagraph->getProperties().getFirstLineIndentation()
1829 aParagraph->getProperties().getBulletList().setBulletChar(
u"•");
1830 aParagraph->getProperties().getBulletList().setSuffixNone();
1831 isBulletList =
true;
1836 ParamMap::const_iterator aDir =
maMap.find(XML_parTxLTRAlign);
1838 if (aDir !=
maMap.end())
1840 css::style::ParagraphAdjust aAlignment =
GetParaAdjust(aDir->second);
1841 for (
auto & aParagraph : pTextBody->getParagraphs())
1842 aParagraph->getProperties().setParaAdjust(aAlignment);
1844 else if (!isBulletList)
1847 for (
auto & aParagraph : pTextBody->getParagraphs())
1848 aParagraph->getProperties().setParaAdjust(css::style::ParagraphAdjust::ParagraphAdjust_CENTER);
1859 "Layouting shape " << rShape->getInternalName() <<
", alg type: " <<
mnType <<
", ("
1860 << rShape->getPosition().X <<
"," << rShape->getPosition().Y <<
","
1861 << rShape->getSize().Width <<
"," << rShape->getSize().Height <<
")");
1866 rVisitor.
visit(*
this);
1873 "Filling content from layout node named \"" <<
msName
1874 <<
"\", modelId \"" << pPresNode->
msModelId <<
"\"");
1877 const DiagramData::StringMap::const_iterator aNodeName =
mrDgm.
getData()->getPresOfNameMap().find(
1879 if( aNodeName !=
mrDgm.
getData()->getPresOfNameMap().end() )
1882 sal_Int32 nMinDepth = std::numeric_limits<sal_Int32>::max();
1883 for (
const auto& rPair : aNodeName->second)
1885 if (rPair.second.mnDepth < nMinDepth)
1886 nMinDepth = rPair.second.mnDepth;
1889 for (
const auto& rPair : aNodeName->second)
1894 DiagramData::PointNameMap::const_iterator aDataNode2 = rMap.find(rItem.
msSourceId);
1895 if (aDataNode2 == rMap.end())
1901 Shape* pDataNode2Shape(
mrDgm.
getData()->getOrCreateAssociatedShape(*aDataNode2->second));
1902 if (
nullptr == pDataNode2Shape)
1908 rShape->setDataNodeType(aDataNode2->second->mnXMLType);
1921 "Custom shape with preset type "
1922 << (rShape->getCustomShapeProperties()
1923 ->getShapePresetType())
1924 <<
" added for layout node named \"" <<
msName
1927 else if (rItem.
mnDepth == nMinDepth)
1937 !pDataNode2Shape->
getTextBody()->getParagraphs().empty() &&
1938 !pDataNode2Shape->
getTextBody()->getParagraphs().front()->getRuns().empty() )
1943 pTextBody = std::make_shared<TextBody>();
1946 pTextBody->getTextListStyle() =
1947 pDataNode2Shape->
getTextBody()->getTextListStyle();
1948 pTextBody->getTextProperties() =
1949 pDataNode2Shape->
getTextBody()->getTextProperties();
1951 rShape->setTextBody(pTextBody);
1955 = pDataNode2Shape->
getTextBody()->getParagraphs();
1956 for (
const auto& pSourceParagraph : rSourceParagraphs)
1962 for (
const auto& pRun : pSourceParagraph->getRuns())
1974 "ShapeCreationVisitor::visit: no data node name found while"
1975 " processing shape type "
1976 << rShape->getCustomShapeProperties()->getShapePresetType()
1977 <<
" for layout node named \"" <<
msName <<
"\"");
1979 if (
nullptr != pPresNodeShape)
1988 if (aStyleLabel.isEmpty())
1990 if( !aStyleLabel.isEmpty() )
1992 const DiagramQStyleMap::const_iterator aStyle =
mrDgm.
getStyles().find(aStyleLabel);
1996 rShape->getShapeStyleRefs()[XML_fillRef] = rStyle.
maFillStyle;
1997 rShape->getShapeStyleRefs()[XML_lnRef] = rStyle.
maLineStyle;
1998 rShape->getShapeStyleRefs()[XML_effectRef] = rStyle.
maEffectStyle;
1999 rShape->getShapeStyleRefs()[XML_fontRef] = rStyle.
maTextStyle;
2003 SAL_WARN(
"oox.drawingml",
"Style " << aStyleLabel <<
" not found");
2006 const DiagramColorMap::const_iterator aColor =
mrDgm.
getColors().find(aStyleLabel);
2032 auto pLayoutNode =
dynamic_cast<LayoutNode*
>(pAtom.get());
2042 rVisitor.
visit(*
this);
PropertiesInfo aProperties
Provides access to attribute values of an element.
std::vector< sal_Int32 > getTokenList(sal_Int32 nAttrToken) const
std::optional< sal_Int32 > getInteger(sal_Int32 nAttrToken) const
Returns the 32-bit signed integer value of the specified attribute (decimal).
std::optional< bool > getBool(sal_Int32 nAttrToken) const
Returns the boolean value of the specified attribute.
virtual void accept(LayoutAtomVisitor &) override
visitor acceptance
double getAspectRatio() const
void layoutShape(const ShapePtr &rShape, const std::vector< Constraint > &rConstraints, const std::vector< Rule > &rRules)
const ParamMap & getMap() const
std::map< sal_Int32, sal_Int32 > ParamMap
sal_Int32 getVerticalShapesCount(const ShapePtr &rShape)
sal_Int32 getConnectorType()
Determines the connector shape type for conn algorithm.
virtual void accept(LayoutAtomVisitor &) override
visitor acceptance
static void applyConstraintToLayout(const Constraint &rConstraint, LayoutPropertyMap &rProperties)
Apply rConstraint to the rProperties shared layout state.
static bool inferFromLayoutProperty(const LayoutProperty &rMap, sal_Int32 nRefType, sal_Int32 &rValue)
Decides if a certain reference type (e.g.
static void layoutShapeChildren(AlgAtom &rAlg, const ShapePtr &rShape, const std::vector< Constraint > &rConstraints)
bool getDecision(const svx::diagram::Point *pPresPoint) const
virtual void accept(LayoutAtomVisitor &) override
visitor acceptance
sal_Int32 getNodeCount(const svx::diagram::Point *pPresPoint) const
static bool compareResult(sal_Int32 nOperator, sal_Int32 nFirst, sal_Int32 nSecond)
ConditionAtom(LayoutNode &rLayoutNode, bool isElse, const css::uno::Reference< css::xml::sax::XFastAttributeList > &xAttributes)
virtual void accept(LayoutAtomVisitor &) override
visitor acceptance
void parseConstraint(std::vector< Constraint > &rConstraints, bool bRequireForName) const
DiagramColorMap & getColors()
DiagramQStyleMap & getStyles()
oox::core::NamedShapePairs & getDiagramFontHeights()
const OoxDiagramDataPtr & getData() const
const DiagramLayoutPtr & getLayout() const
LayoutAtomPtr getRefAtom()
virtual void accept(LayoutAtomVisitor &) override
visitor acceptance
ForEachAtom(LayoutNode &rLayoutNode, const css::uno::Reference< css::xml::sax::XFastAttributeList > &xAttributes)
abstract Atom for the layout
const std::vector< LayoutAtomPtr > & getChildren() const
LayoutNode & getLayoutNode()
LayoutAtomPtr getParent() const
LayoutNode & mrLayoutNode
const LayoutNode * getParentLayoutNode() const
sal_Int32 getChildOrder() const
bool setupShape(const ShapePtr &rShape, const svx::diagram::Point *pPresNode, sal_Int32 nCurrIdx) const
virtual void accept(LayoutAtomVisitor &) override
visitor acceptance
static void layoutShapeChildren(const ShapePtr &rShape)
void parseRule(std::vector< Rule > &rRules) const
virtual void accept(LayoutAtomVisitor &) override
visitor acceptance
virtual void accept(LayoutAtomVisitor &) override
visitor acceptance
PropertyMap & getShapeProperties()
CustomShapePropertiesPtr & getCustomShapeProperties()
LineProperties & getLineProperties()
const TextListStylePtr & getMasterTextListStyle() const
FillProperties & getFillProperties()
const TextBodyPtr & getTextBody() const
static void layoutShapeChildren(const AlgAtom &rAlg, const ShapePtr &rShape, const std::vector< Constraint > &rConstraints)
void apply(const TextParagraphProperties &rSourceProps)
void setLevel(sal_Int16 nLevel)
void addRun(const TextRunPtr &pRun)
TextParagraphProperties & getProperties()
std::map< OUString, std::map< sal_Int32, SourceIdAndDepth > > StringMap
std::map< OUString, Point * > PointNameMap
#define SAL_WARN(area, stream)
#define SAL_INFO(area, stream)
if(aStr !=aBuf) UpdateName_Impl(m_xFollowLb.get()
tools::Long const nLeftMargin
constexpr double deg2rad(double v)
constexpr Point convert(const Point &rPoint, o3tl::Length eFrom, o3tl::Length eTo)
std::map< OUString, ShapePairs > NamedShapePairs
double convertPointToMms(double fValue)
Converts the passed double value from points to mm.
std::shared_ptr< Shape > ShapePtr
std::map< OUString, LayoutAtomPtr > LayoutAtomMap
std::shared_ptr< LayoutAtom > LayoutAtomPtr
std::map< const svx::diagram::Point *, ShapePtr > PresPointShapeMap
ParagraphAdjust GetParaAdjust(sal_Int32 nAlign)
converts a paragraph align to a ParaAdjust
std::map< OUString, LayoutProperty > LayoutPropertyMap
const sal_Int32 PER_DEGREE
std::shared_ptr< TextBody > TextBodyPtr
std::map< sal_Int32, sal_Int32 > LayoutProperty
std::vector< Connection > Connections
void loadFromXAttr(const css::uno::Reference< css::xml::sax::XFastAttributeList > &xAttributes)
Constraints allow you to specify an ideal (or starting point) size for each shape.
static const oox::drawingml::Color & getColorByIndex(const std::vector< oox::drawingml::Color > &rColors, sal_Int32 nIndex)
std::vector< oox::drawingml::Color > maTextFillColors
std::vector< oox::drawingml::Color > maFillColors
std::vector< oox::drawingml::Color > maEffectColors
std::vector< oox::drawingml::Color > maLineColors
ShapeStyleRef maLineStyle
ShapeStyleRef maEffectStyle
ShapeStyleRef maTextStyle
ShapeStyleRef maFillStyle
std::vector< sal_Int32 > maAxis
void loadFromXAttr(const css::uno::Reference< css::xml::sax::XFastAttributeList > &xAttributes)
virtual void visit(ConstraintAtom &rAtom)=0
std::optional< sal_Int32 > moHierarchyBranch
OUString msPresentationLayoutStyleLabel
OUString msPresentationAssociationId
constexpr OUStringLiteral PROP_TextFitToSize
constexpr OUStringLiteral PROP_TextVerticalAdjust