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>
101 rSegInfo.Command = EnhancedCustomShapeSegmentCommand::LINETO;
102 rSegInfo.Count = nSDat & 0xff;
103 if ( !rSegInfo.Count )
107 rSegInfo.Command = EnhancedCustomShapeSegmentCommand::CURVETO;
108 rSegInfo.Count = nSDat & 0xff;
109 if ( !rSegInfo.Count )
113 rSegInfo.Command = EnhancedCustomShapeSegmentCommand::MOVETO;
114 rSegInfo.Count = nSDat & 0xff;
115 if ( !rSegInfo.Count )
119 rSegInfo.Command = EnhancedCustomShapeSegmentCommand::CLOSESUBPATH;
123 rSegInfo.Command = EnhancedCustomShapeSegmentCommand::ENDSUBPATH;
127 rSegInfo.Command = EnhancedCustomShapeSegmentCommand::ANGLEELLIPSETO;
128 rSegInfo.Count = ( nSDat & 0xff ) / 3;
131 rSegInfo.Command = EnhancedCustomShapeSegmentCommand::ANGLEELLIPSE;
132 rSegInfo.Count = ( nSDat & 0xff ) / 3;
135 rSegInfo.Command = EnhancedCustomShapeSegmentCommand::ARCTO;
136 rSegInfo.Count = ( nSDat & 0xff ) >> 2;
139 rSegInfo.Command = EnhancedCustomShapeSegmentCommand::ARC;
140 rSegInfo.Count = ( nSDat & 0xff ) >> 2;
143 rSegInfo.Command = EnhancedCustomShapeSegmentCommand::CLOCKWISEARCTO;
144 rSegInfo.Count = ( nSDat & 0xff ) >> 2;
147 rSegInfo.Command = EnhancedCustomShapeSegmentCommand::CLOCKWISEARC;
148 rSegInfo.Count = ( nSDat & 0xff ) >> 2;
151 rSegInfo.Command = EnhancedCustomShapeSegmentCommand::ELLIPTICALQUADRANTX;
152 rSegInfo.Count = nSDat & 0xff;
155 rSegInfo.Command = EnhancedCustomShapeSegmentCommand::ELLIPTICALQUADRANTY;
156 rSegInfo.Count = nSDat & 0xff;
159 rSegInfo.Command = EnhancedCustomShapeSegmentCommand::NOFILL;
163 rSegInfo.Command = EnhancedCustomShapeSegmentCommand::NOSTROKE;
168 rSegInfo.Command = EnhancedCustomShapeSegmentCommand::UNKNOWN;
169 rSegInfo.Count = nSDat;
179 if ( aEngine.isEmpty() || aEngine ==
"com.sun.star.drawing.EnhancedCustomShapeEngine" )
183 const Any* pAny = rGeometryItem.GetPropertyValueByName(
"Type" );
184 if ( pAny && ( *pAny >>= sShapeType ) )
223 DBG_ASSERT(pRetval,
"ImpCreateShadowObjectClone: Could not clone object (!)");
227 bool bLineUsed(
false);
228 bool bAllFillUsed(
false);
229 bool bSolidFillUsed(
false);
230 bool bGradientFillUsed(
false);
231 bool bHatchFillUsed(
false);
232 bool bBitmapFillUsed(
false);
243 if(drawing::LineStyle_NONE != eLineStyle)
251 if(!bSolidFillUsed && drawing::FillStyle_SOLID == eFillStyle)
253 bSolidFillUsed =
true;
254 bAllFillUsed = (bSolidFillUsed && bGradientFillUsed && bHatchFillUsed && bBitmapFillUsed);
256 if(!bGradientFillUsed && drawing::FillStyle_GRADIENT == eFillStyle)
258 bGradientFillUsed =
true;
259 bAllFillUsed = (bSolidFillUsed && bGradientFillUsed && bHatchFillUsed && bBitmapFillUsed);
261 if(!bHatchFillUsed && drawing::FillStyle_HATCH == eFillStyle)
263 bHatchFillUsed =
true;
264 bAllFillUsed = (bSolidFillUsed && bGradientFillUsed && bHatchFillUsed && bBitmapFillUsed);
266 if(!bBitmapFillUsed && drawing::FillStyle_BITMAP == eFillStyle)
268 bBitmapFillUsed =
true;
269 bAllFillUsed = (bSolidFillUsed && bGradientFillUsed && bHatchFillUsed && bBitmapFillUsed);
275 pRetval->NbcMove(
Size(nXDist, nYDist));
306 if(bGradientFillUsed)
309 sal_uInt8 nStartLuminance(aGradient.GetStartColor().GetLuminance());
310 sal_uInt8 nEndLuminance(aGradient.GetEndColor().GetLuminance());
312 if(aGradient.GetStartIntens() != 100)
314 nStartLuminance =
static_cast<sal_uInt8>(nStartLuminance * (
static_cast<double>(aGradient.GetStartIntens()) / 100.0));
317 if(aGradient.GetEndIntens() != 100)
319 nEndLuminance =
static_cast<sal_uInt8>(nEndLuminance * (
static_cast<double>(aGradient.GetEndIntens()) / 100.0));
323 static_cast<sal_uInt8>((nStartLuminance * aShadowColor.GetRed()) / 256),
324 static_cast<sal_uInt8>((nStartLuminance * aShadowColor.GetGreen()) / 256),
325 static_cast<sal_uInt8>((nStartLuminance * aShadowColor.GetBlue()) / 256));
328 static_cast<sal_uInt8>((nEndLuminance * aShadowColor.GetRed()) / 256),
329 static_cast<sal_uInt8>((nEndLuminance * aShadowColor.GetGreen()) / 256),
330 static_cast<sal_uInt8>((nEndLuminance * aShadowColor.GetBlue()) / 256));
332 aGradient.SetStartColor(aStartColor);
333 aGradient.SetEndColor(aEndColor);
351 BitmapEx aBitmapEx(aGraphicObject.GetGraphic().GetBitmapEx());
353 if(!aBitmapEx.IsEmpty())
356 pVirDev->SetOutputSizePixel(aBitmapEx.GetSizePixel());
358 pVirDev->DrawBitmapEx(
Point(), aBitmapEx);
359 aGraphicObject.SetGraphic(
Graphic(pVirDev->GetBitmapEx(
Point(0,0), aBitmapEx.GetSizePixel())));
367 pRetval->SetMergedItemSet( aTempSet );
385 static constexpr OUStringLiteral sEnhancedCustomShapeEngine =
u"com.sun.star.drawing.EnhancedCustomShapeEngine";
386 if ( aEngine.isEmpty() )
387 aEngine = sEnhancedCustomShapeEngine;
390 static constexpr OUStringLiteral sCustomShape =
u"CustomShape";
393 Sequence< Any > aArgument{
Any(aPropValues) };
396 Reference<XInterface> xInterface(xContext->getServiceManager()->createInstanceWithArgumentsAndContext(aEngine, aArgument, xContext));
400 catch (
const css::loader::CannotActivateFactoryException&)
413 if ( xCustomShapeEngine.is() )
414 const_cast<SdrObjCustomShape*>(
this)->mXRenderedCustomShape = xCustomShapeEngine->render();
419 return pRenderedCustomShape;
448 static const OUStringLiteral sTextPath(
u"TextPath" );
449 bool bTextPathOn =
false;
453 *pAny >>= bTextPathOn;
461 static const OUStringLiteral
sType(
u"Type" );
465 *pAny >>= sShapeType;
473 bool bMirroredX =
false;
477 *pAny >>= bMirroredX;
482 bool bMirroredY =
false;
486 *pAny >>= bMirroredY;
492 PropertyValue aPropVal;
493 aPropVal.Name =
"MirroredX";
494 aPropVal.Value <<= bMirrorX;
501 PropertyValue aPropVal;
502 aPropVal.Name =
"MirroredY";
503 aPropVal.Value <<= bMirrorY;
510 const css::uno::Any* pAny;
512 pAny = rGeometryItem.
GetPropertyValueByName( bPreRotation ? OUString(
"TextPreRotateAngle" ) : OUString(
"TextRotateAngle" ) );
513 double fExtraTextRotateAngle = 0.0;
515 *pAny >>= fExtraTextRotateAngle;
516 return fExtraTextRotateAngle;
524 if ( xCustomShapeEngine.is() )
526 awt::Rectangle aR( xCustomShapeEngine->getTextBounds() );
527 if ( aR.Width > 1 && aR.Height > 1 )
539 if ( xCustomShapeEngine.is() )
541 css::drawing::PolyPolygonBezierCoords aBezierCoords = xCustomShapeEngine->getLineGeometry();
550 catch (
const css::lang::IllegalArgumentException & )
559 std::vector< SdrCustomShapeInteraction > aRet;
563 if ( xCustomShapeEngine.is() )
566 Sequence< Reference< XCustomShapeHandle > > xInteractionHandles( xCustomShapeEngine->getInteraction() );
567 for ( i = 0; i < xInteractionHandles.getLength(); i++ )
569 if ( xInteractionHandles[ i ].is() )
572 aSdrCustomShapeInteraction.
xInteraction = xInteractionHandles[ i ];
573 aSdrCustomShapeInteraction.
aPosition = xInteractionHandles[ i ]->getPosition();
638 aSdrCustomShapeInteraction.
nMode = nMode;
639 aRet.push_back( aSdrCustomShapeInteraction );
644 catch(
const uno::RuntimeException& )
652 #define DEFAULT_MINIMUM_SIGNED_COMPARE (sal_Int32(0x80000000))
653 #define DEFAULT_MAXIMUM_SIGNED_COMPARE (sal_Int32(0x7fffffff))
657 sal_Int32 nPropertiesNeeded=1;
689 return nPropertiesNeeded;
696 auto pPropValues = rPropValues.getArray();
700 css::drawing::EnhancedCustomShapeParameterPair aPosition;
703 pPropValues[ n ].Name =
"Position";
704 pPropValues[ n++ ].Value <<= aPosition;
708 pPropValues[ n ].Name =
"MirroredX";
709 pPropValues[ n++ ].Value <<=
true;
713 pPropValues[ n ].Name =
"MirroredY";
714 pPropValues[ n++ ].Value <<=
true;
718 pPropValues[ n ].Name =
"Switched";
719 pPropValues[ n++ ].Value <<=
true;
723 css::drawing::EnhancedCustomShapeParameterPair aCenter;
728 pPropValues[ n ].Name =
"Polar";
729 pPropValues[ n++ ].Value <<= aCenter;
734 css::drawing::EnhancedCustomShapeParameter aRadiusRangeMinimum;
737 pPropValues[ n ].Name =
"RadiusRangeMinimum";
738 pPropValues[ n++ ].Value <<= aRadiusRangeMinimum;
742 css::drawing::EnhancedCustomShapeParameter aRadiusRangeMaximum;
745 pPropValues[ n ].Name =
"RadiusRangeMaximum";
746 pPropValues[ n++ ].Value <<= aRadiusRangeMaximum;
754 css::drawing::EnhancedCustomShapeParameter aRangeXMinimum;
757 pPropValues[ n ].Name =
"RangeXMinimum";
758 pPropValues[ n++ ].Value <<= aRangeXMinimum;
762 css::drawing::EnhancedCustomShapeParameter aRangeXMaximum;
765 pPropValues[ n ].Name =
"RangeXMaximum";
766 pPropValues[ n++ ].Value <<= aRangeXMaximum;
770 css::drawing::EnhancedCustomShapeParameter aRangeYMinimum;
773 pPropValues[ n ].Name =
"RangeYMinimum";
774 pPropValues[ n++ ].Value <<= aRangeYMinimum;
778 css::drawing::EnhancedCustomShapeParameter aRangeYMaximum;
781 pPropValues[ n ].Name =
"RangeYMaximum";
782 pPropValues[ n++ ].Value <<= aRangeYMaximum;
789 return std::make_unique<sdr::properties::CustomShapeProperties>(*this);
794 , fObjectRotation(0.0)
795 , mbAdjustingTextFrameWidthAndHeight(
false)
796 , mpLastShadowGeometry(nullptr)
804 , fObjectRotation(0.0)
805 , mbAdjustingTextFrameWidthAndHeight(
false)
806 , mpLastShadowGeometry(nullptr)
825 PropertyValue aPropVal;
827 static const OUStringLiteral
sType(
u"Type" );
829 if ( pType && !pType->isEmpty() )
831 sal_Int32
nType = pType->toInt32();
837 aPropVal.Name = sType;
838 aPropVal.Value <<= sShapeType;
845 *pAny >>= sShapeType;
849 const sal_Int32* pDefData =
nullptr;
851 if ( pDefCustomShape )
852 pDefData = pDefCustomShape->
pDefData;
854 css::uno::Sequence< css::drawing::EnhancedCustomShapeAdjustmentValue > seqAdjustmentValues;
859 static const OUStringLiteral sAdjustmentValues(
u"AdjustmentValues" );
862 *pAny >>= seqAdjustmentValues;
863 if ( pDefCustomShape && pDefData )
866 sal_Int32
i, nAdjustmentValues = seqAdjustmentValues.getLength();
867 sal_Int32 nAdjustmentDefaults = *pDefData++;
868 if ( nAdjustmentDefaults > nAdjustmentValues )
869 seqAdjustmentValues.realloc( nAdjustmentDefaults );
870 auto pseqAdjustmentValues = seqAdjustmentValues.getArray();
871 for ( i = nAdjustmentValues; i < nAdjustmentDefaults; i++ )
873 pseqAdjustmentValues[ i ].Value <<= pDefData[ i ];
874 pseqAdjustmentValues[ i ].State = css::beans::PropertyState_DIRECT_VALUE;
877 sal_Int32
nCount = std::min(nAdjustmentValues, nAdjustmentDefaults);
878 for ( i = 0; i < nCount; i++ )
880 if ( seqAdjustmentValues[ i ].
State != css::beans::PropertyState_DIRECT_VALUE )
882 pseqAdjustmentValues[ i ].Value <<= pDefData[ i ];
883 pseqAdjustmentValues[ i ].State = css::beans::PropertyState_DIRECT_VALUE;
887 aPropVal.Name = sAdjustmentValues;
888 aPropVal.Value <<= seqAdjustmentValues;
894 static const OUStringLiteral sViewBox(
u"ViewBox" );
896 css::awt::Rectangle aViewBox;
897 if ( !pViewBox || !(*pViewBox >>= aViewBox ) )
899 if ( pDefCustomShape )
905 aPropVal.Name = sViewBox;
906 aPropVal.Value <<= aViewBox;
911 static const OUStringLiteral sPath(
u"Path" );
916 static const OUStringLiteral sCoordinates(
u"Coordinates" );
918 if ( !pAny && pDefCustomShape && pDefCustomShape->
nVertices && pDefCustomShape->
pVertices )
921 css::uno::Sequence< css::drawing::EnhancedCustomShapeParameterPair> seqCoordinates( nCount );
922 auto pseqCoordinates = seqCoordinates.getArray();
923 for ( i = 0; i < nCount; i++ )
928 aPropVal.Name = sCoordinates;
929 aPropVal.Value <<= seqCoordinates;
934 static const OUStringLiteral sGluePoints(
u"GluePoints" );
939 css::uno::Sequence< css::drawing::EnhancedCustomShapeParameterPair> seqGluePoints( nCount );
940 auto pseqGluePoints = seqGluePoints.getArray();
941 for ( i = 0; i < nCount; i++ )
946 aPropVal.Name = sGluePoints;
947 aPropVal.Value <<= seqGluePoints;
952 static const OUStringLiteral sSegments(
u"Segments" );
954 if ( !pAny && pDefCustomShape && pDefCustomShape->
nElements && pDefCustomShape->
pElements )
957 css::uno::Sequence< css::drawing::EnhancedCustomShapeSegment > seqSegments( nCount );
958 auto pseqSegments = seqSegments.getArray();
959 for ( i = 0; i < nCount; i++ )
961 EnhancedCustomShapeSegment& rSegInfo = pseqSegments[ i ];
962 sal_uInt16 nSDat = pDefCustomShape->
pElements[ i ];
965 aPropVal.Name = sSegments;
966 aPropVal.Value <<= seqSegments;
971 static const OUStringLiteral sStretchX(
u"StretchX" );
973 if ( !pAny && pDefCustomShape )
975 sal_Int32 nXRef = pDefCustomShape->
nXRef;
978 aPropVal.Name = sStretchX;
979 aPropVal.Value <<= nXRef;
985 static const OUStringLiteral sStretchY(
u"StretchY" );
987 if ( !pAny && pDefCustomShape )
989 sal_Int32 nYRef = pDefCustomShape->
nYRef;
992 aPropVal.Name = sStretchY;
993 aPropVal.Value <<= nYRef;
999 static const OUStringLiteral sTextFrames(
u"TextFrames" );
1001 if ( !pAny && pDefCustomShape && pDefCustomShape->
nTextRect && pDefCustomShape->
pTextRect )
1004 css::uno::Sequence< css::drawing::EnhancedCustomShapeTextFrame > seqTextFrames( nCount );
1005 auto pseqTextFrames = seqTextFrames.getArray();
1007 for ( i = 0; i < nCount; i++, pRectangles++ )
1014 aPropVal.Name = sTextFrames;
1015 aPropVal.Value <<= seqTextFrames;
1020 static const OUStringLiteral sEquations(
u"Equations" );
1025 css::uno::Sequence< OUString > seqEquations( nCount );
1026 auto pseqEquations = seqEquations.getArray();
1028 for ( i = 0; i < nCount; i++, pData++ )
1030 aPropVal.Name = sEquations;
1031 aPropVal.Value <<= seqEquations;
1036 static const OUStringLiteral sHandles(
u"Handles" );
1038 if ( !pAny && pDefCustomShape && pDefCustomShape->
nHandles && pDefCustomShape->
pHandles )
1042 css::uno::Sequence< css::beans::PropertyValues > seqHandles( nCount );
1043 auto pseqHandles = seqHandles.getArray();
1044 for ( i = 0; i < nCount; i++, pData++ )
1046 sal_Int32 nPropertiesNeeded;
1047 css::beans::PropertyValues& rPropValues = pseqHandles[ i ];
1049 rPropValues.realloc( nPropertiesNeeded );
1052 aPropVal.Name = sHandles;
1053 aPropVal.Value <<= seqHandles;
1056 else if (pAny && sShapeType.startsWith(
"ooxml-") && sShapeType !=
"ooxml-non-primitive")
1062 css::uno::Sequence<css::beans::PropertyValues> seqHandles;
1063 *pAny >>= seqHandles;
1064 auto seqHandlesRange = asNonConstRange(seqHandles);
1065 bool bChanged(
false);
1066 for (sal_Int32
i = 0;
i < seqHandles.getLength();
i++)
1069 OUString sFirstRefType;
1070 sal_Int32 nFirstAdjRef;
1071 OUString sSecondRefType;
1072 sal_Int32 nSecondAdjRef;
1074 sSecondRefType, nSecondAdjRef);
1075 if (sFirstRefType !=
"na" && 0 <= nFirstAdjRef
1076 && nFirstAdjRef < seqAdjustmentValues.getLength())
1080 if (sSecondRefType !=
"na" && 0 <= nSecondAdjRef
1081 && nSecondAdjRef < seqAdjustmentValues.getLength())
1085 aHandleProps >> seqHandlesRange[i];
1089 aPropVal.Name = sHandles;
1090 aPropVal.Value <<= seqHandles;
1100 bool bIsDefaultGeometry =
false;
1102 OUString sShapeType;
1107 *pAny >>= sShapeType;
1112 static const OUStringLiteral sPath(
u"Path" );
1113 switch( eDefaultType )
1118 css::awt::Rectangle aViewBox;
1119 if (pViewBox && (*pViewBox >>= aViewBox) && pDefCustomShape)
1121 if ( ( aViewBox.Width == pDefCustomShape->
nCoordWidth )
1122 && ( aViewBox.Height == pDefCustomShape->
nCoordHeight ) )
1123 bIsDefaultGeometry =
true;
1131 if ( pAny && pDefCustomShape && pDefCustomShape->
nVertices && pDefCustomShape->
pVertices )
1133 css::uno::Sequence< css::drawing::EnhancedCustomShapeParameterPair> seqCoordinates1;
1134 if ( *pAny >>= seqCoordinates1 )
1137 css::uno::Sequence< css::drawing::EnhancedCustomShapeParameterPair> seqCoordinates2( nCount );
1138 auto pseqCoordinates2 = seqCoordinates2.getArray();
1139 for ( i = 0; i < nCount; i++ )
1144 if ( seqCoordinates1 == seqCoordinates2 )
1145 bIsDefaultGeometry =
true;
1148 else if ( pDefCustomShape && ( ( pDefCustomShape->
nVertices == 0 ) || ( pDefCustomShape->
pVertices ==
nullptr ) ) )
1149 bIsDefaultGeometry =
true;
1158 css::uno::Sequence< css::drawing::EnhancedCustomShapeParameterPair> seqGluePoints1;
1159 if ( *pAny >>= seqGluePoints1 )
1162 css::uno::Sequence< css::drawing::EnhancedCustomShapeParameterPair> seqGluePoints2( nCount );
1163 auto pseqGluePoints2 = seqGluePoints2.getArray();
1164 for ( i = 0; i < nCount; i++ )
1169 if ( seqGluePoints1 == seqGluePoints2 )
1170 bIsDefaultGeometry =
true;
1173 else if ( pDefCustomShape && ( pDefCustomShape->
nGluePoints == 0 ) )
1174 bIsDefaultGeometry =
true;
1184 css::uno::Sequence< css::drawing::EnhancedCustomShapeSegment > seqSegments1;
1185 if ( *pAny >>= seqSegments1 )
1192 css::uno::Sequence< css::drawing::EnhancedCustomShapeSegment > seqSegments2( nCount );
1193 auto pseqSegments2 = seqSegments2.getArray();
1194 for ( i = 0; i < nCount; i++ )
1196 EnhancedCustomShapeSegment& rSegInfo = pseqSegments2[ i ];
1197 sal_uInt16 nSDat = pDefCustomShape->
pElements[ i ];
1200 if ( seqSegments1 == seqSegments2 )
1201 bIsDefaultGeometry =
true;
1207 if ( seqSegments1.getLength() == 4 )
1209 if ( ( seqSegments1[ 0 ].Command == EnhancedCustomShapeSegmentCommand::MOVETO )
1210 && ( seqSegments1[ 1 ].Command == EnhancedCustomShapeSegmentCommand::LINETO )
1211 && ( seqSegments1[ 2 ].Command == EnhancedCustomShapeSegmentCommand::CLOSESUBPATH )
1212 && ( seqSegments1[ 3 ].Command == EnhancedCustomShapeSegmentCommand::ENDSUBPATH ) )
1213 bIsDefaultGeometry =
true;
1218 else if ( pDefCustomShape && ( ( pDefCustomShape->
nElements == 0 ) || ( pDefCustomShape->
pElements == nullptr ) ) )
1219 bIsDefaultGeometry =
true;
1226 if ( pAny && pDefCustomShape )
1228 sal_Int32 nStretchX = 0;
1229 if ( *pAny >>= nStretchX )
1231 if ( pDefCustomShape->
nXRef == nStretchX )
1232 bIsDefaultGeometry =
true;
1236 bIsDefaultGeometry =
true;
1243 if ( pAny && pDefCustomShape )
1245 sal_Int32 nStretchY = 0;
1246 if ( *pAny >>= nStretchY )
1248 if ( pDefCustomShape->
nYRef == nStretchY )
1249 bIsDefaultGeometry =
true;
1253 bIsDefaultGeometry =
true;
1262 css::uno::Sequence< OUString > seqEquations1;
1263 if ( *pAny >>= seqEquations1 )
1266 css::uno::Sequence< OUString > seqEquations2( nCount );
1267 auto pseqEquations2 = seqEquations2.getArray();
1270 for ( i = 0; i < nCount; i++, pData++ )
1273 if ( seqEquations1 == seqEquations2 )
1274 bIsDefaultGeometry =
true;
1277 else if ( pDefCustomShape && ( ( pDefCustomShape->
nCalculation == 0 ) || ( pDefCustomShape->
pCalculation ==
nullptr ) ) )
1278 bIsDefaultGeometry =
true;
1285 if ( pAny && pDefCustomShape && pDefCustomShape->
nTextRect && pDefCustomShape->
pTextRect )
1287 css::uno::Sequence< css::drawing::EnhancedCustomShapeTextFrame > seqTextFrames1;
1288 if ( *pAny >>= seqTextFrames1 )
1291 css::uno::Sequence< css::drawing::EnhancedCustomShapeTextFrame > seqTextFrames2( nCount );
1292 auto pseqTextFrames2 = seqTextFrames2.getArray();
1294 for ( i = 0; i < nCount; i++, pRectangles++ )
1301 if ( seqTextFrames1 == seqTextFrames2 )
1302 bIsDefaultGeometry =
true;
1305 else if ( pDefCustomShape && ( ( pDefCustomShape->
nTextRect == 0 ) || ( pDefCustomShape->
pTextRect ==
nullptr ) ) )
1306 bIsDefaultGeometry =
true;
1310 return bIsDefaultGeometry;
1332 if ( !pRenderedCustomShape )
1340 while(aIterator.
IsMore())
1386 bool bChanged(
false);
1387 if(bResizeShapeToFitText)
1398 if(bResizeShapeToFitText)
1484 if ( pRenderedCustomShape )
1489 pRenderedCustomShape->
NbcMove( rSiz );
1523 for (
const auto& rInteraction : aInteractionHandles)
1528 rInteraction.xInteraction->setControllerPosition( rInteraction.aPosition );
1531 sal_Int32 nX = ( rInteraction.aPosition.X - aOld.
Left() ) +
maRect.
Left();
1532 rInteraction.xInteraction->setControllerPosition( css::awt::Point( nX, rInteraction.xInteraction->getPosition().Y ) );
1537 rInteraction.xInteraction->setControllerPosition( css::awt::Point( nX, rInteraction.xInteraction->getPosition().Y ) );
1541 sal_Int32 nY = ( rInteraction.aPosition.Y - aOld.
Top() ) +
maRect.
Top();
1542 rInteraction.xInteraction->setControllerPosition( css::awt::Point( rInteraction.xInteraction->getPosition().X, nY ) );
1545 catch (
const uno::RuntimeException& )
1552 double fAngle =
toDegrees(nTextObjRotation);
1594 nW = 36000_deg100 - nW;
1596 nW = 18000_deg100 - nW;
1597 nW = nW % 36000_deg100;
1598 if ( nW < 0_deg100 )
1599 nW = 36000_deg100 + nW;
1648 double fAngle =
toDegrees(nTextObjRotation);
1676 double fAngle =
toDegrees(nTextObjRotation);
1736 if(!(pSource && pSource->
GetCount()))
1752 for(a = 0; a < pSource->
GetCount(); a++)
1770 sal_uInt16 nPointCount=aPoly.
GetSize();
1771 for (sal_uInt16
i=0;
i<nPointCount;
i++)
1779 sal_Int32 nYDiff = aBoundRect.Top() -
maRect.
Top();
1781 if (nShearAngle && bMirroredX != bMirroredY)
1783 nShearAngle = -nShearAngle;
1788 for ( a = 0; a < aNewList.
GetCount(); a++ )
1801 aGlue.AdjustX( -nXDiff );
1802 aGlue.AdjustY( -nYDiff );
1807 for(a = 0; a < pList->
GetCount(); a++)
1813 aNewList.
Insert(rCandidate);
1859 int nCustomShapeHdlNum = 0;
1862 if ( rInteraction.xInteraction.is() )
1866 css::awt::Point aPosition( rInteraction.xInteraction->getPosition() );
1868 pH->SetPointNum( nCustomShapeHdlNum );
1869 pH->SetObj( const_cast<SdrObjCustomShape*>(
this) );
1870 rHdlList.
AddHdl(std::move(pH));
1872 catch (
const uno::RuntimeException& )
1876 ++nCustomShapeHdlNum;
1941 aNewRect.
SetPos( aNewPos );
1943 if ( aNewRect ==
maRect )
1949 if ( rNewRect.
Left() > rNewRect.
Right() )
1952 Point aBottom( aTop.X(), aTop.Y() + 1000 );
1955 if ( rNewRect.
Top() > rNewRect.
Bottom() )
1958 Point aRight( aLeft.X() + 1000, aLeft.Y() );
1962 for (
const auto& rInteraction : aInteractionHandles)
1967 rInteraction.xInteraction->setControllerPosition( rInteraction.aPosition );
1972 bOldMirroredX = !bOldMirroredX;
1975 if ( bOldMirroredX )
1977 nX = ( rInteraction.aPosition.X - aOld.
Right() );
1978 if ( rNewRect.
Left() > rNewRect.
Right() )
1985 nX = ( rInteraction.aPosition.X - aOld.
Left() );
1986 if ( rNewRect.
Left() > rNewRect.
Right() )
1991 rInteraction.xInteraction->setControllerPosition( css::awt::Point( nX, rInteraction.xInteraction->getPosition().Y ) );
1996 if ( bOldMirroredY )
1998 nY = ( rInteraction.aPosition.Y - aOld.
Bottom() );
1999 if ( rNewRect.
Top() > rNewRect.
Bottom() )
2006 nY = ( rInteraction.aPosition.Y - aOld.
Top() );
2007 if ( rNewRect.
Top() > rNewRect.
Bottom() )
2012 rInteraction.xInteraction->setControllerPosition( css::awt::Point( rInteraction.xInteraction->getPosition().X, nY ) );
2015 catch (
const uno::RuntimeException& )
2022 const sal_uInt16 nCustomShapeHdlNum,
bool bMoveCalloutRectangle )
2025 if ( nCustomShapeHdlNum >= aInteractionHandles.size() )
2034 css::awt::Point aPt( rDestination.X(), rDestination.Y() );
2037 sal_Int32 nXDiff = aPt.X - aInteractionHandle.
aPosition.X;
2038 sal_Int32 nYDiff = aPt.Y - aInteractionHandle.
aPosition.Y;
2046 for (
const auto& rInteraction : aInteractionHandles)
2050 if ( rInteraction.xInteraction.is() )
2051 rInteraction.xInteraction->setControllerPosition( rInteraction.aPosition );
2055 aInteractionHandle.
xInteraction->setControllerPosition( aPt );
2057 catch (
const uno::RuntimeException& )
2110 constexpr sal_uInt32 nDefaultObjectSizeWidth = 3000;
2111 constexpr sal_uInt32 nDefaultObjectSizeHeight= 3000;
2119 if ( !aInteractionHandles.empty() )
2121 sal_Int32 nHandlePos = aInteractionHandles[ aInteractionHandles.size() - 1 ].xInteraction->getPosition().X;
2130 for (
const auto& rInteraction : aInteractionHandles)
2135 rInteraction.xInteraction->setControllerPosition( awt::Point( rStat.
GetStart().X(), rStat.
GetStart().Y() ) );
2137 catch (
const uno::RuntimeException& )
2182 return bIsAutoGrowHeight;
2190 return bIsAutoGrowWidth;
2203 DBG_ASSERT( pOutlinerParaObject,
"SdrTextObj::SetVerticalWriting() without OutlinerParaObject!" );
2205 if( !pOutlinerParaObject ||
2245 if ( pOutlinerParaObject )
2262 if ( bHasText && !rR.
IsEmpty() )
2266 if ( bWdtGrow || bHgtGrow )
2272 Size aMaxSiz(100000,100000);
2280 if (nMaxWdt==0 || nMaxWdt>aMaxSiz.
Width()) nMaxWdt=aMaxSiz.
Width();
2281 if (nMinWdt<=0) nMinWdt=1;
2282 aSiz.setWidth(nMaxWdt );
2288 if (nMaxHgt==0 || nMaxHgt>aMaxSiz.
Height()) nMaxHgt=aMaxSiz.
Height();
2289 if (nMinHgt<=0) nMinHgt=1;
2290 aSiz.setHeight(nMaxHgt );
2294 aSiz.AdjustWidth( -nHDist );
2295 aSiz.AdjustHeight( -nVDist );
2296 if ( aSiz.Width() < 2 )
2298 if ( aSiz.Height() < 2 )
2299 aSiz.setHeight( 2 );
2309 nWdt=aSiz2.
Width()+1;
2310 if (bHgtGrow) nHgt=aSiz2.Height()+1;
2323 if( pOutlinerParaObject !=
nullptr )
2325 rOutliner.
SetText(*pOutlinerParaObject);
2331 nWdt=aSiz2.
Width()+1;
2333 nHgt=aSiz2.Height()+1;
2340 if (bHgtGrow && nColumns > 1)
2356 if ( nWdt < nMinWdt )
2358 if ( nWdt > nMaxWdt )
2363 if ( nHgt < nMinHgt )
2365 if ( nHgt > nMaxHgt )
2372 if ( nWdtGrow == 0 )
2374 if ( nHgtGrow == 0 )
2421 rR.
Move(aD2.X(),aD2.Y());
2442 if (aAdjustedTextRect != aNewTextRect && aOldTextRect != aAdjustedTextRect &&
2446 double fXScale =
static_cast<double>(aOldTextRect.
GetWidth()) / static_cast<double>(aNewTextRect.
GetWidth());
2447 double fYScale =
static_cast<double>(aOldTextRect.
GetHeight()) / static_cast<double>(aNewTextRect.
GetHeight());
2448 double fRightDiff =
static_cast<double>( aAdjustedTextRect.
Right() - aNewTextRect.
Right() ) * fXScale;
2449 double fLeftDiff =
static_cast<double>( aAdjustedTextRect.
Left() - aNewTextRect.
Left() ) * fXScale;
2450 double fTopDiff =
static_cast<double>( aAdjustedTextRect.
Top() - aNewTextRect.
Top() ) * fYScale;
2451 double fBottomDiff=
static_cast<double>( aAdjustedTextRect.
Bottom()- aNewTextRect.
Bottom()) * fYScale;
2452 aReturnValue.
AdjustLeft(static_cast<sal_Int32>(fLeftDiff) );
2453 aReturnValue.
AdjustRight(static_cast<sal_Int32>(fRightDiff) );
2454 aReturnValue.
AdjustTop(static_cast<sal_Int32>(fTopDiff) );
2455 aReturnValue.
AdjustBottom(static_cast<sal_Int32>(fBottomDiff) );
2458 return aReturnValue;
2464 const bool bRet = !aNewTextRect.
IsEmpty() && aNewTextRect !=
maRect;
2476 for (
const auto& rInteraction : aInteractionHandles)
2481 rInteraction.xInteraction->setControllerPosition( rInteraction.aPosition );
2483 catch (
const uno::RuntimeException& )
2497 bool bRet = !aNewTextRect.
IsEmpty() && ( aNewTextRect !=
maRect );
2510 for (
const auto& rInteraction : aInteractionHandles)
2515 rInteraction.xInteraction->setControllerPosition( rInteraction.aPosition );
2517 catch (
const uno::RuntimeException& )
2537 Point aCenter0(aCenter);
2540 aViewInit.
Move(aCenter.X(),aCenter.Y());
2543 aAnkSiz.
AdjustWidth( -1 ); aAnkSiz.AdjustHeight( -1 );
2544 Size aMaxSiz(1000000,1000000);
2557 if (nMinWdt<1) nMinWdt=1;
2558 if (nMinHgt<1) nMinHgt=1;
2559 if ( nMaxWdt == 0 || nMaxWdt > aMaxSiz.
Width() )
2560 nMaxWdt = aMaxSiz.
Width();
2561 if ( nMaxHgt == 0 || nMaxHgt > aMaxSiz.
Height() )
2562 nMaxHgt=aMaxSiz.
Height();
2568 nMaxHgt = aAnkSiz.Height();
2573 nMaxWdt = aAnkSiz.Width();
2577 Size aPaperMax(nMaxWdt, nMaxHgt);
2578 Size aPaperMin(nMinWdt, nMinHgt);
2582 *pViewMin = aViewInit;
2611 if (pPaperMin!=
nullptr) *pPaperMin=aPaperMin;
2612 if (pPaperMax!=
nullptr) *pPaperMax=aPaperMax;
2613 if (pViewInit!=
nullptr) *pViewInit=aViewInit;
2635 rAnchorRect.
SetPos( aP );
2653 sal_Int32 nMaxAutoPaperWidth = 1000000;
2654 sal_Int32 nMaxAutoPaperHeight= 1000000;
2662 nMaxAutoPaperHeight = nAnkHgt;
2664 nMaxAutoPaperWidth = nAnkWdt;
2690 if( !pTestObj || !bHitTest || pTestObj !=
this ||
2753 aTextPos.AdjustX(nFreeWdt/2 );
2755 aTextPos.AdjustX(nFreeWdt );
2761 aTextPos.AdjustY(nFreeHgt/2 );
2763 aTextPos.AdjustY(nFreeHgt );
2769 *pAnchorRect=aAnkRect;
2793 sName +=
" '" + aNm +
"'";
2799 return SvxResId(STR_ObjNamePluralCUSTOMSHAPE);
2819 SdrObject* pRenderedCustomShape =
nullptr;
2832 if ( pRenderedCustomShape )
2836 DBG_ASSERT(pCandidate,
"SdrObjCustomShape::DoConvertToPolyObj: Could not clone SdrObject (!)");
2870 if(
nullptr != pNewPage)
2882 return std::make_unique<SdrAShapeObjGeoData>();
2907 PropertyValue aPropVal;
2908 aPropVal.Name =
"AdjustmentValues";
2918 SAL_INFO_IF(bShrinkOnly,
"svx",
"Case bShrinkOnly == true is not implemented yet.");
2933 double fRotate, fShearX;
2934 aMatrix.
decompose(aScale, aTranslate, fRotate, fShearX);
2947 double fPolygonWidth = aB2DRange.
getWidth();
2948 if (fPolygonWidth == 0)
2950 double fPolygonHeight = aB2DRange.getHeight();
2951 if (fPolygonHeight == 0)
2953 const double aFactorX =
static_cast<double>(rMaxRect.
GetWidth()) / fPolygonWidth;
2954 const double aFactorY =
static_cast<double>(rMaxRect.
GetHeight()) / fPolygonHeight;
2957 aMathMatrix.
scale(aFactorX, aFactorY);
2961 const double fPolygonLeft = aB2DRange.
getMinX();
2962 const double fPolygonTop = aB2DRange.getMinY();
2963 aMathMatrix.
translate(rMaxRect.
Left() - fPolygonLeft, rMaxRect.
Top() - fPolygonTop);
2966 aMathMatrix.
decompose(aScale, aTranslate, fRotate, fShearX);
2985 if (bIsMirroredX || bIsMirroredY)
2990 Mirror(aCurrentCenter,
Point(aCurrentCenter.X(), aCurrentCenter.Y() + 1000));
2994 Mirror(aCurrentCenter,
Point(aCurrentCenter.X() + 1000, aCurrentCenter.Y()));
3001 double fRotate, fShearX;
3002 rMatrix.
decompose(aScale, aTranslate, fRotate, fShearX);
3023 if( !aSize.Height() ) aSize.
setHeight( 1 );
3024 if( !aSize.Width() ) aSize.setWidth( 1 );
3066 if (!(bIsMirroredX || bIsMirroredY))
3072 if (aScale.
getX() > 2.0 && aScale.
getY() > 2.0)
3079 aCenter = aMathMat * aCenter;
3080 double fCenterX = aCenter.
getX();
3081 double fCenterY = aCenter.getY();
3102 if ( bMirroredX || bMirroredY )
3113 Point aRef1( ( aBoundRect.Left() + aBoundRect.Right() ) >> 1, aBoundRect.Top() );
3114 Point aRef2( aRef1.X(), aRef1.Y() + 1000 );
3116 sal_uInt16 nPointCount=aPol.
GetSize();
3117 for (i=0; i<nPointCount; i++)
3136 Point aRef1( aBoundRect.Left(), ( aBoundRect.Top() + aBoundRect.Bottom() ) >> 1 );
3137 Point aRef2( aRef1.X() + 1000, aRef1.Y() );
3139 sal_uInt16 nPointCount=aPol.
GetSize();
3140 for (i=0; i<nPointCount; i++)
3180 return std::make_unique<sdr::contact::ViewContactOfSdrObjCustomShape>(*this);
3186 bool bRetval(
false);
3231 OUString sShapeName;
3233 if ( aEngine.isEmpty()
3234 || aEngine ==
"com.sun.star.drawing.EnhancedCustomShapeEngine" )
3236 OUString sShapeType;
3239 if ( pAny && ( *pAny >>= sShapeType ) )
virtual void Shear(const Point &rRef, Degree100 nAngle, double tn, bool bVShear)
constexpr TypedWhichId< SdrOnOffItem > SDRATTR_TEXT_AUTOGROWHEIGHT(SDRATTR_MISC_FIRST+2)
tools::Long GetTextLowerDistance() const
Bottom inner spacing to borders.
tools::Rectangle ImpCalculateTextFrame(const bool bHgt, const bool bWdt)
virtual void NbcSetOutlinerParaObject(std::optional< OutlinerParaObject > pTextObject) override
void SetPropertyValue(const css::beans::PropertyValue &rPropVal)
uno::Reference< drawing::XShape > GetXShapeForSdrObject(SdrObject *pObj) noexcept
returns a StarOffice API wrapper for the given SdrObject
virtual void TakeObjInfo(SdrObjTransformInfoRec &rInfo) const
constexpr TypedWhichId< SdrTextHorzAdjustItem > SDRATTR_TEXT_HORZADJUST(SDRATTR_MISC_FIRST+13)
virtual void NbcResize(const Point &rRef, const Fraction &xFact, const Fraction &yFact) override
SdrMetricItem makeSdrShadowYDistItem(tools::Long nDist)
constexpr TypedWhichId< SdrPercentItem > SDRATTR_SHADOWTRANSPARENCE(SDRATTR_SHADOW_FIRST+4)
virtual SdrObjCustomShape * CloneSdrObject(SdrModel &rTargetModel) const override
virtual const tools::Rectangle & GetCurrentBoundRect() const
SVX_DLLPRIVATE void DragCreateObject(SdrDragStat &rDrag)
tools::Long GetDX() const
void ShearPoint(Point &rPnt, const Point &rRef, double tn, bool bVShear=false)
void setWidth(tools::Long nWidth)
void ForceOutlinerParaObject()
B2DPolygon const & createUnitPolygon()
sal_Int32 ImpGetLineWdt() const
Detects the width of the line. No line ->0.
tools::Long GetDY() const
constexpr double deg2rad(double v)
constexpr TypedWhichId< SdrOnOffItem > SDRATTR_TEXT_AUTOGROWWIDTH(SDRATTR_MISC_FIRST+12)
const Point & GetStart() const
std::unique_ptr< sal_Int32[]> pData
void SetPaperSize(const Size &rSize)
tools::Long GetTextLeftDistance() const
Left inner spacing to borders.
void Poly2Rect(const tools::Polygon &rPol, tools::Rectangle &rRect, GeoStat &rGeo)
#define SAL_INFO_IF(condition, area, stream)
css::beans::PropertyValue makePropertyValue(const OUString &rName, T &&rValue)
static bool doConstructOrthogonal(std::u16string_view rName)
static SdrObject * getSdrObjectFromXShape(const css::uno::Reference< css::uno::XInterface > &xInt)
virtual std::unique_ptr< sdr::contact::ViewContact > CreateObjectSpecificViewContact() override
constexpr TypedWhichId< XFillStyleItem > XATTR_FILLSTYLE(XATTR_FILL_FIRST)
virtual SdrObjectUniquePtr DoConvertToPolyObj(bool bBezier, bool bAddText) const
virtual void NbcShear(const Point &rRef, Degree100 nAngle, double tn, bool bVShear) override
static sal_Int32 GetNumberOfProperties(const SvxMSDffHandle *pData)
double mfSinRotationAngle
virtual void Move(const Size &rSiz) override
SvxMSDffVertPair * pVertices
sal_uInt32 GetPointNum() const
virtual sal_uInt32 GetHdlCount() const override
Via GetHdlCount the number of Handles can be retrieved.
virtual void SetBoundRectDirty()
virtual void AdaptTextMinSize() override
virtual basegfx::B2DPolyPolygon TakeContour() const override
contour for TextToContour
virtual void SaveGeoData(SdrObjGeoData &rGeo) const override
virtual void NbcSetLogicRect(const tools::Rectangle &rRect) override
SdrObjectUniquePtr ImpConvertAddText(SdrObjectUniquePtr pObj, bool bBezier) const
constexpr TypedWhichId< XLineStyleItem > XATTR_LINESTYLE(XATTR_LINE_FIRST)
virtual bool MovCreate(SdrDragStat &rStat) override
sal_uInt32 GetTextHeight() const
tools::Long GetMinTextFrameHeight() const
void CheckPortionInfo(const SdrOutliner &rOutliner)
constexpr TypedWhichId< SvxAdjustItem > EE_PARA_JUST(EE_PARA_START+15)
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...
tools::Rectangle m_aOutRect
constexpr TypedWhichId< XFillHatchItem > XATTR_FILLHATCH(XATTR_FILL_FIRST+3)
virtual bool EndCreate(SdrDragStat &rStat, SdrCreateCmd eCmd) override
static void Free(SdrObject *&_rpObject)
sal_uInt16 GetCount() const
virtual const tools::Rectangle & GetSnapRect() const override
All geometrical data of an arbitrary object for use in undo/redo.
virtual std::unique_ptr< sdr::properties::BaseProperties > CreateObjectSpecificProperties() override
virtual void EndTextEdit(SdrOutliner &rOutl)
SdrObjCustomShape(SdrModel &rSdrModel)
virtual bool HasText() const override
virtual void TakeObjInfo(SdrObjTransformInfoRec &rInfo) const override
virtual void NbcMirror(const Point &rRef1, const Point &rRef2) override
SVXCORE_DLLPUBLIC const OUString & GetAccName(const OUString &)
bool IsCustomShapeFilledByDefault(MSO_SPT eSpType)
tools::Long GetMaxTextFrameHeight() const
constexpr tools::Long Width() const
void SetColor(const Color &rColor)
SvxMSDffVertPair * pGluePoints
const SdrHdl * GetHdl() const
SdrMetricItem makeSdrTextMinFrameWidthItem(tools::Long mnWidth)
virtual bool hasSpecialDrag() const override
The standard transformations (Move,Resize,Rotate,Mirror,Shear) are taken over by the View (TakeXorPol...
void SetControlWord(EEControlBits nWord)
virtual void SaveGeoData(SdrObjGeoData &rGeo) const override
B2DHomMatrix createScaleShearXRotateTranslateB2DHomMatrix(double fScaleX, double fScaleY, double fShearX, double fRadiant, double fTranslateX, double fTranslateY)
The transformation of a rectangle into a polygon, by using angle parameters from GeoStat.
OUString SvxResId(TranslateId aId)
bool LineIsOutsideGeometry() const
static bool Filter(BitmapEx &rBmpEx, BitmapFilter const &rFilter)
virtual void SetLogicRect(const tools::Rectangle &rRect) override
const SfxItemSet & GetObjectItemSet() const
constexpr TypedWhichId< SdrOnOffItem > SDRATTR_TEXT_WORDWRAP(SDRATTR_MISC_FIRST+24)
constexpr TypedWhichId< XColorItem > SDRATTR_SHADOWCOLOR(SDRATTR_SHADOW_FIRST+1)
void SetFixedCellHeight(bool bUseFixedCellHeight)
void GetOOXHandleAdjRelation(std::u16string_view sFullOOXShapeName, const sal_Int32 nHandleIndex, OUString &rFirstRefType, sal_Int32 &rFirstAdjValueIndex, OUString &rSecondRefType, sal_Int32 &rSecondAdjValueIndex)
void TakeCreateRect(tools::Rectangle &rRect) const
tools::Long GetMaxTextFrameWidth() const
static SdrObject * ImpCreateShadowObjectClone(const SdrObject &rOriginal, const SfxItemSet &rOriginalSet)
virtual void NbcShear(const Point &rRef, Degree100 nAngle, double tn, bool bVShear) override
EEControlBits GetControlWord() const
const GeoStat & GetGeoStat() const
tools::Rectangle maSnapRect
constexpr TypedWhichId< SdrOnOffItem > SDRATTR_SHADOW(SDRATTR_SHADOW_FIRST+0)
double GetExtraTextRotation(const bool bPreRotation=false) const
virtual bool IsAutoGrowWidth() const override
void MergeDefaultAttributes(const OUString *pType=nullptr)
virtual void handlePageChange(SdrPage *pOldPage, SdrPage *pNewPage) override
virtual void SetBoundAndSnapRectsDirty(bool bNotMyself=false, bool bRecursive=true)
css::awt::Point aPosition
tools::Rectangle ImpDragCalcRect(const SdrDragStat &rDrag) const
SvxMSDffTextRectangles * pTextRect
virtual void RestoreGeoData(const SdrObjGeoData &rGeo) override
virtual bool IsAutoGrowHeight() const override
SvxMSDffHandleFlags nFlags
static void lcl_ShapePropertiesFromDFF(const SvxMSDffHandle *pData, css::beans::PropertyValues &rPropValues)
const SfxPoolItem & GetObjectItem(const sal_uInt16 nWhich) const
virtual SdrGluePoint GetVertexGluePoint(sal_uInt16 nNum) const override
virtual void AdjustToMaxRect(const tools::Rectangle &rMaxRect, bool bShrinkOnly=false) override
SdrTextHorzAdjust GetTextHorizontalAdjust() const
virtual void TakeTextRect(SdrOutliner &rOutliner, tools::Rectangle &rTextRect, bool bNoEditText, tools::Rectangle *pAnchorRect, bool bLineWidth=true) const override
constexpr TypedWhichId< SvxWritingModeItem > SDRATTR_TEXTDIRECTION(SDRATTR_NOTPERSIST_FIRST+34)
void SetNoSnap(bool bOn=true)
virtual void handlePageChange(SdrPage *pOldPage, SdrPage *pNewPage) override
void SetEndDragChangesGeoAndAttributes(bool bOn)
SdrTextVertAdjust GetTextVerticalAdjust() const
virtual const SdrGluePointList * GetGluePointList() const
static OUString GetEquation(const sal_uInt16 nFlags, sal_Int32 nPara1, sal_Int32 nPara2, sal_Int32 nPara3)
void SetText(const OutlinerParaObject &)
constexpr TypedWhichId< XFillGradientItem > XATTR_FILLGRADIENT(XATTR_FILL_FIRST+2)
#define DBG_ASSERT(sCon, aError)
virtual void NbcSetSnapRect(const tools::Rectangle &rRect) override
virtual void NbcSetOutlinerParaObject(std::optional< OutlinerParaObject > pTextObject) override
constexpr TypedWhichId< SdrCustomShapeGeometryItem > SDRATTR_CUSTOMSHAPE_GEOMETRY(SDRATTR_CUSTOMSHAPE_FIRST+2)
virtual void TakeTextAnchorRect(tools::Rectangle &rAnchorRect) const override
constexpr TypedWhichId< XFillBitmapItem > XATTR_FILLBITMAP(XATTR_FILL_FIRST+4)
virtual void InternalSetStyleSheet(SfxStyleSheet *pNewStyleSheet, bool bDontRemoveHardAttr, bool bBroadcast)
SdrOutliner * mpEditingOutliner
bool decompose(B2DTuple &rScale, B2DTuple &rTranslate, double &rRotate, double &rShearX) const
tools::Long FRound(double fVal)
void SetVertical(bool bNew)
virtual void SetVerticalWriting(bool bVertical) override
B2DPolyPolygon UnoPolyPolygonBezierCoordsToB2DPolyPolygon(const css::drawing::PolyPolygonBezierCoords &rPolyPolygonBezierCoordsSource)
virtual void NbcResize(const Point &rRef, const Fraction &xFact, const Fraction &yFact) override
SvxMSDffCalculationData * pCalculation
virtual void TakeTextEditArea(Size *pPaperMin, Size *pPaperMax, tools::Rectangle *pViewInit, tools::Rectangle *pViewMin) const override
void BroadcastObjectChange() const
constexpr TypedWhichId< SdrTextVertAdjustItem > SDRATTR_TEXT_VERTADJUST(SDRATTR_MISC_FIRST+8)
sal_Int32 GetPointCount() const
void MirrorPoint(Point &rPnt, const Point &rRef1, const Point &rRef2)
void ActionChanged() const
virtual void EndTextEdit(SdrOutliner &rOutl) override
SdrView * GetView() const
bool IsDefaultGeometry(const DefaultType eDefaultType) const
virtual basegfx::B2DPolyPolygon TakeContour() const
contour for TextToContour
Universal Network Object packed into SvDraw object.
void scale(double fX, double fY)
constexpr TypedWhichId< SdrMetricItem > SDRATTR_TEXT_MINFRAMEWIDTH(SDRATTR_MISC_FIRST+10)
SdrModel & getSdrModelFromSdrObject() const
virtual sal_uInt32 GetHdlCount() const override
Via GetHdlCount the number of Handles can be retrieved.
SdrObjUserCall * m_pUserCall
bool createItemIfMissing(const OUString &sKey, const TValueType &aValue)
void SetUserDefined(bool bNew)
constexpr TypedWhichId< SdrMetricItem > SDRATTR_SHADOWYDIST(SDRATTR_SHADOW_FIRST+3)
virtual void TakeTextAnchorRect(::tools::Rectangle &rAnchorRect) const
void SetPercent(bool bOn)
virtual bool TRGetBaseGeometry(basegfx::B2DHomMatrix &rMatrix, basegfx::B2DPolyPolygon &rPolyPolygon) const override
virtual basegfx::B2DPolyPolygon TakeXorPoly() const override
The Xor-Polygon is required by the View to drag the object.
static void SetEnhancedCustomShapeParameter(css::drawing::EnhancedCustomShapeParameter &rParameter, const sal_Int32 nValue)
virtual void AddToHdlList(SdrHdlList &rHdlList) const override
tools::Polygon Rect2Poly(const tools::Rectangle &rRect, const GeoStat &rGeo)
void SetMergedItem(const SfxPoolItem &rItem)
const SdrObject * GetSdrObjectShadowFromCustomShape() const
virtual void NbcMove(const Size &rSiz) override
The methods Move, Resize, Rotate, Mirror, Shear, SetSnapRect and SetLogicRect call the corresponding ...
void SetEndDragChangesAttributes(bool bOn)
virtual void NbcRotate(const Point &rRef, Degree100 nAngle, double sn, double cs) override
SvxMSDffHandle * pHandles
constexpr TypedWhichId< SdrMetricItem > SDRATTR_TEXT_MINFRAMEHEIGHT(SDRATTR_MISC_FIRST+1)
virtual SdrText * getActiveText() const
returns the currently active text.
const SfxPoolItem & GetMergedItem(const sal_uInt16 nWhich) const
std::optional< OutlinerParaObject > CreateParaObject(sal_Int32 nStartPara=0, sal_Int32 nParaCount=EE_PARA_ALL) const
bool IsShiftPressed() const
css::uno::Reference< css::drawing::XCustomShapeHandle > xInteraction
SfxItemPool * GetPool() const
virtual void SetSnapRect(const tools::Rectangle &rRect) override
virtual void setUnoShape(const css::uno::Reference< css::drawing::XShape > &_rxUnoShape)
Sets a new UNO representation of the shape.
virtual bool applySpecialDrag(SdrDragStat &rDrag) override
virtual void Mirror(const Point &rRef1, const Point &rRef2)
SdrObject * mpLastShadowGeometry
#define DEFAULT_MAXIMUM_SIGNED_COMPARE
static void lcl_ShapeSegmentFromBinary(EnhancedCustomShapeSegment &rSegInfo, sal_uInt16 nSDat)
CustomShapeHandleModes nMode
Degree100 NormAngle36000(Degree100 a)
Normalize angle to -180.00..179.99.
tools::Long GetMinTextFrameWidth() const
void transform(const basegfx::B2DHomMatrix &rMatrix)
void SuggestTextFrameSize(Size aSuggestedTextFrameSize)
Allows suggesting the text frame size: in case the application has its own text associated to the sha...
css::uno::Reference< css::drawing::XShape > mXRenderedCustomShape
virtual void Shear(const Point &rRef, Degree100 nAngle, double tn, bool bVShear) override
SdrDragMethod * GetDragMethod() const
void DragMoveCustomShapeHdl(const Point &rDestination, const sal_uInt16 nCustomShapeHdlNum, bool bMoveCalloutRectangle)
virtual bool NbcAdjustTextFrameWidthAndHeight(bool bHgt=true, bool bWdt=true) override
sal_uInt16 Insert(const SdrGluePoint &rGP)
tools::Long GetTextRightDistance() const
Right inner spacing to borders.
basegfx::B2DPolyPolygon GetLineGeometry(const bool bBezierAllowed) const
const SdrObject * GetSdrObjectFromCustomShape() const
virtual SdrObjKind GetObjIdentifier() const override
B2DRange const & getB2DRange() const
virtual const tools::Rectangle & GetLastBoundRect() const
const SfxPoolItem * Put(const SfxPoolItem &rItem, sal_uInt16 nWhich)
constexpr TypedWhichId< SdrMetricItem > SDRATTR_SHADOWXDIST(SDRATTR_SHADOW_FIRST+2)
OUString GetCustomShapeName() const
void RotatePoint(Point &rPnt, const Point &rRef, double sn, double cs)
void SetActionRect(const tools::Rectangle &rR)
virtual void NbcRotate(const Point &rRef, Degree100 nAngle, double sn, double cs) override
bool IsEffectivelyVertical() const
virtual bool IsVerticalWriting() const
tools::Long GetTextUpperDistance() const
Top inner spacing to borders.
void SetMaxAutoPaperSize(const Size &rSz)
void ImpCheckCustomGluePointsAreAdded()
sal_Int32 GetDenominator() const
B2DPolygon adaptiveSubdivideByAngle(const B2DPolygon &rCandidate, double fAngleBound)
virtual SdrGluePointList * ForceGluePointList()
bool UseNoFillStyle() const
virtual void TRSetBaseGeometry(const basegfx::B2DHomMatrix &rMatrix, const basegfx::B2DPolyPolygon &rPolyPolygon) override
bool equalsIgnoreAsciiCase(std::u16string_view s1, std::u16string_view s2)
const SfxPoolItem & Get(sal_uInt16 nWhich, bool bSrchInParent=true) const
constexpr tools::Long Height() const
virtual OutlinerParaObject * GetOutlinerParaObject() const override
SdrMetricItem makeSdrShadowXDistItem(tools::Long nDist)
void SetObjectItemSet(const SfxItemSet &rSet)
SdrMetricItem makeSdrTextMinFrameHeightItem(tools::Long mnHeight)
virtual void NbcMove(const Size &rSiz)
The methods Move, Resize, Rotate, Mirror, Shear, SetSnapRect and SetLogicRect call the corresponding ...
bool IsSolidDragging() const
const SfxItemSet & GetMergedItemSet() const
void SetMirroredX(const bool bMirroredX)
void SetMinAutoPaperSize(const Size &rSz)
tools::Long AdjustWidth(tools::Long n)
double mfCosRotationAngle
virtual bool beginSpecialDrag(SdrDragStat &rDrag) const override
static MSO_SPT ImpGetCustomShapeType(const SdrObjCustomShape &rCustoShape)
virtual SdrObject * CloneSdrObject(SdrModel &rTargetModel) const
virtual const SdrGluePointList * GetGluePointList() const override
virtual OUString TakeObjNameSingul() const override
static void SetEnhancedCustomShapeHandleParameter(css::drawing::EnhancedCustomShapeParameter &rParameter, const sal_Int32 nPara, const bool bIsSpecialValue, bool bHorz)
Size m_aSuggestedTextFrameSize
Reference< XComponentContext > getProcessComponentContext()
#define DEFAULT_MINIMUM_SIGNED_COMPARE
void SetMirroredY(const bool bMirroredY)
sal_Int32 GetNumerator() const
bool GetTextBounds(tools::Rectangle &rTextBound) const
css::uno::Sequence< css::drawing::EnhancedCustomShapeAdjustmentValue > aAdjustmentSeq
virtual void RestoreGeoData(const SdrObjGeoData &rGeo) override
std::unique_ptr< SdrObject, SdrObjectFreeOp > SdrObjectUniquePtr
virtual SdrObjectUniquePtr DoConvertToPolyObj(bool bBezier, bool bAddText) const override
SdrOnOffItem makeSdrShadowItem(bool bShadow)
const Point & GetPos() const
const Point & GetNow() const
bool SetUpdateLayout(bool bUpdate)
void translate(double fX, double fY)
static bool ImpVerticalSwitch(const SdrObjCustomShape &rCustoShape)
virtual void InternalSetStyleSheet(SfxStyleSheet *pNewStyleSheet, bool bDontRemoveHardAttr, bool bBroadcast) override
constexpr TypedWhichId< SdrTextFixedCellHeightItem > SDRATTR_TEXT_USEFIXEDCELLHEIGHT(SDRATTR_MISC_FIRST+23)
const Point & GetAnchorPos() const
constexpr TypedWhichId< SfxInt16Item > SDRATTR_TEXTCOLUMNS_NUMBER(SDRATTR_TEXTCOLUMNS_FIRST+0)
virtual OUString TakeObjNamePlural() const override
css::uno::Any * GetPropertyValueByName(const OUString &rPropName)
virtual void Rotate(const Point &rRef, Degree100 nAngle, double sn, double cs)
void AdjustRectToTextDistance(tools::Rectangle &rAnchorRect) const
virtual void setUnoShape(const css::uno::Reference< css::drawing::XShape > &rxUnoShape) override
Sets a new UNO representation of the shape.
void setHeight(tools::Long nHeight)
SVX_DLLPRIVATE void DragResizeCustomShape(const tools::Rectangle &rNewRect)
virtual bool AdjustTextFrameWidthAndHeight() override
void SetTextObj(const SdrTextObj *pObj)
bool IsUserDefined() const
const mso_CustomShape * GetCustomShapeContent(MSO_SPT eSpType)
css::uno::Reference< css::drawing::XCustomShapeEngine > const & GetCustomShapeEngine() const
SVXCORE_DLLPUBLIC MSO_SPT Get(const OUString &)
css::uno::Reference< css::drawing::XCustomShapeEngine > mxCustomShapeEngine
A SdrPage contains exactly one SdrObjList and a description of the physical page dimensions (size / m...
const SdrTextObj * GetTextObj() const
bool areControlPointsUsed() const
virtual SdrGluePointList * ForceGluePointList() override
virtual void SetChanged()
std::unique_ptr< SdrObjPlusData > m_pPlusData
virtual void NbcMove(const Size &rSiz) override
The methods Move, Resize, Rotate, Mirror, Shear, SetSnapRect and SetLogicRect call the corresponding ...
static void ImpJustifyRect(tools::Rectangle &rRect)
SdrOutliner & ImpGetDrawOutliner() const
const OUString & GetName() const
virtual void NbcMirror(const Point &rRef1, const Point &rRef2) override
bool mbAdjustingTextFrameWidthAndHeight
virtual basegfx::B2DPolyPolygon TakeCreatePoly(const SdrDragStat &rDrag) const override
Polygon dragged by the user when creating the object.
virtual void AddToHdlList(SdrHdlList &rHdlList) const override
void SendUserCall(SdrUserCallType eUserCall, const tools::Rectangle &rBoundRect) const
void SetPos(const Point &rNewPos)
constexpr TypedWhichId< SfxStringItem > SDRATTR_CUSTOMSHAPE_ENGINE(SDRATTR_CUSTOMSHAPE_FIRST+0)
void AddHdl(std::unique_ptr< SdrHdl > pHdl)
std::vector< SdrCustomShapeInteraction > GetInteractionHandles() const
SdrHdlKind GetKind() const
bool m_bDetectedRangeSegmentation false
virtual const tools::Rectangle & GetLogicRect() const override
virtual ~SdrObjCustomShape() override
const Size & GetPaperSize() const
void InvalidateRenderGeometry()