summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJan-Marek Glogowski <glogow@fbihome.de>2016-07-22 18:00:59 +0200
committerJan-Marek Glogowski <glogow@fbihome.de>2016-08-29 13:13:15 +0200
commit28b4c575703430602c72a442f59bb5f9f6aeb749 (patch)
treef76da007049462021bd8e942541876b8cbec4599
parentf7f5d27066b696ac4e33246d3794bde8058e8622 (diff)
Remove now unused SwTextBoxHelper functions
Change-Id: I39500424c79040b1887ea74081fdf0ea0bc5f009
-rw-r--r--sw/inc/textboxhelper.hxx13
-rw-r--r--sw/source/core/doc/textboxhelper.cxx94
2 files changed, 0 insertions, 107 deletions
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 5049f10e1954..8a561bbee87a 100644
--- a/sw/source/core/doc/textboxhelper.cxx
+++ b/sw/source/core/doc/textboxhelper.cxx
@@ -126,25 +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 (const SwFrameFormat* pFormat : rSpzFrameFormats)
- {
- // 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);
@@ -167,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 (SwFrameFormat* pFormat : rSpzFrameFormats)
- {
- SwFrameFormat* pTextBox = getOtherTextBoxFormat(pFormat, RES_DRAWFRMFMT);
- if (pTextBox)
- aRet[pTextBox] = pFormat;
- }
-
- return aRet;
-}
-
bool SwTextBoxHelper::isTextBox(const SdrObject* pObject)
{
const SwVirtFlyDrawObj* pVirtFlyDrawObj = dynamic_cast<const SwVirtFlyDrawObj*>(pObject);
@@ -310,38 +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 (SwFrameFormat* pFormat : rSpzFrameFormats)
- {
- // 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)
{