From ebc5777548dea42ed966a16c66d879b1485bbfb4 Mon Sep 17 00:00:00 2001 From: Mathias Bauer Date: Sun, 13 Jun 2010 15:22:56 +0200 Subject: CWS swlayoutrefactoring: #i81480#: enable sw code to use multiple layouts --- sw/source/ui/vba/vbainformationhelper.cxx | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'sw/source/ui/vba/vbainformationhelper.cxx') diff --git a/sw/source/ui/vba/vbainformationhelper.cxx b/sw/source/ui/vba/vbainformationhelper.cxx index 6fdf8f9f9449..317aa64c46ca 100644 --- a/sw/source/ui/vba/vbainformationhelper.cxx +++ b/sw/source/ui/vba/vbainformationhelper.cxx @@ -32,6 +32,7 @@ #include #include #include +#include using namespace ::ooo::vba; using namespace ::com::sun::star; @@ -58,7 +59,9 @@ double SwVbaInformationHelper::handleWdVerticalPositionRelativeToPage( const css sal_Int32 nCurrentPos = xTVCursor->getPosition().Y; sal_Int32 nCurrentPage = handleWdActiveEndPageNumber( xTVCursor ); - sal_Int32 nPageHeight = word::getDocShell( xModel )->GetDoc()->GetPageSize( nCurrentPage, sal_False ).Height(); + SwDoc* pDoc = word::getDocShell( xModel )->GetDoc(); + ViewShell* pViewSh = pDoc->GetCurrentViewShell(); + sal_Int32 nPageHeight = pViewSh ? pViewSh->GetPageSize( nCurrentPage, sal_False ).Height() : 0; // FIXME: handle multipul page style // it is very strange that the curros position is incorrect when open Word file. // e.g. if current cursor in the top left of the text body of the first page without header, -- cgit