cppcheck:redundantAssignment

Change-Id: I1167d0ce6b6f6e48309d0551c1d2a283d79546a7
This commit is contained in:
Noel Grandin 2015-06-13 10:09:21 +02:00 committed by Noel Grandin
parent 943f4b4ff1
commit 4ea281a3cc
38 changed files with 66 additions and 108 deletions

View File

@ -746,12 +746,9 @@ void EditorWindow::HandleProcedureCompletion()
sal_uLong nLine = aSel.GetStart().GetPara(); sal_uLong nLine = aSel.GetStart().GetPara();
OUString aLine( pEditEngine->GetText( nLine ) ); OUString aLine( pEditEngine->GetText( nLine ) );
bool bFoundName = false;
OUString sProcType; OUString sProcType;
OUString sProcName; OUString sProcName;
bool bFoundName = GetProcedureName(aLine, sProcType, sProcName);
bFoundName = GetProcedureName(aLine, sProcType, sProcName);
if (!bFoundName) if (!bFoundName)
return; return;

View File

@ -726,9 +726,9 @@ void implRemoveDirRecursive( const OUString& aDirPath )
File::remove( aPath ); File::remove( aPath );
} }
} }
nRet = aDir.close(); aDir.close();
nRet = Directory::remove( aDirPath ); Directory::remove( aDirPath );
} }

View File

@ -765,7 +765,6 @@ void Chart2ImportTest::testNumberFormatsXLSX()
chart2::DataPointLabel aLabel; chart2::DataPointLabel aLabel;
sal_Int32 nNumberFormat; sal_Int32 nNumberFormat;
bool bLinkNumberFormatToSource = false; bool bLinkNumberFormatToSource = false;
bool bSuccess = false;
const sal_Int32 nChartDataNumberFormat = getNumberFormat( const sal_Int32 nChartDataNumberFormat = getNumberFormat(
xChartDoc, "_(\"$\"* #,##0_);_(\"$\"* \\(#,##0\\);_(\"$\"* \"-\"??_);_(@_)"); xChartDoc, "_(\"$\"* #,##0_);_(\"$\"* \\(#,##0\\);_(\"$\"* \"-\"??_);_(@_)");
@ -775,7 +774,7 @@ void Chart2ImportTest::testNumberFormatsXLSX()
CPPUNIT_ASSERT_EQUAL(sal_True, aLabel.ShowNumberInPercent); CPPUNIT_ASSERT_EQUAL(sal_True, aLabel.ShowNumberInPercent);
xPropertySet->getPropertyValue(CHART_UNONAME_NUMFMT) >>= nNumberFormat; xPropertySet->getPropertyValue(CHART_UNONAME_NUMFMT) >>= nNumberFormat;
CPPUNIT_ASSERT_EQUAL(nChartDataNumberFormat, nNumberFormat); CPPUNIT_ASSERT_EQUAL(nChartDataNumberFormat, nNumberFormat);
bSuccess = xPropertySet->getPropertyValue("PercentageNumberFormat") >>= nNumberFormat; bool bSuccess = xPropertySet->getPropertyValue("PercentageNumberFormat") >>= nNumberFormat;
CPPUNIT_ASSERT_EQUAL(false, bSuccess); CPPUNIT_ASSERT_EQUAL(false, bSuccess);
bSuccess = xPropertySet->getPropertyValue(CHART_UNONAME_LINK_TO_SRC_NUMFMT) >>= bLinkNumberFormatToSource; bSuccess = xPropertySet->getPropertyValue(CHART_UNONAME_LINK_TO_SRC_NUMFMT) >>= bLinkNumberFormatToSource;
CPPUNIT_ASSERT_MESSAGE("\"LinkNumberFormatToSource\" should be set to true.", bSuccess && bLinkNumberFormatToSource); CPPUNIT_ASSERT_MESSAGE("\"LinkNumberFormatToSource\" should be set to true.", bSuccess && bLinkNumberFormatToSource);

View File

@ -492,11 +492,10 @@ IMPL_LINK( ErrorBarResources, RangeChanged, Edit *, pEdit )
void ErrorBarResources::Reset(const SfxItemSet& rInAttrs) void ErrorBarResources::Reset(const SfxItemSet& rInAttrs)
{ {
const SfxPoolItem *pPoolItem = NULL; const SfxPoolItem *pPoolItem = NULL;
SfxItemState aState = SfxItemState::UNKNOWN;
// category // category
m_eErrorKind = CHERROR_NONE; m_eErrorKind = CHERROR_NONE;
aState = rInAttrs.GetItemState( SCHATTR_STAT_KIND_ERROR, true, &pPoolItem ); SfxItemState aState = rInAttrs.GetItemState( SCHATTR_STAT_KIND_ERROR, true, &pPoolItem );
m_bErrorKindUnique = ( aState != SfxItemState::DONTCARE ); m_bErrorKindUnique = ( aState != SfxItemState::DONTCARE );
if( aState == SfxItemState::SET ) if( aState == SfxItemState::SET )

View File

@ -1313,8 +1313,6 @@ bool SentenceEditWindow_Impl::PreNotify( NotifyEvent& rNEvt )
TextView* pTextView = pTextEngine->GetActiveView(); TextView* pTextView = pTextEngine->GetActiveView();
const TextSelection& rCurrentSelection = pTextView->GetSelection(); const TextSelection& rCurrentSelection = pTextView->GetSelection();
//determine if the selection contains a field //determine if the selection contains a field
bool bHasField = false;
bool bHasError = false;
bool bHasFieldLeft = false; bool bHasFieldLeft = false;
bool bHasErrorLeft = false; bool bHasErrorLeft = false;
@ -1327,8 +1325,8 @@ bool SentenceEditWindow_Impl::PreNotify( NotifyEvent& rNEvt )
const TextCharAttrib* pBackAttrLeft = 0; const TextCharAttrib* pBackAttrLeft = 0;
const TextCharAttrib* pErrorAttrLeft = 0; const TextCharAttrib* pErrorAttrLeft = 0;
bHasField = pBackAttr != 0 && (bHasRange || pBackAttr->GetEnd() > aCursor.GetIndex()); bool bHasField = pBackAttr != 0 && (bHasRange || pBackAttr->GetEnd() > aCursor.GetIndex());
bHasError = pErrorAttr != 0 && (bHasRange || pErrorAttr->GetEnd() > aCursor.GetIndex()); bool bHasError = pErrorAttr != 0 && (bHasRange || pErrorAttr->GetEnd() > aCursor.GetIndex());
if(bHasRange) if(bHasRange)
{ {
if(pBackAttr && if(pBackAttr &&

View File

@ -420,10 +420,9 @@ sal_Int16 ODatabaseExport::CheckString(const OUString& aCheckToken, sal_Int16 _n
ensureFormatter(); ensureFormatter();
if ( m_pFormatter && !m_sNumToken.isEmpty() ) if ( m_pFormatter && !m_sNumToken.isEmpty() )
{ {
double fOutNumber = 0.0;
LanguageType eNumLang; LanguageType eNumLang;
sal_uInt32 nFormatKey(0); sal_uInt32 nFormatKey(0);
fOutNumber = SfxHTMLParser::GetTableDataOptionsValNum(nFormatKey,eNumLang,m_sTextToken,m_sNumToken,*m_pFormatter); double fOutNumber = SfxHTMLParser::GetTableDataOptionsValNum(nFormatKey,eNumLang,m_sTextToken,m_sNumToken,*m_pFormatter);
if ( eNumLang != LANGUAGE_NONE ) if ( eNumLang != LANGUAGE_NONE )
{ {
nFormatKey = m_pFormatter->GetFormatForLanguageIfBuiltIn( nFormatKey, eNumLang ); nFormatKey = m_pFormatter->GetFormatForLanguageIfBuiltIn( nFormatKey, eNumLang );

View File

@ -1347,9 +1347,12 @@ namespace
{ {
_pSelectionBrw->DuplicateConditionLevel( nLevel); _pSelectionBrw->DuplicateConditionLevel( nLevel);
eErrorCode = GetORCriteria(_pView,_pSelectionBrw,pSearchCondition->getChild(0), nLevel,bHaving,bMustAddOrOnOneLine ); eErrorCode = GetORCriteria(_pView,_pSelectionBrw,pSearchCondition->getChild(0), nLevel,bHaving,bMustAddOrOnOneLine );
if ( eErrorCode == eOk )
{
++nLevel; ++nLevel;
eErrorCode = GetORCriteria(_pView,_pSelectionBrw,pSearchCondition->getChild(2), nLevel,bHaving,bMustAddOrOnOneLine ); eErrorCode = GetORCriteria(_pView,_pSelectionBrw,pSearchCondition->getChild(2), nLevel,bHaving,bMustAddOrOnOneLine );
} }
}
else else
eErrorCode = GetORCriteria(_pView,_pSelectionBrw,pSearchCondition, nLevel,bHaving,bMustAddOrOnOneLine ); eErrorCode = GetORCriteria(_pView,_pSelectionBrw,pSearchCondition, nLevel,bHaving,bMustAddOrOnOneLine );
} }

View File

@ -1487,7 +1487,7 @@ UpdateCheck::storeReleaseNote(sal_Int8 nNum, const OUString &rURL)
osl::FileBase::RC rc; osl::FileBase::RC rc;
OUString aTargetDir( UpdateCheckConfig::getAllUsersDirectory() + "/sun" ); OUString aTargetDir( UpdateCheckConfig::getAllUsersDirectory() + "/sun" );
rc = osl::Directory::createPath( aTargetDir ); osl::Directory::createPath( aTargetDir );
OUString aFileName = "releasenote" + OUString aFileName = "releasenote" +
OUString::number( nNum ) + OUString::number( nNum ) +
@ -1497,7 +1497,7 @@ UpdateCheck::storeReleaseNote(sal_Int8 nNum, const OUString &rURL)
rc = osl::FileBase::getAbsoluteFileURL( aTargetDir, aFileName, aFilePath ); rc = osl::FileBase::getAbsoluteFileURL( aTargetDir, aFileName, aFilePath );
if ( rc != osl::FileBase::E_None ) return false; if ( rc != osl::FileBase::E_None ) return false;
rc = osl::File::remove( aFilePath ); osl::File::remove( aFilePath );
// don't store empty release notes, but delete old ones // don't store empty release notes, but delete old ones
if ( rURL.isEmpty() ) if ( rURL.isEmpty() )
@ -1505,7 +1505,6 @@ UpdateCheck::storeReleaseNote(sal_Int8 nNum, const OUString &rURL)
osl::File aFile( aFilePath ); osl::File aFile( aFilePath );
rc = aFile.open( osl_File_OpenFlag_Write | osl_File_OpenFlag_Create ); rc = aFile.open( osl_File_OpenFlag_Write | osl_File_OpenFlag_Create );
if ( rc != osl::FileBase::E_None ) return false; if ( rc != osl::FileBase::E_None ) return false;
OString aLineBuf("[InternetShortcut]\r\n"); OString aLineBuf("[InternetShortcut]\r\n");

@ -1 +1 @@
Subproject commit b340cfa8193a9b070e7ff2142764b4cf3c0ff7f0 Subproject commit f5fa46ed8626910d710fd535518ddf9e756f9356

View File

@ -51,9 +51,8 @@ SAL_IMPLEMENT_MAIN_WITH_ARGS(argc, argv)
fprintf(stdout, HELP_TEXT);// default fprintf(stdout, HELP_TEXT);// default
return 0; return 0;
} }
javaFrameworkError errcode = JFW_E_NONE;
sal_Bool bEnabled = sal_False; sal_Bool bEnabled = sal_False;
errcode = jfw_getEnabled( & bEnabled); javaFrameworkError errcode = jfw_getEnabled( & bEnabled);
if (errcode == JFW_E_NONE && bEnabled == sal_False) if (errcode == JFW_E_NONE && bEnabled == sal_False)
{ {
//Do not do any preparation because that may only slow startup time. //Do not do any preparation because that may only slow startup time.

View File

@ -441,11 +441,16 @@ bool getJavaProps(const OUString & exePath,
sClassPath += "/../Resources/java"; sClassPath += "/../Resources/java";
#endif #endif
#ifdef UNX
// Java is no longer required for a11y - we use atk directly.
bool bNoAccessibility = !isEnvVarSetToOne("JFW_PLUGIN_FORCE_ACCESSIBILITY");
#else
//check if we shall examine a Java for accessibility support //check if we shall examine a Java for accessibility support
//If the bootstrap variable is "1" then we pass the argument //If the bootstrap variable is "1" then we pass the argument
//"noaccessibility" to JREProperties.class. This will prevent //"noaccessibility" to JREProperties.class. This will prevent
//that it calls java.awt.Toolkit.getDefaultToolkit(); //that it calls java.awt.Toolkit.getDefaultToolkit();
bool bNoAccessibility = isEnvVarSetToOne("JFW_PLUGIN_DO_NOT_CHECK_ACCESSIBILITY"); bool bNoAccessibility = isEnvVarSetToOne("JFW_PLUGIN_DO_NOT_CHECK_ACCESSIBILITY");
#endif
//prepare the arguments //prepare the arguments
sal_Int32 cArgs = 3; sal_Int32 cArgs = 3;
@ -454,12 +459,6 @@ bool getJavaProps(const OUString & exePath,
OUString arg3("JREProperties"); OUString arg3("JREProperties");
OUString arg4 = "noaccessibility"; OUString arg4 = "noaccessibility";
rtl_uString *args[4] = {arg1.pData, arg2.pData, arg3.pData}; rtl_uString *args[4] = {arg1.pData, arg2.pData, arg3.pData};
#ifdef UNX
// Java is no longer required for a11y - we use atk directly.
bNoAccessibility = !isEnvVarSetToOne("JFW_PLUGIN_FORCE_ACCESSIBILITY");
#endif
// Only add the fourth param if the bootstrap parameter is set. // Only add the fourth param if the bootstrap parameter is set.
if (bNoAccessibility) if (bNoAccessibility)
{ {
@ -624,9 +623,8 @@ bool getJavaInfoFromRegistry(const wchar_t* szRegKey,
DWORD dwIndex = 0; DWORD dwIndex = 0;
const DWORD BUFFSIZE = 1024; const DWORD BUFFSIZE = 1024;
wchar_t bufVersion[BUFFSIZE]; wchar_t bufVersion[BUFFSIZE];
DWORD nNameLen = BUFFSIZE;
FILETIME fileTime; FILETIME fileTime;
nNameLen = sizeof(bufVersion); DWORD nNameLen = sizeof(bufVersion);
// Iterate over all subkeys of HKEY_LOCAL_MACHINE\Software\JavaSoft\Java Runtime Environment // Iterate over all subkeys of HKEY_LOCAL_MACHINE\Software\JavaSoft\Java Runtime Environment
while (RegEnumKeyExW(hRoot, dwIndex, bufVersion, &nNameLen, NULL, NULL, NULL, &fileTime) != ERROR_NO_MORE_ITEMS) while (RegEnumKeyExW(hRoot, dwIndex, bufVersion, &nNameLen, NULL, NULL, NULL, &fileTime) != ERROR_NO_MORE_ITEMS)

View File

@ -1607,13 +1607,11 @@ XFColumns* LwpLayout::GetXFColumns()
for(sal_uInt16 nIndex = 0; nIndex<nCols; nIndex++) for(sal_uInt16 nIndex = 0; nIndex<nCols; nIndex++)
{ {
XFColumn aColumn; XFColumn aColumn;
sal_Int32 nWidth = static_cast<sal_Int32>(GetColWidth(nIndex)); sal_Int32 nWidth = 8305/nCols; //relative width
nWidth=8305/nCols; //relative width
aColumn.SetRelWidth(nWidth); aColumn.SetRelWidth(nWidth);
//the left and right margins is 0; //the left and right margins is 0;
double nGap = GetColGap(nIndex)/2; double nGap = GetColGap(nIndex)/2;
//nGap=0;
aColumn.SetMargins(nGap,nGap); aColumn.SetMargins(nGap,nGap);
if(nIndex==0) if(nIndex==0)
{ {

View File

@ -600,9 +600,7 @@ static DWORD create_dir_with_callback(
// user specified callback function. On success // user specified callback function. On success
// the function returns ERROR_SUCCESS else a Win32 error code. // the function returns ERROR_SUCCESS else a Win32 error code.
BOOL bCreated = FALSE; BOOL bCreated = CreateDirectoryW( reinterpret_cast<LPCWSTR>(rtl_uString_getStr( dir_path )), NULL );
bCreated = CreateDirectoryW( reinterpret_cast<LPCWSTR>(rtl_uString_getStr( dir_path )), NULL );
if ( bCreated ) if ( bCreated )
{ {
@ -702,9 +700,7 @@ oslFileError osl_createDirectoryWithFlags(rtl_uString * strPath, sal_uInt32)
if ( osl_File_E_None == error ) if ( osl_File_E_None == error )
{ {
BOOL bCreated = FALSE; BOOL bCreated = CreateDirectoryW( reinterpret_cast<LPCWSTR>(rtl_uString_getStr( strSysPath )), NULL );
bCreated = CreateDirectoryW( reinterpret_cast<LPCWSTR>(rtl_uString_getStr( strSysPath )), NULL );
if ( !bCreated ) if ( !bCreated )
{ {

View File

@ -1925,19 +1925,16 @@ static sal_Bool osl_ProfileSwapProfileNames(osl_TProfileImpl* pProfile)
static rtl_uString* osl_ProfileGenerateExtension(rtl_uString* ustrFileName, rtl_uString* ustrExtension) static rtl_uString* osl_ProfileGenerateExtension(rtl_uString* ustrFileName, rtl_uString* ustrExtension)
{ {
rtl_uString* ustrNewFileName=0; rtl_uString* ustrNewFileName = 0;
rtl_uString* ustrOldExtension = 0; rtl_uString* ustrOldExtension = 0;
sal_Unicode* pExtensionBuf = 0;
sal_Unicode* pFileNameBuf = 0;
sal_Int32 nIndex = -1;
pFileNameBuf = rtl_uString_getStr(ustrFileName); sal_Unicode* pFileNameBuf = rtl_uString_getStr(ustrFileName);
rtl_uString_newFromAscii(&ustrOldExtension,"."); rtl_uString_newFromAscii(&ustrOldExtension, ".");
pExtensionBuf = rtl_uString_getStr(ustrOldExtension); sal_Unicode* pExtensionBuf = rtl_uString_getStr(ustrOldExtension);
nIndex = rtl_ustr_lastIndexOfChar(pFileNameBuf,*pExtensionBuf); sal_Int32 nIndex = rtl_ustr_lastIndexOfChar(pFileNameBuf, *pExtensionBuf);
rtl_uString_newReplaceStrAt(&ustrNewFileName, rtl_uString_newReplaceStrAt(&ustrNewFileName,
ustrFileName, ustrFileName,

View File

@ -313,9 +313,9 @@ inline bool ifFileExist( const ::rtl::OUString & str )
//check if the file can be written //check if the file can be written
inline bool ifFileCanWrite( const ::rtl::OUString & str ) inline bool ifFileCanWrite( const ::rtl::OUString & str )
{ {
bool bCheckResult = false;
//on Windows, the file has no write right, but can be written //on Windows, the file has no write right, but can be written
#ifdef WNT #ifdef WNT
bool bCheckResult = false;
::rtl::OUString aUStr = str.copy( 0 ); ::rtl::OUString aUStr = str.copy( 0 );
if ( isURL( str ) ) if ( isURL( str ) )
::osl::FileBase::getSystemPathFromFileURL( str, aUStr ); ::osl::FileBase::getSystemPathFromFileURL( str, aUStr );
@ -327,7 +327,7 @@ inline bool ifFileCanWrite( const ::rtl::OUString & str )
//on UNX, just test if open success with osl_File_OpenFlag_Write //on UNX, just test if open success with osl_File_OpenFlag_Write
#else #else
::osl::File testFile( str ); ::osl::File testFile( str );
bCheckResult = (osl::FileBase::E_None == testFile.open( osl_File_OpenFlag_Write )); bool bCheckResult = (osl::FileBase::E_None == testFile.open( osl_File_OpenFlag_Write ));
#endif #endif
return bCheckResult; return bCheckResult;
} }
@ -1397,13 +1397,13 @@ namespace osl_FileStatus
void isValid_002() void isValid_002()
{ {
createTestFile( aTmpName6 ); createTestFile( aTmpName6 );
sal_uInt32 mask_file = ( osl_FileStatus_Mask_Type | osl_FileStatus_Mask_Attributes | sal_uInt32 mask_file = osl_FileStatus_Mask_Type | osl_FileStatus_Mask_Attributes |
osl_FileStatus_Mask_CreationTime | osl_FileStatus_Mask_AccessTime | osl_FileStatus_Mask_CreationTime | osl_FileStatus_Mask_AccessTime |
osl_FileStatus_Mask_ModifyTime | osl_FileStatus_Mask_FileSize | osl_FileStatus_Mask_ModifyTime | osl_FileStatus_Mask_FileSize |
osl_FileStatus_Mask_FileName | osl_FileStatus_Mask_FileURL) ; osl_FileStatus_Mask_FileName | osl_FileStatus_Mask_FileURL;
::osl::FileStatus rFileStatus( mask_file ); ::osl::FileStatus rFileStatus( mask_file );
::osl::FileBase::RC nError1 = ::osl::DirectoryItem::get( aTmpName6, rItem_file ); ::osl::DirectoryItem::get( aTmpName6, rItem_file );
nError1 = rItem_file.getFileStatus( rFileStatus ); ::osl::FileBase::RC nError1 = rItem_file.getFileStatus( rFileStatus );
CPPUNIT_ASSERT_MESSAGE( errorToStr(nError1).getStr(), ::osl::FileBase::E_None == nError1 ); CPPUNIT_ASSERT_MESSAGE( errorToStr(nError1).getStr(), ::osl::FileBase::E_None == nError1 );
@ -2232,8 +2232,8 @@ namespace osl_File
nError1 = testFile.open( osl_File_OpenFlag_Create ); nError1 = testFile.open( osl_File_OpenFlag_Create );
bool bOK = ( File::E_ACCES == nError1 ); bool bOK = ( File::E_ACCES == nError1 );
#if defined (WNT ) #ifdef WNT
bOK = sal_True; /// in Windows, you can create file in c:/ any way. bOK = true; /// in Windows, you can create file in c:/ any way.
testFile.close(); testFile.close();
deleteTestFile( aTestFile); deleteTestFile( aTestFile);
#endif #endif

View File

@ -359,7 +359,6 @@ void MyTestPlugInImpl::initialize( CPPUNIT_NS::TestFactoryRegistry *,
TCHAR tchBuffer[BUFSIZE]; // buffer for string TCHAR tchBuffer[BUFSIZE]; // buffer for string
lpszSystemInfo = tchBuffer; lpszSystemInfo = tchBuffer;
cchBuff = BUFSIZE;
if( GetUserNameA(lpszSystemInfo, &cchBuff) ) if( GetUserNameA(lpszSystemInfo, &cchBuff) )
strUserName = ::rtl::OUString::createFromAscii( lpszSystemInfo ); strUserName = ::rtl::OUString::createFromAscii( lpszSystemInfo );

View File

@ -818,12 +818,11 @@ bool Converter::convertDuration(double& rfTime,
{ {
if ( nDays ) if ( nDays )
nHours += nDays * 24; // add the days to the hours part nHours += nDays * 24; // add the days to the hours part
double fTempTime = 0.0;
double fHour = nHours; double fHour = nHours;
double fMin = nMins; double fMin = nMins;
double fSec = nSecs; double fSec = nSecs;
double fFraction = sDoubleStr.toDouble(); double fFraction = sDoubleStr.toDouble();
fTempTime = fHour / 24; double fTempTime = fHour / 24;
fTempTime += fMin / (24 * 60); fTempTime += fMin / (24 * 60);
fTempTime += fSec / (24 * 60 * 60); fTempTime += fSec / (24 * 60 * 60);
fTempTime += fFraction / (24 * 60 * 60); fTempTime += fFraction / (24 * 60 * 60);

View File

@ -5170,7 +5170,7 @@ void Test::testAreasWithNotes()
SCCOL col; SCCOL col;
SCROW row; SCROW row;
bool dataFound = false; bool dataFound;
// only cell notes (empty content) // only cell notes (empty content)

View File

@ -872,8 +872,6 @@ void ScDrawLayer::RecalcPos( SdrObject* pObj, ScDrawObjData& rData, bool bNegati
rNoRotatedAnchor.maStartOffset = rData.maStartOffset; rNoRotatedAnchor.maStartOffset = rData.maStartOffset;
rNoRotatedAnchor.maEndOffset = rData.maEndOffset; rNoRotatedAnchor.maEndOffset = rData.maEndOffset;
Rectangle aRect = pObj->GetLogicRect();
// get bounding rectangle of shape ( include any hidden row/columns ), <sigh> we need to do this // get bounding rectangle of shape ( include any hidden row/columns ), <sigh> we need to do this
// because if the shape is rotated the anchor from xml is in terms of the unrotated shape, if // because if the shape is rotated the anchor from xml is in terms of the unrotated shape, if
// the shape is hidden ( by the rows that contain the shape being hidden ) then our hack of // the shape is hidden ( by the rows that contain the shape being hidden ) then our hack of
@ -893,8 +891,6 @@ void ScDrawLayer::RecalcPos( SdrObject* pObj, ScDrawObjData& rData, bool bNegati
// resize/position the shape to *full* size e.g. how it would be ( if no hidden rows/cols affected things ) // resize/position the shape to *full* size e.g. how it would be ( if no hidden rows/cols affected things )
pObj->SetLogicRect(aFullRect); pObj->SetLogicRect(aFullRect);
// capture rotated shape ( if relevant )
aRect = pObj->GetSnapRect();
// Ok, here is more nastyness, from xml the Anchor is in terms of the LogicRect which is the // Ok, here is more nastyness, from xml the Anchor is in terms of the LogicRect which is the
// untransformed unrotated shape, here we swap out that initial anchor and from now on use // untransformed unrotated shape, here we swap out that initial anchor and from now on use

View File

@ -280,7 +280,6 @@ OUString XclImpHyperlink::ReadEmbeddedData( XclImpStream& rStrm )
nStrLen = rStrm.ReaduInt32(); nStrLen = rStrm.ReaduInt32();
if( nStrLen ) if( nStrLen )
{ {
nStrLen = 0;
nStrLen = rStrm.ReaduInt32(); nStrLen = rStrm.ReaduInt32();
nStrLen /= 2; // it's byte count here... nStrLen /= 2; // it's byte count here...
rStrm.Ignore( 2 ); rStrm.Ignore( 2 );
@ -780,7 +779,6 @@ void XclImpValidationManager::ReadDV( XclImpStream& rStrm )
// second formula // second formula
::std::unique_ptr< ScTokenArray > xTokArr2; ::std::unique_ptr< ScTokenArray > xTokArr2;
nLen = 0;
nLen = rStrm.ReaduInt16(); nLen = rStrm.ReaduInt16();
rStrm.Ignore( 2 ); rStrm.Ignore( 2 );
if( nLen > 0 ) if( nLen > 0 )

View File

@ -58,7 +58,7 @@ double ScfTools::ReadLongDouble( SvStream& rStrm )
{ {
/* /*
" M a p p i n g - G u i d e " 10-Byte Intel "Mapping - Guide" 10-Byte Intel
77777777 77666666 66665555 55555544 44444444 33333333 33222222 22221111 11111100 00000000 x10 77777777 77666666 66665555 55555544 44444444 33333333 33222222 22221111 11111100 00000000 x10
98765432 10987654 32109876 54321098 76543210 98765432 10987654 32109876 54321098 76543210 Bit-# total 98765432 10987654 32109876 54321098 76543210 98765432 10987654 32109876 54321098 76543210 Bit-# total
@ -69,7 +69,7 @@ SEEEEEEE EEEEEEEE IMMMMMMM MMMMMMMM MMMMMMMM MMMMMMMM MMMMMMMM MMMMMMMM MMMMMMMM
14321098 76543210 02109876 54321098 76543210 98765432 10987654 32109876 54321098 76543210 Bit in Group 14321098 76543210 02109876 54321098 76543210 98765432 10987654 32109876 54321098 76543210 Bit in Group
*/ */
long double lfDouble = 0.0; long double lfDouble;
long double lfFakt = 256.0; long double lfFakt = 256.0;
sal_uInt8 pDouble10[ 10 ]; sal_uInt8 pDouble10[ 10 ];

View File

@ -43,8 +43,7 @@ void QProToSc::ReadSRD( ScSingleRefData& rSRD, sal_Int8 nPage, sal_Int8 nCol, sa
if( nRelBit & 0x2000 ) if( nRelBit & 0x2000 )
{ {
SCROW nRelRow = (~nTmp + 1); SCROW nRelRow = (sal_Int16)(nTmp << 3); // This looks weird... Mistake?
nRelRow = (sal_Int16)(nTmp << 3); // This looks weird... Mistake?
nRelRow /= 8; nRelRow /= 8;
rSRD.SetRelRow(nRelRow); rSRD.SetRelRow(nRelRow);
} }

View File

@ -304,7 +304,6 @@ void ScSheetLinkObj::setFileName(const OUString& rNewName)
// Links updaten // Links updaten
//! Undo !!! //! Undo !!!
pLink = NULL; // wird bei UpdateLinks ungueltig
pDocShell->UpdateLinks(); // alter Link raus, evtl. neuen Link anlegen pDocShell->UpdateLinks(); // alter Link raus, evtl. neuen Link anlegen
// Daten kopieren // Daten kopieren

View File

@ -1977,11 +1977,8 @@ bool StringResourcePersistenceImpl::implReadPropertiesFile
if( !xInputStream.is() || pLocaleItem == NULL ) if( !xInputStream.is() || pLocaleItem == NULL )
return false; return false;
bool bSuccess = false;
Reference< io::XTextInputStream2 > xTextInputStream = io::TextInputStream::create( m_xContext ); Reference< io::XTextInputStream2 > xTextInputStream = io::TextInputStream::create( m_xContext );
bSuccess = true;
xTextInputStream->setInputStream( xInputStream ); xTextInputStream->setInputStream( xInputStream );
OUString aEncodingStr = OUString::createFromAscii OUString aEncodingStr = OUString::createFromAscii
@ -2092,7 +2089,7 @@ bool StringResourcePersistenceImpl::implReadPropertiesFile
rIndexMap[ aResourceID ] = pLocaleItem->m_nNextIndex++; rIndexMap[ aResourceID ] = pLocaleItem->m_nNextIndex++;
} }
return bSuccess; return true;
} }

View File

@ -387,8 +387,8 @@ IMPL_LINK_NOARG(SfxVersionDialog, SelectHdl_Impl)
m_pViewButton->Enable(bEnable); m_pViewButton->Enable(bEnable);
const SfxPoolItem *pDummy=NULL; const SfxPoolItem *pDummy=NULL;
SfxItemState eState = pViewFrame->GetDispatcher()->QueryState( SID_DOCUMENT_MERGE, pDummy ); pViewFrame->GetDispatcher()->QueryState( SID_DOCUMENT_MERGE, pDummy );
eState = pViewFrame->GetDispatcher()->QueryState( SID_DOCUMENT_COMPARE, pDummy ); SfxItemState eState = pViewFrame->GetDispatcher()->QueryState( SID_DOCUMENT_COMPARE, pDummy );
m_pCompareButton->Enable(bEnable && eState >= SfxItemState::DEFAULT); m_pCompareButton->Enable(bEnable && eState >= SfxItemState::DEFAULT);
return 0L; return 0L;

View File

@ -850,9 +850,9 @@ static sal_Bool test_introsp( Reference< XMultiServiceFactory > xMgr,
Any aObjAny = getIntrospectionTestObject( xMgr ); Any aObjAny = getIntrospectionTestObject( xMgr );
// inspect introspection service // inspect introspection service
xIntrospection->inspect( aObjAny );
xIntrospection->inspect( aObjAny );
Reference< XIntrospectionAccess > xAccess = xIntrospection->inspect( aObjAny ); Reference< XIntrospectionAccess > xAccess = xIntrospection->inspect( aObjAny );
xAccess = xIntrospection->inspect( aObjAny );
xAccess = xIntrospection->inspect( aObjAny );
OSL_ENSURE( xAccess.is(), "introspection failed, no XIntrospectionAccess returned" ); OSL_ENSURE( xAccess.is(), "introspection failed, no XIntrospectionAccess returned" );
if( !xAccess.is() ) if( !xAccess.is() )
return sal_False; return sal_False;

View File

@ -420,9 +420,8 @@ void SvImpLBox::PageDown( sal_uInt16 nDelta )
} }
else else
{ {
long nScroll = nRealDelta * (-1);
Rectangle aArea( GetVisibleArea() ); Rectangle aArea( GetVisibleArea() );
nScroll = pView->GetEntryHeight() * static_cast<long>(nRealDelta); long nScroll = pView->GetEntryHeight() * static_cast<long>(nRealDelta);
nScroll = -nScroll; nScroll = -nScroll;
pView->Update(); pView->Update();
pView->Scroll( 0, nScroll, aArea, ScrollFlags::NoChildren ); pView->Scroll( 0, nScroll, aArea, ScrollFlags::NoChildren );

View File

@ -320,7 +320,7 @@ SwTextNode* getModelToViewTestDocument(SwDoc *pDoc)
SwTextNode* getModelToViewTestDocument2(SwDoc *pDoc) SwTextNode* getModelToViewTestDocument2(SwDoc *pDoc)
{ {
SwTextNode* pTextNode = getModelToViewTestDocument(pDoc); getModelToViewTestDocument(pDoc);
SwNodeIndex aIdx(pDoc->GetNodes().GetEndOfContent(), -1); SwNodeIndex aIdx(pDoc->GetNodes().GetEndOfContent(), -1);
SwPaM aPaM(aIdx); SwPaM aPaM(aIdx);
@ -336,7 +336,7 @@ SwTextNode* getModelToViewTestDocument2(SwDoc *pDoc)
(*pFieldmark->GetParameters())[ODF_FORMDROPDOWN_LISTENTRY] = uno::makeAny(vListEntries); (*pFieldmark->GetParameters())[ODF_FORMDROPDOWN_LISTENTRY] = uno::makeAny(vListEntries);
(*pFieldmark->GetParameters())[ODF_FORMDROPDOWN_RESULT] = uno::makeAny(sal_Int32(0)); (*pFieldmark->GetParameters())[ODF_FORMDROPDOWN_RESULT] = uno::makeAny(sal_Int32(0));
pDoc->getIDocumentContentOperations().InsertString(aPaM, OUString("CCCCC")); pDoc->getIDocumentContentOperations().InsertString(aPaM, OUString("CCCCC"));
pTextNode = aPaM.GetNode().GetTextNode(); SwTextNode* pTextNode = aPaM.GetNode().GetTextNode();
CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(11), CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(11),
pTextNode->GetText().getLength()); pTextNode->GetText().getLength());

View File

@ -662,11 +662,8 @@ DECLARE_OOXMLEXPORT_TEST(testParagraphWithComments, "paragraphWithComments.docx"
if(!pXmlDoc) if(!pXmlDoc)
return; return;
sal_Int32 idInDocXml = 0; sal_Int32 idInDocXml = getXPath(pXmlDoc,"/w:document/w:body/w:p[3]/w:commentRangeEnd[1]","id").toInt32();
sal_Int32 idInCommentXml = -1; //intentionally assigning -1 so that it differs from idInDocXml sal_Int32 idInCommentXml = getXPath(pXmlComm,"/w:comments/w:comment[1]","id").toInt32();
//and also because getXpath does not assert.
idInDocXml = getXPath(pXmlDoc,"/w:document/w:body/w:p[3]/w:commentRangeEnd[1]","id").toInt32();
idInCommentXml = getXPath(pXmlComm,"/w:comments/w:comment[1]","id").toInt32();
CPPUNIT_ASSERT_EQUAL( idInDocXml, idInCommentXml ); CPPUNIT_ASSERT_EQUAL( idInDocXml, idInCommentXml );
} }

View File

@ -1031,8 +1031,6 @@ void ControlModelContainerBase::implUpdateGroupStructure()
// it's a radio button, but on a different page // it's a radio button, but on a different page
// -> we open a new group for it // -> we open a new group for it
// close the old group
aCurrentGroup = maGroups.end();
#if OSL_DEBUG_LEVEL > 1 #if OSL_DEBUG_LEVEL > 1
aCurrentGroupLabels.clear(); aCurrentGroupLabels.clear();
#endif #endif

View File

@ -36,7 +36,7 @@ namespace skeletonmaker {
void printLicenseHeader(std::ostream& o, rtl::OString const & filename) void printLicenseHeader(std::ostream& o, rtl::OString const & filename)
{ {
sal_Int32 index = -1; sal_Int32 index;
#ifdef SAL_UNX #ifdef SAL_UNX
index = filename.lastIndexOf('/'); index = filename.lastIndexOf('/');
#else #else

View File

@ -71,8 +71,7 @@ SalData::~SalData()
if( s_aAutoReleaseKey ) if( s_aAutoReleaseKey )
{ {
// release the last pool // release the last pool
NSAutoreleasePool* pPool = nil; NSAutoreleasePool* pPool = reinterpret_cast<NSAutoreleasePool*>( osl_getThreadKeyData( s_aAutoReleaseKey ) );
pPool = reinterpret_cast<NSAutoreleasePool*>( osl_getThreadKeyData( s_aAutoReleaseKey ) );
if( pPool ) if( pPool )
{ {
osl_setThreadKeyData( s_aAutoReleaseKey, NULL ); osl_setThreadKeyData( s_aAutoReleaseKey, NULL );

View File

@ -323,10 +323,8 @@ static bool AddTempDevFont(const OUString& rFontFileURL)
CFStringRef rFontPath = CFStringCreateWithCString(NULL, aCFileName.getStr(), kCFStringEncodingUTF8); CFStringRef rFontPath = CFStringCreateWithCString(NULL, aCFileName.getStr(), kCFStringEncodingUTF8);
CFURLRef rFontURL = CFURLCreateWithFileSystemPath(NULL, rFontPath, kCFURLPOSIXPathStyle, true); CFURLRef rFontURL = CFURLCreateWithFileSystemPath(NULL, rFontPath, kCFURLPOSIXPathStyle, true);
bool success = false;
CFErrorRef error; CFErrorRef error;
success = CTFontManagerRegisterFontsForURL(rFontURL, kCTFontManagerScopeProcess, &error); bool success = CTFontManagerRegisterFontsForURL(rFontURL, kCTFontManagerScopeProcess, &error);
if (!success) if (!success)
{ {
CFRelease(error); CFRelease(error);

View File

@ -734,7 +734,7 @@ SvStream& WriteAnimation( SvStream& rOStm, const Animation& rAnimation )
SvStream& ReadAnimation( SvStream& rIStm, Animation& rAnimation ) SvStream& ReadAnimation( SvStream& rIStm, Animation& rAnimation )
{ {
Bitmap aBmp; Bitmap aBmp;
sal_uLong nStmPos = rIStm.Tell(); sal_uLong nStmPos;
sal_uInt32 nAnimMagic1, nAnimMagic2; sal_uInt32 nAnimMagic1, nAnimMagic2;
SvStreamEndian nOldFormat = rIStm.GetEndian(); SvStreamEndian nOldFormat = rIStm.GetEndian();
bool bReadAnimations = false; bool bReadAnimations = false;

View File

@ -161,7 +161,7 @@ bool TaskPaneList::HandleKeyEvent(const KeyEvent& rKeyEvent)
bool bForward = !aKeyCode.IsShift(); bool bForward = !aKeyCode.IsShift();
if( aKeyCode.GetCode() == KEY_F6 && ! aKeyCode.IsMod2() ) // F6 if( aKeyCode.GetCode() == KEY_F6 && ! aKeyCode.IsMod2() ) // F6
{ {
bool bSplitterOnly = false; bool bSplitterOnly;
bool bFocusInList = false; bool bFocusInList = false;
bSplitterOnly = aKeyCode.IsMod1() && aKeyCode.IsShift(); bSplitterOnly = aKeyCode.IsMod1() && aKeyCode.IsShift();

View File

@ -313,7 +313,7 @@ bool WinSalInstance::CheckYieldMutex()
void SalData::initKeyCodeMap() void SalData::initKeyCodeMap()
{ {
UINT nKey = 0xffffffff; UINT nKey;
#define initKey( a, b )\ #define initKey( a, b )\
nKey = LOWORD( VkKeyScan( a ) );\ nKey = LOWORD( VkKeyScan( a ) );\
if( nKey < 0xffff )\ if( nKey < 0xffff )\

View File

@ -938,8 +938,7 @@ STDMETHODIMP CAccTextBase::put_XInterface(hyper pXInterface)
static OUString ReplaceOneChar(OUString oldOUString, OUString replacedChar, OUString replaceStr) static OUString ReplaceOneChar(OUString oldOUString, OUString replacedChar, OUString replaceStr)
{ {
int iReplace = -1; int iReplace = oldOUString.lastIndexOf(replacedChar);
iReplace = oldOUString.lastIndexOf(replacedChar);
if (iReplace > -1) if (iReplace > -1)
{ {
for(;iReplace>-1;) for(;iReplace>-1;)

View File

@ -431,7 +431,6 @@ int AccObjectWinManager::UpdateAccSelection(XAccessible* pXAcc)
continue; continue;
} }
pAccChildObj = NULL;
pAccChildObj = GetAccObjByXAcc(pRChild.get()); pAccChildObj = GetAccObjByXAcc(pRChild.get());
if(!pAccChildObj) if(!pAccChildObj)
{ {