2010-10-14 08:30:41 +02:00
|
|
|
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
|
2000-09-18 23:08:29 +00:00
|
|
|
/*************************************************************************
|
|
|
|
*
|
2008-04-10 14:22:21 +00:00
|
|
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
2000-09-18 23:08:29 +00:00
|
|
|
*
|
2010-02-12 15:01:35 +01:00
|
|
|
* Copyright 2000, 2010 Oracle and/or its affiliates.
|
2000-09-18 23:08:29 +00:00
|
|
|
*
|
2008-04-10 14:22:21 +00:00
|
|
|
* OpenOffice.org - a multi-platform office productivity suite
|
2000-09-18 23:08:29 +00:00
|
|
|
*
|
2008-04-10 14:22:21 +00:00
|
|
|
* This file is part of OpenOffice.org.
|
2000-09-18 23:08:29 +00:00
|
|
|
*
|
2008-04-10 14:22:21 +00:00
|
|
|
* OpenOffice.org is free software: you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU Lesser General Public License version 3
|
|
|
|
* only, as published by the Free Software Foundation.
|
2000-09-18 23:08:29 +00:00
|
|
|
*
|
2008-04-10 14:22:21 +00:00
|
|
|
* OpenOffice.org is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU Lesser General Public License version 3 for more details
|
|
|
|
* (a copy is included in the LICENSE file that accompanied this code).
|
2000-09-18 23:08:29 +00:00
|
|
|
*
|
2008-04-10 14:22:21 +00:00
|
|
|
* You should have received a copy of the GNU Lesser General Public License
|
|
|
|
* version 3 along with OpenOffice.org. If not, see
|
|
|
|
* <http://www.openoffice.org/license.html>
|
|
|
|
* for a copy of the LGPLv3 License.
|
2000-09-18 23:08:29 +00:00
|
|
|
*
|
|
|
|
************************************************************************/
|
2006-09-16 20:35:57 +00:00
|
|
|
|
|
|
|
// MARKER(update_precomp.py): autogen include statement, do not remove
|
|
|
|
#include "precompiled_sw.hxx"
|
2000-09-18 23:08:29 +00:00
|
|
|
|
2002-02-08 12:42:08 +00:00
|
|
|
#include "hintids.hxx"
|
|
|
|
|
2000-11-20 15:27:07 +00:00
|
|
|
#include <com/sun/star/i18n/ScriptType.hdl>
|
2010-01-08 18:32:51 +01:00
|
|
|
#include <editeng/lspcitem.hxx>
|
2002-08-07 10:21:57 +00:00
|
|
|
#include <txtftn.hxx>
|
|
|
|
#include <fmtftn.hxx>
|
|
|
|
#include <ftninfo.hxx>
|
|
|
|
#include <charfmt.hxx>
|
2010-01-08 18:32:51 +01:00
|
|
|
#include <editeng/charrotateitem.hxx>
|
2000-09-18 23:08:29 +00:00
|
|
|
#include <layfrm.hxx> // GetFrmRstHeight, etc
|
|
|
|
#include <viewsh.hxx>
|
|
|
|
#include <viewopt.hxx> // SwViewOptions
|
|
|
|
#include <paratr.hxx> // SwFmtDrop
|
|
|
|
#include <itrform2.hxx>
|
|
|
|
#include <porrst.hxx>
|
|
|
|
#include <portab.hxx> // pLastTab->
|
|
|
|
#include <porfly.hxx> // CalcFlyWidth
|
|
|
|
#include <portox.hxx> // WhichTxtPortion
|
|
|
|
#include <porref.hxx> // WhichTxtPortion
|
|
|
|
#include <porfld.hxx> // SwNumberPortion fuer CalcAscent()
|
|
|
|
#include <porftn.hxx> // SwFtnPortion
|
|
|
|
#include <porhyph.hxx>
|
2001-05-28 15:20:44 +00:00
|
|
|
#include <guess.hxx>
|
2000-09-18 23:08:29 +00:00
|
|
|
#include <blink.hxx> // pBlink
|
|
|
|
#include <ftnfrm.hxx> // WhichFirstPortion() -> mal Verlagern.
|
|
|
|
#include <redlnitr.hxx> // SwRedlineItr
|
2002-02-05 15:50:43 +00:00
|
|
|
#include <pagefrm.hxx>
|
|
|
|
#include <pagedesc.hxx> // SwPageDesc
|
|
|
|
#include <tgrditem.hxx>
|
2000-09-29 12:55:44 +00:00
|
|
|
#include <doc.hxx> // SwDoc
|
2000-10-16 12:11:59 +00:00
|
|
|
#include <pormulti.hxx> // SwMultiPortion
|
2001-07-24 06:56:43 +00:00
|
|
|
#include <unotools/charclass.hxx>
|
2000-09-18 23:08:29 +00:00
|
|
|
|
2011-02-24 17:34:08 +00:00
|
|
|
#include <vector>
|
|
|
|
|
2003-04-15 15:54:23 +00:00
|
|
|
#if OSL_DEBUG_LEVEL > 1
|
2000-09-18 23:08:29 +00:00
|
|
|
#include <ndtxt.hxx> // pSwpHints, Ausgabeoperator
|
|
|
|
#endif
|
|
|
|
|
2008-02-19 12:51:52 +00:00
|
|
|
using namespace ::com::sun::star;
|
2002-01-16 08:50:11 +00:00
|
|
|
|
2001-10-02 12:51:59 +00:00
|
|
|
extern sal_Bool IsUnderlineBreak( const SwLinePortion& rPor, const SwFont& rFnt );
|
2011-02-24 17:34:08 +00:00
|
|
|
|
|
|
|
namespace {
|
|
|
|
//! Calculates and sets optimal repaint offset for the current line
|
|
|
|
static long lcl_CalcOptRepaint( SwTxtFormatter &rThis,
|
|
|
|
SwLineLayout &rCurr,
|
|
|
|
const xub_StrLen nOldLineEnd,
|
|
|
|
const std::vector<long> &rFlyStarts );
|
|
|
|
//! Determine if we need to build hidden portions
|
|
|
|
static bool lcl_BuildHiddenPortion( const SwTxtSizeInfo& rInf, xub_StrLen &rPos );
|
|
|
|
}
|
2000-09-18 23:08:29 +00:00
|
|
|
|
|
|
|
#define MAX_TXTPORLEN 300
|
|
|
|
|
|
|
|
inline void ClearFly( SwTxtFormatInfo &rInf )
|
|
|
|
{
|
|
|
|
if( rInf.GetFly() )
|
|
|
|
{
|
|
|
|
delete rInf.GetFly();
|
|
|
|
rInf.SetFly(0);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/*************************************************************************
|
2007-09-27 08:14:21 +00:00
|
|
|
* SwTxtFormatter::CtorInitTxtFormatter()
|
2000-09-18 23:08:29 +00:00
|
|
|
*************************************************************************/
|
|
|
|
|
2007-09-27 08:14:21 +00:00
|
|
|
void SwTxtFormatter::CtorInitTxtFormatter( SwTxtFrm *pNewFrm, SwTxtFormatInfo *pNewInf )
|
2000-09-18 23:08:29 +00:00
|
|
|
{
|
2007-09-27 08:14:21 +00:00
|
|
|
CtorInitTxtPainter( pNewFrm, pNewInf );
|
2000-09-18 23:08:29 +00:00
|
|
|
pInf = pNewInf;
|
|
|
|
pDropFmt = GetInfo().GetDropFmt();
|
2000-10-16 12:11:59 +00:00
|
|
|
pMulti = NULL;
|
2000-09-18 23:08:29 +00:00
|
|
|
|
|
|
|
bOnceMore = sal_False;
|
2009-10-30 17:42:00 +01:00
|
|
|
bFlyInCntBase = sal_False;
|
2000-09-18 23:08:29 +00:00
|
|
|
bChanges = sal_False;
|
|
|
|
bTruncLines = sal_False;
|
|
|
|
nCntEndHyph = 0;
|
|
|
|
nCntMidHyph = 0;
|
2001-02-15 12:30:24 +00:00
|
|
|
nLeftScanIdx = STRING_LEN;
|
|
|
|
nRightScanIdx = 0;
|
CWS-TOOLING: integrate CWS odfmetadata3
2009-09-11 Michael Stahl merge DEV300_m58
2009-09-07 Michael Stahl SwFmtFld::Modify(): do nothing on RES_OBJECTDYING
2009-08-27 Michael Stahl #i91565#, #i91566#: TextPortionEnumerationTest.java: add test document
2009-08-27 Michael Stahl #i91565#, #i91566#: add complex test: TextPortionEnumerationTest.java
2009-08-27 Michael Stahl CLiteral::initialize(): zero-length literals probably not an error
2009-08-27 Michael Stahl #i91565#, #i91566#: offapi: new InContentMetadata and MetadataField services
adapt TextPortion for InContentMetadata
2009-08-27 Michael Stahl #i91564#: xmloff: load/store xml:id and RDFa for text:bookmark(-start).
2009-08-27 Michael Stahl #i91564#: sw core: add support for xml:id at bookmarks:
sw::mark::Bookmark: derive from Metadatable.
SwHistoryBookmark, SaveBookmark: store a MetadatableUndo.
ndcopy.cxx: lcl_CopyBookmarks(): copy the xml:id.
SwXBookmark: derive from MetadatableMixin.
2009-08-27 Michael Stahl #i91565#, #i91566#: xmloff: refactor ruby import so nested meta(-field) works:
remove XMLRubyHint_Impl.
XMLImpRubyContext_Impl::~XMLImpRubyContext_Impl(): insert ruby directly.
2009-08-27 Michael Stahl #i91565#, #i91566#: xmloff: fix text:meta(-field) import/export:
new XMLTextParagraphExport::exportTextField() overload for XTextField.
CreateAndInsertMark(): set xml:id after insertion.
fix meta(-field) service names, bugs etc.
2009-08-27 Michael Stahl #i91565#, #i91566#: sw text formatting: paint background of meta(-field) body:
SwFont: add member m_nMetaCount.
txttypes.hxx: add POR_META.
atrstck.cxx: handle RES_TXTATR_META(FIELD).
itrform2.cxx: SwTxtFormatter::WhichTxtPor(): create new class SwMetaPortion.
2009-08-27 Michael Stahl #i91566#: sw text formatting: display meta-field prefix and suffix:
SwAttrIter::GetAttr(): replace with call to GetTxtAttrForCharAt().
SwTxtFormatter::NewExtraPortion(): handle meta-field prefix.
SwTxtFormatter: new member m_nHintEndIndex.
SwTxtFormatter::WhichFirstPortion(): call TryNewNoLengthPortion().
SwTxtFormatter::TryNewNoLengthPortion(): new; handle suffix of meta-field.
SwTxtFormatter::UnderFlow(): UGLY HACK: decrement m_nHintEndIndex.
SwFldPortion: add flag m_bNoLength: portion has zero length (for suffix).
2009-08-27 Michael Stahl #i91565#, #i91566#: extend text:meta(-field) uno wrapper with XText interface:
unoobj.hxx: new CursorType CURSOR_META.
unoobj2.cxx: refactor SwXText implementation to ensure that when the SwXText
belongs to a SwXMeta, content is always inserted inside the meta(-field).
unoobj.cxx: new SwXTextCursor::ForceIntoMeta(): cursor stays in meta(-field).
unometa.hxx: SwXMeta implements XText, forwarding to a member SwXMetaText.
DocInsertStringSplitCR(), SwX*::attachToRange(), SwX*::DeleteAndInsert():
use FORCEHINTEXPAND hack to ensure insert into the meta(-field) at the end.
2009-08-27 Michael Stahl #i91565#, #i91566#: add text:meta(-field) uno wrapper to sw:
fmtmeta.hxx, fmtatr2.cxx: new class sw::MetaField, new sw::MetaFieldManager.
doc.hxx, docnew.cxx: new SwDoc::GetMetaFieldManager().
unocoll.hxx,.cxx: new SW_SERVICE_FIELDTYPE_METAFIELD, SW_SERVICE_TYPE_META.
unomap.hxx,.cxx: new PROPERTY_MAP_METAFIELD.
unoprnms.hxx: new UNO_NAME_META.
unoport.hxx: new PORTION_META; add "InContentMetadata" prop to SwXTextPortion.
new unometa.hxx: new class SwXMeta and SwXMetaField.
unofield.cxx: SwXFieldEnumeration: include meta-fields.
unoportenum.cxx: handle RES_TXTATR_META(FIELD) by using a portion list stack.
unotext.cxx: SwXText::insertTextContent(): handle meta(-field) as attribute.
2009-08-27 Michael Stahl #i91565#, #i91566#: ndhints.cxx: remove sort number from SwTxtAttrNesting
2009-08-27 Michael Stahl #i91565#, #i91566#: add support for hints with end and CH_TXTATR to sw core:
doc.hxx, docedt.cxx: replace SwDoc::Delete(), DeleteAndJoin(), ReplaceRange()
with wrappers that split at left-overlapped end+CH_TXTATR hints.
txatbase.hxx: new member SwTxtAttr::m_bHasDummyChar.
ndtxt.hxx: rename SwTxtNode::GetTxtAttr() to GetTxtAttrForCharAt().
ndtxt.cxx: SwTxtNode::CopyText(): copy end+CH_TXTATR hints iff copy CH_TXTATR.
txtatr2.cxx, thints.cxx: SwTxtMeta gets a CH_TXTATR.
2009-08-27 Michael Stahl #i91565#, #i91566#: add text:meta(-field) to sw core:
txatbase.hxx: new member SwTxtAttr::m_bNesting.
hintids.hxx: new ids RES_TXTATR_META, RES_TXTATR_METAFIELD.
txtatr.hxx: new base class SwTxtAttrNesting.
new hint SwTxtMeta.
SwTxtRuby derives from SwTxtAttrNesting.
txtinet.hxx: SwTxtINetFmt derives from SwTxtAttrNesting.
new header fmtmeta.hxx: new pool item SwFmtMeta. new class sw::Meta.
ndhints.hxx, thints.cxx: new method SwpHints::TryInsertNesting().
thints.cxx: refactoring: BuildPortions() no longer handles Ruby/Hyperlink,
but TryInsertNesting(), which also handles meta(-field).
SwTxtNode::InsertItem(): check if the hint is actually inserted.
ndhints.cxx: sort nesting hints based on sort number.
ndtxt.cxx: lcl_CopyHint(): handle copy of meta/meta-field.
2009-08-27 Michael Stahl enable expanding hints with m_bLockExpandFlag set:
add new InsertFlag: INS_FORCEHINTEXPAND.
add new SetAttrMode: SETATTR_FORCEHINTEXPAND.
rename SwEditShell::Insert() to Insert2() because changed signature fails
to compile when SwWrtShell tries to overwrite these non-virtual members...
SwWrtShell::Insert() sets FOCEHINTEXPAND if range was selected/deleted.
adapt SwUndoInsert to store flags.
2009-08-27 Michael Stahl change formal parameters of item insertion methods to type SetAttrMode
2009-08-27 Michael Stahl fix incorrect resetting of text attributes in SwUndoInsSection, SwUndoInserts
2009-08-27 Michael Stahl clean up SwTxtNode::CutImpl() and lcl_CopyHint()
2009-08-27 Michael Stahl rename SwDoc::Copy() to CopyRange(), and _Copy() to CopyImpl()
2009-08-27 Michael Stahl rename SwNodes::Move() to MoveRange(), and remove unused parameter
2009-08-27 Michael Stahl rename SwDoc::Move() to MoveRange()/MoveNodeRange()
2009-08-27 Michael Stahl rename SwDoc::Insert() to InsertString(), and remove sal_Unicode variant
2009-08-27 Michael Stahl rename SwDoc::Insert() to InsertPoolItem()/InsertItemSet()/InsertSwSection()
2009-08-27 Michael Stahl rename SwDoc::Replace() to ReplaceRange()
2009-08-27 Michael Stahl remove SwDoc::Overwrite() sal_Unicode variant
2009-08-27 Michael Stahl split up SwDoc::DeleteAndJoin(): factor out DeleteAndJoinWithRedline()
2009-08-27 Michael Stahl rename overloaded SwDoc::Delete() to DeleteRange()/DeleteTOXMark()
2009-08-27 Michael Stahl rename SwTxtNode::Copy() to CopyText()
2009-08-27 Michael Stahl rename SwTxtNode::Cut() to CutText(), and _Cut() to CutImpl()
2009-08-27 Michael Stahl rename SwTxtNode::Delete() to DeleteAttribute()/DeleteAttributes()
2009-08-27 Michael Stahl rename SwTxtNode::Replace() to ReplaceText(), and remove the xub_Unicode variant
2009-08-27 Michael Stahl rename SwTxtNode::Erase() to EraseText()
2009-08-27 Michael Stahl rename SwTxtNode::Insert() to InsertText(), and remove the xub_Unicode variant
2009-08-27 Michael Stahl clean up SwTxtNode::Update()
2009-08-27 Michael Stahl remove SwTxtAttr::RemoveFromPool() and make destructor non-public,
to be invoked by new method SwTxtAttr::Destroy()
2009-08-27 Michael Stahl ensure that SwDoc::Insert() for item (set) returns success indicator:
replace SwRegHistory constructor with method InsertItems(), returning bool.
refactor InsAttr() so that it checks if InsertItems() succeeds.
2009-08-27 Michael Stahl move SwXTextPortionEnumeration from unoobj.hxx to unoport.hxx
2009-08-27 Michael Stahl add missing SolarMutex in SwXTextPortion methods
2009-08-27 Michael Stahl SwXTextPortion: new member m_xTextField (so the TextField property need not
be returned indirectly via SwUnoCursorHelper).
factor out function CreateSwXTextField().
2009-08-27 Michael Stahl SwXTextPortion: remove PORTION_CONTROL_CHAR and implementation of XTextField
2009-08-27 Michael Stahl remove obsolete hint SwTxtHardBlank and formats SwFmtHardBlank/SwFmtSoftHyph
2009-08-27 Michael Stahl clean up SwTxtAttr and friends:
remove many accessor methods for obsolete (due to autofmt) char format items.
remove unused flag SwTxtAttr::m_bDontMergeAttr.
MakeRedlineTxtAttr() now dedicated function, no longer calls MakeTxtAttr().
2009-08-27 Michael Stahl remove obsolete attribute SwTxt2Lines
2009-08-27 Michael Stahl SwXTextPortionEnumeration: finish refactoring CreatePortions
change ExportHints so it always returns a text portion for hint w/ CH_TXTATR.
remove special case for handling end of paragraph.
unfortunately had to refactor the fieldmarks export as well (got in the way).
2009-08-27 Michael Stahl SwXTextPortionEnumeration: refactor CreatePortions: frames export
extract function ExportFrames() from CreatePortions().
remove (un)dead code that calls evil MovePara(fnParaCurr, fnParaEnd)
2009-08-27 Michael Stahl clean up SwXParaFrameEnumeration
2009-08-27 Michael Stahl CollectFrameAtNode: replace SwDependArr with STL based FrameDependList_t
2009-08-27 Michael Stahl SwXTextPortionEnumeration: tweak refmark/toxmark export
so ExportHints returns the portion for point marks
2009-08-27 Michael Stahl clean up SwXTextPortionEnumeration:
prefix members, remove casts, replace SvWeirdArray with STL, etc.
make CreatePortions() method a function, and remove lots of members.
extract fieldmarks function from CreatePortions.
2009-08-27 Michael Stahl remove FOREACHUNOPAM_START/END macros
2009-08-27 Michael Stahl clean up SwXTextPortion:
prefix members, remove casts, etc.
remove SwXRubyPortion: replace it with another SwXTextPortion constructor
2009-08-27 Michael Stahl #i102541# SwXReferenceMark::InsertRefMark(): use flag SETATTR_DONTEXPAND
2009-08-27 Michael Stahl rename SwTxtNode::Insert to SwTxtNode::InsertHint, and
fix constness in SwTxtNode::InsertItem
2009-08-27 Michael Stahl turn SwTxtNode::MakeTxtAttr() methods into global functions in ndhints.hxx
2009-08-27 Michael Stahl remove obsolete sw/inc/bookmrk.hxx
2009-08-27 Michael Stahl pam.cxx: fix ComparePosition functions (returned wrong result in one case)
2009-08-27 Michael Stahl #i103613# only import RDF metadata on normal open of a document
2009-09-11 kz CWS-TOOLING: integrate CWS impress176
2009-09-08 20:18:24 +0200 sj r275957 : fixed warning (shadowed variable)
2009-09-08 18:02:05 +0200 cl r275948 : #i104315# added missing tab pages
2009-09-08 17:35:18 +0200 cl r275947 : #i104866# fixed angle import
2009-09-08 17:32:53 +0200 cl r275946 : #i104841# fixed angle import
2009-09-08 17:01:25 +0200 cl r275943 : #i103935# fixed the SID_EVENTCONFIG mess
2009-09-08 14:32:57 +0200 sj r275928 : #i104685# only comments
2009-09-07 12:37:36 +0200 sj r275886 : #i104683# fixed import of bold/italic attributes for normal text shapes
2009-09-04 15:07:46 +0200 sj r275808 : #104689# fixed bullet color problem
2009-09-03 15:25:07 +0200 sj r275753 : #160200# added vertical alignment of table cells
2009-09-11 kz CWS-TOOLING: integrate CWS dv14
2009-09-10 15:16:32 +0200 sg r276035 : #160513# updated wfs scheme to accept ports
2009-09-10 07:41:47 +0200 dv r276019 : #i104942# Better renaming algorithmen
2009-08-31 13:41:11 +0200 dv r275604 : #160505# Setting APP1PRODUCTNAME must not overwrite APP1PRODUCTDEF
2009-09-11 kz CWS-TOOLING: integrate CWS jl131
2009-09-02 16:42:40 +0200 jl r275720 : #i97896#
2009-08-31 13:01:53 +0200 jl r275599 : CWS-TOOLING: rebase CWS jl131 to trunk@275331 (milestone: DEV300:m56)
2009-07-31 14:35:30 +0200 jl r274531 : CWS-TOOLING: rebase CWS jl131 to trunk@274203 (milestone: DEV300:m53)
2009-07-23 14:20:32 +0200 jl r274272 : #i79839# better error text when trying to modify shared layer without having write permission, eg. unopkg add --shared, unopkg remove --shared, unopkg reinstall --shared
2009-07-22 16:38:02 +0200 jl r274252 : #i97896# localize error message for lock file
2009-07-22 16:37:22 +0200 jl r274251 : #i80462# unprecise wording in updatedialog
2009-07-22 16:36:06 +0200 jl r274250 : #i97896# localize error message for lock file
2009-07-22 16:35:20 +0200 jl r274249 : #i97896# localize error message for lock file
2009-07-22 15:07:30 +0200 jl r274242 : #i98873# minimum java version is 1.5 since OOo 3.0
2009-09-11 kz CWS-TOOLING: integrate CWS changehc
2009-08-31 19:38:50 +0200 pl r275633 : remove dbug printf
2009-08-31 17:41:50 +0200 pl r275623 : CWS-TOOLING: rebase CWS changehc to trunk@275331 (milestone: DEV300:m56)
2009-07-15 19:45:46 +0200 pl r274028 : #i35482# use HC flag to decide high contrast mode
2009-07-15 17:40:52 +0200 pl r274020 : #i35482# use HC flag to decide high contrast mode
2009-07-15 17:39:50 +0200 pl r274019 : #i35482# update autohc correctly in MergeSystemSettings
2009-07-15 17:38:57 +0200 pl r274018 : #i35482# update autohc correctly in MergeSystemSettings
2009-09-11 kz CWS-TOOLING: integrate CWS notes10
2009-08-24 07:25:57 +0200 mod r275287 : 2009-07-26 02:38:32 +0200 mod r274343 : #i#i103645#
2009-07-26 02:01:53 +0200 mod r274342 : #i103645#
2009-07-26 01:52:42 +0200 mod r274341 : #i103490#
2009-07-22 08:31:48 +0200 mod r274215 : #i103373#
2009-07-15 00:55:11 +0200 mod r273987 : #i101419#
2009-07-14 07:07:55 +0200 mod r273956 : #i101419#
2009-07-14 07:07:43 +0200 mod r273955 : #i101419#
2009-07-14 07:02:10 +0200 mod r273954 : changes from notes9
2009-07-14 06:14:25 +0200 mod r273953 : #i103476#
2009-09-11 kz CWS-TOOLING: integrate CWS ab70
2009-09-10 15:12:54 +0200 jsk r276034 : #i85434# - mandatory automatic update test
2009-09-10 15:11:06 +0200 jsk r276033 : #i85434# - mandatory automatic update test
2009-09-02 09:49:24 +0200 ab r275698 : #i85434# Dialog Import
2009-09-11 kz CWS-TOOLING: integrate CWS hb32bugs02
2009-09-02 Henning Brinkmann #i102420# revert changes
2009-08-26 Henning Brinkmann merged DEV300_m56
2009-08-19 Henning Brinkmann merged DEV300_m55
2009-08-14 Henning Brinkmann merged changes from wntmsci12
2009-08-12 Henning Brinkmann Implemented NoSpaceEdit constructor and destructor in .cxx to allow compile with debug on wntmsci12.
2009-08-12 Henning Brinkmann Added some SW_DLLPUBLIC to make compilable on wntmsci12.
2009-08-11 Henning Brinkmann #i102420# dbg_out: surround output for SwNodes with <nodes-array>.
2009-08-10 Henning Brinkmann #i102420# rewritten debug output for SwNodes.
2009-08-07 Henning Brinkmann #i102420# debug _MoveNodes: output the destination, too. Break after two iterations.
2009-08-07 Henning Brinkmann #i102420# _MoveNodes: Additionally check if destination index is inside source => false
Check if current range was already handled => loop
Debug output current range
2009-08-06 Henning Brinkmann merged DEV300_m54
2009-08-06 Henning Brinkmann added master fix
2009-08-06 Henning Brinkmann debug output for SwNodeRange
2009-08-04 Henning Brinkmann #i102844# robustness: check for NULL pointer to prevent crash
2009-08-03 Henning Brinkmann #i103475# applied patch and verified
2009-08-03 Henning Brinkmann Removed code preventing build of sw with DEBUG.
2009-09-11 convert-repo update tags
2009-09-10 kz CWS-TOOLING: integrate CWS os2port06dev300
2009-09-05 22:49:00 +0200 ydario r275858 : #i99588# applied os2port06 diff to DEV300 tree.
2009-09-10 kz CWS-TOOLING: integrate CWS mingwport23
2009-08-29 07:07:53 +0200 tono r275555 : i#104522: mingw port graphite
2009-08-29 07:07:26 +0200 tono r275554 : i#104522: mingw port printf format fix
2009-09-10 kz CWS-TOOLING: integrate CWS mh232
2009-08-26 03:52:57 +0200 mh r275385 : #i102182# FreeBSD patch
2009-08-26 03:43:20 +0200 mh r275384 : #i101333# patch for FreeBSD
2009-08-26 03:11:20 +0200 mh r275383 : #i39230
2009-08-26 03:07:51 +0200 mh r275382 : #i39230# more space for initials field
2009-08-26 02:41:19 +0200 mh r275380 : #i39230# use vos::osecurity for reading the user name
2009-08-18 22:06:00 +0200 mh r275130 : #i104243#, line ending problem with newer perl
2009-08-18 21:53:21 +0200 mh r275129 : #i39230# read initials via getpwnam
2009-08-18 21:34:05 +0200 mh r275128 : enable CAIROCANVAS for Linux and Mac, #i88613#
2009-08-17 18:02:59 +0200 mh r275067 : #i95498# make compile with gcc3
2009-09-10 kz CWS-TOOLING: integrate CWS tkr24
2009-09-07 14:31:06 +0200 is r275898 : #160081# adding NO_LICENSE_INTO_COPYRIGHT
2009-09-10 releng #i10000# change KeyMapping to SingletonRef<framework::KeyMapping>
2009-09-11 convert-repo update tags
2009-09-10 kz CWS-TOOLING: integrate CWS os2port06dev300
2009-09-05 22:49:00 +0200 ydario r275858 : #i99588# applied os2port06 diff to DEV300 tree.
2009-09-10 kz CWS-TOOLING: integrate CWS mingwport23
2009-08-29 07:07:53 +0200 tono r275555 : i#104522: mingw port graphite
2009-08-29 07:07:26 +0200 tono r275554 : i#104522: mingw port printf format fix
2009-09-10 kz CWS-TOOLING: integrate CWS mh232
2009-08-26 03:52:57 +0200 mh r275385 : #i102182# FreeBSD patch
2009-08-26 03:43:20 +0200 mh r275384 : #i101333# patch for FreeBSD
2009-08-26 03:11:20 +0200 mh r275383 : #i39230
2009-08-26 03:07:51 +0200 mh r275382 : #i39230# more space for initials field
2009-08-26 02:41:19 +0200 mh r275380 : #i39230# use vos::osecurity for reading the user name
2009-08-18 22:06:00 +0200 mh r275130 : #i104243#, line ending problem with newer perl
2009-08-18 21:53:21 +0200 mh r275129 : #i39230# read initials via getpwnam
2009-08-18 21:34:05 +0200 mh r275128 : enable CAIROCANVAS for Linux and Mac, #i88613#
2009-08-17 18:02:59 +0200 mh r275067 : #i95498# make compile with gcc3
2009-09-10 kz CWS-TOOLING: integrate CWS tkr24
2009-09-07 14:31:06 +0200 is r275898 : #160081# adding NO_LICENSE_INTO_COPYRIGHT
2009-09-10 releng #i10000# change KeyMapping to SingletonRef<framework::KeyMapping>
2009-09-11 14:29:45 +00:00
|
|
|
m_nHintEndIndex = 0;
|
2000-09-18 23:08:29 +00:00
|
|
|
|
|
|
|
if( nStart > GetInfo().GetTxt().Len() )
|
|
|
|
{
|
2010-11-25 17:08:45 +01:00
|
|
|
OSL_ENSURE( !this, "+SwTxtFormatter::CTOR: bad offset" );
|
2000-09-18 23:08:29 +00:00
|
|
|
nStart = GetInfo().GetTxt().Len();
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
* SwTxtFormatter::DTOR
|
|
|
|
*************************************************************************/
|
|
|
|
|
|
|
|
SwTxtFormatter::~SwTxtFormatter()
|
|
|
|
{
|
|
|
|
// Auesserst unwahrscheinlich aber denkbar.
|
|
|
|
// z.B.: Feld spaltet sich auf, Widows schlagen zu
|
|
|
|
if( GetInfo().GetRest() )
|
|
|
|
{
|
|
|
|
delete GetInfo().GetRest();
|
|
|
|
GetInfo().SetRest(0);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
* SwTxtFormatter::Insert()
|
|
|
|
*************************************************************************/
|
|
|
|
|
|
|
|
void SwTxtFormatter::Insert( SwLineLayout *pLay )
|
|
|
|
{
|
|
|
|
// Einfuegen heute mal ausnahmsweise hinter dem aktuellen Element.
|
|
|
|
if ( pCurr )
|
|
|
|
{
|
|
|
|
pLay->SetNext( pCurr->GetNext() );
|
|
|
|
pCurr->SetNext( pLay );
|
|
|
|
}
|
|
|
|
else
|
|
|
|
pCurr = pLay;
|
|
|
|
}
|
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
* SwTxtFormatter::GetFrmRstHeight()
|
|
|
|
*************************************************************************/
|
|
|
|
|
|
|
|
KSHORT SwTxtFormatter::GetFrmRstHeight() const
|
|
|
|
{
|
|
|
|
// 8725: Uns interessiert die Resthoehe bezogen auf die Seite.
|
|
|
|
// Wenn wir in einer Tabelle stehen, dann ist pFrm->GetUpper() nicht
|
|
|
|
// die Seite. GetFrmRstHeight() wird im Zusammenhang mit den Ftn
|
|
|
|
// gerufen.
|
|
|
|
// Falsch: const SwFrm *pUpper = pFrm->GetUpper();
|
|
|
|
const SwFrm *pPage = (const SwFrm*)pFrm->FindPageFrm();
|
|
|
|
const SwTwips nHeight = pPage->Frm().Top()
|
|
|
|
+ pPage->Prt().Top()
|
|
|
|
+ pPage->Prt().Height() - Y();
|
|
|
|
if( 0 > nHeight )
|
|
|
|
return pCurr->Height();
|
|
|
|
else
|
|
|
|
return KSHORT( nHeight );
|
|
|
|
}
|
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
* SwTxtFormatter::UnderFlow()
|
|
|
|
*************************************************************************/
|
|
|
|
|
|
|
|
SwLinePortion *SwTxtFormatter::UnderFlow( SwTxtFormatInfo &rInf )
|
|
|
|
{
|
|
|
|
// Werte sichern und rInf initialisieren.
|
|
|
|
SwLinePortion *pUnderFlow = rInf.GetUnderFlow();
|
|
|
|
if( !pUnderFlow )
|
|
|
|
return 0;
|
|
|
|
|
|
|
|
// Wir formatieren rueckwaerts, d.h. dass Attributwechsel in der
|
|
|
|
// naechsten Zeile durchaus noch einmal drankommen koennen.
|
|
|
|
// Zu beobachten in 8081.sdw, wenn man in der ersten Zeile Text eingibt.
|
|
|
|
|
|
|
|
const xub_StrLen nSoftHyphPos = rInf.GetSoftHyphPos();
|
2001-10-11 09:54:19 +00:00
|
|
|
const xub_StrLen nUnderScorePos = rInf.GetUnderScorePos();
|
2000-09-18 23:08:29 +00:00
|
|
|
|
|
|
|
// 8358, 8359: Flys sichern und auf 0 setzen, sonst GPF
|
|
|
|
// 3983: Nicht ClearFly(rInf) !
|
|
|
|
SwFlyPortion *pFly = rInf.GetFly();
|
|
|
|
rInf.SetFly( 0 );
|
|
|
|
|
|
|
|
FeedInf( rInf );
|
|
|
|
rInf.SetLast( pCurr );
|
|
|
|
// pUnderFlow braucht nicht deletet werden, weil es im folgenden
|
|
|
|
// Truncate() untergehen wird.
|
|
|
|
rInf.SetUnderFlow(0);
|
|
|
|
rInf.SetSoftHyphPos( nSoftHyphPos );
|
2001-10-11 09:54:19 +00:00
|
|
|
rInf.SetUnderScorePos( nUnderScorePos );
|
2001-10-02 12:51:59 +00:00
|
|
|
rInf.SetPaintOfst( GetLeftMargin() );
|
2000-09-18 23:08:29 +00:00
|
|
|
|
|
|
|
// Wir suchen die Portion mit der Unterlaufposition
|
|
|
|
SwLinePortion *pPor = pCurr->GetFirstPortion();
|
|
|
|
if( pPor != pUnderFlow )
|
|
|
|
{
|
|
|
|
// pPrev wird die letzte Portion vor pUnderFlow,
|
|
|
|
// die noch eine echte Breite hat.
|
|
|
|
// Ausnahme: SoftHyphPortions duerfen dabei natuerlich
|
|
|
|
// nicht vergessen werden, obwohl sie keine Breite haben.
|
2007-09-27 08:14:21 +00:00
|
|
|
SwLinePortion *pTmpPrev = pPor;
|
2000-09-18 23:08:29 +00:00
|
|
|
while( pPor && pPor != pUnderFlow )
|
|
|
|
{
|
2001-02-28 07:46:55 +00:00
|
|
|
if( !pPor->IsKernPortion() &&
|
|
|
|
( pPor->Width() || pPor->IsSoftHyphPortion() ) )
|
2000-09-18 23:08:29 +00:00
|
|
|
{
|
2007-09-27 08:14:21 +00:00
|
|
|
while( pTmpPrev != pPor )
|
2000-09-18 23:08:29 +00:00
|
|
|
{
|
2007-09-27 08:14:21 +00:00
|
|
|
pTmpPrev->Move( rInf );
|
|
|
|
rInf.SetLast( pTmpPrev );
|
|
|
|
pTmpPrev = pTmpPrev->GetPortion();
|
2010-11-25 17:08:45 +01:00
|
|
|
OSL_ENSURE( pTmpPrev, "UnderFlow: Loosing control!" );
|
2000-09-18 23:08:29 +00:00
|
|
|
};
|
|
|
|
}
|
|
|
|
pPor = pPor->GetPortion();
|
|
|
|
}
|
2007-09-27 08:14:21 +00:00
|
|
|
pPor = pTmpPrev;
|
2000-09-18 23:08:29 +00:00
|
|
|
if( pPor && // Flies + Initialen werden nicht beim UnderFlow mitgenommen
|
|
|
|
( pPor->IsFlyPortion() || pPor->IsDropPortion() ||
|
|
|
|
pPor->IsFlyCntPortion() ) )
|
|
|
|
{
|
|
|
|
pPor->Move( rInf );
|
|
|
|
rInf.SetLast( pPor );
|
|
|
|
rInf.SetStopUnderFlow( sal_True );
|
|
|
|
pPor = pUnderFlow;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// Was? Die Unterlaufsituation ist nicht in der Portion-Kette ?
|
2010-11-25 17:08:45 +01:00
|
|
|
OSL_ENSURE( pPor, "SwTxtFormatter::UnderFlow: overflow but underflow" );
|
2000-09-18 23:08:29 +00:00
|
|
|
|
2004-06-28 12:00:45 +00:00
|
|
|
// OD 2004-05-26 #i29529# - correction: no delete of footnotes
|
|
|
|
// if( rInf.IsFtnInside() && pPor && !rInf.IsQuick() )
|
|
|
|
// {
|
|
|
|
// SwLinePortion *pTmp = pPor->GetPortion();
|
|
|
|
// while( pTmp )
|
|
|
|
// {
|
|
|
|
// if( pTmp->IsFtnPortion() )
|
|
|
|
// ((SwFtnPortion*)pTmp)->ClearFtn();
|
|
|
|
// pTmp = pTmp->GetPortion();
|
|
|
|
// }
|
|
|
|
// }
|
2000-09-18 23:08:29 +00:00
|
|
|
|
2011-03-14 21:17:00 +01:00
|
|
|
/*--------------------------------------------------
|
2000-09-18 23:08:29 +00:00
|
|
|
* 9849: Schnellschuss
|
|
|
|
* --------------------------------------------------*/
|
|
|
|
if ( pPor==rInf.GetLast() )
|
|
|
|
{
|
|
|
|
// Hier landen wir, wenn die UnderFlow-ausloesende Portion sich
|
|
|
|
// ueber die ganze Zeile erstreckt, z. B. wenn ein Wort ueber
|
|
|
|
// mehrere Zeilen geht und in der zweiten Zeile in einen Fly
|
|
|
|
// hineinlaeuft!
|
|
|
|
rInf.SetFly( pFly ); // wg. 28300
|
|
|
|
pPor->Truncate();
|
|
|
|
return pPor; // Reicht das?
|
|
|
|
}
|
|
|
|
/*---------------------------------------------------
|
|
|
|
* Ende des Schnellschusses wg. 9849
|
|
|
|
* --------------------------------------------------*/
|
|
|
|
|
|
|
|
// 4656: X + Width == 0 bei SoftHyph > Zeile ?!
|
|
|
|
if( !pPor || !(rInf.X() + pPor->Width()) )
|
|
|
|
{
|
|
|
|
delete pFly;
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
// Vorbereitungen auf's Format()
|
|
|
|
// Wir muessen die Kette hinter pLast abknipsen, weil
|
|
|
|
// nach dem Format() ein Insert erfolgt.
|
|
|
|
SeekAndChg( rInf );
|
|
|
|
|
2001-02-15 12:30:24 +00:00
|
|
|
// line width is adjusted, so that pPor does not fit to current
|
|
|
|
// line anymore
|
2011-01-17 15:06:54 +01:00
|
|
|
rInf.Width( (sal_uInt16)(rInf.X() + (pPor->Width() ? pPor->Width() - 1 : 0)) );
|
2000-09-18 23:08:29 +00:00
|
|
|
rInf.SetLen( pPor->GetLen() );
|
|
|
|
rInf.SetFull( sal_False );
|
|
|
|
if( pFly )
|
|
|
|
{
|
|
|
|
// Aus folgendem Grund muss die FlyPortion neu berechnet werden:
|
|
|
|
// Wenn durch einen grossen Font in der Mitte der Zeile die Grundlinie
|
|
|
|
// abgesenkt wird und dadurch eine Ueberlappung mit eine Fly entsteht,
|
|
|
|
// so hat die FlyPortion eine falsche Groesse/Fixsize.
|
|
|
|
rInf.SetFly( pFly );
|
|
|
|
CalcFlyWidth( rInf );
|
|
|
|
}
|
|
|
|
rInf.GetLast()->SetPortion(0);
|
|
|
|
|
|
|
|
// Eine Ausnahme bildet das SwLineLayout, dass sich beim
|
|
|
|
// ersten Portionwechsel aufspaltet. Hier nun der umgekehrte Weg:
|
|
|
|
if( rInf.GetLast() == pCurr )
|
|
|
|
{
|
|
|
|
if( pPor->InTxtGrp() && !pPor->InExpGrp() )
|
|
|
|
{
|
|
|
|
MSHORT nOldWhich = pCurr->GetWhichPor();
|
|
|
|
*(SwLinePortion*)pCurr = *pPor;
|
|
|
|
pCurr->SetPortion( pPor->GetPortion() );
|
|
|
|
pCurr->SetWhichPor( nOldWhich );
|
|
|
|
pPor->SetPortion( 0 );
|
|
|
|
delete pPor;
|
|
|
|
pPor = pCurr;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
pPor->Truncate();
|
CWS-TOOLING: integrate CWS odfmetadata3
2009-09-11 Michael Stahl merge DEV300_m58
2009-09-07 Michael Stahl SwFmtFld::Modify(): do nothing on RES_OBJECTDYING
2009-08-27 Michael Stahl #i91565#, #i91566#: TextPortionEnumerationTest.java: add test document
2009-08-27 Michael Stahl #i91565#, #i91566#: add complex test: TextPortionEnumerationTest.java
2009-08-27 Michael Stahl CLiteral::initialize(): zero-length literals probably not an error
2009-08-27 Michael Stahl #i91565#, #i91566#: offapi: new InContentMetadata and MetadataField services
adapt TextPortion for InContentMetadata
2009-08-27 Michael Stahl #i91564#: xmloff: load/store xml:id and RDFa for text:bookmark(-start).
2009-08-27 Michael Stahl #i91564#: sw core: add support for xml:id at bookmarks:
sw::mark::Bookmark: derive from Metadatable.
SwHistoryBookmark, SaveBookmark: store a MetadatableUndo.
ndcopy.cxx: lcl_CopyBookmarks(): copy the xml:id.
SwXBookmark: derive from MetadatableMixin.
2009-08-27 Michael Stahl #i91565#, #i91566#: xmloff: refactor ruby import so nested meta(-field) works:
remove XMLRubyHint_Impl.
XMLImpRubyContext_Impl::~XMLImpRubyContext_Impl(): insert ruby directly.
2009-08-27 Michael Stahl #i91565#, #i91566#: xmloff: fix text:meta(-field) import/export:
new XMLTextParagraphExport::exportTextField() overload for XTextField.
CreateAndInsertMark(): set xml:id after insertion.
fix meta(-field) service names, bugs etc.
2009-08-27 Michael Stahl #i91565#, #i91566#: sw text formatting: paint background of meta(-field) body:
SwFont: add member m_nMetaCount.
txttypes.hxx: add POR_META.
atrstck.cxx: handle RES_TXTATR_META(FIELD).
itrform2.cxx: SwTxtFormatter::WhichTxtPor(): create new class SwMetaPortion.
2009-08-27 Michael Stahl #i91566#: sw text formatting: display meta-field prefix and suffix:
SwAttrIter::GetAttr(): replace with call to GetTxtAttrForCharAt().
SwTxtFormatter::NewExtraPortion(): handle meta-field prefix.
SwTxtFormatter: new member m_nHintEndIndex.
SwTxtFormatter::WhichFirstPortion(): call TryNewNoLengthPortion().
SwTxtFormatter::TryNewNoLengthPortion(): new; handle suffix of meta-field.
SwTxtFormatter::UnderFlow(): UGLY HACK: decrement m_nHintEndIndex.
SwFldPortion: add flag m_bNoLength: portion has zero length (for suffix).
2009-08-27 Michael Stahl #i91565#, #i91566#: extend text:meta(-field) uno wrapper with XText interface:
unoobj.hxx: new CursorType CURSOR_META.
unoobj2.cxx: refactor SwXText implementation to ensure that when the SwXText
belongs to a SwXMeta, content is always inserted inside the meta(-field).
unoobj.cxx: new SwXTextCursor::ForceIntoMeta(): cursor stays in meta(-field).
unometa.hxx: SwXMeta implements XText, forwarding to a member SwXMetaText.
DocInsertStringSplitCR(), SwX*::attachToRange(), SwX*::DeleteAndInsert():
use FORCEHINTEXPAND hack to ensure insert into the meta(-field) at the end.
2009-08-27 Michael Stahl #i91565#, #i91566#: add text:meta(-field) uno wrapper to sw:
fmtmeta.hxx, fmtatr2.cxx: new class sw::MetaField, new sw::MetaFieldManager.
doc.hxx, docnew.cxx: new SwDoc::GetMetaFieldManager().
unocoll.hxx,.cxx: new SW_SERVICE_FIELDTYPE_METAFIELD, SW_SERVICE_TYPE_META.
unomap.hxx,.cxx: new PROPERTY_MAP_METAFIELD.
unoprnms.hxx: new UNO_NAME_META.
unoport.hxx: new PORTION_META; add "InContentMetadata" prop to SwXTextPortion.
new unometa.hxx: new class SwXMeta and SwXMetaField.
unofield.cxx: SwXFieldEnumeration: include meta-fields.
unoportenum.cxx: handle RES_TXTATR_META(FIELD) by using a portion list stack.
unotext.cxx: SwXText::insertTextContent(): handle meta(-field) as attribute.
2009-08-27 Michael Stahl #i91565#, #i91566#: ndhints.cxx: remove sort number from SwTxtAttrNesting
2009-08-27 Michael Stahl #i91565#, #i91566#: add support for hints with end and CH_TXTATR to sw core:
doc.hxx, docedt.cxx: replace SwDoc::Delete(), DeleteAndJoin(), ReplaceRange()
with wrappers that split at left-overlapped end+CH_TXTATR hints.
txatbase.hxx: new member SwTxtAttr::m_bHasDummyChar.
ndtxt.hxx: rename SwTxtNode::GetTxtAttr() to GetTxtAttrForCharAt().
ndtxt.cxx: SwTxtNode::CopyText(): copy end+CH_TXTATR hints iff copy CH_TXTATR.
txtatr2.cxx, thints.cxx: SwTxtMeta gets a CH_TXTATR.
2009-08-27 Michael Stahl #i91565#, #i91566#: add text:meta(-field) to sw core:
txatbase.hxx: new member SwTxtAttr::m_bNesting.
hintids.hxx: new ids RES_TXTATR_META, RES_TXTATR_METAFIELD.
txtatr.hxx: new base class SwTxtAttrNesting.
new hint SwTxtMeta.
SwTxtRuby derives from SwTxtAttrNesting.
txtinet.hxx: SwTxtINetFmt derives from SwTxtAttrNesting.
new header fmtmeta.hxx: new pool item SwFmtMeta. new class sw::Meta.
ndhints.hxx, thints.cxx: new method SwpHints::TryInsertNesting().
thints.cxx: refactoring: BuildPortions() no longer handles Ruby/Hyperlink,
but TryInsertNesting(), which also handles meta(-field).
SwTxtNode::InsertItem(): check if the hint is actually inserted.
ndhints.cxx: sort nesting hints based on sort number.
ndtxt.cxx: lcl_CopyHint(): handle copy of meta/meta-field.
2009-08-27 Michael Stahl enable expanding hints with m_bLockExpandFlag set:
add new InsertFlag: INS_FORCEHINTEXPAND.
add new SetAttrMode: SETATTR_FORCEHINTEXPAND.
rename SwEditShell::Insert() to Insert2() because changed signature fails
to compile when SwWrtShell tries to overwrite these non-virtual members...
SwWrtShell::Insert() sets FOCEHINTEXPAND if range was selected/deleted.
adapt SwUndoInsert to store flags.
2009-08-27 Michael Stahl change formal parameters of item insertion methods to type SetAttrMode
2009-08-27 Michael Stahl fix incorrect resetting of text attributes in SwUndoInsSection, SwUndoInserts
2009-08-27 Michael Stahl clean up SwTxtNode::CutImpl() and lcl_CopyHint()
2009-08-27 Michael Stahl rename SwDoc::Copy() to CopyRange(), and _Copy() to CopyImpl()
2009-08-27 Michael Stahl rename SwNodes::Move() to MoveRange(), and remove unused parameter
2009-08-27 Michael Stahl rename SwDoc::Move() to MoveRange()/MoveNodeRange()
2009-08-27 Michael Stahl rename SwDoc::Insert() to InsertString(), and remove sal_Unicode variant
2009-08-27 Michael Stahl rename SwDoc::Insert() to InsertPoolItem()/InsertItemSet()/InsertSwSection()
2009-08-27 Michael Stahl rename SwDoc::Replace() to ReplaceRange()
2009-08-27 Michael Stahl remove SwDoc::Overwrite() sal_Unicode variant
2009-08-27 Michael Stahl split up SwDoc::DeleteAndJoin(): factor out DeleteAndJoinWithRedline()
2009-08-27 Michael Stahl rename overloaded SwDoc::Delete() to DeleteRange()/DeleteTOXMark()
2009-08-27 Michael Stahl rename SwTxtNode::Copy() to CopyText()
2009-08-27 Michael Stahl rename SwTxtNode::Cut() to CutText(), and _Cut() to CutImpl()
2009-08-27 Michael Stahl rename SwTxtNode::Delete() to DeleteAttribute()/DeleteAttributes()
2009-08-27 Michael Stahl rename SwTxtNode::Replace() to ReplaceText(), and remove the xub_Unicode variant
2009-08-27 Michael Stahl rename SwTxtNode::Erase() to EraseText()
2009-08-27 Michael Stahl rename SwTxtNode::Insert() to InsertText(), and remove the xub_Unicode variant
2009-08-27 Michael Stahl clean up SwTxtNode::Update()
2009-08-27 Michael Stahl remove SwTxtAttr::RemoveFromPool() and make destructor non-public,
to be invoked by new method SwTxtAttr::Destroy()
2009-08-27 Michael Stahl ensure that SwDoc::Insert() for item (set) returns success indicator:
replace SwRegHistory constructor with method InsertItems(), returning bool.
refactor InsAttr() so that it checks if InsertItems() succeeds.
2009-08-27 Michael Stahl move SwXTextPortionEnumeration from unoobj.hxx to unoport.hxx
2009-08-27 Michael Stahl add missing SolarMutex in SwXTextPortion methods
2009-08-27 Michael Stahl SwXTextPortion: new member m_xTextField (so the TextField property need not
be returned indirectly via SwUnoCursorHelper).
factor out function CreateSwXTextField().
2009-08-27 Michael Stahl SwXTextPortion: remove PORTION_CONTROL_CHAR and implementation of XTextField
2009-08-27 Michael Stahl remove obsolete hint SwTxtHardBlank and formats SwFmtHardBlank/SwFmtSoftHyph
2009-08-27 Michael Stahl clean up SwTxtAttr and friends:
remove many accessor methods for obsolete (due to autofmt) char format items.
remove unused flag SwTxtAttr::m_bDontMergeAttr.
MakeRedlineTxtAttr() now dedicated function, no longer calls MakeTxtAttr().
2009-08-27 Michael Stahl remove obsolete attribute SwTxt2Lines
2009-08-27 Michael Stahl SwXTextPortionEnumeration: finish refactoring CreatePortions
change ExportHints so it always returns a text portion for hint w/ CH_TXTATR.
remove special case for handling end of paragraph.
unfortunately had to refactor the fieldmarks export as well (got in the way).
2009-08-27 Michael Stahl SwXTextPortionEnumeration: refactor CreatePortions: frames export
extract function ExportFrames() from CreatePortions().
remove (un)dead code that calls evil MovePara(fnParaCurr, fnParaEnd)
2009-08-27 Michael Stahl clean up SwXParaFrameEnumeration
2009-08-27 Michael Stahl CollectFrameAtNode: replace SwDependArr with STL based FrameDependList_t
2009-08-27 Michael Stahl SwXTextPortionEnumeration: tweak refmark/toxmark export
so ExportHints returns the portion for point marks
2009-08-27 Michael Stahl clean up SwXTextPortionEnumeration:
prefix members, remove casts, replace SvWeirdArray with STL, etc.
make CreatePortions() method a function, and remove lots of members.
extract fieldmarks function from CreatePortions.
2009-08-27 Michael Stahl remove FOREACHUNOPAM_START/END macros
2009-08-27 Michael Stahl clean up SwXTextPortion:
prefix members, remove casts, etc.
remove SwXRubyPortion: replace it with another SwXTextPortion constructor
2009-08-27 Michael Stahl #i102541# SwXReferenceMark::InsertRefMark(): use flag SETATTR_DONTEXPAND
2009-08-27 Michael Stahl rename SwTxtNode::Insert to SwTxtNode::InsertHint, and
fix constness in SwTxtNode::InsertItem
2009-08-27 Michael Stahl turn SwTxtNode::MakeTxtAttr() methods into global functions in ndhints.hxx
2009-08-27 Michael Stahl remove obsolete sw/inc/bookmrk.hxx
2009-08-27 Michael Stahl pam.cxx: fix ComparePosition functions (returned wrong result in one case)
2009-08-27 Michael Stahl #i103613# only import RDF metadata on normal open of a document
2009-09-11 kz CWS-TOOLING: integrate CWS impress176
2009-09-08 20:18:24 +0200 sj r275957 : fixed warning (shadowed variable)
2009-09-08 18:02:05 +0200 cl r275948 : #i104315# added missing tab pages
2009-09-08 17:35:18 +0200 cl r275947 : #i104866# fixed angle import
2009-09-08 17:32:53 +0200 cl r275946 : #i104841# fixed angle import
2009-09-08 17:01:25 +0200 cl r275943 : #i103935# fixed the SID_EVENTCONFIG mess
2009-09-08 14:32:57 +0200 sj r275928 : #i104685# only comments
2009-09-07 12:37:36 +0200 sj r275886 : #i104683# fixed import of bold/italic attributes for normal text shapes
2009-09-04 15:07:46 +0200 sj r275808 : #104689# fixed bullet color problem
2009-09-03 15:25:07 +0200 sj r275753 : #160200# added vertical alignment of table cells
2009-09-11 kz CWS-TOOLING: integrate CWS dv14
2009-09-10 15:16:32 +0200 sg r276035 : #160513# updated wfs scheme to accept ports
2009-09-10 07:41:47 +0200 dv r276019 : #i104942# Better renaming algorithmen
2009-08-31 13:41:11 +0200 dv r275604 : #160505# Setting APP1PRODUCTNAME must not overwrite APP1PRODUCTDEF
2009-09-11 kz CWS-TOOLING: integrate CWS jl131
2009-09-02 16:42:40 +0200 jl r275720 : #i97896#
2009-08-31 13:01:53 +0200 jl r275599 : CWS-TOOLING: rebase CWS jl131 to trunk@275331 (milestone: DEV300:m56)
2009-07-31 14:35:30 +0200 jl r274531 : CWS-TOOLING: rebase CWS jl131 to trunk@274203 (milestone: DEV300:m53)
2009-07-23 14:20:32 +0200 jl r274272 : #i79839# better error text when trying to modify shared layer without having write permission, eg. unopkg add --shared, unopkg remove --shared, unopkg reinstall --shared
2009-07-22 16:38:02 +0200 jl r274252 : #i97896# localize error message for lock file
2009-07-22 16:37:22 +0200 jl r274251 : #i80462# unprecise wording in updatedialog
2009-07-22 16:36:06 +0200 jl r274250 : #i97896# localize error message for lock file
2009-07-22 16:35:20 +0200 jl r274249 : #i97896# localize error message for lock file
2009-07-22 15:07:30 +0200 jl r274242 : #i98873# minimum java version is 1.5 since OOo 3.0
2009-09-11 kz CWS-TOOLING: integrate CWS changehc
2009-08-31 19:38:50 +0200 pl r275633 : remove dbug printf
2009-08-31 17:41:50 +0200 pl r275623 : CWS-TOOLING: rebase CWS changehc to trunk@275331 (milestone: DEV300:m56)
2009-07-15 19:45:46 +0200 pl r274028 : #i35482# use HC flag to decide high contrast mode
2009-07-15 17:40:52 +0200 pl r274020 : #i35482# use HC flag to decide high contrast mode
2009-07-15 17:39:50 +0200 pl r274019 : #i35482# update autohc correctly in MergeSystemSettings
2009-07-15 17:38:57 +0200 pl r274018 : #i35482# update autohc correctly in MergeSystemSettings
2009-09-11 kz CWS-TOOLING: integrate CWS notes10
2009-08-24 07:25:57 +0200 mod r275287 : 2009-07-26 02:38:32 +0200 mod r274343 : #i#i103645#
2009-07-26 02:01:53 +0200 mod r274342 : #i103645#
2009-07-26 01:52:42 +0200 mod r274341 : #i103490#
2009-07-22 08:31:48 +0200 mod r274215 : #i103373#
2009-07-15 00:55:11 +0200 mod r273987 : #i101419#
2009-07-14 07:07:55 +0200 mod r273956 : #i101419#
2009-07-14 07:07:43 +0200 mod r273955 : #i101419#
2009-07-14 07:02:10 +0200 mod r273954 : changes from notes9
2009-07-14 06:14:25 +0200 mod r273953 : #i103476#
2009-09-11 kz CWS-TOOLING: integrate CWS ab70
2009-09-10 15:12:54 +0200 jsk r276034 : #i85434# - mandatory automatic update test
2009-09-10 15:11:06 +0200 jsk r276033 : #i85434# - mandatory automatic update test
2009-09-02 09:49:24 +0200 ab r275698 : #i85434# Dialog Import
2009-09-11 kz CWS-TOOLING: integrate CWS hb32bugs02
2009-09-02 Henning Brinkmann #i102420# revert changes
2009-08-26 Henning Brinkmann merged DEV300_m56
2009-08-19 Henning Brinkmann merged DEV300_m55
2009-08-14 Henning Brinkmann merged changes from wntmsci12
2009-08-12 Henning Brinkmann Implemented NoSpaceEdit constructor and destructor in .cxx to allow compile with debug on wntmsci12.
2009-08-12 Henning Brinkmann Added some SW_DLLPUBLIC to make compilable on wntmsci12.
2009-08-11 Henning Brinkmann #i102420# dbg_out: surround output for SwNodes with <nodes-array>.
2009-08-10 Henning Brinkmann #i102420# rewritten debug output for SwNodes.
2009-08-07 Henning Brinkmann #i102420# debug _MoveNodes: output the destination, too. Break after two iterations.
2009-08-07 Henning Brinkmann #i102420# _MoveNodes: Additionally check if destination index is inside source => false
Check if current range was already handled => loop
Debug output current range
2009-08-06 Henning Brinkmann merged DEV300_m54
2009-08-06 Henning Brinkmann added master fix
2009-08-06 Henning Brinkmann debug output for SwNodeRange
2009-08-04 Henning Brinkmann #i102844# robustness: check for NULL pointer to prevent crash
2009-08-03 Henning Brinkmann #i103475# applied patch and verified
2009-08-03 Henning Brinkmann Removed code preventing build of sw with DEBUG.
2009-09-11 convert-repo update tags
2009-09-10 kz CWS-TOOLING: integrate CWS os2port06dev300
2009-09-05 22:49:00 +0200 ydario r275858 : #i99588# applied os2port06 diff to DEV300 tree.
2009-09-10 kz CWS-TOOLING: integrate CWS mingwport23
2009-08-29 07:07:53 +0200 tono r275555 : i#104522: mingw port graphite
2009-08-29 07:07:26 +0200 tono r275554 : i#104522: mingw port printf format fix
2009-09-10 kz CWS-TOOLING: integrate CWS mh232
2009-08-26 03:52:57 +0200 mh r275385 : #i102182# FreeBSD patch
2009-08-26 03:43:20 +0200 mh r275384 : #i101333# patch for FreeBSD
2009-08-26 03:11:20 +0200 mh r275383 : #i39230
2009-08-26 03:07:51 +0200 mh r275382 : #i39230# more space for initials field
2009-08-26 02:41:19 +0200 mh r275380 : #i39230# use vos::osecurity for reading the user name
2009-08-18 22:06:00 +0200 mh r275130 : #i104243#, line ending problem with newer perl
2009-08-18 21:53:21 +0200 mh r275129 : #i39230# read initials via getpwnam
2009-08-18 21:34:05 +0200 mh r275128 : enable CAIROCANVAS for Linux and Mac, #i88613#
2009-08-17 18:02:59 +0200 mh r275067 : #i95498# make compile with gcc3
2009-09-10 kz CWS-TOOLING: integrate CWS tkr24
2009-09-07 14:31:06 +0200 is r275898 : #160081# adding NO_LICENSE_INTO_COPYRIGHT
2009-09-10 releng #i10000# change KeyMapping to SingletonRef<framework::KeyMapping>
2009-09-11 convert-repo update tags
2009-09-10 kz CWS-TOOLING: integrate CWS os2port06dev300
2009-09-05 22:49:00 +0200 ydario r275858 : #i99588# applied os2port06 diff to DEV300 tree.
2009-09-10 kz CWS-TOOLING: integrate CWS mingwport23
2009-08-29 07:07:53 +0200 tono r275555 : i#104522: mingw port graphite
2009-08-29 07:07:26 +0200 tono r275554 : i#104522: mingw port printf format fix
2009-09-10 kz CWS-TOOLING: integrate CWS mh232
2009-08-26 03:52:57 +0200 mh r275385 : #i102182# FreeBSD patch
2009-08-26 03:43:20 +0200 mh r275384 : #i101333# patch for FreeBSD
2009-08-26 03:11:20 +0200 mh r275383 : #i39230
2009-08-26 03:07:51 +0200 mh r275382 : #i39230# more space for initials field
2009-08-26 02:41:19 +0200 mh r275380 : #i39230# use vos::osecurity for reading the user name
2009-08-18 22:06:00 +0200 mh r275130 : #i104243#, line ending problem with newer perl
2009-08-18 21:53:21 +0200 mh r275129 : #i39230# read initials via getpwnam
2009-08-18 21:34:05 +0200 mh r275128 : enable CAIROCANVAS for Linux and Mac, #i88613#
2009-08-17 18:02:59 +0200 mh r275067 : #i95498# make compile with gcc3
2009-09-10 kz CWS-TOOLING: integrate CWS tkr24
2009-09-07 14:31:06 +0200 is r275898 : #160081# adding NO_LICENSE_INTO_COPYRIGHT
2009-09-10 releng #i10000# change KeyMapping to SingletonRef<framework::KeyMapping>
2009-09-11 14:29:45 +00:00
|
|
|
SwLinePortion *const pRest( rInf.GetRest() );
|
|
|
|
if (pRest && pRest->InFldGrp() &&
|
|
|
|
static_cast<SwFldPortion*>(pRest)->IsNoLength())
|
|
|
|
{
|
|
|
|
// HACK: decrement again, so we pick up the suffix in next line!
|
|
|
|
--m_nHintEndIndex;
|
|
|
|
}
|
|
|
|
delete pRest;
|
2000-09-18 23:08:29 +00:00
|
|
|
rInf.SetRest(0);
|
|
|
|
return pPor;
|
|
|
|
}
|
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
* SwTxtFormatter::InsertPortion()
|
|
|
|
*************************************************************************/
|
|
|
|
|
|
|
|
void SwTxtFormatter::InsertPortion( SwTxtFormatInfo &rInf,
|
|
|
|
SwLinePortion *pPor ) const
|
|
|
|
{
|
|
|
|
// Die neue Portion wird eingefuegt,
|
|
|
|
// bei dem LineLayout ist allerdings alles anders...
|
|
|
|
if( pPor == pCurr )
|
|
|
|
{
|
2010-07-07 13:05:22 +02:00
|
|
|
if ( pCurr->GetPortion() )
|
|
|
|
{
|
2000-09-18 23:08:29 +00:00
|
|
|
pPor = pCurr->GetPortion();
|
2010-07-07 13:05:22 +02:00
|
|
|
}
|
|
|
|
|
2011-04-16 22:42:13 -03:00
|
|
|
// #i112181#
|
2010-07-07 13:05:22 +02:00
|
|
|
rInf.SetOtherThanFtnInside( rInf.IsOtherThanFtnInside() || !pPor->IsFtnPortion() );
|
2000-09-18 23:08:29 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
SwLinePortion *pLast = rInf.GetLast();
|
|
|
|
if( pLast->GetPortion() )
|
|
|
|
{
|
|
|
|
while( pLast->GetPortion() )
|
|
|
|
pLast = pLast->GetPortion();
|
|
|
|
rInf.SetLast( pLast );
|
|
|
|
}
|
|
|
|
pLast->Insert( pPor );
|
|
|
|
|
2010-03-16 09:54:03 +01:00
|
|
|
rInf.SetOtherThanFtnInside( rInf.IsOtherThanFtnInside() || !pPor->IsFtnPortion() );
|
|
|
|
|
2000-09-18 23:08:29 +00:00
|
|
|
// Maxima anpassen:
|
|
|
|
if( pCurr->Height() < pPor->Height() )
|
|
|
|
pCurr->Height( pPor->Height() );
|
|
|
|
if( pCurr->GetAscent() < pPor->GetAscent() )
|
|
|
|
pCurr->SetAscent( pPor->GetAscent() );
|
|
|
|
}
|
|
|
|
|
|
|
|
// manchmal werden ganze Ketten erzeugt (z.B. durch Hyphenate)
|
|
|
|
rInf.SetLast( pPor );
|
|
|
|
while( pPor )
|
|
|
|
{
|
|
|
|
pPor->Move( rInf );
|
|
|
|
rInf.SetLast( pPor );
|
|
|
|
pPor = pPor->GetPortion();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
* SwTxtFormatter::BuildPortion()
|
|
|
|
*************************************************************************/
|
|
|
|
|
|
|
|
void SwTxtFormatter::BuildPortions( SwTxtFormatInfo &rInf )
|
|
|
|
{
|
2010-11-25 17:08:45 +01:00
|
|
|
OSL_ENSURE( rInf.GetTxt().Len() < STRING_LEN,
|
2000-09-18 23:08:29 +00:00
|
|
|
"SwTxtFormatter::BuildPortions: bad text length in info" );
|
|
|
|
|
|
|
|
rInf.ChkNoHyph( CntEndHyph(), CntMidHyph() );
|
|
|
|
|
|
|
|
// Erst NewTxtPortion() entscheidet, ob pCurr in pPor landet.
|
|
|
|
// Wir muessen in jedem Fall dafuer sorgen, dass der Font eingestellt
|
|
|
|
// wird. In CalcAscent geschieht dies automatisch.
|
2001-05-28 15:20:44 +00:00
|
|
|
rInf.SetLast( pCurr );
|
2000-09-18 23:08:29 +00:00
|
|
|
rInf.ForcedLeftMargin( 0 );
|
|
|
|
|
2010-11-25 17:08:45 +01:00
|
|
|
OSL_ENSURE( pCurr->FindLastPortion() == pCurr, "pLast supposed to equal pCurr" );
|
2000-09-18 23:08:29 +00:00
|
|
|
|
2001-05-28 15:20:44 +00:00
|
|
|
if( !pCurr->GetAscent() && !pCurr->Height() )
|
|
|
|
CalcAscent( rInf, pCurr );
|
|
|
|
|
|
|
|
SeekAndChg( rInf );
|
|
|
|
|
|
|
|
// In CalcFlyWidth wird Width() verkuerzt, wenn eine FlyPortion vorliegt.
|
2010-11-25 17:08:45 +01:00
|
|
|
OSL_ENSURE( !rInf.X() || pMulti, "SwTxtFormatter::BuildPortion X=0?" );
|
2001-05-28 15:20:44 +00:00
|
|
|
CalcFlyWidth( rInf );
|
|
|
|
SwFlyPortion *pFly = rInf.GetFly();
|
|
|
|
if( pFly )
|
|
|
|
{
|
|
|
|
if ( 0 < pFly->Fix() )
|
|
|
|
ClearFly( rInf );
|
|
|
|
else
|
|
|
|
rInf.SetFull(sal_True);
|
2000-09-18 23:08:29 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
SwLinePortion *pPor = NewPortion( rInf );
|
2002-01-11 13:59:18 +00:00
|
|
|
|
2002-12-04 08:48:20 +00:00
|
|
|
// Asian grid stuff
|
2002-02-05 15:50:43 +00:00
|
|
|
GETGRID( pFrm->FindPageFrm() )
|
2002-02-07 10:20:40 +00:00
|
|
|
const sal_Bool bHasGrid = pGrid && rInf.SnapToGrid() &&
|
2002-02-06 10:11:09 +00:00
|
|
|
GRID_LINES_CHARS == pGrid->GetGridType();
|
|
|
|
|
2008-03-07 15:27:42 +00:00
|
|
|
const SwDoc *pDoc = rInf.GetTxtFrm()->GetNode()->GetDoc();
|
2011-01-17 15:06:54 +01:00
|
|
|
const sal_uInt16 nGridWidth = bHasGrid ?
|
2008-03-07 15:27:42 +00:00
|
|
|
GETGRIDWIDTH(pGrid,pDoc) : 0; //for textgrid refactor
|
2002-01-31 13:31:03 +00:00
|
|
|
|
2002-01-16 08:50:11 +00:00
|
|
|
// used for grid mode only:
|
|
|
|
// the pointer is stored, because after formatting of non-asian text,
|
|
|
|
// the width of the kerning portion has to be adjusted
|
2002-01-11 13:59:18 +00:00
|
|
|
SwKernPortion* pGridKernPortion = 0;
|
|
|
|
|
2000-09-18 23:08:29 +00:00
|
|
|
sal_Bool bFull;
|
2001-10-02 12:51:59 +00:00
|
|
|
SwTwips nUnderLineStart = 0;
|
2000-09-18 23:08:29 +00:00
|
|
|
rInf.Y( Y() );
|
|
|
|
|
|
|
|
while( pPor && !rInf.IsStop() )
|
|
|
|
{
|
2010-11-25 17:08:45 +01:00
|
|
|
OSL_ENSURE( rInf.GetLen() < STRING_LEN &&
|
2000-09-18 23:08:29 +00:00
|
|
|
rInf.GetIdx() <= rInf.GetTxt().Len(),
|
|
|
|
"SwTxtFormatter::BuildPortions: bad length in info" );
|
2001-07-24 06:56:43 +00:00
|
|
|
|
2001-08-14 05:28:00 +00:00
|
|
|
// We have to check the script for fields in order to set the
|
|
|
|
// correct nActual value for the font.
|
2004-02-10 13:56:39 +00:00
|
|
|
if( pPor->InFldGrp() )
|
2000-09-28 12:55:03 +00:00
|
|
|
((SwFldPortion*)pPor)->CheckScript( rInf );
|
2001-07-24 06:56:43 +00:00
|
|
|
|
2002-01-31 13:31:03 +00:00
|
|
|
if( ! bHasGrid && rInf.HasScriptSpace() &&
|
2002-12-04 08:48:20 +00:00
|
|
|
rInf.GetLast() && rInf.GetLast()->InTxtGrp() &&
|
|
|
|
rInf.GetLast()->Width() && !rInf.GetLast()->InNumberGrp() )
|
2000-09-28 12:55:03 +00:00
|
|
|
{
|
2011-01-17 15:06:54 +01:00
|
|
|
sal_uInt8 nNxtActual = rInf.GetFont()->GetActual();
|
|
|
|
sal_uInt8 nLstActual = nNxtActual;
|
|
|
|
sal_uInt16 nLstHeight = (sal_uInt16)rInf.GetFont()->GetHeight();
|
2001-07-24 06:56:43 +00:00
|
|
|
sal_Bool bAllowBefore = sal_False;
|
|
|
|
sal_Bool bAllowBehind = sal_False;
|
|
|
|
const CharClass& rCC = GetAppCharClass();
|
|
|
|
|
|
|
|
// are there any punctuation characters on both sides
|
|
|
|
// of the kerning portion?
|
|
|
|
if ( pPor->InFldGrp() )
|
2000-11-24 14:47:12 +00:00
|
|
|
{
|
2001-07-24 06:56:43 +00:00
|
|
|
XubString aAltTxt;
|
|
|
|
if ( ((SwFldPortion*)pPor)->GetExpTxt( rInf, aAltTxt ) &&
|
|
|
|
aAltTxt.Len() )
|
|
|
|
{
|
|
|
|
bAllowBehind = rCC.isLetterNumeric( aAltTxt, 0 );
|
|
|
|
|
|
|
|
const SwFont* pTmpFnt = ((SwFldPortion*)pPor)->GetFont();
|
|
|
|
if ( pTmpFnt )
|
|
|
|
nNxtActual = pTmpFnt->GetActual();
|
|
|
|
}
|
2000-11-24 14:47:12 +00:00
|
|
|
}
|
2000-09-28 12:55:03 +00:00
|
|
|
else
|
2001-07-24 06:56:43 +00:00
|
|
|
bAllowBehind = rCC.isLetterNumeric( rInf.GetTxt(), rInf.GetIdx() );
|
|
|
|
|
|
|
|
const SwLinePortion* pLast = rInf.GetLast();
|
|
|
|
if ( bAllowBehind && pLast )
|
2000-11-24 14:47:12 +00:00
|
|
|
{
|
2001-07-24 06:56:43 +00:00
|
|
|
if ( pLast->InFldGrp() )
|
|
|
|
{
|
|
|
|
XubString aAltTxt;
|
|
|
|
if ( ((SwFldPortion*)pLast)->GetExpTxt( rInf, aAltTxt ) &&
|
|
|
|
aAltTxt.Len() )
|
|
|
|
{
|
|
|
|
bAllowBefore = rCC.isLetterNumeric( aAltTxt, aAltTxt.Len() - 1 );
|
|
|
|
|
|
|
|
const SwFont* pTmpFnt = ((SwFldPortion*)pLast)->GetFont();
|
|
|
|
if ( pTmpFnt )
|
|
|
|
{
|
|
|
|
nLstActual = pTmpFnt->GetActual();
|
2011-01-17 15:06:54 +01:00
|
|
|
nLstHeight = (sal_uInt16)pTmpFnt->GetHeight();
|
2001-07-24 06:56:43 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else if ( rInf.GetIdx() )
|
|
|
|
{
|
|
|
|
bAllowBefore = rCC.isLetterNumeric( rInf.GetTxt(), rInf.GetIdx() - 1 );
|
|
|
|
// Note: ScriptType returns values in [1,4]
|
|
|
|
if ( bAllowBefore )
|
|
|
|
nLstActual = pScriptInfo->ScriptType( rInf.GetIdx() - 1 ) - 1;
|
|
|
|
}
|
|
|
|
|
2000-11-24 14:47:12 +00:00
|
|
|
nLstHeight /= 5;
|
2001-06-14 07:49:47 +00:00
|
|
|
// does the kerning portion still fit into the line?
|
2001-07-24 06:56:43 +00:00
|
|
|
if( bAllowBefore && ( nLstActual != nNxtActual ) &&
|
|
|
|
nLstHeight && rInf.X() + nLstHeight <= rInf.Width() )
|
2000-09-29 12:55:44 +00:00
|
|
|
{
|
|
|
|
SwKernPortion* pKrn =
|
2001-10-09 08:56:17 +00:00
|
|
|
new SwKernPortion( *rInf.GetLast(), nLstHeight,
|
|
|
|
pLast->InFldGrp() && pPor->InFldGrp() );
|
2000-09-29 12:55:44 +00:00
|
|
|
rInf.GetLast()->SetPortion( NULL );
|
|
|
|
InsertPortion( rInf, pKrn );
|
|
|
|
}
|
2000-09-28 12:55:03 +00:00
|
|
|
}
|
|
|
|
}
|
2002-01-31 13:31:03 +00:00
|
|
|
else if ( bHasGrid && ! pGridKernPortion && ! pMulti )
|
2002-01-11 13:59:18 +00:00
|
|
|
{
|
|
|
|
// insert a grid kerning portion
|
2002-01-16 08:50:11 +00:00
|
|
|
if ( ! pGridKernPortion )
|
|
|
|
pGridKernPortion = pPor->IsKernPortion() ?
|
|
|
|
(SwKernPortion*)pPor :
|
|
|
|
new SwKernPortion( *pCurr );
|
|
|
|
|
|
|
|
// if we have a new GridKernPortion, we initially calculate
|
|
|
|
// its size so that its ends on the grid
|
|
|
|
const SwPageFrm* pPageFrm = pFrm->FindPageFrm();
|
2002-01-31 13:31:03 +00:00
|
|
|
const SwLayoutFrm* pBody = pPageFrm->FindBodyCont();
|
2002-01-16 08:50:11 +00:00
|
|
|
SWRECTFN( pPageFrm )
|
2002-01-31 13:31:03 +00:00
|
|
|
|
|
|
|
const long nGridOrigin = pBody ?
|
|
|
|
(pBody->*fnRect->fnGetPrtLeft)() :
|
|
|
|
(pPageFrm->*fnRect->fnGetPrtLeft)();
|
2002-01-16 08:50:11 +00:00
|
|
|
|
2002-01-24 12:41:56 +00:00
|
|
|
SwTwips nStartX = rInf.X() + GetLeftMargin();
|
|
|
|
if ( bVert )
|
|
|
|
{
|
|
|
|
Point aPoint( nStartX, 0 );
|
|
|
|
pFrm->SwitchHorizontalToVertical( aPoint );
|
|
|
|
nStartX = aPoint.Y();
|
|
|
|
}
|
|
|
|
|
|
|
|
const SwTwips nOfst = nStartX - nGridOrigin;
|
2002-01-16 08:50:11 +00:00
|
|
|
if ( nOfst )
|
|
|
|
{
|
2011-01-17 15:06:54 +01:00
|
|
|
const sal_uLong i = ( nOfst > 0 ) ?
|
2003-05-28 11:52:04 +00:00
|
|
|
( ( nOfst - 1 ) / nGridWidth + 1 ) :
|
|
|
|
0;
|
2002-01-16 08:50:11 +00:00
|
|
|
const SwTwips nKernWidth = i * nGridWidth - nOfst;
|
|
|
|
const SwTwips nRestWidth = rInf.Width() - rInf.X();
|
2002-01-18 08:11:53 +00:00
|
|
|
|
2002-01-16 08:50:11 +00:00
|
|
|
if ( nKernWidth <= nRestWidth )
|
2011-01-17 15:06:54 +01:00
|
|
|
pGridKernPortion->Width( (sal_uInt16)nKernWidth );
|
2002-01-16 08:50:11 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
if ( pGridKernPortion != pPor )
|
|
|
|
InsertPortion( rInf, pGridKernPortion );
|
2002-01-11 13:59:18 +00:00
|
|
|
}
|
2000-09-28 12:55:03 +00:00
|
|
|
|
2000-10-16 12:11:59 +00:00
|
|
|
// the multi-portion has it's own format function
|
2002-03-19 07:59:05 +00:00
|
|
|
if( pPor->IsMultiPortion() && ( !pMulti || pMulti->IsBidi() ) )
|
2000-10-16 12:11:59 +00:00
|
|
|
bFull = BuildMultiPortion( rInf, *((SwMultiPortion*)pPor) );
|
|
|
|
else
|
|
|
|
bFull = pPor->Format( rInf );
|
2000-09-18 23:08:29 +00:00
|
|
|
|
2000-11-06 08:20:28 +00:00
|
|
|
if( rInf.IsRuby() && !rInf.GetRest() )
|
|
|
|
bFull = sal_True;
|
|
|
|
|
2001-10-02 12:51:59 +00:00
|
|
|
// if we are underlined, we store the beginning of this underlined
|
|
|
|
// segment for repaint optimization
|
|
|
|
if ( UNDERLINE_NONE != pFnt->GetUnderline() && ! nUnderLineStart )
|
|
|
|
nUnderLineStart = GetLeftMargin() + rInf.X();
|
|
|
|
|
2001-05-28 15:20:44 +00:00
|
|
|
if ( pPor->IsFlyPortion() )
|
|
|
|
pCurr->SetFly( sal_True );
|
2001-06-13 07:32:25 +00:00
|
|
|
// some special cases, where we have to take care for the repaint
|
|
|
|
// offset:
|
2001-10-02 12:51:59 +00:00
|
|
|
// 1. Underlined portions due to special underline feature
|
|
|
|
// 2. Right Tab
|
2003-03-27 14:45:43 +00:00
|
|
|
// 3. BidiPortions
|
|
|
|
// 4. other Multiportions
|
|
|
|
// 5. DropCaps
|
|
|
|
// 6. Grid Mode
|
2001-10-02 12:51:59 +00:00
|
|
|
else if ( ( ! rInf.GetPaintOfst() || nUnderLineStart < rInf.GetPaintOfst() ) &&
|
|
|
|
// 1. Underlined portions
|
|
|
|
nUnderLineStart &&
|
|
|
|
// reformat is at end of an underlined portion and next portion
|
|
|
|
// is not underlined
|
|
|
|
( ( rInf.GetReformatStart() == rInf.GetIdx() &&
|
|
|
|
UNDERLINE_NONE == pFnt->GetUnderline()
|
|
|
|
) ||
|
|
|
|
// reformat is inside portion and portion is underlined
|
|
|
|
( rInf.GetReformatStart() >= rInf.GetIdx() &&
|
|
|
|
rInf.GetReformatStart() <= rInf.GetIdx() + pPor->GetLen() &&
|
|
|
|
UNDERLINE_NONE != pFnt->GetUnderline() ) ) )
|
|
|
|
rInf.SetPaintOfst( nUnderLineStart );
|
2001-06-13 07:32:25 +00:00
|
|
|
else if ( ! rInf.GetPaintOfst() &&
|
2001-10-02 12:51:59 +00:00
|
|
|
// 2. Right Tab
|
2001-06-13 07:32:25 +00:00
|
|
|
( ( pPor->InTabGrp() && !pPor->IsTabLeftPortion() ) ||
|
2003-03-27 14:45:43 +00:00
|
|
|
// 3. BidiPortions
|
|
|
|
( pPor->IsMultiPortion() && ((SwMultiPortion*)pPor)->IsBidi() ) ||
|
|
|
|
// 4. Multi Portion and 5. Drop Caps
|
|
|
|
( ( pPor->IsDropPortion() || pPor->IsMultiPortion() ) &&
|
2001-06-13 07:32:25 +00:00
|
|
|
rInf.GetReformatStart() >= rInf.GetIdx() &&
|
2002-01-25 14:55:59 +00:00
|
|
|
rInf.GetReformatStart() <= rInf.GetIdx() + pPor->GetLen() )
|
2003-03-27 14:45:43 +00:00
|
|
|
// 6. Grid Mode
|
2002-01-31 13:31:03 +00:00
|
|
|
|| ( bHasGrid && SW_CJK != pFnt->GetActual() )
|
2001-06-13 07:32:25 +00:00
|
|
|
)
|
|
|
|
)
|
|
|
|
// we store the beginning of the critical portion as our
|
2001-06-08 12:16:51 +00:00
|
|
|
// paint offset
|
|
|
|
rInf.SetPaintOfst( GetLeftMargin() + rInf.X() );
|
2000-09-18 23:08:29 +00:00
|
|
|
|
2001-10-02 12:51:59 +00:00
|
|
|
// under one of these conditions we are allowed to delete the
|
|
|
|
// start of the underline portion
|
|
|
|
if ( IsUnderlineBreak( *pPor, *pFnt ) )
|
|
|
|
nUnderLineStart = 0;
|
|
|
|
|
2001-02-01 13:05:11 +00:00
|
|
|
if( pPor->IsFlyCntPortion() || ( pPor->IsMultiPortion() &&
|
|
|
|
((SwMultiPortion*)pPor)->HasFlyInCntnt() ) )
|
2000-09-18 23:08:29 +00:00
|
|
|
SetFlyInCntBase();
|
|
|
|
// 5964: bUnderFlow muss zurueckgesetzt werden, sonst wird beim
|
|
|
|
// naechsten Softhyphen wieder umgebrochen!
|
|
|
|
if ( !bFull )
|
2000-09-27 10:53:31 +00:00
|
|
|
{
|
2000-09-18 23:08:29 +00:00
|
|
|
rInf.ClrUnderFlow();
|
2002-01-31 13:31:03 +00:00
|
|
|
if( ! bHasGrid && rInf.HasScriptSpace() && pPor->InTxtGrp() &&
|
2000-11-24 14:47:12 +00:00
|
|
|
pPor->GetLen() && !pPor->InFldGrp() )
|
2000-09-27 10:53:31 +00:00
|
|
|
{
|
2000-11-24 14:47:12 +00:00
|
|
|
// The distance between two different scripts is set
|
|
|
|
// to 20% of the fontheight.
|
2001-07-24 06:56:43 +00:00
|
|
|
xub_StrLen nTmp = rInf.GetIdx() + pPor->GetLen();
|
2001-04-26 09:37:23 +00:00
|
|
|
if( nTmp == pScriptInfo->NextScriptChg( nTmp - 1 ) &&
|
|
|
|
nTmp != rInf.GetTxt().Len() )
|
2000-09-29 12:55:44 +00:00
|
|
|
{
|
2011-01-17 15:06:54 +01:00
|
|
|
sal_uInt16 nDist = (sal_uInt16)(rInf.GetFont()->GetHeight()/5);
|
2001-06-14 07:49:47 +00:00
|
|
|
|
2000-09-29 12:55:44 +00:00
|
|
|
if( nDist )
|
2001-06-14 07:49:47 +00:00
|
|
|
{
|
2001-07-24 06:56:43 +00:00
|
|
|
// we do not want a kerning portion if any end
|
|
|
|
// would be a punctuation character
|
|
|
|
const CharClass& rCC = GetAppCharClass();
|
|
|
|
if ( rCC.isLetterNumeric( rInf.GetTxt(), nTmp - 1 ) &&
|
|
|
|
rCC.isLetterNumeric( rInf.GetTxt(), nTmp ) )
|
|
|
|
{
|
|
|
|
// does the kerning portion still fit into the line?
|
|
|
|
if ( rInf.X() + pPor->Width() + nDist <= rInf.Width() )
|
|
|
|
new SwKernPortion( *pPor, nDist );
|
|
|
|
else
|
|
|
|
bFull = sal_True;
|
|
|
|
}
|
2001-06-14 07:49:47 +00:00
|
|
|
}
|
2000-09-29 12:55:44 +00:00
|
|
|
}
|
2000-09-27 10:53:31 +00:00
|
|
|
}
|
|
|
|
}
|
2000-09-18 23:08:29 +00:00
|
|
|
|
2002-01-31 13:31:03 +00:00
|
|
|
if ( bHasGrid && pPor != pGridKernPortion && ! pMulti )
|
2002-01-11 13:59:18 +00:00
|
|
|
{
|
|
|
|
xub_StrLen nTmp = rInf.GetIdx() + pPor->GetLen();
|
2002-01-25 14:55:59 +00:00
|
|
|
const SwTwips nRestWidth = rInf.Width() - rInf.X() - pPor->Width();
|
2002-01-11 13:59:18 +00:00
|
|
|
|
2011-01-17 15:06:54 +01:00
|
|
|
const sal_uInt8 nCurrScript = pFnt->GetActual(); // pScriptInfo->ScriptType( rInf.GetIdx() );
|
|
|
|
const sal_uInt8 nNextScript = nTmp >= rInf.GetTxt().Len() ?
|
2002-01-25 14:55:59 +00:00
|
|
|
SW_CJK :
|
2003-10-30 09:19:49 +00:00
|
|
|
SwScriptInfo::WhichFont( nTmp, 0, pScriptInfo );
|
2002-01-16 08:50:11 +00:00
|
|
|
|
|
|
|
// snap non-asian text to grid if next portion is ASIAN or
|
|
|
|
// there are no more portions in this line
|
2002-01-24 12:41:56 +00:00
|
|
|
// be careful when handling an underflow event: the gridkernportion
|
|
|
|
// could have been deleted
|
2002-01-25 14:55:59 +00:00
|
|
|
if ( nRestWidth > 0 && SW_CJK != nCurrScript &&
|
|
|
|
! rInf.IsUnderFlow() && ( bFull || SW_CJK == nNextScript ) )
|
2002-01-11 13:59:18 +00:00
|
|
|
{
|
2010-11-25 17:08:45 +01:00
|
|
|
OSL_ENSURE( pGridKernPortion, "No GridKernPortion available" );
|
2002-01-16 08:50:11 +00:00
|
|
|
|
2002-01-11 13:59:18 +00:00
|
|
|
// calculate size
|
2002-01-16 08:50:11 +00:00
|
|
|
SwLinePortion* pTmpPor = pGridKernPortion->GetPortion();
|
2011-01-17 15:06:54 +01:00
|
|
|
sal_uInt16 nSumWidth = pPor->Width();
|
2002-01-11 13:59:18 +00:00
|
|
|
while ( pTmpPor )
|
|
|
|
{
|
2007-09-27 08:14:21 +00:00
|
|
|
nSumWidth = nSumWidth + pTmpPor->Width();
|
2002-01-11 13:59:18 +00:00
|
|
|
pTmpPor = pTmpPor->GetPortion();
|
|
|
|
}
|
|
|
|
|
2011-01-17 15:06:54 +01:00
|
|
|
const sal_uInt16 i = nSumWidth ?
|
2002-01-18 08:11:53 +00:00
|
|
|
( nSumWidth - 1 ) / nGridWidth + 1 :
|
2002-01-24 12:41:56 +00:00
|
|
|
0;
|
2002-01-16 08:50:11 +00:00
|
|
|
const SwTwips nTmpWidth = i * nGridWidth;
|
|
|
|
const SwTwips nKernWidth = Min( (SwTwips)(nTmpWidth - nSumWidth),
|
|
|
|
nRestWidth );
|
2011-01-17 15:06:54 +01:00
|
|
|
const sal_uInt16 nKernWidth_1 = (sal_uInt16)(nKernWidth / 2);
|
2002-01-11 13:59:18 +00:00
|
|
|
|
2010-11-25 17:08:45 +01:00
|
|
|
OSL_ENSURE( nKernWidth <= nRestWidth,
|
|
|
|
"Not enough space left for adjusting non-asian text in grid mode" );
|
2002-01-11 13:59:18 +00:00
|
|
|
|
2002-01-16 08:50:11 +00:00
|
|
|
pGridKernPortion->Width( pGridKernPortion->Width() + nKernWidth_1 );
|
|
|
|
rInf.X( rInf.X() + nKernWidth_1 );
|
|
|
|
|
2002-01-16 11:29:32 +00:00
|
|
|
if ( ! bFull )
|
2003-05-28 11:52:04 +00:00
|
|
|
new SwKernPortion( *pPor, (short)(nKernWidth - nKernWidth_1),
|
2002-01-16 11:29:32 +00:00
|
|
|
sal_False, sal_True );
|
2002-01-11 13:59:18 +00:00
|
|
|
|
|
|
|
pGridKernPortion = 0;
|
|
|
|
}
|
2002-01-25 14:55:59 +00:00
|
|
|
else if ( pPor->IsMultiPortion() || pPor->InFixMargGrp() ||
|
|
|
|
pPor->IsFlyCntPortion() || pPor->InNumberGrp() ||
|
2002-03-19 07:59:05 +00:00
|
|
|
pPor->InFldGrp() || nCurrScript != nNextScript )
|
2002-01-16 08:50:11 +00:00
|
|
|
// next portion should snap to grid
|
|
|
|
pGridKernPortion = 0;
|
2002-01-11 13:59:18 +00:00
|
|
|
}
|
|
|
|
|
2001-06-14 07:49:47 +00:00
|
|
|
rInf.SetFull( bFull );
|
|
|
|
|
2000-09-18 23:08:29 +00:00
|
|
|
// Restportions von mehrzeiligen Feldern haben bisher noch
|
|
|
|
// nicht den richtigen Ascent.
|
|
|
|
if ( !pPor->GetLen() && !pPor->IsFlyPortion()
|
2002-05-30 11:44:26 +00:00
|
|
|
&& !pPor->IsGrfNumPortion() && ! pPor->InNumberGrp()
|
|
|
|
&& !pPor->IsMultiPortion() )
|
2000-09-18 23:08:29 +00:00
|
|
|
CalcAscent( rInf, pPor );
|
|
|
|
|
|
|
|
InsertPortion( rInf, pPor );
|
|
|
|
pPor = NewPortion( rInf );
|
|
|
|
}
|
|
|
|
|
|
|
|
if( !rInf.IsStop() )
|
|
|
|
{
|
|
|
|
// der letzte rechte, zentrierte, dezimale Tab
|
|
|
|
SwTabPortion *pLastTab = rInf.GetLastTab();
|
|
|
|
if( pLastTab )
|
|
|
|
pLastTab->FormatEOL( rInf );
|
2001-04-09 09:44:17 +00:00
|
|
|
else if( rInf.GetLast() && rInf.LastKernPortion() )
|
2000-09-18 23:08:29 +00:00
|
|
|
rInf.GetLast()->FormatEOL( rInf );
|
|
|
|
}
|
|
|
|
if( pCurr->GetPortion() && pCurr->GetPortion()->InNumberGrp()
|
|
|
|
&& ((SwNumberPortion*)pCurr->GetPortion())->IsHide() )
|
|
|
|
rInf.SetNumDone( sal_False );
|
|
|
|
|
|
|
|
// 3260, 3860: Fly auf jeden Fall loeschen!
|
|
|
|
ClearFly( rInf );
|
2011-10-31 17:39:16 +01:00
|
|
|
|
|
|
|
// Reinit the tab overflow flag after the line
|
|
|
|
rInf.SetTabOverflow( sal_False );
|
2000-09-18 23:08:29 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
* SwTxtFormatter::CalcAdjustLine()
|
|
|
|
*************************************************************************/
|
|
|
|
|
2007-09-27 08:14:21 +00:00
|
|
|
void SwTxtFormatter::CalcAdjustLine( SwLineLayout *pCurrent )
|
2000-09-18 23:08:29 +00:00
|
|
|
{
|
2000-10-17 09:30:03 +00:00
|
|
|
if( SVX_ADJUST_LEFT != GetAdjust() && !pMulti)
|
2000-09-18 23:08:29 +00:00
|
|
|
{
|
2007-09-27 08:14:21 +00:00
|
|
|
pCurrent->SetFormatAdj(sal_True);
|
2000-09-18 23:08:29 +00:00
|
|
|
if( IsFlyInCntBase() )
|
|
|
|
{
|
2007-09-27 08:14:21 +00:00
|
|
|
CalcAdjLine( pCurrent );
|
2000-09-18 23:08:29 +00:00
|
|
|
// 23348: z.B. bei zentrierten Flys muessen wir den RefPoint
|
|
|
|
// auf jeden Fall umsetzen, deshalb bAllWays = sal_True
|
2007-09-27 08:14:21 +00:00
|
|
|
UpdatePos( pCurrent, GetTopLeft(), GetStart(), sal_True );
|
2000-09-18 23:08:29 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
* SwTxtFormatter::CalcAscent()
|
|
|
|
*************************************************************************/
|
|
|
|
|
|
|
|
void SwTxtFormatter::CalcAscent( SwTxtFormatInfo &rInf, SwLinePortion *pPor )
|
|
|
|
{
|
|
|
|
if ( pPor->InFldGrp() && ((SwFldPortion*)pPor)->GetFont() )
|
|
|
|
{
|
|
|
|
// Numerierungen + InterNetFlds koennen einen eigenen Font beinhalten,
|
|
|
|
// dann ist ihre Groesse unabhaengig von harten Attributierungen.
|
|
|
|
SwFont* pFldFnt = ((SwFldPortion*)pPor)->pFnt;
|
|
|
|
SwFontSave aSave( rInf, pFldFnt );
|
2003-10-15 08:56:16 +00:00
|
|
|
((SwFldPortion*)pPor)->Height( pFldFnt->GetHeight( rInf.GetVsh(), *rInf.GetOut() ) );
|
|
|
|
((SwFldPortion*)pPor)->SetAscent( pFldFnt->GetAscent( rInf.GetVsh(), *rInf.GetOut() ) );
|
2000-09-18 23:08:29 +00:00
|
|
|
}
|
2011-04-16 22:42:13 -03:00
|
|
|
// #i89179#
|
2008-07-08 07:25:47 +00:00
|
|
|
// tab portion representing the list tab of a list label gets the
|
|
|
|
// same height and ascent as the corresponding number portion
|
|
|
|
else if ( pPor->InTabGrp() && pPor->GetLen() == 0 &&
|
|
|
|
rInf.GetLast() && rInf.GetLast()->InNumberGrp() &&
|
|
|
|
static_cast<const SwNumberPortion*>(rInf.GetLast())->HasFont() )
|
|
|
|
{
|
|
|
|
const SwLinePortion* pLast = rInf.GetLast();
|
|
|
|
pPor->Height( pLast->Height() );
|
|
|
|
pPor->SetAscent( pLast->GetAscent() );
|
|
|
|
}
|
2000-09-18 23:08:29 +00:00
|
|
|
else
|
|
|
|
{
|
|
|
|
const SwLinePortion *pLast = rInf.GetLast();
|
|
|
|
sal_Bool bChg;
|
|
|
|
|
|
|
|
// Fallunterscheidung: in leeren Zeilen werden die Attribute
|
|
|
|
// per SeekStart angeschaltet.
|
|
|
|
const sal_Bool bFirstPor = rInf.GetLineStart() == rInf.GetIdx();
|
|
|
|
if ( pPor->IsQuoVadisPortion() )
|
|
|
|
bChg = SeekStartAndChg( rInf, sal_True );
|
|
|
|
else
|
|
|
|
{
|
|
|
|
if( bFirstPor )
|
|
|
|
{
|
|
|
|
if( rInf.GetTxt().Len() )
|
|
|
|
{
|
|
|
|
if ( pPor->GetLen() || !rInf.GetIdx()
|
|
|
|
|| ( pCurr != pLast && !pLast->IsFlyPortion() )
|
|
|
|
|| !pCurr->IsRest() ) // statt !rInf.GetRest()
|
|
|
|
bChg = SeekAndChg( rInf );
|
|
|
|
else
|
|
|
|
bChg = SeekAndChgBefore( rInf );
|
|
|
|
}
|
2002-08-07 10:21:57 +00:00
|
|
|
else if ( pMulti )
|
|
|
|
// do not open attributes starting at 0 in empty multi
|
|
|
|
// portions (rotated numbering followed by a footnote
|
|
|
|
// can cause trouble, because the footnote attribute
|
|
|
|
// starts at 0, but if we open it, the attribute handler
|
|
|
|
// cannot handle it.
|
|
|
|
bChg = sal_False;
|
2000-09-18 23:08:29 +00:00
|
|
|
else
|
|
|
|
bChg = SeekStartAndChg( rInf );
|
|
|
|
}
|
|
|
|
else
|
|
|
|
bChg = SeekAndChg( rInf );
|
|
|
|
}
|
|
|
|
if( bChg || bFirstPor || !pPor->GetAscent()
|
|
|
|
|| !rInf.GetLast()->InTxtGrp() )
|
|
|
|
{
|
|
|
|
pPor->SetAscent( rInf.GetAscent() );
|
|
|
|
pPor->Height( rInf.GetTxtHeight() );
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
pPor->Height( pLast->Height() );
|
|
|
|
pPor->SetAscent( pLast->GetAscent() );
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
CWS-TOOLING: integrate CWS odfmetadata3
2009-09-11 Michael Stahl merge DEV300_m58
2009-09-07 Michael Stahl SwFmtFld::Modify(): do nothing on RES_OBJECTDYING
2009-08-27 Michael Stahl #i91565#, #i91566#: TextPortionEnumerationTest.java: add test document
2009-08-27 Michael Stahl #i91565#, #i91566#: add complex test: TextPortionEnumerationTest.java
2009-08-27 Michael Stahl CLiteral::initialize(): zero-length literals probably not an error
2009-08-27 Michael Stahl #i91565#, #i91566#: offapi: new InContentMetadata and MetadataField services
adapt TextPortion for InContentMetadata
2009-08-27 Michael Stahl #i91564#: xmloff: load/store xml:id and RDFa for text:bookmark(-start).
2009-08-27 Michael Stahl #i91564#: sw core: add support for xml:id at bookmarks:
sw::mark::Bookmark: derive from Metadatable.
SwHistoryBookmark, SaveBookmark: store a MetadatableUndo.
ndcopy.cxx: lcl_CopyBookmarks(): copy the xml:id.
SwXBookmark: derive from MetadatableMixin.
2009-08-27 Michael Stahl #i91565#, #i91566#: xmloff: refactor ruby import so nested meta(-field) works:
remove XMLRubyHint_Impl.
XMLImpRubyContext_Impl::~XMLImpRubyContext_Impl(): insert ruby directly.
2009-08-27 Michael Stahl #i91565#, #i91566#: xmloff: fix text:meta(-field) import/export:
new XMLTextParagraphExport::exportTextField() overload for XTextField.
CreateAndInsertMark(): set xml:id after insertion.
fix meta(-field) service names, bugs etc.
2009-08-27 Michael Stahl #i91565#, #i91566#: sw text formatting: paint background of meta(-field) body:
SwFont: add member m_nMetaCount.
txttypes.hxx: add POR_META.
atrstck.cxx: handle RES_TXTATR_META(FIELD).
itrform2.cxx: SwTxtFormatter::WhichTxtPor(): create new class SwMetaPortion.
2009-08-27 Michael Stahl #i91566#: sw text formatting: display meta-field prefix and suffix:
SwAttrIter::GetAttr(): replace with call to GetTxtAttrForCharAt().
SwTxtFormatter::NewExtraPortion(): handle meta-field prefix.
SwTxtFormatter: new member m_nHintEndIndex.
SwTxtFormatter::WhichFirstPortion(): call TryNewNoLengthPortion().
SwTxtFormatter::TryNewNoLengthPortion(): new; handle suffix of meta-field.
SwTxtFormatter::UnderFlow(): UGLY HACK: decrement m_nHintEndIndex.
SwFldPortion: add flag m_bNoLength: portion has zero length (for suffix).
2009-08-27 Michael Stahl #i91565#, #i91566#: extend text:meta(-field) uno wrapper with XText interface:
unoobj.hxx: new CursorType CURSOR_META.
unoobj2.cxx: refactor SwXText implementation to ensure that when the SwXText
belongs to a SwXMeta, content is always inserted inside the meta(-field).
unoobj.cxx: new SwXTextCursor::ForceIntoMeta(): cursor stays in meta(-field).
unometa.hxx: SwXMeta implements XText, forwarding to a member SwXMetaText.
DocInsertStringSplitCR(), SwX*::attachToRange(), SwX*::DeleteAndInsert():
use FORCEHINTEXPAND hack to ensure insert into the meta(-field) at the end.
2009-08-27 Michael Stahl #i91565#, #i91566#: add text:meta(-field) uno wrapper to sw:
fmtmeta.hxx, fmtatr2.cxx: new class sw::MetaField, new sw::MetaFieldManager.
doc.hxx, docnew.cxx: new SwDoc::GetMetaFieldManager().
unocoll.hxx,.cxx: new SW_SERVICE_FIELDTYPE_METAFIELD, SW_SERVICE_TYPE_META.
unomap.hxx,.cxx: new PROPERTY_MAP_METAFIELD.
unoprnms.hxx: new UNO_NAME_META.
unoport.hxx: new PORTION_META; add "InContentMetadata" prop to SwXTextPortion.
new unometa.hxx: new class SwXMeta and SwXMetaField.
unofield.cxx: SwXFieldEnumeration: include meta-fields.
unoportenum.cxx: handle RES_TXTATR_META(FIELD) by using a portion list stack.
unotext.cxx: SwXText::insertTextContent(): handle meta(-field) as attribute.
2009-08-27 Michael Stahl #i91565#, #i91566#: ndhints.cxx: remove sort number from SwTxtAttrNesting
2009-08-27 Michael Stahl #i91565#, #i91566#: add support for hints with end and CH_TXTATR to sw core:
doc.hxx, docedt.cxx: replace SwDoc::Delete(), DeleteAndJoin(), ReplaceRange()
with wrappers that split at left-overlapped end+CH_TXTATR hints.
txatbase.hxx: new member SwTxtAttr::m_bHasDummyChar.
ndtxt.hxx: rename SwTxtNode::GetTxtAttr() to GetTxtAttrForCharAt().
ndtxt.cxx: SwTxtNode::CopyText(): copy end+CH_TXTATR hints iff copy CH_TXTATR.
txtatr2.cxx, thints.cxx: SwTxtMeta gets a CH_TXTATR.
2009-08-27 Michael Stahl #i91565#, #i91566#: add text:meta(-field) to sw core:
txatbase.hxx: new member SwTxtAttr::m_bNesting.
hintids.hxx: new ids RES_TXTATR_META, RES_TXTATR_METAFIELD.
txtatr.hxx: new base class SwTxtAttrNesting.
new hint SwTxtMeta.
SwTxtRuby derives from SwTxtAttrNesting.
txtinet.hxx: SwTxtINetFmt derives from SwTxtAttrNesting.
new header fmtmeta.hxx: new pool item SwFmtMeta. new class sw::Meta.
ndhints.hxx, thints.cxx: new method SwpHints::TryInsertNesting().
thints.cxx: refactoring: BuildPortions() no longer handles Ruby/Hyperlink,
but TryInsertNesting(), which also handles meta(-field).
SwTxtNode::InsertItem(): check if the hint is actually inserted.
ndhints.cxx: sort nesting hints based on sort number.
ndtxt.cxx: lcl_CopyHint(): handle copy of meta/meta-field.
2009-08-27 Michael Stahl enable expanding hints with m_bLockExpandFlag set:
add new InsertFlag: INS_FORCEHINTEXPAND.
add new SetAttrMode: SETATTR_FORCEHINTEXPAND.
rename SwEditShell::Insert() to Insert2() because changed signature fails
to compile when SwWrtShell tries to overwrite these non-virtual members...
SwWrtShell::Insert() sets FOCEHINTEXPAND if range was selected/deleted.
adapt SwUndoInsert to store flags.
2009-08-27 Michael Stahl change formal parameters of item insertion methods to type SetAttrMode
2009-08-27 Michael Stahl fix incorrect resetting of text attributes in SwUndoInsSection, SwUndoInserts
2009-08-27 Michael Stahl clean up SwTxtNode::CutImpl() and lcl_CopyHint()
2009-08-27 Michael Stahl rename SwDoc::Copy() to CopyRange(), and _Copy() to CopyImpl()
2009-08-27 Michael Stahl rename SwNodes::Move() to MoveRange(), and remove unused parameter
2009-08-27 Michael Stahl rename SwDoc::Move() to MoveRange()/MoveNodeRange()
2009-08-27 Michael Stahl rename SwDoc::Insert() to InsertString(), and remove sal_Unicode variant
2009-08-27 Michael Stahl rename SwDoc::Insert() to InsertPoolItem()/InsertItemSet()/InsertSwSection()
2009-08-27 Michael Stahl rename SwDoc::Replace() to ReplaceRange()
2009-08-27 Michael Stahl remove SwDoc::Overwrite() sal_Unicode variant
2009-08-27 Michael Stahl split up SwDoc::DeleteAndJoin(): factor out DeleteAndJoinWithRedline()
2009-08-27 Michael Stahl rename overloaded SwDoc::Delete() to DeleteRange()/DeleteTOXMark()
2009-08-27 Michael Stahl rename SwTxtNode::Copy() to CopyText()
2009-08-27 Michael Stahl rename SwTxtNode::Cut() to CutText(), and _Cut() to CutImpl()
2009-08-27 Michael Stahl rename SwTxtNode::Delete() to DeleteAttribute()/DeleteAttributes()
2009-08-27 Michael Stahl rename SwTxtNode::Replace() to ReplaceText(), and remove the xub_Unicode variant
2009-08-27 Michael Stahl rename SwTxtNode::Erase() to EraseText()
2009-08-27 Michael Stahl rename SwTxtNode::Insert() to InsertText(), and remove the xub_Unicode variant
2009-08-27 Michael Stahl clean up SwTxtNode::Update()
2009-08-27 Michael Stahl remove SwTxtAttr::RemoveFromPool() and make destructor non-public,
to be invoked by new method SwTxtAttr::Destroy()
2009-08-27 Michael Stahl ensure that SwDoc::Insert() for item (set) returns success indicator:
replace SwRegHistory constructor with method InsertItems(), returning bool.
refactor InsAttr() so that it checks if InsertItems() succeeds.
2009-08-27 Michael Stahl move SwXTextPortionEnumeration from unoobj.hxx to unoport.hxx
2009-08-27 Michael Stahl add missing SolarMutex in SwXTextPortion methods
2009-08-27 Michael Stahl SwXTextPortion: new member m_xTextField (so the TextField property need not
be returned indirectly via SwUnoCursorHelper).
factor out function CreateSwXTextField().
2009-08-27 Michael Stahl SwXTextPortion: remove PORTION_CONTROL_CHAR and implementation of XTextField
2009-08-27 Michael Stahl remove obsolete hint SwTxtHardBlank and formats SwFmtHardBlank/SwFmtSoftHyph
2009-08-27 Michael Stahl clean up SwTxtAttr and friends:
remove many accessor methods for obsolete (due to autofmt) char format items.
remove unused flag SwTxtAttr::m_bDontMergeAttr.
MakeRedlineTxtAttr() now dedicated function, no longer calls MakeTxtAttr().
2009-08-27 Michael Stahl remove obsolete attribute SwTxt2Lines
2009-08-27 Michael Stahl SwXTextPortionEnumeration: finish refactoring CreatePortions
change ExportHints so it always returns a text portion for hint w/ CH_TXTATR.
remove special case for handling end of paragraph.
unfortunately had to refactor the fieldmarks export as well (got in the way).
2009-08-27 Michael Stahl SwXTextPortionEnumeration: refactor CreatePortions: frames export
extract function ExportFrames() from CreatePortions().
remove (un)dead code that calls evil MovePara(fnParaCurr, fnParaEnd)
2009-08-27 Michael Stahl clean up SwXParaFrameEnumeration
2009-08-27 Michael Stahl CollectFrameAtNode: replace SwDependArr with STL based FrameDependList_t
2009-08-27 Michael Stahl SwXTextPortionEnumeration: tweak refmark/toxmark export
so ExportHints returns the portion for point marks
2009-08-27 Michael Stahl clean up SwXTextPortionEnumeration:
prefix members, remove casts, replace SvWeirdArray with STL, etc.
make CreatePortions() method a function, and remove lots of members.
extract fieldmarks function from CreatePortions.
2009-08-27 Michael Stahl remove FOREACHUNOPAM_START/END macros
2009-08-27 Michael Stahl clean up SwXTextPortion:
prefix members, remove casts, etc.
remove SwXRubyPortion: replace it with another SwXTextPortion constructor
2009-08-27 Michael Stahl #i102541# SwXReferenceMark::InsertRefMark(): use flag SETATTR_DONTEXPAND
2009-08-27 Michael Stahl rename SwTxtNode::Insert to SwTxtNode::InsertHint, and
fix constness in SwTxtNode::InsertItem
2009-08-27 Michael Stahl turn SwTxtNode::MakeTxtAttr() methods into global functions in ndhints.hxx
2009-08-27 Michael Stahl remove obsolete sw/inc/bookmrk.hxx
2009-08-27 Michael Stahl pam.cxx: fix ComparePosition functions (returned wrong result in one case)
2009-08-27 Michael Stahl #i103613# only import RDF metadata on normal open of a document
2009-09-11 kz CWS-TOOLING: integrate CWS impress176
2009-09-08 20:18:24 +0200 sj r275957 : fixed warning (shadowed variable)
2009-09-08 18:02:05 +0200 cl r275948 : #i104315# added missing tab pages
2009-09-08 17:35:18 +0200 cl r275947 : #i104866# fixed angle import
2009-09-08 17:32:53 +0200 cl r275946 : #i104841# fixed angle import
2009-09-08 17:01:25 +0200 cl r275943 : #i103935# fixed the SID_EVENTCONFIG mess
2009-09-08 14:32:57 +0200 sj r275928 : #i104685# only comments
2009-09-07 12:37:36 +0200 sj r275886 : #i104683# fixed import of bold/italic attributes for normal text shapes
2009-09-04 15:07:46 +0200 sj r275808 : #104689# fixed bullet color problem
2009-09-03 15:25:07 +0200 sj r275753 : #160200# added vertical alignment of table cells
2009-09-11 kz CWS-TOOLING: integrate CWS dv14
2009-09-10 15:16:32 +0200 sg r276035 : #160513# updated wfs scheme to accept ports
2009-09-10 07:41:47 +0200 dv r276019 : #i104942# Better renaming algorithmen
2009-08-31 13:41:11 +0200 dv r275604 : #160505# Setting APP1PRODUCTNAME must not overwrite APP1PRODUCTDEF
2009-09-11 kz CWS-TOOLING: integrate CWS jl131
2009-09-02 16:42:40 +0200 jl r275720 : #i97896#
2009-08-31 13:01:53 +0200 jl r275599 : CWS-TOOLING: rebase CWS jl131 to trunk@275331 (milestone: DEV300:m56)
2009-07-31 14:35:30 +0200 jl r274531 : CWS-TOOLING: rebase CWS jl131 to trunk@274203 (milestone: DEV300:m53)
2009-07-23 14:20:32 +0200 jl r274272 : #i79839# better error text when trying to modify shared layer without having write permission, eg. unopkg add --shared, unopkg remove --shared, unopkg reinstall --shared
2009-07-22 16:38:02 +0200 jl r274252 : #i97896# localize error message for lock file
2009-07-22 16:37:22 +0200 jl r274251 : #i80462# unprecise wording in updatedialog
2009-07-22 16:36:06 +0200 jl r274250 : #i97896# localize error message for lock file
2009-07-22 16:35:20 +0200 jl r274249 : #i97896# localize error message for lock file
2009-07-22 15:07:30 +0200 jl r274242 : #i98873# minimum java version is 1.5 since OOo 3.0
2009-09-11 kz CWS-TOOLING: integrate CWS changehc
2009-08-31 19:38:50 +0200 pl r275633 : remove dbug printf
2009-08-31 17:41:50 +0200 pl r275623 : CWS-TOOLING: rebase CWS changehc to trunk@275331 (milestone: DEV300:m56)
2009-07-15 19:45:46 +0200 pl r274028 : #i35482# use HC flag to decide high contrast mode
2009-07-15 17:40:52 +0200 pl r274020 : #i35482# use HC flag to decide high contrast mode
2009-07-15 17:39:50 +0200 pl r274019 : #i35482# update autohc correctly in MergeSystemSettings
2009-07-15 17:38:57 +0200 pl r274018 : #i35482# update autohc correctly in MergeSystemSettings
2009-09-11 kz CWS-TOOLING: integrate CWS notes10
2009-08-24 07:25:57 +0200 mod r275287 : 2009-07-26 02:38:32 +0200 mod r274343 : #i#i103645#
2009-07-26 02:01:53 +0200 mod r274342 : #i103645#
2009-07-26 01:52:42 +0200 mod r274341 : #i103490#
2009-07-22 08:31:48 +0200 mod r274215 : #i103373#
2009-07-15 00:55:11 +0200 mod r273987 : #i101419#
2009-07-14 07:07:55 +0200 mod r273956 : #i101419#
2009-07-14 07:07:43 +0200 mod r273955 : #i101419#
2009-07-14 07:02:10 +0200 mod r273954 : changes from notes9
2009-07-14 06:14:25 +0200 mod r273953 : #i103476#
2009-09-11 kz CWS-TOOLING: integrate CWS ab70
2009-09-10 15:12:54 +0200 jsk r276034 : #i85434# - mandatory automatic update test
2009-09-10 15:11:06 +0200 jsk r276033 : #i85434# - mandatory automatic update test
2009-09-02 09:49:24 +0200 ab r275698 : #i85434# Dialog Import
2009-09-11 kz CWS-TOOLING: integrate CWS hb32bugs02
2009-09-02 Henning Brinkmann #i102420# revert changes
2009-08-26 Henning Brinkmann merged DEV300_m56
2009-08-19 Henning Brinkmann merged DEV300_m55
2009-08-14 Henning Brinkmann merged changes from wntmsci12
2009-08-12 Henning Brinkmann Implemented NoSpaceEdit constructor and destructor in .cxx to allow compile with debug on wntmsci12.
2009-08-12 Henning Brinkmann Added some SW_DLLPUBLIC to make compilable on wntmsci12.
2009-08-11 Henning Brinkmann #i102420# dbg_out: surround output for SwNodes with <nodes-array>.
2009-08-10 Henning Brinkmann #i102420# rewritten debug output for SwNodes.
2009-08-07 Henning Brinkmann #i102420# debug _MoveNodes: output the destination, too. Break after two iterations.
2009-08-07 Henning Brinkmann #i102420# _MoveNodes: Additionally check if destination index is inside source => false
Check if current range was already handled => loop
Debug output current range
2009-08-06 Henning Brinkmann merged DEV300_m54
2009-08-06 Henning Brinkmann added master fix
2009-08-06 Henning Brinkmann debug output for SwNodeRange
2009-08-04 Henning Brinkmann #i102844# robustness: check for NULL pointer to prevent crash
2009-08-03 Henning Brinkmann #i103475# applied patch and verified
2009-08-03 Henning Brinkmann Removed code preventing build of sw with DEBUG.
2009-09-11 convert-repo update tags
2009-09-10 kz CWS-TOOLING: integrate CWS os2port06dev300
2009-09-05 22:49:00 +0200 ydario r275858 : #i99588# applied os2port06 diff to DEV300 tree.
2009-09-10 kz CWS-TOOLING: integrate CWS mingwport23
2009-08-29 07:07:53 +0200 tono r275555 : i#104522: mingw port graphite
2009-08-29 07:07:26 +0200 tono r275554 : i#104522: mingw port printf format fix
2009-09-10 kz CWS-TOOLING: integrate CWS mh232
2009-08-26 03:52:57 +0200 mh r275385 : #i102182# FreeBSD patch
2009-08-26 03:43:20 +0200 mh r275384 : #i101333# patch for FreeBSD
2009-08-26 03:11:20 +0200 mh r275383 : #i39230
2009-08-26 03:07:51 +0200 mh r275382 : #i39230# more space for initials field
2009-08-26 02:41:19 +0200 mh r275380 : #i39230# use vos::osecurity for reading the user name
2009-08-18 22:06:00 +0200 mh r275130 : #i104243#, line ending problem with newer perl
2009-08-18 21:53:21 +0200 mh r275129 : #i39230# read initials via getpwnam
2009-08-18 21:34:05 +0200 mh r275128 : enable CAIROCANVAS for Linux and Mac, #i88613#
2009-08-17 18:02:59 +0200 mh r275067 : #i95498# make compile with gcc3
2009-09-10 kz CWS-TOOLING: integrate CWS tkr24
2009-09-07 14:31:06 +0200 is r275898 : #160081# adding NO_LICENSE_INTO_COPYRIGHT
2009-09-10 releng #i10000# change KeyMapping to SingletonRef<framework::KeyMapping>
2009-09-11 convert-repo update tags
2009-09-10 kz CWS-TOOLING: integrate CWS os2port06dev300
2009-09-05 22:49:00 +0200 ydario r275858 : #i99588# applied os2port06 diff to DEV300 tree.
2009-09-10 kz CWS-TOOLING: integrate CWS mingwport23
2009-08-29 07:07:53 +0200 tono r275555 : i#104522: mingw port graphite
2009-08-29 07:07:26 +0200 tono r275554 : i#104522: mingw port printf format fix
2009-09-10 kz CWS-TOOLING: integrate CWS mh232
2009-08-26 03:52:57 +0200 mh r275385 : #i102182# FreeBSD patch
2009-08-26 03:43:20 +0200 mh r275384 : #i101333# patch for FreeBSD
2009-08-26 03:11:20 +0200 mh r275383 : #i39230
2009-08-26 03:07:51 +0200 mh r275382 : #i39230# more space for initials field
2009-08-26 02:41:19 +0200 mh r275380 : #i39230# use vos::osecurity for reading the user name
2009-08-18 22:06:00 +0200 mh r275130 : #i104243#, line ending problem with newer perl
2009-08-18 21:53:21 +0200 mh r275129 : #i39230# read initials via getpwnam
2009-08-18 21:34:05 +0200 mh r275128 : enable CAIROCANVAS for Linux and Mac, #i88613#
2009-08-17 18:02:59 +0200 mh r275067 : #i95498# make compile with gcc3
2009-09-10 kz CWS-TOOLING: integrate CWS tkr24
2009-09-07 14:31:06 +0200 is r275898 : #160081# adding NO_LICENSE_INTO_COPYRIGHT
2009-09-10 releng #i10000# change KeyMapping to SingletonRef<framework::KeyMapping>
2009-09-11 14:29:45 +00:00
|
|
|
/*************************************************************************
|
|
|
|
* class SwMetaPortion
|
|
|
|
*************************************************************************/
|
|
|
|
|
|
|
|
class SwMetaPortion : public SwTxtPortion
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
inline SwMetaPortion() { SetWhichPor( POR_META ); }
|
|
|
|
virtual void Paint( const SwTxtPaintInfo &rInf ) const;
|
|
|
|
// OUTPUT_OPERATOR
|
|
|
|
};
|
|
|
|
|
|
|
|
//CLASSIO( SwMetaPortion )
|
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
* virtual SwMetaPortion::Paint()
|
|
|
|
*************************************************************************/
|
|
|
|
|
|
|
|
void SwMetaPortion::Paint( const SwTxtPaintInfo &rInf ) const
|
|
|
|
{
|
|
|
|
if ( Width() )
|
|
|
|
{
|
|
|
|
rInf.DrawViewOpt( *this, POR_META );
|
|
|
|
SwTxtPortion::Paint( rInf );
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2000-09-18 23:08:29 +00:00
|
|
|
/*************************************************************************
|
|
|
|
* SwTxtFormatter::WhichTxtPor()
|
|
|
|
*************************************************************************/
|
|
|
|
|
|
|
|
SwTxtPortion *SwTxtFormatter::WhichTxtPor( SwTxtFormatInfo &rInf ) const
|
|
|
|
{
|
|
|
|
SwTxtPortion *pPor = 0;
|
|
|
|
if( GetFnt()->IsTox() )
|
|
|
|
pPor = new SwToxPortion;
|
|
|
|
else
|
|
|
|
{
|
|
|
|
if( GetFnt()->IsRef() )
|
|
|
|
pPor = new SwRefPortion;
|
CWS-TOOLING: integrate CWS odfmetadata3
2009-09-11 Michael Stahl merge DEV300_m58
2009-09-07 Michael Stahl SwFmtFld::Modify(): do nothing on RES_OBJECTDYING
2009-08-27 Michael Stahl #i91565#, #i91566#: TextPortionEnumerationTest.java: add test document
2009-08-27 Michael Stahl #i91565#, #i91566#: add complex test: TextPortionEnumerationTest.java
2009-08-27 Michael Stahl CLiteral::initialize(): zero-length literals probably not an error
2009-08-27 Michael Stahl #i91565#, #i91566#: offapi: new InContentMetadata and MetadataField services
adapt TextPortion for InContentMetadata
2009-08-27 Michael Stahl #i91564#: xmloff: load/store xml:id and RDFa for text:bookmark(-start).
2009-08-27 Michael Stahl #i91564#: sw core: add support for xml:id at bookmarks:
sw::mark::Bookmark: derive from Metadatable.
SwHistoryBookmark, SaveBookmark: store a MetadatableUndo.
ndcopy.cxx: lcl_CopyBookmarks(): copy the xml:id.
SwXBookmark: derive from MetadatableMixin.
2009-08-27 Michael Stahl #i91565#, #i91566#: xmloff: refactor ruby import so nested meta(-field) works:
remove XMLRubyHint_Impl.
XMLImpRubyContext_Impl::~XMLImpRubyContext_Impl(): insert ruby directly.
2009-08-27 Michael Stahl #i91565#, #i91566#: xmloff: fix text:meta(-field) import/export:
new XMLTextParagraphExport::exportTextField() overload for XTextField.
CreateAndInsertMark(): set xml:id after insertion.
fix meta(-field) service names, bugs etc.
2009-08-27 Michael Stahl #i91565#, #i91566#: sw text formatting: paint background of meta(-field) body:
SwFont: add member m_nMetaCount.
txttypes.hxx: add POR_META.
atrstck.cxx: handle RES_TXTATR_META(FIELD).
itrform2.cxx: SwTxtFormatter::WhichTxtPor(): create new class SwMetaPortion.
2009-08-27 Michael Stahl #i91566#: sw text formatting: display meta-field prefix and suffix:
SwAttrIter::GetAttr(): replace with call to GetTxtAttrForCharAt().
SwTxtFormatter::NewExtraPortion(): handle meta-field prefix.
SwTxtFormatter: new member m_nHintEndIndex.
SwTxtFormatter::WhichFirstPortion(): call TryNewNoLengthPortion().
SwTxtFormatter::TryNewNoLengthPortion(): new; handle suffix of meta-field.
SwTxtFormatter::UnderFlow(): UGLY HACK: decrement m_nHintEndIndex.
SwFldPortion: add flag m_bNoLength: portion has zero length (for suffix).
2009-08-27 Michael Stahl #i91565#, #i91566#: extend text:meta(-field) uno wrapper with XText interface:
unoobj.hxx: new CursorType CURSOR_META.
unoobj2.cxx: refactor SwXText implementation to ensure that when the SwXText
belongs to a SwXMeta, content is always inserted inside the meta(-field).
unoobj.cxx: new SwXTextCursor::ForceIntoMeta(): cursor stays in meta(-field).
unometa.hxx: SwXMeta implements XText, forwarding to a member SwXMetaText.
DocInsertStringSplitCR(), SwX*::attachToRange(), SwX*::DeleteAndInsert():
use FORCEHINTEXPAND hack to ensure insert into the meta(-field) at the end.
2009-08-27 Michael Stahl #i91565#, #i91566#: add text:meta(-field) uno wrapper to sw:
fmtmeta.hxx, fmtatr2.cxx: new class sw::MetaField, new sw::MetaFieldManager.
doc.hxx, docnew.cxx: new SwDoc::GetMetaFieldManager().
unocoll.hxx,.cxx: new SW_SERVICE_FIELDTYPE_METAFIELD, SW_SERVICE_TYPE_META.
unomap.hxx,.cxx: new PROPERTY_MAP_METAFIELD.
unoprnms.hxx: new UNO_NAME_META.
unoport.hxx: new PORTION_META; add "InContentMetadata" prop to SwXTextPortion.
new unometa.hxx: new class SwXMeta and SwXMetaField.
unofield.cxx: SwXFieldEnumeration: include meta-fields.
unoportenum.cxx: handle RES_TXTATR_META(FIELD) by using a portion list stack.
unotext.cxx: SwXText::insertTextContent(): handle meta(-field) as attribute.
2009-08-27 Michael Stahl #i91565#, #i91566#: ndhints.cxx: remove sort number from SwTxtAttrNesting
2009-08-27 Michael Stahl #i91565#, #i91566#: add support for hints with end and CH_TXTATR to sw core:
doc.hxx, docedt.cxx: replace SwDoc::Delete(), DeleteAndJoin(), ReplaceRange()
with wrappers that split at left-overlapped end+CH_TXTATR hints.
txatbase.hxx: new member SwTxtAttr::m_bHasDummyChar.
ndtxt.hxx: rename SwTxtNode::GetTxtAttr() to GetTxtAttrForCharAt().
ndtxt.cxx: SwTxtNode::CopyText(): copy end+CH_TXTATR hints iff copy CH_TXTATR.
txtatr2.cxx, thints.cxx: SwTxtMeta gets a CH_TXTATR.
2009-08-27 Michael Stahl #i91565#, #i91566#: add text:meta(-field) to sw core:
txatbase.hxx: new member SwTxtAttr::m_bNesting.
hintids.hxx: new ids RES_TXTATR_META, RES_TXTATR_METAFIELD.
txtatr.hxx: new base class SwTxtAttrNesting.
new hint SwTxtMeta.
SwTxtRuby derives from SwTxtAttrNesting.
txtinet.hxx: SwTxtINetFmt derives from SwTxtAttrNesting.
new header fmtmeta.hxx: new pool item SwFmtMeta. new class sw::Meta.
ndhints.hxx, thints.cxx: new method SwpHints::TryInsertNesting().
thints.cxx: refactoring: BuildPortions() no longer handles Ruby/Hyperlink,
but TryInsertNesting(), which also handles meta(-field).
SwTxtNode::InsertItem(): check if the hint is actually inserted.
ndhints.cxx: sort nesting hints based on sort number.
ndtxt.cxx: lcl_CopyHint(): handle copy of meta/meta-field.
2009-08-27 Michael Stahl enable expanding hints with m_bLockExpandFlag set:
add new InsertFlag: INS_FORCEHINTEXPAND.
add new SetAttrMode: SETATTR_FORCEHINTEXPAND.
rename SwEditShell::Insert() to Insert2() because changed signature fails
to compile when SwWrtShell tries to overwrite these non-virtual members...
SwWrtShell::Insert() sets FOCEHINTEXPAND if range was selected/deleted.
adapt SwUndoInsert to store flags.
2009-08-27 Michael Stahl change formal parameters of item insertion methods to type SetAttrMode
2009-08-27 Michael Stahl fix incorrect resetting of text attributes in SwUndoInsSection, SwUndoInserts
2009-08-27 Michael Stahl clean up SwTxtNode::CutImpl() and lcl_CopyHint()
2009-08-27 Michael Stahl rename SwDoc::Copy() to CopyRange(), and _Copy() to CopyImpl()
2009-08-27 Michael Stahl rename SwNodes::Move() to MoveRange(), and remove unused parameter
2009-08-27 Michael Stahl rename SwDoc::Move() to MoveRange()/MoveNodeRange()
2009-08-27 Michael Stahl rename SwDoc::Insert() to InsertString(), and remove sal_Unicode variant
2009-08-27 Michael Stahl rename SwDoc::Insert() to InsertPoolItem()/InsertItemSet()/InsertSwSection()
2009-08-27 Michael Stahl rename SwDoc::Replace() to ReplaceRange()
2009-08-27 Michael Stahl remove SwDoc::Overwrite() sal_Unicode variant
2009-08-27 Michael Stahl split up SwDoc::DeleteAndJoin(): factor out DeleteAndJoinWithRedline()
2009-08-27 Michael Stahl rename overloaded SwDoc::Delete() to DeleteRange()/DeleteTOXMark()
2009-08-27 Michael Stahl rename SwTxtNode::Copy() to CopyText()
2009-08-27 Michael Stahl rename SwTxtNode::Cut() to CutText(), and _Cut() to CutImpl()
2009-08-27 Michael Stahl rename SwTxtNode::Delete() to DeleteAttribute()/DeleteAttributes()
2009-08-27 Michael Stahl rename SwTxtNode::Replace() to ReplaceText(), and remove the xub_Unicode variant
2009-08-27 Michael Stahl rename SwTxtNode::Erase() to EraseText()
2009-08-27 Michael Stahl rename SwTxtNode::Insert() to InsertText(), and remove the xub_Unicode variant
2009-08-27 Michael Stahl clean up SwTxtNode::Update()
2009-08-27 Michael Stahl remove SwTxtAttr::RemoveFromPool() and make destructor non-public,
to be invoked by new method SwTxtAttr::Destroy()
2009-08-27 Michael Stahl ensure that SwDoc::Insert() for item (set) returns success indicator:
replace SwRegHistory constructor with method InsertItems(), returning bool.
refactor InsAttr() so that it checks if InsertItems() succeeds.
2009-08-27 Michael Stahl move SwXTextPortionEnumeration from unoobj.hxx to unoport.hxx
2009-08-27 Michael Stahl add missing SolarMutex in SwXTextPortion methods
2009-08-27 Michael Stahl SwXTextPortion: new member m_xTextField (so the TextField property need not
be returned indirectly via SwUnoCursorHelper).
factor out function CreateSwXTextField().
2009-08-27 Michael Stahl SwXTextPortion: remove PORTION_CONTROL_CHAR and implementation of XTextField
2009-08-27 Michael Stahl remove obsolete hint SwTxtHardBlank and formats SwFmtHardBlank/SwFmtSoftHyph
2009-08-27 Michael Stahl clean up SwTxtAttr and friends:
remove many accessor methods for obsolete (due to autofmt) char format items.
remove unused flag SwTxtAttr::m_bDontMergeAttr.
MakeRedlineTxtAttr() now dedicated function, no longer calls MakeTxtAttr().
2009-08-27 Michael Stahl remove obsolete attribute SwTxt2Lines
2009-08-27 Michael Stahl SwXTextPortionEnumeration: finish refactoring CreatePortions
change ExportHints so it always returns a text portion for hint w/ CH_TXTATR.
remove special case for handling end of paragraph.
unfortunately had to refactor the fieldmarks export as well (got in the way).
2009-08-27 Michael Stahl SwXTextPortionEnumeration: refactor CreatePortions: frames export
extract function ExportFrames() from CreatePortions().
remove (un)dead code that calls evil MovePara(fnParaCurr, fnParaEnd)
2009-08-27 Michael Stahl clean up SwXParaFrameEnumeration
2009-08-27 Michael Stahl CollectFrameAtNode: replace SwDependArr with STL based FrameDependList_t
2009-08-27 Michael Stahl SwXTextPortionEnumeration: tweak refmark/toxmark export
so ExportHints returns the portion for point marks
2009-08-27 Michael Stahl clean up SwXTextPortionEnumeration:
prefix members, remove casts, replace SvWeirdArray with STL, etc.
make CreatePortions() method a function, and remove lots of members.
extract fieldmarks function from CreatePortions.
2009-08-27 Michael Stahl remove FOREACHUNOPAM_START/END macros
2009-08-27 Michael Stahl clean up SwXTextPortion:
prefix members, remove casts, etc.
remove SwXRubyPortion: replace it with another SwXTextPortion constructor
2009-08-27 Michael Stahl #i102541# SwXReferenceMark::InsertRefMark(): use flag SETATTR_DONTEXPAND
2009-08-27 Michael Stahl rename SwTxtNode::Insert to SwTxtNode::InsertHint, and
fix constness in SwTxtNode::InsertItem
2009-08-27 Michael Stahl turn SwTxtNode::MakeTxtAttr() methods into global functions in ndhints.hxx
2009-08-27 Michael Stahl remove obsolete sw/inc/bookmrk.hxx
2009-08-27 Michael Stahl pam.cxx: fix ComparePosition functions (returned wrong result in one case)
2009-08-27 Michael Stahl #i103613# only import RDF metadata on normal open of a document
2009-09-11 kz CWS-TOOLING: integrate CWS impress176
2009-09-08 20:18:24 +0200 sj r275957 : fixed warning (shadowed variable)
2009-09-08 18:02:05 +0200 cl r275948 : #i104315# added missing tab pages
2009-09-08 17:35:18 +0200 cl r275947 : #i104866# fixed angle import
2009-09-08 17:32:53 +0200 cl r275946 : #i104841# fixed angle import
2009-09-08 17:01:25 +0200 cl r275943 : #i103935# fixed the SID_EVENTCONFIG mess
2009-09-08 14:32:57 +0200 sj r275928 : #i104685# only comments
2009-09-07 12:37:36 +0200 sj r275886 : #i104683# fixed import of bold/italic attributes for normal text shapes
2009-09-04 15:07:46 +0200 sj r275808 : #104689# fixed bullet color problem
2009-09-03 15:25:07 +0200 sj r275753 : #160200# added vertical alignment of table cells
2009-09-11 kz CWS-TOOLING: integrate CWS dv14
2009-09-10 15:16:32 +0200 sg r276035 : #160513# updated wfs scheme to accept ports
2009-09-10 07:41:47 +0200 dv r276019 : #i104942# Better renaming algorithmen
2009-08-31 13:41:11 +0200 dv r275604 : #160505# Setting APP1PRODUCTNAME must not overwrite APP1PRODUCTDEF
2009-09-11 kz CWS-TOOLING: integrate CWS jl131
2009-09-02 16:42:40 +0200 jl r275720 : #i97896#
2009-08-31 13:01:53 +0200 jl r275599 : CWS-TOOLING: rebase CWS jl131 to trunk@275331 (milestone: DEV300:m56)
2009-07-31 14:35:30 +0200 jl r274531 : CWS-TOOLING: rebase CWS jl131 to trunk@274203 (milestone: DEV300:m53)
2009-07-23 14:20:32 +0200 jl r274272 : #i79839# better error text when trying to modify shared layer without having write permission, eg. unopkg add --shared, unopkg remove --shared, unopkg reinstall --shared
2009-07-22 16:38:02 +0200 jl r274252 : #i97896# localize error message for lock file
2009-07-22 16:37:22 +0200 jl r274251 : #i80462# unprecise wording in updatedialog
2009-07-22 16:36:06 +0200 jl r274250 : #i97896# localize error message for lock file
2009-07-22 16:35:20 +0200 jl r274249 : #i97896# localize error message for lock file
2009-07-22 15:07:30 +0200 jl r274242 : #i98873# minimum java version is 1.5 since OOo 3.0
2009-09-11 kz CWS-TOOLING: integrate CWS changehc
2009-08-31 19:38:50 +0200 pl r275633 : remove dbug printf
2009-08-31 17:41:50 +0200 pl r275623 : CWS-TOOLING: rebase CWS changehc to trunk@275331 (milestone: DEV300:m56)
2009-07-15 19:45:46 +0200 pl r274028 : #i35482# use HC flag to decide high contrast mode
2009-07-15 17:40:52 +0200 pl r274020 : #i35482# use HC flag to decide high contrast mode
2009-07-15 17:39:50 +0200 pl r274019 : #i35482# update autohc correctly in MergeSystemSettings
2009-07-15 17:38:57 +0200 pl r274018 : #i35482# update autohc correctly in MergeSystemSettings
2009-09-11 kz CWS-TOOLING: integrate CWS notes10
2009-08-24 07:25:57 +0200 mod r275287 : 2009-07-26 02:38:32 +0200 mod r274343 : #i#i103645#
2009-07-26 02:01:53 +0200 mod r274342 : #i103645#
2009-07-26 01:52:42 +0200 mod r274341 : #i103490#
2009-07-22 08:31:48 +0200 mod r274215 : #i103373#
2009-07-15 00:55:11 +0200 mod r273987 : #i101419#
2009-07-14 07:07:55 +0200 mod r273956 : #i101419#
2009-07-14 07:07:43 +0200 mod r273955 : #i101419#
2009-07-14 07:02:10 +0200 mod r273954 : changes from notes9
2009-07-14 06:14:25 +0200 mod r273953 : #i103476#
2009-09-11 kz CWS-TOOLING: integrate CWS ab70
2009-09-10 15:12:54 +0200 jsk r276034 : #i85434# - mandatory automatic update test
2009-09-10 15:11:06 +0200 jsk r276033 : #i85434# - mandatory automatic update test
2009-09-02 09:49:24 +0200 ab r275698 : #i85434# Dialog Import
2009-09-11 kz CWS-TOOLING: integrate CWS hb32bugs02
2009-09-02 Henning Brinkmann #i102420# revert changes
2009-08-26 Henning Brinkmann merged DEV300_m56
2009-08-19 Henning Brinkmann merged DEV300_m55
2009-08-14 Henning Brinkmann merged changes from wntmsci12
2009-08-12 Henning Brinkmann Implemented NoSpaceEdit constructor and destructor in .cxx to allow compile with debug on wntmsci12.
2009-08-12 Henning Brinkmann Added some SW_DLLPUBLIC to make compilable on wntmsci12.
2009-08-11 Henning Brinkmann #i102420# dbg_out: surround output for SwNodes with <nodes-array>.
2009-08-10 Henning Brinkmann #i102420# rewritten debug output for SwNodes.
2009-08-07 Henning Brinkmann #i102420# debug _MoveNodes: output the destination, too. Break after two iterations.
2009-08-07 Henning Brinkmann #i102420# _MoveNodes: Additionally check if destination index is inside source => false
Check if current range was already handled => loop
Debug output current range
2009-08-06 Henning Brinkmann merged DEV300_m54
2009-08-06 Henning Brinkmann added master fix
2009-08-06 Henning Brinkmann debug output for SwNodeRange
2009-08-04 Henning Brinkmann #i102844# robustness: check for NULL pointer to prevent crash
2009-08-03 Henning Brinkmann #i103475# applied patch and verified
2009-08-03 Henning Brinkmann Removed code preventing build of sw with DEBUG.
2009-09-11 convert-repo update tags
2009-09-10 kz CWS-TOOLING: integrate CWS os2port06dev300
2009-09-05 22:49:00 +0200 ydario r275858 : #i99588# applied os2port06 diff to DEV300 tree.
2009-09-10 kz CWS-TOOLING: integrate CWS mingwport23
2009-08-29 07:07:53 +0200 tono r275555 : i#104522: mingw port graphite
2009-08-29 07:07:26 +0200 tono r275554 : i#104522: mingw port printf format fix
2009-09-10 kz CWS-TOOLING: integrate CWS mh232
2009-08-26 03:52:57 +0200 mh r275385 : #i102182# FreeBSD patch
2009-08-26 03:43:20 +0200 mh r275384 : #i101333# patch for FreeBSD
2009-08-26 03:11:20 +0200 mh r275383 : #i39230
2009-08-26 03:07:51 +0200 mh r275382 : #i39230# more space for initials field
2009-08-26 02:41:19 +0200 mh r275380 : #i39230# use vos::osecurity for reading the user name
2009-08-18 22:06:00 +0200 mh r275130 : #i104243#, line ending problem with newer perl
2009-08-18 21:53:21 +0200 mh r275129 : #i39230# read initials via getpwnam
2009-08-18 21:34:05 +0200 mh r275128 : enable CAIROCANVAS for Linux and Mac, #i88613#
2009-08-17 18:02:59 +0200 mh r275067 : #i95498# make compile with gcc3
2009-09-10 kz CWS-TOOLING: integrate CWS tkr24
2009-09-07 14:31:06 +0200 is r275898 : #160081# adding NO_LICENSE_INTO_COPYRIGHT
2009-09-10 releng #i10000# change KeyMapping to SingletonRef<framework::KeyMapping>
2009-09-11 convert-repo update tags
2009-09-10 kz CWS-TOOLING: integrate CWS os2port06dev300
2009-09-05 22:49:00 +0200 ydario r275858 : #i99588# applied os2port06 diff to DEV300 tree.
2009-09-10 kz CWS-TOOLING: integrate CWS mingwport23
2009-08-29 07:07:53 +0200 tono r275555 : i#104522: mingw port graphite
2009-08-29 07:07:26 +0200 tono r275554 : i#104522: mingw port printf format fix
2009-09-10 kz CWS-TOOLING: integrate CWS mh232
2009-08-26 03:52:57 +0200 mh r275385 : #i102182# FreeBSD patch
2009-08-26 03:43:20 +0200 mh r275384 : #i101333# patch for FreeBSD
2009-08-26 03:11:20 +0200 mh r275383 : #i39230
2009-08-26 03:07:51 +0200 mh r275382 : #i39230# more space for initials field
2009-08-26 02:41:19 +0200 mh r275380 : #i39230# use vos::osecurity for reading the user name
2009-08-18 22:06:00 +0200 mh r275130 : #i104243#, line ending problem with newer perl
2009-08-18 21:53:21 +0200 mh r275129 : #i39230# read initials via getpwnam
2009-08-18 21:34:05 +0200 mh r275128 : enable CAIROCANVAS for Linux and Mac, #i88613#
2009-08-17 18:02:59 +0200 mh r275067 : #i95498# make compile with gcc3
2009-09-10 kz CWS-TOOLING: integrate CWS tkr24
2009-09-07 14:31:06 +0200 is r275898 : #160081# adding NO_LICENSE_INTO_COPYRIGHT
2009-09-10 releng #i10000# change KeyMapping to SingletonRef<framework::KeyMapping>
2009-09-11 14:29:45 +00:00
|
|
|
else if (GetFnt()->IsMeta())
|
|
|
|
{
|
|
|
|
pPor = new SwMetaPortion;
|
|
|
|
}
|
2000-09-18 23:08:29 +00:00
|
|
|
else
|
|
|
|
{
|
|
|
|
// Erst zum Schluss !
|
|
|
|
// Wenn pCurr keine Breite hat, kann sie trotzdem schon Inhalt haben,
|
2008-09-04 09:21:00 +00:00
|
|
|
// z.B. bei nicht darstellbaren Zeichen.
|
|
|
|
if( rInf.GetLen() > 0 )
|
|
|
|
{
|
|
|
|
if( rInf.GetTxt().GetChar(rInf.GetIdx())==CH_TXT_ATR_FIELDSTART )
|
|
|
|
pPor = new SwFieldMarkPortion();
|
|
|
|
else if( rInf.GetTxt().GetChar(rInf.GetIdx())==CH_TXT_ATR_FIELDEND )
|
|
|
|
pPor = new SwFieldMarkPortion();
|
|
|
|
else if( rInf.GetTxt().GetChar(rInf.GetIdx())==CH_TXT_ATR_FORMELEMENT )
|
|
|
|
pPor = new SwFieldFormPortion();
|
|
|
|
}
|
|
|
|
if( !pPor )
|
2000-09-18 23:08:29 +00:00
|
|
|
{
|
2008-09-04 09:21:00 +00:00
|
|
|
if( !rInf.X() && !pCurr->GetPortion() && !pCurr->GetLen() && !GetFnt()->IsURL() )
|
|
|
|
pPor = pCurr;
|
|
|
|
else
|
|
|
|
{
|
|
|
|
pPor = new SwTxtPortion;
|
|
|
|
if( GetFnt()->IsURL() )
|
|
|
|
pPor->SetWhichPor( POR_URL );
|
|
|
|
}
|
2000-09-18 23:08:29 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return pPor;
|
|
|
|
}
|
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
* SwTxtFormatter::NewTxtPortion()
|
|
|
|
*************************************************************************/
|
|
|
|
// Die Laenge wird ermittelt, folgende Portion-Grenzen sind definiert:
|
|
|
|
// 1) Tabs
|
|
|
|
// 2) Linebreaks
|
|
|
|
// 3) CH_TXTATR_BREAKWORD / CH_TXTATR_INWORD
|
|
|
|
// 4) naechster Attributwechsel
|
|
|
|
|
|
|
|
SwTxtPortion *SwTxtFormatter::NewTxtPortion( SwTxtFormatInfo &rInf )
|
|
|
|
{
|
|
|
|
// Wenn wir am Zeilenbeginn stehen, nehmen wir pCurr
|
|
|
|
// Wenn pCurr nicht von SwTxtPortion abgeleitet ist,
|
|
|
|
// muessen wir duplizieren ...
|
|
|
|
Seek( rInf.GetIdx() );
|
|
|
|
SwTxtPortion *pPor = WhichTxtPor( rInf );
|
|
|
|
|
2009-01-05 15:33:41 +00:00
|
|
|
// until next attribute change:
|
|
|
|
const xub_StrLen nNextAttr = GetNextAttr();
|
2000-11-09 12:38:10 +00:00
|
|
|
xub_StrLen nNextChg = Min( nNextAttr, rInf.GetTxt().Len() );
|
|
|
|
|
2009-01-05 15:33:41 +00:00
|
|
|
// end of script type:
|
|
|
|
const xub_StrLen nNextScript = pScriptInfo->NextScriptChg( rInf.GetIdx() );
|
|
|
|
nNextChg = Min( nNextChg, nNextScript );
|
2002-03-19 07:59:05 +00:00
|
|
|
|
2009-01-05 15:33:41 +00:00
|
|
|
// end of direction:
|
|
|
|
const xub_StrLen nNextDir = pScriptInfo->NextDirChg( rInf.GetIdx() );
|
|
|
|
nNextChg = Min( nNextChg, nNextDir );
|
2000-11-09 12:38:10 +00:00
|
|
|
|
|
|
|
// 7515, 7516, 3470, 6441 : Turbo-Boost
|
|
|
|
// Es wird unterstellt, dass die Buchstaben eines Fonts nicht
|
|
|
|
// groesser als doppelt so breit wie hoch sind.
|
|
|
|
// 7659: Ganz verrueckt: man muss sich auf den Ascent beziehen.
|
|
|
|
// Falle: GetSize() enthaelt die Wunschhoehe, die reale Hoehe
|
|
|
|
// ergibt sich erst im CalcAscent!
|
|
|
|
// 7697: Das Verhaeltnis ist noch krasser: ein Blank im Times
|
|
|
|
// New Roman besitzt einen Ascent von 182, eine Hoehe von 200
|
|
|
|
// und eine Breite von 53! Daraus folgt, dass eine Zeile mit
|
|
|
|
// vielen Blanks falsch eingeschaetzt wird. Wir erhoehen von
|
|
|
|
// Faktor 2 auf 8 (wg. negativen Kernings).
|
|
|
|
|
|
|
|
pPor->SetLen(1);
|
|
|
|
CalcAscent( rInf, pPor );
|
|
|
|
|
2007-09-27 08:14:21 +00:00
|
|
|
const SwFont* pTmpFnt = rInf.GetFont();
|
|
|
|
KSHORT nExpect = Min( KSHORT( ((Font *)pTmpFnt)->GetSize().Height() ),
|
2000-11-09 12:38:10 +00:00
|
|
|
KSHORT( pPor->GetAscent() ) ) / 8;
|
|
|
|
if ( !nExpect )
|
|
|
|
nExpect = 1;
|
2011-01-17 15:06:54 +01:00
|
|
|
nExpect = (sal_uInt16)(rInf.GetIdx() + ((rInf.Width() - rInf.X()) / nExpect));
|
2000-11-09 12:38:10 +00:00
|
|
|
if( nExpect > rInf.GetIdx() && nNextChg > nExpect )
|
|
|
|
nNextChg = Min( nExpect, rInf.GetTxt().Len() );
|
|
|
|
|
2001-02-15 12:30:24 +00:00
|
|
|
// we keep an invariant during method calls:
|
|
|
|
// there are no portion ending characters like hard spaces
|
|
|
|
// or tabs in [ nLeftScanIdx, nRightScanIdx ]
|
|
|
|
if ( nLeftScanIdx <= rInf.GetIdx() && rInf.GetIdx() <= nRightScanIdx )
|
|
|
|
{
|
|
|
|
if ( nNextChg > nRightScanIdx )
|
2001-10-11 09:54:19 +00:00
|
|
|
nNextChg = nRightScanIdx =
|
|
|
|
rInf.ScanPortionEnd( nRightScanIdx, nNextChg );
|
2001-02-15 12:30:24 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
nLeftScanIdx = rInf.GetIdx();
|
2001-10-11 09:54:19 +00:00
|
|
|
nNextChg = nRightScanIdx =
|
|
|
|
rInf.ScanPortionEnd( rInf.GetIdx(), nNextChg );
|
2001-02-15 12:30:24 +00:00
|
|
|
}
|
|
|
|
|
2000-09-18 23:08:29 +00:00
|
|
|
pPor->SetLen( nNextChg - rInf.GetIdx() );
|
|
|
|
rInf.SetLen( pPor->GetLen() );
|
|
|
|
return pPor;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
* SwTxtFormatter::WhichFirstPortion()
|
|
|
|
*************************************************************************/
|
|
|
|
|
2001-10-19 07:41:38 +00:00
|
|
|
SwLinePortion *SwTxtFormatter::WhichFirstPortion(SwTxtFormatInfo &rInf)
|
2000-09-18 23:08:29 +00:00
|
|
|
{
|
|
|
|
SwLinePortion *pPor = 0;
|
|
|
|
|
|
|
|
if( rInf.GetRest() )
|
|
|
|
{
|
|
|
|
// 5010: Tabs und Felder
|
|
|
|
if( '\0' != rInf.GetHookChar() )
|
|
|
|
return 0;
|
|
|
|
|
|
|
|
pPor = rInf.GetRest();
|
|
|
|
if( pPor->IsErgoSumPortion() )
|
|
|
|
rInf.SetErgoDone(sal_True);
|
|
|
|
else
|
|
|
|
if( pPor->IsFtnNumPortion() )
|
|
|
|
rInf.SetFtnDone(sal_True);
|
|
|
|
else
|
|
|
|
if( pPor->InNumberGrp() )
|
|
|
|
rInf.SetNumDone(sal_True);
|
|
|
|
if( pPor )
|
|
|
|
{
|
|
|
|
rInf.SetRest(0);
|
|
|
|
pCurr->SetRest( sal_True );
|
|
|
|
return pPor;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// ???? und ????: im Follow duerfen wir schon stehen,
|
|
|
|
// entscheidend ist, ob pFrm->GetOfst() == 0 ist!
|
|
|
|
if( rInf.GetIdx() )
|
|
|
|
{
|
|
|
|
// Nun koennen auch FtnPortions und ErgoSumPortions
|
|
|
|
// verlaengert werden.
|
|
|
|
|
|
|
|
// 1) Die ErgoSumTexte
|
|
|
|
if( !rInf.IsErgoDone() )
|
|
|
|
{
|
|
|
|
if( pFrm->IsInFtn() && !pFrm->GetIndPrev() )
|
|
|
|
pPor = (SwLinePortion*)NewErgoSumPortion( rInf );
|
|
|
|
rInf.SetErgoDone( sal_True );
|
|
|
|
}
|
2006-02-09 12:44:35 +00:00
|
|
|
|
|
|
|
// 2) Arrow portions
|
2000-09-18 23:08:29 +00:00
|
|
|
if( !pPor && !rInf.IsArrowDone() )
|
|
|
|
{
|
|
|
|
if( pFrm->GetOfst() && !pFrm->IsFollow() &&
|
|
|
|
rInf.GetIdx() == pFrm->GetOfst() )
|
|
|
|
pPor = new SwArrowPortion( *pCurr );
|
|
|
|
rInf.SetArrowDone( sal_True );
|
|
|
|
}
|
|
|
|
|
2006-02-09 12:44:35 +00:00
|
|
|
// 3) Kerning portions at beginning of line in grid mode
|
2002-01-31 13:31:03 +00:00
|
|
|
if ( ! pPor && ! pCurr->GetPortion() )
|
|
|
|
{
|
2002-02-05 15:50:43 +00:00
|
|
|
GETGRID( GetTxtFrm()->FindPageFrm() )
|
2002-02-06 10:11:09 +00:00
|
|
|
if ( pGrid )
|
2002-01-31 13:31:03 +00:00
|
|
|
pPor = new SwKernPortion( *pCurr );
|
|
|
|
}
|
2002-01-11 13:59:18 +00:00
|
|
|
|
2006-02-09 12:44:35 +00:00
|
|
|
// 4) Die Zeilenreste (mehrzeilige Felder)
|
2000-09-18 23:08:29 +00:00
|
|
|
if( !pPor )
|
|
|
|
{
|
|
|
|
pPor = rInf.GetRest();
|
|
|
|
// 6922: Nur bei pPor natuerlich.
|
|
|
|
if( pPor )
|
|
|
|
{
|
|
|
|
pCurr->SetRest( sal_True );
|
|
|
|
rInf.SetRest(0);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2002-05-30 11:44:26 +00:00
|
|
|
else
|
2000-09-18 23:08:29 +00:00
|
|
|
{
|
2006-02-09 12:44:35 +00:00
|
|
|
// 5) Die Fussnotenzahlen
|
2002-08-07 10:21:57 +00:00
|
|
|
if( !rInf.IsFtnDone() )
|
2000-09-18 23:08:29 +00:00
|
|
|
{
|
2010-11-25 17:08:45 +01:00
|
|
|
OSL_ENSURE( ( ! rInf.IsMulti() && ! pMulti ) || pMulti->HasRotation(),
|
|
|
|
"Rotated number portion trouble" );
|
2002-08-07 10:21:57 +00:00
|
|
|
|
2000-09-18 23:08:29 +00:00
|
|
|
sal_Bool bFtnNum = pFrm->IsFtnNumFrm();
|
|
|
|
rInf.GetParaPortion()->SetFtnNum( bFtnNum );
|
|
|
|
if( bFtnNum )
|
|
|
|
pPor = (SwLinePortion*)NewFtnNumPortion( rInf );
|
|
|
|
rInf.SetFtnDone( sal_True );
|
|
|
|
}
|
|
|
|
|
2006-02-09 12:44:35 +00:00
|
|
|
// 6) Die ErgoSumTexte gibt es natuerlich auch im TextMaster,
|
2000-09-18 23:08:29 +00:00
|
|
|
// entscheidend ist, ob der SwFtnFrm ein Follow ist.
|
2002-05-30 11:44:26 +00:00
|
|
|
if( !rInf.IsErgoDone() && !pPor && ! rInf.IsMulti() )
|
2000-09-18 23:08:29 +00:00
|
|
|
{
|
|
|
|
if( pFrm->IsInFtn() && !pFrm->GetIndPrev() )
|
|
|
|
pPor = (SwLinePortion*)NewErgoSumPortion( rInf );
|
|
|
|
rInf.SetErgoDone( sal_True );
|
|
|
|
}
|
|
|
|
|
2006-02-09 12:44:35 +00:00
|
|
|
// 7) Die Numerierungen
|
2000-09-18 23:08:29 +00:00
|
|
|
if( !rInf.IsNumDone() && !pPor )
|
|
|
|
{
|
2010-11-25 17:08:45 +01:00
|
|
|
OSL_ENSURE( ( ! rInf.IsMulti() && ! pMulti ) || pMulti->HasRotation(),
|
|
|
|
"Rotated number portion trouble" );
|
2002-05-30 11:44:26 +00:00
|
|
|
|
2000-09-18 23:08:29 +00:00
|
|
|
// Wenn wir im Follow stehen, dann natuerlich nicht.
|
2005-11-08 16:21:51 +00:00
|
|
|
if( GetTxtFrm()->GetTxtNode()->GetNumRule() )
|
2000-09-18 23:08:29 +00:00
|
|
|
pPor = (SwLinePortion*)NewNumberPortion( rInf );
|
|
|
|
rInf.SetNumDone( sal_True );
|
|
|
|
}
|
2006-02-09 12:44:35 +00:00
|
|
|
// 8) Die DropCaps
|
2002-05-30 11:44:26 +00:00
|
|
|
if( !pPor && GetDropFmt() && ! rInf.IsMulti() )
|
2000-09-18 23:08:29 +00:00
|
|
|
pPor = (SwLinePortion*)NewDropPortion( rInf );
|
2002-01-11 13:59:18 +00:00
|
|
|
|
2006-02-09 12:44:35 +00:00
|
|
|
// 9) Kerning portions at beginning of line in grid mode
|
2004-03-25 11:52:47 +00:00
|
|
|
if ( !pPor && !pCurr->GetPortion() )
|
2002-01-31 13:31:03 +00:00
|
|
|
{
|
2002-02-05 15:50:43 +00:00
|
|
|
GETGRID( GetTxtFrm()->FindPageFrm() )
|
2002-02-06 10:11:09 +00:00
|
|
|
if ( pGrid )
|
2002-01-31 13:31:03 +00:00
|
|
|
pPor = new SwKernPortion( *pCurr );
|
|
|
|
}
|
2006-02-09 12:44:35 +00:00
|
|
|
}
|
2004-03-25 11:52:47 +00:00
|
|
|
|
2006-08-14 15:38:45 +00:00
|
|
|
// 10) Decimal tab portion at the beginning of each line in table cells
|
|
|
|
if ( !pPor && !pCurr->GetPortion() &&
|
|
|
|
GetTxtFrm()->IsInTab() &&
|
|
|
|
GetTxtFrm()->GetTxtNode()->getIDocumentSettingAccess()->get(IDocumentSettingAccess::TAB_COMPAT) )
|
|
|
|
{
|
|
|
|
pPor = NewTabPortion( rInf, true );
|
|
|
|
}
|
2006-02-09 12:44:35 +00:00
|
|
|
|
CWS-TOOLING: integrate CWS odfmetadata3
2009-09-11 Michael Stahl merge DEV300_m58
2009-09-07 Michael Stahl SwFmtFld::Modify(): do nothing on RES_OBJECTDYING
2009-08-27 Michael Stahl #i91565#, #i91566#: TextPortionEnumerationTest.java: add test document
2009-08-27 Michael Stahl #i91565#, #i91566#: add complex test: TextPortionEnumerationTest.java
2009-08-27 Michael Stahl CLiteral::initialize(): zero-length literals probably not an error
2009-08-27 Michael Stahl #i91565#, #i91566#: offapi: new InContentMetadata and MetadataField services
adapt TextPortion for InContentMetadata
2009-08-27 Michael Stahl #i91564#: xmloff: load/store xml:id and RDFa for text:bookmark(-start).
2009-08-27 Michael Stahl #i91564#: sw core: add support for xml:id at bookmarks:
sw::mark::Bookmark: derive from Metadatable.
SwHistoryBookmark, SaveBookmark: store a MetadatableUndo.
ndcopy.cxx: lcl_CopyBookmarks(): copy the xml:id.
SwXBookmark: derive from MetadatableMixin.
2009-08-27 Michael Stahl #i91565#, #i91566#: xmloff: refactor ruby import so nested meta(-field) works:
remove XMLRubyHint_Impl.
XMLImpRubyContext_Impl::~XMLImpRubyContext_Impl(): insert ruby directly.
2009-08-27 Michael Stahl #i91565#, #i91566#: xmloff: fix text:meta(-field) import/export:
new XMLTextParagraphExport::exportTextField() overload for XTextField.
CreateAndInsertMark(): set xml:id after insertion.
fix meta(-field) service names, bugs etc.
2009-08-27 Michael Stahl #i91565#, #i91566#: sw text formatting: paint background of meta(-field) body:
SwFont: add member m_nMetaCount.
txttypes.hxx: add POR_META.
atrstck.cxx: handle RES_TXTATR_META(FIELD).
itrform2.cxx: SwTxtFormatter::WhichTxtPor(): create new class SwMetaPortion.
2009-08-27 Michael Stahl #i91566#: sw text formatting: display meta-field prefix and suffix:
SwAttrIter::GetAttr(): replace with call to GetTxtAttrForCharAt().
SwTxtFormatter::NewExtraPortion(): handle meta-field prefix.
SwTxtFormatter: new member m_nHintEndIndex.
SwTxtFormatter::WhichFirstPortion(): call TryNewNoLengthPortion().
SwTxtFormatter::TryNewNoLengthPortion(): new; handle suffix of meta-field.
SwTxtFormatter::UnderFlow(): UGLY HACK: decrement m_nHintEndIndex.
SwFldPortion: add flag m_bNoLength: portion has zero length (for suffix).
2009-08-27 Michael Stahl #i91565#, #i91566#: extend text:meta(-field) uno wrapper with XText interface:
unoobj.hxx: new CursorType CURSOR_META.
unoobj2.cxx: refactor SwXText implementation to ensure that when the SwXText
belongs to a SwXMeta, content is always inserted inside the meta(-field).
unoobj.cxx: new SwXTextCursor::ForceIntoMeta(): cursor stays in meta(-field).
unometa.hxx: SwXMeta implements XText, forwarding to a member SwXMetaText.
DocInsertStringSplitCR(), SwX*::attachToRange(), SwX*::DeleteAndInsert():
use FORCEHINTEXPAND hack to ensure insert into the meta(-field) at the end.
2009-08-27 Michael Stahl #i91565#, #i91566#: add text:meta(-field) uno wrapper to sw:
fmtmeta.hxx, fmtatr2.cxx: new class sw::MetaField, new sw::MetaFieldManager.
doc.hxx, docnew.cxx: new SwDoc::GetMetaFieldManager().
unocoll.hxx,.cxx: new SW_SERVICE_FIELDTYPE_METAFIELD, SW_SERVICE_TYPE_META.
unomap.hxx,.cxx: new PROPERTY_MAP_METAFIELD.
unoprnms.hxx: new UNO_NAME_META.
unoport.hxx: new PORTION_META; add "InContentMetadata" prop to SwXTextPortion.
new unometa.hxx: new class SwXMeta and SwXMetaField.
unofield.cxx: SwXFieldEnumeration: include meta-fields.
unoportenum.cxx: handle RES_TXTATR_META(FIELD) by using a portion list stack.
unotext.cxx: SwXText::insertTextContent(): handle meta(-field) as attribute.
2009-08-27 Michael Stahl #i91565#, #i91566#: ndhints.cxx: remove sort number from SwTxtAttrNesting
2009-08-27 Michael Stahl #i91565#, #i91566#: add support for hints with end and CH_TXTATR to sw core:
doc.hxx, docedt.cxx: replace SwDoc::Delete(), DeleteAndJoin(), ReplaceRange()
with wrappers that split at left-overlapped end+CH_TXTATR hints.
txatbase.hxx: new member SwTxtAttr::m_bHasDummyChar.
ndtxt.hxx: rename SwTxtNode::GetTxtAttr() to GetTxtAttrForCharAt().
ndtxt.cxx: SwTxtNode::CopyText(): copy end+CH_TXTATR hints iff copy CH_TXTATR.
txtatr2.cxx, thints.cxx: SwTxtMeta gets a CH_TXTATR.
2009-08-27 Michael Stahl #i91565#, #i91566#: add text:meta(-field) to sw core:
txatbase.hxx: new member SwTxtAttr::m_bNesting.
hintids.hxx: new ids RES_TXTATR_META, RES_TXTATR_METAFIELD.
txtatr.hxx: new base class SwTxtAttrNesting.
new hint SwTxtMeta.
SwTxtRuby derives from SwTxtAttrNesting.
txtinet.hxx: SwTxtINetFmt derives from SwTxtAttrNesting.
new header fmtmeta.hxx: new pool item SwFmtMeta. new class sw::Meta.
ndhints.hxx, thints.cxx: new method SwpHints::TryInsertNesting().
thints.cxx: refactoring: BuildPortions() no longer handles Ruby/Hyperlink,
but TryInsertNesting(), which also handles meta(-field).
SwTxtNode::InsertItem(): check if the hint is actually inserted.
ndhints.cxx: sort nesting hints based on sort number.
ndtxt.cxx: lcl_CopyHint(): handle copy of meta/meta-field.
2009-08-27 Michael Stahl enable expanding hints with m_bLockExpandFlag set:
add new InsertFlag: INS_FORCEHINTEXPAND.
add new SetAttrMode: SETATTR_FORCEHINTEXPAND.
rename SwEditShell::Insert() to Insert2() because changed signature fails
to compile when SwWrtShell tries to overwrite these non-virtual members...
SwWrtShell::Insert() sets FOCEHINTEXPAND if range was selected/deleted.
adapt SwUndoInsert to store flags.
2009-08-27 Michael Stahl change formal parameters of item insertion methods to type SetAttrMode
2009-08-27 Michael Stahl fix incorrect resetting of text attributes in SwUndoInsSection, SwUndoInserts
2009-08-27 Michael Stahl clean up SwTxtNode::CutImpl() and lcl_CopyHint()
2009-08-27 Michael Stahl rename SwDoc::Copy() to CopyRange(), and _Copy() to CopyImpl()
2009-08-27 Michael Stahl rename SwNodes::Move() to MoveRange(), and remove unused parameter
2009-08-27 Michael Stahl rename SwDoc::Move() to MoveRange()/MoveNodeRange()
2009-08-27 Michael Stahl rename SwDoc::Insert() to InsertString(), and remove sal_Unicode variant
2009-08-27 Michael Stahl rename SwDoc::Insert() to InsertPoolItem()/InsertItemSet()/InsertSwSection()
2009-08-27 Michael Stahl rename SwDoc::Replace() to ReplaceRange()
2009-08-27 Michael Stahl remove SwDoc::Overwrite() sal_Unicode variant
2009-08-27 Michael Stahl split up SwDoc::DeleteAndJoin(): factor out DeleteAndJoinWithRedline()
2009-08-27 Michael Stahl rename overloaded SwDoc::Delete() to DeleteRange()/DeleteTOXMark()
2009-08-27 Michael Stahl rename SwTxtNode::Copy() to CopyText()
2009-08-27 Michael Stahl rename SwTxtNode::Cut() to CutText(), and _Cut() to CutImpl()
2009-08-27 Michael Stahl rename SwTxtNode::Delete() to DeleteAttribute()/DeleteAttributes()
2009-08-27 Michael Stahl rename SwTxtNode::Replace() to ReplaceText(), and remove the xub_Unicode variant
2009-08-27 Michael Stahl rename SwTxtNode::Erase() to EraseText()
2009-08-27 Michael Stahl rename SwTxtNode::Insert() to InsertText(), and remove the xub_Unicode variant
2009-08-27 Michael Stahl clean up SwTxtNode::Update()
2009-08-27 Michael Stahl remove SwTxtAttr::RemoveFromPool() and make destructor non-public,
to be invoked by new method SwTxtAttr::Destroy()
2009-08-27 Michael Stahl ensure that SwDoc::Insert() for item (set) returns success indicator:
replace SwRegHistory constructor with method InsertItems(), returning bool.
refactor InsAttr() so that it checks if InsertItems() succeeds.
2009-08-27 Michael Stahl move SwXTextPortionEnumeration from unoobj.hxx to unoport.hxx
2009-08-27 Michael Stahl add missing SolarMutex in SwXTextPortion methods
2009-08-27 Michael Stahl SwXTextPortion: new member m_xTextField (so the TextField property need not
be returned indirectly via SwUnoCursorHelper).
factor out function CreateSwXTextField().
2009-08-27 Michael Stahl SwXTextPortion: remove PORTION_CONTROL_CHAR and implementation of XTextField
2009-08-27 Michael Stahl remove obsolete hint SwTxtHardBlank and formats SwFmtHardBlank/SwFmtSoftHyph
2009-08-27 Michael Stahl clean up SwTxtAttr and friends:
remove many accessor methods for obsolete (due to autofmt) char format items.
remove unused flag SwTxtAttr::m_bDontMergeAttr.
MakeRedlineTxtAttr() now dedicated function, no longer calls MakeTxtAttr().
2009-08-27 Michael Stahl remove obsolete attribute SwTxt2Lines
2009-08-27 Michael Stahl SwXTextPortionEnumeration: finish refactoring CreatePortions
change ExportHints so it always returns a text portion for hint w/ CH_TXTATR.
remove special case for handling end of paragraph.
unfortunately had to refactor the fieldmarks export as well (got in the way).
2009-08-27 Michael Stahl SwXTextPortionEnumeration: refactor CreatePortions: frames export
extract function ExportFrames() from CreatePortions().
remove (un)dead code that calls evil MovePara(fnParaCurr, fnParaEnd)
2009-08-27 Michael Stahl clean up SwXParaFrameEnumeration
2009-08-27 Michael Stahl CollectFrameAtNode: replace SwDependArr with STL based FrameDependList_t
2009-08-27 Michael Stahl SwXTextPortionEnumeration: tweak refmark/toxmark export
so ExportHints returns the portion for point marks
2009-08-27 Michael Stahl clean up SwXTextPortionEnumeration:
prefix members, remove casts, replace SvWeirdArray with STL, etc.
make CreatePortions() method a function, and remove lots of members.
extract fieldmarks function from CreatePortions.
2009-08-27 Michael Stahl remove FOREACHUNOPAM_START/END macros
2009-08-27 Michael Stahl clean up SwXTextPortion:
prefix members, remove casts, etc.
remove SwXRubyPortion: replace it with another SwXTextPortion constructor
2009-08-27 Michael Stahl #i102541# SwXReferenceMark::InsertRefMark(): use flag SETATTR_DONTEXPAND
2009-08-27 Michael Stahl rename SwTxtNode::Insert to SwTxtNode::InsertHint, and
fix constness in SwTxtNode::InsertItem
2009-08-27 Michael Stahl turn SwTxtNode::MakeTxtAttr() methods into global functions in ndhints.hxx
2009-08-27 Michael Stahl remove obsolete sw/inc/bookmrk.hxx
2009-08-27 Michael Stahl pam.cxx: fix ComparePosition functions (returned wrong result in one case)
2009-08-27 Michael Stahl #i103613# only import RDF metadata on normal open of a document
2009-09-11 kz CWS-TOOLING: integrate CWS impress176
2009-09-08 20:18:24 +0200 sj r275957 : fixed warning (shadowed variable)
2009-09-08 18:02:05 +0200 cl r275948 : #i104315# added missing tab pages
2009-09-08 17:35:18 +0200 cl r275947 : #i104866# fixed angle import
2009-09-08 17:32:53 +0200 cl r275946 : #i104841# fixed angle import
2009-09-08 17:01:25 +0200 cl r275943 : #i103935# fixed the SID_EVENTCONFIG mess
2009-09-08 14:32:57 +0200 sj r275928 : #i104685# only comments
2009-09-07 12:37:36 +0200 sj r275886 : #i104683# fixed import of bold/italic attributes for normal text shapes
2009-09-04 15:07:46 +0200 sj r275808 : #104689# fixed bullet color problem
2009-09-03 15:25:07 +0200 sj r275753 : #160200# added vertical alignment of table cells
2009-09-11 kz CWS-TOOLING: integrate CWS dv14
2009-09-10 15:16:32 +0200 sg r276035 : #160513# updated wfs scheme to accept ports
2009-09-10 07:41:47 +0200 dv r276019 : #i104942# Better renaming algorithmen
2009-08-31 13:41:11 +0200 dv r275604 : #160505# Setting APP1PRODUCTNAME must not overwrite APP1PRODUCTDEF
2009-09-11 kz CWS-TOOLING: integrate CWS jl131
2009-09-02 16:42:40 +0200 jl r275720 : #i97896#
2009-08-31 13:01:53 +0200 jl r275599 : CWS-TOOLING: rebase CWS jl131 to trunk@275331 (milestone: DEV300:m56)
2009-07-31 14:35:30 +0200 jl r274531 : CWS-TOOLING: rebase CWS jl131 to trunk@274203 (milestone: DEV300:m53)
2009-07-23 14:20:32 +0200 jl r274272 : #i79839# better error text when trying to modify shared layer without having write permission, eg. unopkg add --shared, unopkg remove --shared, unopkg reinstall --shared
2009-07-22 16:38:02 +0200 jl r274252 : #i97896# localize error message for lock file
2009-07-22 16:37:22 +0200 jl r274251 : #i80462# unprecise wording in updatedialog
2009-07-22 16:36:06 +0200 jl r274250 : #i97896# localize error message for lock file
2009-07-22 16:35:20 +0200 jl r274249 : #i97896# localize error message for lock file
2009-07-22 15:07:30 +0200 jl r274242 : #i98873# minimum java version is 1.5 since OOo 3.0
2009-09-11 kz CWS-TOOLING: integrate CWS changehc
2009-08-31 19:38:50 +0200 pl r275633 : remove dbug printf
2009-08-31 17:41:50 +0200 pl r275623 : CWS-TOOLING: rebase CWS changehc to trunk@275331 (milestone: DEV300:m56)
2009-07-15 19:45:46 +0200 pl r274028 : #i35482# use HC flag to decide high contrast mode
2009-07-15 17:40:52 +0200 pl r274020 : #i35482# use HC flag to decide high contrast mode
2009-07-15 17:39:50 +0200 pl r274019 : #i35482# update autohc correctly in MergeSystemSettings
2009-07-15 17:38:57 +0200 pl r274018 : #i35482# update autohc correctly in MergeSystemSettings
2009-09-11 kz CWS-TOOLING: integrate CWS notes10
2009-08-24 07:25:57 +0200 mod r275287 : 2009-07-26 02:38:32 +0200 mod r274343 : #i#i103645#
2009-07-26 02:01:53 +0200 mod r274342 : #i103645#
2009-07-26 01:52:42 +0200 mod r274341 : #i103490#
2009-07-22 08:31:48 +0200 mod r274215 : #i103373#
2009-07-15 00:55:11 +0200 mod r273987 : #i101419#
2009-07-14 07:07:55 +0200 mod r273956 : #i101419#
2009-07-14 07:07:43 +0200 mod r273955 : #i101419#
2009-07-14 07:02:10 +0200 mod r273954 : changes from notes9
2009-07-14 06:14:25 +0200 mod r273953 : #i103476#
2009-09-11 kz CWS-TOOLING: integrate CWS ab70
2009-09-10 15:12:54 +0200 jsk r276034 : #i85434# - mandatory automatic update test
2009-09-10 15:11:06 +0200 jsk r276033 : #i85434# - mandatory automatic update test
2009-09-02 09:49:24 +0200 ab r275698 : #i85434# Dialog Import
2009-09-11 kz CWS-TOOLING: integrate CWS hb32bugs02
2009-09-02 Henning Brinkmann #i102420# revert changes
2009-08-26 Henning Brinkmann merged DEV300_m56
2009-08-19 Henning Brinkmann merged DEV300_m55
2009-08-14 Henning Brinkmann merged changes from wntmsci12
2009-08-12 Henning Brinkmann Implemented NoSpaceEdit constructor and destructor in .cxx to allow compile with debug on wntmsci12.
2009-08-12 Henning Brinkmann Added some SW_DLLPUBLIC to make compilable on wntmsci12.
2009-08-11 Henning Brinkmann #i102420# dbg_out: surround output for SwNodes with <nodes-array>.
2009-08-10 Henning Brinkmann #i102420# rewritten debug output for SwNodes.
2009-08-07 Henning Brinkmann #i102420# debug _MoveNodes: output the destination, too. Break after two iterations.
2009-08-07 Henning Brinkmann #i102420# _MoveNodes: Additionally check if destination index is inside source => false
Check if current range was already handled => loop
Debug output current range
2009-08-06 Henning Brinkmann merged DEV300_m54
2009-08-06 Henning Brinkmann added master fix
2009-08-06 Henning Brinkmann debug output for SwNodeRange
2009-08-04 Henning Brinkmann #i102844# robustness: check for NULL pointer to prevent crash
2009-08-03 Henning Brinkmann #i103475# applied patch and verified
2009-08-03 Henning Brinkmann Removed code preventing build of sw with DEBUG.
2009-09-11 convert-repo update tags
2009-09-10 kz CWS-TOOLING: integrate CWS os2port06dev300
2009-09-05 22:49:00 +0200 ydario r275858 : #i99588# applied os2port06 diff to DEV300 tree.
2009-09-10 kz CWS-TOOLING: integrate CWS mingwport23
2009-08-29 07:07:53 +0200 tono r275555 : i#104522: mingw port graphite
2009-08-29 07:07:26 +0200 tono r275554 : i#104522: mingw port printf format fix
2009-09-10 kz CWS-TOOLING: integrate CWS mh232
2009-08-26 03:52:57 +0200 mh r275385 : #i102182# FreeBSD patch
2009-08-26 03:43:20 +0200 mh r275384 : #i101333# patch for FreeBSD
2009-08-26 03:11:20 +0200 mh r275383 : #i39230
2009-08-26 03:07:51 +0200 mh r275382 : #i39230# more space for initials field
2009-08-26 02:41:19 +0200 mh r275380 : #i39230# use vos::osecurity for reading the user name
2009-08-18 22:06:00 +0200 mh r275130 : #i104243#, line ending problem with newer perl
2009-08-18 21:53:21 +0200 mh r275129 : #i39230# read initials via getpwnam
2009-08-18 21:34:05 +0200 mh r275128 : enable CAIROCANVAS for Linux and Mac, #i88613#
2009-08-17 18:02:59 +0200 mh r275067 : #i95498# make compile with gcc3
2009-09-10 kz CWS-TOOLING: integrate CWS tkr24
2009-09-07 14:31:06 +0200 is r275898 : #160081# adding NO_LICENSE_INTO_COPYRIGHT
2009-09-10 releng #i10000# change KeyMapping to SingletonRef<framework::KeyMapping>
2009-09-11 convert-repo update tags
2009-09-10 kz CWS-TOOLING: integrate CWS os2port06dev300
2009-09-05 22:49:00 +0200 ydario r275858 : #i99588# applied os2port06 diff to DEV300 tree.
2009-09-10 kz CWS-TOOLING: integrate CWS mingwport23
2009-08-29 07:07:53 +0200 tono r275555 : i#104522: mingw port graphite
2009-08-29 07:07:26 +0200 tono r275554 : i#104522: mingw port printf format fix
2009-09-10 kz CWS-TOOLING: integrate CWS mh232
2009-08-26 03:52:57 +0200 mh r275385 : #i102182# FreeBSD patch
2009-08-26 03:43:20 +0200 mh r275384 : #i101333# patch for FreeBSD
2009-08-26 03:11:20 +0200 mh r275383 : #i39230
2009-08-26 03:07:51 +0200 mh r275382 : #i39230# more space for initials field
2009-08-26 02:41:19 +0200 mh r275380 : #i39230# use vos::osecurity for reading the user name
2009-08-18 22:06:00 +0200 mh r275130 : #i104243#, line ending problem with newer perl
2009-08-18 21:53:21 +0200 mh r275129 : #i39230# read initials via getpwnam
2009-08-18 21:34:05 +0200 mh r275128 : enable CAIROCANVAS for Linux and Mac, #i88613#
2009-08-17 18:02:59 +0200 mh r275067 : #i95498# make compile with gcc3
2009-09-10 kz CWS-TOOLING: integrate CWS tkr24
2009-09-07 14:31:06 +0200 is r275898 : #160081# adding NO_LICENSE_INTO_COPYRIGHT
2009-09-10 releng #i10000# change KeyMapping to SingletonRef<framework::KeyMapping>
2009-09-11 14:29:45 +00:00
|
|
|
// 11) suffix of meta-field
|
|
|
|
if (!pPor)
|
|
|
|
{
|
|
|
|
pPor = TryNewNoLengthPortion(rInf);
|
|
|
|
}
|
|
|
|
|
2000-09-18 23:08:29 +00:00
|
|
|
return pPor;
|
|
|
|
}
|
|
|
|
|
|
|
|
sal_Bool lcl_OldFieldRest( const SwLineLayout* pCurr )
|
|
|
|
{
|
|
|
|
if( !pCurr->GetNext() )
|
|
|
|
return sal_False;
|
|
|
|
const SwLinePortion *pPor = pCurr->GetNext()->GetPortion();
|
|
|
|
sal_Bool bRet = sal_False;
|
2000-11-06 08:20:28 +00:00
|
|
|
while( pPor && !bRet )
|
2000-09-18 23:08:29 +00:00
|
|
|
{
|
2000-11-06 08:20:28 +00:00
|
|
|
bRet = (pPor->InFldGrp() && ((SwFldPortion*)pPor)->IsFollow()) ||
|
|
|
|
(pPor->IsMultiPortion() && ((SwMultiPortion*)pPor)->IsFollowFld());
|
|
|
|
if( !pPor->GetLen() )
|
|
|
|
break;
|
2000-09-18 23:08:29 +00:00
|
|
|
pPor = pPor->GetPortion();
|
|
|
|
}
|
|
|
|
return bRet;
|
|
|
|
}
|
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
* SwTxtFormatter::NewPortion()
|
|
|
|
*************************************************************************/
|
|
|
|
|
|
|
|
/* NewPortion stellt rInf.nLen ein.
|
|
|
|
* Eine SwTxtPortion wird begrenzt durch ein tab, break, txtatr,
|
|
|
|
* attrwechsel.
|
|
|
|
* Drei Faelle koennen eintreten:
|
|
|
|
* 1) Die Zeile ist voll und der Umbruch wurde nicht emuliert
|
|
|
|
* -> return 0;
|
|
|
|
* 2) Die Zeile ist voll und es wurde ein Umbruch emuliert
|
|
|
|
* -> Breite neu einstellen und return new FlyPortion
|
|
|
|
* 3) Es muss eine neue Portion gebaut werden.
|
|
|
|
* -> CalcFlyWidth emuliert ggf. die Breite und return Portion
|
|
|
|
*/
|
|
|
|
|
|
|
|
SwLinePortion *SwTxtFormatter::NewPortion( SwTxtFormatInfo &rInf )
|
|
|
|
{
|
|
|
|
// Underflow hat Vorrang
|
|
|
|
rInf.SetStopUnderFlow( sal_False );
|
|
|
|
if( rInf.GetUnderFlow() )
|
|
|
|
{
|
2010-11-25 17:08:45 +01:00
|
|
|
OSL_ENSURE( rInf.IsFull(), "SwTxtFormatter::NewPortion: underflow but not full" );
|
2000-09-18 23:08:29 +00:00
|
|
|
return UnderFlow( rInf );
|
|
|
|
}
|
|
|
|
|
|
|
|
// Wenn die Zeile voll ist, koennten noch Flys oder
|
|
|
|
// UnderFlow-LinePortions warten ...
|
|
|
|
if( rInf.IsFull() )
|
|
|
|
{
|
|
|
|
// ????: LineBreaks und Flys (bug05.sdw)
|
|
|
|
// 8450: IsDummy()
|
|
|
|
if( rInf.IsNewLine() && (!rInf.GetFly() || !pCurr->IsDummy()) )
|
|
|
|
return 0;
|
|
|
|
|
|
|
|
// Wenn der Text an den Fly gestossen ist, oder wenn
|
|
|
|
// der Fly als erstes drankommt, weil er ueber dem linken
|
|
|
|
// Rand haengt, wird GetFly() returnt.
|
|
|
|
// Wenn IsFull() und kein GetFly() vorhanden ist, gibt's
|
|
|
|
// naturgemaesz eine 0.
|
|
|
|
if( rInf.GetFly() )
|
|
|
|
{
|
|
|
|
if( rInf.GetLast()->IsBreakPortion() )
|
|
|
|
{
|
|
|
|
delete rInf.GetFly();
|
|
|
|
rInf.SetFly( 0 );
|
|
|
|
}
|
2001-04-26 09:37:23 +00:00
|
|
|
|
2000-09-18 23:08:29 +00:00
|
|
|
return rInf.GetFly();
|
|
|
|
}
|
|
|
|
// Ein fieser Sonderfall: ein Rahmen ohne Umlauf kreuzt den
|
|
|
|
// Ftn-Bereich. Wir muessen die Ftn-Portion als Zeilenrest
|
|
|
|
// bekanntgeben, damit SwTxtFrm::Format nicht abbricht
|
|
|
|
// (die Textmasse wurde ja durchformatiert).
|
|
|
|
if( rInf.GetRest() )
|
|
|
|
rInf.SetNewLine( sal_True );
|
|
|
|
else
|
|
|
|
{
|
|
|
|
// Wenn die naechste Zeile mit einem Rest eines Feldes beginnt,
|
|
|
|
// jetzt aber kein Rest mehr anliegt,
|
|
|
|
// muss sie auf jeden Fall neu formatiert werden!
|
|
|
|
if( lcl_OldFieldRest( GetCurr() ) )
|
|
|
|
rInf.SetNewLine( sal_True );
|
|
|
|
else
|
|
|
|
{
|
|
|
|
SwLinePortion *pFirst = WhichFirstPortion( rInf );
|
|
|
|
if( pFirst )
|
|
|
|
{
|
|
|
|
rInf.SetNewLine( sal_True );
|
|
|
|
if( pFirst->InNumberGrp() )
|
|
|
|
rInf.SetNumDone( sal_False) ;
|
|
|
|
delete pFirst;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
SwLinePortion *pPor = WhichFirstPortion( rInf );
|
2000-10-16 12:11:59 +00:00
|
|
|
|
2004-02-26 14:32:14 +00:00
|
|
|
// Check for Hidden Portion:
|
|
|
|
if ( !pPor )
|
|
|
|
{
|
|
|
|
xub_StrLen nEnd = rInf.GetIdx();
|
2011-02-24 17:34:08 +00:00
|
|
|
if ( ::lcl_BuildHiddenPortion( rInf, nEnd ) )
|
2004-02-26 14:32:14 +00:00
|
|
|
pPor = new SwHiddenTextPortion( nEnd - rInf.GetIdx() );
|
|
|
|
}
|
|
|
|
|
2000-09-18 23:08:29 +00:00
|
|
|
if( !pPor )
|
|
|
|
{
|
2005-03-08 12:45:37 +00:00
|
|
|
if( ( !pMulti || pMulti->IsBidi() ) &&
|
2011-04-16 22:42:13 -03:00
|
|
|
// #i42734#
|
2005-03-08 12:45:37 +00:00
|
|
|
// No multi portion if there is a hook character waiting:
|
|
|
|
( !rInf.GetRest() || '\0' == rInf.GetHookChar() ) )
|
|
|
|
{
|
|
|
|
// We open a multiportion part, if we enter a multi-line part
|
2000-10-16 12:11:59 +00:00
|
|
|
// of the paragraph.
|
2000-11-09 10:37:59 +00:00
|
|
|
xub_StrLen nEnd = rInf.GetIdx();
|
2002-03-19 07:59:05 +00:00
|
|
|
SwMultiCreator* pCreate = rInf.GetMultiCreator( nEnd, pMulti );
|
2001-02-06 14:26:49 +00:00
|
|
|
if( pCreate )
|
2000-10-26 06:41:24 +00:00
|
|
|
{
|
2000-11-06 08:20:28 +00:00
|
|
|
SwMultiPortion* pTmp = NULL;
|
2002-03-19 07:59:05 +00:00
|
|
|
|
|
|
|
if ( SW_MC_BIDI == pCreate->nId )
|
2002-03-21 08:19:43 +00:00
|
|
|
pTmp = new SwBidiPortion( nEnd, pCreate->nLevel );
|
2002-03-19 07:59:05 +00:00
|
|
|
else if ( SW_MC_RUBY == pCreate->nId )
|
|
|
|
{
|
2001-03-19 14:58:50 +00:00
|
|
|
Seek( rInf.GetIdx() );
|
2002-01-31 13:31:03 +00:00
|
|
|
sal_Bool bRubyTop;
|
|
|
|
sal_Bool* pRubyPos = 0;
|
2002-04-25 07:43:45 +00:00
|
|
|
|
|
|
|
if ( rInf.SnapToGrid() )
|
2002-01-31 13:31:03 +00:00
|
|
|
{
|
2002-04-25 07:43:45 +00:00
|
|
|
GETGRID( GetTxtFrm()->FindPageFrm() )
|
|
|
|
if ( pGrid )
|
|
|
|
{
|
|
|
|
bRubyTop = ! pGrid->GetRubyTextBelow();
|
|
|
|
pRubyPos = &bRubyTop;
|
|
|
|
}
|
2002-01-31 13:31:03 +00:00
|
|
|
}
|
|
|
|
|
2002-01-24 12:41:56 +00:00
|
|
|
pTmp = new SwRubyPortion( *pCreate, *rInf.GetFont(),
|
2006-08-14 15:38:45 +00:00
|
|
|
*GetTxtFrm()->GetTxtNode()->getIDocumentSettingAccess(),
|
|
|
|
nEnd, 0, pRubyPos );
|
2001-03-19 14:58:50 +00:00
|
|
|
}
|
2001-02-16 14:27:47 +00:00
|
|
|
else if( SW_MC_ROTATE == pCreate->nId )
|
2002-12-10 13:44:59 +00:00
|
|
|
pTmp = new SwRotatedPortion( *pCreate, nEnd,
|
|
|
|
GetTxtFrm()->IsRightToLeft() );
|
2000-11-14 07:21:35 +00:00
|
|
|
else
|
2001-02-06 14:26:49 +00:00
|
|
|
pTmp = new SwDoubleLinePortion( *pCreate, nEnd );
|
2001-04-26 09:37:23 +00:00
|
|
|
|
2001-02-06 14:26:49 +00:00
|
|
|
delete pCreate;
|
2001-04-26 09:37:23 +00:00
|
|
|
CalcFlyWidth( rInf );
|
|
|
|
|
2000-10-26 06:41:24 +00:00
|
|
|
return pTmp;
|
|
|
|
}
|
2000-10-16 12:11:59 +00:00
|
|
|
}
|
2000-09-18 23:08:29 +00:00
|
|
|
// 5010: Tabs und Felder
|
|
|
|
xub_Unicode cChar = rInf.GetHookChar();
|
|
|
|
|
|
|
|
if( cChar )
|
|
|
|
{
|
|
|
|
/* Wir holen uns nocheinmal cChar, um sicherzustellen, dass das
|
|
|
|
* Tab jetzt wirklich ansteht und nicht auf die naechste Zeile
|
|
|
|
* gewandert ist ( so geschehen hinter Rahmen ).
|
|
|
|
* Wenn allerdings eine FldPortion im Rest wartet, muessen wir
|
|
|
|
* das cChar natuerlich aus dem Feldinhalt holen, z.B. bei
|
|
|
|
* DezimalTabs und Feldern (22615)
|
|
|
|
*/
|
|
|
|
if( !rInf.GetRest() || !rInf.GetRest()->InFldGrp() )
|
|
|
|
cChar = rInf.GetChar( rInf.GetIdx() );
|
2004-03-25 11:52:47 +00:00
|
|
|
rInf.ClearHookChar();
|
2000-09-18 23:08:29 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
if( rInf.GetIdx() >= rInf.GetTxt().Len() )
|
|
|
|
{
|
|
|
|
rInf.SetFull(sal_True);
|
|
|
|
CalcFlyWidth( rInf );
|
|
|
|
return pPor;
|
|
|
|
}
|
|
|
|
cChar = rInf.GetChar( rInf.GetIdx() );
|
|
|
|
}
|
|
|
|
|
|
|
|
switch( cChar )
|
|
|
|
{
|
2005-11-16 08:30:45 +00:00
|
|
|
case CH_TAB:
|
|
|
|
pPor = NewTabPortion( rInf, false ); break;
|
|
|
|
|
|
|
|
case CH_BREAK:
|
|
|
|
pPor = new SwBreakPortion( *rInf.GetLast() ); break;
|
2000-09-18 23:08:29 +00:00
|
|
|
|
|
|
|
case CHAR_SOFTHYPHEN: // soft hyphen
|
|
|
|
pPor = new SwSoftHyphPortion; break;
|
|
|
|
|
|
|
|
case CHAR_HARDBLANK: // no-break space
|
|
|
|
pPor = new SwBlankPortion( ' ' ); break;
|
2005-11-16 08:30:45 +00:00
|
|
|
|
2000-09-18 23:08:29 +00:00
|
|
|
case CHAR_HARDHYPHEN: // non-breaking hyphen
|
|
|
|
pPor = new SwBlankPortion( '-' ); break;
|
|
|
|
|
2005-11-16 08:30:45 +00:00
|
|
|
case CHAR_ZWSP: // zero width space
|
|
|
|
case CHAR_ZWNBSP : // word joiner
|
|
|
|
// case CHAR_RLM : // right to left mark
|
|
|
|
// case CHAR_LRM : // left to right mark
|
|
|
|
pPor = new SwControlCharPortion( cChar ); break;
|
|
|
|
|
2000-09-18 23:08:29 +00:00
|
|
|
case CH_TXTATR_BREAKWORD:
|
|
|
|
case CH_TXTATR_INWORD:
|
|
|
|
if( rInf.HasHint( rInf.GetIdx() ) )
|
|
|
|
{
|
|
|
|
pPor = NewExtraPortion( rInf );
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
// No break
|
|
|
|
default :
|
|
|
|
{
|
2006-02-09 12:44:35 +00:00
|
|
|
SwTabPortion* pLastTabPortion = rInf.GetLastTab();
|
|
|
|
if ( pLastTabPortion && cChar == rInf.GetTabDecimal() )
|
|
|
|
{
|
2011-04-18 12:37:38 -03:00
|
|
|
// #127428# Abandon dec. tab position if line is full
|
2006-02-09 12:44:35 +00:00
|
|
|
// We have a decimal tab portion in the line and the next character has to be
|
|
|
|
// aligned at the tab stop position. We store the width from the beginning of
|
|
|
|
// the tab stop portion up to the portion containint the decimal separator:
|
2006-08-14 15:38:45 +00:00
|
|
|
if ( GetTxtFrm()->GetTxtNode()->getIDocumentSettingAccess()->get(IDocumentSettingAccess::TAB_COMPAT) /*rInf.GetVsh()->IsTabCompat();*/ &&
|
|
|
|
POR_TABDECIMAL == pLastTabPortion->GetWhichPor() )
|
2006-02-09 12:44:35 +00:00
|
|
|
{
|
2010-11-25 17:08:45 +01:00
|
|
|
OSL_ENSURE( rInf.X() >= pLastTabPortion->Fix(), "Decimal tab stop position cannot be calculated" );
|
2011-01-17 15:06:54 +01:00
|
|
|
const sal_uInt16 nWidthOfPortionsUpToDecimalPosition = (sal_uInt16)(rInf.X() - pLastTabPortion->Fix() );
|
2006-02-09 12:44:35 +00:00
|
|
|
static_cast<SwTabDecimalPortion*>(pLastTabPortion)->SetWidthOfPortionsUpToDecimalPosition( nWidthOfPortionsUpToDecimalPosition );
|
|
|
|
rInf.SetTabDecimal( 0 );
|
|
|
|
}
|
|
|
|
else
|
|
|
|
rInf.SetFull( rInf.GetLastTab()->Format( rInf ) );
|
|
|
|
}
|
2000-09-18 23:08:29 +00:00
|
|
|
|
|
|
|
if( rInf.GetRest() )
|
|
|
|
{
|
|
|
|
if( rInf.IsFull() )
|
|
|
|
{
|
|
|
|
rInf.SetNewLine(sal_True);
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
pPor = rInf.GetRest();
|
|
|
|
rInf.SetRest(0);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
if( rInf.IsFull() )
|
|
|
|
return 0;
|
|
|
|
pPor = NewTxtPortion( rInf );
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// Wenn eine Portion erzeugt wird, obwohl eine RestPortion ansteht,
|
|
|
|
// dann haben wir es mit einem Feld zu tun, das sich aufgesplittet
|
|
|
|
// hat, weil z.B. ein Tab enthalten ist.
|
|
|
|
if( pPor && rInf.GetRest() )
|
|
|
|
pPor->SetLen( 0 );
|
|
|
|
|
|
|
|
// robust:
|
|
|
|
if( !pPor || rInf.IsStop() )
|
|
|
|
{
|
|
|
|
delete pPor;
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2002-08-07 10:21:57 +00:00
|
|
|
// Special portions containing numbers (footnote anchor, footnote number,
|
|
|
|
// numbering) can be contained in a rotated portion, if the user
|
|
|
|
// choose a rotated character attribute.
|
|
|
|
if ( pPor && ! pMulti )
|
|
|
|
{
|
|
|
|
if ( pPor->IsFtnPortion() )
|
|
|
|
{
|
|
|
|
const SwTxtFtn* pTxtFtn = ((SwFtnPortion*)pPor)->GetTxtFtn();
|
|
|
|
|
|
|
|
if ( pTxtFtn )
|
|
|
|
{
|
|
|
|
SwFmtFtn& rFtn = (SwFmtFtn&)pTxtFtn->GetFtn();
|
|
|
|
const SwDoc *pDoc = rInf.GetTxtFrm()->GetNode()->GetDoc();
|
|
|
|
const SwEndNoteInfo* pInfo;
|
|
|
|
if( rFtn.IsEndNote() )
|
|
|
|
pInfo = &pDoc->GetEndNoteInfo();
|
|
|
|
else
|
|
|
|
pInfo = &pDoc->GetFtnInfo();
|
|
|
|
const SwAttrSet& rSet = pInfo->GetAnchorCharFmt((SwDoc&)*pDoc)->GetAttrSet();
|
|
|
|
|
|
|
|
const SfxPoolItem* pItem;
|
2011-01-17 15:06:54 +01:00
|
|
|
sal_uInt16 nDir = 0;
|
2002-08-07 10:21:57 +00:00
|
|
|
if( SFX_ITEM_SET == rSet.GetItemState( RES_CHRATR_ROTATE,
|
|
|
|
sal_True, &pItem ))
|
|
|
|
nDir = ((SvxCharRotateItem*)pItem)->GetValue();
|
|
|
|
|
|
|
|
if ( 0 != nDir )
|
|
|
|
{
|
|
|
|
delete pPor;
|
|
|
|
pPor = new SwRotatedPortion( rInf.GetIdx() + 1, 900 == nDir ?
|
|
|
|
DIR_BOTTOM2TOP :
|
|
|
|
DIR_TOP2BOTTOM );
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else if ( pPor->InNumberGrp() )
|
|
|
|
{
|
|
|
|
const SwFont* pNumFnt = ((SwFldPortion*)pPor)->GetFont();
|
|
|
|
|
|
|
|
if ( pNumFnt )
|
|
|
|
{
|
2011-01-17 15:06:54 +01:00
|
|
|
sal_uInt16 nDir = pNumFnt->GetOrientation( rInf.GetTxtFrm()->IsVertical() );
|
2002-08-07 10:21:57 +00:00
|
|
|
if ( 0 != nDir )
|
|
|
|
{
|
|
|
|
delete pPor;
|
|
|
|
pPor = new SwRotatedPortion( 0, 900 == nDir ?
|
|
|
|
DIR_BOTTOM2TOP :
|
|
|
|
DIR_TOP2BOTTOM );
|
|
|
|
|
|
|
|
rInf.SetNumDone( sal_False );
|
|
|
|
rInf.SetFtnDone( sal_False );
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2000-09-18 23:08:29 +00:00
|
|
|
// Der Font wird im Outputdevice eingestellt,
|
|
|
|
// der Ascent und die Hoehe werden berechnet.
|
|
|
|
if( !pPor->GetAscent() && !pPor->Height() )
|
|
|
|
CalcAscent( rInf, pPor );
|
|
|
|
rInf.SetLen( pPor->GetLen() );
|
|
|
|
|
|
|
|
// In CalcFlyWidth wird Width() verkuerzt, wenn eine FlyPortion vorliegt.
|
|
|
|
CalcFlyWidth( rInf );
|
|
|
|
|
|
|
|
// Man darf nicht vergessen, dass pCurr als GetLast() vernuenftige
|
|
|
|
// Werte bereithalten muss:
|
|
|
|
if( !pCurr->Height() )
|
|
|
|
{
|
2010-11-25 17:08:45 +01:00
|
|
|
OSL_ENSURE( pCurr->Height(), "SwTxtFormatter::NewPortion: limbo dance" );
|
2000-09-18 23:08:29 +00:00
|
|
|
pCurr->Height( pPor->Height() );
|
|
|
|
pCurr->SetAscent( pPor->GetAscent() );
|
|
|
|
}
|
|
|
|
|
2010-11-25 17:08:45 +01:00
|
|
|
OSL_ENSURE( !pPor || pPor->Height(),
|
2000-09-18 23:08:29 +00:00
|
|
|
"SwTxtFormatter::NewPortion: something went wrong");
|
|
|
|
if( pPor->IsPostItsPortion() && rInf.X() >= rInf.Width() && rInf.GetFly() )
|
|
|
|
{
|
|
|
|
delete pPor;
|
|
|
|
pPor = rInf.GetFly();
|
|
|
|
}
|
|
|
|
return pPor;
|
|
|
|
}
|
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
* SwTxtFormatter::FormatLine()
|
|
|
|
*************************************************************************/
|
|
|
|
|
2007-09-27 08:14:21 +00:00
|
|
|
xub_StrLen SwTxtFormatter::FormatLine( const xub_StrLen nStartPos )
|
2000-09-18 23:08:29 +00:00
|
|
|
{
|
2010-11-25 17:08:45 +01:00
|
|
|
OSL_ENSURE( ! pFrm->IsVertical() || pFrm->IsSwapped(),
|
2007-09-27 08:14:21 +00:00
|
|
|
"SwTxtFormatter::FormatLine( nStartPos ) with unswapped frame" );
|
2001-10-30 12:47:02 +00:00
|
|
|
|
2003-04-01 08:56:36 +00:00
|
|
|
// For the formatting routines, we set pOut to the reference device.
|
2002-11-04 11:27:25 +00:00
|
|
|
SwHookOut aHook( GetInfo() );
|
2000-09-18 23:08:29 +00:00
|
|
|
if( GetInfo().GetLen() < GetInfo().GetTxt().Len() )
|
|
|
|
GetInfo().SetLen( GetInfo().GetTxt().Len() );
|
|
|
|
|
|
|
|
sal_Bool bBuild = sal_True;
|
|
|
|
SetFlyInCntBase( sal_False );
|
|
|
|
GetInfo().SetLineHeight( 0 );
|
2001-04-26 09:37:23 +00:00
|
|
|
GetInfo().SetLineNettoHeight( 0 );
|
2000-09-18 23:08:29 +00:00
|
|
|
|
|
|
|
// Recycling muss bei geaenderter Zeilenhoehe unterdrueckt werden
|
|
|
|
// und auch bei geaendertem Ascent (Absenken der Grundlinie).
|
|
|
|
const KSHORT nOldHeight = pCurr->Height();
|
|
|
|
const KSHORT nOldAscent = pCurr->GetAscent();
|
|
|
|
|
|
|
|
pCurr->SetEndHyph( sal_False );
|
|
|
|
pCurr->SetMidHyph( sal_False );
|
|
|
|
|
2001-04-26 09:37:23 +00:00
|
|
|
// fly positioning can make it necessary format a line several times
|
|
|
|
// for this, we have to keep a copy of our rest portion
|
|
|
|
SwLinePortion* pFld = GetInfo().GetRest();
|
|
|
|
SwFldPortion* pSaveFld = 0;
|
|
|
|
|
2004-02-10 13:56:39 +00:00
|
|
|
if ( pFld && pFld->InFldGrp() && !pFld->IsFtnPortion() )
|
2001-04-26 09:37:23 +00:00
|
|
|
pSaveFld = new SwFldPortion( *((SwFldPortion*)pFld) );
|
|
|
|
|
2001-05-28 15:20:44 +00:00
|
|
|
// for an optimal repaint rectangle, we want to compare fly portions
|
|
|
|
// before and after the BuildPortions call
|
2001-11-02 12:28:47 +00:00
|
|
|
const sal_Bool bOptimizeRepaint = AllowRepaintOpt();
|
2007-09-27 08:14:21 +00:00
|
|
|
const xub_StrLen nOldLineEnd = nStartPos + pCurr->GetLen();
|
2011-02-24 15:14:53 +00:00
|
|
|
std::vector<long> flyStarts;
|
2001-05-28 15:20:44 +00:00
|
|
|
|
|
|
|
// these are the conditions for a fly position comparison
|
|
|
|
if ( bOptimizeRepaint && pCurr->IsFly() )
|
|
|
|
{
|
|
|
|
SwLinePortion* pPor = pCurr->GetFirstPortion();
|
|
|
|
long nPOfst = 0;
|
|
|
|
while ( pPor )
|
|
|
|
{
|
|
|
|
if ( pPor->IsFlyPortion() )
|
|
|
|
// insert start value of fly portion
|
2011-02-24 15:14:53 +00:00
|
|
|
flyStarts.push_back( nPOfst );
|
2001-05-28 15:20:44 +00:00
|
|
|
|
|
|
|
nPOfst += pPor->Width();
|
|
|
|
pPor = pPor->GetPortion();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2000-09-18 23:08:29 +00:00
|
|
|
// Hier folgt bald die Unterlaufpruefung.
|
|
|
|
while( bBuild )
|
|
|
|
{
|
2002-08-27 12:40:01 +00:00
|
|
|
GetInfo().SetFtnInside( sal_False );
|
2010-03-16 09:54:03 +01:00
|
|
|
GetInfo().SetOtherThanFtnInside( sal_False );
|
2002-08-27 12:40:01 +00:00
|
|
|
|
|
|
|
// These values must not be reset by FormatReset();
|
2000-09-18 23:08:29 +00:00
|
|
|
sal_Bool bOldNumDone = GetInfo().IsNumDone();
|
|
|
|
sal_Bool bOldArrowDone = GetInfo().IsArrowDone();
|
2002-08-27 12:40:01 +00:00
|
|
|
sal_Bool bOldErgoDone = GetInfo().IsErgoDone();
|
2001-04-26 09:37:23 +00:00
|
|
|
|
2001-06-08 12:16:51 +00:00
|
|
|
// besides other things, this sets the repaint offset to 0
|
2001-05-28 15:20:44 +00:00
|
|
|
FormatReset( GetInfo() );
|
2001-04-09 09:44:17 +00:00
|
|
|
|
2002-08-27 12:40:01 +00:00
|
|
|
GetInfo().SetNumDone( bOldNumDone );
|
|
|
|
GetInfo().SetArrowDone( bOldArrowDone );
|
|
|
|
GetInfo().SetErgoDone( bOldErgoDone );
|
2001-04-26 09:37:23 +00:00
|
|
|
|
2001-05-28 15:20:44 +00:00
|
|
|
// build new portions for this line
|
2000-09-18 23:08:29 +00:00
|
|
|
BuildPortions( GetInfo() );
|
2001-05-28 15:20:44 +00:00
|
|
|
|
2000-09-18 23:08:29 +00:00
|
|
|
if( GetInfo().IsStop() )
|
|
|
|
{
|
|
|
|
pCurr->SetLen( 0 );
|
|
|
|
pCurr->Height( GetFrmRstHeight() + 1 );
|
|
|
|
pCurr->SetRealHeight( GetFrmRstHeight() + 1 );
|
|
|
|
pCurr->Width(0);
|
|
|
|
pCurr->Truncate();
|
2007-09-27 08:14:21 +00:00
|
|
|
return nStartPos;
|
2000-09-18 23:08:29 +00:00
|
|
|
}
|
|
|
|
else if( GetInfo().IsDropInit() )
|
|
|
|
{
|
|
|
|
DropInit();
|
|
|
|
GetInfo().SetDropInit( sal_False );
|
|
|
|
}
|
|
|
|
|
2000-12-21 08:10:30 +00:00
|
|
|
pCurr->CalcLine( *this, GetInfo() );
|
2000-09-18 23:08:29 +00:00
|
|
|
CalcRealHeight( GetInfo().IsNewLine() );
|
|
|
|
|
|
|
|
if ( IsFlyInCntBase() && !IsQuick() )
|
|
|
|
{
|
|
|
|
KSHORT nTmpAscent, nTmpHeight;
|
|
|
|
CalcAscentAndHeight( nTmpAscent, nTmpHeight );
|
|
|
|
AlignFlyInCntBase( Y() + long( nTmpAscent ) );
|
2000-12-21 08:10:30 +00:00
|
|
|
pCurr->CalcLine( *this, GetInfo() );
|
2000-09-18 23:08:29 +00:00
|
|
|
CalcRealHeight();
|
|
|
|
}
|
|
|
|
|
|
|
|
// bBuild entscheidet, ob noch eine Ehrenrunde gedreht wird
|
2001-04-26 11:24:59 +00:00
|
|
|
if ( pCurr->GetRealHeight() <= GetInfo().GetLineHeight() )
|
2000-09-18 23:08:29 +00:00
|
|
|
{
|
2001-04-26 11:24:59 +00:00
|
|
|
pCurr->SetRealHeight( GetInfo().GetLineHeight() );
|
|
|
|
bBuild = sal_False;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2010-09-30 15:57:10 +01:00
|
|
|
bBuild = ( GetInfo().GetTxtFly()->IsOn() && ChkFlyUnderflow(GetInfo()) )
|
|
|
|
|| GetInfo().CheckFtnPortion(pCurr);
|
2001-04-26 11:24:59 +00:00
|
|
|
if( bBuild )
|
|
|
|
{
|
|
|
|
GetInfo().SetNumDone( bOldNumDone );
|
|
|
|
GetInfo().ResetMaxWidthDiff();
|
2001-04-26 09:37:23 +00:00
|
|
|
|
2001-04-26 11:24:59 +00:00
|
|
|
// delete old rest
|
|
|
|
if ( GetInfo().GetRest() )
|
|
|
|
{
|
|
|
|
delete GetInfo().GetRest();
|
|
|
|
GetInfo().SetRest( 0 );
|
|
|
|
}
|
2001-04-26 09:37:23 +00:00
|
|
|
|
2001-04-26 11:24:59 +00:00
|
|
|
// set original rest portion
|
|
|
|
if ( pSaveFld )
|
|
|
|
GetInfo().SetRest( new SwFldPortion( *pSaveFld ) );
|
2001-04-26 09:37:23 +00:00
|
|
|
|
2001-04-26 11:24:59 +00:00
|
|
|
pCurr->SetLen( 0 );
|
|
|
|
pCurr->Width(0);
|
|
|
|
pCurr->Truncate();
|
|
|
|
}
|
2000-09-18 23:08:29 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2001-05-28 15:20:44 +00:00
|
|
|
// calculate optimal repaint rectangle
|
|
|
|
if ( bOptimizeRepaint )
|
|
|
|
{
|
2011-02-24 17:34:08 +00:00
|
|
|
GetInfo().SetPaintOfst( ::lcl_CalcOptRepaint( *this, *pCurr, nOldLineEnd, flyStarts ) );
|
2011-02-24 15:14:53 +00:00
|
|
|
flyStarts.clear();
|
2001-05-28 15:20:44 +00:00
|
|
|
}
|
2001-06-29 14:49:00 +00:00
|
|
|
else
|
|
|
|
// Special case: We do not allow an optimitation of the repaint
|
|
|
|
// area, but during formatting the repaint offset is set to indicate
|
|
|
|
// a maximum value for the offset. This value has to be reset:
|
|
|
|
GetInfo().SetPaintOfst( 0 );
|
2001-05-28 15:20:44 +00:00
|
|
|
|
2001-06-27 05:16:44 +00:00
|
|
|
// This corrects the start of the reformat range if something has
|
|
|
|
// moved to the next line. Otherwise IsFirstReformat in AllowRepaintOpt
|
|
|
|
// will give us a wrong result if we have to reformat another line
|
|
|
|
GetInfo().GetParaPortion()->GetReformat()->LeftMove( GetInfo().GetIdx() );
|
|
|
|
|
2001-04-26 09:37:23 +00:00
|
|
|
// delete master copy of rest portion
|
|
|
|
if ( pSaveFld )
|
|
|
|
delete pSaveFld;
|
|
|
|
|
2007-09-27 08:14:21 +00:00
|
|
|
xub_StrLen nNewStart = nStartPos + pCurr->GetLen();
|
2001-04-09 09:44:17 +00:00
|
|
|
|
|
|
|
// adjust text if kana compression is enabled
|
|
|
|
if ( GetInfo().CompressLine() )
|
|
|
|
{
|
2005-04-18 13:36:03 +00:00
|
|
|
SwTwips nRepaintOfst = CalcKanaAdj( pCurr );
|
2001-04-09 09:44:17 +00:00
|
|
|
|
|
|
|
// adjust repaint offset
|
|
|
|
if ( nRepaintOfst < GetInfo().GetPaintOfst() )
|
|
|
|
GetInfo().SetPaintOfst( nRepaintOfst );
|
|
|
|
}
|
|
|
|
|
2000-09-18 23:08:29 +00:00
|
|
|
CalcAdjustLine( pCurr );
|
|
|
|
|
|
|
|
if( nOldHeight != pCurr->Height() || nOldAscent != pCurr->GetAscent() )
|
|
|
|
{
|
|
|
|
SetFlyInCntBase();
|
|
|
|
GetInfo().SetPaintOfst( 0 ); //geaenderte Zeilenhoehe => kein Recycling
|
|
|
|
// alle weiteren Zeilen muessen gepaintet und, wenn Flys im Spiel sind
|
|
|
|
// auch formatiert werden.
|
|
|
|
GetInfo().SetShift( sal_True );
|
|
|
|
}
|
|
|
|
|
|
|
|
if ( IsFlyInCntBase() && !IsQuick() )
|
2001-02-01 13:05:11 +00:00
|
|
|
UpdatePos( pCurr, GetTopLeft(), GetStart() );
|
2000-09-18 23:08:29 +00:00
|
|
|
|
|
|
|
return nNewStart;
|
|
|
|
}
|
|
|
|
|
2002-02-08 12:42:08 +00:00
|
|
|
/*************************************************************************
|
|
|
|
* SwTxtFormatter::RecalcRealHeight()
|
|
|
|
*************************************************************************/
|
|
|
|
|
|
|
|
void SwTxtFormatter::RecalcRealHeight()
|
|
|
|
{
|
|
|
|
sal_Bool bMore = sal_True;
|
|
|
|
while(bMore)
|
|
|
|
{
|
|
|
|
CalcRealHeight();
|
|
|
|
bMore = Next() != 0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
* SwTxtFormatter::CalcRealHeight()
|
|
|
|
*************************************************************************/
|
|
|
|
|
|
|
|
void SwTxtFormatter::CalcRealHeight( sal_Bool bNewLine )
|
|
|
|
{
|
|
|
|
KSHORT nLineHeight = pCurr->Height();
|
|
|
|
pCurr->SetClipping( sal_False );
|
|
|
|
|
|
|
|
GETGRID( pFrm->FindPageFrm() )
|
|
|
|
if ( pGrid && GetInfo().SnapToGrid() )
|
|
|
|
{
|
2011-01-17 15:06:54 +01:00
|
|
|
const sal_uInt16 nGridWidth = pGrid->GetBaseHeight();
|
|
|
|
const sal_uInt16 nRubyHeight = pGrid->GetRubyHeight();
|
2002-02-08 12:42:08 +00:00
|
|
|
const sal_Bool bRubyTop = ! pGrid->GetRubyTextBelow();
|
|
|
|
|
2007-09-27 08:14:21 +00:00
|
|
|
nLineHeight = nGridWidth + nRubyHeight;
|
2011-01-17 15:06:54 +01:00
|
|
|
sal_uInt16 nLineDist = nLineHeight;
|
2002-02-08 12:42:08 +00:00
|
|
|
|
|
|
|
while ( pCurr->Height() > nLineHeight )
|
2007-09-27 08:14:21 +00:00
|
|
|
nLineHeight = nLineHeight + nLineDist;
|
2002-02-08 12:42:08 +00:00
|
|
|
|
|
|
|
KSHORT nAsc = pCurr->GetAscent() +
|
|
|
|
( bRubyTop ?
|
|
|
|
( nLineHeight - pCurr->Height() + nRubyHeight ) / 2 :
|
|
|
|
( nLineHeight - pCurr->Height() - nRubyHeight ) / 2 );
|
|
|
|
|
|
|
|
pCurr->Height( nLineHeight );
|
|
|
|
pCurr->SetAscent( nAsc );
|
|
|
|
pInf->GetParaPortion()->SetFixLineHeight();
|
|
|
|
|
2002-05-03 10:48:41 +00:00
|
|
|
// we ignore any line spacing options except from ...
|
|
|
|
const SvxLineSpacingItem* pSpace = aLineInf.GetLineSpacing();
|
|
|
|
if ( ! IsParaLine() && pSpace &&
|
|
|
|
SVX_INTER_LINE_SPACE_PROP == pSpace->GetInterLineSpaceRule() )
|
|
|
|
{
|
2011-01-17 15:06:54 +01:00
|
|
|
sal_uLong nTmp = pSpace->GetPropLineSpace();
|
2002-05-03 10:48:41 +00:00
|
|
|
|
|
|
|
if( nTmp < 100 )
|
|
|
|
nTmp = 100;
|
|
|
|
|
|
|
|
nTmp *= nLineHeight;
|
2011-01-17 15:06:54 +01:00
|
|
|
nLineHeight = (sal_uInt16)(nTmp / 100);
|
2002-05-03 10:48:41 +00:00
|
|
|
}
|
2002-02-08 12:42:08 +00:00
|
|
|
|
|
|
|
pCurr->SetRealHeight( nLineHeight );
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
// Das Dummyflag besitzen Zeilen, die nur Flyportions enthalten, diese
|
|
|
|
// sollten kein Register etc. beachten. Dummerweise hat kann es eine leere
|
2006-08-14 15:38:45 +00:00
|
|
|
// Zeile am Absatzende geben (bei leeren Abs?tzen oder nach einem
|
2002-02-08 12:42:08 +00:00
|
|
|
// Shift-Return), die das Register durchaus beachten soll.
|
|
|
|
if( !pCurr->IsDummy() || ( !pCurr->GetNext() &&
|
|
|
|
GetStart() >= GetTxtFrm()->GetTxt().Len() && !bNewLine ) )
|
|
|
|
{
|
|
|
|
const SvxLineSpacingItem *pSpace = aLineInf.GetLineSpacing();
|
|
|
|
if( pSpace )
|
|
|
|
{
|
|
|
|
switch( pSpace->GetLineSpaceRule() )
|
|
|
|
{
|
|
|
|
case SVX_LINE_SPACE_AUTO:
|
2010-09-14 14:32:01 +02:00
|
|
|
if (pSpace->GetInterLineSpaceRule()==SVX_INTER_LINE_SPACE_PROP) {
|
|
|
|
long nTmp = pSpace->GetPropLineSpace();
|
|
|
|
if (nTmp<100) { // code adaped from fixed line height
|
|
|
|
nTmp *= nLineHeight;
|
|
|
|
nTmp /= 100;
|
|
|
|
if( !nTmp )
|
|
|
|
++nTmp;
|
|
|
|
nLineHeight = (KSHORT)nTmp;
|
|
|
|
/*
|
|
|
|
//@TODO figure out how WW maps ascent and descent
|
|
|
|
//in case of prop line spacing <100%
|
|
|
|
KSHORT nAsc = ( 4 * nLineHeight ) / 5; // 80%
|
|
|
|
if( nAsc < pCurr->GetAscent() ||
|
|
|
|
nLineHeight - nAsc < pCurr->Height() -
|
|
|
|
pCurr->GetAscent() )
|
|
|
|
pCurr->SetClipping( sal_True );
|
|
|
|
pCurr->SetAscent( nAsc );
|
|
|
|
*/
|
|
|
|
pCurr->Height( nLineHeight );
|
|
|
|
pInf->GetParaPortion()->SetFixLineHeight();
|
|
|
|
}
|
|
|
|
}
|
2002-02-08 12:42:08 +00:00
|
|
|
break;
|
|
|
|
case SVX_LINE_SPACE_MIN:
|
|
|
|
{
|
|
|
|
if( nLineHeight < KSHORT( pSpace->GetLineHeight() ) )
|
|
|
|
nLineHeight = pSpace->GetLineHeight();
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
case SVX_LINE_SPACE_FIX:
|
|
|
|
{
|
|
|
|
nLineHeight = pSpace->GetLineHeight();
|
|
|
|
KSHORT nAsc = ( 4 * nLineHeight ) / 5; // 80%
|
|
|
|
if( nAsc < pCurr->GetAscent() ||
|
|
|
|
nLineHeight - nAsc < pCurr->Height() - pCurr->GetAscent() )
|
|
|
|
pCurr->SetClipping( sal_True );
|
|
|
|
pCurr->Height( nLineHeight );
|
|
|
|
pCurr->SetAscent( nAsc );
|
|
|
|
pInf->GetParaPortion()->SetFixLineHeight();
|
|
|
|
}
|
|
|
|
break;
|
2011-03-19 14:13:18 +01:00
|
|
|
default: OSL_FAIL( ": unknown LineSpaceRule" );
|
2002-02-08 12:42:08 +00:00
|
|
|
}
|
|
|
|
if( !IsParaLine() )
|
|
|
|
switch( pSpace->GetInterLineSpaceRule() )
|
|
|
|
{
|
|
|
|
case SVX_INTER_LINE_SPACE_OFF:
|
|
|
|
break;
|
|
|
|
case SVX_INTER_LINE_SPACE_PROP:
|
|
|
|
{
|
|
|
|
long nTmp = pSpace->GetPropLineSpace();
|
|
|
|
// 50% ist das Minimum, bei 0% schalten wir auf
|
|
|
|
// den Defaultwert 100% um ...
|
|
|
|
if( nTmp < 50 )
|
|
|
|
nTmp = nTmp ? 50 : 100;
|
|
|
|
|
|
|
|
nTmp *= nLineHeight;
|
|
|
|
nTmp /= 100;
|
|
|
|
if( !nTmp )
|
|
|
|
++nTmp;
|
|
|
|
nLineHeight = (KSHORT)nTmp;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
case SVX_INTER_LINE_SPACE_FIX:
|
|
|
|
{
|
2007-09-27 08:14:21 +00:00
|
|
|
nLineHeight = nLineHeight + pSpace->GetInterLineSpace();
|
2002-02-08 12:42:08 +00:00
|
|
|
break;
|
|
|
|
}
|
2011-03-19 14:13:18 +01:00
|
|
|
default: OSL_FAIL( ": unknown InterLineSpaceRule" );
|
2002-02-08 12:42:08 +00:00
|
|
|
}
|
|
|
|
}
|
2003-04-15 15:54:23 +00:00
|
|
|
#if OSL_DEBUG_LEVEL > 1
|
2002-02-08 12:42:08 +00:00
|
|
|
KSHORT nDummy = nLineHeight + 1;
|
2007-09-27 08:14:21 +00:00
|
|
|
(void)nDummy;
|
2002-02-08 12:42:08 +00:00
|
|
|
#endif
|
|
|
|
|
|
|
|
if( IsRegisterOn() )
|
|
|
|
{
|
|
|
|
SwTwips nTmpY = Y() + pCurr->GetAscent() + nLineHeight - pCurr->Height();
|
|
|
|
SWRECTFN( pFrm )
|
|
|
|
if ( bVert )
|
|
|
|
nTmpY = pFrm->SwitchHorizontalToVertical( nTmpY );
|
|
|
|
nTmpY = (*fnRect->fnYDiff)( nTmpY, RegStart() );
|
|
|
|
KSHORT nDiff = KSHORT( nTmpY % RegDiff() );
|
|
|
|
if( nDiff )
|
|
|
|
nLineHeight += RegDiff() - nDiff;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
pCurr->SetRealHeight( nLineHeight );
|
|
|
|
}
|
|
|
|
|
2000-09-18 23:08:29 +00:00
|
|
|
/*************************************************************************
|
|
|
|
* SwTxtFormatter::FeedInf()
|
|
|
|
*************************************************************************/
|
|
|
|
|
|
|
|
void SwTxtFormatter::FeedInf( SwTxtFormatInfo &rInf ) const
|
|
|
|
{
|
|
|
|
// 3260, 3860: Fly auf jeden Fall loeschen!
|
|
|
|
ClearFly( rInf );
|
|
|
|
rInf.Init();
|
|
|
|
|
|
|
|
rInf.ChkNoHyph( CntEndHyph(), CntMidHyph() );
|
|
|
|
rInf.SetRoot( pCurr );
|
|
|
|
rInf.SetLineStart( nStart );
|
|
|
|
rInf.SetIdx( nStart );
|
2003-12-01 08:40:58 +00:00
|
|
|
|
|
|
|
// Handle overflows:
|
2011-04-16 22:42:13 -03:00
|
|
|
// #i34348# Changed type from sal_uInt16 to SwTwips
|
2003-12-01 08:40:58 +00:00
|
|
|
SwTwips nTmpLeft = Left();
|
|
|
|
SwTwips nTmpRight = Right();
|
|
|
|
SwTwips nTmpFirst = FirstLeft();
|
|
|
|
|
|
|
|
if ( nTmpLeft > USHRT_MAX ||
|
|
|
|
nTmpRight > USHRT_MAX ||
|
|
|
|
nTmpFirst > USHRT_MAX )
|
|
|
|
{
|
|
|
|
SWRECTFN( rInf.GetTxtFrm() )
|
|
|
|
nTmpLeft = (rInf.GetTxtFrm()->Frm().*fnRect->fnGetLeft)();
|
|
|
|
nTmpRight = (rInf.GetTxtFrm()->Frm().*fnRect->fnGetRight)();
|
|
|
|
nTmpFirst = nTmpLeft;
|
|
|
|
}
|
|
|
|
|
2004-12-23 09:09:46 +00:00
|
|
|
rInf.Left( nTmpLeft );
|
|
|
|
rInf.Right( nTmpRight );
|
|
|
|
rInf.First( nTmpFirst );
|
2003-12-01 08:40:58 +00:00
|
|
|
|
2000-09-18 23:08:29 +00:00
|
|
|
rInf.RealWidth( KSHORT(rInf.Right()) - KSHORT(GetLeftMargin()) );
|
|
|
|
rInf.Width( rInf.RealWidth() );
|
|
|
|
if( ((SwTxtFormatter*)this)->GetRedln() )
|
|
|
|
{
|
|
|
|
((SwTxtFormatter*)this)->GetRedln()->Clear( ((SwTxtFormatter*)this)->GetFnt() );
|
|
|
|
((SwTxtFormatter*)this)->GetRedln()->Reset();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
* SwTxtFormatter::FormatReset()
|
|
|
|
*************************************************************************/
|
|
|
|
|
|
|
|
void SwTxtFormatter::FormatReset( SwTxtFormatInfo &rInf )
|
|
|
|
{
|
|
|
|
pCurr->Truncate();
|
|
|
|
pCurr->Init();
|
|
|
|
if( pBlink && pCurr->IsBlinking() )
|
|
|
|
pBlink->Delete( pCurr );
|
2001-06-13 07:32:25 +00:00
|
|
|
|
|
|
|
// delete pSpaceAdd und pKanaComp
|
|
|
|
pCurr->FinishSpaceAdd();
|
|
|
|
pCurr->FinishKanaComp();
|
2000-09-18 23:08:29 +00:00
|
|
|
pCurr->ResetFlags();
|
|
|
|
FeedInf( rInf );
|
|
|
|
}
|
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
* SwTxtFormatter::CalcOnceMore()
|
|
|
|
*************************************************************************/
|
|
|
|
|
|
|
|
sal_Bool SwTxtFormatter::CalcOnceMore()
|
|
|
|
{
|
|
|
|
if( pDropFmt )
|
|
|
|
{
|
|
|
|
const KSHORT nOldDrop = GetDropHeight();
|
|
|
|
CalcDropHeight( pDropFmt->GetLines() );
|
|
|
|
bOnceMore = nOldDrop != GetDropHeight();
|
|
|
|
}
|
|
|
|
else
|
|
|
|
bOnceMore = sal_False;
|
|
|
|
return bOnceMore;
|
|
|
|
}
|
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
* SwTxtFormatter::CalcBottomLine()
|
|
|
|
*************************************************************************/
|
|
|
|
|
|
|
|
SwTwips SwTxtFormatter::CalcBottomLine() const
|
|
|
|
{
|
|
|
|
SwTwips nRet = Y() + GetLineHeight();
|
|
|
|
SwTwips nMin = GetInfo().GetTxtFly()->GetMinBottom();
|
|
|
|
if( nMin && ++nMin > nRet )
|
|
|
|
{
|
|
|
|
SwTwips nDist = pFrm->Frm().Height() - pFrm->Prt().Height()
|
|
|
|
- pFrm->Prt().Top();
|
|
|
|
if( nRet + nDist < nMin )
|
|
|
|
{
|
|
|
|
sal_Bool bRepaint = HasTruncLines() &&
|
|
|
|
GetInfo().GetParaPortion()->GetRepaint()->Bottom() == nRet-1;
|
|
|
|
nRet = nMin - nDist;
|
|
|
|
if( bRepaint )
|
|
|
|
{
|
|
|
|
((SwRepaint*)GetInfo().GetParaPortion()
|
|
|
|
->GetRepaint())->Bottom( nRet-1 );
|
|
|
|
((SwTxtFormatInfo&)GetInfo()).SetPaintOfst( 0 );
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return nRet;
|
|
|
|
}
|
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
* SwTxtFormatter::_CalcFitToContent()
|
2003-05-28 11:52:04 +00:00
|
|
|
*
|
2008-03-05 16:06:20 +00:00
|
|
|
* FME/OD: This routine does a limited text formatting.
|
2000-09-18 23:08:29 +00:00
|
|
|
*************************************************************************/
|
|
|
|
|
2005-04-18 13:36:03 +00:00
|
|
|
SwTwips SwTxtFormatter::_CalcFitToContent()
|
2000-09-18 23:08:29 +00:00
|
|
|
{
|
2004-05-18 13:52:55 +00:00
|
|
|
FormatReset( GetInfo() );
|
|
|
|
BuildPortions( GetInfo() );
|
|
|
|
pCurr->CalcLine( *this, GetInfo() );
|
|
|
|
return pCurr->Width();
|
2000-09-18 23:08:29 +00:00
|
|
|
}
|
|
|
|
|
2001-05-28 15:20:44 +00:00
|
|
|
/*************************************************************************
|
|
|
|
* SwTxtFormatter::AllowRepaintOpt()
|
|
|
|
*
|
|
|
|
* determines if the calculation of a repaint offset is allowed
|
|
|
|
* otherwise each line is painted from 0 (this is a copy of the beginning
|
|
|
|
* of the former SwTxtFormatter::Recycle() function
|
|
|
|
*************************************************************************/
|
2001-11-02 12:28:47 +00:00
|
|
|
sal_Bool SwTxtFormatter::AllowRepaintOpt() const
|
2001-05-28 15:20:44 +00:00
|
|
|
{
|
|
|
|
// reformat position in front of current line? Only in this case
|
|
|
|
// we want to set the repaint offset
|
2001-11-02 12:28:47 +00:00
|
|
|
sal_Bool bOptimizeRepaint = nStart < GetInfo().GetReformatStart() &&
|
|
|
|
pCurr->GetLen();
|
2001-05-28 15:20:44 +00:00
|
|
|
|
|
|
|
// a special case is the last line of a block adjusted paragraph:
|
|
|
|
if ( bOptimizeRepaint )
|
|
|
|
{
|
|
|
|
switch( GetAdjust() )
|
|
|
|
{
|
|
|
|
case SVX_ADJUST_BLOCK:
|
|
|
|
{
|
|
|
|
if( IsLastBlock() || IsLastCenter() )
|
|
|
|
bOptimizeRepaint = sal_False;
|
|
|
|
else
|
|
|
|
{
|
|
|
|
// ????: Blank in der letzten Masterzeile (blocksat.sdw)
|
|
|
|
bOptimizeRepaint = 0 == pCurr->GetNext() && !pFrm->GetFollow();
|
|
|
|
if ( bOptimizeRepaint )
|
|
|
|
{
|
|
|
|
SwLinePortion *pPos = pCurr->GetFirstPortion();
|
|
|
|
while ( pPos && !pPos->IsFlyPortion() )
|
|
|
|
pPos = pPos->GetPortion();
|
|
|
|
bOptimizeRepaint = !pPos;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
case SVX_ADJUST_CENTER:
|
|
|
|
case SVX_ADJUST_RIGHT:
|
|
|
|
bOptimizeRepaint = sal_False;
|
|
|
|
break;
|
|
|
|
default: ;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2001-06-08 12:16:51 +00:00
|
|
|
// Schon wieder ein Sonderfall: unsichtbare SoftHyphs
|
2001-11-02 12:28:47 +00:00
|
|
|
const xub_StrLen nReformat = GetInfo().GetReformatStart();
|
2001-06-08 12:16:51 +00:00
|
|
|
if( bOptimizeRepaint && STRING_LEN != nReformat )
|
|
|
|
{
|
2001-11-02 12:28:47 +00:00
|
|
|
const xub_Unicode cCh = GetInfo().GetTxt().GetChar( nReformat );
|
2001-06-08 12:16:51 +00:00
|
|
|
bOptimizeRepaint = ( CH_TXTATR_BREAKWORD != cCh && CH_TXTATR_INWORD != cCh )
|
2001-11-02 12:28:47 +00:00
|
|
|
|| ! GetInfo().HasHint( nReformat );
|
2001-06-08 12:16:51 +00:00
|
|
|
}
|
|
|
|
|
2001-05-28 15:20:44 +00:00
|
|
|
return bOptimizeRepaint;
|
|
|
|
}
|
|
|
|
|
2011-02-24 17:34:08 +00:00
|
|
|
namespace {
|
|
|
|
/*************************************************************************
|
|
|
|
* ::CalcOptRepaint()
|
|
|
|
*
|
|
|
|
* calculates and sets optimal repaint offset for the current line
|
|
|
|
*************************************************************************/
|
|
|
|
long lcl_CalcOptRepaint( SwTxtFormatter &rThis,
|
|
|
|
SwLineLayout &rCurr,
|
|
|
|
const xub_StrLen nOldLineEnd,
|
|
|
|
const std::vector<long> &rFlyStarts )
|
2001-05-28 15:20:44 +00:00
|
|
|
{
|
2011-02-24 17:34:08 +00:00
|
|
|
SwTxtFormatInfo txtFmtInfo = rThis.GetInfo();
|
|
|
|
if ( txtFmtInfo.GetIdx() < txtFmtInfo.GetReformatStart() )
|
|
|
|
// the reformat position is behind our new line, that means
|
|
|
|
// something of our text has moved to the next line
|
2001-06-08 12:16:51 +00:00
|
|
|
return 0;
|
2001-05-28 15:20:44 +00:00
|
|
|
|
2011-02-24 17:34:08 +00:00
|
|
|
xub_StrLen nReformat = Min( txtFmtInfo.GetReformatStart(), nOldLineEnd );
|
2001-05-28 15:20:44 +00:00
|
|
|
|
2011-02-24 17:34:08 +00:00
|
|
|
// in case we do not have any fly in our line, our repaint position
|
|
|
|
// is the changed position - 1
|
|
|
|
if ( rFlyStarts.empty() && ! rCurr.IsFly() )
|
2001-05-28 15:20:44 +00:00
|
|
|
{
|
2011-02-24 17:34:08 +00:00
|
|
|
// this is the maximum repaint offset determined during formatting
|
|
|
|
// for example: the beginning of the first right tab stop
|
|
|
|
// if this value is 0, this means that we do not have an upper
|
|
|
|
// limit for the repaint offset
|
|
|
|
const long nFormatRepaint = txtFmtInfo.GetPaintOfst();
|
|
|
|
|
|
|
|
if ( nReformat < txtFmtInfo.GetLineStart() + 3 )
|
|
|
|
return 0;
|
|
|
|
|
|
|
|
// step back two positions for smoother repaint
|
|
|
|
nReformat -= 2;
|
|
|
|
|
|
|
|
#ifndef QUARTZ
|
|
|
|
#ifndef ENABLE_GRAPHITE
|
2011-04-16 22:42:13 -03:00
|
|
|
// #i28795#, #i34607#, #i38388#
|
2011-02-24 17:34:08 +00:00
|
|
|
// step back six(!) more characters for complex scripts
|
|
|
|
// this is required e.g., for Khmer (thank you, Javier!)
|
|
|
|
const SwScriptInfo& rSI = txtFmtInfo.GetParaPortion()->GetScriptInfo();
|
|
|
|
xub_StrLen nMaxContext = 0;
|
|
|
|
if( ::i18n::ScriptType::COMPLEX == rSI.ScriptType( nReformat ) )
|
|
|
|
nMaxContext = 6;
|
|
|
|
#else
|
|
|
|
// Some Graphite fonts need context for scripts not marked as complex
|
|
|
|
static const xub_StrLen nMaxContext = 10;
|
|
|
|
#endif
|
|
|
|
#else
|
|
|
|
// some fonts like Quartz's Zapfino need more context
|
|
|
|
// TODO: query FontInfo for maximum unicode context
|
|
|
|
static const xub_StrLen nMaxContext = 8;
|
|
|
|
#endif
|
|
|
|
if( nMaxContext > 0 )
|
2001-05-28 15:20:44 +00:00
|
|
|
{
|
2011-02-24 17:34:08 +00:00
|
|
|
if ( nReformat > txtFmtInfo.GetLineStart() + nMaxContext )
|
|
|
|
nReformat = nReformat - nMaxContext;
|
2001-05-28 15:20:44 +00:00
|
|
|
else
|
2011-02-24 17:34:08 +00:00
|
|
|
nReformat = txtFmtInfo.GetLineStart();
|
2001-05-28 15:20:44 +00:00
|
|
|
}
|
2011-02-24 17:34:08 +00:00
|
|
|
|
|
|
|
// Weird situation: Our line used to end with a hole portion
|
|
|
|
// and we delete some characters at the end of our line. We have
|
|
|
|
// to take care for repainting the blanks which are not anymore
|
|
|
|
// covered by the hole portion
|
|
|
|
while ( nReformat > txtFmtInfo.GetLineStart() &&
|
|
|
|
CH_BLANK == txtFmtInfo.GetChar( nReformat ) )
|
|
|
|
--nReformat;
|
|
|
|
|
|
|
|
OSL_ENSURE( nReformat < txtFmtInfo.GetIdx(), "Reformat too small for me!" );
|
|
|
|
SwRect aRect;
|
|
|
|
|
|
|
|
// Note: GetChareRect is not const. It definitely changes the
|
|
|
|
// bMulti flag. We have to save and resore the old value.
|
|
|
|
sal_Bool bOldMulti = txtFmtInfo.IsMulti();
|
|
|
|
rThis.GetCharRect( &aRect, nReformat );
|
|
|
|
txtFmtInfo.SetMulti( bOldMulti );
|
|
|
|
|
|
|
|
return nFormatRepaint ? Min( aRect.Left(), nFormatRepaint ) :
|
|
|
|
aRect.Left();
|
2001-05-28 15:20:44 +00:00
|
|
|
}
|
2011-02-24 17:34:08 +00:00
|
|
|
else
|
|
|
|
{
|
|
|
|
// nReformat may be wrong, if something around flys has changed:
|
|
|
|
// we compare the former and the new fly positions in this line
|
|
|
|
// if anything has changed, we carefully have to adjust the right
|
|
|
|
// repaint position
|
|
|
|
long nPOfst = 0;
|
2011-03-14 16:51:14 +00:00
|
|
|
sal_uInt16 nCnt = 0;
|
|
|
|
sal_uInt16 nX = 0;
|
|
|
|
sal_uInt16 nIdx = rThis.GetInfo().GetLineStart();
|
2011-02-24 17:34:08 +00:00
|
|
|
SwLinePortion* pPor = rCurr.GetFirstPortion();
|
|
|
|
|
|
|
|
while ( pPor )
|
|
|
|
{
|
|
|
|
if ( pPor->IsFlyPortion() )
|
|
|
|
{
|
|
|
|
// compare start of fly with former start of fly
|
|
|
|
if (nCnt < rFlyStarts.size() &&
|
|
|
|
nX == rFlyStarts[ nCnt ] &&
|
|
|
|
nIdx < nReformat
|
|
|
|
)
|
|
|
|
// found fix position, nothing has changed left from nX
|
|
|
|
nPOfst = nX + pPor->Width();
|
|
|
|
else
|
|
|
|
break;
|
2001-05-28 15:20:44 +00:00
|
|
|
|
2011-02-24 17:34:08 +00:00
|
|
|
nCnt++;
|
|
|
|
}
|
|
|
|
nX = nX + pPor->Width();
|
|
|
|
nIdx = nIdx + pPor->GetLen();
|
|
|
|
pPor = pPor->GetPortion();
|
|
|
|
}
|
2001-05-28 15:20:44 +00:00
|
|
|
|
2011-02-24 17:34:08 +00:00
|
|
|
return nPOfst + rThis.GetLeftMargin();
|
|
|
|
}
|
|
|
|
}
|
2004-02-26 14:32:14 +00:00
|
|
|
|
2011-02-24 17:34:08 +00:00
|
|
|
// Determine if we need to build hidden portions
|
|
|
|
bool lcl_BuildHiddenPortion( const SwTxtSizeInfo& rInf, xub_StrLen &rPos )
|
2004-02-26 14:32:14 +00:00
|
|
|
{
|
2011-02-24 17:34:08 +00:00
|
|
|
// Only if hidden text should not be shown:
|
|
|
|
// if ( rInf.GetVsh() && rInf.GetVsh()->GetWin() && rInf.GetOpt().IsShowHiddenChar() )
|
|
|
|
const bool bShowInDocView = rInf.GetVsh() && rInf.GetVsh()->GetWin() && rInf.GetOpt().IsShowHiddenChar();
|
2011-03-14 16:51:14 +00:00
|
|
|
const bool bShowForPrinting = rInf.GetOpt().IsShowHiddenChar( sal_True ) && rInf.GetOpt().IsPrinting();
|
2011-02-24 17:34:08 +00:00
|
|
|
if (bShowInDocView || bShowForPrinting)
|
|
|
|
return false;
|
|
|
|
|
|
|
|
const SwScriptInfo& rSI = rInf.GetParaPortion()->GetScriptInfo();
|
|
|
|
xub_StrLen nHiddenStart;
|
|
|
|
xub_StrLen nHiddenEnd;
|
|
|
|
rSI.GetBoundsOfHiddenRange( rPos, nHiddenStart, nHiddenEnd );
|
|
|
|
if ( nHiddenEnd )
|
|
|
|
{
|
|
|
|
rPos = nHiddenEnd;
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
return false;
|
2004-02-26 14:32:14 +00:00
|
|
|
}
|
2001-05-28 15:20:44 +00:00
|
|
|
|
2011-02-24 17:34:08 +00:00
|
|
|
} //end unnamed namespace
|
2010-10-14 08:30:41 +02:00
|
|
|
|
|
|
|
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|