summaryrefslogtreecommitdiff
path: root/xmloff
diff options
context:
space:
mode:
authorFrank Schönheit <fs@openoffice.org>2001-03-29 08:45:16 +0000
committerFrank Schönheit <fs@openoffice.org>2001-03-29 08:45:16 +0000
commitd4672dba9731ac0d926417bc2dac8c77bfdf9a68 (patch)
tree5bc58f3df03b5d643f3704d5acc7a654e5b7a76b /xmloff
parent0bde99fb309fab2640491178f50d56728b2fa0a4 (diff)
#85386# +OTextLikeImport / handle attributes which's defaults differ from the property defaults
Diffstat (limited to 'xmloff')
-rw-r--r--xmloff/source/forms/elementimport.cxx54
-rw-r--r--xmloff/source/forms/elementimport.hxx29
2 files changed, 79 insertions, 4 deletions
diff --git a/xmloff/source/forms/elementimport.cxx b/xmloff/source/forms/elementimport.cxx
index 9e310e6700ed..c4d0ef54d6e2 100644
--- a/xmloff/source/forms/elementimport.cxx
+++ b/xmloff/source/forms/elementimport.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: elementimport.cxx,v $
*
- * $Revision: 1.17 $
+ * $Revision: 1.18 $
*
- * last change: $Author: fs $ $Date: 2001-03-28 14:00:56 $
+ * last change: $Author: fs $ $Date: 2001-03-29 09:45:16 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -686,6 +686,7 @@ namespace xmloff
OControlElement::ElementType _eType)
:OControlImport(_rImport, _rEventManager, _nPrefix, _rName, _rxParentContainer, _eType)
{
+ enableTrackAttributes();
}
//---------------------------------------------------------------------
@@ -698,6 +699,27 @@ namespace xmloff
}
//=====================================================================
+ //= OTextLikeImport
+ //=====================================================================
+ //---------------------------------------------------------------------
+ OTextLikeImport::OTextLikeImport(IFormsImportContext& _rImport, IEventAttacherManager& _rEventManager, sal_uInt16 _nPrefix, const ::rtl::OUString& _rName,
+ const Reference< XNameContainer >& _rxParentContainer,
+ OControlElement::ElementType _eType)
+ :OControlImport(_rImport, _rEventManager, _nPrefix, _rName, _rxParentContainer, _eType)
+ {
+ enableTrackAttributes();
+ }
+
+ //---------------------------------------------------------------------
+ void OTextLikeImport::StartElement(const Reference< sax::XAttributeList >& _rxAttrList)
+ {
+ OControlImport::StartElement(_rxAttrList);
+
+ // handle the convert-empty-to-null attribute, which's default is different from the property default
+ simluateDefaultedAttribute(getDatabaseAttributeName(DA_CONVERT_EMPTY), PROPERTY_EMPTY_IS_NULL, "false");
+ }
+
+ //=====================================================================
//= OListAndComboImport
//=====================================================================
//---------------------------------------------------------------------
@@ -706,6 +728,8 @@ namespace xmloff
OControlElement::ElementType _eType)
:OControlImport(_rImport, _rEventManager, _nPrefix, _rName, _rxParentContainer, _eType)
{
+ if (OControlElement::COMBOBOX == m_eElementType)
+ enableTrackAttributes();
}
//---------------------------------------------------------------------
@@ -727,6 +751,23 @@ namespace xmloff
}
//---------------------------------------------------------------------
+ void OListAndComboImport::StartElement(const Reference< sax::XAttributeList >& _rxAttrList)
+ {
+ OControlImport::StartElement(_rxAttrList);
+
+ if (OControlElement::COMBOBOX == m_eElementType)
+ {
+ // for the auto-completion
+ // the attribute default does not equal the property default, so in case we did not read this attribute,
+ // we have to simulate it
+ simluateDefaultedAttribute(getSpecialAttributeName(SCA_AUTOMATIC_COMPLETION), PROPERTY_AUTOCOMPLETE, "false");
+
+ // same for the convert-empty-to-null attribute, which's default is different from the property default
+ simluateDefaultedAttribute(getDatabaseAttributeName(DA_CONVERT_EMPTY), PROPERTY_EMPTY_IS_NULL, "false");
+ }
+ }
+
+ //---------------------------------------------------------------------
void OListAndComboImport::EndElement()
{
// append the list source property the the properties sequence of our importer
@@ -921,6 +962,11 @@ namespace xmloff
{
switch (_eType)
{
+ case OControlElement::TEXT:
+ case OControlElement::TEXT_AREA:
+ case OControlElement::FORMATTED_TEXT:
+ return new OTextLikeImport(m_rFormImport, m_rEventManager, _nPrefix, _rLocalName, m_xParentContainer, _eType);
+
case OControlElement::BUTTON:
case OControlElement::IMAGE:
return new OButtonImport(m_rFormImport, m_rEventManager, _nPrefix, _rLocalName, m_xParentContainer, _eType);
@@ -1010,6 +1056,7 @@ namespace xmloff
const Reference< XNameContainer >& _rxParentContainer)
:OFormImport_Base(_rImport, _rEventManager, _nPrefix, _rName, _rxParentContainer, "control")
{
+ enableTrackAttributes();
}
//---------------------------------------------------------------------
@@ -1137,6 +1184,9 @@ namespace xmloff
/*************************************************************************
* history:
* $Log: not supported by cvs2svn $
+ * Revision 1.17 2001/03/28 14:00:56 fs
+ * #85371# +OButtonImport / for buttons and forms, correctly handle the target frame attribute
+ *
* Revision 1.16 2001/03/28 12:27:19 fs
* #85391# correctly read the list source / list items of combo boxes
*
diff --git a/xmloff/source/forms/elementimport.hxx b/xmloff/source/forms/elementimport.hxx
index fdf0f3af2cf4..2560976d290f 100644
--- a/xmloff/source/forms/elementimport.hxx
+++ b/xmloff/source/forms/elementimport.hxx
@@ -2,9 +2,9 @@
*
* $RCSfile: elementimport.hxx,v $
*
- * $Revision: 1.10 $
+ * $Revision: 1.11 $
*
- * last change: $Author: fs $ $Date: 2001-03-28 14:00:56 $
+ * last change: $Author: fs $ $Date: 2001-03-29 09:45:16 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -366,6 +366,26 @@ namespace xmloff
};
//=====================================================================
+ //= OTextLikeImport
+ //=====================================================================
+ /** A specialized version of the <type>OControlImport</type> class, which handles
+ text like controls which have the convert-empty-to-null attribute</p>
+ */
+ class OTextLikeImport : public OControlImport
+ {
+ public:
+ OTextLikeImport(
+ IFormsImportContext& _rImport, IEventAttacherManager& _rEventManager, sal_uInt16 _nPrefix, const ::rtl::OUString& _rName,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameContainer >& _rxParentContainer,
+ OControlElement::ElementType _eType
+ );
+
+ // SvXMLImportContext overridables
+ virtual void StartElement(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList >& _rxAttrList);
+ };
+
+ //=====================================================================
//= OListAndComboImport
//=====================================================================
/** A specialized version of the <type>OControlImport</type> class, which handles
@@ -395,6 +415,8 @@ namespace xmloff
);
// SvXMLImportContext overridables
+ virtual void StartElement(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList >& _rxAttrList);
virtual SvXMLImportContext* CreateChildContext(
sal_uInt16 _nPrefix, const ::rtl::OUString& _rLocalName,
const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList >& _rxAttrList);
@@ -603,6 +625,9 @@ namespace xmloff
/*************************************************************************
* history:
* $Log: not supported by cvs2svn $
+ * Revision 1.10 2001/03/28 14:00:56 fs
+ * #85371# +OButtonImport / for buttons and forms, correctly handle the target frame attribute
+ *
* Revision 1.9 2001/03/28 12:26:53 fs
* #85391# corrected OComboItemImport
*