[Libreoffice-commits] core.git: sw/inc sw/source

Caolán McNamara caolanm at redhat.com
Thu Sep 10 03:25:42 PDT 2015


 sw/inc/fesh.hxx                    |    4 ++--
 sw/source/core/frmedt/fecopy.cxx   |    8 ++++----
 sw/source/core/frmedt/fefly1.cxx   |   24 ++++++++++++------------
 sw/source/core/frmedt/feflyole.cxx |    2 +-
 sw/source/core/frmedt/feshview.cxx |    6 +++---
 sw/source/core/frmedt/fews.cxx     |    4 ++--
 6 files changed, 24 insertions(+), 24 deletions(-)

New commits:
commit d9729bc06d676a36120f3da252d1a4fa39d103d8
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Thu Sep 10 11:07:55 2015 +0100

    this FindFlyFrm variant returns the Selected FlyFrm
    
    the other one actively searches for the FlyFrm that
    matches the XEmbeddedObject argument
    
    Change-Id: I2f9271c01337b4a32d7b644f82d16d85c2dc5b51

diff --git a/sw/inc/fesh.hxx b/sw/inc/fesh.hxx
index 952e9ca..7109a32 100644
--- a/sw/inc/fesh.hxx
+++ b/sw/inc/fesh.hxx
@@ -207,7 +207,7 @@ private:
     std::unique_ptr<SdrDropMarkerOverlay> m_pChainFrom;
     bool m_bCheckForOLEInCaption;
 
-    SAL_DLLPRIVATE SwFlyFrm *FindFlyFrm() const;
+    SAL_DLLPRIVATE SwFlyFrm *GetSelectedFlyFrm() const;
     SAL_DLLPRIVATE SwFlyFrm *FindFlyFrm( const ::com::sun::star::uno::Reference < ::com::sun::star::embed::XEmbeddedObject >&  ) const;
 
     /// Terminate actions for all shells and call ChangeLink.
@@ -394,7 +394,7 @@ public:
 
     SwFrameFormat* GetCurFrameFormat() const; ///< If frame then frame style, else 0.
     void SetFrameFormat( SwFrameFormat *pFormat, bool bKeepOrient = false, Point* pDocPos = 0 ); ///< If frame then set frame style.
-    const SwFlyFrm *GetCurrFlyFrm() const { return FindFlyFrm(); }
+    const SwFlyFrm *GetCurrFlyFrm() const { return GetSelectedFlyFrm(); }
 
     /// Find/delete fly containing the cursor.
     SwFrameFormat* WizardGetFly();
diff --git a/sw/source/core/frmedt/fecopy.cxx b/sw/source/core/frmedt/fecopy.cxx
index 1ec8a81..01b6506 100644
--- a/sw/source/core/frmedt/fecopy.cxx
+++ b/sw/source/core/frmedt/fecopy.cxx
@@ -126,7 +126,7 @@ bool SwFEShell::Copy( SwDoc* pClpDoc, const OUString* pNewClpText )
     if( IsFrmSelected() )
     {
         // get the FlyFormat
-        SwFlyFrm* pFly = FindFlyFrm();
+        SwFlyFrm* pFly = GetSelectedFlyFrm();
         SwFrameFormat* pFlyFormat = pFly->GetFormat();
         SwFormatAnchor aAnchor( pFlyFormat->GetAnchor() );
 
@@ -467,7 +467,7 @@ bool SwFEShell::Copy( SwFEShell* pDestShell, const Point& rSttPt,
 
     if( IsFrmSelected() )
     {
-        SwFlyFrm* pFly = FindFlyFrm();
+        SwFlyFrm* pFly = GetSelectedFlyFrm();
         SwFrameFormat* pFlyFormat = pFly->GetFormat();
         SwFormatAnchor aAnchor( pFlyFormat->GetAnchor() );
         bRet = true;
@@ -1264,10 +1264,10 @@ bool SwFEShell::GetDrawObjGraphic( SotClipboardFormatId nFormat, Graphic& rGrf )
                     }
                     else
                     {
-                        // fix(23806): not the origial size, but the current one.
+                        // Not the original size, but the current one.
                         // Otherwise it could happen that for vector graphics
                         // many MB's of memory are allocated.
-                        const Size aSz( FindFlyFrm()->Prt().SSize() );
+                        const Size aSz( GetSelectedFlyFrm()->Prt().SSize() );
                         ScopedVclPtrInstance< VirtualDevice > pVirtDev(*GetWin());
 
                         MapMode aTmp( MAP_TWIP );
diff --git a/sw/source/core/frmedt/fefly1.cxx b/sw/source/core/frmedt/fefly1.cxx
index 0f7cd93..defb909 100644
--- a/sw/source/core/frmedt/fefly1.cxx
+++ b/sw/source/core/frmedt/fefly1.cxx
@@ -236,7 +236,7 @@ void SwFEShell::SelectFlyFrm( SwFlyFrm& rFrm, bool bNew )
         OSL_ENSURE( rFrm.IsFlyFrm(), "SelectFlyFrm will einen Fly" );
 
        // nothing to be done if the Fly already was selected
-        if ( FindFlyFrm() == &rFrm )
+        if (GetSelectedFlyFrm() == &rFrm)
             return;
 
         // assure the anchor is drawn
@@ -255,7 +255,7 @@ void SwFEShell::SelectFlyFrm( SwFlyFrm& rFrm, bool bNew )
 }
 
 // returns a Fly if one is selected
-SwFlyFrm *SwFEShell::FindFlyFrm() const
+SwFlyFrm *SwFEShell::GetSelectedFlyFrm() const
 {
     if ( Imp()->HasDrawView() )
     {
@@ -968,7 +968,7 @@ void SwFEShell::SetPageObjsNewPage( std::vector<SwFrameFormat*>& rFillArr, int n
 // wrong place or which are ambiguous (multiple selections) will be removed.
 bool SwFEShell::GetFlyFrmAttr( SfxItemSet &rSet ) const
 {
-    SwFlyFrm *pFly = FindFlyFrm();
+    SwFlyFrm *pFly = GetSelectedFlyFrm();
     if ( !pFly )
     {
         SwFrm* pCurrFrm( GetCurrFrm() );
@@ -1026,7 +1026,7 @@ bool SwFEShell::SetFlyFrmAttr( SfxItemSet& rSet )
 
     if( rSet.Count() )
     {
-        SwFlyFrm *pFly = FindFlyFrm();
+        SwFlyFrm *pFly = GetSelectedFlyFrm();
         if( !pFly )
         {
             OSL_ENSURE( GetCurrFrm(), "Crsr in parking zone" );
@@ -1106,7 +1106,7 @@ bool SwFEShell::ResetFlyFrmAttr( sal_uInt16 nWhich, const SfxItemSet* pSet )
     {
         SET_CURR_SHELL( this );
 
-        SwFlyFrm *pFly = FindFlyFrm();
+        SwFlyFrm *pFly = GetSelectedFlyFrm();
         if( !pFly )
         {
             OSL_ENSURE( GetCurrFrm(), "Crsr in parking zone" );
@@ -1146,7 +1146,7 @@ bool SwFEShell::ResetFlyFrmAttr( sal_uInt16 nWhich, const SfxItemSet* pSet )
 SwFrameFormat* SwFEShell::GetCurFrameFormat() const
 {
     SwFrameFormat* pRet = 0;
-    SwLayoutFrm *pFly = FindFlyFrm();
+    SwLayoutFrm *pFly = GetSelectedFlyFrm();
     if( pFly && ( pRet = static_cast<SwFrameFormat*>(pFly->GetFormat()->DerivedFrom()) ) ==
                                             GetDoc()->GetDfltFrameFormat() )
         pRet = 0;
@@ -1164,7 +1164,7 @@ void SwFEShell::SetFrameFormat( SwFrameFormat *pNewFormat, bool bKeepOrient, Poi
             pFly = static_cast<const SwFlyFrameFormat*>(pFormat)->GetFrm();
     }
     else
-        pFly = FindFlyFrm();
+        pFly = GetSelectedFlyFrm();
     OSL_ENSURE( pFly, "SetFrameFormat: no frame" );
     if( pFly )
     {
@@ -1200,7 +1200,7 @@ void SwFEShell::SetFrameFormat( SwFrameFormat *pNewFormat, bool bKeepOrient, Poi
 
 const SwFrameFormat* SwFEShell::GetFlyFrameFormat() const
 {
-    const SwFlyFrm* pFly = FindFlyFrm();
+    const SwFlyFrm* pFly = GetSelectedFlyFrm();
     if ( !pFly )
     {
         SwFrm* pCurrFrm = GetCurrFrm();
@@ -1213,7 +1213,7 @@ const SwFrameFormat* SwFEShell::GetFlyFrameFormat() const
 
 SwFrameFormat* SwFEShell::GetFlyFrameFormat()
 {
-    SwFlyFrm* pFly = FindFlyFrm();
+    SwFlyFrm* pFly = GetSelectedFlyFrm();
     if ( !pFly )
     {
         SwFrm* pCurrFrm = GetCurrFrm();
@@ -1416,7 +1416,7 @@ SwFrameFormat* SwFEShell::WizardGetFly()
 
 void SwFEShell::SetFlyName( const OUString& rName )
 {
-    SwLayoutFrm *pFly = FindFlyFrm();
+    SwLayoutFrm *pFly = GetSelectedFlyFrm();
     if( pFly )
         GetDoc()->SetFlyName( *static_cast<SwFlyFrameFormat*>(pFly->GetFormat()), rName );
     else {
@@ -1426,7 +1426,7 @@ void SwFEShell::SetFlyName( const OUString& rName )
 
 OUString SwFEShell::GetFlyName() const
 {
-    SwLayoutFrm *pFly = FindFlyFrm();
+    SwLayoutFrm *pFly = GetSelectedFlyFrm();
     if( pFly )
         return pFly->GetFormat()->GetName();
 
@@ -1437,7 +1437,7 @@ OUString SwFEShell::GetFlyName() const
 const uno::Reference < embed::XEmbeddedObject > SwFEShell::GetOleRef() const
 {
     uno::Reference < embed::XEmbeddedObject > xObj;
-    SwFlyFrm * pFly = FindFlyFrm();
+    SwFlyFrm * pFly = GetSelectedFlyFrm();
     if (pFly && pFly->Lower() && pFly->Lower()->IsNoTextFrm())
     {
         SwOLENode *pNd = static_cast<SwNoTextFrm*>(pFly->Lower())->GetNode()->GetOLENode();
diff --git a/sw/source/core/frmedt/feflyole.cxx b/sw/source/core/frmedt/feflyole.cxx
index 9b69a4e..2faaab0 100644
--- a/sw/source/core/frmedt/feflyole.cxx
+++ b/sw/source/core/frmedt/feflyole.cxx
@@ -43,7 +43,7 @@ using namespace com::sun::star;
 
 SwFlyFrm *SwFEShell::FindFlyFrm( const uno::Reference < embed::XEmbeddedObject >& xObj ) const
 {
-    SwFlyFrm *pFly = FindFlyFrm();
+    SwFlyFrm *pFly = GetSelectedFlyFrm();
     if ( pFly && pFly->Lower() && pFly->Lower()->IsNoTextFrm() )
     {
         SwOLENode *pNd = static_cast<SwNoTextFrm*>(pFly->Lower())->GetNode()->GetOLENode();
diff --git a/sw/source/core/frmedt/feshview.cxx b/sw/source/core/frmedt/feshview.cxx
index 433a030..9000746 100644
--- a/sw/source/core/frmedt/feshview.cxx
+++ b/sw/source/core/frmedt/feshview.cxx
@@ -1773,7 +1773,7 @@ bool SwFEShell::ImpEndCreate()
         SwFlyFrm* pFlyFrm;
         if( NewFlyFrm( aSet, true ) &&
             ::GetHtmlMode( GetDoc()->GetDocShell() ) &&
-            0 != ( pFlyFrm = FindFlyFrm() ))
+            0 != ( pFlyFrm = GetSelectedFlyFrm() ))
         {
             SfxItemSet aHtmlSet( GetDoc()->GetAttrPool(), RES_VERT_ORIENT, RES_HORI_ORIENT );
             // horizontal orientation:
@@ -2084,7 +2084,7 @@ Point SwFEShell::GetAnchorObjDiff() const
 
     if ( IsFrmSelected() )
     {
-        SwFlyFrm *pFly = FindFlyFrm();
+        SwFlyFrm *pFly = GetSelectedFlyFrm();
         aRet -= pFly->GetAnchorFrm()->Frm().Pos();
     }
     else
@@ -2632,7 +2632,7 @@ void SwFEShell::SetChainMarker()
          bDelTo   = true;
     if ( IsFrmSelected() )
     {
-        SwFlyFrm *pFly = FindFlyFrm();
+        SwFlyFrm *pFly = GetSelectedFlyFrm();
 
         if ( pFly->GetPrevLink() )
         {
diff --git a/sw/source/core/frmedt/fews.cxx b/sw/source/core/frmedt/fews.cxx
index 811e388..8227b30 100644
--- a/sw/source/core/frmedt/fews.cxx
+++ b/sw/source/core/frmedt/fews.cxx
@@ -649,7 +649,7 @@ void SwFEShell::CalcBoundRect( SwRect& _orRect,
     }
     else
     {
-        pFly = FindFlyFrm();
+        pFly = GetSelectedFlyFrm();
         pFrm = pFly ? pFly->GetAnchorFrm() : GetCurrFrm();
     }
 
@@ -1167,7 +1167,7 @@ void SwFEShell::CalcBoundRect( SwRect& _orRect,
 Size SwFEShell::GetGraphicDefaultSize() const
 {
     Size aRet;
-    SwFlyFrm *pFly = FindFlyFrm();
+    SwFlyFrm *pFly = GetSelectedFlyFrm();
     if ( pFly )
     {
         // #i32951# - due to issue #i28701# no format of a


More information about the Libreoffice-commits mailing list