[patch] warning cleanup

View: New views
2 Messages — Rating Filter:   Alert me  

[patch] warning cleanup

by Vesa Jääskeläinen :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi All,

Here is attached a patch that cleans up some warnings generated by the
MSVS2005.

There are some incorrect usage of getter setter functionalities that
compiler noticed. Changed these to use 'value' instead.

Last file in patch is giving a warning with MSVS2005 which I kinda
understand for C#. In C++ that is kinda bad habit. Now the warning is
moving a bit in source, but I think it is better served over there.
Better solution would be to add getter for the picture type, or make it
public which ever is better feeling...

Thanks,
Vesa Jääskeläinen

Index: iTextSharp/svn/src/core/iTextSharp/text/Image.cs
===================================================================
--- iTextSharp/svn/src/core/iTextSharp/text/Image.cs (revision 71)
+++ iTextSharp/svn/src/core/iTextSharp/text/Image.cs (working copy)
@@ -1542,7 +1542,7 @@
                 if (compressionLevel < PdfStream.NO_COMPRESSION || compressionLevel > PdfStream.BEST_COMPRESSION)
                     compressionLevel = PdfStream.DEFAULT_COMPRESSION;
                 else
-                    compressionLevel = compressionLevel;
+                    compressionLevel = value;
             }
             get {
                 return compressionLevel;
Index: iTextSharp/svn/src/core/iTextSharp/text/pdf/BaseFont.cs
===================================================================
--- iTextSharp/svn/src/core/iTextSharp/text/pdf/BaseFont.cs (revision 71)
+++ iTextSharp/svn/src/core/iTextSharp/text/pdf/BaseFont.cs (working copy)
@@ -1582,7 +1582,7 @@
                 if (compressionLevel < PdfStream.NO_COMPRESSION || compressionLevel > PdfStream.BEST_COMPRESSION)
                     compressionLevel = PdfStream.DEFAULT_COMPRESSION;
                 else
-                    compressionLevel = compressionLevel;
+                    compressionLevel = value;
             }
             get {
                 return compressionLevel;
Index: iTextSharp/svn/src/core/iTextSharp/text/pdf/PdfPTable.cs
===================================================================
--- iTextSharp/svn/src/core/iTextSharp/text/pdf/PdfPTable.cs (revision 71)
+++ iTextSharp/svn/src/core/iTextSharp/text/pdf/PdfPTable.cs (working copy)
@@ -1196,12 +1196,12 @@
                 return runDirection;
             }
             set {
-                switch (runDirection) {
+                switch (value) {
                     case PdfWriter.RUN_DIRECTION_DEFAULT:
                     case PdfWriter.RUN_DIRECTION_NO_BIDI:
                     case PdfWriter.RUN_DIRECTION_LTR:
                     case PdfWriter.RUN_DIRECTION_RTL:
-                        this.runDirection = runDirection;
+                        this.runDirection = value;
                         break;
                     default:
                         throw new ArgumentException(MessageLocalization.GetComposedMessage("invalid.run.direction.1", runDirection));
Index: iTextSharp/svn/src/core/iTextSharp/text/rtf/parser/destinations/RtfDestinationShppict.cs
===================================================================
--- iTextSharp/svn/src/core/iTextSharp/text/rtf/parser/destinations/RtfDestinationShppict.cs (revision 71)
+++ iTextSharp/svn/src/core/iTextSharp/text/rtf/parser/destinations/RtfDestinationShppict.cs (working copy)
@@ -178,7 +178,6 @@
         private MemoryStream dataOS = null;
         
         public RtfDestinationShppict() : base(null) {
-            this.pictureType = pictureType; //get rid of a warning
         }
 
         /**

------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
itextsharp-questions mailing list
itextsharp-questions@...
https://lists.sourceforge.net/lists/listinfo/itextsharp-questions

Re: [patch] warning cleanup

by Paulo Soares-3 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Thank you for the fixes.

Paulo

> -----Original Message-----
> From: Vesa Jääskeläinen [mailto:chaac@...]
> Sent: Saturday, September 05, 2009 7:20 PM
> To: iTextSharp questions
> Subject: [itextsharp-questions] [patch] warning cleanup
>
> Hi All,
>
> Here is attached a patch that cleans up some warnings generated by the
> MSVS2005.
>
> There are some incorrect usage of getter setter functionalities that
> compiler noticed. Changed these to use 'value' instead.
>
> Last file in patch is giving a warning with MSVS2005 which I kinda
> understand for C#. In C++ that is kinda bad habit. Now the warning is
> moving a bit in source, but I think it is better served over there.
> Better solution would be to add getter for the picture type,
> or make it
> public which ever is better feeling...
>
> Thanks,
> Vesa Jääskeläinen
>

Aviso Legal:
Esta mensagem é destinada exclusivamente ao destinatário. Pode conter informação confidencial ou legalmente protegida. A incorrecta transmissão desta mensagem não significa a perca de confidencialidade. Se esta mensagem for recebida por engano, por favor envie-a de volta para o remetente e apague-a do seu sistema de imediato. É proibido a qualquer pessoa que não o destinatário de usar, revelar ou distribuir qualquer parte desta mensagem.

Disclaimer:
This message is destined exclusively to the intended receiver. It may contain confidential or legally protected information. The incorrect transmission of this message does not mean the loss of its confidentiality. If this message is received by mistake, please send it back to the sender and delete it from your system immediately. It is forbidden to any person who is not the intended receiver to use, distribute or copy any part of this message.

------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
itextsharp-questions mailing list
itextsharp-questions@...
https://lists.sourceforge.net/lists/listinfo/itextsharp-questions