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
commit30906b1cb3eeecf2c20b9c56a8b4ea33fa6f8cf9 (patch)
tree1322a38ee44d21223335dc9f42c40fd4abd8eb4f /xmloff
parentff84642f23ccdf87386f1ba2cb1d0a925336c02a (diff)
parent6299e019bff7c651e9585d5bf2234539233a646d (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.cxx7
-rw-r--r--xmloff/source/table/XMLTableExport.cxx10
-rw-r--r--xmloff/source/text/XMLSectionExport.cxx2
8 files changed, 65 insertions, 23 deletions
diff --git a/xmloff/inc/xmloff/shapeexport.hxx b/xmloff/inc/xmloff/shapeexport.hxx
index b9a3eb63e7..d6319874a3 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 1b5206880a..a0fb695556 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 1fda3d68b2..055736f67c 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 463e206616..8d122d6f45 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 3ce36cd8e6..90b098a32a 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 9fe201e65a..d3f39ec996 100644
--- a/xmloff/source/forms/elementexport.cxx
+++ b/xmloff/source/forms/elementexport.cxx
@@ -2034,11 +2034,8 @@ 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;
m_xProps->getPropertyValue( PROPERTY_DATASOURCENAME ) >>= sPropValue;
diff --git a/xmloff/source/table/XMLTableExport.cxx b/xmloff/source/table/XMLTableExport.cxx
index 4429c7cbed..e1cdad63c4 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 3e52a7fb67..99a78e33e7 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
,