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
29206b09
Kaydet (Commit)
29206b09
authored
Kas 15, 2012
tarafından
Markus Mohrhard
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
ui part for conditional date formats
Change-Id: I96893aaa016e6947d354aac4d7bc88da693095da
üst
ee1af679
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
168 additions
and
60 deletions
+168
-60
globstr.hrc
sc/inc/globstr.hrc
+3
-2
condformatdlg.cxx
sc/source/ui/condformat/condformatdlg.cxx
+12
-0
condformatdlgentry.cxx
sc/source/ui/condformat/condformatdlgentry.cxx
+90
-55
condformathelper.cxx
sc/source/ui/condformat/condformathelper.cxx
+5
-0
condformatdlg.hrc
sc/source/ui/inc/condformatdlg.hrc
+2
-0
condformatdlgentry.hxx
sc/source/ui/inc/condformatdlgentry.hxx
+25
-2
condformathelper.hxx
sc/source/ui/inc/condformathelper.hxx
+2
-1
condformatdlg.src
sc/source/ui/src/condformatdlg.src
+25
-0
globstr.src
sc/source/ui/src/globstr.src
+4
-0
No files found.
sc/inc/globstr.hrc
Dosyayı görüntüle @
29206b09
...
...
@@ -612,9 +612,10 @@
#define STR_COND_ENDS_WITH 487
#define STR_COND_CONTAINS 488
#define STR_COND_NOT_CONTAINS 489
#define STR_COND_DATE 490
#define STR_ERR_CONDFORMAT_PROTECTED 49
0
#define STR_ERR_CONDFORMAT_PROTECTED 49
1
#define STR_COUNT 49
1
#define STR_COUNT 49
2
#endif
sc/source/ui/condformat/condformatdlg.cxx
Dosyayı görüntüle @
29206b09
...
...
@@ -91,6 +91,9 @@ ScCondFormatList::ScCondFormatList(Window* pParent, const ResId& rResId, ScDocum
break
;
case
condformat
:
:
ICONSET
:
break
;
case
condformat
:
:
DATE
:
maEntries
.
push_back
(
new
ScDateFrmtEntry
(
this
,
mpDoc
,
static_cast
<
const
ScCondDateFormatEntry
*>
(
pEntry
)
)
);
break
;
}
}
}
...
...
@@ -249,6 +252,7 @@ IMPL_LINK(ScCondFormatList, TypeListHdl, ListBox*, pBox)
{
case
condformat
:
:
entry
::
FORMULA
:
case
condformat
:
:
entry
::
CONDITION
:
case
condformat
:
:
entry
::
DATE
:
break
;
case
condformat
:
:
entry
::
COLORSCALE2
:
case
condformat
:
:
entry
::
COLORSCALE3
:
...
...
@@ -275,6 +279,14 @@ IMPL_LINK(ScCondFormatList, TypeListHdl, ListBox*, pBox)
static_cast
<
ScCondFormatDlg
*>
(
GetParent
())
->
InvalidateRefData
();
itr
->
SetActive
();
break
;
case
3
:
if
(
itr
->
GetType
()
==
condformat
::
entry
::
DATE
)
return
0
;
maEntries
.
replace
(
itr
,
new
ScDateFrmtEntry
(
this
,
mpDoc
));
static_cast
<
ScCondFormatDlg
*>
(
GetParent
())
->
InvalidateRefData
();
itr
->
SetActive
();
break
;
}
RecalcAll
();
return
0
;
...
...
sc/source/ui/condformat/condformatdlgentry.cxx
Dosyayı görüntüle @
29206b09
...
...
@@ -254,7 +254,6 @@ ScConditionFrmtEntry::ScConditionFrmtEntry( Window* pParent, ScDocument* pDoc, c
void
ScConditionFrmtEntry
::
Init
()
{
maLbStyle
.
SetSeparatorPos
(
0
);
maEdVal1
.
SetGetFocusHdl
(
LINK
(
GetParent
()
->
GetParent
(),
ScCondFormatDlg
,
RangeGetFocusHdl
)
);
maEdVal2
.
SetGetFocusHdl
(
LINK
(
GetParent
()
->
GetParent
(),
ScCondFormatDlg
,
RangeGetFocusHdl
)
);
maEdVal1
.
SetLoseFocusHdl
(
LINK
(
GetParent
()
->
GetParent
(),
ScCondFormatDlg
,
RangeLoseFocusHdl
)
);
...
...
@@ -266,6 +265,7 @@ void ScConditionFrmtEntry::Init()
maEdVal1
.
SetModifyHdl
(
LINK
(
this
,
ScCondFrmtEntry
,
EdModifyHdl
)
);
maEdVal2
.
SetModifyHdl
(
LINK
(
this
,
ScCondFrmtEntry
,
EdModifyHdl
)
);
maLbStyle
.
SetSeparatorPos
(
0
);
SfxStyleSheetIterator
aStyleIter
(
mpDoc
->
GetStyleSheetPool
(),
SFX_STYLE_FAMILY_PARA
);
for
(
SfxStyleSheetBase
*
pStyle
=
aStyleIter
.
First
();
pStyle
;
pStyle
=
aStyleIter
.
Next
()
)
{
...
...
@@ -402,9 +402,11 @@ void ScConditionFrmtEntry::SetInactive()
Deselect
();
}
IMPL_LINK_NOARG
(
ScConditionFrmtEntry
,
StyleSelectHdl
)
namespace
{
void
StyleSelect
(
ListBox
&
rLbStyle
,
ScDocument
*
pDoc
,
SvxFontPrevWindow
&
rWdPreview
)
{
if
(
ma
LbStyle
.
GetSelectEntryPos
()
==
0
)
if
(
r
LbStyle
.
GetSelectEntryPos
()
==
0
)
{
// call new style dialog
SfxUInt16Item
aFamilyItem
(
SID_STYLE_FAMILY
,
SFX_STYLE_FAMILY_PARA
);
...
...
@@ -430,26 +432,32 @@ IMPL_LINK_NOARG(ScConditionFrmtEntry, StyleSelectHdl)
// Find the new style and add it into the style list boxes
rtl
::
OUString
aNewStyle
;
SfxStyleSheetIterator
aStyleIter
(
m
pDoc
->
GetStyleSheetPool
(),
SFX_STYLE_FAMILY_PARA
);
SfxStyleSheetIterator
aStyleIter
(
pDoc
->
GetStyleSheetPool
(),
SFX_STYLE_FAMILY_PARA
);
for
(
SfxStyleSheetBase
*
pStyle
=
aStyleIter
.
First
();
pStyle
;
pStyle
=
aStyleIter
.
Next
()
)
{
rtl
::
OUString
aName
=
pStyle
->
GetName
();
if
(
ma
LbStyle
.
GetEntryPos
(
aName
)
==
LISTBOX_ENTRY_NOTFOUND
)
// all lists contain the same entries
if
(
r
LbStyle
.
GetEntryPos
(
aName
)
==
LISTBOX_ENTRY_NOTFOUND
)
// all lists contain the same entries
{
ma
LbStyle
.
InsertEntry
(
aName
);
ma
LbStyle
.
SelectEntry
(
aName
);
r
LbStyle
.
InsertEntry
(
aName
);
r
LbStyle
.
SelectEntry
(
aName
);
}
}
}
rtl
::
OUString
aStyleName
=
ma
LbStyle
.
GetSelectEntry
();
SfxStyleSheetBase
*
pStyleSheet
=
m
pDoc
->
GetStyleSheetPool
()
->
Find
(
aStyleName
,
SFX_STYLE_FAMILY_PARA
);
rtl
::
OUString
aStyleName
=
r
LbStyle
.
GetSelectEntry
();
SfxStyleSheetBase
*
pStyleSheet
=
pDoc
->
GetStyleSheetPool
()
->
Find
(
aStyleName
,
SFX_STYLE_FAMILY_PARA
);
if
(
pStyleSheet
)
{
const
SfxItemSet
&
rSet
=
pStyleSheet
->
GetItemSet
();
ma
WdPreview
.
Init
(
rSet
);
r
WdPreview
.
Init
(
rSet
);
}
}
}
IMPL_LINK_NOARG
(
ScConditionFrmtEntry
,
StyleSelectHdl
)
{
StyleSelect
(
maLbStyle
,
mpDoc
,
maWdPreview
);
return
0
;
}
...
...
@@ -495,51 +503,7 @@ void ScFormulaFrmtEntry::Init()
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
);
}
StyleSelect
(
maLbStyle
,
mpDoc
,
maWdPreview
);
return
0
;
}
...
...
@@ -1169,4 +1133,75 @@ IMPL_LINK_NOARG( ScDataBarFrmtEntry, OptionBtnHdl )
return
0
;
}
ScDateFrmtEntry
::
ScDateFrmtEntry
(
Window
*
pParent
,
ScDocument
*
pDoc
,
const
ScCondDateFormatEntry
*
pFormat
)
:
ScCondFrmtEntry
(
pParent
,
pDoc
,
ScAddress
()
),
maLbDateEntry
(
this
,
ScResId
(
LB_DATE_TYPE
)
),
maFtStyle
(
this
,
ScResId
(
FT_STYLE
)
),
maLbStyle
(
this
,
ScResId
(
LB_STYLE
)
),
maWdPreview
(
this
,
ScResId
(
WD_PREVIEW
)
)
{
Init
();
FreeResource
();
if
(
pFormat
)
{
sal_Int32
nPos
=
static_cast
<
sal_Int32
>
(
pFormat
->
GetDateType
());
maLbDateEntry
.
SelectEntryPos
(
nPos
);
}
}
void
ScDateFrmtEntry
::
Init
()
{
maLbDateEntry
.
SelectEntryPos
(
0
);
maLbType
.
SelectEntryPos
(
3
);
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
,
ScDateFrmtEntry
,
StyleSelectHdl
)
);
}
void
ScDateFrmtEntry
::
SetActive
()
{
maLbDateEntry
.
Show
();
maFtStyle
.
Show
();
maWdPreview
.
Show
();
Select
();
}
void
ScDateFrmtEntry
::
SetInactive
()
{
maLbDateEntry
.
Show
();
maFtStyle
.
Show
();
maWdPreview
.
Show
();
Deselect
();
}
ScFormatEntry
*
ScDateFrmtEntry
::
GetEntry
()
const
{
ScCondDateFormatEntry
*
pNewEntry
=
new
ScCondDateFormatEntry
(
mpDoc
);
condformat
::
ScCondFormatDateType
eType
=
static_cast
<
condformat
::
ScCondFormatDateType
>
(
maLbDateEntry
.
GetSelectEntryPos
());
pNewEntry
->
SetDateType
(
eType
);
pNewEntry
->
SetStyleName
(
maLbStyle
.
GetSelectEntry
());
return
pNewEntry
;
}
rtl
::
OUString
ScDateFrmtEntry
::
GetExpressionString
()
{
return
ScCondFormatHelper
::
GetExpression
(
DATE
,
0
);
}
IMPL_LINK_NOARG
(
ScDateFrmtEntry
,
StyleSelectHdl
)
{
StyleSelect
(
maLbStyle
,
mpDoc
,
maWdPreview
);
return
0
;
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
sc/source/ui/condformat/condformathelper.cxx
Dosyayı görüntüle @
29206b09
...
...
@@ -27,6 +27,8 @@ rtl::OUString getTextForType(ScCondFormatEntryType eType)
return
ScGlobal
::
GetRscString
(
STR_COND_FORMULA
);
case
ICONSET
:
return
ScGlobal
::
GetRscString
(
STR_COND_ICONSET
);
case
DATE
:
return
ScGlobal
::
GetRscString
(
STR_COND_DATE
);
default
:
break
;
}
...
...
@@ -136,6 +138,9 @@ rtl::OUString ScCondFormatHelper::GetExpression(const ScConditionalFormat& rForm
case
condformat
:
:
ICONSET
:
aBuffer
.
append
(
getTextForType
(
ICONSET
));
break
;
case
condformat
:
:
DATE
:
aBuffer
.
append
(
getTextForType
(
DATE
));
break
;
}
}
return
aBuffer
.
makeStringAndClear
();
...
...
sc/source/ui/inc/condformatdlg.hrc
Dosyayı görüntüle @
29206b09
...
...
@@ -67,4 +67,6 @@
#define LB_TYPE_COL_SCALE_MIN 42
#define LB_TYPE_COL_SCALE_MIDDLE 43
#define LB_TYPE_COL_SCALE_MAX 44
#define LB_DATE_TYPE 45
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
sc/source/ui/inc/condformatdlgentry.hxx
Dosyayı görüntüle @
29206b09
...
...
@@ -21,7 +21,8 @@ enum ScCondFrmtEntryType
FORMULA
,
COLORSCALE2
,
COLORSCALE3
,
DATABAR
DATABAR
,
DATE
};
}
...
...
@@ -74,7 +75,6 @@ public:
class
ScConditionFrmtEntry
:
public
ScCondFrmtEntry
{
//cond format ui elements
ListBox
maLbCondType
;
formula
::
RefEdit
maEdVal1
;
...
...
@@ -216,4 +216,27 @@ public:
virtual
condformat
::
entry
::
ScCondFrmtEntryType
GetType
()
{
return
condformat
::
entry
::
DATABAR
;
}
};
class
ScDateFrmtEntry
:
public
ScCondFrmtEntry
{
public
:
ScDateFrmtEntry
(
Window
*
pParent
,
ScDocument
*
pDoc
,
const
ScCondDateFormatEntry
*
pFormat
=
NULL
);
virtual
ScFormatEntry
*
GetEntry
()
const
;
virtual
void
SetActive
();
virtual
void
SetInactive
();
virtual
condformat
::
entry
::
ScCondFrmtEntryType
GetType
()
{
return
condformat
::
entry
::
DATE
;
}
protected
:
virtual
rtl
::
OUString
GetExpressionString
();
private
:
void
Init
();
DECL_LINK
(
StyleSelectHdl
,
void
*
);
ListBox
maLbDateEntry
;
FixedText
maFtStyle
;
ListBox
maLbStyle
;
SvxFontPrevWindow
maWdPreview
;
};
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
sc/source/ui/inc/condformathelper.hxx
Dosyayı görüntüle @
29206b09
...
...
@@ -19,7 +19,8 @@ enum ScCondFormatEntryType
DATABAR
,
FORMULA
,
ICONSET
,
COLLAPSED
DATE
,
COLLAPSE
};
class
ScCondFormatHelper
...
...
sc/source/ui/src/condformatdlg.src
Dosyayı görüntüle @
29206b09
...
...
@@ -121,6 +121,7 @@ Control RID_COND_ENTRY
"All Cells";
"Cell value is";
"Formula is";
"Date is";
};
};
ListBox LB_CELLIS_TYPE
...
...
@@ -309,6 +310,30 @@ Control RID_COND_ENTRY
Size = MAP_APPFONT( 60, 14 );
Text [ en-US ] = "More options ...";
};
ListBox LB_DATE_TYPE
{
Pos = MAP_APPFONT( 100, 15 );
Size = MAP_APPFONT( 100, 60 );
Border = TRUE;
DropDown = TRUE;
DDExtraWidth = TRUE;
StringList [ en-US ] =
{
"Today";
"Yesterday";
"Tomorrow";
"Last 7 days";
"This week";
"Last week";
"Next week";
"This month";
"Last month";
"Next month";
"This year";
"Last year";
"Next year";
};
};
};
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
sc/source/ui/src/globstr.src
Dosyayı görüntüle @
29206b09
...
...
@@ -1911,6 +1911,10 @@ Resource RID_GLOBSTR
{
Text [ en-US ] = "Top Percent";
};
String STR_COND_DATE
{
Text [ en-US ] = "Date is";
};
String STR_COND_BOTTOM_PERCENT
{
Text [ en-US ] = "Bottom Percent";
...
...
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