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
fa4c2d8a
Kaydet (Commit)
fa4c2d8a
authored
Nis 21, 2015
tarafından
Caolán McNamara
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
refactor for reuse
Change-Id: I46e04464376324c7e48fe0ccf7362c3a4256e3c2
üst
e367337e
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
20 deletions
+15
-20
tbcontrl.cxx
svx/source/tbxctrls/tbcontrl.cxx
+15
-20
No files found.
svx/source/tbxctrls/tbcontrl.cxx
Dosyayı görüntüle @
fa4c2d8a
...
@@ -158,7 +158,7 @@ private:
...
@@ -158,7 +158,7 @@ private:
void
ReleaseFocus
();
void
ReleaseFocus
();
Color
TestColorsVisible
(
const
Color
&
FontCol
,
const
Color
&
BackCol
);
Color
TestColorsVisible
(
const
Color
&
FontCol
,
const
Color
&
BackCol
);
void
SetupEntry
(
const
UserDrawEvent
&
rUDEvt
,
const
OUString
&
rStyleName
);
void
SetupEntry
(
sal_uInt16
nItem
,
const
Rectangle
&
rRect
,
OutputDevice
*
pDevice
,
const
OUString
&
rStyleName
,
bool
bIsNotSelected
);
void
UserDrawEntry
(
const
UserDrawEvent
&
rUDEvt
,
const
OUString
&
rStyleName
);
void
UserDrawEntry
(
const
UserDrawEvent
&
rUDEvt
,
const
OUString
&
rStyleName
);
DECL_LINK
(
MenuSelectHdl
,
Menu
*
);
DECL_LINK
(
MenuSelectHdl
,
Menu
*
);
};
};
...
@@ -579,13 +579,11 @@ void SvxStyleBox_Impl::UserDrawEntry(const UserDrawEvent& rUDEvt, const OUString
...
@@ -579,13 +579,11 @@ void SvxStyleBox_Impl::UserDrawEntry(const UserDrawEvent& rUDEvt, const OUString
pDevice
->
DrawText
(
aPos
,
rStyleName
);
pDevice
->
DrawText
(
aPos
,
rStyleName
);
}
}
void
SvxStyleBox_Impl
::
SetupEntry
(
const
UserDrawEvent
&
rUDEvt
,
const
OUString
&
rStyleName
)
void
SvxStyleBox_Impl
::
SetupEntry
(
sal_uInt16
nItem
,
const
Rectangle
&
rRect
,
OutputDevice
*
pDevice
,
const
OUString
&
rStyleName
,
bool
bIsNotSelected
)
{
{
sal_uInt16
nItem
=
rUDEvt
.
GetItemId
();
if
(
nItem
==
0
||
nItem
==
GetEntryCount
()
-
1
)
if
(
nItem
==
0
||
nItem
==
GetEntryCount
()
-
1
)
{
{
Rectangle
aRect
(
rUDEvt
.
GetRect
());
unsigned
int
nId
=
(
rRect
.
getY
()
/
rRect
.
GetSize
().
Height
());
unsigned
int
nId
=
(
aRect
.
getY
()
/
aRect
.
GetSize
().
Height
());
if
(
nId
<
MAX_STYLES_ENTRIES
&&
m_pButtons
[
nId
])
if
(
nId
<
MAX_STYLES_ENTRIES
&&
m_pButtons
[
nId
])
m_pButtons
[
nId
]
->
Hide
();
m_pButtons
[
nId
]
->
Hide
();
}
}
...
@@ -613,8 +611,6 @@ void SvxStyleBox_Impl::SetupEntry(const UserDrawEvent& rUDEvt, const OUString& r
...
@@ -613,8 +611,6 @@ void SvxStyleBox_Impl::SetupEntry(const UserDrawEvent& rUDEvt, const OUString& r
if
(
pFontItem
&&
pFontHeightItem
)
if
(
pFontItem
&&
pFontHeightItem
)
{
{
OutputDevice
*
pDevice
=
rUDEvt
.
GetDevice
();
Size
aFontSize
(
0
,
pFontHeightItem
->
GetHeight
()
);
Size
aFontSize
(
0
,
pFontHeightItem
->
GetHeight
()
);
Size
aPixelSize
(
pDevice
->
LogicToPixel
(
aFontSize
,
pShell
->
GetMapUnit
()
)
);
Size
aPixelSize
(
pDevice
->
LogicToPixel
(
aFontSize
,
pShell
->
GetMapUnit
()
)
);
...
@@ -671,18 +667,16 @@ void SvxStyleBox_Impl::SetupEntry(const UserDrawEvent& rUDEvt, const OUString& r
...
@@ -671,18 +667,16 @@ void SvxStyleBox_Impl::SetupEntry(const UserDrawEvent& rUDEvt, const OUString& r
pDevice
->
SetFont
(
aFont
);
pDevice
->
SetFont
(
aFont
);
bool
IsNotSelected
=
rUDEvt
.
GetItemId
()
!=
GetSelectEntryPos
();
pItem
=
aItemSet
.
GetItem
(
SID_ATTR_CHAR_COLOR
);
pItem
=
aItemSet
.
GetItem
(
SID_ATTR_CHAR_COLOR
);
// text color, when nothing is selected
// text color, when nothing is selected
if
(
(
NULL
!=
pItem
)
&&
IsNotSelected
)
if
(
(
NULL
!=
pItem
)
&&
b
IsNotSelected
)
aFontCol
=
Color
(
static_cast
<
const
SvxColorItem
*
>
(
pItem
)
->
GetValue
()
);
aFontCol
=
Color
(
static_cast
<
const
SvxColorItem
*
>
(
pItem
)
->
GetValue
()
);
sal_uInt16
style
=
drawing
::
FillStyle_NONE
;
sal_uInt16
style
=
drawing
::
FillStyle_NONE
;
// which kind of Fill style is selected
// which kind of Fill style is selected
pItem
=
aItemSet
.
GetItem
(
XATTR_FILLSTYLE
);
pItem
=
aItemSet
.
GetItem
(
XATTR_FILLSTYLE
);
// only when ok and not selected
// only when ok and not selected
if
(
(
NULL
!=
pItem
)
&&
IsNotSelected
)
if
(
(
NULL
!=
pItem
)
&&
b
IsNotSelected
)
style
=
static_cast
<
const
XFillStyleItem
*
>
(
pItem
)
->
GetValue
();
style
=
static_cast
<
const
XFillStyleItem
*
>
(
pItem
)
->
GetValue
();
switch
(
style
)
switch
(
style
)
...
@@ -697,7 +691,7 @@ void SvxStyleBox_Impl::SetupEntry(const UserDrawEvent& rUDEvt, const OUString& r
...
@@ -697,7 +691,7 @@ void SvxStyleBox_Impl::SetupEntry(const UserDrawEvent& rUDEvt, const OUString& r
if
(
aBackCol
!=
COL_AUTO
)
if
(
aBackCol
!=
COL_AUTO
)
{
{
pDevice
->
SetFillColor
(
aBackCol
);
pDevice
->
SetFillColor
(
aBackCol
);
pDevice
->
DrawRect
(
rUDEvt
.
GetRect
()
);
pDevice
->
DrawRect
(
rRect
);
}
}
}
}
break
;
break
;
...
@@ -714,26 +708,24 @@ void SvxStyleBox_Impl::SetupEntry(const UserDrawEvent& rUDEvt, const OUString& r
...
@@ -714,26 +708,24 @@ void SvxStyleBox_Impl::SetupEntry(const UserDrawEvent& rUDEvt, const OUString& r
pDevice
->
SetTextColor
(
aFontCol
);
pDevice
->
SetTextColor
(
aFontCol
);
// handle the push-button
// handle the push-button
if
(
IsNotSelected
)
if
(
b
IsNotSelected
)
{
{
Rectangle
aRect
(
rUDEvt
.
GetRect
());
unsigned
int
nId
=
(
rRect
.
getY
()
/
rRect
.
GetSize
().
Height
());
unsigned
int
nId
=
(
aRect
.
getY
()
/
aRect
.
GetSize
().
Height
());
if
(
nId
<
MAX_STYLES_ENTRIES
&&
m_pButtons
[
nId
])
if
(
nId
<
MAX_STYLES_ENTRIES
&&
m_pButtons
[
nId
])
m_pButtons
[
nId
]
->
Hide
();
m_pButtons
[
nId
]
->
Hide
();
}
}
else
else
{
{
Rectangle
aRect
(
rUDEvt
.
GetRect
());
unsigned
int
nId
=
(
rRect
.
getY
()
/
rRect
.
GetSize
().
Height
());
unsigned
int
nId
=
(
aRect
.
getY
()
/
aRect
.
GetSize
().
Height
());
if
(
nId
<
MAX_STYLES_ENTRIES
)
if
(
nId
<
MAX_STYLES_ENTRIES
)
{
{
if
(
m_pButtons
[
nId
]
==
NULL
)
if
(
m_pButtons
[
nId
]
==
NULL
)
{
{
m_pButtons
[
nId
]
=
new
MenuButton
(
static_cast
<
vcl
::
Window
*>
(
pDevice
),
WB_FLATBUTTON
|
WB_NOPOINTERFOCUS
);
m_pButtons
[
nId
]
=
new
MenuButton
(
static_cast
<
vcl
::
Window
*>
(
pDevice
),
WB_FLATBUTTON
|
WB_NOPOINTERFOCUS
);
m_pButtons
[
nId
]
->
SetSizePixel
(
Size
(
20
,
a
Rect
.
GetSize
().
Height
()));
m_pButtons
[
nId
]
->
SetSizePixel
(
Size
(
20
,
r
Rect
.
GetSize
().
Height
()));
m_pButtons
[
nId
]
->
SetPopupMenu
(
&
m_aMenu
);
m_pButtons
[
nId
]
->
SetPopupMenu
(
&
m_aMenu
);
}
}
m_pButtons
[
nId
]
->
SetPosPixel
(
Point
(
aRect
.
GetWidth
()
-
20
,
a
Rect
.
getY
()));
m_pButtons
[
nId
]
->
SetPosPixel
(
Point
(
rRect
.
GetWidth
()
-
20
,
r
Rect
.
getY
()));
m_pButtons
[
nId
]
->
Show
();
m_pButtons
[
nId
]
->
Show
();
}
}
}
}
...
@@ -750,7 +742,10 @@ void SvxStyleBox_Impl::UserDraw( const UserDrawEvent& rUDEvt )
...
@@ -750,7 +742,10 @@ void SvxStyleBox_Impl::UserDraw( const UserDrawEvent& rUDEvt )
OutputDevice
*
pDevice
=
rUDEvt
.
GetDevice
();
OutputDevice
*
pDevice
=
rUDEvt
.
GetDevice
();
pDevice
->
Push
(
PushFlags
::
FILLCOLOR
|
PushFlags
::
FONT
|
PushFlags
::
TEXTCOLOR
);
pDevice
->
Push
(
PushFlags
::
FILLCOLOR
|
PushFlags
::
FONT
|
PushFlags
::
TEXTCOLOR
);
SetupEntry
(
rUDEvt
,
aStyleName
);
const
Rectangle
&
rRect
(
rUDEvt
.
GetRect
());
bool
bIsNotSelected
=
rUDEvt
.
GetItemId
()
!=
GetSelectEntryPos
();
SetupEntry
(
nItem
,
rRect
,
pDevice
,
aStyleName
,
bIsNotSelected
);
UserDrawEntry
(
rUDEvt
,
aStyleName
);
UserDrawEntry
(
rUDEvt
,
aStyleName
);
...
...
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