diff options
author | Sarper Akdemir <sarper.akdemir.extern@allotropia.de> | 2023-07-31 14:05:08 +0300 |
---|---|---|
committer | Sarper Akdemir <sarper.akdemir.extern@allotropia.de> | 2023-08-29 11:06:37 +0200 |
commit | 7b5327ffcb18a4b4f456afecea313039dd79449a (patch) | |
tree | fef877bbbcf7b9871ed3fe691bfc9d8cd3bcebac | |
parent | e9bb17369dc6fd3064fce55a1afacaacea4faae2 (diff) |
tdf#103706: tdf#142857: sw: context aware paste for clone format
Introduces selection aware pasting for Writer's Clone Format
where paragraph properties are applied when the selection
contains a whole paragraph or there's no selection at all (i.e.
clone format applied with just a left click - without drag).
Change-Id: I9f3eedb4544bf53dabed4bb659ce2e44313a692a
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155107
Tested-by: Jenkins
Reviewed-by: Sarper Akdemir <sarper.akdemir.extern@allotropia.de>
-rw-r--r-- | sw/source/uibase/docvw/edtwin.cxx | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/sw/source/uibase/docvw/edtwin.cxx b/sw/source/uibase/docvw/edtwin.cxx index aa97df53e8ab..ba05f034cafd 100644 --- a/sw/source/uibase/docvw/edtwin.cxx +++ b/sw/source/uibase/docvw/edtwin.cxx @@ -5102,7 +5102,10 @@ void SwEditWin::MouseButtonUp(const MouseEvent& rMEvt) SwWrtShell& rWrtShell = m_rView.GetWrtShell(); SfxStyleSheetBasePool* pPool=nullptr; bool bNoCharacterFormats = false; - bool bNoParagraphFormats = false; + // Paste paragraph properties if the selection contains a whole paragraph or + // there was no selection at all (i.e. just a left click) + bool bNoParagraphFormats = rSh.HasSelection() && rSh.IsSelOnePara() && !rSh.IsSelFullPara(); + { SwDocShell* pDocSh = m_rView.GetDocShell(); if(pDocSh) |