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
21e92879
Kaydet (Commit)
21e92879
authored
Mar 29, 2015
tarafından
Markus Mohrhard
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
add color scale entries
Change-Id: If88822765b5ec738f3204a4ef7c76c3d529e6be2
üst
2773e6ff
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
163 additions
and
0 deletions
+163
-0
colorscale.hxx
sc/inc/colorscale.hxx
+2
-0
colorscale.cxx
sc/source/core/data/colorscale.cxx
+8
-0
condformatuno.hxx
sc/source/ui/inc/condformatuno.hxx
+32
-0
condformatuno.cxx
sc/source/ui/unoobj/condformatuno.cxx
+121
-0
No files found.
sc/inc/colorscale.hxx
Dosyayı görüntüle @
21e92879
...
@@ -281,6 +281,8 @@ public:
...
@@ -281,6 +281,8 @@ public:
iterator
end
();
iterator
end
();
const_iterator
end
()
const
;
const_iterator
end
()
const
;
ScColorScaleEntry
*
GetEntry
(
size_t
nPos
);
size_t
size
()
const
;
size_t
size
()
const
;
};
};
...
...
sc/source/core/data/colorscale.cxx
Dosyayı görüntüle @
21e92879
...
@@ -671,6 +671,14 @@ ScColorScaleFormat::const_iterator ScColorScaleFormat::end() const
...
@@ -671,6 +671,14 @@ ScColorScaleFormat::const_iterator ScColorScaleFormat::end() const
return
maColorScales
.
end
();
return
maColorScales
.
end
();
}
}
ScColorScaleEntry
*
ScColorScaleFormat
::
GetEntry
(
size_t
nPos
)
{
if
(
maColorScales
.
size
()
<=
nPos
)
return
NULL
;
return
&
maColorScales
[
nPos
];
}
size_t
ScColorScaleFormat
::
size
()
const
size_t
ScColorScaleFormat
::
size
()
const
{
{
return
maColorScales
.
size
();
return
maColorScales
.
size
();
...
...
sc/source/ui/inc/condformatuno.hxx
Dosyayı görüntüle @
21e92879
...
@@ -297,6 +297,38 @@ private:
...
@@ -297,6 +297,38 @@ private:
const
ScColorScaleFormat
*
mpFormat
;
const
ScColorScaleFormat
*
mpFormat
;
};
};
class
ScColorScaleEntryObj
:
public
cppu
::
WeakImplHelper1
<
com
::
sun
::
star
::
sheet
::
XColorScaleEntry
>
{
public
:
ScColorScaleEntryObj
(
rtl
::
Reference
<
ScColorScaleFormatObj
>
xParent
,
size_t
nPos
);
virtual
~
ScColorScaleEntryObj
();
virtual
com
::
sun
::
star
::
util
::
Color
SAL_CALL
getColor
()
throw
(
::
com
::
sun
::
star
::
uno
::
RuntimeException
,
std
::
exception
)
SAL_OVERRIDE
;
virtual
void
SAL_CALL
setColor
(
com
::
sun
::
star
::
util
::
Color
aColor
)
throw
(
::
com
::
sun
::
star
::
uno
::
RuntimeException
,
std
::
exception
)
SAL_OVERRIDE
;
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
<
ScColorScaleFormatObj
>
mxParent
;
size_t
mnPos
;
};
class
ScDataBarFormatObj
:
public
cppu
::
WeakImplHelper1
<
com
::
sun
::
star
::
beans
::
XPropertySet
>
class
ScDataBarFormatObj
:
public
cppu
::
WeakImplHelper1
<
com
::
sun
::
star
::
beans
::
XPropertySet
>
{
{
public
:
public
:
...
...
sc/source/ui/unoobj/condformatuno.cxx
Dosyayı görüntüle @
21e92879
...
@@ -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/ColorScaleEntryType.hpp>
#include <com/sun/star/sheet/IconSetFormatEntry.hpp>
#include <com/sun/star/sheet/IconSetFormatEntry.hpp>
namespace
{
namespace
{
...
@@ -121,6 +122,22 @@ const SfxItemPropertyMapEntry* getColorScalePropSet()
...
@@ -121,6 +122,22 @@ const SfxItemPropertyMapEntry* getColorScalePropSet()
return
aColorScalePropertyMap_Impl
;
return
aColorScalePropertyMap_Impl
;
}
}
struct
ColorScaleEntryTypeApiMap
{
ScColorScaleEntryType
eType
;
sal_Int32
nApiType
;
};
ColorScaleEntryTypeApiMap
aColorScaleEntryTypeMap
[]
=
{
{
COLORSCALE_MIN
,
sheet
::
ColorScaleEntryType
::
COLORSCALE_MIN
},
{
COLORSCALE_MAX
,
sheet
::
ColorScaleEntryType
::
COLORSCALE_MAX
},
{
COLORSCALE_VALUE
,
sheet
::
ColorScaleEntryType
::
COLORSCALE_VALUE
},
{
COLORSCALE_FORMULA
,
sheet
::
ColorScaleEntryType
::
COLORSCALE_FORMULA
},
{
COLORSCALE_PERCENT
,
sheet
::
ColorScaleEntryType
::
COLORSCALE_PERCENT
},
{
COLORSCALE_PERCENTILE
,
sheet
::
ColorScaleEntryType
::
COLORSCALE_PERCENTILE
}
};
enum
DataBarProperties
enum
DataBarProperties
{
{
AxisPosition
,
AxisPosition
,
...
@@ -823,6 +840,14 @@ uno::Any SAL_CALL ScColorScaleFormatObj::getPropertyValue( const OUString& aProp
...
@@ -823,6 +840,14 @@ uno::Any SAL_CALL ScColorScaleFormatObj::getPropertyValue( const OUString& aProp
switch
(
pEntry
->
nWID
)
switch
(
pEntry
->
nWID
)
{
{
case
ColorScaleEntries
:
case
ColorScaleEntries
:
{
uno
::
Sequence
<
uno
::
Reference
<
sheet
::
XColorScaleEntry
>
>
aEntries
(
getCoreObject
()
->
size
());
for
(
size_t
i
=
0
;
i
<
getCoreObject
()
->
size
();
++
i
)
{
aEntries
[
i
]
=
new
ScColorScaleEntryObj
(
this
,
i
);
}
aAny
<<=
aEntries
;
}
break
;
break
;
default
:
default
:
SAL_WARN
(
"sc"
,
"unknown property"
);
SAL_WARN
(
"sc"
,
"unknown property"
);
...
@@ -863,6 +888,102 @@ void SAL_CALL ScColorScaleFormatObj::removeVetoableChangeListener( const OUStrin
...
@@ -863,6 +888,102 @@ void SAL_CALL ScColorScaleFormatObj::removeVetoableChangeListener( const OUStrin
SAL_WARN
(
"sc"
,
"not implemented"
);
SAL_WARN
(
"sc"
,
"not implemented"
);
}
}
ScColorScaleEntryObj
::
ScColorScaleEntryObj
(
rtl
::
Reference
<
ScColorScaleFormatObj
>
xParent
,
size_t
nPos
)
:
mxParent
(
xParent
),
mnPos
(
nPos
)
{
}
ScColorScaleEntryObj
::~
ScColorScaleEntryObj
()
{
}
ScColorScaleEntry
*
ScColorScaleEntryObj
::
getCoreObject
()
{
ScColorScaleFormat
*
pFormat
=
mxParent
->
getCoreObject
();
if
(
pFormat
->
size
()
<=
mnPos
)
throw
lang
::
IllegalArgumentException
();
return
pFormat
->
GetEntry
(
mnPos
);
}
util
::
Color
ScColorScaleEntryObj
::
getColor
()
throw
(
uno
::
RuntimeException
,
std
::
exception
)
{
Color
aColor
=
getCoreObject
()
->
GetColor
();
return
aColor
.
GetColor
();
}
void
ScColorScaleEntryObj
::
setColor
(
util
::
Color
aColor
)
throw
(
uno
::
RuntimeException
,
std
::
exception
)
{
getCoreObject
()
->
SetColor
(
Color
(
aColor
));
}
sal_Int32
ScColorScaleEntryObj
::
getType
()
throw
(
uno
::
RuntimeException
,
std
::
exception
)
{
ScColorScaleEntry
*
pEntry
=
getCoreObject
();
for
(
size_t
i
=
0
;
i
<
SAL_N_ELEMENTS
(
aColorScaleEntryTypeMap
);
++
i
)
{
if
(
aColorScaleEntryTypeMap
[
i
].
eType
==
pEntry
->
GetType
())
{
return
aColorScaleEntryTypeMap
[
i
].
nApiType
;
}
}
throw
lang
::
IllegalArgumentException
();
}
void
ScColorScaleEntryObj
::
setType
(
sal_Int32
nType
)
throw
(
uno
::
RuntimeException
,
std
::
exception
)
{
ScColorScaleEntry
*
pEntry
=
getCoreObject
();
for
(
size_t
i
=
0
;
i
<
SAL_N_ELEMENTS
(
aColorScaleEntryTypeMap
);
++
i
)
{
if
(
aColorScaleEntryTypeMap
[
i
].
nApiType
==
nType
)
{
pEntry
->
SetType
(
aColorScaleEntryTypeMap
[
i
].
eType
);
return
;
}
}
throw
lang
::
IllegalArgumentException
();
}
OUString
ScColorScaleEntryObj
::
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
ScColorScaleEntryObj
::
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
;
}
}
ScDataBarFormatObj
::
ScDataBarFormatObj
(
rtl
::
Reference
<
ScCondFormatObj
>
xParent
,
ScDataBarFormatObj
::
ScDataBarFormatObj
(
rtl
::
Reference
<
ScCondFormatObj
>
xParent
,
const
ScDataBarFormat
*
pFormat
)
:
const
ScDataBarFormat
*
pFormat
)
:
mpDocShell
(
xParent
->
getDocShell
()),
mpDocShell
(
xParent
->
getDocShell
()),
...
...
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