|
wxMaxima
|
Regression tests for the table of contents sidebar's drag-and-drop reorder (GH #1524). More...
#include <wx/app.h>#include <wx/bitmap.h>#include <wx/dcmemory.h>#include <wx/frame.h>#include <wx/log.h>#include "Configuration.h"#include "worksheet/Worksheet.h"#include "sidebars/TableOfContents.h"#include "cells/EditorCell.h"#include "cells/GroupCell.h"#include <vector>#include <cstdlib>#include <unistd.h>#include <catch2/catch.hpp>Data Structures | |
| class | TestApp |
Functions | |
| SCENARIO ("TOCdnd moves a chapter with no pre-existing worksheet selection") | |
| SCENARIO ("TOCdnd keeps a nested sub-heading attached to its parent when moving") | |
| SCENARIO ("TOCdnd moves a chapter to the very top of the document") | |
| SCENARIO ("ClampDropIndex clamps an out-of-range drop to the end of the list, not the start") | |
| wxDECLARE_APP (TestApp) | |
| int | main (int argc, char **argv) |
Regression tests for the table of contents sidebar's drag-and-drop reorder (GH #1524).
The feature was wired up (drag image, scroll-while-dragging, reordered- preview rendering) well before it was ever exercised end-to-end, and two independent bugs in Worksheet::TOCdnd() – the function that performs the actual reorder – made it either a no-op or silently data-corrupting:
A third bug lived in TableOfContents' own mouse handlers: dropping at or near the end of the list clamped to a position near the drag's own start instead of the end. That logic is pinned here too, extracted into the pure ClampDropIndex() helper so it needs no simulated mouse events at all.