13#include <com/sun/star/container/XNamed.hpp>
14#include <com/sun/star/drawing/FillStyle.hpp>
15#include <com/sun/star/drawing/EnhancedCustomShapeParameterPair.hpp>
16#include <com/sun/star/drawing/XEnhancedCustomShapeDefaulter.hpp>
17#include <com/sun/star/drawing/XDrawPageSupplier.hpp>
18#include <com/sun/star/drawing/LineStyle.hpp>
19#include <com/sun/star/drawing/EnhancedCustomShapeSegment.hpp>
20#include <com/sun/star/drawing/EnhancedCustomShapeSegmentCommand.hpp>
21#include <com/sun/star/drawing/ColorMode.hpp>
22#include <com/sun/star/lang/XServiceInfo.hpp>
23#include <com/sun/star/table/BorderLine2.hpp>
24#include <com/sun/star/text/HoriOrientation.hpp>
25#include <com/sun/star/text/RelOrientation.hpp>
26#include <com/sun/star/text/SizeType.hpp>
27#include <com/sun/star/text/VertOrientation.hpp>
28#include <com/sun/star/text/WrapTextMode.hpp>
29#include <com/sun/star/text/WritingMode.hpp>
30#include <com/sun/star/text/WritingMode2.hpp>
31#include <com/sun/star/text/TextContentAnchorType.hpp>
32#include <com/sun/star/text/XTextRange.hpp>
33#include <com/sun/star/lang/XMultiServiceFactory.hpp>
34#include <ooxml/resourceids.hxx>
63 , m_bTextGraphicObject(false)
85 xPropertySet.set(xShape, uno::UNO_QUERY);
90 std::vector<beans::PropertyValue> aRet;
91 beans::PropertyValue aPropertyValue;
93 aPropertyValue.Name =
"HoriOrient";
95 aRet.push_back(aPropertyValue);
96 aPropertyValue.Name =
"HoriOrientRelation";
98 aRet.push_back(aPropertyValue);
99 aPropertyValue.Name =
"VertOrient";
101 aRet.push_back(aPropertyValue);
102 aPropertyValue.Name =
"VertOrientRelation";
104 aRet.push_back(aPropertyValue);
107 aPropertyValue.Name =
"BackColorTransparency";
108 aPropertyValue.Value <<= sal_Int32(100);
109 aRet.push_back(aPropertyValue);
112 aPropertyValue.Name =
"LeftBorderDistance";
113 aPropertyValue.Value <<= sal_Int32(bNew ? (91440 / 360) : 0);
114 aRet.push_back(aPropertyValue);
115 aPropertyValue.Name =
"RightBorderDistance";
116 aPropertyValue.Value <<= sal_Int32(bNew ? (91440 / 360) : 0);
117 aRet.push_back(aPropertyValue);
118 aPropertyValue.Name =
"TopBorderDistance";
119 aPropertyValue.Value <<= sal_Int32(bNew ? (45720 / 360) : 0);
120 aRet.push_back(aPropertyValue);
121 aPropertyValue.Name =
"BottomBorderDistance";
122 aPropertyValue.Value <<= sal_Int32(bNew ? (45720 / 360) : 0);
123 aRet.push_back(aPropertyValue);
124 aPropertyValue.Name =
"SizeType";
125 aPropertyValue.Value <<= text::SizeType::FIX;
126 aRet.push_back(aPropertyValue);
145 sal_Int32
const nZOrder,
bool const bOldStyle)
150 xPropertySet->setPropertyValue(
"ZOrder",
uno::Any(rHelper.
findZOrder(nZOrder, bOldStyle)));
151 rHelper.
addItem(xPropertySet, nZOrder);
161 xPropertySet->setPropertyValue(
"LineColor", rLineColor);
162 xPropertySet->setPropertyValue(
"LineWidth", rLineWidth);
166 static const char* aBorders[]
167 = {
"TopBorder",
"LeftBorder",
"BottomBorder",
"RightBorder" };
168 for (
const char* pBorder : aBorders)
170 auto aBorderLine = xPropertySet->getPropertyValue(OUString::createFromAscii(pBorder))
171 .get<table::BorderLine2>();
173 aBorderLine.Color = rLineColor.get<sal_Int32>();
175 aBorderLine.LineWidth = rLineWidth.get<sal_Int32>();
176 xPropertySet->setPropertyValue(OUString::createFromAscii(pBorder),
183 sal_Int32
const nFLine)
186 xPropertySet->setPropertyValue(
"LineStyle",
uno::Any(drawing::LineStyle_NONE));
188 xPropertySet->setPropertyValue(
"LineStyle",
uno::Any(drawing::LineStyle_SOLID));
192 std::u16string_view aKey, std::u16string_view aValue)
const
195 sal_Int16 nHoriOrient = 0;
196 sal_Int16 nVertOrient = 0;
197 std::optional<bool> obFitShapeToText;
205 nHoriOrient = text::HoriOrientation::LEFT;
208 nHoriOrient = text::HoriOrientation::CENTER;
211 nHoriOrient = text::HoriOrientation::RIGHT;
214 nHoriOrient = text::HoriOrientation::INSIDE;
217 nHoriOrient = text::HoriOrientation::OUTSIDE;
223 else if (aKey ==
u"posv")
228 nVertOrient = text::VertOrientation::TOP;
231 nVertOrient = text::VertOrientation::CENTER;
234 nVertOrient = text::VertOrientation::BOTTOM;
240 else if (aKey ==
u"fFitShapeToText")
242 else if (aKey ==
u"fFilled")
244 else if (aKey ==
u"rotation")
250 if (!xServiceInfo->supportsService(
"com.sun.star.text.TextFrame"))
251 xPropertySet->setPropertyValue(
255 if (nHoriOrient != 0 && xPropertySet.is())
256 xPropertySet->setPropertyValue(
"HoriOrient",
uno::Any(nHoriOrient));
257 if (nVertOrient != 0 && xPropertySet.is())
258 xPropertySet->setPropertyValue(
"VertOrient",
uno::Any(nVertOrient));
259 if (obFitShapeToText.has_value() && xPropertySet.is())
261 xPropertySet->setPropertyValue(
262 "SizeType",
uno::Any(*obFitShapeToText ? text::SizeType::MIN : text::SizeType::FIX));
263 xPropertySet->setPropertyValue(
"FrameIsAutomaticHeight",
uno::Any(*obFitShapeToText));
265 if (!bFilled && xPropertySet.is())
268 xPropertySet->setPropertyValue(
"BackColorTransparency",
uno::Any(sal_Int32(100)));
270 xPropertySet->setPropertyValue(
"FillStyle",
uno::Any(drawing::FillStyle_NONE));
276 RTFShape const& rShape,
bool const bClose,
279 assert(!o_xShape.is());
280 assert(!o_xPropSet.is());
281 o_rIsCustomShape =
false;
287 [](
const std::pair<OUString, OUString>& rProperty) {
288 return rProperty.first ==
"shapeType";
293 if (
SHAPE == shapeOrPict)
307 nType = iter->second.toInt32();
317 createShape(
"com.sun.star.drawing.GraphicObjectShape", o_xShape, o_xPropSet);
321 createShape(
"com.sun.star.drawing.LineShape", o_xShape, o_xPropSet);
328 createShape(
"com.sun.star.text.TextFrame", o_xShape, o_xPropSet);
331 for (
const beans::PropertyValue&
i : aDefaults)
332 o_xPropSet->setPropertyValue(
i.Name,
i.Value);
337 createShape(
"com.sun.star.drawing.CustomShape", o_xShape, o_xPropSet);
338 o_rIsCustomShape =
true;
345 o_xPropSet->setPropertyValue(
363 beans::PropertyValue aPropertyValue;
364 awt::Rectangle aViewBox;
365 std::vector<beans::PropertyValue> aPath;
370 sal_Int16 eWritingMode = text::WritingMode2::LR_TB;
372 std::optional<sal_Int32> oGroupLeft;
373 std::optional<sal_Int32> oGroupTop;
374 std::optional<sal_Int32> oGroupRight;
375 std::optional<sal_Int32> oGroupBottom;
376 std::optional<sal_Int32> oRelLeft;
377 std::optional<sal_Int32> oRelTop;
378 std::optional<sal_Int32> oRelRight;
379 std::optional<sal_Int32> oRelBottom;
387 std::optional<sal_Int16> oRelativeWidth;
388 std::optional<sal_Int16> oRelativeHeight;
389 sal_Int16 nRelativeWidthRelation = text::RelOrientation::PAGE_FRAME;
390 sal_Int16 nRelativeHeightRelation = text::RelOrientation::PAGE_FRAME;
391 std::optional<bool> obRelFlipV;
395 OUString aShapeText =
"";
396 OUString aFontFamily =
"";
397 float nFontSize = 1.0;
399 sal_Int32 nContrast = 0x10000;
400 sal_Int16 nBrightness = 0;
403 int const nType =
initShape(xShape, xPropertySet, bCustom, rShape, bClose, shapeOrPict);
407 if (rProperty.first ==
"shapeType")
411 if (rProperty.first ==
"wzName")
416 xNamed->setName(rProperty.second);
419 xPropertySet->setPropertyValue(
"Name",
uno::Any(rProperty.second));
421 else if (rProperty.first ==
"wzDescription")
422 xPropertySet->setPropertyValue(
"Description",
uno::Any(rProperty.second));
423 else if (rProperty.first ==
"gtextUNICODE")
424 aShapeText = rProperty.second;
425 else if (rProperty.first ==
"gtextFont")
426 aFontFamily = rProperty.second;
427 else if (rProperty.first ==
"gtextSize")
430 nFontSize =
static_cast<float>(rProperty.second.toUInt32()) /
RTF_MULTIPLIER;
432 else if (rProperty.first ==
"pib")
437 else if (rProperty.first ==
"fillColor" && xPropertySet.is())
441 xPropertySet->setPropertyValue(
"BackColor", aAny);
443 xPropertySet->setPropertyValue(
"FillColor", aAny);
450 else if (rProperty.first ==
"fillBackColor")
455 else if (rProperty.first ==
"lineColor")
457 else if (rProperty.first ==
"lineBackColor")
459 else if (rProperty.first ==
"txflTextFlow" && xPropertySet.is())
461 switch (rProperty.second.toInt32())
465 eWritingMode = text::WritingMode2::TB_RL;
468 eWritingMode = text::WritingMode2::BT_LR;
472 else if (rProperty.first ==
"fLine" && xPropertySet.is())
474 else if (rProperty.first ==
"fillOpacity" && xPropertySet.is())
476 int opacity = 100 - (rProperty.second.toInt32()) * 100 /
RTF_MULTIPLIER;
477 xPropertySet->setPropertyValue(
"FillTransparence",
uno::Any(sal_uInt32(opacity)));
479 else if (rProperty.first ==
"lineWidth")
480 aLineWidth <<= rProperty.second.toInt32() / 360;
481 else if (rProperty.first ==
"pVerticies")
483 std::vector<drawing::EnhancedCustomShapeParameterPair> aCoordinates;
486 sal_Int32 nCharIndex = 0;
489 std::u16string_view aToken =
o3tl::getToken(rProperty.second, 0,
';', nCharIndex);
494 else if (!aToken.empty())
497 aToken = aToken.substr(1, aToken.size() - 2);
502 drawing::EnhancedCustomShapeParameterPair aPair;
503 aPair.First.Value <<= nX;
504 aPair.Second.Value <<= nY;
505 aCoordinates.push_back(aPair);
507 }
while (nCharIndex >= 0);
508 aPropertyValue.Name =
"Coordinates";
510 aPath.push_back(aPropertyValue);
512 else if (rProperty.first ==
"pSegmentInfo")
514 std::vector<drawing::EnhancedCustomShapeSegment>
aSegments;
517 sal_Int32 nCharIndex = 0;
528 sal_Int32 nPoints = 1;
529 if (nSeg >= 0x2000 && nSeg < 0x20FF)
531 nPoints = nSeg & 0x0FFF;
535 drawing::EnhancedCustomShapeSegment aSegment;
539 aSegment.Command = drawing::EnhancedCustomShapeSegmentCommand::LINETO;
540 aSegment.Count = sal_Int32(1);
544 aSegment.Command = drawing::EnhancedCustomShapeSegmentCommand::MOVETO;
545 aSegment.Count = sal_Int32(1);
549 aSegment.Command = drawing::EnhancedCustomShapeSegmentCommand::CURVETO;
550 aSegment.Count = nPoints;
554 aSegment.Command = drawing::EnhancedCustomShapeSegmentCommand::ARCTO;
555 aSegment.Count = sal_Int32(0);
565 = drawing::EnhancedCustomShapeSegmentCommand::ENDSUBPATH;
566 aSegment.Count = sal_Int32(0);
570 aSegment.Command = drawing::EnhancedCustomShapeSegmentCommand::LINETO;
571 aSegment.Count = nSeg;
576 }
while (nCharIndex >= 0);
577 aPropertyValue.Name =
"Segments";
579 aPath.push_back(aPropertyValue);
581 else if (rProperty.first ==
"geoLeft")
582 aViewBox.X = rProperty.second.toInt32();
583 else if (rProperty.first ==
"geoTop")
584 aViewBox.Y = rProperty.second.toInt32();
585 else if (rProperty.first ==
"geoRight")
586 aViewBox.Width = rProperty.second.toInt32();
587 else if (rProperty.first ==
"geoBottom")
588 aViewBox.Height = rProperty.second.toInt32();
589 else if (rProperty.first ==
"dhgt")
593 resolveDhgt(xPropertySet, rProperty.second.toInt32(),
false);
596 else if (rProperty.first ==
"dxTextLeft")
598 if (xPropertySet.is())
599 xPropertySet->setPropertyValue(
"LeftBorderDistance",
600 uno::Any(rProperty.second.toInt32() / 360));
602 else if (rProperty.first ==
"dyTextTop")
604 if (xPropertySet.is())
605 xPropertySet->setPropertyValue(
"TopBorderDistance",
606 uno::Any(rProperty.second.toInt32() / 360));
608 else if (rProperty.first ==
"dxTextRight")
610 if (xPropertySet.is())
611 xPropertySet->setPropertyValue(
"RightBorderDistance",
612 uno::Any(rProperty.second.toInt32() / 360));
614 else if (rProperty.first ==
"dyTextBottom")
616 if (xPropertySet.is())
617 xPropertySet->setPropertyValue(
"BottomBorderDistance",
618 uno::Any(rProperty.second.toInt32() / 360));
620 else if (rProperty.first ==
"dxWrapDistLeft")
624 new RTFValue(rProperty.second.toInt32()));
625 else if (xPropertySet.is())
626 xPropertySet->setPropertyValue(
"LeftMargin",
627 uno::Any(rProperty.second.toInt32() / 360));
629 else if (rProperty.first ==
"dyWrapDistTop")
633 new RTFValue(rProperty.second.toInt32()));
634 else if (xPropertySet.is())
635 xPropertySet->setPropertyValue(
"TopMargin",
636 uno::Any(rProperty.second.toInt32() / 360));
638 else if (rProperty.first ==
"dxWrapDistRight")
642 new RTFValue(rProperty.second.toInt32()));
643 else if (xPropertySet.is())
644 xPropertySet->setPropertyValue(
"RightMargin",
645 uno::Any(rProperty.second.toInt32() / 360));
647 else if (rProperty.first ==
"dyWrapDistBottom")
651 new RTFValue(rProperty.second.toInt32()));
652 else if (xPropertySet.is())
653 xPropertySet->setPropertyValue(
"BottomMargin",
654 uno::Any(rProperty.second.toInt32() / 360));
656 else if (rProperty.first ==
"fillType")
658 switch (rProperty.second.toInt32())
661 aFillModel.
moType = oox::XML_gradient;
665 "TODO handle fillType value '" << rProperty.second <<
"'");
669 else if (rProperty.first ==
"fillFocus")
670 aFillModel.
moFocus = rProperty.second.toDouble() / 100;
671 else if (rProperty.first ==
"fShadow" && xPropertySet.is())
673 if (rProperty.second.toInt32() == 1)
676 else if (rProperty.first ==
"shadowColor")
680 else if (rProperty.first ==
"shadowOffsetX")
682 aShadowModel.
moOffset = OUString::number(rProperty.second.toDouble() / 12700) +
"pt";
683 else if (rProperty.first ==
"posh" || rProperty.first ==
"posv"
684 || rProperty.first ==
"fFitShapeToText" || rProperty.first ==
"fFilled"
685 || rProperty.first ==
"rotation")
687 else if (rProperty.first ==
"posrelh")
689 switch (rProperty.second.toInt32())
698 else if (rProperty.first ==
"posrelv")
700 switch (rProperty.second.toInt32())
709 else if (rProperty.first ==
"groupLeft")
711 else if (rProperty.first ==
"groupTop")
713 else if (rProperty.first ==
"groupRight")
715 else if (rProperty.first ==
"groupBottom")
717 else if (rProperty.first ==
"relLeft")
719 else if (rProperty.first ==
"relTop")
721 else if (rProperty.first ==
"relRight")
723 else if (rProperty.first ==
"relBottom")
725 else if (rProperty.first ==
"fBehindDocument")
726 bOpaque = !rProperty.second.toInt32();
727 else if (rProperty.first ==
"pctHoriz" || rProperty.first ==
"pctVert")
729 sal_Int16 nPercentage = rtl::math::round(rProperty.second.toDouble() / 10);
732 std::optional<sal_Int16>& rPercentage
733 = rProperty.first ==
"pctHoriz" ? oRelativeWidth : oRelativeHeight;
734 rPercentage = nPercentage;
737 else if (rProperty.first ==
"sizerelh")
739 if (xPropertySet.is())
741 switch (rProperty.second.toInt32())
747 nRelativeWidthRelation = text::RelOrientation::PAGE_FRAME;
750 SAL_WARN(
"writerfilter",
"RTFSdrImport::resolve: unhandled sizerelh value: "
751 << rProperty.second);
756 else if (rProperty.first ==
"sizerelv")
758 if (xPropertySet.is())
760 switch (rProperty.second.toInt32())
766 nRelativeHeightRelation = text::RelOrientation::PAGE_FRAME;
769 SAL_WARN(
"writerfilter",
"RTFSdrImport::resolve: unhandled sizerelv value: "
770 << rProperty.second);
775 else if (rProperty.first ==
"fHorizRule")
781 oRelativeWidth = 100;
784 if (xPropertySet.is())
786 sal_Int16
const nVertOrient = text::VertOrientation::CENTER;
787 xPropertySet->setPropertyValue(
"VertOrient",
uno::Any(nVertOrient));
790 else if (rProperty.first ==
"pctHR")
793 oRelativeWidth = rProperty.second.toInt32() / 10;
795 else if (rProperty.first ==
"dxHeightHR")
801 else if (rProperty.first ==
"dxWidthHR")
807 else if (rProperty.first ==
"alignHR")
811 switch (rProperty.second.toInt32())
814 nHoriOrient = text::HoriOrientation::LEFT;
817 nHoriOrient = text::HoriOrientation::CENTER;
820 nHoriOrient = text::HoriOrientation::RIGHT;
825 xPropertySet->setPropertyValue(
"HoriOrient",
uno::Any(nHoriOrient));
828 else if (rProperty.first ==
"pWrapPolygonVertices")
833 sal_Int32 nCharIndex = 0;
836 std::u16string_view aToken =
o3tl::getToken(rProperty.second, 0,
';', nCharIndex);
841 else if (!aToken.empty())
844 aToken = aToken.substr(1, aToken.size() - 2);
850 aPathAttributes.
set(NS_ooxml::LN_CT_Point2D_x,
new RTFValue(nX));
851 aPathAttributes.
set(NS_ooxml::LN_CT_Point2D_y,
new RTFValue(nY));
852 aPolygonSprms.
set(NS_ooxml::LN_CT_WrapPath_lineTo,
855 }
while (nCharIndex >= 0);
858 else if (rProperty.first ==
"fRelFlipV")
859 obRelFlipV = rProperty.second.toInt32() == 1;
860 else if (rProperty.first ==
"fFlipH")
861 obFlipH = rProperty.second.toInt32() == 1;
862 else if (rProperty.first ==
"fFlipV")
863 obFlipV = rProperty.second.toInt32() == 1;
864 else if (rProperty.first ==
"pictureContrast")
867 nContrast = rProperty.second.toInt32();
868 if (nContrast < 0x10000)
871 nContrast /= 0x10000;
875 else if (rProperty.first ==
"pictureBrightness")
878 nBrightness = rProperty.second.toInt32();
879 if (nBrightness != 0)
885 SAL_INFO(
"writerfilter",
"TODO handle shape property '" << rProperty.first <<
"':'"
886 << rProperty.second <<
"'");
889 if (xPropertySet.is())
898 xPropertySet->setPropertyValue(
"WritingMode",
uno::Any(eWritingMode));
901 xPropertySet->setPropertyValue(
"TextWritingMode",
902 uno::Any(text::WritingMode(eWritingMode)));
908 if (nContrast == -70 && nBrightness == 70 && xPropertySet.is())
911 xPropertySet->setPropertyValue(
"GraphicColorMode",
uno::Any(drawing::ColorMode_WATERMARK));
914 if (bCustom && xShape.is() && !bPib)
917 xDefaulter->createCustomShapeDefaults(OUString::number(
nType));
921 if (bCustom && !aShapeText.isEmpty())
925 xTextRange->setString(aShapeText);
927 xPropertySet->setPropertyValue(
"CharFontName",
uno::Any(aFontFamily));
928 xPropertySet->setPropertyValue(
"CharHeight",
uno::Any(nFontSize));
932 if (bCustom && xPropertySet.is())
934 bool bChanged =
false;
936 xPropertySet->getPropertyValue(
"CustomShapeGeometry"));
938 if (aViewBox.X || aViewBox.Y || aViewBox.Width || aViewBox.Height)
940 aViewBox.Width -= aViewBox.X;
941 aViewBox.Height -= aViewBox.Y;
942 aCustomShapeGeometry[
"ViewBox"] <<= aViewBox;
952 if (!aShapeText.isEmpty())
957 aCustomShapeGeometry[
"TextPath"] <<= aSequence;
958 xPropertySet->setPropertyValue(
"TextAutoGrowHeight",
uno::Any(
false));
959 xPropertySet->setPropertyValue(
"TextAutoGrowWidth",
uno::Any(
false));
965 xPropertySet->setPropertyValue(
966 "CustomShapeGeometry",
971 if (obRelFlipV.has_value() && xPropertySet.is())
977 if ((xPropertySet->getPropertyValue(
"PolyPolygon") >>= aPolyPolySequence)
978 && aPolyPolySequence.hasElements())
982 for (
const awt::Point& rPoint : std::as_const(rPolygon))
987 aTransformation.
scale(1.0, *obRelFlipV ? -1.0 : 1.0);
989 auto pPolygon = rPolygon.getArray();
990 for (sal_Int32
i = 0;
i < rPolygon.getLength(); ++
i)
993 pPolygon[
i] = awt::Point(
static_cast<sal_Int32
>(aPoint.
getX()),
994 static_cast<sal_Int32
>(aPoint.
getY()));
996 xPropertySet->setPropertyValue(
"PolyPolygon",
uno::Any(aPolyPolySequence));
1004 sal_Int32 nLeft = rShape.
getLeft();
1005 sal_Int32 nTop = rShape.
getTop();
1007 bool bInShapeGroup = oGroupLeft && oGroupTop && oGroupRight && oGroupBottom && oRelLeft
1008 && oRelTop && oRelRight && oRelBottom;
1015 sal_Int32 nCoordSysWidth = *oGroupRight - *oGroupLeft;
1016 sal_Int32 nCoordSysHeight = *oGroupBottom - *oGroupTop;
1017 double fWidthRatio =
static_cast<double>(nShapeWidth) / nCoordSysWidth;
1018 double fHeightRatio =
static_cast<double>(nShapeHeight) / nCoordSysHeight;
1019 nLeft =
static_cast<sal_Int32
>(rShape.
getLeft()
1020 + fWidthRatio * (*oRelLeft - *oGroupLeft));
1021 nTop =
static_cast<sal_Int32
>(rShape.
getTop() + fHeightRatio * (*oRelTop - *oGroupTop));
1024 aSize.Width = std::lround(fWidthRatio * (*oRelRight - *oRelLeft));
1025 aSize.Height = std::lround(fHeightRatio * (*oRelBottom - *oRelTop));
1030 xPropertySet->setPropertyValue(
"HoriOrientPosition",
uno::Any(nLeft));
1031 xPropertySet->setPropertyValue(
"VertOrientPosition",
uno::Any(nTop));
1034 xShape->setPosition(awt::Point(nLeft, nTop));
1037 xShape->setSize(aSize);
1042 if (obFlipH || obFlipV)
1048 xPropertySet->getPropertyValue(
"CustomShapeGeometry"));
1050 aCustomShapeGeometry[
"MirroredX"] <<=
true;
1052 aCustomShapeGeometry[
"MirroredY"] <<=
true;
1053 xPropertySet->setPropertyValue(
1054 "CustomShapeGeometry",
1071 pObject->Mirror(aRef1, aRef2);
1076 xPropertySet->setPropertyValue(
"HoriOrientRelation",
1079 xPropertySet->setPropertyValue(
"VertOrientRelation",
1081 if (rShape.
getWrap() != text::WrapTextMode::WrapTextMode_MAKE_FIXED_SIZE)
1082 xPropertySet->setPropertyValue(
"Surround",
uno::Any(rShape.
getWrap()));
1084 if (aFillModel.
moType.has_value())
1099 xPropertySet->setPropertyValue(
"AnchorType",
1100 uno::Any(text::TextContentAnchorType_AT_CHARACTER));
1101 xPropertySet->setPropertyValue(
"Opaque",
uno::Any(bOpaque));
1104 xPropertySet->setPropertyValue(
"RelativeWidth",
uno::Any(*oRelativeWidth));
1105 xPropertySet->setPropertyValue(
"RelativeWidthRelation",
1108 if (oRelativeHeight)
1110 xPropertySet->setPropertyValue(
"RelativeHeight",
uno::Any(*oRelativeHeight));
1111 xPropertySet->setPropertyValue(
"RelativeHeightRelation",
1112 uno::Any(nRelativeHeightRelation));
1130 if (obFlipH && xPropertySet.is())
1131 xPropertySet->setPropertyValue(
"IsMirrored",
uno::Any(
true));
1138 aAttributes.
set(NS_ooxml::LN_CT_Background_color,
1139 new RTFValue(xPropertySet->getPropertyValue(
"FillColor").get<sal_Int32>()));
1143 xComponent->dispose();
const SvXMLImport & m_rImport
constexpr auto convertTwipToMm100(N n)
tools::Long AdjustY(tools::Long nVertMove)
tools::Long AdjustX(tools::Long nHorzMove)
static SdrObject * getSdrObjectFromXShape(const css::uno::Reference< css::uno::XInterface > &xInt)
void scale(double fX, double fY)
basegfx::B2DPoint const & getB2DPoint(sal_uInt32 nIndex) const
void transform(const basegfx::B2DHomMatrix &rMatrix)
void append(const basegfx::B2DPoint &rPoint, sal_uInt32 nCount)
css::uno::Sequence< css::beans::PropertyValue > getAsConstPropertyValueList() const
void setProperties(const css::uno::Sequence< OUString > &rPropNames, const css::uno::Sequence< css::uno::Any > &rValues)
virtual void props(writerfilter::Reference< Properties >::Pointer_t ref)=0
Receives properties of the current run of text.
virtual void startShape(css::uno::Reference< css::drawing::XShape > const &xShape)=0
Receives a shape.
virtual void endShape()=0
sal_Int32 findZOrder(sal_Int32 relativeHeight, bool bOldStyle=false)
void addItem(css::uno::Reference< css::beans::XPropertySet > const &props, sal_Int32 relativeHeight)
Implementation of the RTFDocument interface.
void resolvePict(bool bInline, css::uno::Reference< css::drawing::XShape > const &rShape)
Resolve a picture: If not inline, then anchored.
const css::uno::Reference< css::lang::XMultiServiceFactory > & getModelFactory() const
oox::GraphicHelper & getGraphicHelper()
void setDestinationText(std::u16string_view rString)
Sends RTFSprm instances to DomainMapper.
RTFDocumentImpl & m_rImport
void createShape(const OUString &rService, css::uno::Reference< css::drawing::XShape > &xShape, css::uno::Reference< css::beans::XPropertySet > &xPropertySet)
bool m_bTextGraphicObject
If m_xShape is imported as a Writer text graphic object (instead of a drawinglayer shape).
void resolve(RTFShape &rShape, bool bClose, ShapeOrPict shapeOrPict)
static void resolveFLine(css::uno::Reference< css::beans::XPropertySet > const &xPropertySet, sal_Int32 nFLine)
css::uno::Reference< css::drawing::XShape > m_xShape
void popParent()
Pop the current group shape from the parent stack.
bool m_bTextFrame
If m_xShape is imported as a Writer text frame (instead of a drawinglayer rectangle).
void pushParent(css::uno::Reference< css::drawing::XShapes > const &xParent)
Push a new group shape to the parent stack.
void append(std::u16string_view aKey, std::u16string_view aValue)
int initShape(css::uno::Reference< css::drawing::XShape > &o_xShape, css::uno::Reference< css::beans::XPropertySet > &o_xPropSet, bool &o_rIsCustomShape, RTFShape const &rShape, bool bClose, ShapeOrPict shapeOrPict)
void resolveDhgt(css::uno::Reference< css::beans::XPropertySet > const &xPropertySet, sal_Int32 nZOrder, bool bOldStyle)
RTFSdrImport(RTFDocumentImpl &rDocument, css::uno::Reference< css::lang::XComponent > const &xDstDoc)
static void resolveLineColorAndWidth(bool bTextFrame, const css::uno::Reference< css::beans::XPropertySet > &xPropertySet, css::uno::Any const &rLineColor, css::uno::Any const &rLineWidth)
Set line color and line width on the shape, using the relevant API depending on if the shape is a tex...
void appendGroupProperty(std::u16string_view aKey, std::u16string_view aValue)
Append property on the current parent.
void applyProperty(css::uno::Reference< css::drawing::XShape > const &xShape, std::u16string_view aKey, std::u16string_view aValue) const
std::stack< css::uno::Reference< css::drawing::XShapes > > m_aParents
bool m_bFakePict
if inside \pict, but actually it's a shape (not a picture)
static std::vector< css::beans::PropertyValue > getTextFrameDefaults(bool bNew)
These are the default in Word, but not in Writer.
std::stack< writerfilter::dmapper::GraphicZOrderHelper > m_aGraphicZOrderHelpers
Stores the properties of a shape.
std::vector< std::pair< OUString, OUString > > & getProperties()
sal_Int16 getVertOrientRelation() const
void setHoriOrientRelation(sal_Int16 nHoriOrientRelation)
void setBottom(sal_Int32 nBottom)
sal_Int16 getHoriOrientRelation() const
css::text::WrapTextMode getWrap() const
sal_Int32 getBottom() const
RTFSprms & getWrapPolygonSprms()
RTFSprms & getAnchorAttributes()
sal_Int32 getLeft() const
void setVertOrientRelation(sal_Int16 nVertOrientRelation)
sal_Int32 getRight() const
void setRight(sal_Int32 nRight)
A list of RTFSprm with a copy constructor that performs a deep copy.
void set(Id nKeyword, const RTFValue::Pointer_t &pValue, RTFOverwrite eOverwrite=RTFOverwrite::YES)
Does the same as ->push_back(), except that it can overwrite or ignore existing entries.
constexpr ::Color COL_BLACK(0x00, 0x00, 0x00)
EmbeddedObjectRef * pObject
#define ESCHER_ShpInst_TextBox
#define ESCHER_ShpInst_Rectangle
#define ESCHER_ShpInst_Line
#define ESCHER_ShpInst_PictureFrame
#define SAL_WARN(area, stream)
#define SAL_INFO(area, stream)
css::uno::Sequence< DstElementType > containerToSequence(const SrcType &i_Container)
css::uno::Sequence< css::beans::PropertyValue > InitPropertySequence(::std::initializer_list< ::std::pair< OUString, css::uno::Any > > vInit)
::Color BGRToRGB(sal_uInt32 nColour)
OUString ConvertColorOU(const Color &rColor)
sal_Int32 toInt32(std::u16string_view str, sal_Int16 radix=10)
std::basic_string_view< charT, traits > getToken(std::basic_string_view< charT, traits > sv, charT delimiter, std::size_t &position)
css::uno::Reference< css::linguistic2::XProofreadingIterator > get(css::uno::Reference< css::uno::XComponentContext > const &context)
@ NO_APPEND
No, always append the value to the end of the list.
void pushToPropMap(::oox::drawingml::ShapePropertyMap &rPropMap, const GraphicHelper &rGraphicHelper) const
std::optional< OUString > moColor2
std::optional< sal_Int32 > moType
std::optional< double > moFocus
std::optional< OUString > moColor
std::optional< OUString > moOffset
std::optional< OUString > moColor
void pushToPropMap(oox::drawingml::ShapePropertyMap &rPropMap, const GraphicHelper &rGraphicHelper) const
SVXCORE_DLLPUBLIC Degree100 NormAngle36000(Degree100 a)
std::vector< ISegmentProgressBarRef > aSegments