sd/source/ui/func/fuformatpaintbrush.cxx |   13 ++++++++++---
 svx/source/svdraw/svdedxv.cxx            |    5 +----
 2 files changed, 11 insertions(+), 7 deletions(-)

New commits:
commit f828a9fe44bfef9af58035340b6d6afd67d5a870
Author:     Oliver Specht <oliver.spe...@cib.de>
AuthorDate: Thu Jul 18 07:32:57 2024 +0200
Commit:     Gabor Kelemen <gabor.kelemen.ext...@allotropia.de>
CommitDate: Mon Aug 5 16:44:04 2024 +0200

    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.ext...@allotropia.de>
    Reviewed-by: Gabor Kelemen <gabor.kelemen.ext...@allotropia.de>

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 ec938c51c320..b2d7cb85bd9d 100644
--- a/svx/source/svdraw/svdedxv.cxx
+++ b/svx/source/svdraw/svdedxv.cxx
@@ -2919,10 +2919,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)

Reply via email to