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
3dce04a7
Kaydet (Commit)
3dce04a7
authored
Mar 29, 2015
tarafından
Markus Mohrhard
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
add uno object for iconset entries
Change-Id: I3eed6b39a72369063e160e2be7a27fed53a0234a
üst
dd45f089
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
138 additions
and
3 deletions
+138
-3
condformatuno.hxx
sc/source/ui/inc/condformatuno.hxx
+26
-0
condformatuno.cxx
sc/source/ui/unoobj/condformatuno.cxx
+112
-3
No files found.
sc/source/ui/inc/condformatuno.hxx
Dosyayı görüntüle @
3dce04a7
...
@@ -441,6 +441,32 @@ private:
...
@@ -441,6 +441,32 @@ private:
const
ScIconSetFormat
*
mpFormat
;
const
ScIconSetFormat
*
mpFormat
;
};
};
class
ScIconSetEntryObj
:
public
cppu
::
WeakImplHelper1
<
com
::
sun
::
star
::
sheet
::
XIconSetEntry
>
{
public
:
ScIconSetEntryObj
(
rtl
::
Reference
<
ScIconSetFormatObj
>
xParent
,
size_t
nPos
);
virtual
~
ScIconSetEntryObj
();
virtual
sal_Int32
SAL_CALL
getType
()
throw
(
::
com
::
sun
::
star
::
uno
::
RuntimeException
,
std
::
exception
)
SAL_OVERRIDE
;
virtual
void
SAL_CALL
setType
(
sal_Int32
nType
)
throw
(
::
com
::
sun
::
star
::
uno
::
RuntimeException
,
std
::
exception
)
SAL_OVERRIDE
;
virtual
OUString
SAL_CALL
getFormula
()
throw
(
::
com
::
sun
::
star
::
uno
::
RuntimeException
,
std
::
exception
)
SAL_OVERRIDE
;
virtual
void
SAL_CALL
setFormula
(
const
OUString
&
rString
)
throw
(
::
com
::
sun
::
star
::
uno
::
RuntimeException
,
std
::
exception
)
SAL_OVERRIDE
;
private
:
ScColorScaleEntry
*
getCoreObject
();
rtl
::
Reference
<
ScIconSetFormatObj
>
mxParent
;
size_t
mnPos
;
};
#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 @
3dce04a7
...
@@ -28,6 +28,7 @@
...
@@ -28,6 +28,7 @@
#include <com/sun/star/sheet/DataBarAxis.hpp>
#include <com/sun/star/sheet/DataBarAxis.hpp>
#include <com/sun/star/sheet/ConditionFormatOperator.hpp>
#include <com/sun/star/sheet/ConditionFormatOperator.hpp>
#include <com/sun/star/sheet/DataBarEntryType.hpp>
#include <com/sun/star/sheet/DataBarEntryType.hpp>
#include <com/sun/star/sheet/IconSetFormatEntry.hpp>
namespace
{
namespace
{
...
@@ -229,6 +230,21 @@ const IconSetTypeApiMap aIconSetApiMap[] =
...
@@ -229,6 +230,21 @@ const IconSetTypeApiMap aIconSetApiMap[] =
{
IconSet_5Quarters
,
sheet
::
IconSetType
::
ICONSET_5QUARTERS
},
{
IconSet_5Quarters
,
sheet
::
IconSetType
::
ICONSET_5QUARTERS
},
};
};
struct
IconSetEntryTypeApiMap
{
ScColorScaleEntryType
eType
;
sal_Int32
nApiType
;
};
IconSetEntryTypeApiMap
aIconSetEntryTypeMap
[]
=
{
{
COLORSCALE_MIN
,
sheet
::
IconSetFormatEntry
::
ICONSET_MIN
},
{
COLORSCALE_VALUE
,
sheet
::
IconSetFormatEntry
::
ICONSET_VALUE
},
{
COLORSCALE_FORMULA
,
sheet
::
IconSetFormatEntry
::
ICONSET_FORMULA
},
{
COLORSCALE_PERCENT
,
sheet
::
IconSetFormatEntry
::
ICONSET_PERCENT
},
{
COLORSCALE_PERCENTILE
,
sheet
::
IconSetFormatEntry
::
ICONSET_PERCENTILE
}
};
}
}
ScCondFormatsObj
::
ScCondFormatsObj
(
ScDocShell
*
pDocShell
,
SCTAB
nTab
)
:
ScCondFormatsObj
::
ScCondFormatsObj
(
ScDocShell
*
pDocShell
,
SCTAB
nTab
)
:
...
@@ -1266,6 +1282,15 @@ void SAL_CALL ScIconSetFormatObj::setPropertyValue(
...
@@ -1266,6 +1282,15 @@ void SAL_CALL ScIconSetFormatObj::setPropertyValue(
}
}
break
;
break
;
case
IconSetEntries
:
case
IconSetEntries
:
{
uno
::
Sequence
<
uno
::
Reference
<
sheet
::
XIconSetEntry
>
>
aEntries
;
if
(
aValue
>>=
aEntries
)
{
}
else
throw
lang
::
IllegalArgumentException
();
}
break
;
break
;
default
:
default
:
break
;
break
;
...
@@ -1308,11 +1333,13 @@ uno::Any SAL_CALL ScIconSetFormatObj::getPropertyValue( const OUString& aPropert
...
@@ -1308,11 +1333,13 @@ uno::Any SAL_CALL ScIconSetFormatObj::getPropertyValue( const OUString& aPropert
break
;
break
;
case
IconSetEntries
:
case
IconSetEntries
:
{
{
uno
::
Sequence
<
sheet
::
XIconSetEntry
>
aEntries
(
getCoreObject
()
->
size
());
uno
::
Sequence
<
uno
::
Reference
<
sheet
::
XIconSetEntry
>
>
aEntries
(
getCoreObject
()
->
size
());
for
(
auto
it
=
getCoreObject
()
->
begin
(),
itEnd
=
getCoreObject
()
->
end
();
it
!=
itEnd
;
++
it
)
size_t
i
=
0
;
for
(
auto
it
=
getCoreObject
()
->
begin
(),
itEnd
=
getCoreObject
()
->
end
();
it
!=
itEnd
;
++
it
,
++
i
)
{
{
//aEntries.operator[] =
;
aEntries
[
i
]
=
new
ScIconSetEntryObj
(
this
,
i
)
;
}
}
aAny
<<=
aEntries
;
}
}
break
;
break
;
default
:
default
:
...
@@ -1353,4 +1380,86 @@ void SAL_CALL ScIconSetFormatObj::removeVetoableChangeListener( const OUString&,
...
@@ -1353,4 +1380,86 @@ void SAL_CALL ScIconSetFormatObj::removeVetoableChangeListener( const OUString&,
SAL_WARN
(
"sc"
,
"not implemented"
);
SAL_WARN
(
"sc"
,
"not implemented"
);
}
}
ScIconSetEntryObj
::
ScIconSetEntryObj
(
rtl
::
Reference
<
ScIconSetFormatObj
>
xParent
,
size_t
nPos
)
:
mxParent
(
xParent
),
mnPos
(
nPos
)
{
}
ScIconSetEntryObj
::~
ScIconSetEntryObj
()
{
}
ScColorScaleEntry
*
ScIconSetEntryObj
::
getCoreObject
()
{
ScIconSetFormat
*
pFormat
=
mxParent
->
getCoreObject
();
if
(
pFormat
->
GetIconSetData
()
->
maEntries
.
size
()
<=
mnPos
)
throw
lang
::
IllegalArgumentException
();
return
&
pFormat
->
GetIconSetData
()
->
maEntries
[
mnPos
];
}
sal_Int32
ScIconSetEntryObj
::
getType
()
throw
(
uno
::
RuntimeException
,
std
::
exception
)
{
ScColorScaleEntry
*
pEntry
=
getCoreObject
();
for
(
size_t
i
=
0
;
i
<
SAL_N_ELEMENTS
(
aIconSetEntryTypeMap
);
++
i
)
{
if
(
aIconSetEntryTypeMap
[
i
].
eType
==
pEntry
->
GetType
())
{
return
aIconSetEntryTypeMap
[
i
].
nApiType
;
}
}
throw
lang
::
IllegalArgumentException
();
}
void
ScIconSetEntryObj
::
setType
(
sal_Int32
nType
)
throw
(
uno
::
RuntimeException
,
std
::
exception
)
{
ScColorScaleEntry
*
pEntry
=
getCoreObject
();
for
(
size_t
i
=
0
;
i
<
SAL_N_ELEMENTS
(
aIconSetEntryTypeMap
);
++
i
)
{
if
(
aIconSetEntryTypeMap
[
i
].
nApiType
==
nType
)
{
pEntry
->
SetType
(
aIconSetEntryTypeMap
[
i
].
eType
);
return
;
}
}
throw
lang
::
IllegalArgumentException
();
}
OUString
ScIconSetEntryObj
::
getFormula
()
throw
(
uno
::
RuntimeException
,
std
::
exception
)
{
ScColorScaleEntry
*
pEntry
=
getCoreObject
();
switch
(
pEntry
->
GetType
())
{
case
COLORSCALE_FORMULA
:
// TODO: Implement
break
;
default
:
return
OUString
::
number
(
pEntry
->
GetValue
());
}
return
OUString
();
}
void
ScIconSetEntryObj
::
setFormula
(
const
OUString
&
rFormula
)
throw
(
uno
::
RuntimeException
,
std
::
exception
)
{
ScColorScaleEntry
*
pEntry
=
getCoreObject
();
switch
(
pEntry
->
GetType
())
{
case
COLORSCALE_FORMULA
:
// TODO: Implement
// pEntry->SetFormula(rFormula);
break
;
default
:
pEntry
->
SetValue
(
rFormula
.
toDouble
());
break
;
}
}
/* 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