View | Details | Raw Unified | Return to issue 120847
Collapse All | Expand All

(-)boost/prj/d.lst (+8 lines)
Lines 310-312 Link Here
310
..\%__SRC%\inc\boost\utility\detail\* %_DEST%\inc%_EXT%\boost\utility\detail
310
..\%__SRC%\inc\boost\utility\detail\* %_DEST%\inc%_EXT%\boost\utility\detail
311
..\%__SRC%\inc\boost\variant\* %_DEST%\inc%_EXT%\boost\variant
311
..\%__SRC%\inc\boost\variant\* %_DEST%\inc%_EXT%\boost\variant
312
..\%__SRC%\inc\boost\variant\detail\* %_DEST%\inc%_EXT%\boost\variant\detail
312
..\%__SRC%\inc\boost\variant\detail\* %_DEST%\inc%_EXT%\boost\variant\detail
313
314
mkdir: %_DEST%\inc%_EXT%\boost\lambda
315
..\%__SRC%\misc\build\boost-1.30.2\boost\lambda\*.*pp %_DEST%\inc%_EXT%\boost\lambda\*.*pp
316
..\%__SRC%\misc\build\boost_1_39_0\boost\lambda\* %_DEST%\inc%_EXT%\boost\lambda
317
mkdir: %_DEST%\inc%_EXT%\boost\lambda\detail
318
..\%__SRC%\misc\build\boost-1.30.2\boost\lambda\detail\*.*pp %_DEST%\inc%_EXT%\boost\lambda\detail\*.*pp
319
..\%__SRC%\misc\build\boost_1_39_0\boost\lambda\detail\* %_DEST%\inc%_EXT%\boost\lambda\detail
320
(-)sc/inc/cell.hxx (+34 lines)
Lines 38-43 Link Here
38
#include <unotools/fontcvt.hxx>
38
#include <unotools/fontcvt.hxx>
39
#include "scdllapi.h"
39
#include "scdllapi.h"
40
40
41
#include <cellform.hxx>
42
41
#define USE_MEMPOOL
43
#define USE_MEMPOOL
42
#define TEXTWIDTH_DIRTY		0xffff
44
#define TEXTWIDTH_DIRTY		0xffff
43
45
Lines 497-502 Link Here
497
};
499
};
498
500
499
// ============================================================================
501
// ============================================================================
502
inline double GetValueFromCell( const ScBaseCell * pCell )
503
{
504
    switch (pCell->GetCellType())
505
    {
506
    case CELLTYPE_VALUE:
507
        return ((ScValueCell*)pCell)->GetValue();
508
    case CELLTYPE_FORMULA:
509
        {
510
            if (((ScFormulaCell*)pCell)->IsValue())
511
                return ((ScFormulaCell*)pCell)->GetValue();
512
            else
513
                return 0.0;
514
        }
515
    default:
516
        return 0.0;
517
    }
518
}
519
// ============================================================================
500
520
521
522
inline String GetStringFromCell( const ScBaseCell * pCell, sal_uLong nFormat, SvNumberFormatter* pFormatter )
523
{
524
    if (pCell->GetCellType() != CELLTYPE_NOTE)
525
    {
526
        String strResult;
527
	Color* pColor = NULL;
528
        ScCellFormat::GetString( const_cast<ScBaseCell*>(pCell), nFormat, strResult, &pColor, *(pFormatter) );
529
        return strResult;
530
    }
531
    else
532
        return String();
533
}
534
501
#endif
535
#endif
502
536
(-)sc/inc/column.hxx (+4 lines)
Lines 60-65 Link Here
60
struct ScFunctionData;
60
struct ScFunctionData;
61
struct ScLineFlags;
61
struct ScLineFlags;
62
struct ScMergePatternState;
62
struct ScMergePatternState;
63
class ScDPTableDataCache;
63
class ScFlatBoolRowSegments;
64
class ScFlatBoolRowSegments;
64
65
65
#define COLUMN_DELTA	4
66
#define COLUMN_DELTA	4
Lines 360-365 Link Here
360
									double nPPTX, double nPPTY,
361
									double nPPTX, double nPPTY,
361
									const Fraction& rZoomX, const Fraction& rZoomY,
362
									const Fraction& rZoomX, const Fraction& rZoomY,
362
									sal_Bool bShrink, sal_uInt16 nMinHeight, SCROW nMinStart );
363
									sal_Bool bShrink, sal_uInt16 nMinHeight, SCROW nMinStart );
364
    template< typename TAddLebal, typename TAddData >
365
    void        FillDPCacheT( long nDim, SCROW nStartRow, SCROW nEndRow, const TAddLebal & , const TAddData & );
366
    void        FillDPCache( ScDPTableDataCache * pCache, long nDim, SCROW nStartRow, SCROW nEndRow );
363
private:
367
private:
364
	long		GetSimpleTextNeededSize( SCSIZE nIndex, OutputDevice* pDev,
368
	long		GetSimpleTextNeededSize( SCSIZE nIndex, OutputDevice* pDev,
365
									sal_Bool bWidth );
369
									sal_Bool bWidth );
(-)sc/inc/document.hxx (+2 lines)
Lines 1876-1881 Link Here
1876
1876
1877
	std::map< SCTAB, ScSortParam > mSheetSortParams;
1877
	std::map< SCTAB, ScSortParam > mSheetSortParams;
1878
1878
1879
public:
1880
    void    FillDPCache( ScDPTableDataCache * pCache, SCTAB nDocTab, SCCOL nStartCol, SCCOL nEndCol, SCROW nStartRow, SCROW nEndRow );
1879
};
1881
};
1880
inline void ScDocument::GetSortParam( ScSortParam& rParam, SCTAB nTab )
1882
inline void ScDocument::GetSortParam( ScSortParam& rParam, SCTAB nTab )
1881
{
1883
{
(-)sc/inc/dpglobal.hxx (+2 lines)
Lines 196-199 Link Here
196
   bool ChkDPTableOverlap( ScDocument *pDestDoc, std::list<ScDPObject> & rClipboard, SCCOL nClipStartCol, SCROW nClipStartRow, SCCOL nStartCol, SCROW nStartRow, SCTAB nStartTab, sal_uInt16 nEndTab, sal_Bool bExcludeClip = sal_False );
196
   bool ChkDPTableOverlap( ScDocument *pDestDoc, std::list<ScDPObject> & rClipboard, SCCOL nClipStartCol, SCROW nClipStartRow, SCCOL nStartCol, SCROW nStartRow, SCTAB nStartTab, sal_uInt16 nEndTab, sal_Bool bExcludeClip = sal_False );
197
197
198
}
198
}
199
#define isDateFormat( nNumType ) (!!((nNumType) & NUMBERFORMAT_DATE) )
200
199
#endif 
201
#endif 
(-)sc/inc/dptablecache.hxx (-1 / +3 lines)
Lines 107-114 Link Here
107
107
108
protected:
108
protected:
109
private:
109
private:
110
public:
110
	void		AddLabel( ScDPItemData* pData);
111
	void		AddLabel( ScDPItemData* pData);
111
	sal_Bool	AddData( long nDim, ScDPItemData* itemData );
112
    template< bool bCheckDate >
113
    sal_Bool	AddData( long nDim, ScDPItemData* itemData );
112
};
114
};
113
115
114
#endif //DPTABLECACHE_HXX
116
#endif //DPTABLECACHE_HXX
(-)sc/inc/table.hxx (+1 lines)
Lines 313-318 Link Here
313
	void 		SetError( SCCOL nCol, SCROW nRow, sal_uInt16 nError);
313
	void 		SetError( SCCOL nCol, SCROW nRow, sal_uInt16 nError);
314
314
315
	void		GetString( SCCOL nCol, SCROW nRow, String& rString );
315
	void		GetString( SCCOL nCol, SCROW nRow, String& rString );
316
    void    FillDPCache( ScDPTableDataCache * pCache, SCCOL nStartCol, SCCOL nEndCol, SCROW nStartRow, SCROW nEndRow );
316
	void		GetInputString( SCCOL nCol, SCROW nRow, String& rString );
317
	void		GetInputString( SCCOL nCol, SCROW nRow, String& rString );
317
	double		GetValue( const ScAddress& rPos ) const
318
	double		GetValue( const ScAddress& rPos ) const
318
					{
319
					{
(-)sc/source/core/data/column3.cxx (-2 / +74 lines)
Lines 31-36 Link Here
31
#include <svl/zforlist.hxx>
31
#include <svl/zforlist.hxx>
32
#include <svl/zformat.hxx>
32
#include <svl/zformat.hxx>
33
33
34
#include "boost/tuple/tuple.hpp"
35
#include <boost/function.hpp>
36
#include "boost/lambda/bind.hpp"
37
#include "boost/bind.hpp"
38
#include "boost/lambda/lambda.hpp"
34
#include "scitems.hxx"
39
#include "scitems.hxx"
35
#include "column.hxx"
40
#include "column.hxx"
36
#include "cell.hxx"
41
#include "cell.hxx"
Lines 48-56 Link Here
48
#include "detfunc.hxx"			// fuer Notizen bei DeleteRange
53
#include "detfunc.hxx"			// fuer Notizen bei DeleteRange
49
#include "postit.hxx"
54
#include "postit.hxx"
50
#include "stringutil.hxx"
55
#include "stringutil.hxx"
51
56
#include "dpglobal.hxx"
57
#include <dptablecache.hxx>
52
#include <com/sun/star/i18n/LocaleDataItem.hpp>
58
#include <com/sun/star/i18n/LocaleDataItem.hpp>
53
54
using ::com::sun::star::i18n::LocaleDataItem;
59
using ::com::sun::star::i18n::LocaleDataItem;
55
using ::rtl::OUString;
60
using ::rtl::OUString;
56
using ::rtl::OUStringBuffer;
61
using ::rtl::OUStringBuffer;
Lines 1724-1730 Link Here
1724
		rString.Erase();
1729
		rString.Erase();
1725
}
1730
}
1726
1731
1732
template<>
1733
void  ScColumn::FillDPCacheT( long nDim, SCROW nStartRow, SCROW nEndRow, const boost::function<void(ScDPItemData*)> & rAddLabel, const boost::function<sal_Bool(long,ScDPItemData*)> & rAddData )
1734
{
1735
    SCROW nPattenRowStart = -1, nPatternRowEnd = -1;
1736
    SvNumberFormatter* pFormatter = pDocument->GetFormatTable();
1737
    sal_uLong nNumberFormat = 0;
1738
    sal_uLong nNumberFormatType = NUMBERFORMAT_NUMBER;
1739
    SCROW nCurRow = nStartRow;
1740
    ScDPItemData * pDPItemData = NULL;
1727
1741
1742
    if ( pItems )
1743
    {
1744
        SCSIZE nIndex;
1745
        
1746
        for ( Search( nStartRow, nIndex ) ? void( ) : void(nIndex = nCount); nIndex < nCount && pItems[nIndex].nRow <= nEndRow; ++nIndex, ++nCurRow )
1747
        {
1748
            for( ; nCurRow < pItems[nIndex].nRow; nCurRow++ )
1749
                if( nCurRow == nStartRow )
1750
                    rAddLabel( new ScDPItemData() );
1751
                else
1752
                    rAddData( nDim, new ScDPItemData() );
1753
1754
            if( nCurRow > nPatternRowEnd )
1755
                if( const ScPatternAttr* pPattern = pAttrArray ? pAttrArray->GetPatternRange( nPattenRowStart, nPatternRowEnd, nCurRow ) : NULL )
1756
                    nNumberFormatType = pFormatter->GetType( nNumberFormat = pPattern->GetNumberFormat( pFormatter ) );
1757
                else
1758
                    nNumberFormatType = NUMBERFORMAT_NUMBER, nNumberFormat = 0;
1759
1760
            if( ScBaseCell* pCell = pItems[nIndex].pCell )
1761
                if( pCell->GetCellType() == CELLTYPE_FORMULA && ((ScFormulaCell*)pCell)->GetErrCode() )
1762
		{
1763
		    String str( GetStringFromCell( pCell, nNumberFormat, pFormatter ) );
1764
		    sal_uInt8 bFlag = ScDPItemData::MK_ERR;
1765
                    pDPItemData = new ScDPItemData( 0, str, 0.0, bFlag );
1766
		}
1767
                else if( pCell->HasValueData() )
1768
                {
1769
                    double fVal = GetValueFromCell( pCell );
1770
                    String str( GetStringFromCell( pCell, nNumberFormat, pFormatter ) );
1771
                    sal_uInt8 bFlag = ScDPItemData::MK_VAL|ScDPItemData::MK_DATA|(ScDPItemData::MK_DATE * isDateFormat( nNumberFormatType ));
1772
                    pDPItemData = new ScDPItemData( nNumberFormat, str, fVal, bFlag );
1773
                }
1774
                else if( !pCell->IsBlank() )
1775
                    pDPItemData = new ScDPItemData( GetStringFromCell( pCell, nNumberFormat, pFormatter ) );
1776
                else
1777
                    pDPItemData = new ScDPItemData();
1778
            else
1779
                pDPItemData = new ScDPItemData();
1780
1781
            if( nCurRow == nStartRow )
1782
                rAddLabel( pDPItemData );
1783
            else
1784
                rAddData( nDim, pDPItemData );
1785
        }
1786
    }
1787
1788
    for( ; nCurRow <= nEndRow; nCurRow++ )
1789
        if( nCurRow == nStartRow )
1790
            rAddLabel( new ScDPItemData() );
1791
        else
1792
            rAddData( nDim, new ScDPItemData() );
1793
}
1794
void  ScColumn::FillDPCache( ScDPTableDataCache * pCache, long nDim, SCROW nStartRow, SCROW nEndRow )
1795
{
1796
    typedef sal_Bool(ScDPTableDataCache::*PFNAddData)( long, ScDPItemData* );
1797
    FillDPCacheT<boost::function<void(ScDPItemData*)>, boost::function<sal_Bool(long,ScDPItemData*)> >( nDim, nStartRow, nEndRow, boost::bind( &ScDPTableDataCache::AddLabel, pCache, _1 ), boost::bind( (PFNAddData)&ScDPTableDataCache::AddData<false>, pCache, _1, _2 ) );
1798
}
1799
1728
void ScColumn::GetInputString( SCROW nRow, String& rString ) const
1800
void ScColumn::GetInputString( SCROW nRow, String& rString ) const
1729
{
1801
{
1730
	SCSIZE	nIndex;
1802
	SCSIZE	nIndex;
(-)sc/source/core/data/document.cxx (+5 lines)
Lines 2683-2688 Link Here
2683
		rString.Erase();
2683
		rString.Erase();
2684
}
2684
}
2685
2685
2686
void ScDocument::FillDPCache( ScDPTableDataCache * pCache, SCTAB nTab, SCCOL nStartCol, SCCOL nEndCol, SCROW nStartRow, SCROW nEndRow )
2687
{
2688
    if ( VALIDTAB(nTab) && pTab[nTab] )
2689
        pTab[nTab]->FillDPCache( pCache, nStartCol, nEndCol, nStartRow, nEndRow );
2690
}
2686
2691
2687
void ScDocument::GetInputString( SCCOL nCol, SCROW nRow, SCTAB nTab, String& rString )
2692
void ScDocument::GetInputString( SCCOL nCol, SCROW nRow, SCTAB nTab, String& rString )
2688
{
2693
{
(-)sc/source/core/data/dptablecache.cxx (-16 / +17 lines)
Lines 49-54 Link Here
49
using ::com::sun::star::uno::Reference;
49
using ::com::sun::star::uno::Reference;
50
using ::com::sun::star::uno::UNO_QUERY;
50
using ::com::sun::star::uno::UNO_QUERY;
51
using ::com::sun::star::uno::UNO_QUERY_THROW;
51
using ::com::sun::star::uno::UNO_QUERY_THROW;
52
52
// -----------------------------------------------------------------------
53
// -----------------------------------------------------------------------
53
namespace 
54
namespace 
54
{
55
{
Lines 474-480 Link Here
474
	else
475
	else
475
	{
476
	{
476
		for ( sal_uInt16 i = 0; i < nCount && i < mnColumnCount; i ++ )
477
		for ( sal_uInt16 i = 0; i < nCount && i < mnColumnCount; i ++ )
477
			AddData( i, new ScDPItemData( pRow[i] ) );
478
			AddData<true>( i, new ScDPItemData( pRow[i] ) );
478
	}
479
	}
479
}
480
}
480
481
Lines 548-564 Link Here
548
	mpSourceData	  = new std::vector<SCROW>[ mnColumnCount ];
549
	mpSourceData	  = new std::vector<SCROW>[ mnColumnCount ];
549
	mpGlobalOrder	  = new	std::vector<SCROW>[ mnColumnCount ];
550
	mpGlobalOrder	  = new	std::vector<SCROW>[ mnColumnCount ];
550
	mpIndexOrder	  = new std::vector<SCROW>[ mnColumnCount ];
551
	mpIndexOrder	  = new std::vector<SCROW>[ mnColumnCount ];
551
	//check valid
552
    pDoc->FillDPCache( this, nDocTab, nStartCol, nEndCol, nStartRow, nEndRow );
552
	for ( SCROW nRow = nStartRow; nRow <= nEndRow; nRow ++ )
553
	{
554
		for ( sal_uInt16 nCol = nStartCol; nCol <= nEndCol; nCol++ )
555
		{
556
			if ( nRow == nStartRow )
557
				AddLabel( new ScDPItemData( pDoc, nRow, nCol, nDocTab  ) );
558
			else
559
				AddData( nCol - nStartCol, new ScDPItemData( pDoc, nRow, nCol, nDocTab  ) );
560
		}
561
	}
562
	return sal_True;
553
	return sal_True;
563
}
554
}
564
555
Lines 616-622 Link Here
616
            {
607
            {
617
               ScDPItemData * pNew =  lcl_GetItemValue( xRow, aColTypes[nCol], nCol+1, rNullDate );
608
               ScDPItemData * pNew =  lcl_GetItemValue( xRow, aColTypes[nCol], nCol+1, rNullDate );
618
                if ( pNew )
609
                if ( pNew )
619
                    AddData(  nCol , pNew );
610
                    AddData<true>(  nCol , pNew );
620
            }
611
            }
621
        }
612
        }
622
        while (xRowSet->next());
613
        while (xRowSet->next());
Lines 872-877 Link Here
872
	return !GetItemDataById( nColumn, GetItemDataId( nColumn, nRow, sal_False ) )->IsHasData();
863
	return !GetItemDataById( nColumn, GetItemDataId( nColumn, nRow, sal_False ) )->IsHasData();
873
}
864
}
874
865
866
template< bool bCheckDate >
875
sal_Bool ScDPTableDataCache::AddData(long nDim, ScDPItemData* pitemData)
867
sal_Bool ScDPTableDataCache::AddData(long nDim, ScDPItemData* pitemData)
876
{
868
{
877
	DBG_ASSERT( IsValid(), "  IsValid() == false " );
869
	DBG_ASSERT( IsValid(), "  IsValid() == false " );
Lines 880-887 Link Here
880
872
881
	sal_Bool	bInserted = sal_False;
873
	sal_Bool	bInserted = sal_False;
882
	
874
	
875
    if( bCheckDate )
883
	pitemData->SetDate( lcl_isDate( GetNumType( pitemData->nNumFormat ) ) );
876
	pitemData->SetDate( lcl_isDate( GetNumType( pitemData->nNumFormat ) ) );
884
877
	
885
	if ( !lcl_Search( mpTableDataValues[nDim], mpGlobalOrder[nDim], *pitemData, nIndex ) )
878
	if ( !lcl_Search( mpTableDataValues[nDim], mpGlobalOrder[nDim], *pitemData, nIndex ) )
886
	{
879
	{
887
		mpTableDataValues[nDim].push_back( pitemData );
880
		mpTableDataValues[nDim].push_back( pitemData );
Lines 908-913 Link Here
908
}
901
}
909
902
910
903
904
void func_dummy()
905
{
906
    sal_Bool (ScDPTableDataCache::*pfnAddData)(long , ScDPItemData* )
907
        = &ScDPTableDataCache::AddData<false>;
908
909
    pfnAddData = (sal_Bool (ScDPTableDataCache::*)(long , ScDPItemData* ))&ScDPTableDataCache::AddData<true>;
910
}
911
911
String ScDPTableDataCache::GetDimensionName( sal_uInt16 nColumn ) const
912
String ScDPTableDataCache::GetDimensionName( sal_uInt16 nColumn ) const
912
{
913
{
913
    DBG_ASSERT( /* nColumn>=0 && */ nColumn < mrLabelNames.size()-1 , "ScDPTableDataCache::GetDimensionName");
914
    DBG_ASSERT( /* nColumn>=0 && */ nColumn < mrLabelNames.size()-1 , "ScDPTableDataCache::GetDimensionName");
Lines 920-925 Link Here
920
		return String();
921
		return String();
921
}
922
}
922
923
924
923
void ScDPTableDataCache::AddLabel(ScDPItemData *pData)
925
void ScDPTableDataCache::AddLabel(ScDPItemData *pData)
924
{  
926
{  
925
	DBG_ASSERT( IsValid(), "  IsValid() == false " );
927
	DBG_ASSERT( IsValid(), "  IsValid() == false " );
Lines 1134-1138 Link Here
1134
long	ScDPTableDataCache::GetId() const 
1136
long	ScDPTableDataCache::GetId() const 
1135
{
1137
{
1136
	return mnID; 
1138
	return mnID; 
1137
}
1139
}
1138
 
(-)sc/source/core/data/table2.cxx (+7 lines)
Lines 1054-1060 Link Here
1054
		rString.Erase();
1054
		rString.Erase();
1055
}
1055
}
1056
1056
1057
void  ScTable::FillDPCache( ScDPTableDataCache * pCache, SCCOL nStartCol, SCCOL nEndCol, SCROW nStartRow, SCROW nEndRow )
1058
{
1059
    for ( sal_uInt16 nCol = nStartCol; nCol <= nEndCol; nCol++ )
1060
        if( ValidCol( nCol ) )
1061
            aCol[nCol].FillDPCache( pCache, nCol - nStartCol, nStartRow, nEndRow );
1062
}
1057
1063
1064
1058
void ScTable::GetInputString( SCCOL nCol, SCROW nRow, String& rString )
1065
void ScTable::GetInputString( SCCOL nCol, SCROW nRow, String& rString )
1059
{
1066
{
1060
	if (ValidColRow(nCol,nRow))
1067
	if (ValidColRow(nCol,nRow))

Return to issue 120847