From 6803af4dc4bec1c7394403cd54153b706f4cfd11 Mon Sep 17 00:00:00 2001 From: Aapo Date: Fri, 20 Nov 2020 19:56:47 +0200 Subject: [PATCH 1/4] [TD] Fix column index range checking bug in std::string DrawViewSpreadsheet::getSheetImage(void) --- src/Mod/TechDraw/App/DrawViewSpreadsheet.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/Mod/TechDraw/App/DrawViewSpreadsheet.cpp b/src/Mod/TechDraw/App/DrawViewSpreadsheet.cpp index ef9de0ca56..eb1007a836 100644 --- a/src/Mod/TechDraw/App/DrawViewSpreadsheet.cpp +++ b/src/Mod/TechDraw/App/DrawViewSpreadsheet.cpp @@ -211,13 +211,6 @@ std::string DrawViewSpreadsheet::getSheetImage(void) } } - //check for logical range - if ( (sColStart > sColEnd) || - (iRowStart > iRowEnd) ) { - Base::Console().Error("%s - cell range is illogical\n",getNameInDocument()); - return result.str(); - } - std::vector availcolumns = getAvailColumns(); //validate range start column in sheet's available columns @@ -236,6 +229,13 @@ std::string DrawViewSpreadsheet::getSheetImage(void) return result.str(); } + //check for logical range + if ( (iAvailColStart > iAvailColEnd) || + (iRowStart > iRowEnd) ) { + Base::Console().Error("%s - cell range is illogical\n",getNameInDocument()); + return result.str(); + } + // build row and column ranges std::vector validColNames; std::vector validRowNumbers; From 72d003f10239594d09978d4069d561cfc947e0df Mon Sep 17 00:00:00 2001 From: Aapo Date: Fri, 20 Nov 2020 22:12:02 +0200 Subject: [PATCH 2/4] [TD] Make DrawViewSpreadSheet respect DrawPage::redrawCommand() update mechanism. --- src/Mod/TechDraw/App/DrawPage.cpp | 9 +++++++++ src/Mod/TechDraw/App/DrawPage.h | 1 + 2 files changed, 10 insertions(+) diff --git a/src/Mod/TechDraw/App/DrawPage.cpp b/src/Mod/TechDraw/App/DrawPage.cpp index fb56c9acfd..7d944593e8 100644 --- a/src/Mod/TechDraw/App/DrawPage.cpp +++ b/src/Mod/TechDraw/App/DrawPage.cpp @@ -372,6 +372,15 @@ void DrawPage::updateAllViews() line->recomputeFeature(); } } + + //fourth, try to execute all spreadsheets. + for (it = featViews.begin(); it != featViews.end(); ++it) { + TechDraw::DrawViewSpreadsheet *sheet = dynamic_cast(*it); + if (sheet != nullptr) { + sheet->recomputeFeature(); + } + } + } std::vector DrawPage::getAllViews(void) diff --git a/src/Mod/TechDraw/App/DrawPage.h b/src/Mod/TechDraw/App/DrawPage.h index 8b403f2cd0..e298f52078 100644 --- a/src/Mod/TechDraw/App/DrawPage.h +++ b/src/Mod/TechDraw/App/DrawPage.h @@ -31,6 +31,7 @@ #include #include #include +#include namespace TechDraw { From 1d3113ebda76b520379047697db7930faa402d5a Mon Sep 17 00:00:00 2001 From: bitacovir Date: Sun, 6 Dec 2020 18:25:20 -0300 Subject: [PATCH 3/4] Add SVG icons for ten Std File Menu Commands This commit adds SVG files with icons for these commands. Also, it makes the necessary changes on CommandDoc.cpp, CommandWindow.cpp, CommandStd.cpp and resource.qrc files. --- src/Gui/CommandDoc.cpp | 10 +- src/Gui/CommandStd.cpp | 1 + src/Gui/CommandWindow.cpp | 2 + src/Gui/Icons/Std_CloseActiveWindow.svg | 204 +++++++ src/Gui/Icons/Std_CloseAllWindows.svg | 248 ++++++++ src/Gui/Icons/Std_Export.svg | 428 ++++++++++++++ src/Gui/Icons/Std_Import.svg | 428 ++++++++++++++ src/Gui/Icons/Std_MergeProjects.svg | 661 +++++++++++++++++++++ src/Gui/Icons/Std_PrintPdf.svg | 423 ++++++++++++++ src/Gui/Icons/Std_RecentFiles.svg | 728 ++++++++++++++++++++++++ src/Gui/Icons/Std_Revert.svg | 201 +++++++ src/Gui/Icons/Std_SaveAll.svg | 605 ++++++++++++++++++++ src/Gui/Icons/Std_SaveCopy.svg | 633 ++++++++++++++++++++ src/Gui/Icons/resource.qrc | 10 + 14 files changed, 4579 insertions(+), 3 deletions(-) create mode 100644 src/Gui/Icons/Std_CloseActiveWindow.svg create mode 100644 src/Gui/Icons/Std_CloseAllWindows.svg create mode 100644 src/Gui/Icons/Std_Export.svg create mode 100644 src/Gui/Icons/Std_Import.svg create mode 100644 src/Gui/Icons/Std_MergeProjects.svg create mode 100644 src/Gui/Icons/Std_PrintPdf.svg create mode 100644 src/Gui/Icons/Std_RecentFiles.svg create mode 100644 src/Gui/Icons/Std_Revert.svg create mode 100644 src/Gui/Icons/Std_SaveAll.svg create mode 100644 src/Gui/Icons/Std_SaveCopy.svg diff --git a/src/Gui/CommandDoc.cpp b/src/Gui/CommandDoc.cpp index 88d00b609a..225a26177f 100644 --- a/src/Gui/CommandDoc.cpp +++ b/src/Gui/CommandDoc.cpp @@ -179,7 +179,7 @@ StdCmdImport::StdCmdImport() sToolTipText = QT_TR_NOOP("Import a file in the active document"); sWhatsThis = "Std_Import"; sStatusTip = QT_TR_NOOP("Import a file in the active document"); - //sPixmap = "Open"; + sPixmap = "Std_Import"; sAccel = "Ctrl+I"; } @@ -267,6 +267,7 @@ StdCmdExport::StdCmdExport() sStatusTip = QT_TR_NOOP("Export an object in the active document"); //sPixmap = "Open"; sAccel = "Ctrl+E"; + sPixmap = "Std_Export"; eType = 0; } @@ -331,6 +332,7 @@ StdCmdMergeProjects::StdCmdMergeProjects() sToolTipText = QT_TR_NOOP("Merge project"); sWhatsThis = "Std_MergeProjects"; sStatusTip = QT_TR_NOOP("Merge project"); + sPixmap = "Std_MergeProjects"; } void StdCmdMergeProjects::activated(int iMsg) @@ -528,7 +530,7 @@ StdCmdSaveCopy::StdCmdSaveCopy() sToolTipText = QT_TR_NOOP("Save a copy of the active document under a new file name"); sWhatsThis = "Std_SaveCopy"; sStatusTip = QT_TR_NOOP("Save a copy of the active document under a new file name"); - //sPixmap = "document-save-as"; + sPixmap = "Std_SaveCopy"; } void StdCmdSaveCopy::activated(int iMsg) @@ -561,6 +563,7 @@ StdCmdSaveAll::StdCmdSaveAll() sToolTipText = QT_TR_NOOP("Save all opened document"); sWhatsThis = "Std_SaveAll"; sStatusTip = QT_TR_NOOP("Save all opened document"); + sPixmap = "Std_SaveAll"; } void StdCmdSaveAll::activated(int iMsg) @@ -588,7 +591,7 @@ StdCmdRevert::StdCmdRevert() sToolTipText = QT_TR_NOOP("Reverts to the saved version of this file"); sWhatsThis = "Std_Revert"; sStatusTip = QT_TR_NOOP("Reverts to the saved version of this file"); - //sPixmap = "document-revert"; + sPixmap = "Std_Revert"; eType = NoTransaction; } @@ -749,6 +752,7 @@ StdCmdPrintPdf::StdCmdPrintPdf() sToolTipText = QT_TR_NOOP("Export the document as PDF"); sWhatsThis = "Std_PrintPdf"; sStatusTip = QT_TR_NOOP("Export the document as PDF"); + sPixmap = "Std_PrintPdf"; eType = 0; } diff --git a/src/Gui/CommandStd.cpp b/src/Gui/CommandStd.cpp index f350c5434d..e3551d2375 100644 --- a/src/Gui/CommandStd.cpp +++ b/src/Gui/CommandStd.cpp @@ -146,6 +146,7 @@ StdCmdRecentFiles::StdCmdRecentFiles() sToolTipText = QT_TR_NOOP("Recent file list"); sWhatsThis = "Std_RecentFiles"; sStatusTip = QT_TR_NOOP("Recent file list"); + sPixmap = "Std_RecentFiles"; eType = NoTransaction; } diff --git a/src/Gui/CommandWindow.cpp b/src/Gui/CommandWindow.cpp index 73b2f6049a..822378c48f 100644 --- a/src/Gui/CommandWindow.cpp +++ b/src/Gui/CommandWindow.cpp @@ -143,6 +143,7 @@ StdCmdCloseActiveWindow::StdCmdCloseActiveWindow() // collide with this shortcut. Thus the shortcut of QMdiSubWindow will be // reset in MainWindow::addWindow() (#0002631) sAccel = keySequenceToAccel(QKeySequence::Close); + sPixmap = "Std_CloseActiveWindow"; eType = NoTransaction; } @@ -170,6 +171,7 @@ StdCmdCloseAllWindows::StdCmdCloseAllWindows() sToolTipText = QT_TR_NOOP("Close all windows"); sWhatsThis = "Std_CloseAllWindows"; sStatusTip = QT_TR_NOOP("Close all windows"); + sPixmap = "Std_CloseAllWindows"; eType = NoTransaction; } diff --git a/src/Gui/Icons/Std_CloseActiveWindow.svg b/src/Gui/Icons/Std_CloseActiveWindow.svg new file mode 100644 index 0000000000..34cf937f65 --- /dev/null +++ b/src/Gui/Icons/Std_CloseActiveWindow.svg @@ -0,0 +1,204 @@ + + + Std_CloseActiveWindow + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + Std_CloseActiveWindow + + + [bitacovir] + + + Part_Shape_from_Mesh + 2020/11/28 + http://www.freecadweb.org/wiki/index.php?title=Artwork + + + FreeCAD + + + + + + FreeCAD LGPL2+ + + + https://www.gnu.org/copyleft/lesser.html + + + + + + + + cross + + + orange box with a cross + + + + + + + + + + + + diff --git a/src/Gui/Icons/Std_CloseAllWindows.svg b/src/Gui/Icons/Std_CloseAllWindows.svg new file mode 100644 index 0000000000..baabe656e6 --- /dev/null +++ b/src/Gui/Icons/Std_CloseAllWindows.svg @@ -0,0 +1,248 @@ + + + Std_CloseAllWindows + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + Std_CloseAllWindows + + + [bitacovir] + + + Part_Shape_from_Mesh + 2020/11/28 + http://www.freecadweb.org/wiki/index.php?title=Artwork + + + FreeCAD + + + + + + FreeCAD LGPL2+ + + + https://www.gnu.org/copyleft/lesser.html + + + + + + + + cross + + + Double orange box with a cross + + + + + + + + + + + + + + + + + + diff --git a/src/Gui/Icons/Std_Export.svg b/src/Gui/Icons/Std_Export.svg new file mode 100644 index 0000000000..28599a3407 --- /dev/null +++ b/src/Gui/Icons/Std_Export.svg @@ -0,0 +1,428 @@ + + + Std_Export + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + Std_Export + + + [bitacovir] + + + + + + + Based on Jakub Steiner's work + + + 2020/11/31 + + + FreeCAD LGPL2+ + + + + + FreeCAD + + + http://www.freecadweb.org/wiki/index.php?title=Artwork + + + red arrow + document + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/Gui/Icons/Std_Import.svg b/src/Gui/Icons/Std_Import.svg new file mode 100644 index 0000000000..26a2e3ace9 --- /dev/null +++ b/src/Gui/Icons/Std_Import.svg @@ -0,0 +1,428 @@ + + + Std_Import + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + Std_Import + + + [bitacovir] + + + + + + + Based on Jakub Steiner's work + + + 2020/11/31 + + + FreeCAD LGPL2+ + + + + + FreeCAD + + + http://www.freecadweb.org/wiki/index.php?title=Artwork + + + green arrow + document + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/Gui/Icons/Std_MergeProjects.svg b/src/Gui/Icons/Std_MergeProjects.svg new file mode 100644 index 0000000000..e7ef5081a4 --- /dev/null +++ b/src/Gui/Icons/Std_MergeProjects.svg @@ -0,0 +1,661 @@ + + + Std_MergeProjects + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + Std_MergeProjects + + + [bitacovir] + + + + + + + Work based o Jakub Steiner design + + + 2020/11/31 + + + FreeCAD LGPL2+ + + + + + FreeCAD + + + http://www.freecadweb.org/wiki/index.php?title=Artwork + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/Gui/Icons/Std_PrintPdf.svg b/src/Gui/Icons/Std_PrintPdf.svg new file mode 100644 index 0000000000..ac55098cdb --- /dev/null +++ b/src/Gui/Icons/Std_PrintPdf.svg @@ -0,0 +1,423 @@ + + + Std_PrintPdf + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + Std_PrintPdf + + + [bitacovir] + + + + + + + Based on Jakub Steiner's work + + + 2020/11/31 + + + FreeCAD LGPL2+ + + + + + FreeCAD + + + http://www.freecadweb.org/wiki/index.php?title=Artwork + + + loop + document + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/Gui/Icons/Std_RecentFiles.svg b/src/Gui/Icons/Std_RecentFiles.svg new file mode 100644 index 0000000000..5dbe9f91f0 --- /dev/null +++ b/src/Gui/Icons/Std_RecentFiles.svg @@ -0,0 +1,728 @@ + + + Std_RecentFiles + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + Std_RecentFiles + 2020-11-12 + + + [bitacovir] + + + + + documents + clock + + + + + + Based on Andreas Nilsson's work + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/Gui/Icons/Std_Revert.svg b/src/Gui/Icons/Std_Revert.svg new file mode 100644 index 0000000000..5e9f16976a --- /dev/null +++ b/src/Gui/Icons/Std_Revert.svg @@ -0,0 +1,201 @@ + + + Std_Revert + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + Std_Revert + + + [bitacovir] + + + Part_Shape_from_Mesh + 2020/11/28 + http://www.freecadweb.org/wiki/index.php?title=Artwork + + + FreeCAD + + + + + + FreeCAD LGPL2+ + + + https://www.gnu.org/copyleft/lesser.html + + + + + + + + back arrow + + + orange box with a arrow + + + + + + + + + + + diff --git a/src/Gui/Icons/Std_SaveAll.svg b/src/Gui/Icons/Std_SaveAll.svg new file mode 100644 index 0000000000..79810f5e81 --- /dev/null +++ b/src/Gui/Icons/Std_SaveAll.svg @@ -0,0 +1,605 @@ + + + Std_SaveAll + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + Std_SaveAll + + + [bitacovr] + + + + + hdd + hard drive + save + io + store + + + + + + + + Based on Jakub Steiner's work + + + 2020/12/06 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/Gui/Icons/Std_SaveCopy.svg b/src/Gui/Icons/Std_SaveCopy.svg new file mode 100644 index 0000000000..23b885796e --- /dev/null +++ b/src/Gui/Icons/Std_SaveCopy.svg @@ -0,0 +1,633 @@ + + + Std_SaveCopy + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + Std_SaveCopy + + + [bitacovir] + + + + + + + Work based o Jakub Steiner design + + + 2020/11/31 + + + FreeCAD LGPL2+ + + + + + FreeCAD + + + http://www.freecadweb.org/wiki/index.php?title=Artwork + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/Gui/Icons/resource.qrc b/src/Gui/Icons/resource.qrc index 150b757bf7..ad7f6a1fe3 100644 --- a/src/Gui/Icons/resource.qrc +++ b/src/Gui/Icons/resource.qrc @@ -152,6 +152,16 @@ Param_UInt.svg PolygonPick.svg Python.svg + Std_CloseActiveWindow.svg + Std_CloseAllWindows.svg + Std_Export.svg + Std_Import.svg + Std_MergeProjects.svg + Std_PrintPdf.svg + Std_RecentFiles.svg + Std_Revert.svg + Std_SaveAll.svg + Std_SaveCopy.svg Std_Tool1.svg Std_Tool2.svg Std_Tool3.svg From 78c6cc1362c39e3f1f778c52ae2a1c82badeec20 Mon Sep 17 00:00:00 2001 From: wmayer Date: Mon, 7 Dec 2020 17:54:17 +0100 Subject: [PATCH 4/4] Import: [skip ci] fixes #0004477: Can't import .STEP files with cyrillic symbols --- src/Mod/Import/App/AppImportPy.cpp | 3 ++- src/Mod/Import/Gui/AppImportGuiPy.cpp | 3 ++- src/Mod/Part/App/TopoShape.cpp | 3 ++- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/Mod/Import/App/AppImportPy.cpp b/src/Mod/Import/App/AppImportPy.cpp index 63a7ab6161..3f629d102b 100644 --- a/src/Mod/Import/App/AppImportPy.cpp +++ b/src/Mod/Import/App/AppImportPy.cpp @@ -363,7 +363,8 @@ private: Base::Reference hGrp = App::GetApplication().GetUserParameter() .GetGroup("BaseApp")->GetGroup("Preferences")->GetGroup("Mod/Part")->GetGroup("STEP"); - makeHeader.SetName(new TCollection_HAsciiString((Standard_CString)Utf8Name.c_str())); + // https://forum.freecadweb.org/viewtopic.php?f=8&t=52967 + //makeHeader.SetName(new TCollection_HAsciiString((Standard_CString)Utf8Name.c_str())); makeHeader.SetAuthorValue (1, new TCollection_HAsciiString(hGrp->GetASCII("Author", "Author").c_str())); makeHeader.SetOrganizationValue (1, new TCollection_HAsciiString(hGrp->GetASCII("Company").c_str())); makeHeader.SetOriginatingSystem(new TCollection_HAsciiString(App::GetApplication().getExecutableName())); diff --git a/src/Mod/Import/Gui/AppImportGuiPy.cpp b/src/Mod/Import/Gui/AppImportGuiPy.cpp index aa06d3c393..d6054176fe 100644 --- a/src/Mod/Import/Gui/AppImportGuiPy.cpp +++ b/src/Mod/Import/Gui/AppImportGuiPy.cpp @@ -662,7 +662,8 @@ private: Base::Reference hGrp = App::GetApplication().GetUserParameter() .GetGroup("BaseApp")->GetGroup("Preferences")->GetGroup("Mod/Part")->GetGroup("STEP"); - makeHeader.SetName(new TCollection_HAsciiString((Standard_CString)Utf8Name.c_str())); + // https://forum.freecadweb.org/viewtopic.php?f=8&t=52967 + //makeHeader.SetName(new TCollection_HAsciiString((Standard_CString)Utf8Name.c_str())); makeHeader.SetAuthorValue (1, new TCollection_HAsciiString(hGrp->GetASCII("Author", "Author").c_str())); makeHeader.SetOrganizationValue (1, new TCollection_HAsciiString(hGrp->GetASCII("Company").c_str())); makeHeader.SetOriginatingSystem(new TCollection_HAsciiString(App::GetApplication().getExecutableName())); diff --git a/src/Mod/Part/App/TopoShape.cpp b/src/Mod/Part/App/TopoShape.cpp index f4b080eb6d..dfa107766f 100644 --- a/src/Mod/Part/App/TopoShape.cpp +++ b/src/Mod/Part/App/TopoShape.cpp @@ -991,7 +991,8 @@ void TopoShape::exportStep(const char *filename) const throw Base::FileException("Error in transferring STEP"); APIHeaderSection_MakeHeader makeHeader(aWriter.Model()); - makeHeader.SetName(new TCollection_HAsciiString((Standard_CString)(encodeFilename(filename).c_str()))); + // https://forum.freecadweb.org/viewtopic.php?f=8&t=52967 + //makeHeader.SetName(new TCollection_HAsciiString((Standard_CString)(encodeFilename(filename).c_str()))); makeHeader.SetAuthorValue (1, new TCollection_HAsciiString("FreeCAD")); makeHeader.SetOrganizationValue (1, new TCollection_HAsciiString("FreeCAD")); makeHeader.SetOriginatingSystem(new TCollection_HAsciiString("FreeCAD"));