sw/inc/textboxhelper.hxx             |   13 ----
 sw/source/core/doc/textboxhelper.cxx |   97 -----------------------------------
 2 files changed, 110 deletions(-)

New commits:
commit 9e190bbb5d79805159d53a433826181df7f11982
Author: Jan-Marek Glogowski <glo...@fbihome.de>
Date:   Fri Jul 22 18:00:59 2016 +0200

    Remove now unused SwTextBoxHelper functions
    
    (Manually cherry picked from commit 
f7f5d27066b696ac4e33246d3794bde8058e8622)
    
    Change-Id: I39500424c79040b1887ea74081fdf0ea0bc5f009
    Reviewed-on: https://gerrit.libreoffice.org/46331
    Reviewed-by: Thorsten Behrens <thorsten.behr...@cib.de>
    Tested-by: Thorsten Behrens <thorsten.behr...@cib.de>

diff --git a/sw/inc/textboxhelper.hxx b/sw/inc/textboxhelper.hxx
index 98983bad9f42..32fc2167c72a 100644
--- a/sw/inc/textboxhelper.hxx
+++ b/sw/inc/textboxhelper.hxx
@@ -73,8 +73,6 @@ public:
     static SwFrameFormat* getOtherTextBoxFormat(const SwFrameFormat* pFormat, 
sal_uInt16 nType);
     /// If we have an associated TextFrame, then return that.
     static SwFrameFormat* 
getOtherTextBoxFormat(css::uno::Reference<css::drawing::XShape> xShape);
-    static SwFrameFormat* findTextBox(const SwFrameFormat* pShape);
-    static SwFrameFormat* findTextBox(const 
css::uno::Reference<css::drawing::XShape>& xShape);
     /// Return the textbox rectangle of a draw shape (in twips).
     static Rectangle getTextRectangle(SwFrameFormat* pShape, bool bAbsolute = 
true);
 
@@ -91,17 +89,6 @@ public:
     /// Is pObject a textbox of a drawinglayer shape?
     static bool isTextBox(const SdrObject* pObject);
 
-    /// Look up TextFrames in a document, which are in fact TextBoxes.
-    static std::set<const SwFrameFormat*> findTextBoxes(const SwDoc* pDoc);
-    /**
-     * Look up TextFrames in a document, which are in fact TextBoxes.
-     *
-     * If rNode has a matching SwContentFrame, then only TextBoxes of rNode are
-     * returned.
-     */
-    static std::set<const SwFrameFormat*> findTextBoxes(const SwNode& rNode);
-    /// Build a textbox -> shape format map.
-    static std::map<SwFrameFormat*, SwFrameFormat*> findShapes(const SwDoc* 
pDoc);
     /// Count number of shapes in the document, excluding TextBoxes.
     static sal_Int32 getCount(const SwDoc* pDoc);
     /// Count number of shapes on the page, excluding TextBoxes.
diff --git a/sw/source/core/doc/textboxhelper.cxx 
b/sw/source/core/doc/textboxhelper.cxx
index 12464e37e4b6..23033eaeea38 100644
--- a/sw/source/core/doc/textboxhelper.cxx
+++ b/sw/source/core/doc/textboxhelper.cxx
@@ -126,27 +126,6 @@ void SwTextBoxHelper::destroy(SwFrameFormat* pShape)
     }
 }
 
-std::set<const SwFrameFormat*> SwTextBoxHelper::findTextBoxes(const SwDoc* 
pDoc)
-{
-    std::set<const SwFrameFormat*> aTextBoxes;
-
-    const SwFrameFormats& rSpzFrameFormats = *pDoc->GetSpzFrameFormats();
-    for (SwFrameFormats::const_iterator it = rSpzFrameFormats.begin(); it != 
rSpzFrameFormats.end(); ++it)
-    {
-        const SwFrameFormat* pFormat = *it;
-
-        // A TextBox in the context of this class is a fly frame that has a
-        // matching (same RES_CNTNT) draw frame.
-        if (!pFormat->GetAttrSet().HasItem(RES_CNTNT) || 
!pFormat->GetContent().GetContentIdx())
-            continue;
-
-        if (pFormat->Which() == RES_FLYFRMFMT && nullptr != 
pFormat->GetOtherTextBoxFormat())
-            aTextBoxes.insert(pFormat);
-    }
-
-    return aTextBoxes;
-}
-
 bool SwTextBoxHelper::isTextBox(const SwFrameFormat* pShape, sal_uInt16 nType)
 {
    assert(nType == RES_FLYFRMFMT || nType == RES_DRAWFRMFMT);
@@ -169,49 +148,6 @@ bool SwTextBoxHelper::isTextBox(const SwFrameFormat* 
pShape, sal_uInt16 nType)
    return true;
 }
 
-std::set<const SwFrameFormat*> SwTextBoxHelper::findTextBoxes(const SwNode& 
rNode)
-{
-    const SwDoc* pDoc = rNode.GetDoc();
-    const SwContentNode* pContentNode = nullptr;
-    const SwContentFrame* pContentFrame = nullptr;
-    bool bHaveViewShell = 
pDoc->getIDocumentLayoutAccess().GetCurrentViewShell();
-    if (bHaveViewShell && (pContentNode = rNode.GetContentNode()) && 
(pContentFrame = 
pContentNode->getLayoutFrame(pDoc->getIDocumentLayoutAccess().GetCurrentLayout())))
-    {
-        // We can use the layout information to iterate over only the frames 
which are anchored to us.
-        std::set<const SwFrameFormat*> aRet;
-        const SwSortedObjs* pSortedObjs = pContentFrame->GetDrawObjs();
-        if (pSortedObjs)
-        {
-            for (SwAnchoredObject* pAnchoredObject : *pSortedObjs)
-            {
-                SwFrameFormat* pTextBox = 
getOtherTextBoxFormat(&pAnchoredObject->GetFrameFormat(), RES_DRAWFRMFMT);
-                if (pTextBox)
-                    aRet.insert(pTextBox);
-            }
-        }
-        return aRet;
-    }
-    else
-        // If necessary, here we could manually limit the returned set to the
-        // ones which are anchored to rNode, but currently no need to do so.
-        return findTextBoxes(pDoc);
-}
-
-std::map<SwFrameFormat*, SwFrameFormat*> SwTextBoxHelper::findShapes(const 
SwDoc* pDoc)
-{
-    std::map<SwFrameFormat*, SwFrameFormat*> aRet;
-
-    const SwFrameFormats& rSpzFrameFormats = *pDoc->GetSpzFrameFormats();
-    for (SwFrameFormats::const_iterator it = rSpzFrameFormats.begin(); it != 
rSpzFrameFormats.end(); ++it)
-    {
-        SwFrameFormat* pTextBox = getOtherTextBoxFormat(*it, RES_DRAWFRMFMT);
-        if (pTextBox)
-            aRet[pTextBox] = *it;
-    }
-
-    return aRet;
-}
-
 bool SwTextBoxHelper::isTextBox(const SdrObject* pObject)
 {
     const SwVirtFlyDrawObj* pVirtFlyDrawObj = dynamic_cast<const 
SwVirtFlyDrawObj*>(pObject);
@@ -312,39 +248,6 @@ SwFrameFormat* 
SwTextBoxHelper::getOtherTextBoxFormat(uno::Reference<drawing::XS
     return getOtherTextBoxFormat(pFormat, RES_DRAWFRMFMT);
 }
 
-SwFrameFormat* SwTextBoxHelper::findTextBox(const 
uno::Reference<drawing::XShape>& xShape)
-{
-    SwXShape* pShape = dynamic_cast<SwXShape*>(xShape.get());
-    if (!pShape)
-        return nullptr;
-
-    return findTextBox(pShape->GetFrameFormat());
-}
-
-SwFrameFormat* SwTextBoxHelper::findTextBox(const SwFrameFormat* pShape)
-{
-    SwFrameFormat* pRet = nullptr;
-
-    // Only draw frames can have TextBoxes.
-    if (pShape && pShape->Which() == RES_DRAWFRMFMT && 
pShape->GetAttrSet().HasItem(RES_CNTNT))
-    {
-        const SwFormatContent& rContent = pShape->GetContent();
-        const SwFrameFormats& rSpzFrameFormats = 
*pShape->GetDoc()->GetSpzFrameFormats();
-        for (SwFrameFormats::const_iterator it = rSpzFrameFormats.begin(); it 
!= rSpzFrameFormats.end(); ++it)
-        {
-            SwFrameFormat* pFormat = *it;
-            // Only a fly frame can be a TextBox.
-            if (pFormat->Which() == RES_FLYFRMFMT && 
pFormat->GetAttrSet().HasItem(RES_CNTNT) && pFormat->GetContent() == rContent)
-            {
-                pRet = pFormat;
-                break;
-            }
-        }
-    }
-
-    return pRet;
-}
-
 template < typename T >
 void lcl_queryInterface(SwFrameFormat* pShape, uno::Any& rAny)
 {
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to