diff options
author | Gökhan Gurbetoğlu <gokhan.gurbetoglu@pardus.org.tr> | 2018-04-16 17:07:24 +0300 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-04-19 12:17:25 +0200 |
commit | 07c29038d0ffb1cb62f47c61f3611b36eaf87f7c (patch) | |
tree | a2844681db90a3356f1b7c1fad6ff30430ac3b72 /oox | |
parent | 1cb700e9417224cadcf3e90b26eccaa3e2ce1156 (diff) |
cppcheck - fix variableScope in some files
Reduced the scope of some variables in source.
Change-Id: I705e7f2587fd81015f06fb301eb8d4a270668d73
Reviewed-on: https://gerrit.libreoffice.org/53042
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Gökhan Gurbetoğlu <gokhan.gurbetoglu@pardus.org.tr>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'oox')
-rw-r--r-- | oox/source/export/chartexport.cxx | 3 | ||||
-rw-r--r-- | oox/source/export/drawingml.cxx | 2 | ||||
-rw-r--r-- | oox/source/vml/vmlformatting.cxx | 6 |
3 files changed, 3 insertions, 8 deletions
diff --git a/oox/source/export/chartexport.cxx b/oox/source/export/chartexport.cxx index aad1c41ad8fe..bd91390d5f3c 100644 --- a/oox/source/export/chartexport.cxx +++ b/oox/source/export/chartexport.cxx @@ -2979,7 +2979,6 @@ void writeCustomLabel( const FSHelperPtr& pFS, ChartExport* pChartExport, pFS->singleElement(FSNS(XML_a, XML_bodyPr), FSEND); OUString sFieldType; - bool bNewParagraph; pFS->startElement(FSNS(XML_a, XML_p), FSEND); for (auto& rField : rCustomLabelFields) @@ -2987,7 +2986,7 @@ void writeCustomLabel( const FSHelperPtr& pFS, ChartExport* pChartExport, Reference<XPropertySet> xPropertySet(rField, UNO_QUERY); chart2::DataPointCustomLabelFieldType aType = rField->getFieldType(); sFieldType.clear(); - bNewParagraph = false; + bool bNewParagraph = false; if (aType == chart2::DataPointCustomLabelFieldType_NEWLINE) bNewParagraph = true; diff --git a/oox/source/export/drawingml.cxx b/oox/source/export/drawingml.cxx index e18c0ce93fd2..1c0be28fdaf9 100644 --- a/oox/source/export/drawingml.cxx +++ b/oox/source/export/drawingml.cxx @@ -1205,10 +1205,10 @@ void DrawingML::WritePattFill(const Reference<XPropertySet>& rXPropSet, const cs ::Color nColor = COL_WHITE; sal_Int32 nAlpha = 0; - bool isBackgroundFilled = false; if ( GetProperty( rXPropSet, "FillBackground" ) ) { + bool isBackgroundFilled = false; mAny >>= isBackgroundFilled; if( isBackgroundFilled ) { diff --git a/oox/source/vml/vmlformatting.cxx b/oox/source/vml/vmlformatting.cxx index 1e8c1318f832..17a730a2f8d8 100644 --- a/oox/source/vml/vmlformatting.cxx +++ b/oox/source/vml/vmlformatting.cxx @@ -960,7 +960,6 @@ void TextpathModel::pushToPropMap(ShapePropertyMap& rPropMap, const uno::Referen if (!moTrim.has() || !moTrim.get()) { OUString sText = moString.get(); - double fRatio = 0; VclPtr<VirtualDevice> pDevice = VclPtr<VirtualDevice>::Create(); vcl::Font aFont = pDevice->GetFont(); aFont.SetFamilyName(sFont); @@ -970,10 +969,7 @@ void TextpathModel::pushToPropMap(ShapePropertyMap& rPropMap, const uno::Referen auto nTextWidth = pDevice->GetTextWidth(sText); if (nTextWidth) { - fRatio = pDevice->GetTextHeight(); - fRatio /= nTextWidth; - - sal_Int32 nNewHeight = fRatio * xShape->getSize().Width; + sal_Int32 nNewHeight = (static_cast<double>(pDevice->GetTextHeight()) / nTextWidth) * xShape->getSize().Width; xShape->setSize(awt::Size(xShape->getSize().Width, nNewHeight)); } } |