1*b3f79822SAndrew Rist /************************************************************** 2cdf0e10cSrcweir * 3*b3f79822SAndrew Rist * Licensed to the Apache Software Foundation (ASF) under one 4*b3f79822SAndrew Rist * or more contributor license agreements. See the NOTICE file 5*b3f79822SAndrew Rist * distributed with this work for additional information 6*b3f79822SAndrew Rist * regarding copyright ownership. The ASF licenses this file 7*b3f79822SAndrew Rist * to you under the Apache License, Version 2.0 (the 8*b3f79822SAndrew Rist * "License"); you may not use this file except in compliance 9*b3f79822SAndrew Rist * with the License. You may obtain a copy of the License at 10cdf0e10cSrcweir * 11*b3f79822SAndrew Rist * http://www.apache.org/licenses/LICENSE-2.0 12cdf0e10cSrcweir * 13*b3f79822SAndrew Rist * Unless required by applicable law or agreed to in writing, 14*b3f79822SAndrew Rist * software distributed under the License is distributed on an 15*b3f79822SAndrew Rist * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16*b3f79822SAndrew Rist * KIND, either express or implied. See the License for the 17*b3f79822SAndrew Rist * specific language governing permissions and limitations 18*b3f79822SAndrew Rist * under the License. 19cdf0e10cSrcweir * 20*b3f79822SAndrew Rist *************************************************************/ 21*b3f79822SAndrew Rist 22*b3f79822SAndrew Rist 23cdf0e10cSrcweir 24cdf0e10cSrcweir // MARKER(update_precomp.py): autogen include statement, do not remove 25cdf0e10cSrcweir #include "precompiled_sc.hxx" 26cdf0e10cSrcweir 27cdf0e10cSrcweir // INCLUDE --------------------------------------------------------------- 28cdf0e10cSrcweir 29cdf0e10cSrcweir #include <editeng/eeitem.hxx> 30cdf0e10cSrcweir 31cdf0e10cSrcweir #include <editeng/flditem.hxx> 32cdf0e10cSrcweir 33cdf0e10cSrcweir #include <editeng/editview.hxx> 34cdf0e10cSrcweir #include <svx/svdobj.hxx> 35cdf0e10cSrcweir #include <svx/svdpagv.hxx> 36cdf0e10cSrcweir #include <svtools/imapobj.hxx> 37cdf0e10cSrcweir #include <vcl/cursor.hxx> 38cdf0e10cSrcweir #include <vcl/help.hxx> 39cdf0e10cSrcweir #include <tools/urlobj.hxx> 40cdf0e10cSrcweir #include <sfx2/viewfrm.hxx> 41cdf0e10cSrcweir 42cdf0e10cSrcweir #include <unotools/localedatawrapper.hxx> 43cdf0e10cSrcweir 44cdf0e10cSrcweir #include "viewuno.hxx" 45cdf0e10cSrcweir #include "AccessibleDocument.hxx" 46cdf0e10cSrcweir #include <com/sun/star/accessibility/XAccessible.hpp> 47cdf0e10cSrcweir 48cdf0e10cSrcweir #include "gridwin.hxx" 49cdf0e10cSrcweir #include "viewdata.hxx" 50cdf0e10cSrcweir #include "drawview.hxx" 51cdf0e10cSrcweir #include "drwlayer.hxx" 52cdf0e10cSrcweir #include "drawpage.hxx" 53cdf0e10cSrcweir #include "document.hxx" 54cdf0e10cSrcweir #include "notemark.hxx" 55cdf0e10cSrcweir #include "chgtrack.hxx" 56cdf0e10cSrcweir #include "chgviset.hxx" 57cdf0e10cSrcweir #include "dbfunc.hxx" 58cdf0e10cSrcweir #include "tabvwsh.hxx" 59cdf0e10cSrcweir #include "userdat.hxx" 60cdf0e10cSrcweir #include "postit.hxx" 61cdf0e10cSrcweir 62cdf0e10cSrcweir // ----------------------------------------------------------------------- 63cdf0e10cSrcweir 64cdf0e10cSrcweir ScHideTextCursor::ScHideTextCursor( ScViewData* pData, ScSplitPos eW ) : 65cdf0e10cSrcweir pViewData(pData), 66cdf0e10cSrcweir eWhich(eW) 67cdf0e10cSrcweir { 68cdf0e10cSrcweir Window* pWin = pViewData->GetView()->GetWindowByPos( eWhich ); 69cdf0e10cSrcweir if (pWin) 70cdf0e10cSrcweir { 71cdf0e10cSrcweir Cursor* pCur = pWin->GetCursor(); 72cdf0e10cSrcweir if ( pCur && pCur->IsVisible() ) 73cdf0e10cSrcweir pCur->Hide(); 74cdf0e10cSrcweir } 75cdf0e10cSrcweir } 76cdf0e10cSrcweir 77cdf0e10cSrcweir ScHideTextCursor::~ScHideTextCursor() 78cdf0e10cSrcweir { 79cdf0e10cSrcweir Window* pWin = pViewData->GetView()->GetWindowByPos( eWhich ); 80cdf0e10cSrcweir if (pWin) 81cdf0e10cSrcweir { 82cdf0e10cSrcweir // restore text cursor 83cdf0e10cSrcweir if ( pViewData->HasEditView(eWhich) && pWin->HasFocus() ) 84cdf0e10cSrcweir pViewData->GetEditView(eWhich)->ShowCursor( sal_False, sal_True ); 85cdf0e10cSrcweir } 86cdf0e10cSrcweir } 87cdf0e10cSrcweir 88cdf0e10cSrcweir // ----------------------------------------------------------------------- 89cdf0e10cSrcweir 90cdf0e10cSrcweir sal_Bool ScGridWindow::ShowNoteMarker( SCsCOL nPosX, SCsROW nPosY, sal_Bool bKeyboard ) 91cdf0e10cSrcweir { 92cdf0e10cSrcweir sal_Bool bDone = sal_False; 93cdf0e10cSrcweir 94cdf0e10cSrcweir ScDocument* pDoc = pViewData->GetDocument(); 95cdf0e10cSrcweir SCTAB nTab = pViewData->GetTabNo(); 96cdf0e10cSrcweir ScAddress aCellPos( nPosX, nPosY, nTab ); 97cdf0e10cSrcweir 98cdf0e10cSrcweir String aTrackText; 99cdf0e10cSrcweir sal_Bool bLeftEdge = sal_False; 100cdf0e10cSrcweir 101cdf0e10cSrcweir // Change-Tracking 102cdf0e10cSrcweir 103cdf0e10cSrcweir ScChangeTrack* pTrack = pDoc->GetChangeTrack(); 104cdf0e10cSrcweir ScChangeViewSettings* pSettings = pDoc->GetChangeViewSettings(); 105cdf0e10cSrcweir if ( pTrack && pTrack->GetFirst() && pSettings && pSettings->ShowChanges()) 106cdf0e10cSrcweir { 107cdf0e10cSrcweir const ScChangeAction* pFound = NULL; 108cdf0e10cSrcweir const ScChangeAction* pFoundContent = NULL; 109cdf0e10cSrcweir const ScChangeAction* pFoundMove = NULL; 110cdf0e10cSrcweir long nModified = 0; 111cdf0e10cSrcweir const ScChangeAction* pAction = pTrack->GetFirst(); 112cdf0e10cSrcweir while (pAction) 113cdf0e10cSrcweir { 114cdf0e10cSrcweir if ( pAction->IsVisible() && 115cdf0e10cSrcweir ScViewUtil::IsActionShown( *pAction, *pSettings, *pDoc ) ) 116cdf0e10cSrcweir { 117cdf0e10cSrcweir ScChangeActionType eType = pAction->GetType(); 118cdf0e10cSrcweir const ScBigRange& rBig = pAction->GetBigRange(); 119cdf0e10cSrcweir if ( rBig.aStart.Tab() == nTab ) 120cdf0e10cSrcweir { 121cdf0e10cSrcweir ScRange aRange = rBig.MakeRange(); 122cdf0e10cSrcweir 123cdf0e10cSrcweir if ( eType == SC_CAT_DELETE_ROWS ) 124cdf0e10cSrcweir aRange.aEnd.SetRow( aRange.aStart.Row() ); 125cdf0e10cSrcweir else if ( eType == SC_CAT_DELETE_COLS ) 126cdf0e10cSrcweir aRange.aEnd.SetCol( aRange.aStart.Col() ); 127cdf0e10cSrcweir 128cdf0e10cSrcweir if ( aRange.In( aCellPos ) ) 129cdf0e10cSrcweir { 130cdf0e10cSrcweir pFound = pAction; // der letzte gewinnt 131cdf0e10cSrcweir switch ( eType ) 132cdf0e10cSrcweir { 133cdf0e10cSrcweir case SC_CAT_CONTENT : 134cdf0e10cSrcweir pFoundContent = pAction; 135cdf0e10cSrcweir break; 136cdf0e10cSrcweir case SC_CAT_MOVE : 137cdf0e10cSrcweir pFoundMove = pAction; 138cdf0e10cSrcweir break; 139cdf0e10cSrcweir default: 140cdf0e10cSrcweir { 141cdf0e10cSrcweir // added to avoid warnings 142cdf0e10cSrcweir } 143cdf0e10cSrcweir } 144cdf0e10cSrcweir ++nModified; 145cdf0e10cSrcweir } 146cdf0e10cSrcweir } 147cdf0e10cSrcweir if ( eType == SC_CAT_MOVE ) 148cdf0e10cSrcweir { 149cdf0e10cSrcweir ScRange aRange = 150cdf0e10cSrcweir ((const ScChangeActionMove*)pAction)-> 151cdf0e10cSrcweir GetFromRange().MakeRange(); 152cdf0e10cSrcweir if ( aRange.In( aCellPos ) ) 153cdf0e10cSrcweir { 154cdf0e10cSrcweir pFound = pAction; 155cdf0e10cSrcweir ++nModified; 156cdf0e10cSrcweir } 157cdf0e10cSrcweir } 158cdf0e10cSrcweir } 159cdf0e10cSrcweir pAction = pAction->GetNext(); 160cdf0e10cSrcweir } 161cdf0e10cSrcweir 162cdf0e10cSrcweir if ( pFound ) 163cdf0e10cSrcweir { 164cdf0e10cSrcweir if ( pFoundContent && pFound->GetType() != SC_CAT_CONTENT ) 165cdf0e10cSrcweir pFound = pFoundContent; // Content gewinnt 166cdf0e10cSrcweir if ( pFoundMove && pFound->GetType() != SC_CAT_MOVE && 167cdf0e10cSrcweir pFoundMove->GetActionNumber() > 168cdf0e10cSrcweir pFound->GetActionNumber() ) 169cdf0e10cSrcweir pFound = pFoundMove; // Move gewinnt 170cdf0e10cSrcweir 171cdf0e10cSrcweir // bei geloeschten Spalten: Pfeil auf die linke Seite der Zelle 172cdf0e10cSrcweir if ( pFound->GetType() == SC_CAT_DELETE_COLS ) 173cdf0e10cSrcweir bLeftEdge = sal_True; 174cdf0e10cSrcweir 175cdf0e10cSrcweir DateTime aDT = pFound->GetDateTime(); 176cdf0e10cSrcweir aTrackText = pFound->GetUser(); 177cdf0e10cSrcweir aTrackText.AppendAscii(RTL_CONSTASCII_STRINGPARAM( ", " )); 178cdf0e10cSrcweir aTrackText += ScGlobal::pLocaleData->getDate(aDT); 179cdf0e10cSrcweir aTrackText += ' '; 180cdf0e10cSrcweir aTrackText += ScGlobal::pLocaleData->getTime(aDT); 181cdf0e10cSrcweir aTrackText.AppendAscii(RTL_CONSTASCII_STRINGPARAM( ":\n" )); 182cdf0e10cSrcweir String aComStr=pFound->GetComment(); 183cdf0e10cSrcweir if(aComStr.Len()>0) 184cdf0e10cSrcweir { 185cdf0e10cSrcweir aTrackText += aComStr; 186cdf0e10cSrcweir aTrackText.AppendAscii(RTL_CONSTASCII_STRINGPARAM( "\n( " )); 187cdf0e10cSrcweir } 188cdf0e10cSrcweir pFound->GetDescription( aTrackText, pDoc ); 189cdf0e10cSrcweir if(aComStr.Len()>0) 190cdf0e10cSrcweir { 191cdf0e10cSrcweir aTrackText +=')'; 192cdf0e10cSrcweir } 193cdf0e10cSrcweir } 194cdf0e10cSrcweir } 195cdf0e10cSrcweir 196cdf0e10cSrcweir // Notiz nur, wenn sie nicht schon auf dem Drawing-Layer angezeigt wird: 197cdf0e10cSrcweir const ScPostIt* pNote = pDoc->GetNote( aCellPos ); 198cdf0e10cSrcweir if ( (aTrackText.Len() > 0) || (pNote && !pNote->IsCaptionShown()) ) 199cdf0e10cSrcweir { 200cdf0e10cSrcweir sal_Bool bNew = sal_True; 201cdf0e10cSrcweir sal_Bool bFast = sal_False; 202cdf0e10cSrcweir if ( pNoteMarker ) // schon eine Notiz angezeigt 203cdf0e10cSrcweir { 204cdf0e10cSrcweir if ( pNoteMarker->GetDocPos() == aCellPos ) // dieselbe 205cdf0e10cSrcweir bNew = sal_False; // dann stehenlassen 206cdf0e10cSrcweir else 207cdf0e10cSrcweir bFast = sal_True; // sonst sofort 208cdf0e10cSrcweir 209cdf0e10cSrcweir // marker which was shown for ctrl-F1 isn't removed by mouse events 210cdf0e10cSrcweir if ( pNoteMarker->IsByKeyboard() && !bKeyboard ) 211cdf0e10cSrcweir bNew = sal_False; 212cdf0e10cSrcweir } 213cdf0e10cSrcweir if ( bNew ) 214cdf0e10cSrcweir { 215cdf0e10cSrcweir if ( bKeyboard ) 216cdf0e10cSrcweir bFast = sal_True; // keyboard also shows the marker immediately 217cdf0e10cSrcweir 218cdf0e10cSrcweir delete pNoteMarker; 219cdf0e10cSrcweir 220cdf0e10cSrcweir bool bHSplit = pViewData->GetHSplitMode() != SC_SPLIT_NONE; 221cdf0e10cSrcweir bool bVSplit = pViewData->GetVSplitMode() != SC_SPLIT_NONE; 222cdf0e10cSrcweir 223cdf0e10cSrcweir Window* pLeft = pViewData->GetView()->GetWindowByPos( bVSplit ? SC_SPLIT_TOPLEFT : SC_SPLIT_BOTTOMLEFT ); 224cdf0e10cSrcweir Window* pRight = bHSplit ? pViewData->GetView()->GetWindowByPos( bVSplit ? SC_SPLIT_TOPRIGHT : SC_SPLIT_BOTTOMRIGHT ) : 0; 225cdf0e10cSrcweir Window* pBottom = bVSplit ? pViewData->GetView()->GetWindowByPos( SC_SPLIT_BOTTOMLEFT ) : 0; 226cdf0e10cSrcweir Window* pDiagonal = (bHSplit && bVSplit) ? pViewData->GetView()->GetWindowByPos( SC_SPLIT_BOTTOMRIGHT ) : 0; 227cdf0e10cSrcweir DBG_ASSERT( pLeft, "ScGridWindow::ShowNoteMarker - missing top-left grid window" ); 228cdf0e10cSrcweir 229cdf0e10cSrcweir /* If caption is shown from right or bottom windows, adjust 230cdf0e10cSrcweir mapmode to include size of top-left window. */ 231cdf0e10cSrcweir MapMode aMapMode = GetDrawMapMode( sal_True ); 232cdf0e10cSrcweir Size aLeftSize = pLeft->PixelToLogic( pLeft->GetOutputSizePixel(), aMapMode ); 233cdf0e10cSrcweir Point aOrigin = aMapMode.GetOrigin(); 234cdf0e10cSrcweir if( (this == pRight) || (this == pDiagonal) ) 235cdf0e10cSrcweir aOrigin.X() += aLeftSize.Width(); 236cdf0e10cSrcweir if( (this == pBottom) || (this == pDiagonal) ) 237cdf0e10cSrcweir aOrigin.Y() += aLeftSize.Height(); 238cdf0e10cSrcweir aMapMode.SetOrigin( aOrigin ); 239cdf0e10cSrcweir 240cdf0e10cSrcweir pNoteMarker = new ScNoteMarker( pLeft, pRight, pBottom, pDiagonal, 241cdf0e10cSrcweir pDoc, aCellPos, aTrackText, 242cdf0e10cSrcweir aMapMode, bLeftEdge, bFast, bKeyboard ); 243cdf0e10cSrcweir } 244cdf0e10cSrcweir 245cdf0e10cSrcweir bDone = sal_True; // something is shown (old or new) 246cdf0e10cSrcweir } 247cdf0e10cSrcweir 248cdf0e10cSrcweir return bDone; 249cdf0e10cSrcweir } 250cdf0e10cSrcweir 251cdf0e10cSrcweir // ----------------------------------------------------------------------- 252cdf0e10cSrcweir 253cdf0e10cSrcweir void ScGridWindow::RequestHelp(const HelpEvent& rHEvt) 254cdf0e10cSrcweir { 255cdf0e10cSrcweir sal_Bool bDone = sal_False; 256cdf0e10cSrcweir sal_Bool bHelpEnabled = ( rHEvt.GetMode() & ( HELPMODE_BALLOON | HELPMODE_QUICK ) ) != 0; 257cdf0e10cSrcweir SdrView* pDrView = pViewData->GetScDrawView(); 258cdf0e10cSrcweir 259cdf0e10cSrcweir sal_Bool bDrawTextEdit = sal_False; 260cdf0e10cSrcweir if (pDrView) 261cdf0e10cSrcweir bDrawTextEdit = pDrView->IsTextEdit(); 262cdf0e10cSrcweir 263cdf0e10cSrcweir // notes or change tracking 264cdf0e10cSrcweir 265cdf0e10cSrcweir if ( bHelpEnabled && !bDrawTextEdit ) 266cdf0e10cSrcweir { 267cdf0e10cSrcweir Point aPosPixel = ScreenToOutputPixel( rHEvt.GetMousePosPixel() ); 268cdf0e10cSrcweir SCsCOL nPosX; 269cdf0e10cSrcweir SCsROW nPosY; 270cdf0e10cSrcweir pViewData->GetPosFromPixel( aPosPixel.X(), aPosPixel.Y(), eWhich, nPosX, nPosY ); 271cdf0e10cSrcweir 272cdf0e10cSrcweir if ( ShowNoteMarker( nPosX, nPosY, sal_False ) ) 273cdf0e10cSrcweir { 274cdf0e10cSrcweir Window::RequestHelp( rHEvt ); // alte Tip/Balloon ausschalten 275cdf0e10cSrcweir bDone = sal_True; 276cdf0e10cSrcweir } 277cdf0e10cSrcweir } 278cdf0e10cSrcweir 279cdf0e10cSrcweir if ( !bDone && pNoteMarker ) 280cdf0e10cSrcweir { 281cdf0e10cSrcweir if ( pNoteMarker->IsByKeyboard() ) 282cdf0e10cSrcweir { 283cdf0e10cSrcweir // marker which was shown for ctrl-F1 isn't removed by mouse events 284cdf0e10cSrcweir } 285cdf0e10cSrcweir else 286cdf0e10cSrcweir DELETEZ(pNoteMarker); 287cdf0e10cSrcweir } 288cdf0e10cSrcweir 289cdf0e10cSrcweir // Image-Map / Text-URL 290cdf0e10cSrcweir 291cdf0e10cSrcweir if ( bHelpEnabled && !bDone && !nButtonDown ) // nur ohne gedrueckten Button 292cdf0e10cSrcweir { 293cdf0e10cSrcweir String aHelpText; 294cdf0e10cSrcweir Rectangle aPixRect; 295cdf0e10cSrcweir Point aPosPixel = ScreenToOutputPixel( rHEvt.GetMousePosPixel() ); 296cdf0e10cSrcweir 297cdf0e10cSrcweir if ( pDrView ) // URL / Image-Map 298cdf0e10cSrcweir { 299cdf0e10cSrcweir SdrViewEvent aVEvt; 300cdf0e10cSrcweir MouseEvent aMEvt( aPosPixel, 1, 0, MOUSE_LEFT ); 301cdf0e10cSrcweir SdrHitKind eHit = pDrView->PickAnything( aMEvt, SDRMOUSEBUTTONDOWN, aVEvt ); 302cdf0e10cSrcweir 303cdf0e10cSrcweir if ( eHit != SDRHIT_NONE && aVEvt.pObj != NULL ) 304cdf0e10cSrcweir { 305cdf0e10cSrcweir // URL fuer IMapObject unter Pointer ist Hilfetext 306cdf0e10cSrcweir if ( ScDrawLayer::GetIMapInfo( aVEvt.pObj ) ) 307cdf0e10cSrcweir { 308cdf0e10cSrcweir Point aLogicPos = PixelToLogic( aPosPixel ); 309cdf0e10cSrcweir IMapObject* pIMapObj = ScDrawLayer::GetHitIMapObject( 310cdf0e10cSrcweir aVEvt.pObj, aLogicPos, *this ); 311cdf0e10cSrcweir 312cdf0e10cSrcweir if ( pIMapObj ) 313cdf0e10cSrcweir { 314cdf0e10cSrcweir // #44990# Bei ImageMaps die Description anzeigen, wenn vorhanden 315cdf0e10cSrcweir aHelpText = pIMapObj->GetAltText(); 316cdf0e10cSrcweir if (!aHelpText.Len()) 317cdf0e10cSrcweir aHelpText = pIMapObj->GetURL(); 318cdf0e10cSrcweir aPixRect = LogicToPixel(aVEvt.pObj->GetLogicRect()); 319cdf0e10cSrcweir } 320cdf0e10cSrcweir } 321cdf0e10cSrcweir // URL in shape text or at shape itself (URL in text overrides object URL) 322cdf0e10cSrcweir if ( aHelpText.Len() == 0 ) 323cdf0e10cSrcweir { 324cdf0e10cSrcweir if( aVEvt.eEvent == SDREVENT_EXECUTEURL ) 325cdf0e10cSrcweir { 326cdf0e10cSrcweir aHelpText = aVEvt.pURLField->GetURL(); 327cdf0e10cSrcweir aPixRect = LogicToPixel(aVEvt.pObj->GetLogicRect()); 328cdf0e10cSrcweir } 329cdf0e10cSrcweir else 330cdf0e10cSrcweir { 331cdf0e10cSrcweir SdrObject* pObj = 0; 332cdf0e10cSrcweir SdrPageView* pPV = 0; 333cdf0e10cSrcweir Point aMDPos = PixelToLogic( aPosPixel ); 334cdf0e10cSrcweir if ( pDrView->PickObj(aMDPos, pDrView->getHitTolLog(), pObj, pPV, SDRSEARCH_ALSOONMASTER) ) 335cdf0e10cSrcweir { 336cdf0e10cSrcweir if ( pObj->IsGroupObject() ) 337cdf0e10cSrcweir { 338cdf0e10cSrcweir SdrObject* pHit = 0; 339cdf0e10cSrcweir if ( pDrView->PickObj(aMDPos, pDrView->getHitTolLog(), pHit, pPV, SDRSEARCH_DEEP ) ) 340cdf0e10cSrcweir pObj = pHit; 341cdf0e10cSrcweir } 342cdf0e10cSrcweir #ifdef ISSUE66550_HLINK_FOR_SHAPES 343cdf0e10cSrcweir ScMacroInfo* pInfo = ScDrawLayer::GetMacroInfo( pObj ); 344cdf0e10cSrcweir if ( pInfo && (pInfo->GetHlink().getLength() > 0) ) 345cdf0e10cSrcweir { 346cdf0e10cSrcweir aPixRect = LogicToPixel(aVEvt.pObj->GetLogicRect()); 347cdf0e10cSrcweir aHelpText = pInfo->GetHlink(); 348cdf0e10cSrcweir } 349cdf0e10cSrcweir #endif 350cdf0e10cSrcweir } 351cdf0e10cSrcweir } 352cdf0e10cSrcweir } 353cdf0e10cSrcweir } 354cdf0e10cSrcweir } 355cdf0e10cSrcweir 356cdf0e10cSrcweir if ( !aHelpText.Len() ) // Text-URL 357cdf0e10cSrcweir { 358cdf0e10cSrcweir String aUrl; 359cdf0e10cSrcweir if ( GetEditUrl( aPosPixel, NULL, &aUrl, NULL ) ) 360cdf0e10cSrcweir { 361cdf0e10cSrcweir aHelpText = INetURLObject::decode( aUrl, INET_HEX_ESCAPE, 362cdf0e10cSrcweir INetURLObject::DECODE_UNAMBIGUOUS ); 363cdf0e10cSrcweir 364cdf0e10cSrcweir ScDocument* pDoc = pViewData->GetDocument(); 365cdf0e10cSrcweir SCsCOL nPosX; 366cdf0e10cSrcweir SCsROW nPosY; 367cdf0e10cSrcweir SCTAB nTab = pViewData->GetTabNo(); 368cdf0e10cSrcweir pViewData->GetPosFromPixel( aPosPixel.X(), aPosPixel.Y(), eWhich, nPosX, nPosY ); 369cdf0e10cSrcweir const ScPatternAttr* pPattern = pDoc->GetPattern( nPosX, nPosY, nTab ); 370cdf0e10cSrcweir 371cdf0e10cSrcweir ScHideTextCursor aHideCursor( pViewData, eWhich ); // MapMode is changed in GetEditArea 372cdf0e10cSrcweir 373cdf0e10cSrcweir // bForceToTop = sal_False, use the cell's real position 374cdf0e10cSrcweir aPixRect = pViewData->GetEditArea( eWhich, nPosX, nPosY, this, pPattern, sal_False ); 375cdf0e10cSrcweir } 376cdf0e10cSrcweir } 377cdf0e10cSrcweir 378cdf0e10cSrcweir if ( aHelpText.Len() ) 379cdf0e10cSrcweir { 380cdf0e10cSrcweir Rectangle aScreenRect(OutputToScreenPixel(aPixRect.TopLeft()), 381cdf0e10cSrcweir OutputToScreenPixel(aPixRect.BottomRight())); 382cdf0e10cSrcweir 383cdf0e10cSrcweir if ( rHEvt.GetMode() & HELPMODE_BALLOON ) 384cdf0e10cSrcweir Help::ShowBalloon(this,rHEvt.GetMousePosPixel(), aScreenRect, aHelpText); 385cdf0e10cSrcweir else if ( rHEvt.GetMode() & HELPMODE_QUICK ) 386cdf0e10cSrcweir Help::ShowQuickHelp(this,aScreenRect, aHelpText); 387cdf0e10cSrcweir 388cdf0e10cSrcweir bDone = sal_True; 389cdf0e10cSrcweir } 390cdf0e10cSrcweir } 391cdf0e10cSrcweir 392cdf0e10cSrcweir // Basic-Controls 393cdf0e10cSrcweir 394cdf0e10cSrcweir if ( pDrView && bHelpEnabled && !bDone ) 395cdf0e10cSrcweir { 396cdf0e10cSrcweir SdrPageView* pPV = pDrView->GetSdrPageView(); 397cdf0e10cSrcweir DBG_ASSERT( pPV, "SdrPageView* ist NULL" ); 398cdf0e10cSrcweir if (pPV) 399cdf0e10cSrcweir bDone = ((ScDrawPage*)pPV->GetPage())->RequestHelp( this, pDrView, rHEvt ); 400cdf0e10cSrcweir } 401cdf0e10cSrcweir 402cdf0e10cSrcweir // Wenn QuickHelp fuer AutoFill angezeigt wird, nicht wieder wegnehmen lassen 403cdf0e10cSrcweir 404cdf0e10cSrcweir if ( nMouseStatus == SC_GM_TABDOWN && pViewData->GetRefType() == SC_REFTYPE_FILL && 405cdf0e10cSrcweir Help::IsQuickHelpEnabled() ) 406cdf0e10cSrcweir bDone = sal_True; 407cdf0e10cSrcweir 408cdf0e10cSrcweir if (!bDone) 409cdf0e10cSrcweir Window::RequestHelp( rHEvt ); 410cdf0e10cSrcweir } 411cdf0e10cSrcweir 412cdf0e10cSrcweir sal_Bool ScGridWindow::IsMyModel(SdrEditView* pSdrView) 413cdf0e10cSrcweir { 414cdf0e10cSrcweir return pSdrView && 415cdf0e10cSrcweir pSdrView->GetModel() == pViewData->GetDocument()->GetDrawLayer(); 416cdf0e10cSrcweir } 417cdf0e10cSrcweir 418cdf0e10cSrcweir void ScGridWindow::HideNoteMarker() 419cdf0e10cSrcweir { 420cdf0e10cSrcweir DELETEZ(pNoteMarker); 421cdf0e10cSrcweir } 422cdf0e10cSrcweir 423cdf0e10cSrcweir com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible > 424cdf0e10cSrcweir ScGridWindow::CreateAccessible() 425cdf0e10cSrcweir { 426cdf0e10cSrcweir ScAccessibleDocument* pAccessibleDocument = 427cdf0e10cSrcweir new ScAccessibleDocument(GetAccessibleParentWindow()->GetAccessible(), 428cdf0e10cSrcweir pViewData->GetViewShell(), eWhich); 429cdf0e10cSrcweir 430cdf0e10cSrcweir com::sun::star::uno::Reference < ::com::sun::star::accessibility::XAccessible > xAccessible = pAccessibleDocument; 431cdf0e10cSrcweir 432cdf0e10cSrcweir pAccessibleDocument->Init(); 433cdf0e10cSrcweir 434cdf0e10cSrcweir return xAccessible; 435cdf0e10cSrcweir } 436