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
eee24f6c
Kaydet (Commit)
eee24f6c
authored
May 12, 2015
tarafından
Tomaž Vajngerl
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
refactor ContourWindow to use RenderContext
Change-Id: I4b7b5f98b56c8cfa41dcd71ccb25e2d6c809cac7
üst
613ead6d
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
36 additions
and
43 deletions
+36
-43
contwnd.cxx
svx/source/dialog/contwnd.cxx
+36
-43
No files found.
svx/source/dialog/contwnd.cxx
Dosyayı görüntüle @
eee24f6c
...
...
@@ -29,24 +29,24 @@
#include <basegfx/polygon/b2dpolypolygontools.hxx>
#include "svx/sdrpaintwindow.hxx"
using
namespace
c
om
::
sun
::
star
;
using
namespace
c
ss
;
#define TRANSCOL Color(
COL_WHITE
)
#define TRANSCOL Color(
COL_WHITE
)
ContourWindow
::
ContourWindow
(
vcl
::
Window
*
pParent
,
WinBits
nBits
)
:
GraphCtrl
(
pParent
,
nBits
),
aWorkRect
(
0
,
0
,
0
,
0
),
bPipetteMode
(
false
),
bWorkplaceMode
(
false
),
bClickValid
(
false
)
ContourWindow
::
ContourWindow
(
vcl
::
Window
*
pParent
,
WinBits
nBits
)
:
GraphCtrl
(
pParent
,
nBits
)
,
aWorkRect
(
0
,
0
,
0
,
0
)
,
bPipetteMode
(
false
)
,
bWorkplaceMode
(
false
)
,
bClickValid
(
false
)
{
SetWinStyle
(
WB_SDRMODE
);
SetWinStyle
(
WB_SDRMODE
);
}
void
ContourWindow
::
SetPolyPolygon
(
const
tools
::
PolyPolygon
&
rPolyPoly
)
void
ContourWindow
::
SetPolyPolygon
(
const
tools
::
PolyPolygon
&
rPolyPoly
)
{
SdrPage
*
pPage
=
pModel
->
GetPage
(
0
);
const
sal_uInt16
nPolyCount
=
rPolyPoly
.
Count
();
SdrPage
*
pPage
=
pModel
->
GetPage
(
0
);
const
sal_uInt16
nPolyCount
=
rPolyPoly
.
Count
();
// First delete all drawing objects
aPolyPoly
=
rPolyPoly
;
...
...
@@ -57,30 +57,30 @@ void ContourWindow::SetPolyPolygon( const tools::PolyPolygon& rPolyPoly )
pPage
->
Clear
();
for
(
sal_uInt16
i
=
0
;
i
<
nPolyCount
;
i
++
)
for
(
sal_uInt16
i
=
0
;
i
<
nPolyCount
;
i
++
)
{
basegfx
::
B2DPolyPolygon
aPolyPolygon
;
aPolyPolygon
.
append
(
aPolyPoly
[
i
].
getB2DPolygon
());
SdrPathObj
*
pPathObj
=
new
SdrPathObj
(
OBJ_PATHFILL
,
aPolyPolygon
);
SfxItemSet
aSet
(
pModel
->
GetItemPool
()
);
SfxItemSet
aSet
(
pModel
->
GetItemPool
()
);
aSet
.
Put
(
XFillStyleItem
(
drawing
::
FillStyle_SOLID
)
);
aSet
.
Put
(
XFillColorItem
(
""
,
TRANSCOL
)
);
aSet
.
Put
(
XFillTransparenceItem
(
50
)
);
aSet
.
Put
(
XFillStyleItem
(
drawing
::
FillStyle_SOLID
)
);
aSet
.
Put
(
XFillColorItem
(
""
,
TRANSCOL
)
);
aSet
.
Put
(
XFillTransparenceItem
(
50
)
);
pPathObj
->
SetMergedItemSetAndBroadcast
(
aSet
);
pPage
->
InsertObject
(
pPathObj
);
}
if
(
nPolyCount
)
if
(
nPolyCount
)
{
pView
->
MarkAll
();
pView
->
CombineMarkedObjects
(
false
);
pView
->
CombineMarkedObjects
(
false
);
}
pModel
->
SetChanged
(
false
);
pModel
->
SetChanged
(
false
);
}
const
tools
::
PolyPolygon
&
ContourWindow
::
GetPolyPolygon
()
...
...
@@ -217,40 +217,33 @@ void ContourWindow::MouseButtonUp(const MouseEvent& rMEvt)
GraphCtrl
::
MouseButtonUp
(
rMEvt
);
}
void
ContourWindow
::
Paint
(
vcl
::
RenderContext
&
/*rRenderContext*/
,
const
Rectangle
&
rRect
)
void
ContourWindow
::
Paint
(
vcl
::
RenderContext
&
rRenderContext
,
const
Rectangle
&
rRect
)
{
// #i75482#
// encapsulate the redraw using Begin/End and use the returned
// data to get the target output device (e.g. when pre-rendering)
SdrPaintWindow
*
pPaintWindow
=
pView
->
BeginCompleteRedraw
(
this
);
SdrPaintWindow
*
pPaintWindow
=
pView
->
BeginCompleteRedraw
(
&
rRenderContext
);
OutputDevice
&
rTarget
=
pPaintWindow
->
GetTargetOutputDevice
();
const
Graphic
&
rGraphic
=
GetGraphic
();
const
Color
&
rOldLineColor
=
GetLineColor
();
const
Color
&
rOldFillColor
=
GetFillColor
();
rTarget
.
SetLineColor
(
Color
(
COL_BLACK
)
);
rTarget
.
SetFillColor
(
Color
(
COL_WHITE
)
);
rTarget
.
Push
(
PushFlags
::
LINECOLOR
|
PushFlags
::
FILLCOLOR
);
rTarget
.
SetLineColor
(
Color
(
COL_BLACK
));
rTarget
.
SetFillColor
(
Color
(
COL_WHITE
));
rTarget
.
DrawRect
(
Rectangle
(
Point
(),
GetGraphicSize
()
)
);
rTarget
.
Pop
();
rTarget
.
SetLineColor
(
rOldLineColor
);
rTarget
.
SetFillColor
(
rOldFillColor
);
if
(
rGraphic
.
GetType
()
!=
GRAPHIC_NONE
)
rGraphic
.
Draw
(
&
rTarget
,
Point
(),
GetGraphicSize
()
);
if
(
rGraphic
.
GetType
()
!=
GRAPHIC_NONE
)
rGraphic
.
Draw
(
&
rTarget
,
Point
(),
GetGraphicSize
());
if
(
aWorkRect
.
Left
()
!=
aWorkRect
.
Right
()
&&
aWorkRect
.
Top
()
!=
aWorkRect
.
Bottom
()
)
if
(
aWorkRect
.
Left
()
!=
aWorkRect
.
Right
()
&&
aWorkRect
.
Top
()
!=
aWorkRect
.
Bottom
()
)
{
tools
::
PolyPolygon
_aPolyPoly
(
2
,
2
);
const
Color
aOldFillColor
(
GetFillColor
()
);
_aPolyPoly
.
Insert
(
Rectangle
(
Point
(),
GetGraphicSize
()
)
);
_aPolyPoly
.
Insert
(
aWorkRect
);
rTarget
.
SetFillColor
(
COL_LIGHTRED
);
rTarget
.
DrawTransparent
(
_aPolyPoly
,
50
);
rTarget
.
SetFillColor
(
aOldFillColor
);
tools
::
PolyPolygon
_aPolyPoly
(
2
,
2
);
rTarget
.
Push
(
PushFlags
::
FILLCOLOR
);
_aPolyPoly
.
Insert
(
Rectangle
(
Point
(),
GetGraphicSize
()));
_aPolyPoly
.
Insert
(
aWorkRect
);
rTarget
.
SetFillColor
(
COL_LIGHTRED
);
rTarget
.
DrawTransparent
(
_aPolyPoly
,
50
);
rTarget
.
Pop
();
}
// #i75482#
...
...
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