wxMaxima
Loading...
Searching...
No Matches
Data Structures | Macros | Functions
test_WorksheetClipboard.cpp File Reference

Safety net for the multi-format clipboard / drag-and-drop payload of Worksheet. More...

#include <wx/app.h>
#include <wx/bitmap.h>
#include <wx/dataobj.h>
#include <wx/dcmemory.h>
#include <wx/filename.h>
#include <wx/frame.h>
#include <wx/image.h>
#include <wx/log.h>
#include <wx/mstream.h>
#include <wx/xml/xml.h>
#include "Configuration.h"
#include "MathParser.h"
#include "worksheet/Worksheet.h"
#include "cells/GroupCell.h"
#include <cstdlib>
#include <string>
#include <vector>
#include <unistd.h>
#include <catch2/catch.hpp>
Include dependency graph for test_WorksheetClipboard.cpp:

Data Structures

class  TestApp
 

Macros

#define WXM_CORPUS_DIR   "."
 
#define CATCH_CONFIG_RUNNER
 

Functions

 SCENARIO ("The whole-cell (cut/copy-cells) clipboard object is well-formed")
 
 SCENARIO ("The selection (copy-as-output) clipboard object is well-formed")
 
 wxDECLARE_APP (TestApp)
 
int main (int argc, char **argv)
 

Detailed Description

Safety net for the multi-format clipboard / drag-and-drop payload of Worksheet.

When wxMaxima copies (or cuts, or drag-exports) a selection it advertises the same content under many flavors at once - the .wxm batch code, MathML (under two mime types), RTF (under two mime types), plain text, and a bitmap. Those live inside one wxDataObjectComposite / CompositeDataObject. A composite whose children collide on a wxDataFormat, or whose children carry no retrievable data, is a latent clipboard bug (and trips a wxWidgets assertion when it is handed to the real clipboard).

Worksheet::CreateSelectionDataObject() and Worksheet::CreateCellsDataObject() are the exact builders Copy()/CopyCells() use, factored out so the composite can be inspected without opening the (headless-unfriendly) system clipboard. This test builds them over a real document and pins the invariants: