This file is indexed.

/usr/include/scribus/style.h is in scribus 1.4.0.dfsg+r17300-1.1.

This file is owned by root:root, with mode 0o644.

The actual contents of the file can be viewed below.

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
/*
 For general Scribus (>=1.3.2) copyright and licensing information please refer
 to the COPYING file provided with the program. Following this notice may exist
 a copyright and/or license notice that predates the release of Scribus 1.3.2
 for which a new license (GPL+exception) is in place.
 */
/***************************************************************************
*                                                                         *
*   This program is free software; you can redistribute it and/or modify  *
*   it under the terms of the GNU General Public License as published by  *
*   the Free Software Foundation; either version 2 of the License, or     *
*   (at your option) any later version.                                   *
*                                                                         *
***************************************************************************/


#ifndef STYLE_H
#define STYLE_H

#include <cassert>
#include <QString>
#include "scfonts.h"
#include "scribusapi.h"
#include "sccolor.h"
#include "styles/stylecontext.h"
#include "desaxe/saxio.h"


/**
 *  This is the base class for all style-like objects: CharStyles, 
 *  ParagraphStyles, LineStyles, FrameStyles, CellStyles,
 *  FlowStyles,...
 *  It provides a name and an inheritance mechanism which uses a Stylecontext.
 *  Before any attribute is queried, you have to call validate(), which checks
 *  the stored m_contextversion against the StyleContext's version and updates all
 *  attributes if they are different.
 */
class SCRIBUS_API Style : public SaxIO {
protected:
	bool m_isDefaultStyle;
	QString m_name;
	const StyleContext* m_context;
	int m_contextversion;
	QString m_parent;
	QString m_shortcut;
public:
//	static const short NOVALUE = -16000;

	Style(): m_isDefaultStyle(false), m_name(""), m_context(NULL), m_contextversion(-1), m_parent(""), m_shortcut() {}

	Style(StyleContext* b, QString n): m_isDefaultStyle(false), m_name(n), m_context(b), m_contextversion(-1), m_parent(""), m_shortcut() {}
	
	Style& operator=(const Style& o) 
	{ //assert(typeinfo() == o.typeinfo()); 
		m_isDefaultStyle = o.m_isDefaultStyle;
		m_name = o.m_name;
//		m_context = o.m_context; 
		m_contextversion = -1; 
		m_parent = o.m_parent;
		m_shortcut = o.m_shortcut;
		return *this;
	}
	
	Style(const Style& o) : SaxIO(), m_isDefaultStyle(o.m_isDefaultStyle),m_name(o.m_name), 
		m_context(o.m_context), m_contextversion(o.m_contextversion), m_parent(o.m_parent), m_shortcut(o.m_shortcut) {} 
	
	virtual ~Style()                 {}

	
	// this is an abstract class, so:
	// static const Xml_string saxxDefaultElem; 
	template<class SUBSTYLE>
		static void  desaxeRules(const Xml_string& prefixPattern, desaxe::Digester& ruleset, Xml_string elemtag);
	
	void saxxAttributes(Xml_attr& attr) const;
	//virtual void saxx(SaxHandler& handler, const Xml_string& elemtag) const;
	//virtual void saxx(SaxHandler& handler)                     const { saxx(handler, saxxDefaultElem); }
	
	void setDefaultStyle(bool ids);
	bool isDefaultStyle() const      { return m_isDefaultStyle; }
	
	QString name() const             { return m_name; }
	void setName(const QString& n)   { m_name = n.isEmpty() ? "" : n; }
	bool hasName() const             { return ! m_name.isEmpty(); }

	virtual QString displayName() const = 0;/*{ 	
		if ( hasName() || !hasParent() || !m_context)
			return name();
		//	else if ( inheritsAll() )
		//		return parent()->displayName();
		else 
			return parentStyle()->displayName();
	}*/
	
	QString parent() const           { return m_parent; }
	void setParent(const QString& p);
	bool hasParent() const           { return ! m_parent.isEmpty(); }
	const Style* parentStyle() const;
	
	static const QString INHERIT_PARENT;
	
	virtual void setContext(const StyleContext* context);
	const StyleContext* context() const        { return m_context; }
	
	/**
		sets a new StyleContext if b is not NULL and then uses the StyleContext
		to set all inherited attributes to their valid value.
	 */
	virtual void update(const StyleContext* b = NULL);
	
	/**
		Checks if this Style needs an update
	 */
	void validate() const;

	QString shortcut() const { return m_shortcut; }
	void setShortcut(const QString &shortcut) { m_shortcut = shortcut; }

	/**
		returns true if both Styles are of the same type, inherit the same attributes,
	    have the same parent, and agree on all attributes which are not inherited.
	    The StyleContext, the name and any inherited attrinutes may be different.
	 */
	virtual bool equiv(const Style& other) const = 0;
	/**
		returns true if both Styles are equivalent and have the same name.
	    Since the context is not tested, this does *not* ensure they will return
	    the same values for all attributes.
	 */
	virtual bool operator==(const Style& other) const { return name() == other.name() && equiv(other); }
	virtual bool operator!=(const Style& other) const { return ! ( (*this) == other ); }

	/**
		resets all attributes to their defaults and makes them inherited.
	    name and parent are not affected.
	 */
	virtual void erase() = 0;
	/**
		if other has a parent, replace this parent with the other ones
	 */
	void applyStyle(const Style& other) { 
		if (other.hasParent())
			setParent( other.parent() == INHERIT_PARENT? "" :other.parent());
		m_contextversion = -1;
	}
	/** 
		if other has the same parent, remove this parent 
	 */
	void eraseStyle(const Style& other) {
		if (other.parent() == parent())
			setParent("");
		m_contextversion = -1;
	}
};

#endif