diff options
Diffstat (limited to 'svx/source/customshapes')
-rw-r--r-- | svx/source/customshapes/EnhancedCustomShape2d.cxx | 3053 | ||||
-rw-r--r-- | svx/source/customshapes/EnhancedCustomShape3d.cxx | 1037 | ||||
-rw-r--r-- | svx/source/customshapes/EnhancedCustomShape3d.hxx | 37 | ||||
-rw-r--r-- | svx/source/customshapes/EnhancedCustomShapeEngine.cxx | 488 | ||||
-rw-r--r-- | svx/source/customshapes/EnhancedCustomShapeFontWork.cxx | 956 | ||||
-rw-r--r-- | svx/source/customshapes/EnhancedCustomShapeFontWork.hxx | 42 | ||||
-rw-r--r-- | svx/source/customshapes/EnhancedCustomShapeFunctionParser.cxx | 1164 | ||||
-rw-r--r-- | svx/source/customshapes/EnhancedCustomShapeGeometry.cxx | 8567 | ||||
-rw-r--r-- | svx/source/customshapes/EnhancedCustomShapeHandle.cxx | 91 | ||||
-rw-r--r-- | svx/source/customshapes/EnhancedCustomShapeHandle.hxx | 57 | ||||
-rw-r--r-- | svx/source/customshapes/EnhancedCustomShapeTypeNames.cxx | 548 |
11 files changed, 16040 insertions, 0 deletions
diff --git a/svx/source/customshapes/EnhancedCustomShape2d.cxx b/svx/source/customshapes/EnhancedCustomShape2d.cxx new file mode 100644 index 000000000..87c081628 --- /dev/null +++ b/svx/source/customshapes/EnhancedCustomShape2d.cxx @@ -0,0 +1,3053 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#include <sal/config.h> + +#include <o3tl/string_view.hxx> +#include <svx/EnhancedCustomShape2d.hxx> +#include <svx/EnhancedCustomShapeGeometry.hxx> +#include <svx/EnhancedCustomShapeTypeNames.hxx> +#include <svx/svdoashp.hxx> +#include <svx/svdtrans.hxx> +#include <svx/svdogrp.hxx> +#include <svx/svdopath.hxx> +#include <svx/svdorect.hxx> +#include <svx/svdpage.hxx> +#include <svx/xflclit.hxx> +#include <svx/xfillit0.hxx> +#include <svx/xlineit0.hxx> +#include <svx/xlnstit.hxx> +#include <svx/xlnedit.hxx> +#include <svx/xlnstwit.hxx> +#include <svx/xlnedwit.hxx> +#include <svx/xlnstcit.hxx> +#include <svx/xlnedcit.hxx> +#include <svx/xflgrit.hxx> +#include <svx/xflhtit.hxx> +#include <svx/xbtmpit.hxx> +#include <svx/xgrad.hxx> +#include <svx/xhatch.hxx> +#include <svx/sdshitm.hxx> +#include <com/sun/star/awt/Size.hpp> +#include <com/sun/star/drawing/EnhancedCustomShapeParameterType.hpp> +#include <com/sun/star/drawing/EnhancedCustomShapeSegmentCommand.hpp> +#include <com/sun/star/drawing/EnhancedCustomShapeAdjustmentValue.hpp> +#include <com/sun/star/drawing/EnhancedCustomShapeSegment.hpp> +#include <com/sun/star/drawing/EnhancedCustomShapeTextFrame.hpp> +#include <basegfx/numeric/ftools.hxx> +#include <basegfx/color/bcolortools.hxx> +#include <basegfx/polygon/b2dpolygon.hxx> +#include <basegfx/polygon/b2dpolygontools.hxx> +#include <basegfx/matrix/b2dhommatrixtools.hxx> +#include <sal/log.hxx> + +#include <algorithm> +#include <cstdlib> +#include <string_view> +#include <unordered_set> + +using namespace ::com::sun::star; +using namespace ::com::sun::star::uno; +using namespace ::com::sun::star::drawing; +using namespace ::com::sun::star::drawing::EnhancedCustomShapeSegmentCommand; + +void EnhancedCustomShape2d::SetEnhancedCustomShapeParameter( EnhancedCustomShapeParameter& rParameter, const sal_Int32 nValue ) +{ + sal_uInt32 nDat = static_cast<sal_uInt32>(nValue); + sal_Int32 nNewValue = nValue; + + // check if this is a special point + if ( ( nDat >> 16 ) == 0x8000 ) + { + nNewValue = static_cast<sal_uInt16>(nDat); + rParameter.Type = EnhancedCustomShapeParameterType::EQUATION; + } + else + rParameter.Type = EnhancedCustomShapeParameterType::NORMAL; + rParameter.Value <<= nNewValue; +} + +OUString EnhancedCustomShape2d::GetEquation( const sal_uInt16 nFlags, sal_Int32 nP1, sal_Int32 nP2, sal_Int32 nP3 ) +{ + OUString aEquation; + bool b1Special = ( nFlags & 0x2000 ) != 0; + bool b2Special = ( nFlags & 0x4000 ) != 0; + bool b3Special = ( nFlags & 0x8000 ) != 0; + switch( nFlags & 0xff ) + { + case 0 : + case 14 : + { + sal_Int32 nOptimize = 0; + if ( nP1 ) + nOptimize |= 1; + if ( nP2 ) + nOptimize |= 2; + if ( b1Special ) + nOptimize |= 4; + if ( b2Special ) + nOptimize |= 8; + switch( nOptimize ) + { + case 0 : + break; + case 1 : + case 4 : + case 5 : + EnhancedCustomShape2d::AppendEnhancedCustomShapeEquationParameter( aEquation, nP1, b1Special ); + break; + case 2 : + case 8 : + case 10: + EnhancedCustomShape2d::AppendEnhancedCustomShapeEquationParameter( aEquation, nP2, b2Special ); + break; + default : + { + EnhancedCustomShape2d::AppendEnhancedCustomShapeEquationParameter( aEquation, nP1, b1Special ); + aEquation += "+"; + EnhancedCustomShape2d::AppendEnhancedCustomShapeEquationParameter( aEquation, nP2, b2Special ); + } + break; + } + if ( b3Special || nP3 ) + { + aEquation += "-"; + EnhancedCustomShape2d::AppendEnhancedCustomShapeEquationParameter( aEquation, nP3, b3Special ); + } + } + break; + case 1 : + { + EnhancedCustomShape2d::AppendEnhancedCustomShapeEquationParameter( aEquation, nP1, b1Special ); + if ( b2Special || ( nP2 != 1 ) ) + { + aEquation += "*"; + EnhancedCustomShape2d::AppendEnhancedCustomShapeEquationParameter( aEquation, nP2, b2Special ); + } + if ( b3Special || ( ( nP3 != 1 ) && ( nP3 != 0 ) ) ) + { + aEquation += "/"; + EnhancedCustomShape2d::AppendEnhancedCustomShapeEquationParameter( aEquation, nP3, b3Special ); + } + } + break; + case 2 : + { + aEquation += "("; + EnhancedCustomShape2d::AppendEnhancedCustomShapeEquationParameter( aEquation, nP1, b1Special ); + aEquation += "+"; + EnhancedCustomShape2d::AppendEnhancedCustomShapeEquationParameter( aEquation, nP2, b2Special ); + aEquation += ")/2"; + } + break; + case 3 : + { + aEquation += "abs("; + EnhancedCustomShape2d::AppendEnhancedCustomShapeEquationParameter( aEquation, nP1, b1Special ); + aEquation += ")"; + } + break; + case 4 : + { + aEquation += "min("; + EnhancedCustomShape2d::AppendEnhancedCustomShapeEquationParameter( aEquation, nP1, b1Special ); + aEquation += ","; + EnhancedCustomShape2d::AppendEnhancedCustomShapeEquationParameter( aEquation, nP2, b2Special ); + aEquation += ")"; + } + break; + case 5 : + { + aEquation += "max("; + EnhancedCustomShape2d::AppendEnhancedCustomShapeEquationParameter( aEquation, nP1, b1Special ); + aEquation += ","; + EnhancedCustomShape2d::AppendEnhancedCustomShapeEquationParameter( aEquation, nP2, b2Special ); + aEquation += ")"; + } + break; + case 6 : + { + aEquation += "if("; + EnhancedCustomShape2d::AppendEnhancedCustomShapeEquationParameter( aEquation, nP1, b1Special ); + aEquation += ","; + EnhancedCustomShape2d::AppendEnhancedCustomShapeEquationParameter( aEquation, nP2, b2Special ); + aEquation += ","; + EnhancedCustomShape2d::AppendEnhancedCustomShapeEquationParameter( aEquation, nP3, b3Special ); + aEquation += ")"; + } + break; + case 7 : + { + aEquation += "sqrt("; + EnhancedCustomShape2d::AppendEnhancedCustomShapeEquationParameter( aEquation, nP1, b1Special ); + aEquation += "*"; + EnhancedCustomShape2d::AppendEnhancedCustomShapeEquationParameter( aEquation, nP1, b1Special ); + aEquation += "+"; + EnhancedCustomShape2d::AppendEnhancedCustomShapeEquationParameter( aEquation, nP2, b2Special ); + aEquation += "*"; + EnhancedCustomShape2d::AppendEnhancedCustomShapeEquationParameter( aEquation, nP2, b2Special ); + aEquation += "+"; + EnhancedCustomShape2d::AppendEnhancedCustomShapeEquationParameter( aEquation, nP3, b3Special ); + aEquation += "*"; + EnhancedCustomShape2d::AppendEnhancedCustomShapeEquationParameter( aEquation, nP3, b3Special ); + aEquation += ")"; + } + break; + case 8 : + { + aEquation += "atan2("; + EnhancedCustomShape2d::AppendEnhancedCustomShapeEquationParameter( aEquation, nP2, b2Special ); + aEquation += ","; + EnhancedCustomShape2d::AppendEnhancedCustomShapeEquationParameter( aEquation, nP1, b1Special ); + aEquation += ")/(pi/180)"; + } + break; + case 9 : + { + EnhancedCustomShape2d::AppendEnhancedCustomShapeEquationParameter( aEquation, nP1, b1Special ); + aEquation += "*sin("; + EnhancedCustomShape2d::AppendEnhancedCustomShapeEquationParameter( aEquation, nP2, b2Special ); + aEquation += "*(pi/180))"; + } + break; + case 10 : + { + EnhancedCustomShape2d::AppendEnhancedCustomShapeEquationParameter( aEquation, nP1, b1Special ); + aEquation += "*cos("; + EnhancedCustomShape2d::AppendEnhancedCustomShapeEquationParameter( aEquation, nP2, b2Special ); + aEquation += "*(pi/180))"; + } + break; + case 11 : + { + EnhancedCustomShape2d::AppendEnhancedCustomShapeEquationParameter( aEquation, nP1, b1Special ); + aEquation += "*cos(atan2("; + EnhancedCustomShape2d::AppendEnhancedCustomShapeEquationParameter( aEquation, nP3, b3Special ); + aEquation += ","; + EnhancedCustomShape2d::AppendEnhancedCustomShapeEquationParameter( aEquation, nP2, b2Special ); + aEquation += "))"; + } + break; + case 12 : + { + EnhancedCustomShape2d::AppendEnhancedCustomShapeEquationParameter( aEquation, nP1, b1Special ); + aEquation += "*sin(atan2("; + EnhancedCustomShape2d::AppendEnhancedCustomShapeEquationParameter( aEquation, nP3, b3Special ); + aEquation += ","; + EnhancedCustomShape2d::AppendEnhancedCustomShapeEquationParameter( aEquation, nP2, b2Special ); + aEquation += "))"; + } + break; + case 13 : + { + aEquation += "sqrt("; + EnhancedCustomShape2d::AppendEnhancedCustomShapeEquationParameter( aEquation, nP1, b1Special ); + aEquation += ")"; + } + break; + case 15 : + { + EnhancedCustomShape2d::AppendEnhancedCustomShapeEquationParameter( aEquation, nP3, b3Special ); + aEquation += "*sqrt(1-("; + EnhancedCustomShape2d::AppendEnhancedCustomShapeEquationParameter( aEquation, nP1, b1Special ); + aEquation += "/"; + EnhancedCustomShape2d::AppendEnhancedCustomShapeEquationParameter( aEquation, nP2, b2Special ); + aEquation += ")" + "*("; + EnhancedCustomShape2d::AppendEnhancedCustomShapeEquationParameter( aEquation, nP1, b1Special ); + aEquation += "/"; + EnhancedCustomShape2d::AppendEnhancedCustomShapeEquationParameter( aEquation, nP2, b2Special ); + aEquation += "))"; + } + break; + case 16 : + { + EnhancedCustomShape2d::AppendEnhancedCustomShapeEquationParameter( aEquation, nP1, b1Special ); + aEquation += "*tan("; + EnhancedCustomShape2d::AppendEnhancedCustomShapeEquationParameter( aEquation, nP2, b2Special ); + aEquation += ")"; + } + break; + case 0x80 : + { + aEquation += "sqrt("; + EnhancedCustomShape2d::AppendEnhancedCustomShapeEquationParameter( aEquation, nP3, b3Special ); + aEquation += "*"; + EnhancedCustomShape2d::AppendEnhancedCustomShapeEquationParameter( aEquation, nP3, b3Special ); + aEquation += "-"; + EnhancedCustomShape2d::AppendEnhancedCustomShapeEquationParameter( aEquation, nP1, b1Special ); + aEquation += "*"; + EnhancedCustomShape2d::AppendEnhancedCustomShapeEquationParameter( aEquation, nP1, b1Special ); + aEquation += ")"; + } + break; + case 0x81 : + { + aEquation += "(cos("; + EnhancedCustomShape2d::AppendEnhancedCustomShapeEquationParameter( aEquation, nP3, b3Special ); + aEquation += "*(pi/180))*("; + EnhancedCustomShape2d::AppendEnhancedCustomShapeEquationParameter( aEquation, nP1, b1Special ); + aEquation += "-10800)+sin("; + EnhancedCustomShape2d::AppendEnhancedCustomShapeEquationParameter( aEquation, nP3, b3Special ); + aEquation += "*(pi/180))*("; + EnhancedCustomShape2d::AppendEnhancedCustomShapeEquationParameter( aEquation, nP2, b2Special ); + aEquation += "-10800))+10800"; + } + break; + case 0x82 : + { + aEquation += "-(sin("; + EnhancedCustomShape2d::AppendEnhancedCustomShapeEquationParameter( aEquation, nP3, b3Special ); + aEquation += "*(pi/180))*("; + EnhancedCustomShape2d::AppendEnhancedCustomShapeEquationParameter( aEquation, nP1, b1Special ); + aEquation += "-10800)-cos("; + EnhancedCustomShape2d::AppendEnhancedCustomShapeEquationParameter( aEquation, nP3, b3Special ); + aEquation += "*(pi/180))*("; + EnhancedCustomShape2d::AppendEnhancedCustomShapeEquationParameter( aEquation, nP2, b2Special ); + aEquation += "-10800))+10800"; + } + break; + } + return aEquation; +} + +void EnhancedCustomShape2d::AppendEnhancedCustomShapeEquationParameter( OUString& rParameter, const sal_Int32 nPara, const bool bIsSpecialValue ) +{ + if ( bIsSpecialValue ) + { + if ( nPara & 0x400 ) + { + rParameter += "?"; + rParameter += OUString::number( nPara & 0xff ); + rParameter += " "; + } + else + { + switch( nPara ) + { + case DFF_Prop_adjustValue : + case DFF_Prop_adjust2Value : + case DFF_Prop_adjust3Value : + case DFF_Prop_adjust4Value : + case DFF_Prop_adjust5Value : + case DFF_Prop_adjust6Value : + case DFF_Prop_adjust7Value : + case DFF_Prop_adjust8Value : + case DFF_Prop_adjust9Value : + case DFF_Prop_adjust10Value : + { + rParameter += "$"; + rParameter += OUString::number( nPara - DFF_Prop_adjustValue ); + rParameter += " "; + } + break; + case DFF_Prop_geoLeft : + { + rParameter += "left"; + } + break; + case DFF_Prop_geoTop : + { + rParameter += "top"; + } + break; + case DFF_Prop_geoRight : + { + rParameter += "right"; + } + break; + case DFF_Prop_geoBottom : + { + rParameter += "bottom"; + } + break; + } + } + } + else + { + rParameter += OUString::number( nPara ); + } +} + +void EnhancedCustomShape2d::SetEnhancedCustomShapeHandleParameter( EnhancedCustomShapeParameter& rParameter, const sal_Int32 nPara, const bool bIsSpecialValue, bool bHorz ) +{ + sal_Int32 nValue = 0; + if ( bIsSpecialValue ) + { + if ( ( nPara >= 0x100 ) && ( nPara <= 0x107 ) ) + { + nValue = nPara & 0xff; + rParameter.Type = EnhancedCustomShapeParameterType::ADJUSTMENT; + } + else if ( ( nPara >= 3 ) && ( nPara <= 0x82 ) ) + { + nValue = nPara - 3; + rParameter.Type = EnhancedCustomShapeParameterType::EQUATION; + } + else if ( nPara == 0 ) + { + nValue = 0; + if ( bHorz ) + rParameter.Type = EnhancedCustomShapeParameterType::LEFT; + else + rParameter.Type = EnhancedCustomShapeParameterType::TOP; + } + else if ( nPara == 1 ) + { + nValue = 0; + if ( bHorz ) + rParameter.Type = EnhancedCustomShapeParameterType::RIGHT; + else + rParameter.Type = EnhancedCustomShapeParameterType::BOTTOM; + } + else if ( nPara == 2 ) // means to be centered, but should not be + { // used in our implementation + nValue = 5600; + rParameter.Type = EnhancedCustomShapeParameterType::NORMAL; + } + else + { + nValue = nPara; + rParameter.Type = EnhancedCustomShapeParameterType::NORMAL; + } + } + else + { + nValue = nPara; + rParameter.Type = EnhancedCustomShapeParameterType::NORMAL; + } + rParameter.Value <<= nValue; +} + +bool EnhancedCustomShape2d::ConvertSequenceToEnhancedCustomShape2dHandle( + const css::beans::PropertyValues& rHandleProperties, + EnhancedCustomShape2d::Handle& rDestinationHandle ) +{ + bool bRetValue = false; + if ( rHandleProperties.hasElements() ) + { + rDestinationHandle.nFlags = HandleFlags::NONE; + for ( const css::beans::PropertyValue& rPropVal : rHandleProperties ) + { + if ( rPropVal.Name == "Position" ) + { + if ( rPropVal.Value >>= rDestinationHandle.aPosition ) + bRetValue = true; + } + else if ( rPropVal.Name == "MirroredX" ) + { + bool bMirroredX; + if ( rPropVal.Value >>= bMirroredX ) + { + if ( bMirroredX ) + rDestinationHandle.nFlags |= HandleFlags::MIRRORED_X; + } + } + else if ( rPropVal.Name == "MirroredY" ) + { + bool bMirroredY; + if ( rPropVal.Value >>= bMirroredY ) + { + if ( bMirroredY ) + rDestinationHandle.nFlags |= HandleFlags::MIRRORED_Y; + } + } + else if ( rPropVal.Name == "Switched" ) + { + bool bSwitched; + if ( rPropVal.Value >>= bSwitched ) + { + if ( bSwitched ) + rDestinationHandle.nFlags |= HandleFlags::SWITCHED; + } + } + else if ( rPropVal.Name == "Polar" ) + { + if ( rPropVal.Value >>= rDestinationHandle.aPolar ) + rDestinationHandle.nFlags |= HandleFlags::POLAR; + } + else if ( rPropVal.Name == "RefX" ) + { + if ( rPropVal.Value >>= rDestinationHandle.nRefX ) + rDestinationHandle.nFlags |= HandleFlags::REFX; + } + else if ( rPropVal.Name == "RefY" ) + { + if ( rPropVal.Value >>= rDestinationHandle.nRefY ) + rDestinationHandle.nFlags |= HandleFlags::REFY; + } + else if ( rPropVal.Name == "RefAngle" ) + { + if ( rPropVal.Value >>= rDestinationHandle.nRefAngle ) + rDestinationHandle.nFlags |= HandleFlags::REFANGLE; + } + else if ( rPropVal.Name == "RefR" ) + { + if ( rPropVal.Value >>= rDestinationHandle.nRefR ) + rDestinationHandle.nFlags |= HandleFlags::REFR; + } + else if ( rPropVal.Name == "RadiusRangeMinimum" ) + { + if ( rPropVal.Value >>= rDestinationHandle.aRadiusRangeMinimum ) + rDestinationHandle.nFlags |= HandleFlags::RADIUS_RANGE_MINIMUM; + } + else if ( rPropVal.Name == "RadiusRangeMaximum" ) + { + if ( rPropVal.Value >>= rDestinationHandle.aRadiusRangeMaximum ) + rDestinationHandle.nFlags |= HandleFlags::RADIUS_RANGE_MAXIMUM; + } + else if ( rPropVal.Name == "RangeXMinimum" ) + { + if ( rPropVal.Value >>= rDestinationHandle.aXRangeMinimum ) + rDestinationHandle.nFlags |= HandleFlags::RANGE_X_MINIMUM; + } + else if ( rPropVal.Name == "RangeXMaximum" ) + { + if ( rPropVal.Value >>= rDestinationHandle.aXRangeMaximum ) + rDestinationHandle.nFlags |= HandleFlags::RANGE_X_MAXIMUM; + } + else if ( rPropVal.Name == "RangeYMinimum" ) + { + if ( rPropVal.Value >>= rDestinationHandle.aYRangeMinimum ) + rDestinationHandle.nFlags |= HandleFlags::RANGE_Y_MINIMUM; + } + else if ( rPropVal.Name == "RangeYMaximum" ) + { + if ( rPropVal.Value >>= rDestinationHandle.aYRangeMaximum ) + rDestinationHandle.nFlags |= HandleFlags::RANGE_Y_MAXIMUM; + } + } + } + return bRetValue; +} + +void EnhancedCustomShape2d::ApplyShapeAttributes( const SdrCustomShapeGeometryItem& rGeometryItem ) +{ + // AdjustmentValues + static constexpr OUStringLiteral sAdjustmentValues( u"AdjustmentValues" ); + const Any* pAny = const_cast<SdrCustomShapeGeometryItem&>(rGeometryItem).GetPropertyValueByName( sAdjustmentValues ); + if ( pAny ) + *pAny >>= seqAdjustmentValues; + + + // Coordsize + static constexpr OUStringLiteral sViewBox( u"ViewBox" ); + const Any* pViewBox = const_cast<SdrCustomShapeGeometryItem&>(rGeometryItem).GetPropertyValueByName( sViewBox ); + css::awt::Rectangle aViewBox; + if ( pViewBox && (*pViewBox >>= aViewBox ) ) + { + nCoordLeft = aViewBox.X; + nCoordTop = aViewBox.Y; + nCoordWidthG = std::abs( aViewBox.Width ); + nCoordHeightG = std::abs( aViewBox.Height); + } + static constexpr OUStringLiteral sPath( u"Path" ); + static constexpr OUStringLiteral sCoordinates( u"Coordinates" ); + static constexpr OUStringLiteral sGluePoints( u"GluePoints" ); + static constexpr OUStringLiteral sSegments( u"Segments" ); + static constexpr OUStringLiteral sSubViewSize( u"SubViewSize" ); + static constexpr OUStringLiteral sStretchX( u"StretchX" ); + static constexpr OUStringLiteral sStretchY( u"StretchY" ); + static constexpr OUStringLiteral sTextFrames( u"TextFrames" ); + static constexpr OUStringLiteral sEquations( u"Equations" ); + static constexpr OUStringLiteral sHandles( u"Handles" ); + + + // Path/Coordinates + pAny = const_cast<SdrCustomShapeGeometryItem&>(rGeometryItem).GetPropertyValueByName( sPath, sCoordinates ); + if ( pAny ) + *pAny >>= seqCoordinates; + + + // Path/GluePoints + pAny = const_cast<SdrCustomShapeGeometryItem&>(rGeometryItem).GetPropertyValueByName( sPath, sGluePoints ); + if ( pAny ) + *pAny >>= seqGluePoints; + + + // Path/Segments + pAny = const_cast<SdrCustomShapeGeometryItem&>(rGeometryItem).GetPropertyValueByName( sPath, sSegments ); + if ( pAny ) + *pAny >>= seqSegments; + + + // Path/SubViewSize + pAny = const_cast<SdrCustomShapeGeometryItem&>(rGeometryItem).GetPropertyValueByName( sPath, sSubViewSize ); + if ( pAny ) + *pAny >>= seqSubViewSize; + + + // Path/StretchX + pAny = const_cast<SdrCustomShapeGeometryItem&>(rGeometryItem).GetPropertyValueByName( sPath, sStretchX ); + if ( pAny ) + { + sal_Int32 nStretchX = 0; + if ( *pAny >>= nStretchX ) + nXRef = nStretchX; + } + + + // Path/StretchY + pAny = const_cast<SdrCustomShapeGeometryItem&>(rGeometryItem).GetPropertyValueByName( sPath, sStretchY ); + if ( pAny ) + { + sal_Int32 nStretchY = 0; + if ( *pAny >>= nStretchY ) + nYRef = nStretchY; + } + + + // Path/TextFrames + pAny = const_cast<SdrCustomShapeGeometryItem&>(rGeometryItem).GetPropertyValueByName( sPath, sTextFrames ); + if ( pAny ) + *pAny >>= seqTextFrames; + + + // Equations + pAny = const_cast<SdrCustomShapeGeometryItem&>(rGeometryItem).GetPropertyValueByName( sEquations ); + if ( pAny ) + *pAny >>= seqEquations; + + + // Handles + pAny = const_cast<SdrCustomShapeGeometryItem&>(rGeometryItem).GetPropertyValueByName( sHandles ); + if ( pAny ) + *pAny >>= seqHandles; +} + +EnhancedCustomShape2d::~EnhancedCustomShape2d() +{ +} + +void EnhancedCustomShape2d::SetPathSize( sal_Int32 nIndex ) +{ + sal_Int32 nWidth = 0; + sal_Int32 nHeight = 0; + + if ( seqSubViewSize.hasElements() && nIndex < seqSubViewSize.getLength() ) { + nWidth = seqSubViewSize[ nIndex ].Width; + nHeight = seqSubViewSize[ nIndex ].Height; + SAL_INFO( + "svx", + "set subpath " << nIndex << " size: " << nWidth << " x " + << nHeight); + } + + if ( nWidth && nHeight ) { + nCoordWidth = nWidth; + nCoordHeight = nHeight; + } else { + nCoordWidth = nCoordWidthG; + nCoordHeight = nCoordHeightG; + } + + fXScale = nCoordWidth == 0 ? 0.0 : static_cast<double>(aLogicRect.GetWidth()) / static_cast<double>(nCoordWidth); + fYScale = nCoordHeight == 0 ? 0.0 : static_cast<double>(aLogicRect.GetHeight()) / static_cast<double>(nCoordHeight); + if ( bOOXMLShape ) + { + SAL_INFO( + "svx", + "ooxml shape, path width: " << nCoordWidth << " height: " + << nCoordHeight); + + // Try to set up scale separately, if given only width or height + // This is possible case in OOXML when only width or height is non-zero + if ( nCoordWidth == 0 ) + { + if ( nWidth ) + fXScale = static_cast<double>(aLogicRect.GetWidth()) / static_cast<double>(nWidth); + else + fXScale = 1.0; + } + if ( nCoordHeight == 0 ) + { + if ( nHeight ) + fYScale = static_cast<double>(aLogicRect.GetHeight()) / static_cast<double>(nHeight); + else + fYScale = 1.0; + } + } + if ( static_cast<sal_uInt32>(nXRef) != 0x80000000 && aLogicRect.GetHeight() ) + { + fXRatio = static_cast<double>(aLogicRect.GetWidth()) / static_cast<double>(aLogicRect.GetHeight()); + if ( fXRatio > 1 ) + fXScale /= fXRatio; + else + fXRatio = 1.0; + } + else + fXRatio = 1.0; + if ( static_cast<sal_uInt32>(nYRef) != 0x80000000 && aLogicRect.GetWidth() ) + { + fYRatio = static_cast<double>(aLogicRect.GetHeight()) / static_cast<double>(aLogicRect.GetWidth()); + if ( fYRatio > 1 ) + fYScale /= fYRatio; + else + fYRatio = 1.0; + } + else + fYRatio = 1.0; +} + +EnhancedCustomShape2d::EnhancedCustomShape2d(SdrObjCustomShape& rSdrObjCustomShape) +: SfxItemSet ( rSdrObjCustomShape.GetMergedItemSet() ), + mrSdrObjCustomShape ( rSdrObjCustomShape ), + eSpType ( mso_sptNil ), + nCoordLeft ( 0 ), + nCoordTop ( 0 ), + nCoordWidthG ( 21600 ), + nCoordHeightG ( 21600 ), + bOOXMLShape ( false ), + nXRef ( 0x80000000 ), + nYRef ( 0x80000000 ), + nColorData ( 0 ), + bFilled ( rSdrObjCustomShape.GetMergedItem( XATTR_FILLSTYLE ).GetValue() != drawing::FillStyle_NONE ), + bStroked ( rSdrObjCustomShape.GetMergedItem( XATTR_LINESTYLE ).GetValue() != drawing::LineStyle_NONE ), + bFlipH ( false ), + bFlipV ( false ) +{ + // bTextFlow needs to be set before clearing the TextDirection Item + + ClearItem( SDRATTR_TEXTDIRECTION ); //SJ: vertical writing is not required, by removing this item no outliner is created + + // #i105323# For 2D AutoShapes, the shadow attribute does not need to be applied to any + // of the constructed helper SdrObjects. This would lead to problems since the shadow + // of one helper object would fall on one helper object behind it (e.g. with the + // eyes of the smiley shape). This is not wanted; instead a single shadow 'behind' + // the AutoShape visualisation is wanted. This is done with primitive functionality + // now in SdrCustomShapePrimitive2D::create2DDecomposition, but only for 2D objects + // (see there and in EnhancedCustomShape3d::Create3DObject to read more). + // This exception may be removed later when AutoShapes will create primitives directly. + // So, currently remove the ShadowAttribute from the ItemSet to not apply it to any + // 2D helper shape. + ClearItem(SDRATTR_SHADOW); + + Point aP( mrSdrObjCustomShape.GetSnapRect().Center() ); + Size aS( mrSdrObjCustomShape.GetLogicRect().GetSize() ); + aP.AdjustX( -(aS.Width() / 2) ); + aP.AdjustY( -(aS.Height() / 2) ); + aLogicRect = tools::Rectangle( aP, aS ); + + OUString sShapeType; + const SdrCustomShapeGeometryItem& rGeometryItem(mrSdrObjCustomShape.GetMergedItem( SDRATTR_CUSTOMSHAPE_GEOMETRY )); + static constexpr OUStringLiteral sType = u"Type"; + const Any* pAny = rGeometryItem.GetPropertyValueByName( sType ); + if ( pAny ) { + *pAny >>= sShapeType; + bOOXMLShape = sShapeType.startsWith("ooxml-"); + SAL_INFO("svx", "shape type: " << sShapeType << " " << bOOXMLShape); + } + eSpType = EnhancedCustomShapeTypeNames::Get( sShapeType ); + + static constexpr OUStringLiteral sMirroredX = u"MirroredX"; + static constexpr OUStringLiteral sMirroredY = u"MirroredY"; + pAny = rGeometryItem.GetPropertyValueByName( sMirroredX ); + if ( pAny ) + *pAny >>= bFlipH; + pAny = rGeometryItem.GetPropertyValueByName( sMirroredY ); + if ( pAny ) + *pAny >>= bFlipV; + + nRotateAngle = Degree100(static_cast<sal_Int32>(mrSdrObjCustomShape.GetObjectRotation() * 100.0)); + + /*const sal_Int32* pDefData =*/ ApplyShapeAttributes( rGeometryItem ); + SetPathSize(); + + switch( eSpType ) + { + case mso_sptCan : nColorData = 0x20400000; break; + case mso_sptCube : nColorData = 0x302e0000; break; + case mso_sptActionButtonBlank : nColorData = 0x502ce400; break; + case mso_sptActionButtonHome : nColorData = 0x702ce4ce; break; + case mso_sptActionButtonHelp : nColorData = 0x602ce4c0; break; + case mso_sptActionButtonInformation : nColorData = 0x702ce4c5; break; + case mso_sptActionButtonBackPrevious : nColorData = 0x602ce4c0; break; + case mso_sptActionButtonForwardNext : nColorData = 0x602ce4c0; break; + case mso_sptActionButtonBeginning : nColorData = 0x602ce4c0; break; + case mso_sptActionButtonEnd : nColorData = 0x602ce4c0; break; + case mso_sptActionButtonReturn : nColorData = 0x602ce4c0; break; + case mso_sptActionButtonDocument : nColorData = 0x702ce4ec; break; + case mso_sptActionButtonSound : nColorData = 0x602ce4c0; break; + case mso_sptActionButtonMovie : nColorData = 0x602ce4c0; break; + case mso_sptBevel : nColorData = 0x502ce400; break; + case mso_sptFoldedCorner : nColorData = 0x20e00000; break; + case mso_sptSmileyFace : nColorData = 0x20e00000; break; + case mso_sptNil : + { + // Because calculation method has changed in #i102797 original color encoding for + // Octagon Bevel and Diamond Bevel can no longer be used. We keep the color coding + // only for self-created shapes, as authors may have already considered the change. + // We use ColorData compatible to OOXML. + if (sShapeType == "col-60da8460") // Octagon Bevel + { + nColorData = 0x60ecc240; + } + else if (sShapeType == "col-502ad400") // Diamond Bevel + { + nColorData = 0x502ce400; + } + else if (sShapeType.getLength() > 4 && sShapeType.match( "col-" )) + { + nColorData = o3tl::toUInt32(sShapeType.subView( 4 ), 16); + } + } + break; + case mso_sptCurvedLeftArrow : + case mso_sptCurvedRightArrow : + case mso_sptCurvedUpArrow : + case mso_sptCurvedDownArrow : nColorData = 0x20d00000; break; + case mso_sptRibbon2 : nColorData = 0x30ee0000; break; + case mso_sptRibbon : nColorData = 0x30ee0000; break; + + case mso_sptEllipseRibbon2 : nColorData = 0x30ee0000; break; + case mso_sptEllipseRibbon : nColorData = 0x30ee0000; break; + + case mso_sptVerticalScroll : nColorData = 0x30ee0000; break; + case mso_sptHorizontalScroll : nColorData = 0x30ee0000; break; + default: + break; + } + + sal_Int32 nLength = seqEquations.getLength(); + + if ( !nLength ) + return; + + vNodesSharedPtr.resize( nLength ); + vEquationResults.resize( nLength ); + for ( sal_Int32 i = 0; i < nLength; i++ ) + { + vEquationResults[ i ].bReady = false; + try + { + vNodesSharedPtr[ i ] = EnhancedCustomShape::FunctionParser::parseFunction( seqEquations[ i ], *this ); + } + catch ( EnhancedCustomShape::ParseError& ) + { + SAL_INFO( + "svx", + "error: equation number: " << i << ", parser failed (" + << seqEquations[i] << ")"); + } + } +} + +using EnhancedCustomShape::ExpressionFunct; + +double EnhancedCustomShape2d::GetEnumFunc( const ExpressionFunct eFunc ) const +{ + double fRet = 0.0; + switch( eFunc ) + { + case ExpressionFunct::EnumPi : fRet = M_PI; break; + case ExpressionFunct::EnumLeft : fRet = static_cast<double>(nCoordLeft); break; + case ExpressionFunct::EnumTop : fRet = static_cast<double>(nCoordTop); break; + case ExpressionFunct::EnumRight : fRet = (static_cast<double>(nCoordLeft) + static_cast<double>(nCoordWidth)) * fXRatio; break; + case ExpressionFunct::EnumBottom : fRet = (static_cast<double>(nCoordTop) + static_cast<double>(nCoordHeight)) * fYRatio; break; + case ExpressionFunct::EnumXStretch : fRet = nXRef; break; + case ExpressionFunct::EnumYStretch : fRet = nYRef; break; + case ExpressionFunct::EnumHasStroke : fRet = bStroked ? 1.0 : 0.0; break; + case ExpressionFunct::EnumHasFill : fRet = bFilled ? 1.0 : 0.0; break; + case ExpressionFunct::EnumWidth : fRet = nCoordWidth; break; + case ExpressionFunct::EnumHeight : fRet = nCoordHeight; break; + case ExpressionFunct::EnumLogWidth : fRet = aLogicRect.GetWidth(); break; + case ExpressionFunct::EnumLogHeight : fRet = aLogicRect.GetHeight(); break; + default: break; + } + return fRet; +} +double EnhancedCustomShape2d::GetAdjustValueAsDouble( const sal_Int32 nIndex ) const +{ + double fNumber = 0.0; + if ( nIndex < seqAdjustmentValues.getLength() ) + { + if ( seqAdjustmentValues[ nIndex ].Value.getValueTypeClass() == TypeClass_DOUBLE ) + seqAdjustmentValues[ nIndex ].Value >>= fNumber; + else + { + sal_Int32 nNumber = 0; + seqAdjustmentValues[ nIndex ].Value >>= nNumber; + fNumber = static_cast<double>(nNumber); + } + } + return fNumber; +} +double EnhancedCustomShape2d::GetEquationValueAsDouble( const sal_Int32 nIndex ) const +{ + double fNumber = 0.0; + static sal_uInt32 nLevel = 0; + if ( nIndex < static_cast<sal_Int32>(vNodesSharedPtr.size()) ) + { + if ( vNodesSharedPtr[ nIndex ] ) { + nLevel ++; + try + { + if ( vEquationResults[ nIndex ].bReady ) + fNumber = vEquationResults[ nIndex ].fValue; + else { + // cast to non const, so that we can optimize by caching + // equation results, without changing all the const in the stack + struct EquationResult &aResult = const_cast<EnhancedCustomShape2d*>(this)->vEquationResults[ nIndex ]; + + fNumber = aResult.fValue = (*vNodesSharedPtr[ nIndex ])(); + aResult.bReady = true; + + SAL_INFO("svx", "equation " << nLevel << " (level: " << seqEquations[nIndex] << "): " + << fNumber << " --> " << 180.0*fNumber/10800000.0); + } + if ( !std::isfinite( fNumber ) ) + fNumber = 0.0; + } + catch ( ... ) + { + SAL_WARN("svx", "EnhancedCustomShape2d::GetEquationValueAsDouble failed"); + } + nLevel --; + } + SAL_INFO( + "svx", + "?" << nIndex << " --> " << fNumber << " (angle: " + << 180.0*fNumber/10800000.0 << ")"); + } + + return fNumber; +} + +bool EnhancedCustomShape2d::SetAdjustValueAsDouble( const double& rValue, const sal_Int32 nIndex ) +{ + bool bRetValue = false; + if ( nIndex < seqAdjustmentValues.getLength() ) + { + // updating our local adjustment sequence + auto pseqAdjustmentValues = seqAdjustmentValues.getArray(); + pseqAdjustmentValues[ nIndex ].Value <<= rValue; + pseqAdjustmentValues[ nIndex ].State = css::beans::PropertyState_DIRECT_VALUE; + bRetValue = true; + } + return bRetValue; +} + +basegfx::B2DPoint EnhancedCustomShape2d::GetPointAsB2DPoint( const css::drawing::EnhancedCustomShapeParameterPair& rPair, + const bool bScale, const bool bReplaceGeoSize ) const +{ + double fValX, fValY; + // width + GetParameter(fValX, rPair.First, bReplaceGeoSize, false); + fValX -= nCoordLeft; + if (bScale) + { + fValX *= fXScale; + } + // height + GetParameter(fValY, rPair.Second, false, bReplaceGeoSize); + fValY -= nCoordTop; + if (bScale) + { + fValY *= fYScale; + } + return basegfx::B2DPoint(fValX,fValY); +} + +Point EnhancedCustomShape2d::GetPoint( const css::drawing::EnhancedCustomShapeParameterPair& rPair, + const bool bScale, const bool bReplaceGeoSize ) const +{ + basegfx::B2DPoint aPoint(GetPointAsB2DPoint(rPair, bScale, bReplaceGeoSize)); + return Point(static_cast<tools::Long>(aPoint.getX()), static_cast<tools::Long>(aPoint.getY())); +} + +void EnhancedCustomShape2d::GetParameter( double& rRetValue, const EnhancedCustomShapeParameter& rParameter, + const bool bReplaceGeoWidth, const bool bReplaceGeoHeight ) const +{ + rRetValue = 0.0; + switch ( rParameter.Type ) + { + case EnhancedCustomShapeParameterType::ADJUSTMENT : + { + sal_Int32 nAdjustmentIndex = 0; + if ( rParameter.Value >>= nAdjustmentIndex ) + { + rRetValue = GetAdjustValueAsDouble( nAdjustmentIndex ); + } + } + break; + case EnhancedCustomShapeParameterType::EQUATION : + { + sal_Int32 nEquationIndex = 0; + if ( rParameter.Value >>= nEquationIndex ) + { + rRetValue = GetEquationValueAsDouble( nEquationIndex ); + } + } + break; + case EnhancedCustomShapeParameterType::NORMAL : + { + if ( rParameter.Value.getValueTypeClass() == TypeClass_DOUBLE ) + { + double fValue(0.0); + if ( rParameter.Value >>= fValue ) + { + rRetValue = fValue; + } + } + else + { + sal_Int32 nValue = 0; + if ( rParameter.Value >>= nValue ) + { + rRetValue = nValue; + if ( bReplaceGeoWidth && ( nValue == nCoordWidth ) ) + rRetValue *= fXRatio; + else if ( bReplaceGeoHeight && ( nValue == nCoordHeight ) ) + rRetValue *= fYRatio; + } + } + } + break; + case EnhancedCustomShapeParameterType::LEFT : + { + rRetValue = 0.0; + } + break; + case EnhancedCustomShapeParameterType::TOP : + { + rRetValue = 0.0; + } + break; + case EnhancedCustomShapeParameterType::RIGHT : + { + rRetValue = nCoordWidth; + } + break; + case EnhancedCustomShapeParameterType::BOTTOM : + { + rRetValue = nCoordHeight; + } + break; + } +} + +// nLumDat 28-31 = number of luminance entries in nLumDat +// nLumDat 27-24 = nLumDatEntry 0 +// nLumDat 23-20 = nLumDatEntry 1 ... +// each 4bit entry is to be interpreted as a 10 percent signed luminance changing +sal_Int32 EnhancedCustomShape2d::GetLuminanceChange( sal_uInt32 nIndex ) const +{ + const sal_uInt32 nCount = nColorData >> 28; + if ( !nCount ) + return 0; + + if ( nIndex >= nCount ) + nIndex = nCount - 1; + + const sal_Int32 nLumDat = nColorData << ( ( 1 + nIndex ) << 2 ); + return ( nLumDat >> 28 ) * 10; +} + +Color EnhancedCustomShape2d::GetColorData( const Color& rFillColor, sal_uInt32 nIndex, double dBrightness ) const +{ + if ( bOOXMLShape || ( mso_sptMin == eSpType /* ODF "non-primitive" */ ) ) + { //do LibreOffice way, using dBrightness + if ( dBrightness == 0.0) + { + return rFillColor; + } + else + { + if (dBrightness >=0.0) + { //lighten, blending with white + return Color( static_cast<sal_uInt8>(static_cast< sal_Int32 >( std::clamp(rFillColor.GetRed() * (1.0-dBrightness) + dBrightness * 255.0, 0.0, 255.0) )), + static_cast<sal_uInt8>(static_cast< sal_Int32 >( std::clamp(rFillColor.GetGreen() * (1.0-dBrightness) + dBrightness * 255.0, 0.0, 255.0) )), + static_cast<sal_uInt8>(static_cast< sal_Int32 >( std::clamp(rFillColor.GetBlue() * (1.0-dBrightness) + dBrightness * 255.0, 0.0, 255.0) )) ); + } + else + { //darken (indicated by negative sign), blending with black + return Color( static_cast<sal_uInt8>(static_cast< sal_Int32 >( std::clamp(rFillColor.GetRed() * (1.0+dBrightness), 0.0, 255.0) )), + static_cast<sal_uInt8>(static_cast< sal_Int32 >( std::clamp(rFillColor.GetGreen() * (1.0+dBrightness), 0.0, 255.0) )), + static_cast<sal_uInt8>(static_cast< sal_Int32 >( std::clamp(rFillColor.GetBlue() * (1.0+dBrightness), 0.0, 255.0) )) ); + } + } + } + else + { //do OpenOffice way, using nColorData + const sal_Int32 nLuminance = GetLuminanceChange(nIndex); + if( !nLuminance ) + return rFillColor; + + basegfx::BColor aHSVColor= + basegfx::utils::rgb2hsv( + basegfx::BColor(rFillColor.GetRed()/255.0, + rFillColor.GetGreen()/255.0, + rFillColor.GetBlue()/255.0)); + + if( nLuminance > 0 ) + { + aHSVColor.setGreen( + aHSVColor.getGreen() * (1.0-nLuminance/100.0)); + aHSVColor.setBlue( + nLuminance/100.0 + + (1.0-nLuminance/100.0)*aHSVColor.getBlue()); + } + else if( nLuminance < 0 ) + { + aHSVColor.setBlue( + (1.0+nLuminance/100.0)*aHSVColor.getBlue()); + } + + aHSVColor = basegfx::utils::hsv2rgb(aHSVColor); + return Color( static_cast<sal_uInt8>(static_cast< sal_Int32 >( std::clamp(aHSVColor.getRed(),0.0,1.0) * 255.0 + 0.5 )), + static_cast<sal_uInt8>(static_cast< sal_Int32 >( std::clamp(aHSVColor.getGreen(),0.0,1.0) * 255.0 + 0.5 )), + static_cast<sal_uInt8>(static_cast< sal_Int32 >( std::clamp(aHSVColor.getBlue(),0.0,1.0) * 255.0 + 0.5 )) ); + } +} + +tools::Rectangle EnhancedCustomShape2d::GetTextRect() const +{ + if ( !seqTextFrames.hasElements() ) + return aLogicRect; + sal_Int32 nIndex = 0; + Point aTopLeft( GetPoint( seqTextFrames[ nIndex ].TopLeft, !bOOXMLShape, true ) ); + Point aBottomRight( GetPoint( seqTextFrames[ nIndex ].BottomRight, !bOOXMLShape, true ) ); + tools::Rectangle aRect( aTopLeft, aBottomRight ); + if ( bFlipH ) + { + aRect.SetLeft(aLogicRect.GetWidth() - 1 - aBottomRight.X()); + aRect.SetRight( aLogicRect.GetWidth() - 1 - aTopLeft.X()); + } + if ( bFlipV ) + { + aRect.SetTop(aLogicRect.GetHeight() - 1 - aBottomRight.Y()); + aRect.SetBottom(aLogicRect.GetHeight() - 1 - aTopLeft.Y()); + } + SAL_INFO("svx", aRect.GetWidth() << " x " << aRect.GetHeight()); + if( aRect.GetWidth() <= 1 || aRect.GetHeight() <= 1 ) + return aLogicRect; + aRect.Move( aLogicRect.Left(), aLogicRect.Top() ); + aRect.Justify(); + return aRect; +} + +sal_uInt32 EnhancedCustomShape2d::GetHdlCount() const +{ + return seqHandles.getLength(); +} + +bool EnhancedCustomShape2d::GetHandlePosition( const sal_uInt32 nIndex, Point& rReturnPosition ) const +{ + bool bRetValue = false; + if ( nIndex < GetHdlCount() ) + { + Handle aHandle; + if ( ConvertSequenceToEnhancedCustomShape2dHandle( seqHandles[ nIndex ], aHandle ) ) + { + if ( aHandle.nFlags & HandleFlags::POLAR ) + { + Point aReferencePoint( GetPoint( aHandle.aPolar ) ); + + double fAngle; + double fRadius; + GetParameter( fRadius, aHandle.aPosition.First, false, false ); + GetParameter( fAngle, aHandle.aPosition.Second, false, false ); + + double a = basegfx::deg2rad(360.0 - fAngle); + double dx = fRadius * fXScale; + double fX = dx * cos( a ); + double fY =-dx * sin( a ); + rReturnPosition = + Point( + FRound( fX + aReferencePoint.X() ), + basegfx::fTools::equalZero(fXScale) ? aReferencePoint.Y() : + FRound( ( fY * fYScale ) / fXScale + aReferencePoint.Y() ) ); + } + else + { + if ( aHandle.nFlags & HandleFlags::SWITCHED ) + { + if ( aLogicRect.GetHeight() > aLogicRect.GetWidth() ) + { + css::drawing::EnhancedCustomShapeParameter aFirst = aHandle.aPosition.First; + css::drawing::EnhancedCustomShapeParameter aSecond = aHandle.aPosition.Second; + aHandle.aPosition.First = aSecond; + aHandle.aPosition.Second = aFirst; + } + } + if (bOOXMLShape) + rReturnPosition = GetPoint(aHandle.aPosition, false /*bScale*/); + else + rReturnPosition = GetPoint(aHandle.aPosition, true /*bScale*/); + } + const GeoStat aGeoStat(mrSdrObjCustomShape.GetGeoStat()); + if ( aGeoStat.nShearAngle ) + { + double nTan = aGeoStat.mfTanShearAngle; + if (bFlipV != bFlipH) + nTan = -nTan; + ShearPoint( rReturnPosition, Point( aLogicRect.GetWidth() / 2, aLogicRect.GetHeight() / 2 ), nTan ); + } + if ( nRotateAngle ) + { + double a = toRadians(nRotateAngle); + RotatePoint( rReturnPosition, Point( aLogicRect.GetWidth() / 2, aLogicRect.GetHeight() / 2 ), sin( a ), cos( a ) ); + } + if ( bFlipH ) + rReturnPosition.setX( aLogicRect.GetWidth() - rReturnPosition.X() ); + if ( bFlipV ) + rReturnPosition.setY( aLogicRect.GetHeight() - rReturnPosition.Y() ); + rReturnPosition.Move( aLogicRect.Left(), aLogicRect.Top() ); + bRetValue = true; + } + } + return bRetValue; +} + +static double lcl_getXAdjustmentValue(std::u16string_view rShapeType, const sal_uInt32 nHandleIndex, + const double fX, const double fW, const double fH) +{ + // degenerated shapes are not worth to calculate special case for each shape type + if (fW <= 0.0 || fH <= 0.0) + return 50000; + + // pattern (w - x) / ss * 100000 or (r - x) / ss * 100000 + if ((rShapeType == u"ooxml-bentArrow" && nHandleIndex == 2) || (rShapeType == u"ooxml-chevron") + || (rShapeType == u"ooxml-curvedRightArrow") || (rShapeType == u"ooxml-foldedCorner") + || (rShapeType == u"ooxml-homePlate") || (rShapeType == u"ooxml-notchedRightArrow") + || (rShapeType == u"ooxml-nonIsoscelesTrapezoid" && nHandleIndex == 1) + || (rShapeType == u"ooxml-rightArrow") + || (rShapeType == u"ooxml-rightArrowCallout" && nHandleIndex == 2) + || (rShapeType == u"ooxml-round1Rect") + || (rShapeType == u"ooxml-round2DiagRect" && nHandleIndex == 1) + || (rShapeType == u"ooxml-round2SameRect" && nHandleIndex == 0) + || (rShapeType == u"ooxml-snip1Rect") + || (rShapeType == u"ooxml-snip2DiagRect" && nHandleIndex == 1) + || (rShapeType == u"ooxml-snip2SameRect" && nHandleIndex == 0) + || (rShapeType == u"ooxml-snipRoundRect" && nHandleIndex == 1) + || (rShapeType == u"ooxml-swooshArrow") || (rShapeType == u"ooxml-stripedRightArrow")) + return (fW - fX) / std::min(fW, fH) * 100000.0; + + // pattern x / ss * 100000 or (x - l) / ss * 100000 + if ((rShapeType == u"ooxml-bentArrow" && nHandleIndex == 0) + || (rShapeType == u"ooxml-bentArrow" && nHandleIndex == 3) + || (rShapeType == u"ooxml-corner") + || (rShapeType == u"ooxml-curvedDownArrow") || (rShapeType == u"ooxml-curvedLeftArrow") + || (rShapeType == u"ooxml-curvedUpArrow") || (rShapeType == u"ooxml-leftArrow") + || (rShapeType == u"ooxml-leftArrowCallout" && nHandleIndex == 2) + || (rShapeType == u"ooxml-leftRightArrow") + || (rShapeType == u"ooxml-leftRightArrowCallout" && nHandleIndex == 2) + || (rShapeType == u"ooxml-leftRightRibbon") + || (rShapeType == u"ooxml-nonIsoscelesTrapezoid" && nHandleIndex == 0) + || (rShapeType == u"ooxml-parallelogram") + || (rShapeType == u"ooxml-round2DiagRect" && nHandleIndex == 0) + || (rShapeType == u"ooxml-round2SameRect" && nHandleIndex == 1) + || (rShapeType == u"ooxml-roundRect") + || (rShapeType == u"ooxml-snip2DiagRect" && nHandleIndex == 0) + || (rShapeType == u"ooxml-snip2SameRect" && nHandleIndex == 1) + || (rShapeType == u"ooxml-snipRoundRect" && nHandleIndex == 0) + || (rShapeType == u"ooxml-uturnArrow" && nHandleIndex == 0) + || (rShapeType == u"ooxml-uturnArrow" && nHandleIndex == 3)) + return fX / std::min(fW, fH) * 100000.0; + + // pattern (hc - x) / ss * 200000 + if ((rShapeType == u"ooxml-downArrowCallout" && nHandleIndex == 0) + || (rShapeType == u"ooxml-leftRightUpArrow" && nHandleIndex == 0) + || (rShapeType == u"ooxml-quadArrow" && nHandleIndex == 0) + || (rShapeType == u"ooxml-quadArrowCallout" && nHandleIndex == 0) + || (rShapeType == u"ooxml-upArrowCallout" && nHandleIndex == 0) + || (rShapeType == u"ooxml-upDownArrowCallout" && nHandleIndex == 0)) + return (fW / 2.0 - fX) / std::min(fW, fH) * 200000.0; + + // pattern (hc - x) / ss * 100000 + if ((rShapeType == u"ooxml-downArrowCallout" && nHandleIndex == 1) + || (rShapeType == u"ooxml-leftRightUpArrow" && nHandleIndex == 1) + || (rShapeType == u"ooxml-quadArrow" && nHandleIndex == 1) + || (rShapeType == u"ooxml-quadArrowCallout" && nHandleIndex == 1) + || (rShapeType == u"ooxml-upArrowCallout" && nHandleIndex == 1) + || (rShapeType == u"ooxml-upDownArrowCallout" && nHandleIndex == 1)) + return (fW / 2.0 - fX) / std::min(fW, fH) * 100000.0; + + // pattern (w - x) / ss * 50000 or (r - x) / ss * 50000 + if ((rShapeType == u"ooxml-bentUpArrow") || (rShapeType == u"ooxml-leftUpArrow") + || (rShapeType == u"ooxml-uturnArrow" && nHandleIndex == 1)) + return (fW - fX) / std::min(fW, fH) * 50000.0; + + // pattern x / ss * 200000 + if (rShapeType == u"ooxml-nonIsoscelesTrapezoid" && nHandleIndex == 0) + return fX / std::min(fW, fH) * 200000.0; + + // pattern (hc - x) / w * 200000 + if ((rShapeType == u"ooxml-downArrow" && nHandleIndex == 0) + || (rShapeType == u"ooxml-ellipseRibbon") || (rShapeType == u"ooxml-ellipseRibbon2") + || (rShapeType == u"ooxml-leftRightArrowCallout" && nHandleIndex == 3) + || (rShapeType == u"ooxml-ribbon") || (rShapeType == u"ooxml-ribbon2") + || (rShapeType == u"ooxml-upArrow" && nHandleIndex == 0) + || (rShapeType == u"ooxml-upDownArrow" && nHandleIndex == 0)) + return (fW / 2.0 - fX) / fW * 200000.0; + + // pattern (x - hc) / w * 100000 + if ((rShapeType == u"ooxml-cloudCallout") || (rShapeType == u"ooxml-doubleWave") + || (rShapeType == u"ooxml-wave") || (rShapeType == u"ooxml-wedgeEllipseCallout") + || (rShapeType == u"ooxml-wedgeRectCallout") + || (rShapeType == u"ooxml-wedgeRoundRectCallout")) + return (fX - fW / 2.0) / fW * 100000.0; + + // pattern (x - hc) / w * 200000 + if (rShapeType == u"ooxml-teardrop") + return (fX - fW / 2.0) / fW * 200000.0; + + // pattern (w - x) / w * 100000 or (r - x) / w * 100000 + if (rShapeType == u"ooxml-leftArrowCallout" && nHandleIndex == 3) + return (fW - fX) / fW * 100000.0; + + // pattern (hc - x) / h * 100000 + if (rShapeType == u"ooxml-mathDivide") + return (fW / 2.0 - fX) / fH * 100000.0; + + // pattern x / w * 100000, simple scaling + if (o3tl::starts_with(rShapeType, u"ooxml-")) + return fX / fW * 100000.0; + + return fX; // method is unknown +} + +static double lcl_getYAdjustmentValue(std::u16string_view rShapeType, const sal_uInt32 nHandleIndex, + const double fY, const double fW, const double fH) +{ + // degenerated shapes are not worth to calculate a special case for each shape type + if (fW <= 0.0 || fH <= 0.0) + return 50000; + + // pattern (vc - y) / ss * 100000 + if ((rShapeType == u"ooxml-leftArrowCallout" && nHandleIndex == 1) + || (rShapeType == u"ooxml-leftRightArrowCallout" && nHandleIndex == 1) + || (rShapeType == u"ooxml-rightArrowCallout" && nHandleIndex == 1)) + return (fH / 2.0 - fY) / std::min(fW, fH) * 100000.0; + + // pattern (vc - y) / ss * 200000 + if ((rShapeType == u"ooxml-curvedLeftArrow") || (rShapeType == u"ooxml-curvedRightArrow") + || (rShapeType == u"ooxml-leftArrowCallout" && nHandleIndex == 0) + || (rShapeType == u"ooxml-leftRightArrowCallout" && nHandleIndex == 0) + || (rShapeType == u"ooxml-mathPlus") + || (rShapeType == u"ooxml-rightArrowCallout" && nHandleIndex == 0)) + return (fH / 2.0 - fY) / std::min(fW, fH) * 200000.0; + + // pattern (h - y) / ss * 100000 or (b - y) / ss * 100000 + if ((rShapeType == u"ooxml-bentUpArrow" && nHandleIndex == 0) || (rShapeType == u"ooxml-corner") + || (rShapeType == u"ooxml-curvedDownArrow") || (rShapeType == u"ooxml-downArrow") + || (rShapeType == u"ooxml-downArrowCallout" && nHandleIndex == 2) + || (rShapeType == u"ooxml-uturnArrow" && nHandleIndex == 2)) + return (fH - fY) / std::min(fW, fH) * 100000.0; + + // pattern (h - y) / ss * 200000 or (b - y) / ss * 200000 + if (rShapeType == u"ooxml-leftUpArrow" && nHandleIndex == 0) // - adj2 * 2 outside + return (fH - fY) / std::min(fW, fH) * 200000.0; + + // pattern y / ss * 100000 or (y - t) / ss * 100000 + if ((rShapeType == u"ooxml-bentUpArrow" && nHandleIndex == 2) + || (rShapeType == u"ooxml-bracePair") || (rShapeType == u"ooxml-bracketPair") + || (rShapeType == u"ooxml-can") || (rShapeType == u"ooxml-cube") + || (rShapeType == u"ooxml-curvedUpArrow") || (rShapeType == u"ooxml-halfFrame") + || (rShapeType == u"ooxml-leftBrace" && nHandleIndex == 0) + || (rShapeType == u"ooxml-leftBracket") || (rShapeType == u"ooxml-leftRightUpArrow") + || (rShapeType == u"ooxml-leftUpArrow" && nHandleIndex == 2) + || (rShapeType == u"ooxml-mathMultiply") || (rShapeType == u"ooxml-quadArrow") + || (rShapeType == u"ooxml-quadArrowCallout" && nHandleIndex == 2) + || (rShapeType == u"ooxml-rightBrace" && nHandleIndex == 0) + || (rShapeType == u"ooxml-rightBracket") || (rShapeType == u"ooxml-upArrow") + || (rShapeType == u"ooxml-upArrowCallout" && nHandleIndex == 2) + || (rShapeType == u"ooxml-upDownArrow") + || (rShapeType == u"ooxml-upDownArrowCallout" && nHandleIndex == 2) + || (rShapeType == u"ooxml-verticalScroll")) + return fY / std::min(fW, fH) * 100000.0; + + // pattern y / ss * 50000 + if (rShapeType == u"ooxml-bentArrow") + return fY / std::min(fW, fH) * 50000.0; + + // pattern (vc - y) / h * 100000 + if ((rShapeType == u"ooxml-mathDivide" && nHandleIndex == 1) // -adj1 / 2 - adj3 outside + || (rShapeType == u"ooxml-mathEqual" && nHandleIndex == 0) // -adj2 / 2 outside + || (rShapeType == u"ooxml-mathNotEqual" && nHandleIndex == 0) // -adj3 / 2 outside + || (rShapeType == u"ooxml-star4") || (rShapeType == u"ooxml-star6") + || (rShapeType == u"ooxml-star8") || (rShapeType == u"ooxml-star10") + || (rShapeType == u"ooxml-star12") || (rShapeType == u"ooxml-star16") + || (rShapeType == u"ooxml-star24") || (rShapeType == u"ooxml-star32")) + return (fH / 2.0 - fY) / fH * 100000.0; + + // pattern (vc - y) / h * 200000 + if ((rShapeType == u"ooxml-leftArrow") || (rShapeType == u"ooxml-leftRightArrow") + || (rShapeType == u"ooxml-mathDivide" && nHandleIndex == 0) + || (rShapeType == u"ooxml-mathEqual" && nHandleIndex == 1) + || (rShapeType == u"ooxml-mathMinus") || (rShapeType == u"ooxml-notchedRightArrow") + || (rShapeType == u"ooxml-mathNotEqual" && nHandleIndex == 2) + || (rShapeType == u"ooxml-quadArrowCallout" && nHandleIndex == 3) + || (rShapeType == u"ooxml-rightArrow") || (rShapeType == u"ooxml-stripedRightArrow") + || (rShapeType == u"ooxml-upDownArrowCallout" && nHandleIndex == 3)) + return (fH / 2.0 - fY) / fH * 200000.0; + + // pattern (y - vc) / h * 100000 + if ((rShapeType == u"ooxml-cloudCallout") || (rShapeType == u"ooxml-wedgeEllipseCallout") + || (rShapeType == u"ooxml-wedgeRectCallout") + || (rShapeType == u"ooxml-wedgeRoundRectCallout")) + return (fY - fH / 2.0) / fH * 100000.0; + + // pattern (h - y) / h * 100000 or (b - y) / h * 100000 + if ((rShapeType == u"ooxml-ellipseRibbon" && nHandleIndex == 2) + || (rShapeType == u"ooxml-ellipseRibbon2" && nHandleIndex == 0) + || (rShapeType == u"ooxml-ribbon2") + || (rShapeType == u"ooxml-upArrowCallout" && nHandleIndex == 3)) + return (fH - fY) / fH * 100000.0; + + // special pattern smiley + if (rShapeType == u"ooxml-smileyFace") + return (fY - fH * 16515.0 / 21600.0) / fH * 100000.0; + + // special pattern for star with odd number of tips, because center of star not center of shape + if (rShapeType == u"ooxml-star5") + return (fH / 2.0 - fY * 100000.0 / 110557.0) / fH * 100000.0; + if (rShapeType == u"ooxml-star7") + return (fH / 2.0 - fY * 100000.0 / 105210.0) / fH * 100000.0; + + // special pattern swooshArrow + if (rShapeType == u"ooxml-swooshArrow") + return (fY - std::min(fW, fH) / 8.0) / fH * 100000.0; + + // special pattern leftRightRibbon + if (rShapeType == u"ooxml-leftRightRibbon") + return fY / fH * 200000 - 100000; + + // pattern y / h * 100000, simple scaling + if (o3tl::starts_with(rShapeType, u"ooxml-")) + return fY / fH * 100000.0; + + return fY; // method is unknown +} + +static double lcl_getAngleInOOXMLUnit(double fDY, double fDX) +{ + if (fDX != 0.0 || fDY != 0.0) + { + double fAngleRad(atan2(fDY, fDX)); + double fAngle = basegfx::rad2deg(fAngleRad); + // atan2 returns angle in ]-pi; pi], OOXML preset shapes use [0;360[. + if (fAngle < 0.0) + fAngle += 360.0; + // OOXML uses angle unit 1/60000 degree. + fAngle *= 60000.0; + return fAngle; + } + return 0.0; // no angle defined for origin in polar coordinate system +} + +static double lcl_getRadiusDistance(double fWR, double fHR, double fX, double fY) +{ + // Get D so, that point (fX|fY) is on the ellipse, that has width fWR-D and + // height fHR-D and center in origin. + // Get solution of ellipse equation (fX/(fWR-D))^2 + (fY/(fHR-D)^2 = 1 by solving + // fX^2*(fHR-D)^2 + fY^2*(fWR-D)^2 - (fWR-D)^2 * (fHR-D)^2 = 0 with Newton-method. + if (fX == 0.0) + return std::min(fHR - fY, fWR); + else if (fY == 0.0) + return std::min(fWR - fX, fHR); + + double fD = std::min(fWR, fHR) - std::hypot(fX, fY); // iteration start value + sal_uInt8 nIter(0); + bool bFound(false); + do + { + ++nIter; + const double fOldD(fD); + const double fWRmD(fWR - fD); + const double fHRmD(fHR - fD); + double fNumerator + = fX * fX * fHRmD * fHRmD + fY * fY * fWRmD * fWRmD - fWRmD * fWRmD * fHRmD * fHRmD; + double fDenominator + = 2.0 * (fHRmD * (fWRmD * fWRmD - fX * fX) + fWRmD * (fHRmD * fHRmD - fY * fY)); + if (fDenominator != 0.0) + { + fD = fD - fNumerator / fDenominator; + bFound = fabs(fOldD - fD) < 1.0E-12; + } + else + fD = fD * 0.9; // new start value + } while (nIter < 50 && !bFound); + return fD; +} + +bool EnhancedCustomShape2d::SetHandleControllerPosition( const sal_uInt32 nIndex, const css::awt::Point& rPosition ) +{ + // The method name is misleading. Essentially it calculates the adjustment values from a given + // handle position. + + // For ooxml-foo shapes, the way to calculate the adjustment value from the handle position depends on + // the type of the shape, therefore need 'Type'. + OUString sShapeType("non-primitive"); // default for ODF + const SdrCustomShapeGeometryItem& rGeometryItem(mrSdrObjCustomShape.GetMergedItem( SDRATTR_CUSTOMSHAPE_GEOMETRY )); + const Any* pAny = rGeometryItem.GetPropertyValueByName("Type"); + if (pAny) + *pAny >>= sShapeType; + + bool bRetValue = false; + if ( nIndex < GetHdlCount() ) + { + Handle aHandle; + if ( ConvertSequenceToEnhancedCustomShape2dHandle( seqHandles[ nIndex ], aHandle ) ) + { + Point aP( rPosition.X, rPosition.Y ); + // apply the negative object rotation to the controller position + + aP.Move( -aLogicRect.Left(), -aLogicRect.Top() ); + if ( bFlipH ) + aP.setX( aLogicRect.GetWidth() - aP.X() ); + if ( bFlipV ) + aP.setY( aLogicRect.GetHeight() - aP.Y() ); + if ( nRotateAngle ) + { + double a = -toRadians(nRotateAngle); + RotatePoint( aP, Point( aLogicRect.GetWidth() / 2, aLogicRect.GetHeight() / 2 ), sin( a ), cos( a ) ); + } + const GeoStat aGeoStat(mrSdrObjCustomShape.GetGeoStat()); + if ( aGeoStat.nShearAngle ) + { + double nTan = -aGeoStat.mfTanShearAngle; + if (bFlipV != bFlipH) + nTan = -nTan; + ShearPoint( aP, Point( aLogicRect.GetWidth() / 2, aLogicRect.GetHeight() / 2 ), nTan ); + } + + double fPos1 = aP.X(); //( bFlipH ) ? aLogicRect.GetWidth() - aP.X() : aP.X(); + double fPos2 = aP.Y(); //( bFlipV ) ? aLogicRect.GetHeight() -aP.Y() : aP.Y(); + fPos1 = !basegfx::fTools::equalZero(fXScale) ? (fPos1 / fXScale) : SAL_MAX_INT32; + fPos2 = !basegfx::fTools::equalZero(fYScale) ? (fPos2 / fYScale) : SAL_MAX_INT32; + // revert -nCoordLeft and -nCoordTop aus GetPoint() + fPos1 += nCoordLeft; + fPos2 += nCoordTop; + + // Used for scaling the adjustment values based on handle positions + double fWidth; + double fHeight; + + if ( nCoordWidth || nCoordHeight ) + { + fWidth = nCoordWidth; + fHeight = nCoordHeight; + } + else + { + fWidth = aLogicRect.GetWidth(); + fHeight = aLogicRect.GetHeight(); + } + + if ( aHandle.nFlags & HandleFlags::SWITCHED ) + { + if ( aLogicRect.GetHeight() > aLogicRect.GetWidth() ) + { + double fX = fPos1; + double fY = fPos2; + double fTmp = fWidth; + fPos1 = fY; + fPos2 = fX; + fHeight = fWidth; + fWidth = fTmp; + } + } + + sal_Int32 nFirstAdjustmentValue = -1, nSecondAdjustmentValue = -1; + + // ODF shapes are expected to use a direct binding between position and adjustment + // values. OOXML preset shapes use known formulas. These are calculated backward to + // get the adjustment values. So far we do not have a general method to calculate + // the adjustment values for any shape from the handle position. + if ( aHandle.aPosition.First.Type == EnhancedCustomShapeParameterType::ADJUSTMENT ) + aHandle.aPosition.First.Value >>= nFirstAdjustmentValue; + if ( aHandle.aPosition.Second.Type == EnhancedCustomShapeParameterType::ADJUSTMENT ) + aHandle.aPosition.Second.Value>>= nSecondAdjustmentValue; + + if ( aHandle.nFlags & ( HandleFlags::POLAR | HandleFlags::REFR | HandleFlags::REFANGLE)) + { // Polar-Handle + + if (aHandle.nFlags & HandleFlags::REFR) + nFirstAdjustmentValue = aHandle.nRefR; + if (aHandle.nFlags & HandleFlags::REFANGLE) + nSecondAdjustmentValue = aHandle.nRefAngle; + + double fAngle(0.0); + double fRadius(0.0); + // 'then' treats only shapes of type "ooxml-foo", fontwork shapes have been mapped + // to MS binary import and will be treated in 'else'. + if (bOOXMLShape) + { + // DrawingML polar handles set REFR or REFANGLE instead of POLAR + // use the shape center instead. + double fDX = fPos1 - fWidth / 2.0; + double fDY = fPos2 - fHeight / 2.0; + + // There exists no common pattern. 'radius' or 'angle' might have special meaning. + if (sShapeType == "ooxml-blockArc" && nIndex == 1) + { + // usual angle, special radius + fAngle = lcl_getAngleInOOXMLUnit(fDY, fDX); + // The value connected to REFR is the _difference_ between the outer + // ellipse given by shape width and height and the inner ellipse through + // the handle position. + double fRadiusDifference + = lcl_getRadiusDistance(fWidth / 2.0, fHeight / 2.0, fDX, fDY); + double fss(std::min(fWidth, fHeight)); + if (fss != 0) + fRadius = fRadiusDifference * 100000.0 / fss; + } + else if (sShapeType == "ooxml-donut" || sShapeType == "ooxml-noSmoking") + { + // no angle adjustment, radius bound to x-coordinate of handle + double fss(std::min(fWidth, fHeight)); + if (fss != 0.0) + fRadius = fPos1 * 100000.0 / fss; + } + else if ((sShapeType == "ooxml-circularArrow" + || sShapeType == "ooxml-leftRightCircularArrow" + || sShapeType == "ooxml-leftCircularArrow") + && nIndex == 0) + { + // The value adj2 is the increase compared to the angle in adj3 + double fHandleAngle = lcl_getAngleInOOXMLUnit(fDY, fDX); + if (sShapeType == "ooxml-leftCircularArrow") + fAngle = GetAdjustValueAsDouble(2) - fHandleAngle; + else + fAngle = fHandleAngle - GetAdjustValueAsDouble(2); + if (fAngle < 0.0) // 0deg to 360deg cut + fAngle += 21600000.0; + // no REFR + } + else if ((sShapeType == "ooxml-circularArrow" + || sShapeType == "ooxml-leftCircularArrow" + || sShapeType == "ooxml-leftRightCircularArrow") + && nIndex == 2) + { + // The value adj1 connected to REFR is the thickness of the arc. The adjustvalue adj5 + // has the _difference_ between the outer ellipse given by shape width and height + // and the middle ellipse of the arc. The handle is on the outer side of the + // arc. So we calculate the difference between the ellipse through the handle + // and the outer ellipse and subtract then. + double fRadiusDifferenceHandle + = lcl_getRadiusDistance(fWidth / 2.0, fHeight / 2.0, fDX, fDY); + double fadj5(GetAdjustValueAsDouble(4)); + double fss(std::min(fWidth, fHeight)); + if (fss != 0.0) + { + fadj5 = fadj5 * fss / 100000.0; + fRadius = 2.0 * (fadj5 - fRadiusDifferenceHandle); + fRadius = fRadius * 100000.0 / fss; + } + // ToDo: Get angle adj3 exact. Use approximation for now + fAngle = lcl_getAngleInOOXMLUnit(fDY, fDX); + } + else if ((sShapeType == "ooxml-circularArrow" + || sShapeType == "ooxml-leftCircularArrow" + || sShapeType == "ooxml-leftRightCircularArrow") + && nIndex == 3) + { + // ToDo: Getting handle position from adjustment value adj5 is complex. + // Analytical or numerical solution for backward calculation is missing. + // Approximation for now, using a line from center through handle position. + double fAngleRad(0.0); + if (fDX != 0.0 || fDY != 0.0) + fAngleRad = atan2(fDY, fDX); + double fHelpX = cos(fAngleRad) * fHeight / 2.0; + double fHelpY = sin(fAngleRad) * fWidth / 2.0; + if (fHelpX != 0.0 || fHelpY != 0.0) + { + double fHelpAngle = atan2(fHelpY, fHelpX); + double fOuterX = fWidth / 2.0 * cos(fHelpAngle); + double fOuterY = fHeight / 2.0 * sin(fHelpAngle); + double fOuterRadius = std::hypot(fOuterX, fOuterY); + double fHandleRadius = std::hypot(fDX, fDY); + fRadius = (fOuterRadius - fHandleRadius) / 2.0; + double fss(std::min(fWidth, fHeight)); + if (fss != 0.0) + fRadius = fRadius * 100000.0 / fss; + } + // no REFANGLE + } + else if (sShapeType == "ooxml-mathNotEqual" && nIndex == 1) + { + double fadj1(GetAdjustValueAsDouble(0)); + double fadj3(GetAdjustValueAsDouble(2)); + fadj1 = fadj1 * fHeight / 100000.0; + fadj3 = fadj3 * fHeight / 100000.0; + double fDYRefHorizBar = fDY + fadj1 + fadj3; + if (fDX != 0.0 || fDYRefHorizBar != 0.0) + { + double fRawAngleDeg = basegfx::rad2deg(atan2(fDYRefHorizBar, fDX)); + fAngle = (fRawAngleDeg + 180.0) * 60000.0; + } + // no REFR + } + else + { + // no special meaning of radius or angle, suitable for "ooxml-arc", + // "ooxml-chord", "ooxml-pie" and circular arrows value adj4. + fAngle = lcl_getAngleInOOXMLUnit(fDY, fDX); + fRadius = std::hypot(fDX, fDY); + double fss(std::min(fWidth, fHeight)); + if (fss != 0.0) + fRadius = fRadius * 100000.0 / fss; + } + } + else // e.g. shapes from ODF, MS binary import or shape type "fontwork-foo" + { + double fXRef, fYRef; + if (aHandle.nFlags & HandleFlags::POLAR) + { + GetParameter(fXRef, aHandle.aPolar.First, false, false); + GetParameter(fYRef, aHandle.aPolar.Second, false, false); + } + else + { + fXRef = fWidth / 2.0; + fYRef = fHeight / 2.0; + } + const double fDX = fPos1 - fXRef; + const double fDY = fPos2 - fYRef; + // ToDo: MS binary uses fixed-point number for the angle. Make sure conversion + // to double is done in import and export. + // ToDo: Angle unit is degree, but range ]-180;180] or [0;360[? Assume ]-180;180]. + if (fDX != 0.0 || fDY != 0.0) + { + fRadius = std::hypot(fDX, fDY); + fAngle = basegfx::rad2deg(atan2(fDY, fDX)); + } + } + + // All formats can restrict the radius to a range + if ( aHandle.nFlags & HandleFlags::RADIUS_RANGE_MINIMUM ) + { + double fMin; + GetParameter( fMin, aHandle.aRadiusRangeMinimum, false, false ); + if ( fRadius < fMin ) + fRadius = fMin; + } + if ( aHandle.nFlags & HandleFlags::RADIUS_RANGE_MAXIMUM ) + { + double fMax; + GetParameter( fMax, aHandle.aRadiusRangeMaximum, false, false ); + if ( fRadius > fMax ) + fRadius = fMax; + } + + if ( nFirstAdjustmentValue >= 0 ) + SetAdjustValueAsDouble( fRadius, nFirstAdjustmentValue ); + if ( nSecondAdjustmentValue >= 0 ) + SetAdjustValueAsDouble( fAngle, nSecondAdjustmentValue ); + } + else // XY-Handle + { + // Calculating the adjustment values follows in most cases some patterns, which only + // need width and height of the shape and handle position. These patterns are calculated + // in the static, local methods. More complex calculations or additional steps are + // done here. + // Values for corner cases like 'root(negative)' or 'div zero' are meaningless dummies. + // Identifiers often refer to guide names in OOXML shape definitions. + double fAdjustX = fPos1; + double fAdjustY = fPos2; + if (aHandle.nFlags & HandleFlags::REFX) + { + nFirstAdjustmentValue = aHandle.nRefX; + if ((sShapeType == "ooxml-gear6") || (sShapeType == "ooxml-gear9")) + { + // special, needs angle calculations + double fss(std::min(fWidth, fHeight)); + double fadj1(GetAdjustValueAsDouble(0)); // from point D6 or D9 + double fth(fadj1 * fss / 100000.0); // radius difference + double frw(fWidth / 2.0 - fth); // inner ellipse + double frh(fHeight / 2.0 - fth); + double fDX(fPos1 - fWidth / 2.0); + double fDY(fPos2 - fHeight / 2.0); + double fbA(-1.7); // effective angle for point A6 or A9, dummy value + if (fDX != 0.0 || fDY != 0.0) + fbA = atan2(fDY, fDX); + double faA(fbA); // corresponding circle angle, dummy value + double ftmpX(frh * cos(fbA)); + double ftmpY(frw * sin(fbA)); + if (ftmpX != 0.0 || ftmpY != 0.0) + faA = atan2(ftmpY, ftmpX); // range ]-pi..pi], here -pi < faA < -pi/2 + // screen 270 deg = mathematic coordinate system -pi/2 + double fha(-M_PI_2 - faA); // positive circle angle difference to 270 deg + if (abs(fha) == M_PI_2) // should not happen, but ensure no tan(90deg) + fha = 0.12; // dummy value + double flFD(2 * std::min(frw, frh) * tan(fha) - fth); + if (fss != 0.0) + fAdjustX = flFD / fss * 100000.0; + } + else + { + fAdjustX + = lcl_getXAdjustmentValue(sShapeType, nIndex, fPos1, fWidth, fHeight); + if ((sShapeType == "ooxml-curvedDownArrow") + || (sShapeType == "ooxml-curvedUpArrow")) + { + double fss(std::min(fWidth, fHeight)); + if (fss != 0.0) + { + double fadj3(GetAdjustValueAsDouble(2)); + double fHScaled(100000.0 * fHeight / fss); + double fRadicand(fHScaled * fHScaled - fadj3 * fadj3); + double fSqrt = fRadicand >= 0.0 ? sqrt(fRadicand) : 0.0; + double fPart(200000.0 * fWidth / fss * (fSqrt + fHScaled)); + fAdjustX = fPart - 4.0 * fHScaled * fAdjustX; + if (nIndex == 0) + { + // calculate adj1 + double fadj2(GetAdjustValueAsDouble(1)); + fAdjustX = fAdjustX - fadj2 * (fSqrt + fHScaled); + double fDenominator(fSqrt - 3.0 * fHScaled); + fAdjustX /= fDenominator != 0.0 ? fDenominator : 1.0; + } + else + { + // nIndex == 1, calculate adj2 + double fadj1(GetAdjustValueAsDouble(0)); + fAdjustX = fAdjustX - fadj1 * (fSqrt - fHScaled); + double fDenominator(fSqrt + 3.0 * fHScaled); + fAdjustX /= fDenominator != 0.0 ? fDenominator : 1.0; + } + } + } + } + } + + if (aHandle.nFlags & HandleFlags::REFY) + { + nSecondAdjustmentValue = aHandle.nRefY; + if ((sShapeType == "ooxml-gear6") || (sShapeType == "ooxml-gear9")) + { + // special, acts more like a polar handle radius + double fDX = fPos1 - fWidth / 2.0; + double fDY = fPos2 - fHeight / 2.0; + double fRadiusDifference + = lcl_getRadiusDistance(fWidth / 2.0, fHeight / 2.0, fDX, fDY); + double fss(std::min(fWidth, fHeight)); + if (fss != 0) + fAdjustY = fRadiusDifference / fss * 100000.0; + } + else + { + fAdjustY + = lcl_getYAdjustmentValue(sShapeType, nIndex, fPos2, fWidth, fHeight); + if (sShapeType == "ooxml-mathDivide" && nIndex == 1) + fAdjustY = fAdjustY - GetAdjustValueAsDouble(0) / 2.0 + - GetAdjustValueAsDouble(2); + else if (sShapeType == "ooxml-mathEqual" && nIndex == 0) + fAdjustY -= GetAdjustValueAsDouble(1) / 2.0; + else if (sShapeType == "ooxml-mathNotEqual" && nIndex == 0) + fAdjustY -= GetAdjustValueAsDouble(2) / 2.0; + else if (sShapeType == "ooxml-leftUpArrow" && nIndex == 0) + fAdjustY -= GetAdjustValueAsDouble(1) * 2.0; + else if ((sShapeType == "ooxml-curvedRightArrow") + || (sShapeType == "ooxml-curvedLeftArrow")) + { + double fss(std::min(fWidth, fHeight)); + if (fss != 0.0) + { + double fadj3(GetAdjustValueAsDouble(2)); + double fWScaled(100000.0 * fWidth / fss); + double fRadicand(fWScaled * fWScaled - fadj3 * fadj3); + double fSqrt = fRadicand >= 0.0 ? sqrt(fRadicand) : 0.0; + if (nIndex == 0) + { + // calculate adj1 + double fadj2(GetAdjustValueAsDouble(1)); + fAdjustY = fWScaled * (2.0 * fAdjustY - fadj2); + fAdjustY += (200000.0 / fss * fHeight - fadj2) * fSqrt; + double fDenominator(fSqrt + fWScaled); + fAdjustY /= fDenominator != 0.0 ? fDenominator : 1.0; + } + else + { + // nIndex == 1, calculate adj2 + double fadj1(GetAdjustValueAsDouble(0)); + fAdjustY = fWScaled * (2.0 * fAdjustY + fadj1); + fAdjustY += (200000.0 / fss * fHeight - fadj1) * fSqrt; + double fDenominator(fSqrt + 3.0 * fWScaled); + fAdjustY /= fDenominator != 0.0 ? fDenominator : 1.0; + } + } + } + else if (sShapeType == "ooxml-uturnArrow" && nIndex == 2) + { + double fss(std::min(fWidth, fHeight)); + if (fss != 0.0) + { + double fadj5(GetAdjustValueAsDouble(4)); + fAdjustY += fHeight / fss * (fadj5 - 100000.0); + } + } + else if (sShapeType == "ooxml-leftRightRibbon") + { + if (nIndex == 0) + fAdjustY = GetAdjustValueAsDouble(2) - fAdjustY; + else // nIndex == 2 + fAdjustY = GetAdjustValueAsDouble(0) + fAdjustY; + } + } + } + + if ( nFirstAdjustmentValue >= 0 ) + { + if ( aHandle.nFlags & HandleFlags::RANGE_X_MINIMUM ) // check if horizontal handle needs to be within a range + { + double fXMin; + GetParameter( fXMin, aHandle.aXRangeMinimum, false, false ); + if (fAdjustX < fXMin) + fAdjustX = fXMin; + } + if ( aHandle.nFlags & HandleFlags::RANGE_X_MAXIMUM ) // check if horizontal handle needs to be within a range + { + double fXMax; + GetParameter( fXMax, aHandle.aXRangeMaximum, false, false ); + if (fAdjustX > fXMax) + fAdjustX = fXMax; + } + SetAdjustValueAsDouble(fAdjustX, nFirstAdjustmentValue); + } + if ( nSecondAdjustmentValue >= 0 ) + { + if ( aHandle.nFlags & HandleFlags::RANGE_Y_MINIMUM ) // check if vertical handle needs to be within a range + { + double fYMin; + GetParameter( fYMin, aHandle.aYRangeMinimum, false, false ); + if (fAdjustY < fYMin) + fAdjustY = fYMin; + } + if ( aHandle.nFlags & HandleFlags::RANGE_Y_MAXIMUM ) // check if vertical handle needs to be within a range + { + double fYMax; + GetParameter( fYMax, aHandle.aYRangeMaximum, false, false ); + if (fAdjustY > fYMax) + fAdjustY = fYMax; + } + SetAdjustValueAsDouble(fAdjustY, nSecondAdjustmentValue); + } + } + // and writing them back into the GeometryItem + SdrCustomShapeGeometryItem aGeometryItem(mrSdrObjCustomShape.GetMergedItem( SDRATTR_CUSTOMSHAPE_GEOMETRY )); + css::beans::PropertyValue aPropVal; + aPropVal.Name = "AdjustmentValues"; + aPropVal.Value <<= seqAdjustmentValues; + aGeometryItem.SetPropertyValue( aPropVal ); + mrSdrObjCustomShape.SetMergedItem( aGeometryItem ); + bRetValue = true; + } + } + return bRetValue; +} + +void EnhancedCustomShape2d::SwapStartAndEndArrow( SdrObject* pObj ) //#108274 +{ + XLineStartItem aLineStart; + aLineStart.SetLineStartValue(pObj->GetMergedItem( XATTR_LINEEND ).GetLineEndValue()); + XLineStartWidthItem aLineStartWidth(pObj->GetMergedItem( XATTR_LINEENDWIDTH ).GetValue()); + XLineStartCenterItem aLineStartCenter(pObj->GetMergedItem( XATTR_LINEENDCENTER ).GetValue()); + + XLineEndItem aLineEnd; + aLineEnd.SetLineEndValue(pObj->GetMergedItem( XATTR_LINESTART ).GetLineStartValue()); + XLineEndWidthItem aLineEndWidth(pObj->GetMergedItem( XATTR_LINESTARTWIDTH ).GetValue()); + XLineEndCenterItem aLineEndCenter(pObj->GetMergedItem( XATTR_LINESTARTCENTER ).GetValue()); + + pObj->SetMergedItem( aLineStart ); + pObj->SetMergedItem( aLineStartWidth ); + pObj->SetMergedItem( aLineStartCenter ); + pObj->SetMergedItem( aLineEnd ); + pObj->SetMergedItem( aLineEndWidth ); + pObj->SetMergedItem( aLineEndCenter ); +} + +static basegfx::B2DPolygon CreateArc( const tools::Rectangle& rRect, const Point& rStart, const Point& rEnd, const bool bClockwise ) +{ + tools::Rectangle aRect( rRect ); + Point aStart( rStart ); + Point aEnd( rEnd ); + + sal_Int32 bSwapStartEndAngle = 0; + + if ( aRect.Left() > aRect.Right() ) + bSwapStartEndAngle ^= 0x01; + if ( aRect.Top() > aRect.Bottom() ) + bSwapStartEndAngle ^= 0x11; + if ( bSwapStartEndAngle ) + { + aRect.Justify(); + if ( bSwapStartEndAngle & 1 ) + { + Point aTmp( aStart ); + aStart = aEnd; + aEnd = aTmp; + } + } + + tools::Polygon aTempPoly( aRect, aStart, aEnd, PolyStyle::Arc ); + basegfx::B2DPolygon aRetval; + + if ( bClockwise ) + { + for ( sal_uInt16 j = aTempPoly.GetSize(); j--; ) + { + aRetval.append(basegfx::B2DPoint(aTempPoly[ j ].X(), aTempPoly[ j ].Y())); + } + } + else + { + for ( sal_uInt16 j = 0; j < aTempPoly.GetSize(); j++ ) + { + aRetval.append(basegfx::B2DPoint(aTempPoly[ j ].X(), aTempPoly[ j ].Y())); + } + } + + return aRetval; +} + +static double lcl_getNormalizedCircleAngleRad(const double fWR, const double fHR, const double fEllipseAngleDeg) +{ + double fRet(0.0); + double fEAngleDeg(fmod(fEllipseAngleDeg, 360.0)); + if (fEAngleDeg < 0.0) + fEAngleDeg += 360.0; + if (fEAngleDeg == 0.0 || fEAngleDeg == 90.0 || fEAngleDeg == 180.0 || fEAngleDeg == 270.0) + return basegfx::deg2rad(fEAngleDeg); + const double fX(fHR * cos(basegfx::deg2rad(fEAngleDeg))); + const double fY(fWR * sin(basegfx::deg2rad(fEAngleDeg))); + if (fX != 0.0 || fY != 0.0) + { + fRet = atan2(fY, fX); + if (fRet < 0.0) + fRet += 2 * M_PI; + } + return fRet; +} + +static double lcl_getNormalizedAngleRad(const double fCircleAngleDeg) +{ + double fRet(fmod(fCircleAngleDeg, 360.0)); + if (fRet < 0.0) + fRet += 360.0; + return basegfx::deg2rad(fRet); +} + +void EnhancedCustomShape2d::CreateSubPath( + sal_Int32& rSrcPt, + sal_Int32& rSegmentInd, + std::vector< std::pair< SdrPathObjUniquePtr, double> >& rObjectList, + const bool bLineGeometryNeededOnly, + const bool bSortFilledObjectsToBack, + sal_Int32 nIndex) +{ + bool bNoFill = false; + bool bNoStroke = false; + double dBrightness = 0.0; //no blending + + basegfx::B2DPolyPolygon aNewB2DPolyPolygon; + basegfx::B2DPolygon aNewB2DPolygon; + + SetPathSize( nIndex ); + + sal_Int32 nSegInfoSize = seqSegments.getLength(); + if ( !nSegInfoSize ) + { + for ( const EnhancedCustomShapeParameterPair& rCoordinate : std::as_const(seqCoordinates) ) + { + const Point aTempPoint(GetPoint( rCoordinate, true, true )); + aNewB2DPolygon.append(basegfx::B2DPoint(aTempPoint.X(), aTempPoint.Y())); + } + + aNewB2DPolygon.setClosed(true); + } + else + { + sal_Int32 nCoordSize = seqCoordinates.getLength(); + for ( ;rSegmentInd < nSegInfoSize; ) + { + sal_Int16 nCommand = seqSegments[ rSegmentInd ].Command; + sal_Int16 nPntCount= seqSegments[ rSegmentInd++ ].Count; + + switch ( nCommand ) + { + case NOFILL : + bNoFill = true; + break; + case NOSTROKE : + bNoStroke = true; + break; + case DARKEN : + dBrightness = -0.4; //use sign to distinguish DARKEN from LIGHTEN + break; + case DARKENLESS : + dBrightness = -0.2; + break; + case LIGHTEN : + dBrightness = 0.4; + break; + case LIGHTENLESS : + dBrightness = 0.2; + break; + case MOVETO : + { + if(aNewB2DPolygon.count() > 1) + { + // #i76201# Add conversion to closed polygon when first and last points are equal + basegfx::utils::checkClosed(aNewB2DPolygon); + aNewB2DPolyPolygon.append(aNewB2DPolygon); + } + + aNewB2DPolygon.clear(); + + if ( rSrcPt < nCoordSize ) + { + const Point aTempPoint(GetPoint( seqCoordinates[ rSrcPt++ ], true, true )); + SAL_INFO( + "svx", + "moveTo: " << aTempPoint.X() << "," + << aTempPoint.Y()); + aNewB2DPolygon.append(basegfx::B2DPoint(aTempPoint.X(), aTempPoint.Y())); + } + } + break; + case ENDSUBPATH : + break; + case CLOSESUBPATH : + { + if(aNewB2DPolygon.count()) + { + if(aNewB2DPolygon.count() > 1) + { + aNewB2DPolygon.setClosed(true); + aNewB2DPolyPolygon.append(aNewB2DPolygon); + } + + aNewB2DPolygon.clear(); + } + } + break; + case CURVETO : + { + for ( sal_uInt16 i = 0; ( i < nPntCount ) && ( ( rSrcPt + 2 ) < nCoordSize ); i++ ) + { + const Point aControlA(GetPoint( seqCoordinates[ rSrcPt++ ], true, true )); + const Point aControlB(GetPoint( seqCoordinates[ rSrcPt++ ], true, true )); + const Point aEnd(GetPoint( seqCoordinates[ rSrcPt++ ], true, true )); + + DBG_ASSERT(aNewB2DPolygon.count(), "EnhancedCustomShape2d::CreateSubPath: Error in adding control point (!)"); + aNewB2DPolygon.appendBezierSegment( + basegfx::B2DPoint(aControlA.X(), aControlA.Y()), + basegfx::B2DPoint(aControlB.X(), aControlB.Y()), + basegfx::B2DPoint(aEnd.X(), aEnd.Y())); + } + } + break; + + case ANGLEELLIPSE: // command U + case ANGLEELLIPSETO: // command T + { + // Some shapes will need special handling, decide on property 'Type'. + OUString sShpType; + SdrCustomShapeGeometryItem& rGeometryItem = const_cast<SdrCustomShapeGeometryItem&>(mrSdrObjCustomShape.GetMergedItem(SDRATTR_CUSTOMSHAPE_GEOMETRY)); + Any* pAny = rGeometryItem.GetPropertyValueByName("Type"); + if (pAny) + *pAny >>= sShpType; + // User defined shapes in MS binary format, which contain command U or T after import + // in LibreOffice, starts with "mso". + const bool bIsFromBinaryImport(sShpType.startsWith("mso")); + // The only own or imported preset shapes with U command are those listed below. + // Command T is not used in preset shapes. + const std::unordered_set<OUString> aPresetShapesWithU = + { "ellipse", "ring", "smiley", "sun", "forbidden", "flowchart-connector", + "flowchart-summing-junction", "flowchart-or", "cloud-callout"}; + std::unordered_set<OUString>::const_iterator aIter = aPresetShapesWithU.find(sShpType); + const bool bIsPresetShapeWithU(aIter != aPresetShapesWithU.end()); + + for (sal_uInt16 i = 0; (i < nPntCount) && ((rSrcPt + 2) < nCoordSize); i++) + { + // ANGLEELLIPSE is the same as ANGLEELLIPSETO, only that it + // makes an implicit MOVETO. That ends the previous subpath. + if (ANGLEELLIPSE == nCommand) + { + if (aNewB2DPolygon.count() > 1) + { + // #i76201# Add conversion to closed polygon when first and last points are equal + basegfx::utils::checkClosed(aNewB2DPolygon); + aNewB2DPolyPolygon.append(aNewB2DPolygon); + } + aNewB2DPolygon.clear(); + } + + // Read all parameters, but do not finally handle them. + basegfx::B2DPoint aCenter(GetPointAsB2DPoint(seqCoordinates[ rSrcPt ], true, true)); + double fWR; // horizontal ellipse radius + double fHR; // vertical ellipse radius + GetParameter(fWR, seqCoordinates[rSrcPt + 1].First, true, false); + GetParameter(fHR, seqCoordinates[rSrcPt + 1].Second, false, true); + double fStartAngle; + GetParameter(fStartAngle, seqCoordinates[rSrcPt + 2].First, false, false); + double fEndAngle; + GetParameter(fEndAngle, seqCoordinates[rSrcPt + 2].Second, false, false); + // Increasing here allows flat case differentiation tree by using 'continue'. + rSrcPt += 3; + + double fScaledWR(fWR * fXScale); + double fScaledHR(fHR * fYScale); + if (fScaledWR == 0.0 && fScaledHR == 0.0) + { + // degenerated ellipse, add center point + aNewB2DPolygon.append(aCenter); + continue; + } + + if (bIsFromBinaryImport) + { + // If a shape comes from MS binary ('escher') import, the angles are in degrees*2^16 + // and the second angle is not an end angle, but a swing angle. + // MS Word shows this behavior: 0deg right, 90deg top, 180deg left and 270deg + // bottom. Third and forth parameter are horizontal and vertical radius, not width + // and height as noted in VML spec. A positive swing angle goes counter-clock + // wise (in user view). The swing angle might go several times around in case + // abs(swing angle) >= 360deg. Stroke accumulates, so that e.g. dash-dot might fill the + // gaps of previous turn. Fill does not accumulate but uses even-odd rule, semi-transparent + // fill does not become darker. The start and end points of the arc are calculated by + // using the angles on a circle and then scaling the circle to the ellipse. Caution, that + // is different from angle handling in ARCANGLETO and ODF. + // The following implementation generates such rendering. It is only for rendering legacy + // MS shapes and independent of the meaning of commands U and T in ODF specification. + + // The WordArt shape 'RingOutside' has already angles in degree, all other need + // conversion from fixed-point number. + double fSwingAngle = fEndAngle; + if (sShpType != "mso-spt143") + { + fStartAngle /= 65536.0; + fSwingAngle = fEndAngle / 65536.0; + } + // Convert orientation + fStartAngle = -fStartAngle; + fSwingAngle = -fSwingAngle; + + fEndAngle = fStartAngle + fSwingAngle; + if (fSwingAngle < 0.0) + std::swap(fStartAngle, fEndAngle); + double fFrom(fStartAngle); + double fTo(fFrom + 180.0); + basegfx::B2DPolygon aTempB2DPolygon; + double fS; // fFrom in radians in [0..2Pi[ + double fE; // fTo or fEndAngle in radians in [0..2PI[ + while (fTo < fEndAngle) + { + fS = lcl_getNormalizedAngleRad(fFrom); + fE = lcl_getNormalizedAngleRad(fTo); + aTempB2DPolygon.append(basegfx::utils::createPolygonFromEllipseSegment(aCenter, fScaledWR, fScaledHR, fS,fE)); + fFrom = fTo; + fTo += 180.0; + } + fS = lcl_getNormalizedAngleRad(fFrom); + fE = lcl_getNormalizedAngleRad(fEndAngle); + aTempB2DPolygon.append(basegfx::utils::createPolygonFromEllipseSegment(aCenter, fScaledWR, fScaledHR,fS, fE)); + if (fSwingAngle < 0) + aTempB2DPolygon.flip(); + aNewB2DPolygon.append(aTempB2DPolygon); + continue; + } + + // The not yet handled shapes are own preset shapes, or preset shapes from MS binary import, or user + // defined shapes, or foreign shapes. Shapes from OOXML import do not use ANGLEELLIPSE or + // ANGLEELLIPSETO, but use ARCANGLETO. + if (bIsPresetShapeWithU) + { + // Besides "cloud-callout" all preset shapes have angle values '0 360'. + // The imported "cloud-callout" has angle values '0 360' too, only our own "cloud-callout" + // has values '0 23592960'. But that is fixedfloat and means 360*2^16. Thus all these shapes + // have a full ellipse with start at 0deg. + aNewB2DPolygon.append(basegfx::utils::createPolygonFromEllipse(aCenter, fScaledWR, fScaledHR)); + continue; + } + + // In all other cases, full ODF conform handling is necessary. ODF rules: + // Third and forth parameter are horizontal and vertical radius. + // An angle determines the start or end point of the segment by intersection of the second angle + // leg with the ellipse. The first angle leg is always the positive x-axis. For the position + // of the intersection points the angle is used modulo 360deg in range [0deg..360deg[. + // The position of range [0deg..360deg[ is the same as in command ARCANGLETO, with 0deg right, + // 90deg bottom, 180deg left and 270deg top. Only if abs(end angle - start angle) == 360 deg, + // a full ellipse is drawn. The segment is always drawn clock wise (in user view) from start + // point to end point. The end point of the segment becomes the new "current" point. + + if (fabs(fabs(fEndAngle - fStartAngle) - 360.0) < 1.0E-15) + { + // draw full ellipse + // Because createPolygonFromEllipseSegment cannot create full ellipse and + // createPolygonFromEllipse has no varying starts, we use two half ellipses. + const double fS(lcl_getNormalizedCircleAngleRad(fWR, fHR, fStartAngle)); + const double fH(lcl_getNormalizedCircleAngleRad(fWR, fHR, fStartAngle + 180.0)); + const double fE(lcl_getNormalizedCircleAngleRad(fWR, fHR, fEndAngle)); + aNewB2DPolygon.append(basegfx::utils::createPolygonFromEllipseSegment(aCenter, fScaledWR, fScaledHR, fS, fH)); + aNewB2DPolygon.append(basegfx::utils::createPolygonFromEllipseSegment(aCenter, fScaledWR, fScaledHR, fH, fE)); + continue; + } + + // remaining cases with central segment angle < 360 + double fS(lcl_getNormalizedCircleAngleRad(fWR, fHR, fStartAngle)); + double fE(lcl_getNormalizedCircleAngleRad(fWR, fHR, fEndAngle)); + aNewB2DPolygon.append(basegfx::utils::createPolygonFromEllipseSegment(aCenter, fScaledWR, fScaledHR, fS, fE)); + } // end for + } // end case + break; + + case QUADRATICCURVETO : + { + for ( sal_Int32 i(0); ( i < nPntCount ) && ( rSrcPt + 1 < nCoordSize ); i++ ) + { + DBG_ASSERT(aNewB2DPolygon.count(), "EnhancedCustomShape2d::CreateSubPath: Error no previous point for Q (!)"); + if (aNewB2DPolygon.count() > 0) + { + const basegfx::B2DPoint aPreviousEndPoint(aNewB2DPolygon.getB2DPoint(aNewB2DPolygon.count()-1)); + const basegfx::B2DPoint aControlQ(GetPointAsB2DPoint( seqCoordinates[ rSrcPt++ ], true, true )); + const basegfx::B2DPoint aEnd(GetPointAsB2DPoint( seqCoordinates[ rSrcPt++ ], true, true )); + const basegfx::B2DPoint aControlA((aPreviousEndPoint + (aControlQ * 2)) / 3); + const basegfx::B2DPoint aControlB(((aControlQ * 2) + aEnd) / 3); + aNewB2DPolygon.appendBezierSegment(aControlA, aControlB, aEnd); + } + else // no previous point; ill structured path, but try to draw as much as possible + { + rSrcPt++; // skip control point + const basegfx::B2DPoint aEnd(GetPointAsB2DPoint( seqCoordinates[ rSrcPt++ ], true, true )); + aNewB2DPolygon.append(aEnd); + } + } + } + break; + + case LINETO : + { + for ( sal_Int32 i(0); ( i < nPntCount ) && ( rSrcPt < nCoordSize ); i++ ) + { + const Point aTempPoint(GetPoint( seqCoordinates[ rSrcPt++ ], true, true )); + SAL_INFO( + "svx", + "lineTo: " << aTempPoint.X() << "," + << aTempPoint.Y()); + aNewB2DPolygon.append(basegfx::B2DPoint(aTempPoint.X(), aTempPoint.Y())); + } + } + break; + + case ARC : + case CLOCKWISEARC : + case ARCTO : + case CLOCKWISEARCTO : + { + bool bClockwise = ( nCommand == CLOCKWISEARC ) || ( nCommand == CLOCKWISEARCTO ); + bool bImplicitMoveTo = (nCommand == ARC) || (nCommand == CLOCKWISEARC); + sal_uInt32 nXor = bClockwise ? 3 : 2; + for ( sal_uInt16 i = 0; ( i < nPntCount ) && ( ( rSrcPt + 3 ) < nCoordSize ); i++ ) + { + if (bImplicitMoveTo) + { + if (aNewB2DPolygon.count() > 1) + { + // #i76201# Add conversion to closed polygon when first and last + // points are equal + basegfx::utils::checkClosed(aNewB2DPolygon); + aNewB2DPolyPolygon.append(aNewB2DPolygon); + } + aNewB2DPolygon.clear(); + } + tools::Rectangle aRect = tools::Rectangle::Justify( GetPoint( seqCoordinates[ rSrcPt ], true, true ), GetPoint( seqCoordinates[ rSrcPt + 1 ], true, true ) ); + if ( aRect.GetWidth() && aRect.GetHeight() ) + { + Point aStart( GetPoint( seqCoordinates[ static_cast<sal_uInt16>( rSrcPt + nXor ) ], true, true ) ); + Point aEnd( GetPoint( seqCoordinates[ static_cast<sal_uInt16>( rSrcPt + ( nXor ^ 1 ) ) ], true, true ) ); + aNewB2DPolygon.append(CreateArc( aRect, aStart, aEnd, bClockwise)); + } + rSrcPt += 4; + } + } + break; + + case ARCANGLETO : + { + double fWR, fHR; // in Shape coordinate system + double fStartAngle, fSwingAngle; // in deg + + for ( sal_uInt16 i = 0; ( i < nPntCount ) && ( rSrcPt + 1 < nCoordSize ); i++ ) + { + basegfx::B2DPoint aTempPair; + aTempPair = GetPointAsB2DPoint(seqCoordinates[static_cast<sal_uInt16>(rSrcPt)], false /*bScale*/, false /*bReplaceGeoSize*/); + fWR = aTempPair.getX(); + fHR = aTempPair.getY(); + aTempPair = GetPointAsB2DPoint(seqCoordinates[static_cast<sal_uInt16>(rSrcPt + 1)], false /*bScale*/, false /*bReplaceGeoSize*/); + fStartAngle = aTempPair.getX(); + fSwingAngle = aTempPair.getY(); + + // tdf#122323 MS Office clamps the swing angle to [-360,360]. Such restriction + // is neither in OOXML nor in ODF. Nevertheless, to be compatible we do it for + // "ooxml-foo" shapes. Those shapes have their origin in MS Office. + if (bOOXMLShape) + { + fSwingAngle = std::clamp(fSwingAngle, -360.0, 360.0); + } + + SAL_INFO("svx", "ARCANGLETO scale: " << fWR << "x" << fHR << " angles: " << fStartAngle << "," << fSwingAngle); + + if (aNewB2DPolygon.count() > 0) // otherwise no "current point" + { + // use similar methods as in command U + basegfx::B2DPolygon aTempB2DPolygon; + + if (fWR == 0.0 && fHR == 0.0) + { + // degenerated ellipse, add this one point + aTempB2DPolygon.append(basegfx::B2DPoint(0.0, 0.0)); + } + else + { + double fEndAngle = fStartAngle + fSwingAngle; + // Generate arc with ellipse left|top = 0|0. + basegfx::B2DPoint aCenter(fWR, fHR); + if (fSwingAngle < 0.0) + std::swap(fStartAngle, fEndAngle); + double fS; // fFrom in radians in [0..2Pi[ + double fE; // fTo or fEndAngle in radians in [0..2PI[ + double fFrom(fStartAngle); + // createPolygonFromEllipseSegment expects angles in [0..2PI[. + if (fSwingAngle >= 360.0 || fSwingAngle <= -360.0) + { + double fTo(fFrom + 180.0); + while (fTo < fEndAngle) + { + fS = lcl_getNormalizedCircleAngleRad(fWR, fHR, fFrom); + fE = lcl_getNormalizedCircleAngleRad(fWR, fHR, fTo); + aTempB2DPolygon.append(basegfx::utils::createPolygonFromEllipseSegment(aCenter, fWR, fHR, fS,fE)); + fFrom = fTo; + fTo += 180.0; + } + } + fS = lcl_getNormalizedCircleAngleRad(fWR, fHR, fFrom); + fE = lcl_getNormalizedCircleAngleRad(fWR, fHR, fEndAngle); + aTempB2DPolygon.append(basegfx::utils::createPolygonFromEllipseSegment(aCenter, fWR, fHR,fS, fE)); + if (fSwingAngle < 0) + aTempB2DPolygon.flip(); + aTempB2DPolygon.removeDoublePoints(); + } + // Scale arc to 1/100mm + basegfx::B2DHomMatrix aMatrix = basegfx::utils::createScaleB2DHomMatrix(fXScale, fYScale); + aTempB2DPolygon.transform(aMatrix); + + // Now that we have the arc, move it to the "current point". + basegfx::B2DPoint aCurrentPointB2D( aNewB2DPolygon.getB2DPoint(aNewB2DPolygon.count() - 1 ) ); + const double fDx(aCurrentPointB2D.getX() - aTempB2DPolygon.getB2DPoint(0).getX()); + const double fDy(aCurrentPointB2D.getY() - aTempB2DPolygon.getB2DPoint(0).getY()); + aMatrix = basegfx::utils::createTranslateB2DHomMatrix(fDx, fDy); + aTempB2DPolygon.transform(aMatrix); + aNewB2DPolygon.append(aTempB2DPolygon); + } + + rSrcPt += 2; + } + } + break; + + case ELLIPTICALQUADRANTX : + case ELLIPTICALQUADRANTY : + { + if (nPntCount && (rSrcPt < nCoordSize)) + { + // The arc starts at the previous point and ends at the point given in the parameter. + basegfx::B2DPoint aStart; + basegfx::B2DPoint aEnd; + sal_uInt16 i = 0; + if (rSrcPt) + { + aStart = GetPointAsB2DPoint(seqCoordinates[rSrcPt - 1], true, true); + } + else + { // no previous point, path is ill-structured. But we want to show as much as possible. + // Thus make a moveTo to the point given as parameter and continue from there. + aStart = GetPointAsB2DPoint(seqCoordinates[static_cast<sal_uInt16>(rSrcPt)], true, true); + aNewB2DPolygon.append(aStart); + rSrcPt++; + i++; + } + // If there are several points, then the direction changes with every point. + bool bIsXDirection(nCommand == ELLIPTICALQUADRANTX); + basegfx::B2DPolygon aArc; + for ( ; ( i < nPntCount ) && ( rSrcPt < nCoordSize ); i++ ) + { + aEnd = GetPointAsB2DPoint(seqCoordinates[rSrcPt], true, true); + basegfx::B2DPoint aCenter; + double fRadiusX = fabs(aEnd.getX() - aStart.getX()); + double fRadiusY = fabs(aEnd.getY() - aStart.getY()); + if (bIsXDirection) + { + aCenter = basegfx::B2DPoint(aStart.getX(),aEnd.getY()); + if (aEnd.getX()<aStart.getX()) + { + if (aEnd.getY()<aStart.getY()) // left, up + { + aArc = basegfx::utils::createPolygonFromEllipseSegment(aCenter, fRadiusX, fRadiusY, M_PI_2, M_PI); + } + else // left, down + { + aArc = basegfx::utils::createPolygonFromEllipseSegment(aCenter, fRadiusX, fRadiusY, M_PI, 1.5*M_PI); + aArc.flip(); + } + } + else // aEnd.getX()>=aStart.getX() + { + if (aEnd.getY()<aStart.getY()) // right, up + { + aArc = basegfx::utils::createPolygonFromEllipseSegment(aCenter, fRadiusX, fRadiusY, 0.0, M_PI_2); + aArc.flip(); + } + else // right, down + { + aArc = basegfx::utils::createPolygonFromEllipseSegment(aCenter, fRadiusX, fRadiusY, 1.5*M_PI, 2*M_PI); + } + } + } + else // y-direction + { + aCenter = basegfx::B2DPoint(aEnd.getX(),aStart.getY()); + if (aEnd.getX()<aStart.getX()) + { + if (aEnd.getY()<aStart.getY()) // up, left + { + aArc = basegfx::utils::createPolygonFromEllipseSegment(aCenter, fRadiusX, fRadiusY, 1.5*M_PI, 2*M_PI); + aArc.flip(); + } + else // down, left + { + aArc = basegfx::utils::createPolygonFromEllipseSegment(aCenter, fRadiusX, fRadiusY, 0.0, M_PI_2); + } + } + else // aEnd.getX()>=aStart.getX() + { + if (aEnd.getY()<aStart.getY()) // up, right + { + aArc = basegfx::utils::createPolygonFromEllipseSegment(aCenter, fRadiusX, fRadiusY, M_PI, 1.5*M_PI); + } + else // down, right + { + aArc = basegfx::utils::createPolygonFromEllipseSegment(aCenter, fRadiusX, fRadiusY, M_PI_2, M_PI); + aArc.flip(); + } + } + } + aNewB2DPolygon.append(aArc); + rSrcPt++; + bIsXDirection = !bIsXDirection; + aStart = aEnd; + } + } + // else error in path syntax, do nothing + } + break; + +#ifdef DBG_CUSTOMSHAPE + case UNKNOWN : + default : + { + SAL_WARN( "svx", "CustomShapes::unknown PolyFlagValue :" << nCommand ); + } + break; +#endif + } + if ( nCommand == ENDSUBPATH ) + break; + } + } + if ( rSegmentInd == nSegInfoSize ) + rSegmentInd++; + + if(aNewB2DPolygon.count() > 1) + { + // #i76201# Add conversion to closed polygon when first and last points are equal + basegfx::utils::checkClosed(aNewB2DPolygon); + aNewB2DPolyPolygon.append(aNewB2DPolygon); + } + + if(!aNewB2DPolyPolygon.count()) + return; + + // #i37011# + bool bForceCreateTwoObjects(false); + + if(!bSortFilledObjectsToBack && !aNewB2DPolyPolygon.isClosed() && !bNoStroke) + { + bForceCreateTwoObjects = true; + } + + if(bLineGeometryNeededOnly) + { + bForceCreateTwoObjects = true; + bNoFill = true; + bNoStroke = false; + } + + if(bForceCreateTwoObjects || bSortFilledObjectsToBack) + { + if(bFilled && !bNoFill) + { + basegfx::B2DPolyPolygon aClosedPolyPolygon(aNewB2DPolyPolygon); + aClosedPolyPolygon.setClosed(true); + SdrPathObjUniquePtr pFill(new SdrPathObj( + mrSdrObjCustomShape.getSdrModelFromSdrObject(), + SdrObjKind::Polygon, + aClosedPolyPolygon)); + SfxItemSet aTempSet(*this); + aTempSet.Put(makeSdrShadowItem(false)); + aTempSet.Put(XLineStyleItem(drawing::LineStyle_NONE)); + pFill->SetMergedItemSet(aTempSet); + rObjectList.push_back(std::pair< SdrPathObjUniquePtr, double >(std::move(pFill), dBrightness)); + } + + if(!bNoStroke) + { + // there is no reason to use OBJ_PLIN here when the polygon is actually closed, + // the non-fill is defined by XFILL_NONE. Since SdrPathObj::ImpForceKind() needs + // to correct the polygon (here: open it) using the type, the last edge may get lost. + // Thus, use a type that fits the polygon + SdrPathObjUniquePtr pStroke(new SdrPathObj( + mrSdrObjCustomShape.getSdrModelFromSdrObject(), + aNewB2DPolyPolygon.isClosed() ? SdrObjKind::Polygon : SdrObjKind::PolyLine, + aNewB2DPolyPolygon)); + SfxItemSet aTempSet(*this); + aTempSet.Put(makeSdrShadowItem(false)); + aTempSet.Put(XFillStyleItem(drawing::FillStyle_NONE)); + pStroke->SetMergedItemSet(aTempSet); + rObjectList.push_back(std::pair< SdrPathObjUniquePtr, double >(std::move(pStroke), dBrightness)); + } + } + else + { + SdrPathObjUniquePtr pObj; + SfxItemSet aTempSet(*this); + aTempSet.Put(makeSdrShadowItem(false)); + + if(bNoFill) + { + // see comment above about OBJ_PLIN + pObj.reset(new SdrPathObj( + mrSdrObjCustomShape.getSdrModelFromSdrObject(), + aNewB2DPolyPolygon.isClosed() ? SdrObjKind::Polygon : SdrObjKind::PolyLine, + aNewB2DPolyPolygon)); + aTempSet.Put(XFillStyleItem(drawing::FillStyle_NONE)); + } + else + { + aNewB2DPolyPolygon.setClosed(true); + pObj.reset(new SdrPathObj( + mrSdrObjCustomShape.getSdrModelFromSdrObject(), + SdrObjKind::Polygon, + aNewB2DPolyPolygon)); + } + + if(bNoStroke) + { + aTempSet.Put(XLineStyleItem(drawing::LineStyle_NONE)); + } + + pObj->SetMergedItemSet(aTempSet); + rObjectList.push_back(std::pair< SdrPathObjUniquePtr, double >(std::move(pObj), dBrightness)); + } +} + +static void CorrectCalloutArrows( + MSO_SPT eSpType, + sal_uInt32 nLineObjectCount, + std::vector< std::pair< SdrPathObjUniquePtr, double> >& vObjectList ) +{ + bool bAccent = false; + switch( eSpType ) + { + case mso_sptCallout1 : + case mso_sptBorderCallout1 : + case mso_sptCallout90 : + case mso_sptBorderCallout90 : + default: + break; + + case mso_sptAccentCallout1 : + case mso_sptAccentBorderCallout1 : + case mso_sptAccentCallout90 : + case mso_sptAccentBorderCallout90 : + { + sal_uInt32 nLine = 0; + + for ( const std::pair< SdrPathObjUniquePtr, double >& rCandidate : vObjectList ) + { + SdrPathObj* pObj(rCandidate.first.get()); + + if(pObj->IsLine()) + { + nLine++; + if ( nLine == nLineObjectCount ) + { + pObj->ClearMergedItem( XATTR_LINESTART ); + pObj->ClearMergedItem( XATTR_LINEEND ); + } + } + } + } + break; + + // switch start & end + case mso_sptAccentCallout2 : + case mso_sptAccentBorderCallout2 : + bAccent = true; + [[fallthrough]]; + case mso_sptCallout2 : + case mso_sptBorderCallout2 : + { + sal_uInt32 nLine = 0; + + for ( const std::pair< SdrPathObjUniquePtr, double >& rCandidate : vObjectList ) + { + SdrPathObj* pObj(rCandidate.first.get()); + + if(pObj->IsLine()) + { + nLine++; + if ( nLine == 1 ) + pObj->ClearMergedItem( XATTR_LINEEND ); + else if ( ( bAccent && ( nLine == nLineObjectCount - 1 ) ) || ( !bAccent && ( nLine == nLineObjectCount ) ) ) + pObj->ClearMergedItem( XATTR_LINESTART ); + else + { + pObj->ClearMergedItem( XATTR_LINESTART ); + pObj->ClearMergedItem( XATTR_LINEEND ); + } + } + } + } + break; + + case mso_sptAccentCallout3 : + case mso_sptAccentBorderCallout3 : + case mso_sptCallout3 : + case mso_sptBorderCallout3 : + { + sal_uInt32 nLine = 0; + + for ( const std::pair< SdrPathObjUniquePtr, double >& rCandidate : vObjectList ) + { + SdrPathObj* pObj(rCandidate.first.get()); + + if(pObj->IsLine()) + { + if ( nLine ) + { + pObj->ClearMergedItem( XATTR_LINESTART ); + pObj->ClearMergedItem( XATTR_LINEEND ); + } + else + EnhancedCustomShape2d::SwapStartAndEndArrow( pObj ); + + nLine++; + } + } + } + break; + } +} + +void EnhancedCustomShape2d::AdaptObjColor( + SdrPathObj& rObj, + double dBrightness, + const SfxItemSet& rCustomShapeSet, + sal_uInt32& nColorIndex, + sal_uInt32 nColorCount) +{ + if ( rObj.IsLine() ) + return; + + const drawing::FillStyle eFillStyle = rObj.GetMergedItem(XATTR_FILLSTYLE).GetValue(); + if (eFillStyle == drawing::FillStyle_NONE) + return; + + switch( eFillStyle ) + { + default: + case drawing::FillStyle_SOLID: + { + if ( nColorCount || 0.0 != dBrightness ) + { + Color aFillColor = GetColorData( + rCustomShapeSet.Get( XATTR_FILLCOLOR ).GetColorValue(), + std::min(nColorIndex, nColorCount-1), + dBrightness ); + rObj.SetMergedItem( XFillColorItem( "", aFillColor ) ); + } + break; + } + case drawing::FillStyle_GRADIENT: + { + XGradient aXGradient(rObj.GetMergedItem(XATTR_FILLGRADIENT).GetGradientValue()); + + if ( nColorCount || 0.0 != dBrightness ) + { + aXGradient.SetStartColor( + GetColorData( + aXGradient.GetStartColor(), + std::min(nColorIndex, nColorCount-1), + dBrightness )); + aXGradient.SetEndColor( + GetColorData( + aXGradient.GetEndColor(), + std::min(nColorIndex, nColorCount-1), + dBrightness )); + } + + rObj.SetMergedItem( XFillGradientItem( "", aXGradient ) ); + break; + } + case drawing::FillStyle_HATCH: + { + XHatch aXHatch(rObj.GetMergedItem(XATTR_FILLHATCH).GetHatchValue()); + + if ( nColorCount || 0.0 != dBrightness ) + { + aXHatch.SetColor( + GetColorData( + aXHatch.GetColor(), + std::min(nColorIndex, nColorCount-1), + dBrightness )); + } + + rObj.SetMergedItem( XFillHatchItem( "", aXHatch ) ); + break; + } + case drawing::FillStyle_BITMAP: + { + if ( nColorCount || 0.0 != dBrightness ) + { + BitmapEx aBitmap(rObj.GetMergedItem(XATTR_FILLBITMAP).GetGraphicObject().GetGraphic().GetBitmapEx()); + + short nLuminancePercent = static_cast< short > ( GetLuminanceChange( + std::min(nColorIndex, nColorCount-1))); + aBitmap.Adjust( nLuminancePercent, 0, 0, 0, 0 ); + + rObj.SetMergedItem(XFillBitmapItem(OUString(), Graphic(aBitmap))); + } + + break; + } + } + + if ( nColorIndex < nColorCount ) + nColorIndex++; +} + +SdrObjectUniquePtr EnhancedCustomShape2d::CreatePathObj( bool bLineGeometryNeededOnly ) +{ + if ( !seqCoordinates.hasElements() ) + { + return nullptr; + } + + std::vector< std::pair< SdrPathObjUniquePtr, double > > vObjectList; + const bool bSortFilledObjectsToBack(SortFilledObjectsToBackByDefault(eSpType)); + sal_Int32 nSubPathIndex(0); + sal_Int32 nSrcPt(0); + sal_Int32 nSegmentInd(0); + SdrObjectUniquePtr pRet; + + while( nSegmentInd <= seqSegments.getLength() ) + { + CreateSubPath( + nSrcPt, + nSegmentInd, + vObjectList, + bLineGeometryNeededOnly, + bSortFilledObjectsToBack, + nSubPathIndex); + nSubPathIndex++; + } + + if ( !vObjectList.empty() ) + { + const SfxItemSet& rCustomShapeSet(mrSdrObjCustomShape.GetMergedItemSet()); + const sal_uInt32 nColorCount(nColorData >> 28); + sal_uInt32 nColorIndex(0); + + // #i37011# remove invisible objects + std::vector< std::pair< SdrPathObjUniquePtr, double> > vNewList; + + for ( std::pair< SdrPathObjUniquePtr, double >& rCandidate : vObjectList ) + { + SdrPathObj* pObj(rCandidate.first.get()); + const drawing::LineStyle eLineStyle(pObj->GetMergedItem(XATTR_LINESTYLE).GetValue()); + const drawing::FillStyle eFillStyle(pObj->GetMergedItem(XATTR_FILLSTYLE).GetValue()); + const auto pText = pObj->getActiveText(); + + // #i40600# if bLineGeometryNeededOnly is set, linestyle does not matter + if(pText || bLineGeometryNeededOnly || (drawing::LineStyle_NONE != eLineStyle) || (drawing::FillStyle_NONE != eFillStyle)) + vNewList.push_back(std::move(rCandidate)); + } + + vObjectList = std::move(vNewList); + + if(1 == vObjectList.size()) + { + // a single object, correct some values + AdaptObjColor( + *vObjectList.begin()->first, + vObjectList.begin()->second, + rCustomShapeSet, + nColorIndex, + nColorCount); + } + else + { + sal_Int32 nLineObjectCount(0); + + // correct some values and collect content data + for ( const std::pair< SdrPathObjUniquePtr, double >& rCandidate : vObjectList ) + { + SdrPathObj* pObj(rCandidate.first.get()); + + if(pObj->IsLine()) + { + nLineObjectCount++; + } + else + { + AdaptObjColor( + *pObj, + rCandidate.second, + rCustomShapeSet, + nColorIndex, + nColorCount); + + // OperationSmiley: when we have access to the SdrObjCustomShape and the + // CustomShape is built with more than a single filled Geometry, use it + // to define that all helper geometries defined here (SdrObjects currently) + // will use the same FillGeometryDefinition (from the referenced SdrObjCustomShape). + // This will all same-filled objects look like filled smoothly with the same style. + pObj->setFillGeometryDefiningShape(&mrSdrObjCustomShape); + } + } + + // #i88870# correct line arrows for callouts + if ( nLineObjectCount ) + { + CorrectCalloutArrows( + eSpType, + nLineObjectCount, + vObjectList); + } + + // sort objects so that filled ones are in front. Necessary + // for some strange objects + if(bSortFilledObjectsToBack) + { + std::vector< std::pair< SdrPathObjUniquePtr, double> > vTempList; + vTempList.reserve(vObjectList.size()); + + for ( std::pair< SdrPathObjUniquePtr, double >& rCandidate : vObjectList ) + { + SdrPathObj* pObj(rCandidate.first.get()); + if ( !pObj->IsLine() ) + vTempList.push_back(std::move(rCandidate)); + } + + for ( std::pair< SdrPathObjUniquePtr, double >& rCandidate : vObjectList ) + { + if ( rCandidate.first ) + vTempList.push_back(std::move(rCandidate)); + } + + vObjectList = std::move(vTempList); + } + } + } + + // #i37011# + if(!vObjectList.empty()) + { + // copy remaining objects to pRet + if(vObjectList.size() > 1) + { + pRet.reset(new SdrObjGroup(mrSdrObjCustomShape.getSdrModelFromSdrObject())); + + for ( std::pair< SdrPathObjUniquePtr, double >& rCandidate : vObjectList ) + { + pRet->GetSubList()->NbcInsertObject(rCandidate.first.release()); + } + } + else if(1 == vObjectList.size()) + { + pRet.reset(vObjectList.begin()->first.release()); + } + + if(pRet) + { + // move to target position + tools::Rectangle aCurRect(pRet->GetSnapRect()); + aCurRect.Move(aLogicRect.Left(), aLogicRect.Top()); + pRet->NbcSetSnapRect(aCurRect); + } + } + + return pRet; +} + +SdrObjectUniquePtr EnhancedCustomShape2d::CreateObject( bool bLineGeometryNeededOnly ) +{ + SdrObjectUniquePtr pRet; + + if ( eSpType == mso_sptRectangle ) + { + pRet.reset(new SdrRectObj(mrSdrObjCustomShape.getSdrModelFromSdrObject(), aLogicRect)); + pRet->SetMergedItemSet( *this ); + } + if ( !pRet ) + pRet = CreatePathObj( bLineGeometryNeededOnly ); + + return pRet; +} + +void EnhancedCustomShape2d::ApplyGluePoints( SdrObject* pObj ) +{ + if ( !pObj ) + return; + + for ( const auto& rGluePoint : std::as_const(seqGluePoints) ) + { + SdrGluePoint aGluePoint; + + aGluePoint.SetPos( GetPoint( rGluePoint, true, true ) ); + aGluePoint.SetPercent( false ); + aGluePoint.SetAlign( SdrAlign::VERT_TOP | SdrAlign::HORZ_LEFT ); + aGluePoint.SetEscDir( SdrEscapeDirection::SMART ); + SdrGluePointList* pList = pObj->ForceGluePointList(); + if( pList ) + /* sal_uInt16 nId = */ pList->Insert( aGluePoint ); + } +} + +SdrObjectUniquePtr EnhancedCustomShape2d::CreateLineGeometry() +{ + return CreateObject( true ); +} + + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svx/source/customshapes/EnhancedCustomShape3d.cxx b/svx/source/customshapes/EnhancedCustomShape3d.cxx new file mode 100644 index 000000000..00a59ebf5 --- /dev/null +++ b/svx/source/customshapes/EnhancedCustomShape3d.cxx @@ -0,0 +1,1037 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#include "EnhancedCustomShape3d.hxx" +#include <o3tl/unit_conversion.hxx> +#include <svx/deflt3d.hxx> +#include <svx/svdmodel.hxx> +#include <tools/poly.hxx> +#include <svx/svditer.hxx> +#include <svx/svdobj.hxx> +#include <svx/svdoashp.hxx> +#include <svl/itemset.hxx> +#include <svx/xfillit0.hxx> +#include <svx/xlineit0.hxx> +#include <svx/xsflclit.hxx> +#include <svx/xbtmpit.hxx> +#include <svx/xflclit.hxx> +#include <svx/svdopath.hxx> +#include <svx/svddef.hxx> +#include <svx/svx3ditems.hxx> +#include <extrud3d.hxx> +#include <svx/xflbmtit.hxx> +#include <svx/xlnclit.hxx> +#include <svx/sdasitm.hxx> +#include <svx/scene3d.hxx> +#include <com/sun/star/drawing/Position3D.hpp> +#include <com/sun/star/drawing/Direction3D.hpp> +#include <com/sun/star/drawing/NormalsKind.hpp> +#include <com/sun/star/drawing/ShadeMode.hpp> +#include <svx/sdr/properties/properties.hxx> +#include <com/sun/star/drawing/EnhancedCustomShapeParameterPair.hpp> +#include <com/sun/star/drawing/EnhancedCustomShapeMetalType.hpp> +#include <com/sun/star/drawing/ProjectionMode.hpp> +#include <basegfx/polygon/b2dpolypolygontools.hxx> +#include <basegfx/polygon/b3dpolygon.hxx> +#include <basegfx/range/b2drange.hxx> +#include <sdr/primitive2d/sdrattributecreator.hxx> +#include <drawinglayer/attribute/sdrlineattribute.hxx> +#include <drawinglayer/attribute/sdrlinestartendattribute.hxx> +#include <svx/xlnwtit.hxx> +#include <svx/xlntrit.hxx> +#include <svx/xfltrit.hxx> +#include <basegfx/color/bcolor.hxx> + +using namespace com::sun::star; +using namespace com::sun::star::uno; + +namespace { + +void GetOrigin( const SdrCustomShapeGeometryItem& rItem, double& rOriginX, double& rOriginY ) +{ + css::drawing::EnhancedCustomShapeParameterPair aOriginParaPair; + const Any* pAny = rItem.GetPropertyValueByName( "Extrusion", "Origin" ); + if ( ! ( pAny && ( *pAny >>= aOriginParaPair ) && ( aOriginParaPair.First.Value >>= rOriginX ) && ( aOriginParaPair.Second.Value >>= rOriginY ) ) ) + { + rOriginX = 0.50; + rOriginY =-0.50; + } +} + +void GetRotateAngle( const SdrCustomShapeGeometryItem& rItem, double& rAngleX, double& rAngleY ) +{ + css::drawing::EnhancedCustomShapeParameterPair aRotateAngleParaPair; + const Any* pAny = rItem.GetPropertyValueByName( "Extrusion", "RotateAngle" ); + if ( ! ( pAny && ( *pAny >>= aRotateAngleParaPair ) && ( aRotateAngleParaPair.First.Value >>= rAngleX ) && ( aRotateAngleParaPair.Second.Value >>= rAngleY ) ) ) + { + rAngleX = 0.0; + rAngleY = 0.0; + } + rAngleX = basegfx::deg2rad(rAngleX); + rAngleY = basegfx::deg2rad(rAngleY); +} + +void GetSkew( const SdrCustomShapeGeometryItem& rItem, double& rSkewAmount, double& rSkewAngle ) +{ + css::drawing::EnhancedCustomShapeParameterPair aSkewParaPair; + const Any* pAny = rItem.GetPropertyValueByName( "Extrusion", "Skew" ); + if ( ! ( pAny && ( *pAny >>= aSkewParaPair ) && ( aSkewParaPair.First.Value >>= rSkewAmount ) && ( aSkewParaPair.Second.Value >>= rSkewAngle ) ) ) + { + rSkewAmount = 50; + // ODF default is 45, but older ODF documents expect -135 as default. For intermediate + // solution see tdf#141301 and tdf#141127. + // MS Office default -135 is set in msdffimp.cxx to make import independent from setting here. + rSkewAngle = -135; + } + rSkewAngle = basegfx::deg2rad(rSkewAngle); +} + +void GetExtrusionDepth( const SdrCustomShapeGeometryItem& rItem, const double* pMap, double& rBackwardDepth, double& rForwardDepth ) +{ + css::drawing::EnhancedCustomShapeParameterPair aDepthParaPair; + double fDepth = 0, fFraction = 0; + const Any* pAny = rItem.GetPropertyValueByName( "Extrusion", "Depth" ); + if ( pAny && ( *pAny >>= aDepthParaPair ) && ( aDepthParaPair.First.Value >>= fDepth ) && ( aDepthParaPair.Second.Value >>= fFraction ) ) + { + rForwardDepth = fDepth * fFraction; + rBackwardDepth = fDepth - rForwardDepth; + } + else + { + rBackwardDepth = 1270; + rForwardDepth = 0; + } + if ( pMap ) + { + double fMap = *pMap; + rBackwardDepth *= fMap; + rForwardDepth *= fMap; + } +} + +double GetDouble( const SdrCustomShapeGeometryItem& rItem, const OUString& rPropertyName, double fDefault ) +{ + double fRetValue = fDefault; + const Any* pAny = rItem.GetPropertyValueByName( "Extrusion", rPropertyName ); + if ( pAny ) + *pAny >>= fRetValue; + return fRetValue; +} + +drawing::ShadeMode GetShadeMode( const SdrCustomShapeGeometryItem& rItem, const drawing::ShadeMode eDefault ) +{ + drawing::ShadeMode eRet( eDefault ); + const Any* pAny = rItem.GetPropertyValueByName( "Extrusion", "ShadeMode" ); + if ( pAny ) + *pAny >>= eRet; + return eRet; +} + +bool GetBool( const SdrCustomShapeGeometryItem& rItem, const OUString& rPropertyName, const bool bDefault ) +{ + bool bRetValue = bDefault; + const Any* pAny = rItem.GetPropertyValueByName( "Extrusion", rPropertyName ); + if ( pAny ) + *pAny >>= bRetValue; + return bRetValue; +} + +drawing::Position3D GetPosition3D( const SdrCustomShapeGeometryItem& rItem, const OUString& rPropertyName, + const drawing::Position3D& rDefault, const double* pMap ) +{ + drawing::Position3D aRetValue( rDefault ); + const Any* pAny = rItem.GetPropertyValueByName( "Extrusion", rPropertyName ); + if ( pAny ) + *pAny >>= aRetValue; + if ( pMap ) + { + aRetValue.PositionX *= *pMap; + aRetValue.PositionY *= *pMap; + aRetValue.PositionZ *= *pMap; + } + return aRetValue; +} + +drawing::Direction3D GetDirection3D( const SdrCustomShapeGeometryItem& rItem, const OUString& rPropertyName, const drawing::Direction3D& rDefault ) +{ + drawing::Direction3D aRetValue( rDefault ); + const Any* pAny = rItem.GetPropertyValueByName( "Extrusion", rPropertyName ); + if ( pAny ) + *pAny >>= aRetValue; + return aRetValue; +} + +sal_Int16 GetMetalType(const SdrCustomShapeGeometryItem& rItem, const sal_Int16 eDefault) +{ + sal_Int16 aRetValue(eDefault); + const Any* pAny = rItem.GetPropertyValueByName("Extrusion", "MetalType"); + if (pAny) + *pAny >>= aRetValue; + return aRetValue; +} + +// Calculates the light directions for the additional lights, which are used to emulate soft +// lights of MS Office. Method needs to be documented in the Wiki +// https://wiki.documentfoundation.org/Development/ODF_Implementer_Notes in part +// List_of_LibreOffice_ODF_implementation-defined_items +// The method expects vector rLight to be normalized and results normalized vectors. +void lcl_SoftLightsDirection(const basegfx::B3DVector& rLight, basegfx::B3DVector& rSoftUp, + basegfx::B3DVector& rSoftDown, basegfx::B3DVector& rSoftRight, + basegfx::B3DVector& rSoftLeft) +{ + constexpr double fAngle = basegfx::deg2rad(60); // angle between regular light and soft light + + // We first create directions around (0|0|1) and then rotate them to the light position. + rSoftUp = basegfx::B3DVector(0.0, sin(fAngle), cos(fAngle)); + rSoftDown = basegfx::B3DVector(0.0, -sin(fAngle), cos(fAngle)); + rSoftRight = basegfx::B3DVector(sin(fAngle), 0.0, cos(fAngle)); + rSoftLeft = basegfx::B3DVector(-sin(fAngle), 0.0, cos(fAngle)); + + basegfx::B3DHomMatrix aRotateMat; + aRotateMat.rotate(0.0, 0.0, M_PI_4); + if (rLight.getX() == 0.0 && rLight.getZ() == 0.0) + { + // Special case with light from top or bottom + if (rLight.getY() >= 0.0) + aRotateMat.rotate(-M_PI_2, 0.0, 0.0); + else + aRotateMat.rotate(M_PI_2, 0.0, 0.0); + } + else + { + // Azimuth from z-axis to x-axis. (0|0|1) to (1|0|0) is 90deg. + double fAzimuth = atan2(rLight.getX(), rLight.getZ()); + // Elevation from xz-plane to y-axis. (0|0|1) to (0|1|0) is 90deg. + double fElevation = atan2(rLight.getY(), std::hypot(rLight.getX(), rLight.getZ())); + aRotateMat.rotate(-fElevation, fAzimuth, 0.0); + } + + rSoftUp = aRotateMat * rSoftUp; + rSoftDown = aRotateMat * rSoftDown; + rSoftRight = aRotateMat * rSoftRight; + rSoftLeft = aRotateMat * rSoftLeft; +} +} + +SdrObject* EnhancedCustomShape3d::Create3DObject( + const SdrObject* pShape2d, + const SdrObjCustomShape& rSdrObjCustomShape) +{ + SdrObject* pRet(nullptr); + const SdrCustomShapeGeometryItem& rGeometryItem(rSdrObjCustomShape.GetMergedItem(SDRATTR_CUSTOMSHAPE_GEOMETRY)); + double fMap(1.0), *pMap = nullptr; + Fraction aFraction( rSdrObjCustomShape.getSdrModelFromSdrObject().GetScaleFraction() ); + + if ( aFraction.GetNumerator() != 1 || aFraction.GetDenominator() != 1 ) + { + fMap *= double(aFraction); + pMap = &fMap; + } + + if ( rSdrObjCustomShape.getSdrModelFromSdrObject().GetScaleUnit() != MapUnit::Map100thMM ) + { + DBG_ASSERT( rSdrObjCustomShape.getSdrModelFromSdrObject().GetScaleUnit() == MapUnit::MapTwip, "EnhancedCustomShape3d::Current MapMode is Unsupported" ); + // But we could use MapToO3tlUnit from <tools/UnitConversion> ... ? + fMap *= o3tl::convert(1.0, o3tl::Length::mm100, o3tl::Length::twip); + pMap = &fMap; + } + + if ( GetBool( rGeometryItem, "Extrusion", false ) ) + { + bool bIsMirroredX(rSdrObjCustomShape.IsMirroredX()); + bool bIsMirroredY(rSdrObjCustomShape.IsMirroredY()); + tools::Rectangle aSnapRect(rSdrObjCustomShape.GetLogicRect()); + Degree100 nObjectRotation(rSdrObjCustomShape.GetRotateAngle()); + if ( nObjectRotation ) + { + double a = toRadians(36000_deg100 - nObjectRotation); + tools::Long dx = aSnapRect.Right() - aSnapRect.Left(); + tools::Long dy = aSnapRect.Bottom()- aSnapRect.Top(); + Point aP( aSnapRect.TopLeft() ); + RotatePoint( aP, rSdrObjCustomShape.GetSnapRect().Center(), sin( a ), cos( a ) ); + aSnapRect.SetLeft( aP.X() ); + aSnapRect.SetTop( aP.Y() ); + aSnapRect.SetRight( aSnapRect.Left() + dx ); + aSnapRect.SetBottom( aSnapRect.Top() + dy ); + } + Point aCenter( aSnapRect.Center() ); + + SfxItemSet aSet( rSdrObjCustomShape.GetMergedItemSet() ); + + //SJ: vertical writing is not required, by removing this item no outliner is created + aSet.ClearItem( SDRATTR_TEXTDIRECTION ); + + // #i105323# For 3D AutoShapes, the shadow attribute has to be applied to each + // created visualisation helper model shape individually. The shadow itself + // will then be rendered from the 3D renderer correctly for the whole 3D scene + // (and thus behind all objects of which the visualisation may be built). So, + // do NOT remove it from the ItemSet here. + // aSet.ClearItem(SDRATTR_SHADOW); + + std::vector< E3dCompoundObject* > aPlaceholderObjectList; + + double fExtrusionBackward, fExtrusionForward; + GetExtrusionDepth( rGeometryItem, pMap, fExtrusionBackward, fExtrusionForward ); + double fDepth = fExtrusionBackward + fExtrusionForward; + if ( fDepth < 1.0 ) + fDepth = 1.0; + + drawing::ProjectionMode eProjectionMode( drawing::ProjectionMode_PARALLEL ); + const Any* pAny = rGeometryItem.GetPropertyValueByName( "Extrusion", "ProjectionMode" ); + if ( pAny ) + *pAny >>= eProjectionMode; + // pShape2d Convert in scenes which include 3D Objects + E3dDefaultAttributes a3DDefaultAttr; + a3DDefaultAttr.SetDefaultLatheCharacterMode( true ); + a3DDefaultAttr.SetDefaultExtrudeCharacterMode( true ); + + E3dScene* pScene = new E3dScene(rSdrObjCustomShape.getSdrModelFromSdrObject()); + + bool bSceneHasObjects ( false ); + bool bUseTwoFillStyles( false ); + + drawing::ShadeMode eShadeMode( GetShadeMode( rGeometryItem, drawing::ShadeMode_FLAT ) ); + bool bUseExtrusionColor = GetBool( rGeometryItem, "Color", false ); + + drawing::FillStyle eFillStyle( aSet.Get(XATTR_FILLSTYLE).GetValue() ); + pScene->GetProperties().SetObjectItem( Svx3DShadeModeItem(static_cast<sal_uInt16>(eShadeMode))); + aSet.Put( makeSvx3DPercentDiagonalItem( 0 ) ); + aSet.Put( Svx3DTextureModeItem( 1 ) ); + // SPECIFIC needed for ShadeMode_SMOOTH and ShadeMode_PHONG, otherwise FLAT is faster. + if (eShadeMode == drawing::ShadeMode_SMOOTH || eShadeMode == drawing::ShadeMode_PHONG) + aSet.Put( Svx3DNormalsKindItem(static_cast<sal_uInt16>(drawing::NormalsKind_SPECIFIC))); + else + aSet.Put( Svx3DNormalsKindItem(static_cast<sal_uInt16>(drawing::NormalsKind_FLAT))); + + if ( eShadeMode == drawing::ShadeMode_DRAFT ) + { + aSet.Put( XLineStyleItem( drawing::LineStyle_SOLID ) ); + aSet.Put( XFillStyleItem ( drawing::FillStyle_NONE ) ); + aSet.Put( makeSvx3DDoubleSidedItem( true ) ); + } + else + { + aSet.Put( XLineStyleItem( drawing::LineStyle_NONE ) ); + if ( eFillStyle == drawing::FillStyle_NONE ) + aSet.Put( XFillStyleItem( drawing::FillStyle_SOLID ) ); + else if ( ( eFillStyle == drawing::FillStyle_BITMAP ) || ( eFillStyle == drawing::FillStyle_GRADIENT ) || bUseExtrusionColor ) + bUseTwoFillStyles = true; + + // If shapes are mirrored once (mirroring two times correct geometry again) + // double-sided at the object and two-sided-lighting at the scene need to be set. + + // #i122777# Also use double sided for two fill styles since there several 3d objects get + // created with a depth of 0; one of them is the backside which needs double-sided to + // get visible + if(bUseTwoFillStyles || (bIsMirroredX && !bIsMirroredY) || (!bIsMirroredX && bIsMirroredY)) + { + aSet.Put( makeSvx3DDoubleSidedItem( true ) ); + pScene->GetProperties().SetObjectItem( makeSvx3DTwoSidedLightingItem( true ) ); + } + } + + tools::Rectangle aBoundRect2d; + basegfx::B2DPolyPolygon aTotalPolyPoly; + SdrObjListIter aIter( *pShape2d, SdrIterMode::DeepNoGroups ); + const bool bMultipleSubObjects(aIter.Count() > 1); + + while( aIter.IsMore() ) + { + const SdrObject* pNext = aIter.Next(); + bool bIsPlaceholderObject = (pNext->GetMergedItem( XATTR_FILLSTYLE ).GetValue() == drawing::FillStyle_NONE ) + && (pNext->GetMergedItem( XATTR_LINESTYLE ).GetValue() == drawing::LineStyle_NONE ); + basegfx::B2DPolyPolygon aPolyPoly; + SfxItemSet aLocalSet(aSet); + drawing::FillStyle aLocalFillStyle(eFillStyle); + + if ( auto pPathObj = dynamic_cast<const SdrPathObj*>(pNext) ) + { + const SfxItemSet& rSet = pNext->GetMergedItemSet(); + bool bNeedToConvertToContour(false); + + // do conversion only for single line objects; for all others a fill and a + // line object get created. When we have fill, we want no line. That line has + // always been there, but since it was never converted to contour, it kept + // invisible (all this 'hidden' logic should be migrated to primitives). + if(!bMultipleSubObjects) + { + const drawing::FillStyle eStyle(rSet.Get(XATTR_FILLSTYLE).GetValue()); + + if(drawing::FillStyle_NONE == eStyle) + { + const drawinglayer::attribute::SdrLineAttribute aLine( + drawinglayer::primitive2d::createNewSdrLineAttribute(rSet)); + + bNeedToConvertToContour = (0.0 < aLine.getWidth() || 0.0 != aLine.getFullDotDashLen()); + + if(!bNeedToConvertToContour && !aLine.isDefault()) + { + const drawinglayer::attribute::SdrLineStartEndAttribute aLineStartEnd( + drawinglayer::primitive2d::createNewSdrLineStartEndAttribute(rSet, aLine.getWidth())); + + if((aLineStartEnd.getStartWidth() && aLineStartEnd.isStartActive()) + || (aLineStartEnd.getEndWidth() && aLineStartEnd.isEndActive())) + { + bNeedToConvertToContour = true; + } + } + } + } + + if(bNeedToConvertToContour) + { + SdrObject* pNewObj = pNext->ConvertToContourObj(const_cast< SdrObject* >(pNext)); + SdrPathObj* pNewPathObj = dynamic_cast< SdrPathObj* >(pNewObj); + + if(pNewPathObj) + { + aPolyPoly = pNewPathObj->GetPathPoly(); + + if(aPolyPoly.isClosed()) + { + // correct item properties from line to fill style + if(eShadeMode == drawing::ShadeMode_DRAFT) + { + // for draft, create wireframe with fixed line width + aLocalSet.Put(XLineStyleItem(drawing::LineStyle_SOLID)); + aLocalSet.Put(XLineWidthItem(40)); + aLocalFillStyle = drawing::FillStyle_NONE; + } + else + { + // switch from line to fill, copy line attr to fill attr (color, transparence) + aLocalSet.Put(XLineWidthItem(0)); + aLocalSet.Put(XLineStyleItem(drawing::LineStyle_NONE)); + aLocalSet.Put(XFillColorItem(OUString(), aLocalSet.Get(XATTR_LINECOLOR).GetColorValue())); + aLocalSet.Put(XFillStyleItem(drawing::FillStyle_SOLID)); + aLocalSet.Put(XFillTransparenceItem(aLocalSet.Get(XATTR_LINETRANSPARENCE).GetValue())); + aLocalFillStyle = drawing::FillStyle_SOLID; + } + } + else + { + // correct item properties to hairlines + aLocalSet.Put(XLineWidthItem(0)); + aLocalSet.Put(XLineStyleItem(drawing::LineStyle_SOLID)); + } + } + + SdrObject::Free(pNewObj); + } + else + { + aPolyPoly = pPathObj->GetPathPoly(); + } + } + else + { + SdrObjectUniquePtr pNewObj = pNext->ConvertToPolyObj( false, false ); + SdrPathObj* pPath = dynamic_cast<SdrPathObj*>( pNewObj.get() ); + if ( pPath ) + aPolyPoly = pPath->GetPathPoly(); + } + + if( aPolyPoly.count() ) + { + if(aPolyPoly.areControlPointsUsed()) + { + aPolyPoly = basegfx::utils::adaptiveSubdivideByAngle(aPolyPoly); + } + + const basegfx::B2DRange aTempRange(basegfx::utils::getRange(aPolyPoly)); + const tools::Rectangle aBoundRect(basegfx::fround(aTempRange.getMinX()), basegfx::fround(aTempRange.getMinY()), basegfx::fround(aTempRange.getMaxX()), basegfx::fround(aTempRange.getMaxY())); + aTotalPolyPoly.append(aPolyPoly); + aBoundRect2d.Union( aBoundRect ); + + // #i122777# depth 0 is okay for planes when using double-sided + E3dCompoundObject* p3DObj = new E3dExtrudeObj( + rSdrObjCustomShape.getSdrModelFromSdrObject(), + a3DDefaultAttr, + aPolyPoly, + bUseTwoFillStyles ? 0 : fDepth ); + + p3DObj->NbcSetLayer( pShape2d->GetLayer() ); + p3DObj->SetMergedItemSet( aLocalSet ); + + if ( bIsPlaceholderObject ) + aPlaceholderObjectList.push_back( p3DObj ); + else if ( bUseTwoFillStyles ) + { + BitmapEx aFillBmp; + bool bFillBmpTile = p3DObj->GetMergedItem( XATTR_FILLBMP_TILE ).GetValue(); + if ( bFillBmpTile ) + { + const XFillBitmapItem& rBmpItm = p3DObj->GetMergedItem(XATTR_FILLBITMAP); + aFillBmp = rBmpItm.GetGraphicObject().GetGraphic().GetBitmapEx(); + + // #i122777# old adaptation of FillStyle bitmap size to 5-times the original size; this is not needed + // anymore and was used in old times to male the fill look better when converting to 3D. Removed + // from regular 3D objects for some time, also needs to be removed from CustomShapes + + //Size aLogicalSize = aFillBmp.GetPrefSize(); + //if ( aFillBmp.GetPrefMapMode() == MapUnit::MapPixel ) + // aLogicalSize = Application::GetDefaultDevice()->PixelToLogic( aLogicalSize, MapUnit::Map100thMM ); + //else + // aLogicalSize = OutputDevice::LogicToLogic( aLogicalSize, aFillBmp.GetPrefMapMode(), MapUnit::Map100thMM ); + //aLogicalSize.Width() *= 5; ;// :-( nice scaling, look at engine3d/obj3d.cxx + //aLogicalSize.Height() *= 5; + //aFillBmp.SetPrefSize( aLogicalSize ); + //aFillBmp.SetPrefMapMode( MapUnit::Map100thMM ); + //p3DObj->SetMergedItem(XFillBitmapItem(String(), Graphic(aFillBmp))); + } + else + { + if ( aSnapRect != aBoundRect && aSnapRect.GetWidth() > 0 && aSnapRect.GetHeight() > 0) + { + const XFillBitmapItem& rBmpItm = p3DObj->GetMergedItem(XATTR_FILLBITMAP); + aFillBmp = rBmpItm.GetGraphicObject().GetGraphic().GetBitmapEx(); + Size aBmpSize( aFillBmp.GetSizePixel() ); + double fXScale = static_cast<double>(aBoundRect.GetWidth()) / static_cast<double>(aSnapRect.GetWidth()); + double fYScale = static_cast<double>(aBoundRect.GetHeight()) / static_cast<double>(aSnapRect.GetHeight()); + + Point aPt( static_cast<sal_Int32>( static_cast<double>( aBoundRect.Left() - aSnapRect.Left() )* static_cast<double>(aBmpSize.Width()) / static_cast<double>(aSnapRect.GetWidth()) ), + static_cast<sal_Int32>( static_cast<double>( aBoundRect.Top() - aSnapRect.Top() ) * static_cast<double>(aBmpSize.Height()) / static_cast<double>(aSnapRect.GetHeight()) ) ); + Size aSize( static_cast<sal_Int32>( aBmpSize.Width() * fXScale ), + static_cast<sal_Int32>( aBmpSize.Height() * fYScale ) ); + tools::Rectangle aCropRect( aPt, aSize ); + aFillBmp.Crop( aCropRect ); + p3DObj->SetMergedItem(XFillBitmapItem(OUString(), Graphic(aFillBmp))); + } + } + pScene->InsertObject( p3DObj ); + p3DObj = new E3dExtrudeObj( + rSdrObjCustomShape.getSdrModelFromSdrObject(), + a3DDefaultAttr, + aPolyPoly, + fDepth); + p3DObj->NbcSetLayer( pShape2d->GetLayer() ); + p3DObj->SetMergedItemSet( aLocalSet ); + if ( bUseExtrusionColor ) + p3DObj->SetMergedItem( XFillColorItem( "", rSdrObjCustomShape.GetMergedItem( XATTR_SECONDARYFILLCOLOR ).GetColorValue() ) ); + p3DObj->SetMergedItem( XFillStyleItem( drawing::FillStyle_SOLID ) ); + p3DObj->SetMergedItem( Svx3DCloseFrontItem( false ) ); + p3DObj->SetMergedItem( Svx3DCloseBackItem( false ) ); + pScene->InsertObject( p3DObj ); + + // #i122777# depth 0 is okay for planes when using double-sided + p3DObj = new E3dExtrudeObj( + rSdrObjCustomShape.getSdrModelFromSdrObject(), + a3DDefaultAttr, + aPolyPoly, + 0); + + p3DObj->NbcSetLayer( pShape2d->GetLayer() ); + p3DObj->SetMergedItemSet( aLocalSet ); + + basegfx::B3DHomMatrix aFrontTransform( p3DObj->GetTransform() ); + aFrontTransform.translate( 0.0, 0.0, fDepth ); + p3DObj->NbcSetTransform( aFrontTransform ); + + if ( ( aLocalFillStyle == drawing::FillStyle_BITMAP ) && !aFillBmp.IsEmpty() ) + { + p3DObj->SetMergedItem(XFillBitmapItem(OUString(), Graphic(aFillBmp))); + } + } + else if ( aLocalFillStyle == drawing::FillStyle_NONE ) + { + const XLineColorItem& rLineColor = p3DObj->GetMergedItem( XATTR_LINECOLOR ); + p3DObj->SetMergedItem( XFillColorItem( "", rLineColor.GetColorValue() ) ); + p3DObj->SetMergedItem( makeSvx3DDoubleSidedItem( true ) ); + p3DObj->SetMergedItem( Svx3DCloseFrontItem( false ) ); + p3DObj->SetMergedItem( Svx3DCloseBackItem( false ) ); + } + pScene->InsertObject( p3DObj ); + bSceneHasObjects = true; + } + } + + if ( bSceneHasObjects ) // is the SdrObject properly converted + { + // then we can change the return value + pRet = pScene; + + // Camera settings, Perspective ... + Camera3D rCamera = pScene->GetCamera(); + pScene->NbcSetSnapRect( aSnapRect ); + + // InitScene replacement + double fW = aBoundRect2d.getWidth(); + double fH = aBoundRect2d.getHeight(); + rCamera.SetAutoAdjustProjection( false ); + rCamera.SetViewWindow( -fW / 2, - fH / 2, fW, fH); + basegfx::B3DPoint aLookAt( 0.0, 0.0, 0.0 ); + basegfx::B3DPoint aCamPos( 0.0, 0.0, 100.0 ); + rCamera.SetPosAndLookAt( aCamPos, aLookAt ); + rCamera.SetFocalLength( 1.0 ); + ProjectionType eProjectionType( eProjectionMode == drawing::ProjectionMode_PARALLEL ? ProjectionType::Parallel : ProjectionType::Perspective ); + rCamera.SetProjection( eProjectionType ); + pScene->SetCamera( rCamera ); + pScene->SetBoundAndSnapRectsDirty(); + + basegfx::B3DHomMatrix aNewTransform( pScene->GetTransform() ); + basegfx::B2DHomMatrix aPolyPolyTransform; + // Apply flip and z-rotation to scene transformation (y up). At same time transform + // aTotalPolyPoly (y down) which will be used for 2D boundRect of shape having 2D + // transformations applied. + + // API values use shape center as origin. Move scene so, that shape center is origin. + aNewTransform.translate( -aCenter.X(), aCenter.Y(), -fExtrusionBackward); + aPolyPolyTransform.translate(-aCenter.X(), -aCenter.Y()); + + double fZRotate(basegfx::deg2rad(rSdrObjCustomShape.GetObjectRotation())); + if ( fZRotate != 0.0 ) + { + aNewTransform.rotate( 0.0, 0.0, fZRotate ); + aPolyPolyTransform.rotate(-fZRotate); + } + if ( bIsMirroredX ) + { + aNewTransform.scale( -1.0, 1, 1 ); + aPolyPolyTransform.scale(-1.0, 1); + } + if ( bIsMirroredY ) + { + aNewTransform.scale( 1, -1.0, 1 ); + aPolyPolyTransform.scale(1, -1.0); + } + aPolyPolyTransform.translate(aCenter.X(), aCenter.Y()); + aTotalPolyPoly.transform(aPolyPolyTransform); + + // x- and y-rotation have an own rotation center. x- and y-value of rotation center are + // fractions of shape size, z-value is in Hmm in property. Shape center is (0 0 0). + // Values in property are in custom shape extrusion space with y-axis down. + double fXRotate, fYRotate; + GetRotateAngle( rGeometryItem, fXRotate, fYRotate ); + drawing::Direction3D aRotationCenterDefault( 0, 0, 0 ); + drawing::Direction3D aRotationCenter( GetDirection3D( rGeometryItem, "RotationCenter", aRotationCenterDefault ) ); + aRotationCenter.DirectionX *= aSnapRect.getWidth(); + aRotationCenter.DirectionY *= aSnapRect.getHeight(); + if (pMap) + { + aRotationCenter.DirectionZ *= *pMap; + } + aNewTransform.translate( -aRotationCenter.DirectionX, aRotationCenter.DirectionY, -aRotationCenter.DirectionZ ); + if( fYRotate != 0.0 ) + aNewTransform.rotate( 0.0, -fYRotate, 0.0 ); + if( fXRotate != 0.0 ) + aNewTransform.rotate( -fXRotate, 0.0, 0.0 ); + aNewTransform.translate(aRotationCenter.DirectionX, -aRotationCenter.DirectionY, aRotationCenter.DirectionZ); + + // oblique parallel projection is done by shearing the object, not by moving the camera + if (eProjectionMode == drawing::ProjectionMode_PARALLEL) + { + double fSkew, fAlpha; + GetSkew( rGeometryItem, fSkew, fAlpha ); + if ( fSkew != 0.0 ) + { + double fInvTanBeta( fSkew / 100.0 ); + if(fInvTanBeta) + { + aNewTransform.shearXY( + fInvTanBeta * cos(fAlpha), + fInvTanBeta * sin(fAlpha)); + } + } + } + + pScene->NbcSetTransform( aNewTransform ); + + // These values are used later again, so declare them outside the if-statement. They will + // contain the absolute values of ViewPoint in 3D scene coordinate system, y-axis up. + double fViewPointX = 0; // dummy values + double fViewPointY = 0; + double fViewPointZ = 25000; + if (eProjectionMode == drawing::ProjectionMode_PERSPECTIVE) + { + double fOriginX, fOriginY; + // Calculate BoundRect of shape, including flip and z-rotation, from aTotalPolyPoly. + tools::Rectangle aBoundAfter2DTransform; // aBoundAfter2DTransform has y-axis down. + basegfx::B2DRange aTotalPolyPolyRange(aTotalPolyPoly.getB2DRange()); + aBoundAfter2DTransform.SetLeft(aTotalPolyPolyRange.getMinX()); + aBoundAfter2DTransform.SetTop(aTotalPolyPolyRange.getMinY()); + aBoundAfter2DTransform.SetRight(aTotalPolyPolyRange.getMaxX()); + aBoundAfter2DTransform.SetBottom(aTotalPolyPolyRange.getMaxY()); + + // Property "Origin" in API is relative to bounding box of shape after 2D + // transformations. Range is [-0.5;0.5] with center of bounding box as 0. + // Resolve "Origin" fractions to length + GetOrigin( rGeometryItem, fOriginX, fOriginY ); + fOriginX *= aBoundAfter2DTransform.GetWidth(); + fOriginY *= aBoundAfter2DTransform.GetHeight(); + // Resolve length to absolute value for 3D + fOriginX += aBoundAfter2DTransform.Center().X(); + fOriginY += aBoundAfter2DTransform.Center().Y(); + fOriginY = - fOriginY; + // Scene is translated so that shape center is origin of coordinate system. + // Translate point "Origin" too. + fOriginX -= aCenter.X(); + fOriginY -= -aCenter.Y(); + // API ViewPoint values are relative to point "Origin" and have y-axis down. + // ToDo: These default ViewPoint values are used as default by MS Office. But ODF + // default is (3500, -3500, 25000), details in tdf#146192. + drawing::Position3D aViewPointDefault( 3472, -3472, 25000 ); + drawing::Position3D aViewPoint( GetPosition3D( rGeometryItem, "ViewPoint", aViewPointDefault, pMap ) ); + fViewPointX = aViewPoint.PositionX + fOriginX; + fViewPointY = - aViewPoint.PositionY + fOriginY; + fViewPointZ = aViewPoint.PositionZ; + } + + // now set correct camera position + if (eProjectionMode == drawing::ProjectionMode_PARALLEL) + { + basegfx::B3DPoint _aLookAt( 0.0, 0.0, 0.0 ); + basegfx::B3DPoint _aNewCamPos( 0.0, 0.0, 25000.0 ); + rCamera.SetPosAndLookAt( _aNewCamPos, _aLookAt ); + pScene->SetCamera( rCamera ); + } + else + { + basegfx::B3DPoint _aLookAt(fViewPointX, fViewPointY, 0.0); + basegfx::B3DPoint aNewCamPos(fViewPointX, fViewPointY, fViewPointZ); + rCamera.SetPosAndLookAt( aNewCamPos, _aLookAt ); + pScene->SetCamera( rCamera ); + } + + // NbcSetTransform has not updated the scene 2D rectangles. + // Idea: Get a bound volume as polygon from bound rectangle of shape without 2D + // transformations. Calculate its projection to the XY-plane. Then calculate the bounding + // rectangle of the projection and convert this rectangle back to absolute 2D coordinates. + // Set that as 2D rectangle of the scene. + const tools::Polygon aPolygon(aBoundRect2d); // y-up + basegfx::B3DPolygon aPolygonBoundVolume; // y-down, scene coordinates + for (sal_uInt16 i = 0; i < 4; i++ ) + { + aPolygonBoundVolume.append(basegfx::B3DPoint(aPolygon[i].X(), -aPolygon[i].Y(), 0)); + } + for (sal_uInt16 i = 0; i < 4; i++ ) + { + aPolygonBoundVolume.append(basegfx::B3DPoint(aPolygon[i].X(), -aPolygon[i].Y(), fDepth)); + } + aPolygonBoundVolume.transform(aNewTransform); + + // projection + tools::Polygon a2DProjectionResult(8); // in fact 3D points with z=0 + for (sal_uInt16 i = 0; i < 8; i++ ) + { + const basegfx::B3DPoint aPoint3D(aPolygonBoundVolume.getB3DPoint(i)); + + if (eProjectionMode == drawing::ProjectionMode_PARALLEL) + { + a2DProjectionResult[i].setX(aPoint3D.getX()); + a2DProjectionResult[i].setY(aPoint3D.getY()); + } + else + { + // skip point if line from viewpoint to point is parallel to xy-plane + if (double fDiv = aPoint3D.getZ() - fViewPointZ; fDiv != 0.0) + { + double f = (- fViewPointZ) / fDiv; + double fX = (aPoint3D.getX() - fViewPointX) * f + fViewPointX; + double fY = (aPoint3D.getY() - fViewPointY) * f + fViewPointY;; + a2DProjectionResult[i].setX(static_cast<sal_Int32>(fX)); + a2DProjectionResult[i].setY(static_cast<sal_Int32>(fY)); + } + } + } + // Convert to y-axis down + for (sal_uInt16 i = 0; i < 8; i++ ) + { + a2DProjectionResult[i].setY(- a2DProjectionResult[i].Y()); + } + // Shift back to shape center + a2DProjectionResult.Translate(aCenter); + + pScene->SetLogicRect(a2DProjectionResult.GetBoundRect()); + + + // light and material + + // "LightFace" has nothing corresponding in 3D rendering engine. + /* bool bLightFace = */ GetBool(rGeometryItem, "LightFace", true); // default in ODF + + // Light directions + + drawing::Direction3D aFirstLightDirectionDefault(50000.0, 0.0, 10000.0); + drawing::Direction3D aFirstLightDirection(GetDirection3D( rGeometryItem, "FirstLightDirection", aFirstLightDirectionDefault)); + if (aFirstLightDirection.DirectionX == 0.0 && aFirstLightDirection.DirectionY == 0.0 + && aFirstLightDirection.DirectionZ == 0.0) + aFirstLightDirection.DirectionZ = 1.0; + basegfx::B3DVector aLight1Vector(aFirstLightDirection.DirectionX, -aFirstLightDirection.DirectionY, aFirstLightDirection.DirectionZ); + aLight1Vector.normalize(); + + drawing::Direction3D aSecondLightDirectionDefault(-50000.0, 0.0, 10000.0); + drawing::Direction3D aSecondLightDirection(GetDirection3D( rGeometryItem, "SecondLightDirection", aSecondLightDirectionDefault)); + if (aSecondLightDirection.DirectionX == 0.0 && aSecondLightDirection.DirectionY == 0.0 + && aSecondLightDirection.DirectionZ == 0.0) + aSecondLightDirection.DirectionZ = 1.0; + basegfx::B3DVector aLight2Vector(aSecondLightDirection.DirectionX, -aSecondLightDirection.DirectionY, aSecondLightDirection.DirectionZ); + aLight2Vector.normalize(); + + // Light Intensity + + // For "FirstLight" the 3D-Scene light "1" is regularly used. In case of surface "Matte" + // the light 4 is used instead. For "SecondLight" the 3D-Scene light "2" is regularly used. + // In case first or second light is not harsh, the lights 5 to 8 are used in addition + // to get a soft light appearance. + // The 3D-Scene light "3" is currently not used. + + // ODF default 66%. MS Office default 38000/65536=0.579 is set in import filter. + double fLight1Intensity = GetDouble(rGeometryItem, "FirstLightLevel", 66) / 100.0; + // ODF and MS Office have both default 'true'. + bool bFirstLightHarsh = GetBool(rGeometryItem, "FirstLightHarsh", true); + // ODF default 66%. MS Office default 38000/65536=0.579 is set in import filter + double fLight2Intensity = GetDouble(rGeometryItem, "SecondLightLevel", 66) / 100.0; + // ODF has default 'true'. MS Office default 'false' is set in import. + bool bSecondLightHarsh = GetBool(rGeometryItem, "SecondLightHarsh", true); + + // ODF default 33%. MS Office default 20000/65536=0.305 is set in import filter. + double fAmbientIntensity = GetDouble(rGeometryItem, "Brightness", 33) / 100.0; + + double fLight1IntensityForSpecular(fLight1Intensity); // remember original value + if (!bFirstLightHarsh || !bSecondLightHarsh) // might need softing lights + { + bool bNeedSoftLights(false); // catch case of lights with zero intensity. + basegfx::B3DVector aLight5Vector; + basegfx::B3DVector aLight6Vector; + basegfx::B3DVector aLight7Vector; + basegfx::B3DVector aLight8Vector; + // The needed light intensities depend on the angle between regular light and + // additional lights, currently for 60deg. + Color aHoriSoftLightColor; + Color aVertSoftLightColor; + + if (!bSecondLightHarsh && fLight2Intensity > 0.0 + && (bFirstLightHarsh || fLight1Intensity == 0.0)) // only second light soft + { + // That is default for shapes generated in the UI, for LO and MS Office as well. + bNeedSoftLights = true; + double fLight2SoftIntensity = fLight2Intensity * 0.40; + aHoriSoftLightColor = Color(basegfx::BColor(fLight2SoftIntensity).clamp()); + aVertSoftLightColor = aHoriSoftLightColor; + fLight2Intensity *= 0.2; + + lcl_SoftLightsDirection(aLight2Vector, aLight5Vector, aLight6Vector, + aLight7Vector, aLight8Vector); + } + else if (!bFirstLightHarsh && fLight1Intensity > 0.0 + && (bSecondLightHarsh || fLight2Intensity == 0.0)) // only first light soft + { + bNeedSoftLights = true; + double fLight1SoftIntensity = fLight1Intensity * 0.40; + aHoriSoftLightColor = Color(basegfx::BColor(fLight1SoftIntensity).clamp()); + aVertSoftLightColor = aHoriSoftLightColor; + fLight1Intensity *= 0.2; + + lcl_SoftLightsDirection(aLight1Vector, aLight5Vector, aLight6Vector, + aLight7Vector, aLight8Vector); + } + else if (!bFirstLightHarsh && fLight1Intensity > 0.0 && !bSecondLightHarsh + && fLight2Intensity > 0.0) // both lights soft + { + bNeedSoftLights = true; + // We do not hat enough lights. We use two soft lights for FirstLight and two for + // SecondLight and double intensity. + double fLight1SoftIntensity = fLight1Intensity * 0.8; + fLight1Intensity *= 0.4; + aHoriSoftLightColor = Color(basegfx::BColor(fLight1SoftIntensity).clamp()); + basegfx::B3DVector aDummy1, aDummy2; + lcl_SoftLightsDirection(aLight1Vector, aDummy1, aDummy2, aLight7Vector, + aLight8Vector); + + double fLight2SoftIntensity = fLight2Intensity * 0.8; + aVertSoftLightColor = Color(basegfx::BColor(fLight2SoftIntensity).clamp()); + fLight2Intensity *= 0.4; + lcl_SoftLightsDirection(aLight2Vector, aLight5Vector, aLight6Vector, aDummy1, + aDummy2); + } + + if (bNeedSoftLights) + { + pScene->GetProperties().SetObjectItem( + makeSvx3DLightDirection5Item(aLight5Vector)); + pScene->GetProperties().SetObjectItem( + makeSvx3DLightcolor5Item(aVertSoftLightColor)); + pScene->GetProperties().SetObjectItem(makeSvx3DLightOnOff5Item(true)); + pScene->GetProperties().SetObjectItem( + makeSvx3DLightDirection6Item(aLight6Vector)); + pScene->GetProperties().SetObjectItem( + makeSvx3DLightcolor6Item(aVertSoftLightColor)); + pScene->GetProperties().SetObjectItem(makeSvx3DLightOnOff6Item(true)); + pScene->GetProperties().SetObjectItem( + makeSvx3DLightDirection7Item(aLight7Vector)); + pScene->GetProperties().SetObjectItem( + makeSvx3DLightcolor7Item(aHoriSoftLightColor)); + pScene->GetProperties().SetObjectItem(makeSvx3DLightOnOff7Item(true)); + pScene->GetProperties().SetObjectItem( + makeSvx3DLightDirection8Item(aLight8Vector)); + pScene->GetProperties().SetObjectItem( + makeSvx3DLightcolor8Item(aHoriSoftLightColor)); + pScene->GetProperties().SetObjectItem(makeSvx3DLightOnOff8Item(true)); + } + } + + // ToDo: MSO seems to add half of the surplus to ambient color. ODF restricts value to <1. + if (fLight1Intensity > 1.0) + { + fAmbientIntensity += (fLight1Intensity - 1.0) / 2.0; + } + + // ToDo: How to handle fAmbientIntensity larger 1.0 ? Perhaps lighten object color? + + // Now set the regularly 3D-scene light attributes. + Color aAmbientColor(basegfx::BColor(fAmbientIntensity).clamp()); + pScene->GetProperties().SetObjectItem(makeSvx3DAmbientcolorItem(aAmbientColor)); + + pScene->GetProperties().SetObjectItem(makeSvx3DLightDirection1Item(aLight1Vector)); + pScene->GetProperties().SetObjectItem(makeSvx3DLightOnOff1Item(fLight1Intensity > 0.0)); + Color aLight1Color(basegfx::BColor(fLight1Intensity).clamp()); + pScene->GetProperties().SetObjectItem(makeSvx3DLightcolor1Item(aLight1Color)); + + pScene->GetProperties().SetObjectItem(makeSvx3DLightDirection2Item(aLight2Vector)); + pScene->GetProperties().SetObjectItem(makeSvx3DLightOnOff2Item(fLight2Intensity > 0.0)); + Color aLight2Color(basegfx::BColor(fLight2Intensity).clamp()); + pScene->GetProperties().SetObjectItem(makeSvx3DLightcolor2Item(aLight2Color)); + + // Object reactions on light + // Diffusion, Specular-Color and -Intensity are object properties, not scene properties. + // Surface flag "Metal" is an object property too. + + // Property "Diffusion" would correspond to style attribute "drd3:diffuse-color". + // But that is not implemented. We cannot ignore the attribute because MS Office sets + // attribute c3DDiffuseAmt to 43712 (Type Fixed 16.16, approx 66,9%) instead of MSO + // default 65536 (100%), if the user sets surface 'Metal' in the UI of MS Office. + // We will change the material color of the 3D object as ersatz. + // ODF data type is percent with default 0%. MSO default is set in import filter. + double fDiffusion = GetDouble(rGeometryItem, "Diffusion", 0.0) / 100.0; + + // ODF standard specifies for value true: "the specular color for the shading of an + // extruded shape is gray (red, green and blue values of 200) instead of white and 15% is + // added to the specularity." + // Neither 'specularity' nor 'specular color' is clearly defined in the standard. ODF term + // 'specularity' seems to correspond to UI field 'Specular Intensity' for 3D scenes. + // MS Office uses current material color in case 'Metal' is set. To detect, whether + // rendering similar to MS Office has to be used the property 'MetalType' is used. It is + // set on import and in the extrusion bar. + bool bMetal = GetBool(rGeometryItem, "Metal", false); + sal_Int16 eMetalType( + GetMetalType(rGeometryItem, drawing::EnhancedCustomShapeMetalType::MetalODF)); + bool bMetalMSCompatible + = eMetalType == drawing::EnhancedCustomShapeMetalType::MetalMSCompatible; + + // Property "Specularity" corresponds to 3D object style attribute dr3d:specular-color. + double fSpecularity = GetDouble(rGeometryItem, "Specularity", 0) / 100.0; + + if (bMetal && !bMetalMSCompatible) + { + fSpecularity *= 200.0 / 255.0; + } + + // MS Office seems to render as if 'Specular Color' = Specularity * Light1Intensity. + double fShadingFactor = fLight1IntensityForSpecular * fSpecularity; + Color aSpecularCol(basegfx::BColor(fShadingFactor).clamp()); + // In case of bMetalMSCompatible the color will be recalculated in the below loop. + + // Shininess ODF default 50 (unit %). MS Office default 5, import filter makes *10. + // Shininess corresponds to "Specular Intensity" with the nonlinear relationship + // "Specular Intensity" = 2^c3DShininess = 2^("Shininess" / 10) + double fShininess = GetDouble(rGeometryItem, "Shininess", 50) / 10.0; + fShininess = std::clamp<double>(pow(2, fShininess), 0.0, 100.0); + sal_uInt16 nIntensity = static_cast<sal_uInt16>(basegfx::fround(fShininess)); + if (bMetal && !bMetalMSCompatible) + { + nIntensity += 15; // as specified in ODF + nIntensity = std::clamp<sal_uInt16>(nIntensity, 0, 100); + } + + SdrObjListIter aSceneIter(*pScene, SdrIterMode::DeepNoGroups); + while (aSceneIter.IsMore()) + { + const SdrObject* pNext = aSceneIter.Next(); + + // Change material color as ersatz for missing style attribute "drd3:diffuse-color". + // For this ersatz we exclude case fDiffusion == 0.0, because for older documents this + // attribute is not written out to draw:extrusion-diffusion and ODF default 0 would + // produce black objects. + const Color& rMatColor + = pNext->GetProperties().GetItem(XATTR_FILLCOLOR).GetColorValue(); + Color aOldMatColor(rMatColor); + if (basegfx::fTools::more(fDiffusion, 0.0) + && !basegfx::fTools::equal(fDiffusion, 1.0)) + { + // Occurs e.g. with MS surface preset 'Metal'. + sal_uInt16 nHue; + sal_uInt16 nSaturation; + sal_uInt16 nBrightness; + rMatColor.RGBtoHSB(nHue, nSaturation, nBrightness); + nBrightness + = static_cast<sal_uInt16>(static_cast<double>(nBrightness) * fDiffusion); + nBrightness = std::clamp<sal_uInt16>(nBrightness, 0, 100); + Color aNewMatColor = Color::HSBtoRGB(nHue, nSaturation, nBrightness); + pNext->GetProperties().SetObjectItem(XFillColorItem("", aNewMatColor)); + } + + // Using material color instead of gray in case of MS Office compatible rendering. + if (bMetal && bMetalMSCompatible) + { + sal_uInt16 nHue; + sal_uInt16 nSaturation; + sal_uInt16 nBrightness; + aOldMatColor.RGBtoHSB(nHue, nSaturation, nBrightness); + nBrightness = static_cast<sal_uInt16>(static_cast<double>(nBrightness) + * fShadingFactor); + nBrightness = std::clamp<sal_uInt16>(nBrightness, 0, 100); + aSpecularCol = Color::HSBtoRGB(nHue, nSaturation, nBrightness); + } + + pNext->GetProperties().SetObjectItem(makeSvx3DMaterialSpecularItem(aSpecularCol)); + pNext->GetProperties().SetObjectItem( + makeSvx3DMaterialSpecularIntensityItem(nIntensity)); + } + + // fSpecularity = 0 is used to indicate surface preset "Matte". + if (basegfx::fTools::equalZero(fSpecularity)) + { + // First light in LO 3D engine is always specular, all other lights are never specular. + // We copy light1 values to light4 and use it instead of light1 in the 3D scene. + pScene->GetProperties().SetObjectItem(makeSvx3DLightOnOff1Item(false)); + pScene->GetProperties().SetObjectItem(makeSvx3DLightOnOff4Item(true)); + pScene->GetProperties().SetObjectItem(makeSvx3DLightcolor4Item(aLight1Color)); + pScene->GetProperties().SetObjectItem(makeSvx3DLightDirection4Item(aLight1Vector)); + } + + // removing placeholder objects + for (E3dCompoundObject* pTemp : aPlaceholderObjectList) + { + pScene->RemoveObject( pTemp->GetOrdNum() ); + // always use SdrObject::Free(...) for SdrObjects (!) + SdrObject* pTemp2(pTemp); + SdrObject::Free(pTemp2); + } + } + else + { + // always use SdrObject::Free(...) for SdrObjects (!) + SdrObject* pTemp(pScene); + SdrObject::Free(pTemp); + } + } + return pRet; +} + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svx/source/customshapes/EnhancedCustomShape3d.hxx b/svx/source/customshapes/EnhancedCustomShape3d.hxx new file mode 100644 index 000000000..77e7d350f --- /dev/null +++ b/svx/source/customshapes/EnhancedCustomShape3d.hxx @@ -0,0 +1,37 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#ifndef INCLUDED_SVX_SOURCE_CUSTOMSHAPES_ENHANCEDCUSTOMSHAPE3D_HXX +#define INCLUDED_SVX_SOURCE_CUSTOMSHAPES_ENHANCEDCUSTOMSHAPE3D_HXX + +class SdrObject; +class SdrObjCustomShape; + +class EnhancedCustomShape3d final +{ + +public: + static SdrObject* Create3DObject( + const SdrObject* pShape2d, + const SdrObjCustomShape& rSdrObjCustomShape); +}; + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svx/source/customshapes/EnhancedCustomShapeEngine.cxx b/svx/source/customshapes/EnhancedCustomShapeEngine.cxx new file mode 100644 index 000000000..ae919904a --- /dev/null +++ b/svx/source/customshapes/EnhancedCustomShapeEngine.cxx @@ -0,0 +1,488 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#include <com/sun/star/uno/Reference.h> +#include <com/sun/star/uno/XComponentContext.hpp> +#include <com/sun/star/awt/Rectangle.hpp> +#include <com/sun/star/beans/PropertyValue.hpp> +#include <com/sun/star/drawing/PolyPolygonBezierCoords.hpp> +#include <com/sun/star/lang/XInitialization.hpp> +#include <com/sun/star/lang/XServiceInfo.hpp> +#include <com/sun/star/drawing/XCustomShapeEngine.hpp> +#include <svx/EnhancedCustomShape2d.hxx> +#include "EnhancedCustomShape3d.hxx" +#include "EnhancedCustomShapeFontWork.hxx" +#include "EnhancedCustomShapeHandle.hxx" +#include <svx/unoshape.hxx> +#include <svx/unopage.hxx> +#include <svx/svdobj.hxx> +#include <svx/svdoashp.hxx> +#include <svx/svdogrp.hxx> +#include <editeng/outlobj.hxx> +#include <svl/itemset.hxx> +#include <svx/svdopath.hxx> +#include <svx/svdpage.hxx> +#include <svx/svditer.hxx> +#include <svx/xfillit0.hxx> +#include <svx/xlineit0.hxx> +#include <basegfx/polygon/b2dpolypolygontools.hxx> +#include <com/sun/star/document/XActionLockable.hpp> +#include <cppuhelper/implbase.hxx> +#include <cppuhelper/supportsservice.hxx> + +using namespace css; +using namespace css::uno; + +class SdrObject; +class SdrObjCustomShape; + +namespace { + +class EnhancedCustomShapeEngine : public cppu::WeakImplHelper +< + css::lang::XInitialization, + css::lang::XServiceInfo, + css::drawing::XCustomShapeEngine +> +{ + css::uno::Reference< css::drawing::XShape > mxShape; + bool mbForceGroupWithText; + + std::unique_ptr<SdrObject, SdrObjectFreeOp> ImplForceGroupWithText( + const SdrObjCustomShape& rSdrObjCustomShape, + std::unique_ptr<SdrObject, SdrObjectFreeOp> pRenderedShape); + +public: + EnhancedCustomShapeEngine(); + + // XInterface + virtual void SAL_CALL acquire() noexcept override; + virtual void SAL_CALL release() noexcept override; + + // XInitialization + virtual void SAL_CALL initialize( const css::uno::Sequence< css::uno::Any >& aArguments ) override; + + // XServiceInfo + virtual OUString SAL_CALL getImplementationName() override; + virtual sal_Bool SAL_CALL supportsService( const OUString& rServiceName ) override; + virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override; + + // XCustomShapeEngine + virtual css::uno::Reference< css::drawing::XShape > SAL_CALL render() override; + virtual css::awt::Rectangle SAL_CALL getTextBounds() override; + virtual css::drawing::PolyPolygonBezierCoords SAL_CALL getLineGeometry() override; + virtual css::uno::Sequence< css::uno::Reference< css::drawing::XCustomShapeHandle > > SAL_CALL getInteraction() override; +}; + +EnhancedCustomShapeEngine::EnhancedCustomShapeEngine() : + mbForceGroupWithText ( false ) +{ +} + +// XInterface +void SAL_CALL EnhancedCustomShapeEngine::acquire() noexcept +{ + OWeakObject::acquire(); +} +void SAL_CALL EnhancedCustomShapeEngine::release() noexcept +{ + OWeakObject::release(); +} + +// XInitialization +void SAL_CALL EnhancedCustomShapeEngine::initialize( const Sequence< Any >& aArguments ) +{ + Sequence< beans::PropertyValue > aParameter; + for ( const auto& rArgument : aArguments ) + { + if ( rArgument >>= aParameter ) + break; + } + for ( const beans::PropertyValue& rProp : std::as_const(aParameter) ) + { + if ( rProp.Name == "CustomShape" ) + rProp.Value >>= mxShape; + else if ( rProp.Name == "ForceGroupWithText" ) + rProp.Value >>= mbForceGroupWithText; + } +} + +// XServiceInfo +OUString SAL_CALL EnhancedCustomShapeEngine::getImplementationName() +{ + return "com.sun.star.drawing.EnhancedCustomShapeEngine"; +} +sal_Bool SAL_CALL EnhancedCustomShapeEngine::supportsService( const OUString& rServiceName ) +{ + return cppu::supportsService(this, rServiceName); +} +Sequence< OUString > SAL_CALL EnhancedCustomShapeEngine::getSupportedServiceNames() +{ + return { "com.sun.star.drawing.CustomShapeEngine" }; +} + +// XCustomShapeEngine +std::unique_ptr<SdrObject, SdrObjectFreeOp> EnhancedCustomShapeEngine::ImplForceGroupWithText( + const SdrObjCustomShape& rSdrObjCustomShape, + std::unique_ptr<SdrObject, SdrObjectFreeOp> pRenderedShape) +{ + const bool bHasText(rSdrObjCustomShape.HasText()); + + if ( pRenderedShape || bHasText ) + { + // applying shadow + const SdrObject* pShadowGeometry(rSdrObjCustomShape.GetSdrObjectShadowFromCustomShape()); + + if ( pShadowGeometry ) + { + if ( pRenderedShape ) + { + if ( dynamic_cast<const SdrObjGroup*>( pRenderedShape.get() ) == nullptr ) + { + auto pTmp = std::move(pRenderedShape); + pRenderedShape.reset(new SdrObjGroup(rSdrObjCustomShape.getSdrModelFromSdrObject())); + static_cast<SdrObjGroup*>(pRenderedShape.get())->GetSubList()->NbcInsertObject( pTmp.release() ); + } + + static_cast<SdrObjGroup*>(pRenderedShape.get())->GetSubList()->NbcInsertObject( + pShadowGeometry->CloneSdrObject(pShadowGeometry->getSdrModelFromSdrObject()), + 0); + } + else + { + pRenderedShape.reset( pShadowGeometry->CloneSdrObject(pShadowGeometry->getSdrModelFromSdrObject()) ); + } + } + + // apply text + if ( bHasText ) + { + // #i37011# also create a text object and add at rPos + 1 + std::unique_ptr<SdrObject, SdrObjectFreeOp> pTextObj( SdrObjFactory::MakeNewObject( + rSdrObjCustomShape.getSdrModelFromSdrObject(), + rSdrObjCustomShape.GetObjInventor(), + SdrObjKind::Text) ); + + // Copy text content + OutlinerParaObject* pParaObj(rSdrObjCustomShape.GetOutlinerParaObject()); + + if( pParaObj ) + pTextObj->NbcSetOutlinerParaObject( *pParaObj ); + + // copy all attributes + SfxItemSet aTargetItemSet(rSdrObjCustomShape.GetMergedItemSet()); + + // clear fill and line style + aTargetItemSet.Put(XLineStyleItem(drawing::LineStyle_NONE)); + aTargetItemSet.Put(XFillStyleItem(drawing::FillStyle_NONE)); + + // get the text bounds and set at text object + tools::Rectangle aTextBounds(rSdrObjCustomShape.GetSnapRect()); + auto pSdrObjCustomShape = dynamic_cast< SdrObjCustomShape* >(SdrObject::getSdrObjectFromXShape(mxShape)); + + if(pSdrObjCustomShape) + { + EnhancedCustomShape2d aCustomShape2d(*pSdrObjCustomShape); + aTextBounds = aCustomShape2d.GetTextRect(); + } + + pTextObj->SetSnapRect( aTextBounds ); + + // if rotated, copy GeoStat, too. + const GeoStat& rSourceGeo(rSdrObjCustomShape.GetGeoStat()); + if ( rSourceGeo.nRotationAngle ) + { + pTextObj->NbcRotate( + rSdrObjCustomShape.GetSnapRect().Center(), + rSourceGeo.nRotationAngle, + rSourceGeo.mfSinRotationAngle, + rSourceGeo.mfCosRotationAngle); + } + + // set modified ItemSet at text object + pTextObj->SetMergedItemSet(aTargetItemSet); + + if ( pRenderedShape ) + { + if ( dynamic_cast<const SdrObjGroup*>( pRenderedShape.get() ) == nullptr ) + { + auto pTmp = std::move(pRenderedShape); + pRenderedShape.reset(new SdrObjGroup(rSdrObjCustomShape.getSdrModelFromSdrObject())); + static_cast<SdrObjGroup*>(pRenderedShape.get())->GetSubList()->NbcInsertObject( pTmp.release() ); + } + static_cast<SdrObjGroup*>(pRenderedShape.get())->GetSubList()->NbcInsertObject( pTextObj.release() ); + } + else + pRenderedShape = std::move(pTextObj); + } + + // force group + if ( pRenderedShape ) + { + if ( dynamic_cast<const SdrObjGroup*>( pRenderedShape.get() ) == nullptr ) + { + auto pTmp = std::move(pRenderedShape); + pRenderedShape.reset(new SdrObjGroup(rSdrObjCustomShape.getSdrModelFromSdrObject())); + static_cast<SdrObjGroup*>(pRenderedShape.get())->GetSubList()->NbcInsertObject( pTmp.release() ); + } + } + } + + return pRenderedShape; +} + +void SetTemporary( uno::Reference< drawing::XShape > const & xShape ) +{ + if ( xShape.is() ) + { + SvxShape* pShape = comphelper::getFromUnoTunnel<SvxShape>( xShape ); + if ( pShape ) + pShape->TakeSdrObjectOwnership(); + } +} + +Reference< drawing::XShape > SAL_CALL EnhancedCustomShapeEngine::render() +{ + SdrObjCustomShape* pSdrObjCustomShape = dynamic_cast< SdrObjCustomShape* >(SdrObject::getSdrObjectFromXShape(mxShape)); + + if(!pSdrObjCustomShape) + { + return Reference< drawing::XShape >(); + } + + // retrieving the TextPath property to check if feature is enabled + const SdrCustomShapeGeometryItem& rGeometryItem(pSdrObjCustomShape->GetMergedItem( SDRATTR_CUSTOMSHAPE_GEOMETRY )); + bool bTextPathOn = false; + const uno::Any* pAny = rGeometryItem.GetPropertyValueByName( "TextPath", "TextPath" ); + if ( pAny ) + *pAny >>= bTextPathOn; + + EnhancedCustomShape2d aCustomShape2d(*pSdrObjCustomShape); + Degree100 nRotateAngle = aCustomShape2d.GetRotateAngle(); + + bool bFlipV = aCustomShape2d.IsFlipVert(); + bool bFlipH = aCustomShape2d.IsFlipHorz(); + bool bLineGeometryNeededOnly = bTextPathOn; + + std::unique_ptr<SdrObject, SdrObjectFreeOp> xRenderedShape(aCustomShape2d.CreateObject(bLineGeometryNeededOnly)); + if (xRenderedShape) + { + if ( bTextPathOn ) + { + std::unique_ptr<SdrObject, SdrObjectFreeOp> xRenderedFontWork( + EnhancedCustomShapeFontWork::CreateFontWork( + xRenderedShape.get(), + *pSdrObjCustomShape)); + + if (xRenderedFontWork) + { + xRenderedShape = std::move(xRenderedFontWork); + } + } + std::unique_ptr<SdrObject, SdrObjectFreeOp> xRenderedShape3d(EnhancedCustomShape3d::Create3DObject(xRenderedShape.get(), *pSdrObjCustomShape)); + if (xRenderedShape3d) + { + bFlipV = bFlipH = false; + nRotateAngle = 0_deg100; + xRenderedShape = std::move(xRenderedShape3d); + } + + tools::Rectangle aRect(pSdrObjCustomShape->GetSnapRect()); + const GeoStat& rGeoStat(pSdrObjCustomShape->GetGeoStat()); + + if ( rGeoStat.nShearAngle ) + { + Degree100 nShearAngle = rGeoStat.nShearAngle; + double nTan = rGeoStat.mfTanShearAngle; + if (bFlipV != bFlipH) + { + nShearAngle = -nShearAngle; + nTan = -nTan; + } + + xRenderedShape->Shear(pSdrObjCustomShape->GetSnapRect().Center(), nShearAngle, nTan, false); + } + if(nRotateAngle ) + xRenderedShape->NbcRotate(pSdrObjCustomShape->GetSnapRect().Center(), nRotateAngle); + if ( bFlipV ) + { + Point aLeft( aRect.Left(), ( aRect.Top() + aRect.Bottom() ) >> 1 ); + Point aRight( aLeft.X() + 1000, aLeft.Y() ); + xRenderedShape->NbcMirror( aLeft, aRight ); + } + if ( bFlipH ) + { + Point aTop( ( aRect.Left() + aRect.Right() ) >> 1, aRect.Top() ); + Point aBottom( aTop.X(), aTop.Y() + 1000 ); + xRenderedShape->NbcMirror( aTop, aBottom ); + } + + xRenderedShape->NbcSetStyleSheet(pSdrObjCustomShape->GetStyleSheet(), true); + xRenderedShape->RecalcSnapRect(); + } + + if ( mbForceGroupWithText ) + { + xRenderedShape = ImplForceGroupWithText( + *pSdrObjCustomShape, + std::move(xRenderedShape)); + } + + Reference< drawing::XShape > xShape; + + if (xRenderedShape) + { + aCustomShape2d.ApplyGluePoints(xRenderedShape.get()); + SdrObject* pRenderedShape = xRenderedShape.release(); + xShape = SvxDrawPage::CreateShapeByTypeAndInventor( pRenderedShape->GetObjIdentifier(), + pRenderedShape->GetObjInventor(), pRenderedShape ); + } + + SetTemporary( xShape ); + + return xShape; +} + +awt::Rectangle SAL_CALL EnhancedCustomShapeEngine::getTextBounds() +{ + awt::Rectangle aTextRect; + if (SdrObjCustomShape* pSdrObjCustomShape = dynamic_cast< SdrObjCustomShape* >(SdrObject::getSdrObjectFromXShape(mxShape))) + { + uno::Reference< document::XActionLockable > xLockable( mxShape, uno::UNO_QUERY ); + + if(xLockable.is() && !xLockable->isActionLocked()) + { + EnhancedCustomShape2d aCustomShape2d(*pSdrObjCustomShape); + tools::Rectangle aRect( aCustomShape2d.GetTextRect() ); + aTextRect.X = aRect.Left(); + aTextRect.Y = aRect.Top(); + aTextRect.Width = aRect.GetWidth(); + aTextRect.Height = aRect.GetHeight(); + } + } + + return aTextRect; +} + +drawing::PolyPolygonBezierCoords SAL_CALL EnhancedCustomShapeEngine::getLineGeometry() +{ + drawing::PolyPolygonBezierCoords aPolyPolygonBezierCoords; + SdrObjCustomShape* pSdrObjCustomShape = dynamic_cast< SdrObjCustomShape* >(SdrObject::getSdrObjectFromXShape(mxShape)); + + if(pSdrObjCustomShape) + { + EnhancedCustomShape2d aCustomShape2d(*pSdrObjCustomShape); + SdrObjectUniquePtr pObj = aCustomShape2d.CreateLineGeometry(); + + if ( pObj ) + { + tools::Rectangle aRect(pSdrObjCustomShape->GetSnapRect()); + bool bFlipV = aCustomShape2d.IsFlipVert(); + bool bFlipH = aCustomShape2d.IsFlipHorz(); + const GeoStat& rGeoStat(pSdrObjCustomShape->GetGeoStat()); + + if ( rGeoStat.nShearAngle ) + { + Degree100 nShearAngle = rGeoStat.nShearAngle; + double nTan = rGeoStat.mfTanShearAngle; + if (bFlipV != bFlipH) + { + nShearAngle = -nShearAngle; + nTan = -nTan; + } + pObj->Shear( aRect.Center(), nShearAngle, nTan, false); + } + Degree100 nRotateAngle = aCustomShape2d.GetRotateAngle(); + if( nRotateAngle ) + pObj->NbcRotate( aRect.Center(), nRotateAngle ); + if ( bFlipH ) + { + Point aTop( ( aRect.Left() + aRect.Right() ) >> 1, aRect.Top() ); + Point aBottom( aTop.X(), aTop.Y() + 1000 ); + pObj->NbcMirror( aTop, aBottom ); + } + if ( bFlipV ) + { + Point aLeft( aRect.Left(), ( aRect.Top() + aRect.Bottom() ) >> 1 ); + Point aRight( aLeft.X() + 1000, aLeft.Y() ); + pObj->NbcMirror( aLeft, aRight ); + } + + basegfx::B2DPolyPolygon aPolyPolygon; + SdrObjListIter aIter( *pObj, SdrIterMode::DeepWithGroups ); + + while ( aIter.IsMore() ) + { + basegfx::B2DPolyPolygon aPP; + const SdrObject* pNext = aIter.Next(); + + if ( auto pPathObj = dynamic_cast<const SdrPathObj*>(pNext) ) + { + aPP = pPathObj->GetPathPoly(); + } + else + { + SdrObjectUniquePtr pNewObj = pNext->ConvertToPolyObj( false, false ); + SdrPathObj* pPath = dynamic_cast<SdrPathObj*>( pNewObj.get() ); + if ( pPath ) + aPP = pPath->GetPathPoly(); + } + + if ( aPP.count() ) + aPolyPolygon.append(aPP); + } + pObj.reset(); + basegfx::utils::B2DPolyPolygonToUnoPolyPolygonBezierCoords( aPolyPolygon, + aPolyPolygonBezierCoords ); + } + } + + return aPolyPolygonBezierCoords; +} + +Sequence< Reference< drawing::XCustomShapeHandle > > SAL_CALL EnhancedCustomShapeEngine::getInteraction() +{ + sal_uInt32 i, nHdlCount = 0; + SdrObjCustomShape* pSdrObjCustomShape = dynamic_cast< SdrObjCustomShape* >(SdrObject::getSdrObjectFromXShape(mxShape)); + + if(pSdrObjCustomShape) + { + EnhancedCustomShape2d aCustomShape2d(*pSdrObjCustomShape); + nHdlCount = aCustomShape2d.GetHdlCount(); + } + + Sequence< Reference< drawing::XCustomShapeHandle > > aSeq( nHdlCount ); + auto aSeqRange = asNonConstRange(aSeq); + + for ( i = 0; i < nHdlCount; i++ ) + aSeqRange[ i ] = new EnhancedCustomShapeHandle( mxShape, i ); + return aSeq; +} + +} + +extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface * +com_sun_star_drawing_EnhancedCustomShapeEngine_get_implementation( + css::uno::XComponentContext *, + css::uno::Sequence<css::uno::Any> const &) +{ + return cppu::acquire(new EnhancedCustomShapeEngine); +} + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svx/source/customshapes/EnhancedCustomShapeFontWork.cxx b/svx/source/customshapes/EnhancedCustomShapeFontWork.cxx new file mode 100644 index 000000000..0043b69cd --- /dev/null +++ b/svx/source/customshapes/EnhancedCustomShapeFontWork.cxx @@ -0,0 +1,956 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#include "EnhancedCustomShapeFontWork.hxx" +#include <svl/itemset.hxx> +#include <svx/svddef.hxx> +#include <svx/svdopath.hxx> +#include <vcl/metric.hxx> +#include <svx/sdasitm.hxx> +#include <svx/sdtfsitm.hxx> +#include <vcl/virdev.hxx> +#include <svx/svditer.hxx> +#include <editeng/eeitem.hxx> +#include <editeng/frmdiritem.hxx> +#include <editeng/fontitem.hxx> +#include <editeng/postitem.hxx> +#include <editeng/wghtitem.hxx> +#include <editeng/fhgtitem.hxx> +#include <editeng/charscaleitem.hxx> +#include <svx/svdoashp.hxx> +#include <svx/sdshitm.hxx> +#include <editeng/outlobj.hxx> +#include <editeng/editobj.hxx> +#include <o3tl/numeric.hxx> +#include <vector> +#include <numeric> +#include <algorithm> +#include <comphelper/processfactory.hxx> +#include <com/sun/star/i18n/BreakIterator.hpp> +#include <com/sun/star/i18n/ScriptType.hpp> +#include <basegfx/polygon/b2dpolypolygontools.hxx> +#include <basegfx/polygon/b2dpolygontools.hxx> +#include <sal/log.hxx> +#include <rtl/math.hxx> + +using namespace com::sun::star; +using namespace com::sun::star::uno; + +namespace { + +struct FWCharacterData // representing a single character +{ + std::vector< tools::PolyPolygon > vOutlines; + tools::Rectangle aBoundRect; +}; +struct FWParagraphData // representing a single paragraph +{ + OUString aString; + std::vector< FWCharacterData > vCharacters; + tools::Rectangle aBoundRect; + SvxFrameDirection nFrameDirection; +}; +struct FWTextArea // representing multiple concluding paragraphs +{ + std::vector< FWParagraphData > vParagraphs; + tools::Rectangle aBoundRect; +}; +struct FWData // representing the whole text +{ + std::vector< FWTextArea > vTextAreas; + double fHorizontalTextScaling; + double fVerticalTextScaling; + sal_uInt32 nMaxParagraphsPerTextArea; + sal_Int32 nSingleLineHeight; + bool bSingleLineMode; + bool bScaleX; +}; + +} + +static bool InitializeFontWorkData( + const SdrObjCustomShape& rSdrObjCustomShape, + const sal_uInt16 nOutlinesCount2d, + FWData& rFWData) +{ + bool bNoErr = false; + bool bSingleLineMode = false; + sal_uInt16 nTextAreaCount = nOutlinesCount2d; + if ( nOutlinesCount2d & 1 ) + bSingleLineMode = true; + else + nTextAreaCount >>= 1; + + const SdrCustomShapeGeometryItem& rGeometryItem( rSdrObjCustomShape.GetMergedItem( SDRATTR_CUSTOMSHAPE_GEOMETRY ) ); + const css::uno::Any* pAny = rGeometryItem.GetPropertyValueByName( "TextPath", "ScaleX" ); + if (pAny) + *pAny >>= rFWData.bScaleX; + else + rFWData.bScaleX = false; + + if ( nTextAreaCount ) + { + rFWData.bSingleLineMode = bSingleLineMode; + + // setting the strings + OutlinerParaObject* pParaObj(rSdrObjCustomShape.GetOutlinerParaObject()); + + if ( pParaObj ) + { + const EditTextObject& rTextObj = pParaObj->GetTextObject(); + sal_Int32 nParagraphsLeft = rTextObj.GetParagraphCount(); + + rFWData.nMaxParagraphsPerTextArea = ( ( nParagraphsLeft - 1 ) / nTextAreaCount ) + 1; + sal_Int32 j = 0; + while( nParagraphsLeft && nTextAreaCount ) + { + FWTextArea aTextArea; + sal_Int32 i, nParagraphs = ( ( nParagraphsLeft - 1 ) / nTextAreaCount ) + 1; + for ( i = 0; i < nParagraphs; ++i, ++j ) + { + FWParagraphData aParagraphData; + aParagraphData.aString = rTextObj.GetText( j ); + + const SfxItemSet& rParaSet = rTextObj.GetParaAttribs( j ); // retrieving some paragraph attributes + aParagraphData.nFrameDirection = rParaSet.Get( EE_PARA_WRITINGDIR ).GetValue(); + aTextArea.vParagraphs.push_back( aParagraphData ); + } + rFWData.vTextAreas.push_back( aTextArea ); + nParagraphsLeft -= nParagraphs; + nTextAreaCount--; + } + bNoErr = true; + } + } + return bNoErr; +} + +static double GetLength( const tools::Polygon& rPolygon ) +{ + double fLength = 0; + if ( rPolygon.GetSize() > 1 ) + { + sal_uInt16 nCount = rPolygon.GetSize(); + while( --nCount ) + fLength += rPolygon.CalcDistance( nCount, nCount - 1 ); + } + return fLength; +} + + +/* CalculateHorizontalScalingFactor returns the horizontal scaling factor for +the whole text object, so that each text will match its corresponding 2d Outline */ +static void CalculateHorizontalScalingFactor( + const SdrObjCustomShape& rSdrObjCustomShape, + FWData& rFWData, + const tools::PolyPolygon& rOutline2d) +{ + double fScalingFactor = 1.0; + rFWData.fVerticalTextScaling = 1.0; + + sal_uInt16 i = 0; + bool bSingleLineMode = false; + sal_uInt16 nOutlinesCount2d = rOutline2d.Count(); + + vcl::Font aFont; + const SvxFontItem& rFontItem( rSdrObjCustomShape.GetMergedItem( EE_CHAR_FONTINFO ) ); + const SvxFontHeightItem& rFontHeight( rSdrObjCustomShape.GetMergedItem( EE_CHAR_FONTHEIGHT ) ); + sal_Int32 nFontSize = rFontHeight.GetHeight(); + + SAL_WARN_IF(nFontSize > SAL_MAX_INT16, "svx", "CalculateHorizontalScalingFactor suspiciously large font height: " << nFontSize); + + if (rFWData.bScaleX) + aFont.SetFontHeight( nFontSize ); + else + aFont.SetFontHeight( rSdrObjCustomShape.GetLogicRect().GetHeight() / rFWData.nMaxParagraphsPerTextArea ); + + aFont.SetAlignment( ALIGN_TOP ); + aFont.SetFamilyName( rFontItem.GetFamilyName() ); + aFont.SetFamily( rFontItem.GetFamily() ); + aFont.SetStyleName( rFontItem.GetStyleName() ); + const SvxPostureItem& rPostureItem = rSdrObjCustomShape.GetMergedItem( EE_CHAR_ITALIC ); + aFont.SetItalic( rPostureItem.GetPosture() ); + + const SvxWeightItem& rWeightItem = rSdrObjCustomShape.GetMergedItem( EE_CHAR_WEIGHT ); + aFont.SetWeight( rWeightItem.GetWeight() ); + aFont.SetOrientation( 0_deg10 ); + // initializing virtual device + + ScopedVclPtrInstance< VirtualDevice > pVirDev(DeviceFormat::DEFAULT); + pVirDev->SetMapMode(MapMode(MapUnit::Map100thMM)); + pVirDev->SetFont( aFont ); + + if ( nOutlinesCount2d & 1 ) + bSingleLineMode = true; + + // In case of rFWData.bScaleX == true it loops with reduced font size until the current run + // results in a fScalingFactor >=1.0. The fact, that case rFWData.bScaleX == true keeps font + // size if possible, is not done here with scaling factor 1 but is done in method + // FitTextOutlinesToShapeOutlines() + do + { + i = 0; + bool bScalingFactorDefined = false; // New calculation for each font size + for( const auto& rTextArea : rFWData.vTextAreas ) + { + // calculating the width of the corresponding 2d text area + double fWidth = GetLength( rOutline2d.GetObject( i++ ) ); + if ( !bSingleLineMode ) + { + fWidth += GetLength( rOutline2d.GetObject( i++ ) ); + fWidth /= 2.0; + } + + for( const auto& rParagraph : rTextArea.vParagraphs ) + { + double fTextWidth = pVirDev->GetTextWidth( rParagraph.aString ); + if ( fTextWidth > 0.0 ) + { + double fScale = fWidth / fTextWidth; + if ( !bScalingFactorDefined ) + { + fScalingFactor = fScale; + bScalingFactorDefined = true; + } + else if (fScale < fScalingFactor) + { + fScalingFactor = fScale; + } + } + } + } + + if (fScalingFactor < 1.0) + { + // if we have a very large font that will require scaling down to a very small value then + // skip directly to a small font size + if (nFontSize > 128) + { + double nEstimatedFinalFontSize = nFontSize * fScalingFactor; + double nOnePercentFontSize = nFontSize / 100.0; + if (nEstimatedFinalFontSize < nOnePercentFontSize) + { + nFontSize = std::max<int>(16, std::ceil(5 * nEstimatedFinalFontSize)); + SAL_WARN("svx", "CalculateHorizontalScalingFactor skipping direct to: " << nFontSize << " from " << rFontHeight.GetHeight()); + } + } + nFontSize--; + aFont.SetFontHeight( nFontSize ); + pVirDev->SetFont( aFont ); + } + } + while (rFWData.bScaleX && fScalingFactor < 1.0 && nFontSize > 1 ); + + if (nFontSize > 1) + rFWData.fVerticalTextScaling = static_cast<double>(nFontSize) / rFontHeight.GetHeight(); + + rFWData.fHorizontalTextScaling = fScalingFactor; +} + +static void GetTextAreaOutline( + const FWData& rFWData, + const SdrObjCustomShape& rSdrObjCustomShape, + FWTextArea& rTextArea, + bool bSameLetterHeights) +{ + bool bIsVertical(rSdrObjCustomShape.IsVerticalWriting()); + sal_Int32 nVerticalOffset = rFWData.nMaxParagraphsPerTextArea > rTextArea.vParagraphs.size() + ? rFWData.nSingleLineHeight / 2 : 0; + + for( auto& rParagraph : rTextArea.vParagraphs ) + { + const OUString& rText = rParagraph.aString; + if ( !rText.isEmpty() ) + { + // generating vcl/font + sal_uInt16 nScriptType = i18n::ScriptType::LATIN; + Reference< i18n::XBreakIterator > xBI( EnhancedCustomShapeFontWork::GetBreakIterator() ); + if ( xBI.is() ) + { + nScriptType = xBI->getScriptType( rText, 0 ); + if( i18n::ScriptType::WEAK == nScriptType ) + { + sal_Int32 nChg = xBI->endOfScript( rText, 0, nScriptType ); + if (nChg < rText.getLength() && nChg >= 0) + nScriptType = xBI->getScriptType( rText, nChg ); + else + nScriptType = i18n::ScriptType::LATIN; + } + } + sal_uInt16 nFntItm = EE_CHAR_FONTINFO; + if ( nScriptType == i18n::ScriptType::COMPLEX ) + nFntItm = EE_CHAR_FONTINFO_CTL; + else if ( nScriptType == i18n::ScriptType::ASIAN ) + nFntItm = EE_CHAR_FONTINFO_CJK; + const SvxFontItem& rFontItem = static_cast<const SvxFontItem&>(rSdrObjCustomShape.GetMergedItem( nFntItm )); + vcl::Font aFont; + + aFont.SetFontHeight( rFWData.nSingleLineHeight ); + + aFont.SetAlignment( ALIGN_TOP ); + + aFont.SetFamilyName( rFontItem.GetFamilyName() ); + aFont.SetFamily( rFontItem.GetFamily() ); + aFont.SetStyleName( rFontItem.GetStyleName() ); + aFont.SetOrientation( 0_deg10 ); + + const SvxPostureItem& rPostureItem = rSdrObjCustomShape.GetMergedItem( EE_CHAR_ITALIC ); + aFont.SetItalic( rPostureItem.GetPosture() ); + + const SvxWeightItem& rWeightItem = rSdrObjCustomShape.GetMergedItem( EE_CHAR_WEIGHT ); + aFont.SetWeight( rWeightItem.GetWeight() ); + + // initializing virtual device + ScopedVclPtrInstance< VirtualDevice > pVirDev(DeviceFormat::DEFAULT); + pVirDev->SetMapMode(MapMode(MapUnit::Map100thMM)); + pVirDev->SetFont( aFont ); + pVirDev->EnableRTL(); + if ( rParagraph.nFrameDirection == SvxFrameDirection::Horizontal_RL_TB ) + pVirDev->SetLayoutMode( vcl::text::ComplexTextLayoutFlags::BiDiRtl ); + + const SvxCharScaleWidthItem& rCharScaleWidthItem = rSdrObjCustomShape.GetMergedItem( EE_CHAR_FONTWIDTH ); + sal_uInt16 nCharScaleWidth = rCharScaleWidthItem.GetValue(); + sal_Int32 nWidth = 0; + + // VERTICAL + if ( bIsVertical ) + { + // vertical _> each single character needs to be rotated by 90 + sal_Int32 i; + sal_Int32 nHeight = 0; + tools::Rectangle aSingleCharacterUnion; + for ( i = 0; i < rText.getLength(); i++ ) + { + FWCharacterData aCharacterData; + OUString aCharText( rText[ i ] ); + if ( pVirDev->GetTextOutlines( aCharacterData.vOutlines, aCharText, 0, 0, -1, nWidth, {} ) ) + { + sal_Int32 nTextWidth = pVirDev->GetTextWidth( aCharText); + if ( aCharacterData.vOutlines.empty() ) + { + nHeight += rFWData.nSingleLineHeight; + } + else + { + for ( auto& rOutline : aCharacterData.vOutlines ) + { + // rotating + rOutline.Rotate( Point( nTextWidth / 2, rFWData.nSingleLineHeight / 2 ), 900_deg10 ); + aCharacterData.aBoundRect.Union( rOutline.GetBoundRect() ); + } + for ( auto& rOutline : aCharacterData.vOutlines ) + { + sal_Int32 nM = - aCharacterData.aBoundRect.Left() + nHeight; + rOutline.Move( nM, 0 ); + aCharacterData.aBoundRect.Move( nM, 0 ); + } + nHeight += aCharacterData.aBoundRect.GetWidth() + ( rFWData.nSingleLineHeight / 5 ); + aSingleCharacterUnion.Union( aCharacterData.aBoundRect ); + } + } + rParagraph.vCharacters.push_back( aCharacterData ); + } + for ( auto& rCharacter : rParagraph.vCharacters ) + { + for ( auto& rOutline : rCharacter.vOutlines ) + { + rOutline.Move( ( aSingleCharacterUnion.GetWidth() - rCharacter.aBoundRect.GetWidth() ) / 2, 0 ); + } + } + } + else + { + std::vector<sal_Int32> aDXArry; + if ( ( nCharScaleWidth != 100 ) && nCharScaleWidth ) + { // applying character spacing + pVirDev->GetTextArray( rText, &aDXArry); + FontMetric aFontMetric( pVirDev->GetFontMetric() ); + aFont.SetAverageFontWidth( static_cast<sal_Int32>( static_cast<double>(aFontMetric.GetAverageFontWidth()) * ( double(100) / static_cast<double>(nCharScaleWidth) ) ) ); + pVirDev->SetFont( aFont ); + } + FWCharacterData aCharacterData; + if ( pVirDev->GetTextOutlines( aCharacterData.vOutlines, rText, 0, 0, -1, nWidth, aDXArry ) ) + { + rParagraph.vCharacters.push_back( aCharacterData ); + } + else + { + // GetTextOutlines failed what usually means that it is + // not implemented. To make FontWork not fail (it is + // dependent of graphic content to get a Range) create + // a rectangle substitution for now + pVirDev->GetTextArray( rText, &aDXArry); + aCharacterData.vOutlines.clear(); + + if(aDXArry.size()) + { + for(size_t a(0); a < aDXArry.size(); a++) + { + const basegfx::B2DPolygon aPolygon( + basegfx::utils::createPolygonFromRect( + basegfx::B2DRange( + 0 == a ? 0 : aDXArry[a - 1], + 0, + aDXArry[a], + aFont.GetFontHeight() + ))); + aCharacterData.vOutlines.push_back(tools::PolyPolygon(tools::Polygon(aPolygon))); + } + } + else + { + const basegfx::B2DPolygon aPolygon( + basegfx::utils::createPolygonFromRect( + basegfx::B2DRange( + 0, + 0, + aDXArry.empty() ? 10 : aDXArry.back(), + aFont.GetFontHeight() + ))); + aCharacterData.vOutlines.push_back(tools::PolyPolygon(tools::Polygon(aPolygon))); + } + + + rParagraph.vCharacters.push_back( aCharacterData ); + } + } + + // vertical alignment + for ( auto& rCharacter : rParagraph.vCharacters ) + { + for( tools::PolyPolygon& rPolyPoly : rCharacter.vOutlines ) + { + if ( nVerticalOffset ) + rPolyPoly.Move( 0, nVerticalOffset ); + + // retrieving the boundrect for the paragraph + tools::Rectangle aBoundRect( rPolyPoly.GetBoundRect() ); + rParagraph.aBoundRect.Union( aBoundRect ); + } + } + } + // updating the boundrect for the text area by merging the current paragraph boundrect + if ( rParagraph.aBoundRect.IsEmpty() ) + { + if ( rTextArea.aBoundRect.IsEmpty() ) + rTextArea.aBoundRect = tools::Rectangle( Point( 0, 0 ), Size( 1, rFWData.nSingleLineHeight ) ); + else + rTextArea.aBoundRect.AdjustBottom(rFWData.nSingleLineHeight ); + } + else + { + tools::Rectangle& rParagraphBoundRect = rParagraph.aBoundRect; + rTextArea.aBoundRect.Union( rParagraphBoundRect ); + + if ( bSameLetterHeights ) + { + for ( auto& rCharacter : rParagraph.vCharacters ) + { + for( auto& rOutline : rCharacter.vOutlines ) + { + tools::Rectangle aPolyPolyBoundRect( rOutline.GetBoundRect() ); + if (aPolyPolyBoundRect.GetHeight() != rParagraphBoundRect.GetHeight() && aPolyPolyBoundRect.GetHeight()) + rOutline.Scale( 1.0, static_cast<double>(rParagraphBoundRect.GetHeight()) / aPolyPolyBoundRect.GetHeight() ); + aPolyPolyBoundRect = rOutline.GetBoundRect(); + sal_Int32 nMove = aPolyPolyBoundRect.Top() - rParagraphBoundRect.Top(); + if ( nMove ) + rOutline.Move( 0, -nMove ); + } + } + } + } + if ( bIsVertical ) + nVerticalOffset -= rFWData.nSingleLineHeight; + else + nVerticalOffset += rFWData.nSingleLineHeight; + } +} + +static bool GetFontWorkOutline( + FWData& rFWData, + const SdrObjCustomShape& rSdrObjCustomShape) +{ + SdrTextHorzAdjust eHorzAdjust(rSdrObjCustomShape.GetMergedItem( SDRATTR_TEXT_HORZADJUST ).GetValue()); + drawing::TextFitToSizeType const eFTS(rSdrObjCustomShape.GetMergedItem( SDRATTR_TEXT_FITTOSIZE ).GetValue()); + + bool bSameLetterHeights = false; + const SdrCustomShapeGeometryItem& rGeometryItem(rSdrObjCustomShape.GetMergedItem( SDRATTR_CUSTOMSHAPE_GEOMETRY )); + const css::uno::Any* pAny = rGeometryItem.GetPropertyValueByName( "TextPath", "SameLetterHeights" ); + if ( pAny ) + *pAny >>= bSameLetterHeights; + + const SvxFontHeightItem& rFontHeight( rSdrObjCustomShape.GetMergedItem( EE_CHAR_FONTHEIGHT ) ); + if (rFWData.bScaleX) + rFWData.nSingleLineHeight = rFWData.fVerticalTextScaling * rFontHeight.GetHeight(); + else + rFWData.nSingleLineHeight = static_cast<sal_Int32>( ( static_cast<double>( rSdrObjCustomShape.GetLogicRect().GetHeight() ) + / rFWData.nMaxParagraphsPerTextArea ) * rFWData.fHorizontalTextScaling ); + + if (rFWData.nSingleLineHeight == SAL_MIN_INT32) + return false; + + for ( auto& rTextArea : rFWData.vTextAreas ) + { + GetTextAreaOutline( + rFWData, + rSdrObjCustomShape, + rTextArea, + bSameLetterHeights); + + if (eFTS == drawing::TextFitToSizeType_ALLLINES || + // tdf#97630 interpret PROPORTIONAL same as ALLLINES so we don't + // need another ODF attribute! + eFTS == drawing::TextFitToSizeType_PROPORTIONAL) + { + for ( auto& rParagraph : rTextArea.vParagraphs ) + { + sal_Int32 nParaWidth = rParagraph.aBoundRect.GetWidth(); + if ( nParaWidth ) + { + double fScale = static_cast<double>(rTextArea.aBoundRect.GetWidth()) / nParaWidth; + + for ( auto& rCharacter : rParagraph.vCharacters ) + { + for( auto& rOutline : rCharacter.vOutlines ) + { + rOutline.Scale( fScale, 1.0 ); + } + } + } + } + } + else if (rFWData.bScaleX) + { + const SdrTextVertAdjust nVertJustify = rSdrObjCustomShape.GetMergedItem( SDRATTR_TEXT_VERTADJUST ).GetValue(); + double fFactor = nVertJustify == SdrTextVertAdjust::SDRTEXTVERTADJUST_BOTTOM ? -0.5 : ( nVertJustify == SdrTextVertAdjust::SDRTEXTVERTADJUST_TOP ? 0.5 : 0 ); + + for ( auto& rParagraph : rTextArea.vParagraphs ) + { + sal_Int32 nHorzDiff = 0; + sal_Int32 nVertDiff = static_cast<double>( rFWData.nSingleLineHeight ) * fFactor * ( rTextArea.vParagraphs.size() - 1 ); + + if ( eHorzAdjust == SDRTEXTHORZADJUST_CENTER ) + nHorzDiff = ( rFWData.fHorizontalTextScaling * rTextArea.aBoundRect.GetWidth() - rParagraph.aBoundRect.GetWidth() ) / 2; + else if ( eHorzAdjust == SDRTEXTHORZADJUST_RIGHT ) + nHorzDiff = ( rFWData.fHorizontalTextScaling * rTextArea.aBoundRect.GetWidth() - rParagraph.aBoundRect.GetWidth() ); + + if (nHorzDiff || nVertDiff) + { + for ( auto& rCharacter : rParagraph.vCharacters ) + { + for( auto& rOutline : rCharacter.vOutlines ) + { + rOutline.Move( nHorzDiff, nVertDiff ); + } + } + } + } + } + else + { + switch( eHorzAdjust ) + { + case SDRTEXTHORZADJUST_RIGHT : + case SDRTEXTHORZADJUST_CENTER: + { + for ( auto& rParagraph : rTextArea.vParagraphs ) + { + sal_Int32 nHorzDiff = 0; + if ( eHorzAdjust == SDRTEXTHORZADJUST_CENTER ) + nHorzDiff = ( rTextArea.aBoundRect.GetWidth() - rParagraph.aBoundRect.GetWidth() ) / 2; + else if ( eHorzAdjust == SDRTEXTHORZADJUST_RIGHT ) + nHorzDiff = ( rTextArea.aBoundRect.GetWidth() - rParagraph.aBoundRect.GetWidth() ); + if ( nHorzDiff ) + { + for ( auto& rCharacter : rParagraph.vCharacters ) + { + for( auto& rOutline : rCharacter.vOutlines ) + { + rOutline.Move( nHorzDiff, 0 ); + } + } + } + } + } + break; + default: + case SDRTEXTHORZADJUST_BLOCK : break; // don't know + case SDRTEXTHORZADJUST_LEFT : break; // already left aligned -> nothing to do + } + } + } + + return true; +} + +static basegfx::B2DPolyPolygon GetOutlinesFromShape2d( const SdrObject* pShape2d ) +{ + basegfx::B2DPolyPolygon aOutlines2d; + + SdrObjListIter aObjListIter( *pShape2d, SdrIterMode::DeepWithGroups ); + while( aObjListIter.IsMore() ) + { + SdrObject* pPartObj = aObjListIter.Next(); + if ( auto pPathObj = dynamic_cast<const SdrPathObj*>( pPartObj)) + { + basegfx::B2DPolyPolygon aCandidate(pPathObj->GetPathPoly()); + if(aCandidate.areControlPointsUsed()) + { + aCandidate = basegfx::utils::adaptiveSubdivideByAngle(aCandidate); + } + aOutlines2d.append(aCandidate); + } + } + + return aOutlines2d; +} + +static void CalcDistances( const tools::Polygon& rPoly, std::vector< double >& rDistances ) +{ + sal_uInt16 i, nCount = rPoly.GetSize(); + if ( nCount <= 1 ) + return; + + for ( i = 0; i < nCount; i++ ) + { + double fDistance = i ? rPoly.CalcDistance( i, i - 1 ) : 0.0; + rDistances.push_back( fDistance ); + } + std::partial_sum( rDistances.begin(), rDistances.end(), rDistances.begin() ); + double fLength = rDistances[ rDistances.size() - 1 ]; + if ( fLength > 0.0 ) + { + for ( auto& rDistance : rDistances ) + rDistance /= fLength; + } +} + +static void InsertMissingOutlinePoints( const std::vector< double >& rDistances, + const tools::Rectangle& rTextAreaBoundRect, tools::Polygon& rPoly ) +{ + sal_uInt16 nSize = rPoly.GetSize(); + if (nSize == 0) + return; + + tools::Long nTextWidth = rTextAreaBoundRect.GetWidth(); + + if (nTextWidth == 0) + throw o3tl::divide_by_zero(); + + double fLastDistance = 0.0; + for (sal_uInt16 i = 0; i < nSize; ++i) + { + Point& rPoint = rPoly[ i ]; + double fDistance = static_cast<double>( rPoint.X() - rTextAreaBoundRect.Left() ) / static_cast<double>(nTextWidth); + if ( i ) + { + if ( fDistance > fLastDistance ) + { + std::vector< double >::const_iterator aIter = std::upper_bound( rDistances.begin(), rDistances.end(), fLastDistance ); + if ( aIter != rDistances.end() && ( *aIter > fLastDistance ) && ( *aIter < fDistance ) ) + { + Point& rPt0 = rPoly[ i - 1 ]; + sal_Int32 fX = rPoint.X() - rPt0.X(); + sal_Int32 fY = rPoint.Y() - rPt0.Y(); + double fd = ( 1.0 / ( fDistance - fLastDistance ) ) * ( *aIter - fLastDistance ); + rPoly.Insert( i, Point( static_cast<sal_Int32>( rPt0.X() + fX * fd ), static_cast<sal_Int32>( rPt0.Y() + fY * fd ) ) ); + fDistance = *aIter; + } + } + else if ( fDistance < fLastDistance ) + { + std::vector< double >::const_iterator aIter = std::lower_bound( rDistances.begin(), rDistances.end(), fLastDistance ); + if ( aIter != rDistances.begin() ) + { + --aIter; + if ( ( *aIter > fDistance ) && ( *aIter < fLastDistance ) ) + { + Point& rPt0 = rPoly[ i - 1 ]; + sal_Int32 fX = rPoint.X() - rPt0.X(); + sal_Int32 fY = rPoint.Y() - rPt0.Y(); + double fd = ( 1.0 / ( fDistance - fLastDistance ) ) * ( *aIter - fLastDistance ); + rPoly.Insert( i, Point( static_cast<sal_Int32>( rPt0.X() + fX * fd ), static_cast<sal_Int32>( rPt0.Y() + fY * fd ) ) ); + fDistance = *aIter; + } + } + } + } + fLastDistance = fDistance; + } +} + +static void GetPoint( const tools::Polygon& rPoly, const std::vector< double >& rDistances, const double& fX, double& fx1, double& fy1 ) +{ + fy1 = fx1 = 0.0; + if ( rPoly.GetSize() <= 1 ) + return; + + std::vector< double >::const_iterator aIter = std::lower_bound( rDistances.begin(), rDistances.end(), fX ); + sal_uInt16 nIdx = sal::static_int_cast<sal_uInt16>( std::distance( rDistances.begin(), aIter ) ); + if ( aIter == rDistances.end() ) + nIdx--; + const Point& rPt = rPoly[ nIdx ]; + fx1 = rPt.X(); + fy1 = rPt.Y(); + if ( !nIdx || ( aIter == rDistances.end() ) || rtl::math::approxEqual( *aIter, fX ) ) + return; + + nIdx = sal::static_int_cast<sal_uInt16>( std::distance( rDistances.begin(), aIter ) ); + double fDist0 = *( aIter - 1 ); + double fd = ( 1.0 / ( *aIter - fDist0 ) ) * ( fX - fDist0 ); + const Point& rPt2 = rPoly[ nIdx - 1 ]; + double fWidth = rPt.X() - rPt2.X(); + double fHeight= rPt.Y() - rPt2.Y(); + fWidth *= fd; + fHeight*= fd; + fx1 = rPt2.X() + fWidth; + fy1 = rPt2.Y() + fHeight; +} + +static void FitTextOutlinesToShapeOutlines( const tools::PolyPolygon& aOutlines2d, FWData& rFWData ) +{ + sal_uInt16 nOutline2dIdx = 0; + for( auto& rTextArea : rFWData.vTextAreas ) + { + tools::Rectangle rTextAreaBoundRect = rTextArea.aBoundRect; + sal_Int32 nLeft = rTextAreaBoundRect.Left(); + sal_Int32 nTop = rTextAreaBoundRect.Top(); + sal_Int32 nWidth = rTextAreaBoundRect.GetWidth(); + sal_Int32 nHeight= rTextAreaBoundRect.GetHeight(); + + if (rFWData.bScaleX) + { + nWidth *= rFWData.fHorizontalTextScaling; + } + + if ( rFWData.bSingleLineMode && nHeight && nWidth ) + { + if ( nOutline2dIdx >= aOutlines2d.Count() ) + break; + const tools::Polygon& rOutlinePoly( aOutlines2d[ nOutline2dIdx++ ] ); + const sal_uInt16 nPointCount = rOutlinePoly.GetSize(); + if ( nPointCount > 1 ) + { + std::vector< double > vDistances; + vDistances.reserve( nPointCount ); + CalcDistances( rOutlinePoly, vDistances ); + if ( !vDistances.empty() ) + { + for( auto& rParagraph : rTextArea.vParagraphs ) + { + for ( auto& rCharacter : rParagraph.vCharacters ) + { + for( tools::PolyPolygon& rPolyPoly : rCharacter.vOutlines ) + { + tools::Rectangle aBoundRect( rPolyPoly.GetBoundRect() ); + double fx1 = aBoundRect.Left() - nLeft; + double fx2 = aBoundRect.Right() - nLeft; + double fy1, fy2; + double fM1 = fx1 / static_cast<double>(nWidth); + double fM2 = fx2 / static_cast<double>(nWidth); + + GetPoint( rOutlinePoly, vDistances, fM1, fx1, fy1 ); + GetPoint( rOutlinePoly, vDistances, fM2, fx2, fy2 ); + + double fvx = fy2 - fy1; + double fvy = - ( fx2 - fx1 ); + fx1 = fx1 + ( ( fx2 - fx1 ) * 0.5 ); + fy1 = fy1 + ( ( fy2 - fy1 ) * 0.5 ); + + double fAngle = atan2( -fvx, -fvy ); + double fL = hypot( fvx, fvy ); + if (fL == 0.0) + { + SAL_WARN("svx", "FitTextOutlinesToShapeOutlines div-by-zero, abandon fit"); + break; + } + fvx = fvx / fL; + fvy = fvy / fL; + fL = rTextArea.aBoundRect.GetHeight() / 2.0 + rTextArea.aBoundRect.Top() - rParagraph.aBoundRect.Center().Y(); + fvx *= fL; + fvy *= fL; + rPolyPoly.Rotate( Point( aBoundRect.Center().X(), rParagraph.aBoundRect.Center().Y() ), sin( fAngle ), cos( fAngle ) ); + rPolyPoly.Move( static_cast<sal_Int32>( ( fx1 + fvx )- aBoundRect.Center().X() ), static_cast<sal_Int32>( ( fy1 + fvy ) - rParagraph.aBoundRect.Center().Y() ) ); + } + } + } + } + } + } + else + { + if ( ( nOutline2dIdx + 1 ) >= aOutlines2d.Count() ) + break; + const tools::Polygon& rOutlinePoly( aOutlines2d[ nOutline2dIdx++ ] ); + const tools::Polygon& rOutlinePoly2( aOutlines2d[ nOutline2dIdx++ ] ); + const sal_uInt16 nPointCount = rOutlinePoly.GetSize(); + const sal_uInt16 nPointCount2 = rOutlinePoly2.GetSize(); + if ( ( nPointCount > 1 ) && ( nPointCount2 > 1 ) ) + { + std::vector< double > vDistances; + vDistances.reserve( nPointCount ); + std::vector< double > vDistances2; + vDistances2.reserve( nPointCount2 ); + CalcDistances( rOutlinePoly, vDistances ); + CalcDistances( rOutlinePoly2, vDistances2 ); + for( auto& rParagraph : rTextArea.vParagraphs ) + { + for ( auto& rCharacter : rParagraph.vCharacters ) + { + for( tools::PolyPolygon& rPolyPoly : rCharacter.vOutlines ) + { + sal_uInt16 i, nPolyCount = rPolyPoly.Count(); + for ( i = 0; i < nPolyCount; i++ ) + { + // #i35928# + basegfx::B2DPolygon aCandidate(rPolyPoly[ i ].getB2DPolygon()); + + if(aCandidate.areControlPointsUsed()) + { + aCandidate = basegfx::utils::adaptiveSubdivideByAngle(aCandidate); + } + + // create local polygon copy to work on + tools::Polygon aLocalPoly(aCandidate); + + InsertMissingOutlinePoints( vDistances, rTextAreaBoundRect, aLocalPoly ); + InsertMissingOutlinePoints( vDistances2, rTextAreaBoundRect, aLocalPoly ); + + sal_uInt16 _nPointCount = aLocalPoly.GetSize(); + if (_nPointCount) + { + if (!nWidth || !nHeight) + throw o3tl::divide_by_zero(); + for (sal_uInt16 j = 0; j < _nPointCount; ++j) + { + Point& rPoint = aLocalPoly[ j ]; + rPoint.AdjustX( -nLeft ); + rPoint.AdjustY( -nTop ); + double fX = static_cast<double>(rPoint.X()) / static_cast<double>(nWidth); + double fY = static_cast<double>(rPoint.Y()) / static_cast<double>(nHeight); + + double fx1, fy1, fx2, fy2; + GetPoint( rOutlinePoly, vDistances, fX, fx1, fy1 ); + GetPoint( rOutlinePoly2, vDistances2, fX, fx2, fy2 ); + double fWidth = fx2 - fx1; + double fHeight= fy2 - fy1; + rPoint.setX( static_cast<sal_Int32>( fx1 + fWidth * fY ) ); + rPoint.setY( static_cast<sal_Int32>( fy1 + fHeight* fY ) ); + } + } + + // write back polygon + rPolyPoly[ i ] = aLocalPoly; + } + } + } + } + } + } + } +} + +static SdrObject* CreateSdrObjectFromParagraphOutlines( + const FWData& rFWData, + const SdrObjCustomShape& rSdrObjCustomShape) +{ + SdrObject* pRet = nullptr; + basegfx::B2DPolyPolygon aPolyPoly; + if ( !rFWData.vTextAreas.empty() ) + { + for ( const auto& rTextArea : rFWData.vTextAreas ) + { + for ( const auto& rParagraph : rTextArea.vParagraphs ) + { + for ( const auto& rCharacter : rParagraph.vCharacters ) + { + for( const auto& rOutline : rCharacter.vOutlines ) + { + aPolyPoly.append( rOutline.getB2DPolyPolygon() ); + } + } + } + } + + pRet = new SdrPathObj( + rSdrObjCustomShape.getSdrModelFromSdrObject(), + SdrObjKind::Polygon, + aPolyPoly); + + SfxItemSet aSet(rSdrObjCustomShape.GetMergedItemSet()); + aSet.ClearItem( SDRATTR_TEXTDIRECTION ); //SJ: vertical writing is not required, by removing this item no outliner is created + aSet.Put(makeSdrShadowItem(false)); // #i37011# NO shadow for FontWork geometry + pRet->SetMergedItemSet( aSet ); // * otherwise we would crash, because the outliner tries to create a Paraobject, but there is no model + } + + return pRet; +} + +Reference < i18n::XBreakIterator > EnhancedCustomShapeFontWork::mxBreakIterator; + +Reference < i18n::XBreakIterator > const & EnhancedCustomShapeFontWork::GetBreakIterator() +{ + if ( !mxBreakIterator.is() ) + { + Reference< uno::XComponentContext > xContext = ::comphelper::getProcessComponentContext(); + mxBreakIterator = i18n::BreakIterator::create(xContext); + } + return mxBreakIterator; +} + +SdrObject* EnhancedCustomShapeFontWork::CreateFontWork( + const SdrObject* pShape2d, + const SdrObjCustomShape& rSdrObjCustomShape) +{ + SdrObject* pRet = nullptr; + + tools::PolyPolygon aOutlines2d( GetOutlinesFromShape2d( pShape2d ) ); + sal_uInt16 nOutlinesCount2d = aOutlines2d.Count(); + if ( nOutlinesCount2d ) + { + FWData aFWData; + + if(InitializeFontWorkData(rSdrObjCustomShape, nOutlinesCount2d, aFWData)) + { + /* retrieves the horizontal scaling factor that has to be used + to fit each paragraph text into its corresponding 2d outline */ + CalculateHorizontalScalingFactor( + rSdrObjCustomShape, + aFWData, + aOutlines2d); + + /* retrieving the Outlines for the each Paragraph. */ + if(!GetFontWorkOutline( + aFWData, + rSdrObjCustomShape)) + { + return nullptr; + } + + FitTextOutlinesToShapeOutlines( aOutlines2d, aFWData ); + + pRet = CreateSdrObjectFromParagraphOutlines( + aFWData, + rSdrObjCustomShape); + } + } + return pRet; +} + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svx/source/customshapes/EnhancedCustomShapeFontWork.hxx b/svx/source/customshapes/EnhancedCustomShapeFontWork.hxx new file mode 100644 index 000000000..335701be4 --- /dev/null +++ b/svx/source/customshapes/EnhancedCustomShapeFontWork.hxx @@ -0,0 +1,42 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#ifndef INCLUDED_SVX_SOURCE_CUSTOMSHAPES_ENHANCEDCUSTOMSHAPEFONTWORK_HXX +#define INCLUDED_SVX_SOURCE_CUSTOMSHAPES_ENHANCEDCUSTOMSHAPEFONTWORK_HXX + +#include <com/sun/star/i18n/XBreakIterator.hpp> + +class SdrObject; +class SdrObjCustomShape; + +class EnhancedCustomShapeFontWork +{ + static css::uno::Reference < css::i18n::XBreakIterator > mxBreakIterator; + + public: + + static css::uno::Reference < css::i18n::XBreakIterator > const & GetBreakIterator(); + static SdrObject* CreateFontWork( + const SdrObject* pShape2d, + const SdrObjCustomShape& rSdrObjCustomShape); +}; + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svx/source/customshapes/EnhancedCustomShapeFunctionParser.cxx b/svx/source/customshapes/EnhancedCustomShapeFunctionParser.cxx new file mode 100644 index 000000000..f7aa223f4 --- /dev/null +++ b/svx/source/customshapes/EnhancedCustomShapeFunctionParser.cxx @@ -0,0 +1,1164 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#include <sal/config.h> + +#include <svx/EnhancedCustomShape2d.hxx> +#include <rtl/ustring.hxx> +#include <sal/log.hxx> +#include <tools/fract.hxx> + +#include <com/sun/star/drawing/EnhancedCustomShapeParameterType.hpp> + +// Makes parser a static resource, +// we're synchronized externally. +// But watch out, the parser might have +// state not visible to this code! + +#define BOOST_SPIRIT_SINGLE_GRAMMAR_INSTANCE + +#if OSL_DEBUG_LEVEL >= 2 && defined(DBG_UTIL) +#define BOOST_SPIRIT_DEBUG +#endif +#include <boost/spirit/include/classic_core.hpp> + +#include <functional> +#include <algorithm> +#include <stack> + +#include <math.h> +using namespace EnhancedCustomShape; +using namespace com::sun::star; +using namespace com::sun::star::drawing; + +void EnhancedCustomShape::FillEquationParameter( const EnhancedCustomShapeParameter& rSource, const sal_Int32 nDestPara, EnhancedCustomShapeEquation& rDest ) +{ + sal_Int32 nValue = 0; + if ( rSource.Value.getValueTypeClass() == uno::TypeClass_DOUBLE ) + { + double fValue(0.0); + if ( rSource.Value >>= fValue ) + nValue = static_cast<sal_Int32>(fValue); + } + else + rSource.Value >>= nValue; + + switch( rSource.Type ) + { + case css::drawing::EnhancedCustomShapeParameterType::EQUATION : + { + if ( nValue & 0x40000000 ) + { + nValue ^= 0x40000000; + rDest.nOperation |= 0x20000000 << nDestPara; // the bit is indicating that this value has to be adjusted later + } + nValue |= 0x400; + } + break; + case css::drawing::EnhancedCustomShapeParameterType::ADJUSTMENT : nValue += DFF_Prop_adjustValue; break; + case css::drawing::EnhancedCustomShapeParameterType::BOTTOM : nValue = DFF_Prop_geoBottom; break; + case css::drawing::EnhancedCustomShapeParameterType::RIGHT : nValue = DFF_Prop_geoRight; break; + case css::drawing::EnhancedCustomShapeParameterType::TOP : nValue = DFF_Prop_geoTop; break; + case css::drawing::EnhancedCustomShapeParameterType::LEFT : nValue = DFF_Prop_geoLeft; break; + } + if ( rSource.Type != css::drawing::EnhancedCustomShapeParameterType::NORMAL ) + rDest.nOperation |= ( 0x2000 << nDestPara ); + rDest.nPara[ nDestPara ] = nValue; +} + +ExpressionNode::~ExpressionNode() +{} + +namespace +{ + + +// EXPRESSION NODES + + +class ConstantValueExpression : public ExpressionNode +{ + double maValue; + +public: + + explicit ConstantValueExpression( double rValue ) : + maValue( rValue ) + { + } + virtual double operator()() const override + { + return maValue; + } + virtual bool isConstant() const override + { + return true; + } + virtual ExpressionFunct getType() const override + { + return ExpressionFunct::Const; + } + virtual EnhancedCustomShapeParameter fillNode( std::vector< EnhancedCustomShapeEquation >& rEquations, ExpressionNode* /* pOptionalArg */, sal_uInt32 /* nFlags */ ) override + { + EnhancedCustomShapeParameter aRet; + Fraction aFract( maValue ); + if ( aFract.GetDenominator() == 1 ) + { + aRet.Type = EnhancedCustomShapeParameterType::NORMAL; + aRet.Value <<= aFract.GetNumerator(); + } + else + { + EnhancedCustomShapeEquation aEquation; + aEquation.nOperation = 1; + aEquation.nPara[ 0 ] = 1; + aEquation.nPara[ 1 ] = static_cast<sal_Int16>(aFract.GetNumerator()); + aEquation.nPara[ 2 ] = static_cast<sal_Int16>(aFract.GetDenominator()); + aRet.Type = EnhancedCustomShapeParameterType::EQUATION; + aRet.Value <<= static_cast<sal_Int32>(rEquations.size()); + rEquations.push_back( aEquation ); + } + return aRet; + } +}; + +class AdjustmentExpression : public ExpressionNode +{ + sal_Int32 mnIndex; + const EnhancedCustomShape2d& mrCustoShape; + +public: + + AdjustmentExpression( const EnhancedCustomShape2d& rCustoShape, sal_Int32 nIndex ) + : mnIndex ( nIndex ) + , mrCustoShape( rCustoShape ) + + { + } + virtual double operator()() const override + { + SAL_INFO( + "svx", + "$" << mnIndex << " --> " + << mrCustoShape.GetAdjustValueAsDouble(mnIndex) << " (angle: " + << 180.0*mrCustoShape.GetAdjustValueAsDouble(mnIndex)/10800000.0 + << ")"); + return mrCustoShape.GetAdjustValueAsDouble( mnIndex ); + } + virtual bool isConstant() const override + { + return false; + } + virtual ExpressionFunct getType() const override + { + return ExpressionFunct::EnumAdjustment; + } + virtual EnhancedCustomShapeParameter fillNode( std::vector< EnhancedCustomShapeEquation >& /*rEquations*/, ExpressionNode* /*pOptionalArg*/, sal_uInt32 /*nFlags*/ ) override + { + EnhancedCustomShapeParameter aRet; + aRet.Type = EnhancedCustomShapeParameterType::ADJUSTMENT; + aRet.Value <<= mnIndex; + return aRet; + } +}; + +class EquationExpression : public ExpressionNode +{ + const sal_Int32 mnIndex; + const EnhancedCustomShape2d& mrCustoShape; + mutable bool mbGettingValueGuard; + +public: + + EquationExpression( const EnhancedCustomShape2d& rCustoShape, sal_Int32 nIndex ) + : mnIndex ( nIndex ) + , mrCustoShape( rCustoShape ) + , mbGettingValueGuard(false) + { + } + virtual double operator()() const override + { + if (mbGettingValueGuard) + throw ParseError("Loop in Expression"); + mbGettingValueGuard = true; + double fRet = mrCustoShape.GetEquationValueAsDouble(mnIndex); + mbGettingValueGuard = false; + return fRet; + } + virtual bool isConstant() const override + { + return false; + } + virtual ExpressionFunct getType() const override + { + return ExpressionFunct::EnumEquation; + } + virtual EnhancedCustomShapeParameter fillNode( std::vector< EnhancedCustomShapeEquation >& /*rEquations*/, ExpressionNode* /*pOptionalArg*/, sal_uInt32 /*nFlags*/ ) override + { + EnhancedCustomShapeParameter aRet; + aRet.Type = EnhancedCustomShapeParameterType::EQUATION; + aRet.Value <<= mnIndex | 0x40000000; // the bit is indicating that this equation needs to be adjusted later + return aRet; + } +}; + +class EnumValueExpression : public ExpressionNode +{ + const ExpressionFunct meFunct; + const EnhancedCustomShape2d& mrCustoShape; + +public: + + EnumValueExpression( const EnhancedCustomShape2d& rCustoShape, const ExpressionFunct eFunct ) + : meFunct ( eFunct ) + , mrCustoShape ( rCustoShape ) + { + } + virtual double operator()() const override + { + SAL_INFO("svx", meFunct << " --> " << mrCustoShape.GetEnumFunc(meFunct) << "(angle: " << + 180.0 * mrCustoShape.GetEnumFunc(meFunct) / 10800000.0 << ")"); + + return mrCustoShape.GetEnumFunc( meFunct ); + } + virtual bool isConstant() const override + { + return false; + } + virtual ExpressionFunct getType() const override + { + return meFunct; + } + virtual EnhancedCustomShapeParameter fillNode( std::vector< EnhancedCustomShapeEquation >& rEquations, ExpressionNode* /*pOptionalArg*/, sal_uInt32 nFlags ) override + { + EnhancedCustomShapeParameter aRet; + + aRet.Value <<= sal_Int32(1); + + switch( meFunct ) + { + case ExpressionFunct::EnumWidth : // TODO: do not use this as constant value + case ExpressionFunct::EnumHeight : + case ExpressionFunct::EnumLogWidth : + case ExpressionFunct::EnumLogHeight : + case ExpressionFunct::EnumPi : + { + ConstantValueExpression aConstantValue( mrCustoShape.GetEnumFunc( meFunct ) ); + aRet = aConstantValue.fillNode( rEquations, nullptr, nFlags ); + } + break; + case ExpressionFunct::EnumLeft : aRet.Type = EnhancedCustomShapeParameterType::LEFT; break; + case ExpressionFunct::EnumTop : aRet.Type = EnhancedCustomShapeParameterType::TOP; break; + case ExpressionFunct::EnumRight : aRet.Type = EnhancedCustomShapeParameterType::RIGHT; break; + case ExpressionFunct::EnumBottom : aRet.Type = EnhancedCustomShapeParameterType::BOTTOM; break; + + // not implemented so far + case ExpressionFunct::EnumXStretch : + case ExpressionFunct::EnumYStretch : + case ExpressionFunct::EnumHasStroke : + case ExpressionFunct::EnumHasFill : aRet.Type = EnhancedCustomShapeParameterType::NORMAL; break; + + default: + break; + } + return aRet; + } +}; + +/** ExpressionNode implementation for unary + function over one ExpressionNode + */ +class UnaryFunctionExpression : public ExpressionNode +{ + const ExpressionFunct meFunct; + std::shared_ptr<ExpressionNode> mpArg; + +public: + UnaryFunctionExpression( const ExpressionFunct eFunct, const std::shared_ptr<ExpressionNode>& rArg ) : + meFunct( eFunct ), + mpArg( rArg ) + { + } + static double getValue( const ExpressionFunct eFunct, const std::shared_ptr<ExpressionNode>& rArg ) + { + double fRet = 0; + switch( eFunct ) + { + case ExpressionFunct::UnaryAbs : fRet = fabs( (*rArg)() ); break; + case ExpressionFunct::UnarySqrt: fRet = sqrt( (*rArg)() ); break; + case ExpressionFunct::UnarySin : fRet = sin( (*rArg)() ); break; + case ExpressionFunct::UnaryCos : fRet = cos( (*rArg)() ); break; + case ExpressionFunct::UnaryTan : fRet = tan( (*rArg)() ); break; + case ExpressionFunct::UnaryAtan: fRet = atan( (*rArg)() ); break; + case ExpressionFunct::UnaryNeg : fRet = ::std::negate<double>()( (*rArg)() ); break; + default: + break; + } + return fRet; + } + virtual double operator()() const override + { + return getValue( meFunct, mpArg ); + } + virtual bool isConstant() const override + { + return mpArg->isConstant(); + } + virtual ExpressionFunct getType() const override + { + return meFunct; + } + virtual EnhancedCustomShapeParameter fillNode( std::vector< EnhancedCustomShapeEquation >& rEquations, ExpressionNode* pOptionalArg, sal_uInt32 nFlags ) override + { + EnhancedCustomShapeParameter aRet; + switch( meFunct ) + { + case ExpressionFunct::UnaryAbs : + { + EnhancedCustomShapeEquation aEquation; + aEquation.nOperation |= 3; + FillEquationParameter( mpArg->fillNode( rEquations, nullptr, nFlags ), 0, aEquation ); + aRet.Type = EnhancedCustomShapeParameterType::EQUATION; + aRet.Value <<= static_cast<sal_Int32>(rEquations.size()); + rEquations.push_back( aEquation ); + } + break; + case ExpressionFunct::UnarySqrt: + { + EnhancedCustomShapeEquation aEquation; + aEquation.nOperation |= 13; + FillEquationParameter( mpArg->fillNode( rEquations, nullptr, nFlags ), 0, aEquation ); + aRet.Type = EnhancedCustomShapeParameterType::EQUATION; + aRet.Value <<= static_cast<sal_Int32>(rEquations.size()); + rEquations.push_back( aEquation ); + } + break; + case ExpressionFunct::UnarySin : + { + EnhancedCustomShapeEquation aEquation; + aEquation.nOperation |= 9; + if ( pOptionalArg ) + FillEquationParameter( pOptionalArg->fillNode( rEquations, nullptr, nFlags ), 0, aEquation ); + else + aEquation.nPara[ 0 ] = 1; + + EnhancedCustomShapeParameter aSource( mpArg->fillNode( rEquations, nullptr, nFlags | EXPRESSION_FLAG_SUMANGLE_MODE ) ); + if ( aSource.Type == EnhancedCustomShapeParameterType::NORMAL ) + { // sumangle needed :-( + EnhancedCustomShapeEquation _aEquation; + _aEquation.nOperation |= 0xe; // sumangle + FillEquationParameter( aSource, 1, _aEquation ); + aSource.Type = EnhancedCustomShapeParameterType::EQUATION; + aSource.Value <<= static_cast<sal_Int32>(rEquations.size()); + rEquations.push_back( _aEquation ); + } + FillEquationParameter( aSource, 1, aEquation ); + aRet.Type = EnhancedCustomShapeParameterType::EQUATION; + aRet.Value <<= static_cast<sal_Int32>(rEquations.size()); + rEquations.push_back( aEquation ); + } + break; + case ExpressionFunct::UnaryCos : + { + EnhancedCustomShapeEquation aEquation; + aEquation.nOperation |= 10; + if ( pOptionalArg ) + FillEquationParameter( pOptionalArg->fillNode( rEquations, nullptr, nFlags ), 0, aEquation ); + else + aEquation.nPara[ 0 ] = 1; + + EnhancedCustomShapeParameter aSource( mpArg->fillNode( rEquations, nullptr, nFlags | EXPRESSION_FLAG_SUMANGLE_MODE ) ); + if ( aSource.Type == EnhancedCustomShapeParameterType::NORMAL ) + { // sumangle needed :-( + EnhancedCustomShapeEquation aTmpEquation; + aTmpEquation.nOperation |= 0xe; // sumangle + FillEquationParameter( aSource, 1, aTmpEquation ); + aSource.Type = EnhancedCustomShapeParameterType::EQUATION; + aSource.Value <<= static_cast<sal_Int32>(rEquations.size()); + rEquations.push_back( aTmpEquation ); + } + FillEquationParameter( aSource, 1, aEquation ); + aRet.Type = EnhancedCustomShapeParameterType::EQUATION; + aRet.Value <<= static_cast<sal_Int32>(rEquations.size()); + rEquations.push_back( aEquation ); + } + break; + case ExpressionFunct::UnaryTan : + { + EnhancedCustomShapeEquation aEquation; + aEquation.nOperation |= 16; + if ( pOptionalArg ) + FillEquationParameter( pOptionalArg->fillNode( rEquations, nullptr, nFlags ), 0, aEquation ); + else + aEquation.nPara[ 0 ] = 1; + + EnhancedCustomShapeParameter aSource( mpArg->fillNode( rEquations, nullptr, nFlags | EXPRESSION_FLAG_SUMANGLE_MODE ) ); + if ( aSource.Type == EnhancedCustomShapeParameterType::NORMAL ) + { // sumangle needed :-( + EnhancedCustomShapeEquation aTmpEquation; + aTmpEquation.nOperation |= 0xe; // sumangle + FillEquationParameter( aSource, 1, aTmpEquation ); + aSource.Type = EnhancedCustomShapeParameterType::EQUATION; + aSource.Value <<= static_cast<sal_Int32>(rEquations.size()); + rEquations.push_back( aTmpEquation ); + } + FillEquationParameter( aSource, 1, aEquation ); + aRet.Type = EnhancedCustomShapeParameterType::EQUATION; + aRet.Value <<= static_cast<sal_Int32>(rEquations.size()); + rEquations.push_back( aEquation ); + } + break; + case ExpressionFunct::UnaryAtan: + { +// TODO: + aRet.Type = EnhancedCustomShapeParameterType::NORMAL; + } + break; + case ExpressionFunct::UnaryNeg: + { + EnhancedCustomShapeEquation aEquation; + aEquation.nOperation |= 1; + aEquation.nPara[ 1 ] = -1; + aEquation.nPara[ 2 ] = 1; + FillEquationParameter( mpArg->fillNode( rEquations, nullptr, nFlags ), 0, aEquation ); + aRet.Type = EnhancedCustomShapeParameterType::EQUATION; + aRet.Value <<= static_cast<sal_Int32>(rEquations.size()); + rEquations.push_back( aEquation ); + } + break; + default: + break; + } + return aRet; + } +}; + +/** ExpressionNode implementation for unary + function over two ExpressionNodes + */ +class BinaryFunctionExpression : public ExpressionNode +{ + const ExpressionFunct meFunct; + std::shared_ptr<ExpressionNode> mpFirstArg; + std::shared_ptr<ExpressionNode> mpSecondArg; + +public: + + BinaryFunctionExpression( const ExpressionFunct eFunct, const std::shared_ptr<ExpressionNode>& rFirstArg, const std::shared_ptr<ExpressionNode>& rSecondArg ) : + meFunct( eFunct ), + mpFirstArg( rFirstArg ), + mpSecondArg( rSecondArg ) + { + } +#if defined(__clang__) || (defined (__GNUC__) && __GNUC__ >= 8) + //GetEquationValueAsDouble calls isFinite on the result + __attribute__((no_sanitize("float-divide-by-zero"))) +#endif + static double getValue( const ExpressionFunct eFunct, const std::shared_ptr<ExpressionNode>& rFirstArg, const std::shared_ptr<ExpressionNode>& rSecondArg ) + { + double fRet = 0; + switch( eFunct ) + { + case ExpressionFunct::BinaryPlus : fRet = (*rFirstArg)() + (*rSecondArg)(); break; + case ExpressionFunct::BinaryMinus: fRet = (*rFirstArg)() - (*rSecondArg)(); break; + case ExpressionFunct::BinaryMul : fRet = (*rFirstArg)() * (*rSecondArg)(); break; + case ExpressionFunct::BinaryDiv : fRet = (*rFirstArg)() / (*rSecondArg)(); break; + case ExpressionFunct::BinaryMin : fRet = ::std::min( (*rFirstArg)(), (*rSecondArg)() ); break; + case ExpressionFunct::BinaryMax : fRet = ::std::max( (*rFirstArg)(), (*rSecondArg)() ); break; + case ExpressionFunct::BinaryAtan2: fRet = atan2( (*rFirstArg)(), (*rSecondArg)() ); break; + default: + break; + } + return fRet; + } + virtual double operator()() const override + { + return getValue( meFunct, mpFirstArg, mpSecondArg ); + } + virtual bool isConstant() const override + { + return mpFirstArg->isConstant() && mpSecondArg->isConstant(); + } + virtual ExpressionFunct getType() const override + { + return meFunct; + } + virtual EnhancedCustomShapeParameter fillNode( std::vector< EnhancedCustomShapeEquation >& rEquations, ExpressionNode* /*pOptionalArg*/, sal_uInt32 nFlags ) override + { + EnhancedCustomShapeParameter aRet; + switch( meFunct ) + { + case ExpressionFunct::BinaryPlus : + { + if ( nFlags & EXPRESSION_FLAG_SUMANGLE_MODE ) + { + if ( mpFirstArg->getType() == ExpressionFunct::EnumAdjustment ) + { + EnhancedCustomShapeEquation aEquation; + aEquation.nOperation |= 0xe; // sumangle + FillEquationParameter( mpFirstArg->fillNode( rEquations, nullptr, nFlags ), 0, aEquation ); + FillEquationParameter( mpSecondArg->fillNode( rEquations, nullptr, nFlags ), 1, aEquation ); + aRet.Type = EnhancedCustomShapeParameterType::EQUATION; + aRet.Value <<= static_cast<sal_Int32>(rEquations.size()); + rEquations.push_back( aEquation ); + } + else if ( mpSecondArg->getType() == ExpressionFunct::EnumAdjustment ) + { + EnhancedCustomShapeEquation aEquation; + aEquation.nOperation |= 0xe; // sumangle + FillEquationParameter( mpSecondArg->fillNode( rEquations, nullptr, nFlags ), 0, aEquation ); + FillEquationParameter( mpFirstArg->fillNode( rEquations, nullptr, nFlags ), 1, aEquation ); + aRet.Type = EnhancedCustomShapeParameterType::EQUATION; + aRet.Value <<= static_cast<sal_Int32>(rEquations.size()); + rEquations.push_back( aEquation ); + } + else + { + EnhancedCustomShapeEquation aSumangle1; + aSumangle1.nOperation |= 0xe; // sumangle + FillEquationParameter( mpFirstArg->fillNode( rEquations, nullptr, nFlags &~EXPRESSION_FLAG_SUMANGLE_MODE ), 1, aSumangle1 ); + aRet.Type = EnhancedCustomShapeParameterType::EQUATION; + aRet.Value <<= static_cast<sal_Int32>(rEquations.size()); + rEquations.push_back( aSumangle1 ); + + EnhancedCustomShapeEquation aSumangle2; + aSumangle2.nOperation |= 0xe; // sumangle + FillEquationParameter( mpSecondArg->fillNode( rEquations, nullptr, nFlags &~EXPRESSION_FLAG_SUMANGLE_MODE ), 1, aSumangle2 ); + aRet.Type = EnhancedCustomShapeParameterType::EQUATION; + aRet.Value <<= static_cast<sal_Int32>(rEquations.size()); + rEquations.push_back( aSumangle2 ); + + EnhancedCustomShapeEquation aEquation; + aEquation.nOperation |= 0; + aEquation.nPara[ 0 ] = ( rEquations.size() - 2 ) | 0x400; + aEquation.nPara[ 1 ] = ( rEquations.size() - 1 ) | 0x400; + aRet.Type = EnhancedCustomShapeParameterType::EQUATION; + aRet.Value <<= static_cast<sal_Int32>(rEquations.size()); + rEquations.push_back( aEquation ); + } + } + else + { + bool bFirstIsEmpty = mpFirstArg->isConstant() && ( (*mpFirstArg)() == 0 ); + bool bSecondIsEmpty = mpSecondArg->isConstant() && ( (*mpSecondArg)() == 0 ); + + if ( bFirstIsEmpty ) + aRet = mpSecondArg->fillNode( rEquations, nullptr, nFlags ); + else if ( bSecondIsEmpty ) + aRet = mpFirstArg->fillNode( rEquations, nullptr, nFlags ); + else + { + EnhancedCustomShapeEquation aEquation; + aEquation.nOperation |= 0; + FillEquationParameter( mpFirstArg->fillNode( rEquations, nullptr, nFlags ), 0, aEquation ); + FillEquationParameter( mpSecondArg->fillNode( rEquations, nullptr, nFlags ), 1, aEquation ); + aRet.Type = EnhancedCustomShapeParameterType::EQUATION; + aRet.Value <<= static_cast<sal_Int32>(rEquations.size()); + rEquations.push_back( aEquation ); + } + } + } + break; + case ExpressionFunct::BinaryMinus: + { + EnhancedCustomShapeEquation aEquation; + aEquation.nOperation |= 0; + FillEquationParameter( mpFirstArg->fillNode( rEquations, nullptr, nFlags ), 0, aEquation ); + FillEquationParameter( mpSecondArg->fillNode( rEquations, nullptr, nFlags ), 2, aEquation ); + aRet.Type = EnhancedCustomShapeParameterType::EQUATION; + aRet.Value <<= static_cast<sal_Int32>(rEquations.size()); + rEquations.push_back( aEquation ); + } + break; + case ExpressionFunct::BinaryMul : + { + // in the dest. format the cos function is using integer as result :-( + // so we can't use the generic algorithm + if ( ( mpFirstArg->getType() == ExpressionFunct::UnarySin ) || ( mpFirstArg->getType() == ExpressionFunct::UnaryCos ) || ( mpFirstArg->getType() == ExpressionFunct::UnaryTan ) ) + aRet = mpFirstArg->fillNode( rEquations, mpSecondArg.get(), nFlags ); + else if ( ( mpSecondArg->getType() == ExpressionFunct::UnarySin ) || ( mpSecondArg->getType() == ExpressionFunct::UnaryCos ) || ( mpSecondArg->getType() == ExpressionFunct::UnaryTan ) ) + aRet = mpSecondArg->fillNode( rEquations, mpFirstArg.get(), nFlags ); + else + { + if ( mpFirstArg->isConstant() && (*mpFirstArg)() == 1 ) + aRet = mpSecondArg->fillNode( rEquations, nullptr, nFlags ); + else if ( mpSecondArg->isConstant() && (*mpSecondArg)() == 1 ) + aRet = mpFirstArg->fillNode( rEquations, nullptr, nFlags ); + else if ( ( mpFirstArg->getType() == ExpressionFunct::BinaryDiv ) // don't care of (pi/180) + && ( static_cast<BinaryFunctionExpression*>(mpFirstArg.get())->mpFirstArg->getType() == ExpressionFunct::EnumPi ) + && ( static_cast<BinaryFunctionExpression*>(mpFirstArg.get())->mpSecondArg->getType() == ExpressionFunct::Const ) ) + { + aRet = mpSecondArg->fillNode( rEquations, nullptr, nFlags ); + } + else if ( ( mpSecondArg->getType() == ExpressionFunct::BinaryDiv ) // don't care of (pi/180) + && ( static_cast<BinaryFunctionExpression*>(mpSecondArg.get())->mpFirstArg->getType() == ExpressionFunct::EnumPi ) + && ( static_cast<BinaryFunctionExpression*>(mpSecondArg.get())->mpSecondArg->getType() == ExpressionFunct::Const ) ) + { + aRet = mpFirstArg->fillNode( rEquations, nullptr, nFlags ); + } + else + { + EnhancedCustomShapeEquation aEquation; + aEquation.nOperation |= 1; + FillEquationParameter( mpFirstArg->fillNode( rEquations, nullptr, nFlags ), 0, aEquation ); + FillEquationParameter( mpSecondArg->fillNode( rEquations, nullptr, nFlags ), 1, aEquation ); + aEquation.nPara[ 2 ] = 1; + aRet.Type = EnhancedCustomShapeParameterType::EQUATION; + aRet.Value <<= static_cast<sal_Int32>(rEquations.size()); + rEquations.push_back( aEquation ); + } + } + } + break; + case ExpressionFunct::BinaryDiv : + { + EnhancedCustomShapeEquation aEquation; + aEquation.nOperation |= 1; + FillEquationParameter( mpFirstArg->fillNode( rEquations, nullptr, nFlags ), 0, aEquation ); + aEquation.nPara[ 1 ] = 1; + FillEquationParameter( mpSecondArg->fillNode( rEquations, nullptr, nFlags ), 2, aEquation ); + aRet.Type = EnhancedCustomShapeParameterType::EQUATION; + aRet.Value <<= static_cast<sal_Int32>(rEquations.size()); + rEquations.push_back( aEquation ); + } + break; + case ExpressionFunct::BinaryMin : + { + EnhancedCustomShapeEquation aEquation; + aEquation.nOperation |= 4; + FillEquationParameter( mpFirstArg->fillNode( rEquations, nullptr, nFlags ), 0, aEquation ); + FillEquationParameter( mpSecondArg->fillNode( rEquations, nullptr, nFlags ), 1, aEquation ); + aRet.Type = EnhancedCustomShapeParameterType::EQUATION; + aRet.Value <<= static_cast<sal_Int32>(rEquations.size()); + rEquations.push_back( aEquation ); + } + break; + case ExpressionFunct::BinaryMax : + { + EnhancedCustomShapeEquation aEquation; + aEquation.nOperation |= 5; + FillEquationParameter( mpFirstArg->fillNode( rEquations, nullptr, nFlags ), 0, aEquation ); + FillEquationParameter( mpSecondArg->fillNode( rEquations, nullptr, nFlags ), 1, aEquation ); + aRet.Type = EnhancedCustomShapeParameterType::EQUATION; + aRet.Value <<= static_cast<sal_Int32>(rEquations.size()); + rEquations.push_back( aEquation ); + } + break; + case ExpressionFunct::BinaryAtan2: + { + EnhancedCustomShapeEquation aEquation; + aEquation.nOperation |= 8; + FillEquationParameter( mpSecondArg->fillNode( rEquations, nullptr, nFlags ), 0, aEquation ); + FillEquationParameter( mpFirstArg->fillNode( rEquations, nullptr, nFlags ), 1, aEquation ); + aRet.Type = EnhancedCustomShapeParameterType::EQUATION; + aRet.Value <<= static_cast<sal_Int32>(rEquations.size()); + rEquations.push_back( aEquation ); + } + break; + default: + break; + } + return aRet; + } +}; + +class IfExpression : public ExpressionNode +{ + std::shared_ptr<ExpressionNode> mpFirstArg; + std::shared_ptr<ExpressionNode> mpSecondArg; + std::shared_ptr<ExpressionNode> mpThirdArg; + +public: + + IfExpression( const std::shared_ptr<ExpressionNode>& rFirstArg, + const std::shared_ptr<ExpressionNode>& rSecondArg, + const std::shared_ptr<ExpressionNode>& rThirdArg ) : + mpFirstArg( rFirstArg ), + mpSecondArg( rSecondArg ), + mpThirdArg( rThirdArg ) + { + } + virtual bool isConstant() const override + { + return + mpFirstArg->isConstant() && + mpSecondArg->isConstant() && + mpThirdArg->isConstant(); + } + virtual double operator()() const override + { + return (*mpFirstArg)() > 0 ? (*mpSecondArg)() : (*mpThirdArg)(); + } + virtual ExpressionFunct getType() const override + { + return ExpressionFunct::TernaryIf; + } + virtual EnhancedCustomShapeParameter fillNode( std::vector< EnhancedCustomShapeEquation >& rEquations, ExpressionNode* /*pOptionalArg*/, sal_uInt32 nFlags ) override + { + EnhancedCustomShapeParameter aRet; + aRet.Type = EnhancedCustomShapeParameterType::EQUATION; + aRet.Value <<= static_cast<sal_Int32>(rEquations.size()); + { + EnhancedCustomShapeEquation aEquation; + aEquation.nOperation |= 6; + FillEquationParameter( mpFirstArg->fillNode( rEquations, nullptr, nFlags ), 0, aEquation ); + FillEquationParameter( mpSecondArg->fillNode( rEquations, nullptr, nFlags ), 1, aEquation ); + FillEquationParameter( mpThirdArg->fillNode( rEquations, nullptr, nFlags ), 2, aEquation ); + rEquations.push_back( aEquation ); + } + return aRet; + } +}; + + +// FUNCTION PARSER + + +typedef const char* StringIteratorT; + +struct ParserContext +{ + typedef ::std::stack< std::shared_ptr<ExpressionNode> > OperandStack; + + // stores a stack of not-yet-evaluated operands. This is used + // by the operators (i.e. '+', '*', 'sin' etc.) to pop their + // arguments from. If all arguments to an operator are constant, + // the operator pushes a precalculated result on the stack, and + // a composite ExpressionNode otherwise. + OperandStack maOperandStack; + + const EnhancedCustomShape2d* mpCustoShape; + +}; + +typedef std::shared_ptr< ParserContext > ParserContextSharedPtr; + +/** Generate parse-dependent-but-then-constant value + */ +class DoubleConstantFunctor +{ + ParserContextSharedPtr mxContext; + +public: + explicit DoubleConstantFunctor( const ParserContextSharedPtr& rContext ) : + mxContext( rContext ) + { + } + void operator()( double n ) const + { + mxContext->maOperandStack.push( std::make_shared<ConstantValueExpression>( n ) ); + } +}; + +class EnumFunctor +{ + const ExpressionFunct meFunct; + ParserContextSharedPtr mxContext; + +public: + + EnumFunctor( const ExpressionFunct eFunct, const ParserContextSharedPtr& rContext ) + : meFunct( eFunct ) + , mxContext( rContext ) + { + } + void operator()( StringIteratorT rFirst, StringIteratorT rSecond ) const + { + /*double nVal = mnValue;*/ + switch( meFunct ) + { + case ExpressionFunct::EnumAdjustment : + { + OUString aVal( rFirst + 1, rSecond - rFirst, RTL_TEXTENCODING_UTF8 ); + mxContext->maOperandStack.push( std::make_shared<AdjustmentExpression>( *mxContext->mpCustoShape, aVal.toInt32() ) ); + } + break; + case ExpressionFunct::EnumEquation : + { + OUString aVal( rFirst + 1, rSecond - rFirst, RTL_TEXTENCODING_UTF8 ); + mxContext->maOperandStack.push( std::make_shared<EquationExpression>( *mxContext->mpCustoShape, aVal.toInt32() ) ); + } + break; + default: + mxContext->maOperandStack.push( std::make_shared<EnumValueExpression>( *mxContext->mpCustoShape, meFunct ) ); + } + } +}; + +class UnaryFunctionFunctor +{ + const ExpressionFunct meFunct; + ParserContextSharedPtr mxContext; + +public: + + UnaryFunctionFunctor( const ExpressionFunct eFunct, const ParserContextSharedPtr& rContext ) : + meFunct( eFunct ), + mxContext( rContext ) + { + } + void operator()( StringIteratorT, StringIteratorT ) const + { + ParserContext::OperandStack& rNodeStack( mxContext->maOperandStack ); + + if( rNodeStack.empty() ) + throw ParseError( "Not enough arguments for unary operator" ); + + // retrieve arguments + std::shared_ptr<ExpressionNode> pArg( std::move(rNodeStack.top()) ); + rNodeStack.pop(); + + if( pArg->isConstant() ) // check for constness + rNodeStack.push( std::make_shared<ConstantValueExpression>( UnaryFunctionExpression::getValue( meFunct, pArg ) ) ); + else // push complex node, that calcs the value on demand + rNodeStack.push( std::make_shared<UnaryFunctionExpression>( meFunct, pArg ) ); + } +}; + +/** Implements a binary function over two ExpressionNodes + + @tpl Generator + Generator functor, to generate an ExpressionNode of + appropriate type + + */ +class BinaryFunctionFunctor +{ + const ExpressionFunct meFunct; + ParserContextSharedPtr mxContext; + +public: + + BinaryFunctionFunctor( const ExpressionFunct eFunct, const ParserContextSharedPtr& rContext ) : + meFunct( eFunct ), + mxContext( rContext ) + { + } + + void operator()( StringIteratorT, StringIteratorT ) const + { + ParserContext::OperandStack& rNodeStack( mxContext->maOperandStack ); + + if( rNodeStack.size() < 2 ) + throw ParseError( "Not enough arguments for binary operator" ); + + // retrieve arguments + std::shared_ptr<ExpressionNode> pSecondArg( std::move(rNodeStack.top()) ); + rNodeStack.pop(); + std::shared_ptr<ExpressionNode> pFirstArg( std::move(rNodeStack.top()) ); + rNodeStack.pop(); + + assert(pSecondArg && pFirstArg && "count of arg checked before we get here"); + + // create combined ExpressionNode + auto pNode = std::make_shared<BinaryFunctionExpression>( meFunct, pFirstArg, pSecondArg ); + // check for constness + if( pFirstArg->isConstant() && pSecondArg->isConstant() ) // call the operator() at pNode, store result in constant value ExpressionNode. + rNodeStack.push( std::make_shared<ConstantValueExpression>( (*pNode)() ) ); + else // push complex node, that calcs the value on demand + rNodeStack.push( pNode ); + } +}; + +class IfFunctor +{ + ParserContextSharedPtr mxContext; + +public: + + explicit IfFunctor( const ParserContextSharedPtr& rContext ) : + mxContext( rContext ) + { + } + void operator()( StringIteratorT, StringIteratorT ) const + { + ParserContext::OperandStack& rNodeStack( mxContext->maOperandStack ); + + if( rNodeStack.size() < 3 ) + throw ParseError( "Not enough arguments for ternary operator" ); + + // retrieve arguments + std::shared_ptr<ExpressionNode> pThirdArg( std::move(rNodeStack.top()) ); + rNodeStack.pop(); + std::shared_ptr<ExpressionNode> pSecondArg( std::move(rNodeStack.top()) ); + rNodeStack.pop(); + std::shared_ptr<ExpressionNode> pFirstArg( std::move(rNodeStack.top()) ); + rNodeStack.pop(); + + assert(pThirdArg && pSecondArg && pFirstArg); + + // create combined ExpressionNode + auto pNode = std::make_shared<IfExpression>( pFirstArg, pSecondArg, pThirdArg ); + // check for constness + if( pFirstArg->isConstant() && pSecondArg->isConstant() && pThirdArg->isConstant() ) + rNodeStack.push( std::make_shared<ConstantValueExpression>( (*pNode)() ) ); // call the operator() at pNode, store result in constant value ExpressionNode. + else + rNodeStack.push( pNode ); // push complex node, that calcs the value on demand + } +}; + +// Workaround for MSVC compiler anomaly (stack trashing) + +// The default ureal_parser_policies implementation of parse_exp +// triggers a really weird error in MSVC7 (Version 13.00.9466), in +// that the real_parser_impl::parse_main() call of parse_exp() +// overwrites the frame pointer _on the stack_ (EBP of the calling +// function gets overwritten while lying on the stack). + +// For the time being, our parser thus can only read the 1.0E10 +// notation, not the 1.0e10 one. + +// TODO(F1): Also handle the 1.0e10 case here. +template< typename T > struct custom_real_parser_policies : public ::boost::spirit::classic::ureal_parser_policies<T> +{ + template< typename ScannerT > + static typename ::boost::spirit::classic::parser_result< ::boost::spirit::classic::chlit<>, ScannerT >::type + parse_exp(ScannerT& scan) + { + // as_lower_d somehow breaks MSVC7 + return ::boost::spirit::classic::ch_p('E').parse(scan); + } +}; + +/* This class implements the following grammar (more or + less literally written down below, only slightly + obfuscated by the parser actions): + + identifier = '$'|'pi'|'e'|'X'|'Y'|'Width'|'Height' + + function = 'abs'|'sqrt'|'sin'|'cos'|'tan'|'atan'|'acos'|'asin'|'exp'|'log' + + basic_expression = + number | + identifier | + function '(' additive_expression ')' | + '(' additive_expression ')' + + unary_expression = + '-' basic_expression | + basic_expression + + multiplicative_expression = + unary_expression ( ( '*' unary_expression )* | + ( '/' unary_expression )* ) + + additive_expression = + multiplicative_expression ( ( '+' multiplicative_expression )* | + ( '-' multiplicative_expression )* ) + + */ + +class ExpressionGrammar : public ::boost::spirit::classic::grammar< ExpressionGrammar > +{ +public: + /** Create an arithmetic expression grammar + + @param rParserContext + Contains context info for the parser + */ + explicit ExpressionGrammar( const ParserContextSharedPtr& rParserContext ) : + mpParserContext( rParserContext ) + { + } + + template< typename ScannerT > class definition + { + public: + // grammar definition + explicit definition( const ExpressionGrammar& self ) + { + using ::boost::spirit::classic::str_p; + using ::boost::spirit::classic::range_p; + using ::boost::spirit::classic::lexeme_d; + using ::boost::spirit::classic::real_parser; + + identifier = + str_p( "pi" )[ EnumFunctor(ExpressionFunct::EnumPi, self.getContext() ) ] + | str_p( "left" )[ EnumFunctor(ExpressionFunct::EnumLeft, self.getContext() ) ] + | str_p( "top" )[ EnumFunctor(ExpressionFunct::EnumTop, self.getContext() ) ] + | str_p( "right" )[ EnumFunctor(ExpressionFunct::EnumRight, self.getContext() ) ] + | str_p( "bottom" )[ EnumFunctor(ExpressionFunct::EnumBottom, self.getContext() ) ] + | str_p( "xstretch" )[ EnumFunctor(ExpressionFunct::EnumXStretch, self.getContext() ) ] + | str_p( "ystretch" )[ EnumFunctor(ExpressionFunct::EnumYStretch, self.getContext() ) ] + | str_p( "hasstroke" )[ EnumFunctor(ExpressionFunct::EnumHasStroke, self.getContext() ) ] + | str_p( "hasfill" )[ EnumFunctor(ExpressionFunct::EnumHasFill, self.getContext() ) ] + | str_p( "width" )[ EnumFunctor(ExpressionFunct::EnumWidth, self.getContext() ) ] + | str_p( "height" )[ EnumFunctor(ExpressionFunct::EnumHeight, self.getContext() ) ] + | str_p( "logwidth" )[ EnumFunctor(ExpressionFunct::EnumLogWidth, self.getContext() ) ] + | str_p( "logheight" )[ EnumFunctor(ExpressionFunct::EnumLogHeight, self.getContext() ) ] + ; + + unaryFunction = + (str_p( "abs" ) >> '(' >> additiveExpression >> ')' )[ UnaryFunctionFunctor( ExpressionFunct::UnaryAbs, self.getContext()) ] + | (str_p( "sqrt" ) >> '(' >> additiveExpression >> ')' )[ UnaryFunctionFunctor( ExpressionFunct::UnarySqrt, self.getContext()) ] + | (str_p( "sin" ) >> '(' >> additiveExpression >> ')' )[ UnaryFunctionFunctor( ExpressionFunct::UnarySin, self.getContext()) ] + | (str_p( "cos" ) >> '(' >> additiveExpression >> ')' )[ UnaryFunctionFunctor( ExpressionFunct::UnaryCos, self.getContext()) ] + | (str_p( "tan" ) >> '(' >> additiveExpression >> ')' )[ UnaryFunctionFunctor( ExpressionFunct::UnaryTan, self.getContext()) ] + | (str_p( "atan" ) >> '(' >> additiveExpression >> ')' )[ UnaryFunctionFunctor( ExpressionFunct::UnaryAtan, self.getContext()) ] + ; + + binaryFunction = + (str_p( "min" ) >> '(' >> additiveExpression >> ',' >> additiveExpression >> ')' )[ BinaryFunctionFunctor( ExpressionFunct::BinaryMin, self.getContext()) ] + | (str_p( "max" ) >> '(' >> additiveExpression >> ',' >> additiveExpression >> ')' )[ BinaryFunctionFunctor( ExpressionFunct::BinaryMax, self.getContext()) ] + | (str_p( "atan2") >> '(' >> additiveExpression >> ',' >> additiveExpression >> ')' )[ BinaryFunctionFunctor( ExpressionFunct::BinaryAtan2,self.getContext()) ] + ; + + ternaryFunction = + (str_p( "if" ) >> '(' >> additiveExpression >> ',' >> additiveExpression >> ',' >> additiveExpression >> ')' )[ IfFunctor( self.getContext() ) ] + ; + + funcRef_decl = + lexeme_d[ +( range_p('a','z') | range_p('A','Z') | range_p('0','9') ) ]; + + functionReference = + (str_p( "?" ) >> funcRef_decl )[ EnumFunctor( ExpressionFunct::EnumEquation, self.getContext() ) ]; + + modRef_decl = + lexeme_d[ +( range_p('0','9') ) ]; + + modifierReference = + (str_p( "$" ) >> modRef_decl )[ EnumFunctor( ExpressionFunct::EnumAdjustment, self.getContext() ) ]; + + basicExpression = + real_parser<double, custom_real_parser_policies<double> >()[ DoubleConstantFunctor(self.getContext()) ] + | identifier + | functionReference + | modifierReference + | unaryFunction + | binaryFunction + | ternaryFunction + | '(' >> additiveExpression >> ')' + ; + + unaryExpression = + ('-' >> basicExpression)[ UnaryFunctionFunctor( ExpressionFunct::UnaryNeg, self.getContext()) ] + | basicExpression + ; + + multiplicativeExpression = + unaryExpression + >> *( ('*' >> unaryExpression)[ BinaryFunctionFunctor( ExpressionFunct::BinaryMul, self.getContext()) ] + | ('/' >> unaryExpression)[ BinaryFunctionFunctor( ExpressionFunct::BinaryDiv, self.getContext()) ] + ) + ; + + additiveExpression = + multiplicativeExpression + >> *( ('+' >> multiplicativeExpression)[ BinaryFunctionFunctor( ExpressionFunct::BinaryPlus, self.getContext()) ] + | ('-' >> multiplicativeExpression)[ BinaryFunctionFunctor( ExpressionFunct::BinaryMinus, self.getContext()) ] + ) + ; + + BOOST_SPIRIT_DEBUG_RULE(additiveExpression); + BOOST_SPIRIT_DEBUG_RULE(multiplicativeExpression); + BOOST_SPIRIT_DEBUG_RULE(unaryExpression); + BOOST_SPIRIT_DEBUG_RULE(basicExpression); + BOOST_SPIRIT_DEBUG_RULE(unaryFunction); + BOOST_SPIRIT_DEBUG_RULE(binaryFunction); + BOOST_SPIRIT_DEBUG_RULE(ternaryFunction); + BOOST_SPIRIT_DEBUG_RULE(identifier); + } + + const ::boost::spirit::classic::rule< ScannerT >& start() const + { + return additiveExpression; + } + + private: + // the constituents of the Spirit arithmetic expression grammar. + // For the sake of readability, without 'ma' prefix. + ::boost::spirit::classic::rule< ScannerT > additiveExpression; + ::boost::spirit::classic::rule< ScannerT > multiplicativeExpression; + ::boost::spirit::classic::rule< ScannerT > unaryExpression; + ::boost::spirit::classic::rule< ScannerT > basicExpression; + ::boost::spirit::classic::rule< ScannerT > unaryFunction; + ::boost::spirit::classic::rule< ScannerT > binaryFunction; + ::boost::spirit::classic::rule< ScannerT > ternaryFunction; + ::boost::spirit::classic::rule< ScannerT > funcRef_decl; + ::boost::spirit::classic::rule< ScannerT > functionReference; + ::boost::spirit::classic::rule< ScannerT > modRef_decl; + ::boost::spirit::classic::rule< ScannerT > modifierReference; + ::boost::spirit::classic::rule< ScannerT > identifier; + }; + + const ParserContextSharedPtr& getContext() const + { + return mpParserContext; + } + +private: + ParserContextSharedPtr mpParserContext; // might get modified during parsing +}; + +const ParserContextSharedPtr& getParserContext() +{ + static ParserContextSharedPtr lcl_parserContext = std::make_shared<ParserContext>(); + + // clear node stack (since we reuse the static object, that's + // the whole point here) + while( !lcl_parserContext->maOperandStack.empty() ) + lcl_parserContext->maOperandStack.pop(); + + return lcl_parserContext; +} + +} + +namespace EnhancedCustomShape { + + +std::shared_ptr<ExpressionNode> const & FunctionParser::parseFunction( std::u16string_view rFunction, const EnhancedCustomShape2d& rCustoShape ) +{ + // TODO(Q1): Check if a combination of the RTL_UNICODETOTEXT_FLAGS_* + // gives better conversion robustness here (we might want to map space + // etc. to ASCII space here) + const OString& rAsciiFunction( + OUStringToOString( rFunction, RTL_TEXTENCODING_ASCII_US ) ); + + StringIteratorT aStart( rAsciiFunction.getStr() ); + StringIteratorT aEnd( rAsciiFunction.getStr()+rAsciiFunction.getLength() ); + + // static parser context, because the actual + // Spirit parser is also a static object + ParserContextSharedPtr pContext = getParserContext(); + pContext->mpCustoShape = &rCustoShape; + + ExpressionGrammar aExpressionGrammer( pContext ); + const ::boost::spirit::classic::parse_info<StringIteratorT> aParseInfo( + ::boost::spirit::classic::parse( aStart, + aEnd, + aExpressionGrammer >> ::boost::spirit::classic::end_p, + ::boost::spirit::classic::space_p ) ); + + // input fully congested by the parser? + if( !aParseInfo.full ) + throw ParseError( "EnhancedCustomShapeFunctionParser::parseFunction(): string not fully parseable" ); + + // parser's state stack now must contain exactly _one_ ExpressionNode, + // which represents our formula. + if( pContext->maOperandStack.size() != 1 ) + throw ParseError( "EnhancedCustomShapeFunctionParser::parseFunction(): incomplete or empty expression" ); + + + return pContext->maOperandStack.top(); +} + +} + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svx/source/customshapes/EnhancedCustomShapeGeometry.cxx b/svx/source/customshapes/EnhancedCustomShapeGeometry.cxx new file mode 100644 index 000000000..0f999ed42 --- /dev/null +++ b/svx/source/customshapes/EnhancedCustomShapeGeometry.cxx @@ -0,0 +1,8567 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#include <sal/config.h> + +#include <cmath> +#include <limits> + +#include <svx/EnhancedCustomShapeGeometry.hxx> +#include <com/sun/star/drawing/EnhancedCustomShapeGluePointType.hpp> + +const sal_Int32 MIN_INT32 = std::numeric_limits<sal_Int32>::min(); + +const sal_Int32 mso_sptDefault1400[] = +{ + 1, 1400 +}; +const sal_Int32 mso_sptDefault1800[] = +{ + 1, 1800 +}; +const sal_Int32 mso_sptDefault2500[] = +{ + 1, 2500 +}; +const sal_Int32 mso_sptDefault2700[] = +{ + 1, 2700 +}; +const sal_Int32 mso_sptDefault3600[] = +{ + 1, 3600 +}; +const sal_Int32 mso_sptDefault3700[] = +{ + 1, 3700 +}; +const sal_Int32 mso_sptDefault5400[] = +{ + 1, 5400 +}; +const sal_Int32 mso_sptDefault7200[] = +{ + 1, 7200 +}; +const sal_Int32 mso_sptDefault8100[] = +{ + 1, 8100 +}; +const sal_Int32 mso_sptDefault9600[] = +{ + 1, 9600 +}; +const sal_Int32 mso_sptDefault10800[] = +{ + 1, 10800 +}; +const sal_Int32 mso_sptDefault12000[] = +{ + 1, 12000 +}; +const sal_Int32 mso_sptDefault13500[] = +{ + 1, 13500 +}; +const sal_Int32 mso_sptDefault16200[] = +{ + 1, 16200 +}; +const sal_Int32 mso_sptDefault16200and5400[] = +{ + 2, 16200, 5400 +}; + +const SvxMSDffVertPair mso_sptArcVert[] = +{ + { 0, 0 }, { 21600, 21600 }, { 3 MSO_I, 1 MSO_I }, { 7 MSO_I, 5 MSO_I }, { 10800, 10800 }, + { 0, 0 }, { 21600, 21600 }, { 3 MSO_I, 1 MSO_I }, { 7 MSO_I, 5 MSO_I } +}; +const sal_uInt16 mso_sptArcSegm[] = +{ + 0xa604, 0xab00, 0x0001, 0x6001, 0x8000, + 0xa604, 0xaa00, 0x8000 +}; +const SvxMSDffCalculationData mso_sptArcCalc[] = +{ + { 0x4009, { 10800, DFF_Prop_adjustValue, 0 } }, + { 0x2000, { 0x400, 10800, 0 } }, + { 0x400a, { 10800, DFF_Prop_adjustValue, 0 } }, + { 0x2000, { 0x402, 10800, 0 } }, + { 0x4009, { 10800, DFF_Prop_adjust2Value, 0 } }, + { 0x2000, { 0x404, 10800, 0 } }, + { 0x400a, { 10800, DFF_Prop_adjust2Value, 0 } }, + { 0x2000, { 0x406, 10800, 0 } } +}; +const sal_Int32 mso_sptArcDefault[] = +{ + 2, 270, 0 +}; +const SvxMSDffVertPair mso_sptStandardGluePoints[] = +{ + { 10800, 0 }, { 0, 10800 }, { 10800, 21600 }, { 21600, 10800 } +}; +const SvxMSDffHandle mso_sptArcHandle[] = +{ + { SvxMSDffHandleFlags::POLAR | SvxMSDffHandleFlags::RADIUS_RANGE, + 10800, 0x100, 10800, 10800, 10800, 10800, MIN_INT32, 0x7fffffff }, + { SvxMSDffHandleFlags::POLAR | SvxMSDffHandleFlags::RADIUS_RANGE, + 10800, 0x101, 10800, 10800, 10800, 10800, MIN_INT32, 0x7fffffff } +}; +const mso_CustomShape msoArc = +{ + const_cast<SvxMSDffVertPair*>(mso_sptArcVert), SAL_N_ELEMENTS( mso_sptArcVert ), + const_cast<sal_uInt16*>(mso_sptArcSegm), sizeof( mso_sptArcSegm ) >> 1, + const_cast<SvxMSDffCalculationData*>(mso_sptArcCalc), SAL_N_ELEMENTS( mso_sptArcCalc ), + const_cast<sal_Int32*>(mso_sptArcDefault), + nullptr, 0, + 21600, 21600, + MIN_INT32, MIN_INT32, + nullptr, 0, + const_cast<SvxMSDffHandle*>(mso_sptArcHandle), SAL_N_ELEMENTS( mso_sptArcHandle ) // handles +}; + +const SvxMSDffVertPair mso_sptTextSimpleVert[] = +{ + { 0, 0 }, { 21600, 0 }, { 21600, 21600 }, { 0, 21600 }, { 0, 0 } +}; +const mso_CustomShape msoTextSimple = +{ + const_cast<SvxMSDffVertPair*>(mso_sptTextSimpleVert), SAL_N_ELEMENTS( mso_sptTextSimpleVert ), + nullptr, 0, + nullptr, 0, + nullptr, + nullptr, 0, + 21600, 21600, + MIN_INT32, MIN_INT32, + nullptr, 0, + nullptr, 0 // handles +}; + +const SvxMSDffVertPair mso_sptRectangleVert[] = +{ + { 0, 0 }, { 21600, 0 }, { 21600, 21600 }, { 0, 21600 }, { 0, 0 } +}; +const mso_CustomShape msoRectangle = +{ + const_cast<SvxMSDffVertPair*>(mso_sptRectangleVert), SAL_N_ELEMENTS( mso_sptRectangleVert ), + nullptr, 0, + nullptr, 0, + nullptr, + nullptr, 0, + 21600, 21600, + MIN_INT32, MIN_INT32, + nullptr, 0, + nullptr, 0 // handles +}; + +const SvxMSDffVertPair mso_sptRoundRectangleVert[] = // adj value 0 -> 10800 +{ + { 7 MSO_I, 0 }, { 0, 8 MSO_I }, { 0, 9 MSO_I }, { 7 MSO_I, 21600 }, + { 10 MSO_I, 21600 }, { 21600, 9 MSO_I }, { 21600, 8 MSO_I }, { 10 MSO_I, 0 } +}; +const sal_uInt16 mso_sptRoundRectangleSegm[] = +{ + 0x4000, 0xa701, 0x0001, 0xa801, 0x0001, 0xa701, 0x0001, 0xa801, 0x6000, 0x8000 +}; +const SvxMSDffCalculationData mso_sptRoundRectangleCalc[] = +{ + { 0x000e, { 0, 45, 0 } }, + { 0x6009, { DFF_Prop_adjustValue, 0x400, 0 } }, + { 0x2001, { 0x401, 3163, 7636 } }, + { 0x6000, { DFF_Prop_geoLeft, 0x402, 0 } }, + { 0x6000, { DFF_Prop_geoTop, 0x402, 0 } }, + { 0xa000, { DFF_Prop_geoRight, 0, 0x402 } }, + { 0xa000, { DFF_Prop_geoBottom, 0, 0x402 } }, + { 0x6000, { DFF_Prop_geoLeft, DFF_Prop_adjustValue, 0 } }, + { 0x6000, { DFF_Prop_geoTop, DFF_Prop_adjustValue, 0 } }, + { 0xa000, { DFF_Prop_geoBottom, 0, DFF_Prop_adjustValue } }, + { 0xa000, { DFF_Prop_geoRight, 0, DFF_Prop_adjustValue } } +}; +const SvxMSDffTextRectangles mso_sptRoundRectangleTextRect[] = +{ + { { 3 MSO_I, 4 MSO_I }, { 5 MSO_I, 6 MSO_I } } +}; +const SvxMSDffHandle mso_sptRoundRectangleHandle[] = +{ + { SvxMSDffHandleFlags::RANGE | SvxMSDffHandleFlags::SWITCHED, + 0x100, 0, 10800, 10800, 0, 10800, MIN_INT32, 0x7fffffff } +}; +const mso_CustomShape msoRoundRectangle = +{ + const_cast<SvxMSDffVertPair*>(mso_sptRoundRectangleVert), SAL_N_ELEMENTS( mso_sptRoundRectangleVert ), + const_cast<sal_uInt16*>(mso_sptRoundRectangleSegm), sizeof( mso_sptRoundRectangleSegm ) >> 1, + const_cast<SvxMSDffCalculationData*>(mso_sptRoundRectangleCalc), SAL_N_ELEMENTS( mso_sptRoundRectangleCalc ), + const_cast<sal_Int32*>(mso_sptDefault3600), + const_cast<SvxMSDffTextRectangles*>(mso_sptRoundRectangleTextRect), SAL_N_ELEMENTS( mso_sptRoundRectangleTextRect ), + 21600, 21600, + 10800, 10800, + nullptr, 0, + const_cast<SvxMSDffHandle*>(mso_sptRoundRectangleHandle), SAL_N_ELEMENTS( mso_sptRoundRectangleHandle ) // handles +}; + +const SvxMSDffVertPair mso_sptRightTriangleVert[] = +{ + { 0, 0 }, { 21600, 21600 }, { 0, 21600 }, { 0, 0 } +}; +const SvxMSDffTextRectangles mso_sptRightTriangleTextRect[] = +{ + { { 1900, 12700 }, { 12700, 19700 } } +}; +const SvxMSDffVertPair mso_sptRightTriangleGluePoints[] = +{ + { 0, 0 }, { 0, 10800 }, { 0, 21600 }, { 10800, 21600 }, { 21600, 21600 }, { 10800, 10800 } +}; +const mso_CustomShape msoRightTriangle = +{ + const_cast<SvxMSDffVertPair*>(mso_sptRightTriangleVert), SAL_N_ELEMENTS( mso_sptRightTriangleVert ), + nullptr, 0, + nullptr, 0, + nullptr, + const_cast<SvxMSDffTextRectangles*>(mso_sptRightTriangleTextRect), SAL_N_ELEMENTS( mso_sptRightTriangleTextRect ), + 21600, 21600, + MIN_INT32, MIN_INT32, + const_cast<SvxMSDffVertPair*>(mso_sptRightTriangleGluePoints), SAL_N_ELEMENTS( mso_sptRightTriangleGluePoints ), + nullptr, 0 // handles +}; + +const SvxMSDffVertPair mso_sptEllipseVert[] = +{ + { 10800, 10800 }, { 10800, 10800 }, { 0, 360 } +}; +const sal_uInt16 mso_sptEllipseSegm[] = +{ + 0xa203, 0x6000, 0x8000 +}; +const SvxMSDffTextRectangles mso_sptEllipseTextRect[] = +{ + { { 3163, 3163 }, { 18437, 18437 } } +}; +const SvxMSDffVertPair mso_sptEllipseGluePoints[] = +{ + { 10800, 0 }, { 3163, 3163 }, { 0, 10800 }, { 3163, 18437 }, { 10800, 21600 }, { 18437, 18437 }, { 21600, 10800 }, { 18437, 3163 } +}; +const mso_CustomShape msoEllipse = +{ + const_cast<SvxMSDffVertPair*>(mso_sptEllipseVert), SAL_N_ELEMENTS( mso_sptEllipseVert ), + const_cast<sal_uInt16*>(mso_sptEllipseSegm), sizeof( mso_sptEllipseSegm ) >> 1, + nullptr, 0, + nullptr, + const_cast<SvxMSDffTextRectangles*>(mso_sptEllipseTextRect), SAL_N_ELEMENTS( mso_sptEllipseTextRect ), + 21600, 21600, + MIN_INT32, MIN_INT32, + const_cast<SvxMSDffVertPair*>(mso_sptEllipseGluePoints), SAL_N_ELEMENTS( mso_sptEllipseGluePoints ), + nullptr, 0 // handles +}; + +const SvxMSDffVertPair mso_sptParallelogramVert[] = // adjustment1 : 0 - 21600 +{ + { 0 MSO_I, 0 }, { 21600, 0 }, { 1 MSO_I, 21600 }, { 0, 21600 } +}; +const sal_uInt16 mso_sptParallelogramSegm[] = +{ + 0x4000, 0x0003, 0x6001, 0x8000 +}; +const SvxMSDffCalculationData mso_sptParallelogramCalc[] = +{ + { 0x4000, { 0, DFF_Prop_adjustValue, 0 } }, + { 0x8000, { 0, 21600, DFF_Prop_adjustValue } }, + { 0x2001, { DFF_Prop_adjustValue, 10, 24 } }, + { 0x2000, { 0x0402, 1750, 0 } }, + { 0x8000, { 21600, 0, 0x0403 } }, + { 0x2001, { 0x400, 1, 2 } }, + { 0x4000, { 10800, 0x405, 0 } }, + { 0x2000, { 0x400, 0, 10800 } }, + { 0x6006, { 0x407, 0x40d, 0 } }, + { 0x8000, { 10800, 0, 0x405 } }, + { 0x6006, { 0x407, 0x40c, 21600 } }, + { 0x8000, { 21600, 0, 0x405 } }, + { 0x8001, { 21600, 10800, 0x400 } }, + { 0x8000, { 21600, 0, 0x40c } } +}; +const SvxMSDffTextRectangles mso_sptParallelogramTextRect[] = +{ + { { 3 MSO_I, 3 MSO_I }, { 4 MSO_I, 4 MSO_I } } +}; +const SvxMSDffVertPair mso_sptParallelogramGluePoints[] = +{ + { 6 MSO_I, 0 }, { 10800, 8 MSO_I }, { 11 MSO_I, 10800 }, { 9 MSO_I, 21600 }, { 10800, 10 MSO_I }, { 5 MSO_I, 10800 } +}; +const SvxMSDffHandle mso_sptParallelogramHandle[] = +{ + { SvxMSDffHandleFlags::RANGE, + 0x100, 0, 10800, 10800, 0, 21600, MIN_INT32, 0x7fffffff } +}; +const mso_CustomShape msoParallelogram = +{ + const_cast<SvxMSDffVertPair*>(mso_sptParallelogramVert), SAL_N_ELEMENTS( mso_sptParallelogramVert ), + const_cast<sal_uInt16*>(mso_sptParallelogramSegm), sizeof( mso_sptParallelogramSegm ) >> 1, + const_cast<SvxMSDffCalculationData*>(mso_sptParallelogramCalc), SAL_N_ELEMENTS( mso_sptParallelogramCalc ), + const_cast<sal_Int32*>(mso_sptDefault5400), + const_cast<SvxMSDffTextRectangles*>(mso_sptParallelogramTextRect), SAL_N_ELEMENTS( mso_sptParallelogramTextRect ), + 21600, 21600, + MIN_INT32, MIN_INT32, + const_cast<SvxMSDffVertPair*>(mso_sptParallelogramGluePoints), SAL_N_ELEMENTS( mso_sptParallelogramGluePoints ), + const_cast<SvxMSDffHandle*>(mso_sptParallelogramHandle), SAL_N_ELEMENTS( mso_sptParallelogramHandle ) // handles +}; + +const SvxMSDffVertPair mso_sptDiamondVert[] = +{ + { 10800, 0 }, { 21600, 10800 }, { 10800, 21600 }, { 0, 10800 }, { 10800, 0 } +}; +const SvxMSDffTextRectangles mso_sptDiamondTextRect[] = +{ + { { 5400, 5400 }, { 16200, 16200 } } +}; +const mso_CustomShape msoDiamond = +{ + const_cast<SvxMSDffVertPair*>(mso_sptDiamondVert), SAL_N_ELEMENTS( mso_sptDiamondVert ), + nullptr, 0, + nullptr, 0, + nullptr, + const_cast<SvxMSDffTextRectangles*>(mso_sptDiamondTextRect), SAL_N_ELEMENTS( mso_sptDiamondTextRect ), + 21600, 21600, + MIN_INT32, MIN_INT32, + const_cast<SvxMSDffVertPair*>(mso_sptStandardGluePoints), SAL_N_ELEMENTS( mso_sptStandardGluePoints ), + nullptr, 0 // handles +}; + +const SvxMSDffVertPair mso_sptTrapezoidVert[] = // adjustment1 : 0 - 10800 +{ + { 0, 0 }, { 21600, 0 }, {0 MSO_I, 21600 }, { 1 MSO_I, 21600 } +}; +const sal_uInt16 mso_sptTrapezoidSegm[] = +{ + 0x4000, 0x0003, 0x6001, 0x8000 +}; +const SvxMSDffCalculationData mso_sptTrapezoidCalc[] = +{ + { 0x8000, { 21600, 0, DFF_Prop_adjustValue } }, + { 0x2000, { DFF_Prop_adjustValue, 0, 0 } }, + { 0x2001, { DFF_Prop_adjustValue, 10, 18 } }, + { 0x2000, { 0x0402, 1750, 0 } }, + { 0x8000, { 21600, 0, 0x403 } }, + { 0x2001, { DFF_Prop_adjustValue, 1, 2 } }, + { 0x8000, { 21600, 0, 0x405 } } +}; +const SvxMSDffTextRectangles mso_sptTrapezoidTextRect[] = +{ + { { 3 MSO_I, 3 MSO_I }, { 4 MSO_I, 4 MSO_I } } +}; +const SvxMSDffVertPair mso_sptTrapezoidGluePoints[] = +{ + { 6 MSO_I, 10800 }, { 10800, 21600 }, { 5 MSO_I, 10800 }, { 10800, 0 } +}; +const SvxMSDffHandle mso_sptTrapezoidHandle[] = +{ + { SvxMSDffHandleFlags::RANGE, + 0x100, 1, 10800, 10800, 0, 10800, MIN_INT32, 0x7fffffff } +}; +const mso_CustomShape msoTrapezoid = +{ + const_cast<SvxMSDffVertPair*>(mso_sptTrapezoidVert), SAL_N_ELEMENTS( mso_sptTrapezoidVert ), + const_cast<sal_uInt16*>(mso_sptTrapezoidSegm), sizeof( mso_sptTrapezoidSegm ) >> 1, + const_cast<SvxMSDffCalculationData*>(mso_sptTrapezoidCalc), SAL_N_ELEMENTS( mso_sptTrapezoidCalc ), + const_cast<sal_Int32*>(mso_sptDefault5400), + const_cast<SvxMSDffTextRectangles*>(mso_sptTrapezoidTextRect), SAL_N_ELEMENTS( mso_sptTrapezoidTextRect ), + 21600, 21600, + MIN_INT32, MIN_INT32, + const_cast<SvxMSDffVertPair*>(mso_sptTrapezoidGluePoints), SAL_N_ELEMENTS( mso_sptTrapezoidGluePoints ), + const_cast<SvxMSDffHandle*>(mso_sptTrapezoidHandle), SAL_N_ELEMENTS( mso_sptTrapezoidHandle ) // handles +}; + +/* + + The side of the enclosing square for the regular (all sides the + same, all angles the same) octagon described below is 21600. Let's + call that 'a'. + + The "adjustment1" is the horizontal (or vertical) distance from a + side of the square to the nearest vertex. Let's call that 'd'. + + Let's call the side of the regular octagon 'b'. + + We know a. We want d. d=(a-b)/2 + + Pythagoras says that b^2 = 2d^2 + + Solving for b, we get b = (sqrt(2)-1)a + + + !------------a=21600-------! + + !--d--! + x--------------x + / \ + / \ + / \ + / \ + / \ + x x + ! ! + ! ! + ! ! + ! ! + ! ! + ! ! + x x + \ / + \ / + \ / + \ / + \ / + x--------------x + +*/ + +const SvxMSDffVertPair mso_sptOctagonVert[] = // adjustment1 : 0 - 10800 +{ + { 0 MSO_I, 0 }, { 2 MSO_I, 0 }, { 21600, 1 MSO_I }, { 21600, 3 MSO_I }, + { 2 MSO_I, 21600 }, { 0 MSO_I, 21600 }, { 0, 3 MSO_I }, { 0, 1 MSO_I } +}; +const sal_uInt16 mso_sptOctagonSegm[] = +{ + 0x4000, 0x0007, 0x6001, 0x8000 +}; +const SvxMSDffCalculationData mso_sptOctagonCalc[] = +{ + { 0x6000, { DFF_Prop_geoLeft, DFF_Prop_adjustValue, 0 } }, + { 0x6000, { DFF_Prop_geoTop, DFF_Prop_adjustValue, 0 } }, + { 0xa000, { DFF_Prop_geoRight, 0, DFF_Prop_adjustValue } }, + { 0xa000, { DFF_Prop_geoBottom, 0, DFF_Prop_adjustValue } }, + { 0x2001, { DFF_Prop_adjustValue, 1, 2 } }, + { 0x6000, { DFF_Prop_geoLeft, 0x404, 0 } }, + { 0x6000, { DFF_Prop_geoTop, 0x404, 0 } }, + { 0xa000, { DFF_Prop_geoRight, 0, 0x404 } }, + { 0xa000, { DFF_Prop_geoBottom, 0, 0x404 } } +}; +const sal_Int32 mso_sptOctagonDefault[] = +{ + 1, static_cast<sal_Int32>((21600 - ((M_SQRT2-1)*21600)) / 2) +}; +const SvxMSDffTextRectangles mso_sptOctagonTextRect[] = +{ + { { 5 MSO_I, 6 MSO_I }, { 7 MSO_I, 8 MSO_I } } +}; +const SvxMSDffHandle mso_sptOctagonHandle[] = +{ + { SvxMSDffHandleFlags::RANGE, + 0x100, 0, 10800, 10800, 0, 10800, MIN_INT32, 0x7fffffff } +}; +const mso_CustomShape msoOctagon = +{ + const_cast<SvxMSDffVertPair*>(mso_sptOctagonVert), SAL_N_ELEMENTS( mso_sptOctagonVert ), + const_cast<sal_uInt16*>(mso_sptOctagonSegm), sizeof( mso_sptOctagonSegm ) >> 1, + const_cast<SvxMSDffCalculationData*>(mso_sptOctagonCalc), SAL_N_ELEMENTS( mso_sptOctagonCalc ), + const_cast<sal_Int32*>(mso_sptOctagonDefault), + const_cast<SvxMSDffTextRectangles*>(mso_sptOctagonTextRect), SAL_N_ELEMENTS( mso_sptOctagonTextRect ), + 21600, 21600, + 10800, 10800, + const_cast<SvxMSDffVertPair*>(mso_sptStandardGluePoints), SAL_N_ELEMENTS( mso_sptStandardGluePoints ), + const_cast<SvxMSDffHandle*>(mso_sptOctagonHandle), SAL_N_ELEMENTS( mso_sptOctagonHandle ) // handles +}; + +const SvxMSDffVertPair mso_sptIsocelesTriangleVert[] = // adjustment1 : 0 - 21600 +{ + { 0 MSO_I, 0 }, { 21600, 21600 }, { 0, 21600 } +}; +const sal_uInt16 mso_sptIsocelesTriangleSegm[] = +{ + 0x4000, 0x0002, 0x6001, 0x8000 +}; +const SvxMSDffCalculationData mso_sptIsocelesTriangleCalc[] = +{ + { 0x4000, { 0, DFF_Prop_adjustValue, 0 } }, + { 0x2001, { DFF_Prop_adjustValue, 1, 2 } }, + { 0x2000, { 0x401, 10800, 0 } }, + { 0x2001, { DFF_Prop_adjustValue, 2, 3 } }, + { 0x2000, { 0x403, 7200, 0 } }, + { 0x8000, { 21600, 0, 0x400 } }, + { 0x2001, { 0x405, 1, 2 } }, + { 0x8000, { 21600, 0, 0x406 } } +}; +const SvxMSDffTextRectangles mso_sptIsocelesTriangleTextRect[] = +{ + { { 1 MSO_I, 10800 }, { 2 MSO_I, 18000 } }, + { { 3 MSO_I, 7200 }, { 4 MSO_I, 21600 } } +}; +const SvxMSDffVertPair mso_sptIsocelesTriangleGluePoints[] = +{ + { 0 MSO_I, 0 }, { 1 MSO_I, 10800 }, { 0, 21600 }, { 10800, 21600 }, { 21600, 21600 }, { 7 MSO_I, 10800 } +}; +const SvxMSDffHandle mso_sptIsocelesTriangleHandle[] = +{ + { SvxMSDffHandleFlags::RANGE, + 0x100, 0, 10800, 10800, 0, 21600, MIN_INT32, 0x7fffffff } +}; +const mso_CustomShape msoIsocelesTriangle = +{ + const_cast<SvxMSDffVertPair*>(mso_sptIsocelesTriangleVert), SAL_N_ELEMENTS( mso_sptIsocelesTriangleVert ), + const_cast<sal_uInt16*>(mso_sptIsocelesTriangleSegm), sizeof( mso_sptIsocelesTriangleSegm ) >> 1, + const_cast<SvxMSDffCalculationData*>(mso_sptIsocelesTriangleCalc), SAL_N_ELEMENTS( mso_sptIsocelesTriangleCalc ), + const_cast<sal_Int32*>(mso_sptDefault10800), + const_cast<SvxMSDffTextRectangles*>(mso_sptIsocelesTriangleTextRect), SAL_N_ELEMENTS( mso_sptIsocelesTriangleTextRect ), + 21600, 21600, + MIN_INT32, MIN_INT32, + const_cast<SvxMSDffVertPair*>(mso_sptIsocelesTriangleGluePoints), SAL_N_ELEMENTS( mso_sptIsocelesTriangleGluePoints ), + const_cast<SvxMSDffHandle*>(mso_sptIsocelesTriangleHandle), SAL_N_ELEMENTS( mso_sptIsocelesTriangleHandle ) // handles +}; + +const SvxMSDffVertPair mso_sptHexagonVert[] = // adjustment1 : 0 - 10800 +{ + { 0 MSO_I, 0 }, { 1 MSO_I, 0 }, { 21600, 10800 }, { 1 MSO_I, 21600 }, + { 0 MSO_I, 21600 }, { 0, 10800 } +}; +const sal_uInt16 mso_sptHexagonSegm[] = +{ + 0x4000, 0x0005, 0x6001, 0x8000 +}; +const SvxMSDffCalculationData mso_sptHexagonCalc[] = +{ + { 0x2000, { DFF_Prop_adjustValue, 0, 0 } }, + { 0x8000, { 21600, 0, DFF_Prop_adjustValue } }, + { 0x2001, { DFF_Prop_adjustValue, 100, 234 } }, + { 0x2000, { 0x402, 1700, 0 } }, + { 0x8000, { 21600, 0, 0x403 } } +}; +const SvxMSDffTextRectangles mso_sptHexagonTextRect[] = +{ + { { 3 MSO_I, 3 MSO_I }, { 4 MSO_I, 4 MSO_I } } +}; +const SvxMSDffHandle mso_sptHexagonHandle[] = +{ + { SvxMSDffHandleFlags::RANGE, + 0x100, 0, 10800, 10800, 0, 10800, MIN_INT32, 0x7fffffff } +}; +const mso_CustomShape msoHexagon = +{ + const_cast<SvxMSDffVertPair*>(mso_sptHexagonVert), SAL_N_ELEMENTS( mso_sptHexagonVert ), + const_cast<sal_uInt16*>(mso_sptHexagonSegm), sizeof( mso_sptHexagonSegm ) >> 1, + const_cast<SvxMSDffCalculationData*>(mso_sptHexagonCalc), SAL_N_ELEMENTS( mso_sptHexagonCalc ), + const_cast<sal_Int32*>(mso_sptDefault5400), + const_cast<SvxMSDffTextRectangles*>(mso_sptHexagonTextRect), SAL_N_ELEMENTS( mso_sptHexagonTextRect ), + 21600, 21600, + MIN_INT32, MIN_INT32, + const_cast<SvxMSDffVertPair*>(mso_sptStandardGluePoints), SAL_N_ELEMENTS( mso_sptStandardGluePoints ), + const_cast<SvxMSDffHandle*>(mso_sptHexagonHandle), SAL_N_ELEMENTS( mso_sptHexagonHandle ) // handles +}; + +const SvxMSDffVertPair mso_sptPentagonVert[] = +{ + { 10800, 0 }, { 0, 8260 }, { 4230, 21600 }, { 17370, 21600 }, + { 21600, 8260 }, { 10800, 0 } +}; +const SvxMSDffTextRectangles mso_sptPentagonTextRect[] = +{ + { { 4230, 5080 }, { 17370, 21600 } } +}; +const SvxMSDffVertPair mso_sptPentagonGluePoints[] = +{ + { 10800, 0 }, { 0, 8260 }, { 4230, 21600 }, { 10800, 21600 }, + { 17370, 21600 }, { 21600, 8260 } +}; +const mso_CustomShape msoPentagon = +{ + const_cast<SvxMSDffVertPair*>(mso_sptPentagonVert), SAL_N_ELEMENTS( mso_sptPentagonVert ), + nullptr, 0, + nullptr, 0, + nullptr, + const_cast<SvxMSDffTextRectangles*>(mso_sptPentagonTextRect), SAL_N_ELEMENTS( mso_sptPentagonTextRect ), + 21600, 21600, + MIN_INT32, MIN_INT32, + const_cast<SvxMSDffVertPair*>(mso_sptPentagonGluePoints), SAL_N_ELEMENTS( mso_sptPentagonGluePoints ), + nullptr, 0 // handles +}; + +const SvxMSDffVertPair mso_sptPlusVert[] = // adjustment1 : 0 - 10800 +{ + { 1 MSO_I, 0 }, { 2 MSO_I, 0 }, { 2 MSO_I, 1 MSO_I }, { 21600, 1 MSO_I }, + { 21600, 3 MSO_I }, { 2 MSO_I, 3 MSO_I }, { 2 MSO_I, 21600 }, { 1 MSO_I, 21600 }, + { 1 MSO_I, 3 MSO_I }, { 0, 3 MSO_I }, { 0, 1 MSO_I }, { 1 MSO_I, 1 MSO_I }, { 1 MSO_I, 0 } +}; +const SvxMSDffCalculationData mso_sptPlusCalc[] = +{ + { 0x2001, { DFF_Prop_adjustValue, 10799, 10800 } }, + { 0x2000, { 0x400, 0, 0 } }, + { 0xa000, { DFF_Prop_geoRight, 0, 0x400 } }, + { 0xa000, { DFF_Prop_geoBottom, 0, 0x400 } } +}; +const SvxMSDffTextRectangles mso_sptPlusTextRect[] = +{ + { { 1 MSO_I, 1 MSO_I }, { 2 MSO_I, 3 MSO_I } } +}; +const SvxMSDffHandle mso_sptPlusHandle[] = +{ + { SvxMSDffHandleFlags::RANGE | SvxMSDffHandleFlags::SWITCHED, + 0x100, 0, 10800, 10800, 0, 10800, MIN_INT32, 0x7fffffff } +}; +const mso_CustomShape msoPlus = +{ + const_cast<SvxMSDffVertPair*>(mso_sptPlusVert), SAL_N_ELEMENTS( mso_sptPlusVert ), + nullptr, 0, + const_cast<SvxMSDffCalculationData*>(mso_sptPlusCalc), SAL_N_ELEMENTS( mso_sptPlusCalc ), + const_cast<sal_Int32*>(mso_sptDefault5400), + const_cast<SvxMSDffTextRectangles*>(mso_sptPlusTextRect), SAL_N_ELEMENTS( mso_sptPlusTextRect ), + 21600, 21600, + 10800, 10800, + const_cast<SvxMSDffVertPair*>(mso_sptStandardGluePoints), SAL_N_ELEMENTS( mso_sptStandardGluePoints ), + const_cast<SvxMSDffHandle*>(mso_sptPlusHandle), SAL_N_ELEMENTS( mso_sptPlusHandle ) // handles +}; + +const SvxMSDffVertPair mso_sptCanVert[] = // adjustment1 : 0 - 10800 +{ + { 44, 0 }, + { 20, 0 }, { 0, 2 MSO_I }, { 0, 0 MSO_I }, // ccp + { 0, 3 MSO_I }, // p + { 0, 4 MSO_I }, { 20, 21600 }, { 44, 21600 }, // ccp + { 68, 21600 }, { 88, 4 MSO_I }, { 88, 3 MSO_I }, // ccp + { 88, 0 MSO_I }, // p + { 88, 2 MSO_I }, { 68, 0 }, { 44, 0 }, // ccp + { 44, 0 }, // p + { 20, 0 }, { 0, 2 MSO_I }, { 0, 0 MSO_I }, // ccp + { 0, 5 MSO_I }, { 20, 6 MSO_I }, { 44, 6 MSO_I }, // ccp + { 68, 6 MSO_I },{ 88, 5 MSO_I }, { 88, 0 MSO_I }, // ccp + { 88, 2 MSO_I },{ 68, 0 }, { 44, 0 } // ccp +}; +const sal_uInt16 mso_sptCanSegm[] = +{ + 0x4000, 0x2001, 0x0001, 0x2002, 0x0001, 0x2001, 0x6001, 0x8000, + 0x4000, 0x2004, 0x6001, 0x8000 +}; +const SvxMSDffCalculationData mso_sptCanCalc[] = +{ + { 0x2001, { DFF_Prop_adjustValue, 2, 4 } }, // 1/4 + { 0x2001, { 0x0400, 6, 11 } }, + { 0xa000, { 0x0400, 0, 0x0401 } }, + { 0x8000, { 21600, 0, 0x0400 } }, + { 0x6000, { 0x0403, 0x0401, 0 } }, + { 0x6000, { 0x0400, 0x0401, 0 } }, + { 0x2001, { DFF_Prop_adjustValue, 2, 2 } }, + { 0x0000, { 44, 0, 0 } } +}; +const SvxMSDffTextRectangles mso_sptCanTextRect[] = +{ + { { 0, 6 MSO_I }, { 88, 3 MSO_I } } +}; +const SvxMSDffVertPair mso_sptCanGluePoints[] = +{ + { 44, 6 MSO_I }, { 44, 0 }, { 0, 10800 }, { 44, 21600 }, { 88, 10800 } +}; +const SvxMSDffHandle mso_sptCanHandle[] = +{ + { SvxMSDffHandleFlags::RANGE, + 7 + 3, 0x100, 44, 10800, MIN_INT32, 0x7fffffff, 0, 10800 } +}; +const mso_CustomShape msoCan = +{ + const_cast<SvxMSDffVertPair*>(mso_sptCanVert), SAL_N_ELEMENTS( mso_sptCanVert ), + const_cast<sal_uInt16*>(mso_sptCanSegm), sizeof( mso_sptCanSegm ) >> 1, + const_cast<SvxMSDffCalculationData*>(mso_sptCanCalc), SAL_N_ELEMENTS( mso_sptCanCalc ), + const_cast<sal_Int32*>(mso_sptDefault5400), + const_cast<SvxMSDffTextRectangles*>(mso_sptCanTextRect), SAL_N_ELEMENTS( mso_sptCanTextRect ), + 88, 21600, + MIN_INT32, MIN_INT32, + const_cast<SvxMSDffVertPair*>(mso_sptCanGluePoints), SAL_N_ELEMENTS( mso_sptCanGluePoints ), + const_cast<SvxMSDffHandle*>(mso_sptCanHandle), SAL_N_ELEMENTS( mso_sptCanHandle ) // handles +}; + +const SvxMSDffVertPair mso_sptArrowVert[] = // adjustment1: x 0 - 21600 +{ // adjustment2: y 0 - 10800 + { 0, 0 MSO_I }, { 1 MSO_I, 0 MSO_I }, { 1 MSO_I, 0 }, { 21600, 10800 }, + { 1 MSO_I, 21600 }, { 1 MSO_I, 2 MSO_I }, { 0, 2 MSO_I } +}; +const sal_uInt16 mso_sptArrowSegm[] = +{ + 0x4000, 0x0006, 0x6001, 0x8000 +}; +const SvxMSDffCalculationData mso_sptArrowCalc[] = +{ + { 0x2000, { DFF_Prop_adjust2Value, 0, 0 } }, + { 0x2000, { DFF_Prop_adjustValue, 0, 0 } }, + { 0x8000, { 21600, 0, DFF_Prop_adjust2Value } }, + { 0x8000, { 21600, 0, 0x401 } }, + { 0x6001, { 0x403, 0x400, 10800 } }, + { 0x6000, { 0x401, 0x404, 0 } }, + { 0x6001, { 0x401, 0x400, 10800 } }, + { 0xa000, { 0x401, 0, 0x406 } } +}; +const SvxMSDffTextRectangles mso_sptArrowTextRect[] = +{ + { { 0, 0 MSO_I }, { 5 MSO_I, 2 MSO_I } } +}; +const SvxMSDffHandle mso_sptArrowHandle[] = +{ + { SvxMSDffHandleFlags::RANGE, + 0x100, 0x101, 10800, 10800, 0, 21600, 0, 10800 } +}; +const mso_CustomShape msoArrow = +{ + const_cast<SvxMSDffVertPair*>(mso_sptArrowVert), SAL_N_ELEMENTS( mso_sptArrowVert ), + const_cast<sal_uInt16*>(mso_sptArrowSegm), sizeof( mso_sptArrowSegm ) >> 1, + const_cast<SvxMSDffCalculationData*>(mso_sptArrowCalc), SAL_N_ELEMENTS( mso_sptArrowCalc ), + const_cast<sal_Int32*>(mso_sptDefault16200and5400), + const_cast<SvxMSDffTextRectangles*>(mso_sptArrowTextRect), SAL_N_ELEMENTS( mso_sptArrowTextRect ), + 21600, 21600, + MIN_INT32, MIN_INT32, + nullptr, 0, + const_cast<SvxMSDffHandle*>(mso_sptArrowHandle), SAL_N_ELEMENTS( mso_sptArrowHandle ) // handles +}; + +const SvxMSDffVertPair mso_sptLeftArrowVert[] = // adjustment1: x 0 - 21600 +{ // adjustment2: y 0 - 10800 + { 21600, 0 MSO_I }, { 1 MSO_I, 0 MSO_I }, { 1 MSO_I, 0 }, { 0, 10800 }, + { 1 MSO_I, 21600 }, { 1 MSO_I, 2 MSO_I }, { 21600, 2 MSO_I } +}; +const sal_uInt16 mso_sptLeftArrowSegm[] = +{ + 0x4000, 0x0006, 0x6001, 0x8000 +}; +const sal_Int32 mso_sptLeftArrowDefault[] = +{ + 2, 5400, 5400 +}; +const SvxMSDffTextRectangles mso_sptLeftArrowTextRect[] = +{ + { { 7 MSO_I, 0 MSO_I }, { 21600, 2 MSO_I } } +}; +const SvxMSDffHandle mso_sptLeftArrowHandle[] = +{ + { SvxMSDffHandleFlags::RANGE, + 0x100, 0x101, 10800, 10800, 0, 21600, 0, 10800 } +}; +const mso_CustomShape msoLeftArrow = +{ + const_cast<SvxMSDffVertPair*>(mso_sptLeftArrowVert), SAL_N_ELEMENTS( mso_sptLeftArrowVert ), + const_cast<sal_uInt16*>(mso_sptLeftArrowSegm), sizeof( mso_sptLeftArrowSegm ) >> 1, + const_cast<SvxMSDffCalculationData*>(mso_sptArrowCalc), SAL_N_ELEMENTS( mso_sptArrowCalc ), + const_cast<sal_Int32*>(mso_sptLeftArrowDefault), + const_cast<SvxMSDffTextRectangles*>(mso_sptLeftArrowTextRect), SAL_N_ELEMENTS( mso_sptLeftArrowTextRect ), + 21600, 21600, + MIN_INT32, MIN_INT32, + nullptr, 0, + const_cast<SvxMSDffHandle*>(mso_sptLeftArrowHandle), SAL_N_ELEMENTS( mso_sptLeftArrowHandle ) // handles +}; + +const SvxMSDffVertPair mso_sptDownArrowVert[] = // adjustment1: x 0 - 21600 +{ // adjustment2: y 0 - 10800 + { 0 MSO_I, 0 }, { 0 MSO_I, 1 MSO_I }, { 0, 1 MSO_I }, { 10800, 21600 }, + { 21600, 1 MSO_I }, { 2 MSO_I, 1 MSO_I }, { 2 MSO_I, 0 } +}; +const sal_uInt16 mso_sptDownArrowSegm[] = +{ + 0x4000, 0x0006, 0x6001, 0x8000 +}; +const SvxMSDffTextRectangles mso_sptDownArrowTextRect[] = +{ + { { 0 MSO_I, 0 }, { 2 MSO_I, 5 MSO_I } } +}; +const SvxMSDffHandle mso_sptDownArrowHandle[] = +{ + { SvxMSDffHandleFlags::RANGE, + 0x101, 0x100, 10800, 10800, 0, 10800, 0, 21600 } +}; +const mso_CustomShape msoDownArrow = +{ + const_cast<SvxMSDffVertPair*>(mso_sptDownArrowVert), SAL_N_ELEMENTS( mso_sptDownArrowVert ), + const_cast<sal_uInt16*>(mso_sptDownArrowSegm), sizeof( mso_sptDownArrowSegm ) >> 1, + const_cast<SvxMSDffCalculationData*>(mso_sptArrowCalc), SAL_N_ELEMENTS( mso_sptArrowCalc ), + const_cast<sal_Int32*>(mso_sptDefault16200and5400), + const_cast<SvxMSDffTextRectangles*>(mso_sptDownArrowTextRect), SAL_N_ELEMENTS( mso_sptDownArrowTextRect ), + 21600, 21600, + MIN_INT32, MIN_INT32, + nullptr, 0, + const_cast<SvxMSDffHandle*>(mso_sptDownArrowHandle), SAL_N_ELEMENTS( mso_sptDownArrowHandle ) // handles +}; + +const SvxMSDffVertPair mso_sptUpArrowVert[] = // adjustment1: x 0 - 21600 +{ // adjustment2: y 0 - 10800 + { 0 MSO_I, 21600 }, { 0 MSO_I, 1 MSO_I }, { 0, 1 MSO_I }, { 10800, 0 }, + { 21600, 1 MSO_I }, { 2 MSO_I, 1 MSO_I }, { 2 MSO_I, 21600 } +}; +const sal_uInt16 mso_sptUpArrowSegm[] = +{ + 0x4000, 0x0006, 0x6001, 0x8000 +}; +const sal_Int32 mso_sptUpArrowDefault[] = +{ + 2, 5400, 5400 +}; +const SvxMSDffTextRectangles mso_sptUpArrowTextRect[] = +{ + { { 0 MSO_I, 7 MSO_I }, { 2 MSO_I, 21600 } } +}; +const SvxMSDffHandle mso_sptUpArrowHandle[] = +{ + { SvxMSDffHandleFlags::RANGE, + 0x101, 0x100, 10800, 10800, 0, 10800, 0, 21600 } +}; +const mso_CustomShape msoUpArrow = +{ + const_cast<SvxMSDffVertPair*>(mso_sptUpArrowVert), SAL_N_ELEMENTS( mso_sptUpArrowVert ), + const_cast<sal_uInt16*>(mso_sptUpArrowSegm), sizeof( mso_sptUpArrowSegm ) >> 1, + const_cast<SvxMSDffCalculationData*>(mso_sptArrowCalc), SAL_N_ELEMENTS( mso_sptArrowCalc ), + const_cast<sal_Int32*>(mso_sptUpArrowDefault), + const_cast<SvxMSDffTextRectangles*>(mso_sptUpArrowTextRect), SAL_N_ELEMENTS( mso_sptUpArrowTextRect ), + 21600, 21600, + MIN_INT32, MIN_INT32, + nullptr, 0, + const_cast<SvxMSDffHandle*>(mso_sptUpArrowHandle), SAL_N_ELEMENTS( mso_sptUpArrowHandle ) // handles +}; + +const SvxMSDffVertPair mso_sptLeftRightArrowVert[] = // adjustment1: x 0 - 10800 +{ // adjustment2: y 0 - 10800 + { 0, 10800 }, { 0 MSO_I, 0 }, { 0 MSO_I, 1 MSO_I }, { 2 MSO_I, 1 MSO_I }, + { 2 MSO_I, 0 }, { 21600, 10800 }, { 2 MSO_I, 21600 }, { 2 MSO_I, 3 MSO_I }, + { 0 MSO_I, 3 MSO_I }, { 0 MSO_I, 21600 } +}; +const sal_uInt16 mso_sptLeftRightArrowSegm[] = +{ + 0x4000, 0x0009, 0x6001, 0x8000 +}; +const SvxMSDffCalculationData mso_sptDoubleArrowCalc[] = +{ + { 0x2000, { DFF_Prop_adjustValue, 0, 0 } }, + { 0x2000, { DFF_Prop_adjust2Value, 0, 0 } }, + { 0x8000, { 21600, 0, DFF_Prop_adjustValue } }, + { 0x8000, { 21600, 0, DFF_Prop_adjust2Value } }, + { 0x8000, { 10800, 0, DFF_Prop_adjust2Value } }, + { 0x6001, { DFF_Prop_adjustValue, 0x404, 10800 } }, + { 0x8000, { 21600, 0, 0x405 } }, + { 0x8000, { 10800, 0, DFF_Prop_adjustValue } }, + { 0x6001, { DFF_Prop_adjust2Value, 0x407, 10800 } }, + { 0x8000, { 21600, 0, 0x408 } } +}; +const sal_Int32 mso_sptLeftRightArrowDefault[] = +{ + 2, 4300, 5400 +}; +const SvxMSDffTextRectangles mso_sptLeftRightArrowTextRect[] = +{ + { { 5 MSO_I, 1 MSO_I }, { 6 MSO_I, 3 MSO_I } } +}; +const SvxMSDffHandle mso_sptLeftRightArrowHandle[] = +{ + { SvxMSDffHandleFlags::RANGE, + 0x100, 0x101, 10800, 10800, 0, 10800, 0, 10800 } +}; +const mso_CustomShape msoLeftRightArrow = +{ + const_cast<SvxMSDffVertPair*>(mso_sptLeftRightArrowVert), SAL_N_ELEMENTS( mso_sptLeftRightArrowVert ), + const_cast<sal_uInt16*>(mso_sptLeftRightArrowSegm), sizeof( mso_sptLeftRightArrowSegm ) >> 1, + const_cast<SvxMSDffCalculationData*>(mso_sptDoubleArrowCalc), SAL_N_ELEMENTS( mso_sptDoubleArrowCalc ), + const_cast<sal_Int32*>(mso_sptLeftRightArrowDefault), + const_cast<SvxMSDffTextRectangles*>(mso_sptLeftRightArrowTextRect), SAL_N_ELEMENTS( mso_sptLeftRightArrowTextRect ), + 21600, 21600, + MIN_INT32, MIN_INT32, + nullptr, 0, + const_cast<SvxMSDffHandle*>(mso_sptLeftRightArrowHandle), SAL_N_ELEMENTS( mso_sptLeftRightArrowHandle ) // handles +}; + +const SvxMSDffVertPair mso_sptUpDownArrowVert[] = // adjustment1: x 0 - 10800 +{ // adjustment2: y 0 - 10800 + { 0, 1 MSO_I }, { 10800, 0 }, { 21600, 1 MSO_I }, { 2 MSO_I, 1 MSO_I }, + { 2 MSO_I, 3 MSO_I }, { 21600, 3 MSO_I }, { 10800, 21600 }, { 0, 3 MSO_I }, + { 0 MSO_I, 3 MSO_I }, { 0 MSO_I, 1 MSO_I } +}; +const sal_uInt16 mso_sptUpDownArrowSegm[] = +{ + 0x4000, 0x0009, 0x6001, 0x8000 +}; +const sal_Int32 mso_sptUpDownArrowDefault[] = +{ + 2, 5400, 4300 +}; +const SvxMSDffTextRectangles mso_sptUpDownArrowTextRect[] = +{ + { { 0 MSO_I, 8 MSO_I }, { 2 MSO_I, 9 MSO_I } } +}; +const SvxMSDffHandle mso_sptUpDownArrowHandle[] = +{ + { SvxMSDffHandleFlags::RANGE, + 0x100, 0x101, 10800, 10800, 0, 10800, 0, 10800 } +}; +const mso_CustomShape msoUpDownArrow = +{ + const_cast<SvxMSDffVertPair*>(mso_sptUpDownArrowVert), SAL_N_ELEMENTS( mso_sptUpDownArrowVert ), + const_cast<sal_uInt16*>(mso_sptUpDownArrowSegm), sizeof( mso_sptUpDownArrowSegm ) >> 1, + const_cast<SvxMSDffCalculationData*>(mso_sptDoubleArrowCalc), SAL_N_ELEMENTS( mso_sptDoubleArrowCalc ), + const_cast<sal_Int32*>(mso_sptUpDownArrowDefault), + const_cast<SvxMSDffTextRectangles*>(mso_sptUpDownArrowTextRect), SAL_N_ELEMENTS( mso_sptUpDownArrowTextRect ), + 21600, 21600, + MIN_INT32, MIN_INT32, + nullptr, 0, + const_cast<SvxMSDffHandle*>(mso_sptUpDownArrowHandle), SAL_N_ELEMENTS( mso_sptUpDownArrowHandle ) // handles +}; + +const SvxMSDffVertPair mso_sptQuadArrowVert[] = // adjustment1: x 0 - 10800, adjustment2: x 0 - 10800 +{ // adjustment3: y 0 - 10800 + { 0, 10800 }, { 0 MSO_I, 1 MSO_I }, { 0 MSO_I, 2 MSO_I }, { 2 MSO_I, 2 MSO_I }, + { 2 MSO_I, 0 MSO_I }, { 1 MSO_I, 0 MSO_I }, { 10800, 0 }, { 3 MSO_I, 0 MSO_I }, + { 4 MSO_I, 0 MSO_I }, { 4 MSO_I, 2 MSO_I }, { 5 MSO_I, 2 MSO_I }, { 5 MSO_I, 1 MSO_I }, + { 21600, 10800 }, { 5 MSO_I, 3 MSO_I }, { 5 MSO_I, 4 MSO_I }, { 4 MSO_I, 4 MSO_I }, + { 4 MSO_I, 5 MSO_I }, { 3 MSO_I, 5 MSO_I }, { 10800, 21600 }, { 1 MSO_I, 5 MSO_I }, + { 2 MSO_I, 5 MSO_I }, { 2 MSO_I, 4 MSO_I }, { 0 MSO_I, 4 MSO_I }, { 0 MSO_I, 3 MSO_I } +}; +const sal_uInt16 mso_sptQuadArrowSegm[] = +{ + 0x4000, 0x0017, 0x6001, 0x8000 +}; +const SvxMSDffCalculationData mso_sptQuadArrowCalc[] = +{ + { 0x2000, { DFF_Prop_adjust3Value, 0, 0 } }, + { 0x2000, { DFF_Prop_adjustValue, 0, 0 } }, + { 0x2000, { DFF_Prop_adjust2Value, 0, 0 } }, + { 0x8000, { 21600, 0, DFF_Prop_adjustValue } }, + { 0x8000, { 21600, 0, DFF_Prop_adjust2Value } }, + { 0x8000, { 21600, 0, DFF_Prop_adjust3Value } } +}; +const sal_Int32 mso_sptQuadArrowDefault[] = +{ + 3, 6500, 8600, 4300 +}; +const SvxMSDffTextRectangles mso_sptQuadArrowTextRect[] = // todo +{ + { { 0, 0 }, { 21600, 21600 } } +}; +const SvxMSDffHandle mso_sptQuadArrowHandle[] = +{ + { SvxMSDffHandleFlags::RANGE | SvxMSDffHandleFlags::RANGE_Y_MAX_IS_SPECIAL | SvxMSDffHandleFlags::RANGE_X_MIN_IS_SPECIAL, + 0x101, 0x102, 10800, 10800, 0x100, 10800, 0, 0x100 }, + { SvxMSDffHandleFlags::RANGE | SvxMSDffHandleFlags::RANGE_X_MIN_IS_SPECIAL | SvxMSDffHandleFlags::RANGE_X_MAX_IS_SPECIAL, + 0x100, 0, 10800, 10800, 0x102, 0x101, MIN_INT32, 0x7fffffff } +}; +const mso_CustomShape msoQuadArrow = +{ + const_cast<SvxMSDffVertPair*>(mso_sptQuadArrowVert), SAL_N_ELEMENTS( mso_sptQuadArrowVert ), + const_cast<sal_uInt16*>(mso_sptQuadArrowSegm), sizeof( mso_sptQuadArrowSegm ) >> 1, + const_cast<SvxMSDffCalculationData*>(mso_sptQuadArrowCalc), SAL_N_ELEMENTS( mso_sptQuadArrowCalc ), + const_cast<sal_Int32*>(mso_sptQuadArrowDefault), + const_cast<SvxMSDffTextRectangles*>(mso_sptQuadArrowTextRect), SAL_N_ELEMENTS( mso_sptQuadArrowTextRect ), + 21600, 21600, + MIN_INT32, MIN_INT32, + nullptr, 0, + const_cast<SvxMSDffHandle*>(mso_sptQuadArrowHandle), SAL_N_ELEMENTS( mso_sptQuadArrowHandle ) // handles +}; + +const SvxMSDffVertPair mso_sptLeftRightUpArrowVert[] = // adjustment1: x 0 - 10800, adjustment2: x 0 - 10800 +{ // adjustment3: y 0 - 21600 + { 10800, 0 }, { 3 MSO_I, 2 MSO_I }, { 4 MSO_I, 2 MSO_I }, { 4 MSO_I, 1 MSO_I }, + { 5 MSO_I, 1 MSO_I }, { 5 MSO_I, 0 MSO_I }, { 21600, 10800 }, { 5 MSO_I, 3 MSO_I }, + { 5 MSO_I, 4 MSO_I }, { 2 MSO_I, 4 MSO_I }, { 2 MSO_I, 3 MSO_I }, { 0, 10800 }, + { 2 MSO_I, 0 MSO_I }, { 2 MSO_I, 1 MSO_I }, { 1 MSO_I, 1 MSO_I }, { 1 MSO_I, 2 MSO_I }, + { 0 MSO_I, 2 MSO_I } +}; +const sal_uInt16 mso_sptLeftRightUpArrowSegm[] = +{ + 0x4000, 0x0010, 0x6001, 0x8000 +}; +const SvxMSDffCalculationData mso_sptLeftRightUpArrowCalc[] = +{ + { 0x2000, { DFF_Prop_adjustValue, 0, 0 } }, // 0 + { 0x2000, { DFF_Prop_adjust2Value, 0, 0 } }, // 1 + { 0x6001, { 0x0403, DFF_Prop_adjust3Value, 21600 } }, // 2 + { 0x8000, { 21600, 0, DFF_Prop_adjustValue } }, // 3 + { 0x8000, { 21600, 0, DFF_Prop_adjust2Value } }, // 4 + { 0x8000, { 21600, 0, 0x0402 } } // 5 +}; +const sal_Int32 mso_sptLeftRightUpArrowDefault[] = +{ + 3, 6500, 8600, 6200 +}; +const SvxMSDffTextRectangles mso_sptLeftRightUpArrowTextRect[] = // todo +{ + { { 0, 0 }, { 21600, 21600 } } +}; +const SvxMSDffHandle mso_sptLeftRightUpArrowHandle[] = +{ + { SvxMSDffHandleFlags::RANGE | SvxMSDffHandleFlags::RANGE_Y_MAX_IS_SPECIAL | SvxMSDffHandleFlags::RANGE_X_MIN_IS_SPECIAL, + 0x101, 0x102, 10800, 10800, 0x100, 10800, 0, 0x100 }, + { SvxMSDffHandleFlags::RANGE | SvxMSDffHandleFlags::RANGE_X_MIN_IS_SPECIAL | SvxMSDffHandleFlags::RANGE_X_MAX_IS_SPECIAL, + 0x100, 0, 10800, 10800, 0x102, 0x101, MIN_INT32, 0x7fffffff } +}; +const mso_CustomShape msoLeftRightUpArrow = +{ + const_cast<SvxMSDffVertPair*>(mso_sptLeftRightUpArrowVert), SAL_N_ELEMENTS( mso_sptLeftRightUpArrowVert ), + const_cast<sal_uInt16*>(mso_sptLeftRightUpArrowSegm), sizeof( mso_sptLeftRightUpArrowSegm ) >> 1, + const_cast<SvxMSDffCalculationData*>(mso_sptLeftRightUpArrowCalc), SAL_N_ELEMENTS( mso_sptLeftRightUpArrowCalc ), + const_cast<sal_Int32*>(mso_sptLeftRightUpArrowDefault), + const_cast<SvxMSDffTextRectangles*>(mso_sptLeftRightUpArrowTextRect), SAL_N_ELEMENTS( mso_sptLeftRightUpArrowTextRect ), + 21600, 21600, + MIN_INT32, MIN_INT32, + nullptr, 0, + const_cast<SvxMSDffHandle*>(mso_sptLeftRightUpArrowHandle), SAL_N_ELEMENTS( mso_sptLeftRightUpArrowHandle ) // handles +}; + +const SvxMSDffVertPair mso_sptBentArrowVert[] = // adjustment1 : x 12427 - 21600 +{ // adjustment2 : y 0 - 6079 + { 0, 21600 }, { 0, 12160 }, { 12427, 1 MSO_I }, { 0 MSO_I, 1 MSO_I }, + { 0 MSO_I, 0 }, { 21600, 6079 }, { 0 MSO_I, 12158 }, { 0 MSO_I, 2 MSO_I }, + { 12427, 2 MSO_I }, { 4 MSO_I, 12160 }, { 4 MSO_I, 21600 } +}; +const sal_uInt16 mso_sptBentArrowSegm[] = +{ + 0x4000, 0x0001, 0xa801, 0x0006, 0xa701, 0x0001, 0x6001, 0x8000 +}; +const SvxMSDffCalculationData mso_sptBentArrowCalc[] = +{ + { 0x2000, { DFF_Prop_adjustValue, 0, 0 } }, + { 0x2000, { DFF_Prop_adjust2Value, 0, 0 } }, + { 0x8000, { 12158, 0, DFF_Prop_adjust2Value } }, + { 0x8000, { 6079, 0, DFF_Prop_adjust2Value } }, + { 0x2001, { 0x0403, 2, 1 } } +}; +const sal_Int32 mso_sptBentArrowDefault[] = +{ + 2, 15100, 2900 +}; +const SvxMSDffTextRectangles mso_sptBentArrowTextRect[] = // todo +{ + { { 0, 0 }, { 21600, 21600 } } +}; +const SvxMSDffHandle mso_sptBentArrowHandle[] = +{ + { SvxMSDffHandleFlags::RANGE, + 0x100, 0x101, 10800, 10800, 12427, 21600, 0, 6079 } +}; +const mso_CustomShape msoBentArrow = +{ + const_cast<SvxMSDffVertPair*>(mso_sptBentArrowVert), SAL_N_ELEMENTS( mso_sptBentArrowVert ), + const_cast<sal_uInt16*>(mso_sptBentArrowSegm), sizeof( mso_sptBentArrowSegm ) >> 1, + const_cast<SvxMSDffCalculationData*>(mso_sptBentArrowCalc), SAL_N_ELEMENTS( mso_sptBentArrowCalc ), + const_cast<sal_Int32*>(mso_sptBentArrowDefault), + const_cast<SvxMSDffTextRectangles*>(mso_sptBentArrowTextRect), SAL_N_ELEMENTS( mso_sptBentArrowTextRect ), + 21600, 21600, + MIN_INT32, MIN_INT32, + nullptr, 0, + const_cast<SvxMSDffHandle*>(mso_sptBentArrowHandle), SAL_N_ELEMENTS( mso_sptBentArrowHandle ) // handles +}; + +const SvxMSDffVertPair mso_sptUturnArrowVert[] = +{ + { 0, 21600 }, { 0, 8550 }, // pp + { 0, 3540 }, { 4370, 0 }, { 9270, 0 }, // ccp + { 13890, 0 }, { 18570, 3230 }, { 18600, 8300 }, // ccp + { 21600, 8300 }, { 15680, 14260 }, { 9700, 8300 }, { 12500, 8300 }, // pppp + { 12320, 6380 }, { 10870, 5850 }, { 9320, 5850 }, // ccp + { 7770, 5850 }, { 6040, 6410 }, { 6110, 8520 }, // ccp + { 6110, 21600 } +}; +const sal_uInt16 mso_sptUturnArrowSegm[] = +{ + 0x4000, 0x0001, 0x2002, 0x0004, 0x2002, 0x0001, 0x6000, 0x8000 +}; +const SvxMSDffTextRectangles mso_sptUturnArrowTextRect[] = +{ + { { 0, 8280 }, { 6110, 21600 } } +}; +const mso_CustomShape msoUturnArrow = +{ + const_cast<SvxMSDffVertPair*>(mso_sptUturnArrowVert), SAL_N_ELEMENTS( mso_sptUturnArrowVert ), + const_cast<sal_uInt16*>(mso_sptUturnArrowSegm), sizeof( mso_sptUturnArrowSegm ) >> 1, + nullptr, 0, + nullptr, + const_cast<SvxMSDffTextRectangles*>(mso_sptUturnArrowTextRect), SAL_N_ELEMENTS( mso_sptUturnArrowTextRect ), + 21600, 21600, + MIN_INT32, MIN_INT32, + nullptr, 0, + nullptr, 0 // handles +}; + +const SvxMSDffVertPair mso_sptLeftUpArrowVert[] = // adjustment1 : x 0 - 21600, adjustment2 : x 0 - 21600 +{ // adjustment3 : y 0 - 21600 + { 0, 5 MSO_I }, { 2 MSO_I, 0 MSO_I }, { 2 MSO_I, 7 MSO_I }, { 7 MSO_I, 7 MSO_I }, + { 7 MSO_I, 2 MSO_I }, { 0 MSO_I, 2 MSO_I }, { 5 MSO_I, 0 }, { 21600, 2 MSO_I }, + { 1 MSO_I, 2 MSO_I }, { 1 MSO_I, 1 MSO_I }, { 2 MSO_I, 1 MSO_I }, { 2 MSO_I, 21600 } +}; +const sal_uInt16 mso_sptLeftUpArrowSegm[] = +{ + 0x4000, 0x000b, 0x6001, 0x8000 +}; +const SvxMSDffCalculationData mso_sptLeftUpArrowCalc[] = +{ + { 0x2000, { DFF_Prop_adjustValue, 0, 0 } }, // 0 + { 0x2000, { DFF_Prop_adjust2Value, 0, 0 } }, // 1 + { 0x2000, { DFF_Prop_adjust3Value, 0, 0 } }, // 2 + { 0x8000, { 21600, 0, DFF_Prop_adjustValue } }, // 3 + { 0x2001, { 0x0403, 1, 2 } }, // 4 + { 0x6000, { DFF_Prop_adjustValue, 0x0404, 0 } }, // 5 + { 0x8000, { 21600, 0, DFF_Prop_adjust2Value } }, // 6 + { 0x6000, { DFF_Prop_adjustValue, 0x0406, 0 } }, // 7 + { 0x8000, { 21600, 0, 0x406 } }, // 8 + { 0xa000, { 0x408, 0, 0x406 } } // 9 +}; +const sal_Int32 mso_sptLeftUpArrowDefault[] = +{ + 3, 9340, 18500, 6200 +}; +const SvxMSDffTextRectangles mso_sptLeftUpArrowTextRect[] = +{ + { { 2 MSO_I, 7 MSO_I }, { 1 MSO_I, 1 MSO_I } }, + { { 7 MSO_I, 2 MSO_I }, { 1 MSO_I, 1 MSO_I } } +}; +const SvxMSDffHandle mso_sptLeftUpArrowHandle[] = +{ + { SvxMSDffHandleFlags::RANGE | SvxMSDffHandleFlags::RANGE_Y_MAX_IS_SPECIAL | SvxMSDffHandleFlags::RANGE_X_MIN_IS_SPECIAL, + 0x101, 0x102, 10800, 10800, 3 + 5, 21600, 0, 0x100 }, + { SvxMSDffHandleFlags::RANGE | SvxMSDffHandleFlags::RANGE_X_MIN_IS_SPECIAL | SvxMSDffHandleFlags::RANGE_X_MAX_IS_SPECIAL, + 0x100, 0, 10800, 10800, 0x102, 3 + 9, MIN_INT32, 0x7fffffff } +}; +const mso_CustomShape msoLeftUpArrow = +{ + const_cast<SvxMSDffVertPair*>(mso_sptLeftUpArrowVert), SAL_N_ELEMENTS( mso_sptLeftUpArrowVert ), + const_cast<sal_uInt16*>(mso_sptLeftUpArrowSegm), sizeof( mso_sptLeftUpArrowSegm ) >> 1, + const_cast<SvxMSDffCalculationData*>(mso_sptLeftUpArrowCalc), SAL_N_ELEMENTS( mso_sptLeftUpArrowCalc ), + const_cast<sal_Int32*>(mso_sptLeftUpArrowDefault), + const_cast<SvxMSDffTextRectangles*>(mso_sptLeftUpArrowTextRect), SAL_N_ELEMENTS( mso_sptLeftUpArrowTextRect ), + 21600, 21600, + MIN_INT32, MIN_INT32, + nullptr, 0, + const_cast<SvxMSDffHandle*>(mso_sptLeftUpArrowHandle), SAL_N_ELEMENTS( mso_sptLeftUpArrowHandle ) // handles +}; + +const SvxMSDffVertPair mso_sptBentUpArrowVert[] = // adjustment1 : x 0 - 21600, adjustment2 : x 0 - 21600 +{ // adjustment3 : y 0 - 21600 + { 0, 8 MSO_I }, { 7 MSO_I, 8 MSO_I }, { 7 MSO_I, 2 MSO_I }, { 0 MSO_I, 2 MSO_I }, + { 5 MSO_I, 0 }, { 21600, 2 MSO_I }, { 1 MSO_I, 2 MSO_I }, { 1 MSO_I, 21600 }, + { 0, 21600 } +}; +const sal_uInt16 mso_sptBentUpArrowSegm[] = +{ + 0x4000, 0x0008, 0x6001, 0x8000 +}; +const SvxMSDffCalculationData mso_sptBentUpArrowCalc[] = +{ + { 0x2000, { DFF_Prop_adjustValue, 0, 0 } }, // 0 + { 0x2000, { DFF_Prop_adjust2Value, 0, 0 } }, // 1 + { 0x2000, { DFF_Prop_adjust3Value, 0, 0 } }, // 2 + { 0x8000, { 21600, 0, DFF_Prop_adjustValue } }, // 3 + { 0x2001, { 0x0403, 1, 2 } }, // 4 + { 0x6000, { DFF_Prop_adjustValue, 0x0404, 0 } }, // 5 + { 0x8000, { 21600, 0, DFF_Prop_adjust2Value } }, // 6 + { 0x6000, { DFF_Prop_adjustValue, 0x0406, 0 } }, // 7 + { 0x6000, { 0x0407, 0x0406, 0 } }, // 8 + { 0x8000, { 21600, 0, 0x406 } }, // 9 + { 0xa000, { 0x409, 0, 0x406 } } // a +}; +const sal_Int32 mso_sptBentUpArrowDefault[] = +{ + 3, 9340, 18500, 7200 +}; +const SvxMSDffTextRectangles mso_sptBentUpArrowTextRect[] = +{ + { { 2 MSO_I, 7 MSO_I }, { 1 MSO_I, 1 MSO_I } }, + { { 7 MSO_I, 2 MSO_I }, { 1 MSO_I, 1 MSO_I } } +}; +const SvxMSDffHandle mso_sptBentUpArrowHandle[] = +{ + { SvxMSDffHandleFlags::RANGE | SvxMSDffHandleFlags::RANGE_Y_MAX_IS_SPECIAL | SvxMSDffHandleFlags::RANGE_X_MIN_IS_SPECIAL, + 0x101, 0x102, 10800, 10800, 3 + 5, 21600, 0, 0x100 }, + { SvxMSDffHandleFlags::RANGE | SvxMSDffHandleFlags::RANGE_X_MIN_IS_SPECIAL | SvxMSDffHandleFlags::RANGE_X_MAX_IS_SPECIAL, + 0x100, 0, 10800, 10800, 0x102, 3 + 10, MIN_INT32, 0x7fffffff } +}; +const mso_CustomShape msoBentUpArrow = +{ + const_cast<SvxMSDffVertPair*>(mso_sptBentUpArrowVert), SAL_N_ELEMENTS( mso_sptBentUpArrowVert ), + const_cast<sal_uInt16*>(mso_sptBentUpArrowSegm), sizeof( mso_sptBentUpArrowSegm ) >> 1, + const_cast<SvxMSDffCalculationData*>(mso_sptBentUpArrowCalc), SAL_N_ELEMENTS( mso_sptBentUpArrowCalc ), + const_cast<sal_Int32*>(mso_sptBentUpArrowDefault), + const_cast<SvxMSDffTextRectangles*>(mso_sptBentUpArrowTextRect), SAL_N_ELEMENTS( mso_sptBentUpArrowTextRect ), + 21600, 21600, + MIN_INT32, MIN_INT32, + nullptr, 0, + const_cast<SvxMSDffHandle*>(mso_sptBentUpArrowHandle), SAL_N_ELEMENTS( mso_sptBentUpArrowHandle ) +}; + +const SvxMSDffVertPair mso_sptCurvedRightVert[] = +{ + { 0, 0 }, { 23 MSO_I, 3 MSO_I }, { 22 MSO_I, 0 }, { 0, 4 MSO_I }, { 0, 15 MSO_I }, { 23 MSO_I, 1 MSO_I }, { 0, 7 MSO_I }, { 2 MSO_I, 13 MSO_I }, + { 2 MSO_I, 14 MSO_I }, { 22 MSO_I, 8 MSO_I }, { 2 MSO_I, 12 MSO_I }, + { 0, 0 }, { 23 MSO_I, 3 MSO_I }, { 2 MSO_I, 11 MSO_I }, { 26 MSO_I, 17 MSO_I }, { 0, 15 MSO_I }, { 23 MSO_I, 1 MSO_I }, { 26 MSO_I, 17 MSO_I }, { 22 MSO_I, 15 MSO_I }, + { 0, 0 }, { 23 MSO_I, 3 MSO_I }, { 22 MSO_I, 0 }, { 0, 4 MSO_I }, + { 0, 0 }, { 23 MSO_I, 3 MSO_I }, { 0, 4 MSO_I }, { 26 MSO_I, 17 MSO_I }, + { 0, 15 MSO_I }, { 23 MSO_I, 1 MSO_I }, { 26 MSO_I, 17 MSO_I }, { 22 MSO_I, 15 MSO_I } +}; +const sal_uInt16 mso_sptCurvedRightSegm[] = +{ + 0xa404, + 0xa304, + 0x0003, + 0xa508, + 0x6000, + 0x8000, + 0xa404, + 0xa304, + 0xa504, + 0x6000, + 0x8000 +}; +const SvxMSDffCalculationData mso_sptCurvedRightCalc[] = +{ + { 0x2000, { DFF_Prop_adjustValue, 0, 0 } }, + { 0x2000, { DFF_Prop_adjust2Value, 0, 0 } }, + { 0x2000, { DFF_Prop_adjust3Value, 0, 0 } }, + { 0xa000, { DFF_Prop_adjustValue, 21600, DFF_Prop_adjust2Value } }, + { 0x2001, { 0x403, 1, 2 } }, + { 0x6000, { DFF_Prop_adjust2Value, DFF_Prop_adjust2Value, 21600 } }, + { 0xe000, { 0x405, DFF_Prop_adjust2Value, DFF_Prop_adjustValue } }, + { 0x2001, { 0x406, 1, 2 } }, + { 0x4002, { 21600, DFF_Prop_adjustValue, 0 } }, + { 0x8000, { 21600, 0, DFF_Prop_adjust3Value } }, + { 0xa00f, { 0x409, 21600, 0x404 } }, + { 0x6000, { 0x404, 0x40a, 0 } }, + { 0x6000, { 0x40b, DFF_Prop_adjust2Value, 21600 } }, + { 0x6000, { 0x407, 0x40a, 0 } }, + { 0xa000, { 0x40c, 21600, DFF_Prop_adjustValue } }, + { 0xa000, { 0x405, 0, DFF_Prop_adjustValue } }, + { 0x2001, { 0x40f, 1, 2 } }, + { 0x6002, { 0x404, 0x407, 0 } }, + { 0x6000, { DFF_Prop_adjustValue, DFF_Prop_adjust2Value, 21600 } }, + { 0x2001, { 0x412, 1, 2 } }, + { 0xa000, { 0x411, 0, 0x413 } }, + { 0x0000, { 21600, 0, 0 } }, + { 0x0000, { 21600, 0, 0 } }, + { 0x0001, { 21600, 2, 1 } }, + { 0xa000, { 0x411, 0, 0x404 } }, + { 0x600f, { 0x418, 0x404, 21600 } }, + { 0x8000, { 21600, 0, 0x419 } }, + { 0x2000, { 0x408, 128, 0 } }, + { 0x2001, { 0x405, 1, 2 } }, + { 0x2000, { 0x405, 0, 128 } }, + { 0xe000, { DFF_Prop_adjustValue, 0x411, 0x40c } }, + { 0x600f, { 0x414, 0x404, 21600 } }, + { 0x8000, { 21600, 0, DFF_Prop_adjustValue } }, + { 0x2001, { 0x420, 1, 2 } }, + { 0x0001, { 21600, 21600, 1 } }, + { 0x6001, { 0x409, 0x409, 1 } }, + { 0xa000, { 0x422, 0, 0x423 } }, + { 0x200d, { 0x424, 0, 0 } }, + { 0x2000, { 0x425, 21600, 0 } }, + { 0x8001, { 21600, 21600, 0x426 } }, + { 0x2000, { 0x427, 64, 0 } }, + { 0x2001, { DFF_Prop_adjustValue, 1, 2 } }, + { 0x600f, { 0x421, 0x429, 21600 } }, + { 0x8000, { 21600, 0, 0x42a } }, + { 0x2000, { 0x42b, 64, 0 } }, + { 0x2001, { 0x404, 1, 2 } }, + { 0xa000, { DFF_Prop_adjust2Value, 0, 0x42d } }, + { 0x0001, { 21600, 2195, 16384 } }, + { 0x0001, { 21600, 14189, 16384 } } +}; +const sal_Int32 mso_sptCurvedRightDefault[] = +{ + 3, 12960, 19440, 14400 +}; +const SvxMSDffTextRectangles mso_sptCurvedRightTextRect[] = +{ + { { 47 MSO_I, 45 MSO_I }, { 48 MSO_I, 46 MSO_I } } +}; +const SvxMSDffVertPair mso_sptCurvedRightGluePoints[] = +{ + { 0, 17 MSO_I }, { 2 MSO_I, 14 MSO_I }, { 22 MSO_I, 8 MSO_I }, { 2 MSO_I, 12 MSO_I }, { 22 MSO_I, 16 MSO_I } +}; +const SvxMSDffHandle mso_sptCurvedRightHandles[] = +{ + { SvxMSDffHandleFlags::RANGE | SvxMSDffHandleFlags::RANGE_Y_MIN_IS_SPECIAL | SvxMSDffHandleFlags::RANGE_Y_MAX_IS_SPECIAL, + 21600, 0x100, 10800, 10800, 0, 10800, 3 + 40, 3 + 29 }, + { SvxMSDffHandleFlags::RANGE | SvxMSDffHandleFlags::RANGE_Y_MIN_IS_SPECIAL | SvxMSDffHandleFlags::RANGE_Y_MAX_IS_SPECIAL, + 21600, 0x101, 10800, 10800, 0, 10800, 3 + 27, 3 + 21 }, + { SvxMSDffHandleFlags::RANGE | SvxMSDffHandleFlags::RANGE_X_MIN_IS_SPECIAL | SvxMSDffHandleFlags::RANGE_X_MAX_IS_SPECIAL, + 0x102, 21600, 10800, 10800, 3 + 44, 3 + 22, 3375, 21600 } +}; +const mso_CustomShape msoCurvedRightArrow = +{ + const_cast<SvxMSDffVertPair*>(mso_sptCurvedRightVert), SAL_N_ELEMENTS( mso_sptCurvedRightVert ), + const_cast<sal_uInt16*>(mso_sptCurvedRightSegm), sizeof( mso_sptCurvedRightSegm ) >> 1, + const_cast<SvxMSDffCalculationData*>(mso_sptCurvedRightCalc), SAL_N_ELEMENTS( mso_sptCurvedRightCalc ), + const_cast<sal_Int32*>(mso_sptCurvedRightDefault), + const_cast<SvxMSDffTextRectangles*>(mso_sptCurvedRightTextRect), SAL_N_ELEMENTS( mso_sptCurvedRightTextRect ), + 21600, 21600, + MIN_INT32, MIN_INT32, + const_cast<SvxMSDffVertPair*>(mso_sptCurvedRightGluePoints), SAL_N_ELEMENTS( mso_sptCurvedRightGluePoints ), + const_cast<SvxMSDffHandle*>(mso_sptCurvedRightHandles), SAL_N_ELEMENTS( mso_sptCurvedRightHandles ) +}; + +const SvxMSDffVertPair mso_sptCurvedDownVert[] = +{ + { 0, 0 }, { 3 MSO_I, 23 MSO_I }, { 0, 22 MSO_I }, { 4 MSO_I, 0 }, + { 15 MSO_I, 0 }, { 1 MSO_I, 23 MSO_I }, { 7 MSO_I, 0 }, { 13 MSO_I, 2 MSO_I }, + { 14 MSO_I, 2 MSO_I }, { 8 MSO_I, 22 MSO_I }, { 12 MSO_I, 2 MSO_I }, + { 0, 0 }, { 3 MSO_I, 23 MSO_I }, { 11 MSO_I, 2 MSO_I }, { 17 MSO_I, 26 MSO_I }, { 15 MSO_I, 0 }, + { 1 MSO_I, 23 MSO_I }, { 17 MSO_I, 26 MSO_I }, { 15 MSO_I, 22 MSO_I }, + { 0, 0 }, { 3 MSO_I, 23 MSO_I }, { 0, 22 MSO_I }, { 4 MSO_I, 0 }, + { 0, 0 }, { 3 MSO_I, 23 MSO_I }, { 4 MSO_I, 0 }, { 17 MSO_I, 26 MSO_I }, + { 15 MSO_I, 0 }, { 1 MSO_I, 23 MSO_I }, { 17 MSO_I, 26 MSO_I }, { 15 MSO_I, 22 MSO_I } +}; +const sal_uInt16 mso_sptCurvedDownSegm[] = +{ + 0xa604, + 0xa504, + 0x0003, + 0xa308, + 0x6000, + 0x8000, + 0xa604, + 0xa504, + 0xa304, + 0x6000, + 0x8000 +}; +const SvxMSDffTextRectangles mso_sptCurvedDownTextRect[] = +{ + { { 45 MSO_I, 47 MSO_I }, { 46 MSO_I, 48 MSO_I } } +}; +const SvxMSDffVertPair mso_sptCurvedDownGluePoints[] = +{ + { 17 MSO_I, 0 }, { 16 MSO_I, 22 MSO_I }, { 12 MSO_I, 2 MSO_I }, { 8 MSO_I, 22 MSO_I }, { 14 MSO_I, 2 MSO_I } +}; +const SvxMSDffHandle mso_sptCurvedDownHandles[] = +{ + { SvxMSDffHandleFlags::RANGE | SvxMSDffHandleFlags::RANGE_X_MIN_IS_SPECIAL | SvxMSDffHandleFlags::RANGE_X_MAX_IS_SPECIAL, + 0x100, 21600, 10800, 10800, 3 + 40, 3 + 29, 0, 10800 }, + { SvxMSDffHandleFlags::RANGE | SvxMSDffHandleFlags::RANGE_X_MIN_IS_SPECIAL | SvxMSDffHandleFlags::RANGE_X_MAX_IS_SPECIAL, + 0x101, 21600, 10800, 10800, 3 + 27, 3 + 21, 0, 10800 }, + { SvxMSDffHandleFlags::RANGE | SvxMSDffHandleFlags::RANGE_Y_MIN_IS_SPECIAL | SvxMSDffHandleFlags::RANGE_Y_MAX_IS_SPECIAL, + 21600, 0x102, 10800, 10800, 3375, 21600, 3 + 44, 3 + 22 } +}; + +const mso_CustomShape msoCurvedDownArrow = +{ + const_cast<SvxMSDffVertPair*>(mso_sptCurvedDownVert), SAL_N_ELEMENTS( mso_sptCurvedDownVert ), + const_cast<sal_uInt16*>(mso_sptCurvedDownSegm), sizeof( mso_sptCurvedDownSegm ) >> 1, + const_cast<SvxMSDffCalculationData*>(mso_sptCurvedRightCalc), SAL_N_ELEMENTS( mso_sptCurvedRightCalc ), + const_cast<sal_Int32*>(mso_sptCurvedRightDefault), + const_cast<SvxMSDffTextRectangles*>(mso_sptCurvedDownTextRect), SAL_N_ELEMENTS( mso_sptCurvedDownTextRect ), + 21600, 21600, + MIN_INT32, MIN_INT32, + const_cast<SvxMSDffVertPair*>(mso_sptCurvedDownGluePoints), SAL_N_ELEMENTS( mso_sptCurvedDownGluePoints ), + const_cast<SvxMSDffHandle*>(mso_sptCurvedDownHandles), SAL_N_ELEMENTS( mso_sptCurvedDownHandles ) +}; + +const SvxMSDffVertPair mso_sptCurvedUpVert[] = +{ + { 0, 22 MSO_I }, { 3 MSO_I, 21 MSO_I }, { 0, 0 }, { 4 MSO_I, 21 MSO_I }, + { 14 MSO_I, 22 MSO_I }, { 1 MSO_I, 21 MSO_I }, { 7 MSO_I, 21 MSO_I }, + { 12 MSO_I, 2 MSO_I }, { 13 MSO_I, 2 MSO_I }, { 8 MSO_I, 0 }, { 11 MSO_I, 2 MSO_I }, + { 0, 22 MSO_I }, { 3 MSO_I, 21 MSO_I }, { 10 MSO_I, 2 MSO_I }, { 16 MSO_I, 24 MSO_I }, + { 14 MSO_I, 22 MSO_I }, { 1 MSO_I, 21 MSO_I }, { 16 MSO_I, 24 MSO_I }, { 14 MSO_I, 0 }, + { 0, 22 MSO_I }, { 3 MSO_I, 21 MSO_I }, { 0, 0 }, { 4 MSO_I, 21 MSO_I }, + { 14 MSO_I, 22 MSO_I }, { 1 MSO_I, 21 MSO_I }, { 7 MSO_I, 21 MSO_I }, { 16 MSO_I, 24 MSO_I }, + { 14 MSO_I, 22 MSO_I }, { 1 MSO_I, 21 MSO_I }, { 16 MSO_I, 24 MSO_I }, { 14 MSO_I, 0 } +}; +const sal_uInt16 mso_sptCurvedUpSegm[] = +{ + 0xa404, + 0xa304, + 0x0003, + 0xa508, + 0x6000, + 0x8000, + 0xa404, + 0xa508, + 0xa504, + 0x6000, + 0x8000 +}; +const SvxMSDffCalculationData mso_sptCurvedUpCalc[] = +{ + { 0x2000, { DFF_Prop_adjustValue, 0, 0 } }, + { 0x2000, { DFF_Prop_adjust2Value, 0, 0 } }, + { 0x2000, { DFF_Prop_adjust3Value, 0, 0 } }, + { 0xa000, { DFF_Prop_adjustValue, 21600, DFF_Prop_adjust2Value } }, + { 0x2001, { 0x403, 1, 2 } }, + { 0x6000, { DFF_Prop_adjust2Value, DFF_Prop_adjust2Value, 21600 } }, + { 0xe000, { 0x405, DFF_Prop_adjust2Value, DFF_Prop_adjustValue } }, + { 0x2001, { 0x406, 1, 2 } }, + { 0x4002, { 21600, DFF_Prop_adjustValue, 0 } }, + { 0xa00f, { DFF_Prop_adjust3Value, 21600, 0x404 } }, + { 0x6000, { 0x404, 0x409, 0 } }, + { 0x6000, { 0x40a, DFF_Prop_adjust2Value, 21600 } }, + { 0x6000, { 0x407, 0x409, 0 } }, + { 0xa000, { 0x40b, 21600, DFF_Prop_adjustValue } }, + { 0xa000, { 0x405, 0, DFF_Prop_adjustValue } }, + { 0x2001, { 0x40e, 1, 2 } }, + { 0x6002, { 0x404, 0x407, 0 } }, + { 0x6000, { DFF_Prop_adjustValue, DFF_Prop_adjust2Value, 21600 } }, + { 0x2001, { 0x411, 1, 2 } }, + { 0xa000, { 0x410, 0, 0x412 } }, + { 0x0000, { 21600, 0, 0 } }, + { 0x0000, { 21600, 0, 0 } }, + { 0x0000, { 0, 0, 21600 } }, + { 0xa000, { 0x410, 0, 0x404 } }, + { 0x600f, { 0x417, 0x404, 21600 } }, + { 0x2000, { 0x408, 128, 0 } }, + { 0x2001, { 0x405, 1, 2 } }, + { 0x2000, { 0x405, 0, 128 } }, + { 0xe000, { DFF_Prop_adjustValue, 0x410, 0x40b } }, + { 0x8000, { 21600, 0, DFF_Prop_adjustValue } }, + { 0x2001, { 0x41d, 1, 2 } }, + { 0x0001, { 21600, 21600, 1 } }, + { 0x6001, { DFF_Prop_adjust3Value, DFF_Prop_adjust3Value, 1 } }, + { 0xa000, { 0x41f, 0, 0x420 } }, + { 0x200d, { 0x421, 0, 0 } }, + { 0x2000, { 0x422, 21600, 0 } }, + { 0x8001, { 21600, 21600, 0x423 } }, + { 0x2000, { 0x424, 64, 0 } }, + { 0x2001, { DFF_Prop_adjustValue, 1, 2 } }, + { 0x600f, { 0x41e, 0x426, 21600 } }, + { 0x2000, { 0x427, 0, 64 } }, + { 0x2001, { 0x404, 1, 2 } }, + { 0xa000, { DFF_Prop_adjust2Value, 0, 0x429 } }, + { 0x0001, { 21600, 2195, 16384 } }, + { 0x0001, { 21600, 14189, 16384 } } +}; +const sal_Int32 mso_sptCurvedUpDefault[] = +{ + 3, 12960, 19440, 7200 +}; +const SvxMSDffTextRectangles mso_sptCurvedUpTextRect[] = +{ + { { 41 MSO_I, 43 MSO_I }, { 42 MSO_I, 44 MSO_I } } +}; +const SvxMSDffVertPair mso_sptCurvedUpGluePoints[] = +{ + { 8 MSO_I, 0 }, { 11 MSO_I, 2 MSO_I }, { 15 MSO_I, 0 }, { 16 MSO_I, 21 MSO_I }, { 13 MSO_I, 2 MSO_I } +}; +const SvxMSDffHandle mso_sptCurvedUpHandles[] = +{ + { SvxMSDffHandleFlags::RANGE | SvxMSDffHandleFlags::RANGE_X_MIN_IS_SPECIAL | SvxMSDffHandleFlags::RANGE_X_MAX_IS_SPECIAL, + 0x100, 0, 10800, 10800, 3 + 37, 3 + 27, 0, 10800 }, + { SvxMSDffHandleFlags::RANGE | SvxMSDffHandleFlags::RANGE_X_MIN_IS_SPECIAL | SvxMSDffHandleFlags::RANGE_X_MAX_IS_SPECIAL, + 0x101, 0, 10800, 10800, 3 + 25, 3 + 20, 0, 10800 }, + { SvxMSDffHandleFlags::RANGE | SvxMSDffHandleFlags::RANGE_Y_MAX_IS_SPECIAL, + 21600, 0x102, 10800, 10800, 3375, 21600, 0, 3 + 40 } +}; +const mso_CustomShape msoCurvedUpArrow = +{ + const_cast<SvxMSDffVertPair*>(mso_sptCurvedUpVert), SAL_N_ELEMENTS( mso_sptCurvedUpVert ), + const_cast<sal_uInt16*>(mso_sptCurvedUpSegm), sizeof( mso_sptCurvedUpSegm ) >> 1, + const_cast<SvxMSDffCalculationData*>(mso_sptCurvedUpCalc), SAL_N_ELEMENTS( mso_sptCurvedUpCalc ), + const_cast<sal_Int32*>(mso_sptCurvedUpDefault), + const_cast<SvxMSDffTextRectangles*>(mso_sptCurvedUpTextRect), SAL_N_ELEMENTS( mso_sptCurvedUpTextRect ), + 21600, 21600, + MIN_INT32, MIN_INT32, + const_cast<SvxMSDffVertPair*>(mso_sptCurvedUpGluePoints), SAL_N_ELEMENTS( mso_sptCurvedUpGluePoints ), + const_cast<SvxMSDffHandle*>(mso_sptCurvedUpHandles), SAL_N_ELEMENTS( mso_sptCurvedUpHandles ) +}; + +const SvxMSDffVertPair mso_sptCurvedLeftVert[] = +{ + { 22 MSO_I, 0 }, { 21 MSO_I, 3 MSO_I }, { 0, 0 }, { 21 MSO_I, 4 MSO_I }, + { 22 MSO_I, 14 MSO_I }, { 21 MSO_I, 1 MSO_I }, { 21 MSO_I, 7 MSO_I }, { 2 MSO_I, 12 MSO_I }, + { 2 MSO_I, 13 MSO_I }, { 0, 8 MSO_I }, { 2 MSO_I, 11 MSO_I }, + { 22 MSO_I, 0 }, { 21 MSO_I, 3 MSO_I }, { 2 MSO_I, 10 MSO_I }, { 24 MSO_I, 16 MSO_I }, + { 22 MSO_I, 14 MSO_I }, { 21 MSO_I, 1 MSO_I }, { 24 MSO_I, 16 MSO_I }, { 0, 14 MSO_I }, + { 22 MSO_I, 0 }, { 21 MSO_I, 3 MSO_I }, { 0, 0 }, { 21 MSO_I, 4 MSO_I }, + { 22 MSO_I, 14 MSO_I }, { 21 MSO_I, 1 MSO_I }, { 21 MSO_I, 7 MSO_I }, { 24 MSO_I, 16 MSO_I }, + { 22 MSO_I, 14 MSO_I }, { 21 MSO_I, 1 MSO_I }, { 24 MSO_I, 16 MSO_I }, { 0, 14 MSO_I } +}; +const sal_uInt16 mso_sptCurvedLeftSegm[] = +{ + 0xa604, + 0xa504, + 0x0003, + 0xa308, + 0x6000, + 0x8000, + 0xa604, + 0xa308, + 0x6000, + 0x8000 +}; +const SvxMSDffTextRectangles mso_sptCurvedLeftTextRect[] = +{ + { { 43 MSO_I, 41 MSO_I }, { 44 MSO_I, 42 MSO_I } } +}; +const SvxMSDffVertPair mso_sptCurvedLeftGluePoints[] = +{ + { 0, 15 MSO_I }, { 2 MSO_I, 11 MSO_I }, { 0, 8 MSO_I }, { 2 MSO_I, 13 MSO_I }, { 21 MSO_I, 16 MSO_I } +}; +const SvxMSDffHandle mso_sptCurvedLeftHandles[] = +{ + { SvxMSDffHandleFlags::RANGE | SvxMSDffHandleFlags::RANGE_Y_MIN_IS_SPECIAL | SvxMSDffHandleFlags::RANGE_Y_MAX_IS_SPECIAL, + 0, 0x100, 10800, 10800, 0, 10800, 3 + 37, 3 + 27 }, + { SvxMSDffHandleFlags::RANGE | SvxMSDffHandleFlags::RANGE_Y_MIN_IS_SPECIAL | SvxMSDffHandleFlags::RANGE_Y_MAX_IS_SPECIAL, + 0, 0x101, 10800, 10800, 0, 10800, 3 + 25, 3 + 20 }, + { SvxMSDffHandleFlags::RANGE | SvxMSDffHandleFlags::RANGE_X_MAX_IS_SPECIAL, + 0x102, 21600, 10800, 10800, 0, 3 + 40, 3375, 21600 } +}; +const mso_CustomShape msoCurvedLeftArrow = +{ + const_cast<SvxMSDffVertPair*>(mso_sptCurvedLeftVert), SAL_N_ELEMENTS( mso_sptCurvedLeftVert ), + const_cast<sal_uInt16*>(mso_sptCurvedLeftSegm), sizeof( mso_sptCurvedLeftSegm ) >> 1, + const_cast<SvxMSDffCalculationData*>(mso_sptCurvedUpCalc), SAL_N_ELEMENTS( mso_sptCurvedUpCalc ), + const_cast<sal_Int32*>(mso_sptCurvedUpDefault), + const_cast<SvxMSDffTextRectangles*>(mso_sptCurvedLeftTextRect), SAL_N_ELEMENTS( mso_sptCurvedLeftTextRect ), + 21600, 21600, + MIN_INT32, MIN_INT32, + const_cast<SvxMSDffVertPair*>(mso_sptCurvedLeftGluePoints), SAL_N_ELEMENTS( mso_sptCurvedLeftGluePoints ), + const_cast<SvxMSDffHandle*>(mso_sptCurvedLeftHandles), SAL_N_ELEMENTS( mso_sptCurvedLeftHandles ) +}; + +const SvxMSDffVertPair mso_sptStripedRightArrowVert[] = // adjustment1 : x 3375 - 21600 +{ // adjustment2 : y 0 - 10800 + { 3375, 0 MSO_I }, { 1 MSO_I, 0 MSO_I }, { 1 MSO_I, 0 }, { 21600, 10800 }, + { 1 MSO_I, 21600 }, { 1 MSO_I, 2 MSO_I }, { 3375, 2 MSO_I }, { 0, 0 MSO_I }, + { 675, 0 MSO_I }, { 675, 2 MSO_I }, { 0, 2 MSO_I }, { 1350, 0 MSO_I }, + { 2700, 0 MSO_I }, { 2700, 2 MSO_I }, { 1350, 2 MSO_I } +}; +const sal_uInt16 mso_sptStripedRightArrowSegm[] = +{ + 0x4000, 0x0006, 0x6001, 0x8000, + 0x4000, 0x0003, 0x6001, 0x8000, + 0x4000, 0x0003, 0x6001, 0x8000 +}; +const SvxMSDffCalculationData mso_sptStripedRightArrowCalc[] = +{ + { 0x2000, { DFF_Prop_adjust2Value, 0, 0 } }, + { 0x2000, { DFF_Prop_adjustValue, 0, 0 } }, + { 0x8000, { 21600, 0, DFF_Prop_adjust2Value } }, + { 0x8000, { 21600, 0, 0x401 } }, + { 0x6001, { 0x403, 0x400, 10800 } }, + { 0x6000, { 0x401, 0x404, 0 } } +}; +const SvxMSDffTextRectangles mso_sptStripedRightArrowTextRect[] = +{ + { { 3375, 0 MSO_I }, { 5 MSO_I, 2 MSO_I } } +}; +const SvxMSDffHandle mso_sptStripedRightArrowHandle[] = +{ + { SvxMSDffHandleFlags::RANGE, + 0x100, 0x101, 10800, 10800, 3375, 21600, 0, 10800 } +}; +const mso_CustomShape msoStripedRightArrow = +{ + const_cast<SvxMSDffVertPair*>(mso_sptStripedRightArrowVert), SAL_N_ELEMENTS( mso_sptStripedRightArrowVert ), + const_cast<sal_uInt16*>(mso_sptStripedRightArrowSegm), sizeof( mso_sptStripedRightArrowSegm ) >> 1, + const_cast<SvxMSDffCalculationData*>(mso_sptStripedRightArrowCalc), SAL_N_ELEMENTS( mso_sptStripedRightArrowCalc ), + const_cast<sal_Int32*>(mso_sptDefault16200and5400), + const_cast<SvxMSDffTextRectangles*>(mso_sptStripedRightArrowTextRect), SAL_N_ELEMENTS( mso_sptStripedRightArrowTextRect ), + 21600, 21600, + MIN_INT32, MIN_INT32, + nullptr, 0, + const_cast<SvxMSDffHandle*>(mso_sptStripedRightArrowHandle), SAL_N_ELEMENTS( mso_sptStripedRightArrowHandle ) +}; + +const SvxMSDffVertPair mso_sptNotchedRightArrowVert[] = // adjustment1 : x 0 - 21600 (default 16200) +{ // adjustment2 : y 0 - 10800 (default 5400) + { 0, 1 MSO_I }, { 0 MSO_I, 1 MSO_I }, { 0 MSO_I, 0 }, { 21600, 10800 }, + { 0 MSO_I, 21600 }, { 0 MSO_I, 2 MSO_I }, { 0, 2 MSO_I }, { 5 MSO_I, 10800 }, { 0, 1 MSO_I } +}; +const SvxMSDffCalculationData mso_sptNotchedRightArrowCalc[] = +{ + { 0x2000, { DFF_Prop_adjustValue, 0, 0 } }, + { 0x2000, { DFF_Prop_adjust2Value, 0, 0 } }, + { 0x8000, { 21600, 0, DFF_Prop_adjust2Value } }, + { 0x8000, { 21600, 0, DFF_Prop_adjustValue } }, + { 0x8000, { 10800, 0, DFF_Prop_adjust2Value } }, + { 0x6001, { 0x403, 0x404, 10800 } }, + { 0x8000, { 21600, 0, 0x405 }} +}; +const SvxMSDffTextRectangles mso_sptNotchedRightArrowTextRect[] = // todo +{ + { { 5 MSO_I, 1 MSO_I }, { 6 MSO_I, 2 MSO_I } } +}; +const SvxMSDffHandle mso_sptNotchedRightArrowHandle[] = +{ + { SvxMSDffHandleFlags::RANGE, + 0x100, 0x101, 10800, 10800, 0, 21600, 0, 10800 } +}; +const mso_CustomShape msoNotchedRightArrow = +{ + const_cast<SvxMSDffVertPair*>(mso_sptNotchedRightArrowVert), SAL_N_ELEMENTS( mso_sptNotchedRightArrowVert ), + nullptr, 0, + const_cast<SvxMSDffCalculationData*>(mso_sptNotchedRightArrowCalc), SAL_N_ELEMENTS( mso_sptNotchedRightArrowCalc ), + const_cast<sal_Int32*>(mso_sptDefault16200and5400), + const_cast<SvxMSDffTextRectangles*>(mso_sptNotchedRightArrowTextRect), SAL_N_ELEMENTS( mso_sptNotchedRightArrowTextRect ), + 21600, 21600, + MIN_INT32, MIN_INT32, + nullptr, 0, + const_cast<SvxMSDffHandle*>(mso_sptNotchedRightArrowHandle), SAL_N_ELEMENTS( mso_sptNotchedRightArrowHandle ) +}; + +const SvxMSDffVertPair mso_sptHomePlateVert[] = // adjustment1 : x 0 - 21600 +{ + { 0, 0 }, { 0 MSO_I, 0 }, { 21600, 10800 }, { 0 MSO_I, 21600 }, + { 0, 21600 } +}; +const sal_uInt16 mso_sptHomePlateSegm[] = +{ + 0x4000, 0x0004, 0x6001, 0x8000 +}; +const SvxMSDffCalculationData mso_sptHomePlateCalc[] = +{ + { 0x2000, { DFF_Prop_adjustValue, 0, 0 } } +}; +const sal_Int32 mso_sptHomePlateDefault[] = +{ + 1, 16200 +}; +const SvxMSDffTextRectangles mso_sptHomePlateTextRect[] = // todo +{ + { { 0, 0 }, { 21600, 21600 } } +}; +const SvxMSDffHandle mso_sptHomePlateHandle[] = +{ + { SvxMSDffHandleFlags::RANGE, + 0x100, 0, 10800, 10800, 0, 21600, MIN_INT32, 0x7fffffff } +}; +const mso_CustomShape msoHomePlate = +{ + const_cast<SvxMSDffVertPair*>(mso_sptHomePlateVert), SAL_N_ELEMENTS( mso_sptHomePlateVert ), + const_cast<sal_uInt16*>(mso_sptHomePlateSegm), sizeof( mso_sptHomePlateSegm ) >> 1, + const_cast<SvxMSDffCalculationData*>(mso_sptHomePlateCalc), SAL_N_ELEMENTS( mso_sptHomePlateCalc ), + const_cast<sal_Int32*>(mso_sptHomePlateDefault), + const_cast<SvxMSDffTextRectangles*>(mso_sptHomePlateTextRect), SAL_N_ELEMENTS( mso_sptHomePlateTextRect ), + 21600, 21600, + MIN_INT32, MIN_INT32, + nullptr, 0, + const_cast<SvxMSDffHandle*>(mso_sptHomePlateHandle), SAL_N_ELEMENTS( mso_sptHomePlateHandle ) +}; + +const SvxMSDffVertPair mso_sptChevronVert[] = // adjustment1 : x 0 - 21600 +{ + { 0, 0 }, { 0 MSO_I, 0 }, { 21600, 10800 }, { 0 MSO_I, 21600 }, + { 0, 21600 }, { 1 MSO_I, 10800 } +}; +const sal_uInt16 mso_sptChevronSegm[] = +{ + 0x4000, 0x0005, 0x6001, 0x8000 +}; +const SvxMSDffCalculationData mso_sptChevronCalc[] = +{ + { 0x2000, { DFF_Prop_adjustValue, 0, 0 } }, + { 0x8000, { 21600, 0, 0x0400 } } +}; +const sal_Int32 mso_sptChevronDefault[] = +{ + 1, 16200 +}; +const SvxMSDffTextRectangles mso_sptChevronTextRect[] = // todo +{ + { { 0, 0 }, { 21600, 21600 } } +}; +const SvxMSDffHandle mso_sptChevronHandle[] = +{ + { SvxMSDffHandleFlags::RANGE, + 0x100, 0, 10800, 10800, 0, 21600, MIN_INT32, 0x7fffffff } +}; +const mso_CustomShape msoChevron = +{ + const_cast<SvxMSDffVertPair*>(mso_sptChevronVert), SAL_N_ELEMENTS( mso_sptChevronVert ), + const_cast<sal_uInt16*>(mso_sptChevronSegm), sizeof( mso_sptChevronSegm ) >> 1, + const_cast<SvxMSDffCalculationData*>(mso_sptChevronCalc), SAL_N_ELEMENTS( mso_sptChevronCalc ), + const_cast<sal_Int32*>(mso_sptChevronDefault), + const_cast<SvxMSDffTextRectangles*>(mso_sptChevronTextRect), SAL_N_ELEMENTS( mso_sptChevronTextRect ), + 21600, 21600, + MIN_INT32, MIN_INT32, + nullptr, 0, + const_cast<SvxMSDffHandle*>(mso_sptChevronHandle), SAL_N_ELEMENTS( mso_sptChevronHandle ) +}; + +const SvxMSDffVertPair mso_sptRightArrowCalloutVert[] = // adjustment1 : x 0 - 21000 +{ // adjustment2 : y 0 - 10800 + { 0, 0 }, { 0 MSO_I, 0 }, { 0 MSO_I, 3 MSO_I }, { 2 MSO_I, 3 MSO_I }, + { 2 MSO_I, 1 MSO_I }, { 21600, 10800 }, { 2 MSO_I, 4 MSO_I }, { 2 MSO_I, 5 MSO_I }, + { 0 MSO_I, 5 MSO_I }, { 0 MSO_I, 21600 }, { 0, 21600 } +}; +const sal_uInt16 mso_sptRightArrowCalloutSegm[] = +{ + 0x4000, 0x000a, 0x6001, 0x8000 +}; +const SvxMSDffCalculationData mso_sptRightArrowCalloutCalc[] = +{ + { 0x2000, { DFF_Prop_adjustValue, 0, 0 } }, + { 0x2000, { DFF_Prop_adjust2Value, 0, 0 } }, + { 0x2000, { DFF_Prop_adjust3Value, 0, 0 } }, + { 0x2000, { DFF_Prop_adjust4Value, 0, 0 } }, + { 0x8000, { 21600, 0, 0x0401 } }, + { 0x8000, { 21600, 0, 0x0403 } } +}; +const sal_Int32 mso_sptRightArrowCalloutDefault[] = +{ + 4, 14400, 5400, 18000, 8100 +}; +const SvxMSDffTextRectangles mso_sptRightArrowCalloutTextRect[] = +{ + { { 0, 0 }, { 0 MSO_I, 21600 } } +}; +const SvxMSDffHandle mso_sptRightArrowCalloutHandle[] = +{ + { SvxMSDffHandleFlags::RANGE | SvxMSDffHandleFlags::RANGE_X_MAX_IS_SPECIAL, + 0x100, 0, 10800, 10800, 0, 0x102, MIN_INT32, 0x7fffffff }, + { SvxMSDffHandleFlags::RANGE | SvxMSDffHandleFlags::RANGE_X_MIN_IS_SPECIAL | SvxMSDffHandleFlags::RANGE_Y_MIN_IS_SPECIAL, + 0x102, 0x103, 10800, 10800, 0x100, 21600, 0x101, 10800 }, + { SvxMSDffHandleFlags::RANGE | SvxMSDffHandleFlags::RANGE_Y_MAX_IS_SPECIAL, + 1, 0x101, 10800, 10800, MIN_INT32, 0x7fffffff, 0, 0x103 } +}; +const mso_CustomShape msoRightArrowCallout = +{ + const_cast<SvxMSDffVertPair*>(mso_sptRightArrowCalloutVert), SAL_N_ELEMENTS( mso_sptRightArrowCalloutVert ), + const_cast<sal_uInt16*>(mso_sptRightArrowCalloutSegm), sizeof( mso_sptRightArrowCalloutSegm ) >> 1, + const_cast<SvxMSDffCalculationData*>(mso_sptRightArrowCalloutCalc), SAL_N_ELEMENTS( mso_sptRightArrowCalloutCalc ), + const_cast<sal_Int32*>(mso_sptRightArrowCalloutDefault), + const_cast<SvxMSDffTextRectangles*>(mso_sptRightArrowCalloutTextRect), SAL_N_ELEMENTS( mso_sptRightArrowCalloutTextRect ), + 21600, 21600, + MIN_INT32, MIN_INT32, + nullptr, 0, + const_cast<SvxMSDffHandle*>(mso_sptRightArrowCalloutHandle), SAL_N_ELEMENTS( mso_sptRightArrowCalloutHandle ) +}; + +const SvxMSDffVertPair mso_sptLeftArrowCalloutVert[] = // adjustment1 : x 0 - 21600, adjustment2 : y 0 - 10800 +{ // adjustment3 : x 0 - 21600, adjustment4 : y 0 - 10800 + { 0 MSO_I, 0 }, { 21600, 0 }, { 21600, 21600 }, { 0 MSO_I, 21600 }, + { 0 MSO_I, 5 MSO_I }, { 2 MSO_I, 5 MSO_I }, { 2 MSO_I, 4 MSO_I }, { 0, 10800 }, + { 2 MSO_I, 1 MSO_I }, { 2 MSO_I, 3 MSO_I }, { 0 MSO_I, 3 MSO_I } +}; +const sal_uInt16 mso_sptLeftArrowCalloutSegm[] = +{ + 0x4000, 0x000a, 0x6001, 0x8000 +}; +const SvxMSDffCalculationData mso_sptLeftArrowCalloutCalc[] = +{ + { 0x2000, { DFF_Prop_adjustValue, 0, 0 } }, + { 0x2000, { DFF_Prop_adjust2Value, 0, 0 } }, + { 0x2000, { DFF_Prop_adjust3Value, 0, 0 } }, + { 0x2000, { DFF_Prop_adjust4Value, 0, 0 } }, + { 0x8000, { 21600, 0, 0x0401 } }, + { 0x8000, { 21600, 0, 0x0403 } } +}; +const sal_Int32 mso_sptLeftArrowCalloutDefault[] = +{ + 4, 7200, 5400, 3600, 8100 +}; +const SvxMSDffTextRectangles mso_sptLeftArrowCalloutTextRect[] = +{ + { { 0 MSO_I, 0 }, { 21600, 21600 } } +}; +const SvxMSDffHandle mso_sptLeftArrowCalloutHandle[] = +{ + { SvxMSDffHandleFlags::RANGE | SvxMSDffHandleFlags::RANGE_X_MIN_IS_SPECIAL, + 0x100, 0, 10800, 10800, 0x102, 21600, MIN_INT32, 0x7fffffff }, + { SvxMSDffHandleFlags::RANGE | SvxMSDffHandleFlags::RANGE_X_MAX_IS_SPECIAL | SvxMSDffHandleFlags::RANGE_Y_MIN_IS_SPECIAL, + 0x102, 0x103, 10800, 10800, 0, 0x100, 0x101, 10800 }, + { SvxMSDffHandleFlags::RANGE | SvxMSDffHandleFlags::RANGE_Y_MAX_IS_SPECIAL, + 0, 0x101, 10800, 10800, MIN_INT32, 0x7fffffff, 0, 0x103 } +}; +const mso_CustomShape msoLeftArrowCallout = +{ + const_cast<SvxMSDffVertPair*>(mso_sptLeftArrowCalloutVert), SAL_N_ELEMENTS( mso_sptLeftArrowCalloutVert ), + const_cast<sal_uInt16*>(mso_sptLeftArrowCalloutSegm), sizeof( mso_sptLeftArrowCalloutSegm ) >> 1, + const_cast<SvxMSDffCalculationData*>(mso_sptLeftArrowCalloutCalc), SAL_N_ELEMENTS( mso_sptLeftArrowCalloutCalc ), + const_cast<sal_Int32*>(mso_sptLeftArrowCalloutDefault), + const_cast<SvxMSDffTextRectangles*>(mso_sptLeftArrowCalloutTextRect), SAL_N_ELEMENTS( mso_sptLeftArrowCalloutTextRect ), + 21600, 21600, + MIN_INT32, MIN_INT32, + nullptr, 0, + const_cast<SvxMSDffHandle*>(mso_sptLeftArrowCalloutHandle), SAL_N_ELEMENTS( mso_sptLeftArrowCalloutHandle ) +}; + +const SvxMSDffVertPair mso_sptUpArrowCalloutVert[] = +{ + { 21600, 0 MSO_I }, { 21600, 21600 }, { 0, 21600 }, { 0, 0 MSO_I }, + { 3 MSO_I, 0 MSO_I }, { 3 MSO_I, 2 MSO_I }, { 1 MSO_I, 2 MSO_I }, { 10800, 0 }, + { 4 MSO_I, 2 MSO_I }, { 5 MSO_I, 2 MSO_I }, { 5 MSO_I, 0 MSO_I } +}; +const sal_uInt16 mso_sptUpArrowCalloutSegm[] = +{ + 0x4000, 0x000a, 0x6001, 0x8000 +}; +const SvxMSDffCalculationData mso_sptUpArrowCalloutCalc[] = +{ + { 0x2000, { DFF_Prop_adjustValue, 0, 0 } }, + { 0x2000, { DFF_Prop_adjust2Value, 0, 0 } }, + { 0x2000, { DFF_Prop_adjust3Value, 0, 0 } }, + { 0x2000, { DFF_Prop_adjust4Value, 0, 0 } }, + { 0x8000, { 21600, 0, 0x0401 } }, + { 0x8000, { 21600, 0, 0x0403 } } +}; +const sal_Int32 mso_sptUpArrowCalloutDefault[] = +{ + 4, 7200, 5400, 3600, 8100 +}; +const SvxMSDffTextRectangles mso_sptUpArrowCalloutTextRect[] = +{ + { { 0, 0 MSO_I }, { 21600, 21600 } } +}; +const SvxMSDffHandle mso_sptUpArrowCalloutHandle[] = +{ + { SvxMSDffHandleFlags::RANGE | SvxMSDffHandleFlags::RANGE_Y_MIN_IS_SPECIAL, + 0, 0x100, 10800, 10800, MIN_INT32, 0x7fffffff, 0x102, 21600 }, + { SvxMSDffHandleFlags::RANGE | SvxMSDffHandleFlags::RANGE_X_MIN_IS_SPECIAL | SvxMSDffHandleFlags::RANGE_Y_MAX_IS_SPECIAL, + 0x103, 0x102, 10800, 10800, 0x101, 10800, 0, 0x100 }, + { SvxMSDffHandleFlags::RANGE | SvxMSDffHandleFlags::RANGE_X_MAX_IS_SPECIAL, + 0x101, 0, 10800, 10800, 0, 0x103, MIN_INT32, 0x7fffffff } +}; +const mso_CustomShape msoUpArrowCallout = +{ + const_cast<SvxMSDffVertPair*>(mso_sptUpArrowCalloutVert), SAL_N_ELEMENTS( mso_sptUpArrowCalloutVert ), + const_cast<sal_uInt16*>(mso_sptUpArrowCalloutSegm), sizeof( mso_sptUpArrowCalloutSegm ) >> 1, + const_cast<SvxMSDffCalculationData*>(mso_sptUpArrowCalloutCalc), SAL_N_ELEMENTS( mso_sptUpArrowCalloutCalc ), + const_cast<sal_Int32*>(mso_sptUpArrowCalloutDefault), + const_cast<SvxMSDffTextRectangles*>(mso_sptUpArrowCalloutTextRect), SAL_N_ELEMENTS( mso_sptUpArrowCalloutTextRect ), + 21600, 21600, + MIN_INT32, MIN_INT32, + nullptr, 0, + const_cast<SvxMSDffHandle*>(mso_sptUpArrowCalloutHandle), SAL_N_ELEMENTS( mso_sptUpArrowCalloutHandle ) +}; + +const SvxMSDffVertPair mso_sptDownArrowCalloutVert[] = +{ + { 0, 0 MSO_I }, { 0, 0 }, { 21600, 0 }, { 21600, 0 MSO_I }, + { 5 MSO_I, 0 MSO_I }, { 5 MSO_I, 2 MSO_I }, { 4 MSO_I, 2 MSO_I }, { 10800, 21600 }, + { 1 MSO_I, 2 MSO_I }, { 3 MSO_I, 2 MSO_I }, { 3 MSO_I, 0 MSO_I } +}; +const sal_uInt16 mso_sptDownArrowCalloutSegm[] = +{ + 0x4000, 0x000a, 0x6001, 0x8000 +}; +const SvxMSDffCalculationData mso_sptDownArrowCalloutCalc[] = +{ + { 0x2000, { DFF_Prop_adjustValue, 0, 0 } }, + { 0x2000, { DFF_Prop_adjust2Value, 0, 0 } }, + { 0x2000, { DFF_Prop_adjust3Value, 0, 0 } }, + { 0x2000, { DFF_Prop_adjust4Value, 0, 0 } }, + { 0x8000, { 21600, 0, 0x0401 } }, + { 0x8000, { 21600, 0, 0x0403 } } +}; +const sal_Int32 mso_sptDownArrowCalloutDefault[] = +{ + 4, 14400, 5400, 18000, 8100 +}; +const SvxMSDffTextRectangles mso_sptDownArrowCalloutTextRect[] = +{ + { { 0, 0 }, { 21600, 0 MSO_I } } +}; +const SvxMSDffHandle mso_sptDownArrowCalloutHandle[] = +{ + { SvxMSDffHandleFlags::RANGE | SvxMSDffHandleFlags::RANGE_Y_MAX_IS_SPECIAL, + 0, 0x100, 10800, 10800, MIN_INT32, 0x7fffffff, 0, 0x102 }, + { SvxMSDffHandleFlags::RANGE | SvxMSDffHandleFlags::RANGE_X_MIN_IS_SPECIAL | SvxMSDffHandleFlags::RANGE_Y_MIN_IS_SPECIAL, + 0x103, 0x102, 10800, 10800, 0x101, 10800, 0x100, 21600 }, + { SvxMSDffHandleFlags::RANGE | SvxMSDffHandleFlags::RANGE_X_MAX_IS_SPECIAL, + 0x101, 1, 10800, 10800, 0, 0x103, MIN_INT32, 0x7fffffff } +}; +const mso_CustomShape msoDownArrowCallout = +{ + const_cast<SvxMSDffVertPair*>(mso_sptDownArrowCalloutVert), SAL_N_ELEMENTS( mso_sptDownArrowCalloutVert ), + const_cast<sal_uInt16*>(mso_sptDownArrowCalloutSegm), sizeof( mso_sptDownArrowCalloutSegm ) >> 1, + const_cast<SvxMSDffCalculationData*>(mso_sptDownArrowCalloutCalc), SAL_N_ELEMENTS( mso_sptDownArrowCalloutCalc ), + const_cast<sal_Int32*>(mso_sptDownArrowCalloutDefault), + const_cast<SvxMSDffTextRectangles*>(mso_sptDownArrowCalloutTextRect), SAL_N_ELEMENTS( mso_sptDownArrowCalloutTextRect ), + 21600, 21600, + MIN_INT32, MIN_INT32, + nullptr, 0, + const_cast<SvxMSDffHandle*>(mso_sptDownArrowCalloutHandle), SAL_N_ELEMENTS( mso_sptDownArrowCalloutHandle ) +}; + +const SvxMSDffVertPair mso_sptLeftRightArrowCalloutVert[] = +{ + { 0 MSO_I, 0 }, { 4 MSO_I, 0 }, { 4 MSO_I, 3 MSO_I }, { 6 MSO_I, 3 MSO_I }, + { 6 MSO_I, 1 MSO_I }, { 21600, 10800 }, { 6 MSO_I, 5 MSO_I }, { 6 MSO_I, 7 MSO_I }, + { 4 MSO_I, 7 MSO_I }, { 4 MSO_I, 21600 }, { 0 MSO_I, 21600 }, { 0 MSO_I, 7 MSO_I }, + { 2 MSO_I, 7 MSO_I }, { 2 MSO_I, 5 MSO_I }, { 0, 10800 }, { 2 MSO_I, 1 MSO_I }, + { 2 MSO_I, 3 MSO_I }, { 0 MSO_I, 3 MSO_I } +}; +const sal_uInt16 mso_sptLeftRightArrowCalloutSegm[] = +{ + 0x4000, 0x0011, 0x6001, 0x8000 +}; +const SvxMSDffCalculationData mso_sptLeftRightArrowCalloutCalc[] = +{ + { 0x2000, { DFF_Prop_adjustValue, 0, 0 } }, + { 0x2000, { DFF_Prop_adjust2Value, 0, 0 } }, + { 0x2000, { DFF_Prop_adjust3Value, 0, 0 } }, + { 0x2000, { DFF_Prop_adjust4Value, 0, 0 } }, + { 0x8000, { 21600, 0, 0x0400 } }, + { 0x8000, { 21600, 0, 0x0401 } }, + { 0x8000, { 21600, 0, 0x0402 } }, + { 0x8000, { 21600, 0, 0x0403 } } +}; +const sal_Int32 mso_sptLeftRightArrowCalloutDefault[] = +{ + 4, 5400, 5500, 2700, 8100 +}; +const SvxMSDffTextRectangles mso_sptLeftRightArrowCalloutTextRect[] = +{ + { { 0 MSO_I, 0 }, { 4 MSO_I, 21600 } } +}; +const SvxMSDffHandle mso_sptLeftRightArrowCalloutHandle[] = +{ + { SvxMSDffHandleFlags::RANGE | SvxMSDffHandleFlags::RANGE_X_MIN_IS_SPECIAL, + 0x100, 0, 10800, 10800, 0x102, 10800, MIN_INT32, 0x7fffffff }, + { SvxMSDffHandleFlags::RANGE | SvxMSDffHandleFlags::RANGE_X_MAX_IS_SPECIAL | SvxMSDffHandleFlags::RANGE_Y_MIN_IS_SPECIAL, + 0x102, 0x103, 10800, 10800, 0, 0x100, 0x101, 10800 }, + { SvxMSDffHandleFlags::RANGE | SvxMSDffHandleFlags::RANGE_Y_MAX_IS_SPECIAL, + 0, 0x101, 10800, 10800, MIN_INT32, 0x7fffffff, 0, 0x103 } +}; +const mso_CustomShape msoLeftRightArrowCallout = +{ + const_cast<SvxMSDffVertPair*>(mso_sptLeftRightArrowCalloutVert), SAL_N_ELEMENTS( mso_sptLeftRightArrowCalloutVert ), + const_cast<sal_uInt16*>(mso_sptLeftRightArrowCalloutSegm), sizeof( mso_sptLeftRightArrowCalloutSegm ) >> 1, + const_cast<SvxMSDffCalculationData*>(mso_sptLeftRightArrowCalloutCalc), SAL_N_ELEMENTS( mso_sptLeftRightArrowCalloutCalc ), + const_cast<sal_Int32*>(mso_sptLeftRightArrowCalloutDefault), + const_cast<SvxMSDffTextRectangles*>(mso_sptLeftRightArrowCalloutTextRect), SAL_N_ELEMENTS( mso_sptLeftRightArrowCalloutTextRect ), + 21600, 21600, + MIN_INT32, MIN_INT32, + nullptr, 0, + const_cast<SvxMSDffHandle*>(mso_sptLeftRightArrowCalloutHandle), SAL_N_ELEMENTS( mso_sptLeftRightArrowCalloutHandle ) +}; + +const SvxMSDffVertPair mso_sptUpDownArrowCalloutVert[] = +{ + { 0, 0 MSO_I }, { 0, 4 MSO_I }, { 3 MSO_I, 4 MSO_I }, { 3 MSO_I, 6 MSO_I }, + { 1 MSO_I, 6 MSO_I }, { 10800, 21600 }, { 5 MSO_I, 6 MSO_I }, { 7 MSO_I, 6 MSO_I }, + { 7 MSO_I, 4 MSO_I }, { 21600, 4 MSO_I }, { 21600, 0 MSO_I }, { 7 MSO_I, 0 MSO_I }, + { 7 MSO_I, 2 MSO_I }, { 5 MSO_I, 2 MSO_I }, { 10800, 0 }, { 1 MSO_I, 2 MSO_I }, + { 3 MSO_I, 2 MSO_I }, { 3 MSO_I, 0 MSO_I } +}; +const sal_uInt16 mso_sptUpDownArrowCalloutSegm[] = +{ + 0x4000, 0x0011, 0x6001, 0x8000 +}; +const SvxMSDffCalculationData mso_sptUpDownArrowCalloutCalc[] = +{ + { 0x2000, { DFF_Prop_adjustValue, 0, 0 } }, + { 0x2000, { DFF_Prop_adjust2Value, 0, 0 } }, + { 0x2000, { DFF_Prop_adjust3Value, 0, 0 } }, + { 0x2000, { DFF_Prop_adjust4Value, 0, 0 } }, + { 0x8000, { 21600, 0, 0x0400 } }, + { 0x8000, { 21600, 0, 0x0401 } }, + { 0x8000, { 21600, 0, 0x0402 } }, + { 0x8000, { 21600, 0, 0x0403 } } +}; +const sal_Int32 mso_sptUpDownArrowCalloutDefault[] = +{ + 4, 5400, 5500, 2700, 8100 +}; +const SvxMSDffTextRectangles mso_sptUpDownArrowCalloutTextRect[] = +{ + { { 0, 0 MSO_I }, { 21600, 4 MSO_I } } +}; +const SvxMSDffHandle mso_sptUpDownArrowCalloutHandle[] = +{ + { SvxMSDffHandleFlags::RANGE | SvxMSDffHandleFlags::RANGE_Y_MIN_IS_SPECIAL, + 0, 0x100, 10800, 10800, MIN_INT32, 0x7fffffff, 0x102, 10800 }, + { SvxMSDffHandleFlags::RANGE | SvxMSDffHandleFlags::RANGE_X_MIN_IS_SPECIAL | SvxMSDffHandleFlags::RANGE_Y_MAX_IS_SPECIAL, + 0x103, 0x102, 10800, 10800, 0x101, 10800, 0, 0x100 }, + { SvxMSDffHandleFlags::RANGE | SvxMSDffHandleFlags::RANGE_X_MAX_IS_SPECIAL, + 0x101, 0, 10800, 10800, 0, 0x103, MIN_INT32, 0x7fffffff } +}; +const mso_CustomShape msoUpDownArrowCallout = +{ + const_cast<SvxMSDffVertPair*>(mso_sptUpDownArrowCalloutVert), SAL_N_ELEMENTS( mso_sptUpDownArrowCalloutVert ), + const_cast<sal_uInt16*>(mso_sptUpDownArrowCalloutSegm), sizeof( mso_sptUpDownArrowCalloutSegm ) >> 1, + const_cast<SvxMSDffCalculationData*>(mso_sptUpDownArrowCalloutCalc), SAL_N_ELEMENTS( mso_sptUpDownArrowCalloutCalc ), + const_cast<sal_Int32*>(mso_sptUpDownArrowCalloutDefault), + const_cast<SvxMSDffTextRectangles*>(mso_sptUpDownArrowCalloutTextRect), SAL_N_ELEMENTS( mso_sptUpDownArrowCalloutTextRect ), + 21600, 21600, + MIN_INT32, MIN_INT32, + nullptr, 0, + const_cast<SvxMSDffHandle*>(mso_sptUpDownArrowCalloutHandle), SAL_N_ELEMENTS( mso_sptUpDownArrowCalloutHandle ) +}; + +const SvxMSDffVertPair mso_sptQuadArrowCalloutVert[] = +{ + { 0 MSO_I, 0 MSO_I }, { 3 MSO_I, 0 MSO_I }, { 3 MSO_I, 2 MSO_I }, { 1 MSO_I, 2 MSO_I }, + { 10800, 0 }, { 5 MSO_I, 2 MSO_I }, { 7 MSO_I, 2 MSO_I }, { 7 MSO_I, 0 MSO_I }, + { 4 MSO_I, 0 MSO_I }, { 4 MSO_I, 3 MSO_I }, { 6 MSO_I, 3 MSO_I }, { 6 MSO_I, 1 MSO_I }, + { 21600, 10800 }, { 6 MSO_I, 5 MSO_I }, { 6 MSO_I, 7 MSO_I }, { 4 MSO_I, 7 MSO_I }, + { 4 MSO_I, 4 MSO_I }, { 7 MSO_I, 4 MSO_I }, { 7 MSO_I, 6 MSO_I }, { 5 MSO_I, 6 MSO_I }, + { 10800, 21600 }, { 1 MSO_I, 6 MSO_I }, { 3 MSO_I, 6 MSO_I }, { 3 MSO_I, 4 MSO_I }, + { 0 MSO_I, 4 MSO_I }, { 0 MSO_I, 7 MSO_I }, { 2 MSO_I, 7 MSO_I }, { 2 MSO_I, 5 MSO_I }, + { 0, 10800 }, { 2 MSO_I, 1 MSO_I }, { 2 MSO_I, 3 MSO_I }, { 0 MSO_I, 3 MSO_I } +}; +const sal_uInt16 mso_sptQuadArrowCalloutSegm[] = +{ + 0x4000, 0x001f, 0x6001, 0x8000 +}; +const SvxMSDffCalculationData mso_sptQuadArrowCalloutCalc[] = +{ + { 0x2000, { DFF_Prop_adjustValue, 0, 0 } }, + { 0x2000, { DFF_Prop_adjust2Value, 0, 0 } }, + { 0x2000, { DFF_Prop_adjust3Value, 0, 0 } }, + { 0x2000, { DFF_Prop_adjust4Value, 0, 0 } }, + { 0x8000, { 21600, 0, 0x0400 } }, + { 0x8000, { 21600, 0, 0x0401 } }, + { 0x8000, { 21600, 0, 0x0402 } }, + { 0x8000, { 21600, 0, 0x0403 } } +}; +const sal_Int32 mso_sptQuadArrowCalloutDefault[] = +{ + 4, 5400, 8100, 2700, 9400 +}; +const SvxMSDffTextRectangles mso_sptQuadArrowCalloutTextRect[] = +{ + { { 0 MSO_I, 0 MSO_I }, { 4 MSO_I, 4 MSO_I } } +}; +const SvxMSDffHandle mso_sptQuadArrowCalloutHandle[] = +{ + { SvxMSDffHandleFlags::RANGE | SvxMSDffHandleFlags::RANGE_Y_MIN_IS_SPECIAL | SvxMSDffHandleFlags::RANGE_Y_MAX_IS_SPECIAL, + 0, 0x100, 10800, 10800, MIN_INT32, 0x7fffffff, 0x102, 0x101 }, + { SvxMSDffHandleFlags::RANGE | SvxMSDffHandleFlags::RANGE_X_MIN_IS_SPECIAL, + 0x101, 0, 10800, 10800, 0x100, 10800, MIN_INT32, 0x7fffffff }, + { SvxMSDffHandleFlags::RANGE | SvxMSDffHandleFlags::RANGE_X_MIN_IS_SPECIAL | SvxMSDffHandleFlags::RANGE_Y_MAX_IS_SPECIAL, + 0x103, 0x102, 10800, 10800, 0x101, 10800, 0, 0x100 } +}; +const mso_CustomShape msoQuadArrowCallout = +{ + const_cast<SvxMSDffVertPair*>(mso_sptQuadArrowCalloutVert), SAL_N_ELEMENTS( mso_sptQuadArrowCalloutVert ), + const_cast<sal_uInt16*>(mso_sptQuadArrowCalloutSegm), sizeof( mso_sptQuadArrowCalloutSegm ) >> 1, + const_cast<SvxMSDffCalculationData*>(mso_sptQuadArrowCalloutCalc), SAL_N_ELEMENTS( mso_sptQuadArrowCalloutCalc ), + const_cast<sal_Int32*>(mso_sptQuadArrowCalloutDefault), + const_cast<SvxMSDffTextRectangles*>(mso_sptQuadArrowCalloutTextRect), SAL_N_ELEMENTS( mso_sptQuadArrowCalloutTextRect ), + 21600, 21600, + MIN_INT32, MIN_INT32, + nullptr, 0, + const_cast<SvxMSDffHandle*>(mso_sptQuadArrowCalloutHandle), SAL_N_ELEMENTS( mso_sptQuadArrowCalloutHandle ) +}; + +const SvxMSDffVertPair mso_sptCircularArrowVert[] = +{ + { 0x03 MSO_I, 0x03 MSO_I }, + { 0x14 MSO_I, 0x14 MSO_I }, + { 0x13 MSO_I, 0x12 MSO_I }, + { 0x11 MSO_I, 0x10 MSO_I }, + { 0, 0 }, { 21600, 21600 }, + { 0x09 MSO_I, 0x08 MSO_I }, + { 0x0B MSO_I, 0x0A MSO_I }, + { 0x18 MSO_I, 0x17 MSO_I }, + { 0x2F MSO_I, 0x2E MSO_I }, + { 0x1D MSO_I, 0x1C MSO_I } +}; +const sal_uInt16 mso_sptCircularArrowSegm[] = +{ + 0xa404, 0xa504, 0x0003, 0x6001, 0x8000 +}; +const SvxMSDffCalculationData mso_sptCircularArrowCalc[] = +{ + { 0x2000, { 0x0147, 0x0000, 0x0000 } }, + { 0x2000, { 0x0148, 0x0000, 0x0000 } }, + { 0x2000, { 0x0149, 0x0000, 0x0000 } }, + { 0x4000, { 0x2A30, 0x0149, 0x0000 } }, + { 0x4009, { 0x2A30, 0x0147, 0x0000 } }, + { 0x400A, { 0x2A30, 0x0147, 0x0000 } }, + { 0x4009, { 0x2A30, 0x0148, 0x0000 } }, + { 0x400A, { 0x2A30, 0x0148, 0x0000 } }, + { 0x2000, { 0x0404, 0x2A30, 0x0000 } }, + { 0x2000, { 0x0405, 0x2A30, 0x0000 } }, + { 0x2000, { 0x0406, 0x2A30, 0x0000 } }, + { 0x2000, { 0x0407, 0x2A30, 0x0000 } }, + { 0x6009, { 0x0403, 0x0147, 0x0000 } }, + { 0x600A, { 0x0403, 0x0147, 0x0000 } }, + { 0x6009, { 0x0403, 0x0148, 0x0000 } }, + { 0x600A, { 0x0403, 0x0148, 0x0000 } }, + { 0x2000, { 0x040C, 0x2A30, 0x0000 } }, + { 0x2000, { 0x040D, 0x2A30, 0x0000 } }, + { 0x2000, { 0x040E, 0x2A30, 0x0000 } }, + { 0x2000, { 0x040F, 0x2A30, 0x0000 } }, + { 0x8000, { 0x5460, 0x0000, 0x0403 } }, + { 0x4009, { 0x34BC, 0x0148, 0x0000 } }, + { 0x400A, { 0x34BC, 0x0148, 0x0000 } }, + { 0x2000, { 0x0415, 0x2A30, 0x0000 } }, + { 0x2000, { 0x0416, 0x2A30, 0x0000 } }, + { 0x2000, { 0x0149, 0x0000, 0x0A8C } }, + { 0x6009, { 0x0419, 0x0148, 0x0000 } }, + { 0x600A, { 0x0419, 0x0148, 0x0000 } }, + { 0x2000, { 0x041A, 0x2A30, 0x0000 } }, + { 0x2000, { 0x041B, 0x2A30, 0x0000 } }, + { 0xA000, { 0x041D, 0x0000, 0x0418 } }, + { 0xA000, { 0x041D, 0x0000, 0x0418 } }, + { 0x6001, { 0x041E, 0x041F, 0x0001 } }, + { 0xA000, { 0x041C, 0x0000, 0x0417 } }, + { 0xA000, { 0x041C, 0x0000, 0x0417 } }, + { 0x6001, { 0x0421, 0x0422, 0x0001 } }, + { 0x6000, { 0x0420, 0x0423, 0x0000 } }, + { 0x200D, { 0x0424, 0x0000, 0x0000 } }, + { 0x200E, { 0x0148, 0x002D, 0x0000 } }, + { 0x6009, { 0x0425, 0x0426, 0x0000 } }, + { 0x200E, { 0x0148, 0x002D, 0x0000 } }, + { 0x600A, { 0x0425, 0x0428, 0x0000 } }, + { 0x000E, { 0x0000, 0x002D, 0x0000 } }, + { 0x6009, { 0x0427, 0x042A, 0x0000 } }, + { 0x000E, { 0x0000, 0x002D, 0x0000 } }, + { 0x6009, { 0x0429, 0x042C, 0x0000 } }, + { 0x6000, { 0x041C, 0x042B, 0x0000 } }, + { 0x6000, { 0x041D, 0x042D, 0x0000 } } +}; +const sal_Int32 mso_sptCircularArrowDefault[] = +{ + 3, 180, 0, 5500 +}; +const SvxMSDffTextRectangles mso_sptCircularArrowTextRect[] = // todo +{ + { { 0, 0 }, { 21600, 21600 } } +}; +const SvxMSDffHandle mso_sptCircularArrowHandle[] = +{ + { SvxMSDffHandleFlags::POLAR | SvxMSDffHandleFlags::RADIUS_RANGE, + 10800, 0x100, 10800, 10800, 10800, 10800, -0x7f4c0000, 0x00b40000 }, + { SvxMSDffHandleFlags::POLAR | SvxMSDffHandleFlags::RADIUS_RANGE, + 0x102, 0x101, 10800, 10800, 0, 10800, -0x7f4c0000, 0x00b40000 } +}; +const mso_CustomShape msoCircularArrow = +{ + const_cast<SvxMSDffVertPair*>(mso_sptCircularArrowVert), SAL_N_ELEMENTS( mso_sptCircularArrowVert ), + const_cast<sal_uInt16*>(mso_sptCircularArrowSegm), sizeof( mso_sptCircularArrowSegm ) >> 1, + const_cast<SvxMSDffCalculationData*>(mso_sptCircularArrowCalc), SAL_N_ELEMENTS( mso_sptCircularArrowCalc ), + const_cast<sal_Int32*>(mso_sptCircularArrowDefault), + const_cast<SvxMSDffTextRectangles*>(mso_sptCircularArrowTextRect), SAL_N_ELEMENTS( mso_sptCircularArrowTextRect ), + 21600, 21600, + MIN_INT32, MIN_INT32, + nullptr, 0, + const_cast<SvxMSDffHandle*>(mso_sptCircularArrowHandle), SAL_N_ELEMENTS( mso_sptCircularArrowHandle ) // handles +}; + +const SvxMSDffVertPair mso_sptCubeVert[] = +{ + { 0, 12 MSO_I }, { 0, 1 MSO_I }, { 2 MSO_I, 0 }, { 11 MSO_I, 0 }, { 11 MSO_I, 3 MSO_I }, { 4 MSO_I, 12 MSO_I }, + { 0, 1 MSO_I }, { 2 MSO_I, 0 }, { 11 MSO_I, 0 }, { 4 MSO_I, 1 MSO_I }, + { 4 MSO_I, 12 MSO_I }, { 4 MSO_I, 1 MSO_I }, { 11 MSO_I, 0 }, { 11 MSO_I, 3 MSO_I } +}; +const sal_uInt16 mso_sptCubeSegm[] = +{ + 0x4000, 0x0005, 0x6001, 0x8000, + 0x4000, 0x0003, 0x6001, 0x8000, + 0x4000, 0x0003, 0x6001, 0x8000 +}; +const SvxMSDffCalculationData mso_sptCubeCalc[] = +{ + { 0x2000, { DFF_Prop_adjustValue, 0, 0 } }, + { 0x6000, { DFF_Prop_geoTop, 0x400, 0 } }, + { 0x6000, { DFF_Prop_geoLeft, 0x400, 0 } }, + { 0xa000, { DFF_Prop_geoBottom, 0, 0x400 } }, + { 0xa000, { DFF_Prop_geoRight, 0, 0x400 } }, + { 0xa000, { DFF_Prop_geoRight, 0, 0x402 } }, // 5 + { 0x2001, { 0x405, 1, 2 } }, // 6 + { 0x6000, { 0x402, 0x406, 0 } }, // 7 + { 0xa000, { DFF_Prop_geoBottom, 0, 0x401 } }, // 8 + { 0x2001, { 0x408, 1, 2 } }, // 9 + { 0x6000, { 0x401, 0x409, 0 } }, // 10 + { 0x2000, { DFF_Prop_geoRight, 0, 0 } }, // 11 + { 0x2000, { DFF_Prop_geoBottom, 0, 0 } } // 12 +}; +const SvxMSDffTextRectangles mso_sptCubeTextRect[] = +{ + { { 0, 1 MSO_I }, { 4 MSO_I, 12 MSO_I } } +}; +const SvxMSDffHandle mso_sptCubeHandle[] = +{ + { SvxMSDffHandleFlags::RANGE | SvxMSDffHandleFlags::SWITCHED, + 0, 0x100, 10800, 10800, MIN_INT32, 0x7fffffff, 0, 21600 } +}; +const SvxMSDffVertPair mso_sptCubeGluePoints[] = +{ + { 7 MSO_I, 0 }, { 6 MSO_I, 1 MSO_I }, { 0, 10 MSO_I }, { 6 MSO_I, 21600 }, { 4 MSO_I, 10 MSO_I }, { 21600, 9 MSO_I } +}; +const mso_CustomShape msoCube = +{ + const_cast<SvxMSDffVertPair*>(mso_sptCubeVert), SAL_N_ELEMENTS( mso_sptCubeVert ), + const_cast<sal_uInt16*>(mso_sptCubeSegm), sizeof( mso_sptCubeSegm ) >> 1, + const_cast<SvxMSDffCalculationData*>(mso_sptCubeCalc), SAL_N_ELEMENTS( mso_sptCubeCalc ), + const_cast<sal_Int32*>(mso_sptDefault5400), + const_cast<SvxMSDffTextRectangles*>(mso_sptCubeTextRect), SAL_N_ELEMENTS( mso_sptCubeTextRect ), + 21600, 21600, + 10800, 10800, + const_cast<SvxMSDffVertPair*>(mso_sptCubeGluePoints), SAL_N_ELEMENTS( mso_sptCubeGluePoints ), + const_cast<SvxMSDffHandle*>(mso_sptCubeHandle), SAL_N_ELEMENTS( mso_sptCubeHandle ) +}; + +const SvxMSDffVertPair mso_sptBevelVert[] = +{ + { 0, 0 }, { 21600, 0 }, { 21600, 21600 }, { 0, 21600 }, + { 0, 0 }, { 21600, 0 }, { 1 MSO_I, 0 MSO_I }, { 0 MSO_I, 0 MSO_I }, + { 21600, 0 }, { 21600, 21600 }, { 1 MSO_I, 2 MSO_I }, { 1 MSO_I, 0 MSO_I }, + { 21600, 21600 }, { 0, 21600 }, { 0 MSO_I, 2 MSO_I }, { 1 MSO_I, 2 MSO_I }, + { 0, 21600 }, { 0, 0 }, { 0 MSO_I, 0 MSO_I }, { 0 MSO_I, 2 MSO_I } +}; +const sal_uInt16 mso_sptBevelSegm[] = +{ + 0x4000, 0x0003, 0x6001, 0x8000, + 0x4000, 0x0003, 0x6001, 0x8000, + 0x4000, 0x0003, 0x6001, 0x8000, + 0x4000, 0x0003, 0x6001, 0x8000, + 0x4000, 0x0003, 0x6001, 0x8000 +}; +const SvxMSDffCalculationData mso_sptBevelCalc[] = +{ + { 0x2001, { DFF_Prop_adjustValue, 21599, 21600 } }, + { 0xa000, { DFF_Prop_geoRight, 0, 0x400 } }, + { 0xa000, { DFF_Prop_geoBottom, 0, 0x400 } } +}; + +const SvxMSDffTextRectangles mso_sptBevelTextRect[] = +{ + { { 0 MSO_I, 0 MSO_I }, { 1 MSO_I, 2 MSO_I } } +}; +const SvxMSDffHandle mso_sptBevelHandle[] = +{ + { SvxMSDffHandleFlags::RANGE | SvxMSDffHandleFlags::SWITCHED, + 0x100, 0, 10800, 10800, 0, 10800, MIN_INT32, 0x7fffffff } +}; +const mso_CustomShape msoBevel = +{ + const_cast<SvxMSDffVertPair*>(mso_sptBevelVert), SAL_N_ELEMENTS( mso_sptBevelVert ), + const_cast<sal_uInt16*>(mso_sptBevelSegm), sizeof( mso_sptBevelSegm ) >> 1, + const_cast<SvxMSDffCalculationData*>(mso_sptBevelCalc), SAL_N_ELEMENTS( mso_sptBevelCalc ), + const_cast<sal_Int32*>(mso_sptDefault2700), + const_cast<SvxMSDffTextRectangles*>(mso_sptBevelTextRect), SAL_N_ELEMENTS( mso_sptBevelTextRect ), + 21600, 21600, + 10800, 10800, + nullptr, 0, + const_cast<SvxMSDffHandle*>(mso_sptBevelHandle), SAL_N_ELEMENTS( mso_sptBevelHandle ) +}; + +const SvxMSDffVertPair mso_sptFoldedCornerVert[] = // adjustment1 : x 10800 - 21600 +{ + { 0, 0 }, { 21600, 0 }, { 21600, 0 MSO_I }, { 0 MSO_I, 21600 }, + { 0, 21600 }, { 0 MSO_I, 21600 }, { 3 MSO_I, 0 MSO_I }, { 8 MSO_I, 9 MSO_I }, + { 10 MSO_I, 11 MSO_I }, { 21600, 0 MSO_I } +}; +const sal_uInt16 mso_sptFoldedCornerSegm[] = +{ + 0x4000, 0x0004, 0x6001, 0x8000, + 0x4000, 0x0001, 0x2001, 0x6001, 0x8000 +}; +const SvxMSDffCalculationData mso_sptFoldedCornerCalc[] = +{ + { 0x2000, { DFF_Prop_adjustValue, 0, 0 } }, + { 0x8000, { 21600, 0, 0x400 } }, + { 0x2001, { 0x0401, 8000, 10800 } }, + { 0x8000, { 21600, 0, 0x0402 } }, + { 0x2001, { 0x0401, 1, 2 } }, + { 0x2001, { 0x0401, 1, 4 } }, + { 0x2001, { 0x0401, 1, 7 } }, + { 0x2001, { 0x0401, 1, 16 } }, + { 0x6000, { 0x0403, 0x405, 0 } }, + { 0x6000, { 0x0400, 0x406, 0 } }, + { 0x8000, { 21600, 0, 0x404 } }, + { 0x6000, { 0x400, 0x407, 0 } } +}; +const sal_Int32 mso_sptFoldedCornerDefault[] = +{ + 1, 18900 +}; +const SvxMSDffTextRectangles mso_sptFoldedCornerTextRect[] = +{ + { { 0, 0 }, { 21600, 11 MSO_I } } +}; +const SvxMSDffHandle mso_sptFoldedCornerHandle[] = +{ + { SvxMSDffHandleFlags::RANGE, + 0x100, 1, 10800, 10800, 10800, 21600, MIN_INT32, 0x7fffffff } +}; +const mso_CustomShape msoFoldedCorner = +{ + const_cast<SvxMSDffVertPair*>(mso_sptFoldedCornerVert), SAL_N_ELEMENTS( mso_sptFoldedCornerVert ), + const_cast<sal_uInt16*>(mso_sptFoldedCornerSegm), sizeof( mso_sptFoldedCornerSegm ) >> 1, + const_cast<SvxMSDffCalculationData*>(mso_sptFoldedCornerCalc), SAL_N_ELEMENTS( mso_sptFoldedCornerCalc ), + const_cast<sal_Int32*>(mso_sptFoldedCornerDefault), + const_cast<SvxMSDffTextRectangles*>(mso_sptFoldedCornerTextRect), SAL_N_ELEMENTS( mso_sptFoldedCornerTextRect ), + 21600, 21600, + MIN_INT32, MIN_INT32, + const_cast<SvxMSDffVertPair*>(mso_sptStandardGluePoints), SAL_N_ELEMENTS( mso_sptStandardGluePoints ), + const_cast<SvxMSDffHandle*>(mso_sptFoldedCornerHandle), SAL_N_ELEMENTS( mso_sptFoldedCornerHandle ) +}; + +const SvxMSDffVertPair mso_sptActionButtonBlankVert[] = +{ + { 0, 0 }, { 21600, 0 }, { 21600, 21600 }, { 0, 21600 }, + { 0, 0 }, { 21600, 0 }, { 1 MSO_I, 0 MSO_I }, { 0 MSO_I, 0 MSO_I }, + { 21600, 0 }, { 21600, 21600 }, { 1 MSO_I, 2 MSO_I }, { 1 MSO_I, 0 MSO_I }, + { 21600, 21600 }, { 0, 21600 }, { 0 MSO_I, 2 MSO_I }, { 1 MSO_I, 2 MSO_I }, + { 0, 21600 }, { 0, 0 }, { 0 MSO_I, 0 MSO_I }, { 0 MSO_I, 2 MSO_I } +}; +const sal_uInt16 mso_sptActionButtonBlankSegm[] = +{ + 0x4000, 0x0003, 0x6001, 0x8000, + 0x4000, 0x0003, 0x6001, 0x8000, + 0x4000, 0x0003, 0x6001, 0x8000, + 0x4000, 0x0003, 0x6001, 0x8000, + 0x4000, 0x0003, 0x6001, 0x8000 +}; +const SvxMSDffCalculationData mso_sptActionButtonBlankCalc[] = +{ + { 0x2001, { DFF_Prop_adjustValue, 21599, 21600 } }, + { 0xa000, { DFF_Prop_geoRight, 0, 0x400 } }, + { 0xa000, { DFF_Prop_geoBottom, 0, 0x400 } } +}; +const SvxMSDffTextRectangles mso_sptActionButtonBlankTextRect[] = +{ + { { 0 MSO_I, 0 MSO_I }, { 1 MSO_I, 2 MSO_I } } +}; +const SvxMSDffHandle mso_sptButtonHandle[] = +{ + { SvxMSDffHandleFlags::RANGE | SvxMSDffHandleFlags::SWITCHED, + 0x100, 0, 10800, 10800, 0, 5400, MIN_INT32, 0x7fffffff } +}; +const mso_CustomShape msoActionButtonBlank = +{ + const_cast<SvxMSDffVertPair*>(mso_sptActionButtonBlankVert), SAL_N_ELEMENTS( mso_sptActionButtonBlankVert ), + const_cast<sal_uInt16*>(mso_sptActionButtonBlankSegm), sizeof( mso_sptActionButtonBlankSegm ) >> 1, + const_cast<SvxMSDffCalculationData*>(mso_sptActionButtonBlankCalc), SAL_N_ELEMENTS( mso_sptActionButtonBlankCalc ), + const_cast<sal_Int32*>(mso_sptDefault1400), + const_cast<SvxMSDffTextRectangles*>(mso_sptActionButtonBlankTextRect), SAL_N_ELEMENTS( mso_sptActionButtonBlankTextRect ), + 21600, 21600, + 10800, 10800, + nullptr, 0, + const_cast<SvxMSDffHandle*>(mso_sptButtonHandle), SAL_N_ELEMENTS( mso_sptButtonHandle ) +}; + +const SvxMSDffTextRectangles mso_sptActionButtonTextRect[] = +{ + { { 1 MSO_I, 2 MSO_I }, { 3 MSO_I, 4 MSO_I } } +}; +const SvxMSDffVertPair mso_sptActionButtonHomeVert[] = +{ + { 0, 0 }, { 21600, 0 }, { 21600, 21600 }, { 0, 21600 }, + { 0, 0 }, { 21600, 0 }, { 3 MSO_I, 2 MSO_I }, { 1 MSO_I, 2 MSO_I }, + { 21600, 0 }, { 21600, 21600 }, { 3 MSO_I, 4 MSO_I }, { 3 MSO_I, 2 MSO_I }, + { 21600, 21600 }, { 0, 21600 }, { 1 MSO_I, 4 MSO_I }, { 3 MSO_I, 4 MSO_I }, + { 0, 21600 }, { 0, 0 }, { 1 MSO_I, 2 MSO_I }, { 1 MSO_I, 4 MSO_I }, + + { 7 MSO_I, 0xa MSO_I }, { 0xc MSO_I, 0xe MSO_I }, { 0xc MSO_I, 0x10 MSO_I }, { 0x12 MSO_I, 0x10 MSO_I }, + { 0x12 MSO_I, 0x14 MSO_I }, { 0x16 MSO_I, 8 MSO_I }, { 0x18 MSO_I, 8 MSO_I }, { 0x18 MSO_I, 0x1a MSO_I }, + { 0x1c MSO_I, 0x1a MSO_I }, { 0x1c MSO_I, 8 MSO_I }, { 0x1e MSO_I, 8 MSO_I }, + + { 0xc MSO_I, 0xe MSO_I }, { 0xc MSO_I, 0x10 MSO_I }, { 0x12 MSO_I, 0x10 MSO_I },{ 0x12 MSO_I, 0x14 MSO_I }, + + { 0x20 MSO_I, 0x24 MSO_I }, { 0x22 MSO_I, 0x24 MSO_I }, { 0x22 MSO_I, 0x1a MSO_I }, { 0x18 MSO_I, 0x1a MSO_I }, + { 0x18 MSO_I, 8 MSO_I }, { 0x1c MSO_I, 8 MSO_I }, { 0x1c MSO_I, 0x1a MSO_I }, { 0x20 MSO_I, 0x1a MSO_I } + +}; +const sal_uInt16 mso_sptActionButtonHomeSegm[] = +{ + 0x4000, 0x0003, 0x6001, 0x8000, + 0x4000, 0x0003, 0x6001, 0x8000, + 0x4000, 0x0003, 0x6001, 0x8000, + 0x4000, 0x0003, 0x6001, 0x8000, + 0x4000, 0x0003, 0x6001, 0x8000, + 0x4000, 0x000a, 0x6001, 0x8000, + 0x4000, 0x0003, 0x6001, 0x8000, + 0x4000, 0x0007, 0x6001, 0x8000 +}; +const SvxMSDffCalculationData mso_sptActionButtonHomeCalc[] = // adj value 0 - 5400 +{ + { 0x2000, { DFF_Prop_adjustValue, 0, 0 } }, + { 0x6000, { DFF_Prop_geoLeft, DFF_Prop_adjustValue, 0 } }, + { 0x6000, { DFF_Prop_geoTop, DFF_Prop_adjustValue, 0 } }, + { 0xa000, { DFF_Prop_geoRight, 0, DFF_Prop_adjustValue } }, + { 0xa000, { DFF_Prop_geoBottom, 0, DFF_Prop_adjustValue } }, + { 0x8000, { 10800, 0, DFF_Prop_adjustValue } }, + { 0x2001, { 0x0405, 1, 10800 } }, // scaling 6 + { 0x2001, { DFF_Prop_geoRight, 1, 2 } }, // lr center 7 + { 0x2001, { DFF_Prop_geoBottom, 1, 2 } }, // ul center 8 + + { 0x4001, { -8000, 0x0406, 1 } }, // 9 + { 0x6000, { 0x0409, 0x0408, 0 } }, // a + { 0x4001, { 2960, 0x0406, 1 } }, // b + { 0x6000, { 0x040b, 0x0407, 0 } }, // c + { 0x4001, { -5000, 0x0406, 1 } }, // d + { 0x6000, { 0x040d, 0x0408, 0 } }, // e + { 0x4001, { -7000, 0x0406, 1 } }, // f + { 0x6000, { 0x040f, 0x0408, 0 } }, // 10 + { 0x4001, { 5000, 0x0406, 1 } }, // 11 + { 0x6000, { 0x0411, 0x0407, 0 } }, // 12 + { 0x4001, { -2960, 0x0406, 1 } }, // 13 + { 0x6000, { 0x0413, 0x0408, 0 } }, // 14 + { 0x4001, { 8000, 0x0406, 1 } }, // 15 + { 0x6000, { 0x0415,0x0407, 0 } }, // 16 + { 0x4001, { 6100, 0x0406, 1 } }, // 17 + { 0x6000, { 0x0417,0x0407, 0 } }, // 18 + { 0x4001, { 8260, 0x0406, 1 } }, // 19 + { 0x6000, { 0x0419, 0x0408, 0 } }, // 1a + { 0x4001, { -6100, 0x0406, 1 } }, // 1b + { 0x6000, { 0x041b, 0x0407, 0 } }, // 1c + { 0x4001, { -8000, 0x0406, 1 } }, // 1d + { 0x6000, { 0x041d, 0x0407, 0 } }, // 1e + { 0x4001, { -1060, 0x0406, 1 } }, // 1f + { 0x6000, { 0x041f, 0x0407, 0 } }, // 20 + { 0x4001, { 1060, 0x0406, 1 } }, // 21 + { 0x6000, { 0x0421, 0x0407, 0 } }, // 22 + { 0x4001, { 4020, 0x0406, 1 } }, // 23 + { 0x6000, { 0x0423, 0x0408, 0 } } // 24 + +}; +const mso_CustomShape msoActionButtonHome = +{ + const_cast<SvxMSDffVertPair*>(mso_sptActionButtonHomeVert), SAL_N_ELEMENTS( mso_sptActionButtonHomeVert ), + const_cast<sal_uInt16*>(mso_sptActionButtonHomeSegm), sizeof( mso_sptActionButtonHomeSegm ) >> 1, + const_cast<SvxMSDffCalculationData*>(mso_sptActionButtonHomeCalc), SAL_N_ELEMENTS( mso_sptActionButtonHomeCalc ), + const_cast<sal_Int32*>(mso_sptDefault1400), + const_cast<SvxMSDffTextRectangles*>(mso_sptActionButtonTextRect), SAL_N_ELEMENTS( mso_sptActionButtonTextRect ), + 21600, 21600, + 10800, 10800, + nullptr, 0, + const_cast<SvxMSDffHandle*>(mso_sptButtonHandle), SAL_N_ELEMENTS( mso_sptButtonHandle ) +}; + +const SvxMSDffVertPair mso_sptActionButtonHelpVert[] = +{ + { 0, 0 }, { 21600, 0 }, { 21600, 21600 }, { 0, 21600 }, + { 0, 0 }, { 21600, 0 }, { 3 MSO_I, 2 MSO_I }, { 1 MSO_I, 2 MSO_I }, + { 21600, 0 }, { 21600, 21600 }, { 3 MSO_I, 4 MSO_I }, { 3 MSO_I, 2 MSO_I }, + { 21600, 21600 }, { 0, 21600 }, { 1 MSO_I, 4 MSO_I }, { 3 MSO_I, 4 MSO_I }, + { 0, 21600 }, { 0, 0 }, { 1 MSO_I, 2 MSO_I }, { 1 MSO_I,4 MSO_I }, + { 7 MSO_I, 0xc MSO_I }, { 0xa MSO_I, 0x3e MSO_I }, { 7 MSO_I, 0x10 MSO_I }, { 0xe MSO_I, 0x3e MSO_I }, { 7 MSO_I, 0xc MSO_I }, + { 0x12 MSO_I, 0x14 MSO_I }, { 0x12 MSO_I, 0x16 MSO_I }, // pp + { 0x12 MSO_I, 0x18 MSO_I }, { 0x1a MSO_I, 8 MSO_I }, { 0x1c MSO_I, 8 MSO_I }, // ccp + { 0x1e MSO_I, 8 MSO_I }, { 0x20 MSO_I, 0x22 MSO_I }, { 0x20 MSO_I, 0x24 MSO_I }, // ccp + { 0x20 MSO_I, 0x26 MSO_I }, { 0x28 MSO_I, 0x2a MSO_I }, { 7 MSO_I, 0x2a MSO_I }, // ccp + { 0x2c MSO_I, 0x2a MSO_I }, { 0x2e MSO_I, 0x26 MSO_I }, { 0x2e MSO_I, 0x24 MSO_I }, // ccp + { 0x30 MSO_I, 0x24 MSO_I }, { 0x30 MSO_I, 0x32 MSO_I }, { 0x34 MSO_I, 0x36 MSO_I }, // ccp + { 7 MSO_I, 0x36 MSO_I }, // p + { 0x12 MSO_I, 0x36 MSO_I }, { 0x1c MSO_I, 0x32 MSO_I }, { 0x1c MSO_I, 0x24 MSO_I }, // ccp + { 0x1c MSO_I, 0x38 MSO_I }, { 0x3a MSO_I, 0x3c MSO_I }, { 0x12 MSO_I, 0x3c MSO_I }, // ccp + { 7 MSO_I, 0x3c MSO_I }, { 0x34 MSO_I, 8 MSO_I }, { 0x34 MSO_I, 0x16 MSO_I }, // ccp + { 0x34 MSO_I, 0x14 MSO_I } +}; +const sal_uInt16 mso_sptActionButtonHelpSegm[] = +{ + 0x4000, 0x0003, 0x6001, 0x8000, + 0x4000, 0x0003, 0x6001, 0x8000, + 0x4000, 0x0003, 0x6001, 0x8000, + 0x4000, 0x0003, 0x6001, 0x8000, + 0x4000, 0x0003, 0x6001, 0x8000, + 0x4000, 0xa704, 0x6000, 0x8000, + 0x4000, 0x0001, 0x2004, 0x0001, 0x2004, 0x0001, 0x6001, 0x8000 +}; +const SvxMSDffCalculationData mso_sptActionButtonHelpCalc[] = // adj value 0 - 5400 +{ + { 0x2000, { DFF_Prop_adjustValue, 0, 0 } }, + { 0x6000, { DFF_Prop_geoLeft, DFF_Prop_adjustValue, 0 } }, + { 0x6000, { DFF_Prop_geoTop, DFF_Prop_adjustValue, 0 } }, + { 0xa000, { DFF_Prop_geoRight, 0, DFF_Prop_adjustValue } }, + { 0xa000, { DFF_Prop_geoBottom, 0, DFF_Prop_adjustValue } }, + { 0x8000, { 10800, 0, DFF_Prop_adjustValue } }, + { 0x2001, { 0x0405, 1, 10800 } }, // scaling 6 + { 0x2001, { DFF_Prop_geoRight, 1, 2 } }, // lr center 7 + { 0x2001, { DFF_Prop_geoBottom, 1, 2 } }, // ul center 8 + + { 0x4001, { -1690, 0x0406, 1 } }, // 9 + { 0x6000, { 0x0409, 0x0407, 0 } }, // a + { 0x4001, { 4600, 0x0406, 1 } }, // b + { 0x6000, { 0x040b, 0x0408, 0 } }, // c + { 0x4001, { 1690, 0x0406, 1 } }, // d + { 0x6000, { 0x040d, 0x0407, 0 } }, // e + { 0x4001, { 7980, 0x0406, 1 } }, // f + { 0x6000, { 0x040f, 0x0408, 0 } }, // 10 + { 0x4001, { 1270, 0x0406, 1 } }, // 11 + { 0x6000, { 0x0411, 0x0407, 0 } }, // 12 + { 0x4001, { 4000, 0x0406, 1 } }, // 13 + { 0x6000, { 0x0413, 0x0408, 0 } }, // 14 + { 0x4001, { 1750, 0x0406, 1 } }, // 15 + { 0x6000, { 0x0415, 0x0408, 0 } }, // 16 + { 0x4001, { 800, 0x0406, 1 } }, // 17 + { 0x6000, { 0x0417, 0x0408, 0 } }, // 18 + { 0x4001, { 1650, 0x0406, 1 } }, // 19 + { 0x6000, { 0x0419, 0x0407, 0 } }, // 1a + { 0x4001, { 2340, 0x0406, 1 } }, // 1b + { 0x6000, { 0x041b, 0x0407, 0 } }, // 1c + { 0x4001, { 3640, 0x0406, 1 } }, // 1d + { 0x6000, { 0x041d, 0x0407, 0 } }, // 1e + { 0x4001, { 4670, 0x0406, 1 } }, // 1f + { 0x6000, { 0x041f, 0x0407, 0 } }, // 20 + { 0x4001, { -1570, 0x0406, 1 } }, // 21 + { 0x6000, { 0x0421, 0x0408, 0 } }, // 22 + { 0x4001, { -3390, 0x0406, 1 } }, // 23 + { 0x6000, { 0x0423, 0x0408, 0 } }, // 24 + { 0x4001, { -6050, 0x0406, 1 } }, // 25 + { 0x6000, { 0x0425, 0x0408, 0 } }, // 26 + { 0x4001, { 2540, 0x0406, 1 } }, // 27 + { 0x6000, { 0x0427, 0x0407, 0 } }, // 28 + { 0x4001, { -8050, 0x0406, 1 } }, // 29 + { 0x6000, { 0x0429, 0x0408, 0 } }, // 2a + { 0x4001, { -2540, 0x0406, 1 } }, // 2b + { 0x6000, { 0x042b, 0x0407, 0 } }, // 2c + { 0x4001, { -4460, 0x0406, 1 } }, // 2d + { 0x6000, { 0x042d, 0x0407, 0 } }, // 2e + { 0x4001, { -2330, 0x0406, 1 } }, // 2f + { 0x6000, { 0x042f, 0x0407, 0 } }, // 30 + { 0x4001, { -4700, 0x0406, 1 } }, // 31 + { 0x6000, { 0x0431, 0x0408, 0 } }, // 32 + { 0x4001, { -1270, 0x0406, 1 } }, // 33 + { 0x6000, { 0x0433, 0x0407, 0 } }, // 34 + { 0x4001, { -5720, 0x0406, 1 } }, // 35 + { 0x6000, { 0x0435, 0x0408, 0 } }, // 36 + { 0x4001, { -2540, 0x0406, 1 } }, // 37 + { 0x6000, { 0x0437, 0x0408, 0 } }, // 38 + { 0x4001, { 1800, 0x0406, 1 } }, // 39 + { 0x6000, { 0x0439, 0x0407, 0 } }, // 3a + { 0x4001, { -1700, 0x0406, 1 } }, // 3b + { 0x6000, { 0x043b, 0x0408, 0 } }, // 3c + { 0x4001, { 6290, 0x0406, 1 } }, // 3d + { 0x6000, { 0x043d, 0x0408, 0 } } // 3e +}; +const mso_CustomShape msoActionButtonHelp = +{ + const_cast<SvxMSDffVertPair*>(mso_sptActionButtonHelpVert), SAL_N_ELEMENTS( mso_sptActionButtonHelpVert ), + const_cast<sal_uInt16*>(mso_sptActionButtonHelpSegm), sizeof( mso_sptActionButtonHelpSegm ) >> 1, + const_cast<SvxMSDffCalculationData*>(mso_sptActionButtonHelpCalc), SAL_N_ELEMENTS( mso_sptActionButtonHelpCalc ), + const_cast<sal_Int32*>(mso_sptDefault1400), + const_cast<SvxMSDffTextRectangles*>(mso_sptActionButtonTextRect), SAL_N_ELEMENTS( mso_sptActionButtonTextRect ), + 21600, 21600, + 10800, 10800, + nullptr, 0, + const_cast<SvxMSDffHandle*>(mso_sptButtonHandle), SAL_N_ELEMENTS( mso_sptButtonHandle ) +}; + +const SvxMSDffVertPair mso_sptActionButtonInformationVert[] = +{ + { 0, 0 }, { 21600, 0 }, { 21600, 21600 }, { 0, 21600 }, + { 0, 0 }, { 21600, 0 }, { 3 MSO_I, 2 MSO_I }, { 1 MSO_I, 2 MSO_I }, + { 21600, 0 }, { 21600, 21600 }, { 3 MSO_I, 4 MSO_I }, { 3 MSO_I, 2 MSO_I }, + { 21600, 21600 }, { 0, 21600 }, { 1 MSO_I, 4 MSO_I }, { 3 MSO_I, 4 MSO_I }, + { 0, 21600 }, { 0, 0 }, { 1 MSO_I, 2 MSO_I }, { 1 MSO_I, 4 MSO_I }, + { 0x7 MSO_I, 0xc MSO_I }, { 0xa MSO_I, 0x8 MSO_I }, { 0x7 MSO_I, 0x10 MSO_I }, { 0xe MSO_I, 8 MSO_I }, { 0x7 MSO_I, 0xc MSO_I }, + { 0x7 MSO_I, 0x14 MSO_I }, { 0x12 MSO_I, 0x2a MSO_I }, { 0x7 MSO_I, 0x18 MSO_I }, { 0x16 MSO_I, 0x2a MSO_I }, { 0x7 MSO_I, 0x14 MSO_I }, + { 0x1a MSO_I, 0x1c MSO_I }, { 0x1e MSO_I, 0x1c MSO_I }, { 0x1e MSO_I, 0x20 MSO_I }, { 0x22 MSO_I, 0x20 MSO_I }, + { 0x22 MSO_I, 0x24 MSO_I }, { 0x1a MSO_I, 0x24 MSO_I }, { 0x1a MSO_I, 0x20 MSO_I }, { 0x26 MSO_I, 0x20 MSO_I }, + { 0x26 MSO_I, 0x28 MSO_I }, { 0x1a MSO_I, 0x28 MSO_I } +}; +const sal_uInt16 mso_sptActionButtonInformationSegm[] = +{ + 0x4000, 0x0003, 0x6001, 0x8000, + 0x4000, 0x0003, 0x6001, 0x8000, + 0x4000, 0x0003, 0x6001, 0x8000, + 0x4000, 0x0003, 0x6001, 0x8000, + 0x4000, 0x0003, 0x6001, 0x8000, + 0x4000, 0xa704, 0x6000, 0x8000, + 0x4000, 0xa704, 0x6000, 0x8000, + 0x4000, 0x0009, 0x6001, 0x8000 +}; +const SvxMSDffCalculationData mso_sptActionButtonInformationCalc[] = // adj value 0 - 5400 +{ + { 0x2000, { DFF_Prop_adjustValue, 0, 0 } }, + { 0x6000, { DFF_Prop_geoLeft, DFF_Prop_adjustValue, 0 } }, + { 0x6000, { DFF_Prop_geoTop, DFF_Prop_adjustValue, 0 } }, + { 0xa000, { DFF_Prop_geoRight, 0, DFF_Prop_adjustValue } }, + { 0xa000, { DFF_Prop_geoBottom, 0, DFF_Prop_adjustValue } }, + { 0x8000, { 10800, 0, DFF_Prop_adjustValue } }, + { 0x2001, { 0x0405, 1, 10800 } }, // scaling 6 + { 0x2001, { DFF_Prop_geoRight, 1, 2 } }, // lr center 7 + { 0x2001, { DFF_Prop_geoBottom, 1, 2 } }, // ul center 8 + + { 0x4001, { -8050, 0x0406, 1 } }, // 9 + { 0x6000, { 0x0409, 0x0407, 0 } }, // a + { 0x4001, { -8050, 0x0406, 1 } }, // b + { 0x6000, { 0x040b, 0x0408, 0 } }, // c + { 0x4001, { 8050, 0x0406, 1 } }, // d + { 0x6000, { 0x040d, 0x0407, 0 } }, // e + { 0x4001, { 8050, 0x0406, 1 } }, // f + { 0x6000, { 0x040f, 0x0408, 0 } }, // 10 + + { 0x4001, { -2060, 0x0406, 1 } }, // 11 + { 0x6000, { 0x0411, 0x0407, 0 } }, // 12 + { 0x4001, { -7620, 0x0406, 1 } }, // 13 + { 0x6000, { 0x0413, 0x0408, 0 } }, // 14 + { 0x4001, { 2060, 0x0406, 1 } }, // 15 + { 0x6000, { 0x0415, 0x0407, 0 } }, // 16 + { 0x4001, { -3500, 0x0406, 1 } }, // 17 + { 0x6000, { 0x0417, 0x0408, 0 } }, // 18 + + { 0x4001, { -2960, 0x0406, 1 } }, // 19 + { 0x6000, { 0x0419, 0x0407, 0 } }, // 1a + { 0x4001, { -2960, 0x0406, 1 } }, // 1b + { 0x6000, { 0x041b, 0x0408, 0 } }, // 1c + { 0x4001, { 1480, 0x0406, 1 } }, // 1d + { 0x6000, { 0x041d, 0x0407, 0 } }, // 1e + { 0x4001, { 5080, 0x0406, 1 } }, // 1f + { 0x6000, { 0x041f, 0x0408, 0 } }, // 20 + { 0x4001, { 2960, 0x0406, 1 } }, // 21 + { 0x6000, { 0x0421, 0x0407, 0 } }, // 22 + { 0x4001, { 6140, 0x0406, 1 } }, // 23 + { 0x6000, { 0x0423, 0x0408, 0 } }, // 24 + { 0x4001, { -1480, 0x0406, 1 } }, // 25 + { 0x6000, { 0x0425, 0x0407, 0 } }, // 26 + { 0x4001, { -1920, 0x0406, 1 } }, // 27 + { 0x6000, { 0x0427, 0x0408, 0 } }, // 28 + + { 0x4001, { -5560, 0x0406, 1 } }, // 29 + { 0x6000, { 0x0429, 0x0408, 0 } }, // 2a + +}; +const mso_CustomShape msoActionButtonInformation = +{ + const_cast<SvxMSDffVertPair*>(mso_sptActionButtonInformationVert), SAL_N_ELEMENTS( mso_sptActionButtonInformationVert ), + const_cast<sal_uInt16*>(mso_sptActionButtonInformationSegm), sizeof( mso_sptActionButtonInformationSegm ) >> 1, + const_cast<SvxMSDffCalculationData*>(mso_sptActionButtonInformationCalc), SAL_N_ELEMENTS( mso_sptActionButtonInformationCalc ), + const_cast<sal_Int32*>(mso_sptDefault1400), + const_cast<SvxMSDffTextRectangles*>(mso_sptActionButtonTextRect), SAL_N_ELEMENTS( mso_sptActionButtonTextRect ), + 21600, 21600, + 10800, 10800, + nullptr, 0, + const_cast<SvxMSDffHandle*>(mso_sptButtonHandle), SAL_N_ELEMENTS( mso_sptButtonHandle ) +}; + +const SvxMSDffVertPair mso_sptActionButtonBackPreviousVert[] = +{ + { 0, 0 }, { 21600, 0 }, { 21600, 21600 }, { 0, 21600 }, + { 0, 0 }, { 21600, 0 }, { 3 MSO_I, 2 MSO_I }, { 1 MSO_I, 2 MSO_I }, + { 21600, 0 }, { 21600, 21600 }, { 3 MSO_I, 4 MSO_I }, { 3 MSO_I, 2 MSO_I }, + { 21600, 21600 }, { 0, 21600 }, { 1 MSO_I, 4 MSO_I }, { 3 MSO_I,4 MSO_I }, + { 0, 21600 }, { 0, 0 }, { 1 MSO_I, 2 MSO_I }, { 1 MSO_I, 4 MSO_I }, + + { 0xa MSO_I, 8 MSO_I }, { 0xe MSO_I, 0xc MSO_I }, { 0xe MSO_I, 0x10 MSO_I } +}; +const sal_uInt16 mso_sptActionButtonForwardBackSegm[] = +{ + 0x4000, 0x0003, 0x6001, 0x8000, + 0x4000, 0x0003, 0x6001, 0x8000, + 0x4000, 0x0003, 0x6001, 0x8000, + 0x4000, 0x0003, 0x6001, 0x8000, + 0x4000, 0x0003, 0x6001, 0x8000, + 0x4000, 0x0002, 0x6001, 0x8000 +}; +const SvxMSDffCalculationData mso_sptActionButtonForwardBackCalc[] = // adj value 0 - 5400 +{ + { 0x2000, { DFF_Prop_adjustValue, 0, 0 } }, + { 0x6000, { DFF_Prop_geoLeft, DFF_Prop_adjustValue, 0 } }, + { 0x6000, { DFF_Prop_geoTop, DFF_Prop_adjustValue, 0 } }, + { 0xa000, { DFF_Prop_geoRight, 0, DFF_Prop_adjustValue } }, + { 0xa000, { DFF_Prop_geoBottom, 0, DFF_Prop_adjustValue } }, + { 0x8000, { 10800, 0, DFF_Prop_adjustValue } }, + { 0x2001, { 0x0405, 1, 10800 } }, // scaling 6 + { 0x2001, { DFF_Prop_geoRight, 1, 2 } }, // lr center 7 + { 0x2001, { DFF_Prop_geoBottom, 1, 2 } }, // ul center 8 + + { 0x4001, { -8050, 0x0406, 1 } }, // 9 + { 0x6000, { 0x0409, 0x0407, 0 } }, // a + { 0x4001, { -8050, 0x0406, 1 } }, // b + { 0x6000, { 0x040b, 0x0408, 0 } }, // c + { 0x4001, { 8050, 0x0406, 1 } }, // d + { 0x6000, { 0x040d, 0x0407, 0 } }, // e + { 0x4001, { 8050, 0x0406, 1 } }, // f + { 0x6000, { 0x040f, 0x0408, 0 } } // 10 +}; +const mso_CustomShape msoActionButtonBackPrevious = +{ + const_cast<SvxMSDffVertPair*>(mso_sptActionButtonBackPreviousVert), SAL_N_ELEMENTS( mso_sptActionButtonBackPreviousVert ), + const_cast<sal_uInt16*>(mso_sptActionButtonForwardBackSegm), sizeof( mso_sptActionButtonForwardBackSegm ) >> 1, + const_cast<SvxMSDffCalculationData*>(mso_sptActionButtonForwardBackCalc), SAL_N_ELEMENTS( mso_sptActionButtonForwardBackCalc ), + const_cast<sal_Int32*>(mso_sptDefault1400), + const_cast<SvxMSDffTextRectangles*>(mso_sptActionButtonTextRect), SAL_N_ELEMENTS( mso_sptActionButtonTextRect ), + 21600, 21600, + 10800, 10800, + nullptr, 0, + const_cast<SvxMSDffHandle*>(mso_sptButtonHandle), SAL_N_ELEMENTS( mso_sptButtonHandle ) +}; + +const SvxMSDffVertPair mso_sptActionButtonForwardNextVert[] = +{ + { 0, 0 }, { 21600, 0 }, { 21600, 21600 }, { 0, 21600 }, + { 0, 0 }, { 21600, 0 }, { 3 MSO_I, 2 MSO_I }, { 1 MSO_I, 2 MSO_I }, + { 21600, 0 }, { 21600, 21600 }, { 3 MSO_I, 4 MSO_I }, { 3 MSO_I, 2 MSO_I }, + { 21600, 21600 }, { 0, 21600 }, { 1 MSO_I, 4 MSO_I }, { 3 MSO_I, 4 MSO_I }, + { 0, 21600 }, { 0, 0 }, { 1 MSO_I, 2 MSO_I }, { 1 MSO_I, 4 MSO_I }, + + { 0xa MSO_I, 0xc MSO_I }, { 0xe MSO_I, 8 MSO_I }, { 0xa MSO_I, 0x10 MSO_I } +}; +const mso_CustomShape msoActionButtonForwardNext = +{ + const_cast<SvxMSDffVertPair*>(mso_sptActionButtonForwardNextVert), SAL_N_ELEMENTS( mso_sptActionButtonForwardNextVert ), + const_cast<sal_uInt16*>(mso_sptActionButtonForwardBackSegm), sizeof( mso_sptActionButtonForwardBackSegm ) >> 1, + const_cast<SvxMSDffCalculationData*>(mso_sptActionButtonForwardBackCalc), SAL_N_ELEMENTS( mso_sptActionButtonForwardBackCalc ), + const_cast<sal_Int32*>(mso_sptDefault1400), + const_cast<SvxMSDffTextRectangles*>(mso_sptActionButtonTextRect), SAL_N_ELEMENTS( mso_sptActionButtonTextRect ), + 21600, 21600, + 10800, 10800, + nullptr, 0, + const_cast<SvxMSDffHandle*>(mso_sptButtonHandle), SAL_N_ELEMENTS( mso_sptButtonHandle ) +}; + +const SvxMSDffVertPair mso_sptActionButtonBeginningVert[] = +{ + { 0, 0 }, { 21600, 0 }, { 21600, 21600 }, { 0, 21600 }, + { 0, 0 }, { 21600, 0 }, { 3 MSO_I, 2 MSO_I }, { 1 MSO_I, 2 MSO_I }, + { 21600, 0 }, { 21600, 21600 }, { 3 MSO_I, 4 MSO_I }, { 3 MSO_I, 2 MSO_I }, + { 21600, 21600 }, { 0, 21600 }, { 1 MSO_I, 4 MSO_I }, { 3 MSO_I, 4 MSO_I }, + { 0, 21600 }, { 0, 0 }, { 1 MSO_I, 2 MSO_I }, { 1 MSO_I, 4 MSO_I }, + + { 0xa MSO_I, 8 MSO_I }, { 0xe MSO_I, 0xc MSO_I }, { 0xe MSO_I, 0x10 MSO_I }, { 0x12 MSO_I, 0xc MSO_I }, + { 0x14 MSO_I, 0xc MSO_I }, { 0x14 MSO_I, 0x10 MSO_I }, { 0x12 MSO_I, 0x10 MSO_I } +}; +const sal_uInt16 mso_sptActionButtonBeginningEndSegm[] = +{ + 0x4000, 0x0003, 0x6001, 0x8000, + 0x4000, 0x0003, 0x6001, 0x8000, + 0x4000, 0x0003, 0x6001, 0x8000, + 0x4000, 0x0003, 0x6001, 0x8000, + 0x4000, 0x0003, 0x6001, 0x8000, + + 0x4000, 0x0002, 0x6001, 0x8000, + 0x4000, 0x0003, 0x6001, 0x8000 +}; +const SvxMSDffCalculationData mso_sptActionButtonBeginningEndCalc[] = // adj value 0 - 5400 +{ + { 0x2000, { DFF_Prop_adjustValue, 0, 0 } }, + { 0x6000, { DFF_Prop_geoLeft, DFF_Prop_adjustValue, 0 } }, + { 0x6000, { DFF_Prop_geoTop, DFF_Prop_adjustValue, 0 } }, + { 0xa000, { DFF_Prop_geoRight, 0, DFF_Prop_adjustValue } }, + { 0xa000, { DFF_Prop_geoBottom, 0, DFF_Prop_adjustValue } }, + { 0x8000, { 10800, 0, DFF_Prop_adjustValue } }, + { 0x2001, { 0x0405, 1, 10800 } }, // scaling 6 + { 0x2001, { DFF_Prop_geoRight, 1, 2 } }, // lr center 7 + { 0x2001, { DFF_Prop_geoBottom, 1, 2 } }, // ul center 8 + + { 0x4001, { -4020, 0x0406, 1 } }, // 9 + { 0x6000, { 0x0409, 0x0407, 0 } }, // a + { 0x4001, { -8050, 0x0406, 1 } }, // b + { 0x6000, { 0x040b, 0x0408, 0 } }, // c + { 0x4001, { 8050, 0x0406, 1 } }, // d + { 0x6000, { 0x040d, 0x0407, 0 } }, // e + { 0x4001, { 8050, 0x0406, 1 } }, // f + { 0x6000, { 0x040f, 0x0408, 0 } }, // 10 + + { 0x4001, { -8050, 0x0406, 1 } }, // 11 + { 0x6000, { 0x0411, 0x0407, 0 } }, // 12 + { 0x4001, { -6140, 0x0406, 1 } }, // 13 + { 0x6000, { 0x0413, 0x0407, 0 } }, // 14 + + + { 0x4001, { 4020, 0x0406, 1 } }, // 15 + { 0x6000, { 0x0415, 0x0407, 0 } }, // 16 + { 0x4001, { 6140, 0x0406, 1 } }, // 17 + { 0x6000, { 0x0417, 0x0407, 0 } } // 18 +}; +const mso_CustomShape msoActionButtonBeginning = +{ + const_cast<SvxMSDffVertPair*>(mso_sptActionButtonBeginningVert), SAL_N_ELEMENTS( mso_sptActionButtonBeginningVert ), + const_cast<sal_uInt16*>(mso_sptActionButtonBeginningEndSegm), sizeof( mso_sptActionButtonBeginningEndSegm ) >> 1, + const_cast<SvxMSDffCalculationData*>(mso_sptActionButtonBeginningEndCalc), SAL_N_ELEMENTS( mso_sptActionButtonBeginningEndCalc ), + const_cast<sal_Int32*>(mso_sptDefault1400), + const_cast<SvxMSDffTextRectangles*>(mso_sptActionButtonTextRect), SAL_N_ELEMENTS( mso_sptActionButtonTextRect ), + 21600, 21600, + 10800, 10800, + nullptr, 0, + const_cast<SvxMSDffHandle*>(mso_sptButtonHandle), SAL_N_ELEMENTS( mso_sptButtonHandle ) +}; + +const SvxMSDffVertPair mso_sptActionButtonEndVert[] = +{ + { 0, 0 }, { 21600, 0 }, { 21600, 21600 }, { 0, 21600 }, + { 0, 0 }, { 21600, 0 }, { 3 MSO_I, 2 MSO_I }, { 1 MSO_I, 2 MSO_I }, + { 21600, 0 }, { 21600, 21600 }, { 3 MSO_I, 4 MSO_I }, { 3 MSO_I, 2 MSO_I }, + { 21600, 21600 }, { 0, 21600 }, { 1 MSO_I, 4 MSO_I }, { 3 MSO_I, 4 MSO_I }, + { 0, 21600 }, { 0, 0 }, { 1 MSO_I, 2 MSO_I }, { 1 MSO_I, 4 MSO_I }, + + { 0x16 MSO_I, 8 MSO_I }, { 0x12 MSO_I, 0x10 MSO_I }, { 0x12 MSO_I, 0xc MSO_I }, + + { 0x18 MSO_I, 0xc MSO_I }, { 0x18 MSO_I, 0x10 MSO_I }, { 0xe MSO_I, 0x10 MSO_I }, { 0xe MSO_I, 0xc MSO_I } +}; +const mso_CustomShape msoActionButtonEnd = +{ + const_cast<SvxMSDffVertPair*>(mso_sptActionButtonEndVert), SAL_N_ELEMENTS( mso_sptActionButtonEndVert ), + const_cast<sal_uInt16*>(mso_sptActionButtonBeginningEndSegm), sizeof( mso_sptActionButtonBeginningEndSegm ) >> 1, + const_cast<SvxMSDffCalculationData*>(mso_sptActionButtonBeginningEndCalc), SAL_N_ELEMENTS( mso_sptActionButtonBeginningEndCalc ), + const_cast<sal_Int32*>(mso_sptDefault1400), + const_cast<SvxMSDffTextRectangles*>(mso_sptActionButtonTextRect), SAL_N_ELEMENTS( mso_sptActionButtonTextRect ), + 21600, 21600, + 10800, 10800, + nullptr, 0, + const_cast<SvxMSDffHandle*>(mso_sptButtonHandle), SAL_N_ELEMENTS( mso_sptButtonHandle ) +}; + +const SvxMSDffVertPair mso_sptActionButtonReturnVert[] = +{ + { 0, 0 }, { 21600, 0 }, { 21600, 21600 }, { 0, 21600 }, + { 0, 0 }, { 21600, 0 }, { 3 MSO_I, 2 MSO_I }, { 1 MSO_I, 2 MSO_I }, + { 21600, 0 }, { 21600, 21600 }, { 3 MSO_I, 4 MSO_I }, { 3 MSO_I, 2 MSO_I }, + { 21600, 21600 }, { 0, 21600 }, { 1 MSO_I, 4 MSO_I }, { 3 MSO_I, 4 MSO_I }, + { 0, 21600 }, { 0, 0 }, { 1 MSO_I, 2 MSO_I }, { 1 MSO_I, 4 MSO_I }, + + { 0xa MSO_I, 0xc MSO_I }, { 0xe MSO_I, 0xc MSO_I }, { 0xe MSO_I, 0x10 MSO_I }, // ppp + { 0xe MSO_I, 0x12 MSO_I }, { 0x14 MSO_I, 0x16 MSO_I }, { 0x18 MSO_I, 0x16 MSO_I }, // ccp + { 7 MSO_I, 0x16 MSO_I }, // p + { 0x1a MSO_I, 0x16 MSO_I }, { 0x1c MSO_I, 0x12 MSO_I }, { 0x1c MSO_I, 0x10 MSO_I }, // ccp + { 0x1c MSO_I, 0xc MSO_I }, { 7 MSO_I, 0xc MSO_I }, { 0x1e MSO_I, 0x20 MSO_I }, { 0x22 MSO_I, 0xc MSO_I },// pppp + { 0x24 MSO_I, 0xc MSO_I }, { 0x24 MSO_I, 0x10 MSO_I }, // pp + { 0x24 MSO_I, 0x26 MSO_I }, { 0x28 MSO_I, 0x2a MSO_I }, { 7 MSO_I, 0x2a MSO_I }, // ccp + { 0x18 MSO_I, 0x2a MSO_I }, // p + { 0x2c MSO_I, 0x2a MSO_I }, { 0xa MSO_I, 0x26 MSO_I }, { 0xa MSO_I, 0x10 MSO_I } // ccp +}; +const sal_uInt16 mso_sptActionButtonReturnSegm[] = +{ + 0x4000, 0x0003, 0x6001, 0x8000, + 0x4000, 0x0003, 0x6001, 0x8000, + 0x4000, 0x0003, 0x6001, 0x8000, + 0x4000, 0x0003, 0x6001, 0x8000, + 0x4000, 0x0003, 0x6001, 0x8000, + 0x4000, 0x0002, 0x2001, 0x0001, 0x2001, 0x0006,0x2001, 0x0001, 0x2001, 0x6001, 0x8000 +}; +const SvxMSDffCalculationData mso_sptActionButtonReturnCalc[] = // adj value 0 - 5400 +{ + { 0x2000, { DFF_Prop_adjustValue, 0, 0 } }, + { 0x6000, { DFF_Prop_geoLeft, DFF_Prop_adjustValue, 0 } }, + { 0x6000, { DFF_Prop_geoTop, DFF_Prop_adjustValue, 0 } }, + { 0xa000, { DFF_Prop_geoRight, 0, DFF_Prop_adjustValue } }, + { 0xa000, { DFF_Prop_geoBottom, 0, DFF_Prop_adjustValue } }, + { 0x8000, { 10800, 0, DFF_Prop_adjustValue } }, + { 0x2001, { 0x0405, 1, 10800 } }, // scaling 6 + { 0x2001, { DFF_Prop_geoRight, 1, 2 } }, // lr center 7 + { 0x2001, { DFF_Prop_geoBottom, 1, 2 } }, // ul center 8 + + { 0x4001, { -8050, 0x0406, 1 } }, // 9 + { 0x6000, { 0x0409, 0x0407, 0 } }, // a + { 0x4001, { -3800, 0x0406, 1 } }, // b + { 0x6000, { 0x040b, 0x0408, 0 } }, // c + { 0x4001, { -4020, 0x0406, 1 } }, // d + { 0x6000, { 0x040d, 0x0407, 0 } }, // e + { 0x4001, { 2330, 0x0406, 1 } }, // f + { 0x6000, { 0x040f, 0x0408, 0 } }, // 10 + { 0x4001, { 3390, 0x0406, 1 } }, // 11 + { 0x6000, { 0x0411, 0x0408, 0 } }, // 12 + { 0x4001, { -3100, 0x0406, 1 } }, // 13 + { 0x6000, { 0x0413, 0x0407, 0 } }, // 14 + { 0x4001, { 4230, 0x0406, 1 } }, // 15 + { 0x6000, { 0x0415, 0x0408, 0 } }, // 16 + { 0x4001, { -1910, 0x0406, 1 } }, // 17 + { 0x6000, { 0x0417, 0x0407, 0 } }, // 18 + { 0x4001, { 1190, 0x0406, 1 } }, // 19 + { 0x6000, { 0x0419, 0x0407, 0 } }, // 1a + { 0x4001, { 2110, 0x0406, 1 } }, // 1b + { 0x6000, { 0x041b, 0x0407, 0 } }, // 1c + { 0x4001, { 4030, 0x0406, 1 } }, // 1d + { 0x6000, { 0x041d, 0x0407, 0 } }, // 1e + { 0x4001, { -7830, 0x0406, 1 } }, // 1f + { 0x6000, { 0x041f, 0x0408, 0 } }, // 20 + { 0x4001, { 8250, 0x0406, 1 } }, // 21 + { 0x6000, { 0x0421, 0x0407, 0 } }, // 22 + { 0x4001, { 6140, 0x0406, 1 } }, // 23 + { 0x6000, { 0x0423, 0x0407, 0 } }, // 24 + { 0x4001, { 5510, 0x0406, 1 } }, // 25 + { 0x6000, { 0x0425, 0x0408, 0 } }, // 26 + { 0x4001, { 3180, 0x0406, 1 } }, // 27 + { 0x6000, { 0x0427, 0x0407, 0 } }, // 28 + { 0x4001, { 8450, 0x0406, 1 } }, // 29 + { 0x6000, { 0x0429, 0x0408, 0 } }, // 2a + { 0x4001, { -5090, 0x0406, 1 } }, // 2b + { 0x6000, { 0x042b, 0x0407, 0 } } // 2c +}; +const mso_CustomShape msoActionButtonReturn = +{ + const_cast<SvxMSDffVertPair*>(mso_sptActionButtonReturnVert), SAL_N_ELEMENTS( mso_sptActionButtonReturnVert ), + const_cast<sal_uInt16*>(mso_sptActionButtonReturnSegm), sizeof( mso_sptActionButtonReturnSegm ) >> 1, + const_cast<SvxMSDffCalculationData*>(mso_sptActionButtonReturnCalc), SAL_N_ELEMENTS( mso_sptActionButtonReturnCalc ), + const_cast<sal_Int32*>(mso_sptDefault1400), + const_cast<SvxMSDffTextRectangles*>(mso_sptActionButtonTextRect), SAL_N_ELEMENTS( mso_sptActionButtonTextRect ), + 21600, 21600, + 10800, 10800, + nullptr, 0, + const_cast<SvxMSDffHandle*>(mso_sptButtonHandle), SAL_N_ELEMENTS( mso_sptButtonHandle ) +}; + +const SvxMSDffVertPair mso_sptActionButtonDocumentVert[] = +{ + { 0, 0 }, { 21600, 0 }, { 21600, 21600 }, { 0, 21600 }, + { 0, 0 }, { 21600, 0 }, { 3 MSO_I, 2 MSO_I }, { 1 MSO_I, 2 MSO_I }, + { 21600, 0 }, { 21600, 21600 }, { 3 MSO_I, 4 MSO_I }, { 3 MSO_I, 2 MSO_I }, + { 21600, 21600 }, { 0, 21600 }, { 1 MSO_I, 4 MSO_I }, { 3 MSO_I, 4 MSO_I }, + { 0, 21600 }, { 0, 0 }, { 1 MSO_I, 2 MSO_I }, { 1 MSO_I, 4 MSO_I }, + + { 0xa MSO_I, 0xc MSO_I }, { 0xe MSO_I, 0xc MSO_I }, { 0x10 MSO_I, 0x12 MSO_I }, { 0x10 MSO_I, 0x14 MSO_I }, + { 0xa MSO_I, 0x14 MSO_I }, { 0xe MSO_I, 0xc MSO_I }, { 0x10 MSO_I, 0x12 MSO_I }, { 0xe MSO_I, 0x12 MSO_I } +}; +const sal_uInt16 mso_sptActionButtonDocumentSegm[] = +{ + 0x4000, 0x0003, 0x6001, 0x8000, + 0x4000, 0x0003, 0x6001, 0x8000, + 0x4000, 0x0003, 0x6001, 0x8000, + 0x4000, 0x0003, 0x6001, 0x8000, + 0x4000, 0x0003, 0x6001, 0x8000, + + 0x4000, 0x0004, 0x6001, 0x8000, + 0x4000, 0x0002, 0x6001, 0x8000 +}; +const SvxMSDffCalculationData mso_sptActionButtonDocumentCalc[] = // adj value 0 - 5400 +{ + { 0x2000, { DFF_Prop_adjustValue, 0, 0 } }, + { 0x6000, { DFF_Prop_geoLeft, DFF_Prop_adjustValue, 0 } }, + { 0x6000, { DFF_Prop_geoTop, DFF_Prop_adjustValue, 0 } }, + { 0xa000, { DFF_Prop_geoRight, 0, DFF_Prop_adjustValue } }, + { 0xa000, { DFF_Prop_geoBottom, 0, DFF_Prop_adjustValue } }, + { 0x8000, { 10800, 0, DFF_Prop_adjustValue } }, + { 0x2001, { 0x0405, 1, 10800 } }, // scaling 6 + { 0x2001, { DFF_Prop_geoRight, 1, 2 } }, // lr center 7 + { 0x2001, { DFF_Prop_geoBottom, 1, 2 } }, // ul center 8 + + { 0x4001, { -6350, 0x0406, 1 } }, // 9 + { 0x6000, { 0x0409, 0x0407, 0 } }, // a + { 0x4001, { -7830, 0x0406, 1 } }, // b + { 0x6000, { 0x040b, 0x0408, 0 } }, // c + { 0x4001, { 1690, 0x0406, 1 } }, // d + { 0x6000, { 0x040d, 0x0407, 0 } }, // e + { 0x4001, { 6350, 0x0406, 1 } }, // f + { 0x6000, { 0x040f, 0x0407, 0 } }, // 10 + { 0x4001, { -3810, 0x0406, 1 } }, // 11 + { 0x6000, { 0x0411, 0x0408, 0 } }, // 12 + { 0x4001, { 7830, 0x0406, 1 } }, // 13 + { 0x6000, { 0x0413, 0x0408, 0 } } // 14 +}; +const mso_CustomShape msoActionButtonDocument = +{ + const_cast<SvxMSDffVertPair*>(mso_sptActionButtonDocumentVert), SAL_N_ELEMENTS( mso_sptActionButtonDocumentVert ), + const_cast<sal_uInt16*>(mso_sptActionButtonDocumentSegm), sizeof( mso_sptActionButtonDocumentSegm ) >> 1, + const_cast<SvxMSDffCalculationData*>(mso_sptActionButtonDocumentCalc), SAL_N_ELEMENTS( mso_sptActionButtonDocumentCalc ), + const_cast<sal_Int32*>(mso_sptDefault1400), + const_cast<SvxMSDffTextRectangles*>(mso_sptActionButtonTextRect), SAL_N_ELEMENTS( mso_sptActionButtonTextRect ), + 21600, 21600, + 10800, 10800, + nullptr, 0, + const_cast<SvxMSDffHandle*>(mso_sptButtonHandle), SAL_N_ELEMENTS( mso_sptButtonHandle ) +}; + +const SvxMSDffVertPair mso_sptActionButtonSoundVert[] = +{ + { 0, 0 }, { 21600, 0 }, { 21600, 21600 }, { 0, 21600 }, + { 0, 0 }, { 21600, 0 }, { 3 MSO_I, 2 MSO_I }, { 1 MSO_I, 2 MSO_I }, + { 21600, 0 }, { 21600, 21600 }, { 3 MSO_I, 4 MSO_I }, { 3 MSO_I, 2 MSO_I }, + { 21600, 21600 }, { 0, 21600 }, { 1 MSO_I, 4 MSO_I }, { 3 MSO_I, 4 MSO_I }, + { 0, 21600 }, { 0, 0 }, { 1 MSO_I, 2 MSO_I }, { 1 MSO_I, 4 MSO_I }, + + { 0xa MSO_I, 0xc MSO_I }, { 0xe MSO_I, 0xc MSO_I }, { 0x10 MSO_I, 0x12 MSO_I }, { 0x10 MSO_I, 0x14 MSO_I }, + { 0xe MSO_I, 0x16 MSO_I }, { 0xa MSO_I, 0x16 MSO_I }, { 0x18 MSO_I, 8 MSO_I }, { 0x1a MSO_I, 8 MSO_I }, + + { 0x18 MSO_I, 0xc MSO_I }, { 0x1a MSO_I, 0x1c MSO_I }, + + { 0x18 MSO_I, 0x16 MSO_I }, { 0x1a MSO_I, 0x1e MSO_I } +}; +const sal_uInt16 mso_sptActionButtonSoundSegm[] = +{ + 0x4000, 0x0003, 0x6001, 0x8000, + 0x4000, 0x0003, 0x6001, 0x8000, + 0x4000, 0x0003, 0x6001, 0x8000, + 0x4000, 0x0003, 0x6001, 0x8000, + 0x4000, 0x0003, 0x6001, 0x8000, + + 0x4000, 0x0005, 0x6001, 0x8000, + 0x4000, 0x0001, 0x8000, + 0x4000, 0x0001, 0x8000, + 0x4000, 0x0001, 0x8000 +}; +const SvxMSDffCalculationData mso_sptActionButtonSoundCalc[] = // adj value 0 - 5400 +{ + { 0x2000, { DFF_Prop_adjustValue, 0, 0 } }, + { 0x6000, { DFF_Prop_geoLeft, DFF_Prop_adjustValue, 0 } }, + { 0x6000, { DFF_Prop_geoTop, DFF_Prop_adjustValue, 0 } }, + { 0xa000, { DFF_Prop_geoRight, 0, DFF_Prop_adjustValue } }, + { 0xa000, { DFF_Prop_geoBottom, 0, DFF_Prop_adjustValue } }, + { 0x8000, { 10800, 0, DFF_Prop_adjustValue } }, + { 0x2001, { 0x0405, 1, 10800 } }, // scaling 6 + { 0x2001, { DFF_Prop_geoRight, 1, 2 } }, // lr center 7 + { 0x2001, { DFF_Prop_geoBottom, 1, 2 } }, // ul center 8 + + { 0x4001, { -8050, 0x0406, 1 } }, // 9 + { 0x6000, { 0x0409, 0x0407, 0 } }, // a + { 0x4001, { -2750, 0x0406, 1 } }, // b + { 0x6000, { 0x040b, 0x0408, 0 } }, // c + { 0x4001, { -2960, 0x0406, 1 } }, // d + { 0x6000, { 0x040d, 0x0407, 0 } }, // e + { 0x4001, { 2120, 0x0406, 1 } }, // f + { 0x6000, { 0x040f, 0x0407, 0 } }, // 10 + { 0x4001, { -8050, 0x0406, 1 } }, // 11 + { 0x6000, { 0x0411, 0x0408, 0 } }, // 12 + { 0x4001, { 8050, 0x0406, 1 } }, // 13 + { 0x6000, { 0x0413, 0x0408, 0 } }, // 14 + { 0x4001, { 2750, 0x0406, 1 } }, // 15 + { 0x6000, { 0x0415, 0x0408, 0 } }, // 16 + { 0x4001, { 4020, 0x0406, 1 } }, // 17 + { 0x6000, { 0x0417, 0x0407, 0 } }, // 18 + { 0x4001, { 8050, 0x0406, 1 } }, // 19 + { 0x6000, { 0x0419, 0x0407, 0 } }, // 1a + { 0x4001, { -5930, 0x0406, 1 } }, // 1b + { 0x6000, { 0x041b, 0x0408, 0 } }, // 1c + { 0x4001, { 5930, 0x0406, 1 } }, // 1d + { 0x6000, { 0x041d, 0x0408, 0 } } // 1e +}; +const mso_CustomShape msoActionButtonSound = +{ + const_cast<SvxMSDffVertPair*>(mso_sptActionButtonSoundVert), SAL_N_ELEMENTS( mso_sptActionButtonSoundVert ), + const_cast<sal_uInt16*>(mso_sptActionButtonSoundSegm), sizeof( mso_sptActionButtonSoundSegm ) >> 1, + const_cast<SvxMSDffCalculationData*>(mso_sptActionButtonSoundCalc), SAL_N_ELEMENTS( mso_sptActionButtonSoundCalc ), + const_cast<sal_Int32*>(mso_sptDefault1400), + const_cast<SvxMSDffTextRectangles*>(mso_sptActionButtonTextRect), SAL_N_ELEMENTS( mso_sptActionButtonTextRect ), + 21600, 21600, + 10800, 10800, + nullptr, 0, + const_cast<SvxMSDffHandle*>(mso_sptButtonHandle), SAL_N_ELEMENTS( mso_sptButtonHandle ) +}; + +const SvxMSDffVertPair mso_sptActionButtonMovieVert[] = +{ + { 0, 0 }, { 21600, 0 }, { 21600, 21600 }, { 0, 21600 }, + { 0, 0 }, { 21600, 0 }, { 3 MSO_I, 2 MSO_I }, { 1 MSO_I, 2 MSO_I }, + { 21600, 0 }, { 21600, 21600 }, { 3 MSO_I, 4 MSO_I }, { 3 MSO_I, 2 MSO_I }, + { 21600, 21600 }, { 0, 21600 }, { 1 MSO_I, 4 MSO_I }, { 3 MSO_I, 4 MSO_I }, + { 0, 21600 }, { 0, 0 }, { 1 MSO_I, 2 MSO_I }, { 1 MSO_I, 4 MSO_I }, + + { 0xa MSO_I, 0xc MSO_I }, { 0xe MSO_I, 0xc MSO_I }, { 0x10 MSO_I, 0x12 MSO_I }, { 0x14 MSO_I, 0x12 MSO_I }, + { 0x16 MSO_I, 0x18 MSO_I }, { 0x16 MSO_I, 0x1a MSO_I }, { 0x1c MSO_I, 0x1a MSO_I }, { 0x1e MSO_I, 0x18 MSO_I }, + { 0x20 MSO_I, 0x18 MSO_I }, { 0x20 MSO_I, 0x22 MSO_I }, { 0x1e MSO_I, 0x22 MSO_I }, { 0x1c MSO_I, 0x24 MSO_I }, + { 0x16 MSO_I, 0x24 MSO_I }, { 0x16 MSO_I, 0x26 MSO_I }, { 0x2a MSO_I, 0x26 MSO_I }, { 0x2a MSO_I, 0x28 MSO_I }, + { 0x10 MSO_I, 0x28 MSO_I }, { 0xe MSO_I, 0x2c MSO_I }, { 0xa MSO_I, 0x2c MSO_I } +}; +const sal_uInt16 mso_sptActionButtonMovieSegm[] = +{ + 0x4000, 0x0003, 0x6001, 0x8000, + 0x4000, 0x0003, 0x6001, 0x8000, + 0x4000, 0x0003, 0x6001, 0x8000, + 0x4000, 0x0003, 0x6001, 0x8000, + 0x4000, 0x0003, 0x6001, 0x8000, + 0x4000, 0x0012, 0x6001, 0x8000 +}; +const SvxMSDffCalculationData mso_sptActionButtonMovieCalc[] = // adj value 0 - 5400 +{ + { 0x2000, { DFF_Prop_adjustValue, 0, 0 } }, + { 0x6000, { DFF_Prop_geoLeft, DFF_Prop_adjustValue, 0 } }, + { 0x6000, { DFF_Prop_geoTop, DFF_Prop_adjustValue, 0 } }, + { 0xa000, { DFF_Prop_geoRight, 0, DFF_Prop_adjustValue } }, + { 0xa000, { DFF_Prop_geoBottom, 0, DFF_Prop_adjustValue } }, + { 0x8000, { 10800, 0, DFF_Prop_adjustValue } }, + { 0x2001, { 0x0405, 1, 10800 } }, // scaling 6 + { 0x2001, { DFF_Prop_geoRight, 1, 2 } }, // lr center 7 + { 0x2001, { DFF_Prop_geoBottom, 1, 2 } }, // ul center 8 + + { 0x4001, { -8050, 0x0406, 1 } }, // 9 + { 0x6000, { 0x0409, 0x0407, 0 } }, // a + { 0x4001, { -4020, 0x0406, 1 } }, // b + { 0x6000, { 0x040b, 0x0408, 0 } }, // c + { 0x4001, { -7000, 0x0406, 1 } }, // d + { 0x6000, { 0x040d, 0x0407, 0 } }, // e + { 0x4001, { -6560, 0x0406, 1 } }, // f + { 0x6000, { 0x040f, 0x0407, 0 } }, // 10 + { 0x4001, { -3600, 0x0406, 1 } }, // 11 + { 0x6000, { 0x0411, 0x0408, 0 } }, // 12 + { 0x4001, { 4020, 0x0406, 1 } }, // 13 + { 0x6000, { 0x0413, 0x0407, 0 } }, // 14 + { 0x4001, { 4660, 0x0406, 1 } }, // 15 + { 0x6000, { 0x0415, 0x0407, 0 } }, // 16 + { 0x4001, { -2960, 0x0406, 1 } }, // 17 + { 0x6000, { 0x0417, 0x0408, 0 } }, // 18 + { 0x4001, { -2330, 0x0406, 1 } }, // 19 + { 0x6000, { 0x0419, 0x0408, 0 } }, // 1a + { 0x4001, { 6780, 0x0406, 1 } }, // 1b + { 0x6000, { 0x041b, 0x0407, 0 } }, // 1c + { 0x4001, { 7200, 0x0406, 1 } }, // 1d + { 0x6000, { 0x041d, 0x0407, 0 } }, // 1e + { 0x4001, { 8050, 0x0406, 1 } }, // 1f + { 0x6000, { 0x041f, 0x0407, 0 } }, // 20 + { 0x4001, { 2960, 0x0406, 1 } }, // 21 + { 0x6000, { 0x0421, 0x0408, 0 } }, // 22 + { 0x4001, { 2330, 0x0406, 1 } }, // 23 + { 0x6000, { 0x0423, 0x0408, 0 } }, // 24 + { 0x4001, { 3800, 0x0406, 1 } }, // 25 + { 0x6000, { 0x0425, 0x0408, 0 } }, // 26 + { 0x4001, { -1060, 0x0406, 1 } }, // 27 + { 0x6000, { 0x0427, 0x0408, 0 } }, // 28 + { 0x4001, { -6350, 0x0406, 1 } }, // 29 + { 0x6000, { 0x0429, 0x0407, 0 } }, // 2a + { 0x4001, { -640, 0x0406, 1 } }, // 2b + { 0x6000, { 0x042b, 0x0408, 0 } } // 2c +}; +const mso_CustomShape msoActionButtonMovie = +{ + const_cast<SvxMSDffVertPair*>(mso_sptActionButtonMovieVert), SAL_N_ELEMENTS( mso_sptActionButtonMovieVert ), + const_cast<sal_uInt16*>(mso_sptActionButtonMovieSegm), sizeof( mso_sptActionButtonMovieSegm ) >> 1, + const_cast<SvxMSDffCalculationData*>(mso_sptActionButtonMovieCalc), SAL_N_ELEMENTS( mso_sptActionButtonMovieCalc ), + const_cast<sal_Int32*>(mso_sptDefault1400), + const_cast<SvxMSDffTextRectangles*>(mso_sptActionButtonTextRect), SAL_N_ELEMENTS( mso_sptActionButtonTextRect ), + 21600, 21600, + 10800, 10800, + nullptr, 0, + const_cast<SvxMSDffHandle*>(mso_sptButtonHandle), SAL_N_ELEMENTS( mso_sptButtonHandle ) +}; + +const SvxMSDffVertPair mso_sptSmileyFaceVert[] = // adj value 15510 - 17520 +{ + { 10800, 10800 }, { 10800, 10800 }, { 0, 360 }, + { 7305, 7515 }, { 1000, 1865 }, { 0, 360 }, + { 14295, 7515 }, { 1000, 1865 }, { 0, 360 }, + { 4870, 1 MSO_I }, { 8680, 2 MSO_I }, { 12920, 2 MSO_I }, { 16730, 1 MSO_I } +}; +const sal_uInt16 mso_sptSmileyFaceSegm[] = +{ + 0xa203, 0x6000, 0x8000, + 0xa203, 0x6000, 0x8000, + 0xa203, 0x6000, 0x8000, + 0x4000, 0x2001, 0xaa00, 0x8000 +}; +const SvxMSDffCalculationData mso_sptSmileyFaceCalc[] = +{ + { 0x2000, { DFF_Prop_adjustValue, 0, 14510 } }, + { 0x8000, { 18520, 0, 0x400 } }, + { 0x4000, { 14510, 0x400, 0 } } +}; + +const sal_Int32 mso_sptSmileyFaceDefault[] = +{ + 1, 18520 +}; +const SvxMSDffHandle mso_sptSmileyHandle[] = +{ + { SvxMSDffHandleFlags::RANGE, + 10800, 0x100, 10800, 10800, MIN_INT32, 0x7fffffff, 14510, 18520 } +}; +const mso_CustomShape msoSmileyFace = +{ + const_cast<SvxMSDffVertPair*>(mso_sptSmileyFaceVert), SAL_N_ELEMENTS( mso_sptSmileyFaceVert ), + const_cast<sal_uInt16*>(mso_sptSmileyFaceSegm), sizeof( mso_sptSmileyFaceSegm ) >> 1, + const_cast<SvxMSDffCalculationData*>(mso_sptSmileyFaceCalc), SAL_N_ELEMENTS( mso_sptSmileyFaceCalc ), + const_cast<sal_Int32*>(mso_sptSmileyFaceDefault), + const_cast<SvxMSDffTextRectangles*>(mso_sptEllipseTextRect), SAL_N_ELEMENTS( mso_sptEllipseTextRect ), + 21600, 21600, + MIN_INT32, MIN_INT32, + const_cast<SvxMSDffVertPair*>(mso_sptEllipseGluePoints), SAL_N_ELEMENTS( mso_sptEllipseGluePoints ), + const_cast<SvxMSDffHandle*>(mso_sptSmileyHandle), SAL_N_ELEMENTS( mso_sptSmileyHandle ) // handles +}; + +const SvxMSDffVertPair mso_sptDonutVert[] = // adj value 0 - 10800 +{ + { 10800, 10800 }, { 10800, 10800 }, { 0, 360 }, + { 10800, 10800 }, { 1 MSO_I, 1 MSO_I }, { 0, 360 } +}; +const sal_uInt16 mso_sptDonutSegm[] = +{ + 0xa203, 0x6000, 0xa203, 0x8000 +}; +const SvxMSDffCalculationData mso_sptDonutCalc[] = +{ + { 0x2000, { DFF_Prop_adjustValue, 0, 0 } }, + { 0x8000, { 10800, 0, DFF_Prop_adjustValue } } +}; +const SvxMSDffHandle mso_sptDonutHandle[] = +{ + { SvxMSDffHandleFlags::RANGE, + 0x100, 10800, 10800, 10800, 0, 10800, MIN_INT32, 0x7fffffff } +}; +const mso_CustomShape msoDonut = +{ + const_cast<SvxMSDffVertPair*>(mso_sptDonutVert), SAL_N_ELEMENTS( mso_sptDonutVert ), + const_cast<sal_uInt16*>(mso_sptDonutSegm), sizeof( mso_sptDonutSegm ) >> 1, + const_cast<SvxMSDffCalculationData*>(mso_sptDonutCalc), SAL_N_ELEMENTS( mso_sptDonutCalc ), + const_cast<sal_Int32*>(mso_sptDefault5400), + const_cast<SvxMSDffTextRectangles*>(mso_sptEllipseTextRect), SAL_N_ELEMENTS( mso_sptEllipseTextRect ), + 21600, 21600, + MIN_INT32, MIN_INT32, + const_cast<SvxMSDffVertPair*>(mso_sptEllipseGluePoints), SAL_N_ELEMENTS( mso_sptEllipseGluePoints ), + const_cast<SvxMSDffHandle*>(mso_sptDonutHandle), SAL_N_ELEMENTS( mso_sptDonutHandle ) // handles +}; + +const SvxMSDffVertPair mso_sptNoSmokingVert[] = // adj value 0 - 7200 +{ + { 10800, 10800 }, { 10800, 10800 }, { 0, 360 }, + { 0 MSO_I, 0 MSO_I }, { 1 MSO_I, 1 MSO_I }, + { 9 MSO_I, 0xa MSO_I }, { 0xb MSO_I, 0xc MSO_I }, { 0 MSO_I, 0 MSO_I }, { 1 MSO_I, 1 MSO_I }, + { 0xd MSO_I, 0xe MSO_I }, { 0xf MSO_I, 0x10 MSO_I } +}; +const sal_uInt16 mso_sptNoSmokingSegm[] = +{ + 0xa203, 0x6000, 0xa404, 0x6000, 0xa404, 0x6000, 0x8000 +}; +const SvxMSDffCalculationData mso_sptNoSmokingCalc[] = +{ + { 0x2000, { DFF_Prop_adjustValue, 0, 0 } }, // 0 + { 0x8000, { 21600, 0, DFF_Prop_adjustValue } }, // 1 + { 0x8000, { 10800, 0, DFF_Prop_adjustValue } }, // 2 + { 0x2001, { DFF_Prop_adjustValue, 1, 2 } }, // 3 + { 0xa080, { 0x403, 0, 0x402 } }, // 4 + { 0x8000, { 10800, 0, 0x403 } }, // 5 x1 + { 0x4000, { 10800, 0x403, 0 } }, // 6 x2 + { 0x8000, { 10800, 0, 0x404 } }, // 7 y1 + { 0x4000, { 10800, 0x404, 0 } }, // 8 y2 + { 0x6081, { 0x405, 0x407, 45 } }, // 9 + { 0x6082, { 0x405, 0x407, 45 } }, // a + { 0x6081, { 0x405, 0x408, 45 } }, // b + { 0x6082, { 0x405, 0x408, 45 } }, // c + { 0x6081, { 0x406, 0x408, 45 } }, // d + { 0x6082, { 0x406, 0x408, 45 } }, // e + { 0x6081, { 0x406, 0x407, 45 } }, // f + { 0x6082, { 0x406, 0x407, 45 } } // 10 +}; +const SvxMSDffHandle mso_sptNoSmokingHandle[] = +{ + { SvxMSDffHandleFlags::RANGE, + 0x100, 10800, 10800, 10800, 0, 7200, MIN_INT32, 0x7fffffff } +}; +const mso_CustomShape msoNoSmoking = +{ + const_cast<SvxMSDffVertPair*>(mso_sptNoSmokingVert), SAL_N_ELEMENTS( mso_sptNoSmokingVert ), + const_cast<sal_uInt16*>(mso_sptNoSmokingSegm), sizeof( mso_sptNoSmokingSegm ) >> 1, + const_cast<SvxMSDffCalculationData*>(mso_sptNoSmokingCalc), SAL_N_ELEMENTS( mso_sptNoSmokingCalc ), + const_cast<sal_Int32*>(mso_sptDefault2700), + const_cast<SvxMSDffTextRectangles*>(mso_sptEllipseTextRect), SAL_N_ELEMENTS( mso_sptEllipseTextRect ), + 21600, 21600, + MIN_INT32, MIN_INT32, + const_cast<SvxMSDffVertPair*>(mso_sptEllipseGluePoints), SAL_N_ELEMENTS( mso_sptEllipseGluePoints ), + const_cast<SvxMSDffHandle*>(mso_sptNoSmokingHandle), SAL_N_ELEMENTS( mso_sptNoSmokingHandle ) // handles +}; + +const SvxMSDffVertPair mso_sptBlockArcVert[] = // adj value 0 (degrees) +{ // adj value 1: 0 -> 10800; + { 0, 0 }, { 21600, 21600 }, { 4 MSO_I, 3 MSO_I }, { 2 MSO_I, 3 MSO_I }, + { 5 MSO_I, 5 MSO_I }, { 6 MSO_I, 6 MSO_I }, { 2 MSO_I, 3 MSO_I }, { 4 MSO_I, 3 MSO_I } +}; +const sal_uInt16 mso_sptBlockArcSegm[] = +{ + 0xA404, 0xa504, 0x6001, 0x8000 +}; +const sal_Int32 mso_sptBlockArcDefault[] = +{ + 2, 180, 5400 +}; +const SvxMSDffCalculationData mso_sptBlockArcCalc[] = +{ + { 0x400a, { 10800, DFF_Prop_adjustValue, 0 } }, + { 0x4009, { 10800, DFF_Prop_adjustValue, 0 } }, + { 0x2000, { 0x400, 10800, 0 } }, + { 0x2000, { 0x401, 10800, 0 } }, + { 0x8000, { 21600, 0, 0x402 } }, + { 0x8000, { 10800, 0, DFF_Prop_adjust2Value } }, + { 0x4000, { 10800, DFF_Prop_adjust2Value, 0 } }, + { 0x600a, { 0x405, DFF_Prop_adjustValue, 0 } }, + { 0x6009, { 0x405, DFF_Prop_adjustValue, 0 } } +}; +const SvxMSDffHandle mso_sptBlockArcHandle[] = +{ + { SvxMSDffHandleFlags::POLAR | SvxMSDffHandleFlags::RADIUS_RANGE, + 0x101, 0x100, 10800, 10800, 0, 10800, MIN_INT32, 0x7fffffff } +}; +const mso_CustomShape msoBlockArc = +{ + const_cast<SvxMSDffVertPair*>(mso_sptBlockArcVert), SAL_N_ELEMENTS( mso_sptBlockArcVert ), + const_cast<sal_uInt16*>(mso_sptBlockArcSegm), sizeof( mso_sptBlockArcSegm ) >> 1, + const_cast<SvxMSDffCalculationData*>(mso_sptBlockArcCalc), SAL_N_ELEMENTS( mso_sptBlockArcCalc ), + const_cast<sal_Int32*>(mso_sptBlockArcDefault), + nullptr, 0, + 21600, 21600, + MIN_INT32, MIN_INT32, + nullptr, 0, + const_cast<SvxMSDffHandle*>(mso_sptBlockArcHandle), SAL_N_ELEMENTS( mso_sptBlockArcHandle ) // handles +}; + +// aware : control points are always part of the bounding box +const SvxMSDffVertPair mso_sptHeartVert[] = +{ + { 10800, 21599 }, { 321, 6886 }, { 70, 6036 }, // ppp + { -9, 5766 }, { -1, 5474 }, { 2, 5192 }, // ccp + { 6, 4918 }, { 43, 4641 }, { 101, 4370 }, // ccp + { 159, 4103 }, { 245, 3837 }, { 353, 3582 }, // ccp + { 460, 3326 }, { 591, 3077 }, { 741, 2839 }, // ccp + { 892, 2598 }, { 1066, 2369 }, { 1253, 2155 }, // ccp + { 1443, 1938 }, { 1651, 1732 }, { 1874, 1543 }, // ccp + { 2097, 1351 }, { 2337, 1174 }, { 2587, 1014 }, // ccp + { 2839, 854 }, { 3106, 708 }, { 3380, 584 }, // ccp + { 3656, 459 }, { 3945, 350 }, { 4237, 264 }, // ccp + { 4533, 176 }, { 4838, 108 }, { 5144, 66 }, // ccp + { 5454, 22 }, { 5771, 1 }, { 6086, 3 }, // ccp + { 6407, 7 }, { 6731, 35 }, { 7048, 89 }, // ccp + { 7374, 144 }, { 7700, 226 }, { 8015, 335 }, // ccp + { 8344, 447 }, { 8667, 590 }, { 8972, 756 }, // ccp + { 9297, 932 }, { 9613, 1135 }, { 9907, 1363 }, // ccp + { 10224, 1609 }, { 10504, 1900 }, { 10802, 2169 }, // ccp + { 11697, 1363 }, // p + { 11971, 1116 }, { 12304, 934 }, { 12630, 756 }, // ccp + { 12935, 590 }, { 13528, 450 }, { 13589, 335 }, // ccp + { 13901, 226 }, { 14227, 144 }, { 14556, 89 }, // ccp + { 14872, 35 }, { 15195, 7 }, { 15517, 3 }, // ccp + { 15830, 0 }, { 16147, 22 }, { 16458, 66 }, // ccp + { 16764, 109 }, { 17068, 177 }, { 17365, 264 }, // ccp + { 17658, 349 }, { 17946, 458 }, { 18222, 584 }, // ccp + { 18496, 708 }, { 18762, 854 }, { 19015, 1014 }, // ccp + { 19264, 1172 }, { 19504, 1349 }, { 19730, 1543 }, // ccp + { 19950, 1731 }, { 20158, 1937 }, { 20350, 2155 }, // ccp + { 20536, 2369 }, { 20710, 2598 }, { 20861, 2839 }, // ccp + { 21010, 3074 }, { 21143, 3323 }, { 21251, 3582 }, // ccp + { 21357, 3835 }, { 21443, 4099 }, { 21502, 4370 }, // ccp + { 21561, 4639 }, { 21595, 4916 }, { 21600, 5192 }, // ccp + { 21606, 5474 }, { 21584, 5760 }, { 21532, 6036 }, // ccp + { 21478, 6326 }, { 21366, 6603 }, { 21282, 6887 }, // ccp + { 10802, 21602 } // p +}; +const sal_uInt16 mso_sptHeartSegm[] = +{ + 0x4000, 0x0002, 0x2010, 0x0001, 0x2010, 0x0001, 0x6001, 0x8000 +}; +const SvxMSDffTextRectangles mso_sptHeartTextRect[] = +{ + { { 5080, 2540 }, { 16520, 13550 } } +}; +const SvxMSDffVertPair mso_sptHeartGluePoints[] = +{ + { 10800, 2180 }, { 3090, 10800 }, { 10800, 21600 }, { 18490, 10800 } +}; +const mso_CustomShape msoHeart = +{ + const_cast<SvxMSDffVertPair*>(mso_sptHeartVert), SAL_N_ELEMENTS( mso_sptHeartVert ), + const_cast<sal_uInt16*>(mso_sptHeartSegm), sizeof( mso_sptHeartSegm ) >> 1, + nullptr, 0, + nullptr, + const_cast<SvxMSDffTextRectangles*>(mso_sptHeartTextRect), SAL_N_ELEMENTS( mso_sptHeartTextRect ), + 21615, 21602, + MIN_INT32, MIN_INT32, + const_cast<SvxMSDffVertPair*>(mso_sptHeartGluePoints), SAL_N_ELEMENTS( mso_sptHeartGluePoints ), + nullptr, 0 // handles +}; + +const SvxMSDffVertPair mso_sptLightningBoldVert[] = +{ + { 8458, 0 }, { 0, 3923 }, { 7564, 8416 }, { 4993, 9720 }, + { 12197, 13904 }, { 9987, 14934 }, { 21600, 21600 }, { 14768, 12911 }, + { 16558, 12016 }, { 11030, 6840 }, { 12831, 6120 }, { 8458, 0 } +}; +const SvxMSDffTextRectangles mso_sptLightningBoldTextRect[] = +{ + { { 8680, 7410 }, { 13970, 14190 } } +}; +const SvxMSDffVertPair mso_sptLightningBoldGluePoints[] = +{ + { 8458, 0 }, { 0, 3923 }, { 4993, 9720 }, { 9987, 14934 }, { 21600, 21600 }, + { 16558, 12016 }, { 12831, 6120 } +}; +const mso_CustomShape msoLightningBold = +{ + const_cast<SvxMSDffVertPair*>(mso_sptLightningBoldVert), SAL_N_ELEMENTS( mso_sptLightningBoldVert ), + nullptr, 0, + nullptr, 0, + nullptr, + const_cast<SvxMSDffTextRectangles*>(mso_sptLightningBoldTextRect), SAL_N_ELEMENTS( mso_sptLightningBoldTextRect ), + 21600, 21600, + MIN_INT32, MIN_INT32, + const_cast<SvxMSDffVertPair*>(mso_sptLightningBoldGluePoints), SAL_N_ELEMENTS( mso_sptLightningBoldGluePoints ), + nullptr, 0 // handles +}; + +const SvxMSDffVertPair mso_sptSunVert[] = // adj value 2700 -> 10125 +{ + { 0, 10800 }, { 4 MSO_I, 8 MSO_I }, { 4 MSO_I, 9 MSO_I }, + { 0x0a MSO_I, 0x0b MSO_I }, { 0x0c MSO_I, 0x0d MSO_I }, { 0x0e MSO_I, 0x0f MSO_I }, + { 0x10 MSO_I, 0x11 MSO_I }, { 0x12 MSO_I, 0x13 MSO_I }, { 0x14 MSO_I, 0x15 MSO_I }, + { 0x16 MSO_I, 0x17 MSO_I }, { 0x18 MSO_I, 0x19 MSO_I }, { 0x1a MSO_I, 0x1b MSO_I }, + { 0x1c MSO_I, 0x1d MSO_I }, { 0x1e MSO_I, 0x1f MSO_I }, { 0x20 MSO_I, 0x21 MSO_I }, + { 0x22 MSO_I, 0x23 MSO_I }, { 0x24 MSO_I, 0x25 MSO_I }, { 0x26 MSO_I, 0x27 MSO_I }, + { 0x28 MSO_I, 0x29 MSO_I }, { 0x2a MSO_I, 0x2b MSO_I }, { 0x2c MSO_I, 0x2d MSO_I }, + { 0x2e MSO_I, 0x2f MSO_I }, { 0x30 MSO_I, 0x31 MSO_I }, { 0x32 MSO_I, 0x33 MSO_I }, + { 10800, 10800 }, { 0x36 MSO_I, 0x36 MSO_I }, { 0, 360 } +}; +const sal_uInt16 mso_sptSunSegm[] = +{ + 0x4000, 0x0002, 0x6001, 0x8000, + 0x4000, 0x0002, 0x6001, 0x8000, + 0x4000, 0x0002, 0x6001, 0x8000, + 0x4000, 0x0002, 0x6001, 0x8000, + 0x4000, 0x0002, 0x6001, 0x8000, + 0x4000, 0x0002, 0x6001, 0x8000, + 0x4000, 0x0002, 0x6001, 0x8000, + 0x4000, 0x0002, 0x6001, 0x8000, + 0xa203, 0x6000, 0x8000 +}; +const SvxMSDffCalculationData mso_sptSunCalc[] = +{ + { 0x2000, { DFF_Prop_adjustValue, 0, 0 } }, + { 0x8000, { 21600, 0, DFF_Prop_adjustValue } }, + { 0x2000, { DFF_Prop_adjustValue, 0, 2700 } }, + { 0x2001, { 0x402, 5080, 7425 } }, + { 0x2000, { 0x403, 2540, 0 } }, + { 0x8000, { 10125, 0, DFF_Prop_adjustValue } }, + { 0x2001, { 0x405, 2120, 7425 } }, + { 0x2000, { 0x406, 210, 0 } }, + { 0x4000, { 10800, 0x407, 0 } }, // y1 (0x8) + { 0x8000, { 10800, 0, 0x407 } }, // y2 (0x9) + { 0x0081, { 0, 10800, 45 } }, // 0xa + { 0x0082, { 0, 10800, 45 } }, // 0xb + { 0x6081, { 0x404, 0x408, 45 } }, // 0xc + { 0x6082, { 0x404, 0x408, 45 } }, // 0xd + { 0x6081, { 0x404, 0x409, 45 } }, // 0xe + { 0x6082, { 0x404, 0x409, 45 } }, // 0xf + { 0x0081, { 0, 10800, 90 } }, // 0x10 + { 0x0082, { 0, 10800, 90 } }, // 0x11 + { 0x6081, { 0x404, 0x408, 90 } }, // 0x12 + { 0x6082, { 0x404, 0x408, 90 } }, // 0x13 + { 0x6081, { 0x404, 0x409, 90 } }, // 0x14 + { 0x6082, { 0x404, 0x409, 90 } }, // 0x15 + { 0x0081, { 0, 10800, 135 } }, // 0x16 + { 0x0082, { 0, 10800, 135 } }, // 0x17 + { 0x6081, { 0x404, 0x408, 135 } }, // 0x18 + { 0x6082, { 0x404, 0x408, 135 } }, // 0x19 + { 0x6081, { 0x404, 0x409, 135 } }, // 0x1a + { 0x6082, { 0x404, 0x409, 135 } }, // 0x1b + { 0x0081, { 0, 10800, 180 } }, // 0x1c + { 0x0082, { 0, 10800, 180 } }, // 0x1d + { 0x6081, { 0x404, 0x408, 180 } }, // 0x1e + { 0x6082, { 0x404, 0x408, 180 } }, // 0x1f + { 0x6081, { 0x404, 0x409, 180 } }, // 0x20 + { 0x6082, { 0x404, 0x409, 180 } }, // 0x21 + { 0x0081, { 0, 10800, 225 } }, // 0x22 + { 0x0082, { 0, 10800, 225 } }, // 0x23 + { 0x6081, { 0x404, 0x408, 225 } }, // 0x24 + { 0x6082, { 0x404, 0x408, 225 } }, // 0x25 + { 0x6081, { 0x404, 0x409, 225 } }, // 0x26 + { 0x6082, { 0x404, 0x409, 225 } }, // 0x27 + { 0x0081, { 0, 10800, 270 } }, // 0x28 + { 0x0082, { 0, 10800, 270 } }, // 0x29 + { 0x6081, { 0x404, 0x408, 270 } }, // 0x2a + { 0x6082, { 0x404, 0x408, 270 } }, // 0x2b + { 0x6081, { 0x404, 0x409, 270 } }, // 0x2c + { 0x6082, { 0x404, 0x409, 270 } }, // 0x2d + { 0x0081, { 0, 10800, 315 } }, // 0x2e + { 0x0082, { 0, 10800, 315 } }, // 0x2f + { 0x6081, { 0x404, 0x408, 315 } }, // 0x30 + { 0x6082, { 0x404, 0x408, 315 } }, // 0x31 + { 0x6081, { 0x404, 0x409, 315 } }, // 0x32 + { 0x6082, { 0x404, 0x409, 315 } }, // 0x33 + { 0x2081, { DFF_Prop_adjustValue, 10800, 45 } }, // 0x34 ( textbox ) + { 0x2081, { DFF_Prop_adjustValue, 10800, 225 } }, // 0x35 + { 0x8000, { 10800, 0, DFF_Prop_adjustValue } } +}; +const SvxMSDffTextRectangles mso_sptSunTextRect[] = +{ + { { 0x34 MSO_I, 0x34 MSO_I }, { 0x35 MSO_I, 0x35 MSO_I } } +}; +const SvxMSDffHandle mso_sptSunHandle[] = +{ + { SvxMSDffHandleFlags::RANGE, + 0x100, 10800, 10800, 10800, 2700, 10125, MIN_INT32, 0x7fffffff } +}; +const mso_CustomShape msoSun = +{ + const_cast<SvxMSDffVertPair*>(mso_sptSunVert), SAL_N_ELEMENTS( mso_sptSunVert ), + const_cast<sal_uInt16*>(mso_sptSunSegm), sizeof( mso_sptSunSegm ) >> 1, + const_cast<SvxMSDffCalculationData*>(mso_sptSunCalc), SAL_N_ELEMENTS( mso_sptSunCalc ), + const_cast<sal_Int32*>(mso_sptDefault5400), + const_cast<SvxMSDffTextRectangles*>(mso_sptSunTextRect), SAL_N_ELEMENTS( mso_sptSunTextRect ), + 21600, 21600, + MIN_INT32, MIN_INT32, + const_cast<SvxMSDffVertPair*>(mso_sptStandardGluePoints), SAL_N_ELEMENTS( mso_sptStandardGluePoints ), + const_cast<SvxMSDffHandle*>(mso_sptSunHandle), SAL_N_ELEMENTS( mso_sptSunHandle ) // handles +}; + +const SvxMSDffVertPair mso_sptMoonVert[] = // adj value 0 -> 18900 +{ + { 21600, 0 }, + { 3 MSO_I, 4 MSO_I }, { 0 MSO_I, 5080 }, { 0 MSO_I, 10800 }, // ccp + { 0 MSO_I, 16520 }, { 3 MSO_I, 5 MSO_I }, { 21600, 21600 }, // ccp + { 9740, 21600 }, { 0, 16730 }, { 0, 10800 }, // ccp + { 0, 4870 }, { 9740, 0 }, { 21600, 0 } // ccp +}; +const sal_uInt16 mso_sptMoonSegm[] = +{ + 0x4000, 0x2004, 0x6000, 0x8000 +}; +const SvxMSDffCalculationData mso_sptMoonCalc[] = +{ + { 0x2000, { DFF_Prop_adjustValue, 0, 0 } }, + { 0x8000, { 21600, 0, DFF_Prop_adjustValue } }, + { 0x2001, { 0x401, 1, 2 } }, + { 0x6000, { 0x402, DFF_Prop_adjustValue, 0 } }, + { 0x2001, { DFF_Prop_adjustValue, 1794, 10000 } }, + { 0x8000, { 21600, 0, 0x0404 } }, + { 0x2001, { DFF_Prop_adjustValue, 400, 18900 } }, + { 0x8081, { 0, 10800, 0x406 } }, + { 0x8082, { 0, 10800, 0x406 } }, + { 0x6000, { 0x407, 0x407, 0 } }, + { 0x8000, { 21600, 0, 0x408 } } +}; +const SvxMSDffTextRectangles mso_sptMoonTextRect[] = +{ + { { 9 MSO_I, 8 MSO_I }, { 0 MSO_I, 0xa MSO_I } } +}; +const SvxMSDffVertPair mso_sptMoonGluePoints[] = +{ + { 21600, 0 }, { 0, 10800 }, { 21600, 21600 }, { 0 MSO_I, 10800 } +}; +const SvxMSDffHandle mso_sptMoonHandle[] = +{ + { SvxMSDffHandleFlags::RANGE, + 0x100, 10800, 10800, 10800, 0, 18900, MIN_INT32, 0x7fffffff } +}; +const mso_CustomShape msoMoon = +{ + const_cast<SvxMSDffVertPair*>(mso_sptMoonVert), SAL_N_ELEMENTS( mso_sptMoonVert ), + const_cast<sal_uInt16*>(mso_sptMoonSegm), sizeof( mso_sptMoonSegm ) >> 1, + const_cast<SvxMSDffCalculationData*>(mso_sptMoonCalc), SAL_N_ELEMENTS( mso_sptMoonCalc ), + const_cast<sal_Int32*>(mso_sptDefault10800), + const_cast<SvxMSDffTextRectangles*>(mso_sptMoonTextRect), SAL_N_ELEMENTS( mso_sptMoonTextRect ), + 21600, 21600, + MIN_INT32, MIN_INT32, + const_cast<SvxMSDffVertPair*>(mso_sptMoonGluePoints), SAL_N_ELEMENTS( mso_sptMoonGluePoints ), + const_cast<SvxMSDffHandle*>(mso_sptMoonHandle), SAL_N_ELEMENTS( mso_sptMoonHandle ) // handles +}; + +const SvxMSDffVertPair mso_sptBracketPairVert[] = // adj value 0 -> 10800 +{ + { 0 MSO_I, 0 }, { 0, 1 MSO_I }, // left top alignment + { 0, 2 MSO_I }, { 0 MSO_I, 21600 }, // left bottom " + { 3 MSO_I, 21600 }, { 21600, 2 MSO_I }, // right bottom " + { 21600, 1 MSO_I }, { 3 MSO_I, 0 }, // right top " + { 0 MSO_I, 0 }, { 0, 1 MSO_I }, // filling area + { 0, 2 MSO_I }, { 0 MSO_I, 21600 }, + { 3 MSO_I, 21600 }, { 21600, 2 MSO_I }, + { 21600, 1 MSO_I }, { 3 MSO_I, 0 } +}; +const sal_uInt16 mso_sptBracketPairSegm[] = +{ + 0x4000, 0xa701, 0x0001, 0xa801, 0xaa00, 0x8000, + 0x4000, 0xa701, 0x0001, 0xa801, 0xaa00, 0x8000, + 0x4000, 0xa701, 0x0001, 0xa801, 0x0001, // filling area + 0xa701, 0x0001, 0xa801, 0x6000, 0xab00, 0x8000 +}; +const SvxMSDffCalculationData mso_sptBracketPairCalc[] = +{ + { 0x6000, { DFF_Prop_geoLeft, DFF_Prop_adjustValue, 0 } }, + { 0x6000, { DFF_Prop_geoTop, DFF_Prop_adjustValue, 0 } }, + { 0xa000, { DFF_Prop_geoBottom, 0, DFF_Prop_adjustValue } }, + { 0xa000, { DFF_Prop_geoRight, 0, DFF_Prop_adjustValue } }, + { 0x2082, { DFF_Prop_adjustValue, 0, 45 } }, + { 0x2000, { 0x404, 0, 10800 } }, + { 0x8000, { 0, 0, DFF_Prop_adjustValue } }, + { 0xa000, { 0x406, 0, 0x405 } }, + { 0xa000, { DFF_Prop_geoLeft, 0, 0x407 } }, + { 0xa000, { DFF_Prop_geoTop, 0, 0x407 } }, + { 0x6000, { DFF_Prop_geoRight, 0x407, 0 } }, + { 0x6000, { DFF_Prop_geoBottom, 0x407, 0 } }, + { 0xa000, { DFF_Prop_geoLeft, 0, 0x405 } }, + { 0xa000, { DFF_Prop_geoTop, 0, 0x405 } }, + { 0x6000, { DFF_Prop_geoRight, 0x405, 0 } }, + { 0x6000, { DFF_Prop_geoBottom, 0x405, 0 } } +}; +const SvxMSDffTextRectangles mso_sptBracketPairTextRect[] = +{ + { { 8 MSO_I, 9 MSO_I }, { 0xa MSO_I, 0xb MSO_I } } +}; +const SvxMSDffHandle mso_sptBracketPairHandle[] = +{ + { SvxMSDffHandleFlags::RANGE | SvxMSDffHandleFlags::SWITCHED, + 0x100, 0, 10800, 10800, 0, 10800, MIN_INT32, 0x7fffffff } +}; +const mso_CustomShape msoBracketPair = +{ + const_cast<SvxMSDffVertPair*>(mso_sptBracketPairVert), SAL_N_ELEMENTS( mso_sptBracketPairVert ), + const_cast<sal_uInt16*>(mso_sptBracketPairSegm), sizeof( mso_sptBracketPairSegm ) >> 1, + const_cast<SvxMSDffCalculationData*>(mso_sptBracketPairCalc), SAL_N_ELEMENTS( mso_sptBracketPairCalc ), + const_cast<sal_Int32*>(mso_sptDefault3700), + const_cast<SvxMSDffTextRectangles*>(mso_sptBracketPairTextRect), SAL_N_ELEMENTS( mso_sptBracketPairTextRect ), + 21600, 21600, + 10800, MIN_INT32, + const_cast<SvxMSDffVertPair*>(mso_sptStandardGluePoints), SAL_N_ELEMENTS( mso_sptStandardGluePoints ), + const_cast<SvxMSDffHandle*>(mso_sptBracketPairHandle), SAL_N_ELEMENTS( mso_sptBracketPairHandle ) // handles +}; + +const sal_uInt16 mso_sptPlaqueSegm[] = +{ + 0x4000, 0xa801, 0x0001, 0xa701, 0x0001, 0xa801, 0x0001, 0xa701, 0x6000, 0x8000 +}; +const SvxMSDffTextRectangles mso_sptPlaqueTextRect[] = +{ + { { 0xc MSO_I, 0xd MSO_I }, { 0xe MSO_I, 0xf MSO_I } } +}; +const SvxMSDffHandle mso_sptPlaqueHandle[] = +{ + { SvxMSDffHandleFlags::RANGE | SvxMSDffHandleFlags::SWITCHED, + 0x100, 0, 10800, 10800, 0, 10800, MIN_INT32, 0x7fffffff } +}; +const mso_CustomShape msoPlaque = +{ + const_cast<SvxMSDffVertPair*>(mso_sptBracketPairVert), SAL_N_ELEMENTS( mso_sptBracketPairVert ), + const_cast<sal_uInt16*>(mso_sptPlaqueSegm), sizeof( mso_sptPlaqueSegm ) >> 1, + const_cast<SvxMSDffCalculationData*>(mso_sptBracketPairCalc), SAL_N_ELEMENTS( mso_sptBracketPairCalc ), + const_cast<sal_Int32*>(mso_sptDefault3600), + const_cast<SvxMSDffTextRectangles*>(mso_sptPlaqueTextRect), SAL_N_ELEMENTS( mso_sptPlaqueTextRect ), + 21600, 21600, + 10800, 10800, + const_cast<SvxMSDffVertPair*>(mso_sptStandardGluePoints), SAL_N_ELEMENTS( mso_sptStandardGluePoints ), + const_cast<SvxMSDffHandle*>(mso_sptPlaqueHandle), SAL_N_ELEMENTS( mso_sptPlaqueHandle ) // handles +}; + +const SvxMSDffVertPair mso_sptBracePairVert[] = // adj value 0 -> 5400 +{ + { 4 MSO_I, 0 }, { 0 MSO_I, 1 MSO_I }, { 0 MSO_I, 6 MSO_I }, { 0 ,10800 }, // left bracket + { 0 MSO_I, 7 MSO_I }, { 0 MSO_I, 2 MSO_I }, { 4 MSO_I, 21600 }, + { 8 MSO_I, 21600 }, { 3 MSO_I, 2 MSO_I }, { 3 MSO_I, 7 MSO_I }, { 21600, 10800 }, // right bracket + { 3 MSO_I, 6 MSO_I }, { 3 MSO_I, 1 MSO_I }, { 8 MSO_I, 0 }, + { 4 MSO_I, 0 }, { 0 MSO_I, 1 MSO_I }, { 0 MSO_I, 6 MSO_I }, { 0 ,10800 }, // filling area + { 0 MSO_I, 7 MSO_I }, { 0 MSO_I, 2 MSO_I }, { 4 MSO_I, 21600 }, + { 8 MSO_I, 21600 }, { 3 MSO_I, 2 MSO_I }, { 3 MSO_I, 7 MSO_I }, { 21600, 10800 }, + { 3 MSO_I, 6 MSO_I }, { 3 MSO_I, 1 MSO_I }, { 8 MSO_I, 0 } +}; +const sal_uInt16 mso_sptBracePairSegm[] = +{ + 0x4000, 0xa701, 0x0001, 0xa801, 0xa701, 0x0001, 0xa801, 0xaa00, 0x8000, + 0x4000, 0xa701, 0x0001, 0xa801, 0xa701, 0x0001, 0xa801, 0xaa00, 0x8000, + 0x4000, 0xa701, 0x0001, 0xa801, 0xa701, 0x0001, 0xa801, 0x0001, // filling area + 0xa701, 0x0001, 0xa801, 0xa701, 0x0001, 0xa801, 0x6000, 0xab00, 0x8000 +}; +const SvxMSDffCalculationData mso_sptBracePairCalc[] = +{ + { 0x6000, { DFF_Prop_geoLeft, DFF_Prop_adjustValue, 0 } }, + { 0x6000, { DFF_Prop_geoTop, DFF_Prop_adjustValue, 0 } }, + { 0xa000, { DFF_Prop_geoBottom, 0, DFF_Prop_adjustValue } }, + { 0xa000, { DFF_Prop_geoRight, 0, DFF_Prop_adjustValue } }, + { 0x2001, { 0x400, 2, 1 } }, // 4 + { 0x2001, { DFF_Prop_adjustValue, 2, 1 } }, // 5 + { 0x8000, { 10800, 0, DFF_Prop_adjustValue } }, // 6 + { 0x8000, { 21600, 0, 0x406 } }, // 7 + { 0xa000, { DFF_Prop_geoRight, 0, 0x405 } }, // 8 + { 0x2001, { DFF_Prop_adjustValue, 1, 3 } }, // 9 + { 0x6000, { 0x409, DFF_Prop_adjustValue, 0 } }, // xa + { 0x6000, { DFF_Prop_geoLeft, 0x40a, 0 } }, // xb + { 0x6000, { DFF_Prop_geoTop, 0x409, 0 } }, // xc + { 0xa000, { DFF_Prop_geoRight, 0, 0x40a } }, // xd + { 0xa000, { DFF_Prop_geoBottom, 0, 0x409 } } // xe +}; +const SvxMSDffTextRectangles mso_sptBracePairTextRect[] = +{ + { { 0xb MSO_I, 0xc MSO_I }, { 0xd MSO_I, 0xe MSO_I } } +}; +const SvxMSDffHandle mso_sptBracePairHandle[] = +{ + { SvxMSDffHandleFlags::RANGE | SvxMSDffHandleFlags::SWITCHED, + 0, 0x100, 10800, 10800, MIN_INT32, 0x7fffffff, 0, 5400 } +}; +const mso_CustomShape msoBracePair = +{ + const_cast<SvxMSDffVertPair*>(mso_sptBracePairVert), SAL_N_ELEMENTS( mso_sptBracePairVert ), + const_cast<sal_uInt16*>(mso_sptBracePairSegm), sizeof( mso_sptBracePairSegm ) >> 1, + const_cast<SvxMSDffCalculationData*>(mso_sptBracePairCalc), SAL_N_ELEMENTS( mso_sptBracePairCalc ), + const_cast<sal_Int32*>(mso_sptDefault1800), + const_cast<SvxMSDffTextRectangles*>(mso_sptBracePairTextRect), SAL_N_ELEMENTS( mso_sptBracePairTextRect ), + 21600, 21600, + 10800, MIN_INT32, + const_cast<SvxMSDffVertPair*>(mso_sptStandardGluePoints), SAL_N_ELEMENTS( mso_sptStandardGluePoints ), + const_cast<SvxMSDffHandle*>(mso_sptBracePairHandle), SAL_N_ELEMENTS( mso_sptBracePairHandle ) // handles +}; + +const SvxMSDffCalculationData mso_sptBracketCalc[] = +{ + { 0x2001, { DFF_Prop_adjustValue, 1, 2 } }, + { 0x6000, { DFF_Prop_geoTop, DFF_Prop_adjustValue, 0 } }, + { 0xa000, { DFF_Prop_geoBottom, 0, DFF_Prop_adjustValue } }, + { 0x6000, { DFF_Prop_geoTop, 0x400, 0 } }, + { 0xa000, { DFF_Prop_geoBottom, 0, 0x400 } } +}; +const sal_uInt16 mso_sptBracketSegm[] = +{ + 0x4000, 0x2001, 0x0001, 0x2001, 0x8000 +}; +const SvxMSDffVertPair mso_sptLeftBracketVert[] = // adj value 0 -> 10800 +{ + { 21600, 0 }, { 10800, 0 }, { 0, 3 MSO_I }, { 0, 1 MSO_I }, + { 0, 2 MSO_I }, { 0, 4 MSO_I }, { 10800, 21600 }, { 21600, 21600 } +}; +const SvxMSDffTextRectangles mso_sptLeftBracketTextRect[] = +{ + { { 6350, 3 MSO_I }, { 21600, 4 MSO_I } } +}; +const SvxMSDffVertPair mso_sptLeftBracketGluePoints[] = +{ + { 21600, 0 }, { 0, 10800 }, { 21600, 21600 } +}; +const SvxMSDffHandle mso_sptLeftBracketHandle[] = +{ + { SvxMSDffHandleFlags::RANGE, + 0, 0x100, 10800, 10800, MIN_INT32, 0x7fffffff, 0, 10800 } +}; +const mso_CustomShape msoLeftBracket = +{ + const_cast<SvxMSDffVertPair*>(mso_sptLeftBracketVert), SAL_N_ELEMENTS( mso_sptLeftBracketVert ), + const_cast<sal_uInt16*>(mso_sptBracketSegm), sizeof( mso_sptBracketSegm ) >> 1, + const_cast<SvxMSDffCalculationData*>(mso_sptBracketCalc), SAL_N_ELEMENTS( mso_sptBracketCalc ), + const_cast<sal_Int32*>(mso_sptDefault1800), + const_cast<SvxMSDffTextRectangles*>(mso_sptLeftBracketTextRect), SAL_N_ELEMENTS( mso_sptLeftBracketTextRect ), + 21600, 21600, + MIN_INT32, MIN_INT32, + const_cast<SvxMSDffVertPair*>(mso_sptLeftBracketGluePoints), SAL_N_ELEMENTS( mso_sptLeftBracketGluePoints ), + const_cast<SvxMSDffHandle*>(mso_sptLeftBracketHandle), SAL_N_ELEMENTS( mso_sptLeftBracketHandle ) // handles +}; +const SvxMSDffVertPair mso_sptRightBracketVert[] = // adj value 0 -> 10800 +{ + { 0, 0 }, { 10800, 0 }, { 21600, 3 MSO_I }, { 21600, 1 MSO_I }, + { 21600, 2 MSO_I }, { 21600, 4 MSO_I }, { 10800, 21600 }, { 0, 21600 } +}; +const SvxMSDffTextRectangles mso_sptRightBracketTextRect[] = +{ + { { 0, 3 MSO_I }, { 15150, 4 MSO_I } } +}; +const SvxMSDffVertPair mso_sptRightBracketGluePoints[] = +{ + { 0, 0 }, { 0, 21600 }, { 21600, 10800 } +}; +const SvxMSDffHandle mso_sptRightBracketHandle[] = +{ + { SvxMSDffHandleFlags::RANGE, + 1, 0x100, 10800, 10800, MIN_INT32, 0x7fffffff, 0, 10800 } +}; +const mso_CustomShape msoRightBracket = +{ + const_cast<SvxMSDffVertPair*>(mso_sptRightBracketVert), SAL_N_ELEMENTS( mso_sptRightBracketVert ), + const_cast<sal_uInt16*>(mso_sptBracketSegm), sizeof( mso_sptBracketSegm ) >> 1, + const_cast<SvxMSDffCalculationData*>(mso_sptBracketCalc), SAL_N_ELEMENTS( mso_sptBracketCalc ), + const_cast<sal_Int32*>(mso_sptDefault1800), + const_cast<SvxMSDffTextRectangles*>(mso_sptRightBracketTextRect), SAL_N_ELEMENTS( mso_sptRightBracketTextRect ), + 21600, 21600, + MIN_INT32, MIN_INT32, + const_cast<SvxMSDffVertPair*>(mso_sptRightBracketGluePoints), SAL_N_ELEMENTS( mso_sptRightBracketGluePoints ), + const_cast<SvxMSDffHandle*>(mso_sptRightBracketHandle), SAL_N_ELEMENTS( mso_sptRightBracketHandle ) // handles +}; + +const SvxMSDffCalculationData mso_sptBraceCalc[] = +{ + { 0x2001, { DFF_Prop_adjustValue, 1, 2 } }, + { 0x2000, { DFF_Prop_adjustValue, 0, 0 } }, + { 0xa000, { 0x404, 0, DFF_Prop_adjustValue } }, + { 0xa000, { 0x404, 0, 0x400 } }, + { 0x2000, { DFF_Prop_adjust2Value, 0, 0 } }, + { 0x6000, { 0x404, 0x400, 0 } }, + { 0x6000, { 0x404, DFF_Prop_adjustValue, 0 } }, + { 0x8000, { 21600, 0, DFF_Prop_adjustValue } }, + { 0x8000, { 21600, 0, 0x400 } }, + { 0x2001, { DFF_Prop_adjustValue, 10000, 31953 } }, + { 0x8000, { 21600, 0, 0x409 } } +}; +const sal_uInt16 mso_sptBraceSegm[] = +{ + 0x4000, 0x2001, 0x0001, 0x2002, 0x0001, 0x2001, 0x8000 +}; +const sal_Int32 mso_sptBraceDefault[] = +{ + 2, 1800, 10800 +}; +const SvxMSDffVertPair mso_sptLeftBraceVert[] = +{ + { 21600, 0 }, // p + { 16200, 0 }, { 10800, 0 MSO_I }, { 10800, 1 MSO_I }, // ccp + { 10800, 2 MSO_I }, // p + { 10800, 3 MSO_I }, { 5400, 4 MSO_I }, { 0, 4 MSO_I }, // ccp + { 5400, 4 MSO_I }, { 10800, 5 MSO_I }, { 10800, 6 MSO_I }, // ccp + { 10800, 7 MSO_I }, // p + { 10800, 8 MSO_I }, { 16200, 21600 }, { 21600, 21600 } // ccp +}; +const SvxMSDffTextRectangles mso_sptLeftBraceTextRect[] = +{ + { { 13800, 9 MSO_I }, { 21600, 10 MSO_I } } +}; +const SvxMSDffHandle mso_sptLeftBraceHandle[] = +{ + { SvxMSDffHandleFlags::RANGE, + 10800, 0x100, 10800, 10800, MIN_INT32, 0x7fffffff, 0, 5400 }, + { SvxMSDffHandleFlags::RANGE, + 0, 0x101, 10800, 10800, MIN_INT32, 0x7fffffff, 0, 21600 } +}; +const mso_CustomShape msoLeftBrace = // adj value0 0 -> 5400 +{ // adj value1 0 -> 21600 + const_cast<SvxMSDffVertPair*>(mso_sptLeftBraceVert), SAL_N_ELEMENTS( mso_sptLeftBraceVert ), + const_cast<sal_uInt16*>(mso_sptBraceSegm), sizeof( mso_sptBraceSegm ) >> 1, + const_cast<SvxMSDffCalculationData*>(mso_sptBraceCalc), SAL_N_ELEMENTS( mso_sptBraceCalc ), + const_cast<sal_Int32*>(mso_sptBraceDefault), + const_cast<SvxMSDffTextRectangles*>(mso_sptLeftBraceTextRect), SAL_N_ELEMENTS( mso_sptLeftBraceTextRect ), + 21600, 21600, + MIN_INT32, MIN_INT32, + const_cast<SvxMSDffVertPair*>(mso_sptLeftBracketGluePoints), SAL_N_ELEMENTS( mso_sptLeftBracketGluePoints ), + const_cast<SvxMSDffHandle*>(mso_sptLeftBraceHandle), SAL_N_ELEMENTS( mso_sptLeftBraceHandle ) // handles +}; +const SvxMSDffVertPair mso_sptRightBraceVert[] = +{ + { 0, 0 }, // p + { 5400, 0 }, { 10800, 0 MSO_I }, { 10800, 1 MSO_I }, // ccp + { 10800, 2 MSO_I }, // p + { 10800, 3 MSO_I }, { 16200, 4 MSO_I }, { 21600, 4 MSO_I }, // ccp + { 16200, 4 MSO_I }, { 10800, 5 MSO_I }, { 10800, 6 MSO_I }, // ccp + { 10800, 7 MSO_I }, // p + { 10800, 8 MSO_I }, { 5400, 21600 }, { 0, 21600 } // ccp +}; +const SvxMSDffTextRectangles mso_sptRightBraceTextRect[] = +{ + { { 0, 9 MSO_I }, { 7800, 10 MSO_I } } +}; +const SvxMSDffHandle mso_sptRightBraceHandle[] = +{ + { SvxMSDffHandleFlags::RANGE, + 10800, 0x100, 10800, 10800, MIN_INT32, 0x7fffffff, 0, 5400 }, + { SvxMSDffHandleFlags::RANGE, + 1, 0x101, 10800, 10800, MIN_INT32, 0x7fffffff, 0, 21600 } +}; +const mso_CustomShape msoRightBrace = // adj value0 0 -> 5400 +{ // adj value1 0 -> 21600 + const_cast<SvxMSDffVertPair*>(mso_sptRightBraceVert), SAL_N_ELEMENTS( mso_sptRightBraceVert ), + const_cast<sal_uInt16*>(mso_sptBraceSegm), sizeof( mso_sptBraceSegm ) >> 1, + const_cast<SvxMSDffCalculationData*>(mso_sptBraceCalc), SAL_N_ELEMENTS( mso_sptBraceCalc ), + const_cast<sal_Int32*>(mso_sptBraceDefault), + const_cast<SvxMSDffTextRectangles*>(mso_sptRightBraceTextRect), SAL_N_ELEMENTS( mso_sptRightBraceTextRect ), + 21600, 21600, + MIN_INT32, MIN_INT32, + const_cast<SvxMSDffVertPair*>(mso_sptRightBracketGluePoints), SAL_N_ELEMENTS( mso_sptRightBracketGluePoints ), + const_cast<SvxMSDffHandle*>(mso_sptRightBraceHandle), SAL_N_ELEMENTS( mso_sptRightBraceHandle ) // handles +}; + +const SvxMSDffVertPair mso_sptIrregularSeal1Vert[] = +{ + { 10901, 5905 }, { 8458, 2399 }, { 7417, 6425 }, { 476, 2399 }, + { 4732, 7722 }, { 106, 8718 }, { 3828, 11880 }, { 243, 14689 }, + { 5772, 14041 }, { 4868, 17719 }, { 7819, 15730 }, { 8590, 21600 }, + { 10637, 15038 }, { 13349, 19840 }, { 14125, 14561 }, { 18248, 18195 }, + { 16938, 13044 }, { 21600, 13393 }, { 17710, 10579 }, { 21198, 8242 }, + { 16806, 7417 }, { 18482, 4560 }, { 14257, 5429 }, { 14623, 106 }, { 10901, 5905 } +}; +const SvxMSDffTextRectangles mso_sptIrregularSeal1TextRect[] = +{ + { { 4680, 6570 }, { 16140, 13280 } } +}; +const SvxMSDffVertPair mso_sptIrregularSeal1GluePoints[] = +{ + { 14623, 106 }, { 106, 8718 }, { 8590, 21600 }, { 21600, 13393 } +}; +const mso_CustomShape msoIrregularSeal1 = +{ + const_cast<SvxMSDffVertPair*>(mso_sptIrregularSeal1Vert), SAL_N_ELEMENTS( mso_sptIrregularSeal1Vert ), + nullptr, 0, + nullptr, 0, + nullptr, + const_cast<SvxMSDffTextRectangles*>(mso_sptIrregularSeal1TextRect), SAL_N_ELEMENTS( mso_sptIrregularSeal1TextRect ), + 21600, 21600, + MIN_INT32, MIN_INT32, + const_cast<SvxMSDffVertPair*>(mso_sptIrregularSeal1GluePoints), SAL_N_ELEMENTS( mso_sptIrregularSeal1GluePoints ), + nullptr, 0 // handles +}; + +const SvxMSDffVertPair mso_sptIrregularSeal2Vert[] = +{ + { 11464, 4340 }, { 9722, 1887 }, { 8548, 6383 }, { 4503, 3626 }, + { 5373, 7816 }, { 1174, 8270 }, { 3934, 11592 }, { 0, 12875 }, + { 3329, 15372 }, { 1283, 17824 }, { 4804, 18239 }, { 4918, 21600 }, + { 7525, 18125 }, { 8698, 19712 }, { 9871, 17371 }, { 11614, 18844 }, + { 12178, 15937 }, { 14943, 17371 }, { 14640, 14348 }, { 18878, 15632 }, + { 16382, 12311 }, { 18270, 11292 }, { 16986, 9404 }, { 21600, 6646 }, + { 16382, 6533 }, { 18005, 3172 }, { 14524, 5778 }, { 14789, 0 }, + { 11464, 4340 } +}; +const SvxMSDffTextRectangles mso_sptIrregularSeal2TextRect[] = +{ + { { 5400, 6570 }, { 14160, 15290 } } +}; +const SvxMSDffVertPair mso_sptIrregularSeal2GluePoints[] = +{ + { 9722, 1887 }, { 0, 12875 }, { 11614, 18844 }, { 21600, 6646 } +}; +const mso_CustomShape msoIrregularSeal2 = +{ + const_cast<SvxMSDffVertPair*>(mso_sptIrregularSeal2Vert), SAL_N_ELEMENTS( mso_sptIrregularSeal2Vert ), + nullptr, 0, + nullptr, 0, + nullptr, + const_cast<SvxMSDffTextRectangles*>(mso_sptIrregularSeal2TextRect), SAL_N_ELEMENTS( mso_sptIrregularSeal2TextRect ), + 21600, 21600, + MIN_INT32, MIN_INT32, + const_cast<SvxMSDffVertPair*>(mso_sptIrregularSeal2GluePoints), SAL_N_ELEMENTS( mso_sptIrregularSeal2GluePoints ), + nullptr, 0 // handles +}; + +const SvxMSDffVertPair mso_sptSeal4Vert[] = // adjustment1 : 0 - 10800 +{ + { 0, 10800 }, { 4 MSO_I, 4 MSO_I }, { 10800, 0 }, { 3 MSO_I, 4 MSO_I }, + { 21600, 10800 }, { 3 MSO_I, 3 MSO_I }, { 10800, 21600 }, { 4 MSO_I, 3 MSO_I }, + { 0, 10800 } +}; +const SvxMSDffCalculationData mso_sptSeal4Calc[] = +{ + { 0x0000, { 7600, 0, 0 } }, + { 0x6001, { 0x400, DFF_Prop_adjustValue, 10800 } }, + { 0xa000, { 0x400, 0, 0x401 } }, + { 0x4000, { 10800, 0x402, 0 } }, + { 0x8000, { 10800, 0, 0x402 } } +}; +const SvxMSDffTextRectangles mso_sptSeal4TextRect[] = +{ + { { 4 MSO_I, 4 MSO_I }, { 3 MSO_I, 3 MSO_I } } +}; +const SvxMSDffHandle mso_sptSealHandle[] = +{ + { SvxMSDffHandleFlags::RANGE, + 0x100, 10800, 10800, 10800, 0, 10800, MIN_INT32, 0x7fffffff } +}; +const mso_CustomShape msoSeal4 = +{ + const_cast<SvxMSDffVertPair*>(mso_sptSeal4Vert), SAL_N_ELEMENTS( mso_sptSeal4Vert ), + nullptr, 0, + const_cast<SvxMSDffCalculationData*>(mso_sptSeal4Calc), SAL_N_ELEMENTS( mso_sptSeal4Calc ), + const_cast<sal_Int32*>(mso_sptDefault8100), + const_cast<SvxMSDffTextRectangles*>(mso_sptSeal4TextRect), SAL_N_ELEMENTS( mso_sptSeal4TextRect ), + 21600, 21600, + MIN_INT32, MIN_INT32, + nullptr, 0, + const_cast<SvxMSDffHandle*>(mso_sptSealHandle), SAL_N_ELEMENTS( mso_sptSealHandle ) // handles +}; + +const SvxMSDffVertPair mso_sptStarVert[] = +{ + { 10797, 0 }, { 8278, 8256 }, { 0, 8256 }, { 6722, 13405 }, + { 4198, 21600 }, { 10797, 16580 }, { 17401, 21600 }, { 14878, 13405 }, + { 21600, 8256 }, { 13321, 8256 }, { 10797, 0 } +}; +const SvxMSDffTextRectangles mso_sptStarTextRect[] = +{ + { { 6722, 8256 }, { 14878, 15460 } } +}; +const mso_CustomShape msoStar = +{ + const_cast<SvxMSDffVertPair*>(mso_sptStarVert), SAL_N_ELEMENTS( mso_sptStarVert ), + nullptr, 0, + nullptr, 0, + nullptr, + const_cast<SvxMSDffTextRectangles*>(mso_sptStarTextRect), SAL_N_ELEMENTS( mso_sptStarTextRect ), + 21600, 21600, + MIN_INT32, MIN_INT32, + nullptr, 0, + nullptr, 0 // handles +}; + +const SvxMSDffCalculationData mso_sptSeal24Calc[] = +{ + { 0x2000, { DFF_Prop_adjustValue, 0, 0 } }, // 0x00 + { 0x2081, { 0x400, 10800, 315 } }, // 0x01 ( textframe ) + { 0x2082, { 0x400, 10800, 315 } }, // 0x02 + { 0x2081, { 0x400, 10800, 135 } }, // 0x03 + { 0x2082, { 0x400, 10800, 135 } }, // 0x04 + { 0x0081, { 0, 10800, 0 } }, + { 0x0082, { 0, 10800, 0 } }, + { 0x2081, { 0x400, 10800, 7 } }, + { 0x2082, { 0x400, 10800, 7 } }, + { 0x0081, { 0, 10800, 15 } }, + { 0x0082, { 0, 10800, 15 } }, + { 0x2081, { 0x400, 10800, 22 } }, + { 0x2082, { 0x400, 10800, 22 } }, + { 0x0081, { 0, 10800, 30 } }, + { 0x0082, { 0, 10800, 30 } }, + { 0x2081, { 0x400, 10800, 37 } }, + { 0x2082, { 0x400, 10800, 37 } }, + { 0x0081, { 0, 10800, 45 } }, + { 0x0082, { 0, 10800, 45 } }, + { 0x2081, { 0x400, 10800, 52 } }, + { 0x2082, { 0x400, 10800, 52 } }, + { 0x0081, { 0, 10800, 60 } }, + { 0x0082, { 0, 10800, 60 } }, + { 0x2081, { 0x400, 10800, 67 } }, + { 0x2082, { 0x400, 10800, 67 } }, + { 0x0081, { 0, 10800, 75 } }, + { 0x0082, { 0, 10800, 75 } }, + { 0x2081, { 0x400, 10800, 82 } }, + { 0x2082, { 0x400, 10800, 82 } }, + { 0x0081, { 0, 10800, 90 } }, + { 0x0082, { 0, 10800, 90 } }, + { 0x2081, { 0x400, 10800, 97 } }, + { 0x2082, { 0x400, 10800, 97 } }, + { 0x0081, { 0, 10800, 105 } }, + { 0x0082, { 0, 10800, 105 } }, + { 0x2081, { 0x400, 10800, 112 } }, + { 0x2082, { 0x400, 10800, 112 } }, + { 0x0081, { 0, 10800, 120 } }, + { 0x0082, { 0, 10800, 120 } }, + { 0x2081, { 0x400, 10800, 127 } }, + { 0x2082, { 0x400, 10800, 127 } }, + { 0x0081, { 0, 10800, 135 } }, + { 0x0082, { 0, 10800, 135 } }, + { 0x2081, { 0x400, 10800, 142 } }, + { 0x2082, { 0x400, 10800, 142 } }, + { 0x0081, { 0, 10800, 150 } }, + { 0x0082, { 0, 10800, 150 } }, + { 0x2081, { 0x400, 10800, 157 } }, + { 0x2082, { 0x400, 10800, 157 } }, + { 0x0081, { 0, 10800, 165 } }, + { 0x0082, { 0, 10800, 165 } }, + { 0x2081, { 0x400, 10800, 172 } }, + { 0x2082, { 0x400, 10800, 172 } }, + { 0x0081, { 0, 10800, 180 } }, + { 0x0082, { 0, 10800, 180 } }, + { 0x2081, { 0x400, 10800, 187 } }, + { 0x2082, { 0x400, 10800, 187 } }, + { 0x0081, { 0, 10800, 195 } }, + { 0x0082, { 0, 10800, 195 } }, + { 0x2081, { 0x400, 10800, 202 } }, + { 0x2082, { 0x400, 10800, 202 } }, + { 0x0081, { 0, 10800, 210 } }, + { 0x0082, { 0, 10800, 210 } }, + { 0x2081, { 0x400, 10800, 217 } }, + { 0x2082, { 0x400, 10800, 217 } }, + { 0x0081, { 0, 10800, 225 } }, + { 0x0082, { 0, 10800, 225 } }, + { 0x2081, { 0x400, 10800, 232 } }, + { 0x2082, { 0x400, 10800, 232 } }, + { 0x0081, { 0, 10800, 240 } }, + { 0x0082, { 0, 10800, 240 } }, + { 0x2081, { 0x400, 10800, 247 } }, + { 0x2082, { 0x400, 10800, 247 } }, + { 0x0081, { 0, 10800, 255 } }, + { 0x0082, { 0, 10800, 255 } }, + { 0x2081, { 0x400, 10800, 262 } }, + { 0x2082, { 0x400, 10800, 262 } }, + { 0x0081, { 0, 10800, 270 } }, + { 0x0082, { 0, 10800, 270 } }, + { 0x2081, { 0x400, 10800, 277 } }, + { 0x2082, { 0x400, 10800, 277 } }, + { 0x0081, { 0, 10800, 285 } }, + { 0x0082, { 0, 10800, 285 } }, + { 0x2081, { 0x400, 10800, 292 } }, + { 0x2082, { 0x400, 10800, 292 } }, + { 0x0081, { 0, 10800, 300 } }, + { 0x0082, { 0, 10800, 300 } }, + { 0x2081, { 0x400, 10800, 307 } }, + { 0x2082, { 0x400, 10800, 307 } }, + { 0x0081, { 0, 10800, 315 } }, + { 0x0082, { 0, 10800, 315 } }, + { 0x2081, { 0x400, 10800, 322 } }, + { 0x2082, { 0x400, 10800, 322 } }, + { 0x0081, { 0, 10800, 330 } }, + { 0x0082, { 0, 10800, 330 } }, + { 0x2081, { 0x400, 10800, 337 } }, + { 0x2082, { 0x400, 10800, 337 } }, + { 0x0081, { 0, 10800, 345 } }, + { 0x0082, { 0, 10800, 345 } }, + { 0x2081, { 0x400, 10800, 352 } }, + { 0x2082, { 0x400, 10800, 352 } } +}; +const SvxMSDffVertPair mso_sptSeal8Vert[] = // adj value 0 -> 10800 +{ + { 5 MSO_I, 6 MSO_I }, { 11 MSO_I, 12 MSO_I }, { 17 MSO_I, 18 MSO_I }, { 23 MSO_I, 24 MSO_I }, + { 29 MSO_I, 30 MSO_I }, { 35 MSO_I, 36 MSO_I }, { 41 MSO_I, 42 MSO_I }, { 47 MSO_I, 48 MSO_I }, + { 53 MSO_I, 54 MSO_I }, { 59 MSO_I, 60 MSO_I }, { 65 MSO_I, 66 MSO_I }, { 71 MSO_I, 72 MSO_I }, + { 77 MSO_I, 78 MSO_I }, { 83 MSO_I, 84 MSO_I }, { 89 MSO_I, 90 MSO_I }, { 95 MSO_I, 96 MSO_I }, + { 5 MSO_I, 6 MSO_I } +}; +const SvxMSDffTextRectangles mso_sptSealTextRect[] = +{ + { { 1 MSO_I, 2 MSO_I }, { 3 MSO_I, 4 MSO_I } } +}; +const mso_CustomShape msoSeal8 = +{ + const_cast<SvxMSDffVertPair*>(mso_sptSeal8Vert), SAL_N_ELEMENTS( mso_sptSeal8Vert ), + nullptr, 0, + const_cast<SvxMSDffCalculationData*>(mso_sptSeal24Calc), SAL_N_ELEMENTS( mso_sptSeal24Calc ), + const_cast<sal_Int32*>(mso_sptDefault2500), + const_cast<SvxMSDffTextRectangles*>(mso_sptSealTextRect), SAL_N_ELEMENTS( mso_sptSealTextRect ), + 21600, 21600, + MIN_INT32, MIN_INT32, + nullptr, 0, + const_cast<SvxMSDffHandle*>(mso_sptSealHandle), SAL_N_ELEMENTS( mso_sptSealHandle ) // handles +}; +const SvxMSDffVertPair mso_sptSeal16Vert[] = // adj value 0 -> 10800 +{ + { 0x05 MSO_I, 0x06 MSO_I }, { 0x07 MSO_I, 0x08 MSO_I }, { 0x09 MSO_I, 0x0a MSO_I }, { 0x0b MSO_I, 0x0c MSO_I }, + { 0x0d MSO_I, 0x0e MSO_I }, { 0x0f MSO_I, 0x10 MSO_I }, { 0x11 MSO_I, 0x12 MSO_I }, { 0x13 MSO_I, 0x14 MSO_I }, + { 0x15 MSO_I, 0x16 MSO_I }, { 0x17 MSO_I, 0x18 MSO_I }, { 0x19 MSO_I, 0x1a MSO_I }, { 0x1b MSO_I, 0x1c MSO_I }, + { 0x1d MSO_I, 0x1e MSO_I }, { 0x1f MSO_I, 0x20 MSO_I }, { 0x21 MSO_I, 0x22 MSO_I }, { 0x23 MSO_I, 0x24 MSO_I }, + { 0x25 MSO_I, 0x26 MSO_I }, { 0x27 MSO_I, 0x28 MSO_I }, { 0x29 MSO_I, 0x2a MSO_I }, { 0x2b MSO_I, 0x2c MSO_I }, + { 0x2d MSO_I, 0x2e MSO_I }, { 0x2f MSO_I, 0x30 MSO_I }, { 0x31 MSO_I, 0x32 MSO_I }, { 0x33 MSO_I, 0x34 MSO_I }, + { 0x35 MSO_I, 0x36 MSO_I }, { 0x37 MSO_I, 0x38 MSO_I }, { 0x39 MSO_I, 0x3a MSO_I }, { 0x3b MSO_I, 0x3c MSO_I }, + { 0x3d MSO_I, 0x3e MSO_I }, { 0x3f MSO_I, 0x40 MSO_I }, { 0x41 MSO_I, 0x42 MSO_I }, { 0x43 MSO_I, 0x44 MSO_I }, + { 0x05 MSO_I, 0x06 MSO_I } +}; +const SvxMSDffCalculationData mso_sptSeal16Calc[] = +{ + { 0x2000, { DFF_Prop_adjustValue, 0, 0 } }, // 0x00 + { 0x2081, { 0x400, 10800, 315 } }, // 0x01 ( textframe ) + { 0x2082, { 0x400, 10800, 315 } }, // 0x02 + { 0x2081, { 0x400, 10800, 135 } }, // 0x03 + { 0x2082, { 0x400, 10800, 135 } }, // 0x04 + { 0x0081, { 0, 10800, 0 } }, + { 0x0082, { 0, 10800, 0 } }, + { 0x2081, { 0x400, 10800, 11 } }, + { 0x2082, { 0x400, 10800, 11 } }, + { 0x0081, { 0, 10800, 22 } }, + { 0x0082, { 0, 10800, 22 } }, + { 0x2081, { 0x400, 10800, 33 } }, + { 0x2082, { 0x400, 10800, 33 } }, + { 0x0081, { 0, 10800, 45 } }, + { 0x0082, { 0, 10800, 45 } }, + { 0x2081, { 0x400, 10800, 56 } }, + { 0x2082, { 0x400, 10800, 56 } }, + { 0x0081, { 0, 10800, 67 } }, + { 0x0082, { 0, 10800, 67 } }, + { 0x2081, { 0x400, 10800, 78 } }, + { 0x2082, { 0x400, 10800, 78 } }, + { 0x0081, { 0, 10800, 90 } }, + { 0x0082, { 0, 10800, 90 } }, + { 0x2081, { 0x400, 10800, 101 } }, + { 0x2082, { 0x400, 10800, 101 } }, + { 0x0081, { 0, 10800, 112 } }, + { 0x0082, { 0, 10800, 112 } }, + { 0x2081, { 0x400, 10800, 123 } }, + { 0x2082, { 0x400, 10800, 123 } }, + { 0x0081, { 0, 10800, 135 } }, + { 0x0082, { 0, 10800, 135 } }, + { 0x2081, { 0x400, 10800, 146 } }, + { 0x2082, { 0x400, 10800, 146 } }, + { 0x0081, { 0, 10800, 157 } }, + { 0x0082, { 0, 10800, 157 } }, + { 0x2081, { 0x400, 10800, 168 } }, + { 0x2082, { 0x400, 10800, 168 } }, + { 0x0081, { 0, 10800, 180 } }, + { 0x0082, { 0, 10800, 180 } }, + { 0x2081, { 0x400, 10800, 191 } }, + { 0x2082, { 0x400, 10800, 191 } }, + { 0x0081, { 0, 10800, 202 } }, + { 0x0082, { 0, 10800, 202 } }, + { 0x2081, { 0x400, 10800, 213 } }, + { 0x2082, { 0x400, 10800, 213 } }, + { 0x0081, { 0, 10800, 225 } }, + { 0x0082, { 0, 10800, 225 } }, + { 0x2081, { 0x400, 10800, 236 } }, + { 0x2082, { 0x400, 10800, 236 } }, + { 0x0081, { 0, 10800, 247 } }, + { 0x0082, { 0, 10800, 247 } }, + { 0x2081, { 0x400, 10800, 258 } }, + { 0x2082, { 0x400, 10800, 258 } }, + { 0x0081, { 0, 10800, 270 } }, + { 0x0082, { 0, 10800, 270 } }, + { 0x2081, { 0x400, 10800, 281 } }, + { 0x2082, { 0x400, 10800, 281 } }, + { 0x0081, { 0, 10800, 292 } }, + { 0x0082, { 0, 10800, 292 } }, + { 0x2081, { 0x400, 10800, 303 } }, + { 0x2082, { 0x400, 10800, 303 } }, + { 0x0081, { 0, 10800, 315 } }, + { 0x0082, { 0, 10800, 315 } }, + { 0x2081, { 0x400, 10800, 326 } }, + { 0x2082, { 0x400, 10800, 326 } }, + { 0x0081, { 0, 10800, 337 } }, + { 0x0082, { 0, 10800, 337 } }, + { 0x2081, { 0x400, 10800, 348 } }, + { 0x2082, { 0x400, 10800, 348 } } +}; +const mso_CustomShape msoSeal16 = +{ + const_cast<SvxMSDffVertPair*>(mso_sptSeal16Vert), SAL_N_ELEMENTS( mso_sptSeal16Vert ), + nullptr, 0, + const_cast<SvxMSDffCalculationData*>(mso_sptSeal16Calc), SAL_N_ELEMENTS( mso_sptSeal16Calc ), + const_cast<sal_Int32*>(mso_sptDefault2500), + const_cast<SvxMSDffTextRectangles*>(mso_sptSealTextRect), SAL_N_ELEMENTS( mso_sptSealTextRect ), + 21600, 21600, + MIN_INT32, MIN_INT32, + nullptr, 0, + const_cast<SvxMSDffHandle*>(mso_sptSealHandle), SAL_N_ELEMENTS( mso_sptSealHandle ) // handles +}; +const SvxMSDffVertPair mso_sptSeal24Vert[] = +{ + { 0x05 MSO_I, 0x06 MSO_I }, { 0x07 MSO_I, 0x08 MSO_I }, { 0x09 MSO_I, 0x0a MSO_I }, { 0x0b MSO_I, 0x0c MSO_I }, + { 0x0d MSO_I, 0x0e MSO_I }, { 0x0f MSO_I, 0x10 MSO_I }, { 0x11 MSO_I, 0x12 MSO_I }, { 0x13 MSO_I, 0x14 MSO_I }, + { 0x15 MSO_I, 0x16 MSO_I }, { 0x17 MSO_I, 0x18 MSO_I }, { 0x19 MSO_I, 0x1a MSO_I }, { 0x1b MSO_I, 0x1c MSO_I }, + { 0x1d MSO_I, 0x1e MSO_I }, { 0x1f MSO_I, 0x20 MSO_I }, { 0x21 MSO_I, 0x22 MSO_I }, { 0x23 MSO_I, 0x24 MSO_I }, + { 0x25 MSO_I, 0x26 MSO_I }, { 0x27 MSO_I, 0x28 MSO_I }, { 0x29 MSO_I, 0x2a MSO_I }, { 0x2b MSO_I, 0x2c MSO_I }, + { 0x2d MSO_I, 0x2e MSO_I }, { 0x2f MSO_I, 0x30 MSO_I }, { 0x31 MSO_I, 0x32 MSO_I }, { 0x33 MSO_I, 0x34 MSO_I }, + { 0x35 MSO_I, 0x36 MSO_I }, { 0x37 MSO_I, 0x38 MSO_I }, { 0x39 MSO_I, 0x3a MSO_I }, { 0x3b MSO_I, 0x3c MSO_I }, + { 0x3d MSO_I, 0x3e MSO_I }, { 0x3f MSO_I, 0x40 MSO_I }, { 0x41 MSO_I, 0x42 MSO_I }, { 0x43 MSO_I, 0x44 MSO_I }, + { 0x45 MSO_I, 0x46 MSO_I }, { 0x47 MSO_I, 0x48 MSO_I }, { 0x49 MSO_I, 0x4a MSO_I }, { 0x4b MSO_I, 0x4c MSO_I }, + { 0x4d MSO_I, 0x4e MSO_I }, { 0x4f MSO_I, 0x50 MSO_I }, { 0x51 MSO_I, 0x52 MSO_I }, { 0x53 MSO_I, 0x54 MSO_I }, + { 0x55 MSO_I, 0x56 MSO_I }, { 0x57 MSO_I, 0x58 MSO_I }, { 0x59 MSO_I, 0x5a MSO_I }, { 0x5b MSO_I, 0x5c MSO_I }, + { 0x5d MSO_I, 0x5e MSO_I }, { 0x5f MSO_I, 0x60 MSO_I }, { 0x61 MSO_I, 0x62 MSO_I }, { 0x63 MSO_I, 0x64 MSO_I }, + { 0x05 MSO_I, 0x06 MSO_I } +}; +const mso_CustomShape msoSeal24 = +{ + const_cast<SvxMSDffVertPair*>(mso_sptSeal24Vert), SAL_N_ELEMENTS( mso_sptSeal24Vert ), + nullptr, 0, + const_cast<SvxMSDffCalculationData*>(mso_sptSeal24Calc), SAL_N_ELEMENTS( mso_sptSeal24Calc ), + const_cast<sal_Int32*>(mso_sptDefault2500), + const_cast<SvxMSDffTextRectangles*>(mso_sptSealTextRect), SAL_N_ELEMENTS( mso_sptSealTextRect ), + 21600, 21600, + MIN_INT32, MIN_INT32, + nullptr, 0, + const_cast<SvxMSDffHandle*>(mso_sptSealHandle), SAL_N_ELEMENTS( mso_sptSealHandle ) // handles +}; +const SvxMSDffCalculationData mso_sptSeal32Calc[] = +{ + { 0x2000, { DFF_Prop_adjustValue, 0, 0 } }, // 0x00 + { 0x2081, { 0x400, 10800, 315 } }, // 0x01 ( textframe ) + { 0x2082, { 0x400, 10800, 315 } }, // 0x02 + { 0x2081, { 0x400, 10800, 135 } }, // 0x03 + { 0x2082, { 0x400, 10800, 135 } }, // 0x04 + { 0x0081, { 0, 10800, 0 } }, + { 0x0082, { 0, 10800, 0 } }, + { 0x2081, { 0x400, 10800, 5 } }, + { 0x2082, { 0x400, 10800, 5 } }, + { 0x0081, { 0, 10800, 11 } }, + { 0x0082, { 0, 10800, 11 } }, + { 0x2081, { 0x400, 10800, 16 } }, + { 0x2082, { 0x400, 10800, 16 } }, + { 0x0081, { 0, 10800, 22 } }, + { 0x0082, { 0, 10800, 22 } }, + { 0x2081, { 0x400, 10800, 28 } }, + { 0x2082, { 0x400, 10800, 28 } }, + { 0x0081, { 0, 10800, 33 } }, + { 0x0082, { 0, 10800, 33 } }, + { 0x2081, { 0x400, 10800, 39 } }, + { 0x2082, { 0x400, 10800, 39 } }, + { 0x0081, { 0, 10800, 45 } }, + { 0x0082, { 0, 10800, 45 } }, + { 0x2081, { 0x400, 10800, 50 } }, + { 0x2082, { 0x400, 10800, 50 } }, + { 0x0081, { 0, 10800, 56 } }, + { 0x0082, { 0, 10800, 56 } }, + { 0x2081, { 0x400, 10800, 61 } }, + { 0x2082, { 0x400, 10800, 61 } }, + { 0x0081, { 0, 10800, 67 } }, + { 0x0082, { 0, 10800, 67 } }, + { 0x2081, { 0x400, 10800, 73 } }, + { 0x2082, { 0x400, 10800, 73 } }, + { 0x0081, { 0, 10800, 78 } }, + { 0x0082, { 0, 10800, 78 } }, + { 0x2081, { 0x400, 10800, 84 } }, + { 0x2082, { 0x400, 10800, 84 } }, + { 0x0081, { 0, 10800, 90 } }, + { 0x0082, { 0, 10800, 90 } }, + { 0x2081, { 0x400, 10800, 95 } }, + { 0x2082, { 0x400, 10800, 95 } }, + { 0x0081, { 0, 10800, 101 } }, + { 0x0082, { 0, 10800, 101 } }, + { 0x2081, { 0x400, 10800, 106 } }, + { 0x2082, { 0x400, 10800, 106 } }, + { 0x0081, { 0, 10800, 112 } }, + { 0x0082, { 0, 10800, 112 } }, + { 0x2081, { 0x400, 10800, 118 } }, + { 0x2082, { 0x400, 10800, 118 } }, + { 0x0081, { 0, 10800, 123 } }, + { 0x0082, { 0, 10800, 123 } }, + { 0x2081, { 0x400, 10800, 129 } }, + { 0x2082, { 0x400, 10800, 129 } }, + { 0x0081, { 0, 10800, 135 } }, + { 0x0082, { 0, 10800, 135 } }, + { 0x2081, { 0x400, 10800, 140 } }, + { 0x2082, { 0x400, 10800, 140 } }, + { 0x0081, { 0, 10800, 146 } }, + { 0x0082, { 0, 10800, 146 } }, + { 0x2081, { 0x400, 10800, 151 } }, + { 0x2082, { 0x400, 10800, 151 } }, + { 0x0081, { 0, 10800, 157 } }, + { 0x0082, { 0, 10800, 157 } }, + { 0x2081, { 0x400, 10800, 163 } }, + { 0x2082, { 0x400, 10800, 163 } }, + { 0x0081, { 0, 10800, 168 } }, + { 0x0082, { 0, 10800, 168 } }, + { 0x2081, { 0x400, 10800, 174 } }, + { 0x2082, { 0x400, 10800, 174 } }, + { 0x0081, { 0, 10800, 180 } }, + { 0x0082, { 0, 10800, 180 } }, + { 0x2081, { 0x400, 10800, 185 } }, + { 0x2082, { 0x400, 10800, 185 } }, + { 0x0081, { 0, 10800, 191 } }, + { 0x0082, { 0, 10800, 191 } }, + { 0x2081, { 0x400, 10800, 196 } }, + { 0x2082, { 0x400, 10800, 196 } }, + { 0x0081, { 0, 10800, 202 } }, + { 0x0082, { 0, 10800, 202 } }, + { 0x2081, { 0x400, 10800, 208 } }, + { 0x2082, { 0x400, 10800, 208 } }, + { 0x0081, { 0, 10800, 213 } }, + { 0x0082, { 0, 10800, 213 } }, + { 0x2081, { 0x400, 10800, 219 } }, + { 0x2082, { 0x400, 10800, 219 } }, + { 0x0081, { 0, 10800, 225 } }, + { 0x0082, { 0, 10800, 225 } }, + { 0x2081, { 0x400, 10800, 230 } }, + { 0x2082, { 0x400, 10800, 230 } }, + { 0x0081, { 0, 10800, 236 } }, + { 0x0082, { 0, 10800, 236 } }, + { 0x2081, { 0x400, 10800, 241 } }, + { 0x2082, { 0x400, 10800, 241 } }, + { 0x0081, { 0, 10800, 247 } }, + { 0x0082, { 0, 10800, 247 } }, + { 0x2081, { 0x400, 10800, 253 } }, + { 0x2082, { 0x400, 10800, 253 } }, + { 0x0081, { 0, 10800, 258 } }, + { 0x0082, { 0, 10800, 258 } }, + { 0x2081, { 0x400, 10800, 264 } }, + { 0x2082, { 0x400, 10800, 264 } }, + { 0x0081, { 0, 10800, 270 } }, + { 0x0082, { 0, 10800, 270 } }, + { 0x2081, { 0x400, 10800, 275 } }, + { 0x2082, { 0x400, 10800, 275 } }, + { 0x0081, { 0, 10800, 281 } }, + { 0x0082, { 0, 10800, 281 } }, + { 0x2081, { 0x400, 10800, 286 } }, + { 0x2082, { 0x400, 10800, 286 } }, + { 0x0081, { 0, 10800, 292 } }, + { 0x0082, { 0, 10800, 292 } }, + { 0x2081, { 0x400, 10800, 298 } }, + { 0x2082, { 0x400, 10800, 298 } }, + { 0x0081, { 0, 10800, 303 } }, + { 0x0082, { 0, 10800, 303 } }, + { 0x2081, { 0x400, 10800, 309 } }, + { 0x2082, { 0x400, 10800, 309 } }, + { 0x0081, { 0, 10800, 315 } }, + { 0x0082, { 0, 10800, 315 } }, + { 0x2081, { 0x400, 10800, 320 } }, + { 0x2082, { 0x400, 10800, 320 } }, + { 0x0081, { 0, 10800, 326 } }, + { 0x0082, { 0, 10800, 326 } }, + { 0x2081, { 0x400, 10800, 331 } }, + { 0x2082, { 0x400, 10800, 331 } }, + { 0x0081, { 0, 10800, 337 } }, + { 0x0082, { 0, 10800, 337 } }, + { 0x2081, { 0x400, 10800, 343 } }, + { 0x2082, { 0x400, 10800, 343 } }, + { 0x0081, { 0, 10800, 348 } }, + { 0x0082, { 0, 10800, 348 } }, + { 0x2081, { 0x400, 10800, 354 } }, + { 0x2082, { 0x400, 10800, 354 } } +}; +const SvxMSDffVertPair mso_sptSeal32Vert[] = +{ + { 0x05 MSO_I, 0x06 MSO_I }, { 0x07 MSO_I, 0x08 MSO_I }, { 0x09 MSO_I, 0x0a MSO_I }, { 0x0b MSO_I, 0x0c MSO_I }, + { 0x0d MSO_I, 0x0e MSO_I }, { 0x0f MSO_I, 0x10 MSO_I }, { 0x11 MSO_I, 0x12 MSO_I }, { 0x13 MSO_I, 0x14 MSO_I }, + { 0x15 MSO_I, 0x16 MSO_I }, { 0x17 MSO_I, 0x18 MSO_I }, { 0x19 MSO_I, 0x1a MSO_I }, { 0x1b MSO_I, 0x1c MSO_I }, + { 0x1d MSO_I, 0x1e MSO_I }, { 0x1f MSO_I, 0x20 MSO_I }, { 0x21 MSO_I, 0x22 MSO_I }, { 0x23 MSO_I, 0x24 MSO_I }, + { 0x25 MSO_I, 0x26 MSO_I }, { 0x27 MSO_I, 0x28 MSO_I }, { 0x29 MSO_I, 0x2a MSO_I }, { 0x2b MSO_I, 0x2c MSO_I }, + { 0x2d MSO_I, 0x2e MSO_I }, { 0x2f MSO_I, 0x30 MSO_I }, { 0x31 MSO_I, 0x32 MSO_I }, { 0x33 MSO_I, 0x34 MSO_I }, + { 0x35 MSO_I, 0x36 MSO_I }, { 0x37 MSO_I, 0x38 MSO_I }, { 0x39 MSO_I, 0x3a MSO_I }, { 0x3b MSO_I, 0x3c MSO_I }, + { 0x3d MSO_I, 0x3e MSO_I }, { 0x3f MSO_I, 0x40 MSO_I }, { 0x41 MSO_I, 0x42 MSO_I }, { 0x43 MSO_I, 0x44 MSO_I }, + { 0x45 MSO_I, 0x46 MSO_I }, { 0x47 MSO_I, 0x48 MSO_I }, { 0x49 MSO_I, 0x4a MSO_I }, { 0x4b MSO_I, 0x4c MSO_I }, + { 0x4d MSO_I, 0x4e MSO_I }, { 0x4f MSO_I, 0x50 MSO_I }, { 0x51 MSO_I, 0x52 MSO_I }, { 0x53 MSO_I, 0x54 MSO_I }, + { 0x55 MSO_I, 0x56 MSO_I }, { 0x57 MSO_I, 0x58 MSO_I }, { 0x59 MSO_I, 0x5a MSO_I }, { 0x5b MSO_I, 0x5c MSO_I }, + { 0x5d MSO_I, 0x5e MSO_I }, { 0x5f MSO_I, 0x60 MSO_I }, { 0x61 MSO_I, 0x62 MSO_I }, { 0x63 MSO_I, 0x64 MSO_I }, + { 0x65 MSO_I, 0x66 MSO_I }, { 0x67 MSO_I, 0x68 MSO_I }, { 0x69 MSO_I, 0x6a MSO_I }, { 0x6b MSO_I, 0x6c MSO_I }, + { 0x6d MSO_I, 0x6e MSO_I }, { 0x6f MSO_I, 0x70 MSO_I }, { 0x71 MSO_I, 0x72 MSO_I }, { 0x73 MSO_I, 0x74 MSO_I }, + { 0x75 MSO_I, 0x76 MSO_I }, { 0x77 MSO_I, 0x78 MSO_I }, { 0x79 MSO_I, 0x7a MSO_I }, { 0x7b MSO_I, 0x7c MSO_I }, + { 0x7d MSO_I, 0x7e MSO_I }, { 0x7f MSO_I, 0x80 MSO_I }, { 0x81 MSO_I, 0x82 MSO_I }, { 0x83 MSO_I, 0x84 MSO_I }, + { 0x05 MSO_I, 0x06 MSO_I } +}; +const mso_CustomShape msoSeal32 = +{ + const_cast<SvxMSDffVertPair*>(mso_sptSeal32Vert), SAL_N_ELEMENTS( mso_sptSeal32Vert ), + nullptr, 0, + const_cast<SvxMSDffCalculationData*>(mso_sptSeal32Calc), SAL_N_ELEMENTS( mso_sptSeal32Calc ), + const_cast<sal_Int32*>(mso_sptDefault2500), + const_cast<SvxMSDffTextRectangles*>(mso_sptSealTextRect), SAL_N_ELEMENTS( mso_sptSealTextRect ), + 21600, 21600, + MIN_INT32, MIN_INT32, + nullptr, 0, + const_cast<SvxMSDffHandle*>(mso_sptSealHandle), SAL_N_ELEMENTS( mso_sptSealHandle ) +}; + +const SvxMSDffVertPair mso_sptRibbon2Vert[] = // adjustment1 : x 2700 - 8100 def 5400 +{ // adjustment2 : y 14400 - 21600 def 18900 + { 12 MSO_I, 1 MSO_I }, { 12 MSO_I, 13 MSO_I }, // pp + { 12 MSO_I, 14 MSO_I }, { 15 MSO_I, 21600 }, { 16 MSO_I, 21600 }, // ccp + { 0, 21600 }, { 2750, 7 MSO_I }, { 0, 2 MSO_I }, { 0 MSO_I, 2 MSO_I }, // pppp + { 0 MSO_I, 4 MSO_I }, // p + { 0 MSO_I, 5 MSO_I }, { 10 MSO_I, 0 }, { 11 MSO_I, 0 }, // ccp + { 17 MSO_I, 0 }, // p + { 18 MSO_I, 0 }, { 19 MSO_I, 5 MSO_I }, { 19 MSO_I, 4 MSO_I }, // ccp + { 19 MSO_I, 2 MSO_I }, { 21600, 2 MSO_I }, { 18850, 7 MSO_I }, { 21600, 21600 }, // pppp + { 20 MSO_I, 21600 }, // p + { 21 MSO_I, 21600 }, { 22 MSO_I, 14 MSO_I }, { 22 MSO_I, 13 MSO_I }, // ccp + { 22 MSO_I, 1 MSO_I }, { 12 MSO_I, 1 MSO_I }, { 12 MSO_I, 13 MSO_I }, // ppp + { 12 MSO_I, 23 MSO_I }, { 15 MSO_I, 24 MSO_I }, { 16 MSO_I, 24 MSO_I }, // ccp + { 11 MSO_I, 24 MSO_I }, // p + { 10 MSO_I, 24 MSO_I }, { 0 MSO_I, 26 MSO_I }, { 0 MSO_I, 25 MSO_I }, // ccp + { 0 MSO_I, 27 MSO_I }, { 10 MSO_I, 1 MSO_I }, { 11 MSO_I, 1 MSO_I }, // ccp + + { 22 MSO_I, 1 MSO_I }, { 22 MSO_I, 13 MSO_I }, // pp + { 22 MSO_I, 23 MSO_I }, { 21 MSO_I, 24 MSO_I }, { 20 MSO_I, 24 MSO_I }, // ccp + { 17 MSO_I, 24 MSO_I }, // p + { 18 MSO_I, 24 MSO_I }, { 19 MSO_I, 26 MSO_I }, { 19 MSO_I, 25 MSO_I }, // ccp + { 19 MSO_I, 27 MSO_I }, { 18 MSO_I, 1 MSO_I }, { 17 MSO_I, 1 MSO_I }, // ccp + + { 0 MSO_I, 25 MSO_I }, { 0 MSO_I, 2 MSO_I }, // pp + + { 19 MSO_I, 25 MSO_I }, { 19 MSO_I, 2 MSO_I } // pp +}; +const sal_uInt16 mso_sptRibbon2Segm[] = +{ + 0x4000, 0x0001, 0x2001, 0x0005, 0x2001, 0x0001, 0x2001, 0x0005, 0x2001, 0x0001, 0x6001, 0x8000, + 0x4000, 0x0001, 0x2001, 0x0001, 0x2002, 0x6001, 0x8000, + 0x4000, 0x0001, 0x2001, 0x0001, 0x2002, 0x6001, 0x8000, + 0x4000, 0x0001, 0x8000, + 0x4000, 0x0001, 0x8000 +}; +const SvxMSDffCalculationData mso_sptRibbon2Calc[] = +{ + { 0x2000, { DFF_Prop_adjustValue, 0, 0 } }, // 00 + { 0x2000, { DFF_Prop_adjust2Value, 0, 0 } }, // 01 + { 0x8000, { 21600, 0, 0x401 } }, // 02 + { 0x2001, { 0x402, 1, 2 } }, // 03 + { 0x2001, { 0x403, 1, 2 } }, // 04 + { 0x2001, { 0x404, 1, 2 } }, // 05 + { 0x2001, { 0x401, 1, 2 } }, // 06 + { 0x8000, { 21600, 0, 0x406 } }, // 07 + { 0x0000, { 420, 0, 0 } }, // 08 + { 0x2001, { 0x408, 2, 1 } }, // 09 + { 0x6000, { 0x400, 0x408, 0 } }, // 10 + { 0x6000, { 0x400, 0x409, 0 } }, // 11 + { 0x2000, { 0x400, 2700, 0 } }, // 12 + { 0x8000, { 21600, 0, 0x404 } }, // 13 + { 0x8000, { 21600, 0, 0x405 } }, // 14 + { 0xa000, { 0x40c, 0, 0x408 } }, // 15 + { 0xa000, { 0x40c, 0, 0x409 } }, // 16 + + { 0x8000, { 21600, 0, 0x40b } }, // 17 + { 0x8000, { 21600, 0, 0x40a } }, // 18 + { 0x8000, { 21600, 0, 0x400 } }, // 19 + { 0x8000, { 21600, 0, 0x410 } }, // 20 + { 0x8000, { 21600, 0, 0x40f } }, // 21 + { 0x8000, { 21600, 0, 0x40c } }, // 22 + + { 0xa000, { 0x40d, 0, 0x405 } }, // 23 + { 0x6000, { 0x401, 0x403, 0 } }, // 24 + { 0x6000, { 0x401, 0x404, 0 } }, // 25 + { 0x6000, { 0x419, 0x405, 0 } }, // 26 + { 0xa000, { 0x419, 0, 0x405 } } // 27 +}; +const sal_Int32 mso_sptRibbon2Default[] = +{ + 2, 5400, 18900 +}; +const SvxMSDffTextRectangles mso_sptRibbon2TextRect[] = +{ + { { 0 MSO_I, 0 }, { 19 MSO_I, 1 MSO_I } } +}; +const SvxMSDffHandle mso_sptRibbon2Handle[] = +{ + { SvxMSDffHandleFlags::RANGE, + 0x100, 0, 10800, 10800, 2700, 8100, MIN_INT32, 0x7fffffff }, + { SvxMSDffHandleFlags::RANGE, + 10800, 0x101, 10800, 10800, MIN_INT32, 0x7fffffff, 14400, 21600 } +}; +const mso_CustomShape msoRibbon2 = +{ + const_cast<SvxMSDffVertPair*>(mso_sptRibbon2Vert), SAL_N_ELEMENTS( mso_sptRibbon2Vert ), + const_cast<sal_uInt16*>(mso_sptRibbon2Segm), sizeof( mso_sptRibbon2Segm ) >> 1, + const_cast<SvxMSDffCalculationData*>(mso_sptRibbon2Calc), SAL_N_ELEMENTS( mso_sptRibbon2Calc ), + const_cast<sal_Int32*>(mso_sptRibbon2Default), + const_cast<SvxMSDffTextRectangles*>(mso_sptRibbon2TextRect), SAL_N_ELEMENTS( mso_sptRibbon2TextRect ), + 21600, 21600, + MIN_INT32, MIN_INT32, + nullptr, 0, + const_cast<SvxMSDffHandle*>(mso_sptRibbon2Handle), SAL_N_ELEMENTS( mso_sptRibbon2Handle ) +}; + +const SvxMSDffVertPair mso_sptRibbonVert[] = +{ + { 0, 0 }, { 3 MSO_I, 0 }, + { 4 MSO_I, 11 MSO_I }, { 4 MSO_I, 10 MSO_I }, { 5 MSO_I, 10 MSO_I }, { 5 MSO_I, 11 MSO_I }, + { 6 MSO_I, 0 }, { 21600, 0 }, { 18 MSO_I, 14 MSO_I }, { 21600, 15 MSO_I }, { 9 MSO_I, 15 MSO_I }, { 9 MSO_I, 16 MSO_I }, { 8 MSO_I, 21600 }, { 1 MSO_I, 21600 }, + { 0 MSO_I, 16 MSO_I }, { 0 MSO_I, 15 MSO_I }, { 0, 15 MSO_I }, { 2700, 14 MSO_I }, + + { 4 MSO_I, 11 MSO_I }, + { 3 MSO_I, 12 MSO_I }, { 1 MSO_I, 12 MSO_I }, + { 0 MSO_I, 13 MSO_I }, { 1 MSO_I, 10 MSO_I }, { 4 MSO_I, 10 MSO_I }, + { 5 MSO_I, 11 MSO_I }, + { 6 MSO_I, 12 MSO_I }, { 8 MSO_I, 12 MSO_I }, + { 9 MSO_I, 13 MSO_I }, { 8 MSO_I, 10 MSO_I }, { 5 MSO_I, 10 MSO_I }, + { 0 MSO_I, 13 MSO_I }, + { 0 MSO_I, 15 MSO_I }, + { 9 MSO_I, 13 MSO_I }, + { 9 MSO_I, 15 MSO_I } +}; +const sal_uInt16 mso_sptRibbonSegm[] = +{ + 0x4000, 0x0001, 0xa701, 0x0003, 0xa801, 0x0005, 0xa801, 0x0001, 0xa701, 0x0003, 0x6000, 0x8000, + 0x4000, 0xaa00, 0xa801, 0x0001, 0xa702, 0x0001, 0x8000, + 0x4000, 0xaa00, 0xa801, 0x0001, 0xa702, 0x0001, 0x8000, + 0x4000, 0xaa00, 0x0001, 0x8000, + 0x4000, 0xaa00, 0x0001, 0x8000 +}; +const SvxMSDffCalculationData mso_sptRibbonCalc[] = +{ + { 0x2000, { DFF_Prop_adjustValue, 0, 0 } }, // 00 + { 0x2000, { 0x400, 675, 0 } }, // 01 + { 0x2000, { 0x401, 675, 0 } }, // 02 + { 0x2000, { 0x402, 675, 0 } }, // 03 + { 0x2000, { 0x403, 675, 0 } }, // 04 + { 0x8000, { 21600, 0, 0x404 } }, // 05 + { 0x8000, { 21600, 0, 0x403 } }, // 06 + { 0x8000, { 21600, 0, 0x402 } }, // 07 + { 0x8000, { 21600, 0, 0x401 } }, // 08 + { 0x8000, { 21600, 0, 0x400 } }, // 09 + { 0x2000, { DFF_Prop_adjust2Value, 0, 0 } }, // 10 + { 0x2001, { 0x40a, 1, 4 } }, // 11 + { 0x2001, { 0x40b, 2, 1 } }, // 12 + { 0x2001, { 0x40b, 3, 1 } }, // 13 + { 0x8000, { 10800, 0, 0x40c } }, // 14 + { 0x8000, { 21600, 0, 0x40a } }, // 15 + { 0x8000, { 21600, 0, 0x40b } }, // 16 + { 0x0001, { 21600, 1, 2 } }, // 17 + { 0x0000, { 21600, 0, 2700 } }, // 18 + { 0x2000, { 0x411, 0, 2700 } } // 19 +}; +const sal_Int32 mso_sptRibbonDefault[] = +{ + 2, 5400, 2700 +}; +const SvxMSDffTextRectangles mso_sptRibbonTextRect[] = +{ + { { 0 MSO_I, 10 MSO_I }, { 9 MSO_I, 21600 } } +}; +const SvxMSDffVertPair mso_sptRibbonGluePoints[] = +{ + { 17 MSO_I, 10 MSO_I }, { 2700, 14 MSO_I }, { 17 MSO_I, 21600 }, { 18 MSO_I, 14 MSO_I } +}; +const SvxMSDffHandle mso_sptRibbonHandle[] = +{ + { SvxMSDffHandleFlags::RANGE, + 0x100, 0, 10800, 10800, 2700, 8100, MIN_INT32, 0x7fffffff }, + { SvxMSDffHandleFlags::RANGE, + 10800, 0x101, 10800, 10800, MIN_INT32, 0x7fffffff, 0, 7200 } +}; +const mso_CustomShape msoRibbon = +{ + const_cast<SvxMSDffVertPair*>(mso_sptRibbonVert), SAL_N_ELEMENTS( mso_sptRibbonVert ), + const_cast<sal_uInt16*>(mso_sptRibbonSegm), sizeof( mso_sptRibbonSegm ) >> 1, + const_cast<SvxMSDffCalculationData*>(mso_sptRibbonCalc), SAL_N_ELEMENTS( mso_sptRibbonCalc ), + const_cast<sal_Int32*>(mso_sptRibbonDefault), + const_cast<SvxMSDffTextRectangles*>(mso_sptRibbonTextRect), SAL_N_ELEMENTS( mso_sptRibbonTextRect ), + 21600, 21600, + MIN_INT32, MIN_INT32, + const_cast<SvxMSDffVertPair*>(mso_sptRibbonGluePoints), SAL_N_ELEMENTS( mso_sptRibbonGluePoints ), + const_cast<SvxMSDffHandle*>(mso_sptRibbonHandle), SAL_N_ELEMENTS( mso_sptRibbonHandle ) +}; +//msosptEllipseRibbon +//svg path = ar@9@38@8@37,0@27@0@26@9@13@8@4@0@25@22@25@9@38@8@37@22@26@3@27l@7@40@3,wa@9@35@8@10@3,0@21@33@9@36@8@1@21@31@20@31@9@35@8@10@20@33,,l@5@40xewr@9@36@8@1@20@31@0@32nfl@20@33ear@9@36@8@1@21@31@22@32nfl@21@33em@0@26nfl@0@32em@22@26nfl@22@32e +//odp path = A ?f9 ?f38 ?f8 ?f37 0 ?f27 ?f0 ?f26 ?f9 ?f13 ?f8 ?f4 ?f0 ?f25 ?f22 ?f25 ?f9 ?f38 ?f8 ?f37 ?f22 ?f26 ?f3 ?f27 L ?f7 ?f40 ?f3 0 W ?f9 ?f35 ?f8 ?f10 ?f3 0 ?f21 ?f33 ?f9 ?f36 ?f8 ?f1 ?f21 ?f31 ?f20 ?f31 ?f9 ?f35 ?f8 ?f10 ?f20 ?f33 0 0 L ?f5 ?f40 Z N W ?f9 ?f36 ?f8 ?f1 ?f20 ?f31 ?f0 ?f32 F L ?f20 ?f33 N A ?f9 ?f36 ?f8 ?f1 ?f21 ?f31 ?f22 ?f32 F L ?f21 ?f33 N M ?f0 ?f26 F L ?f0 ?f32 N M ?f22 ?f26 F L ?f22 ?f32 N +const SvxMSDffVertPair mso_sptEllipseRibbonVert[] = +{ + { 9 MSO_I , 38 MSO_I }, + { 8 MSO_I , 37 MSO_I }, + { 0 , 27 MSO_I }, + { 0 MSO_I , 26 MSO_I }, + { 9 MSO_I , 13 MSO_I }, + { 8 MSO_I , 4 MSO_I }, + { 0 MSO_I , 25 MSO_I }, + { 22 MSO_I , 25 MSO_I }, + { 9 MSO_I , 38 MSO_I }, + { 8 MSO_I , 37 MSO_I }, + { 22 MSO_I , 26 MSO_I }, + { 3 MSO_I , 27 MSO_I }, + { 7 MSO_I , 40 MSO_I }, + { 3 MSO_I , 0 }, + { 9 MSO_I , 35 MSO_I }, + { 8 MSO_I , 10 MSO_I }, + { 3 MSO_I , 0 }, + { 21 MSO_I , 33 MSO_I }, + { 9 MSO_I , 36 MSO_I }, + { 8 MSO_I , 1 MSO_I }, + { 21 MSO_I , 31 MSO_I }, + { 20 MSO_I , 31 MSO_I }, + { 9 MSO_I , 35 MSO_I }, + { 8 MSO_I , 10 MSO_I }, + { 20 MSO_I , 33 MSO_I }, + { 0 , 0 }, + { 5 MSO_I , 40 MSO_I }, + { 9 MSO_I , 36 MSO_I }, + { 8 MSO_I , 1 MSO_I }, + { 20 MSO_I , 31 MSO_I }, + { 0 MSO_I , 32 MSO_I }, + { 20 MSO_I , 33 MSO_I }, + { 9 MSO_I , 36 MSO_I }, + { 8 MSO_I , 1 MSO_I }, + { 21 MSO_I , 31 MSO_I }, + { 22 MSO_I , 32 MSO_I }, + { 21 MSO_I , 33 MSO_I }, + { 0 MSO_I , 26 MSO_I }, + { 0 MSO_I , 32 MSO_I }, + { 22 MSO_I , 26 MSO_I }, + { 22 MSO_I , 32 MSO_I } +}; + +const sal_uInt16 mso_sptEllipseRibbonSegm[] = +{ + 0xa30c /*ar*/,0x0002/*l*/,0xa50c/*wa*/,0x0001/*l*/, + 0x6001/*x*/, 0x8000/*e*/,0xa504/*wr*/,0xaa00/*nf*/, + 0x0001/*l*/, 0x8000/*e*/,0xa304/*ar*/,0xaa00/*nf*/, + 0x0001/*l*/, 0x8000/*e*/,0x4000/*m*/,0xaa00/*nf*/, + 0x0001/*l*/, 0x8000/*e*/,0x4000/*m*/,0xaa00/*nf*/, + 0x0001/*l*/, 0x8000/*e*/ +}; + +const SvxMSDffCalculationData mso_sptEllipseRibbonCalc[] = +{ + { 0x2000 , { DFF_Prop_adjustValue , 0 , 0 } }, //val #0 + { 0x2000 , { DFF_Prop_adjust2Value , 0 , 0 } }, //val #1 + { 0x2000 , { DFF_Prop_adjust3Value , 0 , 0 } }, //val #2 + { 0x2000 , { DFF_Prop_geoRight , 0 , 0 } }, //val width + { 0x2000 , { DFF_Prop_geoBottom , 0 , 0 } }, //val height + { 0x2001 , { DFF_Prop_geoRight , 1 , 8 } }, //prod width 1 8 + { 0x2001 , { DFF_Prop_geoRight , 1 , 2 } }, //prod width 1 2 + { 0x2001 , { DFF_Prop_geoRight , 7 , 8 } }, //prod width 7 8 + { 0x2001 , { DFF_Prop_geoRight , 3 , 2 } }, //prod width 3 2 + { 0x8000 , { 0 , 0 , 0x406 } }, //sum 0 0 @6 + { 0xa000 , { DFF_Prop_geoBottom , 0 , DFF_Prop_adjust3Value } }, //sum height 0 #2 + { 0x2001 , { 0x40a , 30573 , 4096 } }, //prod @10 30573 4096 + { 0x2001 , { 0x40b , 2 , 1 } }, //prod @11 2 1 + { 0xa000 , { DFF_Prop_geoBottom , 0 , 0x40c } }, //sum height 0 @12 + { 0x6000 , { 0x40b , DFF_Prop_adjust3Value , 0 } }, //sum @11 #2 0 + { 0xe000 , { 0x40b , DFF_Prop_geoBottom , DFF_Prop_adjust2Value } }, //sum @11 height #1 + { 0xa000 , { DFF_Prop_geoBottom , 0 , DFF_Prop_adjust2Value } }, //sum height 0 #1 + { 0x2001 , { 0x410 , 1 , 2 } }, //prod @16 1 2 + { 0x6000 , { 0x40b , 0x411 , 0 } }, //sum @11 @17 0 + { 0xe000 , { 0x40e , DFF_Prop_adjust2Value , DFF_Prop_geoBottom } }, //sum @14 #1 height + { 0x6000 , { DFF_Prop_adjustValue , 0x405 , 0 } }, //sum #0 @5 0 + { 0xa000 , { DFF_Prop_geoRight , 0 , 0x414 } }, //sum width 0 @20 + { 0xa000 , { DFF_Prop_geoRight , 0 , DFF_Prop_adjustValue } }, //sum width 0 #0 + { 0xa000 , { 0x406 , 0 , DFF_Prop_adjustValue } }, //sum @6 0 #0 + { 0xe00f , { 0x417 , DFF_Prop_geoRight , 0x40b } }, //ellipse @23 width @11 + { 0xe000 , { 0x418 , DFF_Prop_geoBottom , 0x40b } }, //sum @24 height @11 + { 0xe000 , { 0x419 , 0x40b , 0x413 } }, //sum @25 @11 @19 + { 0xe000 , { DFF_Prop_adjust3Value , 0x40b , 0x413 } }, //sum #2 @11 @19 + { 0x2001 , { 0x40b , 2391 , 32768 } }, //prod @11 2391 32768 + { 0xa000 , { 0x406 , 0 , 0x414 } }, //sum @6 0 @20 + { 0xe00f , { 0x41d , DFF_Prop_geoRight , 0x40b } }, //ellipse @29 width @11 + { 0xe000 , { DFF_Prop_adjust2Value , 0x41e , 0x40b } }, //sum #1 @30 @11 + { 0xe000 , { 0x419 , DFF_Prop_adjust2Value , DFF_Prop_geoBottom } }, //sum @25 #1 height + { 0xe000 , { DFF_Prop_geoBottom , 0x41e , 0x40e } }, //sum height @30 @14 + { 0x6000 , { 0x40b , 0x40e , 0 } }, //sum @11 @14 0 + { 0xa000 , { DFF_Prop_geoBottom , 0 , 0x422 } }, //sum height 0 @34 + { 0xe000 , { 0x423 , 0x413 , 0x40b } }, //sum @35 @19 @11 + { 0xe000 , { 0x40a , 0x40f , 0x40b } }, //sum @10 @15 @11 + { 0xe000 , { 0x423 , 0x40f , 0x40b } }, //sum @35 @15 @11 + { 0xe000 , { 0x41c , 0x40e , 0x412 } }, //sum @28 @14 @18 + { 0xa000 , { DFF_Prop_geoBottom , 0 , 0x427 } }, //sum height 0 @39 + { 0xa000 , { 0x413 , 0 , 0x412 } }, //sum @19 0 @18 + { 0x2001 , { 0x429 , 2 , 3 } }, //prod @41 2 3 + { 0xa000 , { DFF_Prop_adjust2Value , 0 , 0x42a } }, //sum #1 0 @42 + { 0xa000 , { DFF_Prop_adjust3Value , 0 , 0x42a } }, //sum #2 0 @42 + { 0x2004 , { 0x42c , 20925 , 0 } }, //min @44 20925 + { 0x2001 , { DFF_Prop_geoRight , 3 , 8 } }, //prod width 3 8 + { 0x2000 , { 0x42e , 0 , 4 } }, //sum @46 0 4 +}; + +const SvxMSDffTextRectangles mso_sptEllipseRibbonTextRect[] = +{//@0,@1,@22,@25 + { { 0 MSO_I, 1 MSO_I }, { 22 MSO_I, 25 MSO_I } } +}; + +const sal_Int32 mso_sptEllipseRibbonDefault[] = +{ + 3,5400,5400,18900 +}; + +const SvxMSDffHandle mso_sptEllipseRibbonHandle[] = +{ +//position="#0,bottomRight" xrange="@5,@47 +//position="center,#1" yrange="@10,@43 +//position="topLeft,#2" yrange="@27,@45 + { SvxMSDffHandleFlags::RANGE | SvxMSDffHandleFlags::RANGE_X_MAX_IS_SPECIAL| SvxMSDffHandleFlags::RANGE_X_MIN_IS_SPECIAL, + 0x100, 21600, 0, 0, 0x8/*5+3*/, 0x32/*47+3*/, MIN_INT32, 0x7fffffff }, + { SvxMSDffHandleFlags::RANGE | SvxMSDffHandleFlags::RANGE_Y_MAX_IS_SPECIAL | SvxMSDffHandleFlags::RANGE_Y_MIN_IS_SPECIAL, + 10800, 0x101, 0, 0, MIN_INT32, 0x7fffffff,0xd/*10+3*/, 0x2e /*43+3*/ }, + { SvxMSDffHandleFlags::RANGE | SvxMSDffHandleFlags::RANGE_Y_MAX_IS_SPECIAL | SvxMSDffHandleFlags::RANGE_Y_MIN_IS_SPECIAL, + 0, 0x102, 0, 0, MIN_INT32, 0x7fffffff,0x1e/*27+3*/, 0x30 /*45+3*/ } +}; + +const mso_CustomShape msosptEllipseRibbon = +{ + const_cast<SvxMSDffVertPair*>(mso_sptEllipseRibbonVert), SAL_N_ELEMENTS( mso_sptEllipseRibbonVert ), + const_cast<sal_uInt16*>(mso_sptEllipseRibbonSegm), sizeof( mso_sptEllipseRibbonSegm ) >> 1, + const_cast<SvxMSDffCalculationData*>(mso_sptEllipseRibbonCalc), SAL_N_ELEMENTS( mso_sptEllipseRibbonCalc ), + const_cast<sal_Int32*>(mso_sptEllipseRibbonDefault), + const_cast<SvxMSDffTextRectangles*>(mso_sptEllipseRibbonTextRect), SAL_N_ELEMENTS( mso_sptEllipseRibbonTextRect ), + 21600, 21600, + MIN_INT32, MIN_INT32, + nullptr, 0, + const_cast<SvxMSDffHandle*>(mso_sptEllipseRibbonHandle), SAL_N_ELEMENTS( mso_sptEllipseRibbonHandle ) +}; + +//msosptEllipseRibbon2 +//svg path = wr@9@34@8@35,0@24@0@23@9,0@8@11@0@22@19@22@9@34@8@35@19@23@3@24l@7@36@3@4at@9@31@8@32@3@4@18@30@9@1@8@33@18@28@17@28@9@31@8@32@17@30,0@4l@5@36xear@9@1@8@33@17@28@0@29nfl@17@30ewr@9@1@8@33@18@28@19@29nfl@18@30em@0@23nfl@0@29em@19@23nfl@19@29e +const SvxMSDffVertPair mso_sptEllipseRibbon2Vert[] = +{ + { 9 MSO_I , 34 MSO_I }, + { 8 MSO_I , 35 MSO_I }, + { 0 , 24 MSO_I }, + { 0 MSO_I , 23 MSO_I }, + { 9 MSO_I , 0 }, + { 8 MSO_I , 11 MSO_I }, + { 0 MSO_I , 22 MSO_I }, + { 19 MSO_I , 22 MSO_I }, + { 9 MSO_I , 34 MSO_I }, + { 8 MSO_I , 35 MSO_I }, + { 19 MSO_I , 23 MSO_I }, + { 3 MSO_I , 24 MSO_I }, + { 7 MSO_I , 36 MSO_I }, + { 3 MSO_I , 4 MSO_I }, + { 9 MSO_I , 31 MSO_I }, + { 8 MSO_I , 32 MSO_I }, + { 3 MSO_I , 4 MSO_I }, + { 18 MSO_I , 30 MSO_I }, + { 9 MSO_I , 1 MSO_I }, + { 8 MSO_I , 33 MSO_I }, + { 18 MSO_I , 28 MSO_I }, + { 17 MSO_I , 28 MSO_I }, + { 9 MSO_I , 31 MSO_I }, + { 8 MSO_I , 32 MSO_I }, + { 17 MSO_I , 30 MSO_I }, + { 0 , 4l MSO_I }, + { 5 MSO_I , 36 MSO_I }, + { 9 MSO_I , 1 MSO_I }, + { 8 MSO_I , 33 MSO_I }, + { 17 MSO_I , 28 MSO_I }, + { 0 MSO_I , 29 MSO_I }, + { 17 MSO_I , 30 MSO_I }, + { 9 MSO_I , 1 MSO_I }, + { 8 MSO_I , 33 MSO_I }, + { 18 MSO_I , 28 MSO_I }, + { 19 MSO_I , 29 MSO_I }, + { 18 MSO_I , 30 MSO_I }, + { 0 MSO_I , 23 MSO_I }, + { 0 MSO_I , 29 MSO_I }, + { 19 MSO_I , 23 MSO_I }, + { 19 MSO_I , 29 MSO_I } +}; +const sal_uInt16 mso_sptEllipseRibbon2Segm[] = +{ + 0xa50c/*wr*/,0x0002/*l*/,0xa30c/*at*/,0x0001/*l*/, + 0x6001/*x*/, 0x8000/*e*/,0xa304/*ar*/,0xaa00/*nf*/, + 0x0001/*l*/, 0x8000/*e*/,0xa504/*wr*/,0xaa00/*nf*/, + 0x0001/*l*/, 0x8000/*e*/,0x4000/*m*/,0xaa00/*nf*/, + 0x0001/*l*/, 0x8000/*e*/,0x4000/*m*/,0xaa00/*nf*/, + 0x0001/*l*/, 0x8000/*e*/ +}; + +const SvxMSDffCalculationData mso_sptEllipseRibbon2Calc[] = +{ + { 0x2000 , { DFF_Prop_adjustValue , 0 , 0 } }, //val #0 + { 0x2000 , { DFF_Prop_adjust2Value , 0 , 0 } }, //val #1 + { 0x2000 , { DFF_Prop_adjust3Value , 0 , 0 } }, //val #2 + { 0x2000 , { DFF_Prop_geoRight , 0 , 0 } }, //val width + { 0x2000 , { DFF_Prop_geoBottom , 0 , 0 } }, //val height + { 0x2001 , { DFF_Prop_geoRight , 1 , 8 } }, //prod width 1 8 + { 0x2001 , { DFF_Prop_geoRight , 1 , 2 } }, //prod width 1 2 + { 0x2001 , { DFF_Prop_geoRight , 7 , 8 } }, //prod width 7 8 + { 0x2001 , { DFF_Prop_geoRight , 3 , 2 } }, //prod width 3 2 + { 0x8000 , { 0 , 0 , 0x406 } }, //sum 0 0 @6 + { 0x2001 , { DFF_Prop_adjust3Value , 30573 , 4096 } }, //prod #2 30573 4096 + { 0x2001 , { 0x40a , 2 , 1 } }, //prod @10 2 1 + { 0xe000 , { 0x40a , DFF_Prop_geoBottom , DFF_Prop_adjust3Value } }, //sum @10 height #2 + { 0x6000 , { 0x40a , DFF_Prop_adjust2Value , 0 } }, //sum @10 #1 0 + { 0x2001 , { DFF_Prop_adjust2Value , 1 , 2 } }, //prod #1 1 2 + { 0x6000 , { 0x40a , 0x40e , 0 } }, //sum @10 @14 0 + { 0xa000 , { 0x40c , 0 , DFF_Prop_adjust2Value } }, //sum @12 0 #1 + { 0x6000 , { DFF_Prop_adjustValue , 0x405 , 0 } }, //sum #0 @5 0 + { 0xa000 , { DFF_Prop_geoRight , 0 , 0x411 } }, //sum width 0 @17 + { 0xa000 , { DFF_Prop_geoRight , 0 , DFF_Prop_adjustValue } }, //sum width 0 #0 + { 0xa000 , { 0x406 , 0 , DFF_Prop_adjustValue } }, //sum @6 0 #0 + { 0xe00f , { 0x414 , DFF_Prop_geoRight , 0x40a } }, //ellipse @20 width @10 + { 0xa000 , { 0x40a , 0 , 0x415 } }, //sum @10 0 @21 + { 0xe000 , { 0x416 , 0x410 , 0x40a } }, //sum @22 @16 @10 + { 0xe000 , { DFF_Prop_adjust3Value , 0x410 , 0x40a } }, //sum #2 @16 @10 + { 0x2001 , { 0x40a , 2391 , 32768 } }, //prod @10 2391 32768 + { 0xa000 , { 0x406 , 0 , 0x411 } }, //sum @6 0 @17 + { 0xe00f , { 0x41a , DFF_Prop_geoRight , 0x40a } }, //ellipse @26 width @10 + { 0xe000 , { 0x40a , DFF_Prop_adjust2Value , 0x41b } }, //sum @10 #1 @27 + { 0x6000 , { 0x416 , DFF_Prop_adjust2Value , 0 } }, //sum @22 #1 0 + { 0xa000 , { 0x40c , 0 , 0x41b } }, //sum @12 0 @27 + { 0xa000 , { DFF_Prop_geoBottom , 0 , DFF_Prop_adjust3Value } }, //sum height 0 #2 + { 0x6000 , { 0x40a , 0x40c , 0 } }, //sum @10 @12 0 + { 0xe000 , { 0x420 , 0x40a , 0x410 } }, //sum @32 @10 @16 + { 0xe000 , { 0x41f , 0x40a , 0x40d } }, //sum @31 @10 @13 + { 0xe000 , { 0x420 , 0x40a , 0x40d } }, //sum @32 @10 @13 + { 0xe000 , { 0x419 , 0x40c , 0x40f } }, //sum @25 @12 @15 + { 0xa000 , { 0x410 , 0 , 0x40f } }, //sum @16 0 @15 + { 0x2001 , { 0x425 , 2 , 3 } }, //prod @37 2 3 + { 0x6000 , { 0x401 , 0x426 , 0 } }, //sum @1 @38 0 + { 0x6000 , { DFF_Prop_adjust3Value , 0x426 , 0 } }, //sum #2 @38 0 + { 0x2005 , { 0x428 , 675 , 0 } }, //max @40 675 + { 0x2001 , { DFF_Prop_geoRight , 3 , 8 } }, //prod width 3 8 + { 0x2000 , { 0x42a , 0 , 4 } } //sum @42 0 4 +}; + +const SvxMSDffTextRectangles mso_sptEllipseRibbon2TextRect[] = +{//@0,@22,@19,@1 + { { 0 MSO_I, 22 MSO_I }, { 19 MSO_I, 1 MSO_I } } +}; + +const sal_Int32 mso_sptEllipseRibbon2Default[] = +{ + 3,5400,16200,2700 +}; + +const SvxMSDffHandle mso_sptEllipseRibbon2Handle[] = +{ +//position="#0,topLeft" xrange="@5,@43 +//position="center,#1" yrange="@39,@31 +//position="topLeft,#2" yrange="@41,@24 + { SvxMSDffHandleFlags::RANGE | SvxMSDffHandleFlags::RANGE_X_MAX_IS_SPECIAL| SvxMSDffHandleFlags::RANGE_X_MIN_IS_SPECIAL, + 0x100, 0, 0, 0, 0x8/*5+3*/, 0x2e/*43+3*/, MIN_INT32, 0x7fffffff }, + { SvxMSDffHandleFlags::RANGE | SvxMSDffHandleFlags::RANGE_Y_MAX_IS_SPECIAL | SvxMSDffHandleFlags::RANGE_Y_MIN_IS_SPECIAL, + 10800, 0x101, 0, 0, MIN_INT32, 0x7fffffff,0x2a/*39+3*/, 0x22 /*31+3*/ }, + { SvxMSDffHandleFlags::RANGE | SvxMSDffHandleFlags::RANGE_Y_MAX_IS_SPECIAL | SvxMSDffHandleFlags::RANGE_Y_MIN_IS_SPECIAL, + 0, 0x102, 0, 0, MIN_INT32, 0x7fffffff,0x2c/*41+3*/, 0x1b /*24+3*/ } +}; + +const mso_CustomShape msosptEllipseRibbon2 = +{ + const_cast<SvxMSDffVertPair*>(mso_sptEllipseRibbon2Vert), SAL_N_ELEMENTS( mso_sptEllipseRibbon2Vert ), + const_cast<sal_uInt16*>(mso_sptEllipseRibbon2Segm), sizeof( mso_sptEllipseRibbon2Segm ) >> 1, + const_cast<SvxMSDffCalculationData*>(mso_sptEllipseRibbon2Calc), SAL_N_ELEMENTS( mso_sptEllipseRibbon2Calc ), + const_cast<sal_Int32*>(mso_sptEllipseRibbon2Default), + const_cast<SvxMSDffTextRectangles*>(mso_sptEllipseRibbon2TextRect), SAL_N_ELEMENTS( mso_sptEllipseRibbon2TextRect ), + 21600, 21600, + MIN_INT32, MIN_INT32, + nullptr, 0, + const_cast<SvxMSDffHandle*>(mso_sptEllipseRibbon2Handle), SAL_N_ELEMENTS( mso_sptEllipseRibbon2Handle ) +}; +// End +const SvxMSDffVertPair mso_sptVerticalScrollVert[] = // adjustment1 : 0 - 5400 +{ + { 1 MSO_I, 21600 }, { 0, 11 MSO_I }, { 1 MSO_I, 12 MSO_I }, { 0 MSO_I, 12 MSO_I }, + { 0 MSO_I, 1 MSO_I }, { 4 MSO_I, 0 }, { 2 MSO_I, 0 }, { 21600, 1 MSO_I }, + { 2 MSO_I, 0 MSO_I }, { 3 MSO_I, 0 MSO_I }, { 3 MSO_I, 11 MSO_I }, { 5 MSO_I, 21600 }, + + { 6 MSO_I, 1 MSO_I }, { 4 MSO_I, 0 MSO_I }, { 8 MSO_I, 9 MSO_I }, { 4 MSO_I, 1 MSO_I }, + + { 0 MSO_I, 11 MSO_I }, { 1 MSO_I, 21600 }, { 0, 11 MSO_I }, { 1 MSO_I, 12 MSO_I }, + { 9 MSO_I, 10 MSO_I }, { 1 MSO_I, 11 MSO_I }, + + { 4 MSO_I, 0 }, { 6 MSO_I, 1 MSO_I }, + + { 0 MSO_I, 12 MSO_I }, { 0 MSO_I, 11 MSO_I }, + + { 4 MSO_I, 0 MSO_I }, + { 2 MSO_I, 0 MSO_I } +}; +const sal_uInt16 mso_sptVerticalScrollSegm[] = +{ + 0x4000, 0xa702, 0x0002, 0xa801, 0x0001, 0xa702, 0x0002, 0xa801, 0x6001, 0x8000, + 0x4000, 0xa801, 0xa702, 0x6000, 0x8000, + 0x4000, 0xa803, 0xa702, 0x6001, 0x8000, + 0x4000, 0xa701, 0x8000, + 0x4000, 0x0001, 0x8000, + 0x4000, 0x0001, 0x8000 +}; +const SvxMSDffCalculationData mso_sptScrollCalc[] = +{ + { 0x2000, { DFF_Prop_adjustValue, 0, 0 } }, + { 0x2001, { 0x400, 1, 2 } }, + { 0xa000, { DFF_Prop_geoRight, 0, 0x401 } }, + { 0xa000, { DFF_Prop_geoRight, 0, 0x400 } }, + { 0x6000, { 0x400, 0x401, 0 } }, + { 0xa000, { DFF_Prop_geoRight, 0, 0x404 } }, + { 0x2001, { 0x400, 2, 1 } }, + { 0x2001, { 0x401, 1, 2 } }, + { 0x6000, { 0x400, 0x407, 0 } }, + { 0x6000, { 0x401, 0x407, 0 } }, + { 0xa000, { DFF_Prop_geoBottom, 0, 0x409 } }, + { 0xa000, { DFF_Prop_geoBottom, 0, 0x401 } }, + { 0xa000, { DFF_Prop_geoBottom, 0, 0x400 } }, + { 0xa000, { DFF_Prop_geoBottom, 0, 0x404 } } +}; +const SvxMSDffTextRectangles mso_sptScrollTextRect[] = +{ + { { 0 MSO_I, 0 MSO_I }, { 3 MSO_I, 12 MSO_I } } +}; +const SvxMSDffHandle mso_sptVerticalScrollHandle[] = +{ + { SvxMSDffHandleFlags::RANGE, + 0, 0x100, 10800, 10800, MIN_INT32, 0x7fffffff, 0, 5400 } +}; +const mso_CustomShape msoVerticalScroll = +{ + const_cast<SvxMSDffVertPair*>(mso_sptVerticalScrollVert), SAL_N_ELEMENTS( mso_sptVerticalScrollVert ), + const_cast<sal_uInt16*>(mso_sptVerticalScrollSegm), sizeof( mso_sptVerticalScrollSegm ) >> 1, + const_cast<SvxMSDffCalculationData*>(mso_sptScrollCalc), SAL_N_ELEMENTS( mso_sptScrollCalc ), + const_cast<sal_Int32*>(mso_sptDefault2700), + const_cast<SvxMSDffTextRectangles*>(mso_sptScrollTextRect), SAL_N_ELEMENTS( mso_sptScrollTextRect ), + 21600, 21600, + 11000, 10800, + nullptr, 0, + const_cast<SvxMSDffHandle*>(mso_sptVerticalScrollHandle), SAL_N_ELEMENTS( mso_sptVerticalScrollHandle ) +}; +const SvxMSDffVertPair mso_sptHorizontalScrollVert[] = // adjustment1 : 0 - 5400 +{ + { 0, 4 MSO_I }, { 1 MSO_I, 0 MSO_I }, { 3 MSO_I, 0 MSO_I }, { 3 MSO_I, 1 MSO_I }, + { 2 MSO_I, 0 }, { 21600, 1 MSO_I }, { 21600, 13 MSO_I }, { 2 MSO_I, 12 MSO_I }, + { 0 MSO_I, 12 MSO_I }, { 0 MSO_I, 11 MSO_I }, { 1 MSO_I, 21600 }, { 0, 11 MSO_I }, + + { 1 MSO_I, 4 MSO_I }, { 9 MSO_I, 8 MSO_I }, { 0 MSO_I, 4 MSO_I }, { 1 MSO_I, 6 MSO_I }, + + { 2 MSO_I, 1 MSO_I }, { 3 MSO_I, 9 MSO_I }, { 3 MSO_I, 1 MSO_I }, { 2 MSO_I, 0 }, + { 21600, 1 MSO_I }, { 2 MSO_I, 0 MSO_I }, + + { 1 MSO_I, 6 MSO_I }, + { 0, 4 MSO_I }, + + { 2 MSO_I, 0 MSO_I }, + { 3 MSO_I, 0 MSO_I }, + + { 0 MSO_I, 4 MSO_I }, + { 0 MSO_I, 11 MSO_I } +}; +const sal_uInt16 mso_sptHorizontalScrollSegm[] = +{ + 0x4000, 0xa801, 0x0002, 0xa802, 0x0001, 0xa801, 0x0002, 0xa802, 0x6001, 0x8000, + 0x4000, 0xa803, 0x6000, 0x8000, + 0x4000, 0xa803, 0xa702, 0x6000, 0x8000, + 0x4000, 0xa701, 0x8000, + 0x4000, 0x0001, 0x8000, + 0x4000, 0x0001, 0x8000 +}; +const SvxMSDffHandle mso_sptHorizontalScrollHandle[] = +{ + { SvxMSDffHandleFlags::RANGE, + 0x100, 0, 10800, 10800, 0, 5400, MIN_INT32, 0x7fffffff } +}; +const mso_CustomShape msoHorizontalScroll = +{ + const_cast<SvxMSDffVertPair*>(mso_sptHorizontalScrollVert), SAL_N_ELEMENTS( mso_sptHorizontalScrollVert ), + const_cast<sal_uInt16*>(mso_sptHorizontalScrollSegm), sizeof( mso_sptHorizontalScrollSegm ) >> 1, + const_cast<SvxMSDffCalculationData*>(mso_sptScrollCalc), SAL_N_ELEMENTS( mso_sptScrollCalc ), + const_cast<sal_Int32*>(mso_sptDefault2700), + const_cast<SvxMSDffTextRectangles*>(mso_sptScrollTextRect), SAL_N_ELEMENTS( mso_sptScrollTextRect ), + 21600, 21600, + 10800, 11000, + nullptr, 0, + const_cast<SvxMSDffHandle*>(mso_sptHorizontalScrollHandle), SAL_N_ELEMENTS( mso_sptHorizontalScrollHandle ) +}; + +const SvxMSDffVertPair mso_sptFlowChartProcessVert[] = +{ + { 0, 0 }, { 21600, 0 }, { 21600, 21600 }, { 0, 21600 }, { 0, 0 } +}; +const mso_CustomShape msoFlowChartProcess = +{ + const_cast<SvxMSDffVertPair*>(mso_sptFlowChartProcessVert), SAL_N_ELEMENTS( mso_sptFlowChartProcessVert ), + nullptr, 0, + nullptr, 0, + nullptr, + nullptr, 0, + 21600, 21600, + MIN_INT32, MIN_INT32, + const_cast<SvxMSDffVertPair*>(mso_sptStandardGluePoints), SAL_N_ELEMENTS( mso_sptStandardGluePoints ), + nullptr, 0 // handles +}; + +const SvxMSDffVertPair mso_sptFlowChartAlternateProcessVert[] = +{ + { 0, 2 MSO_I }, { 0 MSO_I, 0 }, { 1 MSO_I, 0 }, { 21600, 2 MSO_I }, + { 21600, 3 MSO_I }, { 1 MSO_I, 21600 }, { 0 MSO_I, 21600 }, { 0, 3 MSO_I } +}; +const sal_uInt16 mso_sptFlowChartAlternateProcessSegm[] = +{ + 0x4000, 0xa801, 0x0001, 0xa701, 0x0001, 0xa801, 0x0001, 0xa701, 0x6000, 0x8000 +}; +const SvxMSDffCalculationData mso_sptFlowChartAlternateProcessCalc[] = +{ + { 0x2000, { DFF_Prop_geoLeft, 2540, 0 } }, + { 0x2000, { DFF_Prop_geoRight, 0, 2540 } }, + { 0x2000, { DFF_Prop_geoTop, 2540, 0 } }, + { 0x2000, { DFF_Prop_geoBottom, 0, 2540 } }, + { 0x2000, { DFF_Prop_geoLeft, 800, 0 } }, + { 0x2000, { DFF_Prop_geoRight, 0, 800 } }, + { 0x2000, { DFF_Prop_geoTop, 800, 0 } }, + { 0x2000, { DFF_Prop_geoBottom,0, 800 } } +}; +const SvxMSDffTextRectangles mso_sptFlowChartAlternateProcessTextRect[] = +{ + { { 4 MSO_I, 6 MSO_I }, { 5 MSO_I, 7 MSO_I } } +}; +const mso_CustomShape msoFlowChartAlternateProcess = +{ + const_cast<SvxMSDffVertPair*>(mso_sptFlowChartAlternateProcessVert), SAL_N_ELEMENTS( mso_sptFlowChartAlternateProcessVert ), + const_cast<sal_uInt16*>(mso_sptFlowChartAlternateProcessSegm), sizeof( mso_sptFlowChartAlternateProcessSegm ) >> 1, + const_cast<SvxMSDffCalculationData*>(mso_sptFlowChartAlternateProcessCalc), SAL_N_ELEMENTS( mso_sptFlowChartAlternateProcessCalc ), + nullptr, + const_cast<SvxMSDffTextRectangles*>(mso_sptFlowChartAlternateProcessTextRect), SAL_N_ELEMENTS( mso_sptFlowChartAlternateProcessTextRect ), + 21600, 21600, + MIN_INT32, MIN_INT32, + const_cast<SvxMSDffVertPair*>(mso_sptStandardGluePoints), SAL_N_ELEMENTS( mso_sptStandardGluePoints ), + nullptr, 0 // handles +}; + +const SvxMSDffVertPair mso_sptFlowChartDecisionVert[] = +{ + { 0, 10800 }, { 10800, 0 }, { 21600, 10800 }, { 10800, 21600 }, { 0, 10800 } +}; +const SvxMSDffTextRectangles mso_sptFlowChartDecisionTextRect[] = +{ + { { 5400, 5400 }, { 16200, 16200 } } +}; +const mso_CustomShape msoFlowChartDecision = +{ + const_cast<SvxMSDffVertPair*>(mso_sptFlowChartDecisionVert), SAL_N_ELEMENTS( mso_sptFlowChartDecisionVert ), + nullptr, 0, + nullptr, 0, + nullptr, + const_cast<SvxMSDffTextRectangles*>(mso_sptFlowChartDecisionTextRect), SAL_N_ELEMENTS( mso_sptFlowChartDecisionTextRect ), + 21600, 21600, + MIN_INT32, MIN_INT32, + const_cast<SvxMSDffVertPair*>(mso_sptStandardGluePoints), SAL_N_ELEMENTS( mso_sptStandardGluePoints ), + nullptr, 0 // handles +}; + +const SvxMSDffVertPair mso_sptFlowChartInputOutputVert[] = +{ + { 4230, 0 }, { 21600, 0 }, { 17370, 21600 }, { 0, 21600 }, { 4230, 0 } +}; +const SvxMSDffTextRectangles mso_sptFlowChartInputOutputTextRect[] = +{ + { { 4230, 0 }, { 17370, 21600 } } +}; +const SvxMSDffVertPair mso_sptFlowChartInputOutputGluePoints[] = +{ + { 12960, 0 }, { 10800, 0 }, { 2160, 10800 }, { 8600, 21600 }, { 10800, 21600 }, { 19400, 10800 } +}; +const mso_CustomShape msoFlowChartInputOutput = +{ + const_cast<SvxMSDffVertPair*>(mso_sptFlowChartInputOutputVert), SAL_N_ELEMENTS( mso_sptFlowChartInputOutputVert ), + nullptr, 0, + nullptr, 0, + nullptr, + const_cast<SvxMSDffTextRectangles*>(mso_sptFlowChartInputOutputTextRect), SAL_N_ELEMENTS( mso_sptFlowChartInputOutputTextRect ), + 21600, 21600, + MIN_INT32, MIN_INT32, + const_cast<SvxMSDffVertPair*>(mso_sptFlowChartInputOutputGluePoints), SAL_N_ELEMENTS( mso_sptFlowChartInputOutputGluePoints ), + nullptr, 0 // handles +}; + +const SvxMSDffVertPair mso_sptFlowChartPredefinedProcessVert[] = +{ + { 0, 0 }, { 21600, 0 }, { 21600, 21600 }, { 0, 21600 }, + + { 2540, 0 }, { 2540, 21600 }, + + { 21600 - 2540, 0 }, { 21600 - 2540, 21600 } +}; +const sal_uInt16 mso_sptFlowChartPredefinedProcessSegm[] = +{ + 0x4000, 0x0003, 0x6000, 0x8000, + 0x4000, 0x0001, 0x8000, + 0x4000, 0x0001, 0x8000 +}; +const SvxMSDffTextRectangles mso_sptFlowChartPredefinedProcessTextRect[] = +{ + { { 2540, 0 }, { 21600 - 2540, 21600 } } +}; +const mso_CustomShape msoFlowChartPredefinedProcess = +{ + const_cast<SvxMSDffVertPair*>(mso_sptFlowChartPredefinedProcessVert), SAL_N_ELEMENTS( mso_sptFlowChartPredefinedProcessVert ), + const_cast<sal_uInt16*>(mso_sptFlowChartPredefinedProcessSegm), sizeof( mso_sptFlowChartPredefinedProcessSegm ) >> 1, + nullptr, 0, + nullptr, + const_cast<SvxMSDffTextRectangles*>(mso_sptFlowChartPredefinedProcessTextRect), SAL_N_ELEMENTS( mso_sptFlowChartPredefinedProcessTextRect ), + 21600, 21600, + MIN_INT32, MIN_INT32, + nullptr, 0, + nullptr, 0 // handles +}; + +const SvxMSDffVertPair mso_sptFlowChartInternalStorageVert[] = +{ + { 0, 0 }, { 21600, 0 }, { 21600, 21600 }, { 0, 21600 }, + + { 4230, 0 }, { 4230, 21600 }, + + { 0, 4230 }, { 21600, 4230 } +}; +const sal_uInt16 mso_sptFlowChartInternalStorageSegm[] = +{ + 0x4000, 0x0003, 0x6000, 0x8000, + 0x4000, 0x0001, 0x8000, + 0x4000, 0x0001, 0x8000 +}; +const SvxMSDffTextRectangles mso_sptFlowChartInternalStorageTextRect[] = +{ + { { 4230, 4230 }, { 21600, 21600 } } +}; +const mso_CustomShape msoFlowChartInternalStorage = +{ + const_cast<SvxMSDffVertPair*>(mso_sptFlowChartInternalStorageVert), SAL_N_ELEMENTS( mso_sptFlowChartInternalStorageVert ), + const_cast<sal_uInt16*>(mso_sptFlowChartInternalStorageSegm), sizeof( mso_sptFlowChartInternalStorageSegm ) >> 1, + nullptr, 0, + nullptr, + const_cast<SvxMSDffTextRectangles*>(mso_sptFlowChartInternalStorageTextRect), SAL_N_ELEMENTS( mso_sptFlowChartInternalStorageTextRect ), + 21600, 21600, + MIN_INT32, MIN_INT32, + nullptr, 0, + nullptr, 0 // handles +}; + +const SvxMSDffVertPair mso_sptFlowChartDocumentVert[] = +{ + { 0, 0 }, { 21600, 0 }, { 21600, 17360 }, + { 13050, 17220 }, { 13340, 20770 }, { 5620, 21600 }, // ccp + { 2860, 21100 }, { 1850, 20700 }, { 0, 20120 } // ccp +}; +const sal_uInt16 mso_sptFlowChartDocumentSegm[] = +{ + 0x4000, 0x0002, 0x2002, 0x6000, 0x8000 +}; +const SvxMSDffTextRectangles mso_sptFlowChartDocumentTextRect[] = +{ + { { 0, 0 }, { 21600, 17360 } } +}; +const SvxMSDffVertPair mso_sptFlowChartDocumentGluePoints[] = +{ + { 10800, 0 }, { 0, 10800 }, { 10800, 20320 }, { 21600, 10800 } +}; +const mso_CustomShape msoFlowChartDocument = +{ + const_cast<SvxMSDffVertPair*>(mso_sptFlowChartDocumentVert), SAL_N_ELEMENTS( mso_sptFlowChartDocumentVert ), + const_cast<sal_uInt16*>(mso_sptFlowChartDocumentSegm), sizeof( mso_sptFlowChartDocumentSegm ) >> 1, + nullptr, 0, + nullptr, + const_cast<SvxMSDffTextRectangles*>(mso_sptFlowChartDocumentTextRect), SAL_N_ELEMENTS( mso_sptFlowChartDocumentTextRect ), + 21600, 21600, + MIN_INT32, MIN_INT32, + const_cast<SvxMSDffVertPair*>(mso_sptFlowChartDocumentGluePoints), SAL_N_ELEMENTS( mso_sptFlowChartDocumentGluePoints ), + nullptr, 0 // handles +}; + +const SvxMSDffVertPair mso_sptFlowChartMultidocumentVert[] = +{ + { 0, 3600 }, { 1500, 3600 }, { 1500, 1800 }, { 3000, 1800 }, + { 3000, 0 }, { 21600, 0 }, { 21600, 14409 }, { 21600 - 1500, 14409 }, + { 21600 - 1500, 14409 + 1800 }, { 21600 - 3000, 14409 + 1800 }, { 21600 - 3000, 14409 + 3600 }, + { 11610, 14293 + 3600 }, { 11472, 17239 + 3600 }, { 4833, 17928 + 3600 }, // ccp + { 2450, 17513 + 3600 }, { 1591, 17181 + 3600 }, { 0, 16700 + 3600 }, // ccp + + { 1500, 3600 }, { 21600 - 3000, 3600 }, { 21600 - 3000, 14409 + 1800 }, + + { 3000, 1800 }, { 21600 - 1500, 1800 }, { 21600 - 1500, 14409 } +}; +const sal_uInt16 mso_sptFlowChartMultidocumentSegm[] = +{ + 0x4000, 0x000a, 0x2002, 0x6000, 0x8000, + 0x4000, 0xaa00, 0x0002, 0x8000, // NO FILL + 0x4000, 0xaa00, 0x0002, 0x8000 // NO FILL +}; +const SvxMSDffTextRectangles mso_sptFlowChartMultidocumentTextRect[] = +{ + { { 0, 3600 }, { 21600 - 3000, 14409 + 3600 } } +}; +const SvxMSDffVertPair mso_sptFlowChartMultidocumentGluePoints[] = +{ + { 10800, 0 }, { 0, 10800 }, { 10800, 19890 }, { 21600, 10800 } +}; +const mso_CustomShape msoFlowChartMultidocument = +{ + const_cast<SvxMSDffVertPair*>(mso_sptFlowChartMultidocumentVert), SAL_N_ELEMENTS( mso_sptFlowChartMultidocumentVert ), + const_cast<sal_uInt16*>(mso_sptFlowChartMultidocumentSegm), sizeof( mso_sptFlowChartMultidocumentSegm ) >> 1, + nullptr, 0, + nullptr, + const_cast<SvxMSDffTextRectangles*>(mso_sptFlowChartMultidocumentTextRect), SAL_N_ELEMENTS( mso_sptFlowChartMultidocumentTextRect ), + 21600, 21600, + MIN_INT32, MIN_INT32, + const_cast<SvxMSDffVertPair*>(mso_sptFlowChartMultidocumentGluePoints), SAL_N_ELEMENTS( mso_sptFlowChartMultidocumentGluePoints ), + nullptr, 0 // handles +}; + +const SvxMSDffVertPair mso_sptFlowChartTerminatorVert[] = +{ + { 3470, 21600 }, { 0, 10800 }, { 3470, 0 }, { 18130, 0 }, + { 21600, 10800 }, { 18130, 21600 } +}; +const sal_uInt16 mso_sptFlowChartTerminatorSegm[] = +{ + 0x4000, 0xa702, 0x0001, 0xa702, 0x6000, 0x8000 +}; +const SvxMSDffTextRectangles mso_sptFlowChartTerminatorTextRect[] = +{ + { { 1060, 3180 }, { 20540, 18420 } } +}; +const mso_CustomShape msoFlowChartTerminator = +{ + const_cast<SvxMSDffVertPair*>(mso_sptFlowChartTerminatorVert), SAL_N_ELEMENTS( mso_sptFlowChartTerminatorVert ), + const_cast<sal_uInt16*>(mso_sptFlowChartTerminatorSegm), sizeof( mso_sptFlowChartTerminatorSegm ) >> 1, + nullptr, 0, + nullptr, + const_cast<SvxMSDffTextRectangles*>(mso_sptFlowChartTerminatorTextRect), SAL_N_ELEMENTS( mso_sptFlowChartTerminatorTextRect ), + 21600, 21600, + MIN_INT32, MIN_INT32, + const_cast<SvxMSDffVertPair*>(mso_sptStandardGluePoints), SAL_N_ELEMENTS( mso_sptStandardGluePoints ), + nullptr, 0 // handles +}; + +const SvxMSDffVertPair mso_sptFlowChartPreparationVert[] = +{ + { 4350, 0 }, { 17250, 0 }, { 21600, 10800 }, { 17250, 21600 }, + { 4350, 21600 }, { 0, 10800 }, { 4350, 0 } +}; +const SvxMSDffTextRectangles mso_sptFlowChartPreparationTextRect[] = +{ + { { 4350, 0 }, { 17250, 21600 } } +}; +const mso_CustomShape msoFlowChartPreparation = +{ + const_cast<SvxMSDffVertPair*>(mso_sptFlowChartPreparationVert), SAL_N_ELEMENTS( mso_sptFlowChartPreparationVert ), + nullptr, 0, + nullptr, 0, + nullptr, + const_cast<SvxMSDffTextRectangles*>(mso_sptFlowChartPreparationTextRect), SAL_N_ELEMENTS( mso_sptFlowChartPreparationTextRect ), + 21600, 21600, + MIN_INT32, MIN_INT32, + const_cast<SvxMSDffVertPair*>(mso_sptStandardGluePoints), SAL_N_ELEMENTS( mso_sptStandardGluePoints ), + nullptr, 0 // handles +}; + +const SvxMSDffVertPair mso_sptFlowChartManualInputVert[] = +{ + { 0, 4300 }, { 21600, 0 }, { 21600, 21600 }, { 0, 21600 }, { 0, 4300 } +}; +const SvxMSDffTextRectangles mso_sptFlowChartManualInputTextRect[] = +{ + { { 0, 4300 }, { 21600, 21600 } } +}; +const SvxMSDffVertPair mso_sptFlowChartManualInputGluePoints[] = +{ + { 10800, 2150 }, { 0, 10800 }, { 10800, 19890 }, { 21600, 10800 } +}; +const mso_CustomShape msoFlowChartManualInput = +{ + const_cast<SvxMSDffVertPair*>(mso_sptFlowChartManualInputVert), SAL_N_ELEMENTS( mso_sptFlowChartManualInputVert ), + nullptr, 0, + nullptr, 0, + nullptr, + const_cast<SvxMSDffTextRectangles*>(mso_sptFlowChartManualInputTextRect), SAL_N_ELEMENTS( mso_sptFlowChartManualInputTextRect ), + 21600, 21600, + MIN_INT32, MIN_INT32, + const_cast<SvxMSDffVertPair*>(mso_sptFlowChartManualInputGluePoints), SAL_N_ELEMENTS( mso_sptFlowChartManualInputGluePoints ), + nullptr, 0 // handles +}; + +const SvxMSDffVertPair mso_sptFlowChartManualOperationVert[] = +{ + { 0, 0 }, { 21600, 0 }, { 17250, 21600 }, { 4350, 21600 }, { 0, 0 } +}; +const SvxMSDffTextRectangles mso_sptFlowChartManualOperationTextRect[] = +{ + { { 4350, 0 }, { 17250, 21600 } } +}; +const SvxMSDffVertPair mso_sptFlowChartManualOperationGluePoints[] = +{ + { 10800, 0 }, { 2160, 10800 }, { 10800, 21600 }, { 19440, 10800 } +}; +const mso_CustomShape msoFlowChartManualOperation = +{ + const_cast<SvxMSDffVertPair*>(mso_sptFlowChartManualOperationVert), SAL_N_ELEMENTS( mso_sptFlowChartManualOperationVert ), + nullptr, 0, + nullptr, 0, + nullptr, + const_cast<SvxMSDffTextRectangles*>(mso_sptFlowChartManualOperationTextRect), SAL_N_ELEMENTS( mso_sptFlowChartManualOperationTextRect ), + 21600, 21600, + MIN_INT32, MIN_INT32, + const_cast<SvxMSDffVertPair*>(mso_sptFlowChartManualOperationGluePoints), SAL_N_ELEMENTS( mso_sptFlowChartManualOperationGluePoints ), + nullptr, 0 // handles +}; + +const SvxMSDffVertPair mso_sptFlowChartConnectorVert[] = +{ + { 10800, 10800 }, { 10800, 10800 }, { 0, 360 } +}; +const sal_uInt16 mso_sptFlowChartConnectorSegm[] = +{ + 0xa203, 0x6000, 0x8000 +}; +const SvxMSDffTextRectangles mso_sptFlowChartConnectorTextRect[] = +{ + { { 3180, 3180 }, { 18420, 18420 } } +}; +const mso_CustomShape msoFlowChartConnector = +{ + const_cast<SvxMSDffVertPair*>(mso_sptFlowChartConnectorVert), SAL_N_ELEMENTS( mso_sptFlowChartConnectorVert ), + const_cast<sal_uInt16*>(mso_sptFlowChartConnectorSegm), sizeof( mso_sptFlowChartConnectorSegm ) >> 1, + nullptr, 0, + nullptr, + const_cast<SvxMSDffTextRectangles*>(mso_sptFlowChartConnectorTextRect), SAL_N_ELEMENTS( mso_sptFlowChartConnectorTextRect ), + 21600, 21600, + MIN_INT32, MIN_INT32, + const_cast<SvxMSDffVertPair*>(mso_sptEllipseGluePoints), SAL_N_ELEMENTS( mso_sptEllipseGluePoints ), + nullptr, 0 // handles +}; + +const SvxMSDffVertPair mso_sptFlowChartOffpageConnectorVert[] = +{ + { 0, 0 }, { 21600, 0 }, { 21600, 17150 }, { 10800, 21600 }, + { 0, 17150 }, { 0, 0 } +}; +const SvxMSDffTextRectangles mso_sptFlowChartOffpageConnectorTextRect[] = +{ + { { 0, 0 }, { 21600, 17150 } } +}; +const mso_CustomShape msoFlowChartOffpageConnector = +{ + const_cast<SvxMSDffVertPair*>(mso_sptFlowChartOffpageConnectorVert), SAL_N_ELEMENTS( mso_sptFlowChartOffpageConnectorVert ), + nullptr, 0, + nullptr, 0, + nullptr, + const_cast<SvxMSDffTextRectangles*>(mso_sptFlowChartOffpageConnectorTextRect), SAL_N_ELEMENTS( mso_sptFlowChartOffpageConnectorTextRect ), + 21600, 21600, + MIN_INT32, MIN_INT32, + const_cast<SvxMSDffVertPair*>(mso_sptStandardGluePoints), SAL_N_ELEMENTS( mso_sptStandardGluePoints ), + nullptr, 0 // handles +}; + +const SvxMSDffVertPair mso_sptFlowChartPunchedCardVert[] = +{ + { 4300, 0 }, { 21600, 0 }, { 21600, 21600 }, { 0, 21600 }, + { 0, 4300 }, { 4300, 0 } +}; +const SvxMSDffTextRectangles mso_sptFlowChartPunchedCardTextRect[] = +{ + { { 0, 4300 }, { 21600, 21600 } } +}; +const mso_CustomShape msoFlowChartPunchedCard = +{ + const_cast<SvxMSDffVertPair*>(mso_sptFlowChartPunchedCardVert), SAL_N_ELEMENTS( mso_sptFlowChartPunchedCardVert ), + nullptr, 0, + nullptr, 0, + nullptr, + const_cast<SvxMSDffTextRectangles*>(mso_sptFlowChartPunchedCardTextRect), SAL_N_ELEMENTS( mso_sptFlowChartPunchedCardTextRect ), + 21600, 21600, + MIN_INT32, MIN_INT32, + const_cast<SvxMSDffVertPair*>(mso_sptStandardGluePoints), SAL_N_ELEMENTS( mso_sptStandardGluePoints ), + nullptr, 0 // handles +}; + +const SvxMSDffVertPair mso_sptFlowChartPunchedTapeVert[] = +{ + { 0, 2230 }, // p + { 820, 3990 }, { 3410, 3980 }, { 5370, 4360 }, // ccp + { 7430, 4030 }, { 10110, 3890 }, { 10690, 2270 }, // ccp + { 11440, 300 }, { 14200, 160 }, { 16150, 0 }, // ccp + { 18670, 170 }, { 20690, 390 }, { 21600, 2230 }, // ccp + { 21600, 19420 }, // p + { 20640, 17510 }, { 18320, 17490 }, { 16140, 17240 }, // ccp + { 14710, 17370 }, { 11310, 17510 }, { 10770, 19430 }, // ccp + { 10150, 21150 }, { 7380, 21290 }, { 5290, 21600 }, // ccp + { 3220, 21250 }, { 610, 21130 }, { 0, 19420 } // ccp +}; +const sal_uInt16 mso_sptFlowChartPunchedTapeSegm[] = +{ + 0x4000, 0x2004, 0x0001, 0x2004, 0x6000, 0x8000 +}; +const SvxMSDffTextRectangles mso_sptFlowChartPunchedTapeTextRect[] = +{ + { { 0, 4360 }, { 21600, 17240 } } +}; +const SvxMSDffVertPair mso_sptFlowChartPunchedTapeGluePoints[] = +{ + { 10800, 2020 }, { 0, 10800 }, { 10800, 19320 }, { 21600, 10800 } +}; +const mso_CustomShape msoFlowChartPunchedTape = +{ + const_cast<SvxMSDffVertPair*>(mso_sptFlowChartPunchedTapeVert), SAL_N_ELEMENTS( mso_sptFlowChartPunchedTapeVert ), + const_cast<sal_uInt16*>(mso_sptFlowChartPunchedTapeSegm), sizeof( mso_sptFlowChartPunchedTapeSegm ) >> 1, + nullptr, 0, + nullptr, + const_cast<SvxMSDffTextRectangles*>(mso_sptFlowChartPunchedTapeTextRect), SAL_N_ELEMENTS( mso_sptFlowChartPunchedTapeTextRect ), + 21600, 21600, + MIN_INT32, MIN_INT32, + const_cast<SvxMSDffVertPair*>(mso_sptFlowChartPunchedTapeGluePoints), SAL_N_ELEMENTS( mso_sptFlowChartPunchedTapeGluePoints ), + nullptr, 0 // handles +}; + +const SvxMSDffVertPair mso_sptFlowChartSummingJunctionVert[] = +{ + { 10800, 10800 }, { 10800, 10800 }, { 0, 360 }, + + { 3100, 3100 }, + { 18500, 18500 }, + + { 3100, 18500 }, + { 18500, 3100 } +}; +const sal_uInt16 mso_sptFlowChartSummingJunctionSegm[] = +{ + 0xa203, 0x6000, 0x8000, + 0x4000, 0x0001, 0x8000, + 0x4000, 0x0001, 0x8000 +}; +const SvxMSDffTextRectangles mso_sptFlowChartSummingJunctionTextRect[] = +{ + { { 3100, 3100 }, { 18500, 18500 } } +}; +const mso_CustomShape msoFlowChartSummingJunction = +{ + const_cast<SvxMSDffVertPair*>(mso_sptFlowChartSummingJunctionVert), SAL_N_ELEMENTS( mso_sptFlowChartSummingJunctionVert ), + const_cast<sal_uInt16*>(mso_sptFlowChartSummingJunctionSegm), sizeof( mso_sptFlowChartSummingJunctionSegm ) >> 1, + nullptr, 0, + nullptr, + const_cast<SvxMSDffTextRectangles*>(mso_sptFlowChartSummingJunctionTextRect), SAL_N_ELEMENTS( mso_sptFlowChartSummingJunctionTextRect ), + 21600, 21600, + MIN_INT32, MIN_INT32, + const_cast<SvxMSDffVertPair*>(mso_sptEllipseGluePoints), SAL_N_ELEMENTS( mso_sptEllipseGluePoints ), + nullptr, 0 // handles +}; + +const SvxMSDffVertPair mso_sptFlowChartOrVert[] = +{ + { 10800, 10800 }, { 10800, 10800 }, { 0, 360 }, + + { 0, 10800 }, { 21600, 10800 }, + + { 10800, 0 }, { 10800, 21600 } +}; +const sal_uInt16 mso_sptFlowChartOrSegm[] = +{ + 0xa203, 0x6000, 0x8000, + 0x4000, 0x0001, 0x8000, + 0x4000, 0x0001, 0x8000 +}; +const SvxMSDffTextRectangles mso_sptFlowChartOrTextRect[] = +{ + { { 3100, 3100 }, { 18500, 18500 } } +}; +const mso_CustomShape msoFlowChartOr = +{ + const_cast<SvxMSDffVertPair*>(mso_sptFlowChartOrVert), SAL_N_ELEMENTS( mso_sptFlowChartOrVert ), + const_cast<sal_uInt16*>(mso_sptFlowChartOrSegm), sizeof( mso_sptFlowChartOrSegm ) >> 1, + nullptr, 0, + nullptr, + const_cast<SvxMSDffTextRectangles*>(mso_sptFlowChartOrTextRect), SAL_N_ELEMENTS( mso_sptFlowChartOrTextRect ), + 21600, 21600, + MIN_INT32, MIN_INT32, + const_cast<SvxMSDffVertPair*>(mso_sptEllipseGluePoints), SAL_N_ELEMENTS( mso_sptEllipseGluePoints ), + nullptr, 0 // handles +}; + +const SvxMSDffVertPair mso_sptFlowChartCollateVert[] = +{ + { 0, 0 }, { 21600, 21600 }, { 0, 21600 }, { 21600, 0 }, { 0, 0 } +}; +const SvxMSDffTextRectangles mso_sptFlowChartCollateTextRect[] = +{ + { { 5400, 5400 }, { 16200, 16200 } } +}; +const SvxMSDffVertPair mso_sptFlowChartCollateGluePoints[] = +{ + { 10800, 0 }, { 10800, 10800 }, { 10800, 21600 } +}; +const mso_CustomShape msoFlowChartCollate = +{ + const_cast<SvxMSDffVertPair*>(mso_sptFlowChartCollateVert), SAL_N_ELEMENTS( mso_sptFlowChartCollateVert ), + nullptr, 0, + nullptr, 0, + nullptr, + const_cast<SvxMSDffTextRectangles*>(mso_sptFlowChartCollateTextRect), SAL_N_ELEMENTS( mso_sptFlowChartCollateTextRect ), + 21600, 21600, + MIN_INT32, MIN_INT32, + const_cast<SvxMSDffVertPair*>(mso_sptFlowChartCollateGluePoints), SAL_N_ELEMENTS( mso_sptFlowChartCollateGluePoints ), + nullptr, 0 // handles +}; + +const SvxMSDffVertPair mso_sptFlowChartSortVert[] = +{ + { 0, 10800 }, { 10800, 0 }, { 21600, 10800 }, { 10800, 21600 }, + + { 0, 10800 }, { 21600, 10800 } +}; +const sal_uInt16 mso_sptFlowChartSortSegm[] = +{ + 0x4000, 0x0003, 0x6000, 0x8000, + 0x4000, 0x0001, 0x8000 +}; +const SvxMSDffTextRectangles mso_sptFlowChartSortTextRect[] = +{ + { { 5400, 5400 }, { 16200, 16200 } } +}; +const mso_CustomShape msoFlowChartSort = +{ + const_cast<SvxMSDffVertPair*>(mso_sptFlowChartSortVert), SAL_N_ELEMENTS( mso_sptFlowChartSortVert ), + const_cast<sal_uInt16*>(mso_sptFlowChartSortSegm), sizeof( mso_sptFlowChartSortSegm ) >> 1, + nullptr, 0, + nullptr, + const_cast<SvxMSDffTextRectangles*>(mso_sptFlowChartSortTextRect), SAL_N_ELEMENTS( mso_sptFlowChartSortTextRect ), + 21600, 21600, + MIN_INT32, MIN_INT32, + nullptr, 0, + nullptr, 0 // handles +}; + +const SvxMSDffVertPair mso_sptFlowChartExtractVert[] = +{ + { 10800, 0 }, { 21600, 21600 }, { 0, 21600 }, { 10800, 0 } +}; +const SvxMSDffTextRectangles mso_sptFlowChartExtractTextRect[] = +{ + { { 5400, 10800 }, { 16200, 21600 } } +}; +const SvxMSDffVertPair mso_sptFlowChartExtractGluePoints[] = +{ + { 10800, 0 }, { 5400, 10800 }, { 10800, 21600 }, { 16200, 10800 } +}; +const mso_CustomShape msoFlowChartExtract = +{ + const_cast<SvxMSDffVertPair*>(mso_sptFlowChartExtractVert), SAL_N_ELEMENTS( mso_sptFlowChartExtractVert ), + nullptr, 0, + nullptr, 0, + nullptr, + const_cast<SvxMSDffTextRectangles*>(mso_sptFlowChartExtractTextRect), SAL_N_ELEMENTS( mso_sptFlowChartExtractTextRect ), + 21600, 21600, + MIN_INT32, MIN_INT32, + const_cast<SvxMSDffVertPair*>(mso_sptFlowChartExtractGluePoints), SAL_N_ELEMENTS( mso_sptFlowChartExtractGluePoints ), + nullptr, 0 // handles +}; + +const SvxMSDffVertPair mso_sptFlowChartMergeVert[] = +{ + { 0, 0 }, { 21600, 0 }, { 10800, 21600 }, { 0, 0 } +}; +const SvxMSDffTextRectangles mso_sptFlowChartMergeTextRect[] = +{ + { { 5400, 0 }, { 16200, 10800 } } +}; +const mso_CustomShape msoFlowChartMerge = +{ + const_cast<SvxMSDffVertPair*>(mso_sptFlowChartMergeVert), SAL_N_ELEMENTS( mso_sptFlowChartMergeVert ), + nullptr, 0, + nullptr, 0, + nullptr, + const_cast<SvxMSDffTextRectangles*>(mso_sptFlowChartMergeTextRect), SAL_N_ELEMENTS( mso_sptFlowChartMergeTextRect ), + 21600, 21600, + MIN_INT32, MIN_INT32, + const_cast<SvxMSDffVertPair*>(mso_sptFlowChartExtractGluePoints), SAL_N_ELEMENTS( mso_sptFlowChartExtractGluePoints ), + nullptr, 0 // handles +}; + +const SvxMSDffVertPair mso_sptFlowChartOnlineStorageVert[] = +{ + { 3600, 21600 }, { 0, 10800 }, { 3600, 0 }, { 21600, 0 }, + { 18000, 10800 }, { 21600, 21600 } +}; +const sal_uInt16 mso_sptFlowChartOnlineStorageSegm[] = +{ + 0x4000, 0xa702, 0x0001, 0xa702, 0x6000, 0x8000 +}; +const SvxMSDffTextRectangles mso_sptFlowChartOnlineStorageTextRect[] = +{ + { { 3600, 0 }, { 18000, 21600 } } +}; +const SvxMSDffVertPair mso_sptFlowChartOnlineStorageGluePoints[] = +{ + { 10800, 0 }, { 0, 10800 }, { 10800, 21600 }, { 18000, 10800 } +}; +const mso_CustomShape msoFlowChartOnlineStorage = +{ + const_cast<SvxMSDffVertPair*>(mso_sptFlowChartOnlineStorageVert), SAL_N_ELEMENTS( mso_sptFlowChartOnlineStorageVert ), + const_cast<sal_uInt16*>(mso_sptFlowChartOnlineStorageSegm), sizeof( mso_sptFlowChartOnlineStorageSegm ) >> 1, + nullptr, 0, + nullptr, + const_cast<SvxMSDffTextRectangles*>(mso_sptFlowChartOnlineStorageTextRect), SAL_N_ELEMENTS( mso_sptFlowChartOnlineStorageTextRect ), + 21600, 21600, + MIN_INT32, MIN_INT32, + const_cast<SvxMSDffVertPair*>(mso_sptFlowChartOnlineStorageGluePoints), SAL_N_ELEMENTS( mso_sptFlowChartOnlineStorageGluePoints ), + nullptr, 0 // handles +}; + +const SvxMSDffVertPair mso_sptFlowChartDelayVert[] = +{ + { 10800, 0 }, { 21600, 10800 }, { 10800, 21600 }, { 0, 21600 }, + { 0, 0 } +}; +const sal_uInt16 mso_sptFlowChartDelaySegm[] = +{ + 0x4000, 0xa702, 0x0002, 0x6000, 0x8000 +}; +const SvxMSDffTextRectangles mso_sptFlowChartDelayTextRect[] = +{ + { { 0, 3100 }, { 18500, 18500 } } +}; +const mso_CustomShape msoFlowChartDelay = +{ + const_cast<SvxMSDffVertPair*>(mso_sptFlowChartDelayVert), SAL_N_ELEMENTS( mso_sptFlowChartDelayVert ), + const_cast<sal_uInt16*>(mso_sptFlowChartDelaySegm), sizeof( mso_sptFlowChartDelaySegm ) >> 1, + nullptr, 0, + nullptr, + const_cast<SvxMSDffTextRectangles*>(mso_sptFlowChartDelayTextRect), SAL_N_ELEMENTS( mso_sptFlowChartDelayTextRect ), + 21600, 21600, + MIN_INT32, MIN_INT32, + const_cast<SvxMSDffVertPair*>(mso_sptStandardGluePoints), SAL_N_ELEMENTS( mso_sptStandardGluePoints ), + nullptr, 0 // handles +}; + +const SvxMSDffVertPair mso_sptFlowChartMagneticTapeVert[] = +{ + { 20980, 18150 }, { 20980, 21600 }, { 10670, 21600 }, + { 4770, 21540 }, { 0, 16720 }, { 0, 10800 }, // ccp + { 0, 4840 }, { 4840, 0 }, { 10800, 0 }, // ccp + { 16740, 0 }, { 21600, 4840 }, { 21600, 10800 }, // ccp + { 21600, 13520 }, { 20550, 16160 }, { 18670, 18170 } // ccp +}; +const sal_uInt16 mso_sptFlowChartMagneticTapeSegm[] = +{ + 0x4000, 0x0002, 0x2004, 0x6000, 0x8000 +}; +const SvxMSDffTextRectangles mso_sptFlowChartMagneticTapeTextRect[] = +{ + { { 3100, 3100 }, { 18500, 18500 } } +}; +const mso_CustomShape msoFlowChartMagneticTape = +{ + const_cast<SvxMSDffVertPair*>(mso_sptFlowChartMagneticTapeVert), SAL_N_ELEMENTS( mso_sptFlowChartMagneticTapeVert ), + const_cast<sal_uInt16*>(mso_sptFlowChartMagneticTapeSegm), sizeof( mso_sptFlowChartMagneticTapeSegm ) >> 1, + nullptr, 0, + nullptr, + const_cast<SvxMSDffTextRectangles*>(mso_sptFlowChartMagneticTapeTextRect), SAL_N_ELEMENTS( mso_sptFlowChartMagneticTapeTextRect ), + 21600, 21600, + MIN_INT32, MIN_INT32, + const_cast<SvxMSDffVertPair*>(mso_sptStandardGluePoints), SAL_N_ELEMENTS( mso_sptStandardGluePoints ), + nullptr, 0 // handles +}; + +const SvxMSDffVertPair mso_sptFlowChartMagneticDiskVert[] = +{ + { 0, 3400 }, { 10800, 0 }, { 21600, 3400 }, { 21600, 18200 }, + { 10800, 21600 }, { 0, 18200 }, + + { 0, 3400 }, { 10800, 6800 }, { 21600, 3400 } +}; +const sal_uInt16 mso_sptFlowChartMagneticDiskSegm[] = +{ + 0x4000, 0xa802, 0x0001, 0xa802, 0x6000, 0x8000, + 0x4000, 0xa802, 0x8000 +}; +const SvxMSDffTextRectangles mso_sptFlowChartMagneticDiskTextRect[] = +{ + { { 0, 6800 }, { 21600, 18200 } } +}; +const SvxMSDffVertPair mso_sptFlowChartMagneticDiskGluePoints[] = +{ + { 10800, 6800 }, { 10800, 0 }, { 0, 10800 }, { 10800, 21600 }, { 21600, 10800 } +}; +const mso_CustomShape msoFlowChartMagneticDisk = +{ + const_cast<SvxMSDffVertPair*>(mso_sptFlowChartMagneticDiskVert), SAL_N_ELEMENTS( mso_sptFlowChartMagneticDiskVert ), + const_cast<sal_uInt16*>(mso_sptFlowChartMagneticDiskSegm), sizeof( mso_sptFlowChartMagneticDiskSegm ) >> 1, + nullptr, 0, + nullptr, + const_cast<SvxMSDffTextRectangles*>(mso_sptFlowChartMagneticDiskTextRect), SAL_N_ELEMENTS( mso_sptFlowChartMagneticDiskTextRect ), + 21600, 21600, + MIN_INT32, MIN_INT32, + const_cast<SvxMSDffVertPair*>(mso_sptFlowChartMagneticDiskGluePoints), SAL_N_ELEMENTS( mso_sptFlowChartMagneticDiskGluePoints ), + nullptr, 0 // handles +}; + +const SvxMSDffVertPair mso_sptFlowChartMagneticDrumVert[] = +{ + { 18200, 0 }, { 21600, 10800 }, { 18200, 21600 }, { 3400, 21600 }, + { 0, 10800 }, { 3400, 0 }, + + { 18200, 0 }, { 14800, 10800 }, { 18200, 21600 } +}; +const sal_uInt16 mso_sptFlowChartMagneticDrumSegm[] = +{ + 0x4000, 0xa702, 0x0001, 0xa702, 0x6000, 0x8000, + 0x4000, 0xa702, 0x8000 +}; +const SvxMSDffTextRectangles mso_sptFlowChartMagneticDrumTextRect[] = +{ + { { 3400, 0 }, { 14800, 21600 } } +}; +const SvxMSDffVertPair mso_sptFlowChartMagneticDrumGluePoints[] = +{ + { 10800, 0 }, { 0, 10800 }, { 10800, 21600 }, { 14800, 10800 }, { 21600, 10800 } +}; +const mso_CustomShape msoFlowChartMagneticDrum = +{ + const_cast<SvxMSDffVertPair*>(mso_sptFlowChartMagneticDrumVert), SAL_N_ELEMENTS( mso_sptFlowChartMagneticDrumVert ), + const_cast<sal_uInt16*>(mso_sptFlowChartMagneticDrumSegm), sizeof( mso_sptFlowChartMagneticDrumSegm ) >> 1, + nullptr, 0, + nullptr, + const_cast<SvxMSDffTextRectangles*>(mso_sptFlowChartMagneticDrumTextRect), SAL_N_ELEMENTS( mso_sptFlowChartMagneticDrumTextRect ), + 21600, 21600, + MIN_INT32, MIN_INT32, + const_cast<SvxMSDffVertPair*>(mso_sptFlowChartMagneticDrumGluePoints), SAL_N_ELEMENTS( mso_sptFlowChartMagneticDrumGluePoints ), + nullptr, 0 // handles +}; + +const SvxMSDffVertPair mso_sptFlowChartDisplayVert[] = +{ + { 3600, 0 }, { 17800, 0 }, { 21600, 10800 }, { 17800, 21600 }, + { 3600, 21600 }, { 0, 10800 } +}; +const sal_uInt16 mso_sptFlowChartDisplaySegm[] = +{ + 0x4000, 0x0001, 0xa702, 0x0002, 0x6000, 0x8000 +}; +const SvxMSDffTextRectangles mso_sptFlowChartDisplayTextRect[] = +{ + { { 3600, 0 }, { 17800, 21600 } } +}; +const mso_CustomShape msoFlowChartDisplay = +{ + const_cast<SvxMSDffVertPair*>(mso_sptFlowChartDisplayVert), SAL_N_ELEMENTS( mso_sptFlowChartDisplayVert ), + const_cast<sal_uInt16*>(mso_sptFlowChartDisplaySegm), sizeof( mso_sptFlowChartDisplaySegm ) >> 1, + nullptr, 0, + nullptr, + const_cast<SvxMSDffTextRectangles*>(mso_sptFlowChartDisplayTextRect), SAL_N_ELEMENTS( mso_sptFlowChartDisplayTextRect ), + 21600, 21600, + MIN_INT32, MIN_INT32, + const_cast<SvxMSDffVertPair*>(mso_sptStandardGluePoints), SAL_N_ELEMENTS( mso_sptStandardGluePoints ), + nullptr, 0 // handles +}; + +const SvxMSDffVertPair mso_sptWedgeRectCalloutVert[] = +{ + { 0, 0 }, + { 0, 3590 }, { 2 MSO_I, 3 MSO_I }, { 0, 8970 }, + { 0, 12630 },{ 4 MSO_I, 5 MSO_I }, { 0, 18010 }, + { 0, 21600 }, + { 3590, 21600 }, { 6 MSO_I, 7 MSO_I }, { 8970, 21600 }, + { 12630, 21600 }, { 8 MSO_I, 9 MSO_I }, { 18010, 21600 }, + { 21600, 21600 }, + { 21600, 18010 }, { 10 MSO_I, 11 MSO_I }, { 21600, 12630 }, + { 21600, 8970 }, { 12 MSO_I, 13 MSO_I }, { 21600, 3590 }, + { 21600, 0 }, + { 18010, 0 }, { 14 MSO_I, 15 MSO_I }, { 12630, 0 }, + { 8970, 0 }, { 16 MSO_I, 17 MSO_I }, { 3590, 0 }, + { 0, 0 } +}; +const SvxMSDffCalculationData mso_sptWedgeRectCalloutCalc[] = +{ + { 0x2000, { DFF_Prop_adjustValue, 0, 10800 } }, //0x400 + { 0x2000, { DFF_Prop_adjust2Value, 0,10800 } }, + { 0x6006, { 0x412, DFF_Prop_adjustValue, 0 } }, //0x402 + { 0x6006, { 0x412, DFF_Prop_adjust2Value, 6280 } }, + { 0x6006, { 0x417, DFF_Prop_adjustValue, 0 } }, //0x404 + { 0x6006, { 0x417, DFF_Prop_adjust2Value, 15320 } }, + { 0x6006, { 0x41a, DFF_Prop_adjustValue, 6280 } }, //0x406 + { 0x6006, { 0x41a, DFF_Prop_adjust2Value, 21600 } }, + { 0x6006, { 0x41d, DFF_Prop_adjustValue, 15320 } }, //0x408 + { 0x6006, { 0x41d, DFF_Prop_adjust2Value, 21600 } }, + { 0x6006, { 0x420, DFF_Prop_adjustValue, 21600 } }, //0x40a + { 0x6006, { 0x420, DFF_Prop_adjust2Value, 15320 } }, + { 0x6006, { 0x422, DFF_Prop_adjustValue, 21600 } }, //0x40c + { 0x6006, { 0x422, DFF_Prop_adjust2Value, 6280 } }, + { 0x6006, { 0x424, DFF_Prop_adjustValue, 15320 } }, //0x40e + { 0x6006, { 0x424, DFF_Prop_adjust2Value, 0 } }, + { 0x6006, { 0x426, DFF_Prop_adjustValue, 6280 } }, //0x410 + { 0x6006, { 0x426, DFF_Prop_adjust2Value, 0 } }, + { 0xa006, { DFF_Prop_adjustValue, -1, 0x413 } }, //0x412 + { 0xa006, { 0x401, -1, 0x416 } }, + { 0x2003, { 0x400, 0, 0 } }, //0x414 + { 0x2003, { 0x401, 0, 0 } }, + { 0xa000, { 0x414, 0, 0x415 } }, //0x416 + { 0xa006, { DFF_Prop_adjustValue, -1, 0x418 } }, + { 0x6006, { 0x401, 0x416, -1 } }, //0x418 + { 0x2000, { DFF_Prop_adjust2Value, 0, 21600 } }, + { 0x6006, { 0x419, 0x41b, -1 } }, //0x41a + { 0xa006, { 0x400, -1, 0x41c } }, + { 0xa000, { 0x415, 0, 0x414 } }, //0x41c + { 0x6006, { 0x419, 0x41e, -1 } }, + { 0x6006, { 0x400, 0x41c, -1 } }, //0x41e + { 0x2000, { DFF_Prop_adjustValue, 0, 21600 } }, + { 0x6006, { 0x41f, 0x421, -1 } }, //0x420 + { 0x6006, { 0x401, 0x416, -1 } }, + { 0x6006, { 0x41f, 0x423, -1 } }, //0x422 + { 0xa006, { 0x401, -1, 0x416 } }, + { 0xa006, { DFF_Prop_adjust2Value, -1, 0x425 } }, //0x424 + { 0x6006, { 0x400, 0x41c, -1 } }, + { 0xa006, { DFF_Prop_adjust2Value, -1, 0x427 } }, //0x426 + { 0xa006, { 0x400, -1, 0x41c } }, + { 0x2000, { DFF_Prop_adjustValue, 0, 0 } }, //0x428 + { 0x2000, { DFF_Prop_adjust2Value, 0, 0 } } +}; +const sal_Int32 mso_sptWedgeRectCalloutDefault[] = +{ + 2, 1400, 25920 +}; +const SvxMSDffTextRectangles mso_sptWedgeRectCalloutTextRect[] = +{ + { { 0, 0 }, { 21600, 21600 } } +}; +const SvxMSDffVertPair mso_sptWedgeRectCalloutGluePoints[] = +{ + { 10800, 0 }, { 0, 10800 }, { 10800, 21600 }, { 21600, 10800 }, { 40 MSO_I, 41 MSO_I } +}; +const SvxMSDffHandle mso_sptCalloutHandle[] = +{ + { + SvxMSDffHandleFlags::NONE, + 0x100, 0x101, 10800, 10800, MIN_INT32, 0x7fffffff, MIN_INT32, 0x7fffffff + } +}; +const mso_CustomShape msoWedgeRectCallout = +{ + const_cast<SvxMSDffVertPair*>(mso_sptWedgeRectCalloutVert), SAL_N_ELEMENTS( mso_sptWedgeRectCalloutVert ), + nullptr, 0, + const_cast<SvxMSDffCalculationData*>(mso_sptWedgeRectCalloutCalc), SAL_N_ELEMENTS( mso_sptWedgeRectCalloutCalc ), + const_cast<sal_Int32*>(mso_sptWedgeRectCalloutDefault), + const_cast<SvxMSDffTextRectangles*>(mso_sptWedgeRectCalloutTextRect), SAL_N_ELEMENTS( mso_sptWedgeRectCalloutTextRect ), + 21600, 21600, + MIN_INT32, MIN_INT32, + const_cast<SvxMSDffVertPair*>(mso_sptWedgeRectCalloutGluePoints), SAL_N_ELEMENTS( mso_sptWedgeRectCalloutGluePoints ), + const_cast<SvxMSDffHandle*>(mso_sptCalloutHandle), SAL_N_ELEMENTS( mso_sptCalloutHandle ) // handles +}; +const SvxMSDffVertPair mso_sptWedgeRRectCalloutVert[] = +{ + { 3590, 0 }, + { 0, 3590 }, + { 2 MSO_I, 3 MSO_I }, { 0, 8970 }, + { 0, 12630 },{ 4 MSO_I, 5 MSO_I }, { 0, 18010 }, + { 3590, 21600 }, + { 6 MSO_I, 7 MSO_I }, { 8970, 21600 }, + { 12630, 21600 }, { 8 MSO_I, 9 MSO_I }, { 18010, 21600 }, + { 21600, 18010 }, + { 10 MSO_I, 11 MSO_I }, { 21600, 12630 }, + { 21600, 8970 }, { 12 MSO_I, 13 MSO_I }, { 21600, 3590 }, + { 18010, 0 }, + { 14 MSO_I, 15 MSO_I }, { 12630, 0 }, + { 8970, 0 }, { 16 MSO_I, 17 MSO_I } +}; +const sal_uInt16 mso_sptWedgeRRectCalloutSegm[] = +{ + 0x4000, 0xa701, 0x0005, 0xa801, 0x0005, 0xa701, 0x0005, 0xa801, 0x0004, 0x6001, 0x8000 +}; +const SvxMSDffTextRectangles mso_sptWedgeRRectCalloutTextRect[] = +{ + { { 800, 800 }, { 20800, 20800 } } +}; +const mso_CustomShape msoWedgeRRectCallout = +{ + const_cast<SvxMSDffVertPair*>(mso_sptWedgeRRectCalloutVert), SAL_N_ELEMENTS( mso_sptWedgeRRectCalloutVert ), + const_cast<sal_uInt16*>(mso_sptWedgeRRectCalloutSegm), sizeof( mso_sptWedgeRRectCalloutSegm ) >> 1, + const_cast<SvxMSDffCalculationData*>(mso_sptWedgeRectCalloutCalc), SAL_N_ELEMENTS( mso_sptWedgeRectCalloutCalc ), + const_cast<sal_Int32*>(mso_sptWedgeRectCalloutDefault), + const_cast<SvxMSDffTextRectangles*>(mso_sptWedgeRRectCalloutTextRect), SAL_N_ELEMENTS( mso_sptWedgeRRectCalloutTextRect ), + 21600, 21600, + MIN_INT32, MIN_INT32, + nullptr, 0, + const_cast<SvxMSDffHandle*>(mso_sptCalloutHandle), SAL_N_ELEMENTS( mso_sptCalloutHandle ) // handles +}; +const SvxMSDffVertPair mso_sptBalloonVert[] = +{ + { 3590, 0 }, + { 0, 3590 }, + { 0, 14460 }, + { 3590, 18050 }, + { 40 MSO_I, 21600 }, { 5420, 18050 }, + { 18010, 18050 }, + { 21600, 14460 }, + { 21600, 3590 }, + { 18010, 0 } +}; +const sal_uInt16 mso_sptBalloonSegm[] = +{ + 0x4000, 0xa701, 0x0001, 0xa801, 0x0003, 0xa701, 0x0001, 0xa801, 0x6001, 0x8000 +}; +const SvxMSDffHandle mso_sptBalloonHandle[] = +{ + { + SvxMSDffHandleFlags::RANGE, + 0x100, 1, 10800, 10800, 0, 8990, MIN_INT32, 0x7fffffff + } +}; +const SvxMSDffTextRectangles mso_sptBalloonTextRect[] = +{ + { { 800, 800 }, { 20800, 17250 } } +}; +const mso_CustomShape msoBalloon = +{ + const_cast<SvxMSDffVertPair*>(mso_sptBalloonVert), SAL_N_ELEMENTS( mso_sptBalloonVert ), + const_cast<sal_uInt16*>(mso_sptBalloonSegm), sizeof( mso_sptBalloonSegm ) >> 1, + const_cast<SvxMSDffCalculationData*>(mso_sptWedgeRectCalloutCalc), SAL_N_ELEMENTS( mso_sptWedgeRectCalloutCalc ), + const_cast<sal_Int32*>(mso_sptWedgeRectCalloutDefault), + const_cast<SvxMSDffTextRectangles*>(mso_sptBalloonTextRect), SAL_N_ELEMENTS( mso_sptBalloonTextRect ), + 21600, 21600, + MIN_INT32, MIN_INT32, + nullptr, 0, + const_cast<SvxMSDffHandle*>(mso_sptBalloonHandle), SAL_N_ELEMENTS( mso_sptBalloonHandle ) // handles +}; +const SvxMSDffVertPair mso_sptWedgeEllipseCalloutVert[] = +{ + { 0, 0 }, { 21600, 21600 }, { 0x16 MSO_I, 0x17 MSO_I }, { 0x12 MSO_I, 0x13 MSO_I }, { 0xe MSO_I, 0xf MSO_I } +}; +const sal_uInt16 mso_sptWedgeEllipseCalloutSegm[] = +{ + 0xa504, 0x0001, 0x6001, 0x8000 +}; +const SvxMSDffCalculationData mso_sptWedgeEllipseCalloutCalc[] = +{ + { 0x2000, { DFF_Prop_adjustValue, 0, 10800 } }, // 00 rad x + { 0x2000, { DFF_Prop_adjust2Value, 0, 10800 } }, // 01 rad y + { 0x6001, { 0x400, 0x400, 1 } }, // 02 rad x^2 + { 0x6001, { 0x401, 0x401, 1 } }, // 03 rad y^2 + { 0x6000, { 0x402, 0x403, 0 } }, // 04 + { 0x200d, { 0x404, 0, 0 } }, // 05 + { 0x2000, { 0x405, 0, 10800 } }, // 06 > 0 ? spur needs to be drawn : 10800 + { 0x6008, { 0x400, 0x401, 0 } }, // 07 atan2 -> angle + { 0x2000, { 0x407, 0, 10 } }, // 08 + { 0x2000, { 0x407, 10, 0 } }, // 09 + { 0x400a, { 10800, 0x407, 0 } }, // 0a + { 0x4009, { 10800, 0x407, 0 } }, // 0b + { 0x2000, { 0x40a, 10800, 0 } }, // 0c + { 0x2000, { 0x40b, 10800, 0 } }, // 0d + { 0xe006, { 0x406, DFF_Prop_adjustValue, 0x40c } }, // 0e + { 0xe006, { 0x406, DFF_Prop_adjust2Value, 0x40d } },// 0f + { 0x400a, { 10800, 0x408, 0 } }, // 10 + { 0x4009, { 10800, 0x408, 0 } }, // 11 + { 0x2000, { 0x410, 10800, 0 } }, // 12 + { 0x2000, { 0x411, 10800, 0 } }, // 13 + { 0x400a, { 10800, 0x409, 0 } }, // 14 + { 0x4009, { 10800, 0x409, 0 } }, // 15 + { 0x2000, { 0x414, 10800, 0 } }, // 16 + { 0x2000, { 0x415, 10800, 0 } } // 17 +}; +const sal_Int32 mso_sptWedgeEllipseCalloutDefault[] = +{ + 2, 1350, 25920 +}; +const SvxMSDffVertPair mso_sptWedgeEllipseCalloutGluePoints[] = +{ + { 10800, 0 }, { 3160, 3160 }, { 0, 10800 }, { 3160, 18440 }, { 10800, 21600 }, { 18440, 18440 }, { 21600, 10800 }, { 18440, 3160 }, { 0xe MSO_I, 0xf MSO_I } +}; +const SvxMSDffTextRectangles mso_sptWedgeEllipseCalloutTextRect[] = +{ + { { 3200, 3200 }, { 18400, 18400 } } +}; +const mso_CustomShape msoWedgeEllipseCallout = +{ + const_cast<SvxMSDffVertPair*>(mso_sptWedgeEllipseCalloutVert), SAL_N_ELEMENTS( mso_sptWedgeEllipseCalloutVert ), + const_cast<sal_uInt16*>(mso_sptWedgeEllipseCalloutSegm), sizeof( mso_sptWedgeEllipseCalloutSegm ) >> 1, + const_cast<SvxMSDffCalculationData*>(mso_sptWedgeEllipseCalloutCalc), SAL_N_ELEMENTS( mso_sptWedgeEllipseCalloutCalc ), + const_cast<sal_Int32*>(mso_sptWedgeEllipseCalloutDefault), + const_cast<SvxMSDffTextRectangles*>(mso_sptWedgeEllipseCalloutTextRect), SAL_N_ELEMENTS( mso_sptWedgeEllipseCalloutTextRect ), + 21600, 21600, + MIN_INT32, MIN_INT32, + const_cast<SvxMSDffVertPair*>(mso_sptWedgeEllipseCalloutGluePoints), SAL_N_ELEMENTS( mso_sptWedgeEllipseCalloutGluePoints ), + const_cast<SvxMSDffHandle*>(mso_sptCalloutHandle), SAL_N_ELEMENTS( mso_sptCalloutHandle ) // handles +}; + +const SvxMSDffVertPair mso_sptCloudCalloutVert[] = +{ + { 1930,7160 }, // p + { 1530,4490 }, { 3400,1970 }, { 5270,1970 }, // ccp + { 5860,1950 }, { 6470,2210 }, { 6970,2600 }, // ccp + { 7450,1390 }, { 8340,650 }, { 9340,650 }, // ccp + { 10004,690 }, { 10710,1050 }, { 11210,1700 }, // ccp + { 11570,630 }, { 12330,0 }, { 13150,0 }, // ccp + { 13840,0 }, { 14470,460 }, { 14870,1160 }, // ccp + { 15330,440 }, { 16020,0 }, { 16740,0 }, // ccp + { 17910,0 }, { 18900,1130 }, { 19110,2710 }, // ccp + { 20240,3150 }, { 21060,4580 }, { 21060,6220 }, // ccp + { 21060,6720 }, { 21000,7200 }, { 20830,7660 }, // ccp + { 21310,8460 }, { 21600,9450 }, { 21600,10460 }, // ccp + { 21600,12750 }, { 20310,14680 }, { 18650,15010 }, // ccp + { 18650,17200 }, { 17370,18920 }, { 15770,18920 }, // ccp + { 15220,18920 }, { 14700,18710 }, { 14240,18310 }, // ccp + { 13820,20240 }, { 12490,21600 }, { 11000,21600 }, // ccp + { 9890,21600 }, { 8840,20790 }, { 8210,19510 }, // ccp + { 7620,20000 }, { 7930,20290 }, { 6240,20290 }, // ccp + { 4850,20290 }, { 3570,19280 }, { 2900,17640 }, // ccp + { 1300,17600 }, { 480,16300 }, { 480,14660 }, // ccp + { 480,13900 }, { 690,13210 }, { 1070,12640 }, // ccp + { 380,12160 }, { 0,11210 }, { 0,10120 }, // ccp + { 0,8590 }, { 840,7330 }, { 1930,7160 }, // ccp + + { 1930, 7160 }, { 1950, 7410 }, { 2040, 7690 }, { 2090, 7920 }, // pccp + { 6970, 2600 }, { 7200, 2790 }, { 7480, 3050 }, { 7670, 3310 }, // pccp + { 11210, 1700 }, { 11130, 1910 }, { 11080, 2160 }, { 11030, 2400 }, // pccp + { 14870, 1160 }, { 14720, 1400 }, { 14640, 1720 }, { 14540, 2010 }, // pccp + { 19110, 2710 }, { 19130, 2890 }, { 19230, 3290 }, { 19190, 3380 }, // pccp + { 20830, 7660 }, { 20660, 8170 }, { 20430, 8620 }, { 20110, 8990 }, // pccp + { 18660, 15010 }, { 18740, 14200 }, { 18280, 12200 }, { 17000, 11450 }, // pccp + { 14240, 18310 }, { 14320, 17980 }, { 14350, 17680 }, { 14370, 17360 }, // pccp + { 8220, 19510 }, { 8060, 19250 }, { 7960, 18950 }, { 7860, 18640 }, // pccp + { 2900, 17640 }, { 3090, 17600 }, { 3280, 17540 }, { 3460, 17450 }, // pccp + { 1070, 12640 }, { 1400, 12900 }, { 1780, 13130 }, { 2330, 13040 }, // pccp + + { 0x11 MSO_I, 0x12 MSO_I }, { 1800, 1800 }, { 0, 360 }, // circ1 + { 0x13 MSO_I, 0x14 MSO_I }, { 1200, 1200 }, { 0, 360 }, // circ2 + { 0xd MSO_I, 0xe MSO_I }, { 700, 700 }, { 0, 360 } // circ3 +}; +const sal_uInt16 mso_sptCloudCalloutSegm[] = +{ + 0x4000, 0x2016, 0x6001, 0x8000, + 0x4000, 0x2001, 0xaa00, 0x8000, + 0x4000, 0x2001, 0xaa00, 0x8000, + 0x4000, 0x2001, 0xaa00, 0x8000, + 0x4000, 0x2001, 0xaa00, 0x8000, + 0x4000, 0x2001, 0xaa00, 0x8000, + 0x4000, 0x2001, 0xaa00, 0x8000, + 0x4000, 0x2001, 0xaa00, 0x8000, + 0x4000, 0x2001, 0xaa00, 0x8000, + 0x4000, 0x2001, 0xaa00, 0x8000, + 0x4000, 0x2001, 0xaa00, 0x8000, + 0x4000, 0x2001, 0xaa00, 0x8000, + 0xa203, 0x6001, 0x8000, + 0xa203, 0x6001, 0x8000, + 0xa203, 0x6001, 0x8000 +}; +const SvxMSDffCalculationData mso_sptCloudCalloutCalc[] = +{ + { 0x2000, { DFF_Prop_adjustValue, 0, 10800 } }, + { 0x2000, { DFF_Prop_adjust2Value, 0, 10800 } }, + { 0x6008, { 0x400, 0x401, 0 } }, + { 0x400a, { 10800, 0x402, 0 } }, // 3 + { 0x4009, { 10800, 0x402, 0 } }, // 4 + { 0x2000, { 0x403, 10800, 0 } }, // 5 + { 0x2000, { 0x404, 10800, 0 } }, // 6 + { 0xa000, { DFF_Prop_adjustValue, 0, 0x405 } }, // 7 + { 0xa000, { DFF_Prop_adjust2Value,0, 0x406 } }, // 8 + { 0x2001, { 0x407, 1, 3 } }, // 9 + { 0x2001, { 0x408, 1, 3 } }, // 0xa + { 0x2001, { 0x407, 2, 3 } }, // 0xb + { 0x2001, { 0x408, 2, 3 } }, // 0xc + { 0x2000, { DFF_Prop_adjustValue, 0, 0 } }, // 0xd + { 0x2000, { DFF_Prop_adjust2Value, 0, 0 } }, // 0xe + { 0x2001, { 0x403, 1, 10800 / 900 } }, // 0xf taking half x distance of the radius from the first bobble + { 0x2001, { 0x404, 1, 10800 / 900 } }, // 0x10 + { 0xe000, { 0x409, 0x405, 0x40f } }, // 0x11 + { 0xe000, { 0x40a, 0x406, 0x410 } }, // 0x12 + { 0x6000, { 0x40b, 0x405, 0 } }, // 0x13 + { 0x6000, { 0x40c, 0x406, 0 } } // 0x14 +}; +const sal_Int32 mso_sptCloudCalloutDefault[] = +{ + 2, 1350, 25920 +}; +const SvxMSDffTextRectangles mso_sptCloudCalloutTextRect[] = +{ + { { 3000, 3320 }, { 17110, 17330 } } +}; +const mso_CustomShape msoCloudCallout = +{ + const_cast<SvxMSDffVertPair*>(mso_sptCloudCalloutVert), SAL_N_ELEMENTS( mso_sptCloudCalloutVert ), + const_cast<sal_uInt16*>(mso_sptCloudCalloutSegm), sizeof( mso_sptCloudCalloutSegm ) >> 1, + const_cast<SvxMSDffCalculationData*>(mso_sptCloudCalloutCalc), SAL_N_ELEMENTS( mso_sptCloudCalloutCalc ), + const_cast<sal_Int32*>(mso_sptCloudCalloutDefault), + const_cast<SvxMSDffTextRectangles*>(mso_sptCloudCalloutTextRect), SAL_N_ELEMENTS( mso_sptCloudCalloutTextRect ), + 21600, 21600, + MIN_INT32, MIN_INT32, + nullptr, 0, + const_cast<SvxMSDffHandle*>(mso_sptCalloutHandle), SAL_N_ELEMENTS( mso_sptCalloutHandle ) // handles +}; + +const SvxMSDffVertPair mso_sptWaveVert[] = // adjustment1 : 0 - 4460 +{ // adjustment2 : 8640 - 12960 + { 7 MSO_I, 0 MSO_I }, { 15 MSO_I, 9 MSO_I }, { 16 MSO_I, 10 MSO_I }, { 12 MSO_I, 0 MSO_I }, + { 24 MSO_I, 1 MSO_I }, { 25 MSO_I, 26 MSO_I }, { 27 MSO_I, 28 MSO_I }, { 29 MSO_I, 1 MSO_I } +}; +const SvxMSDffCalculationData mso_sptWaveCalc[] = +{ + { 0x2000, { DFF_Prop_adjustValue, 0, 0 } }, //400 (vert.adj) + { 0x8000, { 21600, 0, 0x400 } }, //401 + { 0x2000, { DFF_Prop_adjust2Value, 0, 0 } },//402 (horz.adj) + { 0x2000, { 0x402, 0, 10800 } }, //403 -2160 -> 2160 (horz.adj) + { 0x2001, { 0x403, 2, 1 } }, //404 -4320 -> 4320 (horz.adj) + { 0x2003, { 0x404, 0, 0 } }, //405 abs( 0x404 ) (horz.adj) + { 0x8000, { 4320, 0, 0x405 } }, //406 + { 0xa006, { 0x403, 0, 0x405 } }, //407 + { 0x4001, { 15800, 0x400, 4460 } }, //408 0 -> 15800 (vert.adj) + { 0xa000, { 0x400, 0, 0x408 } }, //409 + { 0x6000, { 0x400, 0x408, 0 } }, //40a + { 0x8000, { 21600, 0, 0x404 } }, //40b + { 0x6006, { 0x403, 0x40b, 21600 } }, //40c + { 0xa000, { 0x40c, 0, 0x407 } }, //40d width between p0 and p1 + { 0x2001, { 0x405, 1, 2 } }, //40e + { 0xa000, { 0x407, 7200, 0x40e } }, //40f + { 0x6000, { 0x40c, 0x40e, 7200 } }, //410 + { 0x2001, { 0x40d, 1, 2 } }, //411 1/2 width + { 0x6000, { 0x407, 0x411, 0 } }, //412 top center glue xpos + { 0x8000, { 21600, 0, 0x412 } }, //413 bottom center glue xpos + { 0x2001, { 0x405, 1, 2 } }, //414 left glue x pos + { 0x8000, { 21600, 0, 0x414 } }, //415 right glue x pos + { 0x2001, { 0x400, 2, 1 } }, //416 y1 (textbox) + { 0x8000, { 21600, 0, 0x416 } }, //417 y2 (textbox) + + { 0x8000, { 21600, 0, 0x407 } }, //418 p2 + + { 0x8000, { 21600, 0, 0x40f } }, //419 c + { 0x6000, { 0x401, 0x408, 0 } }, //41a + + { 0x8000, { 21600, 0, 0x410 } }, //41b c + { 0xa000, { 0x401, 0, 0x408 } }, //41c + + { 0x8000, { 21600, 0, 0x40c } } //41d p3 +}; +const SvxMSDffVertPair mso_sptWaveGluePoints[] = +{ + { 0x12 MSO_I, 0 MSO_I }, { 0x14 MSO_I, 10800 }, { 0x13 MSO_I, 1 MSO_I }, { 0x15 MSO_I, 10800 } +}; +const sal_uInt16 mso_sptWaveSegm[] = +{ + 0x4000, 0x2001, 0x0001, 0x2001, 0x6000, 0x8000 +}; +const SvxMSDffHandle mso_sptWaveHandle[] = +{ + { SvxMSDffHandleFlags::RANGE, + 0, 0x100, 10800, 10800, MIN_INT32, 0x7fffffff, 0, 4460 }, + { SvxMSDffHandleFlags::RANGE, + 0x101, 21600, 10800, 10800, 8640, 12960, MIN_INT32, 0x7fffffff } +}; +const sal_Int32 mso_sptWaveDefault[] = +{ + 2, 1400, 10800 +}; +const SvxMSDffTextRectangles mso_sptWaveTextRect[] = +{ + { { 5 MSO_I, 22 MSO_I }, { 11 MSO_I, 23 MSO_I } } +}; +const mso_CustomShape msoWave = +{ + const_cast<SvxMSDffVertPair*>(mso_sptWaveVert), SAL_N_ELEMENTS( mso_sptWaveVert ), + const_cast<sal_uInt16*>(mso_sptWaveSegm), sizeof( mso_sptWaveSegm ) >> 1, + const_cast<SvxMSDffCalculationData*>(mso_sptWaveCalc), SAL_N_ELEMENTS( mso_sptWaveCalc ), + const_cast<sal_Int32*>(mso_sptWaveDefault), + const_cast<SvxMSDffTextRectangles*>(mso_sptWaveTextRect), SAL_N_ELEMENTS( mso_sptWaveTextRect ), + 21600, 21600, + MIN_INT32, MIN_INT32, + const_cast<SvxMSDffVertPair*>(mso_sptWaveGluePoints), SAL_N_ELEMENTS( mso_sptWaveGluePoints ), + const_cast<SvxMSDffHandle*>(mso_sptWaveHandle), SAL_N_ELEMENTS( mso_sptWaveHandle ) +}; + +const SvxMSDffVertPair mso_sptDoubleWaveVert[] = // adjustment1 : 0 - 2230 +{ // adjustment2 : 8640 - 12960 + { 7 MSO_I, 0 MSO_I }, { 15 MSO_I, 9 MSO_I }, { 0x1f MSO_I, 10 MSO_I }, { 0x12 MSO_I, 0 MSO_I }, { 0x1e MSO_I, 9 MSO_I }, { 16 MSO_I, 10 MSO_I }, { 12 MSO_I, 0 MSO_I }, + { 24 MSO_I, 1 MSO_I }, { 25 MSO_I, 26 MSO_I }, { 0x20 MSO_I, 28 MSO_I }, { 0x13 MSO_I, 1 MSO_I }, { 0x21 MSO_I, 26 MSO_I }, { 27 MSO_I, 28 MSO_I }, { 29 MSO_I, 1 MSO_I } +}; +const SvxMSDffCalculationData mso_sptDoubleWaveCalc[] = +{ + { 0x2000, { DFF_Prop_adjustValue, 0, 0 } }, //400 (vert.adj) + { 0x8000, { 21600, 0, 0x400 } }, //401 + { 0x2000, { DFF_Prop_adjust2Value, 0, 0 } },//402 (horz.adj) + { 0x2000, { 0x402, 0, 10800 } }, //403 -2160 -> 2160 (horz.adj) + { 0x2001, { 0x403, 2, 1 } }, //404 -4320 -> 4320 (horz.adj) + { 0x2003, { 0x404, 0, 0 } }, //405 abs( 0x404 ) (horz.adj) + { 0x8000, { 4320, 0, 0x405 } }, //406 -> not used + { 0xa006, { 0x403, 0, 0x405 } }, //407 + { 0x4001, { 7900, 0x400, 2230 } }, //408 0 -> 7900 (vert.adj) + { 0xa000, { 0x400, 0, 0x408 } }, //409 + { 0x6000, { 0x400, 0x408, 0 } }, //40a + { 0x8000, { 21600, 0, 0x404 } }, //40b + { 0x6006, { 0x403, 0x40b, 21600 } }, //40c + { 0xa000, { 0x40c, 0, 0x407 } }, //40d width between p0 and p1 + { 0x2001, { 0x405, 1, 2 } }, //40e + { 0xa000, { 0x407, 3600, 0x40e } }, //40f + { 0x6000, { 0x40c, 0x40e, 3600 } }, //410 + { 0x2001, { 0x40d, 1, 2 } }, //411 1/2 width + { 0x6000, { 0x407, 0x411, 0 } }, //412 top center glue xpos + { 0x8000, { 21600, 0, 0x412 } }, //413 bottom center glue xpos + { 0x2001, { 0x405, 1, 2 } }, //414 left glue x pos + { 0x8000, { 21600, 0, 0x414 } }, //415 right glue x pos + { 0x2001, { 0x400, 2, 1 } }, //416 y1 (textbox) + { 0x8000, { 21600, 0, 0x416 } }, //417 y2 (textbox) + + { 0x8000, { 21600, 0, 0x407 } }, //418 p2 + + { 0x8000, { 21600, 0, 0x40f } }, //419 c + { 0x6000, { 0x401, 0x408, 0 } }, //41a + + { 0x8000, { 21600, 0, 0x410 } }, //41b c + { 0xa000, { 0x401, 0, 0x408 } }, //41c + + { 0x8000, { 21600, 0, 0x40c } }, //41d p3 + { 0xa000, { 0x412, 3600, 0x40e } }, //41e + { 0x6000, { 0x412, 0x40e, 3600 } }, //41f + { 0xa000, { 0x413, 3600, 0x40e } }, //420 + { 0x6000, { 0x413, 0x40e, 3600 } } //421 +}; +const SvxMSDffVertPair mso_sptDoubleWaveGluePoints[] = +{ + { 0x12 MSO_I, 0 MSO_I }, { 0x14 MSO_I, 10800 }, { 0x13 MSO_I, 1 MSO_I }, { 0x15 MSO_I, 10800 } +}; +const sal_uInt16 mso_sptDoubleWaveSegm[] = +{ + 0x4000, 0x2002, 0x0001, 0x2002, 0x6000, 0x8000 +}; +const SvxMSDffHandle mso_sptDoubleWaveHandle[] = +{ + { SvxMSDffHandleFlags::RANGE, + 0, 0x100, 10800, 10800, MIN_INT32, 0x7fffffff, 0, 2230 }, + { SvxMSDffHandleFlags::RANGE, + 0x101, 21600, 10800, 10800, 8640, 12960, MIN_INT32, 0x7fffffff } +}; +const sal_Int32 mso_sptDoubleWaveDefault[] = +{ + 2, 1400, 10800 +}; +const SvxMSDffTextRectangles mso_sptDoubleWaveTextRect[] = +{ + { { 5 MSO_I, 22 MSO_I }, { 11 MSO_I, 23 MSO_I } } +}; +const mso_CustomShape msoDoubleWave = +{ + const_cast<SvxMSDffVertPair*>(mso_sptDoubleWaveVert), SAL_N_ELEMENTS( mso_sptDoubleWaveVert ), + const_cast<sal_uInt16*>(mso_sptDoubleWaveSegm), sizeof( mso_sptDoubleWaveSegm ) >> 1, + const_cast<SvxMSDffCalculationData*>(mso_sptDoubleWaveCalc), SAL_N_ELEMENTS( mso_sptDoubleWaveCalc ), + const_cast<sal_Int32*>(mso_sptDoubleWaveDefault), + const_cast<SvxMSDffTextRectangles*>(mso_sptDoubleWaveTextRect), SAL_N_ELEMENTS( mso_sptDoubleWaveTextRect ), + 21600, 21600, + MIN_INT32, MIN_INT32, + const_cast<SvxMSDffVertPair*>(mso_sptDoubleWaveGluePoints), SAL_N_ELEMENTS( mso_sptDoubleWaveGluePoints ), + const_cast<SvxMSDffHandle*>(mso_sptDoubleWaveHandle), SAL_N_ELEMENTS( mso_sptDoubleWaveHandle ) +}; + +// for each shapetype a bit of 1 is indicating that the shape is NOT filled by default +const sal_uInt16 mso_DefaultFillingTable[] = +{ + 0x0000, 0x0018, 0x01ff, 0x0000, 0x0c00, 0x01e0, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0600, 0x0000, 0x0000, 0x0000, 0x0000 +}; +bool IsCustomShapeFilledByDefault( MSO_SPT eSpType ) +{ + bool bIsFilledByDefault = true; + sal_uInt32 i = static_cast<sal_uInt32>(eSpType); + if ( i < 0x100 ) + bIsFilledByDefault = ( mso_DefaultFillingTable[ i >> 4 ] & ( 1 << ( i & 0xf ) ) ) == 0; + return bIsFilledByDefault; +} +sal_Int16 GetCustomShapeConnectionTypeDefault( MSO_SPT eSpType ) +{ + sal_Int16 nGluePointType = css::drawing::EnhancedCustomShapeGluePointType::SEGMENTS; + const mso_CustomShape* pDefCustomShape = GetCustomShapeContent( eSpType ); + if ( pDefCustomShape && pDefCustomShape->nGluePoints ) + nGluePointType = css::drawing::EnhancedCustomShapeGluePointType::CUSTOM; + else + { + switch( eSpType ) + { + case mso_sptRectangle : + case mso_sptRoundRectangle : + case mso_sptPictureFrame : + case mso_sptFlowChartProcess : + case mso_sptFlowChartPredefinedProcess : + case mso_sptFlowChartInternalStorage : + case mso_sptTextPlainText : + case mso_sptTextBox : + case mso_sptVerticalScroll : + case mso_sptHorizontalScroll : + nGluePointType = css::drawing::EnhancedCustomShapeGluePointType::RECT; + break; + default: break; + } + } + return nGluePointType; +} + +// for each shapetype a bit of 1 is indicating that the shape is NOT stroked by default +// #i28269# +const sal_uInt16 mso_DefaultStrokingTable[] = +{ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0800, 0x0000, 0x0000, 0x0000, // #i28269# Added shape 75 (mso_sptPictureFrame) + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000 +}; +// #i28269# +bool IsCustomShapeStrokedByDefault( MSO_SPT eSpType ) +{ + bool bIsStrokedByDefault = true; + sal_uInt32 i = static_cast<sal_uInt32>(eSpType); + if ( i < 0x100 ) + bIsStrokedByDefault = ( mso_DefaultStrokingTable[ i >> 4 ] & ( 1 << ( i & 0xf ) ) ) == 0; + return bIsStrokedByDefault; +} + +const sal_uInt16 msoSortFilledObjectsToBackTable[] = +{ + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0010, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000 +}; +bool SortFilledObjectsToBackByDefault( MSO_SPT eSpType ) +{ + bool bSortFilledObjectsToBackByDefault = true; + sal_uInt32 i = static_cast<sal_uInt32>(eSpType); + if ( i < 0x100 ) + bSortFilledObjectsToBackByDefault = ( msoSortFilledObjectsToBackTable[ i >> 4 ] & ( 1 << ( i & 0xf ) ) ) != 0; + return bSortFilledObjectsToBackByDefault; +} + +const SvxMSDffTextRectangles mso_sptFontWorkTextRect[] = +{ + { { 0, 0 }, { 21600, 21600 } } +}; + +const SvxMSDffVertPair mso_sptTextPlainTextVert[] = +{ + { 3 MSO_I, 0 }, { 5 MSO_I, 0 }, { 6 MSO_I, 21600 }, { 7 MSO_I, 21600 } +}; +const SvxMSDffCalculationData mso_sptTextPlainTextCalc[] = // adjustment1 : 6629 - 14971 +{ + { 0x2000, { DFF_Prop_adjustValue, 0, 10800 } }, + { 0x2001, { 0x400, 2, 1 } }, + { 0x2003, { 0x401, 0, 0 } }, + { 0xa006, { 0x401, 0, 0x402 } }, // x1(3) + { 0x8000, { 21600, 0, 0x402 } }, + { 0x6006, { 0x401, 0x404, 21600 } }, // x2(5) + { 0x6006, { 0x401, 0x402, 0 } }, // x2 + { 0xa006, { 0x401, 21600, 0x404 } } // x3(7) +}; +const sal_uInt16 mso_sptTextPlainTextSegm[] = +{ + 0x4000, 0x0001, 0x8000, + 0x4000, 0x0001, 0x8000 +}; +const SvxMSDffHandle mso_sptTextPlainTextHandle[] = +{ + { SvxMSDffHandleFlags::RANGE, + 0x100, 21600, 10800, 10800, 6629, 14971, MIN_INT32, 0x7fffffff } +}; +const mso_CustomShape msoTextPlainText = +{ + const_cast<SvxMSDffVertPair*>(mso_sptTextPlainTextVert), SAL_N_ELEMENTS( mso_sptTextPlainTextVert ), + const_cast<sal_uInt16*>(mso_sptTextPlainTextSegm), sizeof( mso_sptTextPlainTextSegm ) >> 1, + const_cast<SvxMSDffCalculationData*>(mso_sptTextPlainTextCalc), SAL_N_ELEMENTS( mso_sptTextPlainTextCalc ), + const_cast<sal_Int32*>(mso_sptDefault10800), + const_cast<SvxMSDffTextRectangles*>(mso_sptFontWorkTextRect), SAL_N_ELEMENTS( mso_sptFontWorkTextRect ), + 21600, 21600, + MIN_INT32, MIN_INT32, + nullptr, 0, + const_cast<SvxMSDffHandle*>(mso_sptTextPlainTextHandle), SAL_N_ELEMENTS( mso_sptTextPlainTextHandle ) +}; + +const SvxMSDffVertPair mso_sptTextStopVert[] = +{ + { 0, 0 MSO_I }, { 7200, 0 }, { 14400, 0 }, { 21600, 0 MSO_I }, + { 0, 1 MSO_I }, { 7200, 21600 }, { 14400, 21600 }, { 21600, 1 MSO_I } +}; +const SvxMSDffCalculationData mso_sptTextStopCalc[] = // adjustment1 : 3080 - 10800 +{ + { 0x2000, { DFF_Prop_adjustValue, 0, 0 } }, + { 0x8000, { 21600, 0, DFF_Prop_adjustValue } } +}; +const sal_uInt16 mso_sptTextStopSegm[] = +{ + 0x4000, 0x0003, 0x8000, + 0x4000, 0x0003, 0x8000 +}; +const sal_Int32 mso_sptTextStopDefault[] = +{ + 1, 2700 +}; +const SvxMSDffHandle mso_sptTextStopHandle[] = +{ + { SvxMSDffHandleFlags::RANGE, + 0, 0x100, 10800, 10800, MIN_INT32, 0x7fffffff, 3080, 10800 } +}; +const mso_CustomShape msoTextStop = +{ + const_cast<SvxMSDffVertPair*>(mso_sptTextStopVert), SAL_N_ELEMENTS( mso_sptTextStopVert ), + const_cast<sal_uInt16*>(mso_sptTextStopSegm), sizeof( mso_sptTextStopSegm ) >> 1, + const_cast<SvxMSDffCalculationData*>(mso_sptTextStopCalc), SAL_N_ELEMENTS( mso_sptTextStopCalc ), + const_cast<sal_Int32*>(mso_sptTextStopDefault), + const_cast<SvxMSDffTextRectangles*>(mso_sptFontWorkTextRect), SAL_N_ELEMENTS( mso_sptFontWorkTextRect ), + 21600, 21600, + MIN_INT32, MIN_INT32, + nullptr, 0, + const_cast<SvxMSDffHandle*>(mso_sptTextStopHandle), SAL_N_ELEMENTS( mso_sptTextStopHandle ) +}; + +const SvxMSDffVertPair mso_sptTextTriangleVert[] = +{ + { 0, 0 MSO_I }, { 10800, 0 }, { 21600, 0 MSO_I }, { 0, 21600 }, { 21600, 21600 } +}; +const SvxMSDffCalculationData mso_sptTextTriangleCalc[] = // adjustment1 : 6629 - 14971 +{ + { 0x2000, { DFF_Prop_adjustValue, 0, 0 } } +}; +const sal_uInt16 mso_sptTextTriangleSegm[] = +{ + 0x4000, 0x0002, 0x8000, + 0x4000, 0x0001, 0x8000 +}; +const SvxMSDffHandle mso_sptTextTriangleHandle[] = +{ + { SvxMSDffHandleFlags::RANGE, + 0, 0x100, 10800, 10800, MIN_INT32, 0x7fffffff, 0, 21600 } +}; +const mso_CustomShape msoTextTriangle = +{ + const_cast<SvxMSDffVertPair*>(mso_sptTextTriangleVert), SAL_N_ELEMENTS( mso_sptTextTriangleVert ), + const_cast<sal_uInt16*>(mso_sptTextTriangleSegm), sizeof( mso_sptTextTriangleSegm ) >> 1, + const_cast<SvxMSDffCalculationData*>(mso_sptTextTriangleCalc), SAL_N_ELEMENTS( mso_sptTextTriangleCalc ), + const_cast<sal_Int32*>(mso_sptDefault10800), + const_cast<SvxMSDffTextRectangles*>(mso_sptFontWorkTextRect), SAL_N_ELEMENTS( mso_sptFontWorkTextRect ), + 21600, 21600, + MIN_INT32, MIN_INT32, + nullptr, 0, + const_cast<SvxMSDffHandle*>(mso_sptTextTriangleHandle), SAL_N_ELEMENTS( mso_sptTextTriangleHandle ) +}; +const SvxMSDffVertPair mso_sptTextTriangleInvertedVert[] = +{ + { 0, 0 }, { 21600, 0 }, { 0, 0 MSO_I }, { 10800, 21600 }, { 21600, 0 MSO_I } +}; +const sal_uInt16 mso_sptTextTriangleInvertedSegm[] = +{ + 0x4000, 0x0001, 0x8000, + 0x4000, 0x0002, 0x8000 +}; +const mso_CustomShape msoTextTriangleInverted = +{ + const_cast<SvxMSDffVertPair*>(mso_sptTextTriangleInvertedVert), SAL_N_ELEMENTS( mso_sptTextTriangleInvertedVert ), + const_cast<sal_uInt16*>(mso_sptTextTriangleInvertedSegm), sizeof( mso_sptTextTriangleInvertedSegm ) >> 1, + const_cast<SvxMSDffCalculationData*>(mso_sptTextTriangleCalc), SAL_N_ELEMENTS( mso_sptTextTriangleCalc ), + const_cast<sal_Int32*>(mso_sptDefault10800), + const_cast<SvxMSDffTextRectangles*>(mso_sptFontWorkTextRect), SAL_N_ELEMENTS( mso_sptFontWorkTextRect ), + 21600, 21600, + MIN_INT32, MIN_INT32, + nullptr, 0, + const_cast<SvxMSDffHandle*>(mso_sptTextTriangleHandle), SAL_N_ELEMENTS( mso_sptTextTriangleHandle ) +}; + +const SvxMSDffVertPair mso_sptTextChevronVert[] = +{ + { 0, 0 MSO_I }, { 10800, 0 }, { 21600, 0 MSO_I }, { 0, 21600 }, { 10800, 1 MSO_I }, { 21600, 21600 } +}; +const SvxMSDffCalculationData mso_sptTextChevronCalc[] = // adjustment1 : 6629 - 14971 +{ + { 0x2000, { DFF_Prop_adjustValue, 0, 0 } }, + { 0x8000, { 21600, 0, DFF_Prop_adjustValue } } +}; +const sal_uInt16 mso_sptTextChevronSegm[] = +{ + 0x4000, 0x0002, 0x8000, + 0x4000, 0x0002, 0x8000 +}; +const SvxMSDffHandle mso_sptTextChevronHandle[] = +{ + { SvxMSDffHandleFlags::RANGE, + 0, 0x100, 10800, 10800, MIN_INT32, 0x7fffffff, 0, 10800 } +}; +const mso_CustomShape msoTextChevron = +{ + const_cast<SvxMSDffVertPair*>(mso_sptTextChevronVert), SAL_N_ELEMENTS( mso_sptTextChevronVert ), + const_cast<sal_uInt16*>(mso_sptTextChevronSegm), sizeof( mso_sptTextChevronSegm ) >> 1, + const_cast<SvxMSDffCalculationData*>(mso_sptTextChevronCalc), SAL_N_ELEMENTS( mso_sptTextChevronCalc ), + const_cast<sal_Int32*>(mso_sptDefault5400), + const_cast<SvxMSDffTextRectangles*>(mso_sptFontWorkTextRect), SAL_N_ELEMENTS( mso_sptFontWorkTextRect ), + 21600, 21600, + MIN_INT32, MIN_INT32, + nullptr, 0, + const_cast<SvxMSDffHandle*>(mso_sptTextChevronHandle), SAL_N_ELEMENTS( mso_sptTextChevronHandle ) +}; + +const SvxMSDffVertPair mso_sptTextChevronInvertedVert[] = +{ + { 0, 0 }, { 10800, 1 MSO_I }, { 21600, 0 }, { 0, 0 MSO_I }, { 10800, 21600 }, { 21600, 0 MSO_I } +}; +const SvxMSDffCalculationData mso_sptTextChevronInvertedCalc[] = // adjustment1 : 6629 - 14971 +{ + { 0x2000, { DFF_Prop_adjustValue, 0, 0 } }, + { 0x8000, { 21600, 0, DFF_Prop_adjustValue } } +}; +const sal_uInt16 mso_sptTextChevronInvertedSegm[] = +{ + 0x4000, 0x0002, 0x8000, + 0x4000, 0x0002, 0x8000 +}; +const SvxMSDffHandle mso_sptTextChevronInvertedHandle[] = +{ + { SvxMSDffHandleFlags::RANGE, + 0, 0x100, 10800, 10800, MIN_INT32, 0x7fffffff, 10800, 21600 } +}; +const mso_CustomShape msoTextChevronInverted = +{ + const_cast<SvxMSDffVertPair*>(mso_sptTextChevronInvertedVert), SAL_N_ELEMENTS( mso_sptTextChevronInvertedVert ), + const_cast<sal_uInt16*>(mso_sptTextChevronInvertedSegm), sizeof( mso_sptTextChevronInvertedSegm ) >> 1, + const_cast<SvxMSDffCalculationData*>(mso_sptTextChevronInvertedCalc), SAL_N_ELEMENTS( mso_sptTextChevronInvertedCalc ), + const_cast<sal_Int32*>(mso_sptDefault16200), + const_cast<SvxMSDffTextRectangles*>(mso_sptFontWorkTextRect), SAL_N_ELEMENTS( mso_sptFontWorkTextRect ), + 21600, 21600, + MIN_INT32, MIN_INT32, + nullptr, 0, + const_cast<SvxMSDffHandle*>(mso_sptTextChevronInvertedHandle), SAL_N_ELEMENTS( mso_sptTextChevronInvertedHandle ) +}; +//V 0 0 21600 ?f2 0 ?f0 21600 ?f0 +//W 0 0 21600 ?f2 21600 ?f0 0 ?f0 N +//V 0 ?f3 21600 21600 0 ?f1 21600 ?f1 +//W 0 ?f3 21600 21600 21600 ?f1 0 ?f1 N +//mso_sptTextRingInside +const SvxMSDffVertPair mso_sptTextRingInsideVert[] = +{ + { 0, 0 }, { 21600, 2 MSO_I }, { 0, 0 MSO_I },{ 21600, 0 MSO_I },//V + { 0, 0 }, { 21600, 2 MSO_I }, { 21600, 0 MSO_I },{ 0, 0 MSO_I },//W + { 0, 3 MSO_I }, { 21600, 21600 }, { 0, 1 MSO_I },{ 21600, 1 MSO_I },//V + { 0, 3 MSO_I }, { 21600, 21600 }, { 21600, 1 MSO_I },{ 0, 1 MSO_I }//W +}; +const SvxMSDffCalculationData mso_sptTextRingInsideCalc[] = // adjustment1 : 6629 - 14971 +{ + { 0x2001, { DFF_Prop_adjustValue, 1, 2 } }, + { 0x8000, { 21600, 0, 0x400 } }, + { 0x2000, { DFF_Prop_adjustValue, 0, 0 } }, //$0 + { 0x8000, { 21600, 0, DFF_Prop_adjustValue } }//21600-$0 +}; +const sal_uInt16 mso_sptTextRingInsideSegm[] = +{ + 0xa604, 0xa504,0x8000, + 0xa604, 0xa504,0x8000 +}; +const SvxMSDffHandle mso_sptTextRingInsideHandle[] = +{ + { SvxMSDffHandleFlags::RANGE| SvxMSDffHandleFlags::RANGE_Y_MAX_IS_SPECIAL | SvxMSDffHandleFlags::RANGE_Y_MIN_IS_SPECIAL, + 10800, 0x100, 10800, 10800, MIN_INT32, 0x7fffffff, 10800, 21600 } +}; +const mso_CustomShape msoTextRingInside = +{ + const_cast<SvxMSDffVertPair*>(mso_sptTextRingInsideVert), SAL_N_ELEMENTS( mso_sptTextRingInsideVert ), + const_cast<sal_uInt16*>(mso_sptTextRingInsideSegm), sizeof( mso_sptTextRingInsideSegm ) >> 1, + const_cast<SvxMSDffCalculationData*>(mso_sptTextRingInsideCalc), SAL_N_ELEMENTS( mso_sptTextRingInsideCalc ), + const_cast<sal_Int32*>(mso_sptDefault13500), + const_cast<SvxMSDffTextRectangles*>(mso_sptFontWorkTextRect), SAL_N_ELEMENTS( mso_sptFontWorkTextRect ), + 21600, 21600, + MIN_INT32, MIN_INT32, + nullptr, 0, + const_cast<SvxMSDffHandle*>(mso_sptTextRingInsideHandle), SAL_N_ELEMENTS( mso_sptTextRingInsideHandle ) +}; +//mso_sptTextRingOutside +//path = U 10800 ?f0 10800 ?f2 180 539 N U 10800 ?f1 10800 ?f2 180 539 N +// MSO binary format has swing angle, not end angle, therefore 359 instead of 539. +const SvxMSDffVertPair mso_sptTextRingOutsideVert[] = +{ + { 10800, 0 MSO_I }, { 10800, 0 MSO_I }, { 180, 359 }, + { 10800, 1 MSO_I }, { 10800, 0 MSO_I }, { 180, 359 } +}; +const SvxMSDffCalculationData mso_sptTextRingOutsideCalc[] = // adjustment1 : 6629 - 14971 +{ + { 0x2001, { DFF_Prop_adjustValue, 1, 2 } }, + { 0x8000, { 21600, 0, 0x400 } } +}; +const sal_uInt16 mso_sptTextRingOutsideSegm[] = +{ + 0xA203, 0x8000, + 0xA203, 0x8000 +}; +const SvxMSDffHandle mso_sptTextRingOutsideHandle[] = +{ + { SvxMSDffHandleFlags::RANGE, + 10800, 0x100, 10800, 10800, MIN_INT32, 0x7fffffff, 10800, 21600 } +}; +const mso_CustomShape msoTextRingOutside = +{ + const_cast<SvxMSDffVertPair*>(mso_sptTextRingOutsideVert), SAL_N_ELEMENTS( mso_sptTextRingOutsideVert ), + const_cast<sal_uInt16*>(mso_sptTextRingOutsideSegm), sizeof( mso_sptTextRingOutsideSegm ) >> 1, + const_cast<SvxMSDffCalculationData*>(mso_sptTextRingOutsideCalc), SAL_N_ELEMENTS( mso_sptTextRingOutsideCalc ), + const_cast<sal_Int32*>(mso_sptDefault13500), + const_cast<SvxMSDffTextRectangles*>(mso_sptFontWorkTextRect), SAL_N_ELEMENTS( mso_sptFontWorkTextRect ), + 21600, 21600, + MIN_INT32, MIN_INT32, + nullptr, 0, + const_cast<SvxMSDffHandle*>(mso_sptTextRingOutsideHandle), SAL_N_ELEMENTS( mso_sptTextRingOutsideHandle ) +}; + +const SvxMSDffVertPair mso_sptTextFadeRightVert[] = +{ + { 0, 0 }, { 21600, 0 MSO_I }, { 0, 21600 }, { 21600, 1 MSO_I } +}; +const SvxMSDffCalculationData mso_sptTextFadeCalc[] = +{ + { 0x2000, { DFF_Prop_adjustValue, 0, 0 } }, + { 0x8000, { 21600, 0, DFF_Prop_adjustValue } } +}; +const sal_uInt16 mso_sptTextFadeSegm[] = +{ + 0x4000, 0x0001, 0x8000, + 0x4000, 0x0001, 0x8000 +}; +const SvxMSDffHandle mso_sptTextFadeRightHandle[] = +{ + { SvxMSDffHandleFlags::RANGE, + 21600, 0x100, 10800, 10800, MIN_INT32, 0x7fffffff, 0, 10800 } +}; +const mso_CustomShape msoTextFadeRight = +{ + const_cast<SvxMSDffVertPair*>(mso_sptTextFadeRightVert), SAL_N_ELEMENTS( mso_sptTextFadeRightVert ), + const_cast<sal_uInt16*>(mso_sptTextFadeSegm), sizeof( mso_sptTextFadeSegm ) >> 1, + const_cast<SvxMSDffCalculationData*>(mso_sptTextFadeCalc), SAL_N_ELEMENTS( mso_sptTextFadeCalc ), + const_cast<sal_Int32*>(mso_sptDefault7200), + const_cast<SvxMSDffTextRectangles*>(mso_sptFontWorkTextRect), SAL_N_ELEMENTS( mso_sptFontWorkTextRect ), + 21600, 21600, + MIN_INT32, MIN_INT32, + nullptr, 0, + const_cast<SvxMSDffHandle*>(mso_sptTextFadeRightHandle), SAL_N_ELEMENTS( mso_sptTextFadeRightHandle ) +}; + +const SvxMSDffVertPair mso_sptTextFadeLeftVert[] = +{ + { 0, 0 MSO_I }, { 21600, 0 }, { 0, 1 MSO_I }, { 21600, 21600 } +}; +const SvxMSDffHandle mso_sptTextFadeLeftHandle[] = +{ + { SvxMSDffHandleFlags::RANGE, + 0, 0x100, 10800, 10800, MIN_INT32, 0x7fffffff, 0, 10800 } +}; +const mso_CustomShape msoTextFadeLeft = +{ + const_cast<SvxMSDffVertPair*>(mso_sptTextFadeLeftVert), SAL_N_ELEMENTS( mso_sptTextFadeLeftVert ), + const_cast<sal_uInt16*>(mso_sptTextFadeSegm), sizeof( mso_sptTextFadeSegm ) >> 1, + const_cast<SvxMSDffCalculationData*>(mso_sptTextFadeCalc), SAL_N_ELEMENTS( mso_sptTextFadeCalc ), + const_cast<sal_Int32*>(mso_sptDefault7200), + const_cast<SvxMSDffTextRectangles*>(mso_sptFontWorkTextRect), SAL_N_ELEMENTS( mso_sptFontWorkTextRect ), + 21600, 21600, + MIN_INT32, MIN_INT32, + nullptr, 0, + const_cast<SvxMSDffHandle*>(mso_sptTextFadeLeftHandle), SAL_N_ELEMENTS( mso_sptTextFadeLeftHandle ) +}; + +const SvxMSDffVertPair mso_sptTextFadeUpVert[] = +{ + { 0 MSO_I, 0 }, { 1 MSO_I, 0 }, { 0, 21600 }, { 21600, 21600 } +}; +const SvxMSDffHandle mso_sptTextFadeUpHandle[] = +{ + { SvxMSDffHandleFlags::RANGE, + 0x100, 0, 10800, 10800, 0, 10800, MIN_INT32, 0x7fffffff } +}; +const mso_CustomShape msoTextFadeUp = +{ + const_cast<SvxMSDffVertPair*>(mso_sptTextFadeUpVert), SAL_N_ELEMENTS( mso_sptTextFadeUpVert ), + const_cast<sal_uInt16*>(mso_sptTextFadeSegm), sizeof( mso_sptTextFadeSegm ) >> 1, + const_cast<SvxMSDffCalculationData*>(mso_sptTextFadeCalc), SAL_N_ELEMENTS( mso_sptTextFadeCalc ), + const_cast<sal_Int32*>(mso_sptDefault7200), + const_cast<SvxMSDffTextRectangles*>(mso_sptFontWorkTextRect), SAL_N_ELEMENTS( mso_sptFontWorkTextRect ), + 21600, 21600, + MIN_INT32, MIN_INT32, + nullptr, 0, + const_cast<SvxMSDffHandle*>(mso_sptTextFadeUpHandle), SAL_N_ELEMENTS( mso_sptTextFadeUpHandle ) +}; + +const SvxMSDffVertPair mso_sptTextFadeDownVert[] = +{ + { 0, 0 }, { 21600, 0 }, { 0 MSO_I, 21600 }, { 1 MSO_I, 21600 } +}; +const SvxMSDffHandle mso_sptTextFadeDownHandle[] = +{ + { SvxMSDffHandleFlags::RANGE, + 0x100, 21600, 10800, 10800, 0, 10800, MIN_INT32, 0x7fffffff } +}; +const mso_CustomShape msoTextFadeDown = +{ + const_cast<SvxMSDffVertPair*>(mso_sptTextFadeDownVert), SAL_N_ELEMENTS( mso_sptTextFadeDownVert ), + const_cast<sal_uInt16*>(mso_sptTextFadeSegm), sizeof( mso_sptTextFadeSegm ) >> 1, + const_cast<SvxMSDffCalculationData*>(mso_sptTextFadeCalc), SAL_N_ELEMENTS( mso_sptTextFadeCalc ), + const_cast<sal_Int32*>(mso_sptDefault7200), + const_cast<SvxMSDffTextRectangles*>(mso_sptFontWorkTextRect), SAL_N_ELEMENTS( mso_sptFontWorkTextRect ), + 21600, 21600, + MIN_INT32, MIN_INT32, + nullptr, 0, + const_cast<SvxMSDffHandle*>(mso_sptTextFadeDownHandle), SAL_N_ELEMENTS( mso_sptTextFadeDownHandle ) +}; + +const SvxMSDffVertPair mso_sptTextSlantUpVert[] = +{ + { 0, 0 MSO_I }, { 21600, 0 }, { 0, 21600 }, { 21600, 1 MSO_I } +}; +const SvxMSDffHandle mso_sptTextSlantUpHandle[] = +{ + { SvxMSDffHandleFlags::RANGE, + 0, 0x100, 10800, 10800, MIN_INT32, 0x7fffffff, 0, 15400 } +}; +const mso_CustomShape msoTextSlantUp = +{ + const_cast<SvxMSDffVertPair*>(mso_sptTextSlantUpVert), SAL_N_ELEMENTS( mso_sptTextSlantUpVert ), + const_cast<sal_uInt16*>(mso_sptTextFadeSegm), sizeof( mso_sptTextFadeSegm ) >> 1, + const_cast<SvxMSDffCalculationData*>(mso_sptTextFadeCalc), SAL_N_ELEMENTS( mso_sptTextFadeCalc ), + const_cast<sal_Int32*>(mso_sptDefault12000), + const_cast<SvxMSDffTextRectangles*>(mso_sptFontWorkTextRect), SAL_N_ELEMENTS( mso_sptFontWorkTextRect ), + 21600, 21600, + MIN_INT32, MIN_INT32, + nullptr, 0, + const_cast<SvxMSDffHandle*>(mso_sptTextSlantUpHandle), SAL_N_ELEMENTS( mso_sptTextSlantUpHandle ) +}; + +const SvxMSDffVertPair mso_sptTextSlantDownVert[] = +{ + { 0, 0 }, { 21600, 1 MSO_I }, { 0, 0 MSO_I }, { 21600, 21600 } +}; +const SvxMSDffHandle mso_sptTextSlantDownHandle[] = +{ + { SvxMSDffHandleFlags::RANGE, + 0, 0x100, 10800, 10800, MIN_INT32, 0x7fffffff, 6200, 21600 } +}; +const mso_CustomShape msoTextSlantDown = +{ + const_cast<SvxMSDffVertPair*>(mso_sptTextSlantDownVert), SAL_N_ELEMENTS( mso_sptTextSlantDownVert ), + const_cast<sal_uInt16*>(mso_sptTextFadeSegm), sizeof( mso_sptTextFadeSegm ) >> 1, + const_cast<SvxMSDffCalculationData*>(mso_sptTextFadeCalc), SAL_N_ELEMENTS( mso_sptTextFadeCalc ), + const_cast<sal_Int32*>(mso_sptDefault12000), + const_cast<SvxMSDffTextRectangles*>(mso_sptFontWorkTextRect), SAL_N_ELEMENTS( mso_sptFontWorkTextRect ), + 21600, 21600, + MIN_INT32, MIN_INT32, + nullptr, 0, + const_cast<SvxMSDffHandle*>(mso_sptTextSlantDownHandle), SAL_N_ELEMENTS( mso_sptTextSlantDownHandle ) +}; + +const SvxMSDffVertPair mso_sptTextCascadeUpVert[] = +{ + { 0, 2 MSO_I }, { 21600, 0 }, { 0, 21600 }, { 21600, 0 MSO_I } +}; +const SvxMSDffCalculationData mso_sptTextCascadeCalc[] = +{ + { 0x2000, { DFF_Prop_adjustValue, 0, 0 } }, + { 0x8000, { 21600, 0, DFF_Prop_adjustValue } }, + { 0x2001, { 0x401, 1, 4 } } +}; +const SvxMSDffHandle mso_sptTextCascadeUpHandle[] = +{ + { SvxMSDffHandleFlags::RANGE, + 21600, 0x100, 10800, 10800, MIN_INT32, 0x7fffffff, 6200, 21600 } +}; +const mso_CustomShape msoTextCascadeUp = +{ + const_cast<SvxMSDffVertPair*>(mso_sptTextCascadeUpVert), SAL_N_ELEMENTS( mso_sptTextCascadeUpVert ), + const_cast<sal_uInt16*>(mso_sptTextFadeSegm), sizeof( mso_sptTextFadeSegm ) >> 1, + const_cast<SvxMSDffCalculationData*>(mso_sptTextCascadeCalc), SAL_N_ELEMENTS( mso_sptTextCascadeCalc ), + const_cast<sal_Int32*>(mso_sptDefault9600), + const_cast<SvxMSDffTextRectangles*>(mso_sptFontWorkTextRect), SAL_N_ELEMENTS( mso_sptFontWorkTextRect ), + 21600, 21600, + MIN_INT32, MIN_INT32, + nullptr, 0, + const_cast<SvxMSDffHandle*>(mso_sptTextCascadeUpHandle), SAL_N_ELEMENTS( mso_sptTextCascadeUpHandle ) +}; + +const SvxMSDffVertPair mso_sptTextCascadeDownVert[] = +{ + { 0, 0 }, { 21600, 2 MSO_I }, { 0, 0 MSO_I }, { 21600, 21600 } +}; +const SvxMSDffHandle mso_sptTextCascadeDownHandle[] = +{ + { SvxMSDffHandleFlags::RANGE, + 0, 0x100, 10800, 10800, MIN_INT32, 0x7fffffff, 6200, 21600 } +}; +const mso_CustomShape msoTextCascadeDown = +{ + const_cast<SvxMSDffVertPair*>(mso_sptTextCascadeDownVert), SAL_N_ELEMENTS( mso_sptTextCascadeDownVert ), + const_cast<sal_uInt16*>(mso_sptTextFadeSegm), sizeof( mso_sptTextFadeSegm ) >> 1, + const_cast<SvxMSDffCalculationData*>(mso_sptTextCascadeCalc), SAL_N_ELEMENTS( mso_sptTextCascadeCalc ), + const_cast<sal_Int32*>(mso_sptDefault9600), + const_cast<SvxMSDffTextRectangles*>(mso_sptFontWorkTextRect), SAL_N_ELEMENTS( mso_sptFontWorkTextRect ), + 21600, 21600, + MIN_INT32, MIN_INT32, + nullptr, 0, + const_cast<SvxMSDffHandle*>(mso_sptTextCascadeDownHandle), SAL_N_ELEMENTS( mso_sptTextCascadeDownHandle ) +}; + +const SvxMSDffVertPair mso_sptTextArchUpCurveVert[] = +{ + { 0, 0 }, { 21600, 21600 }, { 2 MSO_I, 3 MSO_I }, { 4 MSO_I, 3 MSO_I } +}; +const SvxMSDffCalculationData mso_sptTextArchCurveCalc[] = +{ + { 0x400a, { 10800, DFF_Prop_adjustValue, 0 } }, + { 0x4009, { 10800, DFF_Prop_adjustValue, 0 } }, + { 0x2000, { 0x400, 10800, 0 } }, + { 0x2000, { 0x401, 10800, 0 } }, + { 0x8000, { 21600, 0, 0x402 } } +}; +const sal_uInt16 mso_sptTextArchUpCurveSegm[] = +{ + 0xA504, 0x8000 // clockwise arc +}; +const SvxMSDffHandle mso_sptTextArchUpCurveHandle[] = +{ + { SvxMSDffHandleFlags::POLAR, + 10800, 0x100, 10800, 10800, 0, 10800, MIN_INT32, 0x7fffffff } +}; +const sal_Int32 mso_sptTextArchUpCurveDefault[] = +{ + 1, 180 +}; +const mso_CustomShape msoTextArchUpCurve = +{ + const_cast<SvxMSDffVertPair*>(mso_sptTextArchUpCurveVert), SAL_N_ELEMENTS( mso_sptTextArchUpCurveVert ), + const_cast<sal_uInt16*>(mso_sptTextArchUpCurveSegm), sizeof( mso_sptTextArchUpCurveSegm ) >> 1, + const_cast<SvxMSDffCalculationData*>(mso_sptTextArchCurveCalc), SAL_N_ELEMENTS( mso_sptTextArchCurveCalc ), + const_cast<sal_Int32*>(mso_sptTextArchUpCurveDefault), + const_cast<SvxMSDffTextRectangles*>(mso_sptFontWorkTextRect), SAL_N_ELEMENTS( mso_sptFontWorkTextRect ), + 21600, 21600, + MIN_INT32, MIN_INT32, + nullptr, 0, + const_cast<SvxMSDffHandle*>(mso_sptTextArchUpCurveHandle), SAL_N_ELEMENTS( mso_sptTextArchUpCurveHandle ) +}; + +const SvxMSDffVertPair mso_sptTextArchDownCurveVert[] = +{ + { 0, 0 }, { 21600, 21600 }, { 4 MSO_I, 3 MSO_I }, { 2 MSO_I, 3 MSO_I } +}; +const sal_uInt16 mso_sptTextArchDownCurveSegm[] = +{ + 0xA304, 0x8000 // counter clockwise arc to +}; +const SvxMSDffHandle mso_sptTextArchDownCurveHandle[] = +{ + { SvxMSDffHandleFlags::POLAR, + 10800, 0x100, 10800, 10800, 0, 10800, MIN_INT32, 0x7fffffff } +}; +const sal_Int32 mso_sptTextArchDownCurveDefault[] = +{ + 1, 0 +}; +const mso_CustomShape msoTextArchDownCurve = +{ + const_cast<SvxMSDffVertPair*>(mso_sptTextArchDownCurveVert), SAL_N_ELEMENTS( mso_sptTextArchDownCurveVert ), + const_cast<sal_uInt16*>(mso_sptTextArchDownCurveSegm), sizeof( mso_sptTextArchDownCurveSegm ) >> 1, + const_cast<SvxMSDffCalculationData*>(mso_sptTextArchCurveCalc), SAL_N_ELEMENTS( mso_sptTextArchCurveCalc ), + const_cast<sal_Int32*>(mso_sptTextArchDownCurveDefault), + const_cast<SvxMSDffTextRectangles*>(mso_sptFontWorkTextRect), SAL_N_ELEMENTS( mso_sptFontWorkTextRect ), + 21600, 21600, + MIN_INT32, MIN_INT32, + nullptr, 0, + const_cast<SvxMSDffHandle*>(mso_sptTextArchDownCurveHandle), SAL_N_ELEMENTS( mso_sptTextArchDownCurveHandle ) +}; + +const SvxMSDffVertPair mso_sptTextCircleCurveVert[] = +{ + { 0, 0 }, { 21600, 21600 }, { 2 MSO_I, 3 MSO_I }, { 2 MSO_I, 4 MSO_I } +}; +const SvxMSDffCalculationData mso_sptTextCircleCurveCalc[] = +{ + { 0x400a, { 10800, DFF_Prop_adjustValue, 0 } }, + { 0x4009, { 10800, DFF_Prop_adjustValue, 0 } }, + { 0x2000, { 0x400, 10800, 0 } }, + { 0x2000, { 0x401, 10800, 0 } }, + { 0x8000, { 21600, 0, 0x403 } } +}; +const sal_uInt16 mso_sptTextCircleCurveSegm[] = +{ + 0xA504, 0x8000 // clockwise arc to +}; +const SvxMSDffHandle mso_sptTextCircleCurveHandle[] = +{ + { SvxMSDffHandleFlags::POLAR, + 10800, 0x100, 10800, 10800, 0, 10800, MIN_INT32, 0x7fffffff } +}; +const sal_Int32 mso_sptTextCircleCurveDefault[] = +{ + 1, -179 +}; +const mso_CustomShape msoTextCircleCurve = +{ + const_cast<SvxMSDffVertPair*>(mso_sptTextCircleCurveVert), SAL_N_ELEMENTS( mso_sptTextCircleCurveVert ), + const_cast<sal_uInt16*>(mso_sptTextCircleCurveSegm), sizeof( mso_sptTextCircleCurveSegm ) >> 1, + const_cast<SvxMSDffCalculationData*>(mso_sptTextCircleCurveCalc), SAL_N_ELEMENTS( mso_sptTextCircleCurveCalc ), + const_cast<sal_Int32*>(mso_sptTextCircleCurveDefault), + const_cast<SvxMSDffTextRectangles*>(mso_sptFontWorkTextRect), SAL_N_ELEMENTS( mso_sptFontWorkTextRect ), + 21600, 21600, + MIN_INT32, MIN_INT32, + nullptr, 0, + const_cast<SvxMSDffHandle*>(mso_sptTextCircleCurveHandle), SAL_N_ELEMENTS( mso_sptTextCircleCurveHandle ) +}; + +const SvxMSDffVertPair mso_sptTextButtonCurveVert[] = +{ + { 0, 0 }, { 21600, 21600 }, { 2 MSO_I, 3 MSO_I }, { 4 MSO_I, 3 MSO_I }, + { 0, 10800 }, { 21600, 10800 }, + { 0, 0 }, { 21600, 21600 }, { 2 MSO_I, 5 MSO_I }, { 4 MSO_I, 5 MSO_I } +}; +const SvxMSDffCalculationData mso_sptTextButtonCurveCalc[] = +{ + { 0x400a, { 10800, DFF_Prop_adjustValue, 0 } }, + { 0x4009, { 10800, DFF_Prop_adjustValue, 0 } }, + { 0x2000, { 0x400, 10800, 0 } }, + { 0x2000, { 0x401, 10800, 0 } }, + { 0x8000, { 21600, 0, 0x402 } }, + { 0x8000, { 21600, 0, 0x403 } } +}; +const sal_uInt16 mso_sptTextButtonCurveSegm[] = +{ + 0xA504, 0x8000, // clockwise arc + 0x4000, 0x0001, 0x8000, + 0xA304, 0x8000 // counter clockwise +}; +const SvxMSDffHandle mso_sptTextButtonCurveHandle[] = +{ + { SvxMSDffHandleFlags::POLAR, + 10800, 0x100, 10800, 10800, 0, 10800, MIN_INT32, 0x7fffffff } +}; +const sal_Int32 mso_sptTextButtonCurveDefault[] = +{ + 1, 180 +}; +const mso_CustomShape msoTextButtonCurve = +{ + const_cast<SvxMSDffVertPair*>(mso_sptTextButtonCurveVert), SAL_N_ELEMENTS( mso_sptTextButtonCurveVert ), + const_cast<sal_uInt16*>(mso_sptTextButtonCurveSegm), sizeof( mso_sptTextButtonCurveSegm ) >> 1, + const_cast<SvxMSDffCalculationData*>(mso_sptTextButtonCurveCalc), SAL_N_ELEMENTS( mso_sptTextButtonCurveCalc ), + const_cast<sal_Int32*>(mso_sptTextButtonCurveDefault), + const_cast<SvxMSDffTextRectangles*>(mso_sptFontWorkTextRect), SAL_N_ELEMENTS( mso_sptFontWorkTextRect ), + 21600, 21600, + MIN_INT32, MIN_INT32, + nullptr, 0, + const_cast<SvxMSDffHandle*>(mso_sptTextButtonCurveHandle), SAL_N_ELEMENTS( mso_sptTextButtonCurveHandle ) +}; + +const SvxMSDffVertPair mso_sptTextArchUpPourVert[] = +{ + { 0, 0 }, { 21600, 21600 }, { 2 MSO_I, 3 MSO_I }, { 4 MSO_I, 3 MSO_I }, + { 5 MSO_I, 5 MSO_I }, { 11 MSO_I, 11 MSO_I }, { 8 MSO_I, 9 MSO_I }, { 0xa MSO_I, 9 MSO_I } +}; +const SvxMSDffCalculationData mso_sptTextArchPourCalc[] = +{ + { 0x400a, { 10800, DFF_Prop_adjustValue, 0 } }, + { 0x4009, { 10800, DFF_Prop_adjustValue, 0 } }, + { 0x2000, { 0x400, 10800, 0 } }, + { 0x2000, { 0x401, 10800, 0 } }, + { 0x8000, { 21600, 0, 0x402 } }, + { 0x8000, { 10800, 0, DFF_Prop_adjust2Value } }, + { 0x600a, { 0x405, DFF_Prop_adjustValue, 0 } }, // 6 + { 0x6009, { 0x405, DFF_Prop_adjustValue, 0 } }, + { 0x2000, { 0x406, 10800, 0 } }, // 8 + { 0x2000, { 0x407, 10800, 0 } }, + { 0x8000, { 21600, 0, 0x408 } }, // 10 + { 0x8000, { 21600, 0, 0x405 } } +}; +const sal_uInt16 mso_sptTextArchUpPourSegm[] = +{ + 0xA504, 0x8000, 0xA504, 0x8000 +}; +const SvxMSDffHandle mso_sptTextArchPourHandle[] = +{ + { SvxMSDffHandleFlags::POLAR | SvxMSDffHandleFlags::RADIUS_RANGE, + 0x101, 0x100, 10800, 10800, 0, 10800, MIN_INT32, 0x7fffffff } +}; +const sal_Int32 mso_sptTextArchUpPourDefault[] = +{ + 2, 180, 5400 +}; +const mso_CustomShape msoTextArchUpPour = +{ + const_cast<SvxMSDffVertPair*>(mso_sptTextArchUpPourVert), SAL_N_ELEMENTS( mso_sptTextArchUpPourVert ), + const_cast<sal_uInt16*>(mso_sptTextArchUpPourSegm), sizeof( mso_sptTextArchUpPourSegm ) >> 1, + const_cast<SvxMSDffCalculationData*>(mso_sptTextArchPourCalc), SAL_N_ELEMENTS( mso_sptTextArchPourCalc ), + const_cast<sal_Int32*>(mso_sptTextArchUpPourDefault), + const_cast<SvxMSDffTextRectangles*>(mso_sptFontWorkTextRect), SAL_N_ELEMENTS( mso_sptFontWorkTextRect ), + 21600, 21600, + MIN_INT32, MIN_INT32, + nullptr, 0, + const_cast<SvxMSDffHandle*>(mso_sptTextArchPourHandle), SAL_N_ELEMENTS( mso_sptTextArchPourHandle ) +}; + +const SvxMSDffVertPair mso_sptTextArchDownPourVert[] = +{ + { 5 MSO_I, 5 MSO_I }, { 11 MSO_I, 11 MSO_I }, { 0xa MSO_I, 9 MSO_I }, { 8 MSO_I, 9 MSO_I }, + { 0, 0 }, { 21600, 21600 }, { 4 MSO_I, 3 MSO_I }, { 2 MSO_I, 3 MSO_I } +}; +const sal_uInt16 mso_sptTextArchDownPourSegm[] = +{ + 0xA304, 0x8000, 0xA304, 0x8000 +}; +const sal_Int32 mso_sptTextArchDownPourDefault[] = +{ + 2, 0, 5400 +}; +const mso_CustomShape msoTextArchDownPour = +{ + const_cast<SvxMSDffVertPair*>(mso_sptTextArchDownPourVert), SAL_N_ELEMENTS( mso_sptTextArchDownPourVert ), + const_cast<sal_uInt16*>(mso_sptTextArchDownPourSegm), sizeof( mso_sptTextArchDownPourSegm ) >> 1, + const_cast<SvxMSDffCalculationData*>(mso_sptTextArchPourCalc), SAL_N_ELEMENTS( mso_sptTextArchPourCalc ), + const_cast<sal_Int32*>(mso_sptTextArchDownPourDefault), + const_cast<SvxMSDffTextRectangles*>(mso_sptFontWorkTextRect), SAL_N_ELEMENTS( mso_sptFontWorkTextRect ), + 21600, 21600, + MIN_INT32, MIN_INT32, + nullptr, 0, + const_cast<SvxMSDffHandle*>(mso_sptTextArchPourHandle), SAL_N_ELEMENTS( mso_sptTextArchPourHandle ) +}; + +const SvxMSDffVertPair mso_sptTextCirclePourVert[] = +{ + { 0, 0 }, { 21600, 21600 }, { 2 MSO_I, 3 MSO_I }, { 2 MSO_I, 4 MSO_I }, + { 5 MSO_I, 5 MSO_I }, { 11 MSO_I, 11 MSO_I }, { 8 MSO_I, 9 MSO_I }, { 8 MSO_I, 0xa MSO_I } +}; +const SvxMSDffCalculationData mso_sptTextCirclePourCalc[] = +{ + { 0x400a, { 10800, DFF_Prop_adjustValue, 0 } }, + { 0x4009, { 10800, DFF_Prop_adjustValue, 0 } }, + { 0x2000, { 0x400, 10800, 0 } }, + { 0x2000, { 0x401, 10800, 0 } }, + { 0x8000, { 21600, 0, 0x403 } }, + { 0x8000, { 10800, 0, DFF_Prop_adjust2Value } }, + { 0x600a, { 0x405, DFF_Prop_adjustValue, 0 } }, // 6 + { 0x6009, { 0x405, DFF_Prop_adjustValue, 0 } }, + { 0x2000, { 0x406, 10800, 0 } }, // 8 + { 0x2000, { 0x407, 10800, 0 } }, + { 0x8000, { 21600, 0, 0x409 } }, // 10 + { 0x8000, { 21600, 0, 0x405 } }, + { 0x000, { 21600, 0, 0 } } +}; +const sal_uInt16 mso_sptTextCirclePourSegm[] = +{ + 0xA504, 0x8000, 0xA504, 0x8000 +}; +const SvxMSDffHandle mso_sptTextCirclePourHandle[] = +{ + { SvxMSDffHandleFlags::POLAR | SvxMSDffHandleFlags::RADIUS_RANGE, + 0x101, 0x100, 10800, 10800, 0, 10800, MIN_INT32, 0x7fffffff } +}; +const sal_Int32 mso_sptTextCirclePourDefault[] = +{ + 2, -179, 5400 +}; +const mso_CustomShape msoTextCirclePour = +{ + const_cast<SvxMSDffVertPair*>(mso_sptTextCirclePourVert), SAL_N_ELEMENTS( mso_sptTextCirclePourVert ), + const_cast<sal_uInt16*>(mso_sptTextCirclePourSegm), sizeof( mso_sptTextCirclePourSegm ) >> 1, + const_cast<SvxMSDffCalculationData*>(mso_sptTextCirclePourCalc), SAL_N_ELEMENTS( mso_sptTextCirclePourCalc ), + const_cast<sal_Int32*>(mso_sptTextCirclePourDefault), + const_cast<SvxMSDffTextRectangles*>(mso_sptFontWorkTextRect), SAL_N_ELEMENTS( mso_sptFontWorkTextRect ), + 21600, 21600, + MIN_INT32, MIN_INT32, + nullptr, 0, + const_cast<SvxMSDffHandle*>(mso_sptTextCirclePourHandle), SAL_N_ELEMENTS( mso_sptTextCirclePourHandle ) +}; + +const SvxMSDffVertPair mso_sptTextButtonPourVert[] = +{ + { 0, 0 }, { 21600, 21600 }, { 2 MSO_I, 3 MSO_I }, { 4 MSO_I, 3 MSO_I }, + { 6 MSO_I, 6 MSO_I }, { 7 MSO_I, 7 MSO_I }, { 10 MSO_I, 11 MSO_I }, { 12 MSO_I, 11 MSO_I }, + { 0x16 MSO_I, 16 MSO_I }, { 0x15 MSO_I, 16 MSO_I }, + { 0x16 MSO_I, 15 MSO_I }, { 0x15 MSO_I, 15 MSO_I }, + { 6 MSO_I, 6 MSO_I }, { 7 MSO_I, 7 MSO_I }, { 10 MSO_I, 13 MSO_I }, { 12 MSO_I, 13 MSO_I }, + { 0, 0 }, { 21600, 21600 }, { 2 MSO_I, 5 MSO_I }, { 4 MSO_I, 5 MSO_I } +}; +const SvxMSDffCalculationData mso_sptTextButtonPourCalc[] = +{ + { 0x400a, { 10800, DFF_Prop_adjustValue, 0 } }, // 0x00 + { 0x4009, { 10800, DFF_Prop_adjustValue, 0 } }, // 0x01 + { 0x2000, { 0x400, 10800, 0 } }, // 0x02 + { 0x2000, { 0x401, 10800, 0 } }, // 0x03 + { 0x8000, { 21600, 0, 0x402 } }, // 0x04 + { 0x8000, { 21600, 0, 0x403 } }, // 0x05 + + { 0x8000, { 10800, 0, DFF_Prop_adjust2Value } }, // 0x06 + { 0x8000, { 21600, 0, 0x406 } }, // 0x07 + + { 0x600a, { DFF_Prop_adjust2Value, DFF_Prop_adjustValue, 0 } }, // 0x08 + { 0x6009, { DFF_Prop_adjust2Value, DFF_Prop_adjustValue, 0 } }, // 0x09 + { 0x2000, { 0x408, 10800, 0 } }, // 0x0a + { 0x2000, { 0x409, 10800, 0 } }, // 0x0b + { 0x8000, { 21600, 0, 0x40a } }, // 0x0c + { 0x8000, { 21600, 0, 0x40b } }, // 0x0d + { 0x2001, { 0x406, 1, 2 } }, // 0x0e + { 0x4000, { 10800, 0x40e, 0 } }, // 0x0f + { 0x8000, { 10800, 0, 0x40e } }, // 0x10 + { 0x6001, { 0x40e, 0x40e, 1 } }, // 0x11 + { 0x6001, { DFF_Prop_adjust2Value, DFF_Prop_adjust2Value, 1 } }, // 0x12 + { 0xA000, { 0x412, 0, 0x411 } }, // 0x13 + { 0x200d, { 0x413, 0, 0 } }, // 0x14 + { 0x4000, { 10800, 0x414, 0 } }, // 0x15 + { 0x8000, { 10800, 0, 0x414 } } // 0x16 +}; +const sal_uInt16 mso_sptTextButtonPourSegm[] = +{ + 0xA504, 0x8000, // clockwise arc + 0xA504, 0x8000, // clockwise arc + 0x4000, 0x0001, 0x8000, + 0x4000, 0x0001, 0x8000, + 0xA304, 0x8000, // counter clockwise + 0xA304, 0x8000 // counter clockwise +}; +const SvxMSDffHandle mso_sptTextButtonPourHandle[] = +{ + { SvxMSDffHandleFlags::POLAR | SvxMSDffHandleFlags::RADIUS_RANGE, + 0x101, 0x100, 10800, 10800, 4320, 10800, MIN_INT32, 0x7fffffff } +}; +const sal_Int32 mso_sptTextButtonPourDefault[] = +{ + 2, 180, 5400 +}; +const mso_CustomShape msoTextButtonPour = +{ + const_cast<SvxMSDffVertPair*>(mso_sptTextButtonPourVert), SAL_N_ELEMENTS( mso_sptTextButtonPourVert ), + const_cast<sal_uInt16*>(mso_sptTextButtonPourSegm), sizeof( mso_sptTextButtonPourSegm ) >> 1, + const_cast<SvxMSDffCalculationData*>(mso_sptTextButtonPourCalc), SAL_N_ELEMENTS( mso_sptTextButtonPourCalc ), + const_cast<sal_Int32*>(mso_sptTextButtonPourDefault), + const_cast<SvxMSDffTextRectangles*>(mso_sptFontWorkTextRect), SAL_N_ELEMENTS( mso_sptFontWorkTextRect ), + 21600, 21600, + MIN_INT32, MIN_INT32, + nullptr, 0, + const_cast<SvxMSDffHandle*>(mso_sptTextButtonPourHandle), SAL_N_ELEMENTS( mso_sptTextButtonPourHandle ) +}; + +const SvxMSDffVertPair mso_sptTextCurveUpVert[] = +{ + { 0, 0 MSO_I }, { 4900, 1 MSO_I /*12170->0 14250 ->0*/ }, { 11640, 2 MSO_I /*12170->0 12800 ->0*/ }, { 21600, 0 }, + { 0, 4 MSO_I /*12170->0 17220 ->21600*/ }, { 3700, 21600 }, { 8500, 21600 }, { 10100, 21600 }, { 14110, 21600 }, { 15910, 21600 }, { 21600, 4 MSO_I /*12170->0 17220 ->21600*/ } +}; +const SvxMSDffCalculationData mso_sptTextCurveUpCalc[] = +{ + { 0x2000, { DFF_Prop_adjustValue, 0, 0 } }, // 400 + { 0x4001, { 14250, 0x400, 12170 } }, // 401 + { 0x4001, { 12800, 0x400, 12170 } }, // 402 + { 0x4001, { 6380, 0x400, 12170 } }, // 403 + { 0x8000, { 21600, 0, 0x403 } } // 404 +}; +const sal_uInt16 mso_sptTextCurveUpSegm[] = +{ + 0x4000, 0x2001, 0x8000, + 0x4000, 0x2002, 0x8000 +}; +const SvxMSDffHandle mso_sptTextCurveUpHandle[] = +{ + { SvxMSDffHandleFlags::RANGE, + 0, 0x100, 10800, 10800, MIN_INT32, 0x7fffffff, 0, 12170 } +}; +const sal_Int32 mso_sptTextCurveUpDefault[] = +{ + 1, 9900 +}; +const mso_CustomShape msoTextCurveUp = +{ + const_cast<SvxMSDffVertPair*>(mso_sptTextCurveUpVert), SAL_N_ELEMENTS( mso_sptTextCurveUpVert ), + const_cast<sal_uInt16*>(mso_sptTextCurveUpSegm), sizeof( mso_sptTextCurveUpSegm ) >> 1, + const_cast<SvxMSDffCalculationData*>(mso_sptTextCurveUpCalc), SAL_N_ELEMENTS( mso_sptTextCurveUpCalc ), + const_cast<sal_Int32*>(mso_sptTextCurveUpDefault), + const_cast<SvxMSDffTextRectangles*>(mso_sptFontWorkTextRect), SAL_N_ELEMENTS( mso_sptFontWorkTextRect ), + 21600, 21600, + MIN_INT32, MIN_INT32, + nullptr, 0, + const_cast<SvxMSDffHandle*>(mso_sptTextCurveUpHandle), SAL_N_ELEMENTS( mso_sptTextCurveUpHandle ) +}; + +const SvxMSDffVertPair mso_sptTextCurveDownVert[] = +{ +// { 0, 0 MSO_I }, { 4900, 1 MSO_I /*12170->0 14250 ->0*/ }, { 11640, 2 MSO_I /*12170->0 12800 ->0*/ }, { 21600, 0 }, + { 0, 0 }, { 9960, 2 MSO_I }, { 16700, 1 MSO_I }, { 21600, 0 MSO_I }, + +// { 0, 4 MSO_I /*12170->0 17220 ->21600*/ }, { 3700, 21600 }, { 8500, 21600 }, { 10100, 21600 }, { 14110, 21600 }, { 15910, 21600 }, { 21600, 4 MSO_I /*12170->0 17220 ->21600*/ } + { 0, 4 MSO_I }, { 5690, 21600 }, { 7490, 21600 }, { 11500, 21600 }, { 13100, 21600 }, { 17900, 21600 }, { 21600, 4 MSO_I } +}; +const SvxMSDffHandle mso_sptTextCurveDownHandle[] = +{ + { SvxMSDffHandleFlags::RANGE, + 21600, 0x100, 10800, 10800, MIN_INT32, 0x7fffffff, 0, 12170 } +}; +const mso_CustomShape msoTextCurveDown = +{ + const_cast<SvxMSDffVertPair*>(mso_sptTextCurveDownVert), SAL_N_ELEMENTS( mso_sptTextCurveDownVert ), + const_cast<sal_uInt16*>(mso_sptTextCurveUpSegm), sizeof( mso_sptTextCurveUpSegm ) >> 1, + const_cast<SvxMSDffCalculationData*>(mso_sptTextCurveUpCalc), SAL_N_ELEMENTS( mso_sptTextCurveUpCalc ), + const_cast<sal_Int32*>(mso_sptTextCurveUpDefault), + const_cast<SvxMSDffTextRectangles*>(mso_sptFontWorkTextRect), SAL_N_ELEMENTS( mso_sptFontWorkTextRect ), + 21600, 21600, + MIN_INT32, MIN_INT32, + nullptr, 0, + const_cast<SvxMSDffHandle*>(mso_sptTextCurveDownHandle), SAL_N_ELEMENTS( mso_sptTextCurveDownHandle ) +}; + +const SvxMSDffVertPair mso_sptTextCanUpVert[] = +{ + { 0, 1 MSO_I }, { 900, 0 }, { 7100, 0 }, { 10800, 0 }, { 14500, 0 }, { 20700, 0 }, { 21600, 1 MSO_I }, + { 0, 21600 }, { 900, 4 MSO_I }, { 7100, 0 MSO_I }, { 10800, 0 MSO_I }, { 14500, 0 MSO_I }, { 20700, 4 MSO_I }, { 21600, 21600 } +}; +const SvxMSDffCalculationData mso_sptTextCanUpCalc[] = +{ + { 0x2000, { DFF_Prop_adjustValue, 0, 0 } }, // 400 + { 0x8000, { 21600, 0, DFF_Prop_adjustValue } }, // 401 + { 0x2000, { DFF_Prop_adjustValue, 0, 14400 } }, // 402 + { 0x4001, { 5470, 0x402, 7200 } }, // 403 + { 0x4000, { 16130, 0x403, 0 } } // 404 +}; +const sal_uInt16 mso_sptTextCanUpSegm[] = +{ + 0x4000, 0x2002, 0x8000, + 0x4000, 0x2002, 0x8000 +}; +const SvxMSDffHandle mso_sptTextCanUpHandle[] = +{ + { SvxMSDffHandleFlags::RANGE, + 10800, 0x100, 10800, 10800, MIN_INT32, 0x7fffffff, 14400, 21600 } +}; +const sal_Int32 mso_sptTextCanUpDefault[] = +{ + 1, 18500 +}; +const mso_CustomShape msoTextCanUp = +{ + const_cast<SvxMSDffVertPair*>(mso_sptTextCanUpVert), SAL_N_ELEMENTS( mso_sptTextCanUpVert ), + const_cast<sal_uInt16*>(mso_sptTextCanUpSegm), sizeof( mso_sptTextCanUpSegm ) >> 1, + const_cast<SvxMSDffCalculationData*>(mso_sptTextCanUpCalc), SAL_N_ELEMENTS( mso_sptTextCanUpCalc ), + const_cast<sal_Int32*>(mso_sptTextCanUpDefault), + const_cast<SvxMSDffTextRectangles*>(mso_sptFontWorkTextRect), SAL_N_ELEMENTS( mso_sptFontWorkTextRect ), + 21600, 21600, + MIN_INT32, MIN_INT32, + nullptr, 0, + const_cast<SvxMSDffHandle*>(mso_sptTextCanUpHandle), SAL_N_ELEMENTS( mso_sptTextCanUpHandle ) +}; + +const SvxMSDffVertPair mso_sptTextCanDownVert[] = +{ + { 0, 0 }, { 900, 2 MSO_I }, { 7100, 0 MSO_I }, { 10800, 0 MSO_I }, { 14500, 0 MSO_I }, { 20700, 2 MSO_I }, { 21600, 0 }, + { 0, 1 MSO_I }, { 900, 21600 }, { 7100, 21600 }, { 10800, 21600 }, { 14500, 21600 }, { 20700, 21600 }, { 21600, 1 MSO_I } +}; +const SvxMSDffCalculationData mso_sptTextCanDownCalc[] = +{ + { 0x2000, { DFF_Prop_adjustValue, 0, 0 } }, // 400 + { 0x8000, { 21600, 0, DFF_Prop_adjustValue } }, // 401 + { 0x4001, { 5470, 0x400, 7200 } } // 402 +}; +const SvxMSDffHandle mso_sptTextCanDownHandle[] = +{ + { SvxMSDffHandleFlags::RANGE, + 10800, 0x100, 10800, 10800, MIN_INT32, 0x7fffffff, 0, 7200 } +}; +const sal_Int32 mso_sptTextCanDownDefault[] = +{ + 1, 3100 +}; +const mso_CustomShape msoTextCanDown = +{ + const_cast<SvxMSDffVertPair*>(mso_sptTextCanDownVert), SAL_N_ELEMENTS( mso_sptTextCanDownVert ), + const_cast<sal_uInt16*>(mso_sptTextCanUpSegm), sizeof( mso_sptTextCanUpSegm ) >> 1, + const_cast<SvxMSDffCalculationData*>(mso_sptTextCanDownCalc), SAL_N_ELEMENTS( mso_sptTextCanDownCalc ), + const_cast<sal_Int32*>(mso_sptTextCanDownDefault), + const_cast<SvxMSDffTextRectangles*>(mso_sptFontWorkTextRect), SAL_N_ELEMENTS( mso_sptFontWorkTextRect ), + 21600, 21600, + MIN_INT32, MIN_INT32, + nullptr, 0, + const_cast<SvxMSDffHandle*>(mso_sptTextCanDownHandle), SAL_N_ELEMENTS( mso_sptTextCanDownHandle ) +}; + +const SvxMSDffVertPair mso_sptTextInflateVert[] = +{ + { 0, 0 MSO_I }, { 4100, 1 MSO_I }, { 7300, 0 }, { 10800, 0 }, { 14300, 0 }, { 17500, 1 MSO_I }, { 21600, 0 MSO_I }, + { 0, 2 MSO_I }, { 4100, 3 MSO_I }, { 7300, 21600 }, { 10800, 21600 }, { 14300, 21600 }, { 17500, 3 MSO_I }, { 21600, 2 MSO_I } +}; +const SvxMSDffCalculationData mso_sptTextInflateCalc[] = +{ + { 0x2000, { DFF_Prop_adjustValue, 0, 0 } }, // 400 + { 0x4001, { 1530, 0x400, 4650 } }, // 401 + { 0x8000, { 21600, 0, 0x400 } }, // 402 + { 0x8000, { 21600, 0, 0x401 } } // 403 +}; +const SvxMSDffHandle mso_sptTextInflateHandle[] = +{ + { SvxMSDffHandleFlags::RANGE, + 0, 0x100, 10800, 10800, MIN_INT32, 0x7fffffff, 0, 4650 } +}; +const sal_Int32 mso_sptTextInflateDefault[] = +{ + 1, 2950 +}; +const mso_CustomShape msoTextInflate = +{ + const_cast<SvxMSDffVertPair*>(mso_sptTextInflateVert), SAL_N_ELEMENTS( mso_sptTextInflateVert ), + const_cast<sal_uInt16*>(mso_sptTextCanUpSegm), sizeof( mso_sptTextCanUpSegm ) >> 1, + const_cast<SvxMSDffCalculationData*>(mso_sptTextInflateCalc), SAL_N_ELEMENTS( mso_sptTextInflateCalc ), + const_cast<sal_Int32*>(mso_sptTextInflateDefault), + const_cast<SvxMSDffTextRectangles*>(mso_sptFontWorkTextRect), SAL_N_ELEMENTS( mso_sptFontWorkTextRect ), + 21600, 21600, + MIN_INT32, MIN_INT32, + nullptr, 0, + const_cast<SvxMSDffHandle*>(mso_sptTextInflateHandle), SAL_N_ELEMENTS( mso_sptTextInflateHandle ) +}; + +const SvxMSDffVertPair mso_sptTextDeflateVert[] = +{ + { 0, 0 }, { 3500, 1 MSO_I }, { 7100, 0 MSO_I }, { 10800, 0 MSO_I }, { 14500, 0 MSO_I }, { 18100, 1 MSO_I }, { 21600, 0 }, + { 0, 21600 }, { 3500, 3 MSO_I }, { 7100, 2 MSO_I }, { 10800, 2 MSO_I }, { 14500, 2 MSO_I }, { 18100, 3 MSO_I }, { 21600, 21600 } +}; +const SvxMSDffCalculationData mso_sptTextDeflateCalc[] = +{ + { 0x2000, { DFF_Prop_adjustValue, 0, 0 } }, // 400 + { 0x2001, { 0x400, 5320, 7100 } }, // 401 + { 0x8000, { 21600, 0, 0x400 } }, // 402 + { 0x8000, { 21600, 0, 0x401 } } // 403 +}; +const SvxMSDffHandle mso_sptTextDeflateHandle[] = +{ + { SvxMSDffHandleFlags::RANGE, + 10800, 0x100, 10800, 10800, MIN_INT32, 0x7fffffff, 0, 8100 } +}; +const mso_CustomShape msoTextDeflate = +{ + const_cast<SvxMSDffVertPair*>(mso_sptTextDeflateVert), SAL_N_ELEMENTS( mso_sptTextDeflateVert ), + const_cast<sal_uInt16*>(mso_sptTextCanUpSegm), sizeof( mso_sptTextCanUpSegm ) >> 1, + const_cast<SvxMSDffCalculationData*>(mso_sptTextDeflateCalc), SAL_N_ELEMENTS( mso_sptTextDeflateCalc ), + const_cast<sal_Int32*>(mso_sptDefault8100), + const_cast<SvxMSDffTextRectangles*>(mso_sptFontWorkTextRect), SAL_N_ELEMENTS( mso_sptFontWorkTextRect ), + 21600, 21600, + MIN_INT32, MIN_INT32, + nullptr, 0, + const_cast<SvxMSDffHandle*>(mso_sptTextDeflateHandle), SAL_N_ELEMENTS( mso_sptTextDeflateHandle ) +}; + +const SvxMSDffVertPair mso_sptTextInflateBottomVert[] = +{ + { 0, 0 }, { 21600, 0 }, + { 0, 0 MSO_I }, { 3500, 3 MSO_I }, { 7300, 21600 }, { 10800, 21600 }, { 14300, 21600 }, { 18100, 3 MSO_I }, { 21600, 0 MSO_I } +}; +const SvxMSDffCalculationData mso_sptTextInflateBottomCalc[] = +{ + { 0x2000, { DFF_Prop_adjustValue, 0, 0 } }, // 400 + { 0x2000, { 0x400, 0, 11150 } }, // 401 0->10450 + { 0x2001, { 0x401, 3900, 10450 } }, // 402 + { 0x2000, { 0x402, 17700, 0 } } // 403 +}; +const sal_uInt16 mso_sptTextInflateBottomSegm[] = +{ + 0x4000, 0x0001, 0x8000, + 0x4000, 0x2002, 0x8000 +}; +const SvxMSDffHandle mso_sptTextInflateBottomHandle[] = +{ + { SvxMSDffHandleFlags::RANGE, + 0, 0x100, 10800, 10800, MIN_INT32, 0x7fffffff, 11150, 21600 } +}; +const sal_Int32 mso_sptTextInflateBottomDefault[] = +{ + 1, 14700 +}; +const mso_CustomShape msoTextInflateBottom = +{ + const_cast<SvxMSDffVertPair*>(mso_sptTextInflateBottomVert), SAL_N_ELEMENTS( mso_sptTextInflateBottomVert ), + const_cast<sal_uInt16*>(mso_sptTextInflateBottomSegm), sizeof( mso_sptTextInflateBottomSegm ) >> 1, + const_cast<SvxMSDffCalculationData*>(mso_sptTextInflateBottomCalc), SAL_N_ELEMENTS( mso_sptTextInflateBottomCalc ), + const_cast<sal_Int32*>(mso_sptTextInflateBottomDefault), + const_cast<SvxMSDffTextRectangles*>(mso_sptFontWorkTextRect), SAL_N_ELEMENTS( mso_sptFontWorkTextRect ), + 21600, 21600, + MIN_INT32, MIN_INT32, + nullptr, 0, + const_cast<SvxMSDffHandle*>(mso_sptTextInflateBottomHandle), SAL_N_ELEMENTS( mso_sptTextInflateBottomHandle ) +}; + +const SvxMSDffVertPair mso_sptTextDeflateBottomVert[] = +{ + { 0, 0 }, { 21600, 0 }, + { 0, 21600 }, { 2900, 3 MSO_I }, { 7200, 0 MSO_I }, { 10800, 0 MSO_I }, { 14400, 0 MSO_I }, { 18700, 3 MSO_I }, { 21600, 21600 } +}; +const SvxMSDffCalculationData mso_sptTextDeflateBottomCalc[] = +{ + { 0x2000, { DFF_Prop_adjustValue, 0, 0 } }, // 400 + { 0x2000, { 0x400, 0, 1350 } }, // 401 0->20250 + { 0x2001, { 0x401, 12070, 20250 } }, // 402 + { 0x2000, { 0x402, 9530, 0 } } // 403 +}; +const sal_uInt16 mso_sptTextDeflateBottomSegm[] = +{ + 0x4000, 0x0001, 0x8000, + 0x4000, 0x2002, 0x8000 +}; +const SvxMSDffHandle mso_sptTextDeflateBottomHandle[] = +{ + { SvxMSDffHandleFlags::RANGE, + 10800, 0x100, 10800, 10800, MIN_INT32, 0x7fffffff, 1350, 21600 } +}; +const sal_Int32 mso_sptTextDeflateBottomDefault[] = +{ + 1, 11500 +}; +const mso_CustomShape msoTextDeflateBottom = +{ + const_cast<SvxMSDffVertPair*>(mso_sptTextDeflateBottomVert), SAL_N_ELEMENTS( mso_sptTextDeflateBottomVert ), + const_cast<sal_uInt16*>(mso_sptTextDeflateBottomSegm), sizeof( mso_sptTextDeflateBottomSegm ) >> 1, + const_cast<SvxMSDffCalculationData*>(mso_sptTextDeflateBottomCalc), SAL_N_ELEMENTS( mso_sptTextDeflateBottomCalc ), + const_cast<sal_Int32*>(mso_sptTextDeflateBottomDefault), + const_cast<SvxMSDffTextRectangles*>(mso_sptFontWorkTextRect), SAL_N_ELEMENTS( mso_sptFontWorkTextRect ), + 21600, 21600, + MIN_INT32, MIN_INT32, + nullptr, 0, + const_cast<SvxMSDffHandle*>(mso_sptTextDeflateBottomHandle), SAL_N_ELEMENTS( mso_sptTextDeflateBottomHandle ) +}; + +const SvxMSDffVertPair mso_sptTextInflateTopVert[] = +{ + { 0, 0 MSO_I }, { 3500, 1 MSO_I }, { 7300, 0 }, { 10800, 0 }, { 14300, 0 }, { 18100, 1 MSO_I }, { 21600, 0 MSO_I }, + { 0, 21600 }, { 21600, 21600 } +}; +const SvxMSDffCalculationData mso_sptTextInflateTopCalc[] = +{ + { 0x2000, { DFF_Prop_adjustValue, 0, 0 } }, // 400 + { 0x2001, { 0x400, 3900, 10450 } } // 401 +}; +const sal_uInt16 mso_sptTextInflateTopSegm[] = +{ + 0x4000, 0x2002, 0x8000, + 0x4000, 0x0001, 0x8000 +}; +const SvxMSDffHandle mso_sptTextInflateTopHandle[] = +{ + { SvxMSDffHandleFlags::RANGE, + 0, 0x100, 10800, 10800, MIN_INT32, 0x7fffffff, 0, 10450 } +}; +const sal_Int32 mso_sptTextInflateTopDefault[] = +{ + 1, 6900 +}; +const mso_CustomShape msoTextInflateTop = +{ + const_cast<SvxMSDffVertPair*>(mso_sptTextInflateTopVert), SAL_N_ELEMENTS( mso_sptTextInflateTopVert ), + const_cast<sal_uInt16*>(mso_sptTextInflateTopSegm), sizeof( mso_sptTextInflateTopSegm ) >> 1, + const_cast<SvxMSDffCalculationData*>(mso_sptTextInflateTopCalc), SAL_N_ELEMENTS( mso_sptTextInflateTopCalc ), + const_cast<sal_Int32*>(mso_sptTextInflateTopDefault), + const_cast<SvxMSDffTextRectangles*>(mso_sptFontWorkTextRect), SAL_N_ELEMENTS( mso_sptFontWorkTextRect ), + 21600, 21600, + MIN_INT32, MIN_INT32, + nullptr, 0, + const_cast<SvxMSDffHandle*>(mso_sptTextInflateTopHandle), SAL_N_ELEMENTS( mso_sptTextInflateTopHandle ) +}; + +const SvxMSDffVertPair mso_sptTextDeflateTopVert[] = +{ + { 0, 0 }, { 2900, 1 MSO_I }, { 7200, 0 MSO_I }, { 10800, 0 MSO_I }, { 14400, 0 MSO_I }, { 18700, 1 MSO_I }, { 21600, 0 }, + { 0, 21600 }, { 21600, 21600 } +}; +const SvxMSDffCalculationData mso_sptTextDeflateTopCalc[] = +{ + { 0x2000, { DFF_Prop_adjustValue, 0, 0 } }, // 400 + { 0x2001, { 0x400, 12070, 20250 } } // 402 +}; +const sal_uInt16 mso_sptTextDeflateTopSegm[] = +{ + 0x4000, 0x2002, 0x8000, + 0x4000, 0x0001, 0x8000 +}; +const SvxMSDffHandle mso_sptTextDeflateTopHandle[] = +{ + { SvxMSDffHandleFlags::RANGE, + 10800, 0x100, 10800, 10800, MIN_INT32, 0x7fffffff, 0, 20250 } +}; +const sal_Int32 mso_sptTextDeflateTopDefault[] = +{ + 1, 10100 +}; +const mso_CustomShape msoTextDeflateTop = +{ + const_cast<SvxMSDffVertPair*>(mso_sptTextDeflateTopVert), SAL_N_ELEMENTS( mso_sptTextDeflateTopVert ), + const_cast<sal_uInt16*>(mso_sptTextDeflateTopSegm), sizeof( mso_sptTextDeflateTopSegm ) >> 1, + const_cast<SvxMSDffCalculationData*>(mso_sptTextDeflateTopCalc), SAL_N_ELEMENTS( mso_sptTextDeflateTopCalc ), + const_cast<sal_Int32*>(mso_sptTextDeflateTopDefault), + const_cast<SvxMSDffTextRectangles*>(mso_sptFontWorkTextRect), SAL_N_ELEMENTS( mso_sptFontWorkTextRect ), + 21600, 21600, + MIN_INT32, MIN_INT32, + nullptr, 0, + const_cast<SvxMSDffHandle*>(mso_sptTextDeflateTopHandle), SAL_N_ELEMENTS( mso_sptTextDeflateTopHandle ) +}; + +const SvxMSDffVertPair mso_sptTextDeflateInflateVert[] = +{ + { 0, 0 }, { 21600, 0 }, + { 0, 10100 }, { 3300, 3 MSO_I }, { 7100, 5 MSO_I }, { 10800, 5 MSO_I }, { 14500, 5 MSO_I }, { 18300, 3 MSO_I }, { 21600, 10100 }, + { 0, 11500 }, { 3300, 4 MSO_I }, { 7100, 6 MSO_I }, { 10800, 6 MSO_I }, { 14500, 6 MSO_I }, { 18300, 4 MSO_I }, { 21600, 11500 }, + { 0, 21600 }, { 21600, 21600 } +}; +const SvxMSDffCalculationData mso_sptTextDeflateInflateCalc[] = +{ + { 0x2000, { DFF_Prop_adjustValue, 0, 0 } }, // 400 + { 0x8000, { 10800, 0, 0x400 } }, // 401 + { 0x2001, { 0x401, 5770, 9500 } }, // 402 + { 0x8000, { 10100, 0, 0x402 } }, // 403 + { 0x8000, { 11500, 0, 0x402 } }, // 404 + { 0x2000, { 0x400, 0, 700 } }, // 405 + { 0x2000, { 0x400, 700, 0 } } // 406 +}; +const sal_uInt16 mso_sptTextDeflateInflateSegm[] = +{ + 0x4000, 0x0001, 0x8000, + 0x4000, 0x2002, 0x8000, + 0x4000, 0x2002, 0x8000, + 0x4000, 0x0001, 0x8000 +}; +const SvxMSDffHandle mso_sptTextDeflateInflateHandle[] = +{ + { SvxMSDffHandleFlags::RANGE, + 10800, 0x100, 10800, 10800, MIN_INT32, 0x7fffffff, 1300, 20300 } +}; +const sal_Int32 mso_sptTextDeflateInflateDefault[] = +{ + 1, 6500 +}; +const mso_CustomShape msoTextDeflateInflate = +{ + const_cast<SvxMSDffVertPair*>(mso_sptTextDeflateInflateVert), SAL_N_ELEMENTS( mso_sptTextDeflateInflateVert ), + const_cast<sal_uInt16*>(mso_sptTextDeflateInflateSegm), sizeof( mso_sptTextDeflateInflateSegm ) >> 1, + const_cast<SvxMSDffCalculationData*>(mso_sptTextDeflateInflateCalc), SAL_N_ELEMENTS( mso_sptTextDeflateInflateCalc ), + const_cast<sal_Int32*>(mso_sptTextDeflateInflateDefault), + const_cast<SvxMSDffTextRectangles*>(mso_sptFontWorkTextRect), SAL_N_ELEMENTS( mso_sptFontWorkTextRect ), + 21600, 21600, + MIN_INT32, MIN_INT32, + nullptr, 0, + const_cast<SvxMSDffHandle*>(mso_sptTextDeflateInflateHandle), SAL_N_ELEMENTS( mso_sptTextDeflateInflateHandle ) +}; + +const SvxMSDffVertPair mso_sptTextDeflateInflateDeflateVert[] = +{ + { 0, 0 }, { 21600, 0 }, + { 0, 6600 }, { 3600, 3 MSO_I }, { 7250, 4 MSO_I }, { 10800, 4 MSO_I }, { 14350, 4 MSO_I }, { 18000, 3 MSO_I }, { 21600, 6600 }, + { 0, 7500 }, { 3600, 5 MSO_I }, { 7250, 6 MSO_I }, { 10800, 6 MSO_I }, { 14350, 6 MSO_I }, { 18000, 5 MSO_I }, { 21600, 7500 }, + { 0, 14100 }, { 3600, 9 MSO_I }, { 7250, 10 MSO_I }, { 10800, 10 MSO_I }, { 14350, 10 MSO_I }, { 18000, 9 MSO_I }, { 21600, 14100 }, + { 0, 15000 }, { 3600, 7 MSO_I }, { 7250, 8 MSO_I }, { 10800, 8 MSO_I }, { 14350, 8 MSO_I }, { 18000, 7 MSO_I }, { 21600, 15000 }, + { 0, 21600 }, { 21600, 21600 } +}; +const SvxMSDffCalculationData mso_sptTextDeflateInflateDeflateCalc[] = +{ + { 0x2000, { DFF_Prop_adjustValue, 0, 850 } }, // 400 + { 0x2001, { 0x400, 6120, 8700 } }, + { 0x2000, { 0x401, 0, 4280 } }, + { 0x4000, { 6600, 0x402, 0 } }, + { 0x2000, { DFF_Prop_adjustValue, 0, 450 } }, // 404 + { 0x2000, { 0x403, 900, 0 } }, // 405 + { 0x2000, { 0x404, 900, 0 } }, // 406 + { 0x8000, { 21600, 0, 0x403 } }, // 407 + { 0x8000, { 21600, 0, 0x404 } }, // 408 + { 0x8000, { 21600, 0, 0x405 } }, // 409 + { 0x8000, { 21600, 0, 0x406 } } // 410 +}; +const sal_uInt16 mso_sptTextDeflateInflateDeflateSegm[] = +{ + 0x4000, 0x0001, 0x8000, + 0x4000, 0x2002, 0x8000, + 0x4000, 0x2002, 0x8000, + 0x4000, 0x2002, 0x8000, + 0x4000, 0x2002, 0x8000, + 0x4000, 0x0001, 0x8000 +}; +const SvxMSDffHandle mso_sptTextDeflateInflateDeflateHandle[] = +{ + { SvxMSDffHandleFlags::RANGE, + 10800, 0x100, 10800, 10800, MIN_INT32, 0x7fffffff, 850, 9550 } +}; +const sal_Int32 mso_sptTextDeflateInflateDeflateDefault[] = +{ + 1, 6050 +}; +const mso_CustomShape msoTextDeflateInflateDeflate = +{ + const_cast<SvxMSDffVertPair*>(mso_sptTextDeflateInflateDeflateVert), SAL_N_ELEMENTS( mso_sptTextDeflateInflateDeflateVert ), + const_cast<sal_uInt16*>(mso_sptTextDeflateInflateDeflateSegm), sizeof( mso_sptTextDeflateInflateDeflateSegm ) >> 1, + const_cast<SvxMSDffCalculationData*>(mso_sptTextDeflateInflateDeflateCalc), SAL_N_ELEMENTS( mso_sptTextDeflateInflateDeflateCalc ), + const_cast<sal_Int32*>(mso_sptTextDeflateInflateDeflateDefault), + const_cast<SvxMSDffTextRectangles*>(mso_sptFontWorkTextRect), SAL_N_ELEMENTS( mso_sptFontWorkTextRect ), + 21600, 21600, + MIN_INT32, MIN_INT32, + nullptr, 0, + const_cast<SvxMSDffHandle*>(mso_sptTextDeflateInflateDeflateHandle), SAL_N_ELEMENTS( mso_sptTextDeflateInflateDeflateHandle ) +}; + +const SvxMSDffVertPair mso_sptTextWave1Vert[] = // adjustment1 : 0 - 4459 +{ // adjustment2 : 8640 - 12960 + { 7 MSO_I, 0 MSO_I }, { 15 MSO_I, 9 MSO_I }, { 16 MSO_I, 10 MSO_I }, { 12 MSO_I, 0 MSO_I }, + { 29 MSO_I, 1 MSO_I }, { 27 MSO_I, 28 MSO_I }, { 25 MSO_I, 26 MSO_I }, { 24 MSO_I, 1 MSO_I } +}; +const sal_uInt16 mso_sptTextWave1Segm[] = +{ + 0x4000, 0x2001, 0x8000, + 0x4000, 0x2001, 0x8000 +}; +const mso_CustomShape msoTextWave1 = +{ + const_cast<SvxMSDffVertPair*>(mso_sptTextWave1Vert), SAL_N_ELEMENTS( mso_sptTextWave1Vert ), + const_cast<sal_uInt16*>(mso_sptTextWave1Segm), sizeof( mso_sptTextWave1Segm ) >> 1, + const_cast<SvxMSDffCalculationData*>(mso_sptWaveCalc), SAL_N_ELEMENTS( mso_sptWaveCalc ), + const_cast<sal_Int32*>(mso_sptWaveDefault), + const_cast<SvxMSDffTextRectangles*>(mso_sptFontWorkTextRect), SAL_N_ELEMENTS( mso_sptFontWorkTextRect ), + 21600, 21600, + MIN_INT32, MIN_INT32, + const_cast<SvxMSDffVertPair*>(mso_sptWaveGluePoints), SAL_N_ELEMENTS( mso_sptWaveGluePoints ), + const_cast<SvxMSDffHandle*>(mso_sptWaveHandle), SAL_N_ELEMENTS( mso_sptWaveHandle ) +}; + +const SvxMSDffVertPair mso_sptTextWave2Vert[] = // adjustment1 : 0 - 4459 +{ // adjustment2 : 8640 - 12960 + { 7 MSO_I, 0 MSO_I }, { 15 MSO_I, 10 MSO_I }, { 16 MSO_I, 9 MSO_I }, { 12 MSO_I, 0 MSO_I }, + { 29 MSO_I, 1 MSO_I }, { 27 MSO_I, 26 MSO_I }, { 25 MSO_I, 28 MSO_I }, { 24 MSO_I, 1 MSO_I } +}; +const mso_CustomShape msoTextWave2 = +{ + const_cast<SvxMSDffVertPair*>(mso_sptTextWave2Vert), SAL_N_ELEMENTS( mso_sptTextWave2Vert ), + const_cast<sal_uInt16*>(mso_sptTextWave1Segm), sizeof( mso_sptTextWave1Segm ) >> 1, + const_cast<SvxMSDffCalculationData*>(mso_sptWaveCalc), SAL_N_ELEMENTS( mso_sptWaveCalc ), + const_cast<sal_Int32*>(mso_sptWaveDefault), + const_cast<SvxMSDffTextRectangles*>(mso_sptFontWorkTextRect), SAL_N_ELEMENTS( mso_sptFontWorkTextRect ), + 21600, 21600, + MIN_INT32, MIN_INT32, + const_cast<SvxMSDffVertPair*>(mso_sptWaveGluePoints), SAL_N_ELEMENTS( mso_sptWaveGluePoints ), + const_cast<SvxMSDffHandle*>(mso_sptWaveHandle), SAL_N_ELEMENTS( mso_sptWaveHandle ) +}; + +const SvxMSDffVertPair mso_sptTextWave3Vert[] = // adjustment1 : 0 - 2230 +{ // adjustment2 : 8640 - 12960 + { 7 MSO_I, 0 MSO_I }, { 15 MSO_I, 9 MSO_I }, { 0x1f MSO_I, 10 MSO_I }, { 0x12 MSO_I, 0 MSO_I }, { 0x1e MSO_I, 9 MSO_I }, { 16 MSO_I, 10 MSO_I }, { 12 MSO_I, 0 MSO_I }, + { 29 MSO_I, 1 MSO_I }, { 27 MSO_I, 28 MSO_I }, { 0x21 MSO_I, 26 MSO_I }, { 0x13 MSO_I, 1 MSO_I }, { 0x20 MSO_I, 28 MSO_I }, { 25 MSO_I, 26 MSO_I }, { 24 MSO_I, 1 MSO_I } +}; +const sal_uInt16 mso_sptTextWave3Segm[] = +{ + 0x4000, 0x2002, 0x8000, + 0x4000, 0x2002, 0x8000 +}; +const mso_CustomShape msoTextWave3 = +{ + const_cast<SvxMSDffVertPair*>(mso_sptTextWave3Vert), SAL_N_ELEMENTS( mso_sptTextWave3Vert ), + const_cast<sal_uInt16*>(mso_sptTextWave3Segm), sizeof( mso_sptTextWave3Segm ) >> 1, + const_cast<SvxMSDffCalculationData*>(mso_sptDoubleWaveCalc), SAL_N_ELEMENTS( mso_sptDoubleWaveCalc ), + const_cast<sal_Int32*>(mso_sptDoubleWaveDefault), + const_cast<SvxMSDffTextRectangles*>(mso_sptDoubleWaveTextRect), SAL_N_ELEMENTS( mso_sptDoubleWaveTextRect ), + 21600, 21600, + MIN_INT32, MIN_INT32, + const_cast<SvxMSDffVertPair*>(mso_sptDoubleWaveGluePoints), SAL_N_ELEMENTS( mso_sptDoubleWaveGluePoints ), + const_cast<SvxMSDffHandle*>(mso_sptDoubleWaveHandle), SAL_N_ELEMENTS( mso_sptDoubleWaveHandle ) +}; + +const SvxMSDffVertPair mso_sptTextWave4Vert[] = // adjustment1 : 0 - 2230 +{ // adjustment2 : 8640 - 12960 + { 7 MSO_I, 0 MSO_I }, { 15 MSO_I, 10 MSO_I }, { 0x1f MSO_I, 9 MSO_I }, { 0x12 MSO_I, 0 MSO_I }, { 0x1e MSO_I, 10 MSO_I }, { 16 MSO_I, 9 MSO_I }, { 12 MSO_I, 0 MSO_I }, + { 29 MSO_I, 1 MSO_I }, { 27 MSO_I, 26 MSO_I }, { 0x21 MSO_I, 28 MSO_I }, { 0x13 MSO_I, 1 MSO_I }, { 0x20 MSO_I, 26 MSO_I }, { 25 MSO_I, 28 MSO_I }, { 24 MSO_I, 1 MSO_I } +}; +const mso_CustomShape msoTextWave4 = +{ + const_cast<SvxMSDffVertPair*>(mso_sptTextWave4Vert), SAL_N_ELEMENTS( mso_sptTextWave4Vert ), + const_cast<sal_uInt16*>(mso_sptTextWave3Segm), sizeof( mso_sptTextWave3Segm ) >> 1, + const_cast<SvxMSDffCalculationData*>(mso_sptDoubleWaveCalc), SAL_N_ELEMENTS( mso_sptDoubleWaveCalc ), + const_cast<sal_Int32*>(mso_sptDoubleWaveDefault), + const_cast<SvxMSDffTextRectangles*>(mso_sptDoubleWaveTextRect), SAL_N_ELEMENTS( mso_sptDoubleWaveTextRect ), + 21600, 21600, + MIN_INT32, MIN_INT32, + const_cast<SvxMSDffVertPair*>(mso_sptDoubleWaveGluePoints), SAL_N_ELEMENTS( mso_sptDoubleWaveGluePoints ), + const_cast<SvxMSDffHandle*>(mso_sptDoubleWaveHandle), SAL_N_ELEMENTS( mso_sptDoubleWaveHandle ) +}; + +const sal_Int32 mso_sptCalloutDefault1[] = +{ + 4, -1800, 24500, -1800, 4000 +}; +const sal_Int32 mso_sptCalloutDefault2[] = +{ + 4, -8300, 24500, -1800, 4000 +}; +const sal_Int32 mso_sptCalloutDefault3[] = +{ + 6, -10000, 24500, -3600, 4000, -1800, 4000 +}; +const sal_Int32 mso_sptCalloutDefault4[] = +{ + 8, 23400, 24500, 25200, 21600, 25200, 4000, 23400, 4000 +}; +const SvxMSDffVertPair mso_sptCalloutVert1[] = +{ + { 0, 0 }, { 21600, 0 }, { 21600, 21600 }, { 0, 21600 }, { 0 MSO_I, 1 MSO_I }, { 2 MSO_I, 3 MSO_I } +}; +const SvxMSDffHandle mso_sptCalloutHandle1[] = +{ + { SvxMSDffHandleFlags::NONE, + 0x100, 0x101, 10800, 10800, MIN_INT32, 0x7fffffff, MIN_INT32, 0x7fffffff }, + { SvxMSDffHandleFlags::NONE, + 0x102, 0x103, 10800, 10800, MIN_INT32, 0x7fffffff, MIN_INT32, 0x7fffffff } +}; +const sal_uInt16 mso_sptCalloutSegm1a[] = +{ + 0x4000, 0x0003, 0x6000, 0x8000, + 0x4000, 0x0001, 0x8000 +}; +const sal_uInt16 mso_sptCalloutSegm1b[] = +{ + 0x4000, 0xab00, 0x0003, 0x6000, 0x8000, // NO STROKE + 0x4000, 0x0001, 0x8000 +}; +const SvxMSDffVertPair mso_sptCallout1Vert[] = +{ + { 0, 0 }, { 21600, 0 }, { 21600, 21600 }, { 0, 21600 }, { 0 MSO_I, 1 MSO_I }, { 2 MSO_I, 3 MSO_I }, { 2 MSO_I, 0 }, { 2 MSO_I, 21600 } +}; +const sal_uInt16 mso_sptCallout1Segm1a[] = +{ + 0x4000, 0x0003, 0x6000, 0x8000, + 0x4000, 0x0001, 0x8000, + 0x4000, 0x0001, 0x8000 +}; +const sal_uInt16 mso_sptCallout1Segm1b[] = +{ + 0x4000, 0xab00, 0x0003, 0x6000, 0x8000, // NO STROKE + 0x4000, 0x0001, 0x8000, + 0x4000, 0x0001, 0x8000 +}; +const SvxMSDffVertPair mso_sptCallout2Verta[] = +{ + { 0, 0 }, { 21600, 0 }, { 21600, 21600 }, { 0, 21600 }, { 0 MSO_I, 1 MSO_I }, { 2 MSO_I, 3 MSO_I }, { 2 MSO_I, 3 MSO_I }, { 4 MSO_I, 5 MSO_I } +}; +const SvxMSDffVertPair mso_sptCallout2Vertb[] = +{ + { 0, 0 }, { 21600, 0 }, { 21600, 21600 }, { 0, 21600 }, { 0 MSO_I, 1 MSO_I }, { 2 MSO_I, 3 MSO_I }, { 2 MSO_I, 3 MSO_I }, { 4 MSO_I, 5 MSO_I }, { 4 MSO_I, 0 }, { 4 MSO_I, 21600 } +}; +const SvxMSDffHandle mso_sptCalloutHandle2[] = +{ + { SvxMSDffHandleFlags::NONE, + 0x100, 0x101, 10800, 10800, MIN_INT32, 0x7fffffff, MIN_INT32, 0x7fffffff }, + { SvxMSDffHandleFlags::NONE, + 0x102, 0x103, 10800, 10800, MIN_INT32, 0x7fffffff, MIN_INT32, 0x7fffffff }, + { SvxMSDffHandleFlags::NONE, + 0x104, 0x105, 10800, 10800, MIN_INT32, 0x7fffffff, MIN_INT32, 0x7fffffff } +}; +const sal_uInt16 mso_sptCallout2Segm1a[] = +{ + 0x4000, 0x0003, 0x6000, 0x8000, + 0x4000, 0x0001, 0x8000, + 0x4000, 0x0001, 0x8000, + 0x4000, 0x0001, 0x8000 +}; +const sal_uInt16 mso_sptCallout2Segm1b[] = +{ + 0x4000, 0xab00, 0x0003, 0x6000, 0x8000, // NO STROKE + 0x4000, 0x0001, 0x8000, + 0x4000, 0x0001, 0x8000, + 0x4000, 0x0001, 0x8000 +}; +const sal_uInt16 mso_sptCallout2Segm1c[] = +{ + 0x4000, 0x0003, 0x6000, 0x8000, + 0x4000, 0x0001, 0x8000, + 0x4000, 0x0001, 0x8000, + 0x4000, 0x0001, 0x8000, + 0x4000, 0x0001, 0x8000 +}; +const sal_uInt16 mso_sptCallout2Segm1d[] = +{ + 0x4000, 0xab00, 0x0003, 0x6000, 0x8000, // NO STROKE + 0x4000, 0x0001, 0x8000, + 0x4000, 0x0001, 0x8000, + 0x4000, 0x0001, 0x8000, + 0x4000, 0x0001, 0x8000 +}; +const SvxMSDffVertPair mso_sptCallout3Verta[] = +{ + { 0, 0 }, { 21600, 0 }, { 21600, 21600 }, { 0, 21600 }, { 6 MSO_I, 7 MSO_I }, { 4 MSO_I, 5 MSO_I }, { 2 MSO_I, 3 MSO_I }, { 0 MSO_I, 1 MSO_I } +}; +const SvxMSDffVertPair mso_sptCallout3Vertb[] = +{ + { 0, 0 }, { 21600, 0 }, { 21600, 21600 }, { 0, 21600 }, { 6 MSO_I, 7 MSO_I }, { 4 MSO_I, 5 MSO_I }, { 2 MSO_I, 3 MSO_I }, { 0 MSO_I, 1 MSO_I }, { 6 MSO_I, 0 }, { 6 MSO_I, 21600 } +}; +const SvxMSDffHandle mso_sptCalloutHandle3[] = +{ + { SvxMSDffHandleFlags::NONE, + 0x100, 0x101, 10800, 10800, MIN_INT32, 0x7fffffff, MIN_INT32, 0x7fffffff }, + { SvxMSDffHandleFlags::NONE, + 0x102, 0x103, 10800, 10800, MIN_INT32, 0x7fffffff, MIN_INT32, 0x7fffffff }, + { SvxMSDffHandleFlags::NONE, + 0x104, 0x105, 10800, 10800, MIN_INT32, 0x7fffffff, MIN_INT32, 0x7fffffff }, + { SvxMSDffHandleFlags::NONE, + 0x106, 0x107, 10800, 10800, MIN_INT32, 0x7fffffff, MIN_INT32, 0x7fffffff } +}; +const sal_uInt16 mso_sptCallout3Segm1a[] = +{ + 0x4000, 0x0003, 0x6000, 0x8000, + 0x4000, 0xaa00, 0x0003, 0x8000 // NO_FILL +}; +const sal_uInt16 mso_sptCallout3Segm1b[] = +{ + 0x4000, 0xab00, 0x0003, 0x6000, 0x8000, // NO STROKE + 0x4000, 0xaa00, 0x0003, 0x8000 // NO FILL +}; +const sal_uInt16 mso_sptCallout3Segm1c[] = +{ + 0x4000, 0x0003, 0x6000, 0x8000, + 0x4000, 0xaa00, 0x0003, 0x8000, // NO FILL + 0x4000, 0x0001, 0x8000 +}; +const sal_uInt16 mso_sptCallout3Segm1d[] = +{ + 0x4000, 0xab00, 0x0003, 0x6000, 0x8000, // NO STROKE + 0x4000, 0xaa00, 0x0003, 0x8000, // NO FILL + 0x4000, 0x0001, 0x8000 +}; + +const SvxMSDffCalculationData mso_sptCalloutCalc[] = +{ + { 0x2000, { DFF_Prop_adjustValue, 0, 0 } }, + { 0x2000, { DFF_Prop_adjust2Value, 0, 0 } }, + { 0x2000, { DFF_Prop_adjust3Value, 0, 0 } }, + { 0x2000, { DFF_Prop_adjust4Value, 0, 0 } }, + { 0x2000, { DFF_Prop_adjust5Value, 0, 0 } }, + { 0x2000, { DFF_Prop_adjust6Value, 0, 0 } }, + { 0x2000, { DFF_Prop_adjust7Value, 0, 0 } }, + { 0x2000, { DFF_Prop_adjust8Value, 0, 0 } } +}; + +const mso_CustomShape msoCallout90 = +{ + const_cast<SvxMSDffVertPair*>(mso_sptCalloutVert1), SAL_N_ELEMENTS( mso_sptCalloutVert1 ), + const_cast<sal_uInt16*>(mso_sptCalloutSegm1b), sizeof( mso_sptCalloutSegm1b ) >> 1, + const_cast<SvxMSDffCalculationData*>(mso_sptCalloutCalc), SAL_N_ELEMENTS( mso_sptCalloutCalc ), + const_cast<sal_Int32*>(mso_sptCalloutDefault1), + nullptr, 0, + 21600, 21600, + MIN_INT32, MIN_INT32, + nullptr, 0, + const_cast<SvxMSDffHandle*>(mso_sptCalloutHandle1), SAL_N_ELEMENTS( mso_sptCalloutHandle1 ) +}; +const mso_CustomShape msoCallout1 = +{ + const_cast<SvxMSDffVertPair*>(mso_sptCalloutVert1), SAL_N_ELEMENTS( mso_sptCalloutVert1 ), + const_cast<sal_uInt16*>(mso_sptCalloutSegm1b), sizeof( mso_sptCalloutSegm1b ) >> 1, + const_cast<SvxMSDffCalculationData*>(mso_sptCalloutCalc), SAL_N_ELEMENTS( mso_sptCalloutCalc ), + const_cast<sal_Int32*>(mso_sptCalloutDefault2), + nullptr, 0, + 21600, 21600, + MIN_INT32, MIN_INT32, + nullptr, 0, + const_cast<SvxMSDffHandle*>(mso_sptCalloutHandle1), SAL_N_ELEMENTS( mso_sptCalloutHandle1 ) +}; +const mso_CustomShape msoCallout2 = +{ + const_cast<SvxMSDffVertPair*>(mso_sptCallout2Verta), SAL_N_ELEMENTS( mso_sptCallout2Verta ), + const_cast<sal_uInt16*>(mso_sptCallout2Segm1b), sizeof( mso_sptCallout2Segm1b ) >> 1, + const_cast<SvxMSDffCalculationData*>(mso_sptCalloutCalc), SAL_N_ELEMENTS( mso_sptCalloutCalc ), + const_cast<sal_Int32*>(mso_sptCalloutDefault3), + nullptr, 0, + 21600, 21600, + MIN_INT32, MIN_INT32, + nullptr, 0, + const_cast<SvxMSDffHandle*>(mso_sptCalloutHandle2), SAL_N_ELEMENTS( mso_sptCalloutHandle2 ) +}; +const mso_CustomShape msoCallout3 = +{ + const_cast<SvxMSDffVertPair*>(mso_sptCallout3Verta), SAL_N_ELEMENTS( mso_sptCallout3Verta ), + const_cast<sal_uInt16*>(mso_sptCallout3Segm1b), sizeof( mso_sptCallout3Segm1b ) >> 1, + const_cast<SvxMSDffCalculationData*>(mso_sptCalloutCalc), SAL_N_ELEMENTS( mso_sptCalloutCalc ), + const_cast<sal_Int32*>(mso_sptCalloutDefault4), + nullptr, 0, + 21600, 21600, + MIN_INT32, MIN_INT32, + nullptr, 0, + const_cast<SvxMSDffHandle*>(mso_sptCalloutHandle3), SAL_N_ELEMENTS( mso_sptCalloutHandle3 ) +}; +const mso_CustomShape msoAccentCallout90 = +{ + const_cast<SvxMSDffVertPair*>(mso_sptCalloutVert1), SAL_N_ELEMENTS( mso_sptCalloutVert1 ), + const_cast<sal_uInt16*>(mso_sptCalloutSegm1b), sizeof( mso_sptCalloutSegm1b ) >> 1, + const_cast<SvxMSDffCalculationData*>(mso_sptCalloutCalc), SAL_N_ELEMENTS( mso_sptCalloutCalc ), + const_cast<sal_Int32*>(mso_sptCalloutDefault1), + nullptr, 0, + 21600, 21600, + MIN_INT32, MIN_INT32, + nullptr, 0, + const_cast<SvxMSDffHandle*>(mso_sptCalloutHandle1), SAL_N_ELEMENTS( mso_sptCalloutHandle1 ) +}; +const mso_CustomShape msoAccentCallout1 = +{ + const_cast<SvxMSDffVertPair*>(mso_sptCallout1Vert), SAL_N_ELEMENTS( mso_sptCallout1Vert ), + const_cast<sal_uInt16*>(mso_sptCallout1Segm1b), sizeof( mso_sptCallout1Segm1b ) >> 1, + const_cast<SvxMSDffCalculationData*>(mso_sptCalloutCalc), SAL_N_ELEMENTS( mso_sptCalloutCalc ), + const_cast<sal_Int32*>(mso_sptCalloutDefault2), + nullptr, 0, + 21600, 21600, + MIN_INT32, MIN_INT32, + nullptr, 0, + const_cast<SvxMSDffHandle*>(mso_sptCalloutHandle1), SAL_N_ELEMENTS( mso_sptCalloutHandle1 ) +}; +const mso_CustomShape msoAccentCallout2 = +{ + const_cast<SvxMSDffVertPair*>(mso_sptCallout2Vertb), SAL_N_ELEMENTS( mso_sptCallout2Vertb ), + const_cast<sal_uInt16*>(mso_sptCallout2Segm1d), sizeof( mso_sptCallout2Segm1d ) >> 1, + const_cast<SvxMSDffCalculationData*>(mso_sptCalloutCalc), SAL_N_ELEMENTS( mso_sptCalloutCalc ), + const_cast<sal_Int32*>(mso_sptCalloutDefault3), + nullptr, 0, + 21600, 21600, + MIN_INT32, MIN_INT32, + nullptr, 0, + const_cast<SvxMSDffHandle*>(mso_sptCalloutHandle2), SAL_N_ELEMENTS( mso_sptCalloutHandle2 ) +}; +const mso_CustomShape msoAccentCallout3 = +{ + const_cast<SvxMSDffVertPair*>(mso_sptCallout3Vertb), SAL_N_ELEMENTS( mso_sptCallout3Vertb ), + const_cast<sal_uInt16*>(mso_sptCallout3Segm1d), sizeof( mso_sptCallout3Segm1d ) >> 1, + const_cast<SvxMSDffCalculationData*>(mso_sptCalloutCalc), SAL_N_ELEMENTS( mso_sptCalloutCalc ), + const_cast<sal_Int32*>(mso_sptCalloutDefault4), + nullptr, 0, + 21600, 21600, + MIN_INT32, MIN_INT32, + nullptr, 0, + const_cast<SvxMSDffHandle*>(mso_sptCalloutHandle3), SAL_N_ELEMENTS( mso_sptCalloutHandle3 ) +}; +const mso_CustomShape msoBorderCallout90 = +{ + const_cast<SvxMSDffVertPair*>(mso_sptCalloutVert1), SAL_N_ELEMENTS( mso_sptCalloutVert1 ), + const_cast<sal_uInt16*>(mso_sptCalloutSegm1a), sizeof( mso_sptCalloutSegm1a ) >> 1, + const_cast<SvxMSDffCalculationData*>(mso_sptCalloutCalc), SAL_N_ELEMENTS( mso_sptCalloutCalc ), + const_cast<sal_Int32*>(mso_sptCalloutDefault1), + nullptr, 0, + 21600, 21600, + MIN_INT32, MIN_INT32, + nullptr, 0, + const_cast<SvxMSDffHandle*>(mso_sptCalloutHandle1), SAL_N_ELEMENTS( mso_sptCalloutHandle1 ) +}; +const mso_CustomShape msoBorderCallout1 = +{ + const_cast<SvxMSDffVertPair*>(mso_sptCalloutVert1), SAL_N_ELEMENTS( mso_sptCalloutVert1 ), + const_cast<sal_uInt16*>(mso_sptCalloutSegm1a), sizeof( mso_sptCalloutSegm1a ) >> 1, + const_cast<SvxMSDffCalculationData*>(mso_sptCalloutCalc), SAL_N_ELEMENTS( mso_sptCalloutCalc ), + const_cast<sal_Int32*>(mso_sptCalloutDefault2), + nullptr, 0, + 21600, 21600, + MIN_INT32, MIN_INT32, + nullptr, 0, + const_cast<SvxMSDffHandle*>(mso_sptCalloutHandle1), SAL_N_ELEMENTS( mso_sptCalloutHandle1 ) +}; +const mso_CustomShape msoBorderCallout2 = +{ + const_cast<SvxMSDffVertPair*>(mso_sptCallout2Verta), SAL_N_ELEMENTS( mso_sptCallout2Verta ), + const_cast<sal_uInt16*>(mso_sptCallout2Segm1a), sizeof( mso_sptCallout2Segm1a ) >> 1, + const_cast<SvxMSDffCalculationData*>(mso_sptCalloutCalc), SAL_N_ELEMENTS( mso_sptCalloutCalc ), + const_cast<sal_Int32*>(mso_sptCalloutDefault3), + nullptr, 0, + 21600, 21600, + MIN_INT32, MIN_INT32, + nullptr, 0, + const_cast<SvxMSDffHandle*>(mso_sptCalloutHandle2), SAL_N_ELEMENTS( mso_sptCalloutHandle2 ) +}; +const mso_CustomShape msoBorderCallout3 = +{ + const_cast<SvxMSDffVertPair*>(mso_sptCallout3Verta), SAL_N_ELEMENTS( mso_sptCallout3Verta ), + const_cast<sal_uInt16*>(mso_sptCallout3Segm1a), sizeof( mso_sptCallout3Segm1a ) >> 1, + const_cast<SvxMSDffCalculationData*>(mso_sptCalloutCalc), SAL_N_ELEMENTS( mso_sptCalloutCalc ), + const_cast<sal_Int32*>(mso_sptCalloutDefault4), + nullptr, 0, + 21600, 21600, + MIN_INT32, MIN_INT32, + nullptr, 0, + const_cast<SvxMSDffHandle*>(mso_sptCalloutHandle3), SAL_N_ELEMENTS( mso_sptCalloutHandle3 ) +}; +const mso_CustomShape msoAccentBorderCallout90 = +{ + const_cast<SvxMSDffVertPair*>(mso_sptCalloutVert1), SAL_N_ELEMENTS( mso_sptCalloutVert1 ), + const_cast<sal_uInt16*>(mso_sptCalloutSegm1a), sizeof( mso_sptCalloutSegm1a ) >> 1, + const_cast<SvxMSDffCalculationData*>(mso_sptCalloutCalc), SAL_N_ELEMENTS( mso_sptCalloutCalc ), + const_cast<sal_Int32*>(mso_sptCalloutDefault1), + nullptr, 0, + 21600, 21600, + MIN_INT32, MIN_INT32, + nullptr, 0, + const_cast<SvxMSDffHandle*>(mso_sptCalloutHandle1), SAL_N_ELEMENTS( mso_sptCalloutHandle1 ) +}; +const mso_CustomShape msoAccentBorderCallout1 = +{ + const_cast<SvxMSDffVertPair*>(mso_sptCallout1Vert), SAL_N_ELEMENTS( mso_sptCallout1Vert ), + const_cast<sal_uInt16*>(mso_sptCallout1Segm1a), sizeof( mso_sptCallout1Segm1a ) >> 1, + const_cast<SvxMSDffCalculationData*>(mso_sptCalloutCalc), SAL_N_ELEMENTS( mso_sptCalloutCalc ), + const_cast<sal_Int32*>(mso_sptCalloutDefault2), + nullptr, 0, + 21600, 21600, + MIN_INT32, MIN_INT32, + nullptr, 0, + const_cast<SvxMSDffHandle*>(mso_sptCalloutHandle1), SAL_N_ELEMENTS( mso_sptCalloutHandle1 ) +}; +const mso_CustomShape msoAccentBorderCallout2 = +{ + const_cast<SvxMSDffVertPair*>(mso_sptCallout2Vertb), SAL_N_ELEMENTS( mso_sptCallout2Vertb ), + const_cast<sal_uInt16*>(mso_sptCallout2Segm1c), sizeof( mso_sptCallout2Segm1c ) >> 1, + const_cast<SvxMSDffCalculationData*>(mso_sptCalloutCalc), SAL_N_ELEMENTS( mso_sptCalloutCalc ), + const_cast<sal_Int32*>(mso_sptCalloutDefault3), + nullptr, 0, + 21600, 21600, + MIN_INT32, MIN_INT32, + nullptr, 0, + const_cast<SvxMSDffHandle*>(mso_sptCalloutHandle2), SAL_N_ELEMENTS( mso_sptCalloutHandle2 ) +}; +const mso_CustomShape msoAccentBorderCallout3 = +{ + const_cast<SvxMSDffVertPair*>(mso_sptCallout3Vertb), SAL_N_ELEMENTS( mso_sptCallout3Vertb ), + const_cast<sal_uInt16*>(mso_sptCallout3Segm1c), sizeof( mso_sptCallout3Segm1c ) >> 1, + const_cast<SvxMSDffCalculationData*>(mso_sptCalloutCalc), SAL_N_ELEMENTS( mso_sptCalloutCalc ), + const_cast<sal_Int32*>(mso_sptCalloutDefault4), + nullptr, 0, + 21600, 21600, + MIN_INT32, MIN_INT32, + nullptr, 0, + const_cast<SvxMSDffHandle*>(mso_sptCalloutHandle3), SAL_N_ELEMENTS( mso_sptCalloutHandle3 ) +}; + +const SvxMSDffVertPair mso_sptStraightConnector1Vert[] = +{ + { 0, 0 }, { 21600, 21600 } +}; +const sal_uInt16 mso_sptStraightConnector1Segm[] = +{ + 0x4000, 0x0001, 0x8000 +}; +const mso_CustomShape msoStraightConnector1 = +{ + const_cast<SvxMSDffVertPair*>(mso_sptStraightConnector1Vert), SAL_N_ELEMENTS( mso_sptStraightConnector1Vert ), + const_cast<sal_uInt16*>(mso_sptStraightConnector1Segm), sizeof( mso_sptStraightConnector1Segm ) >> 1, + nullptr, 0, + nullptr, + nullptr, 0, + 21600, 21600, + MIN_INT32, MIN_INT32, + nullptr, 0, + nullptr, 0 +}; + +const SvxMSDffVertPair mso_sptBentConnector2Vert[] = +{ + { 0, 0 }, { 21600, 0 }, { 21600, 21600 } +}; +const sal_uInt16 mso_sptBentConnector2Segm[] = +{ + 0x4000, 0x0002, 0x8000 +}; +const mso_CustomShape msoBentConnector2 = +{ + const_cast<SvxMSDffVertPair*>(mso_sptBentConnector2Vert), SAL_N_ELEMENTS( mso_sptBentConnector2Vert ), + const_cast<sal_uInt16*>(mso_sptBentConnector2Segm), sizeof( mso_sptBentConnector2Segm ) >> 1, + nullptr, 0, + nullptr, + nullptr, 0, + 21600, 21600, + MIN_INT32, MIN_INT32, + nullptr, 0, + nullptr, 0 +}; + +const SvxMSDffVertPair mso_sptBentConnector3Vert[] = +{ + { 0, 0 }, { 0 MSO_I, 0 }, { 0 MSO_I, 21600 }, { 21600, 21600 } +}; +const sal_uInt16 mso_sptBentConnector3Segm[] = +{ + 0x4000, 0x0003, 0x8000 +}; +const SvxMSDffCalculationData mso_sptBentConnector3Calc[] = +{ + { 0x2000, { DFF_Prop_adjustValue, 0, 0 } } +}; +const sal_Int32 mso_sptBentConnector3Default[] = +{ + 1, 10800 +}; +const SvxMSDffHandle mso_sptBentConnector3Handle[] = +{ + { SvxMSDffHandleFlags::RANGE, + 0x100, 10800, 10800, 10800, MIN_INT32, 0x7fffffff, MIN_INT32, 0x7fffffff } +}; +const mso_CustomShape msoBentConnector3 = +{ + const_cast<SvxMSDffVertPair*>(mso_sptBentConnector3Vert), SAL_N_ELEMENTS( mso_sptBentConnector3Vert ), + const_cast<sal_uInt16*>(mso_sptBentConnector3Segm), sizeof( mso_sptBentConnector3Segm ) >> 1, + const_cast<SvxMSDffCalculationData*>(mso_sptBentConnector3Calc), SAL_N_ELEMENTS( mso_sptBentConnector3Calc ), + const_cast<sal_Int32*>(mso_sptBentConnector3Default), + nullptr, 0, + 21600, 21600, + MIN_INT32, MIN_INT32, + nullptr, 0, + const_cast<SvxMSDffHandle*>(mso_sptBentConnector3Handle), SAL_N_ELEMENTS( mso_sptBentConnector3Handle ) +}; + +const SvxMSDffVertPair mso_sptBentConnector4Vert[] = +{ + { 0, 0 }, { 0 MSO_I, 0 }, { 0 MSO_I, 1 MSO_I }, { 21600, 1 MSO_I }, { 21600, 21600 } +}; +const sal_uInt16 mso_sptBentConnector4Segm[] = +{ + 0x4000, 0x0004, 0x8000 +}; +const SvxMSDffCalculationData mso_sptBentConnector4Calc[] = +{ + { 0x2000, { DFF_Prop_adjustValue, 0, 0 } }, + { 0x2000, { DFF_Prop_adjust2Value, 0, 0 } }, + { 0x2000, { 0x400, 21600, 0 } }, + { 0x2001, { 0x402, 1, 2 } }, + { 0x2001, { 0x401, 1, 2 } } +}; +const sal_Int32 mso_sptBentConnector4Default[] = +{ + 2, 10800, 10800 +}; +const SvxMSDffHandle mso_sptBentConnector4Handle[] = +{ + { SvxMSDffHandleFlags::RANGE | SvxMSDffHandleFlags::RANGE_Y_MIN_IS_SPECIAL | SvxMSDffHandleFlags::RANGE_Y_MAX_IS_SPECIAL, + 0x100, 4 + 3, 10800, 10800, MIN_INT32, 0x7fffffff, 4 + 3, 4 + 3 }, + { SvxMSDffHandleFlags::RANGE | SvxMSDffHandleFlags::RANGE_X_MIN_IS_SPECIAL | SvxMSDffHandleFlags::RANGE_X_MAX_IS_SPECIAL, + 3 + 3, 0x101, 10800, 10800, 3 + 3, 3 + 3, MIN_INT32, 0x7fffffff } +}; +const mso_CustomShape msoBentConnector4 = +{ + const_cast<SvxMSDffVertPair*>(mso_sptBentConnector4Vert), SAL_N_ELEMENTS( mso_sptBentConnector4Vert ), + const_cast<sal_uInt16*>(mso_sptBentConnector4Segm), sizeof( mso_sptBentConnector4Segm ) >> 1, + const_cast<SvxMSDffCalculationData*>(mso_sptBentConnector4Calc), SAL_N_ELEMENTS( mso_sptBentConnector4Calc ), + const_cast<sal_Int32*>(mso_sptBentConnector4Default), + nullptr, 0, + 21600, 21600, + MIN_INT32, MIN_INT32, + nullptr, 0, + const_cast<SvxMSDffHandle*>(mso_sptBentConnector4Handle), SAL_N_ELEMENTS( mso_sptBentConnector4Handle ) +}; + +const SvxMSDffVertPair mso_sptBentConnector5Vert[] = +{ + { 0, 0 }, { 0 MSO_I, 0 }, { 0 MSO_I, 4 MSO_I }, { 1 MSO_I, 4 MSO_I }, { 1 MSO_I, 21600 }, { 21600, 21600 } +}; +const sal_uInt16 mso_sptBentConnector5Segm[] = +{ + 0x4000, 0x0005, 0x8000 +}; +const SvxMSDffCalculationData mso_sptBentConnector5Calc[] = +{ + { 0x2000, { DFF_Prop_adjustValue, 0, 0 } }, + { 0x2000, { DFF_Prop_adjust3Value, 0, 0 } }, + { 0x6000, { 0x400, 0x401, 0 } }, + { 0x2001, { 0x402, 1, 2 } }, + { 0x2000, { DFF_Prop_adjust2Value, 0, 0 } }, + { 0x2001, { 0x404, 1, 2 } }, + { 0x4000, { 21600, 0x404, 0 } }, + { 0x2001, { 0x406, 1, 2 } } +}; +const sal_Int32 mso_sptBentConnector5Default[] = +{ + 3, 10800, 10800, 10800 +}; +const SvxMSDffHandle mso_sptBentConnector5Handle[] = +{ + { SvxMSDffHandleFlags::RANGE | SvxMSDffHandleFlags::RANGE_Y_MIN_IS_SPECIAL | SvxMSDffHandleFlags::RANGE_Y_MAX_IS_SPECIAL, + 0x100, 5 + 3, 10800, 10800, MIN_INT32, 0x7fffffff, 5 + 3, 5 + 3 }, + { SvxMSDffHandleFlags::RANGE | SvxMSDffHandleFlags::RANGE_X_MIN_IS_SPECIAL | SvxMSDffHandleFlags::RANGE_X_MAX_IS_SPECIAL, + 3 + 3, 0x101, 10800, 10800, 3 + 3, 3 + 3, MIN_INT32, 0x7fffffff }, + { SvxMSDffHandleFlags::RANGE | SvxMSDffHandleFlags::RANGE_Y_MIN_IS_SPECIAL | SvxMSDffHandleFlags::RANGE_Y_MAX_IS_SPECIAL, + 0x102, 7 + 3, 10800, 10800, MIN_INT32, 0x7fffffff, 7 + 3, 7 + 3 } +}; +const mso_CustomShape msoBentConnector5 = +{ + const_cast<SvxMSDffVertPair*>(mso_sptBentConnector5Vert), SAL_N_ELEMENTS( mso_sptBentConnector5Vert ), + const_cast<sal_uInt16*>(mso_sptBentConnector5Segm), sizeof( mso_sptBentConnector5Segm ) >> 1, + const_cast<SvxMSDffCalculationData*>(mso_sptBentConnector5Calc), SAL_N_ELEMENTS( mso_sptBentConnector5Calc ), + const_cast<sal_Int32*>(mso_sptBentConnector5Default), + nullptr, 0, + 21600, 21600, + MIN_INT32, MIN_INT32, + nullptr, 0, + const_cast<SvxMSDffHandle*>(mso_sptBentConnector5Handle), SAL_N_ELEMENTS( mso_sptBentConnector5Handle ) +}; + +const SvxMSDffVertPair mso_sptCurvedConnector2Vert[] = +{ + { 0, 0 }, { 10800, 0 }, { 21600, 10800 }, { 21600, 21600 } +}; +const sal_uInt16 mso_sptCurvedConnector2Segm[] = +{ + 0x4000, 0x2001, 0x8000 +}; +const mso_CustomShape msoCurvedConnector2 = +{ + const_cast<SvxMSDffVertPair*>(mso_sptCurvedConnector2Vert), SAL_N_ELEMENTS( mso_sptCurvedConnector2Vert ), + const_cast<sal_uInt16*>(mso_sptCurvedConnector2Segm), sizeof( mso_sptCurvedConnector2Segm ) >> 1, + nullptr, 0, + nullptr, + nullptr, 0, + 21600, 21600, + MIN_INT32, MIN_INT32, + nullptr, 0, + nullptr, 0 +}; + +const SvxMSDffVertPair mso_sptCurvedConnector3Vert[] = +{ + { 0, 0 }, { 1 MSO_I, 0 }, { 0 MSO_I, 5400 }, { 0 MSO_I, 10800 }, { 0 MSO_I, 16200 }, { 3 MSO_I, 21600 }, { 21600, 21600 } +}; +const sal_uInt16 mso_sptCurvedConnector3Segm[] = +{ + 0x4000, 0x2002, 0x8000 +}; +const SvxMSDffCalculationData mso_sptCurvedConnector3Calc[] = +{ + { 0x2000, { DFF_Prop_adjustValue, 0, 0 } }, + { 0x2001, { 0x400, 1, 2 } }, + { 0x2000, { 0x400, 21600, 0 } }, + { 0x2001, { 0x402, 1, 2 } } +}; +const sal_Int32 mso_sptCurvedConnector3Default[] = +{ + 1, 10800 +}; +const SvxMSDffHandle mso_sptCurvedConnector3Handle[] = +{ + { SvxMSDffHandleFlags::RANGE, + 0x100, 10800, 10800, 10800, MIN_INT32, 0x7fffffff, MIN_INT32, 0x7fffffff } +}; +const mso_CustomShape msoCurvedConnector3 = +{ + const_cast<SvxMSDffVertPair*>(mso_sptCurvedConnector3Vert), SAL_N_ELEMENTS( mso_sptCurvedConnector3Vert ), + const_cast<sal_uInt16*>(mso_sptCurvedConnector3Segm), sizeof( mso_sptCurvedConnector3Segm ) >> 1, + const_cast<SvxMSDffCalculationData*>(mso_sptCurvedConnector3Calc), SAL_N_ELEMENTS( mso_sptCurvedConnector3Calc ), + const_cast<sal_Int32*>(mso_sptCurvedConnector3Default), + nullptr, 0, + 21600, 21600, + MIN_INT32, MIN_INT32, + nullptr, 0, + const_cast<SvxMSDffHandle*>(mso_sptCurvedConnector3Handle), SAL_N_ELEMENTS( mso_sptCurvedConnector3Handle ) +}; + +const SvxMSDffVertPair mso_sptCurvedConnector4Vert[] = +{ + { 0, 0 }, { 1 MSO_I, 0 }, { 0 MSO_I, 10 MSO_I }, { 0 MSO_I, 9 MSO_I }, + { 0 MSO_I, 12 MSO_I }, { 5 MSO_I, 8 MSO_I }, { 3 MSO_I, 8 MSO_I }, + { 7 MSO_I, 8 MSO_I }, { 21600, 14 MSO_I }, { 21600, 21600 } + +}; +const sal_uInt16 mso_sptCurvedConnector4Segm[] = +{ + 0x4000, 0x2003, 0x8000 +}; +const SvxMSDffCalculationData mso_sptCurvedConnector4Calc[] = +{ + { 0x2000, { DFF_Prop_adjustValue, 0, 0 } }, + { 0x2001, { 0x400, 1, 2 } }, + { 0x4000, { 21600, 0x400, 0 } }, + { 0x2001, { 0x402, 1, 2 } }, + { 0x6000, { 0x400, 0x403, 0 } }, + { 0x2001, { 0x404, 1, 2 } }, + { 0x2000, { 0x403, 21600, 0 } }, + { 0x2001, { 0x406, 1, 2 } }, + { 0x2000, { DFF_Prop_adjust2Value, 0, 0 } }, + { 0x2001, { DFF_Prop_adjust2Value, 1, 2 } }, + { 0x2001, { DFF_Prop_adjust2Value, 1, 4 } }, + { 0x6000, { 0x408, 0x409, 0 } }, + { 0x2001, { 0x40b, 1, 2 } }, + { 0x2000, { 0x408, 21600, 0 } }, + { 0x2001, { 0x40d, 1, 2 } } +}; +const sal_Int32 mso_sptCurvedConnector4Default[] = +{ + 2, 10800, 10800 +}; +const SvxMSDffHandle mso_sptCurvedConnector4Handle[] = +{ + { SvxMSDffHandleFlags::RANGE | SvxMSDffHandleFlags::RANGE_Y_MIN_IS_SPECIAL | SvxMSDffHandleFlags::RANGE_Y_MAX_IS_SPECIAL, + 0x100, 9 + 3, 10800, 10800, MIN_INT32, 0x7fffffff, 9 + 3, 9 + 3 }, + { SvxMSDffHandleFlags::RANGE | SvxMSDffHandleFlags::RANGE_X_MIN_IS_SPECIAL | SvxMSDffHandleFlags::RANGE_X_MAX_IS_SPECIAL, + 3 + 3, 0x101, 10800, 10800, 3 + 3, 3 + 3, MIN_INT32, 0x7fffffff } +}; +const mso_CustomShape msoCurvedConnector4 = +{ + const_cast<SvxMSDffVertPair*>(mso_sptCurvedConnector4Vert), SAL_N_ELEMENTS( mso_sptCurvedConnector4Vert ), + const_cast<sal_uInt16*>(mso_sptCurvedConnector4Segm), sizeof( mso_sptCurvedConnector4Segm ) >> 1, + const_cast<SvxMSDffCalculationData*>(mso_sptCurvedConnector4Calc), SAL_N_ELEMENTS( mso_sptCurvedConnector4Calc ), + const_cast<sal_Int32*>(mso_sptCurvedConnector4Default), + nullptr, 0, + 21600, 21600, + MIN_INT32, MIN_INT32, + nullptr, 0, + const_cast<SvxMSDffHandle*>(mso_sptCurvedConnector4Handle), SAL_N_ELEMENTS( mso_sptCurvedConnector4Handle ) +}; + +const SvxMSDffVertPair mso_sptCurvedConnector5Vert[] = +{ + { 0, 0 }, + { 21 MSO_I, 0 }, { 0 MSO_I, 12 MSO_I }, { 0 MSO_I, 11 MSO_I }, + { 0 MSO_I, 14 MSO_I }, { 6 MSO_I, 4 MSO_I }, { 3 MSO_I, 4 MSO_I }, + { 8 MSO_I, 4 MSO_I }, { 1 MSO_I, 18 MSO_I }, { 1 MSO_I, 16 MSO_I }, + { 1 MSO_I, 20 MSO_I }, { 10 MSO_I, 21600 }, { 21600, 21600 } +}; +const sal_uInt16 mso_sptCurvedConnector5Segm[] = +{ + 0x4000, 0x2004, 0x8000 +}; +const SvxMSDffCalculationData mso_sptCurvedConnector5Calc[] = +{ + { 0x2000, { DFF_Prop_adjustValue, 0, 0 } }, + { 0x2000, { DFF_Prop_adjust3Value, 0, 0 } }, + { 0x6000, { 0x400, 0x401, 0 } }, + { 0x2001, { 0x402, 1, 2 } }, + { 0x2000, { DFF_Prop_adjust2Value, 0, 0 } }, + { 0x6000, { 0x400, 0x403, 0 } }, + { 0x2001, { 0x405, 1, 2 } }, + { 0x6000, { 0x401, 0x403, 0 } }, + { 0x2001, { 0x407, 1, 2 } }, + { 0x2000, { 0x401, 21600, 0 } }, + { 0x2001, { 0x409, 1, 2 } }, + { 0x2001, { 0x404, 1, 2 } }, + { 0x2001, { 0x40b, 1, 2 } }, + { 0x6000, { 0x404, 0x40b, 0 } }, + { 0x2001, { 0x40d, 1, 2 } }, + { 0x2000, { 0x404, 21600, 0 } }, + { 0x2001, { 0x40f, 1, 2 } }, + { 0x6000, { 0x404, 0x410, 0 } }, + { 0x2001, { 0x411, 1, 2 } }, + { 0x2000, { 0x410, 21600, 0 } }, + { 0x2001, { 0x413, 1, 2 } }, + { 0x2001, { 0x400, 1, 2 } } +}; +const sal_Int32 mso_sptCurvedConnector5Default[] = +{ + 3, 10800, 10800, 10800 +}; +const SvxMSDffHandle mso_sptCurvedConnector5Handle[] = +{ + { SvxMSDffHandleFlags::RANGE | SvxMSDffHandleFlags::RANGE_Y_MIN_IS_SPECIAL | SvxMSDffHandleFlags::RANGE_Y_MAX_IS_SPECIAL, + 0x100, 11 + 3, 10800, 10800, MIN_INT32, 0x7fffffff, 11 + 3, 11 + 3 }, + { SvxMSDffHandleFlags::RANGE | SvxMSDffHandleFlags::RANGE_X_MIN_IS_SPECIAL | SvxMSDffHandleFlags::RANGE_X_MAX_IS_SPECIAL, + 3 + 3, 0x101, 10800, 10800, 3 + 3, 3 + 3, MIN_INT32, 0x7fffffff }, + { SvxMSDffHandleFlags::RANGE | SvxMSDffHandleFlags::RANGE_Y_MIN_IS_SPECIAL | SvxMSDffHandleFlags::RANGE_Y_MAX_IS_SPECIAL, + 0x102, 16 + 3, 10800, 10800, MIN_INT32, 0x7fffffff, 16 + 3, 16 + 3 } +}; +const mso_CustomShape msoCurvedConnector5 = +{ + const_cast<SvxMSDffVertPair*>(mso_sptCurvedConnector5Vert), SAL_N_ELEMENTS( mso_sptCurvedConnector5Vert ), + const_cast<sal_uInt16*>(mso_sptCurvedConnector5Segm), sizeof( mso_sptCurvedConnector5Segm ) >> 1, + const_cast<SvxMSDffCalculationData*>(mso_sptCurvedConnector5Calc), SAL_N_ELEMENTS( mso_sptCurvedConnector5Calc ), + const_cast<sal_Int32*>(mso_sptCurvedConnector5Default), + nullptr, 0, + 21600, 21600, + MIN_INT32, MIN_INT32, + nullptr, 0, + const_cast<SvxMSDffHandle*>(mso_sptCurvedConnector5Handle), SAL_N_ELEMENTS( mso_sptCurvedConnector5Handle ) +}; + +/////////////////////////////teardrop +const SvxMSDffVertPair mso_sptTearDropVert[] = +{ + { 10800, 0 }, + { 0, 10800 }, // X + { 10800, 21600 }, // Y + { 21600, 10800 }, // X + { 21600, 10800 }, { 21600, 3 MSO_I }, { 0 MSO_I, 1 MSO_I }, // C + { 0 MSO_I, 1 MSO_I }, { 4 MSO_I, 0 }, { 10800, 0 } +}; + +// the last number (0x***n) : 0 = sum, 1 = prod, 2 = mid, 3 = abs, 4 = min, 5 = max, 6 = if, 13 = sqrt, 15 = eclipse ... +// the first number(0xn***) : 2/4/8 the first/second/third value is not directly value +const SvxMSDffCalculationData mso_sptTearDropCalc[] = +{ + { 0x2000 , { DFF_Prop_adjustValue , 0 , 0 } }, // 0 adjust value #0 + { 0x8000 , { 21600 , 0 , 0x0400 } }, // 1 21600 - @0 y0 + { 0x8000 , { 32400 , 0 , 0x0400 } }, // 2 (32400 - @0) + { 0x2001 , { 0x0402 , 1 , 2 } }, // 3 (32400 - @0)/2 y1 + { 0x2002 , { 0x0400 , 10800 , 0 } }, // 4 (@0+10800)/2 x2 +}; + +//m, qx, qy, qx,C,C +//the last number(0x***n) : repeat number of this current Segm +const sal_uInt16 mso_sptTearDropSegm[] = +{ + 0x4000, 0xa701, 0xa801, 0xa701, 0x2002, 0x6000, 0x8000 +}; + +const SvxMSDffTextRectangles mso_sptTearDropTextRect[] = +{ + { { 2863, 2863 }, { 18737, 18737 } } +}; + +//the range of adjust values +const SvxMSDffHandle mso_sptTearDropHandle[] = +{ + //position="$0,0" xrange="10800,32400" + { SvxMSDffHandleFlags::RANGE | SvxMSDffHandleFlags::RANGE_X_MAX_IS_SPECIAL| SvxMSDffHandleFlags::RANGE_X_MIN_IS_SPECIAL, + 0x100, 0, 10800, 10800, 10800, 32400, MIN_INT32, 0x7fffffff } +}; + +//the number of adjust values, the default values +const sal_Int32 mso_sptTearDropDefault[] = +{ + 1, 21600 +}; + +const mso_CustomShape msoTearDrop = +{ + const_cast<SvxMSDffVertPair*>(mso_sptTearDropVert), SAL_N_ELEMENTS( mso_sptTearDropVert ), + const_cast<sal_uInt16*>(mso_sptTearDropSegm), sizeof( mso_sptTearDropSegm ) >> 1, + const_cast<SvxMSDffCalculationData*>(mso_sptTearDropCalc), SAL_N_ELEMENTS(mso_sptTearDropCalc), + const_cast<sal_Int32*>(mso_sptTearDropDefault), + const_cast<SvxMSDffTextRectangles*>(mso_sptTearDropTextRect), SAL_N_ELEMENTS( mso_sptTearDropTextRect ), + 21600, 21600, + MIN_INT32, MIN_INT32, + nullptr, 0, + const_cast<SvxMSDffHandle*>(mso_sptTearDropHandle), SAL_N_ELEMENTS(mso_sptTearDropHandle) // handles +}; + + +const mso_CustomShape* GetCustomShapeContent( MSO_SPT eSpType ) +{ + const mso_CustomShape* pCustomShape = nullptr; + switch( eSpType ) + { + case mso_sptArc : pCustomShape = &msoArc; break; + case mso_sptLine: pCustomShape = &msoStraightConnector1; break; + case mso_sptRectangle : pCustomShape = &msoRectangle; break; + case mso_sptParallelogram : pCustomShape = &msoParallelogram; break; + case mso_sptTrapezoid : pCustomShape = &msoTrapezoid; break; + case mso_sptDiamond : pCustomShape = &msoDiamond; break; + case mso_sptRoundRectangle : pCustomShape = &msoRoundRectangle; break; + case mso_sptOctagon : pCustomShape = &msoOctagon; break; + case mso_sptIsocelesTriangle : pCustomShape = &msoIsocelesTriangle; break; + case mso_sptRightTriangle : pCustomShape = &msoRightTriangle; break; + case mso_sptEllipse : pCustomShape = &msoEllipse; break; + case mso_sptHexagon : pCustomShape = &msoHexagon; break; + case mso_sptPlus : pCustomShape = &msoPlus; break; + case mso_sptPentagon : pCustomShape = &msoPentagon; break; + case mso_sptCan : pCustomShape = &msoCan; break; + case mso_sptCube : pCustomShape = &msoCube; break; + case mso_sptBalloon : pCustomShape = &msoBalloon; break; + case mso_sptActionButtonBlank : pCustomShape = &msoActionButtonBlank; break; + case mso_sptActionButtonHome : pCustomShape = &msoActionButtonHome; break; + case mso_sptActionButtonHelp : pCustomShape = &msoActionButtonHelp; break; + case mso_sptActionButtonInformation : pCustomShape = &msoActionButtonInformation; break; + case mso_sptActionButtonBackPrevious : pCustomShape = &msoActionButtonBackPrevious; break; + case mso_sptActionButtonForwardNext : pCustomShape = &msoActionButtonForwardNext; break; + case mso_sptActionButtonBeginning : pCustomShape = &msoActionButtonBeginning; break; + case mso_sptActionButtonEnd : pCustomShape = &msoActionButtonEnd; break; + case mso_sptActionButtonReturn : pCustomShape = &msoActionButtonReturn; break; + case mso_sptActionButtonDocument : pCustomShape = &msoActionButtonDocument; break; + case mso_sptActionButtonSound : pCustomShape = &msoActionButtonSound; break; + case mso_sptActionButtonMovie : pCustomShape = &msoActionButtonMovie; break; + case mso_sptBevel : pCustomShape = &msoBevel; break; + case mso_sptFoldedCorner : pCustomShape = &msoFoldedCorner; break; + case mso_sptSmileyFace : pCustomShape = &msoSmileyFace; break; + case mso_sptDonut : pCustomShape = &msoDonut; break; + case mso_sptNoSmoking : pCustomShape = &msoNoSmoking; break; + case mso_sptBlockArc : pCustomShape = &msoBlockArc; break; + case mso_sptHeart : pCustomShape = &msoHeart; break; + case mso_sptLightningBolt : pCustomShape = &msoLightningBold; break; + case mso_sptSun : pCustomShape = &msoSun; break; + case mso_sptMoon : pCustomShape = &msoMoon; break; + case mso_sptBracketPair : pCustomShape = &msoBracketPair; break; + case mso_sptBracePair : pCustomShape = &msoBracePair; break; + case mso_sptPlaque : pCustomShape = &msoPlaque; break; + case mso_sptLeftBracket : pCustomShape = &msoLeftBracket; break; + case mso_sptRightBracket : pCustomShape = &msoRightBracket; break; + case mso_sptLeftBrace : pCustomShape = &msoLeftBrace; break; + case mso_sptRightBrace : pCustomShape = &msoRightBrace; break; + case mso_sptArrow : pCustomShape = &msoArrow; break; + case mso_sptUpArrow : pCustomShape = &msoUpArrow; break; + case mso_sptDownArrow : pCustomShape = &msoDownArrow; break; + case mso_sptLeftArrow : pCustomShape = &msoLeftArrow; break; + case mso_sptLeftRightArrow : pCustomShape = &msoLeftRightArrow; break; + case mso_sptUpDownArrow : pCustomShape = &msoUpDownArrow; break; + case mso_sptQuadArrow : pCustomShape = &msoQuadArrow; break; + case mso_sptLeftRightUpArrow : pCustomShape = &msoLeftRightUpArrow; break; + case mso_sptBentArrow : pCustomShape = &msoBentArrow; break; + case mso_sptUturnArrow : pCustomShape = &msoUturnArrow; break; + case mso_sptLeftUpArrow : pCustomShape = &msoLeftUpArrow; break; + case mso_sptBentUpArrow : pCustomShape = &msoBentUpArrow; break; + case mso_sptCurvedRightArrow : pCustomShape = &msoCurvedRightArrow; break; + case mso_sptCurvedLeftArrow : pCustomShape = &msoCurvedLeftArrow; break; + case mso_sptCurvedUpArrow : pCustomShape = &msoCurvedUpArrow; break; + case mso_sptCurvedDownArrow : pCustomShape = &msoCurvedDownArrow; break; + case mso_sptStripedRightArrow : pCustomShape = &msoStripedRightArrow; break; + case mso_sptNotchedRightArrow : pCustomShape = &msoNotchedRightArrow; break; + case mso_sptHomePlate : pCustomShape = &msoHomePlate; break; + case mso_sptChevron : pCustomShape = &msoChevron; break; + case mso_sptRightArrowCallout : pCustomShape = &msoRightArrowCallout; break; + case mso_sptLeftArrowCallout : pCustomShape = &msoLeftArrowCallout; break; + case mso_sptUpArrowCallout : pCustomShape = &msoUpArrowCallout; break; + case mso_sptDownArrowCallout : pCustomShape = &msoDownArrowCallout; break; + case mso_sptLeftRightArrowCallout : pCustomShape = &msoLeftRightArrowCallout; break; + case mso_sptUpDownArrowCallout : pCustomShape = &msoUpDownArrowCallout; break; + case mso_sptQuadArrowCallout : pCustomShape = &msoQuadArrowCallout; break; + case mso_sptCircularArrow : pCustomShape = &msoCircularArrow; break; + case mso_sptIrregularSeal1 : pCustomShape = &msoIrregularSeal1; break; + case mso_sptIrregularSeal2 : pCustomShape = &msoIrregularSeal2; break; + case mso_sptSeal4 : pCustomShape = &msoSeal4; break; + case mso_sptStar : pCustomShape = &msoStar; break; + case mso_sptSeal8 : pCustomShape = &msoSeal8; break; + case mso_sptSeal : + case mso_sptSeal16 : pCustomShape = &msoSeal16; break; + case mso_sptSeal24 : pCustomShape = &msoSeal24; break; + case mso_sptSeal32 : pCustomShape = &msoSeal32; break; + case mso_sptRibbon2 : pCustomShape = &msoRibbon2; break; + case mso_sptRibbon : pCustomShape = &msoRibbon; break; + case mso_sptEllipseRibbon2 : pCustomShape = &msosptEllipseRibbon2; break; // SJ: TODO + case mso_sptEllipseRibbon : pCustomShape = &msosptEllipseRibbon; break; // SJ: TODO + case mso_sptVerticalScroll : pCustomShape = &msoVerticalScroll; break; + case mso_sptHorizontalScroll : pCustomShape = &msoHorizontalScroll; break; + case mso_sptFlowChartProcess : pCustomShape = &msoFlowChartProcess; break; + case mso_sptFlowChartAlternateProcess : pCustomShape = &msoFlowChartAlternateProcess; break; + case mso_sptFlowChartDecision : pCustomShape = &msoFlowChartDecision; break; + case mso_sptFlowChartInputOutput : pCustomShape = &msoFlowChartInputOutput; break; + case mso_sptFlowChartPredefinedProcess :pCustomShape = &msoFlowChartPredefinedProcess; break; + case mso_sptFlowChartInternalStorage : pCustomShape = &msoFlowChartInternalStorage; break; + case mso_sptFlowChartDocument : pCustomShape = &msoFlowChartDocument; break; + case mso_sptFlowChartMultidocument : pCustomShape = &msoFlowChartMultidocument; break; + case mso_sptFlowChartTerminator : pCustomShape = &msoFlowChartTerminator; break; + case mso_sptFlowChartPreparation : pCustomShape = &msoFlowChartPreparation; break; + case mso_sptFlowChartManualInput : pCustomShape = &msoFlowChartManualInput; break; + case mso_sptFlowChartManualOperation : pCustomShape = &msoFlowChartManualOperation; break; + case mso_sptFlowChartConnector : pCustomShape = &msoFlowChartConnector; break; + case mso_sptFlowChartOffpageConnector : pCustomShape = &msoFlowChartOffpageConnector; break; + case mso_sptFlowChartPunchedCard : pCustomShape = &msoFlowChartPunchedCard; break; + case mso_sptFlowChartPunchedTape : pCustomShape = &msoFlowChartPunchedTape; break; + case mso_sptFlowChartSummingJunction : pCustomShape = &msoFlowChartSummingJunction; break; + case mso_sptFlowChartOr : pCustomShape = &msoFlowChartOr; break; + case mso_sptFlowChartCollate : pCustomShape = &msoFlowChartCollate; break; + case mso_sptFlowChartSort : pCustomShape = &msoFlowChartSort; break; + case mso_sptFlowChartExtract : pCustomShape = &msoFlowChartExtract; break; + case mso_sptFlowChartMerge : pCustomShape = &msoFlowChartMerge; break; + case mso_sptFlowChartOnlineStorage : pCustomShape = &msoFlowChartOnlineStorage; break; + case mso_sptFlowChartDelay : pCustomShape = &msoFlowChartDelay; break; + case mso_sptFlowChartMagneticTape : pCustomShape = &msoFlowChartMagneticTape; break; + case mso_sptFlowChartMagneticDisk : pCustomShape = &msoFlowChartMagneticDisk; break; + case mso_sptFlowChartMagneticDrum : pCustomShape = &msoFlowChartMagneticDrum; break; + case mso_sptFlowChartDisplay : pCustomShape = &msoFlowChartDisplay; break; + case mso_sptWedgeRectCallout : pCustomShape = &msoWedgeRectCallout; break; + case mso_sptWedgeRRectCallout : pCustomShape = &msoWedgeRRectCallout; break; + case mso_sptWedgeEllipseCallout : pCustomShape = &msoWedgeEllipseCallout; break; + case mso_sptCloudCallout : pCustomShape = &msoCloudCallout; break; + case mso_sptWave : pCustomShape = &msoWave; break; + case mso_sptDoubleWave : pCustomShape = &msoDoubleWave; break; + + // callout + case mso_sptCallout1 : pCustomShape = &msoCallout1; break; + case mso_sptCallout2 : pCustomShape = &msoCallout2; break; + case mso_sptCallout3 : pCustomShape = &msoCallout3; break; + case mso_sptAccentCallout1 : pCustomShape = &msoAccentCallout1; break; + case mso_sptAccentCallout2 : pCustomShape = &msoAccentCallout2; break; + case mso_sptAccentCallout3 : pCustomShape = &msoAccentCallout3; break; + case mso_sptBorderCallout1 : pCustomShape = &msoBorderCallout1; break; + case mso_sptBorderCallout2 : pCustomShape = &msoBorderCallout2; break; + case mso_sptBorderCallout3 : pCustomShape = &msoBorderCallout3; break; + case mso_sptAccentBorderCallout1 : pCustomShape = &msoAccentBorderCallout1; break; + case mso_sptAccentBorderCallout2 : pCustomShape = &msoAccentBorderCallout2; break; + case mso_sptAccentBorderCallout3 : pCustomShape = &msoAccentBorderCallout3; break; + case mso_sptCallout90 : pCustomShape = &msoCallout90; break; + case mso_sptAccentCallout90 : pCustomShape = &msoAccentCallout90; break; + case mso_sptBorderCallout90 : pCustomShape = &msoBorderCallout90; break; + case mso_sptAccentBorderCallout90 : pCustomShape = &msoAccentBorderCallout90; break; + + // connectors + case mso_sptStraightConnector1 : pCustomShape = &msoStraightConnector1; break; + case mso_sptBentConnector2 : pCustomShape = &msoBentConnector2; break; + case mso_sptBentConnector3 : pCustomShape = &msoBentConnector3; break; + case mso_sptBentConnector4 : pCustomShape = &msoBentConnector4; break; + case mso_sptBentConnector5 : pCustomShape = &msoBentConnector5; break; + case mso_sptCurvedConnector2 : pCustomShape = &msoCurvedConnector2; break; + case mso_sptCurvedConnector3 : pCustomShape = &msoCurvedConnector3; break; + case mso_sptCurvedConnector4 : pCustomShape = &msoCurvedConnector4; break; + case mso_sptCurvedConnector5 : pCustomShape = &msoCurvedConnector5; break; + + // Don't know, simply mapping to TextSimple + case mso_sptTextOnRing : + case mso_sptTextOnCurve : + case mso_sptTextRing : + case mso_sptTextWave : + case mso_sptTextCurve : + case mso_sptTextHexagon : + case mso_sptTextOctagon : + case mso_sptTextBox : pCustomShape = &msoTextSimple; break; + + // FontWork + case mso_sptTextSimple : + case mso_sptTextPlainText : pCustomShape = &msoTextPlainText; break; + case mso_sptTextStop : pCustomShape = &msoTextStop; break; + case mso_sptTextTriangle : pCustomShape = &msoTextTriangle; break; + case mso_sptTextTriangleInverted : pCustomShape = &msoTextTriangleInverted; break; + case mso_sptTextChevron : pCustomShape = &msoTextChevron; break; + case mso_sptTextChevronInverted : pCustomShape = &msoTextChevronInverted; break; + case mso_sptTextRingInside : pCustomShape = &msoTextRingInside; break; // SJ: TODO->the orientation of the ellipse needs to be changed + case mso_sptTextRingOutside : pCustomShape = &msoTextRingOutside; break; + case mso_sptTextFadeRight : pCustomShape = &msoTextFadeRight; break; + case mso_sptTextFadeLeft : pCustomShape = &msoTextFadeLeft; break; + case mso_sptTextFadeUp : pCustomShape = &msoTextFadeUp; break; + case mso_sptTextFadeDown : pCustomShape = &msoTextFadeDown; break; + case mso_sptTextSlantUp : pCustomShape = &msoTextSlantUp; break; + case mso_sptTextSlantDown : pCustomShape = &msoTextSlantDown; break; + case mso_sptTextCascadeUp : pCustomShape = &msoTextCascadeUp; break; + case mso_sptTextCascadeDown : pCustomShape = &msoTextCascadeDown; break; + case mso_sptTextArchUpCurve : pCustomShape = &msoTextArchUpCurve; break; + case mso_sptTextArchDownCurve : pCustomShape = &msoTextArchDownCurve; break; + case mso_sptTextCircleCurve : pCustomShape = &msoTextCircleCurve; break; + case mso_sptTextButtonCurve : pCustomShape = &msoTextButtonCurve; break; + case mso_sptTextArchUpPour : pCustomShape = &msoTextArchUpPour; break; + case mso_sptTextArchDownPour : pCustomShape = &msoTextArchDownPour; break; + case mso_sptTextCirclePour : pCustomShape = &msoTextCirclePour; break; + case mso_sptTextButtonPour : pCustomShape = &msoTextButtonPour; break; + case mso_sptTextCurveUp : pCustomShape = &msoTextCurveUp; break; + case mso_sptTextCurveDown : pCustomShape = &msoTextCurveDown; break; + case mso_sptTextCanUp : pCustomShape = &msoTextCanUp; break; + case mso_sptTextCanDown : pCustomShape = &msoTextCanDown; break; + case mso_sptTextInflate : pCustomShape = &msoTextInflate; break; + case mso_sptTextDeflate : pCustomShape = &msoTextDeflate; break; + case mso_sptTextInflateBottom : pCustomShape = &msoTextInflateBottom; break; + case mso_sptTextDeflateBottom : pCustomShape = &msoTextDeflateBottom; break; + case mso_sptTextInflateTop : pCustomShape = &msoTextInflateTop; break; + case mso_sptTextDeflateTop : pCustomShape = &msoTextDeflateTop; break; + case mso_sptTextDeflateInflate : pCustomShape = &msoTextDeflateInflate; break; + case mso_sptTextDeflateInflateDeflate : pCustomShape = &msoTextDeflateInflateDeflate; break; + case mso_sptTextWave1 : pCustomShape = &msoTextWave1; break; + case mso_sptTextWave2 : pCustomShape = &msoTextWave2; break; + case mso_sptTextWave3 : pCustomShape = &msoTextWave3; break; + case mso_sptTextWave4 : pCustomShape = &msoTextWave4; break; + case mso_sptTearDrop : pCustomShape = &msoTearDrop; break; + default : + break; + } + return pCustomShape; +} + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svx/source/customshapes/EnhancedCustomShapeHandle.cxx b/svx/source/customshapes/EnhancedCustomShapeHandle.cxx new file mode 100644 index 000000000..8dce09c1c --- /dev/null +++ b/svx/source/customshapes/EnhancedCustomShapeHandle.cxx @@ -0,0 +1,91 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#include "EnhancedCustomShapeHandle.hxx" +#include <svx/EnhancedCustomShape2d.hxx> +#include <svx/svdoashp.hxx> + + +EnhancedCustomShapeHandle::EnhancedCustomShapeHandle( css::uno::Reference< css::drawing::XShape > const & xCustomShape, sal_uInt32 nIndex ) : + mnIndex ( nIndex ), + mxCustomShape ( xCustomShape ) +{ +} + + +EnhancedCustomShapeHandle::~EnhancedCustomShapeHandle() +{ +} + + +void SAL_CALL EnhancedCustomShapeHandle::acquire() noexcept +{ + OWeakObject::acquire(); +} + + +void SAL_CALL EnhancedCustomShapeHandle::release() noexcept +{ + OWeakObject::release(); +} + +// XCustomShapeHandle +css::awt::Point SAL_CALL EnhancedCustomShapeHandle::getPosition() +{ + auto pSdrObjCustomShape = dynamic_cast< SdrObjCustomShape* >(SdrObject::getSdrObjectFromXShape(mxCustomShape)); + + if(!pSdrObjCustomShape) + { + throw css::uno::RuntimeException(); + } + + Point aPosition; + EnhancedCustomShape2d aCustomShape2d(*pSdrObjCustomShape); + + if(!aCustomShape2d.GetHandlePosition(mnIndex, aPosition)) + { + throw css::uno::RuntimeException(); + } + + return css::awt::Point( aPosition.X(), aPosition.Y() ); +} + +void SAL_CALL EnhancedCustomShapeHandle::setControllerPosition( const css::awt::Point& aPnt ) +{ + auto pSdrObjCustomShape = dynamic_cast< SdrObjCustomShape* >(SdrObject::getSdrObjectFromXShape(mxCustomShape)); + + if(!pSdrObjCustomShape) + { + throw css::uno::RuntimeException(); + } + + EnhancedCustomShape2d aCustomShape2d(*pSdrObjCustomShape); + + if(!aCustomShape2d.SetHandleControllerPosition(mnIndex, aPnt)) + { + throw css::uno::RuntimeException(); + } +} + +// XInitialization +void SAL_CALL EnhancedCustomShapeHandle::initialize( const css::uno::Sequence< css::uno::Any >& /* aArguments */ ) +{ +} + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svx/source/customshapes/EnhancedCustomShapeHandle.hxx b/svx/source/customshapes/EnhancedCustomShapeHandle.hxx new file mode 100644 index 000000000..b56909420 --- /dev/null +++ b/svx/source/customshapes/EnhancedCustomShapeHandle.hxx @@ -0,0 +1,57 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#ifndef INCLUDED_SVX_SOURCE_CUSTOMSHAPES_ENHANCEDCUSTOMSHAPEHANDLE_HXX +#define INCLUDED_SVX_SOURCE_CUSTOMSHAPES_ENHANCEDCUSTOMSHAPEHANDLE_HXX + +#include <cppuhelper/implbase.hxx> +#include <com/sun/star/lang/XInitialization.hpp> +#include <com/sun/star/drawing/XShape.hpp> +#include <com/sun/star/drawing/XCustomShapeHandle.hpp> +#include <com/sun/star/awt/Point.hpp> + +class EnhancedCustomShapeHandle : public cppu::WeakImplHelper +< + css::drawing::XCustomShapeHandle, + css::lang::XInitialization +> +{ + sal_uInt32 mnIndex; + css::uno::Reference< css::drawing::XShape > mxCustomShape; + +public: + + EnhancedCustomShapeHandle( css::uno::Reference< css::drawing::XShape > const & xCustomShape, sal_uInt32 nIndex ); + virtual ~EnhancedCustomShapeHandle() override; + + // XInterface + virtual void SAL_CALL acquire() noexcept override; + virtual void SAL_CALL release() noexcept override; + + // XCustomShapeHandle + virtual css::awt::Point SAL_CALL getPosition() override; + virtual void SAL_CALL setControllerPosition( const css::awt::Point& ) override; + + // XInitialization + virtual void SAL_CALL initialize( const css::uno::Sequence< css::uno::Any >& aArguments ) override; +}; + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svx/source/customshapes/EnhancedCustomShapeTypeNames.cxx b/svx/source/customshapes/EnhancedCustomShapeTypeNames.cxx new file mode 100644 index 000000000..70c15ca66 --- /dev/null +++ b/svx/source/customshapes/EnhancedCustomShapeTypeNames.cxx @@ -0,0 +1,548 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#include <svx/EnhancedCustomShapeTypeNames.hxx> +#include <unordered_map> + +namespace { + +struct NameTypeTable +{ + const char* pS; + MSO_SPT pE; +}; + +} + +const NameTypeTable pNameTypeTableArray[] = +{ + { "non-primitive", mso_sptMin }, + { "rectangle", mso_sptRectangle }, + { "round-rectangle", mso_sptRoundRectangle }, + { "ellipse", mso_sptEllipse }, + { "diamond", mso_sptDiamond }, + { "isosceles-triangle", mso_sptIsocelesTriangle }, + { "right-triangle", mso_sptRightTriangle }, + { "parallelogram", mso_sptParallelogram }, + { "trapezoid", mso_sptTrapezoid }, + { "hexagon", mso_sptHexagon }, + { "octagon", mso_sptOctagon }, + { "cross", mso_sptPlus }, + { "star5", mso_sptStar }, + { "right-arrow", mso_sptArrow }, + { "mso-spt14", mso_sptThickArrow }, + { "pentagon-right", mso_sptHomePlate }, + { "cube", mso_sptCube }, + { "mso-spt17", mso_sptBalloon }, + { "mso-spt18", mso_sptSeal }, + { "mso-spt19", mso_sptArc }, + { "mso-spt20", mso_sptLine }, + { "mso-spt21", mso_sptPlaque }, + { "can", mso_sptCan }, + { "ring", mso_sptDonut }, + { "mso-spt24", mso_sptTextSimple }, + { "mso-spt25", mso_sptTextOctagon }, + { "mso-spt26", mso_sptTextHexagon }, + { "mso-spt27", mso_sptTextCurve }, + { "mso-spt28", mso_sptTextWave }, + { "mso-spt29", mso_sptTextRing }, + { "mso-spt30", mso_sptTextOnCurve }, + { "mso-spt31", mso_sptTextOnRing }, + { "mso-spt32", mso_sptStraightConnector1 }, + { "mso-spt33", mso_sptBentConnector2 }, + { "mso-spt34", mso_sptBentConnector3 }, + { "mso-spt35", mso_sptBentConnector4 }, + { "mso-spt36", mso_sptBentConnector5 }, + { "mso-spt37", mso_sptCurvedConnector2 }, + { "mso-spt38", mso_sptCurvedConnector3 }, + { "mso-spt39", mso_sptCurvedConnector4 }, + { "mso-spt40", mso_sptCurvedConnector5 }, + { "mso-spt41", mso_sptCallout1 }, + { "mso-spt42", mso_sptCallout2 }, + { "mso-spt43", mso_sptCallout3 }, + { "mso-spt44", mso_sptAccentCallout1 }, + { "mso-spt45", mso_sptAccentCallout2 }, + { "mso-spt46", mso_sptAccentCallout3 }, + { "line-callout-1", mso_sptBorderCallout1 }, + { "line-callout-2", mso_sptBorderCallout2 }, + { "mso-spt49", mso_sptBorderCallout3 }, + { "mso-spt50", mso_sptAccentBorderCallout1 }, + { "mso-spt51", mso_sptAccentBorderCallout2 }, + { "mso-spt52", mso_sptAccentBorderCallout3 }, + { "mso-spt53", mso_sptRibbon }, + { "mso-spt54", mso_sptRibbon2 }, + { "chevron", mso_sptChevron }, + { "pentagon", mso_sptPentagon }, + { "forbidden", mso_sptNoSmoking }, + { "star8", mso_sptSeal8 }, + { "mso-spt59", mso_sptSeal16 }, + { "mso-spt60", mso_sptSeal32 }, + { "rectangular-callout", mso_sptWedgeRectCallout }, + { "round-rectangular-callout", mso_sptWedgeRRectCallout }, + { "round-callout", mso_sptWedgeEllipseCallout }, + { "mso-spt64", mso_sptWave }, + { "paper", mso_sptFoldedCorner }, + { "left-arrow", mso_sptLeftArrow }, + { "down-arrow", mso_sptDownArrow }, + { "up-arrow", mso_sptUpArrow }, + { "left-right-arrow", mso_sptLeftRightArrow }, + { "up-down-arrow", mso_sptUpDownArrow }, + { "mso-spt71", mso_sptIrregularSeal1 }, + { "bang", mso_sptIrregularSeal2 }, + { "lightning", mso_sptLightningBolt }, + { "heart", mso_sptHeart }, + { "mso-spt75", mso_sptPictureFrame }, + { "quad-arrow", mso_sptQuadArrow }, + { "left-arrow-callout", mso_sptLeftArrowCallout }, + { "right-arrow-callout", mso_sptRightArrowCallout }, + { "up-arrow-callout", mso_sptUpArrowCallout }, + { "down-arrow-callout", mso_sptDownArrowCallout }, + { "left-right-arrow-callout", mso_sptLeftRightArrowCallout }, + { "up-down-arrow-callout", mso_sptUpDownArrowCallout }, + { "quad-arrow-callout", mso_sptQuadArrowCallout }, + { "quad-bevel", mso_sptBevel }, + { "left-bracket", mso_sptLeftBracket }, + { "right-bracket", mso_sptRightBracket }, + { "left-brace", mso_sptLeftBrace }, + { "right-brace", mso_sptRightBrace }, + { "mso-spt89", mso_sptLeftUpArrow }, + { "mso-spt90", mso_sptBentUpArrow }, + { "mso-spt91", mso_sptBentArrow }, + { "star24", mso_sptSeal24 }, + { "striped-right-arrow", mso_sptStripedRightArrow }, + { "notched-right-arrow", mso_sptNotchedRightArrow }, + { "block-arc", mso_sptBlockArc }, + { "smiley", mso_sptSmileyFace }, + { "vertical-scroll", mso_sptVerticalScroll }, + { "horizontal-scroll", mso_sptHorizontalScroll }, + { "circular-arrow", mso_sptCircularArrow }, + { "mso-spt100", mso_sptNotchedCircularArrow }, + { "mso-spt101", mso_sptUturnArrow }, + { "mso-spt102", mso_sptCurvedRightArrow }, + { "mso-spt103", mso_sptCurvedLeftArrow }, + { "mso-spt104", mso_sptCurvedUpArrow }, + { "mso-spt105", mso_sptCurvedDownArrow }, + { "cloud-callout", mso_sptCloudCallout }, + { "mso-spt107", mso_sptEllipseRibbon }, + { "mso-spt108", mso_sptEllipseRibbon2 }, + { "flowchart-process", mso_sptFlowChartProcess }, + { "flowchart-decision", mso_sptFlowChartDecision }, + { "flowchart-data", mso_sptFlowChartInputOutput }, + { "flowchart-predefined-process", mso_sptFlowChartPredefinedProcess }, + { "flowchart-internal-storage", mso_sptFlowChartInternalStorage }, + { "flowchart-document", mso_sptFlowChartDocument }, + { "flowchart-multidocument", mso_sptFlowChartMultidocument }, + { "flowchart-terminator", mso_sptFlowChartTerminator }, + { "flowchart-preparation", mso_sptFlowChartPreparation }, + { "flowchart-manual-input", mso_sptFlowChartManualInput }, + { "flowchart-manual-operation", mso_sptFlowChartManualOperation }, + { "flowchart-connector", mso_sptFlowChartConnector }, + { "flowchart-card", mso_sptFlowChartPunchedCard }, + { "flowchart-punched-tape", mso_sptFlowChartPunchedTape }, + { "flowchart-summing-junction", mso_sptFlowChartSummingJunction }, + { "flowchart-or", mso_sptFlowChartOr }, + { "flowchart-collate", mso_sptFlowChartCollate }, + { "flowchart-sort", mso_sptFlowChartSort }, + { "flowchart-extract", mso_sptFlowChartExtract }, + { "flowchart-merge", mso_sptFlowChartMerge }, + { "mso-spt129", mso_sptFlowChartOfflineStorage }, + { "flowchart-stored-data", mso_sptFlowChartOnlineStorage }, + { "flowchart-sequential-access", mso_sptFlowChartMagneticTape }, + { "flowchart-magnetic-disk", mso_sptFlowChartMagneticDisk }, + { "flowchart-direct-access-storage", mso_sptFlowChartMagneticDrum }, + { "flowchart-display", mso_sptFlowChartDisplay }, + { "flowchart-delay", mso_sptFlowChartDelay }, + { "fontwork-plain-text", mso_sptTextPlainText }, + { "fontwork-stop", mso_sptTextStop }, + { "fontwork-triangle-up", mso_sptTextTriangle }, + { "fontwork-triangle-down", mso_sptTextTriangleInverted }, + { "fontwork-chevron-up", mso_sptTextChevron }, + { "fontwork-chevron-down", mso_sptTextChevronInverted }, + { "mso-spt142", mso_sptTextRingInside }, + { "mso-spt143", mso_sptTextRingOutside }, + { "fontwork-arch-up-curve", mso_sptTextArchUpCurve }, + { "fontwork-arch-down-curve", mso_sptTextArchDownCurve }, + { "fontwork-circle-curve", mso_sptTextCircleCurve }, + { "fontwork-open-circle-curve", mso_sptTextButtonCurve }, + { "fontwork-arch-up-pour", mso_sptTextArchUpPour }, + { "fontwork-arch-down-pour", mso_sptTextArchDownPour }, + { "fontwork-circle-pour", mso_sptTextCirclePour }, + { "fontwork-open-circle-pour", mso_sptTextButtonPour }, + { "fontwork-curve-up", mso_sptTextCurveUp }, + { "fontwork-curve-down", mso_sptTextCurveDown }, + { "fontwork-fade-up-and-right", mso_sptTextCascadeUp }, + { "fontwork-fade-up-and-left", mso_sptTextCascadeDown }, + { "fontwork-wave", mso_sptTextWave1 }, + { "mso-spt157", mso_sptTextWave2 }, + { "mso-spt158", mso_sptTextWave3 }, + { "mso-spt159", mso_sptTextWave4 }, + { "fontwork-inflate", mso_sptTextInflate }, + { "mso-spt161", mso_sptTextDeflate }, + { "mso-spt162", mso_sptTextInflateBottom }, + { "mso-spt163", mso_sptTextDeflateBottom }, + { "mso-spt164", mso_sptTextInflateTop }, + { "mso-spt165", mso_sptTextDeflateTop }, + { "mso-spt166", mso_sptTextDeflateInflate }, + { "mso-spt167", mso_sptTextDeflateInflateDeflate }, + { "fontwork-fade-right", mso_sptTextFadeRight }, + { "fontwork-fade-left", mso_sptTextFadeLeft }, + { "fontwork-fade-up", mso_sptTextFadeUp }, + { "fontwork-fade-down", mso_sptTextFadeDown }, + { "fontwork-slant-up", mso_sptTextSlantUp }, + { "fontwork-slant-down", mso_sptTextSlantDown }, + { "mso-spt174", mso_sptTextCanUp }, + { "mso-spt175", mso_sptTextCanDown }, + { "flowchart-alternate-process", mso_sptFlowChartAlternateProcess }, + { "flowchart-off-page-connector", mso_sptFlowChartOffpageConnector }, + { "mso-spt178", mso_sptCallout90 }, + { "mso-spt179", mso_sptAccentCallout90 }, + { "mso-spt180", mso_sptBorderCallout90 }, + { "line-callout-3", mso_sptAccentBorderCallout90 }, + { "mso-spt182", mso_sptLeftRightUpArrow }, + { "sun", mso_sptSun }, + { "moon", mso_sptMoon }, + { "bracket-pair", mso_sptBracketPair }, + { "brace-pair", mso_sptBracePair }, + { "star4", mso_sptSeal4 }, + { "mso-spt188", mso_sptDoubleWave }, + { "mso-spt189", mso_sptActionButtonBlank }, + { "mso-spt190", mso_sptActionButtonHome }, + { "mso-spt191", mso_sptActionButtonHelp }, + { "mso-spt192", mso_sptActionButtonInformation }, + { "mso-spt193", mso_sptActionButtonForwardNext }, + { "mso-spt194", mso_sptActionButtonBackPrevious }, + { "mso-spt195", mso_sptActionButtonEnd }, + { "mso-spt196", mso_sptActionButtonBeginning }, + { "mso-spt197", mso_sptActionButtonReturn }, + { "mso-spt198", mso_sptActionButtonDocument }, + { "mso-spt199", mso_sptActionButtonSound }, + { "mso-spt200", mso_sptActionButtonMovie }, + { "mso-spt201", mso_sptHostControl }, + { "mso-spt202", mso_sptTextBox }, + { "teardrop", mso_sptTearDrop }, + { "ooxml-rect", mso_sptRectangle } +}; + + // gallery: quadrat + // gallery: round-quadrat + // gallery: circle + // gallery: circle-pie + // gallery: frame + // gallery: flower + // gallery: cloud + // gallery: puzzle + // gallery: octagon-bevel + // gallery: diamond-bevel + // gallery: up-right-arrow + // gallery: up-right-down-arrow + // gallery: corner-right-arrow + // gallery: split-arrow + // gallery: up-right-arrow-callout + // gallery: split-round-arrow + // gallery: s-sharped-arrow + // Gallery: star6 + // Gallery: star12 + // Gallery: concave-star6 + // Gallery: signet + // Gallery: doorplate + // gallery: fontwork-arch-left-curve + // gallery: fontwork-arch-right-curve + // gallery: fontwork-arch-left-pour + // gallery: fontwork-arch-right-pour + + +typedef std::unordered_map< OUString, MSO_SPT> TypeNameHashMap; + +static const TypeNameHashMap& GetTypeNameHashMap() +{ + static TypeNameHashMap aMap = []() + { + TypeNameHashMap map; + for (auto const & i : pNameTypeTableArray) + map[OUString::createFromAscii(i.pS)] = i.pE; + return map; + }(); + return aMap; +} + + +MSO_SPT EnhancedCustomShapeTypeNames::Get( const OUString& rShapeType ) +{ + const TypeNameHashMap & rTypeMap = GetTypeNameHashMap(); + MSO_SPT eRetValue = mso_sptNil; + auto aHashIter = rTypeMap.find( rShapeType ); + if ( aHashIter != rTypeMap.end() ) + eRetValue = (*aHashIter).second; + return eRetValue; +} + +OUString EnhancedCustomShapeTypeNames::Get( const MSO_SPT eShapeType ) +{ + return (eShapeType <= mso_sptTextBox && eShapeType >= mso_sptMin) + ? OUString::createFromAscii( pNameTypeTableArray[ eShapeType ].pS ) + : OUString(); +} + +namespace { + +struct ACCNameTypeTable +{ + const char* pS; + const char* pE; +}; + +} + +const ACCNameTypeTable pACCNameTypeTableArray[] = +{ + { "non-primitive", "Non Primitive Shape" }, + { "rectangle", "Rectangle" }, + { "round-rectangle", "Rounded Rectangle" }, + { "ellipse", "Ellipse" }, + { "diamond", "Diamond" }, + { "isosceles-triangle", "Triangle" }, + { "right-triangle", "Right Triangle" }, + { "parallelogram", "Parallelogram" }, + { "trapezoid", "Trapezoid" }, + { "hexagon", "Hexagon" }, + { "octagon", "Octagon" }, + { "cross", "Cross" }, + { "star5", "5-Point Star" }, + { "right-arrow", "Right Arrow" }, + //{ "mso-spt14", mso_sptThickArrow }, + { "pentagon-right", "Pentagon" }, + { "cube", "Cube" }, + { "mso-spt21", "Doorplate" }, + /*{ "mso-spt17", mso_sptBalloon }, + { "mso-spt18", mso_sptSeal }, + { "mso-spt19", mso_sptArc }, + { "mso-spt20", mso_sptLine }, + { "mso-spt21", mso_sptPlaque }, + { "can", mso_sptCan },*/ + { "ring", "Ring" }, + /*{ "mso-spt24", mso_sptTextSimple }, + { "mso-spt25", mso_sptTextOctagon }, + { "mso-spt26", mso_sptTextHexagon }, + { "mso-spt27", mso_sptTextCurve }, + { "mso-spt28", mso_sptTextWave }, + { "mso-spt29", mso_sptTextRing }, + { "mso-spt30", mso_sptTextOnCurve }, + { "mso-spt31", mso_sptTextOnRing }, + { "mso-spt32", mso_sptStraightConnector1 }, + { "mso-spt33", mso_sptBentConnector2 }, + { "mso-spt34", mso_sptBentConnector3 }, + { "mso-spt35", mso_sptBentConnector4 }, + { "mso-spt36", mso_sptBentConnector5 }, + { "mso-spt37", mso_sptCurvedConnector2 }, + { "mso-spt38", mso_sptCurvedConnector3 }, + { "mso-spt39", mso_sptCurvedConnector4 }, + { "mso-spt40", mso_sptCurvedConnector5 }, + { "mso-spt41", mso_sptCallout1 }, + { "mso-spt42", mso_sptCallout2 }, + { "mso-spt43", mso_sptCallout3 }, + { "mso-spt44", mso_sptAccentCallout1 }, + { "mso-spt45", mso_sptAccentCallout2 }, + { "mso-spt46", mso_sptAccentCallout3 },*/ + { "line-callout-1", "Line Callout 1" }, + { "line-callout-2", "Line Callout 2" }, + /*{ "mso-spt49", mso_sptBorderCallout3 }, + { "mso-spt50", mso_sptAccentBorderCallout1 }, + { "mso-spt51", mso_sptAccentBorderCallout2 }, + { "mso-spt52", mso_sptAccentBorderCallout3 }, + { "mso-spt53", mso_sptRibbon }, + { "mso-spt54", mso_sptRibbon2 },*/ + { "chevron", "Chevron" }, + { "pentagon", "Regular Pentagon" }, + { "forbidden", "'No' Symbol" }, + { "star8", "8-Point Star" }, + /*{ "mso-spt59", mso_sptSeal16 }, + { "mso-spt60", mso_sptSeal32 },*/ + { "rectangular-callout", "Rectangular Callout" }, + { "round-rectangular-callout", "Rounded Rectangular Callout" }, + { "round-callout", "Round Callout" }, + //{ "mso-spt64", mso_sptWave }, + { "paper", "Folded Corner" }, + { "left-arrow", "Left Arrow" }, + { "down-arrow", "Down Arrow" }, + { "up-arrow", "Up Arrow" }, + { "left-right-arrow", "Left and Right Arrow" }, + { "up-down-arrow", "Up and Down Arrow" }, + //{ "mso-spt71", mso_sptIrregularSeal1 }, + { "bang", "Explosion" }, + { "lightning", "Lighting Bolt" }, + { "heart", "Heart" }, + //{ "mso-spt75", mso_sptPictureFrame }, + { "quad-arrow", "4-Way Arrow" }, + { "left-arrow-callout", "Left Arrow Callout" }, + { "right-arrow-callout", "Right Arrow Callout" }, + { "up-arrow-callout", "Up Arrow Callout" }, + { "down-arrow-callout", "Down Arrow Callout" }, + { "left-right-arrow-callout", "Left and Right Arrow Callout" }, + { "up-down-arrow-callout", "Up and Down Arrow Callout" }, + { "quad-arrow-callout", "4-Way Arrow Callout" }, + { "quad-bevel", "Square Bevel" }, + { "left-bracket", "Left Bracket" }, + { "right-bracket", "Right Bracket" }, + { "left-brace", "Left Brace" }, + { "right-brace", "Right Brace" }, + { "mso-spt89", "Up and Left Arrow" }, + //{ "mso-spt90", mso_sptBentUpArrow }, + //{ "mso-spt91", mso_sptBentArrow }, + { "star24", "24-Point Star" }, + { "striped-right-arrow", "Striped Right Arrow" }, + { "notched-right-arrow", "Notched Right Arrow" }, + { "block-arc", "Block Arc" }, + { "smiley", "Smile Face" }, + { "vertical-scroll", "Vertical Scroll" }, + { "horizontal-scroll", "Horizontal Scroll" }, + { "circular-arrow", "Circular Arrow" }, + { "mso-spt100", "Notched Circular Arrow" }, + /* + { "mso-spt101", mso_sptUturnArrow }, + { "mso-spt102", mso_sptCurvedRightArrow }, + { "mso-spt103", mso_sptCurvedLeftArrow }, + { "mso-spt104", mso_sptCurvedUpArrow }, + { "mso-spt105", mso_sptCurvedDownArrow },*/ + { "cloud-callout", "Cloud Callout" }, + /*{ "mso-spt107", mso_sptEllipseRibbon }, + { "mso-spt108", mso_sptEllipseRibbon2 },*/ + { "flowchart-process", "Flowchart:Process" }, + { "flowchart-decision", "Flowchart:Decision" }, + { "flowchart-data", "Flowchart:Data" }, + { "flowchart-predefined-process", "Flowchart:Predefined Process" }, + { "flowchart-internal-storage", "Flowchart:Internal Storage" }, + { "flowchart-document", "Flowchart:Document" }, + { "flowchart-multidocument", "Flowchart:Multidocument" }, + { "flowchart-terminator", "Flowchart:Terminator" }, + { "flowchart-preparation", "Flowchart:Preparation" }, + { "flowchart-manual-input", "Flowchart:Manual Input" }, + { "flowchart-manual-operation", "Flowchart:Manual Operation" }, + { "flowchart-connector", "Flowchart:Connector" }, + { "flowchart-card", "Flowchart:Card" }, + { "flowchart-punched-tape", "Flowchart:Punched Tape" }, + { "flowchart-summing-junction", "Flowchart:Summing Junction" }, + { "flowchart-or", "Flowchart:Or" }, + { "flowchart-collate", "Flowchart:Collate" }, + { "flowchart-sort", "Flowchart:Sort" }, + { "flowchart-extract", "Flowchart:Extract" }, + { "flowchart-merge", "Flowchart:Merge" }, + //{ "mso-spt129", mso_sptFlowChartOfflineStorage }, + { "flowchart-stored-data", "Flowchart:Stored Data" }, + { "flowchart-sequential-access", "drawingbar.fc.25=Flowchart:Sequential Access" }, + { "flowchart-magnetic-disk", "Flowchart:Magnetic Disk" }, + { "flowchart-direct-access-storage", "Flowchart:Direct Access Storage" }, + { "flowchart-display", "Flowchart:Display" }, + { "flowchart-delay", "Flowchart:Delay" }, + /*{ "fontwork-plain-text", mso_sptTextPlainText }, + { "fontwork-stop", mso_sptTextStop }, + { "fontwork-triangle-up", mso_sptTextTriangle }, + { "fontwork-triangle-down", mso_sptTextTriangleInverted }, + { "fontwork-chevron-up", mso_sptTextChevron }, + { "fontwork-chevron-down", mso_sptTextChevronInverted }, + { "mso-spt142", mso_sptTextRingInside }, + { "mso-spt143", mso_sptTextRingOutside }, + { "fontwork-arch-up-curve", mso_sptTextArchUpCurve }, + { "fontwork-arch-down-curve", mso_sptTextArchDownCurve }, + { "fontwork-circle-curve", mso_sptTextCircleCurve }, + { "fontwork-open-circle-curve", mso_sptTextButtonCurve }, + { "fontwork-arch-up-pour", mso_sptTextArchUpPour }, + { "fontwork-arch-down-pour", mso_sptTextArchDownPour }, + { "fontwork-circle-pour", mso_sptTextCirclePour }, + { "fontwork-open-circle-pour", mso_sptTextButtonPour }, + { "fontwork-curve-up", mso_sptTextCurveUp }, + { "fontwork-curve-down", mso_sptTextCurveDown }, + { "fontwork-fade-up-and-right", mso_sptTextCascadeUp }, + { "fontwork-fade-up-and-left", mso_sptTextCascadeDown }, + { "fontwork-wave", mso_sptTextWave1 }, + { "mso-spt157", mso_sptTextWave2 }, + { "mso-spt158", mso_sptTextWave3 }, + { "mso-spt159", mso_sptTextWave4 }, + { "fontwork-inflate", mso_sptTextInflate }, + { "mso-spt161", mso_sptTextDeflate }, + { "mso-spt162", mso_sptTextInflateBottom }, + { "mso-spt163", mso_sptTextDeflateBottom }, + { "mso-spt164", mso_sptTextInflateTop }, + { "mso-spt165", mso_sptTextDeflateTop }, + { "mso-spt166", mso_sptTextDeflateInflate }, + { "mso-spt167", mso_sptTextDeflateInflateDeflate }, + { "fontwork-fade-right", mso_sptTextFadeRight }, + { "fontwork-fade-left", mso_sptTextFadeLeft }, + { "fontwork-fade-up", mso_sptTextFadeUp }, + { "fontwork-fade-down", mso_sptTextFadeDown }, + { "fontwork-slant-up", mso_sptTextSlantUp }, + { "fontwork-slant-down", mso_sptTextSlantDown }, + { "mso-spt174", mso_sptTextCanUp }, + { "mso-spt175", mso_sptTextCanDown },*/ + { "flowchart-alternate-process", "Flowchart:Alternate Process " }, + { "flowchart-off-page-connector", "Flowchart:Off-page Connector" }, + /*{ "mso-spt178", mso_sptCallout90 }, + { "mso-spt179", mso_sptAccentCallout90 }, + { "mso-spt180", mso_sptBorderCallout90 },*/ + { "line-callout-3", "Line Callout 3" }, + //{ "mso-spt182", mso_sptLeftRightUpArrow }, + { "sun", "Sun" }, + { "moon", "Moon" }, + { "bracket-pair", "Double Bracket" }, + { "brace-pair", "Double Brace" }, + { "star4", "4-Point Star" }, + /*{ "mso-spt188", mso_sptDoubleWave }, + { "mso-spt189", mso_sptActionButtonBlank }, + { "mso-spt190", mso_sptActionButtonHome }, + { "mso-spt191", mso_sptActionButtonHelp }, + { "mso-spt192", mso_sptActionButtonInformation }, + { "mso-spt193", mso_sptActionButtonForwardNext }, + { "mso-spt194", mso_sptActionButtonBackPrevious }, + { "mso-spt195", mso_sptActionButtonEnd }, + { "mso-spt196", mso_sptActionButtonBeginning }, + { "mso-spt197", mso_sptActionButtonReturn }, + { "mso-spt198", mso_sptActionButtonDocument }, + { "mso-spt199", mso_sptActionButtonSound }, + { "mso-spt200", mso_sptActionButtonMovie }, + { "mso-spt201", mso_sptHostControl }, + { "mso-spt202", mso_sptTextBox },*/ + { "frame", "Frame" }, + { "col-60da8460", "Octagon Bevel" }, + { "col-502ad400", "Diamond Bevel" } +}; + +typedef std::unordered_map<OUString, OUString> TypeACCNameHashMap; + +static const TypeACCNameHashMap& GetACCHashMap() +{ + static TypeACCNameHashMap aMap = []() + { + TypeACCNameHashMap map; + for (auto const & i : pACCNameTypeTableArray) + map[OUString::createFromAscii(i.pS)] = OUString::createFromAscii(i.pE); + return map; + }(); + return aMap; +} + +const OUString & EnhancedCustomShapeTypeNames::GetAccName( const OUString& rShapeType ) +{ + static const OUString EMPTY; + const TypeACCNameHashMap& rACCMap = GetACCHashMap(); + auto aHashIter = rACCMap.find( rShapeType ); + if ( aHashIter != rACCMap.end() ) + return aHashIter->second; + return EMPTY; +} + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |