2010-10-12 15:53:47 +02:00
|
|
|
/* -*- 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
|
|
|
|
2006-09-17 05:17:50 +00:00
|
|
|
|
2002-09-13 13:31:58 +00:00
|
|
|
#include <algorithm>
|
2009-10-16 00:05:16 +02:00
|
|
|
#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
|
|
|
|
2009-10-16 00:05:16 +02:00
|
|
|
#include <svl/itemset.hxx>
|
2010-01-06 19:26:54 +01:00
|
|
|
#include <editeng/editeng.hxx>
|
|
|
|
#include <editeng/editdata.hxx>
|
|
|
|
#include <editeng/outliner.hxx>
|
|
|
|
#include <editeng/unoedhlp.hxx>
|
2009-10-16 00:05:16 +02:00
|
|
|
#include <svl/poolitem.hxx>
|
2000-09-18 16:07:07 +00:00
|
|
|
#include <vcl/wrkwin.hxx>
|
2010-01-06 19:26:54 +01:00
|
|
|
#include <editeng/eeitem.hxx>
|
2000-09-18 16:07:07 +00:00
|
|
|
|
2010-01-06 19:26:54 +01:00
|
|
|
#include <editeng/unoforou.hxx>
|
|
|
|
#include <editeng/unofored.hxx>
|
|
|
|
#include <editeng/outlobj.hxx>
|
2014-06-25 14:57:44 +02:00
|
|
|
#include <unofored_internal.hxx>
|
2000-09-18 16:07:07 +00:00
|
|
|
|
2002-02-11 11:33:11 +00:00
|
|
|
using namespace ::com::sun::star;
|
|
|
|
|
2014-02-22 21:20:15 +01:00
|
|
|
|
2000-09-18 16:07:07 +00:00
|
|
|
|
2014-03-03 08:56:11 +02:00
|
|
|
SvxOutlinerForwarder::SvxOutlinerForwarder( Outliner& rOutl, bool bOutlText /* = false */ ) :
|
2001-11-05 12:55:33 +00:00
|
|
|
rOutliner( rOutl ),
|
2009-12-10 18:09:38 +01:00
|
|
|
bOutlinerText( bOutlText ),
|
2002-02-28 11:25:39 +00:00
|
|
|
mpAttribsCache( NULL ),
|
|
|
|
mpParaAttribsCache( NULL ),
|
|
|
|
mnParaAttribsCache( 0 )
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
SvxOutlinerForwarder::~SvxOutlinerForwarder()
|
|
|
|
{
|
2001-11-05 12:55:33 +00:00
|
|
|
flushCache();
|
2000-09-18 16:07:07 +00:00
|
|
|
}
|
|
|
|
|
2013-05-08 18:12:32 +02:00
|
|
|
sal_Int32 SvxOutlinerForwarder::GetParagraphCount() const
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
2013-05-08 18:12:32 +02:00
|
|
|
return rOutliner.GetParagraphCount();
|
2000-09-18 16:07:07 +00:00
|
|
|
}
|
|
|
|
|
2014-02-02 22:16:48 -06:00
|
|
|
sal_Int32 SvxOutlinerForwarder::GetTextLen( sal_Int32 nParagraph ) const
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
|
|
|
return rOutliner.GetEditEngine().GetTextLen( nParagraph );
|
|
|
|
}
|
|
|
|
|
2013-09-03 18:29:30 +02:00
|
|
|
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
|
2014-06-29 13:10:56 +02:00
|
|
|
// in the time being use as the hack for the EditEngine:
|
2015-03-26 15:28:32 +01:00
|
|
|
EditEngine* pEditEngine = const_cast<EditEngine*>(&rOutliner.GetEditEngine());
|
2000-09-18 16:07:07 +00:00
|
|
|
return pEditEngine->GetText( rSel, LINEEND_LF );
|
|
|
|
}
|
|
|
|
|
2014-04-04 08:45:26 +02:00
|
|
|
static SfxItemSet ImplOutlinerForwarderGetAttribs( const ESelection& rSel, EditEngineAttribs nOnlyHardAttrib, EditEngine& rEditEngine )
|
2001-11-13 14:32:11 +00:00
|
|
|
{
|
|
|
|
if( rSel.nStartPara == rSel.nEndPara )
|
|
|
|
{
|
2015-03-26 16:03:06 +02:00
|
|
|
GetAttribsFlags nFlags = GetAttribsFlags::NONE;
|
2001-11-13 14:32:11 +00:00
|
|
|
|
2014-04-04 08:45:26 +02:00
|
|
|
switch( nOnlyHardAttrib )
|
2001-11-13 14:32:11 +00:00
|
|
|
{
|
|
|
|
case EditEngineAttribs_All:
|
2015-03-26 16:03:06 +02:00
|
|
|
nFlags = GetAttribsFlags::ALL;
|
2001-11-13 14:32:11 +00:00
|
|
|
break;
|
|
|
|
case EditEngineAttribs_HardAndPara:
|
2015-03-26 16:03:06 +02:00
|
|
|
nFlags = GetAttribsFlags::PARAATTRIBS|GetAttribsFlags::CHARATTRIBS;
|
2001-11-13 14:32:11 +00:00
|
|
|
break;
|
|
|
|
case EditEngineAttribs_OnlyHard:
|
2015-03-26 16:03:06 +02:00
|
|
|
nFlags = GetAttribsFlags::CHARATTRIBS;
|
2001-11-13 14:32:11 +00:00
|
|
|
break;
|
|
|
|
default:
|
2011-03-01 19:07:44 +01:00
|
|
|
OSL_FAIL("unknown flags for SvxOutlinerForwarder::GetAttribs");
|
2001-11-13 14:32:11 +00:00
|
|
|
}
|
|
|
|
return rEditEngine.GetAttribs( rSel.nStartPara, rSel.nStartPos, rSel.nEndPos, nFlags );
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2014-04-04 08:45:26 +02:00
|
|
|
return rEditEngine.GetAttribs( rSel, nOnlyHardAttrib );
|
2001-11-13 14:32:11 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2014-04-04 08:45:26 +02:00
|
|
|
SfxItemSet SvxOutlinerForwarder::GetAttribs( const ESelection& rSel, EditEngineAttribs nOnlyHardAttrib ) const
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
2014-04-04 08:45:26 +02:00
|
|
|
if( mpAttribsCache && ( EditEngineAttribs_All == nOnlyHardAttrib ) )
|
2001-11-05 12:55:33 +00:00
|
|
|
{
|
|
|
|
// have we the correct set in cache?
|
2015-03-26 15:28:32 +01:00
|
|
|
if( const_cast<SvxOutlinerForwarder*>(this)->maAttribCacheSelection.IsEqual(rSel) )
|
2001-11-05 12:55:33 +00:00
|
|
|
{
|
|
|
|
// 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();
|
|
|
|
|
2014-04-04 08:45:26 +02:00
|
|
|
SfxItemSet aSet( ImplOutlinerForwarderGetAttribs( rSel, nOnlyHardAttrib, rEditEngine ) );
|
2000-09-18 16:07:07 +00:00
|
|
|
|
2014-04-04 08:45:26 +02:00
|
|
|
if( EditEngineAttribs_All == nOnlyHardAttrib )
|
2001-11-05 12:55:33 +00:00
|
|
|
{
|
|
|
|
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
|
|
|
}
|
|
|
|
|
2013-05-08 18:12:32 +02:00
|
|
|
SfxItemSet SvxOutlinerForwarder::GetParaAttribs( sal_Int32 nPara ) const
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
2001-11-05 12:55:33 +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 )
|
2001-11-05 12:55:33 +00:00
|
|
|
mpParaAttribsCache->SetParent( &(pStyle->GetItemSet() ) );
|
2001-08-05 14:58:37 +00:00
|
|
|
|
2001-11-05 12:55:33 +00:00
|
|
|
return *mpParaAttribsCache;
|
2000-09-18 16:07:07 +00:00
|
|
|
}
|
|
|
|
|
2013-05-08 18:12:32 +02:00
|
|
|
void SvxOutlinerForwarder::SetParaAttribs( sal_Int32 nPara, const SfxItemSet& rSet )
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
2001-11-05 12:55:33 +00:00
|
|
|
flushCache();
|
|
|
|
|
2001-08-22 13:30:53 +00:00
|
|
|
const SfxItemSet* pOldParent = rSet.GetParent();
|
|
|
|
if( pOldParent )
|
2015-03-26 15:28:32 +01:00
|
|
|
const_cast<SfxItemSet*>(&rSet)->SetParent( NULL );
|
2001-08-22 13:30:53 +00:00
|
|
|
|
2008-06-06 11:37:39 +00:00
|
|
|
rOutliner.SetParaAttribs( nPara, rSet );
|
2001-08-22 13:30:53 +00:00
|
|
|
|
|
|
|
if( pOldParent )
|
2015-03-26 15:28:32 +01:00
|
|
|
const_cast<SfxItemSet*>(&rSet)->SetParent( pOldParent );
|
2000-09-18 16:07:07 +00:00
|
|
|
}
|
|
|
|
|
2014-02-28 09:47:38 +02:00
|
|
|
void SvxOutlinerForwarder::RemoveAttribs( const ESelection& rSelection, bool bRemoveParaAttribs, sal_uInt16 nWhich )
|
2008-07-01 11:53:10 +00:00
|
|
|
{
|
|
|
|
rOutliner.RemoveAttribs( rSelection, bRemoveParaAttribs, nWhich );
|
|
|
|
}
|
|
|
|
|
2000-09-18 16:07:07 +00:00
|
|
|
SfxItemPool* SvxOutlinerForwarder::GetPool() const
|
|
|
|
{
|
|
|
|
return rOutliner.GetEmptyItemSet().GetPool();
|
|
|
|
}
|
|
|
|
|
2014-02-02 22:16:48 -06:00
|
|
|
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 );
|
|
|
|
}
|
|
|
|
|
2013-09-03 18:29:30 +02:00
|
|
|
void SvxOutlinerForwarder::QuickInsertText( const OUString& rText, const ESelection& rSel )
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
2001-11-05 12:55:33 +00:00
|
|
|
flushCache();
|
2013-09-03 18:29:30 +02:00
|
|
|
if( rText.isEmpty() )
|
2001-02-01 18:00:06 +00:00
|
|
|
{
|
|
|
|
rOutliner.QuickDelete( rSel );
|
|
|
|
}
|
2000-09-18 16:07:07 +00:00
|
|
|
else
|
2001-08-08 10:08:14 +00:00
|
|
|
{
|
2000-09-18 16:07:07 +00:00
|
|
|
rOutliner.QuickInsertText( rText, rSel );
|
2001-08-08 10:08:14 +00:00
|
|
|
}
|
2000-09-18 16:07:07 +00:00
|
|
|
}
|
|
|
|
|
2001-01-23 10:54:34 +00:00
|
|
|
void SvxOutlinerForwarder::QuickInsertLineBreak( const ESelection& rSel )
|
|
|
|
{
|
2001-11-05 12:55:33 +00:00
|
|
|
flushCache();
|
2001-01-23 10:54:34 +00:00
|
|
|
rOutliner.QuickInsertLineBreak( rSel );
|
|
|
|
}
|
|
|
|
|
2000-09-18 16:07:07 +00:00
|
|
|
void SvxOutlinerForwarder::QuickInsertField( const SvxFieldItem& rFld, const ESelection& rSel )
|
|
|
|
{
|
2001-11-05 12:55:33 +00:00
|
|
|
flushCache();
|
2000-09-18 16:07:07 +00:00
|
|
|
rOutliner.QuickInsertField( rFld, rSel );
|
|
|
|
}
|
|
|
|
|
|
|
|
void SvxOutlinerForwarder::QuickSetAttribs( const SfxItemSet& rSet, const ESelection& rSel )
|
|
|
|
{
|
2001-11-05 12:55:33 +00:00
|
|
|
flushCache();
|
2000-09-18 16:07:07 +00:00
|
|
|
rOutliner.QuickSetAttribs( rSet, rSel );
|
|
|
|
}
|
|
|
|
|
2014-02-02 22:16:48 -06:00
|
|
|
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 );
|
|
|
|
}
|
|
|
|
|
2014-02-02 22:16:48 -06:00
|
|
|
void SvxOutlinerForwarder::FieldClicked( const SvxFieldItem& rField, sal_Int32 nPara, sal_Int32 nPos )
|
2010-02-25 16:58:44 +01:00
|
|
|
{
|
|
|
|
rOutliner.FieldClicked( rField, nPara, nPos );
|
|
|
|
}
|
|
|
|
|
2014-02-28 09:47:38 +02:00
|
|
|
bool SvxOutlinerForwarder::IsValid() const
|
2002-05-29 14:49:18 +00:00
|
|
|
{
|
|
|
|
// cannot reliably query outliner state
|
|
|
|
// while in the middle of an update
|
|
|
|
return rOutliner.GetUpdateMode();
|
|
|
|
}
|
|
|
|
|
2014-07-23 10:48:58 +02:00
|
|
|
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 );
|
|
|
|
}
|
|
|
|
|
2014-07-23 10:48:58 +02:00
|
|
|
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 );
|
|
|
|
}
|
|
|
|
|
2001-11-05 12:55:33 +00:00
|
|
|
|
|
|
|
void SvxOutlinerForwarder::flushCache()
|
|
|
|
{
|
|
|
|
if( mpAttribsCache )
|
|
|
|
{
|
|
|
|
delete mpAttribsCache;
|
|
|
|
mpAttribsCache = NULL;
|
|
|
|
}
|
|
|
|
|
|
|
|
if( mpParaAttribsCache )
|
|
|
|
{
|
|
|
|
delete mpParaAttribsCache;
|
|
|
|
mpParaAttribsCache = NULL;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2014-02-02 22:16:48 -06:00
|
|
|
LanguageType SvxOutlinerForwarder::GetLanguage( sal_Int32 nPara, sal_Int32 nIndex ) const
|
2002-02-11 11:33:11 +00:00
|
|
|
{
|
|
|
|
return rOutliner.GetLanguage(nPara, nIndex);
|
|
|
|
}
|
2000-09-18 16:07:07 +00:00
|
|
|
|
2014-02-02 22:16:48 -06:00
|
|
|
sal_Int32 SvxOutlinerForwarder::GetFieldCount( sal_Int32 nPara ) const
|
2002-04-11 09:14:17 +00:00
|
|
|
{
|
|
|
|
return rOutliner.GetEditEngine().GetFieldCount(nPara);
|
|
|
|
}
|
|
|
|
|
2013-05-08 18:12:32 +02:00
|
|
|
EFieldInfo SvxOutlinerForwarder::GetFieldInfo( sal_Int32 nPara, sal_uInt16 nField ) const
|
2002-04-11 09:14:17 +00:00
|
|
|
{
|
|
|
|
return rOutliner.GetEditEngine().GetFieldInfo( nPara, nField );
|
|
|
|
}
|
|
|
|
|
2013-05-08 18:12:32 +02:00
|
|
|
EBulletInfo SvxOutlinerForwarder::GetBulletInfo( sal_Int32 nPara ) const
|
2002-04-11 09:14:17 +00:00
|
|
|
{
|
|
|
|
return rOutliner.GetBulletInfo( nPara );
|
|
|
|
}
|
|
|
|
|
2014-02-02 22:16:48 -06:00
|
|
|
Rectangle SvxOutlinerForwarder::GetCharBounds( sal_Int32 nPara, sal_Int32 nIndex ) const
|
2002-02-15 08:00:04 +00:00
|
|
|
{
|
2002-09-13 13:13:10 +00:00
|
|
|
// EditEngine's 'internal' methods like GetCharacterBounds()
|
|
|
|
// don't rotate for vertical text.
|
|
|
|
Size aSize( rOutliner.CalcTextSize() );
|
|
|
|
::std::swap( aSize.Width(), aSize.Height() );
|
2014-01-22 11:29:27 +01:00
|
|
|
bool bIsVertical( rOutliner.IsVertical() );
|
2003-04-24 16:00:09 +00:00
|
|
|
|
|
|
|
// #108900# Handle virtual position one-past-the end of the string
|
|
|
|
if( nIndex >= GetTextLen(nPara) )
|
|
|
|
{
|
2003-06-24 06:40:24 +00:00
|
|
|
Rectangle aLast;
|
2003-04-24 16:00:09 +00:00
|
|
|
|
|
|
|
if( nIndex )
|
2003-06-24 06:40:24 +00:00
|
|
|
{
|
|
|
|
// use last character, if possible
|
2003-04-24 16:00:09 +00:00
|
|
|
aLast = rOutliner.GetEditEngine().GetCharacterBounds( EPosition(nPara, nIndex-1) );
|
|
|
|
|
2003-06-24 06:40:24 +00:00
|
|
|
// 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;
|
2003-04-24 16:00:09 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
return SvxEditSourceHelper::EEToUserSpace( rOutliner.GetEditEngine().GetCharacterBounds( EPosition(nPara, nIndex) ),
|
2003-06-24 06:40:24 +00:00
|
|
|
aSize, bIsVertical );
|
2003-04-24 16:00:09 +00:00
|
|
|
}
|
2002-02-15 08:00:04 +00:00
|
|
|
}
|
|
|
|
|
2013-05-08 18:12:32 +02:00
|
|
|
Rectangle SvxOutlinerForwarder::GetParaBounds( sal_Int32 nPara ) const
|
2002-02-11 11:33:11 +00:00
|
|
|
{
|
2002-02-28 11:25:39 +00:00
|
|
|
Point aPnt = rOutliner.GetDocPosTopLeft( nPara );
|
|
|
|
Size aSize = rOutliner.CalcTextSize();
|
|
|
|
|
2002-09-13 13:13:10 +00:00
|
|
|
if( rOutliner.IsVertical() )
|
|
|
|
{
|
|
|
|
// Hargl. Outliner's 'external' methods return the rotated
|
|
|
|
// dimensions, 'internal' methods like GetTextHeight( n )
|
|
|
|
// don't rotate.
|
2011-01-13 14:12:48 +01:00
|
|
|
sal_uLong nWidth = rOutliner.GetTextHeight( nPara );
|
2002-09-13 13:13:10 +00:00
|
|
|
|
|
|
|
return Rectangle( aSize.Width() - aPnt.Y() - nWidth, 0, aSize.Width() - aPnt.Y(), aSize.Height() );
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2011-01-13 14:12:48 +01:00
|
|
|
sal_uLong nHeight = rOutliner.GetTextHeight( nPara );
|
2002-09-13 13:13:10 +00:00
|
|
|
|
|
|
|
return Rectangle( 0, aPnt.Y(), aSize.Width(), aPnt.Y() + nHeight );
|
|
|
|
}
|
2002-02-11 11:33:11 +00:00
|
|
|
}
|
|
|
|
|
2002-03-07 14:45:46 +00:00
|
|
|
MapMode SvxOutlinerForwarder::GetMapMode() const
|
|
|
|
{
|
|
|
|
return rOutliner.GetRefMapMode();
|
|
|
|
}
|
|
|
|
|
2002-04-26 09:27:21 +00:00
|
|
|
OutputDevice* SvxOutlinerForwarder::GetRefDevice() const
|
|
|
|
{
|
|
|
|
return rOutliner.GetRefDevice();
|
|
|
|
}
|
|
|
|
|
2014-02-28 09:47:38 +02:00
|
|
|
bool SvxOutlinerForwarder::GetIndexAtPoint( const Point& rPos, sal_Int32& nPara, sal_Int32& nIndex ) const
|
2002-02-11 11:33:11 +00:00
|
|
|
{
|
2002-09-13 13:13:10 +00:00
|
|
|
Size aSize( rOutliner.CalcTextSize() );
|
|
|
|
::std::swap( aSize.Width(), aSize.Height() );
|
|
|
|
Point aEEPos( SvxEditSourceHelper::UserSpaceToEE( rPos,
|
|
|
|
aSize,
|
2014-01-22 11:29:27 +01:00
|
|
|
rOutliner.IsVertical() ));
|
2002-09-13 13:13:10 +00:00
|
|
|
|
|
|
|
EPosition aDocPos = rOutliner.GetEditEngine().FindDocPosition( aEEPos );
|
2002-03-04 17:32:38 +00:00
|
|
|
|
|
|
|
nPara = aDocPos.nPara;
|
|
|
|
nIndex = aDocPos.nIndex;
|
|
|
|
|
2014-02-28 09:47:38 +02:00
|
|
|
return true;
|
2002-02-11 11:33:11 +00:00
|
|
|
}
|
|
|
|
|
2014-02-28 09:47:38 +02:00
|
|
|
bool SvxOutlinerForwarder::GetWordIndices( sal_Int32 nPara, sal_Int32 nIndex, sal_Int32& nStart, sal_Int32& nEnd ) const
|
2002-02-11 11:33:11 +00:00
|
|
|
{
|
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;
|
|
|
|
|
2014-02-28 09:47:38 +02:00
|
|
|
return true;
|
2002-03-04 17:32:38 +00:00
|
|
|
}
|
|
|
|
|
2014-02-28 09:47:38 +02:00
|
|
|
return false;
|
2002-02-11 11:33:11 +00:00
|
|
|
}
|
|
|
|
|
2014-02-26 15:30:29 +02:00
|
|
|
bool SvxOutlinerForwarder::GetAttributeRun( sal_Int32& nStartIndex, sal_Int32& nEndIndex, sal_Int32 nPara, sal_Int32 nIndex, bool bInCell ) const
|
2002-08-02 10:35:10 +00:00
|
|
|
{
|
2013-11-26 14:25:22 +00:00
|
|
|
return SvxEditSourceHelper::GetAttributeRun( nStartIndex, nEndIndex, rOutliner.GetEditEngine(), nPara, nIndex, bInCell );
|
2002-08-02 10:35:10 +00:00
|
|
|
}
|
|
|
|
|
2014-02-02 22:16:48 -06:00
|
|
|
sal_Int32 SvxOutlinerForwarder::GetLineCount( sal_Int32 nPara ) const
|
2002-02-11 11:33:11 +00:00
|
|
|
{
|
2014-02-02 22:16:48 -06:00
|
|
|
return rOutliner.GetLineCount(nPara);
|
2002-02-11 11:33:11 +00:00
|
|
|
}
|
|
|
|
|
2014-02-02 22:16:48 -06:00
|
|
|
sal_Int32 SvxOutlinerForwarder::GetLineLen( sal_Int32 nPara, sal_Int32 nLine ) const
|
2002-02-11 11:33:11 +00:00
|
|
|
{
|
|
|
|
return rOutliner.GetLineLen(nPara, nLine);
|
|
|
|
}
|
|
|
|
|
2014-02-02 22:16:48 -06:00
|
|
|
void SvxOutlinerForwarder::GetLineBoundaries( /*out*/sal_Int32 &rStart, /*out*/sal_Int32 &rEnd, sal_Int32 nPara, sal_Int32 nLine ) const
|
2009-08-26 13:37:34 +00:00
|
|
|
{
|
|
|
|
return rOutliner.GetEditEngine().GetLineBoundaries( rStart, rEnd, nPara, nLine );
|
|
|
|
}
|
|
|
|
|
2014-02-02 22:16:48 -06:00
|
|
|
sal_Int32 SvxOutlinerForwarder::GetLineNumberAtIndex( sal_Int32 nPara, sal_Int32 nIndex ) const
|
2009-08-26 13:37:34 +00:00
|
|
|
{
|
|
|
|
return rOutliner.GetEditEngine().GetLineNumberAtIndex( nPara, nIndex );
|
|
|
|
}
|
|
|
|
|
2014-02-28 09:47:38 +02:00
|
|
|
bool SvxOutlinerForwarder::QuickFormatDoc( bool )
|
2002-04-26 09:27:21 +00:00
|
|
|
{
|
|
|
|
rOutliner.QuickFormatDoc();
|
|
|
|
|
2014-02-28 09:47:38 +02:00
|
|
|
return true;
|
2002-04-26 09:27:21 +00:00
|
|
|
}
|
|
|
|
|
2014-02-28 09:47:38 +02:00
|
|
|
bool SvxOutlinerForwarder::Delete( const ESelection& rSelection )
|
2002-02-11 11:33:11 +00:00
|
|
|
{
|
2002-04-26 09:27:21 +00:00
|
|
|
flushCache();
|
2002-02-11 11:33:11 +00:00
|
|
|
rOutliner.QuickDelete( rSelection );
|
|
|
|
rOutliner.QuickFormatDoc();
|
|
|
|
|
2014-02-28 09:47:38 +02:00
|
|
|
return true;
|
2002-02-11 11:33:11 +00:00
|
|
|
}
|
|
|
|
|
2014-02-28 09:47:38 +02:00
|
|
|
bool SvxOutlinerForwarder::InsertText( const OUString& rStr, const ESelection& rSelection )
|
2002-02-11 11:33:11 +00:00
|
|
|
{
|
2002-04-26 09:27:21 +00:00
|
|
|
flushCache();
|
2002-02-25 15:34:58 +00:00
|
|
|
rOutliner.QuickInsertText( rStr, rSelection );
|
2002-02-11 11:33:11 +00:00
|
|
|
rOutliner.QuickFormatDoc();
|
|
|
|
|
2014-02-28 09:47:38 +02:00
|
|
|
return true;
|
2002-02-11 11:33:11 +00:00
|
|
|
}
|
|
|
|
|
2013-05-08 18:12:32 +02:00
|
|
|
sal_Int16 SvxOutlinerForwarder::GetDepth( sal_Int32 nPara ) const
|
2002-07-26 10:35:10 +00:00
|
|
|
{
|
2013-05-08 18:12:32 +02:00
|
|
|
DBG_ASSERT( 0 <= nPara && nPara < GetParagraphCount(), "SvxOutlinerForwarder::GetDepth: Invalid paragraph index");
|
2002-07-26 10:35:10 +00:00
|
|
|
|
|
|
|
Paragraph* pPara = rOutliner.GetParagraph( nPara );
|
|
|
|
|
2008-06-06 11:37:39 +00:00
|
|
|
sal_Int16 nLevel = -1;
|
2002-07-26 10:35:10 +00:00
|
|
|
|
|
|
|
if( pPara )
|
|
|
|
nLevel = rOutliner.GetDepth( nPara );
|
|
|
|
|
|
|
|
return nLevel;
|
|
|
|
}
|
|
|
|
|
2014-02-28 09:47:38 +02:00
|
|
|
bool SvxOutlinerForwarder::SetDepth( sal_Int32 nPara, sal_Int16 nNewDepth )
|
2002-07-26 10:35:10 +00:00
|
|
|
{
|
2013-05-08 18:12:32 +02:00
|
|
|
DBG_ASSERT( 0 <= nPara && nPara < GetParagraphCount(), "SvxOutlinerForwarder::SetDepth: Invalid paragraph index");
|
2002-07-26 10:35:10 +00:00
|
|
|
|
2013-05-08 18:12:32 +02:00
|
|
|
if( (nNewDepth >= -1) && (nNewDepth <= 9) && (0 <= nPara && nPara < GetParagraphCount()) )
|
2002-07-26 10:35:10 +00:00
|
|
|
{
|
|
|
|
Paragraph* pPara = rOutliner.GetParagraph( nPara );
|
|
|
|
if( pPara )
|
|
|
|
{
|
|
|
|
rOutliner.SetDepth( pPara, nNewDepth );
|
2008-06-06 11:37:39 +00:00
|
|
|
|
2009-12-10 18:09:38 +01:00
|
|
|
// const bool bOutlinerText = pSdrObject && (pSdrObject->GetObjInventor() == SdrInventor) && (pSdrObject->GetObjIdentifier() == OBJ_OUTLINETEXT);
|
2002-07-26 10:35:10 +00:00
|
|
|
if( bOutlinerText )
|
|
|
|
rOutliner.SetLevelDependendStyleSheet( nPara );
|
|
|
|
|
2014-02-28 09:47:38 +02:00
|
|
|
return true;
|
2002-07-26 10:35:10 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2014-02-28 09:47:38 +02:00
|
|
|
return false;
|
2002-07-26 10:35:10 +00:00
|
|
|
}
|
|
|
|
|
2014-02-02 22:16:48 -06:00
|
|
|
sal_Int32 SvxOutlinerForwarder::GetNumberingStartValue( sal_Int32 nPara )
|
2008-06-06 11:37:39 +00:00
|
|
|
{
|
2013-05-08 18:12:32 +02:00
|
|
|
if( 0 <= nPara && nPara < GetParagraphCount() )
|
2008-06-06 11:37:39 +00:00
|
|
|
{
|
|
|
|
return rOutliner.GetNumberingStartValue( nPara );
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2011-03-01 19:07:44 +01:00
|
|
|
OSL_FAIL( "SvxOutlinerForwarder::GetNumberingStartValue)(), Invalid paragraph index");
|
2008-06-06 11:37:39 +00:00
|
|
|
return -1;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2014-02-02 22:16:48 -06:00
|
|
|
void SvxOutlinerForwarder::SetNumberingStartValue( sal_Int32 nPara, sal_Int32 nNumberingStartValue )
|
2008-06-06 11:37:39 +00:00
|
|
|
{
|
2013-05-08 18:12:32 +02:00
|
|
|
if( 0 <= nPara && nPara < GetParagraphCount() )
|
2008-06-06 11:37:39 +00:00
|
|
|
{
|
|
|
|
rOutliner.SetNumberingStartValue( nPara, nNumberingStartValue );
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2011-03-01 19:07:44 +01:00
|
|
|
OSL_FAIL( "SvxOutlinerForwarder::SetNumberingStartValue)(), Invalid paragraph index");
|
2008-06-06 11:37:39 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2014-03-03 08:56:11 +02:00
|
|
|
bool SvxOutlinerForwarder::IsParaIsNumberingRestart( sal_Int32 nPara )
|
2008-06-06 11:37:39 +00:00
|
|
|
{
|
2013-05-08 18:12:32 +02:00
|
|
|
if( 0 <= nPara && nPara < GetParagraphCount() )
|
2008-06-06 11:37:39 +00:00
|
|
|
{
|
|
|
|
return rOutliner.IsParaIsNumberingRestart( nPara );
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2011-03-01 19:07:44 +01:00
|
|
|
OSL_FAIL( "SvxOutlinerForwarder::IsParaIsNumberingRestart)(), Invalid paragraph index");
|
2014-03-03 08:56:11 +02:00
|
|
|
return false;
|
2008-06-06 11:37:39 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2014-03-03 08:56:11 +02:00
|
|
|
void SvxOutlinerForwarder::SetParaIsNumberingRestart( sal_Int32 nPara, bool bParaIsNumberingRestart )
|
2008-06-06 11:37:39 +00:00
|
|
|
{
|
2013-05-08 18:12:32 +02:00
|
|
|
if( 0 <= nPara && nPara < GetParagraphCount() )
|
2008-06-06 11:37:39 +00:00
|
|
|
{
|
|
|
|
rOutliner.SetParaIsNumberingRestart( nPara, bParaIsNumberingRestart );
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2011-03-01 19:07:44 +01:00
|
|
|
OSL_FAIL( "SvxOutlinerForwarder::SetParaIsNumberingRestart)(), Invalid paragraph index");
|
2008-06-06 11:37:39 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2007-07-18 12:07:31 +00:00
|
|
|
const SfxItemSet * SvxOutlinerForwarder::GetEmptyItemSetPtr()
|
|
|
|
{
|
|
|
|
EditEngine& rEditEngine = const_cast< EditEngine& >( rOutliner.GetEditEngine() );
|
|
|
|
return &rEditEngine.GetEmptyItemSet();
|
|
|
|
}
|
|
|
|
|
|
|
|
void SvxOutlinerForwarder::AppendParagraph()
|
|
|
|
{
|
|
|
|
EditEngine& rEditEngine = const_cast< EditEngine& >( rOutliner.GetEditEngine() );
|
2013-09-08 17:34:06 +01:00
|
|
|
rEditEngine.InsertParagraph( rEditEngine.GetParagraphCount(), OUString() );
|
2007-07-18 12:07:31 +00:00
|
|
|
}
|
|
|
|
|
2014-02-02 22:16:48 -06:00
|
|
|
sal_Int32 SvxOutlinerForwarder::AppendTextPortion( sal_Int32 nPara, const OUString &rText, const SfxItemSet & /*rSet*/ )
|
2007-07-18 12:07:31 +00:00
|
|
|
{
|
2014-02-02 22:16:48 -06:00
|
|
|
sal_Int32 nLen = 0;
|
2007-07-18 12:07:31 +00:00
|
|
|
|
|
|
|
EditEngine& rEditEngine = const_cast< EditEngine& >( rOutliner.GetEditEngine() );
|
2013-05-08 18:12:32 +02:00
|
|
|
sal_Int32 nParaCount = rEditEngine.GetParagraphCount();
|
|
|
|
DBG_ASSERT( 0 <= nPara && nPara < nParaCount, "paragraph index out of bounds" );
|
|
|
|
if (0 <= nPara && nPara < nParaCount)
|
2007-07-18 12:07:31 +00:00
|
|
|
{
|
|
|
|
nLen = rEditEngine.GetTextLen( nPara );
|
|
|
|
rEditEngine.QuickInsertText( rText, ESelection( nPara, nLen, nPara, nLen ) );
|
|
|
|
}
|
|
|
|
|
|
|
|
return nLen;
|
|
|
|
}
|
|
|
|
|
2008-07-01 11:53:10 +00:00
|
|
|
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;
|
|
|
|
}
|
|
|
|
|
2014-02-22 21:20:15 +01:00
|
|
|
|
2008-06-06 11:37:39 +00:00
|
|
|
|
|
|
|
|
2014-02-02 22:16:48 -06:00
|
|
|
sal_Int32 SvxTextForwarder::GetNumberingStartValue( sal_Int32 )
|
2008-06-06 11:37:39 +00:00
|
|
|
{
|
|
|
|
return -1;
|
|
|
|
}
|
|
|
|
|
2014-02-02 22:16:48 -06:00
|
|
|
void SvxTextForwarder::SetNumberingStartValue( sal_Int32, sal_Int32 )
|
2008-06-06 11:37:39 +00:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2014-03-03 08:56:11 +02:00
|
|
|
bool SvxTextForwarder::IsParaIsNumberingRestart( sal_Int32 )
|
2008-06-06 11:37:39 +00:00
|
|
|
{
|
2014-03-03 08:56:11 +02:00
|
|
|
return false;
|
2008-06-06 11:37:39 +00:00
|
|
|
}
|
|
|
|
|
2014-03-03 08:56:11 +02:00
|
|
|
void SvxTextForwarder::SetParaIsNumberingRestart( sal_Int32, bool )
|
2008-06-06 11:37:39 +00:00
|
|
|
{
|
|
|
|
}
|
2007-07-18 12:07:31 +00:00
|
|
|
|
2014-02-22 21:20:15 +01:00
|
|
|
|
2008-07-22 13:35:59 +00:00
|
|
|
|
2010-10-12 15:53:47 +02:00
|
|
|
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|