Kaydet (Commit) aa054eff authored tarafından Kohei Yoshida's avatar Kohei Yoshida

Take care of xetable.?xx.

Change-Id: I00e57ca172ba41733d39aa5025c3f0a6f1de755d
üst 3594cfd5
......@@ -527,7 +527,7 @@ private:
SCCOL nCellCol;
SCROW nCellRow;
const ScBaseCell* pCell;
ScBaseCell* pCell;
SCCOL nAttrCol1;
SCCOL nAttrCol2;
SCROW nAttrRow;
......@@ -537,7 +537,8 @@ private:
SCCOL nFoundEndCol;
SCROW nFoundRow;
const ScPatternAttr* pFoundPattern;
const ScBaseCell* pFoundCell;
ScRefCellValue maFoundCell;
public:
ScUsedAreaIterator( ScDocument* pDocument, SCTAB nTable,
......@@ -550,7 +551,7 @@ public:
SCCOL GetEndCol() const { return nFoundEndCol; }
SCROW GetRow() const { return nFoundRow; }
const ScPatternAttr* GetPattern() const { return pFoundPattern; }
const ScBaseCell* GetCell() const { return pFoundCell; }
const ScRefCellValue& GetCell() const;
};
class ScRowBreakIterator
......
......@@ -2206,7 +2206,7 @@ bool ScUsedAreaIterator::GetNext()
{
if ( IsGreater( nCellCol, nCellRow, nAttrCol1, nAttrRow ) ) // Only attributes at the beginning?
{
pFoundCell = NULL;
maFoundCell.clear();
pFoundPattern = pPattern;
nFoundRow = nAttrRow;
nFoundStartCol = nAttrCol1;
......@@ -2231,7 +2231,7 @@ bool ScUsedAreaIterator::GetNext()
}
else if ( pPattern ) // Just attributes -> take over right away
{
pFoundCell = NULL;
maFoundCell.clear();
pFoundPattern = pPattern;
nFoundRow = nAttrRow;
nFoundStartCol = nAttrCol1;
......@@ -2242,7 +2242,11 @@ bool ScUsedAreaIterator::GetNext()
if ( bUseCell ) // Cell position
{
pFoundCell = pCell;
if (pCell)
maFoundCell.assign(*pCell);
else
maFoundCell.clear();
nFoundRow = nCellRow;
nFoundStartCol = nFoundEndCol = nCellCol;
}
......@@ -2256,6 +2260,11 @@ bool ScUsedAreaIterator::GetNext()
return bFound;
}
const ScRefCellValue& ScUsedAreaIterator::GetCell() const
{
return maFoundCell;
}
//-------------------------------------------------------------------------------
ScDocAttrIterator::ScDocAttrIterator(ScDocument* pDocument, SCTAB nTable,
......
......@@ -643,25 +643,24 @@ IMPL_FIXEDMEMPOOL_NEWDEL( XclExpLabelCell )
XclExpLabelCell::XclExpLabelCell(
const XclExpRoot& rRoot, const XclAddress& rXclPos,
const ScPatternAttr* pPattern, sal_uInt32 nForcedXFId, const ScStringCell& rCell ) :
const ScPatternAttr* pPattern, sal_uInt32 nForcedXFId, const OUString& rStr ) :
XclExpSingleCellBase( EXC_ID3_LABEL, 0, rXclPos, nForcedXFId )
{
sal_uInt16 nMaxLen = (rRoot.GetBiff() == EXC_BIFF8) ? EXC_STR_MAXLEN : EXC_LABEL_MAXLEN;
XclExpStringRef xText = XclExpStringHelper::CreateCellString(
rRoot, rCell.GetString(), pPattern, EXC_STR_DEFAULT, nMaxLen );
rRoot, rStr, pPattern, EXC_STR_DEFAULT, nMaxLen);
Init( rRoot, pPattern, xText );
}
XclExpLabelCell::XclExpLabelCell(
const XclExpRoot& rRoot, const XclAddress& rXclPos,
const ScPatternAttr* pPattern, sal_uInt32 nForcedXFId,
const ScEditCell& rCell, XclExpHyperlinkHelper& rLinkHelper ) :
const EditTextObject* pEditText, XclExpHyperlinkHelper& rLinkHelper ) :
XclExpSingleCellBase( EXC_ID3_LABEL, 0, rXclPos, nForcedXFId )
{
sal_uInt16 nMaxLen = (rRoot.GetBiff() == EXC_BIFF8) ? EXC_STR_MAXLEN : EXC_LABEL_MAXLEN;
XclExpStringRef xText;
const EditTextObject* pEditText = rCell.GetData();
if (pEditText)
xText = XclExpStringHelper::CreateCellString(
rRoot, *pEditText, pPattern, rLinkHelper, EXC_STR_DEFAULT, nMaxLen);
......@@ -2301,7 +2300,7 @@ XclExpCellTable::XclExpCellTable( const XclExpRoot& rRoot ) :
XclAddress aXclPos( static_cast< sal_uInt16 >( nScCol ), static_cast< sal_uInt32 >( nScRow ) );
sal_uInt16 nLastXclCol = static_cast< sal_uInt16 >( nLastScCol );
const ScBaseCell* pScCell = aIt.GetCell();
const ScRefCellValue& rScCell = aIt.GetCell();
XclExpCellRef xCell;
const ScPatternAttr* pPattern = aIt.GetPattern();
......@@ -2324,12 +2323,11 @@ XclExpCellTable::XclExpCellTable( const XclExpRoot& rRoot ) :
String aAddNoteText; // additional text to be appended to a note
CellType eCellType = pScCell ? pScCell->GetCellType() : CELLTYPE_NONE;
switch( eCellType )
switch (rScCell.meType)
{
case CELLTYPE_VALUE:
{
double fValue = static_cast< const ScValueCell* >( pScCell )->GetValue();
double fValue = rScCell.mfValue;
// try to create a Boolean cell
if( pPattern && ((fValue == 0.0) || (fValue == 1.0)) )
......@@ -2355,18 +2353,16 @@ XclExpCellTable::XclExpCellTable( const XclExpRoot& rRoot ) :
case CELLTYPE_STRING:
{
const ScStringCell& rScStrCell = *static_cast< const ScStringCell* >( pScCell );
xCell.reset( new XclExpLabelCell(
GetRoot(), aXclPos, pPattern, nMergeBaseXFId, rScStrCell ) );
xCell.reset(new XclExpLabelCell(
GetRoot(), aXclPos, pPattern, nMergeBaseXFId, *rScCell.mpString));
}
break;
case CELLTYPE_EDIT:
{
const ScEditCell& rScEditCell = *static_cast< const ScEditCell* >( pScCell );
XclExpHyperlinkHelper aLinkHelper( GetRoot(), aScPos );
xCell.reset( new XclExpLabelCell(
GetRoot(), aXclPos, pPattern, nMergeBaseXFId, rScEditCell, aLinkHelper ) );
xCell.reset(new XclExpLabelCell(
GetRoot(), aXclPos, pPattern, nMergeBaseXFId, rScCell.mpEditText, aLinkHelper));
// add a single created HLINK record to the record list
if( aLinkHelper.HasLinkRecord() )
......@@ -2379,10 +2375,9 @@ XclExpCellTable::XclExpCellTable( const XclExpRoot& rRoot ) :
case CELLTYPE_FORMULA:
{
const ScFormulaCell& rScFmlaCell = *static_cast< const ScFormulaCell* >( pScCell );
xCell.reset( new XclExpFormulaCell(
xCell.reset(new XclExpFormulaCell(
GetRoot(), aXclPos, pPattern, nMergeBaseXFId,
rScFmlaCell, maArrayBfr, maShrfmlaBfr, maTableopBfr ) );
*rScCell.mpFormula, maArrayBfr, maShrfmlaBfr, maTableopBfr));
}
break;
......
......@@ -399,9 +399,8 @@ private:
bool mbValue; /// The cell value.
};
class ScStringCell;
class ScEditCell;
class XclExpHyperlinkHelper;
class EditTextObject;
/** Represents a text cell record.
......@@ -417,12 +416,12 @@ public:
/** Constructs the record from an unformatted Calc string cell. */
explicit XclExpLabelCell( const XclExpRoot& rRoot, const XclAddress& rXclPos,
const ScPatternAttr* pPattern, sal_uInt32 nForcedXFId,
const ScStringCell& rCell );
const OUString& rStr );
/** Constructs the record from a formatted Calc edit cell. */
explicit XclExpLabelCell( const XclExpRoot& rRoot, const XclAddress& rXclPos,
const ScPatternAttr* pPattern, sal_uInt32 nForcedXFId,
const ScEditCell& rCell, XclExpHyperlinkHelper& rHlinkHelper );
const EditTextObject* pEditText, XclExpHyperlinkHelper& rHlinkHelper );
/** Returns true if the cell contains multi-line text. */
virtual bool IsMultiLineText() const;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment