From 0e256e2cff0792f00c83dd7b5b0390d3c48b9789 Mon Sep 17 00:00:00 2001 From: RĂ¼diger Timm Date: Mon, 7 Jul 2008 11:53:55 +0000 Subject: INTEGRATION: CWS tl53 (1.33.74); FILE MERGED 2008/06/25 12:36:28 tl 1.33.74.3: RESYNC: (1.35-1.36); FILE MERGED 2008/06/03 13:46:33 tl 1.33.74.2: RESYNC: (1.33-1.35); FILE MERGED 2008/03/18 12:44:13 tl 1.33.74.1: #i74724# missing implementation added --- starmath/source/accessibility.cxx | 38 +++++++++++++++++++++++++++++++------- 1 file changed, 31 insertions(+), 7 deletions(-) (limited to 'starmath/source/accessibility.cxx') diff --git a/starmath/source/accessibility.cxx b/starmath/source/accessibility.cxx index e943ca0518da..42bb5015b55f 100644 --- a/starmath/source/accessibility.cxx +++ b/starmath/source/accessibility.cxx @@ -7,7 +7,7 @@ * OpenOffice.org - a multi-platform office productivity suite * * $RCSfile: accessibility.cxx,v $ - * $Revision: 1.37 $ + * $Revision: 1.38 $ * * This file is part of OpenOffice.org. * @@ -1496,17 +1496,41 @@ sal_Bool SmTextForwarder::InsertText( const String& rStr, const ESelection& rSel const SfxItemSet* SmTextForwarder::GetEmptyItemSetPtr() { - DBG_ERROR("not yet implemented") - return 0; + const SfxItemSet *pItemSet = 0; + EditEngine *pEditEngine = rEditAcc.GetEditEngine(); + if (pEditEngine) + { + pItemSet = &pEditEngine->GetEmptyItemSet(); + } + return pItemSet; } + void SmTextForwarder::AppendParagraph() { - DBG_ERROR("not yet implemented") + // append an empty paragraph + EditEngine *pEditEngine = rEditAcc.GetEditEngine(); + if (pEditEngine) + { + USHORT nParaCount = pEditEngine->GetParagraphCount(); + pEditEngine->InsertParagraph( nParaCount, String() ); + } } -xub_StrLen SmTextForwarder::AppendTextPortion( USHORT /*nPara*/, const String &/*rText*/, const SfxItemSet &/*rSet*/ ) + +xub_StrLen SmTextForwarder::AppendTextPortion( USHORT nPara, const String &rText, const SfxItemSet &rSet ) { - DBG_ERROR("not yet implemented") - return 0; + xub_StrLen nRes = 0; + EditEngine *pEditEngine = rEditAcc.GetEditEngine(); + if (pEditEngine && nPara < pEditEngine->GetParagraphCount()) + { + // append text + ESelection aSel( nPara, pEditEngine->GetTextLen( nPara ) ); + pEditEngine->QuickInsertText( rText, aSel ); + + // set attributes for new appended text + nRes = aSel.nEndPos = pEditEngine->GetTextLen( nPara ); + pEditEngine->QuickSetAttribs( rSet, aSel ); + } + return nRes; } void SmTextForwarder::CopyText(const SvxTextForwarder& rSource) -- cgit