[Libreoffice-commits] core.git: desktop/source filter/source sal/rtl
Muhammet Kara
muhammet.kara at pardus.org.tr
Mon Apr 16 02:59:19 UTC 2018
desktop/source/lib/init.cxx | 4 +---
filter/source/graphicfilter/iras/iras.cxx | 6 +++---
sal/rtl/random.cxx | 2 +-
3 files changed, 5 insertions(+), 7 deletions(-)
New commits:
commit 9c4eaa7b81a40d97fe49b85272b40bfeaaf44f86
Author: Muhammet Kara <muhammet.kara at pardus.org.tr>
Date: Sun Apr 15 12:33:03 2018 +0300
cppcheck: variableScope & unreadVariable
Change-Id: Iaa3adc54d547e243b977a562fa4dbc2b9b9c6592
Reviewed-on: https://gerrit.libreoffice.org/52905
Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>
Tested-by: Jenkins <ci at libreoffice.org>
Reviewed-by: Muhammet Kara <muhammet.kara at pardus.org.tr>
diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx
index 6e4d1cff8556..07c2226c8717 100644
--- a/desktop/source/lib/init.cxx
+++ b/desktop/source/lib/init.cxx
@@ -2841,7 +2841,6 @@ static char* getStyles(LibreOfficeKitDocument* pThis, const char* pCommand)
// Header & Footer Styles
{
OUString sName;
- bool bIsPhysical;
boost::property_tree::ptree aChild;
boost::property_tree::ptree aChildren;
const OUString sPageStyles("PageStyles");
@@ -2853,6 +2852,7 @@ static char* getStyles(LibreOfficeKitDocument* pThis, const char* pCommand)
uno::Sequence<OUString> aSeqNames = xContainer->getElementNames();
for (sal_Int32 itName = 0; itName < aSeqNames.getLength(); itName++)
{
+ bool bIsPhysical;
sName = aSeqNames[itName];
xProperty.set(xContainer->getByName(sName), uno::UNO_QUERY);
if (xProperty.is() && (xProperty->getPropertyValue("IsPhysical") >>= bIsPhysical) && bIsPhysical)
@@ -2861,8 +2861,6 @@ static char* getStyles(LibreOfficeKitDocument* pThis, const char* pCommand)
aChild.put("", sName.toUtf8());
aChildren.push_back(std::make_pair("", aChild));
}
- else
- bIsPhysical = false;
}
aValues.add_child("HeaderFooter", aChildren);
}
diff --git a/filter/source/graphicfilter/iras/iras.cxx b/filter/source/graphicfilter/iras/iras.cxx
index c0d7a6c7fb82..30e00d45f9e1 100644
--- a/filter/source/graphicfilter/iras/iras.cxx
+++ b/filter/source/graphicfilter/iras/iras.cxx
@@ -96,12 +96,13 @@ bool RASReader::ReadRAS(Graphic & rGraphic)
if ( !mbStatus )
return false;
- bool bPalette(false);
std::vector<Color> aPalette;
-
bool bOk = true;
+
if ( mnDstBitsPerPix <= 8 ) // pallets pictures
{
+ bool bPalette(false);
+
if ( mnColorMapType == RAS_COLOR_RAW_MAP ) // RAW color map is skipped
{
sal_uLong nCurPos = m_rRAS.Tell();
@@ -144,7 +145,6 @@ bool RASReader::ReadRAS(Graphic & rGraphic)
sal_uLong nCount = 255 - ( 255 * i / ( mnDstColors - 1 ) );
aPalette[i] = Color(static_cast<sal_uInt8>(nCount), static_cast<sal_uInt8>(nCount), static_cast<sal_uInt8>(nCount));
}
- bPalette = true;
}
}
else
diff --git a/sal/rtl/random.cxx b/sal/rtl/random.cxx
index 1046b7000069..158e8fff3cc5 100644
--- a/sal/rtl/random.cxx
+++ b/sal/rtl/random.cxx
@@ -234,12 +234,12 @@ static void readPool (
rtlRandomPool SAL_CALL rtl_random_createPool() SAL_THROW_EXTERN_C()
{
RandomPool_Impl *pImpl = nullptr;
- char sanity[4];
/* try to get system random number, if it fail fall back on own pool */
pImpl = static_cast< RandomPool_Impl* >(rtl_allocateZeroMemory(sizeof(RandomPool_Impl)));
if (pImpl)
{
+ char sanity[4];
if (!osl_get_system_random_data(sanity, 4))
{
if (!initPool(pImpl))
More information about the Libreoffice-commits
mailing list