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
1b8f3315
Kaydet (Commit)
1b8f3315
authored
Eki 09, 2012
tarafından
Markus Mohrhard
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
separate color scale with 2 and 3 entries
Change-Id: Idd3cd7467850ee32cb1380fce307395f21076071
üst
7bc0c2bd
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
264 additions
and
15 deletions
+264
-15
condformatdlg.cxx
sc/source/ui/condformat/condformatdlg.cxx
+31
-3
condformatdlgentry.cxx
sc/source/ui/condformat/condformatdlgentry.cxx
+175
-10
condformatdlgentry.hxx
sc/source/ui/inc/condformatdlgentry.hxx
+58
-2
No files found.
sc/source/ui/condformat/condformatdlg.cxx
Dosyayı görüntüle @
1b8f3315
...
...
@@ -78,7 +78,7 @@ ScCondFormatList::ScCondFormatList(Window* pParent, const ResId& rResId, ScDocum
maEntries
.
push_back
(
new
ScConditionFrmtEntry
(
this
,
mpDoc
,
maPos
,
static_cast
<
const
ScCondFormatEntry
*>
(
pEntry
)
)
);
break
;
case
condformat
:
:
COLORSCALE
:
maEntries
.
push_back
(
new
ScColorScaleFrmtEntry
(
this
,
mpDoc
,
maPos
,
static_cast
<
const
ScColorScaleFormat
*>
(
pEntry
)
)
);
maEntries
.
push_back
(
new
ScColorScale
3
FrmtEntry
(
this
,
mpDoc
,
maPos
,
static_cast
<
const
ScColorScaleFormat
*>
(
pEntry
)
)
);
break
;
case
condformat
:
:
DATABAR
:
maEntries
.
push_back
(
new
ScDataBarFrmtEntry
(
this
,
mpDoc
,
maPos
,
static_cast
<
const
ScDataBarFormat
*>
(
pEntry
)
)
);
...
...
@@ -94,7 +94,7 @@ ScCondFormatList::ScCondFormatList(Window* pParent, const ResId& rResId, ScDocum
maEntries
.
push_back
(
new
ScConditionFrmtEntry
(
this
,
mpDoc
,
maPos
));
break
;
case
condformat
:
:
dialog
::
COLORSCALE
:
maEntries
.
push_back
(
new
ScColorScaleFrmtEntry
(
this
,
mpDoc
,
maPos
));
maEntries
.
push_back
(
new
ScColorScale
3
FrmtEntry
(
this
,
mpDoc
,
maPos
));
break
;
case
condformat
:
:
dialog
::
DATABAR
:
maEntries
.
push_back
(
new
ScDataBarFrmtEntry
(
this
,
mpDoc
,
maPos
));
...
...
@@ -182,6 +182,34 @@ void ScCondFormatList::DoScroll(long nDelta)
IMPL_LINK
(
ScCondFormatList
,
ColFormatTypeHdl
,
ListBox
*
,
pBox
)
{
EntryContainer
::
iterator
itr
=
maEntries
.
begin
();
for
(;
itr
!=
maEntries
.
end
();
++
itr
)
{
if
(
itr
->
IsSelected
())
break
;
}
if
(
itr
==
maEntries
.
end
())
return
0
;;
sal_Int32
nPos
=
pBox
->
GetSelectEntryPos
();
switch
(
nPos
)
{
case
0
:
if
(
itr
->
GetType
()
!=
condformat
::
entry
::
COLORSCALE2
)
maEntries
.
replace
(
itr
,
new
ScColorScale2FrmtEntry
(
this
,
mpDoc
,
maPos
)
);
break
;
case
1
:
if
(
itr
->
GetType
()
!=
condformat
::
entry
::
COLORSCALE3
)
maEntries
.
replace
(
itr
,
new
ScColorScale3FrmtEntry
(
this
,
mpDoc
,
maPos
)
);
break
;
case
2
:
if
(
itr
->
GetType
()
!=
condformat
::
entry
::
DATABAR
)
maEntries
.
replace
(
itr
,
new
ScDataBarFrmtEntry
(
this
,
mpDoc
,
maPos
)
);
break
;
default
:
break
;
}
itr
->
SetActive
();
RecalcAll
();
return
0
;
}
...
...
@@ -201,7 +229,7 @@ IMPL_LINK(ScCondFormatList, TypeListHdl, ListBox*, pBox)
switch
(
nPos
)
{
case
0
:
maEntries
.
replace
(
itr
,
new
ScColorScaleFrmtEntry
(
this
,
mpDoc
,
maPos
));
maEntries
.
replace
(
itr
,
new
ScColorScale
3
FrmtEntry
(
this
,
mpDoc
,
maPos
));
itr
->
SetActive
();
break
;
case
1
:
...
...
sc/source/ui/condformat/condformatdlgentry.cxx
Dosyayı görüntüle @
1b8f3315
...
...
@@ -151,6 +151,7 @@ ScConditionFrmtEntry::ScConditionFrmtEntry( Window* pParent, ScDocument* pDoc, c
{
FreeResource
();
maLbType
.
SelectEntryPos
(
1
);
Init
();
...
...
@@ -378,6 +379,7 @@ ScFormulaFrmtEntry::ScFormulaFrmtEntry( Window* pParent, ScDocument* pDoc, const
Init
();
FreeResource
();
maLbType
.
SelectEntryPos
(
2
);
if
(
pFormat
)
{
...
...
@@ -584,7 +586,168 @@ ScColorScaleEntry* createColorScaleEntry( const ListBox& rType, const ColorListB
}
ScColorScaleFrmtEntry
::
ScColorScaleFrmtEntry
(
Window
*
pParent
,
ScDocument
*
pDoc
,
const
ScAddress
&
rPos
,
const
ScColorScaleFormat
*
pFormat
)
:
ScColorScale2FrmtEntry
::
ScColorScale2FrmtEntry
(
Window
*
pParent
,
ScDocument
*
pDoc
,
const
ScAddress
&
rPos
,
const
ScColorScaleFormat
*
pFormat
)
:
ScCondFrmtEntry
(
pParent
,
pDoc
,
rPos
),
maLbColorFormat
(
this
,
ScResId
(
LB_COLOR_FORMAT
)
),
maLbColScale2
(
this
,
ScResId
(
LB_COL_SCALE2
)
),
maLbEntryTypeMin
(
this
,
ScResId
(
LB_TYPE_COL_SCALE
)
),
maLbEntryTypeMax
(
this
,
ScResId
(
LB_TYPE_COL_SCALE
)
),
maEdMin
(
this
,
ScResId
(
ED_COL_SCALE
)
),
maEdMax
(
this
,
ScResId
(
ED_COL_SCALE
)
),
maLbColMin
(
this
,
ScResId
(
LB_COL
)
),
maLbColMax
(
this
,
ScResId
(
LB_COL
)
)
{
maLbType
.
SelectEntryPos
(
0
);
maLbColorFormat
.
SelectEntryPos
(
0
);
if
(
pFormat
)
{
ScColorScaleFormat
::
const_iterator
itr
=
pFormat
->
begin
();
SetColorScaleEntryTypes
(
*
itr
,
maLbEntryTypeMin
,
maEdMin
,
maLbColMin
);
++
itr
;
SetColorScaleEntryTypes
(
*
itr
,
maLbEntryTypeMax
,
maEdMax
,
maLbColMax
);
}
else
{
maLbEntryTypeMin
.
SelectEntryPos
(
0
);
maLbEntryTypeMax
.
SelectEntryPos
(
1
);
}
FreeResource
();
maLbColorFormat
.
SetSelectHdl
(
LINK
(
pParent
,
ScCondFormatList
,
ColFormatTypeHdl
)
);
Init
();
}
void
ScColorScale2FrmtEntry
::
Init
()
{
maLbEntryTypeMin
.
SetSelectHdl
(
LINK
(
this
,
ScColorScale2FrmtEntry
,
EntryTypeHdl
)
);
maLbEntryTypeMax
.
SetSelectHdl
(
LINK
(
this
,
ScColorScale2FrmtEntry
,
EntryTypeHdl
)
);
SfxObjectShell
*
pDocSh
=
SfxObjectShell
::
Current
();
const
SfxPoolItem
*
pItem
=
NULL
;
XColorListRef
pColorTable
;
DBG_ASSERT
(
pDocSh
,
"DocShell not found!"
);
/*
Point aPointLb = maLbEntryTypeMiddle.GetPosPixel();
Point aPointEd = maEdMiddle.GetPosPixel();
Point aPointCol = maLbColMiddle.GetPosPixel();
const long nMovePos = maLbEntryTypeMiddle.GetSizePixel().Width() * 1.2;
aPointLb.X() += nMovePos;
aPointEd.X() += nMovePos;
aPointCol.X() += nMovePos;
maLbEntryTypeMiddle.SetPosPixel(aPointLb);
maEdMiddle.SetPosPixel(aPointEd);
maLbColMiddle.SetPosPixel(aPointCol);
aPointLb.X() += nMovePos;
aPointEd.X() += nMovePos;
aPointCol.X() += nMovePos;
maLbEntryTypeMax.SetPosPixel(aPointLb);
maEdMax.SetPosPixel(aPointEd);
maLbColMax.SetPosPixel(aPointCol);
*/
if
(
pDocSh
)
{
pItem
=
pDocSh
->
GetItem
(
SID_COLOR_TABLE
);
if
(
pItem
!=
NULL
)
pColorTable
=
(
(
SvxColorListItem
*
)
pItem
)
->
GetColorList
();
}
if
(
pColorTable
.
is
()
)
{
// filling the line color box
maLbColMin
.
SetUpdateMode
(
false
);
maLbColMax
.
SetUpdateMode
(
false
);
for
(
long
i
=
0
;
i
<
pColorTable
->
Count
();
++
i
)
{
XColorEntry
*
pEntry
=
pColorTable
->
GetColor
(
i
);
maLbColMin
.
InsertEntry
(
pEntry
->
GetColor
(),
pEntry
->
GetName
()
);
maLbColMax
.
InsertEntry
(
pEntry
->
GetColor
(),
pEntry
->
GetName
()
);
if
(
pEntry
->
GetColor
()
==
Color
(
COL_LIGHTRED
))
maLbColMin
.
SelectEntryPos
(
i
);
if
(
pEntry
->
GetColor
()
==
Color
(
COL_LIGHTBLUE
))
maLbColMax
.
SelectEntryPos
(
i
);
}
maLbColMin
.
SetUpdateMode
(
sal_True
);
maLbColMax
.
SetUpdateMode
(
sal_True
);
}
EntryTypeHdl
(
&
maLbEntryTypeMin
);
EntryTypeHdl
(
&
maLbEntryTypeMax
);
}
ScFormatEntry
*
ScColorScale2FrmtEntry
::
createColorscaleEntry
()
const
{
ScColorScaleFormat
*
pColorScale
=
new
ScColorScaleFormat
(
mpDoc
);
pColorScale
->
AddEntry
(
createColorScaleEntry
(
maLbEntryTypeMin
,
maLbColMin
,
maEdMin
,
mpDoc
,
maPos
));
pColorScale
->
AddEntry
(
createColorScaleEntry
(
maLbEntryTypeMax
,
maLbColMax
,
maEdMax
,
mpDoc
,
maPos
));
return
pColorScale
;
}
ScFormatEntry
*
ScColorScale2FrmtEntry
::
GetEntry
()
const
{
return
createColorscaleEntry
();
}
void
ScColorScale2FrmtEntry
::
SetActive
()
{
maLbColScale2
.
Show
();
maLbEntryTypeMin
.
Show
();
maLbEntryTypeMax
.
Show
();
maEdMin
.
Show
();
maEdMax
.
Show
();
maLbColMin
.
Show
();
maLbColMax
.
Show
();
Select
();
}
void
ScColorScale2FrmtEntry
::
SetInactive
()
{
maLbColScale2
.
Hide
();
maLbEntryTypeMin
.
Hide
();
maLbEntryTypeMax
.
Hide
();
maEdMin
.
Hide
();
maEdMax
.
Hide
();
maLbColMin
.
Hide
();
maLbColMax
.
Hide
();
Deselect
();
}
IMPL_LINK
(
ScColorScale2FrmtEntry
,
EntryTypeHdl
,
ListBox
*
,
pBox
)
{
bool
bEnableEdit
=
true
;
sal_Int32
nPos
=
pBox
->
GetSelectEntryPos
();
if
(
nPos
==
0
||
nPos
==
1
)
{
bEnableEdit
=
false
;
}
Edit
*
pEd
=
NULL
;
if
(
pBox
==
&
maLbEntryTypeMin
)
pEd
=
&
maEdMin
;
else
if
(
pBox
==
&
maLbEntryTypeMax
)
pEd
=
&
maEdMax
;
if
(
bEnableEdit
)
pEd
->
Enable
();
else
pEd
->
Disable
();
return
0
;
}
ScColorScale3FrmtEntry
::
ScColorScale3FrmtEntry
(
Window
*
pParent
,
ScDocument
*
pDoc
,
const
ScAddress
&
rPos
,
const
ScColorScaleFormat
*
pFormat
)
:
ScCondFrmtEntry
(
pParent
,
pDoc
,
rPos
),
maLbColorFormat
(
this
,
ScResId
(
LB_COLOR_FORMAT
)
),
maLbColScale2
(
this
,
ScResId
(
LB_COL_SCALE2
)
),
...
...
@@ -599,6 +762,7 @@ ScColorScaleFrmtEntry::ScColorScaleFrmtEntry( Window* pParent, ScDocument* pDoc,
maLbColMiddle
(
this
,
ScResId
(
LB_COL
)
),
maLbColMax
(
this
,
ScResId
(
LB_COL
)
)
{
maLbType
.
SelectEntryPos
(
0
);
if
(
pFormat
)
{
if
(
pFormat
->
size
()
==
2
)
...
...
@@ -630,11 +794,11 @@ ScColorScaleFrmtEntry::ScColorScaleFrmtEntry( Window* pParent, ScDocument* pDoc,
Init
();
}
void
ScColorScaleFrmtEntry
::
Init
()
void
ScColorScale
3
FrmtEntry
::
Init
()
{
maLbEntryTypeMin
.
SetSelectHdl
(
LINK
(
this
,
ScColorScaleFrmtEntry
,
EntryTypeHdl
)
);
maLbEntryTypeMax
.
SetSelectHdl
(
LINK
(
this
,
ScColorScaleFrmtEntry
,
EntryTypeHdl
)
);
maLbEntryTypeMiddle
.
SetSelectHdl
(
LINK
(
this
,
ScColorScaleFrmtEntry
,
EntryTypeHdl
)
);
maLbEntryTypeMin
.
SetSelectHdl
(
LINK
(
this
,
ScColorScale
3
FrmtEntry
,
EntryTypeHdl
)
);
maLbEntryTypeMax
.
SetSelectHdl
(
LINK
(
this
,
ScColorScale
3
FrmtEntry
,
EntryTypeHdl
)
);
maLbEntryTypeMiddle
.
SetSelectHdl
(
LINK
(
this
,
ScColorScale
3
FrmtEntry
,
EntryTypeHdl
)
);
SfxObjectShell
*
pDocSh
=
SfxObjectShell
::
Current
();
const
SfxPoolItem
*
pItem
=
NULL
;
...
...
@@ -696,7 +860,7 @@ void ScColorScaleFrmtEntry::Init()
EntryTypeHdl
(
&
maLbEntryTypeMax
);
}
ScFormatEntry
*
ScColorScaleFrmtEntry
::
createColorscaleEntry
()
const
ScFormatEntry
*
ScColorScale
3
FrmtEntry
::
createColorscaleEntry
()
const
{
ScColorScaleFormat
*
pColorScale
=
new
ScColorScaleFormat
(
mpDoc
);
pColorScale
->
AddEntry
(
createColorScaleEntry
(
maLbEntryTypeMin
,
maLbColMin
,
maEdMin
,
mpDoc
,
maPos
));
...
...
@@ -706,12 +870,12 @@ ScFormatEntry* ScColorScaleFrmtEntry::createColorscaleEntry() const
return
pColorScale
;
}
ScFormatEntry
*
ScColorScaleFrmtEntry
::
GetEntry
()
const
ScFormatEntry
*
ScColorScale
3
FrmtEntry
::
GetEntry
()
const
{
return
createColorscaleEntry
();
}
void
ScColorScaleFrmtEntry
::
SetActive
()
void
ScColorScale
3
FrmtEntry
::
SetActive
()
{
maLbColScale2
.
Show
();
maLbColScale3
.
Show
();
...
...
@@ -731,7 +895,7 @@ void ScColorScaleFrmtEntry::SetActive()
Select
();
}
void
ScColorScaleFrmtEntry
::
SetInactive
()
void
ScColorScale
3
FrmtEntry
::
SetInactive
()
{
maLbColScale2
.
Hide
();
maLbColScale3
.
Hide
();
...
...
@@ -751,7 +915,7 @@ void ScColorScaleFrmtEntry::SetInactive()
Deselect
();
}
IMPL_LINK
(
ScColorScaleFrmtEntry
,
EntryTypeHdl
,
ListBox
*
,
pBox
)
IMPL_LINK
(
ScColorScale
3
FrmtEntry
,
EntryTypeHdl
,
ListBox
*
,
pBox
)
{
bool
bEnableEdit
=
true
;
sal_Int32
nPos
=
pBox
->
GetSelectEntryPos
();
...
...
@@ -841,6 +1005,7 @@ ScDataBarFrmtEntry::ScDataBarFrmtEntry( Window* pParent, ScDocument* pDoc, const
maBtOptions
(
this
,
ScResId
(
BTN_OPTIONS
)
)
{
maLbColorFormat
.
SelectEntryPos
(
2
);
maLbType
.
SelectEntryPos
(
0
);
if
(
pFormat
)
{
mpDataBarData
.
reset
(
new
ScDataBarFormatData
(
*
pFormat
->
GetDataBarData
()));
...
...
sc/source/ui/inc/condformatdlgentry.hxx
Dosyayı görüntüle @
1b8f3315
#include "colorscale.hxx"
#include "conditio.hxx"
namespace
condformat
{
namespace
entry
{
enum
ScCondFrmtEntryType
{
CONDITION
,
FORMULA
,
COLORSCALE2
,
COLORSCALE3
,
DATABAR
};
}
}
class
ScCondFrmtEntry
:
public
Control
{
private
:
...
...
@@ -41,6 +58,8 @@ public:
virtual
ScFormatEntry
*
GetEntry
()
const
=
0
;
virtual
void
SetActive
()
=
0
;
virtual
void
SetInactive
()
=
0
;
virtual
condformat
::
entry
::
ScCondFrmtEntryType
GetType
()
=
0
;
};
class
ScConditionFrmtEntry
:
public
ScCondFrmtEntry
...
...
@@ -65,6 +84,8 @@ public:
virtual
ScFormatEntry
*
GetEntry
()
const
;
virtual
void
SetActive
();
virtual
void
SetInactive
();
virtual
condformat
::
entry
::
ScCondFrmtEntryType
GetType
()
{
return
condformat
::
entry
::
CONDITION
;
}
};
class
ScFormulaFrmtEntry
:
public
ScCondFrmtEntry
...
...
@@ -84,9 +105,41 @@ public:
virtual
ScFormatEntry
*
GetEntry
()
const
;
virtual
void
SetActive
();
virtual
void
SetInactive
();
virtual
condformat
::
entry
::
ScCondFrmtEntryType
GetType
()
{
return
condformat
::
entry
::
FORMULA
;
}
};
class
ScColorScale2FrmtEntry
:
public
ScCondFrmtEntry
{
//color format ui elements
ListBox
maLbColorFormat
;
//color scale ui elements
ListBox
maLbColScale2
;
ListBox
maLbEntryTypeMin
;
ListBox
maLbEntryTypeMax
;
Edit
maEdMin
;
Edit
maEdMax
;
ColorListBox
maLbColMin
;
ColorListBox
maLbColMax
;
ScFormatEntry
*
createColorscaleEntry
()
const
;
void
Init
();
DECL_LINK
(
EntryTypeHdl
,
ListBox
*
);
public
:
ScColorScale2FrmtEntry
(
Window
*
pParent
,
ScDocument
*
pDoc
,
const
ScAddress
&
rPos
,
const
ScColorScaleFormat
*
pFormat
=
NULL
);
virtual
ScFormatEntry
*
GetEntry
()
const
;
virtual
void
SetActive
();
virtual
void
SetInactive
();
virtual
condformat
::
entry
::
ScCondFrmtEntryType
GetType
()
{
return
condformat
::
entry
::
COLORSCALE2
;
}
};
class
ScColorScaleFrmtEntry
:
public
ScCondFrmtEntry
class
ScColorScale
3
FrmtEntry
:
public
ScCondFrmtEntry
{
//color format ui elements
...
...
@@ -114,10 +167,11 @@ class ScColorScaleFrmtEntry : public ScCondFrmtEntry
DECL_LINK
(
EntryTypeHdl
,
ListBox
*
);
public
:
ScColorScaleFrmtEntry
(
Window
*
pParent
,
ScDocument
*
pDoc
,
const
ScAddress
&
rPos
,
const
ScColorScaleFormat
*
pFormat
=
NULL
);
ScColorScale
3
FrmtEntry
(
Window
*
pParent
,
ScDocument
*
pDoc
,
const
ScAddress
&
rPos
,
const
ScColorScaleFormat
*
pFormat
=
NULL
);
virtual
ScFormatEntry
*
GetEntry
()
const
;
virtual
void
SetActive
();
virtual
void
SetInactive
();
virtual
condformat
::
entry
::
ScCondFrmtEntryType
GetType
()
{
return
condformat
::
entry
::
COLORSCALE3
;
}
};
class
ScDataBarFrmtEntry
:
public
ScCondFrmtEntry
...
...
@@ -146,5 +200,7 @@ public:
virtual
ScFormatEntry
*
GetEntry
()
const
;
virtual
void
SetActive
();
virtual
void
SetInactive
();
virtual
condformat
::
entry
::
ScCondFrmtEntryType
GetType
()
{
return
condformat
::
entry
::
DATABAR
;
}
};
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