diff options
author | Daniel Rentz <dr@openoffice.org> | 2002-08-16 12:01:00 +0000 |
---|---|---|
committer | Daniel Rentz <dr@openoffice.org> | 2002-08-16 12:01:00 +0000 |
commit | d65fe0faf3c61b6eea6a77b113c4dd0d98cb72e6 (patch) | |
tree | 11f861bc0b7a6a840831a4bbe58a3731e22bdfa5 /sc | |
parent | fee230e0c9e8f001e033e6f2fd964ad4dcc202bd (diff) |
#101677# CSV accessibility
Diffstat (limited to 'sc')
-rw-r--r-- | sc/source/ui/Accessibility/AccessibleCsvControl.cxx | 390 | ||||
-rw-r--r-- | sc/source/ui/Accessibility/AccessibleText.cxx | 151 | ||||
-rw-r--r-- | sc/source/ui/dbgui/csvcontrol.cxx | 12 | ||||
-rw-r--r-- | sc/source/ui/dbgui/csvgrid.cxx | 37 | ||||
-rw-r--r-- | sc/source/ui/dbgui/csvruler.cxx | 37 | ||||
-rw-r--r-- | sc/source/ui/dbgui/csvsplits.cxx | 20 | ||||
-rw-r--r-- | sc/source/ui/dbgui/csvtablebox.cxx | 12 | ||||
-rw-r--r-- | sc/source/ui/inc/AccessibleCsvControl.hxx | 123 | ||||
-rw-r--r-- | sc/source/ui/inc/AccessibleText.hxx | 75 | ||||
-rw-r--r-- | sc/source/ui/inc/csvcontrol.hxx | 12 | ||||
-rw-r--r-- | sc/source/ui/inc/csvgrid.hxx | 11 | ||||
-rw-r--r-- | sc/source/ui/inc/csvsplits.hxx | 8 |
12 files changed, 501 insertions, 387 deletions
diff --git a/sc/source/ui/Accessibility/AccessibleCsvControl.cxx b/sc/source/ui/Accessibility/AccessibleCsvControl.cxx index a803a85ab7bc..e2a301fb1534 100644 --- a/sc/source/ui/Accessibility/AccessibleCsvControl.cxx +++ b/sc/source/ui/Accessibility/AccessibleCsvControl.cxx @@ -2,9 +2,9 @@ * * $RCSfile: AccessibleCsvControl.cxx,v $ * - * $Revision: 1.1 $ + * $Revision: 1.2 $ * - * last change: $Author: dr $ $Date: 2002-08-15 09:27:02 $ + * last change: $Author: dr $ $Date: 2002-08-16 12:57:30 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -106,6 +106,19 @@ #include <comphelper/sequence.hxx> #endif +#ifndef SC_ITEMS_HXX +#include "scitems.hxx" +#endif +#ifndef _SVX_FONTITEM_HXX +#include <svx/fontitem.hxx> +#endif +#ifndef _SVX_FHGTITEM_HXX +#include <svx/fhgtitem.hxx> +#endif +#ifndef _SVX_LANGITEM_HXX +#include <svx/langitem.hxx> +#endif + #ifndef _SC_CSVCONTROL_HXX #include "csvcontrol.hxx" #endif @@ -115,6 +128,12 @@ #ifndef _SC_CSVGRID_HXX #include "csvgrid.hxx" #endif +#ifndef _SC_ACCESSIBLETEXT_HXX +#include "AccessibleText.hxx" +#endif +#ifndef SC_EDITSRC_HXX +#include "editsrc.hxx" +#endif #ifndef SC_UNOGUARD_HXX #include "unoguard.hxx" @@ -129,6 +148,7 @@ using ::rtl::OUString; using ::rtl::OUStringBuffer; using ::utl::AccessibleRelationSetHelper; using ::utl::AccessibleStateSetHelper; +using ::accessibility::AccessibleStaticTextBase; using ::com::sun::star::uno::Any; using ::com::sun::star::uno::Reference; using ::com::sun::star::uno::Sequence; @@ -142,32 +162,22 @@ using namespace ::drafts::com::sun::star::accessibility; // ---------------------------------------------------------------------------- -const sal_uInt16 nRulerRole = AccessibleRole::TEXT; -const sal_uInt16 nGridRole = AccessibleRole::TABLE; -const sal_uInt16 nCellRole = AccessibleRole::TEXT; +const sal_uInt16 nRulerRole = AccessibleRole::TEXT; +const sal_uInt16 nGridRole = AccessibleRole::TABLE; +const sal_uInt16 nCellRole = AccessibleRole::TEXT; -const sal_Unicode cRulerDot = '.'; -const sal_Unicode cRulerLine = '|'; +#define CREATE_OUSTRING( name ) OUString( RTL_CONSTASCII_USTRINGPARAM( name ) ) +#define RULER_IMPL_NAME "ScAccessibleCsvRuler" +#define GRID_IMPL_NAME "ScAccessibleCsvGrid" +#define CELL_IMPL_NAME "ScAccessibleCsvCell" -// forwarders ================================================================= -#if 0 -/** Used for cell text handling. */ -class ScCsvCellViewForwarder : public SvxViewForwarder -{ -private: - ScCsvGrid* mpGrid; +const sal_Unicode cRulerDot = '.'; +const sal_Unicode cRulerLine = '|'; -public: - ScCsvViewForwarder( ScCsvGrid* pGrid ); - virtual ~ScCsvViewForwarder(); +const sal_Int32 CSV_LINE_HEADER = CSV_POS_INVALID; +const sal_uInt32 CSV_COLUMN_HEADER = CSV_COLUMN_INVALID; - virtual BOOL IsValid() const; - virtual Rectangle GetVisArea() const; - virtual Point LogicToPixel( const Point& rPoint, const MapMode& rMapMode ) const; - virtual Point PixelToLogic( const Point& rPoint, const MapMode& rMapMode ) const; -}; -#endif // CSV base control =========================================================== @@ -235,6 +245,14 @@ void ScAccessibleCsvControl::SendCaretEvent() DBG_ERRORFILE( "ScAccessibleCsvControl::SendCaretEvent - Illegal call" ); } +void ScAccessibleCsvControl::SendVisibleEvent() +{ + AccessibleEventObject aEvent; + aEvent.EventId = AccessibleEventId::ACCESSIBLE_VISIBLE_DATA_EVENT; + aEvent.Source = Reference< XAccessible >( this ); + CommitChange( aEvent ); +} + void ScAccessibleCsvControl::SendSelectionEvent() { AccessibleEventObject aEvent; @@ -401,6 +419,39 @@ sal_Int32 lcl_GetRulerPos( sal_Int32 nApiPos ) return nRulerPos + nRelPos / nDiv * 10 + ::std::max( nRelPos % nDiv - nDiv + 10L, 0L ); } +/** Expands the sequence's size and returns the base index of the new inserted elements. */ +inline sal_Int32 lcl_ExpandSequence( Sequence< PropertyValue >& rSeq, sal_Int32 nExp ) +{ + DBG_ASSERT( nExp > 0, "lcl_ExpandSequence - invalid value" ); + rSeq.realloc( rSeq.getLength() + nExp ); + return rSeq.getLength() - nExp; +} + +/** Fills the property value rVal with the specified name and value from the item. */ +inline void lcl_FillProperty( PropertyValue& rVal, const OUString& rPropName, const SfxPoolItem& rItem, sal_uInt8 nMID ) +{ + rVal.Name = rPropName; + rItem.QueryValue( rVal.Value, nMID ); +} + +/** Fills the sequence with all font attributes of rFont. */ +void lcl_FillFontAttributes( Sequence< PropertyValue >& rSeq, const Font& rFont ) +{ + SvxFontItem aFontItem( rFont.GetFamily(), rFont.GetName(), rFont.GetStyleName(), rFont.GetPitch(), rFont.GetCharSet() ); + SvxFontHeightItem aHeightItem( rFont.GetSize().Height() ); + SvxLanguageItem aLangItem( rFont.GetLanguage() ); + + sal_Int32 nIndex = lcl_ExpandSequence( rSeq, 7 ); + lcl_FillProperty( rSeq[ nIndex++ ], CREATE_OUSTRING( "CharFontName" ), aFontItem, MID_FONT_FAMILY_NAME ); + lcl_FillProperty( rSeq[ nIndex++ ], CREATE_OUSTRING( "CharFontFamily" ), aFontItem, MID_FONT_FAMILY ); + lcl_FillProperty( rSeq[ nIndex++ ], CREATE_OUSTRING( "CharFontStyleName" ), aFontItem, MID_FONT_STYLE_NAME ); + lcl_FillProperty( rSeq[ nIndex++ ], CREATE_OUSTRING( "CharFontCharSet" ), aFontItem, MID_FONT_PITCH ); + lcl_FillProperty( rSeq[ nIndex++ ], CREATE_OUSTRING( "CharFontPitch" ), aFontItem, MID_FONT_CHAR_SET ); + lcl_FillProperty( rSeq[ nIndex++ ], CREATE_OUSTRING( "CharHeight" ), aHeightItem, MID_FONTHEIGHT ); + lcl_FillProperty( rSeq[ nIndex++ ], CREATE_OUSTRING( "CharLocale" ), aLangItem, MID_LANG_LOCALE ); +} + + // ---------------------------------------------------------------------------- @@ -501,14 +552,14 @@ Sequence< PropertyValue > SAL_CALL ScAccessibleCsvRuler::getCharacterAttributes( ScUnoGuard aGuard; ensureAlive(); ensureValidIndex( nIndex ); - Sequence< PropertyValue > aSeq; //! TODO + Sequence< PropertyValue > aSeq; + lcl_FillFontAttributes( aSeq, implGetRuler().GetFont() ); //! TODO split attribute: waiting for #102221# // if( implHasSplit( nIndex ) ) // { -// sal_Int32 nLen = aSeq.getLength(); -// aSeq.realloc( nLen + 1 ); -// aSeq[ nLen ].Name = OUString( RTL_CONSTASCII_USTRINGPARAM( "..." ) ); -// aSeq[ nLen ].Value <<= ...; +// sal_Int32 nIndex = lcl_ExpandSequence( aSeq, 1 ); +// aSeq[ nIndex ].Name = CREATE_OUSTRING( "..." ); +// aSeq[ nIndex ].Value <<= ...; // } return aSeq; } @@ -763,7 +814,7 @@ void SAL_CALL ScAccessibleCsvRuler::release() throw () OUString SAL_CALL ScAccessibleCsvRuler::getImplementationName() throw( RuntimeException ) { - return OUString( RTL_CONSTASCII_USTRINGPARAM( "ScAccessibleCsvRuler" ) ); + return CREATE_OUSTRING( RULER_IMPL_NAME ); } @@ -789,7 +840,7 @@ Sequence< sal_Int8 > SAL_CALL ScAccessibleCsvRuler::getImplementationId() throw( void ScAccessibleCsvRuler::SendCaretEvent() { sal_Int32 nPos = implGetRuler().GetRulerCursorPos(); - if( nPos != POS_INVALID ) + if( nPos != CSV_POS_INVALID ) { AccessibleEventObject aEvent; aEvent.EventId = AccessibleEventId::ACCESSIBLE_CARET_EVENT; @@ -885,13 +936,13 @@ sal_Int32 ScAccessibleCsvRuler::implGetLastEqualFormatted( sal_Int32 nApiPos ) /** Converts a grid columnm index to an API column index. */ inline sal_Int32 lcl_GetApiColumn( sal_uInt32 nGridColumn ) { - return (nGridColumn != VEC_NOTFOUND) ? static_cast< sal_Int32 >( nGridColumn + 1 ) : 0; + return (nGridColumn != CSV_COLUMN_HEADER) ? static_cast< sal_Int32 >( nGridColumn + 1 ) : 0; } /** Converts an API columnm index to a ScCsvGrid column index. */ inline sal_uInt32 lcl_GetGridColumn( sal_Int32 nApiColumn ) { - return (nApiColumn > 0) ? static_cast< sal_uInt32 >( nApiColumn - 1 ) : VEC_NOTFOUND; + return (nApiColumn > 0) ? static_cast< sal_uInt32 >( nApiColumn - 1 ) : CSV_COLUMN_HEADER; } @@ -917,13 +968,18 @@ ScAccessibleCsvGrid::~ScAccessibleCsvGrid() Reference< XAccessible > SAL_CALL ScAccessibleCsvGrid::getAccessibleAt( const AwtPoint& rPoint ) throw( RuntimeException ) { - ScUnoGuard aGuard; - ensureAlive(); + Reference< XAccessible > xRet; + if( contains( rPoint ) ) + { + ScUnoGuard aGuard; + ensureAlive(); - const ScCsvGrid& rGrid = implGetGrid(); - sal_Int32 nColumn = (rPoint.X > rGrid.GetOffsetX()) ? lcl_GetApiColumn( rGrid.GetColumnFromX( rPoint.X ) ) : 0; - sal_Int32 nRow = (rPoint.Y > rGrid.GetOffsetY()) ? (rGrid.GetLineFromY( rPoint.Y ) - rGrid.GetFirstVisLine() + 1) : 0; - return implCreateCellObj( nRow, nColumn ); + const ScCsvGrid& rGrid = implGetGrid(); + sal_Int32 nColumn = (rPoint.X > rGrid.GetOffsetX()) ? lcl_GetApiColumn( rGrid.GetColumnFromX( rPoint.X ) ) : 0; + sal_Int32 nRow = (rPoint.Y > rGrid.GetOffsetY()) ? (rGrid.GetLineFromY( rPoint.Y ) - rGrid.GetFirstVisLine() + 1) : 0; + xRet = implCreateCellObj( nRow, nColumn ); + } + return xRet; } @@ -1058,7 +1114,7 @@ Sequence< sal_Int32 > SAL_CALL ScAccessibleCsvGrid::getSelectedAccessibleColumns sal_Int32 nSeqIx = 0; sal_uInt32 nColIx = rGrid.GetFirstSelected(); - for( ; nColIx != VEC_NOTFOUND; ++nSeqIx, nColIx = rGrid.GetNextSelected( nColIx ) ) + for( ; nColIx != CSV_COLUMN_INVALID; ++nSeqIx, nColIx = rGrid.GetNextSelected( nColIx ) ) aSeq[ nSeqIx ] = lcl_GetApiColumn( nColIx ); aSeq.realloc( nSeqIx ); @@ -1236,7 +1292,7 @@ void SAL_CALL ScAccessibleCsvGrid::release() throw () OUString SAL_CALL ScAccessibleCsvGrid::getImplementationName() throw( RuntimeException ) { - return OUString( RTL_CONSTASCII_USTRINGPARAM( "ScAccessibleCsvGrid" ) ); + return CREATE_OUSTRING( GRID_IMPL_NAME ); } @@ -1374,7 +1430,7 @@ sal_Int32 ScAccessibleCsvGrid::implGetSelColumnCount() const { ScCsvGrid& rGrid = implGetGrid(); sal_Int32 nCount = 0; - for( sal_uInt32 nColIx = rGrid.GetFirstSelected(); nColIx != VEC_NOTFOUND; nColIx = rGrid.GetNextSelected( nColIx ) ) + for( sal_uInt32 nColIx = rGrid.GetFirstSelected(); nColIx != CSV_COLUMN_INVALID; nColIx = rGrid.GetNextSelected( nColIx ) ) ++nCount; return nCount; } @@ -1383,7 +1439,7 @@ sal_Int32 ScAccessibleCsvGrid::implGetSelColumn( sal_Int32 nSelColumn ) const { ScCsvGrid& rGrid = implGetGrid(); sal_Int32 nColumn = 0; - for( sal_uInt32 nColIx = rGrid.GetFirstSelected(); nColIx != VEC_NOTFOUND; nColIx = rGrid.GetNextSelected( nColIx ) ) + for( sal_uInt32 nColIx = rGrid.GetFirstSelected(); nColIx != CSV_COLUMN_INVALID; nColIx = rGrid.GetNextSelected( nColIx ) ) { if( nColumn == nSelColumn ) return static_cast< sal_Int32 >( nColIx + 1 ); @@ -1392,15 +1448,15 @@ sal_Int32 ScAccessibleCsvGrid::implGetSelColumn( sal_Int32 nSelColumn ) const return 0; } -OUString ScAccessibleCsvGrid::implGetCellText( sal_Int32 nRow, sal_Int32 nColumn ) const +String ScAccessibleCsvGrid::implGetCellText( sal_Int32 nRow, sal_Int32 nColumn ) const { ScCsvGrid& rGrid = implGetGrid(); sal_Int32 nLine = nRow + rGrid.GetFirstVisLine() - 1; - OUString aCellStr; + String aCellStr; if( (nColumn > 0) && (nRow > 0) ) aCellStr = rGrid.GetCellText( lcl_GetGridColumn( nColumn ), nLine ); else if( nRow > 0 ) - aCellStr = OUString::valueOf( nLine + 1L ); + aCellStr = String::CreateFromInt32( nLine + 1L ); else if( nColumn > 0 ) aCellStr = rGrid.GetColumnTypeName( lcl_GetGridColumn( nColumn ) ); return aCellStr; @@ -1419,15 +1475,17 @@ DBG_NAME( ScAccessibleCsvCell ) ScAccessibleCsvCell::ScAccessibleCsvCell( ScCsvGrid& rGrid, - const ::rtl::OUString& rCellText, + const String& rCellText, sal_Int32 nRow, sal_Int32 nColumn ) : ScAccessibleCsvControl( rGrid.GetAccessible(), rGrid, nCellRole ), + AccessibleStaticTextBase( SvxEditSourcePtr( NULL ) ), maCellText( rCellText ), - mnLine( nRow ? (nRow + rGrid.GetFirstVisLine() - 1) : POS_INVALID ), + mnLine( nRow ? (nRow + rGrid.GetFirstVisLine() - 1) : CSV_LINE_HEADER ), mnColumn( lcl_GetGridColumn( nColumn ) ), mnIndex( nRow * (rGrid.GetColumnCount() + 1) + nColumn ) { DBG_CTOR( ScAccessibleCsvCell, NULL ); + SetEditSource( implCreateEditSource() ); } ScAccessibleCsvCell::~ScAccessibleCsvCell() @@ -1435,6 +1493,12 @@ ScAccessibleCsvCell::~ScAccessibleCsvCell() DBG_DTOR( ScAccessibleCsvCell, NULL ); } +void SAL_CALL ScAccessibleCsvCell::disposing() +{ + SetEditSource( SvxEditSourcePtr( NULL ) ); + ScAccessibleCsvControl::disposing(); +} + // XAccessibleComponent ------------------------------------------------------- @@ -1449,19 +1513,6 @@ void SAL_CALL ScAccessibleCsvCell::grabFocus() throw( RuntimeException ) // XAccessibleContext ----------------------------------------------------- -sal_Int32 SAL_CALL ScAccessibleCsvCell::getAccessibleChildCount() throw( RuntimeException ) -{ - ensureAlive(); - return 0; -} - -Reference< XAccessible > SAL_CALL ScAccessibleCsvCell::getAccessibleChild( sal_Int32 nIndex ) - throw( IndexOutOfBoundsException, RuntimeException ) -{ - ensureAlive(); - throw IndexOutOfBoundsException(); -} - sal_Int32 SAL_CALL ScAccessibleCsvCell::getAccessibleIndexInParent() throw( RuntimeException ) { ScUnoGuard aGuard; @@ -1485,13 +1536,10 @@ Reference< XAccessibleStateSet > SAL_CALL ScAccessibleCsvCell::getAccessibleStat { const ScCsvGrid& rGrid = implGetGrid(); pStateSet->AddState( AccessibleStateType::SINGLE_LINE ); - if( mnColumn != VEC_NOTFOUND ) - { - pStateSet->AddState( AccessibleStateType::FOCUSABLE ); + if( mnColumn != CSV_COLUMN_HEADER ) pStateSet->AddState( AccessibleStateType::SELECTABLE ); - } - if( rGrid.HasFocus() && (rGrid.GetFocusColumn() == mnColumn) ) - pStateSet->AddState( AccessibleStateType::FOCUSED ); + if( rGrid.HasFocus() && (rGrid.GetFocusColumn() == mnColumn) && (mnLine == CSV_LINE_HEADER) ) + pStateSet->AddState( AccessibleStateType::ACTIVE ); if( rGrid.IsSelected( mnColumn ) ) pStateSet->AddState( AccessibleStateType::SELECTED ); } @@ -1499,142 +1547,17 @@ Reference< XAccessibleStateSet > SAL_CALL ScAccessibleCsvCell::getAccessibleStat } -// XAccessibleText ------------------------------------------------------------ - -sal_Int32 SAL_CALL ScAccessibleCsvCell::getCaretPosition() throw( RuntimeException ) -{ - ensureAlive(); - return 0; -} - -sal_Bool SAL_CALL ScAccessibleCsvCell::setCaretPosition( sal_Int32 nIndex ) - throw( IndexOutOfBoundsException, RuntimeException ) -{ - ensureAlive(); - return sal_False; -} - -sal_Unicode SAL_CALL ScAccessibleCsvCell::getCharacter( sal_Int32 nIndex ) - throw( IndexOutOfBoundsException, RuntimeException ) -{ - ScUnoGuard aGuard; - ensureAlive(); - ensureValidIndex( nIndex ); - return maCellText.getStr()[ nIndex ]; -} - -Sequence< PropertyValue > SAL_CALL ScAccessibleCsvCell::getCharacterAttributes( sal_Int32 nIndex ) - throw( IndexOutOfBoundsException, RuntimeException ) -{ - ScUnoGuard aGuard; - ensureAlive(); - ensureValidIndex( nIndex ); - return Sequence< PropertyValue >(); //! TODO -} - -ScAccessibleCsvCell::AwtRectangle SAL_CALL ScAccessibleCsvCell::getCharacterBounds( sal_Int32 nIndex ) - throw( IndexOutOfBoundsException, RuntimeException ) -{ - ScUnoGuard aGuard; - ensureAlive(); - ensureValidIndex( nIndex ); - ScCsvGrid& rGrid = implGetGrid(); - return AwtRectangle( nIndex * rGrid.GetCharWidth(), 0, rGrid.GetCharWidth(), rGrid.GetLineHeight() ); -} - -sal_Int32 SAL_CALL ScAccessibleCsvCell::getCharacterCount() throw( RuntimeException ) -{ - ScUnoGuard aGuard; - ensureAlive(); - return maCellText.getLength(); -} - -sal_Int32 SAL_CALL ScAccessibleCsvCell::getIndexAtPoint( const AwtPoint& rPoint ) - throw( RuntimeException ) -{ - ScUnoGuard aGuard; - ensureAlive(); - sal_Int32 nIndex = rPoint.X / implGetGrid().GetCharWidth(); - return ((0 <= nIndex) && (nIndex < maCellText.getLength())) ? nIndex : -1; -} - -OUString SAL_CALL ScAccessibleCsvCell::getSelectedText() throw( RuntimeException ) -{ - ensureAlive(); - return OUString(); -} - -sal_Int32 SAL_CALL ScAccessibleCsvCell::getSelectionStart() throw( RuntimeException ) -{ - ensureAlive(); - return -1; -} - -sal_Int32 SAL_CALL ScAccessibleCsvCell::getSelectionEnd() throw( RuntimeException ) -{ - ensureAlive(); - return -1; -} - -sal_Bool SAL_CALL ScAccessibleCsvCell::setSelection( sal_Int32 nStartIndex, sal_Int32 nEndIndex ) - throw( IndexOutOfBoundsException, RuntimeException ) -{ - ensureAlive(); - return sal_False; -} - -OUString SAL_CALL ScAccessibleCsvCell::getText() throw( RuntimeException ) -{ - ScUnoGuard aGuard; - ensureAlive(); - return maCellText; -} - -OUString SAL_CALL ScAccessibleCsvCell::getTextRange( sal_Int32 nStartIndex, sal_Int32 nEndIndex ) - throw( IndexOutOfBoundsException, RuntimeException ) -{ - ScUnoGuard aGuard; - ensureAlive(); - ensureValidRange( nStartIndex, nEndIndex ); - return maCellText.copy( nStartIndex, nEndIndex - nStartIndex ); -} - -OUString SAL_CALL ScAccessibleCsvCell::getTextAtIndex( sal_Int32 nIndex, sal_Int16 nTextType ) - throw( IndexOutOfBoundsException, RuntimeException ) -{ - ensureAlive(); - return OUString(); //! TODO -} - -OUString SAL_CALL ScAccessibleCsvCell::getTextBeforeIndex( sal_Int32 nIndex, sal_Int16 nTextType ) - throw( IndexOutOfBoundsException, RuntimeException ) -{ - ensureAlive(); - return OUString(); //! TODO -} - -OUString SAL_CALL ScAccessibleCsvCell::getTextBehindIndex( sal_Int32 nIndex, sal_Int16 nTextType ) - throw( IndexOutOfBoundsException, RuntimeException ) -{ - ensureAlive(); - return OUString(); //! TODO -} - -sal_Bool SAL_CALL ScAccessibleCsvCell::copyText( sal_Int32 nStartIndex, sal_Int32 nEndIndex ) - throw( IndexOutOfBoundsException, RuntimeException ) -{ - ensureAlive(); - return sal_False; -} - - // XInterface ----------------------------------------------------------------- Any SAL_CALL ScAccessibleCsvCell::queryInterface( const ::com::sun::star::uno::Type& rType ) throw( RuntimeException ) { - Any aAny( ScAccessibleCsvCellImpl::queryInterface( rType ) ); - return aAny.hasValue() ? aAny : ScAccessibleCsvControl::queryInterface( rType ); + Any aAny; + if( rType == getCppuType( static_cast< const Reference< XAccessibleText >* >( NULL ) ) ) + aAny <<= Reference< XAccessibleText >( this ); + else + aAny <<= ScAccessibleCsvControl::queryInterface( rType ); + return aAny; } void SAL_CALL ScAccessibleCsvCell::acquire() throw() @@ -1651,7 +1574,7 @@ void SAL_CALL ScAccessibleCsvCell::release() throw() OUString SAL_CALL ScAccessibleCsvCell::getImplementationName() throw( RuntimeException ) { - return OUString( RTL_CONSTASCII_USTRINGPARAM( "ScAccessibleCsvCell" ) ); + return CREATE_OUSTRING( CELL_IMPL_NAME ); } @@ -1690,53 +1613,64 @@ Rectangle ScAccessibleCsvCell::GetBoundingBox() const throw( RuntimeException ) return implGetBoundingBox(); } -Rectangle ScAccessibleCsvCell::implGetBoundingBox() const +OUString SAL_CALL ScAccessibleCsvCell::createAccessibleName() throw( RuntimeException ) { - ScCsvGrid& rGrid = implGetGrid(); - Point aPos; - Size aSize( rGrid.GetOffsetX(), rGrid.GetOffsetY() ); - if( mnColumn != VEC_NOTFOUND ) - { - aPos.X() = rGrid.GetColumnX( mnColumn ); - aSize.Width() = rGrid.GetColumnWidth( mnColumn ); - } - if( mnLine == POS_INVALID ) - { - aPos.Y() = rGrid.GetY( mnLine ); - aSize.Height() = rGrid.GetLineHeight(); - } - return Rectangle( aPos, aSize ); + return maCellText; } -OUString SAL_CALL ScAccessibleCsvCell::createAccessibleName() throw( RuntimeException ) +OUString SAL_CALL ScAccessibleCsvCell::createAccessibleDescription() throw( RuntimeException ) { return OUString(); } -OUString SAL_CALL ScAccessibleCsvCell::createAccessibleDescription() throw( RuntimeException ) +ScCsvGrid& ScAccessibleCsvCell::implGetGrid() const { - return OUString(); + return static_cast< ScCsvGrid& >( implGetControl() ); } -void ScAccessibleCsvCell::ensureValidIndex( sal_Int32 nIndex ) const - throw( IndexOutOfBoundsException ) +Point ScAccessibleCsvCell::implGetRealPos() const { - if( nIndex >= maCellText.getLength() ) - throw IndexOutOfBoundsException(); + ScCsvGrid& rGrid = implGetGrid(); + return Point( + (mnColumn == CSV_COLUMN_HEADER) ? 0 : rGrid.GetColumnX( mnColumn ), + (mnLine == CSV_LINE_HEADER) ? 0 : rGrid.GetY( mnLine ) ); } -void ScAccessibleCsvCell::ensureValidRange( sal_Int32& rnStartIndex, sal_Int32& rnEndIndex ) const - throw( IndexOutOfBoundsException ) +Size ScAccessibleCsvCell::implGetRealSize() const { - if( rnStartIndex > rnEndIndex ) - ::std::swap( rnStartIndex, rnEndIndex ); - if( (rnStartIndex < 0) || (rnEndIndex > maCellText.getLength()) ) - throw IndexOutOfBoundsException(); + ScCsvGrid& rGrid = implGetGrid(); + return Size( + (mnColumn == CSV_COLUMN_HEADER) ? rGrid.GetOffsetX() : rGrid.GetColumnWidth( mnColumn ), + (mnLine == CSV_LINE_HEADER) ? rGrid.GetOffsetY() : rGrid.GetLineHeight() ); } -ScCsvGrid& ScAccessibleCsvCell::implGetGrid() const +Rectangle ScAccessibleCsvCell::implGetBoundingBox() const { - return static_cast< ScCsvGrid& >( implGetControl() ); + ScCsvGrid& rGrid = implGetGrid(); + Rectangle aClipRect( Point( 0, 0 ), rGrid.GetSizePixel() ); + if( mnColumn != CSV_COLUMN_HEADER ) + aClipRect.Left() = rGrid.GetOffsetX(); + if( mnLine != CSV_LINE_HEADER ) + aClipRect.Top() = rGrid.GetOffsetY(); + + Rectangle aRect( implGetRealPos(), implGetRealSize() ); + aRect.Intersection( aClipRect ); + if( (aRect.GetWidth() <= 0) || (aRect.GetHeight() <= 0) ) + aRect.SetSize( Size( -1, -1 ) ); + return aRect; +} + +::std::auto_ptr< SvxEditSource > ScAccessibleCsvCell::implCreateEditSource() +{ + ScCsvGrid& rGrid = implGetGrid(); + Rectangle aBoundRect( implGetBoundingBox() ); + aBoundRect -= implGetRealPos(); + + ::std::auto_ptr< ScAccessibleTextData > pCsvTextData( new ScAccessibleCsvTextData( + &rGrid, rGrid.GetEditEngine(), maCellText, aBoundRect, implGetRealSize() ) ); + + ::std::auto_ptr< SvxEditSource > pEditSource( new ScAccessibilityEditSource( pCsvTextData ) ); + return pEditSource; } diff --git a/sc/source/ui/Accessibility/AccessibleText.cxx b/sc/source/ui/Accessibility/AccessibleText.cxx index dbdddc5d4639..1691dbcbcbae 100644 --- a/sc/source/ui/Accessibility/AccessibleText.cxx +++ b/sc/source/ui/Accessibility/AccessibleText.cxx @@ -2,9 +2,9 @@ * * $RCSfile: AccessibleText.cxx,v $ * - * $Revision: 1.20 $ + * $Revision: 1.21 $ * - * last change: $Author: sab $ $Date: 2002-08-09 13:00:48 $ + * last change: $Author: dr $ $Date: 2002-08-16 12:57:30 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -120,6 +120,9 @@ #include <svx/svdmodel.hxx> #endif + +// ============================================================================ + class ScViewForwarder : public SvxViewForwarder { ScTabViewShell* mpViewShell; @@ -204,6 +207,9 @@ Point ScViewForwarder::PixelToLogic( const Point& rPoint, const MapMode& rMapMod return Point(); } + +// ============================================================================ + class ScEditObjectViewForwarder : public SvxViewForwarder { Window* mpWindow; @@ -266,6 +272,9 @@ Point ScEditObjectViewForwarder::PixelToLogic( const Point& rPoint, const MapMod return Point(); } + +// ============================================================================ + class ScPreviewViewForwarder : public SvxViewForwarder { ScPreviewShell* mpViewShell; @@ -370,6 +379,9 @@ void ScPreviewViewForwarder::FillTableInfo() const } } + +// ============================================================================ + class ScEditViewForwarder : public SvxEditViewForwarder { EditView* mpEditView; @@ -513,6 +525,9 @@ void ScEditViewForwarder::GrabFocus() { } + +// ============================================================================ + // ScAccessibleCellTextData: shared data between sub objects of a accessible cell text object ScAccessibleCellTextData::ScAccessibleCellTextData(ScTabViewShell* pViewShell, @@ -662,6 +677,9 @@ ScDocShell* ScAccessibleCellTextData::GetDocShell(ScTabViewShell* pViewShell) return pDocSh; } + +// ============================================================================ + ScAccessibleEditObjectTextData::ScAccessibleEditObjectTextData(EditView* pEditView, Window* pWin) : mpViewForwarder(NULL), @@ -759,6 +777,9 @@ IMPL_LINK(ScAccessibleEditObjectTextData, NotifyHdl, EENotify*, aNotify) return 0; } + +// ============================================================================ + ScAccessibleEditLineTextData::ScAccessibleEditLineTextData(EditView* pEditView, Window* pWin) : ScAccessibleEditObjectTextData(pEditView, pWin), @@ -906,6 +927,9 @@ void ScAccessibleEditLineTextData::EndEdit() mpEditView = NULL; } + +// ============================================================================ + // ScAccessiblePreviewCellTextData: shared data between sub objects of a accessible cell text object ScAccessiblePreviewCellTextData::ScAccessiblePreviewCellTextData(ScPreviewShell* pViewShell, @@ -991,6 +1015,9 @@ ScDocShell* ScAccessiblePreviewCellTextData::GetDocShell(ScPreviewShell* pViewSh return pDocSh; } + +// ============================================================================ + // ScAccessiblePreviewHeaderCellTextData: shared data between sub objects of a accessible cell text object ScAccessiblePreviewHeaderCellTextData::ScAccessiblePreviewHeaderCellTextData(ScPreviewShell* pViewShell, @@ -1116,6 +1143,9 @@ ScDocShell* ScAccessiblePreviewHeaderCellTextData::GetDocShell(ScPreviewShell* p return pDocSh; } + +// ============================================================================ + ScAccessibleHeaderTextData::ScAccessibleHeaderTextData(ScPreviewShell* pViewShell, const EditTextObject* pEditObj, sal_Bool bHeader, SvxAdjust eAdjust) : @@ -1228,6 +1258,9 @@ SvxViewForwarder* ScAccessibleHeaderTextData::GetViewForwarder() return mpViewForwarder; } + +// ============================================================================ + ScAccessibleNoteTextData::ScAccessibleNoteTextData(ScPreviewShell* pViewShell, const String& sText, const ScAddress& aCellPos, sal_Bool bMarkNote) : @@ -1341,3 +1374,117 @@ SvxViewForwarder* ScAccessibleNoteTextData::GetViewForwarder() mpViewForwarder = new ScPreviewViewForwarder(mpViewShell); return mpViewForwarder; } + + +// CSV import ================================================================= + +class ScCsvViewForwarder : public SvxViewForwarder +{ + Rectangle maBoundBox; + Window* mpWindow; + +public: + explicit ScCsvViewForwarder( Window* pWindow, const Rectangle& rBoundBox ); + + virtual BOOL IsValid() const; + virtual Rectangle GetVisArea() const; + virtual Point LogicToPixel( const Point& rPoint, const MapMode& rMapMode ) const; + virtual Point PixelToLogic( const Point& rPoint, const MapMode& rMapMode ) const; +}; + +ScCsvViewForwarder::ScCsvViewForwarder( Window* pWindow, const Rectangle& rBoundBox ) : + maBoundBox( rBoundBox ), + mpWindow( pWindow ) +{ +} + +BOOL ScCsvViewForwarder::IsValid() const +{ + return mpWindow != NULL; +} + +Rectangle ScCsvViewForwarder::GetVisArea() const +{ + return maBoundBox; +} + +Point ScCsvViewForwarder::LogicToPixel( const Point& rPoint, const MapMode& rMapMode ) const +{ + if( !mpWindow ) return Point(); + return mpWindow->LogicToPixel( rPoint, rMapMode ); +} + +Point ScCsvViewForwarder::PixelToLogic( const Point& rPoint, const MapMode& rMapMode ) const +{ + if( !mpWindow ) return Point(); + return mpWindow->PixelToLogic( rPoint, rMapMode ); +} + + +// ---------------------------------------------------------------------------- + +ScAccessibleCsvTextData::ScAccessibleCsvTextData( + Window* pWindow, EditEngine* pEditEngine, + const String& rCellText, const Rectangle& rBoundBox, const Size& rCellSize ) : + mpWindow( pWindow ), + mpEditEngine( pEditEngine ), + maCellText( rCellText ), + maBoundBox( rBoundBox ), + maCellSize( rCellSize ) +{ +} + +ScAccessibleCsvTextData::~ScAccessibleCsvTextData() +{ +} + +void ScAccessibleCsvTextData::Notify( SfxBroadcaster& rBC, const SfxHint& rHint ) +{ + if ( rHint.ISA( SfxSimpleHint ) ) + { + ULONG nId = ((const SfxSimpleHint&)rHint).GetId(); + if( nId == SFX_HINT_DYING ) + { + mpWindow = NULL; + mpEditEngine = NULL; + mpTextForwarder.reset( NULL ); + mpViewForwarder.reset( NULL ); + } + } + ScAccessibleTextData::Notify( rBC, rHint ); +} + +ScAccessibleTextData* ScAccessibleCsvTextData::Clone() const +{ + return new ScAccessibleCsvTextData( mpWindow, mpEditEngine, maCellText, maBoundBox, maCellSize ); +} + +SvxTextForwarder* ScAccessibleCsvTextData::GetTextForwarder() +{ + if( mpEditEngine ) + { + mpEditEngine->SetPaperSize( maCellSize ); + mpEditEngine->SetText( maCellText ); + if( !mpTextForwarder.get() ) + mpTextForwarder.reset( new SvxEditEngineForwarder( *mpEditEngine ) ); + } + else + mpTextForwarder.reset( NULL ); + return mpTextForwarder.get(); +} + +SvxViewForwarder* ScAccessibleCsvTextData::GetViewForwarder() +{ + if( !mpViewForwarder.get() ) + mpViewForwarder.reset( new ScCsvViewForwarder( mpWindow, maBoundBox ) ); + return mpViewForwarder.get(); +} + +SvxEditViewForwarder* ScAccessibleCsvTextData::GetEditViewForwarder( sal_Bool bCreate ) +{ + return NULL; +} + + +// ============================================================================ + diff --git a/sc/source/ui/dbgui/csvcontrol.cxx b/sc/source/ui/dbgui/csvcontrol.cxx index 7748f8cb9222..1492fa88858b 100644 --- a/sc/source/ui/dbgui/csvcontrol.cxx +++ b/sc/source/ui/dbgui/csvcontrol.cxx @@ -2,9 +2,9 @@ * * $RCSfile: csvcontrol.cxx,v $ * - * $Revision: 1.4 $ + * $Revision: 1.5 $ * - * last change: $Author: dr $ $Date: 2002-08-15 09:28:08 $ + * last change: $Author: dr $ $Date: 2002-08-16 12:59:08 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -92,7 +92,7 @@ ScCsvLayoutData::ScCsvLayoutData() : mnWinHeight( 1 ), mnOffsetY( 0 ), mnLineHeight( 1 ), - mnPosCursor( POS_INVALID ), + mnPosCursor( CSV_POS_INVALID ), mnColCursor( 0 ), mnNoRepaint( 0 ) { @@ -174,6 +174,12 @@ void ScCsvControl::AccSendCaretEvent() mpAccessible->SendCaretEvent(); } +void ScCsvControl::AccSendVisibleEvent() +{ + if( mpAccessible ) + mpAccessible->SendVisibleEvent(); +} + void ScCsvControl::AccSendSelectionEvent() { if( mpAccessible ) diff --git a/sc/source/ui/dbgui/csvgrid.cxx b/sc/source/ui/dbgui/csvgrid.cxx index 140b65078f63..7e15c223fc16 100644 --- a/sc/source/ui/dbgui/csvgrid.cxx +++ b/sc/source/ui/dbgui/csvgrid.cxx @@ -2,9 +2,9 @@ * * $RCSfile: csvgrid.cxx,v $ * - * $Revision: 1.12 $ + * $Revision: 1.13 $ * - * last change: $Author: dr $ $Date: 2002-08-15 09:28:08 $ + * last change: $Author: dr $ $Date: 2002-08-16 12:59:09 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -138,9 +138,11 @@ ScCsvGrid::ScCsvGrid( ScCsvControl& rParent ) : maHeaderFont( GetFont() ), maColStates( 1 ), maTypeNames( 1 ), - mnRecentSelCol( VEC_NOTFOUND ) + mnRecentSelCol( CSV_COLUMN_INVALID ) { mpEditEngine->SetRefDevice( &maBackgrDev ); + mpEditEngine->SetRefMapMode( MapMode( MAP_PIXEL ) ); + maPopup.SetMenuFlags( maPopup.GetMenuFlags() | MENU_FLAG_NOAUTOMNEMONICS ); InitColors(); @@ -217,6 +219,9 @@ void ScCsvGrid::ApplyLayout( const ScCsvLayoutData& rOldData ) InvalidateGfx(); EnableRepaint(); + + if( nDiff & (CSV_DIFF_POSOFFSET | CSV_DIFF_LINEOFFSET) ) + AccSendVisibleEvent(); } void ScCsvGrid::SetFirstImportedLine( sal_Int32 nLine ) @@ -231,7 +236,7 @@ void ScCsvGrid::SetFirstImportedLine( sal_Int32 nLine ) sal_Int32 ScCsvGrid::GetNoScrollCol( sal_Int32 nPos ) const { sal_Int32 nNewPos = nPos; - if( nNewPos != POS_INVALID ) + if( nNewPos != CSV_POS_INVALID ) { if( nNewPos < GetFirstVisPos() + CSV_SCROLL_DIST ) { @@ -344,7 +349,7 @@ void ScCsvGrid::RemoveSplit( sal_Int32 nPos ) void ScCsvGrid::MoveSplit( sal_Int32 nPos, sal_Int32 nNewPos ) { sal_uInt32 nColIx = GetColumnFromPos( nPos ); - if( nColIx != VEC_NOTFOUND ) + if( nColIx != CSV_COLUMN_INVALID ) { DisableRepaint(); if( (GetColumnPos( nColIx - 1 ) < nNewPos) && (nNewPos < GetColumnPos( nColIx + 1 )) ) @@ -465,7 +470,7 @@ sal_Int32 ScCsvGrid::GetColumnX( sal_uInt32 nColIndex ) const sal_uInt32 ScCsvGrid::GetColumnFromX( sal_Int32 nX ) const { sal_Int32 nPos = (nX - GetOffsetX()) / GetCharWidth() + GetFirstVisPos(); - return (nPos >= GetFirstVisPos()) ? GetColumnFromPos( nPos ) : VEC_NOTFOUND; + return (nPos >= GetFirstVisPos()) ? GetColumnFromPos( nPos ) : CSV_COLUMN_INVALID; } sal_uInt32 ScCsvGrid::GetColumnFromPos( sal_Int32 nPos ) const @@ -504,11 +509,11 @@ void ScCsvGrid::SetColumnType( sal_uInt32 nColIndex, sal_Int32 nColType ) sal_Int32 ScCsvGrid::GetSelColumnType() const { sal_uInt32 nColIx = GetFirstSelected(); - if( nColIx == VEC_NOTFOUND ) + if( nColIx == CSV_COLUMN_INVALID ) return CSV_TYPE_NOSELECTION; sal_Int32 nType = GetColumnType( nColIx ); - while( (nColIx != VEC_NOTFOUND) && (nType != CSV_TYPE_MULTI) ) + while( (nColIx != CSV_COLUMN_INVALID) && (nType != CSV_TYPE_MULTI) ) { if( nType != GetColumnType( nColIx ) ) nType = CSV_TYPE_MULTI; @@ -521,7 +526,7 @@ void ScCsvGrid::SetSelColumnType( sal_Int32 nType ) { if( (nType != CSV_TYPE_MULTI) && (nType != CSV_TYPE_NOSELECTION) ) { - for( sal_uInt32 nColIx = GetFirstSelected(); nColIx != VEC_NOTFOUND; nColIx = GetNextSelected( nColIx ) ) + for( sal_uInt32 nColIx = GetFirstSelected(); nColIx != CSV_COLUMN_INVALID; nColIx = GetNextSelected( nColIx ) ) SetColumnType( nColIx, nType ); Repaint( true ); Execute( CSVCMD_EXPORTCOLUMNTYPE ); @@ -632,7 +637,7 @@ sal_uInt32 ScCsvGrid::GetNextSelected( sal_uInt32 nFromIndex ) const for( sal_uInt32 nColIx = nFromIndex + 1; nColIx < nColCount; ++nColIx ) if( IsSelected( nColIx ) ) return nColIx; - return VEC_NOTFOUND; + return CSV_COLUMN_INVALID; } void ScCsvGrid::Select( sal_uInt32 nColIndex, bool bSelect ) @@ -656,9 +661,9 @@ void ScCsvGrid::ToggleSelect( sal_uInt32 nColIndex ) void ScCsvGrid::SelectRange( sal_uInt32 nColIndex1, sal_uInt32 nColIndex2, bool bSelect ) { - if( nColIndex1 == VEC_NOTFOUND ) + if( nColIndex1 == CSV_COLUMN_INVALID ) Select( nColIndex2 ); - else if( nColIndex2 == VEC_NOTFOUND ) + else if( nColIndex2 == CSV_COLUMN_INVALID ) Select( nColIndex1 ); else if( nColIndex1 > nColIndex2 ) { @@ -706,7 +711,7 @@ void ScCsvGrid::MoveCursor( sal_uInt32 nColIndex ) void ScCsvGrid::MoveCursorRel( ScMoveMode eDir ) { - if( GetFocusColumn() != VEC_NOTFOUND ) + if( GetFocusColumn() != CSV_COLUMN_INVALID ) { switch( eDir ) { @@ -1064,6 +1069,11 @@ void ScCsvGrid::ImplRedraw() } } +EditEngine* ScCsvGrid::GetEditEngine() +{ + return mpEditEngine.get(); +} + void ScCsvGrid::ImplSetColumnClipRegion( OutputDevice& rOutDev, sal_uInt32 nColIndex ) { rOutDev.SetClipRegion( Region( Rectangle( @@ -1094,6 +1104,7 @@ void ScCsvGrid::ImplDrawCellText( const Point& rPos, const String& rText ) { String aText( rText ); aText.SearchAndReplaceAll( '\t', ' ' ); + mpEditEngine->SetPaperSize( maWinSize ); mpEditEngine->SetText( aText ); mpEditEngine->Draw( &maBackgrDev, rPos ); diff --git a/sc/source/ui/dbgui/csvruler.cxx b/sc/source/ui/dbgui/csvruler.cxx index d5244e3f9cdb..a6df6e0449e5 100644 --- a/sc/source/ui/dbgui/csvruler.cxx +++ b/sc/source/ui/dbgui/csvruler.cxx @@ -2,9 +2,9 @@ * * $RCSfile: csvruler.cxx,v $ * - * $Revision: 1.6 $ + * $Revision: 1.7 $ * - * last change: $Author: dr $ $Date: 2002-08-15 09:28:09 $ + * last change: $Author: dr $ $Date: 2002-08-16 12:59:09 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -116,6 +116,9 @@ void ScCsvRuler::ApplyLayout( const ScCsvLayoutData& rOldData ) ImplInvertCursor( GetRulerCursorPos() ); } EnableRepaint(); + + if( nDiff & CSV_DIFF_POSOFFSET ) + AccSendVisibleEvent(); } void ScCsvRuler::InitColors() @@ -151,14 +154,14 @@ void ScCsvRuler::MoveCursor( sal_Int32 nPos, bool bScroll ) DisableRepaint(); if( bScroll ) Execute( CSVCMD_MAKEPOSVISIBLE, nPos ); - Execute( CSVCMD_MOVERULERCURSOR, IsVisibleSplitPos( nPos ) ? nPos : POS_INVALID ); + Execute( CSVCMD_MOVERULERCURSOR, IsVisibleSplitPos( nPos ) ? nPos : CSV_POS_INVALID ); EnableRepaint(); AccSendCaretEvent(); } void ScCsvRuler::MoveCursorRel( ScMoveMode eDir ) { - if( GetRulerCursorPos() != POS_INVALID ) + if( GetRulerCursorPos() != CSV_POS_INVALID ) { switch( eDir ) { @@ -182,9 +185,9 @@ void ScCsvRuler::MoveCursorRel( ScMoveMode eDir ) void ScCsvRuler::MoveCursorToSplit( ScMoveMode eDir ) { - if( GetRulerCursorPos() != POS_INVALID ) + if( GetRulerCursorPos() != CSV_POS_INVALID ) { - sal_uInt32 nIndex = VEC_NOTFOUND; + sal_uInt32 nIndex = CSV_VEC_NOTFOUND; switch( eDir ) { case MOVE_FIRST: nIndex = maSplits.LowerBound( 0 ); break; @@ -193,7 +196,7 @@ void ScCsvRuler::MoveCursorToSplit( ScMoveMode eDir ) case MOVE_NEXT: nIndex = maSplits.LowerBound( GetRulerCursorPos() + 1 ); break; } sal_Int32 nPos = maSplits[ nIndex ]; - if( nPos != POS_INVALID ) + if( nPos != CSV_POS_INVALID ) MoveCursor( nPos ); } } @@ -217,7 +220,7 @@ void ScCsvRuler::ScrollVertRel( ScMoveMode eDir ) sal_Int32 ScCsvRuler::GetNoScrollPos( sal_Int32 nPos ) const { sal_Int32 nNewPos = nPos; - if( nNewPos != POS_INVALID ) + if( nNewPos != CSV_POS_INVALID ) { if( nNewPos < GetFirstVisPos() + CSV_SCROLL_DIST ) { @@ -268,7 +271,7 @@ void ScCsvRuler::MoveSplitRel( sal_Int32 nPos, ScMoveMode eDir ) if( HasSplit( nPos ) ) { sal_Int32 nNewPos = FindEmptyPos( nPos, eDir ); - if( nNewPos != POS_INVALID ) + if( nNewPos != CSV_POS_INVALID ) Execute( CSVCMD_MOVESPLIT, nPos, nNewPos ); } } @@ -282,7 +285,7 @@ void ScCsvRuler::RemoveAllSplits() sal_Int32 ScCsvRuler::FindEmptyPos( sal_Int32 nPos, ScMoveMode eDir ) const { sal_Int32 nNewPos = nPos; - if( nNewPos != POS_INVALID ) + if( nNewPos != CSV_POS_INVALID ) { switch( eDir ) { @@ -300,7 +303,7 @@ sal_Int32 ScCsvRuler::FindEmptyPos( sal_Int32 nPos, ScMoveMode eDir ) const break; } } - return IsValidSplitPos( nNewPos ) ? nNewPos : POS_INVALID; + return IsValidSplitPos( nNewPos ) ? nNewPos : CSV_POS_INVALID; } void ScCsvRuler::MoveCurrSplit( sal_Int32 nNewPos ) @@ -316,7 +319,7 @@ void ScCsvRuler::MoveCurrSplitRel( ScMoveMode eDir ) if( HasSplit( GetRulerCursorPos() ) ) { sal_Int32 nNewPos = FindEmptyPos( GetRulerCursorPos(), eDir ); - if( nNewPos != POS_INVALID ) + if( nNewPos != CSV_POS_INVALID ) MoveCurrSplit( nNewPos ); } } @@ -335,7 +338,7 @@ void ScCsvRuler::GetFocus() { ScCsvControl::GetFocus(); DisableRepaint(); - if( GetRulerCursorPos() == POS_INVALID ) + if( GetRulerCursorPos() == CSV_POS_INVALID ) MoveCursor( GetNoScrollPos( mnPosCursorLast ) ); EnableRepaint(); } @@ -344,7 +347,7 @@ void ScCsvRuler::LoseFocus() { ScCsvControl::LoseFocus(); mnPosCursorLast = GetRulerCursorPos(); - MoveCursor( POS_INVALID ); + MoveCursor( CSV_POS_INVALID ); } void ScCsvRuler::DataChanged( const DataChangedEvent& rDCEvt ) @@ -389,7 +392,7 @@ void ScCsvRuler::MouseMove( const MouseEvent& rMEvt ) Rectangle aRect( aPoint, maWinSize ); if( !IsVisibleSplitPos( nPos ) || !aRect.IsInside( rMEvt.GetPosPixel() ) ) // if focused, keep old cursor position for key input - nPos = HasFocus() ? GetRulerCursorPos() : POS_INVALID; + nPos = HasFocus() ? GetRulerCursorPos() : CSV_POS_INVALID; MoveCursor( nPos, false ); } ImplSetMousePointer( nPos ); @@ -484,7 +487,7 @@ void ScCsvRuler::EndMouseTracking( bool bApply ) else if( !maOldSplits.HasSplit( mnPosMTCurr ) ) Execute( CSVCMD_REMOVESPLIT, mnPosMTCurr ); } - mnPosMTStart = POS_INVALID; + mnPosMTStart = CSV_POS_INVALID; } @@ -597,7 +600,7 @@ void ScCsvRuler::ImplDrawRulerDev() sal_uInt32 nFirst = maSplits.LowerBound( GetFirstVisPos() ); sal_uInt32 nLast = maSplits.UpperBound( GetLastVisPos() ); - if( (nFirst != POS_INVALID) && (nLast != POS_INVALID) ) + if( (nFirst != CSV_POS_INVALID) && (nLast != CSV_POS_INVALID) ) for( sal_uInt32 nIndex = nFirst; nIndex <= nLast; ++nIndex ) ImplDrawSplit( GetSplitPos( nIndex ) ); } diff --git a/sc/source/ui/dbgui/csvsplits.cxx b/sc/source/ui/dbgui/csvsplits.cxx index 2feac43f958c..62d04aa25d54 100644 --- a/sc/source/ui/dbgui/csvsplits.cxx +++ b/sc/source/ui/dbgui/csvsplits.cxx @@ -2,9 +2,9 @@ * * $RCSfile: csvsplits.cxx,v $ * - * $Revision: 1.1 $ + * $Revision: 1.2 $ * - * last change: $Author: dr $ $Date: 2002-07-05 15:47:38 $ + * last change: $Author: dr $ $Date: 2002-08-16 12:59:09 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -95,7 +95,7 @@ bool ScCsvSplits::Insert( sal_Int32 nPos ) bool ScCsvSplits::Remove( sal_Int32 nPos ) { sal_uInt32 nIndex = GetIndex( nPos ); - bool bValid = (nIndex != VEC_NOTFOUND); + bool bValid = (nIndex != CSV_VEC_NOTFOUND); if( bValid ) maVec.erase( maVec.begin() + nIndex ); return bValid; @@ -105,7 +105,7 @@ void ScCsvSplits::RemoveRange( sal_Int32 nPosStart, sal_Int32 nPosEnd ) { sal_uInt32 nStartIx = LowerBound( nPosStart ); sal_uInt32 nEndIx = UpperBound( nPosEnd ); - if( (nStartIx != VEC_NOTFOUND) && (nEndIx != VEC_NOTFOUND) && (nStartIx <= nEndIx) ) + if( (nStartIx != CSV_VEC_NOTFOUND) && (nEndIx != CSV_VEC_NOTFOUND) && (nStartIx <= nEndIx) ) maVec.erase( maVec.begin() + nStartIx, maVec.begin() + nEndIx + 1 ); } @@ -116,7 +116,7 @@ void ScCsvSplits::Clear() bool ScCsvSplits::HasSplit( sal_Int32 nPos ) const { - return GetIndex( nPos ) != VEC_NOTFOUND; + return GetIndex( nPos ) != CSV_VEC_NOTFOUND; } @@ -136,16 +136,16 @@ sal_uInt32 ScCsvSplits::LowerBound( sal_Int32 nPos ) const sal_uInt32 ScCsvSplits::UpperBound( sal_Int32 nPos ) const { sal_uInt32 nIndex = LowerBound( nPos ); - if( nIndex == VEC_NOTFOUND ) - return Count() ? (Count() - 1) : VEC_NOTFOUND; + if( nIndex == CSV_VEC_NOTFOUND ) + return Count() ? (Count() - 1) : CSV_VEC_NOTFOUND; if( GetPos( nIndex ) == nPos ) return nIndex; - return nIndex ? (nIndex - 1) : VEC_NOTFOUND; + return nIndex ? (nIndex - 1) : CSV_VEC_NOTFOUND; } sal_Int32 ScCsvSplits::GetPos( sal_uInt32 nIndex ) const { - return (nIndex < Count()) ? maVec[ nIndex ] : POS_INVALID; + return (nIndex < Count()) ? maVec[ nIndex ] : CSV_POS_INVALID; } @@ -153,7 +153,7 @@ sal_Int32 ScCsvSplits::GetPos( sal_uInt32 nIndex ) const sal_uInt32 ScCsvSplits::GetIterIndex( const_iterator aIter ) const { - return (aIter == maVec.end()) ? VEC_NOTFOUND : (aIter - maVec.begin()); + return (aIter == maVec.end()) ? CSV_VEC_NOTFOUND : (aIter - maVec.begin()); } diff --git a/sc/source/ui/dbgui/csvtablebox.cxx b/sc/source/ui/dbgui/csvtablebox.cxx index 24842e9c07fa..c0f03d5b7f5a 100644 --- a/sc/source/ui/dbgui/csvtablebox.cxx +++ b/sc/source/ui/dbgui/csvtablebox.cxx @@ -2,9 +2,9 @@ * * $RCSfile: csvtablebox.cxx,v $ * - * $Revision: 1.5 $ + * $Revision: 1.6 $ * - * last change: $Author: dr $ $Date: 2002-08-15 09:28:09 $ + * last change: $Author: dr $ $Date: 2002-08-16 12:59:09 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -436,10 +436,10 @@ IMPL_LINK( ScCsvTableBox, CsvCmdHdl, ScCsvControl*, pCtrl ) ImplSetLineOffset( GetFirstVisLine() ); break; case CSVCMD_MOVERULERCURSOR: - maData.mnPosCursor = IsVisibleSplitPos( nParam1 ) ? nParam1 : POS_INVALID; + maData.mnPosCursor = IsVisibleSplitPos( nParam1 ) ? nParam1 : CSV_POS_INVALID; break; case CSVCMD_MOVEGRIDCURSOR: - maData.mnColCursor = ((0 <= nParam1) && (nParam1 < GetPosCount())) ? nParam1 : POS_INVALID; + maData.mnColCursor = ((0 <= nParam1) && (nParam1 < GetPosCount())) ? nParam1 : CSV_POS_INVALID; break; } @@ -472,9 +472,9 @@ IMPL_LINK( ScCsvTableBox, ScrollEndHdl, ScrollBar*, pScrollBar ) if( pScrollBar == &maHScroll ) { - if( GetRulerCursorPos() != POS_INVALID ) + if( GetRulerCursorPos() != CSV_POS_INVALID ) Execute( CSVCMD_MOVERULERCURSOR, maRuler.GetNoScrollPos( GetRulerCursorPos() ) ); - if( GetGridCursorPos() != POS_INVALID ) + if( GetGridCursorPos() != CSV_POS_INVALID ) Execute( CSVCMD_MOVEGRIDCURSOR, maGrid.GetNoScrollCol( GetGridCursorPos() ) ); } diff --git a/sc/source/ui/inc/AccessibleCsvControl.hxx b/sc/source/ui/inc/AccessibleCsvControl.hxx index dd73d4fb97a4..4fdb60621ea2 100644 --- a/sc/source/ui/inc/AccessibleCsvControl.hxx +++ b/sc/source/ui/inc/AccessibleCsvControl.hxx @@ -2,9 +2,9 @@ * * $RCSfile: AccessibleCsvControl.hxx,v $ * - * $Revision: 1.1 $ + * $Revision: 1.2 $ * - * last change: $Author: dr $ $Date: 2002-08-15 09:29:08 $ + * last change: $Author: dr $ $Date: 2002-08-16 13:00:59 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -77,6 +77,9 @@ #ifndef _SV_GEN_HXX #include <vcl/gen.hxx> #endif +#ifndef _STRING_HXX +#include <tools/string.hxx> +#endif #ifndef _RTL_USTRBUF_HXX_ #include <rtl/ustrbuf.hxx> #endif @@ -86,6 +89,9 @@ #ifndef _CPPUHELPER_IMPLBASE2_HXX_ #include <cppuhelper/implbase2.hxx> #endif +#ifndef _SVX_ACCESSILE_STATIC_TEXT_BASE_HXX_ +#include <svx/AccessibleStaticTextBase.hxx> +#endif #ifndef _SC_ACCESSIBLECONTEXTBASE_HXX #include "AccessibleContextBase.hxx" @@ -141,6 +147,8 @@ public: virtual void SendFocusEvent( bool bFocused ); /** Sends a caret changed event to all listeners. */ virtual void SendCaretEvent(); + /** Sends a visible area changed event to all listeners. */ + virtual void SendVisibleEvent(); /** Sends a selection changed event to all listeners. */ virtual void SendSelectionEvent(); /** Sends a table model changed event for changed cell contents to all listeners. */ @@ -318,7 +326,7 @@ public: virtual void SendCaretEvent(); // helpers ---------------------------------------------------------------- -protected: +private: /** Returns this object's name. */ virtual ::rtl::OUString SAL_CALL createAccessibleName() throw( ::com::sun::star::uno::RuntimeException ); @@ -545,7 +553,7 @@ public: virtual void SendRemoveColumnEvent( sal_uInt32 nFirstColumn, sal_uInt32 nLastColumn ); // helpers ---------------------------------------------------------------- -protected: +private: /** Returns this object's name. */ virtual ::rtl::OUString SAL_CALL createAccessibleName() throw( ::com::sun::star::uno::RuntimeException ); @@ -587,7 +595,7 @@ protected: inline sal_Int32 implGetIndex( sal_Int32 nRow, sal_Int32 nColumn ) const { return nRow * implGetColumnCount() + nColumn; } /** Returns the contents of the specified cell (including header). Indexes must be valid. */ - ::rtl::OUString implGetCellText( sal_Int32 nRow, sal_Int32 nColumn ) const; + String implGetCellText( sal_Int32 nRow, sal_Int32 nColumn ) const; /** Creates a new accessible object of the specified cell. Indexes must be valid. */ ScAccessibleCsvControl* implCreateCellObj( sal_Int32 nRow, sal_Int32 nColumn ) const; }; @@ -595,19 +603,16 @@ protected: // ============================================================================ -typedef ::cppu::ImplHelper1< - ::drafts::com::sun::star::accessibility::XAccessibleText > - ScAccessibleCsvCellImpl; - /** Accessible class representing a cell of the CSV grid control. */ -class ScAccessibleCsvCell : public ScAccessibleCsvControl, public ScAccessibleCsvCellImpl +class ScAccessibleCsvCell : public ScAccessibleCsvControl, public accessibility::AccessibleStaticTextBase { protected: typedef ::com::sun::star::uno::Sequence< - ::com::sun::star::beans::PropertyValue > PropertyValueSeq; + ::com::sun::star::beans::PropertyValue > PropertyValueSeq; + typedef ::std::auto_ptr< SvxEditSource > SvxEditSourcePtr; private: - ::rtl::OUString maCellText; /// The text contents of this cell. + String maCellText; /// The text contents of this cell. sal_Int32 mnLine; /// The grid line index (core index). sal_uInt32 mnColumn; /// The grid column index (core index). sal_Int32 mnIndex; /// The index of the cell in the table. @@ -615,9 +620,10 @@ private: public: explicit ScAccessibleCsvCell( ScCsvGrid& rGrid, - const ::rtl::OUString& rCellText, + const String& rCellText, sal_Int32 nRow, sal_Int32 nColumn ); virtual ~ScAccessibleCsvCell(); + virtual void SAL_CALL disposing(); // XAccessibleComponent --------------------------------------------------- @@ -626,14 +632,6 @@ public: // XAccessibleContext ----------------------------------------------------- - /** Returns the child count (count of cells in the table). */ - virtual sal_Int32 SAL_CALL getAccessibleChildCount() - throw( ::com::sun::star::uno::RuntimeException ); - - /** Returns the specified child cell. */ - virtual XAccessibleRef SAL_CALL getAccessibleChild( sal_Int32 nIndex ) - throw( ::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException ); - /** Returns the index of this cell in the table. */ virtual sal_Int32 SAL_CALL getAccessibleIndexInParent() throw( ::com::sun::star::uno::RuntimeException ); @@ -646,68 +644,6 @@ public: virtual XAccessibleStateSetRef SAL_CALL getAccessibleStateSet() throw( ::com::sun::star::uno::RuntimeException ); - // XAccessibleText -------------------------------------------------------- - - /** Return the position of the caret (not supported). */ - virtual sal_Int32 SAL_CALL getCaretPosition() throw( ::com::sun::star::uno::RuntimeException ); - - /** Sets the position of the caret (not supported). */ - virtual sal_Bool SAL_CALL setCaretPosition( sal_Int32 nIndex ) - throw( ::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException ); - - /** Returns the specified character. */ - virtual sal_Unicode SAL_CALL getCharacter( sal_Int32 nIndex ) - throw( ::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException ); - - /** Returns the attributes of the specified character. */ - virtual PropertyValueSeq SAL_CALL getCharacterAttributes( sal_Int32 nIndex ) - throw( ::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException ); - - /** Returns the screen coordinates of the specified character. */ - virtual AwtRectangle SAL_CALL getCharacterBounds( sal_Int32 nIndex ) - throw( ::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException ); - - /** Returns the count of characters. */ - virtual sal_Int32 SAL_CALL getCharacterCount() throw( ::com::sun::star::uno::RuntimeException ); - - /** Returns the character index at the specified screen coordinate. */ - virtual sal_Int32 SAL_CALL getIndexAtPoint( const AwtPoint& rPoint ) - throw( ::com::sun::star::uno::RuntimeException ); - - /** Returns the selected text (not supported). */ - virtual ::rtl::OUString SAL_CALL getSelectedText() throw( ::com::sun::star::uno::RuntimeException ); - - /** Returns the start index of the selection (not supported). */ - virtual sal_Int32 SAL_CALL getSelectionStart() throw( ::com::sun::star::uno::RuntimeException ); - - /** Returns the end index of the selection (not supported). */ - virtual sal_Int32 SAL_CALL getSelectionEnd() throw( ::com::sun::star::uno::RuntimeException ); - - /** Selects a part of the text (not supported). */ - virtual sal_Bool SAL_CALL setSelection( sal_Int32 nStartIndex, sal_Int32 nEndIndex ) - throw( ::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException ); - - /** Returns the entire text. */ - virtual ::rtl::OUString SAL_CALL getText() throw( ::com::sun::star::uno::RuntimeException ); - - /** Returns the specified range [Start,End) of the text. */ - virtual ::rtl::OUString SAL_CALL getTextRange( sal_Int32 nStartIndex, sal_Int32 nEndIndex ) - throw( ::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException ); - - /** Returns the specified text portion. */ - virtual ::rtl::OUString SAL_CALL getTextAtIndex( sal_Int32 nIndex, sal_Int16 nTextType ) - throw( ::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException ); - - virtual ::rtl::OUString SAL_CALL getTextBeforeIndex( sal_Int32 nIndex, sal_Int16 nTextType ) - throw( ::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException ); - - virtual ::rtl::OUString SAL_CALL getTextBehindIndex( sal_Int32 nIndex, sal_Int16 nTextType ) - throw( ::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException ); - - /** Copies the specified text range into the clipboard (not supported). */ - virtual sal_Bool SAL_CALL copyText( sal_Int32 nStartIndex, sal_Int32 nEndIndex ) - throw( ::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException ); - // XInterface ------------------------------------------------------------- virtual ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type& rType ) @@ -740,9 +676,7 @@ protected: /** Returns this object's current bounding box relative to the parent object. */ virtual Rectangle GetBoundingBox() const throw( ::com::sun::star::uno::RuntimeException ); - /** Returns the bounding box of the cell. */ - Rectangle implGetBoundingBox() const; - +private: /** Returns this object's name. */ virtual ::rtl::OUString SAL_CALL createAccessibleName() throw( ::com::sun::star::uno::RuntimeException ); @@ -750,16 +684,17 @@ protected: virtual ::rtl::OUString SAL_CALL createAccessibleDescription() throw( ::com::sun::star::uno::RuntimeException ); - /** Throws an exception, if the specified character position is invalid. */ - void ensureValidIndex( sal_Int32 nIndex ) const - throw( ::com::sun::star::lang::IndexOutOfBoundsException ); - /** Throws an exception, if the specified character range [Start,End) is invalid. - @descr If Start>End, swaps Start and End before checking. */ - void ensureValidRange( sal_Int32& rnStartIndex, sal_Int32& rnEndIndex ) const - throw( ::com::sun::star::lang::IndexOutOfBoundsException ); - /** Returns the VCL grid control. Assumes a living object. */ ScCsvGrid& implGetGrid() const; + /** Returns the pixel position of the cell (rel. to parent), regardless of visibility. */ + Point implGetRealPos() const; + /** Returns the pixel size of the cell, regardless of visibility. */ + Size implGetRealSize() const; + /** Returns the bounding box of the cell relative in the table. */ + Rectangle implGetBoundingBox() const; + + /** Creates the edit source the text helper needs. */ + ::std::auto_ptr< SvxEditSource > implCreateEditSource(); }; diff --git a/sc/source/ui/inc/AccessibleText.hxx b/sc/source/ui/inc/AccessibleText.hxx index 6a4cfcc4f0ad..e3c7bf06f330 100644 --- a/sc/source/ui/inc/AccessibleText.hxx +++ b/sc/source/ui/inc/AccessibleText.hxx @@ -2,9 +2,9 @@ * * $RCSfile: AccessibleText.hxx,v $ * - * $Revision: 1.11 $ + * $Revision: 1.12 $ * - * last change: $Author: sab $ $Date: 2002-06-12 10:35:10 $ + * last change: $Author: dr $ $Date: 2002-08-16 13:00:59 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -76,6 +76,8 @@ #include <svx/svxenum.hxx> #endif +#include <memory> + class ScCellTextData; class ScDocShell; class ScViewForwarder; @@ -85,6 +87,9 @@ class ScEditViewForwarder; class ScPreviewShell; class EditTextObject; + +// ============================================================================ + class ScAccessibleTextData : public SfxListener { public: @@ -111,6 +116,9 @@ private: ScSharedCellEditSource* GetOriginalSource() { return NULL; } }; + +// ============================================================================ + class ScAccessibleCellBaseTextData : public ScAccessibleTextData, public ScCellTextData { @@ -126,6 +134,9 @@ public: virtual sal_Bool IsDirty() const { return ScCellTextData::IsDirty(); } }; + +// ============================================================================ + // ScAccessibleCellTextData: shared data between sub objects of a accessible cell text object class ScAccessibleCellTextData : public ScAccessibleCellBaseTextData @@ -157,6 +168,9 @@ private: ScDocShell* GetDocShell(ScTabViewShell* pViewShell); }; + +// ============================================================================ + class ScAccessibleEditObjectTextData : public ScAccessibleTextData { public: @@ -185,6 +199,9 @@ protected: Window* mpWindow; }; + +// ============================================================================ + class ScAccessibleEditLineTextData : public ScAccessibleEditObjectTextData { public: @@ -206,6 +223,9 @@ private: sal_Bool mbEditEngineCreated; }; + +// ============================================================================ + class ScAccessiblePreviewCellTextData : public ScAccessibleCellBaseTextData { public: @@ -232,6 +252,9 @@ private: ScDocShell* GetDocShell(ScPreviewShell* pViewShell); }; + +// ============================================================================ + class ScAccessiblePreviewHeaderCellTextData : public ScAccessibleCellBaseTextData { public: @@ -261,6 +284,9 @@ private: ScDocShell* GetDocShell(ScPreviewShell* pViewShell); }; + +// ============================================================================ + class ScAccessibleHeaderTextData : public ScAccessibleTextData { public: @@ -291,6 +317,9 @@ private: SvxAdjust meAdjust; }; + +// ============================================================================ + class ScAccessibleNoteTextData : public ScAccessibleTextData { public: @@ -321,4 +350,46 @@ private: sal_Bool mbDataValid; }; + +// ============================================================================ + +class ScAccessibleCsvTextData : public ScAccessibleTextData +{ +private: + typedef ::std::auto_ptr< SvxTextForwarder > TextForwarderPtr; + typedef ::std::auto_ptr< SvxViewForwarder > ViewForwarderPtr; + + Window* mpWindow; + EditEngine* mpEditEngine; + TextForwarderPtr mpTextForwarder; + ViewForwarderPtr mpViewForwarder; + String maCellText; + Rectangle maBoundBox; + Size maCellSize; + +public: + explicit ScAccessibleCsvTextData( + Window* pWindow, + EditEngine* pEditEngine, + const String& rCellText, + const Rectangle& rBoundBox, + const Size& rCellSize ); + virtual ~ScAccessibleCsvTextData(); + + virtual ScAccessibleTextData* Clone() const; + + virtual void Notify( SfxBroadcaster& rBC, const SfxHint& rHint ); + + virtual SvxTextForwarder* GetTextForwarder(); + virtual SvxViewForwarder* GetViewForwarder(); + virtual SvxEditViewForwarder* GetEditViewForwarder( sal_Bool bCreate ); + + virtual void UpdateData() {} + virtual void SetDoUpdate( sal_Bool bValue ) {} + virtual sal_Bool IsDirty() const { return sal_False; } +}; + + +// ============================================================================ + #endif diff --git a/sc/source/ui/inc/csvcontrol.hxx b/sc/source/ui/inc/csvcontrol.hxx index 54639893119e..67e997657a99 100644 --- a/sc/source/ui/inc/csvcontrol.hxx +++ b/sc/source/ui/inc/csvcontrol.hxx @@ -2,9 +2,9 @@ * * $RCSfile: csvcontrol.hxx,v $ * - * $Revision: 1.7 $ + * $Revision: 1.8 $ * - * last change: $Author: dr $ $Date: 2002-08-15 09:29:11 $ + * last change: $Author: dr $ $Date: 2002-08-16 13:00:59 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -277,7 +277,7 @@ private: public: inline explicit ScCsvCmd() : meType( CSVCMD_NONE ), - mnParam1( POS_INVALID ), mnParam2( POS_INVALID ) {} + mnParam1( CSV_POS_INVALID ), mnParam2( CSV_POS_INVALID ) {} inline void Set( ScCsvCmdType eType, sal_Int32 nParam1, sal_Int32 nParam2 ); @@ -329,6 +329,8 @@ public: void AccSendFocusEvent( bool bFocused ); /** Sends a caret changed event to the accessibility object. */ void AccSendCaretEvent(); + /** Sends a visible area changed event to the accessibility object. */ + void AccSendVisibleEvent(); /** Sends a selection changed event to the accessibility object. */ void AccSendSelectionEvent(); /** Sends a table model changed event for changed cell contents to the accessibility object. */ @@ -370,8 +372,8 @@ public: /** Executes a command by calling command handler. */ void Execute( ScCsvCmdType eType, - sal_Int32 nParam1 = POS_INVALID, - sal_Int32 nParam2 = POS_INVALID ); + sal_Int32 nParam1 = CSV_POS_INVALID, + sal_Int32 nParam2 = CSV_POS_INVALID ); // layout helpers --------------------------------------------------------- diff --git a/sc/source/ui/inc/csvgrid.hxx b/sc/source/ui/inc/csvgrid.hxx index 7646de2bf046..90c68222d4e4 100644 --- a/sc/source/ui/inc/csvgrid.hxx +++ b/sc/source/ui/inc/csvgrid.hxx @@ -2,9 +2,9 @@ * * $RCSfile: csvgrid.hxx,v $ * - * $Revision: 1.5 $ + * $Revision: 1.6 $ * - * last change: $Author: dr $ $Date: 2002-08-15 09:29:11 $ + * last change: $Author: dr $ $Date: 2002-08-16 13:00:59 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -88,6 +88,7 @@ // ---------------------------------------------------------------------------- namespace svx { class ColorConfig; } +class EditEngine; class ScEditEngineDefaulter; class ScAsciiOptions; class ScAccessibleCsvControl; @@ -98,6 +99,8 @@ class ScAccessibleCsvControl; const sal_uInt8 CSV_COLFLAG_NONE = 0x00; /// Nothing set. const sal_uInt8 CSV_COLFLAG_SELECT = 0x01; /// Column is selected. +const sal_uInt32 CSV_COLUMN_INVALID = CSV_VEC_NOTFOUND; + // ---------------------------------------------------------------------------- @@ -282,7 +285,7 @@ public: /** Returns index of the first selected column really after nFromIndex. */ sal_uInt32 GetNextSelected( sal_uInt32 nFromIndex ) const; /** Returns true, if at least one column is selected. */ - inline bool HasSelection() const { return GetFirstSelected() != VEC_NOTFOUND; } + inline bool HasSelection() const { return GetFirstSelected() != CSV_COLUMN_INVALID; } /** Selects or deselects the specified column. */ void Select( sal_uInt32 nColIndex, bool bSelect = true ); @@ -341,6 +344,8 @@ protected: public: /** Redraws the entire data grid. */ void ImplRedraw(); + /** Returns a pointer to the used edit engine. */ + EditEngine* GetEditEngine(); private: /** Returns the width of the control. */ diff --git a/sc/source/ui/inc/csvsplits.hxx b/sc/source/ui/inc/csvsplits.hxx index 4b483dde09eb..7c1d085f93e7 100644 --- a/sc/source/ui/inc/csvsplits.hxx +++ b/sc/source/ui/inc/csvsplits.hxx @@ -2,9 +2,9 @@ * * $RCSfile: csvsplits.hxx,v $ * - * $Revision: 1.1 $ + * $Revision: 1.2 $ * - * last change: $Author: dr $ $Date: 2002-07-05 15:42:18 $ + * last change: $Author: dr $ $Date: 2002-08-16 13:01:00 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -74,9 +74,9 @@ // ============================================================================ /** Constant for an invalid vector index. */ -const sal_uInt32 VEC_NOTFOUND = ~0UL; +const sal_uInt32 CSV_VEC_NOTFOUND = ~0UL; /** Constant for an invalid ruler position. */ -const sal_Int32 POS_INVALID = -1; +const sal_Int32 CSV_POS_INVALID = -1; // ---------------------------------------------------------------------------- |