[GSoC] Improved Color Selection - how do I load .soc files
Hi All! I'm trying to load .soc palettes, they are in XML format, and it's hardcoded in LO to load "standard.soc" to get the default colors. The loading process starts here: http://opengrok.libreoffice.org/xref/core/svx/source/xoutdev/xtable.cxx#234 If anyone has any insights, please share them! Thank you! All the best, Krisztian ___ LibreOffice mailing list LibreOffice@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice
Re: [GSoC] Improved Color Selection - how do I load .soc files
*Excuse me, I accidentally sent this before finishing writing it.* Hi All! I'm trying to load .soc palettes, they are in XML format, and it's hardcoded in LO to load "standard.soc" to get the default colors. The loading process starts here: http://opengrok.libreoffice.org/xref/core/svx/source/xoutdev/xtable.cxx#234 SvxXMLXTableImport::load returns it's result to an object created by createInstance(). CreateInstance is here: http://opengrok.libreoffice.org/xref/core/svx/source/xoutdev/xtabcolr.cxx#58 It calls this: http://opengrok.libreoffice.org/xref/core/svx/source/unodraw/XPropertyTable.cxx#269 And this kind of keeps going but I'm not really closer to what I want to do, namely to have a function that is given a path to a .soc file, and returns a vector of colors. If anyone has any insights, please share them! Thank you! All the best, Krisztian On 25 July 2014 03:59, Krisztian Pinter wrote: > Hi All! > > I'm trying to load .soc palettes, they are in XML format, and it's > hardcoded in LO to load "standard.soc" to get the default colors. > > The loading process starts here: > http://opengrok.libreoffice.org/xref/core/svx/source/xoutdev/xtable.cxx#234 > > > If anyone has any insights, please share them! Thank you! > > All the best, > Krisztian > ___ LibreOffice mailing list LibreOffice@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice
Re: [GSoC] Improved Color Selection - how do I load .soc files
Hi, On July 25, 2014 04:11 CEST, Krisztian Pinter wrote: > Hi All! > > I'm trying to load .soc palettes, they are in XML format, and it's > hardcoded in LO to load "standard.soc" to get the default colors. > > The loading process starts here: > http://opengrok.libreoffice.org/xref/core/svx/source/xoutdev/xtable.cxx#234 > SvxXMLXTableImport::load returns it's result to an object created > by createInstance(). > CreateInstance is here: > http://opengrok.libreoffice.org/xref/core/svx/source/xoutdev/xtabcolr.cxx#58 > It calls this: > http://opengrok.libreoffice.org/xref/core/svx/source/unodraw/XPropertyTable.cxx#269 > > And this kind of keeps going but I'm not really closer to what I want to > do, namely to have a function that is given a path to a .soc file, and > returns a vector of colors. > > If anyone has any insights, please share them! Thank you! You need to do something like this: XColorListRef pList = XPropertyList::AsColorList(XPropertyList::CreatePropertyListFromURL(XCOLOR_LIST, "path/to/soc/file")); pList->Load(); I think you already convert from XColorListRef somewhere to color vector so use that. :) > All the best, > Krisztian Regards, Tomaž ___ LibreOffice mailing list LibreOffice@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice