summaryrefslogtreecommitdiff
path: root/tools/source/memtools
diff options
context:
space:
mode:
authorIvan Timofeev <timofeev.i.s@gmail.com>2011-10-20 23:11:17 +0400
committerIvan Timofeev <timofeev.i.s@gmail.com>2011-10-20 23:11:17 +0400
commitd72701bba66817fbd0ddcb8dea969aea49f8426a (patch)
tree292c117d6ea1bb75b1b41c7113dcdbcd5d6bdfa1 /tools/source/memtools
parent593e4c36d2f199cc3b82be587bc7674c2f394d06 (diff)
bye-bye old range parser
Diffstat (limited to 'tools/source/memtools')
-rw-r--r--tools/source/memtools/multisel.cxx158
1 files changed, 0 insertions, 158 deletions
diff --git a/tools/source/memtools/multisel.cxx b/tools/source/memtools/multisel.cxx
index 1a21f0ac0aaa..4d6d577269c7 100644
--- a/tools/source/memtools/multisel.cxx
+++ b/tools/source/memtools/multisel.cxx
@@ -137,164 +137,6 @@ MultiSelection::MultiSelection():
// -----------------------------------------------------------------------
-MultiSelection::MultiSelection( const UniString& rString, sal_Unicode cRange, sal_Unicode cSep ):
- aTotRange(0,RANGE_MAX),
- nCurSubSel(0),
- nSelCount(0),
- bCurValid(sal_False),
- bSelectNew(sal_False)
-{
- // Dies ist nur ein Schnellschuss und sollte bald optimiert,
- // an die verschiedenen Systeme (UNIX etc.)
- // und die gewuenschte Eingabe-Syntax angepasst werden.
-
- UniString aStr( rString );
- sal_Unicode* pStr = aStr.GetBufferAccess();
- sal_Unicode* pOld = pStr;
- sal_Bool bReady = sal_False;
- sal_Bool bUntil = sal_False;
- xub_StrLen nCut = 0;
-
- // Hier normieren wir den String, sodass nur Ziffern,
- // Semikola als Trenn- und Minus als VonBis-Zeichen
- // uebrigbleiben, z.B. "99-117;55;34;-17;37-43"
- while ( *pOld )
- {
- switch( *pOld )
- {
- case '0':
- case '1':
- case '2':
- case '3':
- case '4':
- case '5':
- case '6':
- case '7':
- case '8':
- case '9':
- DBG_ASSERT( *pOld != cRange, "digit for range char not allowed" );
- DBG_ASSERT( *pOld != cSep, "digit for separator not allowed" );
- if( bReady )
- {
- *pStr++ = ';';
- nCut++;
- bReady = sal_False;
- }
- *pStr++ = *pOld;
- nCut++;
- bUntil = sal_False;
- break;
-
- case '-':
- case ':':
- case '/':
- if ( *pOld != cSep )
- {
- if ( !bUntil )
- {
- *pStr++ = '-';
- nCut++;
- bUntil = sal_True;
- }
- bReady = sal_False;
- }
- else
- bReady = sal_True;
- break;
-
- case ' ':
- DBG_ASSERT( *pOld != cRange, "SPACE for range char not allowed" );
- DBG_ASSERT( *pOld != cSep, "SPACE for separator not allowed" );
- bReady = !bUntil;
- break;
-
- default:
- if ( *pOld == cRange )
- {
- if ( !bUntil )
- {
- *pStr++ = '-';
- nCut++;
- bUntil = sal_True;
- }
- bReady = sal_False;
- }
- else
- bReady = sal_True;
- break;
- }
-
- pOld++;
- }
- aStr.ReleaseBufferAccess( nCut );
-
- // Jetzt wird der normierte String ausgewertet ..
- UniString aNumStr;
- Range aRg( 1, RANGE_MAX );
- const sal_Unicode* pCStr = aStr.GetBuffer();
- long nPage = 1;
- long nNum = 1;
- bUntil = sal_False;
- while ( *pCStr )
- {
- switch ( *pCStr )
- {
- case '0':
- case '1':
- case '2':
- case '3':
- case '4':
- case '5':
- case '6':
- case '7':
- case '8':
- case '9':
- aNumStr += *pCStr;
- break;
- case ';':
- nNum = aNumStr.ToInt32();
- if ( bUntil )
- {
- if ( !aNumStr.Len() )
- nNum = RANGE_MAX;
- aRg.Min() = nPage;
- aRg.Max() = nNum;
- aRg.Justify();
- Select( aRg );
- }
- else
- Select( nNum );
- nPage = 0;
- aNumStr.Erase();
- bUntil = sal_False;
- break;
-
- case '-':
- nPage = aNumStr.ToInt32();
- aNumStr.Erase();
- bUntil = sal_True;
- break;
- }
-
- pCStr++;
- }
-
- nNum = aNumStr.ToInt32();
- if ( bUntil )
- {
- if ( !aNumStr.Len() )
- nNum = RANGE_MAX;
- aRg.Min() = nPage;
- aRg.Max() = nNum;
- aRg.Justify();
- Select( aRg );
- }
- else
- Select( nNum );
-}
-
-// -----------------------------------------------------------------------
-
MultiSelection::MultiSelection( const MultiSelection& rOrig ) :
aTotRange(rOrig.aTotRange),
nSelCount(rOrig.nSelCount),