-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

AFAIK, the return types of functions in C++ do not enter into the
function signature. That means that
        String SvtUserOptions_Impl::GetFirstName() const
and
        const String& SvtUserOptions::GetFirstName() const
should have the same signature. And that can be a problem because while
linking any of the two can be linked to. If a program takes a const
reference to a temporary that goes out of the scope and works with this
reference, it might make a big boom at certain point of time :-)

Just my 2 pence

Fridrich

Yan Wu wrote:
> Hi Andreas,
> 
> When redesigning svtools\source\config\useroptions.cxx,
> I made like below changes:
> 
> String SvtUserOptions_Impl::GetFirstName() const
> {
>     ::rtl::OUString sFirstName;
>     try
>     {
>         m_xData->getPropertyValue(s_sgivenname) >>= sFirstName;
>     }
>     catch ( const css::uno::Exception& ex)
>     {
>         LogHelper::logIt(ex);
>     }
>     return String(sFirstName);
> }
> 
> The OOo still will crash when opening Menu:Tools->Options. The crash
> point is aFirstName.SetText( aUserOpt.GetFirstName() ) in
> SvxGeneralTabPage::SetAddress_Impl();
> 
> BTW, "const String& SvtUserOptions::GetFirstName() const" isnt made any
> changes. Does this method need changes too?
> 
> Needing your help to solve this problem.:-)
> 
> Regards,
> Yan Wu
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 

- --
Please avoid sending me Word, Excel or PowerPoint attachments.
See http://www.gnu.org/philosophy/no-word-attachments.html
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2 (GNU/Linux)
Comment: Using GnuPG with SUSE - http://enigmail.mozdev.org

iD8DBQFHPAvRu9a1imXPdA8RAk1PAJ0ar7XzRs4UnFzgmI/Mav2bhxaH8wCcD+rS
yHxKcGK9QULqGhV4mZ+lDXw=
=cLyX
-----END PGP SIGNATURE-----

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to