summaryrefslogtreecommitdiff
path: root/editeng/source/editeng/impedit2.cxx
diff options
context:
space:
mode:
authorKatarina Behrens <Katarina.Behrens@cib.de>2020-01-17 14:30:56 +0100
committerKatarina Behrens <Katarina.Behrens@cib.de>2020-01-23 15:01:33 +0100
commit66ed51712bb323bba7d1a0b0d21b256e5f5f9ccf (patch)
tree42fe1df2126ceae345bd0af4bdeeca0227a9fa32 /editeng/source/editeng/impedit2.cxx
parentb53d83507fab90606606261b8593e05bdbb06fab (diff)
tdf#128046: preserve list levels on paste
done in two steps: 1) bullet and numbering properties must be included in the property list of SvxUnoText on import from ODF clipboard (SvxReadXML) 2) in ConnectParagraphs, don't merge para attributes if the paragraph to be deleted is empty. Paragraph breaks are inserted before paste so this would make the last list level of the pasted text take the properties of the empty paragraph and thus lose its indentation Also updated tdf#103083 unit test to be more specific and test that bullet properties don't get lost after paste. Previously only count of SfxItems was tested which is somehow fragile and fails bc paste adds a paragraph style Change-Id: Ia162adb7abf145a8217f21c7ebfe06b69731e2a5 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/86983 Tested-by: Jenkins Reviewed-by: Katarina Behrens <Katarina.Behrens@cib.de>
Diffstat (limited to 'editeng/source/editeng/impedit2.cxx')
-rw-r--r--editeng/source/editeng/impedit2.cxx6
1 files changed, 4 insertions, 2 deletions
diff --git a/editeng/source/editeng/impedit2.cxx b/editeng/source/editeng/impedit2.cxx
index 64c9f10f5135..30e12bec9a56 100644
--- a/editeng/source/editeng/impedit2.cxx
+++ b/editeng/source/editeng/impedit2.cxx
@@ -2232,7 +2232,9 @@ EditPaM ImpEditEngine::ImpConnectParagraphs( ContentNode* pLeft, ContentNode* pR
if ( bBackward )
{
pLeft->SetStyleSheet( pRight->GetStyleSheet() );
- pLeft->GetContentAttribs().GetItems().Set( pRight->GetContentAttribs().GetItems() );
+ // it feels wrong to set pLeft's attribs if pRight is empty, tdf#128046
+ if ( pRight->Len() )
+ pLeft->GetContentAttribs().GetItems().Set( pRight->GetContentAttribs().GetItems() );
pLeft->GetCharAttribs().GetDefFont() = pRight->GetCharAttribs().GetDefFont();
}
@@ -3489,7 +3491,7 @@ uno::Reference< datatransfer::XTransferable > ImpEditEngine::CreateTransferable(
std::filebuf afilebuf;
afilebuf.open ("gsoc17_clipboard_test.xml",std::ios::out);
std::ostream os(&afilebuf);
- os.write((const char*)(pDataObj->GetODFStream().GetBuffer()), pDataObj->GetODFStream().remainingSize());
+ os.write((const char*)(pDataObj->GetODFStream().GetData()), pDataObj->GetODFStream().remainingSize());
afilebuf.close();
*/
//dumping ends