summaryrefslogtreecommitdiff
path: root/reportdesign
diff options
context:
space:
mode:
authorNoel <noelgrandin@gmail.com>2020-10-02 13:37:17 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2020-10-04 14:07:15 +0200
commitd06fe13f234e6b13c15da07ceed9d50c3c0675fa (patch)
tree2783c0dd2e146fc8895bcd285149cf5c426da728 /reportdesign
parent05082326bed3aac6fe3c902a21e854fcb9813d7c (diff)
loplugin:reducevarscope in reportdesign
Change-Id: Id77ea5524570654c36aa50a0e55c02b5a2a20876 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/103838 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'reportdesign')
-rw-r--r--reportdesign/source/filter/xml/xmlExport.cxx2
-rw-r--r--reportdesign/source/ui/inspection/DefaultInspection.cxx2
-rw-r--r--reportdesign/source/ui/inspection/GeometryHandler.cxx2
-rw-r--r--reportdesign/source/ui/report/FormattedFieldBeautifier.cxx4
-rw-r--r--reportdesign/source/ui/report/ReportController.cxx2
5 files changed, 5 insertions, 7 deletions
diff --git a/reportdesign/source/filter/xml/xmlExport.cxx b/reportdesign/source/filter/xml/xmlExport.cxx
index e692bf76724f..af5e3222d57d 100644
--- a/reportdesign/source/filter/xml/xmlExport.cxx
+++ b/reportdesign/source/filter/xml/xmlExport.cxx
@@ -691,7 +691,6 @@ void ORptExport::exportReportComponentAutoStyles(const Reference<XSection>& _xPr
void ORptExport::exportSection(const Reference<XSection>& _xSection,bool bHeader)
{
OSL_ENSURE(_xSection.is(),"Section is NULL -> GPF");
- OUStringBuffer sValue;
AddAttribute(XML_NAMESPACE_TABLE, XML_NAME,_xSection->getName());
if ( !_xSection->getVisible() )
@@ -699,6 +698,7 @@ void ORptExport::exportSection(const Reference<XSection>& _xSection,bool bHeader
if ( !bHeader )
{
+ OUStringBuffer sValue;
sal_Int16 nRet = _xSection->getForceNewPage();
const SvXMLEnumMapEntry<sal_Int16>* aXML_EnumMap = OXMLHelper::GetForceNewPageOptions();
if ( SvXMLUnitConverter::convertEnum( sValue, nRet,aXML_EnumMap ) )
diff --git a/reportdesign/source/ui/inspection/DefaultInspection.cxx b/reportdesign/source/ui/inspection/DefaultInspection.cxx
index 5ab49d95ae01..91b8921e08f5 100644
--- a/reportdesign/source/ui/inspection/DefaultInspection.cxx
+++ b/reportdesign/source/ui/inspection/DefaultInspection.cxx
@@ -129,9 +129,9 @@ namespace rptui
return;
}
- sal_Int32 nMinHelpTextLines( 0 ), nMaxHelpTextLines( 0 );
if ( _arguments.getLength() == 2 )
{ // constructor: "createWithHelpSection( long, long )"
+ sal_Int32 nMinHelpTextLines( 0 ), nMaxHelpTextLines( 0 );
if ( !( _arguments[0] >>= nMinHelpTextLines ) || !( _arguments[1] >>= nMaxHelpTextLines ) )
throw lang::IllegalArgumentException( OUString(), *this, 0 );
createWithHelpSection( nMinHelpTextLines, nMaxHelpTextLines );
diff --git a/reportdesign/source/ui/inspection/GeometryHandler.cxx b/reportdesign/source/ui/inspection/GeometryHandler.cxx
index e9dd9325fbe4..606d9af18bd5 100644
--- a/reportdesign/source/ui/inspection/GeometryHandler.cxx
+++ b/reportdesign/source/ui/inspection/GeometryHandler.cxx
@@ -498,7 +498,6 @@ void SAL_CALL GeometryHandler::setPropertyValue(const OUString & PropertyName, c
}
else if ( m_nDataFieldType == USER_DEF_FUNCTION )
{
- OUString sDataField;
OBlocker aBlocker(m_bIn);
const sal_uInt32 nNewDataType = impl_getDataFieldType_throw(sFunction);
if ( nNewDataType != UNDEF_DATA && nNewDataType != m_nDataFieldType )
@@ -513,6 +512,7 @@ void SAL_CALL GeometryHandler::setPropertyValue(const OUString & PropertyName, c
else
{
OUString sNamePostfix;
+ OUString sDataField;
const uno::Reference< report::XFunctionsSupplier> xFunctionsSupplier = fillScope_throw(sNamePostfix);
isDefaultFunction(sFunction,sDataField,xFunctionsSupplier,true);
}
diff --git a/reportdesign/source/ui/report/FormattedFieldBeautifier.cxx b/reportdesign/source/ui/report/FormattedFieldBeautifier.cxx
index 6ebc21915ccd..9ff564ca4d3d 100644
--- a/reportdesign/source/ui/report/FormattedFieldBeautifier.cxx
+++ b/reportdesign/source/ui/report/FormattedFieldBeautifier.cxx
@@ -66,14 +66,12 @@ namespace rptui
void FormattedFieldBeautifier::setPlaceholderText( const uno::Reference< uno::XInterface >& _rxComponent )
{
- OUString sDataField;
-
try
{
uno::Reference< report::XFormattedField > xControlModel( _rxComponent, uno::UNO_QUERY );
if ( xControlModel.is() )
{
- sDataField = xControlModel->getDataField();
+ OUString sDataField = xControlModel->getDataField();
if ( !sDataField.isEmpty() )
{
diff --git a/reportdesign/source/ui/report/ReportController.cxx b/reportdesign/source/ui/report/ReportController.cxx
index f6509cd3beaf..0c2ba10ea590 100644
--- a/reportdesign/source/ui/report/ReportController.cxx
+++ b/reportdesign/source/ui/report/ReportController.cxx
@@ -3995,7 +3995,6 @@ void OReportController::checkChartEnabled()
return;
m_bChartEnabledAsked = true;
- const OUString sPropertyName( "UserData/Chart" );
try
{
@@ -4003,6 +4002,7 @@ void OReportController::checkChartEnabled()
::utl::OConfigurationTreeRoot::createWithComponentContext( m_xContext, "/org.openoffice.Office.ReportDesign" ) );
bool bChartEnabled = false;
+ const OUString sPropertyName( "UserData/Chart" );
if ( aConfiguration.hasByHierarchicalName(sPropertyName) )
aConfiguration.getNodeValue( sPropertyName ) >>= bChartEnabled;
m_bChartEnabled = bChartEnabled;