Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
C
core
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
LibreOffice
core
Commits
6e6f822e
Kaydet (Commit)
6e6f822e
authored
Mar 30, 2015
tarafından
Markus Mohrhard
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
finally implement and define also date formatting
Change-Id: I261e6d3199573fc2e37d940e4249a1fce105e6eb
üst
f5c178f7
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
347 additions
and
0 deletions
+347
-0
UnoApi_offapi.mk
offapi/UnoApi_offapi.mk
+2
-0
DateCondition.idl
offapi/com/sun/star/sheet/DateCondition.idl
+34
-0
DateType.idl
offapi/com/sun/star/sheet/DateType.idl
+49
-0
condformatuno.hxx
sc/source/ui/inc/condformatuno.hxx
+64
-0
condformatuno.cxx
sc/source/ui/unoobj/condformatuno.cxx
+198
-0
No files found.
offapi/UnoApi_offapi.mk
Dosyayı görüntüle @
6e6f822e
...
@@ -1206,6 +1206,7 @@ $(eval $(call gb_UnoApi_add_idlfiles_noheader,offapi,com/sun/star/sheet,\
...
@@ -1206,6 +1206,7 @@ $(eval $(call gb_UnoApi_add_idlfiles_noheader,offapi,com/sun/star/sheet,\
DatabaseRange \
DatabaseRange \
DatabaseRanges \
DatabaseRanges \
DatabaseRangesEnumeration \
DatabaseRangesEnumeration \
DateCondition \
DocumentSettings \
DocumentSettings \
FormulaParser \
FormulaParser \
FunctionAccess \
FunctionAccess \
...
@@ -3369,6 +3370,7 @@ $(eval $(call gb_UnoApi_add_idlfiles,offapi,com/sun/star/sheet,\
...
@@ -3369,6 +3370,7 @@ $(eval $(call gb_UnoApi_add_idlfiles,offapi,com/sun/star/sheet,\
ConditionOperator2 \
ConditionOperator2 \
DataBarAxis \
DataBarAxis \
DataBarEntryType \
DataBarEntryType \
DateType \
DDEItemInfo \
DDEItemInfo \
DDELinkInfo \
DDELinkInfo \
DDELinkMode \
DDELinkMode \
...
...
offapi/com/sun/star/sheet/DateCondition.idl
0 → 100644
Dosyayı görüntüle @
6e6f822e
/*
-*-
Mode
:
C
++
; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*
*
This
file
is
part
of
the
LibreOffice
project
.
*
*
This
Source
Code
Form
is
subject
to
the
terms
of
the
Mozilla
Public
*
License
,
v
.
2.0
.
If
a
copy
of
the
MPL
was
not
distributed
with
this
*
file
,
You
can
obtain
one
at
http
:
//
mozilla
.
org/MPL/2.0/.
*/
#
ifndef
__com_sun_star_sheet_DateCondition_idl__
#
define
__com_sun_star_sheet_DateCondition_idl__
#
include
<
com
/
sun
/
star
/
sheet
/
XConditionEntry
.
idl>
module
com
{
module
sun
{
module
star
{
module
sheet
{
service
DateCondition
{
interface
XConditionEntry
;
[
property
]
string
StyleName
;
/**
*
See
com
.
sun.star.sheet.DateType
for
possible
values
*/
[
property
]
long
DateType
;
}
;
}
; }; }; };
#
endif
/*
vim
:
set
shiftwidth
=
4
softtabstop
=
4
expandtab
:
*/
offapi/com/sun/star/sheet/DateType.idl
0 → 100644
Dosyayı görüntüle @
6e6f822e
/*
-*-
Mode
:
C
++
; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*
*
This
file
is
part
of
the
LibreOffice
project
.
*
*
This
Source
Code
Form
is
subject
to
the
terms
of
the
Mozilla
Public
*
License
,
v
.
2.0
.
If
a
copy
of
the
MPL
was
not
distributed
with
this
*
file
,
You
can
obtain
one
at
http
:
//
mozilla
.
org/MPL/2.0/.
*/
#
ifndef
__com_sun_star_sheet_DateType_idl__
#
define
__com_sun_star_sheet_DateType_idl__
module
com
{
module
sun
{
module
star
{
module
sheet
{
constants
DateType
{
const
long
TODAY
=
0
;
const
long
YESTERDAY
=
1
;
const
long
TOMORROW
=
2
;
const
long
LAST7DAYS
=
3
;
const
long
THISWEEK
=
4
;
const
long
LASTWEEK
=
5
;
const
long
NEXTWEEK
=
6
;
const
long
THISMONTH
=
7
;
const
long
LASTMONTH
=
8
;
const
long
NEXTMONTH
=
9
;
const
long
THISYEAR
=
10
;
const
long
LASTYEAR
=
11
;
const
long
NEXTYEAR
=
12
;
}
;
}
; }; }; };
#
endif
/*
vim
:
set
shiftwidth
=
4
softtabstop
=
4
expandtab
:
*/
sc/source/ui/inc/condformatuno.hxx
Dosyayı görüntüle @
6e6f822e
...
@@ -35,6 +35,7 @@ class ScDataBarFormat;
...
@@ -35,6 +35,7 @@ class ScDataBarFormat;
class
ScColorScaleFormat
;
class
ScColorScaleFormat
;
class
ScCondFormatEntry
;
class
ScCondFormatEntry
;
class
ScColorScaleEntry
;
class
ScColorScaleEntry
;
class
ScCondDateFormatEntry
;
using
namespace
com
::
sun
::
star
;
using
namespace
com
::
sun
::
star
;
...
@@ -515,6 +516,69 @@ private:
...
@@ -515,6 +516,69 @@ private:
size_t
mnPos
;
size_t
mnPos
;
};
};
class
ScCondDateFormatObj
:
public
cppu
::
WeakImplHelper2
<
com
::
sun
::
star
::
beans
::
XPropertySet
,
com
::
sun
::
star
::
sheet
::
XConditionEntry
>
{
public
:
ScCondDateFormatObj
(
rtl
::
Reference
<
ScCondFormatObj
>
xParent
,
const
ScCondDateFormatEntry
*
pFormat
);
virtual
~
ScCondDateFormatObj
();
ScCondDateFormatEntry
*
getCoreObject
();
// XConditionEntry
virtual
sal_Int32
SAL_CALL
getType
()
throw
(
::
com
::
sun
::
star
::
uno
::
RuntimeException
,
std
::
exception
)
SAL_OVERRIDE
;
// XPropertySet
virtual
::
com
::
sun
::
star
::
uno
::
Reference
<
::
com
::
sun
::
star
::
beans
::
XPropertySetInfo
>
SAL_CALL
getPropertySetInfo
()
throw
(
::
com
::
sun
::
star
::
uno
::
RuntimeException
,
std
::
exception
)
SAL_OVERRIDE
;
virtual
void
SAL_CALL
setPropertyValue
(
const
OUString
&
aPropertyName
,
const
::
com
::
sun
::
star
::
uno
::
Any
&
aValue
)
throw
(
::
com
::
sun
::
star
::
beans
::
UnknownPropertyException
,
::
com
::
sun
::
star
::
beans
::
PropertyVetoException
,
::
com
::
sun
::
star
::
lang
::
IllegalArgumentException
,
::
com
::
sun
::
star
::
lang
::
WrappedTargetException
,
::
com
::
sun
::
star
::
uno
::
RuntimeException
,
std
::
exception
)
SAL_OVERRIDE
;
virtual
::
com
::
sun
::
star
::
uno
::
Any
SAL_CALL
getPropertyValue
(
const
OUString
&
PropertyName
)
throw
(
::
com
::
sun
::
star
::
beans
::
UnknownPropertyException
,
::
com
::
sun
::
star
::
lang
::
WrappedTargetException
,
::
com
::
sun
::
star
::
uno
::
RuntimeException
,
std
::
exception
)
SAL_OVERRIDE
;
virtual
void
SAL_CALL
addPropertyChangeListener
(
const
OUString
&
aPropertyName
,
const
::
com
::
sun
::
star
::
uno
::
Reference
<
::
com
::
sun
::
star
::
beans
::
XPropertyChangeListener
>&
xListener
)
throw
(
::
com
::
sun
::
star
::
beans
::
UnknownPropertyException
,
::
com
::
sun
::
star
::
lang
::
WrappedTargetException
,
::
com
::
sun
::
star
::
uno
::
RuntimeException
,
std
::
exception
)
SAL_OVERRIDE
;
virtual
void
SAL_CALL
removePropertyChangeListener
(
const
OUString
&
aPropertyName
,
const
::
com
::
sun
::
star
::
uno
::
Reference
<
::
com
::
sun
::
star
::
beans
::
XPropertyChangeListener
>&
aListener
)
throw
(
::
com
::
sun
::
star
::
beans
::
UnknownPropertyException
,
::
com
::
sun
::
star
::
lang
::
WrappedTargetException
,
::
com
::
sun
::
star
::
uno
::
RuntimeException
,
std
::
exception
)
SAL_OVERRIDE
;
virtual
void
SAL_CALL
addVetoableChangeListener
(
const
OUString
&
PropertyName
,
const
::
com
::
sun
::
star
::
uno
::
Reference
<
::
com
::
sun
::
star
::
beans
::
XVetoableChangeListener
>&
aListener
)
throw
(
::
com
::
sun
::
star
::
beans
::
UnknownPropertyException
,
::
com
::
sun
::
star
::
lang
::
WrappedTargetException
,
::
com
::
sun
::
star
::
uno
::
RuntimeException
,
std
::
exception
)
SAL_OVERRIDE
;
virtual
void
SAL_CALL
removeVetoableChangeListener
(
const
OUString
&
PropertyName
,
const
::
com
::
sun
::
star
::
uno
::
Reference
<
::
com
::
sun
::
star
::
beans
::
XVetoableChangeListener
>&
aListener
)
throw
(
::
com
::
sun
::
star
::
beans
::
UnknownPropertyException
,
::
com
::
sun
::
star
::
lang
::
WrappedTargetException
,
::
com
::
sun
::
star
::
uno
::
RuntimeException
,
std
::
exception
)
SAL_OVERRIDE
;
private
:
ScDocShell
*
mpDocShell
;
rtl
::
Reference
<
ScCondFormatObj
>
mxParent
;
SfxItemPropertySet
maPropSet
;
const
ScCondDateFormatEntry
*
mpFormat
;
};
#endif
#endif
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
sc/source/ui/unoobj/condformatuno.cxx
Dosyayı görüntüle @
6e6f822e
...
@@ -31,6 +31,7 @@
...
@@ -31,6 +31,7 @@
#include <com/sun/star/sheet/ColorScaleEntryType.hpp>
#include <com/sun/star/sheet/ColorScaleEntryType.hpp>
#include <com/sun/star/sheet/IconSetFormatEntry.hpp>
#include <com/sun/star/sheet/IconSetFormatEntry.hpp>
#include <com/sun/star/sheet/ConditionEntryType.hpp>
#include <com/sun/star/sheet/ConditionEntryType.hpp>
#include <com/sun/star/sheet/DateType.hpp>
namespace
{
namespace
{
...
@@ -263,6 +264,45 @@ IconSetEntryTypeApiMap aIconSetEntryTypeMap[] =
...
@@ -263,6 +264,45 @@ IconSetEntryTypeApiMap aIconSetEntryTypeMap[] =
{
COLORSCALE_PERCENTILE
,
sheet
::
IconSetFormatEntry
::
ICONSET_PERCENTILE
}
{
COLORSCALE_PERCENTILE
,
sheet
::
IconSetFormatEntry
::
ICONSET_PERCENTILE
}
};
};
enum
DateProperties
{
Date_StyleName
,
DateType
};
const
SfxItemPropertyMapEntry
*
getCondDatePropSet
()
{
static
const
SfxItemPropertyMapEntry
aCondDatePropertyMap_Impl
[]
=
{
{
OUString
(
"StyleName"
),
StyleName
,
cppu
::
UnoType
<
OUString
>::
get
(),
0
,
0
},
{
OUString
(),
0
,
css
::
uno
::
Type
(),
0
,
0
}
};
return
aCondDatePropertyMap_Impl
;
}
struct
DateTypeApiMap
{
condformat
::
ScCondFormatDateType
eType
;
sal_Int32
nApiType
;
};
DateTypeApiMap
aDateTypeApiMap
[]
=
{
{
condformat
::
TODAY
,
sheet
::
DateType
::
TODAY
},
{
condformat
::
YESTERDAY
,
sheet
::
DateType
::
YESTERDAY
},
{
condformat
::
TOMORROW
,
sheet
::
DateType
::
TOMORROW
},
{
condformat
::
LAST7DAYS
,
sheet
::
DateType
::
LAST7DAYS
},
{
condformat
::
THISWEEK
,
sheet
::
DateType
::
THISWEEK
},
{
condformat
::
LASTWEEK
,
sheet
::
DateType
::
LASTWEEK
},
{
condformat
::
NEXTWEEK
,
sheet
::
DateType
::
NEXTWEEK
},
{
condformat
::
THISMONTH
,
sheet
::
DateType
::
THISMONTH
},
{
condformat
::
LASTMONTH
,
sheet
::
DateType
::
LASTMONTH
},
{
condformat
::
NEXTMONTH
,
sheet
::
DateType
::
NEXTMONTH
},
{
condformat
::
THISYEAR
,
sheet
::
DateType
::
THISYEAR
},
{
condformat
::
LASTYEAR
,
sheet
::
DateType
::
LASTYEAR
},
{
condformat
::
NEXTYEAR
,
sheet
::
DateType
::
NEXTYEAR
}
};
}
}
ScCondFormatsObj
::
ScCondFormatsObj
(
ScDocShell
*
pDocShell
,
SCTAB
nTab
)
:
ScCondFormatsObj
::
ScCondFormatsObj
(
ScDocShell
*
pDocShell
,
SCTAB
nTab
)
:
...
@@ -371,6 +411,8 @@ uno::Reference<beans::XPropertySet> createConditionEntry(const ScFormatEntry* pE
...
@@ -371,6 +411,8 @@ uno::Reference<beans::XPropertySet> createConditionEntry(const ScFormatEntry* pE
static_cast
<
const
ScIconSetFormat
*>
(
pEntry
));
static_cast
<
const
ScIconSetFormat
*>
(
pEntry
));
break
;
break
;
case
condformat
:
:
DATE
:
case
condformat
:
:
DATE
:
return
new
ScCondDateFormatObj
(
xParent
,
static_cast
<
const
ScCondDateFormatEntry
*>
(
pEntry
));
break
;
break
;
default
:
default
:
break
;
break
;
...
@@ -1743,4 +1785,160 @@ void ScIconSetEntryObj::setFormula(const OUString& rFormula)
...
@@ -1743,4 +1785,160 @@ void ScIconSetEntryObj::setFormula(const OUString& rFormula)
}
}
}
}
ScCondDateFormatObj
::
ScCondDateFormatObj
(
rtl
::
Reference
<
ScCondFormatObj
>
xParent
,
const
ScCondDateFormatEntry
*
pFormat
)
:
mpDocShell
(
xParent
->
getDocShell
()),
mxParent
(
xParent
),
maPropSet
(
getCondDatePropSet
()),
mpFormat
(
pFormat
)
{
}
ScCondDateFormatObj
::~
ScCondDateFormatObj
()
{
}
ScCondDateFormatEntry
*
ScCondDateFormatObj
::
getCoreObject
()
{
ScConditionalFormat
*
pFormat
=
mxParent
->
getCoreObject
();
if
(
isObjectStillAlive
(
pFormat
,
mpFormat
))
return
const_cast
<
ScCondDateFormatEntry
*>
(
mpFormat
);
throw
lang
::
IllegalArgumentException
();
}
sal_Int32
ScCondDateFormatObj
::
getType
()
throw
(
uno
::
RuntimeException
,
std
::
exception
)
{
return
sheet
::
ConditionEntryType
::
DATE
;
}
uno
::
Reference
<
beans
::
XPropertySetInfo
>
SAL_CALL
ScCondDateFormatObj
::
getPropertySetInfo
()
throw
(
uno
::
RuntimeException
,
std
::
exception
)
{
SolarMutexGuard
aGuard
;
static
uno
::
Reference
<
beans
::
XPropertySetInfo
>
aRef
(
new
SfxItemPropertySetInfo
(
maPropSet
.
getPropertyMap
()
));
return
aRef
;
}
void
SAL_CALL
ScCondDateFormatObj
::
setPropertyValue
(
const
OUString
&
aPropertyName
,
const
uno
::
Any
&
aValue
)
throw
(
beans
::
UnknownPropertyException
,
beans
::
PropertyVetoException
,
lang
::
IllegalArgumentException
,
lang
::
WrappedTargetException
,
uno
::
RuntimeException
,
std
::
exception
)
{
SolarMutexGuard
aGuard
;
const
SfxItemPropertyMap
&
rPropertyMap
=
maPropSet
.
getPropertyMap
();
// from derived class
const
SfxItemPropertySimpleEntry
*
pEntry
=
rPropertyMap
.
getByName
(
aPropertyName
);
if
(
!
pEntry
)
throw
beans
::
UnknownPropertyException
();
switch
(
pEntry
->
nWID
)
{
case
Date_StyleName
:
{
OUString
aStyleName
;
if
(
aValue
>>=
aStyleName
)
{
getCoreObject
()
->
SetStyleName
(
aStyleName
);
}
else
throw
lang
::
IllegalArgumentException
();
}
break
;
case
DateType
:
{
sal_Int32
nApiType
=
-
1
;
if
(
!
(
aValue
>>=
nApiType
))
throw
lang
::
IllegalArgumentException
();
for
(
size_t
i
=
0
;
i
<
SAL_N_ELEMENTS
(
aDateTypeApiMap
);
++
i
)
{
if
(
aDateTypeApiMap
[
i
].
nApiType
==
nApiType
)
{
getCoreObject
()
->
SetDateType
(
aDateTypeApiMap
[
i
].
eType
);
break
;
}
}
}
break
;
default
:
break
;
}
}
uno
::
Any
SAL_CALL
ScCondDateFormatObj
::
getPropertyValue
(
const
OUString
&
aPropertyName
)
throw
(
beans
::
UnknownPropertyException
,
lang
::
WrappedTargetException
,
uno
::
RuntimeException
,
std
::
exception
)
{
SolarMutexGuard
aGuard
;
const
SfxItemPropertyMap
&
rPropertyMap
=
maPropSet
.
getPropertyMap
();
// from derived class
const
SfxItemPropertySimpleEntry
*
pEntry
=
rPropertyMap
.
getByName
(
aPropertyName
);
if
(
!
pEntry
)
throw
beans
::
UnknownPropertyException
();
uno
::
Any
aAny
;
switch
(
pEntry
->
nWID
)
{
case
Date_StyleName
:
{
OUString
aStyleName
=
getCoreObject
()
->
GetStyleName
();
aAny
<<=
aStyleName
;
}
break
;
case
DateType
:
{
condformat
::
ScCondFormatDateType
eType
=
getCoreObject
()
->
GetDateType
();
for
(
size_t
i
=
0
;
i
<
SAL_N_ELEMENTS
(
aDateTypeApiMap
);
++
i
)
{
if
(
aDateTypeApiMap
[
i
].
eType
==
eType
)
{
aAny
<<=
aDateTypeApiMap
[
i
].
nApiType
;
break
;
}
}
}
break
;
default
:
SAL_WARN
(
"sc"
,
"unknown property"
);
}
return
aAny
;
}
void
SAL_CALL
ScCondDateFormatObj
::
addPropertyChangeListener
(
const
OUString
&
/* aPropertyName */
,
const
uno
::
Reference
<
beans
::
XPropertyChangeListener
>&
/* aListener */
)
throw
(
beans
::
UnknownPropertyException
,
lang
::
WrappedTargetException
,
uno
::
RuntimeException
,
std
::
exception
)
{
SAL_WARN
(
"sc"
,
"not implemented"
);
}
void
SAL_CALL
ScCondDateFormatObj
::
removePropertyChangeListener
(
const
OUString
&
/* aPropertyName */
,
const
uno
::
Reference
<
beans
::
XPropertyChangeListener
>&
/* aListener */
)
throw
(
beans
::
UnknownPropertyException
,
lang
::
WrappedTargetException
,
uno
::
RuntimeException
,
std
::
exception
)
{
SAL_WARN
(
"sc"
,
"not implemented"
);
}
void
SAL_CALL
ScCondDateFormatObj
::
addVetoableChangeListener
(
const
OUString
&
,
const
uno
::
Reference
<
beans
::
XVetoableChangeListener
>&
)
throw
(
beans
::
UnknownPropertyException
,
lang
::
WrappedTargetException
,
uno
::
RuntimeException
,
std
::
exception
)
{
SAL_WARN
(
"sc"
,
"not implemented"
);
}
void
SAL_CALL
ScCondDateFormatObj
::
removeVetoableChangeListener
(
const
OUString
&
,
const
uno
::
Reference
<
beans
::
XVetoableChangeListener
>&
)
throw
(
beans
::
UnknownPropertyException
,
lang
::
WrappedTargetException
,
uno
::
RuntimeException
,
std
::
exception
)
{
SAL_WARN
(
"sc"
,
"not implemented"
);
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment