summaryrefslogtreecommitdiff
path: root/svtools
diff options
context:
space:
mode:
authorNoel Grandin <noelgrandin@gmail.com>2021-07-16 20:37:15 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2021-07-17 12:48:05 +0200
commit1b80998025e13fbf71017ac08fa607737e716429 (patch)
tree548642a43b8f8e5ddb0ed63df4d0f44ef2f03971 /svtools
parent960ad8037275d86f15e0177f52a1d0dac25319e4 (diff)
move BuildWhichTable and simplify
move it to the only place using it, and simplify Change-Id: I4a46b5d01f042e7b2e99b7dd1d28f67feda037d0 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/119086 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'svtools')
-rw-r--r--svtools/source/svrtf/svparser.cxx55
1 files changed, 0 insertions, 55 deletions
diff --git a/svtools/source/svrtf/svparser.cxx b/svtools/source/svrtf/svparser.cxx
index 301e2961d923..3da34404f517 100644
--- a/svtools/source/svrtf/svparser.cxx
+++ b/svtools/source/svrtf/svparser.cxx
@@ -595,61 +595,6 @@ void SvParser<T>::Continue( T )
{
}
-void BuildWhichTable( std::vector<sal_uInt16> &rWhichMap,
- sal_uInt16 const *pWhichIds,
- sal_uInt16 nWhichIds )
-{
- sal_uInt16 aNewRange[2];
-
- for( sal_uInt16 nCnt = 0; nCnt < nWhichIds; ++nCnt, ++pWhichIds )
- if( *pWhichIds )
- {
- aNewRange[0] = aNewRange[1] = *pWhichIds;
- bool bIns = true;
-
- // search position
- for ( sal_uInt16 nOfs = 0; rWhichMap[nOfs]; nOfs += 2 )
- {
- if( *pWhichIds < rWhichMap[nOfs] - 1 )
- {
- // new range before
- rWhichMap.insert( rWhichMap.begin() + nOfs, aNewRange, aNewRange + 2 );
- bIns = false;
- break;
- }
- else if( *pWhichIds == rWhichMap[nOfs] - 1 )
- {
- // extend range downwards
- rWhichMap[nOfs] = *pWhichIds;
- bIns = false;
- break;
- }
- else if( *pWhichIds == rWhichMap[nOfs+1] + 1 )
- {
- if( rWhichMap[nOfs+2] != 0 && rWhichMap[nOfs+2] == *pWhichIds + 1 )
- {
- // merge with next field
- rWhichMap[nOfs+1] = rWhichMap[nOfs+3];
- rWhichMap.erase( rWhichMap.begin() + nOfs + 2,
- rWhichMap.begin() + nOfs + 4 );
- }
- else
- // extend range upwards
- rWhichMap[nOfs+1] = *pWhichIds;
- bIns = false;
- break;
- }
- }
-
- // append range
- if( bIns )
- {
- rWhichMap.insert( rWhichMap.begin() + rWhichMap.size() - 1,
- aNewRange, aNewRange + 2 );
- }
- }
-}
-
// expanded out version of
// IMPL_LINK_NOARG( SvParser, NewDataRead, LinkParamNone*, void )