[Libreoffice-commits] core.git: Branch 'libreoffice-7-4' - starmath/source

2023-04-17 Thread Mike Kaganski (via logerrit)
 starmath/source/ElementsDockingWindow.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 73e4009dc2a645b1bf9f06ce34711e135c147082
Author: Mike Kaganski 
AuthorDate: Mon Apr 17 18:26:56 2023 +0300
Commit: Adolfo Jayme Barrientos 
CommitDate: Tue Apr 18 05:17:49 2023 +0200

tdf#154016: use ScopedVclPtr

A regression crash from commit d79c527c2a599c7821d27cf03b95cb79e2abe685
(Use IconView in SmElementsControl, 2022-06-01). Without disposeAndClear,
the VirtualDevices leak; and on Windows this quickly leads to GDI handle
10 000 limit killing the process (which is good, helping to track this
kind of issues).

Change-Id: I28e1ffbeb425fae3fdbd76b7873fef5c929b8e11
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/150523
Tested-by: Jenkins
Reviewed-by: Mike Kaganski 
(cherry picked from commit c11463cdc5415707d05ab6da08736ff7212db4a0)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/150511
Reviewed-by: Adolfo Jayme Barrientos 

diff --git a/starmath/source/ElementsDockingWindow.cxx 
b/starmath/source/ElementsDockingWindow.cxx
index a52b5f85ec0f..a3a4085a7ea1 100644
--- a/starmath/source/ElementsDockingWindow.cxx
+++ b/starmath/source/ElementsDockingWindow.cxx
@@ -508,7 +508,7 @@ struct ElementData
 void SmElementsControl::addElement(const OUString& aElementVisual, const 
OUString& aElementSource, const OUString& aHelpText)
 {
 std::unique_ptr pNode = maParser->ParseExpression(aElementVisual);
-VclPtr pDevice(mpIconView->create_virtual_device());
+ScopedVclPtr pDevice(mpIconView->create_virtual_device());
 pDevice->SetTextRenderModeForResolutionIndependentLayout(true);
 pDevice->SetMapMode(MapMode(MapUnit::Map100thMM));
 pDevice->SetDrawMode(DrawModeFlags::Default);


[Libreoffice-commits] core.git: Branch 'libreoffice-7-4' - starmath/source

2023-02-20 Thread Xisco Fauli (via logerrit)
 starmath/source/cursor.cxx   |4 ++--
 starmath/source/dialog.cxx   |7 +--
 starmath/source/document.cxx |8 +++-
 3 files changed, 10 insertions(+), 9 deletions(-)

New commits:
commit c0181b2f26b784d8317f51a77a9dfade16913ad1
Author: Xisco Fauli 
AuthorDate: Fri Feb 17 15:50:29 2023 +0100
Commit: Michael Stahl 
CommitDate: Mon Feb 20 11:25:56 2023 +

check SmGetActiveView()

it might be null

See 
https://crashreport.libreoffice.org/stats/signature/SmPrintOptionsTabPage::~SmPrintOptionsTabPage()

Change-Id: I7bc17da230784e6e3fc9c0b33848423ac113ab29
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/147221
Reviewed-by: Caolán McNamara 
Tested-by: Jenkins
Reviewed-by: Xisco Fauli 
(cherry picked from commit a7fd1e067eb2af0ef329719c4c7dbb32cc5926b2)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/147246
(cherry picked from commit b905b793be520b9fdece8d12614566be82ce3c92)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/147312
Reviewed-by: Michael Stahl 

diff --git a/starmath/source/cursor.cxx b/starmath/source/cursor.cxx
index 52621d360c80..d5479ab42765 100644
--- a/starmath/source/cursor.cxx
+++ b/starmath/source/cursor.cxx
@@ -1315,8 +1315,8 @@ void SmCursor::EndEdit(){
 }
 
 void SmCursor::RequestRepaint(){
-SmViewShell *pViewSh = SmGetActiveView();
-if( pViewSh ) {
+if (SmViewShell *pViewSh = SmGetActiveView())
+{
 if ( SfxObjectCreateMode::EMBEDDED == mpDocShell->GetCreateMode() )
 mpDocShell->Repaint();
 else
diff --git a/starmath/source/dialog.cxx b/starmath/source/dialog.cxx
index 043739cf5c0d..19992b341c36 100644
--- a/starmath/source/dialog.cxx
+++ b/starmath/source/dialog.cxx
@@ -181,7 +181,8 @@ 
SmPrintOptionsTabPage::SmPrintOptionsTabPage(weld::Container* pPage, weld::Dialo
 
 SmPrintOptionsTabPage::~SmPrintOptionsTabPage()
 {
-SmGetActiveView()->GetEditWindow()->UpdateStatus();
+if (SmViewShell *pViewSh = SmGetActiveView())
+pViewSh->GetEditWindow()->UpdateStatus();
 }
 
 bool SmPrintOptionsTabPage::FillItemSet(SfxItemSet* rSet)
@@ -204,7 +205,9 @@ bool SmPrintOptionsTabPage::FillItemSet(SfxItemSet* rSet)
 rSet->Put(SfxBoolItem(SID_AUTO_CLOSE_BRACKETS, 
m_xAutoCloseBrackets->get_active()));
 rSet->Put(SfxUInt16Item(SID_SMEDITWINDOWZOOM, 
sal::static_int_cast(m_xSmZoom->get_value(FieldUnit::PERCENT;
 
-SmGetActiveView()->GetEditWindow()->UpdateStatus();
+if (SmViewShell *pViewSh = SmGetActiveView())
+pViewSh->GetEditWindow()->UpdateStatus();
+
 return true;
 }
 
diff --git a/starmath/source/document.cxx b/starmath/source/document.cxx
index 23034ede3e3c..59353879d4e4 100644
--- a/starmath/source/document.cxx
+++ b/starmath/source/document.cxx
@@ -159,7 +159,7 @@ void SmDocShell::SetText(const OUString& rBuffer)
 Parse();
 
 SmViewShell *pViewSh = SmGetActiveView();
-if( pViewSh )
+if (pViewSh)
 {
 pViewSh->GetViewFrame()->GetBindings().Invalidate(SID_TEXT);
 if ( SfxObjectCreateMode::EMBEDDED == GetCreateMode() )
@@ -256,8 +256,7 @@ void SmDocShell::ArrangeFormula()
 // if necessary get another OutputDevice for which we format
 if (!pOutDev)
 {
-SmViewShell *pView = SmGetActiveView();
-if (pView)
+if (SmViewShell *pView = SmGetActiveView())
 pOutDev = 
>GetGraphicWidget().GetDrawingArea()->get_ref_device();
 else
 {
@@ -542,8 +541,7 @@ void SmDocShell::Repaint()
 
 Size aVisSize = GetSize();
 SetVisAreaSize(aVisSize);
-SmViewShell* pViewSh = SmGetActiveView();
-if (pViewSh)
+if (SmViewShell* pViewSh = SmGetActiveView())
 pViewSh->GetGraphicWidget().Invalidate();
 
 if (bIsEnabled)


[Libreoffice-commits] core.git: Branch 'libreoffice-7-4' - starmath/source

2022-12-08 Thread Caolán McNamara (via logerrit)
 starmath/source/ElementsDockingWindow.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 4e8331b77a2dcad2b10d3ca5b788711ea4e83a1b
Author: Caolán McNamara 
AuthorDate: Wed Dec 7 13:20:03 2022 +
Commit: Michael Stahl 
CommitDate: Thu Dec 8 12:20:49 2022 +

Resolves: tdf#152411 clear before freeze to let gtk a11y drop reference

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

diff --git a/starmath/source/ElementsDockingWindow.cxx 
b/starmath/source/ElementsDockingWindow.cxx
index aab82cac3f11..a52b5f85ec0f 100644
--- a/starmath/source/ElementsDockingWindow.cxx
+++ b/starmath/source/ElementsDockingWindow.cxx
@@ -554,8 +554,8 @@ void SmElementsControl::setElementSetId(TranslateId pSetId)
 
 void SmElementsControl::addElements(const TranslateId& rCategory)
 {
+mpIconView->clear(); // tdf#152411 clear before freeze to let gtk a11y 
drop reference
 mpIconView->freeze();
-mpIconView->clear();
 mpIconView->set_item_width(0);
 maItemDatas.clear();
 


[Libreoffice-commits] core.git: Branch 'libreoffice-7-4' - starmath/source

2022-12-05 Thread Rafael Lima (via logerrit)
 starmath/source/tmpdevice.cxx |3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

New commits:
commit fd8a7f0b6ca9454401d035c6b8d822f671e1849f
Author: Rafael Lima 
AuthorDate: Fri Dec 2 11:06:07 2022 +
Commit: Xisco Fauli 
CommitDate: Mon Dec 5 21:18:10 2022 +

tdf#148505 Fix COL_AUTO in embedded Math formulas

Change-Id: I8be0289100cbd0921bcb05ffec186155abba8743
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/143575
Tested-by: Jenkins
Tested-by: Heiko Tietze 
Reviewed-by: Heiko Tietze 
(cherry picked from commit 12732eb7c34baa3f846ec6d0c10f8987051ace34)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/143588
Reviewed-by: Xisco Fauli 

diff --git a/starmath/source/tmpdevice.cxx b/starmath/source/tmpdevice.cxx
index 5eee10d9670f..fccb20f728bd 100644
--- a/starmath/source/tmpdevice.cxx
+++ b/starmath/source/tmpdevice.cxx
@@ -49,7 +49,8 @@ Color SmTmpDevice::GetTextColor(const Color& rTextColor)
 if (rTextColor == COL_AUTO)
 {
 Color aConfigFontColor = 
SM_MOD()->GetColorConfig().GetColorValue(svtools::FONTCOLOR).nColor;
-return rOutDev.GetReadableFontColor(aConfigFontColor, 
rOutDev.GetBackgroundColor());
+Color aConfigDocColor = 
SM_MOD()->GetColorConfig().GetColorValue(svtools::DOCCOLOR).nColor;
+return rOutDev.GetReadableFontColor(aConfigFontColor, aConfigDocColor);
 }
 
 return rTextColor;


[Libreoffice-commits] core.git: Branch 'libreoffice-7-4' - starmath/source

2022-09-15 Thread Caolán McNamara (via logerrit)
 starmath/source/view.cxx |4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

New commits:
commit d1232444faf7f311d5d79f0e0291a8e261f8258b
Author: Caolán McNamara 
AuthorDate: Thu Sep 15 11:25:28 2022 +0100
Commit: Michael Stahl 
CommitDate: Thu Sep 15 16:54:44 2022 +0200

Conditional jump or move depends on uninitialised value

==1533286== Conditional jump or move depends on uninitialised value(s)
==1533286==at 0x12DEC3C9: param_double_validate (gparamspecs.c:592)
==1533286==by 0x12DEF924: g_param_value_validate (gparam.c:700)
==1533286==by 0x12DEFA9A: object_set_property (gobject.c:1594)
==1533286==by 0x12DF1F96: g_object_set_valist (gobject.c:2538)
==1533286==by 0x12DF2253: g_object_set (gobject.c:2705)
==1533286==by 0x241E8C44: gtk_adjustment_configure (gtkadjustment.c:833)
==1533286==by 0x23B6310A: (anonymous 
namespace)::GtkInstanceScrolledWindow::vadjustment_configure(int, int, int, 
int, int, int) (gtkinst.cxx:8207)
==1533286==by 0x23B63D3D: virtual thunk to (anonymous 
namespace)::GtkInstanceScrolledWindow::vadjustment_configure(int, int, int, 
int, int, int) (gtkinst.cxx:0)
==1533286==by 0x36424112: SmGraphicWindow::Resize() (view.cxx:227)

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

diff --git a/starmath/source/view.cxx b/starmath/source/view.cxx
index e5f67a040a85..2ddb7a23043b 100644
--- a/starmath/source/view.cxx
+++ b/starmath/source/view.cxx
@@ -100,6 +100,8 @@ using namespace css::uno;
 
 SmGraphicWindow::SmGraphicWindow(SmViewShell& rShell)
 : InterimItemWindow(()->GetWindow(), 
"modules/smath/ui/mathwindow.ui", "MathWindow")
+, nLinePixH(GetSettings().GetStyleSettings().GetScrollBarSize())
+, nColumnPixW(nLinePixH)
 , nZoom(100)
 // continue to use user-scrolling to make this work equivalent to how it 
'always' worked
 , mxScrolledWindow(m_xBuilder->weld_scrolled_window("scrolledwindow", 
true))
@@ -108,8 +110,6 @@ SmGraphicWindow::SmGraphicWindow(SmViewShell& rShell)
 {
 InitControlBase(mxGraphic->GetDrawingArea());
 
-nColumnPixW = nLinePixH = 
GetSettings().GetStyleSettings().GetScrollBarSize();
-
 mxScrolledWindow->connect_hadjustment_changed(LINK(this, SmGraphicWindow, 
ScrollHdl));
 mxScrolledWindow->connect_vadjustment_changed(LINK(this, SmGraphicWindow, 
ScrollHdl));
 


[Libreoffice-commits] core.git: Branch 'libreoffice-7-4' - starmath/source

2022-09-02 Thread Caolán McNamara (via logerrit)
 starmath/source/mathml/export.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 5caa07ee4e77dfabb6fb48fd755ed2d18ddb2867
Author: Caolán McNamara 
AuthorDate: Wed Aug 31 11:27:07 2022 +0100
Commit: Eike Rathke 
CommitDate: Fri Sep 2 11:43:24 2022 +0200

cid#1509247 reserve here can't be right

the assumption is that m_aSvXMLElementExportList[m_nDepth] can be
written to here, so it should at least be resize not reserve

Change-Id: I2bb6074ca9dd2f71e17f5b9ec955e4d6d65edaa9
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/138983
Tested-by: Jenkins
Reviewed-by: Eike Rathke 

diff --git a/starmath/source/mathml/export.cxx 
b/starmath/source/mathml/export.cxx
index 1c88d3f5664d..b55be509216b 100644
--- a/starmath/source/mathml/export.cxx
+++ b/starmath/source/mathml/export.cxx
@@ -1063,7 +1063,7 @@ public:
 inline void setDepthData(SvXMLElementExport* aSvXMLElementExportList)
 {
 if (m_nDepth == m_aSvXMLElementExportList.size())
-m_aSvXMLElementExportList.reserve(m_aSvXMLElementExportList.size() 
+ 1024);
+m_aSvXMLElementExportList.resize(m_aSvXMLElementExportList.size() 
+ 1024);
 m_aSvXMLElementExportList[m_nDepth] = aSvXMLElementExportList;
 }