LCOV - code coverage report
Current view: top level - core - qgsmargins.cpp (source / functions) Hit Total Coverage
Test: coverage.info.cleaned Lines: 0 15 0.0 %
Date: 2021-04-10 08:29:14 Functions: 0 0 -
Branches: 0 0 -

           Branch data     Line data    Source code
       1                 :            : /***************************************************************************
       2                 :            :   qgsmargins.cpp
       3                 :            :   --------------
       4                 :            :   Date                 : January 2017
       5                 :            :   Copyright            : (C) 2017 by Nyall Dawson
       6                 :            :   Email                : nyall dot dawson at gmail dot com
       7                 :            :  ***************************************************************************
       8                 :            :  *                                                                         *
       9                 :            :  *   This program is free software; you can redistribute it and/or modify  *
      10                 :            :  *   it under the terms of the GNU General Public License as published by  *
      11                 :            :  *   the Free Software Foundation; either version 2 of the License, or     *
      12                 :            :  *   (at your option) any later version.                                   *
      13                 :            :  *                                                                         *
      14                 :            :  ***************************************************************************/
      15                 :            : 
      16                 :            : #include "qgsmargins.h"
      17                 :            : 
      18                 :          0 : QString QgsMargins::toString() const
      19                 :            : {
      20                 :          0 :   if ( isNull() )
      21                 :          0 :     return QString();
      22                 :            :   else
      23                 :          0 :     return QStringLiteral( "%1,%2,%3,%4" ).arg( qgsDoubleToString( mLeft ), qgsDoubleToString( mTop ),
      24                 :          0 :            qgsDoubleToString( mRight ), qgsDoubleToString( mBottom ) );
      25                 :          0 : }
      26                 :            : 
      27                 :          0 : QgsMargins QgsMargins::fromString( const QString &string )
      28                 :            : {
      29                 :          0 :   QStringList margins = string.split( ',' );
      30                 :          0 :   if ( margins.count() != 4 )
      31                 :          0 :     return QgsMargins();
      32                 :            : 
      33                 :          0 :   return QgsMargins( margins.at( 0 ).toDouble(),
      34                 :          0 :                      margins.at( 1 ).toDouble(),
      35                 :          0 :                      margins.at( 2 ).toDouble(),
      36                 :          0 :                      margins.at( 3 ).toDouble() );
      37                 :          0 : }

Generated by: LCOV version 1.14