Kaydet (Commit) 91fa22fe authored tarafından Miklos Vajna's avatar Miklos Vajna

writerfilter: remove unused CpAndFc class in doctok

Change-Id: Id24eb2ab53e62961e6cbe2ea72221c6bfe7262d7
üst b8002169
......@@ -79,46 +79,6 @@ ostream & operator << (ostream & o, const Fc & rFc)
return o << rFc.toString();
}
bool operator < (const CpAndFc & rA, const CpAndFc & rB)
{
bool bResult = false;
if (rA.mCp < rB.mCp)
bResult = true;
else if (rA.mCp == rB.mCp && rA.mType < rB.mType)
bResult = true;
return bResult;
}
bool operator == (const CpAndFc & rA, const CpAndFc & rB)
{
return rA.mCp == rB.mCp;
}
ostream & operator << (ostream & o, const CpAndFc & /*rCpAndFc*/)
{
return o;
}
ostream & operator << (ostream & o, const CpAndFcs & rCpAndFcs)
{
copy(rCpAndFcs.begin(), rCpAndFcs.end(),
ostream_iterator<CpAndFc>(o, ", "));
char sBuffer[256];
snprintf(sBuffer, 255, "%" SAL_PRI_SIZET "u", rCpAndFcs.size());
o << sBuffer;
return o;
}
CpAndFc::CpAndFc(const Cp & rCp, const Fc & rFc, PropertyType eType_)
: mCp(rCp), mFc(rFc), mType(eType_)
{
}
}}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
......@@ -211,103 +211,6 @@ struct Fc
friend ostream & operator << (ostream & o, const Fc & rFc);
};
/**
A character position and a corresponding file character position
paired.
*/
class CpAndFc
{
private:
/**
character position
*/
Cp mCp;
/**
file character position
*/
Fc mFc;
/**
property type
*/
PropertyType mType;
public:
CpAndFc() {}
CpAndFc(const Cp & rCp, const Fc & rFc, PropertyType eType_);
/**
Return character position.
*/
const Cp & getCp() const { return mCp; }
/**
Return file character position.
*/
const Fc & getFc() const { return mFc; }
/**
Return property type.
*/
PropertyType getType() const { return mType; }
/**
Return if FC is complex.
@retval true FC is complex
@retval false else
*/
bool isComplex() const { return mFc.isComplex(); }
/**
Return the distance to other CpAndFc.
@param rCpAndFc the other CpAndFc
@return the distance from the CP in @a rCpAndFc to the CP in
CpAndFc.
*/
sal_uInt32 operator-(const CpAndFc & rCpAndFc) const
{ return mCp - rCpAndFc.mCp; }
/**
Return string representation of the CpAndFc.
*/
string toString() const;
friend bool operator < (const CpAndFc & rA, const CpAndFc & rB);
friend bool operator == (const CpAndFc & rA, const CpAndFc & rB);
friend ostream & operator << (ostream & o, const CpAndFc & rCpAndFc);
};
struct CpAndFcLess
{
CpAndFcLess()
{
}
bool operator()(const CpAndFc & rA, const CpAndFc & rB) const
{
return rA < rB;
}
bool operator()(const CpAndFc & rA, const Cp & rB) const
{
return rA.getCp() < rB;
}
bool operator()(const Cp & rA, const CpAndFc & rB) const
{
return rA < rB.getCp();
}
};
typedef set<CpAndFc, CpAndFcLess> CpAndFcs;
ostream & operator << (ostream & o, const CpAndFcs & rCpAndFcs);
struct CpHash
{
size_t operator()(const Cp & rCp) const
......@@ -332,16 +235,6 @@ struct CpEq
}
};
struct CpAndFcHash
{
size_t operator()(const CpAndFc & rCpAndFc) const
{
CpHash aHash;
return aHash(rCpAndFc.getCp());
}
};
typedef boost::unordered_map<Cp, Fc, CpHash, CpEq> Cp2FcHashMap_t;
} // namespace doctok
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment