Date: prev next · Thread: first prev next last
2012 Archives by date, by thread · List index


Looking at how the data is used, I'm pretty sure these data-structures could be modified to use std::vector, and the node structure stored directly like this:

std::vector<HWPPara>  plist;

   ...and...

extern std::vector<Node>  nodelist;

which would be more memory-efficient, but I suppose it doesn't really matter for this case?


Regards, Noel Grandin

On 2012-03-02 17:39, Dézsi Szabolcs wrote:
Hi!

I removed every use of LinkedList and replaced it with std::list
I hope everything's correct. Tested it with the .hwp file in
hwpfilter/qa/cppunit/data (pass and fail). Working as expected.

LinkedList had a find(int n) method, which returned the underlying
std::vector's nth element, unfortunately this isn't possible with std::list, so
the calls to find(...) and replaced with iterating with a for loop i times,
thus pointing the iterator to the nth element of the list.

Don't know if it's a very good solution though. The original find method had an
assertion that the parameter is between 0 and the size of the underlying
vector.

If something is wrong, let me know, and i try to enhance/work on it. Or feel
free to improve it :)

https://bugs.freedesktop.org/show_bug.cgi?id=45678

Szabolcs


_______________________________________________
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice

Disclaimer: http://www.peralex.com/disclaimer.html



Context


Privacy Policy | Impressum (Legal Info) | Copyright information: Unless otherwise specified, all text and images on this website are licensed under the Creative Commons Attribution-Share Alike 3.0 License. This does not include the source code of LibreOffice, which is licensed under the Mozilla Public License (MPLv2). "LibreOffice" and "The Document Foundation" are registered trademarks of their corresponding registered owners or are in actual use as trademarks in one or more countries. Their respective logos and icons are also subject to international copyright laws. Use thereof is explained in our trademark policy.