sc-xls-builtin-name-scope.diff: Print_Area/_Titles only for sheet local names

n#191005, n#257422
This commit is contained in:
Jonathan Pryor 2010-09-15 11:49:27 +02:00 committed by Fridrich Štrba
parent 164aca5f32
commit 82edbbe8b7
6 changed files with 45 additions and 31 deletions

View file

@ -898,7 +898,8 @@ ConvErr ExcelToSc::Convert( const ScTokenArray*& pErgebnis, XclImpStream& aIn, s
// stream seeks to first byte after <nFormulaLen>
ConvErr ExcelToSc::Convert( _ScRangeListTabs& rRangeList, XclImpStream& aIn, sal_Size nFormulaLen, const FORMULA_TYPE eFT )
ConvErr ExcelToSc::Convert( _ScRangeListTabs& rRangeList, XclImpStream& aIn, sal_Size nFormulaLen,
SCsTAB nTab, const FORMULA_TYPE eFT )
{
RootData& rR = GetOldRoot();
BYTE nOp, nLen;
@ -1066,7 +1067,7 @@ ConvErr ExcelToSc::Convert( _ScRangeListTabs& rRangeList, XclImpStream& aIn, sal
ExcRelToScRel( nUINT16, nByte, aSRD, bRangeName );
rRangeList.Append( aSRD );
rRangeList.Append( aSRD, nTab );
break;
case 0x45:
case 0x65:
@ -1093,7 +1094,7 @@ ConvErr ExcelToSc::Convert( _ScRangeListTabs& rRangeList, XclImpStream& aIn, sal
else if( IsComplRowRange( nRowFirst, nRowLast ) )
SetComplRow( aCRD );
rRangeList.Append( aCRD );
rRangeList.Append( aCRD, nTab );
}
break;
case 0x46:
@ -1130,7 +1131,7 @@ ConvErr ExcelToSc::Convert( _ScRangeListTabs& rRangeList, XclImpStream& aIn, sal
ExcRelToScRel( nUINT16, nByte, aSRD, bRNorSF );
rRangeList.Append( aSRD );
rRangeList.Append( aSRD, nTab );
}
break;
case 0x4D:
@ -1156,7 +1157,7 @@ ConvErr ExcelToSc::Convert( _ScRangeListTabs& rRangeList, XclImpStream& aIn, sal
else if( IsComplRowRange( nRowFirst, nRowLast ) )
SetComplRow( aCRD );
rRangeList.Append( aCRD );
rRangeList.Append( aCRD, nTab );
}
break;
case 0x49:
@ -1226,10 +1227,10 @@ ConvErr ExcelToSc::Convert( _ScRangeListTabs& rRangeList, XclImpStream& aIn, sal
b3D = ( static_cast<SCTAB>(nTabLast) != aEingPos.Tab() );
aCRD.Ref2.SetFlag3D( b3D );
aCRD.Ref2.SetTabRel( FALSE );
rRangeList.Append( aCRD );
rRangeList.Append( aCRD, nTab );
}
else
rRangeList.Append( aSRD );
rRangeList.Append( aSRD, nTab );
}
}
@ -1284,7 +1285,7 @@ ConvErr ExcelToSc::Convert( _ScRangeListTabs& rRangeList, XclImpStream& aIn, sal
else if( IsComplRowRange( nRowFirst, nRowLast ) )
SetComplRow( aCRD );
rRangeList.Append( aCRD );
rRangeList.Append( aCRD, nTab );
}//ENDE in aktuellem Workbook
}
break;

View file

@ -871,7 +871,8 @@ ConvErr ExcelToSc8::Convert( const ScTokenArray*& rpTokArray, XclImpStream& aIn,
// stream seeks to first byte after <nFormulaLen>
ConvErr ExcelToSc8::Convert( _ScRangeListTabs& rRangeList, XclImpStream& aIn, sal_Size nFormulaLen, const FORMULA_TYPE eFT )
ConvErr ExcelToSc8::Convert( _ScRangeListTabs& rRangeList, XclImpStream& aIn, sal_Size nFormulaLen,
SCsTAB nTab, const FORMULA_TYPE eFT )
{
BYTE nOp, nLen;//, nByte;
BOOL bError = FALSE;
@ -1002,7 +1003,7 @@ ConvErr ExcelToSc8::Convert( _ScRangeListTabs& rRangeList, XclImpStream& aIn, sa
ExcRelToScRel8( nRow, nCol, aSRD, bRangeName );
rRangeList.Append( aSRD );
rRangeList.Append( aSRD, nTab );
}
break;
case 0x45:
@ -1030,7 +1031,7 @@ ConvErr ExcelToSc8::Convert( _ScRangeListTabs& rRangeList, XclImpStream& aIn, sa
else if( IsComplRowRange( nRowFirst, nRowLast ) )
SetComplRow( aCRD );
rRangeList.Append( aCRD );
rRangeList.Append( aCRD, nTab );
}
break;
case 0x46:
@ -1074,7 +1075,7 @@ ConvErr ExcelToSc8::Convert( _ScRangeListTabs& rRangeList, XclImpStream& aIn, sa
ExcRelToScRel8( nRow, nCol, aSRD, bRNorSF );
rRangeList.Append( aSRD );
rRangeList.Append( aSRD, nTab );
}
break;
case 0x4D:
@ -1100,7 +1101,7 @@ ConvErr ExcelToSc8::Convert( _ScRangeListTabs& rRangeList, XclImpStream& aIn, sa
else if( IsComplRowRange( nRowFirst, nRowLast ) )
SetComplRow( aCRD );
rRangeList.Append( aCRD );
rRangeList.Append( aCRD, nTab );
}
break;
case 0x4E:
@ -1142,10 +1143,10 @@ ConvErr ExcelToSc8::Convert( _ScRangeListTabs& rRangeList, XclImpStream& aIn, sa
aCRD.Ref2.nCol = aSRD.nCol;
aCRD.Ref2.nRow = aSRD.nRow;
aCRD.Ref2.nTab = nLastScTab;
rRangeList.Append( aCRD );
rRangeList.Append( aCRD, nTab );
}
else
rRangeList.Append( aSRD );
rRangeList.Append( aSRD, nTab );
}
}
break;
@ -1178,7 +1179,7 @@ ConvErr ExcelToSc8::Convert( _ScRangeListTabs& rRangeList, XclImpStream& aIn, sa
else if( IsComplRowRange( nRw1, nRw2 ) )
SetComplRow( aCRD );
rRangeList.Append( aCRD );
rRangeList.Append( aCRD, nTab );
}
}
break;

View file

@ -78,7 +78,7 @@ _ScRangeListTabs::~_ScRangeListTabs()
}
void _ScRangeListTabs::Append( ScSingleRefData a, const BOOL b )
void _ScRangeListTabs::Append( ScSingleRefData a, SCsTAB nTab, const BOOL b )
{
if( b )
{
@ -98,19 +98,24 @@ void _ScRangeListTabs::Append( ScSingleRefData a, const BOOL b )
bHasRanges = TRUE;
if( a.nTab >= 0 )
if( nTab == SCTAB_MAX)
return;
if( nTab < 0)
nTab = a.nTab;
if( nTab >= 0 )
{
_ScRangeList* p = ppTabLists[ a.nTab ];
_ScRangeList* p = ppTabLists[ nTab ];
if( !p )
p = ppTabLists[ a.nTab ] = new _ScRangeList;
p = ppTabLists[ nTab ] = new _ScRangeList;
p->Append( a );
}
}
void _ScRangeListTabs::Append( ScComplexRefData a, const BOOL b )
void _ScRangeListTabs::Append( ScComplexRefData a, SCsTAB nTab, const BOOL b )
{
if( b )
{
@ -158,12 +163,17 @@ void _ScRangeListTabs::Append( ScComplexRefData a, const BOOL b )
bHasRanges = TRUE;
if( a.Ref1.nTab >= 0 )
if( nTab == SCTAB_MAX)
return;
if( nTab < -1)
nTab = a.Ref1.nTab;
if( nTab >= 0 )
{
_ScRangeList* p = ppTabLists[ a.Ref1.nTab ];
_ScRangeList* p = ppTabLists[ nTab ];
if( !p )
p = ppTabLists[ a.Ref1.nTab ] = new _ScRangeList;
p = ppTabLists[ nTab ] = new _ScRangeList;
p->Append( a );
}

View file

@ -158,16 +158,18 @@ XclImpName::XclImpName( XclImpStream& rStrm, sal_uInt16 nXclNameIdx ) :
}
else if( bBuiltIn )
{
SCsTAB const nLocalTab = (nXclTab == EXC_NAME_GLOBAL) ? SCTAB_MAX : (nXclTab - 1);
// --- print ranges or title ranges ---
rStrm.PushPosition();
switch( mcBuiltIn )
{
case EXC_BUILTIN_PRINTAREA:
if( rFmlaConv.Convert( GetPrintAreaBuffer(), rStrm, nFmlaSize, FT_RangeName ) == ConvOK )
if( rFmlaConv.Convert( GetPrintAreaBuffer(), rStrm, nFmlaSize, nLocalTab, FT_RangeName ) == ConvOK )
nNameType |= RT_PRINTAREA;
break;
case EXC_BUILTIN_PRINTTITLES:
if( rFmlaConv.Convert( GetTitleAreaBuffer(), rStrm, nFmlaSize, FT_RangeName ) == ConvOK )
if( rFmlaConv.Convert( GetTitleAreaBuffer(), rStrm, nFmlaSize, nLocalTab, FT_RangeName ) == ConvOK )
nNameType |= RT_COLHEADER | RT_ROWHEADER;
break;
}

View file

@ -61,7 +61,7 @@ public:
virtual ConvErr Convert( const ScTokenArray*&, XclImpStream& rStrm, sal_Size nFormulaLen,
bool bAllowArrays, const FORMULA_TYPE eFT = FT_CellFormula );
virtual ConvErr Convert( _ScRangeListTabs&, XclImpStream& rStrm, sal_Size nFormulaLen, const FORMULA_TYPE eFT = FT_CellFormula );
virtual ConvErr Convert( _ScRangeListTabs&, XclImpStream& rStrm, sal_Size nFormulaLen, SCsTAB nTab, const FORMULA_TYPE eFT = FT_CellFormula );
virtual ConvErr ConvertExternName( const ScTokenArray*& rpArray, XclImpStream& rStrm, sal_Size nFormulaLen,
const String& rUrl, const ::std::vector<String>& rTabNames );
@ -137,7 +137,7 @@ public:
virtual ConvErr Convert( const ScTokenArray*& rpTokArray, XclImpStream& rStrm, sal_Size nFormulaLen, bool bAllowArrays, const FORMULA_TYPE eFT = FT_CellFormula );
virtual ConvErr Convert( _ScRangeListTabs&, XclImpStream& rStrm, sal_Size nFormulaLen, const FORMULA_TYPE eFT = FT_CellFormula );
virtual ConvErr Convert( _ScRangeListTabs&, XclImpStream& rStrm, sal_Size nFormulaLen, SCsTAB nTab, const FORMULA_TYPE eFT = FT_CellFormula );
virtual ConvErr ConvertExternName( const ScTokenArray*& rpArray, XclImpStream& rStrm, sal_Size nFormulaLen,
const String& rUrl, const ::std::vector<String>& rTabNames );

View file

@ -151,8 +151,8 @@ public:
_ScRangeListTabs( void );
virtual ~_ScRangeListTabs();
void Append( ScSingleRefData aSRD, const BOOL bLimit = TRUE );
void Append( ScComplexRefData aCRD, const BOOL bLimit = TRUE );
void Append( ScSingleRefData aSRD, SCsTAB nTab, const BOOL bLimit = TRUE );
void Append( ScComplexRefData aCRD, SCsTAB nTab, const BOOL bLimit = TRUE );
inline BOOL HasRanges( void ) const;
@ -213,7 +213,7 @@ public:
virtual ConvErr Convert( const ScTokenArray*& rpErg, XclImpStream& rStrm, sal_Size nFormulaLen,
bool bAllowArrays, const FORMULA_TYPE eFT = FT_CellFormula ) = 0;
virtual ConvErr Convert( _ScRangeListTabs&, XclImpStream& rStrm, sal_Size nFormulaLen,
virtual ConvErr Convert( _ScRangeListTabs&, XclImpStream& rStrm, sal_Size nFormulaLen, SCsTAB nTab,
const FORMULA_TYPE eFT = FT_CellFormula ) = 0;
};