summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Stahl <mstahl@redhat.com>2012-05-07 23:25:48 +0200
committerMichael Stahl <mstahl@redhat.com>2012-05-08 11:31:49 +0200
commitb532fccca7c398a42d84fcb06deced60fa959819 (patch)
treed874f2050ffc39b83ed89e5aaa4516e4235f5b2a
parenta50812813de0594ac2aeb064ea4a95d66b8e4e42 (diff)
work around spurious signed overflow warnings
gcc version 4.6.3 20120306 (Red Hat 4.6.3-2) (GCC): /com/sun/star/uno/Sequence.hxx:178:10: error: assuming signed overflow does not occur when assuming that (X - c) > X is always false [-Werror=strict-overflow]
-rw-r--r--filter/source/pdf/impdialog.cxx29
-rw-r--r--toolkit/source/controls/tksimpleanimation.cxx6
-rw-r--r--toolkit/source/controls/tkthrobber.cxx12
3 files changed, 27 insertions, 20 deletions
diff --git a/filter/source/pdf/impdialog.cxx b/filter/source/pdf/impdialog.cxx
index 3b286cf9060b..03de7492d46a 100644
--- a/filter/source/pdf/impdialog.cxx
+++ b/filter/source/pdf/impdialog.cxx
@@ -391,40 +391,41 @@ Sequence< PropertyValue > ImpPDFTabDialog::GetFilterData()
aRet.realloc( aRet.getLength() + nElementAdded );
// add the encryption enable flag
- aRet[ aRet.getLength() - nElementAdded ].Name = OUString( RTL_CONSTASCII_USTRINGPARAM( "Watermark" ) );
- aRet[ aRet.getLength() - nElementAdded ].Value <<= maWatermarkText;
+ sal_uInt32 const nLength(aRet.getLength());
+ aRet[ nLength - nElementAdded ].Name = OUString( RTL_CONSTASCII_USTRINGPARAM( "Watermark" ) );
+ aRet[ nLength - nElementAdded ].Value <<= maWatermarkText;
nElementAdded--;
// add the encryption enable flag
- aRet[ aRet.getLength() - nElementAdded ].Name = OUString( RTL_CONSTASCII_USTRINGPARAM( "EncryptFile" ) );
- aRet[ aRet.getLength() - nElementAdded ].Value <<= mbEncrypt;
+ aRet[ nLength - nElementAdded ].Name = OUString( RTL_CONSTASCII_USTRINGPARAM( "EncryptFile" ) );
+ aRet[ nLength - nElementAdded ].Value <<= mbEncrypt;
nElementAdded--;
// add the open password
- aRet[ aRet.getLength() - nElementAdded ].Name = OUString( RTL_CONSTASCII_USTRINGPARAM( "PreparedPasswords" ) );
- aRet[ aRet.getLength() - nElementAdded ].Value <<= mxPreparedPasswords;
+ aRet[ nLength - nElementAdded ].Name = OUString( RTL_CONSTASCII_USTRINGPARAM( "PreparedPasswords" ) );
+ aRet[ nLength - nElementAdded ].Value <<= mxPreparedPasswords;
nElementAdded--;
//the restrict permission flag (needed to have the scripting consistent with the dialog)
- aRet[ aRet.getLength() - nElementAdded ].Name = OUString( RTL_CONSTASCII_USTRINGPARAM( "RestrictPermissions" ) );
- aRet[ aRet.getLength() - nElementAdded ].Value <<= mbRestrictPermissions;
+ aRet[ nLength - nElementAdded ].Name = OUString( RTL_CONSTASCII_USTRINGPARAM( "RestrictPermissions" ) );
+ aRet[ nLength - nElementAdded ].Value <<= mbRestrictPermissions;
nElementAdded--;
//add the permission password
- aRet[ aRet.getLength() - nElementAdded ].Name = OUString( RTL_CONSTASCII_USTRINGPARAM( "PreparedPermissionPassword" ) );
- aRet[ aRet.getLength() - nElementAdded ].Value <<= maPreparedOwnerPassword;
+ aRet[ nLength - nElementAdded ].Name = OUString( RTL_CONSTASCII_USTRINGPARAM( "PreparedPermissionPassword" ) );
+ aRet[ nLength - nElementAdded ].Value <<= maPreparedOwnerPassword;
nElementAdded--;
// this should be the last added...
if( mbIsRangeChecked )
{
- aRet[ aRet.getLength() - nElementAdded ].Name = OUString( RTL_CONSTASCII_USTRINGPARAM( "PageRange" ) );
- aRet[ aRet.getLength() - nElementAdded ].Value <<= OUString( msPageRange );
+ aRet[ nLength - nElementAdded ].Name = OUString( RTL_CONSTASCII_USTRINGPARAM( "PageRange" ) );
+ aRet[ nLength - nElementAdded ].Value <<= OUString( msPageRange );
}
else if( mbSelectionIsChecked )
{
- aRet[ aRet.getLength() - nElementAdded ].Name = OUString( RTL_CONSTASCII_USTRINGPARAM( "Selection" ) );
- aRet[ aRet.getLength() - nElementAdded ].Value <<= maSelection;
+ aRet[ nLength - nElementAdded ].Name = OUString( RTL_CONSTASCII_USTRINGPARAM( "Selection" ) );
+ aRet[ nLength - nElementAdded ].Value <<= maSelection;
}
return aRet;
diff --git a/toolkit/source/controls/tksimpleanimation.cxx b/toolkit/source/controls/tksimpleanimation.cxx
index 56192b22d48d..4661144a5cb2 100644
--- a/toolkit/source/controls/tksimpleanimation.cxx
+++ b/toolkit/source/controls/tksimpleanimation.cxx
@@ -109,8 +109,10 @@ namespace toolkit
{
uno::Sequence< ::rtl::OUString > aServices( UnoControlModel::getSupportedServiceNames() );
aServices.realloc( aServices.getLength() + 2 );
- aServices[ aServices.getLength() - 2 ] = ::rtl::OUString::createFromAscii( szServiceName_UnoSimpleAnimationControlModel );
- aServices[ aServices.getLength() - 1 ] = ::rtl::OUString::createFromAscii( szServiceName2_UnoSimpleAnimationControlModel );
+ aServices[sal::static_int_cast<sal_uInt32>(aServices.getLength()) - 2]
+ = ::rtl::OUString::createFromAscii( szServiceName_UnoSimpleAnimationControlModel );
+ aServices[sal::static_int_cast<sal_uInt32>(aServices.getLength()) - 1]
+ = ::rtl::OUString::createFromAscii( szServiceName2_UnoSimpleAnimationControlModel );
return aServices;
}
diff --git a/toolkit/source/controls/tkthrobber.cxx b/toolkit/source/controls/tkthrobber.cxx
index 2b27b1dff48b..74b078ebacfc 100644
--- a/toolkit/source/controls/tkthrobber.cxx
+++ b/toolkit/source/controls/tkthrobber.cxx
@@ -107,8 +107,10 @@ namespace toolkit
{
uno::Sequence< ::rtl::OUString > aServices( UnoControlModel::getSupportedServiceNames() );
aServices.realloc( aServices.getLength() + 2 );
- aServices[ aServices.getLength() - 2 ] = ::rtl::OUString::createFromAscii( szServiceName_UnoThrobberControlModel );
- aServices[ aServices.getLength() - 1 ] = ::rtl::OUString::createFromAscii( szServiceName2_UnoThrobberControlModel );
+ aServices[sal::static_int_cast<sal_uInt32>(aServices.getLength()) - 2] =
+ ::rtl::OUString::createFromAscii(szServiceName_UnoThrobberControlModel);
+ aServices[sal::static_int_cast<sal_uInt32>(aServices.getLength()) - 1] =
+ ::rtl::OUString::createFromAscii(szServiceName2_UnoThrobberControlModel);
return aServices;
}
@@ -160,8 +162,10 @@ namespace toolkit
{
uno::Sequence< ::rtl::OUString > aServices( UnoControlBase::getSupportedServiceNames() );
aServices.realloc( aServices.getLength() + 2 );
- aServices[ aServices.getLength() - 2 ] = ::rtl::OUString::createFromAscii( szServiceName_UnoThrobberControl );
- aServices[ aServices.getLength() - 1 ] = ::rtl::OUString::createFromAscii( szServiceName2_UnoThrobberControl );
+ aServices[sal::static_int_cast<sal_uInt32>(aServices.getLength()) - 2] =
+ ::rtl::OUString::createFromAscii(szServiceName_UnoThrobberControl);
+ aServices[sal::static_int_cast<sal_uInt32>(aServices.getLength()) - 1] =
+ ::rtl::OUString::createFromAscii(szServiceName2_UnoThrobberControl);
return aServices;
}