summaryrefslogtreecommitdiff
path: root/xmloff
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2016-05-26 15:28:05 +0100
committerCaolán McNamara <caolanm@redhat.com>2016-05-26 17:07:18 +0100
commitefe57384953c2a9eeb5f8fd65c2d548759ef05f7 (patch)
tree87f9c6880c59398978c30a185fb15ea174c66130 /xmloff
parent5784ba5ffed88c4fa5da0ac6d06fd2e70a8456c1 (diff)
cppcheck: variable scope
Change-Id: I27ab82d32df984a86af1a2abda491581bff70a2c
Diffstat (limited to 'xmloff')
-rw-r--r--xmloff/source/forms/elementexport.cxx13
-rw-r--r--xmloff/source/text/XMLIndexBibliographyConfigurationContext.cxx7
2 files changed, 11 insertions, 9 deletions
diff --git a/xmloff/source/forms/elementexport.cxx b/xmloff/source/forms/elementexport.cxx
index b80d7b0bb2c6..688c6e8427fb 100644
--- a/xmloff/source/forms/elementexport.cxx
+++ b/xmloff/source/forms/elementexport.cxx
@@ -778,31 +778,34 @@ namespace xmloff
// get the property names
getValuePropertyNames(m_eType, m_nClassId, pCurrentValuePropertyName, pValuePropertyName);
- static const sal_Char* pCurrentValueAttributeName = OAttributeMetaData::getCommonControlAttributeName(CCAFlags::CurrentValue);
- static const sal_Char* pValueAttributeName = OAttributeMetaData::getCommonControlAttributeName(CCAFlags::Value);
- static const sal_uInt16 nCurrentValueAttributeNamespaceKey = OAttributeMetaData::getCommonControlAttributeNamespace(CCAFlags::CurrentValue);
- static const sal_uInt16 nValueAttributeNamespaceKey = OAttributeMetaData::getCommonControlAttributeNamespace(CCAFlags::Value);
-
// add the attributes if necessary and possible
if (pCurrentValuePropertyName && (CCAFlags::CurrentValue & m_nIncludeCommon))
{
+ static const sal_Char* pCurrentValueAttributeName = OAttributeMetaData::getCommonControlAttributeName(CCAFlags::CurrentValue);
// don't export the current-value if this value originates from a data binding
// #i26944#
if ( controlHasActiveDataBinding() )
exportedProperty( OUString::createFromAscii( pCurrentValuePropertyName ) );
else
+ {
+ static const sal_uInt16 nCurrentValueAttributeNamespaceKey = OAttributeMetaData::getCommonControlAttributeNamespace(CCAFlags::CurrentValue);
exportGenericPropertyAttribute(
nCurrentValueAttributeNamespaceKey,
pCurrentValueAttributeName,
pCurrentValuePropertyName
);
+ }
}
if (pValuePropertyName && (CCAFlags::Value & m_nIncludeCommon))
+ {
+ static const sal_Char* pValueAttributeName = OAttributeMetaData::getCommonControlAttributeName(CCAFlags::Value);
+ static const sal_uInt16 nValueAttributeNamespaceKey = OAttributeMetaData::getCommonControlAttributeNamespace(CCAFlags::Value);
exportGenericPropertyAttribute(
nValueAttributeNamespaceKey,
pValueAttributeName,
pValuePropertyName);
+ }
OSL_ENSURE((nullptr == pValuePropertyName) == (CCAFlags::NONE == (CCAFlags::Value & m_nIncludeCommon)),
"OControlExport::exportCommonControlAttributes: no property found for the value attribute!");
diff --git a/xmloff/source/text/XMLIndexBibliographyConfigurationContext.cxx b/xmloff/source/text/XMLIndexBibliographyConfigurationContext.cxx
index 8e961ea92606..30d2dd4a924a 100644
--- a/xmloff/source/text/XMLIndexBibliographyConfigurationContext.cxx
+++ b/xmloff/source/text/XMLIndexBibliographyConfigurationContext.cxx
@@ -151,19 +151,18 @@ void XMLIndexBibliographyConfigurationContext::ProcessAttribute(
}
}
-
SvXMLImportContext *XMLIndexBibliographyConfigurationContext::CreateChildContext(
sal_uInt16 nPrefix,
const OUString& rLocalName,
const Reference<XAttributeList> & xAttrList )
{
- OUString sKey;
- bool bSort(true);
-
// process children here and use default context!
if ( ( nPrefix == XML_NAMESPACE_TEXT ) &&
IsXMLToken( rLocalName, XML_SORT_KEY ) )
{
+ OUString sKey;
+ bool bSort(true);
+
sal_Int16 nLength = xAttrList->getLength();
for(sal_Int16 nAttr = 0; nAttr < nLength; nAttr++)
{