Files
libreoffice/editeng/source/uno/unofored.cxx

509 lines
15 KiB
C++
Raw Normal View History

/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
re-base on ALv2 code. Includes (at least) relevant parts of: linecap: Reintegrating finished LineCap feature Patch contributed by Regina Henschel http://svn.apache.org/viewvc?view=revision&revision=1232507 Patches contributed by Sven Jacobi impress212: #i81610# fixed animation export http://svn.apache.org/viewvc?view=revision&revision=1167620 impress212: drawinglayer gbuild environment changes http://svn.apache.org/viewvc?view=revision&revision=1167627 http://svn.apache.org/viewvc?view=revision&revision=1167628 impress212: DffPropSet -> minor code improvements, removing table http://svn.apache.org/viewvc?view=revision&revision=1167634 impress212: #158494# fixed excel import (text rotation) http://svn.apache.org/viewvc?view=revision&revision=1167638 Patches contributed by Armin Le Grand Svg: Reintegrated Svg replacement from /branches/alg/svgreplavement http://svn.apache.org/viewvc?view=revision&revision=1220836 #118728# changed indentifying definitions for Svg file detection http://svn.apache.org/viewvc?view=revision&revision=1229961 #118838# LineGeometry creation for complicated cases optimized to create single Polygons http://svn.apache.org/viewvc?view=revision&revision=1236232 #119176# corrected file type detection for SVG for svg files without xml header http://svn.apache.org/viewvc?view=revision&revision=1309445 #118728# Extended Svg file detection http://svn.apache.org/viewvc?view=revision&revision=1230531 #118529# solve break converters and convert commands for OLEs and images http://svn.apache.org/viewvc?view=revision&revision=1186168 svg: added WaE changes from branch svgreplacement to trunc http://svn.apache.org/viewvc?view=revision&revision=1222974 svg: corrected missing member initialization http://svn.apache.org/viewvc?view=revision&revision=1226134 fix for #118525#: Using primitives for chart sub-geometry visualisation http://svn.apache.org/viewvc?view=revision&revision=1226879 #118898# Adapted ImpGraphic::ImplGetBitmap to correctly convert metafiles to bitmapEx ... http://svn.apache.org/viewvc?view=revision&revision=1293316 fix for #118525#: removed no longer used variable maOriginalMapMode, one more exception eliminated http://svn.apache.org/viewvc?view=revision&revision=1227097 #16758# Added buffering to the VDev usages of the VclProcessor2D derivates... http://svn.apache.org/viewvc?view=revision&revision=1229521 #116758# Secured VDev buffer device to Vcl deinit http://svn.apache.org/viewvc?view=revision&revision=1230574 #116758# added remembering allocated VDevs for VDevBuffer to be able to also delete these when vcl goes down; it should never happen, but You never know http://svn.apache.org/viewvc?view=revision&revision=1230927 #118730# Changed SvgClipPathNode to use MaskPrimitive2D for primitive representation instead of TransparencePrimitive2D http://svn.apache.org/viewvc?view=revision&revision=1231198 #118822# secured 3D geometry creation (slices) by subdividing the 2D source polyPolygon early http://svn.apache.org/viewvc?view=revision&revision=1234749 #118829# enhanced Svg gradient quality, obstacles avoided http://svn.apache.org/viewvc?view=revision&revision=1235361 #118834# Unified usage of TextBreakupHelper as single tooling class for i18n text primitive breakup http://svn.apache.org/viewvc?view=revision&revision=1236110 #118853# added square pixel size limit to conversion of TransparencePrimitive2D to Metafile action http://svn.apache.org/viewvc?view=revision&revision=1237656 #118824# coreccted mirroring and boundrect when the graphicmanager is used for bitmap output http://svn.apache.org/viewvc?view=revision&revision=1240097 #115092# Corrected VclProcessor2D::RenderPolygonStrokePrimitive2D for various optimization scenarios http://svn.apache.org/viewvc?view=revision&revision=1241434 #118783# Corrected errors in ID strings, corrected Svg line/fill export, corrected polygon close state http://svn.apache.org/viewvc?view=revision&revision=1232006 #118796# corrected null-pointer usage in SVG text exporter http://svn.apache.org/viewvc?view=revision&revision=1240262 #118729# Use GraphicStreamUrl and GraphicUrl to allow multi image import with linked graphics, too http://svn.apache.org/viewvc?view=revision&revision=1229962 #118898# corrected error in GDIMetaFile::GetBoundRect in handling MetaFloatTransparentAction http://svn.apache.org/viewvc?view=revision&revision=1293349 #118855# Corrected handling of possibly created empty clipRegions after PolyPolygon clipping http://svn.apache.org/viewvc?view=revision&revision=1237725 #115962# Better (but not yet optimal, see comments in task) handling of MetaFloatTransparentAction in PDF export http://svn.apache.org/viewvc?view=revision&revision=1241078 IP clearance: #118466# This patch removes librsvg, libcroco, libgsf, ... http://svn.apache.org/viewvc?view=revision&revision=1200879 118779# Added svg content streaming in/out to ImpGraphic stream operators http://svn.apache.org/viewvc?view=revision&revision=1231908 linecap: correctons for WaE and mac drawing http://svn.apache.org/viewvc?view=revision&revision=1232793 svg: uses current system Dpi for Svg replacement image creation http://svn.apache.org/viewvc?view=revision&revision=1233948 Patches contributed by Mathias Bauer (and others) gnumake4 work variously http://svn.apache.org/viewvc?view=revision&revision=1394326 http://svn.apache.org/viewvc?view=revision&revision=1396797 http://svn.apache.org/viewvc?view=revision&revision=1397315 http://svn.apache.org/viewvc?view=revision&revision=1394326 Remove duplicate header includes. cws mba34issues01: #i117720#: convert assertion into warning http://svn.apache.org/viewvc?view=revision&revision=1172352 118485 - Styles for OLEs are not saved. Submitted by Armin Le Grand. http://svn.apache.org/viewvc?view=revision&revision=1182166 cws mba34issues01: #i117714#: remove assertion http://svn.apache.org/viewvc?view=revision&revision=1172357 Patch contributed by Jurgen Schmidt add some additional checks to ensure proper reading operations http://svn.apache.org/viewvc?view=revision&revision=1209022 mostly prefer our stream / bounds checking work. Patches contributed by Herbert Duerr #i118816# add clarifying comment regarding Font::*Color*() methods http://svn.apache.org/viewvc?view=revision&revision=1233833 extend macro->string handling for empty strings http://svn.apache.org/viewvc?view=revision&revision=1175801 avoid magic constants for SALCOLOR_NONE http://svn.apache.org/viewvc?view=revision&revision=1177543 initialize slant properly in ImplFontMetricData constructor (author=iorsh) http://svn.apache.org/viewvc?view=revision&revision=1177551 #i118675# make check for extension updates more stable http://svn.apache.org/viewvc?view=revision&revision=1214797 #a118617# remove VBasicEventListener.dll binary There are no known users depending on its CLSID http://svn.apache.org/viewvc?view=revision&revision=1203697 Patches contributed by Ariel Constenla-Haile Fix build breaker on Linux/gcc http://svn.apache.org/viewvc?view=revision&revision=1221104 Fix crash when trying to instantiate css.graphic.GraphicRasterizer_RSVG http://svn.apache.org/viewvc?view=revision&revision=1215559 Patches contributed by Oliver-Rainer Wittmann sw34bf06: #i117962# - method <SwFlyFrm::IsPaint(..)> - consider instances of <SwFlyDrawObj> http://svn.apache.org/viewvc?view=revision&revision=1172120 sw34bf06: #i117783# - Writer's implementation of XPagePrintable - apply print settings to new printing routines http://svn.apache.org/viewvc?view=revision&revision=1172115 gnumake4 work variously from Hans-Joachim Lankenau http://svn.apache.org/viewvc?view=revision&revision=1397315 http://svn.apache.org/viewvc?view=revision&revision=1396797 http://svn.apache.org/viewvc?view=revision&revision=1396782 http://svn.apache.org/viewvc?view=revision&revision=1394707 plus some amount of re-splitting of legacy headers. Patch contributed by Pavel Janik WaE: Remove unused variables. http://svn.apache.org/viewvc?view=revision&revision=1230697 Patches contributed by Takashi Ono mingwport35: i#117795: MinGW port fix for vcl2gnumake http://svn.apache.org/viewvc?view=revision&revision=1172091 mingwport35: i#117795: MinGW port fix for vcl2gnumake http://svn.apache.org/viewvc?view=revision&revision=1172091 Patch contributed by Christian Lippka impress212: #i98044# re enable Text menu for outline and title shapes http://svn.apache.org/viewvc?view=revision&revision=1167639 Patch contributed by Andre Fischer 118674: Made category B code optional and disabled by default. http://svn.apache.org/viewvc?view=revision&revision=1215131 118881: Ignore empty paragraphs after bullets. http://svn.apache.org/viewvc?view=revision&revision=1296205 Patches contributed by Philipp Lohmann ooo340fixes: #i117780# use rtl allocator http://svn.apache.org/viewvc?view=revision&revision=1172087 ooo34gsl02: #i117807# fix an off by one error (index actually inside the pfb section header) http://svn.apache.org/viewvc?view=revision&revision=1167576 various cleanups, related compilation fixes, warning cleanups, re-working of obsolete stl template pieces to use boost instead, changed string classes, re-adapt KDE about data, about dialog, fixing warnings, and other fixes & improvements. Disable svg import / render for about/ branding code-paths for now. Restore full icon theme set. Remove OS/2 conditionals and sources. Remove conflicting gtk/full-screen monitors support. Retain existing svg rasterizer files - temporarily disabled. Standardize stringificaiton and fixup dllpostfix issues. Rename SvgGradientHelper::== to equalTo to avoid overloading issues. Use the flat GdiPlus API for LineCaps calls.
2012-10-09 12:22:23 +01:00
/*
* This file is part of the LibreOffice project.
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*
* This file incorporates work covered by the following license notice:
*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed
* with this work for additional information regarding copyright
* ownership. The ASF licenses this file to you under the Apache
* License, Version 2.0 (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.apache.org/licenses/LICENSE-2.0 .
*/
2000-09-18 16:07:07 +00:00
2002-09-13 13:31:58 +00:00
#include <algorithm>
#include <editeng/eeitem.hxx>
2002-03-04 17:32:38 +00:00
#include <com/sun/star/i18n/WordType.hpp>
2000-09-18 16:07:07 +00:00
#include <svl/itemset.hxx>
#include <editeng/editeng.hxx>
#include <editeng/editview.hxx>
#include <editeng/unoedhlp.hxx>
#include <editeng/editdata.hxx>
#include <editeng/outliner.hxx>
#include <editeng/editobj.hxx>
2000-09-18 16:07:07 +00:00
#include <editeng/unofored.hxx>
#include <unofored_internal.hxx>
2000-09-18 16:07:07 +00:00
using namespace ::com::sun::star;
2000-09-18 16:07:07 +00:00
SvxEditEngineForwarder::SvxEditEngineForwarder( EditEngine& rEngine ) :
rEditEngine( rEngine )
{
}
SvxEditEngineForwarder::~SvxEditEngineForwarder()
{
2011-02-16 16:34:02 -05:00
// the EditEngine may need to be deleted from the outside
2000-09-18 16:07:07 +00:00
}
sal_Int32 SvxEditEngineForwarder::GetParagraphCount() const
2000-09-18 16:07:07 +00:00
{
return rEditEngine.GetParagraphCount();
}
sal_Int32 SvxEditEngineForwarder::GetTextLen( sal_Int32 nParagraph ) const
2000-09-18 16:07:07 +00:00
{
return rEditEngine.GetTextLen( nParagraph );
}
OUString SvxEditEngineForwarder::GetText( const ESelection& rSel ) const
2000-09-18 16:07:07 +00:00
{
2012-01-30 11:31:05 +00:00
return convertLineEnd(rEditEngine.GetText(rSel, LINEEND_LF), GetSystemLineEnd());
2000-09-18 16:07:07 +00:00
}
SfxItemSet SvxEditEngineForwarder::GetAttribs( const ESelection& rSel, EditEngineAttribs nOnlyHardAttrib ) const
2000-09-18 16:07:07 +00:00
{
if( rSel.nStartPara == rSel.nEndPara )
{
sal_uInt8 nFlags = 0;
switch( nOnlyHardAttrib )
{
case EditEngineAttribs_All:
nFlags = GETATTRIBS_ALL;
break;
case EditEngineAttribs_HardAndPara:
nFlags = GETATTRIBS_PARAATTRIBS|GETATTRIBS_CHARATTRIBS;
break;
case EditEngineAttribs_OnlyHard:
nFlags = GETATTRIBS_CHARATTRIBS;
break;
default:
2011-03-01 19:07:44 +01:00
OSL_FAIL("unknown flags for SvxOutlinerForwarder::GetAttribs");
}
return rEditEngine.GetAttribs( rSel.nStartPara, rSel.nStartPos, rSel.nEndPos, nFlags );
}
else
{
return rEditEngine.GetAttribs( rSel, nOnlyHardAttrib );
}
2000-09-18 16:07:07 +00:00
}
SfxItemSet SvxEditEngineForwarder::GetParaAttribs( sal_Int32 nPara ) const
2000-09-18 16:07:07 +00:00
{
SfxItemSet aSet( rEditEngine.GetParaAttribs( nPara ) );
sal_uInt16 nWhich = EE_PARA_START;
2000-09-18 16:07:07 +00:00
while( nWhich <= EE_PARA_END )
{
if( aSet.GetItemState( nWhich, true ) != SFX_ITEM_SET )
2000-09-18 16:07:07 +00:00
{
if( rEditEngine.HasParaAttrib( nPara, nWhich ) )
aSet.Put( rEditEngine.GetParaAttrib( nPara, nWhich ) );
}
nWhich++;
}
return aSet;
}
void SvxEditEngineForwarder::SetParaAttribs( sal_Int32 nPara, const SfxItemSet& rSet )
2000-09-18 16:07:07 +00:00
{
rEditEngine.SetParaAttribs( nPara, rSet );
}
void SvxEditEngineForwarder::RemoveAttribs( const ESelection& rSelection, bool bRemoveParaAttribs, sal_uInt16 nWhich )
{
rEditEngine.RemoveAttribs( rSelection, bRemoveParaAttribs, nWhich );
}
2000-09-18 16:07:07 +00:00
SfxItemPool* SvxEditEngineForwarder::GetPool() const
{
return rEditEngine.GetEmptyItemSet().GetPool();
}
void SvxEditEngineForwarder::GetPortions( sal_Int32 nPara, std::vector<sal_Int32>& rList ) const
2000-09-18 16:07:07 +00:00
{
rEditEngine.GetPortions( nPara, rList );
}
void SvxEditEngineForwarder::QuickInsertText( const OUString& rText, const ESelection& rSel )
2000-09-18 16:07:07 +00:00
{
rEditEngine.QuickInsertText( rText, rSel );
}
void SvxEditEngineForwarder::QuickInsertLineBreak( const ESelection& rSel )
{
rEditEngine.QuickInsertLineBreak( rSel );
}
2000-09-18 16:07:07 +00:00
void SvxEditEngineForwarder::QuickInsertField( const SvxFieldItem& rFld, const ESelection& rSel )
{
rEditEngine.QuickInsertField( rFld, rSel );
}
void SvxEditEngineForwarder::QuickSetAttribs( const SfxItemSet& rSet, const ESelection& rSel )
{
rEditEngine.QuickSetAttribs( rSet, rSel );
}
bool SvxEditEngineForwarder::IsValid() const
{
// cannot reliably query EditEngine state
// while in the middle of an update
return rEditEngine.GetUpdateMode();
}
OUString SvxEditEngineForwarder::CalcFieldValue( const SvxFieldItem& rField, sal_Int32 nPara, sal_Int32 nPos, Color*& rpTxtColor, Color*& rpFldColor )
2000-09-18 16:07:07 +00:00
{
return rEditEngine.CalcFieldValue( rField, nPara, nPos, rpTxtColor, rpFldColor );
}
void SvxEditEngineForwarder::FieldClicked( const SvxFieldItem& rField, sal_Int32 nPara, sal_Int32 nPos )
{
rEditEngine.FieldClicked( rField, nPara, nPos );
}
SfxItemState GetSvxEditEngineItemState( EditEngine& rEditEngine, const ESelection& rSel, sal_uInt16 nWhich )
2000-09-18 16:07:07 +00:00
{
2011-12-23 02:30:41 -05:00
std::vector<EECharAttrib> aAttribs;
2000-09-18 16:07:07 +00:00
const SfxPoolItem* pLastItem = NULL;
SfxItemState eState = SFX_ITEM_DEFAULT;
// check all paragraphs inside the selection
for( sal_Int32 nPara = rSel.nStartPara; nPara <= rSel.nEndPara; nPara++ )
2000-09-18 16:07:07 +00:00
{
SfxItemState eParaState = SFX_ITEM_DEFAULT;
// calculate start and endpos for this paragraph
sal_Int32 nPos = 0;
2000-09-18 16:07:07 +00:00
if( rSel.nStartPara == nPara )
nPos = rSel.nStartPos;
sal_Int32 nEndPos = rSel.nEndPos;
2000-09-18 16:07:07 +00:00
if( rSel.nEndPara != nPara )
nEndPos = rEditEngine.GetTextLen( nPara );
// get list of char attribs
rEditEngine.GetCharAttribs( nPara, aAttribs );
bool bEmpty = true; // we found no item inside the selection of this paragraph
bool bGaps = false; // we found items but theire gaps between them
sal_Int32 nLastEnd = nPos;
2000-09-18 16:07:07 +00:00
const SfxPoolItem* pParaItem = NULL;
2011-12-23 02:30:41 -05:00
for(std::vector<EECharAttrib>::const_iterator i = aAttribs.begin(); i < aAttribs.end(); ++i)
2000-09-18 16:07:07 +00:00
{
2011-12-23 02:30:41 -05:00
DBG_ASSERT(i->pAttr, "GetCharAttribs gives corrupt data");
2000-09-18 16:07:07 +00:00
const bool bEmptyPortion = i->nStart == i->nEnd;
2011-12-23 02:30:41 -05:00
if((!bEmptyPortion && i->nStart >= nEndPos) ||
(bEmptyPortion && i->nStart > nEndPos))
2014-03-29 18:54:45 +01:00
break; // break if we are already behind our selection
2000-09-18 16:07:07 +00:00
2011-12-23 02:30:41 -05:00
if((!bEmptyPortion && i->nEnd <= nPos) ||
(bEmptyPortion && i->nEnd < nPos))
2014-03-29 18:54:45 +01:00
continue; // or if the attribute ends before our selection
2000-09-18 16:07:07 +00:00
2011-12-23 02:30:41 -05:00
if(i->pAttr->Which() != nWhich)
2000-09-18 16:07:07 +00:00
continue; // skip if is not the searched item
// if we already found an item
if( pParaItem )
{
// ... and its different to this one than the state is dont care
2011-12-23 02:30:41 -05:00
if(*pParaItem != *(i->pAttr))
2000-09-18 16:07:07 +00:00
return SFX_ITEM_DONTCARE;
}
else
2011-12-23 02:30:41 -05:00
pParaItem = i->pAttr;
2000-09-18 16:07:07 +00:00
if( bEmpty )
bEmpty = false;
2000-09-18 16:07:07 +00:00
2011-12-23 02:30:41 -05:00
if(!bGaps && i->nStart > nLastEnd)
bGaps = true;
2000-09-18 16:07:07 +00:00
2011-12-23 02:30:41 -05:00
nLastEnd = i->nEnd;
2000-09-18 16:07:07 +00:00
}
if( !bEmpty && !bGaps && nLastEnd < ( nEndPos - 1 ) )
bGaps = true;
2011-12-23 02:30:41 -05:00
if( bEmpty )
eParaState = SFX_ITEM_DEFAULT;
else if( bGaps )
eParaState = SFX_ITEM_DONTCARE;
else
eParaState = SFX_ITEM_SET;
2000-09-18 16:07:07 +00:00
// if we already found an item check if we found the same
if( pLastItem )
{
if( (pParaItem == NULL) || (*pLastItem != *pParaItem) )
return SFX_ITEM_DONTCARE;
}
else
{
pLastItem = pParaItem;
eState = eParaState;
}
}
return eState;
}
SfxItemState SvxEditEngineForwarder::GetItemState( const ESelection& rSel, sal_uInt16 nWhich ) const
2000-09-18 16:07:07 +00:00
{
return GetSvxEditEngineItemState( rEditEngine, rSel, nWhich );
}
SfxItemState SvxEditEngineForwarder::GetItemState( sal_Int32 nPara, sal_uInt16 nWhich ) const
2000-09-18 16:07:07 +00:00
{
const SfxItemSet& rSet = rEditEngine.GetParaAttribs( nPara );
return rSet.GetItemState( nWhich );
}
LanguageType SvxEditEngineForwarder::GetLanguage( sal_Int32 nPara, sal_Int32 nIndex ) const
{
return rEditEngine.GetLanguage(nPara, nIndex);
}
sal_Int32 SvxEditEngineForwarder::GetFieldCount( sal_Int32 nPara ) const
2002-04-11 09:14:17 +00:00
{
return rEditEngine.GetFieldCount(nPara);
}
EFieldInfo SvxEditEngineForwarder::GetFieldInfo( sal_Int32 nPara, sal_uInt16 nField ) const
2002-04-11 09:14:17 +00:00
{
return rEditEngine.GetFieldInfo( nPara, nField );
}
EBulletInfo SvxEditEngineForwarder::GetBulletInfo( sal_Int32 ) const
2002-04-11 09:14:17 +00:00
{
return EBulletInfo();
}
Rectangle SvxEditEngineForwarder::GetCharBounds( sal_Int32 nPara, sal_Int32 nIndex ) const
2002-02-15 08:00:04 +00:00
{
// #101701#
// EditEngine's 'internal' methods like GetCharacterBounds()
// don't rotate for vertical text.
2002-09-13 13:31:58 +00:00
Size aSize( rEditEngine.CalcTextWidth(), rEditEngine.GetTextHeight() );
::std::swap( aSize.Width(), aSize.Height() );
bool bIsVertical( rEditEngine.IsVertical() );
// #108900# Handle virtual position one-past-the end of the string
if( nIndex >= rEditEngine.GetTextLen(nPara) )
{
Rectangle aLast;
if( nIndex )
{
// use last character, if possible
aLast = rEditEngine.GetCharacterBounds( EPosition(nPara, nIndex-1) );
// move at end of this last character, make one pixel wide
aLast.Move( aLast.Right() - aLast.Left(), 0 );
aLast.SetSize( Size(1, aLast.GetHeight()) );
// take care for CTL
aLast = SvxEditSourceHelper::EEToUserSpace( aLast, aSize, bIsVertical );
}
else
{
// #109864# Bounds must lie within the paragraph
aLast = GetParaBounds( nPara );
// #109151# Don't use paragraph height, but line height
// instead. aLast is already CTL-correct
if( bIsVertical)
aLast.SetSize( Size( rEditEngine.GetLineHeight(nPara,0), 1 ) );
else
aLast.SetSize( Size( 1, rEditEngine.GetLineHeight(nPara,0) ) );
}
return aLast;
}
else
{
return SvxEditSourceHelper::EEToUserSpace( rEditEngine.GetCharacterBounds( EPosition(nPara, nIndex) ),
aSize, bIsVertical );
}
2002-02-15 08:00:04 +00:00
}
Rectangle SvxEditEngineForwarder::GetParaBounds( sal_Int32 nPara ) const
{
const Point aPnt = rEditEngine.GetDocPosTopLeft( nPara );
sal_uLong nWidth;
sal_uLong nHeight;
sal_uLong nTextWidth;
if( rEditEngine.IsVertical() )
{
// #101701#
// Hargl. EditEngine's 'external' methods return the rotated
// dimensions, 'internal' methods like GetTextHeight( n )
// don't rotate.
nWidth = rEditEngine.GetTextHeight( nPara );
nHeight = rEditEngine.GetTextHeight();
nTextWidth = rEditEngine.GetTextHeight();
return Rectangle( nTextWidth - aPnt.Y() - nWidth, 0, nTextWidth - aPnt.Y(), nHeight );
}
else
{
nWidth = rEditEngine.CalcTextWidth();
nHeight = rEditEngine.GetTextHeight( nPara );
return Rectangle( 0, aPnt.Y(), nWidth, aPnt.Y() + nHeight );
}
}
MapMode SvxEditEngineForwarder::GetMapMode() const
{
return rEditEngine.GetRefMapMode();
}
OutputDevice* SvxEditEngineForwarder::GetRefDevice() const
{
return rEditEngine.GetRefDevice();
}
bool SvxEditEngineForwarder::GetIndexAtPoint( const Point& rPos, sal_Int32& nPara, sal_Int32& nIndex ) const
{
2002-09-13 13:31:58 +00:00
Size aSize( rEditEngine.CalcTextWidth(), rEditEngine.GetTextHeight() );
::std::swap( aSize.Width(), aSize.Height() );
Point aEEPos( SvxEditSourceHelper::UserSpaceToEE( rPos,
2002-09-13 13:31:58 +00:00
aSize,
rEditEngine.IsVertical() ));
EPosition aDocPos = rEditEngine.FindDocPosition( aEEPos );
2002-03-04 17:32:38 +00:00
nPara = aDocPos.nPara;
nIndex = aDocPos.nIndex;
return true;
}
bool SvxEditEngineForwarder::GetWordIndices( sal_Int32 nPara, sal_Int32 nIndex, sal_Int32& nStart, sal_Int32& nEnd ) const
{
2002-03-04 17:32:38 +00:00
ESelection aRes = rEditEngine.GetWord( ESelection(nPara, nIndex, nPara, nIndex), com::sun::star::i18n::WordType::DICTIONARY_WORD );
if( aRes.nStartPara == nPara &&
aRes.nStartPara == aRes.nEndPara )
{
nStart = aRes.nStartPos;
nEnd = aRes.nEndPos;
return true;
2002-03-04 17:32:38 +00:00
}
return false;
}
bool SvxEditEngineForwarder::GetAttributeRun( sal_Int32& nStartIndex, sal_Int32& nEndIndex, sal_Int32 nPara, sal_Int32 nIndex, bool bInCell ) const
{
return SvxEditSourceHelper::GetAttributeRun( nStartIndex, nEndIndex, rEditEngine, nPara, nIndex, bInCell );
}
sal_Int32 SvxEditEngineForwarder::GetLineCount( sal_Int32 nPara ) const
{
return rEditEngine.GetLineCount(nPara);
}
sal_Int32 SvxEditEngineForwarder::GetLineLen( sal_Int32 nPara, sal_Int32 nLine ) const
{
return rEditEngine.GetLineLen(nPara, nLine);
}
void SvxEditEngineForwarder::GetLineBoundaries( /*out*/sal_Int32 &rStart, /*out*/sal_Int32 &rEnd, sal_Int32 nPara, sal_Int32 nLine ) const
CWS-TOOLING: integrate CWS swa11y32_2nd 2009-08-13 13:04:09 +0200 mav r274936 : #i104204# remove support for Ctrl-Tab 2009-08-13 09:59:22 +0200 od r274924 : #i93269# method <atk_wrapper_focus_idle_handler(..)> - emit also object:state-changed:focus, if cursor is inside <XAccessibleText> object 2009-08-11 12:15:11 +0200 tl r274851 : CWS-TOOLING: rebase CWS swa11y32_2nd to trunk@274622 (milestone: DEV300:m54) 2009-07-14 17:35:03 +0200 tl r273982 : 2009-07-10 10:46:39 +0200 tl r273879 : CWS-TOOLING: rebase CWS swa11y32 to trunk@273468 (milestone: DEV300:m51) 2009-07-01 14:00:25 +0200 mav r273577 : #i102879# the text of the button should not change 2009-07-01 13:16:19 +0200 od r273574 : #159496# method <GetHelpAnchor_Impl(..)> - do not release the solar mutex 2009-06-29 15:29:10 +0200 od r273476 : #i95042# method <CreateXWindow(..)> - return instance <VCLXComboBox> for <Window> instance of type <MetricBox>. note: <MetricBox> is inherited from <ComboBox> 2009-06-23 15:49:32 +0200 mav r273283 : #i101967# fix tab-control implementation 2009-06-22 13:56:22 +0200 od r273229 : #i100938# method <text_wrapper_get_run_attributes(..)> - always provide start_offset and end_offset - do _not_ increment the end_offset provide by <accessibility::TextSegment> instance 2009-06-02 12:09:03 +0200 mav r272492 : #i101959# Let the additional dialog window add its childred to the parents tab-hierarchy 2009-06-02 09:55:39 +0200 mav r272484 : #i102015# allow to have indirect child windows in tab-hierarchy 2009-06-02 09:49:42 +0200 mav r272482 : #i102015# Let the windows containing the extension dialog controls add controls to the tab hierarchy 2009-05-27 15:45:33 +0200 od r272354 : #i101012# method <SvxIconChoiceCtrl_Impl::EntrySelected(..)> - emit vcl event LISTBOX_SELECT only in case that the given entry is selected. 2009-05-27 09:54:36 +0200 od r272333 : #i92103# map UNO-API accessible events list box entry expanded/collapsed to corresponding atk events. 2009-05-27 09:52:15 +0200 od r272331 : #i92103# process list box entry expanded/collapsed events 2009-05-27 09:49:19 +0200 od r272330 : #i92103# emit vcl event list box entry expanded/collapsed 2009-05-26 10:42:05 +0200 od r272283 : #i93269# correct fix: check success of <queryInterface> call 2009-05-04 15:52:04 +0200 od r271469 : #i92103# new vcl event ids VCLEVENT_LISTBOX_ENTRY_EXPANDED and VCLEVENT_LISTBOX_ENTRY_COLLAPSED 2009-05-04 15:10:20 +0200 od r271460 : #i92103# refine definition of new constants 2009-05-04 14:36:44 +0200 od r271454 : #i92103# new constants for indicating that a list box entry is expanded respectively collapsed. 2009-04-30 16:09:40 +0200 od r271421 : #i93269# method <atk_wrapper_focus_idle_handler(..)> - emit text_caret_moved event for <XAccessibleText> object, if cursor is inside the <XAccessibleText> object. 2009-04-22 14:00:10 +0200 tl r271105 : warning-free code 2009-04-22 09:17:30 +0200 tl r271073 : CWS-TOOLING: rebase CWS swa11y32 to trunk@270723 (milestone: DEV300:m46) 2009-04-20 12:53:03 +0200 cd r270974 : #i83639# Check extendedhelp state to provide correct tool tip text 2009-04-03 13:07:13 +0200 tl r270471 : #i63983# changed accessible object names to empty strings 2009-04-01 15:52:09 +0200 tl r270336 : #i90991# accessible names and description for paragraphs should be empty 2009-04-01 15:12:42 +0200 tl r270333 : #i90991# accessible names and description for paragraphs should be empty 2009-04-01 15:10:34 +0200 tl r270331 : warning-free code 2009-04-01 12:54:44 +0200 tl r270319 : #i89176# Implementation of XAccessibleMultiLineText in EditEngine 2009-04-01 12:52:56 +0200 tl r270318 : #i89176# Implementation of XAccessibleMultiLineText in EditEngine 2009-03-27 18:31:01 +0100 tbe r270166 : #i92143# text getRangeExtents reports incorrect 'x' values for spreadsheet cells 2009-03-13 13:43:54 +0100 tl r269476 : #i94322# ImpEditView::ShowCursor and nPara == USHRT_MAX problem fixed 2009-03-12 10:27:30 +0100 tl r269366 : warning-free code; unresolved external dbg_out when compiling with debug=t 2009-03-11 12:40:31 +0100 tl r269312 : warning-free code Solaris x86 2009-03-10 15:49:01 +0100 tl r269279 : #i86443# handle GetColumnCount() == 0 2009-03-10 10:48:32 +0100 cl r269254 : #i91742# name cells for accessibility 2009-03-09 17:06:33 +0100 cl r269203 : #i91742# call init on accessible cells
2009-08-26 13:37:34 +00:00
{
rEditEngine.GetLineBoundaries(rStart, rEnd, nPara, nLine);
}
sal_Int32 SvxEditEngineForwarder::GetLineNumberAtIndex( sal_Int32 nPara, sal_Int32 nIndex ) const
CWS-TOOLING: integrate CWS swa11y32_2nd 2009-08-13 13:04:09 +0200 mav r274936 : #i104204# remove support for Ctrl-Tab 2009-08-13 09:59:22 +0200 od r274924 : #i93269# method <atk_wrapper_focus_idle_handler(..)> - emit also object:state-changed:focus, if cursor is inside <XAccessibleText> object 2009-08-11 12:15:11 +0200 tl r274851 : CWS-TOOLING: rebase CWS swa11y32_2nd to trunk@274622 (milestone: DEV300:m54) 2009-07-14 17:35:03 +0200 tl r273982 : 2009-07-10 10:46:39 +0200 tl r273879 : CWS-TOOLING: rebase CWS swa11y32 to trunk@273468 (milestone: DEV300:m51) 2009-07-01 14:00:25 +0200 mav r273577 : #i102879# the text of the button should not change 2009-07-01 13:16:19 +0200 od r273574 : #159496# method <GetHelpAnchor_Impl(..)> - do not release the solar mutex 2009-06-29 15:29:10 +0200 od r273476 : #i95042# method <CreateXWindow(..)> - return instance <VCLXComboBox> for <Window> instance of type <MetricBox>. note: <MetricBox> is inherited from <ComboBox> 2009-06-23 15:49:32 +0200 mav r273283 : #i101967# fix tab-control implementation 2009-06-22 13:56:22 +0200 od r273229 : #i100938# method <text_wrapper_get_run_attributes(..)> - always provide start_offset and end_offset - do _not_ increment the end_offset provide by <accessibility::TextSegment> instance 2009-06-02 12:09:03 +0200 mav r272492 : #i101959# Let the additional dialog window add its childred to the parents tab-hierarchy 2009-06-02 09:55:39 +0200 mav r272484 : #i102015# allow to have indirect child windows in tab-hierarchy 2009-06-02 09:49:42 +0200 mav r272482 : #i102015# Let the windows containing the extension dialog controls add controls to the tab hierarchy 2009-05-27 15:45:33 +0200 od r272354 : #i101012# method <SvxIconChoiceCtrl_Impl::EntrySelected(..)> - emit vcl event LISTBOX_SELECT only in case that the given entry is selected. 2009-05-27 09:54:36 +0200 od r272333 : #i92103# map UNO-API accessible events list box entry expanded/collapsed to corresponding atk events. 2009-05-27 09:52:15 +0200 od r272331 : #i92103# process list box entry expanded/collapsed events 2009-05-27 09:49:19 +0200 od r272330 : #i92103# emit vcl event list box entry expanded/collapsed 2009-05-26 10:42:05 +0200 od r272283 : #i93269# correct fix: check success of <queryInterface> call 2009-05-04 15:52:04 +0200 od r271469 : #i92103# new vcl event ids VCLEVENT_LISTBOX_ENTRY_EXPANDED and VCLEVENT_LISTBOX_ENTRY_COLLAPSED 2009-05-04 15:10:20 +0200 od r271460 : #i92103# refine definition of new constants 2009-05-04 14:36:44 +0200 od r271454 : #i92103# new constants for indicating that a list box entry is expanded respectively collapsed. 2009-04-30 16:09:40 +0200 od r271421 : #i93269# method <atk_wrapper_focus_idle_handler(..)> - emit text_caret_moved event for <XAccessibleText> object, if cursor is inside the <XAccessibleText> object. 2009-04-22 14:00:10 +0200 tl r271105 : warning-free code 2009-04-22 09:17:30 +0200 tl r271073 : CWS-TOOLING: rebase CWS swa11y32 to trunk@270723 (milestone: DEV300:m46) 2009-04-20 12:53:03 +0200 cd r270974 : #i83639# Check extendedhelp state to provide correct tool tip text 2009-04-03 13:07:13 +0200 tl r270471 : #i63983# changed accessible object names to empty strings 2009-04-01 15:52:09 +0200 tl r270336 : #i90991# accessible names and description for paragraphs should be empty 2009-04-01 15:12:42 +0200 tl r270333 : #i90991# accessible names and description for paragraphs should be empty 2009-04-01 15:10:34 +0200 tl r270331 : warning-free code 2009-04-01 12:54:44 +0200 tl r270319 : #i89176# Implementation of XAccessibleMultiLineText in EditEngine 2009-04-01 12:52:56 +0200 tl r270318 : #i89176# Implementation of XAccessibleMultiLineText in EditEngine 2009-03-27 18:31:01 +0100 tbe r270166 : #i92143# text getRangeExtents reports incorrect 'x' values for spreadsheet cells 2009-03-13 13:43:54 +0100 tl r269476 : #i94322# ImpEditView::ShowCursor and nPara == USHRT_MAX problem fixed 2009-03-12 10:27:30 +0100 tl r269366 : warning-free code; unresolved external dbg_out when compiling with debug=t 2009-03-11 12:40:31 +0100 tl r269312 : warning-free code Solaris x86 2009-03-10 15:49:01 +0100 tl r269279 : #i86443# handle GetColumnCount() == 0 2009-03-10 10:48:32 +0100 cl r269254 : #i91742# name cells for accessibility 2009-03-09 17:06:33 +0100 cl r269203 : #i91742# call init on accessible cells
2009-08-26 13:37:34 +00:00
{
return rEditEngine.GetLineNumberAtIndex(nPara, nIndex);
}
bool SvxEditEngineForwarder::QuickFormatDoc( bool )
{
rEditEngine.QuickFormatDoc();
return true;
}
bool SvxEditEngineForwarder::Delete( const ESelection& rSelection )
{
rEditEngine.QuickDelete( rSelection );
rEditEngine.QuickFormatDoc();
return true;
}
bool SvxEditEngineForwarder::InsertText( const OUString& rStr, const ESelection& rSelection )
{
rEditEngine.QuickInsertText( rStr, rSelection );
rEditEngine.QuickFormatDoc();
return true;
}
sal_Int16 SvxEditEngineForwarder::GetDepth( sal_Int32 ) const
{
// EditEngine does not support outline depth
return -1;
}
bool SvxEditEngineForwarder::SetDepth( sal_Int32, sal_Int16 nNewDepth )
{
// EditEngine does not support outline depth
return nNewDepth == -1;
}
const SfxItemSet * SvxEditEngineForwarder::GetEmptyItemSetPtr()
{
return &rEditEngine.GetEmptyItemSet();
}
void SvxEditEngineForwarder::AppendParagraph()
{
rEditEngine.InsertParagraph( rEditEngine.GetParagraphCount(), OUString() );
}
sal_Int32 SvxEditEngineForwarder::AppendTextPortion( sal_Int32 nPara, const OUString &rText, const SfxItemSet & /*rSet*/ )
{
sal_Int32 nLen = 0;
sal_Int32 nParaCount = rEditEngine.GetParagraphCount();
DBG_ASSERT( nPara < nParaCount, "paragraph index out of bounds" );
if (0 <= nPara && nPara < nParaCount)
{
nLen = rEditEngine.GetTextLen( nPara );
rEditEngine.QuickInsertText( rText, ESelection( nPara, nLen, nPara, nLen ) );
}
return nLen;
}
void SvxEditEngineForwarder::CopyText(const SvxTextForwarder& rSource)
{
const SvxEditEngineForwarder* pSourceForwarder = dynamic_cast< const SvxEditEngineForwarder* >( &rSource );
if( !pSourceForwarder )
return;
EditTextObject* pNewTextObject = pSourceForwarder->rEditEngine.CreateTextObject();
rEditEngine.SetText( *pNewTextObject );
delete pNewTextObject;
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */