fixed assignment issue with gcc 2.95.x and auto_ptr

This commit is contained in:
fluxgen 2002-10-24 11:26:16 +00:00
parent 5e521b66b7
commit 660f363f19

View file

@ -19,7 +19,7 @@
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
// DEALINGS IN THE SOFTWARE.
//$Id: Font.cc,v 1.16 2002/10/19 14:01:05 fluxgen Exp $
//$Id: Font.cc,v 1.17 2002/10/24 11:26:16 fluxgen Exp $
#include "Font.hh"
@ -86,16 +86,16 @@ m_antialias(false) {
// antialias is prio 1
#ifdef USE_XFT
if (antialias) {
m_fontimp = std::auto_ptr<FontImp>(new XftFontImp(0, m_utf8mode));
m_fontimp.reset(std::auto_ptr<FontImp>(new XftFontImp(0, m_utf8mode)).release());
m_antialias = true;
}
#endif //USE_XFT
// if we didn't create a Xft font then create basic font
if (m_fontimp.get() == 0) {
if (m_multibyte || m_utf8mode)
m_fontimp = std::auto_ptr<FontImp>(new XmbFontImp(0, m_utf8mode));
m_fontimp.reset(std::auto_ptr<FontImp>(new XmbFontImp(0, m_utf8mode)).release());
else // basic font implementation
m_fontimp = std::auto_ptr<FontImp>(new XFontImp());
m_fontimp.reset(std::auto_ptr<FontImp>(new XFontImp()).release());
}
if (name != 0) {
@ -112,14 +112,14 @@ void Font::setAntialias(bool flag) {
bool loaded = m_fontimp->loaded();
#ifdef USE_XFT
if (flag && !isAntialias()) {
m_fontimp = std::auto_ptr<FontImp>(new XftFontImp(m_fontstr.c_str(), m_utf8mode));
m_fontimp.reset(std::auto_ptr<FontImp>(new XftFontImp(m_fontstr.c_str(), m_utf8mode)).release());
} else if (!flag && isAntialias())
#endif // USE_XFT
{
if (m_multibyte || m_utf8mode)
m_fontimp = std::auto_ptr<FontImp>(new XmbFontImp(m_fontstr.c_str(), m_utf8mode));
m_fontimp.reset(std::auto_ptr<FontImp>(new XmbFontImp(m_fontstr.c_str(), m_utf8mode)).release());
else {
m_fontimp = std::auto_ptr<FontImp>(new XFontImp(m_fontstr.c_str()));
m_fontimp.reset(std::auto_ptr<FontImp>(new XFontImp(m_fontstr.c_str())).release());
}
}