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
c6ac33db
Kaydet (Commit)
c6ac33db
authored
Tem 21, 2015
tarafından
Markus Mohrhard
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
extract some code for reuse by chart2 sidebar
Change-Id: I44e2378dafa66f53588027cca56dc52cb4cec794
üst
ab0c81c0
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
112 additions
and
82 deletions
+112
-82
AreaPropertyPanelBase.hxx
include/svx/sidebar/AreaPropertyPanelBase.hxx
+8
-0
AreaPropertyPanelBase.cxx
svx/source/sidebar/area/AreaPropertyPanelBase.cxx
+104
-82
No files found.
include/svx/sidebar/AreaPropertyPanelBase.hxx
Dosyayı görüntüle @
c6ac33db
...
@@ -97,6 +97,14 @@ public:
...
@@ -97,6 +97,14 @@ public:
virtual
void
setFillStyleAndHatch
(
const
XFillStyleItem
*
pStyleItem
,
const
XFillHatchItem
&
aHatchItem
)
=
0
;
virtual
void
setFillStyleAndHatch
(
const
XFillStyleItem
*
pStyleItem
,
const
XFillHatchItem
&
aHatchItem
)
=
0
;
virtual
void
setFillStyleAndBitmap
(
const
XFillStyleItem
*
pStyleItem
,
const
XFillBitmapItem
&
aHatchItem
)
=
0
;
virtual
void
setFillStyleAndBitmap
(
const
XFillStyleItem
*
pStyleItem
,
const
XFillBitmapItem
&
aHatchItem
)
=
0
;
void
updateFillTransparence
(
bool
bDisabled
,
bool
bDefault
,
const
SfxUInt16Item
*
pItem
);
void
updateFillFloatTransparence
(
bool
bDisabled
,
bool
bDefault
,
const
XFillFloatTransparenceItem
*
pItem
);
void
updateFillStyle
(
bool
bDisabled
,
bool
bDefault
,
const
XFillStyleItem
*
pItem
);
void
updateFillGradient
(
bool
bDisabled
,
bool
bDefault
,
const
XFillGradientItem
*
pItem
);
void
updateFillHatch
(
bool
bDisabled
,
bool
bDefault
,
const
XFillHatchItem
*
pItem
);
void
updateFillColor
(
bool
bDefault
,
const
XFillColorItem
*
pItem
);
void
updateFillBitmap
(
bool
BDisabled
,
bool
bDefault
,
const
XFillBitmapItem
*
pItem
);
protected
:
protected
:
sal_uInt16
meLastXFS
;
sal_uInt16
meLastXFS
;
...
...
svx/source/sidebar/area/AreaPropertyPanelBase.cxx
Dosyayı görüntüle @
c6ac33db
...
@@ -592,29 +592,15 @@ void AreaPropertyPanelBase::ImpUpdateTransparencies()
...
@@ -592,29 +592,15 @@ void AreaPropertyPanelBase::ImpUpdateTransparencies()
}
}
}
}
void
AreaPropertyPanelBase
::
NotifyItemUpdate
(
void
AreaPropertyPanelBase
::
updateFillTransparence
(
bool
bDisabled
,
bool
bDefault
,
const
SfxUInt16Item
*
pItem
)
sal_uInt16
nSID
,
SfxItemState
eState
,
const
SfxPoolItem
*
pState
,
const
bool
/*bIsEnabled*/
)
{
{
const
bool
bDisabled
(
SfxItemState
::
DISABLED
==
eState
);
if
(
bDisabled
)
switch
(
nSID
)
{
case
SID_ATTR_FILL_TRANSPARENCE
:
case
SID_ATTR_FILL_FLOATTRANSPARENCE
:
{
{
bool
bFillTransparenceChanged
(
false
);
mpTransparanceItem
.
reset
();
return
;
if
(
SID_ATTR_FILL_TRANSPARENCE
==
nSID
)
}
{
else
if
(
bDefault
)
bFillTransparenceChanged
=
true
;
if
(
eState
>=
SfxItemState
::
DEFAULT
)
{
{
const
SfxUInt16Item
*
pItem
=
dynamic_cast
<
const
SfxUInt16Item
*
>
(
pState
);
if
(
pItem
&&
(
!
mpTransparanceItem
||
*
pItem
!=
*
mpTransparanceItem
))
if
(
pItem
&&
(
!
mpTransparanceItem
||
*
pItem
!=
*
mpTransparanceItem
))
{
{
mpTransparanceItem
.
reset
(
static_cast
<
SfxUInt16Item
*>
(
pItem
->
Clone
()));
mpTransparanceItem
.
reset
(
static_cast
<
SfxUInt16Item
*>
(
pItem
->
Clone
()));
...
@@ -628,15 +614,21 @@ void AreaPropertyPanelBase::NotifyItemUpdate(
...
@@ -628,15 +614,21 @@ void AreaPropertyPanelBase::NotifyItemUpdate(
{
{
mpTransparanceItem
.
reset
();
mpTransparanceItem
.
reset
();
}
}
}
else
// if(SID_ATTR_FILL_FLOATTRANSPARENCE == nSID)
{
bFillTransparenceChanged
=
true
;
if
(
eState
>=
SfxItemState
::
DEFAULT
)
// update transparency settings dependent of mpTransparanceItem and mpFloatTransparenceItem
ImpUpdateTransparencies
();
}
void
AreaPropertyPanelBase
::
updateFillFloatTransparence
(
bool
bDisabled
,
bool
bDefault
,
const
XFillFloatTransparenceItem
*
pItem
)
{
if
(
bDisabled
)
{
{
const
XFillFloatTransparenceItem
*
pItem
=
dynamic_cast
<
const
XFillFloatTransparenceItem
*
>
(
pState
);
mpFloatTransparenceItem
.
reset
();
return
;
}
if
(
bDefault
)
{
if
(
pItem
&&
(
!
mpFloatTransparenceItem
||
*
pItem
!=
*
mpFloatTransparenceItem
))
if
(
pItem
&&
(
!
mpFloatTransparenceItem
||
*
pItem
!=
*
mpFloatTransparenceItem
))
{
{
mpFloatTransparenceItem
.
reset
(
static_cast
<
XFillFloatTransparenceItem
*>
(
pItem
->
Clone
()));
mpFloatTransparenceItem
.
reset
(
static_cast
<
XFillFloatTransparenceItem
*>
(
pItem
->
Clone
()));
...
@@ -650,17 +642,13 @@ void AreaPropertyPanelBase::NotifyItemUpdate(
...
@@ -650,17 +642,13 @@ void AreaPropertyPanelBase::NotifyItemUpdate(
{
{
mpFloatTransparenceItem
.
reset
();
mpFloatTransparenceItem
.
reset
();
}
}
}
if
(
bFillTransparenceChanged
)
{
// update transparency settings dependent of mpTransparanceItem and mpFloatTransparenceItem
// update transparency settings dependent of mpTransparanceItem and mpFloatTransparenceItem
ImpUpdateTransparencies
();
ImpUpdateTransparencies
();
}
}
break
;
}
void
AreaPropertyPanelBase
::
updateFillStyle
(
bool
bDisabled
,
bool
bDefault
,
const
XFillStyleItem
*
pItem
)
case
SID_ATTR_FILL_STYLE
:
{
{
if
(
bDisabled
)
if
(
bDisabled
)
{
{
mpLbFillType
->
Disable
();
mpLbFillType
->
Disable
();
...
@@ -673,11 +661,7 @@ void AreaPropertyPanelBase::NotifyItemUpdate(
...
@@ -673,11 +661,7 @@ void AreaPropertyPanelBase::NotifyItemUpdate(
meLastXFS
=
static_cast
<
sal_uInt16
>
(
-
1
);
meLastXFS
=
static_cast
<
sal_uInt16
>
(
-
1
);
mpStyleItem
.
reset
();
mpStyleItem
.
reset
();
}
}
else
if
(
eState
>=
SfxItemState
::
DEFAULT
)
else
if
(
bDefault
&&
pItem
)
{
const
XFillStyleItem
*
pItem
=
dynamic_cast
<
const
XFillStyleItem
*
>
(
pState
);
if
(
pItem
)
{
{
mpStyleItem
.
reset
(
dynamic_cast
<
XFillStyleItem
*
>
(
pItem
->
Clone
()));
mpStyleItem
.
reset
(
dynamic_cast
<
XFillStyleItem
*
>
(
pItem
->
Clone
()));
mpLbFillType
->
Enable
();
mpLbFillType
->
Enable
();
...
@@ -693,8 +677,7 @@ void AreaPropertyPanelBase::NotifyItemUpdate(
...
@@ -693,8 +677,7 @@ void AreaPropertyPanelBase::NotifyItemUpdate(
}
}
Update
();
Update
();
break
;
return
;
}
}
}
mpLbFillType
->
SetNoSelection
();
mpLbFillType
->
SetNoSelection
();
...
@@ -704,29 +687,13 @@ void AreaPropertyPanelBase::NotifyItemUpdate(
...
@@ -704,29 +687,13 @@ void AreaPropertyPanelBase::NotifyItemUpdate(
mpToolBoxColor
->
Hide
();
mpToolBoxColor
->
Hide
();
meLastXFS
=
static_cast
<
sal_uInt16
>
(
-
1
);
meLastXFS
=
static_cast
<
sal_uInt16
>
(
-
1
);
mpStyleItem
.
reset
();
mpStyleItem
.
reset
();
break
;
}
}
case
SID_ATTR_FILL_COLOR
:
{
if
(
SfxItemState
::
DEFAULT
==
eState
)
{
mpColorItem
.
reset
(
pState
?
static_cast
<
XFillColorItem
*>
(
pState
->
Clone
())
:
0
);
}
if
(
mpStyleItem
&&
drawing
::
FillStyle_SOLID
==
(
drawing
::
FillStyle
)
mpStyleItem
->
GetValue
())
{
mpLbFillAttr
->
Hide
();
mpToolBoxColor
->
Show
();
Update
();
void
AreaPropertyPanelBase
::
updateFillGradient
(
bool
bDisabled
,
bool
bDefault
,
const
XFillGradientItem
*
pItem
)
}
{
break
;
if
(
bDefault
)
}
case
SID_ATTR_FILL_GRADIENT
:
{
if
(
SfxItemState
::
DEFAULT
==
eState
)
{
{
mpFillGradientItem
.
reset
(
pState
?
static_cast
<
XFillGradientItem
*>
(
pState
->
Clone
())
:
0
);
mpFillGradientItem
.
reset
(
pItem
?
static_cast
<
XFillGradientItem
*>
(
pItem
->
Clone
())
:
0
);
}
}
if
(
mpStyleItem
&&
drawing
::
FillStyle_GRADIENT
==
(
drawing
::
FillStyle
)
mpStyleItem
->
GetValue
())
if
(
mpStyleItem
&&
drawing
::
FillStyle_GRADIENT
==
(
drawing
::
FillStyle
)
mpStyleItem
->
GetValue
())
...
@@ -734,12 +701,12 @@ void AreaPropertyPanelBase::NotifyItemUpdate(
...
@@ -734,12 +701,12 @@ void AreaPropertyPanelBase::NotifyItemUpdate(
mpLbFillAttr
->
Show
();
mpLbFillAttr
->
Show
();
mpToolBoxColor
->
Hide
();
mpToolBoxColor
->
Hide
();
if
(
SfxItemState
::
DEFAULT
==
eState
)
if
(
bDefault
)
{
{
mpLbFillAttr
->
Enable
();
mpLbFillAttr
->
Enable
();
Update
();
Update
();
}
}
else
if
(
SfxItemState
::
DISABLED
==
eState
)
else
if
(
bDisabled
)
{
{
mpLbFillAttr
->
Disable
();
mpLbFillAttr
->
Disable
();
mpLbFillAttr
->
SetNoSelection
();
mpLbFillAttr
->
SetNoSelection
();
...
@@ -749,13 +716,13 @@ void AreaPropertyPanelBase::NotifyItemUpdate(
...
@@ -749,13 +716,13 @@ void AreaPropertyPanelBase::NotifyItemUpdate(
mpLbFillAttr
->
SetNoSelection
();
mpLbFillAttr
->
SetNoSelection
();
}
}
}
}
break
;
}
}
case
SID_ATTR_FILL_HATCH
:
void
AreaPropertyPanelBase
::
updateFillHatch
(
bool
bDisabled
,
bool
bDefault
,
const
XFillHatchItem
*
pItem
)
{
{
if
(
SfxItemState
::
DEFAULT
==
eState
)
if
(
bDefault
)
{
{
mpHatchItem
.
reset
(
pState
?
static_cast
<
XFillHatchItem
*>
(
pState
->
Clone
())
:
0
);
mpHatchItem
.
reset
(
pItem
?
static_cast
<
XFillHatchItem
*>
(
pItem
->
Clone
())
:
0
);
}
}
if
(
mpStyleItem
&&
drawing
::
FillStyle_HATCH
==
(
drawing
::
FillStyle
)
mpStyleItem
->
GetValue
())
if
(
mpStyleItem
&&
drawing
::
FillStyle_HATCH
==
(
drawing
::
FillStyle
)
mpStyleItem
->
GetValue
())
...
@@ -763,12 +730,12 @@ void AreaPropertyPanelBase::NotifyItemUpdate(
...
@@ -763,12 +730,12 @@ void AreaPropertyPanelBase::NotifyItemUpdate(
mpLbFillAttr
->
Show
();
mpLbFillAttr
->
Show
();
mpToolBoxColor
->
Hide
();
mpToolBoxColor
->
Hide
();
if
(
SfxItemState
::
DEFAULT
==
eState
)
if
(
bDefault
)
{
{
mpLbFillAttr
->
Enable
();
mpLbFillAttr
->
Enable
();
Update
();
Update
();
}
}
else
if
(
SfxItemState
::
DISABLED
==
eState
)
else
if
(
bDisabled
)
{
{
mpLbFillAttr
->
Disable
();
mpLbFillAttr
->
Disable
();
mpLbFillAttr
->
SetNoSelection
();
mpLbFillAttr
->
SetNoSelection
();
...
@@ -778,13 +745,29 @@ void AreaPropertyPanelBase::NotifyItemUpdate(
...
@@ -778,13 +745,29 @@ void AreaPropertyPanelBase::NotifyItemUpdate(
mpLbFillAttr
->
SetNoSelection
();
mpLbFillAttr
->
SetNoSelection
();
}
}
}
}
break
;
}
void
AreaPropertyPanelBase
::
updateFillColor
(
bool
bDefault
,
const
XFillColorItem
*
pItem
)
{
if
(
bDefault
)
{
mpColorItem
.
reset
(
pItem
?
static_cast
<
XFillColorItem
*>
(
pItem
->
Clone
())
:
0
);
}
}
case
SID_ATTR_FILL_BITMAP
:
if
(
mpStyleItem
&&
drawing
::
FillStyle_SOLID
==
(
drawing
::
FillStyle
)
mpStyleItem
->
GetValue
())
{
{
if
(
SfxItemState
::
DEFAULT
==
eState
)
mpLbFillAttr
->
Hide
();
mpToolBoxColor
->
Show
();
Update
();
}
}
void
AreaPropertyPanelBase
::
updateFillBitmap
(
bool
bDisabled
,
bool
bDefault
,
const
XFillBitmapItem
*
pItem
)
{
if
(
bDefault
)
{
{
mpBitmapItem
.
reset
(
pState
?
static_cast
<
XFillBitmapItem
*>
(
pState
->
Clone
())
:
0
);
mpBitmapItem
.
reset
(
pItem
?
static_cast
<
XFillBitmapItem
*>
(
pItem
->
Clone
())
:
0
);
}
}
if
(
mpStyleItem
&&
drawing
::
FillStyle_BITMAP
==
(
drawing
::
FillStyle
)
mpStyleItem
->
GetValue
())
if
(
mpStyleItem
&&
drawing
::
FillStyle_BITMAP
==
(
drawing
::
FillStyle
)
mpStyleItem
->
GetValue
())
...
@@ -792,12 +775,12 @@ void AreaPropertyPanelBase::NotifyItemUpdate(
...
@@ -792,12 +775,12 @@ void AreaPropertyPanelBase::NotifyItemUpdate(
mpLbFillAttr
->
Show
();
mpLbFillAttr
->
Show
();
mpToolBoxColor
->
Hide
();
mpToolBoxColor
->
Hide
();
if
(
SfxItemState
::
DEFAULT
==
eState
)
if
(
bDefault
)
{
{
mpLbFillAttr
->
Enable
();
mpLbFillAttr
->
Enable
();
Update
();
Update
();
}
}
else
if
(
SfxItemState
::
DISABLED
==
eState
)
else
if
(
bDisabled
)
{
{
mpLbFillAttr
->
Disable
();
mpLbFillAttr
->
Disable
();
mpLbFillAttr
->
SetNoSelection
();
mpLbFillAttr
->
SetNoSelection
();
...
@@ -807,11 +790,50 @@ void AreaPropertyPanelBase::NotifyItemUpdate(
...
@@ -807,11 +790,50 @@ void AreaPropertyPanelBase::NotifyItemUpdate(
mpLbFillAttr
->
SetNoSelection
();
mpLbFillAttr
->
SetNoSelection
();
}
}
}
}
}
void
AreaPropertyPanelBase
::
NotifyItemUpdate
(
sal_uInt16
nSID
,
SfxItemState
eState
,
const
SfxPoolItem
*
pState
,
const
bool
/*bIsEnabled*/
)
{
const
bool
bDisabled
(
SfxItemState
::
DISABLED
==
eState
);
const
bool
bDefault
(
SfxItemState
::
DEFAULT
==
eState
);
switch
(
nSID
)
{
case
SID_ATTR_FILL_TRANSPARENCE
:
updateFillTransparence
(
bDisabled
,
bDefault
,
static_cast
<
const
SfxUInt16Item
*>
(
pState
));
break
;
case
SID_ATTR_FILL_FLOATTRANSPARENCE
:
updateFillFloatTransparence
(
bDisabled
,
bDefault
,
static_cast
<
const
XFillFloatTransparenceItem
*>
(
pState
));
break
;
case
SID_ATTR_FILL_STYLE
:
updateFillStyle
(
bDisabled
,
bDefault
,
static_cast
<
const
XFillStyleItem
*>
(
pState
));
break
;
case
SID_ATTR_FILL_COLOR
:
updateFillColor
(
bDefault
,
static_cast
<
const
XFillColorItem
*>
(
pState
));
break
;
case
SID_ATTR_FILL_GRADIENT
:
updateFillGradient
(
bDisabled
,
bDefault
,
static_cast
<
const
XFillGradientItem
*>
(
pState
));
break
;
case
SID_ATTR_FILL_HATCH
:
updateFillHatch
(
bDisabled
,
bDefault
,
static_cast
<
const
XFillHatchItem
*>
(
pState
));
break
;
case
SID_ATTR_FILL_BITMAP
:
updateFillBitmap
(
bDisabled
,
bDefault
,
static_cast
<
const
XFillBitmapItem
*>
(
pState
));
break
;
break
;
}
case
SID_GRADIENT_LIST
:
case
SID_GRADIENT_LIST
:
{
{
if
(
SfxItemState
::
DEFAULT
==
eState
)
if
(
bDefault
)
{
{
if
(
mpStyleItem
&&
drawing
::
FillStyle_GRADIENT
==
(
drawing
::
FillStyle
)
mpStyleItem
->
GetValue
())
if
(
mpStyleItem
&&
drawing
::
FillStyle_GRADIENT
==
(
drawing
::
FillStyle
)
mpStyleItem
->
GetValue
())
{
{
...
@@ -836,7 +858,7 @@ void AreaPropertyPanelBase::NotifyItemUpdate(
...
@@ -836,7 +858,7 @@ void AreaPropertyPanelBase::NotifyItemUpdate(
}
}
case
SID_HATCH_LIST
:
case
SID_HATCH_LIST
:
{
{
if
(
SfxItemState
::
DEFAULT
==
eState
)
if
(
bDefault
)
{
{
if
(
mpStyleItem
&&
drawing
::
FillStyle_HATCH
==
(
drawing
::
FillStyle
)
mpStyleItem
->
GetValue
())
if
(
mpStyleItem
&&
drawing
::
FillStyle_HATCH
==
(
drawing
::
FillStyle
)
mpStyleItem
->
GetValue
())
{
{
...
@@ -861,7 +883,7 @@ void AreaPropertyPanelBase::NotifyItemUpdate(
...
@@ -861,7 +883,7 @@ void AreaPropertyPanelBase::NotifyItemUpdate(
}
}
case
SID_BITMAP_LIST
:
case
SID_BITMAP_LIST
:
{
{
if
(
SfxItemState
::
DEFAULT
==
eState
)
if
(
bDefault
)
{
{
if
(
mpStyleItem
&&
drawing
::
FillStyle_BITMAP
==
(
drawing
::
FillStyle
)
mpStyleItem
->
GetValue
())
if
(
mpStyleItem
&&
drawing
::
FillStyle_BITMAP
==
(
drawing
::
FillStyle
)
mpStyleItem
->
GetValue
())
{
{
...
...
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