Kaydet (Commit) 73f89b5d authored tarafından Andre Fische's avatar Andre Fische Kaydeden (comit) Michael Meeks

impress211: #i116911# Accept -1 as special value for multi monitor support.

Conflicts:
	vcl/source/window/wrkwin.cxx
	vcl/win/source/window/salframe.cxx
üst 784909a7
......@@ -188,7 +188,7 @@ void WorkWindow::ShowFullScreenMode( sal_Bool bFullScreenMode, sal_Int32 nDispla
if ( !mbFullScreenMode == !bFullScreenMode )
return;
if( (nDisplayScreen < 0)
if( (nDisplayScreen < -1)
|| (nDisplayScreen >= static_cast<sal_Int32>(Application::GetScreenCount()) ) )
{
nDisplayScreen = GetScreenNumber();
......
......@@ -793,8 +793,9 @@ static void ImplSalCalcFullScreenSize( const WinSalFrame* pFrame,
try
{
uno::Reference< XMultiServiceFactory > xFactory( ::comphelper::getProcessServiceFactory(), UNO_QUERY_THROW );
uno::Reference< XIndexAccess > xMultiMon( xFactory->createInstance(OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.awt.DisplayAccess" ) ) ), UNO_QUERY_THROW );
if( (pFrame->mnDisplay >= 0) && (pFrame->mnDisplay < xMultiMon->getCount()) )
uno::Reference< XIndexAccess > xMultiMon( xFactory->createInstance( "com.sun.star.awt.DisplayAccess" ), UNO_QUERY_THROW );
sal_Int32 nMonitors = xMultiMon->getCount();
if( (pFrame->mnDisplay >= 0) && (pFrame->mnDisplay < nMonitors) )
{
uno::Reference< XPropertySet > xMonitor( xMultiMon->getByIndex( pFrame->mnDisplay ), UNO_QUERY_THROW );
com::sun::star::awt::Rectangle aRect;
......@@ -808,10 +809,28 @@ static void ImplSalCalcFullScreenSize( const WinSalFrame* pFrame,
}
else
{
nScreenX = GetSystemMetrics( SM_XVIRTUALSCREEN );
nScreenY = GetSystemMetrics( SM_YVIRTUALSCREEN );
nScreenDX = GetSystemMetrics( SM_CXVIRTUALSCREEN );
nScreenDY = GetSystemMetrics( SM_CYVIRTUALSCREEN );
Rectangle aCombined;
Reference< XPropertySet > xMonitor( xMultiMon->getByIndex( 0 ), UNO_QUERY_THROW );
com::sun::star::awt::Rectangle aRect;
if( xMonitor->getPropertyValue( OUString( RTL_CONSTASCII_USTRINGPARAM( "ScreenArea" ) ) ) >>= aRect )
{
aCombined.Left() = aRect.X;
aCombined.Top() = aRect.Y;
aCombined.Right() = aRect.X + aRect.Width;
aCombined.Bottom() = aRect.Y + aRect.Height;
for( sal_Int32 i = 1 ; i < nMonitors ; i++ )
{
xMonitor = Reference< XPropertySet >( xMultiMon->getByIndex(i), UNO_QUERY_THROW );
if( xMonitor->getPropertyValue( OUString( RTL_CONSTASCII_USTRINGPARAM( "ScreenArea" ) ) ) >>= aRect )
{
aCombined.Union( Rectangle( aRect.X, aRect.Y, aRect.X+aRect.Width, aRect.Y+aRect.Height ) );
}
}
}
nScreenX = aCombined.Left();
nScreenY = aCombined.Top();
nScreenDX = aCombined.GetWidth();
nScreenDY = aCombined.GetHeight();
}
}
catch( Exception& )
......@@ -920,6 +939,8 @@ WinSalFrame::WinSalFrame()
// -----------------------------------------------------------------------
void WinSalFrame::updateScreenNumber()
{
if( mnDisplay == -1 ) // spans all monitors
return;
WinSalSystem* pSys = static_cast<WinSalSystem*>(ImplGetSalSystem());
if( pSys )
{
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment