diff options
author | Oliver Specht <oliver.specht@cib.de> | 2024-03-07 12:47:22 +0100 |
---|---|---|
committer | Thorsten Behrens <thorsten.behrens@allotropia.de> | 2024-04-30 15:10:42 +0200 |
commit | bdf7857602c16959b9ebdccdcb866a61bf46765f (patch) | |
tree | 12e57e07a6652d1c844d8be74e8a3d6c18b084f6 | |
parent | tdf#155218 sc: fix regression page orientation in print dialog (diff) | |
download | core-bdf7857602c16959b9ebdccdcb866a61bf46765f.tar.gz core-bdf7857602c16959b9ebdccdcb866a61bf46765f.zip |
tdf#159726 Improve Clone formatting
Paragraph attributes and lists are copied if there is no source
selection or the source selection includes at least a full paragraph.
They are only applied to an empty or a paragraph selection.
As in tdf#160069 requested the clone formatting function is only enabled
in text edit mode.
Change-Id: I789402a7928837bb85ec941fd6f958d12585ac40
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/164533
Tested-by: Thorsten Behrens <thorsten.behrens@allotropia.de>
Reviewed-by: Thorsten Behrens <thorsten.behrens@allotropia.de>
(cherry picked from commit 456d0216aae69c39b12a5df749525589871272a7)
-rw-r--r-- | sd/source/ui/func/fuformatpaintbrush.cxx | 4 | ||||
-rw-r--r-- | svx/source/svdraw/svdedxv.cxx | 4 |
2 files changed, 6 insertions, 2 deletions
diff --git a/sd/source/ui/func/fuformatpaintbrush.cxx b/sd/source/ui/func/fuformatpaintbrush.cxx index 9bbd30939d53..ef1ea258c78f 100644 --- a/sd/source/ui/func/fuformatpaintbrush.cxx +++ b/sd/source/ui/func/fuformatpaintbrush.cxx @@ -290,7 +290,9 @@ void FuFormatPaintBrush::Paste( bool bNoCharacterFormats, bool bNoParagraphForma if( rMarkList.GetMarkCount() == 1 ) { SdrObject* pObj = rMarkList.GetMark(0)->GetMarkedSdrObj(); - if( pObj && SdrObjEditView::SupportsFormatPaintbrush(pObj->GetObjInventor(),pObj->GetObjIdentifier()) ) + const OutlinerView* pOLV = rDrawViewShell.GetDrawView()->GetTextEditOutlinerView(); + if( pObj && pOLV && + SdrObjEditView::SupportsFormatPaintbrush(pObj->GetObjInventor(),pObj->GetObjIdentifier()) ) return; } rSet.DisableItem( SID_FORMATPAINTBRUSH ); diff --git a/svx/source/svdraw/svdedxv.cxx b/svx/source/svdraw/svdedxv.cxx index 486b9e338cc8..ce801f796d4a 100644 --- a/svx/source/svdraw/svdedxv.cxx +++ b/svx/source/svdraw/svdedxv.cxx @@ -2896,7 +2896,9 @@ sal_Int32 SdrObjEditView::TakeFormatPaintBrush(std::shared_ptr<SfxItemSet>& rFor OutlinerView* pOLV = GetTextEditOutlinerView(); - bool isParaSelection = pOLV ? pOLV->GetEditView().IsSelectionFullPara() : false; + bool isParaSelection + = pOLV ? !pOLV->GetEditView().HasSelection() || pOLV->GetEditView().IsSelectionFullPara() + : false; rFormatSet = std::make_shared<SfxItemSet>(GetModel().GetItemPool(), GetFormatRangeImpl(pOLV != nullptr, isParaSelection)); if (pOLV) |