summaryrefslogtreecommitdiff
path: root/xmloff
diff options
context:
space:
mode:
authorFrank Schönheit <fs@openoffice.org>2001-03-29 08:44:19 +0000
committerFrank Schönheit <fs@openoffice.org>2001-03-29 08:44:19 +0000
commit0bde99fb309fab2640491178f50d56728b2fa0a4 (patch)
treedaeae828bfb139a613f102355ad0221abf0eb2b6 /xmloff
parent9b2f611223d6201c5b5bb7ad85bf4fa6f7ebbf29 (diff)
enableTrackAttributes to prevent the (expensive) attribute tracking
Diffstat (limited to 'xmloff')
-rw-r--r--xmloff/source/forms/propertyimport.cxx12
-rw-r--r--xmloff/source/forms/propertyimport.hxx17
2 files changed, 23 insertions, 6 deletions
diff --git a/xmloff/source/forms/propertyimport.cxx b/xmloff/source/forms/propertyimport.cxx
index 628954d2015f..1c2003206bd6 100644
--- a/xmloff/source/forms/propertyimport.cxx
+++ b/xmloff/source/forms/propertyimport.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: propertyimport.cxx,v $
*
- * $Revision: 1.11 $
+ * $Revision: 1.12 $
*
- * last change: $Author: fs $ $Date: 2001-03-28 13:59:54 $
+ * last change: $Author: fs $ $Date: 2001-03-29 09:44:19 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -131,6 +131,7 @@ namespace xmloff
OPropertyImport::OPropertyImport(IFormsImportContext& _rImport, sal_uInt16 _nPrefix, const ::rtl::OUString& _rName)
:SvXMLImportContext(_rImport.getGlobalContext(), _nPrefix, _rName)
,m_rContext(_rImport)
+ ,m_bTrackAttributes(sal_False)
{
}
@@ -169,7 +170,8 @@ namespace xmloff
nNamespace = m_rContext.getGlobalContext().GetNamespaceMap().GetKeyByAttrName(_rxAttrList->getNameByIndex(i), &sLocalName);
handleAttribute(nNamespace, sLocalName, _rxAttrList->getValueByIndex(i));
- m_aEncounteredAttributes.insert(sLocalName);
+ if (m_bTrackAttributes)
+ m_aEncounteredAttributes.insert(sLocalName);
}
// TODO: create PropertyValues for all the attributes which were not present, because they were implied
@@ -185,6 +187,7 @@ namespace xmloff
//---------------------------------------------------------------------
sal_Bool OPropertyImport::encounteredAttribute(const ::rtl::OUString& _rAttributeName) const
{
+ OSL_ENSURE(m_bTrackAttributes, "OPropertyImport::encounteredAttribute: attribute tracking not enabled!");
return m_aEncounteredAttributes.end() != m_aEncounteredAttributes.find(_rAttributeName);
}
@@ -555,6 +558,9 @@ namespace xmloff
/*************************************************************************
* history:
* $Log: not supported by cvs2svn $
+ * Revision 1.11 2001/03/28 13:59:54 fs
+ * #85371# +simulateDefaultedAttribute / +encounteredAttribute
+ *
* Revision 1.10 2001/03/28 09:59:38 fs
* #85097# correctly import boolean properties with inverse semantics
*
diff --git a/xmloff/source/forms/propertyimport.hxx b/xmloff/source/forms/propertyimport.hxx
index 71ffa54d5f52..93d7830a3647 100644
--- a/xmloff/source/forms/propertyimport.hxx
+++ b/xmloff/source/forms/propertyimport.hxx
@@ -2,9 +2,9 @@
*
* $RCSfile: propertyimport.hxx,v $
*
- * $Revision: 1.7 $
+ * $Revision: 1.8 $
*
- * last change: $Author: fs $ $Date: 2001-03-28 13:59:54 $
+ * last change: $Author: fs $ $Date: 2001-03-29 09:44:19 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -111,7 +111,9 @@ namespace xmloff
DECLARE_STL_STDKEY_SET( ::rtl::OUString, StringSet );
StringSet m_aEncounteredAttributes;
- IFormsImportContext& m_rContext;
+ IFormsImportContext& m_rContext;
+
+ sal_Bool m_bTrackAttributes;
// TODO: think about the restriction that the class does not know anything about the object it is importing.
// Perhaps this object should be known to the class, so setting the properties ('normal' ones as well as
@@ -168,6 +170,12 @@ namespace xmloff
*/
void simluateDefaultedAttribute(const sal_Char* _pAttributeName, const ::rtl::OUString& _rPropertyName, const sal_Char* _pAttributeDefault);
+ /** enables the tracking of the encountered attributes
+ <p>The tracking will raise the import, but allow derived classes' instances to use
+ <method>simluateDefaultedAttribute</method>.</p>
+ */
+ void enableTrackAttributes() { m_bTrackAttributes = sal_True; }
+
void implPushBackPropertyValue(const ::com::sun::star::beans::PropertyValue& _rProp)
{ m_aValues.push_back(_rProp); }
@@ -268,6 +276,9 @@ namespace xmloff
/*************************************************************************
* history:
* $Log: not supported by cvs2svn $
+ * Revision 1.7 2001/03/28 13:59:54 fs
+ * #85371# +simulateDefaultedAttribute / +encounteredAttribute
+ *
* Revision 1.6 2001/03/28 09:59:38 fs
* #85097# correctly import boolean properties with inverse semantics
*