mirror of
https://github.com/ElvishArtisan/rivendell.git
synced 2025-11-26 15:20:29 +01:00
2018-08-01 Fred Gleason <fredg@paravelsystems.com>
* Modified as-played reports to work correctly with UTF-8 strings.
This commit is contained in:
@@ -848,18 +848,42 @@ QString RDReport::errorText(RDReport::ErrorCode code)
|
||||
}
|
||||
|
||||
|
||||
QString RDReport::StringField(const QString &str,const QString &null_text) const
|
||||
QString RDReport::LeftJustify(const QString &str,int width) const
|
||||
{
|
||||
QString ret=null_text;
|
||||
QString ret=str.left(width);
|
||||
|
||||
if(!str.isEmpty()) {
|
||||
ret=str;
|
||||
while(ret.length()<(unsigned)width) {
|
||||
ret+=" ";
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
QString RDReport::RightJustify(const QString &str,int width) const
|
||||
{
|
||||
QString ret=str.left(width);
|
||||
|
||||
while(ret.length()<(unsigned)width) {
|
||||
ret=" "+ret;
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
QString RDReport::Center(const QString &str,int width) const
|
||||
{
|
||||
QString ret=str.left(width);
|
||||
|
||||
int margin=(width-ret.length())/2;
|
||||
for(int i=0;i<margin;i++) {
|
||||
ret=" "+ret;
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
void RDReport::SetRow(const QString ¶m,const QString &value) const
|
||||
{
|
||||
RDSqlQuery *q;
|
||||
|
||||
Reference in New Issue
Block a user