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
ee93051d
Kaydet (Commit)
ee93051d
authored
Eki 08, 2012
tarafından
Markus Mohrhard
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
add own class for formula type cond formats
Change-Id: I0348797babb9e94e1d552dce341504144c837325
üst
d7a27f40
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
157 additions
and
15 deletions
+157
-15
condformatdlg.cxx
sc/source/ui/condformat/condformatdlg.cxx
+4
-2
condformatdlgentry.cxx
sc/source/ui/condformat/condformatdlgentry.cxx
+126
-12
condformatdlg.hrc
sc/source/ui/inc/condformatdlg.hrc
+2
-0
condformatdlgentry.hxx
sc/source/ui/inc/condformatdlgentry.hxx
+19
-1
condformatdlg.src
sc/source/ui/src/condformatdlg.src
+6
-0
No files found.
sc/source/ui/condformat/condformatdlg.cxx
Dosyayı görüntüle @
ee93051d
...
@@ -190,13 +190,15 @@ IMPL_LINK(ScCondFormatList, TypeListHdl, ListBox*, pBox)
...
@@ -190,13 +190,15 @@ IMPL_LINK(ScCondFormatList, TypeListHdl, ListBox*, pBox)
{
{
case
0
:
case
0
:
maEntries
.
replace
(
itr
,
new
ScColorScaleFrmtEntry
(
this
,
mpDoc
,
maPos
));
maEntries
.
replace
(
itr
,
new
ScColorScaleFrmtEntry
(
this
,
mpDoc
,
maPos
));
itr
->
Set
Height
();
itr
->
Set
Active
();
break
;
break
;
case
1
:
case
1
:
maEntries
.
replace
(
itr
,
new
ScConditionFrmtEntry
(
this
,
mpDoc
,
maPos
));
maEntries
.
replace
(
itr
,
new
ScConditionFrmtEntry
(
this
,
mpDoc
,
maPos
));
itr
->
Set
Height
();
itr
->
Set
Active
();
break
;
break
;
case
2
:
case
2
:
maEntries
.
replace
(
itr
,
new
ScFormulaFrmtEntry
(
this
,
mpDoc
,
maPos
));
itr
->
SetActive
();
break
;
break
;
}
}
RecalcAll
();
RecalcAll
();
...
...
sc/source/ui/condformat/condformatdlgentry.cxx
Dosyayı görüntüle @
ee93051d
#include "condformatdlg.hxx"
#include "condformatdlg.hxx"
#include "condformatdlgentry.hxx"
#include "condformatdlgentry.hxx"
#include "condformatdlg.hrc"
#include "condformatdlg.hrc"
#include "conditio.hxx"
#include "document.hxx"
#include "document.hxx"
...
@@ -139,18 +140,6 @@ IMPL_LINK(ScCondFrmtEntry, EdModifyHdl, Edit*, pEdit)
...
@@ -139,18 +140,6 @@ IMPL_LINK(ScCondFrmtEntry, EdModifyHdl, Edit*, pEdit)
//
//
//condition
//condition
ScFormatEntry
*
ScConditionFrmtEntry
::
createFormulaEntry
()
const
{
ScConditionMode
eMode
=
SC_COND_DIRECT
;
rtl
::
OUString
aFormula
=
maEdVal1
.
GetText
();
if
(
aFormula
.
isEmpty
())
return
NULL
;
rtl
::
OUString
aExpr2
;
ScFormatEntry
*
pEntry
=
new
ScCondFormatEntry
(
eMode
,
aFormula
,
aExpr2
,
mpDoc
,
maPos
,
maLbStyle
.
GetSelectEntry
());
return
pEntry
;
}
ScConditionFrmtEntry
::
ScConditionFrmtEntry
(
Window
*
pParent
,
ScDocument
*
pDoc
,
const
ScAddress
&
rPos
,
const
ScCondFormatEntry
*
pFormatEntry
)
:
ScConditionFrmtEntry
::
ScConditionFrmtEntry
(
Window
*
pParent
,
ScDocument
*
pDoc
,
const
ScAddress
&
rPos
,
const
ScCondFormatEntry
*
pFormatEntry
)
:
ScCondFrmtEntry
(
pParent
,
pDoc
,
rPos
),
ScCondFrmtEntry
(
pParent
,
pDoc
,
rPos
),
maLbCondType
(
this
,
ScResId
(
LB_CELLIS_TYPE
)
),
maLbCondType
(
this
,
ScResId
(
LB_CELLIS_TYPE
)
),
...
@@ -377,6 +366,131 @@ IMPL_LINK_NOARG(ScConditionFrmtEntry, StyleSelectHdl)
...
@@ -377,6 +366,131 @@ IMPL_LINK_NOARG(ScConditionFrmtEntry, StyleSelectHdl)
return
0
;
return
0
;
}
}
// formula
ScFormulaFrmtEntry
::
ScFormulaFrmtEntry
(
Window
*
pParent
,
ScDocument
*
pDoc
,
const
ScAddress
&
rPos
,
const
ScCondFormatEntry
*
pFormat
)
:
ScCondFrmtEntry
(
pParent
,
pDoc
,
rPos
),
maFtStyle
(
this
,
ScResId
(
FT_STYLE
)
),
maLbStyle
(
this
,
ScResId
(
LB_STYLE
)
),
maWdPreview
(
this
,
ScResId
(
WD_PREVIEW
)
),
maEdFormula
(
this
,
ScResId
(
ED_FORMULA
)
)
{
Init
();
FreeResource
();
if
(
pFormat
)
{
maEdFormula
.
SetText
(
pFormat
->
GetExpression
(
rPos
,
0
,
0
,
pDoc
->
GetGrammar
()));
maLbStyle
.
SelectEntry
(
pFormat
->
GetStyle
());
}
else
{
maLbStyle
.
SelectEntryPos
(
1
);
}
}
void
ScFormulaFrmtEntry
::
Init
()
{
maLbStyle
.
SetSeparatorPos
(
0
);
SfxStyleSheetIterator
aStyleIter
(
mpDoc
->
GetStyleSheetPool
(),
SFX_STYLE_FAMILY_PARA
);
for
(
SfxStyleSheetBase
*
pStyle
=
aStyleIter
.
First
();
pStyle
;
pStyle
=
aStyleIter
.
Next
()
)
{
rtl
::
OUString
aName
=
pStyle
->
GetName
();
maLbStyle
.
InsertEntry
(
aName
);
}
maLbStyle
.
SetSelectHdl
(
LINK
(
this
,
ScFormulaFrmtEntry
,
StyleSelectHdl
)
);
}
IMPL_LINK_NOARG
(
ScFormulaFrmtEntry
,
StyleSelectHdl
)
{
if
(
maLbStyle
.
GetSelectEntryPos
()
==
0
)
{
// call new style dialog
SfxUInt16Item
aFamilyItem
(
SID_STYLE_FAMILY
,
SFX_STYLE_FAMILY_PARA
);
SfxStringItem
aRefItem
(
SID_STYLE_REFERENCE
,
ScGlobal
::
GetRscString
(
STR_STYLENAME_STANDARD
)
);
// unlock the dispatcher so SID_STYLE_NEW can be executed
// (SetDispatcherLock would affect all Calc documents)
ScTabViewShell
*
pViewShell
=
ScTabViewShell
::
GetActiveViewShell
();
SfxDispatcher
*
pDisp
=
pViewShell
->
GetDispatcher
();
sal_Bool
bLocked
=
pDisp
->
IsLocked
();
if
(
bLocked
)
pDisp
->
Lock
(
false
);
// Execute the "new style" slot, complete with undo and all necessary updates.
// The return value (SfxUInt16Item) is ignored, look for new styles instead.
pDisp
->
Execute
(
SID_STYLE_NEW
,
SFX_CALLMODE_SYNCHRON
|
SFX_CALLMODE_RECORD
|
SFX_CALLMODE_MODAL
,
&
aFamilyItem
,
&
aRefItem
,
0L
);
if
(
bLocked
)
pDisp
->
Lock
(
sal_True
);
// Find the new style and add it into the style list boxes
rtl
::
OUString
aNewStyle
;
SfxStyleSheetIterator
aStyleIter
(
mpDoc
->
GetStyleSheetPool
(),
SFX_STYLE_FAMILY_PARA
);
for
(
SfxStyleSheetBase
*
pStyle
=
aStyleIter
.
First
();
pStyle
;
pStyle
=
aStyleIter
.
Next
()
)
{
rtl
::
OUString
aName
=
pStyle
->
GetName
();
if
(
maLbStyle
.
GetEntryPos
(
aName
)
==
LISTBOX_ENTRY_NOTFOUND
)
// all lists contain the same entries
{
maLbStyle
.
InsertEntry
(
aName
);
maLbStyle
.
SelectEntry
(
aName
);
}
}
}
rtl
::
OUString
aStyleName
=
maLbStyle
.
GetSelectEntry
();
SfxStyleSheetBase
*
pStyleSheet
=
mpDoc
->
GetStyleSheetPool
()
->
Find
(
aStyleName
,
SFX_STYLE_FAMILY_PARA
);
if
(
pStyleSheet
)
{
const
SfxItemSet
&
rSet
=
pStyleSheet
->
GetItemSet
();
maWdPreview
.
Init
(
rSet
);
}
return
0
;
}
ScFormatEntry
*
ScFormulaFrmtEntry
::
createFormulaEntry
()
const
{
ScConditionMode
eMode
=
SC_COND_DIRECT
;
rtl
::
OUString
aFormula
=
maEdFormula
.
GetText
();
if
(
aFormula
.
isEmpty
())
return
NULL
;
rtl
::
OUString
aExpr2
;
ScFormatEntry
*
pEntry
=
new
ScCondFormatEntry
(
eMode
,
aFormula
,
aExpr2
,
mpDoc
,
maPos
,
maLbStyle
.
GetSelectEntry
());
return
pEntry
;
}
ScFormatEntry
*
ScFormulaFrmtEntry
::
GetEntry
()
const
{
return
createFormulaEntry
();
}
void
ScFormulaFrmtEntry
::
SetActive
()
{
maWdPreview
.
Show
();
maFtStyle
.
Show
();
maLbStyle
.
Show
();
maEdFormula
.
Show
();
Select
();
}
void
ScFormulaFrmtEntry
::
SetInactive
()
{
maWdPreview
.
Hide
();
maFtStyle
.
Hide
();
maLbStyle
.
Hide
();
maEdFormula
.
Hide
();
Deselect
();
}
//color scale
//color scale
namespace
{
namespace
{
...
...
sc/source/ui/inc/condformatdlg.hrc
Dosyayı görüntüle @
ee93051d
...
@@ -59,4 +59,6 @@
...
@@ -59,4 +59,6 @@
#define ED_RANGE 33
#define ED_RANGE 33
#define RB_RANGE 34
#define RB_RANGE 34
#define ED_FORMULA 35
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
sc/source/ui/inc/condformatdlgentry.hxx
Dosyayı görüntüle @
ee93051d
...
@@ -55,7 +55,6 @@ class ScConditionFrmtEntry : public ScCondFrmtEntry
...
@@ -55,7 +55,6 @@ class ScConditionFrmtEntry : public ScCondFrmtEntry
SvxFontPrevWindow
maWdPreview
;
SvxFontPrevWindow
maWdPreview
;
ScFormatEntry
*
createConditionEntry
()
const
;
ScFormatEntry
*
createConditionEntry
()
const
;
ScFormatEntry
*
createFormulaEntry
()
const
;
void
Init
();
void
Init
();
DECL_LINK
(
StyleSelectHdl
,
void
*
);
DECL_LINK
(
StyleSelectHdl
,
void
*
);
...
@@ -68,6 +67,25 @@ public:
...
@@ -68,6 +67,25 @@ public:
virtual
void
SetInactive
();
virtual
void
SetInactive
();
};
};
class
ScFormulaFrmtEntry
:
public
ScCondFrmtEntry
{
FixedText
maFtStyle
;
ListBox
maLbStyle
;
SvxFontPrevWindow
maWdPreview
;
Edit
maEdFormula
;
ScFormatEntry
*
createFormulaEntry
()
const
;
void
Init
();
DECL_LINK
(
StyleSelectHdl
,
void
*
);
public
:
ScFormulaFrmtEntry
(
Window
*
pParent
,
ScDocument
*
PDoc
,
const
ScAddress
&
rPos
,
const
ScCondFormatEntry
*
pFormatEntry
=
NULL
);
virtual
ScFormatEntry
*
GetEntry
()
const
;
virtual
void
SetActive
();
virtual
void
SetInactive
();
};
class
ScColorScaleFrmtEntry
:
public
ScCondFrmtEntry
class
ScColorScaleFrmtEntry
:
public
ScCondFrmtEntry
{
{
...
...
sc/source/ui/src/condformatdlg.src
Dosyayı görüntüle @
ee93051d
...
@@ -149,6 +149,12 @@ Control RID_COND_ENTRY
...
@@ -149,6 +149,12 @@ Control RID_COND_ENTRY
Size = MAP_APPFONT( 50, 12 );
Size = MAP_APPFONT( 50, 12 );
Border = TRUE;
Border = TRUE;
};
};
Edit ED_FORMULA
{
Pos = MAP_APPFONT( 90, 15 );
Size = MAP_APPFONT( 135, 12 );
Border = TRUE;
};
Edit ED_VAL2
Edit ED_VAL2
{
{
Pos = MAP_APPFONT( 230, 15 );
Pos = MAP_APPFONT( 230, 15 );
...
...
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