summaryrefslogtreecommitdiff
path: root/sw/inc/textboxhelper.hxx
diff options
context:
space:
mode:
authorJan-Marek Glogowski <glogow@fbihome.de>2016-07-22 17:50:52 +0200
committerJan-Marek Glogowski <glogow@fbihome.de>2016-08-29 13:13:14 +0200
commit0bcc5b3daebeb2a7d2b5ba132af4745cc6c78cd0 (patch)
tree4fcff9413879a6dd789cee6e8450db5496785c75 /sw/inc/textboxhelper.hxx
parent5bed080c77f99f22fd52ad6cf2d6274e7c1e12a8 (diff)
Switch isTextBox to use the format pointers
This replaces all possible occurences of the text box format maps, which just want to know, if a SwFrameFormat is part of a text box to use the direct lookup via the isTextBox, which is now a cheap call. Change-Id: I3b4e2301f816aead1b719cd70a8ef118e685ccfc
Diffstat (limited to 'sw/inc/textboxhelper.hxx')
-rw-r--r--sw/inc/textboxhelper.hxx23
1 files changed, 18 insertions, 5 deletions
diff --git a/sw/inc/textboxhelper.hxx b/sw/inc/textboxhelper.hxx
index cce179607181..eb94bbc1d194 100644
--- a/sw/inc/textboxhelper.hxx
+++ b/sw/inc/textboxhelper.hxx
@@ -68,6 +68,19 @@ public:
/// Return the textbox rectangle of a draw shape (in twips).
static Rectangle getTextRectangle(SwFrameFormat* pShape, bool bAbsolute = true);
+ /**
+ * Is the frame format a text box?
+ *
+ * A text box consists of a coupled fly and draw format. Most times you
+ * just want to check for a single type, otherwise you get duplicate results.
+ *
+ * @param nType Expected frame format input type.
+ * Valid types are RES_DRAWFRMFMT and RES_FLYFRMFMT.
+ */
+ static bool isTextBox(const SwFrameFormat* pFormat, sal_uInt16 nType);
+ /// 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);
/**
@@ -77,16 +90,16 @@ public:
* returned.
*/
static std::set<const SwFrameFormat*> findTextBoxes(const SwNode& rNode);
- /// Is pObject a textbox of a drawinglayer shape?
- static bool isTextBox(const SdrObject* pObject);
/// 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(SdrPage* pPage, std::set<const SwFrameFormat*>& rTextBoxes);
+ static sal_Int32 getCount(const SwDoc* pDoc);
+ /// Count number of shapes on the page, excluding TextBoxes.
+ static sal_Int32 getCount(SdrPage* pPage);
/// Get a shape by index, excluding TextBoxes.
- static css::uno::Any getByIndex(SdrPage* pPage, sal_Int32 nIndex, std::set<const SwFrameFormat*>& rTextBoxes) throw(css::lang::IndexOutOfBoundsException);
+ static css::uno::Any getByIndex(SdrPage* pPage, sal_Int32 nIndex) throw(css::lang::IndexOutOfBoundsException);
/// Get the order of the shape, excluding TextBoxes.
- static sal_Int32 getOrdNum(const SdrObject* pObject, std::set<const SwFrameFormat*>& rTextBoxes);
+ static sal_Int32 getOrdNum(const SdrObject* pObject);
/// If pTextBox is a textbox, then set rWrapThrough to the surround of its shape.
static void getShapeWrapThrough(const SwFrameFormat* pTextBox, bool& rWrapThrough);