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

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

Change-Id: Ieb48a5fd29f78d2e39e1d91448f3ce973aff93d9
Reviewed-on: https://gerrit.libreoffice.org/62463
Tested-by: Jenkins
Reviewed-by: 's avatarMike Kaganski <mike.kaganski@collabora.com>
üst c026807d
...@@ -545,40 +545,28 @@ void SmXMLExport::GetConfigurationSettings( Sequence < PropertyValue > & rProps) ...@@ -545,40 +545,28 @@ void SmXMLExport::GetConfigurationSettings( Sequence < PropertyValue > & rProps)
if (xPropertySetInfo.is()) if (xPropertySetInfo.is())
{ {
Sequence< Property > aProps = xPropertySetInfo->getProperties(); Sequence< Property > aProps = xPropertySetInfo->getProperties();
sal_Int32 nCount(aProps.getLength()); if (const sal_Int32 nCount = aProps.getLength())
if (nCount > 0)
{ {
rProps.realloc(nCount); rProps.realloc(nCount);
PropertyValue* pProps = rProps.getArray(); SmMathConfig* pConfig = SM_MOD()->GetConfig();
if (pProps) const bool bUsedSymbolsOnly = pConfig && pConfig->IsSaveOnlyUsedSymbols();
{
SmMathConfig *pConfig = SM_MOD()->GetConfig(); std::transform(aProps.begin(), aProps.end(), rProps.begin(),
const bool bUsedSymbolsOnly = pConfig && pConfig->IsSaveOnlyUsedSymbols(); [bUsedSymbolsOnly, &xProps](Property& prop) {
PropertyValue aRet;
const OUString sFormula ( "Formula" ); if (prop.Name != "Formula" && prop.Name != "BasicLibraries"
const OUString sBasicLibraries ( "BasicLibraries" ); && prop.Name != "DialogLibraries"
const OUString sDialogLibraries ( "DialogLibraries" ); && prop.Name != "RuntimeUID")
const OUString sRuntimeUID ( "RuntimeUID" ); {
for (sal_Int32 i = 0; i < nCount; i++, pProps++) aRet.Name = prop.Name;
{ OUString aActualName(prop.Name);
const OUString &rPropName = aProps[i].Name; // handle 'save used symbols only'
if (rPropName != sFormula && if (bUsedSymbolsOnly && prop.Name == "Symbols")
rPropName != sBasicLibraries && aActualName = "UserDefinedSymbolsInUse";
rPropName != sDialogLibraries && aRet.Value = xProps->getPropertyValue(aActualName);
rPropName != sRuntimeUID) }
{ return aRet;
pProps->Name = rPropName; });
OUString aActualName( rPropName );
// handle 'save used symbols only'
if (bUsedSymbolsOnly && rPropName == "Symbols" )
aActualName = "UserDefinedSymbolsInUse";
pProps->Value = xProps->getPropertyValue( aActualName );
}
}
}
} }
} }
} }
......
...@@ -745,9 +745,9 @@ bool MathType::HandleRecords(int nLevel, sal_uInt8 nSelector, ...@@ -745,9 +745,9 @@ bool MathType::HandleRecords(int nLevel, sal_uInt8 nSelector,
rRet.append(" \\ldline "); rRet.append(" \\ldline ");
break; break;
case tmFLOOR: case tmFLOOR:
if (nVariation == 0 || nVariation == 1) if (nVariation == 0 || nVariation & 0x01) // tvFENCE_L
rRet.append(" left lfloor "); rRet.append(" left lfloor ");
else if (nVariation==1) else
rRet.append(" left none "); rRet.append(" left none ");
break; break;
case tmCEILING: case tmCEILING:
...@@ -1286,9 +1286,9 @@ bool MathType::HandleRecords(int nLevel, sal_uInt8 nSelector, ...@@ -1286,9 +1286,9 @@ bool MathType::HandleRecords(int nLevel, sal_uInt8 nSelector,
rRet.append(" \\rdline "); rRet.append(" \\rdline ");
break; break;
case tmFLOOR: case tmFLOOR:
if (nVariation == 0 || nVariation == 2) if (nVariation == 0 || nVariation & 0x02) // tvFENCE_R
rRet.append(" right rfloor "); rRet.append(" right rfloor ");
else if (nVariation==2) else
rRet.append(" right none "); rRet.append(" right none ");
break; break;
case tmCEILING: case tmCEILING:
......
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