svl::SharedString is stored in Calc core instead of OUString

Kohei Yoshida kohei.yoshida at
Tue Oct 8 13:00:32 PDT 2013

Hi there,

FYI, I've just pushed a whole bunch of changes to the master branch in
order to implemented shared strings in Calc's document storage.  I'll
skip the implementation details, but the punch line is that the document
cell storage now stores svl::SharedString as the string cell values
instead of the previous straight OUString.  svl::SharedString stores two
ref-counted string storages (rtl_uString*), one for the normal string,
and one for the case-ignored string.  They are all normalized as they
are entered into the cell storage, so you can use the pointer values for
quick string equality check, both in case sensitive and case insensitive

One thing to note is that the strings are normalized per ScDocument
instance, and each ScDocument stores svl::SharedStringPool to store the
master string objects.  As such, be extra careful when copying string
values from one document instance to another, since you'll now have to
re-normalize those copied strings when they are entered into another
document instance.

Also, I'll probably continue making changes around this area, so please
be on the lookout for further changes in case you are working in the
vicinity of Calc core.



Kohei Yoshida, LibreOffice hacker, Collabora Productivity

More information about the LibreOffice mailing list