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
9b6057dc
Kaydet (Commit)
9b6057dc
authored
May 18, 2015
tarafından
Tomaž Vajngerl
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
refactor SwAddressPreview to use RenderContext
Change-Id: I82d76c28a2326a41fe78a25d3efcea0196775881
üst
c24e3097
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
32 additions
and
30 deletions
+32
-30
mailmergehelper.cxx
sw/source/uibase/dbui/mailmergehelper.cxx
+32
-30
mailmergehelper.hxx
sw/source/uibase/inc/mailmergehelper.hxx
+0
-0
No files found.
sw/source/uibase/dbui/mailmergehelper.cxx
Dosyayı görüntüle @
9b6057dc
...
@@ -316,51 +316,53 @@ void SwAddressPreview::UpdateScrollBar()
...
@@ -316,51 +316,53 @@ void SwAddressPreview::UpdateScrollBar()
}
}
}
}
void
SwAddressPreview
::
Paint
(
vcl
::
RenderContext
&
/*rRenderContext*/
,
const
Rectangle
&
)
void
SwAddressPreview
::
Paint
(
vcl
::
RenderContext
&
rRenderContext
,
const
Rectangle
&
)
{
{
const
StyleSettings
&
rSettings
=
GetSettings
().
GetStyleSettings
();
const
StyleSettings
&
rSettings
=
rRenderContext
.
GetSettings
().
GetStyleSettings
();
SetFillColor
(
rSettings
.
GetWindowColor
());
rRenderContext
.
SetFillColor
(
rSettings
.
GetWindowColor
());
SetLineColor
(
Color
(
COL_TRANSPARENT
)
);
rRenderContext
.
SetLineColor
(
Color
(
COL_TRANSPARENT
)
);
DrawRect
(
Rectangle
(
Point
(
0
,
0
),
GetOutputSizePixel
())
);
rRenderContext
.
DrawRect
(
Rectangle
(
Point
(
0
,
0
),
rRenderContext
.
GetOutputSizePixel
())
);
Color
aPaintColor
(
IsEnabled
()
?
rSettings
.
GetWindowTextColor
()
:
rSettings
.
GetDisableColor
());
Color
aPaintColor
(
IsEnabled
()
?
rSettings
.
GetWindowTextColor
()
:
rSettings
.
GetDisableColor
());
SetLineColor
(
aPaintColor
);
rRenderContext
.
SetLineColor
(
aPaintColor
);
vcl
::
Font
aFont
(
GetFont
());
vcl
::
Font
aFont
(
rRenderContext
.
GetFont
());
aFont
.
SetColor
(
aPaintColor
);
aFont
.
SetColor
(
aPaintColor
);
SetFont
(
aFont
);
rRenderContext
.
SetFont
(
aFont
);
Size
aSize
=
GetOutputSizePixel
();
Size
aSize
=
rRenderContext
.
GetOutputSizePixel
();
sal_uInt16
nStartRow
=
0
;
sal_uInt16
nStartRow
=
0
;
if
(
aVScrollBar
->
IsVisible
())
if
(
aVScrollBar
->
IsVisible
())
{
{
aSize
.
Width
()
-=
aVScrollBar
->
GetSizePixel
().
Width
();
aSize
.
Width
()
-=
aVScrollBar
->
GetSizePixel
().
Width
();
nStartRow
=
(
sal_uInt16
)
aVScrollBar
->
GetThumbPos
();
nStartRow
=
(
sal_uInt16
)
aVScrollBar
->
GetThumbPos
();
}
}
Size
aPartSize
(
aSize
.
Width
()
/
pImpl
->
nColumns
,
aSize
.
Height
()
/
pImpl
->
nRows
);
Size
aPartSize
(
aSize
.
Width
()
/
pImpl
->
nColumns
,
aSize
.
Height
()
/
pImpl
->
nRows
);
aPartSize
.
Width
()
-=
2
;
aPartSize
.
Width
()
-=
2
;
aPartSize
.
Height
()
-=
2
;
aPartSize
.
Height
()
-=
2
;
sal_uInt16
nAddress
=
nStartRow
*
pImpl
->
nColumns
;
sal_uInt16
nAddress
=
nStartRow
*
pImpl
->
nColumns
;
const
sal_uInt16
nNumAddresses
=
static_cast
<
sal_uInt16
>
(
pImpl
->
aAddresses
.
size
());
const
sal_uInt16
nNumAddresses
=
static_cast
<
sal_uInt16
>
(
pImpl
->
aAddresses
.
size
());
for
(
sal_uInt16
nRow
=
0
;
nRow
<
pImpl
->
nRows
;
++
nRow
)
for
(
sal_uInt16
nRow
=
0
;
nRow
<
pImpl
->
nRows
;
++
nRow
)
{
{
for
(
sal_uInt16
nCol
=
0
;
nCol
<
pImpl
->
nColumns
;
++
nCol
)
for
(
sal_uInt16
nCol
=
0
;
nCol
<
pImpl
->
nColumns
;
++
nCol
)
{
{
if
(
nAddress
>=
nNumAddresses
)
if
(
nAddress
>=
nNumAddresses
)
break
;
break
;
Point
aPos
(
nCol
*
aPartSize
.
Width
(),
(
nRow
)
*
aPartSize
.
Height
());
Point
aPos
(
nCol
*
aPartSize
.
Width
(),
aPos
.
Move
(
1
,
1
);
nRow
*
aPartSize
.
Height
());
aPos
.
Move
(
1
,
1
);
bool
bIsSelected
=
nAddress
==
pImpl
->
nSelectedAddress
;
bool
bIsSelected
=
nAddress
==
pImpl
->
nSelectedAddress
;
if
((
pImpl
->
nColumns
*
pImpl
->
nRows
)
==
1
)
if
((
pImpl
->
nColumns
*
pImpl
->
nRows
)
==
1
)
bIsSelected
=
false
;
bIsSelected
=
false
;
OUString
adr
(
pImpl
->
aAddresses
[
nAddress
]);
OUString
adr
(
pImpl
->
aAddresses
[
nAddress
]);
DrawText_Impl
(
adr
,
aPos
,
aPartSize
,
bIsSelected
);
DrawText_Impl
(
rRenderContext
,
adr
,
aPos
,
aPartSize
,
bIsSelected
);
++
nAddress
;
++
nAddress
;
}
}
}
}
SetClipRegion
();
rRenderContext
.
SetClipRegion
();
}
}
void
SwAddressPreview
::
MouseButtonDown
(
const
MouseEvent
&
rMEvt
)
void
SwAddressPreview
::
MouseButtonDown
(
const
MouseEvent
&
rMEvt
)
{
{
Window
::
MouseButtonDown
(
rMEvt
);
Window
::
MouseButtonDown
(
rMEvt
);
if
(
rMEvt
.
IsLeft
()
&&
pImpl
->
nRows
&&
pImpl
->
nColumns
)
if
(
rMEvt
.
IsLeft
()
&&
pImpl
->
nRows
&&
pImpl
->
nColumns
)
...
@@ -434,30 +436,30 @@ void SwAddressPreview::KeyInput( const KeyEvent& rKEvt )
...
@@ -434,30 +436,30 @@ void SwAddressPreview::KeyInput( const KeyEvent& rKEvt )
void
SwAddressPreview
::
StateChanged
(
StateChangedType
nStateChange
)
void
SwAddressPreview
::
StateChanged
(
StateChangedType
nStateChange
)
{
{
if
(
nStateChange
==
StateChangedType
::
Enable
)
if
(
nStateChange
==
StateChangedType
::
Enable
)
Invalidate
();
Invalidate
();
Window
::
StateChanged
(
nStateChange
);
Window
::
StateChanged
(
nStateChange
);
}
}
void
SwAddressPreview
::
DrawText_Impl
(
void
SwAddressPreview
::
DrawText_Impl
(
vcl
::
RenderContext
&
rRenderContext
,
const
OUString
&
rAddress
,
const
OUString
&
rAddress
,
const
Point
&
rTopLeft
,
const
Size
&
rSize
,
bool
bIsSelected
)
const
Point
&
rTopLeft
,
const
Size
&
rSize
,
bool
bIsSelected
)
{
{
SetClipRegion
(
vcl
::
Region
(
Rectangle
(
rTopLeft
,
rSize
))
);
rRenderContext
.
SetClipRegion
(
vcl
::
Region
(
Rectangle
(
rTopLeft
,
rSize
))
);
if
(
bIsSelected
)
if
(
bIsSelected
)
{
{
//selection rectangle
//selection rectangle
SetFillColor
(
Color
(
COL_TRANSPARENT
));
rRenderContext
.
SetFillColor
(
Color
(
COL_TRANSPARENT
));
DrawRect
(
Rectangle
(
rTopLeft
,
rSize
));
rRenderContext
.
DrawRect
(
Rectangle
(
rTopLeft
,
rSize
));
}
}
sal_Int32
nHeight
=
GetTextHeight
();
sal_Int32
nHeight
=
GetTextHeight
();
OUString
sAddress
(
rAddress
);
OUString
sAddress
(
rAddress
);
sal_uInt16
nTokens
=
comphelper
::
string
::
getTokenCount
(
sAddress
,
'\n'
);
sal_uInt16
nTokens
=
comphelper
::
string
::
getTokenCount
(
sAddress
,
'\n'
);
Point
aStart
=
rTopLeft
;
Point
aStart
=
rTopLeft
;
//put it away from the border
//put it away from the border
aStart
.
Move
(
2
,
2
);
aStart
.
Move
(
2
,
2
);
for
(
sal_uInt16
nToken
=
0
;
nToken
<
nTokens
;
nToken
++
)
for
(
sal_uInt16
nToken
=
0
;
nToken
<
nTokens
;
nToken
++
)
{
{
DrawText
(
aStart
,
sAddress
.
getToken
(
nToken
,
'\n'
)
);
rRenderContext
.
DrawText
(
aStart
,
sAddress
.
getToken
(
nToken
,
'\n'
)
);
aStart
.
Y
()
+=
nHeight
;
aStart
.
Y
()
+=
nHeight
;
}
}
}
}
...
...
sw/source/uibase/inc/mailmergehelper.hxx
Dosyayı görüntüle @
9b6057dc
This diff is collapsed.
Click to expand it.
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