2010-10-14 08:30:41 +02:00
|
|
|
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
|
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>
|
2008-07-16 12:26:07 +00:00
|
|
|
#include <com/sun/star/text/XFlatParagraph.hpp>
|
2011-11-18 21:03:31 +00:00
|
|
|
#include <comphelper/string.hxx>
|
2008-07-16 12:26:07 +00:00
|
|
|
|
|
|
|
#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>
|
2010-01-08 18:32:51 +01:00
|
|
|
#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>
|
2010-11-25 14:31:08 +01:00
|
|
|
#include <IDocumentUndoRedo.hxx>
|
2013-10-22 15:58:57 +03:00
|
|
|
#include <rootfrm.hxx>
|
2000-09-18 23:08:29 +00:00
|
|
|
#include <pam.hxx>
|
2013-10-22 15:58:57 +03:00
|
|
|
#include <swundo.hxx>
|
|
|
|
#include <ndtxt.hxx>
|
|
|
|
#include <viewopt.hxx>
|
|
|
|
#include <viscrs.hxx>
|
|
|
|
#include <SwGrammarMarkUp.hxx>
|
|
|
|
#include <mdiexp.hxx>
|
|
|
|
#include <statstr.hrc>
|
2004-05-17 16:27:54 +00:00
|
|
|
#include <cntfrm.hxx>
|
2004-09-17 13:49:23 +00:00
|
|
|
#include <crsskip.hxx>
|
2005-04-04 07:14:47 +00:00
|
|
|
#include <splargs.hxx>
|
2013-10-22 15:58:57 +03:00
|
|
|
#include <redline.hxx>
|
|
|
|
#include <docary.hxx>
|
2008-07-16 12:26:07 +00:00
|
|
|
#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>
|
2010-12-17 09:02:23 +01:00
|
|
|
#include <txtfrm.hxx>
|
2000-10-27 10:55:57 +00:00
|
|
|
|
2004-09-17 13:49:23 +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; }
|
|
|
|
|
2013-06-09 00:07:31 +02:00
|
|
|
// for the UI:
|
2000-09-18 23:08:29 +00:00
|
|
|
void _Start( SwEditShell *pSh, SwDocPositions eStart,
|
2004-09-17 13:49:23 +00:00
|
|
|
SwDocPositions eEnd );
|
2005-10-18 12:48:17 +00:00
|
|
|
void _End(bool bRestoreSelection = true);
|
2000-09-18 23:08:29 +00:00
|
|
|
};
|
|
|
|
|
2004-09-17 13:49:23 +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
|
|
|
|
{
|
2013-11-12 00:46:22 +01:00
|
|
|
sal_Int32 nLeft;
|
|
|
|
sal_Int32 nRight;
|
2004-09-17 13:49:23 +00:00
|
|
|
};
|
2013-06-09 00:44:03 +02:00
|
|
|
|
2004-09-17 13:49:23 +00:00
|
|
|
typedef std::vector<SpellContentPosition> SpellContentPositions;
|
2013-06-09 00:44:03 +02:00
|
|
|
|
2000-09-18 23:08:29 +00:00
|
|
|
class SwSpellIter : public SwLinguIter
|
|
|
|
{
|
2000-10-27 10:55:57 +00:00
|
|
|
uno::Reference< XSpellChecker1 > xSpeller;
|
2004-09-17 13:49:23 +00:00
|
|
|
::svx::SpellPortions aLastPortions;
|
|
|
|
|
|
|
|
SpellContentPositions aLastPositions;
|
2008-12-15 12:01:46 +00:00
|
|
|
bool bBackToStartOfSentence;
|
2010-04-22 13:08:19 +02:00
|
|
|
bool bMoveToEndOfSentence;
|
2004-09-17 13:49:23 +00:00
|
|
|
|
|
|
|
|
2005-03-01 14:24:11 +00:00
|
|
|
void CreatePortion(uno::Reference< XSpellAlternatives > xAlt,
|
2008-12-15 12:01:46 +00:00
|
|
|
linguistic2::ProofreadingResult* pGrammarResult,
|
2005-03-01 14:24:11 +00:00
|
|
|
bool bIsField, bool bIsHidden);
|
2008-07-16 12:26:07 +00:00
|
|
|
|
2005-03-01 14:24:11 +00:00
|
|
|
void AddPortion(uno::Reference< XSpellAlternatives > xAlt,
|
2008-12-15 12:01:46 +00:00
|
|
|
linguistic2::ProofreadingResult* pGrammarResult,
|
2005-03-01 14:24:11 +00:00
|
|
|
const SpellContentPositions& rDeletedRedlines);
|
2000-09-18 23:08:29 +00:00
|
|
|
public:
|
2008-12-15 12:01:46 +00:00
|
|
|
SwSpellIter() :
|
2010-04-22 13:08:19 +02:00
|
|
|
bBackToStartOfSentence(false), bMoveToEndOfSentence(false) {}
|
2000-09-18 23:08:29 +00:00
|
|
|
|
|
|
|
void Start( SwEditShell *pSh, SwDocPositions eStart, SwDocPositions eEnd );
|
|
|
|
|
2003-04-17 16:49:32 +00:00
|
|
|
uno::Any Continue( sal_uInt16* pPageCnt, sal_uInt16* pPageSt );
|
2004-09-17 13:49:23 +00:00
|
|
|
|
2008-07-16 12:26:07 +00:00
|
|
|
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;}
|
2010-04-22 13:08:19 +02:00
|
|
|
void ContinueAfterThisSentence() { bMoveToEndOfSentence = true; }
|
2003-04-17 16:49:32 +00:00
|
|
|
};
|
|
|
|
|
2013-06-09 00:31:37 +02:00
|
|
|
/// used for text conversion
|
2003-04-17 16:49:32 +00:00
|
|
|
class SwConvIter : public SwLinguIter
|
|
|
|
{
|
2005-04-04 07:14:47 +00:00
|
|
|
SwConversionArgs &rArgs;
|
2003-04-17 16:49:32 +00:00
|
|
|
public:
|
2005-04-04 07:14:47 +00:00
|
|
|
SwConvIter( SwConversionArgs &rConvArgs ) :
|
|
|
|
rArgs( rConvArgs )
|
2004-09-17 12:29:12 +00:00
|
|
|
{}
|
2003-04-17 16:49:32 +00:00
|
|
|
|
|
|
|
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();
|
|
|
|
|
2003-04-17 16:49:32 +00:00
|
|
|
uno::Any Continue( sal_uInt16* pPageCnt, sal_uInt16* pPageSt );
|
2000-09-18 23:08:29 +00:00
|
|
|
|
|
|
|
sal_Bool IsAuto();
|
2013-11-12 00:46:22 +01:00
|
|
|
void InsertSoftHyph( const sal_Int32 nHyphPos );
|
2000-09-18 23:08:29 +00:00
|
|
|
void ShowSelection();
|
|
|
|
};
|
|
|
|
|
|
|
|
static SwSpellIter* pSpellIter = 0;
|
2003-04-17 16:49:32 +00:00
|
|
|
static SwConvIter* pConvIter = 0;
|
2000-09-18 23:08:29 +00:00
|
|
|
static SwHyphIter* pHyphIter = 0;
|
|
|
|
|
2013-06-09 00:07:31 +02:00
|
|
|
// 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 )
|
|
|
|
{
|
2013-06-09 00:07:31 +02:00
|
|
|
// TODO missing: ensurance of re-entrance, OSL_ENSURE( etc.
|
2000-09-18 23:08:29 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void SwLinguIter::_Start( SwEditShell *pShell, SwDocPositions eStart,
|
2004-09-17 13:49:23 +00:00
|
|
|
SwDocPositions eEnd )
|
2000-09-18 23:08:29 +00:00
|
|
|
{
|
2013-06-09 00:07:31 +02:00
|
|
|
// TODO missing: ensurance of re-entrance, locking
|
2000-09-18 23:08:29 +00:00
|
|
|
if( pSh )
|
|
|
|
return;
|
|
|
|
|
2012-11-23 11:06:51 +09:00
|
|
|
bool bSetCurr;
|
2000-09-18 23:08:29 +00:00
|
|
|
|
|
|
|
pSh = pShell;
|
|
|
|
|
|
|
|
SET_CURR_SHELL( pSh );
|
|
|
|
|
2013-06-09 00:07:31 +02:00
|
|
|
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
|
|
|
|
{
|
2012-11-23 11:06:51 +09:00
|
|
|
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 )
|
|
|
|
{
|
2004-09-17 13:49:23 +00:00
|
|
|
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;
|
|
|
|
}
|
|
|
|
|
2005-10-18 12:48:17 +00:00
|
|
|
void SwLinguIter::_End(bool bRestoreSelection)
|
2000-09-18 23:08:29 +00:00
|
|
|
{
|
|
|
|
if( !pSh )
|
|
|
|
return;
|
|
|
|
|
2013-06-09 00:07:31 +02:00
|
|
|
OSL_ENSURE( pEnd, "SwLinguIter::_End without end?");
|
2005-10-18 12:48:17 +00:00
|
|
|
if(bRestoreSelection)
|
|
|
|
{
|
|
|
|
while( nCrsrCnt-- )
|
|
|
|
pSh->Pop( sal_False );
|
2000-09-18 23:08:29 +00:00
|
|
|
|
2005-10-18 12:48:17 +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;
|
2000-10-25 11:07:02 +00:00
|
|
|
|
|
|
|
xSpeller = ::GetSpellChecker();
|
|
|
|
if ( xSpeller.is() )
|
2004-09-17 13:49:23 +00:00
|
|
|
_Start( pShell, eStart, eEnd );
|
|
|
|
aLastPortions.clear();
|
|
|
|
aLastPositions.clear();
|
2000-09-18 23:08:29 +00:00
|
|
|
}
|
|
|
|
|
2013-06-09 00:07:31 +02:00
|
|
|
// This method is the origin of SwEditShell::SpellContinue()
|
2003-04-17 16:49:32 +00:00
|
|
|
uno::Any SwSpellIter::Continue( sal_uInt16* pPageCnt, sal_uInt16* pPageSt )
|
2000-09-18 23:08:29 +00:00
|
|
|
{
|
2003-04-17 16:49:32 +00:00
|
|
|
//!!
|
|
|
|
//!! Please check SwConvIter also when modifying this
|
|
|
|
//!!
|
|
|
|
|
|
|
|
uno::Any aSpellRet;
|
2007-09-27 07:46:02 +00:00
|
|
|
SwEditShell *pMySh = GetSh();
|
|
|
|
if( !pMySh )
|
2003-04-17 16:49:32 +00:00
|
|
|
return aSpellRet;
|
2000-09-18 23:08:29 +00:00
|
|
|
|
2013-06-09 00:07:31 +02:00
|
|
|
OSL_ENSURE( GetEnd(), "SwSpellIter::Continue without start?");
|
2000-09-18 23:08:29 +00:00
|
|
|
|
2003-04-17 16:49:32 +00:00
|
|
|
uno::Reference< uno::XInterface > xSpellRet;
|
2012-09-27 13:21:50 +09:00
|
|
|
bool bGoOn = true;
|
2000-10-25 11:07:02 +00:00
|
|
|
do {
|
2007-09-27 07:46:02 +00:00
|
|
|
SwPaM *pCrsr = pMySh->GetCrsr();
|
2000-09-18 23:08:29 +00:00
|
|
|
if ( !pCrsr->HasMark() )
|
|
|
|
pCrsr->SetMark();
|
2000-10-25 11:07:02 +00:00
|
|
|
|
|
|
|
uno::Reference< beans::XPropertySet > xProp( GetLinguPropertySet() );
|
2007-09-27 07:46:02 +00:00
|
|
|
*pMySh->GetCrsr()->GetPoint() = *GetCurr();
|
|
|
|
*pMySh->GetCrsr()->GetMark() = *GetEnd();
|
|
|
|
pMySh->GetDoc()->Spell(*pMySh->GetCrsr(),
|
2008-07-16 12:26:07 +00:00
|
|
|
xSpeller, pPageCnt, pPageSt, false ) >>= xSpellRet;
|
2000-09-18 23:08:29 +00:00
|
|
|
bGoOn = GetCrsrCnt() > 1;
|
|
|
|
if( xSpellRet.is() )
|
|
|
|
{
|
2012-09-27 13:21:50 +09:00
|
|
|
bGoOn = false;
|
2000-09-18 23:08:29 +00:00
|
|
|
SwPosition* pNewPoint = new SwPosition( *pCrsr->GetPoint() );
|
|
|
|
SwPosition* pNewMark = new SwPosition( *pCrsr->GetMark() );
|
2004-09-17 13:49:23 +00:00
|
|
|
SetCurr( pNewPoint );
|
|
|
|
SetCurrX( pNewMark );
|
2000-09-18 23:08:29 +00:00
|
|
|
}
|
|
|
|
if( bGoOn )
|
|
|
|
{
|
2007-09-27 07:46:02 +00:00
|
|
|
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 );
|
2004-09-17 13:49:23 +00:00
|
|
|
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 );
|
2003-04-17 16:49:32 +00:00
|
|
|
aSpellRet <<= xSpellRet;
|
|
|
|
return aSpellRet;
|
|
|
|
}
|
|
|
|
|
|
|
|
void SwConvIter::Start( SwEditShell *pShell, SwDocPositions eStart,
|
|
|
|
SwDocPositions eEnd )
|
|
|
|
{
|
|
|
|
if( GetSh() )
|
|
|
|
return;
|
2004-09-17 13:49:23 +00:00
|
|
|
_Start( pShell, eStart, eEnd );
|
2003-04-17 16:49:32 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
uno::Any SwConvIter::Continue( sal_uInt16* pPageCnt, sal_uInt16* pPageSt )
|
|
|
|
{
|
|
|
|
//!!
|
|
|
|
//!! Please check SwSpellIter also when modifying this
|
|
|
|
//!!
|
|
|
|
|
2013-03-01 13:50:58 +01:00
|
|
|
uno::Any aConvRet( makeAny( OUString() ) );
|
2007-09-27 07:46:02 +00:00
|
|
|
SwEditShell *pMySh = GetSh();
|
|
|
|
if( !pMySh )
|
2003-04-17 16:49:32 +00:00
|
|
|
return aConvRet;
|
|
|
|
|
2013-06-09 00:07:31 +02:00
|
|
|
OSL_ENSURE( GetEnd(), "SwConvIter::Continue() without Start?");
|
2003-04-17 16:49:32 +00:00
|
|
|
|
2013-03-01 13:50:58 +01:00
|
|
|
OUString aConvText;
|
2012-09-27 13:21:50 +09:00
|
|
|
bool bGoOn = true;
|
2003-04-17 16:49:32 +00:00
|
|
|
do {
|
2007-09-27 07:46:02 +00:00
|
|
|
SwPaM *pCrsr = pMySh->GetCrsr();
|
2003-04-17 16:49:32 +00:00
|
|
|
if ( !pCrsr->HasMark() )
|
|
|
|
pCrsr->SetMark();
|
|
|
|
|
2007-09-27 07:46:02 +00:00
|
|
|
*pMySh->GetCrsr()->GetPoint() = *GetCurr();
|
|
|
|
*pMySh->GetCrsr()->GetMark() = *GetEnd();
|
2003-04-17 16:49:32 +00:00
|
|
|
|
|
|
|
// call function to find next text portion to be converted
|
|
|
|
uno::Reference< linguistic2::XSpellChecker1 > xEmpty;
|
2007-09-27 07:46:02 +00:00
|
|
|
pMySh->GetDoc()->Spell( *pMySh->GetCrsr(),
|
2008-07-16 12:26:07 +00:00
|
|
|
xEmpty, pPageCnt, pPageSt, false, &rArgs ) >>= aConvText;
|
2003-04-17 16:49:32 +00:00
|
|
|
|
|
|
|
bGoOn = GetCrsrCnt() > 1;
|
2012-01-17 17:47:34 -02:00
|
|
|
if( !aConvText.isEmpty() )
|
2003-04-17 16:49:32 +00:00
|
|
|
{
|
2012-09-27 13:21:50 +09:00
|
|
|
bGoOn = false;
|
2003-04-17 16:49:32 +00:00
|
|
|
SwPosition* pNewPoint = new SwPosition( *pCrsr->GetPoint() );
|
|
|
|
SwPosition* pNewMark = new SwPosition( *pCrsr->GetMark() );
|
2003-06-25 09:33:56 +00:00
|
|
|
|
|
|
|
SetCurr( pNewPoint );
|
|
|
|
SetCurrX( pNewMark );
|
2003-04-17 16:49:32 +00:00
|
|
|
}
|
|
|
|
if( bGoOn )
|
|
|
|
{
|
2007-09-27 07:46:02 +00:00
|
|
|
pMySh->Pop( sal_False );
|
|
|
|
pCrsr = pMySh->GetCrsr();
|
2003-04-17 16:49:32 +00:00
|
|
|
if ( *pCrsr->GetPoint() > *pCrsr->GetMark() )
|
|
|
|
pCrsr->Exchange();
|
|
|
|
SwPosition* pNew = new SwPosition( *pCrsr->GetPoint() );
|
|
|
|
SetStart( pNew );
|
|
|
|
pNew = new SwPosition( *pCrsr->GetMark() );
|
|
|
|
SetEnd( pNew );
|
2003-06-25 09:33:56 +00:00
|
|
|
pNew = new SwPosition( *GetStart() );
|
2003-04-17 16:49:32 +00:00
|
|
|
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()
|
|
|
|
{
|
2000-10-25 11:07:02 +00:00
|
|
|
uno::Reference< beans::XPropertySet > xProp( ::GetLinguPropertySet() );
|
|
|
|
return xProp.is() ? *(sal_Bool*)xProp->getPropertyValue(
|
2013-03-01 13:50:58 +01:00
|
|
|
OUString(UPN_IS_HYPH_AUTO) ).getValue()
|
2000-10-25 11:07:02 +00:00
|
|
|
: sal_False;
|
2000-09-18 23:08:29 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void SwHyphIter::ShowSelection()
|
|
|
|
{
|
2007-09-27 07:46:02 +00:00
|
|
|
SwEditShell *pMySh = GetSh();
|
|
|
|
if( pMySh )
|
2000-09-18 23:08:29 +00:00
|
|
|
{
|
2007-09-27 07:46:02 +00:00
|
|
|
pMySh->StartAction();
|
2013-06-09 00:07:31 +02:00
|
|
|
// 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!
|
2007-09-27 07:46:02 +00:00
|
|
|
pMySh->EndAction();
|
2000-09-18 23:08:29 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void SwHyphIter::Start( SwEditShell *pShell, SwDocPositions eStart, SwDocPositions eEnd )
|
|
|
|
{
|
|
|
|
// robust
|
|
|
|
if( GetSh() || GetEnd() )
|
|
|
|
{
|
2013-06-09 00:31:37 +02:00
|
|
|
OSL_ENSURE( !GetSh(), "SwHyphIter::Start: missing HyphEnd()" );
|
2000-09-18 23:08:29 +00:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2013-06-09 00:31:37 +02:00
|
|
|
// 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 );
|
|
|
|
}
|
|
|
|
|
2013-06-09 00:07:31 +02:00
|
|
|
// restore selections
|
2000-09-18 23:08:29 +00:00
|
|
|
void SwHyphIter::End()
|
|
|
|
{
|
|
|
|
if( !GetSh() )
|
|
|
|
return;
|
|
|
|
((SwViewOption*)GetSh()->GetViewOptions())->SetIdle( bOldIdle );
|
|
|
|
_End();
|
|
|
|
}
|
|
|
|
|
2003-04-17 16:49:32 +00:00
|
|
|
uno::Any SwHyphIter::Continue( sal_uInt16* pPageCnt, sal_uInt16* pPageSt )
|
2000-09-18 23:08:29 +00:00
|
|
|
{
|
2003-04-17 16:49:32 +00:00
|
|
|
uno::Any aHyphRet;
|
2007-09-27 07:46:02 +00:00
|
|
|
SwEditShell *pMySh = GetSh();
|
|
|
|
if( !pMySh )
|
2003-04-17 16:49:32 +00:00
|
|
|
return aHyphRet;
|
2000-09-18 23:08:29 +00:00
|
|
|
|
2012-11-23 11:06:51 +09:00
|
|
|
const bool bAuto = IsAuto();
|
2000-10-27 10:55:57 +00:00
|
|
|
uno::Reference< XHyphenatedWord > xHyphWord;
|
2012-09-27 13:21:50 +09:00
|
|
|
bool bGoOn = false;
|
2000-09-18 23:08:29 +00:00
|
|
|
do {
|
|
|
|
SwPaM *pCrsr;
|
|
|
|
do {
|
2013-06-09 00:07:31 +02:00
|
|
|
OSL_ENSURE( GetEnd(), "SwHyphIter::Continue without Start?" );
|
2007-09-27 07:46:02 +00:00
|
|
|
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();
|
|
|
|
}
|
|
|
|
|
2011-01-28 21:16:36 +00:00
|
|
|
if ( *pCrsr->End() <= *GetEnd() )
|
2000-09-18 23:08:29 +00:00
|
|
|
{
|
|
|
|
*pCrsr->GetMark() = *GetEnd();
|
|
|
|
|
2013-06-09 00:07:31 +02:00
|
|
|
// Do we need to break the word at the current cursor position?
|
2007-09-27 07:46:02 +00:00
|
|
|
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() )
|
|
|
|
{
|
2007-09-27 07:46:02 +00:00
|
|
|
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 )
|
|
|
|
{
|
2007-09-27 07:46:02 +00:00
|
|
|
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 );
|
2003-04-17 16:49:32 +00:00
|
|
|
aHyphRet <<= xHyphWord;
|
|
|
|
return aHyphRet;
|
2000-09-18 23:08:29 +00:00
|
|
|
}
|
|
|
|
|
2013-06-09 00:07:31 +02:00
|
|
|
/// ignore hyphenation
|
2000-09-18 23:08:29 +00:00
|
|
|
void SwHyphIter::Ignore()
|
|
|
|
{
|
2007-09-27 07:46:02 +00:00
|
|
|
SwEditShell *pMySh = GetSh();
|
|
|
|
SwPaM *pCrsr = pMySh->GetCrsr();
|
2000-09-18 23:08:29 +00:00
|
|
|
|
2013-06-09 00:07:31 +02:00
|
|
|
// delete old SoftHyphen
|
2000-09-18 23:08:29 +00:00
|
|
|
DelSoftHyph( *pCrsr );
|
|
|
|
|
2013-06-09 00:07:31 +02:00
|
|
|
// 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();
|
2013-11-12 00:46:22 +01:00
|
|
|
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 );
|
|
|
|
}
|
|
|
|
|
2013-11-12 00:46:22 +01:00
|
|
|
void SwHyphIter::InsertSoftHyph( const sal_Int32 nHyphPos )
|
2000-09-18 23:08:29 +00:00
|
|
|
{
|
2007-09-27 07:46:02 +00:00
|
|
|
SwEditShell *pMySh = GetSh();
|
2013-06-09 00:31:37 +02:00
|
|
|
OSL_ENSURE( pMySh, "SwHyphIter::InsertSoftHyph: missing HyphStart()");
|
2007-09-27 07:46:02 +00:00
|
|
|
if( !pMySh )
|
2000-09-18 23:08:29 +00:00
|
|
|
return;
|
|
|
|
|
2007-09-27 07:46:02 +00:00
|
|
|
SwPaM *pCrsr = pMySh->GetCrsr();
|
|
|
|
SwPosition* pSttPos = pCrsr->Start();
|
|
|
|
SwPosition* pEndPos = pCrsr->End();
|
2000-09-18 23:08:29 +00:00
|
|
|
|
2013-11-12 00:46:22 +01:00
|
|
|
const sal_Int32 nLastHyphLen = GetEnd()->nContent.GetIndex() -
|
2007-09-27 07:46:02 +00:00
|
|
|
pSttPos->nContent.GetIndex();
|
2000-09-18 23:08:29 +00:00
|
|
|
|
2007-09-27 07:46:02 +00:00
|
|
|
if( pSttPos->nNode != pEndPos->nNode || !nLastHyphLen )
|
2000-09-18 23:08:29 +00:00
|
|
|
{
|
2010-11-25 17:08:45 +01:00
|
|
|
OSL_ENSURE( pSttPos->nNode == pEndPos->nNode,
|
2013-06-09 00:31:37 +02:00
|
|
|
"SwHyphIter::InsertSoftHyph: node warp during hyphenation" );
|
|
|
|
OSL_ENSURE(nLastHyphLen, "SwHyphIter::InsertSoftHyph: missing HyphContinue()");
|
2007-09-27 07:46:02 +00:00
|
|
|
*pSttPos = *pEndPos;
|
2000-09-18 23:08:29 +00:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2007-09-27 07:46:02 +00:00
|
|
|
pMySh->StartAction();
|
2000-09-18 23:08:29 +00:00
|
|
|
{
|
2007-09-27 07:46:02 +00:00
|
|
|
SwDoc *pDoc = pMySh->GetDoc();
|
2000-09-18 23:08:29 +00:00
|
|
|
DelSoftHyph( *pCrsr );
|
2007-09-27 07:46:02 +00:00
|
|
|
pSttPos->nContent += nHyphPos;
|
|
|
|
SwPaM aRg( *pSttPos );
|
2013-03-01 13:50:58 +01:00
|
|
|
pDoc->InsertString( aRg, OUString(CHAR_SOFTHYPHEN) );
|
2000-09-18 23:08:29 +00:00
|
|
|
}
|
2013-06-09 00:07:31 +02:00
|
|
|
// revoke selection
|
2000-09-18 23:08:29 +00:00
|
|
|
pCrsr->DeleteMark();
|
2007-09-27 07:46:02 +00:00
|
|
|
pMySh->EndAction();
|
2000-09-18 23:08:29 +00:00
|
|
|
pCrsr->SetMark();
|
|
|
|
}
|
|
|
|
|
2010-04-22 13:08:19 +02:00
|
|
|
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;
|
|
|
|
}
|
|
|
|
|
2011-01-17 15:06:54 +01:00
|
|
|
sal_Bool SwEditShell::HasConvIter() const
|
2003-04-17 16:49:32 +00:00
|
|
|
{
|
|
|
|
return 0 != pConvIter;
|
|
|
|
}
|
|
|
|
|
2011-01-17 15:06:54 +01:00
|
|
|
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();
|
2011-01-17 15:06:54 +01:00
|
|
|
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();
|
|
|
|
}
|
|
|
|
|
2003-04-17 16:49:32 +00:00
|
|
|
void SwEditShell::SpellStart(
|
|
|
|
SwDocPositions eStart, SwDocPositions eEnd, SwDocPositions eCurr,
|
2005-04-04 07:14:47 +00:00
|
|
|
SwConversionArgs *pConvArgs )
|
2000-09-18 23:08:29 +00:00
|
|
|
{
|
2003-04-17 16:49:32 +00:00
|
|
|
SwLinguIter *pLinguIter = 0;
|
|
|
|
|
2000-09-18 23:08:29 +00:00
|
|
|
// do not spell if interactive spelling is active elsewhere
|
2005-04-04 07:14:47 +00:00
|
|
|
if (!pConvArgs && !pSpellIter)
|
2000-09-18 23:08:29 +00:00
|
|
|
{
|
2010-11-25 17:08:45 +01:00
|
|
|
OSL_ENSURE( !pSpellIter, "wer ist da schon am spellen?" );
|
2000-09-18 23:08:29 +00:00
|
|
|
pSpellIter = new SwSpellIter;
|
2003-04-17 16:49:32 +00:00
|
|
|
pLinguIter = pSpellIter;
|
|
|
|
}
|
|
|
|
// do not do text conversion if it is active elsewhere
|
2005-04-04 07:14:47 +00:00
|
|
|
if (pConvArgs && !pConvIter)
|
2003-04-17 16:49:32 +00:00
|
|
|
{
|
2010-11-25 17:08:45 +01:00
|
|
|
OSL_ENSURE( !pConvIter, "text conversion already active!" );
|
2005-04-04 07:14:47 +00:00
|
|
|
pConvIter = new SwConvIter( *pConvArgs );
|
2003-04-17 16:49:32 +00:00
|
|
|
pLinguIter = pConvIter;
|
|
|
|
}
|
2000-09-18 23:08:29 +00:00
|
|
|
|
2003-04-17 16:49:32 +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 );
|
2003-04-17 16:49:32 +00:00
|
|
|
pLinguIter->SetCurr( pTmp );
|
2000-09-18 23:08:29 +00:00
|
|
|
|
|
|
|
pTmp = new SwPosition( *pTmp );
|
2003-04-17 16:49:32 +00:00
|
|
|
pLinguIter->SetCurrX( pTmp );
|
|
|
|
}
|
2000-09-18 23:08:29 +00:00
|
|
|
|
2005-04-04 07:14:47 +00:00
|
|
|
if (!pConvArgs && pSpellIter)
|
2000-09-18 23:08:29 +00:00
|
|
|
pSpellIter->Start( this, eStart, eEnd );
|
2005-04-04 07:14:47 +00:00
|
|
|
if (pConvArgs && pConvIter)
|
2003-04-17 16:49:32 +00:00
|
|
|
pConvIter->Start( this, eStart, eEnd );
|
2000-09-18 23:08:29 +00:00
|
|
|
}
|
|
|
|
|
2005-10-18 12:48:17 +00:00
|
|
|
void SwEditShell::SpellEnd( SwConversionArgs *pConvArgs, bool bRestoreSelection )
|
2000-09-18 23:08:29 +00:00
|
|
|
{
|
2005-04-04 07:14:47 +00:00
|
|
|
if (!pConvArgs && pSpellIter && pSpellIter->GetSh() == this)
|
2000-09-18 23:08:29 +00:00
|
|
|
{
|
2010-11-25 17:08:45 +01:00
|
|
|
OSL_ENSURE( pSpellIter, "wo ist mein Iterator?" );
|
2005-10-18 12:48:17 +00:00
|
|
|
pSpellIter->_End(bRestoreSelection);
|
2000-09-18 23:08:29 +00:00
|
|
|
delete pSpellIter, pSpellIter = 0;
|
|
|
|
}
|
2005-04-04 07:14:47 +00:00
|
|
|
if (pConvArgs && pConvIter && pConvIter->GetSh() == this)
|
2003-04-17 16:49:32 +00:00
|
|
|
{
|
2010-11-25 17:08:45 +01:00
|
|
|
OSL_ENSURE( pConvIter, "wo ist mein Iterator?" );
|
2003-04-17 16:49:32 +00:00
|
|
|
pConvIter->_End();
|
|
|
|
delete pConvIter, pConvIter = 0;
|
|
|
|
}
|
2000-09-18 23:08:29 +00:00
|
|
|
}
|
|
|
|
|
2013-06-09 00:07:31 +02:00
|
|
|
/// @returns SPL_ return values as in splchk.hxx
|
2003-04-17 16:49:32 +00:00
|
|
|
uno::Any SwEditShell::SpellContinue(
|
|
|
|
sal_uInt16* pPageCnt, sal_uInt16* pPageSt,
|
2005-04-04 07:14:47 +00:00
|
|
|
SwConversionArgs *pConvArgs )
|
2000-09-18 23:08:29 +00:00
|
|
|
{
|
2003-04-17 16:49:32 +00:00
|
|
|
uno::Any aRes;
|
|
|
|
|
2005-04-04 07:14:47 +00:00
|
|
|
if ((!pConvArgs && pSpellIter->GetSh() != this) ||
|
|
|
|
( pConvArgs && pConvIter->GetSh() != this))
|
2003-04-17 16:49:32 +00:00
|
|
|
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() );
|
|
|
|
}
|
|
|
|
|
2010-11-25 17:08:45 +01:00
|
|
|
OSL_ENSURE( pConvArgs || pSpellIter, "SpellIter missing" );
|
|
|
|
OSL_ENSURE( !pConvArgs || pConvIter, "ConvIter missing" );
|
2013-06-09 00:07:31 +02:00
|
|
|
//JP 18.07.95: prevent displaying selection on error messages. NO StartAction so that all
|
|
|
|
// Paints are also disabled.
|
2013-02-23 12:33:14 +01:00
|
|
|
++mnStartAction;
|
2013-03-01 13:50:58 +01:00
|
|
|
OUString aRet;
|
2003-04-17 16:49:32 +00:00
|
|
|
uno::Reference< uno::XInterface > xRet;
|
2005-04-04 07:14:47 +00:00
|
|
|
if (pConvArgs)
|
2003-04-17 16:49:32 +00:00
|
|
|
{
|
|
|
|
pConvIter->Continue( pPageCnt, pPageSt ) >>= aRet;
|
|
|
|
aRes <<= aRet;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
pSpellIter->Continue( pPageCnt, pPageSt ) >>= xRet;
|
|
|
|
aRes <<= xRet;
|
|
|
|
}
|
2013-02-23 12:33:14 +01:00
|
|
|
--mnStartAction;
|
2000-09-18 23:08:29 +00:00
|
|
|
|
2012-01-17 17:47:34 -02:00
|
|
|
if( !aRet.isEmpty() || xRet.is() )
|
2000-09-18 23:08:29 +00:00
|
|
|
{
|
2013-06-09 00:07:31 +02:00
|
|
|
// then make awt::Selection again visible
|
2000-09-18 23:08:29 +00:00
|
|
|
StartAction();
|
|
|
|
EndAction();
|
|
|
|
}
|
2003-04-17 16:49:32 +00:00
|
|
|
return aRes;
|
2000-09-18 23:08:29 +00:00
|
|
|
}
|
|
|
|
|
2013-06-09 00:07:31 +02:00
|
|
|
/* Interactive Hyphenation (BP 10.03.93)
|
2000-09-18 23:08:29 +00:00
|
|
|
*
|
|
|
|
* 1) HyphStart
|
2013-06-09 00:07:31 +02:00
|
|
|
* - 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
|
2013-06-09 00:07:31 +02:00
|
|
|
* - 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
|
2013-06-09 00:07:31 +02:00
|
|
|
* - 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)
|
|
|
|
{
|
2010-11-25 17:08:45 +01:00
|
|
|
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 );
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2013-06-09 00:07:31 +02:00
|
|
|
/// restore selections
|
2000-09-18 23:08:29 +00:00
|
|
|
void SwEditShell::HyphEnd()
|
|
|
|
{
|
|
|
|
if (pHyphIter->GetSh() == this)
|
|
|
|
{
|
2013-06-09 00:07:31 +02:00
|
|
|
OSL_ENSURE( pHyphIter, "No Iterator" );
|
2000-09-18 23:08:29 +00:00
|
|
|
pHyphIter->End();
|
|
|
|
delete pHyphIter, pHyphIter = 0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2013-06-09 00:07:31 +02:00
|
|
|
/// @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());
|
|
|
|
}
|
2013-06-09 00:07:31 +02:00
|
|
|
else // here we once and for all suppress StatLineStartPercent
|
|
|
|
*pPageSt = 1;
|
2000-09-18 23:08:29 +00:00
|
|
|
}
|
|
|
|
|
2013-06-09 00:07:31 +02: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.
|
2013-02-23 12:33:14 +01:00
|
|
|
++mnStartAction;
|
2003-04-17 16:49:32 +00:00
|
|
|
uno::Reference< uno::XInterface > xRet;
|
|
|
|
pHyphIter->Continue( pPageCnt, pPageSt ) >>= xRet;
|
2013-02-23 12:33:14 +01:00
|
|
|
--mnStartAction;
|
2000-09-18 23:08:29 +00:00
|
|
|
|
|
|
|
if( xRet.is() )
|
|
|
|
pHyphIter->ShowSelection();
|
|
|
|
|
|
|
|
return xRet;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2013-06-09 00:07:31 +02:00
|
|
|
/** 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 )
|
|
|
|
{
|
2010-11-25 17:08:45 +01:00
|
|
|
OSL_ENSURE( pHyphIter, "wo ist mein Iterator?" );
|
2000-09-18 23:08:29 +00:00
|
|
|
pHyphIter->InsertSoftHyph( nHyphPos );
|
|
|
|
}
|
|
|
|
|
2013-06-09 00:07:31 +02:00
|
|
|
/// ignore hyphenation
|
2000-09-18 23:08:29 +00:00
|
|
|
void SwEditShell::HyphIgnore()
|
|
|
|
{
|
2013-06-09 00:07:31 +02: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.
|
2013-02-23 12:33:14 +01:00
|
|
|
++mnStartAction;
|
2000-09-18 23:08:29 +00:00
|
|
|
pHyphIter->Ignore();
|
2013-02-23 12:33:14 +01:00
|
|
|
--mnStartAction;
|
2000-09-18 23:08:29 +00:00
|
|
|
|
|
|
|
pHyphIter->ShowSelection();
|
|
|
|
}
|
|
|
|
|
2013-06-09 00:07:31 +02:00
|
|
|
/** 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 >
|
2004-05-17 16:27:54 +00:00
|
|
|
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() )
|
|
|
|
{
|
2013-11-12 00:46:22 +01:00
|
|
|
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) )
|
|
|
|
{
|
2013-10-02 13:34:02 +01:00
|
|
|
const OUString aText(pNode->GetTxt().copy(nBegin, nLen));
|
2013-10-15 17:54:25 +02:00
|
|
|
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() )
|
|
|
|
{
|
2004-11-27 12:18:01 +00:00
|
|
|
LanguageType eActLang = (LanguageType)pNode->GetLang( nBegin, nLen );
|
2000-09-18 23:08:29 +00:00
|
|
|
if( xSpell->hasLanguage( eActLang ))
|
2004-11-27 12:18:01 +00:00
|
|
|
{
|
|
|
|
// 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];
|
2013-03-01 13:50:58 +01:00
|
|
|
rVal.Name = OUString( UPN_MAX_NUMBER_OF_SUGGESTIONS );
|
2011-01-17 15:06:54 +01:00
|
|
|
rVal.Value <<= (sal_Int16) 7;
|
2004-11-27 12:18:01 +00:00
|
|
|
|
|
|
|
xSpellAlt = xSpell->spell( aWord, eActLang, aPropVals );
|
|
|
|
}
|
2000-09-18 23:08:29 +00:00
|
|
|
}
|
|
|
|
|
2008-07-16 12:26:07 +00:00
|
|
|
if ( xSpellAlt.is() ) // error found?
|
2000-09-18 23:08:29 +00:00
|
|
|
{
|
2013-06-09 00:07:31 +02:00
|
|
|
// save the start and end positons of the line and the starting point
|
2004-05-17 16:27:54 +00:00
|
|
|
Push();
|
|
|
|
LeftMargin();
|
2013-11-12 00:46:22 +01:00
|
|
|
const sal_Int32 nLineStart = GetCrsr()->GetPoint()->nContent.GetIndex();
|
2004-05-17 16:27:54 +00:00
|
|
|
RightMargin();
|
2013-11-12 00:46:22 +01:00
|
|
|
const sal_Int32 nLineEnd = GetCrsr()->GetPoint()->nContent.GetIndex();
|
2011-01-17 15:06:54 +01:00
|
|
|
Pop(sal_False);
|
2004-05-17 16:27:54 +00:00
|
|
|
|
2012-07-18 17:00:52 +01:00
|
|
|
// 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.
|
2013-10-02 13:34:02 +01:00
|
|
|
const sal_Unicode* pChar = aText.getStr();
|
2013-11-12 00:46:22 +01:00
|
|
|
sal_Int32 nLeft = 0;
|
2003-09-29 14:05:10 +00:00
|
|
|
while (pChar && *pChar++ == CH_TXTATR_INWORD)
|
|
|
|
++nLeft;
|
2013-10-02 13:34:02 +01:00
|
|
|
pChar = aText.getLength() ? aText.getStr() + aText.getLength() - 1 : 0;
|
2013-11-12 00:46:22 +01:00
|
|
|
sal_Int32 nRight = 0;
|
2003-09-29 14:05:10 +00:00
|
|
|
while (pChar && *pChar-- == CH_TXTATR_INWORD)
|
|
|
|
++nRight;
|
|
|
|
|
|
|
|
aPos.nContent = nBegin + nLeft;
|
2004-05-17 16:27:54 +00:00
|
|
|
pCrsr = GetCrsr();
|
2000-09-18 23:08:29 +00:00
|
|
|
*pCrsr->GetPoint() = aPos;
|
|
|
|
pCrsr->SetMark();
|
2003-09-29 14:05:10 +00:00
|
|
|
ExtendSelection( sal_True, nLen - nLeft - nRight );
|
2013-06-09 00:31:37 +02:00
|
|
|
// don't determine the rectangle in the current line
|
2013-11-12 00:46:22 +01:00
|
|
|
const sal_Int32 nWordStart = (nBegin + nLeft) < nLineStart ? nLineStart : nBegin + nLeft;
|
2013-06-09 00:31:37 +02:00
|
|
|
// take one less than the line end - otherwise the next line would be calculated
|
2013-11-12 00:46:22 +01:00
|
|
|
const sal_Int32 nWordEnd = (nBegin + nLen - nLeft - nRight) > nLineEnd
|
2013-06-09 00:46:42 +02:00
|
|
|
? nLineEnd : (nBegin + nLen - nLeft - nRight);
|
2004-05-17 16:27:54 +00:00
|
|
|
Push();
|
|
|
|
pCrsr->DeleteMark();
|
|
|
|
SwIndex& rContent = GetCrsr()->GetPoint()->nContent;
|
|
|
|
rContent = nWordStart;
|
|
|
|
SwRect aStartRect;
|
|
|
|
SwCrsrMoveState aState;
|
2011-01-17 15:06:54 +01:00
|
|
|
aState.bRealWidth = sal_True;
|
2004-05-17 16:27:54 +00:00
|
|
|
SwCntntNode* pCntntNode = pCrsr->GetCntntNode();
|
2011-02-09 15:55:27 +01:00
|
|
|
SwCntntFrm *pCntntFrame = pCntntNode->getLayoutFrm( GetLayout(), pPt, pCrsr->GetPoint(), sal_False);
|
2004-05-17 16:27:54 +00:00
|
|
|
|
|
|
|
pCntntFrame->GetCharRect( aStartRect, *pCrsr->GetPoint(), &aState );
|
2011-01-28 21:16:36 +00:00
|
|
|
rContent = nWordEnd - 1;
|
2004-05-17 16:27:54 +00:00
|
|
|
SwRect aEndRect;
|
|
|
|
pCntntFrame->GetCharRect( aEndRect, *pCrsr->GetPoint(),&aState );
|
|
|
|
rSelectRect = aStartRect.Union( aEndRect );
|
2011-01-17 15:06:54 +01:00
|
|
|
Pop(sal_False);
|
2000-09-18 23:08:29 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return xSpellAlt;
|
|
|
|
}
|
|
|
|
|
2008-07-16 12:26:07 +00:00
|
|
|
bool SwEditShell::GetGrammarCorrection(
|
2013-06-09 00:31:37 +02:00
|
|
|
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
|
2008-07-16 12:26:07 +00:00
|
|
|
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() )
|
|
|
|
{
|
2013-11-12 00:46:22 +01:00
|
|
|
sal_Int32 nBegin = aPos.nContent.GetIndex();
|
|
|
|
sal_Int32 nLen = 1;
|
2008-07-16 12:26:07 +00:00
|
|
|
if (pWrong->InWrongWord(nBegin, nLen))
|
|
|
|
{
|
2013-10-02 13:34:02 +01:00
|
|
|
const OUString aText(pNode->GetTxt().copy(nBegin, nLen));
|
2008-07-16 12:26:07 +00:00
|
|
|
|
2013-02-23 12:33:14 +01:00
|
|
|
uno::Reference< linguistic2::XProofreadingIterator > xGCIterator( mpDoc->GetGCIterator() );
|
2008-07-16 12:26:07 +00:00
|
|
|
if (xGCIterator.is())
|
|
|
|
{
|
2013-02-23 12:33:14 +01:00
|
|
|
uno::Reference< lang::XComponent > xDoc( mpDoc->GetDocShell()->GetBaseModel(), uno::UNO_QUERY );
|
2008-07-16 12:26:07 +00:00
|
|
|
|
|
|
|
// Expand the string:
|
2012-07-20 16:11:08 +01:00
|
|
|
const ModelToViewHelper aConversionMap(*pNode);
|
2013-03-01 13:50:58 +01:00
|
|
|
OUString aExpandText = aConversionMap.getViewText();
|
2008-07-16 12:26:07 +00:00
|
|
|
// get XFlatParagraph to use...
|
2012-07-20 16:11:08 +01:00
|
|
|
uno::Reference< text::XFlatParagraph > xFlatPara = new SwXFlatParagraph( *pNode, aExpandText, aConversionMap );
|
2008-07-16 12:26:07 +00:00
|
|
|
|
|
|
|
// get error position of cursor in XFlatParagraph
|
2012-07-20 16:11:08 +01:00
|
|
|
rErrorPosInText = aConversionMap.ConvertToViewPosition( nBegin );
|
2008-07-16 12:26:07 +00:00
|
|
|
|
2013-12-08 14:08:22 +01:00
|
|
|
const sal_Int32 nStartOfSentence = aConversionMap.ConvertToViewPosition( pWrong->getSentenceStart( nBegin ) );
|
|
|
|
const sal_Int32 nEndOfSentence = aConversionMap.ConvertToViewPosition( pWrong->getSentenceEnd( nBegin ) );
|
2008-07-16 12:26:07 +00:00
|
|
|
|
2008-12-15 12:01:46 +00:00
|
|
|
rResult = xGCIterator->checkSentenceAtPosition(
|
2013-12-08 14:08:22 +01:00
|
|
|
xDoc, xFlatPara, aExpandText, lang::Locale(), nStartOfSentence,
|
|
|
|
nEndOfSentence == STRING_LEN ? aExpandText.getLength() : nEndOfSentence,
|
|
|
|
rErrorPosInText );
|
2008-07-16 12:26:07 +00:00
|
|
|
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();
|
2008-07-16 12:26:07 +00:00
|
|
|
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];
|
2008-07-16 12:26:07 +00:00
|
|
|
if (rError.nErrorStart <= rErrorPosInText &&
|
2012-05-09 20:39:40 +02:00
|
|
|
rErrorPosInText + nLen <= rError.nErrorStart + rError.nErrorLength)
|
2008-07-16 12:26:07 +00:00
|
|
|
{
|
|
|
|
rSuggestions = rError.aSuggestions;
|
|
|
|
rErrorIndexInResult = i;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2008-12-15 12:01:46 +00:00
|
|
|
if (rResult.aErrors.getLength() > 0) // error found?
|
2008-07-16 12:26:07 +00:00
|
|
|
{
|
2013-06-09 00:31:37 +02:00
|
|
|
// save the start and end positons of the line and the starting point
|
2008-07-16 12:26:07 +00:00
|
|
|
Push();
|
|
|
|
LeftMargin();
|
2013-11-12 00:46:22 +01:00
|
|
|
const sal_Int32 nLineStart = GetCrsr()->GetPoint()->nContent.GetIndex();
|
2008-07-16 12:26:07 +00:00
|
|
|
RightMargin();
|
2013-11-12 00:46:22 +01:00
|
|
|
const sal_Int32 nLineEnd = GetCrsr()->GetPoint()->nContent.GetIndex();
|
2011-01-17 15:06:54 +01:00
|
|
|
Pop(sal_False);
|
2008-07-16 12:26:07 +00:00
|
|
|
|
2012-07-18 17:00:52 +01:00
|
|
|
// 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.
|
2013-10-02 13:34:02 +01:00
|
|
|
const sal_Unicode* pChar = aText.getStr();
|
2013-11-12 00:46:22 +01:00
|
|
|
sal_Int32 nLeft = 0;
|
2008-07-16 12:26:07 +00:00
|
|
|
while (pChar && *pChar++ == CH_TXTATR_INWORD)
|
|
|
|
++nLeft;
|
2013-10-02 13:34:02 +01:00
|
|
|
pChar = aText.getLength() ? aText.getStr() + aText.getLength() - 1 : 0;
|
2013-11-12 00:46:22 +01:00
|
|
|
sal_Int32 nRight = 0;
|
2008-07-16 12:26:07 +00:00
|
|
|
while (pChar && *pChar-- == CH_TXTATR_INWORD)
|
|
|
|
++nRight;
|
|
|
|
|
|
|
|
aPos.nContent = nBegin + nLeft;
|
|
|
|
pCrsr = GetCrsr();
|
|
|
|
*pCrsr->GetPoint() = aPos;
|
|
|
|
pCrsr->SetMark();
|
|
|
|
ExtendSelection( sal_True, nLen - nLeft - nRight );
|
2013-06-09 00:31:37 +02:00
|
|
|
// don't determine the rectangle in the current line
|
2013-11-12 00:46:22 +01:00
|
|
|
const sal_Int32 nWordStart = (nBegin + nLeft) < nLineStart ? nLineStart : nBegin + nLeft;
|
2013-06-09 00:31:37 +02:00
|
|
|
// take one less than the line end - otherwise the next line would be calculated
|
2013-11-12 00:46:22 +01:00
|
|
|
const sal_Int32 nWordEnd = (nBegin + nLen - nLeft - nRight) > nLineEnd
|
2013-06-09 00:46:42 +02:00
|
|
|
? nLineEnd : (nBegin + nLen - nLeft - nRight);
|
2008-07-16 12:26:07 +00:00
|
|
|
Push();
|
|
|
|
pCrsr->DeleteMark();
|
|
|
|
SwIndex& rContent = GetCrsr()->GetPoint()->nContent;
|
|
|
|
rContent = nWordStart;
|
|
|
|
SwRect aStartRect;
|
|
|
|
SwCrsrMoveState aState;
|
2011-01-17 15:06:54 +01:00
|
|
|
aState.bRealWidth = sal_True;
|
2008-07-16 12:26:07 +00:00
|
|
|
SwCntntNode* pCntntNode = pCrsr->GetCntntNode();
|
2011-02-09 15:55:27 +01:00
|
|
|
SwCntntFrm *pCntntFrame = pCntntNode->getLayoutFrm( GetLayout(), pPt, pCrsr->GetPoint(), sal_False);
|
2008-07-16 12:26:07 +00:00
|
|
|
|
|
|
|
pCntntFrame->GetCharRect( aStartRect, *pCrsr->GetPoint(), &aState );
|
2011-01-28 21:16:36 +00:00
|
|
|
rContent = nWordEnd - 1;
|
2008-07-16 12:26:07 +00:00
|
|
|
SwRect aEndRect;
|
|
|
|
pCntntFrame->GetCharRect( aEndRect, *pCrsr->GetPoint(),&aState );
|
|
|
|
rSelectRect = aStartRect.Union( aEndRect );
|
2011-01-17 15:06:54 +01:00
|
|
|
Pop(sal_False);
|
2008-07-16 12:26:07 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return bRes;
|
|
|
|
}
|
|
|
|
|
|
|
|
bool SwEditShell::SpellSentence(::svx::SpellPortions& rPortions, bool bIsGrammarCheck)
|
2004-09-17 13:49:23 +00:00
|
|
|
{
|
2010-11-25 17:08:45 +01:00
|
|
|
OSL_ENSURE( pSpellIter, "SpellIter missing" );
|
2004-09-17 13:49:23 +00:00
|
|
|
if(!pSpellIter)
|
|
|
|
return false;
|
2008-07-16 12:26:07 +00:00
|
|
|
bool bRet = pSpellIter->SpellSentence(rPortions, bIsGrammarCheck);
|
2004-09-17 13:49:23 +00:00
|
|
|
|
|
|
|
// make Selection visible - this should simply move the
|
|
|
|
// cursor to the end of the sentence
|
|
|
|
StartAction();
|
|
|
|
EndAction();
|
|
|
|
return bRet;
|
|
|
|
}
|
2013-06-09 00:31:37 +02:00
|
|
|
|
|
|
|
///make SpellIter start with the current sentence when called next time
|
2008-12-15 12:01:46 +00:00
|
|
|
void SwEditShell::PutSpellingToSentenceStart()
|
|
|
|
{
|
2010-11-25 17:08:45 +01:00
|
|
|
OSL_ENSURE( pSpellIter, "SpellIter missing" );
|
2008-12-15 12:01:46 +00:00
|
|
|
if(!pSpellIter)
|
|
|
|
return;
|
|
|
|
pSpellIter->ToSentenceStart();
|
|
|
|
}
|
2005-03-01 14:24:11 +00:00
|
|
|
|
2013-06-09 00:46:42 +02:00
|
|
|
static sal_uInt32 lcl_CountRedlines(const ::svx::SpellPortions& rLastPortions)
|
2005-03-01 14:24:11 +00:00
|
|
|
{
|
|
|
|
sal_uInt32 nRet = 0;
|
|
|
|
SpellPortions::const_iterator aIter = rLastPortions.begin();
|
|
|
|
for( ; aIter != rLastPortions.end(); ++aIter)
|
|
|
|
{
|
|
|
|
if( aIter->bIsHidden )
|
|
|
|
++nRet;
|
|
|
|
}
|
|
|
|
return nRet;
|
|
|
|
}
|
2010-04-22 13:08:19 +02:00
|
|
|
|
|
|
|
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)
|
2004-09-17 13:49:23 +00:00
|
|
|
{
|
2010-07-09 10:55:23 +02:00
|
|
|
// Note: rNewPortions.size() == 0 is valid and happens when the whole
|
|
|
|
// sentence got removed in the dialog
|
|
|
|
|
2010-11-25 17:08:45 +01:00
|
|
|
OSL_ENSURE( pSpellIter, "SpellIter missing" );
|
2010-07-09 10:55:23 +02:00
|
|
|
if(pSpellIter &&
|
|
|
|
pSpellIter->GetLastPortions().size() > 0) // no portions -> no text to be changed
|
2004-09-17 13:49:23 +00:00
|
|
|
{
|
|
|
|
const SpellPortions& rLastPortions = pSpellIter->GetLastPortions();
|
|
|
|
const SpellContentPositions rLastPositions = pSpellIter->GetLastPositions();
|
2010-11-25 17:08:45 +01:00
|
|
|
OSL_ENSURE(rLastPortions.size() > 0 &&
|
2004-09-17 13:49:23 +00:00
|
|
|
rLastPortions.size() == rLastPositions.size(),
|
2010-11-25 17:08:45 +01:00
|
|
|
"last vectors of spelling results are not set or not equal");
|
2000-09-18 23:08:29 +00:00
|
|
|
|
2004-09-17 13:49:23 +00:00
|
|
|
// iterate over the new portions, beginning at the end to take advantage of the previously
|
|
|
|
// saved content positions
|
|
|
|
|
2013-02-23 12:33:14 +01:00
|
|
|
mpDoc->GetIDocumentUndoRedo().StartUndo( UNDO_UI_TEXT_CORRECTION, NULL );
|
2004-09-17 13:49:23 +00:00
|
|
|
StartAction();
|
2010-04-22 13:08:19 +02:00
|
|
|
|
|
|
|
SwPaM *pCrsr = GetCrsr();
|
|
|
|
// save cursor position (which should be at the end of the current sentence)
|
|
|
|
// for later restoration
|
|
|
|
Push();
|
|
|
|
|
2005-03-01 14:24:11 +00:00
|
|
|
sal_uInt32 nRedlinePortions = lcl_CountRedlines(rLastPortions);
|
|
|
|
if((rLastPortions.size() - nRedlinePortions) == rNewPortions.size())
|
2004-09-17 13:49:23 +00:00
|
|
|
{
|
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" );
|
2010-07-09 10:55:23 +02:00
|
|
|
|
2013-06-09 00:31:37 +02:00
|
|
|
// the simple case: the same number of elements on both sides
|
|
|
|
// each changed element has to be applied to the corresponding source element
|
2004-09-17 13:49:23 +00:00
|
|
|
svx::SpellPortions::const_iterator aCurrentNewPortion = rNewPortions.end();
|
|
|
|
SpellPortions::const_iterator aCurrentOldPortion = rLastPortions.end();
|
|
|
|
SpellContentPositions::const_iterator aCurrentOldPosition = rLastPositions.end();
|
|
|
|
do
|
|
|
|
{
|
|
|
|
--aCurrentNewPortion;
|
|
|
|
--aCurrentOldPortion;
|
|
|
|
--aCurrentOldPosition;
|
2005-03-01 14:24:11 +00:00
|
|
|
//jump over redline portions
|
|
|
|
while(aCurrentOldPortion->bIsHidden)
|
|
|
|
{
|
2010-07-09 10:55:23 +02:00
|
|
|
if (aCurrentOldPortion != rLastPortions.begin() &&
|
|
|
|
aCurrentOldPosition != rLastPositions.begin())
|
|
|
|
{
|
|
|
|
--aCurrentOldPortion;
|
|
|
|
--aCurrentOldPosition;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2011-05-10 09:56:23 +02:00
|
|
|
OSL_FAIL("ApplyChangedSentence: iterator positions broken" );
|
2010-07-09 10:55:23 +02:00
|
|
|
break;
|
|
|
|
}
|
2005-03-01 14:24:11 +00:00
|
|
|
}
|
2004-09-17 13:49:23 +00:00
|
|
|
if ( !pCrsr->HasMark() )
|
|
|
|
pCrsr->SetMark();
|
|
|
|
pCrsr->GetPoint()->nContent = aCurrentOldPosition->nLeft;
|
|
|
|
pCrsr->GetMark()->nContent = aCurrentOldPosition->nRight;
|
2011-01-17 15:06:54 +01:00
|
|
|
sal_uInt16 nScriptType = GetI18NScriptTypeOfLanguage( aCurrentNewPortion->eLanguage );
|
|
|
|
sal_uInt16 nLangWhichId = RES_CHRATR_LANGUAGE;
|
2004-09-17 13:49:23 +00:00
|
|
|
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)
|
|
|
|
{
|
2013-06-09 00:31:37 +02:00
|
|
|
// change text ...
|
2013-02-23 12:33:14 +01:00
|
|
|
mpDoc->DeleteAndJoin(*pCrsr);
|
2004-09-17 13:49:23 +00:00
|
|
|
// ... and apply language if necessary
|
|
|
|
if(aCurrentNewPortion->eLanguage != aCurrentOldPortion->eLanguage)
|
2013-11-18 11:29:24 +00:00
|
|
|
SetAttrItem( SvxLanguageItem(aCurrentNewPortion->eLanguage, nLangWhichId), nLangWhichId );
|
2013-02-23 12:33:14 +01:00
|
|
|
mpDoc->InsertString(*pCrsr, aCurrentNewPortion->sText);
|
2004-09-17 13:49:23 +00:00
|
|
|
}
|
|
|
|
else if(aCurrentNewPortion->eLanguage != aCurrentOldPortion->eLanguage)
|
|
|
|
{
|
2013-06-09 00:31:37 +02:00
|
|
|
// apply language
|
2013-11-18 11:29:24 +00:00
|
|
|
SetAttrItem( SvxLanguageItem(aCurrentNewPortion->eLanguage, nLangWhichId), nLangWhichId );
|
2004-09-17 13:49:23 +00:00
|
|
|
}
|
2008-12-15 12:01:46 +00:00
|
|
|
else if( aCurrentNewPortion->bIgnoreThisError )
|
|
|
|
{
|
2013-06-09 00:31:37 +02:00
|
|
|
// 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
|
|
|
}
|
2004-09-17 13:49:23 +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" );
|
2010-07-09 10:55:23 +02:00
|
|
|
|
2013-06-09 00:31:37 +02:00
|
|
|
// select the complete sentence
|
2004-09-17 13:49:23 +00:00
|
|
|
SpellContentPositions::const_iterator aCurrentEndPosition = rLastPositions.end();
|
|
|
|
--aCurrentEndPosition;
|
|
|
|
SpellContentPositions::const_iterator aCurrentStartPosition = rLastPositions.begin();
|
|
|
|
pCrsr->GetPoint()->nContent = aCurrentStartPosition->nLeft;
|
|
|
|
pCrsr->GetMark()->nContent = aCurrentEndPosition->nRight;
|
|
|
|
|
2013-06-09 00:31:37 +02:00
|
|
|
// delete the sentence completely
|
2013-02-23 12:33:14 +01:00
|
|
|
mpDoc->DeleteAndJoin(*pCrsr);
|
2004-09-17 13:49:23 +00:00
|
|
|
svx::SpellPortions::const_iterator aCurrentNewPortion = rNewPortions.begin();
|
|
|
|
while(aCurrentNewPortion != rNewPortions.end())
|
|
|
|
{
|
2013-06-09 00:31:37 +02:00
|
|
|
// set the language attribute
|
2011-01-17 15:06:54 +01:00
|
|
|
sal_uInt16 nScriptType = GetScriptType();
|
|
|
|
sal_uInt16 nLangWhichId = RES_CHRATR_LANGUAGE;
|
2004-09-17 13:49:23 +00:00
|
|
|
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);
|
2008-03-05 16:00:30 +00:00
|
|
|
GetCurAttr( aSet );
|
2004-09-17 13:49:23 +00:00
|
|
|
const SvxLanguageItem& rLang = static_cast<const SvxLanguageItem& >(aSet.Get(nLangWhichId));
|
|
|
|
if(rLang.GetLanguage() != aCurrentNewPortion->eLanguage)
|
2013-11-18 11:29:24 +00:00
|
|
|
SetAttrItem( SvxLanguageItem(aCurrentNewPortion->eLanguage, nLangWhichId) );
|
2013-06-09 00:31:37 +02:00
|
|
|
// insert the new string
|
2013-02-23 12:33:14 +01:00
|
|
|
mpDoc->InsertString(*pCrsr, aCurrentNewPortion->sText);
|
2004-09-17 13:49:23 +00:00
|
|
|
|
2013-06-09 00:31:37 +02:00
|
|
|
// set the cursor to the end of the inserted string
|
2004-09-17 13:49:23 +00:00
|
|
|
*pCrsr->Start() = *pCrsr->End();
|
|
|
|
++aCurrentNewPortion;
|
|
|
|
}
|
|
|
|
}
|
2010-04-22 13:08:19 +02:00
|
|
|
|
|
|
|
// restore cursor to the end of the sentence
|
|
|
|
// (will work also if the sentence length has changed,
|
|
|
|
// since cursors get updated automatically!)
|
2011-01-17 15:06:54 +01:00
|
|
|
Pop( sal_False );
|
2010-04-22 13:08:19 +02:00
|
|
|
|
|
|
|
// collapse cursor to the end of the modified sentence
|
2008-12-15 12:01:46 +00:00
|
|
|
*pCrsr->Start() = *pCrsr->End();
|
2010-04-22 13:08:19 +02:00
|
|
|
if (bRecheck)
|
2008-07-16 12:26:07 +00:00
|
|
|
{
|
2013-06-09 00:31:37 +02:00
|
|
|
// in grammar check the current sentence has to be checked again
|
2008-12-15 12:01:46 +00:00
|
|
|
GoStartSentence();
|
2008-07-16 12:26:07 +00:00
|
|
|
}
|
2010-04-22 13:08:19 +02:00
|
|
|
// set continuation position for spell/grammar checking to the end of this sentence
|
|
|
|
pSpellIter->SetCurr( new SwPosition( *pCrsr->Start() ) );
|
|
|
|
|
2013-02-23 12:33:14 +01:00
|
|
|
mpDoc->GetIDocumentUndoRedo().EndUndo( UNDO_UI_TEXT_CORRECTION, NULL );
|
2004-09-17 13:49:23 +00:00
|
|
|
EndAction();
|
|
|
|
}
|
|
|
|
}
|
2013-06-09 00:31:37 +02:00
|
|
|
/** Collect all deleted redlines of the current text node
|
|
|
|
* beginning at the start of the cursor position
|
|
|
|
*/
|
2012-10-12 16:49:40 +02:00
|
|
|
static SpellContentPositions lcl_CollectDeletedRedlines(SwEditShell* pSh)
|
2005-03-01 14:24:11 +00:00
|
|
|
{
|
|
|
|
SpellContentPositions aRedlines;
|
|
|
|
SwDoc* pDoc = pSh->GetDoc();
|
2007-09-27 07:46:02 +00:00
|
|
|
const bool bShowChg = IDocumentRedlineAccess::IsShowChanges( pDoc->GetRedlineMode() );
|
2005-03-01 14:24:11 +00:00
|
|
|
if ( bShowChg )
|
|
|
|
{
|
|
|
|
SwPaM *pCrsr = pSh->GetCrsr();
|
|
|
|
const SwPosition* pStartPos = pCrsr->Start();
|
|
|
|
const SwTxtNode* pTxtNode = pCrsr->GetNode()->GetTxtNode();
|
|
|
|
|
2011-01-17 15:06:54 +01:00
|
|
|
sal_uInt16 nAct = pDoc->GetRedlinePos( *pTxtNode, USHRT_MAX );
|
2013-11-12 00:46:22 +01:00
|
|
|
const sal_Int32 nStartIndex = pStartPos->nContent.GetIndex();
|
2012-07-20 17:16:03 +02:00
|
|
|
for ( ; nAct < pDoc->GetRedlineTbl().size(); nAct++ )
|
2005-03-01 14:24:11 +00:00
|
|
|
{
|
|
|
|
const SwRedline* pRed = pDoc->GetRedlineTbl()[ nAct ];
|
|
|
|
|
|
|
|
if ( pRed->Start()->nNode > pTxtNode->GetIndex() )
|
|
|
|
break;
|
|
|
|
|
2007-09-27 07:46:02 +00:00
|
|
|
if( nsRedlineType_t::REDLINE_DELETE == pRed->GetType() )
|
2005-03-01 14:24:11 +00:00
|
|
|
{
|
2013-11-12 00:46:22 +01:00
|
|
|
xub_StrLen nStart_, nEnd_;
|
|
|
|
pRed->CalcStartEnd( pTxtNode->GetIndex(), nStart_, nEnd_ );
|
|
|
|
sal_Int32 nStart = nStart_;
|
|
|
|
sal_Int32 nEnd = nEnd_;
|
2005-03-01 14:24:11 +00:00
|
|
|
if(nStart >= nStartIndex || nEnd >= nStartIndex)
|
|
|
|
{
|
|
|
|
SpellContentPosition aAdd;
|
|
|
|
aAdd.nLeft = nStart;
|
|
|
|
aAdd.nRight = nEnd;
|
|
|
|
aRedlines.push_back(aAdd);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return aRedlines;
|
|
|
|
}
|
2013-06-09 00:31:37 +02:00
|
|
|
|
|
|
|
/// remove the redline positions after the current selection
|
2012-10-12 16:49:40 +02:00
|
|
|
static void lcl_CutRedlines( SpellContentPositions& aDeletedRedlines, SwEditShell* pSh )
|
2005-03-01 14:24:11 +00:00
|
|
|
{
|
|
|
|
if(!aDeletedRedlines.empty())
|
|
|
|
{
|
|
|
|
SwPaM *pCrsr = pSh->GetCrsr();
|
|
|
|
const SwPosition* pEndPos = pCrsr->End();
|
2013-11-12 00:46:22 +01:00
|
|
|
const sal_Int32 nEnd = pEndPos->nContent.GetIndex();
|
2005-03-01 14:24:11 +00:00
|
|
|
while(!aDeletedRedlines.empty() &&
|
|
|
|
aDeletedRedlines.back().nLeft > nEnd)
|
|
|
|
{
|
|
|
|
aDeletedRedlines.pop_back();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2012-10-12 16:49:40 +02:00
|
|
|
static SpellContentPosition lcl_FindNextDeletedRedline(
|
2005-03-01 14:24:11 +00:00
|
|
|
const SpellContentPositions& rDeletedRedlines,
|
2013-11-12 00:46:22 +01:00
|
|
|
sal_Int32 nSearchFrom )
|
2005-03-01 14:24:11 +00:00
|
|
|
{
|
|
|
|
SpellContentPosition aRet;
|
2013-11-12 00:46:22 +01:00
|
|
|
aRet.nLeft = aRet.nRight = SAL_MAX_INT32;
|
2005-03-01 14:24:11 +00:00
|
|
|
if(!rDeletedRedlines.empty())
|
|
|
|
{
|
|
|
|
SpellContentPositions::const_iterator aIter = rDeletedRedlines.begin();
|
|
|
|
for( ; aIter != rDeletedRedlines.end(); ++aIter)
|
|
|
|
{
|
|
|
|
if(aIter->nLeft < nSearchFrom)
|
|
|
|
continue;
|
|
|
|
aRet = *aIter;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return aRet;
|
|
|
|
}
|
2004-09-17 13:49:23 +00:00
|
|
|
|
2008-07-16 12:26:07 +00:00
|
|
|
bool SwSpellIter::SpellSentence(::svx::SpellPortions& rPortions, bool bIsGrammarCheck)
|
2004-09-17 13:49:23 +00:00
|
|
|
{
|
|
|
|
bool bRet = false;
|
|
|
|
aLastPortions.clear();
|
|
|
|
aLastPositions.clear();
|
|
|
|
|
2007-09-27 07:46:02 +00:00
|
|
|
SwEditShell *pMySh = GetSh();
|
|
|
|
if( !pMySh )
|
2004-09-17 13:49:23 +00:00
|
|
|
return false;
|
|
|
|
|
2013-06-09 00:07:31 +02:00
|
|
|
OSL_ENSURE( GetEnd(), "SwSpellIter::SpellSentence without Start?");
|
2004-09-17 13:49:23 +00:00
|
|
|
|
|
|
|
uno::Reference< XSpellAlternatives > xSpellRet;
|
2008-12-15 12:01:46 +00:00
|
|
|
linguistic2::ProofreadingResult aGrammarResult;
|
2012-09-27 13:21:50 +09:00
|
|
|
bool bGoOn = true;
|
2008-07-16 12:26:07 +00:00
|
|
|
bool bGrammarErrorFound = false;
|
2004-09-17 13:49:23 +00:00
|
|
|
do {
|
2007-09-27 07:46:02 +00:00
|
|
|
SwPaM *pCrsr = pMySh->GetCrsr();
|
2004-09-17 13:49:23 +00:00
|
|
|
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;
|
|
|
|
}
|
2008-07-16 12:26:07 +00:00
|
|
|
uno::Any aSpellRet =
|
2007-09-27 07:46:02 +00:00
|
|
|
pMySh->GetDoc()->Spell(*pCrsr,
|
2008-07-16 12:26:07 +00:00
|
|
|
xSpeller, 0, 0, bIsGrammarCheck );
|
|
|
|
aSpellRet >>= xSpellRet;
|
|
|
|
aSpellRet >>= aGrammarResult;
|
2004-09-17 13:49:23 +00:00
|
|
|
bGoOn = GetCrsrCnt() > 1;
|
2008-12-15 12:01:46 +00:00
|
|
|
bGrammarErrorFound = aGrammarResult.aErrors.getLength() > 0;
|
2008-07-16 12:26:07 +00:00
|
|
|
if( xSpellRet.is() || bGrammarErrorFound )
|
2004-09-17 13:49:23 +00:00
|
|
|
{
|
2012-09-27 13:21:50 +09:00
|
|
|
bGoOn = false;
|
2004-09-17 13:49:23 +00:00
|
|
|
SwPosition* pNewPoint = new SwPosition( *pCrsr->GetPoint() );
|
|
|
|
SwPosition* pNewMark = new SwPosition( *pCrsr->GetMark() );
|
|
|
|
|
|
|
|
SetCurr( pNewPoint );
|
|
|
|
SetCurrX( pNewMark );
|
|
|
|
}
|
|
|
|
if( bGoOn )
|
|
|
|
{
|
2007-09-27 07:46:02 +00:00
|
|
|
pMySh->Pop( sal_False );
|
|
|
|
pCrsr = pMySh->GetCrsr();
|
2004-09-17 13:49:23 +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() );
|
|
|
|
SetCurr( pNew );
|
|
|
|
pNew = new SwPosition( *pNew );
|
|
|
|
SetCurrX( pNew );
|
|
|
|
pCrsr->SetMark();
|
|
|
|
--GetCrsrCnt();
|
|
|
|
}
|
2013-06-09 00:46:42 +02:00
|
|
|
} while ( bGoOn );
|
|
|
|
|
2008-07-16 12:26:07 +00:00
|
|
|
if(xSpellRet.is() || bGrammarErrorFound)
|
2004-09-17 13:49:23 +00:00
|
|
|
{
|
2013-06-09 00:31:37 +02:00
|
|
|
// an error has been found
|
|
|
|
// To fill the spell portions the beginning of the sentence has to be found
|
2007-09-27 07:46:02 +00:00
|
|
|
SwPaM *pCrsr = pMySh->GetCrsr();
|
2013-06-09 00:31:37 +02:00
|
|
|
// set the mark to the right if necessary
|
2008-12-15 12:01:46 +00:00
|
|
|
if ( *pCrsr->GetPoint() > *pCrsr->GetMark() )
|
2004-09-17 13:49:23 +00:00
|
|
|
pCrsr->Exchange();
|
2013-06-09 00:31:37 +02:00
|
|
|
// 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();
|
2012-11-23 11:06:51 +09:00
|
|
|
bool bStartSent = 0 != pMySh->GoStartSentence();
|
2007-09-27 07:46:02 +00:00
|
|
|
SpellContentPositions aDeletedRedlines = lcl_CollectDeletedRedlines(pMySh);
|
2004-09-17 13:49:23 +00:00
|
|
|
if(bStartSent)
|
|
|
|
{
|
2013-06-09 00:31:37 +02:00
|
|
|
// create a portion from the start part
|
2008-07-16 12:26:07 +00:00
|
|
|
AddPortion(0, 0, aDeletedRedlines);
|
2004-09-17 13:49:23 +00:00
|
|
|
}
|
2013-06-09 00:31:37 +02:00
|
|
|
// Set the cursor to the error already found
|
2004-09-17 13:49:23 +00:00
|
|
|
*pCrsr->GetPoint() = *GetCurrX();
|
|
|
|
*pCrsr->GetMark() = *GetCurr();
|
2008-07-16 12:26:07 +00:00
|
|
|
AddPortion(xSpellRet, &aGrammarResult, aDeletedRedlines);
|
2004-09-17 13:49:23 +00:00
|
|
|
|
2013-06-09 00:31:37 +02:00
|
|
|
// save the end position of the error to continue from here
|
2008-12-15 12:01:46 +00:00
|
|
|
SwPosition aSaveStartPos = *pCrsr->End();
|
2013-06-09 00:31:37 +02:00
|
|
|
// determine the end of the current sentence
|
2008-12-15 12:01:46 +00:00
|
|
|
if ( *pCrsr->GetPoint() < *pCrsr->GetMark() )
|
2004-09-17 13:49:23 +00:00
|
|
|
pCrsr->Exchange();
|
2013-06-09 00:31:37 +02:00
|
|
|
// again collapse to start marking after the end of the error
|
2008-12-15 12:01:46 +00:00
|
|
|
pCrsr->DeleteMark();
|
|
|
|
pCrsr->SetMark();
|
2004-09-17 13:49:23 +00:00
|
|
|
|
2007-09-27 07:46:02 +00:00
|
|
|
pMySh->GoEndSentence();
|
2008-12-15 12:01:46 +00:00
|
|
|
if( bGrammarErrorFound )
|
|
|
|
{
|
2012-07-20 16:11:08 +01:00
|
|
|
const ModelToViewHelper aConversionMap(*(SwTxtNode*)pCrsr->GetNode());
|
2013-03-01 13:50:58 +01:00
|
|
|
OUString aExpandText = aConversionMap.getViewText();
|
2013-12-01 18:04:38 +01:00
|
|
|
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);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2007-09-27 07:46:02 +00:00
|
|
|
lcl_CutRedlines( aDeletedRedlines, pMySh );
|
2013-06-09 00:31:37 +02:00
|
|
|
// save the 'global' end of the spellchecking
|
2004-09-17 13:49:23 +00:00
|
|
|
const SwPosition aSaveEndPos = *GetEnd();
|
2013-06-09 00:31:37 +02:00
|
|
|
// set the sentence end as 'local' end
|
2004-09-17 13:49:23 +00:00
|
|
|
SetEnd( new SwPosition( *pCrsr->End() ));
|
|
|
|
|
|
|
|
*pCrsr->GetPoint() = aSaveStartPos;
|
|
|
|
*pCrsr->GetMark() = *GetEnd();
|
2013-06-09 00:31:37 +02:00
|
|
|
// now the rest of the sentence has to be searched for errors
|
2004-09-17 13:49:23 +00:00
|
|
|
// 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
|
2008-07-16 12:26:07 +00:00
|
|
|
if( !bGrammarErrorFound ) //in grammar check there's only one error returned
|
2004-09-17 13:49:23 +00:00
|
|
|
{
|
2008-07-16 12:26:07 +00:00
|
|
|
do
|
2004-09-17 13:49:23 +00:00
|
|
|
{
|
2008-07-16 12:26:07 +00:00
|
|
|
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() ));
|
|
|
|
|
2013-06-09 00:31:37 +02:00
|
|
|
// if an error has been found go back to the text preceeding the error
|
2008-07-16 12:26:07 +00:00
|
|
|
if(xSpellRet.is())
|
|
|
|
{
|
|
|
|
*pCrsr->GetPoint() = aSaveStartPos;
|
|
|
|
*pCrsr->GetMark() = *GetCurr();
|
|
|
|
}
|
2013-06-09 00:31:37 +02:00
|
|
|
// add the portion
|
2008-07-16 12:26:07 +00:00
|
|
|
AddPortion(0, 0, aDeletedRedlines);
|
2004-09-17 13:49:23 +00:00
|
|
|
|
2008-07-16 12:26:07 +00:00
|
|
|
if(xSpellRet.is())
|
|
|
|
{
|
|
|
|
*pCrsr->GetPoint() = *GetCurr();
|
|
|
|
*pCrsr->GetMark() = *GetCurrX();
|
|
|
|
AddPortion(xSpellRet, 0, aDeletedRedlines);
|
2013-06-09 00:31:37 +02:00
|
|
|
// move the cursor to the end of the error string
|
2008-07-16 12:26:07 +00:00
|
|
|
*pCrsr->GetPoint() = *GetCurrX();
|
2013-06-09 00:31:37 +02:00
|
|
|
// and save the end of the error as new start position
|
2008-07-16 12:26:07 +00:00
|
|
|
aSaveStartPos = *GetCurrX();
|
2013-06-09 00:31:37 +02:00
|
|
|
// and the end of the sentence
|
2008-07-16 12:26:07 +00:00
|
|
|
*pCrsr->GetMark() = *GetEnd();
|
|
|
|
}
|
|
|
|
// if the end of the sentence has already been reached then break here
|
|
|
|
if(*GetCurrX() >= *GetEnd())
|
|
|
|
break;
|
2004-09-17 13:49:23 +00:00
|
|
|
}
|
2008-07-16 12:26:07 +00:00
|
|
|
while(xSpellRet.is());
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2013-06-09 00:31:37 +02:00
|
|
|
// go to the end of sentence as the grammar check returned it
|
2008-07-16 12:26:07 +00:00
|
|
|
// 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();
|
2004-09-17 13:49:23 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// the part between the last error and the end of the sentence has to be added
|
2007-09-27 07:46:02 +00:00
|
|
|
*pMySh->GetCrsr()->GetPoint() = *GetEnd();
|
2004-09-17 13:49:23 +00:00
|
|
|
if(*GetCurrX() < *GetEnd())
|
|
|
|
{
|
2008-07-16 12:26:07 +00:00
|
|
|
AddPortion(0, 0, aDeletedRedlines);
|
2004-09-17 13:49:23 +00:00
|
|
|
}
|
2013-06-09 00:31:37 +02:00
|
|
|
// set the shell cursor to the end of the sentence to prevent a visible selection
|
2004-09-17 13:49:23 +00:00
|
|
|
*pCrsr->GetMark() = *GetEnd();
|
2008-07-16 12:26:07 +00:00
|
|
|
if( !bIsGrammarCheck )
|
|
|
|
{
|
2013-06-09 00:31:37 +02:00
|
|
|
// set the current position to the end of the sentence
|
2008-07-16 12:26:07 +00:00
|
|
|
SetCurr( new SwPosition(*GetEnd()) );
|
|
|
|
}
|
2013-06-09 00:31:37 +02:00
|
|
|
// restore the 'global' end
|
2004-09-17 13:49:23 +00:00
|
|
|
SetEnd( new SwPosition(aSaveEndPos) );
|
|
|
|
rPortions = aLastPortions;
|
|
|
|
bRet = true;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2013-06-09 00:31:37 +02:00
|
|
|
// if no error could be found the selection has to be corrected - at least if it's not in the body
|
2007-09-27 07:46:02 +00:00
|
|
|
*pMySh->GetCrsr()->GetPoint() = *GetEnd();
|
|
|
|
pMySh->GetCrsr()->DeleteMark();
|
2004-09-17 13:49:23 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
return bRet;
|
|
|
|
}
|
2008-12-15 12:01:46 +00:00
|
|
|
|
|
|
|
void SwSpellIter::ToSentenceStart()
|
|
|
|
{
|
|
|
|
bBackToStartOfSentence = true;
|
|
|
|
}
|
2004-09-17 13:49:23 +00:00
|
|
|
|
2012-10-12 16:49:40 +02:00
|
|
|
static LanguageType lcl_GetLanguage(SwEditShell& rSh)
|
2004-09-17 13:49:23 +00:00
|
|
|
{
|
2011-01-17 15:06:54 +01:00
|
|
|
sal_uInt16 nScriptType = rSh.GetScriptType();
|
|
|
|
sal_uInt16 nLangWhichId = RES_CHRATR_LANGUAGE;
|
2004-09-17 13:49:23 +00:00
|
|
|
|
|
|
|
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);
|
2008-03-05 16:00:30 +00:00
|
|
|
rSh.GetCurAttr( aSet );
|
2004-09-17 13:49:23 +00:00
|
|
|
const SvxLanguageItem& rLang = static_cast<const SvxLanguageItem& >(aSet.Get(nLangWhichId));
|
|
|
|
return rLang.GetLanguage();
|
|
|
|
}
|
2013-06-09 00:31:37 +02:00
|
|
|
|
|
|
|
/// create a text portion at the given position
|
2005-03-01 14:24:11 +00:00
|
|
|
void SwSpellIter::CreatePortion(uno::Reference< XSpellAlternatives > xAlt,
|
2008-12-15 12:01:46 +00:00
|
|
|
linguistic2::ProofreadingResult* pGrammarResult,
|
2005-03-01 14:24:11 +00:00
|
|
|
bool bIsField, bool bIsHidden)
|
2004-09-17 13:49:23 +00:00
|
|
|
{
|
|
|
|
svx::SpellPortion aPortion;
|
2013-10-10 17:32:45 +02:00
|
|
|
OUString sText;
|
2004-09-17 13:49:23 +00:00
|
|
|
GetSh()->GetSelectedText( sText );
|
2013-10-10 17:32:45 +02:00
|
|
|
if(!sText.isEmpty())
|
2004-09-17 13:49:23 +00:00
|
|
|
{
|
2013-06-09 00:31:37 +02:00
|
|
|
// in case of redlined deletions the selection of an error is not the same as the _real_ word
|
2005-03-01 14:24:11 +00:00
|
|
|
if(xAlt.is())
|
|
|
|
aPortion.sText = xAlt->getWord();
|
2008-07-16 12:26:07 +00:00
|
|
|
else if(pGrammarResult)
|
|
|
|
{
|
|
|
|
aPortion.bIsGrammarError = true;
|
2008-12-15 12:01:46 +00:00
|
|
|
if(pGrammarResult->aErrors.getLength())
|
2008-07-16 12:26:07 +00:00
|
|
|
{
|
2008-12-15 12:01:46 +00:00
|
|
|
aPortion.aGrammarError = pGrammarResult->aErrors[0];
|
2008-07-16 12:26:07 +00:00
|
|
|
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 )
|
|
|
|
{
|
2012-04-06 15:05:52 +02:00
|
|
|
if ( pProperties->Name == "DialogTitle" )
|
2008-12-15 12:01:46 +00:00
|
|
|
{
|
|
|
|
pProperties->Value >>= aPortion.sDialogTitle;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
2008-07-16 12:26:07 +00:00
|
|
|
}
|
|
|
|
}
|
2005-03-01 14:24:11 +00:00
|
|
|
else
|
|
|
|
aPortion.sText = sText;
|
2004-09-17 13:49:23 +00:00
|
|
|
aPortion.eLanguage = lcl_GetLanguage(*GetSh());
|
|
|
|
aPortion.bIsField = bIsField;
|
2005-03-01 14:24:11 +00:00
|
|
|
aPortion.bIsHidden = bIsHidden;
|
2004-09-17 13:49:23 +00:00
|
|
|
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);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2005-03-01 14:24:11 +00:00
|
|
|
void SwSpellIter::AddPortion(uno::Reference< XSpellAlternatives > xAlt,
|
2008-12-15 12:01:46 +00:00
|
|
|
linguistic2::ProofreadingResult* pGrammarResult,
|
2005-03-01 14:24:11 +00:00
|
|
|
const SpellContentPositions& rDeletedRedlines)
|
2004-09-17 13:49:23 +00:00
|
|
|
{
|
2007-09-27 07:46:02 +00:00
|
|
|
SwEditShell *pMySh = GetSh();
|
2013-10-10 17:32:45 +02:00
|
|
|
OUString sText;
|
2007-09-27 07:46:02 +00:00
|
|
|
pMySh->GetSelectedText( sText );
|
2013-10-10 17:32:45 +02:00
|
|
|
if(!sText.isEmpty())
|
2004-09-17 13:49:23 +00:00
|
|
|
{
|
2008-07-16 12:26:07 +00:00
|
|
|
if(xAlt.is() || pGrammarResult != 0)
|
2004-09-17 13:49:23 +00:00
|
|
|
{
|
2008-07-16 12:26:07 +00:00
|
|
|
CreatePortion(xAlt, pGrammarResult, false, false);
|
2004-09-17 13:49:23 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
SwPaM *pCrsr = GetSh()->GetCrsr();
|
|
|
|
if ( *pCrsr->GetPoint() > *pCrsr->GetMark() )
|
|
|
|
pCrsr->Exchange();
|
2013-06-09 00:31:37 +02:00
|
|
|
// save the start and end positions
|
2004-09-17 13:49:23 +00:00
|
|
|
SwPosition aStart(*pCrsr->GetPoint());
|
|
|
|
SwPosition aEnd(*pCrsr->GetMark());
|
2013-06-09 00:31:37 +02:00
|
|
|
// iterate over the text to find changes in language
|
|
|
|
// set the mark equal to the point
|
2004-09-17 13:49:23 +00:00
|
|
|
*pCrsr->GetMark() = aStart;
|
2005-03-01 14:24:11 +00:00
|
|
|
SwTxtNode* pTxtNode = pCrsr->GetNode()->GetTxtNode();
|
2004-09-17 13:49:23 +00:00
|
|
|
LanguageType eStartLanguage = lcl_GetLanguage(*GetSh());
|
2005-03-01 14:24:11 +00:00
|
|
|
SpellContentPosition aNextRedline = lcl_FindNextDeletedRedline(
|
|
|
|
rDeletedRedlines, aStart.nContent.GetIndex() );
|
|
|
|
if( aNextRedline.nLeft == aStart.nContent.GetIndex() )
|
|
|
|
{
|
2013-06-09 00:31:37 +02:00
|
|
|
// select until the end of the current redline
|
2013-11-12 00:46:22 +01:00
|
|
|
const sal_Int32 nEnd = aEnd.nContent.GetIndex() < aNextRedline.nRight ?
|
2005-03-01 14:24:11 +00:00
|
|
|
aEnd.nContent.GetIndex() : aNextRedline.nRight;
|
|
|
|
pCrsr->GetPoint()->nContent.Assign( pTxtNode, nEnd );
|
2008-07-16 12:26:07 +00:00
|
|
|
CreatePortion(xAlt, pGrammarResult, false, true);
|
2005-03-01 14:24:11 +00:00
|
|
|
aStart = *pCrsr->End();
|
2013-06-09 00:31:37 +02:00
|
|
|
// search for next redline
|
2005-03-01 14:24:11 +00:00
|
|
|
aNextRedline = lcl_FindNextDeletedRedline(
|
|
|
|
rDeletedRedlines, aStart.nContent.GetIndex() );
|
|
|
|
}
|
|
|
|
while(*pCrsr->GetPoint() < aEnd)
|
2004-09-17 13:49:23 +00:00
|
|
|
{
|
2013-06-09 00:31:37 +02:00
|
|
|
// #125786 in table cell with fixed row height the cursor might not move forward
|
2005-11-04 15:00:25 +00:00
|
|
|
if(!GetSh()->Right(1, CRSR_SKIP_CELLS))
|
|
|
|
break;
|
|
|
|
|
2004-09-17 13:49:23 +00:00
|
|
|
bool bField = false;
|
2013-06-09 00:31:37 +02:00
|
|
|
// read the character at the current position to check if it's a field
|
2013-02-18 18:36:45 +01:00
|
|
|
sal_Unicode const cChar =
|
|
|
|
pTxtNode->GetTxt()[pCrsr->GetMark()->nContent.GetIndex()];
|
2004-09-17 13:49:23 +00:00
|
|
|
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() );
|
2011-01-17 15:06:54 +01:00
|
|
|
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()
|
2011-01-17 15:06:54 +01:00
|
|
|
: 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)
|
2004-09-17 13:49:23 +00:00
|
|
|
{
|
CWS-TOOLING: integrate CWS odfmetadata3
2009-09-11 Michael Stahl merge DEV300_m58
2009-09-07 Michael Stahl SwFmtFld::Modify(): do nothing on RES_OBJECTDYING
2009-08-27 Michael Stahl #i91565#, #i91566#: TextPortionEnumerationTest.java: add test document
2009-08-27 Michael Stahl #i91565#, #i91566#: add complex test: TextPortionEnumerationTest.java
2009-08-27 Michael Stahl CLiteral::initialize(): zero-length literals probably not an error
2009-08-27 Michael Stahl #i91565#, #i91566#: offapi: new InContentMetadata and MetadataField services
adapt TextPortion for InContentMetadata
2009-08-27 Michael Stahl #i91564#: xmloff: load/store xml:id and RDFa for text:bookmark(-start).
2009-08-27 Michael Stahl #i91564#: sw core: add support for xml:id at bookmarks:
sw::mark::Bookmark: derive from Metadatable.
SwHistoryBookmark, SaveBookmark: store a MetadatableUndo.
ndcopy.cxx: lcl_CopyBookmarks(): copy the xml:id.
SwXBookmark: derive from MetadatableMixin.
2009-08-27 Michael Stahl #i91565#, #i91566#: xmloff: refactor ruby import so nested meta(-field) works:
remove XMLRubyHint_Impl.
XMLImpRubyContext_Impl::~XMLImpRubyContext_Impl(): insert ruby directly.
2009-08-27 Michael Stahl #i91565#, #i91566#: xmloff: fix text:meta(-field) import/export:
new XMLTextParagraphExport::exportTextField() overload for XTextField.
CreateAndInsertMark(): set xml:id after insertion.
fix meta(-field) service names, bugs etc.
2009-08-27 Michael Stahl #i91565#, #i91566#: sw text formatting: paint background of meta(-field) body:
SwFont: add member m_nMetaCount.
txttypes.hxx: add POR_META.
atrstck.cxx: handle RES_TXTATR_META(FIELD).
itrform2.cxx: SwTxtFormatter::WhichTxtPor(): create new class SwMetaPortion.
2009-08-27 Michael Stahl #i91566#: sw text formatting: display meta-field prefix and suffix:
SwAttrIter::GetAttr(): replace with call to GetTxtAttrForCharAt().
SwTxtFormatter::NewExtraPortion(): handle meta-field prefix.
SwTxtFormatter: new member m_nHintEndIndex.
SwTxtFormatter::WhichFirstPortion(): call TryNewNoLengthPortion().
SwTxtFormatter::TryNewNoLengthPortion(): new; handle suffix of meta-field.
SwTxtFormatter::UnderFlow(): UGLY HACK: decrement m_nHintEndIndex.
SwFldPortion: add flag m_bNoLength: portion has zero length (for suffix).
2009-08-27 Michael Stahl #i91565#, #i91566#: extend text:meta(-field) uno wrapper with XText interface:
unoobj.hxx: new CursorType CURSOR_META.
unoobj2.cxx: refactor SwXText implementation to ensure that when the SwXText
belongs to a SwXMeta, content is always inserted inside the meta(-field).
unoobj.cxx: new SwXTextCursor::ForceIntoMeta(): cursor stays in meta(-field).
unometa.hxx: SwXMeta implements XText, forwarding to a member SwXMetaText.
DocInsertStringSplitCR(), SwX*::attachToRange(), SwX*::DeleteAndInsert():
use FORCEHINTEXPAND hack to ensure insert into the meta(-field) at the end.
2009-08-27 Michael Stahl #i91565#, #i91566#: add text:meta(-field) uno wrapper to sw:
fmtmeta.hxx, fmtatr2.cxx: new class sw::MetaField, new sw::MetaFieldManager.
doc.hxx, docnew.cxx: new SwDoc::GetMetaFieldManager().
unocoll.hxx,.cxx: new SW_SERVICE_FIELDTYPE_METAFIELD, SW_SERVICE_TYPE_META.
unomap.hxx,.cxx: new PROPERTY_MAP_METAFIELD.
unoprnms.hxx: new UNO_NAME_META.
unoport.hxx: new PORTION_META; add "InContentMetadata" prop to SwXTextPortion.
new unometa.hxx: new class SwXMeta and SwXMetaField.
unofield.cxx: SwXFieldEnumeration: include meta-fields.
unoportenum.cxx: handle RES_TXTATR_META(FIELD) by using a portion list stack.
unotext.cxx: SwXText::insertTextContent(): handle meta(-field) as attribute.
2009-08-27 Michael Stahl #i91565#, #i91566#: ndhints.cxx: remove sort number from SwTxtAttrNesting
2009-08-27 Michael Stahl #i91565#, #i91566#: add support for hints with end and CH_TXTATR to sw core:
doc.hxx, docedt.cxx: replace SwDoc::Delete(), DeleteAndJoin(), ReplaceRange()
with wrappers that split at left-overlapped end+CH_TXTATR hints.
txatbase.hxx: new member SwTxtAttr::m_bHasDummyChar.
ndtxt.hxx: rename SwTxtNode::GetTxtAttr() to GetTxtAttrForCharAt().
ndtxt.cxx: SwTxtNode::CopyText(): copy end+CH_TXTATR hints iff copy CH_TXTATR.
txtatr2.cxx, thints.cxx: SwTxtMeta gets a CH_TXTATR.
2009-08-27 Michael Stahl #i91565#, #i91566#: add text:meta(-field) to sw core:
txatbase.hxx: new member SwTxtAttr::m_bNesting.
hintids.hxx: new ids RES_TXTATR_META, RES_TXTATR_METAFIELD.
txtatr.hxx: new base class SwTxtAttrNesting.
new hint SwTxtMeta.
SwTxtRuby derives from SwTxtAttrNesting.
txtinet.hxx: SwTxtINetFmt derives from SwTxtAttrNesting.
new header fmtmeta.hxx: new pool item SwFmtMeta. new class sw::Meta.
ndhints.hxx, thints.cxx: new method SwpHints::TryInsertNesting().
thints.cxx: refactoring: BuildPortions() no longer handles Ruby/Hyperlink,
but TryInsertNesting(), which also handles meta(-field).
SwTxtNode::InsertItem(): check if the hint is actually inserted.
ndhints.cxx: sort nesting hints based on sort number.
ndtxt.cxx: lcl_CopyHint(): handle copy of meta/meta-field.
2009-08-27 Michael Stahl enable expanding hints with m_bLockExpandFlag set:
add new InsertFlag: INS_FORCEHINTEXPAND.
add new SetAttrMode: SETATTR_FORCEHINTEXPAND.
rename SwEditShell::Insert() to Insert2() because changed signature fails
to compile when SwWrtShell tries to overwrite these non-virtual members...
SwWrtShell::Insert() sets FOCEHINTEXPAND if range was selected/deleted.
adapt SwUndoInsert to store flags.
2009-08-27 Michael Stahl change formal parameters of item insertion methods to type SetAttrMode
2009-08-27 Michael Stahl fix incorrect resetting of text attributes in SwUndoInsSection, SwUndoInserts
2009-08-27 Michael Stahl clean up SwTxtNode::CutImpl() and lcl_CopyHint()
2009-08-27 Michael Stahl rename SwDoc::Copy() to CopyRange(), and _Copy() to CopyImpl()
2009-08-27 Michael Stahl rename SwNodes::Move() to MoveRange(), and remove unused parameter
2009-08-27 Michael Stahl rename SwDoc::Move() to MoveRange()/MoveNodeRange()
2009-08-27 Michael Stahl rename SwDoc::Insert() to InsertString(), and remove sal_Unicode variant
2009-08-27 Michael Stahl rename SwDoc::Insert() to InsertPoolItem()/InsertItemSet()/InsertSwSection()
2009-08-27 Michael Stahl rename SwDoc::Replace() to ReplaceRange()
2009-08-27 Michael Stahl remove SwDoc::Overwrite() sal_Unicode variant
2009-08-27 Michael Stahl split up SwDoc::DeleteAndJoin(): factor out DeleteAndJoinWithRedline()
2009-08-27 Michael Stahl rename overloaded SwDoc::Delete() to DeleteRange()/DeleteTOXMark()
2009-08-27 Michael Stahl rename SwTxtNode::Copy() to CopyText()
2009-08-27 Michael Stahl rename SwTxtNode::Cut() to CutText(), and _Cut() to CutImpl()
2009-08-27 Michael Stahl rename SwTxtNode::Delete() to DeleteAttribute()/DeleteAttributes()
2009-08-27 Michael Stahl rename SwTxtNode::Replace() to ReplaceText(), and remove the xub_Unicode variant
2009-08-27 Michael Stahl rename SwTxtNode::Erase() to EraseText()
2009-08-27 Michael Stahl rename SwTxtNode::Insert() to InsertText(), and remove the xub_Unicode variant
2009-08-27 Michael Stahl clean up SwTxtNode::Update()
2009-08-27 Michael Stahl remove SwTxtAttr::RemoveFromPool() and make destructor non-public,
to be invoked by new method SwTxtAttr::Destroy()
2009-08-27 Michael Stahl ensure that SwDoc::Insert() for item (set) returns success indicator:
replace SwRegHistory constructor with method InsertItems(), returning bool.
refactor InsAttr() so that it checks if InsertItems() succeeds.
2009-08-27 Michael Stahl move SwXTextPortionEnumeration from unoobj.hxx to unoport.hxx
2009-08-27 Michael Stahl add missing SolarMutex in SwXTextPortion methods
2009-08-27 Michael Stahl SwXTextPortion: new member m_xTextField (so the TextField property need not
be returned indirectly via SwUnoCursorHelper).
factor out function CreateSwXTextField().
2009-08-27 Michael Stahl SwXTextPortion: remove PORTION_CONTROL_CHAR and implementation of XTextField
2009-08-27 Michael Stahl remove obsolete hint SwTxtHardBlank and formats SwFmtHardBlank/SwFmtSoftHyph
2009-08-27 Michael Stahl clean up SwTxtAttr and friends:
remove many accessor methods for obsolete (due to autofmt) char format items.
remove unused flag SwTxtAttr::m_bDontMergeAttr.
MakeRedlineTxtAttr() now dedicated function, no longer calls MakeTxtAttr().
2009-08-27 Michael Stahl remove obsolete attribute SwTxt2Lines
2009-08-27 Michael Stahl SwXTextPortionEnumeration: finish refactoring CreatePortions
change ExportHints so it always returns a text portion for hint w/ CH_TXTATR.
remove special case for handling end of paragraph.
unfortunately had to refactor the fieldmarks export as well (got in the way).
2009-08-27 Michael Stahl SwXTextPortionEnumeration: refactor CreatePortions: frames export
extract function ExportFrames() from CreatePortions().
remove (un)dead code that calls evil MovePara(fnParaCurr, fnParaEnd)
2009-08-27 Michael Stahl clean up SwXParaFrameEnumeration
2009-08-27 Michael Stahl CollectFrameAtNode: replace SwDependArr with STL based FrameDependList_t
2009-08-27 Michael Stahl SwXTextPortionEnumeration: tweak refmark/toxmark export
so ExportHints returns the portion for point marks
2009-08-27 Michael Stahl clean up SwXTextPortionEnumeration:
prefix members, remove casts, replace SvWeirdArray with STL, etc.
make CreatePortions() method a function, and remove lots of members.
extract fieldmarks function from CreatePortions.
2009-08-27 Michael Stahl remove FOREACHUNOPAM_START/END macros
2009-08-27 Michael Stahl clean up SwXTextPortion:
prefix members, remove casts, etc.
remove SwXRubyPortion: replace it with another SwXTextPortion constructor
2009-08-27 Michael Stahl #i102541# SwXReferenceMark::InsertRefMark(): use flag SETATTR_DONTEXPAND
2009-08-27 Michael Stahl rename SwTxtNode::Insert to SwTxtNode::InsertHint, and
fix constness in SwTxtNode::InsertItem
2009-08-27 Michael Stahl turn SwTxtNode::MakeTxtAttr() methods into global functions in ndhints.hxx
2009-08-27 Michael Stahl remove obsolete sw/inc/bookmrk.hxx
2009-08-27 Michael Stahl pam.cxx: fix ComparePosition functions (returned wrong result in one case)
2009-08-27 Michael Stahl #i103613# only import RDF metadata on normal open of a document
2009-09-11 kz CWS-TOOLING: integrate CWS impress176
2009-09-08 20:18:24 +0200 sj r275957 : fixed warning (shadowed variable)
2009-09-08 18:02:05 +0200 cl r275948 : #i104315# added missing tab pages
2009-09-08 17:35:18 +0200 cl r275947 : #i104866# fixed angle import
2009-09-08 17:32:53 +0200 cl r275946 : #i104841# fixed angle import
2009-09-08 17:01:25 +0200 cl r275943 : #i103935# fixed the SID_EVENTCONFIG mess
2009-09-08 14:32:57 +0200 sj r275928 : #i104685# only comments
2009-09-07 12:37:36 +0200 sj r275886 : #i104683# fixed import of bold/italic attributes for normal text shapes
2009-09-04 15:07:46 +0200 sj r275808 : #104689# fixed bullet color problem
2009-09-03 15:25:07 +0200 sj r275753 : #160200# added vertical alignment of table cells
2009-09-11 kz CWS-TOOLING: integrate CWS dv14
2009-09-10 15:16:32 +0200 sg r276035 : #160513# updated wfs scheme to accept ports
2009-09-10 07:41:47 +0200 dv r276019 : #i104942# Better renaming algorithmen
2009-08-31 13:41:11 +0200 dv r275604 : #160505# Setting APP1PRODUCTNAME must not overwrite APP1PRODUCTDEF
2009-09-11 kz CWS-TOOLING: integrate CWS jl131
2009-09-02 16:42:40 +0200 jl r275720 : #i97896#
2009-08-31 13:01:53 +0200 jl r275599 : CWS-TOOLING: rebase CWS jl131 to trunk@275331 (milestone: DEV300:m56)
2009-07-31 14:35:30 +0200 jl r274531 : CWS-TOOLING: rebase CWS jl131 to trunk@274203 (milestone: DEV300:m53)
2009-07-23 14:20:32 +0200 jl r274272 : #i79839# better error text when trying to modify shared layer without having write permission, eg. unopkg add --shared, unopkg remove --shared, unopkg reinstall --shared
2009-07-22 16:38:02 +0200 jl r274252 : #i97896# localize error message for lock file
2009-07-22 16:37:22 +0200 jl r274251 : #i80462# unprecise wording in updatedialog
2009-07-22 16:36:06 +0200 jl r274250 : #i97896# localize error message for lock file
2009-07-22 16:35:20 +0200 jl r274249 : #i97896# localize error message for lock file
2009-07-22 15:07:30 +0200 jl r274242 : #i98873# minimum java version is 1.5 since OOo 3.0
2009-09-11 kz CWS-TOOLING: integrate CWS changehc
2009-08-31 19:38:50 +0200 pl r275633 : remove dbug printf
2009-08-31 17:41:50 +0200 pl r275623 : CWS-TOOLING: rebase CWS changehc to trunk@275331 (milestone: DEV300:m56)
2009-07-15 19:45:46 +0200 pl r274028 : #i35482# use HC flag to decide high contrast mode
2009-07-15 17:40:52 +0200 pl r274020 : #i35482# use HC flag to decide high contrast mode
2009-07-15 17:39:50 +0200 pl r274019 : #i35482# update autohc correctly in MergeSystemSettings
2009-07-15 17:38:57 +0200 pl r274018 : #i35482# update autohc correctly in MergeSystemSettings
2009-09-11 kz CWS-TOOLING: integrate CWS notes10
2009-08-24 07:25:57 +0200 mod r275287 : 2009-07-26 02:38:32 +0200 mod r274343 : #i#i103645#
2009-07-26 02:01:53 +0200 mod r274342 : #i103645#
2009-07-26 01:52:42 +0200 mod r274341 : #i103490#
2009-07-22 08:31:48 +0200 mod r274215 : #i103373#
2009-07-15 00:55:11 +0200 mod r273987 : #i101419#
2009-07-14 07:07:55 +0200 mod r273956 : #i101419#
2009-07-14 07:07:43 +0200 mod r273955 : #i101419#
2009-07-14 07:02:10 +0200 mod r273954 : changes from notes9
2009-07-14 06:14:25 +0200 mod r273953 : #i103476#
2009-09-11 kz CWS-TOOLING: integrate CWS ab70
2009-09-10 15:12:54 +0200 jsk r276034 : #i85434# - mandatory automatic update test
2009-09-10 15:11:06 +0200 jsk r276033 : #i85434# - mandatory automatic update test
2009-09-02 09:49:24 +0200 ab r275698 : #i85434# Dialog Import
2009-09-11 kz CWS-TOOLING: integrate CWS hb32bugs02
2009-09-02 Henning Brinkmann #i102420# revert changes
2009-08-26 Henning Brinkmann merged DEV300_m56
2009-08-19 Henning Brinkmann merged DEV300_m55
2009-08-14 Henning Brinkmann merged changes from wntmsci12
2009-08-12 Henning Brinkmann Implemented NoSpaceEdit constructor and destructor in .cxx to allow compile with debug on wntmsci12.
2009-08-12 Henning Brinkmann Added some SW_DLLPUBLIC to make compilable on wntmsci12.
2009-08-11 Henning Brinkmann #i102420# dbg_out: surround output for SwNodes with <nodes-array>.
2009-08-10 Henning Brinkmann #i102420# rewritten debug output for SwNodes.
2009-08-07 Henning Brinkmann #i102420# debug _MoveNodes: output the destination, too. Break after two iterations.
2009-08-07 Henning Brinkmann #i102420# _MoveNodes: Additionally check if destination index is inside source => false
Check if current range was already handled => loop
Debug output current range
2009-08-06 Henning Brinkmann merged DEV300_m54
2009-08-06 Henning Brinkmann added master fix
2009-08-06 Henning Brinkmann debug output for SwNodeRange
2009-08-04 Henning Brinkmann #i102844# robustness: check for NULL pointer to prevent crash
2009-08-03 Henning Brinkmann #i103475# applied patch and verified
2009-08-03 Henning Brinkmann Removed code preventing build of sw with DEBUG.
2009-09-11 convert-repo update tags
2009-09-10 kz CWS-TOOLING: integrate CWS os2port06dev300
2009-09-05 22:49:00 +0200 ydario r275858 : #i99588# applied os2port06 diff to DEV300 tree.
2009-09-10 kz CWS-TOOLING: integrate CWS mingwport23
2009-08-29 07:07:53 +0200 tono r275555 : i#104522: mingw port graphite
2009-08-29 07:07:26 +0200 tono r275554 : i#104522: mingw port printf format fix
2009-09-10 kz CWS-TOOLING: integrate CWS mh232
2009-08-26 03:52:57 +0200 mh r275385 : #i102182# FreeBSD patch
2009-08-26 03:43:20 +0200 mh r275384 : #i101333# patch for FreeBSD
2009-08-26 03:11:20 +0200 mh r275383 : #i39230
2009-08-26 03:07:51 +0200 mh r275382 : #i39230# more space for initials field
2009-08-26 02:41:19 +0200 mh r275380 : #i39230# use vos::osecurity for reading the user name
2009-08-18 22:06:00 +0200 mh r275130 : #i104243#, line ending problem with newer perl
2009-08-18 21:53:21 +0200 mh r275129 : #i39230# read initials via getpwnam
2009-08-18 21:34:05 +0200 mh r275128 : enable CAIROCANVAS for Linux and Mac, #i88613#
2009-08-17 18:02:59 +0200 mh r275067 : #i95498# make compile with gcc3
2009-09-10 kz CWS-TOOLING: integrate CWS tkr24
2009-09-07 14:31:06 +0200 is r275898 : #160081# adding NO_LICENSE_INTO_COPYRIGHT
2009-09-10 releng #i10000# change KeyMapping to SingletonRef<framework::KeyMapping>
2009-09-11 convert-repo update tags
2009-09-10 kz CWS-TOOLING: integrate CWS os2port06dev300
2009-09-05 22:49:00 +0200 ydario r275858 : #i99588# applied os2port06 diff to DEV300 tree.
2009-09-10 kz CWS-TOOLING: integrate CWS mingwport23
2009-08-29 07:07:53 +0200 tono r275555 : i#104522: mingw port graphite
2009-08-29 07:07:26 +0200 tono r275554 : i#104522: mingw port printf format fix
2009-09-10 kz CWS-TOOLING: integrate CWS mh232
2009-08-26 03:52:57 +0200 mh r275385 : #i102182# FreeBSD patch
2009-08-26 03:43:20 +0200 mh r275384 : #i101333# patch for FreeBSD
2009-08-26 03:11:20 +0200 mh r275383 : #i39230
2009-08-26 03:07:51 +0200 mh r275382 : #i39230# more space for initials field
2009-08-26 02:41:19 +0200 mh r275380 : #i39230# use vos::osecurity for reading the user name
2009-08-18 22:06:00 +0200 mh r275130 : #i104243#, line ending problem with newer perl
2009-08-18 21:53:21 +0200 mh r275129 : #i39230# read initials via getpwnam
2009-08-18 21:34:05 +0200 mh r275128 : enable CAIROCANVAS for Linux and Mac, #i88613#
2009-08-17 18:02:59 +0200 mh r275067 : #i95498# make compile with gcc3
2009-09-10 kz CWS-TOOLING: integrate CWS tkr24
2009-09-07 14:31:06 +0200 is r275898 : #160081# adding NO_LICENSE_INTO_COPYRIGHT
2009-09-10 releng #i10000# change KeyMapping to SingletonRef<framework::KeyMapping>
2009-09-11 14:29:45 +00:00
|
|
|
case RES_TXTATR_FIELD:
|
|
|
|
case RES_TXTATR_FTN:
|
|
|
|
case RES_TXTATR_FLYCNT:
|
|
|
|
bField = true;
|
|
|
|
break;
|
2004-09-17 13:49:23 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
LanguageType eCurLanguage = lcl_GetLanguage(*GetSh());
|
2005-03-01 14:24:11 +00:00
|
|
|
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)
|
2004-09-17 13:49:23 +00:00
|
|
|
{
|
|
|
|
eStartLanguage = eCurLanguage;
|
2013-06-09 00:31:37 +02:00
|
|
|
// go one step back - the cursor currently selects the first character
|
|
|
|
// with a different language
|
|
|
|
// in the case of redlining it's different
|
2005-03-01 14:24:11 +00:00
|
|
|
if(eCurLanguage != eStartLanguage || bField)
|
|
|
|
*pCrsr->GetPoint() = *pCrsr->GetMark();
|
2013-06-09 00:31:37 +02:00
|
|
|
// set to the last start
|
2004-09-17 13:49:23 +00:00
|
|
|
*pCrsr->GetMark() = aStart;
|
2013-06-09 00:31:37 +02:00
|
|
|
// create portion should only be called if a selection exists
|
|
|
|
// there's no selection if there's a field at the beginning
|
2004-09-17 13:49:23 +00:00
|
|
|
if(*pCrsr->Start() != *pCrsr->End())
|
2008-07-16 12:26:07 +00:00
|
|
|
CreatePortion(xAlt, pGrammarResult, false, false);
|
2004-09-17 13:49:23 +00:00
|
|
|
aStart = *pCrsr->End();
|
2013-06-09 00:31:37 +02:00
|
|
|
// now export the field - if there is any
|
2004-09-17 13:49:23 +00:00
|
|
|
if(bField)
|
|
|
|
{
|
|
|
|
*pCrsr->GetMark() = *pCrsr->GetPoint();
|
|
|
|
GetSh()->Right(1, CRSR_SKIP_CELLS);
|
2008-07-16 12:26:07 +00:00
|
|
|
CreatePortion(xAlt, pGrammarResult, true, false);
|
2004-09-17 13:49:23 +00:00
|
|
|
aStart = *pCrsr->End();
|
|
|
|
}
|
|
|
|
}
|
2005-03-01 14:24:11 +00:00
|
|
|
// if a redline start then create a portion for it
|
|
|
|
if(bRedline)
|
|
|
|
{
|
|
|
|
*pCrsr->GetMark() = *pCrsr->GetPoint();
|
2013-06-09 00:31:37 +02:00
|
|
|
// select until the end of the current redline
|
2013-11-12 00:46:22 +01:00
|
|
|
const sal_Int32 nEnd = aEnd.nContent.GetIndex() < aNextRedline.nRight ?
|
2005-03-01 14:24:11 +00:00
|
|
|
aEnd.nContent.GetIndex() : aNextRedline.nRight;
|
|
|
|
pCrsr->GetPoint()->nContent.Assign( pTxtNode, nEnd );
|
2008-07-16 12:26:07 +00:00
|
|
|
CreatePortion(xAlt, pGrammarResult, false, true);
|
2005-03-01 14:24:11 +00:00
|
|
|
aStart = *pCrsr->End();
|
2013-06-09 00:31:37 +02:00
|
|
|
// search for next redline
|
2005-03-01 14:24:11 +00:00
|
|
|
aNextRedline = lcl_FindNextDeletedRedline(
|
|
|
|
rDeletedRedlines, aStart.nContent.GetIndex() );
|
|
|
|
}
|
2004-09-17 13:49:23 +00:00
|
|
|
*pCrsr->GetMark() = *pCrsr->GetPoint();
|
|
|
|
}
|
|
|
|
pCrsr->SetMark();
|
|
|
|
*pCrsr->GetMark() = aStart;
|
2008-07-16 12:26:07 +00:00
|
|
|
CreatePortion(xAlt, pGrammarResult, false, false);
|
2004-09-17 13:49:23 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
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;
|
2013-12-03 11:34:12 +02:00
|
|
|
sal_Int32 nStart = rErrorPosition.Start()->nContent.GetIndex();
|
2013-12-08 14:08:22 +01:00
|
|
|
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 );
|
2010-12-17 09:02:23 +01:00
|
|
|
SwTxtFrm::repaintTextFrames( *pNode );
|
2008-12-15 12:01:46 +00:00
|
|
|
}
|
|
|
|
++aIdx;
|
|
|
|
nStart = 0;
|
|
|
|
}
|
|
|
|
}
|
2000-09-18 23:08:29 +00:00
|
|
|
|
2010-10-14 08:30:41 +02:00
|
|
|
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|