/* -*- 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/.
*/
namespace oox::drawingml
{ // DMLPresetShapeExporter class
// ctor
DMLPresetShapeExporter::DMLPresetShapeExporter(DrawingML* pDMLExporter,
css::uno::Reference<css::drawing::XShape> xShape)
: m_pDMLexporter(pDMLExporter)
{ // This class only work with custom shapes!
OSL_ASSERT(xShape->getShapeType() == "com.sun.star.drawing.CustomShape");
bool DMLPresetShapeExporter::WriteShape()
{ if (m_pDMLexporter && m_xShape)
{ // Case 1: We do not have adjustment points of the shape: just export it as preset if (!m_bHasHandleValues)
{
OUString sShapeType = GetShapeType(); const OString sPresetShape = msfilter::util::GetOOXMLPresetGeometry(sShapeType);
m_pDMLexporter->WriteShapeTransformation(m_xShape, XML_a, IsXFlipped(), IsYFlipped(), false, false);
m_pDMLexporter->WritePresetShape(sPresetShape); returntrue;
} else// Case2: There are adjustment points what have to be converted and exported.
{ return WriteShapeWithAVlist();
}
} returnfalse;
};
bool DMLPresetShapeExporter::WriteShapeWithAVlist()
{ // Remark: This method is under development. If a shape type is implemented, the corresponding, // return must be set to true. False means nothing done true, export done. There are many // types which do not have pairs in LO, they are do not have to be mapped, because import // filter it does with GrabBag, this method only maps the SDR ones to OOXML shapes.
// OOXML uses 60th of degree, so 360 degree is 21 600 000 60thdeg const tools::Long nConstOfMaxDegreeOf60th = 21600000; try
{ if (sShapeType == "accentBorderCallout1")
{ // LO does not have this type, so it does not necessary to be mapped. returnfalse;
} if (sShapeType == "accentBorderCallout2")
{ // LO does not have this type, so it does not necessary to be mapped. returnfalse;
} if (sShapeType == "accentBorderCallout3")
{ // LO does not have this type, so it does not necessary to be mapped. returnfalse;
} if (sShapeType == "accentCallout1")
{ // LO does not have this type, so it does not necessary to be mapped. returnfalse;
} if (sShapeType == "accentCallout2")
{ // LO does not have this type, so it does not necessary to be mapped. returnfalse;
} if (sShapeType == "accentCallout3")
{ // LO does not have this type, so it does not necessary to be mapped. returnfalse;
} if (sShapeType == "actionButtonBackPrevious")
{ // LO does not have this type, so it does not necessary to be mapped. returnfalse;
} if (sShapeType == "actionButtonBeginning")
{ // LO does not have this type, so it does not necessary to be mapped. returnfalse;
} if (sShapeType == "actionButtonBlank")
{ // LO does not have this type, so it does not necessary to be mapped. returnfalse;
} if (sShapeType == "actionButtonDocument")
{ // LO does not have this type, so it does not necessary to be mapped. returnfalse;
} if (sShapeType == "actionButtonEnd")
{ // LO does not have this type, so it does not necessary to be mapped. returnfalse;
} if (sShapeType == "actionButtonForwardNext")
{ // LO does not have this type, so it does not necessary to be mapped. returnfalse;
} if (sShapeType == "actionButtonHelp")
{ // LO does not have this type, so it does not necessary to be mapped. returnfalse;
} if (sShapeType == "actionButtonHome")
{ // LO does not have this type, so it does not necessary to be mapped. returnfalse;
} if (sShapeType == "actionButtonInformation")
{ // LO does not have this type, so it does not necessary to be mapped. returnfalse;
} if (sShapeType == "actionButtonMovie")
{ // LO does not have this type, so it does not necessary to be mapped. returnfalse;
} if (sShapeType == "actionButtonReturn")
{ // LO does not have this type, so it does not necessary to be mapped. returnfalse;
} if (sShapeType == "actionButtonSound")
{ // LO does not have this type, so it does not necessary to be mapped. returnfalse;
} if (sShapeType == "arc")
{ // LO does not have handle points for this, so CustGeom is enough. returnfalse;
} if (sShapeType == "bentArrow")
{ // LO has only one type, which have to be rotated, without handling points // So CustGeom enough. returnfalse;
} if (sShapeType == "bentConnector2")
{ // CustGeom Enough returnfalse;
} if (sShapeType == "bentConnector3")
{ // CustGeom Enough returnfalse;
} if (sShapeType == "bentConnector4")
{ // CustGeom Enough returnfalse;
} if (sShapeType == "bentConnector5")
{ // CustGeom Enough returnfalse;
} if (sShapeType == "bentUpArrow")
{ // CustGeom Enough, no handle points returnfalse;
} if (sShapeType == "bevel")
{ auto aPoint1 = GetAdjustmentPointXValue(0); if (!aPoint1.nCurrVal.has_value() || !aPoint1.nMaxVal.has_value()
|| !aPoint1.nMinVal.has_value()) returnfalse;
m_pDMLexporter->WriteShapeTransformation(m_xShape, XML_a, IsXFlipped(), IsYFlipped(), false, false);
tools::Long nVal1
= std::lround(*aPoint1.nCurrVal / (*aPoint1.nMaxVal - *aPoint1.nMinVal) * 50000); return StartAVListWriting()
&& WriteAV(u"adj"_ustr, OUString(u"val " + OUString::number(nVal1)))
&& EndAVListWriting();
} if (sShapeType == "blockArc")
{ auto aPointR = GetAdjustmentPointRadiusValue(0); auto aPointA = GetAdjustmentPointAngleValue(0); if (!aPointA.nCurrVal.has_value() || !aPointA.nMaxVal.has_value()
|| !aPointA.nMinVal.has_value() || !aPointR.nCurrVal.has_value()
|| !aPointR.nMaxVal.has_value() || !aPointR.nMinVal.has_value()) returnfalse;
m_pDMLexporter->WriteShapeTransformation(m_xShape, XML_a, IsXFlipped(), IsYFlipped(), false, false);
tools::Long nVal1
= std::lround((*aPointA.nCurrVal < 0 ? 360 + *aPointA.nCurrVal : *aPointA.nCurrVal)
/ (*aPointA.nMaxVal - *aPointA.nMinVal) * nConstOfMaxDegreeOf60th);
tools::Long nVal2 = std::lround(
(*aPointA.nCurrVal > 180 ? 360 - *aPointA.nCurrVal : 180 - *aPointA.nCurrVal)
/ (*aPointA.nMaxVal - *aPointA.nMinVal) * nConstOfMaxDegreeOf60th);
tools::Long nVal3 = std::lround(
50000 - (*aPointR.nCurrVal / (*aPointR.nMaxVal - *aPointR.nMinVal) * 50000)); return StartAVListWriting()
&& WriteAV(u"adj1"_ustr, OUString(u"val " + OUString::number(nVal1)))
&& WriteAV(u"adj2"_ustr, OUString(u"val " + OUString::number(nVal2)))
&& WriteAV(u"adj3"_ustr, OUString(u"val " + OUString::number(nVal3)))
&& EndAVListWriting();
} if (sShapeType == "borderCallout1")
{ // LO does not have this type, so it does not necessary to be mapped. returnfalse;
} if (sShapeType == "borderCallout2")
{ // LO does not have this type, so it does not necessary to be mapped. returnfalse;
} if (sShapeType == "borderCallout3")
{ // LO does not have this type, so it does not necessary to be mapped. returnfalse;
} if (sShapeType == "bracePair")
{ auto aPoint1 = GetAdjustmentPointYValue(0); if (!aPoint1.nCurrVal.has_value() || !aPoint1.nMaxVal.has_value()
|| !aPoint1.nMinVal.has_value()) returnfalse;
m_pDMLexporter->WriteShapeTransformation(m_xShape, XML_a, IsXFlipped(), IsYFlipped(), false, false);
tools::Long nVal1
= std::lround(*aPoint1.nCurrVal / (*aPoint1.nMaxVal - *aPoint1.nMinVal) * 50000); return StartAVListWriting()
&& WriteAV(u"adj"_ustr, OUString(u"val " + OUString::number(nVal1)))
&& EndAVListWriting();
} if (sShapeType == "callout1")
{ // LO does not have this type, so it does not necessary to be mapped. returnfalse;
} if (sShapeType == "callout2")
{ // LO does not have this type, so it does not necessary to be mapped. returnfalse;
} if (sShapeType == "callout3")
{ // LO does not have this type, so it does not necessary to be mapped. returnfalse;
} if (sShapeType == "can")
{ returnfalse; // Do the export as before.
} if (sShapeType == "chartPlus")
{ // LO does not have this type, so it does not necessary to be mapped. returnfalse;
} if (sShapeType == "chartStar")
{ // LO does not have this type, so it does not necessary to be mapped. returnfalse;
} if (sShapeType == "chartX")
{ // LO does not have this type, so it does not necessary to be mapped. returnfalse;
} if (sShapeType == "chord")
{ // CustGeom, because LO does not have handle points returnfalse;
} if (sShapeType == "circularArrow")
{ // LO does not have this type, so it does not necessary to be mapped. returnfalse;
} if (sShapeType == "cloud")
{ // CustGeom enough returnfalse;
} if (sShapeType == "cloudCallout")
{ returnfalse; // Works fine without this, so export it like before.
} if (sShapeType == "cornerTabs")
{ // LO does not have this type, so it does not necessary to be mapped. returnfalse;
} if (sShapeType == "cube")
{ // Works fine without this, so export it like before. returnfalse;
} if (sShapeType == "curvedConnector2")
{ // Not necessary to be mapped returnfalse;
} if (sShapeType == "curvedConnector3")
{ // Not necessary to be mapped returnfalse;
} if (sShapeType == "curvedConnector4")
{ // Not necessary to be mapped returnfalse;
} if (sShapeType == "curvedConnector5")
{ // Not necessary to be mapped returnfalse;
} if (sShapeType == "curvedDownArrow")
{ // LO does not have this type, so it does not necessary to be mapped. returnfalse;
} if (sShapeType == "curvedLeftArrow")
{ // LO does not have this type, so it does not necessary to be mapped. returnfalse;
} if (sShapeType == "curvedRightArrow")
{ // LO does not have this type, so it does not necessary to be mapped. returnfalse;
} if (sShapeType == "curvedUpArrow")
{ // LO does not have this type, so it does not necessary to be mapped. returnfalse;
} if (sShapeType == "decagon")
{ // LO does not have this type, so it does not necessary to be mapped. returnfalse;
} if (sShapeType == "diagStripe")
{ // LO does not have this type, so it does not necessary to be mapped. returnfalse;
} if (sShapeType == "diamond")
{ // It does not have handle points so it do not have to be mapped. returnfalse;
} if (sShapeType == "dodecagon")
{ // LO does not have this type, so it does not necessary to be mapped. returnfalse;
} if (sShapeType == "donut")
{ // TODO returnfalse;
} if (sShapeType == "doubleWave")
{ // LO does not have this type, so it does not necessary to be mapped. returnfalse;
} if (sShapeType == "downArrow")
{ auto aPointX = GetAdjustmentPointXValue(0); auto aPointY = GetAdjustmentPointYValue(0); if (!aPointX.nCurrVal.has_value() || !aPointX.nMaxVal.has_value()
|| !aPointX.nMinVal.has_value() || !aPointY.nCurrVal.has_value()
|| !aPointY.nMaxVal.has_value() || !aPointY.nMinVal.has_value()) returnfalse;
m_pDMLexporter->WriteShapeTransformation(m_xShape, XML_a, IsXFlipped(), IsYFlipped(), false, false);
tools::Long nMaxVal1
= 100000 * m_xShape->getSize().Width
/ std::min(m_xShape->getSize().Width, m_xShape->getSize().Height);
tools::Long nMaxVal2
= 50000 * m_xShape->getSize().Width
/ std::min(m_xShape->getSize().Width, m_xShape->getSize().Height);
tools::Long nMaxVal3
= 100000 * m_xShape->getSize().Height
/ std::min(m_xShape->getSize().Width, m_xShape->getSize().Height);
tools::Long nVal1
= std::lround((*aNeckFromBox.nMaxVal - *aNeckFromBox.nCurrVal)
/ (*aNeckFromBox.nMaxVal - *aNeckFromBox.nMinVal) * nMaxVal1);
tools::Long nVal2 = std::lround((10800 - *aHeadFromNeck.nCurrVal)
/ (10800 - *aHeadFromNeck.nMinVal) * nMaxVal2);
tools::Long nVal3
= std::lround((*aHeadHeight.nMaxVal - *aHeadHeight.nCurrVal)
/ (*aHeadHeight.nMaxVal - *aHeadHeight.nMinVal) * nMaxVal3);
tools::Long nVal4 = std::lround((*aBoxHeight.nCurrVal - *aBoxHeight.nMinVal)
/ (21600 - *aBoxHeight.nMinVal) * 100000); return StartAVListWriting()
&& WriteAV(u"adj1"_ustr, OUString(u"val " + OUString::number(nVal1)))
&& WriteAV(u"adj2"_ustr, OUString(u"val " + OUString::number(nVal2)))
&& WriteAV(u"adj3"_ustr, OUString(u"val " + OUString::number(nVal3)))
&& WriteAV(u"adj4"_ustr, OUString(u"val " + OUString::number(nVal4)))
&& EndAVListWriting();
} if (sShapeType == "ellipse")
{ // Does not have handle points, so preset enough. returnfalse;
} if (sShapeType == "ellipseRibbon")
{ // LO does not have this type, so it does not necessary to be mapped. returnfalse;
} if (sShapeType == "ellipseRibbon2")
{ // LO does not have this type, so it does not necessary to be mapped. returnfalse;
} if (sShapeType == "flowChartAlternateProcess")
{ // Does not have handle points, so preset enough. returnfalse;
} if (sShapeType == "flowChartCollate")
{ // Does not have handle points, so preset enough. returnfalse;
} if (sShapeType == "flowChartConnector")
{ // Does not have handle points, so preset enough. returnfalse;
} if (sShapeType == "flowChartDecision")
{ // Does not have handle points, so preset enough. returnfalse;
} if (sShapeType == "flowChartDelay")
{ // Does not have handle points, so preset enough. returnfalse;
} if (sShapeType == "flowChartDisplay")
{ // Does not have handle points, so preset enough. returnfalse;
} if (sShapeType == "flowChartDocument")
{ // Does not have handle points, so preset enough. returnfalse;
} if (sShapeType == "flowChartExtract")
{ // Does not have handle points, so preset enough. returnfalse;
} if (sShapeType == "flowChartInputOutput")
{ // Does not have handle points, so preset enough. returnfalse;
} if (sShapeType == "flowChartInternalStorage")
{ // Does not have handle points, so preset enough. returnfalse;
} if (sShapeType == "flowChartMagneticDisk")
{ // Does not have handle points, so preset enough. returnfalse;
} if (sShapeType == "flowChartMagneticDrum")
{ // Does not have handle points, so preset enough. returnfalse;
} if (sShapeType == "flowChartMagneticTape")
{ // Does not have handle points, so preset enough. returnfalse;
} if (sShapeType == "flowChartManualInput")
{ // Does not have handle points, so preset enough. returnfalse;
} if (sShapeType == "flowChartManualOperation")
{ // Does not have handle points, so preset enough. returnfalse;
} if (sShapeType == "flowChartMerge")
{ // Does not have handle points, so preset enough. returnfalse;
} if (sShapeType == "flowChartMultidocument")
{ // Does not have handle points, so preset enough. returnfalse;
} if (sShapeType == "flowChartOfflineStorage")
{ // Does not have handle points, so preset enough. returnfalse;
} if (sShapeType == "flowChartOffpageConnector")
{ // Does not have handle points, so preset enough. returnfalse;
} if (sShapeType == "flowChartOnlineStorage")
{ // Does not have handle points, so preset enough. returnfalse;
} if (sShapeType == "flowChartOr")
{ // Does not have handle points, so preset enough. returnfalse;
} if (sShapeType == "flowChartPredefinedProcess")
{ // Does not have handle points, so preset enough. returnfalse;
} if (sShapeType == "flowChartPreparation")
{ // Does not have handle points, so preset enough. returnfalse;
} if (sShapeType == "flowChartPunchedCard")
{ // Does not have handle points, so preset enough. returnfalse;
} if (sShapeType == "flowChartPunchedTape")
{ // Does not have handle points, so preset enough. returnfalse;
} if (sShapeType == "flowChartSort")
{ // Does not have handle points, so preset enough. returnfalse;
} if (sShapeType == "flowChartSummingJunction")
{ // Does not have handle points, so preset enough. returnfalse;
} if (sShapeType == "flowChartTerminator")
{ // Does not have handle points, so preset enough. returnfalse;
} if (sShapeType == "foldedCorner")
{ // TODO returnfalse;
} if (sShapeType == "frame")
{ // TODO returnfalse;
} if (sShapeType == "funnel")
{ // Not found in word returnfalse;
} if (sShapeType == "gear6")
{ // Not found in word returnfalse;
} if (sShapeType == "gear9")
{ // Not found in word returnfalse;
} if (sShapeType == "halfFrame")
{ // LO does not have this type, not necessary to map returnfalse;
} if (sShapeType == "heart")
{ // TODO returnfalse;
} if (sShapeType == "heptagon")
{ // LO does not have this type, not necessary to map returnfalse;
} if (sShapeType == "hexagon")
{ auto aPoint1 = GetAdjustmentPointXValue(0); if (!aPoint1.nCurrVal.has_value() || !aPoint1.nMaxVal.has_value()
|| !aPoint1.nMinVal.has_value()) returnfalse;
m_pDMLexporter->WriteShapeTransformation(m_xShape, XML_a, IsXFlipped(), IsYFlipped(), false, false);
tools::Long nMaxVal = 50000 * m_xShape->getSize().Width
/ std::min(m_xShape->getSize().Width, m_xShape->getSize().Height);
tools::Long nVal1
= std::lround(*aPoint1.nCurrVal / (*aPoint1.nMaxVal - *aPoint1.nMinVal) * nMaxVal); return StartAVListWriting()
&& WriteAV(u"adj"_ustr, OUString(u"val " + OUString::number(nVal1)))
&& WriteAV(u"vf"_ustr, OUString(u"val " + OUString::number(115470)))
&& EndAVListWriting();
} if (sShapeType == "homePlate")
{ // Not found in word returnfalse;
} if (sShapeType == "horizontalScroll")
{ // TODO returnfalse;
} if (sShapeType == "irregularSeal1")
{ // Not found in word returnfalse;
} if (sShapeType == "irregularSeal2")
{ // Not found in word returnfalse;
} if (sShapeType == "leftArrow")
{ auto aPointX = GetAdjustmentPointXValue(0); auto aPointY = GetAdjustmentPointYValue(0); if (!aPointX.nCurrVal.has_value() || !aPointX.nMaxVal.has_value()
|| !aPointX.nMinVal.has_value() || !aPointY.nCurrVal.has_value()
|| !aPointY.nMaxVal.has_value() || !aPointY.nMinVal.has_value()) returnfalse;
m_pDMLexporter->WriteShapeTransformation(m_xShape, XML_a, IsXFlipped(), IsYFlipped(), false, false);
tools::Long nMaxVal1
= 100000 * m_xShape->getSize().Width
/ std::min(m_xShape->getSize().Width, m_xShape->getSize().Height);
tools::Long nMaxVal2
= 50000 * m_xShape->getSize().Width
/ std::min(m_xShape->getSize().Width, m_xShape->getSize().Height);
tools::Long nMaxVal3
= 100000 * m_xShape->getSize().Height
/ std::min(m_xShape->getSize().Width, m_xShape->getSize().Height);
tools::Long nVal1
= std::lround((*aNeckFromBox.nMaxVal - *aNeckFromBox.nCurrVal)
/ (*aNeckFromBox.nMaxVal - *aNeckFromBox.nMinVal) * nMaxVal1);
tools::Long nVal2 = std::lround((10800 - *aHeadFromNeck.nCurrVal)
/ (10800 - *aHeadFromNeck.nMinVal) * nMaxVal2);
tools::Long nVal3 = std::lround((*aHeadHeight.nCurrVal - *aHeadHeight.nMinVal)
/ (21600 - *aHeadHeight.nMinVal) * nMaxVal3);
tools::Long nVal4 = std::lround((*aBoxHeight.nCurrVal - *aBoxHeight.nMinVal)
/ (10800 - *aBoxHeight.nMinVal) * 100000); return StartAVListWriting()
&& WriteAV(u"adj1"_ustr, OUString(u"val " + OUString::number(nVal1)))
&& WriteAV(u"adj2"_ustr, OUString(u"val " + OUString::number(nVal2)))
&& WriteAV(u"adj3"_ustr, OUString(u"val " + OUString::number(nVal3)))
&& WriteAV(u"adj4"_ustr, OUString(u"val " + OUString::number(nVal4)))
&& EndAVListWriting();
} if (sShapeType == "leftRightCircularArrow")
{ // Not found in word returnfalse;
} if (sShapeType == "leftRightRibbon")
{ // LO does not have this type so mapping not necessary returnfalse;
} if (sShapeType == "leftRightUpArrow")
{ // TODO? // MS Word stretches the arrow to fit the bounding box; LO doesn't returnfalse;
} if (sShapeType == "leftUpArrow")
{ // MS Word's and LO's interpretations of what a leftUpArrow should look like // are too different to find a compromise :(
} if (sShapeType == "lightningBolt")
{ // Difference between the SDR and OOXML variants, custgeom? returnfalse;
} if (sShapeType == "line")
{ // Not necessary returnfalse;
} if (sShapeType == "lineInv")
{ // Not necessary returnfalse;
} if (sShapeType == "mathDivide")
{ // LO does not have this type so mapping not necessary returnfalse;
} if (sShapeType == "mathEqual")
{ // LO does not have this type so mapping not necessary returnfalse;
} if (sShapeType == "mathMinus")
{ // LO does not have this type so mapping not necessary returnfalse;
} if (sShapeType == "mathMultiply")
{ // LO does not have this type so mapping not necessary returnfalse;
} if (sShapeType == "mathNotEqual")
{ // LO does not have this type so mapping not necessary returnfalse;
} if (sShapeType == "mathPlus")
{ // LO does not have this type so mapping not necessary returnfalse;
} if (sShapeType == "nonIsoscelesTrapezoid")
{ // TODO returnfalse;
} if (sShapeType == "noSmoking")
{ // TODO returnfalse;
} if (sShapeType == "notchedRightArrow")
{ // TODO returnfalse;
} if (sShapeType == "octagon")
{ auto aPoint1 = GetAdjustmentPointXValue(0); if (!aPoint1.nCurrVal.has_value() || !aPoint1.nMaxVal.has_value()
|| !aPoint1.nMinVal.has_value()) returnfalse;
m_pDMLexporter->WriteShapeTransformation(m_xShape, XML_a, IsXFlipped(), IsYFlipped(), false, false);
tools::Long nMaxVal = 100000 * m_xShape->getSize().Width
/ std::min(m_xShape->getSize().Width, m_xShape->getSize().Height);
tools::Long nVal1
= std::lround(*aPoint1.nCurrVal / (*aPoint1.nMaxVal - *aPoint1.nMinVal) * nMaxVal); return StartAVListWriting()
&& WriteAV(u"adj"_ustr, OUString(u"val " + OUString::number(nVal1)))
&& EndAVListWriting();
} if (sShapeType == "pentagon")
{ // TODO returnfalse;
} if (sShapeType == "pie")
{ // TODO returnfalse;
} if (sShapeType == "pieWedge")
{ // Not found in word. returnfalse;
} if (sShapeType == "plaque")
{ // TODO returnfalse;
} if (sShapeType == "plaqueTabs")
{ // LO does not have this, so not necessary to map. returnfalse;
} if (sShapeType == "plus")
{ auto aPoint1 = GetAdjustmentPointXValue(0); if (!aPoint1.nCurrVal.has_value() || !aPoint1.nMaxVal.has_value()
|| !aPoint1.nMinVal.has_value()) returnfalse;
m_pDMLexporter->WriteShapeTransformation(m_xShape, XML_a, IsXFlipped(), IsYFlipped(), false, false);
tools::Long nVal1
= std::lround(*aPoint1.nCurrVal / (*aPoint1.nMaxVal - *aPoint1.nMinVal) * 50000); return StartAVListWriting()
&& WriteAV(u"adj"_ustr, OUString(u"val " + OUString::number(nVal1)))
&& EndAVListWriting();
} if (sShapeType == "quadArrow")
{ // TODO returnfalse;
} if (sShapeType == "quadArrowCallout")
{ // TODO returnfalse;
} if (sShapeType == "rect")
{ // preset enough without AV points. returnfalse;
} if (sShapeType == "ribbon")
{ // LO does not have this, so not necessary to map. returnfalse;
} if (sShapeType == "ribbon2")
{ // LO does not have this, so not necessary to map. returnfalse;
} if (sShapeType == "rightArrow")
{ auto aPointX = GetAdjustmentPointXValue(0); auto aPointY = GetAdjustmentPointYValue(0); if (!aPointX.nCurrVal.has_value() || !aPointX.nMaxVal.has_value()
|| !aPointX.nMinVal.has_value() || !aPointY.nCurrVal.has_value()
|| !aPointY.nMaxVal.has_value() || !aPointY.nMinVal.has_value()) returnfalse;
m_pDMLexporter->WriteShapeTransformation(m_xShape, XML_a, IsXFlipped(), IsYFlipped(), false, false);
tools::Long nMaxVal1
= 100000 * m_xShape->getSize().Height
/ std::min(m_xShape->getSize().Width, m_xShape->getSize().Height);
tools::Long nMaxVal2
= 50000 * m_xShape->getSize().Height
/ std::min(m_xShape->getSize().Width, m_xShape->getSize().Height);
tools::Long nMaxVal3
= 100000 * m_xShape->getSize().Width
/ std::min(m_xShape->getSize().Width, m_xShape->getSize().Height);
tools::Long nVal1
= std::lround((*aNeckFromBox.nMaxVal - *aNeckFromBox.nCurrVal)
/ (*aNeckFromBox.nMaxVal - *aNeckFromBox.nMinVal) * nMaxVal1);
tools::Long nVal2 = std::lround((10800 - *aHeadFromNeck.nCurrVal)
/ (10800 - *aHeadFromNeck.nMinVal) * nMaxVal2);
tools::Long nVal3
= std::lround((*aNeckLength.nMaxVal - *aNeckLength.nCurrVal)
/ (*aNeckLength.nMaxVal - *aNeckLength.nMinVal) * nMaxVal3);
tools::Long nVal4 = std::lround((*aBoxWidth.nCurrVal - *aBoxWidth.nMinVal)
/ (21600 - *aBoxWidth.nMinVal) * 100000); return StartAVListWriting()
&& WriteAV(u"adj1"_ustr, OUString(u"val " + OUString::number(nVal1)))
&& WriteAV(u"adj2"_ustr, OUString(u"val " + OUString::number(nVal2)))
&& WriteAV(u"adj3"_ustr, OUString(u"val " + OUString::number(nVal3)))
&& WriteAV(u"adj4"_ustr, OUString(u"val " + OUString::number(nVal4)))
&& EndAVListWriting();
} if (sShapeType == "rightBrace")
{ // TODO returnfalse;
} if (sShapeType == "rightBracket")
{ // TODO returnfalse;
} if (sShapeType == "round1Rect")
{ // LO does not have this, so not necessary to map. returnfalse;
} if (sShapeType == "round2DiagRect")
{ // LO does not have this, so not necessary to map. returnfalse;
} if (sShapeType == "round2SameRect")
{ // LO does not have this, so not necessary to map. returnfalse;
} if (sShapeType == "roundRect")
{
tools::Long nVal1 = 0; if (m_xShape->getSize().Width >= m_xShape->getSize().Height)
{ auto aPointX = GetAdjustmentPointXValue(0); if (!aPointX.nCurrVal.has_value() || !aPointX.nMaxVal.has_value()
|| !aPointX.nMinVal.has_value()) returnfalse;
nVal1 = std::lround(*aPointX.nCurrVal / (*aPointX.nMaxVal - *aPointX.nMinVal)
* 50000);
} else
{ auto aPointY = GetAdjustmentPointYValue(0); if (!aPointY.nCurrVal.has_value() || !aPointY.nMaxVal.has_value()
|| !aPointY.nMinVal.has_value()) returnfalse;
nVal1 = std::lround(*aPointY.nCurrVal / (*aPointY.nMaxVal - *aPointY.nMinVal)
* 50000);
}
m_pDMLexporter->WriteShapeTransformation(m_xShape, XML_a, IsXFlipped(), IsYFlipped(), false, false); return StartAVListWriting()
&& WriteAV(u"adj"_ustr, OUString(u"val " + OUString::number(nVal1)))
&& EndAVListWriting();
} if (sShapeType == "rtTriangle")
{ // Does not have AV points not necessary to map returnfalse;
} if (sShapeType == "smileyFace")
{ // TODO returnfalse;
} if (sShapeType == "snip1Rect")
{ // LO does not have this, so not necessary to map. returnfalse;
} if (sShapeType == "snip2DiagRect")
{ // LO does not have this, so not necessary to map. returnfalse;
} if (sShapeType == "snip2SameRect")
{ // LO does not have this, so not necessary to map. returnfalse;
} if (sShapeType == "snipRoundRect")
{ // LO does not have this, so not necessary to map. returnfalse;
} if (sShapeType == "squareTabs")
{ // LO does not have this, so not necessary to map. returnfalse;
} if (sShapeType == "star10")
{ // LO does not have this, so not necessary to map. returnfalse;
} if (sShapeType == "star12")
{ // TODO returnfalse;
} if (sShapeType == "star16")
{ // LO does not have this, so not necessary to map. returnfalse;
} if (sShapeType == "star24")
{ // TODO returnfalse;
} if (sShapeType == "star32")
{ // LO does not have this, so not necessary to map. returnfalse;
} if (sShapeType == "star4")
{ // TODO returnfalse;
} if (sShapeType == "star5")
{ // TODO returnfalse;
} if (sShapeType == "star6")
{ // TODO returnfalse;
} if (sShapeType == "star7")
{ // LO does not have this, so not necessary to map. returnfalse;
} if (sShapeType == "star8")
{ // TODO returnfalse;
} if (sShapeType == "straightConnector1")
{ // Not necessary to map. returnfalse;
} if (sShapeType == "stripedRightArrow")
{ // TODO returnfalse;
} if (sShapeType == "sun")
{ // TODO returnfalse;
} if (sShapeType == "swooshArrow")
{ // Not found in word. returnfalse;
} if (sShapeType == "teardrop")
{ // TODO returnfalse;
} if (sShapeType == "trapezoid")
{ // Preset enough. returnfalse;
} if (sShapeType == "triangle")
{ auto aPoint1 = GetAdjustmentPointXValue(0); if (!aPoint1.nCurrVal.has_value() || !aPoint1.nMaxVal.has_value()
|| !aPoint1.nMinVal.has_value()) returnfalse;
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.