diff options
author | Kohei Yoshida <kohei.yoshida@gmail.com> | 2012-05-01 11:28:31 -0400 |
---|---|---|
committer | Kohei Yoshida <kohei.yoshida@gmail.com> | 2012-05-03 20:28:15 -0400 |
commit | a5c8e9a8cec4202ddc7bac60dd38c5782fa3b2cc (patch) | |
tree | 7b7f5393100a4afb3a421a1e5bd72cbcd342097a | |
parent | 4aeb8aff9e418aef1fde4b2b60333216cc527f13 (diff) |
Properly import DateTimeField.
Change-Id: Ib56655b3306f9be035e1f59d233e0a118f247e37
-rw-r--r-- | sc/inc/fielduno.hxx | 4 | ||||
-rw-r--r-- | sc/inc/servuno.hxx | 4 | ||||
-rw-r--r-- | sc/source/ui/unoobj/fielduno.cxx | 18 | ||||
-rw-r--r-- | sc/source/ui/unoobj/servuno.cxx | 6 |
4 files changed, 29 insertions, 3 deletions
diff --git a/sc/inc/fielduno.hxx b/sc/inc/fielduno.hxx index 4f3d29b718d9..8f83eebd480f 100644 --- a/sc/inc/fielduno.hxx +++ b/sc/inc/fielduno.hxx @@ -214,7 +214,7 @@ class ScEditFieldObj : public cppu::WeakImplHelper4< private boost::noncopyable { public: - enum FieldType { URL = 0, Page, Pages, Date, Time, Title, File, Sheet }; + enum FieldType { URL = 0, Page, Pages, Date, Time, ExtTime, Title, File, Sheet }; private: const SfxItemPropertySet* pPropSet; @@ -236,6 +236,8 @@ private: void setPropertyValueFile(const rtl::OUString& rName, const com::sun::star::uno::Any& rVal); com::sun::star::uno::Any getPropertyValueFile(const rtl::OUString& rName); + void setPropertyValueExtTime(const rtl::OUString& rName, const com::sun::star::uno::Any& rVal); + public: static const com::sun::star::uno::Sequence<sal_Int8>& getUnoTunnelId(); static ScEditFieldObj* getImplementation(const com::sun::star::uno::Reference<com::sun::star::text::XTextContent>& xObj); diff --git a/sc/inc/servuno.hxx b/sc/inc/servuno.hxx index 9adca2a1dc93..04abac7c2f15 100644 --- a/sc/inc/servuno.hxx +++ b/sc/inc/servuno.hxx @@ -98,9 +98,11 @@ class ScDocShell; #define SC_SERVICE_VBACODENAMEPROVIDER 41 #define SC_SERVICE_VBAGLOBALS 42 -#define SC_SERVICE_COUNT 43 + +#define SC_SERVICE_COUNT 44 #define SC_SERVICE_INVALID USHRT_MAX +#define SC_SERVICE_EXT_TIMEFIELD 43 class ScServiceProvider { diff --git a/sc/source/ui/unoobj/fielduno.cxx b/sc/source/ui/unoobj/fielduno.cxx index 6bef71a3092c..9a047665c8bc 100644 --- a/sc/source/ui/unoobj/fielduno.cxx +++ b/sc/source/ui/unoobj/fielduno.cxx @@ -140,13 +140,14 @@ ScEditFieldObj::FieldType getFieldType(sal_uInt16 nSvxType) return ScEditFieldObj::Pages; case SVX_TIMEFIELD: return ScEditFieldObj::Time; + case SVX_EXT_TIMEFIELD: + return ScEditFieldObj::ExtTime; case SVX_FILEFIELD: return ScEditFieldObj::Title; case SVX_TABLEFIELD: return ScEditFieldObj::Sheet; case SVX_EXT_FILEFIELD: return ScEditFieldObj::File; - case SVX_EXT_TIMEFIELD: case SVX_AUTHORFIELD: case SVX_HEADERFIELD: case SVX_FOOTERFIELD: @@ -689,6 +690,9 @@ SvxFieldData* ScEditFieldObj::getData() case Time: mpData.reset(new SvxTimeField); break; + case ExtTime: + mpData.reset(new SvxExtTimeField); + break; case Title: mpData.reset(new SvxFileField); break; @@ -890,6 +894,15 @@ uno::Any ScEditFieldObj::getPropertyValueFile(const rtl::OUString& rName) return aRet; } +void ScEditFieldObj::setPropertyValueExtTime(const rtl::OUString& rName, const uno::Any& rVal) +{ + if (rName == "IsDate") + { + // TODO: Find out what to do with this. + sal_Bool b = rVal.get<sal_Bool>(); + } +} + ScEditFieldObj::ScEditFieldObj( const uno::Reference<text::XTextRange>& rContent, ScEditSource* pEditSrc, FieldType eType, const ESelection& rSel) : @@ -1063,6 +1076,9 @@ void SAL_CALL ScEditFieldObj::setPropertyValue( case File: setPropertyValueFile(aPropertyName, aValue); break; + case ExtTime: + setPropertyValueExtTime(aPropertyName, aValue); + break; default: throw beans::UnknownPropertyException(); } diff --git a/sc/source/ui/unoobj/servuno.cxx b/sc/source/ui/unoobj/servuno.cxx index 23047b3b4bb6..50d3362cc782 100644 --- a/sc/source/ui/unoobj/servuno.cxx +++ b/sc/source/ui/unoobj/servuno.cxx @@ -272,6 +272,7 @@ static const ProvNamesId_Type aProvNamesId[] = { "com.sun.star.text.TextField.PageCount", SC_SERVICE_PAGESFIELD }, { "com.sun.star.text.TextField.Date", SC_SERVICE_DATEFIELD }, { "com.sun.star.text.TextField.Time", SC_SERVICE_TIMEFIELD }, + { "com.sun.star.text.TextField.DateTime", SC_SERVICE_EXT_TIMEFIELD }, { "com.sun.star.text.TextField.DocumentTitle", SC_SERVICE_TITLEFIELD }, { "com.sun.star.text.TextField.FileName", SC_SERVICE_FILEFIELD }, { "com.sun.star.text.TextField.SheetName", SC_SERVICE_SHEETFIELD }, @@ -321,6 +322,7 @@ static const ProvNamesId_Type aProvNamesId[] = { "com.sun.star.text.textfield.PageCount", SC_SERVICE_PAGESFIELD }, { "com.sun.star.text.textfield.Date", SC_SERVICE_DATEFIELD }, { "com.sun.star.text.textfield.Time", SC_SERVICE_TIMEFIELD }, + { "com.sun.star.text.textfield.DateTime", SC_SERVICE_EXT_TIMEFIELD }, { "com.sun.star.text.textfield.DocumentTitle", SC_SERVICE_TITLEFIELD }, { "com.sun.star.text.textfield.FileName", SC_SERVICE_FILEFIELD }, { "com.sun.star.text.textfield.SheetName", SC_SERVICE_SHEETFIELD }, @@ -380,6 +382,7 @@ static const sal_Char* aOldNames[SC_SERVICE_COUNT] = "", // SC_SERVICE_VBAOBJECTPROVIDER "", // SC_SERVICE_VBACODENAMEPROVIDER "", // SC_SERVICE_VBAGLOBALS + "", // SC_SERVICE_EXT_TIMEFIELD }; @@ -434,6 +437,8 @@ ScEditFieldObj::FieldType getFieldType(sal_uInt16 nOldType) return ScEditFieldObj::Date; case SC_SERVICE_TIMEFIELD: return ScEditFieldObj::Time; + case SC_SERVICE_EXT_TIMEFIELD: + return ScEditFieldObj::ExtTime; case SC_SERVICE_TITLEFIELD: return ScEditFieldObj::Title; case SC_SERVICE_FILEFIELD: @@ -464,6 +469,7 @@ uno::Reference<uno::XInterface> ScServiceProvider::MakeInstance( case SC_SERVICE_PAGESFIELD: case SC_SERVICE_DATEFIELD: case SC_SERVICE_TIMEFIELD: + case SC_SERVICE_EXT_TIMEFIELD: case SC_SERVICE_TITLEFIELD: case SC_SERVICE_FILEFIELD: case SC_SERVICE_SHEETFIELD: |