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
f4147a39
Kaydet (Commit)
f4147a39
authored
May 11, 2015
tarafından
Tomaž Vajngerl
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
refactor TableControl to use RenderContext
Change-Id: I4a84cdc8517b69b28fbb8521d0593ae5ed4c3a79
üst
f54212fb
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
48 additions
and
80 deletions
+48
-80
gridtablerenderer.cxx
svtools/source/table/gridtablerenderer.cxx
+0
-0
tablecontrol_impl.cxx
svtools/source/table/tablecontrol_impl.cxx
+34
-55
tablecontrol_impl.hxx
svtools/source/table/tablecontrol_impl.hxx
+1
-4
tabledatawindow.cxx
svtools/source/table/tabledatawindow.cxx
+4
-12
tabledatawindow.hxx
svtools/source/table/tabledatawindow.hxx
+9
-9
No files found.
svtools/source/table/gridtablerenderer.cxx
Dosyayı görüntüle @
f4147a39
This diff is collapsed.
Click to expand it.
svtools/source/table/tablecontrol_impl.cxx
Dosyayı görüntüle @
f4147a39
...
...
@@ -1197,124 +1197,103 @@ namespace svt { namespace table
}
void
TableControl_Impl
::
doPaintContent
(
const
Rectangle
&
_rUpdateRect
)
void
TableControl_Impl
::
doPaintContent
(
vcl
::
RenderContext
&
rRenderContext
,
const
Rectangle
&
_rUpdateRect
)
{
if
(
!
getModel
()
)
if
(
!
getModel
()
)
return
;
PTableRenderer
pRenderer
=
getModel
()
->
getRenderer
();
DBG_ASSERT
(
!!
pRenderer
,
"TableDataWindow::doPaintContent: invalid renderer!"
);
if
(
!
pRenderer
)
DBG_ASSERT
(
!!
pRenderer
,
"TableDataWindow::doPaintContent: invalid renderer!"
);
if
(
!
pRenderer
)
return
;
// our current style settings, to be passed to the renderer
const
StyleSettings
&
rStyle
=
m_rAntiImpl
.
GetSettings
().
GetStyleSettings
();
const
StyleSettings
&
rStyle
=
rRenderContext
.
GetSettings
().
GetStyleSettings
();
m_nRowCount
=
m_pModel
->
getRowCount
();
// the area occupied by all (at least partially) visible cells, including
// headers
Rectangle
const
aAllCellsWithHeaders
(
impl_getAllVisibleCellsArea
()
);
// draw the header column area
if
(
m_pModel
->
hasColumnHeaders
()
)
if
(
m_pModel
->
hasColumnHeaders
()
)
{
TableRowGeometry
const
aHeaderRow
(
*
this
,
Rectangle
(
Point
(
0
,
0
),
aAllCellsWithHeaders
.
BottomRight
()
),
ROW_COL_HEADERS
);
TableRowGeometry
const
aHeaderRow
(
*
this
,
Rectangle
(
Point
(
0
,
0
),
aAllCellsWithHeaders
.
BottomRight
()),
ROW_COL_HEADERS
);
Rectangle
const
aColRect
(
aHeaderRow
.
getRect
());
pRenderer
->
PaintHeaderArea
(
*
m_pDataWindow
,
aColRect
,
true
,
false
,
rStyle
);
pRenderer
->
PaintHeaderArea
(
rRenderContext
,
aColRect
,
true
,
false
,
rStyle
);
// Note that strictly, aHeaderRow.getRect() also contains the intersection between column
// and row header area. However, below we go to paint this intersection, again,
// so this hopefully doesn't hurt if we already paint it here.
for
(
TableCellGeometry
aCell
(
aHeaderRow
,
m_nLeftColumn
);
aCell
.
isValid
();
aCell
.
moveRight
()
)
for
(
TableCellGeometry
aCell
(
aHeaderRow
,
m_nLeftColumn
);
aCell
.
isValid
();
aCell
.
moveRight
())
{
if
(
_rUpdateRect
.
GetIntersection
(
aCell
.
getRect
()
).
IsEmpty
()
)
if
(
_rUpdateRect
.
GetIntersection
(
aCell
.
getRect
()).
IsEmpty
()
)
continue
;
bool
isActiveColumn
=
(
aCell
.
getColumn
()
==
getCurrentColumn
()
);
bool
isActiveColumn
=
(
aCell
.
getColumn
()
==
getCurrentColumn
()
);
bool
isSelectedColumn
=
false
;
pRenderer
->
PaintColumnHeader
(
aCell
.
getColumn
(),
isActiveColumn
,
isSelectedColumn
,
*
m_pDataWindow
,
aCell
.
getRect
(),
rStyle
);
pRenderer
->
PaintColumnHeader
(
aCell
.
getColumn
(),
isActiveColumn
,
isSelectedColumn
,
rRenderContext
,
aCell
.
getRect
(),
rStyle
);
}
}
// the area occupied by the row header, if any
Rectangle
aRowHeaderArea
;
if
(
m_pModel
->
hasRowHeaders
()
)
if
(
m_pModel
->
hasRowHeaders
()
)
{
aRowHeaderArea
=
aAllCellsWithHeaders
;
aRowHeaderArea
.
Right
()
=
m_nRowHeaderWidthPixel
-
1
;
TableSize
const
nVisibleRows
=
impl_getVisibleRows
(
true
);
TableSize
const
nVisibleRows
=
impl_getVisibleRows
(
true
);
TableSize
nActualRows
=
nVisibleRows
;
if
(
m_nTopRow
+
nActualRows
>
m_nRowCount
)
if
(
m_nTopRow
+
nActualRows
>
m_nRowCount
)
nActualRows
=
m_nRowCount
-
m_nTopRow
;
aRowHeaderArea
.
Bottom
()
=
m_nColHeaderHeightPixel
+
m_nRowHeightPixel
*
nActualRows
-
1
;
pRenderer
->
PaintHeaderArea
(
*
m_pDataWindow
,
aRowHeaderArea
,
false
,
true
,
rStyle
);
pRenderer
->
PaintHeaderArea
(
rRenderContext
,
aRowHeaderArea
,
false
,
true
,
rStyle
);
// Note that strictly, aRowHeaderArea also contains the intersection between column
// and row header area. However, below we go to paint this intersection, again,
// so this hopefully doesn't hurt if we already paint it here.
if
(
m_pModel
->
hasColumnHeaders
()
)
if
(
m_pModel
->
hasColumnHeaders
()
)
{
TableCellGeometry
const
aIntersection
(
*
this
,
Rectangle
(
Point
(
0
,
0
),
aAllCellsWithHeaders
.
BottomRight
()
),
COL_ROW_HEADERS
,
ROW_COL_HEADERS
);
Rectangle
const
aInters
(
aIntersection
.
getRect
()
);
pRenderer
->
PaintHeaderArea
(
*
m_pDataWindow
,
aInters
,
true
,
true
,
rStyle
);
TableCellGeometry
const
aIntersection
(
*
this
,
Rectangle
(
Point
(
0
,
0
),
aAllCellsWithHeaders
.
BottomRight
()),
COL_ROW_HEADERS
,
ROW_COL_HEADERS
);
Rectangle
const
aInters
(
aIntersection
.
getRect
());
pRenderer
->
PaintHeaderArea
(
rRenderContext
,
aInters
,
true
,
true
,
rStyle
);
}
}
// draw the table content row by row
TableSize
colCount
=
getModel
()
->
getColumnCount
();
// paint all rows
Rectangle
const
aAllDataCellsArea
(
impl_getAllVisibleDataCellArea
()
);
for
(
TableRowGeometry
aRowIterator
(
*
this
,
aAllCellsWithHeaders
,
getTopRow
()
);
aRowIterator
.
isValid
();
aRowIterator
.
moveDown
()
)
Rectangle
const
aAllDataCellsArea
(
impl_getAllVisibleDataCellArea
());
for
(
TableRowGeometry
aRowIterator
(
*
this
,
aAllCellsWithHeaders
,
getTopRow
());
aRowIterator
.
isValid
();
aRowIterator
.
moveDown
())
{
if
(
_rUpdateRect
.
GetIntersection
(
aRowIterator
.
getRect
()
).
IsEmpty
()
)
if
(
_rUpdateRect
.
GetIntersection
(
aRowIterator
.
getRect
()
).
IsEmpty
()
)
continue
;
bool
const
isControlFocused
=
m_rAntiImpl
.
HasControlFocus
();
bool
const
isSelectedRow
=
isRowSelected
(
aRowIterator
.
getRow
()
);
bool
const
isSelectedRow
=
isRowSelected
(
aRowIterator
.
getRow
()
);
Rectangle
const
aRect
=
aRowIterator
.
getRect
().
GetIntersection
(
aAllDataCellsArea
);
Rectangle
const
aRect
=
aRowIterator
.
getRect
().
GetIntersection
(
aAllDataCellsArea
);
// give the redenderer a chance to prepare the row
pRenderer
->
PrepareRow
(
aRowIterator
.
getRow
(),
isControlFocused
,
isSelectedRow
,
*
m_pDataWindow
,
aRect
,
rStyle
);
pRenderer
->
PrepareRow
(
aRowIterator
.
getRow
(),
isControlFocused
,
isSelectedRow
,
rRenderContext
,
aRect
,
rStyle
);
// paint the row header
if
(
m_pModel
->
hasRowHeaders
()
)
if
(
m_pModel
->
hasRowHeaders
()
)
{
const
Rectangle
aCurrentRowHeader
(
aRowHeaderArea
.
GetIntersection
(
aRowIterator
.
getRect
()
)
);
pRenderer
->
PaintRowHeader
(
isControlFocused
,
isSelectedRow
,
*
m_pDataWindow
,
aCurrentRowHeader
,
rStyle
);
const
Rectangle
aCurrentRowHeader
(
aRowHeaderArea
.
GetIntersection
(
aRowIterator
.
getRect
()));
pRenderer
->
PaintRowHeader
(
isControlFocused
,
isSelectedRow
,
rRenderContext
,
aCurrentRowHeader
,
rStyle
);
}
if
(
!
colCount
)
if
(
!
colCount
)
continue
;
// paint all cells in this row
for
(
TableCellGeometry
aCell
(
aRowIterator
,
m_nLeftColumn
);
aCell
.
isValid
();
aCell
.
moveRight
()
)
for
(
TableCellGeometry
aCell
(
aRowIterator
,
m_nLeftColumn
);
aCell
.
isValid
();
aCell
.
moveRight
())
{
bool
isSelectedColumn
=
false
;
pRenderer
->
PaintCell
(
aCell
.
getColumn
(),
isSelectedRow
||
isSelectedColumn
,
isControlFocused
,
*
m_pDataWindow
,
aCell
.
getRect
(),
rStyle
);
pRenderer
->
PaintCell
(
aCell
.
getColumn
(),
isSelectedRow
||
isSelectedColumn
,
isControlFocused
,
rRenderContext
,
aCell
.
getRect
(),
rStyle
);
}
}
}
...
...
svtools/source/table/tablecontrol_impl.hxx
Dosyayı görüntüle @
f4147a39
...
...
@@ -34,11 +34,8 @@
class
ScrollBar
;
class
ScrollBarBox
;
namespace
svt
{
namespace
table
{
struct
MutableColumnMetrics
:
protected
ColumnMetrics
{
MutableColumnMetrics
()
...
...
@@ -170,7 +167,7 @@ namespace svt { namespace table
/** paints the table control content which intersects with the given rectangle
*/
void
doPaintContent
(
const
Rectangle
&
_rUpdateRect
);
void
doPaintContent
(
vcl
::
RenderContext
&
rRenderContext
,
const
Rectangle
&
_rUpdateRect
);
/** moves the cursor to the cell with the given coordinates
...
...
svtools/source/table/tabledatawindow.cxx
Dosyayı görüntüle @
f4147a39
...
...
@@ -17,7 +17,6 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
#include "table/tablecontrol.hxx"
#include "tabledatawindow.hxx"
...
...
@@ -27,16 +26,9 @@
#include <vcl/help.hxx>
#include <vcl/settings.hxx>
namespace
svt
{
namespace
table
{
using
::
com
::
sun
::
star
::
uno
::
Any
;
//= TableDataWindow
using
css
::
uno
::
Any
;
TableDataWindow
::
TableDataWindow
(
TableControl_Impl
&
_rTableControl
)
:
Window
(
&
_rTableControl
.
getAntiImpl
()
)
...
...
@@ -60,9 +52,9 @@ namespace svt { namespace table
Window
::
dispose
();
}
void
TableDataWindow
::
Paint
(
vcl
::
RenderContext
&
/*rRenderContext*/
,
const
Rectangle
&
rUpdateRect
)
void
TableDataWindow
::
Paint
(
vcl
::
RenderContext
&
rRenderContext
,
const
Rectangle
&
rUpdateRect
)
{
m_rTableControl
.
doPaintContent
(
rUpdateRect
);
m_rTableControl
.
doPaintContent
(
rRenderContext
,
rUpdateRect
);
}
void
TableDataWindow
::
SetBackground
(
const
Wallpaper
&
rColor
)
...
...
@@ -221,7 +213,7 @@ namespace svt { namespace table
return
nDone
||
Window
::
Notify
(
rNEvt
);
}
}
}
// namespace svt::table
}}
// namespace svt::table
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
svtools/source/table/tabledatawindow.hxx
Dosyayı görüntüle @
f4147a39
...
...
@@ -26,15 +26,9 @@
namespace
svt
{
namespace
table
{
class
TableControl_Impl
;
class
TableFunctionSet
;
//= TableDataWindow
/** the window containing the content area (including headers) of
a table control
*/
...
...
@@ -51,11 +45,17 @@ namespace svt { namespace table
virtual
~
TableDataWindow
();
virtual
void
dispose
()
SAL_OVERRIDE
;
inline
void
SetSelectHdl
(
const
Link
<>&
rLink
)
{
m_aSelectHdl
=
rLink
;
}
inline
const
Link
<>&
GetSelectHdl
()
const
{
return
m_aSelectHdl
;
}
inline
void
SetSelectHdl
(
const
Link
<>&
rLink
)
{
m_aSelectHdl
=
rLink
;
}
inline
const
Link
<>&
GetSelectHdl
()
const
{
return
m_aSelectHdl
;
}
// Window overridables
virtual
void
Paint
(
vcl
::
RenderContext
&
rRenderContext
,
const
Rectangle
&
rRect
)
SAL_OVERRIDE
;
virtual
void
Paint
(
vcl
::
RenderContext
&
rRenderContext
,
const
Rectangle
&
rRect
)
SAL_OVERRIDE
;
virtual
void
MouseMove
(
const
MouseEvent
&
rMEvt
)
SAL_OVERRIDE
;
virtual
void
MouseButtonDown
(
const
MouseEvent
&
rMEvt
)
SAL_OVERRIDE
;
virtual
void
MouseButtonUp
(
const
MouseEvent
&
rMEvt
)
SAL_OVERRIDE
;
...
...
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