Commit Graph

808 Commits

Author SHA1 Message Date
Ian 'z0r0' Abreu
df20bc6609 Finalizing Python interface bindings for Robot, Spreadsheet, Surface. 2025-08-31 15:41:14 -04:00
Frank David Martínez M
0f2ea5588c [Core] Fix #15558: Direct expression in ternary operator (#22938)
* [Core] Fix #15558: Direct expression in ternary operator

* [Core] Added tests for Non-Numeric conditions in ternary op.

* [Core] prevent relational operator chains at grammar level.

* [Core] Rewrite expressions grammar as a layered grammar.

* [Core] Revert to left associative relops (like C/C++) plus tests.
2025-08-25 21:52:42 +02:00
xtemp09
887e7bd595 Simplify repr() function 2025-08-25 10:38:39 -05:00
wmayer
a8959de56d Sheet: Verify that UnitExpression is valid
The crash happens because the UnitExpression is null and thus segfaults when trying to access the unit and scalar value.
This fixes https://github.com/FreeCAD/FreeCAD/issues/23222
2025-08-20 10:15:08 +02:00
Chris Hennes
40b1ea294c Update translations 2025-08-18 17:55:24 +02:00
Max Wilfinger
1850c5dc0f Fix missed strings for UI consistency
Fix ellipsis rendering
2025-08-08 06:37:59 -05:00
Frank David Martínez M
d4c38502d8 [Core] Add Boolean Functions to expressions (AND, OR, NOT) (#22506)
* [Core] Add Boolean Functions to expressions (AND, OR, BOOL, NOT)

* [Core] Add `if` function to expressions to overcome ternary operator limitations

* [Core] Update expressions grammar to recognize relational operations as arguments

* [Core] The `if` function has been removed as no consensus was reached regarding its convenience or necessity. Its inclusion was considered potentially confusing or redundant.

* [Core] Make boolean cast based on Confusion threshold.
2025-08-05 03:50:13 +00:00
xtemp09
81fa85370a [Spreadsheet] Add icons to the context menu (#22773)
* [Spreadsheet] Add icons to the context menu

This commit adds the following icons:
- edit-cut
- edit-copy
- edit-paste
- edit-delete
- merge-cells
- split-cell
- view-refresh

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2025-08-02 14:57:53 +02:00
Ian Abreu
5b272ae393 Core: Generation of Spreadsheet interface bindings (#22624)
* Initial commit of spreadsheet

---------

Co-authored-by: Chris Hennes <chennes@pioneerlibrarysystem.org>
2025-07-22 18:34:42 -05:00
Max Wilfinger
53c367f4b5 Update src/Mod/Spreadsheet/Gui/Workbench.cpp
Co-authored-by: Ryan K <114723629+ryankembrey@users.noreply.github.com>
2025-06-30 10:35:16 -05:00
Max Wilfinger
c7952719f3 Update src/Mod/Spreadsheet/Gui/Workbench.cpp
Co-authored-by: Ryan K <114723629+ryankembrey@users.noreply.github.com>
2025-06-30 10:35:16 -05:00
Max Wilfinger
2f8b4f0106 Update src/Mod/Spreadsheet/Gui/Workbench.cpp
Co-authored-by: Ryan K <114723629+ryankembrey@users.noreply.github.com>
2025-06-30 10:35:16 -05:00
Max Wilfinger
ee926ba67f Update src/Mod/Spreadsheet/Gui/Workbench.cpp
Co-authored-by: Ryan K <114723629+ryankembrey@users.noreply.github.com>
2025-06-30 10:35:16 -05:00
Max Wilfinger
4332a95b49 Update src/Mod/Spreadsheet/Gui/Workbench.cpp
Co-authored-by: Ryan K <114723629+ryankembrey@users.noreply.github.com>
2025-06-30 10:35:16 -05:00
Max Wilfinger
87c7dd6163 Update src/Mod/Spreadsheet/Gui/Command.cpp
Co-authored-by: Ryan K <114723629+ryankembrey@users.noreply.github.com>
2025-06-30 10:35:16 -05:00
Max Wilfinger
7eb21b9951 Update src/Mod/Spreadsheet/Gui/Command.cpp
Co-authored-by: Ryan K <114723629+ryankembrey@users.noreply.github.com>
2025-06-30 10:35:16 -05:00
Max Wilfinger
bea7c631e8 Update src/Mod/Spreadsheet/Gui/Command.cpp
Co-authored-by: Ryan K <114723629+ryankembrey@users.noreply.github.com>
2025-06-30 10:35:16 -05:00
Max Wilfinger
6c32e8ae07 Update src/Mod/Spreadsheet/Gui/Command.cpp
Co-authored-by: Ryan K <114723629+ryankembrey@users.noreply.github.com>
2025-06-30 10:35:16 -05:00
Max Wilfinger
b90cbcca08 Update src/Mod/Spreadsheet/Gui/Command.cpp
Co-authored-by: Ryan K <114723629+ryankembrey@users.noreply.github.com>
2025-06-30 10:35:16 -05:00
Max Wilfinger
9c6aa7267f Update src/Mod/Spreadsheet/Gui/Command.cpp
Co-authored-by: Ryan K <114723629+ryankembrey@users.noreply.github.com>
2025-06-30 10:35:16 -05:00
Max Wilfinger
07c35c1a83 Update src/Mod/Spreadsheet/Gui/Command.cpp
Co-authored-by: Ryan K <114723629+ryankembrey@users.noreply.github.com>
2025-06-30 10:35:16 -05:00
Max Wilfinger
27c4cf52e0 Update src/Mod/Spreadsheet/Gui/Command.cpp
Co-authored-by: Ryan K <114723629+ryankembrey@users.noreply.github.com>
2025-06-30 10:35:16 -05:00
Max Wilfinger
71ec5e8050 Update src/Mod/Spreadsheet/Gui/Workbench.cpp
Co-authored-by: Ryan K <114723629+ryankembrey@users.noreply.github.com>
2025-06-30 10:35:16 -05:00
Max Wilfinger
c5ddbb8a16 Spreadsheet: Update UI strings for consistency 2025-06-30 10:35:16 -05:00
Kacper Donat
a1f0d7b5fc Spreadsheet Fix '=' regression in spreadsheets (#22146)
* Tools: Add ExpressionLineEdit to QtDesigner plugin

* Spreadsheet: Only use validator when when prefix is not '='

---------

Co-authored-by: wmayer <wmayer@freecad.org>
2025-06-23 22:20:25 +02:00
Benjamin Nauck
0fd4f2bac6 Spreadsheet: Only use validator when when prefix is not '=' 2025-06-23 16:14:35 +02:00
xtemp09
be542053e1 [Spreadsheet] Replace override cursor with QGraphicsItem::setCursor (#22097)
* [Spreadsheet] Replace the risky use of override cursor with
QGraphicsItem::setCursor

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2025-06-21 12:57:07 +02:00
Ladislav Michl
54fae95685 Revert "Sheet: Disable zooming"
This reverts 0c4fb60 ("Sheet: Disable zooming") as it breaks some
users workflow.
2025-06-11 06:54:59 +02:00
Kacper Donat
ea9ca39db9 Spreadsheet: Fix cursor being stuck resize state when scaled 2025-06-11 06:54:59 +02:00
wmayer
7ac57656e1 Sheet: Further cleanup in Sheet class
With PR 21445 an unused function has been removed. But the underlying
class member isn't used anywhere else and can be removed as well.
2025-06-05 10:15:58 +02:00
wmayer
5763e959f6 Sheet: Improve handling of unsupported formulas
With the example file of issue 20299 the parser stops with an exception
and reads in the formulas only partially. This PR doesn't fix the issue
but avoids to raise an exception so that as much as possible will be
read in. For unsupported formulas a suitable message is printed with
the content of the cell.
2025-06-05 10:15:28 +02:00
wmayer
e2f39f59be Sheet: Fix crash in Cell::setContent
This fixes issue 14697
2025-06-05 10:15:24 +02:00
wmayer
74f09bbf8d Sheet: Fix reading xlsx files
for the specs of the XLSX file format see:
https://jkp-ads.com/articles/excel2007fileformat00.aspx or
https://www.data2type.de/xml-xslt-xslfo/spreadsheetml/xlsx-format

In order to find the correct sheet file one has to first read-in
xl/_rels/workbook.xml.rels and save the relations of Id and Target.
The file xl/workbook.xml contains a list of sheet elements where for
each element the attribute 'r:id' is set. This attribute can be used
to look up for the actual data file.

This fixes issue 19757
2025-06-05 10:14:42 +02:00
wmayer
4d123e8ae9 Sheet: Disable zooming
With PR 16130 the zooming capability was added to spreadsheet view.

The SheetTableView is added to a QGraphicsScene of a QGraphicsView
that provides the method scale(). However, this causes some problems
with header of the table view and makes resizing columns or rows
very unintuitive.

A correctly working table view is probably more important than the
possibility to zoom in or out and that's why the latter will be
disabled.

This fixes issue 19863
2025-06-05 10:14:03 +02:00
Gonzalo
1f11be1059 Avoid error importing spreadsheet with deleted sheet (#19757)
This fix was proposed by pageeddie on https://github.com/FreeCAD/FreeCAD/issues/19757
2025-06-04 21:54:31 -05:00
Ladislav Michl
a0917bcc7c Base: Units: introduce unit one
Dimensionless quantities have all exponents equal to zero.
Such quantities are simply numbers. The associated unit is
the unit one, symbol 1, although this is rarely explicitly
written.

See chapter 2.3.3 Dimensions of quantities, The International
System of Units, 9th edition.
2025-06-03 09:31:38 +02:00
pre-commit-ci[bot]
8f5c56ea28 [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
2025-06-02 09:53:47 +00:00
Yorik van Havre
640642eed2 Translations: Merged crowdin translations 2025-06-02 11:48:26 +02:00
Yorik van Havre
26e16765b0 Translations: updated ts files 2025-06-02 11:07:28 +02:00
Pieter Hijma
8c01d577e7 Core: Update expressions on property rename
This includes both expressions in generic containers and in
spreadsheets.
2025-05-26 18:11:27 +02:00
mosfet80
68aaa50100 Sketcher: Remove unused variables (#21504)
removed unused variables
2025-05-25 00:19:46 +02:00
Andrea
6d81096b5a SpreadSheet: remove function
Observer is no longer required as PropertySheet is now derived from  PropertyLinkBase and will handle all the link related behavior
2025-05-19 18:27:01 +02:00
Chris Hennes
952485dcbb Merge pull request #19907 from benj5378/getAttribute
Base: make getAttribute template
2025-05-12 10:39:55 -05:00
Benjamin Bræstrup Sayoc
2b6e73c29d Everywhere: clean up getAttribute conversions 2025-05-09 15:54:57 +02:00
Benjamin Bræstrup Sayoc
2b1aec0041 Base: make getAttribute template 2025-05-09 15:54:57 +02:00
bofdahof
ba2c2ca5ad Console: rename PascalCase named methods to camelCase 2025-05-06 17:50:21 +02:00
Ladislav Michl
9683cf1e4f Base: rename Exception's PascalCase methods to camelCase 2025-05-05 23:50:01 +02:00
Benjamin Nauck
f6b62fcc99 Spreadsheet: use isEmpty() instead of count() where possible 2025-05-03 22:22:10 +02:00
tetektoza
8fda3b4bd1 Core: Introduce PDF Import-Export dialog (#20860)
* Core: Introduce PDF Import-Export dialog

Currently, we only have hardcoded exporting to one pdf version, which
leads to (as in one of the below issues) to problems, such as
non-transparent layers, which are by default not supported in PDF/A-1b.

So, this patch adds an option to the user to select their preferred PDF
version by introducing new dialog under Import-Export in Preferences,
and allowing to update that version before exporting.

* Core: Add informational messages regarding selected PDF format

* Gui: Handle Qt < 6.8 unsupported PDF format

* Gui: Switch PDF export prefs dialog to use tr()

* Gui: Remove center alignment of PDF version description

---------

Co-authored-by: Chris Hennes <chennes@pioneerlibrarysystem.org>
2025-04-27 19:31:34 -05:00
Kacper Donat
5658331bb0 Spreadsheet: Replace dynamic_cast with qobject_cast 2025-04-26 14:23:25 +02:00