diff options
author | Markus Mohrhard <markus.mohrhard@googlemail.com> | 2016-05-21 01:22:01 +0200 |
---|---|---|
committer | Markus Mohrhard <markus.mohrhard@googlemail.com> | 2016-06-18 17:02:32 +0200 |
commit | 8b21af2d243bf033f9a9375f48be840e61300fce (patch) | |
tree | 250fa6266367f8a7634a68dd78796cde9419de5f /sw/source/uibase/uitest/uiobject.cxx | |
parent | 229ab4ba12c3bf4ff535c150a9d2ef4ba29cfd57 (diff) |
uitest: provide information about current page
Change-Id: Ie0ef65a023e156f65370e11f024fa6349841841e
Diffstat (limited to 'sw/source/uibase/uitest/uiobject.cxx')
-rw-r--r-- | sw/source/uibase/uitest/uiobject.cxx | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/sw/source/uibase/uitest/uiobject.cxx b/sw/source/uibase/uitest/uiobject.cxx index 907e7b9aeb62..555aef43f65a 100644 --- a/sw/source/uibase/uitest/uiobject.cxx +++ b/sw/source/uibase/uitest/uiobject.cxx @@ -10,6 +10,7 @@ #include "uiobject.hxx" #include "edtwin.hxx" #include "view.hxx" +#include "wrtsh.hxx" SwEditWinUIObject::SwEditWinUIObject(VclPtr<SwEditWin> xEditWin): WindowUIObject(xEditWin), @@ -17,11 +18,28 @@ SwEditWinUIObject::SwEditWinUIObject(VclPtr<SwEditWin> xEditWin): { } +namespace { + +SwWrtShell& getWrtShell(VclPtr<SwEditWin> xEditWin) +{ + return xEditWin->GetView().GetWrtShell(); +} + +} + StringMap SwEditWinUIObject::get_state() { StringMap aMap = WindowUIObject::get_state(); - // aMap["SelectedText"] = mxEditWin + aMap["SelectedText"] = mxEditWin->GetView().GetSelectionText(); + + sal_uInt16 nPageNum = 0; + sal_uInt16 nVirtPageNum = 0; + getWrtShell(mxEditWin).GetPageNum(nPageNum, nVirtPageNum); + aMap["CurrentPage"] = OUString::number(nPageNum); + getWrtShell(mxEditWin).GetPageNum(nPageNum, nVirtPageNum, false); + aMap["TopVisiblePage"] = OUString::number(nPageNum); + return aMap; } |