diff options
author | Jens-Heiner Rechtien <hr@openoffice.org> | 2003-04-04 15:56:39 +0000 |
---|---|---|
committer | Jens-Heiner Rechtien <hr@openoffice.org> | 2003-04-04 15:56:39 +0000 |
commit | da9f3e27b5b570040070b7c87be3892c700687a1 (patch) | |
tree | 29d60642bd151cc168d9677400fbe6c3cb3e9739 /svx/source | |
parent | 56d44af1e298c773e38788ae2093443fb8ad9485 (diff) |
INTEGRATION: CWS uaa01 (1.14.12.1.38); FILE MERGED
2003/03/25 11:45:11 thb 1.14.12.1.38.1: #108199# Implemented OJ's additions to BrowseBox (GetFieldCharacterBounds and GetFieldIndexAtPoint) for GalleryListView
Diffstat (limited to 'svx/source')
-rw-r--r-- | svx/source/gallery2/galctrl.cxx | 42 |
1 files changed, 40 insertions, 2 deletions
diff --git a/svx/source/gallery2/galctrl.cxx b/svx/source/gallery2/galctrl.cxx index 1a269bde655d..9bb44f29d085 100644 --- a/svx/source/gallery2/galctrl.cxx +++ b/svx/source/gallery2/galctrl.cxx @@ -2,9 +2,9 @@ * * $RCSfile: galctrl.cxx,v $ * - * $Revision: 1.16 $ + * $Revision: 1.17 $ * - * last change: $Author: vg $ $Date: 2003-04-01 13:49:00 $ + * last change: $Author: hr $ $Date: 2003-04-04 16:56:39 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -65,6 +65,8 @@ #include "galtheme.hxx" #include "galmisc.hxx" #include "galctrl.hxx" +#include "AccessibleStringWrap.hxx" +#include "svxfont.hxx" // ----------- // - Defines - @@ -516,6 +518,7 @@ BOOL GalleryListView::SeekRow( long nRow ) mnCurRow = nRow; return TRUE; } + // ----------------------------------------------------------------------------- String GalleryListView::GetCellText(long _nRow, USHORT nColumnId) const @@ -536,6 +539,41 @@ String GalleryListView::GetCellText(long _nRow, USHORT nColumnId) const return sRet;; } + +// ----------------------------------------------------------------------------- + +Rectangle GalleryListView::GetFieldCharacterBounds(sal_Int32 _nRow,sal_Int32 _nColumnId,sal_Int32 nIndex) +{ + DBG_ASSERT(_nColumnId >= 0 && _nColumnId <= USHRT_MAX, "GalleryListView::GetFieldCharacterBounds: _nColumnId overflow"); + Rectangle aRect; + if ( SeekRow(_nRow) ) + { + SvxFont aFont( GetFont() ); + AccessibleStringWrap aStringWrap( *this, aFont, GetCellText(_nRow, static_cast<USHORT>(_nColumnId)) ); + + // get the bounds inside the string + aStringWrap.GetCharacterBounds(nIndex, aRect); + + // offset to + } + return aRect; +} + +// ----------------------------------------------------------------------------- + +sal_Int32 GalleryListView::GetFieldIndexAtPoint(sal_Int32 _nRow,sal_Int32 _nColumnId,const Point& _rPoint) +{ + DBG_ASSERT(_nColumnId >= 0 && _nColumnId <= USHRT_MAX, "GalleryListView::GetFieldIndexAtPoint: _nColumnId overflow"); + sal_Int32 nRet = -1; + if ( SeekRow(_nRow) ) + { + SvxFont aFont( GetFont() ); + AccessibleStringWrap aStringWrap( *this, aFont, GetCellText(_nRow, static_cast<USHORT>(_nColumnId)) ); + nRet = aStringWrap.GetIndexAtPoint(_rPoint); + } + return nRet; +} + // ------------------------------------------------------------------------ void GalleryListView::PaintField( OutputDevice& rDev, const Rectangle& rRect, USHORT nColumnId ) const |