[Libreoffice-commits] core.git: Branch 'libreoffice-6-1' - editeng/qa editeng/source
Libreoffice Gerrit user
logerrit at kemper.freedesktop.org
Tue Aug 28 15:09:15 UTC 2018
editeng/qa/unit/core-test.cxx | 9 ++++-----
editeng/source/editeng/impedit2.cxx | 1 +
2 files changed, 5 insertions(+), 5 deletions(-)
New commits:
commit 4efa7cdc891b92b03e3335f7d410321db8109491
Author: Paul Trojahn <paul.trojahn at gmail.com>
AuthorDate: Sun Aug 19 09:18:28 2018 +0200
Commit: Caolán McNamara <caolanm at redhat.com>
CommitDate: Tue Aug 28 17:08:51 2018 +0200
tdf#106260 Fix invisible pasted urls
UpdateFields() was never called after pasting a field.
Change-Id: I91f3eb183a0545d8735c0844f1e864a287101d22
Reviewed-on: https://gerrit.libreoffice.org/59339
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>
(cherry picked from commit 7b52990a234bfd6d4efcbc9fe51e240e065faeea)
Reviewed-on: https://gerrit.libreoffice.org/59641
Reviewed-by: Paul Trojahn <paul.trojahn at gmail.com>
Reviewed-by: Caolán McNamara <caolanm at redhat.com>
Tested-by: Caolán McNamara <caolanm at redhat.com>
diff --git a/editeng/qa/unit/core-test.cxx b/editeng/qa/unit/core-test.cxx
index 7cd582a6a91e..1e0673677653 100644
--- a/editeng/qa/unit/core-test.cxx
+++ b/editeng/qa/unit/core-test.cxx
@@ -606,8 +606,8 @@ void Test::testHyperlinkCopyPaste()
// Assert URL Fields and text before copy
// Check text
- CPPUNIT_ASSERT_EQUAL( sal_uLong(aTextLen), rDoc.GetTextLen() );
- CPPUNIT_ASSERT_EQUAL( OUString("sampletextfortestingfeaturefields"), rDoc.GetParaAsString(sal_Int32(0)) );
+ CPPUNIT_ASSERT_EQUAL( sal_uLong(aTextLen + aRepres1.getLength() + aRepres2.getLength()), rDoc.GetTextLen() );
+ CPPUNIT_ASSERT_EQUAL( OUString("sampletextforuser at example.comtestingexample@domain.comfeaturefields"), rDoc.GetParaAsString(sal_Int32(0)) );
// Check Field 1
EFieldInfo aURLFieldInfo1 = aEditEngine.GetFieldInfo( sal_Int32(0), sal_uInt16(0) );
@@ -637,10 +637,10 @@ void Test::testHyperlinkCopyPaste()
CPPUNIT_ASSERT_EQUAL( sal_uInt16(3), aEditEngine.GetFieldCount(0) );
// Check the updated text length
- CPPUNIT_ASSERT_EQUAL( sal_uLong(aTextLen + 10 ), rDoc.GetTextLen() );
+ CPPUNIT_ASSERT_EQUAL( sal_uLong(aTextLen + 10 + aRepres1.getLength()*2 + aRepres2.getLength()), rDoc.GetTextLen() );
// Check the updated text contents
- CPPUNIT_ASSERT_EQUAL( OUString("sampletextfortestingfeaturefieldsfortesting"), rDoc.GetParaAsString(sal_Int32(0)) );
+ CPPUNIT_ASSERT_EQUAL( OUString("sampletextforuser at example.comtestingexample@domain.comfeaturefieldsforuser at example.comtesting"), rDoc.GetParaAsString(sal_Int32(0)) );
// Check the Fields and their values
@@ -830,7 +830,6 @@ void Test::testHyperlinkSearch()
SvxFieldItem aField(aURLField, EE_FEATURE_FIELD);
aEngine.InsertField(aSel, aField);
- aEngine.UpdateFields();
OUString aContent = pNode->GetExpandedText();
CPPUNIT_ASSERT_EQUAL_MESSAGE("get text", OUString("Please write email to jim at bob.com. if you find a fish(not a dog)."),
diff --git a/editeng/source/editeng/impedit2.cxx b/editeng/source/editeng/impedit2.cxx
index 7e8fb846136a..39192121fcf0 100644
--- a/editeng/source/editeng/impedit2.cxx
+++ b/editeng/source/editeng/impedit2.cxx
@@ -2803,6 +2803,7 @@ EditPaM ImpEditEngine::ImpInsertFeature(const EditSelection& rCurSel, const SfxP
if ( IsUndoEnabled() && !IsInUndo() )
InsertUndo(new EditUndoInsertFeature(pEditEngine, CreateEPaM(aPaM), rItem));
aPaM = aEditDoc.InsertFeature( aPaM, rItem );
+ UpdateFields();
ParaPortion* pPortion = FindParaPortion( aPaM.GetNode() );
OSL_ENSURE( pPortion, "Blind Portion in InsertFeature" );
More information about the Libreoffice-commits
mailing list