From 24be43ab5287828705356e22421cc7fc47fa30a4 Mon Sep 17 00:00:00 2001 From: Christian Lippka Date: Tue, 23 Feb 2010 00:23:09 +0100 Subject: presentation placeholder rework --- xmloff/inc/xmloff/shapeexport.hxx | 8 +++++--- xmloff/source/draw/shapeexport.cxx | 12 ++++++++++-- xmloff/source/draw/shapeexport2.cxx | 5 ++++- xmloff/source/draw/shapeexport4.cxx | 6 +++--- xmloff/source/draw/ximpshap.cxx | 37 +++++++++++++++++++++++++++++++++---- 5 files changed, 55 insertions(+), 13 deletions(-) (limited to 'xmloff') diff --git a/xmloff/inc/xmloff/shapeexport.hxx b/xmloff/inc/xmloff/shapeexport.hxx index 12766aa8d582..130b9b6abaed 100644 --- a/xmloff/inc/xmloff/shapeexport.hxx +++ b/xmloff/inc/xmloff/shapeexport.hxx @@ -114,7 +114,8 @@ enum XmlShapeType XmlShapeTypePresPageShape, // "com.sun.star.presentation.PageShape" XmlShapeTypePresOLE2Shape, // "com.sun.star.presentation.OLE2Shape" XmlShapeTypePresChartShape, // "com.sun.star.presentation.ChartShape" - XmlShapeTypePresSheetShape, // "com.sun.star.presentation.OLE2Shape" + XmlShapeTypePresSheetShape, // "com.sun.star.presentation.CalcShape" + XmlShapeTypePresTableShape, // "com.sun.star.presentation.TableShape" XmlShapeTypePresOrgChartShape, // "com.sun.star.presentation.OrgChartShape" XmlShapeTypePresNotesShape, // "com.sun.star.presentation.NotesShape" XmlShapeTypeHandoutShape, // "com.sun.star.presentation.HandoutShape" @@ -124,8 +125,9 @@ enum XmlShapeType XmlShapeTypePresSlideNumberShape, // "com.sun.star.presentation.SlideNumberShape" XmlShapeTypePresDateTimeShape, // "com.sun.star.presentation.DateTimeShape" - XmlShapeTypeDrawCustomShape, // "com.sun.star.draw.CustomShape" - XmlShapeTypeDrawMediaShape, // "com.sun.star.draw.MediaShape" + XmlShapeTypeDrawCustomShape, // "com.sun.star.drawing.CustomShape" + XmlShapeTypeDrawMediaShape, // "com.sun.star.drawing.MediaShape" + XmlShapeTypePresMediaShape, // "com.sun.star.presentation.MediaShape" XmlShapeTypeDrawTableShape, // "com.sun.star.drawing.TableShape" diff --git a/xmloff/source/draw/shapeexport.cxx b/xmloff/source/draw/shapeexport.cxx index 3a0e01631f28..49d6a87831f0 100644 --- a/xmloff/source/draw/shapeexport.cxx +++ b/xmloff/source/draw/shapeexport.cxx @@ -762,6 +762,7 @@ void XMLShapeExport::exportShape(const uno::Reference< drawing::XShape >& xShape break; } + case XmlShapeTypePresTableShape: case XmlShapeTypeDrawTableShape: { ImpExportTableShape( xShape, aShapeInfo.meShapeType, nFeatures, pRefPoint ); @@ -831,6 +832,7 @@ void XMLShapeExport::exportShape(const uno::Reference< drawing::XShape >& xShape break; } + case XmlShapeTypePresMediaShape: case XmlShapeTypeDrawMediaShape: { ImpExportMediaShape( xShape, aShapeInfo.meShapeType, nFeatures, pRefPoint ); @@ -1088,7 +1090,7 @@ void XMLShapeExport::ImpCalcShapeType(const uno::Reference< drawing::XShape >& x // get info about presentation shape uno::Reference xPropSet(xShape, uno::UNO_QUERY); - if(xPropSet.is()) + if(xPropSet.is()) try { rtl::OUString sCLSID; if(xPropSet->getPropertyValue(OUString(RTL_CONSTASCII_USTRINGPARAM("CLSID"))) >>= sCLSID) @@ -1100,16 +1102,22 @@ void XMLShapeExport::ImpCalcShapeType(const uno::Reference< drawing::XShape >& x } } } + catch( uno::Exception& ) + { + DBG_ERROR( "XMLShapeExport::ImpCalcShapeType(), expected ole shape to have the CLSID property?" ); + } } else if(aType.EqualsAscii("Chart", 26, 5)) { eShapeType = XmlShapeTypePresChartShape; } else if(aType.EqualsAscii("OrgChart", 26, 8)) { eShapeType = XmlShapeTypePresOrgChartShape; } - else if(aType.EqualsAscii("TableShape", 26, 10)) { eShapeType = XmlShapeTypePresSheetShape; } + else if(aType.EqualsAscii("CalcShape", 26, 9)) { eShapeType = XmlShapeTypePresSheetShape; } + else if(aType.EqualsAscii("TableShape", 26, 10)) { eShapeType = XmlShapeTypePresTableShape; } else if(aType.EqualsAscii("Notes", 26, 5)) { eShapeType = XmlShapeTypePresNotesShape; } else if(aType.EqualsAscii("HandoutShape", 26, 12)) { eShapeType = XmlShapeTypeHandoutShape; } else if(aType.EqualsAscii("HeaderShape", 26, 11)) { eShapeType = XmlShapeTypePresHeaderShape; } else if(aType.EqualsAscii("FooterShape", 26, 11)) { eShapeType = XmlShapeTypePresFooterShape; } else if(aType.EqualsAscii("SlideNumberShape", 26, 16)) { eShapeType = XmlShapeTypePresSlideNumberShape; } else if(aType.EqualsAscii("DateTimeShape", 26, 13)) { eShapeType = XmlShapeTypePresDateTimeShape; } + else if(aType.EqualsAscii("MediaShape", 21, 10)) { eShapeType = XmlShapeTypePresMediaShape; } } } } diff --git a/xmloff/source/draw/shapeexport2.cxx b/xmloff/source/draw/shapeexport2.cxx index e09ad66dfeb9..40e8b9d874fa 100644 --- a/xmloff/source/draw/shapeexport2.cxx +++ b/xmloff/source/draw/shapeexport2.cxx @@ -1999,7 +1999,7 @@ void XMLShapeExport::ImpExportPluginShape( void XMLShapeExport::ImpExportMediaShape( const uno::Reference< drawing::XShape >& xShape, - XmlShapeType, sal_Int32 nFeatures, com::sun::star::awt::Point* pRefPoint) + XmlShapeType eShapeType, sal_Int32 nFeatures, com::sun::star::awt::Point* pRefPoint) { const uno::Reference< beans::XPropertySet > xPropSet(xShape, uno::UNO_QUERY); if(xPropSet.is()) @@ -2007,6 +2007,9 @@ void XMLShapeExport::ImpExportMediaShape( // Transformation ImpExportNewTrans(xPropSet, nFeatures, pRefPoint); + if(eShapeType == XmlShapeTypePresMediaShape) + ImpExportPresentationAttributes( xPropSet, GetXMLToken(XML_PRESENTATION_OBJECT) ); + sal_Bool bCreateNewline( (nFeatures & SEF_EXPORT_NO_WS) == 0 ); // #86116#/#92210# SvXMLElementExport aElem( mrExport, XML_NAMESPACE_DRAW, XML_FRAME, bCreateNewline, sal_True ); diff --git a/xmloff/source/draw/shapeexport4.cxx b/xmloff/source/draw/shapeexport4.cxx index e2e804eefb43..efe0b4fa668d 100644 --- a/xmloff/source/draw/shapeexport4.cxx +++ b/xmloff/source/draw/shapeexport4.cxx @@ -1098,7 +1098,7 @@ void XMLShapeExport::ImpExportCustomShape( } } -void XMLShapeExport::ImpExportTableShape( const uno::Reference< drawing::XShape >& xShape, XmlShapeType /*eShapeType*/, sal_Int32 nFeatures, com::sun::star::awt::Point* pRefPoint ) +void XMLShapeExport::ImpExportTableShape( const uno::Reference< drawing::XShape >& xShape, XmlShapeType eShapeType, sal_Int32 nFeatures, com::sun::star::awt::Point* pRefPoint ) { uno::Reference< beans::XPropertySet > xPropSet(xShape, uno::UNO_QUERY); uno::Reference< container::XNamed > xNamed(xShape, uno::UNO_QUERY); @@ -1112,8 +1112,8 @@ void XMLShapeExport::ImpExportTableShape( const uno::Reference< drawing::XShape sal_Bool bIsEmptyPresObj = sal_False; // presentation settings -// if(eShapeType == XmlShapeTypePresTableShape) -// bIsEmptyPresObj = ImpExportPresentationAttributes( xPropSet, GetXMLToken(XML_PRESENTATION_TABLE) ); + if(eShapeType == XmlShapeTypePresTableShape) + bIsEmptyPresObj = ImpExportPresentationAttributes( xPropSet, GetXMLToken(XML_PRESENTATION_TABLE) ); const bool bCreateNewline( (nFeatures & SEF_EXPORT_NO_WS) == 0 ); const bool bExportEmbedded(0 != (mrExport.getExportFlags() & EXPORT_EMBEDDED)); diff --git a/xmloff/source/draw/ximpshap.cxx b/xmloff/source/draw/ximpshap.cxx index 65aad96bad86..95f2d6b80058 100644 --- a/xmloff/source/draw/ximpshap.cxx +++ b/xmloff/source/draw/ximpshap.cxx @@ -2551,7 +2551,7 @@ void SdXMLObjectShapeContext::StartElement( const ::com::sun::star::uno::Referen } else if( IsXMLToken( maPresentationClass, XML_PRESENTATION_TABLE ) ) { - pService = "com.sun.star.presentation.TableShape"; + pService = "com.sun.star.presentation.CalcShape"; } else if( IsXMLToken( maPresentationClass, XML_PRESENTATION_OBJECT ) ) { @@ -2908,8 +2908,21 @@ void SdXMLPluginShapeContext::StartElement( const ::com::sun::star::uno::Referen const char* pService; + sal_Bool bIsPresShape = sal_False; + if( mbMedia ) + { pService = "com.sun.star.drawing.MediaShape"; + + bIsPresShape = maPresentationClass.getLength() && GetImport().GetShapeImport()->IsPresentationShapesSupported(); + if( bIsPresShape ) + { + if( IsXMLToken( maPresentationClass, XML_PRESENTATION_OBJECT ) ) + { + pService = "com.sun.star.presentation.MediaShape"; + } + } + } else pService = "com.sun.star.drawing.PluginShape"; @@ -2919,6 +2932,23 @@ void SdXMLPluginShapeContext::StartElement( const ::com::sun::star::uno::Referen { SetLayer(); + if(bIsPresShape) + { + uno::Reference< beans::XPropertySet > xProps( mxShape, uno::UNO_QUERY ); + if(xProps.is()) + { + uno::Reference< beans::XPropertySetInfo > xPropsInfo( xProps->getPropertySetInfo() ); + if( xPropsInfo.is() ) + { + if( !mbIsPlaceholder && xPropsInfo->hasPropertyByName(OUString(RTL_CONSTASCII_USTRINGPARAM("IsEmptyPresentationObject") ))) + xProps->setPropertyValue( OUString(RTL_CONSTASCII_USTRINGPARAM("IsEmptyPresentationObject") ), ::cppu::bool2any( sal_False ) ); + + if( mbIsUserTransformed && xPropsInfo->hasPropertyByName(OUString(RTL_CONSTASCII_USTRINGPARAM("IsPlaceholderDependent") ))) + xProps->setPropertyValue( OUString(RTL_CONSTASCII_USTRINGPARAM("IsPlaceholderDependent") ), ::cppu::bool2any( sal_False ) ); + } + } + } + // set pos, size, shear and rotate SetTransformation(); GetImport().GetShapeImport()->finishShape( mxShape, mxAttrList, mxShapes ); @@ -3531,8 +3561,7 @@ void SdXMLTableShapeContext::StartElement( const ::com::sun::star::uno::Referenc { const char* pService = "com.sun.star.drawing.TableShape"; - sal_Bool bIsPresShape = sal_False; //maPresentationClass.getLength() && GetImport().GetShapeImport()->IsPresentationShapesSupported(); -/* + sal_Bool bIsPresShape = maPresentationClass.getLength() && GetImport().GetShapeImport()->IsPresentationShapesSupported(); if( bIsPresShape ) { if( IsXMLToken( maPresentationClass, XML_PRESENTATION_TABLE ) ) @@ -3540,7 +3569,7 @@ void SdXMLTableShapeContext::StartElement( const ::com::sun::star::uno::Referenc pService = "com.sun.star.presentation.TableShape"; } } -*/ + AddShape( pService ); if( mxShape.is() ) -- cgit From 3dbbaa9d0eb6259a346f485e52086459f895215e Mon Sep 17 00:00:00 2001 From: Christian Lippka Date: Wed, 24 Feb 2010 13:11:19 +0100 Subject: fixed storing issue with presentation tables --- xmloff/source/draw/shapeexport.cxx | 1 + xmloff/source/table/XMLTableExport.cxx | 10 ++++++---- 2 files changed, 7 insertions(+), 4 deletions(-) (limited to 'xmloff') diff --git a/xmloff/source/draw/shapeexport.cxx b/xmloff/source/draw/shapeexport.cxx index 49d6a87831f0..3db1e336410f 100644 --- a/xmloff/source/draw/shapeexport.cxx +++ b/xmloff/source/draw/shapeexport.cxx @@ -470,6 +470,7 @@ void XMLShapeExport::collectShapeAutoStyles(const uno::Reference< drawing::XShap mrExport.getInterfaceToIdentifierMapper().registerReference( xConnection ); break; } + case XmlShapeTypePresTableShape: case XmlShapeTypeDrawTableShape: { try diff --git a/xmloff/source/table/XMLTableExport.cxx b/xmloff/source/table/XMLTableExport.cxx index de930d6dd288..29e9c6c257dc 100644 --- a/xmloff/source/table/XMLTableExport.cxx +++ b/xmloff/source/table/XMLTableExport.cxx @@ -356,6 +356,8 @@ static bool has_states( const std::vector< XMLPropertyState >& xPropStates ) // get the current row Reference< XCellRange > xCellRange( xIndexAccess->getByIndex(rowIndex), UNO_QUERY_THROW ); + OUString sDefaultCellStyle; + // table:style-name if( pTableInfo.get() ) { @@ -363,11 +365,11 @@ static bool has_states( const std::vector< XMLPropertyState >& xPropStates ) const OUString sStyleName( pTableInfo->maRowStyleMap[xKey] ); if( sStyleName.getLength() ) mrExport.AddAttribute(XML_NAMESPACE_TABLE, XML_STYLE_NAME, sStyleName ); - } - const OUString sDefaultCellStyle( pTableInfo->maDefaultRowCellStyles[rowIndex] ); - if( sDefaultCellStyle.getLength() ) - mrExport.AddAttribute(XML_NAMESPACE_TABLE, XML_DEFAULT_CELL_STYLE_NAME, sDefaultCellStyle ); + sDefaultCellStyle = pTableInfo->maDefaultRowCellStyles[rowIndex]; + if( sDefaultCellStyle.getLength() ) + mrExport.AddAttribute(XML_NAMESPACE_TABLE, XML_DEFAULT_CELL_STYLE_NAME, sDefaultCellStyle ); + } // write row element SvXMLElementExport tableRowElement( mrExport, XML_NAMESPACE_TABLE, XML_TABLE_ROW, sal_True, sal_True ); -- cgit From 3138e431cb23a6ba95d16713ce30a54451566665 Mon Sep 17 00:00:00 2001 From: Christian Lippka Date: Thu, 25 Feb 2010 18:04:05 +0100 Subject: more fixes for new presentation layout shapes --- xmloff/source/draw/shapeexport.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'xmloff') diff --git a/xmloff/source/draw/shapeexport.cxx b/xmloff/source/draw/shapeexport.cxx index 3db1e336410f..f1941e715a96 100644 --- a/xmloff/source/draw/shapeexport.cxx +++ b/xmloff/source/draw/shapeexport.cxx @@ -1118,7 +1118,7 @@ void XMLShapeExport::ImpCalcShapeType(const uno::Reference< drawing::XShape >& x else if(aType.EqualsAscii("FooterShape", 26, 11)) { eShapeType = XmlShapeTypePresFooterShape; } else if(aType.EqualsAscii("SlideNumberShape", 26, 16)) { eShapeType = XmlShapeTypePresSlideNumberShape; } else if(aType.EqualsAscii("DateTimeShape", 26, 13)) { eShapeType = XmlShapeTypePresDateTimeShape; } - else if(aType.EqualsAscii("MediaShape", 21, 10)) { eShapeType = XmlShapeTypePresMediaShape; } + else if(aType.EqualsAscii("MediaShape", 26, 10)) { eShapeType = XmlShapeTypePresMediaShape; } } } } -- cgit From 6785f857f4956c6dfd155074c92fe985c05d5835 Mon Sep 17 00:00:00 2001 From: Ivo Hinkelmann Date: Fri, 4 Jun 2010 10:43:31 +0200 Subject: masterfix: #i10000# #i112082# load/store issue --- xmloff/source/forms/elementexport.cxx | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'xmloff') diff --git a/xmloff/source/forms/elementexport.cxx b/xmloff/source/forms/elementexport.cxx index 88abf8ad988a..115b06c4c2ad 100644 --- a/xmloff/source/forms/elementexport.cxx +++ b/xmloff/source/forms/elementexport.cxx @@ -2034,10 +2034,7 @@ namespace xmloff OAttributeMetaData::getFormAttributeName(eStringPropertyIds[i]), aStringPropertyNames[i]); - // Since as per ODF 1.2, xlink:href and xlink:type need to exist either both or none, - // we need to write xlink:type, too, even if it carries no information. - // #i111035# / 2010-04-141/ frank.schoenheit@sun.com - AddAttributeASCII( XML_NAMESPACE_XLINK, "type", "simple" ); + // #i112082# xlink:type is added as part of exportTargetLocationAttribute // now export the data source name or databaselocation or connection resource ::rtl::OUString sPropValue; -- cgit From e03596eaf693b9809cffe86c21658a5ce381d6c3 Mon Sep 17 00:00:00 2001 From: Ruediger Timm Date: Mon, 7 Jun 2010 16:20:49 +0200 Subject: masterfix #i112192#: buildbreaker in xmloff/source/text/XMLSectionExport.cxx on product debug --- xmloff/source/text/XMLSectionExport.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'xmloff') diff --git a/xmloff/source/text/XMLSectionExport.cxx b/xmloff/source/text/XMLSectionExport.cxx index 0a0437426a3c..7cf96abea2e2 100644 --- a/xmloff/source/text/XMLSectionExport.cxx +++ b/xmloff/source/text/XMLSectionExport.cxx @@ -917,7 +917,7 @@ void XMLSectionExport::ExportBaseIndexSource( void XMLSectionExport::ExportBaseIndexBody( SectionTypeEnum - #ifdef DBG_UTIL + #if OSL_DEBUG_LEVEL > 0 eType #endif , -- cgit