Improve clone formatting

Follow-up to 178d8a38e1
Makes sure that without selection at target position only
character attributes are copied

Change-Id: I677b1ef29855fb2cf4c42a7b821678ecdd37c7f6
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/164430
Tested-by: Jenkins
Tested-by: Gabor Kelemen <gabor.kelemen.extern@allotropia.de>
Reviewed-by: Thorsten Behrens <thorsten.behrens@allotropia.de>
This commit is contained in:
Oliver Specht 2024-03-05 15:42:18 +01:00 committed by Thorsten Behrens
parent 98c42f7e96
commit bea5341c22

View file

@ -40,17 +40,13 @@
namespace namespace
{ {
// Paragraph properties are pasted if the selection contains a whole paragraph // Paragraph properties are pasted if the selection contains a whole paragraph
// or there was no selection at all (i.e. just a left click)
bool ShouldPasteParaFormatPerSelection(const OutlinerView* pOLV) bool ShouldPasteParaFormatPerSelection(const OutlinerView* pOLV)
{ {
if(!pOLV) if(!pOLV)
return true; return true;
if(!pOLV->GetEditView().HasSelection())
return true;
if(!pOLV->GetEditView().IsSelectionWithinSinglePara()) if(!pOLV->GetEditView().IsSelectionWithinSinglePara())
return true; return false;
return pOLV->GetEditView().IsSelectionFullPara(); return pOLV->GetEditView().IsSelectionFullPara();
} }