Back to index

scribus-ng  1.3.4.dfsg+svn20071115
stylecontextproxy.cpp
Go to the documentation of this file.
00001 /*
00002  For general Scribus (>=1.3.2) copyright and licensing information please refer
00003  to the COPYING file provided with the program. Following this notice may exist
00004  a copyright and/or license notice that predates the release of Scribus 1.3.2
00005  for which a new license (GPL+exception) is in place.
00006  */
00007 /***************************************************************************
00008 *                                                                         *
00009 *   This program is free software; you can redistribute it and/or modify  *
00010 *   it under the terms of the GNU General Public License as published by  *
00011 *   the Free Software Foundation; either version 2 of the License, or     *
00012 *   (at your option) any later version.                                   *
00013 *                                                                         *
00014 ***************************************************************************/
00015 
00016 #include "style.h"
00017 #include "stylecontextproxy.h"
00018 
00019 
00020 const Style* StyleContextProxy::resolve(const QString& name) const
00021 {
00022        const StyleContext* context = m_default->context();
00023        //     if (!name.isEmpty())
00024        //            qDebug(QString("resolve %4 %3 -%1- %2").arg(name)
00025        //                      .arg(reinterpret_cast<uint>(context),16).arg(reinterpret_cast<uint>(this),16)
00026        //                      .arg(m_default->name()));
00027        
00028        if (name.isEmpty() || ! context)
00029               return m_default;
00030        else if (this == context)
00031               return NULL;
00032        else
00033               return context->resolve(name);
00034 }