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

603 lines
18 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 <svl/style.hxx>
2002-03-04 17:32:38 +00:00
#include <com/sun/star/i18n/WordType.hpp>
2001-08-05 14:58:37 +00:00
#include <svl/itemset.hxx>
#include <editeng/editeng.hxx>
#include <editeng/editdata.hxx>
#include <editeng/outliner.hxx>
#include <editeng/unoedhlp.hxx>
#include <svl/poolitem.hxx>
2000-09-18 16:07:07 +00:00
#include <vcl/wrkwin.hxx>
#include <editeng/eeitem.hxx>
2000-09-18 16:07:07 +00:00
#include <editeng/unoforou.hxx>
#include <editeng/unofored.hxx>
#include <editeng/outlobj.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
SvxOutlinerForwarder::SvxOutlinerForwarder( Outliner& rOutl, bool bOutlText /* = false */ ) :
rOutliner( rOutl ),
bOutlinerText( bOutlText ),
mpAttribsCache( NULL ),
mpParaAttribsCache( NULL ),
mnParaAttribsCache( 0 )
2000-09-18 16:07:07 +00:00
{
}
SvxOutlinerForwarder::~SvxOutlinerForwarder()
{
flushCache();
2000-09-18 16:07:07 +00:00
}
sal_Int32 SvxOutlinerForwarder::GetParagraphCount() const
2000-09-18 16:07:07 +00:00
{
return rOutliner.GetParagraphCount();
2000-09-18 16:07:07 +00:00
}
sal_Int32 SvxOutlinerForwarder::GetTextLen( sal_Int32 nParagraph ) const
2000-09-18 16:07:07 +00:00
{
return rOutliner.GetEditEngine().GetTextLen( nParagraph );
}
OUString SvxOutlinerForwarder::GetText( const ESelection& rSel ) const
2000-09-18 16:07:07 +00:00
{
2011-02-16 16:34:02 -05:00
//! GetText (ESelection) should probably also be in the Outliner
// in the time being use as the hack for the EditEngine:
EditEngine* pEditEngine = const_cast<EditEngine*>(&rOutliner.GetEditEngine());
2000-09-18 16:07:07 +00:00
return pEditEngine->GetText( rSel, LINEEND_LF );
}
static SfxItemSet ImplOutlinerForwarderGetAttribs( const ESelection& rSel, EditEngineAttribs nOnlyHardAttrib, EditEngine& rEditEngine )
{
if( rSel.nStartPara == rSel.nEndPara )
{
GetAttribsFlags nFlags = GetAttribsFlags::NONE;
switch( nOnlyHardAttrib )
{
case EditEngineAttribs_All:
nFlags = GetAttribsFlags::ALL;
break;
case EditEngineAttribs_HardAndPara:
nFlags = GetAttribsFlags::PARAATTRIBS|GetAttribsFlags::CHARATTRIBS;
break;
case EditEngineAttribs_OnlyHard:
nFlags = GetAttribsFlags::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 );
}
}
SfxItemSet SvxOutlinerForwarder::GetAttribs( const ESelection& rSel, EditEngineAttribs nOnlyHardAttrib ) const
2000-09-18 16:07:07 +00:00
{
if( mpAttribsCache && ( EditEngineAttribs_All == nOnlyHardAttrib ) )
{
// have we the correct set in cache?
if( const_cast<SvxOutlinerForwarder*>(this)->maAttribCacheSelection.IsEqual(rSel) )
{
// yes! just return the cache
return *mpAttribsCache;
}
else
{
// no, we need delete the old cache
delete mpAttribsCache;
mpAttribsCache = NULL;
}
}
2011-02-16 16:34:02 -05:00
//! Does it not exist on the Outliner?
//! and why is the GetAttribs on the EditEngine not a const?
2001-08-05 14:58:37 +00:00
EditEngine& rEditEngine = (EditEngine&)rOutliner.GetEditEngine();
SfxItemSet aSet( ImplOutlinerForwarderGetAttribs( rSel, nOnlyHardAttrib, rEditEngine ) );
2000-09-18 16:07:07 +00:00
if( EditEngineAttribs_All == nOnlyHardAttrib )
{
mpAttribsCache = new SfxItemSet( aSet );
maAttribCacheSelection = rSel;
}
2001-08-05 14:58:37 +00:00
SfxStyleSheet* pStyle = rEditEngine.GetStyleSheet( rSel.nStartPara );
if( pStyle )
aSet.SetParent( &(pStyle->GetItemSet() ) );
return aSet;
2000-09-18 16:07:07 +00:00
}
SfxItemSet SvxOutlinerForwarder::GetParaAttribs( sal_Int32 nPara ) const
2000-09-18 16:07:07 +00:00
{
if( mpParaAttribsCache )
{
// have we the correct set in cache?
if( nPara == mnParaAttribsCache )
{
// yes! just return the cache
return *mpParaAttribsCache;
}
else
{
// no, we need delete the old cache
delete mpParaAttribsCache;
mpParaAttribsCache = NULL;
}
}
mpParaAttribsCache = new SfxItemSet( rOutliner.GetParaAttribs( nPara ) );
mnParaAttribsCache = nPara;
2000-09-18 16:07:07 +00:00
EditEngine& rEditEngine = (EditEngine&)rOutliner.GetEditEngine();
2001-08-05 14:58:37 +00:00
SfxStyleSheet* pStyle = rEditEngine.GetStyleSheet( nPara );
if( pStyle )
mpParaAttribsCache->SetParent( &(pStyle->GetItemSet() ) );
2001-08-05 14:58:37 +00:00
return *mpParaAttribsCache;
2000-09-18 16:07:07 +00:00
}
void SvxOutlinerForwarder::SetParaAttribs( sal_Int32 nPara, const SfxItemSet& rSet )
2000-09-18 16:07:07 +00:00
{
flushCache();
const SfxItemSet* pOldParent = rSet.GetParent();
if( pOldParent )
const_cast<SfxItemSet*>(&rSet)->SetParent( NULL );
rOutliner.SetParaAttribs( nPara, rSet );
if( pOldParent )
const_cast<SfxItemSet*>(&rSet)->SetParent( pOldParent );
2000-09-18 16:07:07 +00:00
}
void SvxOutlinerForwarder::RemoveAttribs( const ESelection& rSelection, bool bRemoveParaAttribs, sal_uInt16 nWhich )
{
rOutliner.RemoveAttribs( rSelection, bRemoveParaAttribs, nWhich );
}
2000-09-18 16:07:07 +00:00
SfxItemPool* SvxOutlinerForwarder::GetPool() const
{
return rOutliner.GetEmptyItemSet().GetPool();
}
void SvxOutlinerForwarder::GetPortions( sal_Int32 nPara, std::vector<sal_Int32>& rList ) const
2000-09-18 16:07:07 +00:00
{
((EditEngine&)rOutliner.GetEditEngine()).GetPortions( nPara, rList );
}
void SvxOutlinerForwarder::QuickInsertText( const OUString& rText, const ESelection& rSel )
2000-09-18 16:07:07 +00:00
{
flushCache();
if( rText.isEmpty() )
2001-02-01 18:00:06 +00:00
{
rOutliner.QuickDelete( rSel );
}
2000-09-18 16:07:07 +00:00
else
{
2000-09-18 16:07:07 +00:00
rOutliner.QuickInsertText( rText, rSel );
}
2000-09-18 16:07:07 +00:00
}
void SvxOutlinerForwarder::QuickInsertLineBreak( const ESelection& rSel )
{
flushCache();
rOutliner.QuickInsertLineBreak( rSel );
}
2000-09-18 16:07:07 +00:00
void SvxOutlinerForwarder::QuickInsertField( const SvxFieldItem& rFld, const ESelection& rSel )
{
flushCache();
2000-09-18 16:07:07 +00:00
rOutliner.QuickInsertField( rFld, rSel );
}
void SvxOutlinerForwarder::QuickSetAttribs( const SfxItemSet& rSet, const ESelection& rSel )
{
flushCache();
2000-09-18 16:07:07 +00:00
rOutliner.QuickSetAttribs( rSet, rSel );
}
OUString SvxOutlinerForwarder::CalcFieldValue( const SvxFieldItem& rField, sal_Int32 nPara, sal_Int32 nPos, Color*& rpTxtColor, Color*& rpFldColor )
2000-09-18 16:07:07 +00:00
{
return rOutliner.CalcFieldValue( rField, nPara, nPos, rpTxtColor, rpFldColor );
}
void SvxOutlinerForwarder::FieldClicked( const SvxFieldItem& rField, sal_Int32 nPara, sal_Int32 nPos )
{
rOutliner.FieldClicked( rField, nPara, nPos );
}
bool SvxOutlinerForwarder::IsValid() const
{
// cannot reliably query outliner state
// while in the middle of an update
return rOutliner.GetUpdateMode();
}
SfxItemState SvxOutlinerForwarder::GetItemState( const ESelection& rSel, sal_uInt16 nWhich ) const
2000-09-18 16:07:07 +00:00
{
return GetSvxEditEngineItemState( (EditEngine&)rOutliner.GetEditEngine(), rSel, nWhich );
}
SfxItemState SvxOutlinerForwarder::GetItemState( sal_Int32 nPara, sal_uInt16 nWhich ) const
2000-09-18 16:07:07 +00:00
{
const SfxItemSet& rSet = rOutliner.GetParaAttribs( nPara );
return rSet.GetItemState( nWhich );
}
void SvxOutlinerForwarder::flushCache()
{
if( mpAttribsCache )
{
delete mpAttribsCache;
mpAttribsCache = NULL;
}
if( mpParaAttribsCache )
{
delete mpParaAttribsCache;
mpParaAttribsCache = NULL;
}
}
LanguageType SvxOutlinerForwarder::GetLanguage( sal_Int32 nPara, sal_Int32 nIndex ) const
{
return rOutliner.GetLanguage(nPara, nIndex);
}
2000-09-18 16:07:07 +00:00
sal_Int32 SvxOutlinerForwarder::GetFieldCount( sal_Int32 nPara ) const
2002-04-11 09:14:17 +00:00
{
return rOutliner.GetEditEngine().GetFieldCount(nPara);
}
EFieldInfo SvxOutlinerForwarder::GetFieldInfo( sal_Int32 nPara, sal_uInt16 nField ) const
2002-04-11 09:14:17 +00:00
{
return rOutliner.GetEditEngine().GetFieldInfo( nPara, nField );
}
EBulletInfo SvxOutlinerForwarder::GetBulletInfo( sal_Int32 nPara ) const
2002-04-11 09:14:17 +00:00
{
return rOutliner.GetBulletInfo( nPara );
}
Rectangle SvxOutlinerForwarder::GetCharBounds( sal_Int32 nPara, sal_Int32 nIndex ) const
2002-02-15 08:00:04 +00:00
{
// EditEngine's 'internal' methods like GetCharacterBounds()
// don't rotate for vertical text.
Size aSize( rOutliner.CalcTextSize() );
::std::swap( aSize.Width(), aSize.Height() );
bool bIsVertical( rOutliner.IsVertical() );
// #108900# Handle virtual position one-past-the end of the string
if( nIndex >= GetTextLen(nPara) )
{
Rectangle aLast;
if( nIndex )
{
// use last character, if possible
aLast = rOutliner.GetEditEngine().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( rOutliner.GetLineHeight(nPara,0), 1 ) );
else
aLast.SetSize( Size( 1, rOutliner.GetLineHeight(nPara,0) ) );
}
return aLast;
}
else
{
return SvxEditSourceHelper::EEToUserSpace( rOutliner.GetEditEngine().GetCharacterBounds( EPosition(nPara, nIndex) ),
aSize, bIsVertical );
}
2002-02-15 08:00:04 +00:00
}
Rectangle SvxOutlinerForwarder::GetParaBounds( sal_Int32 nPara ) const
{
Point aPnt = rOutliner.GetDocPosTopLeft( nPara );
Size aSize = rOutliner.CalcTextSize();
if( rOutliner.IsVertical() )
{
// Hargl. Outliner's 'external' methods return the rotated
// dimensions, 'internal' methods like GetTextHeight( n )
// don't rotate.
sal_uLong nWidth = rOutliner.GetTextHeight( nPara );
return Rectangle( aSize.Width() - aPnt.Y() - nWidth, 0, aSize.Width() - aPnt.Y(), aSize.Height() );
}
else
{
sal_uLong nHeight = rOutliner.GetTextHeight( nPara );
return Rectangle( 0, aPnt.Y(), aSize.Width(), aPnt.Y() + nHeight );
}
}
MapMode SvxOutlinerForwarder::GetMapMode() const
{
return rOutliner.GetRefMapMode();
}
OutputDevice* SvxOutlinerForwarder::GetRefDevice() const
{
return rOutliner.GetRefDevice();
}
bool SvxOutlinerForwarder::GetIndexAtPoint( const Point& rPos, sal_Int32& nPara, sal_Int32& nIndex ) const
{
Size aSize( rOutliner.CalcTextSize() );
::std::swap( aSize.Width(), aSize.Height() );
Point aEEPos( SvxEditSourceHelper::UserSpaceToEE( rPos,
aSize,
rOutliner.IsVertical() ));
EPosition aDocPos = rOutliner.GetEditEngine().FindDocPosition( aEEPos );
2002-03-04 17:32:38 +00:00
nPara = aDocPos.nPara;
nIndex = aDocPos.nIndex;
return true;
}
bool SvxOutlinerForwarder::GetWordIndices( sal_Int32 nPara, sal_Int32 nIndex, sal_Int32& nStart, sal_Int32& nEnd ) const
{
2002-03-04 17:32:38 +00:00
ESelection aRes = rOutliner.GetEditEngine().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 SvxOutlinerForwarder::GetAttributeRun( sal_Int32& nStartIndex, sal_Int32& nEndIndex, sal_Int32 nPara, sal_Int32 nIndex, bool bInCell ) const
{
return SvxEditSourceHelper::GetAttributeRun( nStartIndex, nEndIndex, rOutliner.GetEditEngine(), nPara, nIndex, bInCell );
}
sal_Int32 SvxOutlinerForwarder::GetLineCount( sal_Int32 nPara ) const
{
return rOutliner.GetLineCount(nPara);
}
sal_Int32 SvxOutlinerForwarder::GetLineLen( sal_Int32 nPara, sal_Int32 nLine ) const
{
return rOutliner.GetLineLen(nPara, nLine);
}
void SvxOutlinerForwarder::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
{
return rOutliner.GetEditEngine().GetLineBoundaries( rStart, rEnd, nPara, nLine );
}
sal_Int32 SvxOutlinerForwarder::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 rOutliner.GetEditEngine().GetLineNumberAtIndex( nPara, nIndex );
}
bool SvxOutlinerForwarder::QuickFormatDoc( bool )
{
rOutliner.QuickFormatDoc();
return true;
}
bool SvxOutlinerForwarder::Delete( const ESelection& rSelection )
{
flushCache();
rOutliner.QuickDelete( rSelection );
rOutliner.QuickFormatDoc();
return true;
}
bool SvxOutlinerForwarder::InsertText( const OUString& rStr, const ESelection& rSelection )
{
flushCache();
rOutliner.QuickInsertText( rStr, rSelection );
rOutliner.QuickFormatDoc();
return true;
}
sal_Int16 SvxOutlinerForwarder::GetDepth( sal_Int32 nPara ) const
{
DBG_ASSERT( 0 <= nPara && nPara < GetParagraphCount(), "SvxOutlinerForwarder::GetDepth: Invalid paragraph index");
Paragraph* pPara = rOutliner.GetParagraph( nPara );
sal_Int16 nLevel = -1;
if( pPara )
nLevel = rOutliner.GetDepth( nPara );
return nLevel;
}
bool SvxOutlinerForwarder::SetDepth( sal_Int32 nPara, sal_Int16 nNewDepth )
{
DBG_ASSERT( 0 <= nPara && nPara < GetParagraphCount(), "SvxOutlinerForwarder::SetDepth: Invalid paragraph index");
if( (nNewDepth >= -1) && (nNewDepth <= 9) && (0 <= nPara && nPara < GetParagraphCount()) )
{
Paragraph* pPara = rOutliner.GetParagraph( nPara );
if( pPara )
{
rOutliner.SetDepth( pPara, nNewDepth );
// const bool bOutlinerText = pSdrObject && (pSdrObject->GetObjInventor() == SdrInventor) && (pSdrObject->GetObjIdentifier() == OBJ_OUTLINETEXT);
if( bOutlinerText )
rOutliner.SetLevelDependendStyleSheet( nPara );
return true;
}
}
return false;
}
sal_Int32 SvxOutlinerForwarder::GetNumberingStartValue( sal_Int32 nPara )
{
if( 0 <= nPara && nPara < GetParagraphCount() )
{
return rOutliner.GetNumberingStartValue( nPara );
}
else
{
2011-03-01 19:07:44 +01:00
OSL_FAIL( "SvxOutlinerForwarder::GetNumberingStartValue)(), Invalid paragraph index");
return -1;
}
}
void SvxOutlinerForwarder::SetNumberingStartValue( sal_Int32 nPara, sal_Int32 nNumberingStartValue )
{
if( 0 <= nPara && nPara < GetParagraphCount() )
{
rOutliner.SetNumberingStartValue( nPara, nNumberingStartValue );
}
else
{
2011-03-01 19:07:44 +01:00
OSL_FAIL( "SvxOutlinerForwarder::SetNumberingStartValue)(), Invalid paragraph index");
}
}
bool SvxOutlinerForwarder::IsParaIsNumberingRestart( sal_Int32 nPara )
{
if( 0 <= nPara && nPara < GetParagraphCount() )
{
return rOutliner.IsParaIsNumberingRestart( nPara );
}
else
{
2011-03-01 19:07:44 +01:00
OSL_FAIL( "SvxOutlinerForwarder::IsParaIsNumberingRestart)(), Invalid paragraph index");
return false;
}
}
void SvxOutlinerForwarder::SetParaIsNumberingRestart( sal_Int32 nPara, bool bParaIsNumberingRestart )
{
if( 0 <= nPara && nPara < GetParagraphCount() )
{
rOutliner.SetParaIsNumberingRestart( nPara, bParaIsNumberingRestart );
}
else
{
2011-03-01 19:07:44 +01:00
OSL_FAIL( "SvxOutlinerForwarder::SetParaIsNumberingRestart)(), Invalid paragraph index");
}
}
const SfxItemSet * SvxOutlinerForwarder::GetEmptyItemSetPtr()
{
EditEngine& rEditEngine = const_cast< EditEngine& >( rOutliner.GetEditEngine() );
return &rEditEngine.GetEmptyItemSet();
}
void SvxOutlinerForwarder::AppendParagraph()
{
EditEngine& rEditEngine = const_cast< EditEngine& >( rOutliner.GetEditEngine() );
rEditEngine.InsertParagraph( rEditEngine.GetParagraphCount(), OUString() );
}
sal_Int32 SvxOutlinerForwarder::AppendTextPortion( sal_Int32 nPara, const OUString &rText, const SfxItemSet & /*rSet*/ )
{
sal_Int32 nLen = 0;
EditEngine& rEditEngine = const_cast< EditEngine& >( rOutliner.GetEditEngine() );
sal_Int32 nParaCount = rEditEngine.GetParagraphCount();
DBG_ASSERT( 0 <= nPara && 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 SvxOutlinerForwarder::CopyText(const SvxTextForwarder& rSource)
{
const SvxOutlinerForwarder* pSourceForwarder = dynamic_cast< const SvxOutlinerForwarder* >( &rSource );
if( !pSourceForwarder )
return;
OutlinerParaObject* pNewOutlinerParaObject = pSourceForwarder->rOutliner.CreateParaObject();
rOutliner.SetText( *pNewOutlinerParaObject );
delete pNewOutlinerParaObject;
}
sal_Int32 SvxTextForwarder::GetNumberingStartValue( sal_Int32 )
{
return -1;
}
void SvxTextForwarder::SetNumberingStartValue( sal_Int32, sal_Int32 )
{
}
bool SvxTextForwarder::IsParaIsNumberingRestart( sal_Int32 )
{
return false;
}
void SvxTextForwarder::SetParaIsNumberingRestart( sal_Int32, bool )
{
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */