summaryrefslogtreecommitdiff
path: root/sc/source/ui/unoobj/viewuno.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'sc/source/ui/unoobj/viewuno.cxx')
-rw-r--r--sc/source/ui/unoobj/viewuno.cxx25
1 files changed, 21 insertions, 4 deletions
diff --git a/sc/source/ui/unoobj/viewuno.cxx b/sc/source/ui/unoobj/viewuno.cxx
index 7646e52c030f..71ed56a93dad 100644
--- a/sc/source/ui/unoobj/viewuno.cxx
+++ b/sc/source/ui/unoobj/viewuno.cxx
@@ -51,6 +51,7 @@
#include <sfx2/viewfrm.hxx>
#include <rtl/uuid.h>
#include <toolkit/helper/convert.hxx>
+#include <toolkit/helper/vclunohelper.hxx>
#include "drawsh.hxx"
#include "drtxtob.hxx"
@@ -114,6 +115,7 @@ const SfxItemPropertyMapEntry* lcl_GetViewOptPropertyMap()
{MAP_CHAR_LEN(SC_UNO_VISAREA), 0, &getCppuType((awt::Rectangle*)0), 0, 0},
{MAP_CHAR_LEN(SC_UNO_ZOOMTYPE), 0, &getCppuType((sal_Int16*)0), 0, 0},
{MAP_CHAR_LEN(SC_UNO_ZOOMVALUE), 0, &getCppuType((sal_Int16*)0), 0, 0},
+ {MAP_CHAR_LEN(SC_UNO_VISAREASCREEN),0, &getCppuType((awt::Rectangle*)0), 0, 0},
{0,0,0,0,0,0}
};
return aViewOptPropertyMap_Impl;
@@ -418,10 +420,15 @@ awt::Rectangle ScViewPaneBase::GetVisArea() const
ScAddress aCell(pViewShell->GetViewData()->GetPosX(eWhichH),
pViewShell->GetViewData()->GetPosY(eWhichV),
pViewShell->GetViewData()->GetTabNo());
- Rectangle aVisRect(pDoc->GetMMRect(aCell.Col(), aCell.Row(), aCell.Col(), aCell.Row(), aCell.Tab()));
-
- aVisRect.SetSize(pWindow->PixelToLogic(pWindow->GetSizePixel(), pWindow->GetDrawMapMode(sal_True)));
-
+ Rectangle aCellRect( pDoc->GetMMRect( aCell.Col(), aCell.Row(), aCell.Col(), aCell.Row(), aCell.Tab() ) );
+ Size aVisSize( pWindow->PixelToLogic( pWindow->GetSizePixel(), pWindow->GetDrawMapMode( sal_True ) ) );
+ Point aVisPos( aCellRect.TopLeft() );
+ if ( pDoc->IsLayoutRTL( aCell.Tab() ) )
+ {
+ aVisPos = aCellRect.TopRight();
+ aVisPos.X() -= aVisSize.Width();
+ }
+ Rectangle aVisRect( aVisPos, aVisSize );
aVisArea = AWTRectangle(aVisRect);
}
}
@@ -2038,6 +2045,16 @@ uno::Any SAL_CALL ScTabViewObj::getPropertyValue( const rtl::OUString& aProperty
else if ( aString.EqualsAscii( SC_UNO_VISAREA ) ) aRet <<= GetVisArea();
else if ( aString.EqualsAscii( SC_UNO_ZOOMTYPE ) ) aRet <<= GetZoomType();
else if ( aString.EqualsAscii( SC_UNO_ZOOMVALUE ) ) aRet <<= GetZoom();
+ else if ( aString.EqualsAscii( SC_UNO_VISAREASCREEN ) )
+ {
+ ScViewData* pViewData = pViewSh->GetViewData();
+ Window* pActiveWin = ( pViewData ? pViewData->GetActiveWin() : NULL );
+ if ( pActiveWin )
+ {
+ Rectangle aRect = pActiveWin->GetWindowExtentsRelative( NULL );
+ aRet <<= AWTRectangle( aRect );
+ }
+ }
}
return aRet;