Files
libreoffice/sw/source/core/edit/edlingu.cxx

1744 lines
63 KiB
C++
Raw Normal View History

/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
re-base on ALv2 code. Includes: Patches contributed by Oliver-Rainer Wittmann sw34bf06: #i117783# - Writer's implementation of XPagePrintable - apply print settings to new printing routines http://svn.apache.org/viewvc?view=revision&revision=1172115 sw34bf06: #o12311627# use <rtl_random> methods to create unique ids for list styles and list ids http://svn.apache.org/viewvc?view=revision&revision=1172112 sw34bf06 #i114725#,#i115828# - method <SwDoc::ClearDoc()> - clear list structures completely http://svn.apache.org/viewvc?view=revision&revision=1172122 i#118572 - remove ui string and help content regarding usage of Java Mail in Writer's Mail Merge as Java Mail is not used. http://svn.apache.org/viewvc?view=revision&revision=1197035 Patches contributed by Mathias Bauer cws mba34issues01: #i117718#: provide filter name in case storage of medium does not allow to detect one http://svn.apache.org/viewvc?view=revision&revision=1172350 cws mba34issues01: #i117721#: directly provide parameters retrieved from SfxMedium http://svn.apache.org/viewvc?view=revision&revision=1172353 gnumake4 work variously http://svn.apache.org/viewvc?view=revision&revision=1394707 http://svn.apache.org/viewvc?view=revision&revision=1394326 http://svn.apache.org/viewvc?view=revision&revision=1396797 http://svn.apache.org/viewvc?view=revision&revision=1397315 cws mba34issues01: #i117723#: convert assertion into trace http://svn.apache.org/viewvc?view=revision&revision=1172355 cws mba34issues01: #i117699#: keep layout alive until swdoc dies http://svn.apache.org/viewvc?view=revision&revision=1172362 cws mba34issues01: #i117943#: missing color attributes in RTF clipboard http://svn.apache.org/viewvc?view=revision&revision=1172363 Patch contributed by Henning Brinkmann imported patch i#103878 http://svn.apache.org/viewvc?view=revision&revision=1172109 Patches contributed by Michael Stahl sw34bf06: #i117955#: WW8 export: disable storing of section breaks in endnotes http://svn.apache.org/viewvc?view=revision&revision=1172119 Patch contributed by imacat Fixed the Asian language work count. http://svn.apache.org/viewvc?view=revision&revision=1241345 Patch contributed by Pedro Giffuni i#20878 - Add comment with BZ issue for reference. http://svn.apache.org/viewvc?view=revision&revision=1244517 Patch contributed by Andre Fischer Do not add targets for junit tests when junit is disabled. http://svn.apache.org/viewvc?view=revision&revision=1241508 add writerperfect dependency.
2011-03-31 10:05:04 +02:00
/*
* This file is part of the LibreOffice project.
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*
* This file incorporates work covered by the following license notice:
*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed
* with this work for additional information regarding copyright
* ownership. The ASF licenses this file to you under the Apache
* License, Version 2.0 (the "License"); you may not use this file
* except in compliance with the License. You may obtain a copy of
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
2000-09-18 23:08:29 +00:00
2008-12-15 12:01:46 +00:00
#include <com/sun/star/linguistic2/ProofreadingResult.hpp>
#include <com/sun/star/linguistic2/XProofreader.hpp>
#include <com/sun/star/linguistic2/XProofreadingIterator.hpp>
#include <com/sun/star/text/XFlatParagraph.hpp>
2011-11-18 21:03:31 +00:00
#include <comphelper/string.hxx>
#include <unoflatpara.hxx>
2000-09-18 23:08:29 +00:00
#include <comcore.hrc>
#include <hintids.hxx>
2000-11-19 10:41:10 +00:00
#include <linguistic/lngprops.hxx>
2000-09-18 23:08:29 +00:00
#include <vcl/msgbox.hxx>
#include <editeng/unolingu.hxx>
#include <editeng/svxacorr.hxx>
#include <editeng/langitem.hxx>
#include <editeng/SpellPortions.hxx>
#include <editeng/scripttypeitem.hxx>
2000-09-18 23:08:29 +00:00
#include <charatr.hxx>
#include <editsh.hxx>
#include <doc.hxx>
#include <IDocumentUndoRedo.hxx>
#include <rootfrm.hxx>
2000-09-18 23:08:29 +00:00
#include <pam.hxx>
#include <swundo.hxx>
#include <ndtxt.hxx>
#include <viewopt.hxx>
#include <viscrs.hxx>
#include <SwGrammarMarkUp.hxx>
#include <mdiexp.hxx>
#include <statstr.hrc>
#include <cntfrm.hxx>
#include <crsskip.hxx>
#include <splargs.hxx>
#include <redline.hxx>
#include <docary.hxx>
#include <docsh.hxx>
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
#include <txatbase.hxx>
#include <txtfrm.hxx>
2000-10-27 10:55:57 +00:00
using namespace ::svx;
2000-09-18 23:08:29 +00:00
using namespace ::com::sun::star;
2000-10-27 10:55:57 +00:00
using namespace ::com::sun::star::uno;
using namespace ::com::sun::star::beans;
using namespace ::com::sun::star::linguistic2;
2000-09-18 23:08:29 +00:00
class SwLinguIter
{
SwEditShell *pSh;
SwPosition *pStart;
SwPosition *pEnd;
SwPosition *pCurr;
SwPosition *pCurrX;
sal_uInt16 nCrsrCnt;
public:
SwLinguIter();
inline SwEditShell *GetSh() { return pSh; }
inline const SwEditShell *GetSh() const { return pSh; }
inline const SwPosition *GetEnd() const { return pEnd; }
inline void SetEnd( SwPosition* pNew ){ delete pEnd; pEnd = pNew; }
inline const SwPosition *GetStart() const { return pStart; }
inline void SetStart( SwPosition* pNew ){ delete pStart; pStart = pNew; }
inline const SwPosition *GetCurr() const { return pCurr; }
inline void SetCurr( SwPosition* pNew ){ delete pCurr; pCurr = pNew; }
inline const SwPosition *GetCurrX() const { return pCurrX; }
inline void SetCurrX( SwPosition* pNew ){ delete pCurrX; pCurrX = pNew; }
inline sal_uInt16& GetCrsrCnt(){ return nCrsrCnt; }
// for the UI:
2000-09-18 23:08:29 +00:00
void _Start( SwEditShell *pSh, SwDocPositions eStart,
SwDocPositions eEnd );
void _End(bool bRestoreSelection = true);
2000-09-18 23:08:29 +00:00
};
// #i18881# to be able to identify the postions of the changed words
// the content positions of each portion need to be saved
struct SpellContentPosition
{
sal_Int32 nLeft;
sal_Int32 nRight;
};
typedef std::vector<SpellContentPosition> SpellContentPositions;
2000-09-18 23:08:29 +00:00
class SwSpellIter : public SwLinguIter
{
2000-10-27 10:55:57 +00:00
uno::Reference< XSpellChecker1 > xSpeller;
::svx::SpellPortions aLastPortions;
SpellContentPositions aLastPositions;
2008-12-15 12:01:46 +00:00
bool bBackToStartOfSentence;
bool bMoveToEndOfSentence;
void CreatePortion(uno::Reference< XSpellAlternatives > xAlt,
2008-12-15 12:01:46 +00:00
linguistic2::ProofreadingResult* pGrammarResult,
bool bIsField, bool bIsHidden);
void AddPortion(uno::Reference< XSpellAlternatives > xAlt,
2008-12-15 12:01:46 +00:00
linguistic2::ProofreadingResult* pGrammarResult,
const SpellContentPositions& rDeletedRedlines);
2000-09-18 23:08:29 +00:00
public:
2008-12-15 12:01:46 +00:00
SwSpellIter() :
bBackToStartOfSentence(false), bMoveToEndOfSentence(false) {}
2000-09-18 23:08:29 +00:00
void Start( SwEditShell *pSh, SwDocPositions eStart, SwDocPositions eEnd );
uno::Any Continue( sal_uInt16* pPageCnt, sal_uInt16* pPageSt );
bool SpellSentence(::svx::SpellPortions& rPortions, bool bIsGrammarCheck);
2008-12-15 12:01:46 +00:00
void ToSentenceStart();
2011-02-01 23:11:04 +01:00
const ::svx::SpellPortions GetLastPortions() const { return aLastPortions;}
SpellContentPositions GetLastPositions() const {return aLastPositions;}
void ContinueAfterThisSentence() { bMoveToEndOfSentence = true; }
};
/// used for text conversion
class SwConvIter : public SwLinguIter
{
SwConversionArgs &rArgs;
public:
SwConvIter( SwConversionArgs &rConvArgs ) :
rArgs( rConvArgs )
{}
void Start( SwEditShell *pSh, SwDocPositions eStart, SwDocPositions eEnd );
uno::Any Continue( sal_uInt16* pPageCnt, sal_uInt16* pPageSt );
2000-09-18 23:08:29 +00:00
};
class SwHyphIter : public SwLinguIter
{
sal_Bool bOldIdle;
void DelSoftHyph( SwPaM &rPam );
public:
SwHyphIter() : bOldIdle(sal_False) {}
void Start( SwEditShell *pSh, SwDocPositions eStart, SwDocPositions eEnd );
void End();
void Ignore();
uno::Any Continue( sal_uInt16* pPageCnt, sal_uInt16* pPageSt );
2000-09-18 23:08:29 +00:00
sal_Bool IsAuto();
void InsertSoftHyph( const sal_Int32 nHyphPos );
2000-09-18 23:08:29 +00:00
void ShowSelection();
};
static SwSpellIter* pSpellIter = 0;
static SwConvIter* pConvIter = 0;
2000-09-18 23:08:29 +00:00
static SwHyphIter* pHyphIter = 0;
// With that we save a GetFrm() in Hyphenate.
// Caution: There are external declaration to these pointers in txtedt.cxx!
2000-09-18 23:08:29 +00:00
const SwTxtNode *pLinguNode;
SwTxtFrm *pLinguFrm;
SwLinguIter::SwLinguIter()
: pSh( 0 ), pStart( 0 ), pEnd( 0 ), pCurr( 0 ), pCurrX( 0 )
{
// TODO missing: ensurance of re-entrance, OSL_ENSURE( etc.
2000-09-18 23:08:29 +00:00
}
void SwLinguIter::_Start( SwEditShell *pShell, SwDocPositions eStart,
SwDocPositions eEnd )
2000-09-18 23:08:29 +00:00
{
// TODO missing: ensurance of re-entrance, locking
2000-09-18 23:08:29 +00:00
if( pSh )
return;
bool bSetCurr;
2000-09-18 23:08:29 +00:00
pSh = pShell;
SET_CURR_SHELL( pSh );
OSL_ENSURE( !pEnd, "SwLinguIter::_Start without End?");
2000-09-18 23:08:29 +00:00
SwPaM *pCrsr = pSh->GetCrsr();
if( pShell->HasSelection() || pCrsr != pCrsr->GetNext() )
{
bSetCurr = 0 != GetCurr();
nCrsrCnt = pSh->GetCrsrCnt();
if( pSh->IsTableMode() )
pSh->TblCrsrToCursor();
pSh->Push();
sal_uInt16 n;
for( n = 0; n < nCrsrCnt; ++n )
{
pSh->Push();
pSh->DestroyCrsr();
}
pSh->Pop( sal_False );
}
else
{
bSetCurr = false;
2000-09-18 23:08:29 +00:00
nCrsrCnt = 1;
pSh->Push();
pSh->SetLinguRange( eStart, eEnd );
}
pCrsr = pSh->GetCrsr();
if ( *pCrsr->GetPoint() > *pCrsr->GetMark() )
pCrsr->Exchange();
pStart = new SwPosition( *pCrsr->GetPoint() );
pEnd = new SwPosition( *pCrsr->GetMark() );
if( bSetCurr )
{
SwPosition* pNew = new SwPosition( *GetStart() );
2000-09-18 23:08:29 +00:00
SetCurr( pNew );
pNew = new SwPosition( *pNew );
SetCurrX( pNew );
}
pCrsr->SetMark();
pLinguFrm = 0;
pLinguNode = 0;
}
void SwLinguIter::_End(bool bRestoreSelection)
2000-09-18 23:08:29 +00:00
{
if( !pSh )
return;
OSL_ENSURE( pEnd, "SwLinguIter::_End without end?");
if(bRestoreSelection)
{
while( nCrsrCnt-- )
pSh->Pop( sal_False );
2000-09-18 23:08:29 +00:00
pSh->KillPams();
pSh->ClearMark();
}
2000-09-18 23:08:29 +00:00
DELETEZ(pStart);
DELETEZ(pEnd);
DELETEZ(pCurr);
DELETEZ(pCurrX);
pSh = 0;
}
void SwSpellIter::Start( SwEditShell *pShell, SwDocPositions eStart,
SwDocPositions eEnd )
{
if( GetSh() )
return;
xSpeller = ::GetSpellChecker();
if ( xSpeller.is() )
_Start( pShell, eStart, eEnd );
aLastPortions.clear();
aLastPositions.clear();
2000-09-18 23:08:29 +00:00
}
// This method is the origin of SwEditShell::SpellContinue()
uno::Any SwSpellIter::Continue( sal_uInt16* pPageCnt, sal_uInt16* pPageSt )
2000-09-18 23:08:29 +00:00
{
//!!
//!! Please check SwConvIter also when modifying this
//!!
uno::Any aSpellRet;
SwEditShell *pMySh = GetSh();
if( !pMySh )
return aSpellRet;
2000-09-18 23:08:29 +00:00
OSL_ENSURE( GetEnd(), "SwSpellIter::Continue without start?");
2000-09-18 23:08:29 +00:00
uno::Reference< uno::XInterface > xSpellRet;
bool bGoOn = true;
do {
SwPaM *pCrsr = pMySh->GetCrsr();
2000-09-18 23:08:29 +00:00
if ( !pCrsr->HasMark() )
pCrsr->SetMark();
uno::Reference< beans::XPropertySet > xProp( GetLinguPropertySet() );
*pMySh->GetCrsr()->GetPoint() = *GetCurr();
*pMySh->GetCrsr()->GetMark() = *GetEnd();
pMySh->GetDoc()->Spell(*pMySh->GetCrsr(),
xSpeller, pPageCnt, pPageSt, false ) >>= xSpellRet;
2000-09-18 23:08:29 +00:00
bGoOn = GetCrsrCnt() > 1;
if( xSpellRet.is() )
{
bGoOn = false;
2000-09-18 23:08:29 +00:00
SwPosition* pNewPoint = new SwPosition( *pCrsr->GetPoint() );
SwPosition* pNewMark = new SwPosition( *pCrsr->GetMark() );
SetCurr( pNewPoint );
SetCurrX( pNewMark );
2000-09-18 23:08:29 +00:00
}
if( bGoOn )
{
pMySh->Pop( sal_False );
pCrsr = pMySh->GetCrsr();
2000-09-18 23:08:29 +00:00
if ( *pCrsr->GetPoint() > *pCrsr->GetMark() )
pCrsr->Exchange();
SwPosition* pNew = new SwPosition( *pCrsr->GetPoint() );
SetStart( pNew );
pNew = new SwPosition( *pCrsr->GetMark() );
SetEnd( pNew );
pNew = new SwPosition( *GetStart() );
2000-09-18 23:08:29 +00:00
SetCurr( pNew );
pNew = new SwPosition( *pNew );
SetCurrX( pNew );
pCrsr->SetMark();
--GetCrsrCnt();
}
}while ( bGoOn );
aSpellRet <<= xSpellRet;
return aSpellRet;
}
void SwConvIter::Start( SwEditShell *pShell, SwDocPositions eStart,
SwDocPositions eEnd )
{
if( GetSh() )
return;
_Start( pShell, eStart, eEnd );
}
uno::Any SwConvIter::Continue( sal_uInt16* pPageCnt, sal_uInt16* pPageSt )
{
//!!
//!! Please check SwSpellIter also when modifying this
//!!
uno::Any aConvRet( makeAny( OUString() ) );
SwEditShell *pMySh = GetSh();
if( !pMySh )
return aConvRet;
OSL_ENSURE( GetEnd(), "SwConvIter::Continue() without Start?");
OUString aConvText;
bool bGoOn = true;
do {
SwPaM *pCrsr = pMySh->GetCrsr();
if ( !pCrsr->HasMark() )
pCrsr->SetMark();
*pMySh->GetCrsr()->GetPoint() = *GetCurr();
*pMySh->GetCrsr()->GetMark() = *GetEnd();
// call function to find next text portion to be converted
uno::Reference< linguistic2::XSpellChecker1 > xEmpty;
pMySh->GetDoc()->Spell( *pMySh->GetCrsr(),
xEmpty, pPageCnt, pPageSt, false, &rArgs ) >>= aConvText;
bGoOn = GetCrsrCnt() > 1;
if( !aConvText.isEmpty() )
{
bGoOn = false;
SwPosition* pNewPoint = new SwPosition( *pCrsr->GetPoint() );
SwPosition* pNewMark = new SwPosition( *pCrsr->GetMark() );
SetCurr( pNewPoint );
SetCurrX( pNewMark );
}
if( bGoOn )
{
pMySh->Pop( sal_False );
pCrsr = pMySh->GetCrsr();
if ( *pCrsr->GetPoint() > *pCrsr->GetMark() )
pCrsr->Exchange();
SwPosition* pNew = new SwPosition( *pCrsr->GetPoint() );
SetStart( pNew );
pNew = new SwPosition( *pCrsr->GetMark() );
SetEnd( pNew );
pNew = new SwPosition( *GetStart() );
SetCurr( pNew );
pNew = new SwPosition( *pNew );
SetCurrX( pNew );
pCrsr->SetMark();
--GetCrsrCnt();
}
}while ( bGoOn );
return makeAny( aConvText );
2000-09-18 23:08:29 +00:00
}
sal_Bool SwHyphIter::IsAuto()
{
uno::Reference< beans::XPropertySet > xProp( ::GetLinguPropertySet() );
return xProp.is() ? *(sal_Bool*)xProp->getPropertyValue(
OUString(UPN_IS_HYPH_AUTO) ).getValue()
: sal_False;
2000-09-18 23:08:29 +00:00
}
void SwHyphIter::ShowSelection()
{
SwEditShell *pMySh = GetSh();
if( pMySh )
2000-09-18 23:08:29 +00:00
{
pMySh->StartAction();
// Caution! Due to EndAction() formatting is started which can lead to the fact that new
// words are added to/set in the Hyphenator. Thus: save!
pMySh->EndAction();
2000-09-18 23:08:29 +00:00
}
}
void SwHyphIter::Start( SwEditShell *pShell, SwDocPositions eStart, SwDocPositions eEnd )
{
// robust
if( GetSh() || GetEnd() )
{
OSL_ENSURE( !GetSh(), "SwHyphIter::Start: missing HyphEnd()" );
2000-09-18 23:08:29 +00:00
return;
}
// nothing to do (at least not in the way as in the "else" part)
2000-09-18 23:08:29 +00:00
bOldIdle = pShell->GetViewOptions()->IsIdle();
((SwViewOption*)pShell->GetViewOptions())->SetIdle( sal_False );
_Start( pShell, eStart, eEnd );
}
// restore selections
2000-09-18 23:08:29 +00:00
void SwHyphIter::End()
{
if( !GetSh() )
return;
((SwViewOption*)GetSh()->GetViewOptions())->SetIdle( bOldIdle );
_End();
}
uno::Any SwHyphIter::Continue( sal_uInt16* pPageCnt, sal_uInt16* pPageSt )
2000-09-18 23:08:29 +00:00
{
uno::Any aHyphRet;
SwEditShell *pMySh = GetSh();
if( !pMySh )
return aHyphRet;
2000-09-18 23:08:29 +00:00
const bool bAuto = IsAuto();
2000-10-27 10:55:57 +00:00
uno::Reference< XHyphenatedWord > xHyphWord;
bool bGoOn = false;
2000-09-18 23:08:29 +00:00
do {
SwPaM *pCrsr;
do {
OSL_ENSURE( GetEnd(), "SwHyphIter::Continue without Start?" );
pCrsr = pMySh->GetCrsr();
2000-09-18 23:08:29 +00:00
if ( !pCrsr->HasMark() )
pCrsr->SetMark();
if ( *pCrsr->GetPoint() < *pCrsr->GetMark() )
{
pCrsr->Exchange();
pCrsr->SetMark();
}
if ( *pCrsr->End() <= *GetEnd() )
2000-09-18 23:08:29 +00:00
{
*pCrsr->GetMark() = *GetEnd();
// Do we need to break the word at the current cursor position?
const Point aCrsrPos( pMySh->GetCharRect().Pos() );
xHyphWord = pMySh->GetDoc()->Hyphenate( pCrsr, aCrsrPos,
2000-09-18 23:08:29 +00:00
pPageCnt, pPageSt );
}
if( bAuto && xHyphWord.is() )
{
pMySh->InsertSoftHyph( xHyphWord->getHyphenationPos() + 1);
2000-09-18 23:08:29 +00:00
}
} while( bAuto && xHyphWord.is() ); //end of do-while
bGoOn = !xHyphWord.is() && GetCrsrCnt() > 1;
if( bGoOn )
{
pMySh->Pop( sal_False );
pCrsr = pMySh->GetCrsr();
2000-09-18 23:08:29 +00:00
if ( *pCrsr->GetPoint() > *pCrsr->GetMark() )
pCrsr->Exchange();
SwPosition* pNew = new SwPosition(*pCrsr->End());
SetEnd( pNew );
pCrsr->SetMark();
--GetCrsrCnt();
}
} while ( bGoOn );
aHyphRet <<= xHyphWord;
return aHyphRet;
2000-09-18 23:08:29 +00:00
}
/// ignore hyphenation
2000-09-18 23:08:29 +00:00
void SwHyphIter::Ignore()
{
SwEditShell *pMySh = GetSh();
SwPaM *pCrsr = pMySh->GetCrsr();
2000-09-18 23:08:29 +00:00
// delete old SoftHyphen
2000-09-18 23:08:29 +00:00
DelSoftHyph( *pCrsr );
// and continue
2000-09-18 23:08:29 +00:00
pCrsr->Start()->nContent = pCrsr->End()->nContent;
pCrsr->SetMark();
}
void SwHyphIter::DelSoftHyph( SwPaM &rPam )
{
const SwPosition* pStt = rPam.Start();
const sal_Int32 nStart = pStt->nContent.GetIndex();
const sal_Int32 nEnd = rPam.End()->nContent.GetIndex();
2000-09-18 23:08:29 +00:00
SwTxtNode *pNode = pStt->nNode.GetNode().GetTxtNode();
pNode->DelSoftHyph( nStart, nEnd );
}
void SwHyphIter::InsertSoftHyph( const sal_Int32 nHyphPos )
2000-09-18 23:08:29 +00:00
{
SwEditShell *pMySh = GetSh();
OSL_ENSURE( pMySh, "SwHyphIter::InsertSoftHyph: missing HyphStart()");
if( !pMySh )
2000-09-18 23:08:29 +00:00
return;
SwPaM *pCrsr = pMySh->GetCrsr();
SwPosition* pSttPos = pCrsr->Start();
SwPosition* pEndPos = pCrsr->End();
2000-09-18 23:08:29 +00:00
const sal_Int32 nLastHyphLen = GetEnd()->nContent.GetIndex() -
pSttPos->nContent.GetIndex();
2000-09-18 23:08:29 +00:00
if( pSttPos->nNode != pEndPos->nNode || !nLastHyphLen )
2000-09-18 23:08:29 +00:00
{
OSL_ENSURE( pSttPos->nNode == pEndPos->nNode,
"SwHyphIter::InsertSoftHyph: node warp during hyphenation" );
OSL_ENSURE(nLastHyphLen, "SwHyphIter::InsertSoftHyph: missing HyphContinue()");
*pSttPos = *pEndPos;
2000-09-18 23:08:29 +00:00
return;
}
pMySh->StartAction();
2000-09-18 23:08:29 +00:00
{
SwDoc *pDoc = pMySh->GetDoc();
2000-09-18 23:08:29 +00:00
DelSoftHyph( *pCrsr );
pSttPos->nContent += nHyphPos;
SwPaM aRg( *pSttPos );
pDoc->InsertString( aRg, OUString(CHAR_SOFTHYPHEN) );
2000-09-18 23:08:29 +00:00
}
// revoke selection
2000-09-18 23:08:29 +00:00
pCrsr->DeleteMark();
pMySh->EndAction();
2000-09-18 23:08:29 +00:00
pCrsr->SetMark();
}
bool SwEditShell::HasLastSentenceGotGrammarChecked() const
{
bool bTextWasGrammarChecked = false;
if (pSpellIter)
{
::svx::SpellPortions aLastPortions( pSpellIter->GetLastPortions() );
for (size_t i = 0; i < aLastPortions.size() && !bTextWasGrammarChecked; ++i)
{
// bIsGrammarError is also true if the text was only checked but no
// grammar error was found. (That is if a ProofreadingResult was obtained in
// SwDoc::Spell and in turn bIsGrammarError was set in SwSpellIter::CreatePortion)
if (aLastPortions[i].bIsGrammarError)
bTextWasGrammarChecked = true;
}
}
return bTextWasGrammarChecked;
}
sal_Bool SwEditShell::HasConvIter() const
{
return 0 != pConvIter;
}
sal_Bool SwEditShell::HasHyphIter() const
2000-09-18 23:08:29 +00:00
{
return 0 != pHyphIter;
}
void SwEditShell::SetLinguRange( SwDocPositions eStart, SwDocPositions eEnd )
{
SwPaM *pCrsr = GetCrsr();
MakeFindRange( static_cast<sal_uInt16>(eStart), static_cast<sal_uInt16>(eEnd), pCrsr );
2000-09-18 23:08:29 +00:00
if( *pCrsr->GetPoint() > *pCrsr->GetMark() )
pCrsr->Exchange();
}
void SwEditShell::SpellStart(
SwDocPositions eStart, SwDocPositions eEnd, SwDocPositions eCurr,
SwConversionArgs *pConvArgs )
2000-09-18 23:08:29 +00:00
{
SwLinguIter *pLinguIter = 0;
2000-09-18 23:08:29 +00:00
// do not spell if interactive spelling is active elsewhere
if (!pConvArgs && !pSpellIter)
2000-09-18 23:08:29 +00:00
{
OSL_ENSURE( !pSpellIter, "wer ist da schon am spellen?" );
2000-09-18 23:08:29 +00:00
pSpellIter = new SwSpellIter;
pLinguIter = pSpellIter;
}
// do not do text conversion if it is active elsewhere
if (pConvArgs && !pConvIter)
{
OSL_ENSURE( !pConvIter, "text conversion already active!" );
pConvIter = new SwConvIter( *pConvArgs );
pLinguIter = pConvIter;
}
2000-09-18 23:08:29 +00:00
if (pLinguIter)
{
2000-09-18 23:08:29 +00:00
SwCursor* pSwCrsr = GetSwCrsr();
SwPosition *pTmp = new SwPosition( *pSwCrsr->GetPoint() );
pSwCrsr->FillFindPos( eCurr, *pTmp );
pLinguIter->SetCurr( pTmp );
2000-09-18 23:08:29 +00:00
pTmp = new SwPosition( *pTmp );
pLinguIter->SetCurrX( pTmp );
}
2000-09-18 23:08:29 +00:00
if (!pConvArgs && pSpellIter)
2000-09-18 23:08:29 +00:00
pSpellIter->Start( this, eStart, eEnd );
if (pConvArgs && pConvIter)
pConvIter->Start( this, eStart, eEnd );
2000-09-18 23:08:29 +00:00
}
void SwEditShell::SpellEnd( SwConversionArgs *pConvArgs, bool bRestoreSelection )
2000-09-18 23:08:29 +00:00
{
if (!pConvArgs && pSpellIter && pSpellIter->GetSh() == this)
2000-09-18 23:08:29 +00:00
{
OSL_ENSURE( pSpellIter, "wo ist mein Iterator?" );
pSpellIter->_End(bRestoreSelection);
2000-09-18 23:08:29 +00:00
delete pSpellIter, pSpellIter = 0;
}
if (pConvArgs && pConvIter && pConvIter->GetSh() == this)
{
OSL_ENSURE( pConvIter, "wo ist mein Iterator?" );
pConvIter->_End();
delete pConvIter, pConvIter = 0;
}
2000-09-18 23:08:29 +00:00
}
/// @returns SPL_ return values as in splchk.hxx
uno::Any SwEditShell::SpellContinue(
sal_uInt16* pPageCnt, sal_uInt16* pPageSt,
SwConversionArgs *pConvArgs )
2000-09-18 23:08:29 +00:00
{
uno::Any aRes;
if ((!pConvArgs && pSpellIter->GetSh() != this) ||
( pConvArgs && pConvIter->GetSh() != this))
return aRes;
2000-09-18 23:08:29 +00:00
if( pPageCnt && !*pPageCnt )
{
sal_uInt16 nEndPage = GetLayout()->GetPageNum();
nEndPage += nEndPage * 10 / 100;
*pPageCnt = nEndPage;
if( nEndPage )
::StartProgress( STR_STATSTR_SPELL, 0, nEndPage, GetDoc()->GetDocShell() );
}
OSL_ENSURE( pConvArgs || pSpellIter, "SpellIter missing" );
OSL_ENSURE( !pConvArgs || pConvIter, "ConvIter missing" );
//JP 18.07.95: prevent displaying selection on error messages. NO StartAction so that all
// Paints are also disabled.
++mnStartAction;
OUString aRet;
uno::Reference< uno::XInterface > xRet;
if (pConvArgs)
{
pConvIter->Continue( pPageCnt, pPageSt ) >>= aRet;
aRes <<= aRet;
}
else
{
pSpellIter->Continue( pPageCnt, pPageSt ) >>= xRet;
aRes <<= xRet;
}
--mnStartAction;
2000-09-18 23:08:29 +00:00
if( !aRet.isEmpty() || xRet.is() )
2000-09-18 23:08:29 +00:00
{
// then make awt::Selection again visible
2000-09-18 23:08:29 +00:00
StartAction();
EndAction();
}
return aRes;
2000-09-18 23:08:29 +00:00
}
/* Interactive Hyphenation (BP 10.03.93)
2000-09-18 23:08:29 +00:00
*
* 1) HyphStart
* - Revoke all Selections
* - Save current Cursor
* - if no selections existant:
* - create new selection reaching until document end
2000-09-18 23:08:29 +00:00
* 2) HyphContinue
* - add nLastHyphLen onto SelectionStart
* - iterate over all selected areas
* - pDoc->Hyphenate() iterates over all Nodes of a selection
* - pTxtNode->Hyphenate() calls SwTxtFrm::Hyphenate of the EditShell
* - SwTxtFrm:Hyphenate() iterates over all rows of the Pam
* - LineIter::Hyphenate() sets the Hyphenator and the Pam based on
* the to be separated word.
* - Returns sal_True if there is a hyphenation and sal_False if the Pam is processed.
* - If sal_True, show the selected word and set nLastHyphLen.
* - If sal_False, delete current selection and select next one. Returns HYPH_OK if no more.
* 3) InsertSoftHyph (might be called by UI if needed)
* - Place current cursor and add attribute.
2000-09-18 23:08:29 +00:00
* 4) HyphEnd
* - Restore old cursor, EndAction
2000-09-18 23:08:29 +00:00
*/
void SwEditShell::HyphStart( SwDocPositions eStart, SwDocPositions eEnd )
{
// do not hyphenate if interactive hyphenationg is active elsewhere
if (!pHyphIter)
{
OSL_ENSURE( !pHyphIter, "wer ist da schon am hyphinieren?" );
2000-09-18 23:08:29 +00:00
pHyphIter = new SwHyphIter;
pHyphIter->Start( this, eStart, eEnd );
}
}
/// restore selections
2000-09-18 23:08:29 +00:00
void SwEditShell::HyphEnd()
{
if (pHyphIter->GetSh() == this)
{
OSL_ENSURE( pHyphIter, "No Iterator" );
2000-09-18 23:08:29 +00:00
pHyphIter->End();
delete pHyphIter, pHyphIter = 0;
}
}
/// @returns HYPH_CONTINUE if hyphenation, HYPH_OK if selected area was processed.
2000-09-18 23:08:29 +00:00
uno::Reference< uno::XInterface >
SwEditShell::HyphContinue( sal_uInt16* pPageCnt, sal_uInt16* pPageSt )
{
if (pHyphIter->GetSh() != this)
return 0;
if( pPageCnt && !*pPageCnt && !*pPageSt )
{
sal_uInt16 nEndPage = GetLayout()->GetPageNum();
nEndPage += nEndPage * 10 / 100;
if( nEndPage > 14 )
{
*pPageCnt = nEndPage;
::StartProgress( STR_STATSTR_HYPHEN, 0, nEndPage, GetDoc()->GetDocShell());
}
else // here we once and for all suppress StatLineStartPercent
*pPageSt = 1;
2000-09-18 23:08:29 +00:00
}
OSL_ENSURE( pHyphIter, "No Iterator" );
//JP 18.07.95: prevent displaying selection on error messages. NO StartAction so that all
// Paints are also disabled.
++mnStartAction;
uno::Reference< uno::XInterface > xRet;
pHyphIter->Continue( pPageCnt, pPageSt ) >>= xRet;
--mnStartAction;
2000-09-18 23:08:29 +00:00
if( xRet.is() )
pHyphIter->ShowSelection();
return xRet;
}
/** Insert soft hyphen
*
* @param nHyphPos Offset in the to be separated word
*/
2000-09-18 23:08:29 +00:00
void SwEditShell::InsertSoftHyph( const xub_StrLen nHyphPos )
{
OSL_ENSURE( pHyphIter, "wo ist mein Iterator?" );
2000-09-18 23:08:29 +00:00
pHyphIter->InsertSoftHyph( nHyphPos );
}
/// ignore hyphenation
2000-09-18 23:08:29 +00:00
void SwEditShell::HyphIgnore()
{
OSL_ENSURE( pHyphIter, "No Iterator" );
//JP 18.07.95: prevent displaying selection on error messages. NO StartAction so that all
// Paints are also disabled.
++mnStartAction;
2000-09-18 23:08:29 +00:00
pHyphIter->Ignore();
--mnStartAction;
2000-09-18 23:08:29 +00:00
pHyphIter->ShowSelection();
}
/** Get a list of potential corrections for misspelled word.
*
* If empty, word is unknown but there are no corrections available.
* If NULL then the word is not misspelled but correct.
*
* @brief SwEditShell::GetCorrection
* @return list or NULL pointer
*/
2000-10-27 10:55:57 +00:00
uno::Reference< XSpellAlternatives >
SwEditShell::GetCorrection( const Point* pPt, SwRect& rSelectRect )
2000-09-18 23:08:29 +00:00
{
2000-10-27 10:55:57 +00:00
uno::Reference< XSpellAlternatives > xSpellAlt;
2000-09-18 23:08:29 +00:00
if( IsTableMode() )
return NULL;
SwPaM* pCrsr = GetCrsr();
SwPosition aPos( *pCrsr->GetPoint() );
Point aPt( *pPt );
SwCrsrMoveState eTmpState( MV_SETONLYTEXT );
SwTxtNode *pNode;
SwWrongList *pWrong;
if( GetLayout()->GetCrsrOfst( &aPos, aPt, &eTmpState ) &&
0 != (pNode = aPos.nNode.GetNode().GetTxtNode()) &&
0 != (pWrong = pNode->GetWrong()) &&
!pNode->IsInProtectSect() )
{
sal_Int32 nBegin = aPos.nContent.GetIndex();
sal_Int32 nLen = 1;
2000-09-18 23:08:29 +00:00
if( pWrong->InWrongWord(nBegin,nLen) && !pNode->IsSymbol(nBegin) )
{
const OUString aText(pNode->GetTxt().copy(nBegin, nLen));
OUString aWord( aText );
2011-11-18 21:03:31 +00:00
aWord = comphelper::string::remove(aWord, CH_TXTATR_BREAKWORD);
aWord = comphelper::string::remove(aWord, CH_TXTATR_INWORD);
2000-09-18 23:08:29 +00:00
2000-10-27 10:55:57 +00:00
uno::Reference< XSpellChecker1 > xSpell( ::GetSpellChecker() );
2000-09-18 23:08:29 +00:00
if( xSpell.is() )
{
LanguageType eActLang = (LanguageType)pNode->GetLang( nBegin, nLen );
2000-09-18 23:08:29 +00:00
if( xSpell->hasLanguage( eActLang ))
{
// restrict the maximal number of suggestions displayed
// in the context menu.
// Note: That could of course be done by clipping the
// resulting sequence but the current third party
// implementations result differs greatly if the number of
// suggestions to be retuned gets changed. Statistically
// it gets much better if told to return e.g. only 7 strings
// than returning e.g. 16 suggestions and using only the
// first 7. Thus we hand down the value to use to that
// implementation here by providing an additional parameter.
Sequence< PropertyValue > aPropVals(1);
PropertyValue &rVal = aPropVals.getArray()[0];
rVal.Name = OUString( UPN_MAX_NUMBER_OF_SUGGESTIONS );
rVal.Value <<= (sal_Int16) 7;
xSpellAlt = xSpell->spell( aWord, eActLang, aPropVals );
}
2000-09-18 23:08:29 +00:00
}
if ( xSpellAlt.is() ) // error found?
2000-09-18 23:08:29 +00:00
{
// save the start and end positons of the line and the starting point
Push();
LeftMargin();
const sal_Int32 nLineStart = GetCrsr()->GetPoint()->nContent.GetIndex();
RightMargin();
const sal_Int32 nLineEnd = GetCrsr()->GetPoint()->nContent.GetIndex();
Pop(sal_False);
// make sure the selection build later from the data below does
// not "in word" character to the left and right in order to
// preserve those. Therefore count those "in words" in order to
// modify the selection accordingly.
const sal_Unicode* pChar = aText.getStr();
sal_Int32 nLeft = 0;
while (pChar && *pChar++ == CH_TXTATR_INWORD)
++nLeft;
pChar = aText.getLength() ? aText.getStr() + aText.getLength() - 1 : 0;
sal_Int32 nRight = 0;
while (pChar && *pChar-- == CH_TXTATR_INWORD)
++nRight;
aPos.nContent = nBegin + nLeft;
pCrsr = GetCrsr();
2000-09-18 23:08:29 +00:00
*pCrsr->GetPoint() = aPos;
pCrsr->SetMark();
ExtendSelection( sal_True, nLen - nLeft - nRight );
// don't determine the rectangle in the current line
const sal_Int32 nWordStart = (nBegin + nLeft) < nLineStart ? nLineStart : nBegin + nLeft;
// take one less than the line end - otherwise the next line would be calculated
const sal_Int32 nWordEnd = (nBegin + nLen - nLeft - nRight) > nLineEnd
? nLineEnd : (nBegin + nLen - nLeft - nRight);
Push();
pCrsr->DeleteMark();
SwIndex& rContent = GetCrsr()->GetPoint()->nContent;
rContent = nWordStart;
SwRect aStartRect;
SwCrsrMoveState aState;
aState.bRealWidth = sal_True;
SwCntntNode* pCntntNode = pCrsr->GetCntntNode();
SwCntntFrm *pCntntFrame = pCntntNode->getLayoutFrm( GetLayout(), pPt, pCrsr->GetPoint(), sal_False);
pCntntFrame->GetCharRect( aStartRect, *pCrsr->GetPoint(), &aState );
rContent = nWordEnd - 1;
SwRect aEndRect;
pCntntFrame->GetCharRect( aEndRect, *pCrsr->GetPoint(),&aState );
rSelectRect = aStartRect.Union( aEndRect );
Pop(sal_False);
2000-09-18 23:08:29 +00:00
}
}
}
return xSpellAlt;
}
bool SwEditShell::GetGrammarCorrection(
linguistic2::ProofreadingResult /*out*/ &rResult, // the complete result
sal_Int32 /*out*/ &rErrorPosInText, // offset of error position in string that was grammar checked...
sal_Int32 /*out*/ &rErrorIndexInResult, // index of error in rResult.aGrammarErrors
uno::Sequence< OUString > /*out*/ &rSuggestions, // suggestions to be used for the error found
const Point *pPt, SwRect &rSelectRect )
{
bool bRes = false;
if( IsTableMode() )
return bRes;
SwPaM* pCrsr = GetCrsr();
SwPosition aPos( *pCrsr->GetPoint() );
Point aPt( *pPt );
SwCrsrMoveState eTmpState( MV_SETONLYTEXT );
SwTxtNode *pNode;
SwGrammarMarkUp *pWrong;
if( GetLayout()->GetCrsrOfst( &aPos, aPt, &eTmpState ) &&
0 != (pNode = aPos.nNode.GetNode().GetTxtNode()) &&
0 != (pWrong = pNode->GetGrammarCheck()) &&
!pNode->IsInProtectSect() )
{
sal_Int32 nBegin = aPos.nContent.GetIndex();
sal_Int32 nLen = 1;
if (pWrong->InWrongWord(nBegin, nLen))
{
const OUString aText(pNode->GetTxt().copy(nBegin, nLen));
uno::Reference< linguistic2::XProofreadingIterator > xGCIterator( mpDoc->GetGCIterator() );
if (xGCIterator.is())
{
uno::Reference< lang::XComponent > xDoc( mpDoc->GetDocShell()->GetBaseModel(), uno::UNO_QUERY );
// Expand the string:
const ModelToViewHelper aConversionMap(*pNode);
OUString aExpandText = aConversionMap.getViewText();
// get XFlatParagraph to use...
uno::Reference< text::XFlatParagraph > xFlatPara = new SwXFlatParagraph( *pNode, aExpandText, aConversionMap );
// get error position of cursor in XFlatParagraph
rErrorPosInText = aConversionMap.ConvertToViewPosition( nBegin );
const sal_Int32 nStartOfSentence = aConversionMap.ConvertToViewPosition( pWrong->getSentenceStart( nBegin ) );
const sal_Int32 nEndOfSentence = aConversionMap.ConvertToViewPosition( pWrong->getSentenceEnd( nBegin ) );
2008-12-15 12:01:46 +00:00
rResult = xGCIterator->checkSentenceAtPosition(
xDoc, xFlatPara, aExpandText, lang::Locale(), nStartOfSentence,
nEndOfSentence == STRING_LEN ? aExpandText.getLength() : nEndOfSentence,
rErrorPosInText );
bRes = true;
// get suggestions to use for the specific error position
2008-12-15 12:01:46 +00:00
sal_Int32 nErrors = rResult.aErrors.getLength();
rSuggestions.realloc( 0 );
for (sal_Int32 i = 0; i < nErrors; ++i )
{
// return suggestions for first error that includes the given error position
2008-12-15 12:01:46 +00:00
const linguistic2::SingleProofreadingError &rError = rResult.aErrors[i];
if (rError.nErrorStart <= rErrorPosInText &&
rErrorPosInText + nLen <= rError.nErrorStart + rError.nErrorLength)
{
rSuggestions = rError.aSuggestions;
rErrorIndexInResult = i;
break;
}
}
}
2008-12-15 12:01:46 +00:00
if (rResult.aErrors.getLength() > 0) // error found?
{
// save the start and end positons of the line and the starting point
Push();
LeftMargin();
const sal_Int32 nLineStart = GetCrsr()->GetPoint()->nContent.GetIndex();
RightMargin();
const sal_Int32 nLineEnd = GetCrsr()->GetPoint()->nContent.GetIndex();
Pop(sal_False);
// make sure the selection build later from the data below does
// not include "in word" character to the left and right in
// order to preserve those. Therefore count those "in words" in
// order to modify the selection accordingly.
const sal_Unicode* pChar = aText.getStr();
sal_Int32 nLeft = 0;
while (pChar && *pChar++ == CH_TXTATR_INWORD)
++nLeft;
pChar = aText.getLength() ? aText.getStr() + aText.getLength() - 1 : 0;
sal_Int32 nRight = 0;
while (pChar && *pChar-- == CH_TXTATR_INWORD)
++nRight;
aPos.nContent = nBegin + nLeft;
pCrsr = GetCrsr();
*pCrsr->GetPoint() = aPos;
pCrsr->SetMark();
ExtendSelection( sal_True, nLen - nLeft - nRight );
// don't determine the rectangle in the current line
const sal_Int32 nWordStart = (nBegin + nLeft) < nLineStart ? nLineStart : nBegin + nLeft;
// take one less than the line end - otherwise the next line would be calculated
const sal_Int32 nWordEnd = (nBegin + nLen - nLeft - nRight) > nLineEnd
? nLineEnd : (nBegin + nLen - nLeft - nRight);
Push();
pCrsr->DeleteMark();
SwIndex& rContent = GetCrsr()->GetPoint()->nContent;
rContent = nWordStart;
SwRect aStartRect;
SwCrsrMoveState aState;
aState.bRealWidth = sal_True;
SwCntntNode* pCntntNode = pCrsr->GetCntntNode();
SwCntntFrm *pCntntFrame = pCntntNode->getLayoutFrm( GetLayout(), pPt, pCrsr->GetPoint(), sal_False);
pCntntFrame->GetCharRect( aStartRect, *pCrsr->GetPoint(), &aState );
rContent = nWordEnd - 1;
SwRect aEndRect;
pCntntFrame->GetCharRect( aEndRect, *pCrsr->GetPoint(),&aState );
rSelectRect = aStartRect.Union( aEndRect );
Pop(sal_False);
}
}
}
return bRes;
}
bool SwEditShell::SpellSentence(::svx::SpellPortions& rPortions, bool bIsGrammarCheck)
{
OSL_ENSURE( pSpellIter, "SpellIter missing" );
if(!pSpellIter)
return false;
bool bRet = pSpellIter->SpellSentence(rPortions, bIsGrammarCheck);
// make Selection visible - this should simply move the
// cursor to the end of the sentence
StartAction();
EndAction();
return bRet;
}
///make SpellIter start with the current sentence when called next time
2008-12-15 12:01:46 +00:00
void SwEditShell::PutSpellingToSentenceStart()
{
OSL_ENSURE( pSpellIter, "SpellIter missing" );
2008-12-15 12:01:46 +00:00
if(!pSpellIter)
return;
pSpellIter->ToSentenceStart();
}
static sal_uInt32 lcl_CountRedlines(const ::svx::SpellPortions& rLastPortions)
{
sal_uInt32 nRet = 0;
SpellPortions::const_iterator aIter = rLastPortions.begin();
for( ; aIter != rLastPortions.end(); ++aIter)
{
if( aIter->bIsHidden )
++nRet;
}
return nRet;
}
void SwEditShell::MoveContinuationPosToEndOfCheckedSentence()
{
// give hint that continuation position for spell/grammar checking is
// at the end of this sentence
if (pSpellIter)
{
pSpellIter->SetCurr( new SwPosition( *pSpellIter->GetCurrX() ) );
pSpellIter->ContinueAfterThisSentence();
}
}
void SwEditShell::ApplyChangedSentence(const ::svx::SpellPortions& rNewPortions, bool bRecheck)
{
// Note: rNewPortions.size() == 0 is valid and happens when the whole
// sentence got removed in the dialog
OSL_ENSURE( pSpellIter, "SpellIter missing" );
if(pSpellIter &&
pSpellIter->GetLastPortions().size() > 0) // no portions -> no text to be changed
{
const SpellPortions& rLastPortions = pSpellIter->GetLastPortions();
const SpellContentPositions rLastPositions = pSpellIter->GetLastPositions();
OSL_ENSURE(rLastPortions.size() > 0 &&
rLastPortions.size() == rLastPositions.size(),
"last vectors of spelling results are not set or not equal");
2000-09-18 23:08:29 +00:00
// iterate over the new portions, beginning at the end to take advantage of the previously
// saved content positions
mpDoc->GetIDocumentUndoRedo().StartUndo( UNDO_UI_TEXT_CORRECTION, NULL );
StartAction();
SwPaM *pCrsr = GetCrsr();
// save cursor position (which should be at the end of the current sentence)
// for later restoration
Push();
sal_uInt32 nRedlinePortions = lcl_CountRedlines(rLastPortions);
if((rLastPortions.size() - nRedlinePortions) == rNewPortions.size())
{
2011-05-16 16:04:50 +02:00
OSL_ENSURE( !rNewPortions.empty(), "rNewPortions should not be empty here" );
OSL_ENSURE( !rLastPortions.empty(), "rLastPortions should not be empty here" );
OSL_ENSURE( !rLastPositions.empty(), "rLastPositions should not be empty here" );
// the simple case: the same number of elements on both sides
// each changed element has to be applied to the corresponding source element
svx::SpellPortions::const_iterator aCurrentNewPortion = rNewPortions.end();
SpellPortions::const_iterator aCurrentOldPortion = rLastPortions.end();
SpellContentPositions::const_iterator aCurrentOldPosition = rLastPositions.end();
do
{
--aCurrentNewPortion;
--aCurrentOldPortion;
--aCurrentOldPosition;
//jump over redline portions
while(aCurrentOldPortion->bIsHidden)
{
if (aCurrentOldPortion != rLastPortions.begin() &&
aCurrentOldPosition != rLastPositions.begin())
{
--aCurrentOldPortion;
--aCurrentOldPosition;
}
else
{
OSL_FAIL("ApplyChangedSentence: iterator positions broken" );
break;
}
}
if ( !pCrsr->HasMark() )
pCrsr->SetMark();
pCrsr->GetPoint()->nContent = aCurrentOldPosition->nLeft;
pCrsr->GetMark()->nContent = aCurrentOldPosition->nRight;
sal_uInt16 nScriptType = GetI18NScriptTypeOfLanguage( aCurrentNewPortion->eLanguage );
sal_uInt16 nLangWhichId = RES_CHRATR_LANGUAGE;
switch(nScriptType)
{
case SCRIPTTYPE_ASIAN : nLangWhichId = RES_CHRATR_CJK_LANGUAGE; break;
case SCRIPTTYPE_COMPLEX : nLangWhichId = RES_CHRATR_CTL_LANGUAGE; break;
}
if(aCurrentNewPortion->sText != aCurrentOldPortion->sText)
{
// change text ...
mpDoc->DeleteAndJoin(*pCrsr);
// ... and apply language if necessary
if(aCurrentNewPortion->eLanguage != aCurrentOldPortion->eLanguage)
Resolves: #i33737# enable in-place editing of Input Fields (cherry picked from commit c2afeb1c3f11e8f420b59f3786eb8626c99ff595) Conflicts: sw/inc/IDocumentContentOperations.hxx sw/inc/crsrsh.hxx sw/inc/doc.hxx sw/inc/editsh.hxx sw/inc/expfld.hxx sw/inc/fldbas.hxx sw/inc/fmtfld.hxx sw/inc/hintids.hxx sw/inc/ndtxt.hxx sw/inc/txatbase.hxx sw/inc/txtfld.hxx sw/inc/txtrfmrk.hxx sw/inc/txttxmrk.hxx sw/inc/viscrs.hxx sw/source/core/bastyp/init.cxx sw/source/core/crsr/crsrsh.cxx sw/source/core/crsr/crstrvl.cxx sw/source/core/crsr/findattr.cxx sw/source/core/crsr/findtxt.cxx sw/source/core/crsr/swcrsr.cxx sw/source/core/crsr/viscrs.cxx sw/source/core/doc/dbgoutsw.cxx sw/source/core/doc/doc.cxx sw/source/core/doc/docfld.cxx sw/source/core/doc/docfmt.cxx sw/source/core/doc/docnum.cxx sw/source/core/doc/docredln.cxx sw/source/core/doc/docruby.cxx sw/source/core/doc/doctxm.cxx sw/source/core/doc/visiturl.cxx sw/source/core/docnode/nodes.cxx sw/source/core/edit/edatmisc.cxx sw/source/core/edit/edattr.cxx sw/source/core/edit/edfld.cxx sw/source/core/edit/edfldexp.cxx sw/source/core/edit/editsh.cxx sw/source/core/edit/edlingu.cxx sw/source/core/edit/ednumber.cxx sw/source/core/fields/expfld.cxx sw/source/core/fields/fldbas.cxx sw/source/core/fields/reffld.cxx sw/source/core/frmedt/fefly1.cxx sw/source/core/inc/docfld.hxx sw/source/core/inc/rolbck.hxx sw/source/core/inc/swfont.hxx sw/source/core/layout/flycnt.cxx sw/source/core/layout/laycache.cxx sw/source/core/layout/trvlfrm.cxx sw/source/core/text/atrhndl.hxx sw/source/core/text/atrstck.cxx sw/source/core/text/inftxt.cxx sw/source/core/text/porfld.cxx sw/source/core/text/porfld.hxx sw/source/core/text/txtfld.cxx sw/source/core/tox/tox.cxx sw/source/core/tox/txmsrt.cxx sw/source/core/txtnode/atrfld.cxx sw/source/core/txtnode/ndhints.cxx sw/source/core/txtnode/ndtxt.cxx sw/source/core/txtnode/thints.cxx sw/source/core/txtnode/txatbase.cxx sw/source/core/txtnode/txatritr.cxx sw/source/core/txtnode/txtedt.cxx sw/source/core/undo/SwUndoField.cxx sw/source/core/undo/rolbck.cxx sw/source/core/undo/unsect.cxx sw/source/core/undo/untbl.cxx sw/source/core/unocore/unocrsrhelper.cxx sw/source/core/unocore/unofield.cxx sw/source/core/unocore/unoframe.cxx sw/source/core/unocore/unorefmk.cxx sw/source/core/view/vprint.cxx sw/source/filter/ascii/ascatr.cxx sw/source/filter/html/htmlatr.cxx sw/source/filter/rtf/rtffly.cxx sw/source/filter/ww1/fltshell.cxx sw/source/filter/ww1/w1filter.cxx sw/source/filter/ww8/wrtw8esh.cxx sw/source/filter/ww8/wrtw8nds.cxx sw/source/filter/ww8/ww8atr.cxx sw/source/filter/ww8/ww8par.cxx sw/source/filter/ww8/ww8par3.cxx sw/source/filter/ww8/ww8par5.cxx sw/source/ui/app/applab.cxx sw/source/ui/docvw/edtwin.cxx sw/source/ui/docvw/edtwin2.cxx sw/source/ui/envelp/envfmt.cxx sw/source/ui/fldui/fldedt.cxx sw/source/ui/fldui/fldmgr.cxx sw/source/ui/inc/wrtsh.hxx sw/source/ui/lingu/hhcwrp.cxx sw/source/ui/shells/basesh.cxx sw/source/ui/shells/drwtxtex.cxx sw/source/ui/shells/grfsh.cxx sw/source/ui/shells/tabsh.cxx sw/source/ui/shells/textfld.cxx sw/source/ui/shells/textidx.cxx sw/source/ui/shells/textsh.cxx sw/source/ui/shells/textsh1.cxx sw/source/ui/shells/txtattr.cxx sw/source/ui/uiview/formatclipboard.cxx sw/source/ui/uiview/view.cxx sw/source/ui/uiview/view2.cxx sw/source/ui/uiview/viewsrch.cxx sw/source/ui/uiview/viewstat.cxx sw/source/ui/uiview/viewtab.cxx sw/source/ui/wrtsh/wrtsh1.cxx sw/source/ui/wrtsh/wrtsh2.cxx Change-Id: I6758d6719e1fd523797cc6ee2648ffcb47d52595
2013-11-18 11:29:24 +00:00
SetAttrItem( SvxLanguageItem(aCurrentNewPortion->eLanguage, nLangWhichId), nLangWhichId );
mpDoc->InsertString(*pCrsr, aCurrentNewPortion->sText);
}
else if(aCurrentNewPortion->eLanguage != aCurrentOldPortion->eLanguage)
{
// apply language
Resolves: #i33737# enable in-place editing of Input Fields (cherry picked from commit c2afeb1c3f11e8f420b59f3786eb8626c99ff595) Conflicts: sw/inc/IDocumentContentOperations.hxx sw/inc/crsrsh.hxx sw/inc/doc.hxx sw/inc/editsh.hxx sw/inc/expfld.hxx sw/inc/fldbas.hxx sw/inc/fmtfld.hxx sw/inc/hintids.hxx sw/inc/ndtxt.hxx sw/inc/txatbase.hxx sw/inc/txtfld.hxx sw/inc/txtrfmrk.hxx sw/inc/txttxmrk.hxx sw/inc/viscrs.hxx sw/source/core/bastyp/init.cxx sw/source/core/crsr/crsrsh.cxx sw/source/core/crsr/crstrvl.cxx sw/source/core/crsr/findattr.cxx sw/source/core/crsr/findtxt.cxx sw/source/core/crsr/swcrsr.cxx sw/source/core/crsr/viscrs.cxx sw/source/core/doc/dbgoutsw.cxx sw/source/core/doc/doc.cxx sw/source/core/doc/docfld.cxx sw/source/core/doc/docfmt.cxx sw/source/core/doc/docnum.cxx sw/source/core/doc/docredln.cxx sw/source/core/doc/docruby.cxx sw/source/core/doc/doctxm.cxx sw/source/core/doc/visiturl.cxx sw/source/core/docnode/nodes.cxx sw/source/core/edit/edatmisc.cxx sw/source/core/edit/edattr.cxx sw/source/core/edit/edfld.cxx sw/source/core/edit/edfldexp.cxx sw/source/core/edit/editsh.cxx sw/source/core/edit/edlingu.cxx sw/source/core/edit/ednumber.cxx sw/source/core/fields/expfld.cxx sw/source/core/fields/fldbas.cxx sw/source/core/fields/reffld.cxx sw/source/core/frmedt/fefly1.cxx sw/source/core/inc/docfld.hxx sw/source/core/inc/rolbck.hxx sw/source/core/inc/swfont.hxx sw/source/core/layout/flycnt.cxx sw/source/core/layout/laycache.cxx sw/source/core/layout/trvlfrm.cxx sw/source/core/text/atrhndl.hxx sw/source/core/text/atrstck.cxx sw/source/core/text/inftxt.cxx sw/source/core/text/porfld.cxx sw/source/core/text/porfld.hxx sw/source/core/text/txtfld.cxx sw/source/core/tox/tox.cxx sw/source/core/tox/txmsrt.cxx sw/source/core/txtnode/atrfld.cxx sw/source/core/txtnode/ndhints.cxx sw/source/core/txtnode/ndtxt.cxx sw/source/core/txtnode/thints.cxx sw/source/core/txtnode/txatbase.cxx sw/source/core/txtnode/txatritr.cxx sw/source/core/txtnode/txtedt.cxx sw/source/core/undo/SwUndoField.cxx sw/source/core/undo/rolbck.cxx sw/source/core/undo/unsect.cxx sw/source/core/undo/untbl.cxx sw/source/core/unocore/unocrsrhelper.cxx sw/source/core/unocore/unofield.cxx sw/source/core/unocore/unoframe.cxx sw/source/core/unocore/unorefmk.cxx sw/source/core/view/vprint.cxx sw/source/filter/ascii/ascatr.cxx sw/source/filter/html/htmlatr.cxx sw/source/filter/rtf/rtffly.cxx sw/source/filter/ww1/fltshell.cxx sw/source/filter/ww1/w1filter.cxx sw/source/filter/ww8/wrtw8esh.cxx sw/source/filter/ww8/wrtw8nds.cxx sw/source/filter/ww8/ww8atr.cxx sw/source/filter/ww8/ww8par.cxx sw/source/filter/ww8/ww8par3.cxx sw/source/filter/ww8/ww8par5.cxx sw/source/ui/app/applab.cxx sw/source/ui/docvw/edtwin.cxx sw/source/ui/docvw/edtwin2.cxx sw/source/ui/envelp/envfmt.cxx sw/source/ui/fldui/fldedt.cxx sw/source/ui/fldui/fldmgr.cxx sw/source/ui/inc/wrtsh.hxx sw/source/ui/lingu/hhcwrp.cxx sw/source/ui/shells/basesh.cxx sw/source/ui/shells/drwtxtex.cxx sw/source/ui/shells/grfsh.cxx sw/source/ui/shells/tabsh.cxx sw/source/ui/shells/textfld.cxx sw/source/ui/shells/textidx.cxx sw/source/ui/shells/textsh.cxx sw/source/ui/shells/textsh1.cxx sw/source/ui/shells/txtattr.cxx sw/source/ui/uiview/formatclipboard.cxx sw/source/ui/uiview/view.cxx sw/source/ui/uiview/view2.cxx sw/source/ui/uiview/viewsrch.cxx sw/source/ui/uiview/viewstat.cxx sw/source/ui/uiview/viewtab.cxx sw/source/ui/wrtsh/wrtsh1.cxx sw/source/ui/wrtsh/wrtsh2.cxx Change-Id: I6758d6719e1fd523797cc6ee2648ffcb47d52595
2013-11-18 11:29:24 +00:00
SetAttrItem( SvxLanguageItem(aCurrentNewPortion->eLanguage, nLangWhichId), nLangWhichId );
}
2008-12-15 12:01:46 +00:00
else if( aCurrentNewPortion->bIgnoreThisError )
{
// add the 'ignore' markup to the TextNode's grammar ignore markup list
2008-12-15 12:01:46 +00:00
IgnoreGrammarErrorAt( *pCrsr );
2011-03-01 19:09:12 +01:00
OSL_FAIL("TODO: add ignore mark to text node");
2008-12-15 12:01:46 +00:00
}
if(aCurrentNewPortion == rNewPortions.begin())
break;
}
while(aCurrentNewPortion != rNewPortions.begin());
}
else
{
2011-05-16 16:04:50 +02:00
OSL_ENSURE( !rLastPositions.empty(), "rLastPositions should not be empty here" );
// select the complete sentence
SpellContentPositions::const_iterator aCurrentEndPosition = rLastPositions.end();
--aCurrentEndPosition;
SpellContentPositions::const_iterator aCurrentStartPosition = rLastPositions.begin();
pCrsr->GetPoint()->nContent = aCurrentStartPosition->nLeft;
pCrsr->GetMark()->nContent = aCurrentEndPosition->nRight;
// delete the sentence completely
mpDoc->DeleteAndJoin(*pCrsr);
svx::SpellPortions::const_iterator aCurrentNewPortion = rNewPortions.begin();
while(aCurrentNewPortion != rNewPortions.end())
{
// set the language attribute
sal_uInt16 nScriptType = GetScriptType();
sal_uInt16 nLangWhichId = RES_CHRATR_LANGUAGE;
switch(nScriptType)
{
case SCRIPTTYPE_ASIAN : nLangWhichId = RES_CHRATR_CJK_LANGUAGE; break;
case SCRIPTTYPE_COMPLEX : nLangWhichId = RES_CHRATR_CTL_LANGUAGE; break;
}
SfxItemSet aSet(GetAttrPool(), nLangWhichId, nLangWhichId, 0);
GetCurAttr( aSet );
const SvxLanguageItem& rLang = static_cast<const SvxLanguageItem& >(aSet.Get(nLangWhichId));
if(rLang.GetLanguage() != aCurrentNewPortion->eLanguage)
Resolves: #i33737# enable in-place editing of Input Fields (cherry picked from commit c2afeb1c3f11e8f420b59f3786eb8626c99ff595) Conflicts: sw/inc/IDocumentContentOperations.hxx sw/inc/crsrsh.hxx sw/inc/doc.hxx sw/inc/editsh.hxx sw/inc/expfld.hxx sw/inc/fldbas.hxx sw/inc/fmtfld.hxx sw/inc/hintids.hxx sw/inc/ndtxt.hxx sw/inc/txatbase.hxx sw/inc/txtfld.hxx sw/inc/txtrfmrk.hxx sw/inc/txttxmrk.hxx sw/inc/viscrs.hxx sw/source/core/bastyp/init.cxx sw/source/core/crsr/crsrsh.cxx sw/source/core/crsr/crstrvl.cxx sw/source/core/crsr/findattr.cxx sw/source/core/crsr/findtxt.cxx sw/source/core/crsr/swcrsr.cxx sw/source/core/crsr/viscrs.cxx sw/source/core/doc/dbgoutsw.cxx sw/source/core/doc/doc.cxx sw/source/core/doc/docfld.cxx sw/source/core/doc/docfmt.cxx sw/source/core/doc/docnum.cxx sw/source/core/doc/docredln.cxx sw/source/core/doc/docruby.cxx sw/source/core/doc/doctxm.cxx sw/source/core/doc/visiturl.cxx sw/source/core/docnode/nodes.cxx sw/source/core/edit/edatmisc.cxx sw/source/core/edit/edattr.cxx sw/source/core/edit/edfld.cxx sw/source/core/edit/edfldexp.cxx sw/source/core/edit/editsh.cxx sw/source/core/edit/edlingu.cxx sw/source/core/edit/ednumber.cxx sw/source/core/fields/expfld.cxx sw/source/core/fields/fldbas.cxx sw/source/core/fields/reffld.cxx sw/source/core/frmedt/fefly1.cxx sw/source/core/inc/docfld.hxx sw/source/core/inc/rolbck.hxx sw/source/core/inc/swfont.hxx sw/source/core/layout/flycnt.cxx sw/source/core/layout/laycache.cxx sw/source/core/layout/trvlfrm.cxx sw/source/core/text/atrhndl.hxx sw/source/core/text/atrstck.cxx sw/source/core/text/inftxt.cxx sw/source/core/text/porfld.cxx sw/source/core/text/porfld.hxx sw/source/core/text/txtfld.cxx sw/source/core/tox/tox.cxx sw/source/core/tox/txmsrt.cxx sw/source/core/txtnode/atrfld.cxx sw/source/core/txtnode/ndhints.cxx sw/source/core/txtnode/ndtxt.cxx sw/source/core/txtnode/thints.cxx sw/source/core/txtnode/txatbase.cxx sw/source/core/txtnode/txatritr.cxx sw/source/core/txtnode/txtedt.cxx sw/source/core/undo/SwUndoField.cxx sw/source/core/undo/rolbck.cxx sw/source/core/undo/unsect.cxx sw/source/core/undo/untbl.cxx sw/source/core/unocore/unocrsrhelper.cxx sw/source/core/unocore/unofield.cxx sw/source/core/unocore/unoframe.cxx sw/source/core/unocore/unorefmk.cxx sw/source/core/view/vprint.cxx sw/source/filter/ascii/ascatr.cxx sw/source/filter/html/htmlatr.cxx sw/source/filter/rtf/rtffly.cxx sw/source/filter/ww1/fltshell.cxx sw/source/filter/ww1/w1filter.cxx sw/source/filter/ww8/wrtw8esh.cxx sw/source/filter/ww8/wrtw8nds.cxx sw/source/filter/ww8/ww8atr.cxx sw/source/filter/ww8/ww8par.cxx sw/source/filter/ww8/ww8par3.cxx sw/source/filter/ww8/ww8par5.cxx sw/source/ui/app/applab.cxx sw/source/ui/docvw/edtwin.cxx sw/source/ui/docvw/edtwin2.cxx sw/source/ui/envelp/envfmt.cxx sw/source/ui/fldui/fldedt.cxx sw/source/ui/fldui/fldmgr.cxx sw/source/ui/inc/wrtsh.hxx sw/source/ui/lingu/hhcwrp.cxx sw/source/ui/shells/basesh.cxx sw/source/ui/shells/drwtxtex.cxx sw/source/ui/shells/grfsh.cxx sw/source/ui/shells/tabsh.cxx sw/source/ui/shells/textfld.cxx sw/source/ui/shells/textidx.cxx sw/source/ui/shells/textsh.cxx sw/source/ui/shells/textsh1.cxx sw/source/ui/shells/txtattr.cxx sw/source/ui/uiview/formatclipboard.cxx sw/source/ui/uiview/view.cxx sw/source/ui/uiview/view2.cxx sw/source/ui/uiview/viewsrch.cxx sw/source/ui/uiview/viewstat.cxx sw/source/ui/uiview/viewtab.cxx sw/source/ui/wrtsh/wrtsh1.cxx sw/source/ui/wrtsh/wrtsh2.cxx Change-Id: I6758d6719e1fd523797cc6ee2648ffcb47d52595
2013-11-18 11:29:24 +00:00
SetAttrItem( SvxLanguageItem(aCurrentNewPortion->eLanguage, nLangWhichId) );
// insert the new string
mpDoc->InsertString(*pCrsr, aCurrentNewPortion->sText);
// set the cursor to the end of the inserted string
*pCrsr->Start() = *pCrsr->End();
++aCurrentNewPortion;
}
}
// restore cursor to the end of the sentence
// (will work also if the sentence length has changed,
// since cursors get updated automatically!)
Pop( sal_False );
// collapse cursor to the end of the modified sentence
2008-12-15 12:01:46 +00:00
*pCrsr->Start() = *pCrsr->End();
if (bRecheck)
{
// in grammar check the current sentence has to be checked again
2008-12-15 12:01:46 +00:00
GoStartSentence();
}
// set continuation position for spell/grammar checking to the end of this sentence
pSpellIter->SetCurr( new SwPosition( *pCrsr->Start() ) );
mpDoc->GetIDocumentUndoRedo().EndUndo( UNDO_UI_TEXT_CORRECTION, NULL );
EndAction();
}
}
/** Collect all deleted redlines of the current text node
* beginning at the start of the cursor position
*/
static SpellContentPositions lcl_CollectDeletedRedlines(SwEditShell* pSh)
{
SpellContentPositions aRedlines;
SwDoc* pDoc = pSh->GetDoc();
const bool bShowChg = IDocumentRedlineAccess::IsShowChanges( pDoc->GetRedlineMode() );
if ( bShowChg )
{
SwPaM *pCrsr = pSh->GetCrsr();
const SwPosition* pStartPos = pCrsr->Start();
const SwTxtNode* pTxtNode = pCrsr->GetNode()->GetTxtNode();
sal_uInt16 nAct = pDoc->GetRedlinePos( *pTxtNode, USHRT_MAX );
const sal_Int32 nStartIndex = pStartPos->nContent.GetIndex();
for ( ; nAct < pDoc->GetRedlineTbl().size(); nAct++ )
{
const SwRedline* pRed = pDoc->GetRedlineTbl()[ nAct ];
if ( pRed->Start()->nNode > pTxtNode->GetIndex() )
break;
if( nsRedlineType_t::REDLINE_DELETE == pRed->GetType() )
{
xub_StrLen nStart_, nEnd_;
pRed->CalcStartEnd( pTxtNode->GetIndex(), nStart_, nEnd_ );
sal_Int32 nStart = nStart_;
sal_Int32 nEnd = nEnd_;
if(nStart >= nStartIndex || nEnd >= nStartIndex)
{
SpellContentPosition aAdd;
aAdd.nLeft = nStart;
aAdd.nRight = nEnd;
aRedlines.push_back(aAdd);
}
}
}
}
return aRedlines;
}
/// remove the redline positions after the current selection
static void lcl_CutRedlines( SpellContentPositions& aDeletedRedlines, SwEditShell* pSh )
{
if(!aDeletedRedlines.empty())
{
SwPaM *pCrsr = pSh->GetCrsr();
const SwPosition* pEndPos = pCrsr->End();
const sal_Int32 nEnd = pEndPos->nContent.GetIndex();
while(!aDeletedRedlines.empty() &&
aDeletedRedlines.back().nLeft > nEnd)
{
aDeletedRedlines.pop_back();
}
}
}
static SpellContentPosition lcl_FindNextDeletedRedline(
const SpellContentPositions& rDeletedRedlines,
sal_Int32 nSearchFrom )
{
SpellContentPosition aRet;
aRet.nLeft = aRet.nRight = SAL_MAX_INT32;
if(!rDeletedRedlines.empty())
{
SpellContentPositions::const_iterator aIter = rDeletedRedlines.begin();
for( ; aIter != rDeletedRedlines.end(); ++aIter)
{
if(aIter->nLeft < nSearchFrom)
continue;
aRet = *aIter;
break;
}
}
return aRet;
}
bool SwSpellIter::SpellSentence(::svx::SpellPortions& rPortions, bool bIsGrammarCheck)
{
bool bRet = false;
aLastPortions.clear();
aLastPositions.clear();
SwEditShell *pMySh = GetSh();
if( !pMySh )
return false;
OSL_ENSURE( GetEnd(), "SwSpellIter::SpellSentence without Start?");
uno::Reference< XSpellAlternatives > xSpellRet;
2008-12-15 12:01:46 +00:00
linguistic2::ProofreadingResult aGrammarResult;
bool bGoOn = true;
bool bGrammarErrorFound = false;
do {
SwPaM *pCrsr = pMySh->GetCrsr();
if ( !pCrsr->HasMark() )
pCrsr->SetMark();
*pCrsr->GetPoint() = *GetCurr();
*pCrsr->GetMark() = *GetEnd();
2008-12-15 12:01:46 +00:00
if( bBackToStartOfSentence )
{
pMySh->GoStartSentence();
bBackToStartOfSentence = false;
}
uno::Any aSpellRet =
pMySh->GetDoc()->Spell(*pCrsr,
xSpeller, 0, 0, bIsGrammarCheck );
aSpellRet >>= xSpellRet;
aSpellRet >>= aGrammarResult;
bGoOn = GetCrsrCnt() > 1;
2008-12-15 12:01:46 +00:00
bGrammarErrorFound = aGrammarResult.aErrors.getLength() > 0;
if( xSpellRet.is() || bGrammarErrorFound )
{
bGoOn = false;
SwPosition* pNewPoint = new SwPosition( *pCrsr->GetPoint() );
SwPosition* pNewMark = new SwPosition( *pCrsr->GetMark() );
SetCurr( pNewPoint );
SetCurrX( pNewMark );
}
if( bGoOn )
{
pMySh->Pop( sal_False );
pCrsr = pMySh->GetCrsr();
if ( *pCrsr->GetPoint() > *pCrsr->GetMark() )
pCrsr->Exchange();
SwPosition* pNew = new SwPosition( *pCrsr->GetPoint() );
SetStart( pNew );
pNew = new SwPosition( *pCrsr->GetMark() );
SetEnd( pNew );
pNew = new SwPosition( *GetStart() );
SetCurr( pNew );
pNew = new SwPosition( *pNew );
SetCurrX( pNew );
pCrsr->SetMark();
--GetCrsrCnt();
}
} while ( bGoOn );
if(xSpellRet.is() || bGrammarErrorFound)
{
// an error has been found
// To fill the spell portions the beginning of the sentence has to be found
SwPaM *pCrsr = pMySh->GetCrsr();
// set the mark to the right if necessary
2008-12-15 12:01:46 +00:00
if ( *pCrsr->GetPoint() > *pCrsr->GetMark() )
pCrsr->Exchange();
// the cursor has to be collapsed on the left to go to the start of the sentence - if sentence ends inside of the error
2008-12-15 12:01:46 +00:00
pCrsr->DeleteMark();
pCrsr->SetMark();
bool bStartSent = 0 != pMySh->GoStartSentence();
SpellContentPositions aDeletedRedlines = lcl_CollectDeletedRedlines(pMySh);
if(bStartSent)
{
// create a portion from the start part
AddPortion(0, 0, aDeletedRedlines);
}
// Set the cursor to the error already found
*pCrsr->GetPoint() = *GetCurrX();
*pCrsr->GetMark() = *GetCurr();
AddPortion(xSpellRet, &aGrammarResult, aDeletedRedlines);
// save the end position of the error to continue from here
2008-12-15 12:01:46 +00:00
SwPosition aSaveStartPos = *pCrsr->End();
// determine the end of the current sentence
2008-12-15 12:01:46 +00:00
if ( *pCrsr->GetPoint() < *pCrsr->GetMark() )
pCrsr->Exchange();
// again collapse to start marking after the end of the error
2008-12-15 12:01:46 +00:00
pCrsr->DeleteMark();
pCrsr->SetMark();
pMySh->GoEndSentence();
2008-12-15 12:01:46 +00:00
if( bGrammarErrorFound )
{
const ModelToViewHelper aConversionMap(*(SwTxtNode*)pCrsr->GetNode());
OUString aExpandText = aConversionMap.getViewText();
sal_Int32 nSentenceEnd =
aConversionMap.ConvertToViewPosition( aGrammarResult.nBehindEndOfSentencePosition );
2008-12-15 12:01:46 +00:00
// remove trailing space
if( aExpandText[nSentenceEnd - 1] == ' ' )
--nSentenceEnd;
if( pCrsr->End()->nContent.GetIndex() < nSentenceEnd )
{
pCrsr->End()->nContent.Assign(
pCrsr->End()->nNode.GetNode().GetCntntNode(), nSentenceEnd);
}
}
lcl_CutRedlines( aDeletedRedlines, pMySh );
// save the 'global' end of the spellchecking
const SwPosition aSaveEndPos = *GetEnd();
// set the sentence end as 'local' end
SetEnd( new SwPosition( *pCrsr->End() ));
*pCrsr->GetPoint() = aSaveStartPos;
*pCrsr->GetMark() = *GetEnd();
// now the rest of the sentence has to be searched for errors
// for each error the non-error text between the current and the last error has
// to be added to the portions - if necessary broken into same-language-portions
if( !bGrammarErrorFound ) //in grammar check there's only one error returned
{
do
{
xSpellRet = 0;
// don't search for grammar errors here anymore!
pMySh->GetDoc()->Spell(*pCrsr,
xSpeller, 0, 0, false ) >>= xSpellRet;
if ( *pCrsr->GetPoint() > *pCrsr->GetMark() )
pCrsr->Exchange();
SetCurr( new SwPosition( *pCrsr->GetPoint() ));
SetCurrX( new SwPosition( *pCrsr->GetMark() ));
// if an error has been found go back to the text preceeding the error
if(xSpellRet.is())
{
*pCrsr->GetPoint() = aSaveStartPos;
*pCrsr->GetMark() = *GetCurr();
}
// add the portion
AddPortion(0, 0, aDeletedRedlines);
if(xSpellRet.is())
{
*pCrsr->GetPoint() = *GetCurr();
*pCrsr->GetMark() = *GetCurrX();
AddPortion(xSpellRet, 0, aDeletedRedlines);
// move the cursor to the end of the error string
*pCrsr->GetPoint() = *GetCurrX();
// and save the end of the error as new start position
aSaveStartPos = *GetCurrX();
// and the end of the sentence
*pCrsr->GetMark() = *GetEnd();
}
// if the end of the sentence has already been reached then break here
if(*GetCurrX() >= *GetEnd())
break;
}
while(xSpellRet.is());
}
else
{
// go to the end of sentence as the grammar check returned it
// at this time the Point is behind the grammar error
// and the mark points to the sentence end as
if ( *pCrsr->GetPoint() < *pCrsr->GetMark() )
pCrsr->Exchange();
}
// the part between the last error and the end of the sentence has to be added
*pMySh->GetCrsr()->GetPoint() = *GetEnd();
if(*GetCurrX() < *GetEnd())
{
AddPortion(0, 0, aDeletedRedlines);
}
// set the shell cursor to the end of the sentence to prevent a visible selection
*pCrsr->GetMark() = *GetEnd();
if( !bIsGrammarCheck )
{
// set the current position to the end of the sentence
SetCurr( new SwPosition(*GetEnd()) );
}
// restore the 'global' end
SetEnd( new SwPosition(aSaveEndPos) );
rPortions = aLastPortions;
bRet = true;
}
else
{
// if no error could be found the selection has to be corrected - at least if it's not in the body
*pMySh->GetCrsr()->GetPoint() = *GetEnd();
pMySh->GetCrsr()->DeleteMark();
}
return bRet;
}
2008-12-15 12:01:46 +00:00
void SwSpellIter::ToSentenceStart()
{
bBackToStartOfSentence = true;
}
static LanguageType lcl_GetLanguage(SwEditShell& rSh)
{
sal_uInt16 nScriptType = rSh.GetScriptType();
sal_uInt16 nLangWhichId = RES_CHRATR_LANGUAGE;
switch(nScriptType)
{
case SCRIPTTYPE_ASIAN : nLangWhichId = RES_CHRATR_CJK_LANGUAGE; break;
case SCRIPTTYPE_COMPLEX : nLangWhichId = RES_CHRATR_CTL_LANGUAGE; break;
}
SfxItemSet aSet(rSh.GetAttrPool(), nLangWhichId, nLangWhichId, 0);
rSh.GetCurAttr( aSet );
const SvxLanguageItem& rLang = static_cast<const SvxLanguageItem& >(aSet.Get(nLangWhichId));
return rLang.GetLanguage();
}
/// create a text portion at the given position
void SwSpellIter::CreatePortion(uno::Reference< XSpellAlternatives > xAlt,
2008-12-15 12:01:46 +00:00
linguistic2::ProofreadingResult* pGrammarResult,
bool bIsField, bool bIsHidden)
{
svx::SpellPortion aPortion;
OUString sText;
GetSh()->GetSelectedText( sText );
if(!sText.isEmpty())
{
// in case of redlined deletions the selection of an error is not the same as the _real_ word
if(xAlt.is())
aPortion.sText = xAlt->getWord();
else if(pGrammarResult)
{
aPortion.bIsGrammarError = true;
2008-12-15 12:01:46 +00:00
if(pGrammarResult->aErrors.getLength())
{
2008-12-15 12:01:46 +00:00
aPortion.aGrammarError = pGrammarResult->aErrors[0];
aPortion.sText = pGrammarResult->aText.copy( aPortion.aGrammarError.nErrorStart, aPortion.aGrammarError.nErrorLength );
2008-12-15 12:01:46 +00:00
aPortion.xGrammarChecker = pGrammarResult->xProofreader;
const beans::PropertyValue* pProperties = pGrammarResult->aProperties.getConstArray();
for( sal_Int32 nProp = 0; nProp < pGrammarResult->aProperties.getLength(); ++nProp )
{
if ( pProperties->Name == "DialogTitle" )
2008-12-15 12:01:46 +00:00
{
pProperties->Value >>= aPortion.sDialogTitle;
break;
}
}
}
}
else
aPortion.sText = sText;
aPortion.eLanguage = lcl_GetLanguage(*GetSh());
aPortion.bIsField = bIsField;
aPortion.bIsHidden = bIsHidden;
aPortion.xAlternatives = xAlt;
SpellContentPosition aPosition;
SwPaM *pCrsr = GetSh()->GetCrsr();
aPosition.nLeft = pCrsr->Start()->nContent.GetIndex();
aPosition.nRight = pCrsr->End()->nContent.GetIndex();
aLastPortions.push_back(aPortion);
aLastPositions.push_back(aPosition);
}
}
void SwSpellIter::AddPortion(uno::Reference< XSpellAlternatives > xAlt,
2008-12-15 12:01:46 +00:00
linguistic2::ProofreadingResult* pGrammarResult,
const SpellContentPositions& rDeletedRedlines)
{
SwEditShell *pMySh = GetSh();
OUString sText;
pMySh->GetSelectedText( sText );
if(!sText.isEmpty())
{
if(xAlt.is() || pGrammarResult != 0)
{
CreatePortion(xAlt, pGrammarResult, false, false);
}
else
{
SwPaM *pCrsr = GetSh()->GetCrsr();
if ( *pCrsr->GetPoint() > *pCrsr->GetMark() )
pCrsr->Exchange();
// save the start and end positions
SwPosition aStart(*pCrsr->GetPoint());
SwPosition aEnd(*pCrsr->GetMark());
// iterate over the text to find changes in language
// set the mark equal to the point
*pCrsr->GetMark() = aStart;
SwTxtNode* pTxtNode = pCrsr->GetNode()->GetTxtNode();
LanguageType eStartLanguage = lcl_GetLanguage(*GetSh());
SpellContentPosition aNextRedline = lcl_FindNextDeletedRedline(
rDeletedRedlines, aStart.nContent.GetIndex() );
if( aNextRedline.nLeft == aStart.nContent.GetIndex() )
{
// select until the end of the current redline
const sal_Int32 nEnd = aEnd.nContent.GetIndex() < aNextRedline.nRight ?
aEnd.nContent.GetIndex() : aNextRedline.nRight;
pCrsr->GetPoint()->nContent.Assign( pTxtNode, nEnd );
CreatePortion(xAlt, pGrammarResult, false, true);
aStart = *pCrsr->End();
// search for next redline
aNextRedline = lcl_FindNextDeletedRedline(
rDeletedRedlines, aStart.nContent.GetIndex() );
}
while(*pCrsr->GetPoint() < aEnd)
{
// #125786 in table cell with fixed row height the cursor might not move forward
if(!GetSh()->Right(1, CRSR_SKIP_CELLS))
break;
bool bField = false;
// read the character at the current position to check if it's a field
sal_Unicode const cChar =
pTxtNode->GetTxt()[pCrsr->GetMark()->nContent.GetIndex()];
if( CH_TXTATR_BREAKWORD == cChar || CH_TXTATR_INWORD == cChar)
{
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
const SwTxtAttr* pTxtAttr = pTxtNode->GetTxtAttrForCharAt(
pCrsr->GetMark()->nContent.GetIndex() );
const sal_uInt16 nWhich = pTxtAttr
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
? pTxtAttr->Which()
: static_cast<sal_uInt16>(RES_TXTATR_END);
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
switch (nWhich)
{
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
case RES_TXTATR_FIELD:
case RES_TXTATR_FTN:
case RES_TXTATR_FLYCNT:
bField = true;
break;
}
}
LanguageType eCurLanguage = lcl_GetLanguage(*GetSh());
bool bRedline = aNextRedline.nLeft == pCrsr->GetPoint()->nContent.GetIndex();
// create a portion if the next character
// - is a field,
// - is at the beginning of a deleted redline
// - has a different language
if(bField || bRedline || eCurLanguage != eStartLanguage)
{
eStartLanguage = eCurLanguage;
// go one step back - the cursor currently selects the first character
// with a different language
// in the case of redlining it's different
if(eCurLanguage != eStartLanguage || bField)
*pCrsr->GetPoint() = *pCrsr->GetMark();
// set to the last start
*pCrsr->GetMark() = aStart;
// create portion should only be called if a selection exists
// there's no selection if there's a field at the beginning
if(*pCrsr->Start() != *pCrsr->End())
CreatePortion(xAlt, pGrammarResult, false, false);
aStart = *pCrsr->End();
// now export the field - if there is any
if(bField)
{
*pCrsr->GetMark() = *pCrsr->GetPoint();
GetSh()->Right(1, CRSR_SKIP_CELLS);
CreatePortion(xAlt, pGrammarResult, true, false);
aStart = *pCrsr->End();
}
}
// if a redline start then create a portion for it
if(bRedline)
{
*pCrsr->GetMark() = *pCrsr->GetPoint();
// select until the end of the current redline
const sal_Int32 nEnd = aEnd.nContent.GetIndex() < aNextRedline.nRight ?
aEnd.nContent.GetIndex() : aNextRedline.nRight;
pCrsr->GetPoint()->nContent.Assign( pTxtNode, nEnd );
CreatePortion(xAlt, pGrammarResult, false, true);
aStart = *pCrsr->End();
// search for next redline
aNextRedline = lcl_FindNextDeletedRedline(
rDeletedRedlines, aStart.nContent.GetIndex() );
}
*pCrsr->GetMark() = *pCrsr->GetPoint();
}
pCrsr->SetMark();
*pCrsr->GetMark() = aStart;
CreatePortion(xAlt, pGrammarResult, false, false);
}
}
}
2008-12-15 12:01:46 +00:00
void SwEditShell::IgnoreGrammarErrorAt( SwPaM& rErrorPosition )
{
SwTxtNode *pNode;
SwWrongList *pWrong;
SwNodeIndex aIdx = rErrorPosition.Start()->nNode;
SwNodeIndex aEndIdx = rErrorPosition.Start()->nNode;
sal_Int32 nStart = rErrorPosition.Start()->nContent.GetIndex();
sal_Int32 nEnd = STRING_LEN;
2008-12-15 12:01:46 +00:00
while( aIdx <= aEndIdx )
{
pNode = aIdx.GetNode().GetTxtNode();
if( pNode ) {
if( aIdx == aEndIdx )
nEnd = rErrorPosition.End()->nContent.GetIndex();
pWrong = pNode->GetGrammarCheck();
if( pWrong )
pWrong->RemoveEntry( nStart, nEnd );
pWrong = pNode->GetWrong();
if( pWrong )
pWrong->RemoveEntry( nStart, nEnd );
SwTxtFrm::repaintTextFrames( *pNode );
2008-12-15 12:01:46 +00:00
}
++aIdx;
nStart = 0;
}
}
2000-09-18 23:08:29 +00:00
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */