Commit Graph

38 Commits

Author SHA1 Message Date
Benjamin Nauck
8a2cfc268e [Base] Remove includes to StdStlTools.h as that's not needed anymore
std::make_unique was introduced in c++14, so no need to use the back
ported version
2021-03-06 21:20:32 +01:00
Benjamin Nauck
93d2758fbd [Spreadsheet] Use std::shared_ptr instead of boost::shared_ptr
There's no need to use boost version when stl has support for shared_ptr
2021-03-06 19:32:03 +01:00
Yorik van Havre
321fd7c840 Merge pull request #4215 from hyarion/feature-spreadsheet-equal-prefix-for-expressions
[Spreadsheet] Only evaluate cell values when prefixed with '='
2021-02-05 13:29:57 +01:00
Benjamin Nauck
aa91457491 Spreadsheet: Allow alias removed by undo to be reused
Fixes issue descripted in the forum post:
https://forum.freecadweb.org/viewtopic.php?f=3&t=54009
2021-01-30 14:04:57 +01:00
Benjamin Nauck
8589c4e782 Spreadsheet: make setContent use unique_ptr and cleanup
Make `Cell::setContent` use `unique_ptr` and
`make_unique` for expressions to avoid potential memory
leaks.
Also renames `expo` to `newExpr` to avoid mixup with the
member variable `expression`.

Both changes was made at the request of @chennes.
2021-01-20 18:55:27 +01:00
Benjamin Nauck
7fdbd87b13 [Spreadsheet] Only evaluate cell values when prefixed with '='
This commit only changes the user interaction with spreadsheet and does
not affect backwards compatibility (as valid cell expressions are
prefixed with '=' when serialized).

This fixes [#4156](https://tracker.freecadweb.org/view.php?id=4156),
which is discussed in the forum thread:
https://forum.freecadweb.org/viewtopic.php?f=3&t=39665

There has been additional logic added to handle numbers and simple
fractions without using '='.
The behaviour is what is expected by the spreadsheet test cases
and in line with how other spreadsheet software works.
The '-prefix can still be used to force the input to be handled as
as string instead.

Example of numbers and fractions handled are:
  3
  2mm
  1/8
  1mm/2
  1/2mm
  2/m
  1mm/2s

More complex expressions are not handled without '=' and will be stored
as strings instead, for example:
  2 / 3 / 2
  1 + 1/3
2021-01-20 18:55:27 +01:00
luz paz
068997112c Spreadsheet: Make all file headers uniform [skip-ci] 2020-11-03 14:52:53 +01:00
wmayer
bd58cfe81a PVS: V506 Pointer to local variable '_value' is stored outside the scope of this variable. Such a pointer will become invalid. 2020-07-18 10:59:28 +02:00
wmayer
e14e5b845e [skip ci] use QLocale class consistently to make it possible to change it application-wide 2020-03-26 16:37:45 +01:00
Zheng, Lei
c061a4df7e Spreadsheet: improve cyclic dependency exception handling 2019-10-07 17:24:30 +02:00
wandererfan
1e5b8df2eb [SS]Fix Integer Formatted Value 2019-10-01 20:34:11 -04:00
Zheng, Lei
38c47d6e95 Expression: split Expression.h to ExpressionParser.h
Split Expression details into a separate header to reduce recompilation
time on changes.
2019-09-28 15:30:41 +02:00
wandererfan
b1b1c4f0df [TD][SS]Fix 4131 SS formatting in TD View 2019-09-20 12:56:26 -04:00
wmayer
e48c52c480 force strict ISO C++ (-Wpedantic)
for Drawing, Image, Inspection, Mesh, MeshPart, Part, Path, Points, Raytracing, ReverseEngineering, Spreadsheet, Start, Surface, Web

TODO: fix several -Woverflow in area
2019-09-18 11:32:42 +02:00
Zheng, Lei
11321bb996 Spreadsheet changes
Various changes to support in-place editing, and more.
2019-08-17 15:15:47 +02:00
Zheng, Lei
b4751145b4 Spreadsheet: convert PropertySheet to link type property
PropertySheet is changed to derive from PropertyExpressionContainer,
which makes it a link type property that is capable of external linking.
It now relies on the unified link property API to manage object
depenency, and tracking of object life time, relabeling, etc.

This patch also includes various fix and improvement of Spreadsheet,
such as improved recompute efficiency, correct handling of document
label change, etc.
2019-08-17 14:52:09 +02:00
wmayer
d4bf7d1f6f Replace Base::Exception with appropriate subclass 2018-11-14 18:02:49 +01:00
Eivind Kvedalen
edb44f5051 Spreadsheet: Fixed issue #3361. 2018-07-31 16:11:37 -03:00
luz.paz
39eb4fc5a0 Spreadsheet: typo fixes 2018-04-30 08:30:20 +02:00
hgutsche
19c82acb60 Address is actually spelled with two "d" 2017-02-28 18:52:04 +01:00
hgutsche
7867096e8b fix typo and and add explanation for a cell address 2017-02-28 18:52:04 +01:00
hgutsche
201c9d89b0 Some fixes for doygen syntax errors and some configuration to make it run smoother under Windows 2017-02-28 18:52:04 +01:00
wmayer
47b41a7883 fixes #0002460: Use keyword 'explicit' for Quantity constructor 2016-11-05 23:21:42 +01:00
Eivind Kvedalen
7a58bead5c Spreadsheet: Fixed undo/redo (issue #2483). 2016-04-04 19:58:19 +02:00
Eivind Kvedalen
ae111d11b5 Spreadsheet: Removed own expression parser and instead use the one in App. 2016-04-02 12:01:04 +02:00
Eivind Kvedalen
eff4458332 Spreadsheet: Fixed crash when invalid unit was given as input. 2016-04-02 12:01:04 +02:00
Eivind Kvedalen
b214551b6d Spreadsheet: Expose parse error to user. 2016-04-02 12:01:04 +02:00
Eivind Kvedalen
7da5451028 Spreadsheet: Refactored code to use AtomicPropertyChangeInterface. 2016-02-18 16:54:40 +01:00
Eivind Kvedalen
7f417fe095 Spreadsheet: Added alias as tooltip. Made background of cell light yellow if an alias is defined for it. Can be overridden by setting a background color. 2015-10-11 09:41:14 +02:00
Eivind Kvedalen
e39578c742 Spreadsheet: Replaced own Expression classed by the ones in App. 2015-09-21 14:51:11 +02:00
Eivind Kvedalen
e34884b1a8 Spreadsheet: Removed 'using namespace App'; preparation for moving Expression
classes to App.
2015-09-21 14:51:00 +02:00
Eivind Kvedalen
b99cd32be5 Spreadsheet: Made freecad_dynamic_cast calls unambiguous (preparation for next commit). 2015-09-21 14:50:58 +02:00
wmayer
96219e72b5 + fix various warnings 2015-08-30 11:48:26 +02:00
wmayer
0a06b2b703 + fix various warnings 2015-08-29 23:01:19 +02:00
Eivind Kvedalen
b4dc4d97f4 - Self-reference bug
- Refactoring/clean-up of code
- Dependency tracking of aliased cells
- Various resolution errors
- Rewriting of ranges when columns/rows are inserted/removed
- References to aliases keep their units.
2015-03-04 22:18:20 +01:00
Eivind Kvedalen
f57ea14ac8 Spreadsheet: docDeps property was not properly maintained, resulting in spurious links to other objects. 2015-02-17 11:46:12 +01:00
Eivind Kvedalen
1f347b53cf + Fixed merge of cells to retain value in upper left cell+ Replaced std::map::at() with iterators and find. Removed some superfluous calls to std::map::find()
+ Visual Studio fixes
+ Fixed return values
+ Removed unused variables
2015-02-13 21:53:59 +01:00
Eivind Kvedalen
935ec5b034 Initial implementation of Spreadsheet module (C++ version) by Eivind Kvedalen.
Various fixes for Windows by
Peter Lama <peterldev94@gmail.com>
Werner Mayer <wmayer@users.sourceforge.net>
2015-02-13 21:53:58 +01:00