Kaydet (Commit) 5672dab6 authored tarafından David Tardon's avatar David Tardon

Revert "Don't assume that the ZOrder property of shapes is an enumeration"

This reverts commit 66c7dbbf.

See https://gerrit.libreoffice.org/#/c/13554/ .

Conflicts:
	include/xmloff/shapeexport.hxx
	reportdesign/source/filter/xml/xmlExport.cxx
	sc/source/filter/xml/xmlexprt.cxx
	xmloff/source/draw/shapeexport.cxx

Change-Id: I14fed9ad043a756a9e2d390c76fa907c349c3a2e
üst 4852e6d2
......@@ -250,13 +250,11 @@ public:
// This method collects all automatic styles for the given XShape
void collectShapeAutoStyles(
const com::sun::star::uno::Reference < com::sun::star::drawing::XShape >& xShape,
sal_Int32 nShapeId = -1);
const com::sun::star::uno::Reference < com::sun::star::drawing::XShape >& xShape);
// This method exports the given XShape
void exportShape(
const com::sun::star::uno::Reference < com::sun::star::drawing::XShape >& xShape,
sal_Int32 nShapeId = -1,
XMLShapeExportFlags nFeatures = SEF_DEFAULT,
com::sun::star::awt::Point* pRefPoint = NULL,
SvXMLAttributeList* pAttrList = NULL
......
......@@ -674,7 +674,7 @@ void ORptExport::exportReportComponentAutoStyles(const Reference<XSection>& _xPr
rtl::Reference< XMLShapeExport > xShapeExport = GetShapeExport();
xShapeExport->seekShapes(_xProp.get());
SolarMutexGuard aGuard;
xShapeExport->collectShapeAutoStyles(xShape.get(), i);
xShapeExport->collectShapeAutoStyles(xShape.get());
}
else
{
......@@ -1501,7 +1501,7 @@ void ORptExport::exportShapes(const Reference< XSection>& _xSection,bool _bAddPa
}
AddAttribute( XML_NAMESPACE_TEXT, XML_ANCHOR_TYPE, XML_PARAGRAPH );
xShapeExport->exportShape(xShape.get(), i, SEF_DEFAULT|XMLShapeExportFlags::NO_WS,&aRefPoint);
xShapeExport->exportShape(xShape.get(), SEF_DEFAULT|XMLShapeExportFlags::NO_WS,&aRefPoint);
}
}
}
......
......@@ -3470,7 +3470,7 @@ void ScXMLExport::ExportShape(const uno::Reference < drawing::XShape >& xShape,
pAttrList->AddAttribute(
GetNamespaceMap().GetQNameByKey( XML_NAMESPACE_DRAW, GetXMLToken( XML_NOTIFY_ON_UPDATE_OF_RANGES ) ), sRanges );
}
GetShapeExport()->exportShape( xShape, -1, XMLShapeExportFlags::NO_CHART_DATA | SEF_DEFAULT, pPoint, pAttrList );
GetShapeExport()->exportShape( xShape, XMLShapeExportFlags::NO_CHART_DATA | SEF_DEFAULT, pPoint, pAttrList );
}
}
}
......@@ -3504,7 +3504,7 @@ void ScXMLExport::ExportShape(const uno::Reference < drawing::XShape >& xShape,
pAttrList->AddAttribute(
GetNamespaceMap().GetQNameByKey( XML_NAMESPACE_DRAW, GetXMLToken(XML_NOTIFY_ON_UPDATE_OF_RANGES) ), sRanges );
}
GetShapeExport()->exportShape(xShape, -1, XMLShapeExportFlags::NO_CHART_DATA | SEF_DEFAULT, pPoint, pAttrList);
GetShapeExport()->exportShape(xShape, XMLShapeExportFlags::NO_CHART_DATA | SEF_DEFAULT, pPoint, pAttrList);
}
}
}
......@@ -3546,7 +3546,7 @@ void ScXMLExport::ExportShape(const uno::Reference < drawing::XShape >& xShape,
// re-add pre-loaded attributes
AddAttributeList( xSaveAttribs );
}
GetShapeExport()->exportShape(xShape, -1, SEF_DEFAULT, pPoint);
GetShapeExport()->exportShape(xShape, SEF_DEFAULT, pPoint);
}
IncrementProgressBar(false);
}
......@@ -3716,7 +3716,7 @@ void ScXMLExport::WriteAnnotation(ScMyCell& rMyCell)
SdrCaptionObj* pNoteCaption = pNote->GetOrCreateCaption(rMyCell.maCellAddress);
Reference<drawing::XShape> xShape( pNoteCaption->getUnoShape(), uno::UNO_QUERY );
GetShapeExport()->exportShape(xShape, -1, SEF_DEFAULT|XMLShapeExportFlags::ANNOTATION, NULL);
GetShapeExport()->exportShape(xShape, SEF_DEFAULT|XMLShapeExportFlags::ANNOTATION, NULL);
pCurrentCell = NULL;
......
......@@ -1487,7 +1487,7 @@ void SchXMLExportHelper_Impl::parseDocument( Reference< chart::XChartDocument >&
if( ! xShape.is())
continue;
rShapeExport->exportShape( xShape, nShapeId );
rShapeExport->exportShape( xShape );
}
// this would be the easier way if it worked:
//mrExport.GetShapeExport()->exportShapes( mxAdditionalShapes );
......@@ -1536,7 +1536,7 @@ void SchXMLExportHelper_Impl::parseDocument( Reference< chart::XChartDocument >&
if( ! xShape.is())
continue;
rShapeExport->collectShapeAutoStyles( xShape, nShapeId );
rShapeExport->collectShapeAutoStyles( xShape );
}
}
}
......
......@@ -235,21 +235,17 @@ uno::Reference< drawing::XShape > XMLShapeExport::checkForCustomShapeReplacement
}
// This method collects all automatic styles for the given XShape
void XMLShapeExport::collectShapeAutoStyles(const uno::Reference< drawing::XShape >& xShape, sal_Int32 nZIndex)
void XMLShapeExport::collectShapeAutoStyles(const uno::Reference< drawing::XShape >& xShape )
{
if( maCurrentShapesIter == maShapesInfos.end() )
{
OSL_FAIL( "XMLShapeExport::collectShapeAutoStyles(): no call to seekShapes()!" );
return;
}
sal_Int32 nZIndex = 0;
uno::Reference< beans::XPropertySet > xPropSet(xShape, uno::UNO_QUERY);
if( nZIndex == -1 )
{
if( xPropSet.is() )
xPropSet->getPropertyValue(msZIndex) >>= nZIndex;
else
nZIndex = 0;
}
if( xPropSet.is() )
xPropSet->getPropertyValue(msZIndex) >>= nZIndex;
ImplXMLShapeExportInfoVector& aShapeInfoVector = (*maCurrentShapesIter).second;
......@@ -567,7 +563,6 @@ namespace
}
// This method exports the given XShape
void XMLShapeExport::exportShape(const uno::Reference< drawing::XShape >& xShape,
sal_Int32 nZIndex,
XMLShapeExportFlags nFeatures /* = SEF_DEFAULT */,
com::sun::star::awt::Point* pRefPoint /* = NULL */,
SvXMLAttributeList* pAttrList /* = NULL */ )
......@@ -578,6 +573,7 @@ void XMLShapeExport::exportShape(const uno::Reference< drawing::XShape >& xShape
SAL_WARN( "xmloff", "XMLShapeExport::exportShape(): no auto styles where collected before export" );
return;
}
sal_Int32 nZIndex = 0;
uno::Reference< beans::XPropertySet > xSet( xShape, uno::UNO_QUERY );
boost::scoped_ptr< SvXMLElementExport > mpHyperlinkElement;
......@@ -609,13 +605,8 @@ void XMLShapeExport::exportShape(const uno::Reference< drawing::XShape >& xShape
SAL_WARN("xmloff", "XMLShapeExport::exportShape(): exception during hyperlink export");
}
if( nZIndex == -1 )
{
if( xSet.is() )
xSet->getPropertyValue(msZIndex) >>= nZIndex;
else
nZIndex = 0;
}
if( xSet.is() )
xSet->getPropertyValue(msZIndex) >>= nZIndex;
ImplXMLShapeExportInfoVector& aShapeInfoVector = (*maCurrentShapesIter).second;
......@@ -962,7 +953,7 @@ void XMLShapeExport::collectShapesAutoStyles( const uno::Reference < drawing::XS
if(!xShape.is())
continue;
collectShapeAutoStyles( xShape, nShapeId );
collectShapeAutoStyles( xShape );
}
maCurrentShapesIter = aOldCurrentShapesIter;
......@@ -983,7 +974,7 @@ void XMLShapeExport::exportShapes( const uno::Reference < drawing::XShapes >& xS
if(!xShape.is())
continue;
exportShape( xShape, nShapeId, nFeatures, pRefPoint );
exportShape( xShape, nFeatures, pRefPoint );
}
maCurrentShapesIter = aOldCurrentShapesIter;
......
......@@ -2874,7 +2874,7 @@ void XMLTextParagraphExport::exportAnyTextFrame(
XMLShapeExportFlags nFeatures =
addTextFrameAttributes( xPropSet, true );
GetExport().GetShapeExport()
->exportShape( xShape, -1, nFeatures );
->exportShape( xShape, nFeatures );
}
break;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment