[Libreoffice-commits] core.git: Branch 'libreoffice-7-5' - starmath/source
starmath/source/dialog.cxx |6 + starmath/source/view.cxx | 136 ++--- 2 files changed, 73 insertions(+), 69 deletions(-) New commits: commit 16a63227e4d791707531e3720df70ba659ba0cc1 Author: Xisco Fauli AuthorDate: Wed Jul 5 11:29:34 2023 +0200 Commit: Michael Stahl CommitDate: Fri Jul 7 11:08:46 2023 +0200 starmath: check GetEditWindow() it might return nullptr See https://crashreport.libreoffice.org/stats/signature/SmPrintOptionsTabPage::~SmPrintOptionsTabPage() Change-Id: I4b34b0da3dc282ae89fd58defa12045c34a12cfb Reviewed-on: https://gerrit.libreoffice.org/c/core/+/154026 Reviewed-by: Caolán McNamara Tested-by: Xisco Fauli Reviewed-by: Xisco Fauli (cherry picked from commit 5f89bf6f35d71ed3bcf3293ea173a91b7e089702) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/154123 Tested-by: Jenkins Reviewed-by: Michael Stahl diff --git a/starmath/source/dialog.cxx b/starmath/source/dialog.cxx index 969466d6f06d..5ca38a4c4f99 100644 --- a/starmath/source/dialog.cxx +++ b/starmath/source/dialog.cxx @@ -182,7 +182,8 @@ SmPrintOptionsTabPage::SmPrintOptionsTabPage(weld::Container* pPage, weld::Dialo SmPrintOptionsTabPage::~SmPrintOptionsTabPage() { if (SmViewShell *pViewSh = SmGetActiveView()) -pViewSh->GetEditWindow()->UpdateStatus(); +if (SmEditWindow* pEdit = pViewSh->GetEditWindow()) +pEdit->UpdateStatus(); } bool SmPrintOptionsTabPage::FillItemSet(SfxItemSet* rSet) @@ -206,7 +207,8 @@ bool SmPrintOptionsTabPage::FillItemSet(SfxItemSet* rSet) rSet->Put(SfxUInt16Item(SID_SMEDITWINDOWZOOM, sal::static_int_cast(m_xSmZoom->get_value(FieldUnit::PERCENT; if (SmViewShell *pViewSh = SmGetActiveView()) -pViewSh->GetEditWindow()->UpdateStatus(); +if (SmEditWindow* pEdit = pViewSh->GetEditWindow()) +pEdit->UpdateStatus(); return true; } diff --git a/starmath/source/view.cxx b/starmath/source/view.cxx index bdc8b0729335..10cdb8fee2a0 100644 --- a/starmath/source/view.cxx +++ b/starmath/source/view.cxx @@ -415,8 +415,8 @@ void SmGraphicWidget::GetFocus() { if (!SmViewShell::IsInlineEditEnabled()) return; -if (GetView().GetEditWindow()) -GetView().GetEditWindow()->Flush(); +if (SmEditWindow* pEdit = GetView().GetEditWindow()) +pEdit->Flush(); //Let view shell know what insertions should be done in visual editor GetView().SetInsertIntoEditWindow(false); SetIsCursorVisible(true); @@ -591,8 +591,7 @@ void SmGraphicWidget::Paint(vcl::RenderContext& rRenderContext, const tools::Rec { SetIsCursorVisible(false); // (old) cursor must be drawn again -const SmEditWindow* pEdit = GetView().GetEditWindow(); -if (pEdit) +if (const SmEditWindow* pEdit = GetView().GetEditWindow()) { // get new position for formula-cursor (for possible altered formula) sal_Int32 nRow; sal_uInt16 nCol; @@ -1568,8 +1567,9 @@ void SmViewShell::ShowError(const SmErrorDesc* pErrorDesc) if (pErrorDesc || nullptr != (pErrorDesc = GetDoc()->GetParser()->GetError()) ) { SetStatusText( pErrorDesc->m_aText ); -GetEditWindow()->MarkError( Point( pErrorDesc->m_pNode->GetColumn(), - pErrorDesc->m_pNode->GetRow())); +if (SmEditWindow* pEdit = GetEditWindow()) +pEdit->MarkError( Point( pErrorDesc->m_pNode->GetColumn(), + pErrorDesc->m_pNode->GetRow())); } } @@ -1612,8 +1612,7 @@ void SmViewShell::Insert( SfxMedium& rMedium ) return; OUString aText = pDoc->GetText(); -SmEditWindow *pEditWin = GetEditWindow(); -if (pEditWin) +if (SmEditWindow *pEditWin = GetEditWindow()) pEditWin->InsertText( aText ); else { @@ -1649,8 +1648,7 @@ void SmViewShell::InsertFrom(SfxMedium ) return; OUString aText = pDoc->GetText(); -SmEditWindow *pEditWin = GetEditWindow(); -if (pEditWin) +if (SmEditWindow *pEditWin = GetEditWindow()) pEditWin->InsertText(aText); else SAL_WARN( "starmath", "EditWindow missing" ); @@ -1720,8 +1718,8 @@ void SmViewShell::Execute(SfxRequest& rReq) auto pTrans = comphelper::getFromUnoTunnel(xTrans); if (pTrans) { -SmEditWindow *pEditWin = GetEditWindow(); -pTrans->CopyToClipboard(pEditWin->GetClipboard()); +if (pWin) +pTrans->CopyToClipboard(pWin->GetClipboard()); } } } @@ -1729,15 +1727,17 @@ void SmViewShell::Execute(SfxRequest& rReq) case SID_PASTEOBJECT: { -SmEditWindow *pEditWin = GetEditWindow(); -TransferableDataHelper
[Libreoffice-commits] core.git: Branch 'libreoffice-7-5' - starmath/source
starmath/source/dialog.cxx |4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) New commits: commit 69dfde2d2e42a21444e1a4b18f0a4a1929ac330d Author: Rafael Lima AuthorDate: Wed Apr 12 16:14:10 2023 +0200 Commit: Adolfo Jayme Barrientos CommitDate: Tue Apr 18 22:58:06 2023 +0200 tdf#154773 Fix Symbols dialog in dark mode Change-Id: I92029f1d19c7545a4122b125ae69ab5964e562d2 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/150209 Tested-by: Jenkins Reviewed-by: Heiko Tietze (cherry picked from commit 2c01d4448a8059b5f335d07347b9e85a0d0031d8) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/150564 Reviewed-by: Adolfo Jayme Barrientos diff --git a/starmath/source/dialog.cxx b/starmath/source/dialog.cxx index e7450727ad61..969466d6f06d 100644 --- a/starmath/source/dialog.cxx +++ b/starmath/source/dialog.cxx @@ -61,8 +61,8 @@ void lclGetSettingColors(Color& rBackgroundColor, Color& rTextColor) } else { -rBackgroundColor = COL_WHITE; -rTextColor = COL_BLACK; +rBackgroundColor = rStyleSettings.GetFaceColor(); +rTextColor = rStyleSettings.GetLabelTextColor(); } }
[Libreoffice-commits] core.git: Branch 'libreoffice-7-5' - starmath/source
starmath/source/ElementsDockingWindow.cxx |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) New commits: commit 069fcbe6531ad7e22c368c1a3994528ea30c8195 Author: Mike Kaganski AuthorDate: Mon Apr 17 18:26:56 2023 +0300 Commit: Adolfo Jayme Barrientos CommitDate: Tue Apr 18 05:17:31 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/+/150510 Reviewed-by: Adolfo Jayme Barrientos diff --git a/starmath/source/ElementsDockingWindow.cxx b/starmath/source/ElementsDockingWindow.cxx index 1ea324dc7fe7..59a02422c34c 100644 --- a/starmath/source/ElementsDockingWindow.cxx +++ b/starmath/source/ElementsDockingWindow.cxx @@ -527,7 +527,7 @@ namespace 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->SetMapMode(MapMode(SmMapUnit())); pDevice->SetDrawMode(DrawModeFlags::Default); pDevice->SetLayoutMode(vcl::text::ComplexTextLayoutFlags::Default);
[Libreoffice-commits] core.git: Branch 'libreoffice-7-5' - starmath/source
starmath/source/cursor.cxx |7 --- starmath/source/dialog.cxx |7 +-- starmath/source/document.cxx |8 +++- 3 files changed, 12 insertions(+), 10 deletions(-) New commits: commit b905b793be520b9fdece8d12614566be82ce3c92 Author: Xisco Fauli AuthorDate: Fri Feb 17 15:50:29 2023 +0100 Commit: Xisco Fauli CommitDate: Mon Feb 20 09:03:43 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 diff --git a/starmath/source/cursor.cxx b/starmath/source/cursor.cxx index c7c27616b3f9..e8623517bcd7 100644 --- a/starmath/source/cursor.cxx +++ b/starmath/source/cursor.cxx @@ -1330,9 +1330,10 @@ void SmCursor::EndEdit(){ mpDocShell->GetEditEngine().QuickFormatDoc(); } -void SmCursor::RequestRepaint(){ -SmViewShell *pViewSh = SmGetActiveView(); -if( pViewSh ) { +void SmCursor::RequestRepaint() +{ +if (SmViewShell *pViewSh = SmGetActiveView()) +{ if (comphelper::LibreOfficeKit::isActive()) { pViewSh->SendCaretToLOK(); diff --git a/starmath/source/dialog.cxx b/starmath/source/dialog.cxx index 2aedbae19d05..e7450727ad61 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 e7c5dee90c4d..0593d26c268c 100644 --- a/starmath/source/document.cxx +++ b/starmath/source/document.cxx @@ -150,7 +150,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() ) @@ -247,8 +247,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 { @@ -533,8 +532,7 @@ void SmDocShell::Repaint() Size aVisSize = GetSize(); SetVisAreaSize(aVisSize); -SmViewShell* pViewSh = SmGetActiveView(); -if (pViewSh) +if (SmViewShell* pViewSh = SmGetActiveView()) pViewSh->GetGraphicWidget().Invalidate(); if (bIsEnabled)