[Libreoffice-commits] core.git: svx/source

Kohei Yoshida kohei.yoshida at collabora.com
Sat Nov 1 10:22:37 PDT 2014


 svx/source/sdr/contact/viewobjectcontactofsdrobj.cxx |  214 +++++++++----------
 1 file changed, 105 insertions(+), 109 deletions(-)

New commits:
commit 0cada896f09d9e6b9a2c7ac04317a3a9cc6c0a7c
Author: Kohei Yoshida <kohei.yoshida at collabora.com>
Date:   Sat Nov 1 13:21:08 2014 -0400

    Unindent.
    
    Change-Id: I0e86d04c0fa6185b41d5751d28a7e3f3b86af371

diff --git a/svx/source/sdr/contact/viewobjectcontactofsdrobj.cxx b/svx/source/sdr/contact/viewobjectcontactofsdrobj.cxx
index d61bc3e..2273f4b 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: */


More information about the Libreoffice-commits mailing list