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; |