[Libreoffice-commits] core.git: starmath/source

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

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

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

Change-Id: I4effa4905f05a8a6105d4283c0a3b5ba8dd4d31d
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159402
Tested-by: Jenkins
Reviewed-by: Caolán McNamara 

diff --git a/starmath/source/dialog.cxx b/starmath/source/dialog.cxx
index 98f96eacb480..f96f43cfebba 100644
--- a/starmath/source/dialog.cxx
+++ b/starmath/source/dialog.cxx
@@ -280,6 +280,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_xEnableInlineEdit->set_active(rSet->Get(SID_INLINE_EDIT_ENABLE).GetValue());
 m_xNoRightSpaces->set_active(rSet->Get(SID_NO_RIGHT_SPACES).GetValue());
 
m_xSaveOnlyUsedSymbols->set_active(rSet->Get(SID_SAVE_ONLY_USED_SYMBOLS).GetValue());


[Libreoffice-commits] core.git: starmath/source

2023-10-29 Thread Mike Kaganski (via logerrit)
 starmath/source/unomodel.cxx |6 +-
 1 file changed, 5 insertions(+), 1 deletion(-)

New commits:
commit 798d21e2a1b8bc48b6bb5e1b3cf0cba0e5882a59
Author: Mike Kaganski 
AuthorDate: Sun Oct 29 16:36:43 2023 +0300
Commit: Mike Kaganski 
CommitDate: Sun Oct 29 20:26:38 2023 +0100

tdf#157965: UNO methods are expected to return sizes in mm/100

Commit 9e92a17cb6e03beedeeca40bfc8524c2623d31eb made sm to always
use twips; before, it used mm/100 except in LOK. That change broke
the size values returned from XRenderable::getRenderer: instead of
mm/100, the resulting values were in twips, but handled as mm/100.

Set the printer's map mode to use mm/100s explicitly. Also use
mm/100s in the call to SvxPaperInfo::GetDefaultPaperSize.

Change-Id: Id7cf40d4bc19c92dc54ca03d81f25ba1f6bf25b9
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158622
Tested-by: Jenkins
Reviewed-by: Mike Kaganski 

diff --git a/starmath/source/unomodel.cxx b/starmath/source/unomodel.cxx
index 73f1c4b17715..829c57de820f 100644
--- a/starmath/source/unomodel.cxx
+++ b/starmath/source/unomodel.cxx
@@ -960,12 +960,16 @@ uno::Sequence< beans::PropertyValue > SAL_CALL 
SmModel::getRenderer(
 SmPrinterAccess aPrinterAccess( *pDocSh );
 Size aPrtPaperSize;
 if (Printer *pPrinter = aPrinterAccess.GetPrinter())
+{
+// tdf#157965: UNO methods are expected to return sizes in mm/100
+pPrinter->SetMapMode(MapMode(MapUnit::Map100thMM)); // reset in 
SmPrinterAccess dtor
 aPrtPaperSize = pPrinter->GetPaperSize();
+}
 
 // if paper size is 0 (usually if no 'real' printer is found),
 // guess the paper size
 if (aPrtPaperSize.IsEmpty())
-aPrtPaperSize = SvxPaperInfo::GetDefaultPaperSize(SmMapUnit());
+aPrtPaperSize = SvxPaperInfo::GetDefaultPaperSize(MapUnit::Map100thMM);
 awt::Size   aPageSize( aPrtPaperSize.Width(), aPrtPaperSize.Height() );
 
 uno::Sequence< beans::PropertyValue > aRenderer(1);


[Libreoffice-commits] core.git: starmath/source

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

New commits:
commit 81f36caea6acd3042d42625940a9396305f5569c
Author: Mike Kaganski 
AuthorDate: Sun Oct 29 14:57:03 2023 +0300
Commit: Mike Kaganski 
CommitDate: Sun Oct 29 14:28:28 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 

diff --git a/starmath/source/document.cxx b/starmath/source/document.cxx
index 91bdcc601ec4..715525c94307 100644
--- a/starmath/source/document.cxx
+++ b/starmath/source/document.cxx
@@ -1550,7 +1550,7 @@ void SmDocShell::Impl_Print(OutputDevice& rOutDev, const 
SmPrintUIOptions& rPrin
 = 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: starmath/source

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

New commits:
commit 8dda6270f8b9af6fcfba2a3a935612ab5a81c247
Author: Mike Kaganski 
AuthorDate: Sat Oct 28 18:06:34 2023 +0300
Commit: Mike Kaganski 
CommitDate: Sat Oct 28 21:40:43 2023 +0200

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 

diff --git a/starmath/source/unomodel.cxx b/starmath/source/unomodel.cxx
index 96e41599ddad..114fb29e43d7 100644
--- a/starmath/source/unomodel.cxx
+++ b/starmath/source/unomodel.cxx
@@ -958,8 +958,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
@@ -1029,11 +1030,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: starmath/source

2023-10-20 Thread Stephan Bergmann (via logerrit)
 starmath/source/cfgitem.cxx |4 ++--
 starmath/source/dialog.cxx  |2 +-
 starmath/source/mathml/mathmlexport.cxx |8 
 starmath/source/unomodel.cxx|4 ++--
 4 files changed, 9 insertions(+), 9 deletions(-)

New commits:
commit 734db70ec85944aefb55a41b198fe1a60b91b2ea
Author: Stephan Bergmann 
AuthorDate: Thu Oct 19 10:30:29 2023 +0200
Commit: Stephan Bergmann 
CommitDate: Fri Oct 20 10:58:12 2023 +0200

Extended loplugin:ostr: Automatic rewrite O[U]StringLiteral: starmath

Change-Id: I964db94e75e19cb507508b15755e3595247b5524
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158221
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann 

diff --git a/starmath/source/cfgitem.cxx b/starmath/source/cfgitem.cxx
index 5287b05e018d..8f698bb282ee 100644
--- a/starmath/source/cfgitem.cxx
+++ b/starmath/source/cfgitem.cxx
@@ -42,8 +42,8 @@
 using namespace com::sun::star::uno;
 using namespace com::sun::star::beans;
 
-constexpr OUStringLiteral SYMBOL_LIST = u"SymbolList";
-constexpr OUStringLiteral FONT_FORMAT_LIST = u"FontFormatList";
+constexpr OUString SYMBOL_LIST = u"SymbolList"_ustr;
+constexpr OUString FONT_FORMAT_LIST = u"FontFormatList"_ustr;
 
 static Sequence< OUString > lcl_GetFontPropertyNames()
 {
diff --git a/starmath/source/dialog.cxx b/starmath/source/dialog.cxx
index cea78036d59a..98f96eacb480 100644
--- a/starmath/source/dialog.cxx
+++ b/starmath/source/dialog.cxx
@@ -733,7 +733,7 @@ void SmDistanceDialog::SetCategory(sal_uInt16 nCategory)
 // array to convert category- and metricfield-number in help ids.
 // 0 is used in case of unused combinations.
 assert(NOCATEGORIES == 10 && "Sm : array doesn't fit into the number of 
categories");
-static constexpr OUStringLiteral EMPTY(u"");
+static constexpr OUString EMPTY(u""_ustr);
 static constexpr OUString aCatMf2Hid[10][4] =
 {
 { HID_SMA_DEFAULT_DIST, HID_SMA_LINE_DIST,  
HID_SMA_ROOT_DIST, EMPTY },
diff --git a/starmath/source/mathml/mathmlexport.cxx 
b/starmath/source/mathml/mathmlexport.cxx
index c498187222e9..3c308cd84bc6 100644
--- a/starmath/source/mathml/mathmlexport.cxx
+++ b/starmath/source/mathml/mathmlexport.cxx
@@ -124,10 +124,10 @@ bool SmXMLExportWrapper::Export(SfxMedium& rMedium)
 }
 }
 
-static constexpr OUStringLiteral sUsePrettyPrinting(u"UsePrettyPrinting");
-static constexpr OUStringLiteral sBaseURI(u"BaseURI");
-static constexpr OUStringLiteral sStreamRelPath(u"StreamRelPath");
-static constexpr OUStringLiteral sStreamName(u"StreamName");
+static constexpr OUString sUsePrettyPrinting(u"UsePrettyPrinting"_ustr);
+static constexpr OUString sBaseURI(u"BaseURI"_ustr);
+static constexpr OUString sStreamRelPath(u"StreamRelPath"_ustr);
+static constexpr OUString sStreamName(u"StreamName"_ustr);
 
 // create XPropertySet with three properties for status indicator
 static const comphelper::PropertyMapEntry aInfoMap[] = {
diff --git a/starmath/source/unomodel.cxx b/starmath/source/unomodel.cxx
index 8348287f9350..96e41599ddad 100644
--- a/starmath/source/unomodel.cxx
+++ b/starmath/source/unomodel.cxx
@@ -393,8 +393,8 @@ sal_Bool SmModel::supportsService(const OUString& 
rServiceName)
 
 uno::Sequence< OUString > SmModel::getSupportedServiceNames()
 {
-static constexpr OUStringLiteral service1 = 
u"com.sun.star.document.OfficeDocument";
-static constexpr OUStringLiteral service2 = 
u"com.sun.star.formula.FormulaProperties";
+static constexpr OUString service1 = 
u"com.sun.star.document.OfficeDocument"_ustr;
+static constexpr OUString service2 = 
u"com.sun.star.formula.FormulaProperties"_ustr;
 return uno::Sequence{ service1, service2 };
 }
 


[Libreoffice-commits] core.git: starmath/source

2023-09-30 Thread Andrea Gelmini (via logerrit)
 starmath/source/dialog.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit f401545131119de63f38a7c4f0877405a040292c
Author: Andrea Gelmini 
AuthorDate: Sat Sep 30 12:58:28 2023 +0200
Commit: Julien Nabet 
CommitDate: Sat Sep 30 13:14:55 2023 +0200

Fix typo

Change-Id: I178b1612466971a139817aee217a80cc19449291
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157427
Tested-by: Julien Nabet 
Reviewed-by: Julien Nabet 

diff --git a/starmath/source/dialog.cxx b/starmath/source/dialog.cxx
index 8061e8f53f25..bacc84fcba87 100644
--- a/starmath/source/dialog.cxx
+++ b/starmath/source/dialog.cxx
@@ -91,7 +91,7 @@ vcl::Font lclGetSymbolFont(const SmViewShell& rViewShell, 
const SmSym )
 if (pDoc)
 {
 // If we have a document, we want to render the symbol using the font 
and style used in
-// the documnet, so we do that by creating a node and preparing it, 
then get the resolved
+// the document, so we do that by creating a node and preparing it, 
then get the resolved
 // font and style from it.
 SmToken token(TSPECIAL, '\0', "%" + rSymbol.GetUiName());
 SmSpecialNode aNode(token);


[Libreoffice-commits] core.git: starmath/source

2023-09-30 Thread Andrea Gelmini (via logerrit)
 starmath/source/dialog.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit cd0337df5e8d5b0ada76eff847c36146fc9704b7
Author: Andrea Gelmini 
AuthorDate: Sat Sep 30 12:58:16 2023 +0200
Commit: Julien Nabet 
CommitDate: Sat Sep 30 13:14:37 2023 +0200

Fix typo

Change-Id: I4bfea09a6f400e49af47cd898ec2941c44430fb1
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157426
Tested-by: Julien Nabet 
Reviewed-by: Julien Nabet 

diff --git a/starmath/source/dialog.cxx b/starmath/source/dialog.cxx
index 585f5a0df475..8061e8f53f25 100644
--- a/starmath/source/dialog.cxx
+++ b/starmath/source/dialog.cxx
@@ -90,7 +90,7 @@ vcl::Font lclGetSymbolFont(const SmViewShell& rViewShell, 
const SmSym )
 const SmDocShell* pDoc = rViewShell.GetDoc();
 if (pDoc)
 {
-// If we have a document, we want to render the symbol useing the font 
and style used in
+// If we have a document, we want to render the symbol using the font 
and style used in
 // the documnet, so we do that by creating a node and preparing it, 
then get the resolved
 // font and style from it.
 SmToken token(TSPECIAL, '\0', "%" + rSymbol.GetUiName());


[Libreoffice-commits] core.git: starmath/source

2023-09-30 Thread Andrea Gelmini (via logerrit)
 starmath/source/node.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit b6e2576798c48eba907a20728afb83fdafe51ee6
Author: Andrea Gelmini 
AuthorDate: Sat Sep 30 12:57:52 2023 +0200
Commit: Julien Nabet 
CommitDate: Sat Sep 30 13:14:15 2023 +0200

Fix typo

Change-Id: I906deadf53e1c564c786e5b5f8184e706c4dbdec
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157425
Tested-by: Julien Nabet 
Reviewed-by: Julien Nabet 

diff --git a/starmath/source/node.cxx b/starmath/source/node.cxx
index 1a89b52c4110..778baaa74dca 100644
--- a/starmath/source/node.cxx
+++ b/starmath/source/node.cxx
@@ -1871,7 +1871,7 @@ void SmTextNode::Prepare(const SmFormat , const 
SmDocShell , i
 if (maText.getLength() == 1 && GetToken().aText[0] == ':')
 Attributes() &= ~FontAttribute::Italic;
 
-// Arabic text should not be italic, so we check for any charcter in 
Arabic script and
+// Arabic text should not be italic, so we check for any character in 
Arabic script and
 // remove italic attribute.
 if (!maText.isEmpty())
 {


[Libreoffice-commits] core.git: starmath/source

2023-09-21 Thread Khaled Hosny (via logerrit)
 starmath/source/symbol.cxx |3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

New commits:
commit d31cc3545ba05d5a45d38d8e72c2428af91cb784
Author: Khaled Hosny 
AuthorDate: Thu Sep 21 13:47:08 2023 +0300
Commit: خالد حسني 
CommitDate: Thu Sep 21 16:40:30 2023 +0200

starmath: No need for the OUString copy here

Change-Id: I71e6fd6ff9f5420899ece59b97b81b5e837f919b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157142
Tested-by: Jenkins
Reviewed-by: خالد حسني 

diff --git a/starmath/source/symbol.cxx b/starmath/source/symbol.cxx
index b4309dad586f..4bb854f1236f 100644
--- a/starmath/source/symbol.cxx
+++ b/starmath/source/symbol.cxx
@@ -140,12 +140,11 @@ SmSym 
*SmSymbolManager::GetSymbolByUiName(std::u16string_view rSymbolName)
 
 SmSym* SmSymbolManager::GetSymbolByExportName(std::u16string_view rSymbolName)
 {
-OUString aSymbolName(rSymbolName);
 SmSym* pRes = nullptr;
 for (auto& rPair : m_aSymbols)
 {
 SmSym& rSymbol = rPair.second;
-if (rSymbol.GetExportName() == aSymbolName)
+if (rSymbol.GetExportName() == rSymbolName)
 {
 pRes = 
 break;


[Libreoffice-commits] core.git: starmath/source

2023-09-20 Thread Khaled Hosny (via logerrit)
 starmath/source/unomodel.cxx |3 +++
 1 file changed, 3 insertions(+)

New commits:
commit 8bf38cc394f96a1f1592a7bbd62e1f7db03f3db6
Author: Khaled Hosny 
AuthorDate: Wed Sep 20 09:26:33 2023 +0300
Commit: خالد حسني 
CommitDate: Wed Sep 20 10:12:00 2023 +0200

starmath: Don’t set empty font name when reading font format from file

If a setting is missing, e.g. math font when reading old file, we would
set it to an empty font instead of using the default.

Regression from:

commit 626d17a8ec270937575e9684a325eb0669327a25
Author: Khaled Hosny 
Date:   Thu Aug 31 14:54:52 2023 +0300

tdf#143213: Fix reading math font settings from file

Change-Id: Ib8b3cede3d4bea7e03a146b7e5f39ad2c7dfa363
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157094
Tested-by: Jenkins
Reviewed-by: خالد حسني 

diff --git a/starmath/source/unomodel.cxx b/starmath/source/unomodel.cxx
index 4e02783b5ebb..0f3d5b4464e0 100644
--- a/starmath/source/unomodel.cxx
+++ b/starmath/source/unomodel.cxx
@@ -674,6 +674,9 @@ void SmModel::_setPropertyValues(const PropertyMapEntry** 
ppEntries, const Any*
 for (sal_uInt16 nFontDesc = FNT_BEGIN; nFontDesc <= FNT_END; ++nFontDesc)
 {
 const SmFace& rFont = maFonts[nFontDesc];
+if (rFont.GetFamilyName().isEmpty())
+continue;
+
 if (aFormat.GetFont(nFontDesc).GetFamilyName() != 
rFont.GetFamilyName())
 {
 const SmFace rOld = aFormat.GetFont(nFontDesc);


[Libreoffice-commits] core.git: starmath/source

2023-09-15 Thread Khaled Hosny (via logerrit)
 starmath/source/node.cxx |6 ++
 1 file changed, 6 insertions(+)

New commits:
commit a15762233047a75588f8c5da1cee1134f1259417
Author: Khaled Hosny 
AuthorDate: Thu Sep 14 20:03:36 2023 +0300
Commit: خالد حسني 
CommitDate: Fri Sep 15 12:44:05 2023 +0200

starmath: Improve root rendering for fonts other than OpenSymbol

The radical glyph in OpenSymbol is aligned to the font ascender, which
is not essentially true for other fonts, so we now use the bounding
rectangle of the glyph to get accurate positioning.

Change-Id: I83c21cd21de25f23f96f819e168f43aa9ab22351
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156926
Tested-by: Jenkins
Reviewed-by: خالد حسني 

diff --git a/starmath/source/node.cxx b/starmath/source/node.cxx
index 1572d5f8e67e..92eafe8dbccb 100644
--- a/starmath/source/node.cxx
+++ b/starmath/source/node.cxx
@@ -769,6 +769,12 @@ void SmRootNode::Arrange(OutputDevice , const 
SmFormat )
 
 pRootSym->Arrange(rDev, rFormat);
 
+// Set the top and bottom of the root symbol to the top and bottom of its 
glyph bounding rect,
+// to get accurate position of the root symbol.
+SmRect rRootSymRect = pRootSym->AsGlyphRect();
+pRootSym->SetTop(rRootSymRect.GetTop());
+pRootSym->SetBottom(rRootSymRect.GetBottom());
+
 Point  aPos = pRootSym->AlignTo(*pBody, RectPos::Left, 
RectHorAlign::Center, RectVerAlign::Baseline);
 //! override calculated vertical position
 aPos.setY( pRootSym->GetTop() + pBody->GetBottom() - pRootSym->GetBottom() 
);


[Libreoffice-commits] core.git: starmath/source

2023-09-09 Thread Andrea Gelmini (via logerrit)
 starmath/source/cursor.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit fafb156b2dfe1169997b1546da7966355684f611
Author: Andrea Gelmini 
AuthorDate: Fri Sep 8 21:33:46 2023 +0200
Commit: Julien Nabet 
CommitDate: Sat Sep 9 10:16:03 2023 +0200

Fix typo

Change-Id: Ifac298898f2d36bcbaffb111346d1e9fa71b2e1f
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156758
Tested-by: Julien Nabet 
Reviewed-by: Julien Nabet 

diff --git a/starmath/source/cursor.cxx b/starmath/source/cursor.cxx
index ef4853cb22a4..c127c35f56c3 100644
--- a/starmath/source/cursor.cxx
+++ b/starmath/source/cursor.cxx
@@ -1105,7 +1105,7 @@ void SmCursor::Paste(vcl::Window* pWindow)
 auto aDataHelper(TransferableDataHelper::CreateFromClipboard(xClipboard));
 if (aDataHelper.GetTransferable().is())
 {
-// TODO: Suppport MATHML
+// TODO: Support MATHML
 auto nId = SotClipboardFormatId::STRING;
 if (aDataHelper.HasFormat(nId))
 {


[Libreoffice-commits] core.git: starmath/source

2023-09-04 Thread Khaled Hosny (via logerrit)
 starmath/source/view.cxx |2 ++
 1 file changed, 2 insertions(+)

New commits:
commit fe3098b4c4b5b8099e43279044db9ae7a1e0999d
Author: Khaled Hosny 
AuthorDate: Sun Aug 27 15:06:14 2023 +0300
Commit: خالد حسني 
CommitDate: Mon Sep 4 18:18:16 2023 +0200

tdf#134193: Fix RTL selection and cursor handling

Change-Id: Ib9d7dd56d884aaca9b88a8b9403aeef30a9917d5
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156167
Tested-by: Jenkins
Reviewed-by: خالد حسني 

diff --git a/starmath/source/view.cxx b/starmath/source/view.cxx
index 6505031f13ba..85dccb711ec6 100644
--- a/starmath/source/view.cxx
+++ b/starmath/source/view.cxx
@@ -310,6 +310,7 @@ void SmGraphicWidget::SetDrawingArea(weld::DrawingArea* 
pDrawingArea)
 
 OutputDevice& rDevice = GetOutputDevice();
 
+rDevice.EnableRTL(GetDoc()->GetFormat().IsRightToLeft());
 
rDevice.SetBackground(SM_MOD()->GetColorConfig().GetColorValue(svtools::DOCCOLOR).nColor);
 
 if (comphelper::LibreOfficeKit::isActive())
@@ -2073,6 +2074,7 @@ void SmViewShell::Execute(SfxRequest& rReq)
 {
 bool bRTL = rReq.GetSlot() == SID_ATTR_PARA_RIGHT_TO_LEFT;
 GetDoc()->SetRightToLeft(bRTL);
+
GetGraphicWindow().GetGraphicWidget().GetOutputDevice().EnableRTL(bRTL);
 GetViewFrame().GetBindings().Invalidate(bRTL ? 
SID_ATTR_PARA_LEFT_TO_RIGHT : SID_ATTR_PARA_RIGHT_TO_LEFT);
 }
 break;


[Libreoffice-commits] core.git: starmath/source

2023-09-04 Thread Khaled Hosny (via logerrit)
 starmath/source/view.cxx |   36 +---
 1 file changed, 17 insertions(+), 19 deletions(-)

New commits:
commit 03c43d303b6d32dc4c39bd273d446b66a3e6c42d
Author: Khaled Hosny 
AuthorDate: Thu Aug 31 11:55:22 2023 +0300
Commit: خالد حسني 
CommitDate: Mon Sep 4 11:58:15 2023 +0200

Math: enable in-place editing on desktop

Move the code outside the else block as it doesn’t get hit for me on
desktop otherwise, and use SmViewShell::IsInlineEditEnabled() instead of
comphelper::LibreOfficeKit::isActive() (which is included in the former).

Followup to:

commit 737a270c61cd2038ede7911b7d7b4afcf020f53c
Date:   Mon Jan 17 17:15:46 2022 +0300

lok: enable in-place editing of math equations

Change-Id: Ie604f152344b83479eaf6024b6d58e374abb39b8
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156331
Tested-by: Jenkins
Reviewed-by: خالد حسني 

diff --git a/starmath/source/view.cxx b/starmath/source/view.cxx
index 97332a4810c1..a71438bc82b5 100644
--- a/starmath/source/view.cxx
+++ b/starmath/source/view.cxx
@@ -835,26 +835,24 @@ bool SmGraphicWidget::Command(const CommandEvent& rCEvt)
 default: break;
 }
 }
-else
+
+switch (rCEvt.GetCommand())
 {
-switch (rCEvt.GetCommand())
-{
-case CommandEventId::ExtTextInput:
-if (comphelper::LibreOfficeKit::isActive())
-{
-const CommandExtTextInputData* pData = 
rCEvt.GetExtTextInputData();
-assert(pData);
-const OUString& rText = pData->GetText();
-SmCursor& rCursor = GetCursor();
-OutputDevice& rDevice = GetOutputDevice();
-for (sal_Int32 i = 0; i < rText.getLength();)
-CharInput(rText.iterateCodePoints(), rCursor, 
rDevice);
-bCallBase = false;
-}
-break;
-default:
-break;
-}
+case CommandEventId::ExtTextInput:
+if (SmViewShell::IsInlineEditEnabled())
+{
+const CommandExtTextInputData* pData = 
rCEvt.GetExtTextInputData();
+assert(pData);
+const OUString& rText = pData->GetText();
+SmCursor& rCursor = GetCursor();
+OutputDevice& rDevice = GetOutputDevice();
+for (sal_Int32 i = 0; i < rText.getLength();)
+CharInput(rText.iterateCodePoints(), rCursor, rDevice);
+bCallBase = false;
+}
+break;
+default:
+break;
 }
 return !bCallBase;
 }


[Libreoffice-commits] core.git: starmath/source

2023-09-03 Thread Khaled Hosny (via logerrit)
 starmath/source/view.cxx |6 --
 1 file changed, 4 insertions(+), 2 deletions(-)

New commits:
commit cc7d6211bc01e5ec84dbad542605d2e93dea925c
Author: Khaled Hosny 
AuthorDate: Sun Sep 3 19:00:22 2023 +0300
Commit: خالد حسني 
CommitDate: Sun Sep 3 23:26:07 2023 +0200

starmath: Disable formula cursor toolbar button when inline editing is 
enabled

It is ignore when inline editing is enable, so better disable it to make
it clear.

Change-Id: Ie79a1c16109109e213658d44a6ffc0bff2291c7a
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156487
Tested-by: Jenkins
Reviewed-by: خالد حسني 

diff --git a/starmath/source/view.cxx b/starmath/source/view.cxx
index 3e1e4909ea1d..97332a4810c1 100644
--- a/starmath/source/view.cxx
+++ b/starmath/source/view.cxx
@@ -2144,8 +2144,10 @@ void SmViewShell::GetState(SfxItemSet )
 
 case SID_FORMULACURSOR:
 {
-SmModule *pp = SM_MOD();
-rSet.Put(SfxBoolItem(nWh, 
pp->GetConfig()->IsShowFormulaCursor()));
+if (IsInlineEditEnabled())
+rSet.DisableItem(nWh);
+else
+rSet.Put(SfxBoolItem(nWh, 
SM_MOD()->GetConfig()->IsShowFormulaCursor()));
 }
 break;
 case SID_ELEMENTSDOCKINGWINDOW:


[Libreoffice-commits] core.git: starmath/source

2023-08-14 Thread Miklos Vajna (via logerrit)
 starmath/source/symbol.cxx |3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

New commits:
commit 518fa99dd7693d64a53e404a065090aedc0002b1
Author: Miklos Vajna 
AuthorDate: Mon Aug 14 10:50:41 2023 +0200
Commit: Miklos Vajna 
CommitDate: Mon Aug 14 13:04:17 2023 +0200

starmath: fix -Werror=unused-variable

Seen with gcc 7.5.0.

Change-Id: I34940865f62ff397a3a6813fbabd0fb45a01d88f
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155654
Reviewed-by: Miklos Vajna 
Tested-by: Jenkins

diff --git a/starmath/source/symbol.cxx b/starmath/source/symbol.cxx
index 1523543d0a43..3baf79702faf 100644
--- a/starmath/source/symbol.cxx
+++ b/starmath/source/symbol.cxx
@@ -117,8 +117,9 @@ SmSym *SmSymbolManager::GetSymbolByName(const OUString& 
rSymbolName)
 pRes = >second;
 else
 {
-for (auto& [_, rSymbol] : m_aSymbols)
+for (auto& rPair : m_aSymbols)
 {
+SmSym& rSymbol = rPair.second;
 if (rSymbol.GetExportName() == rSymbolName)
 {
 pRes = 


[Libreoffice-commits] core.git: starmath/source

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

New commits:
commit 25b2e4a4e2f9b2191bdd80cca5a015e5b6089399
Author: Khaled Hosny 
AuthorDate: Thu Aug 10 14:19:45 2023 +0300
Commit: خالد حسني 
CommitDate: Thu Aug 10 15:43:47 2023 +0200

tdf#32415: Always accept English symbol names in math

If symbol name does not match localized names, try to find a match using
English (export) names.

Change-Id: Id668ee68b07c8431c2780b78e26e07d3aef043aa
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/13
Tested-by: Jenkins
Reviewed-by: خالد حسني 

diff --git a/starmath/source/symbol.cxx b/starmath/source/symbol.cxx
index 5dcf17309372..1523543d0a43 100644
--- a/starmath/source/symbol.cxx
+++ b/starmath/source/symbol.cxx
@@ -115,6 +115,17 @@ SmSym *SmSymbolManager::GetSymbolByName(const OUString& 
rSymbolName)
 SymbolMap_t::iterator aIt( m_aSymbols.find( rSymbolName ) );
 if (aIt != m_aSymbols.end())
 pRes = >second;
+else
+{
+for (auto& [_, rSymbol] : m_aSymbols)
+{
+if (rSymbol.GetExportName() == rSymbolName)
+{
+pRes = 
+break;
+}
+}
+}
 return pRes;
 }
 


[Libreoffice-commits] core.git: starmath/source

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

New commits:
commit ca78e610e1a4d20021d204c3d7857e6edb591fa6
Author: Khaled Hosny 
AuthorDate: Thu Aug 10 10:11:22 2023 +0300
Commit: خالد حسني 
CommitDate: Thu Aug 10 12:23:37 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: خالد حسني 

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: starmath/source

2023-07-27 Thread Andrea Gelmini (via logerrit)
 starmath/source/view.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 9d1cc55a7738ac401aaa787c42ce9c330c38631b
Author: Andrea Gelmini 
AuthorDate: Thu Jul 27 11:02:18 2023 +0200
Commit: Julien Nabet 
CommitDate: Thu Jul 27 11:45:27 2023 +0200

Fix typo

Change-Id: I09fc9db6621a1e074a76e38d1d98a666ab2159f5
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/154983
Tested-by: Julien Nabet 
Reviewed-by: Julien Nabet 

diff --git a/starmath/source/view.cxx b/starmath/source/view.cxx
index 449dc0e586e7..e495039326f9 100644
--- a/starmath/source/view.cxx
+++ b/starmath/source/view.cxx
@@ -151,7 +151,7 @@ void SmGraphicWindow::Resize()
 const auto nScrSize = mxScrolledWindow->get_scroll_thickness();
 bool bVVisible = false; // by default no vertical-ScrollBar
 bool bHVisible = false; // by default no horizontal-ScrollBar
-bool bChanged;  // determines if a visiblility was changed
+bool bChanged;  // determines if a visibility was changed
 do
 {
 bChanged = false;


[Libreoffice-commits] core.git: starmath/source

2023-07-10 Thread Szymon Kłos (via logerrit)
 starmath/source/document.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit c6619100ed6d0524ac5294c1a9e1467a4371aee0
Author: Szymon Kłos 
AuthorDate: Fri Jul 7 11:54:02 2023 +0200
Commit: Szymon Kłos 
CommitDate: Mon Jul 10 18:43:00 2023 +0200

math: set initial formula width to non-zero

After:
commit 96de6dee60aaf2f0d332291fa3b0ad7bb8b7127c
tdf#65067 Remove excessive spacing from Formula objects

Initial size of formula object is 1 (width).
This makes it ugly and hard to resize.

Let's make it bigger when it is empty.

Change-Id: I823de83b0f79a5a30c6ea6227f117daca3157e5f
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/154160
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Mike Kaganski 
(cherry picked from commit 9fefa504be3e5ef28a5ef9a0dab7be7044def3c0)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/154252
Tested-by: Jenkins
Reviewed-by: Szymon Kłos 

diff --git a/starmath/source/document.cxx b/starmath/source/document.cxx
index 81187d376c4b..a62d1e949d1a 100644
--- a/starmath/source/document.cxx
+++ b/starmath/source/document.cxx
@@ -373,7 +373,7 @@ Size SmDocShell::GetSize()
 ArrangeFormula();
 aRet = mpTree->GetSize();
 
-if ( !aRet.Width() )
+if ( !aRet.Width() || aRet.Width() == 1 )
 aRet.setWidth( 2000 );
 else
 aRet.AdjustWidth(maFormat.GetDistance( DIS_LEFTSPACE ) +


[Libreoffice-commits] core.git: 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 359e2be93a4560a86237f076003c23a6635fb1bb
Author: Xisco Fauli 
AuthorDate: Wed Jul 5 11:29:34 2023 +0200
Commit: Xisco Fauli 
CommitDate: Thu Jul 6 16:41:07 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 

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 d056e4c86ee7..a67745184e34 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()));
 uno::Reference < io::XInputStream > xStrm;
-SotClipboardFormatId nId;
-if( aData.GetTransferable().is() &&
-

[Libreoffice-commits] core.git: starmath/source

2023-07-06 Thread Mike Kaganski (via logerrit)
 starmath/source/view.cxx |   30 ++
 1 file changed, 30 insertions(+)

New commits:
commit a0ab053c9f7645ff10a1ab69858a30bb3bb4857c
Author: Mike Kaganski 
AuthorDate: Tue Sep 27 10:48:21 2022 +0300
Commit: Szymon Kłos 
CommitDate: Thu Jul 6 14:21:00 2023 +0200

lok: Register sidebar for frame explicitly

For some reason, it is needed in 22.05 (unlike master). Without this,
sidebar sometimes isn't shown in inline edit mode.

Change-Id: Ie225ff0676786e9164e8640c6e159efb8aebf241
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/140640
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Mike Kaganski 
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/154022
Reviewed-by: Szymon Kłos 
(cherry picked from commit 8a1f78dab16e3b27752b76e9013ec2249c894dbc)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/154113
Tested-by: Jenkins

diff --git a/starmath/source/view.cxx b/starmath/source/view.cxx
index ea802231b6a5..d056e4c86ee7 100644
--- a/starmath/source/view.cxx
+++ b/starmath/source/view.cxx
@@ -2149,6 +2149,24 @@ void SmViewShell::GetState(SfxItemSet )
 
 namespace
 {
+css::uno::Reference
+getSidebarFromModel(const css::uno::Reference& xModel)
+{
+css::uno::Reference xChild(xModel, 
css::uno::UNO_QUERY);
+if (!xChild.is())
+return nullptr;
+css::uno::Reference xParent(xChild->getParent(), 
css::uno::UNO_QUERY);
+if (!xParent.is())
+return nullptr;
+css::uno::Reference 
xController(xParent->getCurrentController(),
+  
css::uno::UNO_QUERY);
+if (!xController.is())
+return nullptr;
+css::uno::Reference xSidebarProvider = 
xController->getSidebar();
+if (!xSidebarProvider.is())
+return nullptr;
+return xSidebarProvider->getSidebar();
+}
 class SmController : public SfxBaseController
 {
 public:
@@ -2168,7 +2186,19 @@ public:
 SfxBaseController::attachFrame(xFrame);
 
 if (comphelper::LibreOfficeKit::isActive())
+{
 CopyLokViewCallbackFromFrameCreator();
+// In lok mode, DocumentHolder::ShowUI is not called on OLE 
in-place activation,
+// because respective code is skipped in 
OCommonEmbeddedObject::SwitchStateTo_Impl,
+// so sidebar controller does not get registered properly; do it 
here
+if (auto xSidebar = getSidebarFromModel(getModel()))
+{
+auto pSidebar = 
dynamic_cast(xSidebar.get());
+assert(pSidebar);
+pSidebar->registerSidebarForFrame(this);
+pSidebar->updateModel(getModel());
+}
+}
 
 // No need to call mpSelectionChangeHandler->Connect() unless 
SmController implements XSelectionSupplier
 mpSelectionChangeHandler->selectionChanged({}); // Installs the 
correct context


[Libreoffice-commits] core.git: starmath/source

2023-07-06 Thread Mike Kaganski (via logerrit)
 starmath/source/SmElementsPanel.cxx |   11 ++-
 1 file changed, 10 insertions(+), 1 deletion(-)

New commits:
commit 107ec1a9bd17c195998687460a3aee0eb41ff897
Author: Mike Kaganski 
AuthorDate: Tue Sep 27 14:05:19 2022 +0300
Commit: Szymon Kłos 
CommitDate: Thu Jul 6 14:20:41 2023 +0200

lok: find active SmViewShell reliably in Elements panel

It is needed in 22.05, unlike master

Change-Id: I76265888e7814f47b09c405dc1e907aa0dfbc743
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/140646
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Mike Kaganski 
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/154114
Tested-by: Jenkins
Reviewed-by: Szymon Kłos 

diff --git a/starmath/source/SmElementsPanel.cxx 
b/starmath/source/SmElementsPanel.cxx
index be08091508c0..dec685787c3a 100644
--- a/starmath/source/SmElementsPanel.cxx
+++ b/starmath/source/SmElementsPanel.cxx
@@ -19,7 +19,9 @@
 
 #include 
 
+#include 
 #include 
+#include 
 #include 
 
 #include "SmElementsPanel.hxx"
@@ -84,7 +86,14 @@ IMPL_LINK(SmElementsPanel, ElementClickHandler, OUString, 
ElementSource, void)
 SmViewShell* SmElementsPanel::GetView() const
 {
 SfxViewShell* pView = 
mrBindings.GetDispatcher()->GetFrame()->GetViewShell();
-return dynamic_cast(pView);
+SmViewShell* pSmViewShell = dynamic_cast(pView);
+if (!pSmViewShell && comphelper::LibreOfficeKit::isActive())
+{
+auto* pWindow = 
static_cast(LokStarMathHelper(pView).GetGraphicWindow());
+if (pWindow)
+pSmViewShell = >GetGraphicWidget().GetView();
+}
+return pSmViewShell;
 }
 
 } // end of namespace sm::sidebar


[Libreoffice-commits] core.git: starmath/source

2023-06-04 Thread Julien Nabet (via logerrit)
 starmath/source/mathtype.cxx |   11 +--
 1 file changed, 1 insertion(+), 10 deletions(-)

New commits:
commit 97710bbf1df975e896839cd78a34bdab7be7622a
Author: Julien Nabet 
AuthorDate: Sun Jun 4 09:18:16 2023 +0200
Commit: Julien Nabet 
CommitDate: Sun Jun 4 11:02:01 2023 +0200

MathType::HandleNodes: SmNodeType::Expression does the same as default one

Change-Id: I0b7b17bf93470ac07f53c656f91f12b1cec4cd7c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152584
Tested-by: Jenkins
Reviewed-by: Julien Nabet 

diff --git a/starmath/source/mathtype.cxx b/starmath/source/mathtype.cxx
index a3199c06c686..56a666b969f3 100644
--- a/starmath/source/mathtype.cxx
+++ b/starmath/source/mathtype.cxx
@@ -1976,16 +1976,6 @@ void MathType::HandleNodes(SmNode *pNode,int nLevel)
 case SmNodeType::SubSup:
 HandleSubSupScript(pNode,nLevel);
 break;
-case SmNodeType::Expression:
-{
-size_t nSize = pNode->GetNumSubNodes();
-for (size_t i = 0; i < nSize; ++i)
-{
-if (SmNode *pTemp = pNode->GetSubNode(i))
-HandleNodes(pTemp,nLevel+1);
-}
-break;
-}
 case SmNodeType::Table:
 //Root Node, PILE equivalent, i.e. vertical stack
 HandleTable(pNode,nLevel);
@@ -2017,6 +2007,7 @@ void MathType::HandleNodes(SmNode *pNode,int nLevel)
 else
 pS->WriteUInt16( 0xEB05 );
 break;
+case SmNodeType::Expression: // same treatment as the default one
 default:
 {
 size_t nSize = pNode->GetNumSubNodes();


[Libreoffice-commits] core.git: starmath/source

2023-06-04 Thread Julien Nabet (via logerrit)
 starmath/source/visitors.cxx |   76 +++
 1 file changed, 13 insertions(+), 63 deletions(-)

New commits:
commit 7932427a39e684d78f2108d14660288a46f42df9
Author: Julien Nabet 
AuthorDate: Sun Jun 4 09:12:04 2023 +0200
Commit: Julien Nabet 
CommitDate: Sun Jun 4 09:58:57 2023 +0200

Related tdf#155630: deduplicate in starmath/visitors (2)

Change-Id: I86e629260c5f25a67627589f5b33edc939aa1dff
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152583
Tested-by: Jenkins
Reviewed-by: Julien Nabet 

diff --git a/starmath/source/visitors.cxx b/starmath/source/visitors.cxx
index 92c1ef3413ec..a15a62a4b048 100644
--- a/starmath/source/visitors.cxx
+++ b/starmath/source/visitors.cxx
@@ -954,70 +954,20 @@ void SmCaretPosGraphBuildingVisitor::Visit( SmOperNode* 
pNode )
 SmSubSupNode* pSubSup = pOper->GetType( ) == SmNodeType::SubSup ? 
static_cast(pOper) : nullptr;
 
 if( pSubSup ) {
-SmNode* pChild = pSubSup->GetSubSup( LSUP );
-if( pChild ) {
-//Create position in front of pChild
-SmCaretPosGraphEntry *childLeft = mpGraph->Add( SmCaretPos( 
pChild, 0 ), left );
-//Visit pChild
-mpRightMost = childLeft;
-pChild->Accept( this );
-//Set right on mpRightMost from pChild
-mpRightMost->SetRight( bodyLeft );
-}
-
-pChild = pSubSup->GetSubSup( LSUB );
-if( pChild ) {
-//Create position in front of pChild
-SmCaretPosGraphEntry *childLeft = mpGraph->Add( SmCaretPos( 
pChild, 0 ), left );
-//Visit pChild
-mpRightMost = childLeft;
-pChild->Accept( this );
-//Set right on mpRightMost from pChild
-mpRightMost->SetRight( bodyLeft );
-}
-
-pChild = pSubSup->GetSubSup( CSUP );
-if ( pChild ) {//TO
-//Create position in front of pChild
-SmCaretPosGraphEntry *childLeft = mpGraph->Add( SmCaretPos( 
pChild, 0 ), left );
-//Visit pChild
-mpRightMost = childLeft;
-pChild->Accept( this );
-//Set right on mpRightMost from pChild
-mpRightMost->SetRight( bodyLeft );
-}
-
-pChild = pSubSup->GetSubSup( CSUB );
-if( pChild ) { //FROM
-//Create position in front of pChild
-SmCaretPosGraphEntry *childLeft = mpGraph->Add( SmCaretPos( 
pChild, 0 ), left );
-//Visit pChild
-mpRightMost = childLeft;
-pChild->Accept( this );
-//Set right on mpRightMost from pChild
-mpRightMost->SetRight( bodyLeft );
-}
-
-pChild = pSubSup->GetSubSup( RSUP );
-if ( pChild ) {
-//Create position in front of pChild
-SmCaretPosGraphEntry *childLeft = mpGraph->Add( SmCaretPos( 
pChild, 0 ), left );
-//Visit pChild
-mpRightMost = childLeft;
-pChild->Accept( this );
-//Set right on mpRightMost from pChild
-mpRightMost->SetRight( bodyLeft );
-}
-
-pChild = pSubSup->GetSubSup( RSUB );
-if ( pChild ) {
+SmNode* pChild;
+for (SmSubSup const nodeType : { LSUP, LSUB, CSUP, CSUB, RSUP, RSUB })
+{
+pChild = pSubSup->GetSubSup(nodeType);
+if( pChild )
+{
 //Create position in front of pChild
-SmCaretPosGraphEntry *childLeft = mpGraph->Add( SmCaretPos( 
pChild, 0 ), left );
-//Visit pChild
-mpRightMost = childLeft;
-pChild->Accept( this );
-//Set right on mpRightMost from pChild
-mpRightMost->SetRight( bodyLeft );
+SmCaretPosGraphEntry *childLeft = mpGraph->Add( SmCaretPos( 
pChild, 0 ), left );
+//Visit pChild
+mpRightMost = childLeft;
+pChild->Accept( this );
+//Set right on mpRightMost from pChild
+mpRightMost->SetRight( bodyLeft );
+}
 }
 }
 


[Libreoffice-commits] core.git: starmath/source

2023-06-03 Thread Julien Nabet (via logerrit)
 starmath/source/visitors.cxx |   75 ++-
 1 file changed, 12 insertions(+), 63 deletions(-)

New commits:
commit befc6ac8e20863c913da0fd0bac2fa26bab1b025
Author: Julien Nabet 
AuthorDate: Sat Jun 3 21:58:59 2023 +0200
Commit: Julien Nabet 
CommitDate: Sun Jun 4 07:48:17 2023 +0200

Related tdf#155630: deduplicate in starmath/visitors

Change-Id: I331ce6d2e24e395a1c85789cdc4bd1f973287027
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152580
Tested-by: Jenkins
Reviewed-by: Julien Nabet 

diff --git a/starmath/source/visitors.cxx b/starmath/source/visitors.cxx
index 42257925d38e..92c1ef3413ec 100644
--- a/starmath/source/visitors.cxx
+++ b/starmath/source/visitors.cxx
@@ -871,71 +871,20 @@ void SmCaretPosGraphBuildingVisitor::Visit( SmSubSupNode* 
pNode )
 bodyRight->SetRight( right );
 right->SetLeft( bodyRight );
 
-//If there's an LSUP
-SmNode* pChild = pNode->GetSubSup( LSUP );
-if( pChild ){
-SmCaretPosGraphEntry *cLeft; //Child left
-cLeft = mpGraph->Add( SmCaretPos( pChild, 0 ), left );
-
-mpRightMost = cLeft;
-pChild->Accept( this );
-
-mpRightMost->SetRight( bodyLeft );
-}
-//If there's an LSUB
-pChild = pNode->GetSubSup( LSUB );
-if( pChild ){
-SmCaretPosGraphEntry *cLeft; //Child left
-cLeft = mpGraph->Add( SmCaretPos( pChild, 0 ), left );
-
-mpRightMost = cLeft;
-pChild->Accept( this );
-
-mpRightMost->SetRight( bodyLeft );
-}
-//If there's a CSUP
-pChild = pNode->GetSubSup( CSUP );
-if( pChild ){
-SmCaretPosGraphEntry *cLeft; //Child left
-cLeft = mpGraph->Add( SmCaretPos( pChild, 0 ), left );
-
-mpRightMost = cLeft;
-pChild->Accept( this );
-
-mpRightMost->SetRight( right );
-}
-//If there's a CSUB
-pChild = pNode->GetSubSup( CSUB );
-if( pChild ){
-SmCaretPosGraphEntry *cLeft; //Child left
-cLeft = mpGraph->Add( SmCaretPos( pChild, 0 ), left );
-
-mpRightMost = cLeft;
-pChild->Accept( this );
-
-mpRightMost->SetRight( right );
-}
-//If there's an RSUP
-pChild = pNode->GetSubSup( RSUP );
-if( pChild ){
-SmCaretPosGraphEntry *cLeft; //Child left
-cLeft = mpGraph->Add( SmCaretPos( pChild, 0 ), bodyRight );
-
-mpRightMost = cLeft;
-pChild->Accept( this );
-
-mpRightMost->SetRight( right );
-}
-//If there's an RSUB
-pChild = pNode->GetSubSup( RSUB );
-if( pChild ){
-SmCaretPosGraphEntry *cLeft; //Child left
-cLeft = mpGraph->Add( SmCaretPos( pChild, 0 ), bodyRight );
+SmNode* pChild;
+for (SmSubSup const nodeType : { LSUP, LSUB, CSUP, CSUB, RSUP, RSUB })
+{
+pChild = pNode->GetSubSup(nodeType);
+if( pChild )
+{
+SmCaretPosGraphEntry *cLeft; //Child left
+cLeft = mpGraph->Add( SmCaretPos( pChild, 0 ), ((nodeType == RSUP) 
|| (nodeType == RSUB))?bodyRight:left );
 
-mpRightMost = cLeft;
-pChild->Accept( this );
+mpRightMost = cLeft;
+pChild->Accept( this );
 
-mpRightMost->SetRight( right );
+mpRightMost->SetRight( ((nodeType == LSUP) || (nodeType == 
LSUB))?bodyLeft:right );
+}
 }
 
 //Set return parameters


[Libreoffice-commits] core.git: starmath/source

2023-04-18 Thread Rafael Lima (via logerrit)
 starmath/source/dialog.cxx |4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

New commits:
commit 2c01d4448a8059b5f335d07347b9e85a0d0031d8
Author: Rafael Lima 
AuthorDate: Wed Apr 12 16:14:10 2023 +0200
Commit: Rafael Lima 
CommitDate: Tue Apr 18 14:06: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 

diff --git a/starmath/source/dialog.cxx b/starmath/source/dialog.cxx
index 76dd40a13268..ecb68dbf2d63 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: 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 c11463cdc5415707d05ab6da08736ff7212db4a0
Author: Mike Kaganski 
AuthorDate: Mon Apr 17 18:26:56 2023 +0300
Commit: Mike Kaganski 
CommitDate: Mon Apr 17 19:56:07 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 

diff --git a/starmath/source/ElementsDockingWindow.cxx 
b/starmath/source/ElementsDockingWindow.cxx
index 16a22d27aa00..b2186a7ecbf9 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: starmath/source stoc/source svl/qa svl/source

2023-03-30 Thread Noel Grandin (via logerrit)
 starmath/source/ooxmlimport.cxx|9 +---
 starmath/source/utility.cxx|6 --
 stoc/source/inspect/introspection.cxx  |4 -
 stoc/source/security/permissions.cxx   |   14 ++
 stoc/source/uriproc/UriReference.cxx   |6 --
 stoc/source/uriproc/UriReferenceFactory.cxx|   18 ++--
 svl/qa/unit/test_URIHelper.cxx |   41 +++
 svl/source/misc/gridprinter.cxx|3 -
 svl/source/misc/urihelper.cxx  |3 -
 svl/source/numbers/zforlist.cxx|   45 ++---
 svl/source/numbers/zformat.cxx |   16 ++-
 svl/source/passwordcontainer/passwordcontainer.cxx |7 +--
 12 files changed, 63 insertions(+), 109 deletions(-)

New commits:
commit aa8fb790e8d3f975c7ffadcb5a4fa390186c6d5d
Author: Noel Grandin 
AuthorDate: Thu Mar 30 10:19:35 2023 +0200
Commit: Noel Grandin 
CommitDate: Thu Mar 30 09:26:58 2023 +

loplugin:stringadd in starmath..svl

when applying my upcoming patch to also consider O[U]StringBuffer

Change-Id: Id8f229c3a5223dee8d2710caf15d4612594fc763
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/149748
Tested-by: Jenkins
Reviewed-by: Noel Grandin 

diff --git a/starmath/source/ooxmlimport.cxx b/starmath/source/ooxmlimport.cxx
index f040265ad31d..4023a5e652ac 100644
--- a/starmath/source/ooxmlimport.cxx
+++ b/starmath/source/ooxmlimport.cxx
@@ -355,8 +355,7 @@ OUString SmOoxmlImport::handleD()
 opening = "left none ";
 if( closing.isEmpty())
 closing = " right none";
-OUStringBuffer ret;
-ret.append( opening );
+OUStringBuffer ret( opening );
 bool first = true;
 while( m_rStream.findTag( OPENING( M_TOKEN( e 
 {
@@ -378,9 +377,9 @@ OUString SmOoxmlImport::handleEqArr()
 { // there must be at least one m:e
 if( !ret.isEmpty())
 ret.append("#");
-ret.append(" ");
-ret.append(readOMathArgInElement( M_TOKEN( e )));
-ret.append(" ");
+ret.append(" "
++ readOMathArgInElement( M_TOKEN( e ))
++ " ");
 } while( !m_rStream.atEnd() && m_rStream.findTag( OPENING( M_TOKEN( e ;
 m_rStream.ensureClosingTag( M_TOKEN( eqArr ));
 return "stack {" + ret + "}";
diff --git a/starmath/source/utility.cxx b/starmath/source/utility.cxx
index 5c957899092e..4a9225f6b363 100644
--- a/starmath/source/utility.cxx
+++ b/starmath/source/utility.cxx
@@ -82,13 +82,11 @@ OUString lcl_GetStringItem(const vcl::Font )
 
 if (IsItalic( rFont ))
 {
-aString.append(", ");
-aString.append(SmResId(RID_FONTITALIC));
+aString.append(", " + SmResId(RID_FONTITALIC));
 }
 if (IsBold( rFont ))
 {
-aString.append(", ");
-aString.append(SmResId(RID_FONTBOLD));
+aString.append(", " + SmResId(RID_FONTBOLD));
 }
 
 return aString.makeStringAndClear();
diff --git a/stoc/source/inspect/introspection.cxx 
b/stoc/source/inspect/introspection.cxx
index c219e8030f0c..e6c44c4748ba 100644
--- a/stoc/source/inspect/introspection.cxx
+++ b/stoc/source/inspect/introspection.cxx
@@ -1441,8 +1441,8 @@ struct TypeKey {
 // those matches, too:
 OUStringBuffer b(static_cast(theTypes.size() * 64));
 for (const css::uno::Type& rType : theTypes) {
-b.append(rType.getTypeName());
-b.append('*'); // arbitrary delimiter not used by type grammar
+b.append(rType.getTypeName()
++ "*"); // arbitrary delimiter not used by type grammar
 }
 types = b.makeStringAndClear();
 }
diff --git a/stoc/source/security/permissions.cxx 
b/stoc/source/security/permissions.cxx
index 12f39ce3d83a..48a1f907f01c 100644
--- a/stoc/source/security/permissions.cxx
+++ b/stoc/source/security/permissions.cxx
@@ -238,13 +238,11 @@ OUString SocketPermission::toString() const
 {
 OUStringBuffer buf( 48 );
 // host
-buf.append( "com.sun.star.connection.SocketPermission (host=\"" );
-buf.append( m_host );
+buf.append( "com.sun.star.connection.SocketPermission (host=\""
++ m_host );
 if (m_resolvedHost)
 {
-buf.append( '[' );
-buf.append( m_ip );
-buf.append( ']' );
+buf.append( "[" + m_ip  + "]" );
 }
 // port
 if (0 != m_lowerPort || 65535 != m_upperPort)
@@ -260,9 +258,9 @@ OUString SocketPermission::toString() const
 }
 }
 // actions
-buf.append( "\", actions=\"" );
-buf.append( makeStrings( m_actions, s_actions ) );
-buf.append( "\")" );
+buf.append( "\", actions=\""
++ makeStrings( m_actions, s_actions )
++ "\")" );
 return buf.makeStringAndClear();
 }
 
diff --git a/stoc/source/uriproc/UriReference.cxx 
b/stoc/source/uriproc/UriReference.cxx
index 9c7c7962c66a..fc272014143a 100644
--- 

[Libreoffice-commits] core.git: starmath/source

2023-03-10 Thread Michael Weghorn (via logerrit)
 starmath/source/ElementsDockingWindow.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 76fcddcd955ba26655dcfc0d6261f4c00be375fe
Author: Michael Weghorn 
AuthorDate: Thu Mar 9 16:34:42 2023 +0100
Commit: Michael Weghorn 
CommitDate: Fri Mar 10 10:48:44 2023 +

Revert "Resolves: tdf#152411 clear before freeze to let gtk a11y ...

... drop reference"

It's no longer needed, since the original problem is solved
differently with Change-Id Id0c241d68ec4fbf933312008f7d0ee86bd3eab0c
("tdf#140659 gtk a11y: Don't unset model when freezing icon view")
in place.

This reverts commit 4e8331b77a2dcad2b10d3ca5b788711ea4e83a1b.

Change-Id: I5c94a1c610a807a09ab62577477135cc14dbcfa6
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/148558
Tested-by: Jenkins
Reviewed-by: Michael Weghorn 

diff --git a/starmath/source/ElementsDockingWindow.cxx 
b/starmath/source/ElementsDockingWindow.cxx
index 1ea324dc7fe7..16a22d27aa00 100644
--- a/starmath/source/ElementsDockingWindow.cxx
+++ b/starmath/source/ElementsDockingWindow.cxx
@@ -574,8 +574,8 @@ void SmElementsControl::setElementSetIndex(int nSetIndex)
 
 void SmElementsControl::addElements(int nCategory)
 {
-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: starmath/source

2023-02-17 Thread Xisco Fauli (via logerrit)
 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 a7fd1e067eb2af0ef329719c4c7dbb32cc5926b2
Author: Xisco Fauli 
AuthorDate: Fri Feb 17 15:50:29 2023 +0100
Commit: Xisco Fauli 
CommitDate: Fri Feb 17 18:20:07 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 

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 2ffe14a816bf..19d5b4352b1b 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 0e43fa1d6efb..51b548032f1c 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)


[Libreoffice-commits] core.git: starmath/source

2022-12-16 Thread Caolán McNamara (via logerrit)
 starmath/source/node.cxx |   11 +--
 1 file changed, 9 insertions(+), 2 deletions(-)

New commits:
commit 6091603e3c8794c2959f96309286ed782414bb41
Author: Caolán McNamara 
AuthorDate: Fri Dec 16 09:34:13 2022 +
Commit: Caolán McNamara 
CommitDate: Fri Dec 16 11:58:23 2022 +

ofz#54365 Integer-overflow

Change-Id: Id7202e35bd381e36aa8d36a4ae2c9b987f8e9e79
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/144293
Tested-by: Jenkins
Reviewed-by: Caolán McNamara 

diff --git a/starmath/source/node.cxx b/starmath/source/node.cxx
index eddde9f18f2d..5beab34c731d 100644
--- a/starmath/source/node.cxx
+++ b/starmath/source/node.cxx
@@ -25,6 +25,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 
@@ -835,8 +836,14 @@ void SmBinHorNode::Arrange(OutputDevice , const 
SmFormat )
 
 const SmRect  = pOper->GetRect();
 
-tools::Long nDist = (rOpRect.GetWidth() *
- rFormat.GetDistance(DIS_HORIZONTAL)) / 100;
+tools::Long nMul;
+if (o3tl::checked_multiply(rOpRect.GetWidth(), 
rFormat.GetDistance(DIS_HORIZONTAL), nMul))
+{
+SAL_WARN("starmath", "integer overflow");
+return;
+}
+
+tools::Long nDist = nMul / 100;
 
 SmRect::operator = (*pLeft);
 


[Libreoffice-commits] core.git: starmath/source

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

New commits:
commit e58ad604df2022450bec0d83d496037c799ae969
Author: Caolán McNamara 
AuthorDate: Wed Dec 7 13:20:03 2022 +
Commit: Caolán McNamara 
CommitDate: Wed Dec 7 14:49:08 2022 +

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

Change-Id: I2c0f852a0432e7319644b0ea11533b6d153b4ac7
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/143780
Tested-by: Jenkins
Reviewed-by: Caolán McNamara 

diff --git a/starmath/source/ElementsDockingWindow.cxx 
b/starmath/source/ElementsDockingWindow.cxx
index 16a22d27aa00..1ea324dc7fe7 100644
--- a/starmath/source/ElementsDockingWindow.cxx
+++ b/starmath/source/ElementsDockingWindow.cxx
@@ -574,8 +574,8 @@ void SmElementsControl::setElementSetIndex(int nSetIndex)
 
 void SmElementsControl::addElements(int nCategory)
 {
+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: starmath/source

2022-12-07 Thread Caolán McNamara (via logerrit)
 starmath/source/ElementsDockingWindow.cxx |   33 ++
 1 file changed, 33 insertions(+)

New commits:
commit dab143489838c0b91eadc8bf7f9d7e2537336751
Author: Caolán McNamara 
AuthorDate: Tue Dec 6 20:19:11 2022 +
Commit: Caolán McNamara 
CommitDate: Wed Dec 7 10:04:09 2022 +

Resolves: tdf#152392 use sidebar text color for COL_AUTO in examples

Change-Id: I5f5c1a6c79c65bd1d4bf2de4af02bef5d60ee5c5
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/143745
Tested-by: Jenkins
Reviewed-by: Caolán McNamara 

diff --git a/starmath/source/ElementsDockingWindow.cxx 
b/starmath/source/ElementsDockingWindow.cxx
index e768726eada5..16a22d27aa00 100644
--- a/starmath/source/ElementsDockingWindow.cxx
+++ b/starmath/source/ElementsDockingWindow.cxx
@@ -493,6 +493,37 @@ Color SmElementsControl::GetControlBackground()
 return rStyleSettings.GetFieldColor();
 }
 
+namespace
+{
+// SmTmpDevice::GetTextColor assumes a fg/bg of 
svtools::FONTCOLOR/svtools::DOCCOLOR
+// here replace COL_AUTO with the desired fg color, alternatively could 
add something
+// to SmTmpDevice to override its defaults
+class AutoColorVisitor : public SmDefaultingVisitor
+{
+private:
+Color m_aAutoColor;
+public:
+AutoColorVisitor(SmNode* pNode, Color aAutoColor)
+: m_aAutoColor(aAutoColor)
+{
+DefaultVisit(pNode);
+}
+virtual void DefaultVisit(SmNode* pNode) override
+{
+if (pNode->GetFont().GetColor() == COL_AUTO)
+pNode->GetFont().SetColor(m_aAutoColor);
+size_t nNodes = pNode->GetNumSubNodes();
+for (size_t i = 0; i < nNodes; ++i)
+{
+SmNode* pChild = pNode->GetSubNode(i);
+if (!pChild)
+continue;
+DefaultVisit(pChild);
+}
+}
+};
+}
+
 void SmElementsControl::addElement(const OUString& aElementVisual, const 
OUString& aElementSource, const OUString& aHelpText)
 {
 std::unique_ptr pNode = maParser->ParseExpression(aElementVisual);
@@ -509,6 +540,8 @@ void SmElementsControl::addElement(const OUString& 
aElementVisual, const OUStrin
 pNode->SetSize(Fraction(10,8));
 pNode->Arrange(*pDevice, maFormat);
 
+AutoColorVisitor(pNode.get(), GetTextColor());
+
 Size aSize = pDevice->LogicToPixel(Size(pNode->GetWidth(), 
pNode->GetHeight()));
 aSize.extendBy(10, 0); // Add 5 pixels from both sides to accommodate 
extending parts of italics
 pDevice->SetOutputSizePixel(aSize);


[Libreoffice-commits] core.git: starmath/source

2022-12-06 Thread Mike Kaganski (via logerrit)
 starmath/source/SmPanelFactory.cxx|2 +-
 starmath/source/SmPropertiesPanel.cxx |   12 
 starmath/source/SmPropertiesPanel.hxx |7 +--
 3 files changed, 14 insertions(+), 7 deletions(-)

New commits:
commit 834f49b7e30ec9cc9bd050079b23995ad514b40c
Author: Mike Kaganski 
AuthorDate: Tue Dec 6 11:22:47 2022 +0300
Commit: Mike Kaganski 
CommitDate: Tue Dec 6 12:00:42 2022 +

tdf#150940: Store frame reference in the panel

It is needed to properly dispatch the commands in case of embedded
objects, otherwise they are dispatched to the top-level frame.

Change-Id: Ia5fadf7c35bded75f1ca20a682dc6c9f14548990
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/143693
Tested-by: Jenkins
Reviewed-by: Mike Kaganski 

diff --git a/starmath/source/SmPanelFactory.cxx 
b/starmath/source/SmPanelFactory.cxx
index 8e9f146a1959..df35dcadffbc 100644
--- a/starmath/source/SmPanelFactory.cxx
+++ b/starmath/source/SmPanelFactory.cxx
@@ -83,7 +83,7 @@ css::uno::Reference SAL_CALL 
SmPanelFactory::createUIElemen
 css::ui::LayoutSize aLayoutSize{ -1, -1, -1 };
 if (ResourceURL.endsWith("/MathPropertiesPanel"))
 {
-pPanel = sm::sidebar::SmPropertiesPanel::Create(*pParent);
+pPanel = sm::sidebar::SmPropertiesPanel::Create(*pParent, xFrame);
 }
 else if (ResourceURL.endsWith("/MathElementsPanel"))
 {
diff --git a/starmath/source/SmPropertiesPanel.cxx 
b/starmath/source/SmPropertiesPanel.cxx
index 3ffd25c40e79..48f2c6897cd1 100644
--- a/starmath/source/SmPropertiesPanel.cxx
+++ b/starmath/source/SmPropertiesPanel.cxx
@@ -32,13 +32,17 @@
 namespace sm::sidebar
 {
 // static
-std::unique_ptr SmPropertiesPanel::Create(weld::Widget& rParent)
+std::unique_ptr
+SmPropertiesPanel::Create(weld::Widget& rParent,
+  const css::uno::Reference& 
xFrame)
 {
-return std::make_unique(rParent);
+return std::make_unique(rParent, xFrame);
 }
 
-SmPropertiesPanel::SmPropertiesPanel(weld::Widget& rParent)
+SmPropertiesPanel::SmPropertiesPanel(weld::Widget& rParent,
+ const 
css::uno::Reference& xFrame)
 : PanelLayout(, "MathPropertiesPanel", 
"modules/smath/ui/sidebarproperties_math.ui")
+, mxFrame(xFrame)
 , mpFormatFontsButton(m_xBuilder->weld_button("btnFormatFonts"))
 , mpFormatFontSizeButton(m_xBuilder->weld_button("btnFormatFontSize"))
 , mpFormatSpacingButton(m_xBuilder->weld_button("btnFormatSpacing"))
@@ -80,7 +84,7 @@ SmPropertiesPanel::~SmPropertiesPanel()
 IMPL_LINK(SmPropertiesPanel, ButtonClickHandler, weld::Button&, rButton, void)
 {
 if (OUString command = maButtonCommands[]; !command.isEmpty())
-comphelper::dispatchCommand(command, {});
+comphelper::dispatchCommand(command, mxFrame, {});
 }
 
 } // end of namespace sm::sidebar
diff --git a/starmath/source/SmPropertiesPanel.hxx 
b/starmath/source/SmPropertiesPanel.hxx
index e81463f37022..f19316e3fac1 100644
--- a/starmath/source/SmPropertiesPanel.hxx
+++ b/starmath/source/SmPropertiesPanel.hxx
@@ -31,13 +31,16 @@ namespace sm::sidebar
 class SmPropertiesPanel : public PanelLayout
 {
 public:
-static std::unique_ptr Create(weld::Widget& rParent);
-SmPropertiesPanel(weld::Widget& rParent);
+static std::unique_ptr
+Create(weld::Widget& rParent, const 
css::uno::Reference& xFrame);
+SmPropertiesPanel(weld::Widget& rParent, const 
css::uno::Reference& xFrame);
 ~SmPropertiesPanel();
 
 private:
 DECL_LINK(ButtonClickHandler, weld::Button&, void);
 
+css::uno::Reference mxFrame;
+
 std::unique_ptr mpFormatFontsButton;
 std::unique_ptr mpFormatFontSizeButton;
 std::unique_ptr mpFormatSpacingButton;


[Libreoffice-commits] core.git: 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 12732eb7c34baa3f846ec6d0c10f8987051ace34
Author: Rafael Lima 
AuthorDate: Fri Dec 2 11:06:07 2022 +
Commit: Rafael Lima 
CommitDate: Mon Dec 5 10:52:55 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 

diff --git a/starmath/source/tmpdevice.cxx b/starmath/source/tmpdevice.cxx
index 1e30fbc7cd11..077977b39def 100644
--- a/starmath/source/tmpdevice.cxx
+++ b/starmath/source/tmpdevice.cxx
@@ -51,7 +51,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: starmath/source

2022-11-23 Thread Mike Kaganski (via logerrit)
 starmath/source/view.cxx |4 
 1 file changed, 4 insertions(+)

New commits:
commit f4b6ff46aea6d260eab191daf5d437dada39f4d0
Author: Mike Kaganski 
AuthorDate: Wed Nov 23 12:29:48 2022 +0300
Commit: Mike Kaganski 
CommitDate: Wed Nov 23 12:18:16 2022 +0100

lok: take borders into account in in-place Math cursor/selection

The offset is defined by formula's top/left borders (in UI under
Format->Spacing).

Change-Id: Ic17356f8c6e4db3cbe0df765d133ee240f5b088d
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/143136
Tested-by: Jenkins
Reviewed-by: Mike Kaganski 

diff --git a/starmath/source/view.cxx b/starmath/source/view.cxx
index 8898d10bf5a1..3c7c8b1554d3 100644
--- a/starmath/source/view.cxx
+++ b/starmath/source/view.cxx
@@ -2319,6 +2319,8 @@ std::optional SmViewShell::getLOKPayload(int 
nType, int nViewId) const
 SmCursor& rCursor = GetDoc()->GetCursor();
 OutputDevice& rOutDev = 
const_cast(widget).GetOutputDevice();
 tools::Rectangle aCaret = rCursor.GetCaretRectangle(rOutDev);
+Point aFormulaDrawPos = widget.GetFormulaDrawPos();
+aCaret.Move(aFormulaDrawPos.X(), aFormulaDrawPos.Y());
 LokStarMathHelper helper(SfxViewShell::Current());
 tools::Rectangle aBounds = helper.GetBoundingBox();
 aCaret.Move(aBounds.Left(), aBounds.Top());
@@ -2336,6 +2338,8 @@ std::optional SmViewShell::getLOKPayload(int 
nType, int nViewId) const
 tools::Rectangle aSelection = 
rCursor.GetSelectionRectangle(rOutDev);
 if (!aSelection.IsEmpty())
 {
+Point aFormulaDrawPos = widget.GetFormulaDrawPos();
+aSelection.Move(aFormulaDrawPos.X(), aFormulaDrawPos.Y());
 LokStarMathHelper helper(SfxViewShell::Current());
 tools::Rectangle aBounds = helper.GetBoundingBox();
 


[Libreoffice-commits] core.git: starmath/source

2022-11-06 Thread Mike Kaganski (via logerrit)
 starmath/source/view.cxx |6 --
 1 file changed, 4 insertions(+), 2 deletions(-)

New commits:
commit 75395e0ccaeae2761a6b58bc36c8a5e32d49566f
Author: Mike Kaganski 
AuthorDate: Sun Nov 6 22:07:04 2022 +0300
Commit: Mike Kaganski 
CommitDate: Mon Nov 7 06:03:48 2022 +0100

Use o3tl::convert instead of temporary Fractions

Change-Id: I7e1f68e579e6520d17e0a058e6e0a8056e082c2a
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/142360
Tested-by: Jenkins
Reviewed-by: Mike Kaganski 

diff --git a/starmath/source/view.cxx b/starmath/source/view.cxx
index 1bcfc0d3efc7..8898d10bf5a1 100644
--- a/starmath/source/view.cxx
+++ b/starmath/source/view.cxx
@@ -2295,8 +2295,10 @@ void SmViewShell::ZoomByItemSet(const SfxItemSet *pSet)
 Size   
OutputSize(pPrinter->LogicToPixel(Size(OutputRect.GetWidth(),
   
OutputRect.GetHeight()), aMap));
 Size   GraphicSize(pPrinter->LogicToPixel(GetDoc()->GetSize(), 
aMap));
-sal_uInt16 nZ = 
sal::static_int_cast(std::min(tools::Long(Fraction(OutputSize.Width()
  * 100, GraphicSize.Width())),
-  
tools::Long(Fraction(OutputSize.Height() * 100, GraphicSize.Height();
+if (GraphicSize.Width() <= 0 || GraphicSize.Height() <= 0)
+break;
+sal_uInt16 nZ = std::min(o3tl::convert(OutputSize.Width(), 100, 
GraphicSize.Width()),
+ o3tl::convert(OutputSize.Height(), 100, 
GraphicSize.Height()));
 mxGraphicWindow->SetZoom(nZ);
 break;
 }


[Libreoffice-commits] core.git: starmath/source

2022-11-04 Thread Stephan Bergmann (via logerrit)
 starmath/source/unomodel.cxx |   27 +++
 1 file changed, 3 insertions(+), 24 deletions(-)

New commits:
commit 20926c0a7559ea9c4f82c662f11a395fa1eb79a3
Author: Stephan Bergmann 
AuthorDate: Thu Nov 3 17:11:01 2022 +0100
Commit: Stephan Bergmann 
CommitDate: Fri Nov 4 10:08:36 2022 +0100

Reinstate removal of lcl_GuessPaperSize

...originally done with 1d7964c5ff579ff93067dc1c3e45b522e3cb2b4e 
"CWS-TOOLING:
integrate CWS unifypaper01" on 2009-06-12.  However, the removed
lcl_GuessPaperSize then reappeared, apparently with the merge commit
4563270cfd37f1a08e0315a5624affa3a7680771 "CWS-TOOLING: integrate CWS
printerpullpages" on 2010-01-15, presumably due to a mis-merge somewhere 
along
the way.

SmModel::getRenderer and SmModel::render are e.g. called when doing "Export 
as
PDF..." of a Math Formula, but it seems a bit hard to get into the "no real
printer" branches there that would actually have called lcl_GuessPaperSize. 
 But
anyway, it looks reasonable to replace that function with the more elaborate
SvxPaperInfo::GetDefaultPaperSize.

(I stumbled over this when the code in lcl_GuessPaperSize caused a newly
introduced -Werror=dangling-reference with GCC 13 trunk, similar to
e0121b2478526d803681d57d59af0cbf9cf602b4 "-Werror=dangling-reference".  So I
figured I'd remove that code as apparently intended back in 2009 rather 
than try
to fix it now.)

Change-Id: Ia73d9ece8429bbeccd4f65a9efc156c0dee52c01
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/142246
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann 

diff --git a/starmath/source/unomodel.cxx b/starmath/source/unomodel.cxx
index 51a5fc822af0..76c4e86651b1 100644
--- a/starmath/source/unomodel.cxx
+++ b/starmath/source/unomodel.cxx
@@ -40,6 +40,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -894,28 +895,6 @@ sal_Int32 SAL_CALL SmModel::getRendererCount(
 return 1;
 }
 
-
-static Size lcl_GuessPaperSize()
-{
-Size aRes;
-const LocaleDataWrapper& rLocWrp( AllSettings().GetLocaleDataWrapper() );
-if( MeasurementSystem::Metric == rLocWrp.getMeasurementSystemEnum() )
-{
-// in 100th mm
-PaperInfo aInfo( PAPER_A4 );
-aRes.setWidth( aInfo.getWidth() );
-aRes.setHeight( aInfo.getHeight() );
-}
-else
-{
-// in 100th mm
-PaperInfo aInfo( PAPER_LETTER );
-aRes.setWidth( aInfo.getWidth() );
-aRes.setHeight( aInfo.getHeight() );
-}
-return aRes;
-}
-
 uno::Sequence< beans::PropertyValue > SAL_CALL SmModel::getRenderer(
 sal_Int32 nRenderer,
 const uno::Any& /*rSelection*/,
@@ -937,7 +916,7 @@ uno::Sequence< beans::PropertyValue > SAL_CALL 
SmModel::getRenderer(
 // if paper size is 0 (usually if no 'real' printer is found),
 // guess the paper size
 if (aPrtPaperSize.IsEmpty())
-aPrtPaperSize = lcl_GuessPaperSize();
+aPrtPaperSize = SvxPaperInfo::GetDefaultPaperSize(MapUnit::Map100thMM);
 awt::Size   aPageSize( aPrtPaperSize.Width(), aPrtPaperSize.Height() );
 
 uno::Sequence< beans::PropertyValue > aRenderer(1);
@@ -1011,7 +990,7 @@ void SAL_CALL SmModel::render(
 // no real printer ??
 if (aPrtPaperSize.IsEmpty())
 {
-aPrtPaperSize = lcl_GuessPaperSize();
+aPrtPaperSize = SvxPaperInfo::GetDefaultPaperSize(MapUnit::Map100thMM);
 // factors from Windows DIN A4
 aOutputSize= Size( static_cast(aPrtPaperSize.Width()  
* 0.941),
static_cast(aPrtPaperSize.Height() 
* 0.961));


[Libreoffice-commits] core.git: starmath/source

2022-10-25 Thread Stephan Bergmann (via logerrit)
 starmath/source/ElementsDockingWindow.cxx |   22 +++---
 1 file changed, 11 insertions(+), 11 deletions(-)

New commits:
commit ec27f2e5e39034ac4b38323149df72be28cba274
Author: Stephan Bergmann 
AuthorDate: Tue Oct 25 14:38:18 2022 +0200
Commit: Stephan Bergmann 
CommitDate: Tue Oct 25 16:45:06 2022 +0200

Address a constexpr template point of instantiation issue

...that hits at least when building with Clang and --with-latest-c++ against
recent libc++ or MSVC standard library (where C++20 and esp. C++23 made 
more and
more class template member functions constexpr).  My understanding is that 
there
is some leeway at what point a compiler should instantiate such function
specializations, and Clang decides to instantiate constexpr ones early (cf.


"C++11 half of r147023: In C++11, additionally eagerly instantiate:" and 
its "Do
not defer instantiations of constexpr functions" comment, and the 
discussion at

).

> In file included from starmath/source/ElementsDockingWindow.cxx:20:
> In file included from starmath/inc/ElementsDockingWindow.hxx:22:
> In file included from include/sfx2/dockwin.hxx:22:
> In file included from ~/llvm/inst/bin/../include/c++/v1/memory:881:
> In file included from 
~/llvm/inst/bin/../include/c++/v1/__memory/shared_ptr.h:30:
> ~/llvm/inst/bin/../include/c++/v1/__memory/unique_ptr.h:47:19: error: 
invalid application of 'sizeof' to an incomplete type 'ElementData'
> static_assert(sizeof(_Tp) >= 0, "cannot delete an incomplete type");
>   ^~~
> ~/llvm/inst/bin/../include/c++/v1/__memory/unique_ptr.h:281:7: note: in 
instantiation of member function 'std::default_delete::operator()' 
requested here
>   __ptr_.second()(__tmp);
>   ^
> ~/llvm/inst/bin/../include/c++/v1/__memory/unique_ptr.h:247:75: note: in 
instantiation of member function 'std::unique_ptr::reset' 
requested here
>   _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX23 ~unique_ptr() { 
reset(); }
>   
^
> ~/llvm/inst/bin/../include/c++/v1/__memory/construct_at.h:64:13: note: in 
instantiation of member function 'std::unique_ptr::~unique_ptr' 
requested here
> __loc->~_Tp();
> ^
> ~/llvm/inst/bin/../include/c++/v1/__memory/construct_at.h:89:12: note: in 
instantiation of function template specialization 
'std::__destroy_at, 0>' requested here
> _VSTD::__destroy_at(__loc);
>^
> ~/llvm/inst/bin/../include/c++/v1/__memory/allocator_traits.h:317:16: 
note: in instantiation of function template specialization 
'std::destroy_at, 0>' requested here
> _VSTD::destroy_at(__p);
>^
> ~/llvm/inst/bin/../include/c++/v1/vector:834:25: note: in instantiation 
of function template specialization 
'std::allocator_traits>>::destroy,
 void, void>' requested here
> __alloc_traits::destroy(__alloc(), 
std::__to_address(--__soon_to_be_end));
> ^
> ~/llvm/inst/bin/../include/c++/v1/vector:828:29: note: in instantiation 
of member function 
'std::vector>::__base_destruct_at_end' requested 
here
>   void __clear() _NOEXCEPT {__base_destruct_at_end(this->__begin_);}
> ^
> ~/llvm/inst/bin/../include/c++/v1/vector:433:9: note: in instantiation of 
member function 'std::vector>::__clear' requested 
here
> __clear();
> ^
> starmath/source/ElementsDockingWindow.cxx:455:20: note: in instantiation 
of member function 'std::vector>::~vector' 
requested here
> SmElementsControl::SmElementsControl(std::unique_ptr 
pIconView)
>^
> starmath/inc/ElementsDockingWindow.hxx:35:8: note: forward declaration of 
'ElementData'
> struct ElementData;
>^

Change-Id: Iaae76ed5e59d04da32b468a69052ef305ca8005a
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/141819
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann 

diff --git a/starmath/source/ElementsDockingWindow.cxx 
b/starmath/source/ElementsDockingWindow.cxx
index c332c5afda2d..0444db4ba42a 100644
--- a/starmath/source/ElementsDockingWindow.cxx
+++ b/starmath/source/ElementsDockingWindow.cxx
@@ -452,6 +452,17 @@ const std::vector& 
SmElementsControl::categories()
 return s_a5Categories;
 }
 
+struct ElementData
+{
+OUString maElementSource;
+OUString maHelpText;
+ElementData(const OUString& aElementSource, const OUString& aHelpText)
+: maElementSource(aElementSource)
+, maHelpText(aHelpText)
+{
+}
+};
+
 SmElementsControl::SmElementsControl(std::unique_ptr pIconView)
 : mpDocShell(new 

[Libreoffice-commits] core.git: starmath/source

2022-10-17 Thread Noel Grandin (via logerrit)
 starmath/source/unomodel.cxx |3 ---
 1 file changed, 3 deletions(-)

New commits:
commit 993e075c909a609c8a2af80afc1080672d724ac5
Author: Noel Grandin 
AuthorDate: Mon Oct 17 10:48:27 2022 +0200
Commit: Noel Grandin 
CommitDate: Mon Oct 17 11:50:36 2022 +0200

simplify SmModel::queryInterface

these two are redundant, the base class queryInterface already handles
them

Change-Id: I047b32941c104a03a994e0553d80c4ead2b967df
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/141444
Tested-by: Jenkins
Reviewed-by: Noel Grandin 

diff --git a/starmath/source/unomodel.cxx b/starmath/source/unomodel.cxx
index 42f377f27ce9..3c0d750f5737 100644
--- a/starmath/source/unomodel.cxx
+++ b/starmath/source/unomodel.cxx
@@ -320,9 +320,6 @@ SmModel::~SmModel() noexcept
 uno::Any SAL_CALL SmModel::queryInterface( const uno::Type& rType )
 {
 uno::Any aRet =  ::cppu::queryInterface ( rType,
-// OWeakObject interfaces
-
_cast(static_cast(*this)),
-static_cast< XWeak* > ( this ),
 // PropertySetHelper interfaces
 static_cast< XPropertySet* > ( this ),
 static_cast< XMultiPropertySet* > ( this ),


[Libreoffice-commits] core.git: starmath/source

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

New commits:
commit 382b82541a2e4d83197bd0b20fc5fc40bb4313e2
Author: Caolán McNamara 
AuthorDate: Thu Sep 15 11:30:54 2022 +0100
Commit: Caolán McNamara 
CommitDate: Thu Sep 15 15:31:02 2022 +0200

cid#1500440 Use after free

this is the inline starmath editing where you can edit the formula
directly in the view window instead of the command window. Currently
requires experimental to be enabled.

reproduce by clicking in initially empty formula and enter a character.
In practice the deleted pos.pSelectedNode is not actually used-after-free
in SmCursor::FindPositionInLineList because it is not found by the
std::find of pLineList.

Change-Id: I57476a8eb073914099c5026dd33dc75b20288d52
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/140003
Tested-by: Jenkins
Reviewed-by: Caolán McNamara 

diff --git a/starmath/source/cursor.cxx b/starmath/source/cursor.cxx
index 52621d360c80..fc1e3c5ecb7b 100644
--- a/starmath/source/cursor.cxx
+++ b/starmath/source/cursor.cxx
@@ -303,6 +303,7 @@ void SmCursor::InsertNodes(std::unique_ptr 
pNewNodes){
 
 //Find top most of line that holds position
 SmNode* pLine = FindTopMostNodeInLine(pos.pSelectedNode);
+const bool bSelectedIsTopMost = pLine == pos.pSelectedNode;
 
 //Find line parent and line index in parent
 SmStructureNode* pLineParent = pLine->GetParent();
@@ -311,10 +312,11 @@ void SmCursor::InsertNodes(std::unique_ptr 
pNewNodes){
 
 //Convert line to list
 std::unique_ptr pLineList(new SmNodeList);
-NodeToList(pLine, *pLineList);
+NodeToList(pLine, *pLineList); // deletes pLine, potentially deleting 
pos.pSelectedNode
 
 //Find iterator for place to insert nodes
-SmNodeList::iterator it = FindPositionInLineList(pLineList.get(), pos);
+SmNodeList::iterator it = bSelectedIsTopMost ? pLineList->begin()
+ : 
FindPositionInLineList(pLineList.get(), pos);
 
 //Insert all new nodes
 SmNodeList::iterator newIt,


[Libreoffice-commits] core.git: starmath/source starmath/util

2022-09-05 Thread dante (via logerrit)
 starmath/source/document.cxx |   27 +--
 starmath/util/sm.component   |   24 
 2 files changed, 37 insertions(+), 14 deletions(-)

New commits:
commit 9b7600f547cec9ed1bacca3a1b995b3c33fd5723
Author: dante 
AuthorDate: Wed May 11 12:08:52 2022 +0200
Commit: Noel Grandin 
CommitDate: Mon Sep 5 18:22:01 2022 +0200

Connect new import / export to starmath

See: https://gerrit.libreoffice.org/c/core/+/120753
Change-Id: I9b02a4a7b4bc6c132220710573b7672b1a5b1c60
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134163
Tested-by: Jenkins
Reviewed-by: Noel Grandin 

diff --git a/starmath/source/document.cxx b/starmath/source/document.cxx
index 8e8747d3c793..d13cd8218055 100644
--- a/starmath/source/document.cxx
+++ b/starmath/source/document.cxx
@@ -70,8 +70,8 @@
 #include "ooxmlexport.hxx"
 #include "ooxmlimport.hxx"
 #include "rtfexport.hxx"
-#include 
-#include 
+#include 
+#include 
 #include 
 #include 
 #include 
@@ -594,8 +594,7 @@ bool SmDocShell::ConvertFrom(SfxMedium )
 InvalidateCursor();
 }
 Reference xModel(GetModel());
-SmXMLImportWrapper aEquation(xModel);
-aEquation.useHTMLMLEntities(true);
+SmMLImportWrapper aEquation(xModel);
 bSuccess = ( ERRCODE_NONE == aEquation.Import(rMedium) );
 }
 else
@@ -655,7 +654,7 @@ bool SmDocShell::Load( SfxMedium& rMedium )
 {
 // is this a fabulous math package ?
 Reference xModel(GetModel());
-SmXMLImportWrapper aEquation(xModel);
+SmMLImportWrapper aEquation(xModel);
 auto nError = aEquation.Import(rMedium);
 bRet = ERRCODE_NONE == nError;
 SetError(nError);
@@ -686,8 +685,8 @@ bool SmDocShell::Save()
 ArrangeFormula();
 
 Reference xModel(GetModel());
-SmXMLExportWrapper aEquation(xModel);
-aEquation.SetFlat(false);
+SmMLExportWrapper aEquation(xModel);
+aEquation.setFlat(false);
 return aEquation.Export(*GetMedium());
 }
 
@@ -746,8 +745,8 @@ bool SmDocShell::SaveAs( SfxMedium& rMedium )
 ArrangeFormula();
 
 Reference xModel(GetModel());
-SmXMLExportWrapper aEquation(xModel);
-aEquation.SetFlat(false);
+SmMLExportWrapper aEquation(xModel);
+aEquation.setFlat(false);
 bRet = aEquation.Export(rMedium);
 }
 return bRet;
@@ -768,16 +767,16 @@ bool SmDocShell::ConvertTo( SfxMedium  )
 if(rFltName == STAROFFICE_XML)
 {
 Reference xModel(GetModel());
-SmXMLExportWrapper aEquation(xModel);
-aEquation.SetFlat(false);
+SmMLExportWrapper aEquation(xModel);
+aEquation.setFlat(false);
 bRet = aEquation.Export(rMedium);
 }
 else if(rFltName == MATHML_XML)
 {
 Reference xModel(GetModel());
-SmXMLExportWrapper aEquation(xModel);
-aEquation.SetFlat(true);
-aEquation.SetUseHTMLMLEntities(true);
+SmMLExportWrapper aEquation(xModel);
+aEquation.setFlat(true);
+aEquation.setUseHTMLMLEntities(true);
 bRet = aEquation.Export(rMedium);
 }
 else if (pFlt->GetFilterName() == "MathType 3.x")
diff --git a/starmath/util/sm.component b/starmath/util/sm.component
index 2b84a17c429c..29eb7c9b4168 100644
--- a/starmath/util/sm.component
+++ b/starmath/util/sm.component
@@ -67,4 +67,28 @@
 constructor="org_libreoffice_comp_Math_sidebar_SmPanelFactory">
 
   
+
+
+  
+  
+
+  
+  
+
+  
+  
+
+  
+  
+
+  
+  
+
+  
 


[Libreoffice-commits] core.git: starmath/source

2022-09-05 Thread dante (via logerrit)
 starmath/source/mathml/import.cxx |5 -
 1 file changed, 4 insertions(+), 1 deletion(-)

New commits:
commit d2873a0510d620de06ac3d4d30aabc9ab73ffe21
Author: dante 
AuthorDate: Fri Aug 20 14:49:02 2021 +0200
Commit: Noel Grandin 
CommitDate: Mon Sep 5 16:00:50 2022 +0200

Identify OOo2OasisTransformer and act in consequence

Change-Id: I99950e6dd73822ef49f9d4ef1155a5722b748127
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/120786
Tested-by: Jenkins
Reviewed-by: Noel Grandin 

diff --git a/starmath/source/mathml/import.cxx 
b/starmath/source/mathml/import.cxx
index 52d47028e657..90469abaa0d1 100644
--- a/starmath/source/mathml/import.cxx
+++ b/starmath/source/mathml/import.cxx
@@ -231,7 +231,7 @@ ErrCode SmMLImportWrapper::Import(SfxMedium& rMedium)
 xInfoSet, 
u"com.sun.star.comp.Math.XMLSettingsImporter", 5);
 
 // Check if successful
-if (nWarn == ERRCODE_IO_BROKENPACKAGE)
+if (nWarn != ERRCODE_NONE)
 {
 if (xStatusIndicator.is())
 xStatusIndicator->end();
@@ -435,6 +435,9 @@ ErrCode SmMLImportWrapper::ReadThroughComponentIS(
 else
 {
 SAL_WARN("starmath", "Filter failed on file input");
+// However this can not be included since it's not public
+if (pXMlImport == nullptr)
+return ERRCODE_NONE;
 return ERRCODE_SFX_DOLOADFAILED;
 }
 }


[Libreoffice-commits] core.git: starmath/source

2022-09-03 Thread Caolán McNamara (via logerrit)
 starmath/source/mathtype.cxx |   15 +--
 1 file changed, 9 insertions(+), 6 deletions(-)

New commits:
commit 3554e6d92b9045e6dd9881e294c3306dc08aeac9
Author: Caolán McNamara 
AuthorDate: Sat Sep 3 11:00:09 2022 +0100
Commit: Caolán McNamara 
CommitDate: Sat Sep 3 14:52:46 2022 +0200

cid#1509261 Dereference after null check

Change-Id: I74cf3eed734bc09abdbca455d9a762b5aeb02481
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/139315
Tested-by: Jenkins
Reviewed-by: Caolán McNamara 

diff --git a/starmath/source/mathtype.cxx b/starmath/source/mathtype.cxx
index 66b4dfd60f84..9273a4498b61 100644
--- a/starmath/source/mathtype.cxx
+++ b/starmath/source/mathtype.cxx
@@ -3191,8 +3191,9 @@ void MathType::HandleAttributes(SmNode *pNode,int nLevel)
 break;
 case TOVERLINE: //If the next node is not text
 //or text with more than one char
-if ((pIsText->GetToken().eType != TTEXT) ||
-(pIsText->GetText().getLength() > 1))
+if (!pIsText ||
+pIsText->GetToken().eType != TTEXT ||
+pIsText->GetText().getLength() > 1)
 nOldPending = StartTemplate(0x11);
 break;
 default:
@@ -3213,8 +3214,9 @@ void MathType::HandleAttributes(SmNode *pNode,int nLevel)
 EndTemplate(nOldPending);
 break;
 case TOVERLINE:
-if ((pIsText->GetToken().eType != TTEXT) ||
-(pIsText->GetText().getLength() > 1))
+if (!pIsText ||
+pIsText->GetToken().eType != TTEXT ||
+pIsText->GetText().getLength() > 1)
 EndTemplate(nOldPending);
 break;
 default:
@@ -3261,8 +3263,9 @@ void MathType::HandleAttributes(SmNode *pNode,int nLevel)
 pS->WriteUChar( 16 );
 break;
 case TOVERLINE:
-if ((pIsText->GetToken().eType == TTEXT) &&
-(pIsText->GetText().getLength() == 1))
+if (pIsText &&
+(pIsText->GetToken().eType == TTEXT &&
+ pIsText->GetText().getLength() == 1))
 pS->WriteUChar( 17 );
 break;
 case TBREVE:


[Libreoffice-commits] core.git: starmath/source

2022-09-01 Thread Caolán McNamara (via logerrit)
 starmath/source/mathtype.cxx |   25 ++---
 1 file changed, 14 insertions(+), 11 deletions(-)

New commits:
commit c097c2ff102e8033afd26e22b7ea092ae82e27b0
Author: Caolán McNamara 
AuthorDate: Thu Sep 1 11:41:02 2022 +0100
Commit: Caolán McNamara 
CommitDate: Thu Sep 1 15:01:49 2022 +0200

cid#1509261 Dereference after null check

Change-Id: Ib6dd69e4610ee6df76cde8446677e0f68bed3e0e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/139157
Tested-by: Caolán McNamara 
Reviewed-by: Caolán McNamara 

diff --git a/starmath/source/mathtype.cxx b/starmath/source/mathtype.cxx
index 518f29fc5b40..66b4dfd60f84 100644
--- a/starmath/source/mathtype.cxx
+++ b/starmath/source/mathtype.cxx
@@ -3204,19 +3204,22 @@ void MathType::HandleAttributes(SmNode *pNode,int 
nLevel)
 if (pIsText)
 HandleNodes(pIsText,nLevel+1);
 
-switch (pTemp->GetToken().eType)
+if (pTemp)
 {
-case TWIDEVEC:
-case TUNDERLINE:
-EndTemplate(nOldPending);
-break;
-case TOVERLINE:
-if ((pIsText->GetToken().eType != TTEXT) ||
-(pIsText->GetText().getLength() > 1))
+switch (pTemp->GetToken().eType)
+{
+case TWIDEVEC:
+case TUNDERLINE:
 EndTemplate(nOldPending);
-break;
-default:
-break;
+break;
+case TOVERLINE:
+if ((pIsText->GetToken().eType != TTEXT) ||
+(pIsText->GetText().getLength() > 1))
+EndTemplate(nOldPending);
+break;
+default:
+break;
+}
 }
 
 //if there was no suitable place to put the attribute,


[Libreoffice-commits] core.git: starmath/source

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

New commits:
commit ead23d945fb7bc794996c82287282bc385296ada
Author: Caolán McNamara 
AuthorDate: Wed Aug 31 11:27:07 2022 +0100
Commit: Caolán McNamara 
CommitDate: Wed Aug 31 20:53:26 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/+/139098
Tested-by: Jenkins
Reviewed-by: Caolán McNamara 

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;
 }
 


[Libreoffice-commits] core.git: starmath/source starmath/uiconfig

2022-08-18 Thread Mike Kaganski (via logerrit)
 starmath/source/SmElementsPanel.cxx|   10 +--
 starmath/source/SmElementsPanel.hxx|4 -
 starmath/uiconfig/smath/ui/sidebarelements_math.ui |   54 -
 3 files changed, 19 insertions(+), 49 deletions(-)

New commits:
commit 5ac75131556b687a01517ce4520a05bb49c1d840
Author: Mike Kaganski 
AuthorDate: Thu Aug 18 19:23:45 2022 +0300
Commit: Mike Kaganski 
CommitDate: Thu Aug 18 22:34:44 2022 +0200

Use combobox for category list on Elements sidebar panel

And replace GtkPaned with GtkBox: the elements are not expected
to have a resize handle between them.

Change-Id: I9ba170458754fe28052007e8051d3814dc7d2ea0
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/138501
Tested-by: Jenkins
Reviewed-by: Mike Kaganski 

diff --git a/starmath/source/SmElementsPanel.cxx 
b/starmath/source/SmElementsPanel.cxx
index 432e58d0e707..08ff6af95ab9 100644
--- a/starmath/source/SmElementsPanel.cxx
+++ b/starmath/source/SmElementsPanel.cxx
@@ -40,16 +40,16 @@ std::unique_ptr 
SmElementsPanel::Create(weld::Widget& rParent,
 SmElementsPanel::SmElementsPanel(weld::Widget& rParent, const SfxBindings& 
rBindings)
 : PanelLayout(, "MathElementsPanel", 
"modules/smath/ui/sidebarelements_math.ui")
 , mrBindings(rBindings)
-, mxCategoryList(m_xBuilder->weld_tree_view("categorylist"))
+, mxCategoryList(m_xBuilder->weld_combo_box("categorylist"))
 , 
mxElementsControl(std::make_unique(m_xBuilder->weld_icon_view("elements")))
 {
 for (const auto& rCategoryId : SmElementsControl::categories())
 mxCategoryList->append_text(SmResId(rCategoryId));
 
-mxCategoryList->set_size_request(-1, mxCategoryList->get_height_rows(6));
+mxCategoryList->set_size_request(-1, -1);
 
 mxCategoryList->connect_changed(LINK(this, SmElementsPanel, 
CategorySelectedHandle));
-mxCategoryList->select(0);
+mxCategoryList->set_active(0);
 
 mxElementsControl->setElementSetIndex(0);
 mxElementsControl->SetSelectHdl(LINK(this, SmElementsPanel, 
ElementClickHandler));
@@ -61,9 +61,9 @@ SmElementsPanel::~SmElementsPanel()
 mxCategoryList.reset();
 }
 
-IMPL_LINK(SmElementsPanel, CategorySelectedHandle, weld::TreeView&, rList, 
void)
+IMPL_LINK(SmElementsPanel, CategorySelectedHandle, weld::ComboBox&, rList, 
void)
 {
-const int nActive = rList.get_selected_index();
+const int nActive = rList.get_active();
 if (nActive == -1)
 return;
 mxElementsControl->setElementSetIndex(nActive);
diff --git a/starmath/source/SmElementsPanel.hxx 
b/starmath/source/SmElementsPanel.hxx
index d80d53e7211f..d7e4609a4246 100644
--- a/starmath/source/SmElementsPanel.hxx
+++ b/starmath/source/SmElementsPanel.hxx
@@ -40,14 +40,14 @@ public:
 ~SmElementsPanel();
 
 private:
-DECL_LINK(CategorySelectedHandle, weld::TreeView&, void);
+DECL_LINK(CategorySelectedHandle, weld::ComboBox&, void);
 DECL_LINK(ElementClickHandler, OUString, void);
 
 SmViewShell* GetView() const;
 
 const SfxBindings& mrBindings;
 
-std::unique_ptr mxCategoryList;
+std::unique_ptr mxCategoryList;
 std::unique_ptr mxElementsControl;
 };
 
diff --git a/starmath/uiconfig/smath/ui/sidebarelements_math.ui 
b/starmath/uiconfig/smath/ui/sidebarelements_math.ui
index 80bdfda4064b..b9a5736abb9d 100644
--- a/starmath/uiconfig/smath/ui/sidebarelements_math.ui
+++ b/starmath/uiconfig/smath/ui/sidebarelements_math.ui
@@ -2,14 +2,6 @@
 
 
   
-  
-
-  
-  
-  
-  
-
-  
   
 
   
@@ -18,47 +10,24 @@
   
 
   
-  
+  
 True
 False
 vertical
 True
 True
-6
-True
+6
 
-  
+  
 True
 True
-True
-True
-in
-
-  
-True
-True
-True
-True
-liststore1
-False
-0
-False
-
-  
-
-
-  
-
-  
-  
-0
-  
-
-  
-
-  
-
+Element 
categories
   
+  
+False
+True
+0
+  
 
 
   
@@ -81,8 +50,9 @@
 
   
   
-True
-True
+False
+True
+1
   
 
   


[Libreoffice-commits] core.git: starmath/source

2022-07-25 Thread Mike Kaganski (via logerrit)
 starmath/source/view.cxx |7 +++
 1 file changed, 7 insertions(+)

New commits:
commit 195faf2b3d1ee0f4fd1bf59137cc6310c390ebbe
Author: Mike Kaganski 
AuthorDate: Mon Jul 25 11:59:58 2022 +0300
Commit: Mike Kaganski 
CommitDate: Mon Jul 25 19:26:34 2022 +0200

Handle Ctrl+Z / Ctrl+Y in Math graphic window correctly

... instead of trying to insert a control character in the formula.

Change-Id: Ifcf4d3cea381cd29de310b041c08f7314cff
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/137402
Tested-by: Jenkins
Reviewed-by: Mike Kaganski 

diff --git a/starmath/source/view.cxx b/starmath/source/view.cxx
index ebbf0bcea2e6..e2b60cb9c6bd 100644
--- a/starmath/source/view.cxx
+++ b/starmath/source/view.cxx
@@ -65,6 +65,7 @@
 #include 
 #include 
 #include 
+#include 
 
 #include 
 
@@ -686,6 +687,12 @@ bool SmGraphicWidget::KeyInput(const KeyEvent& rKEvt)
 case KeyFuncType::PASTE:
 rCursor.Paste();
 break;
+case KeyFuncType::UNDO:
+GetDoc()->Execute(o3tl::temporary(SfxRequest(GetView().GetFrame(), 
SID_UNDO)));
+break;
+case KeyFuncType::REDO:
+GetDoc()->Execute(o3tl::temporary(SfxRequest(GetView().GetFrame(), 
SID_REDO)));
+break;
 default:
 switch (rKEvt.GetKeyCode().GetCode())
 {


[Libreoffice-commits] core.git: starmath/source

2022-06-02 Thread Andrea Gelmini (via logerrit)
 starmath/source/ElementsDockingWindow.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 7f1709d8b762c953f33ced3b53222599c40a40c6
Author: Andrea Gelmini 
AuthorDate: Thu Jun 2 14:32:15 2022 +0200
Commit: Julien Nabet 
CommitDate: Thu Jun 2 20:54:10 2022 +0200

Fix typo

Change-Id: Ie7d5a2b2a6fceb09ffcb6b24a462dd6911886a1d
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/135307
Tested-by: Jenkins
Reviewed-by: Julien Nabet 

diff --git a/starmath/source/ElementsDockingWindow.cxx 
b/starmath/source/ElementsDockingWindow.cxx
index bdfdf9e6444d..aab82cac3f11 100644
--- a/starmath/source/ElementsDockingWindow.cxx
+++ b/starmath/source/ElementsDockingWindow.cxx
@@ -523,7 +523,7 @@ void SmElementsControl::addElement(const OUString& 
aElementVisual, const OUStrin
 pNode->Arrange(*pDevice, maFormat);
 
 Size aSize = pDevice->LogicToPixel(Size(pNode->GetWidth(), 
pNode->GetHeight()));
-aSize.extendBy(10, 0); // Add 5 pixels from both sides to accomodate 
extending parts of italics
+aSize.extendBy(10, 0); // Add 5 pixels from both sides to accommodate 
extending parts of italics
 pDevice->SetOutputSizePixel(aSize);
 SmDrawingVisitor(*pDevice, pDevice->PixelToLogic(Point(5, 0)), 
pNode.get());
 


[Libreoffice-commits] core.git: starmath/source

2022-05-26 Thread Caolán McNamara (via logerrit)
 starmath/source/mathml/mathmlattr.cxx |1 +
 1 file changed, 1 insertion(+)

New commits:
commit f26926fe679d3718a61b6e5873cb2ffad0d391c3
Author: Caolán McNamara 
AuthorDate: Thu May 26 09:19:38 2022 +0100
Commit: Caolán McNamara 
CommitDate: Thu May 26 11:09:21 2022 +0200

ofz#47639 avoid Integer-overflow

Change-Id: I3f89238187dfb8cfd7a929d5f5576b83f6ec37c9
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134982
Tested-by: Jenkins
Reviewed-by: Caolán McNamara 

diff --git a/starmath/source/mathml/mathmlattr.cxx 
b/starmath/source/mathml/mathmlattr.cxx
index ce28ec7836e9..5e54f0d92e3e 100644
--- a/starmath/source/mathml/mathmlattr.cxx
+++ b/starmath/source/mathml/mathmlattr.cxx
@@ -40,6 +40,7 @@ static std::size_t 
ParseMathMLUnsignedNumber(std::u16string_view rStr, Fraction&
 if (validNomDen
 && (o3tl::checked_multiply(nom, sal_Int64(10), nom)
 || o3tl::checked_add(nom, sal_Int64(cD - u'0'), nom)
+|| nom >= std::numeric_limits::max()
 || (nDecimalPoint != std::u16string_view::npos
 && o3tl::checked_multiply(den, sal_Int64(10), den
 {


[Libreoffice-commits] core.git: starmath/source

2022-05-25 Thread Noel Grandin (via logerrit)
 starmath/source/mathtype.cxx |3 ++-
 starmath/source/mathtype.hxx |4 ++--
 2 files changed, 4 insertions(+), 3 deletions(-)

New commits:
commit a0731f14d1b9c86a626e8560053d87dcaaef8ad6
Author: Noel Grandin 
AuthorDate: Tue May 24 15:42:21 2022 +0200
Commit: Noel Grandin 
CommitDate: Wed May 25 19:00:26 2022 +0200

std::set->o3tl::sorted_vector in MathTypeFontSet

Change-Id: I8b664f10bee232355eeb431de6b1445d9c797f6e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134921
Tested-by: Jenkins
Reviewed-by: Noel Grandin 

diff --git a/starmath/source/mathtype.cxx b/starmath/source/mathtype.cxx
index 4df34fa1714e..518f29fc5b40 100644
--- a/starmath/source/mathtype.cxx
+++ b/starmath/source/mathtype.cxx
@@ -45,6 +45,7 @@ void MathType::Init()
 stored in the document
 */
 MathTypeFont aFont;
+aUserStyles.reserve(11);
 for(sal_uInt8 i=1;i<=11;i++)
 {
 aFont.nTface = i+128;
@@ -540,7 +541,7 @@ void MathTypeFont::AppendStyleToText(OUString )
 void MathType::TypeFaceToString(OUString ,sal_uInt8 nFace)
 {
 MathTypeFont aFont(nFace);
-MathTypeFontSet::iterator aItr = aUserStyles.find(aFont);
+auto aItr = aUserStyles.find(aFont);
 if (aItr != aUserStyles.end())
 aFont.nStyle = aItr->nStyle;
 aFont.AppendStyleToText(rTxt);
diff --git a/starmath/source/mathtype.hxx b/starmath/source/mathtype.hxx
index 4293b1e0608f..cd06cfcddf87 100644
--- a/starmath/source/mathtype.hxx
+++ b/starmath/source/mathtype.hxx
@@ -21,7 +21,7 @@
 
 #include 
 
-#include 
+#include 
 
 class SfxMedium;
 class SotStorage;
@@ -46,7 +46,7 @@ struct LessMathTypeFont
 }
 };
 
-typedef ::std::set< MathTypeFont, LessMathTypeFont > MathTypeFontSet;
+typedef o3tl::sorted_vector< MathTypeFont, LessMathTypeFont > MathTypeFontSet;
 
 class MathType
 {


[Libreoffice-commits] core.git: starmath/source svx/source ucbhelper/source

2022-05-23 Thread Noel Grandin (via logerrit)
 starmath/source/unomodel.cxx  |7 +++
 svx/source/customshapes/EnhancedCustomShape2d.cxx |   15 ++-
 ucbhelper/source/client/content.cxx   |3 ++-
 3 files changed, 15 insertions(+), 10 deletions(-)

New commits:
commit 0a1bfe1e3fb298d7d7e2cfd85887d430cce59238
Author: Noel Grandin 
AuthorDate: Mon May 23 11:04:19 2022 +0200
Commit: Noel Grandin 
CommitDate: Mon May 23 15:25:42 2022 +0200

elide some OUString allocation

Change-Id: I5f0b9057b86ec98b66b4ce2d6c681b8cb93d49e1
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134802
Tested-by: Jenkins
Reviewed-by: Noel Grandin 

diff --git a/starmath/source/unomodel.cxx b/starmath/source/unomodel.cxx
index 8b0b8817f588..b61fae230441 100644
--- a/starmath/source/unomodel.cxx
+++ b/starmath/source/unomodel.cxx
@@ -389,10 +389,9 @@ sal_Bool SmModel::supportsService(const OUString& 
rServiceName)
 
 uno::Sequence< OUString > SmModel::getSupportedServiceNames()
 {
-return uno::Sequence{
-"com.sun.star.document.OfficeDocument",
-"com.sun.star.formula.FormulaProperties"
-};
+static constexpr OUStringLiteral service1 = 
u"com.sun.star.document.OfficeDocument";
+static constexpr OUStringLiteral service2 = 
u"com.sun.star.formula.FormulaProperties";
+return uno::Sequence{ service1, service2 };
 }
 
 void SmModel::_setPropertyValues(const PropertyMapEntry** ppEntries, const 
Any* pValues)
diff --git a/svx/source/customshapes/EnhancedCustomShape2d.cxx 
b/svx/source/customshapes/EnhancedCustomShape2d.cxx
index 41cec42df4a1..87c081628993 100644
--- a/svx/source/customshapes/EnhancedCustomShape2d.cxx
+++ b/svx/source/customshapes/EnhancedCustomShape2d.cxx
@@ -541,13 +541,15 @@ bool 
EnhancedCustomShape2d::ConvertSequenceToEnhancedCustomShape2dHandle(
 void EnhancedCustomShape2d::ApplyShapeAttributes( const 
SdrCustomShapeGeometryItem& rGeometryItem )
 {
 // AdjustmentValues
-const Any* pAny = 
const_cast(rGeometryItem).GetPropertyValueByName( 
"AdjustmentValues" );
+static constexpr OUStringLiteral sAdjustmentValues( u"AdjustmentValues" );
+const Any* pAny = 
const_cast(rGeometryItem).GetPropertyValueByName( 
sAdjustmentValues );
 if ( pAny )
 *pAny >>= seqAdjustmentValues;
 
 
 // Coordsize
-const Any* pViewBox = 
const_cast(rGeometryItem).GetPropertyValueByName( 
"ViewBox" );
+static constexpr OUStringLiteral sViewBox( u"ViewBox" );
+const Any* pViewBox = 
const_cast(rGeometryItem).GetPropertyValueByName( 
sViewBox );
 css::awt::Rectangle aViewBox;
 if ( pViewBox && (*pViewBox >>= aViewBox ) )
 {
@@ -745,7 +747,8 @@ 
EnhancedCustomShape2d::EnhancedCustomShape2d(SdrObjCustomShape& rSdrObjCustomSha
 
 OUString sShapeType;
 const SdrCustomShapeGeometryItem& 
rGeometryItem(mrSdrObjCustomShape.GetMergedItem( SDRATTR_CUSTOMSHAPE_GEOMETRY 
));
-const Any* pAny = rGeometryItem.GetPropertyValueByName( "Type" );
+static constexpr OUStringLiteral sType = u"Type";
+const Any* pAny = rGeometryItem.GetPropertyValueByName( sType );
 if ( pAny ) {
 *pAny >>= sShapeType;
 bOOXMLShape = sShapeType.startsWith("ooxml-");
@@ -753,10 +756,12 @@ 
EnhancedCustomShape2d::EnhancedCustomShape2d(SdrObjCustomShape& rSdrObjCustomSha
 }
 eSpType = EnhancedCustomShapeTypeNames::Get( sShapeType );
 
-pAny = rGeometryItem.GetPropertyValueByName( "MirroredX" );
+static constexpr OUStringLiteral sMirroredX = u"MirroredX";
+static constexpr OUStringLiteral sMirroredY = u"MirroredY";
+pAny = rGeometryItem.GetPropertyValueByName( sMirroredX );
 if ( pAny )
 *pAny >>= bFlipH;
-pAny = rGeometryItem.GetPropertyValueByName( "MirroredY" );
+pAny = rGeometryItem.GetPropertyValueByName( sMirroredY );
 if ( pAny )
 *pAny >>= bFlipV;
 
diff --git a/ucbhelper/source/client/content.cxx 
b/ucbhelper/source/client/content.cxx
index 948c4848c6f4..7f3268c41754 100644
--- a/ucbhelper/source/client/content.cxx
+++ b/ucbhelper/source/client/content.cxx
@@ -416,8 +416,9 @@ Reference< XCommandInfo > Content::getCommands()
 
 Reference< XPropertySetInfo > Content::getProperties()
 {
+static constexpr OUStringLiteral sgetPropertySetInfo = 
u"getPropertySetInfo";
 Command aCommand;
-aCommand.Name = "getPropertySetInfo";
+aCommand.Name = sgetPropertySetInfo;
 aCommand.Handle   = -1; // n/a
 aCommand.Argument = Any();
 


[Libreoffice-commits] core.git: starmath/source

2022-05-23 Thread Michael Stahl (via logerrit)
 starmath/source/mathml/iterator.cxx |6 +-
 1 file changed, 5 insertions(+), 1 deletion(-)

New commits:
commit 32c43ee75c094ffe3c34f7a713aa252479515ad0
Author: Michael Stahl 
AuthorDate: Sun May 22 14:50:55 2022 +0200
Commit: Michael Stahl 
CommitDate: Mon May 23 10:48:56 2022 +0200

starmath: fix real use-after-free detected by GCC 12

In file included from starmath/inc/mathml/iterator.hxx:12,
 from starmath/source/mathml/iterator.cxx:10:
In member function ‘SmMlElement* SmMlElement::getParentElement()’,
inlined from ‘void mathml::SmMlIteratorBottomToTop(SmMlElement*, 
runType, void*) [with runType = void (*)(SmMlElement*, void*)]’ at 
starmath/inc/mathml/iterator.hxx:43:39,
inlined from ‘void mathml::SmMlIteratorFree(SmMlElement*)’ at 
starmath/source/mathml/iterator.cxx:57:28:
starmath/inc/mathml/element.hxx:263:46: error: pointer ‘pCurrent’ used 
after ‘void operator delete(void*, std::size_t)’ [-Werror=use-after-free]
  263 | SmMlElement* getParentElement() { return m_aParentElement; };
  |  ^~~~
In function ‘void mathml::deleteElement(SmMlElement*, void*)’,
inlined from ‘void mathml::deleteElement(SmMlElement*, void*)’ at 
starmath/source/mathml/iterator.cxx:19:20,
inlined from ‘void mathml::SmMlIteratorBottomToTop(SmMlElement*, 
runType, void*) [with runType = void (*)(SmMlElement*, void*)]’ at 
starmath/inc/mathml/iterator.hxx:65:21,
inlined from ‘void mathml::SmMlIteratorFree(SmMlElement*)’ at 
starmath/source/mathml/iterator.cxx:57:28:
starmath/source/mathml/iterator.cxx:19:77: note: call to ‘void operator 
delete(void*, std::size_t)’ here
   19 | static inline void deleteElement(SmMlElement* aSmMlElement, void*) 
{ delete aSmMlElement; }
  | 
^~~~

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

diff --git a/starmath/source/mathml/iterator.cxx 
b/starmath/source/mathml/iterator.cxx
index cfa9a0b78865..24de35c18323 100644
--- a/starmath/source/mathml/iterator.cxx
+++ b/starmath/source/mathml/iterator.cxx
@@ -54,7 +54,11 @@ void SmMlIteratorFree(SmMlElement* pMlElementTree)
 {
 if (pMlElementTree == nullptr)
 return;
-SmMlIteratorBottomToTop(pMlElementTree, deleteElement, nullptr);
+for (size_t i = 0; i < pMlElementTree->getSubElementsCount(); ++i)
+{
+SmMlIteratorFree(pMlElementTree->getSubElement(i));
+}
+deleteElement(pMlElementTree, nullptr);
 }
 
 SmMlElement* SmMlIteratorCopy(SmMlElement* pMlElementTree)


[Libreoffice-commits] core.git: starmath/source

2022-05-21 Thread Noel Grandin (via logerrit)
 starmath/source/mathml/mathmlexport.cxx |4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

New commits:
commit 052a6c9e5e2c5e4a4d1e3b3d91ca6464939ebbab
Author: Noel Grandin 
AuthorDate: Sat May 21 08:32:14 2022 +0200
Commit: Noel Grandin 
CommitDate: Sat May 21 12:31:34 2022 +0200

elide OUString allocation

Change-Id: I45cc3b8df0c29237b69cab87f0fbb6853776394f
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134701
Tested-by: Jenkins
Reviewed-by: Noel Grandin 

diff --git a/starmath/source/mathml/mathmlexport.cxx 
b/starmath/source/mathml/mathmlexport.cxx
index 64640ae0d96a..619082bd3758 100644
--- a/starmath/source/mathml/mathmlexport.cxx
+++ b/starmath/source/mathml/mathmlexport.cxx
@@ -544,8 +544,10 @@ void 
SmXMLExport::GetConfigurationSettings(Sequence& rProps)
aRet.Name = prop.Name;
OUString aActualName(prop.Name);
// handle 'save used symbols only'
+   static constexpr OUStringLiteral 
sUserDefinedSymbolsInUse
+   = u"UserDefinedSymbolsInUse";
if (bUsedSymbolsOnly && prop.Name == "Symbols")
-   aActualName = "UserDefinedSymbolsInUse";
+   aActualName = sUserDefinedSymbolsInUse;
aRet.Value = xProps->getPropertyValue(aActualName);
}
return aRet;


[Libreoffice-commits] core.git: starmath/source

2022-05-19 Thread Noel Grandin (via logerrit)
 starmath/source/mathtype.cxx |   22 --
 starmath/source/mathtype.hxx |1 -
 2 files changed, 12 insertions(+), 11 deletions(-)

New commits:
commit 8901242b249dacd9fb154ec12628d73562d89f79
Author: Noel Grandin 
AuthorDate: Wed May 18 20:58:12 2022 +0200
Commit: Noel Grandin 
CommitDate: Thu May 19 14:10:41 2022 +0200

the size table in MathType can be compile-time data

Change-Id: Ie0769509e38d3414bf227d8d2b7248461bc41aa6
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134598
Tested-by: Jenkins
Reviewed-by: Noel Grandin 

diff --git a/starmath/source/mathtype.cxx b/starmath/source/mathtype.cxx
index d261f5770dfe..4df34fa1714e 100644
--- a/starmath/source/mathtype.cxx
+++ b/starmath/source/mathtype.cxx
@@ -24,19 +24,21 @@
 #include 
 #include 
 #include 
+#include 
+
+//These are the default MathType sizes
+constexpr std::array aSizeTable {
+12,
+8,
+6,
+24,
+10,
+12,
+12,
+};
 
 void MathType::Init()
 {
-//These are the default MathType sizes
-aSizeTable.reserve(7);
-aSizeTable.push_back(12);
-aSizeTable.push_back(8);
-aSizeTable.push_back(6);
-aSizeTable.push_back(24);
-aSizeTable.push_back(10);
-aSizeTable.push_back(12);
-aSizeTable.push_back(12);
-
 /*
 These are the default MathType italic/bold settings If mathtype is changed
 from its defaults, there is nothing we can do, as this information is not
diff --git a/starmath/source/mathtype.hxx b/starmath/source/mathtype.hxx
index 0941edc1acb2..4293b1e0608f 100644
--- a/starmath/source/mathtype.hxx
+++ b/starmath/source/mathtype.hxx
@@ -153,7 +153,6 @@ private:
 int nPendingAttributes;
 sal_uInt64 nInsertion;
 
-std::vector aSizeTable;
 sal_Int16 nLSize;
 sal_Int16 nDSize;
 sal_Int16 nCurSize;


[Libreoffice-commits] core.git: starmath/source

2022-05-17 Thread Mike Kaganski (via logerrit)
 starmath/source/ElementsDockingWindow.cxx |8 
 1 file changed, 4 insertions(+), 4 deletions(-)

New commits:
commit 64d2c70c9092149e634ff8bcf416ef2fb10d3062
Author: Mike Kaganski 
AuthorDate: Tue May 17 16:02:52 2022 +0200
Commit: Mike Kaganski 
CommitDate: Tue May 17 18:03:17 2022 +0200

Use structured binding to clarify the code

Change-Id: I6b1c0532a64a18d961b7ab112675213eea2fd121
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134438
Tested-by: Jenkins
Reviewed-by: Mike Kaganski 

diff --git a/starmath/source/ElementsDockingWindow.cxx 
b/starmath/source/ElementsDockingWindow.cxx
index ed67baa9260f..8256dfe19c55 100644
--- a/starmath/source/ElementsDockingWindow.cxx
+++ b/starmath/source/ElementsDockingWindow.cxx
@@ -1042,15 +1042,15 @@ void SmElementsControl::build()
 {
 case 5:
 {
-for (sal_uInt16 n = 0; n < m_a5CategoriesSize; ++n)
+for (const auto& [rSetId, rElementsArray, rElementsArraySize] : 
m_a5Categories)
 {
-if (msCurrentSetId == std::get<0>(m_a5Categories[n]))
+if (msCurrentSetId == rSetId)
 {
-addElements(std::get<1>(m_a5Categories[n]), 
std::get<2>(m_a5Categories[n]));
+addElements(rElementsArray, rElementsArraySize);
 break;
 }
 else
-m_nCurrentOffset += std::get<2>(m_a5Categories[n]);
+m_nCurrentOffset += rElementsArraySize;
 }
 break;
 }


[Libreoffice-commits] core.git: starmath/source unoidl/source

2022-05-17 Thread Noel Grandin (via logerrit)
 starmath/source/mathtype.cxx |1 +
 unoidl/source/unoidlprovider.cxx |   21 +
 2 files changed, 22 insertions(+)

New commits:
commit 4dc1a911a5b20bf08341b1db098a577ecc9afea3
Author: Noel Grandin 
AuthorDate: Tue May 17 15:03:03 2022 +0200
Commit: Noel Grandin 
CommitDate: Tue May 17 17:37:20 2022 +0200

use reserve before filling some vectors

Change-Id: Ib2ae513de46b2a0c16101747540ba09a7cdfb018
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134481
Tested-by: Jenkins
Reviewed-by: Noel Grandin 

diff --git a/starmath/source/mathtype.cxx b/starmath/source/mathtype.cxx
index d9306c2402df..d261f5770dfe 100644
--- a/starmath/source/mathtype.cxx
+++ b/starmath/source/mathtype.cxx
@@ -28,6 +28,7 @@
 void MathType::Init()
 {
 //These are the default MathType sizes
+aSizeTable.reserve(7);
 aSizeTable.push_back(12);
 aSizeTable.push_back(8);
 aSizeTable.push_back(6);
diff --git a/unoidl/source/unoidlprovider.cxx b/unoidl/source/unoidlprovider.cxx
index 0b29906a8cb2..216bf564e14d 100644
--- a/unoidl/source/unoidlprovider.cxx
+++ b/unoidl/source/unoidlprovider.cxx
@@ -777,6 +777,7 @@ rtl::Reference< Entity > readEntity(
 }
 offset += 5;
 std::vector< EnumTypeEntity::Member > mems;
+mems.reserve(n);
 for (sal_uInt32 i = 0; i != n; ++i) {
 OUString memName(file->readIdxName());
 checkEntityName(file, memName);
@@ -817,6 +818,7 @@ rtl::Reference< Entity > readEntity(
 }
 offset += 4;
 std::vector< PlainStructTypeEntity::Member > mems;
+mems.reserve(n);
 for (sal_uInt32 i = 0; i != n; ++i) {
 OUString memName(file->readIdxName());
 checkEntityName(file, memName);
@@ -841,6 +843,7 @@ rtl::Reference< Entity > readEntity(
 }
 offset += 5;
 std::vector< OUString > params;
+params.reserve(n);
 for (sal_uInt32 i = 0; i != n; ++i) {
 OUString param(file->readIdxName());
 checkEntityName(file, param);
@@ -855,6 +858,7 @@ rtl::Reference< Entity > readEntity(
 }
 offset += 4;
 std::vector< PolymorphicStructTypeTemplateEntity::Member > mems;
+mems.reserve(n);
 for (sal_uInt32 i = 0; i != n; ++i) {
 v = file->read8(offset);
 ++offset;
@@ -900,6 +904,7 @@ rtl::Reference< Entity > readEntity(
 }
 offset += 4;
 std::vector< ExceptionTypeEntity::Member > mems;
+mems.reserve(n);
 for (sal_uInt32 i = 0; i != n; ++i) {
 OUString memName(file->readIdxName());
 checkEntityName(file, memName);
@@ -924,6 +929,7 @@ rtl::Reference< Entity > readEntity(
 }
 offset += 5;
 std::vector< AnnotatedReference > mandBases;
+mandBases.reserve(n);
 for (sal_uInt32 i = 0; i != n; ++i) {
 OUString base(file->readIdxName());
 checkTypeName(file, base);
@@ -939,6 +945,7 @@ rtl::Reference< Entity > readEntity(
 }
 offset += 4;
 std::vector< AnnotatedReference > optBases;
+optBases.reserve(n);
 for (sal_uInt32 i = 0; i != n; ++i) {
 OUString base(file->readIdxName());
 checkTypeName(file, base);
@@ -954,6 +961,7 @@ rtl::Reference< Entity > readEntity(
 }
 offset += 4;
 std::vector< InterfaceTypeEntity::Attribute > attrs;
+attrs.reserve(nAttrs);
 for (sal_uInt32 i = 0; i != nAttrs; ++i) {
 v = file->read8(offset);
 ++offset;
@@ -976,6 +984,7 @@ rtl::Reference< Entity > readEntity(
  " attribute " + attrName + " of interface type"));
 }
 offset += 4;
+getExcs.reserve(m);
 for (sal_uInt32 j = 0; j != m; ++j) {
 OUString exc(file->readIdxName());
 checkTypeName(file, exc);
@@ -992,6 +1001,7 @@ rtl::Reference< Entity > readEntity(
  + " of interface type"));
 }
 offset += 4;
+setExcs.reserve(m);
 for (sal_uInt32 j = 0; j != m; ++j) {
 OUString exc(file->readIdxName());
 checkTypeName(file, exc);
@@ -1027,6 +1037,7 @@ rtl::Reference< Entity > readEntity(
 }
 offset += 4;
 std::vector< InterfaceTypeEntity::Method::Parameter > params;
+params.reserve(m);
 for (sal_uInt32 j = 0; j != m; ++j) {
 v = file->read8(offset);
 ++offset;
@@ -1067,6 +1078,7 @@ rtl::Reference< 

[Libreoffice-commits] core.git: starmath/source

2022-05-13 Thread Noel Grandin (via logerrit)
 starmath/source/parse5.cxx |4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

New commits:
commit 205f99d6cf4dcfab6ee6c66efd1788200ac118c4
Author: Noel Grandin 
AuthorDate: Thu May 12 19:46:50 2022 +0200
Commit: Noel Grandin 
CommitDate: Fri May 13 14:01:02 2022 +0200

use vector as backing for stack

which is a little faster

Change-Id: Id086b67eba3ec00dc86a48a0fdec1a467b600d1c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134268
Tested-by: Jenkins
Reviewed-by: Noel Grandin 

diff --git a/starmath/source/parse5.cxx b/starmath/source/parse5.cxx
index 1bc218f646f0..06aa373aa037 100644
--- a/starmath/source/parse5.cxx
+++ b/starmath/source/parse5.cxx
@@ -1781,7 +1781,9 @@ std::unique_ptr SmParser5::DoTerm(bool 
bGroupNumberIdent)
 return DoUnOper();
 if (TokenInGroup(TG::Attribute) || TokenInGroup(TG::FontAttr))
 {
-std::stack> aStack;
+std::stack,
+   std::vector>>
+aStack;
 bool bIsAttr;
 for (;;)
 {


[Libreoffice-commits] core.git: starmath/source

2022-05-11 Thread Noel Grandin (via logerrit)
 starmath/source/unomodel.cxx |5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

New commits:
commit 8055ad41bbde67d0be0b240218295ea16c03d136
Author: Noel Grandin 
AuthorDate: Wed May 11 11:03:12 2022 +0200
Commit: Noel Grandin 
CommitDate: Wed May 11 15:18:19 2022 +0200

cache the PropertySetInfo in lcl_createModelPropertyInfo

we only need one of them

Change-Id: I2f6f2c75da96f76d4bf9cb31ef31bf597a3f5e6e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134159
Tested-by: Jenkins
Reviewed-by: Noel Grandin 

diff --git a/starmath/source/unomodel.cxx b/starmath/source/unomodel.cxx
index 4b32900cbf26..8b0b8817f588 100644
--- a/starmath/source/unomodel.cxx
+++ b/starmath/source/unomodel.cxx
@@ -228,7 +228,7 @@ enum SmModelPropertyHandles
 
 }
 
-static rtl::Reference lcl_createModelPropertyInfo ()
+static const rtl::Reference & lcl_createModelPropertyInfo ()
 {
 static PropertyMapEntry aModelPropertyInfoMap[] =
 {
@@ -304,7 +304,8 @@ static rtl::Reference 
lcl_createModelPropertyInfo ()
 { OUString("SyntaxVersion"), 
HANDLE_STARMATH_VERSION   ,  ::cppu::UnoType::get(), 
PROPERTY_NONE,  0 },
 { OUString(), 0, css::uno::Type(), 0, 0 }
 };
-return rtl::Reference( new PropertySetInfo ( 
aModelPropertyInfoMap ) );
+static const rtl::Reference PROPS_INFO = new 
PropertySetInfo ( aModelPropertyInfoMap );
+return PROPS_INFO;
 }
 
 SmModel::SmModel( SfxObjectShell *pObjSh )


[Libreoffice-commits] core.git: starmath/source

2022-05-11 Thread Noel Grandin (via logerrit)
 starmath/source/symbol.cxx |1 +
 1 file changed, 1 insertion(+)

New commits:
commit 8ca5cdbd87bedc6a239dfed060d3100ea5e0196e
Author: Noel Grandin 
AuthorDate: Wed May 11 11:02:50 2022 +0200
Commit: Noel Grandin 
CommitDate: Wed May 11 15:17:51 2022 +0200

reserve vector space in SmSymbolManager::GetSymbols

Change-Id: I9101e07fa54e35f1cec9797deaf1647763c9ebfe
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134158
Tested-by: Jenkins
Reviewed-by: Noel Grandin 

diff --git a/starmath/source/symbol.cxx b/starmath/source/symbol.cxx
index d28d558f59a1..5dcf17309372 100644
--- a/starmath/source/symbol.cxx
+++ b/starmath/source/symbol.cxx
@@ -122,6 +122,7 @@ SmSym *SmSymbolManager::GetSymbolByName(const OUString& 
rSymbolName)
 SymbolPtrVec_t SmSymbolManager::GetSymbols() const
 {
 SymbolPtrVec_t aRes;
+aRes.reserve(m_aSymbols.size());
 for (const auto& rEntry : m_aSymbols)
 aRes.push_back(  );
 //OSL_ENSURE( sSymbols.size() == m_aSymbols.size(), "number of symbols 
mismatch " );


[Libreoffice-commits] core.git: starmath/source

2022-05-06 Thread Caolán McNamara (via logerrit)
 starmath/source/edit.cxx |4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

New commits:
commit 531405a695d6bad044545ab96f2eb26e5c6d5778
Author: Caolán McNamara 
AuthorDate: Fri May 6 14:41:15 2022 +0100
Commit: Caolán McNamara 
CommitDate: Fri May 6 17:17:23 2022 +0200

tdf#148962 starmath's UnicodeNotationToggle (alt+x) getting called twice

Change-Id: Ib150e4825c547c19a30c7b66d3f33904b814a917
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133942
Tested-by: Jenkins
Reviewed-by: Caolán McNamara 

diff --git a/starmath/source/edit.cxx b/starmath/source/edit.cxx
index 6a6bbbf1162a..a0e75f18b408 100644
--- a/starmath/source/edit.cxx
+++ b/starmath/source/edit.cxx
@@ -341,7 +341,9 @@ bool SmEditTextWindow::KeyInput(const KeyEvent& rKEvt)
 if (!bConsumed)
 {
 SmViewShell *pView = mrEditWindow.GetView();
-if ( pView && !pView->KeyInput(rKEvt) )
+if (pView)
+bConsumed = pView->KeyInput(rKEvt);
+if (pView && !bConsumed)
 {
 // F1 (help) leads to the destruction of this
 Flush();


[Libreoffice-commits] core.git: starmath/source

2022-05-04 Thread Stephan Bergmann (via logerrit)
 starmath/source/mathml/export.cxx   |6 +++---
 starmath/source/mathml/import.cxx   |6 +++---
 starmath/source/mathml/mathmlexport.cxx |6 +++---
 starmath/source/mathml/mathmlimport.cxx |6 +++---
 4 files changed, 12 insertions(+), 12 deletions(-)

New commits:
commit 9c111cc4302bf344b4093693e64833d6bd870602
Author: Stephan Bergmann 
AuthorDate: Tue May 3 21:39:56 2022 +0200
Commit: Stephan Bergmann 
CommitDate: Wed May 4 09:59:04 2022 +0200

Just use Any ctor instead of makeAny in starmath

Change-Id: I8264c2330837fbd46ea372a8e370bb43ca1fb7b5
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133775
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann 

diff --git a/starmath/source/mathml/export.cxx 
b/starmath/source/mathml/export.cxx
index b7b7d6c82733..7115e7a1a8f3 100644
--- a/starmath/source/mathml/export.cxx
+++ b/starmath/source/mathml/export.cxx
@@ -144,7 +144,7 @@ bool SmMLExportWrapper::Export(SfxMedium& rMedium)
 xInfoSet->setPropertyValue("UsePrettyPrinting", Any(true));
 
 // Set base URI
-xInfoSet->setPropertyValue(u"BaseURI", makeAny(rMedium.GetBaseURL(true)));
+xInfoSet->setPropertyValue(u"BaseURI", Any(rMedium.GetBaseURL(true)));
 
 if (!m_bFlat) //Storage (Package) of Stream
 {
@@ -165,7 +165,7 @@ bool SmMLExportWrapper::Export(SfxMedium& rMedium)
 {
 OUString aName = pDocHierarchItem->GetValue();
 if (!aName.isEmpty())
-xInfoSet->setPropertyValue("StreamRelPath", 
makeAny(aName));
+xInfoSet->setPropertyValue("StreamRelPath", Any(aName));
 }
 }
 else
@@ -395,7 +395,7 @@ bool SmMLExportWrapper::WriteThroughComponentS(const 
Reference&
 xSet->setPropertyValue("UseCommonStoragePasswordEncryption", Any(true));
 
 // set Base URL
-rPropSet->setPropertyValue("StreamName", makeAny(OUString(pStreamName)));
+rPropSet->setPropertyValue("StreamName", Any(OUString(pStreamName)));
 
 // write the stuff
 // Note: export through an XML exporter component (output stream version)
diff --git a/starmath/source/mathml/import.cxx 
b/starmath/source/mathml/import.cxx
index ea3f63eee264..950bbff4dfe3 100644
--- a/starmath/source/mathml/import.cxx
+++ b/starmath/source/mathml/import.cxx
@@ -156,7 +156,7 @@ ErrCode SmMLImportWrapper::Import(SfxMedium& rMedium)
 // Set base URI
 // needed for relative URLs; but it's OK to import e.g. MathML from the 
clipboard without one
 SAL_INFO_IF(rMedium.GetBaseURL().isEmpty(), "starmath", 
"SmMLImportWrapper: no base URL");
-xInfoSet->setPropertyValue("BaseURI", makeAny(rMedium.GetBaseURL()));
+xInfoSet->setPropertyValue("BaseURI", Any(rMedium.GetBaseURL()));
 
 // Fetch progress range
 sal_Int32 nProgressRange(rMedium.IsStorage() ? 3 : 1);
@@ -182,7 +182,7 @@ ErrCode SmMLImportWrapper::Import(SfxMedium& rMedium)
 }
 
 if (!aName.isEmpty())
-xInfoSet->setPropertyValue("StreamRelPath", makeAny(aName));
+xInfoSet->setPropertyValue("StreamRelPath", Any(aName));
 }
 
 // Check if use OASIS ( new document format )
@@ -535,7 +535,7 @@ ErrCode SmMLImportWrapper::ReadThroughComponentS(const 
uno::Reference>= bEncrypted;
 
 // Set base URL and open stream
-rPropSet->setPropertyValue("StreamName", 
makeAny(OUString(pStreamName)));
+rPropSet->setPropertyValue("StreamName", Any(OUString(pStreamName)));
 Reference xStream = xEventsStream->getInputStream();
 
 // Execute read
diff --git a/starmath/source/mathml/mathmlexport.cxx 
b/starmath/source/mathml/mathmlexport.cxx
index b52b447b3439..142ba6fd665c 100644
--- a/starmath/source/mathml/mathmlexport.cxx
+++ b/starmath/source/mathml/mathmlexport.cxx
@@ -148,7 +148,7 @@ bool SmXMLExportWrapper::Export(SfxMedium& rMedium)
 
 // Set base URI
 OUString sPropName("BaseURI");
-xInfoSet->setPropertyValue(sPropName, makeAny(rMedium.GetBaseURL(true)));
+xInfoSet->setPropertyValue(sPropName, Any(rMedium.GetBaseURL(true)));
 
 sal_Int32 nSteps = 0;
 if (xStatusIndicator.is())
@@ -173,7 +173,7 @@ bool SmXMLExportWrapper::Export(SfxMedium& rMedium)
 if (!aName.isEmpty())
 {
 sPropName = "StreamRelPath";
-xInfoSet->setPropertyValue(sPropName, makeAny(aName));
+xInfoSet->setPropertyValue(sPropName, Any(aName));
 }
 }
 
@@ -300,7 +300,7 @@ bool SmXMLExportWrapper::WriteThroughComponent(const 
Reference&
 // set Base URL
 if (rPropSet.is())
 {
-rPropSet->setPropertyValue("StreamName", makeAny(sStreamName));
+rPropSet->setPropertyValue("StreamName", Any(sStreamName));
 }
 
 // write the stuff
diff --git a/starmath/source/mathml/mathmlimport.cxx 
b/starmath/source/mathml/mathmlimport.cxx
index f8c845e93dee..6020b5ffb044 100644
--- 

[Libreoffice-commits] core.git: starmath/source

2022-05-01 Thread Caolán McNamara (via logerrit)
 starmath/source/node.cxx |6 ++
 1 file changed, 6 insertions(+)

New commits:
commit cd9602dcc51a7ce54fadf9796642ee9d7fcf3cfe
Author: Caolán McNamara 
AuthorDate: Sat Apr 30 20:03:51 2022 +0100
Commit: Caolán McNamara 
CommitDate: Sun May 1 15:42:56 2022 +0200

ofz#47162 Integer-overflow

Change-Id: I4d910a1844100415f95c89bda83843ddffdc3df0
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133663
Tested-by: Caolán McNamara 
Reviewed-by: Caolán McNamara 

diff --git a/starmath/source/node.cxx b/starmath/source/node.cxx
index a13f5deada56..c4c013b15725 100644
--- a/starmath/source/node.cxx
+++ b/starmath/source/node.cxx
@@ -782,6 +782,12 @@ void SmRootNode::Arrange(OutputDevice , const 
SmFormat )
 nHeight += rFormat.GetDistance(DIS_ROOT)
* GetFont().GetFontSize().Height() / 100;
 
+if (nHeight < 0)
+{
+SAL_WARN("starmath", "negative height");
+nHeight = 0;
+}
+
 // font specialist advised to change the width first
 pRootSym->AdaptToY(rDev, nHeight);
 pRootSym->AdaptToX(rDev, pBody->GetItalicWidth());


[Libreoffice-commits] core.git: starmath/source

2022-04-27 Thread Mike Kaganski (via logerrit)
 starmath/source/ElementsDockingWindow.cxx |2 ++
 1 file changed, 2 insertions(+)

New commits:
commit 8de60b9049f07d8a958d0e28759dca247c4d5044
Author: Mike Kaganski 
AuthorDate: Wed Apr 27 17:40:20 2022 +0300
Commit: Mike Kaganski 
CommitDate: Wed Apr 27 22:36:06 2022 +0200

tdf#148819: let the scroller know the custom widget's line size

Change-Id: Ie30cd1db182aad5fbbf7e89498bd0ae9ce98c0f3
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133518
Tested-by: Jenkins
Reviewed-by: Mike Kaganski 

diff --git a/starmath/source/ElementsDockingWindow.cxx 
b/starmath/source/ElementsDockingWindow.cxx
index 7f1b86120ad0..ed67baa9260f 100644
--- a/starmath/source/ElementsDockingWindow.cxx
+++ b/starmath/source/ElementsDockingWindow.cxx
@@ -500,6 +500,7 @@ void 
SmElementsControl::LayoutOrPaintContents(vcl::RenderContext& rContext, bool
 mxScroll->hadjustment_set_upper(nTotalControlWidth);
 mxScroll->hadjustment_set_page_size(nControlWidth);
 mxScroll->hadjustment_set_page_increment(nControlWidth);
+mxScroll->hadjustment_set_step_increment(boxX);
 mxScroll->set_hpolicy(VclPolicyType::ALWAYS);
 }
 else
@@ -516,6 +517,7 @@ void 
SmElementsControl::LayoutOrPaintContents(vcl::RenderContext& rContext, bool
 mxScroll->vadjustment_set_upper(nTotalControlHeight);
 mxScroll->vadjustment_set_page_size(nControlHeight);
 mxScroll->vadjustment_set_page_increment(nControlHeight);
+mxScroll->vadjustment_set_step_increment(boxY);
 mxScroll->set_vpolicy(VclPolicyType::ALWAYS);
 }
 else


[Libreoffice-commits] core.git: starmath/source

2022-04-27 Thread Mike Kaganski (via logerrit)
 starmath/source/SmElementsPanel.hxx |2 --
 1 file changed, 2 deletions(-)

New commits:
commit 3ce4689dd73e5652d58d186ed7380f576ff56617
Author: Mike Kaganski 
AuthorDate: Wed Apr 27 15:53:09 2022 +0300
Commit: Mike Kaganski 
CommitDate: Wed Apr 27 18:03:02 2022 +0200

Clean up includes

Change-Id: Ied9a75953875e809e4284fdff03aab6add6800ac
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133511
Tested-by: Jenkins
Reviewed-by: Mike Kaganski 

diff --git a/starmath/source/SmElementsPanel.hxx 
b/starmath/source/SmElementsPanel.hxx
index 4629b33af409..72de4c227a87 100644
--- a/starmath/source/SmElementsPanel.hxx
+++ b/starmath/source/SmElementsPanel.hxx
@@ -22,8 +22,6 @@
 #include 
 
 #include 
-#include 
-#include 
 #include 
 #include 
 #include 


[Libreoffice-commits] core.git: starmath/source

2022-03-11 Thread Mike Kaganski (via logerrit)
 starmath/source/view.cxx |   10 --
 1 file changed, 10 deletions(-)

New commits:
commit 344353495c60dcdc69f7975ec4e51a753ebfb81f
Author: Mike Kaganski 
AuthorDate: Fri Mar 11 17:48:53 2022 +0300
Commit: Mike Kaganski 
CommitDate: Sat Mar 12 07:04:38 2022 +0100

Related: tdf#128610 drop obsolete encoding attribute replacement

It was needed once, when we used expat; now libxml2 does its own
detection (in its xmlDetectCharEncoding) after the strange dance
in our XMLFile2UTFConverter::readAndConvert (which does nothing
useful for UTF-16 case).

The original problem in tdf#128610 was addressed in commit
c964700d16d99d1569373a1eb9a1352fb3512915. This one just drops
the obsolete replacement.

Change-Id: I2e6b28212619dd0f6cb90ae8234277092a37e7a7
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/131409
Tested-by: Jenkins
Reviewed-by: Mike Kaganski 

diff --git a/starmath/source/view.cxx b/starmath/source/view.cxx
index 77886a5795dc..4ab60033951e 100644
--- a/starmath/source/view.cxx
+++ b/starmath/source/view.cxx
@@ -1832,16 +1832,6 @@ void SmViewShell::Execute(SfxRequest& rReq)
 SfxFilter::GetFilterByName(MATHML_XML);
 aClipboardMedium.SetFilter(pMathFilter);
 
-// The text to be imported might asserts encoding 
like 'encoding="utf-8"' but FORMAT_STRING is UTF-16.
-// Force encoding to UTF-16, if encoding exists.
-sal_Int32 nPosL = aString.indexOf("encoding=\"");
-if ( nPosL >= 0 && nPosL +10 < aString.getLength() 
)
-{
-nPosL += 10;
-sal_Int32 nPosU = aString.indexOf( '"',nPosL);
-if (nPosU > nPosL)
-aString = aString.replaceAt(nPosL, nPosU - 
nPosL, u"UTF-16");
-}
 SvMemoryStream aStrm( const_cast(aString.getStr()), aString.getLength() * sizeof(sal_Unicode), 
StreamMode::READ);
 uno::Reference xStrm2( new 
::utl::OInputStreamWrapper(aStrm) );
 aClipboardMedium.setStreamToLoadFrom(xStrm2, true 
/*bIsReadOnly*/);


[Libreoffice-commits] core.git: starmath/source

2022-03-11 Thread Mike Kaganski (via logerrit)
 starmath/source/view.cxx |   21 -
 1 file changed, 4 insertions(+), 17 deletions(-)

New commits:
commit c964700d16d99d1569373a1eb9a1352fb3512915
Author: Mike Kaganski 
AuthorDate: Fri Mar 11 15:19:41 2022 +0300
Commit: Mike Kaganski 
CommitDate: Fri Mar 11 15:03:51 2022 +0100

Related: tdf#128610 Avoid use-after-free

Creating SvMemoryStream from string makes it non-owning, i.e. pointing
to the string's memory. So the string must outlive the stream.

Since commit 64bc8b45b5c23efc5fe57585a69aa4263aaf4e83
  Date   Wed Jul 08 12:31:43 2015 +
i#107734 Support for Math Input Panel in Windows 7

Was only working by chance, when destructor didn't clean the memory
(e.g., in optimized release builds) and the released memory hasn't
been reused yet.

Change-Id: I2e0c195de7bd2aff2889a94ef0f2eb084411933f
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/131373
Tested-by: Mike Kaganski 
Reviewed-by: Mike Kaganski 

diff --git a/starmath/source/view.cxx b/starmath/source/view.cxx
index eb1555a9a29b..77886a5795dc 100644
--- a/starmath/source/view.cxx
+++ b/starmath/source/view.cxx
@@ -1832,31 +1832,18 @@ void SmViewShell::Execute(SfxRequest& rReq)
 SfxFilter::GetFilterByName(MATHML_XML);
 aClipboardMedium.SetFilter(pMathFilter);
 
-std::unique_ptr pStrm;
 // The text to be imported might asserts encoding 
like 'encoding="utf-8"' but FORMAT_STRING is UTF-16.
 // Force encoding to UTF-16, if encoding exists.
-bool bForceUTF16 = false;
 sal_Int32 nPosL = aString.indexOf("encoding=\"");
-sal_Int32 nPosU = -1;
 if ( nPosL >= 0 && nPosL +10 < aString.getLength() 
)
 {
 nPosL += 10;
-nPosU = aString.indexOf( '"',nPosL);
+sal_Int32 nPosU = aString.indexOf( '"',nPosL);
 if (nPosU > nPosL)
-{
-bForceUTF16 = true;
-}
+aString = aString.replaceAt(nPosL, nPosU - 
nPosL, u"UTF-16");
 }
-if ( bForceUTF16 )
-{
-OUString aNewString = aString.replaceAt( 
nPosL, nPosU-nPosL, u"UTF-16");
-pStrm.reset(new SvMemoryStream( 
const_cast(aNewString.getStr()), aNewString.getLength() * 
sizeof(sal_Unicode), StreamMode::READ));
-}
-else
-{
-pStrm.reset(new SvMemoryStream( 
const_cast(aString.getStr()), aString.getLength() * 
sizeof(sal_Unicode), StreamMode::READ));
-}
-uno::Reference xStrm2( new 
::utl::OInputStreamWrapper(*pStrm) );
+SvMemoryStream aStrm( const_cast(aString.getStr()), aString.getLength() * sizeof(sal_Unicode), 
StreamMode::READ);
+uno::Reference xStrm2( new 
::utl::OInputStreamWrapper(aStrm) );
 aClipboardMedium.setStreamToLoadFrom(xStrm2, true 
/*bIsReadOnly*/);
 InsertFrom(aClipboardMedium);
 GetDoc()->UpdateText();


[Libreoffice-commits] core.git: starmath/source

2022-02-27 Thread Julien Nabet (via logerrit)
 starmath/source/mathml/import.cxx |3 +++
 1 file changed, 3 insertions(+)

New commits:
commit a8815905278e9df47bb0aea80affc2c30055b316
Author: Julien Nabet 
AuthorDate: Sun Feb 27 11:47:44 2022 +0100
Commit: Julien Nabet 
CommitDate: Sun Feb 27 12:33:59 2022 +0100

cid#1500496: Uninitialized pointer read

Values retrieved from SmMlAttribute::setDefaultAttributeValue in case 
SmMlAttributeValueType::MlMaxsize
see 
https://opengrok.libreoffice.org/xref/core/starmath/source/mathml/attribute.cxx?r=ffaaec23#94

Change-Id: Ie36254157da7ce85223ca71e2070fbd075b52699
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/130620
Reviewed-by: Mike Kaganski 
Reviewed-by: Julien Nabet 
Tested-by: Jenkins

diff --git a/starmath/source/mathml/import.cxx 
b/starmath/source/mathml/import.cxx
index d09b29e21b9c..a9af99c07949 100644
--- a/starmath/source/mathml/import.cxx
+++ b/starmath/source/mathml/import.cxx
@@ -1049,7 +1049,10 @@ void SmMLImportContext::handleAttributes(const 
Reference& aA
 {
 SmMlMaxsize aMaxsize;
 if (IsXMLToken(aIter, XML_INFINITY))
+{
 aMaxsize.m_aMaxsize = 
SmMlAttributeValueMaxsize::MlInfinity;
+aMaxsize.m_aLengthValue = { SmLengthUnit::MlP, 1, new 
OUString(u"1%") };
+}
 else
 {
 aMaxsize.m_aMaxsize = SmMlAttributeValueMaxsize::MlFinite;


[Libreoffice-commits] core.git: starmath/source

2022-02-26 Thread Caolán McNamara (via logerrit)
 starmath/source/dialog.cxx |3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

New commits:
commit fbd33571cd8f54161669abc6b696f6ebd085d70a
Author: Caolán McNamara 
AuthorDate: Fri Feb 25 21:43:04 2022 +
Commit: Caolán McNamara 
CommitDate: Sat Feb 26 11:33:39 2022 +0100

cid#1500654 Using a moved object

Change-Id: Ia4b74cdeeae7f0c03e7e050be30714f948c67106
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/130567
Tested-by: Jenkins
Reviewed-by: Caolán McNamara 

diff --git a/starmath/source/dialog.cxx b/starmath/source/dialog.cxx
index 51a923023c36..1c63416e57c1 100644
--- a/starmath/source/dialog.cxx
+++ b/starmath/source/dialog.cxx
@@ -1349,8 +1349,9 @@ bool SmSymbolDialog::SelectSymbolSet(const OUString 
)
return pSym1->GetCharacter() < pSym2->GetCharacter();
} );
 
+const bool bEmptySymbolSet = aSymbolSet.empty();
 m_xSymbolSetDisplay->SetSymbolSet( std::move(aSymbolSet) );
-if (!aSymbolSet.empty())
+if (!bEmptySymbolSet)
 SelectSymbol(0);
 
 bRet = true;


[Libreoffice-commits] core.git: starmath/source

2021-12-03 Thread Julien Nabet (via logerrit)
 starmath/source/cfgitem.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 33f3470474dd79a3a0eae1f6cb369e6400b58b6a
Author: Julien Nabet 
AuthorDate: Fri Dec 3 22:35:39 2021 +0100
Commit: Mike Kaganski 
CommitDate: Sat Dec 4 00:00:51 2021 +0100

Related tdf#132145: fix Print/Size NoSuchElementException


warn:unotools.config:1167538:1167538:unotools/source/config/configitem.cxx:423:
ignoring XHierarchicalNameAccess Print/Size: 
com.sun.star.container.NoSuchElementException
message: Print/Size: 
/home/julien/lo/libreoffice/configmgr/source/access.cxx:437

Regression from a5808c6446f6de536c44cf5bfba6566ad398fb8c
tdf#132145: Synchronize SmMathConfig with configuration

Change-Id: I472bd3dc2d4bf76700c2b9e1df9148737dfaa1f4
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/126335
Tested-by: Jenkins
Reviewed-by: Mike Kaganski 

diff --git a/starmath/source/cfgitem.cxx b/starmath/source/cfgitem.cxx
index efa994e2fa8a..a235446eb279 100644
--- a/starmath/source/cfgitem.cxx
+++ b/starmath/source/cfgitem.cxx
@@ -76,7 +76,7 @@ static Sequence lcl_GetOtherPropertyNames()
"Misc/SmEditWindowZoomFactor",
"Print/FormulaText",
"Print/Frame",
-   "Print/Size:",
+   "Print/Size",
"Print/Title",
"Print/ZoomFactor",
"View/AutoRedraw",


[Libreoffice-commits] core.git: starmath/source

2021-10-22 Thread Julien Nabet (via logerrit)
 starmath/source/smediteng.cxx |   12 ++--
 1 file changed, 6 insertions(+), 6 deletions(-)

New commits:
commit 25278dc22ff6949da442032ce2dad8638b1c8512
Author: Julien Nabet 
AuthorDate: Fri Oct 22 19:06:09 2021 +0200
Commit: Julien Nabet 
CommitDate: Fri Oct 22 20:25:16 2021 +0200

Typo: aFontHeigt->aFontHeight (starmath/smediteng.cxx)

Change-Id: I8ae578350e911c69eeabbb3af41aaf9801b4ffee
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/124073
Tested-by: Jenkins
Reviewed-by: Julien Nabet 

diff --git a/starmath/source/smediteng.cxx b/starmath/source/smediteng.cxx
index c7b33373bc4d..ca1592eb2add 100644
--- a/starmath/source/smediteng.cxx
+++ b/starmath/source/smediteng.cxx
@@ -143,14 +143,14 @@ void SmEditEngine::setSmItemPool(SfxItemPool* mpItemPool, 
const SvtLinguOptions&
 }
 
 // Set font heights
-SvxFontHeightItem aFontHeigt(
+SvxFontHeightItem aFontHeight(
 aDefaultDevice->LogicToPixel(Size(0, 11), 
MapMode(MapUnit::MapPoint)).Height(), 100,
 EE_CHAR_FONTHEIGHT);
-mpItemPool->SetPoolDefaultItem(aFontHeigt);
-aFontHeigt.SetWhich(EE_CHAR_FONTHEIGHT_CJK);
-mpItemPool->SetPoolDefaultItem(aFontHeigt);
-aFontHeigt.SetWhich(EE_CHAR_FONTHEIGHT_CTL);
-mpItemPool->SetPoolDefaultItem(aFontHeigt);
+mpItemPool->SetPoolDefaultItem(aFontHeight);
+aFontHeight.SetWhich(EE_CHAR_FONTHEIGHT_CJK);
+mpItemPool->SetPoolDefaultItem(aFontHeight);
+aFontHeight.SetWhich(EE_CHAR_FONTHEIGHT_CTL);
+mpItemPool->SetPoolDefaultItem(aFontHeight);
 }
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s 
cinkeys+=0=break: */


[Libreoffice-commits] core.git: starmath/source

2021-10-20 Thread Caolán McNamara (via logerrit)
 starmath/source/document.cxx |3 +--
 starmath/source/smmod.cxx|3 +--
 starmath/source/unomodel.cxx |3 +--
 3 files changed, 3 insertions(+), 6 deletions(-)

New commits:
commit 733623d6d4de6ed3441269e3ecf3ed86066735c2
Author: Caolán McNamara 
AuthorDate: Wed Oct 20 10:23:58 2021 +0100
Commit: Caolán McNamara 
CommitDate: Wed Oct 20 12:44:02 2021 +0200

combine these contiguous ranges

Change-Id: I5f2b4ae72599fb16d567b3500fd1a77811e708a0
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123881
Tested-by: Jenkins
Reviewed-by: Caolán McNamara 

diff --git a/starmath/source/document.cxx b/starmath/source/document.cxx
index b71cef3720b7..dde2dd1cfc6b 100644
--- a/starmath/source/document.cxx
+++ b/starmath/source/document.cxx
@@ -495,8 +495,7 @@ Printer* SmDocShell::GetPrt()
 auto pOptions = std::make_unique>(GetPool());
+SID_AUTO_CLOSE_BRACKETS, SID_SMEDITWINDOWZOOM>>(GetPool());
 SmModule *pp = SM_MOD();
 pp->GetConfig()->ConfigToItemSet(*pOptions);
 mpPrinter = VclPtr::Create(std::move(pOptions));
diff --git a/starmath/source/smmod.cxx b/starmath/source/smmod.cxx
index 2365e877e992..484c4af4a6dd 100644
--- a/starmath/source/smmod.cxx
+++ b/starmath/source/smmod.cxx
@@ -210,8 +210,7 @@ std::optional SmModule::CreateItemSet( 
sal_uInt16 nId )
 svl::Items< //TP_SMPRINT
 SID_PRINTTITLE, SID_PRINTZOOM,
 SID_NO_RIGHT_SPACES, SID_SAVE_ONLY_USED_SYMBOLS,
-SID_AUTO_CLOSE_BRACKETS, SID_AUTO_CLOSE_BRACKETS,
-SID_SMEDITWINDOWZOOM, SID_SMEDITWINDOWZOOM>);
+SID_AUTO_CLOSE_BRACKETS, SID_SMEDITWINDOWZOOM>);
 
 GetConfig()->ConfigToItemSet(*pRet);
 }
diff --git a/starmath/source/unomodel.cxx b/starmath/source/unomodel.cxx
index 1420a3244815..3a5b6805b420 100644
--- a/starmath/source/unomodel.cxx
+++ b/starmath/source/unomodel.cxx
@@ -609,8 +609,7 @@ void SmModel::_setPropertyValues(const PropertyMapEntry** 
ppEntries, const Any*
 SID_PRINTZOOM,   SID_PRINTZOOM,
 SID_NO_RIGHT_SPACES, SID_NO_RIGHT_SPACES,
 SID_SAVE_ONLY_USED_SYMBOLS, SID_SAVE_ONLY_USED_SYMBOLS,
-SID_AUTO_CLOSE_BRACKETS,SID_AUTO_CLOSE_BRACKETS,
-SID_SMEDITWINDOWZOOM,   SID_SMEDITWINDOWZOOM>> ( 
SmDocShell::GetPool() );
+SID_AUTO_CLOSE_BRACKETS,SID_SMEDITWINDOWZOOM>> ( 
SmDocShell::GetPool() );
 SmModule *pp = SM_MOD();
 pp->GetConfig()->ConfigToItemSet(*pItemSet);
 VclPtr pPrinter = SfxPrinter::Create ( aStream, 
std::move(pItemSet) );


[Libreoffice-commits] core.git: starmath/source

2021-10-20 Thread Caolán McNamara (via logerrit)
 starmath/source/document.cxx |3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

New commits:
commit 649e29e53f9a79d8695b31b9a848fba14d6b583d
Author: Caolán McNamara 
AuthorDate: Wed Oct 20 10:07:57 2021 +0100
Commit: Caolán McNamara 
CommitDate: Wed Oct 20 12:23:10 2021 +0200

assert in math, file, printer settings, options

probably since...

commit 1a0fd1c1342969e5b4d08d13764483cd8bada589
Date:   Fri May 14 13:46:41 2021 +0200

tdf#130654 editable smeditwindow zoom UI

Change-Id: Iead2fd9b5332a9cfead8d4e0d909746d6ed50db8
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123879
Tested-by: Jenkins
Reviewed-by: Caolán McNamara 

diff --git a/starmath/source/document.cxx b/starmath/source/document.cxx
index 72d9c218d021..b71cef3720b7 100644
--- a/starmath/source/document.cxx
+++ b/starmath/source/document.cxx
@@ -495,7 +495,8 @@ Printer* SmDocShell::GetPrt()
 auto pOptions = std::make_unique>(GetPool());
+SID_AUTO_CLOSE_BRACKETS, SID_AUTO_CLOSE_BRACKETS,
+SID_SMEDITWINDOWZOOM, SID_SMEDITWINDOWZOOM>>(GetPool());
 SmModule *pp = SM_MOD();
 pp->GetConfig()->ConfigToItemSet(*pOptions);
 mpPrinter = VclPtr::Create(std::move(pOptions));


[Libreoffice-commits] core.git: starmath/source

2021-09-16 Thread Stephan Bergmann (via logerrit)
 starmath/source/mathml/mathmlattr.cxx |   25 -
 1 file changed, 24 insertions(+), 1 deletion(-)

New commits:
commit 1d4adcee1ba82cb8f02ac73be3e558d10dea8eda
Author: Stephan Bergmann 
AuthorDate: Thu Sep 16 11:23:03 2021 +0200
Commit: Stephan Bergmann 
CommitDate: Thu Sep 16 13:00:40 2021 +0200

Increase accuracy of ParseMathMLUnsignedNumber Fraction result

The new test from d5e55d204b71710eb5eb5d2c683dd6698626df3c "tdf#144319:
sw_odfexport: Add unittest" started to cause UBSan failure during
CppunitTest_sw_odfexport (),

> /workdir/UnpackedTarball/boost/boost/rational.hpp:605:22: runtime error: 
signed integer overflow: 1073741824 * 2 cannot be represented in type 'int'
> #0 0x2b450983594f in 
boost::rational::operator/=(boost::rational const&) 
/workdir/UnpackedTarball/boost/boost/rational.hpp:605:22
> #1 0x2b450982e216 in Fraction::operator/=(Fraction const&) 
/tools/source/generic/fract.cxx:224:7
> #2 0x2b45098312d3 in operator/(Fraction const&, Fraction const&) 
/tools/source/generic/fract.cxx:320:10
> #3 0x2b46066963d5 in (anonymous 
namespace)::lcl_CountBlanks(MathMLAttributeLengthValue const&, int*, int*) 
/starmath/source/mathml/mathmlimport.cxx:1497:30
> #4 0x2b46066943eb in (anonymous 
namespace)::SmXMLSpaceContext_Impl::startFastElement(int, 
com::sun::star::uno::Reference 
const&) /starmath/source/mathml/mathmlimport.cxx:1526:25
[...]

Formula-14/content.xml in sw/qa/extras/odfexport/data/tdf144319.odt contains
width="0.444em", which resulted in the inaccurate Fraction 
476741369/1073741824
since 67d83e40e2c4f3862c50e6abeabfc24a75119fc8 "speedup rational_FromDouble"
(which computes dVal=4.76741e+08 and nDen=1073741824; where before that 
speedup
it computed dVal=4.44e+08 and nDen=10, which would have resulted in 
the
accurate Fraction 111/250).  The excessively large denominator (1073741824 =
std::numeric_limits::max()/2 + 1) then caused overflow later on, 
as
shown above.

Change-Id: I221549528e4fa155e10697d218ec76bf678e8b2f
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/122186
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann 

diff --git a/starmath/source/mathml/mathmlattr.cxx 
b/starmath/source/mathml/mathmlattr.cxx
index 008f8e2a81f6..7da7f947a8c6 100644
--- a/starmath/source/mathml/mathmlattr.cxx
+++ b/starmath/source/mathml/mathmlattr.cxx
@@ -9,6 +9,8 @@
 
 #include 
 
+#include 
+
 #include 
 
 static sal_Int32 ParseMathMLUnsignedNumber(const OUString& rStr, Fraction& rUN)
@@ -16,6 +18,9 @@ static sal_Int32 ParseMathMLUnsignedNumber(const OUString& 
rStr, Fraction& rUN)
 auto nLen = rStr.getLength();
 sal_Int32 nDecimalPoint = -1;
 sal_Int32 nIdx;
+sal_Int64 nom = 0;
+sal_Int64 den = 1;
+bool validNomDen = true;
 for (nIdx = 0; nIdx < nLen; nIdx++)
 {
 auto cD = rStr[nIdx];
@@ -28,11 +33,29 @@ static sal_Int32 ParseMathMLUnsignedNumber(const OUString& 
rStr, Fraction& rUN)
 }
 if (cD < u'0' || u'9' < cD)
 break;
+if (validNomDen
+&& (o3tl::checked_multiply(nom, sal_Int64(10), nom)
+|| o3tl::checked_add(nom, sal_Int64(cD - u'0'), nom)
+|| (nDecimalPoint >= 0 && o3tl::checked_multiply(den, 
sal_Int64(10), den
+{
+validNomDen = false;
+}
 }
 if (nIdx == 0 || (nIdx == 1 && nDecimalPoint == 0))
 return -1;
 
-rUN = Fraction(rStr.copy(0, nIdx).toDouble());
+// If the input "xx.yyy" can be represented with nom = xx*10^n + yyy and 
den = 10^n in sal_Int64
+// (where n is the length of "yyy"), then use that to create an accurate 
Fraction (and TODO: we
+// could even ignore trailing "0" characters in "yyy", for a smaller n and 
thus a greater chance
+// of validNomDen); if not, use the less accurate approach of creating a 
Fraction from double:
+if (validNomDen)
+{
+rUN = Fraction(nom, den);
+}
+else
+{
+rUN = Fraction(rStr.copy(0, nIdx).toDouble());
+}
 
 return nIdx;
 }


[Libreoffice-commits] core.git: starmath/source

2021-08-31 Thread Caolán McNamara (via logerrit)
 starmath/source/mathtype.cxx |2 ++
 1 file changed, 2 insertions(+)

New commits:
commit 4a65109b7ab3cafddad113900754260af2dbb4ea
Author: Caolán McNamara 
AuthorDate: Mon Aug 30 14:48:47 2021 +0100
Commit: Caolán McNamara 
CommitDate: Tue Aug 31 11:27:14 2021 +0200

ofz: MemorySanitizer: use-of-uninitialized-value

Change-Id: I9867737be62871aaa80a9ce0b51318afa62e8a67
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/121334
Tested-by: Jenkins
Reviewed-by: Caolán McNamara 

diff --git a/starmath/source/mathtype.cxx b/starmath/source/mathtype.cxx
index fde2defe51e5..d9306c2402df 100644
--- a/starmath/source/mathtype.cxx
+++ b/starmath/source/mathtype.cxx
@@ -2660,6 +2660,8 @@ bool MathType::HandleMatrix(int nLevel, sal_uInt8 
nSelector, sal_uInt8 nVariatio
 pS->ReadUChar( nV_just );
 pS->ReadUChar( nRows );
 pS->ReadUChar( nCols );
+if (!pS->good())
+return false;
 int nBytes = ((nRows+1)*2)/8;
 if (((nRows+1)*2)%8)
 nBytes++;


[Libreoffice-commits] core.git: starmath/source

2021-08-29 Thread Caolán McNamara (via logerrit)
 starmath/source/mathtype.cxx |4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

New commits:
commit 5ecc01990dbdd21501d49a1a5a66a2348d0e229b
Author: Caolán McNamara 
AuthorDate: Sat Aug 28 10:23:50 2021 +0100
Commit: Caolán McNamara 
CommitDate: Sun Aug 29 11:46:39 2021 +0200

ofz: MemorySanitizer: use-of-uninitialized-value

Change-Id: I35210b36a927b96f29d0a07a3cf63e226e4c4453
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/121191
Tested-by: Jenkins
Reviewed-by: Caolán McNamara 

diff --git a/starmath/source/mathtype.cxx b/starmath/source/mathtype.cxx
index acdeba5fcfb6..b32ad0c555ec 100644
--- a/starmath/source/mathtype.cxx
+++ b/starmath/source/mathtype.cxx
@@ -2815,8 +2815,8 @@ void MathType::HandleEmblishments()
 
 void MathType::HandleSetSize()
 {
-sal_uInt8 nTemp;
-pS->ReadUChar( nTemp );
+sal_uInt8 nTemp(0);
+pS->ReadUChar(nTemp);
 switch (nTemp)
 {
 case 101:


[Libreoffice-commits] core.git: starmath/source

2021-08-25 Thread Caolán McNamara (via logerrit)
 starmath/source/mathtype.cxx |7 +--
 1 file changed, 5 insertions(+), 2 deletions(-)

New commits:
commit 5f11e921fb878cc6fd6a15181a416e0143e389f7
Author: Caolán McNamara 
AuthorDate: Tue Aug 24 20:42:53 2021 +0100
Commit: Caolán McNamara 
CommitDate: Wed Aug 25 09:56:28 2021 +0200

ofz: MemorySanitizer: use-of-uninitialized-value

Change-Id: I15d68391e20fba3a8ba46621aac0c831cd0900b0
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/120964
Tested-by: Jenkins
Reviewed-by: Caolán McNamara 

diff --git a/starmath/source/mathtype.cxx b/starmath/source/mathtype.cxx
index cb46776cc618..acdeba5fcfb6 100644
--- a/starmath/source/mathtype.cxx
+++ b/starmath/source/mathtype.cxx
@@ -570,7 +570,7 @@ bool MathType::Parse(SvStream* pStream)
 pS->ReadUChar( nProdVersion );
 pS->ReadUChar( nProdSubVersion );
 
-if (nVersion > 3)   // allow only supported versions of MathType to be 
parsed
+if (!pS->good() || nVersion > 3)   // allow only supported versions of 
MathType to be parsed
 return false;
 
 bool bRet = HandleRecords(0);
@@ -637,7 +637,7 @@ bool MathType::HandleRecords(int nLevel, sal_uInt8 
nSelector,
 return false;
 
 sal_uInt8 nTag,nRecord;
-sal_uInt8 nTabType,nTabStops;
+sal_uInt8 nTabType;
 sal_uInt16 nTabOffset;
 int i, newline=0;
 bool bSilent=false;
@@ -1688,6 +1688,8 @@ bool MathType::HandleRecords(int nLevel, sal_uInt8 
nSelector,
 HandleEmblishments();
 break;
 case RULER:
+{
+sal_uInt8 nTabStops(0);
 pS->ReadUChar( nTabStops );
 for (i=0;i

[Libreoffice-commits] core.git: starmath/source

2021-08-20 Thread dante (via logerrit)
 starmath/source/mathml/iterator.cxx |4 
 1 file changed, 4 insertions(+)

New commits:
commit aa232a45bc0d5daf4a0ae4b47b9459000d1ec210
Author: dante 
AuthorDate: Fri Aug 20 04:08:37 2021 +0200
Commit: Noel Grandin 
CommitDate: Fri Aug 20 09:36:05 2021 +0200

Add security handlers to the iterators

Change-Id: I0cc8dd92c7ae870e58f0f9118df76569d6deecd8
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/120764
Tested-by: Jenkins
Reviewed-by: Noel Grandin 

diff --git a/starmath/source/mathml/iterator.cxx 
b/starmath/source/mathml/iterator.cxx
index 5e88a717f6c1..481ff799689c 100644
--- a/starmath/source/mathml/iterator.cxx
+++ b/starmath/source/mathml/iterator.cxx
@@ -54,11 +54,15 @@ static inline void cloneElement(SmMlElement* aSmMlElement, 
void* aData)
 
 void SmMlIteratorFree(SmMlElement* pMlElementTree)
 {
+if (pMlElementTree == nullptr)
+return;
 SmMlIteratorBottomToTop(pMlElementTree, deleteElement, nullptr);
 }
 
 SmMlElement* SmMlIteratorCopy(SmMlElement* pMlElementTree)
 {
+if (pMlElementTree == nullptr)
+return nullptr;
 SmMlElement* aDummyElement = new SmMlElement();
 SmMlIteratorTopToBottom(pMlElementTree, cloneElement, );
 SmMlElement* aResultElement = aDummyElement->getSubElement(0);


[Libreoffice-commits] core.git: starmath/source

2021-08-18 Thread Andrea Gelmini (via logerrit)
 starmath/source/mathml/import.cxx |4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

New commits:
commit 3ab570d8b3e208db966865357a4f8ecae2e0afc2
Author: Andrea Gelmini 
AuthorDate: Tue Aug 17 15:50:41 2021 +0200
Commit: Adolfo Jayme Barrientos 
CommitDate: Wed Aug 18 19:23:58 2021 +0200

Fix typo

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

diff --git a/starmath/source/mathml/import.cxx 
b/starmath/source/mathml/import.cxx
index e353f38ff72c..329205319a75 100644
--- a/starmath/source/mathml/import.cxx
+++ b/starmath/source/mathml/import.cxx
@@ -356,7 +356,7 @@ ErrCode SmMLImportWrapper::ReadThroughComponent(const 
Reference 
const& rPropSet,
 const char16_t* pFilterName, 
bool bEncrypted)
 {
-// Needs an iunput stream but checked by caller
+// Needs an input stream but checked by caller
 // Needs a context but checked by caller
 // Needs property set but checked by caller
 // Needs a filter name but checked by caller
@@ -1335,7 +1335,7 @@ void SmMLImport::SetConfigurationSettings(const 
Sequence& aConfPr
 }
 catch (const Exception&)
 {
-SAL_WARN("starmath", "Unespected issue while loading document 
properties");
+SAL_WARN("starmath", "Unexpected issue while loading document 
properties");
 }
 }
 }


[Libreoffice-commits] core.git: starmath/source

2021-08-18 Thread Stephan Bergmann (via logerrit)
 starmath/source/mathml/import.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 4ef25107c144ea05ded1d797bf4d93f2d7044e14
Author: Stephan Bergmann 
AuthorDate: Wed Aug 18 13:25:56 2021 +0200
Commit: Stephan Bergmann 
CommitDate: Wed Aug 18 16:27:19 2021 +0200

Don't use std::ostream operator <<(char16_t const *) deleted in C++20

similar to 4af56d8189012f96d0471d7f50a3e4463516 "Don't use std::ostream
operator <<(char16_t const *) deleted in C++20"

Change-Id: Ica7b02c14b66fea64f630bed4943c04ae999485e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/120662
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann 

diff --git a/starmath/source/mathml/import.cxx 
b/starmath/source/mathml/import.cxx
index f1987d370971..e353f38ff72c 100644
--- a/starmath/source/mathml/import.cxx
+++ b/starmath/source/mathml/import.cxx
@@ -375,7 +375,7 @@ ErrCode SmMLImportWrapper::ReadThroughComponent(const 
Reference

[Libreoffice-commits] core.git: starmath/source

2021-08-17 Thread Andrea Gelmini (via logerrit)
 starmath/source/mathml/import.cxx |1 -
 1 file changed, 1 deletion(-)

New commits:
commit af1b2ea5a6d49ddeb376e83f8ca7d053b17afa20
Author: Andrea Gelmini 
AuthorDate: Tue Aug 17 15:43:02 2021 +0200
Commit: Andrea Gelmini 
CommitDate: Tue Aug 17 23:43:27 2021 +0200

Removed duplicated include

Change-Id: I4103d44e0535b39555f2f62e36ce6109e39cabfb
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/120595
Reviewed-by: Julien Nabet 
Tested-by: Jenkins

diff --git a/starmath/source/mathml/import.cxx 
b/starmath/source/mathml/import.cxx
index 4d0da69c559d..f1987d370971 100644
--- a/starmath/source/mathml/import.cxx
+++ b/starmath/source/mathml/import.cxx
@@ -37,7 +37,6 @@
 #include 
 #include 
 #include 
-#include 
 #include 
 #include 
 #include 


[Libreoffice-commits] core.git: starmath/source

2021-08-17 Thread dante (via logerrit)
 starmath/source/mathml/export.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 50f4d711337b84baf22536fac99150c116b0c700
Author: dante 
AuthorDate: Mon Aug 16 16:48:28 2021 +0200
Commit: Noel Grandin 
CommitDate: Tue Aug 17 18:29:16 2021 +0200

Improvement to ml element exporter

Change-Id: I12303add11406c0ab65ca02084945989f41380d8
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/120549
Tested-by: Jenkins
Reviewed-by: Noel Grandin 

diff --git a/starmath/source/mathml/export.cxx 
b/starmath/source/mathml/export.cxx
index e701f017d7e9..57d9626a239c 100644
--- a/starmath/source/mathml/export.cxx
+++ b/starmath/source/mathml/export.cxx
@@ -904,7 +904,7 @@ void SmMlExport::exportMlAttributtes(const SmMlElement* 
pMlElement)
 {
 case SmMlAttributeValueMaxsize::MlInfinity:
 {
-addAttribute(XML_MAXSIZE, OUString(u"infinity"));
+addAttribute(XML_MAXSIZE, XML_INFINITY);
 break;
 }
 case SmMlAttributeValueMaxsize::MlFinite:


[Libreoffice-commits] core.git: starmath/source

2021-08-17 Thread Andrea Gelmini (via logerrit)
 starmath/source/mathml/import.cxx |6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

New commits:
commit da9fc526f3bc84443ae37666d6775c5119b3f1e8
Author: Andrea Gelmini 
AuthorDate: Tue Aug 17 15:58:00 2021 +0200
Commit: Julien Nabet 
CommitDate: Tue Aug 17 17:36:53 2021 +0200

Fix typo

Change-Id: I28ef5ac72fb06406d049e1076f48dcd2d06a42af
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/120600
Tested-by: Julien Nabet 
Reviewed-by: Julien Nabet 

diff --git a/starmath/source/mathml/import.cxx 
b/starmath/source/mathml/import.cxx
index 39b81b9aaed9..4d0da69c559d 100644
--- a/starmath/source/mathml/import.cxx
+++ b/starmath/source/mathml/import.cxx
@@ -200,7 +200,7 @@ ErrCode SmMLImportWrapper::Import(SfxMedium& rMedium)
  bOASIS ? 
u"com.sun.star.comp.Math.MLOasisMetaImporter"
 : 
u"com.sun.star.comp.Math.MLMetaImporter");
 
-// Check if succefull
+// Check if successful
 if (nWarn != ERRCODE_NONE)
 {
 if (xStatusIndicator.is())
@@ -220,7 +220,7 @@ ErrCode SmMLImportWrapper::Import(SfxMedium& rMedium)
  bOASIS ? 
u"com.sun.star.comp.Math.MLOasisSettingsImporter"
 : 
u"com.sun.star.comp.Math.MLSettingsImporter");
 
-// Check if succefull
+// Check if successful
 if (nWarn != ERRCODE_NONE)
 {
 if (xStatusIndicator.is())
@@ -237,7 +237,7 @@ ErrCode SmMLImportWrapper::Import(SfxMedium& rMedium)
 // read a component from storage
 nWarn = ReadThroughComponent(rMedium.GetStorage(), xModelComp, 
u"content.xml", xContext,
  xInfoSet, 
u"com.sun.star.comp.Math.MLImporter");
-// Check if succefull
+// Check if successful
 if (nWarn != ERRCODE_NONE)
 {
 if (xStatusIndicator.is())


[Libreoffice-commits] core.git: starmath/source

2021-08-13 Thread dante (via logerrit)
 starmath/source/unomodel.cxx |8 
 1 file changed, 8 insertions(+)

New commits:
commit d3ff1aa10839be41a419d5a1004a50915182d163
Author: dante 
AuthorDate: Tue Aug 10 14:24:53 2021 +0200
Commit: Noel Grandin 
CommitDate: Fri Aug 13 15:43:56 2021 +0200

Include the starmath version inside the configuration

Change-Id: I4492fad6eb498e0c8c9a53b2096f538f2916d843
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/120271
Tested-by: Jenkins
Reviewed-by: Noel Grandin 

diff --git a/starmath/source/unomodel.cxx b/starmath/source/unomodel.cxx
index 1a5cecbabe3e..5c49c8b52a64 100644
--- a/starmath/source/unomodel.cxx
+++ b/starmath/source/unomodel.cxx
@@ -224,6 +224,7 @@ enum SmModelPropertyHandles
 HANDLE_DIALOG_LIBRARIES,  // #i73329#
 HANDLE_BASELINE,
 HANDLE_INTEROP_GRAB_BAG,
+HANDLE_STARMATH_VERSION
 };
 
 }
@@ -301,6 +302,7 @@ static rtl::Reference 
lcl_createModelPropertyInfo ()
 // #i972#
 { OUString("BaseLine") , HANDLE_BASELINE   
,  ::cppu::UnoType::get(),   
  PROPERTY_NONE,  0 },
 { OUString("InteropGrabBag")   , 
HANDLE_INTEROP_GRAB_BAG   ,  cppu::UnoType>::get(),   PROPERTY_NONE,  0 
},
+{ OUString("SyntaxVersion"), 
HANDLE_STARMATH_VERSION   ,  ::cppu::UnoType::get(), 
PROPERTY_NONE,  0 },
 { OUString(), 0, css::uno::Type(), 0, 0 }
 };
 return rtl::Reference( new PropertySetInfo ( 
aModelPropertyInfoMap ) );
@@ -667,6 +669,9 @@ void SmModel::_setPropertyValues(const PropertyMapEntry** 
ppEntries, const Any*
 pDocSh->SetUseThumbnailSave(bThumbnail);
 }
 break;
+case HANDLE_STARMATH_VERSION:
+pDocSh->SetSmSyntaxVersion(pValues->get());
+break;
 }
 }
 
@@ -885,6 +890,9 @@ void SmModel::_getPropertyValues( const PropertyMapEntry 
**ppEntries, Any *pValu
 *pValue <<= pDocSh->IsUseThumbnailSave();
 }
 break;
+case HANDLE_STARMATH_VERSION:
+*pValue <<= pDocSh->GetSmSyntaxVersion();
+break;
 }
 }
 }


[Libreoffice-commits] core.git: starmath/source

2021-05-06 Thread Caolán McNamara (via logerrit)
 starmath/source/edit.cxx |1 +
 1 file changed, 1 insertion(+)

New commits:
commit 7dc277c97491887c7f6cf2bb24e55596740ba7b5
Author: Caolán McNamara 
AuthorDate: Thu May 6 17:27:53 2021 +0100
Commit: Caolán McNamara 
CommitDate: Thu May 6 21:02:52 2021 +0200

release mouse before showing context menu

otherwise math loses focus due to the mouse release

Change-Id: Ie50cfde6a9f13d87efba2f6ec4830b9730f6e938
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/115186
Tested-by: Jenkins
Reviewed-by: Caolán McNamara 

diff --git a/starmath/source/edit.cxx b/starmath/source/edit.cxx
index 42687f48f9ce..2a23122d395a 100644
--- a/starmath/source/edit.cxx
+++ b/starmath/source/edit.cxx
@@ -304,6 +304,7 @@ bool SmEditTextWindow::Command(const CommandEvent& rCEvt)
 {
 // purely for "ExecutePopup" taking a vcl::Window and
 // we assume SmEditTextWindow 0,0 is at SmEditWindow 0,0
+ReleaseMouse();
 mrEditWindow.Command(rCEvt);
 return true;
 }
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: starmath/source

2021-05-04 Thread Caolán McNamara (via logerrit)
 starmath/source/edit.cxx |4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

New commits:
commit 9fed7b07af44792012028eb57900640a5ee833cb
Author: Caolán McNamara 
AuthorDate: Tue May 4 09:15:25 2021 +0100
Commit: Caolán McNamara 
CommitDate: Tue May 4 11:36:40 2021 +0200

tdf#141930 document set as unmodified if editengine didn't modify on 
keyevent

this appears to have always happened for cursor keys, and since

commit 0154f04e8c64df937b793c73ac58d553637f324f
Author: Caolán McNamara 
Date:   Wed Feb 24 14:32:21 2021 +

Resolves: rhbz#1931423 start update timer in IM events as well as 
keyevents

also happens on Input Engine events which don't cause changes

Change-Id: Ic5cdd9ef4f1bed1cc2b2c17fc847f196a9c6e23a
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/115055
Tested-by: Jenkins
Reviewed-by: Caolán McNamara 

diff --git a/starmath/source/edit.cxx b/starmath/source/edit.cxx
index 5287eeca9664..42687f48f9ce 100644
--- a/starmath/source/edit.cxx
+++ b/starmath/source/edit.cxx
@@ -431,8 +431,8 @@ void SmEditTextWindow::UserPossiblyChangedText()
 // cursor travelling and such things...
 SmDocShell *pDocShell = mrEditWindow.GetDoc();
 EditEngine *pEditEngine = GetEditEngine();
-if (pDocShell && pEditEngine)
-pDocShell->SetModified(pEditEngine->IsModified());
+if (pDocShell && pEditEngine && pEditEngine->IsModified())
+pDocShell->SetModified(true);
 aModifyIdle.Start();
 }
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: starmath/source

2021-04-23 Thread Caolán McNamara (via logerrit)
 starmath/source/edit.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 031876e3287828e9a7077db3c37cce801c8f3d93
Author: Caolán McNamara 
AuthorDate: Fri Apr 23 13:40:40 2021 +0100
Commit: Caolán McNamara 
CommitDate: Fri Apr 23 20:43:27 2021 +0200

consume context menu event

Change-Id: Ic7d819775f59b7303dea1a381a20ca3ea1ac8d48
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/114550
Tested-by: Jenkins
Reviewed-by: Caolán McNamara 

diff --git a/starmath/source/edit.cxx b/starmath/source/edit.cxx
index 2aa3c31d5d7b..26359d774682 100644
--- a/starmath/source/edit.cxx
+++ b/starmath/source/edit.cxx
@@ -340,7 +340,7 @@ bool SmEditTextWindow::Command(const CommandEvent& rCEvt)
 // purely for "ExecutePopup" taking a vcl::Window and
 // we assume SmEditTextWindow 0,0 is at SmEditWindow 0,0
 mrEditWindow.Command(rCEvt);
-return false;
+return true;
 }
 
 bool bConsumed = WeldEditView::Command(rCEvt);
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: starmath/source

2021-04-23 Thread Caolán McNamara (via logerrit)
 starmath/source/view.cxx |2 ++
 1 file changed, 2 insertions(+)

New commits:
commit f7787bbea5a8d469e20102af77115f70885dd605
Author: Caolán McNamara 
AuthorDate: Fri Apr 23 15:00:39 2021 +0100
Commit: Caolán McNamara 
CommitDate: Fri Apr 23 18:19:48 2021 +0200

cid#1477316 Uninitialized scalar field

Change-Id: I11ad5375e5fee35065bb855fb0db0b0c00d75fd0
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/114554
Tested-by: Jenkins
Reviewed-by: Caolán McNamara 

diff --git a/starmath/source/view.cxx b/starmath/source/view.cxx
index e36596316386..7a1a8e91465e 100644
--- a/starmath/source/view.cxx
+++ b/starmath/source/view.cxx
@@ -284,6 +284,8 @@ void SmGraphicWindow::ShowContextMenu(const CommandEvent& 
rCEvt)
 
 SmGraphicWidget::SmGraphicWidget(SmViewShell& rShell, SmGraphicWindow& 
rGraphicWindow)
 : mrGraphicWindow(rGraphicWindow)
+, bIsCursorVisible(false)
+, bIsLineVisible(false)
 , mrViewShell(rShell)
 {
 }
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: starmath/source

2021-04-23 Thread Caolán McNamara (via logerrit)
 starmath/source/view.cxx |3 +++
 1 file changed, 3 insertions(+)

New commits:
commit cd7a62a260b2006ea837393b8f0900d336494ce2
Author: Caolán McNamara 
AuthorDate: Thu Apr 22 16:38:35 2021 +0100
Commit: Caolán McNamara 
CommitDate: Fri Apr 23 09:49:07 2021 +0200

designate which widget to get default focus

Change-Id: Ie5968b80583f8c560b145463a60e2e86992fdb96
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/114513
Tested-by: Jenkins
Reviewed-by: Caolán McNamara 

diff --git a/starmath/source/view.cxx b/starmath/source/view.cxx
index a007d1d4ff0b..e36596316386 100644
--- a/starmath/source/view.cxx
+++ b/starmath/source/view.cxx
@@ -100,6 +100,8 @@ SmGraphicWindow::SmGraphicWindow(SmViewShell& rShell)
 , mxGraphic(new SmGraphicWidget(rShell, *this))
 , mxGraphicWin(new weld::CustomWeld(*m_xBuilder, "mathview", *mxGraphic))
 {
+InitControlBase(mxGraphic->GetDrawingArea());
+
 nColumnPixW = nLinePixH = 
GetSettings().GetStyleSettings().GetScrollBarSize();
 
 mxScrolledWindow->connect_hadjustment_changed(LINK(this, SmGraphicWindow, 
ScrollHdl));
@@ -112,6 +114,7 @@ SmGraphicWindow::SmGraphicWindow(SmViewShell& rShell)
 
 void SmGraphicWindow::dispose()
 {
+InitControlBase(nullptr);
 mxGraphicWin.reset();
 mxGraphic.reset();
 mxScrolledWindow.reset();
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: starmath/source

2021-04-21 Thread Caolán McNamara (via logerrit)
 starmath/source/ElementsDockingWindow.cxx |4 
 1 file changed, 4 insertions(+)

New commits:
commit 30b36f290aa0b59fd7d2bd41c8bdfca304d859af
Author: Caolán McNamara 
AuthorDate: Wed Apr 21 17:09:59 2021 +0100
Commit: Caolán McNamara 
CommitDate: Wed Apr 21 20:45:01 2021 +0200

Related: tdf#140659 on control get/lose focus call update custom a11y

Change-Id: Iab7df2c657da3386dc38db8a9d6427c60d8c1cc5
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/114449
Tested-by: Jenkins
Reviewed-by: Caolán McNamara 

diff --git a/starmath/source/ElementsDockingWindow.cxx 
b/starmath/source/ElementsDockingWindow.cxx
index aef1d2598d60..29d4aef5a646 100644
--- a/starmath/source/ElementsDockingWindow.cxx
+++ b/starmath/source/ElementsDockingWindow.cxx
@@ -651,10 +651,14 @@ void SmElementsControl::GetFocus()
 {
 CustomWidgetController::GetFocus();
 Invalidate();
+if (m_xAccessible.is() && m_nCurrentElement != SAL_MAX_UINT16)
+m_xAccessible->AcquireFocus();
 }
 
 void SmElementsControl::LoseFocus()
 {
+if (m_xAccessible.is() && m_nCurrentElement != SAL_MAX_UINT16)
+m_xAccessible->ReleaseFocus(m_nCurrentElement);
 CustomWidgetController::LoseFocus();
 Invalidate();
 }
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: starmath/source

2021-04-21 Thread Caolán McNamara (via logerrit)
 starmath/source/ElementsDockingWindow.cxx |8 +++-
 1 file changed, 3 insertions(+), 5 deletions(-)

New commits:
commit 12ea51ba8bfbc1d22feb2e4d498360eec015859e
Author: Caolán McNamara 
AuthorDate: Wed Apr 21 16:57:32 2021 +0100
Commit: Caolán McNamara 
CommitDate: Wed Apr 21 20:43:46 2021 +0200

Related: tdf#140659 off by one indexes because scrollbar is now outside

and not inside the control so it doesn't need to be accounted for
as a child

Change-Id: I77b55ec8d9b515850817417664df8944b4e44204
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/114448
Tested-by: Jenkins
Reviewed-by: Caolán McNamara 

diff --git a/starmath/source/ElementsDockingWindow.cxx 
b/starmath/source/ElementsDockingWindow.cxx
index 5c43b4f7f8bb..aef1d2598d60 100644
--- a/starmath/source/ElementsDockingWindow.cxx
+++ b/starmath/source/ElementsDockingWindow.cxx
@@ -285,7 +285,7 @@ 
SmElementsControl::SmElementsControl(std::unique_ptr xScro
 : mpDocShell(new SmDocShell(SfxModelFlags::EMBEDDED_OBJECT))
 , m_nCurrentElement(SAL_MAX_UINT16)
 , m_nCurrentRolloverElement(SAL_MAX_UINT16)
-, m_nCurrentOffset(1) // Default offset of 1 due to the ScrollBar child
+, m_nCurrentOffset(0)
 , m_nSmSyntaxVersion(SM_MOD()->GetConfig()->GetDefaultSmSyntaxVersion())
 , mbVerticalMode(true)
 , mxScroll(std::move(xScrolledWindow))
@@ -1014,7 +1014,7 @@ void SmElementsControl::addElements(const SmElementDescr 
aElementsArray[], sal_u
 void SmElementsControl::build()
 {
 // The order is important!
-// 1. Ensure there are no items left, including the default scrollbar!
+// 1. Ensure there are no items left
 // 2. Release all the current accessible items.
 //This will check for new items after releasing them!
 // 3. Set the cursor element
@@ -1029,9 +1029,7 @@ void SmElementsControl::build()
 
 setCurrentElement(SAL_MAX_UINT16);
 
-// The first element is the scrollbar. We can't change its indexInParent
-// value, as this is set by being a child of the SmElementsControl.
-m_nCurrentOffset = 1;
+m_nCurrentOffset = 0;
 
 switch(m_nSmSyntaxVersion)
 {
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: starmath/source

2021-04-21 Thread Caolán McNamara (via logerrit)
 starmath/source/edit.cxx |5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

New commits:
commit 3902cfcd14cc66ee52b6d5bca7621bf30d6f4095
Author: Caolán McNamara 
AuthorDate: Wed Apr 21 11:23:04 2021 +0100
Commit: Caolán McNamara 
CommitDate: Wed Apr 21 15:52:07 2021 +0200

cid#1476301 Dereference null return value

Change-Id: I7dff59f18fdf08389e7f279001627da4e5e3baeb
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/114392
Tested-by: Jenkins
Reviewed-by: Caolán McNamara 

diff --git a/starmath/source/edit.cxx b/starmath/source/edit.cxx
index a02ad7436500..4c3549ec8d62 100644
--- a/starmath/source/edit.cxx
+++ b/starmath/source/edit.cxx
@@ -784,8 +784,9 @@ void SmEditTextWindow::UpdateStatus(bool bSetDocModified)
 SmModule *pMod = SM_MOD();
 if (pMod && pMod->GetConfig()->IsAutoRedraw())
 Flush();
-if ( bSetDocModified )
-mrEditWindow.GetDoc()->SetModified();
+SmDocShell* pDoc = bSetDocModified ? mrEditWindow.GetDoc() : nullptr;
+if (pDoc)
+pDoc->SetModified();
 }
 
 void SmEditWindow::Cut()
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: starmath/source vcl/source vcl/unx

2021-04-21 Thread Noel Grandin (via logerrit)
 starmath/source/dialog.cxx|3 +--
 vcl/source/control/fmtfield.cxx   |6 ++
 vcl/source/treelist/imap2.cxx |6 ++
 vcl/unx/generic/printer/ppdparser.cxx |9 +++--
 4 files changed, 8 insertions(+), 16 deletions(-)

New commits:
commit 69e385ec0240d0c44caa5a4ea0195e06007cd588
Author: Noel Grandin 
AuthorDate: Wed Apr 21 12:28:54 2021 +0200
Commit: Noel Grandin 
CommitDate: Wed Apr 21 14:11:57 2021 +0200

simplify stripStart/End pairs into a single strip call

Change-Id: I32b1b7d944a4ec49d7daa5b8fa9371b059380062
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/114393
Tested-by: Noel Grandin 
Reviewed-by: Noel Grandin 

diff --git a/starmath/source/dialog.cxx b/starmath/source/dialog.cxx
index fc722e252bce..523f2fa89d7f 100644
--- a/starmath/source/dialog.cxx
+++ b/starmath/source/dialog.cxx
@@ -1813,8 +1813,7 @@ bool SmSymDefineDialog::SelectSymbolSet(weld::ComboBox& 
rComboBox,
 assert(( == m_xOldSymbolSets.get() ||  == 
m_xSymbolSets.get()) && "Sm : wrong ComboBox");
 
 // trim SymbolName (no leading and trailing blanks)
-OUString aNormName = comphelper::string::stripStart(rSymbolSetName, ' ');
-aNormName = comphelper::string::stripEnd(aNormName, ' ');
+OUString aNormName = comphelper::string::strip(rSymbolSetName, ' ');
 // and remove possible deviations within the input
 rComboBox.set_entry_text(aNormName);
 
diff --git a/vcl/source/control/fmtfield.cxx b/vcl/source/control/fmtfield.cxx
index 2910c7e02604..cb55d2ce158a 100644
--- a/vcl/source/control/fmtfield.cxx
+++ b/vcl/source/control/fmtfield.cxx
@@ -1114,8 +1114,7 @@ void DoubleCurrencyField::UpdateCurrencyFormat()
 if (getPrependCurrSym())
 {
 OUString sSymbol = getCurrencySymbol();
-sSymbol = comphelper::string::stripStart(sSymbol, ' ');
-sSymbol = comphelper::string::stripEnd(sSymbol, ' ');
+sSymbol = comphelper::string::strip(sSymbol, ' ');
 
 OUStringBuffer sTemp("[$");
 sTemp.append(sSymbol);
@@ -1136,8 +1135,7 @@ void DoubleCurrencyField::UpdateCurrencyFormat()
 else
 {
 OUString sTemp = getCurrencySymbol();
-sTemp = comphelper::string::stripStart(sTemp, ' ');
-sTemp = comphelper::string::stripEnd(sTemp, ' ');
+sTemp = comphelper::string::strip(sTemp, ' ');
 
 sNewFormat.append(" [$");
 sNewFormat.append(sTemp);
diff --git a/vcl/source/treelist/imap2.cxx b/vcl/source/treelist/imap2.cxx
index 4c55f67cde31..889b2c061d92 100644
--- a/vcl/source/treelist/imap2.cxx
+++ b/vcl/source/treelist/imap2.cxx
@@ -358,10 +358,8 @@ OUString ImageMap::ImpReadCERNURL( const char** ppStr )
 {
 OUString aStr(OUString::createFromAscii(*ppStr));
 
-aStr = comphelper::string::stripStart(aStr, ' ');
-aStr = comphelper::string::stripStart(aStr, '\t');
-aStr = comphelper::string::stripEnd(aStr, ' ');
-aStr = comphelper::string::stripEnd(aStr, '\t');
+aStr = comphelper::string::strip(aStr, ' ');
+aStr = comphelper::string::strip(aStr, '\t');
 
 return INetURLObject::GetAbsURL( "", aStr );
 }
diff --git a/vcl/unx/generic/printer/ppdparser.cxx 
b/vcl/unx/generic/printer/ppdparser.cxx
index 7b29c876a8c3..75abab8bc728 100644
--- a/vcl/unx/generic/printer/ppdparser.cxx
+++ b/vcl/unx/generic/printer/ppdparser.cxx
@@ -720,14 +720,11 @@ PPDParser::PPDParser( const OUString& rFile ) :
 if (aCurLine.matchIgnoreAsciiCase("*include:"))
 {
 aCurLine = aCurLine.copy(9);
-aCurLine = comphelper::string::stripStart(aCurLine, ' ');
-aCurLine = comphelper::string::stripEnd(aCurLine, ' ');
-aCurLine = comphelper::string::stripStart(aCurLine, '\t');
-aCurLine = comphelper::string::stripEnd(aCurLine, '\t');
+aCurLine = comphelper::string::strip(aCurLine, ' ');
+aCurLine = comphelper::string::strip(aCurLine, '\t');
 aCurLine = comphelper::string::stripEnd(aCurLine, '\r');
 aCurLine = comphelper::string::stripEnd(aCurLine, '\n');
-aCurLine = comphelper::string::stripStart(aCurLine, '"');
-aCurLine = comphelper::string::stripEnd(aCurLine, '"');
+aCurLine = comphelper::string::strip(aCurLine, '"');
 aStream.Close();
 aStream.Open(getPPDFile(OStringToOUString(aCurLine, 
m_aFileEncoding)));
 continue;
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: starmath/source

2021-03-15 Thread dante (via logerrit)
 starmath/source/mathml/starmathdatabase.cxx |4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

New commits:
commit 9b9d4da7c688b884c428cda6900415fe891f88c2
Author: dante 
AuthorDate: Sun Mar 14 16:55:24 2021 +0100
Commit: Noel Grandin 
CommitDate: Mon Mar 15 07:31:26 2021 +0100

Correct text command on mathml import

Change-Id: Ie3c2433606d1994feaa349b7664fd7b3d07ffcd5
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/112475
Tested-by: Jenkins
Reviewed-by: Noel Grandin 

diff --git a/starmath/source/mathml/starmathdatabase.cxx 
b/starmath/source/mathml/starmathdatabase.cxx
index d2c54931..9a45ff0edacf 100644
--- a/starmath/source/mathml/starmathdatabase.cxx
+++ b/starmath/source/mathml/starmathdatabase.cxx
@@ -91,9 +91,9 @@ SmToken 
starmathdatabase::Identify_SmXMLOperatorContext_Impl(sal_Unicode cChar,
 return SmToken(TSLASH, MS_SLASH, "slash", TG::Product, 0);
 case MS_BACKSLASH:
 if (bIsStretchy)
-return SmToken(TWIDEBACKSLASH, MS_BACKSLASH, "bslash", 
TG::Product, 0);
+return SmToken(TWIDEBACKSLASH, MS_BACKSLASH, "widebslash", 
TG::Product, 0);
 else
-return SmToken(TBACKSLASH, MS_BACKSLASH, "slash", TG::Product, 
0);
+return SmToken(TBACKSLASH, MS_BACKSLASH, "bslash", 
TG::Product, 0);
 case MS_DEF:
 return SmToken(TDEF, MS_DEF, "def", TG::Relation, 0);
 case MS_LINE:
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: starmath/source

2021-03-06 Thread dante (via logerrit)
 starmath/source/parse.cxx |4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

New commits:
commit 1b64713b6cbcc2bf748b199e0c97dfd6d2f262ec
Author: dante 
AuthorDate: Fri Mar 5 11:29:22 2021 +0100
Commit: Noel Grandin 
CommitDate: Sat Mar 6 13:10:04 2021 +0100

SmParser obtainer, correct error on exception message

Change-Id: Ia2c0bad7546e5a4288ce70cf2a72e400ff722a94
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/112001
Tested-by: Jenkins
Reviewed-by: Noel Grandin 

diff --git a/starmath/source/parse.cxx b/starmath/source/parse.cxx
index 3ea272faef6b..45cb75d9a942 100644
--- a/starmath/source/parse.cxx
+++ b/starmath/source/parse.cxx
@@ -31,7 +31,7 @@ AbstractSmParser* starmathdatabase::GetDefaultSmParser()
 return aParser;
 }
 default:
-throw std::range_error("parser depth limit");
+throw std::range_error("parser version limit");
 }
 }
 
@@ -45,7 +45,7 @@ AbstractSmParser* 
starmathdatabase::GetVersionSmParser(sal_uInt16 nVersion)
 return aParser;
 }
 default:
-throw std::range_error("parser depth limit");
+throw std::range_error("parser version limit");
 }
 }
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: starmath/source

2021-02-20 Thread Caolán McNamara (via logerrit)
 starmath/source/cfgitem.cxx |8 +++-
 starmath/source/parse.cxx   |3 +--
 2 files changed, 8 insertions(+), 3 deletions(-)

New commits:
commit aac0412d549ec6a2763a2beee1fdb24b501c6982
Author: Caolán McNamara 
AuthorDate: Sat Feb 20 19:51:32 2021 +
Commit: Caolán McNamara 
CommitDate: Sat Feb 20 21:52:59 2021 +0100

ofz#31177 avoid config layer for fuzzing

Change-Id: Id476c3075ed20e97e93ea58813007941bd090027
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111263
Tested-by: Jenkins
Reviewed-by: Caolán McNamara 

diff --git a/starmath/source/cfgitem.cxx b/starmath/source/cfgitem.cxx
index 34dbdebba656..8b9739ac14b9 100644
--- a/starmath/source/cfgitem.cxx
+++ b/starmath/source/cfgitem.cxx
@@ -26,6 +26,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -138,12 +139,13 @@ struct SmCfgOther
 SmCfgOther();
 };
 
+constexpr sal_uInt16 nDefaultSmSyntaxVersion(5);
 
 SmCfgOther::SmCfgOther()
 : ePrintSize(PRINT_SIZE_NORMAL)
 , nPrintZoomFactor(100)
 // Defaulted as 5 so I have time to code the parser 6
-, nSmSyntaxVersion(5)
+, nSmSyntaxVersion(nDefaultSmSyntaxVersion)
 , bPrintTitle(true)
 , bPrintFormulaText(true)
 , bPrintFrame(true)
@@ -1117,6 +1119,8 @@ bool SmMathConfig::IsAutoCloseBrackets() const
 
 sal_uInt16 SmMathConfig::GetDefaultSmSyntaxVersion() const
 {
+if (utl::ConfigManager::IsFuzzing())
+return nDefaultSmSyntaxVersion;
 if (!pOther)
 const_cast(this)->LoadOther();
 return pOther->nSmSyntaxVersion;
@@ -1166,6 +1170,8 @@ void SmMathConfig::SetDefaultSmSyntaxVersion( sal_uInt16 
nVal )
 
 bool SmMathConfig::IsIgnoreSpacesRight() const
 {
+if (utl::ConfigManager::IsFuzzing())
+return false;
 if (!pOther)
 const_cast(this)->LoadOther();
 return pOther->bIgnoreSpacesRight;
diff --git a/starmath/source/parse.cxx b/starmath/source/parse.cxx
index 3a9ad138e409..1de0a0518eef 100644
--- a/starmath/source/parse.cxx
+++ b/starmath/source/parse.cxx
@@ -23,7 +23,6 @@
 #include 
 #include 
 #include 
-#include 
 #include 
 #include 
 #include 
@@ -1570,7 +1569,7 @@ std::unique_ptr SmParser::DoBlank()
 
 // Ignore trailing spaces, if corresponding option is set
 if ( m_aCurToken.eType == TNEWLINE ||
- (m_aCurToken.eType == TEND && !utl::ConfigManager::IsFuzzing() && 
SM_MOD()->GetConfig()->IsIgnoreSpacesRight()) )
+ (m_aCurToken.eType == TEND && 
SM_MOD()->GetConfig()->IsIgnoreSpacesRight()) )
 {
 pBlankNode->Clear();
 }
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: starmath/source

2021-02-20 Thread Noel (via logerrit)
 starmath/source/AccessibleSmElement.cxx |   10 --
 starmath/source/AccessibleSmElementsControl.cxx |9 -
 starmath/source/accessibility.cxx   |   14 +-
 3 files changed, 13 insertions(+), 20 deletions(-)

New commits:
commit 7c992bd895574eb1faf473875f8e655e9b73cb79
Author: Noel 
AuthorDate: Sat Feb 20 12:49:48 2021 +0200
Commit: Noel Grandin 
CommitDate: Sat Feb 20 19:21:34 2021 +0100

loplugin:refcounting in starmath

Change-Id: I165272a8f7bd514b60719db360a2a19236b6658a
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111260
Tested-by: Jenkins
Reviewed-by: Noel Grandin 

diff --git a/starmath/source/AccessibleSmElement.cxx 
b/starmath/source/AccessibleSmElement.cxx
index 848af8af6b0d..30d19cc8afc3 100644
--- a/starmath/source/AccessibleSmElement.cxx
+++ b/starmath/source/AccessibleSmElement.cxx
@@ -168,17 +168,15 @@ uno::Reference 
AccessibleSmElement::getAccessibleRelatio
 {
 OContextEntryGuard aGuard(this);
 
-utl::AccessibleRelationSetHelper* pRelationSetHelper = new 
utl::AccessibleRelationSetHelper;
-uno::Reference xSet = pRelationSetHelper;
-return xSet;
+return new utl::AccessibleRelationSetHelper;
 }
 
 uno::Reference 
AccessibleSmElement::getAccessibleStateSet()
 {
 OExternalLockGuard aGuard(this);
 
-utl::AccessibleStateSetHelper* pStateSetHelper = new 
utl::AccessibleStateSetHelper;
-uno::Reference xStateSet = pStateSetHelper;
+rtl::Reference pStateSetHelper
+= new utl::AccessibleStateSetHelper;
 
 if (m_pSmElementsControl && !rBHelper.bDisposed && !rBHelper.bInDispose)
 {
@@ -199,7 +197,7 @@ uno::Reference 
AccessibleSmElement::getAccessibleStateSet()
 else
 pStateSetHelper->AddState(AccessibleStateType::DEFUNC);
 
-return xStateSet;
+return pStateSetHelper;
 }
 
 // XAccessibleComponent
diff --git a/starmath/source/AccessibleSmElementsControl.cxx 
b/starmath/source/AccessibleSmElementsControl.cxx
index 0b82f3f87e5a..922c8097fd6a 100644
--- a/starmath/source/AccessibleSmElementsControl.cxx
+++ b/starmath/source/AccessibleSmElementsControl.cxx
@@ -192,7 +192,8 @@ uno::Reference 
AccessibleSmElementsControl::getAccessibleChild(sal_
 if (!xChild.is())
 {
 sal_uInt16 nHighlightItemId = m_pControl->itemHighlighted();
-AccessibleSmElement* pChild = new AccessibleSmElement(m_pControl, 
nItemId, c);
+rtl::Reference pChild
+= new AccessibleSmElement(m_pControl, nItemId, c);
 if (pChild->itemId() == nHighlightItemId)
 pChild->SetFocus(true);
 m_aAccessibleChildren[c] = pChild;
@@ -342,9 +343,7 @@ uno::Reference 
AccessibleSmElementsControl::getAccessibl
 uno::Reference 
AccessibleSmElementsControl::getAccessibleStateSet()
 {
 SolarMutexGuard aGuard;
-::utl::AccessibleStateSetHelper* pStateSet = new 
::utl::AccessibleStateSetHelper;
-
-uno::Reference xStateSet(pStateSet);
+rtl::Reference<::utl::AccessibleStateSetHelper> pStateSet = new 
::utl::AccessibleStateSetHelper;
 
 if (!m_pControl)
 pStateSet->AddState(AccessibleStateType::DEFUNC);
@@ -364,7 +363,7 @@ uno::Reference 
AccessibleSmElementsControl::getAccessibleSt
 pStateSet->AddState(AccessibleStateType::OPAQUE);
 }
 
-return xStateSet;
+return pStateSet;
 }
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/starmath/source/accessibility.cxx 
b/starmath/source/accessibility.cxx
index efc6bc691043..851f122c5ad5 100644
--- a/starmath/source/accessibility.cxx
+++ b/starmath/source/accessibility.cxx
@@ -337,11 +337,9 @@ Reference< XAccessibleRelationSet > SAL_CALL 
SmGraphicAccessible::getAccessibleR
 Reference< XAccessibleStateSet > SAL_CALL 
SmGraphicAccessible::getAccessibleStateSet()
 {
 SolarMutexGuard aGuard;
-::utl::AccessibleStateSetHelper *pStateSet =
+rtl::Reference<::utl::AccessibleStateSetHelper> pStateSet =
 new ::utl::AccessibleStateSetHelper;
 
-Reference xStateSet( pStateSet );
-
 if (!pWin)
 pStateSet->AddState( AccessibleStateType::DEFUNC );
 else
@@ -360,7 +358,7 @@ Reference< XAccessibleStateSet > SAL_CALL 
SmGraphicAccessible::getAccessibleStat
 pStateSet->AddState( AccessibleStateType::OPAQUE );
 }
 
-return xStateSet;
+return pStateSet;
 }
 
 Locale SAL_CALL SmGraphicAccessible::getLocale()
@@ -703,7 +701,7 @@ sal_Bool SAL_CALL SmGraphicAccessible::copyText(
 {
 OUString sText( getTextRange(nStartIndex, nEndIndex) );
 
-vcl::unohelper::TextDataObject* pDataObj = new 
vcl::unohelper::TextDataObject( sText );
+rtl::Reference pDataObj = new 
vcl::unohelper::TextDataObject( sText );
 SolarMutexReleaser aReleaser;
 xClipboard->setContents( pDataObj, nullptr );
 
@@ -1717,11 +1715,9 @@ uno::Reference< XAccessibleRelationSet > SAL_CALL 
SmEditAccessible::getAccessibl
 uno::Reference< XAccessibleStateSet > SAL_CALL 

[Libreoffice-commits] core.git: starmath/source

2021-02-16 Thread dante (via logerrit)
 starmath/source/node.cxx |4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

New commits:
commit b7d8c5bc614e826dbe0588593a4de5102ed22cda
Author: dante 
AuthorDate: Tue Feb 16 10:14:27 2021 +0100
Commit: Noel Grandin 
CommitDate: Tue Feb 16 14:55:08 2021 +0100

SetSubnodesBinMo fix node order for diagonal operators

Change-Id: I72a95f91e9bed9aeb6da5f9621f2ba334f63f17c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/110977
Tested-by: Jenkins
Reviewed-by: Noel Grandin 

diff --git a/starmath/source/node.cxx b/starmath/source/node.cxx
index e5916a094224..696db00cca64 100644
--- a/starmath/source/node.cxx
+++ b/starmath/source/node.cxx
@@ -451,9 +451,9 @@ void SmStructureNode::SetSubNodesBinMo(SmNode* pFirst, 
SmNode* pSecond, SmNode*
 if (pFirst)
 maSubNodes[0] = pFirst;
 if (pSecond)
-maSubNodes[1] = pSecond;
+maSubNodes[2] = pSecond;
 if (pThird)
-maSubNodes[2] = pThird;
+maSubNodes[1] = pThird;
 }
 else
 {
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: starmath/source

2021-02-14 Thread Rafael Lima (via logerrit)
 starmath/source/edit.cxx |4 
 1 file changed, 4 insertions(+)

New commits:
commit 737112d7c37300661972778a63a4e93fa196a395
Author: Rafael Lima 
AuthorDate: Sat Feb 13 16:43:01 2021 +0100
Commit: Adolfo Jayme Barrientos 
CommitDate: Mon Feb 15 08:58:34 2021 +0100

Resolves tdf#140221 auto-adjust Formula Editor width

Currently the formula editor uses a fixed width that corresponds to about 
half the size of the display. This patch makes the formula editor auto adjust.

Change-Id: I0cd6a6385b698fced96132a636df2d24c6c62cf1
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/110852
Tested-by: Jenkins
Reviewed-by: Dante DM 
Reviewed-by: Adolfo Jayme Barrientos 

diff --git a/starmath/source/edit.cxx b/starmath/source/edit.cxx
index 9b4cd02fb876..e49945acb840 100644
--- a/starmath/source/edit.cxx
+++ b/starmath/source/edit.cxx
@@ -293,6 +293,10 @@ void SmEditWindow::Resize()
 
 if (pEditView)
 {
+// Resizes the edit engine to adjust to the size of the output area
+const Size aSize( pEditView->GetOutputArea().GetSize() );
+pEditView->GetEditEngine()->SetPaperSize(aSize);
+
 pEditView->SetOutputArea(AdjustScrollBars());
 pEditView->ShowCursor();
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


  1   2   3   4   5   >