summaryrefslogtreecommitdiff
path: root/xmloff
diff options
context:
space:
mode:
authorNoel Power <noel.power@novell.com>2010-10-13 10:51:50 +0100
committerNoel Power <noel.power@novell.com>2010-10-13 10:51:50 +0100
commit606a57481911e111dfab950cd7fb90ae80aed014 (patch)
tree62e85311b32105e6d4e165d60c9d4bbdb80c03bc /xmloff
parenta4d7dbf897e41a1afda6c2b6f0e5cc35920a1cf3 (diff)
parented49568618442960781b63c3a47ddc65031b2fa0 (diff)
Merge branch 'vba' fix conflics, trailing ws & tab issues
also removed some old headers ( which I need to add new ones for ) Conflicts: basic/source/classes/sbunoobj.cxx basic/source/classes/sbxmod.cxx xmloff/inc/xmlnmspe.hxx xmloff/inc/xmloff/xmltoken.hxx xmlscript/inc/xmlscript/xmldlg_imexp.hxx
Diffstat (limited to 'xmloff')
-rw-r--r--xmloff/inc/xmlnmspe.hxx2
-rw-r--r--xmloff/inc/xmloff/shapeexport.hxx5
-rw-r--r--xmloff/inc/xmloff/xmltoken.hxx5
-rw-r--r--xmloff/source/core/xmlexp.cxx1
-rw-r--r--xmloff/source/core/xmlimp.cxx4
-rw-r--r--xmloff/source/core/xmltoken.cxx3
-rw-r--r--xmloff/source/draw/eventimp.cxx46
-rw-r--r--xmloff/source/draw/shapeexport.cxx5
-rw-r--r--xmloff/source/draw/shapeexport2.cxx48
-rw-r--r--xmloff/source/draw/ximpshap.cxx45
-rw-r--r--xmloff/source/forms/elementexport.cxx35
-rw-r--r--xmloff/source/forms/formattributes.cxx8
-rw-r--r--xmloff/source/forms/formattributes.hxx1
-rw-r--r--xmloff/source/forms/layerimport.cxx2
-rw-r--r--xmloff/source/forms/strings.hxx1
15 files changed, 88 insertions, 123 deletions
diff --git a/xmloff/inc/xmlnmspe.hxx b/xmloff/inc/xmlnmspe.hxx
index 3378c56226..79197cf8f9 100644
--- a/xmloff/inc/xmlnmspe.hxx
+++ b/xmloff/inc/xmlnmspe.hxx
@@ -105,5 +105,7 @@ XML_OLD_NAMESPACE( META, 6U )
// experimental namespaces
XML_NAMESPACE( FIELD, 100U )
XML_NAMESPACE( CSS3TEXT, 103U ) // CSS Text Level 3
+XML_NAMESPACE( FORMX, 101U ) // form interop extensions
+
#endif // _XMLOFF_XMLNMSPE_HXX
diff --git a/xmloff/inc/xmloff/shapeexport.hxx b/xmloff/inc/xmloff/shapeexport.hxx
index 9f28c27207..43cabbeaf1 100644
--- a/xmloff/inc/xmloff/shapeexport.hxx
+++ b/xmloff/inc/xmloff/shapeexport.hxx
@@ -199,11 +199,6 @@ private:
const rtl::OUString msStartShape;
const rtl::OUString msEndShape;
const rtl::OUString msOnClick;
-#ifdef ISSUE66550_HLINK_FOR_SHAPES
- const rtl::OUString msOnAction;
- const rtl::OUString msAction;
- const rtl::OUString msURL;
-#endif
const rtl::OUString msEventType;
const rtl::OUString msPresentation;
const rtl::OUString msMacroName;
diff --git a/xmloff/inc/xmloff/xmltoken.hxx b/xmloff/inc/xmloff/xmltoken.hxx
index 0e848d69b1..0f9ff6695b 100644
--- a/xmloff/inc/xmloff/xmltoken.hxx
+++ b/xmloff/inc/xmloff/xmltoken.hxx
@@ -145,10 +145,13 @@ namespace xmloff { namespace token {
XML_NP_OFFICE_EXT,
XML_N_OFFICE_EXT,
+ // jonp: 2008-09-24 Excel Interop
+ XML_NP_FORMX,
+ XML_N_FORMX,
+
XML_NP_TABLE_EXT,
XML_N_TABLE_EXT,
-
XML_NP_DRAW_EXT,
XML_N_DRAW_EXT,
diff --git a/xmloff/source/core/xmlexp.cxx b/xmloff/source/core/xmlexp.cxx
index 01c6647ef2..c58cdb4297 100644
--- a/xmloff/source/core/xmlexp.cxx
+++ b/xmloff/source/core/xmlexp.cxx
@@ -409,6 +409,7 @@ void SvXMLExport::_InitCtor()
mpNamespaceMap->Add( GetXMLToken(XML_NP_XSD), GetXMLToken(XML_N_XSD), XML_NAMESPACE_XSD );
mpNamespaceMap->Add( GetXMLToken(XML_NP_XSI), GetXMLToken(XML_N_XSI), XML_NAMESPACE_XSI );
mpNamespaceMap->Add( GetXMLToken(XML_NP_FIELD), GetXMLToken(XML_N_FIELD), XML_NAMESPACE_FIELD );
+ mpNamespaceMap->Add( GetXMLToken(XML_NP_FORMX), GetXMLToken(XML_N_FORMX), XML_NAMESPACE_FORMX );
}
// RDFa: needed for content and header/footer styles
if( (getExportFlags() & (EXPORT_STYLES|EXPORT_AUTOSTYLES|EXPORT_MASTERSTYLES|EXPORT_CONTENT) ) != 0 )
diff --git a/xmloff/source/core/xmlimp.cxx b/xmloff/source/core/xmlimp.cxx
index 87c29594ca..2bbfdad82c 100644
--- a/xmloff/source/core/xmlimp.cxx
+++ b/xmloff/source/core/xmlimp.cxx
@@ -115,6 +115,7 @@ sal_Char __READONLY_DATA sXML_np__script[] = "_script";
sal_Char __READONLY_DATA sXML_np__config[] = "_config";
sal_Char __READONLY_DATA sXML_np__db[] = "_db";
sal_Char __READONLY_DATA sXML_np__xforms[] = "_xforms";
+sal_Char __READONLY_DATA sXML_np__formx[] = "_formx";
sal_Char __READONLY_DATA sXML_np__xsd[] = "_xsd";
sal_Char __READONLY_DATA sXML_np__xsi[] = "_xsi";
sal_Char __READONLY_DATA sXML_np__field[] = "_field";
@@ -310,6 +311,9 @@ void SvXMLImport::_InitCtor()
mpNamespaceMap->Add( OUString( RTL_CONSTASCII_USTRINGPARAM ( sXML_np__xforms) ),
GetXMLToken(XML_N_XFORMS_1_0),
XML_NAMESPACE_XFORMS );
+ mpNamespaceMap->Add( OUString( RTL_CONSTASCII_USTRINGPARAM ( sXML_np__formx) ),
+ GetXMLToken( XML_N_FORMX ),
+ XML_NAMESPACE_FORMX );
mpNamespaceMap->Add( OUString( RTL_CONSTASCII_USTRINGPARAM ( sXML_np__xsd) ),
GetXMLToken(XML_N_XSD),
XML_NAMESPACE_XSD );
diff --git a/xmloff/source/core/xmltoken.cxx b/xmloff/source/core/xmltoken.cxx
index 0ebf878d95..7564910281 100644
--- a/xmloff/source/core/xmltoken.cxx
+++ b/xmloff/source/core/xmltoken.cxx
@@ -153,6 +153,9 @@ namespace xmloff { namespace token {
TOKEN( "officeooo", XML_NP_OFFICE_EXT ),
TOKEN( "http://openoffice.org/2009/office", XML_N_OFFICE_EXT ),
+ // jonp: 2008-09-24 Excel Interop
+ TOKEN( "formx", XML_NP_FORMX ),
+ TOKEN( "urn:openoffice:names:experimental:ooxml-odf-interop:xmlns:form:1.0", XML_N_FORMX ),
TOKEN( "tableooo", XML_NP_TABLE_EXT ),
TOKEN( "http://openoffice.org/2009/table", XML_N_TABLE_EXT ),
diff --git a/xmloff/source/draw/eventimp.cxx b/xmloff/source/draw/eventimp.cxx
index dcc9ff48cb..732fc07de9 100644
--- a/xmloff/source/draw/eventimp.cxx
+++ b/xmloff/source/draw/eventimp.cxx
@@ -101,9 +101,6 @@ public:
sal_Bool mbValid;
sal_Bool mbScript;
-#ifdef ISSUE66550_HLINK_FOR_SHAPES
- sal_Bool mbActionEvent;
-#endif
ClickAction meClickAction;
XMLEffect meEffect;
XMLEffectDirection meDirection;
@@ -115,9 +112,6 @@ public:
OUString msMacroName;
OUString msBookmark;
OUString msLanguage;
-#ifdef ISSUE66550_HLINK_FOR_SHAPES
- OUString msHyperURL;
-#endif
};
///////////////////////////////////////////////////////////////////////
@@ -176,18 +170,11 @@ TYPEINIT1( SdXMLEventContext, SvXMLImportContext );
SdXMLEventContext::SdXMLEventContext( SvXMLImport& rImp, sal_uInt16 nPrfx, const OUString& rLocalName, const Reference< XAttributeList >& xAttrList, const Reference< XShape >& rxShape )
: SvXMLImportContext(rImp, nPrfx, rLocalName),
-#ifdef ISSUE66550_HLINK_FOR_SHAPES
- mxShape( rxShape ), mbScript( sal_False ), mbActionEvent( sal_False ), meClickAction( ClickAction_NONE ),
-#else
mxShape( rxShape ), mbScript( sal_False ), meClickAction( ClickAction_NONE ),
-#endif
meEffect( EK_none ), meDirection( ED_none ), mnStartScale( 100 ),
meSpeed( AnimationSpeed_MEDIUM ), mnVerb(0), mbPlayFull( sal_False )
{
static const OUString sXMLClickName( RTL_CONSTASCII_USTRINGPARAM( "click" ) );
-#ifdef ISSUE66550_HLINK_FOR_SHAPES
- static const OUString sXMLActionName( RTL_CONSTASCII_USTRINGPARAM( "action" ) );
-#endif
if( nPrfx == XML_NAMESPACE_PRESENTATION && IsXMLToken( rLocalName, XML_EVENT_LISTENER ) )
{
@@ -258,12 +245,7 @@ SdXMLEventContext::SdXMLEventContext( SvXMLImport& rImp, sal_uInt16 nPrfx, cons
sEventName = sValue;
sal_uInt16 nScriptPrefix =
GetImport().GetNamespaceMap().GetKeyByAttrName( sValue, &sEventName );
-#ifdef ISSUE66550_HLINK_FOR_SHAPES
- mbValid = XML_NAMESPACE_DOM == nScriptPrefix && ( sEventName == sXMLClickName || sEventName == sXMLActionName );
- mbActionEvent = mbValid && (sEventName == sXMLActionName);
-#else
mbValid = XML_NAMESPACE_DOM == nScriptPrefix && sEventName == sXMLClickName;
-#endif
}
else if( IsXMLToken( aAttrLocalName, XML_LANGUAGE ) )
{
@@ -292,12 +274,6 @@ SdXMLEventContext::SdXMLEventContext( SvXMLImport& rImp, sal_uInt16 nPrfx, cons
{
msMacroName = sValue;
}
-#ifdef ISSUE66550_HLINK_FOR_SHAPES
- else if ( mbActionEvent )
- {
- msHyperURL = sValue;
- }
-#endif
else
{
const rtl::OUString &rTmp =
@@ -343,26 +319,6 @@ void SdXMLEventContext::EndElement()
OUString sAPIEventName;
uno::Sequence< beans::PropertyValue > aProperties;
-#ifdef ISSUE66550_HLINK_FOR_SHAPES
- if( mbActionEvent )
- {
- sAPIEventName = OUString( RTL_CONSTASCII_USTRINGPARAM( "OnAction" ) );
- aProperties.realloc( 2 );
- beans::PropertyValue* pProperty = aProperties.getArray();
-
- pProperty->Name = OUString( RTL_CONSTASCII_USTRINGPARAM( "EventType" ) );
- pProperty->Handle = -1;
- pProperty->Value <<= OUString( RTL_CONSTASCII_USTRINGPARAM( "Action" ) );
- pProperty->State = beans::PropertyState_DIRECT_VALUE;
- ++pProperty;
- pProperty->Name = OUString( RTL_CONSTASCII_USTRINGPARAM( "URL" ) );
- pProperty->Handle = -1;
- pProperty->Value <<= msHyperURL;
- pProperty->State = beans::PropertyState_DIRECT_VALUE;
- }
- else
-#endif
- {
sAPIEventName = OUString( RTL_CONSTASCII_USTRINGPARAM( "OnClick" ) );
if( mbScript )
@@ -547,8 +503,6 @@ void SdXMLEventContext::EndElement()
break;
}
}
- }
-
xEvents->replaceByName( sAPIEventName, uno::Any( aProperties ) );
} while(0);
diff --git a/xmloff/source/draw/shapeexport.cxx b/xmloff/source/draw/shapeexport.cxx
index 76353ba6a3..7dc8ce67d3 100644
--- a/xmloff/source/draw/shapeexport.cxx
+++ b/xmloff/source/draw/shapeexport.cxx
@@ -90,11 +90,6 @@ XMLShapeExport::XMLShapeExport(SvXMLExport& rExp,
msStartShape( RTL_CONSTASCII_USTRINGPARAM("StartShape") ),
msEndShape( RTL_CONSTASCII_USTRINGPARAM("EndShape") ),
msOnClick( RTL_CONSTASCII_USTRINGPARAM("OnClick") ),
-#ifdef ISSUE66550_HLINK_FOR_SHAPES
- msOnAction( RTL_CONSTASCII_USTRINGPARAM("OnAction") ),
- msAction( RTL_CONSTASCII_USTRINGPARAM("Action") ),
- msURL( RTL_CONSTASCII_USTRINGPARAM("URL") ),
-#endif
msEventType( RTL_CONSTASCII_USTRINGPARAM("EventType") ),
msPresentation( RTL_CONSTASCII_USTRINGPARAM("Presentation") ),
msMacroName( RTL_CONSTASCII_USTRINGPARAM("MacroName") ),
diff --git a/xmloff/source/draw/shapeexport2.cxx b/xmloff/source/draw/shapeexport2.cxx
index 6a21bf5bee..f28591ffc7 100644
--- a/xmloff/source/draw/shapeexport2.cxx
+++ b/xmloff/source/draw/shapeexport2.cxx
@@ -291,9 +291,6 @@ const sal_Int32 FOUND_CLICKEVENTTYPE = 0x00000080;
const sal_Int32 FOUND_MACRO = 0x00000100;
const sal_Int32 FOUND_LIBRARY = 0x00000200;
const sal_Int32 FOUND_ACTIONEVENTTYPE = 0x00000400;
-#ifdef ISSUE66550_HLINK_FOR_SHAPES
-const sal_Int32 FOUND_URL = 0x00000800;
-#endif
} // namespace
@@ -383,33 +380,6 @@ void XMLShapeExport::ImpExportEvents( const uno::Reference< drawing::XShape >& x
}
}
-#ifdef ISSUE66550_HLINK_FOR_SHAPES
- // extract properties from "OnAction" event -------------------------------
-
- OUString aActionEventType;
- OUString aHyperURL;
-
- uno::Sequence< beans::PropertyValue > aActionProperties;
- if( xEvents->hasByName( msOnAction ) && (xEvents->getByName( msOnAction ) >>= aActionProperties) )
- {
- const beans::PropertyValue* pProperty = aActionProperties.getConstArray();
- const beans::PropertyValue* pPropertyEnd = pProperty + aActionProperties.getLength();
- for( ; pProperty != pPropertyEnd; ++pProperty )
- {
- if( ( ( nFound & FOUND_ACTIONEVENTTYPE ) == 0 ) && pProperty->Name == msEventType )
- {
- if( pProperty->Value >>= aActionEventType )
- nFound |= FOUND_ACTIONEVENTTYPE;
- }
- else if( ( ( nFound & FOUND_URL ) == 0 ) && ( pProperty->Name == msURL ) )
- {
- if( pProperty->Value >>= aHyperURL )
- nFound |= FOUND_URL;
- }
- }
- }
-#endif
-
// create the XML elements
if( aClickEventType == msPresentation )
@@ -561,15 +531,9 @@ void XMLShapeExport::ImpExportEvents( const uno::Reference< drawing::XShape >& x
SvXMLElementExport aEventElemt(mrExport, XML_NAMESPACE_SCRIPT, XML_EVENT_LISTENER, sal_True, sal_True);
}
}
-#ifdef ISSUE66550_HLINK_FOR_SHAPES
- else if( aClickEventType == msScript || aActionEventType == msAction )
- {
- if( nFound & ( FOUND_MACRO | FOUND_URL ) )
-#else
else if( aClickEventType == msScript )
{
if( nFound & FOUND_MACRO )
-#endif
{
SvXMLElementExport aEventsElemt(mrExport, XML_NAMESPACE_OFFICE, XML_EVENT_LISTENERS, sal_True, sal_True);
if ( nFound & FOUND_MACRO )
@@ -584,18 +548,6 @@ void XMLShapeExport::ImpExportEvents( const uno::Reference< drawing::XShape >& x
SvXMLElementExport aEventElemt(mrExport, XML_NAMESPACE_SCRIPT, XML_EVENT_LISTENER, sal_True, sal_True);
}
-#ifdef ISSUE66550_HLINK_FOR_SHAPES
- if ( nFound & FOUND_URL )
- {
- OUString aEventQName(
- mrExport.GetNamespaceMap().GetQNameByKey(
- XML_NAMESPACE_DOM, OUString( RTL_CONSTASCII_USTRINGPARAM( "action" ) ) ) );
- mrExport.AddAttribute( XML_NAMESPACE_SCRIPT, XML_EVENT_NAME, aEventQName );
- mrExport.AddAttribute( XML_NAMESPACE_XLINK, XML_HREF, aHyperURL );
-
- SvXMLElementExport aEventElemt(mrExport, XML_NAMESPACE_PRESENTATION, XML_EVENT_LISTENER, sal_True, sal_True);
- }
-#endif
}
}
}
diff --git a/xmloff/source/draw/ximpshap.cxx b/xmloff/source/draw/ximpshap.cxx
index 82285ba30d..a12207781e 100644
--- a/xmloff/source/draw/ximpshap.cxx
+++ b/xmloff/source/draw/ximpshap.cxx
@@ -1,7 +1,7 @@
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
+ *
* Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
@@ -187,7 +187,7 @@ SvXMLImportContext *SdXMLShapeContext::CreateChildContext( USHORT p_nPrefix,
SvXMLImportContext * pContext = NULL;
// #i68101#
- if( p_nPrefix == XML_NAMESPACE_SVG &&
+ if( p_nPrefix == XML_NAMESPACE_SVG &&
(IsXMLToken( rLocalName, XML_TITLE ) || IsXMLToken( rLocalName, XML_DESC ) ) )
{
pContext = new SdXMLDescriptionContext( GetImport(), p_nPrefix, rLocalName, xAttrList, mxShape );
@@ -374,9 +374,15 @@ void SdXMLShapeContext::EndElement()
if( msHyperlink.getLength() != 0 ) try
{
+ uno::Reference< beans::XPropertySet > xProp( mxShape, uno::UNO_QUERY );
+
+ rtl::OUString sLink( RTL_CONSTASCII_USTRINGPARAM( "Hyperlink" ) );
+ if ( xProp.is() && xProp->getPropertySetInfo()->hasPropertyByName( sLink ) )
+ xProp->setPropertyValue( sLink, uno::Any( msHyperlink ) );
+ Reference< XEventsSupplier > xEventsSupplier( mxShape, UNO_QUERY_THROW );
+ Reference< XNameReplace > xEvents( xEventsSupplier->getEvents(), UNO_QUERY_THROW );
const OUString sBookmark( RTL_CONSTASCII_USTRINGPARAM( "Bookmark" ) );
- Reference< XEventsSupplier > xEventsSupplier( mxShape, UNO_QUERY );
if( xEventsSupplier.is() )
{
const OUString sEventType( RTL_CONSTASCII_USTRINGPARAM( "EventType" ) );
@@ -1834,8 +1840,8 @@ void SdXMLConnectorShapeContext::processAttribute( sal_uInt16 nPrefix, const ::r
{
SdXMLImExViewBox aViewBox( 0, 0, 1, 1 );
awt::Point aPoint( 0, 0 );
- awt::Size aSize( 1, 1 );
-
+ awt::Size aSize( 1, 1 );
+
SdXMLImExSvgDElement aPoints( rValue, aViewBox,
aPoint, aSize, GetImport().GetMM100UnitConverter() );
@@ -2184,7 +2190,7 @@ void SdXMLCaptionShapeContext::StartElement(const uno::Reference< xml::sax::XAtt
uno::Reference< beans::XPropertySet > xProps( mxShape, uno::UNO_QUERY );
// SJ: If AutoGrowWidthItem is set, SetTransformation will lead to the wrong SnapRect
- // because NbcAdjustTextFrameWidthAndHeight() is called (text is set later and center alignment
+ // because NbcAdjustTextFrameWidthAndHeight() is called (text is set later and center alignment
// is the default setting, so the top left reference point that is used by the caption point is
// no longer correct) There are two ways to solve this problem, temporarily disabling the
// autogrowwith as we are doing here or to apply the CaptionPoint after setting text
@@ -2197,7 +2203,7 @@ void SdXMLCaptionShapeContext::StartElement(const uno::Reference< xml::sax::XAtt
if ( bIsAutoGrowWidth )
xProps->setPropertyValue( OUString(RTL_CONSTASCII_USTRINGPARAM("TextAutoGrowWidth")), uno::makeAny( sal_False ) );
}
-
+
// set pos, size, shear and rotate
SetTransformation();
if( xProps.is() )
@@ -2821,7 +2827,7 @@ void SdXMLAppletShapeContext::EndElement()
aAny <<= aRect;
xProps->setPropertyValue( OUString( RTL_CONSTASCII_USTRINGPARAM( "VisibleArea" ) ), aAny );
}
-
+
if( maParams.getLength() )
{
aAny <<= maParams;
@@ -3059,17 +3065,17 @@ void SdXMLPluginShapeContext::EndElement()
else
{
// in case we have a media object
-
+
OUString sTempRef;
-
+
// check for package URL
if( GetImport().IsPackageURL( maHref ) )
{
- sTempRef = OUString( RTL_CONSTASCII_USTRINGPARAM( "vnd.sun.star.Package:" ) );
+ sTempRef = OUString( RTL_CONSTASCII_USTRINGPARAM( "vnd.sun.star.Package:" ) );
}
-
+
sTempRef += maHref;
-
+
xProps->setPropertyValue( OUString( RTL_CONSTASCII_USTRINGPARAM( "MediaURL" ) ), uno::makeAny( sTempRef ) );
for( sal_Int32 nParam = 0; nParam < maParams.getLength(); ++nParam )
@@ -3306,9 +3312,16 @@ SvXMLImportContext *SdXMLFrameShapeContext::CreateChildContext( USHORT nPrefix,
if( !mxImplContext.Is() )
{
- pContext = GetImport().GetShapeImport()->CreateFrameChildContext(
+
+ SvXMLShapeContext* pShapeContext= GetImport().GetShapeImport()->CreateFrameChildContext(
GetImport(), nPrefix, rLocalName, xAttrList, mxShapes, mxAttrList );
+ pContext = pShapeContext;
+
+ // propagate the hyperlink to child context
+ if ( msHyperlink.getLength() > 0 )
+ pShapeContext->setHyperlink( msHyperlink );
+
mxImplContext = pContext;
mbSupportsReplacement = IsXMLToken( rLocalName, XML_OBJECT ) ||
IsXMLToken( rLocalName, XML_OBJECT_OLE );
@@ -3333,7 +3346,7 @@ SvXMLImportContext *SdXMLFrameShapeContext::CreateChildContext( USHORT nPrefix,
}
}
}
- else if(
+ else if(
( nPrefix == XML_NAMESPACE_SVG && // #i68101#
(IsXMLToken( rLocalName, XML_TITLE ) || IsXMLToken( rLocalName, XML_DESC ) ) ) ||
(nPrefix == XML_NAMESPACE_OFFICE && IsXMLToken( rLocalName, XML_EVENT_LISTENERS ) ) ||
@@ -3669,7 +3682,7 @@ void SdXMLTableShapeContext::StartElement( const ::com::sun::star::uno::Referenc
catch( Exception& )
{
DBG_ERROR("SdXMLTableShapeContext::StartElement(), exception caught!");
- }
+ }
}
}
diff --git a/xmloff/source/forms/elementexport.cxx b/xmloff/source/forms/elementexport.cxx
index d3f39ec996..4cd111e3d5 100644
--- a/xmloff/source/forms/elementexport.cxx
+++ b/xmloff/source/forms/elementexport.cxx
@@ -1107,6 +1107,39 @@ namespace xmloff
}
// ----------------------------------
+ // the string properties
+ {
+ static sal_Int32 nStringPropertyAttributeIds[] =
+ { // attribute flags
+ SCA_GROUP_NAME
+ };
+ static const ::rtl::OUString* pStringPropertyNames[] =
+ { // property names
+ &PROPERTY_GROUP_NAME
+ };
+
+ sal_Int32 nIdCount = sizeof( nStringPropertyAttributeIds ) / sizeof( nStringPropertyAttributeIds[0] );
+ #if OSL_DEBUG_LEVEL > 0
+ sal_Int32 nNameCount = sizeof( pStringPropertyNames ) / sizeof( pStringPropertyNames[0] );
+ OSL_ENSURE( ( nIdCount == nNameCount ),
+ "OControlExport::exportSpecialAttributes: somebody tampered with the maps (2)!" );
+ #endif
+ for ( i = 0; i < nIdCount; ++i )
+ if ( nStringPropertyAttributeIds[i] & m_nIncludeSpecial )
+ {
+ exportStringPropertyAttribute(
+ OAttributeMetaData::getSpecialAttributeNamespace( nStringPropertyAttributeIds[i] ),
+ OAttributeMetaData::getSpecialAttributeName( nStringPropertyAttributeIds[i] ),
+ *( pStringPropertyNames[i] )
+ );
+ #if OSL_DEBUG_LEVEL > 0
+ // reset the bit for later checking
+ m_nIncludeSpecial = m_nIncludeSpecial & ~nStringPropertyAttributeIds[i];
+ #endif
+ }
+ }
+
+ // ----------------------------------
if ((SCA_MIN_VALUE | SCA_MAX_VALUE) & m_nIncludeSpecial)
{
// need to export the min value and the max value as attributes
@@ -1564,6 +1597,8 @@ namespace xmloff
}
if ( m_xPropertyInfo->hasPropertyByName( PROPERTY_IMAGE_POSITION ) )
m_nIncludeSpecial |= SCA_IMAGE_POSITION;
+ if ( m_xPropertyInfo->hasPropertyByName( PROPERTY_GROUP_NAME ) )
+ m_nIncludeSpecial |= SCA_GROUP_NAME;
m_nIncludeDatabase = DA_DATA_FIELD | DA_INPUT_REQUIRED;
m_nIncludeEvents = EA_CONTROL_EVENTS | EA_ON_CHANGE;
break;
diff --git a/xmloff/source/forms/formattributes.cxx b/xmloff/source/forms/formattributes.cxx
index 430b2573af..9bdd5b21b8 100644
--- a/xmloff/source/forms/formattributes.cxx
+++ b/xmloff/source/forms/formattributes.cxx
@@ -192,6 +192,7 @@ namespace xmloff
case SCA_MAX_VALUE: return "max-value";
case SCA_MIN_VALUE: return "min-value";
case SCA_VALIDATION: return "validation";
+ case SCA_GROUP_NAME: return "group-name";
case SCA_MULTI_LINE: return "multi-line";
case SCA_AUTOMATIC_COMPLETION: return "auto-complete";
case SCA_MULTIPLE: return "multiple";
@@ -212,9 +213,12 @@ namespace xmloff
}
//---------------------------------------------------------------------
- sal_uInt16 OAttributeMetaData::getSpecialAttributeNamespace(sal_Int32 /*_nId*/)
+ sal_uInt16 OAttributeMetaData::getSpecialAttributeNamespace(sal_Int32 _nId)
{
- // nothing special here
+ switch( _nId )
+ {
+ case SCA_GROUP_NAME: return XML_NAMESPACE_FORMX;
+ }
return XML_NAMESPACE_FORM;
}
diff --git a/xmloff/source/forms/formattributes.hxx b/xmloff/source/forms/formattributes.hxx
index f2e7bb7cc3..a406a6e7c9 100644
--- a/xmloff/source/forms/formattributes.hxx
+++ b/xmloff/source/forms/formattributes.hxx
@@ -123,6 +123,7 @@ namespace xmloff
#define SCA_MAX_VALUE 0x00000002
#define SCA_MIN_VALUE 0x00000004
#define SCA_VALIDATION 0x00000008
+ #define SCA_GROUP_NAME 0x00000010
#define SCA_MULTI_LINE 0x00000020
#define SCA_AUTOMATIC_COMPLETION 0x00000080
#define SCA_MULTIPLE 0x00000100
diff --git a/xmloff/source/forms/layerimport.cxx b/xmloff/source/forms/layerimport.cxx
index 5fe178f561..bb478f1078 100644
--- a/xmloff/source/forms/layerimport.cxx
+++ b/xmloff/source/forms/layerimport.cxx
@@ -95,6 +95,8 @@ OFormLayerXMLImport_Impl::OFormLayerXMLImport_Impl(SvXMLImport& _rImporter)
m_aAttributeMetaData.addStringProperty(
OAttributeMetaData::getCommonControlAttributeName(CCA_NAME), PROPERTY_NAME);
m_aAttributeMetaData.addStringProperty(
+ OAttributeMetaData::getSpecialAttributeName(SCA_GROUP_NAME), PROPERTY_GROUP_NAME);
+ m_aAttributeMetaData.addStringProperty(
OAttributeMetaData::getCommonControlAttributeName(CCA_IMAGE_DATA), PROPERTY_IMAGEURL);
m_aAttributeMetaData.addStringProperty(
OAttributeMetaData::getCommonControlAttributeName(CCA_LABEL), PROPERTY_LABEL);
diff --git a/xmloff/source/forms/strings.hxx b/xmloff/source/forms/strings.hxx
index 83d4262531..8b7b6ef4b2 100644
--- a/xmloff/source/forms/strings.hxx
+++ b/xmloff/source/forms/strings.hxx
@@ -205,6 +205,7 @@ namespace xmloff
XMLFORM_CONSTASCII_STRING( PROPERTY_IMAGE_POSITION, "ImagePosition");
XMLFORM_CONSTASCII_STRING( PROPERTY_IMAGE_ALIGN, "ImageAlign");
XMLFORM_CONSTASCII_STRING( PROPERTY_SCALE_IMAGE, "ScaleImage");
+ XMLFORM_CONSTASCII_STRING( PROPERTY_GROUP_NAME, "GroupName");
XMLFORM_CONSTASCII_STRING( PROPERTY_BOUND_CELL, "BoundCell");
XMLFORM_CONSTASCII_STRING( PROPERTY_LIST_CELL_RANGE, "CellRange");