diff options
author | Maxim Monastirsky <momonasmon@gmail.com> | 2017-02-23 09:43:24 +0200 |
---|---|---|
committer | Maxim Monastirsky <momonasmon@gmail.com> | 2017-02-24 01:28:21 +0200 |
commit | 89c05973ff57eea1bc6c9cdc9e7dc13796e7d339 (patch) | |
tree | d3914026092241c93b9c2088c6c1b739b9a15526 /vcl | |
parent | a8538f0774bd0fabf6012d735d1e86b3ff1c291f (diff) |
Remove the intermediate xModel variables
And make sure to check for a nullptr xController
in GetBitmapForCommand.
Change-Id: Ib62bc06d0708847cfec54a71209cf68a4c32a50d
Diffstat (limited to 'vcl')
-rw-r--r-- | vcl/source/helper/commandinfoprovider.cxx | 22 |
1 files changed, 8 insertions, 14 deletions
diff --git a/vcl/source/helper/commandinfoprovider.cxx b/vcl/source/helper/commandinfoprovider.cxx index 755d41ff0dc2..931900ad2abe 100644 --- a/vcl/source/helper/commandinfoprovider.cxx +++ b/vcl/source/helper/commandinfoprovider.cxx @@ -85,18 +85,14 @@ Reference<ui::XAcceleratorConfiguration> const GetDocumentAcceleratorConfigurati Reference<frame::XController> xController = rxFrame->getController(); if (xController.is()) { - Reference<frame::XModel> xModel (xController->getModel()); - if (xModel.is()) + Reference<ui::XUIConfigurationManagerSupplier> xSupplier(xController->getModel(), UNO_QUERY); + if (xSupplier.is()) { - Reference<ui::XUIConfigurationManagerSupplier> xSupplier (xModel, UNO_QUERY); - if (xSupplier.is()) + Reference<ui::XUIConfigurationManager> xConfigurationManager( + xSupplier->getUIConfigurationManager()); + if (xConfigurationManager.is()) { - Reference<ui::XUIConfigurationManager> xConfigurationManager( - xSupplier->getUIConfigurationManager()); - if (xConfigurationManager.is()) - { - return xConfigurationManager->getShortCutManager(); - } + return xConfigurationManager->getShortCutManager(); } } } @@ -314,10 +310,8 @@ BitmapEx GetBitmapForCommand(const OUString& rsCommandName, try { - Reference<frame::XController> xController(rxFrame->getController()); - Reference<frame::XModel> xModel(xController->getModel()); - - Reference<ui::XUIConfigurationManagerSupplier> xSupplier(xModel, UNO_QUERY); + Reference<frame::XController> xController(rxFrame->getController(), UNO_SET_THROW); + Reference<ui::XUIConfigurationManagerSupplier> xSupplier(xController->getModel(), UNO_QUERY); if (xSupplier.is()) { Reference<ui::XUIConfigurationManager> xDocUICfgMgr(xSupplier->getUIConfigurationManager()); |