summaryrefslogtreecommitdiff
path: root/reportdesign
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2017-06-25 18:20:04 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2017-06-26 08:56:47 +0200
commit979c8c56b7d52fe9a5d4b1fbfdab0adaba04c470 (patch)
treede5942b227fb6f441e1f36878a030a1b13601ba0 /reportdesign
parentc2d139d8fa92e44baf592cd8ce644dc66356e143 (diff)
loplugin:oncevar in oox..sax
Change-Id: I0fee8bcddaeea48335e3be05761d2ad2c45020e2 Reviewed-on: https://gerrit.libreoffice.org/39238 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'reportdesign')
-rw-r--r--reportdesign/source/core/api/ReportDefinition.cxx12
-rw-r--r--reportdesign/source/core/api/ReportEngineJFree.cxx5
-rw-r--r--reportdesign/source/core/misc/reportformula.cxx4
-rw-r--r--reportdesign/source/ui/dlg/Navigator.cxx3
-rw-r--r--reportdesign/source/ui/report/ReportController.cxx3
-rw-r--r--reportdesign/source/ui/report/dlgedfunc.cxx3
6 files changed, 9 insertions, 21 deletions
diff --git a/reportdesign/source/core/api/ReportDefinition.cxx b/reportdesign/source/core/api/ReportDefinition.cxx
index eeb651da8a0f..ecdc92676273 100644
--- a/reportdesign/source/core/api/ReportDefinition.cxx
+++ b/reportdesign/source/core/api/ReportDefinition.cxx
@@ -1398,13 +1398,10 @@ void SAL_CALL OReportDefinition::storeToStorage( const uno::Reference< embed::XS
}
if ( aImage.hasValue() )
{
- OUString sObject1("report");
- OUString sPng("image/png");
-
uno::Sequence<sal_Int8> aSeq;
aImage >>= aSeq;
uno::Reference<io::XInputStream> xStream = new ::comphelper::SequenceInputStream( aSeq );
- m_pImpl->m_pObjectContainer->InsertGraphicStreamDirectly(xStream,sObject1,sPng);
+ m_pImpl->m_pObjectContainer->InsertGraphicStreamDirectly(xStream, "report", "image/png");
}
if ( !bErr )
@@ -1508,9 +1505,7 @@ bool OReportDefinition::WriteThroughComponent(
xSeek->seek(0);
}
- OUString aPropName("MediaType");
- OUString aMime("text/xml");
- xStreamProp->setPropertyValue( aPropName, uno::Any(aMime) );
+ xStreamProp->setPropertyValue( "MediaType", uno::Any(OUString("text/xml")) );
// encrypt all streams
xStreamProp->setPropertyValue( "UseCommonStoragePasswordEncryption",
@@ -1707,9 +1702,8 @@ embed::VisualRepresentation SAL_CALL OReportDefinition::getPreferredVisualRepres
::osl::MutexGuard aGuard(m_aMutex);
::connectivity::checkDisposed(ReportDefinitionBase::rBHelper.bDisposed);
embed::VisualRepresentation aResult;
- OUString sImageName("report");
OUString sMimeType;
- uno::Reference<io::XInputStream> xStream = m_pImpl->m_pObjectContainer->GetGraphicStream(sImageName,&sMimeType);
+ uno::Reference<io::XInputStream> xStream = m_pImpl->m_pObjectContainer->GetGraphicStream("report", &sMimeType);
if ( xStream.is() )
{
uno::Sequence<sal_Int8> aSeq;
diff --git a/reportdesign/source/core/api/ReportEngineJFree.cxx b/reportdesign/source/core/api/ReportEngineJFree.cxx
index 37d20bd89c15..9c04a42119f7 100644
--- a/reportdesign/source/core/api/ReportEngineJFree.cxx
+++ b/reportdesign/source/core/api/ReportEngineJFree.cxx
@@ -285,9 +285,8 @@ uno::Reference< frame::XModel > SAL_CALL OReportEngineJFree::createDocumentAlive
{
// if there is no frame given, find the right
xFrameLoad.set( frame::Desktop::create(m_xContext), uno::UNO_QUERY);
- OUString sTarget("_blank");
- sal_Int32 nFrameSearchFlag = frame::FrameSearchFlag::TASKS | frame::FrameSearchFlag::CREATE;
- uno::Reference< frame::XFrame> xFrame = uno::Reference< frame::XFrame>(xFrameLoad,uno::UNO_QUERY)->findFrame(sTarget,nFrameSearchFlag);
+ sal_Int32 const nFrameSearchFlag = frame::FrameSearchFlag::TASKS | frame::FrameSearchFlag::CREATE;
+ uno::Reference< frame::XFrame> xFrame = uno::Reference< frame::XFrame>(xFrameLoad,uno::UNO_QUERY)->findFrame("_blank",nFrameSearchFlag);
xFrameLoad.set( xFrame,uno::UNO_QUERY);
}
diff --git a/reportdesign/source/core/misc/reportformula.cxx b/reportdesign/source/core/misc/reportformula.cxx
index bdecbc69cd46..cbea9f8ad459 100644
--- a/reportdesign/source/core/misc/reportformula.cxx
+++ b/reportdesign/source/core/misc/reportformula.cxx
@@ -83,11 +83,9 @@ namespace rptui
m_sCompleteFormula = _rFormula;
// is it an ordinary expression?
- if ( m_sCompleteFormula.startsWith( sExpressionPrefix ) )
+ if ( m_sCompleteFormula.startsWith( sExpressionPrefix, &m_sUndecoratedContent ) )
{
- sal_Int32 nPrefixLen = strlen(sExpressionPrefix);
m_eType = Expression;
- m_sUndecoratedContent = m_sCompleteFormula.copy( nPrefixLen );
return;
}
diff --git a/reportdesign/source/ui/dlg/Navigator.cxx b/reportdesign/source/ui/dlg/Navigator.cxx
index 2fc0ec31f3b6..4d1b2d745925 100644
--- a/reportdesign/source/ui/dlg/Navigator.cxx
+++ b/reportdesign/source/ui/dlg/Navigator.cxx
@@ -373,7 +373,6 @@ void NavigatorTree::Command( const CommandEvent& rEvt )
sal_Int8 NavigatorTree::AcceptDrop( const AcceptDropEvent& _rEvt )
{
- sal_Int8 nDropOption = DND_ACTION_NONE;
::Point aDropPos = _rEvt.maPosPixel;
if (_rEvt.mbLeaving)
{
@@ -421,7 +420,7 @@ sal_Int8 NavigatorTree::AcceptDrop( const AcceptDropEvent& _rEvt )
m_aDropActionTimer.Stop();
}
- return nDropOption;
+ return DND_ACTION_NONE;
}
sal_Int8 NavigatorTree::ExecuteDrop( const ExecuteDropEvent& /*_rEvt*/ )
diff --git a/reportdesign/source/ui/report/ReportController.cxx b/reportdesign/source/ui/report/ReportController.cxx
index f813e8f55c08..41cf6fc02472 100644
--- a/reportdesign/source/ui/report/ReportController.cxx
+++ b/reportdesign/source/ui/report/ReportController.cxx
@@ -3020,7 +3020,6 @@ void OReportController::insertGraphic()
sal_Bool SAL_CALL OReportController::select( const Any& aSelection )
{
::osl::MutexGuard aGuard( getMutex() );
- bool bRet = true;
if ( getDesignView() )
{
getDesignView()->unmarkAllObjects();
@@ -3054,7 +3053,7 @@ sal_Bool SAL_CALL OReportController::select( const Any& aSelection )
}
InvalidateAll();
}
- return bRet;
+ return true;
}
Any SAL_CALL OReportController::getSelection( )
diff --git a/reportdesign/source/ui/report/dlgedfunc.cxx b/reportdesign/source/ui/report/dlgedfunc.cxx
index a513fab6efe1..98f4ae2857da 100644
--- a/reportdesign/source/ui/report/dlgedfunc.cxx
+++ b/reportdesign/source/ui/report/dlgedfunc.cxx
@@ -218,9 +218,8 @@ bool DlgEdFunc::MouseButtonDown( const MouseEvent& rMEvt )
bool DlgEdFunc::MouseButtonUp( const MouseEvent& /*rMEvt*/ )
{
- bool bHandled = false;
m_pParent->getSectionWindow()->getViewsWindow()->stopScrollTimer();
- return bHandled;
+ return false;
}
void DlgEdFunc::checkTwoCklicks(const MouseEvent& rMEvt)