20#include <config_wasm_strip.h>
32#include <com/sun/star/beans/XPropertyState.hpp>
33#include <com/sun/star/beans/PropertyValues.hpp>
34#include <com/sun/star/container/XChild.hpp>
35#include <com/sun/star/container/XEnumerationAccess.hpp>
36#include <com/sun/star/container/XIdentifierAccess.hpp>
37#include <com/sun/star/container/XNamed.hpp>
38#include <com/sun/star/document/XEventsSupplier.hpp>
39#include <com/sun/star/drawing/Alignment.hpp>
40#include <com/sun/star/drawing/CameraGeometry.hpp>
41#include <com/sun/star/drawing/CircleKind.hpp>
42#include <com/sun/star/drawing/ConnectorType.hpp>
43#include <com/sun/star/drawing/Direction3D.hpp>
44#include <com/sun/star/drawing/EscapeDirection.hpp>
45#include <com/sun/star/drawing/EnhancedCustomShapeAdjustmentValue.hpp>
46#include <com/sun/star/drawing/EnhancedCustomShapeGluePointType.hpp>
47#include <com/sun/star/drawing/EnhancedCustomShapeParameterPair.hpp>
48#include <com/sun/star/drawing/EnhancedCustomShapeParameterType.hpp>
49#include <com/sun/star/drawing/EnhancedCustomShapeMetalType.hpp>
50#include <com/sun/star/drawing/EnhancedCustomShapeSegment.hpp>
51#include <com/sun/star/drawing/EnhancedCustomShapeSegmentCommand.hpp>
52#include <com/sun/star/drawing/EnhancedCustomShapeTextFrame.hpp>
53#include <com/sun/star/drawing/EnhancedCustomShapeTextPathMode.hpp>
54#include <com/sun/star/drawing/GluePoint2.hpp>
55#include <com/sun/star/drawing/HomogenMatrix.hpp>
56#include <com/sun/star/drawing/HomogenMatrix3.hpp>
57#include <com/sun/star/drawing/PolyPolygonBezierCoords.hpp>
58#include <com/sun/star/drawing/PolyPolygonShape3D.hpp>
59#include <com/sun/star/drawing/Position3D.hpp>
60#include <com/sun/star/drawing/ProjectionMode.hpp>
61#include <com/sun/star/drawing/ShadeMode.hpp>
62#include <com/sun/star/drawing/XControlShape.hpp>
63#include <com/sun/star/drawing/XCustomShapeEngine.hpp>
64#include <com/sun/star/drawing/XGluePointsSupplier.hpp>
65#include <com/sun/star/drawing/BarCode.hpp>
66#include <com/sun/star/drawing/BarCodeErrorCorrection.hpp>
67#include <com/sun/star/drawing/XShapes3.hpp>
68#include <com/sun/star/embed/ElementModes.hpp>
69#include <com/sun/star/embed/XStorage.hpp>
70#include <com/sun/star/embed/XTransactedObject.hpp>
71#include <com/sun/star/graphic/XGraphic.hpp>
72#include <com/sun/star/graphic/GraphicProvider.hpp>
73#include <com/sun/star/graphic/XGraphicProvider.hpp>
74#include <com/sun/star/io/XSeekableInputStream.hpp>
75#include <com/sun/star/io/XStream.hpp>
76#include <com/sun/star/lang/ServiceNotRegisteredException.hpp>
77#include <com/sun/star/lang/XMultiServiceFactory.hpp>
78#include <com/sun/star/media/ZoomLevel.hpp>
79#include <com/sun/star/presentation/AnimationSpeed.hpp>
80#include <com/sun/star/presentation/ClickAction.hpp>
81#include <com/sun/star/style/XStyle.hpp>
82#include <com/sun/star/table/XColumnRowRange.hpp>
83#include <com/sun/star/text/WritingMode2.hpp>
84#include <com/sun/star/text/XText.hpp>
90#include <officecfg/Office/Common.hxx>
96#include <rtl/math.hxx>
97#include <rtl/ustrbuf.hxx>
98#include <rtl/ustring.hxx>
173constexpr OUStringLiteral
gsVerb( u
"Verb" );
182 maCurrentShapesIter(maShapesInfos.
end()),
183 mbExportLayer( false ),
185 mbHandleProgressBar( false )
222 uno::Reference< drawing::XShape > xCustomShapeReplacement;
226 OUString aType( xShape->getShapeType() );
227 if( aType ==
"com.sun.star.drawing.CustomShape" )
229 uno::Reference< beans::XPropertySet > xSet( xShape, uno::UNO_QUERY );
233 xSet->getPropertyValue(
"CustomShapeEngine") >>= aEngine;
234 if ( aEngine.isEmpty() )
236 aEngine =
"com.sun.star.drawing.EnhancedCustomShapeEngine";
238 uno::Reference< uno::XComponentContext > xContext( ::comphelper::getProcessComponentContext() );
240 if ( !aEngine.isEmpty() )
242 uno::Sequence< beans::PropertyValue > aPropValues{
246 uno::Sequence< uno::Any > aArgument = {
uno::Any(aPropValues) };
247 uno::Reference< uno::XInterface > xInterface(
248 xContext->getServiceManager()->createInstanceWithArgumentsAndContext(aEngine, aArgument, xContext) );
249 if ( xInterface.is() )
251 uno::Reference< drawing::XCustomShapeEngine > xCustomShapeEngine(
252 uno::Reference< drawing::XCustomShapeEngine >( xInterface, uno::UNO_QUERY ) );
253 if ( xCustomShapeEngine.is() )
254 xCustomShapeReplacement = xCustomShapeEngine->render();
260 return xCustomShapeReplacement;
268 OSL_FAIL(
"XMLShapeExport::collectShapeAutoStyles(): no call to seekShapes()!" );
271 sal_Int32 nZIndex = 0;
272 uno::Reference< beans::XPropertySet > xPropSet(xShape, uno::UNO_QUERY);
274 xPropSet->getPropertyValue(
gsZIndex) >>= nZIndex;
278 if(
static_cast<sal_Int32
>(aShapeInfoVector.size()) <= nZIndex )
280 OSL_FAIL(
"XMLShapeExport::collectShapeAutoStyles(): no shape info allocated for a given shape" );
287 if ( xCustomShapeReplacement.is() )
295 const bool bObjSupportsText =
298 const bool bObjSupportsStyle =
301 bool bIsEmptyPresObj =
false;
307 if( xPropSet.is() && bObjSupportsText )
309 uno::Reference< text::XText > xText(xShape, uno::UNO_QUERY);
319 catch (uno::RuntimeException
const&)
324 uno::Reference< beans::XPropertySetInfo > xPropSetInfo( xPropSet->getPropertySetInfo() );
326 if( xPropSetInfo.is() && xPropSetInfo->hasPropertyByName(
"IsEmptyPresentationObject") )
328 uno::Any aAny = xPropSet->getPropertyValue(
"IsEmptyPresentationObject");
329 aAny >>= bIsEmptyPresObj;
342 uno::Reference< beans::XPropertySetInfo > xPropertySetInfo( xPropSet->getPropertySetInfo() );
344 OUString aParentName;
345 uno::Reference< style::XStyle > xStyle;
347 if( bObjSupportsStyle )
349 if( xPropertySetInfo.is() && xPropertySetInfo->hasPropertyByName(
"Style") )
350 xPropSet->getPropertyValue(
"Style") >>= xStyle;
355 uno::Reference< beans::XPropertySet > xStylePropSet(xStyle, uno::UNO_QUERY);
356 SAL_WARN_IF( !xStylePropSet.is(),
"xmloff",
"style without a XPropertySet?" );
359 if(xStylePropSet.is())
361 OUString aFamilyName;
362 xStylePropSet->getPropertyValue(
"Family") >>= aFamilyName;
363 if( !aFamilyName.isEmpty() && aFamilyName !=
"graphics" )
367 catch(
const beans::UnknownPropertyException&)
371 "XMLShapeExport::collectShapeAutoStyles: style has no 'Family' property");
380 aParentName += xStyle->getName();
384 if (aParentName.isEmpty() && xPropertySetInfo->hasPropertyByName(
"TextBox") && xPropSet->getPropertyValue(
"TextBox").hasValue() && xPropSet->getPropertyValue(
"TextBox").get<
bool>())
388 aParentName =
"Frame";
392 std::vector< XMLPropertyState > aPropStates;
402 uno::Reference< drawing::XControlShape > xControl(xShape, uno::UNO_QUERY);
403 DBG_ASSERT(xControl.is(),
"XMLShapeExport::collectShapeAutoStyles: ShapeType control, but no XControlShape!");
406 uno::Reference< beans::XPropertySet > xControlModel(xControl->getControl(), uno::UNO_QUERY);
407 DBG_ASSERT(xControlModel.is(),
"XMLShapeExport::collectShapeAutoStyles: no control model on the control shape!");
410 if (!sNumberStyle.isEmpty())
415 DBG_ASSERT(-1 !=
nIndex,
"XMLShapeExport::collectShapeAutoStyles: could not obtain the index for our context id!");
418 aPropStates.push_back(aNewState);
423 nCount = std::count_if(aPropStates.cbegin(), aPropStates.cend(),
453 uno::Reference< beans::XPropertySetInfo > xPropSetInfo( xPropSet->getPropertySetInfo() );
454 uno::Reference< beans::XPropertyState > xPropState( xPropSet, uno::UNO_QUERY );
455 if ( xPropSetInfo.is() && xPropState.is() )
464 if ( xPropSetInfo->hasPropertyByName(
"ParaAdjust" )
465 && ( beans::PropertyState_DEFAULT_VALUE == xPropState->getPropertyState(
"ParaAdjust" ) )
471 DBG_ASSERT(-1 !=
nIndex,
"XMLShapeExport::collectShapeAutoStyles: could not obtain the index for the ParaAdjust context id!");
473 uno::Any aParaAdjustValue = xPropSet->getPropertyValue(
"ParaAdjust" );
476 aPropStates.push_back( aAlignDefaultState );
481 nCount = std::count_if(aPropStates.cbegin(), aPropStates.cend(),
506 uno::Reference< uno::XInterface > xConnection;
509 xPropSet->getPropertyValue(
gsStartShape ) >>= xConnection;
510 if( xConnection.is() )
513 xPropSet->getPropertyValue(
gsEndShape ) >>= xConnection;
514 if( xConnection.is() )
523 uno::Reference< table::XColumnRowRange > xRange( xPropSet->getPropertyValue(
gsModel ), uno::UNO_QUERY_THROW );
526 catch(
const uno::Exception&)
541 uno::Reference< drawing::XShapes > xShapes( xCollection, uno::UNO_QUERY );
551 class NewTextListsHelper
557 mrExport.GetTextParagraphExport()->PushNewTextListsHelper();
560 ~NewTextListsHelper()
562 mrExport.GetTextParagraphExport()->PopTextListsHelper();
572 css::awt::Point* pRefPoint ,
575 SAL_INFO(
"xmloff", xShape->getShapeType());
578 SAL_WARN(
"xmloff",
"XMLShapeExport::exportShape(): no auto styles where collected before export" );
581 sal_Int32 nZIndex = 0;
582 uno::Reference< beans::XPropertySet > xSet( xShape, uno::UNO_QUERY );
586 xSet->getPropertyValue(
gsHyperlink) >>= sHyperlink;
588 catch (beans::UnknownPropertyException)
592 std::unique_ptr< SvXMLElementExport > pHyperlinkElement;
596 uno::Reference<xml::sax::XAttributeList> xSaveAttribs(
605 presentation::ClickAction eAction = presentation::ClickAction_NONE;
606 xSet->getPropertyValue(
gsOnClick) >>= eAction;
608 if( (eAction == presentation::ClickAction_DOCUMENT) ||
609 (eAction == presentation::ClickAction_BOOKMARK) )
614 if( !sURL.isEmpty() )
623 catch(
const uno::Exception&)
625 TOOLS_WARN_EXCEPTION(
"xmloff",
"XMLShapeExport::exportShape(): exception during hyperlink export");
628 else if (xSet.is() && !sHyperlink.isEmpty())
638 xSet->getPropertyValue(
gsZIndex) >>= nZIndex;
642 if(
static_cast<sal_Int32
>(aShapeInfoVector.size()) <= nZIndex )
644 SAL_WARN(
"xmloff",
"XMLShapeExport::exportShape(): no shape info collected for a given shape" );
648 NewTextListsHelper aNewTextListsHelper(
mrExport );
654 uno::Reference< container::XChild > xChild( xShape, uno::UNO_QUERY );
657 uno::Reference< drawing::XShapes > xParent( xChild->getParent(), uno::UNO_QUERY );
658 SAL_WARN_IF( !xParent.is() && xParent.get() == (*maCurrentShapesIter).first.get(),
"xmloff",
"XMLShapeExport::exportShape(): Wrong call to XMLShapeExport::seekShapes()" );
666 SAL_WARN_IF( eShapeType != aShapeInfo.
meShapeType,
"xmloff",
"exportShape callings do not correspond to collectShapeAutoStyles calls!: " << xShape->getShapeType() );
689 uno::Reference< container::XNamed > xNamed( xShape, uno::UNO_QUERY );
692 const OUString
aName( xNamed->getName() );
693 if( !
aName.isEmpty() )
716 uno::Reference< uno::XInterface > xRef( xShape, uno::UNO_QUERY );
718 if( !rShapeId.isEmpty() )
728 uno::Reference< drawing::XShapes > xShapes( xShape, uno::UNO_QUERY );
733 uno::Reference< beans::XPropertySet > xProps( xShape, uno::UNO_QUERY );
735 xProps->getPropertyValue(
"LayerName") >>= aLayerName;
739 catch(
const uno::Exception&)
754 bool bPrintable =
true;
757 xSet->getPropertyValue(
gsPrintable) >>= bPrintable;
760 const unsigned short nDisplay = (
bVisible ? 2 : 0) | (bPrintable ? 1 : 0);
763 case 0: eDisplayToken =
XML_NONE;
break;
772 catch(
const uno::Exception&)
952 OSL_FAIL(
"XMLEXP: WriteShape: unknown or unexpected type of shape in export!");
957 pHyperlinkElement.reset();
975 uno::Reference< drawing::XShape > xShape;
976 const sal_Int32 nShapeCount(xShapes->getCount());
977 for(sal_Int32 nShapeId = 0; nShapeId < nShapeCount; nShapeId++)
979 xShapes->getByIndex(nShapeId) >>= xShape;
980 SAL_WARN_IF( !xShape.is(),
"xmloff",
"Shape without a XShape?" );
996 uno::Reference< drawing::XShape > xShape;
997 const sal_Int32 nShapeCount(xShapes->getCount());
998 for(sal_Int32 nShapeId = 0; nShapeId < nShapeCount; nShapeId++)
1000 xShapes->getByIndex(nShapeId) >>= xShape;
1001 SAL_WARN_IF( !xShape.is(),
"xmloff",
"Shape without a XShape?" );
1013void FixZOrder(uno::Reference<drawing::XShapes>
const& xShapes,
1014 std::function<
unsigned int (uno::Reference<beans::XPropertySet>
const&)>
const& rGetLayer)
1016 uno::Reference<drawing::XShapes3>
const xShapes3(xShapes, uno::UNO_QUERY);
1017 assert(xShapes3.is());
1022 struct Layer { std::vector<sal_Int32> shapes; sal_Int32 nMin =
SAL_MAX_INT32; sal_Int32 nMax = 0; };
1023 std::vector<Layer> layers;
1025 sal_Int32
const nCount(xShapes->getCount());
1028 uno::Reference<beans::XPropertySet>
const xShape(xShapes->getByIndex(
i), uno::UNO_QUERY);
1031 SAL_WARN(
"xmloff",
"FixZOrder: null shape, cannot sort");
1034 unsigned int const nLayer(rGetLayer(xShape));
1035 if (layers.size() <= nLayer)
1037 layers.resize(nLayer + 1);
1039 layers[nLayer].shapes.emplace_back(
i);
1040 if (
i < layers[nLayer].nMin)
1042 layers[nLayer].nMin =
i;
1044 if (layers[nLayer].nMax <
i)
1046 layers[nLayer].nMax =
i;
1049 layers.erase(std::remove_if(layers.begin(), layers.end(),
1050 [](Layer
const& rLayer) { return rLayer.shapes.empty(); }),
1052 bool isSorted(
true);
1053 for (
size_t i = 1;
i < layers.size(); ++
i)
1055 assert(layers[
i].nMin != layers[
i-1].nMax);
1056 if (layers[
i].nMin < layers[
i-1].nMax)
1066 uno::Sequence<sal_Int32> aNewOrder(
nCount);
1067 auto iterInsert(aNewOrder.getArray());
1068 for (
auto const& rLayer : layers)
1070 assert(rLayer.nMin <= rLayer.nMax);
1071 iterInsert = std::copy(rLayer.shapes.begin(), rLayer.shapes.end(), iterInsert);
1075 xShapes3->sort(aNewOrder);
1077 catch (uno::Exception
const&)
1079 SAL_WARN(
"xmloff",
"FixZOrder: exception");
1089 maCurrentShapesIter = maShapesInfos.find( xShapes );
1090 if( maCurrentShapesIter == maShapesInfos.end() )
1092 auto itPair = maShapesInfos.emplace( xShapes,
ImplXMLShapeExportInfoVector(
static_cast<ShapesInfos::size_type
>(xShapes->getCount()) ) );
1094 maCurrentShapesIter = itPair.first;
1096 SAL_WARN_IF( maCurrentShapesIter == maShapesInfos.end(),
"xmloff",
"XMLShapeExport::seekShapes(): insert into stl::map failed" );
1099 SAL_WARN_IF( (*maCurrentShapesIter).second.size() !=
static_cast<ShapesInfos::size_type
>(xShapes->getCount()),
"xmloff",
"XMLShapeExport::seekShapes(): XShapes size varied between calls" );
1104 maCurrentShapesIter = maShapesInfos.end();
1148 OUString aType(xShape->getShapeType());
1150 if(!aType.match(
"com.sun.star."))
1153 if(aType.match(
"drawing.", 13))
1185 else if(aType.match(
"OLE2", 21))
1190 uno::Reference <beans::XPropertySet> xPropSet(xShape, uno::UNO_QUERY);
1195 if(xPropSet->getPropertyValue(
"CLSID") >>= sCLSID)
1197#if !ENABLE_WASM_STRIP_CHART
1220 else if(aType.match(
"Page", 21)) { eShapeType = XmlShapeType::DrawPageShape; }
1221 else if(aType.match(
"Frame", 21)) { eShapeType = XmlShapeType::DrawFrameShape; }
1222 else if(aType.match(
"Caption", 21)) { eShapeType = XmlShapeType::DrawCaptionShape; }
1223 else if(aType.match(
"Plugin", 21)) { eShapeType = XmlShapeType::DrawPluginShape; }
1224 else if(aType.match(
"Applet", 21)) { eShapeType = XmlShapeType::DrawAppletShape; }
1225 else if(aType.match(
"MediaShape", 21)) { eShapeType = XmlShapeType::DrawMediaShape; }
1226 else if(aType.match(
"TableShape", 21)) { eShapeType = XmlShapeType::DrawTableShape; }
1229 else if(aType.match(
"Scene", 21 + 7)) { eShapeType = XmlShapeType::Draw3DSceneObject; }
1230 else if(aType.match(
"Cube", 21 + 7)) { eShapeType = XmlShapeType::Draw3DCubeObject; }
1231 else if(aType.match(
"Sphere", 21 + 7)) { eShapeType = XmlShapeType::Draw3DSphereObject; }
1232 else if(aType.match(
"Lathe", 21 + 7)) { eShapeType = XmlShapeType::Draw3DLatheObject; }
1233 else if(aType.match(
"Extrude", 21 + 7)) { eShapeType = XmlShapeType::Draw3DExtrudeObject; }
1235 else if(aType.match(
"presentation.", 13))
1238 if (aType.match(
"TitleText", 26)) { eShapeType = XmlShapeType::PresTitleTextShape; }
1239 else if(aType.match(
"Outliner", 26)) { eShapeType = XmlShapeType::PresOutlinerShape; }
1240 else if(aType.match(
"Subtitle", 26)) { eShapeType = XmlShapeType::PresSubtitleShape; }
1241 else if(aType.match(
"GraphicObject", 26)) { eShapeType = XmlShapeType::PresGraphicObjectShape; }
1242 else if(aType.match(
"Page", 26)) { eShapeType = XmlShapeType::PresPageShape; }
1243 else if(aType.match(
"OLE2", 26))
1245 eShapeType = XmlShapeType::PresOLE2Shape;
1248 uno::Reference <beans::XPropertySet> xPropSet(xShape, uno::UNO_QUERY);
1250 if(xPropSet.is()) try
1253 if(xPropSet->getPropertyValue(
"CLSID") >>= sCLSID)
1255 if( sCLSID == SvGlobalName( SO3_SC_CLASSID ).GetHexName() )
1257 eShapeType = XmlShapeType::PresSheetShape;
1261 catch(
const uno::Exception&)
1263 SAL_WARN(
"xmloff",
"XMLShapeExport::ImpCalcShapeType(), expected ole shape to have the CLSID property?" );
1266 else if(aType.match(
"Chart", 26)) { eShapeType = XmlShapeType::PresChartShape; }
1267 else if(aType.match(
"OrgChart", 26)) { eShapeType = XmlShapeType::PresOrgChartShape; }
1268 else if(aType.match(
"CalcShape", 26)) { eShapeType = XmlShapeType::PresSheetShape; }
1269 else if(aType.match(
"TableShape", 26)) { eShapeType = XmlShapeType::PresTableShape; }
1270 else if(aType.match(
"Notes", 26)) { eShapeType = XmlShapeType::PresNotesShape; }
1271 else if(aType.match(
"HandoutShape", 26)) { eShapeType = XmlShapeType::HandoutShape; }
1272 else if(aType.match(
"HeaderShape", 26)) { eShapeType = XmlShapeType::PresHeaderShape; }
1273 else if(aType.match(
"FooterShape", 26)) { eShapeType = XmlShapeType::PresFooterShape; }
1274 else if(aType.match(
"SlideNumberShape", 26)) { eShapeType = XmlShapeType::PresSlideNumberShape; }
1275 else if(aType.match(
"DateTimeShape", 26)) { eShapeType = XmlShapeType::PresDateTimeShape; }
1276 else if(aType.match(
"MediaShape", 26)) { eShapeType = XmlShapeType::PresMediaShape; }
1283 uno::Reference< drawing::XGluePointsSupplier > xSupplier( xShape, uno::UNO_QUERY );
1284 if( !xSupplier.is() )
1287 uno::Reference< container::XIdentifierAccess > xGluePoints( xSupplier->getGluePoints(), uno::UNO_QUERY );
1288 if( !xGluePoints.is() )
1291 drawing::GluePoint2 aGluePoint;
1293 const uno::Sequence< sal_Int32 > aIdSequence( xGluePoints->getIdentifiers() );
1295 for(
const sal_Int32 nIdentifier : aIdSequence )
1297 if( (xGluePoints->getByIdentifier( nIdentifier ) >>= aGluePoint) && aGluePoint.IsUserDefined )
1301 const OUString
sId( OUString::number( nIdentifier ) );
1305 aGluePoint.Position.X);
1309 aGluePoint.Position.Y);
1312 if( !aGluePoint.IsRelative )
1318 if( aGluePoint.Escape != drawing::EscapeDirection_SMART )
1331 uno::Reference<beans::XPropertySet> xPropSet(xShape, uno::UNO_QUERY);
1333 bool bIsSignatureLine =
false;
1334 xPropSet->getPropertyValue(
"IsSignatureLine") >>= bIsSignatureLine;
1335 if (!bIsSignatureLine)
1338 OUString aSignatureLineId;
1339 xPropSet->getPropertyValue(
"SignatureLineId") >>= aSignatureLineId;
1342 OUString aSuggestedSignerName;
1343 xPropSet->getPropertyValue(
"SignatureLineSuggestedSignerName") >>= aSuggestedSignerName;
1344 if (!aSuggestedSignerName.isEmpty())
1347 OUString aSuggestedSignerTitle;
1348 xPropSet->getPropertyValue(
"SignatureLineSuggestedSignerTitle") >>= aSuggestedSignerTitle;
1349 if (!aSuggestedSignerTitle.isEmpty())
1352 OUString aSuggestedSignerEmail;
1353 xPropSet->getPropertyValue(
"SignatureLineSuggestedSignerEmail") >>= aSuggestedSignerEmail;
1354 if (!aSuggestedSignerEmail.isEmpty())
1357 OUString aSigningInstructions;
1358 xPropSet->getPropertyValue(
"SignatureLineSigningInstructions") >>= aSigningInstructions;
1359 if (!aSigningInstructions.isEmpty())
1362 bool bShowSignDate =
false;
1363 xPropSet->getPropertyValue(
"SignatureLineShowSignDate") >>= bShowSignDate;
1367 bool bCanAddComment =
false;
1368 xPropSet->getPropertyValue(
"SignatureLineCanAddComment") >>= bCanAddComment;
1378 uno::Reference<beans::XPropertySet> xPropSet(xShape, uno::UNO_QUERY);
1380 uno::Any aAny = xPropSet->getPropertyValue(
"BarCodeProperties");
1382 css::drawing::BarCode aBarCode;
1383 if(!(aAny >>= aBarCode))
1389 switch(aBarCode.ErrorCorrection){
1390 case css::drawing::BarCodeErrorCorrection::LOW :
1393 case css::drawing::BarCodeErrorCorrection::MEDIUM:
1396 case css::drawing::BarCodeErrorCorrection::QUARTILE:
1399 case css::drawing::BarCodeErrorCorrection::HIGH:
1426 uno::Reference< lang::XMultiServiceFactory > xFact(
mrExport.
GetModel(), uno::UNO_QUERY );
1432 uno::Reference< beans::XPropertySet > xDefaults( xFact->createInstance(
"com.sun.star.drawing.Defaults"), uno::UNO_QUERY );
1433 if( xDefaults.is() )
1442 catch(
const lang::ServiceNotRegisteredException&)
1474 double fTRShear(0.0);
1475 double fTRRotate(0.0);
1484 const uno::Reference< beans::XPropertySet >& xPropSet)
1499 xPropSet->getPropertySetInfo()->hasPropertyByName(
"TransformationInHoriL2R") )
1501 aAny = xPropSet->getPropertyValue(
"TransformationInHoriL2R");
1505 aAny = xPropSet->getPropertyValue(
"Transformation");
1507 drawing::HomogenMatrix3 aMatrix;
1510 rMatrix.
set(0, 0, aMatrix.Line1.Column1);
1511 rMatrix.
set(0, 1, aMatrix.Line1.Column2);
1512 rMatrix.
set(0, 2, aMatrix.Line1.Column3);
1513 rMatrix.
set(1, 0, aMatrix.Line2.Column1);
1514 rMatrix.
set(1, 1, aMatrix.Line2.Column2);
1515 rMatrix.
set(1, 2, aMatrix.Line2.Column3);
1517 assert( aMatrix.Line3.Column1 == 0 );
1518 assert( aMatrix.Line3.Column2 == 0 );
1519 assert( aMatrix.Line3.Column3 == 1 );
1523 double& fTRShear,
double& fTRRotate,
::basegfx::B2DTuple& rTRTranslate, css::awt::Point* pRefPoint)
1526 rMatrix.decompose(rTRScale, rTRTranslate, fTRRotate, fTRShear);
1541 OUStringBuffer sStringBuffer;
1551 if( aTRScale.
getX() > 0.0 )
1552 aTRScale.
setX(aTRScale.
getX() - 1.0);
1553 else if( aTRScale.
getX() < 0.0 )
1554 aTRScale.
setX(aTRScale.
getX() + 1.0);
1559 aStr = sStringBuffer.makeStringAndClear();
1569 if( aTRScale.
getY() > 0.0 )
1570 aTRScale.
setY(aTRScale.
getY() - 1.0);
1571 else if( aTRScale.
getY() < 0.0 )
1572 aTRScale.
setY(aTRScale.
getY() + 1.0);
1577 aStr = sStringBuffer.makeStringAndClear();
1581 bool bTransformationIsNecessary(fTRShear != 0.0 || fTRRotate != 0.0);
1583 if(bTransformationIsNecessary)
1588 aTransform.
AddSkewX(atan(fTRShear));
1612 aStr = sStringBuffer.makeStringAndClear();
1621 aStr = sStringBuffer.makeStringAndClear();
1629 bool bIsEmpty =
false;
1636 uno::Reference< beans::XPropertySetInfo > xPropSetInfo( xPropSet->getPropertySetInfo() );
1640 if( xPropSetInfo.is() && xPropSetInfo->hasPropertyByName(
"IsEmptyPresentationObject"))
1642 xPropSet->getPropertyValue(
"IsEmptyPresentationObject") >>= bIsEmpty;
1648 if( xPropSetInfo.is() && xPropSetInfo->hasPropertyByName(
"IsPlaceholderDependent"))
1651 xPropSet->getPropertyValue(
"IsPlaceholderDependent") >>= bTemp;
1669 uno::Reference< text::XText > xText( xShape, uno::UNO_QUERY );
1672 uno::Reference< container::XEnumerationAccess > xEnumAccess( xShape, uno::UNO_QUERY );
1673 if( xEnumAccess.is() && xEnumAccess->hasElements() )
1682 CLICKACTION = 0x0001,
1689 CLICKEVENTTYPE = 0x0080,
1702 uno::Reference< document::XEventsSupplier > xEventsSupplier( xShape, uno::UNO_QUERY );
1703 if( !xEventsSupplier.is() )
1706 uno::Reference< container::XNameAccess > xEvents = xEventsSupplier->getEvents();
1707 SAL_WARN_IF( !xEvents.is(),
"xmloff",
"XEventsSupplier::getEvents() returned NULL" );
1711 Found nFound = Found::NONE;
1713 OUString aClickEventType;
1714 presentation::ClickAction eClickAction = presentation::ClickAction_NONE;
1715 presentation::AnimationEffect eEffect = presentation::AnimationEffect_NONE;
1716 presentation::AnimationSpeed eSpeed = presentation::AnimationSpeed_SLOW;
1717 OUString aStrSoundURL;
1718 bool bPlayFull =
false;
1719 sal_Int32 nVerb = 0;
1721 OUString aStrLibrary;
1722 OUString aStrBookmark;
1724 uno::Sequence< beans::PropertyValue > aClickProperties;
1725 if( xEvents->hasByName(
gsOnClick ) && (xEvents->getByName(
gsOnClick ) >>= aClickProperties) )
1727 for(
const auto& rProperty : std::as_const(aClickProperties) )
1729 if( !( nFound & Found::CLICKEVENTTYPE ) && rProperty.Name ==
gsEventType )
1731 if( rProperty.Value >>= aClickEventType )
1732 nFound |= Found::CLICKEVENTTYPE;
1734 else if( !( nFound & Found::CLICKACTION ) && rProperty.Name ==
gsClickAction )
1736 if( rProperty.Value >>= eClickAction )
1737 nFound |= Found::CLICKACTION;
1739 else if( !( nFound & Found::MACRO ) && ( rProperty.Name ==
gsMacroName || rProperty.Name ==
gsScript ) )
1741 if( rProperty.Value >>= aStrMacro )
1742 nFound |= Found::MACRO;
1744 else if( !( nFound & Found::LIBRARY ) && rProperty.Name ==
gsLibrary )
1746 if( rProperty.Value >>= aStrLibrary )
1747 nFound |= Found::LIBRARY;
1749 else if( !( nFound & Found::EFFECT ) && rProperty.Name ==
gsEffect )
1751 if( rProperty.Value >>= eEffect )
1752 nFound |= Found::EFFECT;
1754 else if( !( nFound & Found::BOOKMARK ) && rProperty.Name ==
gsBookmark )
1756 if( rProperty.Value >>= aStrBookmark )
1757 nFound |= Found::BOOKMARK;
1759 else if( !( nFound & Found::SPEED ) && rProperty.Name ==
gsSpeed )
1761 if( rProperty.Value >>= eSpeed )
1762 nFound |= Found::SPEED;
1764 else if( !( nFound & Found::SOUNDURL ) && rProperty.Name ==
gsSoundURL )
1766 if( rProperty.Value >>= aStrSoundURL )
1767 nFound |= Found::SOUNDURL;
1769 else if( !( nFound & Found::PLAYFULL ) && rProperty.Name ==
gsPlayFull )
1771 if( rProperty.Value >>= bPlayFull )
1772 nFound |= Found::PLAYFULL;
1774 else if( !( nFound & Found::VERB ) && rProperty.Name ==
gsVerb )
1776 if( rProperty.Value >>= nVerb )
1777 nFound |= Found::VERB;
1786 if( !(nFound & Found::CLICKACTION) || (eClickAction == presentation::ClickAction_NONE) )
1793 switch( eClickAction )
1796 case presentation::ClickAction_NEXTPAGE: eStrAction =
XML_NEXT_PAGE;
break;
1797 case presentation::ClickAction_FIRSTPAGE: eStrAction =
XML_FIRST_PAGE;
break;
1798 case presentation::ClickAction_LASTPAGE: eStrAction =
XML_LAST_PAGE;
break;
1799 case presentation::ClickAction_INVISIBLE: eStrAction =
XML_HIDE;
break;
1800 case presentation::ClickAction_STOPPRESENTATION:eStrAction =
XML_STOP;
break;
1801 case presentation::ClickAction_PROGRAM: eStrAction =
XML_EXECUTE;
break;
1802 case presentation::ClickAction_BOOKMARK: eStrAction =
XML_SHOW;
break;
1803 case presentation::ClickAction_DOCUMENT: eStrAction =
XML_SHOW;
break;
1805 case presentation::ClickAction_VERB: eStrAction =
XML_VERB;
break;
1806 case presentation::ClickAction_VANISH: eStrAction =
XML_FADE_OUT;
break;
1807 case presentation::ClickAction_SOUND: eStrAction =
XML_SOUND;
break;
1809 OSL_FAIL(
"unknown presentation::ClickAction found!" );
1813 OUString aEventQName(
1819 if( eClickAction == presentation::ClickAction_VANISH )
1821 if( nFound & Found::EFFECT )
1825 sal_Int16 nStartScale;
1842 if( nStartScale != -1 )
1849 if( nFound & Found::SPEED && eEffect != presentation::AnimationEffect_NONE )
1851 if( eSpeed != presentation::AnimationSpeed_MEDIUM )
1859 if( eClickAction == presentation::ClickAction_PROGRAM ||
1860 eClickAction == presentation::ClickAction_BOOKMARK ||
1861 eClickAction == presentation::ClickAction_DOCUMENT )
1863 if( eClickAction == presentation::ClickAction_BOOKMARK )
1873 if( ( nFound & Found::VERB ) && eClickAction == presentation::ClickAction_VERB )
1881 if( eClickAction == presentation::ClickAction_VANISH || eClickAction == presentation::ClickAction_SOUND )
1883 if( ( nFound & Found::SOUNDURL ) && !aStrSoundURL.isEmpty() )
1889 if( nFound & Found::PLAYFULL && bPlayFull )
1898 if( nFound & Found::MACRO )
1906 OUString aEventQName(
1911 if( nFound & Found::LIBRARY )
1914 (aStrLibrary.equalsIgnoreAsciiCase(
"StarOffice") ||
1918 sLocation +
":" + aStrMacro);
1928 else if( aClickEventType ==
gsScript )
1930 if( nFound & Found::MACRO )
1936 OUString aEventQName(
1954 OUString aDescription;
1956 uno::Reference< beans::XPropertySet > xProps( xShape, uno::UNO_QUERY_THROW );
1957 xProps->getPropertyValue(
"Title") >>= aTitle;
1958 xProps->getPropertyValue(
"Description") >>= aDescription;
1960 if(!aTitle.isEmpty())
1966 if(!aDescription.isEmpty())
1972 catch( uno::Exception& )
1980 uno::Reference< drawing::XShapes > xShapes(xShape, uno::UNO_QUERY);
1981 if(!(xShapes.is() && xShapes->getCount()))
1995 awt::Point aUpperLeft;
2000 aUpperLeft = xShape->getPosition();
2001 pRefPoint = &aUpperLeft;
2009 const uno::Reference< drawing::XShape >& xShape,
2012 const uno::Reference< beans::XPropertySet > xPropSet(xShape, uno::UNO_QUERY);
2017 bool bIsPresShape(
false);
2018 bool bIsEmptyPresObj(
false);
2026 bIsPresShape =
true;
2032 bIsPresShape =
true;
2038 bIsPresShape =
true;
2044 bIsPresShape =
true;
2050 bIsPresShape =
true;
2056 bIsPresShape =
true;
2062 bIsPresShape =
true;
2068 bIsPresShape =
true;
2086 sal_Int32 nCornerRadius(0);
2087 xPropSet->getPropertyValue(
"CornerRadius") >>= nCornerRadius;
2090 OUStringBuffer sStringBuffer;
2099 if(!bIsEmptyPresObj)
2110 const uno::Reference< drawing::XShape >& xShape,
2113 const uno::Reference< beans::XPropertySet > xPropSet(xShape, uno::UNO_QUERY);
2121 sal_Int32 nCornerRadius(0);
2122 xPropSet->getPropertyValue(
"CornerRadius") >>= nCornerRadius;
2125 OUStringBuffer sStringBuffer;
2142 const uno::Reference< drawing::XShape >& xShape,
2145 const uno::Reference< beans::XPropertySet > xPropSet(xShape, uno::UNO_QUERY);
2150 OUStringBuffer sStringBuffer;
2151 awt::Point aStart(0,0);
2152 awt::Point aEnd(1,1);
2163 double fTRShear(0.0);
2164 double fTRRotate(0.0);
2171 if (xPropSet->getPropertySetInfo()->hasPropertyByName(
"Geometry"))
2174 uno::Any aAny(xPropSet->getPropertyValue(
"Geometry"));
2175 if (
auto pSourcePolyPolygon
2176 = o3tl::tryAccess<drawing::PointSequenceSequence>(aAny))
2178 if (pSourcePolyPolygon->getLength() > 0)
2180 const drawing::PointSequence& rInnerSequence = (*pSourcePolyPolygon)[0];
2181 if (rInnerSequence.hasElements())
2183 const awt::Point& rPoint = rInnerSequence[0];
2184 aStart = awt::Point(rPoint.X + aBasePosition.X, rPoint.Y + aBasePosition.Y);
2186 if (rInnerSequence.getLength() > 1)
2188 const awt::Point& rPoint = rInnerSequence[1];
2189 aEnd = awt::Point(rPoint.X + aBasePosition.X, rPoint.Y + aBasePosition.Y);
2200 aStr = sStringBuffer.makeStringAndClear();
2213 aStr = sStringBuffer.makeStringAndClear();
2224 aStr = sStringBuffer.makeStringAndClear();
2230 aStr = sStringBuffer.makeStringAndClear();
2245 const uno::Reference< drawing::XShape >& xShape,
2248 const uno::Reference< beans::XPropertySet > xPropSet(xShape, uno::UNO_QUERY);
2253 awt::Size aSize = xShape->getSize();
2254 sal_Int32 nRx((aSize.Width + 1) / 2);
2255 sal_Int32 nRy((aSize.Height + 1) / 2);
2256 bool bCircle(nRx == nRy);
2261 drawing::CircleKind eKind = drawing::CircleKind_FULL;
2262 xPropSet->getPropertyValue(
"CircleKind") >>= eKind;
2263 if( eKind != drawing::CircleKind_FULL )
2265 OUStringBuffer sStringBuffer;
2266 sal_Int32 nStartAngle = 0;
2267 sal_Int32 nEndAngle = 0;
2268 xPropSet->getPropertyValue(
"CircleStartAngle") >>= nStartAngle;
2269 xPropSet->getPropertyValue(
"CircleEndAngle") >>= nEndAngle;
2271 const double dStartAngle = nStartAngle / 100.0;
2272 const double dEndAngle = nEndAngle / 100.0;
2292 bCreateNewline,
true);
2302 const uno::Reference< drawing::XShape >& xShape,
2305 const uno::Reference< beans::XPropertySet > xPropSet(xShape, uno::UNO_QUERY);
2318 double fTRShear(0.0);
2319 double fTRRotate(0.0);
2336 uno::Any aAny( xPropSet->getPropertyValue(
"Geometry") );
2343 auto pSourcePolyPolygon = o3tl::tryAccess<drawing::PolyPolygonBezierCoords>(aAny);
2345 if(pSourcePolyPolygon && pSourcePolyPolygon->Coordinates.getLength())
2352 if(0 == aPolyPolygon.
count())
2354 auto pSourcePolyPolygon = o3tl::tryAccess<drawing::PointSequenceSequence>(aAny);
2356 if(pSourcePolyPolygon)
2362 if(aPolyPolygon.
count())
2379 const OUString aPolygonString(
2411OUString getNameFromStreamURL(std::u16string_view rURL)
2413 static constexpr std::u16string_view sPackageURL(u
"vnd.sun.star.Package:");
2419 std::u16string_view sRequestedName = rURL.substr(sPackageURL.size());
2420 size_t nLastIndex = sRequestedName.rfind(
'/') + 1;
2421 if ((nLastIndex > 0) && (nLastIndex < sRequestedName.size()))
2422 sRequestedName = sRequestedName.substr(nLastIndex);
2423 nLastIndex = sRequestedName.rfind(
'.');
2424 if (nLastIndex != std::u16string_view::npos)
2425 sRequestedName = sRequestedName.substr(0, nLastIndex);
2426 if (!sRequestedName.empty())
2427 sResult = sRequestedName;
2436 const uno::Reference< drawing::XShape >& xShape,
2439 const uno::Reference< beans::XPropertySet > xPropSet(xShape, uno::UNO_QUERY);
2443 bool bIsEmptyPresObj =
false;
2455 if (!bIsEmptyPresObj)
2457 uno::Reference<graphic::XGraphic> xGraphic;
2458 OUString sOutMimeType;
2461 OUString aStreamURL;
2462 xPropSet->getPropertyValue(
"GraphicStreamURL") >>= aStreamURL;
2463 OUString sRequestedName = getNameFromStreamURL(aStreamURL);
2465 xPropSet->getPropertyValue(
"Graphic") >>= xGraphic;
2467 OUString sInternalURL;
2472 if (!sInternalURL.isEmpty())
2475 if (!sRequestedName.isEmpty())
2477 OUString newStreamURL =
"vnd.sun.star.Package:";
2478 if (sInternalURL[0] ==
'#')
2480 newStreamURL += sInternalURL.subView(1, sInternalURL.getLength() - 1);
2484 newStreamURL += sInternalURL;
2487 if (newStreamURL != aStreamURL)
2489 xPropSet->setPropertyValue(
"GraphicStreamURL",
uno::Any(newStreamURL));
2503 if (sOutMimeType.isEmpty())
2507 if (!sOutMimeType.isEmpty())
2513 "mime-type", sOutMimeType);
2524 if (!bIsEmptyPresObj)
2530 const bool bAddReplacementImages = officecfg::Office::Common::Save::Graphic::AddReplacementImages::get();
2531 if( !bIsEmptyPresObj && bAddReplacementImages)
2533 uno::Reference<graphic::XGraphic> xReplacementGraphic;
2534 xPropSet->getPropertyValue(
"ReplacementGraphic") >>= xReplacementGraphic;
2537 if (xReplacementGraphic.is())
2545 if (!aHref.isEmpty())
2586 const uno::Reference< drawing::XShape >& xShape,
2594 const uno::Reference< drawing::XShape >& xShape,
2597 const uno::Reference< beans::XPropertySet > xPropSet(xShape, uno::UNO_QUERY);
2604 uno::Reference< drawing::XControlShape > xControl( xShape, uno::UNO_QUERY );
2605 SAL_WARN_IF( !xControl.is(),
"xmloff",
"Control shape is not supporting XControlShape" );
2608 uno::Reference< beans::XPropertySet > xControlModel( xControl->getControl(), uno::UNO_QUERY );
2609 SAL_WARN_IF( !xControlModel.is(),
"xmloff",
"Control shape has not XControlModel" );
2610 if( xControlModel.is() )
2624 const uno::Reference< drawing::XShape >& xShape,
2627 uno::Reference< beans::XPropertySet > xProps( xShape, uno::UNO_QUERY );
2630 OUStringBuffer sStringBuffer;
2633 drawing::ConnectorType
eType = drawing::ConnectorType_STANDARD;
2634 uno::Any aAny = xProps->getPropertyValue(
"EdgeKind");
2637 if(
eType != drawing::ConnectorType_STANDARD )
2640 aStr = sStringBuffer.makeStringAndClear();
2645 sal_Int32 nDelta1 = 0, nDelta2 = 0, nDelta3 = 0;
2647 aAny = xProps->getPropertyValue(
"EdgeLine1Delta");
2649 aAny = xProps->getPropertyValue(
"EdgeLine2Delta");
2651 aAny = xProps->getPropertyValue(
"EdgeLine3Delta");
2654 if( nDelta1 != 0 || nDelta2 != 0 || nDelta3 != 0 )
2658 if( nDelta2 != 0 || nDelta3 != 0 )
2660 sStringBuffer.append(
' ' );
2665 sStringBuffer.append(
' ' );
2667 sStringBuffer, nDelta3);
2671 aStr = sStringBuffer.makeStringAndClear();
2676 awt::Point aStart(0,0);
2677 awt::Point aEnd(1,1);
2692 xProps->getPropertySetInfo()->hasPropertyByName(
"StartPositionInHoriL2R") &&
2693 xProps->getPropertySetInfo()->hasPropertyByName(
"EndPositionInHoriL2R") )
2695 xProps->getPropertyValue(
"StartPositionInHoriL2R") >>= aStart;
2696 xProps->getPropertyValue(
"EndPositionInHoriL2R") >>= aEnd;
2700 xProps->getPropertyValue(
"StartPosition") >>= aStart;
2701 xProps->getPropertyValue(
"EndPosition") >>= aEnd;
2706 aStart.X -= pRefPoint->X;
2707 aStart.Y -= pRefPoint->Y;
2708 aEnd.X -= pRefPoint->X;
2709 aEnd.Y -= pRefPoint->Y;
2717 aStr = sStringBuffer.makeStringAndClear();
2730 aStr = sStringBuffer.makeStringAndClear();
2740 aStr = sStringBuffer.makeStringAndClear();
2745 aStr = sStringBuffer.makeStringAndClear();
2749 uno::Reference< uno::XInterface > xRefS;
2750 uno::Reference< uno::XInterface > xRefE;
2753 xProps->getPropertyValue(
"StartShape") >>= xRefS;
2759 aAny = xProps->getPropertyValue(
"StartGluePointIndex");
2760 sal_Int32 nGluePointId = 0;
2761 if( aAny >>= nGluePointId )
2763 if( nGluePointId != -1 )
2771 xProps->getPropertyValue(
"EndShape") >>= xRefE;
2777 aAny = xProps->getPropertyValue(
"EndGluePointIndex");
2778 sal_Int32 nGluePointId = 0;
2779 if( aAny >>= nGluePointId )
2781 if( nGluePointId != -1 )
2789 aAny = xProps->getPropertyValue(
"PolyPolygonBezier");
2790 auto pSourcePolyPolygon = o3tl::tryAccess<drawing::PolyPolygonBezierCoords>(aAny);
2791 if(pSourcePolyPolygon && pSourcePolyPolygon->Coordinates.getLength())
2795 *pSourcePolyPolygon));
2796 const OUString aPolygonString(
2813 double fTRShear(0.0);
2814 double fTRRotate(0.0);
2817 fTRRotate, aTRTranslate, pRefPoint);
2835 const uno::Reference< drawing::XShape >& xShape,
2838 uno::Reference< beans::XPropertySet > xProps( xShape, uno::UNO_QUERY );
2841 OUStringBuffer sStringBuffer;
2844 awt::Point aStart(0,0);
2845 awt::Point aEnd(1,1);
2860 xProps->getPropertySetInfo()->hasPropertyByName(
"StartPositionInHoriL2R") &&
2861 xProps->getPropertySetInfo()->hasPropertyByName(
"EndPositionInHoriL2R") )
2863 xProps->getPropertyValue(
"StartPositionInHoriL2R") >>= aStart;
2864 xProps->getPropertyValue(
"EndPositionInHoriL2R") >>= aEnd;
2868 xProps->getPropertyValue(
"StartPosition") >>= aStart;
2869 xProps->getPropertyValue(
"EndPosition") >>= aEnd;
2874 aStart.X -= pRefPoint->X;
2875 aStart.Y -= pRefPoint->Y;
2876 aEnd.X -= pRefPoint->X;
2877 aEnd.Y -= pRefPoint->Y;
2885 aStr = sStringBuffer.makeStringAndClear();
2898 aStr = sStringBuffer.makeStringAndClear();
2908 aStr = sStringBuffer.makeStringAndClear();
2913 aStr = sStringBuffer.makeStringAndClear();
2924 uno::Reference< text::XText > xText( xShape, uno::UNO_QUERY );
2930 const uno::Reference< drawing::XShape >& xShape,
2934 uno::Reference< beans::XPropertySet > xPropSet(xShape, uno::UNO_QUERY);
2935 uno::Reference< container::XNamed > xNamed(xShape, uno::UNO_QUERY);
2937 SAL_WARN_IF( !xPropSet.is() || !xNamed.is(),
"xmloff",
"ole shape is not implementing needed interfaces");
2938 if(!(xPropSet.is() && xNamed.is()))
2944 bool bIsEmptyPresObj =
false;
2956 OUString sPersistName;
2960 if (!bIsEmptyPresObj)
2969 bool bInternal =
false;
2970 xPropSet->getPropertyValue(
"IsInternal") >>= bInternal;
2978 xPropSet->getPropertyValue(
"LinkURL") >>= sURL;
2981 xPropSet->getPropertyValue(
"PersistName") >>= sPersistName;
2982 if ( sURL.isEmpty() )
2984 if( !sPersistName.isEmpty() )
2986 sURL =
"vnd.sun.star.EmbeddedObject:" + sPersistName;
2991 xPropSet->getPropertyValue(
"CLSID") >>= sClassId;
2993 if( !sClassId.isEmpty() )
2996 if(!bExportEmbedded)
2999 if( !sURL.isEmpty() )
3014 uno::Reference<graphic::XGraphic> xGraphic;
3015 xPropSet->getPropertyValue(
"Graphic") >>= xGraphic;
3025 if (!aHref.isEmpty())
3063 if (!bIsEmptyPresObj && supportsText(eShapeType))
3069 if(bExportEmbedded && !bIsEmptyPresObj)
3074 uno::Reference< lang::XComponent > xComp;
3075 xPropSet->getPropertyValue(
"Model") >>= xComp;
3076 SAL_WARN_IF( !xComp.is(),
"xmloff",
"no xModel for own OLE format" );
3085 OUString sURLRequest( sURL );
3087 sURLRequest +=
"?oasis=false";
3092 if( !bIsEmptyPresObj )
3095 if( !bExportEmbedded )
3107 if( bExportEmbedded )
3118 const uno::Reference< drawing::XShape >& xShape,
3121 const uno::Reference< beans::XPropertySet > xPropSet(xShape, uno::UNO_QUERY);
3129 uno::Reference< beans::XPropertySetInfo > xPropSetInfo( xPropSet->getPropertySetInfo() );
3130 static constexpr OUStringLiteral aPageNumberStr(
u"PageNumber");
3131 if( xPropSetInfo.is() && xPropSetInfo->hasPropertyByName(aPageNumberStr))
3133 sal_Int32 nPageNumber = 0;
3134 xPropSet->getPropertyValue(aPageNumberStr) >>= nPageNumber;
3154 const uno::Reference< drawing::XShape >& xShape,
3157 const uno::Reference< beans::XPropertySet > xPropSet(xShape, uno::UNO_QUERY);
3165 sal_Int32 nCornerRadius(0);
3166 xPropSet->getPropertyValue(
"CornerRadius") >>= nCornerRadius;
3169 OUStringBuffer sStringBuffer;
3175 awt::Point aCaptionPoint;
3176 xPropSet->getPropertyValue(
"CaptionPoint") >>= aCaptionPoint;
3193 bCreateNewline,
true );
3205 const uno::Reference< drawing::XShape >& xShape,
3208 const uno::Reference< beans::XPropertySet > xPropSet(xShape, uno::UNO_QUERY);
3221 xPropSet->getPropertyValue(
"FrameURL") >>=
aStr;
3228 xPropSet->getPropertyValue(
"FrameName") >>=
aStr;
3229 if( !
aStr.isEmpty() )
3241 const uno::Reference< drawing::XShape >& xShape,
3244 const uno::Reference< beans::XPropertySet > xPropSet(xShape, uno::UNO_QUERY);
3257 xPropSet->getPropertyValue(
"AppletCodeBase") >>=
aStr;
3264 xPropSet->getPropertyValue(
"AppletName") >>=
aStr;
3265 if( !
aStr.isEmpty() )
3269 xPropSet->getPropertyValue(
"AppletCode") >>=
aStr;
3273 bool bIsScript =
false;
3274 xPropSet->getPropertyValue(
"AppletIsScript") >>= bIsScript;
3282 uno::Sequence< beans::PropertyValue > aCommands;
3283 xPropSet->getPropertyValue(
"AppletCommands") >>= aCommands;
3284 for(
const auto& rCommand : std::as_const(aCommands) )
3286 rCommand.Value >>=
aStr;
3297 const uno::Reference< drawing::XShape >& xShape,
3300 const uno::Reference< beans::XPropertySet > xPropSet(xShape, uno::UNO_QUERY);
3313 xPropSet->getPropertyValue(
"PluginURL") >>=
aStr;
3320 xPropSet->getPropertyValue(
"PluginMimeType") >>=
aStr;
3329 uno::Sequence< beans::PropertyValue > aCommands;
3330 xPropSet->getPropertyValue(
"PluginCommands") >>= aCommands;
3331 for(
const auto& rCommand : std::as_const(aCommands) )
3333 rCommand.Value >>=
aStr;
3344 uno::Reference<io::XInputStream>
const& xInStream,
3345 uno::Reference<embed::XStorage>
const& xTarget,
3346 OUString
const& rPath,
const OUString& rMimeType)
3349 uno::Reference<io::XStream>
const xStream(
3351 embed::ElementModes::WRITE | embed::ElementModes::TRUNCATE, proxy));
3352 uno::Reference<io::XOutputStream>
const xOutStream(
3354 if (!xOutStream.is())
3356 SAL_WARN(
"xmloff",
"no output stream");
3357 throw uno::Exception(
"no output stream",
nullptr);
3359 uno::Reference< beans::XPropertySet >
const xStreamProps(
xStream,
3361 if (xStreamProps.is()) {
3362 xStreamProps->setPropertyValue(
"MediaType",
3364 xStreamProps->setPropertyValue(
3369 xOutStream->closeOutput();
3375 uno::Reference<beans::XPropertySet>
const& xPropSet,
3376 OUString
const& rURL,
const OUString& rMimeType)
3379 if (rURL.startsWithIgnoreAsciiCase(
"vnd.sun.star.Package:", &urlPath))
3383 uno::Reference<embed::XStorage>
const xTarget(
3385 uno::Reference<io::XInputStream> xInStream;
3386 xPropSet->getPropertyValue(
"PrivateStream")
3389 if (!xInStream.is())
3391 SAL_WARN(
"xmloff",
"no input stream");
3399 catch (uno::Exception
const&)
3413void ExportGraphicPreview(
const uno::Reference<graphic::XGraphic>& xGraphic,
SvXMLExport& rExport,
const std::u16string_view& rPrefix,
const std::u16string_view& rExtension,
const OUString& rMimeType)
3417 if( xGraphic.is() )
try
3421 uno::Reference< embed::XStorage > xPictureStorage;
3422 uno::Reference< embed::XStorage > xStorage;
3423 uno::Reference< io::XStream > xPictureStream;
3425 OUString sPictureName;
3426 if( bExportEmbedded )
3428 xPictureStream.set( xContext->getServiceManager()->createInstanceWithContext(
"com.sun.star.comp.MemoryStream", xContext), uno::UNO_QUERY_THROW );
3434 xPictureStorage.set( xStorage->openStorageElement(
"Pictures" , ::embed::ElementModes::READWRITE ), uno::UNO_SET_THROW );
3439 sPictureName = rPrefix + OUString::number( ++nIndex ) + rExtension;
3441 while( xPictureStorage->hasByName( sPictureName ) );
3443 xPictureStream.set( xPictureStorage->openStreamElement( sPictureName, ::embed::ElementModes::READWRITE ), uno::UNO_SET_THROW );
3446 uno::Reference< graphic::XGraphicProvider > xProvider( graphic::GraphicProvider::create(xContext) );
3447 uno::Sequence< beans::PropertyValue > aArgs{
3451 xProvider->storeGraphic( xGraphic, aArgs );
3453 if( xPictureStorage.is() )
3455 uno::Reference< embed::XTransactedObject > xTrans( xPictureStorage, uno::UNO_QUERY );
3460 if( !bExportEmbedded )
3462 OUString sURL =
"Pictures/" + sPictureName;
3471 if( bExportEmbedded )
3473 uno::Reference< io::XSeekableInputStream > xSeekable( xPictureStream, uno::UNO_QUERY_THROW );
3477 aBase64Exp.exportOfficeBinaryDataElement( uno::Reference < io::XInputStream >( xPictureStream, uno::UNO_QUERY_THROW ) );
3480 catch( uno::Exception
const & )
3488 const uno::Reference< drawing::XShape >& xShape,
3491 const uno::Reference< beans::XPropertySet > xPropSet(xShape, uno::UNO_QUERY);
3508 xPropSet->getPropertyValue(
"MediaURL") >>= aMediaURL;
3510 xPropSet->getPropertyValue(
"MediaMimeType") >>= sMimeType;
3512 OUString
const persistentURL =
3527 static constexpr OUStringLiteral
aFalseStr(
u"false" );
3528 static constexpr OUStringLiteral
aTrueStr(
u"true" );
3531 static constexpr OUStringLiteral aLoopStr(
u"Loop" );
3532 xPropSet->getPropertyValue( aLoopStr ) >>= bLoop;
3538 static constexpr OUStringLiteral aMuteStr(
u"Mute" );
3539 xPropSet->getPropertyValue( aMuteStr ) >>= bMute;
3544 sal_Int16 nVolumeDB = 0;
3545 xPropSet->getPropertyValue(
"VolumeDB") >>= nVolumeDB;
3550 media::ZoomLevel eZoom;
3551 OUString aZoomValue;
3552 xPropSet->getPropertyValue(
"Zoom") >>= eZoom;
3555 case media::ZoomLevel_ZOOM_1_TO_4 : aZoomValue =
"25%";
break;
3556 case media::ZoomLevel_ZOOM_1_TO_2 : aZoomValue =
"50%";
break;
3557 case media::ZoomLevel_ORIGINAL : aZoomValue =
"100%";
break;
3558 case media::ZoomLevel_ZOOM_2_TO_1 : aZoomValue =
"200%";
break;
3559 case media::ZoomLevel_ZOOM_4_TO_1 : aZoomValue =
"400%";
break;
3560 case media::ZoomLevel_FIT_TO_WINDOW: aZoomValue =
"fit";
break;
3561 case media::ZoomLevel_FIT_TO_WINDOW_FIXED_ASPECT: aZoomValue =
"fixedfit";
break;
3562 case media::ZoomLevel_FULLSCREEN : aZoomValue =
"fullscreen";
break;
3568 if( !aZoomValue.isEmpty() )
3577 uno::Reference<graphic::XGraphic> xGraphic;
3578 xPropSet->getPropertyValue(
"Graphic") >>= xGraphic;
3583 ExportGraphicPreview(xGraphic,
mrExport,
u"MediaPreview",
u".png",
"image/png");
3591 uno::Reference< drawing::XShapes > xShapes(xShape, uno::UNO_QUERY);
3592 if(!(xShapes.is() && xShapes->getCount()))
3595 uno::Reference< beans::XPropertySet > xPropSet( xShape, uno::UNO_QUERY );
3596 SAL_WARN_IF( !xPropSet.is(),
"xmloff",
"XMLShapeExport::ImpExport3DSceneShape can't export a scene without a propertyset" );
3597 if( !xPropSet.is() )
3619 awt::Point aUpperLeft;
3624 aUpperLeft = xShape->getPosition();
3625 pRefPoint = &aUpperLeft;
3633 const uno::Reference< drawing::XShape >& xShape,
3636 const uno::Reference< beans::XPropertySet > xPropSet(xShape, uno::UNO_QUERY);
3641 OUStringBuffer sStringBuffer;
3644 uno::Any aAny = xPropSet->getPropertyValue(
"D3DTransformMatrix");
3645 drawing::HomogenMatrix aHomMat;
3657 aAny = xPropSet->getPropertyValue(
"D3DPosition");
3658 drawing::Position3D aPosition3D;
3659 aAny >>= aPosition3D;
3660 ::basegfx::B3DVector aPos3D(aPosition3D.PositionX, aPosition3D.PositionY, aPosition3D.PositionZ);
3663 aAny = xPropSet->getPropertyValue(
"D3DSize");
3664 drawing::Direction3D aDirection3D;
3665 aAny >>= aDirection3D;
3666 ::basegfx::B3DVector aDir3D(aDirection3D.DirectionX, aDirection3D.DirectionY, aDirection3D.DirectionZ);
3669 aDir3D = aPos3D + aDir3D;
3675 aStr = sStringBuffer.makeStringAndClear();
3683 aStr = sStringBuffer.makeStringAndClear();
3697 aAny = xPropSet->getPropertyValue(
"D3DPosition");
3698 drawing::Position3D aPosition3D;
3699 aAny >>= aPosition3D;
3700 ::basegfx::B3DVector aPos3D(aPosition3D.PositionX, aPosition3D.PositionY, aPosition3D.PositionZ);
3703 aAny = xPropSet->getPropertyValue(
"D3DSize");
3704 drawing::Direction3D aDirection3D;
3705 aAny >>= aDirection3D;
3706 ::basegfx::B3DVector aDir3D(aDirection3D.DirectionX, aDirection3D.DirectionY, aDirection3D.DirectionZ);
3712 aStr = sStringBuffer.makeStringAndClear();
3720 aStr = sStringBuffer.makeStringAndClear();
3735 aAny = xPropSet->getPropertyValue(
"D3DPolyPolygon3D");
3736 drawing::PolyPolygonShape3D aUnoPolyPolygon3D;
3737 aAny >>= aUnoPolyPolygon3D;
3742 aUnoPolyPolygon3D));
3749 aB3DHomMatrixFor2DConversion));
3764 const OUString aPolygonString(
3795 OUStringBuffer sStringBuffer;
3798 uno::Any aAny = xPropSet->getPropertyValue(
"D3DTransformMatrix");
3799 drawing::HomogenMatrix aHomMat;
3807 aAny = xPropSet->getPropertyValue(
"D3DCameraGeometry");
3808 drawing::CameraGeometry aCamGeo;
3811 ::basegfx::B3DVector aVRP(aCamGeo.vrp.PositionX, aCamGeo.vrp.PositionY, aCamGeo.vrp.PositionZ);
3815 aStr = sStringBuffer.makeStringAndClear();
3819 ::basegfx::B3DVector aVPN(aCamGeo.vpn.DirectionX, aCamGeo.vpn.DirectionY, aCamGeo.vpn.DirectionZ);
3823 aStr = sStringBuffer.makeStringAndClear();
3827 ::basegfx::B3DVector aVUP(aCamGeo.vup.DirectionX, aCamGeo.vup.DirectionY, aCamGeo.vup.DirectionZ);
3831 aStr = sStringBuffer.makeStringAndClear();
3836 aAny = xPropSet->getPropertyValue(
"D3DScenePerspective");
3837 drawing::ProjectionMode aPrjMode;
3839 if(aPrjMode == drawing::ProjectionMode_PARALLEL)
3846 aAny = xPropSet->getPropertyValue(
"D3DSceneDistance");
3847 sal_Int32 nDistance = 0;
3851 aStr = sStringBuffer.makeStringAndClear();
3855 aAny = xPropSet->getPropertyValue(
"D3DSceneFocalLength");
3856 sal_Int32 nFocalLength = 0;
3857 aAny >>= nFocalLength;
3860 aStr = sStringBuffer.makeStringAndClear();
3864 aAny = xPropSet->getPropertyValue(
"D3DSceneShadowSlant");
3865 sal_Int16 nShadowSlant = 0;
3866 aAny >>= nShadowSlant;
3870 aAny = xPropSet->getPropertyValue(
"D3DSceneShadeMode");
3871 drawing::ShadeMode aShadeMode;
3872 if(aAny >>= aShadeMode)
3874 if(aShadeMode == drawing::ShadeMode_FLAT)
3876 else if(aShadeMode == drawing::ShadeMode_PHONG)
3878 else if(aShadeMode == drawing::ShadeMode_SMOOTH)
3891 aAny = xPropSet->getPropertyValue(
"D3DSceneAmbientColor");
3892 sal_Int32 nAmbientColor = 0;
3893 aAny >>= nAmbientColor;
3895 aStr = sStringBuffer.makeStringAndClear();
3899 aAny = xPropSet->getPropertyValue(
"D3DSceneTwoSidedLighting");
3900 bool bTwoSidedLighting =
false;
3901 aAny >>= bTwoSidedLighting;
3903 aStr = sStringBuffer.makeStringAndClear();
3912 OUStringBuffer sStringBuffer;
3914 static constexpr OUStringLiteral aColorPropName(
u"D3DSceneLightColor");
3915 static constexpr OUStringLiteral aDirectionPropName(
u"D3DSceneLightDirection");
3916 static constexpr OUStringLiteral aLightOnPropName(
u"D3DSceneLightOn");
3919 drawing::Direction3D aLightDir;
3920 bool bLightOnOff =
false;
3921 for(sal_Int32 nLamp = 1; nLamp <= 8; nLamp++)
3923 OUString aIndexStr = OUString::number( nLamp );
3926 OUString
aPropName = aColorPropName + aIndexStr;
3927 sal_Int32 nLightColor = 0;
3928 xPropSet->getPropertyValue(
aPropName ) >>= nLightColor;
3930 aStr = sStringBuffer.makeStringAndClear();
3934 aPropName = aDirectionPropName + aIndexStr;
3935 xPropSet->getPropertyValue(
aPropName) >>= aLightDir;
3936 aLightDirection =
::basegfx::B3DVector(aLightDir.DirectionX, aLightDir.DirectionY, aLightDir.DirectionZ);
3938 aStr = sStringBuffer.makeStringAndClear();
3942 aPropName = aLightOnPropName + aIndexStr;
3943 xPropSet->getPropertyValue(
aPropName) >>= bLightOnOff;
3945 aStr = sStringBuffer.makeStringAndClear();
3962static void ExportParameter( OUStringBuffer& rStrBuffer,
const css::drawing::EnhancedCustomShapeParameter& rParameter )
3964 if ( !rStrBuffer.isEmpty() )
3965 rStrBuffer.append(
' ' );
3966 if ( rParameter.Value.getValueTypeClass() == uno::TypeClass_DOUBLE )
3968 double fNumber = 0.0;
3969 rParameter.Value >>= fNumber;
3970 ::rtl::math::doubleToUStringBuffer( rStrBuffer, fNumber, rtl_math_StringFormat_Automatic, rtl_math_DecimalPlaces_Max,
'.',
true );
3975 rParameter.Value >>=
nValue;
3977 switch( rParameter.Type )
3979 case css::drawing::EnhancedCustomShapeParameterType::EQUATION :
3981 rStrBuffer.append(
"?f" + OUString::number(
nValue ) );
3985 case css::drawing::EnhancedCustomShapeParameterType::ADJUSTMENT :
3987 rStrBuffer.append(
'$' );
3988 rStrBuffer.append(
nValue );
3992 case css::drawing::EnhancedCustomShapeParameterType::BOTTOM :
3994 case css::drawing::EnhancedCustomShapeParameterType::RIGHT :
3996 case css::drawing::EnhancedCustomShapeParameterType::TOP :
3998 case css::drawing::EnhancedCustomShapeParameterType::LEFT :
4000 case css::drawing::EnhancedCustomShapeParameterType::XSTRETCH :
4002 case css::drawing::EnhancedCustomShapeParameterType::YSTRETCH :
4004 case css::drawing::EnhancedCustomShapeParameterType::HASSTROKE :
4006 case css::drawing::EnhancedCustomShapeParameterType::HASFILL :
4008 case css::drawing::EnhancedCustomShapeParameterType::WIDTH :
4010 case css::drawing::EnhancedCustomShapeParameterType::HEIGHT :
4012 case css::drawing::EnhancedCustomShapeParameterType::LOGWIDTH :
4014 case css::drawing::EnhancedCustomShapeParameterType::LOGHEIGHT :
4017 rStrBuffer.append(
nValue );
4025 for (
i = 0;
i < rEquations.getLength();
i++ )
4027 OUString
aStr=
"f" + OUString::number(
i );
4030 aStr = rEquations[
i ];
4049 if ( !rHandles.hasElements() )
4053 OUStringBuffer aStrBuffer;
4055 for (
const uno::Sequence< beans::PropertyValue >& rPropSeq : rHandles )
4057 bool bPosition =
false;
4058 for (
const beans::PropertyValue& rPropVal : rPropSeq )
4060 switch(
EASGet( rPropVal.Name ) )
4064 css::drawing::EnhancedCustomShapeParameterPair aPosition;
4065 if ( rPropVal.Value >>= aPosition )
4069 aStr = aStrBuffer.makeStringAndClear();
4078 if ( rPropVal.Value >>= bMirroredX )
4086 if ( rPropVal.Value >>= bMirroredY )
4094 if ( rPropVal.Value >>= bSwitched )
4101 css::drawing::EnhancedCustomShapeParameterPair aPolar;
4102 if ( rPropVal.Value >>= aPolar )
4106 aStr = aStrBuffer.makeStringAndClear();
4113 css::drawing::EnhancedCustomShapeParameter aRadiusRangeMinimum;
4114 if ( rPropVal.Value >>= aRadiusRangeMinimum )
4117 aStr = aStrBuffer.makeStringAndClear();
4124 css::drawing::EnhancedCustomShapeParameter aRadiusRangeMaximum;
4125 if ( rPropVal.Value >>= aRadiusRangeMaximum )
4128 aStr = aStrBuffer.makeStringAndClear();
4135 css::drawing::EnhancedCustomShapeParameter aXRangeMinimum;
4136 if ( rPropVal.Value >>= aXRangeMinimum )
4139 aStr = aStrBuffer.makeStringAndClear();
4146 css::drawing::EnhancedCustomShapeParameter aXRangeMaximum;
4147 if ( rPropVal.Value >>= aXRangeMaximum )
4150 aStr = aStrBuffer.makeStringAndClear();
4157 css::drawing::EnhancedCustomShapeParameter aYRangeMinimum;
4158 if ( rPropVal.Value >>= aYRangeMinimum )
4161 aStr = aStrBuffer.makeStringAndClear();
4168 css::drawing::EnhancedCustomShapeParameter aYRangeMaximum;
4169 if ( rPropVal.Value >>= aYRangeMaximum )
4172 aStr = aStrBuffer.makeStringAndClear();
4189 const uno::Sequence< css::drawing::EnhancedCustomShapeParameterPair >& rCoordinates,
4190 const uno::Sequence< css::drawing::EnhancedCustomShapeSegment >& rSegments,
4191 bool bExtended =
false )
4195 OUStringBuffer aStrBuffer;
4196 bool bNeedExtended =
false;
4198 sal_Int32
i, j, k, l;
4200 sal_Int32 nCoords = rCoordinates.getLength();
4201 sal_Int32 nSegments = rSegments.getLength();
4202 bool bSimpleSegments = nSegments == 0;
4203 if ( bSimpleSegments )
4205 for ( j =
i = 0; j < nSegments; j++ )
4207 css::drawing::EnhancedCustomShapeSegment aSegment;
4208 if ( bSimpleSegments )
4216 aSegment.Command = css::drawing::EnhancedCustomShapeSegmentCommand::MOVETO;
4221 aSegment.Count =
static_cast<sal_Int16
>(std::min( nCoords - 1, sal_Int32(32767) ));
4222 aSegment.Command = css::drawing::EnhancedCustomShapeSegmentCommand::LINETO;
4228 aSegment.Command = css::drawing::EnhancedCustomShapeSegmentCommand::CLOSESUBPATH;
4234 aSegment.Command = css::drawing::EnhancedCustomShapeSegmentCommand::ENDSUBPATH;
4240 aSegment = rSegments[ j ];
4242 if ( !aStrBuffer.isEmpty() )
4243 aStrBuffer.append(
' ' );
4245 sal_Int32 nParameter = 0;
4246 switch( aSegment.Command )
4248 case css::drawing::EnhancedCustomShapeSegmentCommand::CLOSESUBPATH :
4249 aStrBuffer.append(
'Z' );
break;
4250 case css::drawing::EnhancedCustomShapeSegmentCommand::ENDSUBPATH :
4251 aStrBuffer.append(
'N' );
break;
4252 case css::drawing::EnhancedCustomShapeSegmentCommand::NOFILL :
4253 aStrBuffer.append(
'F' );
break;
4254 case css::drawing::EnhancedCustomShapeSegmentCommand::NOSTROKE :
4255 aStrBuffer.append(
'S' );
break;
4257 case css::drawing::EnhancedCustomShapeSegmentCommand::MOVETO :
4258 aStrBuffer.append(
'M' ); nParameter = 1;
break;
4259 case css::drawing::EnhancedCustomShapeSegmentCommand::LINETO :
4260 aStrBuffer.append(
'L' ); nParameter = 1;
break;
4261 case css::drawing::EnhancedCustomShapeSegmentCommand::CURVETO :
4262 aStrBuffer.append(
'C' ); nParameter = 3;
break;
4263 case css::drawing::EnhancedCustomShapeSegmentCommand::ANGLEELLIPSETO :
4264 aStrBuffer.append(
'T' ); nParameter = 3;
break;
4265 case css::drawing::EnhancedCustomShapeSegmentCommand::ANGLEELLIPSE :
4266 aStrBuffer.append(
'U' ); nParameter = 3;
break;
4267 case css::drawing::EnhancedCustomShapeSegmentCommand::ARCTO :
4268 aStrBuffer.append(
'A' ); nParameter = 4;
break;
4269 case css::drawing::EnhancedCustomShapeSegmentCommand::ARC :
4270 aStrBuffer.append(
'B' ); nParameter = 4;
break;
4271 case css::drawing::EnhancedCustomShapeSegmentCommand::CLOCKWISEARCTO :
4272 aStrBuffer.append(
'W' ); nParameter = 4;
break;
4273 case css::drawing::EnhancedCustomShapeSegmentCommand::CLOCKWISEARC :
4274 aStrBuffer.append(
'V' ); nParameter = 4;
break;
4275 case css::drawing::EnhancedCustomShapeSegmentCommand::ELLIPTICALQUADRANTX :
4276 aStrBuffer.append(
'X' ); nParameter = 1;
break;
4277 case css::drawing::EnhancedCustomShapeSegmentCommand::ELLIPTICALQUADRANTY :
4278 aStrBuffer.append(
'Y' ); nParameter = 1;
break;
4279 case css::drawing::EnhancedCustomShapeSegmentCommand::QUADRATICCURVETO :
4280 aStrBuffer.append(
'Q' ); nParameter = 2;
break;
4281 case css::drawing::EnhancedCustomShapeSegmentCommand::ARCANGLETO :
4283 aStrBuffer.append(
'G' );
4286 aStrBuffer.setLength( aStrBuffer.getLength() - 1);
4287 bNeedExtended =
true;
4291 case css::drawing::EnhancedCustomShapeSegmentCommand::DARKEN :
4293 aStrBuffer.append(
'H' );
4295 bNeedExtended =
true;
4297 case css::drawing::EnhancedCustomShapeSegmentCommand::DARKENLESS :
4299 aStrBuffer.append(
'I' );
4301 bNeedExtended =
true;
4303 case css::drawing::EnhancedCustomShapeSegmentCommand::LIGHTEN :
4305 aStrBuffer.append(
'J' );
4307 bNeedExtended =
true;
4309 case css::drawing::EnhancedCustomShapeSegmentCommand::LIGHTENLESS :
4311 aStrBuffer.append(
'K' );
4313 bNeedExtended =
true;
4318 aSegment.Command = css::drawing::EnhancedCustomShapeSegmentCommand::LINETO;
4324 for ( k = 0; k < aSegment.Count; k++ )
4326 if ( (
i + nParameter ) <= nCoords )
4328 for ( l = 0; l < nParameter; l++ )
4342 aStr = aStrBuffer.makeStringAndClear();
4350 bool bEquations =
false;
4351 uno::Sequence< OUString > aEquations;
4353 bool bHandles =
false;
4354 uno::Sequence< beans::PropertyValues > aHandles;
4356 uno::Sequence< css::drawing::EnhancedCustomShapeSegment >
aSegments;
4357 uno::Sequence< css::drawing::EnhancedCustomShapeParameterPair > aCoordinates;
4359 uno::Sequence< css::drawing::EnhancedCustomShapeAdjustmentValue > aAdjustmentValues;
4362 OUStringBuffer aStrBuffer;
4363 double fTextRotateAngle(0.0);
4364 double fTextPreRotateAngle(0.0);
4367 uno::Reference< beans::XPropertySetInfo > xPropSetInfo( xPropSet->getPropertySetInfo() );
4370 static constexpr OUStringLiteral sCustomShapeGeometry(
u"CustomShapeGeometry" );
4371 if ( xPropSetInfo.is() && xPropSetInfo->hasPropertyByName( sCustomShapeGeometry ) )
4373 uno::Any aGeoPropSet( xPropSet->getPropertyValue( sCustomShapeGeometry ) );
4374 uno::Sequence< beans::PropertyValue > aGeoPropSeq;
4376 if ( aGeoPropSet >>= aGeoPropSeq )
4378 bool bCoordinates =
false;
4379 OUString aCustomShapeType(
"non-primitive" );
4381 for (
const beans::PropertyValue& rGeoProp : std::as_const(aGeoPropSeq) )
4383 switch(
EASGet( rGeoProp.Name ) )
4387 rGeoProp.Value >>= aCustomShapeType;
4393 if ( rGeoProp.Value >>= bMirroredX )
4401 if ( rGeoProp.Value >>= bMirroredY )
4408 awt::Rectangle aRect;
4409 if ( rGeoProp.Value >>= aRect )
4418 rGeoProp.Value >>= fTextPreRotateAngle;
4423 rGeoProp.Value >>= fTextRotateAngle;
4428 uno::Sequence< beans::PropertyValue > aExtrusionPropSeq;
4429 if ( rGeoProp.Value >>= aExtrusionPropSeq )
4431 bool bSkewValuesProvided =
false;
4432 for (
const beans::PropertyValue& rProp : std::as_const(aExtrusionPropSeq) )
4434 switch(
EASGet( rProp.Name ) )
4439 if ( rProp.Value >>= bExtrusionOn )
4446 double fExtrusionBrightness = 0;
4447 if ( rProp.Value >>= fExtrusionBrightness )
4451 fExtrusionBrightness,
4453 util::MeasureUnit::PERCENT,
4454 util::MeasureUnit::PERCENT);
4455 aStrBuffer.append(
'%' );
4456 aStr = aStrBuffer.makeStringAndClear();
4463 css::drawing::EnhancedCustomShapeParameterPair aDepthParaPair;
4464 if ( rProp.Value >>= aDepthParaPair )
4467 if ( aDepthParaPair.First.Value >>= fDepth )
4471 aStr = aStrBuffer.makeStringAndClear();
4479 double fExtrusionDiffusion = 0;
4480 if ( rProp.Value >>= fExtrusionDiffusion )
4484 fExtrusionDiffusion,
4486 util::MeasureUnit::PERCENT,
4487 util::MeasureUnit::PERCENT);
4488 aStrBuffer.append(
'%' );
4489 aStr = aStrBuffer.makeStringAndClear();
4496 sal_Int32 nExtrusionNumberOfLineSegments = 0;
4497 if ( rProp.Value >>= nExtrusionNumberOfLineSegments )
4503 bool bExtrusionLightFace;
4504 if ( rProp.Value >>= bExtrusionLightFace )
4511 bool bExtrusionFirstLightHarsh;
4512 if ( rProp.Value >>= bExtrusionFirstLightHarsh )
4519 bool bExtrusionSecondLightHarsh;
4520 if ( rProp.Value >>= bExtrusionSecondLightHarsh )
4527 double fExtrusionFirstLightLevel = 0;
4528 if ( rProp.Value >>= fExtrusionFirstLightLevel )
4532 fExtrusionFirstLightLevel,
4534 util::MeasureUnit::PERCENT,
4535 util::MeasureUnit::PERCENT);
4536 aStrBuffer.append(
'%' );
4537 aStr = aStrBuffer.makeStringAndClear();
4544 double fExtrusionSecondLightLevel = 0;
4545 if ( rProp.Value >>= fExtrusionSecondLightLevel )
4549 fExtrusionSecondLightLevel,
4551 util::MeasureUnit::PERCENT,
4552 util::MeasureUnit::PERCENT);
4553 aStrBuffer.append(
'%' );
4554 aStr = aStrBuffer.makeStringAndClear();
4561 drawing::Direction3D aExtrusionFirstLightDirection;
4562 if ( rProp.Value >>= aExtrusionFirstLightDirection )
4564 ::basegfx::B3DVector aVec3D( aExtrusionFirstLightDirection.DirectionX, aExtrusionFirstLightDirection.DirectionY,
4565 aExtrusionFirstLightDirection.DirectionZ );
4567 aStr = aStrBuffer.makeStringAndClear();
4574 drawing::Direction3D aExtrusionSecondLightDirection;
4575 if ( rProp.Value >>= aExtrusionSecondLightDirection )
4577 ::basegfx::B3DVector aVec3D( aExtrusionSecondLightDirection.DirectionX, aExtrusionSecondLightDirection.DirectionY,
4578 aExtrusionSecondLightDirection.DirectionZ );
4580 aStr = aStrBuffer.makeStringAndClear();
4587 bool bExtrusionMetal;
4588 if ( rProp.Value >>= bExtrusionMetal )
4596 sal_Int16 eMetalType;
4597 if (rProp.Value >>= eMetalType)
4603 if (eMetalType == drawing::EnhancedCustomShapeMetalType::MetalMSCompatible)
4604 aStr =
"loext:MetalMSCompatible";
4606 aStr =
"draw:MetalODF";
4615 drawing::ShadeMode eShadeMode;
4616 if( rProp.Value >>= eShadeMode )
4618 if( eShadeMode == drawing::ShadeMode_FLAT )
4620 else if( eShadeMode == drawing::ShadeMode_PHONG )
4622 else if( eShadeMode == drawing::ShadeMode_SMOOTH )
4637 css::drawing::EnhancedCustomShapeParameterPair aRotateAngleParaPair;
4638 if ( rProp.Value >>= aRotateAngleParaPair )
4642 aStr = aStrBuffer.makeStringAndClear();
4649 drawing::Direction3D aExtrusionRotationCenter;
4650 if ( rProp.Value >>= aExtrusionRotationCenter )
4652 ::basegfx::B3DVector aVec3D( aExtrusionRotationCenter.DirectionX, aExtrusionRotationCenter.DirectionY,
4653 aExtrusionRotationCenter.DirectionZ );
4655 aStr = aStrBuffer.makeStringAndClear();
4662 double fExtrusionShininess = 0;
4663 if ( rProp.Value >>= fExtrusionShininess )
4667 fExtrusionShininess,
4669 util::MeasureUnit::PERCENT,
4670 util::MeasureUnit::PERCENT);
4671 aStrBuffer.append(
'%' );
4672 aStr = aStrBuffer.makeStringAndClear();
4679 css::drawing::EnhancedCustomShapeParameterPair aSkewParaPair;
4680 if ( rProp.Value >>= aSkewParaPair )
4682 bSkewValuesProvided =
true;
4685 aStr = aStrBuffer.makeStringAndClear();
4692 double fExtrusionSpecularity = 0;
4693 if ( rProp.Value >>= fExtrusionSpecularity )
4702 fExtrusionSpecularity,
4704 util::MeasureUnit::PERCENT,
4705 util::MeasureUnit::PERCENT);
4706 aStrBuffer.append(
'%' );
4707 aStr = aStrBuffer.makeStringAndClear();
4713 fExtrusionSpecularity = std::clamp<double>(fExtrusionSpecularity, 0.0, 100.0);
4717 fExtrusionSpecularity,
4719 util::MeasureUnit::PERCENT,
4720 util::MeasureUnit::PERCENT);
4721 aStrBuffer.append(
'%' );
4722 aStr = aStrBuffer.makeStringAndClear();
4729 drawing::ProjectionMode eProjectionMode;
4730 if ( rProp.Value >>= eProjectionMode )
4737 drawing::Position3D aExtrusionViewPoint;
4738 if ( rProp.Value >>= aExtrusionViewPoint )
4741 aStr = aStrBuffer.makeStringAndClear();
4748 css::drawing::EnhancedCustomShapeParameterPair aOriginParaPair;
4749 if ( rProp.Value >>= aOriginParaPair )
4753 aStr = aStrBuffer.makeStringAndClear();
4760 bool bExtrusionColor;
4761 if ( rProp.Value >>= bExtrusionColor )
4773 if (!bSkewValuesProvided)
4783 uno::Sequence< beans::PropertyValue > aTextPathPropSeq;
4784 if ( rGeoProp.Value >>= aTextPathPropSeq )
4786 for (
const beans::PropertyValue& rProp : std::as_const(aTextPathPropSeq) )
4788 switch(
EASGet( rProp.Name ) )
4793 if ( rProp.Value >>= bTextPathOn )
4800 css::drawing::EnhancedCustomShapeTextPathMode eTextPathMode;
4801 if ( rProp.Value >>= eTextPathMode )
4803 switch ( eTextPathMode )
4811 if ( !
aStr.isEmpty() )
4819 if ( rProp.Value >>= bScaleX )
4828 bool bSameLetterHeights;
4829 if ( rProp.Value >>= bSameLetterHeights )
4843 uno::Sequence< beans::PropertyValue > aPathPropSeq;
4844 if ( rGeoProp.Value >>= aPathPropSeq )
4846 for (
const beans::PropertyValue& rProp : std::as_const(aPathPropSeq) )
4848 switch(
EASGet( rProp.Name ) )
4857 uno::Sequence< awt::Size > aSubViewSizes;
4858 rProp.Value >>= aSubViewSizes;
4860 for (
int nIdx = 0; nIdx < aSubViewSizes.getLength(); nIdx++ )
4863 aStrBuffer.append(
' ');
4864 aStrBuffer.append( aSubViewSizes[nIdx].
Width );
4865 aStrBuffer.append(
' ');
4866 aStrBuffer.append( aSubViewSizes[nIdx].
Height );
4868 aStr = aStrBuffer.makeStringAndClear();
4874 bool bExtrusionAllowed;
4875 if ( rProp.Value >>= bExtrusionAllowed )
4882 bool bConcentricGradientFillAllowed;
4883 if ( rProp.Value >>= bConcentricGradientFillAllowed )
4890 bool bTextPathAllowed;
4891 if ( rProp.Value >>= bTextPathAllowed )
4898 css::uno::Sequence< css::drawing::EnhancedCustomShapeParameterPair> aGluePoints;
4899 if ( rProp.Value >>= aGluePoints )
4901 if ( aGluePoints.hasElements() )
4903 for(
const auto& rGluePoint : std::as_const(aGluePoints) )
4908 aStr = aStrBuffer.makeStringAndClear();
4916 sal_Int16 nGluePointType = sal_Int16();
4917 if ( rProp.Value >>= nGluePointType )
4919 switch ( nGluePointType )
4925 if ( !
aStr.isEmpty() )
4932 bCoordinates = ( rProp.Value >>= aCoordinates );
4942 sal_Int32 nStretchPoint = 0;
4943 if ( rProp.Value >>= nStretchPoint )
4949 sal_Int32 nStretchPoint = 0;
4950 if ( rProp.Value >>= nStretchPoint )
4956 css::uno::Sequence< css::drawing::EnhancedCustomShapeTextFrame > aPathTextFrames;
4957 if ( rProp.Value >>= aPathTextFrames )
4959 if ( aPathTextFrames.hasElements() )
4961 for (
const auto& rPathTextFrame : std::as_const(aPathTextFrames) )
4968 aStr = aStrBuffer.makeStringAndClear();
4983 bEquations = ( rGeoProp.Value >>= aEquations );
4988 bHandles = ( rGeoProp.Value >>= aHandles );
4993 rGeoProp.Value >>= aAdjustmentValues;
5002 fTextRotateAngle += fTextPreRotateAngle;
5007 if (xPropSetInfo->hasPropertyByName(
u"WritingMode"))
5009 sal_Int16 nDirection = -1;
5010 xPropSet->getPropertyValue(
u"WritingMode") >>= nDirection;
5011 if (nDirection == text::WritingMode2::TB_RL90)
5012 fTextRotateAngle -= 90;
5013 else if (nDirection == text::WritingMode2::BT_LR)
5014 fTextRotateAngle -= 270;
5017 if (fTextRotateAngle != 0)
5020 aStr = aStrBuffer.makeStringAndClear();
5027 sal_Int32 nAdjustmentValues = aAdjustmentValues.getLength();
5028 if ( nAdjustmentValues )
5031 for (
i = 0;
i < nAdjustmentValues;
i++ )
5034 aStrBuffer.append(
' ' );
5036 const css::drawing::EnhancedCustomShapeAdjustmentValue& rAdj = aAdjustmentValues[
i ];
5037 if ( rAdj.State == beans::PropertyState_DIRECT_VALUE )
5039 if ( rAdj.Value.getValueTypeClass() == uno::TypeClass_DOUBLE )
5041 double fValue = 0.0;
5042 rAdj.Value >>= fValue;
5048 aStrBuffer.append(
nValue);
5054 aStrBuffer.append(
"0");
5057 aStr = aStrBuffer.makeStringAndClear();
5072 const uno::Reference< drawing::XShape >& xShape,
5075 const uno::Reference< beans::XPropertySet > xPropSet(xShape, uno::UNO_QUERY);
5076 if ( !xPropSet.is() )
5079 uno::Reference< beans::XPropertySetInfo > xPropSetInfo( xPropSet->getPropertySetInfo() );
5084 if ( xPropSetInfo.is() )
5087 if ( xPropSetInfo->hasPropertyByName(
"CustomShapeEngine" ) )
5089 uno::Any aEngine( xPropSet->getPropertyValue(
"CustomShapeEngine" ) );
5090 if ( ( aEngine >>=
aStr ) && !
aStr.isEmpty() )
5093 if ( xPropSetInfo->hasPropertyByName(
"CustomShapeData" ) )
5095 uno::Any aData( xPropSet->getPropertyValue(
"CustomShapeData" ) );
5112 uno::Reference< beans::XPropertySet > xPropSet(xShape, uno::UNO_QUERY);
5113 uno::Reference< container::XNamed > xNamed(xShape, uno::UNO_QUERY);
5115 SAL_WARN_IF( !xPropSet.is() || !xNamed.is(),
"xmloff",
"xmloff::XMLShapeExport::ImpExportTableShape(), table shape is not implementing needed interfaces");
5116 if(!(xPropSet.is() && xNamed.is()))
5124 bool bIsEmptyPresObj =
false;
5137 if( !bIsEmptyPresObj )
5139 uno::Reference< container::XNamed > xTemplate( xPropSet->getPropertyValue(
"TableTemplate"), uno::UNO_QUERY );
5140 if( xTemplate.is() )
5142 const OUString sTemplate( xTemplate->getName() );
5143 if( !sTemplate.isEmpty() )
5152 xPropSet->getPropertyValue( pEntry->getApiName() ) >>= bBool;
5156 catch( uno::Exception& )
5164 uno::Reference< table::XColumnRowRange > xRange( xPropSet->getPropertyValue(
gsModel ), uno::UNO_QUERY_THROW );
5169 if( !bIsEmptyPresObj )
5171 uno::Reference< graphic::XGraphic > xGraphic( xPropSet->getPropertyValue(
"ReplacementGraphic"), uno::UNO_QUERY );
5172 ExportGraphicPreview(xGraphic,
mrExport,
u"TablePreview",
u".svm",
"image/x-vclgraphic");
5179 catch( uno::Exception
const & )
void SdXMLImplSetEffect(AnimationEffect eEffect, XMLEffect &eKind, XMLEffectDirection &eDirection, sal_Int16 &nStartScale, bool &bIn)
const SvXMLEnumMapEntry< XMLEffectDirection > aXML_AnimationDirection_EnumMap[]
const SvXMLEnumMapEntry< AnimationSpeed > aXML_AnimationSpeed_EnumMap[]
const SvXMLEnumMapEntry< XMLEffect > aXML_AnimationEffect_EnumMap[]
void Increment(sal_Int32 nInc=1)
const OUString & GetExportString()
const SvXMLNamespaceMap & GetNamespaceMap() const
ProgressBarHelper * GetProgressBarHelper()
::comphelper::UnoInterfaceToUniqueIdentifierMapper & getInterfaceToIdentifierMapper()
OUString GetRelativeReference(const OUString &rValue)
void AddAttributeList(const css::uno::Reference< css::xml::sax::XAttributeList > &xAttrList)
rtl::Reference< XMLTextParagraphExport > const & GetTextParagraphExport()
void AddAttribute(sal_uInt16 nPrefix, const OUString &rName, const OUString &rValue)
void Characters(const OUString &rChars)
SvXMLExportFlags getExportFlags() const
bool GetGraphicMimeTypeFromStream(css::uno::Reference< css::graphic::XGraphic > const &rxGraphic, OUString &rOutMimeType)
virtual void exportAnnotationMeta(const css::uno::Reference< css::drawing::XShape > &xShape)
OUString AddEmbeddedObject(const OUString &rEmbeddedObjectURL)
rtl::Reference< SchXMLExportHelper > const & GetChartExport()
const css::uno::Reference< css::frame::XModel > & GetModel() const
void SAL_DLLPRIVATE AddAttributeIdLegacy(sal_uInt16 const nLegacyPrefix, OUString const &rValue)
add xml:id and legacy namespace id
SvtSaveOptions::ODFSaneDefaultVersion getSaneDefaultVersion() const
returns the deterministic version for odf export
rtl::Reference< XMLShapeExport > const & GetShapeExport()
rtl::Reference< SvXMLAutoStylePoolP > const & GetAutoStylePool()
OUString EncodeStyleName(const OUString &rName, bool *pEncoded=nullptr) const
bool AddEmbeddedXGraphicAsBase64(css::uno::Reference< css::graphic::XGraphic > const &rxGraphic)
css::uno::Reference< css::embed::XStorage > const & GetTargetStorage() const
XMLImageMapExport & GetImageMapExport()
get the export for image maps
void ExportEmbeddedOwnObject(css::uno::Reference< css::lang::XComponent > const &rComp)
const css::uno::Reference< css::uno::XComponentContext > & getComponentContext() const
rtl::Reference< xmloff::OFormLayerXMLExport > const & GetFormExport()
const SvXMLUnitConverter & GetMM100UnitConverter() const
bool AddEmbeddedObjectAsBase64(const OUString &rEmbeddedObjectURL)
OUString AddEmbeddedXGraphic(css::uno::Reference< css::graphic::XGraphic > const &rxGraphic, OUString &rOutMimeType, OUString const &rRequestedName=OUString())
OUString GetQNameByKey(sal_uInt16 nKey, const OUString &rLocalName, bool bCache=true) const
the SvXMLTypeConverter converts values of various types from their internal representation to the tex...
static bool convertEnum(EnumT &rEnum, std::u16string_view rValue, const SvXMLEnumMapEntry< EnumT > *pMap)
convert string to enum using given enum map, if the enum is not found in the map, this method will re...
bool convertPosition3D(css::drawing::Position3D &rPosition, std::string_view rValue) const
convert string to Position3D
void convertDouble(OUStringBuffer &rBuffer, double fNumber) const
convert double number to string (using ::rtl::math) and DO convert to export MapUnit using meCoreMeas...
static bool convertB3DVector(::basegfx::B3DVector &rVector, std::string_view rValue)
convert string to basegfx::B3DVector
void convertMeasureToXML(OUStringBuffer &rBuffer, sal_Int32 nMeasure) const
convert measure to string: from meCoreMeasureUnit to meXMLMeasureUnit
static void prepare(const css::uno::Reference< css::drawing::XShape > &xShape)
void Export(const css::uno::Reference< css::beans::XPropertySet > &rPropertySet)
Get the ImageMap object from the "ImageMap" property and subsequently export the map (if present).
SAL_DLLPRIVATE void ImpExportFrameShape(const css::uno::Reference< css::drawing::XShape > &xShape, XMLShapeExportFlags nFeatures=SEF_DEFAULT, css::awt::Point *pRefPoint=nullptr)
SAL_DLLPRIVATE void ImpExportTableShape(const css::uno::Reference< css::drawing::XShape > &xShape, XmlShapeType eShapeType, XMLShapeExportFlags nFeatures=SEF_DEFAULT, css::awt::Point *pRefPoint=nullptr)
SAL_DLLPRIVATE void ImpExportPageShape(const css::uno::Reference< css::drawing::XShape > &xShape, XmlShapeType eShapeType, XMLShapeExportFlags nFeatures=SEF_DEFAULT, css::awt::Point *pRefPoint=nullptr)
SAL_DLLPRIVATE void ImpExportMeasureShape(const css::uno::Reference< css::drawing::XShape > &xShape, XMLShapeExportFlags nFeatures=SEF_DEFAULT, css::awt::Point const *pRefPoint=nullptr)
void collectShapesAutoStyles(const css::uno::Reference< css::drawing::XShapes > &xShapes)
SAL_DLLPRIVATE void ImpExportControlShape(const css::uno::Reference< css::drawing::XShape > &xShape, XMLShapeExportFlags nFeatures=SEF_DEFAULT, css::awt::Point *pRefPoint=nullptr)
ShapesInfos maShapesInfos
SAL_DLLPRIVATE void ImpExportChartShape(const css::uno::Reference< css::drawing::XShape > &xShape, XmlShapeType eShapeType, XMLShapeExportFlags nFeatures=SEF_DEFAULT, css::awt::Point *pRefPoint=nullptr, comphelper::AttributeList *pAttrList=nullptr)
static SAL_DLLPRIVATE void ImpExportNewTrans_DecomposeAndRefPoint(const ::basegfx::B2DHomMatrix &rMat, ::basegfx::B2DTuple &rTRScale, double &fTRShear, double &fTRRotate, ::basegfx::B2DTuple &rTRTranslate, css::awt::Point *pRefPoint)
SAL_DLLPRIVATE void ImpExportText(const css::uno::Reference< css::drawing::XShape > &xShape, TextPNS eExtensionNS=TextPNS::ODF)
virtual void onExport(const css::uno::Reference< css::drawing::XShape > &xShape)
is called before a shape element for the given XShape is exported
SAL_DLLPRIVATE void ImpExportSignatureLine(const css::uno::Reference< css::drawing::XShape > &xShape)
SAL_DLLPRIVATE void ImpExportLineShape(const css::uno::Reference< css::drawing::XShape > &xShape, XMLShapeExportFlags nFeatures=SEF_DEFAULT, css::awt::Point *pRefPoint=nullptr)
SAL_DLLPRIVATE void ImpExportQRCode(const css::uno::Reference< css::drawing::XShape > &xShape)
SAL_DLLPRIVATE void ImpExportConnectorShape(const css::uno::Reference< css::drawing::XShape > &xShape, XMLShapeExportFlags nFeatures=SEF_DEFAULT, css::awt::Point *pRefPoint=nullptr)
SAL_DLLPRIVATE void ImpExportDescription(const css::uno::Reference< css::drawing::XShape > &xShape)
#i68101# export shape Title and Description
const rtl::Reference< XMLTableExport > & GetShapeTableExport()
XMLShapeExport(SvXMLExport &rExp, SvXMLExportPropertyMapper *pExtMapper=nullptr)
SAL_DLLPRIVATE void ImpExportNewTrans_GetB2DHomMatrix(::basegfx::B2DHomMatrix &rMatrix, const css::uno::Reference< css::beans::XPropertySet > &xPropSet)
OUString msPresentationStylePrefix
SAL_DLLPRIVATE bool ImpExportPresentationAttributes(const css::uno::Reference< css::beans::XPropertySet > &xPropSet, const OUString &rClass)
css::uno::Reference< css::drawing::XShape > checkForCustomShapeReplacement(const css::uno::Reference< css::drawing::XShape > &)
sj: replacing CustomShapes with standard objects that are also supported in OpenOffice....
SAL_DLLPRIVATE void ImpExportGluePoints(const css::uno::Reference< css::drawing::XShape > &xShape)
exports all user defined gluepoints
SAL_DLLPRIVATE void ImpExportGraphicObjectShape(const css::uno::Reference< css::drawing::XShape > &xShape, XmlShapeType eShapeType, XMLShapeExportFlags nFeatures=SEF_DEFAULT, css::awt::Point *pRefPoint=nullptr)
void export3DSceneAttributes(const css::uno::Reference< css::beans::XPropertySet > &xPropSet)
helper for chart that adds all attributes of a 3d scene element to the export
void exportShape(const css::uno::Reference< css::drawing::XShape > &xShape, XMLShapeExportFlags nFeatures=SEF_DEFAULT, css::awt::Point *pRefPoint=nullptr, comphelper::AttributeList *pAttrList=nullptr)
SAL_DLLPRIVATE void ImpExportEvents(const css::uno::Reference< css::drawing::XShape > &xShape)
SAL_DLLPRIVATE void ImpExportPolygonShape(const css::uno::Reference< css::drawing::XShape > &xShape, XmlShapeType eShapeType, XMLShapeExportFlags nFeatures=SEF_DEFAULT, css::awt::Point *pRefPoint=nullptr)
SAL_DLLPRIVATE void ImpExportNewTrans_FeaturesAndWrite(::basegfx::B2DTuple const &rTRScale, double fTRShear, double fTRRotate, ::basegfx::B2DTuple const &rTRTranslate, const XMLShapeExportFlags nFeatures)
SAL_DLLPRIVATE void ImpExportGroupShape(const css::uno::Reference< css::drawing::XShape > &xShape, XMLShapeExportFlags nFeatures=SEF_DEFAULT, css::awt::Point *pRefPoint=nullptr)
rtl::Reference< XMLTableExport > mxShapeTableExport
SAL_DLLPRIVATE void ImpExportRectangleShape(const css::uno::Reference< css::drawing::XShape > &xShape, XMLShapeExportFlags nFeatures=SEF_DEFAULT, css::awt::Point *pRefPoint=nullptr)
SAL_DLLPRIVATE void ImpExport3DShape(const css::uno::Reference< css::drawing::XShape > &xShape, XmlShapeType eShapeType)
void ExportGraphicDefaults()
helper to export the style for graphic defaults
SAL_DLLPRIVATE void ImpExportCaptionShape(const css::uno::Reference< css::drawing::XShape > &xShape, XMLShapeExportFlags nFeatures=SEF_DEFAULT, css::awt::Point *pRefPoint=nullptr)
void collectShapeAutoStyles(const css::uno::Reference< css::drawing::XShape > &xShape)
SAL_DLLPRIVATE const rtl::Reference< SvXMLExportPropertyMapper > & GetPropertySetMapper() const
SAL_DLLPRIVATE void ImpExportOLE2Shape(const css::uno::Reference< css::drawing::XShape > &xShape, XmlShapeType eShapeType, XMLShapeExportFlags nFeatures=SEF_DEFAULT, css::awt::Point *pRefPoint=nullptr, comphelper::AttributeList *pAttrList=nullptr)
SAL_DLLPRIVATE void ImpExportTextBoxShape(const css::uno::Reference< css::drawing::XShape > &xShape, XmlShapeType eShapeType, XMLShapeExportFlags nFeatures=SEF_DEFAULT, css::awt::Point *pRefPoint=nullptr)
rtl::Reference< SvXMLExportPropertyMapper > mxPropertySetMapper
SAL_DLLPRIVATE void ImpExportNewTrans(const css::uno::Reference< css::beans::XPropertySet > &xPropSet, XMLShapeExportFlags nFeatures, css::awt::Point *pRefPoint)
void export3DLamps(const css::uno::Reference< css::beans::XPropertySet > &xPropSet)
helper for chart that exports all lamps from the propertyset
ShapesInfos::iterator maCurrentShapesIter
SAL_DLLPRIVATE void ImpExportAppletShape(const css::uno::Reference< css::drawing::XShape > &xShape, XMLShapeExportFlags nFeatures=SEF_DEFAULT, css::awt::Point *pRefPoint=nullptr)
SAL_DLLPRIVATE void ImpExportPluginShape(const css::uno::Reference< css::drawing::XShape > &xShape, XMLShapeExportFlags nFeatures=SEF_DEFAULT, css::awt::Point *pRefPoint=nullptr)
SAL_DLLPRIVATE void ImpExportEllipseShape(const css::uno::Reference< css::drawing::XShape > &xShape, XMLShapeExportFlags nFeatures=SEF_DEFAULT, css::awt::Point *pRefPoint=nullptr)
SAL_DLLPRIVATE void ImpExport3DSceneShape(const css::uno::Reference< css::drawing::XShape > &xShape, XMLShapeExportFlags nFeatures=SEF_DEFAULT, css::awt::Point *pRefPoint=nullptr)
SAL_DLLPRIVATE void ImpCalcShapeType(const css::uno::Reference< css::drawing::XShape > &xShape, XmlShapeType &eShapeType)
void seekShapes(const css::uno::Reference< css::drawing::XShapes > &xShapes) noexcept
initializes some internal structures for fast access to the given XShapes collection
SAL_DLLPRIVATE void ImpExportMediaShape(const css::uno::Reference< css::drawing::XShape > &xShape, XmlShapeType eShapeType, XMLShapeExportFlags nFeatures=SEF_DEFAULT, css::awt::Point *pRefPoint=nullptr)
virtual ~XMLShapeExport() override
static SvXMLExportPropertyMapper * CreateShapePropMapper(SvXMLExport &rExport)
returns the export property mapper for external chaining
rtl::Reference< XMLAnimationsExporter > mxAnimationsExporter
SAL_DLLPRIVATE void ImpExportCustomShape(const css::uno::Reference< css::drawing::XShape > &xShape, XMLShapeExportFlags nFeatures=SEF_DEFAULT, css::awt::Point *pRefPoint=nullptr)
SvXMLExport & GetExport()
void exportShapes(const css::uno::Reference< css::drawing::XShapes > &xShapes, XMLShapeExportFlags nFeatures=SEF_DEFAULT, css::awt::Point *pRefPoint=nullptr)
static SvXMLExportPropertyMapper * CreateParaDefaultExtPropMapper(SvXMLExport &rExport)
static SvXMLExportPropertyMapper * CreateParaExtPropMapper(SvXMLExport &rExport)
void set(sal_uInt16 nRow, sal_uInt16 nColumn, double fValue)
B2DPolygon const & getB2DPolygon(sal_uInt32 nIndex) const
B2DRange getB2DRange() const
bool areControlPointsUsed() const
static void CopyInputToOutput(const css::uno::Reference< css::io::XInputStream > &xInput, const css::uno::Reference< css::io::XOutputStream > &xOutput)
static css::uno::Reference< css::io::XStream > GetStreamAtPackageURL(const css::uno::Reference< css::embed::XStorage > &xStorage, const OUString &rURL, sal_uInt32 const nOpenMode, LifecycleProxy const &rNastiness)
const OUString & getIdentifier(const css::uno::Reference< css::uno::XInterface > &rInterface) const
const OUString & registerReference(const css::uno::Reference< css::uno::XInterface > &rInterface)
returns a unique identifier for the given uno object.
#define SO3_RPTCH_CLASSID
static void convertDouble(OUStringBuffer &rBuffer, double fNumber, bool bWriteUnits, sal_Int16 nSourceUnit, sal_Int16 nTargetUnit)
static bool convertPercent(sal_Int32 &rValue, std::u16string_view rString)
static bool convertColor(sal_Int32 &rColor, std::u16string_view rValue)
static bool convertBool(bool &rBool, std::u16string_view rString)
#define CTF_SD_CONTROL_SHAPE_DATA_STYLE
#define CTF_SD_SHAPE_PARA_ADJUST
#define DBG_ASSERT(sCon, aError)
#define TOOLS_WARN_EXCEPTION(area, stream)
#define TOOLS_INFO_EXCEPTION(area, stream)
#define DBG_UNHANDLED_EXCEPTION(...)
Reference< XInterface > xTarget
Reference< XSingleServiceFactory > xFactory
constexpr OUStringLiteral XML_STYLE_FAMILY_SD_PRESENTATION_PREFIX
constexpr OUStringLiteral XML_STYLE_FAMILY_SD_GRAPHICS_NAME
constexpr OUStringLiteral XML_STYLE_FAMILY_SD_GRAPHICS_PREFIX
constexpr OUStringLiteral XML_STYLE_FAMILY_SD_PRESENTATION_NAME
tools::Long FRound(double fVal)
#define SAL_WARN_IF(condition, area, stream)
#define SAL_WARN(area, stream)
#define SAL_INFO(area, stream)
constexpr OUStringLiteral aData
B2DPolyPolygon createB2DPolyPolygonFromB3DPolyPolygon(const B3DPolyPolygon &rCandidate, const B3DHomMatrix &rMat)
OUString exportToSvgD(const B2DPolyPolygon &rPolyPoly, bool bUseRelativeCoordinates, bool bDetectQuadraticBeziers, bool bHandleRelativeNextPointCompatible, bool bOOXMLMotionPath=false)
B3DPolyPolygon UnoPolyPolygonShape3DToB3DPolyPolygon(const css::drawing::PolyPolygonShape3D &rPolyPolygonShape3DSource)
OUString exportToSvgPoints(const B2DPolygon &rPoly)
B2DPolyPolygon UnoPointSequenceSequenceToB2DPolyPolygon(const css::drawing::PointSequenceSequence &rPointSequenceSequenceSource)
B2DPolyPolygon UnoPolyPolygonBezierCoordsToB2DPolyPolygon(const css::drawing::PolyPolygonBezierCoords &rPolyPolygonBezierCoordsSource)
css::beans::PropertyValue makePropertyValue(const OUString &rName, T &&rValue)
constexpr bool starts_with(std::basic_string_view< charT, traits > sv, std::basic_string_view< charT, traits > x) noexcept
EnhancedCustomShapeTokenEnum EASGet(std::u16string_view rShapeType)
@ EAS_NumberOfLineSegments
@ EAS_SecondLightDirection
@ EAS_FirstLightDirection
@ EAS_ConcentricGradientFillAllowed
Handling of tokens in XML:
XMLTokenEnum
The enumeration of all XML tokens.
@ XML_HANDLE_RANGE_X_MINIMUM
@ XML_EXTRUSION_SPECULARITY
@ XML_HANDLE_RADIUS_RANGE_MINIMUM
@ XML_HANDLE_RANGE_Y_MINIMUM
@ XML_QRCODE_ERROR_CORRECTION
@ XML_EXTRUSION_SPECULARITY_LOEXT
@ XML_EXTRUSION_VIEWPOINT
@ XML_HANDLE_RANGE_Y_MAXIMUM
@ XML_EXTRUSION_BRIGHTNESS
@ XML_EXTRUSION_DIFFUSION
@ XML_EXTRUSION_NUMBER_OF_LINE_SEGMENTS
@ XML_SUGGESTED_SIGNER_TITLE
@ XML_HANDLE_RADIUS_RANGE_MAXIMUM
@ XML_EXTRUSION_METAL_TYPE
@ XML_EXTRUSION_SECOND_LIGHT_HARSH
@ XML_TEXT_PATH_SAME_LETTER_HEIGHTS
@ XML_HANDLE_MIRROR_VERTICAL
@ XML_EXTRUSION_SHININESS
@ XML_HANDLE_MIRROR_HORIZONTAL
@ XML_EXTRUSION_SECOND_LIGHT_DIRECTION
@ XML_SUGGESTED_SIGNER_EMAIL
@ XML_PATH_STRETCHPOINT_X
@ XML_SIGNING_INSTRUCTIONS
@ XML_CONCENTRIC_GRADIENT_FILL_ALLOWED
@ XML_EXTRUSION_FIRST_LIGHT_HARSH
@ XML_PRESENTATION_OUTLINE
@ XML_EXTRUSION_ROTATION_ANGLE
@ XML_EXTRUSION_ROTATION_CENTER
@ XML_EXTRUSION_LIGHT_FACE
@ XML_EXTRUSION_FIRST_LIGHT_LEVEL
@ XML_HANDLE_RANGE_X_MAXIMUM
@ XML_PATH_STRETCHPOINT_Y
@ XML_EXTRUSION_SECOND_LIGHT_LEVEL
@ XML_EXTRUSION_FIRST_LIGHT_DIRECTION
@ XML_SUGGESTED_SIGNER_NAME
const OUString & GetXMLToken(enum XMLTokenEnum eToken)
return the OUString representation for eToken
void FixZOrder(uno::Reference< drawing::XShapes > const &xShapes, std::function< unsigned int(uno::Reference< beans::XPropertySet > const &)> const &rGetLayer)
constexpr OUStringLiteral aFalseStr
constexpr OUStringLiteral aTrueStr
const XMLPropertyMapEntry aXMLTableShapeAttributes[]
contains the attribute to property mapping for a drawing layer table WARNING: if attributes are added...
SvXMLEnumMapEntry< drawing::ConnectorType > const aXML_ConnectionKind_EnumMap[]
SvXMLEnumMapEntry< drawing::CircleKind > const aXML_CircleKind_EnumMap[]
constexpr OUStringLiteral gsPlayFull(u"PlayFull")
constexpr OUStringLiteral gsOnClick(u"OnClick")
constexpr OUStringLiteral gsClickAction(u"ClickAction")
constexpr OUStringLiteral gsBookmark(u"Bookmark")
constexpr OUStringLiteral gsLibrary(u"Library")
static void ImpExportEquations(SvXMLExport &rExport, const uno::Sequence< OUString > &rEquations)
static void lcl_CopyStream(uno::Reference< io::XInputStream > const &xInStream, uno::Reference< embed::XStorage > const &xTarget, OUString const &rPath, const OUString &rMimeType)
constexpr OUStringLiteral gsEffect(u"Effect")
constexpr OUStringLiteral gsStartShape(u"StartShape")
constexpr OUStringLiteral gsSoundURL(u"SoundURL")
static void ImpExportEnhancedPath(SvXMLExport &rExport, const uno::Sequence< css::drawing::EnhancedCustomShapeParameterPair > &rCoordinates, const uno::Sequence< css::drawing::EnhancedCustomShapeSegment > &rSegments, bool bExtended=false)
constexpr OUStringLiteral gsMacroName(u"MacroName")
static void ExportParameter(OUStringBuffer &rStrBuffer, const css::drawing::EnhancedCustomShapeParameter &rParameter)
constexpr OUStringLiteral gsEndShape(u"EndShape")
static OUString lcl_StoreMediaAndGetURL(SvXMLExport &rExport, uno::Reference< beans::XPropertySet > const &xPropSet, OUString const &rURL, const OUString &rMimeType)
constexpr OUStringLiteral gsZIndex(u"ZOrder")
constexpr OUStringLiteral gsStarBasic(u"StarBasic")
constexpr OUStringLiteral gsSpeed(u"Speed")
constexpr OUStringLiteral gsPrintable(u"Printable")
constexpr OUStringLiteral gsModel(u"Model")
constexpr OUStringLiteral XML_EMBEDDEDOBJECTGRAPHIC_URL_BASE
constexpr OUStringLiteral gsScript(u"Script")
constexpr OUStringLiteral gsHyperlink(u"Hyperlink")
constexpr OUStringLiteral gsVerb(u"Verb")
static void ImpExportEnhancedGeometry(SvXMLExport &rExport, const uno::Reference< beans::XPropertySet > &xPropSet)
constexpr OUStringLiteral gsVisible(u"Visible")
static void ImpExportHandles(SvXMLExport &rExport, const uno::Sequence< beans::PropertyValues > &rHandles)
constexpr OUStringLiteral gsEventType(u"EventType")
constexpr OUStringLiteral gsPresentation(u"Presentation")
std::vector< ImplXMLShapeExportInfo > ImplXMLShapeExportInfoVector
a vector for shape style and type cache information
const sal_Unicode *const aMimeType[]
caches style and type info after a collectShapeAutostyle for later use in exportShape
css::uno::Reference< css::drawing::XShape > xCustomShapeReplacement
Represents a property with its API-name, its XML-name and the type of its value.
Smart struct to transport an Any with an index to the appropriate property-name.
std::vector< ISegmentProgressBarRef > aSegments
SvXMLEnumMapEntry< drawing::EscapeDirection > const aXML_GlueEscapeDirection_EnumMap[]
SvXMLEnumMapEntry< drawing::Alignment > const aXML_GlueAlignment_EnumMap[]
constexpr sal_uInt16 XML_NAMESPACE_DRAW
constexpr sal_uInt16 XML_NAMESPACE_XLINK
constexpr sal_uInt16 XML_NAMESPACE_SVG
constexpr sal_uInt16 XML_NAMESPACE_DR3D
constexpr sal_uInt16 XML_NAMESPACE_DOM
constexpr sal_uInt16 XML_NAMESPACE_TABLE
constexpr sal_uInt16 XML_NAMESPACE_LO_EXT
constexpr sal_uInt16 XML_NAMESPACE_OFFICE
constexpr sal_uInt16 XML_NAMESPACE_PRESENTATION
constexpr sal_uInt16 XML_NAMESPACE_OOO
constexpr sal_uInt16 XML_NAMESPACE_DRAW_EXT
constexpr sal_uInt16 XML_NAMESPACE_SCRIPT