summaryrefslogtreecommitdiff
path: root/xmloff/source/text
diff options
context:
space:
mode:
authorMichael Weghorn <m.weghorn@posteo.de>2015-01-17 02:00:35 +0100
committerNoel Grandin <noelgrandin@gmail.com>2015-01-19 08:39:32 +0000
commitbfe79b50bce44707cb2416e6ff6b7441491967bb (patch)
treebc439d804193c01baa2f78bdf794169e912bf749 /xmloff/source/text
parent08f9bd504de9bcb267a0e71b07759080592bd0d8 (diff)
fdo#39440 reduce scope of local variables
This addresses some cppcheck warnings. Change-Id: If7ad3584b3124ed0b337836071af1a5bd0451d85 Reviewed-on: https://gerrit.libreoffice.org/13972 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
Diffstat (limited to 'xmloff/source/text')
-rw-r--r--xmloff/source/text/XMLRedlineExport.cxx3
-rw-r--r--xmloff/source/text/XMLTextNumRuleInfo.cxx2
-rw-r--r--xmloff/source/text/txtimp.cxx3
3 files changed, 3 insertions, 5 deletions
diff --git a/xmloff/source/text/XMLRedlineExport.cxx b/xmloff/source/text/XMLRedlineExport.cxx
index 5aabd59fb25b..fa93ac9441d7 100644
--- a/xmloff/source/text/XMLRedlineExport.cxx
+++ b/xmloff/source/text/XMLRedlineExport.cxx
@@ -332,7 +332,6 @@ void XMLRedlineExport::ExportChangeInline(
enum XMLTokenEnum eElement = XML_TOKEN_INVALID;
Any aAny = rPropSet->getPropertyValue(sIsCollapsed);
bool bCollapsed = *(sal_Bool *)aAny.getValue();
- bool bStart = true; // ignored if bCollapsed = sal_True
if (bCollapsed)
{
eElement = XML_CHANGE;
@@ -340,7 +339,7 @@ void XMLRedlineExport::ExportChangeInline(
else
{
aAny = rPropSet->getPropertyValue(sIsStart);
- bStart = *(sal_Bool *)aAny.getValue();
+ const bool bStart = *(sal_Bool *)aAny.getValue();
eElement = bStart ? XML_CHANGE_START : XML_CHANGE_END;
}
diff --git a/xmloff/source/text/XMLTextNumRuleInfo.cxx b/xmloff/source/text/XMLTextNumRuleInfo.cxx
index 02fde000dc22..cb597daf167f 100644
--- a/xmloff/source/text/XMLTextNumRuleInfo.cxx
+++ b/xmloff/source/text/XMLTextNumRuleInfo.cxx
@@ -115,12 +115,12 @@ void XMLTextNumRuleInfo::Set(
{
if ( !mbOutlineStyleAsNormalListStyle )
{
- bool bIsOutline = false;
Reference<XPropertySet> xNumRulesProps(mxNumRules, UNO_QUERY);
if ( xNumRulesProps.is() &&
xNumRulesProps->getPropertySetInfo()->
hasPropertyByName( msNumberingIsOutline ) )
{
+ bool bIsOutline = false;
xNumRulesProps->getPropertyValue( msNumberingIsOutline ) >>= bIsOutline;
bSuppressListStyle = bIsOutline;
}
diff --git a/xmloff/source/text/txtimp.cxx b/xmloff/source/text/txtimp.cxx
index a7e781bcbc47..7be24938e296 100644
--- a/xmloff/source/text/txtimp.cxx
+++ b/xmloff/source/text/txtimp.cxx
@@ -2114,14 +2114,13 @@ void XMLTextImportHelper::SetRuby(
xPropSet->setPropertyValue(sRubyText, makeAny(rText));
// the ruby style (ruby-adjust)
- XMLPropStyleContext *pStyle = 0;
if (!rStyleName.isEmpty() && m_pImpl->m_xAutoStyles.Is())
{
const SvXMLStyleContext* pTempStyle =
static_cast<SvXMLStylesContext *>(&m_pImpl->m_xAutoStyles)->
FindStyleChildContext( XML_STYLE_FAMILY_TEXT_RUBY,
rStyleName, true );
- pStyle = const_cast<XMLPropStyleContext*>(PTR_CAST(XMLPropStyleContext,pTempStyle));
+ XMLPropStyleContext *pStyle = const_cast<XMLPropStyleContext*>(PTR_CAST(XMLPropStyleContext,pTempStyle));
if (NULL != pStyle)
pStyle->FillPropertySet( xPropSet );