Commit Graph

315 Commits

Author SHA1 Message Date
Yorik van Havre
aa52a3f55c 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
37952a5949 Spreadsheet: Add test for undo alias issue 2021-01-30 14:04:57 +01:00
Benjamin Nauck
f4c2539765 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
24c6183661 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
98414334ad [Spreadsheet] Add unit tests for new input behaviour 2021-01-20 18:55:27 +01:00
Benjamin Nauck
dbedb21676 [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
Benjamin Nauck
d525b29fa5 [Spreadsheet] Remove alias from dynamic properties on removeRows/Columns
When removing a row in a spreadsheet which has an assigned alias, the
alias will not be removed from the list of dynamic properties.

This makes it impossible to create a new alias which uses the same name
even if the original was removed (using removeRows/removeColumns)

Fixes #4492
2021-01-04 22:10:58 +01:00
Yorik van Havre
5a322d75cb Merged crowdin translations 2020-12-23 15:13:05 +01:00
Yorik van Havre
5a974f824c Updated ts files 2020-12-23 14:51:04 +01:00
luz paz
7b6af35e6c Spreadsheet: Issue #0004473: Expose openCommand() to translation
Continuing the work to expose the undo/redo functionality to translation. This commit does so for the Spreadsheet Wb.  
Ticket: https://tracker.freecadweb.org/view.php?id=4473
2020-12-01 14:53:35 +01:00
luz paz
5bd5f3a963 Spreadsheet: Fix header uniformity + trailing whitespace
[skip ci]
2020-11-27 19:39:06 +01:00
Yorik van Havre
e76c857036 Merged crowdin translations 2020-11-10 14:58:06 +01:00
luz paz
44636aca2f Spreadsheet: Make all file headers uniform [skip-ci] 2020-11-03 14:52:53 +01:00
Yorik van Havre
7c9e0f3a99 Merged crowdin translations 2020-10-28 12:04:37 +01:00
Yorik van Havre
089ed768cc Merged crowdin translations 2020-09-30 14:37:02 +02:00
Cheuksan Wang
0aa759b5c5 Move the aliases before other content of cells
When a user performs insert rows, remove rows, insert columns, or
remove rows, we need to move multiple cells as a batch. The cells are
moved sequentially. For each cell, its dependent alias positions are
looked up and dependencies are added.  However, those cells with
aliases may be moved later in the batch. Thus the earlier dependencies
become wrong. This commit fixes this bug by moving all the aliases
before moving the cells. Unit tests are added to for this bug.

fixes issue #4429
2020-09-13 11:58:54 +02:00
wmayer
06152bf12a Spreadsheet: [skip ci] disable unused function 2020-09-09 21:18:31 +02:00
wmayer
556630ffdf Spreadsheet: [skip ci] use global scheme to display quantities in a spreadsheet table 2020-09-09 16:28:55 +02:00
luz paz
59e3ea096e Crowdin: Merge new translations [skip-ci] 2020-08-07 17:17:35 +02:00
wmayer
421f6c52cb Coverity: Dereference after null check 2020-07-20 17:34:25 +02:00
wmayer
dff82ea08a 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
811efa6107 PVS: V690 The copy constructor is declared as private in the 'PropertySheet' class, but the default copy assignment operator will still be generated by compiler. It is dangerous to use such a class. 2020-07-18 10:59:28 +02:00
luz paz
3dfae3ba46 Merged crowdin translations 2020-07-13 14:49:45 +02:00
Yorik van Havre
fbfe821e8c Updated master ts files 2020-07-13 13:20:21 +02:00
Tobias Bossert
165933bced fixed xlsx import issue, now compatible with python 2.x and 3.x 2020-07-06 16:28:17 +02:00
Tobias Bossert
603b19d7c8 Fixed import from XLSX files
since getText() already returns a string, the encode() function results in a byte object which is not compatible with setAlias().
2020-07-06 16:28:17 +02:00
wmayer
2c56e3c9fa Spreadsheet: [skip ci] avoid to show scroll buttons in PropertiesDialog when a style sheet is used 2020-06-28 18:24:16 +02:00
donovaly
ca13b24673 [Spreadsheet] add visible alias check
as discussed in https://forum.freecadweb.org/viewtopic.php?p=408992#p408981
visible feedback is missing for the Alias field. This PR add it and also adapts the UI label style.
2020-06-19 12:17:04 +02:00
wmayer
f3b460e42e boost: fix for boost < 1.60 2020-06-15 19:38:39 +02:00
wmayer
eced0cb568 Qt5: QDesktopWidget is deprecated use QScreen [-Wdeprecated-declarations] 2020-06-12 17:51:33 +02:00
wmayer
4ec45b545e boost 1.73.0: The practice of declaring the Bind placeholders (_1, _2, ...) in the global namespace is deprecated 2020-06-12 17:51:33 +02:00
wmayer
c814eb1a50 Qt5: 'QString::null' is deprecated: use QString() [-Wdeprecated-declarations] 2020-06-12 17:51:33 +02:00
Yorik van Havre
28b51cf28a Merged crowdin translations 2020-04-29 16:08:23 +02:00
Yorik van Havre
693e374f99 Updated source ts files 2020-04-29 15:41:26 +02:00
wmayer
5e9869aaef Spreadsheet: [skip ci] add generated Imp files to repository to avoid possible build failures 2020-04-16 12:24:38 +02:00
luz.paz
2ed5786d07 [skip-ci] Various typo fixes
Found via codespell  v1.17.0.dev0  
```
codespell -q 3 -L aci,ake,aline,alle,alledges,alocation,als,ang,anid,ba,beginn,behaviour,bloaded,byteorder,calculater,cancelled,cancelling,cas,cascade,centimetre,childs,colour,colours,commen,connexion,currenty,dof,doubleclick,dum,eiter,elemente,ende,feld,finde,findf,freez,hist,iff,indicies,initialisation,initialise,initialised,initialises,initialisiert,ist,kilometre,lod,mantatory,methode,metres,millimetre,modell,nd,noe,normale,normaly,nto,numer,oder,orgin,orginx,orginy,ot,pard,pres,programm,que,recurrance,rougly,seperator,serie,sinc,strack,substraction,te,thist,thru,tread,uint,unter,vertexes,wallthickness,whitespaces -S ./.git,*.po,*.ts,./ChangeLog.txt,./src/3rdParty,./src/Mod/Assembly/App/opendcm,./src/CXX,./src/zipios++,./src/Base/swig*,./src/Mod/Robot/App/kdl_cp,./src/Mod/Import/App/SCL,./src/WindowsInstaller,./src/Doc/FreeCAD.uml
```
2020-04-07 18:17:03 +02:00
wmayer
ec8b1bc072 [skip ci] use QLocale class consistently to make it possible to change it application-wide 2020-03-26 16:37:45 +01:00
mwganson
40f50736f7 [Spreadsheet] [skip ci] fix bug where aliases renamed in the spreadsheet were not getting renamed in sketcher constraints 2020-03-22 15:20:53 +01:00
mwganson
953ae1e6e9 [Spreadsheet] fix tooltip to show newline instead of \n characters 2020-03-13 15:40:30 +01:00
mwganson
973caf90ec [Spreadsheet] add tooltip for alias line edit. Also, per user request, make it so when creating a new spreadsheet it is open for viewing/editing 2020-03-13 15:40:30 +01:00
mwganson
1ee2c4d835 [Spreadsheet] fix minor bug where failure to set alias message appears erroneously. Fixes #4287 2020-03-13 15:40:30 +01:00
mwganson
520b5cc0aa [Spreadsheet] fix bug where duplicate / bad aliases were being allowed. 2020-03-12 15:47:54 +01:00
mwganson
c337cfeec2 [Spreadsheet] add alias line edit next to contents line edit -- add back in some inadvertently removed code 2020-03-12 15:47:54 +01:00
mwganson
de1cc43b0b [Spreadsheet] add alias line edit next to contents line edit 2020-03-12 15:47:54 +01:00
Yorik van Havre
0c1289282b Merged latest translations from crowdin 2020-03-05 11:58:03 -03:00
donovaly
f2c83ac46b remove program-specific SVG namespaces
while fixing a SVG export issue for techDraw I noticed that some SVG files have program-dependent (and thus not clean) code in it. These are traces of the programs Sodipodi and Inkscape, like e.g. this line:
inkscape:export-filename="/home/yorik/PartDesign_Groove.png

This is unnecessary and FC should not use program-dependent code in the SVG but use instead plain SVG strictly following the SVG specification.

This PR transforms the few affected SVGs to a plain version.
2020-02-07 07:34:49 -05:00
wmayer
ec18f070d1 Spreadsheet: [skip ci] fix regression when pressing Return/Enter when completion list is shown 2020-01-01 10:43:12 +01:00
wmayer
40ed5df69f Spreadsheet: [skip ci] fix inconsistent German translation 2019-12-31 17:37:49 +01:00
Zheng, Lei
d5a4996d25 App: fix Expression _moveCells()
The problem is caused by not refreshing ObjectIdentifier internal cache
after change.
2019-12-31 15:23:03 +01:00
wmayer
e900384250 declare getMDIView and getMDIViewPage as const 2019-12-29 13:55:39 +01:00