diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2019-11-30 16:00:37 +0100 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2019-11-30 16:44:47 +0100 |
commit | 6ddefb080b12f54f84a8de44347a9b1816972ad3 (patch) | |
tree | 48a7377f65b6ec0d0789b6a4e9903c367dad726a | |
parent | 3566bf146e5ad329432b48351d14b012cb5ea538 (diff) |
Let getPageViewOutputDevice return const OutputDevice*
...instead of boost::optional<const OutputDevice&> (in preparation for replacing
boost::optional with std::optional, which doesn't support references types as
template arguments)
Change-Id: I02d2b617123cfa9ca0d6436c8a4104c5987f4eb5
Reviewed-on: https://gerrit.libreoffice.org/84121
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
4 files changed, 10 insertions, 11 deletions
diff --git a/include/svx/sdr/contact/viewobjectcontactofsdrobj.hxx b/include/svx/sdr/contact/viewobjectcontactofsdrobj.hxx index cb7773c716f3..44296b96cf1c 100644 --- a/include/svx/sdr/contact/viewobjectcontactofsdrobj.hxx +++ b/include/svx/sdr/contact/viewobjectcontactofsdrobj.hxx @@ -21,7 +21,6 @@ #define INCLUDED_SVX_SDR_CONTACT_VIEWOBJECTCONTACTOFSDROBJ_HXX #include <svx/sdr/contact/viewobjectcontact.hxx> -#include <boost/optional.hpp> class SdrObject; class SdrLayerIDSet; @@ -56,7 +55,7 @@ public: This method cares for this, by retrieving the very original OutputDevice. */ - boost::optional<const OutputDevice&> getPageViewOutputDevice() const; + const OutputDevice* getPageViewOutputDevice() const; }; }} diff --git a/svx/source/sdr/contact/viewobjectcontactofsdrmediaobj.cxx b/svx/source/sdr/contact/viewobjectcontactofsdrmediaobj.cxx index 42e7a6a22675..23684f55901c 100644 --- a/svx/source/sdr/contact/viewobjectcontactofsdrmediaobj.cxx +++ b/svx/source/sdr/contact/viewobjectcontactofsdrmediaobj.cxx @@ -60,12 +60,12 @@ vcl::Window* ViewObjectContactOfSdrMediaObj::getWindow() const { vcl::Window* pRetval = nullptr; - boost::optional<const OutputDevice&> oPageOutputDev = getPageViewOutputDevice(); + const OutputDevice* oPageOutputDev = getPageViewOutputDevice(); if( oPageOutputDev ) { if(OUTDEV_WINDOW == oPageOutputDev->GetOutDevType()) { - pRetval = static_cast< vcl::Window* >(&const_cast<OutputDevice&>(oPageOutputDev.get())); + pRetval = static_cast< vcl::Window* >(&const_cast<OutputDevice&>(*oPageOutputDev)); } } diff --git a/svx/source/sdr/contact/viewobjectcontactofsdrobj.cxx b/svx/source/sdr/contact/viewobjectcontactofsdrobj.cxx index 5a614187e484..d21fddcb14b6 100644 --- a/svx/source/sdr/contact/viewobjectcontactofsdrobj.cxx +++ b/svx/source/sdr/contact/viewobjectcontactofsdrobj.cxx @@ -171,7 +171,7 @@ bool ViewObjectContactOfSdrObj::isPrimitiveVisible(const DisplayInfo& rDisplayIn return true; } -boost::optional<const OutputDevice&> ViewObjectContactOfSdrObj::getPageViewOutputDevice() const +const OutputDevice* ViewObjectContactOfSdrObj::getPageViewOutputDevice() const { ObjectContactOfPageView* pPageViewContact = dynamic_cast< ObjectContactOfPageView* >( &GetObjectContact() ); if ( pPageViewContact ) @@ -182,11 +182,11 @@ boost::optional<const OutputDevice&> ViewObjectContactOfSdrObj::getPageViewOutpu // #i72429# / 2007-02-20 / frank.schoenheit (at) sun.com SdrPageWindow& rPageWindow( pPageViewContact->GetPageWindow() ); if ( rPageWindow.GetOriginalPaintWindow() ) - return rPageWindow.GetOriginalPaintWindow()->GetOutputDevice(); + return &rPageWindow.GetOriginalPaintWindow()->GetOutputDevice(); - return rPageWindow.GetPaintWindow().GetOutputDevice(); + return &rPageWindow.GetPaintWindow().GetOutputDevice(); } - return boost::optional<const OutputDevice&>(); + return nullptr; } }} diff --git a/svx/source/sdr/contact/viewobjectcontactofunocontrol.cxx b/svx/source/sdr/contact/viewobjectcontactofunocontrol.cxx index adedad499f22..f4703d348adb 100644 --- a/svx/source/sdr/contact/viewobjectcontactofunocontrol.cxx +++ b/svx/source/sdr/contact/viewobjectcontactofunocontrol.cxx @@ -962,7 +962,7 @@ namespace sdr { namespace contact { if ( pPageViewContact ) { SdrPageViewAccess aPVAccess( pPageViewContact->GetPageWindow().GetPageView() ); - const OutputDevice& rDevice( m_pAntiImpl->getPageViewOutputDevice().get() ); + const OutputDevice& rDevice( *m_pAntiImpl->getPageViewOutputDevice() ); impl_ensureControl_nothrow( aPVAccess, rDevice, @@ -985,9 +985,9 @@ namespace sdr { namespace contact { { // do not use ObjectContact::TryToGetOutputDevice, it would not care for the PageWindow's // OriginalPaintWindow - boost::optional<const OutputDevice&> oPageOutputDev = m_pAntiImpl->getPageViewOutputDevice(); + const OutputDevice* oPageOutputDev = m_pAntiImpl->getPageViewOutputDevice(); if( oPageOutputDev ) - return oPageOutputDev.get(); + return *oPageOutputDev; const OutputDevice* pDevice = m_pAntiImpl->GetObjectContact().TryToGetOutputDevice(); ENSURE_OR_THROW( pDevice, "no output device -> no control" ); |