11#include <oox/token/tokens.hxx>
13#include <com/sun/star/beans/XPropertySet.hpp>
14#include <com/sun/star/beans/PropertyValue.hpp>
15#include <com/sun/star/drawing/EnhancedCustomShapeAdjustmentValue.hpp>
16#include <com/sun/star/drawing/EnhancedCustomShapeParameterPair.hpp>
17#include <com/sun/star/drawing/XShape.hpp>
19#include <osl/diagnose.h>
25using namespace ::css::drawing;
33 css::uno::Reference<css::drawing::XShape> xShape)
34 : m_pDMLexporter(pDMLExporter)
37 OSL_ASSERT(xShape->getShapeType() ==
"com.sun.star.drawing.CustomShape");
41 uno::Reference<beans::XPropertySet> xShapeProps(
m_xShape, uno::UNO_QUERY);
42 css::uno::Sequence<css::beans::PropertyValue> aCustomShapeGeometry
43 = xShapeProps->getPropertyValue(
"CustomShapeGeometry")
44 .get<uno::Sequence<beans::PropertyValue>>();
46 for (
auto const& rCustomShapeGeometryItem : aCustomShapeGeometry)
48 if (rCustomShapeGeometryItem.Name ==
"Type")
52 if (rCustomShapeGeometryItem.Name ==
"Handles")
56 = rCustomShapeGeometryItem.Value
57 .get<css::uno::Sequence<css::uno::Sequence<css::beans::PropertyValue>>>();
59 if (rCustomShapeGeometryItem.Name ==
"AdjustmentValues")
62 = rCustomShapeGeometryItem.Value
63 .get<css::uno::Sequence<css::drawing::EnhancedCustomShapeAdjustmentValue>>();
65 if (rCustomShapeGeometryItem.Name ==
"MirroredX")
67 m_bIsFlipped.first = rCustomShapeGeometryItem.Value.get<
bool>();
69 if (rCustomShapeGeometryItem.Name ==
"MirroredY")
71 m_bIsFlipped.second = rCustomShapeGeometryItem.Value.get<
bool>();
98const css::uno::Sequence<css::uno::Sequence<css::beans::PropertyValue>>&
104const css::uno::Sequence<css::drawing::EnhancedCustomShapeAdjustmentValue>&
111 std::u16string_view sType)
135 .get<EnhancedCustomShapeParameterPair>();
137 .get<EnhancedCustomShapeParameter>()
138 .
Value.get<
double>();
140 .get<EnhancedCustomShapeParameter>()
141 .
Value.get<
double>();
158 .get<EnhancedCustomShapeParameterPair>();
177 .get<EnhancedCustomShapeParameterPair>();
179 .get<EnhancedCustomShapeParameter>()
180 .
Value.get<
double>();
182 .get<EnhancedCustomShapeParameter>()
183 .
Value.get<
double>();
200 .get<EnhancedCustomShapeParameterPair>();
202 .get<EnhancedCustomShapeParameter>()
203 .
Value.get<
double>();
205 .get<EnhancedCustomShapeParameter>()
206 .
Value.get<
double>();
242 m_pDMLexporter->
GetFS()->singleElementNS(XML_a, XML_gd, XML_name, sValName, XML_fmla, sVal);
289 const tools::Long nConstOfMaxDegreeOf60th = 21600000;
292 if (sShapeType ==
"accentBorderCallout1")
297 if (sShapeType ==
"accentBorderCallout2")
302 if (sShapeType ==
"accentBorderCallout3")
307 if (sShapeType ==
"accentCallout1")
312 if (sShapeType ==
"accentCallout2")
317 if (sShapeType ==
"accentCallout3")
322 if (sShapeType ==
"actionButtonBackPrevious")
327 if (sShapeType ==
"actionButtonBeginning")
332 if (sShapeType ==
"actionButtonBlank")
337 if (sShapeType ==
"actionButtonDocument")
342 if (sShapeType ==
"actionButtonEnd")
347 if (sShapeType ==
"actionButtonForwardNext")
352 if (sShapeType ==
"actionButtonHelp")
357 if (sShapeType ==
"actionButtonHome")
362 if (sShapeType ==
"actionButtonInformation")
367 if (sShapeType ==
"actionButtonMovie")
372 if (sShapeType ==
"actionButtonReturn")
377 if (sShapeType ==
"actionButtonSound")
382 if (sShapeType ==
"arc")
387 if (sShapeType ==
"bentArrow")
393 if (sShapeType ==
"bentConnector2")
398 if (sShapeType ==
"bentConnector3")
403 if (sShapeType ==
"bentConnector4")
408 if (sShapeType ==
"bentConnector5")
413 if (sShapeType ==
"bentUpArrow")
418 if (sShapeType ==
"bevel")
421 if (!aPoint1.nCurrVal.has_value() || !aPoint1.nMaxVal.has_value()
422 || !aPoint1.nMinVal.has_value())
428 = std::lround(*aPoint1.nCurrVal / (*aPoint1.nMaxVal - *aPoint1.nMinVal) * 50000);
430 &&
WriteAV(
u"adj", OUString(
u"val " + OUString::number(nVal1)))
433 if (sShapeType ==
"blockArc")
437 if (!aPointA.nCurrVal.has_value() || !aPointA.nMaxVal.has_value()
438 || !aPointA.nMinVal.has_value() || !aPointR.nCurrVal.has_value()
439 || !aPointR.nMaxVal.has_value() || !aPointR.nMinVal.has_value())
444 = std::lround((*aPointA.nCurrVal < 0 ? 360 + *aPointA.nCurrVal : *aPointA.nCurrVal)
445 / (*aPointA.nMaxVal - *aPointA.nMinVal) * nConstOfMaxDegreeOf60th);
447 (*aPointA.nCurrVal > 180 ? 360 - *aPointA.nCurrVal : 180 - *aPointA.nCurrVal)
448 / (*aPointA.nMaxVal - *aPointA.nMinVal) * nConstOfMaxDegreeOf60th);
450 50000 - (*aPointR.nCurrVal / (*aPointR.nMaxVal - *aPointR.nMinVal) * 50000));
452 &&
WriteAV(
u"adj1", OUString(
u"val " + OUString::number(nVal1)))
453 &&
WriteAV(
u"adj2", OUString(
u"val " + OUString::number(nVal2)))
454 &&
WriteAV(
u"adj3", OUString(
u"val " + OUString::number(nVal3)))
457 if (sShapeType ==
"borderCallout1")
462 if (sShapeType ==
"borderCallout2")
467 if (sShapeType ==
"borderCallout3")
472 if (sShapeType ==
"bracePair")
475 if (!aPoint1.nCurrVal.has_value() || !aPoint1.nMaxVal.has_value()
476 || !aPoint1.nMinVal.has_value())
482 = std::lround(*aPoint1.nCurrVal / (*aPoint1.nMaxVal - *aPoint1.nMinVal) * 25000);
484 &&
WriteAV(
u"adj", OUString(
u"val " + OUString::number(nVal1)))
487 if (sShapeType ==
"bracketPair")
490 if (!aPoint1.nCurrVal.has_value() || !aPoint1.nMaxVal.has_value()
491 || !aPoint1.nMinVal.has_value())
497 = std::lround(*aPoint1.nCurrVal / (*aPoint1.nMaxVal - *aPoint1.nMinVal) * 50000);
499 &&
WriteAV(
u"adj", OUString(
u"val " + OUString::number(nVal1)))
502 if (sShapeType ==
"callout1")
507 if (sShapeType ==
"callout2")
512 if (sShapeType ==
"callout3")
517 if (sShapeType ==
"can")
522 if (sShapeType ==
"chartPlus")
527 if (sShapeType ==
"chartStar")
532 if (sShapeType ==
"chartX")
537 if (sShapeType ==
"chord")
542 if (sShapeType ==
"circularArrow")
547 if (sShapeType ==
"cloud")
552 if (sShapeType ==
"cloudCallout")
557 if (sShapeType ==
"cornerTabs")
562 if (sShapeType ==
"cube")
567 if (sShapeType ==
"curvedConnector2")
572 if (sShapeType ==
"curvedConnector3")
577 if (sShapeType ==
"curvedConnector4")
582 if (sShapeType ==
"curvedConnector5")
587 if (sShapeType ==
"curvedDownArrow")
592 if (sShapeType ==
"curvedLeftArrow")
597 if (sShapeType ==
"curvedRightArrow")
602 if (sShapeType ==
"curvedUpArrow")
607 if (sShapeType ==
"decagon")
612 if (sShapeType ==
"diagStripe")
617 if (sShapeType ==
"diamond")
622 if (sShapeType ==
"dodecagon")
627 if (sShapeType ==
"donut")
632 if (sShapeType ==
"doubleWave")
637 if (sShapeType ==
"downArrow")
641 if (!aPointX.nCurrVal.has_value() || !aPointX.nMaxVal.has_value()
642 || !aPointX.nMinVal.has_value() || !aPointY.nCurrVal.has_value()
643 || !aPointY.nMaxVal.has_value() || !aPointY.nMinVal.has_value())
650 = 100000 *
m_xShape->getSize().Height
652 tools::Long nVal1 = std::lround((*aPointX.nMaxVal - *aPointX.nCurrVal)
653 / (*aPointX.nMaxVal - *aPointX.nMinVal) * nMaxVal1);
654 tools::Long nVal2 = std::lround((*aPointY.nMaxVal - *aPointY.nCurrVal)
655 / (*aPointY.nMaxVal - *aPointY.nMinVal) * nMaxVal2);
657 &&
WriteAV(
u"adj1", OUString(
u"val " + OUString::number(nVal1)))
658 &&
WriteAV(
u"adj2", OUString(
u"val " + OUString::number(nVal2)))
661 if (sShapeType ==
"downArrowCallout")
667 if (!aNeckFromBox.nCurrVal.has_value() || !aNeckFromBox.nMaxVal.has_value()
668 || !aNeckFromBox.nMinVal.has_value() || !aHeadFromNeck.nCurrVal.has_value()
669 || !aHeadFromNeck.nMaxVal.has_value() || !aHeadFromNeck.nMinVal.has_value()
670 || !aHeadHeight.nCurrVal.has_value() || !aHeadHeight.nMaxVal.has_value()
671 || !aHeadHeight.nMinVal.has_value() || !aBoxHeight.nCurrVal.has_value()
672 || !aBoxHeight.nMaxVal.has_value() || !aBoxHeight.nMinVal.has_value())
678 = 100000 *
m_xShape->getSize().Width
684 = 100000 *
m_xShape->getSize().Height
687 = std::lround((*aNeckFromBox.nMaxVal - *aNeckFromBox.nCurrVal)
688 / (*aNeckFromBox.nMaxVal - *aNeckFromBox.nMinVal) * nMaxVal1);
689 tools::Long nVal2 = std::lround((10800 - *aHeadFromNeck.nCurrVal)
690 / (10800 - *aHeadFromNeck.nMinVal) * nMaxVal2);
692 = std::lround((*aHeadHeight.nMaxVal - *aHeadHeight.nCurrVal)
693 / (*aHeadHeight.nMaxVal - *aHeadHeight.nMinVal) * nMaxVal3);
694 tools::Long nVal4 = std::lround((*aBoxHeight.nCurrVal - *aBoxHeight.nMinVal)
695 / (21600 - *aBoxHeight.nMinVal) * 100000);
697 &&
WriteAV(
u"adj1", OUString(
u"val " + OUString::number(nVal1)))
698 &&
WriteAV(
u"adj2", OUString(
u"val " + OUString::number(nVal2)))
699 &&
WriteAV(
u"adj3", OUString(
u"val " + OUString::number(nVal3)))
700 &&
WriteAV(
u"adj4", OUString(
u"val " + OUString::number(nVal4)))
703 if (sShapeType ==
"ellipse")
708 if (sShapeType ==
"ellipseRibbon")
713 if (sShapeType ==
"ellipseRibbon2")
718 if (sShapeType ==
"flowChartAlternateProcess")
723 if (sShapeType ==
"flowChartCollate")
728 if (sShapeType ==
"flowChartConnector")
733 if (sShapeType ==
"flowChartDecision")
738 if (sShapeType ==
"flowChartDecision")
743 if (sShapeType ==
"flowChartDelay")
748 if (sShapeType ==
"flowChartDisplay")
753 if (sShapeType ==
"flowChartDocument")
758 if (sShapeType ==
"flowChartExtract")
763 if (sShapeType ==
"flowChartInputOutput")
768 if (sShapeType ==
"flowChartInternalStorage")
773 if (sShapeType ==
"flowChartMagneticDisk")
778 if (sShapeType ==
"flowChartMagneticDrum")
783 if (sShapeType ==
"flowChartMagneticTape")
788 if (sShapeType ==
"flowChartManualInput")
793 if (sShapeType ==
"flowChartManualOperation")
798 if (sShapeType ==
"flowChartMerge")
803 if (sShapeType ==
"flowChartMultidocument")
808 if (sShapeType ==
"flowChartOfflineStorage")
813 if (sShapeType ==
"flowChartOffpageConnector")
818 if (sShapeType ==
"flowChartOnlineStorage")
823 if (sShapeType ==
"flowChartOr")
828 if (sShapeType ==
"flowChartDecision")
833 if (sShapeType ==
"flowChartPredefinedProcess")
838 if (sShapeType ==
"flowChartPreparation")
843 if (sShapeType ==
"flowChartPunchedCard")
848 if (sShapeType ==
"flowChartPunchedTape")
853 if (sShapeType ==
"flowChartSort")
858 if (sShapeType ==
"flowChartSummingJunction")
863 if (sShapeType ==
"flowChartTerminator")
868 if (sShapeType ==
"foldedCorner")
873 if (sShapeType ==
"frame")
878 if (sShapeType ==
"funnel")
883 if (sShapeType ==
"gear6")
888 if (sShapeType ==
"gear9")
893 if (sShapeType ==
"halfFrame")
898 if (sShapeType ==
"heart")
903 if (sShapeType ==
"heptagon")
908 if (sShapeType ==
"hexagon")
911 if (!aPoint1.nCurrVal.has_value() || !aPoint1.nMaxVal.has_value()
912 || !aPoint1.nMinVal.has_value())
920 = std::lround(*aPoint1.nCurrVal / (*aPoint1.nMaxVal - *aPoint1.nMinVal) * nMaxVal);
922 &&
WriteAV(
u"adj", OUString(
u"val " + OUString::number(nVal1)))
923 &&
WriteAV(
u"vf", OUString(
u"val " + OUString::number(115470)))
926 if (sShapeType ==
"homePlate")
931 if (sShapeType ==
"horizontalScroll")
936 if (sShapeType ==
"irregularSeal1")
941 if (sShapeType ==
"irregularSeal2")
946 if (sShapeType ==
"leftArrow")
950 if (!aPointX.nCurrVal.has_value() || !aPointX.nMaxVal.has_value()
951 || !aPointX.nMinVal.has_value() || !aPointY.nCurrVal.has_value()
952 || !aPointY.nMaxVal.has_value() || !aPointY.nMinVal.has_value())
960 * (double(
m_xShape->getSize().Width)
962 tools::Long nVal1 = std::lround((*aPointY.nMaxVal - *aPointY.nCurrVal)
963 / (*aPointY.nMaxVal - *aPointY.nMinVal) * nMaxVal1);
964 tools::Long nVal2 = std::lround((*aPointX.nCurrVal - *aPointX.nMinVal)
965 / (*aPointX.nMaxVal - *aPointX.nMinVal) * nMaxVal2);
967 &&
WriteAV(
u"adj1", OUString(
u"val " + OUString::number(nVal1)))
968 &&
WriteAV(
u"adj2", OUString(
u"val " + OUString::number(nVal2)))
971 if (sShapeType ==
"leftArrowCallout")
977 if (!aBoxWidth.nCurrVal.has_value() || !aBoxWidth.nMaxVal.has_value()
978 || !aBoxWidth.nMinVal.has_value() || !aNeckLength.nCurrVal.has_value()
979 || !aNeckLength.nMaxVal.has_value() || !aNeckLength.nMinVal.has_value()
980 || !aNeckFromBox.nCurrVal.has_value() || !aNeckFromBox.nMaxVal.has_value()
981 || !aNeckFromBox.nMinVal.has_value() || !aHeadFromNeck.nCurrVal.has_value()
982 || !aHeadFromNeck.nMaxVal.has_value() || !aHeadFromNeck.nMinVal.has_value())
988 = 100000 *
m_xShape->getSize().Height
991 = 50000 *
m_xShape->getSize().Height
994 = 100000 *
m_xShape->getSize().Width
997 = std::lround((*aNeckFromBox.nMaxVal - *aNeckFromBox.nCurrVal)
998 / (*aNeckFromBox.nMaxVal - *aNeckFromBox.nMinVal) * nMaxVal1);
999 tools::Long nVal2 = std::lround((10800 - *aHeadFromNeck.nCurrVal)
1000 / (10800 - *aHeadFromNeck.nMinVal) * nMaxVal2);
1001 tools::Long nVal3 = std::lround((*aNeckLength.nCurrVal - *aNeckLength.nMinVal)
1002 / (21600 - *aNeckLength.nMinVal) * nMaxVal3);
1003 tools::Long nVal4 = std::lround((*aBoxWidth.nMaxVal - *aBoxWidth.nCurrVal)
1004 / (*aBoxWidth.nMaxVal - *aBoxWidth.nMinVal) * 100000);
1006 &&
WriteAV(
u"adj1", OUString(
u"val " + OUString::number(nVal1)))
1007 &&
WriteAV(
u"adj2", OUString(
u"val " + OUString::number(nVal2)))
1008 &&
WriteAV(
u"adj3", OUString(
u"val " + OUString::number(nVal3)))
1009 &&
WriteAV(
u"adj4", OUString(
u"val " + OUString::number(nVal4)))
1012 if (sShapeType ==
"leftBrace")
1017 if (sShapeType ==
"leftBracket")
1022 if (sShapeType ==
"leftCircularArrow")
1027 if (sShapeType ==
"leftRightArrow")
1031 if (!aPointX.nCurrVal.has_value() || !aPointX.nMaxVal.has_value()
1032 || !aPointX.nMinVal.has_value() || !aPointY.nCurrVal.has_value()
1033 || !aPointY.nMaxVal.has_value() || !aPointY.nMinVal.has_value())
1041 * (double(
m_xShape->getSize().Width)
1043 tools::Long nVal1 = std::lround((*aPointY.nMaxVal - *aPointY.nCurrVal)
1044 / (*aPointY.nMaxVal - *aPointY.nMinVal) * nMaxVal1);
1045 tools::Long nVal2 = std::lround((*aPointX.nCurrVal - *aPointX.nMinVal)
1046 / (*aPointX.nMaxVal - *aPointX.nMinVal) * nMaxVal2);
1048 &&
WriteAV(
u"adj1", OUString(
u"val " + OUString::number(nVal1)))
1049 &&
WriteAV(
u"adj2", OUString(
u"val " + OUString::number(nVal2)))
1052 if (sShapeType ==
"leftRightArrowCallout")
1058 if (!aNeckFromBox.nCurrVal.has_value() || !aNeckFromBox.nMaxVal.has_value()
1059 || !aNeckFromBox.nMinVal.has_value() || !aHeadFromNeck.nCurrVal.has_value()
1060 || !aHeadFromNeck.nMaxVal.has_value() || !aHeadFromNeck.nMinVal.has_value()
1061 || !aHeadHeight.nCurrVal.has_value() || !aHeadHeight.nMaxVal.has_value()
1062 || !aHeadHeight.nMinVal.has_value() || !aBoxHeight.nCurrVal.has_value()
1063 || !aBoxHeight.nMaxVal.has_value() || !aBoxHeight.nMinVal.has_value())
1069 = 100000 *
m_xShape->getSize().Width
1072 = 50000 *
m_xShape->getSize().Width
1075 = 100000 *
m_xShape->getSize().Height
1078 = std::lround((*aNeckFromBox.nMaxVal - *aNeckFromBox.nCurrVal)
1079 / (*aNeckFromBox.nMaxVal - *aNeckFromBox.nMinVal) * nMaxVal1);
1080 tools::Long nVal2 = std::lround((10800 - *aHeadFromNeck.nCurrVal)
1081 / (10800 - *aHeadFromNeck.nMinVal) * nMaxVal2);
1082 tools::Long nVal3 = std::lround((*aHeadHeight.nCurrVal - *aHeadHeight.nMinVal)
1083 / (21600 - *aHeadHeight.nMinVal) * nMaxVal3);
1084 tools::Long nVal4 = std::lround((*aBoxHeight.nCurrVal - *aBoxHeight.nMinVal)
1085 / (10800 - *aBoxHeight.nMinVal) * 100000);
1087 &&
WriteAV(
u"adj1", OUString(
u"val " + OUString::number(nVal1)))
1088 &&
WriteAV(
u"adj2", OUString(
u"val " + OUString::number(nVal2)))
1089 &&
WriteAV(
u"adj3", OUString(
u"val " + OUString::number(nVal3)))
1090 &&
WriteAV(
u"adj4", OUString(
u"val " + OUString::number(nVal4)))
1093 if (sShapeType ==
"leftRightCircularArrow")
1098 if (sShapeType ==
"leftRightRibbon")
1103 if (sShapeType ==
"leftRightUpArrow")
1109 if (sShapeType ==
"leftUpArrow")
1114 if (sShapeType ==
"lightningBolt")
1119 if (sShapeType ==
"line")
1124 if (sShapeType ==
"lineInv")
1129 if (sShapeType ==
"mathDivide")
1134 if (sShapeType ==
"mathEqual")
1139 if (sShapeType ==
"mathMinus")
1144 if (sShapeType ==
"mathMultiply")
1149 if (sShapeType ==
"mathNotEqual")
1154 if (sShapeType ==
"mathPlus")
1159 if (sShapeType ==
"nonIsoscelesTrapezoid")
1164 if (sShapeType ==
"noSmoking")
1169 if (sShapeType ==
"notchedRightArrow")
1174 if (sShapeType ==
"octagon")
1177 if (!aPoint1.nCurrVal.has_value() || !aPoint1.nMaxVal.has_value()
1178 || !aPoint1.nMinVal.has_value())
1184 = std::lround(*aPoint1.nCurrVal / (*aPoint1.nMaxVal - *aPoint1.nMinVal) * 50000);
1186 &&
WriteAV(
u"adj", OUString(
u"val " + OUString::number(nVal1)))
1189 if (sShapeType ==
"parallelogram")
1192 if (!aPoint1.nCurrVal.has_value() || !aPoint1.nMaxVal.has_value()
1193 || !aPoint1.nMinVal.has_value())
1201 = std::lround(*aPoint1.nCurrVal / (*aPoint1.nMaxVal - *aPoint1.nMinVal) * nMaxVal);
1203 &&
WriteAV(
u"adj", OUString(
u"val " + OUString::number(nVal1)))
1206 if (sShapeType ==
"pentagon")
1211 if (sShapeType ==
"pie")
1216 if (sShapeType ==
"pieWedge")
1221 if (sShapeType ==
"plaque")
1226 if (sShapeType ==
"plaqueTabs")
1231 if (sShapeType ==
"plus")
1234 if (!aPoint1.nCurrVal.has_value() || !aPoint1.nMaxVal.has_value()
1235 || !aPoint1.nMinVal.has_value())
1241 = std::lround(*aPoint1.nCurrVal / (*aPoint1.nMaxVal - *aPoint1.nMinVal) * 50000);
1243 &&
WriteAV(
u"adj", OUString(
u"val " + OUString::number(nVal1)))
1246 if (sShapeType ==
"quadArrow")
1251 if (sShapeType ==
"quadArrowCallout")
1256 if (sShapeType ==
"rect")
1261 if (sShapeType ==
"ribbon")
1266 if (sShapeType ==
"ribbon2")
1271 if (sShapeType ==
"rightArrow")
1275 if (!aPointX.nCurrVal.has_value() || !aPointX.nMaxVal.has_value()
1276 || !aPointX.nMinVal.has_value() || !aPointY.nCurrVal.has_value()
1277 || !aPointY.nMaxVal.has_value() || !aPointY.nMinVal.has_value())
1285 * (double(
m_xShape->getSize().Width)
1287 tools::Long nVal1 = std::lround((*aPointY.nMaxVal - *aPointY.nCurrVal)
1288 / (*aPointY.nMaxVal - *aPointY.nMinVal) * nMaxVal1);
1289 tools::Long nVal2 = std::lround((*aPointX.nMaxVal - *aPointX.nCurrVal)
1290 / (*aPointX.nMaxVal - *aPointX.nMinVal) * nMaxVal2);
1292 &&
WriteAV(
u"adj1", OUString(
u"val " + OUString::number(nVal1)))
1293 &&
WriteAV(
u"adj2", OUString(
u"val " + OUString::number(nVal2)))
1296 if (sShapeType ==
"rightArrowCallout")
1302 if (!aBoxWidth.nCurrVal.has_value() || !aBoxWidth.nMaxVal.has_value()
1303 || !aBoxWidth.nMinVal.has_value() || !aNeckLength.nCurrVal.has_value()
1304 || !aNeckLength.nMaxVal.has_value() || !aNeckLength.nMinVal.has_value()
1305 || !aNeckFromBox.nCurrVal.has_value() || !aNeckFromBox.nMaxVal.has_value()
1306 || !aNeckFromBox.nMinVal.has_value() || !aHeadFromNeck.nCurrVal.has_value()
1307 || !aHeadFromNeck.nMaxVal.has_value() || !aHeadFromNeck.nMinVal.has_value())
1313 = 100000 *
m_xShape->getSize().Height
1316 = 50000 *
m_xShape->getSize().Height
1319 = 100000 *
m_xShape->getSize().Width
1322 = std::lround((*aNeckFromBox.nMaxVal - *aNeckFromBox.nCurrVal)
1323 / (*aNeckFromBox.nMaxVal - *aNeckFromBox.nMinVal) * nMaxVal1);
1324 tools::Long nVal2 = std::lround((10800 - *aHeadFromNeck.nCurrVal)
1325 / (10800 - *aHeadFromNeck.nMinVal) * nMaxVal2);
1327 = std::lround((*aNeckLength.nMaxVal - *aNeckLength.nCurrVal)
1328 / (*aNeckLength.nMaxVal - *aNeckLength.nMinVal) * nMaxVal3);
1329 tools::Long nVal4 = std::lround((*aBoxWidth.nCurrVal - *aBoxWidth.nMinVal)
1330 / (21600 - *aBoxWidth.nMinVal) * 100000);
1332 &&
WriteAV(
u"adj1", OUString(
u"val " + OUString::number(nVal1)))
1333 &&
WriteAV(
u"adj2", OUString(
u"val " + OUString::number(nVal2)))
1334 &&
WriteAV(
u"adj3", OUString(
u"val " + OUString::number(nVal3)))
1335 &&
WriteAV(
u"adj4", OUString(
u"val " + OUString::number(nVal4)))
1338 if (sShapeType ==
"rightBrace")
1343 if (sShapeType ==
"rightBracket")
1348 if (sShapeType ==
"round1Rect")
1353 if (sShapeType ==
"round2DiagRect")
1358 if (sShapeType ==
"round2SameRect")
1363 if (sShapeType ==
"roundRect")
1369 if (!aPointX.nCurrVal.has_value() || !aPointX.nMaxVal.has_value()
1370 || !aPointX.nMinVal.has_value())
1372 nVal1 = std::lround(*aPointX.nCurrVal / (*aPointX.nMaxVal - *aPointX.nMinVal)
1378 if (!aPointY.nCurrVal.has_value() || !aPointY.nMaxVal.has_value()
1379 || !aPointY.nMinVal.has_value())
1381 nVal1 = std::lround(*aPointY.nCurrVal / (*aPointY.nMaxVal - *aPointY.nMinVal)
1388 &&
WriteAV(
u"adj", OUString(
u"val " + OUString::number(nVal1)))
1391 if (sShapeType ==
"rtTriangle")
1396 if (sShapeType ==
"smileyFace")
1401 if (sShapeType ==
"snip1Rect")
1406 if (sShapeType ==
"snip2DiagRect")
1411 if (sShapeType ==
"snip2SameRect")
1416 if (sShapeType ==
"snipRoundRect")
1421 if (sShapeType ==
"squareTabs")
1426 if (sShapeType ==
"star10")
1431 if (sShapeType ==
"star12")
1436 if (sShapeType ==
"star16")
1441 if (sShapeType ==
"star24")
1446 if (sShapeType ==
"star32")
1451 if (sShapeType ==
"star4")
1456 if (sShapeType ==
"star5")
1461 if (sShapeType ==
"star6")
1466 if (sShapeType ==
"star7")
1471 if (sShapeType ==
"star8")
1476 if (sShapeType ==
"straightConnector1")
1481 if (sShapeType ==
"stripedRightArrow")
1486 if (sShapeType ==
"sun")
1491 if (sShapeType ==
"swooshArrow")
1496 if (sShapeType ==
"teardrop")
1501 if (sShapeType ==
"trapezoid")
1506 if (sShapeType ==
"triangle")
1509 if (!aPoint1.nCurrVal.has_value() || !aPoint1.nMaxVal.has_value()
1510 || !aPoint1.nMinVal.has_value())
1517 = std::lround(*aPoint1.nCurrVal / (*aPoint1.nMaxVal - *aPoint1.nMinVal) * nMaxVal);
1519 &&
WriteAV(
u"adj", OUString(
u"val " + OUString::number(nVal1)))
1522 if (sShapeType ==
"upArrowCallout")
1528 if (!aNeckFromBox.nCurrVal.has_value() || !aNeckFromBox.nMaxVal.has_value()
1529 || !aNeckFromBox.nMinVal.has_value() || !aHeadFromNeck.nCurrVal.has_value()
1530 || !aHeadFromNeck.nMaxVal.has_value() || !aHeadFromNeck.nMinVal.has_value()
1531 || !aHeadHeight.nCurrVal.has_value() || !aHeadHeight.nMaxVal.has_value()
1532 || !aHeadHeight.nMinVal.has_value() || !aBoxHeight.nCurrVal.has_value()
1533 || !aBoxHeight.nMaxVal.has_value() || !aBoxHeight.nMinVal.has_value())
1539 = 100000 *
m_xShape->getSize().Width
1542 = 50000 *
m_xShape->getSize().Width
1545 = 100000 *
m_xShape->getSize().Height
1548 = std::lround((*aNeckFromBox.nMaxVal - *aNeckFromBox.nCurrVal)
1549 / (*aNeckFromBox.nMaxVal - *aNeckFromBox.nMinVal) * nMaxVal1);
1550 tools::Long nVal2 = std::lround((10800 - *aHeadFromNeck.nCurrVal)
1551 / (10800 - *aHeadFromNeck.nMinVal) * nMaxVal2);
1552 tools::Long nVal3 = std::lround((*aHeadHeight.nCurrVal - *aHeadHeight.nMinVal)
1553 / (21600 - *aHeadHeight.nMinVal) * nMaxVal3);
1554 tools::Long nVal4 = std::lround((*aBoxHeight.nCurrVal - *aBoxHeight.nMinVal)
1555 / (10800 - *aBoxHeight.nMinVal) * 100000);
1557 &&
WriteAV(
u"adj1", OUString(
u"val " + OUString::number(nVal1)))
1558 &&
WriteAV(
u"adj2", OUString(
u"val " + OUString::number(nVal2)))
1559 &&
WriteAV(
u"adj3", OUString(
u"val " + OUString::number(nVal3)))
1560 &&
WriteAV(
u"adj4", OUString(
u"val " + OUString::number(nVal4)))
1563 if (sShapeType ==
"upDownArrow")
1567 if (!aPointX.nCurrVal.has_value() || !aPointX.nMaxVal.has_value()
1568 || !aPointX.nMinVal.has_value() || !aPointY.nCurrVal.has_value()
1569 || !aPointY.nMaxVal.has_value() || !aPointY.nMinVal.has_value())
1576 = 50000 *
m_xShape->getSize().Height
1578 tools::Long nVal1 = std::lround((*aPointX.nMaxVal - *aPointX.nCurrVal)
1579 / (*aPointX.nMaxVal - *aPointX.nMinVal) * nMaxVal1);
1580 tools::Long nVal2 = std::lround((*aPointY.nCurrVal - *aPointY.nMinVal)
1581 / (*aPointY.nMaxVal - *aPointY.nMinVal) * nMaxVal2);
1583 &&
WriteAV(
u"adj1", OUString(
u"val " + OUString::number(nVal1)))
1584 &&
WriteAV(
u"adj2", OUString(
u"val " + OUString::number(nVal2)))
1587 if (sShapeType ==
"upArrow")
1591 if (!aPointX.nCurrVal.has_value() || !aPointX.nMaxVal.has_value()
1592 || !aPointX.nMinVal.has_value() || !aPointY.nCurrVal.has_value()
1593 || !aPointY.nMaxVal.has_value() || !aPointY.nMinVal.has_value())
1600 = 100000 *
m_xShape->getSize().Height
1602 tools::Long nVal1 = std::lround((*aPointX.nMaxVal - *aPointX.nCurrVal)
1603 / (*aPointX.nMaxVal - *aPointX.nMinVal) * nMaxVal1);
1604 tools::Long nVal2 = std::lround((*aPointY.nCurrVal - *aPointY.nMinVal)
1605 / (*aPointY.nMaxVal - *aPointY.nMinVal) * nMaxVal2);
1607 &&
WriteAV(
u"adj1", OUString(
u"val " + OUString::number(nVal1)))
1608 &&
WriteAV(
u"adj2", OUString(
u"val " + OUString::number(nVal2)))
1611 if (sShapeType ==
"upDownArrowCallout")
1616 if (sShapeType ==
"uturnArrow")
1621 if (sShapeType ==
"verticalScroll")
1626 if (sShapeType ==
"wave")
1631 if (sShapeType ==
"wedgeEllipseCallout")
1636 if (sShapeType ==
"wedgeRectCallout")
1641 if (sShapeType ==
"wedgeRoundRectCallout")
const css::uno::Sequence< css::uno::Sequence< css::beans::PropertyValue > > & GetHandleValues() const
AngleAdjustmentValue GetAdjustmentPointAngleValue(sal_Int32 nPoint)
OUString m_sPresetShapeType
bool StartAVListWriting()
std::pair< bool, bool > m_bIsFlipped
const css::uno::Sequence< css::drawing::EnhancedCustomShapeAdjustmentValue > & GetAdjustmentValues() const
RadiusAdjustmentValue GetAdjustmentPointRadiusValue(sal_Int32 nPoint)
YAdjustmentValue GetAdjustmentPointYValue(sal_Int32 nPoint)
bool HasHandleValue() const
~DMLPresetShapeExporter()
bool WriteShapeWithAVlist()
XAdjustmentValue GetAdjustmentPointXValue(sal_Int32 nPoint)
css::uno::Sequence< css::uno::Sequence< css::beans::PropertyValue > > m_HandleValues
css::uno::Reference< css::drawing::XShape > m_xShape
const OUString & GetShapeType() const
css::uno::Any GetHandleValueOfModificationPoint(sal_Int32 nPoint, std::u16string_view sType)
bool WriteAV(const OUString &sValName, const OUString &sVal)
DrawingML * m_pDMLexporter
DMLPresetShapeExporter()=delete
css::uno::Sequence< css::drawing::EnhancedCustomShapeAdjustmentValue > m_AdjustmentValues
const ::sax_fastparser::FSHelperPtr & GetFS() const
void WriteShapeTransformation(const css::uno::Reference< css::drawing::XShape > &rXShape, sal_Int32 nXmlNamespace, bool bFlipH=false, bool bFlipV=false, bool bSuppressRotation=false, bool bSuppressFlipping=false, bool bFlippedBeforeRotation=false)
void WritePresetShape(const OString &pShape, std::vector< std::pair< sal_Int32, sal_Int32 > > &rAvList)
double getLength(const B2DPolygon &rCandidate)
OString GetOOXMLPresetGeometry(std::u16string_view rShapeType)
std::optional< double > nMinVal
std::optional< double > nMaxVal
std::optional< double > nCurrVal