diff options
Diffstat (limited to 'svx/source')
-rw-r--r-- | svx/source/unodraw/unoshtxt.cxx | 189 | ||||
-rw-r--r-- | svx/source/unoedit/makefile.mk | 7 | ||||
-rw-r--r-- | svx/source/unoedit/unoedhlp.cxx | 155 | ||||
-rw-r--r-- | svx/source/unoedit/unoedsrc.cxx | 53 | ||||
-rw-r--r-- | svx/source/unoedit/unofored.cxx | 17 | ||||
-rw-r--r-- | svx/source/unoedit/unoforou.cxx | 23 |
6 files changed, 282 insertions, 162 deletions
diff --git a/svx/source/unodraw/unoshtxt.cxx b/svx/source/unodraw/unoshtxt.cxx index 6ff1a0dfad73..9e3855516fb4 100644 --- a/svx/source/unodraw/unoshtxt.cxx +++ b/svx/source/unodraw/unoshtxt.cxx @@ -2,9 +2,9 @@ * * $RCSfile: unoshtxt.cxx,v $ * - * $Revision: 1.25 $ + * $Revision: 1.26 $ * - * last change: $Author: thb $ $Date: 2002-02-26 12:22:03 $ + * last change: $Author: thb $ $Date: 2002-02-28 12:25:03 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -69,6 +69,7 @@ //#include <svx/editeng.hxx> #include <unoshtxt.hxx> +#include <unoedhlp.hxx> #ifndef _SFXLSTNER_HXX //autogen #include <svtools/lstner.hxx> @@ -165,17 +166,25 @@ private: SdrModel* mpModel; SdrOutliner* mpOutliner; SvxOutlinerForwarder* mpTextForwarder; - SvxDrawOutlinerViewForwarder* mpViewForwarder; // if non-NULL, use GetEditModeTextForwarder text forwarder + SvxDrawOutlinerViewForwarder* mpViewForwarder; // if non-NULL, use GetViewModeTextForwarder text forwarder BOOL mbDataValid; BOOL mbDestroyed; BOOL mbIsLocked; BOOL mbNeedsUpdate; BOOL mbOldUndoMode; + BOOL mbForwarderIsEditMode; // have to reflect that, since ENDEDIT can happen more often SvxTextForwarder* GetBackgroundTextForwarder(); SvxTextForwarder* GetEditModeTextForwarder(); SvxDrawOutlinerViewForwarder* CreateViewForwarder(); + sal_Bool HasView() const { return mpViewForwarder ? sal_True : sal_False; } + sal_Bool IsEditMode() const + { + SdrTextObj* pTextObj = PTR_CAST( SdrTextObj, mpObject ); + return pTextObj && pTextObj->IsTextEditActive() ? sal_True : sal_False; + } + public: SvxTextEditSourceImpl( SdrObject* pObject ); SvxTextEditSourceImpl( SdrObject& rObject, SdrView& rView, const Window& rWindow ); @@ -209,10 +218,11 @@ public: //------------------------------------------------------------------------ SvxTextEditSourceImpl::SvxTextEditSourceImpl( SdrObject* pObject ) -: mpObject ( pObject ), - mpModel ( pObject ? pObject->GetModel() : NULL ), + : maRefCount ( 0 ), + mpObject ( pObject ), mpView ( NULL ), mpWindow ( NULL ), + mpModel ( pObject ? pObject->GetModel() : NULL ), mpOutliner ( NULL ), mpTextForwarder ( NULL ), mpViewForwarder ( NULL ), @@ -221,7 +231,7 @@ SvxTextEditSourceImpl::SvxTextEditSourceImpl( SdrObject* pObject ) mbIsLocked ( FALSE ), mbNeedsUpdate ( FALSE ), mbOldUndoMode ( FALSE ), - maRefCount ( 0 ) + mbForwarderIsEditMode ( FALSE ) { DBG_ASSERT( mpObject, "invalid pObject!" ); @@ -232,10 +242,11 @@ SvxTextEditSourceImpl::SvxTextEditSourceImpl( SdrObject* pObject ) //------------------------------------------------------------------------ SvxTextEditSourceImpl::SvxTextEditSourceImpl( SdrObject& rObject, SdrView& rView, const Window& rWindow ) -: mpObject ( &rObject ), - mpModel ( rObject.GetModel() ), + : maRefCount ( 0 ), + mpObject ( &rObject ), mpView ( &rView ), mpWindow ( &rWindow ), + mpModel ( rObject.GetModel() ), mpOutliner ( NULL ), mpTextForwarder ( NULL ), mpViewForwarder ( NULL ), @@ -244,7 +255,7 @@ SvxTextEditSourceImpl::SvxTextEditSourceImpl( SdrObject& rObject, SdrView& rView mbIsLocked ( FALSE ), mbNeedsUpdate ( FALSE ), mbOldUndoMode ( FALSE ), - maRefCount ( 0 ) + mbForwarderIsEditMode ( FALSE ) { if( mpModel ) StartListening( *mpModel ); @@ -297,34 +308,52 @@ void SvxTextEditSourceImpl::Notify( SfxBroadcaster& rBC, const SfxHint& rHint ) if( pSdrHint ) { - if( pSdrHint->GetKind() == HINT_OBJCHG ) + switch( pSdrHint->GetKind() ) { - mbDataValid = FALSE; // Text muss neu geholt werden - } - else if( pSdrHint->GetKind() == HINT_OBJREMOVED ) - { - if( mpObject == pSdrHint->GetObject() ) - { + case HINT_OBJCHG: + mbDataValid = FALSE; // Text muss neu geholt werden + break; + + case HINT_OBJREMOVED: + if( mpObject == pSdrHint->GetObject() ) + { + mbDestroyed = TRUE; + } + break; + + case HINT_MODELCLEARED: mbDestroyed = TRUE; - } - } - else if( pSdrHint->GetKind() == HINT_MODELCLEARED ) - { - mbDestroyed = TRUE; - } - else if( pSdrHint->GetKind() == HINT_OBJLISTCLEAR ) - { - SdrObjList* pObjList = mpObject ? mpObject->GetObjList() : NULL; - while( pObjList ) + break; + + case HINT_OBJLISTCLEAR: { - if( pSdrHint->GetObjList() == pObjList ) + SdrObjList* pObjList = mpObject ? mpObject->GetObjList() : NULL; + while( pObjList ) { - mbDestroyed = sal_True; - break; - } + if( pSdrHint->GetObjList() == pObjList ) + { + mbDestroyed = sal_True; + break; + } - pObjList = pObjList->GetUpList(); + pObjList = pObjList->GetUpList(); + } + break; } + + case HINT_BEGEDIT: + // invalidate old forwarder + if( !mbForwarderIsEditMode ) + { + delete mpTextForwarder; + mpTextForwarder = NULL; + } + Broadcast( *pSdrHint ); + break; + + case HINT_ENDEDIT: + Broadcast( *pSdrHint ); + break; } } @@ -414,8 +443,13 @@ SvxTextForwarder* SvxTextEditSourceImpl::GetBackgroundTextForwarder() mpTextForwarder = new SvxOutlinerForwarder( *mpOutliner ); - // register as listener - need to broadcast state change messages - mpTextForwarder->SetNotifyHdl( LINK(this, SvxTextEditSourceImpl, NotifyHdl) ); + if( HasView() ) + { + // register as listener - need to broadcast state change messages + mpOutliner->SetNotifyHdl( LINK(this, SvxTextEditSourceImpl, NotifyHdl) ); + } + + mbForwarderIsEditMode = sal_False; } if( mpObject && !mbDataValid ) @@ -487,28 +521,20 @@ SvxTextForwarder* SvxTextEditSourceImpl::GetBackgroundTextForwarder() SvxTextForwarder* SvxTextEditSourceImpl::GetEditModeTextForwarder() { - // are we still in edit mode? - SdrTextObj* pTextObj = PTR_CAST( SdrTextObj, mpObject ); - if( pTextObj && pTextObj->IsTextEditActive() ) + if (!mpTextForwarder) { - if (!mpTextForwarder) - { - mpTextForwarder = new SvxOutlinerForwarder( mpModel->GetDrawOutliner() ); + mpTextForwarder = new SvxOutlinerForwarder( mpModel->GetDrawOutliner() ); + if( HasView() ) + { // register as listener - need to broadcast state change messages - mpTextForwarder->SetNotifyHdl( LINK(this, SvxTextEditSourceImpl, NotifyHdl) ); + mpModel->GetDrawOutliner().SetNotifyHdl( LINK(this, SvxTextEditSourceImpl, NotifyHdl) ); } - return mpTextForwarder; + mbForwarderIsEditMode = sal_True; } - else - { - // no, have left it. Revert to background mode - delete mpTextForwarder; - mpTextForwarder = NULL; - return GetBackgroundTextForwarder(); - } + return mpTextForwarder; } //------------------------------------------------------------------------ @@ -525,10 +551,22 @@ SvxTextForwarder* SvxTextEditSourceImpl::GetTextForwarder() return NULL; // distinguish the cases - // a) background Outliner, reflect changes into ParaOutliner - // b) edit mode active, work directly on the EditOutliner - if( mpViewForwarder ) - return GetEditModeTextForwarder(); + // a) connected to view, maybe edit mode is active, can work directly on the EditOutliner + // b) background Outliner, reflect changes into ParaOutlinerObject (this is exactly the old UNO code) + if( HasView() ) + { + if( IsEditMode() != mbForwarderIsEditMode ) + { + // forwarder mismatch - create new + delete mpTextForwarder; + mpTextForwarder = NULL; + } + + if( IsEditMode() ) + return GetEditModeTextForwarder(); + else + return GetBackgroundTextForwarder(); + } else return GetBackgroundTextForwarder(); } @@ -616,11 +654,11 @@ SvxEditViewForwarder* SvxTextEditSourceImpl::GetEditViewForwarder( sal_Bool bCre void SvxTextEditSourceImpl::UpdateData() { - // if we have a view forwarder, we're in edit mode and working - // with the DrawOutliner. Thus, all changes made on the text - // forwarder are reflected on the view and committed to the model - // on EndTextEdit(). Thus, no need for explicit updates here. - if( !mpViewForwarder ) + // if we have a view and in edit mode, we're working with the + // DrawOutliner. Thus, all changes made on the text forwarder are + // reflected on the view and committed to the model on + // EndTextEdit(). Thus, no need for explicit updates here. + if( !HasView() || !IsEditMode() ) { if( mbIsLocked ) { @@ -708,42 +746,7 @@ Point SvxTextEditSourceImpl::PixelToLogic( const Point& rPoint ) const IMPL_LINK(SvxTextEditSourceImpl, NotifyHdl, EENotify*, aNotify) { if( aNotify ) - { - switch( aNotify->eNotificationType ) - { - case EE_NOTIFY_TEXTMODIFIED: - Broadcast( SvxEditSourceHint( TEXT_HINT_MODIFIED, aNotify->nParagraph ) ); - break; - - case EE_NOTIFY_PARAGRAPHINSERTED: - Broadcast( SvxEditSourceHint( TEXT_HINT_PARAINSERTED, aNotify->nParagraph ) ); - break; - - case EE_NOTIFY_PARAGRAPHREMOVED: - Broadcast( SvxEditSourceHint( TEXT_HINT_PARAREMOVED, aNotify->nParagraph ) ); - break; - - case EE_NOTIFY_PARAGRAPHSMOVED: - Broadcast( SvxEditSourceHint( EDITSOURCE_HINT_PARASMOVED, aNotify->nParagraph, aNotify->nParam1, aNotify->nParam2 ) ); - break; - - case EE_NOTIFY_TEXTHEIGHTCHANGED: - Broadcast( SvxEditSourceHint( TEXT_HINT_TEXTHEIGHTCHANGED, aNotify->nParagraph ) ); - break; - - case EE_NOTIFY_TEXTVIEWSCROLLED: - Broadcast( SvxEditSourceHint( TEXT_HINT_VIEWSCROLLED ) ); - break; - - case EE_NOTIFY_TEXTVIEWSELECTIONCHANGED: - Broadcast( SvxEditSourceHint( EDITSOURCE_HINT_SELECTIONCHANGED ) ); - break; - - default: - DBG_ERROR( "SvxTextEditSourceImpl::NotifyHdl unknown notification" ); - break; - } - } + Broadcast( SvxEditSourceHintTranslator::EENotification2Hint( aNotify) ); return 0; } diff --git a/svx/source/unoedit/makefile.mk b/svx/source/unoedit/makefile.mk index c9ffb869d79d..a04486089eff 100644 --- a/svx/source/unoedit/makefile.mk +++ b/svx/source/unoedit/makefile.mk @@ -2,9 +2,9 @@ # # $RCSfile: makefile.mk,v $ # -# $Revision: 1.5 $ +# $Revision: 1.6 $ # -# last change: $Author: thb $ $Date: 2002-02-25 16:29:44 $ +# last change: $Author: thb $ $Date: 2002-02-28 12:25:39 $ # # The Contents of this file are made available subject to the terms of # either of the following licenses @@ -78,6 +78,7 @@ ENABLE_EXCEPTIONS=TRUE CXXFILES = \ UnoForbiddenCharsTable.cxx \ unoedsrc.cxx \ + unoedhlp.cxx \ unoedacc.cxx \ unoviwed.cxx \ unoviwou.cxx \ @@ -90,6 +91,7 @@ CXXFILES = \ SVXLIGHTOBJFILES=\ $(OBJ)$/UnoForbiddenCharsTable.obj \ $(OBJ)$/unoedsrc.obj \ + $(OBJ)$/unoedhlp.obj \ $(OBJ)$/unoedacc.obj \ $(OBJ)$/unoviwed.obj \ $(OBJ)$/unoviwou.obj \ @@ -102,6 +104,7 @@ SVXLIGHTOBJFILES=\ SLOFILES = \ $(SLO)$/UnoForbiddenCharsTable.obj \ $(SLO)$/unoedsrc.obj \ + $(SLO)$/unoedhlp.obj \ $(SLO)$/unoedacc.obj \ $(SLO)$/unoviwed.obj \ $(SLO)$/unoviwou.obj \ diff --git a/svx/source/unoedit/unoedhlp.cxx b/svx/source/unoedit/unoedhlp.cxx new file mode 100644 index 000000000000..8bb071cfad74 --- /dev/null +++ b/svx/source/unoedit/unoedhlp.cxx @@ -0,0 +1,155 @@ +/************************************************************************* + * + * $RCSfile: unoedhlp.cxx,v $ + * + * $Revision: 1.1 $ + * + * last change: $Author: thb $ $Date: 2002-02-28 12:25:39 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ + +#pragma hdrstop + +#ifndef _TOOLS_DEBUG_HXX +#include <tools/debug.hxx> +#endif + +#include "unoedhlp.hxx" +#include "editdata.hxx" + +//------------------------------------------------------------------------ + +TYPEINIT1( SvxEditSourceHint, TextHint ); + +SvxEditSourceHint::SvxEditSourceHint( ULONG _nId ) : + TextHint( _nId ), + mnStart( 0 ), + mnEnd( 0 ) +{ +} + +SvxEditSourceHint::SvxEditSourceHint( ULONG _nId, ULONG nValue, ULONG nStart, ULONG nEnd ) : + TextHint( _nId, nValue ), + mnStart( nStart), + mnEnd( nEnd ) +{ +} + +ULONG SvxEditSourceHint::GetValue() const +{ + return TextHint::GetValue(); +} + +ULONG SvxEditSourceHint::GetStartValue() const +{ + return mnStart; +} + +ULONG SvxEditSourceHint::GetEndValue() const +{ + return mnEnd; +} + +void SvxEditSourceHint::SetValue( ULONG n ) +{ + TextHint::SetValue( n ); +} + +void SvxEditSourceHint::SetStartValue( ULONG n ) +{ + mnStart = n; +} + +void SvxEditSourceHint::SetEndValue( ULONG n ) +{ + mnEnd = n; +} + +//------------------------------------------------------------------------ + +SfxHint SvxEditSourceHintTranslator::EENotification2Hint( EENotify* aNotify ) +{ + if( aNotify ) + { + switch( aNotify->eNotificationType ) + { + case EE_NOTIFY_TEXTMODIFIED: + return TextHint( TEXT_HINT_MODIFIED, aNotify->nParagraph ); + + case EE_NOTIFY_PARAGRAPHINSERTED: + return TextHint( TEXT_HINT_PARAINSERTED, aNotify->nParagraph ); + + case EE_NOTIFY_PARAGRAPHREMOVED: + return TextHint( TEXT_HINT_PARAREMOVED, aNotify->nParagraph ); + + case EE_NOTIFY_PARAGRAPHSMOVED: + return SvxEditSourceHint( EDITSOURCE_HINT_PARASMOVED, aNotify->nParagraph, aNotify->nParam1, aNotify->nParam2 ); + + case EE_NOTIFY_TEXTHEIGHTCHANGED: + return TextHint( TEXT_HINT_TEXTHEIGHTCHANGED, aNotify->nParagraph ); + + case EE_NOTIFY_TEXTVIEWSCROLLED: + return TextHint( TEXT_HINT_VIEWSCROLLED ); + + case EE_NOTIFY_TEXTVIEWSELECTIONCHANGED: + return SvxEditSourceHint( EDITSOURCE_HINT_SELECTIONCHANGED ); + + default: + DBG_ERROR( "SvxEditSourceHintTranslator::EENotification2Hint unknown notification" ); + break; + } + } + + return SfxHint(); +} diff --git a/svx/source/unoedit/unoedsrc.cxx b/svx/source/unoedit/unoedsrc.cxx index 5f5be4cadec2..b40f188e6e97 100644 --- a/svx/source/unoedit/unoedsrc.cxx +++ b/svx/source/unoedit/unoedsrc.cxx @@ -2,9 +2,9 @@ * * $RCSfile: unoedsrc.cxx,v $ * - * $Revision: 1.4 $ + * $Revision: 1.5 $ * - * last change: $Author: thb $ $Date: 2002-02-25 16:29:45 $ + * last change: $Author: thb $ $Date: 2002-02-28 12:25:39 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -61,6 +61,10 @@ #pragma hdrstop +#ifndef _SFXBRDCST_HXX +#include <svtools/brdcst.hxx> +#endif + #include "unoedsrc.hxx" //------------------------------------------------------------------------ @@ -105,48 +109,3 @@ SfxBroadcaster& SvxEditSource::GetBroadcaster() const return aBroadcaster; } - -//------------------------------------------------------------------------ - -TYPEINIT1( SvxEditSourceHint, TextHint ); - -SvxEditSourceHint::SvxEditSourceHint( ULONG nId ) : TextHint( nId ) -{ -} - -SvxEditSourceHint::SvxEditSourceHint( ULONG nId, ULONG nValue, ULONG nStart, ULONG nEnd ) : - TextHint( nId, nValue ), - mnStart( nStart), - mnEnd( nEnd ) -{ -} - -ULONG SvxEditSourceHint::GetValue() const -{ - return TextHint::GetValue(); -} - -ULONG SvxEditSourceHint::GetStartValue() const -{ - return mnStart; -} - -ULONG SvxEditSourceHint::GetEndValue() const -{ - return mnEnd; -} - -void SvxEditSourceHint::SetValue( ULONG n ) -{ - TextHint::SetValue( n ); -} - -void SvxEditSourceHint::SetStartValue( ULONG n ) -{ - mnStart = n; -} - -void SvxEditSourceHint::SetEndValue( ULONG n ) -{ - mnEnd = n; -} diff --git a/svx/source/unoedit/unofored.cxx b/svx/source/unoedit/unofored.cxx index 745067570341..f862daae3a11 100644 --- a/svx/source/unoedit/unofored.cxx +++ b/svx/source/unoedit/unofored.cxx @@ -2,9 +2,9 @@ * * $RCSfile: unofored.cxx,v $ * - * $Revision: 1.9 $ + * $Revision: 1.10 $ * - * last change: $Author: thb $ $Date: 2002-02-25 16:29:45 $ + * last change: $Author: thb $ $Date: 2002-02-28 12:25:39 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -107,7 +107,7 @@ SfxItemSet SvxEditEngineForwarder::GetAttribs( const ESelection& rSel, BOOL bOnl { if( rSel.nStartPara == rSel.nEndPara ) { - sal_uInt8 nFlags; + sal_uInt8 nFlags = 0; switch( bOnlyHardAttrib ) { case EditEngineAttribs_All: @@ -332,11 +332,6 @@ USHORT SvxEditEngineForwarder::GetItemState( USHORT nPara, USHORT nWhich ) const return rSet.GetItemState( nWhich ); } -void SvxEditEngineForwarder::SetNotifyHdl( const Link& rLink ) -{ - rEditEngine.SetNotifyHdl( rLink ); -} - LanguageType SvxEditEngineForwarder::GetLanguage( USHORT nPara, USHORT nIndex ) const { return rEditEngine.GetLanguage(nPara, nIndex); @@ -350,6 +345,12 @@ Rectangle SvxEditEngineForwarder::GetCharBounds( USHORT nPara, USHORT nIndex ) c Rectangle SvxEditEngineForwarder::GetParaBounds( USHORT nPara ) const { + const Point aPnt = rEditEngine.GetDocPosTopLeft( nPara ); + const ULONG nWidth = rEditEngine.CalcTextWidth(); + const ULONG nHeight = rEditEngine.GetTextHeight( nPara ); + + return Rectangle( aPnt.X(), aPnt.Y(), nWidth, nHeight ); + // TODO return Rectangle(); } diff --git a/svx/source/unoedit/unoforou.cxx b/svx/source/unoedit/unoforou.cxx index 62a2fa88e79c..baac5572f671 100644 --- a/svx/source/unoedit/unoforou.cxx +++ b/svx/source/unoedit/unoforou.cxx @@ -2,9 +2,9 @@ * * $RCSfile: unoforou.cxx,v $ * - * $Revision: 1.11 $ + * $Revision: 1.12 $ * - * last change: $Author: thb $ $Date: 2002-02-25 16:29:45 $ + * last change: $Author: thb $ $Date: 2002-02-28 12:25:39 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -90,8 +90,9 @@ using namespace ::com::sun::star; SvxOutlinerForwarder::SvxOutlinerForwarder( Outliner& rOutl ) : rOutliner( rOutl ), - mpAttribsCache( NULL ), - mpParaAttribsCache( NULL ) + mpAttribsCache( NULL ), + mpParaAttribsCache( NULL ), + mnParaAttribsCache( 0 ) { } @@ -122,7 +123,7 @@ static SfxItemSet ImplOutlinerForwarderGetAttribs( const ESelection& rSel, BOOL { if( rSel.nStartPara == rSel.nEndPara ) { - sal_uInt8 nFlags; + sal_uInt8 nFlags = 0; switch( bOnlyHardAttrib ) { @@ -302,11 +303,6 @@ void SvxOutlinerForwarder::flushCache() } } -void SvxOutlinerForwarder::SetNotifyHdl( const Link& rLink ) -{ - rOutliner.SetNotifyHdl( rLink ); -} - LanguageType SvxOutlinerForwarder::GetLanguage( USHORT nPara, USHORT nIndex ) const { return rOutliner.GetLanguage(nPara, nIndex); @@ -320,8 +316,11 @@ Rectangle SvxOutlinerForwarder::GetCharBounds( USHORT nPara, USHORT nIndex ) con Rectangle SvxOutlinerForwarder::GetParaBounds( USHORT nPara ) const { - // TODO - return Rectangle(); + Point aPnt = rOutliner.GetDocPosTopLeft( nPara ); + ULONG nHeight = rOutliner.GetTextHeight( nPara ); + Size aSize = rOutliner.CalcTextSize(); + + return Rectangle( aPnt.X(), aPnt.Y(), aSize.Width(), nHeight ); } sal_Bool SvxOutlinerForwarder::GetIndexAtPoint( const Point&, USHORT& nPara, USHORT& nIndex ) const |