Commit f1f11cf6 authored by dickelbeck's avatar dickelbeck

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

parent 56ccc81b
...@@ -42,7 +42,7 @@ set(COMMON_SRCS ...@@ -42,7 +42,7 @@ set(COMMON_SRCS
gr_basic.cpp gr_basic.cpp
hotkeys_basic.cpp hotkeys_basic.cpp
msgpanel.cpp msgpanel.cpp
newstroke_font.cpp newstroke_font.cpp
projet_config.cpp projet_config.cpp
# pyhandler.cpp # pyhandler.cpp
richio.cpp richio.cpp
...@@ -88,3 +88,13 @@ set(PCB_COMMON_SRCS ...@@ -88,3 +88,13 @@ set(PCB_COMMON_SRCS
) )
add_library(pcbcommon ${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) ...@@ -91,19 +91,18 @@ int STRING_LINE_READER::ReadLine() throw (IOError)
if( advance ) if( advance )
{ {
if( advance >= maxLineLength ) if( advance > maxLineLength )
throw IOError( _("Line length exceeded") ); throw IOError( _("Line length exceeded") );
wxASSERT( ndx + advance <= source.length() ); wxASSERT( ndx + advance <= source.length() );
memcpy( line, &source[ndx], advance ); memcpy( line, &source[ndx], advance );
length = advance;
++lineNum; ++lineNum;
ndx += advance; ndx += advance;
} }
length = advance;
line[advance] = 0; line[advance] = 0;
return advance; return advance;
......
...@@ -98,6 +98,7 @@ class DSNLEXER ...@@ -98,6 +98,7 @@ class DSNLEXER
const KEYWORD* keywords; const KEYWORD* keywords;
unsigned keywordCount; unsigned keywordCount;
void init();
int readLine() throw (IOError) int readLine() throw (IOError)
{ {
...@@ -159,6 +160,9 @@ public: ...@@ -159,6 +160,9 @@ public:
DSNLEXER( FILE* aFile, const wxString& aFilename, DSNLEXER( FILE* aFile, const wxString& aFilename,
const KEYWORD* aKeywordTable, unsigned aKeywordCount ); const KEYWORD* aKeywordTable, unsigned aKeywordCount );
DSNLEXER( const std::string& aClipboardTxt,
const KEYWORD* aKeywordTable, unsigned aKeywordCount );
~DSNLEXER() ~DSNLEXER()
{ {
delete reader; delete reader;
......
...@@ -233,14 +233,9 @@ install(TARGETS ${PCBNEW_NAME} ...@@ -233,14 +233,9 @@ install(TARGETS ${PCBNEW_NAME}
# The specctra test fails to build properly using MS Visual Studio. # The specctra test fails to build properly using MS Visual Studio.
if(NOT MSVC) 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. # This one gets made only when testing.
add_executable(specctra_test EXCLUDE_FROM_ALL specctra.cpp) add_executable(specctra_test EXCLUDE_FROM_ALL specctra.cpp)
target_link_libraries(specctra_test common ${wxWidgets_LIBRARIES}) target_link_libraries(specctra_test common ${wxWidgets_LIBRARIES})
endif(NOT MSVC) endif(NOT MSVC)
# This one gets made only when testing. # This one gets made only when testing.
......
...@@ -71,6 +71,7 @@ enum DSN_T { ...@@ -71,6 +71,7 @@ enum DSN_T {
// these first few are negative special ones for syntax, and are // these first few are negative special ones for syntax, and are
// inherited from DSNLEXER. // inherited from DSNLEXER.
T_NONE = DSN_NONE, T_NONE = DSN_NONE,
T_COMMENT = DSN_COMMENT,
T_STRING_QUOTE = DSN_STRING_QUOTE, T_STRING_QUOTE = DSN_STRING_QUOTE,
T_QUOTE_DEF = DSN_QUOTE_DEF, T_QUOTE_DEF = DSN_QUOTE_DEF,
T_DASH = DSN_DASH, 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