summaryrefslogtreecommitdiff
path: root/xmloff
diff options
context:
space:
mode:
authorNiklas Nebel <nn@openoffice.org>2010-06-10 10:33:55 +0200
committerNiklas Nebel <nn@openoffice.org>2010-06-10 10:33:55 +0200
commit88e530cb0c153655e43a5ee557421dc8dbdf2002 (patch)
tree79e1db44b816aa0c5c94de31410ecd64b0f4c686 /xmloff
parenta8edc64ce0b3e6238a704218b84247a5e63dedbb (diff)
parente03596eaf693b9809cffe86c21658a5ce381d6c3 (diff)
calc55: merge with DEV300_m81
Diffstat (limited to 'xmloff')
-rw-r--r--xmloff/inc/xmloff/shapeexport.hxx8
-rw-r--r--xmloff/source/draw/shapeexport.cxx13
-rw-r--r--xmloff/source/draw/shapeexport2.cxx5
-rw-r--r--xmloff/source/draw/shapeexport4.cxx6
-rw-r--r--xmloff/source/draw/ximpshap.cxx37
-rw-r--r--xmloff/source/forms/elementexport.cxx5
-rw-r--r--xmloff/source/table/XMLTableExport.cxx10
-rw-r--r--xmloff/source/text/XMLSectionExport.cxx2
8 files changed, 64 insertions, 22 deletions
diff --git a/xmloff/inc/xmloff/shapeexport.hxx b/xmloff/inc/xmloff/shapeexport.hxx
index 1b30658ef89c..b12f93f0b8b2 100644
--- a/xmloff/inc/xmloff/shapeexport.hxx
+++ b/xmloff/inc/xmloff/shapeexport.hxx
@@ -111,7 +111,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"
@@ -121,8 +122,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 c4f398524a2f..20c7879416cf 100644
--- a/xmloff/source/draw/shapeexport.cxx
+++ b/xmloff/source/draw/shapeexport.cxx
@@ -471,6 +471,7 @@ void XMLShapeExport::collectShapeAutoStyles(const uno::Reference< drawing::XShap
mrExport.getInterfaceToIdentifierMapper().registerReference( xConnection );
break;
}
+ case XmlShapeTypePresTableShape:
case XmlShapeTypeDrawTableShape:
{
try
@@ -797,6 +798,7 @@ void XMLShapeExport::exportShape(const uno::Reference< drawing::XShape >& xShape
break;
}
+ case XmlShapeTypePresTableShape:
case XmlShapeTypeDrawTableShape:
{
ImpExportTableShape( xShape, aShapeInfo.meShapeType, nFeatures, pRefPoint );
@@ -866,6 +868,7 @@ void XMLShapeExport::exportShape(const uno::Reference< drawing::XShape >& xShape
break;
}
+ case XmlShapeTypePresMediaShape:
case XmlShapeTypeDrawMediaShape:
{
ImpExportMediaShape( xShape, aShapeInfo.meShapeType, nFeatures, pRefPoint );
@@ -1125,7 +1128,7 @@ void XMLShapeExport::ImpCalcShapeType(const uno::Reference< drawing::XShape >& x
// get info about presentation shape
uno::Reference <beans::XPropertySet> xPropSet(xShape, uno::UNO_QUERY);
- if(xPropSet.is())
+ if(xPropSet.is()) try
{
rtl::OUString sCLSID;
if(xPropSet->getPropertyValue(OUString(RTL_CONSTASCII_USTRINGPARAM("CLSID"))) >>= sCLSID)
@@ -1137,16 +1140,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", 26, 10)) { eShapeType = XmlShapeTypePresMediaShape; }
}
}
}
diff --git a/xmloff/source/draw/shapeexport2.cxx b/xmloff/source/draw/shapeexport2.cxx
index fb1d15f57350..21097108ca29 100644
--- a/xmloff/source/draw/shapeexport2.cxx
+++ b/xmloff/source/draw/shapeexport2.cxx
@@ -1996,7 +1996,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())
@@ -2004,6 +2004,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 710d343ba42c..3f52fcd50084 100644
--- a/xmloff/source/draw/shapeexport4.cxx
+++ b/xmloff/source/draw/shapeexport4.cxx
@@ -1095,7 +1095,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);
@@ -1109,8 +1109,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 dc362136a3fe..f1bf683b57e9 100644
--- a/xmloff/source/draw/ximpshap.cxx
+++ b/xmloff/source/draw/ximpshap.cxx
@@ -2565,7 +2565,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 ) )
{
@@ -2922,8 +2922,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";
@@ -2933,6 +2946,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 );
@@ -3556,8 +3586,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 ) )
@@ -3565,7 +3594,7 @@ void SdXMLTableShapeContext::StartElement( const ::com::sun::star::uno::Referenc
pService = "com.sun.star.presentation.TableShape";
}
}
-*/
+
AddShape( pService );
if( mxShape.is() )
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;
diff --git a/xmloff/source/table/XMLTableExport.cxx b/xmloff/source/table/XMLTableExport.cxx
index 7affab134134..ad3a1f96752f 100644
--- a/xmloff/source/table/XMLTableExport.cxx
+++ b/xmloff/source/table/XMLTableExport.cxx
@@ -353,6 +353,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() )
{
@@ -360,11 +362,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 );
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
,