summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Lippka <cl@openoffice.org>2000-10-20 13:53:32 +0000
committerChristian Lippka <cl@openoffice.org>2000-10-20 13:53:32 +0000
commite8671778aba28f6febc72376cd93276094409455 (patch)
tree0f5764e4797cd78cdf6e38ad63ce4180c219e1aa
parent44450b044e87909a0bd5b9833a368983c39e9df6 (diff)
#78916# added missing entities
-rw-r--r--svx/xml/SvxDrawPage.xml4
-rw-r--r--svx/xml/SvxShapePolyPolygonBezier.xml4
-rw-r--r--svx/xml/SvxUnoNumberingRules.xml4
-rw-r--r--svx/xml/SvxUnoText.xml4
-rw-r--r--svx/xml/SvxUnoTextContent.xml4
-rw-r--r--svx/xml/SvxUnoTextContentEnum.xml4
-rw-r--r--svx/xml/SvxUnoTextCursor.xml4
-rw-r--r--svx/xml/SvxUnoTextField.xml4
-rw-r--r--svx/xml/SvxUnoTextRange.xml4
-rw-r--r--xmloff/source/style/AttributeContainerHandler.cxx147
-rw-r--r--xmloff/source/style/makefile.mk9
-rw-r--r--xmloff/source/style/prhdlfac.cxx10
-rw-r--r--xmloff/source/style/xmlexppr.cxx61
-rw-r--r--xmloff/source/style/xmlimppr.cxx91
14 files changed, 276 insertions, 78 deletions
diff --git a/svx/xml/SvxDrawPage.xml b/svx/xml/SvxDrawPage.xml
index b8554021d9..2deb664161 100644
--- a/svx/xml/SvxDrawPage.xml
+++ b/svx/xml/SvxDrawPage.xml
@@ -5,11 +5,13 @@
<Author>automatically generated by objects2xml</Author>
<Name>com.sun.star.comp.office.SvxDrawPage</Name>
<Description>
- This component provides ...
+ This component implements the basic functionality for a drawing page
</Description>
<SupportedService>com::sun::star::drawing::DrawPage</SupportedService>
+<ModuleName>svx</ModuleName>
+<LoaderName>com.sun.star.loader.SharedLibrary</LoaderName>
<Language>c++</Language>
<Status StatusValue="final"/>
diff --git a/svx/xml/SvxShapePolyPolygonBezier.xml b/svx/xml/SvxShapePolyPolygonBezier.xml
index 498ba8845c..fc4da3e093 100644
--- a/svx/xml/SvxShapePolyPolygonBezier.xml
+++ b/svx/xml/SvxShapePolyPolygonBezier.xml
@@ -5,11 +5,13 @@
<Author>automatically generated by objects2xml</Author>
<Name>com.sun.star.comp.office.SvxShapePolyPolygonBezier</Name>
<Description>
- This component provides ...
+ This component provides access to a poly polygon bezier shape.
</Description>
<SupportedService>com::sun::star::drawing::PolyPolygonBezierShape</SupportedService>
+<ModuleName>svx</ModuleName>
+<LoaderName>com.sun.star.loader.SharedLibrary</LoaderName>
<Language>c++</Language>
<Status StatusValue="final"/>
diff --git a/svx/xml/SvxUnoNumberingRules.xml b/svx/xml/SvxUnoNumberingRules.xml
index 45c2d3fac7..02b2ae3105 100644
--- a/svx/xml/SvxUnoNumberingRules.xml
+++ b/svx/xml/SvxUnoNumberingRules.xml
@@ -5,11 +5,13 @@
<Author>automatically generated by objects2xml</Author>
<Name>com.sun.star.comp.office.SvxUnoNumberingRules</Name>
<Description>
- This component provides ...
+ This component provides access to a anumbering rule
</Description>
<SupportedService>com::sun::star::text::NumberingRules</SupportedService>
+<ModuleName>svx</ModuleName>
+<LoaderName>com.sun.star.loader.SharedLibrary</LoaderName>
<Language>c++</Language>
<Status StatusValue="final"/>
diff --git a/svx/xml/SvxUnoText.xml b/svx/xml/SvxUnoText.xml
index b581a1fda0..97c20a9c49 100644
--- a/svx/xml/SvxUnoText.xml
+++ b/svx/xml/SvxUnoText.xml
@@ -5,11 +5,13 @@
<Author>automatically generated by objects2xml</Author>
<Name>com.sun.star.comp.office.SvxUnoText</Name>
<Description>
- This component provides ...
+ This component provides access to the text based on the edit engine or the outliner.
</Description>
<SupportedService>com::sun::star::text::Text</SupportedService>
+<ModuleName>svx</ModuleName>
+<LoaderName>com.sun.star.loader.SharedLibrary</LoaderName>
<Language>c++</Language>
<Status StatusValue="final"/>
diff --git a/svx/xml/SvxUnoTextContent.xml b/svx/xml/SvxUnoTextContent.xml
index b525cffb6c..5e379e2990 100644
--- a/svx/xml/SvxUnoTextContent.xml
+++ b/svx/xml/SvxUnoTextContent.xml
@@ -5,11 +5,13 @@
<Author>automatically generated by objects2xml</Author>
<Name>com.sun.star.comp.office.SvxUnoTextContent</Name>
<Description>
- This component provides ...
+ This component provides access to the paragraph contend inside the text of an edit engine or outliner.
</Description>
<SupportedService>com::sun::star::text::Paragraph</SupportedService>
+<ModuleName>svx</ModuleName>
+<LoaderName>com.sun.star.loader.SharedLibrary</LoaderName>
<Language>c++</Language>
<Status StatusValue="final"/>
diff --git a/svx/xml/SvxUnoTextContentEnum.xml b/svx/xml/SvxUnoTextContentEnum.xml
index fca3cd30fe..b1c9230589 100644
--- a/svx/xml/SvxUnoTextContentEnum.xml
+++ b/svx/xml/SvxUnoTextContentEnum.xml
@@ -5,11 +5,13 @@
<Author>automatically generated by objects2xml</Author>
<Name>com.sun.star.comp.office.SvxUnoTextContentEnum</Name>
<Description>
- This component provides ...
+ This component provides access to the paragraph insides an edit engine or outliner
</Description>
<SupportedService>com::sun::star::container::XEnumeration</SupportedService>
+<ModuleName>svx</ModuleName>
+<LoaderName>com.sun.star.loader.SharedLibrary</LoaderName>
<Language>c++</Language>
<Status StatusValue="final"/>
diff --git a/svx/xml/SvxUnoTextCursor.xml b/svx/xml/SvxUnoTextCursor.xml
index d7a8f73c5c..dd0244f3cb 100644
--- a/svx/xml/SvxUnoTextCursor.xml
+++ b/svx/xml/SvxUnoTextCursor.xml
@@ -5,11 +5,13 @@
<Author>automatically generated by objects2xml</Author>
<Name>com.sun.star.comp.office.SvxUnoTextCursor</Name>
<Description>
- This component provides ...
+ This component provides an implementation of a text cursor for the edit engine or outliner.
</Description>
<SupportedService>com::sun::star::text::TextCursor</SupportedService>
+<ModuleName>svx</ModuleName>
+<LoaderName>com.sun.star.loader.SharedLibrary</LoaderName>
<Language>c++</Language>
<Status StatusValue="final"/>
diff --git a/svx/xml/SvxUnoTextField.xml b/svx/xml/SvxUnoTextField.xml
index 4f77a6e729..6a415eb116 100644
--- a/svx/xml/SvxUnoTextField.xml
+++ b/svx/xml/SvxUnoTextField.xml
@@ -5,11 +5,13 @@
<Author>automatically generated by objects2xml</Author>
<Name>com.sun.star.comp.office.SvxUnoTextField</Name>
<Description>
- This component provides ...
+ This component provides access to a text field text content for edit engine and outliner
</Description>
<SupportedService>com::sun::star::text::TextField</SupportedService>
+<ModuleName>svx</ModuleName>
+<LoaderName>com.sun.star.loader.SharedLibrary</LoaderName>
<Language>c++</Language>
<Status StatusValue="final"/>
diff --git a/svx/xml/SvxUnoTextRange.xml b/svx/xml/SvxUnoTextRange.xml
index 552fec324d..12e8595a74 100644
--- a/svx/xml/SvxUnoTextRange.xml
+++ b/svx/xml/SvxUnoTextRange.xml
@@ -5,11 +5,13 @@
<Author>automatically generated by objects2xml</Author>
<Name>com.sun.star.comp.office.SvxUnoTextRange</Name>
<Description>
- This component provides ...
+ This component provides access to a simple text range in an edit engine or outliner.
</Description>
<SupportedService>com::sun::star::text::TextRange</SupportedService>
+<ModuleName>svx</ModuleName>
+<LoaderName>com.sun.star.loader.SharedLibrary</LoaderName>
<Language>c++</Language>
<Status StatusValue="final"/>
diff --git a/xmloff/source/style/AttributeContainerHandler.cxx b/xmloff/source/style/AttributeContainerHandler.cxx
new file mode 100644
index 0000000000..7e38c9cbfe
--- /dev/null
+++ b/xmloff/source/style/AttributeContainerHandler.cxx
@@ -0,0 +1,147 @@
+/*************************************************************************
+ *
+ * $RCSfile: AttributeContainerHandler.cxx,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change: $Author: cl $ $Date: 2000-10-20 14:53:32 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+#ifndef _COM_SUN_STAR_CONTAINER_XNAMECONTAINER_HPP_
+#include <com/sun/star/container/XNameContainer.hpp>
+#endif
+#ifndef _COM_SUN_STAR_XML_ATTRIBUTEDATA_HPP_
+#include <com/sun/star/xml/AttributeData.hpp>
+#endif
+
+#ifndef _COM_SUN_STAR_UNO_ANY_HXX_
+#include <com/sun/star/uno/Any.hxx>
+#endif
+
+#ifndef _RTL_USTRBUF_HXX_
+#include <rtl/ustrbuf.hxx>
+#endif
+
+#ifndef _COM_SUN_STAR_TEXT_GRAPHICCROP_HPP_
+#include <com/sun/star/text/GraphicCrop.hpp>
+#endif
+
+#include "AttributeContainerHandler.hxx"
+
+using namespace ::rtl;
+using namespace ::com::sun::star;
+using namespace ::com::sun::star::uno;
+using namespace ::com::sun::star::container;
+
+///////////////////////////////////////////////////////////////////////////////
+//
+// class XMLAttributeContainerHandler
+//
+
+XMLAttributeContainerHandler::~XMLAttributeContainerHandler()
+{
+ // nothing to do
+}
+
+sal_Bool XMLAttributeContainerHandler::equals(
+ const Any& r1,
+ const Any& r2 ) const
+{
+ Reference< XNameContainer > xContainer1;
+ Reference< XNameContainer > xContainer2;
+
+ if( ( r1 >>= xContainer1 ) && ( r2 >>= xContainer2 ) )
+ {
+ uno::Sequence< OUString > aAttribNames1( xContainer1->getElementNames() );
+ uno::Sequence< OUString > aAttribNames2( xContainer2->getElementNames() );
+ const sal_Int32 nCount = aAttribNames1.getLength();
+
+ if( aAttribNames2.getLength() == nCount )
+ {
+ const OUString* pAttribName = aAttribNames1.getConstArray();
+
+ xml::AttributeData aData1;
+ xml::AttributeData aData2;
+
+ for( sal_Int32 i=0; i < nCount; i++, pAttribName++ )
+ {
+ if( !xContainer2->hasByName( *pAttribName ) )
+ return sal_False;
+
+ xContainer1->getByName( *pAttribName ) >>= aData1;
+ xContainer2->getByName( *pAttribName ) >>= aData2;
+
+ if( ( aData1.Namespace != aData2.Namespace ) ||
+ ( aData1.Type != aData2.Type ) ||
+ ( aData1.Value != aData2.Value ) )
+ return sal_False;
+ }
+
+ return sal_True;
+ }
+ }
+
+ return sal_False;
+}
+
+sal_Bool XMLAttributeContainerHandler::importXML( const OUString& rStrImpValue, Any& rValue, const SvXMLUnitConverter& rUnitConverter ) const
+{
+ return sal_True;
+}
+
+sal_Bool XMLAttributeContainerHandler::exportXML( OUString& rStrExpValue, const Any& rValue, const SvXMLUnitConverter& rUnitConverter ) const
+{
+ return sal_True;
+}
diff --git a/xmloff/source/style/makefile.mk b/xmloff/source/style/makefile.mk
index 5bd35c321f..c338b1965f 100644
--- a/xmloff/source/style/makefile.mk
+++ b/xmloff/source/style/makefile.mk
@@ -2,9 +2,9 @@
#
# $RCSfile: makefile.mk,v $
#
-# $Revision: 1.5 $
+# $Revision: 1.6 $
#
-# last change: $Author: mib $ $Date: 2000-10-19 14:25:17 $
+# last change: $Author: cl $ $Date: 2000-10-20 14:53:32 $
#
# The Contents of this file are made available subject to the terms of
# either of the following licenses
@@ -132,6 +132,8 @@ CXXFILES = \
HatchStyle.cxx \
ImageStyle.cxx \
MarkerStyle.cxx \
+ DashStyle.cxx \
+ AttributeContainerHandler.cxx \
NamedBoolPropertyHdl.cxx \
TransGradientStyle.cxx \
XMLBackgroundImageContext.cxx \
@@ -146,7 +148,6 @@ CXXFILES = \
PageMasterPropMapper.cxx \
PageMasterExportPropMapper.cxx
-
SLOFILES = \
$(SLO)$/adjushdl.obj \
$(SLO)$/backhdl.obj \
@@ -209,6 +210,7 @@ SLOFILES = \
$(SLO)$/XMLBackgroundImageExport.obj \
$(SLO)$/XMLClipPropertyHandler.obj \
$(SLO)$/XMLConstantsPropertyHandler.obj \
+ $(SLO)$/AttributeContainerHandler.obj \
$(SLO)$/XMLElementPropertyContext.obj \
$(SLO)$/XMLPageExport.obj \
$(SLO)$/PageMasterPropHdl.obj \
@@ -217,7 +219,6 @@ SLOFILES = \
$(SLO)$/PageMasterPropMapper.obj \
$(SLO)$/PageMasterExportPropMapper.obj
-
# --- Tagets -------------------------------------------------------
.INCLUDE : target.mk
diff --git a/xmloff/source/style/prhdlfac.cxx b/xmloff/source/style/prhdlfac.cxx
index 5647319776..2d9948efb0 100644
--- a/xmloff/source/style/prhdlfac.cxx
+++ b/xmloff/source/style/prhdlfac.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: prhdlfac.cxx,v $
*
- * $Revision: 1.3 $
+ * $Revision: 1.4 $
*
- * last change: $Author: mib $ $Date: 2000-10-19 14:25:17 $
+ * last change: $Author: cl $ $Date: 2000-10-20 14:53:32 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -137,6 +137,9 @@
#ifndef _XMLOFF_PROPERTYHANDLER_TABSTOPTYPES_HXX
#include <tabsthdl.hxx>
#endif
+#ifndef _XMLOFF_ATTRIBUTECONTAINERHANDLER_HXX
+#include "AttributeContainerHandler.hxx"
+#endif
///////////////////////////////////////////////////////////////////////////
//
@@ -340,6 +343,9 @@ const XMLPropertyHandler* XMLPropertyHandlerFactory::GetBasicHandler( sal_Int32
case XML_TYPE_TEXT_TABSTOP:
pPropHdl = new XMLTabStopPropHdl;
break;
+ case XML_TYPE_ATTRIBUTE_CONTAINER:
+ pPropHdl = new XMLAttributeContainerHandler;
+ break;
}
if( pPropHdl )
diff --git a/xmloff/source/style/xmlexppr.cxx b/xmloff/source/style/xmlexppr.cxx
index 3d36e500df..657ad5bab1 100644
--- a/xmloff/source/style/xmlexppr.cxx
+++ b/xmloff/source/style/xmlexppr.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: xmlexppr.cxx,v $
*
- * $Revision: 1.2 $
+ * $Revision: 1.3 $
*
- * last change: $Author: mib $ $Date: 2000-10-19 14:25:17 $
+ * last change: $Author: cl $ $Date: 2000-10-20 14:53:32 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -59,6 +59,18 @@
*
************************************************************************/
+#ifndef _COM_SUN_STAR_CONTAINER_XNAMECONTAINER_HPP_
+#include <com/sun/star/container/XNameContainer.hpp>
+#endif
+
+#ifndef _COM_SUN_STAR_XML_ATTRIBUTEDATA_HPP_
+#include <com/sun/star/xml/AttributeData.hpp>
+#endif
+
+#ifndef _RTL_USTRBUF_HXX_
+#include <rtl/ustrbuf.hxx>
+#endif
+
#include "xmlexppr.hxx"
#ifndef _XMLOFF_XMLKYWD_HXX
@@ -273,34 +285,41 @@ void SvXMLExportPropertyMapper::_exportXML(
if ( ( maPropMapper->GetEntryFlags( rProperty.mnIndex ) &
MID_FLAG_SPECIAL_ITEM_EXPORT ) != 0 )
{
- /* Currently, we have nothing like a SvXMLAttrContainerItem, since we use properties instead of poolitems
-
- if( rItem.ISA( SvXMLAttrContainerItem ) )
- {
+ uno::Reference< container::XNameContainer > xAttrContainer;
+ if( rProperty.maValue >>= xAttrContainer )
+ {
SvXMLNamespaceMap *pNewNamespaceMap = 0;
const SvXMLNamespaceMap *pNamespaceMap = &rNamespaceMap;
-
- const SvXMLAttrContainerItem *pUnknown = PTR_CAST( SvXMLAttrContainerItem, &rItem );
+
+ uno::Sequence< OUString > aAttribNames( xAttrContainer->getElementNames() );
+ const OUString* pAttribName = aAttribNames.getConstArray();
+
+ const sal_Int32 nCount = aAttribNames.getLength();
- sal_uInt16 nCount = pUnknown->GetAttrCount();
OUStringBuffer sName;
- for( sal_uInt16 i=0; i < nCount; i++ )
+ xml::AttributeData aData;
+ for( sal_Int32 i=0; i < nCount; i++, pAttribName++ )
{
- OUString sPrefix( pUnknown->GetAttrPrefix( i ) );
+ xAttrContainer->getByName( *pAttribName ) >>= aData;
+
+ // extract namespace prefix from attribute name if it exists
+ OUString sPrefix;
+ const sal_Int32 nPos = pAttribName->indexOf( sal_Unicode(':') );
+ if( nPos != -1 )
+ sPrefix = pAttribName->copy( 0, nPos );
+
if( sPrefix.getLength() )
{
- OUString sNamespace( pUnknown->GetAttrNamespace( i ) );
+ OUString sNamespace( aData.Namespace );
// if the prefix isn't defined yet or has another meaning,
// we have to redefine it now.
- sal_uInt16 nIdx = pNamespaceMap->GetIndexByPrefix( sPrefix );
- if( USHRT_MAX == nIdx ||
- pNamespaceMap->GetNameByIndex( nIdx ) != sNamespace )
+ sal_uInt16 nIdx = pNamespaceMap->GetIndexByPrefix( sPrefix );
+ if( USHRT_MAX == nIdx || pNamespaceMap->GetNameByIndex( nIdx ) != sNamespace )
{
if( !pNewNamespaceMap )
{
- pNewNamespaceMap =
- new SvXMLNamespaceMap( rNamespaceMap );
+ pNewNamespaceMap = new SvXMLNamespaceMap( rNamespaceMap );
pNamespaceMap = pNewNamespaceMap;
}
pNewNamespaceMap->Add( sPrefix, sNamespace );
@@ -311,20 +330,14 @@ void SvXMLExportPropertyMapper::_exportXML(
rAttrList.AddAttribute( sName.makeStringAndClear(), sCDATA,
sNamespace );
}
-
- sName.append( sPrefix );
- sName.append( sal_Unicode(':') );
}
- sName.append( pUnknown->GetAttrLName( i ) );
- rAttrList.AddAttribute( sName.makeStringAndClear(), sCDATA,
- pUnknown->GetAttrValue(i) );
+ rAttrList.AddAttribute( *pAttribName, aData.Type, aData.Value );
}
delete pNewNamespaceMap;
}
else
- */
{
handleSpecialItem( rAttrList, rProperty, rUnitConverter,
rNamespaceMap, pProperties, nIdx );
diff --git a/xmloff/source/style/xmlimppr.cxx b/xmloff/source/style/xmlimppr.cxx
index ec455e2bf0..507646b1e6 100644
--- a/xmloff/source/style/xmlimppr.cxx
+++ b/xmloff/source/style/xmlimppr.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: xmlimppr.cxx,v $
*
- * $Revision: 1.2 $
+ * $Revision: 1.3 $
*
- * last change: $Author: sab $ $Date: 2000-09-25 14:45:01 $
+ * last change: $Author: cl $ $Date: 2000-10-20 14:53:32 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -59,6 +59,13 @@
*
************************************************************************/
+#ifndef _COM_SUN_STAR_XML_ATTRIBUTEDATA_HPP_
+#include <com/sun/star/xml/AttributeData.hpp>
+#endif
+
+#ifndef _RTL_USTRBUF_HXX_
+#include <rtl/ustrbuf.hxx>
+#endif
#ifndef _XMLOFF_PROPERTYSETMAPPER_HXX
#include "xmlprmap.hxx"
@@ -74,7 +81,13 @@
#include "xmlimppr.hxx"
#endif
+#include "xmlkywd.hxx"
+#include "unoatrcn.hxx"
+#include "xmlnmspe.hxx"
+
using namespace ::com::sun::star::uno;
+using namespace ::com::sun::star::container;
+using namespace ::com::sun::star::xml;
using namespace ::com::sun::star::xml::sax;
using namespace ::rtl;
using namespace ::std;
@@ -98,7 +111,7 @@ void SvXMLImportPropertyMapper::importXML(
{
INT16 nAttr = xAttrList->getLength();
-// SvXMLAttrContainerItem *pUnknownItem = 0;
+ Reference< XNameContainer > xAttrContainer;
for( INT16 i=0; i < nAttr; i++ )
{
@@ -178,52 +191,52 @@ void SvXMLImportPropertyMapper::importXML(
}
else
{
- /*
- if( USHRT_MAX != mnUnknownWhich &&
- // TODO: PI
- (XML_NAMESPACE_NONE == nPrefix ||
- XML_NAMESPACE_UNKNOWN == nPrefix) )
+ if( XML_NAMESPACE_NONE == nPrefix || XML_NAMESPACE_UNKNOWN == nPrefix )
{
- if( !pUnknownItem )
+ if( !xAttrContainer.is() )
{
- const SfxPoolItem* pItem = 0;
- if( SFX_ITEM_SET == rSet.GetItemState( mnUnknownWhich, TRUE,
- &pItem ) )
- {
- SfxPoolItem *pNew = pItem->Clone();
- pUnknownItem = PTR_CAST( SvXMLAttrContainerItem, pNew );
- DBG_ASSERT( pUnknownItem,
- "SvXMLAttrContainerItem expected" );
- if( !pUnknownItem )
- delete pNew;
- }
- else
- {
- pUnknownItem = new SvXMLAttrContainerItem( mnUnknownWhich );
- }
+ // add an unknown attribute container to the properties
+ Reference< XNameContainer > xNew( SvUnoAttributeContainer_CreateInstance(), UNO_QUERY );
+ xAttrContainer = xNew;
+
+ // find map entry and create new property state
+ nIndex = maPropMapper->FindEntryIndex( "CharUserDefinedAttributes", XML_NAMESPACE_TEXT, sXML_xmlns );
+ if( nIndex == -1 )
+ nIndex = maPropMapper->FindEntryIndex( "ParaUserDefinedAttributes", XML_NAMESPACE_TEXT, sXML_xmlns );
+
+ Any aAny;
+ aAny <<= xAttrContainer;
+ XMLPropertyState aNewProperty( nIndex, aAny );
+
+ // push it on our stack so we export it later
+ rProperties.push_back( aNewProperty );
}
- if( pUnknownItem )
+
+ if( xAttrContainer.is() )
{
- if( XML_NAMESPACE_NONE == nPrefix )
- pUnknownItem->AddAttr( aLocalName, rValue );
- else
- pUnknownItem->AddAttr( aPrefix, aNamespace, aLocalName,
- rValue );
+ AttributeData aData;
+ aData.Type = OUString::createFromAscii( sXML_CDATA );
+ aData.Value = rValue;
+
+ OUStringBuffer sName;
+ if( XML_NAMESPACE_NONE != nPrefix )
+ {
+ sName.append( aPrefix );
+ sName.append( sal_Unicode(':') );
+ aData.Namespace = aNamespace;
+ }
+
+ sName.append( aLocalName );
+
+ Any aAny;
+ aAny <<= aData;
+ xAttrContainer->insertByName( sName.makeStringAndClear(), aAny );
}
}
- */
}
}
while( ( nIndex >= 0 ) && (( nFlags & MID_FLAG_MULTI_PROPERTY ) != 0 ) );
}
-
-/*
- if( pUnknownItem )
- {
- rSet.Put( *pUnknownItem );
- delete pUnknownItem;
- }
-*/
finished( rProperties );
}