--===============0400104008== Content-Type: multipart/signed; boundary="nextPart2225799.J2XIhJLLyk"; protocol="application/pgp-signature"; micalg=pgp-sha1 Content-Transfer-Encoding: 7bit --nextPart2225799.J2XIhJLLyk Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline On Saturday 03 February 2007 23:11, Sebastian Sauer wrote: > SVN commit 629851 by sebsauer: > > doc says createVariable can return NULL. Reading your usage, I see my docs and implementation of the manager can be= =20 improved :) Its concepts are highly confusing, I admit. The variable manager manages 2 things; the name/value pairs. (which are just QStrings) and the KoVariable instances that _have_ to be inserted into a text documen= t=20 to have any use. Your code here doesn't use the KoVariable instance, and thus the call=20 to 'createVariable' is not the correct one. Just a manager.setValue() woul= d=20 be enough. > M +3 -3 TextDocument.h > > > --- trunk/koffice/kword/plugins/scripting/TextDocument.h #629850:629851 > @@ -118,9 +118,9 @@ > /** Add a new variable. */ > bool addVariable(const QString& variablename, const QString& > value) { KoVariableManager* manager =3D variableManager(); > - if( ! manager ) return false; > - KoVariable* v =3D manager->createVariable(variablename); > - v->setValue(value); > + KoVariable* variable =3D manager ? > manager->createVariable(variablename) : 0; + if( ! variable > ) return false; > + variable->setValue(value); > return true; > } > /** Remove an existing variable. */ =2D-=20 Thomas Zander --nextPart2225799.J2XIhJLLyk Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.3 (GNU/Linux) iD8DBQBFxacrCojCW6H2z/QRAr7RAJ9bbO7QaksIn0g/XqIPOPj0xu7eaQCcDZpC cPyG7GGSlvvSn3BsA+2O4uk= =2VyX -----END PGP SIGNATURE----- --nextPart2225799.J2XIhJLLyk-- --===============0400104008== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ koffice-devel mailing list koffice-devel@kde.org https://mail.kde.org/mailman/listinfo/koffice-devel --===============0400104008==--