summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2020-02-03 15:19:07 +0000
committerMichael Stahl <michael.stahl@cib.de>2020-02-04 11:35:24 +0100
commit1cff94d109c38cc4c929e9ab69c8d5fbd881ba84 (patch)
treeaad8676feaab91904657c42883e7a6bd9f55ff06
parentfc043d38c256243fb782cc48e7708feaeabba4ae (diff)
Related: tdf#129933 assert on pasting over selection in edit
when its selected right to left with cursor flashing at the start format->paragraph->area->color->pick, cursor into hex# edit, end to cursor at the end, shift + home to select all, right to left, ctrl+c, ctrl+v, assert Change-Id: I8e29108ddff94487c298bd5e6607b98f5f841afd Reviewed-on: https://gerrit.libreoffice.org/c/core/+/87885 Tested-by: Jenkins Reviewed-by: Michael Stahl <michael.stahl@cib.de>
-rw-r--r--vcl/source/control/edit.cxx6
1 files changed, 5 insertions, 1 deletions
diff --git a/vcl/source/control/edit.cxx b/vcl/source/control/edit.cxx
index 9e25359bcf19..d76b4464ffcf 100644
--- a/vcl/source/control/edit.cxx
+++ b/vcl/source/control/edit.cxx
@@ -1290,8 +1290,12 @@ void Edit::ImplPaste( uno::Reference< datatransfer::clipboard::XClipboard > cons
uno::Any aData = xDataObj->getTransferData( aFlavor );
OUString aText;
aData >>= aText;
- if( ImplTruncateToMaxLen( aText, maSelection.Len() ) )
+
+ Selection aSelection(maSelection);
+ aSelection.Justify();
+ if (ImplTruncateToMaxLen(aText, aSelection.Len()))
ShowTruncationWarning(GetFrameWeld());
+
ReplaceSelected( aText );
}
catch( const css::uno::Exception& )