23#include <com/sun/star/loader/CannotActivateFactoryException.hpp>
24#include <com/sun/star/drawing/XShape.hpp>
25#include <com/sun/star/drawing/XCustomShapeEngine.hpp>
26#include <com/sun/star/drawing/PolyPolygonBezierCoords.hpp>
27#include <com/sun/star/beans/PropertyValue.hpp>
28#include <com/sun/star/awt/Rectangle.hpp>
29#include <com/sun/star/uno/XComponentContext.hpp>
33#include <com/sun/star/uno/Sequence.h>
43#include <svx/strings.hrc>
53#include <com/sun/star/beans/PropertyValues.hpp>
54#include <com/sun/star/drawing/EnhancedCustomShapeAdjustmentValue.hpp>
55#include <com/sun/star/drawing/EnhancedCustomShapeParameterPair.hpp>
56#include <com/sun/star/drawing/EnhancedCustomShapeTextFrame.hpp>
57#include <com/sun/star/drawing/EnhancedCustomShapeSegment.hpp>
58#include <com/sun/star/drawing/EnhancedCustomShapeSegmentCommand.hpp>
98 rSegInfo.Command = drawing::EnhancedCustomShapeSegmentCommand::LINETO;
99 rSegInfo.Count = nSDat & 0xff;
100 if ( !rSegInfo.Count )
104 rSegInfo.Command = drawing::EnhancedCustomShapeSegmentCommand::CURVETO;
105 rSegInfo.Count = nSDat & 0xff;
106 if ( !rSegInfo.Count )
110 rSegInfo.Command = drawing::EnhancedCustomShapeSegmentCommand::MOVETO;
111 rSegInfo.Count = nSDat & 0xff;
112 if ( !rSegInfo.Count )
116 rSegInfo.Command = drawing::EnhancedCustomShapeSegmentCommand::CLOSESUBPATH;
120 rSegInfo.Command = drawing::EnhancedCustomShapeSegmentCommand::ENDSUBPATH;
124 rSegInfo.Command = drawing::EnhancedCustomShapeSegmentCommand::ANGLEELLIPSETO;
125 rSegInfo.Count = ( nSDat & 0xff ) / 3;
128 rSegInfo.Command = drawing::EnhancedCustomShapeSegmentCommand::ANGLEELLIPSE;
129 rSegInfo.Count = ( nSDat & 0xff ) / 3;
132 rSegInfo.Command = drawing::EnhancedCustomShapeSegmentCommand::ARCTO;
133 rSegInfo.Count = ( nSDat & 0xff ) >> 2;
136 rSegInfo.Command = drawing::EnhancedCustomShapeSegmentCommand::ARC;
137 rSegInfo.Count = ( nSDat & 0xff ) >> 2;
140 rSegInfo.Command = drawing::EnhancedCustomShapeSegmentCommand::CLOCKWISEARCTO;
141 rSegInfo.Count = ( nSDat & 0xff ) >> 2;
144 rSegInfo.Command = drawing::EnhancedCustomShapeSegmentCommand::CLOCKWISEARC;
145 rSegInfo.Count = ( nSDat & 0xff ) >> 2;
148 rSegInfo.Command = drawing::EnhancedCustomShapeSegmentCommand::ELLIPTICALQUADRANTX;
149 rSegInfo.Count = nSDat & 0xff;
152 rSegInfo.Command = drawing::EnhancedCustomShapeSegmentCommand::ELLIPTICALQUADRANTY;
153 rSegInfo.Count = nSDat & 0xff;
156 rSegInfo.Command = drawing::EnhancedCustomShapeSegmentCommand::NOFILL;
160 rSegInfo.Command = drawing::EnhancedCustomShapeSegmentCommand::NOSTROKE;
165 rSegInfo.Command = drawing::EnhancedCustomShapeSegmentCommand::UNKNOWN;
166 rSegInfo.Count = nSDat;
176 if ( aEngine.isEmpty() || aEngine ==
"com.sun.star.drawing.EnhancedCustomShapeEngine" )
181 if ( pAny && ( *pAny >>= sShapeType ) )
220 DBG_ASSERT(pRetval,
"ImpCreateShadowObjectClone: Could not clone object (!)");
224 bool bLineUsed(
false);
225 bool bAllFillUsed(
false);
226 bool bSolidFillUsed(
false);
227 bool bGradientFillUsed(
false);
228 bool bHatchFillUsed(
false);
229 bool bBitmapFillUsed(
false);
240 if(drawing::LineStyle_NONE != eLineStyle)
248 if(!bSolidFillUsed && drawing::FillStyle_SOLID == eFillStyle)
250 bSolidFillUsed =
true;
251 bAllFillUsed = (bSolidFillUsed && bGradientFillUsed && bHatchFillUsed && bBitmapFillUsed);
253 if(!bGradientFillUsed && drawing::FillStyle_GRADIENT == eFillStyle)
255 bGradientFillUsed =
true;
256 bAllFillUsed = (bSolidFillUsed && bGradientFillUsed && bHatchFillUsed && bBitmapFillUsed);
258 if(!bHatchFillUsed && drawing::FillStyle_HATCH == eFillStyle)
260 bHatchFillUsed =
true;
261 bAllFillUsed = (bSolidFillUsed && bGradientFillUsed && bHatchFillUsed && bBitmapFillUsed);
263 if(!bBitmapFillUsed && drawing::FillStyle_BITMAP == eFillStyle)
265 bBitmapFillUsed =
true;
266 bAllFillUsed = (bSolidFillUsed && bGradientFillUsed && bHatchFillUsed && bBitmapFillUsed);
272 pRetval->NbcMove(
Size(nXDist, nYDist));
303 if(bGradientFillUsed)
311 nStartLuminance =
static_cast<sal_uInt8>(nStartLuminance * (
static_cast<double>(aGradient.
GetStartIntens()) / 100.0));
316 nEndLuminance =
static_cast<sal_uInt8>(nEndLuminance * (
static_cast<double>(aGradient.
GetEndIntens()) / 100.0));
320 static_cast<sal_uInt8>((nStartLuminance * aShadowColor.GetRed()) / 256),
321 static_cast<sal_uInt8>((nStartLuminance * aShadowColor.GetGreen()) / 256),
322 static_cast<sal_uInt8>((nStartLuminance * aShadowColor.GetBlue()) / 256));
325 static_cast<sal_uInt8>((nEndLuminance * aShadowColor.GetRed()) / 256),
326 static_cast<sal_uInt8>((nEndLuminance * aShadowColor.GetGreen()) / 256),
327 static_cast<sal_uInt8>((nEndLuminance * aShadowColor.GetBlue()) / 256));
357 pVirDev->DrawBitmapEx(
Point(), aBitmapEx);
366 pRetval->SetMergedItemSet( aTempSet );
381 uno::Reference<uno::XComponentContext> xContext( ::comphelper::getProcessComponentContext() );
384 static constexpr OUStringLiteral sEnhancedCustomShapeEngine =
u"com.sun.star.drawing.EnhancedCustomShapeEngine";
385 if ( aEngine.isEmpty() )
386 aEngine = sEnhancedCustomShapeEngine;
389 static constexpr OUStringLiteral sCustomShape =
u"CustomShape";
392 uno::Sequence<uno::Any> aArgument{
uno::Any(aPropValues) };
395 uno::Reference<uno::XInterface> xInterface(xContext->getServiceManager()->createInstanceWithArgumentsAndContext(aEngine, aArgument, xContext));
399 catch (
const loader::CannotActivateFactoryException&)
412 if ( xCustomShapeEngine.is() )
418 return pRenderedCustomShape;
447 static constexpr OUStringLiteral sTextPath(
u"TextPath" );
448 bool bTextPathOn =
false;
452 *pAny >>= bTextPathOn;
460 static constexpr OUStringLiteral
sType(
u"Type" );
464 *pAny >>= sShapeType;
472 bool bMirroredX =
false;
476 *pAny >>= bMirroredX;
481 bool bMirroredY =
false;
485 *pAny >>= bMirroredY;
491 beans::PropertyValue aPropVal;
492 aPropVal.Name =
"MirroredX";
493 aPropVal.Value <<= bMirrorX;
500 beans::PropertyValue aPropVal;
501 aPropVal.Name =
"MirroredY";
502 aPropVal.Value <<= bMirrorY;
509 double fExtraTextRotateAngle = 0.0;
517 *pAny >>= fExtraTextRotateAngle;
522 if (rDirectionItem.GetValue() == SvxFrameDirection::Vertical_RL_TB90)
523 fExtraTextRotateAngle -= 90;
524 else if (rDirectionItem.GetValue() == SvxFrameDirection::Vertical_LR_BT)
525 fExtraTextRotateAngle -=270;
533 *pAny >>= fExtraTextRotateAngle;
535 return fExtraTextRotateAngle;
543 if ( xCustomShapeEngine.is() )
545 awt::Rectangle aR( xCustomShapeEngine->getTextBounds() );
546 if ( aR.Width > 1 && aR.Height > 1 )
558 if ( xCustomShapeEngine.is() )
560 drawing::PolyPolygonBezierCoords aBezierCoords = xCustomShapeEngine->getLineGeometry();
569 catch (
const lang::IllegalArgumentException & )
578 std::vector< SdrCustomShapeInteraction > aRet;
582 if ( xCustomShapeEngine.is() )
585 uno::Sequence<uno::Reference<drawing::XCustomShapeHandle>> xInteractionHandles( xCustomShapeEngine->getInteraction() );
586 for (
i = 0;
i < xInteractionHandles.getLength();
i++ )
588 if ( xInteractionHandles[
i ].is() )
591 aSdrCustomShapeInteraction.
xInteraction = xInteractionHandles[
i ];
592 aSdrCustomShapeInteraction.
aPosition = xInteractionHandles[
i ]->getPosition();
657 aSdrCustomShapeInteraction.
nMode = nMode;
658 aRet.push_back( aSdrCustomShapeInteraction );
663 catch(
const uno::RuntimeException& )
671#define DEFAULT_MINIMUM_SIGNED_COMPARE (sal_Int32(0x80000000))
672#define DEFAULT_MAXIMUM_SIGNED_COMPARE (sal_Int32(0x7fffffff))
676 sal_Int32 nPropertiesNeeded=1;
708 return nPropertiesNeeded;
715 auto pPropValues = rPropValues.getArray();
719 drawing::EnhancedCustomShapeParameterPair aPosition;
722 pPropValues[
n ].Name =
"Position";
723 pPropValues[
n++ ].Value <<= aPosition;
727 pPropValues[
n ].Name =
"MirroredX";
728 pPropValues[
n++ ].Value <<=
true;
732 pPropValues[
n ].Name =
"MirroredY";
733 pPropValues[
n++ ].Value <<=
true;
737 pPropValues[
n ].Name =
"Switched";
738 pPropValues[
n++ ].Value <<=
true;
742 drawing::EnhancedCustomShapeParameterPair aCenter;
747 pPropValues[
n ].Name =
"Polar";
748 pPropValues[
n++ ].Value <<= aCenter;
753 drawing::EnhancedCustomShapeParameter aRadiusRangeMinimum;
756 pPropValues[
n ].Name =
"RadiusRangeMinimum";
757 pPropValues[
n++ ].Value <<= aRadiusRangeMinimum;
761 drawing::EnhancedCustomShapeParameter aRadiusRangeMaximum;
764 pPropValues[
n ].Name =
"RadiusRangeMaximum";
765 pPropValues[
n++ ].Value <<= aRadiusRangeMaximum;
773 drawing::EnhancedCustomShapeParameter aRangeXMinimum;
776 pPropValues[
n ].Name =
"RangeXMinimum";
777 pPropValues[
n++ ].Value <<= aRangeXMinimum;
781 drawing::EnhancedCustomShapeParameter aRangeXMaximum;
784 pPropValues[
n ].Name =
"RangeXMaximum";
785 pPropValues[
n++ ].Value <<= aRangeXMaximum;
789 drawing::EnhancedCustomShapeParameter aRangeYMinimum;
792 pPropValues[
n ].Name =
"RangeYMinimum";
793 pPropValues[
n++ ].Value <<= aRangeYMinimum;
797 drawing::EnhancedCustomShapeParameter aRangeYMaximum;
800 pPropValues[
n ].Name =
"RangeYMaximum";
801 pPropValues[
n++ ].Value <<= aRangeYMaximum;
808 return std::make_unique<sdr::properties::CustomShapeProperties>(*
this);
813 , fObjectRotation(0.0)
814 , mbAdjustingTextFrameWidthAndHeight(false)
822 , fObjectRotation(0.0)
823 , mbAdjustingTextFrameWidthAndHeight(false)
842 beans::PropertyValue aPropVal;
844 static constexpr OUStringLiteral
sType(
u"Type" );
846 if ( pType && !pType->isEmpty() )
848 sal_Int32
nType = pType->toInt32();
854 aPropVal.Name =
sType;
855 aPropVal.Value <<= sShapeType;
862 *pAny >>= sShapeType;
866 const sal_Int32* pDefData =
nullptr;
868 if ( pDefCustomShape )
869 pDefData = pDefCustomShape->
pDefData;
871 uno::Sequence<drawing::EnhancedCustomShapeAdjustmentValue> seqAdjustmentValues;
876 static constexpr OUStringLiteral sAdjustmentValues(
u"AdjustmentValues" );
879 *pAny >>= seqAdjustmentValues;
880 if ( pDefCustomShape && pDefData )
883 sal_Int32
i, nAdjustmentValues = seqAdjustmentValues.getLength();
884 sal_Int32 nAdjustmentDefaults = *pDefData++;
885 if ( nAdjustmentDefaults > nAdjustmentValues )
886 seqAdjustmentValues.realloc( nAdjustmentDefaults );
887 auto pseqAdjustmentValues = seqAdjustmentValues.getArray();
888 for (
i = nAdjustmentValues;
i < nAdjustmentDefaults;
i++ )
890 pseqAdjustmentValues[
i ].Value <<= pDefData[
i ];
891 pseqAdjustmentValues[
i ].State = beans::PropertyState_DIRECT_VALUE;
894 sal_Int32
nCount = std::min(nAdjustmentValues, nAdjustmentDefaults);
897 if ( seqAdjustmentValues[
i ].
State != beans::PropertyState_DIRECT_VALUE )
899 pseqAdjustmentValues[
i ].Value <<= pDefData[
i ];
900 pseqAdjustmentValues[
i ].State = beans::PropertyState_DIRECT_VALUE;
904 aPropVal.Name = sAdjustmentValues;
905 aPropVal.Value <<= seqAdjustmentValues;
911 static constexpr OUStringLiteral sViewBox(
u"ViewBox" );
913 awt::Rectangle aViewBox;
914 if ( !pViewBox || !(*pViewBox >>= aViewBox ) )
916 if ( pDefCustomShape )
922 aPropVal.Name = sViewBox;
923 aPropVal.Value <<= aViewBox;
928 static constexpr OUStringLiteral sPath(
u"Path" );
933 static constexpr OUStringLiteral sCoordinates(
u"Coordinates" );
935 if ( !pAny && pDefCustomShape && pDefCustomShape->
nVertices && pDefCustomShape->
pVertices )
938 uno::Sequence<drawing::EnhancedCustomShapeParameterPair> seqCoordinates(
nCount );
939 auto pseqCoordinates = seqCoordinates.getArray();
945 aPropVal.Name = sCoordinates;
946 aPropVal.Value <<= seqCoordinates;
951 static constexpr OUStringLiteral sGluePoints(
u"GluePoints" );
956 uno::Sequence<drawing::EnhancedCustomShapeParameterPair> seqGluePoints(
nCount );
957 auto pseqGluePoints = seqGluePoints.getArray();
963 aPropVal.Name = sGluePoints;
964 aPropVal.Value <<= seqGluePoints;
969 static constexpr OUStringLiteral sSegments(
u"Segments" );
971 if ( !pAny && pDefCustomShape && pDefCustomShape->
nElements && pDefCustomShape->
pElements )
974 uno::Sequence<drawing::EnhancedCustomShapeSegment> seqSegments(
nCount );
975 auto pseqSegments = seqSegments.getArray();
978 drawing::EnhancedCustomShapeSegment& rSegInfo = pseqSegments[
i ];
979 sal_uInt16 nSDat = pDefCustomShape->
pElements[
i ];
982 aPropVal.Name = sSegments;
983 aPropVal.Value <<= seqSegments;
988 static constexpr OUStringLiteral sStretchX(
u"StretchX" );
990 if ( !pAny && pDefCustomShape )
992 sal_Int32 nXRef = pDefCustomShape->
nXRef;
995 aPropVal.Name = sStretchX;
996 aPropVal.Value <<= nXRef;
1002 static constexpr OUStringLiteral sStretchY(
u"StretchY" );
1004 if ( !pAny && pDefCustomShape )
1006 sal_Int32 nYRef = pDefCustomShape->
nYRef;
1009 aPropVal.Name = sStretchY;
1010 aPropVal.Value <<= nYRef;
1016 static constexpr OUStringLiteral sTextFrames(
u"TextFrames" );
1018 if ( !pAny && pDefCustomShape && pDefCustomShape->
nTextRect && pDefCustomShape->
pTextRect )
1021 uno::Sequence<drawing::EnhancedCustomShapeTextFrame> seqTextFrames(
nCount );
1022 auto pseqTextFrames = seqTextFrames.getArray();
1024 for (
i = 0;
i <
nCount;
i++, pRectangles++ )
1031 aPropVal.Name = sTextFrames;
1032 aPropVal.Value <<= seqTextFrames;
1037 static constexpr OUStringLiteral sEquations(
u"Equations" );
1042 uno::Sequence< OUString > seqEquations(
nCount );
1043 auto pseqEquations = seqEquations.getArray();
1047 aPropVal.Name = sEquations;
1048 aPropVal.Value <<= seqEquations;
1053 static constexpr OUStringLiteral sHandles(
u"Handles" );
1055 if ( !pAny && pDefCustomShape && pDefCustomShape->
nHandles && pDefCustomShape->
pHandles )
1059 uno::Sequence<beans::PropertyValues> seqHandles(
nCount );
1060 auto pseqHandles = seqHandles.getArray();
1063 sal_Int32 nPropertiesNeeded;
1064 beans::PropertyValues& rPropValues = pseqHandles[
i ];
1066 rPropValues.realloc( nPropertiesNeeded );
1069 aPropVal.Name = sHandles;
1070 aPropVal.Value <<= seqHandles;
1073 else if (pAny && sShapeType.startsWith(
"ooxml-") && sShapeType !=
"ooxml-non-primitive")
1079 uno::Sequence<beans::PropertyValues> seqHandles;
1080 *pAny >>= seqHandles;
1081 auto seqHandlesRange = asNonConstRange(seqHandles);
1082 bool bChanged(
false);
1083 for (sal_Int32
i = 0;
i < seqHandles.getLength();
i++)
1086 OUString sFirstRefType;
1087 sal_Int32 nFirstAdjRef;
1088 OUString sSecondRefType;
1089 sal_Int32 nSecondAdjRef;
1091 sSecondRefType, nSecondAdjRef);
1092 if (sFirstRefType !=
"na" && 0 <= nFirstAdjRef
1093 && nFirstAdjRef < seqAdjustmentValues.getLength())
1097 if (sSecondRefType !=
"na" && 0 <= nSecondAdjRef
1098 && nSecondAdjRef < seqAdjustmentValues.getLength())
1102 aHandleProps >> seqHandlesRange[
i];
1106 aPropVal.Name = sHandles;
1107 aPropVal.Value <<= seqHandles;
1117 bool bIsDefaultGeometry =
false;
1119 OUString sShapeType;
1124 *pAny >>= sShapeType;
1129 static constexpr OUStringLiteral sPath(
u"Path" );
1130 switch( eDefaultType )
1135 awt::Rectangle aViewBox;
1136 if (pViewBox && (*pViewBox >>= aViewBox) && pDefCustomShape)
1138 if ( ( aViewBox.Width == pDefCustomShape->
nCoordWidth )
1139 && ( aViewBox.Height == pDefCustomShape->
nCoordHeight ) )
1140 bIsDefaultGeometry =
true;
1148 if ( pAny && pDefCustomShape && pDefCustomShape->
nVertices && pDefCustomShape->
pVertices )
1150 uno::Sequence<drawing::EnhancedCustomShapeParameterPair> seqCoordinates1;
1151 if ( *pAny >>= seqCoordinates1 )
1154 uno::Sequence<drawing::EnhancedCustomShapeParameterPair> seqCoordinates2(
nCount );
1155 auto pseqCoordinates2 = seqCoordinates2.getArray();
1161 if ( seqCoordinates1 == seqCoordinates2 )
1162 bIsDefaultGeometry =
true;
1165 else if ( pDefCustomShape && ( ( pDefCustomShape->
nVertices == 0 ) || ( pDefCustomShape->
pVertices ==
nullptr ) ) )
1166 bIsDefaultGeometry =
true;
1175 uno::Sequence<drawing::EnhancedCustomShapeParameterPair> seqGluePoints1;
1176 if ( *pAny >>= seqGluePoints1 )
1179 uno::Sequence<drawing::EnhancedCustomShapeParameterPair> seqGluePoints2(
nCount );
1180 auto pseqGluePoints2 = seqGluePoints2.getArray();
1186 if ( seqGluePoints1 == seqGluePoints2 )
1187 bIsDefaultGeometry =
true;
1190 else if ( pDefCustomShape && ( pDefCustomShape->
nGluePoints == 0 ) )
1191 bIsDefaultGeometry =
true;
1201 uno::Sequence<drawing::EnhancedCustomShapeSegment> seqSegments1;
1202 if ( *pAny >>= seqSegments1 )
1209 uno::Sequence<drawing::EnhancedCustomShapeSegment> seqSegments2(
nCount );
1210 auto pseqSegments2 = seqSegments2.getArray();
1213 drawing::EnhancedCustomShapeSegment& rSegInfo = pseqSegments2[
i ];
1214 sal_uInt16 nSDat = pDefCustomShape->
pElements[
i ];
1217 if ( seqSegments1 == seqSegments2 )
1218 bIsDefaultGeometry =
true;
1224 if ( seqSegments1.getLength() == 4 )
1226 if ( ( seqSegments1[ 0 ].Command == drawing::EnhancedCustomShapeSegmentCommand::MOVETO )
1227 && ( seqSegments1[ 1 ].Command == drawing::EnhancedCustomShapeSegmentCommand::LINETO )
1228 && ( seqSegments1[ 2 ].Command == drawing::EnhancedCustomShapeSegmentCommand::CLOSESUBPATH )
1229 && ( seqSegments1[ 3 ].Command == drawing::EnhancedCustomShapeSegmentCommand::ENDSUBPATH ) )
1230 bIsDefaultGeometry =
true;
1235 else if ( pDefCustomShape && ( ( pDefCustomShape->
nElements == 0 ) || ( pDefCustomShape->
pElements ==
nullptr ) ) )
1236 bIsDefaultGeometry =
true;
1243 if ( pAny && pDefCustomShape )
1245 sal_Int32 nStretchX = 0;
1246 if ( *pAny >>= nStretchX )
1248 if ( pDefCustomShape->
nXRef == nStretchX )
1249 bIsDefaultGeometry =
true;
1253 bIsDefaultGeometry =
true;
1260 if ( pAny && pDefCustomShape )
1262 sal_Int32 nStretchY = 0;
1263 if ( *pAny >>= nStretchY )
1265 if ( pDefCustomShape->
nYRef == nStretchY )
1266 bIsDefaultGeometry =
true;
1270 bIsDefaultGeometry =
true;
1279 uno::Sequence<OUString> seqEquations1;
1280 if ( *pAny >>= seqEquations1 )
1283 uno::Sequence<OUString> seqEquations2(
nCount );
1284 auto pseqEquations2 = seqEquations2.getArray();
1290 if ( seqEquations1 == seqEquations2 )
1291 bIsDefaultGeometry =
true;
1294 else if ( pDefCustomShape && ( ( pDefCustomShape->
nCalculation == 0 ) || ( pDefCustomShape->
pCalculation ==
nullptr ) ) )
1295 bIsDefaultGeometry =
true;
1302 if ( pAny && pDefCustomShape && pDefCustomShape->
nTextRect && pDefCustomShape->
pTextRect )
1304 uno::Sequence<drawing::EnhancedCustomShapeTextFrame> seqTextFrames1;
1305 if ( *pAny >>= seqTextFrames1 )
1308 uno::Sequence<drawing::EnhancedCustomShapeTextFrame> seqTextFrames2(
nCount );
1309 auto pseqTextFrames2 = seqTextFrames2.getArray();
1311 for (
i = 0;
i <
nCount;
i++, pRectangles++ )
1318 if ( seqTextFrames1 == seqTextFrames2 )
1319 bIsDefaultGeometry =
true;
1322 else if ( pDefCustomShape && ( ( pDefCustomShape->
nTextRect == 0 ) || ( pDefCustomShape->
pTextRect ==
nullptr ) ) )
1323 bIsDefaultGeometry =
true;
1327 return bIsDefaultGeometry;
1349 if ( !pRenderedCustomShape )
1357 while(aIterator.
IsMore())
1403 bool bChanged(
false);
1404 if(bResizeShapeToFitText)
1415 if(bResizeShapeToFitText)
1503 if ( pRenderedCustomShape )
1508 pRenderedCustomShape->
NbcMove( rSiz );
1542 for (
const auto& rInteraction : aInteractionHandles)
1547 rInteraction.xInteraction->setControllerPosition( rInteraction.aPosition );
1551 rInteraction.xInteraction->setControllerPosition(awt::Point(nX, rInteraction.xInteraction->getPosition().Y));
1556 rInteraction.xInteraction->setControllerPosition(awt::Point(nX, rInteraction.xInteraction->getPosition().Y));
1561 rInteraction.xInteraction->setControllerPosition(awt::Point(rInteraction.xInteraction->getPosition().X, nY));
1564 catch (
const uno::RuntimeException& )
1571 double fAngle =
toDegrees(nTextObjRotation);
1613 nW = 36000_deg100 - nW;
1615 nW = 18000_deg100 - nW;
1616 nW = nW % 36000_deg100;
1617 if ( nW < 0_deg100 )
1618 nW = 36000_deg100 + nW;
1667 double fAngle =
toDegrees(nTextObjRotation);
1695 double fAngle =
toDegrees(nTextObjRotation);
1733 case 0: aPt = aRectangle.TopCenter(); aPt.
AdjustY( -nWdt );
break;
1734 case 1: aPt = aRectangle.RightCenter(); aPt.
AdjustX(nWdt );
break;
1735 case 2: aPt = aRectangle.BottomCenter(); aPt.
AdjustY(nWdt );
break;
1736 case 3: aPt = aRectangle.LeftCenter(); aPt.
AdjustX( -nWdt );
break;
1759 if(!(pSource && pSource->
GetCount()))
1793 sal_uInt16 nPointCount=aPoly.
GetSize();
1794 for (sal_uInt16
i=0;
i<nPointCount;
i++)
1804 if (nShearAngle && bMirroredX != bMirroredY)
1806 nShearAngle = -nShearAngle;
1836 aNewList.
Insert(rCandidate);
1882 int nCustomShapeHdlNum = 0;
1885 if ( rInteraction.xInteraction.is() )
1889 awt::Point aPosition( rInteraction.xInteraction->getPosition() );
1891 pH->SetPointNum( nCustomShapeHdlNum );
1893 rHdlList.
AddHdl(std::move(pH));
1895 catch (
const uno::RuntimeException& )
1899 ++nCustomShapeHdlNum;
1964 aNewRect.
SetPos( aNewPos );
1972 if ( rNewRect.
Left() > rNewRect.
Right() )
1975 Point aBottom( aTop.
X(), aTop.
Y() + 1000 );
1978 if ( rNewRect.
Top() > rNewRect.
Bottom() )
1981 Point aRight( aLeft.
X() + 1000, aLeft.
Y() );
1985 for (
const auto& rInteraction : aInteractionHandles)
1990 rInteraction.xInteraction->setControllerPosition( rInteraction.aPosition );
1995 bOldMirroredX = !bOldMirroredX;
1998 if ( bOldMirroredX )
2000 nX = ( rInteraction.aPosition.X - aOld.
Right() );
2001 if ( rNewRect.
Left() > rNewRect.
Right() )
2008 nX = ( rInteraction.aPosition.X - aOld.
Left() );
2009 if ( rNewRect.
Left() > rNewRect.
Right() )
2014 rInteraction.xInteraction->setControllerPosition(awt::Point(nX, rInteraction.xInteraction->getPosition().Y));
2019 if ( bOldMirroredY )
2021 nY = ( rInteraction.aPosition.Y - aOld.
Bottom() );
2022 if ( rNewRect.
Top() > rNewRect.
Bottom() )
2029 nY = ( rInteraction.aPosition.Y - aOld.
Top() );
2030 if ( rNewRect.
Top() > rNewRect.
Bottom() )
2035 rInteraction.xInteraction->setControllerPosition(awt::Point(rInteraction.xInteraction->getPosition().X, nY));
2038 catch (
const uno::RuntimeException& )
2045 const sal_uInt16 nCustomShapeHdlNum,
bool bMoveCalloutRectangle )
2048 if ( nCustomShapeHdlNum >= aInteractionHandles.size() )
2057 awt::Point aPt( rDestination.
X(), rDestination.
Y() );
2060 sal_Int32 nXDiff = aPt.X - aInteractionHandle.
aPosition.X;
2061 sal_Int32 nYDiff = aPt.Y - aInteractionHandle.
aPosition.Y;
2069 for (
const auto& rInteraction : aInteractionHandles)
2073 if ( rInteraction.xInteraction.is() )
2074 rInteraction.xInteraction->setControllerPosition( rInteraction.aPosition );
2078 aInteractionHandle.
xInteraction->setControllerPosition( aPt );
2080 catch (
const uno::RuntimeException& )
2133 constexpr sal_uInt32 nDefaultObjectSizeWidth = 3000;
2134 constexpr sal_uInt32 nDefaultObjectSizeHeight= 3000;
2142 if ( !aInteractionHandles.empty() )
2144 sal_Int32 nHandlePos = aInteractionHandles[ aInteractionHandles.size() - 1 ].xInteraction->getPosition().X;
2153 for (
const auto& rInteraction : aInteractionHandles)
2158 rInteraction.xInteraction->setControllerPosition( awt::Point( rStat.
GetStart().
X(), rStat.
GetStart().
Y() ) );
2160 catch (
const uno::RuntimeException& )
2205 return bIsAutoGrowHeight;
2213 return bIsAutoGrowWidth;
2226 DBG_ASSERT( pOutlinerParaObject,
"SdrTextObj::SetVerticalWriting() without OutlinerParaObject!" );
2228 if( !pOutlinerParaObject ||
2268 if ( pOutlinerParaObject )
2285 if ( bHasText && !rR.
IsEmpty() )
2289 if ( bWdtGrow || bHgtGrow )
2295 Size aMaxSiz(100000,100000);
2303 if (nMaxWdt==0 || nMaxWdt>aMaxSiz.
Width()) nMaxWdt=aMaxSiz.
Width();
2304 if (nMinWdt<=0) nMinWdt=1;
2311 if (nMaxHgt==0 || nMaxHgt>aMaxSiz.
Height()) nMaxHgt=aMaxSiz.
Height();
2312 if (nMinHgt<=0) nMinHgt=1;
2319 if ( aSiz.
Width() < 2 )
2332 nWdt=aSiz2.
Width()+1;
2333 if (bHgtGrow) nHgt=aSiz2.
Height()+1;
2346 if( pOutlinerParaObject !=
nullptr )
2348 rOutliner.
SetText(*pOutlinerParaObject);
2354 nWdt=aSiz2.
Width()+1;
2363 if (bHgtGrow && nColumns > 1)
2379 if ( nWdt < nMinWdt )
2381 if ( nWdt > nMaxWdt )
2386 if ( nHgt < nMinHgt )
2388 if ( nHgt > nMaxHgt )
2395 if ( nWdtGrow == 0 )
2397 if ( nHgtGrow == 0 )
2444 rR.
Move(aD2.
X(),aD2.
Y());
2465 if (aAdjustedTextRect != aNewTextRect && aOldTextRect != aAdjustedTextRect &&
2469 double fXScale =
static_cast<double>(aOldTextRect.
GetWidth()) /
static_cast<double>(aNewTextRect.
GetWidth());
2470 double fYScale =
static_cast<double>(aOldTextRect.
GetHeight()) /
static_cast<double>(aNewTextRect.
GetHeight());
2471 double fRightDiff =
static_cast<double>( aAdjustedTextRect.
Right() - aNewTextRect.
Right() ) * fXScale;
2472 double fLeftDiff =
static_cast<double>( aAdjustedTextRect.
Left() - aNewTextRect.
Left() ) * fXScale;
2473 double fTopDiff =
static_cast<double>( aAdjustedTextRect.
Top() - aNewTextRect.
Top() ) * fYScale;
2474 double fBottomDiff=
static_cast<double>( aAdjustedTextRect.
Bottom()- aNewTextRect.
Bottom()) * fYScale;
2475 aReturnValue.
AdjustLeft(
static_cast<sal_Int32
>(fLeftDiff) );
2476 aReturnValue.
AdjustRight(
static_cast<sal_Int32
>(fRightDiff) );
2477 aReturnValue.
AdjustTop(
static_cast<sal_Int32
>(fTopDiff) );
2478 aReturnValue.
AdjustBottom(
static_cast<sal_Int32
>(fBottomDiff) );
2481 return aReturnValue;
2499 for (
const auto& rInteraction : aInteractionHandles)
2504 rInteraction.xInteraction->setControllerPosition( rInteraction.aPosition );
2506 catch (
const uno::RuntimeException& )
2533 for (
const auto& rInteraction : aInteractionHandles)
2538 rInteraction.xInteraction->setControllerPosition( rInteraction.aPosition );
2540 catch (
const uno::RuntimeException& )
2560 Point aCenter0(aCenter);
2563 aViewInit.
Move(aCenter.
X(),aCenter.
Y());
2567 Size aMaxSiz(1000000,1000000);
2580 if (nMinWdt<1) nMinWdt=1;
2581 if (nMinHgt<1) nMinHgt=1;
2582 if ( nMaxWdt == 0 || nMaxWdt > aMaxSiz.
Width() )
2583 nMaxWdt = aMaxSiz.
Width();
2584 if ( nMaxHgt == 0 || nMaxHgt > aMaxSiz.
Height() )
2585 nMaxHgt=aMaxSiz.
Height();
2591 nMaxHgt = aAnkSiz.
Height();
2596 nMaxWdt = aAnkSiz.
Width();
2600 Size aPaperMax(nMaxWdt, nMaxHgt);
2601 Size aPaperMin(nMinWdt, nMinHgt);
2605 *pViewMin = aViewInit;
2634 if (pPaperMin!=
nullptr) *pPaperMin=aPaperMin;
2635 if (pPaperMax!=
nullptr) *pPaperMax=aPaperMax;
2636 if (pViewInit!=
nullptr) *pViewInit=aViewInit;
2658 rAnchorRect.
SetPos( aP );
2676 sal_Int32 nMaxAutoPaperWidth = 1000000;
2677 sal_Int32 nMaxAutoPaperHeight= 1000000;
2685 nMaxAutoPaperHeight = nAnkHgt;
2687 nMaxAutoPaperWidth = nAnkWdt;
2713 if( !pTestObj || !bHitTest || pTestObj !=
this ||
2776 aTextPos.
AdjustX(nFreeWdt/2 );
2784 aTextPos.
AdjustY(nFreeHgt/2 );
2792 *pAnchorRect=aAnkRect;
2816 sName +=
" '" + aNm +
"'";
2822 return SvxResId(STR_ObjNamePluralCUSTOMSHAPE);
2842 SdrObject* pRenderedCustomShape =
nullptr;
2855 if ( pRenderedCustomShape )
2859 DBG_ASSERT(pCandidate,
"SdrObjCustomShape::DoConvertToPolyObj: Could not clone SdrObject (!)");
2860 pRetval = pCandidate->DoConvertToPolyObj(bBezier, bAddText);
2893 if(
nullptr != pNewPage)
2905 return std::make_unique<SdrAShapeObjGeoData>();
2930 beans::PropertyValue aPropVal;
2931 aPropVal.Name =
"AdjustmentValues";
2941 SAL_INFO_IF(bShrinkOnly,
"svx",
"Case bShrinkOnly == true is not implemented yet.");
2956 double fRotate, fShearX;
2957 aMatrix.
decompose(aScale, aTranslate, fRotate, fShearX);
2970 double fPolygonWidth = aB2DRange.
getWidth();
2971 if (fPolygonWidth == 0)
2973 double fPolygonHeight = aB2DRange.
getHeight();
2974 if (fPolygonHeight == 0)
2976 const double aFactorX =
static_cast<double>(rMaxRect.
GetWidth()) / fPolygonWidth;
2977 const double aFactorY =
static_cast<double>(rMaxRect.
GetHeight()) / fPolygonHeight;
2980 aMathMatrix.
scale(aFactorX, aFactorY);
2984 const double fPolygonLeft = aB2DRange.
getMinX();
2985 const double fPolygonTop = aB2DRange.
getMinY();
2986 aMathMatrix.
translate(rMaxRect.
Left() - fPolygonLeft, rMaxRect.
Top() - fPolygonTop);
2989 aMathMatrix.
decompose(aScale, aTranslate, fRotate, fShearX);
3008 if (bIsMirroredX || bIsMirroredY)
3013 Mirror(aCurrentCenter,
Point(aCurrentCenter.
X(), aCurrentCenter.
Y() + 1000));
3017 Mirror(aCurrentCenter,
Point(aCurrentCenter.
X() + 1000, aCurrentCenter.
Y()));
3024 double fRotate, fShearX;
3025 rMatrix.
decompose(aScale, aTranslate, fRotate, fShearX);
3089 if (!(bIsMirroredX || bIsMirroredY))
3095 if (aScale.
getX() > 2.0 && aScale.
getY() > 2.0)
3102 aCenter = aMathMat * aCenter;
3103 double fCenterX = aCenter.
getX();
3104 double fCenterY = aCenter.
getY();
3125 if ( bMirroredX || bMirroredY )
3136 Point aRef1( ( aBoundRect.
Left() + aBoundRect.
Right() ) >> 1, aBoundRect.
Top() );
3137 Point aRef2( aRef1.
X(), aRef1.
Y() + 1000 );
3139 sal_uInt16 nPointCount=aPol.
GetSize();
3140 for (
i=0;
i<nPointCount;
i++)
3160 Point aRef2( aRef1.
X() + 1000, aRef1.
Y() );
3162 sal_uInt16 nPointCount=aPol.
GetSize();
3163 for (
i=0;
i<nPointCount;
i++)
3203 return std::make_unique<sdr::contact::ViewContactOfSdrObjCustomShape>(*
this);
3209 bool bRetval(
false);
3253 OUString sShapeName;
3255 if ( aEngine.isEmpty()
3256 || aEngine ==
"com.sun.star.drawing.EnhancedCustomShapeEngine" )
3258 OUString sShapeType;
3261 if ( pAny && ( *pAny >>= sShapeType ) )
bool IsCustomShapeFilledByDefault(MSO_SPT eSpType)
const mso_CustomShape * GetCustomShapeContent(MSO_SPT eSpType)
const Size & GetSizePixel() const
static bool Filter(BitmapEx &rBmpEx, BitmapFilter const &rFilter)
sal_uInt8 GetLuminance() const
basegfx::BColor getBColor() const
static void SetEnhancedCustomShapeParameter(css::drawing::EnhancedCustomShapeParameter &rParameter, const sal_Int32 nValue)
static OUString GetEquation(const sal_uInt16 nFlags, sal_Int32 nPara1, sal_Int32 nPara2, sal_Int32 nPara3)
static void SetEnhancedCustomShapeHandleParameter(css::drawing::EnhancedCustomShapeParameter &rParameter, const sal_Int32 nPara, const bool bIsSpecialValue, bool bHorz)
sal_Int32 GetNumerator() const
sal_Int32 GetDenominator() const
The transformation of a rectangle into a polygon, by using angle parameters from GeoStat.
double mfCosRotationAngle
double mfSinRotationAngle
Degree100 m_nRotationAngle
void SetGraphic(const Graphic &rGraphic)
const Graphic & GetGraphic() const
BitmapEx GetBitmapEx(const GraphicConversionParameters &rParameters=GraphicConversionParameters()) const
void SetVertical(bool bNew)
bool IsEffectivelyVertical() const
void SetMaxAutoPaperSize(const Size &rSz)
void SetText(const OutlinerParaObject &)
const Size & GetPaperSize() const
void SetMinAutoPaperSize(const Size &rSz)
std::optional< OutlinerParaObject > CreateParaObject(sal_Int32 nStartPara=0, sal_Int32 nParaCount=EE_PARA_ALL) const
void SetPaperSize(const Size &rSize)
bool SetUpdateLayout(bool bUpdate)
void SetFixedCellHeight(bool bUseFixedCellHeight)
EEControlBits GetControlWord() const
void SetControlWord(EEControlBits nWord)
sal_uInt32 GetTextHeight() const
constexpr tools::Long Y() const
void setX(tools::Long nX)
void setY(tools::Long nY)
tools::Long AdjustY(tools::Long nVertMove)
tools::Long AdjustX(tools::Long nHorzMove)
constexpr tools::Long X() const
css::uno::Sequence< css::drawing::EnhancedCustomShapeAdjustmentValue > aAdjustmentSeq
virtual const tools::Rectangle & GetSnapRect() const override
sal_Int32 ImpGetLineWdt() const
Detects the width of the line. No line ->0.
tools::Rectangle maSnapRect
void SetPropertyValue(const css::beans::PropertyValue &rPropVal)
css::uno::Any * GetPropertyValueByName(const OUString &rPropName)
bool IsShiftPressed() const
void SetActionRect(const tools::Rectangle &rR)
sal_Int32 GetPointCount() const
void TakeCreateRect(tools::Rectangle &rRect) const
tools::Long GetDY() const
const Point & GetStart() const
SdrDragMethod * GetDragMethod() const
SdrView * GetView() const
void SetEndDragChangesGeoAndAttributes(bool bOn)
const SdrHdl * GetHdl() const
const Point & GetNow() const
void SetNoSnap(bool bOn=true)
void SetEndDragChangesAttributes(bool bOn)
tools::Long GetDX() const
bool IsSolidDragging() const
sal_uInt16 Insert(const SdrGluePoint &rGP)
sal_uInt16 GetCount() const
void SetPercent(bool bOn)
void SetPos(const Point &rNewPos)
void SetUserDefined(bool bNew)
bool IsUserDefined() const
const Point & GetPos() const
void AddHdl(std::unique_ptr< SdrHdl > pHdl)
SdrHdlKind GetKind() const
sal_uInt32 GetPointNum() const
virtual void NbcRotate(const Point &rRef, Degree100 nAngle, double sn, double cs) override
virtual void TakeTextEditArea(Size *pPaperMin, Size *pPaperMax, tools::Rectangle *pViewInit, tools::Rectangle *pViewMin) const override
void SuggestTextFrameSize(Size aSuggestedTextFrameSize)
Allows suggesting the text frame size: in case the application has its own text associated to the sha...
void DragMoveCustomShapeHdl(const Point &rDestination, const sal_uInt16 nCustomShapeHdlNum, bool bMoveCalloutRectangle)
virtual SdrGluePointList * ForceGluePointList() override
basegfx::B2DPolyPolygon GetLineGeometry(const bool bBezierAllowed) const
static bool doConstructOrthogonal(std::u16string_view rName)
virtual void EndTextEdit(SdrOutliner &rOutl) override
virtual OUString TakeObjNameSingul() const override
virtual void NbcMove(const Size &rSiz) override
The methods Move, Resize, Rotate, Mirror, Shear, SetSnapRect and SetLogicRect call the corresponding ...
virtual OUString TakeObjNamePlural() const override
const SdrObject * GetSdrObjectShadowFromCustomShape() const
virtual void InternalSetStyleSheet(SfxStyleSheet *pNewStyleSheet, bool bDontRemoveHardAttr, bool bBroadcast) override
virtual bool IsTextPath() const override
virtual bool AdjustTextFrameWidthAndHeight() override
SVX_DLLPRIVATE void DragCreateObject(SdrDragStat &rDrag)
virtual void RestoreGeoData(const SdrObjGeoData &rGeo) override
virtual basegfx::B2DPolyPolygon TakeCreatePoly(const SdrDragStat &rDrag) const override
Polygon dragged by the user when creating the object.
virtual ~SdrObjCustomShape() override
virtual void TakeTextRect(SdrOutliner &rOutliner, tools::Rectangle &rTextRect, bool bNoEditText, tools::Rectangle *pAnchorRect, bool bLineWidth=true) const override
virtual std::unique_ptr< sdr::contact::ViewContact > CreateObjectSpecificViewContact() override
virtual void NbcResize(const Point &rRef, const Fraction &xFact, const Fraction &yFact) override
virtual void SetSnapRect(const tools::Rectangle &rRect) override
virtual SdrObjKind GetObjIdentifier() const override
virtual rtl::Reference< SdrObject > DoConvertToPolyObj(bool bBezier, bool bAddText) const override
bool mbAdjustingTextFrameWidthAndHeight
virtual std::unique_ptr< sdr::properties::BaseProperties > CreateObjectSpecificProperties() override
virtual rtl::Reference< SdrObject > CloneSdrObject(SdrModel &rTargetModel) const override
virtual bool IsAutoGrowWidth() const override
virtual void AdjustToMaxRect(const tools::Rectangle &rMaxRect, bool bShrinkOnly=false) override
OUString GetCustomShapeName() const
virtual const SdrGluePointList * GetGluePointList() const override
virtual bool NbcAdjustTextFrameWidthAndHeight(bool bHgt=true, bool bWdt=true) override
virtual sal_uInt32 GetHdlCount() const override
Via GetHdlCount the number of Handles can be retrieved.
virtual bool EndCreate(SdrDragStat &rStat, SdrCreateCmd eCmd) override
virtual bool MovCreate(SdrDragStat &rStat) override
rtl::Reference< SdrObject > mpLastShadowGeometry
virtual void NbcSetLogicRect(const tools::Rectangle &rRect) override
void ImpCheckCustomGluePointsAreAdded()
virtual void SaveGeoData(SdrObjGeoData &rGeo) const override
virtual void NbcSetOutlinerParaObject(std::optional< OutlinerParaObject > pTextObject) override
const SdrObject * GetSdrObjectFromCustomShape() const
void InvalidateRenderGeometry()
void SetMirroredX(const bool bMirroredX)
virtual void AdaptTextMinSize() override
virtual void TakeObjInfo(SdrObjTransformInfoRec &rInfo) const override
virtual bool hasSpecialDrag() const override
The standard transformations (Move,Resize,Rotate,Mirror,Shear) are taken over by the View (TakeXorPol...
SVX_DLLPRIVATE void DragResizeCustomShape(const tools::Rectangle &rNewRect)
virtual bool TRGetBaseGeometry(basegfx::B2DHomMatrix &rMatrix, basegfx::B2DPolyPolygon &rPolyPolygon) const override
virtual void Move(const Size &rSiz) override
virtual std::unique_ptr< SdrObjGeoData > NewGeoData() const override
A derived class must override these 3 methods if it has own geometric data that must be saved for Und...
bool UseNoFillStyle() const
virtual void NbcSetSnapRect(const tools::Rectangle &rRect) override
css::uno::Reference< css::drawing::XShape > mXRenderedCustomShape
virtual void SetVerticalWriting(bool bVertical) override
Size m_aSuggestedTextFrameSize
virtual SdrGluePoint GetVertexGluePoint(sal_uInt16 nNum) const override
virtual void handlePageChange(SdrPage *pOldPage, SdrPage *pNewPage) override
virtual void SetLogicRect(const tools::Rectangle &rRect) override
virtual bool IsAutoGrowHeight() const override
bool IsDefaultGeometry(const DefaultType eDefaultType) const
tools::Rectangle ImpCalculateTextFrame(const bool bHgt, const bool bWdt)
virtual void NbcShear(const Point &rRef, Degree100 nAngle, double tn, bool bVShear) override
bool GetTextBounds(tools::Rectangle &rTextBound) const
virtual basegfx::B2DPolyPolygon TakeXorPoly() const override
The Xor-Polygon is required by the View to drag the object.
virtual void TakeTextAnchorRect(tools::Rectangle &rAnchorRect) const override
double GetExtraTextRotation(const bool bPreRotation=false) const
void SetMirroredY(const bool bMirroredY)
virtual void NbcMirror(const Point &rRef1, const Point &rRef2) override
css::uno::Reference< css::drawing::XCustomShapeEngine > mxCustomShapeEngine
void MergeDefaultAttributes(const OUString *pType=nullptr)
virtual basegfx::B2DPolyPolygon TakeContour() const override
contour for TextToContour
virtual void TRSetBaseGeometry(const basegfx::B2DHomMatrix &rMatrix, const basegfx::B2DPolyPolygon &rPolyPolygon) override
virtual void setUnoShape(const css::uno::Reference< css::drawing::XShape > &rxUnoShape) override
Sets a new UNO representation of the shape.
virtual void AddToHdlList(SdrHdlList &rHdlList) const override
virtual void Shear(const Point &rRef, Degree100 nAngle, double tn, bool bVShear) override
css::uno::Reference< css::drawing::XCustomShapeEngine > const & GetCustomShapeEngine() const
virtual bool beginSpecialDrag(SdrDragStat &rDrag) const override
std::vector< SdrCustomShapeInteraction > GetInteractionHandles() const
virtual bool applySpecialDrag(SdrDragStat &rDrag) override
All geometrical data of an arbitrary object for use in undo/redo.
static SdrObject * getSdrObjectFromXShape(const css::uno::Reference< css::uno::XInterface > &xInt)
const SfxPoolItem & GetMergedItem(const sal_uInt16 nWhich) const
const Point & GetAnchorPos() const
void ActionChanged() const
virtual SdrGluePointList * ForceGluePointList()
void moveOutRectangle(sal_Int32 nXDelta, sal_Int32 nYDelta)
virtual void Shear(const Point &rRef, Degree100 nAngle, double tn, bool bVShear)
virtual void InternalSetStyleSheet(SfxStyleSheet *pNewStyleSheet, bool bDontRemoveHardAttr, bool bBroadcast)
std::unique_ptr< SdrObjPlusData > m_pPlusData
virtual void setUnoShape(const css::uno::Reference< css::drawing::XShape > &_rxUnoShape)
Sets a new UNO representation of the shape.
void BroadcastObjectChange() const
void SetObjectItemSet(const SfxItemSet &rSet)
bool LineIsOutsideGeometry() const
const SfxPoolItem & GetObjectItem(const sal_uInt16 nWhich) const
virtual void Mirror(const Point &rRef1, const Point &rRef2)
virtual const tools::Rectangle & GetCurrentBoundRect() const
SdrModel & getSdrModelFromSdrObject() const
SdrObjUserCall * m_pUserCall
virtual const OUString & GetName() const
virtual void Rotate(const Point &rRef, Degree100 nAngle, double sn, double cs)
void SendUserCall(SdrUserCallType eUserCall, const tools::Rectangle &rBoundRect) const
virtual void SetChanged()
virtual const tools::Rectangle & GetLastBoundRect() const
virtual rtl::Reference< SdrObject > CloneSdrObject(SdrModel &rTargetModel) const =0
virtual const SdrGluePointList * GetGluePointList() const
virtual basegfx::B2DPolyPolygon TakeContour() const
contour for TextToContour
const SfxItemSet & GetMergedItemSet() const
void SetMergedItem(const SfxPoolItem &rItem)
virtual void SetBoundRectDirty()
virtual void NbcMove(const Size &rSiz)
The methods Move, Resize, Rotate, Mirror, Shear, SetSnapRect and SetLogicRect call the corresponding ...
virtual void SetBoundAndSnapRectsDirty(bool bNotMyself=false, bool bRecursive=true)
const SfxItemSet & GetObjectItemSet() const
virtual void TakeObjInfo(SdrObjTransformInfoRec &rInfo) const
void SetTextObj(const SdrTextObj *pObj)
const SdrTextObj * GetTextObj() const
A SdrPage contains exactly one SdrObjList and a description of the physical page dimensions (size / m...
SdrTextHorzAdjust GetTextHorizontalAdjust() const
tools::Long GetMaxTextFrameHeight() const
virtual void SaveGeoData(SdrObjGeoData &rGeo) const override
tools::Rectangle const & getRectangle() const
virtual void NbcMirror(const Point &rRef1, const Point &rRef2) override
friend class SdrObjCustomShape
virtual void RestoreGeoData(const SdrObjGeoData &rGeo) override
virtual void NbcShear(const Point &rRef, Degree100 nAngle, double tn, bool bVShear) override
virtual void NbcMove(const Size &rSiz) override
The methods Move, Resize, Rotate, Mirror, Shear, SetSnapRect and SetLogicRect call the corresponding ...
tools::Long GetTextLowerDistance() const
Bottom inner spacing to borders.
SdrOutliner & ImpGetDrawOutliner() const
virtual sal_uInt32 GetHdlCount() const override
Via GetHdlCount the number of Handles can be retrieved.
tools::Long GetMinTextFrameHeight() const
void moveRectangle(sal_Int32 nXDelta, sal_Int32 nYDelta)
virtual SdrText * getActiveText() const
returns the currently active text.
SdrOutliner * mpEditingOutliner
tools::Long GetMaxTextFrameWidth() const
virtual void TakeTextAnchorRect(::tools::Rectangle &rAnchorRect) const
virtual OutlinerParaObject * GetOutlinerParaObject() const override
tools::Long GetTextLeftDistance() const
Left inner spacing to borders
tools::Long GetTextRightDistance() const
Right inner spacing to borders
virtual const tools::Rectangle & GetLogicRect() const override
static void ImpJustifyRect(tools::Rectangle &rRect)
tools::Rectangle ImpDragCalcRect(const SdrDragStat &rDrag) const
virtual bool HasText() const override
virtual void handlePageChange(SdrPage *pOldPage, SdrPage *pNewPage) override
virtual void NbcSetOutlinerParaObject(std::optional< OutlinerParaObject > pTextObject) override
tools::Long GetMinTextFrameWidth() const
virtual void AddToHdlList(SdrHdlList &rHdlList) const override
SdrTextVertAdjust GetTextVerticalAdjust() const
void AdjustRectToTextDistance(tools::Rectangle &rAnchorRect) const
const GeoStat & GetGeoStat() const
void ForceOutlinerParaObject()
rtl::Reference< SdrObject > ImpConvertAddText(rtl::Reference< SdrObject > pObj, bool bBezier) const
virtual void NbcResize(const Point &rRef, const Fraction &xFact, const Fraction &yFact) override
virtual void EndTextEdit(SdrOutliner &rOutl)
void setRectangle(tools::Rectangle const &rRectangle)
tools::Long GetTextUpperDistance() const
Top inner spacing to borders.
virtual bool IsVerticalWriting() const
virtual void NbcRotate(const Point &rRef, Degree100 nAngle, double sn, double cs) override
void CheckPortionInfo(const SdrOutliner &rOutliner)
SfxItemPool * GetPool() const
const SfxPoolItem * Put(const SfxPoolItem &rItem, sal_uInt16 nWhich)
const SfxPoolItem & Get(sal_uInt16 nWhich, bool bSrchInParent=true) const
constexpr tools::Long Height() const
tools::Long AdjustHeight(tools::Long n)
void setWidth(tools::Long nWidth)
tools::Long AdjustWidth(tools::Long n)
void setHeight(tools::Long nHeight)
constexpr tools::Long Width() const
void SetColor(const Color &rColor)
bool decompose(B2DTuple &rScale, B2DTuple &rTranslate, double &rRotate, double &rShearX) const
void translate(double fX, double fY)
void scale(double fX, double fY)
bool areControlPointsUsed() const
void transform(const basegfx::B2DHomMatrix &rMatrix)
B2DRange const & getB2DRange() const
sal_uInt16 GetStartIntens() const
void SetColorStops(const basegfx::BColorStops &rSteps)
const basegfx::BColorStops & GetColorStops() const
sal_uInt16 GetEndIntens() const
bool createItemIfMissing(const OUString &sKey, const TValueType &aValue)
#define DBG_ASSERT(sCon, aError)
OUString SvxResId(TranslateId aId)
constexpr TypedWhichId< SvxAdjustItem > EE_PARA_JUST(EE_PARA_START+16)
tools::Long FRound(double fVal)
#define SAL_INFO_IF(condition, area, stream)
std::unique_ptr< sal_Int32[]> pData
@ mso_sptAccentBorderCallout2
@ mso_sptAccentBorderCallout1
@ mso_sptWedgeRectCallout
@ mso_sptAccentBorderCallout90
@ mso_sptWedgeEllipseCallout
@ mso_sptAccentBorderCallout3
@ mso_sptWedgeRRectCallout
SVXCORE_DLLPUBLIC MSO_SPT Get(const OUString &)
SVXCORE_DLLPUBLIC const OUString & GetAccName(const OUString &)
void GetOOXHandleAdjRelation(std::u16string_view sFullOOXShapeName, const sal_Int32 nHandleIndex, OUString &rFirstRefType, sal_Int32 &rFirstAdjValueIndex, OUString &rSecondRefType, sal_Int32 &rSecondAdjValueIndex)
B2DPolygon adaptiveSubdivideByAngle(const B2DPolygon &rCandidate, double fAngleBound)
B2DHomMatrix createScaleShearXRotateTranslateB2DHomMatrix(double fScaleX, double fScaleY, double fShearX, double fRadiant, double fTranslateX, double fTranslateY)
B2DPolygon const & createUnitPolygon()
B2DPolyPolygon UnoPolyPolygonBezierCoordsToB2DPolyPolygon(const css::drawing::PolyPolygonBezierCoords &rPolyPolygonBezierCoordsSource)
constexpr double deg2rad(double v)
css::beans::PropertyValue makePropertyValue(const OUString &rName, T &&rValue)
bool equalsIgnoreAsciiCase(std::u16string_view s1, std::u16string_view s2)
tools::Rectangle polygonToRectangle(const tools::Polygon &rPolygon, GeoStat &rGeo)
SdrOnOffItem makeSdrShadowItem(bool bShadow)
SdrMetricItem makeSdrShadowXDistItem(tools::Long nDist)
SdrMetricItem makeSdrShadowYDistItem(tools::Long nDist)
@ SDRTEXTVERTADJUST_BOTTOM
@ SDRTEXTVERTADJUST_BLOCK
@ SDRTEXTVERTADJUST_CENTER
@ SDRTEXTHORZADJUST_BLOCK
@ SDRTEXTHORZADJUST_CENTER
@ SDRTEXTHORZADJUST_RIGHT
SdrMetricItem makeSdrTextMinFrameHeightItem(tools::Long mnHeight)
SdrMetricItem makeSdrTextMinFrameWidthItem(tools::Long mnWidth)
css::awt::Point aPosition
css::uno::Reference< css::drawing::XCustomShapeHandle > xInteraction
CustomShapeHandleModes nMode
SvxMSDffVertPair * pVertices
SvxMSDffTextRectangles * pTextRect
SvxMSDffCalculationData * pCalculation
SvxMSDffHandle * pHandles
SvxMSDffVertPair * pGluePoints
constexpr TypedWhichId< SdrOnOffItem > SDRATTR_SHADOW(SDRATTR_SHADOW_FIRST+0)
constexpr TypedWhichId< SdrOnOffItem > SDRATTR_TEXT_AUTOGROWWIDTH(SDRATTR_MISC_FIRST+12)
constexpr TypedWhichId< SfxStringItem > SDRATTR_CUSTOMSHAPE_ENGINE(SDRATTR_CUSTOMSHAPE_FIRST+0)
constexpr TypedWhichId< SdrPercentItem > SDRATTR_SHADOWTRANSPARENCE(SDRATTR_SHADOW_FIRST+4)
constexpr TypedWhichId< SdrMetricItem > SDRATTR_SHADOWYDIST(SDRATTR_SHADOW_FIRST+3)
constexpr TypedWhichId< SdrTextFixedCellHeightItem > SDRATTR_TEXT_USEFIXEDCELLHEIGHT(SDRATTR_MISC_FIRST+23)
constexpr TypedWhichId< SdrTextHorzAdjustItem > SDRATTR_TEXT_HORZADJUST(SDRATTR_MISC_FIRST+13)
constexpr TypedWhichId< SdrMetricItem > SDRATTR_TEXT_MINFRAMEWIDTH(SDRATTR_MISC_FIRST+10)
constexpr TypedWhichId< SdrOnOffItem > SDRATTR_TEXT_AUTOGROWHEIGHT(SDRATTR_MISC_FIRST+2)
constexpr TypedWhichId< SdrOnOffItem > SDRATTR_TEXT_WORDWRAP(SDRATTR_MISC_FIRST+24)
constexpr TypedWhichId< SdrMetricItem > SDRATTR_TEXT_MINFRAMEHEIGHT(SDRATTR_MISC_FIRST+1)
constexpr TypedWhichId< SdrTextVertAdjustItem > SDRATTR_TEXT_VERTADJUST(SDRATTR_MISC_FIRST+8)
constexpr TypedWhichId< SfxInt16Item > SDRATTR_TEXTCOLUMNS_NUMBER(SDRATTR_TEXTCOLUMNS_FIRST+0)
constexpr TypedWhichId< XColorItem > SDRATTR_SHADOWCOLOR(SDRATTR_SHADOW_FIRST+1)
constexpr TypedWhichId< SdrCustomShapeGeometryItem > SDRATTR_CUSTOMSHAPE_GEOMETRY(SDRATTR_CUSTOMSHAPE_FIRST+2)
constexpr TypedWhichId< SvxWritingModeItem > SDRATTR_TEXTDIRECTION(SDRATTR_NOTPERSIST_FIRST+34)
constexpr TypedWhichId< SvxFrameDirectionItem > SDRATTR_WRITINGMODE2(SDRATTR_WRITINGMODE2_FIRST+0)
constexpr TypedWhichId< SdrMetricItem > SDRATTR_SHADOWXDIST(SDRATTR_SHADOW_FIRST+2)
#define DEFAULT_MAXIMUM_SIGNED_COMPARE
#define DEFAULT_MINIMUM_SIGNED_COMPARE
static sal_Int32 GetNumberOfProperties(const SvxMSDffHandle *pData)
static MSO_SPT ImpGetCustomShapeType(const SdrObjCustomShape &rCustoShape)
static void lcl_ShapePropertiesFromDFF(const SvxMSDffHandle *pData, beans::PropertyValues &rPropValues)
static rtl::Reference< SdrObject > ImpCreateShadowObjectClone(const SdrObject &rOriginal, const SfxItemSet &rOriginalSet)
static void lcl_ShapeSegmentFromBinary(drawing::EnhancedCustomShapeSegment &rSegInfo, sal_uInt16 nSDat)
static bool ImpVerticalSwitch(const SdrObjCustomShape &rCustoShape)
@ CustomShape
Universal Network Object packed into SvDraw object.
tools::Polygon Rect2Poly(const tools::Rectangle &rRect, const GeoStat &rGeo)
void MirrorPoint(Point &rPnt, const Point &rRef1, const Point &rRef2)
Degree100 NormAngle36000(Degree100 a)
Normalize angle to -180.00..179.99.
void ShearPoint(Point &rPnt, const Point &rRef, double tn, bool bVShear=false)
void RotatePoint(Point &rPnt, const Point &rRef, double sn, double cs)
uno::Reference< drawing::XShape > GetXShapeForSdrObject(SdrObject *pObj) noexcept
returns a StarOffice API wrapper for the given SdrObject
constexpr TypedWhichId< XFillHatchItem > XATTR_FILLHATCH(XATTR_FILL_FIRST+3)
constexpr TypedWhichId< XFillBitmapItem > XATTR_FILLBITMAP(XATTR_FILL_FIRST+4)
constexpr TypedWhichId< XLineStyleItem > XATTR_LINESTYLE(XATTR_LINE_FIRST)
constexpr TypedWhichId< XFillStyleItem > XATTR_FILLSTYLE(XATTR_FILL_FIRST)
constexpr TypedWhichId< XFillGradientItem > XATTR_FILLGRADIENT(XATTR_FILL_FIRST+2)