summaryrefslogtreecommitdiff
path: root/sc/source/ui/unoobj
diff options
context:
space:
mode:
authorKohei Yoshida <kohei.yoshida@gmail.com>2012-05-01 14:27:21 -0400
committerKohei Yoshida <kohei.yoshida@gmail.com>2012-05-03 20:28:16 -0400
commitd6d4d00114e267142145f0d6bb80a66dd4bca990 (patch)
tree17d4983876985388bc6bd5d614aa420a2fbb3cbd /sc/source/ui/unoobj
parent9af4b611190c14b04460e2554735725b4231b685 (diff)
Support date field in cells.
Change-Id: Iff20eb16bb4a7f700b0a533bc745b92fdce8ac0f
Diffstat (limited to 'sc/source/ui/unoobj')
-rw-r--r--sc/source/ui/unoobj/fielduno.cxx29
1 files changed, 25 insertions, 4 deletions
diff --git a/sc/source/ui/unoobj/fielduno.cxx b/sc/source/ui/unoobj/fielduno.cxx
index 9a047665c8bc..693c2c457bde 100644
--- a/sc/source/ui/unoobj/fielduno.cxx
+++ b/sc/source/ui/unoobj/fielduno.cxx
@@ -59,6 +59,20 @@ namespace {
// alles ohne Which-ID, Map nur fuer PropertySetInfo
+const SfxItemPropertySet* getExtTimePropertySet()
+{
+ static SfxItemPropertyMapEntry aMapContent[] =
+ {
+ { MAP_CHAR_LEN(SC_UNONAME_DATETIME), 0, &getCppuType((const util::DateTime*)0), 0, 0 },
+ { MAP_CHAR_LEN(SC_UNONAME_ISFIXED), 0, &getBooleanCppuType(), 0, 0 },
+ { MAP_CHAR_LEN(SC_UNONAME_ISDATE), 0, &getBooleanCppuType(), 0, 0 },
+ { MAP_CHAR_LEN(SC_UNONAME_NUMFMT), 0, &getCppuType((const sal_Int32*)0), 0, 0 },
+ {0,0,0,0,0,0}
+ };
+ static SfxItemPropertySet aMap(aMapContent);
+ return &aMap;
+}
+
const SfxItemPropertySet* lcl_GetURLPropertySet()
{
static SfxItemPropertyMapEntry aURLPropertyMap_Impl[] =
@@ -691,7 +705,12 @@ SvxFieldData* ScEditFieldObj::getData()
mpData.reset(new SvxTimeField);
break;
case ExtTime:
- mpData.reset(new SvxExtTimeField);
+ {
+ if (mbIsDate)
+ mpData.reset(new SvxDateField);
+ else
+ mpData.reset(new SvxExtTimeField);
+ }
break;
case Title:
mpData.reset(new SvxFileField);
@@ -898,8 +917,7 @@ void ScEditFieldObj::setPropertyValueExtTime(const rtl::OUString& rName, const u
{
if (rName == "IsDate")
{
- // TODO: Find out what to do with this.
- sal_Bool b = rVal.get<sal_Bool>();
+ mbIsDate = rVal.get<sal_Bool>();
}
}
@@ -910,7 +928,7 @@ ScEditFieldObj::ScEditFieldObj(
pPropSet(NULL),
mpEditSource(pEditSrc),
aSelection(rSel),
- meType(eType), mpData(NULL), mpContent(rContent)
+ meType(eType), mpData(NULL), mpContent(rContent), mbIsDate(false)
{
switch (meType)
{
@@ -920,6 +938,9 @@ ScEditFieldObj::ScEditFieldObj(
case URL:
pPropSet = lcl_GetURLPropertySet();
break;
+ case ExtTime:
+ pPropSet = getExtTimePropertySet();
+ break;
default:
pPropSet = lcl_GetHeaderFieldPropertySet();
}