summaryrefslogtreecommitdiff
path: root/sc/source/filter/xml
diff options
context:
space:
mode:
authorSascha Ballach <sab@openoffice.org>2001-04-20 07:12:17 +0000
committerSascha Ballach <sab@openoffice.org>2001-04-20 07:12:17 +0000
commit25925058d6ee5ef54465c00ea07857675fe689ec (patch)
treeba70d931ba0497eee006ff09c812639f008ab0fe /sc/source/filter/xml
parent3e50d13f150bee74d51053a357de03fc74940f45 (diff)
export and import the refresh delay attribute of table source element
Diffstat (limited to 'sc/source/filter/xml')
-rw-r--r--sc/source/filter/xml/XMLTableSourceContext.cxx23
-rw-r--r--sc/source/filter/xml/XMLTableSourceContext.hxx5
-rw-r--r--sc/source/filter/xml/xmlexprt.cxx13
3 files changed, 29 insertions, 12 deletions
diff --git a/sc/source/filter/xml/XMLTableSourceContext.cxx b/sc/source/filter/xml/XMLTableSourceContext.cxx
index ce76a4237623..769e90b2613a 100644
--- a/sc/source/filter/xml/XMLTableSourceContext.cxx
+++ b/sc/source/filter/xml/XMLTableSourceContext.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: XMLTableSourceContext.cxx,v $
*
- * $Revision: 1.4 $
+ * $Revision: 1.5 $
*
- * last change: $Author: er $ $Date: 2001-04-18 12:31:39 $
+ * last change: $Author: sab $ $Date: 2001-04-20 08:12:17 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -92,6 +92,9 @@
#ifndef _XMLOFF_NMSPMAP_HXX
#include <xmloff/nmspmap.hxx>
#endif
+#ifndef _XMLOFF_XMLUCONV_HXX
+#include <xmloff/xmluconv.hxx>
+#endif
#ifndef _COM_SUN_STAR_SHEET_XSHEETLINKABLE_HPP_
#include <com/sun/star/sheet/XSheetLinkable.hpp>
@@ -111,6 +114,7 @@ ScXMLTableSourceContext::ScXMLTableSourceContext( ScXMLImport& rImport,
sTableName(),
sFilterName(),
sFilterOptions(),
+ nRefresh(0),
nMode(sheet::SheetLinkMode_NORMAL)
{
sal_Int16 nAttrCount = xAttrList.is() ? xAttrList->getLength() : 0;
@@ -135,8 +139,16 @@ ScXMLTableSourceContext::ScXMLTableSourceContext( ScXMLImport& rImport,
else if (aLocalName.compareToAscii(sXML_filter_options) == 0)
sFilterOptions = sValue;
else if (aLocalName.compareToAscii(sXML_mode) == 0)
+ {
if (sValue.compareToAscii(sXML_copy_results_only) == 0)
nMode = sheet::SheetLinkMode_VALUE;
+ }
+ else if (aLocalName.compareToAscii(sXML_refresh_delay) == 0)
+ {
+ double fTime;
+ if( SvXMLUnitConverter::convertTime( fTime, sValue ) )
+ nRefresh = Max( (sal_Int32)(fTime * 86400.0), (sal_Int32)0 );
+ }
}
}
}
@@ -180,14 +192,9 @@ void ScXMLTableSourceContext::EndElement()
else if ( nMode == sheet::SheetLinkMode_VALUE )
nLinkMode = SC_LINK_VALUE;
-//!!!!!!!
-//! TODO: (erAck 17.04.01) store and load refresh delay
-//!!!!!!!
- ULONG nLinkRefreshDelay = 0;
-
pDoc->SetLink( GetScImport().GetTables().GetCurrentSheet(),
nLinkMode, aFileString, aFilterString, aOptString,
- aSheetString, nLinkRefreshDelay );
+ aSheetString, nRefresh );
}
}
}
diff --git a/sc/source/filter/xml/XMLTableSourceContext.hxx b/sc/source/filter/xml/XMLTableSourceContext.hxx
index 6b356f3034a6..e4858f741af9 100644
--- a/sc/source/filter/xml/XMLTableSourceContext.hxx
+++ b/sc/source/filter/xml/XMLTableSourceContext.hxx
@@ -2,9 +2,9 @@
*
* $RCSfile: XMLTableSourceContext.hxx,v $
*
- * $Revision: 1.2 $
+ * $Revision: 1.3 $
*
- * last change: $Author: nn $ $Date: 2001-03-16 14:16:30 $
+ * last change: $Author: sab $ $Date: 2001-04-20 08:12:17 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -78,6 +78,7 @@ class ScXMLTableSourceContext : public SvXMLImportContext
rtl::OUString sTableName;
rtl::OUString sFilterName;
rtl::OUString sFilterOptions;
+ sal_Int32 nRefresh;
com::sun::star::sheet::SheetLinkMode nMode;
const ScXMLImport& GetScImport() const { return (const ScXMLImport&)GetImport(); }
diff --git a/sc/source/filter/xml/xmlexprt.cxx b/sc/source/filter/xml/xmlexprt.cxx
index 575b16cb4833..a35e3cbcefa4 100644
--- a/sc/source/filter/xml/xmlexprt.cxx
+++ b/sc/source/filter/xml/xmlexprt.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: xmlexprt.cxx,v $
*
- * $Revision: 1.96 $
+ * $Revision: 1.97 $
*
- * last change: $Author: sab $ $Date: 2001-04-18 13:59:30 $
+ * last change: $Author: sab $ $Date: 2001-04-20 08:12:17 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -2688,10 +2688,13 @@ void ScXMLExport::WriteTableSource()
rtl::OUString sFilter;
rtl::OUString sFilterOptions;
rtl::OUString sTableName (xLinkable->getLinkSheetName());
+ sal_Int32 nRefresh(0);
aAny = xLinkProps->getPropertyValue(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(SC_UNONAME_FILTER)));
aAny >>= sFilter;
aAny = xLinkProps->getPropertyValue(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(SC_UNONAME_FILTOPT)));
aAny >>= sFilterOptions;
+ aAny = xLinkProps->getPropertyValue(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(SC_UNONAME_REFDELAY)));
+ aAny >>= nRefresh;
if (sLink.getLength())
{
AddAttribute(XML_NAMESPACE_XLINK, sXML_href, sLink);
@@ -2703,6 +2706,12 @@ void ScXMLExport::WriteTableSource()
AddAttribute(XML_NAMESPACE_TABLE, sXML_filter_options, sFilterOptions);
if (nMode != sheet::SheetLinkMode_NORMAL)
AddAttributeASCII(XML_NAMESPACE_TABLE, sXML_mode, sXML_copy_results_only);
+ if( nRefresh )
+ {
+ rtl::OUStringBuffer sBuffer;
+ SvXMLUnitConverter::convertTime( sBuffer, (double)nRefresh / 86400 );
+ AddAttribute( XML_NAMESPACE_TABLE, sXML_refresh_delay, sBuffer.makeStringAndClear() );
+ }
SvXMLElementExport aSourceElem(*this, XML_NAMESPACE_TABLE, sXML_table_source, sal_True, sal_True);
}
}