Kaydet (Commit) 9cfab5c6 authored tarafından Markus Mohrhard's avatar Markus Mohrhard

index is 1-based in this case

Change-Id: I74aae3f422423de09cb012e274f8d536f8b778f1
üst a2a9f197
......@@ -148,12 +148,13 @@ void ScColorScaleFormatList::AddFormat( ScColorScaleFormat* pFormat )
maColorScaleFormats.push_back( pFormat );
}
// attention nFormat is 1 based, 0 is reserved for no format
ScColorScaleFormat* ScColorScaleFormatList::GetFormat(sal_uInt32 nFormat)
{
if( nFormat >= size() )
if( nFormat > size() || !nFormat )
return NULL;
return &maColorScaleFormats[nFormat];
return &maColorScaleFormats[nFormat-1];
}
ScColorScaleFormatList::iterator ScColorScaleFormatList::begin()
......
......@@ -629,6 +629,7 @@ sal_uLong ScDocument::AddCondFormat( const ScConditionalFormat& rNew )
}
//takes ownership
// returns a 1-based index, 0 is reserved for no entry
sal_uLong ScDocument::AddColorScaleFormat( ScColorScaleFormat* pNew )
{
if(!pNew)
......@@ -639,7 +640,7 @@ sal_uLong ScDocument::AddColorScaleFormat( ScColorScaleFormat* pNew )
mpColorScaleList->AddFormat( pNew );
return mpColorScaleList->size()-1;
return mpColorScaleList->size();
}
sal_uLong ScDocument::AddValidationEntry( const ScValidationData& rNew )
......
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