20#include <config_folders.h>
21#include <rtl/bootstrap.hxx>
27#include <oox/token/tokens.hxx>
29#include <rtl/strbuf.hxx>
30#include <rtl/ustring.hxx>
46#include <com/sun/star/beans/XPropertySet.hpp>
47#include <com/sun/star/beans/XPropertySetInfo.hpp>
48#include <com/sun/star/drawing/XShape.hpp>
49#include <com/sun/star/text/HoriOrientation.hpp>
50#include <com/sun/star/text/VertOrientation.hpp>
51#include <com/sun/star/text/RelOrientation.hpp>
52#include <com/sun/star/text/WritingMode2.hpp>
53#include <com/sun/star/text/XTextFrame.hpp>
66 , m_pSerializer(
std::move( pSerializer ))
67 , m_pTextExport( pTextExport )
73 , m_pSdrObject( nullptr )
78 , m_bSkipwzName( false )
79 , m_bUseHashMarkForType( false )
80 , m_bOverrideShapeIdGeneration( false )
81 , m_nShapeIDCounter( 0 )
138 OStringBuffer aStyle( 200 );
143 if ( rShapeName.getLength() )
144 pAttrList->add( XML_alt, rShapeName );
146 bool rbAbsolutePos =
true;
149 if (!rEditAs.isEmpty())
151 pAttrList->add(XML_editas, rEditAs);
152 rbAbsolutePos =
false;
159 if ( !aStyle.isEmpty() )
160 pAttrList->add( XML_style, aStyle.makeStringAndClear() );
165 pAttrList->add( XML_coordorigin,
166 OString::number( pRect->
Left() ) +
"," + OString::number( pRect->
Top() ) );
168 pAttrList->add( XML_coordsize,
169 OString::number( pRect->
Right() - pRect->
Left() ) +
"," +
170 OString::number( pRect->
Bottom() - pRect->
Top() ) );
173 m_pSerializer->startElementNS( XML_v, XML_group, pAttrList );
213 if (rStr.empty() )
return false;
221 if(bOverrideShapeIdGen)
223 assert(!sShapeIDPrefix.isEmpty());
235 const char *pArrowHead =
nullptr;
247 pAttrList->
add( nElement, pArrowHead );
255 const char *pArrowLength =
nullptr;
264 pAttrList->
add( nElement, pArrowLength );
272 const char *pArrowWidth =
nullptr;
281 pAttrList->
add( nElement, pArrowWidth );
289 pAttrList->
add( nElement, bValue?
"t":
"f" );
294 SAL_WARN_IF( nColor & 0xFF000000 ,
"oox.vml" ,
"TODO: this is not a RGB value!");
296 if ( !pAttrList || ( nColor & 0xFF000000 ) )
299 nColor = ( ( nColor & 0xFF ) << 16 ) + ( nColor & 0xFF00 ) + ( ( nColor & 0xFF0000 ) >> 16 );
301 const char *pColor =
nullptr;
305 case 0x000000: pColor =
"black";
break;
306 case 0xC0C0C0: pColor =
"silver";
break;
307 case 0x808080: pColor =
"gray";
break;
308 case 0xFFFFFF: pColor =
"white";
break;
309 case 0x800000: pColor =
"maroon";
break;
310 case 0xFF0000: pColor =
"red";
break;
311 case 0x800080: pColor =
"purple";
break;
312 case 0xFF00FF: pColor =
"fuchsia";
break;
313 case 0x008000: pColor =
"green";
break;
314 case 0x00FF00: pColor =
"lime";
break;
315 case 0x808000: pColor =
"olive";
break;
316 case 0xFFFF00: pColor =
"yellow";
break;
317 case 0x000080: pColor =
"navy";
break;
318 case 0x0000FF: pColor =
"blue";
break;
319 case 0x008080: pColor =
"teal";
break;
320 case 0x00FFFF: pColor =
"aqua";
break;
323 snprintf( pRgbColor,
sizeof( pRgbColor ),
"#%06x",
static_cast< unsigned int >( nColor ) );
329 pAttrList->
add( nElement, pColor );
337 pAttrList->
add( nElement, OString::number(
nValue ).getStr() );
342 sal_uInt16 nRet = *pVal++;
343 nRet += ( *pVal++ ) << 8;
350 if ( ( nPointSize == 0xfff0 ) || ( nPointSize == 4 ) )
352 sal_uInt16 nUnsigned = *pVal++;
353 nUnsigned += ( *pVal++ ) << 8;
355 nRet = sal_Int16( nUnsigned );
357 else if ( nPointSize == 8 )
359 sal_uInt32 nUnsigned = *pVal++;
360 nUnsigned += ( *pVal++ ) << 8;
361 nUnsigned += ( *pVal++ ) << 16;
362 nUnsigned += ( *pVal++ ) << 24;
394 nPaddingY += pItem->GetValue();
408 bool bAlreadyWritten[ 0xFFF ] = {};
410 for (
auto const& opt : rOpts)
412 sal_uInt16
nId = ( opt.nPropId & 0x0FFF );
414 if ( bAlreadyWritten[
nId ] )
421 const char *pWrapType =
nullptr;
422 switch ( opt.nPropValue )
442 char const* pValue(
nullptr);
443 switch (opt.nPropValue)
455 pValue =
"top-center";
458 pValue =
"middle-center";
461 pValue =
"bottom-center";
464 pValue =
"top-baseline";
467 pValue =
"bottom-baseline";
470 pValue =
"top-center-baseline";
473 pValue =
"bottom-center-baseline";
485 switch (opt.nPropValue)
507 sal_uInt32 nLeft = 0, nTop = 0;
511 nLeft = opt.nPropValue;
516 nTop = opt.nPropValue;
519 if(nTop!=0 && nLeft!=0)
521 OString::number( nLeft ) +
"," + OString::number( nTop ) );
531 sal_uInt32 nLeft = 0, nRight = 0, nTop = 0, nBottom = 0;
537 nRight = opt.nPropValue;
542 nBottom = opt.nPropValue;
546 if(nBottom!=0 && nRight!=0 )
548 OString::number( nRight - nLeft ) +
"," + OString::number( nBottom - nTop ) );
565 OStringBuffer aPath( 512 );
567 sal_uInt16 nPointSize = aVertices.
nProp[4] + ( aVertices.
nProp[5] << 8 );
573 for ( ; nSegments; --nSegments )
580 unsigned char nSegmentType = (nSeg & 0xE000) >> 13;
581 unsigned short nSegmentCount = nSeg & 0x03FF;
583 switch (nSegmentType)
589 if (nX >= 0 && nY >= 0 )
590 aPath.append(
"m" + OString::number( nX ) +
"," + OString::number( nY ) );
600 unsigned char nEscapeCode = (nSegmentCount & 0x1F00) >> 8;
601 unsigned char nVertexCount = nSegmentCount & 0x00FF;
602 pVerticesIt += nVertexCount;
607 aPath.append(
"nf" );
610 aPath.append(
"ns" );
617 for (
unsigned short i = 0;
i < nSegmentCount; ++
i)
621 aPath.append(
"l" + OString::number( nX ) +
"," + OString::number( nY ) );
625 for (
unsigned short i = 0;
i < nSegmentCount; ++
i)
633 aPath.append(
"c" + OString::number( nX1 ) +
"," + OString::number( nY1 ) +
"," +
634 OString::number( nX2 ) +
"," + OString::number( nY2 ) +
"," +
635 OString::number( nX3 ) +
"," + OString::number( nY3 ) );
648 SAL_WARN(
"oox",
"Invalid - should never be found");
652 OString pathString = aPath.makeStringAndClear();
653 if ( !pathString.isEmpty() && pathString !=
"xe" )
657 SAL_WARN(
"oox.vml",
"unhandled shape path, missing either pVertices or pSegmentInfo.");
672 = FastSerializerHelper::createAttrList();
674 bool imageData =
false;
681 = FastSerializerHelper::createAttrList();
682 pAttrListSignatureLine->add(XML_issignatureline,
"t");
685 pAttrListSignatureLine->add(
690 pAttrListSignatureLine->add(
691 FSNS(XML_o, XML_suggestedsigner),
696 pAttrListSignatureLine->add(
697 FSNS(XML_o, XML_suggestedsigner2),
702 pAttrListSignatureLine->add(
703 FSNS(XML_o, XML_suggestedsigneremail),
708 pAttrListSignatureLine->add(XML_signinginstructionsset,
"t");
709 pAttrListSignatureLine->add(
710 FSNS(XML_o, XML_signinginstructions),
713 pAttrListSignatureLine->add(
716 pAttrListSignatureLine->add(
721 XML_o, XML_signatureline,
722 pAttrListSignatureLine);
725 const uno::Reference<graphic::XGraphic>& xGraphic
729 pAttrList->add(
FSNS(XML_r, XML_id), aImageId);
736 int nHeaderSize = 25;
738 aStruct.
nProp.size() - nHeaderSize);
743 pAttrList->add(
FSNS(XML_r, XML_id), aImageId);
752 m_pSerializer->singleElementNS( XML_v, XML_imagedata, pAttrList );
757 const char *pFillType =
nullptr;
775 pAttrList->add(
XML_type, pFillType );
778 pAttrList->add( XML_on,
"false" );
788 pAttrList->add(XML_opacity, OString::number(
double((
nValue * 100) >> 16) / 100));
789 m_pSerializer->singleElementNS( XML_v, XML_fill, pAttrList );
824 const char *pDashStyle =
nullptr;
840 pAttrList->add( XML_dashstyle, pDashStyle );
863 const char *pJoinStyle =
nullptr;
871 pAttrList->add( XML_joinstyle, pJoinStyle );
876 const char *pEndCap =
nullptr;
884 pAttrList->add( XML_endcap, pEndCap );
887 m_pSerializer->singleElementNS( XML_v, XML_stroke, pAttrList );
903 if ( !opt.nPropValue )
910 bool bShadow =
false;
911 bool bObscured =
false;
914 bShadow = ((
nValue & 0x20002 ) == 0x20002 );
915 bObscured = ((
nValue & 0x10001 ) == 0x10001 );
921 impl_AddBool( pAttrList.get(), XML_obscured, bObscured );
926 m_pSerializer->singleElementNS( XML_v, XML_shadow, pAttrList );
940 if(!opt.nProp.empty())
942 aStream.
WriteBytes(opt.nProp.data(), opt.nProp.size());
949 m_pSerializer->singleElementNS(XML_v, XML_path, XML_textpathok,
"t");
952 pAttrList->add(XML_on,
"t");
953 pAttrList->add(XML_fitshape,
"t");
954 pAttrList->add(XML_string, aTextPathString);
962 aStyle +=
"font-family:\"" + aTextPathFont +
"\"";
967 float nSizeF =
static_cast<sal_Int32
>(nSize) / 65536.0;
968 OUString aSize = OUString::number(nSizeF);
969 aStyle +=
";font-size:" + aSize +
"pt";
972 sal_uInt32 nGtextFlags;
979 if ((nGtextFlags & 0x00200020) == 0x00200020)
980 aStyle +=
";font-weight:bold";
981 if ((nGtextFlags & 0x00100010) == 0x00100010)
982 aStyle +=
";font-style:italic";
983 if ((nGtextFlags & 0x00800080) == 0x00800080)
984 aStyle +=
";v-same-letter-heights:t";
992 sal_uInt32 nGtextSpacing;
994 aStyle +=
";v-text-spacing:" + OUString::number(nGtextSpacing) +
"f";
997 if (!aStyle.isEmpty())
998 pAttrList->add(XML_style, aStyle);
1001 pAttrList->add(XML_trim,
"t");
1003 m_pSerializer->singleElementNS(XML_v, XML_textpath, pAttrList);
1013 m_ShapeStyle.append(
";rotation:" + OString::number(
double(opt.nPropValue >> 16)));
1028 if(!opt.nProp.empty())
1030 aStream.
WriteBytes(opt.nProp.data(), opt.nProp.size());
1046#if OSL_DEBUG_LEVEL > 0
1047 const size_t opt_nProp_size(opt.nProp.size());
1048 SAL_WARN(
"oox.vml",
"TODO VMLExport::Commit(), unimplemented id: " <<
nId
1049 <<
", value: " << opt.nPropValue
1050 <<
", data: [" << opt_nProp_size <<
"]");
1051 if ( opt.nProp.size() )
1053 const sal_uInt8 *pIt = opt.nProp.data();
1055 buf.append(
" ( " );
1058 buf.append(
static_cast<sal_Int32
>(*pIt), 16 ).append(
' ');
1062 SAL_WARN(
"oox.vml", std::string_view(buf));
1077 return "shape_" + OString::number(
nId );
1105 OString aLeft, aTop, aRight, aBottom;
1109 const OString aPt(
"pt" );
1110 aLeft = OString::number(
double( rRectangle.
Left() ) / 20 ) + aPt;
1111 aTop = OString::number(
double( rRectangle.
Top() ) / 20 ) + aPt;
1112 aRight = OString::number(
double( rRectangle.
Right() ) / 20 ) + aPt;
1113 aBottom = OString::number(
double( rRectangle.
Bottom() ) / 20 ) + aPt;
1117 aLeft = OString::number( rRectangle.
Left() );
1118 aTop = OString::number( rRectangle.
Top() );
1119 aRight = OString::number( rRectangle.
Right() );
1120 aBottom = OString::number( rRectangle.
Bottom() );
1130 if ( !rBuffer.isEmpty() )
1131 rBuffer.append(
";" );
1135 rBuffer.append(
"position:absolute;" );
1140 rBuffer.append(
"width:" + OString::number(
double( rRectangle.
Right() - rRectangle.
Left() ) / 20 ) +
1141 "pt;height:" + OString::number(
double( rRectangle.
Bottom() - rRectangle.
Top() ) / 20 ) +
1146 rBuffer.append(
"margin-left:" + OString::number(
double( rRectangle.
Left() ) / 20 ) +
1147 "pt;margin-top:" + OString::number(
double( rRectangle.
Top() ) / 20 ) +
1148 "pt;width:" + OString::number(
double( rRectangle.
Right() - rRectangle.
Left() ) / 20 ) +
1149 "pt;height:" + OString::number(
double( rRectangle.
Bottom() - rRectangle.
Top() ) / 20 ) +
1154 rBuffer.append(
"left:" + OString::number( rRectangle.
Left() ) +
1155 ";top:" + OString::number( rRectangle.
Top() ) +
1156 ";width:" + OString::number( rRectangle.
Right() - rRectangle.
Left() ) +
1157 ";height:" + OString::number( rRectangle.
Bottom() - rRectangle.
Top() ) );
1170 std::vector<OString> aRet;
1172 OUString aPath(
"$BRAND_BASE_DIR/" LIBO_SHARE_FOLDER
"/filter/vml-shape-types");
1173 rtl::Bootstrap::expandMacros(aPath);
1176 SAL_WARN(
"oox",
"failed to open vml-shape-types");
1177 OStringBuffer aLine;
1178 bool bNotDone = aStream.
ReadLine(aLine);
1183 aRet.push_back(OString(aLine));
1184 bNotDone = aStream.
ReadLine(aLine);
1191 uno::Reference<beans::XPropertySet> xPropertySet(
const_cast<SdrObject*
>(pSdrObject)->getUnoShape(), uno::UNO_QUERY);
1192 if (!xPropertySet.is())
1194 uno::Reference<beans::XPropertySetInfo> xPropertySetInfo = xPropertySet->getPropertySetInfo();
1195 if (!xPropertySetInfo->hasPropertyByName(
"TextBox"))
1197 css::uno::Any aTextBox(xPropertySet->getPropertyValue(
"TextBox"));
1198 if (!aTextBox.hasValue())
1200 return aTextBox.get<
bool>();
1207 uno::Reference<beans::XPropertySet> xShape(
const_cast<SdrObject*
>(pSdrObject)->getUnoShape(), uno::UNO_QUERY);
1208 if (xShape->getPropertySetInfo()->hasPropertyByName(
"InteropGrabBag"))
1211 if (aInteropGrabBag.
find(
"AnchorId") != aInteropGrabBag.
end())
1212 aInteropGrabBag[
"AnchorId"] >>= aResult;
1227 std::string_view sShapeID,
const bool bIsPictureFrame )
1230 if ( !bIsPictureFrame )
1233 sShapeType = OString::Concat(
"<v:shapetype id=\"_x0000_t") + sShapeID +
1234 "\" coordsize=\"21600,21600\" o:spt=\"" + sShapeID +
1235 "\" path=\"m,l,21600l21600,21600l21600,xe\">\n"
1236 "<v:stroke joinstyle=\"miter\"/>\n"
1237 "<v:path shadowok=\"f\" o:extrusionok=\"f\" strokeok=\"f\" fillok=\"f\" o:connecttype=\"rect\"/>\n"
1238 "<o:lock v:ext=\"edit\" shapetype=\"t\"/>\n"
1243 sShapeType = OString::Concat(
"<v:shapetype id=\"_x0000_t") + sShapeID +
1244 "\" coordsize=\"21600,21600\" o:spt=\"" + sShapeID +
1245 "\" o:preferrelative=\"t\" path=\"m@4@5l@4@11@9@11@9@5xe\" filled=\"f\" stroked=\"f\">\n"
1246 "<v:stroke joinstyle=\"miter\"/>\n"
1248 "<v:f eqn=\"if lineDrawn pixelLineWidth 0\"/>\n"
1249 "<v:f eqn=\"sum @0 1 0\"/>\n"
1250 "<v:f eqn=\"sum 0 0 @1\"/>\n"
1251 "<v:f eqn=\"prod @2 1 2\"/>\n"
1252 "<v:f eqn=\"prod @3 21600 pixelWidth\"/>\n"
1253 "<v:f eqn=\"prod @3 21600 pixelHeight\"/>\n"
1254 "<v:f eqn=\"sum @0 0 1\"/>\n"
1255 "<v:f eqn=\"prod @6 1 2\"/>\n"
1256 "<v:f eqn=\"prod @7 21600 pixelWidth\"/>\n"
1257 "<v:f eqn=\"sum @8 21600 0\"/>\n"
1258 "<v:f eqn=\"prod @7 21600 pixelHeight\"/>\n"
1259 "<v:f eqn=\"sum @10 21600 0\"/>\n"
1261 "<v:path o:extrusionok=\"f\" gradientshapeok=\"t\" o:connecttype=\"rect\"/>\n"
1262 "<o:lock v:ext=\"edit\" aspectratio=\"t\"/>\n"
1273 sal_Int32 nShapeElement = -1;
1274 bool bReferToShapeType =
false;
1285 bReferToShapeType =
true;
1286 nShapeElement = XML_shape;
1296 bReferToShapeType =
true;
1297 nShapeElement = XML_shape;
1308 nShapeElement = XML_shape;
1315 bReferToShapeType =
true;
1325 nShapeElement = XML_rect;
1334 case text::HoriOrientation::LEFT:
1337 case text::HoriOrientation::CENTER:
1338 m_ShapeStyle.append(
";mso-position-horizontal:center");
1340 case text::HoriOrientation::RIGHT:
1343 case text::HoriOrientation::INSIDE:
1344 m_ShapeStyle.append(
";mso-position-horizontal:inside");
1346 case text::HoriOrientation::OUTSIDE:
1347 m_ShapeStyle.append(
";mso-position-horizontal:outside");
1350 case text::HoriOrientation::NONE:
1355 case text::RelOrientation::PAGE_PRINT_AREA:
1356 m_ShapeStyle.append(
";mso-position-horizontal-relative:margin");
1358 case text::RelOrientation::PAGE_FRAME:
1359 case text::RelOrientation::PAGE_LEFT:
1360 case text::RelOrientation::PAGE_RIGHT:
1361 m_ShapeStyle.append(
";mso-position-horizontal-relative:page");
1363 case text::RelOrientation::CHAR:
1364 m_ShapeStyle.append(
";mso-position-horizontal-relative:char");
1372 case text::VertOrientation::TOP:
1373 case text::VertOrientation::LINE_TOP:
1374 case text::VertOrientation::CHAR_TOP:
1377 case text::VertOrientation::CENTER:
1378 case text::VertOrientation::LINE_CENTER:
1381 case text::VertOrientation::BOTTOM:
1382 case text::VertOrientation::LINE_BOTTOM:
1383 case text::VertOrientation::CHAR_BOTTOM:
1387 case text::VertOrientation::NONE:
1392 case text::RelOrientation::PAGE_PRINT_AREA:
1393 m_ShapeStyle.append(
";mso-position-vertical-relative:margin");
1395 case text::RelOrientation::PAGE_FRAME:
1396 m_ShapeStyle.append(
";mso-position-vertical-relative:page");
1412 if (!sAnchorId.isEmpty())
1458 if (!textboxStyle.isEmpty())
1460 pTextboxAttrList->add(XML_style, textboxStyle);
1464 m_pSerializer->startElementNS(XML_v, XML_textbox, pTextboxAttrList);
1470 return nShapeElement;
1475 if ( nShapeElement < 0 )
1480 uno::Reference<drawing::XShape> xShape {
const_cast<SdrObject*
>(
m_pSdrObject)->getUnoShape(), uno::UNO_QUERY};
1481 uno::Reference<beans::XPropertySet> xPropertySet(xShape, uno::UNO_QUERY);
1482 uno::Reference<beans::XPropertySetInfo> xPropertySetInfo = xPropertySet->getPropertySetInfo();
1483 bool bBottomToTop =
false;
1484 if (xPropertySetInfo->hasPropertyByName(
"CustomShapeGeometry"))
1487 auto aAny = xPropertySet->getPropertyValue(
"WritingMode");
1488 sal_Int16 nWritingMode;
1489 if ((aAny >>= nWritingMode) && nWritingMode == text::WritingMode2::BT_LR)
1490 bBottomToTop =
true;
1500 uno::Reference<beans::XPropertySet> xPropSet(xTextFrame, uno::UNO_QUERY);
1501 auto aAny = xPropSet->getPropertyValue(
"WritingMode");
1502 sal_Int16 nWritingMode;
1503 if (aAny >>= nWritingMode)
1505 switch (nWritingMode)
1507 case text::WritingMode2::BT_LR:
1508 bBottomToTop =
true;
1518 pTextboxAttrList->add(XML_style,
"mso-layout-flow-alt:bottom-to-top");
1519 m_pSerializer->startElementNS(XML_v, XML_textbox, pTextboxAttrList);
1536 bool const bIsFollowingTextFlow,
1537 sal_Int16 eHOri, sal_Int16 eVOri, sal_Int16 eHRel, sal_Int16 eVRel,
1539 const bool bOOxmlExport, sal_uInt32
nId)
sal_uInt32 AddSdrObject(const SdrObject &rObj, bool ooxmlExport=false, sal_uInt32 nId=0)
virtual sal_uInt32 GenerateShapeId()
virtual void OpenContainer(sal_uInt16 nEscherContainer, int nRecInstance=0)
const OUString & GetEditAs() const
std::vector< sal_uInt16 > mRecTypes
virtual void CloseContainer()
bool GetOpt(sal_uInt16 nPropertyID, sal_uInt32 &rPropValue) const
const EscherProperties & GetOpts() const
static ErrCode Import(SvStream &rIStm, Graphic &rGraphic, ConvertDataFormat nFormat=ConvertDataFormat::Unknown)
css::uno::Reference< css::graphic::XGraphic > const & getSignatureLineUnsignedGraphic() const
bool isSignatureLine() const
bool isSignatureLineShowSignDate() const
const OUString & getSignatureLineSuggestedSignerTitle() const
const OUString & getSignatureLineSuggestedSignerName() const
const OUString & getSignatureLineId() const
const OUString & getSignatureLineSigningInstructions() const
bool isSignatureLineCanAddComment() const
const OUString & getSignatureLineSuggestedSignerEmail() const
const OUString & getHyperlink() const
virtual const OUString & GetName() const
virtual bool IsTextPath() const
const SfxItemSet & GetMergedItemSet() const
bool IsTextEditActive() const
virtual OutlinerParaObject * GetOutlinerParaObject() const override
std::optional< OutlinerParaObject > CreateEditOutlinerParaObject() const
const SfxPoolItem * GetItem(sal_uInt16 nWhich, bool bSearchInParent=true) const
std::size_t WriteBytes(const void *pData, std::size_t nSize)
bool ReadLine(OStringBuffer &rStr, sal_Int32 nMaxBytesToRead=0xFFFE)
sal_uInt64 Seek(sal_uInt64 nPos)
static OUString MSDFFReadZString(SvStream &rIn, sal_uInt32 nMaxLen, bool bUniCode)
iterator find(const OUString &rKey)
virtual css::uno::Reference< css::text::XTextFrame > GetUnoTextFrame(css::uno::Reference< css::drawing::XShape > xShape)=0
Get textbox which belongs to the shape.
OUString WriteImage(const Graphic &rGraphic, bool bRelPathToMedia=false)
If bRelPathToMedia is true add "../" to image folder path while adding the image relationship.
DMLTextExport * GetTextExport()
The application-specific text exporter callback, if there is one.
sal_uInt32 m_nShapeType
Remember the shape type.
OString m_sShapeId
Remember the generated shape id.
ShapeFlag m_nShapeFlags
Remember the shape flags.
static OString GetVMLShapeTypeDefinition(std::string_view sShapeID, const bool bIsPictureFrame)
virtual void EndShape(sal_Int32 nShapeElement)
End the shape.
OString ShapeIdString(sal_uInt32 nId)
Create an OString representing the id from a numerical id.
OString const & AddInlineSdrObject(const SdrObject &rObj, const bool bOOxmlExport)
::sax_fastparser::FSHelperPtr m_pSerializer
Fast serializer to output the data.
void AddShapeAttribute(sal_Int32 nAttribute, const OString &sValue)
Add an attribute to the generated <v:shape/> element.
virtual void AddSdrObjectVMLObject(const SdrObject &rObj) override
void AddFlipXY()
Add flip X and\or flip Y.
OStringBuffer m_TextboxStyle
style for textbox
virtual void CloseContainer() override
OString m_sShapeIDPrefix
Prefix for overridden shape id generation (used if m_bOverrideShapeIdGeneration is true)
void OverrideShapeIDGen(bool bOverrideShapeIdGeneration, const OString &sShapeIDPrefix=OString())
const SdrObject * m_pSdrObject
The object we're exporting.
virtual void AddShape(sal_uInt32 nShapeType, ShapeFlag nShapeFlags, sal_uInt32 nShapeId=0) override
std::vector< bool > m_aShapeTypeWritten
Remember which shape types we had already written.
virtual sal_uInt32 EnterGroup(const OUString &rShapeName, const tools::Rectangle *pBoundRect) override
sal_Int16 m_eHOri
Anchoring - Writer specific properties.
bool m_IsFollowingTextFlow
static bool IsWaterMarkShape(std::u16string_view rStr)
OString const & AddSdrObject(const SdrObject &rObj, bool const bIsFollowingTextFlow=false, sal_Int16 eHOri=-1, sal_Int16 eVOri=-1, sal_Int16 eHRel=-1, sal_Int16 eVRel=-1, sax_fastparser::FastAttributeList *pWrapAttrList=nullptr, const bool bOOxmlExport=false, sal_uInt32 nId=0)
Export the sdr object as VML.
virtual sal_uInt32 GenerateShapeId() override
Override shape ID generation when m_bOverrideShapeIdGeneration is set to true.
bool m_bUseHashMarkForType
Use '#' mark for type attribute (check Type Attribute of VML shape in OOXML documentation)
bool m_bOverrideShapeIdGeneration
There is a shapeid generation mechanism in EscherEx, but it does not seem to work so override the exi...
sal_uInt64 m_nShapeIDCounter
Counter for generating shape ids (used if m_bOverrideShapeIdGeneration is true)
virtual void OpenContainer(sal_uInt16 nEscherContainer, int nRecInstance=0) override
virtual sal_Int32 StartShape()
Start the shape for which we just collected the information.
bool m_bSkipwzName
It seems useless to write out an XML_ID attribute next to XML_id which defines the actual shape id.
void AddRectangleDimensions(OStringBuffer &rBuffer, const tools::Rectangle &rRectangle, bool rbAbsolutePos=true)
Add position and size to the OStringBuffer.
virtual void LeaveGroup() override
virtual ~VMLExport() override
OStringBuffer m_ShapeStyle
Remember style, the most important shape attribute ;-)
void SetFS(const ::sax_fastparser::FSHelperPtr &pSerializer)
VMLTextExport * m_pTextExport
Parent exporter, used for text callback.
rtl::Reference<::sax_fastparser::FastAttributeList > m_pShapeAttrList
Fill the shape attributes as they come.
void AddLineDimensions(const tools::Rectangle &rRectangle)
Add starting and ending point of a line to the m_pShapeAttrList.
rtl::Reference< sax_fastparser::FastAttributeList > m_pWrapAttrList
virtual void Commit(EscherPropertyContainer &rProps, const tools::Rectangle &rRect) override
Interface to be implemented by the parent exporter that knows how to handle shape text.
virtual void WriteOutliner(const OutlinerParaObject &rParaObj)=0
virtual oox::drawingml::DrawingML & GetDrawingML()=0
virtual void WriteVMLTextBox(css::uno::Reference< css::drawing::XShape > xShape)=0
Write the contents of the textbox that is associated to this shape in VML format.
void add(const FastAttributeList &)
#define ESCHER_Prop_lineColor
#define ESCHER_ShpInst_RoundRectangle
ESCHER_AnchorMiddleCentered
ESCHER_AnchorBottomBaseline
ESCHER_AnchorTopCenteredBaseline
ESCHER_AnchorBottomCenteredBaseline
ESCHER_AnchorBottomCentered
std::vector< EscherPropSortStruct > EscherProperties
#define ESCHER_ShpInst_COUNT
#define ESCHER_Prop_lineStartArrowWidth
#define ESCHER_Prop_fNoFillHitTest
#define ESCHER_ShpInst_HostControl
#define ESCHER_Prop_lineJoinStyle
#define ESCHER_Prop_fshadowObscured
#define ESCHER_Prop_geoRight
#define ESCHER_Prop_fNoLineDrawDash
#define ESCHER_Prop_wzName
#define ESCHER_Prop_gtextUNICODE
#define ESCHER_Prop_lineStartArrowhead
#define ESCHER_Prop_AnchorText
#define ESCHER_Prop_shadowColor
#define ESCHER_Prop_WrapText
ESCHER_LineMediumWidthArrow
#define ESCHER_Prop_lineStartArrowLength
ESCHER_LineMediumLenArrow
#define ESCHER_Prop_txflTextFlow
#define ESCHER_Prop_gtextSize
#define ESCHER_Prop_Rotation
#define ESCHER_ShpInst_NotPrimitive
#define ESCHER_Prop_geoLeft
#define ESCHER_Prop_gtextFont
#define ESCHER_Prop_lineEndCapStyle
ESCHER_LineLongDashDotDotGEL
ESCHER_LineLongDashDotGEL
#define ESCHER_Prop_lineWidth
#define ESCHER_Prop_pSegmentInfo
#define ESCHER_Prop_geoBottom
#define ESCHER_Prop_fillBackColor
#define ESCHER_ShpInst_Ellipse
#define ESCHER_Prop_fHidden
#define ESCHER_Prop_pVertices
#define ESCHER_Prop_fillBlip
#define ESCHER_ShpInst_Arc
#define ESCHER_Prop_lineEndArrowLength
#define ESCHER_Prop_lineEndArrowWidth
#define ESCHER_Prop_geoTop
#define ESCHER_ShpInst_Nil
#define ESCHER_ShpInst_Rectangle
#define ESCHER_Prop_fillType
#define ESCHER_Prop_fillOpacity
#define ESCHER_SpContainer
#define ESCHER_Prop_lineEndArrowhead
ESCHER_LineArrowStealthEnd
ESCHER_LineArrowDiamondEnd
#define ESCHER_Prop_fillColor
#define ESCHER_ShpInst_Line
#define ESCHER_Prop_lineDashing
#define ESCHER_ShpInst_PictureFrame
constexpr sal_Int32 FSNS(sal_Int32 namespc, sal_Int32 element)
#define SAL_WARN_IF(condition, area, stream)
#define SAL_WARN(area, stream)
#define SAL_INFO(area, stream)
#define DFF_Prop_gtextFStrikethrough
#define DFF_Prop_gtextSpacing
std::shared_ptr< T > make_shared(Args &&... args)
constexpr bool starts_with(std::basic_string_view< charT, traits > sv, std::basic_string_view< charT, traits > x) noexcept
std::shared_ptr< FastSerializerHelper > FSHelperPtr
std::vector< sal_uInt8 > nProp
constexpr TypedWhichId< SdrMetricItem > SDRATTR_TEXT_UPPERDIST(SDRATTR_MISC_FIRST+6)
SVXCORE_DLLPUBLIC SdrTextObj * DynCastSdrTextObj(SdrObject *)
static sal_Int32 impl_GetPointComponent(const sal_uInt8 *&pVal, sal_uInt16 nPointSize)
static void impl_AddInt(sax_fastparser::FastAttributeList *pAttrList, sal_Int32 nElement, sal_uInt32 nValue)
const sal_Int32 Tag_Container
static void impl_AddArrowLength(sax_fastparser::FastAttributeList *pAttrList, sal_Int32 nElement, sal_uInt32 nValue)
static void impl_AddColor(sax_fastparser::FastAttributeList *pAttrList, sal_Int32 nElement, sal_uInt32 nColor)
static void impl_AddBool(sax_fastparser::FastAttributeList *pAttrList, sal_Int32 nElement, bool bValue)
const sal_Int32 Tag_Commit
static OUString lcl_getAnchorIdFromGrabBag(const SdrObject *pSdrObject)
static std::vector< OString > lcl_getShapeTypes()
static void impl_AddArrowHead(sax_fastparser::FastAttributeList *pAttrList, sal_Int32 nElement, sal_uInt32 nValue)
static void impl_AddArrowWidth(sax_fastparser::FastAttributeList *pAttrList, sal_Int32 nElement, sal_uInt32 nValue)
static bool lcl_isTextBox(const SdrObject *pSdrObject)
static sal_uInt16 impl_GetUInt16(const sal_uInt8 *&pVal)
std::vector< ISegmentProgressBarRef > aSegments