diff options
author | Bjoern Michaelsen <bjoern.michaelsen@canonical.com> | 2011-08-23 15:23:52 +0200 |
---|---|---|
committer | Bjoern Michaelsen <bjoern.michaelsen@canonical.com> | 2011-08-23 15:23:52 +0200 |
commit | ed41260b25bbb72c3afc173c3950e4db6586aae5 (patch) | |
tree | a1e1f6e9e7c7152281500b4f2885db86de114299 /sw/source/core/txtnode/txtedt.cxx | |
parent | cce335a211fc31158cc2c257c03fa602dd89e19f (diff) |
recreated tag OOO_BUILD_3_2_98_1 which had these commits:
commit f4e134e37cd1c6bcdf821aea38aa549c9ea1c46b (tag: refs/tags/OOO_BUILD_3_2_98_1)
Author: Petr Mladek <pmladek@walk.suse.cz>
Date: Wed Sep 15 19:03:29 2010 +0200
Release ooo-build-3.2.98.1, tag OOO_BUILD_3_2_98_1 (3.3-alpha1)
commit 11ab1028c5e354ac40ee58ace0dc84989eae8a27
Author: Jiao Jianhua <jjiao@novell.com>
Date: Tue Sep 14 17:14:11 2010 +0200
sw-default-cjk-fontsize.diff: default CJK font fontsize as 10.5pt
i#72010
sw/source/ui/config/fontcfg.cxx | 5 ++++-
sw/source/ui/inc/fontcfg.hxx | 1 +
2 files changed, 5 insertions(+), 1 deletions(-)
commit 216f84e4b0933612276690a7f69f264e9ded5c71
Author: Florian Reuter <freuter@novell.com>
Date: Tue Sep 14 17:11:44 2010 +0200
sw-graphic-save-problem.diff:
n240770
sw/source/core/graphic/ndgrf.cxx | 4 ++++
1 files changed, 4 insertions(+), 0 deletions(-)
commit 9ec22325aba338803a96a373db97f3f4e2bc2b12
Author: Michel Loiseleur <mloiseleur@linagora.com>
Date: Tue Sep 14 17:04:28 2010 +0200
sw-html-insert-unknown-tags.diff: paste html text between 2 unknown tags
i#59064
sw/source/filter/html/swhtml.cxx | 16 ++++++++++++++++
1 files changed, 16 insertions(+), 0 deletions(-)
commit 4b3a488ecb4e6810735825973bb9433249a19fb6
Author: Cédric Bosdonnat <cedricbosdo@openoffice.org>
Date: Tue Sep 14 16:54:36 2010 +0200
sw-paste-table.diff: Refresh the cell formatting after pasting in it
n#564789
sw/source/filter/basflt/shellio.cxx | 10 ++++++++++
1 files changed, 10 insertions(+), 0 deletions(-)
commit d4ad757a11eb662f853ea78fefd6d11ea1df2119
Author: Fong Lin <pflin@novell.com>
Date: Tue Sep 14 16:42:39 2010 +0200
sw-changes-format-fix.diff: show insertion change first
n#545815
sw/source/core/doc/docredln.cxx | 21 +++++++++++++++++++++
1 files changed, 21 insertions(+), 0 deletions(-)
commit 33370870cc133b7cb7f470f752526cdd4a4339ab
Author: Fong Lin <pflin@novell.com>
Date: Tue Sep 14 16:39:57 2010 +0200
sw-ww8-import-list-fix.diff:fix bullet indent issue
n#547308
sw/source/filter/ww8/ww8par6.cxx | 23 +++++++++++++++++++++++
1 files changed, 23 insertions(+), 0 deletions(-)
commit 0589e7f8eb08119cee8ff1a186bfbb887d3838e4
Author: Fong Lin <pflin@novell.com>
Date: Tue Sep 14 16:35:20 2010 +0200
sw-ww8-textframe-background-fix.diff
n#547308
sw/source/filter/ww8/ww8graf.cxx | 5 +++--
1 files changed, 3 insertions(+), 2 deletions(-)
commit b7551ace7e57ba3a4dbacf5d8906000600a43467
Author: Amelia Wang <amwang@novell.com>
Date: Tue Sep 14 16:23:16 2010 +0200
sw-insert-pagebreak-in-numbered-paragraph.diff
n#396648
sw/inc/doc.hxx | 1 +
sw/source/core/docnode/ndtbl.cxx | 43 ++++++++++++++++++++++++++++++++++++++
sw/source/ui/wrtsh/wrtsh1.cxx | 2 +
3 files changed, 46 insertions(+), 0 deletions(-)
commit edbd32ded9f6dddb75ebb57d03a10ac10d0fa107
Author: Amelia Wang <amwang@novell.com>
Date: Tue Sep 14 16:20:45 2010 +0200
sw-outline-numbering-broken-fix.diff: outline numbering fix in master docs
i#96092, n#445536
sw/source/core/docnode/ndcopy.cxx | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
commit 7dd2e230f9de2676be07d094a837a0167e275194
Author: Florian Reuter <freuter@novell.com>
Date: Tue Sep 14 16:12:59 2010 +0200
sw-import-html-controls.diff:
n#485609
sw/source/filter/ww8/ww8par.hxx | 2 ++
sw/source/filter/ww8/ww8par3.cxx | 8 ++++++++
sw/source/filter/ww8/ww8par5.cxx | 2 +-
3 files changed, 11 insertions(+), 1 deletions(-)
commit 8208802eed76b29302c132dd0a0608cc71dd396f
Author: Cédric Bosdonnat <cedricbosdo@openoffice.org>
Date: Tue Sep 14 16:00:07 2010 +0200
field-patch-lock.diff: enhanced fields lock fix
sw/source/core/crsr/pam.cxx | 28 +++++++++++++++++-----------
1 files changed, 17 insertions(+), 11 deletions(-)
commit 7bd9bc8377047629a69450bf7d4c7dee67af517b
Author: Cédric Bosdonnat <cedricbosdo@openoffice.org>
Date: Tue Sep 14 15:58:16 2010 +0200
field-patch-uno-fix.diff: enhanced fields UNO fix
sw/source/core/unocore/unocoll.cxx | 18 +++++++++---------
1 files changed, 9 insertions(+), 9 deletions(-)
commit d19c7c96ee03fccc41fb5a74128304bd432eac81
Author: Florian Reuter <freuter@novell.com>
Date: Tue Sep 14 15:00:33 2010 +0200
sw-table-join-fix-i99267.diff:
n#417814
sw/source/core/layout/tabfrm.cxx | 5 +++++
1 files changed, 5 insertions(+), 0 deletions(-)
commit 47472e8e70c1ae3dc55a5b00ef69eaa85f651a7f
Author: Florian Reuter <freuter@novell.com>
Date: Tue Sep 14 14:40:15 2010 +0200
sw-collapse-empty-table-par-like-html.diff:
n#376690
sw/inc/IDocumentSettingAccess.hxx | 1 +
sw/inc/doc.hxx | 1 +
sw/inc/ndtxt.hxx | 2 +
sw/source/core/crsr/callnk.cxx | 50 ++++++++++++++++++++++++++++++
sw/source/core/doc/doc.cxx | 4 ++
sw/source/core/doc/docnew.cxx | 1 +
sw/source/core/inc/frame.hxx | 4 ++
sw/source/core/layout/calcmove.cxx | 43 +++++++++++++++++++++++++
sw/source/core/layout/findfrm.cxx | 9 +++++
sw/source/core/text/frmpaint.cxx | 34 +++++++++++---------
sw/source/core/text/porrst.cxx | 16 +++++++++
sw/source/filter/ww8/ww8par.cxx | 1 +
sw/source/filter/ww8/ww8par2.cxx | 14 --------
sw/source/ui/uno/SwXDocumentSettings.cxx | 16 +++++++++-
14 files changed, 166 insertions(+), 30 deletions(-)
commit 440bab6daea191ddf18b019fb88600b82e11a0ed
Author: Florian Reuter <freuter@novell.com>
Date: Tue Sep 14 14:36:01 2010 +0200
sw-invert-border-spacing.diff:
n#391591
sw/inc/IDocumentSettingAccess.hxx | 1 +
sw/inc/doc.hxx | 1 +
sw/source/core/doc/doc.cxx | 4 ++++
sw/source/core/doc/docnew.cxx | 1 +
sw/source/core/layout/frmtool.cxx | 9 +++++++--
sw/source/core/layout/paintfrm.cxx | 2 +-
sw/source/filter/rtf/swparrtf.cxx | 2 +-
sw/source/filter/ww8/ww8par.cxx | 2 ++
sw/source/filter/ww8/ww8par6.cxx | 17 +++++++++++++----
sw/source/ui/uno/SwXDocumentSettings.cxx | 18 +++++++++++++++---
10 files changed, 46 insertions(+), 11 deletions(-)
commit 70597695b23b5c45dfc735a7afd175f034428195
Author: Florian Reuter <freuter@novell.com>
Date: Tue Sep 14 14:32:01 2010 +0200
sw-allow-negative-spacing.diff: correctly display linespacing < 100%
n#364534
sw/source/core/text/itrform2.cxx | 22 ++++++++++++++++++++++
1 files changed, 22 insertions(+), 0 deletions(-)
commit 998c642599c9196e2249fe35cf1450711fdd5d75
Author: Florian Reuter <freuter@novell.com>
Date: Tue Sep 14 14:28:15 2010 +0200
sw-section-import-fix.diff: Additional paragraph imported from ww8
n#364533
sw/source/filter/ww8/ww8par.cxx | 7 ++++---
1 files changed, 4 insertions(+), 3 deletions(-)
commit 70561fdb1c47bc0bcfdbb97ffed28fe13ab556f8
Author: Cédric Bosdonnat <cedricbosdo@openoffice.org>
Date: Tue Sep 14 14:16:21 2010 +0200
g++44-debug.diff: Fixed some imports for debug more
sw/source/core/text/inftxt.cxx | 4 ++++
sw/source/filter/ww8/WW8Sttbf.cxx | 4 ++++
sw/source/filter/ww8/wrtww8gr.cxx | 4 ++++
3 files changed, 12 insertions(+), 0 deletions(-)
commit 10c10ffa04a952c81e0a85e0606b46e2433705c3
Author: Thorsten Behrens <tbehrens@novell.com>
Date: Tue Sep 14 13:12:33 2010 +0200
win32-vs2005-compat.diff: Fix build with Visual Studio 2005
sw/source/filter/ww8/wrtw8nds.cxx | 6 +++---
1 files changed, 3 insertions(+), 3 deletions(-)
commit 985b180a2fae4ffeaac83ead0a71e1e128db0f79
Author: Octavio Alvarez <alvarezp@alvarezp.ods.org>
Date: Mon Sep 13 17:30:41 2010 +0200
sw-preserve-char-style-on-reset-format.diff:Perserve character style on links
i#47893
sw/source/ui/shells/textsh1.cxx | 2 --
1 files changed, 0 insertions(+), 2 deletions(-)
commit 46c042512344d9e714ea716efc8f707ede5e179b
Author: Octavio Alvarez <alvarezp@alvarezp.ods.org>
Date: Mon Sep 13 17:26:19 2010 +0200
sw-show-Remove-Hyperlink-even-with-selection.diff:
sw/source/ui/shells/textsh1.cxx | 15 ++++++++++++++-
1 files changed, 14 insertions(+), 1 deletions(-)
commit 1ccbb5d782056eeaf0c50333eed49ded73acfc5f
Author: Cédric Bosdonnat <cedricbosdo@openoffice.org>
Date: Mon Sep 13 17:15:50 2010 +0200
sw-rtf-num-fix.diff:Fixes for RTF numbering export
n#569266
sw/source/filter/rtf/rtfatr.cxx | 12 +++---
sw/source/filter/rtf/rtfnum.cxx | 78 ++++++++++++--------------------------
2 files changed, 31 insertions(+), 59 deletions(-)
commit 934cea09a95d7d638d09f881629579c568a30621
Author: Amelia Wang <amwang@novell.com>
Date: Mon Sep 13 14:46:36 2010 +0200
cjk-character-units-in-pggrid-fix.diff: add a new character unit
sw/source/ui/inc/pggrid.hxx | 1 +
sw/source/ui/misc/pggrid.cxx | 42 ++++++++++++++++++++++++++----------------
2 files changed, 27 insertions(+), 16 deletions(-)
commit dae07c66db3014b7f0eefada5e4ff8af8556e768
Author: Amelia Wang <amwang@novell.com>
Date: Mon Sep 13 14:45:00 2010 +0200
cjk-character-units-fix-376788.diff: add a new character unit
i#376788
sw/source/ui/app/swmodul1.cxx | 14 ++++++++++----
sw/source/ui/config/optload.cxx | 8 +++++---
sw/source/ui/misc/pggrid.cxx | 4 ++--
sw/source/ui/uiview/view.cxx | 36 ++++++++++++++++++++++++++++++------
4 files changed, 47 insertions(+), 15 deletions(-)
commit 6321ca557a2a188a3a3f8f6eeb2881f8e7eacce8
Author: Amelia Wang <amwang@novell.com>
Date: Mon Sep 13 14:43:46 2010 +0200
cjk-character-units-fix.diff: add a new unit 'character unit'
i#356101
sw/source/ui/app/appopt.cxx | 1 +
sw/source/ui/app/swmodul1.cxx | 6 ++++--
sw/source/ui/config/optload.cxx | 3 +++
sw/source/ui/config/optload.src | 3 +--
sw/source/ui/config/usrpref.cxx | 3 ++-
sw/source/ui/misc/pggrid.cxx | 6 +++---
sw/source/ui/uiview/view.cxx | 6 ++++--
7 files changed, 18 insertions(+), 10 deletions(-)
commit 723b3fc153061b39604a032d578409d7f22d708f
Author: Amelia Wang <amwang@novell.com>
Date: Mon Sep 13 14:42:44 2010 +0200
cjk-character-units-rulers-sync-with-pggrid-fix.diff:
sw/source/ui/inc/pggrid.hxx | 2 ++
sw/source/ui/misc/pggrid.cxx | 24 ++++++++++++++++++++----
2 files changed, 22 insertions(+), 4 deletions(-)
commit baf4316376191dce3a3d070a07e745e0286b7bac
Author: Amelia Wang <amwang@novell.com>
Date: Mon Sep 13 14:40:57 2010 +0200
cjk-character-units-ui.diff: add a new unit 'character unit'
sw/source/ui/config/optload.cxx | 6 ++++++
sw/source/ui/config/optload.hrc | 1 +
sw/source/ui/config/optload.src | 12 ++++++++++++
sw/source/ui/config/optpage.cxx | 23 +++++++++++++++++------
sw/source/ui/inc/optload.hxx | 1 +
sw/source/ui/inc/pggrid.hxx | 2 ++
sw/source/ui/misc/pggrid.cxx | 3 +++
sw/source/ui/misc/pggrid.hrc | 2 ++
sw/source/ui/misc/pggrid.src | 12 ++++++++++++
9 files changed, 56 insertions(+), 6 deletions(-)
commit 4cd64c0c68b4c81406d0075ac9d846014538840b
Author: Amelia Wang <amwang@novell.com>
Date: Mon Sep 13 14:37:51 2010 +0200
cjk-character-units-imp.diff: add a new unit 'character unit'
sw/inc/swmodule.hxx | 2 +
sw/source/ui/app/appopt.cxx | 10 +++++++
sw/source/ui/app/swmodul1.cxx | 57 +++++++++++++++++++++++++++++++++++++++
sw/source/ui/config/optload.cxx | 17 +++++++++++
sw/source/ui/config/usrpref.cxx | 11 +++++---
sw/source/ui/inc/pggrid.hxx | 2 +-
sw/source/ui/inc/uitool.hxx | 3 ++
sw/source/ui/inc/usrpref.hxx | 12 ++++++++
sw/source/ui/misc/pggrid.cxx | 32 ++++++++++++++++++---
sw/source/ui/shells/textsh1.cxx | 4 +++
sw/source/ui/uiview/view.cxx | 17 ++++++++++-
sw/source/ui/utlui/uitool.cxx | 13 +++++++++
12 files changed, 168 insertions(+), 12 deletions(-)
commit 825b1706ab0a71d86812cbb95ac056e78f6a5864
Author: Jiao Jianhua <jjiao@novell.com>
Date: Mon Sep 13 14:07:35 2010 +0200
plus-minus-sw-navigator2.diff: Folding for each heading in Navigator
i#64886, n#129410i
sw/source/ui/inc/conttree.hxx | 5 +++
sw/source/ui/utlui/content.cxx | 74 +++++++++++++++++++++++++++++++++++++--
2 files changed, 75 insertions(+), 4 deletions(-)
commit c2b6b1ab7a949fb80fd98f506486d45a1166fbc5
Author: Jiao Jianhua <jjiao@novell.com>
Date: Mon Sep 13 14:06:16 2010 +0200
plus-minus-sw-navigator.diff: folding for each heading in Navigator
i#64886, n#129410
sw/source/ui/utlui/content.cxx | 134 +++++++++++++++++++++++++++++++---------
1 files changed, 105 insertions(+), 29 deletions(-)
commit 290f7aba51f626e259764487fec8795ef6b4043a
Merge: d3ae4c6 4937fcb
Author: Jan Holesovsky <kendy@suse.cz>
Date: Wed Sep 8 11:34:21 2010 +0200
Merge commit 'ooo/OOO330_m7'
commit d3ae4c683dda23722661cad8b5992586d2883bd0
Merge: e0b0ca3 17b62cb
Author: Jan Holesovsky <kendy@suse.cz>
Date: Tue Sep 7 09:33:10 2010 +0200
Merge commit 'ooo/OOO330_m6'
commit 4937fcb1c4fa15194c01a79c57523d9a9333c710 (tag: refs/tags/ooo/OOO330_m7)
Merge: 17b62cb 3274d37
Author: Kurt Zenker <kz@openoffice.org>
Date: Fri Sep 3 14:39:55 2010 +0200
CWS-TOOLING: integrate CWS fs33a
commit 17b62cb5acad25dc82a95a40d545e6af6a185f55 (tag: refs/tags/ooo/OOO330_m6)
Author: obo <obo@openoffice.org>
Date: Fri Aug 27 13:02:34 2010 +0200
masterfix OOO330: #i10000# new exception file unovwr.cxx
sw/source/core/undo/makefile.mk | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)
commit a3019ec68acb22c8f590ee104fd6e7aad20c4778
Merge: aa24f45 631d42d
Author: Ivo Hinkelmann <ihi@openoffice.org>
Date: Wed Aug 25 14:19:19 2010 +0200
CWS-TOOLING: integrate CWS sw33bf08
commit 631d42da043d690b931e3750176a3a295b376c7e
Author: Thomas Lange [tl] <tl@openoffice.org>
Date: Tue Aug 17 16:46:36 2010 +0200
cws sw33bf08: #i113584#, #i113587# transliteration fixed
sw/inc/undobj.hxx | 6 +-
sw/source/core/doc/docedt.cxx | 33 +++--
sw/source/core/txtnode/txtedt.cxx | 271 ++++++++++++++++++++++++++++++++-----
sw/source/core/undo/unovwr.cxx | 136 +++++++++----------
4 files changed, 326 insertions(+), 120 deletions(-)
commit 3274d37826fc2613aa5061a985d1aab476e3a6fc
Author: Frank Schoenheit [fs] <frank.schoenheit@oracle.com>
Date: Fri Aug 13 23:34:21 2010 +0200
fs33a: make compile in non-pro build (removed seemingly dead assertion)
sw/source/ui/lingu/olmenu.cxx | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
commit 013feef7fc5add0b3468b2c3d11bea8d4f830174
Merge: db3cc71 aa24f45
Author: Frank Schoenheit [fs] <frank.schoenheit@oracle.com>
Date: Fri Aug 13 12:04:35 2010 +0200
fs33a: merge after pulling OOO330.m4's change sets
commit db3cc711f90a781bc8cd82a90d872f6e281ae205
Merge: e1a0f88 80200b9
Author: Frank Schoenheit [fs] <frank.schoenheit@oracle.com>
Date: Tue Aug 10 14:53:21 2010 +0200
merging in latest changes from OOO330(m3)
Notes
Notes:
split repo tag: writer_OOO_BUILD_3_2_98_1
Diffstat (limited to 'sw/source/core/txtnode/txtedt.cxx')
-rw-r--r-- | sw/source/core/txtnode/txtedt.cxx | 307 |
1 files changed, 256 insertions, 51 deletions
diff --git a/sw/source/core/txtnode/txtedt.cxx b/sw/source/core/txtnode/txtedt.cxx index 944eb70b2c3d..19af8908faca 100644 --- a/sw/source/core/txtnode/txtedt.cxx +++ b/sw/source/core/txtnode/txtedt.cxx @@ -1,7 +1,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -31,11 +31,12 @@ // So kann man die Linguistik-Statistik ( (Tmp-Path)\swlingu.stk ) aktivieren: //#define LINGU_STATISTIK #ifdef LINGU_STATISTIK - #include <stdio.h> // in SwLinguStatistik::DTOR - #include <stdlib.h> // getenv() - #include <time.h> // clock() + #include <stdio.h> // in SwLinguStatistik::DTOR + #include <stdlib.h> // getenv() + #include <time.h> // clock() #include <tools/stream.hxx> #endif + #include <hintids.hxx> #include <vcl/svapp.hxx> #include <svl/itemiter.hxx> @@ -46,9 +47,6 @@ #include <editeng/hangulhanja.hxx> #include <SwSmartTagMgr.hxx> #include <linguistic/lngprops.hxx> -#include <com/sun/star/beans/XPropertySet.hpp> -#include <com/sun/star/i18n/WordType.hdl> -#include <com/sun/star/i18n/ScriptType.hdl> #include <unotools/transliterationwrapper.hxx> #include <unotools/charclass.hxx> #include <dlelstnr.hxx> @@ -56,7 +54,7 @@ #include <splargs.hxx> #include <viewopt.hxx> #include <acmplwrd.hxx> -#include <doc.hxx> // GetDoc() +#include <doc.hxx> // GetDoc() #include <docsh.hxx> #include <txtfld.hxx> #include <fmtfld.hxx> @@ -74,8 +72,8 @@ #include <crstate.hxx> #include <undobj.hxx> #include <txatritr.hxx> -#include <redline.hxx> // SwRedline -#include <docary.hxx> // SwRedlineTbl +#include <redline.hxx> // SwRedline +#include <docary.hxx> // SwRedlineTbl #include <scriptinfo.hxx> #include <docstat.hxx> #include <editsh.hxx> @@ -86,6 +84,15 @@ #include <unomid.h> +#include <com/sun/star/beans/XPropertySet.hpp> +#include <com/sun/star/i18n/WordType.hdl> +#include <com/sun/star/i18n/ScriptType.hdl> +#include <com/sun/star/i18n/TransliterationModules.hpp> +#include <com/sun/star/i18n/TransliterationModulesExtra.hpp> + +#include <vector> + + using rtl::OUString; using namespace ::com::sun::star; using namespace ::com::sun::star::frame; @@ -377,7 +384,7 @@ inline BOOL InRange(xub_StrLen nIdx, xub_StrLen nStart, xub_StrLen nEnd) { /* 5 cases: * 1) The attribute is completely in the deletion range: - * -> delete it + * -> delete it * 2) The end of the attribute is in the deletion range: * -> delete it, then re-insert it with new end * 3) The start of the attribute is in the deletion range: @@ -403,7 +410,7 @@ void SwTxtNode::RstAttr(const SwIndex &rIdx, xub_StrLen nLen, USHORT nWhich, xub_StrLen nAttrStart; SwTxtAttr *pHt; - BOOL bChanged = FALSE; + BOOL bChanged = FALSE; // nMin and nMax initialized to maximum / minimum (inverse) xub_StrLen nMin = m_Text.Len(); @@ -487,7 +494,7 @@ void SwTxtNode::RstAttr(const SwIndex &rIdx, xub_StrLen nLen, USHORT nWhich, // Falls wir nur ein nichtaufgespanntes Attribut entfernen, // tun wir mal so, als ob sich nichts geaendert hat. bChanged = bChanged || nEnd > nAttrStart || bNoLen; - if( *pAttrEnd <= nEnd ) // Fall: 1 + if( *pAttrEnd <= nEnd ) // Fall: 1 { const xub_StrLen nAttrEnd = *pAttrEnd; @@ -516,7 +523,7 @@ void SwTxtNode::RstAttr(const SwIndex &rIdx, xub_StrLen nLen, USHORT nWhich, continue; } - else // Fall: 3 + else // Fall: 3 { m_pSwpHints->NoteInHistory( pHt ); *pHt->GetStart() = nEnd; @@ -533,10 +540,10 @@ void SwTxtNode::RstAttr(const SwIndex &rIdx, xub_StrLen nLen, USHORT nWhich, } } } - else // Faelle: 2,4,5 + else // Faelle: 2,4,5 if( *pAttrEnd > nStt ) // Faelle: 2,4 { - if( *pAttrEnd < nEnd ) // Fall: 2 + if( *pAttrEnd < nEnd ) // Fall: 2 { if ( nMin > nAttrStart ) nMin = nAttrStart; @@ -557,8 +564,8 @@ void SwTxtNode::RstAttr(const SwIndex &rIdx, xub_StrLen nLen, USHORT nWhich, InsertHint( pNew, nsSetAttrMode::SETATTR_NOHINTADJUST ); } } - else if( nLen ) // Fall: 4 - { // bei Lange 0 werden beide Hints vom Insert(Ht) + else if( nLen ) // Fall: 4 + { // bei Lange 0 werden beide Hints vom Insert(Ht) // wieder zu einem zusammengezogen !!!! if ( nMin > nAttrStart ) nMin = nAttrStart; @@ -619,7 +626,7 @@ void SwTxtNode::RstAttr(const SwIndex &rIdx, xub_StrLen nLen, USHORT nWhich, /************************************************************************* - * SwTxtNode::GetCurWord() + * SwTxtNode::GetCurWord() * * Aktuelles Wort zurueckliefern: * Wir suchen immer von links nach rechts, es wird also das Wort @@ -1058,7 +1065,7 @@ USHORT SwTxtNode::Convert( SwConversionArgs &rArgs ) } nBegin = nChPos; // start of next language portion } - } while (!bFound && aIter.Next()); /* loop while nothing was found and still sth is left to be searched */ + } while (!bFound && aIter.Next()); /* loop while nothing was found and still sth is left to be searched */ } // keep resulting text within selection / range of text to be converted @@ -1451,7 +1458,7 @@ void SwTxtFrm::CollectAutoCmplWrds( SwCntntNode* pActNode, xub_StrLen nActPos ) /************************************************************************* - * SwTxtNode::Hyphenate + * SwTxtNode::Hyphenate *************************************************************************/ // Findet den TxtFrm und sucht dessen CalcHyph @@ -1578,49 +1585,247 @@ void SwLinguStatistik::Flush() #endif + +struct TransliterationChgData +{ + xub_StrLen nStart; + xub_StrLen nLen; + String sChanged; + Sequence< sal_Int32 > aOffsets; +}; + // change text to Upper/Lower/Hiragana/Katagana/... -void SwTxtNode::TransliterateText( utl::TransliterationWrapper& rTrans, - xub_StrLen nStt, xub_StrLen nEnd, SwUndoTransliterate* pUndo ) +void SwTxtNode::TransliterateText( + utl::TransliterationWrapper& rTrans, + xub_StrLen nStt, xub_StrLen nEnd, + SwUndoTransliterate* pUndo ) { - if( nStt < nEnd ) + if (nStt < nEnd && pBreakIt->GetBreakIter().is()) { - SwLanguageIterator* pIter; - if( rTrans.needLanguageForTheMode() ) - pIter = new SwLanguageIterator( *this, nStt ); - else - pIter = 0; + // since we don't use Hiragana/Katakana or half-width/full-width transliterations here + // it is fine to use ANYWORD_IGNOREWHITESPACES. (ANY_WORD btw is broken and will + // occasionaly miss words in consecutive sentences). Also with ANYWORD_IGNOREWHITESPACES + // text like 'just-in-time' will be converted to 'Just-In-Time' which seems to be the + // proper thing to do. + const sal_Int16 nWordType = WordType::ANYWORD_IGNOREWHITESPACES; + + //! In order to have less trouble with changing text size, e.g. because + //! of ligatures or � (German small sz) being resolved, we need to process + //! the text replacements from end to start. + //! This way the offsets for the yet to be changed words will be + //! left unchanged by the already replaced text. + //! For this we temporarily save the changes to be done in this vector + std::vector< TransliterationChgData > aChanges; + TransliterationChgData aChgData; + + if (rTrans.getType() == (sal_uInt32)TransliterationModulesExtra::TITLE_CASE) + { + // for 'capitalize every word' we need to iterate over each word + + Boundary aSttBndry; + Boundary aEndBndry; + aSttBndry = pBreakIt->GetBreakIter()->getWordBoundary( + GetTxt(), nStt, + pBreakIt->GetLocale( GetLang( nStt ) ), + nWordType, + TRUE /*prefer forward direction*/); + aEndBndry = pBreakIt->GetBreakIter()->getWordBoundary( + GetTxt(), nEnd, + pBreakIt->GetLocale( GetLang( nEnd ) ), + nWordType, + FALSE /*prefer backward direction*/); + + // prevent backtracking to the previous word if selection is at word boundary + if (aSttBndry.endPos <= nStt) + { + aSttBndry = pBreakIt->GetBreakIter()->nextWord( + GetTxt(), aSttBndry.endPos, + pBreakIt->GetLocale( GetLang( aSttBndry.endPos ) ), + nWordType); + } + // prevent advancing to the next word if selection is at word boundary + if (aEndBndry.startPos >= nEnd) + { + aEndBndry = pBreakIt->GetBreakIter()->previousWord( + GetTxt(), aEndBndry.startPos, + pBreakIt->GetLocale( GetLang( aEndBndry.startPos ) ), + nWordType); + } - xub_StrLen nEndPos; - sal_uInt16 nLang; - do { - if( pIter ) + Boundary aCurWordBndry( aSttBndry ); + while (aCurWordBndry.startPos <= aEndBndry.startPos) { - nLang = pIter->GetLanguage(); - nEndPos = pIter->GetChgPos(); - if( nEndPos > nEnd ) - nEndPos = nEnd; + nStt = (xub_StrLen)aCurWordBndry.startPos; + nEnd = (xub_StrLen)aCurWordBndry.endPos; + sal_Int32 nLen = nEnd - nStt; + DBG_ASSERT( nLen > 0, "invalid word length of 0" ); +#if OSL_DEBUG_LEVEL > 1 + String aText( GetTxt().Copy( nStt, nLen ) ); +#endif + + Sequence <sal_Int32> aOffsets; + String sChgd( rTrans.transliterate( GetTxt(), GetLang( nStt ), nStt, nLen, &aOffsets )); + + if (!m_Text.Equals( sChgd, nStt, nLen )) + { + aChgData.nStart = nStt; + aChgData.nLen = nLen; + aChgData.sChanged = sChgd; + aChgData.aOffsets = aOffsets; + aChanges.push_back( aChgData ); + } + + aCurWordBndry = pBreakIt->GetBreakIter()->nextWord( + GetTxt(), nEnd, + pBreakIt->GetLocale( GetLang( nEnd ) ), + nWordType); } - else + } + else if (rTrans.getType() == (sal_uInt32)TransliterationModulesExtra::SENTENCE_CASE) + { + // for 'sentence case' we need to iterate sentence by sentence + + sal_Int32 nLastStart = pBreakIt->GetBreakIter()->beginOfSentence( + GetTxt(), nEnd, + pBreakIt->GetLocale( GetLang( nEnd ) ) ); + sal_Int32 nLastEnd = pBreakIt->GetBreakIter()->endOfSentence( + GetTxt(), nLastStart, + pBreakIt->GetLocale( GetLang( nLastStart ) ) ); + + // extend nStt, nEnd to the current sentence boundaries + sal_Int32 nCurrentStart = pBreakIt->GetBreakIter()->beginOfSentence( + GetTxt(), nStt, + pBreakIt->GetLocale( GetLang( nStt ) ) ); + sal_Int32 nCurrentEnd = pBreakIt->GetBreakIter()->endOfSentence( + GetTxt(), nCurrentStart, + pBreakIt->GetLocale( GetLang( nCurrentStart ) ) ); + + // prevent backtracking to the previous sentence if selection starts at end of a sentence + if (nCurrentEnd <= nStt) + { + // now nCurrentStart is probably located on a non-letter word. (unless we + // are in Asian text with no spaces...) + // Thus to get the real sentence start we should locate the next real word, + // that is one found by DICTIONARY_WORD + i18n::Boundary aBndry = pBreakIt->GetBreakIter()->nextWord( + GetTxt(), nCurrentEnd, + pBreakIt->GetLocale( GetLang( nCurrentEnd ) ), + i18n::WordType::DICTIONARY_WORD); + + // now get new current sentence boundaries + nCurrentStart = pBreakIt->GetBreakIter()->beginOfSentence( + GetTxt(), aBndry.startPos, + pBreakIt->GetLocale( GetLang( aBndry.startPos) ) ); + nCurrentEnd = pBreakIt->GetBreakIter()->endOfSentence( + GetTxt(), nCurrentStart, + pBreakIt->GetLocale( GetLang( nCurrentStart) ) ); + } + // prevent advancing to the next sentence if selection ends at start of a sentence + if (nLastStart >= nEnd) { - nLang = LANGUAGE_SYSTEM; - nEndPos = nEnd; + // now nCurrentStart is probably located on a non-letter word. (unless we + // are in Asian text with no spaces...) + // Thus to get the real sentence start we should locate the previous real word, + // that is one found by DICTIONARY_WORD + i18n::Boundary aBndry = pBreakIt->GetBreakIter()->previousWord( + GetTxt(), nLastStart, + pBreakIt->GetLocale( GetLang( nLastStart) ), + i18n::WordType::DICTIONARY_WORD); + nLastEnd = pBreakIt->GetBreakIter()->endOfSentence( + GetTxt(), aBndry.startPos, + pBreakIt->GetLocale( GetLang( aBndry.startPos) ) ); + if (nCurrentEnd > nLastEnd) + nCurrentEnd = nLastEnd; } - xub_StrLen nLen = nEndPos - nStt; - Sequence <sal_Int32> aOffsets; - String sChgd( rTrans.transliterate( m_Text, nLang, nStt, nLen, - &aOffsets )); - if( !m_Text.Equals( sChgd, nStt, nLen ) ) + while (nCurrentStart < nLastEnd) { - if ( pUndo ) + sal_Int32 nLen = nCurrentEnd - nCurrentStart; + DBG_ASSERT( nLen > 0, "invalid word length of 0" ); +#if OSL_DEBUG_LEVEL > 1 + String aText( GetTxt().Copy( nCurrentStart, nLen ) ); +#endif + + Sequence <sal_Int32> aOffsets; + String sChgd( rTrans.transliterate( GetTxt(), + GetLang( nCurrentStart ), nCurrentStart, nLen, &aOffsets )); + + if (!m_Text.Equals( sChgd, nStt, nLen )) + { + aChgData.nStart = nCurrentStart; + aChgData.nLen = nLen; + aChgData.sChanged = sChgd; + aChgData.aOffsets = aOffsets; + aChanges.push_back( aChgData ); + } + + Boundary aFirstWordBndry; + aFirstWordBndry = pBreakIt->GetBreakIter()->nextWord( + GetTxt(), nCurrentEnd, + pBreakIt->GetLocale( GetLang( nCurrentEnd ) ), + nWordType); + nCurrentStart = aFirstWordBndry.startPos; + nCurrentEnd = pBreakIt->GetBreakIter()->endOfSentence( + GetTxt(), nCurrentStart, + pBreakIt->GetLocale( GetLang( nCurrentStart ) ) ); + } + } + else + { + // here we may transliterate over complete language portions... + + SwLanguageIterator* pIter; + if( rTrans.needLanguageForTheMode() ) + pIter = new SwLanguageIterator( *this, nStt ); + else + pIter = 0; + + xub_StrLen nEndPos; + sal_uInt16 nLang; + do { + if( pIter ) + { + nLang = pIter->GetLanguage(); + nEndPos = pIter->GetChgPos(); + if( nEndPos > nEnd ) + nEndPos = nEnd; + } + else + { + nLang = LANGUAGE_SYSTEM; + nEndPos = nEnd; + } + xub_StrLen nLen = nEndPos - nStt; + + Sequence <sal_Int32> aOffsets; + String sChgd( rTrans.transliterate( m_Text, nLang, nStt, nLen, &aOffsets )); + + if (!m_Text.Equals( sChgd, nStt, nLen )) { - pUndo->AddChanges( *this, nStt, nLen, aOffsets ); + aChgData.nStart = nStt; + aChgData.nLen = nLen; + aChgData.sChanged = sChgd; + aChgData.aOffsets = aOffsets; + aChanges.push_back( aChgData ); } - ReplaceTextOnly( nStt, nLen, sChgd, aOffsets ); + + nStt = nEndPos; + } while( nEndPos < nEnd && pIter && pIter->Next() ); + delete pIter; + } + + if (aChanges.size() > 0) + { + // now apply the changes from end to start to leave the offsets of the + // yet unchanged text parts remain the same. + for (size_t i = 0; i < aChanges.size(); ++i) + { + TransliterationChgData &rData = aChanges[ aChanges.size() - 1 - i ]; + if (pUndo) + pUndo->AddChanges( *this, rData.nStart, rData.nLen, rData.aOffsets ); + ReplaceTextOnly( rData.nStart, rData.nLen, rData.sChanged, rData.aOffsets ); } - nStt = nEndPos; - } while( nEndPos < nEnd && pIter && pIter->Next() ); - delete pIter; + } } } |