core.git: Branch 'libreoffice-24-2' - svx/source

2024-05-17 Thread Noel Grandin (via logerrit)
 svx/source/dialog/framelinkarray.cxx |8 
 1 file changed, 4 insertions(+), 4 deletions(-)

New commits:
commit ab69de0e0aa0c9e48355c9db36c8aa9b93f235d4
Author: Noel Grandin 
AuthorDate: Tue May 14 09:08:16 2024 +0200
Commit: Xisco Fauli 
CommitDate: Fri May 17 13:34:44 2024 +0200

tdf#161019 tdf#159846 spreadsheet border rendering

regression from
commit e27d4cc31e04be4c47b5085dfa2363ee45457e8a
Author: Noel Grandin 
Date:   Mon Jun 19 12:23:55 2023 +0200
tdf#150534 reduce the memory consumption of cells when calculating

Change-Id: Id8b52a3a0880bbb6a7aff28f55bcd57cb1cae048
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/167617
Tested-by: Jenkins
Reviewed-by: Noel Grandin 
(cherry picked from commit 6f8a73a379d97829080367b21d54f9b5fab781c9)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/167682
Reviewed-by: Xisco Fauli 

diff --git a/svx/source/dialog/framelinkarray.cxx 
b/svx/source/dialog/framelinkarray.cxx
index fa5829438698..897012611151 100644
--- a/svx/source/dialog/framelinkarray.cxx
+++ b/svx/source/dialog/framelinkarray.cxx
@@ -936,7 +936,7 @@ void Array::SetAddMergedLeftSize( sal_Int32 nCol, sal_Int32 
nRow, sal_Int32 nAdd
 return;
 Cell aTempCell(*pTempCell);
 aTempCell.mnAddLeft = nAddSize;
-mxImpl->PutCell( nCol, nRow, aTempCell );
+mxImpl->PutCell( aIt.Col(), aIt.Row(), aTempCell );
 }
 }
 
@@ -951,7 +951,7 @@ void Array::SetAddMergedRightSize( sal_Int32 nCol, 
sal_Int32 nRow, sal_Int32 nAd
 return;
 Cell aTempCell(*pTempCell);
 aTempCell.mnAddRight = nAddSize;
-mxImpl->PutCell( nCol, nRow, aTempCell );
+mxImpl->PutCell( aIt.Col(), aIt.Row(), aTempCell );
 }
 }
 
@@ -966,7 +966,7 @@ void Array::SetAddMergedTopSize( sal_Int32 nCol, sal_Int32 
nRow, sal_Int32 nAddS
 return;
 Cell aTempCell(*pTempCell);
 aTempCell.mnAddTop = nAddSize;
-mxImpl->PutCell( nCol, nRow, aTempCell );
+mxImpl->PutCell( aIt.Col(), aIt.Row(), aTempCell );
 }
 }
 
@@ -981,7 +981,7 @@ void Array::SetAddMergedBottomSize( sal_Int32 nCol, 
sal_Int32 nRow, sal_Int32 nA
 return;
 Cell aTempCell(*pTempCell);
 aTempCell.mnAddBottom = nAddSize;
-mxImpl->PutCell( nCol, nRow, aTempCell );
+mxImpl->PutCell( aIt.Col(), aIt.Row(), aTempCell );
 }
 }
 


core.git: Branch 'libreoffice-24-2' - svx/source

2024-05-06 Thread Xisco Fauli (via logerrit)
 svx/source/dialog/svxruler.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 35c0afcf0a0428670e3e1998f222440b504ae0c8
Author: Xisco Fauli 
AuthorDate: Thu Apr 25 15:52:29 2024 +0200
Commit: Aron Budea 
CommitDate: Tue May 7 03:42:38 2024 +0200

svx: Avoid divide by 0

See 
https://crashreport.libreoffice.org/stats/signature/SvxRuler::UpdateTabs()

Change-Id: Ie08c54d1a1b40bcc42da9f81c893f496fff433a8
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/166626
Tested-by: Jenkins
Tested-by: Caolán McNamara 
Reviewed-by: Caolán McNamara 
(cherry picked from commit 90548039f09d4bc773bf6879a62d544adfa175db)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/166674
Reviewed-by: Aron Budea 

diff --git a/svx/source/dialog/svxruler.cxx b/svx/source/dialog/svxruler.cxx
index 6323583fd271..17c4edaa930d 100644
--- a/svx/source/dialog/svxruler.cxx
+++ b/svx/source/dialog/svxruler.cxx
@@ -1033,7 +1033,7 @@ void SvxRuler::UpdateTabs()
 lCurrentDefTabDist = mxTabStopItem->GetDefaultDistance();
 tools::Long nDefTabDist = ConvertHPosPixel(lCurrentDefTabDist);
 
-const sal_uInt16 nDefTabBuf = lPosPixel > lRightIndent || lLastTab > 
lRightIndent
+const sal_uInt16 nDefTabBuf = lPosPixel > lRightIndent || lLastTab > 
lRightIndent || nDefTabDist == 0
 ? 0
 : static_cast( (lRightIndent - lPosPixel) / 
nDefTabDist );
 


core.git: Branch 'libreoffice-24-2' - svx/source

2024-05-02 Thread Caolán McNamara (via logerrit)
 svx/source/dialog/optgrid.cxx |   24 +---
 1 file changed, 13 insertions(+), 11 deletions(-)

New commits:
commit cd7ee2410a42da4b702cb32f57e038ba7d9f0854
Author: Caolán McNamara 
AuthorDate: Wed May 1 20:27:00 2024 +0100
Commit: Xisco Fauli 
CommitDate: Thu May 2 12:31:32 2024 +0200

always check return of SfxViewFrame::Current()

Change-Id: If35fe03c775aec12ec534d02d58596aebcec764f
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/166985
Tested-by: Jenkins
Reviewed-by: Caolán McNamara 
(cherry picked from commit caf719c59c6dc8db2b6a0eab8d47760277f112a3)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/166902
Reviewed-by: Michael Stahl 

diff --git a/svx/source/dialog/optgrid.cxx b/svx/source/dialog/optgrid.cxx
index 2226eaa4e23c..66ddc8c4e5e8 100644
--- a/svx/source/dialog/optgrid.cxx
+++ b/svx/source/dialog/optgrid.cxx
@@ -161,17 +161,19 @@ SvxGridTabPage::SvxGridTabPage(weld::Container* pPage, 
weld::DialogController* p
 
 if (m_Emode != HTML_MODE)
 {
-SfxViewFrame* pCurrent = SfxViewFrame::Current();
-OUString aModuleName = 
vcl::CommandInfoProvider::GetModuleIdentifier(pCurrent->GetFrame().GetFrameInterface());
-std::u16string_view sModulename = 
aModuleName.subView(aModuleName.lastIndexOf('.') + 1);
-if (sModulename.starts_with(u"Text"))
-m_Emode = WRITER_MODE;
-else if (sModulename.starts_with(u"Spreadsheet"))
-m_Emode = CALC_MODE;
-else if (sModulename.starts_with(u"Presentation"))
-m_Emode = IMPRESS_MODE;
-else if (sModulename.starts_with(u"Drawing"))
-m_Emode = DRAW_MODE;
+if (SfxViewFrame* pCurrent = SfxViewFrame::Current())
+{
+OUString aModuleName = 
vcl::CommandInfoProvider::GetModuleIdentifier(pCurrent->GetFrame().GetFrameInterface());
+std::u16string_view sModulename = 
aModuleName.subView(aModuleName.lastIndexOf('.') + 1);
+if (sModulename.starts_with(u"Text"))
+m_Emode = WRITER_MODE;
+else if (sModulename.starts_with(u"Spreadsheet"))
+m_Emode = CALC_MODE;
+else if (sModulename.starts_with(u"Presentation"))
+m_Emode = IMPRESS_MODE;
+else if (sModulename.starts_with(u"Drawing"))
+m_Emode = DRAW_MODE;
+}
 }
 
 m_xCbxRotate->connect_toggled(LINK(this, SvxGridTabPage, 
ClickRotateHdl_Impl));


core.git: Branch 'libreoffice-24-2' - svx/source

2024-04-12 Thread Michael Weghorn (via logerrit)
 svx/source/form/fmpage.cxx |   31 +++
 1 file changed, 15 insertions(+), 16 deletions(-)

New commits:
commit d1c29054449b00a16da6ee7ecaef0a94fe3964bf
Author: Michael Weghorn 
AuthorDate: Thu Apr 11 11:02:41 2024 +0200
Commit: Adolfo Jayme Barrientos 
CommitDate: Fri Apr 12 08:08:06 2024 +0200

tdf#160176 svx: Reset help text when form control has none

In `FmFormPage::RequestHelp`, also call
`Help::ShowQuickHelp`/`Help::ShowBalloon` when
the help text is empty, as that is the way to
unset the help text/remove the tooltip again,
see `ImplShowHelpWindow` in `vcl/source/app/help.cxx`:

For the case of non-native tooltips (e.g. the
gen VCL plugin on Linux), the `bRemoveHelp = true`
code path is relevant.
For qt5/qt6/kf5/kf6 which use native tooltips,
the call to

pParent->ImplGetFrame()->ShowTooltip(rHelpText, rHelpArea)

further up sets the `QtFrame`'s `m_aTooltipText` member
to an empty string, which prevents showing the outdated
help text for the `QEvent::ToolTip` event in
`QtWidget::handleEvent`.

Change-Id: Iceb2424d9c72ae46333a718c677629122e517f11
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/166006
Tested-by: Jenkins
Reviewed-by: Michael Weghorn 
(cherry picked from commit 6347c89711903834cc9188abda5d5a253053b789)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/165933
Reviewed-by: Adolfo Jayme Barrientos 

diff --git a/svx/source/form/fmpage.cxx b/svx/source/form/fmpage.cxx
index 8c24f3cc22ae..6e4f2093d011 100644
--- a/svx/source/form/fmpage.cxx
+++ b/svx/source/form/fmpage.cxx
@@ -139,22 +139,21 @@ bool FmFormPage::RequestHelp( vcl::Window* pWindow, 
SdrView const * pView,
 }
 }
 }
-if ( !aHelpText.isEmpty() )
-{
-// display the help
-tools::Rectangle aItemRect = pObj->GetCurrentBoundRect();
-aItemRect = pWindow->LogicToPixel( aItemRect );
-Point aPt = pWindow->OutputToScreenPixel( aItemRect.TopLeft() );
-aItemRect.SetLeft( aPt.X() );
-aItemRect.SetTop( aPt.Y() );
-aPt = pWindow->OutputToScreenPixel( aItemRect.BottomRight() );
-aItemRect.SetRight( aPt.X() );
-aItemRect.SetBottom( aPt.Y() );
-if( rEvt.GetMode() == HelpEventMode::BALLOON )
-Help::ShowBalloon( pWindow, aItemRect.Center(), aItemRect, 
aHelpText);
-else
-Help::ShowQuickHelp( pWindow, aItemRect, aHelpText );
-}
+
+// display the help
+tools::Rectangle aItemRect = pObj->GetCurrentBoundRect();
+aItemRect = pWindow->LogicToPixel( aItemRect );
+Point aPt = pWindow->OutputToScreenPixel( aItemRect.TopLeft() );
+aItemRect.SetLeft( aPt.X() );
+aItemRect.SetTop( aPt.Y() );
+aPt = pWindow->OutputToScreenPixel( aItemRect.BottomRight() );
+aItemRect.SetRight( aPt.X() );
+aItemRect.SetBottom( aPt.Y() );
+if( rEvt.GetMode() == HelpEventMode::BALLOON )
+Help::ShowBalloon( pWindow, aItemRect.Center(), aItemRect, aHelpText);
+else
+Help::ShowQuickHelp( pWindow, aItemRect, aHelpText );
+
 return true;
 }
 


core.git: Branch 'libreoffice-24-2' - svx/source

2024-04-01 Thread Patrick Luby (via logerrit)
 svx/source/svdraw/svdpntv.cxx |7 ++-
 1 file changed, 6 insertions(+), 1 deletion(-)

New commits:
commit 4241a641a433511ae9c3e1795de445a25eab14d8
Author: Patrick Luby 
AuthorDate: Mon Apr 1 10:01:03 2024 -0400
Commit: Adolfo Jayme Barrientos 
CommitDate: Tue Apr 2 01:36:49 2024 +0200

tdf#160444 check device's owner window is a nullptr

Since commit 563f7077f1dbce31ff95ee8d2e8d17b629693db1, the
device's owner window gets deleted before this object is
deleted.

Change-Id: I15dc8db60e5520c2f0e73a9a117f25af15845caf
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/165637
Tested-by: Jenkins
Reviewed-by: Patrick Luby 
(cherry picked from commit d034036a049d6dcc8dc62a8e44c1e4befcaa25b0)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/165623
Reviewed-by: Adolfo Jayme Barrientos 

diff --git a/svx/source/svdraw/svdpntv.cxx b/svx/source/svdraw/svdpntv.cxx
index f0928872509a..780227f4a117 100644
--- a/svx/source/svdraw/svdpntv.cxx
+++ b/svx/source/svdraw/svdpntv.cxx
@@ -858,7 +858,12 @@ void SdrPaintView::InvalidateAllWin(const 
tools::Rectangle& rRect)
 void SdrPaintView::InvalidateOneWin(OutputDevice& rDevice)
 {
 // do not erase background, that causes flicker (!)
-rDevice.GetOwnerWindow()->Invalidate(InvalidateFlags::NoErase);
+// tdf#160444 check device's owner window is a nullptr
+// Since commit 563f7077f1dbce31ff95ee8d2e8d17b629693db1, the
+// device's owner window gets deleted before this object is
+// deleted.
+if (rDevice.GetOwnerWindow())
+rDevice.GetOwnerWindow()->Invalidate(InvalidateFlags::NoErase);
 }
 
 void SdrPaintView::InvalidateOneWin(OutputDevice& rDevice, const 
tools::Rectangle& rRect)


core.git: Branch 'libreoffice-24-2' - svx/source

2024-03-05 Thread Caolán McNamara (via logerrit)
 svx/source/form/labelitemwindow.cxx |2 ++
 1 file changed, 2 insertions(+)

New commits:
commit 1b030b6938352c4babcbf56d598c07efa714f103
Author: Caolán McNamara 
AuthorDate: Mon Mar 4 10:57:18 2024 +
Commit: Michael Stahl 
CommitDate: Tue Mar 5 12:15:18 2024 +0100

GLib-GObject-CRITICAL **: gsignal.c:2778: instance X has no handler with id 
Y

Change-Id: I4fbbd4af0ed1605874e2ef2694ecda0a9e107a07
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/164370
Tested-by: Jenkins
Reviewed-by: Michael Stahl 

diff --git a/svx/source/form/labelitemwindow.cxx 
b/svx/source/form/labelitemwindow.cxx
index c9afd1534acc..91d9f99c0ce9 100644
--- a/svx/source/form/labelitemwindow.cxx
+++ b/svx/source/form/labelitemwindow.cxx
@@ -58,7 +58,9 @@ OUString LabelItemWindow::get_label() const { return 
m_xLabel->get_label(); }
 
 void LabelItemWindow::dispose()
 {
+m_xImage.reset();
 m_xLabel.reset();
+m_xBox.reset();
 InterimItemWindow::dispose();
 }
 


core.git: Branch 'libreoffice-24-2' - svx/source

2024-03-03 Thread Caolán McNamara (via logerrit)
 svx/source/svdraw/svdotextdecomposition.cxx |   40 +++-
 1 file changed, 33 insertions(+), 7 deletions(-)

New commits:
commit d768e6e376b7828e3a306a97b789a76f85f9f3b9
Author: Caolán McNamara 
AuthorDate: Sun Mar 3 14:53:19 2024 +
Commit: Adolfo Jayme Barrientos 
CommitDate: Sun Mar 3 20:35:56 2024 +0100

Resolves: tdf#159696 Small capitals with 'Individual words' underlining

Change-Id: I79af3f74ef384f734273b00bddbcfed8952a3ad2
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/164275
Tested-by: Jenkins
Reviewed-by: Adolfo Jayme Barrientos 

diff --git a/svx/source/svdraw/svdotextdecomposition.cxx 
b/svx/source/svdraw/svdotextdecomposition.cxx
index 1bad74cebb70..a74c6d5b8f3a 100644
--- a/svx/source/svdraw/svdotextdecomposition.cxx
+++ b/svx/source/svdraw/svdotextdecomposition.cxx
@@ -35,6 +35,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -328,13 +329,38 @@ namespace
 const 
drawinglayer::primitive2d::TextDecoratedPortionPrimitive2D* pTCPP =
 static_cast(pNewPrimitive.get());
 
-pTCPP->CreateDecorationGeometryContent(
-aContainer,
-pTCPP->getTextTransform(),
-caseMappedText,
-rInfo.mnTextStart,
-rInfo.mnTextLen,
-aDXArray);
+if (pTCPP->getWordLineMode()) // single word mode: 'Individual 
words' in UI
+{
+// Split to single word primitives using TextBreakupHelper
+drawinglayer::primitive2d::TextBreakupHelper 
aTextBreakupHelper(*pTCPP);
+drawinglayer::primitive2d::Primitive2DContainer 
aBroken(aTextBreakupHelper.extractResult(drawinglayer::primitive2d::BreakupUnit::Word));
+for (auto& rPortion : aBroken)
+{
+assert(rPortion->getPrimitive2DID() == 
PRIMITIVE2D_ID_TEXTDECORATEDPORTIONPRIMITIVE2D &&
+   "TextBreakupHelper generates same output 
primitive type as input");
+
+const 
drawinglayer::primitive2d::TextDecoratedPortionPrimitive2D* pPortion =
+static_cast(rPortion.get());
+
+pPortion->CreateDecorationGeometryContent(
+aContainer,
+pPortion->getTextTransform(),
+caseMappedText,
+pPortion->getTextPosition(),
+pPortion->getTextLength(),
+pPortion->getDXArray());
+}
+}
+else
+{
+pTCPP->CreateDecorationGeometryContent(
+aContainer,
+pTCPP->getTextTransform(),
+caseMappedText,
+rInfo.mnTextStart,
+rInfo.mnTextLen,
+aDXArray);
+}
 }
 
 pNewPrimitive = new 
drawinglayer::primitive2d::GroupPrimitive2D(std::move(aContainer));


core.git: Branch 'libreoffice-24-2' - svx/source

2024-02-12 Thread Noel Grandin (via logerrit)
 svx/source/svdraw/svdhdl.cxx |  101 +--
 1 file changed, 51 insertions(+), 50 deletions(-)

New commits:
commit bcf75e6f07daa7e5444071d87b469f443aa7ef83
Author: Noel Grandin 
AuthorDate: Mon Feb 12 12:54:06 2024 +0200
Commit: Xisco Fauli 
CommitDate: Mon Feb 12 17:21:12 2024 +0100

tdf#159666 Crash when table and line object are selected at the same time

before
commit e3077168072452fb8f1c0a8afb2992877cb96d1c
Author: Noel Grandin 
Date:   Thu Jun 17 09:49:37 2021 +0200
loplugin:finalclasses
the cast in
   const SdrEdgeObj* pEdge = static_cast(m_pObj);
would incorrectly cast a SdrTableObj, but it happened to do nothing
problematic.

After the above commit, the vtable layout changed and it started
crashing.

Work around it by use dynamic_cast and ignoring objects that are not
SdrEdgeObj.

Change-Id: Ibe03d4935b8eeb182e037b1648d841e26fa23ed4
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/163242
Tested-by: Jenkins
Reviewed-by: Noel Grandin 
(cherry picked from commit bac09f76fd903c109b591a7bc15883e5653715ee)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/163187
Reviewed-by: Xisco Fauli 

diff --git a/svx/source/svdraw/svdhdl.cxx b/svx/source/svdraw/svdhdl.cxx
index 867afa6a90b8..c8f1fa3159b7 100644
--- a/svx/source/svdraw/svdhdl.cxx
+++ b/svx/source/svdraw/svdhdl.cxx
@@ -1604,66 +1604,67 @@ ImpEdgeHdl::~ImpEdgeHdl()
 
 void ImpEdgeHdl::CreateB2dIAObject()
 {
-if(m_nObjHdlNum <= 1 && m_pObj)
+if(m_nObjHdlNum > 1 || !m_pObj)
 {
-// first throw away old one
-GetRidOfIAObject();
+// call parent
+SdrHdl::CreateB2dIAObject();
+return;
+}
 
-BitmapColorIndex eColIndex = BitmapColorIndex::LightCyan;
-BitmapMarkerKind eKindOfMarker = BitmapMarkerKind::Rect_7x7;
+// first throw away old one
+GetRidOfIAObject();
 
-if(m_pHdlList)
-{
-SdrMarkView* pView = m_pHdlList->GetView();
+BitmapColorIndex eColIndex = BitmapColorIndex::LightCyan;
+BitmapMarkerKind eKindOfMarker = BitmapMarkerKind::Rect_7x7;
 
-if(pView && !pView->areMarkHandlesHidden())
-{
-const SdrEdgeObj* pEdge = static_cast(m_pObj);
+if(!m_pHdlList)
+return;
 
-if(pEdge->GetConnectedNode(m_nObjHdlNum == 0) != nullptr)
-eColIndex = BitmapColorIndex::LightRed;
+SdrMarkView* pView = m_pHdlList->GetView();
 
-if(m_nPPntNum < 2)
-{
-// Handle with plus sign inside
-eKindOfMarker = BitmapMarkerKind::Circ_7x7;
-}
+if(!pView || pView->areMarkHandlesHidden())
+return;
 
-SdrPageView* pPageView = pView->GetSdrPageView();
+// tdf#159666 Crash when table and line object are selected at the same 
time
+auto pEdge = dynamic_cast(m_pObj);
+if (!pEdge)
+return;
 
-if(pPageView)
-{
-for(sal_uInt32 b(0); b < pPageView->PageWindowCount(); b++)
-{
-const SdrPageWindow& rPageWindow = 
*pPageView->GetPageWindow(b);
-
-if(rPageWindow.GetPaintWindow().OutputToWindow())
-{
-const rtl::Reference< sdr::overlay::OverlayManager 
>& xManager = rPageWindow.GetOverlayManager();
-if (xManager.is())
-{
-basegfx::B2DPoint aPosition(m_aPos.X(), 
m_aPos.Y());
-std::unique_ptr 
pNewOverlayObject(CreateOverlayObject(
-aPosition,
-eColIndex,
-eKindOfMarker));
-
-// OVERLAYMANAGER
-insertNewlyCreatedOverlayObjectForSdrHdl(
-std::move(pNewOverlayObject),
-rPageWindow.GetObjectContact(),
-*xManager);
-}
-}
-}
-}
-}
-}
+if(pEdge->GetConnectedNode(m_nObjHdlNum == 0) != nullptr)
+eColIndex = BitmapColorIndex::LightRed;
+
+if(m_nPPntNum < 2)
+{
+// Handle with plus sign inside
+eKindOfMarker = BitmapMarkerKind::Circ_7x7;
 }
-else
+
+SdrPageView* pPageView = pView->GetSdrPageView();
+if(!pPageView)
+return;
+
+for(sal_uInt32 b(0); b < pPageView->PageWindowCount(); b++)
 {
-// call parent
-SdrHdl::CreateB2dIAObject();
+const SdrPageWindow& rPageWindow = *pPageView->GetPageWindow(b);
+
+

core.git: Branch 'libreoffice-24-2' - svx/source

2024-02-12 Thread Regina Henschel (via logerrit)
 svx/source/sdr/contact/viewcontactofsdrpage.cxx |6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

New commits:
commit f05bc0cf6c9fdba682a0aee4e3a06b093ae345da
Author: Regina Henschel 
AuthorDate: Fri Feb 9 15:02:41 2024 +0100
Commit: Xisco Fauli 
CommitDate: Mon Feb 12 11:48:37 2024 +0100

tdf#156993 use correct count for ViewContactOfSdrPage

The count is used as upper limit in a for-loop in
ViewObjectContact::getPrimitive2DSequenceSubHierarchy().
That calls ViewContactOfSdrPage::GetViewContact().
With the wrong count the case 10 was not reached and thus the helplines
were not drawn.

Change-Id: If606bbb718b1f78a874862217d1e03b02287e848
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/163192
Tested-by: Jenkins
Reviewed-by: Regina Henschel 
(cherry picked from commit 56517d8a38459f5a9e67327c1ac0dc8bcd07bcb8)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/163180
Reviewed-by: Xisco Fauli 

diff --git a/svx/source/sdr/contact/viewcontactofsdrpage.cxx 
b/svx/source/sdr/contact/viewcontactofsdrpage.cxx
index 43ca1fd5c06f..dfef01d30410 100644
--- a/svx/source/sdr/contact/viewcontactofsdrpage.cxx
+++ b/svx/source/sdr/contact/viewcontactofsdrpage.cxx
@@ -515,10 +515,10 @@ sal_uInt32 ViewContactOfSdrPage::GetObjectCount() const
 {
 // Fixed count of content. It contains PageBackground (Wiese), PageShadow, 
PageFill,
 // then - depending on if the page has a MasterPage - either MasterPage 
Hierarchy
-// or MPBGO. Also OuterPageBorder, InnerPageBorder and two pairs of Grid 
and Helplines
-// (for front and back) which internally are visible or not depending on 
the current
+// or MPBGO. Also OuterPageBorder, InnerPageBorder, PageHierarchy and two 
pairs of Grid and
+// Helplines (for front and back) which internally are visible or not 
depending on the current
 // front/back setting for those.
-return 10;
+return 11;
 }
 
 ViewContact& ViewContactOfSdrPage::GetViewContact(sal_uInt32 nIndex) const


core.git: Branch 'libreoffice-24-2' - svx/source

2024-01-24 Thread Michael Weghorn (via logerrit)
 svx/source/accessibility/AccessibleShape.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit df266f613bc12c18ec8d1c9cdc250fda1bc6c45b
Author: Michael Weghorn 
AuthorDate: Wed Jan 24 10:19:58 2024 +0100
Commit: Caolán McNamara 
CommitDate: Wed Jan 24 21:35:13 2024 +0100

svx a11y: Notify listeners when disposing shape

In `AccessibleShape::disposing`, call the same method
of the base class, i.e. `AccessibleContextBase::disposing`,
not `AccessibleContextBase::dispose`.

The code was moved from `AccessibleShape::dispose` to
`AccessibleShape::disposing` in

commit f11b151dc08ccfcb7e78bfd9a24c77670942ea63
Date:   Tue Apr 30 13:30:10 2002 +

#95585# Moved code from dispose to disposing().

and it seems likely that adjusting the base class method to call
was just forgotten/missed.

This resulted in the accessible getting disposed without listeners
getting notified (since `AccessibleContextBase::disposing` takes
care of that).

This resulted in a crash for the following scenario with the qt6
VCL plugin when the Orca screen reader is running:

1) start LO Writer
2) click on the "Basic shapes" toolbar button
3) click + drag to insert a shape into the document
4) click somewhere else

Backtrace is below.
`AtSpiAdaptor::handleMessage` (frame #12 in the bt) checks
whether the accessible is valid and returns early otherwise.
But since listeners were not notified when the object got disposed,
`QtAccessibleEventListener::disposing` wasn't called, which would
have taken care of invalidating the `QtAccessibleWidget`, in which
case this early return would have happened instead of the crash.

This behaves as expected now with this commit in place.

stderr output of the crash:

terminate called after throwing an instance of 
'com::sun::star::lang::DisposedException'

Backtrace:

Thread 1 received signal SIGABRT, Aborted.
__pthread_kill_implementation (threadid=, 
signo=signo@entry=6, no_tid=no_tid@entry=0) at ./nptl/pthread_kill.c:44
44  ./nptl/pthread_kill.c: No such file or directory.
(gdb) bt
#0  __pthread_kill_implementation (threadid=, 
signo=signo@entry=6, no_tid=no_tid@entry=0) at ./nptl/pthread_kill.c:44
#1  0x7f5bc1ca815f in __pthread_kill_internal (signo=6, 
threadid=) at ./nptl/pthread_kill.c:78
#2  0x7f5bc1c5a472 in __GI_raise (sig=sig@entry=6) at 
../sysdeps/posix/raise.c:26
#3  0x7f5bc1c444b2 in __GI_abort () at ./stdlib/abort.c:79
#4  0x7f5bc18a09eb in  () at /lib/x86_64-linux-gnu/libstdc++.so.6
#5  0x7f5bc18affca in  () at /lib/x86_64-linux-gnu/libstdc++.so.6
#6  0x7f5bc18b0035 in  () at /lib/x86_64-linux-gnu/libstdc++.so.6
#7  0x7f5bc18b0288 in  () at /lib/x86_64-linux-gnu/libstdc++.so.6
#8  0x7f5bc02b4550 in 
accessibility::AccessibleContextBase::ThrowIfDisposed() (this=0x55a6fc7e7da0) 
at .../libreoffice/editeng/source/accessibility/AccessibleContextBase.cxx:494
#9  0x7f5bbcf7d54e in 
accessibility::AccessibleShape::getAccessibleName() (this=0x55a6fc7e7da0) at 
.../libreoffice/svx/source/accessibility/AccessibleShape.cxx:280
#10 0x7f5bada62107 in QtAccessibleWidget::text(QAccessible::Text) 
const (this=0x55a6fad4fe20, text=QAccessible::Name) at 
.../libreoffice/vcl/qt6/../qt5/QtAccessibleWidget.cxx:362
#11 0x7f5bac5552d2 in 
AtSpiAdaptor::accessibleInterface(QAccessibleInterface*, QString const&, 
QDBusMessage const&, QDBusConnection const&) (this=0x55a6f769bce0, 
interface=0x55a6fad4fe20, function=..., message=..., connection=...)
at .../qt5/qtbase/src/gui/accessible/linux/atspiadaptor.cpp:1545
#12 0x7f5bac553cce in AtSpiAdaptor::handleMessage(QDBusMessage 
const&, QDBusConnection const&) (this=0x55a6f769bce0, message=..., 
connection=...)
at .../qt5/qtbase/src/gui/accessible/linux/atspiadaptor.cpp:1432
#13 0x7f5baaa88943 in 
QDBusConnectionPrivate::activateObject(QDBusConnectionPrivate::ObjectTreeNode&, 
QDBusMessage const&, int) (this=0x7f5ba4010f30, node=..., msg=..., 
pathStartPos=27)
at .../qt5/qtbase/src/dbus/qdbusintegrator.cpp:1448
#14 0x7f5baaa89628 in 
QDBusActivateObjectEvent::placeMetaCall(QObject*) (this=0x7f5ba4026980) at 
.../qt5/qtbase/src/dbus/qdbusintegrator.cpp:1604
#15 0x7f5bad044013 in QObject::event(QEvent*) (this=0x55a6f769bce0, 
e=0x7f5ba4026980) at .../qt5/qtbase/src/corelib/kernel/qobject.cpp:1447
#16 0x7f5bab1a6986 in QApplicationPrivate::notify_helper(QObject*, 
QEvent*) (this=0x55a6f631c3e0, receiver=0x55a6f769bce0, e=0x7f5ba4026980) at 
.../qt5/qtbase/src/widgets/kernel/qapplication.cpp:3298
#17 0x7f5bab1a6797 in QApplication::notify(QObject*, QEvent*) 

core.git: Branch 'libreoffice-24-2' - svx/source

2024-01-18 Thread Michael Stahl (via logerrit)
 svx/source/tbxctrls/tbunosearchcontrollers.cxx |   20 +++-
 1 file changed, 15 insertions(+), 5 deletions(-)

New commits:
commit d41053defd59257a13916a096da40db152b4b41e
Author: Michael Stahl 
AuthorDate: Thu Jan 18 13:04:35 2024 +0100
Commit: Xisco Fauli 
CommitDate: Thu Jan 18 17:28:46 2024 +0100

tdf#158277 sw_redlinehide: fix find bar string

FindTextFieldControl::SetTextToSelected_Impl() uses the XModel to
retrieve the currently selected text, which naturally includes deleted
text.

Instead, use view API XTextViewCursor to get the visible selected text.

(regression from commit ae2232366f00e08c1855667cfaf068269ac9af2f)

Change-Id: I302ea90a7407af6e3ae7b62a2f373dccb33b8275
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/162245
Tested-by: Jenkins
Reviewed-by: Michael Stahl 
(cherry picked from commit 1f540c49e68b28a360ee5c32d60ab1bed3837eec)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/162229
Reviewed-by: Xisco Fauli 

diff --git a/svx/source/tbxctrls/tbunosearchcontrollers.cxx 
b/svx/source/tbxctrls/tbunosearchcontrollers.cxx
index 8e833167ea12..f8c4436443bc 100644
--- a/svx/source/tbxctrls/tbunosearchcontrollers.cxx
+++ b/svx/source/tbxctrls/tbunosearchcontrollers.cxx
@@ -43,6 +43,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -243,12 +244,21 @@ void FindTextFieldControl::SetTextToSelected_Impl()
 try
 {
 css::uno::Reference 
xController(m_xFrame->getController(), css::uno::UNO_SET_THROW);
-css::uno::Reference 
xModel(xController->getModel(), css::uno::UNO_SET_THROW);
-css::uno::Reference 
xIndexAccess(xModel->getCurrentSelection(), css::uno::UNO_QUERY_THROW);
-if (xIndexAccess->getCount() > 0)
+uno::Reference const xTVCS(xController, 
uno::UNO_QUERY);
+if (xTVCS.is())
 {
-css::uno::Reference 
xTextRange(xIndexAccess->getByIndex(0), css::uno::UNO_QUERY_THROW);
-aString = xTextRange->getString();
+uno::Reference const 
xTVC(xTVCS->getViewCursor());
+aString = xTVC->getString();
+}
+else
+{
+uno::Reference xModel(xController->getModel(), 
uno::UNO_SET_THROW);
+uno::Reference 
xIndexAccess(xModel->getCurrentSelection(), uno::UNO_QUERY_THROW);
+if (xIndexAccess->getCount() > 0)
+{
+uno::Reference 
xTextRange(xIndexAccess->getByIndex(0), uno::UNO_QUERY_THROW);
+aString = xTextRange->getString();
+}
 }
 }
 catch ( ... )


core.git: Branch 'libreoffice-24-2' - svx/source

2023-12-13 Thread Noel Grandin (via logerrit)
 svx/source/dialog/framelinkarray.cxx |   26 +++---
 1 file changed, 23 insertions(+), 3 deletions(-)

New commits:
commit ca965c4e54d5126ded9e099dbb5e073560914155
Author: Noel Grandin 
AuthorDate: Tue Dec 12 15:23:16 2023 +0200
Commit: Xisco Fauli 
CommitDate: Wed Dec 13 16:52:33 2023 +0100

tdf#158636 Wrong border behaviour when cells are merged

regression from
commit e27d4cc31e04be4c47b5085dfa2363ee45457e8a
Author: Noel Grandin 
Date:   Mon Jun 19 12:23:55 2023 +0200
tdf#150534 reduce the memory consumption of cells when calculating

where I accidentally removed a line in lclSetMergedRange that
set mbMergedOrg to true.

And then the singlevalfields plugin spotted that
mbMergedOrig had only value, and so it got removed in:
commit 884a2cd39a7c0433a5bbbf4e83e2a9b16cdad71c
Author: Noel Grandin 
Date:   Fri Jun 30 15:36:51 2023 +0200
loplugin:singlevalfields

Change-Id: I9fc057f63e14df36c73d25c421ddbec72f7723e7
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/160619
Tested-by: Jenkins
Reviewed-by: Noel Grandin 
(cherry picked from commit f625928c346109216045d08b4dda30dbada005f5)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/160640
Reviewed-by: Xisco Fauli 

diff --git a/svx/source/dialog/framelinkarray.cxx 
b/svx/source/dialog/framelinkarray.cxx
index 21afef6441f5..fa5829438698 100644
--- a/svx/source/dialog/framelinkarray.cxx
+++ b/svx/source/dialog/framelinkarray.cxx
@@ -64,6 +64,7 @@ public:
 SvxRotateMode   meRotMode;
 double  mfOrientation;
 
+boolmbMergeOrig;
 boolmbOverlapX;
 boolmbOverlapY;
 
@@ -88,7 +89,7 @@ public:
 const Style& GetStyleTLBR() const { return maTLBR; }
 const Style& GetStyleBLTR() const { return maBLTR; }
 
-boolIsMerged() const { return mbOverlapX || mbOverlapY; }
+boolIsMerged() const { return mbMergeOrig || mbOverlapX || 
mbOverlapY; }
 boolIsRotated() const { return mfOrientation != 0.0; }
 
 voidMirrorSelfX();
@@ -206,6 +207,7 @@ Cell::Cell() :
 mnAddBottom( 0 ),
 meRotMode(SvxRotateMode::SVX_ROTATE_MODE_STANDARD ),
 mfOrientation( 0.0 ),
+mbMergeOrig( false ),
 mbOverlapX( false ),
 mbOverlapY( false )
 {
@@ -229,6 +231,7 @@ bool Cell::operator==(const Cell& rOther) const
 && mnAddBottom == rOther.mnAddBottom
 && meRotMode == rOther.meRotMode
 && mfOrientation == rOther.mfOrientation
+&& mbMergeOrig == rOther.mbMergeOrig
 && mbOverlapX == rOther.mbOverlapX
 && mbOverlapY == rOther.mbOverlapY;
 }
@@ -248,6 +251,7 @@ size_t Cell::hashCode() const
 o3tl::hash_combine(seed, mnAddBottom);
 o3tl::hash_combine(seed, meRotMode);
 o3tl::hash_combine(seed, mfOrientation);
+o3tl::hash_combine(seed, mbMergeOrig);
 o3tl::hash_combine(seed, mbOverlapX);
 o3tl::hash_combine(seed, mbOverlapY);
 return seed;
@@ -352,7 +356,7 @@ struct ArrayImpl
 
 boolHasCellRotation() const;
 
-Cell* createOrFind(const Cell& rCell);
+const Cell* createOrFind(const Cell& rCell);
 };
 
 static void lclSetMergedRange( ArrayImpl& rImpl, CellVec& rCells, sal_Int32 
nWidth, sal_Int32 nFirstCol, sal_Int32 nFirstRow, sal_Int32 nLastCol, sal_Int32 
nLastRow )
@@ -363,12 +367,14 @@ static void lclSetMergedRange( ArrayImpl& rImpl, CellVec& 
rCells, sal_Int32 nWid
 {
 const Cell* pCell = rCells[ nRow * nWidth + nCol ];
 Cell aTempCell(*pCell);
+aTempCell.mbMergeOrig = false;
 aTempCell.mbOverlapX = nCol > nFirstCol;
 aTempCell.mbOverlapY = nRow > nFirstRow;
 rCells[ nRow * nWidth + nCol ] = rImpl.createOrFind(aTempCell);
 }
 }
 Cell aTempCell(*rCells[ nFirstRow * nWidth + nFirstCol ]);
+aTempCell.mbMergeOrig = true;
 rCells[ nFirstRow * nWidth + nFirstCol ] = rImpl.createOrFind(aTempCell);
 }
 
@@ -399,7 +405,7 @@ ArrayImpl::~ArrayImpl()
 delete pCell;
 }
 
-Cell* ArrayImpl::createOrFind(const Cell& rCell)
+const Cell* ArrayImpl::createOrFind(const Cell& rCell)
 {
 auto it = maRegisteredCells.find(const_cast());
 if (it != maRegisteredCells.end())
@@ -1142,6 +1148,20 @@ void Array::MirrorSelfX()
 aNewCells.push_back( mxImpl->createOrFind(aTempCell) );
 }
 }
+for( nRow = 0; nRow < mxImpl->mnHeight; ++nRow )
+{
+for( nCol = 0; nCol < mxImpl->mnWidth; ++nCol )
+{
+if( mxImpl->GetCell( nCol, nRow )->mbMergeOrig )
+{
+sal_Int32 nLastCol = mxImpl->GetMergedLastCol( nCol, nRow );
+sal_Int32 nLastRow = mxImpl->GetMergedLastRow( nCol, nRow );
+lclSetMergedRange( *mxImpl, aNewCells, mxImpl->mnWidth,
+