Skip to content

Commit

Permalink
Remove legacy code in composer label
Browse files Browse the repository at this point in the history
git-svn-id: http://svn.osgeo.org/qgis/trunk@11351 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
mhugent committed Aug 12, 2009
1 parent 702fc88 commit 7689cf4
Showing 1 changed file with 0 additions and 23 deletions.
23 changes: 0 additions & 23 deletions src/core/composer/qgscomposerlabel.cpp
Expand Up @@ -61,29 +61,6 @@ void QgsComposerLabel::paint( QPainter* painter, const QStyleOptionGraphicsItem*
void QgsComposerLabel::setText( const QString& text ) void QgsComposerLabel::setText( const QString& text )
{ {
mText = text; mText = text;

#if 0
//replace '$CURRENT_DATE<(FORMAT)>' with the current date
//e.g. $CURRENT_DATE(d 'June' yyyy)
mText = text;
int currentDatePos = mText.indexOf( "$CURRENT_DATE" );
if ( currentDatePos != -1 )
{
//check if there is a bracket just after $CURRENT_DATE
QString formatText;
int openingBracketPos = mText.indexOf( "(", currentDatePos );
int closingBracketPos = mText.indexOf( ")", openingBracketPos + 1 );
if ( openingBracketPos != -1 && closingBracketPos != -1 && ( closingBracketPos - openingBracketPos ) > 1 )
{
formatText = mText.mid( openingBracketPos + 1, closingBracketPos - openingBracketPos - 1 );
mText.replace( currentDatePos, closingBracketPos - currentDatePos + 1, QDate::currentDate().toString( formatText ) );
}
else //no bracket
{
mText.replace( "$CURRENT_DATE", QDate::currentDate().toString() );
}
}
#endif //0
} }


QString QgsComposerLabel::displayText() const QString QgsComposerLabel::displayText() const
Expand Down

0 comments on commit 7689cf4

Please sign in to comment.