diff options
Diffstat (limited to 'xmlscript/source/xmldlg_imexp/xmldlg_import.cxx')
-rw-r--r-- | xmlscript/source/xmldlg_imexp/xmldlg_import.cxx | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/xmlscript/source/xmldlg_imexp/xmldlg_import.cxx b/xmlscript/source/xmldlg_imexp/xmldlg_import.cxx index 754efaf4e017..820dd9bf83d4 100644 --- a/xmlscript/source/xmldlg_imexp/xmldlg_import.cxx +++ b/xmlscript/source/xmldlg_imexp/xmldlg_import.cxx @@ -34,6 +34,10 @@ #include <com/sun/star/awt/PushButtonType.hpp> #include <com/sun/star/awt/VisualEffect.hpp> #include <com/sun/star/style/VerticalAlignment.hpp> +#include <com/sun/star/util/Date.hpp> +#include <com/sun/star/util/Time.hpp> +#include <tools/date.hxx> +#include <tools/time.hxx> #include <com/sun/star/script/XScriptEventsSupplier.hpp> #include <com/sun/star/script/ScriptEventDescriptor.hpp> @@ -1195,6 +1199,40 @@ bool ImportContext::importDateFormatProperty( return false; } //__________________________________________________________________________________________________ +bool ImportContext::importTimeProperty( + OUString const & rPropName, OUString const & rAttrName, + Reference< xml::input::XAttributes > const & xAttributes ) +{ + OUString aValue( + xAttributes->getValueByUidName( + _pImport->XMLNS_DIALOGS_UID, rAttrName ) ); + if (!aValue.isEmpty()) + { + ::Time aTTime(toInt32( aValue ) * ::Time::nanoPerCenti); + util::Time aUTime(aTTime.GetUNOTime()); + _xControlModel->setPropertyValue( rPropName, makeAny( aUTime ) ); + return true; + } + return false; +} +//__________________________________________________________________________________________________ +bool ImportContext::importDateProperty( + OUString const & rPropName, OUString const & rAttrName, + Reference< xml::input::XAttributes > const & xAttributes ) +{ + OUString aValue( + xAttributes->getValueByUidName( + _pImport->XMLNS_DIALOGS_UID, rAttrName ) ); + if (!aValue.isEmpty()) + { + ::Date aTDate(toInt32( aValue )); + util::Date aUDate(aTDate.GetUNODate()); + _xControlModel->setPropertyValue( rPropName, makeAny( aUDate ) ); + return true; + } + return false; +} +//__________________________________________________________________________________________________ bool ImportContext::importTimeFormatProperty( OUString const & rPropName, OUString const & rAttrName, Reference< xml::input::XAttributes > const & xAttributes ) |