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>
32 #include <com/sun/star/uno/Sequence.h>
42 #include <svx/strings.hrc>
52 #include <com/sun/star/beans/PropertyValues.hpp>
53 #include <com/sun/star/drawing/EnhancedCustomShapeAdjustmentValue.hpp>
54 #include <com/sun/star/drawing/EnhancedCustomShapeParameterPair.hpp>
55 #include <com/sun/star/drawing/EnhancedCustomShapeTextFrame.hpp>
56 #include <com/sun/star/drawing/EnhancedCustomShapeSegment.hpp>
57 #include <com/sun/star/drawing/EnhancedCustomShapeSegmentCommand.hpp>
85 #include <rtl/ustrbuf.hxx>
100 rSegInfo.Command = EnhancedCustomShapeSegmentCommand::LINETO;
101 rSegInfo.Count = nSDat & 0xff;
102 if ( !rSegInfo.Count )
106 rSegInfo.Command = EnhancedCustomShapeSegmentCommand::CURVETO;
107 rSegInfo.Count = nSDat & 0xff;
108 if ( !rSegInfo.Count )
112 rSegInfo.Command = EnhancedCustomShapeSegmentCommand::MOVETO;
113 rSegInfo.Count = nSDat & 0xff;
114 if ( !rSegInfo.Count )
118 rSegInfo.Command = EnhancedCustomShapeSegmentCommand::CLOSESUBPATH;
122 rSegInfo.Command = EnhancedCustomShapeSegmentCommand::ENDSUBPATH;
126 rSegInfo.Command = EnhancedCustomShapeSegmentCommand::ANGLEELLIPSETO;
127 rSegInfo.Count = ( nSDat & 0xff ) / 3;
130 rSegInfo.Command = EnhancedCustomShapeSegmentCommand::ANGLEELLIPSE;
131 rSegInfo.Count = ( nSDat & 0xff ) / 3;
134 rSegInfo.Command = EnhancedCustomShapeSegmentCommand::ARCTO;
135 rSegInfo.Count = ( nSDat & 0xff ) >> 2;
138 rSegInfo.Command = EnhancedCustomShapeSegmentCommand::ARC;
139 rSegInfo.Count = ( nSDat & 0xff ) >> 2;
142 rSegInfo.Command = EnhancedCustomShapeSegmentCommand::CLOCKWISEARCTO;
143 rSegInfo.Count = ( nSDat & 0xff ) >> 2;
146 rSegInfo.Command = EnhancedCustomShapeSegmentCommand::CLOCKWISEARC;
147 rSegInfo.Count = ( nSDat & 0xff ) >> 2;
150 rSegInfo.Command = EnhancedCustomShapeSegmentCommand::ELLIPTICALQUADRANTX;
151 rSegInfo.Count = nSDat & 0xff;
154 rSegInfo.Command = EnhancedCustomShapeSegmentCommand::ELLIPTICALQUADRANTY;
155 rSegInfo.Count = nSDat & 0xff;
158 rSegInfo.Command = EnhancedCustomShapeSegmentCommand::NOFILL;
162 rSegInfo.Command = EnhancedCustomShapeSegmentCommand::NOSTROKE;
167 rSegInfo.Command = EnhancedCustomShapeSegmentCommand::UNKNOWN;
168 rSegInfo.Count = nSDat;
178 if ( aEngine.isEmpty() || aEngine ==
"com.sun.star.drawing.EnhancedCustomShapeEngine" )
182 const Any* pAny = rGeometryItem.GetPropertyValueByName(
"Type" );
183 if ( pAny && ( *pAny >>= sShapeType ) )
222 DBG_ASSERT(pRetval,
"ImpCreateShadowObjectClone: Could not clone object (!)");
226 bool bLineUsed(
false);
227 bool bAllFillUsed(
false);
228 bool bSolidFillUsed(
false);
229 bool bGradientFillUsed(
false);
230 bool bHatchFillUsed(
false);
231 bool bBitmapFillUsed(
false);
242 if(drawing::LineStyle_NONE != eLineStyle)
250 if(!bSolidFillUsed && drawing::FillStyle_SOLID == eFillStyle)
252 bSolidFillUsed =
true;
253 bAllFillUsed = (bSolidFillUsed && bGradientFillUsed && bHatchFillUsed && bBitmapFillUsed);
255 if(!bGradientFillUsed && drawing::FillStyle_GRADIENT == eFillStyle)
257 bGradientFillUsed =
true;
258 bAllFillUsed = (bSolidFillUsed && bGradientFillUsed && bHatchFillUsed && bBitmapFillUsed);
260 if(!bHatchFillUsed && drawing::FillStyle_HATCH == eFillStyle)
262 bHatchFillUsed =
true;
263 bAllFillUsed = (bSolidFillUsed && bGradientFillUsed && bHatchFillUsed && bBitmapFillUsed);
265 if(!bBitmapFillUsed && drawing::FillStyle_BITMAP == eFillStyle)
267 bBitmapFillUsed =
true;
268 bAllFillUsed = (bSolidFillUsed && bGradientFillUsed && bHatchFillUsed && bBitmapFillUsed);
274 pRetval->NbcMove(
Size(nXDist, nYDist));
305 if(bGradientFillUsed)
308 sal_uInt8 nStartLuminance(aGradient.GetStartColor().GetLuminance());
309 sal_uInt8 nEndLuminance(aGradient.GetEndColor().GetLuminance());
311 if(aGradient.GetStartIntens() != 100)
313 nStartLuminance =
static_cast<sal_uInt8>(nStartLuminance * (
static_cast<double>(aGradient.GetStartIntens()) / 100.0));
316 if(aGradient.GetEndIntens() != 100)
318 nEndLuminance =
static_cast<sal_uInt8>(nEndLuminance * (
static_cast<double>(aGradient.GetEndIntens()) / 100.0));
322 static_cast<sal_uInt8>((nStartLuminance * aShadowColor.GetRed()) / 256),
323 static_cast<sal_uInt8>((nStartLuminance * aShadowColor.GetGreen()) / 256),
324 static_cast<sal_uInt8>((nStartLuminance * aShadowColor.GetBlue()) / 256));
327 static_cast<sal_uInt8>((nEndLuminance * aShadowColor.GetRed()) / 256),
328 static_cast<sal_uInt8>((nEndLuminance * aShadowColor.GetGreen()) / 256),
329 static_cast<sal_uInt8>((nEndLuminance * aShadowColor.GetBlue()) / 256));
331 aGradient.SetStartColor(aStartColor);
332 aGradient.SetEndColor(aEndColor);
350 BitmapEx aBitmapEx(aGraphicObject.GetGraphic().GetBitmapEx());
352 if(!aBitmapEx.IsEmpty())
355 pVirDev->SetOutputSizePixel(aBitmapEx.GetSizePixel());
357 pVirDev->DrawBitmapEx(
Point(), aBitmapEx);
358 aGraphicObject.SetGraphic(
Graphic(pVirDev->GetBitmapEx(
Point(0,0), aBitmapEx.GetSizePixel())));
366 pRetval->SetMergedItemSet( aTempSet );
378 if ( aEngine.isEmpty() )
379 aEngine =
"com.sun.star.drawing.EnhancedCustomShapeEngine";
386 Sequence< Any > aArgument( 1 );
387 Sequence< PropertyValue > aPropValues( 1 );
388 aPropValues[ 0 ].Name =
"CustomShape";
389 aPropValues[ 0 ].Value <<= aXShape;
390 aArgument[ 0 ] <<= aPropValues;
393 Reference<XInterface> xInterface(xContext->getServiceManager()->createInstanceWithArgumentsAndContext(aEngine, aArgument, xContext));
397 catch (
const css::loader::CannotActivateFactoryException&)
410 if ( xCustomShapeEngine.is() )
411 const_cast<SdrObjCustomShape*>(
this)->mXRenderedCustomShape = xCustomShapeEngine->render();
416 return pRenderedCustomShape;
445 const OUString sTextPath(
"TextPath" );
446 bool bTextPathOn =
false;
450 *pAny >>= bTextPathOn;
458 const OUString
sType(
"Type" );
462 *pAny >>= sShapeType;
470 bool bMirroredX =
false;
474 *pAny >>= bMirroredX;
479 bool bMirroredY =
false;
483 *pAny >>= bMirroredY;
489 PropertyValue aPropVal;
490 aPropVal.Name =
"MirroredX";
491 aPropVal.Value <<= bMirrorX;
498 PropertyValue aPropVal;
499 aPropVal.Name =
"MirroredY";
500 aPropVal.Value <<= bMirrorY;
507 const css::uno::Any* pAny;
509 pAny = rGeometryItem.
GetPropertyValueByName( bPreRotation ? OUString(
"TextPreRotateAngle" ) : OUString(
"TextRotateAngle" ) );
510 double fExtraTextRotateAngle = 0.0;
512 *pAny >>= fExtraTextRotateAngle;
513 return fExtraTextRotateAngle;
521 if ( xCustomShapeEngine.is() )
523 awt::Rectangle aR( xCustomShapeEngine->getTextBounds() );
524 if ( aR.Width > 1 && aR.Height > 1 )
536 if ( xCustomShapeEngine.is() )
538 css::drawing::PolyPolygonBezierCoords aBezierCoords = xCustomShapeEngine->getLineGeometry();
547 catch (
const css::lang::IllegalArgumentException & )
556 std::vector< SdrCustomShapeInteraction > aRet;
560 if ( xCustomShapeEngine.is() )
563 Sequence< Reference< XCustomShapeHandle > > xInteractionHandles( xCustomShapeEngine->getInteraction() );
564 for ( i = 0; i < xInteractionHandles.getLength(); i++ )
566 if ( xInteractionHandles[ i ].is() )
569 aSdrCustomShapeInteraction.
xInteraction = xInteractionHandles[ i ];
570 aSdrCustomShapeInteraction.
aPosition = xInteractionHandles[ i ]->getPosition();
635 aSdrCustomShapeInteraction.
nMode = nMode;
636 aRet.push_back( aSdrCustomShapeInteraction );
641 catch(
const uno::RuntimeException& )
649 #define DEFAULT_MINIMUM_SIGNED_COMPARE (sal_Int32(0x80000000))
650 #define DEFAULT_MAXIMUM_SIGNED_COMPARE (sal_Int32(0x7fffffff))
654 sal_Int32 nPropertiesNeeded=1;
686 return nPropertiesNeeded;
696 css::drawing::EnhancedCustomShapeParameterPair aPosition;
699 rPropValues[ n ].Name =
"Position";
700 rPropValues[ n++ ].Value <<= aPosition;
704 rPropValues[ n ].Name =
"MirroredX";
705 rPropValues[ n++ ].Value <<=
true;
709 rPropValues[ n ].Name =
"MirroredY";
710 rPropValues[ n++ ].Value <<=
true;
714 rPropValues[ n ].Name =
"Switched";
715 rPropValues[ n++ ].Value <<=
true;
719 css::drawing::EnhancedCustomShapeParameterPair aCenter;
724 rPropValues[ n ].Name =
"Polar";
725 rPropValues[ n++ ].Value <<= aCenter;
730 css::drawing::EnhancedCustomShapeParameter aRadiusRangeMinimum;
733 rPropValues[ n ].Name =
"RadiusRangeMinimum";
734 rPropValues[ n++ ].Value <<= aRadiusRangeMinimum;
738 css::drawing::EnhancedCustomShapeParameter aRadiusRangeMaximum;
741 rPropValues[ n ].Name =
"RadiusRangeMaximum";
742 rPropValues[ n++ ].Value <<= aRadiusRangeMaximum;
750 css::drawing::EnhancedCustomShapeParameter aRangeXMinimum;
753 rPropValues[ n ].Name =
"RangeXMinimum";
754 rPropValues[ n++ ].Value <<= aRangeXMinimum;
758 css::drawing::EnhancedCustomShapeParameter aRangeXMaximum;
761 rPropValues[ n ].Name =
"RangeXMaximum";
762 rPropValues[ n++ ].Value <<= aRangeXMaximum;
766 css::drawing::EnhancedCustomShapeParameter aRangeYMinimum;
769 rPropValues[ n ].Name =
"RangeYMinimum";
770 rPropValues[ n++ ].Value <<= aRangeYMinimum;
774 css::drawing::EnhancedCustomShapeParameter aRangeYMaximum;
777 rPropValues[ n ].Name =
"RangeYMaximum";
778 rPropValues[ n++ ].Value <<= aRangeYMaximum;
785 return std::make_unique<sdr::properties::CustomShapeProperties>(*this);
790 , fObjectRotation(0.0)
791 , mbAdjustingTextFrameWidthAndHeight(false)
792 , mpLastShadowGeometry(nullptr)
800 , fObjectRotation(0.0)
801 , mbAdjustingTextFrameWidthAndHeight(false)
802 , mpLastShadowGeometry(nullptr)
821 PropertyValue aPropVal;
823 const OUString
sType(
"Type" );
825 if ( pType && !pType->isEmpty() )
827 sal_Int32
nType = pType->toInt32();
833 aPropVal.Name = sType;
834 aPropVal.Value <<= sShapeType;
841 *pAny >>= sShapeType;
845 const sal_Int32* pDefData =
nullptr;
847 if ( pDefCustomShape )
848 pDefData = pDefCustomShape->
pDefData;
850 css::uno::Sequence< css::drawing::EnhancedCustomShapeAdjustmentValue > seqAdjustmentValues;
855 const OUString sAdjustmentValues(
"AdjustmentValues" );
858 *pAny >>= seqAdjustmentValues;
859 if ( pDefCustomShape && pDefData )
862 sal_Int32
i, nAdjustmentValues = seqAdjustmentValues.getLength();
863 sal_Int32 nAdjustmentDefaults = *pDefData++;
864 if ( nAdjustmentDefaults > nAdjustmentValues )
866 seqAdjustmentValues.realloc( nAdjustmentDefaults );
867 for ( i = nAdjustmentValues; i < nAdjustmentDefaults; i++ )
869 seqAdjustmentValues[ i ].Value <<= pDefData[ i ];
870 seqAdjustmentValues[ i ].State = css::beans::PropertyState_DIRECT_VALUE;
874 sal_Int32
nCount = std::min(nAdjustmentValues, nAdjustmentDefaults);
875 for ( i = 0; i < nCount; i++ )
877 if ( seqAdjustmentValues[ i ].
State != css::beans::PropertyState_DIRECT_VALUE )
879 seqAdjustmentValues[ i ].Value <<= pDefData[ i ];
880 seqAdjustmentValues[ i ].State = css::beans::PropertyState_DIRECT_VALUE;
884 aPropVal.Name = sAdjustmentValues;
885 aPropVal.Value <<= seqAdjustmentValues;
891 const OUString sViewBox(
"ViewBox" );
893 css::awt::Rectangle aViewBox;
894 if ( !pViewBox || !(*pViewBox >>= aViewBox ) )
896 if ( pDefCustomShape )
902 aPropVal.Name = sViewBox;
903 aPropVal.Value <<= aViewBox;
908 const OUString sPath(
"Path" );
913 const OUString sCoordinates(
"Coordinates" );
915 if ( !pAny && pDefCustomShape && pDefCustomShape->
nVertices && pDefCustomShape->
pVertices )
917 css::uno::Sequence< css::drawing::EnhancedCustomShapeParameterPair> seqCoordinates;
920 seqCoordinates.realloc( nCount );
921 for ( i = 0; i < nCount; i++ )
926 aPropVal.Name = sCoordinates;
927 aPropVal.Value <<= seqCoordinates;
932 const OUString sGluePoints(
"GluePoints" );
936 css::uno::Sequence< css::drawing::EnhancedCustomShapeParameterPair> seqGluePoints;
938 seqGluePoints.realloc( nCount );
939 for ( i = 0; i < nCount; i++ )
944 aPropVal.Name = sGluePoints;
945 aPropVal.Value <<= seqGluePoints;
950 const OUString sSegments(
"Segments" );
952 if ( !pAny && pDefCustomShape && pDefCustomShape->
nElements && pDefCustomShape->
pElements )
954 css::uno::Sequence< css::drawing::EnhancedCustomShapeSegment > seqSegments;
957 seqSegments.realloc( nCount );
958 for ( i = 0; i < nCount; i++ )
960 EnhancedCustomShapeSegment& rSegInfo = seqSegments[ i ];
961 sal_uInt16 nSDat = pDefCustomShape->
pElements[ i ];
964 aPropVal.Name = sSegments;
965 aPropVal.Value <<= seqSegments;
970 const OUString sStretchX(
"StretchX" );
972 if ( !pAny && pDefCustomShape )
974 sal_Int32 nXRef = pDefCustomShape->
nXRef;
977 aPropVal.Name = sStretchX;
978 aPropVal.Value <<= nXRef;
984 const OUString sStretchY(
"StretchY" );
986 if ( !pAny && pDefCustomShape )
988 sal_Int32 nYRef = pDefCustomShape->
nYRef;
991 aPropVal.Name = sStretchY;
992 aPropVal.Value <<= nYRef;
998 const OUString sTextFrames(
"TextFrames" );
1000 if ( !pAny && pDefCustomShape && pDefCustomShape->
nTextRect && pDefCustomShape->
pTextRect )
1002 css::uno::Sequence< css::drawing::EnhancedCustomShapeTextFrame > seqTextFrames;
1005 seqTextFrames.realloc( nCount );
1007 for ( i = 0; i < nCount; i++, pRectangles++ )
1014 aPropVal.Name = sTextFrames;
1015 aPropVal.Value <<= seqTextFrames;
1020 const OUString sEquations(
"Equations" );
1024 css::uno::Sequence< OUString > seqEquations;
1027 seqEquations.realloc( nCount );
1029 for ( i = 0; i < nCount; i++, pData++ )
1031 aPropVal.Name = sEquations;
1032 aPropVal.Value <<= seqEquations;
1037 const OUString sHandles(
"Handles" );
1039 if ( !pAny && pDefCustomShape && pDefCustomShape->
nHandles && pDefCustomShape->
pHandles )
1041 css::uno::Sequence< css::beans::PropertyValues > seqHandles;
1045 seqHandles.realloc( nCount );
1046 for ( i = 0; i < nCount; i++, pData++ )
1048 sal_Int32 nPropertiesNeeded;
1049 css::beans::PropertyValues& rPropValues = seqHandles[ i ];
1051 rPropValues.realloc( nPropertiesNeeded );
1054 aPropVal.Name = sHandles;
1055 aPropVal.Value <<= seqHandles;
1058 else if (pAny && sShapeType.startsWith(
"ooxml-") && sShapeType !=
"ooxml-non-primitive")
1064 css::uno::Sequence<css::beans::PropertyValues> seqHandles;
1065 *pAny >>= seqHandles;
1066 bool bChanged(
false);
1067 for (sal_Int32
i = 0;
i < seqHandles.getLength();
i++)
1070 OUString sFirstRefType;
1071 sal_Int32 nFirstAdjRef;
1072 OUString sSecondRefType;
1073 sal_Int32 nSecondAdjRef;
1075 sSecondRefType, nSecondAdjRef);
1076 if (sFirstRefType !=
"na" && 0 <= nFirstAdjRef
1077 && nFirstAdjRef < seqAdjustmentValues.getLength())
1081 if (sSecondRefType !=
"na" && 0 <= nSecondAdjRef
1082 && nSecondAdjRef < seqAdjustmentValues.getLength())
1086 aHandleProps >> seqHandles[i];
1090 aPropVal.Name = sHandles;
1091 aPropVal.Value <<= seqHandles;
1101 bool bIsDefaultGeometry =
false;
1103 OUString sShapeType;
1108 *pAny >>= sShapeType;
1113 const OUString sPath(
"Path" );
1114 switch( eDefaultType )
1119 css::awt::Rectangle aViewBox;
1120 if (pViewBox && (*pViewBox >>= aViewBox) && pDefCustomShape)
1122 if ( ( aViewBox.Width == pDefCustomShape->
nCoordWidth )
1123 && ( aViewBox.Height == pDefCustomShape->
nCoordHeight ) )
1124 bIsDefaultGeometry =
true;
1132 if ( pAny && pDefCustomShape && pDefCustomShape->
nVertices && pDefCustomShape->
pVertices )
1134 css::uno::Sequence< css::drawing::EnhancedCustomShapeParameterPair> seqCoordinates1, seqCoordinates2;
1135 if ( *pAny >>= seqCoordinates1 )
1138 seqCoordinates2.realloc( nCount );
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, seqGluePoints2;
1159 if ( *pAny >>= seqGluePoints1 )
1162 seqGluePoints2.realloc( nCount );
1163 for ( i = 0; i < nCount; i++ )
1168 if ( seqGluePoints1 == seqGluePoints2 )
1169 bIsDefaultGeometry =
true;
1172 else if ( pDefCustomShape && ( pDefCustomShape->
nGluePoints == 0 ) )
1173 bIsDefaultGeometry =
true;
1183 css::uno::Sequence< css::drawing::EnhancedCustomShapeSegment > seqSegments1, seqSegments2;
1184 if ( *pAny >>= seqSegments1 )
1191 seqSegments2.realloc( nCount );
1192 for ( i = 0; i < nCount; i++ )
1194 EnhancedCustomShapeSegment& rSegInfo = seqSegments2[ i ];
1195 sal_uInt16 nSDat = pDefCustomShape->
pElements[ i ];
1198 if ( seqSegments1 == seqSegments2 )
1199 bIsDefaultGeometry =
true;
1205 if ( seqSegments1.getLength() == 4 )
1207 if ( ( seqSegments1[ 0 ].Command == EnhancedCustomShapeSegmentCommand::MOVETO )
1208 && ( seqSegments1[ 1 ].Command == EnhancedCustomShapeSegmentCommand::LINETO )
1209 && ( seqSegments1[ 2 ].Command == EnhancedCustomShapeSegmentCommand::CLOSESUBPATH )
1210 && ( seqSegments1[ 3 ].Command == EnhancedCustomShapeSegmentCommand::ENDSUBPATH ) )
1211 bIsDefaultGeometry =
true;
1216 else if ( pDefCustomShape && ( ( pDefCustomShape->
nElements == 0 ) || ( pDefCustomShape->
pElements == nullptr ) ) )
1217 bIsDefaultGeometry =
true;
1224 if ( pAny && pDefCustomShape )
1226 sal_Int32 nStretchX = 0;
1227 if ( *pAny >>= nStretchX )
1229 if ( pDefCustomShape->
nXRef == nStretchX )
1230 bIsDefaultGeometry =
true;
1234 bIsDefaultGeometry =
true;
1241 if ( pAny && pDefCustomShape )
1243 sal_Int32 nStretchY = 0;
1244 if ( *pAny >>= nStretchY )
1246 if ( pDefCustomShape->
nYRef == nStretchY )
1247 bIsDefaultGeometry =
true;
1251 bIsDefaultGeometry =
true;
1260 css::uno::Sequence< OUString > seqEquations1, seqEquations2;
1261 if ( *pAny >>= seqEquations1 )
1264 seqEquations2.realloc( nCount );
1267 for ( i = 0; i < nCount; i++, pData++ )
1270 if ( seqEquations1 == seqEquations2 )
1271 bIsDefaultGeometry =
true;
1274 else if ( pDefCustomShape && ( ( pDefCustomShape->
nCalculation == 0 ) || ( pDefCustomShape->
pCalculation ==
nullptr ) ) )
1275 bIsDefaultGeometry =
true;
1282 if ( pAny && pDefCustomShape && pDefCustomShape->
nTextRect && pDefCustomShape->
pTextRect )
1284 css::uno::Sequence< css::drawing::EnhancedCustomShapeTextFrame > seqTextFrames1, seqTextFrames2;
1285 if ( *pAny >>= seqTextFrames1 )
1288 seqTextFrames2.realloc( nCount );
1290 for ( i = 0; i < nCount; i++, pRectangles++ )
1297 if ( seqTextFrames1 == seqTextFrames2 )
1298 bIsDefaultGeometry =
true;
1301 else if ( pDefCustomShape && ( ( pDefCustomShape->
nTextRect == 0 ) || ( pDefCustomShape->
pTextRect ==
nullptr ) ) )
1302 bIsDefaultGeometry =
true;
1306 return bIsDefaultGeometry;
1328 if ( !pRenderedCustomShape )
1336 while(aIterator.
IsMore())
1384 bool bChanged(
false);
1386 if(bResizeShapeToFitText)
1480 if ( pRenderedCustomShape )
1485 pRenderedCustomShape->
NbcMove( rSiz );
1519 for (
const auto& rInteraction : aInteractionHandles)
1524 rInteraction.xInteraction->setControllerPosition( rInteraction.aPosition );
1527 sal_Int32 nX = ( rInteraction.aPosition.X - aOld.
Left() ) +
maRect.
Left();
1528 rInteraction.xInteraction->setControllerPosition( css::awt::Point( nX, rInteraction.xInteraction->getPosition().Y ) );
1533 rInteraction.xInteraction->setControllerPosition( css::awt::Point( nX, rInteraction.xInteraction->getPosition().Y ) );
1537 sal_Int32 nY = ( rInteraction.aPosition.Y - aOld.
Top() ) +
maRect.
Top();
1538 rInteraction.xInteraction->setControllerPosition( css::awt::Point( rInteraction.xInteraction->getPosition().X, nY ) );
1541 catch (
const uno::RuntimeException& )
1548 double fAngle =
toDegrees(nTextObjRotation);
1598 cos( nW * F_PI18000 ) );
1644 double fAngle =
toDegrees(nTextObjRotation);
1672 double fAngle =
toDegrees(nTextObjRotation);
1732 if(!(pSource && pSource->
GetCount()))
1748 for(a = 0; a < pSource->
GetCount(); a++)
1766 sal_uInt16 nPointCount=aPoly.
GetSize();
1767 for (sal_uInt16
i=0;
i<nPointCount;
i++)
1775 sal_Int32 nYDiff = aBoundRect.Top() -
maRect.
Top();
1777 if (nShearAngle && bMirroredX != bMirroredY)
1779 nShearAngle = -nShearAngle;
1784 for ( a = 0; a < aNewList.
GetCount(); a++ )
1797 aGlue.AdjustX( -nXDiff );
1798 aGlue.AdjustY( -nYDiff );
1803 for(a = 0; a < pList->
GetCount(); a++)
1809 aNewList.
Insert(rCandidate);
1855 int nCustomShapeHdlNum = 0;
1858 if ( rInteraction.xInteraction.is() )
1862 css::awt::Point aPosition( rInteraction.xInteraction->getPosition() );
1864 pH->SetPointNum( nCustomShapeHdlNum );
1865 pH->SetObj( const_cast<SdrObjCustomShape*>(
this) );
1866 rHdlList.
AddHdl(std::move(pH));
1868 catch (
const uno::RuntimeException& )
1872 ++nCustomShapeHdlNum;
1937 aNewRect.
SetPos( aNewPos );
1939 if ( aNewRect ==
maRect )
1945 if ( rNewRect.
Left() > rNewRect.
Right() )
1948 Point aBottom( aTop.X(), aTop.Y() + 1000 );
1951 if ( rNewRect.
Top() > rNewRect.
Bottom() )
1954 Point aRight( aLeft.X() + 1000, aLeft.Y() );
1958 for (
const auto& rInteraction : aInteractionHandles)
1963 rInteraction.xInteraction->setControllerPosition( rInteraction.aPosition );
1968 bOldMirroredX = !bOldMirroredX;
1971 if ( bOldMirroredX )
1973 nX = ( rInteraction.aPosition.X - aOld.
Right() );
1974 if ( rNewRect.
Left() > rNewRect.
Right() )
1981 nX = ( rInteraction.aPosition.X - aOld.
Left() );
1982 if ( rNewRect.
Left() > rNewRect.
Right() )
1987 rInteraction.xInteraction->setControllerPosition( css::awt::Point( nX, rInteraction.xInteraction->getPosition().Y ) );
1992 if ( bOldMirroredY )
1994 nY = ( rInteraction.aPosition.Y - aOld.
Bottom() );
1995 if ( rNewRect.
Top() > rNewRect.
Bottom() )
2002 nY = ( rInteraction.aPosition.Y - aOld.
Top() );
2003 if ( rNewRect.
Top() > rNewRect.
Bottom() )
2008 rInteraction.xInteraction->setControllerPosition( css::awt::Point( rInteraction.xInteraction->getPosition().X, nY ) );
2011 catch (
const uno::RuntimeException& )
2018 const sal_uInt16 nCustomShapeHdlNum,
bool bMoveCalloutRectangle )
2021 if ( nCustomShapeHdlNum >= aInteractionHandles.size() )
2030 css::awt::Point aPt( rDestination.X(), rDestination.Y() );
2033 sal_Int32 nXDiff = aPt.X - aInteractionHandle.
aPosition.X;
2034 sal_Int32 nYDiff = aPt.Y - aInteractionHandle.
aPosition.Y;
2042 for (
const auto& rInteraction : aInteractionHandles)
2046 if ( rInteraction.xInteraction.is() )
2047 rInteraction.xInteraction->setControllerPosition( rInteraction.aPosition );
2051 aInteractionHandle.
xInteraction->setControllerPosition( aPt );
2053 catch (
const uno::RuntimeException& )
2106 constexpr sal_uInt32 nDefaultObjectSizeWidth = 3000;
2107 constexpr sal_uInt32 nDefaultObjectSizeHeight= 3000;
2115 if ( !aInteractionHandles.empty() )
2117 sal_Int32 nHandlePos = aInteractionHandles[ aInteractionHandles.size() - 1 ].xInteraction->getPosition().X;
2126 for (
const auto& rInteraction : aInteractionHandles)
2131 rInteraction.xInteraction->setControllerPosition( awt::Point( rStat.
GetStart().X(), rStat.
GetStart().Y() ) );
2133 catch (
const uno::RuntimeException& )
2178 return bIsAutoGrowHeight;
2186 return bIsAutoGrowWidth;
2199 DBG_ASSERT( pOutlinerParaObject,
"SdrTextObj::SetVerticalWriting() without OutlinerParaObject!" );
2201 if( !pOutlinerParaObject ||
2202 (pOutlinerParaObject->
IsVertical() == bVertical) )
2242 if ( pOutlinerParaObject )
2259 if ( bHasText && !rR.
IsEmpty() )
2263 if ( bWdtGrow || bHgtGrow )
2269 Size aMaxSiz(100000,100000);
2277 if (nMaxWdt==0 || nMaxWdt>aMaxSiz.
Width()) nMaxWdt=aMaxSiz.
Width();
2278 if (nMinWdt<=0) nMinWdt=1;
2279 aSiz.setWidth(nMaxWdt );
2285 if (nMaxHgt==0 || nMaxHgt>aMaxSiz.
Height()) nMaxHgt=aMaxSiz.
Height();
2286 if (nMinHgt<=0) nMinHgt=1;
2287 aSiz.setHeight(nMaxHgt );
2291 aSiz.AdjustWidth( -nHDist );
2292 aSiz.AdjustHeight( -nVDist );
2293 if ( aSiz.Width() < 2 )
2295 if ( aSiz.Height() < 2 )
2296 aSiz.setHeight( 2 );
2306 nWdt=aSiz2.
Width()+1;
2307 if (bHgtGrow) nHgt=aSiz2.Height()+1;
2320 if( pOutlinerParaObject !=
nullptr )
2322 rOutliner.
SetText(*pOutlinerParaObject);
2328 nWdt=aSiz2.
Width()+1;
2330 nHgt=aSiz2.Height()+1;
2342 if ( nWdt < nMinWdt )
2344 if ( nWdt > nMaxWdt )
2349 if ( nHgt < nMinHgt )
2351 if ( nHgt > nMaxHgt )
2358 if ( nWdtGrow == 0 )
2360 if ( nHgtGrow == 0 )
2407 rR.
Move(aD2.X(),aD2.Y());
2428 if (aAdjustedTextRect != aNewTextRect && aOldTextRect != aAdjustedTextRect &&
2432 double fXScale =
static_cast<double>(aOldTextRect.
GetWidth()) / static_cast<double>(aNewTextRect.
GetWidth());
2433 double fYScale =
static_cast<double>(aOldTextRect.
GetHeight()) / static_cast<double>(aNewTextRect.
GetHeight());
2434 double fRightDiff =
static_cast<double>( aAdjustedTextRect.
Right() - aNewTextRect.
Right() ) * fXScale;
2435 double fLeftDiff =
static_cast<double>( aAdjustedTextRect.
Left() - aNewTextRect.
Left() ) * fXScale;
2436 double fTopDiff =
static_cast<double>( aAdjustedTextRect.
Top() - aNewTextRect.
Top() ) * fYScale;
2437 double fBottomDiff=
static_cast<double>( aAdjustedTextRect.
Bottom()- aNewTextRect.
Bottom()) * fYScale;
2438 aReturnValue.
AdjustLeft(static_cast<sal_Int32>(fLeftDiff) );
2439 aReturnValue.
AdjustRight(static_cast<sal_Int32>(fRightDiff) );
2440 aReturnValue.
AdjustTop(static_cast<sal_Int32>(fTopDiff) );
2441 aReturnValue.
AdjustBottom(static_cast<sal_Int32>(fBottomDiff) );
2444 return aReturnValue;
2450 const bool bRet = !aNewTextRect.
IsEmpty() && aNewTextRect !=
maRect;
2462 for (
const auto& rInteraction : aInteractionHandles)
2467 rInteraction.xInteraction->setControllerPosition( rInteraction.aPosition );
2469 catch (
const uno::RuntimeException& )
2483 bool bRet = !aNewTextRect.
IsEmpty() && ( aNewTextRect !=
maRect );
2496 for (
const auto& rInteraction : aInteractionHandles)
2501 rInteraction.xInteraction->setControllerPosition( rInteraction.aPosition );
2503 catch (
const uno::RuntimeException& )
2517 Size aPaperMin,aPaperMax;
2524 Point aCenter0(aCenter);
2527 aViewInit.
Move(aCenter.X(),aCenter.Y());
2530 aAnkSiz.
AdjustWidth( -1 ); aAnkSiz.AdjustHeight( -1 );
2531 Size aMaxSiz(1000000,1000000);
2544 if (nMinWdt<1) nMinWdt=1;
2545 if (nMinHgt<1) nMinHgt=1;
2546 if ( nMaxWdt == 0 || nMaxWdt > aMaxSiz.
Width() )
2547 nMaxWdt = aMaxSiz.
Width();
2548 if ( nMaxHgt == 0 || nMaxHgt > aMaxSiz.
Height() )
2549 nMaxHgt=aMaxSiz.
Height();
2555 nMaxHgt = aAnkSiz.Height();
2560 nMaxWdt = aAnkSiz.Width();
2572 *pViewMin = aViewInit;
2601 if (pPaperMin!=
nullptr) *pPaperMin=aPaperMin;
2602 if (pPaperMax!=
nullptr) *pPaperMax=aPaperMax;
2603 if (pViewInit!=
nullptr) *pViewInit=aViewInit;
2629 rAnchorRect.
SetPos( aP );
2647 sal_Int32 nMaxAutoPaperWidth = 1000000;
2648 sal_Int32 nMaxAutoPaperHeight= 1000000;
2656 nMaxAutoPaperHeight = nAnkHgt;
2658 nMaxAutoPaperWidth = nAnkWdt;
2682 if( !pTestObj || !bHitTest || pTestObj !=
this ||
2696 if (
pEdtOutl && !bNoEditText && pPara)
2747 aTextPos.AdjustX(nFreeWdt/2 );
2749 aTextPos.AdjustX(nFreeWdt );
2755 aTextPos.AdjustY(nFreeHgt/2 );
2757 aTextPos.AdjustY(nFreeHgt );
2763 *pAnchorRect=aAnkRect;
2784 OUStringBuffer
sName(
SvxResId(STR_ObjNameSingulCUSTOMSHAPE));
2793 return sName.makeStringAndClear();
2798 return SvxResId(STR_ObjNamePluralCUSTOMSHAPE);
2818 SdrObject* pRenderedCustomShape =
nullptr;
2831 if ( pRenderedCustomShape )
2835 DBG_ASSERT(pCandidate,
"SdrObjCustomShape::DoConvertToPolyObj: Could not clone SdrObject (!)");
2869 if(
nullptr != pNewPage)
2881 return std::make_unique<SdrAShapeObjGeoData>();
2906 PropertyValue aPropVal;
2907 aPropVal.Name =
"AdjustmentValues";
2917 SAL_INFO_IF(bShrinkOnly,
"svx",
"Case bShrinkOnly == true is not implemented yet.");
2932 double fRotate, fShearX;
2933 aMatrix.
decompose(aScale, aTranslate, fRotate, fShearX);
2946 double fPolygonWidth = aB2DRange.
getWidth();
2947 if (fPolygonWidth == 0)
2949 double fPolygonHeight = aB2DRange.getHeight();
2950 if (fPolygonHeight == 0)
2952 const double aFactorX =
static_cast<double>(rMaxRect.
GetWidth()) / fPolygonWidth;
2953 const double aFactorY =
static_cast<double>(rMaxRect.
GetHeight()) / fPolygonHeight;
2956 aMathMatrix.
scale(aFactorX, aFactorY);
2960 const double fPolygonLeft = aB2DRange.
getMinX();
2961 const double fPolygonTop = aB2DRange.getMinY();
2962 aMathMatrix.
translate(rMaxRect.
getX() - fPolygonLeft, rMaxRect.
getY() - fPolygonTop);
2965 aMathMatrix.
decompose(aScale, aTranslate, fRotate, fShearX);
2984 if (bIsMirroredX || bIsMirroredY)
2989 Mirror(aCurrentCenter,
Point(aCurrentCenter.X(), aCurrentCenter.Y() + 1000));
2993 Mirror(aCurrentCenter,
Point(aCurrentCenter.X() + 1000, aCurrentCenter.Y()));
3000 double fRotate, fShearX;
3001 rMatrix.
decompose(aScale, aTranslate, fRotate, fShearX);
3022 if( !aSize.Height() ) aSize.
setHeight( 1 );
3023 if( !aSize.Width() ) aSize.setWidth( 1 );
3065 if (!(bIsMirroredX || bIsMirroredY))
3071 if (aScale.
getX() > 2.0 && aScale.
getY() > 2.0)
3078 aCenter = aMathMat * aCenter;
3079 double fCenterX = aCenter.
getX();
3080 double fCenterY = aCenter.getY();
3101 if ( bMirroredX || bMirroredY )
3112 Point aRef1( ( aBoundRect.Left() + aBoundRect.Right() ) >> 1, aBoundRect.Top() );
3113 Point aRef2( aRef1.X(), aRef1.Y() + 1000 );
3115 sal_uInt16 nPointCount=aPol.
GetSize();
3116 for (i=0; i<nPointCount; i++)
3135 Point aRef1( aBoundRect.Left(), ( aBoundRect.Top() + aBoundRect.Bottom() ) >> 1 );
3136 Point aRef2( aRef1.X() + 1000, aRef1.Y() );
3138 sal_uInt16 nPointCount=aPol.
GetSize();
3139 for (i=0; i<nPointCount; i++)
3179 return std::make_unique<sdr::contact::ViewContactOfSdrObjCustomShape>(*this);
3185 bool bRetval(
false);
3187 if(rName.equalsIgnoreAsciiCase(
"quadrat"))
3191 else if(rName.equalsIgnoreAsciiCase(
"round-quadrat"))
3195 else if(rName.equalsIgnoreAsciiCase(
"circle"))
3199 else if(rName.equalsIgnoreAsciiCase(
"circle-pie"))
3203 else if(rName.equalsIgnoreAsciiCase(
"ring"))
3230 OUString sShapeName;
3232 if ( aEngine.isEmpty()
3233 || aEngine ==
"com.sun.star.drawing.EnhancedCustomShapeEngine" )
3235 OUString sShapeType;
3238 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)
double toDegrees(Degree10 x)
void SetPropertyValue(const css::beans::PropertyValue &rPropVal)
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)
uno::Reference< drawing::XShape > GetXShapeForSdrObject(SdrObject *pObj)
returns a StarOffice API wrapper for the given SdrObject
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)
SdrObjUserCall * pUserCall
void ForceOutlinerParaObject()
B2DPolygon const & createUnitPolygon()
std::unique_ptr< ContentProperties > pData
sal_Int32 ImpGetLineWdt() const
Detects the width of the line. No line ->0.
tools::Long GetDY() const
constexpr TypedWhichId< SdrOnOffItem > SDRATTR_TEXT_AUTOGROWWIDTH(SDRATTR_MISC_FIRST+12)
const Point & GetStart() const
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)
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
double toRadians(Degree10 x)
tools::Long GetMinTextFrameHeight() const
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...
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
constexpr double rad2deg(double v)
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
bool IsCustomShapeFilledByDefault(MSO_SPT eSpType)
tools::Long GetMaxTextFrameHeight() 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)
OUString SvxResId(const char *pId)
const BorderLinePrimitive2D *pCandidateB assert(pCandidateA)
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.
Degree10 toDegree10(Degree100 x)
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 TakeCreateRect(tools::Rectangle &rRect) const
tools::Long GetMaxTextFrameWidth() const
Degree100 NormAngle36000(Degree100 deg100)
Normalize angle to -180.00..179.99.
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
virtual void impl_setUnoShape(const css::uno::Reference< css::uno::XInterface > &rxUnoShape) override
Sets a new UNO shape.
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
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 NbcSetOutlinerParaObject(std::unique_ptr< OutlinerParaObject > pTextObject) override
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
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)
bool decompose(B2DTuple &rScale, B2DTuple &rTranslate, double &rRotate, double &rShearX) const
tools::Long FRound(double fVal)
void SetVertical(bool bNew)
tools::Rectangle aOutRect
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
void GetOOXHandleAdjRelation(const OUString &sFullOOXShapeName, const sal_Int32 nHandleIndex, OUString &rFirstRefType, sal_Int32 &rFirstAdjValueIndex, OUString &rSecondRefType, sal_Int32 &rSecondAdjValueIndex)
virtual void TakeTextEditArea(Size *pPaperMin, Size *pPaperMax, tools::Rectangle *pViewInit, tools::Rectangle *pViewMin) const override
virtual void NbcSetStyleSheet(SfxStyleSheet *pNewStyleSheet, bool bDontRemoveHardAttr) 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
virtual void impl_setUnoShape(const css::uno::Reference< css::uno::XInterface > &_rxUnoShape)
Sets a new UNO shape.
SdrView * GetView() const
tools::Long Width() const
bool IsDefaultGeometry(const DefaultType eDefaultType) const
virtual basegfx::B2DPolyPolygon TakeContour() const
contour for TextToContour
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.
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)
constexpr double deg2rad(double v)
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
bool IsShiftPressed() const
css::uno::Reference< css::drawing::XCustomShapeHandle > xInteraction
SfxItemPool * GetPool() const
virtual void SetSnapRect(const tools::Rectangle &rRect) override
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
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 void NbcSetOutlinerParaObject(std::unique_ptr< OutlinerParaObject > pTextObject) override
virtual const tools::Rectangle & GetLastBoundRect() const
void CheckPortionInfo(SdrOutliner &rOutliner)
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)
std::unique_ptr< OutlinerParaObject > CreateParaObject(sal_Int32 nStartPara=0, sal_Int32 nParaCount=EE_PARA_ALL) const
virtual void NbcRotate(const Point &rRef, Degree100 nAngle, double sn, double cs) override
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
const SfxPoolItem & Get(sal_uInt16 nWhich, bool bSrchInParent=true) 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)
tools::Long Height() const
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
void SetUpdateMode(bool bUpdate)
void translate(double fX, double fY)
static bool ImpVerticalSwitch(const SdrObjCustomShape &rCustoShape)
constexpr TypedWhichId< SdrTextFixedCellHeightItem > SDRATTR_TEXT_USEFIXEDCELLHEIGHT(SDRATTR_MISC_FIRST+23)
const Point & GetAnchorPos() const
virtual OUString TakeObjNamePlural() const override
css::uno::Any * GetPropertyValueByName(const OUString &rPropName)
virtual void Rotate(const Point &rRef, Degree100 nAngle, double sn, double cs)
std::unique_ptr< SdrObjPlusData > pPlusData
virtual void SetRectsDirty(bool bNotMyself=false, bool bRecursive=true)
Universal Network Object packed into SvDraw object.
void setHeight(tools::Long nHeight)
SVX_DLLPRIVATE void DragResizeCustomShape(const tools::Rectangle &rNewRect)
SVXCORE_DLLPUBLIC OUString GetAccName(const OUString &)
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
static bool doConstructOrthogonal(const OUString &rName)
A SdrPage contains exactly one SdrObjList and a description of the physical page dimensions (size / m...
const SdrTextObj * GetTextObj() const
virtual void NbcSetStyleSheet(SfxStyleSheet *pNewStyleSheet, bool bDontRemoveHardAttr)
bool areControlPointsUsed() const
SdrObject * GetSdrObjectFromXShape(const uno::Reference< drawing::XShape > &xShape)
returns the SdrObject from the given StarOffice API wrapper
virtual SdrGluePointList * ForceGluePointList() override
virtual void SetChanged()
sal_uLong GetTextHeight() const
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
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
virtual const tools::Rectangle & GetLogicRect() const override
virtual ~SdrObjCustomShape() override
const Size & GetPaperSize() const
void InvalidateRenderGeometry()