summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOliver Specht <oliver.specht@cib.de>2024-07-18 07:32:57 +0200
committerChristian Lohmaier <lohmaier+LibreOffice@googlemail.com>2024-08-23 13:14:12 +0200
commitc14b39084f596ed3a12057c85c27f2e900d6cced (patch)
tree862f8cbe934377c0e1a501dd0b5b9d475047f0f3
parentc59518656a7f96bf4fb79332d1160765a84f9153 (diff)
tdf#162065 Fix format paintbrush in draw/impress
With tdf#160069 the format paintbrush was disabled outside of text selection and with tdf#160069 target selection was reduced to text only. The change of tdf#160069 is mostly undone with this patch. Change-Id: I8e23ef56206c6749913e2c95870537c3e378f946 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/170672 Tested-by: Jenkins Tested-by: Gabor Kelemen <gabor.kelemen.extern@allotropia.de> Reviewed-by: Gabor Kelemen <gabor.kelemen.extern@allotropia.de> (cherry picked from commit f828a9fe44bfef9af58035340b6d6afd67d5a870) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/172125 Reviewed-by: Christian Lohmaier <lohmaier+LibreOffice@googlemail.com>
-rw-r--r--sd/source/ui/func/fuformatpaintbrush.cxx13
-rw-r--r--svx/source/svdraw/svdedxv.cxx5
2 files changed, 11 insertions, 7 deletions
diff --git a/sd/source/ui/func/fuformatpaintbrush.cxx b/sd/source/ui/func/fuformatpaintbrush.cxx
index 8f41b6344d53..f41b4278c28f 100644
--- a/sd/source/ui/func/fuformatpaintbrush.cxx
+++ b/sd/source/ui/func/fuformatpaintbrush.cxx
@@ -62,7 +62,7 @@ FuFormatPaintBrush::FuFormatPaintBrush( ViewShell* pViewSh, ::sd::Window* pWin,
: FuText(pViewSh, pWin, pView, pDoc, rReq)
, mnDepth(-1)
, mbPermanent( false )
-, mbOldIsQuickTextEditMode( true )
+ , mbOldIsQuickTextEditMode(true)
{
}
@@ -145,6 +145,14 @@ bool FuFormatPaintBrush::MouseButtonDown(const MouseEvent& rMEvt)
}
unmarkimpl( mpView );
+
+ if (aVEvt.mpObj)
+ {
+ sal_uInt16 nHitLog = sal_uInt16 ( mpWindow->PixelToLogic(Size(HITPIX,0)).Width() );
+ mpView->MarkObj(mpWindow->PixelToLogic( rMEvt.GetPosPixel() ), nHitLog, false/*bToggle*/);
+ return true;
+ }
+
}
return false;
}
@@ -282,8 +290,7 @@ void FuFormatPaintBrush::Paste( bool bNoCharacterFormats, bool bNoParagraphForma
if( rMarkList.GetMarkCount() == 1 )
{
SdrObject* pObj = rMarkList.GetMark(0)->GetMarkedSdrObj();
- const OutlinerView* pOLV = rDrawViewShell.GetDrawView()->GetTextEditOutlinerView();
- if( pObj && pOLV &&
+ if (pObj &&
SdrObjEditView::SupportsFormatPaintbrush(pObj->GetObjInventor(),pObj->GetObjIdentifier()) )
return;
}
diff --git a/svx/source/svdraw/svdedxv.cxx b/svx/source/svdraw/svdedxv.cxx
index 6071fbc042bd..6eea9d2a6292 100644
--- a/svx/source/svdraw/svdedxv.cxx
+++ b/svx/source/svdraw/svdedxv.cxx
@@ -2909,10 +2909,7 @@ sal_Int32 SdrObjEditView::TakeFormatPaintBrush(std::shared_ptr<SfxItemSet>& rFor
return nDepth;
OutlinerView* pOLV = GetTextEditOutlinerView();
-
- bool isParaSelection
- = pOLV ? !pOLV->GetEditView().HasSelection() || pOLV->GetEditView().IsSelectionFullPara()
- : false;
+ bool isParaSelection = pOLV ? pOLV->GetEditView().IsSelectionFullPara() : false;
rFormatSet = std::make_shared<SfxItemSet>(GetModel().GetItemPool(),
GetFormatRangeImpl(pOLV != nullptr, isParaSelection));
if (pOLV)