Skip to content

Commit d8a5d62

Browse files
committed
Merge branch 'master' of github.com:wxMaxima-developers/wxmaxima
2 parents 576bc8d + 3b2d4bf commit d8a5d62

10 files changed

+49
-23
lines changed

ChangeLog

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
Current:
1+
19.12.0:
22
* wxMaxima now uses C++11 that makes the code more readable and helps
33
finding bugs
44
* If found wxMaxima now asks cppcheck to find bugs
@@ -7,6 +7,7 @@ Current:
77
* For Cmake>=3.10.0 the build system now asks cppcheck to find bugs.
88
* Changing the worksheet style was partially broken.
99
* A big number of additional bug fixes in various places
10+
* A config option that forces displaying all multiplication signs.
1011

1112
19.11.1:
1213
* Improved italian translation by Marco Ciampa

data/io.github.wxmaxima_developers.wxMaxima.appdata.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@
6464
<li>Opening the config dialogue since 19.11.0 unchecked "offer known answers"</li>
6565
<li>Changing the worksheet style was partially broken</li>
6666
<li>A big number of additional small bug fixes in various places</li>
67+
<li>A config option that forces displaying all multiplication signs</li>
6768
</ul>
6869
</description>
6970
</release>

src/Cell.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ Cell::Cell(Cell *group, Configuration **config, CellPointers *cellPointers)
6060
m_configuration(config),
6161
m_cellPointers(cellPointers)
6262
{
63+
m_isHidableMultSign = false;
6364
m_lastZoomFactor = -1;
6465
m_clientWidth_old = -1;
6566
m_next = NULL;
@@ -168,6 +169,8 @@ void Cell::CopyCommonData(const Cell & cell)
168169
m_forceBreakLine = cell.m_forceBreakLine;
169170
m_type = cell.m_type;
170171
m_textStyle = cell.m_textStyle;
172+
m_isHidden = cell.m_isHidden;
173+
m_isHidableMultSign = cell.m_isHidableMultSign;
171174
}
172175

173176
Cell *Cell::CopyList()

src/Cell.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -822,11 +822,13 @@ class Cell
822822
Currently the following items fall into this category:
823823
- parenthesis around fractions or similar things that clearly can be recognized as atoms
824824
- plus signs within numbers
825-
- most multiplication dots.
826825
- The output in folded GroupCells
827826
*/
828827
bool m_isHidden;
829828

829+
//! True means: This is a hidable multiplication sign
830+
bool m_isHidableMultSign;
831+
830832
/*! Determine if this cell contains text that isn't code
831833
832834
\return true, if this is a text cell, a title cell, a section, a subsection or a sub(n)section cell.

src/ConfigDialogue.cpp

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -374,6 +374,7 @@ void ConfigDialogue::SetProperties()
374374
m_getFont->SetToolTip(_("Font used for display in document."));
375375
m_getMathFont->SetToolTip(_("Font used for displaying math characters in document."));
376376
m_changeAsterisk->SetToolTip(_("Use centered dot and Minus, not Star and Hyphen"));
377+
m_hidemultiplicationSign->SetToolTip(_("Hide all multiplication signs that aren't really necessary for understanding the equation"));
377378
m_latin2Greek->SetToolTip(_("Change the text \"alpha\" and \"beta\" to the corresponding greek letter?"));
378379
m_defaultPort->SetToolTip(_("The default port used for communication between Maxima and wxMaxima."));
379380
m_undoLimit->SetToolTip(
@@ -480,6 +481,7 @@ void ConfigDialogue::SetProperties()
480481
m_showLength->SetSelection(configuration->ShowLength());
481482
m_autosubscript->SetSelection(configuration->GetAutosubscript_Num());
482483
m_changeAsterisk->SetValue(configuration->GetChangeAsterisk());
484+
m_hidemultiplicationSign->SetValue(configuration->HidemultiplicationSign());
483485
m_latin2Greek->SetValue(configuration->Latin2Greek());
484486
m_enterEvaluates->SetValue(configuration->EnterEvaluates());
485487
m_saveUntitled->SetValue(saveUntitled);
@@ -531,7 +533,7 @@ wxPanel *ConfigDialogue::CreateWorksheetPanel()
531533
wxPanel *panel = new wxPanel(m_notebook, -1);
532534

533535
wxFlexGridSizer *grid_sizer = new wxFlexGridSizer(10, 2, 5, 5);
534-
wxFlexGridSizer *vsizer = new wxFlexGridSizer(31, 1, 5, 5);
536+
wxFlexGridSizer *vsizer = new wxFlexGridSizer(32, 1, 5, 5);
535537

536538
wxStaticText *pw = new wxStaticText(panel, -1, _("Default plot size for new maxima sessions:"));
537539
wxBoxSizer *PlotWidthHbox = new wxBoxSizer(wxHORIZONTAL);
@@ -618,6 +620,9 @@ wxPanel *ConfigDialogue::CreateWorksheetPanel()
618620
m_changeAsterisk = new wxCheckBox(panel, -1, _("Use centered dot character for multiplication"));
619621
vsizer->Add(m_changeAsterisk, 0, wxALL, 5);
620622

623+
m_hidemultiplicationSign = new wxCheckBox(panel, -1, _("Hide multiplication signs, if possible"));
624+
vsizer->Add(m_hidemultiplicationSign, 0, wxALL, 5);
625+
621626
m_latin2Greek = new wxCheckBox(panel, -1, _("Change names of greek letters to greek letters"));
622627
vsizer->Add(m_latin2Greek, 0, wxALL, 5);
623628

@@ -1186,6 +1191,7 @@ void ConfigDialogue::WriteSettings()
11861191
config->Write(wxT("fixedFontTC"), m_fixedFontInTC->GetValue());
11871192
configuration->OfferKnownAnswers(m_offerKnownAnswers->GetValue());
11881193
configuration->SetChangeAsterisk(m_changeAsterisk->GetValue());
1194+
configuration->HidemultiplicationSign(m_hidemultiplicationSign->GetValue());
11891195
configuration->Latin2Greek(m_latin2Greek->GetValue());
11901196
configuration->EnterEvaluates(m_enterEvaluates->GetValue());
11911197
config->Write(wxT("saveUntitled"), m_saveUntitled->GetValue());

src/ConfigDialogue.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -312,6 +312,7 @@ class ConfigDialogue : public wxPropertySheetDialog
312312
wxCheckBox *m_fixedFontInTC;
313313
wxCheckBox *m_unixCopy;
314314
wxCheckBox *m_changeAsterisk;
315+
wxCheckBox *m_hidemultiplicationSign;
315316
wxCheckBox *m_latin2Greek;
316317
wxCheckBox *m_useJSMath;
317318
wxCheckBox *m_useUnicodeMaths;

src/Configuration.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ Configuration::Configuration(wxDC *dc) :
4343
m_BackgroundBrush(*wxWHITE_BRUSH)
4444

4545
{
46+
m_hidemultiplicationsign = true;
4647
m_autoSaveAsTempFile = false;
4748
m_inLispMode = false;
4849
m_htmlEquationFormat = mathJaX_TeX;
@@ -360,6 +361,7 @@ void Configuration::ReadConfig()
360361
config->Read(wxT("documentclassoptions"), &m_documentclassOptions);
361362
config->Read(wxT("latin2greek"), &m_latin2greek);
362363
config->Read(wxT("enterEvaluates"), &m_enterEvaluates);
364+
config->Read(wxT("hidemultiplicationsign"), &m_hidemultiplicationsign);
363365

364366
{
365367
int tmp;

src/Configuration.h

Lines changed: 19 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -511,19 +511,29 @@ class Configuration
511511
redrawn.
512512
*/
513513
bool GetPrinting() const
514-
{ return m_printing; }
515-
514+
{ return m_printing; }
515+
516516
bool GetMatchParens() const
517-
{ return m_matchParens; }
517+
{ return m_matchParens; }
518518

519519
bool GetChangeAsterisk() const
520-
{ return m_changeAsterisk; }
521-
520+
{ return m_changeAsterisk; }
521+
522522
void SetChangeAsterisk(bool changeAsterisk)
523-
{
524-
wxConfig::Get()->Write(wxT("changeAsterisk"), m_changeAsterisk = changeAsterisk);
525-
}
523+
{
524+
wxConfig::Get()->Write(wxT("changeAsterisk"), m_changeAsterisk = changeAsterisk);
525+
}
526+
527+
bool HidemultiplicationSign() const
528+
{
529+
return m_hidemultiplicationsign;
530+
}
526531

532+
void HidemultiplicationSign(bool show)
533+
{
534+
wxConfig::Get()->Write(wxT("hidemultiplicationsign"), m_hidemultiplicationsign = show);
535+
}
536+
527537
bool Latin2Greek() const
528538
{return m_latin2greek;}
529539

@@ -910,6 +920,7 @@ class Configuration
910920
bool m_useUnicodeMaths;
911921
bool m_indentMaths;
912922
bool m_abortOnError;
923+
bool m_hidemultiplicationsign;
913924
bool m_offerKnownAnswers;
914925
int m_defaultPort;
915926
wxString m_documentclass;

src/MathParser.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -771,7 +771,7 @@ Cell *MathParser::ParseTag(wxXmlNode *node, bool all)
771771
else if (tagName == wxT("h"))
772772
{ // Hidden cells (*)
773773
tmp = ParseText(node->GetChildren());
774-
tmp->m_isHidden = true;
774+
tmp->m_isHidableMultSign = true;
775775
}
776776
else if (tagName == wxT("p"))
777777
{ // Parenthesis

src/TextCell.cpp

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -345,7 +345,6 @@ TextCell::TextCell(const TextCell &cell):
345345
CopyCommonData(cell);
346346
m_forceBreakLine = cell.m_forceBreakLine;
347347
m_bigSkip = cell.m_bigSkip;
348-
m_isHidden = cell.m_isHidden;
349348
m_lastZoomFactor = -1;
350349
m_fontSizeLabel = -1;
351350
m_displayedDigits_old = -1;
@@ -487,7 +486,7 @@ void TextCell::RecalculateWidths(int fontsize)
487486
m_height = m_height + 2 * MC_TEXT_PADDING;
488487

489488
/// Hidden cells (multiplication * is not displayed)
490-
if (m_isHidden)
489+
if ((m_isHidden) || ((configuration->HidemultiplicationSign()) && m_isHidableMultSign))
491490
{
492491
m_height = 0;
493492
m_width = m_width / 4;
@@ -501,10 +500,10 @@ void TextCell::RecalculateWidths(int fontsize)
501500
void TextCell::Draw(wxPoint point)
502501
{
503502
Cell::Draw(point);
504-
if (DrawThisCell(point) && !m_isHidden)
503+
Configuration *configuration = (*m_configuration);
504+
if (DrawThisCell(point) &&
505+
!(m_isHidden || ((configuration->HidemultiplicationSign()) && m_isHidableMultSign)))
505506
{
506-
507-
Configuration *configuration = (*m_configuration);
508507
wxDC *dc = configuration->GetDC();
509508

510509
if (m_width == -1 || m_height == -1 || m_fontSize != m_lastCalculationFontSize)
@@ -1004,9 +1003,8 @@ wxString TextCell::ToTeX()
10041003
text.Replace(wxT("\x2192"), mathModeStart + wxT("\\rightarrow") + mathModeEnd);
10051004
text.Replace(wxT("\x2794"), mathModeStart + wxT("\\longrightarrow") + mathModeEnd);
10061005

1007-
// m_IsHidden is set for multiplication signs and parenthesis that
1008-
// don't need to be shown
1009-
if (m_isHidden)
1006+
// m_IsHidden is set for parenthesis that don't need to be shown
1007+
if (m_isHidden || (((*m_configuration)->HidemultiplicationSign()) && m_isHidableMultSign))
10101008
{
10111009
// Normally in TeX the spacing between variable names following each other directly
10121010
// is chosen to show that this is a multiplication.
@@ -1265,7 +1263,7 @@ wxString TextCell::ToMathML()
12651263
text = XMLescape(wxT("(") + m_userDefinedLabel + wxT(")"));
12661264

12671265
// If we didn't display a multiplication dot we want to do the same in MathML.
1268-
if (m_isHidden)
1266+
if (m_isHidden || (((*m_configuration)->HidemultiplicationSign()) && m_isHidableMultSign))
12691267
{
12701268
text.Replace(wxT("*"), wxT("&#8290;"));
12711269
text.Replace(wxT("\xB7"), wxT("&#8290;"));
@@ -1354,7 +1352,7 @@ wxString TextCell::ToOMML()
13541352
wxString text = XMLescape(m_displayedText);
13551353

13561354
// If we didn't display a multiplication dot we want to do the same in MathML.
1357-
if (m_isHidden)
1355+
if (m_isHidden || (((*m_configuration)->HidemultiplicationSign()) && m_isHidableMultSign))
13581356
{
13591357
text.Replace(wxT("*"), wxT("&#8290;"));
13601358
text.Replace(wxT("\xB7"), wxT("&#8290;"));
@@ -1440,7 +1438,8 @@ wxString TextCell::ToXML()
14401438
{
14411439
wxString tag;
14421440
wxString flags;
1443-
if (m_isHidden)tag = _T("h");
1441+
if (m_isHidden || (m_isHidableMultSign))
1442+
tag = _T("h");
14441443
else
14451444
switch (GetStyle())
14461445
{

0 commit comments

Comments
 (0)