On Fri, Apr 19, 2013 at 11:59:41AM -0500, jorge ivan poot diaz wrote:
>  std::stringstream aS;
[...]
> std::string s = aS.str();
[...]
>         pEntry = new XColorEntry( aAktuellColor, s );
> <----------------------
> Would be like this
> 
>         pColorTab->Insert( pColorTab->Count(), pEntry );
> 
>         aLbColor.Append( pEntry );
>         aValSetColorTable.InsertItem( aValSetColorTable.GetItemCount() + 1,
>                 pEntry->GetColor(), pEntry->GetName() );
> 
>         aLbColor.SelectEntryPos( aLbColor.GetEntryCount() - 1 );
> 
> But this does not work, in building generates error:
> http://imagebin.org/254616

(it would be more useful to put the error in a pastebin, not an
imagebin)

The error message is rather clear: there is no matching function call to
the any of the constructors of XColorEntry, none takes a std::string.

http://opengrok.adfinis-sygroup.org/source/xref/aoo-trunk/main/svx/inc/svx/xtable.hxx#57

The constructor that is used in this code is

XColorEntry(const Color& rColor, const String& rName)

it takes a tools' string
http://opengrok.adfinis-sygroup.org/source/xref/aoo-trunk/main/tools/inc/tools/string.hxx


On the other head, why are you using std::stringstream/string?  In the
core code you should not use standard C++ string classes, but
rtl::OUString, OUStringBuffer, etc.; even if you are playing with the
code, before diving into the source, you should get familiar with them
- in general, with the whole C++ UNO language binding:

http://wiki.openoffice.org/wiki/Documentation/DevGuide/ProUNO/C%2B%2B/C%2B%2B_Language_Binding
http://www.openoffice.org/api/docs/cpp/ref/
http://www.openoffice.org/api/docs/cpp/ref/names/rtl/c-OUString.html
http://www.openoffice.org/api/docs/cpp/ref/names/rtl/c-OString.html
http://www.openoffice.org/api/docs/cpp/ref/names/rtl/c-OUStringBuffer.html
http://www.openoffice.org/api/docs/cpp/ref/names/rtl/c-OStringBuffer.html

Set-up the SDK and play with the string sample in
http://svn.apache.org/viewvc/openoffice/trunk/main/odk/examples/DevelopersGuide/ProfUNO/CppBinding/


Regards
-- 
Ariel Constenla-Haile
La Plata, Argentina

Attachment: pgp7xHVm9bqaC.pgp
Description: PGP signature

Reply via email to