summaryrefslogtreecommitdiff
path: root/sd/source/ui/func
diff options
context:
space:
mode:
authorOliver Specht <oliver.specht@cib.de>2024-03-07 12:47:22 +0100
committerThorsten Behrens <thorsten.behrens@allotropia.de>2024-03-07 21:48:37 +0100
commitdbb05dc818afb08b3e05ac62bd92389a5cf90fa7 (patch)
tree46e4f86a031dba6495095153eee1ea1237947d8e /sd/source/ui/func
parentbfb6904d8c0b054409faf8469752b033d7c2955a (diff)
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>
Diffstat (limited to 'sd/source/ui/func')
-rw-r--r--sd/source/ui/func/fuformatpaintbrush.cxx7
1 files changed, 6 insertions, 1 deletions
diff --git a/sd/source/ui/func/fuformatpaintbrush.cxx b/sd/source/ui/func/fuformatpaintbrush.cxx
index 930e75233f32..89eecc13f989 100644
--- a/sd/source/ui/func/fuformatpaintbrush.cxx
+++ b/sd/source/ui/func/fuformatpaintbrush.cxx
@@ -45,6 +45,9 @@ bool ShouldPasteParaFormatPerSelection(const OutlinerView* pOLV)
if(!pOLV)
return true;
+ if(!pOLV->GetEditView().HasSelection())
+ return true;
+
if(!pOLV->GetEditView().IsSelectionWithinSinglePara())
return false;
@@ -286,7 +289,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 );