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>
44 #include <com/sun/star/beans/XPropertySet.hpp>
45 #include <com/sun/star/beans/XPropertySetInfo.hpp>
46 #include <com/sun/star/drawing/XShape.hpp>
47 #include <com/sun/star/text/HoriOrientation.hpp>
48 #include <com/sun/star/text/VertOrientation.hpp>
49 #include <com/sun/star/text/RelOrientation.hpp>
50 #include <com/sun/star/text/WritingMode2.hpp>
51 #include <com/sun/star/text/XTextFrame.hpp>
64 , m_pSerializer( pSerializer )
65 , m_pTextExport( pTextExport )
71 , m_pSdrObject( nullptr )
76 , m_bSkipwzName(
false )
77 , m_bUseHashMarkForType(
false )
78 , m_bOverrideShapeIdGeneration(
false )
79 , 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 );
209 if (rStr.empty() )
return false;
217 if(bOverrideShapeIdGen)
219 assert(!sShapeIDPrefix.isEmpty());
231 const char *pArrowHead =
nullptr;
243 pAttrList->
add( nElement, pArrowHead );
251 const char *pArrowLength =
nullptr;
260 pAttrList->
add( nElement, pArrowLength );
268 const char *pArrowWidth =
nullptr;
277 pAttrList->
add( nElement, pArrowWidth );
285 pAttrList->
add( nElement, bValue?
"t":
"f" );
290 SAL_WARN_IF( nColor & 0xFF000000 ,
"oox.vml" ,
"TODO: this is not a RGB value!");
292 if ( !pAttrList || ( nColor & 0xFF000000 ) )
295 nColor = ( ( nColor & 0xFF ) << 16 ) + ( nColor & 0xFF00 ) + ( ( nColor & 0xFF0000 ) >> 16 );
297 const char *pColor =
nullptr;
301 case 0x000000: pColor =
"black";
break;
302 case 0xC0C0C0: pColor =
"silver";
break;
303 case 0x808080: pColor =
"gray";
break;
304 case 0xFFFFFF: pColor =
"white";
break;
305 case 0x800000: pColor =
"maroon";
break;
306 case 0xFF0000: pColor =
"red";
break;
307 case 0x800080: pColor =
"purple";
break;
308 case 0xFF00FF: pColor =
"fuchsia";
break;
309 case 0x008000: pColor =
"green";
break;
310 case 0x00FF00: pColor =
"lime";
break;
311 case 0x808000: pColor =
"olive";
break;
312 case 0xFFFF00: pColor =
"yellow";
break;
313 case 0x000080: pColor =
"navy";
break;
314 case 0x0000FF: pColor =
"blue";
break;
315 case 0x008080: pColor =
"teal";
break;
316 case 0x00FFFF: pColor =
"aqua";
break;
319 snprintf( pRgbColor,
sizeof( pRgbColor ),
"#%06x", static_cast< unsigned int >( nColor ) );
325 pAttrList->
add( nElement, pColor );
333 pAttrList->
add( nElement, OString::number( nValue ).getStr() );
338 sal_uInt16 nRet = *pVal++;
339 nRet += ( *pVal++ ) << 8;
346 if ( ( nPointSize == 0xfff0 ) || ( nPointSize == 4 ) )
348 sal_uInt16 nUnsigned = *pVal++;
349 nUnsigned += ( *pVal++ ) << 8;
351 nRet = sal_Int16( nUnsigned );
353 else if ( nPointSize == 8 )
355 sal_uInt32 nUnsigned = *pVal++;
356 nUnsigned += ( *pVal++ ) << 8;
357 nUnsigned += ( *pVal++ ) << 16;
358 nUnsigned += ( *pVal++ ) << 24;
390 nPaddingY += pItem->GetValue();
401 bool bAlreadyWritten[ 0xFFF ] = {};
403 for (
auto const& opt : rOpts)
405 sal_uInt16
nId = ( opt.nPropId & 0x0FFF );
407 if ( bAlreadyWritten[ nId ] )
414 const char *pWrapType =
nullptr;
415 switch ( opt.nPropValue )
435 char const* pValue(
nullptr);
436 switch (opt.nPropValue)
448 pValue =
"top-center";
451 pValue =
"middle-center";
454 pValue =
"bottom-center";
457 pValue =
"top-baseline";
460 pValue =
"bottom-baseline";
463 pValue =
"top-center-baseline";
466 pValue =
"bottom-center-baseline";
478 switch (opt.nPropValue)
500 sal_uInt32 nLeft = 0, nTop = 0;
504 nLeft = opt.nPropValue;
509 nTop = opt.nPropValue;
512 if(nTop!=0 && nLeft!=0)
514 OString::number( nLeft ) +
"," + OString::number( nTop ) );
524 sal_uInt32 nLeft = 0, nRight = 0, nTop = 0, nBottom = 0;
530 nRight = opt.nPropValue;
535 nBottom = opt.nPropValue;
539 if(nBottom!=0 && nRight!=0 )
541 OString::number( nRight - nLeft ) +
"," + OString::number( nBottom - nTop ) );
558 OStringBuffer aPath( 512 );
560 sal_uInt16 nPointSize = aVertices.
nProp[4] + ( aVertices.
nProp[5] << 8 );
566 for ( ; nSegments; --nSegments )
573 unsigned char nSegmentType = (nSeg & 0xE000) >> 13;
574 unsigned short nSegmentCount = nSeg & 0x03FF;
576 switch (nSegmentType)
582 if (nX >= 0 && nY >= 0 )
583 aPath.append(
"m" + OString::number( nX ) +
"," + OString::number( nY ) );
593 unsigned char nEscapeCode = (nSegmentCount & 0x1F00) >> 8;
594 unsigned char nVertexCount = nSegmentCount & 0x00FF;
595 pVerticesIt += nVertexCount;
600 aPath.append(
"nf" );
603 aPath.append(
"ns" );
610 for (
unsigned short i = 0;
i < nSegmentCount; ++
i)
614 aPath.append(
"l" + OString::number( nX ) +
"," + OString::number( nY ) );
618 for (
unsigned short i = 0;
i < nSegmentCount; ++
i)
626 aPath.append(
"c" + OString::number( nX1 ) +
"," + OString::number( nY1 ) +
"," +
627 OString::number( nX2 ) +
"," + OString::number( nY2 ) +
"," +
628 OString::number( nX3 ) +
"," + OString::number( nY3 ) );
641 SAL_WARN(
"oox",
"Invalid - should never be found");
645 OString pathString = aPath.makeStringAndClear();
646 if ( !pathString.isEmpty() && pathString !=
"xe" )
650 SAL_WARN(
"oox.vml",
"unhandled shape path, missing either pVertices or pSegmentInfo.");
665 = FastSerializerHelper::createAttrList();
667 bool imageData =
false;
674 = FastSerializerHelper::createAttrList();
675 pAttrListSignatureLine->add(XML_issignatureline,
"t");
678 pAttrListSignatureLine->add(
683 pAttrListSignatureLine->add(
684 FSNS(XML_o, XML_suggestedsigner),
689 pAttrListSignatureLine->add(
690 FSNS(XML_o, XML_suggestedsigner2),
695 pAttrListSignatureLine->add(
696 FSNS(XML_o, XML_suggestedsigneremail),
701 pAttrListSignatureLine->add(XML_signinginstructionsset,
"t");
702 pAttrListSignatureLine->add(
703 FSNS(XML_o, XML_signinginstructions),
706 pAttrListSignatureLine->add(
709 pAttrListSignatureLine->add(
714 XML_o, XML_signatureline,
715 pAttrListSignatureLine);
718 const uno::Reference<graphic::XGraphic>& xGraphic
722 pAttrList->add(
FSNS(XML_r, XML_id), aImageId);
729 int nHeaderSize = 25;
731 aStruct.
nProp.size() - nHeaderSize);
736 pAttrList->add(
FSNS(XML_r, XML_id), aImageId);
741 impl_AddBool(pAttrList.get(),
FSNS(XML_o, XML_detectmouseclick), nValue != 0);
744 m_pSerializer->singleElementNS( XML_v, XML_imagedata, pAttrList );
749 const char *pFillType =
nullptr;
763 SAL_INFO(
"oox.vml",
"Unhandled fill type: " << nValue);
767 pAttrList->add(
XML_type, pFillType );
770 pAttrList->add( XML_on,
"false" );
781 pAttrList->add(XML_opacity, OString::number(
double((nValue * 100) >> 16) / 100));
782 m_pSerializer->singleElementNS( XML_v, XML_fill, pAttrList );
813 impl_AddInt( pAttrList.get(), XML_weight, nValue );
817 const char *pDashStyle =
nullptr;
833 pAttrList->add( XML_dashstyle, pDashStyle );
856 const char *pJoinStyle =
nullptr;
864 pAttrList->add( XML_joinstyle, pJoinStyle );
869 const char *pEndCap =
nullptr;
877 pAttrList->add( XML_endcap, pEndCap );
880 m_pSerializer->singleElementNS( XML_v, XML_stroke, pAttrList );
896 if ( !opt.nPropValue )
903 bool bShadow =
false;
904 bool bObscured =
false;
907 bShadow = (( nValue & 0x20002 ) == 0x20002 );
908 bObscured = (( nValue & 0x10001 ) == 0x10001 );
914 impl_AddBool( pAttrList.get(), XML_obscured, bObscured );
919 m_pSerializer->singleElementNS( XML_v, XML_shadow, pAttrList );
933 if(!opt.nProp.empty())
935 aStream.
WriteBytes(opt.nProp.data(), opt.nProp.size());
942 m_pSerializer->singleElementNS(XML_v, XML_path, XML_textpathok,
"t");
945 pAttrList->add(XML_on,
"t");
946 pAttrList->add(XML_fitshape,
"t");
947 pAttrList->add(XML_string, aTextPathString);
955 aStyle +=
"font-family:\"" + aTextPathFont +
"\"";
960 float nSizeF =
static_cast<sal_Int32
>(nSize) / 65536.0;
961 OUString aSize = OUString::number(nSizeF);
962 aStyle +=
";font-size:" + aSize +
"pt";
965 pAttrList->add(XML_trim,
"t");
967 if (!aStyle.isEmpty())
968 pAttrList->add(XML_style, aStyle);
969 m_pSerializer->singleElementNS(XML_v, XML_textpath, pAttrList);
979 m_ShapeStyle.append(
";rotation:" + OString::number(
double(opt.nPropValue >> 16)));
994 if(!opt.nProp.empty())
996 aStream.
WriteBytes(opt.nProp.data(), opt.nProp.size());
1009 #if OSL_DEBUG_LEVEL > 0
1010 const size_t opt_nProp_size(opt.nProp.size());
1012 fprintf( stderr,
"TODO VMLExport::Commit(), unimplemented id: %d, value: %" SAL_PRIuUINT32
", data: [%zu, %p]\n",
1016 0 == opt_nProp_size ? &opt_nProp_empty : opt.nProp.data());
1017 if ( opt.nProp.size() )
1019 const sal_uInt8 *pIt = opt.nProp.data();
1020 fprintf( stderr,
" ( " );
1023 fprintf( stderr,
"%02x ", *pIt );
1026 fprintf( stderr,
")\n" );
1041 return "shape_" + OString::number( nId );
1069 OString aLeft, aTop, aRight, aBottom;
1073 const OString aPt(
"pt" );
1074 aLeft = OString::number(
double( rRectangle.
Left() ) / 20 ) + aPt;
1075 aTop = OString::number(
double( rRectangle.
Top() ) / 20 ) + aPt;
1076 aRight = OString::number(
double( rRectangle.
Right() ) / 20 ) + aPt;
1077 aBottom = OString::number(
double( rRectangle.
Bottom() ) / 20 ) + aPt;
1081 aLeft = OString::number( rRectangle.
Left() );
1082 aTop = OString::number( rRectangle.
Top() );
1083 aRight = OString::number( rRectangle.
Right() );
1084 aBottom = OString::number( rRectangle.
Bottom() );
1094 if ( !rBuffer.isEmpty() )
1095 rBuffer.append(
";" );
1099 rBuffer.append(
"position:absolute;" );
1104 rBuffer.append(
"width:" + OString::number(
double( rRectangle.
Right() - rRectangle.
Left() ) / 20 ) +
1105 "pt;height:" + OString::number(
double( rRectangle.
Bottom() - rRectangle.
Top() ) / 20 ) +
1110 rBuffer.append(
"margin-left:" + OString::number(
double( rRectangle.
Left() ) / 20 ) +
1111 "pt;margin-top:" + OString::number(
double( rRectangle.
Top() ) / 20 ) +
1112 "pt;width:" + OString::number(
double( rRectangle.
Right() - rRectangle.
Left() ) / 20 ) +
1113 "pt;height:" + OString::number(
double( rRectangle.
Bottom() - rRectangle.
Top() ) / 20 ) +
1118 rBuffer.append(
"left:" + OString::number( rRectangle.
Left() ) +
1119 ";top:" + OString::number( rRectangle.
Top() ) +
1120 ";width:" + OString::number( rRectangle.
Right() - rRectangle.
Left() ) +
1121 ";height:" + OString::number( rRectangle.
Bottom() - rRectangle.
Top() ) );
1134 std::vector<OString> aRet;
1136 OUString aPath(
"$BRAND_BASE_DIR/" LIBO_SHARE_FOLDER
"/filter/vml-shape-types");
1137 rtl::Bootstrap::expandMacros(aPath);
1140 SAL_WARN(
"oox",
"failed to open vml-shape-types");
1141 OStringBuffer aLine;
1142 bool bNotDone = aStream.
ReadLine(aLine);
1147 aRet.push_back(OString(aLine));
1148 bNotDone = aStream.
ReadLine(aLine);
1155 uno::Reference<beans::XPropertySet> xPropertySet(const_cast<SdrObject*>(pSdrObject)->getUnoShape(), uno::UNO_QUERY);
1156 if (xPropertySet.is())
1158 uno::Reference<beans::XPropertySetInfo> xPropertySetInfo = xPropertySet->getPropertySetInfo();
1159 return xPropertySetInfo->hasPropertyByName(
"TextBox") && xPropertySet->getPropertyValue(
"TextBox").get<
bool>();
1168 uno::Reference<beans::XPropertySet> xShape(const_cast<SdrObject*>(pSdrObject)->getUnoShape(), uno::UNO_QUERY);
1169 if (xShape->getPropertySetInfo()->hasPropertyByName(
"InteropGrabBag"))
1172 if (aInteropGrabBag.find(
"AnchorId") != aInteropGrabBag.end())
1173 aInteropGrabBag[
"AnchorId"] >>= aResult;
1188 std::string_view sShapeID,
const bool bIsPictureFrame )
1191 if ( !bIsPictureFrame )
1194 sShapeType = OString::Concat(
"<v:shapetype id=\"_x0000_t") + sShapeID +
1195 "\" coordsize=\"21600,21600\" o:spt=\"" + sShapeID +
1196 "\" path=\"m,l,21600l21600,21600l21600,xe\">\n"
1197 "<v:stroke joinstyle=\"miter\"/>\n"
1198 "<v:path shadowok=\"f\" o:extrusionok=\"f\" strokeok=\"f\" fillok=\"f\" o:connecttype=\"rect\"/>\n"
1199 "<o:lock v:ext=\"edit\" shapetype=\"t\"/>\n"
1204 sShapeType = OString::Concat(
"<v:shapetype id=\"_x0000_t") + sShapeID +
1205 "\" coordsize=\"21600,21600\" o:spt=\"" + sShapeID +
1206 "\" o:preferrelative=\"t\" path=\"m@4@5l@4@11@9@11@9@5xe\" filled=\"f\" stroked=\"f\">\n"
1207 "<v:stroke joinstyle=\"miter\"/>\n"
1209 "<v:f eqn=\"if lineDrawn pixelLineWidth 0\"/>\n"
1210 "<v:f eqn=\"sum @0 1 0\"/>\n"
1211 "<v:f eqn=\"sum 0 0 @1\"/>\n"
1212 "<v:f eqn=\"prod @2 1 2\"/>\n"
1213 "<v:f eqn=\"prod @3 21600 pixelWidth\"/>\n"
1214 "<v:f eqn=\"prod @3 21600 pixelHeight\"/>\n"
1215 "<v:f eqn=\"sum @0 0 1\"/>\n"
1216 "<v:f eqn=\"prod @6 1 2\"/>\n"
1217 "<v:f eqn=\"prod @7 21600 pixelWidth\"/>\n"
1218 "<v:f eqn=\"sum @8 21600 0\"/>\n"
1219 "<v:f eqn=\"prod @7 21600 pixelHeight\"/>\n"
1220 "<v:f eqn=\"sum @10 21600 0\"/>\n"
1222 "<v:path o:extrusionok=\"f\" gradientshapeok=\"t\" o:connecttype=\"rect\"/>\n"
1223 "<o:lock v:ext=\"edit\" aspectratio=\"t\"/>\n"
1234 sal_Int32 nShapeElement = -1;
1235 bool bReferToShapeType =
false;
1246 bReferToShapeType =
true;
1247 nShapeElement = XML_shape;
1257 bReferToShapeType =
true;
1258 nShapeElement = XML_shape;
1269 nShapeElement = XML_shape;
1276 bReferToShapeType =
true;
1286 nShapeElement = XML_rect;
1295 case text::HoriOrientation::LEFT:
1298 case text::HoriOrientation::CENTER:
1299 m_ShapeStyle.append(
";mso-position-horizontal:center");
1301 case text::HoriOrientation::RIGHT:
1304 case text::HoriOrientation::INSIDE:
1305 m_ShapeStyle.append(
";mso-position-horizontal:inside");
1307 case text::HoriOrientation::OUTSIDE:
1308 m_ShapeStyle.append(
";mso-position-horizontal:outside");
1311 case text::HoriOrientation::NONE:
1316 case text::RelOrientation::PAGE_PRINT_AREA:
1317 m_ShapeStyle.append(
";mso-position-horizontal-relative:margin");
1319 case text::RelOrientation::PAGE_FRAME:
1320 case text::RelOrientation::PAGE_LEFT:
1321 case text::RelOrientation::PAGE_RIGHT:
1322 m_ShapeStyle.append(
";mso-position-horizontal-relative:page");
1324 case text::RelOrientation::CHAR:
1325 m_ShapeStyle.append(
";mso-position-horizontal-relative:char");
1333 case text::VertOrientation::TOP:
1334 case text::VertOrientation::LINE_TOP:
1335 case text::VertOrientation::CHAR_TOP:
1338 case text::VertOrientation::CENTER:
1339 case text::VertOrientation::LINE_CENTER:
1342 case text::VertOrientation::BOTTOM:
1343 case text::VertOrientation::LINE_BOTTOM:
1344 case text::VertOrientation::CHAR_BOTTOM:
1348 case text::VertOrientation::NONE:
1353 case text::RelOrientation::PAGE_PRINT_AREA:
1354 m_ShapeStyle.append(
";mso-position-vertical-relative:margin");
1356 case text::RelOrientation::PAGE_FRAME:
1357 m_ShapeStyle.append(
";mso-position-vertical-relative:page");
1373 if (!sAnchorId.isEmpty())
1401 if (pTxtObj->IsTextEditActive())
1403 pParaObj = pTxtObj->CreateEditOutlinerParaObject();
1405 else if (pTxtObj->GetOutlinerParaObject())
1407 pParaObj = *pTxtObj->GetOutlinerParaObject();
1413 if (!textboxStyle.isEmpty())
1415 pTextboxAttrList->add(XML_style, textboxStyle);
1419 m_pSerializer->startElementNS(XML_v, XML_textbox, pTextboxAttrList);
1425 return nShapeElement;
1430 if ( nShapeElement < 0 )
1435 uno::Reference<drawing::XShape> xShape {
const_cast<SdrObject*
>(
m_pSdrObject)->getUnoShape(), uno::UNO_QUERY};
1436 uno::Reference<beans::XPropertySet> xPropertySet(xShape, uno::UNO_QUERY);
1437 uno::Reference<beans::XPropertySetInfo> xPropertySetInfo = xPropertySet->getPropertySetInfo();
1438 bool bBottomToTop =
false;
1439 if (xPropertySetInfo->hasPropertyByName(
"CustomShapeGeometry"))
1443 xPropertySet->getPropertyValue(
"CustomShapeGeometry"));
1444 if (aCustomShapeProperties.find(
"TextPreRotateAngle") != aCustomShapeProperties.end())
1446 sal_Int32 nTextRotateAngle = aCustomShapeProperties[
"TextPreRotateAngle"].get<sal_Int32>();
1447 if (nTextRotateAngle == -270)
1448 bBottomToTop =
true;
1459 uno::Reference<beans::XPropertySet> xPropSet(xTextFrame, uno::UNO_QUERY);
1460 auto aAny = xPropSet->getPropertyValue(
"WritingMode");
1461 sal_Int16 nWritingMode;
1462 if (aAny >>= nWritingMode)
1464 switch (nWritingMode)
1466 case text::WritingMode2::BT_LR:
1467 bBottomToTop =
true;
1477 pTextboxAttrList->add(XML_style,
"mso-layout-flow-alt:bottom-to-top");
1478 m_pSerializer->startElementNS(XML_v, XML_textbox, pTextboxAttrList);
1495 bool const bIsFollowingTextFlow,
1496 sal_Int16 eHOri, sal_Int16 eVOri, sal_Int16 eHRel, sal_Int16 eVRel,
1498 const bool bOOxmlExport )
void AddShapeAttribute(sal_Int32 nAttribute, const OString &sValue)
Add an attribute to the generated element.
ESCHER_LineMediumLenArrow
rtl::Reference<::sax_fastparser::FastAttributeList > m_pShapeAttrList
Fill the shape attributes as they come.
#define ESCHER_ShpInst_Nil
virtual void LeaveGroup() override
virtual void AddSdrObjectVMLObject(const SdrObject &rObj) override
sal_uInt32 m_nShapeType
Remember the shape type.
ESCHER_AnchorMiddleCentered
OString const & AddInlineSdrObject(const SdrObject &rObj, const bool bOOxmlExport)
const SdrObject * m_pSdrObject
The object we're exporting.
void AddLineDimensions(const tools::Rectangle &rRectangle)
Add starting and ending point of a line to the m_pShapeAttrList.
#define ESCHER_Prop_geoRight
#define ESCHER_Prop_geoLeft
bool m_bOverrideShapeIdGeneration
There is a shapeid generation mechanism in EscherEx, but it does not seem to work so override the exi...
#define ESCHER_Prop_fshadowObscured
ESCHER_AnchorBottomCenteredBaseline
void OverrideShapeIDGen(bool bOverrideShapeIdGeneration, const OString &sShapeIDPrefix=OString())
#define ESCHER_Prop_lineEndArrowWidth
#define ESCHER_Prop_lineWidth
#define ESCHER_Prop_geoBottom
std::vector< sal_uInt8 > nProp
virtual oox::drawingml::DrawingML & GetDrawingML()=0
virtual void AddShape(sal_uInt32 nShapeType, ShapeFlag nShapeFlags, sal_uInt32 nShapeId=0) override
#define ESCHER_Prop_lineEndArrowLength
std::vector< sal_uInt16 > mRecTypes
#define ESCHER_Prop_pVertices
sal_uInt32 AddSdrObject(const SdrObject &rObj, bool ooxmlExport=false)
bool ReadLine(OStringBuffer &rStr, sal_Int32 nMaxBytesToRead=0xFFFE)
#define ESCHER_Prop_lineEndCapStyle
#define ESCHER_ShpInst_Ellipse
sal_uInt64 Seek(sal_uInt64 nPos)
#define ESCHER_Prop_txflTextFlow
const OUString & getHyperlink() const
std::vector< bool > m_aShapeTypeWritten
Remember which shape types we had already written.
OString m_sShapeId
Remember the generated shape id.
std::shared_ptr< T > make_shared(Args &&...args)
VMLTextExport * m_pTextExport
Parent exporter, used for text callback.
ESCHER_LineLongDashDotDotGEL
const OUString & getSignatureLineSigningInstructions() const
static std::vector< OString > lcl_getShapeTypes()
#define ESCHER_Prop_pSegmentInfo
bool isSignatureLineCanAddComment() const
const sal_Int32 Tag_Container
virtual sal_uInt32 GenerateShapeId()
constexpr bool starts_with(std::basic_string_view< charT, traits > sv, std::basic_string_view< charT, traits > x) noexcept
virtual void OpenContainer(sal_uInt16 nEscherContainer, int nRecInstance=0) override
static void impl_AddArrowWidth(sax_fastparser::FastAttributeList *pAttrList, sal_Int32 nElement, sal_uInt32 nValue)
#define ESCHER_Prop_wzName
#define ESCHER_Prop_AnchorText
rtl::Reference< sax_fastparser::FastAttributeList > m_pWrapAttrList
virtual sal_uInt32 GenerateShapeId() override
Override shape ID generation when m_bOverrideShapeIdGeneration is set to true.
#define ESCHER_ShpInst_RoundRectangle
ESCHER_LineArrowDiamondEnd
virtual void CloseContainer() override
#define ESCHER_ShpInst_HostControl
static void impl_AddArrowHead(sax_fastparser::FastAttributeList *pAttrList, sal_Int32 nElement, sal_uInt32 nValue)
bool isSignatureLine() const
#define ESCHER_ShpInst_Line
bool HasTextBoxContent(sal_uInt32 nShapeType)
#define ESCHER_Prop_gtextUNICODE
static OUString MSDFFReadZString(SvStream &rIn, sal_uInt32 nMaxLen, bool bUniCode)
static void impl_AddArrowLength(sax_fastparser::FastAttributeList *pAttrList, sal_Int32 nElement, sal_uInt32 nValue)
#define ESCHER_Prop_fillOpacity
#define ESCHER_Prop_fNoLineDrawDash
#define ESCHER_Prop_lineDashing
#define ESCHER_ShpInst_NotPrimitive
bool m_bUseHashMarkForType
Use '#' mark for type attribute (check Type Attribute of VML shape in OOXML documentation) ...
sal_Int16 m_eHOri
Anchoring - Writer specific properties.
ESCHER_AnchorBottomBaseline
static bool lcl_isTextBox(const SdrObject *pSdrObject)
#define ESCHER_Prop_WrapText
#define ESCHER_Prop_geoTop
#define ESCHER_Prop_fHidden
#define ESCHER_Prop_gtextSize
std::size_t WriteBytes(const void *pData, std::size_t nSize)
virtual void EndShape(sal_Int32 nShapeElement)
End the shape.
#define ESCHER_Prop_lineStartArrowhead
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. ...
static sal_uInt16 impl_GetUInt16(const sal_uInt8 *&pVal)
#define ESCHER_Prop_lineStartArrowWidth
#define ESCHER_Prop_lineStartArrowLength
ESCHER_AnchorTopCenteredBaseline
#define ESCHER_ShpInst_COUNT
sal_uInt64 m_nShapeIDCounter
Counter for generating shape ids (used if m_bOverrideShapeIdGeneration is true)
OStringBuffer m_TextboxStyle
style for textbox
void AddFlipXY()
Add flip X and flip Y.
std::shared_ptr< FastSerializerHelper > FSHelperPtr
static ErrCode Import(SvStream &rIStm, Graphic &rGraphic, ConvertDataFormat nFormat=ConvertDataFormat::Unknown)
#define ESCHER_Prop_lineEndArrowhead
static void impl_AddInt(sax_fastparser::FastAttributeList *pAttrList, sal_Int32 nElement, sal_uInt32 nValue)
const sal_Int32 Tag_Commit
#define ESCHER_Prop_lineJoinStyle
#define ESCHER_Prop_fillBlip
bool m_bSkipwzName
It seems useless to write out an XML_ID attribute next to XML_id which defines the actual shape id...
virtual void Commit(EscherPropertyContainer &rProps, const tools::Rectangle &rRect) override
virtual sal_uInt32 EnterGroup(const OUString &rShapeName, const tools::Rectangle *pBoundRect) override
#define ESCHER_Prop_shadowColor
#define ESCHER_Prop_fillBackColor
const OUString & getSignatureLineSuggestedSignerName() const
std::vector< ISegmentProgressBarRef > aSegments
constexpr TypedWhichId< SdrMetricItem > SDRATTR_TEXT_UPPERDIST(SDRATTR_MISC_FIRST+6)
virtual ~VMLExport() override
void AddRectangleDimensions(OStringBuffer &rBuffer, const tools::Rectangle &rRectangle, bool rbAbsolutePos=true)
Add position and size to the OStringBuffer.
void add(const FastAttributeList &)
static bool IsWaterMarkShape(std::u16string_view rStr)
#define ESCHER_Prop_fillColor
const OUString & getSignatureLineSuggestedSignerTitle() const
OUString WriteImage(const Graphic &rGraphic, bool bRelPathToMedia=false)
If bRelPathToMedia is true add "../" to image folder path while adding the image relationship.
ESCHER_LineLongDashDotGEL
#define ESCHER_SpContainer
virtual void WriteOutliner(const OutlinerParaObject &rParaObj)=0
virtual void CloseContainer()
ESCHER_LineMediumWidthArrow
#define ESCHER_ShpInst_PictureFrame
OStringBuffer m_ShapeStyle
Remember style, the most important shape attribute ;-)
virtual sal_Int32 StartShape()
Start the shape for which we just collected the information.
static void impl_AddColor(sax_fastparser::FastAttributeList *pAttrList, sal_Int32 nElement, sal_uInt32 nColor)
#define SAL_WARN_IF(condition, area, stream)
#define ESCHER_ShpInst_Rectangle
#define ESCHER_Prop_lineColor
#define ESCHER_Prop_fNoFillHitTest
::sax_fastparser::FSHelperPtr m_pSerializer
Fast serializer to output the data.
virtual void OpenContainer(sal_uInt16 nEscherContainer, int nRecInstance=0)
#define SAL_INFO(area, stream)
const SfxItemSet & GetMergedItemSet() const
css::uno::Reference< css::graphic::XGraphic > const & getSignatureLineUnsignedGraphic() const
#define ESCHER_Prop_fillType
static OString GetVMLShapeTypeDefinition(std::string_view sShapeID, const bool bIsPictureFrame)
DMLTextExport * GetTextExport()
The application-specific text exporter callback, if there is one.
bool isSignatureLineShowSignDate() const
OString m_sShapeIDPrefix
Prefix for overridden shape id generation (used if m_bOverrideShapeIdGeneration is true) ...
Interface to be implemented by the parent exporter that knows how to handle shape text...
constexpr sal_Int32 FSNS(sal_Int32 namespc, sal_Int32 element)
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)
Export the sdr object as VML.
const EscherProperties & GetOpts() const
virtual css::uno::Reference< css::text::XTextFrame > GetUnoTextFrame(css::uno::Reference< css::drawing::XShape > xShape)=0
Get textbox which belongs to the shape.
#define SAL_WARN(area, stream)
ESCHER_LineArrowStealthEnd
static sal_Int32 impl_GetPointComponent(const sal_uInt8 *&pVal, sal_uInt16 nPointSize)
bool m_IsFollowingTextFlow
#define ESCHER_ShpInst_Arc
bool GetOpt(sal_uInt16 nPropertyID, sal_uInt32 &rPropValue) const
const OUString & getSignatureLineId() const
const SfxPoolItem * GetItem(sal_uInt16 nWhich, bool bSearchInParent=true) const
const OUString & GetEditAs() const
void SetFS(const ::sax_fastparser::FSHelperPtr &pSerializer)
static OUString lcl_getAnchorIdFromGrabBag(const SdrObject *pSdrObject)
const OUString & GetName() const
static void impl_AddBool(sax_fastparser::FastAttributeList *pAttrList, sal_Int32 nElement, bool bValue)
OString ShapeIdString(sal_uInt32 nId)
Create an OString representing the id from a numerical id.
const OUString & getSignatureLineSuggestedSignerEmail() const
std::vector< EscherPropSortStruct > EscherProperties
ESCHER_AnchorBottomCentered
#define ESCHER_Prop_Rotation
bool m_bDetectedRangeSegmentation false
ShapeFlag m_nShapeFlags
Remember the shape flags.
#define ESCHER_Prop_gtextFont