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
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
221 additions
and
191 deletions
+221
-191
AreaPropertyPanelBase.hxx
include/svx/sidebar/AreaPropertyPanelBase.hxx
+8
-0
AreaPropertyPanelBase.cxx
svx/source/sidebar/area/AreaPropertyPanelBase.cxx
+213
-191
No files found.
include/svx/sidebar/AreaPropertyPanelBase.hxx
Dosyayı görüntüle @
c6ac33db
...
...
@@ -97,6 +97,14 @@ public:
virtual
void
setFillStyleAndHatch
(
const
XFillStyleItem
*
pStyleItem
,
const
XFillHatchItem
&
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
:
sal_uInt16
meLastXFS
;
...
...
svx/source/sidebar/area/AreaPropertyPanelBase.cxx
Dosyayı görüntüle @
c6ac33db
...
...
@@ -592,226 +592,248 @@ void AreaPropertyPanelBase::ImpUpdateTransparencies()
}
}
void
AreaPropertyPanelBase
::
NotifyItemUpdate
(
sal_uInt16
nSID
,
SfxItemState
eState
,
const
SfxPoolItem
*
pState
,
const
bool
/*bIsEnabled*/
)
void
AreaPropertyPanelBase
::
updateFillTransparence
(
bool
bDisabled
,
bool
bDefault
,
const
SfxUInt16Item
*
pItem
)
{
const
bool
bDisabled
(
SfxItemState
::
DISABLED
==
eState
);
if
(
bDisabled
)
{
mpTransparanceItem
.
reset
();
return
;
}
else
if
(
bDefault
)
{
if
(
pItem
&&
(
!
mpTransparanceItem
||
*
pItem
!=
*
mpTransparanceItem
))
{
mpTransparanceItem
.
reset
(
static_cast
<
SfxUInt16Item
*>
(
pItem
->
Clone
()));
}
else
{
mpTransparanceItem
.
reset
();
}
}
else
{
mpTransparanceItem
.
reset
();
}
switch
(
nSID
)
// update transparency settings dependent of mpTransparanceItem and mpFloatTransparenceItem
ImpUpdateTransparencies
();
}
void
AreaPropertyPanelBase
::
updateFillFloatTransparence
(
bool
bDisabled
,
bool
bDefault
,
const
XFillFloatTransparenceItem
*
pItem
)
{
if
(
bDisabled
)
{
case
SID_ATTR_FILL_TRANSPARENCE
:
case
SID_ATTR_FILL_FLOATTRANSPARENCE
:
mpFloatTransparenceItem
.
reset
();
return
;
}
if
(
bDefault
)
{
if
(
pItem
&&
(
!
mpFloatTransparenceItem
||
*
pItem
!=
*
mpFloatTransparenceItem
))
{
mpFloatTransparenceItem
.
reset
(
static_cast
<
XFillFloatTransparenceItem
*>
(
pItem
->
Clone
()));
}
else
{
bool
bFillTransparenceChanged
(
false
);
mpFloatTransparenceItem
.
reset
();
}
}
else
{
mpFloatTransparenceItem
.
reset
();
}
if
(
SID_ATTR_FILL_TRANSPARENCE
==
nSID
)
{
bFillTransparenceChanged
=
true
;
// update transparency settings dependent of mpTransparanceItem and mpFloatTransparenceItem
ImpUpdateTransparencies
();
}
if
(
eState
>=
SfxItemState
::
DEFAULT
)
{
const
SfxUInt16Item
*
pItem
=
dynamic_cast
<
const
SfxUInt16Item
*
>
(
pState
);
void
AreaPropertyPanelBase
::
updateFillStyle
(
bool
bDisabled
,
bool
bDefault
,
const
XFillStyleItem
*
pItem
)
{
if
(
bDisabled
)
{
mpLbFillType
->
Disable
();
mpColorTextFT
->
Disable
();
mpLbFillType
->
SetNoSelection
();
mpLbFillAttr
->
Show
();
mpLbFillAttr
->
Disable
();
mpLbFillAttr
->
SetNoSelection
();
mpToolBoxColor
->
Hide
();
meLastXFS
=
static_cast
<
sal_uInt16
>
(
-
1
);
mpStyleItem
.
reset
();
}
else
if
(
bDefault
&&
pItem
)
{
mpStyleItem
.
reset
(
dynamic_cast
<
XFillStyleItem
*
>
(
pItem
->
Clone
()));
mpLbFillType
->
Enable
();
mpColorTextFT
->
Enable
();
drawing
::
FillStyle
eXFS
=
(
drawing
::
FillStyle
)
mpStyleItem
->
GetValue
();
meLastXFS
=
eXFS
;
mpLbFillType
->
SelectEntryPos
(
sal
::
static_int_cast
<
sal_Int32
>
(
eXFS
));
if
(
drawing
::
FillStyle_NONE
==
eXFS
)
{
mpLbFillAttr
->
SetNoSelection
();
mpLbFillAttr
->
Disable
();
}
if
(
pItem
&&
(
!
mpTransparanceItem
||
*
pItem
!=
*
mpTransparanceItem
))
{
mpTransparanceItem
.
reset
(
static_cast
<
SfxUInt16Item
*>
(
pItem
->
Clone
()));
}
else
{
mpTransparanceItem
.
reset
();
}
}
else
{
mpTransparanceItem
.
reset
();
}
}
else
// if(SID_ATTR_FILL_FLOATTRANSPARENCE == nSID)
{
bFillTransparenceChanged
=
true
;
Update
();
return
;
}
if
(
eState
>=
SfxItemState
::
DEFAULT
)
{
const
XFillFloatTransparenceItem
*
pItem
=
dynamic_cast
<
const
XFillFloatTransparenceItem
*
>
(
pState
);
mpLbFillType
->
SetNoSelection
();
mpLbFillAttr
->
Show
();
mpLbFillAttr
->
Disable
();
mpLbFillAttr
->
SetNoSelection
();
mpToolBoxColor
->
Hide
();
meLastXFS
=
static_cast
<
sal_uInt16
>
(
-
1
);
mpStyleItem
.
reset
();
}
if
(
pItem
&&
(
!
mpFloatTransparenceItem
||
*
pItem
!=
*
mpFloatTransparenceItem
))
{
mpFloatTransparenceItem
.
reset
(
static_cast
<
XFillFloatTransparenceItem
*>
(
pItem
->
Clone
()));
}
else
{
mpFloatTransparenceItem
.
reset
();
}
}
else
{
mpFloatTransparenceItem
.
reset
();
}
}
void
AreaPropertyPanelBase
::
updateFillGradient
(
bool
bDisabled
,
bool
bDefault
,
const
XFillGradientItem
*
pItem
)
{
if
(
bDefault
)
{
mpFillGradientItem
.
reset
(
pItem
?
static_cast
<
XFillGradientItem
*>
(
pItem
->
Clone
())
:
0
);
}
if
(
bFillTransparenceChanged
)
{
// update transparency settings dependent of mpTransparanceItem and mpFloatTransparenceItem
ImpUpdateTransparencies
();
}
break
;
if
(
mpStyleItem
&&
drawing
::
FillStyle_GRADIENT
==
(
drawing
::
FillStyle
)
mpStyleItem
->
GetValue
())
{
mpLbFillAttr
->
Show
();
mpToolBoxColor
->
Hide
();
if
(
bDefault
)
{
mpLbFillAttr
->
Enable
();
Update
();
}
case
SID_ATTR_FILL_STYLE
:
else
if
(
bDisabled
)
{
if
(
bDisabled
)
{
mpLbFillType
->
Disable
();
mpColorTextFT
->
Disable
();
mpLbFillType
->
SetNoSelection
();
mpLbFillAttr
->
Show
();
mpLbFillAttr
->
Disable
();
mpLbFillAttr
->
SetNoSelection
();
mpToolBoxColor
->
Hide
();
meLastXFS
=
static_cast
<
sal_uInt16
>
(
-
1
);
mpStyleItem
.
reset
();
}
else
if
(
eState
>=
SfxItemState
::
DEFAULT
)
{
const
XFillStyleItem
*
pItem
=
dynamic_cast
<
const
XFillStyleItem
*
>
(
pState
);
mpLbFillAttr
->
Disable
();
mpLbFillAttr
->
SetNoSelection
();
}
else
{
mpLbFillAttr
->
SetNoSelection
();
}
}
}
if
(
pItem
)
{
mpStyleItem
.
reset
(
dynamic_cast
<
XFillStyleItem
*
>
(
pItem
->
Clone
()));
mpLbFillType
->
Enable
();
mpColorTextFT
->
Enable
();
drawing
::
FillStyle
eXFS
=
(
drawing
::
FillStyle
)
mpStyleItem
->
GetValue
();
meLastXFS
=
eXFS
;
mpLbFillType
->
SelectEntryPos
(
sal
::
static_int_cast
<
sal_Int32
>
(
eXFS
));
if
(
drawing
::
FillStyle_NONE
==
eXFS
)
{
mpLbFillAttr
->
SetNoSelection
();
mpLbFillAttr
->
Disable
();
}
void
AreaPropertyPanelBase
::
updateFillHatch
(
bool
bDisabled
,
bool
bDefault
,
const
XFillHatchItem
*
pItem
)
{
if
(
bDefault
)
{
mpHatchItem
.
reset
(
pItem
?
static_cast
<
XFillHatchItem
*>
(
pItem
->
Clone
())
:
0
);
}
Update
();
break
;
}
}
if
(
mpStyleItem
&&
drawing
::
FillStyle_HATCH
==
(
drawing
::
FillStyle
)
mpStyleItem
->
GetValue
())
{
mpLbFillAttr
->
Show
();
mpToolBoxColor
->
Hide
();
mpLbFillType
->
SetNoSelection
();
mpLbFillAttr
->
Show
();
if
(
bDefault
)
{
mpLbFillAttr
->
Enable
();
Update
();
}
else
if
(
bDisabled
)
{
mpLbFillAttr
->
Disable
();
mpLbFillAttr
->
SetNoSelection
();
mpToolBoxColor
->
Hide
();
meLastXFS
=
static_cast
<
sal_uInt16
>
(
-
1
);
mpStyleItem
.
reset
();
break
;
}
case
SID_ATTR_FILL_COLOR
:
else
{
if
(
SfxItemState
::
DEFAULT
==
eState
)
{
mpColorItem
.
reset
(
pState
?
static_cast
<
XFillColorItem
*>
(
pState
->
Clone
())
:
0
);
}
mpLbFillAttr
->
SetNoSelection
();
}
}
}
if
(
mpStyleItem
&&
drawing
::
FillStyle_SOLID
==
(
drawing
::
FillStyle
)
mpStyleItem
->
GetValue
())
{
mpLbFillAttr
->
Hide
();
mpToolBoxColor
->
Show
();
void
AreaPropertyPanelBase
::
updateFillColor
(
bool
bDefault
,
const
XFillColorItem
*
pItem
)
{
if
(
bDefault
)
{
mpColorItem
.
reset
(
pItem
?
static_cast
<
XFillColorItem
*>
(
pItem
->
Clone
())
:
0
);
}
Update
();
}
break
;
}
case
SID_ATTR_FILL_GRADIENT
:
{
if
(
SfxItemState
::
DEFAULT
==
eState
)
{
mpFillGradientItem
.
reset
(
pState
?
static_cast
<
XFillGradientItem
*>
(
pState
->
Clone
())
:
0
);
}
if
(
mpStyleItem
&&
drawing
::
FillStyle_SOLID
==
(
drawing
::
FillStyle
)
mpStyleItem
->
GetValue
())
{
mpLbFillAttr
->
Hide
();
mpToolBoxColor
->
Show
();
if
(
mpStyleItem
&&
drawing
::
FillStyle_GRADIENT
==
(
drawing
::
FillStyle
)
mpStyleItem
->
GetValue
())
{
mpLbFillAttr
->
Show
();
mpToolBoxColor
->
Hide
();
Update
();
}
}
if
(
SfxItemState
::
DEFAULT
==
eState
)
{
mpLbFillAttr
->
Enable
();
Update
();
}
else
if
(
SfxItemState
::
DISABLED
==
eState
)
{
mpLbFillAttr
->
Disable
();
mpLbFillAttr
->
SetNoSelection
();
}
else
{
mpLbFillAttr
->
SetNoSelection
();
}
}
break
;
}
case
SID_ATTR_FILL_HATCH
:
{
if
(
SfxItemState
::
DEFAULT
==
eState
)
{
mpHatchItem
.
reset
(
pState
?
static_cast
<
XFillHatchItem
*>
(
pState
->
Clone
())
:
0
);
}
void
AreaPropertyPanelBase
::
updateFillBitmap
(
bool
bDisabled
,
bool
bDefault
,
const
XFillBitmapItem
*
pItem
)
{
if
(
bDefault
)
{
mpBitmapItem
.
reset
(
pItem
?
static_cast
<
XFillBitmapItem
*>
(
pItem
->
Clone
())
:
0
);
}
if
(
mpStyleItem
&&
drawing
::
FillStyle_HATCH
==
(
drawing
::
FillStyle
)
mpStyleItem
->
GetValue
())
{
mpLbFillAttr
->
Show
();
mpToolBoxColor
->
Hide
();
if
(
mpStyleItem
&&
drawing
::
FillStyle_BITMAP
==
(
drawing
::
FillStyle
)
mpStyleItem
->
GetValue
())
{
mpLbFillAttr
->
Show
();
mpToolBoxColor
->
Hide
();
if
(
SfxItemState
::
DEFAULT
==
eState
)
{
mpLbFillAttr
->
Enable
();
Update
();
}
else
if
(
SfxItemState
::
DISABLED
==
eState
)
{
mpLbFillAttr
->
Disable
();
mpLbFillAttr
->
SetNoSelection
();
}
else
{
mpLbFillAttr
->
SetNoSelection
();
}
}
break
;
if
(
bDefault
)
{
mpLbFillAttr
->
Enable
();
Update
();
}
case
SID_ATTR_FILL_BITMAP
:
else
if
(
bDisabled
)
{
if
(
SfxItemState
::
DEFAULT
==
eState
)
{
mpBitmapItem
.
reset
(
pState
?
static_cast
<
XFillBitmapItem
*>
(
pState
->
Clone
())
:
0
);
}
mpLbFillAttr
->
Disable
();
mpLbFillAttr
->
SetNoSelection
();
}
else
{
mpLbFillAttr
->
SetNoSelection
();
}
}
}
if
(
mpStyleItem
&&
drawing
::
FillStyle_BITMAP
==
(
drawing
::
FillStyle
)
mpStyleItem
->
GetValue
())
{
mpLbFillAttr
->
Show
();
mpToolBoxColor
->
Hide
();
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
);
if
(
SfxItemState
::
DEFAULT
==
eState
)
{
mpLbFillAttr
->
Enable
();
Update
();
}
else
if
(
SfxItemState
::
DISABLED
==
eState
)
{
mpLbFillAttr
->
Disable
();
mpLbFillAttr
->
SetNoSelection
();
}
else
{
mpLbFillAttr
->
SetNoSelection
();
}
}
break
;
}
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
;
case
SID_GRADIENT_LIST
:
{
if
(
SfxItemState
::
DEFAULT
==
eState
)
if
(
bDefault
)
{
if
(
mpStyleItem
&&
drawing
::
FillStyle_GRADIENT
==
(
drawing
::
FillStyle
)
mpStyleItem
->
GetValue
())
{
...
...
@@ -836,7 +858,7 @@ void AreaPropertyPanelBase::NotifyItemUpdate(
}
case
SID_HATCH_LIST
:
{
if
(
SfxItemState
::
DEFAULT
==
eState
)
if
(
bDefault
)
{
if
(
mpStyleItem
&&
drawing
::
FillStyle_HATCH
==
(
drawing
::
FillStyle
)
mpStyleItem
->
GetValue
())
{
...
...
@@ -861,7 +883,7 @@ void AreaPropertyPanelBase::NotifyItemUpdate(
}
case
SID_BITMAP_LIST
:
{
if
(
SfxItemState
::
DEFAULT
==
eState
)
if
(
bDefault
)
{
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