summaryrefslogtreecommitdiff
path: root/xmloff
diff options
context:
space:
mode:
authorMartin Gallwey <mtg@openoffice.org>2001-07-27 08:54:08 +0000
committerMartin Gallwey <mtg@openoffice.org>2001-07-27 08:54:08 +0000
commit9bc037ab7c26ebd2ec1b61f477932204268da49f (patch)
tree0a61949abe769b7c9691e0a6fc07d1094a82dc8d /xmloff
parentc7ef3d16f4390657d8dc10b8597619c52ec8a21a (diff)
#89906# need to be able to export single bytes and PropertyAttribute::MAYBEVOID values
Diffstat (limited to 'xmloff')
-rw-r--r--xmloff/source/core/SettingsExportHelper.cxx28
1 files changed, 25 insertions, 3 deletions
diff --git a/xmloff/source/core/SettingsExportHelper.cxx b/xmloff/source/core/SettingsExportHelper.cxx
index 8dd0753964da..089b70ebb2c0 100644
--- a/xmloff/source/core/SettingsExportHelper.cxx
+++ b/xmloff/source/core/SettingsExportHelper.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: SettingsExportHelper.cxx,v $
*
- * $Revision: 1.15 $
+ * $Revision: 1.16 $
*
- * last change: $Author: dvo $ $Date: 2001-06-29 21:07:12 $
+ * last change: $Author: mtg $ $Date: 2001-07-27 09:54:08 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -133,7 +133,12 @@ void XMLSettingsExportHelper::CallTypeFunction(const uno::Any& rAny,
{
case uno::TypeClass_VOID:
{
- DBG_ERROR("no type");
+ /*
+ * This assertion pops up when exporting values which are set to:
+ * PropertyAttribute::MAYBEVOID, and thus are _supposed_ to have
+ * a VOID value...so I'm removing it ...mtg
+ * DBG_ERROR("no type");
+ */
}
break;
case uno::TypeClass_BOOLEAN:
@@ -141,6 +146,13 @@ void XMLSettingsExportHelper::CallTypeFunction(const uno::Any& rAny,
exportBool(::cppu::any2bool(rAny), rName);
}
break;
+ case uno::TypeClass_BYTE:
+ {
+ sal_Int8 nInt8;
+ rAny >>= nInt8;
+ exportByte(nInt8, rName);
+ }
+ break;
case uno::TypeClass_SHORT:
{
sal_Int16 nInt16;
@@ -242,6 +254,16 @@ void XMLSettingsExportHelper::exportBool(const sal_Bool bValue, const rtl::OUStr
rExport.GetDocHandler()->characters(sValue);
}
+void XMLSettingsExportHelper::exportByte(const sal_Int8 nValue, const rtl::OUString& rName) const
+{
+ DBG_ASSERT(rName.getLength(), "no name");
+ rExport.AddAttribute(XML_NAMESPACE_CONFIG, XML_NAME, rName);
+ rExport.AddAttribute(XML_NAMESPACE_CONFIG, XML_TYPE, XML_BYTE);
+ SvXMLElementExport aShortElem(rExport, XML_NAMESPACE_CONFIG, XML_CONFIG_ITEM, sal_True, sal_False);
+ rtl::OUStringBuffer sBuffer;
+ SvXMLUnitConverter::convertNumber(sBuffer, sal_Int32(nValue));
+ rExport.GetDocHandler()->characters(sBuffer.makeStringAndClear());
+}
void XMLSettingsExportHelper::exportShort(const sal_Int16 nValue, const rtl::OUString& rName) const
{
DBG_ASSERT(rName.getLength(), "no name");