diff options
author | Caolán McNamara <caolanm@redhat.com> | 2010-12-18 19:07:05 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2010-12-18 19:07:05 +0000 |
commit | fb4c82b541f4e5b50d644bd56a52f1428691c7e4 (patch) | |
tree | d99b5ca109d86e20ff4be55d82a74d5b29d40483 | |
parent | f15dfff3b033e9405e4c4a391f42ea6ba7cba944 (diff) |
cppcheck: can reduce the scope of this variable
-rw-r--r-- | vcl/source/gdi/pdfwriter_impl.cxx | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/vcl/source/gdi/pdfwriter_impl.cxx b/vcl/source/gdi/pdfwriter_impl.cxx index 2f671880eb9a..a6d349706b00 100644 --- a/vcl/source/gdi/pdfwriter_impl.cxx +++ b/vcl/source/gdi/pdfwriter_impl.cxx @@ -4551,7 +4551,6 @@ we check in the following sequence: // extract target file type INetURLObject aDocumentURL( m_aContext.BaseURL ); INetURLObject aTargetURL( rLink.m_aURL ); - sal_Int32 nChangeFileExtensionToPDF = 0; sal_Int32 nSetGoToRMode = 0; sal_Bool bTargetHasPDFExtension = sal_False; INetProtocol eTargetProtocol = aTargetURL.GetProtocol(); @@ -4590,18 +4589,19 @@ we check in the following sequence: { if( m_aContext.ConvertOOoTargetToPDFTarget ) { -//examine the file type (.odm .odt. .odp, odg, ods) + sal_Int32 bChangeFileExtensionToPDF = false; + //examine the file type (.odm .odt. .odp, odg, ods) if( aFileExtension.equalsIgnoreAsciiCase(rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "odm" ) ) ) ) - nChangeFileExtensionToPDF++; + bChangeFileExtensionToPDF = true; if( aFileExtension.equalsIgnoreAsciiCase(rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "odt" ) ) ) ) - nChangeFileExtensionToPDF++; + bChangeFileExtensionToPDF = true; else if( aFileExtension.equalsIgnoreAsciiCase(rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "odp" ) ) ) ) - nChangeFileExtensionToPDF++; + bChangeFileExtensionToPDF = true; else if( aFileExtension.equalsIgnoreAsciiCase(rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "odg" ) ) ) ) - nChangeFileExtensionToPDF++; + bChangeFileExtensionToPDF = true; else if( aFileExtension.equalsIgnoreAsciiCase(rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "ods" ) ) ) ) - nChangeFileExtensionToPDF++; - if( nChangeFileExtensionToPDF ) + bChangeFileExtensionToPDF = true; + if( bChangeFileExtensionToPDF ) aTargetURL.setExtension(rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "pdf" ) ) ); } //check if extension is pdf, see if GoToR should be forced |