diff options
author | Michael Meeks <michael.meeks@suse.com> | 2011-10-21 10:08:02 +0100 |
---|---|---|
committer | Michael Meeks <michael.meeks@suse.com> | 2011-10-21 10:08:58 +0100 |
commit | e31496c9382ebdaa6ed1c6889c0d6ecde6f57de7 (patch) | |
tree | 8f3fe2225a29a82faad01dc80160269c700931ba /basic | |
parent | 034350a5097c2138311999b87da5621fe0d9d96e (diff) |
misc trivial tweaks, and documentation addition
Diffstat (limited to 'basic')
-rw-r--r-- | basic/Module_basic.mk | 2 | ||||
-rw-r--r-- | basic/qa/cppunit/test_scanner.cxx | 22 | ||||
-rw-r--r-- | basic/source/comp/scanner.cxx | 10 | ||||
-rw-r--r-- | basic/source/comp/token.cxx | 4 |
4 files changed, 15 insertions, 23 deletions
diff --git a/basic/Module_basic.mk b/basic/Module_basic.mk index d1b5deea0d86..885a0c0353d7 100644 --- a/basic/Module_basic.mk +++ b/basic/Module_basic.mk @@ -39,6 +39,6 @@ $(eval $(call gb_Module_add_targets,basic,\ $(eval $(call gb_Module_add_check_targets,basic,\ CppunitTest_basic_scanner \ -)) +)) # vim: set noet sw=4 ts=4: diff --git a/basic/qa/cppunit/test_scanner.cxx b/basic/qa/cppunit/test_scanner.cxx index f6459a53864f..25f5147f46ff 100644 --- a/basic/qa/cppunit/test_scanner.cxx +++ b/basic/qa/cppunit/test_scanner.cxx @@ -36,7 +36,7 @@ namespace void testGoto(); void testExclamation(); void testNumbers(); - + // Adds code needed to register the test suite CPPUNIT_TEST_SUITE(ScannerTest); @@ -51,14 +51,6 @@ namespace // End of test suite definition CPPUNIT_TEST_SUITE_END(); - public: - void setUp() - { - } - - void tearDown() - { - } }; const static rtl::OUString cr(RTL_CONSTASCII_USTRINGPARAM("\n")); @@ -309,7 +301,7 @@ namespace CPPUNIT_ASSERT(symbols[1].type == SbxVARIANT); CPPUNIT_ASSERT(symbols[2].text == cr); CPPUNIT_ASSERT(symbols[2].type == SbxVARIANT); - + symbols = getSymbols(source10); CPPUNIT_ASSERT(symbols.size() == 8); CPPUNIT_ASSERT(symbols[0].text == cr); @@ -405,7 +397,7 @@ namespace CPPUNIT_ASSERT(symbols[0].type == SbxVARIANT); CPPUNIT_ASSERT(symbols[1].text == rem); CPPUNIT_ASSERT(symbols[1].type == SbxVARIANT); - + symbols = getSymbols(source7); CPPUNIT_ASSERT(symbols.size() == 4); CPPUNIT_ASSERT(symbols[0].text == rem); @@ -471,7 +463,7 @@ namespace CPPUNIT_ASSERT(symbols[0].text == asdf); CPPUNIT_ASSERT(symbols[1].text == excl); CPPUNIT_ASSERT(symbols[2].text == asdf); - CPPUNIT_ASSERT(symbols[3].text == cr); + CPPUNIT_ASSERT(symbols[3].text == cr); symbols = getSymbols(source2); CPPUNIT_ASSERT(symbols.size() == 3); @@ -497,7 +489,7 @@ namespace CPPUNIT_ASSERT(symbols[0].text == excl); CPPUNIT_ASSERT(symbols[1].text == rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("%"))); CPPUNIT_ASSERT(symbols[2].text == cr); - + symbols = getSymbols(source6); CPPUNIT_ASSERT(symbols.size() == 2); CPPUNIT_ASSERT(symbols[0].text == excl); @@ -523,12 +515,12 @@ namespace CPPUNIT_ASSERT(symbols.size() == 2); CPPUNIT_ASSERT(symbols[0].number == 12345); CPPUNIT_ASSERT(symbols[1].text == cr); - + symbols = getSymbols(source2); CPPUNIT_ASSERT(symbols.size() == 2); CPPUNIT_ASSERT(symbols[0].number == 1.23); CPPUNIT_ASSERT(symbols[1].text == cr); - + symbols = getSymbols(source3); CPPUNIT_ASSERT(symbols.size() == 2); CPPUNIT_ASSERT(symbols[0].number = 123.4); diff --git a/basic/source/comp/scanner.cxx b/basic/source/comp/scanner.cxx index 998ecbf8aa0d..0211b75292b2 100644 --- a/basic/source/comp/scanner.cxx +++ b/basic/source/comp/scanner.cxx @@ -391,7 +391,7 @@ sal_Bool SbiScanner::NextSym() break; default : // treated as an operator - pLine--; nCol--; nCol1 = nCol-1; + pLine--; nCol--; nCol1 = nCol-1; aSym = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("&")); return SYMBOL; } @@ -459,14 +459,14 @@ sal_Bool SbiScanner::NextSym() // get out duplicate string delimiters String s( cSep ); s += cSep; - sal_uInt16 nIdx = 0; + sal_Int32 nIdx = 0; do { nIdx = aSym.indexOf( s, nIdx ); - if( nIdx == STRING_NOTFOUND ) + if( nIdx < 0 ) break; - ::rtl::OUStringBuffer aSymBuf(aSym); - aSymBuf.remove(nIdx, 1); + ::rtl::OUStringBuffer aSymBuf( aSym ); + aSymBuf.remove( nIdx, 1 ); aSym = aSymBuf.makeStringAndClear(); nIdx++; } diff --git a/basic/source/comp/token.cxx b/basic/source/comp/token.cxx index d09d5390f482..dc8287fe39e4 100644 --- a/basic/source/comp/token.cxx +++ b/basic/source/comp/token.cxx @@ -291,10 +291,10 @@ const ::rtl::OUString& SbiTokenizer::Symbol( SbiToken t ) } switch( t ) { - case NEG : + case NEG : aSym = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("-")); return aSym; - case EOS : + case EOS : aSym = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(":/CRLF")); return aSym; case EOLN : |