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

2023-11-14 Thread Caolán McNamara (via logerrit)
 starmath/source/dialog.cxx |2 ++
 1 file changed, 2 insertions(+)

New commits:
commit e9441aef95c31afcc155a0076cf34521d605e5a2
Author: Caolán McNamara 
AuthorDate: Tue Nov 14 09:23:58 2023 +
Commit: Caolán McNamara 
CommitDate: Tue Nov 14 11:15:51 2023 +0100

Resolves: tdf#158121 Math - Print settings not read after changing

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

diff --git a/starmath/source/dialog.cxx b/starmath/source/dialog.cxx
index 03bbc60da66a..d5c107774ee7 100644
--- a/starmath/source/dialog.cxx
+++ b/starmath/source/dialog.cxx
@@ -229,6 +229,8 @@ void SmPrintOptionsTabPage::Reset(const SfxItemSet* rSet)
 m_xSmZoom->set_value(rSet->Get(SID_SMEDITWINDOWZOOM).GetValue(), 
FieldUnit::PERCENT);
 
 m_xTitle->set_active(rSet->Get(SID_PRINTTITLE).GetValue());
+m_xText->set_active(rSet->Get(GetWhich(SID_PRINTTEXT)).GetValue());
+m_xFrame->set_active(rSet->Get(GetWhich(SID_PRINTFRAME)).GetValue());
 m_xNoRightSpaces->set_active(rSet->Get(SID_NO_RIGHT_SPACES).GetValue());
 
m_xSaveOnlyUsedSymbols->set_active(rSet->Get(SID_SAVE_ONLY_USED_SYMBOLS).GetValue());
 
m_xAutoCloseBrackets->set_active(rSet->Get(SID_AUTO_CLOSE_BRACKETS).GetValue());


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

2023-10-30 Thread Mike Kaganski (via logerrit)
 starmath/source/view.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 79b4fc22792d3fa905579db900315dff22c51b22
Author: Mike Kaganski 
AuthorDate: Sun Oct 29 14:57:03 2023 +0300
Commit: Adolfo Jayme Barrientos 
CommitDate: Mon Oct 30 16:42:40 2023 +0100

tdf#157966: fix "Fit to page" printing option

Regression after commit bf4bbc3c2174b21577b8878bc3197923ba44a029
(replace std::max(std::min()) with std::clamp, 2020-11-16).

Change-Id: Iada43ba352cbfb5ea597c72c871b47beb2d766c9
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158617
Tested-by: Jenkins
Reviewed-by: Mike Kaganski 
Signed-off-by: Xisco Fauli 
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158649
Reviewed-by: Adolfo Jayme Barrientos 

diff --git a/starmath/source/view.cxx b/starmath/source/view.cxx
index 37105394a32e..76eef9fe6d88 100644
--- a/starmath/source/view.cxx
+++ b/starmath/source/view.cxx
@@ -1469,7 +1469,7 @@ void SmViewShell::Impl_Print(OutputDevice , const 
SmPrintUIOptions 
 sal_uInt16 nZ = std::min(o3tl::convert(OutputSize.Width(), 
100, GraphicSize.Width()),
  o3tl::convert(OutputSize.Height(), 
100, GraphicSize.Height()));
 nZ -= 10;
-Fraction aFraction(std::clamp(nZ, MINZOOM, sal_uInt16(100)), 
1);
+Fraction aFraction(std::clamp(nZ, MINZOOM, MAXZOOM), 100);
 
 OutputMapMode = MapMode(SmMapUnit(), Point(), aFraction, 
aFraction);
 }


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

2023-10-30 Thread Mike Kaganski (via logerrit)
 starmath/source/unomodel.cxx |   18 --
 1 file changed, 12 insertions(+), 6 deletions(-)

New commits:
commit 51d50517df324e9f7d5e0ac7aed1bb150a8feeaf
Author: Mike Kaganski 
AuthorDate: Sat Oct 28 18:06:34 2023 +0300
Commit: Xisco Fauli 
CommitDate: Mon Oct 30 13:07:54 2023 +0100

pPrinter may be nullptr

E.g., calling storeToURL, generating a PDF, on an embedded formula.

Change-Id: If74af90f9c3dfd54a328782ddecd0adf52b51a5a
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158591
Tested-by: Jenkins
Reviewed-by: Mike Kaganski 
(cherry picked from commit 8dda6270f8b9af6fcfba2a3a935612ab5a81c247)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158542
Reviewed-by: Michael Stahl 

diff --git a/starmath/source/unomodel.cxx b/starmath/source/unomodel.cxx
index f2f8abfb50e2..8a1a17011f45 100644
--- a/starmath/source/unomodel.cxx
+++ b/starmath/source/unomodel.cxx
@@ -909,8 +909,9 @@ uno::Sequence< beans::PropertyValue > SAL_CALL 
SmModel::getRenderer(
 throw RuntimeException();
 
 SmPrinterAccess aPrinterAccess( *pDocSh );
-Printer *pPrinter = aPrinterAccess.GetPrinter();
-SizeaPrtPaperSize ( pPrinter->GetPaperSize() );
+Size aPrtPaperSize;
+if (Printer *pPrinter = aPrinterAccess.GetPrinter())
+aPrtPaperSize = pPrinter->GetPaperSize();
 
 // if paper size is 0 (usually if no 'real' printer is found),
 // guess the paper size
@@ -980,11 +981,16 @@ void SAL_CALL SmModel::render(
 return;
 
 SmPrinterAccess aPrinterAccess( *pDocSh );
-Printer *pPrinter = aPrinterAccess.GetPrinter();
 
-SizeaPrtPaperSize ( pPrinter->GetPaperSize() );
-SizeaOutputSize   ( pPrinter->GetOutputSize() );
-Point   aPrtPageOffset( pPrinter->GetPageOffset() );
+Size aPrtPaperSize;
+Size aOutputSize;
+Point aPrtPageOffset;
+if (Printer *pPrinter = aPrinterAccess.GetPrinter())
+{
+aPrtPaperSize = pPrinter->GetPaperSize();
+aOutputSize = pPrinter->GetOutputSize();
+aPrtPageOffset = pPrinter->GetPageOffset();
+}
 
 // no real printer ??
 if (aPrtPaperSize.IsEmpty())


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

2023-08-11 Thread Khaled Hosny (via logerrit)
 starmath/source/ElementsDockingWindow.cxx |1 +
 1 file changed, 1 insertion(+)

New commits:
commit ec7065bafc0a805b03a2b4d5522026f829c25522
Author: Khaled Hosny 
AuthorDate: Thu Aug 10 10:11:22 2023 +0300
Commit: Michael Stahl 
CommitDate: Fri Aug 11 13:25:48 2023 +0200

tdf#80467: Fix math rendering in elements dock with RTL UI

Make sure to disable RTL on the OutputDevice, otherwise the math will be
rendered right-to-left without even mirroring the parenthesis.

Change-Id: Iea43dbc0d7efe914120d5cc1605522254344b4fc
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155538
Tested-by: Jenkins
Reviewed-by: خالد حسني 
(cherry picked from commit f681d37d7aab768b507ea48d34a985b8dc49391a)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155486
Reviewed-by: Michael Stahl 

diff --git a/starmath/source/ElementsDockingWindow.cxx 
b/starmath/source/ElementsDockingWindow.cxx
index b2186a7ecbf9..7fdfb3b3ec49 100644
--- a/starmath/source/ElementsDockingWindow.cxx
+++ b/starmath/source/ElementsDockingWindow.cxx
@@ -532,6 +532,7 @@ void SmElementsControl::addElement(const OUString& 
aElementVisual, const OUStrin
 pDevice->SetDrawMode(DrawModeFlags::Default);
 pDevice->SetLayoutMode(vcl::text::ComplexTextLayoutFlags::Default);
 pDevice->SetDigitLanguage(LANGUAGE_ENGLISH);
+pDevice->EnableRTL(false);
 
 pDevice->SetBackground(GetControlBackground());
 pDevice->SetTextColor(GetTextColor());


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

2023-07-06 Thread Xisco Fauli (via logerrit)
 starmath/source/dialog.cxx |6 +
 starmath/source/view.cxx   |  136 ++---
 2 files changed, 73 insertions(+), 69 deletions(-)

New commits:
commit 14f166d30c43f7e9a0386e17b2be525dc06765d9
Author: Xisco Fauli 
AuthorDate: Wed Jul 5 11:29:34 2023 +0200
Commit: Xisco Fauli 
CommitDate: Thu Jul 6 19:46:38 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/+/154122
Tested-by: Jenkins

diff --git a/starmath/source/dialog.cxx b/starmath/source/dialog.cxx
index ecb68dbf2d63..03bbc60da66a 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 ea802231b6a5..37105394a32e 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 = dynamic_cast(xTrans.get());
 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 
aData(TransferableDataHelper::CreateFromClipboard(pEditWin->GetClipboard()));