[Libreoffice] problem with ScTableSheetsObj::replaceByName

Markus Mohrhard markus.mohrhard at googlemail.com
Thu Feb 2 13:27:55 PST 2012


Hey Eike,
>
>> >> If all parts of this are correct I suggest that we implement more
>> >> something like: delete sheet and then create a copy of the passed
>> >> sheet at this place with the new name.
>> >
>> > Um.. how would you create the copy?
>>
>> Through ScDocShell::TransferTab with bInsertNew = true. That is the
>> same as a copy in the dialog. The only arguments against this idea is
>> that we do exactly this in ScTableSheetsObj::importSheet already.
>>
>> Any better ideas for that?
>
> No. But I think we're overlooking something and replaceByName() does not
> simply replace with an empty sheet. It's only the encompassing range
> that gets expanded to MAXCOL/MAXROW and otherwise the object is kept as
> is. Or am I mislead?
>

docuno.cxx:2571 removes the old sheet
docuno.cxx:2575 inserts an empty sheet with the same name at the same place

And docuno.cxx:2577 does not modify the ScDocument/ScTable, so either
I'm missing something or we would only get an empty sheet.

Markus


More information about the LibreOffice mailing list