diff options
Diffstat (limited to 'sc/source/ui/unoobj/viewuno.cxx')
-rw-r--r-- | sc/source/ui/unoobj/viewuno.cxx | 227 |
1 files changed, 122 insertions, 105 deletions
diff --git a/sc/source/ui/unoobj/viewuno.cxx b/sc/source/ui/unoobj/viewuno.cxx index d94767067ebd..adeb0e7a3a6d 100644 --- a/sc/source/ui/unoobj/viewuno.cxx +++ b/sc/source/ui/unoobj/viewuno.cxx @@ -115,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; @@ -136,7 +137,7 @@ SC_SIMPLE_SERVICE_INFO( ScViewPaneBase, "ScViewPaneObj", "com.sun.star.sheet.Spr //------------------------------------------------------------------------ -ScViewPaneBase::ScViewPaneBase(ScTabViewShell* pViewSh, USHORT nP) : +ScViewPaneBase::ScViewPaneBase(ScTabViewShell* pViewSh, sal_uInt16 nP) : pViewShell( pViewSh ), nPane( nP ) { @@ -322,7 +323,7 @@ uno::Reference<table::XCellRange> SAL_CALL ScViewPaneBase::getReferredCells() namespace { - bool lcl_prepareFormShellCall( ScTabViewShell* _pViewShell, USHORT _nPane, FmFormShell*& _rpFormShell, Window*& _rpWindow, SdrView*& _rpSdrView ) + bool lcl_prepareFormShellCall( ScTabViewShell* _pViewShell, sal_uInt16 _nPane, FmFormShell*& _rpFormShell, Window*& _rpWindow, SdrView*& _rpSdrView ) { if ( !_pViewShell ) return false; @@ -419,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); } } @@ -431,7 +437,7 @@ awt::Rectangle ScViewPaneBase::GetVisArea() const //------------------------------------------------------------------------ -ScViewPaneObj::ScViewPaneObj(ScTabViewShell* pViewSh, USHORT nP) : +ScViewPaneObj::ScViewPaneObj(ScTabViewShell* pViewSh, sal_uInt16 nP) : ScViewPaneBase( pViewSh, nP ) { } @@ -487,7 +493,7 @@ public: }; ScTabViewEventListener::ScTabViewEventListener(ScTabViewObj* pObj, uno::Reference< script::vba::XVBAEventProcessor >& rVbaEventsHelper): - pViewObj( pObj ),xVbaEventsHelper( rVbaEventsHelper ), bDelaySelectionEvent( sal_False ), bSelectionChangeOccurred( sal_False ) + pViewObj( pObj ),xVbaEventsHelper( rVbaEventsHelper ), bDelaySelectionEvent( false ), bSelectionChangeOccurred( false ) { } @@ -513,15 +519,15 @@ void ScTabViewEventListener::fireSelectionChangeEvent() { } } - bDelaySelectionEvent = sal_False; - bSelectionChangeOccurred = sal_False; + bDelaySelectionEvent = false; + bSelectionChangeOccurred = false; } sal_Bool SAL_CALL ScTabViewEventListener::mousePressed( const awt::EnhancedMouseEvent& e ) throw (uno::RuntimeException) { // Delay to fire the selection change event if clicking the left mouse button to do selection. - bDelaySelectionEvent = ( e.Buttons == ::com::sun::star::awt::MouseButton::RIGHT ) ? sal_False : sal_True; - bSelectionChangeOccurred = sal_False; + bDelaySelectionEvent = ( e.Buttons == ::com::sun::star::awt::MouseButton::RIGHT ) ? false : sal_True; + bSelectionChangeOccurred = false; // ScTabViewObj::MousePressed should handle process BeforeDoubleClick and BeforeRightClick events return sal_True; @@ -557,7 +563,7 @@ ScTabViewObj::ScTabViewObj( ScTabViewShell* pViewSh ) : aMouseClickHandlers( 0 ), aActivationListeners( 0 ), nPreviousTab( 0 ), - bDrawSelModeSet(sal_False) + bDrawSelModeSet(false) { if (pViewSh) { @@ -662,7 +668,7 @@ void lcl_CallActivate( ScDocShell* pDocSh, SCTAB nTab, sal_Int32 nEvent ) } } -void ScTabViewObj::SheetChanged() +void ScTabViewObj::SheetChanged( bool bSameTabButMoved ) { if ( !GetViewShell() ) return; @@ -676,7 +682,7 @@ void ScTabViewObj::SheetChanged() uno::Reference< uno::XInterface > xSource(xView, uno::UNO_QUERY); aEvent.Source = xSource; aEvent.ActiveSheet = new ScTableSheetObj(pDocSh, pViewData->GetTabNo()); - for ( USHORT n=0; n<aActivationListeners.Count(); n++ ) + for ( sal_uInt16 n=0; n<aActivationListeners.Count(); n++ ) { try { @@ -690,9 +696,10 @@ void ScTabViewObj::SheetChanged() } } - // handle sheet events + /* Handle sheet events, but do not trigger event handlers, if the old + active sheet gets re-activated after inserting/deleting/moving a sheet. */ SCTAB nNewTab = pViewData->GetTabNo(); - if ( nNewTab != nPreviousTab ) + if ( !bSameTabButMoved && (nNewTab != nPreviousTab) ) { lcl_CallActivate( pDocSh, nPreviousTab, SC_SHEETEVENT_UNFOCUS ); lcl_CallActivate( pDocSh, nNewTab, SC_SHEETEVENT_FOCUS ); @@ -753,25 +760,25 @@ uno::Sequence<sal_Int8> SAL_CALL ScTabViewObj::getImplementationId() // XDocumentView -BOOL lcl_TabInRanges( SCTAB nTab, const ScRangeList& rRanges ) +sal_Bool lcl_TabInRanges( SCTAB nTab, const ScRangeList& rRanges ) { for (size_t i = 0, nCount = rRanges.size(); i < nCount; ++i) { const ScRange* pRange = rRanges[ i ]; if ( nTab >= pRange->aStart.Tab() && nTab <= pRange->aEnd.Tab() ) - return TRUE; + return sal_True; } - return FALSE; + return false; } void lcl_ShowObject( ScTabViewShell& rViewSh, ScDrawView& rDrawView, SdrObject* pSelObj ) { - BOOL bFound = FALSE; + sal_Bool bFound = false; SCTAB nObjectTab = 0; SdrModel* pModel = rDrawView.GetModel(); - USHORT nPageCount = pModel->GetPageCount(); - for (USHORT i=0; i<nPageCount && !bFound; i++) + sal_uInt16 nPageCount = pModel->GetPageCount(); + for (sal_uInt16 i=0; i<nPageCount && !bFound; i++) { SdrPage* pPage = pModel->GetPage(i); if (pPage) @@ -782,7 +789,7 @@ void lcl_ShowObject( ScTabViewShell& rViewSh, ScDrawView& rDrawView, SdrObject* { if ( pObject == pSelObj ) { - bFound = TRUE; + bFound = sal_True; nObjectTab = static_cast<SCTAB>(i); } pObject = aIter.Next(); @@ -804,11 +811,11 @@ sal_Bool SAL_CALL ScTabViewObj::select( const uno::Any& aSelection ) ScTabViewShell* pViewSh = GetViewShell(); if ( !pViewSh ) - return FALSE; + return false; //! Type of aSelection can be some specific interface instead of XInterface - BOOL bRet = FALSE; + sal_Bool bRet = false; uno::Reference<uno::XInterface> xInterface(aSelection, uno::UNO_QUERY); if ( !xInterface.is() ) //clear all selections { @@ -820,14 +827,14 @@ sal_Bool SAL_CALL ScTabViewObj::select( const uno::Any& aSelection ) } else //#102232#; if there is no DrawView remove range selection pViewSh->Unmark(); - bRet = TRUE; + bRet = sal_True; } if (bDrawSelModeSet) // remove DrawSelMode if set by API; if necessary it will be set again later { - pViewSh->SetDrawSelMode(sal_False); + pViewSh->SetDrawSelMode(false); pViewSh->UpdateLayerLocks(); - bDrawSelModeSet = sal_False; + bDrawSelModeSet = false; } if (bRet) @@ -861,8 +868,8 @@ sal_Bool SAL_CALL ScTabViewObj::select( const uno::Any& aSelection ) if (pDisp) pDisp->Execute( pFunc->GetSlotID(), SFX_CALLMODE_SYNCHRON ); } - pViewSh->SetDrawShell(FALSE); - pViewSh->SetDrawSelMode(FALSE); // nach dem Dispatcher-Execute + pViewSh->SetDrawShell(false); + pViewSh->SetDrawSelMode(false); // nach dem Dispatcher-Execute // Ranges selektieren @@ -882,7 +889,7 @@ sal_Bool SAL_CALL ScTabViewObj::select( const uno::Any& aSelection ) pViewSh->SetTabNo( pFirst->aStart.Tab() ); pViewSh->DoneBlockMode(); pViewSh->InitOwnBlockMode(); - pViewData->GetMarkData().MarkFromRangeList( rRanges, TRUE ); + pViewData->GetMarkData().MarkFromRangeList( rRanges, sal_True ); pViewSh->MarkDataChanged(); pViewData->GetDocShell()->PostPaintGridAll(); // Markierung (alt&neu) if ( pFirst ) @@ -894,7 +901,7 @@ sal_Bool SAL_CALL ScTabViewObj::select( const uno::Any& aSelection ) //! Methode an der View, um RangeList zu selektieren } - bRet = TRUE; + bRet = sal_True; } } else if ( pShapeImp || xShapeColl.is() ) // Drawing-Layer @@ -915,7 +922,7 @@ sal_Bool SAL_CALL ScTabViewObj::select( const uno::Any& aSelection ) if ( pPV && pObj->GetPage() == pPV->GetPage() ) { pDrawView->MarkObj( pObj, pPV ); - bRet = TRUE; + bRet = sal_True; } } } @@ -957,21 +964,21 @@ sal_Bool SAL_CALL ScTabViewObj::select( const uno::Any& aSelection ) if (pDrawView->IsObjMarkable( pObj, pPV )) pDrawView->MarkObj( pObj, pPV ); else - bAllMarked = sal_False; + bAllMarked = false; } } } } } if (bAllMarked) - bRet = TRUE; + bRet = sal_True; } else - bRet = TRUE; // empty XShapes (all shapes are deselected) + bRet = sal_True; // empty XShapes (all shapes are deselected) } if (bRet) - pViewSh->SetDrawShell(TRUE); + pViewSh->SetDrawShell(sal_True); } } @@ -994,7 +1001,7 @@ uno::Any SAL_CALL ScTabViewObj::getSelection() throw(uno::RuntimeException) if (pDrawView) { const SdrMarkList& rMarkList = pDrawView->GetMarkedObjectList(); - ULONG nMarkCount = rMarkList.GetMarkCount(); + sal_uLong nMarkCount = rMarkList.GetMarkCount(); if (nMarkCount) { // ShapeCollection erzeugen (wie in SdXImpressView::getSelection im Draw) @@ -1003,7 +1010,7 @@ uno::Any SAL_CALL ScTabViewObj::getSelection() throw(uno::RuntimeException) SvxShapeCollection* pShapes = new SvxShapeCollection(); uno::Reference<uno::XInterface> xRet(static_cast<cppu::OWeakObject*>(pShapes)); - for (ULONG i=0; i<nMarkCount; i++) + for (sal_uLong i=0; i<nMarkCount; i++) { SdrObject* pDrawObj = rMarkList.GetMark(i)->GetMarkedSdrObj(); if (pDrawObj) @@ -1039,7 +1046,7 @@ uno::Any SAL_CALL ScTabViewObj::getSelection() throw(uno::RuntimeException) ScMarkData aFilteredMark( rMark ); ScViewUtil::UnmarkFiltered( aFilteredMark, pDocSh->GetDocument()); ScRangeList aRangeList; - aFilteredMark.FillRangeListWithMarks( &aRangeList, FALSE); + aFilteredMark.FillRangeListWithMarks( &aRangeList, false); // Theoretically a selection may start and end on a filtered row. switch ( aRangeList.size() ) { @@ -1079,7 +1086,7 @@ uno::Any SAL_CALL ScTabViewObj::getSelection() throw(uno::RuntimeException) // remember if the selection was from the cursor position without anything selected // (used when rendering the selection) - pObj->SetCursorOnly( TRUE ); + pObj->SetCursorOnly( sal_True ); } } @@ -1101,7 +1108,7 @@ sal_Int32 SAL_CALL ScTabViewObj::getCount() throw(uno::RuntimeException) { SolarMutexGuard aGuard; ScTabViewShell* pViewSh = GetViewShell(); - USHORT nPanes = 0; + sal_uInt16 nPanes = 0; if (pViewSh) { nPanes = 1; @@ -1119,7 +1126,7 @@ uno::Any SAL_CALL ScTabViewObj::getByIndex( sal_Int32 nIndex ) lang::WrappedTargetException, uno::RuntimeException) { SolarMutexGuard aGuard; - uno::Reference<sheet::XViewPane> xPane(GetObjectByIndex_Impl((USHORT)nIndex)); + uno::Reference<sheet::XViewPane> xPane(GetObjectByIndex_Impl((sal_uInt16)nIndex)); if (xPane.is()) return uno::makeAny(xPane); else @@ -1141,7 +1148,7 @@ sal_Bool SAL_CALL ScTabViewObj::hasElements() throw(uno::RuntimeException) // XSpreadsheetView -ScViewPaneObj* ScTabViewObj::GetObjectByIndex_Impl(USHORT nIndex) const +ScViewPaneObj* ScTabViewObj::GetObjectByIndex_Impl(sal_uInt16 nIndex) const { static ScSplitPos ePosHV[4] = { SC_SPLIT_TOPLEFT, SC_SPLIT_BOTTOMLEFT, SC_SPLIT_TOPRIGHT, SC_SPLIT_BOTTOMRIGHT }; @@ -1150,22 +1157,22 @@ ScViewPaneObj* ScTabViewObj::GetObjectByIndex_Impl(USHORT nIndex) const if (pViewSh) { ScSplitPos eWhich = SC_SPLIT_BOTTOMLEFT; // default Position - BOOL bError = FALSE; + sal_Bool bError = false; ScViewData* pViewData = pViewSh->GetViewData(); - BOOL bHor = ( pViewData->GetHSplitMode() != SC_SPLIT_NONE ); - BOOL bVer = ( pViewData->GetVSplitMode() != SC_SPLIT_NONE ); + sal_Bool bHor = ( pViewData->GetHSplitMode() != SC_SPLIT_NONE ); + sal_Bool bVer = ( pViewData->GetVSplitMode() != SC_SPLIT_NONE ); if ( bHor && bVer ) { // links oben, links unten, rechts oben, rechts unten - wie in Excel if ( nIndex < 4 ) eWhich = ePosHV[nIndex]; else - bError = TRUE; + bError = sal_True; } else if ( bHor ) { if ( nIndex > 1 ) - bError = TRUE; + bError = sal_True; else if ( nIndex == 1 ) eWhich = SC_SPLIT_BOTTOMRIGHT; // sonst SC_SPLIT_BOTTOMLEFT @@ -1173,16 +1180,16 @@ ScViewPaneObj* ScTabViewObj::GetObjectByIndex_Impl(USHORT nIndex) const else if ( bVer ) { if ( nIndex > 1 ) - bError = TRUE; + bError = sal_True; else if ( nIndex == 0 ) eWhich = SC_SPLIT_TOPLEFT; // sonst SC_SPLIT_BOTTOMLEFT } else if ( nIndex > 0 ) - bError = TRUE; // nicht geteilt: nur 0 gueltig + bError = sal_True; // nicht geteilt: nur 0 gueltig if (!bError) - return new ScViewPaneObj( pViewSh, sal::static_int_cast<USHORT>(eWhich) ); + return new ScViewPaneObj( pViewSh, sal::static_int_cast<sal_uInt16>(eWhich) ); } return NULL; @@ -1268,11 +1275,11 @@ uno::Reference< uno::XInterface > ScTabViewObj::GetClickedObject(const Point& rP Window* pActiveWin = pData->GetActiveWin(); Point aPos = pActiveWin->PixelToLogic(rPoint); - USHORT nHitLog = (USHORT) pActiveWin->PixelToLogic( + sal_uInt16 nHitLog = (sal_uInt16) pActiveWin->PixelToLogic( Size(pDrawView->GetHitTolerancePixel(),0)).Width(); sal_uInt32 nCount(pDrawPage->GetObjCount()); - sal_Bool bFound(sal_False); + sal_Bool bFound(false); sal_uInt32 i(0); while (i < nCount && !bFound) { @@ -1307,7 +1314,7 @@ bool ScTabViewObj::IsMouseListening() const sal_Bool ScTabViewObj::MousePressed( const awt::MouseEvent& e ) throw (::uno::RuntimeException) { - sal_Bool bReturn(sal_False); + sal_Bool bReturn(false); uno::Reference< uno::XInterface > xTarget = GetClickedObject(Point(e.X, e.Y)); if (aMouseClickHandlers.Count() && xTarget.is()) @@ -1321,7 +1328,7 @@ sal_Bool ScTabViewObj::MousePressed( const awt::MouseEvent& e ) aMouseEvent.PopupTrigger = e.PopupTrigger; aMouseEvent.Target = xTarget; - for ( USHORT n=0; n<aMouseClickHandlers.Count(); n++ ) + for ( sal_uInt16 n=0; n<aMouseClickHandlers.Count(); n++ ) { try { @@ -1365,7 +1372,7 @@ sal_Bool ScTabViewObj::MousePressed( const awt::MouseEvent& e ) /*ErrCode eRet =*/ pDocSh->CallXScript( *pScript, aParams, aRet, aOutArgsIndex, aOutArgs ); // look for a boolean return value of true - sal_Bool bRetValue = sal_False; + sal_Bool bRetValue = false; if (aRet >>= bRetValue) { if (bRetValue) @@ -1398,7 +1405,7 @@ sal_Bool ScTabViewObj::MousePressed( const awt::MouseEvent& e ) sal_Bool ScTabViewObj::MouseReleased( const awt::MouseEvent& e ) throw (uno::RuntimeException) { - sal_Bool bReturn(sal_False); + sal_Bool bReturn(false); if (aMouseClickHandlers.Count()) { @@ -1415,7 +1422,7 @@ sal_Bool ScTabViewObj::MouseReleased( const awt::MouseEvent& e ) aMouseEvent.PopupTrigger = e.PopupTrigger; aMouseEvent.Target = xTarget; - for ( USHORT n=0; n<aMouseClickHandlers.Count(); n++ ) + for ( sal_uInt16 n=0; n<aMouseClickHandlers.Count(); n++ ) { try { @@ -1441,10 +1448,10 @@ void ScTabViewObj::StartMouseListening() void ScTabViewObj::EndMouseListening() { - USHORT nCount(aMouseClickHandlers.Count()); + sal_uInt16 nCount(aMouseClickHandlers.Count()); lang::EventObject aEvent; aEvent.Source = (cppu::OWeakObject*)this; - for ( USHORT n=0; n<nCount; n++ ) + for ( sal_uInt16 n=0; n<nCount; n++ ) { try { @@ -1463,10 +1470,10 @@ void ScTabViewObj::StartActivationListening() void ScTabViewObj::EndActivationListening() { - USHORT nCount = aActivationListeners.Count(); + sal_uInt16 nCount = aActivationListeners.Count(); lang::EventObject aEvent; aEvent.Source = (cppu::OWeakObject*)this; - for ( USHORT n=0; n<nCount; n++ ) + for ( sal_uInt16 n=0; n<nCount; n++ ) { try { @@ -1486,7 +1493,7 @@ void SAL_CALL ScTabViewObj::addEnhancedMouseClickHandler( const uno::Reference< if (aListener.is()) { - USHORT nCount = aMouseClickHandlers.Count(); + sal_uInt16 nCount = aMouseClickHandlers.Count(); uno::Reference<awt::XEnhancedMouseClickHandler> *pObj = new uno::Reference<awt::XEnhancedMouseClickHandler>( aListener ); aMouseClickHandlers.Insert( pObj, nCount ); @@ -1500,8 +1507,8 @@ void SAL_CALL ScTabViewObj::removeEnhancedMouseClickHandler( const uno::Referenc throw (uno::RuntimeException) { SolarMutexGuard aGuard; - USHORT nCount = aMouseClickHandlers.Count(); - for ( USHORT n=nCount; n--; ) + sal_uInt16 nCount = aMouseClickHandlers.Count(); + for ( sal_uInt16 n=nCount; n--; ) { uno::Reference<awt::XEnhancedMouseClickHandler> *pObj = aMouseClickHandlers[n]; if ( *pObj == aListener ) @@ -1520,7 +1527,7 @@ void SAL_CALL ScTabViewObj::addActivationEventListener( const uno::Reference< sh if (aListener.is()) { - USHORT nCount = aActivationListeners.Count(); + sal_uInt16 nCount = aActivationListeners.Count(); uno::Reference<sheet::XActivationEventListener> *pObj = new uno::Reference<sheet::XActivationEventListener>( aListener ); aActivationListeners.Insert( pObj, nCount ); @@ -1534,8 +1541,8 @@ void SAL_CALL ScTabViewObj::removeActivationEventListener( const uno::Reference< throw (uno::RuntimeException) { SolarMutexGuard aGuard; - USHORT nCount = aActivationListeners.Count(); - for ( USHORT n=nCount; n--; ) + sal_uInt16 nCount = aActivationListeners.Count(); + for ( sal_uInt16 n=nCount; n--; ) { uno::Reference<sheet::XActivationEventListener> *pObj = aActivationListeners[n]; if ( *pObj == aListener ) @@ -1551,12 +1558,12 @@ INT16 ScTabViewObj::GetZoom(void) const if (pViewSh) { const Fraction& rZoomY = pViewSh->GetViewData()->GetZoomY(); // Y wird angezeigt - return (INT16)(( rZoomY.GetNumerator() * 100 ) / rZoomY.GetDenominator()); + return (sal_Int16)(( rZoomY.GetNumerator() * 100 ) / rZoomY.GetDenominator()); } return 0; } -void ScTabViewObj::SetZoom(INT16 nZoom) +void ScTabViewObj::SetZoom(sal_Int16 nZoom) { ScTabViewShell* pViewSh = GetViewShell(); if (pViewSh) @@ -1573,7 +1580,7 @@ void ScTabViewObj::SetZoom(INT16 nZoom) } } Fraction aFract( nZoom, 100 ); - pViewSh->SetZoom( aFract, aFract, TRUE ); + pViewSh->SetZoom( aFract, aFract, sal_True ); pViewSh->PaintGrid(); pViewSh->PaintTop(); pViewSh->PaintLeft(); @@ -1582,9 +1589,9 @@ void ScTabViewObj::SetZoom(INT16 nZoom) } } -INT16 ScTabViewObj::GetZoomType(void) const +sal_Int16 ScTabViewObj::GetZoomType(void) const { - INT16 aZoomType = view::DocumentZoomType::OPTIMAL; + sal_Int16 aZoomType = view::DocumentZoomType::OPTIMAL; ScTabViewShell* pViewSh = GetViewShell(); if (pViewSh) { @@ -1611,7 +1618,7 @@ INT16 ScTabViewObj::GetZoomType(void) const return aZoomType; } -void ScTabViewObj::SetZoomType(INT16 aZoomType) +void ScTabViewObj::SetZoomType(sal_Int16 aZoomType) { ScTabViewShell* pViewSh = GetViewShell(); if (pViewSh) @@ -1654,11 +1661,11 @@ void ScTabViewObj::SetZoomType(INT16 aZoomType) { case SVX_ZOOM_WHOLEPAGE: case SVX_ZOOM_PAGEWIDTH: - pView->SetZoomType( eZoomType, TRUE ); + pView->SetZoomType( eZoomType, sal_True ); break; default: - pView->SetZoomType( SVX_ZOOM_PERCENT, TRUE ); + pView->SetZoomType( SVX_ZOOM_PERCENT, sal_True ); } SetZoom( nZoom ); } @@ -1678,7 +1685,7 @@ sal_Bool SAL_CALL ScTabViewObj::getIsWindowSplit() throw(uno::RuntimeException) pViewData->GetVSplitMode() == SC_SPLIT_NORMAL ); } - return FALSE; + return false; } sal_Bool SAL_CALL ScTabViewObj::hasFrozenPanes() throw(uno::RuntimeException) @@ -1694,7 +1701,7 @@ sal_Bool SAL_CALL ScTabViewObj::hasFrozenPanes() throw(uno::RuntimeException) pViewData->GetVSplitMode() == SC_SPLIT_FIX ); } - return FALSE; + return false; } sal_Int32 SAL_CALL ScTabViewObj::getSplitHorizontal() throw(uno::RuntimeException) @@ -1740,7 +1747,7 @@ sal_Int32 SAL_CALL ScTabViewObj::getSplitColumn() throw(uno::RuntimeException) SCsCOL nCol; SCsROW nRow; - pViewData->GetPosFromPixel( nSplit, 0, ePos, nCol, nRow, FALSE ); + pViewData->GetPosFromPixel( nSplit, 0, ePos, nCol, nRow, false ); if ( nCol > 0 ) return nCol; } @@ -1762,7 +1769,7 @@ sal_Int32 SAL_CALL ScTabViewObj::getSplitRow() throw(uno::RuntimeException) ScSplitPos ePos = SC_SPLIT_TOPLEFT; // es ist vertikal geteilt SCsCOL nCol; SCsROW nRow; - pViewData->GetPosFromPixel( 0, nSplit, ePos, nCol, nRow, FALSE ); + pViewData->GetPosFromPixel( 0, nSplit, ePos, nCol, nRow, false ); if ( nRow > 0 ) return nRow; } @@ -1777,8 +1784,8 @@ void SAL_CALL ScTabViewObj::splitAtPosition( sal_Int32 nPixelX, sal_Int32 nPixel ScTabViewShell* pViewSh = GetViewShell(); if (pViewSh) { - pViewSh->SplitAtPixel( Point( nPixelX, nPixelY ), TRUE, TRUE ); - pViewSh->FreezeSplitters( FALSE ); + pViewSh->SplitAtPixel( Point( nPixelX, nPixelY ), sal_True, sal_True ); + pViewSh->FreezeSplitters( false ); pViewSh->InvalidateSplit(); } } @@ -1800,11 +1807,11 @@ void SAL_CALL ScTabViewObj::freezeAtPosition( sal_Int32 nColumns, sal_Int32 nRow aWinStart = pWin->GetPosPixel(); ScViewData* pViewData = pViewSh->GetViewData(); - Point aSplit(pViewData->GetScrPos( (SCCOL)nColumns, (SCROW)nRows, SC_SPLIT_BOTTOMLEFT, TRUE )); + Point aSplit(pViewData->GetScrPos( (SCCOL)nColumns, (SCROW)nRows, SC_SPLIT_BOTTOMLEFT, sal_True )); aSplit += aWinStart; - pViewSh->SplitAtPixel( aSplit, TRUE, TRUE ); - pViewSh->FreezeSplitters( TRUE ); + pViewSh->SplitAtPixel( aSplit, sal_True, sal_True ); + pViewSh->FreezeSplitters( sal_True ); pViewSh->InvalidateSplit(); } } @@ -1824,8 +1831,8 @@ void SAL_CALL ScTabViewObj::removeSelectionChangeListener( throw(uno::RuntimeException) { SolarMutexGuard aGuard; - USHORT nCount = aSelectionListeners.Count(); - for ( USHORT n=nCount; n--; ) + sal_uInt16 nCount = aSelectionListeners.Count(); + for ( sal_uInt16 n=nCount; n--; ) { uno::Reference<view::XSelectionChangeListener> *pObj = aSelectionListeners[n]; if ( *pObj == xListener ) //! wozu der Mumpitz mit queryInterface? @@ -1840,7 +1847,7 @@ void ScTabViewObj::SelectionChanged() { lang::EventObject aEvent; aEvent.Source.set(static_cast<cppu::OWeakObject*>(this)); - for ( USHORT n=0; n<aSelectionListeners.Count(); n++ ) + for ( sal_uInt16 n=0; n<aSelectionListeners.Count(); n++ ) (*aSelectionListeners[n])->selectionChanged( aEvent ); // handle sheet events @@ -2053,6 +2060,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; @@ -2077,8 +2094,8 @@ void SAL_CALL ScTabViewObj::removePropertyChangeListener( const ::rtl::OUString& uno::RuntimeException) { SolarMutexGuard aGuard; - USHORT nCount = aPropertyChgListeners.Count(); - for ( USHORT n=nCount; n--; ) + sal_uInt16 nCount = aPropertyChgListeners.Count(); + for ( sal_uInt16 n=nCount; n--; ) { uno::Reference<beans::XPropertyChangeListener> *pObj = aPropertyChgListeners[n]; if ( *pObj == xListener ) //! wozu der Mumpitz mit queryInterface? @@ -2109,7 +2126,7 @@ void ScTabViewObj::VisAreaChanged() { beans::PropertyChangeEvent aEvent; aEvent.Source.set(static_cast<cppu::OWeakObject*>(this)); - for ( USHORT n=0; n<aPropertyChgListeners.Count(); n++ ) + for ( sal_uInt16 n=0; n<aPropertyChgListeners.Count(); n++ ) (*aPropertyChgListeners[n])->propertyChange( aEvent ); } @@ -2124,9 +2141,9 @@ void SAL_CALL ScTabViewObj::startRangeSelection( if (pViewSh) { String aInitVal, aTitle; - BOOL bCloseOnButtonUp = FALSE; - BOOL bSingleCell = FALSE; - BOOL bMultiSelection = FALSE; + sal_Bool bCloseOnButtonUp = false; + sal_Bool bSingleCell = false; + sal_Bool bMultiSelection = false; rtl::OUString aStrVal; const beans::PropertyValue* pPropArray = aArguments.getConstArray(); @@ -2181,8 +2198,8 @@ void SAL_CALL ScTabViewObj::removeRangeSelectionListener( throw(uno::RuntimeException) { SolarMutexGuard aGuard; - USHORT nCount = aRangeSelListeners.Count(); - for ( USHORT n=nCount; n--; ) + sal_uInt16 nCount = aRangeSelListeners.Count(); + for ( sal_uInt16 n=nCount; n--; ) { uno::Reference<sheet::XRangeSelectionListener> *pObj = aRangeSelListeners[n]; if ( *pObj == xListener ) @@ -2208,8 +2225,8 @@ void SAL_CALL ScTabViewObj::removeRangeSelectionChangeListener( throw(uno::RuntimeException) { SolarMutexGuard aGuard; - USHORT nCount = aRangeChgListeners.Count(); - for ( USHORT n=nCount; n--; ) + sal_uInt16 nCount = aRangeChgListeners.Count(); + for ( sal_uInt16 n=nCount; n--; ) { uno::Reference<sheet::XRangeSelectionChangeListener> *pObj = aRangeChgListeners[n]; if ( *pObj == xListener ) @@ -2226,7 +2243,7 @@ void ScTabViewObj::RangeSelDone( const String& rText ) aEvent.Source.set(static_cast<cppu::OWeakObject*>(this)); aEvent.RangeDescriptor = rtl::OUString( rText ); - for ( USHORT n=0; n<aRangeSelListeners.Count(); n++ ) + for ( sal_uInt16 n=0; n<aRangeSelListeners.Count(); n++ ) (*aRangeSelListeners[n])->done( aEvent ); } @@ -2236,7 +2253,7 @@ void ScTabViewObj::RangeSelAborted( const String& rText ) aEvent.Source.set(static_cast<cppu::OWeakObject*>(this)); aEvent.RangeDescriptor = rtl::OUString( rText ); - for ( USHORT n=0; n<aRangeSelListeners.Count(); n++ ) + for ( sal_uInt16 n=0; n<aRangeSelListeners.Count(); n++ ) (*aRangeSelListeners[n])->aborted( aEvent ); } @@ -2246,7 +2263,7 @@ void ScTabViewObj::RangeSelChanged( const String& rText ) aEvent.Source.set(static_cast<cppu::OWeakObject*>(this)); aEvent.RangeDescriptor = rtl::OUString( rText ); - for ( USHORT n=0; n<aRangeChgListeners.Count(); n++ ) + for ( sal_uInt16 n=0; n<aRangeChgListeners.Count(); n++ ) (*aRangeChgListeners[n])->descriptorChanged( aEvent ); } @@ -2345,7 +2362,7 @@ void SAL_CALL ScTabViewObj::insertTransferable( const ::com::sun::star::uno::Ref SolarMutexGuard aGuard; ScEditShell* pShell = PTR_CAST( ScEditShell, GetViewShell()->GetViewFrame()->GetDispatcher()->GetShell(0) ); if (pShell) - pShell->GetEditView()->InsertText( xTrans, ::rtl::OUString(), FALSE ); + pShell->GetEditView()->InsertText( xTrans, ::rtl::OUString(), false ); else { ScDrawTextObjectBar* pTextShell = PTR_CAST( ScDrawTextObjectBar, GetViewShell()->GetViewFrame()->GetDispatcher()->GetShell(0) ); @@ -2356,7 +2373,7 @@ void SAL_CALL ScTabViewObj::insertTransferable( const ::com::sun::star::uno::Ref OutlinerView* pOutView = pView->GetTextEditOutlinerView(); if ( pOutView ) { - pOutView->GetEditView().InsertText( xTrans, ::rtl::OUString(), FALSE ); + pOutView->GetEditView().InsertText( xTrans, ::rtl::OUString(), false ); return; } } |