Commit Graph

823 Commits

Author SHA1 Message Date
Markus Reitböck
c3805ecf4a fix duplicate include guards in precompiled headers 2025-09-23 00:51:00 +02:00
Markus Reitböck
62b915ee7b Spreadsheet: use CMake to generate precompiled headers on all platforms
"Professional CMake" book suggest the following:

"Targets should build successfully with or without compiler support for precompiled headers. It
 should be considered an optimization, not a requirement. In particular, do not explicitly include a
 precompile header (e.g. stdafx.h) in the source code, let CMake force-include an automatically
 generated precompile header on the compiler command line instead. This is more portable across
 the major compilers and is likely to be easier to maintain. It will also avoid warnings being
 generated from certain code checking tools like iwyu (include what you use)."

Therefore, removed the "#include <PreCompiled.h>" from sources, also
there is no need for the "#ifdef _PreComp_" anymore
2025-09-23 00:50:59 +02:00
Chris Hennes
29c69a4689 Update translations 2025-09-15 2025-09-16 09:55:13 +02:00
Markus Reitböck
749ac36615 do not use precompiled header for setting global compiler definitions and to disable compiler warnings
only 4 of these warnings are still relevant, CMake shall be used to disable them

Compiler definitions:

  NOMINMAX:
    * is already globally defined in SetGlobalCompilerAndLinkerSettings.cmake

  WIN32_LEAN_AND_MEAN:
    * use CMake target_compile_options on relevant targets

Warnings that still occur:

  C4251, C4273, C4275: all related to dllimport / export
    * use CMake target_compile_options on relevant targets

  C4661: no suitable definition provied for explicit template instantiation request
    * triggered in Mesh because of Vector3D in Base - not all functions are defined in header
    * use CMake target_compile_options on relevant targets

Warnings that are Currently not triggered (fix code if they appear again):

  C4005: macro redefinition

  C4244: argument conversion, possible loss of data

  C4267: conversion from size_t to type, possible loss of data

  C4305: truncation from type1 to type2
    * only occurrence disabled in Reader.cpp

  C4522: multiple assignment operator specified

  C5208: unnamed class in typedef name

Obsolete Compiler warnings:

  C4181: not mentioned in Microsoft docs anymore

  C4290: C++ exception specification ignored except to indicate a function is not __declspec(nothrow)
    * throw(optional_type_list)  deprecated in C++17

  C4482: nonstandard extension used: enum 'enumeration' used in qualified name
    * not generated for compilers that support C++11

  C4503: 'identifier': decorated name length exceeded, name was truncated
    * obsolete since Visual Studio 2017

  C4786: not mentioned in Microsoft docs anymore
2025-09-11 20:21:04 -05:00
Roy-043
1bbc1c805d Spreadsheet: fix Split Cell name in context menu 2025-09-11 12:32:23 -05:00
Roy-043
a4b659fcbf Spreadsheet: message box titles to Title Case (#23842) 2025-09-11 14:45:37 +02:00
Chris Hennes
3d65ae46d5 Merge pull request #23746 from 3x380V/cmake
CMake: Use scoped include and library directories
2025-09-10 21:54:51 -05:00
Chris Hennes
58a8d589a7 Update translations 2025-09-09 2025-09-10 08:53:41 +02:00
wmayer
93db4c7d8a CMake: Replace include_directories with target_include_directories 2025-09-08 19:04:34 +02:00
Chris Hennes
84c810dc4a Merge pull request #23521 from z0r0/python-interface-bindings-final
Core: Python interface bindings cleanup
2025-09-08 10:58:15 -05:00
Chris Hennes
fd20bdd6d8 Update translations 2025-09-03 2025-09-04 11:37:11 +02:00
Ian 'z0r0' Abreu
0217c1ef97 updating docblock locations. 2025-09-02 08:28:47 -04:00
Ian 'z0r0' Abreu
8d56e3e529 reverting author metadata 2025-09-02 08:25:37 -04:00
Ian 'z0r0' Abreu
b24040ee52 Adding license documentation to interface class docblocks. 2025-09-01 21:50:59 -04:00
Ian 'z0r0' Abreu
6d3fb9393a Finalizing Python interface bindings for Robot, Spreadsheet, Surface. 2025-08-31 15:41:14 -04:00
Chris Hennes
b1b97e44f1 Update translations 2025-08-28 16:14:49 +02:00
Frank David Martínez M
e5c912e0f3 [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
f20c1a0102 Simplify repr() function 2025-08-25 10:38:39 -05:00
wmayer
f5cfd3d64c 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
3e1cc8302a Update translations 2025-08-18 17:55:24 +02:00
Max Wilfinger
70f4221993 Fix missed strings for UI consistency
Fix ellipsis rendering
2025-08-08 06:37:59 -05:00
Frank David Martínez M
1b3851c502 [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
5aae85f48d [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
bb2ee82990 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
3cce6ffa3c 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
e7161fedd4 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
f38d0028a1 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
a732648fe9 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
50173a4e1b 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
d3e6c1fd63 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
a3f2e8cf6b 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
cbef684d63 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
a31f2d3a1c 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
4151dfd18c 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
7fdf2ec460 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
5ae0d2f6a9 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
6ffe3ee81b 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
f078e51dab 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
751626202d Spreadsheet: Update UI strings for consistency 2025-06-30 10:35:16 -05:00
Kacper Donat
96b006a2dd 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
4fcb871b5b Spreadsheet: Only use validator when when prefix is not '=' 2025-06-23 16:14:35 +02:00
xtemp09
eb8d8b68f0 [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
4d1d6f4e78 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
109e11e6b2 Spreadsheet: Fix cursor being stuck resize state when scaled 2025-06-11 06:54:59 +02:00
wmayer
b38c8867d0 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
513260d29d 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
a46f79aa68 Sheet: Fix crash in Cell::setContent
This fixes issue 14697
2025-06-05 10:15:24 +02:00
wmayer
c215bd7be9 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
0c4fb60225 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
bcfda35b42 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