20#include <config_wasm_strip.h>
52#include <oox/token/properties.hxx>
53#include "diagram/datamodel.hxx"
65#include <com/sun/star/awt/FontSlant.hpp>
66#include <com/sun/star/awt/Size.hpp>
67#include <com/sun/star/awt/XBitmap.hpp>
68#include <com/sun/star/awt/FontWeight.hpp>
69#include <com/sun/star/graphic/XGraphic.hpp>
70#include <com/sun/star/container/XNamed.hpp>
71#include <com/sun/star/lang/XMultiServiceFactory.hpp>
72#include <com/sun/star/xml/dom/XDocument.hpp>
73#include <com/sun/star/xml/sax/XFastSAXSerializable.hpp>
74#include <com/sun/star/drawing/FillStyle.hpp>
75#include <com/sun/star/drawing/HomogenMatrix3.hpp>
76#include <com/sun/star/drawing/TextVerticalAdjust.hpp>
77#include <com/sun/star/drawing/GraphicExportFilter.hpp>
78#include <com/sun/star/drawing/XShapes.hpp>
79#include <com/sun/star/drawing/EnhancedCustomShapeAdjustmentValue.hpp>
80#include <com/sun/star/drawing/XEnhancedCustomShapeDefaulter.hpp>
81#include <com/sun/star/drawing/EnhancedCustomShapeTextPathMode.hpp>
82#include <com/sun/star/drawing/ConnectorType.hpp>
83#include <com/sun/star/embed/XEmbeddedObject.hpp>
84#include <com/sun/star/text/XText.hpp>
85#include <com/sun/star/table/BorderLine2.hpp>
86#include <com/sun/star/table/ShadowFormat.hpp>
87#include <com/sun/star/chart2/XChartDocument.hpp>
88#include <com/sun/star/style/ParagraphAdjust.hpp>
89#include <com/sun/star/io/XOutputStream.hpp>
90#include <com/sun/star/lang/Locale.hpp>
91#include <com/sun/star/i18n/ScriptType.hpp>
96#include <com/sun/star/document/XActionLockable.hpp>
97#include <com/sun/star/chart2/data/XDataReceiver.hpp>
98#include <com/sun/star/text/GraphicCrop.hpp>
139, meFrameType( FRAMETYPE_GENERIC )
141, mnDiagramRotation( 0 )
145, mbHiddenMasterShape( false )
148, mbLockedCanvas( false )
151, mbHasLinkedTxbx( false )
153, mpDiagramHelper( nullptr )
161: mpTextBody(pSourceShape->mpTextBody)
162, mpLinePropertiesPtr( pSourceShape->mpLinePropertiesPtr )
163, mpShapeRefLinePropPtr( pSourceShape->mpShapeRefLinePropPtr )
164, mpFillPropertiesPtr( pSourceShape->mpFillPropertiesPtr )
165, mpShapeRefFillPropPtr( pSourceShape->mpShapeRefFillPropPtr )
166, mpGraphicPropertiesPtr( pSourceShape->mpGraphicPropertiesPtr )
167, mpCustomShapePropertiesPtr( pSourceShape->mpCustomShapePropertiesPtr )
168, mpTablePropertiesPtr( pSourceShape->mpTablePropertiesPtr )
169, mp3DPropertiesPtr( pSourceShape->mp3DPropertiesPtr )
170, mpEffectPropertiesPtr (pSourceShape->mpEffectPropertiesPtr)
171, mpShapeRefEffectPropPtr(pSourceShape->mpShapeRefEffectPropPtr)
172, maShapeProperties( pSourceShape->maShapeProperties )
173, mpMasterTextListStyle( pSourceShape->mpMasterTextListStyle )
174, msServiceName( pSourceShape->msServiceName )
176, msInternalName( pSourceShape->msInternalName )
177, msId( pSourceShape->msId )
178, mnSubType( pSourceShape->mnSubType )
179, moSubTypeIndex( pSourceShape->moSubTypeIndex )
180, maShapeStyleRefs( pSourceShape->maShapeStyleRefs )
183, meFrameType( pSourceShape->meFrameType )
184, mnRotation( pSourceShape->mnRotation )
185, mnDiagramRotation( pSourceShape->mnDiagramRotation )
186, mbFlipH( pSourceShape->mbFlipH )
187, mbFlipV( pSourceShape->mbFlipV )
188, mbHidden( pSourceShape->mbHidden )
189, mbHiddenMasterShape( pSourceShape->mbHiddenMasterShape )
190, mbLocked( pSourceShape->mbLocked )
191, mbWPGChild( pSourceShape->mbWPGChild )
192, mbLockedCanvas( pSourceShape->mbLockedCanvas )
193, mbWps( pSourceShape->mbWps )
194, mbTextBox( pSourceShape->mbTextBox )
195, mbHasLinkedTxbx(false)
196, maDiagramDoms( pSourceShape->maDiagramDoms )
197, mnZOrder(pSourceShape->mnZOrder)
198, mnZOrderOff(pSourceShape->mnZOrderOff)
199, mnDataNodeType(pSourceShape->mnDataNodeType)
200, mfAspectRatio(pSourceShape->mfAspectRatio)
201, mpDiagramHelper( nullptr )
202, msDiagramDataModelID(pSourceShape->msDiagramDataModelID)
213 const std::shared_ptr< Diagram >& rDiagramPtr,
214 const std::shared_ptr<::oox::drawingml::Theme>& rTheme)
265 if(pTarget->mpDiagramHelper)
268 delete pTarget->mpDiagramHelper;
269 pTarget->mpDiagramHelper =
nullptr;
296 static_cast<sal_Int16
>(ParagraphAdjust_LEFT));
312 msServiceName =
"com.sun.star.drawing.temporaryForXMLImportOLE2Shape";
356 SAL_INFO(
"oox.drawingml",
"Shape::addShape: id='" <<
msId <<
"'");
366 if( pShapeMap && !
msId.isEmpty() )
368 (*pShapeMap)[
msId ] = shared_from_this();
374 addChildren( rFilterBase, *
this, pTheme, xShapes, pShapeMap, aMatrix );
384 xChildWPSProperties->setPropertyValue(
388 xChildWPSProperties->setPropertyValue(
393 xChildWPSProperties->setPropertyValue(
398 xChildWPSProperties->setPropertyValue(
403 xChildWPSProperties->setPropertyValue(
427 if (xShape.is() && pNamedShapePairs)
430 if (itPairs != pNamedShapePairs->end())
432 auto it = itPairs->second.find(shared_from_this());
433 if (it != itPairs->second.end())
471 SAL_INFO(
"oox.drawingml",
"Shape::applyShapeReference: apply '" << rReferencedShape.
msId <<
"' to '" <<
msId <<
"'");
473 if ( rReferencedShape.
mpTextBody && bUseText )
495struct ActionLockGuard
528 child->addShape( rFilterBase, pTheme, rxShapes, aTransformation,
getFillProperties(), pShapeMap, rMaster.shared_from_this());
534 if (eAdjust == ParagraphAdjust_LEFT)
536 else if (eAdjust == ParagraphAdjust_RIGHT)
538 else if (eAdjust == ParagraphAdjust_CENTER)
548 const ::oox::core::XmlFilterBase& rFilter)
550 if (!xShape.is() || !pTextBody)
565 auto aParaIt = std::find_if_not(rParagraphs.cbegin(), rParagraphs.cend(),
566 [](
const std::shared_ptr<TextParagraph> pParagraph) {
567 return pParagraph->getRuns().empty();
569 if (aParaIt != rParagraphs.cend())
571 std::shared_ptr<TextParagraph> pParagraph = *aParaIt;
573 auto aRunIt = std::find_if_not(
574 rRuns.cbegin(), rRuns.cend(),
575 [](
const std::shared_ptr<TextRun> pRun) { return pRun->getText().isEmpty(); });
576 if (aRunIt != rRuns.cend())
578 std::shared_ptr<TextRun> pRun = *aRunIt;
582 if (rCharProps.
moLang.has_value() && !rCharProps.
moLang.value().isEmpty())
585 css::lang::Locale aLocale(aTag.
getLocale(
false));
588 case css::i18n::ScriptType::LATIN:
589 xSet->setPropertyValue(
u"CharLocale",
uno::Any(aLocale));
591 case css::i18n::ScriptType::ASIAN:
592 xSet->setPropertyValue(
u"CharLocaleAsian",
uno::Any(aLocale));
594 case css::i18n::ScriptType::COMPLEX:
595 xSet->setPropertyValue(
u"CharLocaleComplex",
uno::Any(aLocale));
602 if (rCharProps.
moBold.has_value() && rCharProps.
moBold.value())
609 uno::Any(css::awt::FontSlant::FontSlant_ITALIC));
611 if (rCharProps.
moHeight.has_value())
613 sal_Int32 nHeight = rCharProps.
moHeight.value() / 100;
619 sal_Int16 nFontPitch = 0;
620 sal_Int16 nFontFamily = 0;
622 if (
const Theme* pTheme = rFilter.getCurrentTheme())
625 if (
const TextFont* pFont = pTheme->resolveFont(
u"+mn-lt"))
627 bRet = pFont->getFontData(sFontName, nFontPitch, nFontFamily, rFilter);
630 xSet->setPropertyValue(
u"CharFontName",
uno::Any(sFontName));
631 xSet->setPropertyValue(
u"CharFontPitch",
uno::Any(nFontPitch));
632 xSet->setPropertyValue(
u"CharFontFamily",
uno::Any(nFontFamily));
636 if (
const TextFont* pFont = pTheme->resolveFont(
u"+mn-ea"))
638 bRet = pFont->getFontData(sFontName, nFontPitch, nFontFamily, rFilter);
641 xSet->setPropertyValue(
u"CharFontNameAsian",
uno::Any(sFontName));
642 xSet->setPropertyValue(
u"CharFontPitchAsian",
uno::Any(nFontPitch));
643 xSet->setPropertyValue(
u"CharFontFamilyAsian",
uno::Any(nFontFamily));
647 if (
const TextFont* pFont = pTheme->resolveFont(
u"+mn-cs"))
649 bRet = pFont->getFontData(sFontName, nFontPitch, nFontFamily, rFilter);
652 xSet->setPropertyValue(
u"CharFontNameComplex",
uno::Any(sFontName));
653 xSet->setPropertyValue(
u"CharFontPitchComplex",
uno::Any(nFontPitch));
654 xSet->setPropertyValue(
u"CharFontFamilyComplex",
uno::Any(nFontFamily));
669 xSet->setPropertyValue(
u"CharFontName",
uno::Any(sFontName));
670 xSet->setPropertyValue(
u"CharFontPitch",
uno::Any(nFontPitch));
671 xSet->setPropertyValue(
u"CharFontFamily",
uno::Any(nFontFamily));
681 xSet->setPropertyValue(
u"CharFontNameAsian",
uno::Any(sFontName));
682 xSet->setPropertyValue(
u"CharFontPitchAsian",
uno::Any(nFontPitch));
683 xSet->setPropertyValue(
u"CharFontFamilyAsian",
uno::Any(nFontFamily));
694 xSet->setPropertyValue(
u"CharFontNameComplex",
uno::Any(sFontName));
695 xSet->setPropertyValue(
u"CharFontPitchComplex",
uno::Any(nFontPitch));
696 xSet->setPropertyValue(
u"CharFontFamilyComplex",
uno::Any(nFontFamily));
705 aStrokeShapeProps, rFilter.getGraphicHelper());
708 xSet->setPropertyValue(rProp.Name, rProp.Value);
727 xSet->setPropertyValue(rProp.Name, rProp.Value);
735 ParagraphAdjust eAdjust = ParagraphAdjust_LEFT;
736 if (pParagraph->getProperties().getParaAdjust())
737 eAdjust = *pParagraph->getProperties().getParaAdjust();
738 xSet->setPropertyValue(
"ParaAdjust",
uno::Any(eAdjust));
748 const OUString sMSPresetType = pTextBody->getTextProperties().msPrst;
752 if (sFontworkType ==
"fontwork-arch-up-curve" || sFontworkType ==
"fontwork-circle-curve")
754 else if (sFontworkType ==
"fontwork-arch-down-curve")
767 if (!bFlipH && !bFlipV)
770 aCenter *= aTransformation;
772 aTransformation.
scale(bFlipH ? -1.0 : 1.0, bFlipV ? -1.0 : 1.0);
782 const double fSx(aTransformation.
get(0, 0));
783 const double fSy(aTransformation.
get(1, 1));
784 const double fTx(aTransformation.
get(0, 2));
785 const double fTy(aTransformation.
get(1, 2));
786 aTransformation.
set(0, 0, fSy);
787 aTransformation.
set(1, 1, fSx);
788 aTransformation.
set(0, 2, fTx + 0.5 * (fSx - fSy));
789 aTransformation.
set(1, 2, fTy + 0.5 * (fSy - fSx));
795 if (nMSORotationAngle == 0)
797 double fRad = basegfx::deg2rad<60000>(nMSORotationAngle);
799 aCenter *= aTransformation;
801 aTransformation.
rotate(fRad);
809 const OUString& rServiceName,
811 const css::uno::Reference< css::drawing::XShapes >& rxShapes,
813 bool bDoNotInsertEmptyTextBody,
818 bool bIsEmbMedia =
false;
819 SAL_INFO(
"oox.drawingml",
"Shape::createAndInsert: id='" <<
msId <<
"' service='" << rServiceName <<
"'");
824 for (
auto const& it :
mpTextBody->getParagraphs())
826 if (it->HasMathXml())
828 if (!
mpTextBody->isEmpty() || pMathXml !=
nullptr)
830 SAL_WARN(
"oox.drawingml",
"losing a Math object...");
834 pMathXml = &it->GetMathXml();
856 awt::Rectangle aShapeRectHmm(
862 OUString aServiceName;
866 aServiceName =
"com.sun.star.drawing.OLE2Shape";
871 else if (rServiceName ==
"com.sun.star.drawing.GraphicObjectShape" &&
874 aServiceName =
finalizeServiceName( rFilterBase,
"com.sun.star.presentation.MediaShape", aShapeRectHmm );
883 bool bIsCroppedGraphic = (aServiceName ==
"com.sun.star.drawing.GraphicObjectShape" &&
886 bool bIsCustomShape = (aServiceName ==
"com.sun.star.drawing.CustomShape" || bIsCroppedGraphic);
887 bool bIsConnectorShape = (aServiceName ==
"com.sun.star.drawing.ConnectorShape");
888 if(bIsCroppedGraphic)
890 aServiceName =
"com.sun.star.drawing.CustomShape";
893 bool bUseRotationTransform = ( !
mbWps ||
894 aServiceName ==
"com.sun.star.drawing.LineShape" ||
895 aServiceName ==
"com.sun.star.drawing.GroupShape" ||
911 if (aServiceName ==
"com.sun.star.drawing.LineShape"
912 || aServiceName ==
"com.sun.star.drawing.ConnectorShape")
929 double fParentRotate(0.0);
930 double fParentShearX(0.0);
931 if (pParentGroupShape)
933 aParentTransformation.
decompose(aParentScale, aParentTranslate, fParentRotate, fParentShearX);
936 lcl_mirrorAtCenter(aTransformation, aParentScale.
getX() < 0, aParentScale.
getY() < 0);
937 if(aParentScale.
getX() < 0)
939 if(aParentScale.
getY() < 0)
947 if (
mbWps && pParentGroupShape ==
nullptr)
961 if (pParentGroupShape)
968 aTransformation.
translate(-pParentGroupShape->maChPosition.X,
969 -pParentGroupShape->maChPosition.Y);
976 double fFactorX = 1.0;
977 double fFactorY = 1.0;
978 if (pParentGroupShape->maChSize.Width != 0)
979 fFactorX = aParentScale.
getX() / pParentGroupShape->maChSize.Width;
980 if (pParentGroupShape->maChSize.Height != 0)
981 fFactorY = aParentScale.
getY() / pParentGroupShape->maChSize.Height;
982 if (fFactorX != 1 || fFactorY != 1)
987 const bool bNeedsMSOWidthHeightToggle
988 = (nDeg >= 45 && nDeg < 135) || (nDeg >= 225 && nDeg < 315);
989 if (bNeedsMSOWidthHeightToggle)
990 lcl_doSpecialMSOWidthHeightToggle(aTransformation);
992 aTransformation.
scale(fFactorX, fFactorY);
994 if (bNeedsMSOWidthHeightToggle)
996 lcl_doSpecialMSOWidthHeightToggle(aTransformation);
998 if ((aParentScale.
getX() < 0) != (aParentScale.
getY() < 0))
999 lcl_RotateAtCenter(aTransformation, 10800000);
1006 sal_Int16 nOrientation = ((aParentScale.
getX() < 0) != (aParentScale.
getY() < 0)) ? -1 : 1;
1011 if (bUseRotationTransform && (
mnRotation != 0 || nCameraRotation != 0))
1012 lcl_RotateAtCenter(aTransformation, nOrientation * (
mnRotation - nCameraRotation));
1014 if (fParentRotate != 0.0)
1015 aTransformation.
rotate(fParentRotate);
1017 aTransformation.
translate(aParentTranslate);
1019 aParentTransformation = aTransformation;
1022 aTransformation.
scale(fEmuToMm100, fEmuToMm100);
1028 double fRotate, fShearX;
1029 aTransformation.
decompose(aScale, aTranslate, fRotate, fShearX);
1034 aCenter *= aTransformation;
1036 aTransformation.
rotate( fRotate * -2.0 );
1042 if ( aServiceName ==
"com.sun.star.drawing.LineShape" )
1050 sal_Int32
i, nNumPoints = aPoly.
count();
1051 uno::Sequence< awt::Point > aPointSequence( nNumPoints );
1052 awt::Point* pPoints = aPointSequence.getArray();
1053 for(
i = 0;
i < nNumPoints; ++
i )
1061 if (aPoint.
getX() - rPreviousPoint.
getX() == 0)
1063 if (aPoint.
getY() - rPreviousPoint.
getY() == 0)
1067 pPoints[
i] = awt::Point(
static_cast<sal_Int32
>(aPoint.
getX()),
static_cast<sal_Int32
>(aPoint.
getY()));
1069 uno::Sequence< uno::Sequence< awt::Point > > aPolyPolySequence( 1 );
1070 aPolyPolySequence.getArray()[ 0 ] = aPointSequence;
1074 else if ( aServiceName ==
"com.sun.star.drawing.ConnectorShape" )
1083 awt::Point aAWTStartPosition(
static_cast< sal_Int32
>( aStartPosition.
getX() ),
static_cast< sal_Int32
>( aStartPosition.
getY() ) );
1084 awt::Point aAWTEndPosition(
static_cast< sal_Int32
>( aEndPosition.
getX() ),
static_cast< sal_Int32
>( aEndPosition.
getY() ) );
1092 HomogenMatrix3 aMatrix;
1094 aMatrix.Line1.Column1 = aTransformation.
get(0,0);
1095 aMatrix.Line1.Column2 = aTransformation.
get(0,1);
1096 aMatrix.Line1.Column3 = aTransformation.
get(0,2);
1098 aMatrix.Line2.Column1 = aTransformation.
get(1,0);
1099 aMatrix.Line2.Column2 = aTransformation.
get(1,1);
1100 aMatrix.Line2.Column3 = aTransformation.
get(1,2);
1102 aMatrix.Line3.Column1 = aTransformation.
get(2,0);
1103 aMatrix.Line3.Column2 = aTransformation.
get(2,1);
1104 aMatrix.Line3.Column3 = aTransformation.
get(2,2);
1112 mxShape.set( xServiceFact->createInstance( aServiceName ), UNO_QUERY_THROW );
1122 xNamed->setName(
msName );
1128 if (aServiceName !=
"com.sun.star.text.TextFrame")
1133 SAL_INFO(
"oox.drawingml",
"Shape::createAndInsert: invisible shape with id='" <<
msId <<
"'");
1134 xSet->setPropertyValue(
"Visible",
Any(
false ) );
1136 xSet->setPropertyValue(
"Printable",
Any(
false ) );
1141 xSet->setPropertyValue(
"MoveProtect",
Any(
true));
1142 xSet->setPropertyValue(
"SizeProtect",
Any(
true));
1145 ActionLockGuard
const alg(
mxShape);
1150 uno::Reference< text::XText > xText(
mxShape, uno::UNO_QUERY );
1153 xText->setString(
"" );
1163 xSet->setPropertyValue(
"CLSID",
uno::Any(
name.GetHexName()));
1164 uno::Reference<embed::XEmbeddedObject>
const xObj(
1165 xSet->getPropertyValue(
"EmbeddedObject"), uno::UNO_QUERY);
1168 uno::Reference<uno::XInterface>
const xMathModel(xObj->getComponent());
1169 oox::FormulaImExportBase *
const pMagic(
1170 dynamic_cast<oox::FormulaImExportBase*
>(xMathModel.get()));
1172 pMagic->readFormulaOoxml(*pMathXml);
1180 sal_Int16 nFillPhClrTheme = -1;
1181 sal_Int16 nLinePhClrTheme = -1;
1197 nLinePhClr = pLineRef->maPhClr.getColor( rGraphicHelper );
1198 nLinePhClrTheme = pLineRef->maPhClr.getSchemeColorIndex();
1203 {
"SchemeClr",
uno::Any(pLineRef->maPhClr.getSchemeColorName())},
1204 {
"Idx",
uno::Any(pLineRef->mnThemedIdx)},
1210 {
"Transformations",
uno::Any(pLineRef->maPhClr.getTransformations())}
1218 nFillPhClr = pFillRef->maPhClr.getColor(rGraphicHelper);
1219 nFillPhClrTheme = pFillRef->maPhClr.getSchemeColorIndex();
1222 OUString sColorScheme = pFillRef->maPhClr.getSchemeColorName();
1223 if( !sColorScheme.isEmpty() )
1227 {
"SchemeClr",
uno::Any(sColorScheme)},
1228 {
"Idx",
uno::Any(pFillRef->mnThemedIdx)},
1230 {
"Transformations",
uno::Any(pFillRef->maPhClr.getTransformations())}
1244 {
"SchemeClr",
uno::Any(pEffectRef->maPhClr.getSchemeColorName())},
1245 {
"Idx",
uno::Any(pEffectRef->mnThemedIdx)},
1246 {
"Transformations",
uno::Any(pEffectRef->maPhClr.getTransformations())}
1256 mpTextBody->getTextProperties().pushTextDistances(
Size(aShapeRectHmm.Width, aShapeRectHmm.Height));
1270 aServiceName ==
"com.sun.star.drawing.GraphicObjectShape" ||
1271 aServiceName ==
"com.sun.star.drawing.OLE2Shape")
1281 pTableShape->SetSkipChangeLayout(
true);
1288 if(!bIsCroppedGraphic)
1291 aLineProperties.
pushToPropMap( aShapeProps, rGraphicHelper, nLinePhClr, nLinePhClrTheme);
1294 aEffectProperties.
pushToPropMap( aShapeProps, rGraphicHelper );
1301 if( xSetInfo.is() && xSetInfo->hasPropertyByName( rPropName ) )
1303 xSet->setPropertyValue( rPropName,
Any(
false ) );
1307 if( aServiceName !=
"com.sun.star.drawing.GroupShape" )
1309 if (aServiceName ==
"com.sun.star.text.TextFrame")
1313 uno::Reference<beans::XPropertySet> propertySet (
mxShape, uno::UNO_QUERY);
1314 uno::Sequence<beans::PropertyValue> aGrabBag;
1315 propertySet->getPropertyValue(
"FrameInteropGrabBag") >>= aGrabBag;
1316 sal_Int32
length = aGrabBag.getLength();
1317 aGrabBag.realloc(
length+1);
1318 auto pGrabBag = aGrabBag.getArray();
1319 pGrabBag[
length].Name =
"mso-orig-shape-type";
1320 uno::Sequence< sal_Int8 >
const & aNameSeq =
1322 OUString sShapePresetTypeName(
reinterpret_cast< const char*
>(
1323 aNameSeq.getConstArray()), aNameSeq.getLength(), RTL_TEXTENCODING_UTF8);
1324 pGrabBag[
length].Value <<= sShapePresetTypeName;
1325 propertySet->setPropertyValue(
"FrameInteropGrabBag",
uno::Any(aGrabBag));
1331 uno::Reference<beans::XPropertySet> propertySet (
mxShape, uno::UNO_QUERY);
1332 uno::Sequence<beans::PropertyValue> aGrabBag;
1333 propertySet->getPropertyValue(
"FrameInteropGrabBag") >>= aGrabBag;
1334 sal_Int32
length = aGrabBag.getLength();
1335 aGrabBag.realloc(
length + 3 );
1336 auto pGrabBag = aGrabBag.getArray();
1337 pGrabBag[
length].Name =
"TxbxHasLink";
1339 pGrabBag[
length + 1 ].Name =
"Txbx-Id";
1341 pGrabBag[
length + 2 ].Name =
"Txbx-Seq";
1343 propertySet->setPropertyValue(
"FrameInteropGrabBag",
uno::Any(aGrabBag));
1362 aShapeProps.
erase(PROP_FillBitmap);
1367 OUString aFillBitmapName = aAny.get<OUString>();
1369 uno::Reference<graphic::XGraphic> xGraphic(xBitmap, uno::UNO_QUERY);
1376 uno::Reference<beans::XPropertySet> xPropertySet(
mxShape, uno::UNO_QUERY);
1377 static const sal_Int32 aBorders[] =
1381 for (sal_Int32
nBorder : aBorders)
1393 uno::Reference<beans::XPropertySet> xPropertySet(
mxShape, uno::UNO_QUERY);
1394 static const OUStringLiteral aGrabBagPropName =
u"FrameInteropGrabBag";
1395 uno::Sequence<beans::PropertyValue> aGrabBag;
1396 xPropertySet->getPropertyValue(aGrabBagPropName) >>= aGrabBag;
1399 if (aGrabBag.hasElements())
1401 sal_Int32
nLength = aGrabBag.getLength();
1402 aGrabBag.realloc(
nLength + 1);
1403 aGrabBag.getArray()[
nLength] = aPair;
1407 aGrabBag = { aPair };
1409 xPropertySet->setPropertyValue(aGrabBagPropName,
uno::Any(aGrabBag));
1412 std::optional<sal_Int32> oShadowDistance;
1423 std::optional<sal_Int32> oShadowColor;
1432 if (oShadowDistance || oShadowColor || aEffectProperties.
maShadow.
moShadowDir.has_value())
1434 css::table::ShadowFormat aFormat;
1436 aFormat.Color = *oShadowColor;
1439 css::table::ShadowLocation nLocation = css::table::ShadowLocation_NONE;
1443 nLocation = css::table::ShadowLocation_TOP_LEFT;
1446 nLocation = css::table::ShadowLocation_TOP_RIGHT;
1449 nLocation = css::table::ShadowLocation_BOTTOM_LEFT;
1452 nLocation = css::table::ShadowLocation_BOTTOM_RIGHT;
1455 aFormat.Location = nLocation;
1457 aFormat.ShadowWidth = *oShadowDistance;
1469 if (aServiceName !=
"com.sun.star.text.TextFrame" &&
isLinkedTxbx())
1471 uno::Reference<beans::XPropertySet> propertySet (
mxShape, uno::UNO_QUERY);
1472 uno::Sequence<beans::PropertyValue> aGrabBag;
1473 propertySet->getPropertyValue(
"InteropGrabBag") >>= aGrabBag;
1474 sal_Int32
length = aGrabBag.getLength();
1475 aGrabBag.realloc(
length + 3 );
1476 auto pGrabBag = aGrabBag.getArray();
1477 pGrabBag[
length].Name =
"TxbxHasLink";
1479 pGrabBag[
length + 1 ].Name =
"Txbx-Id";
1481 pGrabBag[
length + 2 ].Name =
"Txbx-Seq";
1483 propertySet->setPropertyValue(
"InteropGrabBag",
uno::Any(aGrabBag));
1487 if (aServiceName ==
"com.sun.star.presentation.GraphicObjectShape" && !bClearText)
1496 uno::Reference<beans::XPropertySet> xGraphic(xSet->getPropertyValue(
"Graphic"), uno::UNO_QUERY);
1499 awt::Size aBitmapSize;
1500 xGraphic->getPropertyValue(
"Size100thMM") >>= aBitmapSize;
1501 sal_Int32 nXMargin = (aShapeRectHmm.Width - aBitmapSize.Width) / 2;
1502 sal_Int32 nYMargin = (aShapeRectHmm.Height - aBitmapSize.Height) / 2;
1503 if (nXMargin > 0 && nYMargin > 0)
1505 text::GraphicCrop aGraphicCrop;
1506 aGraphicCrop.Top = nYMargin * -1;
1507 aGraphicCrop.Bottom = nYMargin * -1;
1508 aGraphicCrop.Left = nXMargin * -1;
1509 aGraphicCrop.Right = nXMargin * -1;
1524 pTableShape->LayoutTableHeight(aArea,
false);
1525 sal_Int32 nCorrectedHeight = aArea.
GetHeight();
1526 const auto& aShapeSize =
mxShape->getSize();
1527 if( nCorrectedHeight > aShapeSize.Height )
1528 mxShape->setSize( {aShapeSize.Width, nCorrectedHeight} );
1529 pTableShape->SetSkipChangeLayout(
false);
1536 if (aServiceName ==
"com.sun.star.drawing.LineShape")
1539 mxShape->setPosition(awt::Point(aShapeRectHmm.X, aShapeRectHmm.Y));
1540 mxShape->setSize(awt::Size(aShapeRectHmm.Width, aShapeRectHmm.Height));
1570 if( aShapeProps.
hasProperty( PROP_FillGradient ) )
1572 std::vector<beans::PropertyValue> aGradientStops;
1578 std::vector<beans::PropertyValue> aGradientStop
1583 OUString sStopColorScheme = rColor.getSchemeColorName();
1584 if( sStopColorScheme.isEmpty() )
1591 if( rColor.hasTransparency() )
1613 if (!aEffectProperties.
m_Effects.empty())
1615 std::vector<beans::PropertyValue> aEffects;
1616 for (
auto const& it : aEffectProperties.
m_Effects)
1618 PropertyValue aEffect = it->getEffect();
1619 if( !aEffect.Name.isEmpty() )
1621 std::vector<beans::PropertyValue> aEffectsGrabBag
1626 Color& aColor( it->moColor );
1628 if( sColorScheme.isEmpty() )
1650 if( aCamera3DEffects.hasElements() || aLightRig3DEffects.hasElements() || aShape3DEffects.hasElements() )
1654 {
"Camera",
uno::Any(aCamera3DEffects)},
1655 {
"LightRig",
uno::Any(aLightRig3DEffects)},
1656 {
"Shape3D",
uno::Any(aShape3DEffects)}
1667 if( aTextCamera3DEffects.hasElements() || aTextLightRig3DEffects.hasElements() || aTextShape3DEffects.hasElements() )
1671 {
"Camera",
uno::Any(aTextCamera3DEffects)},
1672 {
"LightRig",
uno::Any(aTextLightRig3DEffects)},
1673 {
"Shape3D",
uno::Any(aTextShape3DEffects)}
1694 if (
mbWps && aServiceName ==
"com.sun.star.drawing.LineShape" && !pParentGroupShape)
1697 if (bIsConnectorShape)
1699 OUString sConnectorShapePresetTypeName(
1700 reinterpret_cast<const char*
>(
1703 RTL_TEXTENCODING_UTF8);
1707 for (
size_t i = 0;
i < aAdjustmentList.size();
i++)
1714 case XML_straightConnector1:
1715 xSet->setPropertyValue(
"EdgeKind",
Any(ConnectorType_LINE));
1717 case XML_bentConnector2:
1718 case XML_bentConnector3:
1719 case XML_bentConnector4:
1720 case XML_bentConnector5:
1721 xSet->setPropertyValue(
"EdgeKind",
Any(ConnectorType_STANDARD));
1723 case XML_curvedConnector2:
1724 case XML_curvedConnector3:
1725 case XML_curvedConnector4:
1726 case XML_curvedConnector5:
1727 xSet->setPropertyValue(
"EdgeKind",
Any(ConnectorType_CURVE));
1734 if( bIsCustomShape )
1742 sal_Int32 nTextCameraZRotation =
getTextBody()->get3DProperties().maCameraRotation.mnRevolution.value_or(0);
1746 sal_Int32 nTextPreRotateAngle =
static_cast< sal_Int32
>(
getTextBody()->getTextProperties().moTextPreRotation.value_or( 0 ) );
1751 sal_Int32 nTextAreaRotateAngle =
getTextBody()->getTextProperties().moTextAreaRotation.value_or(0);
1762 if ((nDeg >= 45 && nDeg < 135) || (nDeg >= 225 && nDeg < 315))
1764 nTextAreaRotateAngle += 5400000;
1765 nTextPreRotateAngle -= 5400000;
1772 if (nTextAreaRotateAngle != 0)
1775 auto sHorzOverflow =
getTextBody()->getTextProperties().msHorzOverflow;
1776 if (!sHorzOverflow.isEmpty())
1778 auto nVertOverflow =
getTextBody()->getTextProperties().msVertOverflow;
1779 if (!nVertOverflow.isEmpty())
1785 SAL_INFO(
"oox.cscode",
"==cscode== shape name: '" <<
msName <<
"'");
1786 SAL_INFO(
"oox.csdata",
"==csdata== shape name: '" <<
msName <<
"'");
1792 &&
mpTextBody->getTextProperties().msPrst !=
u"textNoShape")
1794 bool bFromWordArt(aShapeProps.
hasProperty(PROP_FromWordArt)
1795 ? aShapeProps.
getProperty(PROP_FromWordArt).get<
bool>()
1803 getTextBody()->getTextProperties().pushVertSimulation();
1807 if ( !bUseRotationTransform && (
mnRotation != 0 || nCameraRotation != 0) )
1825 if( pFontRef->mnThemedIdx != 0 )
1829 aCharStyleProperties.
assignUsed( *pCharProps );
1830 SAL_INFO(
"oox.drawingml",
"Shape::createAndInsert: use font color");
1831 if ( pFontRef->maPhClr.isUsed() )
1838 xText->setString(
"");
1843 if (!rParagraphs.empty())
1845 const std::shared_ptr<TextParagraph>& pParagraph = rParagraphs[0];
1846 if (pParagraph->getProperties().getParaAdjust())
1848 style::ParagraphAdjust eAdjust = *pParagraph->getProperties().getParaAdjust();
1849 if (eAdjust == style::ParagraphAdjust_CENTER)
1859 if (rParagraphs.size() == 1 && pParagraph->getRuns().empty())
1864 aTextCharacterProps.
assignUsed(pParagraph->getEndProperties());
1865 aTextCharacterProps.pushToPropSet(aPropertySet, rFilterBase);
1871 if (!
mpTextBody->getTextProperties().msPrst.isEmpty()
1872 &&
mpTextBody->getTextProperties().msPrst !=
u"textNoShape")
1884 ::Color nCharColor = pFontRef->maPhClr.getColor(rGraphicHelper);
1892 uno::Reference<beans::XPropertySet> propertySet (
mxShape, uno::UNO_QUERY);
1901 uno::Reference<beans::XPropertySet> propertySet(
mxShape, uno::UNO_QUERY);
1902 propertySet->setPropertyValue(
1907 if (aServiceName ==
"com.sun.star.drawing.OLE2Shape" &&
mxOleObjectInfo
1910 if (const ::oox::vml::ShapeBase* pVmlShape
1915 pVmlShape->getTypeModel().maStrokeModel.pushToPropMap(
1918 pVmlShape->getTypeModel().maFillModel.pushToPropMap(
1948 uno::Sequence<uno::Any> diagramDrawing{
1954 pValue[
length].Name =
"OOXDrawing";
1955 pValue[
length].Value <<= diagramDrawing;
1967 if ( !xSetInfo.is() )
1971 if( !xSetInfo->hasPropertyByName( aGrabBagPropName ) )
1975 xSet->getPropertyValue( aGrabBagPropName ) >>= aGrabBag;
1978 if ( aGrabBag.hasElements() )
1995 xSet->setPropertyValue(
"MoveProtect",
Any(
true));
1996 xSet->setPropertyValue(
"SizeProtect",
Any(
true));
2006 while (xShapes->hasElements())
2008 xShapes->add(xShape);
2034 awt::Size aActualSize =
mxShape->getSize();
2036 double fPixelsPer100thmm =
static_cast < double > ( aResolution.
Width() ) / 100000.0;
2037 awt::Size aSize(
static_cast < sal_Int32
> ( ( fPixelsPer100thmm * aActualSize.Width ) + 0.5 ),
2038 static_cast < sal_Int32
> ( ( fPixelsPer100thmm * aActualSize.Height ) + 0.5 ) );
2055 xGraphicExporter->setSourceDocument( xSourceDoc );
2056 xGraphicExporter->filter( aDescriptor );
2064 SAL_WARN(
"oox.drawingml",
"Shape::renderDiagramToGraphic: Unable to import rendered stream into graphic object" );
2070 xShape.set( xServiceFact->createInstance(
"com.sun.star.drawing.GraphicObjectShape" ), UNO_QUERY_THROW );
2072 xPropSet->setPropertyValue(
"Graphic",
Any( xGraphic ) );
2073 xPropSet->setPropertyValue(
"MoveProtect",
Any(
true ) );
2074 xPropSet->setPropertyValue(
"SizeProtect",
Any(
true ) );
2075 xPropSet->setPropertyValue(
"Name",
Any( OUString(
"RenderedShapes" ) ) );
2092 SAL_INFO(
"oox.drawingml",
"Shape::setMasterTextListStyle: Set master text list style to shape id='" <<
msId <<
"'");
2099 OUString aServiceName = rServiceName;
2104 awt::Size aOleSize( rShapeRect.Width, rShapeRect.Height );
2106 aServiceName =
"com.sun.star.drawing.OLE2Shape";
2109 OUString aGraphicPath;
2112 if( const ::oox::vml::ShapeBase* pVmlShape = pVmlDrawing->getShapes().getShapeById(
mxOleObjectInfo->maShapeId ) )
2113 aGraphicPath = pVmlShape->getGraphicPath();
2116 if( !aGraphicPath.isEmpty() )
2121 aExtHeader.
xExt = rShapeRect.Width;
2122 aExtHeader.
yExt = rShapeRect.Height;
2133 return aServiceName;
2142 OSL_ENSURE( !
mxChartShapeInfo->maFragmentPath.isEmpty(),
"Shape::finalizeXShape - missing chart fragment" );
2147 aShapeProp.setProperty( PROP_CLSID, OUString(
"12dcae26-281f-416f-a234-c3086127382e" ) );
2151 aShapeProp.getProperty( xDocModel, PROP_Model );
2155#if ENABLE_WASM_STRIP_CHART
2168 const OUString aThemeOverrideFragmentPath( pChartSpaceFragment->
2169 getFragmentPathFromFirstTypeFromOfficeDoc(u
"themeOverride") );
2177 if (!aThemeOverrideFragmentPath.isEmpty() && pPowerPointImport)
2180 uno::Reference< xml::sax::XFastSAXSerializable > xDoc(
2181 rFilter.
importFragment(aThemeOverrideFragmentPath), uno::UNO_QUERY_THROW);
2183 auto pThemeOverride = std::make_shared<Theme>(*pTheme);
2192 Reference< drawing::XShapes > xExternalPage;
2194 xExternalPage = rxShapes;
2198 if( !xChartDoc->hasInternalDataProvider() )
2200 Reference< chart2::data::XDataReceiver > xDataRec( xChartDoc, UNO_QUERY );
2201 Reference< chart2::data::XDataSource > xData = xDataRec->getUsedData();
2202 if( !xData->getDataSequences().hasElements() || !xData->getDataSequences()[0]->getValues().is() ||
2203 !xData->getDataSequences()[0]->getValues()->getData().hasElements() )
2213 if (!aThemeOverrideFragmentPath.isEmpty() && pPowerPointImport)
2232 PropertyValue aNewProperty;
2233 aNewProperty.Name = sPropertyName;
2234 aNewProperty.Value = aPropertyValue;
2240 Reference< XPropertySet > xSet(
mxShape, UNO_QUERY );
2241 Reference< XPropertySetInfo > xSetInfo( xSet->getPropertySetInfo() );
2243 if(
mxShape.is() && xSet.is() && xSetInfo.is() && xSetInfo->hasPropertyByName( aGrabBagPropName ) )
2245 Sequence< PropertyValue > aGrabBag;
2246 xSet->getPropertyValue( aGrabBagPropName ) >>= aGrabBag;
2248 sal_Int32
length = aGrabBag.getLength();
2249 aGrabBag.realloc( length + 1 );
2250 aGrabBag.getArray()[
length] = pProperty;
2252 xSet->setPropertyValue( aGrabBagPropName,
Any( aGrabBag ) );
2261 if( !(
mxShape.is() && xSet.is() && xSetInfo.is() && xSetInfo->hasPropertyByName( aGrabBagPropName )) )
2266 xSet->getPropertyValue( aGrabBagPropName ) >>= aGrabBag;
2268 std::vector<PropertyValue> aVec;
2273 [](
const PropertyValue& rProp) {
2274 PropertyValue aProp;
2275 aProp.Name = rProp.Name;
2276 aProp.Value = rProp.Value;
2293 if( pTheme !=
nullptr )
2306 if ( pParentShapeFillProps !=
nullptr)
2308 aFillProperties.
assignUsed( *pParentShapeFillProps );
2310 return aFillProperties;
2322 if( pTheme !=
nullptr )
2334 return aLineProperties;
2345 if( pTheme !=
nullptr )
2350 aEffectProperties.
assignUsed( *pEffectProps );
2357 return aEffectProperties;
2362 uno::Sequence< uno::Sequence< uno::Any > > xRelListTemp;
2363 sal_Int32 counter = 0;
2371 xRelListTemp.realloc( xImageRels->size() );
2372 auto pxRelListTemp = xRelListTemp.getArray();
2373 for (
auto const& imageRel : *xImageRels)
2375 uno::Sequence< uno::Any > diagramRelTuple (3);
2376 auto pdiagramRelTuple = diagramRelTuple.getArray();
2378 OUString sRelId = imageRel.second.maId;
2380 pdiagramRelTuple[0] <<= sRelId;
2381 OUString sTarget = xImageRels->getFragmentPathFromRelId( sRelId );
2383 uno::Reference< io::XInputStream > xImageInputStrm( rFilter.
openInputStream( sTarget ), uno::UNO_SET_THROW );
2387 pdiagramRelTuple[1] <<= dataSeq;
2390 pdiagramRelTuple[2] <<= sTarget.copy( sTarget.lastIndexOf(
".") );
2392 pxRelListTemp[counter] = diagramRelTuple;
2395 xRelListTemp.realloc(counter);
2399 return xRelListTemp;
2404 auto pFillProperties = std::make_shared<FillProperties>();
geometry::RealPoint2D maPosition
geometry::RealSize2D maSize
PropertiesInfo aProperties
constexpr OUStringLiteral sServiceName
constexpr OUStringLiteral sDocumentService
static OutputDevice * GetDefaultDevice()
ErrCode ImportGraphic(Graphic &rGraphic, const INetURLObject &rPath, sal_uInt16 nFormat=GRFILTER_FORMAT_DONTKNOW, sal_uInt16 *pDeterminedFormat=nullptr, GraphicFilterImportFlags nImportFlags=GraphicFilterImportFlags::NONE)
css::uno::Reference< css::graphic::XGraphic > GetXGraphic() const
LanguageType getLanguageType(bool bResolveSystem=true) const
const css::lang::Locale & getLocale(bool bResolveSystem=true) const
static sal_Int16 getScriptType(LanguageType nLang)
static SdrObject * getSdrObjectFromXShape(const css::uno::Reference< css::uno::XInterface > &xInt)
virtual void NbcSetLogicRect(const tools::Rectangle &rRect)
void SetMergedItem(const SfxPoolItem &rItem)
virtual const tools::Rectangle & GetLogicRect() const
constexpr tools::Long Width() const
sal_uInt64 Seek(sal_uInt64 nPos)
static SvtFilterOptions & Get()
bool IsSmartArt2Shape() const
bool decompose(B2DTuple &rScale, B2DTuple &rTranslate, double &rRotate, double &rShearX) const
void set(sal_uInt16 nRow, sal_uInt16 nColumn, double fValue)
void rotate(double fRadiant)
void translate(double fX, double fY)
double get(sal_uInt16 nRow, sal_uInt16 nColumn) const
void scale(double fX, double fY)
void insert(sal_uInt32 nIndex, const basegfx::B2DPoint &rPoint, sal_uInt32 nCount=1)
basegfx::B2DPoint const & getB2DPoint(sal_uInt32 nIndex) const
void transform(const basegfx::B2DHomMatrix &rMatrix)
Provides helper functions for colors, device measurement conversion, graphics, and graphic objects ha...
css::uno::Reference< css::graphic::XGraphic > importEmbeddedGraphic(const OUString &rStreamName, const WmfExternal *pExtHeader=nullptr) const
Imports a graphic from the storage stream with the passed path and name.
css::uno::Reference< css::awt::XBitmap > getFillBitmap(OUString const &rGraphicName)
void assignUsed(const PropertyMap &rPropMap)
Inserts all properties contained in the passed property map.
void erase(sal_Int32 nPropId)
css::uno::Any getProperty(sal_Int32 nPropId)
bool hasProperty(sal_Int32 nPropId) const
Returns true, if the map contains a property with the passed identifier.
static const OUString & getPropertyName(sal_Int32 nPropId)
Returns the name of the passed property identifier.
css::uno::Sequence< css::beans::PropertyValue > makePropertyValueSequence() const
Returns a sequence of property values, filled with all contained properties.
bool setProperty(sal_Int32 nPropId, Type &&rValue)
Sets the specified property to the passed value.
A wrapper for a UNO property set.
void setProperties(const css::uno::Sequence< OUString > &rPropNames, const css::uno::Sequence< css::uno::Any > &rValues)
Puts the passed properties into the property set.
bool setAnyProperty(sal_Int32 nPropId, const css::uno::Any &rValue)
Puts the passed any into the property set.
bool importBinaryData(StreamDataSequence &orDataSeq, const OUString &rStreamName)
Imports the raw binary data from the specified stream.
utl::MediaDescriptor & getMediaDescriptor() const
Returns the media descriptor.
const css::uno::Reference< css::frame::XModel > & getModel() const
Returns the document model (always existing).
css::uno::Reference< css::io::XInputStream > openInputStream(const OUString &rStreamName) const
Opens and returns the specified input stream from the base storage.
::oox::ole::OleObjectHelper & getOleObjectHelper() const
Returns a helper for the handling of OLE objects.
GraphicHelper & getGraphicHelper() const
Returns a helper for the handling of graphics and graphic objects.
ModelObjectHelper & getModelObjectHelper() const
Returns a helper with containers for various named drawing objects for the imported document.
const css::uno::Reference< css::uno::XComponentContext > & getComponentContext() const
Returns the component context passed in the filter constructor (always existing).
virtual ::oox::vml::Drawing * getVmlDrawing()=0
Has to be implemented by each filter to return the collection of VML shapes.
RelationsRef importRelations(const OUString &rFragmentPath)
Imports the relations fragment associated with the specified fragment.
NamedShapePairs * getDiagramFontHeights()
virtual ::oox::drawingml::chart::ChartConverter * getChartConverter()=0
Has to be implemented by each filter, returns a filter-specific chart converter object,...
bool importFragment(const rtl::Reference< FragmentHandler > &rxHandler)
Imports a fragment using the passed fragment handler, which contains the full path to the fragment st...
virtual void useInternalChartDataTable(bool)
Helper to switch chart data table - specifically for xlsx imports.
bool isMSO2007Document() const
bool isPlaceHolder() const
Returns true, if the color is a placeholder color in theme style lists.
const OUString & getSchemeColorName() const
Returns the scheme name from the a:schemeClr element for interoperability purposes.
sal_Int16 getTransparency() const
Returns the transparency of the color (0 = opaque, 100 = full transparent).
void clearTransformations()
Removes all color transformations.
const css::uno::Sequence< css::beans::PropertyValue > & getTransformations() const
Returns the unaltered list of transformations for interoperability purposes.
::Color getColor(const GraphicHelper &rGraphicHelper, ::Color nPhClr=API_RGB_TRANSPARENT) const
Returns the final RGB color value.
bool setProperty(ShapeProperty ePropId, const Type &rValue)
Sets the specified shape property to the passed value.
bool setAnyProperty(ShapeProperty ePropId, const css::uno::Any &rValue)
Sets the specified shape property to the passed value.
bool mbLockedCanvas
Is this shape part of a locked canvas?
ChartShapeInfo & setChartType(bool bEmbedShapes)
void setTextBox(bool bTextBox)
FrameType meFrameType
Type for graphic frame shapes.
const OUString & getInternalName() const
FillProperties getActualFillProperties(const Theme *pTheme, const FillProperties *pParentShapeFillProps) const
void putPropertyToGrabBag(const OUString &sPropertyName, const css::uno::Any &aPropertyValue)
void setServiceName(const char *pServiceName)
const ShapeStyleRef * getShapeStyleRef(sal_Int32 nRefType) const
svx::diagram::IDiagramHelper * mpDiagramHelper
PropertyMap maShapeProperties
PropertyMap & getShapeProperties()
LinePropertiesPtr mpShapeRefLinePropPtr
void keepDiagramDrawing(::oox::core::XmlFilterBase &rFilterBase, const OUString &rFragmentPath)
css::uno::Sequence< css::beans::PropertyValue > maDiagramDoms
void applyShapeReference(const Shape &rReferencedShape, bool bUseText=true)
void putPropertiesToGrabBag(const css::uno::Sequence< css::beans::PropertyValue > &aProperties)
void propagateDiagramHelper()
LineProperties & getLineProperties()
css::uno::Reference< css::drawing::XShape > renderDiagramToGraphic(::oox::core::XmlFilterBase const &rFilterBase)
PropertyMap maDefaultShapeProperties
const css::awt::Size & getSize() const
css::uno::Sequence< css::uno::Sequence< css::uno::Any > > resolveRelationshipsOfTypeFromOfficeDoc(core::XmlFilterBase &rFilter, const OUString &sFragment, std::u16string_view sType)
GraphicPropertiesPtr mpGraphicPropertiesPtr
void cloneFillProperties()
Changes reference semantics to value semantics for fill properties.
void setWPGChild(bool bWPG)
OUString finalizeServiceName(::oox::core::XmlFilterBase &rFilter, const OUString &rServiceName, const css::awt::Rectangle &rShapeRect)
bool mbTextBox
This shape has a textbox.
ShapeStyleRefMap maShapeStyleRefs
EffectProperties & getEffectProperties() const
void setMasterTextListStyle(const TextListStylePtr &pMasterTextListStyle)
const LinkedTxbxAttr & getLinkedTxbxAttributes() const
Shape3DProperties & get3DProperties()
void convertSmartArtToMetafile(::oox::core::XmlFilterBase const &rFilterBase)
void setLockedCanvas(bool bLockedCanvas)
FillPropertiesPtr mpShapeRefFillPropPtr
EffectProperties getActualEffectProperties(const Theme *pTheme) const
@ FRAMETYPE_GENERIC
Generic shape, no special type.
@ FRAMETYPE_TABLE
A table embedded in a shape.
@ FRAMETYPE_OLEOBJECT
OLE object embedded in a shape.
@ FRAMETYPE_CHART
Chart embedded in a shape.
@ FRAMETYPE_DIAGRAM
Complex diagram drawing shape.
Shape(const char *pServiceType=nullptr, bool bDefaultHeight=true)
void addChildren(::oox::core::XmlFilterBase &rFilterBase, Shape &rMaster, const Theme *pTheme, const css::uno::Reference< css::drawing::XShapes > &rxShapes, ShapeIdMap *pShapeMap, const basegfx::B2DHomMatrix &aTransformation)
ChartShapeInfoRef mxChartShapeInfo
Additional data for chart shapes.
css::awt::Point maPosition
TextListStylePtr mpMasterTextListStyle
table::TablePropertiesPtr mpTablePropertiesPtr
table::TablePropertiesPtr const & getTableProperties()
void keepDiagramCompatibilityInfo()
FillPropertiesPtr mpFillPropertiesPtr
CustomShapePropertiesPtr mpCustomShapePropertiesPtr
OleObjectInfoRef mxOleObjectInfo
Additional data for OLE objects.
FillProperties & getFillProperties()
void prepareDiagramHelper(const std::shared_ptr< Diagram > &rDiagramPtr, const std::shared_ptr<::oox::drawingml::Theme > &rTheme)
void setDefaults(bool bHeight)
bool mbWps
Is this a wps shape?
virtual void finalizeXShape(::oox::core::XmlFilterBase &rFilter, const css::uno::Reference< css::drawing::XShapes > &rxShapes)
void migrateDiagramHelperToNewShape(const ShapePtr &pTarget)
std::vector< ShapePtr > maChildren
EffectPropertiesPtr mpShapeRefEffectPropPtr
const TextBodyPtr & getTextBody() const
bool isLinkedTxbx() const
css::uno::Reference< css::drawing::XShape > const & createAndInsert(::oox::core::XmlFilterBase &rFilterBase, const OUString &rServiceName, const Theme *pTheme, const css::uno::Reference< css::drawing::XShapes > &rxShapes, bool bClearText, bool bDoNotInsertEmptyTextBody, basegfx::B2DHomMatrix &aTransformation, const FillProperties &rShapeOrParentShapeFillProps, oox::drawingml::ShapePtr pParentGroupShape=nullptr)
void addShape(::oox::core::XmlFilterBase &rFilterBase, const Theme *pTheme, const css::uno::Reference< css::drawing::XShapes > &rxShapes, const basegfx::B2DHomMatrix &aTransformation, const FillProperties &rShapeOrParentShapeFillProps, ShapeIdMap *pShapeMap=nullptr, oox::drawingml::ShapePtr pParentGroupShape=nullptr)
sal_Int32 mnDiagramRotation
::oox::vml::OleObjectInfo & setOleObjectType()
css::uno::Reference< css::drawing::XShape > mxShape
std::vector< OUString > maConnectorAdjustmentList
void setTextBody(const TextBodyPtr &pTextBody)
LineProperties getActualLineProperties(const Theme *pTheme) const
bool getFontData(OUString &rFontName, sal_Int16 &rnFontPitch, sal_Int16 &rnFontFamily, const ::oox::core::XmlFilterBase &rFilter) const
Returns the font name, pitch, and family; tries to resolve theme placeholder names,...
const EffectProperties * getEffectStyle(sal_Int32 nIndex) const
const FillProperties * getFillStyle(sal_Int32 nIndex) const
Returns the fill properties of the passed one-based themed style index.
const LineProperties * getLineStyle(sal_Int32 nIndex) const
Returns the line properties of the passed one-based themed style index.
const TextCharacterProperties * getFontStyle(sal_Int32 nSchemeType) const
Returns theme font properties by scheme type (major/minor).
void convertFromModel(::oox::core::XmlFilterBase &rFilter, ChartSpaceModel &rChartModel, const css::uno::Reference< css::chart2::XChartDocument > &rxChartDoc, const css::uno::Reference< css::drawing::XShapes > &rxExternalPage, const css::awt::Point &rChartPos, const css::awt::Size &rChartSize)
Converts the passed OOXML chart model to the passed chart2 document.
Handler for a chart fragment (c:chartSpace root element).
bool importOleObject(PropertyMap &rPropMap, const OleObjectInfo &rOleObject, const css::awt::Size &rObjSize)
const SlidePersistPtr & getActualSlidePersist() const
Represents the collection of VML shapes for a complete draw page.
#define TOOLS_WARN_EXCEPTION(area, stream)
#define GRFILTER_FORMAT_NOTFOUND
#define SAL_WARN(area, stream)
#define SAL_INFO(area, stream)
void putCustomShapeIntoTextPathMode(const css::uno::Reference< css::drawing::XShape > &xShape, const oox::drawingml::CustomShapePropertiesPtr &pCustomShapePropertiesPtr, const OUString &sMSPresetType, const bool bFromWordArt)
Changes the EnhancedCustomShapeGeometry of xShape shape so, that it becomes a LO Fontwork shape corre...
OUString GetFontworkType(std::u16string_view rMsoType)
tools::Long const nBorder
css::uno::Sequence< T > concatSequences(const css::uno::Sequence< T > &rS1, const Ss &... rSn)
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)
css::beans::PropertyValue makePropertyValue(const OUString &rName, T &&rValue)
std::shared_ptr< T > make_shared(Args &&... args)
constexpr Point convert(const Point &rPoint, o3tl::Length eFrom, o3tl::Length eTo)
constexpr T saturating_add(T a, T b)
std::shared_ptr< Relations > RelationsRef
std::map< OUString, ShapePairs > NamedShapePairs
std::shared_ptr< TableProperties > TablePropertiesPtr
float GetFontHeight(sal_Int32 nHeight)
static SdrTextHorzAdjust lcl_convertAdjust(ParagraphAdjust eAdjust)
std::shared_ptr< Shape > ShapePtr
sal_Int32 convertEmuToHmm(sal_Int64 nValue)
Converts the passed 64-bit integer value from EMUs to 1/100 mm.
std::shared_ptr< Theme > ThemePtr
::std::map< OUString, ShapePtr > ShapeIdMap
static void lcl_copyCharPropsToShape(const uno::Reference< drawing::XShape > &xShape, const TextBodyPtr &pTextBody, const ::oox::core::XmlFilterBase &rFilter)
std::shared_ptr< TextListStyle > TextListStylePtr
std::shared_ptr< TextBody > TextBodyPtr
css::uno::Sequence< sal_Int8 > StreamDataSequence
const ::Color API_RGB_TRANSPARENT(ColorTransparency, 0xffffffff)
Transparent color for API calls.
Reference< document::XActionLockable > m_xLockable
#define STREAM_SEEK_TO_BEGIN
UNDERLYING_TYPE get() const
Additional information for a chart embedded in a drawing shape.
std::optional< sal_Int64 > moGlowRad
EffectGlowProperties maGlow
EffectSoftEdgeProperties maSoftEdge
std::vector< std::unique_ptr< Effect > > m_Effects
Stores all effect properties, including those not supported by core yet.
void assignUsed(const EffectProperties &rSourceProps)
Overwrites all members that are explicitly set in rSourceProps.
EffectShadowProperties maShadow
void pushToPropMap(PropertyMap &rPropMap, const GraphicHelper &rGraphicHelper) const
Writes the properties to the passed property map.
std::optional< sal_Int64 > moShadowDir
std::optional< sal_Int64 > moRad
void pushToPropMap(ShapePropertyMap &rPropMap, const GraphicHelper &rGraphicHelper, sal_Int32 nShapeRotation=0, ::Color nPhClr=API_RGB_TRANSPARENT, sal_Int16 nPhClrTheme=-1, bool bFlipH=false, bool bFlipV=false, bool bIsCustomShape=false) const
Writes the properties to the passed property map.
GradientFillProperties maGradientProps
Whether the background is used as fill type.
void assignUsed(const FillProperties &rSourceProps)
Properties for bitmap fills.
Color maFillColor
Fill type (OOXML token).
std::optional< sal_Int32 > moFillType
css::uno::Sequence< css::beans::PropertyValue > getLightRigAttributes()
css::uno::Sequence< css::beans::PropertyValue > getShape3DAttributes(const GraphicHelper &rGraphicHelper, ::Color rPhClr)
RotationProperties maCameraRotation
css::uno::Sequence< css::beans::PropertyValue > getCameraAttributes()
GradientStopMap maGradientStops
void assignUsed(const LineProperties &rSourceProps)
Line joint type (OOXML token).
FillProperties maLineFill
End line arrow style.
sal_Int32 getLineWidth() const
Calculates the line width attribute from the internal state of the object.
std::optional< sal_Int32 > moLineWidth
User-defined line dash style.
void pushToPropMap(ShapePropertyMap &rPropMap, const GraphicHelper &rGraphicHelper, ::Color nPhClr=API_RGB_TRANSPARENT, sal_Int16 nPhClrTheme=-1) const
Writes the properties to the passed property map.
css::drawing::LineStyle getLineStyle() const
Calculates the line style attribute from the internal state of the object.
css::drawing::LineCap getLineCap() const
Calculates the line cap attribute from the internal state of the object.
css::drawing::LineJoint getLineJoint() const
Calculates the line joint attribute from the internal state of the object.
std::optional< sal_Int32 > mnRevolution
TextFont maAsianThemeFont
TextFont maLatinThemeFont
std::optional< OUString > moLang
std::optional< bool > moItalic
void assignUsed(const TextCharacterProperties &rSourceProps)
Overwrites all members that are explicitly set in rSourceProps.
TextFont maComplexThemeFont
std::optional< sal_Int32 > moHeight
FillProperties maFillProperties
std::optional< bool > moBold
std::optional< LineProperties > moTextOutlineProperties
Contains information about an OLE object embedded in a draw page.
SVXCORE_DLLPUBLIC Degree100 NormAngle36000(Degree100 a)
constexpr OUStringLiteral UNO_NAME_TEXT_LOWERDIST
constexpr OUStringLiteral UNO_NAME_TEXT_UPPERDIST
constexpr OUStringLiteral UNO_NAME_LINESTYLE
constexpr OUStringLiteral UNO_NAME_CHAR_POSTURE
constexpr OUStringLiteral UNO_NAME_TEXT_VERTADJUST
constexpr OUStringLiteral UNO_NAME_TEXT_LEFTDIST
constexpr OUStringLiteral UNO_NAME_TEXT_AUTOGROWHEIGHT
constexpr OUStringLiteral UNO_NAME_TEXT_AUTOGROWWIDTH
constexpr OUStringLiteral UNO_NAME_CHAR_HEIGHT
constexpr OUStringLiteral UNO_NAME_MISC_OBJ_INTEROPGRABBAG
constexpr OUStringLiteral UNO_NAME_TEXT_RIGHTDIST
constexpr OUStringLiteral UNO_NAME_CHAR_WEIGHT
constexpr OUStringLiteral PROP_FillTransparence
constexpr OUStringLiteral PROP_TextWordWrap
constexpr OUStringLiteral PROP_Shadow
constexpr OUStringLiteral PROP_RightBorder
constexpr OUStringLiteral PROP_RotateAngle
constexpr OUStringLiteral PROP_TextLeftDistance
constexpr OUStringLiteral PROP_ShadowXDistance
constexpr OUStringLiteral PROP_HoriOrientPosition
constexpr OUStringLiteral PROP_CharHeight
constexpr OUStringLiteral PROP_LineColor
constexpr OUStringLiteral PROP_TextUpperDistance
constexpr OUStringLiteral PROP_BackColor
constexpr OUStringLiteral PROP_FillColor
constexpr OUStringLiteral PROP_BackColorTransparency
constexpr OUStringLiteral PROP_TextContourFrame
constexpr OUStringLiteral PROP_CharColor
constexpr OUStringLiteral PROP_FillBitmapName
constexpr OUStringLiteral PROP_LeftBorder
constexpr OUStringLiteral PROP_GraphicCrop
constexpr OUStringLiteral PROP_ShadowFormat
constexpr OUStringLiteral PROP_BackGraphic
constexpr OUStringLiteral PROP_TextLowerDistance
constexpr OUStringLiteral PROP_TextAutoGrowHeight
constexpr OUStringLiteral PROP_ParaAdjust
constexpr OUStringLiteral PROP_TextRightDistance
constexpr OUStringLiteral PROP_TopBorder
constexpr OUStringLiteral PROP_TextVerticalAdjust
constexpr OUStringLiteral PROP_VertOrientPosition
constexpr OUStringLiteral PROP_ShadowColor
constexpr OUStringLiteral PROP_ShadowYDistance
constexpr OUStringLiteral PROP_BottomBorder