android/Bootstrap/Makefile.shared                       |    7 
 android/Makefile                                        |    2 
 android/source/AndroidManifest.xml                      |    6 
 android/source/Makefile                                 |    4 
 android/source/build.gradle                             |   16 
 android/source/gradle/wrapper/gradle-wrapper.properties |    2 
 config_host.mk.in                                       |    4 
 configure.ac                                            |   42 +-
 editeng/inc/editdoc.hxx                                 |   38 +-
 editeng/qa/unit/core-test.cxx                           |    4 
 editeng/source/editeng/editdbg.cxx                      |   32 -
 editeng/source/editeng/editdoc.cxx                      |  114 +++---
 editeng/source/editeng/editeng.cxx                      |   24 -
 editeng/source/editeng/impedit.cxx                      |   16 
 editeng/source/editeng/impedit.hxx                      |    8 
 editeng/source/editeng/impedit2.cxx                     |  211 ++++++------
 editeng/source/editeng/impedit3.cxx                     |  279 ++++++++--------
 editeng/source/editeng/impedit4.cxx                     |   79 ++--
 editeng/source/editeng/impedit5.cxx                     |   10 
 external/nss/ExternalProject_nss.mk                     |    2 
 fpicker/source/office/autocmpledit.cxx                  |   25 +
 fpicker/source/office/autocmpledit.hxx                  |    2 
 sfx2/source/appl/newhelp.cxx                            |    1 
 svx/source/svdraw/sdrhittesthelper.cxx                  |    7 
 sw/qa/uitest/writer_tests7/tdf144439.py                 |    3 
 sw/source/core/doc/number.cxx                           |    2 
 vcl/inc/unx/gtk/gtkobject.hxx                           |    7 
 vcl/unx/gtk3/gtkinst.cxx                                |    2 
 vcl/unx/gtk3/gtkobject.cxx                              |   53 ++-
 29 files changed, 550 insertions(+), 452 deletions(-)

New commits:
commit daad3b76bfc557360070fffe2fce79261f31cc9f
Author:     Michael Weghorn <m.wegh...@posteo.de>
AuthorDate: Tue Apr 19 17:19:26 2022 +0200
Commit:     Michael Weghorn <m.wegh...@posteo.de>
CommitDate: Wed Apr 20 05:33:22 2022 +0200

    android: Update dependencies to current versions
    
    This requires the Gradle update from
    Change-Id Ia982d72d877e229c3006c6d528b830d16c88481f
    "android: Update Android Gradle Plugin to 7.1.3"
    as a prerequisite, since the build would otherwise fail
    with
    
    > > Task :desugarStrippedUIDebugFileDependencies FAILED
    > D8: Method name '$private$<clinit>' in class
    > 'com.sun.star.frame.XMenuBarMergingAcceptor$-CC' cannot be represented
    > in dex format.
    >
    > FAILURE: Build failed with an exception.
    
    after updating only the dependencies.
    
    Change-Id: Ifa007fa0e520e9494ace173d1643abb7d7a5f9c6
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133183
    Tested-by: Jenkins
    Reviewed-by: Michael Weghorn <m.wegh...@posteo.de>
    (cherry picked from commit f22f83fbac3a0a419c2e95d7b725525fd02649e6)

diff --git a/android/source/build.gradle b/android/source/build.gradle
index 08f59bd2f90a..118d7c53d86e 100644
--- a/android/source/build.gradle
+++ b/android/source/build.gradle
@@ -27,8 +27,8 @@ dependencies {
             "libreoffice.jar",
             "unoloader.jar"
     ])
-    implementation 'com.google.android.material:material:1.0.0'
-    implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
+    implementation 'com.google.android.material:material:1.5.0'
+    implementation 'androidx.constraintlayout:constraintlayout:2.1.3'
 }
 
 android {
commit 61d7d2407e6af2ed2dcf52deeaf99841a0a23d6c
Author:     Michael Weghorn <m.wegh...@posteo.de>
AuthorDate: Tue Apr 19 17:18:03 2022 +0200
Commit:     Michael Weghorn <m.wegh...@posteo.de>
CommitDate: Wed Apr 20 05:33:22 2022 +0200

    android: Drop obsolete "sourceCompatibility 6"
    
    This addresses this warning when building Android Viewer:
    
    > > Task :compileStrippedUIDebugJavaWithJavac
    > warning: [options] source value 6 is obsolete and will be removed in a 
future release
    > warning: [options] To suppress warnings about obsolete options, use 
-Xlint:-options.
    
    Change-Id: Ic1a80117e7e8c31774947729452bfafacd7a24c8
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133182
    Tested-by: Jenkins
    Reviewed-by: Michael Weghorn <m.wegh...@posteo.de>
    (cherry picked from commit 8917c8b11a4c05e9dd8b0259146179a99ae08a19)

diff --git a/android/source/build.gradle b/android/source/build.gradle
index 47661f79c4cc..08f59bd2f90a 100644
--- a/android/source/build.gradle
+++ b/android/source/build.gradle
@@ -33,10 +33,6 @@ dependencies {
 
 android {
     compileSdkVersion 31
-    compileOptions {
-        // silence some java-language features hints
-        sourceCompatibility 6
-    }
     // uses non-conventional source layout, so need to reconfigure accordingly
     // ToDo move to conventional layout, so stuff can be stripped down.
     sourceSets {
commit 2a58d87beeb08fb19d24097e4a22f77c37a1570c
Author:     Michael Weghorn <m.wegh...@posteo.de>
AuthorDate: Tue Apr 19 15:49:53 2022 +0200
Commit:     Michael Weghorn <m.wegh...@posteo.de>
CommitDate: Wed Apr 20 05:33:22 2022 +0200

    android: Update Android Gradle Plugin to 7.1.3
    
    ... and gradle to 7.2, which is what Android Studio suggested
    and did automatically when confirming.
    
    Also apply the following optional, but recommended change
    while doing so:
    
    > Migrate from lintOptions to lint
    > Configuration related to lint is now performed using the lint block.
    
    Change-Id: Ia982d72d877e229c3006c6d528b830d16c88481f
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133179
    Tested-by: Jenkins
    Reviewed-by: Michael Weghorn <m.wegh...@posteo.de>
    (cherry picked from commit 39326bc7d439170dd24c9d4b837c2cdb720b5d6f)

diff --git a/android/source/build.gradle b/android/source/build.gradle
index 6b7391d5e389..47661f79c4cc 100644
--- a/android/source/build.gradle
+++ b/android/source/build.gradle
@@ -16,7 +16,7 @@ buildscript {
         google()
     }
     dependencies {
-        classpath 'com.android.tools.build:gradle:3.6.1'
+        classpath 'com.android.tools.build:gradle:7.1.3'
     }
 }
 
@@ -81,7 +81,7 @@ android {
         }
         fullUI.dimension "default"
     }
-    lintOptions {
+    lint {
         // don't error-out on missing translations
         warning 'MissingTranslation'
     }
diff --git a/android/source/gradle/wrapper/gradle-wrapper.properties 
b/android/source/gradle/wrapper/gradle-wrapper.properties
index 7d1cfd365805..2d5e5400a6ed 100644
--- a/android/source/gradle/wrapper/gradle-wrapper.properties
+++ b/android/source/gradle/wrapper/gradle-wrapper.properties
@@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME
 distributionPath=wrapper/dists
 zipStoreBase=GRADLE_USER_HOME
 zipStorePath=wrapper/dists
-distributionUrl=https\://services.gradle.org/distributions/gradle-5.6.4-all.zip
+distributionUrl=https\://services.gradle.org/distributions/gradle-7.2-all.zip
commit 7ee3af34fe7681663ad8faf5082d39e1b6ec96dc
Author:     Michael Weghorn <m.wegh...@posteo.de>
AuthorDate: Tue Apr 19 15:44:08 2022 +0200
Commit:     Michael Weghorn <m.wegh...@posteo.de>
CommitDate: Wed Apr 20 05:33:21 2022 +0200

    android: Stop using ANDROID_SDK_HOME env variable
    
    Otherwise, upgrading to Android Gradle Plugin 7.1.3 and
    gradle 7.2 (which will be done in a follow-up commit)
    would make the build fail like this:
    
    > FAILURE: Build failed with an exception.
    >
    > * Where:
    > Build file 
'/home/michi/development/git/libreoffice-WORKTREE-for-android-x86/android/source/build.gradle'
 line: 1
    >
    > * What went wrong:
    > A problem occurred evaluating root project 'source'.
    > > Failed to apply plugin 'com.android.internal.application'.
    >    > ANDROID_SDK_HOME is set to the root of your SDK: 
/home/michi/Android/Sdk
    >      ANDROID_SDK_HOME was meant to be the parent path of the preference 
folder expected by the Android tools.
    >      It is now deprecated.
    >
    >      To set a custom preference folder location, use ANDROID_USER_HOME.
    >
    >      It should NOT be set to the same directory as the root of your SDK.
    >      To set a custom SDK location, use ANDROID_HOME.
    
    We don't actually rely on `ANDROID_SDK_HOME` being evaluated
    by the Android toolchain, but it used to be set in configure.ac,
    and the value was then assigned to the `sdk.dir` property written to
    `android/source/local.properties`.
    
    Just use a new variable name `ANDROID_SDK_DIR`
    and keep the mechanism otherwise unchanged for now.
    
    Change-Id: I44826621a1342119d40036fb704d8ff1eeed7c77
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133178
    Tested-by: Jenkins
    Reviewed-by: Michael Weghorn <m.wegh...@posteo.de>
    (cherry picked from commit 76d50f83274549002cedc7dc6ded0e3eac7c277c)

diff --git a/android/Bootstrap/Makefile.shared 
b/android/Bootstrap/Makefile.shared
index 18082ea30ea3..83a2383581e4 100644
--- a/android/Bootstrap/Makefile.shared
+++ b/android/Bootstrap/Makefile.shared
@@ -24,7 +24,7 @@ OBJLOCAL=$(BUILDDIR)/android/obj/local/$(ANDROID_APP_ABI)
 
 local.properties: $(BUILDDIR)/config_host.mk
        echo ndk.dir=$(ANDROID_NDK_DIR) >local.properties
-       echo sdk.dir=$(ANDROID_SDK_HOME) >>local.properties
+       echo sdk.dir=$(ANDROID_SDK_DIR) >>local.properties
 
 #
 # Build / link the single .so for this app
@@ -84,7 +84,7 @@ link-so: $(SODEST)/liblo-native-code.so 
$(SODEST)/nss-libraries $(SODEST)/libc++
 # can't "stop" a device anyway.)
 
 stop-start-cycle:
-       $(ANDROID_SDK_HOME)/platform-tools/adb shell stop && 
$(ANDROID_SDK_HOME)/platform-tools/adb shell start && sleep 10
+       $(ANDROID_SDK_DIR)/platform-tools/adb shell stop && 
$(ANDROID_SDK_DIR)/platform-tools/adb shell start && sleep 10
 
 # build-host specific stuff (build paths and the like) to keep build.gradle 
static
 liboSettings.gradle: $(BUILDDIR)/config_build.mk $(BUILDDIR)/config_host.mk
diff --git a/android/Makefile b/android/Makefile
index 288932bbe1b6..796f8092959b 100644
--- a/android/Makefile
+++ b/android/Makefile
@@ -24,7 +24,7 @@ release-apk: build
 
        # the actual signing
        jarsigner --verbose -verbose -sigalg SHA1withRSA -digestalg SHA1 
-keystore ~/.keystore 
$(BUILDDIR)/android/source/build/outputs/apk/LibreOfficeViewer-strippedUI-release-unsigned.apk
 $(key)
-       $(ANDROID_SDK_HOME)/build-tools/*/zipalign -v 4 
$(BUILDDIR)/android/source/build/outputs/apk/LibreOfficeViewer-strippedUI-release-unsigned.apk
 $(SIGNED_APK)
+       $(ANDROID_SDK_DIR)/build-tools/*/zipalign -v 4 
$(BUILDDIR)/android/source/build/outputs/apk/LibreOfficeViewer-strippedUI-release-unsigned.apk
 $(SIGNED_APK)
 
        @echo
        @echo "Resulting signed apk: $(SIGNED_APK)"
diff --git a/android/source/Makefile b/android/source/Makefile
index 5d6603f94738..1dc1b42d187b 100644
--- a/android/source/Makefile
+++ b/android/source/Makefile
@@ -20,7 +20,7 @@ install:
        @if test "$$ENABLE_ANDROID_LOK" != "TRUE" ; then echo ; echo 'Run it 
with "make run"' ; echo ; fi
 
 uninstall:
-       $(ANDROID_SDK_HOME)/platform-tools/adb uninstall $(ANDROID_PACKAGE_NAME)
+       $(ANDROID_SDK_DIR)/platform-tools/adb uninstall $(ANDROID_PACKAGE_NAME)
 
 clean:
        rm -rf assets assets_fullUI assets_strippedUI jniLibs jniLibs_debug 
$(OBJLOCAL)
@@ -33,7 +33,7 @@ ifeq ($(ENABLE_JAVA),TRUE)
 endif
 
 run:
-       if test "$$ENABLE_ANDROID_LOK" != "TRUE" ; then 
$(ANDROID_SDK_HOME)/platform-tools/adb shell am start -n 
$(ANDROID_PACKAGE_NAME)/org.libreoffice.ui.LibreOfficeUIActivity ; fi
+       if test "$$ENABLE_ANDROID_LOK" != "TRUE" ; then 
$(ANDROID_SDK_DIR)/platform-tools/adb shell am start -n 
$(ANDROID_PACKAGE_NAME)/org.libreoffice.ui.LibreOfficeUIActivity ; fi
 
 debugrun:
        @echo "please debug with lldb from within Android Studio, or setup 
ndk-gdb manually (see android/README for details)"
diff --git a/config_host.mk.in b/config_host.mk.in
index 3befc1e9ae95..19d4fb4ea825 100644
--- a/config_host.mk.in
+++ b/config_host.mk.in
@@ -17,7 +17,7 @@ export ABW_CFLAGS=$(gb_SPACE)@ABW_CFLAGS@
 export ABW_LIBS=$(gb_SPACE)@ABW_LIBS@
 export ANDROID_NDK_DIR=@ANDROID_NDK_DIR@
 export ANDROID_APP_ABI=@ANDROID_APP_ABI@
-export ANDROID_SDK_HOME=@ANDROID_SDK_HOME@
+export ANDROID_SDK_DIR=@ANDROID_SDK_DIR@
 export ANDROID_PACKAGE_NAME=@ANDROID_PACKAGE_NAME@
 export ANDROID_BINUTILS_PREBUILT_ROOT=@ANDROID_BINUTILS_PREBUILT_ROOT@
 export ANDROID_GCC_TOOLCHAIN_VERSION=@ANDROID_GCC_TOOLCHAIN_VERSION@
diff --git a/configure.ac b/configure.ac
index 9554cb641814..2766b69daf04 100644
--- a/configure.ac
+++ b/configure.ac
@@ -761,15 +761,15 @@ AC_SUBST(ANDROID_GCC_TOOLCHAIN_VERSION)
 dnl ===================================================================
 dnl --with-android-sdk
 dnl ===================================================================
-ANDROID_SDK_HOME=
+ANDROID_SDK_DIR=
 if test -z "$with_android_sdk" -a -e "$SRC_ROOT/external/android-sdk-linux" -a 
"$build" != "$host"; then
     with_android_sdk="$SRC_ROOT/external/android-sdk-linux"
 fi
 if test -n "$with_android_sdk"; then
-    eval ANDROID_SDK_HOME=$with_android_sdk
-    PATH="$ANDROID_SDK_HOME/platform-tools:$ANDROID_SDK_HOME/tools:$PATH"
+    eval ANDROID_SDK_DIR=$with_android_sdk
+    PATH="$ANDROID_SDK_DIR/platform-tools:$ANDROID_SDK_DIR/tools:$PATH"
 fi
-AC_SUBST(ANDROID_SDK_HOME)
+AC_SUBST(ANDROID_SDK_DIR)
 
 AC_ARG_ENABLE([android-lok],
     AS_HELP_STRING([--enable-android-lok],
@@ -1199,19 +1199,19 @@ if test "$_os" = "Android" ; then
         AC_MSG_ERROR([the --with-android-ndk option does not point to an 
Android NDK])
     fi
 
-    if test -z "$ANDROID_SDK_HOME"; then
+    if test -z "$ANDROID_SDK_DIR"; then
         AC_MSG_ERROR([the --with-android-sdk option is mandatory, unless it is 
available at external/android-sdk-linux/.])
-    elif test ! -d "$ANDROID_SDK_HOME/platforms"; then
+    elif test ! -d "$ANDROID_SDK_DIR/platforms"; then
         AC_MSG_ERROR([the --with-android-sdk option does not point to an 
Android SDK])
     fi
 
     BUILD_TOOLS_VERSION=`$SED -n -e 's/.*buildToolsVersion "\(.*\)"/\1/p' 
$SRC_ROOT/android/source/build.gradle`
-    if test ! -d "$ANDROID_SDK_HOME/build-tools/$BUILD_TOOLS_VERSION"; then
+    if test ! -d "$ANDROID_SDK_DIR/build-tools/$BUILD_TOOLS_VERSION"; then
         AC_MSG_WARN([android build-tools $BUILD_TOOLS_VERSION not found - 
install with
-                         $ANDROID_SDK_HOME/tools/android update sdk -u --all 
--filter build-tools-$BUILD_TOOLS_VERSION
+                         $ANDROID_SDK_DIR/tools/android update sdk -u --all 
--filter build-tools-$BUILD_TOOLS_VERSION
                     or adjust change $SRC_ROOT/android/source/build.gradle 
accordingly])
         add_warning "android build-tools $BUILD_TOOLS_VERSION not found - 
install with"
-        add_warning "    $ANDROID_SDK_HOME/tools/android update sdk -u --all 
--filter build-tools-$BUILD_TOOLS_VERSION"
+        add_warning "    $ANDROID_SDK_DIR/tools/android update sdk -u --all 
--filter build-tools-$BUILD_TOOLS_VERSION"
         add_warning "or adjust $SRC_ROOT/android/source/build.gradle 
accordingly"
     fi
 fi
commit 927ddd8f0fd5951360cba17568d78992eb484803
Author:     Michael Weghorn <m.wegh...@posteo.de>
AuthorDate: Tue Apr 19 15:18:49 2022 +0200
Commit:     Michael Weghorn <m.wegh...@posteo.de>
CommitDate: Wed Apr 20 05:33:21 2022 +0200

    android: Use property instead of ANDROID_NDK_HOME env var
    
    Write an `ndk.dir` property with the directory path to
    `android/source/local.properties` instead, similar
    to how it's done for `sdk.dir`.
    
    Also, rename the `ANDROID_NDK_HOME` variable that's
    assigned in configure.ac that holds the corresponding
    value to `ANDROID_NDK_DIR`, because the gradle warning
    still shows up if that environment variable is set in
    addition to having an `ndk.dir` property in `local.properties`.
    
    This makes the following gradle warning disappear:
    
    > > Task :stripStrippedUIDebugDebugSymbols
    > WARNING: Support for ANDROID_NDK_HOME is deprecated and will be removed 
in the future. Use android.ndkVersion in build.gradle instead.
    > Support for ANDROID_NDK_HOME is deprecated and will be removed in the 
future. Use android.ndkVersion in build.gradle instead.
    
    Note however, that with this approach of using the `ndk.dir`
    property instead of the suggested `android.ndkVersion`
    (with the latter having the stricter requirement that
    the `ndk` dir would have to be a subdir of the SDK dir),
    doing the actual upgrade to a newer Gradle (plugin) version
    in follow-up commit
    Change-Id Ia982d72d877e229c3006c6d528b830d16c88481f
    "android: Update Android Gradle Plugin to 7.1.3"
    revealed that the use of the `ndk.dir` property
    is deprecated in newer Gradle (plugin) versions as well,
    resulting in this warning.
    
    > > Task :stripStrippedUIDebugDebugSymbols
    > [CXX5106] NDK was located by using ndk.dir property. This method is
    > deprecated and will be removed in a future release. Please delete
    > ndk.dir from local.properties and set android.ndkVersion to
    > [20.0.5594570] in all native modules in the project.
    > https://developer.android.com/r/studio-ui/ndk-dir
    
    It might make sense to address that in a follow-up step,
    but for now, it's an improvement and keeps it working
    after the upgrade without potentially causing any incompatibility
    problems with existing autogen configurations,
    while support for the `ANDROID_NDK_HOME` env var that was
    used so far seems to have been dropped, resulting in
    
    > > Task :stripStrippedUIDebugDebugSymbols
    > Unable to strip the following libraries, packaging them as they are:
    > libc++_shared.so, libfreebl3.so, liblo-native-code.so, libnspr4.so,
    > libnss3.so, libnssckbi.so, libnssdbm3.so, libnssutil3.so,
    > libplc4.so, libplds4.so, libsmime3.so, libsoftokn3.so,
    > libsqlite3.so, libssl3.so.
    
    instead if upgrading gradle without switching to the use of the property.
    
    Change-Id: I4a090e8736dac80777f69b0e12819b9c056f582b
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133177
    Tested-by: Jenkins
    Reviewed-by: Michael Weghorn <m.wegh...@posteo.de>
    (cherry picked from commit 128de1949ff120ac925dbb06e398fa992fb295ba)

diff --git a/android/Bootstrap/Makefile.shared 
b/android/Bootstrap/Makefile.shared
index f40693615f0a..18082ea30ea3 100644
--- a/android/Bootstrap/Makefile.shared
+++ b/android/Bootstrap/Makefile.shared
@@ -23,7 +23,8 @@ OBJLOCAL=$(BUILDDIR)/android/obj/local/$(ANDROID_APP_ABI)
 #
 
 local.properties: $(BUILDDIR)/config_host.mk
-       echo sdk.dir=$(ANDROID_SDK_HOME) >local.properties
+       echo ndk.dir=$(ANDROID_NDK_DIR) >local.properties
+       echo sdk.dir=$(ANDROID_SDK_HOME) >>local.properties
 
 #
 # Build / link the single .so for this app
@@ -71,7 +72,7 @@ $(SODEST)/nss-libraries :
        mkdir -p $(SODEST)
        $(foreach lib,$(NSSLIBS),$(STRIP) -o $(SODEST)/lib$(lib).so 
$(INSTDIR)/$(LIBO_LIB_FOLDER)/lib$(lib).so;)
 
-$(SODEST)/libc++_shared.so : 
$(ANDROID_NDK_HOME)/sources/cxx-stl/llvm-libc++/libs/$(ANDROID_APP_ABI)/libc++_shared.so
+$(SODEST)/libc++_shared.so : 
$(ANDROID_NDK_DIR)/sources/cxx-stl/llvm-libc++/libs/$(ANDROID_APP_ABI)/libc++_shared.so
        mkdir -p $(SODEST)
        cp $< $@
 
diff --git a/config_host.mk.in b/config_host.mk.in
index 02f6ec6aba46..3befc1e9ae95 100644
--- a/config_host.mk.in
+++ b/config_host.mk.in
@@ -15,7 +15,7 @@ export BUILDDIR=@BUILDDIR@
 @x_AFLAGS@ export AFLAGS=@AFLAGS@
 export ABW_CFLAGS=$(gb_SPACE)@ABW_CFLAGS@
 export ABW_LIBS=$(gb_SPACE)@ABW_LIBS@
-export ANDROID_NDK_HOME=@ANDROID_NDK_HOME@
+export ANDROID_NDK_DIR=@ANDROID_NDK_DIR@
 export ANDROID_APP_ABI=@ANDROID_APP_ABI@
 export ANDROID_SDK_HOME=@ANDROID_SDK_HOME@
 export ANDROID_PACKAGE_NAME=@ANDROID_PACKAGE_NAME@
diff --git a/configure.ac b/configure.ac
index 4cd279ab6b53..9554cb641814 100644
--- a/configure.ac
+++ b/configure.ac
@@ -622,22 +622,22 @@ AC_ARG_WITH(android-api-level,
         [Specify the API level when building for Android. Defaults to 16 for 
ARM and x86 and to 21 for ARM64 and x86-64]),
 ,)
 
-ANDROID_NDK_HOME=
+ANDROID_NDK_DIR=
 if test -z "$with_android_ndk" -a -e "$SRC_ROOT/external/android-ndk" -a 
"$build" != "$host"; then
     with_android_ndk="$SRC_ROOT/external/android-ndk"
 fi
 if test -n "$with_android_ndk"; then
-    eval ANDROID_NDK_HOME=$with_android_ndk
+    eval ANDROID_NDK_DIR=$with_android_ndk
 
     # Set up a lot of pre-canned defaults
 
-    if test ! -f $ANDROID_NDK_HOME/RELEASE.TXT; then
-        if test ! -f $ANDROID_NDK_HOME/source.properties; then
-            AC_MSG_ERROR([Unrecognized Android NDK. Missing RELEASE.TXT or 
source.properties file in $ANDROID_NDK_HOME.])
+    if test ! -f $ANDROID_NDK_DIR/RELEASE.TXT; then
+        if test ! -f $ANDROID_NDK_DIR/source.properties; then
+            AC_MSG_ERROR([Unrecognized Android NDK. Missing RELEASE.TXT or 
source.properties file in $ANDROID_NDK_DIR.])
         fi
-        ANDROID_NDK_VERSION=`sed -n -e 's/Pkg.Revision = //p' 
$ANDROID_NDK_HOME/source.properties`
+        ANDROID_NDK_VERSION=`sed -n -e 's/Pkg.Revision = //p' 
$ANDROID_NDK_DIR/source.properties`
     else
-        ANDROID_NDK_VERSION=`cut -f1 -d' ' <$ANDROID_NDK_HOME/RELEASE.TXT`
+        ANDROID_NDK_VERSION=`cut -f1 -d' ' <$ANDROID_NDK_DIR/RELEASE.TXT`
     fi
     if test -z "$ANDROID_NDK_VERSION";  then
         AC_MSG_ERROR([Failed to determine Android NDK version. Please check 
your installation.])
@@ -723,10 +723,10 @@ if test -n "$with_android_ndk"; then
         # ndk would also support windows and windows-x86_64
         ;;
     esac
-    
android_TOOLCHAIN=$ANDROID_NDK_HOME/toolchains/llvm/prebuilt/$android_HOST_TAG
+    
android_TOOLCHAIN=$ANDROID_NDK_DIR/toolchains/llvm/prebuilt/$android_HOST_TAG
     ANDROID_COMPILER_BIN=$android_TOOLCHAIN/bin
     dnl TODO: NSS build uses it...
-    
ANDROID_BINUTILS_PREBUILT_ROOT=$ANDROID_NDK_HOME/toolchains/$android_platform_prefix-$ANDROID_GCC_TOOLCHAIN_VERSION/prebuilt/$android_HOST_TAG
+    
ANDROID_BINUTILS_PREBUILT_ROOT=$ANDROID_NDK_DIR/toolchains/$android_platform_prefix-$ANDROID_GCC_TOOLCHAIN_VERSION/prebuilt/$android_HOST_TAG
     AC_SUBST(ANDROID_BINUTILS_PREBUILT_ROOT)
 
     test -z "$AR" && AR=$ANDROID_COMPILER_BIN/$android_gnu_prefix-ar
@@ -754,7 +754,7 @@ if test -n "$with_android_ndk"; then
         CXX_BASE="clang++"
     fi
 fi
-AC_SUBST(ANDROID_NDK_HOME)
+AC_SUBST(ANDROID_NDK_DIR)
 AC_SUBST(ANDROID_APP_ABI)
 AC_SUBST(ANDROID_GCC_TOOLCHAIN_VERSION)
 
@@ -779,7 +779,7 @@ AC_ARG_ENABLE([android-lok],
          actually the Online-based, non-modified LOK.])
 )
 ENABLE_ANDROID_LOK=
-if test -n "$ANDROID_NDK_HOME" ; then
+if test -n "$ANDROID_NDK_DIR" ; then
     if test "$enable_android_lok" = yes; then
         ENABLE_ANDROID_LOK=TRUE
         AC_DEFINE(HAVE_FEATURE_ANDROID_LOK)
@@ -1195,7 +1195,7 @@ if test "$_os" = "Android" ; then
     # Verify that the NDK and SDK options are proper
     if test -z "$with_android_ndk"; then
         AC_MSG_ERROR([the --with-android-ndk option is mandatory, unless it is 
available at external/android-ndk/.])
-    elif test ! -f "$ANDROID_NDK_HOME/meta/abis.json"; then
+    elif test ! -f "$ANDROID_NDK_DIR/meta/abis.json"; then
         AC_MSG_ERROR([the --with-android-ndk option does not point to an 
Android NDK])
     fi
 
diff --git a/external/nss/ExternalProject_nss.mk 
b/external/nss/ExternalProject_nss.mk
index cc6c19bdbc35..316d83d06d3c 100644
--- a/external/nss/ExternalProject_nss.mk
+++ b/external/nss/ExternalProject_nss.mk
@@ -78,7 +78,7 @@ $(call gb_ExternalProject_get_state_target,nss,build): \
                        COMMA=$(COMMA) \
                        CC="$(CC)$(if $(filter iOS,$(OS)), 
-DNSS_STATIC_SOFTOKEN=1 -DNSS_STATIC_FREEBL=1 -DNSS_STATIC_PKCS11=1)$(if 
$(filter ANDROID,$(OS)), -D_PR_NO_LARGE_FILES=1 -DSQLITE_DISABLE_LFS=1)" 
CCC="$(CXX)" \
                        $(if $(CROSS_COMPILING),NSINSTALL="$(if $(filter 
MACOSX,$(OS_FOR_BUILD)),xcrun python3,$(call 
gb_ExternalExecutable_get_command,python)) 
$(SRCDIR)/external/nss/nsinstall.py") \
-                       $(if $(filter ANDROID,$(OS)),OS_TARGET=Android 
OS_TARGET_RELEASE=16 ARCHFLAG="" DEFAULT_COMPILER=clang 
ANDROID_NDK=$(ANDROID_NDK_HOME) 
ANDROID_TOOLCHAIN_VERSION=$(ANDROID_GCC_TOOLCHAIN_VERSION) 
ANDROID_PREFIX=$(HOST_PLATFORM) ANDROID_SYSROOT=$(ANDROID_NDK_HOME)/sysroot 
ANDROID_TOOLCHAIN=$(ANDROID_BINUTILS_PREBUILT_ROOT)) \
+                       $(if $(filter ANDROID,$(OS)),OS_TARGET=Android 
OS_TARGET_RELEASE=16 ARCHFLAG="" DEFAULT_COMPILER=clang 
ANDROID_NDK=$(ANDROID_NDK_DIR) 
ANDROID_TOOLCHAIN_VERSION=$(ANDROID_GCC_TOOLCHAIN_VERSION) 
ANDROID_PREFIX=$(HOST_PLATFORM) ANDROID_SYSROOT=$(ANDROID_NDK_DIR)/sysroot 
ANDROID_TOOLCHAIN=$(ANDROID_BINUTILS_PREBUILT_ROOT)) \
                        NSS_DISABLE_GTESTS=1 \
                        nss_build_all \
                && rm -f $(call 
gb_UnpackedTarball_get_dir,nss)/dist/out/lib/*.a \
commit 9733394f9a5732309edfc6019b32f32d334e18d1
Author:     Michael Weghorn <m.wegh...@posteo.de>
AuthorDate: Tue Apr 19 12:04:11 2022 +0200
Commit:     Michael Weghorn <m.wegh...@posteo.de>
CommitDate: Wed Apr 20 05:33:21 2022 +0200

    android: Remove redundant label attribute from activities
    
    Android Studio was showing an info/warning in the "Problems"
    pane that this label is redundant, so remove it.
    (The app name is used by default if nothing else is specified
    anyway.)
    
    Change-Id: I799c681488b95e2fffe89b59e7de18febe654dcb
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133174
    Tested-by: Jenkins
    Reviewed-by: Michael Weghorn <m.wegh...@posteo.de>
    (cherry picked from commit 258fd217a35444ed245528ccbabdef62869c0419)

diff --git a/android/source/AndroidManifest.xml 
b/android/source/AndroidManifest.xml
index 409a56cb84ef..0af368c8460b 100644
--- a/android/source/AndroidManifest.xml
+++ b/android/source/AndroidManifest.xml
@@ -25,7 +25,6 @@
         <!-- When changing android:windowSoftInputMode, please don't specify 
multiple "adjust..." or "state...". -->
         <activity
             android:name=".LibreOfficeMainActivity"
-            android:label="@string/app_name"
             
android:configChanges="orientation|keyboard|keyboardHidden|screenLayout|uiMode|screenSize|smallestScreenSize"
             android:windowSoftInputMode="adjustResize"
             android:exported="true">
@@ -102,7 +101,6 @@
 
         <!-- Document Browser Activity -->
         <activity android:name="org.libreoffice.ui.LibreOfficeUIActivity"
-            android:label="@string/app_name"
             android:exported="true">
             <intent-filter>
                 <action android:name="android.intent.action.MAIN" />
commit cf0099ac8dac12483e856c2110794ddeb89e45b0
Author:     Michael Weghorn <m.wegh...@posteo.de>
AuthorDate: Tue Apr 19 10:33:27 2022 +0200
Commit:     Michael Weghorn <m.wegh...@posteo.de>
CommitDate: Wed Apr 20 05:32:53 2022 +0200

    android: Update compileSdkVersion/targetSdkVersion to 31
    
    Google Play now requires that apps target API level 30 or higher, and
    compileSdkVersion/targetSdkVersion 31 is also needed to update
    the com.google.android.material dependency to >= 1.5.0 [1].
    
    Explicitly set the `android:exported="true"` attribute for activities
    which is required when targeting Android 12 or newer; quoting from
    the list of behavior changes for apps targeting Android 12 [1]:
    
    > Safer component exporting
    >
    > If your app targets Android 12 or higher and contains activities,
    > services, or broadcast receivers that use intent filters, you must
    > explicitly declare the android:exported attribute for these app
    > components.  Warning: If an activity, service, or broadcast receiver
    > uses intent filters and doesn't have an explicitly-declared value for
    > android:exported, your app can't be installed on a device that runs
    > Android 12 or higher.
    >
    > If the app component includes the LAUNCHER category, set
    > android:exported to true. In most other cases, set android:exported
    > to false.
    >
    > The following code snippet shows an example of a service that
    > contains an intent filter whose android:exported attribute is set to
    > false:
    >
    > <service android:name="com.example.app.backgroundService"
    >          android:exported="false">
    >     <intent-filter>
    >         <action android:name="com.example.app.START_BACKGROUND" />
    >     </intent-filter>
    > </service>
    
    The app worked fine in a quick test on an x86_64 AVD with API level 31.
    
    [1] 
https://github.com/material-components/material-components-android/releases/tag/1.5.0-alpha03
    
    Change-Id: Ibb919e4edb995740e48ebc3338ffab6ca35c1373
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133167
    Tested-by: Jenkins
    Reviewed-by: Michael Weghorn <m.wegh...@posteo.de>
    (cherry picked from commit 2ab389b251744fa7f3f6b060c09746e59d87f3b1)

diff --git a/android/source/AndroidManifest.xml 
b/android/source/AndroidManifest.xml
index 43f790fca985..409a56cb84ef 100644
--- a/android/source/AndroidManifest.xml
+++ b/android/source/AndroidManifest.xml
@@ -27,7 +27,8 @@
             android:name=".LibreOfficeMainActivity"
             android:label="@string/app_name"
             
android:configChanges="orientation|keyboard|keyboardHidden|screenLayout|uiMode|screenSize|smallestScreenSize"
-            android:windowSoftInputMode="adjustResize" >
+            android:windowSoftInputMode="adjustResize"
+            android:exported="true">
 
             <intent-filter>
                 <action android:name="android.intent.action.VIEW" />
@@ -101,7 +102,8 @@
 
         <!-- Document Browser Activity -->
         <activity android:name="org.libreoffice.ui.LibreOfficeUIActivity"
-                  android:label="@string/app_name" >
+            android:label="@string/app_name"
+            android:exported="true">
             <intent-filter>
                 <action android:name="android.intent.action.MAIN" />
                 <category android:name="android.intent.category.LAUNCHER" />
diff --git a/android/source/build.gradle b/android/source/build.gradle
index 7dc93e778a7c..6b7391d5e389 100644
--- a/android/source/build.gradle
+++ b/android/source/build.gradle
@@ -32,7 +32,7 @@ dependencies {
 }
 
 android {
-    compileSdkVersion 28
+    compileSdkVersion 31
     compileOptions {
         // silence some java-language features hints
         sourceCompatibility 6
@@ -53,7 +53,7 @@ android {
     }
     defaultConfig {
         minSdkVersion 16
-        targetSdkVersion 28
+        targetSdkVersion 31
         vectorDrawables.useSupportLibrary = true
     }
     buildTypes {
commit 9543110a7bfd027025c19c76db6a0e7027baa14a
Merge: 0d622b07d78f a1820d4c62e8
Author:     Michael Weghorn <m.wegh...@posteo.de>
AuthorDate: Wed Apr 20 05:32:34 2022 +0200
Commit:     Michael Weghorn <m.wegh...@posteo.de>
CommitDate: Wed Apr 20 05:32:34 2022 +0200

    Merge branch 'libreoffice-7-3'
    
    into distro/lhm/libreoffice-7-3+backports
    
    Change-Id: Ibe31bcd9ef56163740c2ea3d625a96816d78a527

commit a1820d4c62e8f38faa6360f1de168622d296d049
Author:     Noel Grandin <noel.gran...@collabora.co.uk>
AuthorDate: Tue Apr 19 12:53:43 2022 +0200
Commit:     Adolfo Jayme Barrientos <fit...@ubuntu.com>
CommitDate: Wed Apr 20 05:24:46 2022 +0200

    tdf#148313 Basic IDE crashing while resizing dialog
    
    Change-Id: Ic68b78f26626f346f3ef8b54a584de64165d9eb2
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133170
    Tested-by: Jenkins
    Reviewed-by: Noel Grandin <noel.gran...@collabora.co.uk>
    (cherry picked from commit d40c6601330b70c3cb9c1be0fa9e9775ad51113c)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133140
    Reviewed-by: Adolfo Jayme Barrientos <fit...@ubuntu.com>

diff --git a/svx/source/svdraw/sdrhittesthelper.cxx 
b/svx/source/svdraw/sdrhittesthelper.cxx
index 2a93dc372555..eb5116e584a7 100644
--- a/svx/source/svdraw/sdrhittesthelper.cxx
+++ b/svx/source/svdraw/sdrhittesthelper.cxx
@@ -136,9 +136,10 @@ bool ViewObjectContactPrimitiveHit(
         {
             // get primitive sequence
             sdr::contact::DisplayInfo aDisplayInfo;
-            const drawinglayer::primitive2d::Primitive2DContainer& 
rSequence(rVOC.getPrimitive2DSequence(aDisplayInfo));
+            // have to make a copy of this container here, because it might be 
changed underneath us
+            const drawinglayer::primitive2d::Primitive2DContainer 
aSequence(rVOC.getPrimitive2DSequence(aDisplayInfo));
 
-            if(!rSequence.empty())
+            if(!aSequence.empty())
             {
                 // create a HitTest processor
                 const drawinglayer::geometry::ViewInformation2D& 
rViewInformation2D = rVOC.GetObjectContact().getViewInformation2D();
@@ -152,7 +153,7 @@ bool ViewObjectContactPrimitiveHit(
                 aHitTestProcessor2D.collectHitStack(true);
 
                 // feed it with the primitives
-                aHitTestProcessor2D.process(rSequence);
+                aHitTestProcessor2D.process(aSequence);
 
                 // deliver result
                 if (aHitTestProcessor2D.getHit())
commit b8485b4a4675b5ae2fcee9d44d986415a7165e64
Author:     Caolán McNamara <caol...@redhat.com>
AuthorDate: Thu Apr 14 12:05:49 2022 +0100
Commit:     Xisco Fauli <xiscofa...@libreoffice.org>
CommitDate: Tue Apr 19 15:28:31 2022 +0200

    tdf#148101 don't autocomplete remote files dialog entry on delete/backspace
    
    Change-Id: Ieddb41eb37e7090416a418afeffb76ce0eddf90a
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132873
    Tested-by: Jenkins
    Reviewed-by: Xisco Fauli <xiscofa...@libreoffice.org>

diff --git a/fpicker/source/office/autocmpledit.cxx 
b/fpicker/source/office/autocmpledit.cxx
index 5a31c7bdc501..89a2d0b0c245 100644
--- a/fpicker/source/office/autocmpledit.cxx
+++ b/fpicker/source/office/autocmpledit.cxx
@@ -7,21 +7,44 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/.
  */
 
+#include <vcl/event.hxx>
 #include "autocmpledit.hxx"
 
 AutocompleteEdit::AutocompleteEdit(std::unique_ptr<weld::Entry> xEntry)
     : m_xEntry(std::move(xEntry))
     , m_aChangedIdle("fpicker::AutocompleteEdit m_aChangedIdle")
+    , m_nLastCharCode(0)
 {
     m_xEntry->connect_changed(LINK(this, AutocompleteEdit, ChangedHdl));
+    m_xEntry->connect_key_press(LINK(this, AutocompleteEdit, KeyInputHdl));
 
     m_aChangedIdle.SetInvokeHandler(LINK(this, AutocompleteEdit, 
TryAutoComplete));
 }
 
+IMPL_LINK(AutocompleteEdit, KeyInputHdl, const KeyEvent&, rKEvt, bool)
+{
+    m_nLastCharCode = rKEvt.GetKeyCode().GetCode();
+    return false;
+}
+
 IMPL_LINK_NOARG(AutocompleteEdit, ChangedHdl, weld::Entry&, void)
 {
     m_aChangeHdl.Call(*m_xEntry);
-    m_aChangedIdle.Start(); //launch this to happen on idle after cursor 
position will have been set
+
+    switch (m_nLastCharCode)
+    {
+        case css::awt::Key::DELETE_WORD_BACKWARD:
+        case css::awt::Key::DELETE_WORD_FORWARD:
+        case css::awt::Key::DELETE_TO_BEGIN_OF_LINE:
+        case css::awt::Key::DELETE_TO_END_OF_LINE:
+        case KEY_BACKSPACE:
+        case KEY_DELETE:
+            m_aChangedIdle.Stop();
+            break;
+        default:
+            m_aChangedIdle.Start(); //launch this to happen on idle after 
cursor position will have been set
+            break;
+    }
 }
 
 void AutocompleteEdit::AddEntry( const OUString& rEntry )
diff --git a/fpicker/source/office/autocmpledit.hxx 
b/fpicker/source/office/autocmpledit.hxx
index bfb2ee096a63..3eb79eb14aa6 100644
--- a/fpicker/source/office/autocmpledit.hxx
+++ b/fpicker/source/office/autocmpledit.hxx
@@ -22,7 +22,9 @@ private:
     std::vector<OUString> m_aMatching;
     Idle m_aChangedIdle;
     Link<weld::Entry&, void> m_aChangeHdl;
+    sal_uInt16 m_nLastCharCode;
 
+    DECL_LINK(KeyInputHdl, const KeyEvent&, bool);
     DECL_LINK(ChangedHdl, weld::Entry&, void);
     DECL_LINK(TryAutoComplete, Timer*, void);
 
diff --git a/sfx2/source/appl/newhelp.cxx b/sfx2/source/appl/newhelp.cxx
index 9312a83ccd04..b3b7483bb29a 100644
--- a/sfx2/source/appl/newhelp.cxx
+++ b/sfx2/source/appl/newhelp.cxx
@@ -475,6 +475,7 @@ IMPL_LINK_NOARG(IndexTabPage_Impl, EntryChangeHdl, 
weld::Entry&, void)
         case css::awt::Key::DELETE_TO_END_OF_LINE:
         case KEY_BACKSPACE:
         case KEY_DELETE:
+            aAutoCompleteIdle.Stop();
             break;
         default:
             aAutoCompleteIdle.Start();
commit ffa172fc6b98d7d7dd3928693035a34cd331fe12
Author:     Caolán McNamara <caol...@redhat.com>
AuthorDate: Thu Apr 14 09:13:35 2022 +0100
Commit:     Adolfo Jayme Barrientos <fit...@ubuntu.com>
CommitDate: Tue Apr 19 13:55:53 2022 +0200

    tdf#148197 gtk_tree_row_reference_new_proxy warning on docking navigator
    
    Gtk-CRITICAL **: 09:05:11.124: gtk_tree_row_reference_new_proxy: assertion 
'path->depth > 0' failed
    
    from TreeView::set_cursor(-1)
    
    gtk_tree_view_set_cursor is ok (and documented as such) with an
    "invalid" path to unset the cursor, but there isn't the same for
    gtk_tree_view_scroll_to_cell, though there null is docs as acceptable.
    
    Change-Id: I11b94ba997fbbd2f31031d9e73765ea1882ad9ae
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132872
    Tested-by: Jenkins
    Reviewed-by: Adolfo Jayme Barrientos <fit...@ubuntu.com>

diff --git a/vcl/unx/gtk3/gtkinst.cxx b/vcl/unx/gtk3/gtkinst.cxx
index 2732ea7dd0ad..9c6327d7c4f7 100644
--- a/vcl/unx/gtk3/gtkinst.cxx
+++ b/vcl/unx/gtk3/gtkinst.cxx
@@ -14552,7 +14552,7 @@ public:
     virtual void set_cursor(int pos) override
     {
         disable_notify_events();
-        GtkTreePath* path = gtk_tree_path_new_from_indices(pos, -1);
+        GtkTreePath* path = pos != -1 ? gtk_tree_path_new_from_indices(pos, 
-1) : nullptr;
         gtk_tree_view_scroll_to_cell(m_pTreeView, path, nullptr, false, 0, 0);
         gtk_tree_view_set_cursor(m_pTreeView, path, nullptr, false);
         gtk_tree_path_free(path);
commit 79b584af649c9499b1b4606803ee50595e2da33d
Author:     Noel Grandin <noelgran...@gmail.com>
AuthorDate: Mon Apr 18 16:30:55 2022 +0200
Commit:     Xisco Fauli <xiscofa...@libreoffice.org>
CommitDate: Tue Apr 19 12:27:58 2022 +0200

    tdf#148620 Crash in Draw using Format > Lists > Move Down
    
    This reverts
        commit 35f03f26799747894d1534796b6cb227bd4f233b
        speed up loading large ODS a little
    since ImpEditEngine::ImpMoveParagraphs wants to manipulate
    ParaPortion's and also identify them by pointer
    
    Also convert the OSL_ASSERT in this method to an assert
    to catch such problems earlier
    
    Change-Id: Id924d00c9524223db9a96e487b331ce60e3a4fff
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133128
    Tested-by: Jenkins
    Reviewed-by: Noel Grandin <noel.gran...@collabora.co.uk>
    Signed-off-by: Xisco Fauli <xiscofa...@libreoffice.org>
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133165
    Reviewed-by: Michael Stahl <michael.st...@allotropia.de>

diff --git a/editeng/inc/editdoc.hxx b/editeng/inc/editdoc.hxx
index 4d4de9497b67..b37fefd40bd0 100644
--- a/editeng/inc/editdoc.hxx
+++ b/editeng/inc/editdoc.hxx
@@ -433,10 +433,8 @@ class TextPortionList
     PortionsType maPortions;
 
 public:
-   TextPortionList();
-    ~TextPortionList();
-    TextPortionList(TextPortionList&&) = default;
-    TextPortionList& operator=(TextPortionList&&) = default;
+            TextPortionList();
+            ~TextPortionList();
 
     void    Reset();
     sal_Int32 FindPortion(
@@ -477,7 +475,9 @@ private:
     bool            bInvalid:1;   // for skillful formatting
 
 public:
-    EditLine();
+                    EditLine();
+                    EditLine( const EditLine& );
+                    ~EditLine();
 
     bool            IsIn( sal_Int32 nIndex ) const
                         { return ( (nIndex >= nStart ) && ( nIndex < nEnd ) ); 
}
@@ -532,6 +532,7 @@ public:
 
     EditLine*       Clone() const;
 
+    EditLine&   operator = ( const EditLine& rLine );
     friend bool operator == ( const EditLine& r1,  const EditLine& r2  );
 };
 
@@ -543,10 +544,8 @@ class EditLineList
     LinesType maLines;
 
 public:
-    EditLineList();
-    ~EditLineList();
-    EditLineList(EditLineList&&) = default;
-    EditLineList& operator=(EditLineList&&) = default;
+            EditLineList();
+            ~EditLineList();
 
     void Reset();
     void DeleteFromLine(sal_Int32 nDelFrom);
@@ -583,11 +582,11 @@ private:
     bool                bVisible            : 1;    // Belongs to the node!
     bool                bForceRepaint       : 1;
 
+                        ParaPortion( const ParaPortion& ) = delete;
+
 public:
-    ParaPortion( ContentNode* pNode );
-    ~ParaPortion();
-    ParaPortion( ParaPortion&& ) = default;
-    ParaPortion& operator=( ParaPortion&& ) = default;
+                        ParaPortion( ContentNode* pNode );
+                        ~ParaPortion();
 
     sal_Int32 GetLineNumber( sal_Int32 nIndex ) const;
 
@@ -634,7 +633,7 @@ public:
 class ParaPortionList
 {
     mutable sal_Int32 nLastCache;
-    std::vector<ParaPortion> maPortions;
+    std::vector<std::unique_ptr<ParaPortion>> maPortions;
 public:
                     ParaPortionList();
                     ~ParaPortionList();
@@ -647,12 +646,13 @@ public:
     ParaPortion* SafeGetObject(sal_Int32 nPos);
 
     sal_Int32 GetPos(const ParaPortion* p) const;
-    ParaPortion& operator[](sal_Int32 nPos);
-    const ParaPortion& operator[](sal_Int32 nPos) const;
+    ParaPortion* operator[](sal_Int32 nPos);
+    const ParaPortion* operator[](sal_Int32 nPos) const;
 
-    ParaPortion Remove(sal_Int32 nPos);
-    ParaPortion& Insert(sal_Int32 nPos, ParaPortion&& p);
-    void Append(ParaPortion&& p);
+    std::unique_ptr<ParaPortion> Release(sal_Int32 nPos);
+    void Remove(sal_Int32 nPos);
+    void Insert(sal_Int32 nPos, std::unique_ptr<ParaPortion> p);
+    void Append(std::unique_ptr<ParaPortion> p);
     sal_Int32 Count() const;
 
 #if OSL_DEBUG_LEVEL > 0 && !defined NDEBUG
diff --git a/editeng/qa/unit/core-test.cxx b/editeng/qa/unit/core-test.cxx
index 8215c451118a..cefeca9453ba 100644
--- a/editeng/qa/unit/core-test.cxx
+++ b/editeng/qa/unit/core-test.cxx
@@ -191,8 +191,8 @@ void Test::testLineSpacing()
         aEditEngine.QuickSetAttribs(*pSet, aSelection);
 
         // Assert changes
-        ParaPortion& rParaPortion = aEditEngine.GetParaPortions()[0];
-        ContentNode* const pNode = rParaPortion.GetNode();
+        ParaPortion* pParaPortion = aEditEngine.GetParaPortions()[0];
+        ContentNode* const pNode = pParaPortion->GetNode();
         const SvxLineSpacingItem& rLSItem = 
pNode->GetContentAttribs().GetItem(EE_PARA_SBL);
         CPPUNIT_ASSERT_EQUAL(SvxInterLineSpaceRule::Prop, 
rLSItem.GetInterLineSpaceRule());
         CPPUNIT_ASSERT_EQUAL(nSpace, rLSItem.GetPropLineSpace());
diff --git a/editeng/source/editeng/editdbg.cxx 
b/editeng/source/editeng/editdbg.cxx
index 89bff9f34fc6..e3c8f5a2bff8 100644
--- a/editeng/source/editeng/editdbg.cxx
+++ b/editeng/source/editeng/editdbg.cxx
@@ -335,22 +335,22 @@ void EditEngine::DumpData(const EditEngine* pEE, bool 
bInfoBox)
     fprintf( fp, 
"\n================================================================================"
 );
     for ( sal_Int32 nPortion = 0; nPortion < 
pEE->pImpEditEngine->GetParaPortions().Count(); nPortion++)
     {
-        ParaPortion& rPPortion = 
pEE->pImpEditEngine->GetParaPortions()[nPortion];
+        ParaPortion* pPPortion = 
pEE->pImpEditEngine->GetParaPortions()[nPortion];
         fprintf( fp, "\nParagraph %" SAL_PRIdINT32 ": Length = %" 
SAL_PRIdINT32 ", Invalid = %i\nText = '%s'",
-                 nPortion, rPPortion.GetNode()->Len(), rPPortion.IsInvalid(),
-                 OUStringToOString(rPPortion.GetNode()->GetString(), 
RTL_TEXTENCODING_UTF8).getStr() );
+                 nPortion, pPPortion->GetNode()->Len(), pPPortion->IsInvalid(),
+                 OUStringToOString(pPPortion->GetNode()->GetString(), 
RTL_TEXTENCODING_UTF8).getStr() );
         fprintf( fp, "\nVorlage:" );
-        SfxStyleSheet* pStyle = rPPortion.GetNode()->GetStyleSheet();
+        SfxStyleSheet* pStyle = pPPortion->GetNode()->GetStyleSheet();
         if ( pStyle )
             fprintf( fp, " %s", OUStringToOString( pStyle->GetName(), 
RTL_TEXTENCODING_UTF8).getStr() );
         fprintf( fp, "\nParagraph attribute:" );
-        DbgOutItemSet( fp, 
rPPortion.GetNode()->GetContentAttribs().GetItems(), false, false );
+        DbgOutItemSet( fp, 
pPPortion->GetNode()->GetContentAttribs().GetItems(), false, false );
 
         fprintf( fp, "\nCharacter attribute:" );
         bool bZeroAttr = false;
-        for ( sal_Int32 z = 0; z < 
rPPortion.GetNode()->GetCharAttribs().Count(); ++z )
+        for ( sal_Int32 z = 0; z < 
pPPortion->GetNode()->GetCharAttribs().Count(); ++z )
         {
-            const std::unique_ptr<EditCharAttrib>& rAttr = 
rPPortion.GetNode()->GetCharAttribs().GetAttribs()[z];
+            const std::unique_ptr<EditCharAttrib>& rAttr = 
pPPortion->GetNode()->GetCharAttribs().GetAttribs()[z];
             OStringBuffer aCharAttribs;
             aCharAttribs.append("\nA");
             aCharAttribs.append(nPortion);
@@ -370,20 +370,20 @@ void EditEngine::DumpData(const EditEngine* pEE, bool 
bInfoBox)
         if ( bZeroAttr )
             fprintf( fp, "\nNULL-Attribute!" );
 
-        const sal_Int32 nTextPortions = rPPortion.GetTextPortions().Count();
+        const sal_Int32 nTextPortions = pPPortion->GetTextPortions().Count();
         OStringBuffer aPortionStr("\nText portions: #");
         aPortionStr.append(nTextPortions);
         aPortionStr.append(" \nA");
         aPortionStr.append(nPortion);
         aPortionStr.append(": Paragraph Length = ");
-        aPortionStr.append(rPPortion.GetNode()->Len());
+        aPortionStr.append(pPPortion->GetNode()->Len());
         aPortionStr.append("\nA");
         aPortionStr.append(nPortion);
         aPortionStr.append(": ");
         sal_Int32 n = 0;
         for ( sal_Int32 z = 0; z < nTextPortions; ++z )
         {
-            TextPortion& rPortion = rPPortion.GetTextPortions()[z];
+            TextPortion& rPortion = pPPortion->GetTextPortions()[z];
             aPortionStr.append(' ');
             aPortionStr.append(rPortion.GetLen());
             aPortionStr.append('(');
@@ -399,23 +399,23 @@ void EditEngine::DumpData(const EditEngine* pEE, bool 
bInfoBox)
         aPortionStr.append(nPortion);
         aPortionStr.append(": Total length: ");
         aPortionStr.append(n);
-        if ( rPPortion.GetNode()->Len() != n )
+        if ( pPPortion->GetNode()->Len() != n )
             aPortionStr.append(" => Error !!!");
         fprintf(fp, "%s", aPortionStr.getStr());
 
         fprintf( fp, "\n\nLines:" );
         // First the content ...
-        for ( sal_Int32 nLine = 0; nLine < rPPortion.GetLines().Count(); 
nLine++ )
+        for ( sal_Int32 nLine = 0; nLine < pPPortion->GetLines().Count(); 
nLine++ )
         {
-            EditLine& rLine = rPPortion.GetLines()[nLine];
+            EditLine& rLine = pPPortion->GetLines()[nLine];
 
-            OString 
aLine(OUStringToOString(rPPortion.GetNode()->Copy(rLine.GetStart(), 
rLine.GetEnd() - rLine.GetStart()), RTL_TEXTENCODING_ASCII_US));
+            OString 
aLine(OUStringToOString(pPPortion->GetNode()->Copy(rLine.GetStart(), 
rLine.GetEnd() - rLine.GetStart()), RTL_TEXTENCODING_ASCII_US));
             fprintf( fp, "\nLine %" SAL_PRIdINT32 "\t>%s<", nLine, 
aLine.getStr() );
         }
         // then the internal data ...
-        for ( sal_Int32 nLine = 0; nLine < rPPortion.GetLines().Count(); 
nLine++ )
+        for ( sal_Int32 nLine = 0; nLine < pPPortion->GetLines().Count(); 
nLine++ )
         {
-            EditLine& rLine = rPPortion.GetLines()[nLine];
+            EditLine& rLine = pPPortion->GetLines()[nLine];
             fprintf( fp, "\nLine %" SAL_PRIdINT32 ":\tStart: %" SAL_PRIdINT32 
",\tEnd: %" SAL_PRIdINT32, nLine, rLine.GetStart(), rLine.GetEnd() );
             fprintf( fp, "\t\tPortions: %" SAL_PRIdINT32 " - %" SAL_PRIdINT32 
".\tHight: %i, Ascent=%i", rLine.GetStartPortion(), rLine.GetEndPortion(), 
rLine.GetHeight(), rLine.GetMaxAscent() );
         }
diff --git a/editeng/source/editeng/editdoc.cxx 
b/editeng/source/editeng/editdoc.cxx
index 36a7d5727434..3aa587b04ad1 100644
--- a/editeng/source/editeng/editdoc.cxx
+++ b/editeng/source/editeng/editdoc.cxx
@@ -369,6 +369,7 @@ TextPortionList::TextPortionList()
 
 TextPortionList::~TextPortionList()
 {
+    Reset();
 }
 
 void TextPortionList::Reset()
@@ -683,65 +684,52 @@ ParaPortionList::~ParaPortionList()
 
 sal_Int32 ParaPortionList::GetPos(const ParaPortion* p) const
 {
-    sal_Int32 nArrayLen = maPortions.size();
-
-    // Through certain filter code-paths we do a lot of appends, which in
-    // turn call GetPos - creating some N^2 nightmares. If we have a
-    // non-trivially large list, do a few checks from the end first.
-    if (nLastCache > 16 && nArrayLen > 16)
-    {
-        sal_Int32 nEnd;
-        if (nLastCache > nArrayLen - 2)
-            nEnd = nArrayLen;
-        else
-            nEnd = nLastCache + 2;
-
-        for (sal_Int32 nIdx = nLastCache - 2; nIdx < nEnd; ++nIdx)
-        {
-            if (&maPortions.at(nIdx) == p)
-            {
-                nLastCache = nIdx;
-                return nIdx;
-            }
-        }
-    }
-    // The world's lamest linear search from svarray...
-    for (sal_Int32 nIdx = 0; nIdx < nArrayLen; ++nIdx)
-        if (&maPortions.at(nIdx) == p)
-        {
-            nLastCache = nIdx;
-            return nLastCache;
-        }
+    return FastGetPos(maPortions, p, nLastCache);
+}
 
-    // XXX "not found" condition for sal_Int32 indexes
-    return EE_PARA_NOT_FOUND;
+ParaPortion* ParaPortionList::operator [](sal_Int32 nPos)
+{
+    return 0 <= nPos && nPos < static_cast<sal_Int32>(maPortions.size()) ? 
maPortions[nPos].get() : nullptr;
 }
 
-ParaPortion& ParaPortionList::operator [](sal_Int32 nPos)
+const ParaPortion* ParaPortionList::operator [](sal_Int32 nPos) const
 {
-    return maPortions[nPos];
+    return 0 <= nPos && nPos < static_cast<sal_Int32>(maPortions.size()) ? 
maPortions[nPos].get() : nullptr;
 }
 
-const ParaPortion& ParaPortionList::operator [](sal_Int32 nPos) const
+std::unique_ptr<ParaPortion> ParaPortionList::Release(sal_Int32 nPos)
 {
-    return maPortions[nPos];
+    if (nPos < 0 || static_cast<sal_Int32>(maPortions.size()) <= nPos)
+    {
+        SAL_WARN( "editeng", "ParaPortionList::Release - out of bounds pos " 
<< nPos);
+        return nullptr;
+    }
+    std::unique_ptr<ParaPortion> p = std::move(maPortions[nPos]);
+    maPortions.erase(maPortions.begin()+nPos);
+    return p;
 }
 
-ParaPortion ParaPortionList::Remove(sal_Int32 nPos)
+void ParaPortionList::Remove(sal_Int32 nPos)
 {
-    auto it = maPortions.begin()+nPos;
-    ParaPortion val = std::move(*it);
-    maPortions.erase(it);
-    return val;
+    if (nPos < 0 || static_cast<sal_Int32>(maPortions.size()) <= nPos)
+    {
+        SAL_WARN( "editeng", "ParaPortionList::Remove - out of bounds pos " << 
nPos);
+        return;
+    }
+    maPortions.erase(maPortions.begin()+nPos);
 }
 
-ParaPortion& ParaPortionList::Insert(sal_Int32 nPos, ParaPortion&& p)
+void ParaPortionList::Insert(sal_Int32 nPos, std::unique_ptr<ParaPortion> p)
 {
+    if (nPos < 0 || static_cast<sal_Int32>(maPortions.size()) < nPos)
+    {
+        SAL_WARN( "editeng", "ParaPortionList::Insert - out of bounds pos " << 
nPos);
+        return;
+    }
     maPortions.insert(maPortions.begin()+nPos, std::move(p));
-    return maPortions[nPos];
 }
 
-void ParaPortionList::Append(ParaPortion&& p)
+void ParaPortionList::Append(std::unique_ptr<ParaPortion> p)
 {
     maPortions.push_back(std::move(p));
 }
@@ -767,9 +755,10 @@ tools::Long ParaPortionList::GetYOffset(const ParaPortion* 
pPPortion) const
     tools::Long nHeight = 0;
     for (const auto & rPortion : maPortions)
     {
-        if ( pPPortion == &rPortion )
+        const ParaPortion* pTmpPortion = rPortion.get();
+        if ( pTmpPortion == pPPortion )
             return nHeight;
-        nHeight += rPortion.GetHeight();
+        nHeight += pTmpPortion->GetHeight();
     }
     OSL_FAIL( "GetYOffset: Portion not found" );
     return nHeight;
@@ -780,7 +769,7 @@ sal_Int32 ParaPortionList::FindParagraph(tools::Long 
nYOffset) const
     tools::Long nY = 0;
     for (size_t i = 0, n = maPortions.size(); i < n; ++i)
     {
-        nY += maPortions[i].GetHeight(); // should also be correct even in 
bVisible!
+        nY += maPortions[i]->GetHeight(); // should also be correct even in 
bVisible!
         if ( nY > nYOffset )
             return i <= SAL_MAX_INT32 ? static_cast<sal_Int32>(i) : 
SAL_MAX_INT32;
     }
@@ -789,12 +778,12 @@ sal_Int32 ParaPortionList::FindParagraph(tools::Long 
nYOffset) const
 
 const ParaPortion* ParaPortionList::SafeGetObject(sal_Int32 nPos) const
 {
-    return 0 <= nPos && nPos < static_cast<sal_Int32>(maPortions.size()) ? 
&maPortions[nPos] : nullptr;
+    return 0 <= nPos && nPos < static_cast<sal_Int32>(maPortions.size()) ? 
maPortions[nPos].get() : nullptr;
 }
 
 ParaPortion* ParaPortionList::SafeGetObject(sal_Int32 nPos)
 {
-    return 0 <= nPos && nPos < static_cast<sal_Int32>(maPortions.size()) ? 
&maPortions[nPos] : nullptr;
+    return 0 <= nPos && nPos < static_cast<sal_Int32>(maPortions.size()) ? 
maPortions[nPos].get() : nullptr;
 }
 
 #if OSL_DEBUG_LEVEL > 0 && !defined NDEBUG
@@ -938,6 +927,26 @@ EditLine::EditLine() :
 {
 }
 
+EditLine::EditLine( const EditLine& r ) :
+    nTxtWidth(0),
+    nStartPosX(0),
+    nStart(r.nStart),
+    nEnd(r.nEnd),
+    nStartPortion(r.nStartPortion),
+    nEndPortion(r.nEndPortion),
+    nHeight(0),
+    nTxtHeight(0),
+    nMaxAscent(0),
+    bHangingPunctuation(r.bHangingPunctuation),
+    bInvalid(true)
+{
+}
+
+EditLine::~EditLine()
+{
+}
+
+
 EditLine* EditLine::Clone() const
 {
     EditLine* pL = new EditLine;
@@ -972,6 +981,15 @@ bool operator == ( const EditLine& r1,  const EditLine& r2 
 )
     return true;
 }
 
+EditLine& EditLine::operator = ( const EditLine& r )
+{
+    nEnd = r.nEnd;
+    nStart = r.nStart;
+    nEndPortion = r.nEndPortion;
+    nStartPortion = r.nStartPortion;
+    return *this;
+}
+
 
 void EditLine::SetHeight( sal_uInt16 nH, sal_uInt16 nTxtH )
 {
diff --git a/editeng/source/editeng/editeng.cxx 
b/editeng/source/editeng/editeng.cxx
index b557dd693d72..615fca65028f 100644
--- a/editeng/source/editeng/editeng.cxx
+++ b/editeng/source/editeng/editeng.cxx
@@ -694,12 +694,12 @@ bool EditEngine::IsIdleFormatterActive() const
 
 ParaPortion* EditEngine::FindParaPortion(ContentNode const * pNode)
 {
-    return &pImpEditEngine->FindParaPortion(pNode);
+    return pImpEditEngine->FindParaPortion(pNode);
 }
 
 const ParaPortion* EditEngine::FindParaPortion(ContentNode const * pNode) const
 {
-    return &pImpEditEngine->FindParaPortion(pNode);
+    return pImpEditEngine->FindParaPortion(pNode);
 }
 
 const ParaPortion* EditEngine::GetPrevVisPortion(const ParaPortion* 
pCurPortion) const
@@ -1926,7 +1926,7 @@ void EditEngine::SetControlWord( EEControlBits nWord )
         for ( sal_Int32 n = 0; n < nNodes; n++ )
         {
             ContentNode* pNode = pImpEditEngine->GetEditDoc().GetObject( n );
-            const ParaPortion& rPortion = pImpEditEngine->GetParaPortions()[n];
+            const ParaPortion* pPortion = pImpEditEngine->GetParaPortions()[n];
             bool bWrongs = false;
             if (pNode->GetWrongList() != nullptr)
                 bWrongs = !pNode->GetWrongList()->empty();
@@ -1936,10 +1936,10 @@ void EditEngine::SetControlWord( EEControlBits nWord )
                 pImpEditEngine->aInvalidRect.SetLeft( 0 );
                 pImpEditEngine->aInvalidRect.SetRight( 
pImpEditEngine->GetPaperSize().Width() );
                 pImpEditEngine->aInvalidRect.SetTop( nY+1 );
-                pImpEditEngine->aInvalidRect.SetBottom( nY + 
rPortion.GetHeight()-1 );
+                pImpEditEngine->aInvalidRect.SetBottom( 
nY+pPortion->GetHeight()-1 );
                 pImpEditEngine->UpdateViews( pImpEditEngine->pActiveView );
             }
-            nY += rPortion.GetHeight();
+            nY += pPortion->GetHeight();
         }
     }
 }
@@ -2281,8 +2281,8 @@ bool EditEngine::ShouldCreateBigTextObject() const
     sal_Int32 nParas = pImpEditEngine->GetEditDoc().Count();
     for ( sal_Int32 nPara = 0; nPara < nParas; nPara++  )
     {
-        ParaPortion& rParaPortion = pImpEditEngine->GetParaPortions()[nPara];
-        nTextPortions = nTextPortions + rParaPortion.GetTextPortions().Count();
+        ParaPortion* pParaPortion = pImpEditEngine->GetParaPortions()[nPara];
+        nTextPortions = nTextPortions + 
pParaPortion->GetTextPortions().Count();
     }
     return nTextPortions >= pImpEditEngine->GetBigTextObjectStart();
 }
@@ -2439,11 +2439,11 @@ ParagraphInfos EditEngine::GetParagraphInfos( sal_Int32 
nPara )
     aInfos.bValid = pImpEditEngine->IsFormatted();
     if ( pImpEditEngine->IsFormatted() )
     {
-        const ParaPortion& rParaPortion = 
pImpEditEngine->GetParaPortions()[nPara];
-        const EditLine* pLine = rParaPortion.GetLines().Count() ?
-                &rParaPortion.GetLines()[0] : nullptr;
-        DBG_ASSERT( pLine, "GetParagraphInfos - Paragraph out of range" );
-        if ( pLine )
+        const ParaPortion* pParaPortion = 
pImpEditEngine->GetParaPortions()[nPara];
+        const EditLine* pLine = (pParaPortion && 
pParaPortion->GetLines().Count()) ?
+                &pParaPortion->GetLines()[0] : nullptr;
+        DBG_ASSERT( pParaPortion && pLine, "GetParagraphInfos - Paragraph out 
of range" );
+        if ( pParaPortion && pLine )
         {
             aInfos.nFirstLineHeight = pLine->GetHeight();
             aInfos.nFirstLineTextHeight = pLine->GetTxtHeight();
diff --git a/editeng/source/editeng/impedit.cxx 
b/editeng/source/editeng/impedit.cxx
index 3b44e851b821..16033bec31ab 100644
--- a/editeng/source/editeng/impedit.cxx
+++ b/editeng/source/editeng/impedit.cxx
@@ -1137,7 +1137,7 @@ tools::Rectangle ImpEditView::GetEditCursor() const
     if (nPara == EE_PARA_NOT_FOUND) // #i94322
         return tools::Rectangle();
 
-    const ParaPortion& rParaPortion = pEditEngine->GetParaPortions()[nPara];
+    const ParaPortion* pParaPortion = pEditEngine->GetParaPortions()[nPara];
 
     GetCursorFlags nShowCursorFlags = nExtraCursorFlags | 
GetCursorFlags::TextOnly;
 
@@ -1150,7 +1150,7 @@ tools::Rectangle ImpEditView::GetEditCursor() const
         nShowCursorFlags |= GetCursorFlags::PreferPortionStart;
     }
 
-    return ImplGetEditCursor(aPaM, nShowCursorFlags, nTextPortionStart, 
&rParaPortion);
+    return ImplGetEditCursor(aPaM, nShowCursorFlags, nTextPortionStart, 
pParaPortion);
 }
 
 void ImpEditView::ShowCursor( bool bGotoCursor, bool bForceVisCursor )
@@ -1184,7 +1184,7 @@ void ImpEditView::ShowCursor( bool bGotoCursor, bool 
bForceVisCursor )
     if (nPara == EE_PARA_NOT_FOUND) // #i94322
         return;
 
-    const ParaPortion& rParaPortion = pEditEngine->GetParaPortions()[nPara];
+    const ParaPortion* pParaPortion = pEditEngine->GetParaPortions()[nPara];
 
     GetCursorFlags nShowCursorFlags = nExtraCursorFlags | 
GetCursorFlags::TextOnly;
 
@@ -1197,7 +1197,7 @@ void ImpEditView::ShowCursor( bool bGotoCursor, bool 
bForceVisCursor )
         nShowCursorFlags |= GetCursorFlags::PreferPortionStart;
     }
 
-    tools::Rectangle aEditCursor = ImplGetEditCursor(aPaM, nShowCursorFlags, 
nTextPortionStart, &rParaPortion);
+    tools::Rectangle aEditCursor = ImplGetEditCursor(aPaM, nShowCursorFlags, 
nTextPortionStart, pParaPortion);
 
     if ( bGotoCursor  ) // && 
(!pEditEngine->pImpEditEngine->GetStatus().AutoPageSize() ) )
     {
@@ -1439,8 +1439,8 @@ void ImpEditView::ShowCursor( bool bGotoCursor, bool 
bForceVisCursor )
         CursorDirection nCursorDir = CursorDirection::NONE;
         if ( IsInsertMode() && !aEditSelection.HasRange() && ( 
pEditEngine->pImpEditEngine->HasDifferentRTLLevels( aPaM.GetNode() ) ) )
         {
-            sal_uInt16 nTextPortion = 
rParaPortion.GetTextPortions().FindPortion( aPaM.GetIndex(), nTextPortionStart, 
bool(nShowCursorFlags & GetCursorFlags::PreferPortionStart) );
-            const TextPortion& rTextPortion = 
rParaPortion.GetTextPortions()[nTextPortion];
+            sal_uInt16 nTextPortion = 
pParaPortion->GetTextPortions().FindPortion( aPaM.GetIndex(), 
nTextPortionStart, bool(nShowCursorFlags & GetCursorFlags::PreferPortionStart) 
);
+            const TextPortion& rTextPortion = 
pParaPortion->GetTextPortions()[nTextPortion];
             if (rTextPortion.IsRightToLeft())
                 nCursorDir = CursorDirection::RTL;
             else
@@ -1871,8 +1871,8 @@ bool ImpEditView::IsBulletArea( const Point& rPos, 
sal_Int32* pPara )
         sal_Int32 nPara = pEditEngine->GetEditDoc().GetPos( aPaM.GetNode() );
         tools::Rectangle aBulletArea = pEditEngine->GetBulletArea( nPara );
         tools::Long nY = pEditEngine->GetDocPosTopLeft( nPara ).Y();
-        const ParaPortion& rParaPortion = 
pEditEngine->GetParaPortions()[nPara];
-        nY += rParaPortion.GetFirstLineOffset();
+        const ParaPortion* pParaPortion = 
pEditEngine->GetParaPortions()[nPara];
+        nY += pParaPortion->GetFirstLineOffset();
         if ( ( aDocPos.Y() > ( nY + aBulletArea.Top() ) ) &&
              ( aDocPos.Y() < ( nY + aBulletArea.Bottom() ) ) &&
              ( aDocPos.X() > ( aBulletArea.Left() ) ) &&
diff --git a/editeng/source/editeng/impedit.hxx 
b/editeng/source/editeng/impedit.hxx
index 7e22687aba7c..fba5a688c3e1 100644
--- a/editeng/source/editeng/impedit.hxx
+++ b/editeng/source/editeng/impedit.hxx
@@ -761,8 +761,8 @@ private:
 
     void                CheckIdleFormatter();
 
-    inline const ParaPortion& FindParaPortion( const ContentNode* pNode ) 
const;
-    inline ParaPortion& FindParaPortion( ContentNode const * pNode );
+    inline const ParaPortion* FindParaPortion( const ContentNode* pNode ) 
const;
+    inline ParaPortion* FindParaPortion( ContentNode const * pNode );
 
     css::uno::Reference< css::datatransfer::XTransferable > 
CreateTransferable( const EditSelection& rSelection );
 
@@ -1261,14 +1261,14 @@ inline SfxUndoManager* 
ImpEditEngine::SetUndoManager(SfxUndoManager* pNew)
     return pRetval;
 }
 
-inline const ParaPortion& ImpEditEngine::FindParaPortion( const ContentNode* 
pNode ) const
+inline const ParaPortion* ImpEditEngine::FindParaPortion( const ContentNode* 
pNode ) const
 {
     sal_Int32 nPos = aEditDoc.GetPos( pNode );
     DBG_ASSERT( nPos < GetParaPortions().Count(), "Portionloser Node?" );
     return GetParaPortions()[ nPos ];
 }
 
-inline ParaPortion& ImpEditEngine::FindParaPortion( ContentNode const * pNode )
+inline ParaPortion* ImpEditEngine::FindParaPortion( ContentNode const * pNode )
 {
     sal_Int32 nPos = aEditDoc.GetPos( pNode );
     DBG_ASSERT( nPos < GetParaPortions().Count(), "Portionloser Node?" );
diff --git a/editeng/source/editeng/impedit2.cxx 
b/editeng/source/editeng/impedit2.cxx
index 53748a9d4ce9..f46583c8963d 100644
--- a/editeng/source/editeng/impedit2.cxx
+++ b/editeng/source/editeng/impedit2.cxx
@@ -237,7 +237,7 @@ void ImpEditEngine::InitDoc(bool bKeepParaAttribs)
 
     GetParaPortions().Reset();
 
-    GetParaPortions().Insert(0, ParaPortion( aEditDoc[0] ));
+    GetParaPortions().Insert(0, std::make_unique<ParaPortion>( aEditDoc[0] ));
 
     bFormatted = false;
 
@@ -377,8 +377,8 @@ bool ImpEditEngine::Command( const CommandEvent& rCEvt, 
EditView* pView )
                 }
             }
 
-            ParaPortion& rPortion = FindParaPortion( 
mpIMEInfos->aPos.GetNode() );
-            rPortion.MarkSelectionInvalid( mpIMEInfos->aPos.GetIndex() );
+            ParaPortion* pPortion = FindParaPortion( 
mpIMEInfos->aPos.GetNode() );
+            pPortion->MarkSelectionInvalid( mpIMEInfos->aPos.GetIndex() );
 
             bool bWasCursorOverwrite = mpIMEInfos->bWasCursorOverwrite;
 
@@ -443,8 +443,8 @@ bool ImpEditEngine::Command( const CommandEvent& rCEvt, 
EditView* pView )
                     mpIMEInfos->nLen = pData->GetText().getLength();
                 }
 
-                ParaPortion& rPortion = FindParaPortion( 
mpIMEInfos->aPos.GetNode() );
-                rPortion.MarkSelectionInvalid( mpIMEInfos->aPos.GetIndex() );
+                ParaPortion* pPortion = FindParaPortion( 
mpIMEInfos->aPos.GetNode() );
+                pPortion->MarkSelectionInvalid( mpIMEInfos->aPos.GetIndex() );
                 FormatAndLayout( pView );
             }
 
@@ -768,8 +768,9 @@ void ImpEditEngine::ParaAttribsChanged( ContentNode const * 
pNode, bool bIgnoreU
     aEditDoc.SetModified( true );
     bFormatted = false;
 
-    ParaPortion& rPortion = FindParaPortion( pNode );
-    rPortion.MarkSelectionInvalid( 0 );
+    ParaPortion* pPortion = FindParaPortion( pNode );
+    OSL_ENSURE( pPortion, "ParaAttribsChanged: Portion?" );
+    pPortion->MarkSelectionInvalid( 0 );
 
     sal_Int32 nPara = aEditDoc.GetPos( pNode );
     if ( bIgnoreUndoCheck || pEditEngine->IsInUndo() )
@@ -1254,14 +1255,15 @@ EditPaM ImpEditEngine::CursorUp( const EditPaM& rPaM, 
EditView const * pView )
 {
     assert(pView && "No View - No Cursor Movement!");
 
-    const ParaPortion& rPPortion = FindParaPortion( rPaM.GetNode() );
-    sal_Int32 nLine = rPPortion.GetLineNumber( rPaM.GetIndex() );
-    const EditLine& rLine = rPPortion.GetLines()[nLine];
+    const ParaPortion* pPPortion = FindParaPortion( rPaM.GetNode() );
+    OSL_ENSURE( pPPortion, "No matching portion found: CursorUp ");
+    sal_Int32 nLine = pPPortion->GetLineNumber( rPaM.GetIndex() );
+    const EditLine& rLine = pPPortion->GetLines()[nLine];
 
     tools::Long nX;
     if ( pView->pImpEditView->nTravelXPos == TRAVEL_X_DONTKNOW )
     {
-        nX = GetXPos( &rPPortion, &rLine, rPaM.GetIndex() );
+        nX = GetXPos( pPPortion, &rLine, rPaM.GetIndex() );
         pView->pImpEditView->nTravelXPos = nX+nOnePixelInRef;
     }
     else
@@ -1270,8 +1272,8 @@ EditPaM ImpEditEngine::CursorUp( const EditPaM& rPaM, 
EditView const * pView )
     EditPaM aNewPaM( rPaM );
     if ( nLine )    // same paragraph
     {
-        const EditLine& rPrevLine = rPPortion.GetLines()[nLine-1];
-        aNewPaM.SetIndex( GetChar( &rPPortion, &rPrevLine, nX ) );
+        const EditLine& rPrevLine = pPPortion->GetLines()[nLine-1];
+        aNewPaM.SetIndex( GetChar( pPPortion, &rPrevLine, nX ) );
         // If a previous automatically wrapped line, and one has to be exactly
         // at the end of this line, the cursor lands on the current line at the
         // beginning. See Problem: Last character of an automatically wrapped
@@ -1281,7 +1283,7 @@ EditPaM ImpEditEngine::CursorUp( const EditPaM& rPaM, 
EditView const * pView )
     }
     else    // previous paragraph
     {
-        const ParaPortion* pPrevPortion = GetPrevVisPortion( &rPPortion );
+        const ParaPortion* pPrevPortion = GetPrevVisPortion( pPPortion );
         if ( pPrevPortion )
         {
             const EditLine& rLine2 = 
pPrevPortion->GetLines()[pPrevPortion->GetLines().Count()-1];
@@ -1297,31 +1299,32 @@ EditPaM ImpEditEngine::CursorDown( const EditPaM& rPaM, 
EditView const * pView )
 {
     OSL_ENSURE( pView, "No View - No Cursor Movement!" );
 
-    const ParaPortion& rPPortion = FindParaPortion( rPaM.GetNode() );
-    sal_Int32 nLine = rPPortion.GetLineNumber( rPaM.GetIndex() );
+    const ParaPortion* pPPortion = FindParaPortion( rPaM.GetNode() );
+    OSL_ENSURE( pPPortion, "No matching portion found: CursorDown" );
+    sal_Int32 nLine = pPPortion->GetLineNumber( rPaM.GetIndex() );
 
     tools::Long nX;
     if ( pView->pImpEditView->nTravelXPos == TRAVEL_X_DONTKNOW )
     {
-        const EditLine& rLine = rPPortion.GetLines()[nLine];
-        nX = GetXPos( &rPPortion, &rLine, rPaM.GetIndex() );
+        const EditLine& rLine = pPPortion->GetLines()[nLine];
+        nX = GetXPos( pPPortion, &rLine, rPaM.GetIndex() );
         pView->pImpEditView->nTravelXPos = nX+nOnePixelInRef;
     }
     else
         nX = pView->pImpEditView->nTravelXPos;
 
     EditPaM aNewPaM( rPaM );
-    if ( nLine < rPPortion.GetLines().Count()-1 )
+    if ( nLine < pPPortion->GetLines().Count()-1 )
     {
-        const EditLine& rNextLine = rPPortion.GetLines()[nLine+1];
-        aNewPaM.SetIndex( GetChar( &rPPortion, &rNextLine, nX ) );
+        const EditLine& rNextLine = pPPortion->GetLines()[nLine+1];
+        aNewPaM.SetIndex( GetChar( pPPortion, &rNextLine, nX ) );
         // Special treatment, see CursorUp ...
-        if ( ( aNewPaM.GetIndex() == rNextLine.GetEnd() ) && ( 
aNewPaM.GetIndex() > rNextLine.GetStart() ) && ( aNewPaM.GetIndex() < 
rPPortion.GetNode()->Len() ) )
+        if ( ( aNewPaM.GetIndex() == rNextLine.GetEnd() ) && ( 
aNewPaM.GetIndex() > rNextLine.GetStart() ) && ( aNewPaM.GetIndex() < 
pPPortion->GetNode()->Len() ) )
             aNewPaM = CursorLeft( aNewPaM );
     }
     else    // next paragraph
     {
-        const ParaPortion* pNextPortion = GetNextVisPortion( &rPPortion );
+        const ParaPortion* pNextPortion = GetNextVisPortion( pPPortion );
         if ( pNextPortion )
         {
             const EditLine& rLine = pNextPortion->GetLines()[0];
@@ -1339,9 +1342,10 @@ EditPaM ImpEditEngine::CursorDown( const EditPaM& rPaM, 
EditView const * pView )
 
 EditPaM ImpEditEngine::CursorStartOfLine( const EditPaM& rPaM )
 {
-    const ParaPortion& rCurPortion = FindParaPortion( rPaM.GetNode() );
-    sal_Int32 nLine = rCurPortion.GetLineNumber( rPaM.GetIndex() );
-    const EditLine& rLine = rCurPortion.GetLines()[nLine];
+    const ParaPortion* pCurPortion = FindParaPortion( rPaM.GetNode() );
+    OSL_ENSURE( pCurPortion, "No Portion for the PaM ?" );
+    sal_Int32 nLine = pCurPortion->GetLineNumber( rPaM.GetIndex() );
+    const EditLine& rLine = pCurPortion->GetLines()[nLine];
 
     EditPaM aNewPaM( rPaM );
     aNewPaM.SetIndex( rLine.GetStart() );
@@ -1350,9 +1354,10 @@ EditPaM ImpEditEngine::CursorStartOfLine( const EditPaM& 
rPaM )
 
 EditPaM ImpEditEngine::CursorEndOfLine( const EditPaM& rPaM )
 {
-    const ParaPortion& rCurPortion = FindParaPortion( rPaM.GetNode() );
-    sal_Int32 nLine = rCurPortion.GetLineNumber( rPaM.GetIndex() );
-    const EditLine& rLine = rCurPortion.GetLines()[nLine];
+    const ParaPortion* pCurPortion = FindParaPortion( rPaM.GetNode() );
+    OSL_ENSURE( pCurPortion, "No Portion for the PaM ?" );
+    sal_Int32 nLine = pCurPortion->GetLineNumber( rPaM.GetIndex() );
+    const EditLine& rLine = pCurPortion->GetLines()[nLine];
 
     EditPaM aNewPaM( rPaM );
     aNewPaM.SetIndex( rLine.GetEnd() );
@@ -2146,25 +2151,25 @@ EditSelection ImpEditEngine::ImpMoveParagraphs( Range 
aOldPositions, sal_Int32 n
 
     if ( nNewPos == 0 ) // Move to Start
     {
-        pRecalc1 = &GetParaPortions()[0];
-        pRecalc2 = &GetParaPortions()[aOldPositions.Min()];
+        pRecalc1 = GetParaPortions()[0];
+        pRecalc2 = GetParaPortions()[aOldPositions.Min()];
 
     }
     else if ( nNewPos == nParaCount )
     {
-        pRecalc1 = &GetParaPortions()[nParaCount-1];
-        pRecalc2 = &GetParaPortions()[aOldPositions.Max()];
+        pRecalc1 = GetParaPortions()[nParaCount-1];
+        pRecalc2 = GetParaPortions()[aOldPositions.Max()];
     }
 
     if ( aOldPositions.Min() == 0 ) // Move from Start
     {
-        pRecalc3 = &GetParaPortions()[0];
-        pRecalc4 = &GetParaPortions()[aOldPositions.Max()+1];
+        pRecalc3 = GetParaPortions()[0];
+        pRecalc4 = GetParaPortions()[aOldPositions.Max()+1];
     }
     else if ( aOldPositions.Max() == (nParaCount-1) )
     {
-        pRecalc3 = &GetParaPortions()[aOldPositions.Max()];
-        pRecalc4 = &GetParaPortions()[aOldPositions.Min()-1];
+        pRecalc3 = GetParaPortions()[aOldPositions.Max()];
+        pRecalc4 = GetParaPortions()[aOldPositions.Min()-1];
     }
 
     MoveParagraphsInfo aMoveParagraphsInfo( aOldPositions.Min(), 
aOldPositions.Max(), nNewPos );
@@ -2180,28 +2185,28 @@ EditSelection ImpEditEngine::ImpMoveParagraphs( Range 
aOldPositions, sal_Int32 n
     for (tools::Long i = aOldPositions.Min(); i <= aOldPositions.Max(); i++  )
     {
         // always aOldPositions.Min(), since Remove().
-        ParaPortion aTmpPortion = 
GetParaPortions().Remove(aOldPositions.Min());
+        std::unique_ptr<ParaPortion> pTmpPortion = 
GetParaPortions().Release(aOldPositions.Min());
         aEditDoc.Release( aOldPositions.Min() );
-        aTmpPortionList.Append(std::move(aTmpPortion));
+        aTmpPortionList.Append(std::move(pTmpPortion));
     }
 
     sal_Int32 nRealNewPos = pDestPortion ? GetParaPortions().GetPos( 
pDestPortion ) : GetParaPortions().Count();
-    OSL_ENSURE( nRealNewPos != EE_PARA_NOT_FOUND, "ImpMoveParagraphs: Invalid 
Position!" );
+    assert( nRealNewPos != EE_PARA_NOT_FOUND && "ImpMoveParagraphs: Invalid 
Position!" );
 
     sal_Int32 i = 0;
     while( aTmpPortionList.Count() > 0 )
     {
-        ParaPortion aTmpPortion = aTmpPortionList.Remove(0);
+        std::unique_ptr<ParaPortion> pTmpPortion = aTmpPortionList.Release(0);
         if ( i == 0 )
-            aSelection.Min().SetNode( aTmpPortion.GetNode() );
+            aSelection.Min().SetNode( pTmpPortion->GetNode() );
 
-        aSelection.Max().SetNode( aTmpPortion.GetNode() );
-        aSelection.Max().SetIndex( aTmpPortion.GetNode()->Len() );
+        aSelection.Max().SetNode( pTmpPortion->GetNode() );
+        aSelection.Max().SetIndex( pTmpPortion->GetNode()->Len() );
 
-        ContentNode* pN = aTmpPortion.GetNode();
+        ContentNode* pN = pTmpPortion->GetNode();
         aEditDoc.Insert(nRealNewPos+i, pN);
 
-        GetParaPortions().Insert(nRealNewPos+i, std::move(aTmpPortion));
+        GetParaPortions().Insert(nRealNewPos+i, std::move(pTmpPortion));
         ++i;
     }
 
@@ -2275,7 +2280,8 @@ EditPaM ImpEditEngine::ImpConnectParagraphs( ContentNode* 
pLeft, ContentNode* pR
     ParaAttribsChanged( pLeft, true );
 
     // First search for Portions since pRight is gone after ConnectParagraphs.
-    ParaPortion& rLeftPortion = FindParaPortion( pLeft );
+    ParaPortion* pLeftPortion = FindParaPortion( pLeft );
+    OSL_ENSURE( pLeftPortion, "Blind Portion in ImpConnectParagraphs(1)" );
 
     if ( GetStatus().DoOnlineSpelling() )
     {
@@ -2302,7 +2308,7 @@ EditPaM ImpEditEngine::ImpConnectParagraphs( ContentNode* 
pLeft, ContentNode* pR
     EditPaM aPaM = aEditDoc.ConnectParagraphs( pLeft, pRight );
     GetParaPortions().Remove( nParagraphTobeDeleted );
 
-    rLeftPortion.MarkSelectionInvalid( aPaM.GetIndex() );
+    pLeftPortion->MarkSelectionInvalid( aPaM.GetIndex() );
 
     // the right node is deleted by EditDoc:ConnectParagraphs().
     if ( GetTextRanger() )
@@ -2312,9 +2318,9 @@ EditPaM ImpEditEngine::ImpConnectParagraphs( ContentNode* 
pLeft, ContentNode* pR
         // the change of the total text height too late...
         for ( sal_Int32 n = nParagraphTobeDeleted; n < 
GetParaPortions().Count(); n++ )
         {
-            ParaPortion& rPP = GetParaPortions()[n];
-            rPP.MarkSelectionInvalid( 0 );
-            rPP.GetLines().Reset();
+            ParaPortion* pPP = GetParaPortions()[n];
+            pPP->MarkSelectionInvalid( 0 );
+            pPP->GetLines().Reset();
         }
     }
 
@@ -2449,23 +2455,26 @@ EditPaM ImpEditEngine::ImpDeleteSelection(const 
EditSelection& rCurSel)
     {
         // The Rest of the StartNodes...
         ImpRemoveChars( aStartPaM, aStartPaM.GetNode()->Len() - 
aStartPaM.GetIndex() );
-        ParaPortion& rPortion = FindParaPortion( aStartPaM.GetNode() );
-        rPortion.MarkSelectionInvalid( aStartPaM.GetIndex() );
+        ParaPortion* pPortion = FindParaPortion( aStartPaM.GetNode() );
+        OSL_ENSURE( pPortion, "Blind Portion in ImpDeleteSelection(3)" );
+        pPortion->MarkSelectionInvalid( aStartPaM.GetIndex() );
 
         // The beginning of the EndNodes...
         const sal_Int32 nChars = aEndPaM.GetIndex();
         aEndPaM.SetIndex( 0 );
         ImpRemoveChars( aEndPaM, nChars );
-        ParaPortion& rPortion2 = FindParaPortion( aEndPaM.GetNode() );
-        rPortion2.MarkSelectionInvalid( 0 );
+        pPortion = FindParaPortion( aEndPaM.GetNode() );
+        OSL_ENSURE( pPortion, "Blind Portion in ImpDeleteSelection(4)" );
+        pPortion->MarkSelectionInvalid( 0 );
         // Join together...
         aStartPaM = ImpConnectParagraphs( aStartPaM.GetNode(), 
aEndPaM.GetNode() );
     }
     else
     {
         ImpRemoveChars( aStartPaM, aEndPaM.GetIndex() - aStartPaM.GetIndex() );
-        ParaPortion& rPortion = FindParaPortion( aStartPaM.GetNode() );
-        rPortion.MarkInvalid( aEndPaM.GetIndex(), aStartPaM.GetIndex() - 
aEndPaM.GetIndex() );
+        ParaPortion* pPortion = FindParaPortion( aStartPaM.GetNode() );
+        OSL_ENSURE( pPortion, "Blind Portion in ImpDeleteSelection(5)" );
+        pPortion->MarkInvalid( aEndPaM.GetIndex(), aStartPaM.GetIndex() - 
aEndPaM.GetIndex() );
     }
 
     UpdateSelections();
@@ -2670,8 +2679,9 @@ EditPaM ImpEditEngine::InsertTextUserInput( const 
EditSelection& rCurSel,
         }
 
         aEditDoc.InsertText( aPaM, OUString(c) );
-        ParaPortion& rPortion = FindParaPortion( aPaM.GetNode() );
-        rPortion.MarkInvalid( aPaM.GetIndex(), 1 );
+        ParaPortion* pPortion = FindParaPortion( aPaM.GetNode() );
+        OSL_ENSURE( pPortion, "Blind Portion in InsertText" );
+        pPortion->MarkInvalid( aPaM.GetIndex(), 1 );
         aPaM.SetIndex( aPaM.GetIndex()+1 );   // does not do EditDoc-Method 
anymore
     }
 
@@ -2756,7 +2766,8 @@ EditPaM ImpEditEngine::ImpInsertText(const EditSelection& 
aCurSel, const OUStrin
                     nStart2 = nEnd2+1;
                 }
             }
-            ParaPortion& rPortion = FindParaPortion( aPaM.GetNode() );
+            ParaPortion* pPortion = FindParaPortion( aPaM.GetNode() );
+            OSL_ENSURE( pPortion, "Blind Portion in InsertText" );
 
             if ( GetStatus().DoOnlineSpelling() )
             {
@@ -2765,10 +2776,10 @@ EditPaM ImpEditEngine::ImpInsertText(const 
EditSelection& aCurSel, const OUStrin
                 if (pWrongs && !pWrongs->empty())
                     pWrongs->ClearWrongs( aCurWord.Min().GetIndex(), 
aPaM.GetIndex(), aPaM.GetNode() );
                 // ... and mark both words as 'to be checked again'
-                rPortion.MarkInvalid( aCurWord.Min().GetIndex(), 
aLine.getLength() );
+                pPortion->MarkInvalid( aCurWord.Min().GetIndex(), 
aLine.getLength() );
             }
             else
-                rPortion.MarkInvalid( aCurPaM.GetIndex(), aLine.getLength() );
+                pPortion->MarkInvalid( aCurPaM.GetIndex(), aLine.getLength() );
         }
         if ( nEnd < aText.getLength() )
             aPaM = ImpInsertParaBreak( aPaM );
@@ -2820,8 +2831,9 @@ EditPaM ImpEditEngine::ImpInsertFeature(const 
EditSelection& rCurSel, const SfxP
     aPaM = aEditDoc.InsertFeature( aPaM, rItem );
     UpdateFields();
 
-    ParaPortion& rPortion = FindParaPortion( aPaM.GetNode() );
-    rPortion.MarkInvalid( aPaM.GetIndex()-1, 1 );
+    ParaPortion* pPortion = FindParaPortion( aPaM.GetNode() );
+    OSL_ENSURE( pPortion, "Blind Portion in InsertFeature" );
+    pPortion->MarkInvalid( aPaM.GetIndex()-1, 1 );
 
     TextModified();
 
@@ -2883,14 +2895,16 @@ EditPaM ImpEditEngine::ImpInsertParaBreak( EditPaM& 
rPaM, bool bKeepEndingAttrib
         pRWrongs->SetInvalidRange(0, 1);  // Only test the first word
     }
 
-    ParaPortion& rPortion = FindParaPortion( rPaM.GetNode() );
-    rPortion.MarkInvalid( rPaM.GetIndex(), 0 );
+    ParaPortion* pPortion = FindParaPortion( rPaM.GetNode() );
+    OSL_ENSURE( pPortion, "Blind Portion in ImpInsertParaBreak" );
+    pPortion->MarkInvalid( rPaM.GetIndex(), 0 );
 
     // Optimization: Do not place unnecessarily many getPos to Listen!
     // Here, as in undo, but also in all other methods.
-    sal_Int32 nPos = GetParaPortions().GetPos( &rPortion );
-    ParaPortion& rNewPortion = GetParaPortions().Insert(nPos+1, 
ParaPortion(aPaM.GetNode()));
-    ParaAttribsChanged( rNewPortion.GetNode() );
+    sal_Int32 nPos = GetParaPortions().GetPos( pPortion );
+    ParaPortion* pNewPortion = new ParaPortion( aPaM.GetNode() );
+    GetParaPortions().Insert(nPos+1, 
std::unique_ptr<ParaPortion>(pNewPortion));
+    ParaAttribsChanged( pNewPortion->GetNode() );
     if ( IsCallParaInsertedOrDeleted() )
         GetEditEnginePtr()->ParagraphInserted( nPos+1 );
 
@@ -2921,7 +2935,7 @@ EditPaM ImpEditEngine::ImpFastInsertParagraph( sal_Int32 
nPara )
 
     aEditDoc.Insert(nPara, pNode);
 
-    GetParaPortions().Insert(nPara, ParaPortion( pNode ));
+    GetParaPortions().Insert(nPara, std::make_unique<ParaPortion>( pNode ));
     if ( IsCallParaInsertedOrDeleted() )
         GetEditEnginePtr()->ParagraphInserted( nPara );
 
@@ -3013,8 +3027,9 @@ bool ImpEditEngine::UpdateFields()
         if ( bChangesInPara )
         {
             // If possible be more precise when invalidate.
-            ParaPortion& rPortion = GetParaPortions()[nPara];
-            rPortion.MarkSelectionInvalid( 0 );
+            ParaPortion* pPortion = GetParaPortions()[nPara];
+            OSL_ENSURE( pPortion, "NULL-Pointer in Doc" );
+            pPortion->MarkSelectionInvalid( 0 );
         }
     }
     return bChanges;
@@ -3118,19 +3133,19 @@ void ImpEditEngine::IterateLineAreas(const 
IterateLinesAreasFunc& f, IterFlag eO
     sal_Int16 nColumn = 0;
     for (sal_Int32 n = 0, nPortions = GetParaPortions().Count(); n < 
nPortions; ++n)
     {
-        ParaPortion& rPortion = GetParaPortions()[n];
+        ParaPortion* pPortion = GetParaPortions()[n];
         bool bSkipThis = true;
-        if (rPortion.IsVisible())
+        if (pPortion->IsVisible())
         {
             // when typing idle formatting, asynchronous Paint. Invisible 
Portions may be invalid.
-            if (rPortion.IsInvalid())
+            if (pPortion->IsInvalid())
                 return;
 
             LineAreaInfo aInfo{
-                rPortion, // rPortion
+                *pPortion, // pPortion
                 nullptr, // pLine
                 0, // nHeightNeededToNotWrap
-                { aLineStart, Size{ nColumnWidth, 
rPortion.GetFirstLineOffset() } }, // aArea
+                { aLineStart, Size{ nColumnWidth, 
pPortion->GetFirstLineOffset() } }, // aArea
                 n, // nPortion
                 0, // nLine
                 nColumn // nColumn
@@ -3144,16 +3159,16 @@ void ImpEditEngine::IterateLineAreas(const 
IterateLinesAreasFunc& f, IterFlag eO
             if (!aStatus.IsOutliner())
             {
                 const SvxLineSpacingItem& rLSItem
-                    = 
rPortion.GetNode()->GetContentAttribs().GetItem(EE_PARA_SBL);
+                    = 
pPortion->GetNode()->GetContentAttribs().GetItem(EE_PARA_SBL);
                 nSBL = (rLSItem.GetInterLineSpaceRule() == 
SvxInterLineSpaceRule::Fix)
                            ? GetYValue(rLSItem.GetInterLineSpace())
                            : 0;
             }
 
-            adjustYDirectionAware(aLineStart, rPortion.GetFirstLineOffset());
-            for (sal_Int32 nLine = 0, nLines = rPortion.GetLines().Count(); 
nLine < nLines; nLine++)
+            adjustYDirectionAware(aLineStart, pPortion->GetFirstLineOffset());
+            for (sal_Int32 nLine = 0, nLines = pPortion->GetLines().Count(); 
nLine < nLines; nLine++)
             {
-                EditLine& rLine = rPortion.GetLines()[nLine];
+                EditLine& rLine = pPortion->GetLines()[nLine];
                 tools::Long nLineHeight = rLine.GetHeight();
                 if (nLine != nLines - 1)
                     nLineHeight += nVertLineSpacing;
@@ -3189,7 +3204,7 @@ void ImpEditEngine::IterateLineAreas(const 
IterateLinesAreasFunc& f, IterFlag eO
             if (!aStatus.IsOutliner())
             {
                 const SvxULSpaceItem& rULItem
-                    = 
rPortion.GetNode()->GetContentAttribs().GetItem(EE_PARA_ULSPACE);
+                    = 
pPortion->GetNode()->GetContentAttribs().GetItem(EE_PARA_ULSPACE);
                 tools::Long nUL = GetYValue(rULItem.GetLower());
                 adjustYDirectionAware(aLineStart, nUL);
             }
@@ -3307,19 +3322,20 @@ sal_uInt32 ImpEditEngine::CalcParaWidth( sal_Int32 
nPara, bool bIgnoreExtraSpace
 
     // Over all the paragraphs ...
 
-    ParaPortion& rPortion = GetParaPortions()[nPara];
-    if ( rPortion.IsVisible() )
+    OSL_ENSURE( 0 <= nPara && nPara < GetParaPortions().Count(), 
"CalcParaWidth: Out of range" );
+    ParaPortion* pPortion = GetParaPortions()[nPara];
+    if ( pPortion && pPortion->IsVisible() )
     {
-        const SvxLRSpaceItem& rLRItem = GetLRSpaceItem( rPortion.GetNode() );
-        sal_Int32 nSpaceBeforeAndMinLabelWidth = 
GetSpaceBeforeAndMinLabelWidth( rPortion.GetNode() );
+        const SvxLRSpaceItem& rLRItem = GetLRSpaceItem( pPortion->GetNode() );
+        sal_Int32 nSpaceBeforeAndMinLabelWidth = 
GetSpaceBeforeAndMinLabelWidth( pPortion->GetNode() );
 
 
         // On the lines of the paragraph ...
 
-        sal_Int32 nLines = rPortion.GetLines().Count();
+        sal_Int32 nLines = pPortion->GetLines().Count();
         for ( sal_Int32 nLine = 0; nLine < nLines; nLine++ )
         {
-            EditLine& rLine = rPortion.GetLines()[nLine];
+            EditLine& rLine = pPortion->GetLines()[nLine];
             // nCurWidth = pLine->GetStartPosX();
             // For Center- or Right- alignment it depends on the paper
             // width, here not preferred. I general, it is best not leave it
@@ -3330,15 +3346,15 @@ sal_uInt32 ImpEditEngine::CalcParaWidth( sal_Int32 
nPara, bool bIgnoreExtraSpace
             {
                 tools::Long nFI = GetXValue( rLRItem.GetTextFirstLineOffset() 
);
                 nCurWidth -= nFI;
-                if ( rPortion.GetBulletX() > nCurWidth )
+                if ( pPortion->GetBulletX() > nCurWidth )
                 {
                     nCurWidth += nFI;   // LI?
-                    if ( rPortion.GetBulletX() > nCurWidth )
-                        nCurWidth = rPortion.GetBulletX();
+                    if ( pPortion->GetBulletX() > nCurWidth )
+                        nCurWidth = pPortion->GetBulletX();
                 }
             }
             nCurWidth += GetXValue( rLRItem.GetRight() );
-            nCurWidth += CalcLineWidth( &rPortion, &rLine, bIgnoreExtraSpace );
+            nCurWidth += CalcLineWidth( pPortion, &rLine, bIgnoreExtraSpace );
             if ( nCurWidth > nMaxWidth )
             {
                 nMaxWidth = nCurWidth;
@@ -3640,21 +3656,22 @@ void ImpEditEngine::UpdateSelections()
                 {
                     nPara = GetParaPortions().Count()-1;
                 }
+                assert(GetParaPortions()[nPara] && "Empty Document in 
UpdateSelections ?");
                 // Do not end up from a hidden paragraph:
                 sal_Int32 nCurPara = nPara;
                 sal_Int32 nLastPara = GetParaPortions().Count()-1;
-                while ( nPara <= nLastPara && 
!GetParaPortions()[nPara].IsVisible() )
+                while ( nPara <= nLastPara && 
!GetParaPortions()[nPara]->IsVisible() )
                     nPara++;
                 if ( nPara > nLastPara ) // then also backwards ...
                 {
                     nPara = nCurPara;
-                    while ( nPara && !GetParaPortions()[nPara].IsVisible() )
+                    while ( nPara && !GetParaPortions()[nPara]->IsVisible() )
                         nPara--;
                 }
-                OSL_ENSURE( GetParaPortions()[nPara].IsVisible(), "No visible 
paragraph found: UpdateSelections" );
+                OSL_ENSURE( GetParaPortions()[nPara]->IsVisible(), "No visible 
paragraph found: UpdateSelections" );
 
-                ParaPortion& rParaPortion = GetParaPortions()[nPara];
-                EditSelection aTmpSelection( EditPaM( rParaPortion.GetNode(), 
0 ) );
+                ParaPortion* pParaPortion = GetParaPortions()[nPara];
+                EditSelection aTmpSelection( EditPaM( pParaPortion->GetNode(), 
0 ) );
                 pView->pImpEditView->SetEditSelection( aTmpSelection );
                 bChanged=true;
                 break;  // for loop
diff --git a/editeng/source/editeng/impedit3.cxx 
b/editeng/source/editeng/impedit3.cxx
index 19d942eeb911..257767fbfb6c 100644
--- a/editeng/source/editeng/impedit3.cxx
+++ b/editeng/source/editeng/impedit3.cxx
@@ -356,7 +356,7 @@ bool ImpEditEngine::IsPageOverflow( ) const
 void ImpEditEngine::FormatFullDoc()
 {
     for ( sal_Int32 nPortion = 0; nPortion < GetParaPortions().Count(); 
nPortion++ )
-        GetParaPortions()[nPortion].MarkSelectionInvalid( 0 );
+        GetParaPortions()[nPortion]->MarkSelectionInvalid( 0 );
     FormatDoc();
 }
 
@@ -380,20 +380,20 @@ void ImpEditEngine::FormatDoc()
 
     for ( sal_Int32 nPara = 0; nPara < GetParaPortions().Count(); nPara++ )
     {
-        ParaPortion& rParaPortion = GetParaPortions()[nPara];
-        if ( rParaPortion.MustRepaint() || ( rParaPortion.IsInvalid() && 
rParaPortion.IsVisible() ) )
+        ParaPortion* pParaPortion = GetParaPortions()[nPara];
+        if ( pParaPortion->MustRepaint() || ( pParaPortion->IsInvalid() && 
pParaPortion->IsVisible() ) )
         {
             // No formatting should be necessary for MustRepaint()!
-            if ( !rParaPortion.IsInvalid() || CreateLines( nPara, nY ) )
+            if ( !pParaPortion->IsInvalid() || CreateLines( nPara, nY ) )
             {
                 if ( !bGrow && GetTextRanger() )
                 {
                     // For a change in height all below must be reformatted...
                     for ( sal_Int32 n = nPara+1; n < 
GetParaPortions().Count(); n++ )
                     {
-                        ParaPortion& rPP = GetParaPortions()[n];
-                        rPP.MarkSelectionInvalid( 0 );
-                        rPP.GetLines().Reset();
+                        ParaPortion* pPP = GetParaPortions()[n];
+                        pPP->MarkSelectionInvalid( 0 );
+                        pPP->GetLines().Reset();
                     }
                 }
                 bGrow = true;
@@ -408,12 +408,12 @@ void ImpEditEngine::FormatDoc()
                     }
 
                 }
-                rParaPortion.SetMustRepaint( false );
+                pParaPortion->SetMustRepaint( false );
             }
 
             aRepaintParas.insert(nPara);
         }
-        nY += rParaPortion.GetHeight();
+        nY += pParaPortion->GetHeight();
     }
 
     aInvalidRect = tools::Rectangle(); // make empty
@@ -521,11 +521,11 @@ void ImpEditEngine::CheckAutoPageSize()
         {
             // Only paragraphs which are not aligned to the left need to be
             // reformatted, the height can not be changed here anymore.
-            ParaPortion& rParaPortion = GetParaPortions()[nPara];
+            ParaPortion* pParaPortion = GetParaPortions()[nPara];
             SvxAdjust eJustification = GetJustification( nPara );
             if ( eJustification != SvxAdjust::Left )
             {
-                rParaPortion.MarkSelectionInvalid( 0 );
+                pParaPortion->MarkSelectionInvalid( 0 );
                 CreateLines( nPara, 0 );  // 0: For AutoPageSize no TextRange!
             }
         }
@@ -597,28 +597,28 @@ tools::Long ImpEditEngine::GetColumnWidth(const Size& 
rPaperSize) const
 
 bool ImpEditEngine::CreateLines( sal_Int32 nPara, sal_uInt32 nStartPosY )
 {
-    ParaPortion& rParaPortion = GetParaPortions()[nPara];
+    ParaPortion* pParaPortion = GetParaPortions()[nPara];
 
     // sal_Bool: Changes in the height of paragraph Yes / No - 
sal_True/sal_False
-    assert( rParaPortion.GetNode() && "Portion without Node in CreateLines" );
-    DBG_ASSERT( rParaPortion.IsVisible(), "Invisible paragraphs not 
formatted!" );
-    DBG_ASSERT( rParaPortion.IsInvalid(), "CreateLines: Portion not invalid!" 
);
+    assert( pParaPortion->GetNode() && "Portion without Node in CreateLines" );
+    DBG_ASSERT( pParaPortion->IsVisible(), "Invisible paragraphs not 
formatted!" );
+    DBG_ASSERT( pParaPortion->IsInvalid(), "CreateLines: Portion not invalid!" 
);
 
-    bool bProcessingEmptyLine = ( rParaPortion.GetNode()->Len() == 0 );
-    bool bEmptyNodeWithPolygon = ( rParaPortion.GetNode()->Len() == 0 ) && 
GetTextRanger();
+    bool bProcessingEmptyLine = ( pParaPortion->GetNode()->Len() == 0 );
+    bool bEmptyNodeWithPolygon = ( pParaPortion->GetNode()->Len() == 0 ) && 
GetTextRanger();
 
 
     // Fast special treatment for empty paragraphs...
 
-    if ( ( rParaPortion.GetNode()->Len() == 0 ) && !GetTextRanger() )
+    if ( ( pParaPortion->GetNode()->Len() == 0 ) && !GetTextRanger() )
     {
         // fast special treatment...
-        if ( rParaPortion.GetTextPortions().Count() )
-            rParaPortion.GetTextPortions().Reset();
-        if ( rParaPortion.GetLines().Count() )
-            rParaPortion.GetLines().Reset();
-        CreateAndInsertEmptyLine( &rParaPortion );
-        return FinishCreateLines( &rParaPortion );
+        if ( pParaPortion->GetTextPortions().Count() )
+            pParaPortion->GetTextPortions().Reset();
+        if ( pParaPortion->GetLines().Count() )
+            pParaPortion->GetLines().Reset();
+        CreateAndInsertEmptyLine( pParaPortion );
+        return FinishCreateLines( pParaPortion );
     }
 
 
@@ -628,16 +628,16 @@ bool ImpEditEngine::CreateLines( sal_Int32 nPara, 
sal_uInt32 nStartPosY )
     // Always format for 100%:
     bool bMapChanged = ImpCheckRefMapMode();
 
-    if ( rParaPortion.GetLines().Count() == 0 )
+    if ( pParaPortion->GetLines().Count() == 0 )
     {
         EditLine* pL = new EditLine;
-        rParaPortion.GetLines().Append(pL);
+        pParaPortion->GetLines().Append(pL);
     }
 
 
     // Get Paragraph attributes...
 
-    ContentNode* const pNode = rParaPortion.GetNode();
+    ContentNode* const pNode = pParaPortion->GetNode();
 
     bool bRightToLeftPara = IsRightToLeft( nPara );
 
@@ -650,30 +650,30 @@ bool ImpEditEngine::CreateLines( sal_Int32 nPara, 
sal_uInt32 nStartPosY )
     const SvxLineSpacingItem& rLSItem = pNode->GetContentAttribs().GetItem( 
EE_PARA_SBL );
     const bool bScriptSpace = pNode->GetContentAttribs().GetItem( 
EE_PARA_ASIANCJKSPACING ).GetValue();
 
-    const short nInvalidDiff = rParaPortion.GetInvalidDiff();
-    const sal_Int32 nInvalidStart = rParaPortion.GetInvalidPosStart();
+    const short nInvalidDiff = pParaPortion->GetInvalidDiff();
+    const sal_Int32 nInvalidStart = pParaPortion->GetInvalidPosStart();
     const sal_Int32 nInvalidEnd =  nInvalidStart + std::abs( nInvalidDiff );
 
     bool bQuickFormat = false;
     if ( !bEmptyNodeWithPolygon && !HasScriptType( nPara, 
i18n::ScriptType::COMPLEX ) )
     {
-        if ( ( rParaPortion.IsSimpleInvalid() ) && ( nInvalidDiff > 0 ) &&
+        if ( ( pParaPortion->IsSimpleInvalid() ) && ( nInvalidDiff > 0 ) &&
              ( pNode->GetString().indexOf( CH_FEATURE, nInvalidStart ) > 
nInvalidEnd ) )
         {
             bQuickFormat = true;
         }
-        else if ( ( rParaPortion.IsSimpleInvalid() ) && ( nInvalidDiff < 0 ) )
+        else if ( ( pParaPortion->IsSimpleInvalid() ) && ( nInvalidDiff < 0 ) )
         {
             // check if delete over the portion boundaries was done...
             sal_Int32 nStart = nInvalidStart;  // DOUBLE !!!!!!!!!!!!!!!
             sal_Int32 nEnd = nStart - nInvalidDiff;  // negative
             bQuickFormat = true;
             sal_Int32 nPos = 0;
-            sal_Int32 nPortions = rParaPortion.GetTextPortions().Count();
+            sal_Int32 nPortions = pParaPortion->GetTextPortions().Count();
             for ( sal_Int32 nTP = 0; nTP < nPortions; nTP++ )
             {
                 // There must be no start / end in the deleted area.
-                const TextPortion& rTP = rParaPortion.GetTextPortions()[ nTP ];
+                const TextPortion& rTP = pParaPortion->GetTextPortions()[ nTP 
];
                 nPos = nPos + rTP.GetLen();
                 if ( ( nPos > nStart ) && ( nPos < nEnd ) )
                 {
@@ -694,17 +694,17 @@ bool ImpEditEngine::CreateLines( sal_Int32 nPara, 
sal_uInt32 nStartPosY )
     if ( bEmptyNodeWithPolygon )
     {
         TextPortion* pDummyPortion = new TextPortion( 0 );
-        rParaPortion.GetTextPortions().Reset();
-        rParaPortion.GetTextPortions().Append(pDummyPortion);
+        pParaPortion->GetTextPortions().Reset();
+        pParaPortion->GetTextPortions().Append(pDummyPortion);
     }
     else if ( bQuickFormat )
     {
         // faster Method:
-        RecalcTextPortion( &rParaPortion, nInvalidStart, nInvalidDiff );
+        RecalcTextPortion( pParaPortion, nInvalidStart, nInvalidDiff );
     }
     else    // nRealInvalidStart can be before InvalidStart, since Portions 
were deleted...
     {
-        CreateTextPortions( &rParaPortion, nRealInvalidStart );
+        CreateTextPortions( pParaPortion, nRealInvalidStart );
     }
 
 
@@ -712,10 +712,10 @@ bool ImpEditEngine::CreateLines( sal_Int32 nPara, 
sal_uInt32 nStartPosY )
     // Flag the line => do not remove it !
 
 
-    sal_Int32 nLine = rParaPortion.GetLines().Count()-1;
+    sal_Int32 nLine = pParaPortion->GetLines().Count()-1;
     for ( sal_Int32 nL = 0; nL <= nLine; nL++ )
     {
-        EditLine& rLine = rParaPortion.GetLines()[nL];
+        EditLine& rLine = pParaPortion->GetLines()[nL];
         if ( rLine.GetEnd() > nRealInvalidStart )  // not nInvalidStart!
         {
             nLine = nL;
@@ -725,20 +725,20 @@ bool ImpEditEngine::CreateLines( sal_Int32 nPara, 
sal_uInt32 nStartPosY )
     }
     // Begin one line before...
     // If it is typed at the end, the line in front cannot change.
-    if ( nLine && ( !rParaPortion.IsSimpleInvalid() || ( nInvalidEnd < 
pNode->Len() ) || ( nInvalidDiff <= 0 ) ) )
+    if ( nLine && ( !pParaPortion->IsSimpleInvalid() || ( nInvalidEnd < 
pNode->Len() ) || ( nInvalidDiff <= 0 ) ) )
         nLine--;
 
-    EditLine* pLine = &rParaPortion.GetLines()[nLine];
+    EditLine* pLine = &pParaPortion->GetLines()[nLine];
 
     static const tools::Rectangle aZeroArea { Point(), Point() };
     tools::Rectangle aBulletArea( aZeroArea );
     if ( !nLine )
     {
-        aBulletArea = GetEditEnginePtr()->GetBulletArea( 
GetParaPortions().GetPos( &rParaPortion ) );
+        aBulletArea = GetEditEnginePtr()->GetBulletArea( 
GetParaPortions().GetPos( pParaPortion ) );
         if ( !aBulletArea.IsWidthEmpty() && aBulletArea.Right() > 0 )
-            rParaPortion.SetBulletX( static_cast<sal_Int32>(GetXValue( 
aBulletArea.Right() )) );
+            pParaPortion->SetBulletX( static_cast<sal_Int32>(GetXValue( 
aBulletArea.Right() )) );
         else
-            rParaPortion.SetBulletX( 0 ); // if Bullet is set incorrectly
+            pParaPortion->SetBulletX( 0 ); // if Bullet is set incorrectly
     }
 
 
@@ -776,9 +776,9 @@ bool ImpEditEngine::CreateLines( sal_Int32 nPara, 
sal_uInt32 nStartPosY )
             tools::Long nFI = GetXValue( rLRItem.GetTextFirstLineOffset() );
             nStartX += nFI;
 
-            if ( !nLine && ( rParaPortion.GetBulletX() > nStartX ) )
+            if ( !nLine && ( pParaPortion->GetBulletX() > nStartX ) )
             {
-                    nStartX = rParaPortion.GetBulletX();
+                    nStartX = pParaPortion->GetBulletX();
             }
         }
 
@@ -818,7 +818,7 @@ bool ImpEditEngine::CreateLines( sal_Int32 nPara, 
sal_uInt32 nStartPosY )
         {
             GetTextRanger()->SetVertical( IsEffectivelyVertical() );
 
-            tools::Long nTextY = nStartPosY + GetEditCursor( &rParaPortion, 
pLine, pLine->GetStart(), GetCursorFlags::NONE ).Top();
+            tools::Long nTextY = nStartPosY + GetEditCursor( pParaPortion, 
pLine, pLine->GetStart(), GetCursorFlags::NONE ).Top();
             if ( !bSameLineAgain )
             {
                 SeekCursor( pNode, nTmpPos+1, aTmpFont );
@@ -896,7 +896,7 @@ bool ImpEditEngine::CreateLines( sal_Int32 nPara, 
sal_uInt32 nStartPosY )
         const EditCharAttrib* pNextFeature = 
pNode->GetCharAttribs().FindFeature( pLine->GetStart() );
         while ( ( nTmpWidth < nXWidth ) && !bEOL )
         {
-            const sal_Int32 nTextPortions = 
rParaPortion.GetTextPortions().Count();
+            const sal_Int32 nTextPortions = 
pParaPortion->GetTextPortions().Count();
             assert(nTextPortions > 0);
             bContinueLastPortion = (nTmpPortion >= nTextPortions);
             if (bContinueLastPortion)
@@ -914,17 +914,17 @@ bool ImpEditEngine::CreateLines( sal_Int32 nPara, 
sal_uInt32 nStartPosY )
             }
 
             nPortionStart = nTmpPos;
-            pPortion = &rParaPortion.GetTextPortions()[nTmpPortion];
+            pPortion = &pParaPortion->GetTextPortions()[nTmpPortion];
             if ( !bContinueLastPortion && pPortion->GetKind() == 
PortionKind::HYPHENATOR )
             {
                 // Throw away a Portion, if necessary correct the one before,
                 // if the Hyph portion has swallowed a character...
                 sal_Int32 nTmpLen = pPortion->GetLen();
-                rParaPortion.GetTextPortions().Remove( nTmpPortion );
+                pParaPortion->GetTextPortions().Remove( nTmpPortion );
                 if (nTmpPortion && nTmpLen)
                 {
                     nTmpPortion--;
-                    TextPortion& rPrev = 
rParaPortion.GetTextPortions()[nTmpPortion];
+                    TextPortion& rPrev = 
pParaPortion->GetTextPortions()[nTmpPortion];

... etc. - the rest is truncated

Reply via email to