MI_DEBUG is never defined
Change-Id: I6f5d74e892d9bdca5a39caa76feb4e3d05b95ba9
This commit is contained in:
@@ -17,46 +17,11 @@
|
|||||||
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
|
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifdef MI_DEBUG
|
|
||||||
#define private public
|
|
||||||
#include <stdio.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include <tools/debug.hxx>
|
#include <tools/debug.hxx>
|
||||||
#include <tools/multisel.hxx>
|
#include <tools/multisel.hxx>
|
||||||
|
|
||||||
#include "rtl/ustrbuf.hxx"
|
#include "rtl/ustrbuf.hxx"
|
||||||
|
|
||||||
#ifdef MI_DEBUG
|
|
||||||
#define DBG(x) x
|
|
||||||
#else
|
|
||||||
#define DBG(x)
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
#ifdef MI_DEBUG
|
|
||||||
static void Print( const MultiSelection* pSel )
|
|
||||||
{
|
|
||||||
DbgOutf( "TotRange: %4ld-%4ld\n",
|
|
||||||
pSel->aTotRange.Min(), pSel->aTotRange.Max() );
|
|
||||||
if ( pSel->bCurValid )
|
|
||||||
{
|
|
||||||
DbgOutf( "CurSubSel: %4ld\n", pSel->nCurSubSel );
|
|
||||||
DbgOutf( "CurIndex: %4ld\n", pSel->nCurIndex );
|
|
||||||
}
|
|
||||||
DbgOutf( "SelCount: %4ld\n", pSel->nSelCount );
|
|
||||||
DbgOutf( "SubCount: %4ld\n", pSel->aSels.Count() );
|
|
||||||
for ( sal_uIntPtr nPos = 0; nPos < pSel->aSels.Count(); ++nPos )
|
|
||||||
{
|
|
||||||
DbgOutf( "SubSel #%2ld: %4ld-%4ld\n", nPos,
|
|
||||||
pSel->aSels.GetObject(nPos)->Min(),
|
|
||||||
pSel->aSels.GetObject(nPos)->Max() );
|
|
||||||
}
|
|
||||||
DbgOutf( "\n" );
|
|
||||||
fclose( pFile );
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
void MultiSelection::ImplClear()
|
void MultiSelection::ImplClear()
|
||||||
{
|
{
|
||||||
// no selected indexes
|
// no selected indexes
|
||||||
@@ -186,16 +151,12 @@ bool MultiSelection::operator== ( MultiSelection& rWith )
|
|||||||
|
|
||||||
void MultiSelection::SelectAll( bool bSelect )
|
void MultiSelection::SelectAll( bool bSelect )
|
||||||
{
|
{
|
||||||
DBG(DbgOutf( "::SelectAll(%s)\n", bSelect ? "sal_True" : "sal_False" ));
|
|
||||||
|
|
||||||
ImplClear();
|
ImplClear();
|
||||||
if ( bSelect )
|
if ( bSelect )
|
||||||
{
|
{
|
||||||
aSels.push_back( new Range(aTotRange) );
|
aSels.push_back( new Range(aTotRange) );
|
||||||
nSelCount = aTotRange.Len();
|
nSelCount = aTotRange.Len();
|
||||||
}
|
}
|
||||||
|
|
||||||
DBG(Print( this ));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool MultiSelection::Select( long nIndex, bool bSelect )
|
bool MultiSelection::Select( long nIndex, bool bSelect )
|
||||||
@@ -256,7 +217,6 @@ bool MultiSelection::Select( long nIndex, bool bSelect )
|
|||||||
|| !aSels[ nSubSelPos ]->IsInside( nIndex )
|
|| !aSels[ nSubSelPos ]->IsInside( nIndex )
|
||||||
) {
|
) {
|
||||||
// not selected, nothing to do
|
// not selected, nothing to do
|
||||||
DBG(Print( this ));
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -271,7 +231,6 @@ bool MultiSelection::Select( long nIndex, bool bSelect )
|
|||||||
::std::advance( it, nSubSelPos );
|
::std::advance( it, nSubSelPos );
|
||||||
delete *it;
|
delete *it;
|
||||||
aSels.erase( it );
|
aSels.erase( it );
|
||||||
DBG(Print( this ));
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -296,8 +255,6 @@ bool MultiSelection::Select( long nIndex, bool bSelect )
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
DBG(Print( this ));
|
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -389,8 +346,6 @@ bool MultiSelection::IsSelected( long nIndex ) const
|
|||||||
|
|
||||||
void MultiSelection::Insert( long nIndex, long nCount )
|
void MultiSelection::Insert( long nIndex, long nCount )
|
||||||
{
|
{
|
||||||
DBG(DbgOutf( "::Insert(%ld, %ld)\n", nIndex, nCount ));
|
|
||||||
|
|
||||||
// find the virtual target position
|
// find the virtual target position
|
||||||
size_t nSubSelPos = ImplFindSubSelection( nIndex );
|
size_t nSubSelPos = ImplFindSubSelection( nIndex );
|
||||||
|
|
||||||
@@ -439,14 +394,10 @@ void MultiSelection::Insert( long nIndex, long nCount )
|
|||||||
aTotRange.Max() += nCount;
|
aTotRange.Max() += nCount;
|
||||||
if ( bSelectNew )
|
if ( bSelectNew )
|
||||||
nSelCount += nCount;
|
nSelCount += nCount;
|
||||||
|
|
||||||
DBG(Print( this ));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void MultiSelection::Remove( long nIndex )
|
void MultiSelection::Remove( long nIndex )
|
||||||
{
|
{
|
||||||
DBG(DbgOutf( "::Remove(%ld)\n", nIndex ));
|
|
||||||
|
|
||||||
// find the virtual target position
|
// find the virtual target position
|
||||||
size_t nSubSelPos = ImplFindSubSelection( nIndex );
|
size_t nSubSelPos = ImplFindSubSelection( nIndex );
|
||||||
|
|
||||||
@@ -479,8 +430,6 @@ void MultiSelection::Remove( long nIndex )
|
|||||||
|
|
||||||
bCurValid = false;
|
bCurValid = false;
|
||||||
aTotRange.Max() -= 1;
|
aTotRange.Max() -= 1;
|
||||||
|
|
||||||
DBG(Print( this ));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
long MultiSelection::ImplFwdUnselected()
|
long MultiSelection::ImplFwdUnselected()
|
||||||
|
Reference in New Issue
Block a user