summaryrefslogtreecommitdiff
path: root/svl/source
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-29 09:50:14 +0200
commit6bccdf23fdf755494e840a3a21380a754969df73 (patch)
tree3cfe6b88e1b4a739e05b68c19402e24457c56632 /svl/source
parent7a3d25c5916dc293a8d30e24c41aee4b7154a39a (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 (cherry picked from commit 1dc60bc9e99304c58007bfd5a964ff3f78480106)
Diffstat (limited to 'svl/source')
-rw-r--r--svl/source/items/srchitem.cxx32
1 files changed, 30 insertions, 2 deletions
diff --git a/svl/source/items/srchitem.cxx b/svl/source/items/srchitem.cxx
index e46d2557e7d9..986463e1d489 100644
--- a/svl/source/items/srchitem.cxx
+++ b/svl/source/items/srchitem.cxx
@@ -125,7 +125,9 @@ SvxSearchItem::SvxSearchItem( const sal_uInt16 nId ) :
bBackward ( false ),
bPattern ( false ),
bContent ( false ),
- bAsianOptions ( false )
+ bAsianOptions ( false ),
+ m_nStartPointX(0),
+ m_nStartPointY(0)
{
EnableNotification( lcl_GetNotifyNames() );
@@ -211,7 +213,9 @@ SvxSearchItem::SvxSearchItem( const SvxSearchItem& rItem ) :
bBackward ( rItem.bBackward ),
bPattern ( rItem.bPattern ),
bContent ( rItem.bContent ),
- bAsianOptions ( rItem.bAsianOptions )
+ bAsianOptions ( rItem.bAsianOptions ),
+ m_nStartPointX(rItem.m_nStartPointX),
+ m_nStartPointY(rItem.m_nStartPointY)
{
EnableNotification( lcl_GetNotifyNames() );
}
@@ -604,6 +608,16 @@ bool SvxSearchItem::PutValue( const com::sun::star::uno::Any& rVal, sal_uInt8 nM
}
break;
}
+ case MID_SEARCH_STARTPOINTX:
+ {
+ bRet = (rVal >>= m_nStartPointX);
+ break;
+ }
+ case MID_SEARCH_STARTPOINTY:
+ {
+ bRet = (rVal >>= m_nStartPointY);
+ break;
+ }
default:
OSL_FAIL( "Unknown MemberId" );
}
@@ -611,5 +625,19 @@ bool SvxSearchItem::PutValue( const com::sun::star::uno::Any& rVal, sal_uInt8 nM
return bRet;
}
+sal_Int32 SvxSearchItem::GetStartPointX() const
+{
+ return m_nStartPointX;
+}
+
+sal_Int32 SvxSearchItem::GetStartPointY() const
+{
+ return m_nStartPointY;
+}
+
+bool SvxSearchItem::HasStartPoint() const
+{
+ return m_nStartPointX > 0 || m_nStartPointY > 0;
+}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */