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

fix incorrect ScAnnotationsObj UNO API, fdo#80551

The used index was a sheet local index but the returned position was
from a global container.

Change-Id: I0b9e9e7e9618c72daf8e6417bca9d3a1cb23abb1
üst 355c3cbb
...@@ -951,6 +951,7 @@ public: ...@@ -951,6 +951,7 @@ public:
void ForgetNoteCaptions( const ScRangeList& rRanges ); void ForgetNoteCaptions( const ScRangeList& rRanges );
ScAddress GetNotePosition( size_t nIndex ) const; ScAddress GetNotePosition( size_t nIndex ) const;
ScAddress GetNotePosition( size_t nIndex, SCTAB nTab ) const;
SCROW GetNotePosition( SCTAB nTab, SCCOL nCol, size_t nIndex ) const; SCROW GetNotePosition( SCTAB nTab, SCCOL nCol, size_t nIndex ) const;
SC_DLLPUBLIC void GetAllNoteEntries( std::vector<sc::NoteEntry>& rNotes ) const; SC_DLLPUBLIC void GetAllNoteEntries( std::vector<sc::NoteEntry>& rNotes ) const;
......
...@@ -6097,6 +6097,32 @@ ScAddress ScDocument::GetNotePosition( size_t nIndex ) const ...@@ -6097,6 +6097,32 @@ ScAddress ScDocument::GetNotePosition( size_t nIndex ) const
return ScAddress(ScAddress::INITIALIZE_INVALID); return ScAddress(ScAddress::INITIALIZE_INVALID);
} }
ScAddress ScDocument::GetNotePosition( size_t nIndex, SCTAB nTab ) const
{
for (SCCOL nCol=0; nCol<MAXCOLCOUNT; nCol++)
{
size_t nColNoteCount = GetNoteCount(nTab, nCol);
if (!nColNoteCount)
continue;
if (nIndex >= nColNoteCount)
{
nIndex -= nColNoteCount;
continue;
}
SCROW nRow = GetNotePosition(nTab, nCol, nIndex);
if (nRow >= 0)
return ScAddress(nCol, nRow, nTab);
OSL_FAIL("note not found");
return ScAddress(ScAddress::INITIALIZE_INVALID);
}
OSL_FAIL("note not found");
return ScAddress(ScAddress::INITIALIZE_INVALID);
}
SCROW ScDocument::GetNotePosition( SCTAB nTab, SCCOL nCol, size_t nIndex ) const SCROW ScDocument::GetNotePosition( SCTAB nTab, SCCOL nCol, size_t nIndex ) const
{ {
const ScTable* pTab = FetchTable(nTab); const ScTable* pTab = FetchTable(nTab);
......
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