[Libreoffice-commits] core.git: extras/source starmath/inc starmath/qa starmath/source starmath/uiconfig
Takeshi Abe (via logerrit)
logerrit at kemper.freedesktop.org
Thu Jun 13 03:12:02 UTC 2019
extras/source/truetype/symbol/OpenSymbol.sfd | 25 ++++++++++++++++++++----
starmath/inc/node.hxx | 2 -
starmath/inc/strings.hrc | 2 +
starmath/inc/strings.hxx | 2 +
starmath/inc/token.hxx | 4 ++-
starmath/inc/types.hxx | 1
starmath/qa/cppunit/test_nodetotextvisitors.cxx | 2 +
starmath/source/ElementsDockingWindow.cxx | 4 ++-
starmath/source/mathmlexport.cxx | 1
starmath/source/mathtype.cxx | 2 +
starmath/source/node.cxx | 3 ++
starmath/source/ooxmlexport.cxx | 1
starmath/source/ooxmlimport.cxx | 3 ++
starmath/source/parse.cxx | 3 ++
starmath/source/rtfexport.cxx | 1
starmath/uiconfig/smath/popupmenu/edit.xml | 2 +
16 files changed, 51 insertions(+), 7 deletions(-)
New commits:
commit 93eeaf0ad902214fb6b4205606b24046a458ee45
Author: Takeshi Abe <tabe at fixedpoint.jp>
AuthorDate: Mon May 27 00:12:28 2019 +0900
Commit: Takeshi Abe <tabe at fixedpoint.jp>
CommitDate: Thu Jun 13 05:11:25 2019 +0200
tdf#120047 Support attribute harpoon/wideharpoon in Math
... for an alternative style of vectors.
They are vec/widevec analogs but with COMBINING RIGHT HARPOON ABOVE
(U+20D1). The new attribute names are deliberately long in order to
make fewer accidental collisions with variable names in formulae of
exising documents.
This also adds a glyph uni20D1 to OpenSymbol.
Change-Id: I31666e57808aa0e0327500916d3b862549891886
Reviewed-on: https://gerrit.libreoffice.org/72987
Tested-by: Jenkins
Reviewed-by: Takeshi Abe <tabe at fixedpoint.jp>
diff --git a/extras/source/truetype/symbol/OpenSymbol.sfd b/extras/source/truetype/symbol/OpenSymbol.sfd
index 35d4b01328b9..c9e9baad1707 100644
--- a/extras/source/truetype/symbol/OpenSymbol.sfd
+++ b/extras/source/truetype/symbol/OpenSymbol.sfd
@@ -3,8 +3,8 @@ FontName: OpenSymbol
FullName: OpenSymbol
FamilyName: OpenSymbol
Weight: Book
-Copyright: (c) 2009 Sun Microsystems Inc.\nTHERE DOES NOT EXIST (c) 2011 Julien Nabet\nPRECEDES <-> DOES NOT SUCCEED (c) 2011 Olivier Hallot\nPRIME <-> TRIPLE PRIME (c) 2013 Mathias Hasselmann\nphi <-> phi1 (c) 2015 Khaled Hosny\n(c) 2016 Mike Kaganski\nzero, one, two, three, four, five, six, seven, eight, nine, question, underscore, copyright, registered, uni2215, angle, therefore, lozenge (c) 2010 Google Corporation
-Version: 102.10
+Copyright: (c) 2009 Sun Microsystems Inc.\nTHERE DOES NOT EXIST (c) 2011 Julien Nabet\nPRECEDES <-> DOES NOT SUCCEED (c) 2011 Olivier Hallot\nPRIME <-> TRIPLE PRIME (c) 2013 Mathias Hasselmann\nphi <-> phi1 (c) 2015 Khaled Hosny\n(c) 2016 Mike Kaganski\nzero, one, two, three, four, five, six, seven, eight, nine, question, underscore, copyright, registered, uni2215, angle, therefore, lozenge (c) 2010 Google Corporation\nuni20D1 (c) 2019 Takeshi Abe
+Version: 102.11
ItalicAngle: 0
UnderlinePosition: -143
UnderlineWidth: 20
@@ -20,7 +20,7 @@ OS2Version: 0
OS2_WeightWidthSlopeOnly: 0
OS2_UseTypoMetrics: 1
CreationTime: 1144938807
-ModificationTime: 1479754802
+ModificationTime: 1558881510
PfmFamily: 81
TTFWeight: 400
TTFWidth: 5
@@ -784,7 +784,7 @@ FitToEm: 1
WinInfo: 0 34 12
BeginPrivate: 0
EndPrivate
-BeginChars: 1052 1052
+BeginChars: 1053 1053
StartChar: Alpha
Encoding: 0 913 0
@@ -108707,5 +108707,22 @@ SplineSet
508 1286 l 1,6,-1
EndSplineSet
EndChar
+
+StartChar: uni20D1
+Encoding: 1052 8401 1052
+Width: 1056
+Flags: W
+HStem: 1313 112<98 686>
+LayerCount: 2
+Fore
+SplineSet
+98 1313 m 1,0,-1
+ 98 1425 l 1,1,-1
+ 686 1425 l 1,2,-1
+ 645 1575 l 1,3,-1
+ 1026 1313 l 1,4,-1
+ 98 1313 l 1,0,-1
+EndSplineSet
+EndChar
EndChars
EndSplineFont
diff --git a/starmath/inc/node.hxx b/starmath/inc/node.hxx
index da67e9bdece6..73bfb17132c9 100644
--- a/starmath/inc/node.hxx
+++ b/starmath/inc/node.hxx
@@ -1019,7 +1019,7 @@ public:
/** Attribute node
*
* Used to give an attribute to another node. Used for commands such as:
- * UNDERLINE, OVERLINE, OVERSTRIKE, WIDEVEC, WIDEHAT and WIDETILDE.
+ * UNDERLINE, OVERLINE, OVERSTRIKE, WIDEVEC, WIDEHARPOON, WIDEHAT and WIDETILDE.
*
* Children:<BR>
* 0: Attribute<BR>
diff --git a/starmath/inc/strings.hrc b/starmath/inc/strings.hrc
index eec600990ba0..f12677d26eca 100644
--- a/starmath/inc/strings.hrc
+++ b/starmath/inc/strings.hrc
@@ -165,6 +165,7 @@
#define RID_HATX_HELP NC_("RID_HATX_HELP", "Circumflex" )
#define RID_TILDEX_HELP NC_("RID_TILDEX_HELP", "Tilde" )
#define RID_VECX_HELP NC_("RID_VECX_HELP", "Vector Arrow" )
+#define RID_HARPOONX_HELP NC_("RID_HARPOONX_HELP", "Harpoon" )
#define RID_UNDERLINEX_HELP NC_("RID_UNDERLINEX_HELP", "Line Below" )
#define RID_OVERLINEX_HELP NC_("RID_OVERLINEX_HELP", "Line Over" )
#define RID_OVERSTRIKEX_HELP NC_("RID_OVERSTRIKEX_HELP", "Line Through" )
@@ -256,6 +257,7 @@
#define RID_WIDEHATX_HELP NC_("RID_WIDEHATX_HELP", "Large Circumflex" )
#define RID_WIDETILDEX_HELP NC_("RID_WIDETILDEX_HELP", "Large Tilde" )
#define RID_WIDEVECX_HELP NC_("RID_WIDEVECX_HELP", "Large Vector Arrow" )
+#define RID_WIDEHARPOONX_HELP NC_("RID_WIDEHARPOONX_HELP", "Large Harpoon" )
#define RID_HBAR_HELP NC_("RID_HBAR_HELP", "h Bar" )
#define RID_LAMBDABAR_HELP NC_("RID_LAMBDABAR_HELP", "Lambda Bar" )
#define RID_LEFTARROW_HELP NC_("RID_LEFTARROW_HELP", "Left Arrow" )
diff --git a/starmath/inc/strings.hxx b/starmath/inc/strings.hxx
index beeb1519730c..ba7826a3dd75 100644
--- a/starmath/inc/strings.hxx
+++ b/starmath/inc/strings.hxx
@@ -158,6 +158,7 @@
#define RID_HATX "hat <?> "
#define RID_TILDEX "tilde <?> "
#define RID_VECX "vec <?> "
+#define RID_HARPOONX "harpoon <?> "
#define RID_UNDERLINEX "underline {<?>} "
#define RID_OVERLINEX "overline {<?>} "
#define RID_OVERSTRIKEX "overstrike {<?>} "
@@ -249,6 +250,7 @@
#define RID_WIDEHATX "widehat {<?>} "
#define RID_WIDETILDEX "widetilde {<?>} "
#define RID_WIDEVECX "widevec {<?>} "
+#define RID_WIDEHARPOONX "wideharpoon {<?>} "
#define RID_HBAR "hbar "
#define RID_LAMBDABAR "lambdabar "
#define RID_LEFTARROW "leftarrow "
diff --git a/starmath/inc/token.hxx b/starmath/inc/token.hxx
index c2b948bd7b70..8abe85e61858 100644
--- a/starmath/inc/token.hxx
+++ b/starmath/inc/token.hxx
@@ -63,6 +63,7 @@ enum SmTokenType
TDOTSDIAG, TDOTSUP, TDOTSDOWN, TACUTE, TBAR,
TBREVE, TCHECK, TCIRCLE, TDOT, TDDOT,
TDDDOT, TGRAVE, THAT, TTILDE, TVEC,
+ THARPOON,
TUNDERLINE, TOVERLINE, TOVERSTRIKE, TITALIC, TNITALIC,
TBOLD, TNBOLD, TPHANTOM, TFONT, TSIZE,
TCOLOR, TALIGNL, TALIGNC, TALIGNR, TLEFT,
@@ -93,7 +94,8 @@ enum SmTokenType
TUNDERBRACE, TOVERBRACE, TCIRC, THBAR,
TLAMBDABAR, TLEFTARROW, TRIGHTARROW, TUPARROW, TDOWNARROW,
TDIVIDES, TSETN, TSETZ, TSETQ,
- TSETR, TSETC, TWIDEVEC, TWIDETILDE, TWIDEHAT,
+ TSETR, TSETC, TWIDEVEC, TWIDEHARPOON, TWIDETILDE,
+ TWIDEHAT,
TWIDESLASH, TWIDEBACKSLASH, TLDBRACKET, TRDBRACKET, TNOSPACE,
TUNKNOWN, TPRECEDES, TSUCCEEDS, TPRECEDESEQUAL, TSUCCEEDSEQUAL,
TPRECEDESEQUIV, TSUCCEEDSEQUIV, TNOTPRECEDES, TNOTSUCCEEDS, TSILVER,
diff --git a/starmath/inc/types.hxx b/starmath/inc/types.hxx
index 78e33b62905a..b5cca6087346 100644
--- a/starmath/inc/types.hxx
+++ b/starmath/inc/types.hxx
@@ -141,6 +141,7 @@ sal_Unicode const MS_CIRCLE = 0x02DA;
sal_Unicode const MS_COMBCIRCLE = 0x030A;
sal_Unicode const MS_CHECK = 0x02C7;
sal_Unicode const MS_COMBCHECK = 0x030C;
+sal_Unicode const MS_HARPOON = 0x20D1;
sal_Unicode const MS_VEC = 0x20D7;
sal_Unicode const MS_DOT = 0x02D9;
sal_Unicode const MS_DDOT = 0x00A8;
diff --git a/starmath/qa/cppunit/test_nodetotextvisitors.cxx b/starmath/qa/cppunit/test_nodetotextvisitors.cxx
index e76cc4e1d5e9..5fba90348dae 100644
--- a/starmath/qa/cppunit/test_nodetotextvisitors.cxx
+++ b/starmath/qa/cppunit/test_nodetotextvisitors.cxx
@@ -249,11 +249,13 @@ void Test::SimpleAttributes()
parseandparseagain("breve a", "Breve");
parseandparseagain("circle a", "Circle");
parseandparseagain("vec a", "Vector arrow");
+ parseandparseagain("harpoon a", "Harpoon");
parseandparseagain("tilde a", "Tilde");
parseandparseagain("hat a", "Circumflex");
parseandparseagain("bar a", "Line above");
parseandparseagain("dot a", "Dot");
parseandparseagain("widevec abc", "Wide vector arrow");
+ parseandparseagain("wideharpoon abc", "Wide harpoon");
parseandparseagain("widetilde abc", "Wide tilde");
parseandparseagain("widehat abc", "Wide circumflex");
parseandparseagain("ddot a", "Double dot");
diff --git a/starmath/source/ElementsDockingWindow.cxx b/starmath/source/ElementsDockingWindow.cxx
index 12d362208a88..72787b5c6a12 100644
--- a/starmath/source/ElementsDockingWindow.cxx
+++ b/starmath/source/ElementsDockingWindow.cxx
@@ -167,9 +167,11 @@ const SmElementDescr SmElementsControl::m_aAttributesList[] =
{RID_ACUTEX, RID_ACUTEX_HELP}, {RID_GRAVEX, RID_GRAVEX_HELP}, {RID_BREVEX, RID_BREVEX_HELP},
{RID_CIRCLEX, RID_CIRCLEX_HELP}, {RID_DOTX, RID_DOTX_HELP}, {RID_DDOTX, RID_DDOTX_HELP},
{RID_DDDOTX, RID_DDDOTX_HELP}, {RID_BARX, RID_BARX_HELP}, {RID_VECX, RID_VECX_HELP},
+ {RID_HARPOONX, RID_HARPOONX_HELP},
{RID_TILDEX, RID_TILDEX_HELP}, {RID_HATX, RID_HATX_HELP}, {RID_CHECKX, RID_CHECKX_HELP},
{nullptr, nullptr},
- {RID_WIDEVECX, RID_WIDEVECX_HELP}, {RID_WIDETILDEX, RID_WIDETILDEX_HELP}, {RID_WIDEHATX, RID_WIDEHATX_HELP},
+ {RID_WIDEVECX, RID_WIDEVECX_HELP}, {RID_WIDEHARPOONX, RID_WIDEHARPOONX_HELP},
+ {RID_WIDETILDEX, RID_WIDETILDEX_HELP}, {RID_WIDEHATX, RID_WIDEHATX_HELP},
{RID_OVERLINEX, RID_OVERLINEX_HELP}, {RID_UNDERLINEX, RID_UNDERLINEX_HELP}, {RID_OVERSTRIKEX, RID_OVERSTRIKEX_HELP},
{nullptr, nullptr},
{RID_PHANTOMX, RID_PHANTOMX_HELP}, {RID_BOLDX, RID_BOLDX_HELP}, {RID_ITALX, RID_ITALX_HELP},
diff --git a/starmath/source/mathmlexport.cxx b/starmath/source/mathmlexport.cxx
index 9538a74c2e57..e5523c7ed122 100644
--- a/starmath/source/mathmlexport.cxx
+++ b/starmath/source/mathmlexport.cxx
@@ -1128,6 +1128,7 @@ void SmXMLExport::ExportAttributes(const SmNode *pNode, int nLevel)
case TWIDETILDE:
case TWIDEHAT:
case TWIDEVEC:
+ case TWIDEHARPOON:
{
// make these wide accents stretchy
AddAttribute(XML_NAMESPACE_MATH, XML_STRETCHY, XML_TRUE);
diff --git a/starmath/source/mathtype.cxx b/starmath/source/mathtype.cxx
index afedfc192e9b..65a7bb834009 100644
--- a/starmath/source/mathtype.cxx
+++ b/starmath/source/mathtype.cxx
@@ -3165,6 +3165,7 @@ void MathType::HandleAttributes(SmNode *pNode,int nLevel)
case TACUTE: //Not Exportable
case TGRAVE: //Not Exportable
case TCIRCLE: //Not Exportable
+ case TWIDEHARPOON: //Not Exportable
case TWIDETILDE: //Not Exportable
case TWIDEHAT: //Not Exportable
break;
@@ -3248,6 +3249,7 @@ void MathType::HandleAttributes(SmNode *pNode,int nLevel)
pS->WriteUChar( 20 );
break;
case TWIDEVEC:
+ case TWIDEHARPOON:
case TUNDERLINE:
case TWIDETILDE:
case TWIDEHAT:
diff --git a/starmath/source/node.cxx b/starmath/source/node.cxx
index eab5ff5ac1a7..ca5dd1a24a4e 100644
--- a/starmath/source/node.cxx
+++ b/starmath/source/node.cxx
@@ -2535,6 +2535,9 @@ void SmAttributNode::CreateTextFromNode(OUStringBuffer &rText)
case MS_VEC: // COMBINING RIGHT ARROW ABOVE
rText.append("vec ");
break;
+ case MS_HARPOON: // COMBINING RIGHT HARPOON ABOVE
+ rText.append("harpoon ");
+ break;
case MS_TILDE: // TILDE
case MS_COMBTILDE: // COMBINING TILDE
rText.append("tilde ");
diff --git a/starmath/source/ooxmlexport.cxx b/starmath/source/ooxmlexport.cxx
index 2d5a8e6253ca..f52c7275b399 100644
--- a/starmath/source/ooxmlexport.cxx
+++ b/starmath/source/ooxmlexport.cxx
@@ -167,6 +167,7 @@ void SmOoxmlExport::HandleAttribute( const SmAttributNode* pNode, int nLevel )
case TDDDOT:
case TWIDETILDE:
case TWIDEHAT:
+ case TWIDEHARPOON:
case TWIDEVEC:
case TBAR:
{
diff --git a/starmath/source/ooxmlimport.cxx b/starmath/source/ooxmlimport.cxx
index 4b2100439143..912136e69aa8 100644
--- a/starmath/source/ooxmlimport.cxx
+++ b/starmath/source/ooxmlimport.cxx
@@ -199,6 +199,9 @@ OUString SmOoxmlImport::handleAcc()
// shouldn't matter, but short above a longer expression doesn't look right
acc = "widevec";
break;
+ case MS_HARPOON:
+ acc = "wideharpoon";
+ break;
case MS_TILDE:
case MS_COMBTILDE:
acc = "widetilde";
diff --git a/starmath/source/parse.cxx b/starmath/source/parse.cxx
index 2c76ace91243..84c8508d4fe2 100644
--- a/starmath/source/parse.cxx
+++ b/starmath/source/parse.cxx
@@ -143,6 +143,7 @@ static const SmTokenTableEntry aTokenTable[] =
{ "gray", TGRAY, '\0', TG::Color, 0},
{ "green", TGREEN, '\0', TG::Color, 0},
{ "gt", TGT, MS_GT, TG::Relation, 0},
+ { "harpoon", THARPOON, MS_HARPOON, TG::Attribute, 5},
{ "hat", THAT, MS_HAT, TG::Attribute, 5},
{ "hbar" , THBAR, MS_HBAR, TG::Standalone, 5},
{ "iiint", TIIINT, MS_IIINT, TG::Oper, 5},
@@ -287,6 +288,7 @@ static const SmTokenTableEntry aTokenTable[] =
{ "vec", TVEC, MS_VEC, TG::Attribute, 5},
{ "white", TWHITE, '\0', TG::Color, 0},
{ "widebslash", TWIDEBACKSLASH, MS_BACKSLASH, TG::Product, 0 },
+ { "wideharpoon", TWIDEHARPOON, MS_HARPOON, TG::Attribute, 5},
{ "widehat", TWIDEHAT, MS_HAT, TG::Attribute, 5},
{ "wideslash", TWIDESLASH, MS_SLASH, TG::Product, 0 },
{ "widetilde", TWIDETILDE, MS_TILDE, TG::Attribute, 5},
@@ -1778,6 +1780,7 @@ std::unique_ptr<SmStructureNode> SmParser::DoAttribut()
break;
case TWIDEVEC :
+ case TWIDEHARPOON :
case TWIDEHAT :
case TWIDETILDE :
xAttr.reset(new SmMathSymbolNode(m_aCurToken));
diff --git a/starmath/source/rtfexport.cxx b/starmath/source/rtfexport.cxx
index 2f3839c54a39..87e51a3b9374 100644
--- a/starmath/source/rtfexport.cxx
+++ b/starmath/source/rtfexport.cxx
@@ -106,6 +106,7 @@ void SmRtfExport::HandleAttribute(const SmAttributNode* pNode, int nLevel)
case TDDDOT:
case TWIDETILDE:
case TWIDEHAT:
+ case TWIDEHARPOON:
case TWIDEVEC:
case TBAR:
{
diff --git a/starmath/uiconfig/smath/popupmenu/edit.xml b/starmath/uiconfig/smath/popupmenu/edit.xml
index 211776eea9a8..85a90675a703 100644
--- a/starmath/uiconfig/smath/popupmenu/edit.xml
+++ b/starmath/uiconfig/smath/popupmenu/edit.xml
@@ -166,10 +166,12 @@
<menu:menuitem menu:label="dddot a" menu:id=".uno:InsertCommandText?Text:string=dddot <?> "/>
<menu:menuitem menu:label="bar a" menu:id=".uno:InsertCommandText?Text:string=bar <?> "/>
<menu:menuitem menu:label="vec a" menu:id=".uno:InsertCommandText?Text:string=vec <?> "/>
+ <menu:menuitem menu:label="harpoon a" menu:id=".uno:InsertCommandText?Text:string=harpoon <?> "/>
<menu:menuitem menu:label="tilde a" menu:id=".uno:InsertCommandText?Text:string=tilde <?> "/>
<menu:menuitem menu:label="hat a" menu:id=".uno:InsertCommandText?Text:string=hat <?> "/>
<menu:menuseparator/>
<menu:menuitem menu:label="widevec abc" menu:id=".uno:InsertCommandText?Text:string=widevec {<?>} "/>
+ <menu:menuitem menu:label="wideharpoon abc" menu:id=".uno:InsertCommandText?Text:string=wideharpoon {<?>} "/>
<menu:menuitem menu:label="widetilde abc" menu:id=".uno:InsertCommandText?Text:string=widetilde {<?>} "/>
<menu:menuitem menu:label="widehat abc" menu:id=".uno:InsertCommandText?Text:string=widehat {<?>} "/>
<menu:menuitem menu:label="overline abc" menu:id=".uno:InsertCommandText?Text:string=overline {<?>} "/>
More information about the Libreoffice-commits
mailing list