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

2023-10-29 Thread Mike Kaganski (via logerrit)
 starmath/inc/view.hxx|4 ++--
 starmath/source/document.cxx |   16 +++-
 2 files changed, 9 insertions(+), 11 deletions(-)

New commits:
commit 9278577e8f3a3d8a65a3a02c2d4c59b5fa4c26ec
Author: Mike Kaganski 
AuthorDate: Sun Oct 29 14:59:47 2023 +0300
Commit: Mike Kaganski 
CommitDate: Sun Oct 29 20:25:53 2023 +0100

Drop some intermediate conversions to pixel

Should improve independence of results from resolution. Some output
devices are not even pixel-based (e.g., PDF output).

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

diff --git a/starmath/source/document.cxx b/starmath/source/document.cxx
index 29dd3f2ef411..59b23522ffa5 100644
--- a/starmath/source/document.cxx
+++ b/starmath/source/document.cxx
@@ -1544,11 +1544,9 @@ void SmDocShell::Impl_Print(OutputDevice& rOutDev, const 
SmPrintUIOptions& rPrin
 case PRINT_SIZE_SCALED:
 if (!aSize.IsEmpty())
 {
-Size OutputSize(rOutDev.LogicToPixel(aOutRect.GetSize(), 
MapMode(SmMapUnit(;
-Size GraphicSize(rOutDev.LogicToPixel(aSize, 
MapMode(SmMapUnit(;
 sal_uInt16 nZ
-= std::min(o3tl::convert(OutputSize.Width(), 100, 
GraphicSize.Width()),
-   o3tl::convert(OutputSize.Height(), 100, 
GraphicSize.Height()));
+= std::min(o3tl::convert(aOutRect.GetWidth(), 100, 
aSize.Width()),
+   o3tl::convert(aOutRect.GetHeight(), 100, 
aSize.Height()));
 if (nZ > MINZOOM)
 nZ -= 10;
 Fraction aFraction(std::clamp(nZ, MINZOOM, MAXZOOM), 100);
@@ -1568,14 +1566,13 @@ void SmDocShell::Impl_Print(OutputDevice& rOutDev, 
const SmPrintUIOptions& rPrin
 }
 }
 
-aSize = rOutDev.PixelToLogic(rOutDev.LogicToPixel(aSize, OutputMapMode), 
MapMode(SmMapUnit()));
+aSize = OutputDevice::LogicToLogic(aSize, OutputMapMode, 
MapMode(SmMapUnit()));
 
 Point aPos(aOutRect.Left() + (aOutRect.GetWidth() - aSize.Width()) / 2,
aOutRect.Top() + (aOutRect.GetHeight() - aSize.Height()) / 2);
 
-aPos = rOutDev.PixelToLogic(rOutDev.LogicToPixel(aPos, 
MapMode(SmMapUnit())), OutputMapMode);
-aOutRect
-= rOutDev.PixelToLogic(rOutDev.LogicToPixel(aOutRect, 
MapMode(SmMapUnit())), OutputMapMode);
+aPos = OutputDevice::LogicToLogic(aPos, MapMode(SmMapUnit()), 
OutputMapMode);
+aOutRect = OutputDevice::LogicToLogic(aOutRect, MapMode(SmMapUnit()), 
OutputMapMode);
 
 rOutDev.SetMapMode(OutputMapMode);
 rOutDev.SetClipRegion(vcl::Region(aOutRect));
commit 7605de7303f57c1320d96d5ff833f492d002cfb7
Author: Mike Kaganski 
AuthorDate: Sun Oct 29 16:45:53 2023 +0300
Commit: Mike Kaganski 
CommitDate: Sun Oct 29 20:25:39 2023 +0100

Subtraction could wrap

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

diff --git a/starmath/inc/view.hxx b/starmath/inc/view.hxx
index 8b17744d6171..03f67fdbed40 100644
--- a/starmath/inc/view.hxx
+++ b/starmath/inc/view.hxx
@@ -37,8 +37,8 @@ class SmPrintUIOptions;
 class SmGraphicAccessible;
 class SmGraphicWidget;
 
-#define MINZOOM sal_uInt16(25)
-#define MAXZOOM sal_uInt16(800)
+constexpr sal_uInt16 MINZOOM = 25;
+constexpr sal_uInt16 MAXZOOM = 800;
 
 class SmGraphicWindow final : public InterimItemWindow
 {
diff --git a/starmath/source/document.cxx b/starmath/source/document.cxx
index 715525c94307..29dd3f2ef411 100644
--- a/starmath/source/document.cxx
+++ b/starmath/source/document.cxx
@@ -1549,7 +1549,8 @@ void SmDocShell::Impl_Print(OutputDevice& rOutDev, const 
SmPrintUIOptions& rPrin
 sal_uInt16 nZ
 = std::min(o3tl::convert(OutputSize.Width(), 100, 
GraphicSize.Width()),
o3tl::convert(OutputSize.Height(), 100, 
GraphicSize.Height()));
-nZ -= 10;
+if (nZ > MINZOOM)
+nZ -= 10;
 Fraction aFraction(std::clamp(nZ, MINZOOM, MAXZOOM), 100);
 
 OutputMapMode = MapMode(SmMapUnit(), Point(), aFraction, 
aFraction);


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

2023-09-28 Thread Khaled Hosny (via logerrit)
 starmath/inc/strings.hxx  |  601 +++---
 starmath/inc/token.hxx|3 
 starmath/source/ElementsDockingWindow.cxx |   55 ++
 starmath/source/parse5.cxx|   33 +
 4 files changed, 388 insertions(+), 304 deletions(-)

New commits:
commit fb0ecd64011922bc47716f77d4225bca3a8b0858
Author: Khaled Hosny 
AuthorDate: Thu Sep 28 12:08:20 2023 +0300
Commit: خالد حسني 
CommitDate: Thu Sep 28 14:34:43 2023 +0200

starmath: Add Arabic functions to elements panel

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

diff --git a/starmath/inc/strings.hxx b/starmath/inc/strings.hxx
index 4be4f1d144f5..cf8e7d5de2ce 100644
--- a/starmath/inc/strings.hxx
+++ b/starmath/inc/strings.hxx
@@ -20,294 +20,319 @@
 inline constexpr OUStringLiteral RID_UNDOFORMATNAME = u"Format";
 
 // clang-format off
-#define RID_PLUSX   "+ "
-#define RID_MINUSX  "- "
-#define RID_PLUSMINUSX  "+- "
-#define RID_MINUSPLUSX  "-+ "
-#define RID_NEGX"neg  "
-#define RID_XPLUSY  " +  "
-#define RID_XMINUSY " -  "
-#define RID_XCDOTY  " cdot  "
-#define RID_XTIMESY " times  "
-#define RID_XSYMTIMESY  " *  "
-#define RID_XSYMDIVIDEY " /  "
-#define RID_XDIVY   " div  "
-#define RID_XOVERY  "{} over {} "
-#define RID_FRACXY  "frac {} {} "
-#define RID_XODIVIDEY   " odivide  "
-#define RID_XODOTY  " odot  "
-#define RID_XOMINUSY" ominus  "
-#define RID_XOPLUSY " oplus  "
-#define RID_XOTIMESY" otimes  "
-#define RID_XANDY   " and  "
-#define RID_XORY" or  "
-#define RID_XEQY" =  "
-#define RID_XNEQY   " <>  "
-#define RID_XLTY" <  "
-#define RID_XGTY" >  "
-#define RID_XLEY" <=  "
-#define RID_XGEY" >=  "
-#define RID_XLESLANTY   " leslant  "
-#define RID_XGESLANTY   " geslant  "
-#define RID_XLLY" <<  "
-#define RID_XGGY" >>  "
-#define RID_XDEFY   " def  "
-#define RID_XEQUIVY " equiv  "
-#define RID_XAPPROXY" approx  "
-#define RID_XSIMY   " sim  "
-#define RID_XSIMEQY " simeq  "
-#define RID_XPROPY  " prop  "
-#define RID_XORTHOY " ortho  "
-#define RID_XPARALLELY  " parallel  "
-#define RID_XTOWARDY" toward  "
-#define RID_XTRANSLY" transl  "
-#define RID_XTRANSRY" transr  "
-#define RID_XINY" in  "
-#define RID_XNOTINY " notin  "
-#define RID_XOWNSY  " owns  "
-#define RID_XUNIONY " union  "
-#define RID_XINTERSECTIONY  " intersection  "
-#define RID_XSETMINUSY  " setminus  "
-#define RID_XSETQUOTIENTY   " setquotient  "
-#define RID_XSUBSETY" subset  "
-#define RID_XSUBSETEQY  " subseteq  "
-#define RID_XSUPSETY" supset  "
-#define RID_XSUPSETEQY  " supseteq  "
-#define RID_XNSUBSETY   " nsubset  "
-#define RID_XNSUBSETEQY " nsubseteq  "
-#define RID_XNSUPSETY   " nsupset  "
-#define RID_XNSUPSETEQY " nsupseteq  "
-#define RID_FUNCX   "func () "
-#define RID_ABSX"abs{} "
-#define RID_FACTX   "fact{} "
-#define RID_SQRTX   "sqrt{} "
-#define RID_NROOTXY "nroot{}{} "
-#define RID_EX  "func e^{} "
-#define RID_EXPX"exp() "
-#define RID_LNX "ln() "
-#define RID_LOGX"log() "
-#define RID_SINX"sin() "
-#define RID_COSX"cos() "
-#define RID_TANX"tan() "
-#define RID_COTX"cot() "
-#define RID_ARCSINX "arcsin() "
-#define RID_ARCCOSX "arccos() "
-#define RID_ARCTANX "arctan() "
-#define RID_ARCCOTX "arccot() "
-#define RID_SINHX   "sinh() "
-#define RID_COSHX   "cosh() "
-#define RID_TANHX   "tanh() "
-#define RID_COTHX   "coth() "
-#define RID_ARSINHX "arsinh() "
-#define RID_ARCOSHX "arcosh() "
-#define RID_ARTANHX "artanh() "
-#define RID_ARCOTHX "arcoth() "
-#define RID_OPERX   "oper oper  "
-#define RID_OPER_FROMX  "oper oper from{}  "
-#define RID_OPER_TOX"oper oper to{}  "
-#define RID_OPER_FROMTOX"oper oper from{} to{}  "
-#define RID_SUMX"sum  "
-#define RID_SUM_FROMX   "sum from{}  "
-#define RID_SUM_TOX "sum to{}  "
-#define RID_SUM_FROMTOX "sum from{} to{}  "
-#define RID_MAJX

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

2023-09-17 Thread Khaled Hosny (via logerrit)
 starmath/inc/mathml/starmathdatabase.hxx|   26 +---
 starmath/inc/token.hxx  |   10 +
 starmath/inc/types.hxx  |2 +
 starmath/qa/extras/data/hadd.mml|   11 ++
 starmath/qa/extras/data/maj.mml |   18 
 starmath/qa/extras/mmlexport-test.cxx   |   30 
 starmath/qa/extras/mmlimport-test.cxx   |   28 ++
 starmath/source/mathml/mathmlexport.cxx |   20 ++
 starmath/source/mathml/mathmlimport.cxx |   22 +---
 starmath/source/mathml/starmathdatabase.cxx |   19 ++---
 starmath/source/parse5.cxx  |   13 ++--
 11 files changed, 152 insertions(+), 47 deletions(-)

New commits:
commit 9023cbc96c3538995f0ef9042aebcad14711cd60
Author: Khaled Hosny 
AuthorDate: Sun Sep 17 19:31:27 2023 +0300
Commit: خالد حسني 
CommitDate: Mon Sep 18 02:32:15 2023 +0200

tdf#111705: Add support of Persian limits operator (U+1EEF1)

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

diff --git a/starmath/inc/token.hxx b/starmath/inc/token.hxx
index a47e741a4358..8409af89dd8a 100644
--- a/starmath/inc/token.hxx
+++ b/starmath/inc/token.hxx
@@ -84,6 +84,7 @@ enum SmTokenType
 TIM,TRE,THBAR,  TLAMBDABAR, // Complex 
and constants
 TPLUSMINUS, TMINUSPLUS, TSIM,   TSIMEQ, // +- -+ ~ 
~=
 TLIM,   TLIMSUP,TLIMINF,TTOWARD,// Limits
+THADD,
 TOVER,  TTIMES, TCDOT,  TDIV,   // Product 
type
 TSLASH, TBACKSLASH, TWIDESLASH, TWIDEBACKSLASH, //Slash
 TFRAC,  TIT,// mathml 
related
diff --git a/starmath/inc/types.hxx b/starmath/inc/types.hxx
index 597f6dcd187f..e91d6da7f363 100644
--- a/starmath/inc/types.hxx
+++ b/starmath/inc/types.hxx
@@ -126,6 +126,7 @@ sal_Unicode const MS_PROD = 0x220F;
 sal_Unicode const MS_COPROD = 0x2210;
 sal_Unicode const MS_SUM = 0x2211;
 sal_uInt32 const MS_MAJ = 0x1EEF0;
+sal_uInt32 const MS_HADD = 0x1EEF1;
 sal_Unicode const MS_SQRT = 0x221A;
 sal_Unicode const MS_INT = 0x222B;
 sal_Unicode const MS_IINT = 0x222C;
diff --git a/starmath/qa/extras/data/hadd.mml b/starmath/qa/extras/data/hadd.mml
new file mode 100644
index ..b6ebd374a57f
--- /dev/null
+++ b/starmath/qa/extras/data/hadd.mml
@@ -0,0 +1,11 @@
+
+http://www.w3.org/1998/Math/MathML; display="block">
+ 
+  
+   
+   
+   
+  
+  
+ 
+
diff --git a/starmath/qa/extras/mmlexport-test.cxx 
b/starmath/qa/extras/mmlexport-test.cxx
index 01528199086f..615dcd7dfa98 100644
--- a/starmath/qa/extras/mmlexport-test.cxx
+++ b/starmath/qa/extras/mmlexport-test.cxx
@@ -32,12 +32,14 @@ public:
 void testTdf97049();
 void testTdf101022();
 void testMaj();
+void testHadd();
 
 CPPUNIT_TEST_SUITE(MathMLExportTest);
 CPPUNIT_TEST(testBlank);
 CPPUNIT_TEST(testTdf97049);
 CPPUNIT_TEST(testTdf101022);
 CPPUNIT_TEST(testMaj);
+CPPUNIT_TEST(testHadd);
 CPPUNIT_TEST_SUITE_END();
 
 protected:
@@ -132,6 +134,18 @@ void MathMLExportTest::testMaj()
 assertXPathContent(pDoc, "/m:math/m:semantics/m:mrow/m:munderover/m:mo", 
u"\U0001EEF0");
 }
 
+void MathMLExportTest::testHadd()
+{
+mxComponent = loadFromDesktop("private:factory/smath");
+SfxBaseModel* pModel = dynamic_cast(mxComponent.get());
+SmDocShell* pDocShell = static_cast(pModel->GetObjectShell());
+pDocShell->SetText(u"hadd to { \U0001EE4E } from { \U0001EE4E } 
\U0001EE4E");
+save("MathML XML (Math)");
+xmlDocUniquePtr pDoc = parseXml(maTempFile);
+CPPUNIT_ASSERT(pDoc);
+assertXPathContent(pDoc, "/m:math/m:semantics/m:mrow/m:munderover/m:mi", 
u"\U0001EEF1");
+}
+
 CPPUNIT_TEST_SUITE_REGISTRATION(MathMLExportTest);
 
 CPPUNIT_PLUGIN_IMPLEMENT();
diff --git a/starmath/qa/extras/mmlimport-test.cxx 
b/starmath/qa/extras/mmlimport-test.cxx
index 03f5e7bcfac5..2fcb1de13744 100644
--- a/starmath/qa/extras/mmlimport-test.cxx
+++ b/starmath/qa/extras/mmlimport-test.cxx
@@ -37,6 +37,7 @@ public:
 void testTdf151842();
 void testMathmlEntities();
 void testMaj();
+void testHadd();
 
 CPPUNIT_TEST_SUITE(Test);
 CPPUNIT_TEST(testColor);
@@ -51,6 +52,7 @@ public:
 CPPUNIT_TEST(testTdf151842);
 CPPUNIT_TEST(testMathmlEntities);
 CPPUNIT_TEST(testMaj);
+CPPUNIT_TEST(testHadd);
 CPPUNIT_TEST_SUITE_END();
 };
 
@@ -191,6 +193,18 @@ void Test::testMaj()
  pDocShell->GetText());
 }
 
+void Test::testHadd()
+{
+loadFromURL(u"hadd.mml");
+SfxBaseModel* pModel = dynamic_cast(mxComponent.get());
+CPPUNIT_ASSERT(pModel);
+SmDocShell* pDocShell = 

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

2018-12-30 Thread Libreoffice Gerrit user
 starmath/inc/node.hxx|2 
 starmath/source/cursor.cxx   |  130 +++
 starmath/source/mathmlimport.cxx |   98 ++---
 starmath/source/node.cxx |8 +-
 starmath/source/parse.cxx|   32 -
 5 files changed, 135 insertions(+), 135 deletions(-)

New commits:
commit 9bdc1118c7b7fe10529b3320daa278f108e8f2c3
Author: Noel Grandin 
AuthorDate: Fri Dec 21 15:38:29 2018 +0200
Commit: Noel Grandin 
CommitDate: Sun Dec 30 11:41:41 2018 +0100

use unique_ptr in SmStructureNode::SetSubNodes

Change-Id: I1dafb03f72a3a662eeae3bb23fb0a8b7ba4e6d95
Reviewed-on: https://gerrit.libreoffice.org/65734
Tested-by: Jenkins
Reviewed-by: Noel Grandin 

diff --git a/starmath/inc/node.hxx b/starmath/inc/node.hxx
index 640435a4101e..da67e9bdece6 100644
--- a/starmath/inc/node.hxx
+++ b/starmath/inc/node.hxx
@@ -235,7 +235,7 @@ public:
 using   SmNode::GetSubNode;
 virtual SmNode *GetSubNode(size_t nIndex) override;
 void ClearSubNodes();
-void SetSubNodes(SmNode *pFirst, SmNode *pSecond, SmNode *pThird = 
nullptr);
+void SetSubNodes(std::unique_ptr pFirst, 
std::unique_ptr pSecond, std::unique_ptr pThird = nullptr);
 void SetSubNodes(SmNodeArray&& rNodeArray);
 
 virtual void  GetAccessibleText( OUStringBuffer  ) const override;
diff --git a/starmath/source/cursor.cxx b/starmath/source/cursor.cxx
index a883b679ce2a..6b27956cb83f 100644
--- a/starmath/source/cursor.cxx
+++ b/starmath/source/cursor.cxx
@@ -617,13 +617,13 @@ void SmCursor::InsertBrackets(SmBracketType eBracketType) 
{
 it = FindPositionInLineList(pLineList.get(), mpPosition->CaretPos);
 
 //If there's no selected nodes, create a place node
-SmNode *pBodyNode;
+std::unique_ptr pBodyNode;
 SmCaretPos PosAfterInsert;
 if(pSelectedNodesList->empty()) {
-pBodyNode = new SmPlaceNode();
-PosAfterInsert = SmCaretPos(pBodyNode, 1);
+pBodyNode.reset(new SmPlaceNode());
+PosAfterInsert = SmCaretPos(pBodyNode.get(), 1);
 } else
-pBodyNode = SmNodeListParser().Parse(pSelectedNodesList.get());
+pBodyNode.reset(SmNodeListParser().Parse(pSelectedNodesList.get()));
 
 pSelectedNodesList.reset();
 
@@ -631,11 +631,11 @@ void SmCursor::InsertBrackets(SmBracketType eBracketType) 
{
 SmToken aTok(TLEFT, '\0', "left", TG::NONE, 5);
 SmBraceNode *pBrace = new SmBraceNode(aTok);
 pBrace->SetScaleMode(SmScaleMode::Height);
-SmNode *pLeft = CreateBracket(eBracketType, true),
-   *pRight = CreateBracket(eBracketType, false);
-SmBracebodyNode *pBody = new SmBracebodyNode(SmToken());
-pBody->SetSubNodes(pBodyNode, nullptr);
-pBrace->SetSubNodes(pLeft, pBody, pRight);
+std::unique_ptr pLeft( CreateBracket(eBracketType, true) ),
+pRight( CreateBracket(eBracketType, false) );
+std::unique_ptr pBody(new SmBracebodyNode(SmToken()));
+pBody->SetSubNodes(std::move(pBodyNode), nullptr);
+pBrace->SetSubNodes(std::move(pLeft), std::move(pBody), std::move(pRight));
 pBrace->Prepare(mpDocShell->GetFormat(), *mpDocShell, 0);
 
 //Insert into line
@@ -750,22 +750,22 @@ bool SmCursor::InsertRow() {
 if(pNewLineList->empty())
 pNewLineList->push_front(new SmPlaceNode());
 //Parse new line
-SmNode *pNewLine = SmNodeListParser().Parse(pNewLineList);
+std::unique_ptr 
pNewLine(SmNodeListParser().Parse(pNewLineList));
 delete pNewLineList;
 //Wrap pNewLine in SmLineNode if needed
 if(pLineParent->GetType() == SmNodeType::Line) {
-SmLineNode *pNewLineNode = new SmLineNode(SmToken(TNEWLINE, '\0', 
"newline"));
-pNewLineNode->SetSubNodes(pNewLine, nullptr);
-pNewLine = pNewLineNode;
+std::unique_ptr pNewLineNode(new 
SmLineNode(SmToken(TNEWLINE, '\0', "newline")));
+pNewLineNode->SetSubNodes(std::move(pNewLine), nullptr);
+pNewLine = std::move(pNewLineNode);
 }
 //Get position
-PosAfterInsert = SmCaretPos(pNewLine, 0);
+PosAfterInsert = SmCaretPos(pNewLine.get(), 0);
 //Move other nodes if needed
 for( int i = pTable->GetNumSubNodes(); i > nTableIndex + 1; i--)
 pTable->SetSubNode(i, pTable->GetSubNode(i-1));
 
 //Insert new line
-pTable->SetSubNode(nTableIndex + 1, pNewLine);
+pTable->SetSubNode(nTableIndex + 1, pNewLine.get());
 
 //Check if we need to change token type:
 if(pTable->GetNumSubNodes() > 2 && pTable->GetToken().eType == TBINOM) 
{
@@ -835,16 +835,16 @@ void SmCursor::InsertFraction() {
 
 //Create pNum, and pDenom
 bool bEmptyFraction = pSelectedNodesList->empty();
-SmNode *pNum = bEmptyFraction
+std::unique_ptr pNum( bEmptyFraction
 ? new SmPlaceNode()
-: 

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

2015-01-15 Thread Takeshi Abe
 starmath/inc/parse.hxx|1 -
 starmath/source/parse.cxx |2 +-
 2 files changed, 1 insertion(+), 2 deletions(-)

New commits:
commit 94518fb280075e2dbebd7717618ca0f5557a333a
Author: Takeshi Abe t...@fixedpoint.jp
Date:   Thu Jan 15 17:38:55 2015 +0900

protected - private

Change-Id: I199f4cd8897e3fa7b794f3d6d96077e98ccff51e

diff --git a/starmath/inc/parse.hxx b/starmath/inc/parse.hxx
index 7b7a8a5..8219407 100644
--- a/starmath/inc/parse.hxx
+++ b/starmath/inc/parse.hxx
@@ -51,7 +51,6 @@ class SmParser : boost::noncopyable
 //! locale where '.' is decimal separator!
 ::com::sun::star::lang::Locale m_aDotLoc;
 
-protected:
 #if OSL_DEBUG_LEVEL  1
 boolIsDelimiter( const OUString rTxt, sal_Int32 nPos );
 #endif
commit f95a3a409a056a0b0bc8e9d56a0c3bff42c72355
Author: Takeshi Abe t...@fixedpoint.jp
Date:   Thu Jan 15 16:39:17 2015 +0900

no need to compare it with true

Change-Id: I9c825663508abdc7efa9cf2801770acc2b79174a

diff --git a/starmath/source/parse.cxx b/starmath/source/parse.cxx
index 5215602..31e4962 100644
--- a/starmath/source/parse.cxx
+++ b/starmath/source/parse.cxx
@@ -1519,7 +1519,7 @@ void SmParser::Term(bool bGroupNumberIdent)
 
 boolbIsAttr;
 sal_uInt16  n = 0;
-while (true == (bIsAttr = TokenInGroup(TGATTRIBUT))
+while ( (bIsAttr = TokenInGroup(TGATTRIBUT))
||  TokenInGroup(TGFONTATTR))
 {   aArray.resize(n + 1);
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2014-12-03 Thread Noel Grandin
 starmath/inc/caret.hxx|2 -
 starmath/inc/cursor.hxx   |2 -
 starmath/inc/view.hxx |5 +--
 starmath/source/ElementsDockingWindow.cxx |2 -
 starmath/source/config.cxx|   16 +-
 starmath/source/cursor.cxx|   40 +-
 starmath/source/dialog.cxx|   18 +--
 starmath/source/document.cxx  |8 ++---
 starmath/source/edit.cxx  |4 +-
 starmath/source/mathmlimport.cxx  |6 +--
 starmath/source/mathtype.cxx  |   10 +++---
 starmath/source/node.cxx  |   10 +++---
 starmath/source/ooxmlexport.cxx   |2 -
 starmath/source/parse.cxx |2 -
 starmath/source/rtfexport.cxx |2 -
 starmath/source/smmod.cxx |2 -
 starmath/source/tmpdevice.cxx |2 -
 starmath/source/toolbox.cxx   |2 -
 starmath/source/view.cxx  |   20 ++---
 starmath/source/visitors.cxx  |4 +-
 sw/source/ui/dbui/createaddresslistdialog.cxx |4 +-
 sw/source/ui/dbui/mmaddressblockpage.cxx  |   20 ++---
 sw/source/ui/dbui/selectdbtabledialog.cxx |2 -
 sw/source/ui/misc/glosbib.cxx |8 ++---
 sw/source/ui/misc/pgfnote.cxx |   18 +--
 25 files changed, 106 insertions(+), 105 deletions(-)

New commits:
commit 0e2927ed2cffdc718085cadce3cc41e34cd6a04f
Author: Noel Grandin n...@peralex.com
Date:   Wed Dec 3 10:43:11 2014 +0200

loplugin: cstylecast

Change-Id: Ic48a59c209e77382a0e431a5502c24a62407334b

diff --git a/sw/source/ui/dbui/createaddresslistdialog.cxx 
b/sw/source/ui/dbui/createaddresslistdialog.cxx
index b398105..b331a8e 100644
--- a/sw/source/ui/dbui/createaddresslistdialog.cxx
+++ b/sw/source/ui/dbui/createaddresslistdialog.cxx
@@ -179,7 +179,7 @@ void SwAddressControl_Impl::SetData(SwCSVData rDBData)
 FixedText* pNewFT = new FixedText(m_pWindow, WB_RIGHT);
 Edit* pNewED = new Edit(m_pWindow, WB_BORDER);
 //set nLines a position identifier - used in the ModifyHdl
-pNewED-SetData((void*)nLines);
+pNewED-SetData(reinterpret_castvoid*(nLines));
 pNewED-SetGetFocusHdl(aFocusLink);
 pNewED-SetModifyHdl(aEditModifyLink);
 
@@ -299,7 +299,7 @@ void SwAddressControl_Impl::MakeVisible(const Rectangle  
rRect)
 IMPL_LINK(SwAddressControl_Impl, EditModifyHdl_Impl, Edit*, pEdit)
 {
 //get the data element number of the current set
-sal_Int32 nIndex = (sal_Int32)(sal_IntPtr)pEdit-GetData();
+sal_Int32 nIndex = 
(sal_Int32)reinterpret_castsal_IntPtr(pEdit-GetData());
 //get the index of the set
 OSL_ENSURE(m_pData-aDBData.size()  m_nCurrentDataSet, wrong data set 
index );
 if(m_pData-aDBData.size()  m_nCurrentDataSet)
diff --git a/sw/source/ui/dbui/mmaddressblockpage.cxx 
b/sw/source/ui/dbui/mmaddressblockpage.cxx
index 675b1e8..f0868a7 100644
--- a/sw/source/ui/dbui/mmaddressblockpage.cxx
+++ b/sw/source/ui/dbui/mmaddressblockpage.cxx
@@ -483,11 +483,11 @@ 
SwCustomizeAddressBlockDialog::SwCustomizeAddressBlockDialog(
 m_pFieldFT-Show();
 m_pFieldCB-Show();
 SvTreeListEntry* pEntry = 
m_pAddressElementsLB-InsertEntry(SW_RESSTR(ST_SALUTATION));
-pEntry-SetUserData((void*)(sal_Int32)USER_DATA_SALUTATION );
+
pEntry-SetUserData(reinterpret_castvoid*((sal_Int32)USER_DATA_SALUTATION) );
 pEntry = m_pAddressElementsLB-InsertEntry(SW_RESSTR(ST_PUNCTUATION));
-pEntry-SetUserData((void*)(sal_Int32)USER_DATA_PUNCTUATION );
+
pEntry-SetUserData(reinterpret_castvoid*((sal_Int32)USER_DATA_PUNCTUATION) );
 pEntry = m_pAddressElementsLB-InsertEntry(SW_RESSTR(ST_TEXT));
-pEntry-SetUserData((void*)(sal_Int32)USER_DATA_TEXT   );
+pEntry-SetUserData(reinterpret_castvoid*((sal_Int32)USER_DATA_TEXT) 
  );
 ResStringArray aSalutArr(SW_RES(RA_SALUTATION));
 for(sal_uInt32 i = 0; i  aSalutArr.Count(); ++i)
 m_aSalutations.push_back(aSalutArr.GetString(i));
@@ -512,7 +512,7 @@ 
SwCustomizeAddressBlockDialog::SwCustomizeAddressBlockDialog(
 for(sal_uInt32 i = 0; i  rHeaders.Count(); ++i)
 {
 SvTreeListEntry* pEntry = 
m_pAddressElementsLB-InsertEntry(rHeaders.GetString( i ));
-pEntry-SetUserData((void*)(sal_IntPtr)i);
+pEntry-SetUserData(reinterpret_castvoid*((sal_IntPtr)i));
 }
 m_pOK-SetClickHdl(LINK(this, SwCustomizeAddressBlockDialog, OKHdl_Impl));
 m_pAddressElementsLB-SetSelectHdl(LINK(this, 
SwCustomizeAddressBlockDialog, ListBoxSelectHdl_Impl ));
@@ -543,7 +543,7 @@ IMPL_LINK_NOARG(SwCustomizeAddressBlockDialog, OKHdl_Impl)
 
 IMPL_LINK(SwCustomizeAddressBlockDialog, ListBoxSelectHdl_Impl, DDListBox*, 
pBox)
 {
-sal_Int32 

[Libreoffice-commits] core.git: 2 commits - starmath/inc

2014-11-03 Thread Takeshi Abe
 starmath/inc/cursor.hxx |2 ++
 starmath/inc/parse.hxx  |8 ++--
 2 files changed, 4 insertions(+), 6 deletions(-)

New commits:
commit 5c5e809605d750d87ae7a5334f8406894f6a4184
Author: Takeshi Abe t...@fixedpoint.jp
Date:   Tue Nov 4 00:56:45 2014 +0900

mark as noncopyable

Change-Id: Ic464974087f9f8fb161aaffde232668ba01c2f62

diff --git a/starmath/inc/parse.hxx b/starmath/inc/parse.hxx
index 22de086..c740991 100644
--- a/starmath/inc/parse.hxx
+++ b/starmath/inc/parse.hxx
@@ -26,6 +26,7 @@
 
 #include types.hxx
 
+#include boost/noncopyable.hpp
 #include boost/ptr_container/ptr_vector.hpp
 
 class SmNode;
@@ -169,7 +170,7 @@ struct SmTokenTableEntry
 sal_uInt16  nLevel;
 };
 
-class SmParser
+class SmParser : boost::noncopyable
 {
 OUStringm_aBufferString;
 SmToken m_aCurToken;
@@ -190,10 +191,6 @@ class SmParser
 //! locale where '.' is decimal separator!
 ::com::sun::star::lang::Locale m_aDotLoc;
 
-// declare copy-constructor and assignment-operator private
-SmParser(const SmParser );
-SmParser  operator = (const SmParser );
-
 protected:
 #if OSL_DEBUG_LEVEL  1
 boolIsDelimiter( const OUString rTxt, sal_Int32 nPos );
commit 67276f70039c460332eabc00bd4109d301b2f40a
Author: Takeshi Abe t...@fixedpoint.jp
Date:   Tue Nov 4 00:40:34 2014 +0900

include list where needed

Change-Id: Ia6784bf95d9d0c57b79bdf7373f4836709563b7a

diff --git a/starmath/inc/cursor.hxx b/starmath/inc/cursor.hxx
index 6f80e41..4ce2efc 100644
--- a/starmath/inc/cursor.hxx
+++ b/starmath/inc/cursor.hxx
@@ -12,6 +12,8 @@
 #include node.hxx
 #include caret.hxx
 
+#include list
+
 /** Factor to multiple the squared horizontal distance with
  * Used for Up and Down movement.
  */
diff --git a/starmath/inc/parse.hxx b/starmath/inc/parse.hxx
index 376113c..22de086 100644
--- a/starmath/inc/parse.hxx
+++ b/starmath/inc/parse.hxx
@@ -23,7 +23,6 @@
 
 #include set
 #include stack
-#include list
 
 #include types.hxx
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2013-06-13 Thread Andras Timar
 starmath/inc/starmath.hrc |   20 ++---
 starmath/source/ElementsDockingWindow.cxx |   44 +++---
 starmath/source/commands.src  |   20 ++---
 3 files changed, 42 insertions(+), 42 deletions(-)

New commits:
commit 34f0478ba80d38855c503890dd8422a8a4367d7e
Author: Andras Timar ati...@suse.com
Date:   Thu Jun 13 08:00:58 2013 +0200

make categories localizable in Elements docking panel

Change-Id: Ic1e4af8f8dd60ab48d701b5d713beafd0ddd22df

diff --git a/starmath/source/commands.src b/starmath/source/commands.src
index ec4308a..d719d77 100644
--- a/starmath/source/commands.src
+++ b/starmath/source/commands.src
@@ -257,16 +257,16 @@ String RID_XSUCCEEDSEQUIVY   { Text = ? succsim ?  
; };
 String RID_XNOTPRECEDESY { Text = ? nprec ?  ; };
 String RID_XNOTSUCCEEDSY { Text = ? nsucc ?  ; };
 
-String RID_CATEGORY_UNARY_BINARY_OPERATORS { Text = Unary/Binary Operators ; 
};
-String RID_CATEGORY_RELATIONS  { Text = Relations ; };
-String RID_CATEGORY_SET_OPERATIONS { Text = Set Operations ; };
-String RID_CATEGORY_FUNCTIONS  { Text = Functions ; };
-String RID_CATEGORY_OPERATORS  { Text = Operators ; };
-String RID_CATEGORY_ATTRIBUTES { Text = Attributes ; };
-String RID_CATEGORY_BRACKETS   { Text = Brackets ; };
-String RID_CATEGORY_FORMATS{ Text = Formats ; };
-String RID_CATEGORY_OTHERS { Text = Others ; };
-String RID_CATEGORY_EXAMPLES   { Text = Examples ; };
+String RID_CATEGORY_UNARY_BINARY_OPERATORS { Text [ en-US ] = Unary/Binary 
Operators ; };
+String RID_CATEGORY_RELATIONS  { Text [ en-US ] = Relations ; };
+String RID_CATEGORY_SET_OPERATIONS { Text [ en-US ] = Set Operations 
; };
+String RID_CATEGORY_FUNCTIONS  { Text [ en-US ] = Functions ; };
+String RID_CATEGORY_OPERATORS  { Text [ en-US ] = Operators ; };
+String RID_CATEGORY_ATTRIBUTES { Text [ en-US ] = Attributes ; };
+String RID_CATEGORY_BRACKETS   { Text [ en-US ] = Brackets ; };
+String RID_CATEGORY_FORMATS{ Text [ en-US ] = Formats ; };
+String RID_CATEGORY_OTHERS { Text [ en-US ] = Others ; };
+String RID_CATEGORY_EXAMPLES   { Text [ en-US ] = Examples ; };
 
 //
 
commit eaf4c51ea981b7f314c8ea090b873e83df979a29
Author: Andras Timar ati...@suse.com
Date:   Thu Jun 13 07:57:17 2013 +0200

typo: s/CATERGORY/CATEGORY/

Change-Id: I37f2db8b073ad1257101af02118cfbc91ee60f26

diff --git a/starmath/inc/starmath.hrc b/starmath/inc/starmath.hrc
index 3b2e902..f03cd6d 100644
--- a/starmath/inc/starmath.hrc
+++ b/starmath/inc/starmath.hrc
@@ -422,16 +422,16 @@
 #define RID_SPANISH_50_NAMES(RID_APP_START + 3113)
 #define RID_SPANISH_60_NAMES(RID_APP_START + 3114)
 
-#define RID_CATERGORY_UNARY_BINARY_OPERATORS (RID_APP_START + 4001)
-#define RID_CATERGORY_RELATIONS  (RID_APP_START + 4002)
-#define RID_CATERGORY_SET_OPERATIONS (RID_APP_START + 4003)
-#define RID_CATERGORY_FUNCTIONS  (RID_APP_START + 4004)
-#define RID_CATERGORY_OPERATORS  (RID_APP_START + 4005)
-#define RID_CATERGORY_ATTRIBUTES (RID_APP_START + 4006)
-#define RID_CATERGORY_BRACKETS   (RID_APP_START + 4007)
-#define RID_CATERGORY_FORMATS(RID_APP_START + 4008)
-#define RID_CATERGORY_OTHERS (RID_APP_START + 4009)
-#define RID_CATERGORY_EXAMPLES   (RID_APP_START + 4010)
+#define RID_CATEGORY_UNARY_BINARY_OPERATORS (RID_APP_START + 4001)
+#define RID_CATEGORY_RELATIONS  (RID_APP_START + 4002)
+#define RID_CATEGORY_SET_OPERATIONS (RID_APP_START + 4003)
+#define RID_CATEGORY_FUNCTIONS  (RID_APP_START + 4004)
+#define RID_CATEGORY_OPERATORS  (RID_APP_START + 4005)
+#define RID_CATEGORY_ATTRIBUTES (RID_APP_START + 4006)
+#define RID_CATEGORY_BRACKETS   (RID_APP_START + 4007)
+#define RID_CATEGORY_FORMATS(RID_APP_START + 4008)
+#define RID_CATEGORY_OTHERS (RID_APP_START + 4009)
+#define RID_CATEGORY_EXAMPLES   (RID_APP_START + 4010)
 
 #define BMP_ARROW_RIGHT 1
 
diff --git a/starmath/source/ElementsDockingWindow.cxx 
b/starmath/source/ElementsDockingWindow.cxx
index 7be18ca..1ad05fc 100644
--- a/starmath/source/ElementsDockingWindow.cxx
+++ b/starmath/source/ElementsDockingWindow.cxx
@@ -364,34 +364,34 @@ void SmElementsControl::build()
 
 switch(maCurrentSetId)
 {
-case RID_CATERGORY_UNARY_BINARY_OPERATORS:
+case RID_CATEGORY_UNARY_BINARY_OPERATORS:
 addElements(aUnaryBinaryOperatorsList, 
sizeof(aUnaryBinaryOperatorsList) / sizeof(sal_uInt16));
 break;
-case RID_CATERGORY_RELATIONS:
+case RID_CATEGORY_RELATIONS: