Commit f1f11cf6 authored by dickelbeck's avatar dickelbeck

revive target 'dsntest' from common, start exploring pasting text from clipboard, primitively.

parent 56ccc81b
......@@ -88,3 +88,13 @@ set(PCB_COMMON_SRCS
)
add_library(pcbcommon ${PCB_COMMON_SRCS})
# The dsntest may not build properly using MS Visual Studio.
if(NOT MSVC)
# This one gets made only when testing.
# to build it, first enable #define STAND_ALONE at top of dsnlexer.cpp
add_executable( dsntest EXCLUDE_FROM_ALL dsnlexer.cpp )
target_link_libraries( dsntest common ${wxWidgets_LIBRARIES} )
endif( NOT MSVC )
This diff is collapsed.
......@@ -91,19 +91,18 @@ int STRING_LINE_READER::ReadLine() throw (IOError)
if( advance )
{
if( advance >= maxLineLength )
if( advance > maxLineLength )
throw IOError( _("Line length exceeded") );
wxASSERT( ndx + advance <= source.length() );
memcpy( line, &source[ndx], advance );
length = advance;
++lineNum;
ndx += advance;
}
length = advance;
line[advance] = 0;
return advance;
......
......@@ -98,6 +98,7 @@ class DSNLEXER
const KEYWORD* keywords;
unsigned keywordCount;
void init();
int readLine() throw (IOError)
{
......@@ -159,6 +160,9 @@ public:
DSNLEXER( FILE* aFile, const wxString& aFilename,
const KEYWORD* aKeywordTable, unsigned aKeywordCount );
DSNLEXER( const std::string& aClipboardTxt,
const KEYWORD* aKeywordTable, unsigned aKeywordCount );
~DSNLEXER()
{
delete reader;
......
......@@ -233,14 +233,9 @@ install(TARGETS ${PCBNEW_NAME}
# The specctra test fails to build properly using MS Visual Studio.
if(NOT MSVC)
# This one gets made only when testing.
#add_executable(dsntest EXCLUDE_FROM_ALL dsn.cpp)
#target_link_libraries(dsntest common ${wxWidgets_LIBRARIES})
# This one gets made only when testing.
add_executable(specctra_test EXCLUDE_FROM_ALL specctra.cpp)
target_link_libraries(specctra_test common ${wxWidgets_LIBRARIES})
endif(NOT MSVC)
# This one gets made only when testing.
......
......@@ -71,6 +71,7 @@ enum DSN_T {
// these first few are negative special ones for syntax, and are
// inherited from DSNLEXER.
T_NONE = DSN_NONE,
T_COMMENT = DSN_COMMENT,
T_STRING_QUOTE = DSN_STRING_QUOTE,
T_QUOTE_DEF = DSN_QUOTE_DEF,
T_DASH = DSN_DASH,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment