diff options
author | Kohei Yoshida <kohei.yoshida@collabora.com> | 2014-11-01 13:21:08 -0400 |
---|---|---|
committer | Kohei Yoshida <kohei.yoshida@collabora.com> | 2014-11-01 13:21:43 -0400 |
commit | 0cada896f09d9e6b9a2c7ac04317a3a9cc6c0a7c (patch) | |
tree | da48da8c530917cddc57e7cfa620d8095222c81f /svx/source/sdr/contact | |
parent | c75466ac88a47859227efc635fa1fcd5edd0a277 (diff) |
Unindent.
Change-Id: I0e86d04c0fa6185b41d5751d28a7e3f3b86af371
Diffstat (limited to 'svx/source/sdr/contact')
-rw-r--r-- | svx/source/sdr/contact/viewobjectcontactofsdrobj.cxx | 214 |
1 files changed, 105 insertions, 109 deletions
diff --git a/svx/source/sdr/contact/viewobjectcontactofsdrobj.cxx b/svx/source/sdr/contact/viewobjectcontactofsdrobj.cxx index d61bc3eca35f..2273f4b434e2 100644 --- a/svx/source/sdr/contact/viewobjectcontactofsdrobj.cxx +++ b/svx/source/sdr/contact/viewobjectcontactofsdrobj.cxx @@ -32,137 +32,133 @@ #include "fmobj.hxx" +namespace sdr { namespace contact { +const SdrObject& ViewObjectContactOfSdrObj::getSdrObject() const +{ + return static_cast< ViewContactOfSdrObj& >(GetViewContact()).GetSdrObject(); +} -namespace sdr +ViewObjectContactOfSdrObj::ViewObjectContactOfSdrObj(ObjectContact& rObjectContact, ViewContact& rViewContact) +: ViewObjectContact(rObjectContact, rViewContact) { - namespace contact - { - const SdrObject& ViewObjectContactOfSdrObj::getSdrObject() const - { - return static_cast< ViewContactOfSdrObj& >(GetViewContact()).GetSdrObject(); - } +} - ViewObjectContactOfSdrObj::ViewObjectContactOfSdrObj(ObjectContact& rObjectContact, ViewContact& rViewContact) - : ViewObjectContact(rObjectContact, rViewContact) - { - } +ViewObjectContactOfSdrObj::~ViewObjectContactOfSdrObj() +{ +} - ViewObjectContactOfSdrObj::~ViewObjectContactOfSdrObj() - { - } +bool ViewObjectContactOfSdrObj::isPrimitiveVisibleOnAnyLayer(const SetOfByte& aLayers) const +{ + return aLayers.IsSet(getSdrObject().GetLayer()); +} - bool ViewObjectContactOfSdrObj::isPrimitiveVisibleOnAnyLayer(const SetOfByte& aLayers) const - { - return aLayers.IsSet(getSdrObject().GetLayer()); - } +bool ViewObjectContactOfSdrObj::isPrimitiveVisible(const DisplayInfo& rDisplayInfo) const +{ + const SdrObject& rObject = getSdrObject(); - bool ViewObjectContactOfSdrObj::isPrimitiveVisible(const DisplayInfo& rDisplayInfo) const - { - const SdrObject& rObject = getSdrObject(); + // Test layer visibility + if(!isPrimitiveVisibleOnAnyLayer(rDisplayInfo.GetProcessLayers())) + { + return false; + } - // Test layer visibility - if(!isPrimitiveVisibleOnAnyLayer(rDisplayInfo.GetProcessLayers())) - { - return false; - } + if(GetObjectContact().isOutputToPrinter() ) + { + // Test if print output but not printable + if( !rObject.IsPrintable()) + return false; + } + else + { + // test is object is not visible on screen + if( !rObject.IsVisible() ) + return false; + } - if(GetObjectContact().isOutputToPrinter() ) - { - // Test if print output but not printable - if( !rObject.IsPrintable()) - return false; - } - else - { - // test is object is not visible on screen - if( !rObject.IsVisible() ) - return false; - } + // Test for hidden object on MasterPage + if(rDisplayInfo.GetSubContentActive() && rObject.IsNotVisibleAsMaster()) + { + return false; + } - // Test for hidden object on MasterPage - if(rDisplayInfo.GetSubContentActive() && rObject.IsNotVisibleAsMaster()) - { - return false; - } + // Test for Calc object hiding (for OLE and Graphic it's extra, see there) + const SdrPageView* pSdrPageView = GetObjectContact().TryToGetSdrPageView(); - // Test for Calc object hiding (for OLE and Graphic it's extra, see there) - const SdrPageView* pSdrPageView = GetObjectContact().TryToGetSdrPageView(); + if(pSdrPageView) + { + const SdrView& rSdrView = pSdrPageView->GetView(); + const bool bHideOle(rSdrView.getHideOle()); + const bool bHideChart(rSdrView.getHideChart()); + const bool bHideDraw(rSdrView.getHideDraw()); + const bool bHideFormControl(rSdrView.getHideFormControl()); - if(pSdrPageView) + if(bHideOle || bHideChart || bHideDraw || bHideFormControl) + { + if(OBJ_OLE2 == rObject.GetObjIdentifier()) { - const SdrView& rSdrView = pSdrPageView->GetView(); - const bool bHideOle(rSdrView.getHideOle()); - const bool bHideChart(rSdrView.getHideChart()); - const bool bHideDraw(rSdrView.getHideDraw()); - const bool bHideFormControl(rSdrView.getHideFormControl()); - - if(bHideOle || bHideChart || bHideDraw || bHideFormControl) + if(static_cast<const SdrOle2Obj&>(rObject).IsChart()) { - if(OBJ_OLE2 == rObject.GetObjIdentifier()) + // chart + if(bHideChart) { - if(static_cast<const SdrOle2Obj&>(rObject).IsChart()) - { - // chart - if(bHideChart) - { - return false; - } - } - else - { - // OLE - if(bHideOle) - { - return false; - } - } + return false; } - else if(OBJ_GRAF == rObject.GetObjIdentifier()) - { - // graphic handled like OLE - if(bHideOle) - { - return false; - } - } - else + } + else + { + // OLE + if(bHideOle) { - const bool bIsFormControl = dynamic_cast< const FmFormObj * >( &rObject ) != 0; - if(bIsFormControl && bHideFormControl) - { - return false; - } - // any other draw object - if(!bIsFormControl && bHideDraw) - { - return false; - } + return false; } } } - - return true; - } - - boost::optional<const OutputDevice&> ViewObjectContactOfSdrObj::getPageViewOutputDevice() const - { - ObjectContactOfPageView* pPageViewContact = dynamic_cast< ObjectContactOfPageView* >( &GetObjectContact() ); - if ( pPageViewContact ) + else if(OBJ_GRAF == rObject.GetObjIdentifier()) + { + // graphic handled like OLE + if(bHideOle) + { + return false; + } + } + else { - // if the PageWindow has a patched PaintWindow, use the original PaintWindow - // this ensures that our control is _not_ re-created just because somebody - // (temporarily) changed the window to paint onto. - // #i72429# / 2007-02-20 / frank.schoenheit (at) sun.com - SdrPageWindow& rPageWindow( pPageViewContact->GetPageWindow() ); - if ( rPageWindow.GetOriginalPaintWindow() ) - return rPageWindow.GetOriginalPaintWindow()->GetOutputDevice(); - - return rPageWindow.GetPaintWindow().GetOutputDevice(); + const bool bIsFormControl = dynamic_cast< const FmFormObj * >( &rObject ) != 0; + if(bIsFormControl && bHideFormControl) + { + return false; + } + // any other draw object + if(!bIsFormControl && bHideDraw) + { + return false; + } } - return boost::optional<const OutputDevice&>(); } - } // end of namespace contact -} // end of namespace sdr + } + + return true; +} + +boost::optional<const OutputDevice&> ViewObjectContactOfSdrObj::getPageViewOutputDevice() const +{ + ObjectContactOfPageView* pPageViewContact = dynamic_cast< ObjectContactOfPageView* >( &GetObjectContact() ); + if ( pPageViewContact ) + { + // if the PageWindow has a patched PaintWindow, use the original PaintWindow + // this ensures that our control is _not_ re-created just because somebody + // (temporarily) changed the window to paint onto. + // #i72429# / 2007-02-20 / frank.schoenheit (at) sun.com + SdrPageWindow& rPageWindow( pPageViewContact->GetPageWindow() ); + if ( rPageWindow.GetOriginalPaintWindow() ) + return rPageWindow.GetOriginalPaintWindow()->GetOutputDevice(); + + return rPageWindow.GetPaintWindow().GetOutputDevice(); + } + return boost::optional<const OutputDevice&>(); +} + +}} /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |