Kaydet (Commit) 36880d76 authored tarafından Mike Kaganski's avatar Mike Kaganski

tdf#120703 PVS: V547 Expression is always true/false

Change-Id: I1e5098e11f1e5e2f7c5518ea05c57512f58b585b
Reviewed-on: https://gerrit.libreoffice.org/62464
Tested-by: Jenkins
Reviewed-by: 's avatarMike Kaganski <mike.kaganski@collabora.com>
üst 85985a6a
......@@ -523,18 +523,13 @@ void ScGlobal::InitTextHeight(const SfxItemPool* pPool)
return;
}
const ScPatternAttr* pPattern = &pPool->GetDefaultItem(ATTR_PATTERN);
if (!pPattern)
{
OSL_FAIL("ScGlobal::InitTextHeight: No default pattern");
return;
}
const ScPatternAttr& rPattern = pPool->GetDefaultItem(ATTR_PATTERN);
OutputDevice* pDefaultDev = Application::GetDefaultDevice();
ScopedVclPtrInstance< VirtualDevice > pVirtWindow( *pDefaultDev );
pVirtWindow->SetMapMode(MapMode(MapUnit::MapPixel));
vcl::Font aDefFont;
pPattern->GetFont(aDefFont, SC_AUTOCOL_BLACK, pVirtWindow); // Font color doesn't matter here
rPattern.GetFont(aDefFont, SC_AUTOCOL_BLACK, pVirtWindow); // Font color doesn't matter here
pVirtWindow->SetFont(aDefFont);
sal_uInt16 nTest = static_cast<sal_uInt16>(
pVirtWindow->PixelToLogic(Size(0, pVirtWindow->GetTextHeight()), MapMode(MapUnit::MapTwip)).Height());
......@@ -542,10 +537,10 @@ void ScGlobal::InitTextHeight(const SfxItemPool* pPool)
if (nTest > nDefFontHeight)
nDefFontHeight = nTest;
const SvxMarginItem* pMargin = &pPattern->GetItem(ATTR_MARGIN);
const SvxMarginItem& rMargin = rPattern.GetItem(ATTR_MARGIN);
nTest = static_cast<sal_uInt16>(
nDefFontHeight + pMargin->GetTopMargin() + pMargin->GetBottomMargin() - STD_ROWHEIGHT_DIFF);
nTest = static_cast<sal_uInt16>(nDefFontHeight + rMargin.GetTopMargin()
+ rMargin.GetBottomMargin() - STD_ROWHEIGHT_DIFF);
if (nTest > nStdRowHeight)
nStdRowHeight = nTest;
......
This diff is collapsed.
......@@ -398,8 +398,6 @@ MasterScriptProvider::getName()
Sequence< Reference< browse::XBrowseNode > > SAL_CALL
MasterScriptProvider::getChildNodes()
{
if ( !providerCache() )
throw RuntimeException( "MasterScriptProvider::getAllProviders, cache not initialised" );
Sequence< Reference< provider::XScriptProvider > > providers = providerCache()->getAllProviders();
sal_Int32 size = providers.getLength();
......@@ -525,12 +523,6 @@ MasterScriptProvider::insertByName( const OUString& aName, const Any& aElement )
// TODO for library package parse the language, for the moment will try
// to get each provider to process the new Package, the first one the succeeds
// will terminate processing
if ( !providerCache() )
{
throw RuntimeException(
"insertByName cannot instantiate "
"child script providers." );
}
const bool bSuccess = FindProviderAndApply(
*providerCache(), [&aName, &aElement](Reference<container::XNameContainer>& xCont) {
xCont->insertByName(aName, aElement);
......@@ -570,13 +562,6 @@ MasterScriptProvider::removeByName( const OUString& Name )
// TODO for Script library package url parse the language,
// for the moment will just try to get each provider to process remove/revoke
// request, the first one the succeeds will terminate processing
if ( !providerCache() )
{
throw RuntimeException(
"removeByName() cannot instantiate "
"child script providers." );
}
const bool bSuccess = FindProviderAndApply(
*providerCache(), [&Name](Reference<container::XNameContainer>& xCont) {
xCont->removeByName(Name);
......@@ -637,13 +622,6 @@ MasterScriptProvider::hasByName( const OUString& aName )
// for the moment will just try to get each provider to see if the
// package exists in any provider, first one that succeed will
// terminate the loop
if ( !providerCache() )
{
throw RuntimeException(
"removeByName() cannot instantiate "
"child script providers." );
}
result = FindProviderAndApply(
*providerCache(), [&aName](Reference<container::XNameContainer>& xCont) {
return xCont->hasByName(aName);
......
......@@ -1512,14 +1512,12 @@ bool SfxObjectShell::SaveTo_Impl
aInfo.TimeStamp.Minutes = aTime.GetMin();
aInfo.TimeStamp.Seconds = aTime.GetSec();
if ( bOk )
{
// add new version information into the versionlist and save the versionlist
// the version list must have been transferred from the "old" medium before
rMedium.AddVersion_Impl( aInfo );
rMedium.SaveVersionList_Impl();
bOk = PutURLContentsToVersionStream_Impl( aTmpVersionURL, xMedStorage, aInfo.Identifier );
}
// add new version information into the versionlist and save the versionlist
// the version list must have been transferred from the "old" medium before
rMedium.AddVersion_Impl(aInfo);
rMedium.SaveVersionList_Impl();
bOk = PutURLContentsToVersionStream_Impl(aTmpVersionURL, xMedStorage,
aInfo.Identifier);
}
else if ( bOk && ( pImpl->bIsSaving || pImpl->bPreserveVersions ) )
{
......
......@@ -1085,8 +1085,7 @@ void SwGlobalTree::ExecCommand(const OUString &rCmd)
}
else if (rCmd == "up")
{
if(nSource)
bMove = 0 != nSource;
bMove = 0 != nSource;
nDest--;
}
if( bMove && m_pActiveShell->MoveGlobalDocContent(
......
......@@ -450,10 +450,9 @@ Any SAL_CALL FTPContent::execute( const Command& aCommand,
else if(xOutputStream.is()) {
Reference<XInputStream> xStream(
new ucbhelper::FdInputStream(m_aFTPURL.open()));
Sequence<sal_Int8> byte_seq(4096);
sal_Int32 n = 1000; // value does not matter here
for (;;) {
n = xStream->readBytes(byte_seq,4096);
Sequence<sal_Int8> byte_seq(4096);
sal_Int32 n = xStream->readBytes(byte_seq, 4096);
if (n == 0) {
break;
}
......@@ -469,19 +468,6 @@ Any SAL_CALL FTPContent::execute( const Command& aCommand,
}
}
if(n) {
Sequence<Any> seq(1);
PropertyValue value;
value.Name = "Uri";
value.Handle = -1;
value.Value <<= m_aFTPURL.ident(false,false);
value.State = PropertyState_DIRECT_VALUE;
seq[0] <<= value;
ucbhelper::cancelCommandExecution(
IOErrorCode_UNKNOWN,
seq,
Environment);
}
}
else {
aRet <<= UnsupportedDataSinkException(
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment