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>
47#include <com/sun/star/beans/XPropertySet.hpp>
48#include <com/sun/star/beans/XPropertySetInfo.hpp>
49#include <com/sun/star/drawing/XShape.hpp>
50#include <com/sun/star/text/HoriOrientation.hpp>
51#include <com/sun/star/text/VertOrientation.hpp>
52#include <com/sun/star/text/RelOrientation.hpp>
53#include <com/sun/star/text/WritingMode2.hpp>
54#include <com/sun/star/text/XTextFrame.hpp>
67 , m_pSerializer(
std::move( pSerializer ))
68 , m_pTextExport( pTextExport )
74 , m_pSdrObject( nullptr )
79 , m_bSkipwzName( false )
80 , m_bUseHashMarkForType( false )
81 , m_bOverrideShapeIdGeneration( false )
82 , m_nShapeIDCounter( 0 )
139 OStringBuffer aStyle( 200 );
144 if ( rShapeName.getLength() )
145 pAttrList->add( XML_alt, rShapeName );
147 bool rbAbsolutePos =
true;
150 if (!rEditAs.isEmpty())
152 pAttrList->add(XML_editas, rEditAs);
153 rbAbsolutePos =
false;
160 if ( !aStyle.isEmpty() )
161 pAttrList->add( XML_style, aStyle );
166 pAttrList->add( XML_coordorigin,
167 OString::number( pRect->
Left() ) +
"," + OString::number( pRect->
Top() ) );
169 pAttrList->add( XML_coordsize,
170 OString::number( pRect->
Right() - pRect->
Left() ) +
"," +
171 OString::number( pRect->
Bottom() - pRect->
Top() ) );
174 m_pSerializer->startElementNS( XML_v, XML_group, pAttrList );
214 if (rStr.empty() )
return false;
222 if(bOverrideShapeIdGen)
224 assert(!sShapeIDPrefix.isEmpty());
236 const char *pArrowHead =
nullptr;
248 pAttrList->
add( nElement, pArrowHead );
256 const char *pArrowLength =
nullptr;
265 pAttrList->
add( nElement, pArrowLength );
273 const char *pArrowWidth =
nullptr;
282 pAttrList->
add( nElement, pArrowWidth );
290 pAttrList->
add( nElement, bValue?
"t":
"f" );
295 SAL_WARN_IF( nColor & 0xFF000000 ,
"oox.vml" ,
"TODO: this is not a RGB value!");
297 if ( !pAttrList || ( nColor & 0xFF000000 ) )
300 nColor = ( ( nColor & 0xFF ) << 16 ) + ( nColor & 0xFF00 ) + ( ( nColor & 0xFF0000 ) >> 16 );
302 const char *pColor =
nullptr;
306 case 0x000000: pColor =
"black";
break;
307 case 0xC0C0C0: pColor =
"silver";
break;
308 case 0x808080: pColor =
"gray";
break;
309 case 0xFFFFFF: pColor =
"white";
break;
310 case 0x800000: pColor =
"maroon";
break;
311 case 0xFF0000: pColor =
"red";
break;
312 case 0x800080: pColor =
"purple";
break;
313 case 0xFF00FF: pColor =
"fuchsia";
break;
314 case 0x008000: pColor =
"green";
break;
315 case 0x00FF00: pColor =
"lime";
break;
316 case 0x808000: pColor =
"olive";
break;
317 case 0xFFFF00: pColor =
"yellow";
break;
318 case 0x000080: pColor =
"navy";
break;
319 case 0x0000FF: pColor =
"blue";
break;
320 case 0x008080: pColor =
"teal";
break;
321 case 0x00FFFF: pColor =
"aqua";
break;
324 snprintf( pRgbColor,
sizeof( pRgbColor ),
"#%06x",
static_cast< unsigned int >( nColor ) );
330 pAttrList->
add( nElement, pColor );
338 pAttrList->
add( nElement, OString::number(
nValue ) );
343 sal_uInt16 nRet = *pVal++;
344 nRet += ( *pVal++ ) << 8;
351 if ( ( nPointSize == 0xfff0 ) || ( nPointSize == 4 ) )
353 sal_uInt16 nUnsigned = *pVal++;
354 nUnsigned += ( *pVal++ ) << 8;
356 nRet = sal_Int16( nUnsigned );
358 else if ( nPointSize == 8 )
360 sal_uInt32 nUnsigned = *pVal++;
361 nUnsigned += ( *pVal++ ) << 8;
362 nUnsigned += ( *pVal++ ) << 16;
363 nUnsigned += ( *pVal++ ) << 24;
395 nPaddingY += pItem->GetValue();
409 bool bAlreadyWritten[ 0xFFF ] = {};
411 for (
auto const& opt : rOpts)
413 sal_uInt16
nId = ( opt.nPropId & 0x0FFF );
415 if ( bAlreadyWritten[
nId ] )
422 const char *pWrapType =
nullptr;
423 switch ( opt.nPropValue )
443 char const* pValue(
nullptr);
444 switch (opt.nPropValue)
456 pValue =
"top-center";
459 pValue =
"middle-center";
462 pValue =
"bottom-center";
465 pValue =
"top-baseline";
468 pValue =
"bottom-baseline";
471 pValue =
"top-center-baseline";
474 pValue =
"bottom-center-baseline";
486 switch (opt.nPropValue)
508 sal_uInt32 nLeft = 0, nTop = 0;
512 nLeft = opt.nPropValue;
517 nTop = opt.nPropValue;
520 if(nTop!=0 && nLeft!=0)
522 OString::number( nLeft ) +
"," + OString::number( nTop ) );
532 sal_uInt32 nLeft = 0, nRight = 0, nTop = 0, nBottom = 0;
538 nRight = opt.nPropValue;
543 nBottom = opt.nPropValue;
547 if(nBottom!=0 && nRight!=0 )
549 OString::number( nRight - nLeft ) +
"," + OString::number( nBottom - nTop ) );
566 OStringBuffer aPath( 512 );
568 sal_uInt16 nPointSize = aVertices.
nProp[4] + ( aVertices.
nProp[5] << 8 );
574 for ( ; nSegments; --nSegments )
581 unsigned char nSegmentType = (nSeg & 0xE000) >> 13;
582 unsigned short nSegmentCount = nSeg & 0x03FF;
584 switch (nSegmentType)
590 if (nX >= 0 && nY >= 0 )
591 aPath.append(
"m" + OString::number( nX ) +
"," + OString::number( nY ) );
601 unsigned char nEscapeCode = (nSegmentCount & 0x1F00) >> 8;
602 unsigned char nVertexCount = nSegmentCount & 0x00FF;
603 pVerticesIt += nVertexCount;
608 aPath.append(
"nf" );
611 aPath.append(
"ns" );
618 for (
unsigned short i = 0;
i < nSegmentCount; ++
i)
622 aPath.append(
"l" + OString::number( nX ) +
"," + OString::number( nY ) );
626 for (
unsigned short i = 0;
i < nSegmentCount; ++
i)
634 aPath.append(
"c" + OString::number( nX1 ) +
"," + OString::number( nY1 ) +
"," +
635 OString::number( nX2 ) +
"," + OString::number( nY2 ) +
"," +
636 OString::number( nX3 ) +
"," + OString::number( nY3 ) );
649 SAL_WARN(
"oox",
"Invalid - should never be found");
653 OString pathString = aPath.makeStringAndClear();
654 if ( !pathString.isEmpty() && pathString !=
"xe" )
658 SAL_WARN(
"oox.vml",
"unhandled shape path, missing either pVertices or pSegmentInfo.");
673 = FastSerializerHelper::createAttrList();
675 bool imageData =
false;
682 = FastSerializerHelper::createAttrList();
683 pAttrListSignatureLine->add(XML_issignatureline,
"t");
686 pAttrListSignatureLine->add(
691 pAttrListSignatureLine->add(
692 FSNS(XML_o, XML_suggestedsigner),
697 pAttrListSignatureLine->add(
698 FSNS(XML_o, XML_suggestedsigner2),
703 pAttrListSignatureLine->add(
704 FSNS(XML_o, XML_suggestedsigneremail),
709 pAttrListSignatureLine->add(XML_signinginstructionsset,
"t");
710 pAttrListSignatureLine->add(
711 FSNS(XML_o, XML_signinginstructions),
714 pAttrListSignatureLine->add(
717 pAttrListSignatureLine->add(
722 XML_o, XML_signatureline,
723 pAttrListSignatureLine);
726 const uno::Reference<graphic::XGraphic>& xGraphic
730 pAttrList->add(
FSNS(XML_r, XML_id), aImageId);
737 int nHeaderSize = 25;
739 aStruct.
nProp.size() - nHeaderSize);
744 pAttrList->add(
FSNS(XML_r, XML_id), aImageId);
753 m_pSerializer->singleElementNS( XML_v, XML_imagedata, pAttrList );
758 const char *pFillType =
nullptr;
776 pAttrList->add(
XML_type, pFillType );
779 pAttrList->add( XML_on,
"false" );
789 pAttrList->add(XML_opacity, OString::number(
double((
nValue * 100) >> 16) / 100));
790 m_pSerializer->singleElementNS( XML_v, XML_fill, pAttrList );
825 const char *pDashStyle =
nullptr;
841 pAttrList->add( XML_dashstyle, pDashStyle );
864 const char *pJoinStyle =
nullptr;
872 pAttrList->add( XML_joinstyle, pJoinStyle );
877 const char *pEndCap =
nullptr;
885 pAttrList->add( XML_endcap, pEndCap );
888 m_pSerializer->singleElementNS( XML_v, XML_stroke, pAttrList );
904 if ( !opt.nPropValue )
911 bool bShadow =
false;
912 bool bObscured =
false;
915 bShadow = ((
nValue & 0x20002 ) == 0x20002 );
916 bObscured = ((
nValue & 0x10001 ) == 0x10001 );
922 impl_AddBool( pAttrList.get(), XML_obscured, bObscured );
927 m_pSerializer->singleElementNS( XML_v, XML_shadow, pAttrList );
941 if(!opt.nProp.empty())
943 aStream.
WriteBytes(opt.nProp.data(), opt.nProp.size());
950 m_pSerializer->singleElementNS(XML_v, XML_path, XML_textpathok,
"t");
953 pAttrList->add(XML_on,
"t");
954 pAttrList->add(XML_fitshape,
"t");
955 pAttrList->add(XML_string, aTextPathString);
963 aStyle +=
"font-family:\"" + aTextPathFont +
"\"";
968 float nSizeF =
static_cast<sal_Int32
>(nSize) / 65536.0;
969 OUString aSize = OUString::number(nSizeF);
970 aStyle +=
";font-size:" + aSize +
"pt";
973 sal_uInt32 nGtextFlags;
980 if ((nGtextFlags & 0x00200020) == 0x00200020)
981 aStyle +=
";font-weight:bold";
982 if ((nGtextFlags & 0x00100010) == 0x00100010)
983 aStyle +=
";font-style:italic";
984 if ((nGtextFlags & 0x00800080) == 0x00800080)
985 aStyle +=
";v-same-letter-heights:t";
993 sal_uInt32 nGtextSpacing;
995 aStyle +=
";v-text-spacing:" + OUString::number(nGtextSpacing) +
"f";
998 if (!aStyle.isEmpty())
999 pAttrList->add(XML_style, aStyle);
1004 pAttrList->add(XML_trim,
"t");
1006 m_pSerializer->singleElementNS(XML_v, XML_textpath, pAttrList);
1028 sAdj = OString::number(
static_cast<sal_Int32
>(
nValue));
1030 sAdj +=
"," + OString::number(
static_cast<sal_Int32
>(
nValue));
1032 if (!sAdj.isEmpty())
1042 m_ShapeStyle.append(
";rotation:" + OString::number(
double(opt.nPropValue >> 16)));
1057 if(!opt.nProp.empty())
1059 aStream.
WriteBytes(opt.nProp.data(), opt.nProp.size());
1075#if OSL_DEBUG_LEVEL > 0
1076 const size_t opt_nProp_size(opt.nProp.size());
1077 SAL_WARN(
"oox.vml",
"TODO VMLExport::Commit(), unimplemented id: " <<
nId
1078 <<
", value: " << opt.nPropValue
1079 <<
", data: [" << opt_nProp_size <<
"]");
1080 if ( opt.nProp.size() )
1082 const sal_uInt8 *pIt = opt.nProp.data();
1083 OStringBuffer buf(
" ( " );
1086 buf.append( OString::number(
static_cast<sal_Int32
>(*pIt), 16) +
" ");
1090 SAL_WARN(
"oox.vml", std::string_view(buf));
1105 return "shape_" + OString::number(
nId );
1133 OString aLeft, aTop, aRight, aBottom;
1137 static constexpr OStringLiteral aPt(
"pt" );
1138 aLeft = OString::number(
double( rRectangle.
Left() ) / 20 ) + aPt;
1139 aTop = OString::number(
double( rRectangle.
Top() ) / 20 ) + aPt;
1140 aRight = OString::number(
double( rRectangle.
Right() ) / 20 ) + aPt;
1141 aBottom = OString::number(
double( rRectangle.
Bottom() ) / 20 ) + aPt;
1145 aLeft = OString::number( rRectangle.
Left() );
1146 aTop = OString::number( rRectangle.
Top() );
1147 aRight = OString::number( rRectangle.
Right() );
1148 aBottom = OString::number( rRectangle.
Bottom() );
1158 if ( !rBuffer.isEmpty() )
1159 rBuffer.append(
";" );
1163 rBuffer.append(
"position:absolute;" );
1168 rBuffer.append(
"width:" + OString::number(
double( rRectangle.
Right() - rRectangle.
Left() ) / 20 ) +
1169 "pt;height:" + OString::number(
double( rRectangle.
Bottom() - rRectangle.
Top() ) / 20 ) +
1174 rBuffer.append(
"margin-left:" + OString::number(
double( rRectangle.
Left() ) / 20 ) +
1175 "pt;margin-top:" + OString::number(
double( rRectangle.
Top() ) / 20 ) +
1176 "pt;width:" + OString::number(
double( rRectangle.
Right() - rRectangle.
Left() ) / 20 ) +
1177 "pt;height:" + OString::number(
double( rRectangle.
Bottom() - rRectangle.
Top() ) / 20 ) +
1182 rBuffer.append(
"left:" + OString::number( rRectangle.
Left() ) +
1183 ";top:" + OString::number( rRectangle.
Top() ) +
1184 ";width:" + OString::number( rRectangle.
Right() - rRectangle.
Left() ) +
1185 ";height:" + OString::number( rRectangle.
Bottom() - rRectangle.
Top() ) );
1198 std::vector<OString> aRet;
1200 OUString aPath(
"$BRAND_BASE_DIR/" LIBO_SHARE_FOLDER
"/filter/vml-shape-types");
1201 rtl::Bootstrap::expandMacros(aPath);
1204 SAL_WARN(
"oox",
"failed to open vml-shape-types");
1205 OStringBuffer aLine;
1206 bool bNotDone = aStream.
ReadLine(aLine);
1211 aRet.push_back(OString(aLine));
1212 bNotDone = aStream.
ReadLine(aLine);
1219 uno::Reference<beans::XPropertySet> xPropertySet(
const_cast<SdrObject*
>(pSdrObject)->getUnoShape(), uno::UNO_QUERY);
1220 if (!xPropertySet.is())
1222 uno::Reference<beans::XPropertySetInfo> xPropertySetInfo = xPropertySet->getPropertySetInfo();
1223 if (!xPropertySetInfo->hasPropertyByName(
"TextBox"))
1225 css::uno::Any aTextBox(xPropertySet->getPropertyValue(
"TextBox"));
1226 if (!aTextBox.hasValue())
1228 return aTextBox.get<
bool>();
1235 uno::Reference<beans::XPropertySet> xShape(
const_cast<SdrObject*
>(pSdrObject)->getUnoShape(), uno::UNO_QUERY);
1236 if (xShape->getPropertySetInfo()->hasPropertyByName(
"InteropGrabBag"))
1239 if (aInteropGrabBag.
find(
"AnchorId") != aInteropGrabBag.
end())
1240 aInteropGrabBag[
"AnchorId"] >>= aResult;
1255 std::string_view sShapeID,
const bool bIsPictureFrame )
1258 if ( !bIsPictureFrame )
1261 sShapeType = OString::Concat(
"<v:shapetype id=\"_x0000_t") + sShapeID +
1262 "\" coordsize=\"21600,21600\" o:spt=\"" + sShapeID +
1263 "\" path=\"m,l,21600l21600,21600l21600,xe\">\n"
1264 "<v:stroke joinstyle=\"miter\"/>\n"
1265 "<v:path shadowok=\"f\" o:extrusionok=\"f\" strokeok=\"f\" fillok=\"f\" o:connecttype=\"rect\"/>\n"
1266 "<o:lock v:ext=\"edit\" shapetype=\"t\"/>\n"
1271 sShapeType = OString::Concat(
"<v:shapetype id=\"_x0000_t") + sShapeID +
1272 "\" coordsize=\"21600,21600\" o:spt=\"" + sShapeID +
1273 "\" o:preferrelative=\"t\" path=\"m@4@5l@4@11@9@11@9@5xe\" filled=\"f\" stroked=\"f\">\n"
1274 "<v:stroke joinstyle=\"miter\"/>\n"
1276 "<v:f eqn=\"if lineDrawn pixelLineWidth 0\"/>\n"
1277 "<v:f eqn=\"sum @0 1 0\"/>\n"
1278 "<v:f eqn=\"sum 0 0 @1\"/>\n"
1279 "<v:f eqn=\"prod @2 1 2\"/>\n"
1280 "<v:f eqn=\"prod @3 21600 pixelWidth\"/>\n"
1281 "<v:f eqn=\"prod @3 21600 pixelHeight\"/>\n"
1282 "<v:f eqn=\"sum @0 0 1\"/>\n"
1283 "<v:f eqn=\"prod @6 1 2\"/>\n"
1284 "<v:f eqn=\"prod @7 21600 pixelWidth\"/>\n"
1285 "<v:f eqn=\"sum @8 21600 0\"/>\n"
1286 "<v:f eqn=\"prod @7 21600 pixelHeight\"/>\n"
1287 "<v:f eqn=\"sum @10 21600 0\"/>\n"
1289 "<v:path o:extrusionok=\"f\" gradientshapeok=\"t\" o:connecttype=\"rect\"/>\n"
1290 "<o:lock v:ext=\"edit\" aspectratio=\"t\"/>\n"
1301 sal_Int32 nShapeElement = -1;
1302 bool bReferToShapeType =
false;
1313 bReferToShapeType =
true;
1314 nShapeElement = XML_shape;
1324 bReferToShapeType =
true;
1325 nShapeElement = XML_shape;
1334 nShapeElement = XML_shape;
1338 if (!bReferToShapeType)
1343 if (!sMarkup.isEmpty())
1347 bReferToShapeType =
true;
1360 bReferToShapeType =
true;
1370 nShapeElement = XML_rect;
1379 case text::HoriOrientation::LEFT:
1382 case text::HoriOrientation::CENTER:
1383 m_ShapeStyle.append(
";mso-position-horizontal:center");
1385 case text::HoriOrientation::RIGHT:
1388 case text::HoriOrientation::INSIDE:
1389 m_ShapeStyle.append(
";mso-position-horizontal:inside");
1391 case text::HoriOrientation::OUTSIDE:
1392 m_ShapeStyle.append(
";mso-position-horizontal:outside");
1395 case text::HoriOrientation::NONE:
1400 case text::RelOrientation::PAGE_PRINT_AREA:
1401 m_ShapeStyle.append(
";mso-position-horizontal-relative:margin");
1403 case text::RelOrientation::PAGE_FRAME:
1404 case text::RelOrientation::PAGE_LEFT:
1405 case text::RelOrientation::PAGE_RIGHT:
1406 m_ShapeStyle.append(
";mso-position-horizontal-relative:page");
1408 case text::RelOrientation::CHAR:
1409 m_ShapeStyle.append(
";mso-position-horizontal-relative:char");
1417 case text::VertOrientation::TOP:
1418 case text::VertOrientation::LINE_TOP:
1419 case text::VertOrientation::CHAR_TOP:
1422 case text::VertOrientation::CENTER:
1423 case text::VertOrientation::LINE_CENTER:
1426 case text::VertOrientation::BOTTOM:
1427 case text::VertOrientation::LINE_BOTTOM:
1428 case text::VertOrientation::CHAR_BOTTOM:
1432 case text::VertOrientation::NONE:
1437 case text::RelOrientation::PAGE_PRINT_AREA:
1438 m_ShapeStyle.append(
";mso-position-vertical-relative:margin");
1440 case text::RelOrientation::PAGE_FRAME:
1441 m_ShapeStyle.append(
";mso-position-vertical-relative:page");
1457 if (!sAnchorId.isEmpty())
1503 if (!textboxStyle.isEmpty())
1505 pTextboxAttrList->add(XML_style, textboxStyle);
1509 m_pSerializer->startElementNS(XML_v, XML_textbox, pTextboxAttrList);
1515 return nShapeElement;
1520 if ( nShapeElement < 0 )
1525 uno::Reference<drawing::XShape> xShape {
const_cast<SdrObject*
>(
m_pSdrObject)->getUnoShape(), uno::UNO_QUERY};
1526 uno::Reference<beans::XPropertySet> xPropertySet(xShape, uno::UNO_QUERY);
1527 uno::Reference<beans::XPropertySetInfo> xPropertySetInfo = xPropertySet->getPropertySetInfo();
1528 bool bBottomToTop =
false;
1529 if (xPropertySetInfo->hasPropertyByName(
"CustomShapeGeometry"))
1532 auto aAny = xPropertySet->getPropertyValue(
"WritingMode");
1533 sal_Int16 nWritingMode;
1534 if ((aAny >>= nWritingMode) && nWritingMode == text::WritingMode2::BT_LR)
1535 bBottomToTop =
true;
1545 uno::Reference<beans::XPropertySet> xPropSet(xTextFrame, uno::UNO_QUERY);
1546 auto aAny = xPropSet->getPropertyValue(
"WritingMode");
1547 sal_Int16 nWritingMode;
1548 if (aAny >>= nWritingMode)
1550 switch (nWritingMode)
1552 case text::WritingMode2::BT_LR:
1553 bBottomToTop =
true;
1563 pTextboxAttrList->add(XML_style,
"mso-layout-flow-alt:bottom-to-top");
1564 m_pSerializer->startElementNS(XML_v, XML_textbox, pTextboxAttrList);
1581 bool const bIsFollowingTextFlow,
1582 sal_Int16 eHOri, sal_Int16 eVOri, sal_Int16 eHRel, sal_Int16 eVRel,
1584 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.
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
void AddShapeAttribute(sal_Int32 nAttribute, std::string_view sValue)
Add an attribute to the generated <v:shape/> element.
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_adjust2Value
#define DFF_Prop_adjustValue
#define DFF_Prop_gtextFStrikethrough
#define DFF_Prop_gtextSpacing
OString GetVMLFontworkShapetypeMarkup(const MSO_SPT eShapeType)
Returns the markup for the v:shapetype element for export of a Fontwork shape to VML.
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