summaryrefslogtreecommitdiff
path: root/include/svl
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.co.uk>2015-05-28 17:13:38 +0200
committerMiklos Vajna <vmiklos@collabora.co.uk>2015-05-28 17:37:18 +0200
commit1dc60bc9e99304c58007bfd5a964ff3f78480106 (patch)
tree8ddc1154e6fb6ca71ae36e24612ab1173240981b /include/svl
parent2ecf0ced9d2e55881033786fe95d45ceaeb73d37 (diff)
SvxSearchItem: add m_nStartPoint{X,Y}
The idea is that if you have your cursor at the begining of a Writer document, and you scroll down a lot, then search, then it's annoying that search jumps back to the start of the document for the first hit. Add an optional way to provide what is the starting point of such a search, so we can have "when nothing is selected, then search from the top left corner of the visible area". No UI yet to enable this, but available via the UNO API. Change-Id: Ibcf3a5f2eeba1372b1dfe8474081e6591a6e0134
Diffstat (limited to 'include/svl')
-rw-r--r--include/svl/memberid.hrc2
-rw-r--r--include/svl/srchitem.hxx9
2 files changed, 11 insertions, 0 deletions
diff --git a/include/svl/memberid.hrc b/include/svl/memberid.hrc
index ef5639523e8e..1593e2379aec 100644
--- a/include/svl/memberid.hrc
+++ b/include/svl/memberid.hrc
@@ -53,6 +53,8 @@
#define MID_SEARCH_INSERTEDCHARS 17
#define MID_SEARCH_TRANSLITERATEFLAGS 18
#define MID_SEARCH_COMMAND 19
+#define MID_SEARCH_STARTPOINTX 20
+#define MID_SEARCH_STARTPOINTY 21
#endif
diff --git a/include/svl/srchitem.hxx b/include/svl/srchitem.hxx
index 7ce0f77c8922..9a298585e43a 100644
--- a/include/svl/srchitem.hxx
+++ b/include/svl/srchitem.hxx
@@ -84,6 +84,10 @@ class SVL_DLLPUBLIC SvxSearchItem :
bool bContent; // search in content
bool bAsianOptions; // use asian options?
+ // Start search at this point (absolute twips).
+ sal_Int32 m_nStartPointX;
+ sal_Int32 m_nStartPointY;
+
virtual void ImplCommit() SAL_OVERRIDE;
public:
@@ -184,6 +188,11 @@ public:
inline bool IsUseAsianOptions() const { return bAsianOptions; }
inline void SetUseAsianOptions( bool bVal ) { bAsianOptions = bVal; }
+
+ sal_Int32 GetStartPointX() const;
+ sal_Int32 GetStartPointY() const;
+ /// Either x or y start point is set.
+ bool HasStartPoint() const;
};
const OUString SvxSearchItem::GetSearchString() const