diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2021-12-21 20:22:48 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2021-12-22 07:43:35 +0100 |
commit | 494b3e69fd4bef0af19627cf31da98da376019d0 (patch) | |
tree | f0c9f434cfcc5775c45c79e8dba93453ec0ac8d0 /reportdesign/source/ui/report/ReportController.cxx | |
parent | 968b64d054eb164cee9fb92b6bf7dd93f478bf24 (diff) |
loplugin:flatten in package..reportdesign
Change-Id: I2da242fcb59709ebdd0819ec04d051d794da71e9
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/127277
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'reportdesign/source/ui/report/ReportController.cxx')
-rw-r--r-- | reportdesign/source/ui/report/ReportController.cxx | 46 |
1 files changed, 23 insertions, 23 deletions
diff --git a/reportdesign/source/ui/report/ReportController.cxx b/reportdesign/source/ui/report/ReportController.cxx index af893f91d253..d81d100bc129 100644 --- a/reportdesign/source/ui/report/ReportController.cxx +++ b/reportdesign/source/ui/report/ReportController.cxx @@ -3023,38 +3023,38 @@ void OReportController::insertGraphic() sal_Bool SAL_CALL OReportController::select( const Any& aSelection ) { ::osl::MutexGuard aGuard( getMutex() ); - if ( getDesignView() ) - { - getDesignView()->unmarkAllObjects(); - getDesignView()->SetMode(DlgEdMode::Select); + if ( !getDesignView() ) + return true; - uno::Sequence< uno::Reference<report::XReportComponent> > aElements; - if ( aSelection >>= aElements ) + getDesignView()->unmarkAllObjects(); + getDesignView()->SetMode(DlgEdMode::Select); + + uno::Sequence< uno::Reference<report::XReportComponent> > aElements; + if ( aSelection >>= aElements ) + { + if ( aElements.hasElements() ) + getDesignView()->showProperties(uno::Reference<uno::XInterface>(aElements[0],uno::UNO_QUERY)); + getDesignView()->setMarked(aElements, true); + } + else + { + uno::Reference<uno::XInterface> xObject(aSelection,uno::UNO_QUERY); + uno::Reference<report::XReportComponent> xProp(xObject,uno::UNO_QUERY); + if ( xProp.is() ) { - if ( aElements.hasElements() ) - getDesignView()->showProperties(uno::Reference<uno::XInterface>(aElements[0],uno::UNO_QUERY)); + getDesignView()->showProperties(xObject); + aElements = { xProp }; getDesignView()->setMarked(aElements, true); } else { - uno::Reference<uno::XInterface> xObject(aSelection,uno::UNO_QUERY); - uno::Reference<report::XReportComponent> xProp(xObject,uno::UNO_QUERY); - if ( xProp.is() ) - { + uno::Reference<report::XSection> xSection(aSelection,uno::UNO_QUERY); + if ( !xSection.is() && xObject.is() ) getDesignView()->showProperties(xObject); - aElements = { xProp }; - getDesignView()->setMarked(aElements, true); - } - else - { - uno::Reference<report::XSection> xSection(aSelection,uno::UNO_QUERY); - if ( !xSection.is() && xObject.is() ) - getDesignView()->showProperties(xObject); - getDesignView()->setMarked(xSection,xSection.is()); - } + getDesignView()->setMarked(xSection,xSection.is()); } - InvalidateAll(); } + InvalidateAll(); return true; } |